@zvada/agent-server 0.3.23 → 0.3.25
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +64 -0
- package/README.md +14 -5
- package/dist/accounts/chatgpt.js +144 -0
- package/dist/accounts/check.js +71 -0
- package/dist/accounts/claude.js +80 -0
- package/dist/accounts/endpoint.js +104 -0
- package/dist/accounts/http.js +58 -0
- package/dist/accounts/index.js +9 -0
- package/dist/client/client.js +745 -0
- package/dist/client/connection.js +338 -0
- package/dist/client/history.js +49 -0
- package/dist/client/index.js +6 -0
- package/dist/client/listeners.js +19 -0
- package/dist/client/logins.js +92 -0
- package/dist/client/rpc.js +105 -0
- package/dist/client/streams.js +432 -0
- package/dist/client/transports.js +118 -0
- package/dist/client/turns.js +122 -0
- package/dist/core/agents/acp/acp-agent.js +425 -0
- package/dist/core/agents/acp/adapter.js +231 -0
- package/dist/core/agents/acp/client.js +222 -0
- package/dist/core/agents/acp/known-agents.js +57 -0
- package/dist/core/agents/acp/mappings.js +164 -0
- package/dist/core/agents/acp/requests.js +79 -0
- package/dist/core/agents/attachments.js +14 -0
- package/dist/core/agents/base.js +64 -0
- package/dist/core/agents/claude-code/adapter.js +474 -0
- package/dist/core/agents/claude-code/approvals.js +245 -0
- package/dist/core/agents/claude-code/claude-agent.js +319 -0
- package/dist/core/agents/claude-code/credentials.js +142 -0
- package/dist/core/agents/claude-code/events.js +11 -0
- package/dist/core/agents/claude-code/login.js +217 -0
- package/dist/core/agents/claude-code/mcp.js +181 -0
- package/dist/core/agents/claude-code/models.js +74 -0
- package/dist/core/agents/claude-code/options.js +240 -0
- package/dist/core/agents/claude-code/outcome.js +204 -0
- package/dist/core/agents/claude-code/results.js +58 -0
- package/dist/core/agents/claude-code/sdk-pair.js +59 -0
- package/dist/core/agents/claude-code/session.js +593 -0
- package/dist/core/agents/claude-code/spawn.js +125 -0
- package/dist/core/agents/claude-code/spend.js +118 -0
- package/dist/core/agents/claude-code/tools.js +131 -0
- package/dist/core/agents/claude-code/turn-usage.js +121 -0
- package/dist/core/agents/claude-code/turn.js +199 -0
- package/dist/core/agents/codex-app-server/adapter.js +463 -0
- package/dist/core/agents/codex-app-server/client.js +338 -0
- package/dist/core/agents/codex-app-server/codex-agent.js +294 -0
- package/dist/core/agents/codex-app-server/commands.js +184 -0
- package/dist/core/agents/codex-app-server/credentials.js +92 -0
- package/dist/core/agents/codex-app-server/effort.js +13 -0
- package/dist/core/agents/codex-app-server/events.js +18 -0
- package/dist/core/agents/codex-app-server/homes.js +118 -0
- package/dist/core/agents/codex-app-server/input.js +52 -0
- package/dist/core/agents/codex-app-server/items.js +307 -0
- package/dist/core/agents/codex-app-server/login.js +183 -0
- package/dist/core/agents/codex-app-server/mcp.js +323 -0
- package/dist/core/agents/codex-app-server/models.js +160 -0
- package/dist/core/agents/codex-app-server/options.js +155 -0
- package/dist/core/agents/codex-app-server/plan-approval.js +124 -0
- package/dist/core/agents/codex-app-server/protocol.js +38 -0
- package/dist/core/agents/codex-app-server/requests.js +250 -0
- package/dist/core/agents/codex-app-server/session.js +278 -0
- package/dist/core/agents/codex-app-server/subagents.js +260 -0
- package/dist/core/agents/codex-app-server/thread-settings.js +214 -0
- package/dist/core/agents/codex-app-server/turn-items.js +69 -0
- package/dist/core/agents/codex-app-server/turn.js +448 -0
- package/dist/core/agents/codex-app-server/user-login.js +78 -0
- package/dist/core/agents/config-fingerprint.js +10 -0
- package/dist/core/agents/credentials.js +71 -0
- package/dist/core/agents/diffs.js +27 -0
- package/dist/core/agents/elicitation.js +42 -0
- package/dist/core/agents/inherit-config.js +5 -0
- package/dist/core/agents/login.js +56 -0
- package/dist/core/agents/mcp-config.js +109 -0
- package/dist/core/agents/plan.js +6 -0
- package/dist/core/agents/process-pool.js +307 -0
- package/dist/core/agents/registry.js +49 -0
- package/dist/core/agents/scripted/adapter.js +86 -0
- package/dist/core/agents/scripted/mcp-call.js +74 -0
- package/dist/core/agents/scripted/scripted-agent.js +331 -0
- package/dist/core/agents/scripted/scripts.js +154 -0
- package/dist/core/agents/scripted/steps.js +87 -0
- package/dist/core/agents/session-agent.js +209 -0
- package/dist/core/agents/stderr-tail.js +71 -0
- package/dist/core/agents/thinking-levels.js +9 -0
- package/dist/core/agents/types.js +1 -0
- package/dist/core/diagnostics.js +23 -0
- package/dist/core/index.js +31 -0
- package/dist/core/presets.js +114 -0
- package/dist/core/processes/identity.js +92 -0
- package/dist/core/processes/lifeline.js +218 -0
- package/dist/core/processes/native-processes.js +299 -0
- package/dist/core/processes/process-table.js +164 -0
- package/dist/core/provision/cache-trust.js +121 -0
- package/dist/core/provision/cache-usage.js +61 -0
- package/dist/core/provision/checksums.js +22 -0
- package/dist/core/provision/extract.js +29 -0
- package/dist/core/provision/index.js +4 -0
- package/dist/core/provision/install-build.js +99 -0
- package/dist/core/provision/npm.js +316 -0
- package/dist/core/provision/pins.js +35 -0
- package/dist/core/provision/platform.js +65 -0
- package/dist/core/provision/provisioner.js +372 -0
- package/dist/core/provision/releases.js +68 -0
- package/dist/core/provision/tools.js +279 -0
- package/dist/core/proxy/anthropic-proxy.js +163 -0
- package/dist/core/proxy/api-key-store.js +30 -0
- package/dist/core/proxy/index.js +3 -0
- package/dist/core/proxy/loopback.js +86 -0
- package/dist/core/runtime/agent-runtime.js +437 -0
- package/dist/core/runtime/event-processor.js +379 -0
- package/dist/core/runtime/event-sink.js +65 -0
- package/dist/core/runtime/harness-clis.js +83 -0
- package/dist/core/runtime/harness-logins.js +313 -0
- package/dist/core/runtime/login-reads.js +71 -0
- package/dist/core/runtime/model-lists.js +160 -0
- package/dist/core/runtime/permission-policy.js +84 -0
- package/dist/core/runtime/request-broker.js +139 -0
- package/dist/core/runtime/steering.js +79 -0
- package/dist/core/runtime/turn-outcome.js +16 -0
- package/dist/core/runtime/turn.js +339 -0
- package/dist/core/utils/bounded.js +13 -0
- package/dist/core/utils/deadline.js +57 -0
- package/dist/core/utils/errors.js +176 -0
- package/dist/core/utils/is-record.js +4 -0
- package/dist/core/utils/loopback.js +11 -0
- package/dist/index.js +4 -0
- package/dist/operator/index.js +10 -0
- package/dist/operator/mcp.js +139 -0
- package/dist/operator/operator.js +499 -0
- package/dist/operator/render.js +408 -0
- package/dist/operator/view.js +35 -0
- package/dist/protocol/account.js +96 -0
- package/dist/protocol/async-queue.js +65 -0
- package/dist/protocol/auth.js +169 -0
- package/dist/protocol/canonical.js +18 -0
- package/dist/protocol/clis.js +63 -0
- package/dist/protocol/config.js +137 -0
- package/dist/protocol/conversation.js +231 -0
- package/dist/protocol/credentials.js +142 -0
- package/dist/protocol/errors.js +190 -0
- package/dist/protocol/execution.js +28 -0
- package/dist/protocol/factories.js +231 -0
- package/dist/protocol/guards.js +71 -0
- package/dist/protocol/harness.js +93 -0
- package/dist/protocol/history.js +201 -0
- package/dist/protocol/ids.js +37 -0
- package/dist/protocol/index.js +36 -0
- package/dist/protocol/lifecycle.js +562 -0
- package/dist/protocol/meta-keys.js +17 -0
- package/dist/protocol/meta.js +13 -0
- package/dist/protocol/model-catalog.js +223 -0
- package/dist/protocol/models.js +84 -0
- package/dist/protocol/part-input.js +94 -0
- package/dist/protocol/parts.js +166 -0
- package/dist/protocol/plan.js +31 -0
- package/dist/protocol/reduce.js +484 -0
- package/dist/protocol/selectors.js +136 -0
- package/dist/protocol/seq-cursor.js +37 -0
- package/dist/protocol/stop-reasons.js +41 -0
- package/dist/protocol/thinking.js +31 -0
- package/dist/protocol/time.js +21 -0
- package/dist/protocol/tokens.js +57 -0
- package/dist/protocol/tool-closure.js +70 -0
- package/dist/protocol/tool-state.js +153 -0
- package/dist/protocol/verify.js +467 -0
- package/dist/protocol/vocabulary.js +27 -0
- package/dist/protocol/wire-api.js +94 -0
- package/dist/protocol/wire.js +669 -0
- package/dist/server/acp/binding.js +251 -0
- package/dist/server/acp/session-records.js +53 -0
- package/dist/server/acp/translate.js +401 -0
- package/dist/server/agent-server.js +338 -0
- package/dist/server/bin.js +492 -0
- package/dist/server/feedback.js +216 -0
- package/dist/server/history.js +123 -0
- package/dist/server/index.js +8 -0
- package/dist/server/install.js +171 -0
- package/dist/server/open-parts.js +87 -0
- package/dist/server/routes.js +292 -0
- package/dist/server/secrets.js +19 -0
- package/dist/server/session-gate.js +54 -0
- package/dist/server/session-log.js +66 -0
- package/dist/server/session-store.js +243 -0
- package/dist/server/subscriptions.js +189 -0
- package/dist/server/transports.js +214 -0
- package/dist/server/wire-error.js +26 -0
- package/dist/sync/event-log.js +89 -0
- package/dist/sync/fit.js +202 -0
- package/dist/sync/history-reader.js +33 -0
- package/dist/sync/history-sqlite.js +281 -0
- package/dist/sync/history.js +163 -0
- package/dist/sync/index.js +5 -0
- package/dist/sync/journal-sqlite.js +316 -0
- package/dist/sync/journal.js +10 -0
- package/dist/sync/live-tails.js +85 -0
- package/dist/sync/node-sqlite.js +27 -0
- package/dist/sync/projection.js +32 -0
- package/dist/sync/recovery.js +117 -0
- package/dist/sync/retry.js +45 -0
- package/dist/sync/schema.js +73 -0
- package/dist/sync/sql.js +94 -0
- package/dist/sync/sqlite-file.js +31 -0
- package/dist/sync/sqlite.js +18 -0
- package/dist/sync/worker.js +212 -0
- package/dist/types/client/client.d.ts +6 -1
- package/dist/types/client/client.d.ts.map +1 -1
- package/dist/types/core/agents/claude-code/approvals.d.ts.map +1 -1
- package/dist/types/core/agents/claude-code/claude-agent.d.ts +4 -1
- package/dist/types/core/agents/claude-code/claude-agent.d.ts.map +1 -1
- package/dist/types/core/agents/claude-code/options.d.ts +28 -11
- package/dist/types/core/agents/claude-code/options.d.ts.map +1 -1
- package/dist/types/core/agents/claude-code/session.d.ts +8 -0
- package/dist/types/core/agents/claude-code/session.d.ts.map +1 -1
- package/dist/types/core/agents/codex-app-server/homes.d.ts +6 -0
- package/dist/types/core/agents/codex-app-server/homes.d.ts.map +1 -1
- package/dist/types/core/agents/codex-app-server/login.d.ts +12 -0
- package/dist/types/core/agents/codex-app-server/login.d.ts.map +1 -1
- package/dist/types/core/agents/codex-app-server/requests.d.ts.map +1 -1
- package/dist/types/core/agents/codex-app-server/session.d.ts +4 -1
- package/dist/types/core/agents/codex-app-server/session.d.ts.map +1 -1
- package/dist/types/core/agents/process-pool.d.ts +8 -0
- package/dist/types/core/agents/process-pool.d.ts.map +1 -1
- package/dist/types/core/agents/scripted/scripted-agent.d.ts.map +1 -1
- package/dist/types/core/agents/scripted/steps.d.ts +1 -1
- package/dist/types/core/presets.d.ts +2 -2
- package/dist/types/core/presets.d.ts.map +1 -1
- package/dist/types/core/processes/identity.d.ts.map +1 -1
- package/dist/types/core/processes/lifeline.d.ts.map +1 -1
- package/dist/types/core/processes/process-table.d.ts.map +1 -1
- package/dist/types/core/provision/extract.d.ts.map +1 -1
- package/dist/types/core/runtime/agent-runtime.d.ts +4 -1
- package/dist/types/core/runtime/agent-runtime.d.ts.map +1 -1
- package/dist/types/core/runtime/turn.d.ts +12 -7
- package/dist/types/core/runtime/turn.d.ts.map +1 -1
- package/dist/types/protocol/clis.d.ts +3 -3
- package/dist/types/protocol/conversation.d.ts +6 -6
- package/dist/types/protocol/credentials.d.ts +13 -1
- package/dist/types/protocol/credentials.d.ts.map +1 -1
- package/dist/types/protocol/errors.d.ts +6 -4
- package/dist/types/protocol/errors.d.ts.map +1 -1
- package/dist/types/protocol/lifecycle.d.ts +4 -4
- package/dist/types/protocol/wire-api.d.ts +12 -12
- package/dist/types/protocol/wire.d.ts +8 -8
- package/dist/types/server/bin.d.ts +3 -0
- package/dist/types/server/bin.d.ts.map +1 -0
- package/dist/types/server/routes.d.ts.map +1 -1
- package/dist/types/server/transports.d.ts +2 -1
- package/dist/types/server/transports.d.ts.map +1 -1
- package/dist/types/sync/node-sqlite.d.ts +4 -1
- package/dist/types/sync/node-sqlite.d.ts.map +1 -1
- package/docs/consuming.md +56 -7
- package/docs/deploy.md +35 -0
- package/docs/harnesses.md +30 -5
- package/package.json +43 -18
- package/src/client/client.ts +114 -44
- package/src/core/agents/claude-code/approvals.ts +5 -1
- package/src/core/agents/claude-code/claude-agent.ts +32 -5
- package/src/core/agents/claude-code/options.ts +28 -11
- package/src/core/agents/claude-code/session.ts +13 -0
- package/src/core/agents/codex-app-server/homes.ts +11 -2
- package/src/core/agents/codex-app-server/login.ts +30 -0
- package/src/core/agents/codex-app-server/requests.ts +7 -6
- package/src/core/agents/codex-app-server/session.ts +11 -2
- package/src/core/agents/process-pool.ts +30 -4
- package/src/core/agents/scripted/scripted-agent.ts +2 -1
- package/src/core/agents/scripted/steps.ts +1 -1
- package/src/core/presets.ts +3 -2
- package/src/core/processes/identity.ts +1 -0
- package/src/core/processes/lifeline.ts +10 -1
- package/src/core/processes/process-table.ts +1 -0
- package/src/core/provision/extract.ts +1 -0
- package/src/core/runtime/agent-runtime.ts +6 -3
- package/src/core/runtime/turn.ts +21 -9
- package/src/protocol/credentials.ts +19 -5
- package/src/protocol/errors.ts +12 -3
- package/src/server/bin.ts +25 -10
- package/src/server/routes.ts +3 -2
- package/src/server/transports.ts +6 -1
- package/src/sync/node-sqlite.ts +19 -3
|
@@ -185,7 +185,7 @@ declare const API: {
|
|
|
185
185
|
}, z.core.$strip>>;
|
|
186
186
|
cost: z.ZodOptional<z.ZodNumber>;
|
|
187
187
|
error: z.ZodOptional<z.ZodObject<{
|
|
188
|
-
category: z.ZodType<"abort" | (string & {}) | "auth" | "rate_limit" | "overloaded" | "usage_limit" | "context_limit" | "network" | "invalid_request" | "process_exit" | "resume_failed" | "mcp_unavailable" | "server_restart" | "internal", unknown, z.core.$ZodTypeInternals<"abort" | (string & {}) | "auth" | "rate_limit" | "overloaded" | "usage_limit" | "context_limit" | "network" | "invalid_request" | "process_exit" | "resume_failed" | "mcp_unavailable" | "server_restart" | "internal", unknown>>;
|
|
188
|
+
category: z.ZodType<"abort" | (string & {}) | "auth" | "rate_limit" | "overloaded" | "usage_limit" | "context_limit" | "network" | "invalid_request" | "process_exit" | "resume_failed" | "resume_busy" | "mcp_unavailable" | "server_restart" | "internal", unknown, z.core.$ZodTypeInternals<"abort" | (string & {}) | "auth" | "rate_limit" | "overloaded" | "usage_limit" | "context_limit" | "network" | "invalid_request" | "process_exit" | "resume_failed" | "resume_busy" | "mcp_unavailable" | "server_restart" | "internal", unknown>>;
|
|
189
189
|
message: z.ZodString;
|
|
190
190
|
}, z.core.$strip>>;
|
|
191
191
|
undeliveredSteers: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
@@ -231,7 +231,7 @@ declare const API: {
|
|
|
231
231
|
} | undefined;
|
|
232
232
|
cost?: number | undefined;
|
|
233
233
|
error?: {
|
|
234
|
-
category: "abort" | (string & {}) | "auth" | "rate_limit" | "overloaded" | "usage_limit" | "context_limit" | "network" | "invalid_request" | "process_exit" | "resume_failed" | "mcp_unavailable" | "server_restart" | "internal";
|
|
234
|
+
category: "abort" | (string & {}) | "auth" | "rate_limit" | "overloaded" | "usage_limit" | "context_limit" | "network" | "invalid_request" | "process_exit" | "resume_failed" | "resume_busy" | "mcp_unavailable" | "server_restart" | "internal";
|
|
235
235
|
message: string;
|
|
236
236
|
} | undefined;
|
|
237
237
|
undeliveredSteers?: string[] | undefined;
|
|
@@ -673,7 +673,7 @@ declare const API: {
|
|
|
673
673
|
}, z.core.$strip>>;
|
|
674
674
|
cost: z.ZodOptional<z.ZodNumber>;
|
|
675
675
|
error: z.ZodOptional<z.ZodObject<{
|
|
676
|
-
category: z.ZodType<"abort" | (string & {}) | "auth" | "rate_limit" | "overloaded" | "usage_limit" | "context_limit" | "network" | "invalid_request" | "process_exit" | "resume_failed" | "mcp_unavailable" | "server_restart" | "internal", unknown, z.core.$ZodTypeInternals<"abort" | (string & {}) | "auth" | "rate_limit" | "overloaded" | "usage_limit" | "context_limit" | "network" | "invalid_request" | "process_exit" | "resume_failed" | "mcp_unavailable" | "server_restart" | "internal", unknown>>;
|
|
676
|
+
category: z.ZodType<"abort" | (string & {}) | "auth" | "rate_limit" | "overloaded" | "usage_limit" | "context_limit" | "network" | "invalid_request" | "process_exit" | "resume_failed" | "resume_busy" | "mcp_unavailable" | "server_restart" | "internal", unknown, z.core.$ZodTypeInternals<"abort" | (string & {}) | "auth" | "rate_limit" | "overloaded" | "usage_limit" | "context_limit" | "network" | "invalid_request" | "process_exit" | "resume_failed" | "resume_busy" | "mcp_unavailable" | "server_restart" | "internal", unknown>>;
|
|
677
677
|
message: z.ZodString;
|
|
678
678
|
}, z.core.$strip>>;
|
|
679
679
|
undeliveredSteers: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
@@ -730,7 +730,7 @@ declare const API: {
|
|
|
730
730
|
type: z.ZodLiteral<"error">;
|
|
731
731
|
sessionId: z.ZodOptional<z.ZodString>;
|
|
732
732
|
turnId: z.ZodOptional<z.ZodString>;
|
|
733
|
-
category: z.ZodType<"abort" | (string & {}) | "auth" | "rate_limit" | "overloaded" | "usage_limit" | "context_limit" | "network" | "invalid_request" | "process_exit" | "resume_failed" | "mcp_unavailable" | "server_restart" | "internal", unknown, z.core.$ZodTypeInternals<"abort" | (string & {}) | "auth" | "rate_limit" | "overloaded" | "usage_limit" | "context_limit" | "network" | "invalid_request" | "process_exit" | "resume_failed" | "mcp_unavailable" | "server_restart" | "internal", unknown>>;
|
|
733
|
+
category: z.ZodType<"abort" | (string & {}) | "auth" | "rate_limit" | "overloaded" | "usage_limit" | "context_limit" | "network" | "invalid_request" | "process_exit" | "resume_failed" | "resume_busy" | "mcp_unavailable" | "server_restart" | "internal", unknown, z.core.$ZodTypeInternals<"abort" | (string & {}) | "auth" | "rate_limit" | "overloaded" | "usage_limit" | "context_limit" | "network" | "invalid_request" | "process_exit" | "resume_failed" | "resume_busy" | "mcp_unavailable" | "server_restart" | "internal", unknown>>;
|
|
734
734
|
message: z.ZodString;
|
|
735
735
|
recoverable: z.ZodBoolean;
|
|
736
736
|
retry: z.ZodOptional<z.ZodObject<{
|
|
@@ -944,7 +944,7 @@ declare const API: {
|
|
|
944
944
|
receivedBytes: z.ZodOptional<z.ZodNumber>;
|
|
945
945
|
totalBytes: z.ZodOptional<z.ZodNumber>;
|
|
946
946
|
error: z.ZodOptional<z.ZodString>;
|
|
947
|
-
category: z.ZodOptional<z.ZodType<"abort" | (string & {}) | "auth" | "rate_limit" | "overloaded" | "usage_limit" | "context_limit" | "network" | "invalid_request" | "process_exit" | "resume_failed" | "mcp_unavailable" | "server_restart" | "internal", unknown, z.core.$ZodTypeInternals<"abort" | (string & {}) | "auth" | "rate_limit" | "overloaded" | "usage_limit" | "context_limit" | "network" | "invalid_request" | "process_exit" | "resume_failed" | "mcp_unavailable" | "server_restart" | "internal", unknown>>>;
|
|
947
|
+
category: z.ZodOptional<z.ZodType<"abort" | (string & {}) | "auth" | "rate_limit" | "overloaded" | "usage_limit" | "context_limit" | "network" | "invalid_request" | "process_exit" | "resume_failed" | "resume_busy" | "mcp_unavailable" | "server_restart" | "internal", unknown, z.core.$ZodTypeInternals<"abort" | (string & {}) | "auth" | "rate_limit" | "overloaded" | "usage_limit" | "context_limit" | "network" | "invalid_request" | "process_exit" | "resume_failed" | "resume_busy" | "mcp_unavailable" | "server_restart" | "internal", unknown>>>;
|
|
948
948
|
}, z.core.$strip>>;
|
|
949
949
|
}, z.core.$strip>;
|
|
950
950
|
decode: (raw: unknown) => {
|
|
@@ -956,7 +956,7 @@ declare const API: {
|
|
|
956
956
|
receivedBytes?: number | undefined;
|
|
957
957
|
totalBytes?: number | undefined;
|
|
958
958
|
error?: string | undefined;
|
|
959
|
-
category?: "abort" | (string & {}) | "auth" | "rate_limit" | "overloaded" | "usage_limit" | "context_limit" | "network" | "invalid_request" | "process_exit" | "resume_failed" | "mcp_unavailable" | "server_restart" | "internal" | undefined;
|
|
959
|
+
category?: "abort" | (string & {}) | "auth" | "rate_limit" | "overloaded" | "usage_limit" | "context_limit" | "network" | "invalid_request" | "process_exit" | "resume_failed" | "resume_busy" | "mcp_unavailable" | "server_restart" | "internal" | undefined;
|
|
960
960
|
}[];
|
|
961
961
|
};
|
|
962
962
|
};
|
|
@@ -978,7 +978,7 @@ declare const API: {
|
|
|
978
978
|
receivedBytes: z.ZodOptional<z.ZodNumber>;
|
|
979
979
|
totalBytes: z.ZodOptional<z.ZodNumber>;
|
|
980
980
|
error: z.ZodOptional<z.ZodString>;
|
|
981
|
-
category: z.ZodOptional<z.ZodType<"abort" | (string & {}) | "auth" | "rate_limit" | "overloaded" | "usage_limit" | "context_limit" | "network" | "invalid_request" | "process_exit" | "resume_failed" | "mcp_unavailable" | "server_restart" | "internal", unknown, z.core.$ZodTypeInternals<"abort" | (string & {}) | "auth" | "rate_limit" | "overloaded" | "usage_limit" | "context_limit" | "network" | "invalid_request" | "process_exit" | "resume_failed" | "mcp_unavailable" | "server_restart" | "internal", unknown>>>;
|
|
981
|
+
category: z.ZodOptional<z.ZodType<"abort" | (string & {}) | "auth" | "rate_limit" | "overloaded" | "usage_limit" | "context_limit" | "network" | "invalid_request" | "process_exit" | "resume_failed" | "resume_busy" | "mcp_unavailable" | "server_restart" | "internal", unknown, z.core.$ZodTypeInternals<"abort" | (string & {}) | "auth" | "rate_limit" | "overloaded" | "usage_limit" | "context_limit" | "network" | "invalid_request" | "process_exit" | "resume_failed" | "resume_busy" | "mcp_unavailable" | "server_restart" | "internal", unknown>>>;
|
|
982
982
|
}, z.core.$strip>>;
|
|
983
983
|
}, z.core.$strip>;
|
|
984
984
|
decode: (raw: unknown) => {
|
|
@@ -990,7 +990,7 @@ declare const API: {
|
|
|
990
990
|
receivedBytes?: number | undefined;
|
|
991
991
|
totalBytes?: number | undefined;
|
|
992
992
|
error?: string | undefined;
|
|
993
|
-
category?: "abort" | (string & {}) | "auth" | "rate_limit" | "overloaded" | "usage_limit" | "context_limit" | "network" | "invalid_request" | "process_exit" | "resume_failed" | "mcp_unavailable" | "server_restart" | "internal" | undefined;
|
|
993
|
+
category?: "abort" | (string & {}) | "auth" | "rate_limit" | "overloaded" | "usage_limit" | "context_limit" | "network" | "invalid_request" | "process_exit" | "resume_failed" | "resume_busy" | "mcp_unavailable" | "server_restart" | "internal" | undefined;
|
|
994
994
|
}[];
|
|
995
995
|
};
|
|
996
996
|
};
|
|
@@ -1343,7 +1343,7 @@ declare const API: {
|
|
|
1343
1343
|
}, z.core.$strip>>;
|
|
1344
1344
|
cost: z.ZodOptional<z.ZodNumber>;
|
|
1345
1345
|
error: z.ZodOptional<z.ZodObject<{
|
|
1346
|
-
category: z.ZodType<"abort" | (string & {}) | "auth" | "rate_limit" | "overloaded" | "usage_limit" | "context_limit" | "network" | "invalid_request" | "process_exit" | "resume_failed" | "mcp_unavailable" | "server_restart" | "internal", unknown, z.core.$ZodTypeInternals<"abort" | (string & {}) | "auth" | "rate_limit" | "overloaded" | "usage_limit" | "context_limit" | "network" | "invalid_request" | "process_exit" | "resume_failed" | "mcp_unavailable" | "server_restart" | "internal", unknown>>;
|
|
1346
|
+
category: z.ZodType<"abort" | (string & {}) | "auth" | "rate_limit" | "overloaded" | "usage_limit" | "context_limit" | "network" | "invalid_request" | "process_exit" | "resume_failed" | "resume_busy" | "mcp_unavailable" | "server_restart" | "internal", unknown, z.core.$ZodTypeInternals<"abort" | (string & {}) | "auth" | "rate_limit" | "overloaded" | "usage_limit" | "context_limit" | "network" | "invalid_request" | "process_exit" | "resume_failed" | "resume_busy" | "mcp_unavailable" | "server_restart" | "internal", unknown>>;
|
|
1347
1347
|
message: z.ZodString;
|
|
1348
1348
|
}, z.core.$strip>>;
|
|
1349
1349
|
undeliveredSteers: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
@@ -1408,7 +1408,7 @@ declare const API: {
|
|
|
1408
1408
|
} | undefined;
|
|
1409
1409
|
cost?: number | undefined;
|
|
1410
1410
|
error?: {
|
|
1411
|
-
category: "abort" | (string & {}) | "auth" | "rate_limit" | "overloaded" | "usage_limit" | "context_limit" | "network" | "invalid_request" | "process_exit" | "resume_failed" | "mcp_unavailable" | "server_restart" | "internal";
|
|
1411
|
+
category: "abort" | (string & {}) | "auth" | "rate_limit" | "overloaded" | "usage_limit" | "context_limit" | "network" | "invalid_request" | "process_exit" | "resume_failed" | "resume_busy" | "mcp_unavailable" | "server_restart" | "internal";
|
|
1412
1412
|
message: string;
|
|
1413
1413
|
} | undefined;
|
|
1414
1414
|
undeliveredSteers?: string[] | undefined;
|
|
@@ -1438,7 +1438,7 @@ declare const API: {
|
|
|
1438
1438
|
}>>;
|
|
1439
1439
|
lastTurn: z.ZodOptional<z.ZodObject<{
|
|
1440
1440
|
error: z.ZodOptional<z.ZodObject<{
|
|
1441
|
-
category: z.ZodType<"abort" | (string & {}) | "auth" | "rate_limit" | "overloaded" | "usage_limit" | "context_limit" | "network" | "invalid_request" | "process_exit" | "resume_failed" | "mcp_unavailable" | "server_restart" | "internal", unknown, z.core.$ZodTypeInternals<"abort" | (string & {}) | "auth" | "rate_limit" | "overloaded" | "usage_limit" | "context_limit" | "network" | "invalid_request" | "process_exit" | "resume_failed" | "mcp_unavailable" | "server_restart" | "internal", unknown>>;
|
|
1441
|
+
category: z.ZodType<"abort" | (string & {}) | "auth" | "rate_limit" | "overloaded" | "usage_limit" | "context_limit" | "network" | "invalid_request" | "process_exit" | "resume_failed" | "resume_busy" | "mcp_unavailable" | "server_restart" | "internal", unknown, z.core.$ZodTypeInternals<"abort" | (string & {}) | "auth" | "rate_limit" | "overloaded" | "usage_limit" | "context_limit" | "network" | "invalid_request" | "process_exit" | "resume_failed" | "resume_busy" | "mcp_unavailable" | "server_restart" | "internal", unknown>>;
|
|
1442
1442
|
message: z.ZodString;
|
|
1443
1443
|
}, z.core.$strip>>;
|
|
1444
1444
|
turnId: z.ZodString;
|
|
@@ -1456,7 +1456,7 @@ declare const API: {
|
|
|
1456
1456
|
lastTurn?: {
|
|
1457
1457
|
turnId: string;
|
|
1458
1458
|
error?: {
|
|
1459
|
-
category: "abort" | (string & {}) | "auth" | "rate_limit" | "overloaded" | "usage_limit" | "context_limit" | "network" | "invalid_request" | "process_exit" | "resume_failed" | "mcp_unavailable" | "server_restart" | "internal";
|
|
1459
|
+
category: "abort" | (string & {}) | "auth" | "rate_limit" | "overloaded" | "usage_limit" | "context_limit" | "network" | "invalid_request" | "process_exit" | "resume_failed" | "resume_busy" | "mcp_unavailable" | "server_restart" | "internal";
|
|
1460
1460
|
message: string;
|
|
1461
1461
|
} | undefined;
|
|
1462
1462
|
stopReason?: "error" | (string & {}) | "cancelled" | "end_turn" | "max_tokens" | "max_turn_requests" | "refusal" | undefined;
|
|
@@ -319,7 +319,7 @@ export declare const TurnStartResultSchema: z.ZodObject<{
|
|
|
319
319
|
}, z.core.$strip>>;
|
|
320
320
|
cost: z.ZodOptional<z.ZodNumber>;
|
|
321
321
|
error: z.ZodOptional<z.ZodObject<{
|
|
322
|
-
category: z.ZodType<"abort" | (string & {}) | "auth" | "rate_limit" | "overloaded" | "usage_limit" | "context_limit" | "network" | "invalid_request" | "process_exit" | "resume_failed" | "mcp_unavailable" | "server_restart" | "internal", unknown, z.core.$ZodTypeInternals<"abort" | (string & {}) | "auth" | "rate_limit" | "overloaded" | "usage_limit" | "context_limit" | "network" | "invalid_request" | "process_exit" | "resume_failed" | "mcp_unavailable" | "server_restart" | "internal", unknown>>;
|
|
322
|
+
category: z.ZodType<"abort" | (string & {}) | "auth" | "rate_limit" | "overloaded" | "usage_limit" | "context_limit" | "network" | "invalid_request" | "process_exit" | "resume_failed" | "resume_busy" | "mcp_unavailable" | "server_restart" | "internal", unknown, z.core.$ZodTypeInternals<"abort" | (string & {}) | "auth" | "rate_limit" | "overloaded" | "usage_limit" | "context_limit" | "network" | "invalid_request" | "process_exit" | "resume_failed" | "resume_busy" | "mcp_unavailable" | "server_restart" | "internal", unknown>>;
|
|
323
323
|
message: z.ZodString;
|
|
324
324
|
}, z.core.$strip>>;
|
|
325
325
|
undeliveredSteers: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
@@ -770,7 +770,7 @@ export declare const WireEventEnvelopeSchema: z.ZodObject<{
|
|
|
770
770
|
}, z.core.$strip>>;
|
|
771
771
|
cost: z.ZodOptional<z.ZodNumber>;
|
|
772
772
|
error: z.ZodOptional<z.ZodObject<{
|
|
773
|
-
category: z.ZodType<"abort" | (string & {}) | "auth" | "rate_limit" | "overloaded" | "usage_limit" | "context_limit" | "network" | "invalid_request" | "process_exit" | "resume_failed" | "mcp_unavailable" | "server_restart" | "internal", unknown, z.core.$ZodTypeInternals<"abort" | (string & {}) | "auth" | "rate_limit" | "overloaded" | "usage_limit" | "context_limit" | "network" | "invalid_request" | "process_exit" | "resume_failed" | "mcp_unavailable" | "server_restart" | "internal", unknown>>;
|
|
773
|
+
category: z.ZodType<"abort" | (string & {}) | "auth" | "rate_limit" | "overloaded" | "usage_limit" | "context_limit" | "network" | "invalid_request" | "process_exit" | "resume_failed" | "resume_busy" | "mcp_unavailable" | "server_restart" | "internal", unknown, z.core.$ZodTypeInternals<"abort" | (string & {}) | "auth" | "rate_limit" | "overloaded" | "usage_limit" | "context_limit" | "network" | "invalid_request" | "process_exit" | "resume_failed" | "resume_busy" | "mcp_unavailable" | "server_restart" | "internal", unknown>>;
|
|
774
774
|
message: z.ZodString;
|
|
775
775
|
}, z.core.$strip>>;
|
|
776
776
|
undeliveredSteers: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
@@ -827,7 +827,7 @@ export declare const WireEventEnvelopeSchema: z.ZodObject<{
|
|
|
827
827
|
type: z.ZodLiteral<"error">;
|
|
828
828
|
sessionId: z.ZodOptional<z.ZodString>;
|
|
829
829
|
turnId: z.ZodOptional<z.ZodString>;
|
|
830
|
-
category: z.ZodType<"abort" | (string & {}) | "auth" | "rate_limit" | "overloaded" | "usage_limit" | "context_limit" | "network" | "invalid_request" | "process_exit" | "resume_failed" | "mcp_unavailable" | "server_restart" | "internal", unknown, z.core.$ZodTypeInternals<"abort" | (string & {}) | "auth" | "rate_limit" | "overloaded" | "usage_limit" | "context_limit" | "network" | "invalid_request" | "process_exit" | "resume_failed" | "mcp_unavailable" | "server_restart" | "internal", unknown>>;
|
|
830
|
+
category: z.ZodType<"abort" | (string & {}) | "auth" | "rate_limit" | "overloaded" | "usage_limit" | "context_limit" | "network" | "invalid_request" | "process_exit" | "resume_failed" | "resume_busy" | "mcp_unavailable" | "server_restart" | "internal", unknown, z.core.$ZodTypeInternals<"abort" | (string & {}) | "auth" | "rate_limit" | "overloaded" | "usage_limit" | "context_limit" | "network" | "invalid_request" | "process_exit" | "resume_failed" | "resume_busy" | "mcp_unavailable" | "server_restart" | "internal", unknown>>;
|
|
831
831
|
message: z.ZodString;
|
|
832
832
|
recoverable: z.ZodBoolean;
|
|
833
833
|
retry: z.ZodOptional<z.ZodObject<{
|
|
@@ -1259,7 +1259,7 @@ export declare const EventsReplayResultSchema: z.ZodObject<{
|
|
|
1259
1259
|
}, z.core.$strip>>;
|
|
1260
1260
|
cost: z.ZodOptional<z.ZodNumber>;
|
|
1261
1261
|
error: z.ZodOptional<z.ZodObject<{
|
|
1262
|
-
category: z.ZodType<"abort" | (string & {}) | "auth" | "rate_limit" | "overloaded" | "usage_limit" | "context_limit" | "network" | "invalid_request" | "process_exit" | "resume_failed" | "mcp_unavailable" | "server_restart" | "internal", unknown, z.core.$ZodTypeInternals<"abort" | (string & {}) | "auth" | "rate_limit" | "overloaded" | "usage_limit" | "context_limit" | "network" | "invalid_request" | "process_exit" | "resume_failed" | "mcp_unavailable" | "server_restart" | "internal", unknown>>;
|
|
1262
|
+
category: z.ZodType<"abort" | (string & {}) | "auth" | "rate_limit" | "overloaded" | "usage_limit" | "context_limit" | "network" | "invalid_request" | "process_exit" | "resume_failed" | "resume_busy" | "mcp_unavailable" | "server_restart" | "internal", unknown, z.core.$ZodTypeInternals<"abort" | (string & {}) | "auth" | "rate_limit" | "overloaded" | "usage_limit" | "context_limit" | "network" | "invalid_request" | "process_exit" | "resume_failed" | "resume_busy" | "mcp_unavailable" | "server_restart" | "internal", unknown>>;
|
|
1263
1263
|
message: z.ZodString;
|
|
1264
1264
|
}, z.core.$strip>>;
|
|
1265
1265
|
undeliveredSteers: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
@@ -1316,7 +1316,7 @@ export declare const EventsReplayResultSchema: z.ZodObject<{
|
|
|
1316
1316
|
type: z.ZodLiteral<"error">;
|
|
1317
1317
|
sessionId: z.ZodOptional<z.ZodString>;
|
|
1318
1318
|
turnId: z.ZodOptional<z.ZodString>;
|
|
1319
|
-
category: z.ZodType<"abort" | (string & {}) | "auth" | "rate_limit" | "overloaded" | "usage_limit" | "context_limit" | "network" | "invalid_request" | "process_exit" | "resume_failed" | "mcp_unavailable" | "server_restart" | "internal", unknown, z.core.$ZodTypeInternals<"abort" | (string & {}) | "auth" | "rate_limit" | "overloaded" | "usage_limit" | "context_limit" | "network" | "invalid_request" | "process_exit" | "resume_failed" | "mcp_unavailable" | "server_restart" | "internal", unknown>>;
|
|
1319
|
+
category: z.ZodType<"abort" | (string & {}) | "auth" | "rate_limit" | "overloaded" | "usage_limit" | "context_limit" | "network" | "invalid_request" | "process_exit" | "resume_failed" | "resume_busy" | "mcp_unavailable" | "server_restart" | "internal", unknown, z.core.$ZodTypeInternals<"abort" | (string & {}) | "auth" | "rate_limit" | "overloaded" | "usage_limit" | "context_limit" | "network" | "invalid_request" | "process_exit" | "resume_failed" | "resume_busy" | "mcp_unavailable" | "server_restart" | "internal", unknown>>;
|
|
1320
1320
|
message: z.ZodString;
|
|
1321
1321
|
recoverable: z.ZodBoolean;
|
|
1322
1322
|
retry: z.ZodOptional<z.ZodObject<{
|
|
@@ -1541,7 +1541,7 @@ export declare const TurnReceiptSchema: z.ZodObject<{
|
|
|
1541
1541
|
}, z.core.$strip>>;
|
|
1542
1542
|
cost: z.ZodOptional<z.ZodNumber>;
|
|
1543
1543
|
error: z.ZodOptional<z.ZodObject<{
|
|
1544
|
-
category: z.ZodType<"abort" | (string & {}) | "auth" | "rate_limit" | "overloaded" | "usage_limit" | "context_limit" | "network" | "invalid_request" | "process_exit" | "resume_failed" | "mcp_unavailable" | "server_restart" | "internal", unknown, z.core.$ZodTypeInternals<"abort" | (string & {}) | "auth" | "rate_limit" | "overloaded" | "usage_limit" | "context_limit" | "network" | "invalid_request" | "process_exit" | "resume_failed" | "mcp_unavailable" | "server_restart" | "internal", unknown>>;
|
|
1544
|
+
category: z.ZodType<"abort" | (string & {}) | "auth" | "rate_limit" | "overloaded" | "usage_limit" | "context_limit" | "network" | "invalid_request" | "process_exit" | "resume_failed" | "resume_busy" | "mcp_unavailable" | "server_restart" | "internal", unknown, z.core.$ZodTypeInternals<"abort" | (string & {}) | "auth" | "rate_limit" | "overloaded" | "usage_limit" | "context_limit" | "network" | "invalid_request" | "process_exit" | "resume_failed" | "resume_busy" | "mcp_unavailable" | "server_restart" | "internal", unknown>>;
|
|
1545
1545
|
message: z.ZodString;
|
|
1546
1546
|
}, z.core.$strip>>;
|
|
1547
1547
|
undeliveredSteers: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
@@ -1576,7 +1576,7 @@ export type RecoveryReason = z.infer<typeof RecoveryReasonSchema>;
|
|
|
1576
1576
|
*/
|
|
1577
1577
|
export declare const LastTurnSchema: z.ZodObject<{
|
|
1578
1578
|
error: z.ZodOptional<z.ZodObject<{
|
|
1579
|
-
category: z.ZodType<"abort" | (string & {}) | "auth" | "rate_limit" | "overloaded" | "usage_limit" | "context_limit" | "network" | "invalid_request" | "process_exit" | "resume_failed" | "mcp_unavailable" | "server_restart" | "internal", unknown, z.core.$ZodTypeInternals<"abort" | (string & {}) | "auth" | "rate_limit" | "overloaded" | "usage_limit" | "context_limit" | "network" | "invalid_request" | "process_exit" | "resume_failed" | "mcp_unavailable" | "server_restart" | "internal", unknown>>;
|
|
1579
|
+
category: z.ZodType<"abort" | (string & {}) | "auth" | "rate_limit" | "overloaded" | "usage_limit" | "context_limit" | "network" | "invalid_request" | "process_exit" | "resume_failed" | "resume_busy" | "mcp_unavailable" | "server_restart" | "internal", unknown, z.core.$ZodTypeInternals<"abort" | (string & {}) | "auth" | "rate_limit" | "overloaded" | "usage_limit" | "context_limit" | "network" | "invalid_request" | "process_exit" | "resume_failed" | "resume_busy" | "mcp_unavailable" | "server_restart" | "internal", unknown>>;
|
|
1580
1580
|
message: z.ZodString;
|
|
1581
1581
|
}, z.core.$strip>>;
|
|
1582
1582
|
turnId: z.ZodString;
|
|
@@ -1602,7 +1602,7 @@ export declare const DurableSessionSchema: z.ZodObject<{
|
|
|
1602
1602
|
}>>;
|
|
1603
1603
|
lastTurn: z.ZodOptional<z.ZodObject<{
|
|
1604
1604
|
error: z.ZodOptional<z.ZodObject<{
|
|
1605
|
-
category: z.ZodType<"abort" | (string & {}) | "auth" | "rate_limit" | "overloaded" | "usage_limit" | "context_limit" | "network" | "invalid_request" | "process_exit" | "resume_failed" | "mcp_unavailable" | "server_restart" | "internal", unknown, z.core.$ZodTypeInternals<"abort" | (string & {}) | "auth" | "rate_limit" | "overloaded" | "usage_limit" | "context_limit" | "network" | "invalid_request" | "process_exit" | "resume_failed" | "mcp_unavailable" | "server_restart" | "internal", unknown>>;
|
|
1605
|
+
category: z.ZodType<"abort" | (string & {}) | "auth" | "rate_limit" | "overloaded" | "usage_limit" | "context_limit" | "network" | "invalid_request" | "process_exit" | "resume_failed" | "resume_busy" | "mcp_unavailable" | "server_restart" | "internal", unknown, z.core.$ZodTypeInternals<"abort" | (string & {}) | "auth" | "rate_limit" | "overloaded" | "usage_limit" | "context_limit" | "network" | "invalid_request" | "process_exit" | "resume_failed" | "resume_busy" | "mcp_unavailable" | "server_restart" | "internal", unknown>>;
|
|
1606
1606
|
message: z.ZodString;
|
|
1607
1607
|
}, z.core.$strip>>;
|
|
1608
1608
|
turnId: z.ZodString;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bin.d.ts","sourceRoot":"","sources":["../../../src/server/bin.ts"],"names":[],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"routes.d.ts","sourceRoot":"","sources":["../../../src/server/routes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAc,MAAM,kBAAkB,CAAC;AACjE,OAAO,EAGN,KAAK,aAAa,EACl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aAAa,CAAC,CAkCvB"}
|
|
@@ -45,7 +45,8 @@ export declare function assertListenOptions(opts: ListenOptions): void;
|
|
|
45
45
|
* Accept WebSocket clients (agnt's model: the consumer connects to us). Each
|
|
46
46
|
* accepted socket becomes an attached transport, which receives the sessions
|
|
47
47
|
* it subscribes to. It answers native clients, and browsers only from
|
|
48
|
-
* `allowedOrigins`; beyond loopback it requires a `token`.
|
|
48
|
+
* `allowedOrigins`; beyond loopback it requires a `token`. Bun only: under
|
|
49
|
+
* any other runtime it throws an error that says what works there.
|
|
49
50
|
*/
|
|
50
51
|
export declare function listen(server: AgentServer, opts?: ListenOptions): {
|
|
51
52
|
url: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transports.d.ts","sourceRoot":"","sources":["../../../src/server/transports.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,aAAa,EAAqC,MAAM,sBAAsB,CAAC;AAC7F,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAErD;;;;GAIG;AACH,wBAAgB,cAAc,CAC7B,KAAK,GAAE,MAAM,CAAC,cAA8B;AAC5C,iGAAiG;AACjG,MAAM,GAAE,MAAM,CAAC,cAAc,GAAG;IAAE,QAAQ,CAAC,cAAc,CAAC,EAAE,MAAM,CAAA;CAAmB,GACnF,aAAa,CAcf;AA2BD,MAAM,WAAW,aAAa;IAC7B,oCAAoC;IACpC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,4EAA4E;IAC5E,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;;;OAKG;IACH,cAAc,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;CACnC;AAKD;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,aAAa,GAAG,IAAI,CAe7D;AAkCD
|
|
1
|
+
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M,CAAC,CAAC;CACjC;AAED;;;;GAIG;AACH,wBAAgB,IAAI,CAAC,MAAM,EAAE,WAAW,EAAE,GAAG,EAAE,MAAM,EAAE,IAAI,GAAE,WAAgB,GAAG;IAAE,IAAI,IAAI,IAAI,CAAA;CAAE,CAkD/F"}
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { SqliteJournal } from "./journal-sqlite.ts";
|
|
2
2
|
/** Node >=22.16 adapter (node:sqlite). Same schema and guarantees as Bun.
|
|
3
|
-
*
|
|
3
|
+
* `node:sqlite` loads when a journal opens, not when this module does: a
|
|
4
|
+
* bundle holding both adapters (the bin, compiled by Bun into one binary)
|
|
5
|
+
* hoists a static import of it, which Bun, without the module, refuses at
|
|
6
|
+
* start; and Node 22 warns that it is experimental on its first load. */
|
|
4
7
|
export declare class NodeSqliteSessionJournal extends SqliteJournal {
|
|
5
8
|
constructor(path: string);
|
|
6
9
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"node-sqlite.d.ts","sourceRoot":"","sources":["../../../src/sync/node-sqlite.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAGpD;
|
|
1
|
+
{"version":3,"file":"node-sqlite.d.ts","sourceRoot":"","sources":["../../../src/sync/node-sqlite.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAGpD;;;;yEAIyE;AACzE,qBAAa,wBAAyB,SAAQ,aAAa;gBAC9C,IAAI,EAAE,MAAM;CAYxB"}
|
package/docs/consuming.md
CHANGED
|
@@ -457,8 +457,10 @@ conversation later — across processes and machines where its native history is
|
|
|
457
457
|
available. Built-in harnesses fail the turn if the requested conversation is
|
|
458
458
|
missing, unsupported, or resolves to the wrong Codex thread. They never replay
|
|
459
459
|
the prompt on a new conversation. Missing or unsupported history reports
|
|
460
|
-
`error.category: "resume_failed"`;
|
|
461
|
-
|
|
460
|
+
`error.category: "resume_failed"`; a Codex thread another process still holds
|
|
461
|
+
reports `resume_busy`, and the same resume succeeds once that process has let
|
|
462
|
+
it go (try again later, do not start fresh); authentication and transport
|
|
463
|
+
failures keep their existing error categories.
|
|
462
464
|
|
|
463
465
|
Keep the saved ID when a turn fails. To retry after fixing the cause, submit a
|
|
464
466
|
new `turnId` with the same resume target. To deliberately start fresh, use a new
|
|
@@ -473,6 +475,19 @@ A successful Claude resume can mint a new native ID; use the reported `resumed`
|
|
|
473
475
|
flag rather than comparing Claude IDs. The `resumed: false` wire value remains
|
|
474
476
|
readable for older engines and custom harnesses.
|
|
475
477
|
|
|
478
|
+
Claude Code deletes old conversations. A few seconds after any Claude process
|
|
479
|
+
starts on a config folder, it removes the transcripts older than
|
|
480
|
+
`cleanupPeriodDays` (30 by default) for every project in that folder. At
|
|
481
|
+
`inheritConfig: "all"` the person's own setting governs; at `none` nothing is
|
|
482
|
+
removed; at `project` a repository's settings can set it. A resume of a removed
|
|
483
|
+
transcript ends `resume_failed` ("No conversation found…"), and the session
|
|
484
|
+
keeps asking for that conversation: go on in a new logical `sessionId`, as
|
|
485
|
+
above. A product that must keep sessions longer sets it for
|
|
486
|
+
its own processes through `claudeCode.sdkOptions`
|
|
487
|
+
(`settings: { cleanupPeriodDays }`), which holds only where no other Claude
|
|
488
|
+
process shares that config folder. The engine sets none: at `all` it would
|
|
489
|
+
override the person's own choice.
|
|
490
|
+
|
|
476
491
|
## Steer a running turn
|
|
477
492
|
|
|
478
493
|
A user who types while the agent works means "and also…" or "stop, do this
|
|
@@ -539,6 +554,10 @@ can reuse its turn ID. Custom harnesses retain their own concurrency contract.
|
|
|
539
554
|
`turn/cancel` accepts a `turnId` stamp — always pass
|
|
540
555
|
the id of the turn you mean, so a late cancel can never kill its successor
|
|
541
556
|
(a stale stamp returns `{outcome: "no_active_turn", activeTurnId}`). The
|
|
557
|
+
client's `cancelTurn` for a turn the same client is starting (`runTurn`,
|
|
558
|
+
`startTurn`) is sent after that start's first send, so cancelling at once,
|
|
559
|
+
in the same tick as the start, works; after a reconnect a cancel can reach
|
|
560
|
+
the server before a re-sent start and is answered `no_active_turn`. The
|
|
542
561
|
result is a single-outcome union: `cancelled` means the harness confirmed the
|
|
543
562
|
interrupt; `unconfirmed` means it did not land — including the window between
|
|
544
563
|
the `turn/start` quick-ack and the harness registering its abortable turn —
|
|
@@ -555,8 +574,12 @@ for every harness. `cancelConfirmMs` (2 s by default) is how long a cancel
|
|
|
555
574
|
waits for the agent to confirm it stopped before it answers `unconfirmed`;
|
|
556
575
|
a turn still starting is confirmed once it has ended within it.
|
|
557
576
|
`cancelGraceMs` is how long after a cancel the engine ends an agent that has
|
|
558
|
-
not stopped, and its turn then ends `cancelled`: 2 s on Codex, 10 s on
|
|
559
|
-
ACP agent
|
|
577
|
+
not stopped, and its turn then ends `cancelled`: 2 s on Codex, 10 s on
|
|
578
|
+
Claude and on an ACP agent. A Claude CLI that never answers its interrupt (a
|
|
579
|
+
hung or frozen process) is ended then, `onSessionEnd` says `replaced`, and
|
|
580
|
+
the session's next turn resumes the conversation on a new process. A Claude
|
|
581
|
+
cancel is `cancelled` when its turn ended within `cancelConfirmMs`, by the
|
|
582
|
+
interrupt or by that grace.
|
|
560
583
|
|
|
561
584
|
Embedded `runtime.cancel(harness, sessionId)` cancels the session's active
|
|
562
585
|
turn without a turn ID check. Prefer a per-turn `AbortSignal` when cancellation
|
|
@@ -717,7 +740,11 @@ match what you want asked. To tell which of your tools a call is, read
|
|
|
717
740
|
`mcp.server` and `mcp.tool` on the tool part or the permission request's
|
|
718
741
|
`toolCall`, the same on both harnesses: `toolName` is each harness's own
|
|
719
742
|
spelling (`mcp__<server>__<tool>` on Claude, `<server>.<tool>` on Codex).
|
|
720
|
-
|
|
743
|
+
A Claude `toolPolicy`, which sees no part, gets Claude's own name and the
|
|
744
|
+
same `mcp` in its context. A Codex consent that cannot be linked to one
|
|
745
|
+
started call (none is open, or two of the tool are and neither has its
|
|
746
|
+
arguments) gets a `toolCallId` of its own and still names the server and the
|
|
747
|
+
tool its message names; one whose message names no tool carries no `mcp`.
|
|
721
748
|
|
|
722
749
|
## Own your session resources
|
|
723
750
|
|
|
@@ -872,7 +899,11 @@ Register `onSessionEnd` (claude options) to release per-session resources —
|
|
|
872
899
|
BYOK proxy keys, recorders — instead of re-deriving termination from side
|
|
873
900
|
effects. Reasons: `idle` (idle-timeout eviction), `replaced` (config change or
|
|
874
901
|
host resume replaced the subprocess — usually respawns immediately with context kept),
|
|
875
|
-
`released` (explicit close), `shutdown`.
|
|
902
|
+
`released` (explicit close), `shutdown`. A cancel during a Claude start
|
|
903
|
+
answers at once; `onSessionEnd(sessionId, "released")` for that process can
|
|
904
|
+
come after the cancel's answer (130 to 325 ms on the real CLI), and comes
|
|
905
|
+
before that turn's end. Set up the next turn's per-session resources after
|
|
906
|
+
the turn's end, not after the cancel's answer. On the wire, call `session/close`
|
|
876
907
|
when a logical session will not be resumed: it frees the replay buffer and
|
|
877
908
|
the harness-native state (until then, memory cost ≈ `bufferSize` events per
|
|
878
909
|
session).
|
|
@@ -891,6 +922,8 @@ Treat `unknownSession` on replay as "session over", not as an error to retry.
|
|
|
891
922
|
|
|
892
923
|
## Let an outside agent operate your sessions
|
|
893
924
|
|
|
925
|
+
In this section the operator is that outside agent; elsewhere in this guide
|
|
926
|
+
it is whoever runs the engine (an operator option).
|
|
894
927
|
`@zvada/agent-server/operator` gives a hosted assistant (ChatGPT, Claude, a
|
|
895
928
|
CLI agent) the tools to operate your product's coding agents:
|
|
896
929
|
`list_sessions`, `read_session`, `start_session`, `send_message`,
|
|
@@ -1034,6 +1067,18 @@ exact peer) shows up here; the turn still runs.
|
|
|
1034
1067
|
These are the signals the engine deliberately does not fail turns over — a
|
|
1035
1068
|
product that doesn't surface them debugs blind.
|
|
1036
1069
|
|
|
1070
|
+
## Run it on Bun or Node
|
|
1071
|
+
|
|
1072
|
+
Import the package as it is, under either runtime: Bun loads its TypeScript
|
|
1073
|
+
sources, Node and your bundler its compiled JavaScript (`dist/`), and your
|
|
1074
|
+
`tsc` its declarations, so you need no loader, `allowImportingTsExtensions`
|
|
1075
|
+
or transpiling of its sources. Two things are Bun's alone: `listen` (under
|
|
1076
|
+
Node, serve over stdio, `dial`, or your own WebSocket server's sockets
|
|
1077
|
+
through `channelTransport` and `server.attach`) and `./sync/sqlite` (under
|
|
1078
|
+
Node, `./sync/node-sqlite`). The bin under Node is
|
|
1079
|
+
`node node_modules/@zvada/agent-server/dist/server/bin.js`
|
|
1080
|
+
([deploy](deploy.md#on-node)).
|
|
1081
|
+
|
|
1037
1082
|
## Wire transports
|
|
1038
1083
|
|
|
1039
1084
|
`spawn` (stdio subprocess), `connect` (dial a `--listen` server; reconnects
|
|
@@ -1055,7 +1100,11 @@ followed to its end); `subscribeAll()` is for observers: every session, live
|
|
|
1055
1100
|
from then, with no history (`session/subscribeAll` on the wire; `unsubscribeAll()`
|
|
1056
1101
|
is `session/unsubscribeAll`). The client follows every session from the
|
|
1057
1102
|
call until `unsubscribeAll()`: a connection that drops before the answer asks
|
|
1058
|
-
the server it redials, and `subscribeAll()` resolves on that answer.
|
|
1103
|
+
the server it redials, and `subscribeAll()` resolves on that answer. On a
|
|
1104
|
+
client that redials it resolves only once a server has answered, and fails
|
|
1105
|
+
only when one refuses it, the redials run out (`maxReconnectAttempts`) or the
|
|
1106
|
+
client closes: do not await it on a start path while no engine may be up,
|
|
1107
|
+
since the client follows every session from the call either way. `joinTurn(sessionId, {fromSeq})` watches the
|
|
1059
1108
|
session and joins the turn it runs (`undefined` when none): a handle that
|
|
1060
1109
|
yields the kept events from `fromSeq` (default: the turn's start), then the
|
|
1061
1110
|
turn's open parts, then live frames through its `turn.ended`, each once,
|
package/docs/deploy.md
CHANGED
|
@@ -132,6 +132,34 @@ in a turn's error as in `clis/*`, carry URLs without their credentials or
|
|
|
132
132
|
query. The CLI says a download's start,
|
|
133
133
|
its quarters and its end, and `/info` shows the session harness's CLI.
|
|
134
134
|
|
|
135
|
+
## On Node
|
|
136
|
+
|
|
137
|
+
The package runs on Node as well as Bun. Under Bun each export loads its
|
|
138
|
+
TypeScript source (the `bun` export condition); under Node, and in a
|
|
139
|
+
bundler that does not target Bun, its compiled JavaScript in `dist/`
|
|
140
|
+
(`default`). Tested from the packed tarball on Node 22.16, 22.23 and 24.21
|
|
141
|
+
and Bun 1.3.6 (`test/package/runtime.test.ts`). What differs on Node:
|
|
142
|
+
|
|
143
|
+
- **The bin.** `bin` stays the Bun one (`src/server/bin.ts`). Under Node:
|
|
144
|
+
`node node_modules/@zvada/agent-server/dist/server/bin.js`, with the same
|
|
145
|
+
flags.
|
|
146
|
+
- **`--listen` and `listen` need Bun** (`Bun.serve`): under Node the bin
|
|
147
|
+
refuses `--listen` before it starts, and `listen` throws an error that
|
|
148
|
+
says what works there. Serve over `--stdio` (`stdioTransport`), `--dial`
|
|
149
|
+
(`dial`), or attach each socket of a WebSocket server of your own
|
|
150
|
+
(`channelTransport`, then `server.attach`).
|
|
151
|
+
- **The journal.** `--journal` opens `node:sqlite` under Node (Node >= 22.16;
|
|
152
|
+
Node 22 warns once that it is experimental) and `bun:sqlite` under Bun. In
|
|
153
|
+
code, `./sync/node-sqlite` is Node's and `./sync/sqlite` Bun's, which does
|
|
154
|
+
not load under Node. The Node adapter loads `node:sqlite` when a journal
|
|
155
|
+
opens, not on import, so a bundle holding both adapters starts on either
|
|
156
|
+
runtime.
|
|
157
|
+
- **A bundler** picks the compiled files (esbuild, tsup, Vite, and Bun's own
|
|
158
|
+
with `--target=node`); Bun's with `--target=bun`, as `bun build --compile`
|
|
159
|
+
below, picks the sources. The engine's source paths are unchanged
|
|
160
|
+
(`src/` stays in the package), so a build that copies or maps them keeps
|
|
161
|
+
working.
|
|
162
|
+
|
|
135
163
|
## Single binary & sandbox cold starts
|
|
136
164
|
|
|
137
165
|
The server compiles to a self-contained executable — no bun, node, or
|
|
@@ -215,6 +243,13 @@ AGENT_SERVER_CREDENTIALS_TOKEN=<this sandbox's token> \
|
|
|
215
243
|
Claude's credential stays in the engine (its proxy on 127.0.0.1), not in the
|
|
216
244
|
CLI's environment its tools can read; Codex keeps ChatGPT tokens in memory.
|
|
217
245
|
|
|
246
|
+
Every process the engine starts itself (each CLI, the lifeline shell, the
|
|
247
|
+
`ps`, `sysctl` and `tar` it runs) gets the engine's `process.env` as it is at
|
|
248
|
+
that start, with the turn's `env` over it for a CLI, under Bun as under Node.
|
|
249
|
+
A secret your product deletes from `process.env` before it starts the engine
|
|
250
|
+
reaches none of them; the bin takes its own tokens out the same way (LLP
|
|
251
|
+
0007, The environment a process is given).
|
|
252
|
+
|
|
218
253
|
## App bundles and images for another machine
|
|
219
254
|
|
|
220
255
|
A desktop app that ships its CLIs (to run offline, or to show no download)
|
package/docs/harnesses.md
CHANGED
|
@@ -70,6 +70,7 @@ warm multi-turn reuse, a unified `ThinkingLevel`, and normalized token usage.
|
|
|
70
70
|
| the words said with a refusal (capability `rejectionMessages`) | ✅ the denial tells Claude what the user said | ❌ a bare verdict (a plan's answer carries them) |
|
|
71
71
|
| `elicitation` (questions, MCP input) | `AskUserQuestion`; MCP `onElicitation` (form, url) | `request_user_input` in every mode (each thread starts with Codex's `default_mode_request_user_input`; declined in a turn that does not opt in); MCP elicitation (form, url) |
|
|
72
72
|
| steering (`turn/steer`) | ✅ uuid-stamped messages, read where Claude replays them; a late steer runs as one more query in the turn | ✅ `turn/steer`, read where Codex starts its user message |
|
|
73
|
+
| a cancel (`turn/cancel`) | the SDK's interrupt, confirmed once Claude acknowledges it or the turn ends within `cancelConfirmMs`; a turn Claude has not ended `cancelGraceMs` (10 s) after it has its process ended, and the next turn resumes on a new one | `turn/interrupt`, then the turn's commands stopped (below); its process ended when either is not done within `cancelGraceMs` (2 s) |
|
|
73
74
|
| image / file input (capabilities `images`, `files`) | images (data or http(s) URL), PDFs, text files (`files: text, pdf`) | images (data or local path), text files inline (`files: text`), local files as mentions |
|
|
74
75
|
| `includeRaw` | ✅ | ✅ |
|
|
75
76
|
|
|
@@ -144,6 +145,15 @@ the engine writes them (LLP 0001, D21; see
|
|
|
144
145
|
ACP server binding, a client's stdio and HTTP servers take the first path;
|
|
145
146
|
an SSE server or one named `codex_apps` is refused at `session/new` or
|
|
146
147
|
`session/resume`, naming it.
|
|
148
|
+
|
|
149
|
+
How long one MCP tool call may run is each agent's own, and the engine has
|
|
150
|
+
no field for it yet. Claude cuts a call to an HTTP server at 60 s: the tool
|
|
151
|
+
part fails with "The operation timed out." and the turn goes on. A stdio
|
|
152
|
+
server's call is not cut. `MCP_TOOL_TIMEOUT` (milliseconds) in the turn's
|
|
153
|
+
`env` lifts it (measured with `120000` and a 75 s tool). Codex cuts no call
|
|
154
|
+
by default (measured to 100 s); its own config has a
|
|
155
|
+
per-server `tool_timeout_sec`.
|
|
156
|
+
|
|
147
157
|
Below `inheritConfig: "all"` every Codex turn needs a home of its session's
|
|
148
158
|
own, so the bin refuses `--acp --harness codex-app-server` with
|
|
149
159
|
`--inherit-config project` or `none`.
|
|
@@ -417,7 +427,18 @@ recipe is in
|
|
|
417
427
|
A login lands in the store a turn with the same `env` uses (`CLAUDE_CONFIG_DIR`,
|
|
418
428
|
`CODEX_HOME`). Claude reports the credential a turn would run with, so a key in
|
|
419
429
|
the environment shows as `source: "environment"` over any login. A login change
|
|
420
|
-
starts each session's next turn on a new CLI. Codex
|
|
430
|
+
starts each session's next turn on a new CLI. A Codex session on its home's own
|
|
431
|
+
login also follows a change made outside the engine (`codex login` in a
|
|
432
|
+
terminal, another app): when the home's `auth.json` (a link followed to its
|
|
433
|
+
target) changed since its app-server started, the next turn starts a new one,
|
|
434
|
+
which resumes the thread; a turn already running finishes first. The engine
|
|
435
|
+
never opens the file, so any rewrite counts, a ChatGPT token Codex renewed
|
|
436
|
+
(about every ten days per login) included: one colder turn. A sign-out removes
|
|
437
|
+
the file, and the next turn fails `auth`. Not followed: a keychain store
|
|
438
|
+
(`cli_auth_credentials_store = "keyring"`, or `auto` with a keychain), and a
|
|
439
|
+
session the engine hands a login to (`credentials`, `userLogin`, `apiKey`),
|
|
440
|
+
which is logged in again at each turn. A warm Claude CLI reads its store on
|
|
441
|
+
each request (LLP 0011). Codex logins below `inheritConfig:
|
|
421
442
|
"all"` land in the `CODEX_HOME` the request's `env` names; under
|
|
422
443
|
`codexAppServer.userLogin` the turns in those homes run on the user's own
|
|
423
444
|
login, which a request with no `env` reads and signs in. The engine reads and
|
|
@@ -639,7 +660,7 @@ refused when the script is read, never skipped.
|
|
|
639
660
|
| `{ echo: "input" }` | Says the turn's input as a model reads it (`inputToText`). |
|
|
640
661
|
| `{ echo: "config" }` | Says the turn's config as JSON: `model`, `thinkingLevel`, `cwd`, `additionalDirectories`, `systemPromptAppend`, `permissionMode`, the names of its MCP servers and the keys of its `env`, never their values. |
|
|
641
662
|
| `{ wait: ms }` | A pause; a cancel ends it. |
|
|
642
|
-
| `{ hang: true, stopTakes?: ms }` | Runs until the turn is cancelled; `stopTakes` ms more before it stops, as a harness slow to stop. The cancel is confirmed at once. |
|
|
663
|
+
| `{ hang: true, stopTakes?: ms }` | Runs until the turn is cancelled; `stopTakes` ms more before it stops, as a harness slow to stop, also when the cancel came before the hang began. The cancel is confirmed at once. |
|
|
643
664
|
| `{ fail: string, category? }` | Ends the turn in an error: of `category` when given, else what the engine's classifier makes of the text. |
|
|
644
665
|
| `{ end: true, stopReason?, usage?, cost? }` | Ends the turn: `end_turn` and zero usage by default. |
|
|
645
666
|
|
|
@@ -730,9 +751,13 @@ once. Unstable methods (`session/list`, `session/fork`, `session/delete`,
|
|
|
730
751
|
for Codex home ownership, supported transports, and live-update behavior.
|
|
731
752
|
- **Codex app-server threads have one writer** (CLI 0.160 and newer). A
|
|
732
753
|
thread still loaded by a live session cannot be resumed from another
|
|
733
|
-
process; the turn fails with `
|
|
734
|
-
writer")
|
|
735
|
-
|
|
754
|
+
process; the turn fails with `resume_busy` ("already has an active
|
|
755
|
+
writer"), and the same resume succeeds once the other process has let the
|
|
756
|
+
thread go. Close the first session (`session/close`) or let its process end
|
|
757
|
+
before resuming elsewhere. A thread that is gone fails `resume_failed` ("no
|
|
758
|
+
rollout found for thread id"): offer a fresh start for that one, not a
|
|
759
|
+
retry. Claude has no such case: its CLI takes no writer lock, so a
|
|
760
|
+
conversation is resumed or `resume_failed`.
|
|
736
761
|
- The **BYOK proxy** (`/core/proxy`) is a building block, not yet auto-wired
|
|
737
762
|
into the harnesses (they use ambient/explicit keys today).
|
|
738
763
|
- **Hook bridge** (PreToolUse/Stop decisions) is exposed for the claude
|