Skip to content
Skills Library
AI & agents · Building & coding

phaseo-agent-sdk-typescript

/phaseo-agent-sdk-typescript

Builds agent loops on the Phaseo Gateway with the TypeScript Agent SDK, `@phaseo/agent-sdk`: `createAgent`, `defineTool`, `createGatewayAgentClient`, bounded model retries, resumable runs from app-owned state, presets, managed search and concurrent tool calls. Use when a project imports `@phaseo/agent-sdk` or needs a tool-calling agent, a resumable workflow or a human review step on Phaseo. Not for single requests (use phaseo-sdk-typescript) or agent SDKs in other languages.

Repository
phaseo ↗
Licence
AGPL-3.0
Last repository change
27.10.2026

Assessment and security

100/ 100Class: good
Format25 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content35 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
3
Scripts
0
HTML comments
0
URLs in SKILL.md
0
Deprecation

No signals detected. Repository changed on 27.10.2026, without references to retired models or APIs.

Licence

AGPL-3.0, copyleft: przeróbki udostępniane innym muszą mieć tę samą licencję.

What it does and when to use it

Builds agent loops on the Phaseo Gateway with the TypeScript Agent SDK, `@phaseo/agent-sdk`: `createAgent`, `defineTool`, `createGatewayAgentClient`, bounded model retries, resumable runs from app-owned state, presets, managed search and concurrent tool calls. Use when a project imports `@phaseo/agent-sdk` or needs a tool-calling agent, a resumable workflow or a human review step on Phaseo. Not for single requests (use phaseo-sdk-typescript) or agent SDKs in other languages.

Original author description

Builds agent loops on the Phaseo Gateway with the TypeScript Agent SDK, `@phaseo/agent-sdk`: `createAgent`, `defineTool`, `createGatewayAgentClient`, bounded model retries, resumable runs from app-owned state, presets, managed search and concurrent tool calls. Use when a project imports `@phaseo/agent-sdk` or needs a tool-calling agent, a resumable workflow or a human review step on Phaseo. Not for single requests (use phaseo-sdk-typescript) or agent SDKs in other languages.

How it works

  1. Outcome
  2. Workflow
  3. Canonical setup
  4. Rules
  5. Validation
Original SKILL.md headings · 88 lines, 741 words
SKILL.md preview
---
name: phaseo-agent-sdk-typescript
description: "Builds agent loops on the Phaseo Gateway with the TypeScript Agent SDK, `@phaseo/agent-sdk`: `createAgent`, `defineTool`, `createGatewayAgentClient`, bounded model retries, resumable runs from app-owned state, presets, managed search and concurrent tool calls. Use when a project imports `@phaseo/agent-sdk` or needs a tool-calling agent, a resumable workflow or a human review step on Phaseo. Not for single requests (use phaseo-sdk-typescript) or agent SDKs in other languages."
license: MIT
---

# Phaseo Agent SDK TypeScript

Use this skill when the repository should implement agent-style workflows through `@phaseo/agent-sdk`.

## Outcome
Deliver a working agent integration that:
- defines one clear `createAgent()` entrypoint
- reads credentials from `PHASEO_API_KEY`
- uses `createGatewayAgentClient()` for live gateway execution
- supports resumable runs from application-owned state
- can retry bounded transient model failures before persisting a terminal run failure
- can target dashboard-managed preset routing directly instead of hard-coding one model id in application code
- can carry gateway-native controls such as structured outputs, managed search tools, plugin policy, and tool choice when the workflow needs them
- keeps runtime tools small and deterministic
- can fan out multiple independent local tool calls concurrently without losing deterministic tool-result ordering

## Workflow
1. Create or reuse one shared gateway client path through `createGatewayAgentClient()`.
2. Keep the first agent narrow: one agent and one or two tools.
3. Keep one-shot runs simple and in-process.
4. If the app needs resumability, persist the returned run state in the repo's own database, cache, or workflow record instead of adding an SDK-owned persistence layer.
5. If transient provider/model failures are acceptable, set a bounded `modelRetry` policy on the agent or the specific run instead of requeueing blindly outside the SDK.
6. If routing, prompts, or parameter defaults should stay outside application code, prefer `preset` on the agent or run over manually hard-coding `model: "@slug"` strings everywhere.
7. Treat tool inputs and outputs as durable step data, not transient console output.
8. If one agent family should always use managed search or strict JSON, configure that once on `createGatewayAgentClient()` with `gatewayTools`, `toolChoice`, `responseFormat`, and `plugins`.
9. If one model turn can safely call several local tools independently, use `toolExecution.toolConcurrency` instead of manually splitting the workflow across multiple agent steps.
10. Validate the exact run loop you changed, not just the package import surface.

## Canonical setup

```ts
import {
  createAgent,
  createGatewayAgentClient,
  defineTool,
} from "@phaseo/agent-sdk";

const lookupDocs = defineTool({
  id: "lookup-docs",
  description: "Look up internal docs by slug.",
  async execute(input: { slug: string }) {
    return { slug: input.slug };
  },
});

const agent = createAgent({
  id: "docs-agent",
  model: "phaseo/free",
  instructions: "Use tools when helpful and finish with a concise answer.",
  tools: [lookupDocs],
});

const result = await agent.run({
  input: "Find the docs page for presets.",
  client: createGatewayAgentClient({
    clientOptions: {
      apiKey: process.env.PHASEO_API_KEY!,
    },
  }),
});
```

## Rules

- Prefer the Responses API-backed adapter for new agent loops.
- Keep system instructions on the agent definition, not duplicated in every call site.
- Keep returned run state owned by the application rather than introducing an SDK-level persistence subsystem.
- If the repo needs approval points, leave clear seams for pause/continue instead of hiding review inside a tool callback.
- Log run ids and gateway request ids when the surrounding app already has operational logging.
- If one workflow always needs grounded research, prefer adapter-level `gatewayTools` plus `toolChoice` over rebuilding upstream-native tool definitions at every run call.
- For coding-style workflows, prefer a small set of local runtime tools plus an explicit `humanReview` seam over one generic upstream-managed tool surface.
- Use persisted `requestId`, `nativeResponseId`, and `modelAttempts` on step records when the surrounding application needs a stable correlation bridge back to gateway logs and upstream responses.
- Catch `AgentGatewayError` when application code needs to distinguish policy blocks, provider diagnostics, or routing failures from generic transport errors.
- Expect failed runs and steps caused by `AgentGatewayError` to persist `errorDetails`.
- Use `step.failed`, `step.completed`, `run.resumed`, `model.failed`, or `tool.failed` when the application needs exact lifecycle hooks instead of inferring state from generic logs.
- Use `includeMeta: true` on `createGatewayAgentClient()` when successful steps should retain gateway response metadata such as routing or plugin execution details on `responseMeta`.
- Expect model failures that still throw after the configured retries, or thrown tool/parse-output failures, to persist both the run and the active step as `failed`.
- Expect retrying model steps to persist `modelAttempts`.
- Expect concurrent local tool execution to preserve tool-result message order even when tool completion order differs.
- Define `parameters` on local runtime tools when the model should target a constrained JSON input contract instead of a generic free-form object payload.

## Validation

- one successful local build or typecheck on the agent package or module you changed
- one docs/example path that reflects the shipped API if the SDK surface changed
- one end-to-end run or a deterministic mocked run loop when the repository supports it
Files in this package (3)
  • SKILL.md 6 KB
  • agents/openai.yaml 1 KB
  • evals/evals.json 1 KB

Versions

The database has no other skills named phaseo-agent-sdk-typescript.

Identical content appears in 1 other GitHub folders. We show one copy with the highest score.

Database snapshot: 13.11.2026 · package version 68b206b0c2b4 (SHA-256 digest of the entire package)

Downloads in the last 30 days: 0 · ranking

Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 90phaseo-web-search-tools
    Configures and debugs web grounding on Phaseo: the `gateway:web_search` and `gateway:web_fetch` tools, native provider web search, citations and request-log checks for search-heavy flows. Use when responses need current web information or citations, or search tool calls fail or…
  • 100phaseo-sdk-typescript
    Builds Phaseo integrations with the official TypeScript and JavaScript SDK, `@phaseo/sdk`: one shared client, `generateResponse` and streaming, images, audio, async video, presets, model discovery and request IDs for debugging. Use when a project depends on or should adopt…
  • 100agent-sdk-quickstart
    Build a first agent with the Claude Agent SDK (TypeScript or Python): install, run query(), read result messages, restrict tools and permissions, add custom tools through an in-process MCP server, and guard tool calls with hooks. Also explains when to pick the Agent SDK, the…
  • 90agent-sdk-dev
    Use when creating, reviewing, or verifying Claude Agent SDK applications in Python or TypeScript, including new SDK app scaffolding guidance, SDK setup checks, verifier-agent style reviews, dependency/version checks, and best-practice audits.
  • 96typescript-sdk
    TypeScript SDK patterns for Opik. Use when working in sdks/typescript.
  • 100claude-agent-sdk
    This skill should be used when developing applications with the Claude Agent SDK, answering questions about SDK features and APIs, implementing SDK patterns, or troubleshooting SDK integration. Covers Python and TypeScript APIs, core features, advanced features, and integrations.

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.