@letta-ai/letta-code 0.34.69 → 0.34.71
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/cursor-worker.js +5 -1
- package/dist/agent-presets.js.map +7 -7
- package/dist/app-server-client.cjs.map +3 -3
- package/dist/app-server-client.js.map +3 -3
- package/dist/ask-user-question.cjs.map +2 -2
- package/dist/ask-user-question.js.map +2 -2
- package/dist/channels-public.js.map +8 -8
- package/dist/channels-slack.js.map +9 -9
- package/dist/channels-telegram.js.map +6 -6
- package/dist/gateway-core.js.map +8 -8
- package/dist/mcp-client.js +2 -2
- package/dist/mcp-client.js.map +3 -3
- package/dist/mcp-oauth.js +2 -2
- package/dist/mcp-oauth.js.map +11 -11
- package/dist/memory-confinement.js.map +11 -11
- package/dist/memory-constraints.js.map +3 -3
- package/dist/schedules.js.map +2 -2
- package/dist/types/agent/acting-user.d.ts +0 -16
- package/dist/types/agent/acting-user.d.ts.map +1 -1
- package/dist/types/agent/agent-tags.d.ts +0 -13
- package/dist/types/agent/agent-tags.d.ts.map +1 -1
- package/dist/types/agent/approval-execution.d.ts +0 -60
- package/dist/types/agent/approval-execution.d.ts.map +1 -1
- package/dist/types/agent/approval-result-normalization.d.ts +0 -8
- package/dist/types/agent/approval-result-normalization.d.ts.map +1 -1
- package/dist/types/agent/available-models.d.ts +0 -22
- package/dist/types/agent/available-models.d.ts.map +1 -1
- package/dist/types/agent/client-skills-baseline-store.d.ts +0 -26
- package/dist/types/agent/client-skills-baseline-store.d.ts.map +1 -1
- package/dist/types/agent/client-skills-baseline.d.ts +0 -29
- package/dist/types/agent/client-skills-baseline.d.ts.map +1 -1
- package/dist/types/agent/client-skills-watcher.d.ts +0 -6
- package/dist/types/agent/client-skills-watcher.d.ts.map +1 -1
- package/dist/types/agent/client-skills.d.ts +0 -39
- package/dist/types/agent/client-skills.d.ts.map +1 -1
- package/dist/types/agent/cloud-managed-system-prompt.d.ts +0 -1
- package/dist/types/agent/cloud-managed-system-prompt.d.ts.map +1 -1
- package/dist/types/agent/context.d.ts +0 -43
- package/dist/types/agent/context.d.ts.map +1 -1
- package/dist/types/agent/create-agent-request.d.ts +0 -34
- package/dist/types/agent/create-agent-request.d.ts.map +1 -1
- package/dist/types/agent/legacy-default-system-prompt-hashes.d.ts +0 -12
- package/dist/types/agent/legacy-default-system-prompt-hashes.d.ts.map +1 -1
- package/dist/types/agent/mcp-originator-authority-file.d.ts +0 -54
- package/dist/types/agent/mcp-originator-authority-file.d.ts.map +1 -1
- package/dist/types/agent/mcp-originator-authority.d.ts +0 -105
- package/dist/types/agent/mcp-originator-authority.d.ts.map +1 -1
- package/dist/types/agent/mcp-originator-keepalive.d.ts +0 -41
- package/dist/types/agent/mcp-originator-keepalive.d.ts.map +1 -1
- package/dist/types/agent/mcp-originator-tokens.d.ts +0 -178
- package/dist/types/agent/mcp-originator-tokens.d.ts.map +1 -1
- package/dist/types/agent/memory-auth.d.ts +0 -1
- package/dist/types/agent/memory-auth.d.ts.map +1 -1
- package/dist/types/agent/memory-conflict-repair.d.ts +3 -25
- package/dist/types/agent/memory-conflict-repair.d.ts.map +1 -1
- package/dist/types/agent/memory-constraints-audit.d.ts +0 -6
- package/dist/types/agent/memory-constraints-audit.d.ts.map +1 -1
- package/dist/types/agent/memory-constraints.d.ts +0 -26
- package/dist/types/agent/memory-constraints.d.ts.map +1 -1
- package/dist/types/agent/memory-filesystem.d.ts +0 -91
- package/dist/types/agent/memory-filesystem.d.ts.map +1 -1
- package/dist/types/agent/memory-git-config-lock.d.ts +0 -24
- package/dist/types/agent/memory-git-config-lock.d.ts.map +1 -1
- package/dist/types/agent/memory-git-dir.d.ts +0 -5
- package/dist/types/agent/memory-git-dir.d.ts.map +1 -1
- package/dist/types/agent/memory-git-hooks.d.ts +0 -42
- package/dist/types/agent/memory-git-hooks.d.ts.map +1 -1
- package/dist/types/agent/memory-git-process.d.ts +0 -1
- package/dist/types/agent/memory-git-process.d.ts.map +1 -1
- package/dist/types/agent/memory-git-signing.d.ts +0 -12
- package/dist/types/agent/memory-git-signing.d.ts.map +1 -1
- package/dist/types/agent/memory-git-windows-credentials.d.ts +0 -2
- package/dist/types/agent/memory-git-windows-credentials.d.ts.map +1 -1
- package/dist/types/agent/memory-git.d.ts +0 -80
- package/dist/types/agent/memory-git.d.ts.map +1 -1
- package/dist/types/agent/memory-operation.d.ts +0 -11
- package/dist/types/agent/memory-operation.d.ts.map +1 -1
- package/dist/types/agent/memory-runtime.d.ts +0 -8
- package/dist/types/agent/memory-runtime.d.ts.map +1 -1
- package/dist/types/agent/memory.d.ts +0 -19
- package/dist/types/agent/memory.d.ts.map +1 -1
- package/dist/types/agent/message-attribution.d.ts +0 -2
- package/dist/types/agent/message-attribution.d.ts.map +1 -1
- package/dist/types/agent/message.d.ts +0 -49
- package/dist/types/agent/message.d.ts.map +1 -1
- package/dist/types/agent/model-catalog.d.ts +0 -23
- package/dist/types/agent/model-catalog.d.ts.map +1 -1
- package/dist/types/agent/model.d.ts +0 -99
- package/dist/types/agent/model.d.ts.map +1 -1
- package/dist/types/agent/modify.d.ts +0 -88
- package/dist/types/agent/modify.d.ts.map +1 -1
- package/dist/types/agent/organization-id.d.ts +0 -19
- package/dist/types/agent/organization-id.d.ts.map +1 -1
- package/dist/types/agent/parent-memory-note.d.ts +0 -1
- package/dist/types/agent/parent-memory-note.d.ts.map +1 -1
- package/dist/types/agent/personality-default-files.d.ts.map +1 -1
- package/dist/types/agent/personality-presets.d.ts +0 -19
- package/dist/types/agent/personality-presets.d.ts.map +1 -1
- package/dist/types/agent/preloaded-skills.d.ts +0 -1
- package/dist/types/agent/preloaded-skills.d.ts.map +1 -1
- package/dist/types/agent/prompt-assets.d.ts +0 -11
- package/dist/types/agent/prompt-assets.d.ts.map +1 -1
- package/dist/types/agent/shared-memory-skills.d.ts +0 -4
- package/dist/types/agent/shared-memory-skills.d.ts.map +1 -1
- package/dist/types/agent/skill-sources.d.ts +0 -3
- package/dist/types/agent/skill-sources.d.ts.map +1 -1
- package/dist/types/agent/skills.d.ts +0 -73
- package/dist/types/agent/skills.d.ts.map +1 -1
- package/dist/types/agent/subagent-events.d.ts +0 -15
- package/dist/types/agent/subagent-events.d.ts.map +1 -1
- package/dist/types/agent/subagent-state.d.ts +4 -134
- package/dist/types/agent/subagent-state.d.ts.map +1 -1
- package/dist/types/agent/subagents/background-link.d.ts +1 -4
- package/dist/types/agent/subagents/background-link.d.ts.map +1 -1
- package/dist/types/agent/subagents/child-send-tracking.d.ts +5 -15
- package/dist/types/agent/subagents/child-send-tracking.d.ts.map +1 -1
- package/dist/types/agent/subagents/context-budget.d.ts +0 -8
- package/dist/types/agent/subagents/context-budget.d.ts.map +1 -1
- package/dist/types/agent/subagents/ephemeral-subagent.d.ts +1 -31
- package/dist/types/agent/subagents/ephemeral-subagent.d.ts.map +1 -1
- package/dist/types/agent/subagents/fork-conversation.d.ts +0 -1
- package/dist/types/agent/subagents/fork-conversation.d.ts.map +1 -1
- package/dist/types/agent/subagents/index.d.ts +0 -49
- package/dist/types/agent/subagents/index.d.ts.map +1 -1
- package/dist/types/agent/subagents/manager.d.ts +1 -29
- package/dist/types/agent/subagents/manager.d.ts.map +1 -1
- package/dist/types/agent/subagents/memory-handoff.d.ts +0 -3
- package/dist/types/agent/subagents/memory-handoff.d.ts.map +1 -1
- package/dist/types/agent/subagents/memory-worker-session.d.ts +0 -5
- package/dist/types/agent/subagents/memory-worker-session.d.ts.map +1 -1
- package/dist/types/agent/subagents/memory-worker.d.ts +0 -14
- package/dist/types/agent/subagents/memory-worker.d.ts.map +1 -1
- package/dist/types/agent/subagents/names.d.ts +0 -2
- package/dist/types/agent/subagents/names.d.ts.map +1 -1
- package/dist/types/agent/subagents/parent-transcript.d.ts +0 -14
- package/dist/types/agent/subagents/parent-transcript.d.ts.map +1 -1
- package/dist/types/agent/subagents/remote-turn-wait.d.ts +0 -2
- package/dist/types/agent/subagents/remote-turn-wait.d.ts.map +1 -1
- package/dist/types/agent/subagents/sandbox.d.ts +0 -43
- package/dist/types/agent/subagents/sandbox.d.ts.map +1 -1
- package/dist/types/agent/subagents/subagent-depth.d.ts +0 -9
- package/dist/types/agent/subagents/subagent-depth.d.ts.map +1 -1
- package/dist/types/agent/subagents/subagent-launcher.d.ts +1 -42
- package/dist/types/agent/subagents/subagent-launcher.d.ts.map +1 -1
- package/dist/types/agent/subagents/subagent-model.d.ts +0 -8
- package/dist/types/agent/subagents/subagent-model.d.ts.map +1 -1
- package/dist/types/agent/subagents/subagent-names.d.ts +0 -5
- package/dist/types/agent/subagents/subagent-names.d.ts.map +1 -1
- package/dist/types/agent/subagents/subagent-process.d.ts +0 -11
- package/dist/types/agent/subagents/subagent-process.d.ts.map +1 -1
- package/dist/types/agent/subagents/subagent-refusal.d.ts +0 -2
- package/dist/types/agent/subagents/subagent-refusal.d.ts.map +1 -1
- package/dist/types/agent/subagents/subagent-reminders.d.ts +0 -3
- package/dist/types/agent/subagents/subagent-reminders.d.ts.map +1 -1
- package/dist/types/agent/subagents/subagent-stream.d.ts +0 -44
- package/dist/types/agent/subagents/subagent-stream.d.ts.map +1 -1
- package/dist/types/agent/system-prompt-resolution.d.ts +0 -33
- package/dist/types/agent/system-prompt-resolution.d.ts.map +1 -1
- package/dist/types/agent/system-prompt-size.d.ts +0 -23
- package/dist/types/agent/system-prompt-size.d.ts.map +1 -1
- package/dist/types/agent/system-prompt-versioning.d.ts.map +1 -1
- package/dist/types/agent/turn-recovery-policy.d.ts +0 -83
- package/dist/types/agent/turn-recovery-policy.d.ts.map +1 -1
- package/dist/types/agent-presets.d.ts +0 -11
- package/dist/types/agent-presets.d.ts.map +1 -1
- package/dist/types/agent-settings.d.ts +0 -1
- package/dist/types/agent-settings.d.ts.map +1 -1
- package/dist/types/app-server-client.d.ts +0 -30
- package/dist/types/app-server-client.d.ts.map +1 -1
- package/dist/types/ask-user-question.d.ts +0 -3
- package/dist/types/ask-user-question.d.ts.map +1 -1
- package/dist/types/auth/desktop-credentials.d.ts +0 -3
- package/dist/types/auth/desktop-credentials.d.ts.map +1 -1
- package/dist/types/auth/oauth-refresh.d.ts.map +1 -1
- package/dist/types/auth/oauth.d.ts +0 -27
- package/dist/types/auth/oauth.d.ts.map +1 -1
- package/dist/types/auth/org-credentials-session.d.ts +0 -27
- package/dist/types/auth/org-credentials-session.d.ts.map +1 -1
- package/dist/types/backend/api/agent-message.d.ts +0 -12
- package/dist/types/backend/api/agent-message.d.ts.map +1 -1
- package/dist/types/backend/api/agents.d.ts +0 -20
- package/dist/types/backend/api/agents.d.ts.map +1 -1
- package/dist/types/backend/api/client.d.ts.map +1 -1
- package/dist/types/backend/api/conversation-enqueue.d.ts +0 -10
- package/dist/types/backend/api/conversation-enqueue.d.ts.map +1 -1
- package/dist/types/backend/api/conversations.d.ts +0 -1
- package/dist/types/backend/api/conversations.d.ts.map +1 -1
- package/dist/types/backend/api/environments.d.ts +9 -10
- package/dist/types/backend/api/environments.d.ts.map +1 -1
- package/dist/types/backend/api/ephemeral-conversations.d.ts +1 -1
- package/dist/types/backend/api/ephemeral-conversations.d.ts.map +1 -1
- package/dist/types/backend/api/generate.d.ts.map +1 -1
- package/dist/types/backend/api/http-headers.d.ts +0 -7
- package/dist/types/backend/api/http-headers.d.ts.map +1 -1
- package/dist/types/backend/api/mcp-originator-resolver.d.ts +0 -6
- package/dist/types/backend/api/mcp-originator-resolver.d.ts.map +1 -1
- package/dist/types/backend/api/mcp-subprocess-broker.d.ts +0 -8
- package/dist/types/backend/api/mcp-subprocess-broker.d.ts.map +1 -1
- package/dist/types/backend/api/memfs-git-proxy.d.ts +0 -23
- package/dist/types/backend/api/memfs-git-proxy.d.ts.map +1 -1
- package/dist/types/backend/api/metadata.d.ts +0 -1
- package/dist/types/backend/api/metadata.d.ts.map +1 -1
- package/dist/types/backend/api/monitors.d.ts.map +1 -1
- package/dist/types/backend/api/providers.d.ts +0 -5
- package/dist/types/backend/api/providers.d.ts.map +1 -1
- package/dist/types/backend/api/reflection-runs.d.ts +0 -1
- package/dist/types/backend/api/reflection-runs.d.ts.map +1 -1
- package/dist/types/backend/api/request.d.ts +0 -6
- package/dist/types/backend/api/request.d.ts.map +1 -1
- package/dist/types/backend/api/schedules.d.ts +0 -22
- package/dist/types/backend/api/schedules.d.ts.map +1 -1
- package/dist/types/backend/api/server-url.d.ts +0 -8
- package/dist/types/backend/api/server-url.d.ts.map +1 -1
- package/dist/types/backend/api/subagents.d.ts +48 -0
- package/dist/types/backend/api/subagents.d.ts.map +1 -0
- package/dist/types/backend/api/unified-mcp.d.ts +0 -6
- package/dist/types/backend/api/unified-mcp.d.ts.map +1 -1
- package/dist/types/backend/api/usage-cost.d.ts +0 -2
- package/dist/types/backend/api/usage-cost.d.ts.map +1 -1
- package/dist/types/backend/backend-mode.d.ts +0 -8
- package/dist/types/backend/backend-mode.d.ts.map +1 -1
- package/dist/types/backend/backend.d.ts +0 -19
- package/dist/types/backend/backend.d.ts.map +1 -1
- package/dist/types/backend/compaction-events.d.ts +0 -15
- package/dist/types/backend/compaction-events.d.ts.map +1 -1
- package/dist/types/backend/dev/fake-headless-backend.d.ts.map +1 -1
- package/dist/types/backend/dev/headless-turn-executor.d.ts +0 -4
- package/dist/types/backend/dev/headless-turn-executor.d.ts.map +1 -1
- package/dist/types/backend/dev/local-provider-errors.d.ts.map +1 -1
- package/dist/types/backend/dev/pi-api-streams.d.ts +0 -7
- package/dist/types/backend/dev/pi-api-streams.d.ts.map +1 -1
- package/dist/types/backend/dev/pi-image-elision.d.ts.map +1 -1
- package/dist/types/backend/dev/pi-llama-cpp-provider.d.ts +0 -8
- package/dist/types/backend/dev/pi-llama-cpp-provider.d.ts.map +1 -1
- package/dist/types/backend/dev/pi-lmstudio-provider.d.ts +0 -6
- package/dist/types/backend/dev/pi-lmstudio-provider.d.ts.map +1 -1
- package/dist/types/backend/dev/pi-local-endpoint-provider.d.ts +0 -40
- package/dist/types/backend/dev/pi-local-endpoint-provider.d.ts.map +1 -1
- package/dist/types/backend/dev/pi-messages.d.ts +0 -1
- package/dist/types/backend/dev/pi-messages.d.ts.map +1 -1
- package/dist/types/backend/dev/pi-mod-provider.d.ts +0 -15
- package/dist/types/backend/dev/pi-mod-provider.d.ts.map +1 -1
- package/dist/types/backend/dev/pi-model-factory.d.ts +0 -12
- package/dist/types/backend/dev/pi-model-factory.d.ts.map +1 -1
- package/dist/types/backend/dev/pi-models-runtime.d.ts +0 -83
- package/dist/types/backend/dev/pi-models-runtime.d.ts.map +1 -1
- package/dist/types/backend/dev/pi-oauth.d.ts +0 -6
- package/dist/types/backend/dev/pi-oauth.d.ts.map +1 -1
- package/dist/types/backend/dev/pi-ollama-provider.d.ts +0 -22
- package/dist/types/backend/dev/pi-ollama-provider.d.ts.map +1 -1
- package/dist/types/backend/dev/pi-openai-compatible-provider.d.ts +0 -5
- package/dist/types/backend/dev/pi-openai-compatible-provider.d.ts.map +1 -1
- package/dist/types/backend/dev/pi-provider-mod-registry.d.ts +0 -5
- package/dist/types/backend/dev/pi-provider-mod-registry.d.ts.map +1 -1
- package/dist/types/backend/dev/pi-provider-mod-types.d.ts +0 -7
- package/dist/types/backend/dev/pi-provider-mod-types.d.ts.map +1 -1
- package/dist/types/backend/dev/pi-provider-registry.d.ts +0 -5
- package/dist/types/backend/dev/pi-provider-registry.d.ts.map +1 -1
- package/dist/types/backend/dev/pi-request-headers.d.ts +0 -1
- package/dist/types/backend/dev/pi-request-headers.d.ts.map +1 -1
- package/dist/types/backend/dev/pi-stream-adapter.d.ts +4 -16
- package/dist/types/backend/dev/pi-stream-adapter.d.ts.map +1 -1
- package/dist/types/backend/dev/provider-turn-executor.d.ts +0 -26
- package/dist/types/backend/dev/provider-turn-executor.d.ts.map +1 -1
- package/dist/types/backend/local/compaction-transcript.d.ts.map +1 -1
- package/dist/types/backend/local/compaction.d.ts +0 -8
- package/dist/types/backend/local/compaction.d.ts.map +1 -1
- package/dist/types/backend/local/initial-memory.d.ts +0 -4
- package/dist/types/backend/local/initial-memory.d.ts.map +1 -1
- package/dist/types/backend/local/local-agent-record-file.d.ts +0 -7
- package/dist/types/backend/local/local-agent-record-file.d.ts.map +1 -1
- package/dist/types/backend/local/local-agent-record.d.ts.map +1 -1
- package/dist/types/backend/local/local-backend.d.ts +2 -22
- package/dist/types/backend/local/local-backend.d.ts.map +1 -1
- package/dist/types/backend/local/local-context-estimate.d.ts.map +1 -1
- package/dist/types/backend/local/local-conversation-key.d.ts +0 -4
- package/dist/types/backend/local/local-conversation-key.d.ts.map +1 -1
- package/dist/types/backend/local/local-executor-factory.d.ts +2 -7
- package/dist/types/backend/local/local-executor-factory.d.ts.map +1 -1
- package/dist/types/backend/local/local-message-list-options.d.ts +0 -1
- package/dist/types/backend/local/local-message-list-options.d.ts.map +1 -1
- package/dist/types/backend/local/local-message-projection.d.ts.map +1 -1
- package/dist/types/backend/local/local-message.d.ts +0 -10
- package/dist/types/backend/local/local-message.d.ts.map +1 -1
- package/dist/types/backend/local/local-model-config.d.ts +0 -5
- package/dist/types/backend/local/local-model-config.d.ts.map +1 -1
- package/dist/types/backend/local/local-pi-credential-store.d.ts +0 -16
- package/dist/types/backend/local/local-pi-credential-store.d.ts.map +1 -1
- package/dist/types/backend/local/local-provider-auth-store.d.ts +0 -6
- package/dist/types/backend/local/local-provider-auth-store.d.ts.map +1 -1
- package/dist/types/backend/local/local-provider-timeout.d.ts.map +1 -1
- package/dist/types/backend/local/local-store.d.ts +0 -37
- package/dist/types/backend/local/local-store.d.ts.map +1 -1
- package/dist/types/backend/local/local-stream-chunks.d.ts +0 -2
- package/dist/types/backend/local/local-stream-chunks.d.ts.map +1 -1
- package/dist/types/backend/local/local-transcript-history.d.ts +0 -13
- package/dist/types/backend/local/local-transcript-history.d.ts.map +1 -1
- package/dist/types/backend/local/local-transcript.d.ts +0 -60
- package/dist/types/backend/local/local-transcript.d.ts.map +1 -1
- package/dist/types/backend/local/local-types.d.ts +0 -7
- package/dist/types/backend/local/local-types.d.ts.map +1 -1
- package/dist/types/backend/local/paths.d.ts +0 -1
- package/dist/types/backend/local/paths.d.ts.map +1 -1
- package/dist/types/backend/local/system-prompt-compilation.d.ts +0 -1
- package/dist/types/backend/local/system-prompt-compilation.d.ts.map +1 -1
- package/dist/types/browser-device-mcp-oauth.d.ts +0 -19
- package/dist/types/browser-device-mcp-oauth.d.ts.map +1 -1
- package/dist/types/channels/command-runtime-executor.d.ts +0 -56
- package/dist/types/channels/command-runtime-executor.d.ts.map +1 -1
- package/dist/types/channels/command-surface.d.ts +0 -49
- package/dist/types/channels/command-surface.d.ts.map +1 -1
- package/dist/types/channels/control-request-coordinator.d.ts.map +1 -1
- package/dist/types/channels/gateway-core.d.ts +0 -7
- package/dist/types/channels/gateway-core.d.ts.map +1 -1
- package/dist/types/channels/message-channel-bindings.d.ts +0 -1
- package/dist/types/channels/message-channel-bindings.d.ts.map +1 -1
- package/dist/types/channels/message-channel-executor.d.ts +0 -8
- package/dist/types/channels/message-channel-executor.d.ts.map +1 -1
- package/dist/types/channels/message-channel-idempotency.d.ts +0 -5
- package/dist/types/channels/message-channel-idempotency.d.ts.map +1 -1
- package/dist/types/channels/message-channel-tool-definition.d.ts +0 -3
- package/dist/types/channels/message-channel-tool-definition.d.ts.map +1 -1
- package/dist/types/channels/message-channel-types.d.ts +0 -2
- package/dist/types/channels/message-channel-types.d.ts.map +1 -1
- package/dist/types/channels/message-references.d.ts +0 -5
- package/dist/types/channels/message-references.d.ts.map +1 -1
- package/dist/types/channels/plugin-types.d.ts +0 -57
- package/dist/types/channels/plugin-types.d.ts.map +1 -1
- package/dist/types/channels/progress-builder.d.ts +0 -6
- package/dist/types/channels/progress-builder.d.ts.map +1 -1
- package/dist/types/channels/progress-formatting.d.ts +0 -7
- package/dist/types/channels/progress-formatting.d.ts.map +1 -1
- package/dist/types/channels/progress-types.d.ts +0 -12
- package/dist/types/channels/progress-types.d.ts.map +1 -1
- package/dist/types/channels/route-thread-key.d.ts +0 -16
- package/dist/types/channels/route-thread-key.d.ts.map +1 -1
- package/dist/types/channels/slack/attachment-primitives.d.ts +0 -15
- package/dist/types/channels/slack/attachment-primitives.d.ts.map +1 -1
- package/dist/types/channels/slack/bot-policy.d.ts.map +1 -1
- package/dist/types/channels/slack/message-action-contract.d.ts +0 -11
- package/dist/types/channels/slack/message-action-contract.d.ts.map +1 -1
- package/dist/types/channels/slack/model-picker-blocks.d.ts +0 -5
- package/dist/types/channels/slack/model-picker-blocks.d.ts.map +1 -1
- package/dist/types/channels/slack/status-controller.d.ts +0 -1
- package/dist/types/channels/slack/status-controller.d.ts.map +1 -1
- package/dist/types/channels/telegram/debounce.d.ts +0 -11
- package/dist/types/channels/telegram/debounce.d.ts.map +1 -1
- package/dist/types/channels/telegram/ingress.d.ts +0 -12
- package/dist/types/channels/telegram/ingress.d.ts.map +1 -1
- package/dist/types/channels/telegram/message-action-contract.d.ts +0 -10
- package/dist/types/channels/telegram/message-action-contract.d.ts.map +1 -1
- package/dist/types/channels/telegram/message-shapes.d.ts +0 -14
- package/dist/types/channels/telegram/message-shapes.d.ts.map +1 -1
- package/dist/types/channels/telegram/outbound.d.ts +0 -8
- package/dist/types/channels/telegram/outbound.d.ts.map +1 -1
- package/dist/types/channels/types.d.ts +0 -355
- package/dist/types/channels/types.d.ts.map +1 -1
- package/dist/types/channels/whatsapp/attachment-policy-types.d.ts +0 -5
- package/dist/types/channels/whatsapp/attachment-policy-types.d.ts.map +1 -1
- package/dist/types/channels/whatsapp/message-prefix-config-types.d.ts +0 -1
- package/dist/types/channels/whatsapp/message-prefix-config-types.d.ts.map +1 -1
- package/dist/types/channels/whatsapp/waiting-behavior-config-types.d.ts +0 -1
- package/dist/types/channels/whatsapp/waiting-behavior-config-types.d.ts.map +1 -1
- package/dist/types/channels/xml.d.ts +0 -26
- package/dist/types/channels/xml.d.ts.map +1 -1
- package/dist/types/channels-telegram.d.ts +0 -12
- package/dist/types/channels-telegram.d.ts.map +1 -1
- package/dist/types/cli/helpers/accumulator.d.ts +0 -48
- package/dist/types/cli/helpers/accumulator.d.ts.map +1 -1
- package/dist/types/cli/helpers/agent-info.d.ts +0 -5
- package/dist/types/cli/helpers/agent-info.d.ts.map +1 -1
- package/dist/types/cli/helpers/app-urls.d.ts +0 -21
- package/dist/types/cli/helpers/app-urls.d.ts.map +1 -1
- package/dist/types/cli/helpers/chunk-log.d.ts +0 -37
- package/dist/types/cli/helpers/chunk-log.d.ts.map +1 -1
- package/dist/types/cli/helpers/compaction-utils.d.ts +0 -7
- package/dist/types/cli/helpers/compaction-utils.d.ts.map +1 -1
- package/dist/types/cli/helpers/context-tracker.d.ts +0 -7
- package/dist/types/cli/helpers/context-tracker.d.ts.map +1 -1
- package/dist/types/cli/helpers/conversation-bootstrap.d.ts.map +1 -1
- package/dist/types/cli/helpers/conversation-title.d.ts +0 -7
- package/dist/types/cli/helpers/conversation-title.d.ts.map +1 -1
- package/dist/types/cli/helpers/error-context.d.ts +0 -13
- package/dist/types/cli/helpers/error-context.d.ts.map +1 -1
- package/dist/types/cli/helpers/error-formatter.d.ts +0 -29
- package/dist/types/cli/helpers/error-formatter.d.ts.map +1 -1
- package/dist/types/cli/helpers/git-context.d.ts +0 -10
- package/dist/types/cli/helpers/git-context.d.ts.map +1 -1
- package/dist/types/cli/helpers/markdown-split.d.ts +0 -7
- package/dist/types/cli/helpers/markdown-split.d.ts.map +1 -1
- package/dist/types/cli/helpers/memory-reminder.d.ts +0 -3
- package/dist/types/cli/helpers/memory-reminder.d.ts.map +1 -1
- package/dist/types/cli/helpers/session-context.d.ts +0 -17
- package/dist/types/cli/helpers/session-context.d.ts.map +1 -1
- package/dist/types/cli/helpers/stream-processor.d.ts +0 -11
- package/dist/types/cli/helpers/stream-processor.d.ts.map +1 -1
- package/dist/types/cli/helpers/stream-resume.d.ts +0 -4
- package/dist/types/cli/helpers/stream-resume.d.ts.map +1 -1
- package/dist/types/cli/helpers/stream-stall-reconciler.d.ts +0 -4
- package/dist/types/cli/helpers/stream-stall-reconciler.d.ts.map +1 -1
- package/dist/types/cli/helpers/stream-terminal-eof-guard.d.ts +0 -3
- package/dist/types/cli/helpers/stream-terminal-eof-guard.d.ts.map +1 -1
- package/dist/types/cli/helpers/stream.d.ts +0 -15
- package/dist/types/cli/helpers/stream.d.ts.map +1 -1
- package/dist/types/cli/helpers/system-prompt-warning.d.ts +0 -5
- package/dist/types/cli/helpers/system-prompt-warning.d.ts.map +1 -1
- package/dist/types/cli/helpers/tool-name-mapping.d.ts +0 -62
- package/dist/types/cli/helpers/tool-name-mapping.d.ts.map +1 -1
- package/dist/types/cli/helpers/unified-exec-output.d.ts +0 -5
- package/dist/types/cli/helpers/unified-exec-output.d.ts.map +1 -1
- package/dist/types/cli/helpers/zai-errors.d.ts +0 -30
- package/dist/types/cli/helpers/zai-errors.d.ts.map +1 -1
- package/dist/types/cli/subcommands/mcp-connect.d.ts +0 -6
- package/dist/types/cli/subcommands/mcp-connect.d.ts.map +1 -1
- package/dist/types/cli/subcommands/mcp-io.d.ts.map +1 -1
- package/dist/types/cli/subcommands/mcp-search.d.ts.map +1 -1
- package/dist/types/cli/subcommands/mcp.d.ts +0 -8
- package/dist/types/cli/subcommands/mcp.d.ts.map +1 -1
- package/dist/types/constants.d.ts +0 -30
- package/dist/types/constants.d.ts.map +1 -1
- package/dist/types/cron/cron-file.d.ts +0 -101
- package/dist/types/cron/cron-file.d.ts.map +1 -1
- package/dist/types/cron/parse-interval.d.ts +0 -50
- package/dist/types/cron/parse-interval.d.ts.map +1 -1
- package/dist/types/cron/process-identity.d.ts +0 -2
- package/dist/types/cron/process-identity.d.ts.map +1 -1
- package/dist/types/cron/prompt.d.ts +0 -2
- package/dist/types/cron/prompt.d.ts.map +1 -1
- package/dist/types/cron/run-log.d.ts +0 -6
- package/dist/types/cron/run-log.d.ts.map +1 -1
- package/dist/types/cron/runner.d.ts +0 -42
- package/dist/types/cron/runner.d.ts.map +1 -1
- package/dist/types/cron/scheduled-task-prompt.d.ts +0 -13
- package/dist/types/cron/scheduled-task-prompt.d.ts.map +1 -1
- package/dist/types/cron/scheduler.d.ts +0 -36
- package/dist/types/cron/scheduler.d.ts.map +1 -1
- package/dist/types/headless-enqueue-wait.d.ts +0 -5
- package/dist/types/headless-enqueue-wait.d.ts.map +1 -1
- package/dist/types/headless-environment-response.d.ts +0 -45
- package/dist/types/headless-environment-response.d.ts.map +1 -1
- package/dist/types/headless-listener-launch.d.ts +0 -10
- package/dist/types/headless-listener-launch.d.ts.map +1 -1
- package/dist/types/headless-super-run-wait.d.ts +0 -9
- package/dist/types/headless-super-run-wait.d.ts.map +1 -1
- package/dist/types/helpers/usable-directory.d.ts +0 -1
- package/dist/types/helpers/usable-directory.d.ts.map +1 -1
- package/dist/types/hooks/executor.d.ts +0 -25
- package/dist/types/hooks/executor.d.ts.map +1 -1
- package/dist/types/hooks/index.d.ts +0 -49
- package/dist/types/hooks/index.d.ts.map +1 -1
- package/dist/types/hooks/loader.d.ts +0 -50
- package/dist/types/hooks/loader.d.ts.map +1 -1
- package/dist/types/hooks/prompt-executor.d.ts +0 -4
- package/dist/types/hooks/prompt-executor.d.ts.map +1 -1
- package/dist/types/hooks/types.d.ts +0 -203
- package/dist/types/hooks/types.d.ts.map +1 -1
- package/dist/types/image-resize-public.d.ts.map +1 -1
- package/dist/types/lsp/client.d.ts +0 -21
- package/dist/types/lsp/client.d.ts.map +1 -1
- package/dist/types/lsp/manager.d.ts +0 -28
- package/dist/types/lsp/manager.d.ts.map +1 -1
- package/dist/types/lsp/servers/index.d.ts +0 -7
- package/dist/types/lsp/servers/index.d.ts.map +1 -1
- package/dist/types/lsp/servers/python.d.ts +0 -8
- package/dist/types/lsp/servers/python.d.ts.map +1 -1
- package/dist/types/lsp/servers/typescript.d.ts +0 -7
- package/dist/types/lsp/servers/typescript.d.ts.map +1 -1
- package/dist/types/lsp/types.d.ts +0 -40
- package/dist/types/lsp/types.d.ts.map +1 -1
- package/dist/types/managed-cloud-runtime.d.ts +0 -5
- package/dist/types/managed-cloud-runtime.d.ts.map +1 -1
- package/dist/types/mcp-client.d.ts +0 -7
- package/dist/types/mcp-client.d.ts.map +1 -1
- package/dist/types/mcp-oauth-callback.d.ts +0 -9
- package/dist/types/mcp-oauth-callback.d.ts.map +1 -1
- package/dist/types/mcp-oauth-client-name.d.ts +0 -6
- package/dist/types/mcp-oauth-client-name.d.ts.map +1 -1
- package/dist/types/mcp-oauth-identity.d.ts +0 -5
- package/dist/types/mcp-oauth-identity.d.ts.map +1 -1
- package/dist/types/mcp-oauth-public.d.ts +0 -36
- package/dist/types/mcp-oauth-public.d.ts.map +1 -1
- package/dist/types/mcp-oauth.d.ts +0 -26
- package/dist/types/mcp-oauth.d.ts.map +1 -1
- package/dist/types/mcp-runtime.d.ts +0 -4
- package/dist/types/mcp-runtime.d.ts.map +1 -1
- package/dist/types/mcp-scope.d.ts +0 -6
- package/dist/types/mcp-scope.d.ts.map +1 -1
- package/dist/types/memory-confinement.d.ts +0 -9
- package/dist/types/memory-confinement.d.ts.map +1 -1
- package/dist/types/memory-constraints.d.ts +0 -14
- package/dist/types/memory-constraints.d.ts.map +1 -1
- package/dist/types/memory-frontmatter.d.ts +0 -10
- package/dist/types/memory-frontmatter.d.ts.map +1 -1
- package/dist/types/mods/event-emitter.d.ts +0 -1
- package/dist/types/mods/event-emitter.d.ts.map +1 -1
- package/dist/types/mods/mod-adapter.d.ts.map +1 -1
- package/dist/types/mods/mod-engine.d.ts +0 -3
- package/dist/types/mods/mod-engine.d.ts.map +1 -1
- package/dist/types/mods/turn-start-cancel.d.ts +0 -3
- package/dist/types/mods/turn-start-cancel.d.ts.map +1 -1
- package/dist/types/mods/types.d.ts +0 -33
- package/dist/types/mods/types.d.ts.map +1 -1
- package/dist/types/permissions/agent-memory-prefixes.d.ts +0 -1
- package/dist/types/permissions/agent-memory-prefixes.d.ts.map +1 -1
- package/dist/types/permissions/analyzer.d.ts +0 -3
- package/dist/types/permissions/analyzer.d.ts.map +1 -1
- package/dist/types/permissions/canonical.d.ts.map +1 -1
- package/dist/types/permissions/checker.d.ts +0 -40
- package/dist/types/permissions/checker.d.ts.map +1 -1
- package/dist/types/permissions/cli-permissions-instance.d.ts +0 -9
- package/dist/types/permissions/cli-permissions-instance.d.ts.map +1 -1
- package/dist/types/permissions/cli.d.ts +0 -44
- package/dist/types/permissions/cli.d.ts.map +1 -1
- package/dist/types/permissions/cross-agent-guard.d.ts +0 -41
- package/dist/types/permissions/cross-agent-guard.d.ts.map +1 -1
- package/dist/types/permissions/file-path-args.d.ts +0 -1
- package/dist/types/permissions/file-path-args.d.ts.map +1 -1
- package/dist/types/permissions/loader.d.ts +0 -14
- package/dist/types/permissions/loader.d.ts.map +1 -1
- package/dist/types/permissions/matcher.d.ts +0 -35
- package/dist/types/permissions/matcher.d.ts.map +1 -1
- package/dist/types/permissions/memory-confinement-launcher.d.ts +0 -7
- package/dist/types/permissions/memory-confinement-launcher.d.ts.map +1 -1
- package/dist/types/permissions/memory-paths.d.ts +0 -5
- package/dist/types/permissions/memory-paths.d.ts.map +1 -1
- package/dist/types/permissions/memory-write-allowance.d.ts +0 -12
- package/dist/types/permissions/memory-write-allowance.d.ts.map +1 -1
- package/dist/types/permissions/mode.d.ts +0 -37
- package/dist/types/permissions/mode.d.ts.map +1 -1
- package/dist/types/permissions/read-only-letta.d.ts.map +1 -1
- package/dist/types/permissions/read-only-shell.d.ts +0 -3
- package/dist/types/permissions/read-only-shell.d.ts.map +1 -1
- package/dist/types/permissions/sandbox-gate.d.ts +0 -28
- package/dist/types/permissions/sandbox-gate.d.ts.map +1 -1
- package/dist/types/permissions/sandbox-policy.d.ts +0 -116
- package/dist/types/permissions/sandbox-policy.d.ts.map +1 -1
- package/dist/types/permissions/session.d.ts +0 -16
- package/dist/types/permissions/session.d.ts.map +1 -1
- package/dist/types/permissions/shell-analysis.d.ts +0 -20
- package/dist/types/permissions/shell-analysis.d.ts.map +1 -1
- package/dist/types/permissions/types.d.ts +0 -12
- package/dist/types/permissions/types.d.ts.map +1 -1
- package/dist/types/providers/byok-providers.d.ts +0 -60
- package/dist/types/providers/byok-providers.d.ts.map +1 -1
- package/dist/types/providers/chatgpt-provider-auth.d.ts +0 -22
- package/dist/types/providers/chatgpt-provider-auth.d.ts.map +1 -1
- package/dist/types/providers/openai-codex-provider.d.ts +0 -31
- package/dist/types/providers/openai-codex-provider.d.ts.map +1 -1
- package/dist/types/queue/queue-runtime.d.ts +0 -111
- package/dist/types/queue/queue-runtime.d.ts.map +1 -1
- package/dist/types/reflection-settings.d.ts +0 -1
- package/dist/types/reflection-settings.d.ts.map +1 -1
- package/dist/types/reminders/disk-space.d.ts +0 -36
- package/dist/types/reminders/disk-space.d.ts.map +1 -1
- package/dist/types/reminders/engine.d.ts +0 -13
- package/dist/types/reminders/engine.d.ts.map +1 -1
- package/dist/types/reminders/state.d.ts +0 -7
- package/dist/types/reminders/state.d.ts.map +1 -1
- package/dist/types/reminders/variables.d.ts.map +1 -1
- package/dist/types/runtime-context.d.ts +0 -37
- package/dist/types/runtime-context.d.ts.map +1 -1
- package/dist/types/runtime-execution-settings.d.ts +0 -3
- package/dist/types/runtime-execution-settings.d.ts.map +1 -1
- package/dist/types/sandbox/availability.d.ts +0 -44
- package/dist/types/sandbox/availability.d.ts.map +1 -1
- package/dist/types/sandbox/bwrap.d.ts +0 -32
- package/dist/types/sandbox/bwrap.d.ts.map +1 -1
- package/dist/types/sandbox/policy.d.ts +0 -70
- package/dist/types/sandbox/policy.d.ts.map +1 -1
- package/dist/types/sandbox/seatbelt.d.ts +0 -26
- package/dist/types/sandbox/seatbelt.d.ts.map +1 -1
- package/dist/types/sandbox/wrap.d.ts +0 -11
- package/dist/types/sandbox/wrap.d.ts.map +1 -1
- package/dist/types/schedules.d.ts +0 -6
- package/dist/types/schedules.d.ts.map +1 -1
- package/dist/types/settings-manager.d.ts +0 -218
- package/dist/types/settings-manager.d.ts.map +1 -1
- package/dist/types/telemetry/busy-recovery.d.ts +0 -2
- package/dist/types/telemetry/busy-recovery.d.ts.map +1 -1
- package/dist/types/telemetry/channel.d.ts.map +1 -1
- package/dist/types/telemetry/error-reporting.d.ts +1 -8
- package/dist/types/telemetry/error-reporting.d.ts.map +1 -1
- package/dist/types/telemetry/event-queue.d.ts +0 -24
- package/dist/types/telemetry/event-queue.d.ts.map +1 -1
- package/dist/types/telemetry/fatal-error-handler.d.ts +0 -4
- package/dist/types/telemetry/fatal-error-handler.d.ts.map +1 -1
- package/dist/types/telemetry/index.d.ts +0 -63
- package/dist/types/telemetry/index.d.ts.map +1 -1
- package/dist/types/tools/client-preferences.d.ts +0 -2
- package/dist/types/tools/client-preferences.d.ts.map +1 -1
- package/dist/types/tools/client-tool-background.d.ts +0 -2
- package/dist/types/tools/client-tool-background.d.ts.map +1 -1
- package/dist/types/tools/client-tool-serialization.d.ts +0 -1
- package/dist/types/tools/client-tool-serialization.d.ts.map +1 -1
- package/dist/types/tools/commit-trailer.d.ts +0 -22
- package/dist/types/tools/commit-trailer.d.ts.map +1 -1
- package/dist/types/tools/external-tool-background-eligibility.d.ts +0 -2
- package/dist/types/tools/external-tool-background-eligibility.d.ts.map +1 -1
- package/dist/types/tools/external-tool-background.d.ts +0 -8
- package/dist/types/tools/external-tool-background.d.ts.map +1 -1
- package/dist/types/tools/external-tool-content.d.ts +0 -1
- package/dist/types/tools/external-tool-content.d.ts.map +1 -1
- package/dist/types/tools/external-tool-execution.d.ts +0 -1
- package/dist/types/tools/external-tool-execution.d.ts.map +1 -1
- package/dist/types/tools/external-tool-types.d.ts +0 -9
- package/dist/types/tools/external-tool-types.d.ts.map +1 -1
- package/dist/types/tools/filter.d.ts +0 -14
- package/dist/types/tools/filter.d.ts.map +1 -1
- package/dist/types/tools/foreground-yield.d.ts +0 -6
- package/dist/types/tools/foreground-yield.d.ts.map +1 -1
- package/dist/types/tools/hook-feedback.d.ts +0 -10
- package/dist/types/tools/hook-feedback.d.ts.map +1 -1
- package/dist/types/tools/impl/antigravity-session.d.ts +29 -0
- package/dist/types/tools/impl/antigravity-session.d.ts.map +1 -0
- package/dist/types/tools/impl/apply-patch.d.ts +0 -3
- package/dist/types/tools/impl/apply-patch.d.ts.map +1 -1
- package/dist/types/tools/impl/bash.d.ts +0 -15
- package/dist/types/tools/impl/bash.d.ts.map +1 -1
- package/dist/types/tools/impl/claude-repository-skills.d.ts.map +1 -1
- package/dist/types/tools/impl/claude-steer-timeouts.d.ts +0 -18
- package/dist/types/tools/impl/claude-steer-timeouts.d.ts.map +1 -1
- package/dist/types/tools/impl/claude-stream-session-types.d.ts +2 -15
- package/dist/types/tools/impl/claude-stream-session-types.d.ts.map +1 -1
- package/dist/types/tools/impl/claude-stream-session.d.ts +1 -9
- package/dist/types/tools/impl/claude-stream-session.d.ts.map +1 -1
- package/dist/types/tools/impl/code-mode.d.ts +0 -6
- package/dist/types/tools/impl/code-mode.d.ts.map +1 -1
- package/dist/types/tools/impl/codex-app-server-payloads.d.ts +5 -8
- package/dist/types/tools/impl/codex-app-server-payloads.d.ts.map +1 -1
- package/dist/types/tools/impl/codex-app-server.d.ts +1 -5
- package/dist/types/tools/impl/codex-app-server.d.ts.map +1 -1
- package/dist/types/tools/impl/codex-steer-receipt.d.ts +0 -2
- package/dist/types/tools/impl/codex-steer-receipt.d.ts.map +1 -1
- package/dist/types/tools/impl/cursor-session.d.ts +1 -1
- package/dist/types/tools/impl/cursor-session.d.ts.map +1 -1
- package/dist/types/tools/impl/cursor-start-retry.d.ts.map +1 -1
- package/dist/types/tools/impl/cursor-worker.d.ts +2 -0
- package/dist/types/tools/impl/cursor-worker.d.ts.map +1 -1
- package/dist/types/tools/impl/edit.d.ts +0 -10
- package/dist/types/tools/impl/edit.d.ts.map +1 -1
- package/dist/types/tools/impl/enter-worktree-messages.d.ts.map +1 -1
- package/dist/types/tools/impl/enter-worktree.d.ts +0 -19
- package/dist/types/tools/impl/enter-worktree.d.ts.map +1 -1
- package/dist/types/tools/impl/exec-command.d.ts.map +1 -1
- package/dist/types/tools/impl/exit-worktree.d.ts +0 -9
- package/dist/types/tools/impl/exit-worktree.d.ts.map +1 -1
- package/dist/types/tools/impl/external-coding-agent-task.d.ts +0 -7
- package/dist/types/tools/impl/external-coding-agent-task.d.ts.map +1 -1
- package/dist/types/tools/impl/external-coding-agent.d.ts +3 -36
- package/dist/types/tools/impl/external-coding-agent.d.ts.map +1 -1
- package/dist/types/tools/impl/external-fork-context.d.ts +0 -17
- package/dist/types/tools/impl/external-fork-context.d.ts.map +1 -1
- package/dist/types/tools/impl/external-llm-trace-launch.d.ts +1 -4
- package/dist/types/tools/impl/external-llm-trace-launch.d.ts.map +1 -1
- package/dist/types/tools/impl/external-llm-trace-payload.d.ts +1 -3
- package/dist/types/tools/impl/external-llm-trace-payload.d.ts.map +1 -1
- package/dist/types/tools/impl/external-llm-trace-proxy.d.ts +1 -1
- package/dist/types/tools/impl/external-llm-trace-proxy.d.ts.map +1 -1
- package/dist/types/tools/impl/external-llm-trace-session.d.ts +0 -1
- package/dist/types/tools/impl/external-llm-trace-session.d.ts.map +1 -1
- package/dist/types/tools/impl/external-tool-call.d.ts +0 -15
- package/dist/types/tools/impl/external-tool-call.d.ts.map +1 -1
- package/dist/types/tools/impl/foreground-sleep.d.ts +0 -10
- package/dist/types/tools/impl/foreground-sleep.d.ts.map +1 -1
- package/dist/types/tools/impl/fork-prompt.d.ts +0 -1
- package/dist/types/tools/impl/fork-prompt.d.ts.map +1 -1
- package/dist/types/tools/impl/github-pull-request-cloud.d.ts +0 -1
- package/dist/types/tools/impl/github-pull-request-cloud.d.ts.map +1 -1
- package/dist/types/tools/impl/github-pull-request-tracker.d.ts +0 -1
- package/dist/types/tools/impl/github-pull-request-tracker.d.ts.map +1 -1
- package/dist/types/tools/impl/github-pull-request-watch.d.ts +0 -5
- package/dist/types/tools/impl/github-pull-request-watch.d.ts.map +1 -1
- package/dist/types/tools/impl/github-workflow-run.d.ts.map +1 -1
- package/dist/types/tools/impl/glob.d.ts.map +1 -1
- package/dist/types/tools/impl/grep.d.ts.map +1 -1
- package/dist/types/tools/impl/kill-bash.d.ts.map +1 -1
- package/dist/types/tools/impl/list-agents.d.ts +35 -0
- package/dist/types/tools/impl/list-agents.d.ts.map +1 -0
- package/dist/types/tools/impl/ls.d.ts.map +1 -1
- package/dist/types/tools/impl/memory-task-lifecycle.d.ts +0 -27
- package/dist/types/tools/impl/memory-task-lifecycle.d.ts.map +1 -1
- package/dist/types/tools/impl/memory.d.ts +0 -5
- package/dist/types/tools/impl/memory.d.ts.map +1 -1
- package/dist/types/tools/impl/monitor-backup.d.ts +0 -17
- package/dist/types/tools/impl/monitor-backup.d.ts.map +1 -1
- package/dist/types/tools/impl/monitor-script.d.ts +0 -6
- package/dist/types/tools/impl/monitor-script.d.ts.map +1 -1
- package/dist/types/tools/impl/monitor-state.d.ts +0 -1
- package/dist/types/tools/impl/monitor-state.d.ts.map +1 -1
- package/dist/types/tools/impl/monitor-timeout.d.ts +0 -11
- package/dist/types/tools/impl/monitor-timeout.d.ts.map +1 -1
- package/dist/types/tools/impl/monitor-url-cloud.d.ts +0 -13
- package/dist/types/tools/impl/monitor-url-cloud.d.ts.map +1 -1
- package/dist/types/tools/impl/monitor.d.ts.map +1 -1
- package/dist/types/tools/impl/native-session-capture.d.ts +0 -3
- package/dist/types/tools/impl/native-session-capture.d.ts.map +1 -1
- package/dist/types/tools/impl/native-session-owner.d.ts +5 -1
- package/dist/types/tools/impl/native-session-owner.d.ts.map +1 -1
- package/dist/types/tools/impl/opencode-server.d.ts +0 -2
- package/dist/types/tools/impl/opencode-server.d.ts.map +1 -1
- package/dist/types/tools/impl/opencode-session.d.ts +1 -1
- package/dist/types/tools/impl/opencode-session.d.ts.map +1 -1
- package/dist/types/tools/impl/overflow.d.ts +0 -50
- package/dist/types/tools/impl/overflow.d.ts.map +1 -1
- package/dist/types/tools/impl/process_manager.d.ts +0 -34
- package/dist/types/tools/impl/process_manager.d.ts.map +1 -1
- package/dist/types/tools/impl/read-lsp.d.ts.map +1 -1
- package/dist/types/tools/impl/read.d.ts.map +1 -1
- package/dist/types/tools/impl/remote-connect-retry.d.ts +0 -1
- package/dist/types/tools/impl/remote-connect-retry.d.ts.map +1 -1
- package/dist/types/tools/impl/remote-external-coding-agent.d.ts +0 -3
- package/dist/types/tools/impl/remote-external-coding-agent.d.ts.map +1 -1
- package/dist/types/tools/impl/remote-external-worker-computer.d.ts.map +1 -1
- package/dist/types/tools/impl/remote-follow-up-retry.d.ts +0 -2
- package/dist/types/tools/impl/remote-follow-up-retry.d.ts.map +1 -1
- package/dist/types/tools/impl/remote-subagent-events.d.ts +0 -7
- package/dist/types/tools/impl/remote-subagent-events.d.ts.map +1 -1
- package/dist/types/tools/impl/self-matching-pgrep.d.ts +0 -10
- package/dist/types/tools/impl/self-matching-pgrep.d.ts.map +1 -1
- package/dist/types/tools/impl/send-agent-message.d.ts +0 -1
- package/dist/types/tools/impl/send-agent-message.d.ts.map +1 -1
- package/dist/types/tools/impl/shell-env.d.ts +0 -9
- package/dist/types/tools/impl/shell-env.d.ts.map +1 -1
- package/dist/types/tools/impl/shell-launchers.d.ts.map +1 -1
- package/dist/types/tools/impl/shell-runner.d.ts +0 -11
- package/dist/types/tools/impl/shell-runner.d.ts.map +1 -1
- package/dist/types/tools/impl/shell-sandbox.d.ts +1 -31
- package/dist/types/tools/impl/shell-sandbox.d.ts.map +1 -1
- package/dist/types/tools/impl/skill-content-registry.d.ts +0 -18
- package/dist/types/tools/impl/skill-content-registry.d.ts.map +1 -1
- package/dist/types/tools/impl/skill.d.ts +0 -17
- package/dist/types/tools/impl/skill.d.ts.map +1 -1
- package/dist/types/tools/impl/stop-conversation-background.d.ts +0 -1
- package/dist/types/tools/impl/stop-conversation-background.d.ts.map +1 -1
- package/dist/types/tools/impl/subagent-computer.d.ts +0 -38
- package/dist/types/tools/impl/subagent-computer.d.ts.map +1 -1
- package/dist/types/tools/impl/subagent-persistence.d.ts +10 -0
- package/dist/types/tools/impl/subagent-persistence.d.ts.map +1 -0
- package/dist/types/tools/impl/subagent-stop-bridge.d.ts +0 -1
- package/dist/types/tools/impl/subagent-stop-bridge.d.ts.map +1 -1
- package/dist/types/tools/impl/task-abort-hook.d.ts.map +1 -1
- package/dist/types/tools/impl/task-agent-selection.d.ts +1 -6
- package/dist/types/tools/impl/task-agent-selection.d.ts.map +1 -1
- package/dist/types/tools/impl/task-stop.d.ts.map +1 -1
- package/dist/types/tools/impl/task-summary.d.ts +19 -0
- package/dist/types/tools/impl/task-summary.d.ts.map +1 -0
- package/dist/types/tools/impl/task-transcript.d.ts +1 -47
- package/dist/types/tools/impl/task-transcript.d.ts.map +1 -1
- package/dist/types/tools/impl/task.d.ts +2 -50
- package/dist/types/tools/impl/task.d.ts.map +1 -1
- package/dist/types/tools/impl/tasks/store.d.ts +0 -14
- package/dist/types/tools/impl/tasks/store.d.ts.map +1 -1
- package/dist/types/tools/impl/tool-return-clamp.d.ts +0 -31
- package/dist/types/tools/impl/tool-return-clamp.d.ts.map +1 -1
- package/dist/types/tools/impl/truncation.d.ts +0 -21
- package/dist/types/tools/impl/truncation.d.ts.map +1 -1
- package/dist/types/tools/impl/update-plan.d.ts +0 -9
- package/dist/types/tools/impl/update-plan.d.ts.map +1 -1
- package/dist/types/tools/impl/validation.d.ts +0 -4
- package/dist/types/tools/impl/validation.d.ts.map +1 -1
- package/dist/types/tools/impl/wake.d.ts +0 -1
- package/dist/types/tools/impl/wake.d.ts.map +1 -1
- package/dist/types/tools/impl/watch-pr-cloud.d.ts +0 -1
- package/dist/types/tools/impl/watch-pr-cloud.d.ts.map +1 -1
- package/dist/types/tools/impl/watch-pr.d.ts.map +1 -1
- package/dist/types/tools/impl/windows-command-safety.d.ts.map +1 -1
- package/dist/types/tools/impl/workflow.d.ts +0 -30
- package/dist/types/tools/impl/workflow.d.ts.map +1 -1
- package/dist/types/tools/impl/worktree-git.d.ts +0 -16
- package/dist/types/tools/impl/worktree-git.d.ts.map +1 -1
- package/dist/types/tools/manager.d.ts +0 -129
- package/dist/types/tools/manager.d.ts.map +1 -1
- package/dist/types/tools/model-facing-tool.d.ts.map +1 -1
- package/dist/types/tools/permission-mode-state.d.ts +0 -1
- package/dist/types/tools/permission-mode-state.d.ts.map +1 -1
- package/dist/types/tools/removed-tools.d.ts.map +1 -1
- package/dist/types/tools/script-tool-scope.d.ts +0 -2
- package/dist/types/tools/script-tool-scope.d.ts.map +1 -1
- package/dist/types/tools/secret-substitution.d.ts +0 -74
- package/dist/types/tools/secret-substitution.d.ts.map +1 -1
- package/dist/types/tools/subagent-tool-policy.d.ts +0 -3
- package/dist/types/tools/subagent-tool-policy.d.ts.map +1 -1
- package/dist/types/tools/task-tool-assets.d.ts +0 -11
- package/dist/types/tools/task-tool-assets.d.ts.map +1 -1
- package/dist/types/tools/tool-context-retention.d.ts +0 -2
- package/dist/types/tools/tool-context-retention.d.ts.map +1 -1
- package/dist/types/tools/tool-definitions.d.ts +87 -0
- package/dist/types/tools/tool-definitions.d.ts.map +1 -1
- package/dist/types/tools/tool-name-mapping.d.ts +0 -2
- package/dist/types/tools/tool-name-mapping.d.ts.map +1 -1
- package/dist/types/tools/tool-policy.d.ts +0 -7
- package/dist/types/tools/tool-policy.d.ts.map +1 -1
- package/dist/types/tools/toolset-catalog.d.ts +1 -3
- package/dist/types/tools/toolset-catalog.d.ts.map +1 -1
- package/dist/types/tools/toolset.d.ts +0 -20
- package/dist/types/tools/toolset.d.ts.map +1 -1
- package/dist/types/tools/workflow/decide.d.ts +0 -1
- package/dist/types/tools/workflow/decide.d.ts.map +1 -1
- package/dist/types/tools/workflow/execution-registry.d.ts +0 -17
- package/dist/types/tools/workflow/execution-registry.d.ts.map +1 -1
- package/dist/types/tools/workflow/format-stats.d.ts +0 -14
- package/dist/types/tools/workflow/format-stats.d.ts.map +1 -1
- package/dist/types/tools/workflow/journal.d.ts +0 -10
- package/dist/types/tools/workflow/journal.d.ts.map +1 -1
- package/dist/types/tools/workflow/meta.d.ts +0 -10
- package/dist/types/tools/workflow/meta.d.ts.map +1 -1
- package/dist/types/tools/workflow/sdk-loader.d.ts +0 -27
- package/dist/types/tools/workflow/sdk-loader.d.ts.map +1 -1
- package/dist/types/tools/workflow/sdk-spawner.d.ts +0 -32
- package/dist/types/tools/workflow/sdk-spawner.d.ts.map +1 -1
- package/dist/types/tools/workflow/types.d.ts +0 -81
- package/dist/types/tools/workflow/types.d.ts.map +1 -1
- package/dist/types/tools/workflow/workflow-engine.d.ts +0 -18
- package/dist/types/tools/workflow/workflow-engine.d.ts.map +1 -1
- package/dist/types/types/app-server-info.d.ts +1 -9
- package/dist/types/types/app-server-info.d.ts.map +1 -1
- package/dist/types/types/app-server-protocol.d.ts +0 -1
- package/dist/types/types/app-server-protocol.d.ts.map +1 -1
- package/dist/types/types/background-process-protocol.d.ts +0 -2
- package/dist/types/types/background-process-protocol.d.ts.map +1 -1
- package/dist/types/types/client-preferences.d.ts +0 -1
- package/dist/types/types/client-preferences.d.ts.map +1 -1
- package/dist/types/types/conversation-fork-protocol.d.ts +0 -3
- package/dist/types/types/conversation-fork-protocol.d.ts.map +1 -1
- package/dist/types/types/cwd-protocol.d.ts +0 -5
- package/dist/types/types/cwd-protocol.d.ts.map +1 -1
- package/dist/types/types/external-tool-protocol.d.ts +1 -32
- package/dist/types/types/external-tool-protocol.d.ts.map +1 -1
- package/dist/types/types/file-write-protocol.d.ts +0 -23
- package/dist/types/types/file-write-protocol.d.ts.map +1 -1
- package/dist/types/types/input-command.d.ts +0 -23
- package/dist/types/types/input-command.d.ts.map +1 -1
- package/dist/types/types/input-create-message.d.ts +0 -20
- package/dist/types/types/input-create-message.d.ts.map +1 -1
- package/dist/types/types/loop-status-protocol.d.ts +0 -10
- package/dist/types/types/loop-status-protocol.d.ts.map +1 -1
- package/dist/types/types/protocol.d.ts +0 -319
- package/dist/types/types/protocol.d.ts.map +1 -1
- package/dist/types/types/protocol_v2.d.ts +0 -259
- package/dist/types/types/protocol_v2.d.ts.map +1 -1
- package/dist/types/types/provider-oauth-config.d.ts +0 -12
- package/dist/types/types/provider-oauth-config.d.ts.map +1 -1
- package/dist/types/types/queue-update-protocol.d.ts +0 -12
- package/dist/types/types/queue-update-protocol.d.ts.map +1 -1
- package/dist/types/types/runtime-scope.d.ts +0 -12
- package/dist/types/types/runtime-scope.d.ts.map +1 -1
- package/dist/types/types/runtime-start-protocol.d.ts +1 -39
- package/dist/types/types/runtime-start-protocol.d.ts.map +1 -1
- package/dist/types/types/schedule-protocol.d.ts +0 -1
- package/dist/types/types/schedule-protocol.d.ts.map +1 -1
- package/dist/types/types/subagent-protocol.d.ts +0 -42
- package/dist/types/types/subagent-protocol.d.ts.map +1 -1
- package/dist/types/types/task-control-protocol.d.ts +0 -7
- package/dist/types/types/task-control-protocol.d.ts.map +1 -1
- package/dist/types/types/teleport-protocol.d.ts +0 -1
- package/dist/types/types/teleport-protocol.d.ts.map +1 -1
- package/dist/types/types/turn-finished-protocol.d.ts +0 -1
- package/dist/types/types/turn-finished-protocol.d.ts.map +1 -1
- package/dist/types/usage/cost.d.ts +0 -6
- package/dist/types/usage/cost.d.ts.map +1 -1
- package/dist/types/utils/checkout-readiness.d.ts +0 -2
- package/dist/types/utils/checkout-readiness.d.ts.map +1 -1
- package/dist/types/utils/confirm-process-exit.d.ts +0 -1
- package/dist/types/utils/confirm-process-exit.d.ts.map +1 -1
- package/dist/types/utils/create-relayed-abort-controller.d.ts +0 -9
- package/dist/types/utils/create-relayed-abort-controller.d.ts.map +1 -1
- package/dist/types/utils/debug.d.ts +0 -22
- package/dist/types/utils/debug.d.ts.map +1 -1
- package/dist/types/utils/directory-limits.d.ts +0 -3
- package/dist/types/utils/directory-limits.d.ts.map +1 -1
- package/dist/types/utils/disk-reserve.d.ts +0 -2
- package/dist/types/utils/disk-reserve.d.ts.map +1 -1
- package/dist/types/utils/error.d.ts +0 -6
- package/dist/types/utils/error.d.ts.map +1 -1
- package/dist/types/utils/file-lock.d.ts +0 -23
- package/dist/types/utils/file-lock.d.ts.map +1 -1
- package/dist/types/utils/file-path.d.ts +0 -7
- package/dist/types/utils/file-path.d.ts.map +1 -1
- package/dist/types/utils/frontmatter.d.ts +0 -15
- package/dist/types/utils/frontmatter.d.ts.map +1 -1
- package/dist/types/utils/fs.d.ts +0 -16
- package/dist/types/utils/fs.d.ts.map +1 -1
- package/dist/types/utils/image-resize.d.ts.map +1 -1
- package/dist/types/utils/image-resize.magick.d.ts +0 -5
- package/dist/types/utils/image-resize.magick.d.ts.map +1 -1
- package/dist/types/utils/image-resize.shared.d.ts +0 -1
- package/dist/types/utils/image-resize.shared.d.ts.map +1 -1
- package/dist/types/utils/local-backend-paths.d.ts +0 -19
- package/dist/types/utils/local-backend-paths.d.ts.map +1 -1
- package/dist/types/utils/memory-access.d.ts.map +1 -1
- package/dist/types/utils/message-queue-bridge.d.ts +0 -32
- package/dist/types/utils/message-queue-bridge.d.ts.map +1 -1
- package/dist/types/utils/native-cli-env.d.ts +0 -1
- package/dist/types/utils/native-cli-env.d.ts.map +1 -1
- package/dist/types/utils/openai-reasoning-effort.d.ts +0 -4
- package/dist/types/utils/openai-reasoning-effort.d.ts.map +1 -1
- package/dist/types/utils/package-manager-spawn.d.ts +0 -7
- package/dist/types/utils/package-manager-spawn.d.ts.map +1 -1
- package/dist/types/utils/process-liveness.d.ts +0 -25
- package/dist/types/utils/process-liveness.d.ts.map +1 -1
- package/dist/types/utils/rename-sync-with-retry.d.ts.map +1 -1
- package/dist/types/utils/repository-checkout.d.ts +0 -1
- package/dist/types/utils/repository-checkout.d.ts.map +1 -1
- package/dist/types/utils/secrets-store.d.ts +0 -52
- package/dist/types/utils/secrets-store.d.ts.map +1 -1
- package/dist/types/utils/secrets.d.ts +0 -34
- package/dist/types/utils/secrets.d.ts.map +1 -1
- package/dist/types/utils/settings-path.d.ts +0 -6
- package/dist/types/utils/settings-path.d.ts.map +1 -1
- package/dist/types/utils/shell-context.d.ts +0 -7
- package/dist/types/utils/shell-context.d.ts.map +1 -1
- package/dist/types/utils/sleep.d.ts +0 -3
- package/dist/types/utils/sleep.d.ts.map +1 -1
- package/dist/types/utils/stdin.d.ts +0 -1
- package/dist/types/utils/stdin.d.ts.map +1 -1
- package/dist/types/utils/subagent-depth-env.d.ts +0 -6
- package/dist/types/utils/subagent-depth-env.d.ts.map +1 -1
- package/dist/types/utils/subagent-launch-marker.d.ts +1 -1
- package/dist/types/utils/subagent-launch-marker.d.ts.map +1 -1
- package/dist/types/utils/subagent-scope.d.ts +0 -7
- package/dist/types/utils/subagent-scope.d.ts.map +1 -1
- package/dist/types/utils/subagent-stdout-failure.d.ts +0 -6
- package/dist/types/utils/subagent-stdout-failure.d.ts.map +1 -1
- package/dist/types/utils/systemd-workload-scope.d.ts +0 -7
- package/dist/types/utils/systemd-workload-scope.d.ts.map +1 -1
- package/dist/types/utils/task-notifications.d.ts +0 -55
- package/dist/types/utils/task-notifications.d.ts.map +1 -1
- package/dist/types/utils/timing.d.ts +0 -40
- package/dist/types/utils/timing.d.ts.map +1 -1
- package/dist/types/utils/transcript-paths.d.ts +0 -10
- package/dist/types/utils/transcript-paths.d.ts.map +1 -1
- package/dist/types/utils/type-guards.d.ts +0 -5
- package/dist/types/utils/type-guards.d.ts.map +1 -1
- package/dist/types/utils/url.d.ts.map +1 -1
- package/dist/types/utils/variables-store.d.ts.map +1 -1
- package/dist/types/utils/version.d.ts +0 -19
- package/dist/types/utils/version.d.ts.map +1 -1
- package/dist/types/utils/worktree-lock.d.ts +0 -18
- package/dist/types/utils/worktree-lock.d.ts.map +1 -1
- package/dist/types/websocket/listener/background-process-snapshot.d.ts +0 -1
- package/dist/types/websocket/listener/background-process-snapshot.d.ts.map +1 -1
- package/dist/types/websocket/listener/commands/browser-device-mcp-oauth.d.ts +0 -1
- package/dist/types/websocket/listener/commands/browser-device-mcp-oauth.d.ts.map +1 -1
- package/dist/types/websocket/listener/connection.d.ts +0 -7
- package/dist/types/websocket/listener/connection.d.ts.map +1 -1
- package/dist/types/websocket/listener/constants.d.ts +0 -8
- package/dist/types/websocket/listener/constants.d.ts.map +1 -1
- package/dist/types/websocket/listener/conversation-runtime.d.ts +0 -1
- package/dist/types/websocket/listener/conversation-runtime.d.ts.map +1 -1
- package/dist/types/websocket/listener/cwd-change.d.ts +0 -6
- package/dist/types/websocket/listener/cwd-change.d.ts.map +1 -1
- package/dist/types/websocket/listener/cwd.d.ts +0 -14
- package/dist/types/websocket/listener/cwd.d.ts.map +1 -1
- package/dist/types/websocket/listener/device-git-context.d.ts.map +1 -1
- package/dist/types/websocket/listener/device-status-cache.d.ts.map +1 -1
- package/dist/types/websocket/listener/device-toolset-status.d.ts.map +1 -1
- package/dist/types/websocket/listener/durable-file-lock.d.ts +0 -18
- package/dist/types/websocket/listener/durable-file-lock.d.ts.map +1 -1
- package/dist/types/websocket/listener/failed-teleport-cleanup.d.ts.map +1 -1
- package/dist/types/websocket/listener/inbound-queue.d.ts.map +1 -1
- package/dist/types/websocket/listener/input-disposition.d.ts +0 -2
- package/dist/types/websocket/listener/input-disposition.d.ts.map +1 -1
- package/dist/types/websocket/listener/input-terminal-journal.d.ts +0 -15
- package/dist/types/websocket/listener/input-terminal-journal.d.ts.map +1 -1
- package/dist/types/websocket/listener/interrupted-turn-disk-reserve.d.ts +0 -1
- package/dist/types/websocket/listener/interrupted-turn-disk-reserve.d.ts.map +1 -1
- package/dist/types/websocket/listener/interrupted-turn-input-ownership.d.ts +0 -1
- package/dist/types/websocket/listener/interrupted-turn-input-ownership.d.ts.map +1 -1
- package/dist/types/websocket/listener/interrupted-turn-record.d.ts.map +1 -1
- package/dist/types/websocket/listener/interrupted-turn-storage.d.ts.map +1 -1
- package/dist/types/websocket/listener/interrupted-turn-types.d.ts +0 -11
- package/dist/types/websocket/listener/interrupted-turn-types.d.ts.map +1 -1
- package/dist/types/websocket/listener/listener-constants.d.ts +0 -7
- package/dist/types/websocket/listener/listener-constants.d.ts.map +1 -1
- package/dist/types/websocket/listener/org-credentials.d.ts +0 -10
- package/dist/types/websocket/listener/org-credentials.d.ts.map +1 -1
- package/dist/types/websocket/listener/outbound-delivery.d.ts +0 -1
- package/dist/types/websocket/listener/outbound-delivery.d.ts.map +1 -1
- package/dist/types/websocket/listener/outbound-wire.d.ts +0 -56
- package/dist/types/websocket/listener/outbound-wire.d.ts.map +1 -1
- package/dist/types/websocket/listener/permission-mode.d.ts +0 -40
- package/dist/types/websocket/listener/permission-mode.d.ts.map +1 -1
- package/dist/types/websocket/listener/protocol-outbound-routing.d.ts.map +1 -1
- package/dist/types/websocket/listener/protocol-outbound.d.ts.map +1 -1
- package/dist/types/websocket/listener/queue.d.ts.map +1 -1
- package/dist/types/websocket/listener/recovery-lineage-sidecar.d.ts +0 -2
- package/dist/types/websocket/listener/recovery-lineage-sidecar.d.ts.map +1 -1
- package/dist/types/websocket/listener/remote-settings-lock.d.ts +0 -14
- package/dist/types/websocket/listener/remote-settings-lock.d.ts.map +1 -1
- package/dist/types/websocket/listener/remote-settings.d.ts +0 -31
- package/dist/types/websocket/listener/remote-settings.d.ts.map +1 -1
- package/dist/types/websocket/listener/runtime.d.ts +0 -9
- package/dist/types/websocket/listener/runtime.d.ts.map +1 -1
- package/dist/types/websocket/listener/startup-frame-buffer.d.ts +0 -2
- package/dist/types/websocket/listener/startup-frame-buffer.d.ts.map +1 -1
- package/dist/types/websocket/listener/startup-ingress.d.ts +0 -27
- package/dist/types/websocket/listener/startup-ingress.d.ts.map +1 -1
- package/dist/types/websocket/listener/stream-observers.d.ts +0 -12
- package/dist/types/websocket/listener/stream-observers.d.ts.map +1 -1
- package/dist/types/websocket/listener/subagent-state-cache.d.ts +0 -5
- package/dist/types/websocket/listener/subagent-state-cache.d.ts.map +1 -1
- package/dist/types/websocket/listener/transport.d.ts +0 -7
- package/dist/types/websocket/listener/transport.d.ts.map +1 -1
- package/dist/types/websocket/listener/turn-context.d.ts.map +1 -1
- package/dist/types/websocket/listener/turn-finished-replay.d.ts +0 -15
- package/dist/types/websocket/listener/turn-finished-replay.d.ts.map +1 -1
- package/dist/types/websocket/listener/turn-lifecycle.d.ts.map +1 -1
- package/dist/types/websocket/listener/types.d.ts +0 -226
- package/dist/types/websocket/listener/types.d.ts.map +1 -1
- package/dist/types/websocket/listener/worktree-watcher.d.ts +0 -23
- package/dist/types/websocket/listener/worktree-watcher.d.ts.map +1 -1
- package/dist/types/websocket/ws-event-redaction.d.ts +0 -8
- package/dist/types/websocket/ws-event-redaction.d.ts.map +1 -1
- package/image-resize.js.map +4 -4
- package/letta.js +1114 -318
- package/npm-shrinkwrap.json +123 -123
- package/package.json +2 -2
- package/scripts/agent-watch/verify-pr-identity.ts +1 -4
- package/scripts/build-pypi.py +0 -5
- package/scripts/builtin-skills-watch/agent-watch.ts +0 -1
- package/scripts/builtin-skills-watch/aggregate-results.ts +0 -1
- package/scripts/builtin-skills-watch/finalize-result.ts +0 -1
- package/scripts/builtin-skills-watch/reconcile-results.ts +0 -1
- package/scripts/builtin-skills-watch/update-tracker.ts +0 -1
- package/scripts/check-bundled-skill-scripts.js +0 -11
- package/scripts/check-exported-functions.js +0 -14
- package/scripts/check-filename-casing.js +0 -10
- package/scripts/check-layer-boundaries.js +0 -21
- package/scripts/check-test-coverage.cjs +0 -24
- package/scripts/claude-watch/docs-snapshot.ts +1 -19
- package/scripts/claude-watch/release-source.ts +0 -6
- package/scripts/claude-watch/runtime-probe.ts +0 -5
- package/scripts/claude-watch/runtime-sandbox.ts +0 -7
- package/scripts/claude-watch/state-branch.ts +0 -20
- package/scripts/claude-watch/tracker.ts +0 -4
- package/scripts/claude-watch/types.ts +0 -2
- package/scripts/codex-watch/agent-watch.ts +0 -6
- package/scripts/codex-watch/diff-models-json.ts +0 -25
- package/scripts/codex-watch/release-analysis.ts +0 -1
- package/scripts/codex-watch/update-tracker.ts +0 -6
- package/scripts/isolated-unit-tests.json +0 -187
- package/scripts/latency-benchmark.ts +0 -38
- package/scripts/postinstall-patches.js +6 -46
- package/scripts/rename-to-kebab.js +1 -8
- package/scripts/run-api-integration-tests.ts +0 -4
- package/scripts/run-unit-tests.cjs +0 -12
- package/scripts/smoke-image-resize-export.mjs +0 -5
- package/scripts/smoke-image-worker.mjs +0 -3
- package/scripts/source-file-size-baseline.json +29 -36
- package/scripts/stage-pypi-deps.mjs +0 -5
- package/scripts/test-home-preload.ts +0 -6
- package/scripts/test-sharding.cjs +0 -3
- package/scripts/unit-test-impact.cjs +0 -10
- package/scripts/unit-test-impact.test.cjs +25 -10
- package/scripts/update-kebab-imports.js +1 -14
- package/skills/creating-skills/scripts/init-skill.ts +0 -19
- package/skills/creating-skills/scripts/package-skill.ts +36 -64
- package/skills/creating-skills/scripts/validate-skill.ts +0 -29
- package/skills/image-generation/SKILL.md +24 -11
- package/skills/initializing-memory/scripts/history-coverage.mjs +0 -13
- package/skills/initializing-memory/scripts/prepare-history.mjs +0 -14
- package/skills/managing-agent-webhooks/scripts/manage-agent-webhooks.mjs +1 -2
- package/skills/self-configuration/scripts/add_permission.py +0 -1
package/letta.js
CHANGED
|
@@ -3472,14 +3472,14 @@ function trackEndTurnNoAssistant(params) {
|
|
|
3472
3472
|
});
|
|
3473
3473
|
}
|
|
3474
3474
|
function extractHttpStatus(message) {
|
|
3475
|
-
const match = /(?:^|:\s
|
|
3475
|
+
const match = /(?:^|:\s*|API error \()(?:HTTP\s+)?([45]\d{2})\b/.exec(message);
|
|
3476
3476
|
return match ? Number(match[1]) : undefined;
|
|
3477
3477
|
}
|
|
3478
3478
|
function reportExternalWorkerLaunchFailure(options) {
|
|
3479
3479
|
try {
|
|
3480
3480
|
const safe = (value, pattern) => value && pattern.test(value) ? value : undefined;
|
|
3481
3481
|
const safeId = (id) => safe(id, /^[a-zA-Z0-9_-]{1,128}$/);
|
|
3482
|
-
const httpStatus = extractHttpStatus(formatTelemetryErrorMessage(options.error));
|
|
3482
|
+
const httpStatus = options.httpStatus === undefined ? extractHttpStatus(formatTelemetryErrorMessage(options.error)) : options.httpStatus ?? undefined;
|
|
3483
3483
|
telemetry.trackError("external_worker_launch_failed", "External worker launch failed", JSON.stringify({
|
|
3484
3484
|
stage: options.stage,
|
|
3485
3485
|
harness: safe(options.harness, /^[a-z-]{1,32}$/),
|
|
@@ -4629,6 +4629,7 @@ var init_toolset_catalog = __esm(() => {
|
|
|
4629
4629
|
"SetWorkingDirectory",
|
|
4630
4630
|
"Task",
|
|
4631
4631
|
"SendAgentMessage",
|
|
4632
|
+
"ListAgents",
|
|
4632
4633
|
"Monitor",
|
|
4633
4634
|
"WatchPR",
|
|
4634
4635
|
"Wake",
|
|
@@ -4675,6 +4676,7 @@ var init_toolset_catalog = __esm(() => {
|
|
|
4675
4676
|
"Workflow",
|
|
4676
4677
|
"Task",
|
|
4677
4678
|
"SendAgentMessage",
|
|
4679
|
+
"ListAgents",
|
|
4678
4680
|
"TaskCreate",
|
|
4679
4681
|
"TaskGet",
|
|
4680
4682
|
"TaskList",
|
|
@@ -4693,6 +4695,7 @@ var init_toolset_catalog = __esm(() => {
|
|
|
4693
4695
|
"SetWorkingDirectory",
|
|
4694
4696
|
"Task",
|
|
4695
4697
|
"SendAgentMessage",
|
|
4698
|
+
"ListAgents",
|
|
4696
4699
|
"Monitor",
|
|
4697
4700
|
"WatchPR",
|
|
4698
4701
|
"Wake",
|
|
@@ -6139,7 +6142,7 @@ var package_default;
|
|
|
6139
6142
|
var init_package = __esm(() => {
|
|
6140
6143
|
package_default = {
|
|
6141
6144
|
name: "@letta-ai/letta-code",
|
|
6142
|
-
version: "0.34.
|
|
6145
|
+
version: "0.34.71",
|
|
6143
6146
|
lettaStartupLogProtocol: 1,
|
|
6144
6147
|
lettaConfigDirProtocol: 1,
|
|
6145
6148
|
description: "Letta Code is a CLI tool for interacting with stateful Letta agents from the terminal.",
|
|
@@ -6426,7 +6429,7 @@ var init_package = __esm(() => {
|
|
|
6426
6429
|
},
|
|
6427
6430
|
lettaLifecycleProtocol: 1,
|
|
6428
6431
|
lettaRuntimeGraphProtocol: 1,
|
|
6429
|
-
lettaRuntimeGraphSha512: "sha512-
|
|
6432
|
+
lettaRuntimeGraphSha512: "sha512-j5GwILxjJXaimzogBnQyZHVILv0v0BgYhSIPUyy2KYUTn9frhkCbOrBlCJtFk/QGChUYISTEpCHX/IbyGPQZzA==",
|
|
6430
6433
|
patchedDependencies: {
|
|
6431
6434
|
"@earendil-works/pi-ai@1.5.2": "patches/@earendil-works%2Fpi-ai@1.5.2.patch"
|
|
6432
6435
|
}
|
|
@@ -6463,7 +6466,7 @@ function maybeMapKnownApiError(status, responseText) {
|
|
|
6463
6466
|
try {
|
|
6464
6467
|
const errorData = JSON.parse(responseText);
|
|
6465
6468
|
if (typeof errorData.error === "string" && errorData.error.includes("only available for pro or enterprise")) {
|
|
6466
|
-
return new Error("PLAN_UPGRADE_REQUIRED");
|
|
6469
|
+
return Object.assign(new Error("PLAN_UPGRADE_REQUIRED"), { status });
|
|
6467
6470
|
}
|
|
6468
6471
|
} catch {}
|
|
6469
6472
|
return null;
|
|
@@ -94370,7 +94373,7 @@ function consumeSubagentLaunch(env4) {
|
|
|
94370
94373
|
delete env4[SUBAGENT_LAUNCH_ENV];
|
|
94371
94374
|
return isLaunch;
|
|
94372
94375
|
}
|
|
94373
|
-
var SUBAGENT_LAUNCH_ENV = "LETTA_SUBAGENT_LAUNCH", SUBAGENT_LAUNCH_PROFILE_ENV = "LETTA_SUBAGENT_LAUNCH_PROFILE", SUBAGENT_NAME_ENV = "LETTA_SUBAGENT_NAME", LISTENER_CONNECTION_ENV = "LETTA_RUNTIME_LISTENER_CONNECTION_ID";
|
|
94376
|
+
var SUBAGENT_LAUNCH_ENV = "LETTA_SUBAGENT_LAUNCH", SUBAGENT_LAUNCH_PROFILE_ENV = "LETTA_SUBAGENT_LAUNCH_PROFILE", SUBAGENT_SUMMARY_ENV = "LETTA_SUBAGENT_SUMMARY", SUBAGENT_NAME_ENV = "LETTA_SUBAGENT_NAME", LISTENER_CONNECTION_ENV = "LETTA_RUNTIME_LISTENER_CONNECTION_ID";
|
|
94374
94377
|
|
|
94375
94378
|
// src/constants.ts
|
|
94376
94379
|
var DEFAULT_TITLE_SUMMARIZATION_MODEL = "openai/gpt-6-luna", DEFAULT_AGENT_NAME = "Letta Code", INTERRUPTED_BY_USER = "Interrupted by user", TURN_DID_NOT_COMPLETE = "Turn did not complete", SYSTEM_REMINDER_TAG = "system-reminder", SYSTEM_REMINDER_OPEN, SYSTEM_REMINDER_CLOSE, SYSTEM_ALERT_TAG = "system-alert", SYSTEM_ALERT_OPEN, SYSTEM_ALERT_CLOSE, COMPACTION_SUMMARY_HEADER = "(Earlier messages in this conversation have been compacted to free up context, summarized below)", TOKEN_DISPLAY_THRESHOLD = 100, ELAPSED_DISPLAY_THRESHOLD_MS;
|
|
@@ -94743,7 +94746,9 @@ function resolveEphemeralSubagentLink(env4 = process.env) {
|
|
|
94743
94746
|
const parentAgentId = env4.LETTA_PARENT_AGENT_ID?.trim();
|
|
94744
94747
|
if (!parentAgentId)
|
|
94745
94748
|
return null;
|
|
94749
|
+
const summary = env4[SUBAGENT_SUMMARY_ENV]?.trim();
|
|
94746
94750
|
return {
|
|
94751
|
+
...summary ? { summary } : {},
|
|
94747
94752
|
parent_agent_id: parentAgentId,
|
|
94748
94753
|
is_subagent: true,
|
|
94749
94754
|
name: resolveCreatedAgentName(undefined, true, env4[SUBAGENT_NAME_ENV]?.trim() || undefined)
|
|
@@ -98724,6 +98729,7 @@ var init_subagents2 = __esm(() => {
|
|
|
98724
98729
|
MEMFS_V2_BUILTIN_SOURCES = [init_v2_default, reflection_v2_default];
|
|
98725
98730
|
GLOBAL_AGENTS_DIR = getGlobalAgentsDir();
|
|
98726
98731
|
RESERVED_EXTERNAL_SUBAGENT_NAMES = new Set([
|
|
98732
|
+
"antigravity",
|
|
98727
98733
|
"letta",
|
|
98728
98734
|
"claude-code",
|
|
98729
98735
|
"codex",
|
|
@@ -109348,6 +109354,13 @@ var exports_pi_stream_adapter = {};
|
|
|
109348
109354
|
__export(exports_pi_stream_adapter, {
|
|
109349
109355
|
PiStreamAdapter: () => PiStreamAdapter
|
|
109350
109356
|
});
|
|
109357
|
+
function inputAfterCompaction(input, compaction) {
|
|
109358
|
+
return {
|
|
109359
|
+
...input,
|
|
109360
|
+
uiMessages: compaction.uiMessages,
|
|
109361
|
+
systemPrompt: compaction.systemPrompt ?? input.systemPrompt
|
|
109362
|
+
};
|
|
109363
|
+
}
|
|
109351
109364
|
async function sleepWithAbort(delayMs, abortSignal) {
|
|
109352
109365
|
if (delayMs <= 0)
|
|
109353
109366
|
return;
|
|
@@ -109556,12 +109569,7 @@ class PiStreamAdapter {
|
|
|
109556
109569
|
if (!shouldCompactForContextPressure({ contextTokens, contextWindow })) {
|
|
109557
109570
|
return null;
|
|
109558
109571
|
}
|
|
109559
|
-
return this.onContextPressure(input, {
|
|
109560
|
-
contextTokens,
|
|
109561
|
-
contextWindow,
|
|
109562
|
-
phase: "preflight",
|
|
109563
|
-
source: "estimate"
|
|
109564
|
-
});
|
|
109572
|
+
return this.onContextPressure(input, { contextTokens, contextWindow });
|
|
109565
109573
|
}
|
|
109566
109574
|
async* streamOnce(input) {
|
|
109567
109575
|
const tools = toPiTools(input.clientTools);
|
|
@@ -109659,7 +109667,6 @@ class PiStreamAdapter {
|
|
|
109659
109667
|
const result = this.runStream(resolved.model, context3, options);
|
|
109660
109668
|
let streamError;
|
|
109661
109669
|
let finalMessage;
|
|
109662
|
-
let finalLocalMessage;
|
|
109663
109670
|
for await (const part of result) {
|
|
109664
109671
|
if (part.type === "error") {
|
|
109665
109672
|
const error3 = new PiProviderError(part.error);
|
|
@@ -109673,8 +109680,7 @@ class PiStreamAdapter {
|
|
|
109673
109680
|
}
|
|
109674
109681
|
if (part.type === "done") {
|
|
109675
109682
|
finalMessage = part.message;
|
|
109676
|
-
|
|
109677
|
-
yield providerLocalMessage(finalLocalMessage);
|
|
109683
|
+
yield providerLocalMessage(toLocalAssistantMessage(part.message, input));
|
|
109678
109684
|
}
|
|
109679
109685
|
yield providerStreamPart(part, resolved.model);
|
|
109680
109686
|
}
|
|
@@ -109694,26 +109700,6 @@ class PiStreamAdapter {
|
|
|
109694
109700
|
if (finalMessage.stopReason === "error" || finalMessage.stopReason === "aborted") {
|
|
109695
109701
|
throw new PiProviderError(finalMessage);
|
|
109696
109702
|
}
|
|
109697
|
-
if (this.onContextPressure) {
|
|
109698
|
-
const usageContextTokens = contextTokensFromUsage(finalMessage.usage);
|
|
109699
|
-
const contextTokens = usageContextTokens ?? estimateProviderContextTokens({
|
|
109700
|
-
...input,
|
|
109701
|
-
uiMessages: [
|
|
109702
|
-
...input.uiMessages,
|
|
109703
|
-
finalLocalMessage ?? toLocalAssistantMessage(finalMessage, input)
|
|
109704
|
-
]
|
|
109705
|
-
});
|
|
109706
|
-
const contextWindow = resolved.model.contextWindow;
|
|
109707
|
-
const compaction = shouldCompactForContextPressure({ contextTokens, contextWindow }) && contextTokens !== undefined ? await this.onContextPressure(input, {
|
|
109708
|
-
contextTokens,
|
|
109709
|
-
contextWindow,
|
|
109710
|
-
phase: "post_turn",
|
|
109711
|
-
source: usageContextTokens === undefined ? "estimate" : "usage"
|
|
109712
|
-
}) : null;
|
|
109713
|
-
if (compaction) {
|
|
109714
|
-
yield* this.emitCompactionChunks(compaction, "context_window_limit");
|
|
109715
|
-
}
|
|
109716
|
-
}
|
|
109717
109703
|
} catch (error3) {
|
|
109718
109704
|
if (!llmEnded) {
|
|
109719
109705
|
const endError = llmEndErrorFromError(error3);
|
|
@@ -109738,7 +109724,7 @@ class PiStreamAdapter {
|
|
|
109738
109724
|
preflightCompactionChecked = true;
|
|
109739
109725
|
const compaction = await this.compactBeforeProviderCall(activeInput);
|
|
109740
109726
|
if (compaction) {
|
|
109741
|
-
activeInput =
|
|
109727
|
+
activeInput = inputAfterCompaction(activeInput, compaction);
|
|
109742
109728
|
yield* this.emitCompactionChunks(compaction, "context_window_limit");
|
|
109743
109729
|
continue;
|
|
109744
109730
|
}
|
|
@@ -109763,7 +109749,7 @@ class PiStreamAdapter {
|
|
|
109763
109749
|
if (!compaction)
|
|
109764
109750
|
throw error3;
|
|
109765
109751
|
contextOverflowCompactions += 1;
|
|
109766
|
-
activeInput =
|
|
109752
|
+
activeInput = inputAfterCompaction(activeInput, compaction);
|
|
109767
109753
|
yield* this.emitCompactionChunks(compaction, "context_window_overflow");
|
|
109768
109754
|
continue;
|
|
109769
109755
|
}
|
|
@@ -109784,7 +109770,7 @@ class PiStreamAdapter {
|
|
|
109784
109770
|
}
|
|
109785
109771
|
if (compaction) {
|
|
109786
109772
|
contextOverflowCompactions += 1;
|
|
109787
|
-
activeInput =
|
|
109773
|
+
activeInput = inputAfterCompaction(activeInput, compaction);
|
|
109788
109774
|
yield* this.emitCompactionChunks(compaction, "context_window_overflow");
|
|
109789
109775
|
continue;
|
|
109790
109776
|
}
|
|
@@ -110439,11 +110425,7 @@ var init_local_backend = __esm(() => {
|
|
|
110439
110425
|
}
|
|
110440
110426
|
async compactAfterContextOverflow(input, _error) {
|
|
110441
110427
|
const result = await this.compactLocalConversation(input.conversationId, input.agentId, "context_window_overflow", undefined, input);
|
|
110442
|
-
return
|
|
110443
|
-
uiMessages: this.store.listLocalMessages(input.conversationId, input.agentId),
|
|
110444
|
-
summary: result.summary,
|
|
110445
|
-
stats: result.stats
|
|
110446
|
-
};
|
|
110428
|
+
return this.turnCompaction(input, result);
|
|
110447
110429
|
}
|
|
110448
110430
|
async compactForContextPressure(input, pressure) {
|
|
110449
110431
|
const messageTokens = estimateLocalMessageTokens2(this.store.listLocalMessages(input.conversationId, input.agentId));
|
|
@@ -110451,10 +110433,16 @@ var init_local_backend = __esm(() => {
|
|
|
110451
110433
|
const result = await runLocalPressureCompaction(() => this.compactLocalConversation(input.conversationId, input.agentId, "context_window_limit", undefined, input, (contextCompactionThreshold(pressure.contextWindow) ?? 0) - fixedTokens));
|
|
110452
110434
|
if (!result)
|
|
110453
110435
|
return null;
|
|
110436
|
+
return this.turnCompaction(input, result);
|
|
110437
|
+
}
|
|
110438
|
+
turnCompaction(input, result) {
|
|
110454
110439
|
return {
|
|
110455
110440
|
uiMessages: this.store.listLocalMessages(input.conversationId, input.agentId),
|
|
110456
110441
|
summary: result.summary,
|
|
110457
|
-
stats: result.stats
|
|
110442
|
+
stats: result.stats,
|
|
110443
|
+
...result.systemPrompt !== undefined ? {
|
|
110444
|
+
systemPrompt: appendAvailableSkillsBlock(result.systemPrompt, input.clientSkills)
|
|
110445
|
+
} : {}
|
|
110458
110446
|
};
|
|
110459
110447
|
}
|
|
110460
110448
|
effectiveContextWindow(conversationId, agentId) {
|
|
@@ -110491,8 +110479,16 @@ var init_local_backend = __esm(() => {
|
|
|
110491
110479
|
async compactLocalConversation(conversationId, agentId, trigger, body, turn, maxMessageTokens) {
|
|
110492
110480
|
await this.emitCompactStart(conversationId, agentId, trigger);
|
|
110493
110481
|
const result = await this.compactLocalConversationInner(conversationId, agentId, trigger, body, turn, maxMessageTokens);
|
|
110482
|
+
const systemPrompt = await this.recompileMemoryAfterCompaction(conversationId, agentId);
|
|
110494
110483
|
await this.emitCompactEnd(conversationId, agentId, trigger, result.stats);
|
|
110495
|
-
return result;
|
|
110484
|
+
return systemPrompt === undefined ? result : { ...result, systemPrompt };
|
|
110485
|
+
}
|
|
110486
|
+
async recompileMemoryAfterCompaction(conversationId, agentId) {
|
|
110487
|
+
if (this.store.isAgentFreeConversation(conversationId) || !this.isMemfsEnabledForAgent(agentId)) {
|
|
110488
|
+
return;
|
|
110489
|
+
}
|
|
110490
|
+
const compiled = await this.compileAndMaybePersistSystemPrompt(conversationId, agentId, { dryRun: false });
|
|
110491
|
+
return compiled.content;
|
|
110496
110492
|
}
|
|
110497
110493
|
async compactLocalConversationInner(conversationId, agentId, trigger, body, turn, maxMessageTokens) {
|
|
110498
110494
|
const agent = this.effectiveAgentForConversation(conversationId, agentId);
|
|
@@ -110503,27 +110499,20 @@ var init_local_backend = __esm(() => {
|
|
|
110503
110499
|
const self2 = isLocalSelfCompactionMode(settings.mode) ? await this.selfCompactionContext(conversationId, agentId, turn) : undefined;
|
|
110504
110500
|
if (isLocalSlidingWindowMode(settings.mode)) {
|
|
110505
110501
|
try {
|
|
110506
|
-
const
|
|
110507
|
-
if (
|
|
110508
|
-
|
|
110509
|
-
dryRun: false
|
|
110510
|
-
});
|
|
110511
|
-
return result2;
|
|
110502
|
+
const result = await this.compactLocalConversationPass(conversationId, agentId, agent, trigger, settings, self2);
|
|
110503
|
+
if (result.stats.context_window === undefined || result.stats.context_tokens_after === undefined || result.stats.context_tokens_after < result.stats.context_window) {
|
|
110504
|
+
return result;
|
|
110512
110505
|
}
|
|
110513
110506
|
} catch (error3) {
|
|
110514
110507
|
if (!isLocalSlidingWindowCompactionPlanningError(error3))
|
|
110515
110508
|
throw error3;
|
|
110516
110509
|
}
|
|
110517
110510
|
}
|
|
110518
|
-
|
|
110511
|
+
return this.compactLocalConversationPass(conversationId, agentId, agent, trigger, {
|
|
110519
110512
|
...settings,
|
|
110520
110513
|
mode: self2 ? "self_compact_all" : "all",
|
|
110521
110514
|
prompt: settings.prompt
|
|
110522
110515
|
}, self2);
|
|
110523
|
-
await this.compileAndMaybePersistSystemPrompt(conversationId, agentId, {
|
|
110524
|
-
dryRun: false
|
|
110525
|
-
});
|
|
110526
|
-
return result;
|
|
110527
110516
|
}
|
|
110528
110517
|
async compactLocalConversationPass(conversationId, agentId, agent, trigger, settings, self2) {
|
|
110529
110518
|
const slidingWindow = isLocalSlidingWindowMode(settings.mode);
|
|
@@ -203477,7 +203466,7 @@ var init_mcp_client = __esm(() => {
|
|
|
203477
203466
|
init_streamableHttp();
|
|
203478
203467
|
DEFAULT_CLIENT_INFO = {
|
|
203479
203468
|
name: "letta-code",
|
|
203480
|
-
version: "0.34.
|
|
203469
|
+
version: "0.34.71"
|
|
203481
203470
|
};
|
|
203482
203471
|
});
|
|
203483
203472
|
|
|
@@ -207825,6 +207814,11 @@ A powerful search tool built on ripgrep
|
|
|
207825
207814
|
`;
|
|
207826
207815
|
var init_Grep = () => {};
|
|
207827
207816
|
|
|
207817
|
+
// src/tools/descriptions/ListAgents.md
|
|
207818
|
+
var ListAgents_default = `List unarchived subagents launched by the current conversation, most recently updated first. Each entry includes timestamps, status, and the address for SendAgentMessage. Returns up to 20 entries by default. Filter by running, completed, failed, or stopped. When has_more is true, pass next_cursor as cursor to get the next page with the same status filter.
|
|
207819
|
+
`;
|
|
207820
|
+
var init_ListAgents = () => {};
|
|
207821
|
+
|
|
207828
207822
|
// src/tools/descriptions/LS.md
|
|
207829
207823
|
var LS_default = `# LS
|
|
207830
207824
|
|
|
@@ -207958,6 +207952,8 @@ Launch an agent in the background. You'll be notified when it finishes; the user
|
|
|
207958
207952
|
|
|
207959
207953
|
A fresh agent knows only what you put in the prompt, and you see only the summary it sends back. Do the work yourself when it is a handful of tool calls or a lookup whose target you already know; delegate independent work that can run in parallel, or reading across many files where you only need the conclusion. Once you've delegated something, don't also run it yourself; wait for the result. Never fabricate or predict a pending agent's result: if the user asks before the notification arrives, say it's still running.
|
|
207960
207954
|
|
|
207955
|
+
Scope each agent to one task, the one its \`description\` names, which the user sees as the session's title. A different task gets a new agent even when an earlier one is idle: a context full of the previous task degrades work on the next, and whatever carries over can go in the new prompt.
|
|
207956
|
+
|
|
207961
207957
|
To steer an agent that is still working, call SendAgentMessage with the receipt's \`Agent ID\`, plus its \`Conversation ID\` when the receipt has one. For external harnesses, the Agent ID is the native session ID with a harness prefix (e.g. \`claude_<session-id>\`), and sending to it resumes that session. Do not call Agent again for the same task.
|
|
207962
207958
|
|
|
207963
207959
|
Progress and history:
|
|
@@ -215837,6 +215833,37 @@ function excerptProgressText(value, max2) {
|
|
|
215837
215833
|
const line = value.replace(/\s+/g, " ").trim();
|
|
215838
215834
|
return line.length > max2 ? `${line.slice(0, max2)}…` : line;
|
|
215839
215835
|
}
|
|
215836
|
+
function observeSubagentState(id, observer) {
|
|
215837
|
+
const state2 = store2.agents.get(id);
|
|
215838
|
+
if (state2)
|
|
215839
|
+
stateObservers.set(state2, observer);
|
|
215840
|
+
}
|
|
215841
|
+
function captureSubagentStop(id) {
|
|
215842
|
+
const state2 = store2.agents.get(id);
|
|
215843
|
+
const observer = state2 && stateObservers.get(state2);
|
|
215844
|
+
return () => {
|
|
215845
|
+
if (!state2 || !observer)
|
|
215846
|
+
return;
|
|
215847
|
+
const current = store2.agents.get(id) ?? state2;
|
|
215848
|
+
observer({
|
|
215849
|
+
...current,
|
|
215850
|
+
stopOutcome: { attempt: current.stopAttempts ?? 0, kind: "stopped" }
|
|
215851
|
+
});
|
|
215852
|
+
};
|
|
215853
|
+
}
|
|
215854
|
+
function observeStateChange(previous, next, resultIdentity) {
|
|
215855
|
+
const observer = stateObservers.get(previous);
|
|
215856
|
+
if (!observer)
|
|
215857
|
+
return;
|
|
215858
|
+
stateObservers.set(next, observer);
|
|
215859
|
+
if (resultIdentity || previous.status !== next.status || previous.agentId !== next.agentId || previous.conversationId !== next.conversationId || previous.cancelPending !== next.cancelPending || previous.stopOutcome?.kind !== next.stopOutcome?.kind) {
|
|
215860
|
+
observer(resultIdentity ? {
|
|
215861
|
+
...next,
|
|
215862
|
+
agentId: next.agentId || resultIdentity.agentId,
|
|
215863
|
+
conversationId: resultIdentity.conversationId || next.conversationId
|
|
215864
|
+
} : next);
|
|
215865
|
+
}
|
|
215866
|
+
}
|
|
215840
215867
|
function updateSnapshot() {
|
|
215841
215868
|
const agents = Array.from(store2.agents.values());
|
|
215842
215869
|
const now2 = Date.now();
|
|
@@ -215947,8 +215974,14 @@ function updateSubagent(id, updates) {
|
|
|
215947
215974
|
const isNoop = keys2.every((k3) => agent[k3] === updates[k3]) && nextMax === agent.maxToolCallsSeen;
|
|
215948
215975
|
if (isNoop)
|
|
215949
215976
|
return;
|
|
215950
|
-
const updatedAgent = {
|
|
215977
|
+
const updatedAgent = {
|
|
215978
|
+
...agent,
|
|
215979
|
+
...updates,
|
|
215980
|
+
maxToolCallsSeen: nextMax,
|
|
215981
|
+
updatedAt: Date.now()
|
|
215982
|
+
};
|
|
215951
215983
|
store2.agents.set(id, updatedAgent);
|
|
215984
|
+
observeStateChange(agent, updatedAgent);
|
|
215952
215985
|
if (updatedAgent.status === "completed" || updatedAgent.status === "error") {
|
|
215953
215986
|
scheduleCompletedSubagentCleanup(id);
|
|
215954
215987
|
} else {
|
|
@@ -215971,6 +216004,7 @@ function addToolCall(subagentId, toolCallId, toolName2, toolArgs) {
|
|
|
215971
216004
|
maxToolCallsSeen: Math.max(agent.maxToolCallsSeen, agent.toolCalls.length + 1)
|
|
215972
216005
|
};
|
|
215973
216006
|
store2.agents.set(subagentId, updatedAgent);
|
|
216007
|
+
observeStateChange(agent, updatedAgent);
|
|
215974
216008
|
notifyListeners();
|
|
215975
216009
|
}
|
|
215976
216010
|
function addProgressText(subagentId, text2, now2 = () => new Date) {
|
|
@@ -215982,23 +216016,26 @@ function addProgressText(subagentId, text2, now2 = () => new Date) {
|
|
|
215982
216016
|
if (!excerpt || previous?.text === excerpt)
|
|
215983
216017
|
return;
|
|
215984
216018
|
const count = (agent.progressTextCount ?? 0) + 1;
|
|
215985
|
-
|
|
216019
|
+
const updatedAgent = {
|
|
215986
216020
|
...agent,
|
|
215987
216021
|
progressTexts: [
|
|
215988
216022
|
...agent.progressTexts ?? [],
|
|
215989
216023
|
{ id: `text-${count}`, at: now2().toISOString(), text: excerpt }
|
|
215990
216024
|
].slice(-MAX_PROGRESS_TEXTS),
|
|
215991
216025
|
progressTextCount: count
|
|
215992
|
-
}
|
|
216026
|
+
};
|
|
216027
|
+
store2.agents.set(subagentId, updatedAgent);
|
|
216028
|
+
observeStateChange(agent, updatedAgent);
|
|
215993
216029
|
notifyListeners();
|
|
215994
216030
|
}
|
|
215995
|
-
function completeSubagent(id, result2) {
|
|
216031
|
+
function completeSubagent(id, result2, resultIdentity) {
|
|
215996
216032
|
const agent = store2.agents.get(id);
|
|
215997
216033
|
if (!agent)
|
|
215998
216034
|
return;
|
|
215999
216035
|
const updatedAgent = {
|
|
216000
216036
|
...agent,
|
|
216001
216037
|
status: result2.success ? "completed" : "error",
|
|
216038
|
+
updatedAt: Date.now(),
|
|
216002
216039
|
error: result2.error,
|
|
216003
216040
|
stopFailed: undefined,
|
|
216004
216041
|
...result2.result !== undefined ? { result: result2.result } : {},
|
|
@@ -216008,6 +216045,7 @@ function completeSubagent(id, result2) {
|
|
|
216008
216045
|
maxToolCallsSeen: Math.max(agent.maxToolCallsSeen, agent.toolCalls.length)
|
|
216009
216046
|
};
|
|
216010
216047
|
store2.agents.set(id, updatedAgent);
|
|
216048
|
+
observeStateChange(agent, updatedAgent, resultIdentity);
|
|
216011
216049
|
scheduleCompletedSubagentCleanup(id);
|
|
216012
216050
|
notifyListeners();
|
|
216013
216051
|
}
|
|
@@ -216113,12 +216151,14 @@ function interruptActiveSubagents(errorMessage3, scope) {
|
|
|
216113
216151
|
const updatedAgent = {
|
|
216114
216152
|
...agent,
|
|
216115
216153
|
status: "error",
|
|
216154
|
+
updatedAt: Date.now(),
|
|
216116
216155
|
error: errorMessage3,
|
|
216117
216156
|
durationMs: Date.now() - agent.startTime,
|
|
216118
216157
|
...hook ? { cancelPending: true, stopAttempts: (agent.stopAttempts ?? 0) + 1 } : {},
|
|
216119
216158
|
stopFailed: undefined
|
|
216120
216159
|
};
|
|
216121
216160
|
store2.agents.set(id, updatedAgent);
|
|
216161
|
+
observeStateChange(agent, updatedAgent);
|
|
216122
216162
|
scheduleCompletedSubagentCleanup(id);
|
|
216123
216163
|
anyInterrupted = true;
|
|
216124
216164
|
}
|
|
@@ -216148,6 +216188,7 @@ function interruptStopFailedSubagents(errorMessage3, scope) {
|
|
|
216148
216188
|
stopFailed: undefined
|
|
216149
216189
|
};
|
|
216150
216190
|
store2.agents.set(id, updatedAgent);
|
|
216191
|
+
observeStateChange(agent, updatedAgent);
|
|
216151
216192
|
scheduleCompletedSubagentCleanup(id);
|
|
216152
216193
|
interrupted.push(id);
|
|
216153
216194
|
}
|
|
@@ -216191,7 +216232,7 @@ function emitStreamEvent(subagentId, event) {
|
|
|
216191
216232
|
listener(subagentId, event);
|
|
216192
216233
|
}
|
|
216193
216234
|
}
|
|
216194
|
-
var PROGRESS_TEXT_CHARS = 300, MAX_PROGRESS_TEXTS = 20, store2, cachedSnapshot, cachedLifecycleItems, DEFAULT_COMPLETED_SUBAGENT_RETENTION_MS = 30000, completedSubagentRetentionMs, DEFAULT_PUBLISHED_RESULT_RETENTION_MS, publishedResultRetentionMs, completedSubagentCleanupTimers, subagentCounter = 0, subagentAbortHooks, streamEventListeners;
|
|
216235
|
+
var PROGRESS_TEXT_CHARS = 300, MAX_PROGRESS_TEXTS = 20, store2, stateObservers, cachedSnapshot, cachedLifecycleItems, DEFAULT_COMPLETED_SUBAGENT_RETENTION_MS = 30000, completedSubagentRetentionMs, DEFAULT_PUBLISHED_RESULT_RETENTION_MS, publishedResultRetentionMs, completedSubagentCleanupTimers, subagentCounter = 0, subagentAbortHooks, streamEventListeners;
|
|
216195
216236
|
var init_subagent_state = __esm(() => {
|
|
216196
216237
|
init_subagent_events();
|
|
216197
216238
|
store2 = {
|
|
@@ -216199,6 +216240,7 @@ var init_subagent_state = __esm(() => {
|
|
|
216199
216240
|
expanded: false,
|
|
216200
216241
|
listeners: new Set
|
|
216201
216242
|
};
|
|
216243
|
+
stateObservers = new WeakMap;
|
|
216202
216244
|
cachedSnapshot = {
|
|
216203
216245
|
agents: [],
|
|
216204
216246
|
expanded: false
|
|
@@ -221355,6 +221397,7 @@ function getDefaultDecision(toolName2, toolArgs, modTools = getAvailableModTools
|
|
|
221355
221397
|
"TaskGet",
|
|
221356
221398
|
"TaskList",
|
|
221357
221399
|
"TaskUpdate",
|
|
221400
|
+
"ListAgents",
|
|
221358
221401
|
"read_artifact_file",
|
|
221359
221402
|
"write_artifact_file",
|
|
221360
221403
|
"Wake",
|
|
@@ -232525,6 +232568,257 @@ var init_grep = __esm(() => {
|
|
|
232525
232568
|
execFileAsync10 = promisify14(execFile14);
|
|
232526
232569
|
});
|
|
232527
232570
|
|
|
232571
|
+
// src/backend/api/subagents.ts
|
|
232572
|
+
function usesCloudSubagents() {
|
|
232573
|
+
return resolveBackendMode() === "api" && isCloudServerUrl();
|
|
232574
|
+
}
|
|
232575
|
+
function listCloudSubagentsPage(conversationId, actingUserId, options) {
|
|
232576
|
+
return apiRequest("GET", "/v1/subagents", undefined, {
|
|
232577
|
+
actingUserId,
|
|
232578
|
+
signal: AbortSignal.timeout(15000),
|
|
232579
|
+
query: {
|
|
232580
|
+
parent_conversation_id: conversationId,
|
|
232581
|
+
archived: options.archived ?? false,
|
|
232582
|
+
after: options.after,
|
|
232583
|
+
limit: options.limit,
|
|
232584
|
+
status: options.status
|
|
232585
|
+
}
|
|
232586
|
+
});
|
|
232587
|
+
}
|
|
232588
|
+
async function listCloudSubagents(conversationId, actingUserId, archived = false) {
|
|
232589
|
+
const records = [];
|
|
232590
|
+
let after2;
|
|
232591
|
+
while (true) {
|
|
232592
|
+
const page = await listCloudSubagentsPage(conversationId, actingUserId, {
|
|
232593
|
+
archived,
|
|
232594
|
+
after: after2,
|
|
232595
|
+
limit: 200
|
|
232596
|
+
});
|
|
232597
|
+
records.push(...page);
|
|
232598
|
+
if (page.length < 200)
|
|
232599
|
+
return records;
|
|
232600
|
+
after2 = page.at(-1)?.subagent_id;
|
|
232601
|
+
}
|
|
232602
|
+
}
|
|
232603
|
+
function queueSubagentUpdates(record4, update2) {
|
|
232604
|
+
let pending2 = record4.catch(() => {
|
|
232605
|
+
debugLog("subagents", "Could not resolve the persisted subagent");
|
|
232606
|
+
return;
|
|
232607
|
+
});
|
|
232608
|
+
return (change) => {
|
|
232609
|
+
pending2 = pending2.then(async (id) => {
|
|
232610
|
+
if (id) {
|
|
232611
|
+
try {
|
|
232612
|
+
await update2(id, change);
|
|
232613
|
+
} catch {
|
|
232614
|
+
debugLog("subagents", "Could not update the persisted subagent");
|
|
232615
|
+
}
|
|
232616
|
+
}
|
|
232617
|
+
return id;
|
|
232618
|
+
});
|
|
232619
|
+
};
|
|
232620
|
+
}
|
|
232621
|
+
function createSubagentWriter(input, actingUserId) {
|
|
232622
|
+
const record4 = apiRequest("POST", "/v1/subagents", { ...input }, {
|
|
232623
|
+
actingUserId,
|
|
232624
|
+
signal: AbortSignal.timeout(15000)
|
|
232625
|
+
}).then((row) => row.subagent_id);
|
|
232626
|
+
return subagentWriter(record4, actingUserId);
|
|
232627
|
+
}
|
|
232628
|
+
function subagentWriter(record4, actingUserId) {
|
|
232629
|
+
return queueSubagentUpdates(record4, (id, change) => apiRequest("PATCH", `/v1/subagents/${encodeURIComponent(id)}`, { ...change }, {
|
|
232630
|
+
actingUserId,
|
|
232631
|
+
signal: AbortSignal.timeout(15000)
|
|
232632
|
+
}));
|
|
232633
|
+
}
|
|
232634
|
+
function resumeSubagentWriter(conversationId, target, actingUserId) {
|
|
232635
|
+
if (!usesCloudSubagents() || conversationId === "default" || !target.conversation_id && !target.worker_session_id)
|
|
232636
|
+
return;
|
|
232637
|
+
const matches3 = (record5) => target.worker_session_id ? record5.worker_session_id === target.worker_session_id : record5.conversation_id === target.conversation_id;
|
|
232638
|
+
const record4 = (async () => {
|
|
232639
|
+
for (const archived of [false, true]) {
|
|
232640
|
+
const records = await listCloudSubagents(conversationId, actingUserId, archived);
|
|
232641
|
+
const match3 = records.filter(matches3).sort((a2, b3) => b3.updated_at.localeCompare(a2.updated_at))[0];
|
|
232642
|
+
if (match3)
|
|
232643
|
+
return match3.subagent_id;
|
|
232644
|
+
}
|
|
232645
|
+
return;
|
|
232646
|
+
})();
|
|
232647
|
+
const update2 = subagentWriter(record4, actingUserId);
|
|
232648
|
+
update2({ status: "running", archived: false });
|
|
232649
|
+
return { update: update2, found: record4.then(Boolean, () => false) };
|
|
232650
|
+
}
|
|
232651
|
+
var init_subagents3 = __esm(() => {
|
|
232652
|
+
init_backend_mode();
|
|
232653
|
+
init_debug();
|
|
232654
|
+
init_request();
|
|
232655
|
+
init_server_url();
|
|
232656
|
+
});
|
|
232657
|
+
|
|
232658
|
+
// src/tools/schemas/ListAgents.json
|
|
232659
|
+
var ListAgents_default2;
|
|
232660
|
+
var init_ListAgents2 = __esm(() => {
|
|
232661
|
+
ListAgents_default2 = {
|
|
232662
|
+
type: "object",
|
|
232663
|
+
properties: {
|
|
232664
|
+
limit: {
|
|
232665
|
+
type: "integer",
|
|
232666
|
+
minimum: 1,
|
|
232667
|
+
maximum: 100,
|
|
232668
|
+
default: 20,
|
|
232669
|
+
description: "Maximum number of subagents to return."
|
|
232670
|
+
},
|
|
232671
|
+
cursor: {
|
|
232672
|
+
type: "string",
|
|
232673
|
+
minLength: 1,
|
|
232674
|
+
description: "The next_cursor from the previous page. Keep the same status filter."
|
|
232675
|
+
},
|
|
232676
|
+
status: {
|
|
232677
|
+
type: "string",
|
|
232678
|
+
enum: ["running", "completed", "failed", "stopped"],
|
|
232679
|
+
description: "Only return subagents with this status."
|
|
232680
|
+
}
|
|
232681
|
+
},
|
|
232682
|
+
additionalProperties: false
|
|
232683
|
+
};
|
|
232684
|
+
});
|
|
232685
|
+
|
|
232686
|
+
// src/tools/impl/subagent-persistence.ts
|
|
232687
|
+
function createLaunchSubagentObserver(scope, args, description, prompt, harness, forkContext, computer, cloud) {
|
|
232688
|
+
if (!scope || scope.conversationId === "default" || !usesCloudSubagents())
|
|
232689
|
+
return;
|
|
232690
|
+
const actingUserId = getRuntimeActingUserAttribution();
|
|
232691
|
+
const input = {
|
|
232692
|
+
parent_agent_id: scope.agentId,
|
|
232693
|
+
parent_conversation_id: scope.conversationId,
|
|
232694
|
+
description,
|
|
232695
|
+
prompt,
|
|
232696
|
+
harness,
|
|
232697
|
+
subagent_type: args.subagent_type ?? null,
|
|
232698
|
+
fork_context: forkContext,
|
|
232699
|
+
model_config: args.model ? { model: args.model } : null,
|
|
232700
|
+
agent_id: args.agent_id ?? null,
|
|
232701
|
+
conversation_id: args.conversation_id === "default" ? null : args.conversation_id ?? null,
|
|
232702
|
+
computer: computer ?? null,
|
|
232703
|
+
repositories: cloud?.githubRepositories?.map(({ owner, repo, commit }) => `${owner}/${repo}${commit ? `@${commit}` : ""}`) ?? null,
|
|
232704
|
+
sandbox_size: cloud?.sandboxSize ?? null,
|
|
232705
|
+
mcp_config: args.mcp ?? null,
|
|
232706
|
+
worker_session_id: null,
|
|
232707
|
+
status: "running"
|
|
232708
|
+
};
|
|
232709
|
+
return () => {
|
|
232710
|
+
const write = createSubagentWriter(input, actingUserId);
|
|
232711
|
+
let previous;
|
|
232712
|
+
let stopped = false;
|
|
232713
|
+
let resolvedLinks = {};
|
|
232714
|
+
return (state2) => {
|
|
232715
|
+
const links2 = harness === "letta" ? {
|
|
232716
|
+
...state2.agentId ? { agent_id: state2.agentId } : {},
|
|
232717
|
+
...state2.conversationId && state2.conversationId !== "default" ? { conversation_id: state2.conversationId } : {}
|
|
232718
|
+
} : state2.agentId ? { worker_session_id: state2.agentId } : {};
|
|
232719
|
+
const status = stopped ? "stopped" : persistedSubagentStatus(state2);
|
|
232720
|
+
stopped = status === "stopped";
|
|
232721
|
+
resolvedLinks = { ...resolvedLinks, ...links2 };
|
|
232722
|
+
const change = { ...resolvedLinks, status };
|
|
232723
|
+
const serialized = JSON.stringify(change);
|
|
232724
|
+
if (serialized === previous)
|
|
232725
|
+
return;
|
|
232726
|
+
previous = serialized;
|
|
232727
|
+
write(change);
|
|
232728
|
+
};
|
|
232729
|
+
};
|
|
232730
|
+
}
|
|
232731
|
+
function persistedSubagentStatus(state2) {
|
|
232732
|
+
if (state2.stopOutcome?.kind === "stopped")
|
|
232733
|
+
return "stopped";
|
|
232734
|
+
if (state2.status === "error" && !state2.cancelPending)
|
|
232735
|
+
return "failed";
|
|
232736
|
+
if (state2.status === "completed")
|
|
232737
|
+
return "completed";
|
|
232738
|
+
return "running";
|
|
232739
|
+
}
|
|
232740
|
+
var init_subagent_persistence = __esm(() => {
|
|
232741
|
+
init_subagents3();
|
|
232742
|
+
init_runtime_context();
|
|
232743
|
+
});
|
|
232744
|
+
|
|
232745
|
+
// src/tools/impl/list-agents.ts
|
|
232746
|
+
function formatPage(rows, limit4) {
|
|
232747
|
+
const agents = rows.slice(0, limit4);
|
|
232748
|
+
const has_more = rows.length > limit4;
|
|
232749
|
+
return {
|
|
232750
|
+
agents,
|
|
232751
|
+
has_more,
|
|
232752
|
+
next_cursor: has_more ? agents.at(-1)?.subagent_id ?? null : null
|
|
232753
|
+
};
|
|
232754
|
+
}
|
|
232755
|
+
async function list_agents({
|
|
232756
|
+
limit: limit4 = 20,
|
|
232757
|
+
cursor,
|
|
232758
|
+
status
|
|
232759
|
+
} = {}) {
|
|
232760
|
+
if (!Number.isInteger(limit4) || limit4 < 1 || limit4 > 100) {
|
|
232761
|
+
throw new Error("ListAgents limit must be an integer between 1 and 100.");
|
|
232762
|
+
}
|
|
232763
|
+
if (status !== undefined && !ListAgents_default2.properties.status.enum.includes(status)) {
|
|
232764
|
+
throw new Error("ListAgents status must be running, completed, failed, or stopped.");
|
|
232765
|
+
}
|
|
232766
|
+
const scope = resolveNotificationScope();
|
|
232767
|
+
if (!scope)
|
|
232768
|
+
throw new Error("ListAgents requires a calling conversation.");
|
|
232769
|
+
if (usesCloudSubagents()) {
|
|
232770
|
+
if (scope.conversationId === "default")
|
|
232771
|
+
return formatPage([], limit4);
|
|
232772
|
+
const rows2 = await listCloudSubagentsPage(scope.conversationId, getRuntimeActingUserAttribution(), { after: cursor, limit: limit4 + 1, status });
|
|
232773
|
+
return formatPage(rows2.map(({
|
|
232774
|
+
subagent_id,
|
|
232775
|
+
description,
|
|
232776
|
+
harness,
|
|
232777
|
+
subagent_type,
|
|
232778
|
+
status: status2,
|
|
232779
|
+
agent_id,
|
|
232780
|
+
conversation_id,
|
|
232781
|
+
worker_session_id,
|
|
232782
|
+
created_at,
|
|
232783
|
+
updated_at
|
|
232784
|
+
}) => ({
|
|
232785
|
+
subagent_id,
|
|
232786
|
+
description,
|
|
232787
|
+
harness,
|
|
232788
|
+
subagent_type,
|
|
232789
|
+
status: status2,
|
|
232790
|
+
agent_id: worker_session_id ?? agent_id,
|
|
232791
|
+
conversation_id,
|
|
232792
|
+
worker_session_id,
|
|
232793
|
+
created_at,
|
|
232794
|
+
updated_at
|
|
232795
|
+
})), limit4);
|
|
232796
|
+
}
|
|
232797
|
+
const rows = getSubagents().filter((agent) => agent.parentAgentId === scope.agentId && agent.parentConversationId === scope.conversationId).map((agent) => ({
|
|
232798
|
+
subagent_id: agent.id,
|
|
232799
|
+
description: agent.description,
|
|
232800
|
+
subagent_type: agent.type,
|
|
232801
|
+
status: persistedSubagentStatus(agent),
|
|
232802
|
+
agent_id: agent.agentId ?? null,
|
|
232803
|
+
conversation_id: agent.conversationId ?? null,
|
|
232804
|
+
created_at: new Date(agent.startTime).toISOString(),
|
|
232805
|
+
updated_at: new Date(agent.updatedAt ?? agent.startTime).toISOString()
|
|
232806
|
+
})).sort((a2, b3) => b3.updated_at.localeCompare(a2.updated_at) || b3.subagent_id.localeCompare(a2.subagent_id));
|
|
232807
|
+
const cursorIndex = cursor ? rows.findIndex((row) => row.subagent_id === cursor) : -1;
|
|
232808
|
+
if (cursor && cursorIndex === -1)
|
|
232809
|
+
return formatPage([], limit4);
|
|
232810
|
+
const page = rows.slice(cursorIndex + 1).filter((row) => !status || row.status === status);
|
|
232811
|
+
return formatPage(page, limit4);
|
|
232812
|
+
}
|
|
232813
|
+
var init_list_agents = __esm(() => {
|
|
232814
|
+
init_subagent_state();
|
|
232815
|
+
init_subagents3();
|
|
232816
|
+
init_runtime_context();
|
|
232817
|
+
init_ListAgents2();
|
|
232818
|
+
init_task_notifications();
|
|
232819
|
+
init_subagent_persistence();
|
|
232820
|
+
});
|
|
232821
|
+
|
|
232528
232822
|
// node_modules/picomatch/lib/constants.js
|
|
232529
232823
|
var require_constants2 = __commonJS((exports, module) => {
|
|
232530
232824
|
var path28 = __require("path");
|
|
@@ -234077,6 +234371,7 @@ __export(exports_environments3, {
|
|
|
234077
234371
|
environmentMatchesSelector: () => environmentMatchesSelector,
|
|
234078
234372
|
describeEnvironment: () => describeEnvironment,
|
|
234079
234373
|
createAgentSandbox: () => createAgentSandbox,
|
|
234374
|
+
WorkerSandboxExpiredError: () => WorkerSandboxExpiredError,
|
|
234080
234375
|
SUBAGENT_CLOUD_OPTIONS_ENV: () => SUBAGENT_CLOUD_OPTIONS_ENV,
|
|
234081
234376
|
ComputerResolutionError: () => ComputerResolutionError
|
|
234082
234377
|
});
|
|
@@ -234096,17 +234391,39 @@ async function sendEnvironmentMessage(connectionId, body3) {
|
|
|
234096
234391
|
async function getEnvironmentConnection(deviceId) {
|
|
234097
234392
|
return apiRequest("GET", `/v1/environments/${encodeURIComponent(deviceId)}`);
|
|
234098
234393
|
}
|
|
234394
|
+
function isSandboxExpiredResponse(error4) {
|
|
234395
|
+
if (!(error4 instanceof ApiRequestError))
|
|
234396
|
+
return false;
|
|
234397
|
+
if (error4.status === 410)
|
|
234398
|
+
return true;
|
|
234399
|
+
try {
|
|
234400
|
+
return JSON.parse(error4.responseText)?.code === "SANDBOX_EXPIRED";
|
|
234401
|
+
} catch {
|
|
234402
|
+
return false;
|
|
234403
|
+
}
|
|
234404
|
+
}
|
|
234099
234405
|
async function createAgentSandbox(agentId, options = {}, request3 = apiRequest) {
|
|
234100
234406
|
const conversationId = options.conversationId === "default" ? undefined : options.conversationId;
|
|
234101
|
-
|
|
234102
|
-
|
|
234103
|
-
|
|
234104
|
-
|
|
234105
|
-
|
|
234106
|
-
|
|
234107
|
-
|
|
234108
|
-
|
|
234109
|
-
|
|
234407
|
+
let sandbox;
|
|
234408
|
+
try {
|
|
234409
|
+
sandbox = await request3("POST", `/v1/agents/${encodeURIComponent(agentId)}/sandboxes`, {
|
|
234410
|
+
...conversationId && { conversationId },
|
|
234411
|
+
...options.resumeOnly && { resumeOnly: true },
|
|
234412
|
+
...options.githubRepositories !== undefined && {
|
|
234413
|
+
githubRepositories: options.githubRepositories
|
|
234414
|
+
},
|
|
234415
|
+
...options.sandboxSize !== undefined && {
|
|
234416
|
+
sandboxSize: options.sandboxSize
|
|
234417
|
+
}
|
|
234418
|
+
});
|
|
234419
|
+
} catch (error4) {
|
|
234420
|
+
if (options.resumeOnly && isSandboxExpiredResponse(error4))
|
|
234421
|
+
throw new WorkerSandboxExpiredError;
|
|
234422
|
+
throw error4;
|
|
234423
|
+
}
|
|
234424
|
+
if (options.resumeOnly && sandbox.resumed === false)
|
|
234425
|
+
throw new WorkerSandboxExpiredError;
|
|
234426
|
+
return sandbox;
|
|
234110
234427
|
}
|
|
234111
234428
|
function isEnvironmentOnline(environment) {
|
|
234112
234429
|
return typeof environment.connectionId === "string" && environment.connectionId.length > 0 && typeof environment.lastHeartbeat === "number" && Date.now() - environment.lastHeartbeat < 120000;
|
|
@@ -234163,8 +234480,17 @@ async function resolveEnvironmentConnectionId(selector, list = listEnvironments)
|
|
|
234163
234480
|
async function resolveAgentSandboxConnectionId(agentId, options = {}) {
|
|
234164
234481
|
const timeoutMs = options.timeoutMs ?? 3 * 60000;
|
|
234165
234482
|
const pollIntervalMs = options.pollIntervalMs ?? 2000;
|
|
234166
|
-
|
|
234167
|
-
|
|
234483
|
+
let deviceId;
|
|
234484
|
+
let connectionName;
|
|
234485
|
+
try {
|
|
234486
|
+
const sandbox = await createAgentSandbox(agentId, options);
|
|
234487
|
+
deviceId = sandbox.deviceId || `sandbox-${agentId}`;
|
|
234488
|
+
connectionName = sandbox.connectionName;
|
|
234489
|
+
} catch (error4) {
|
|
234490
|
+
if (error4 instanceof WorkerSandboxExpiredError)
|
|
234491
|
+
throw error4;
|
|
234492
|
+
throw new ComputerResolutionError("cloud_sandbox_create_failed", error4 instanceof Error ? error4.message : String(error4), error4);
|
|
234493
|
+
}
|
|
234168
234494
|
const deadline = Date.now() + timeoutMs;
|
|
234169
234495
|
let lastEnvironment = null;
|
|
234170
234496
|
let lastError = null;
|
|
@@ -234181,9 +234507,9 @@ async function resolveAgentSandboxConnectionId(agentId, options = {}) {
|
|
|
234181
234507
|
await new Promise((resolve33) => setTimeout(resolve33, pollIntervalMs));
|
|
234182
234508
|
}
|
|
234183
234509
|
if (lastEnvironment) {
|
|
234184
|
-
throw new
|
|
234510
|
+
throw new ComputerResolutionError("cloud_sandbox_online_timeout", `Timed out waiting for cloud sandbox ${connectionName} to come online. Last status: ${describeEnvironment(lastEnvironment)}`, lastError);
|
|
234185
234511
|
}
|
|
234186
|
-
throw new
|
|
234512
|
+
throw new ComputerResolutionError("cloud_sandbox_register_timeout", `Timed out waiting for cloud sandbox ${connectionName} to register${lastError instanceof Error ? `: ${lastError.message}` : ""}`, lastError);
|
|
234187
234513
|
}
|
|
234188
234514
|
function getTeleportStatus(agentId, conversationId, teleportId, request3 = apiRequest) {
|
|
234189
234515
|
return request3("GET", `/v1/environments/runtimes/${encodeURIComponent(agentId)}/${encodeURIComponent(conversationId)}/teleports/${encodeURIComponent(teleportId)}`, undefined, { signal: AbortSignal.timeout(5000) });
|
|
@@ -234194,15 +234520,27 @@ async function teleportToEnvironment(agentId, conversationId, targetConnectionId
|
|
|
234194
234520
|
idempotencyKey: randomUUID37()
|
|
234195
234521
|
});
|
|
234196
234522
|
}
|
|
234197
|
-
var SUBAGENT_CLOUD_OPTIONS_ENV = "LETTA_SUBAGENT_CLOUD_OPTIONS", ComputerResolutionError;
|
|
234523
|
+
var SUBAGENT_CLOUD_OPTIONS_ENV = "LETTA_SUBAGENT_CLOUD_OPTIONS", WorkerSandboxExpiredError, ComputerResolutionError;
|
|
234198
234524
|
var init_environments3 = __esm(() => {
|
|
234199
234525
|
init_request();
|
|
234526
|
+
WorkerSandboxExpiredError = class WorkerSandboxExpiredError extends Error {
|
|
234527
|
+
constructor() {
|
|
234528
|
+
super("The worker's cloud sandbox expired and was deleted. Launch a new worker with Agent.");
|
|
234529
|
+
}
|
|
234530
|
+
};
|
|
234200
234531
|
ComputerResolutionError = class ComputerResolutionError extends Error {
|
|
234201
234532
|
code;
|
|
234202
|
-
|
|
234203
|
-
|
|
234533
|
+
httpStatus;
|
|
234534
|
+
constructor(code, message, cause) {
|
|
234535
|
+
super(message, { cause });
|
|
234204
234536
|
this.code = code;
|
|
234205
234537
|
this.name = "ComputerResolutionError";
|
|
234538
|
+
if (cause && typeof cause === "object" && "status" in cause) {
|
|
234539
|
+
const status = cause.status;
|
|
234540
|
+
if (typeof status === "number" && Number.isInteger(status) && status >= 400 && status <= 599) {
|
|
234541
|
+
this.httpStatus = status;
|
|
234542
|
+
}
|
|
234543
|
+
}
|
|
234206
234544
|
}
|
|
234207
234545
|
};
|
|
234208
234546
|
});
|
|
@@ -239100,6 +239438,20 @@ function waitForChildRun(receipt, signal, onIdle) {
|
|
|
239100
239438
|
onIdle
|
|
239101
239439
|
});
|
|
239102
239440
|
}
|
|
239441
|
+
function trackPersistedChildSend(receipt, writer) {
|
|
239442
|
+
writer.found.then(async (found) => {
|
|
239443
|
+
if (!found)
|
|
239444
|
+
return;
|
|
239445
|
+
try {
|
|
239446
|
+
await waitForChildRun(receipt, new AbortController().signal, () => {
|
|
239447
|
+
return;
|
|
239448
|
+
});
|
|
239449
|
+
writer.update({ status: "completed" });
|
|
239450
|
+
} catch {
|
|
239451
|
+
writer.update({ status: "failed" });
|
|
239452
|
+
}
|
|
239453
|
+
});
|
|
239454
|
+
}
|
|
239103
239455
|
function trackChildSend(input) {
|
|
239104
239456
|
const { receipt, child, parentScope } = input;
|
|
239105
239457
|
const subagentId = generateSubagentId();
|
|
@@ -239113,10 +239465,16 @@ function trackChildSend(input) {
|
|
|
239113
239465
|
})
|
|
239114
239466
|
});
|
|
239115
239467
|
const onIdle = createRemoteIdleNotifier(subagentId, parentScope);
|
|
239116
|
-
(input.waitForRun ?? ((receipt2, signal) => waitForChildRun(receipt2, signal, onIdle)))(receipt, input.signal ?? new AbortController().signal).then(() =>
|
|
239117
|
-
|
|
239118
|
-
|
|
239119
|
-
})
|
|
239468
|
+
(input.waitForRun ?? ((receipt2, signal) => waitForChildRun(receipt2, signal, onIdle)))(receipt, input.signal ?? new AbortController().signal).then(() => {
|
|
239469
|
+
input.persistRun?.({ status: "completed" });
|
|
239470
|
+
completeSubagent(subagentId, { success: true });
|
|
239471
|
+
}, (error4) => {
|
|
239472
|
+
input.persistRun?.({ status: "failed" });
|
|
239473
|
+
completeSubagent(subagentId, {
|
|
239474
|
+
success: false,
|
|
239475
|
+
error: getErrorMessage2(error4)
|
|
239476
|
+
});
|
|
239477
|
+
});
|
|
239120
239478
|
return subagentId;
|
|
239121
239479
|
}
|
|
239122
239480
|
var init_child_send_tracking = __esm(() => {
|
|
@@ -239328,6 +239686,7 @@ function composeSubagentChildEnv(options) {
|
|
|
239328
239686
|
},
|
|
239329
239687
|
LETTA_PARENT_AGENT_ID: parentAgentId,
|
|
239330
239688
|
LETTA_PARENT_CONVERSATION_ID: options.parentConversationId,
|
|
239689
|
+
[SUBAGENT_SUMMARY_ENV]: options.subagentSummary,
|
|
239331
239690
|
[SUBAGENT_DEPTH_ENV]: String(readSubagentDepth(parentProcessEnv) + 1),
|
|
239332
239691
|
...transcriptPath && { TRANSCRIPT_PATH: transcriptPath }
|
|
239333
239692
|
};
|
|
@@ -239604,6 +239963,250 @@ var init_subagent_process = __esm(() => {
|
|
|
239604
239963
|
init_package_manager_spawn();
|
|
239605
239964
|
});
|
|
239606
239965
|
|
|
239966
|
+
// src/tools/impl/native-session-owner.ts
|
|
239967
|
+
import { createHash as createHash11 } from "node:crypto";
|
|
239968
|
+
import { mkdirSync as mkdirSync38, readFileSync as readFileSync41, rmSync as rmSync16, writeFileSync as writeFileSync33 } from "node:fs";
|
|
239969
|
+
import { join as join68 } from "node:path";
|
|
239970
|
+
function ownerPath(source, sessionId) {
|
|
239971
|
+
const id = createHash11("sha256").update(`${source}:${sessionId}`).digest("hex");
|
|
239972
|
+
return join68(resolveGlobalConfigDir(), "native-session-owners", `${id}.json`);
|
|
239973
|
+
}
|
|
239974
|
+
function readNativeSessionOwner(source, sessionId) {
|
|
239975
|
+
try {
|
|
239976
|
+
const owner = JSON.parse(readFileSync41(ownerPath(source, sessionId), "utf8"));
|
|
239977
|
+
if (typeof owner.agentId === "string" && typeof owner.conversationId === "string" && (owner.cloudSkillRepositories === undefined || isCloudRepositoryNames(owner.cloudSkillRepositories)))
|
|
239978
|
+
return owner;
|
|
239979
|
+
throw new Error("Invalid native session owner record");
|
|
239980
|
+
} catch (error4) {
|
|
239981
|
+
if (error4.code !== "ENOENT")
|
|
239982
|
+
throw error4;
|
|
239983
|
+
}
|
|
239984
|
+
return;
|
|
239985
|
+
}
|
|
239986
|
+
function persistNativeSessionOwner(source, sessionId, scope) {
|
|
239987
|
+
const path30 = ownerPath(source, sessionId);
|
|
239988
|
+
mkdirSync38(join68(path30, ".."), { recursive: true, mode: 448 });
|
|
239989
|
+
try {
|
|
239990
|
+
writeFileSync33(path30, JSON.stringify(scope), { flag: "wx", mode: 384 });
|
|
239991
|
+
} catch (error4) {
|
|
239992
|
+
if (error4.code !== "EEXIST")
|
|
239993
|
+
throw error4;
|
|
239994
|
+
}
|
|
239995
|
+
}
|
|
239996
|
+
var init_native_session_owner = __esm(() => {
|
|
239997
|
+
init_cloud_repository_roots();
|
|
239998
|
+
init_settings_path();
|
|
239999
|
+
});
|
|
240000
|
+
|
|
240001
|
+
// src/tools/impl/antigravity-session.ts
|
|
240002
|
+
import { createInterface as createInterface8 } from "node:readline";
|
|
240003
|
+
async function runAntigravityTurn(options, env6, secrets2) {
|
|
240004
|
+
const start = Date.now();
|
|
240005
|
+
if (env6.GEMINI_API_KEY)
|
|
240006
|
+
secrets2 = { ...secrets2, GEMINI_API_KEY: env6.GEMINI_API_KEY };
|
|
240007
|
+
let sessionId = options.resumeSessionId;
|
|
240008
|
+
const state2 = { queue: [], closing: false };
|
|
240009
|
+
const controller = new AbortController;
|
|
240010
|
+
const signal = options.signal ? AbortSignal.any([controller.signal, options.signal]) : controller.signal;
|
|
240011
|
+
const base2 = {
|
|
240012
|
+
model: options.model,
|
|
240013
|
+
report: "",
|
|
240014
|
+
agentId: options.parentAgentId
|
|
240015
|
+
};
|
|
240016
|
+
try {
|
|
240017
|
+
signal.throwIfAborted();
|
|
240018
|
+
const args = [
|
|
240019
|
+
"--mode",
|
|
240020
|
+
"accept-edits",
|
|
240021
|
+
"--input-format",
|
|
240022
|
+
"stream-json",
|
|
240023
|
+
"--output-format",
|
|
240024
|
+
"stream-json",
|
|
240025
|
+
"--disable-slash-commands"
|
|
240026
|
+
];
|
|
240027
|
+
if (env6.GEMINI_API_KEY)
|
|
240028
|
+
args.push("--settings", '{"modelProvider":"gemini"}');
|
|
240029
|
+
if (sessionId) {
|
|
240030
|
+
const owner = readNativeSessionOwner("antigravity", sessionId);
|
|
240031
|
+
if (!sessionPattern.test(sessionId) || owner?.agentId !== options.parentAgentId)
|
|
240032
|
+
throw new Error("Antigravity session does not belong to this agent");
|
|
240033
|
+
if (sessions.has(sessionId))
|
|
240034
|
+
throw new Error("Antigravity session is already running");
|
|
240035
|
+
sessions.set(sessionId, state2);
|
|
240036
|
+
args.push("--conversation", sessionId);
|
|
240037
|
+
options = {
|
|
240038
|
+
...options,
|
|
240039
|
+
cwd: owner.cwd ?? options.cwd,
|
|
240040
|
+
model: options.model ?? owner.model
|
|
240041
|
+
};
|
|
240042
|
+
}
|
|
240043
|
+
if (options.model)
|
|
240044
|
+
args.push("--model", options.model);
|
|
240045
|
+
const running = spawnManagedWorkloadProcess("agy", args, {
|
|
240046
|
+
cwd: options.cwd,
|
|
240047
|
+
env: env6,
|
|
240048
|
+
signal
|
|
240049
|
+
});
|
|
240050
|
+
const child = running.process;
|
|
240051
|
+
let diagnostic = "";
|
|
240052
|
+
let spawnError;
|
|
240053
|
+
child.once("error", (error5) => {
|
|
240054
|
+
spawnError = error5;
|
|
240055
|
+
});
|
|
240056
|
+
child.stderr.on("data", (chunk2) => {
|
|
240057
|
+
diagnostic = (diagnostic + chunk2).slice(-2048);
|
|
240058
|
+
});
|
|
240059
|
+
child.stdin.on("error", () => {});
|
|
240060
|
+
const lines = createInterface8({ input: child.stdout });
|
|
240061
|
+
const send = (content) => child.stdin.write(`${JSON.stringify({ event: "user", message: { content } })}
|
|
240062
|
+
`);
|
|
240063
|
+
send([options.mcpReminder, options.prompt].filter(Boolean).join(`
|
|
240064
|
+
|
|
240065
|
+
`));
|
|
240066
|
+
let report;
|
|
240067
|
+
let error4;
|
|
240068
|
+
let initialized = false;
|
|
240069
|
+
const text2 = createSecretStreamScrubber(secrets2);
|
|
240070
|
+
const tools = new Set;
|
|
240071
|
+
try {
|
|
240072
|
+
for await (const line of lines) {
|
|
240073
|
+
if (!line.trim())
|
|
240074
|
+
continue;
|
|
240075
|
+
const event = JSON.parse(line);
|
|
240076
|
+
if (!isRecord2(event))
|
|
240077
|
+
throw new Error("Invalid Antigravity event");
|
|
240078
|
+
if (event.event === "init") {
|
|
240079
|
+
const id = event.conversation_id;
|
|
240080
|
+
if (initialized || typeof id !== "string" || !sessionPattern.test(id) || sessionId && id !== sessionId || !sessionId && sessions.has(id))
|
|
240081
|
+
throw new Error("Invalid Antigravity conversation ID");
|
|
240082
|
+
sessionId = id;
|
|
240083
|
+
if (!options.resumeSessionId)
|
|
240084
|
+
persistNativeSessionOwner("antigravity", id, {
|
|
240085
|
+
agentId: options.parentAgentId,
|
|
240086
|
+
conversationId: options.parentConversationId ?? "default",
|
|
240087
|
+
cwd: options.cwd,
|
|
240088
|
+
model: options.model
|
|
240089
|
+
});
|
|
240090
|
+
if (readNativeSessionOwner("antigravity", id)?.agentId !== options.parentAgentId)
|
|
240091
|
+
throw new Error("Antigravity session owner mismatch");
|
|
240092
|
+
sessions.set(id, state2);
|
|
240093
|
+
initialized = true;
|
|
240094
|
+
options.onStarted?.(`antigravity_${id}`);
|
|
240095
|
+
} else if (event.event === "step_update" && isRecord2(event.step_update)) {
|
|
240096
|
+
const step = event.step_update;
|
|
240097
|
+
if (!initialized || step.conversation_id !== sessionId)
|
|
240098
|
+
throw new Error("Unexpected Antigravity step conversation");
|
|
240099
|
+
if (step.step_type === "agent_response" && typeof step.text_delta === "string") {
|
|
240100
|
+
const delta = text2.push(step.text_delta);
|
|
240101
|
+
if (delta)
|
|
240102
|
+
emitProgress(options.onText, delta);
|
|
240103
|
+
}
|
|
240104
|
+
if (step.step_type === "tool" && typeof step.step_index === "number" && typeof step.tool_name === "string") {
|
|
240105
|
+
const info = isRecord2(step.tool_info) ? step.tool_info : {};
|
|
240106
|
+
const id = `step-${step.step_index}`;
|
|
240107
|
+
if (!tools.has(step.step_index)) {
|
|
240108
|
+
tools.add(step.step_index);
|
|
240109
|
+
emitProgress(options.onToolCall, {
|
|
240110
|
+
id,
|
|
240111
|
+
name: step.tool_name,
|
|
240112
|
+
args: formatExternalToolCallArgs(info.parameters)
|
|
240113
|
+
});
|
|
240114
|
+
}
|
|
240115
|
+
if (step.state === "DONE")
|
|
240116
|
+
emitProgress(options.onToolResult, {
|
|
240117
|
+
id,
|
|
240118
|
+
name: step.tool_name,
|
|
240119
|
+
isError: !!info.error,
|
|
240120
|
+
output: toolOutputText(info.error ?? info.output)
|
|
240121
|
+
});
|
|
240122
|
+
}
|
|
240123
|
+
} else if (event.event === "result" && isRecord2(event.result)) {
|
|
240124
|
+
const result3 = event.result;
|
|
240125
|
+
const tail2 = text2.flush();
|
|
240126
|
+
if (tail2)
|
|
240127
|
+
emitProgress(options.onText, tail2);
|
|
240128
|
+
if (result3.status !== "SUCCESS")
|
|
240129
|
+
error4 = typeof result3.error === "string" ? result3.error : "Antigravity turn failed";
|
|
240130
|
+
else if (!initialized || result3.conversation_id !== sessionId || typeof result3.response !== "string" || state2.closing)
|
|
240131
|
+
throw new Error("Invalid Antigravity result");
|
|
240132
|
+
const next = !error4 && state2.queue.shift();
|
|
240133
|
+
if (next) {
|
|
240134
|
+
tools.clear();
|
|
240135
|
+
send(next);
|
|
240136
|
+
} else {
|
|
240137
|
+
state2.closing = true;
|
|
240138
|
+
report = typeof result3.response === "string" ? result3.response : undefined;
|
|
240139
|
+
child.stdin.end();
|
|
240140
|
+
}
|
|
240141
|
+
}
|
|
240142
|
+
}
|
|
240143
|
+
const { exitCode } = await running.completion;
|
|
240144
|
+
signal.throwIfAborted();
|
|
240145
|
+
if (spawnError?.code === "ENOENT")
|
|
240146
|
+
throw new Error("Required executable 'agy' was not found on PATH");
|
|
240147
|
+
if (!initialized && /authentication required|authentication failed/i.test(`${diagnostic}
|
|
240148
|
+
${error4}`))
|
|
240149
|
+
throw new Error("Antigravity is not signed in: run agy to authenticate");
|
|
240150
|
+
if (spawnError || error4 || exitCode !== 0 || report === undefined || !sessionId)
|
|
240151
|
+
throw spawnError ?? new Error(error4 || diagnostic.trim() || "Antigravity exited without a result");
|
|
240152
|
+
return {
|
|
240153
|
+
...base2,
|
|
240154
|
+
agentId: `antigravity_${sessionId}`,
|
|
240155
|
+
runtimeSessionId: sessionId,
|
|
240156
|
+
report: scrubSecretsFromString(report, secrets2),
|
|
240157
|
+
success: true,
|
|
240158
|
+
durationMs: Date.now() - start
|
|
240159
|
+
};
|
|
240160
|
+
} finally {
|
|
240161
|
+
lines.close();
|
|
240162
|
+
if (child.exitCode === null && child.signalCode === null)
|
|
240163
|
+
controller.abort();
|
|
240164
|
+
await running.completion;
|
|
240165
|
+
}
|
|
240166
|
+
} catch (error4) {
|
|
240167
|
+
return {
|
|
240168
|
+
...base2,
|
|
240169
|
+
success: false,
|
|
240170
|
+
error: scrubSecretsFromString(error4 instanceof Error ? error4.message : String(error4), secrets2),
|
|
240171
|
+
durationMs: Date.now() - start
|
|
240172
|
+
};
|
|
240173
|
+
} finally {
|
|
240174
|
+
if (sessionId && sessions.get(sessionId) === state2)
|
|
240175
|
+
sessions.delete(sessionId);
|
|
240176
|
+
}
|
|
240177
|
+
}
|
|
240178
|
+
function sendAntigravityMessage(options, env6, secrets2) {
|
|
240179
|
+
const id = options.resumeSessionId;
|
|
240180
|
+
if (readNativeSessionOwner("antigravity", id)?.agentId !== options.parentAgentId)
|
|
240181
|
+
throw new Error("Antigravity session does not belong to this agent");
|
|
240182
|
+
const active = sessions.get(id);
|
|
240183
|
+
if (active) {
|
|
240184
|
+
if (active.closing)
|
|
240185
|
+
throw new Error("Antigravity session is finishing; retry after completion");
|
|
240186
|
+
active.queue.push(options.prompt);
|
|
240187
|
+
return { mode: "steered", queued: true };
|
|
240188
|
+
}
|
|
240189
|
+
const controller = new AbortController;
|
|
240190
|
+
const signal = options.signal ? AbortSignal.any([controller.signal, options.signal]) : controller.signal;
|
|
240191
|
+
const completion = runAntigravityTurn({ ...options, signal }, env6, secrets2);
|
|
240192
|
+
return {
|
|
240193
|
+
mode: "resumed",
|
|
240194
|
+
completion,
|
|
240195
|
+
interrupt: async () => {
|
|
240196
|
+
controller.abort();
|
|
240197
|
+
await completion;
|
|
240198
|
+
}
|
|
240199
|
+
};
|
|
240200
|
+
}
|
|
240201
|
+
var sessions, sessionPattern;
|
|
240202
|
+
var init_antigravity_session = __esm(() => {
|
|
240203
|
+
init_subagent_process();
|
|
240204
|
+
init_secret_substitution();
|
|
240205
|
+
init_native_session_owner();
|
|
240206
|
+
sessions = new Map;
|
|
240207
|
+
sessionPattern = /^[a-f\d]{8}(?:-[a-f\d]{4}){3}-[a-f\d]{12}$/i;
|
|
240208
|
+
});
|
|
240209
|
+
|
|
239607
240210
|
// src/utils/confirm-process-exit.ts
|
|
239608
240211
|
async function confirmProcessExit(exit, name) {
|
|
239609
240212
|
let timer;
|
|
@@ -239621,11 +240224,11 @@ async function confirmProcessExit(exit, name) {
|
|
|
239621
240224
|
|
|
239622
240225
|
// src/utils/native-cli-env.ts
|
|
239623
240226
|
import { homedir as homedir19 } from "node:os";
|
|
239624
|
-
import { join as
|
|
240227
|
+
import { join as join69 } from "node:path";
|
|
239625
240228
|
function withNativeCliPath(env6, platform7 = process.platform) {
|
|
239626
240229
|
if (platform7 === "win32")
|
|
239627
240230
|
return { ...env6 };
|
|
239628
|
-
const nativeBin =
|
|
240231
|
+
const nativeBin = join69(env6.HOME || homedir19(), ".local", "bin");
|
|
239629
240232
|
const paths = (env6.PATH ?? "/usr/bin:/bin").split(":");
|
|
239630
240233
|
if (!paths.includes(nativeBin))
|
|
239631
240234
|
paths.push(nativeBin);
|
|
@@ -239636,7 +240239,7 @@ var init_native_cli_env = () => {};
|
|
|
239636
240239
|
// src/tools/impl/claude-repository-skills.ts
|
|
239637
240240
|
import { mkdir as mkdir11, mkdtemp as mkdtemp4, rm as rm8, stat as stat10, symlink as symlink3 } from "node:fs/promises";
|
|
239638
240241
|
import { tmpdir as tmpdir13 } from "node:os";
|
|
239639
|
-
import { basename as basename22, join as
|
|
240242
|
+
import { basename as basename22, join as join70 } from "node:path";
|
|
239640
240243
|
async function stageClaudeRepositorySkills(repositoryRoots) {
|
|
239641
240244
|
const directories = [];
|
|
239642
240245
|
let stagingRoot;
|
|
@@ -239647,7 +240250,7 @@ async function stageClaudeRepositorySkills(repositoryRoots) {
|
|
|
239647
240250
|
try {
|
|
239648
240251
|
for (const repo of repositoryRoots) {
|
|
239649
240252
|
for (const source of [".claude", ".agents"]) {
|
|
239650
|
-
const skills =
|
|
240253
|
+
const skills = join70(repo, source, "skills");
|
|
239651
240254
|
const info = await stat10(skills).catch((error4) => {
|
|
239652
240255
|
if (error4.code === "ENOENT" || error4.code === "ENOTDIR")
|
|
239653
240256
|
return;
|
|
@@ -239655,11 +240258,11 @@ async function stageClaudeRepositorySkills(repositoryRoots) {
|
|
|
239655
240258
|
});
|
|
239656
240259
|
if (!info?.isDirectory())
|
|
239657
240260
|
continue;
|
|
239658
|
-
stagingRoot ??= await mkdtemp4(
|
|
239659
|
-
const directory =
|
|
239660
|
-
const claudeDir =
|
|
240261
|
+
stagingRoot ??= await mkdtemp4(join70(tmpdir13(), "letta-claude-skills-"));
|
|
240262
|
+
const directory = join70(stagingRoot, source, basename22(repo));
|
|
240263
|
+
const claudeDir = join70(directory, ".claude");
|
|
239661
240264
|
await mkdir11(claudeDir, { recursive: true });
|
|
239662
|
-
await symlink3(skills,
|
|
240265
|
+
await symlink3(skills, join70(claudeDir, "skills"), "dir");
|
|
239663
240266
|
directories.push(directory);
|
|
239664
240267
|
}
|
|
239665
240268
|
}
|
|
@@ -239798,11 +240401,17 @@ function traceJsonFits(bytes, encodedBytes) {
|
|
|
239798
240401
|
function tracePayloadFits(json2) {
|
|
239799
240402
|
return traceJsonFits(Buffer.byteLength(json2), Buffer.byteLength(JSON.stringify(json2)));
|
|
239800
240403
|
}
|
|
239801
|
-
function
|
|
240404
|
+
function isInlineImage(value) {
|
|
240405
|
+
if (value.type === "image")
|
|
240406
|
+
return value.source?.type === "base64" && typeof value.source.data === "string";
|
|
240407
|
+
const url2 = typeof value.image_url === "string" ? value.image_url : value.image_url?.url;
|
|
240408
|
+
return (value.type === "input_image" || value.type === "image_url") && typeof url2 === "string" && /^data:image\/[^;,]+;base64,/i.test(url2);
|
|
240409
|
+
}
|
|
240410
|
+
function compactTracePayload(json2, mode = "full") {
|
|
239802
240411
|
const payload = JSON.parse(json2);
|
|
239803
240412
|
if (!payload || typeof payload !== "object")
|
|
239804
240413
|
return TRUNCATED_TRACE_JSON;
|
|
239805
|
-
if (!Array.isArray(payload)) {
|
|
240414
|
+
if (mode === "full" && !Array.isArray(payload)) {
|
|
239806
240415
|
const object4 = payload;
|
|
239807
240416
|
delete object4.system;
|
|
239808
240417
|
delete object4.tools;
|
|
@@ -239814,36 +240423,47 @@ function compactTracePayload(json2) {
|
|
|
239814
240423
|
let encodedBytes = Buffer.byteLength(JSON.stringify(initial2));
|
|
239815
240424
|
if (traceJsonFits(bytes, encodedBytes))
|
|
239816
240425
|
return initial2;
|
|
239817
|
-
|
|
239818
|
-
|
|
239819
|
-
|
|
239820
|
-
|
|
239821
|
-
|
|
239822
|
-
|
|
239823
|
-
|
|
239824
|
-
|
|
239825
|
-
|
|
239826
|
-
|
|
239827
|
-
|
|
239828
|
-
|
|
239829
|
-
|
|
239830
|
-
|
|
239831
|
-
|
|
239832
|
-
|
|
239833
|
-
|
|
239834
|
-
|
|
240426
|
+
function shrink(imagesOnly) {
|
|
240427
|
+
const candidates = [];
|
|
240428
|
+
function collect(container) {
|
|
240429
|
+
for (const [key2, value] of Object.entries(container)) {
|
|
240430
|
+
const isObject5 = value !== null && typeof value === "object";
|
|
240431
|
+
if (imagesOnly && (!isObject5 || !isInlineImage(value))) {
|
|
240432
|
+
if (isObject5)
|
|
240433
|
+
collect(value);
|
|
240434
|
+
continue;
|
|
240435
|
+
}
|
|
240436
|
+
if (!imagesOnly && (Array.isArray(value) || key2 === "response" && isObject5)) {
|
|
240437
|
+
collect(value);
|
|
240438
|
+
continue;
|
|
240439
|
+
}
|
|
240440
|
+
const serialized = JSON.stringify(value);
|
|
240441
|
+
const bytes2 = Buffer.byteLength(serialized) - Buffer.byteLength(TRUNCATED_TRACE_JSON);
|
|
240442
|
+
const encodedBytes2 = Buffer.byteLength(JSON.stringify(serialized)) - Buffer.byteLength(JSON.stringify(TRUNCATED_TRACE_JSON));
|
|
240443
|
+
if (bytes2 > 0 && encodedBytes2 > 0) {
|
|
240444
|
+
candidates.push({
|
|
240445
|
+
bytes: bytes2,
|
|
240446
|
+
encodedBytes: encodedBytes2,
|
|
240447
|
+
replace: () => {
|
|
240448
|
+
container[key2] = truncated;
|
|
240449
|
+
}
|
|
240450
|
+
});
|
|
240451
|
+
}
|
|
239835
240452
|
}
|
|
239836
240453
|
}
|
|
240454
|
+
collect(payload);
|
|
240455
|
+
candidates.sort((a2, b3) => b3.bytes - a2.bytes);
|
|
240456
|
+
for (const candidate of candidates) {
|
|
240457
|
+
if (traceJsonFits(bytes, encodedBytes))
|
|
240458
|
+
break;
|
|
240459
|
+
candidate.replace();
|
|
240460
|
+
bytes -= candidate.bytes;
|
|
240461
|
+
encodedBytes -= candidate.encodedBytes;
|
|
240462
|
+
}
|
|
239837
240463
|
}
|
|
239838
|
-
|
|
239839
|
-
|
|
239840
|
-
|
|
239841
|
-
if (traceJsonFits(bytes, encodedBytes))
|
|
239842
|
-
break;
|
|
239843
|
-
candidate.replace();
|
|
239844
|
-
bytes -= candidate.bytes;
|
|
239845
|
-
encodedBytes -= candidate.encodedBytes;
|
|
239846
|
-
}
|
|
240464
|
+
shrink(true);
|
|
240465
|
+
if (mode === "full" && !traceJsonFits(bytes, encodedBytes))
|
|
240466
|
+
shrink(false);
|
|
239847
240467
|
return traceJsonFits(bytes, encodedBytes) ? marked() : TRUNCATED_TRACE_JSON;
|
|
239848
240468
|
}
|
|
239849
240469
|
var MAX_TRACE_PAYLOAD_BYTES, SENSITIVE, MAX_TRACE_BUFFER_BYTES, MAX_ENCODED_PAYLOAD_BYTES, truncated, TRUNCATED_TRACE_JSON;
|
|
@@ -239863,12 +240483,24 @@ import { createServer as createServer6, request as httpRequest3 } from "node:htt
|
|
|
239863
240483
|
import { request as httpsRequest2 } from "node:https";
|
|
239864
240484
|
import { isDeepStrictEqual } from "node:util";
|
|
239865
240485
|
import { brotliDecompressSync, gunzipSync, inflateSync } from "node:zlib";
|
|
240486
|
+
function withoutCacheBreakpoints(item) {
|
|
240487
|
+
if (!item || typeof item !== "object" || Array.isArray(item))
|
|
240488
|
+
return item;
|
|
240489
|
+
const block = { ...item };
|
|
240490
|
+
const cacheControl = block.cache_control;
|
|
240491
|
+
if (cacheControl && typeof cacheControl === "object" && "type" in cacheControl && cacheControl.type === "ephemeral")
|
|
240492
|
+
delete block.cache_control;
|
|
240493
|
+
if (Array.isArray(block.content))
|
|
240494
|
+
block.content = block.content.map(withoutCacheBreakpoints);
|
|
240495
|
+
return block;
|
|
240496
|
+
}
|
|
239866
240497
|
async function startTraceProxy(options) {
|
|
239867
240498
|
const upstream = new URL(options.upstream);
|
|
239868
240499
|
if (!["http:", "https:"].includes(upstream.protocol) || upstream.username || upstream.password)
|
|
239869
240500
|
throw new Error("Unsupported trace upstream");
|
|
239870
240501
|
const prefix = `/${randomUUID39()}`;
|
|
239871
240502
|
const historyKey = options.harness === "claude_code" ? "messages" : "input";
|
|
240503
|
+
const comparable = (item) => options.harness === "claude_code" ? withoutCacheBreakpoints(item) : item;
|
|
239872
240504
|
let previous;
|
|
239873
240505
|
let activeCaptures = 0;
|
|
239874
240506
|
const pending2 = new Set;
|
|
@@ -239946,21 +240578,26 @@ async function startTraceProxy(options) {
|
|
|
239946
240578
|
requestJson = fallbackJson;
|
|
239947
240579
|
if (previous?.sessionId === scope.worker_session_id && Array.isArray(items)) {
|
|
239948
240580
|
const prefixItems = previous.items.length;
|
|
239949
|
-
if (prefixItems > 0 && items.length > prefixItems && previous.items.every((item, index) => isDeepStrictEqual(item, items[index]))) {
|
|
239950
|
-
const
|
|
240581
|
+
if (prefixItems > 0 && items.length > prefixItems && previous.items.every((item, index) => isDeepStrictEqual(item, comparable(items[index])))) {
|
|
240582
|
+
const rawDelta = JSON.stringify({
|
|
239951
240583
|
...request3,
|
|
239952
240584
|
[historyKey]: items.slice(prefixItems),
|
|
239953
240585
|
base_trace_id: previous.id,
|
|
239954
240586
|
prefix_items: prefixItems
|
|
239955
240587
|
});
|
|
239956
|
-
|
|
240588
|
+
const deltaJson = tracePayloadFits(rawDelta) ? rawDelta : compactTracePayload(rawDelta, "images");
|
|
240589
|
+
if (deltaJson !== TRUNCATED_TRACE_JSON) {
|
|
239957
240590
|
requestJson = deltaJson;
|
|
239958
240591
|
delta = { baseId: previous.id, fallbackJson };
|
|
239959
240592
|
}
|
|
239960
240593
|
}
|
|
239961
240594
|
}
|
|
239962
240595
|
}
|
|
239963
|
-
previous = Array.isArray(items) && (!requestTruncated || delta) ? {
|
|
240596
|
+
previous = Array.isArray(items) && (!requestTruncated || delta) ? {
|
|
240597
|
+
id,
|
|
240598
|
+
sessionId: scope.worker_session_id,
|
|
240599
|
+
items: items.map(comparable)
|
|
240600
|
+
} : undefined;
|
|
239964
240601
|
const response = assembled.response;
|
|
239965
240602
|
const usage = response.usage ?? {};
|
|
239966
240603
|
const token2 = (value) => typeof value === "number" && Number.isFinite(value) && value >= 0 ? Math.min(Math.trunc(value), 4294967295) : null;
|
|
@@ -239973,6 +240610,7 @@ async function startTraceProxy(options) {
|
|
|
239973
240610
|
const error4 = transportError || status >= 400 || Boolean(response.error) || response.status === "failed";
|
|
239974
240611
|
options.emit({
|
|
239975
240612
|
...scope,
|
|
240613
|
+
task_description: scope.task_description === undefined ? undefined : JSON.parse(sanitizeTraceJson(JSON.stringify(scope.task_description), credentials)),
|
|
239976
240614
|
id,
|
|
239977
240615
|
harness: options.harness,
|
|
239978
240616
|
model: JSON.parse(sanitizeTraceJson(JSON.stringify(String(response.model ?? request3?.model ?? "")), credentials)).slice(0, 255),
|
|
@@ -240024,6 +240662,7 @@ async function startTraceProxy(options) {
|
|
|
240024
240662
|
reply.on("end", () => finish());
|
|
240025
240663
|
reply.on("error", () => {
|
|
240026
240664
|
finish(true);
|
|
240665
|
+
res.socket?.destroy();
|
|
240027
240666
|
res.destroy();
|
|
240028
240667
|
});
|
|
240029
240668
|
reply.pipe(res);
|
|
@@ -240055,6 +240694,15 @@ async function startTraceProxy(options) {
|
|
|
240055
240694
|
});
|
|
240056
240695
|
req.pipe(target);
|
|
240057
240696
|
});
|
|
240697
|
+
if (options.harness === "codex") {
|
|
240698
|
+
server2.on("upgrade", (_request, socket) => {
|
|
240699
|
+
socket.end(`HTTP/1.1 404 Not Found\r
|
|
240700
|
+
Connection: close\r
|
|
240701
|
+
Content-Length: 0\r
|
|
240702
|
+
\r
|
|
240703
|
+
`);
|
|
240704
|
+
});
|
|
240705
|
+
}
|
|
240058
240706
|
await new Promise((resolve34, reject2) => {
|
|
240059
240707
|
server2.once("error", reject2);
|
|
240060
240708
|
server2.listen(0, "127.0.0.1", resolve34);
|
|
@@ -240081,8 +240729,10 @@ var init_external_llm_trace_proxy = __esm(() => {
|
|
|
240081
240729
|
// src/tools/impl/external-llm-trace-session.ts
|
|
240082
240730
|
function updateExternalTraceTask(sessionId, context3) {
|
|
240083
240731
|
const scope = sessionScopes.get(sessionId);
|
|
240084
|
-
if (scope && context3 && scope.parent_agent_id === context3.parent_agent_id && scope.parent_conversation_id === context3.parent_conversation_id)
|
|
240732
|
+
if (scope && context3 && scope.parent_agent_id === context3.parent_agent_id && scope.parent_conversation_id === context3.parent_conversation_id) {
|
|
240085
240733
|
scope.task_id = context3.task_id;
|
|
240734
|
+
scope.task_description = context3.task_description;
|
|
240735
|
+
}
|
|
240086
240736
|
}
|
|
240087
240737
|
function describeUploadError(error4, secrets2) {
|
|
240088
240738
|
if (!(error4 instanceof Error))
|
|
@@ -240278,12 +240928,21 @@ async function traceClaudeLaunch(context3, env6, sessionId) {
|
|
|
240278
240928
|
function record4(value) {
|
|
240279
240929
|
return value && typeof value === "object" && !Array.isArray(value) ? value : {};
|
|
240280
240930
|
}
|
|
240281
|
-
async function traceCodexLaunch(context3, env6, client, createTrace2 = createTraceSession) {
|
|
240931
|
+
async function traceCodexLaunch(context3, env6, client, resumeThreadId, createTrace2 = createTraceSession) {
|
|
240282
240932
|
if (!context3 || env6.LETTA_CODE_TELEM === "0" || env6.LETTA_CODE_TELEM === "false" || env6.DO_NOT_TRACK === "1")
|
|
240283
240933
|
return;
|
|
240284
240934
|
try {
|
|
240285
240935
|
const configuration = record4((await client.request("config/read", { includeLayers: false })).config);
|
|
240286
|
-
const
|
|
240936
|
+
const resumed = resumeThreadId ? await client.request("thread/read", {
|
|
240937
|
+
threadId: resumeThreadId,
|
|
240938
|
+
includeTurns: false
|
|
240939
|
+
}).catch(() => {
|
|
240940
|
+
return;
|
|
240941
|
+
}) : undefined;
|
|
240942
|
+
const persistedProvider = record4(resumed?.thread).modelProvider;
|
|
240943
|
+
const configuredProvider = configuration.model_provider;
|
|
240944
|
+
const sourceProvider = typeof persistedProvider === "string" && persistedProvider ? persistedProvider : configuredProvider;
|
|
240945
|
+
const providerId2 = typeof sourceProvider === "string" && sourceProvider !== "letta_trace" ? sourceProvider : "openai";
|
|
240287
240946
|
const provider2 = record4(record4(configuration.model_providers)[providerId2]);
|
|
240288
240947
|
const account = record4((await client.request("account/read", { refreshToken: false })).account);
|
|
240289
240948
|
const configuredUrl = provider2.base_url ?? (providerId2 === "openai" ? configuration.openai_base_url ?? env6.OPENAI_BASE_URL : undefined);
|
|
@@ -240300,6 +240959,8 @@ async function traceCodexLaunch(context3, env6, client, createTrace2 = createTra
|
|
|
240300
240959
|
[`model_providers.${selected}.supports_websockets`]: false
|
|
240301
240960
|
};
|
|
240302
240961
|
if (providerId2 === "openai") {
|
|
240962
|
+
if (resumeThreadId)
|
|
240963
|
+
overrides.openai_base_url = trace.url;
|
|
240303
240964
|
overrides[`model_providers.${selected}.name`] = "OpenAI trace";
|
|
240304
240965
|
overrides[`model_providers.${selected}.requires_openai_auth`] = true;
|
|
240305
240966
|
overrides[`model_providers.${selected}.wire_api`] = "responses";
|
|
@@ -240309,8 +240970,7 @@ async function traceCodexLaunch(context3, env6, client, createTrace2 = createTra
|
|
|
240309
240970
|
args: Object.entries(overrides).flatMap(([key2, value]) => [
|
|
240310
240971
|
"-c",
|
|
240311
240972
|
`${key2}=${JSON.stringify(value)}`
|
|
240312
|
-
])
|
|
240313
|
-
params: { modelProvider: selected }
|
|
240973
|
+
])
|
|
240314
240974
|
};
|
|
240315
240975
|
} catch {
|
|
240316
240976
|
return;
|
|
@@ -240322,7 +240982,7 @@ var init_external_llm_trace_launch = __esm(() => {
|
|
|
240322
240982
|
|
|
240323
240983
|
// src/tools/impl/claude-stream-session.ts
|
|
240324
240984
|
import { randomUUID as randomUUID40 } from "node:crypto";
|
|
240325
|
-
import { createInterface as
|
|
240985
|
+
import { createInterface as createInterface9 } from "node:readline";
|
|
240326
240986
|
function errorMessage3(error4) {
|
|
240327
240987
|
return error4 instanceof Error ? error4.message : String(error4);
|
|
240328
240988
|
}
|
|
@@ -240345,6 +241005,8 @@ function buildClaudeStreamArgs(options) {
|
|
|
240345
241005
|
args.push("--resume", options.resumeSessionId);
|
|
240346
241006
|
else if (options.sessionId)
|
|
240347
241007
|
args.push("--session-id", options.sessionId);
|
|
241008
|
+
if (options.sessionName && !options.resumeSessionId)
|
|
241009
|
+
args.push("--name", options.sessionName);
|
|
240348
241010
|
if (options.mcpReminder)
|
|
240349
241011
|
args.push("--append-system-prompt", options.mcpReminder);
|
|
240350
241012
|
if (options.skillDirectories?.length)
|
|
@@ -240662,6 +241324,7 @@ async function launchSession(options, deps) {
|
|
|
240662
241324
|
mcpReminder: options.mcpReminder,
|
|
240663
241325
|
resumeSessionId: options.resumeSessionId,
|
|
240664
241326
|
sessionId,
|
|
241327
|
+
sessionName: options.sessionName,
|
|
240665
241328
|
skillDirectories: skills.directories
|
|
240666
241329
|
}),
|
|
240667
241330
|
cwd: options.cwd,
|
|
@@ -240725,12 +241388,12 @@ async function launchSession(options, deps) {
|
|
|
240725
241388
|
onReasoning: options.onReasoning,
|
|
240726
241389
|
toolNames: new Map
|
|
240727
241390
|
};
|
|
240728
|
-
|
|
241391
|
+
sessions2.set(sessionId, session3);
|
|
240729
241392
|
transport3.process.stderr.setEncoding("utf8");
|
|
240730
241393
|
transport3.process.stderr.on("data", (chunk2) => {
|
|
240731
241394
|
session3.stderr += chunk2;
|
|
240732
241395
|
});
|
|
240733
|
-
const stdout =
|
|
241396
|
+
const stdout = createInterface9({ input: transport3.process.stdout });
|
|
240734
241397
|
stdout.on("line", (line) => {
|
|
240735
241398
|
if (!line.trim())
|
|
240736
241399
|
return;
|
|
@@ -240779,8 +241442,8 @@ async function launchSession(options, deps) {
|
|
|
240779
241442
|
}).finally(() => {
|
|
240780
241443
|
session3.exited = true;
|
|
240781
241444
|
removeUpstreamAbort();
|
|
240782
|
-
if (
|
|
240783
|
-
|
|
241445
|
+
if (sessions2.get(sessionId) === session3)
|
|
241446
|
+
sessions2.delete(sessionId);
|
|
240784
241447
|
resolveExit();
|
|
240785
241448
|
});
|
|
240786
241449
|
try {
|
|
@@ -240834,7 +241497,7 @@ async function startSession(options, deps) {
|
|
|
240834
241497
|
const key2 = options.resumeSessionId ?? options.sessionId;
|
|
240835
241498
|
if (key2) {
|
|
240836
241499
|
for (;; ) {
|
|
240837
|
-
const existing =
|
|
241500
|
+
const existing = sessions2.get(key2);
|
|
240838
241501
|
if (!existing)
|
|
240839
241502
|
break;
|
|
240840
241503
|
if (!existing.settled)
|
|
@@ -240866,14 +241529,14 @@ async function steerSession(session3, prompt, signal) {
|
|
|
240866
241529
|
signal?.throwIfAborted();
|
|
240867
241530
|
await waitForTurnStart(session3, signal);
|
|
240868
241531
|
if (session3.idleOnBackgroundTasks) {
|
|
240869
|
-
if (session3.settled ||
|
|
241532
|
+
if (session3.settled || sessions2.get(session3.sessionId) !== session3) {
|
|
240870
241533
|
throw new Error("Claude Code session is no longer active");
|
|
240871
241534
|
}
|
|
240872
241535
|
session3.idleOnBackgroundTasks = false;
|
|
240873
241536
|
await writeInput(session3, prompt);
|
|
240874
241537
|
return "steered";
|
|
240875
241538
|
}
|
|
240876
|
-
if (session3.settled ||
|
|
241539
|
+
if (session3.settled || sessions2.get(session3.sessionId) !== session3) {
|
|
240877
241540
|
throw new Error("Claude Code session is no longer active");
|
|
240878
241541
|
}
|
|
240879
241542
|
const requestId = randomUUID40();
|
|
@@ -240906,7 +241569,7 @@ async function steerSession(session3, prompt, signal) {
|
|
|
240906
241569
|
session3.suppressedResult = undefined;
|
|
240907
241570
|
return "steered";
|
|
240908
241571
|
} catch (error4) {
|
|
240909
|
-
if (ackTimedOut && !signal?.aborted && !session3.settled &&
|
|
241572
|
+
if (ackTimedOut && !signal?.aborted && !session3.settled && sessions2.get(session3.sessionId) === session3 && await queueSteerPrompt(session3, prompt))
|
|
240910
241573
|
return "queued";
|
|
240911
241574
|
session3.pendingSteers = Math.max(0, session3.pendingSteers - 1);
|
|
240912
241575
|
if (interruptAcknowledged) {
|
|
@@ -240918,7 +241581,7 @@ async function steerSession(session3, prompt, signal) {
|
|
|
240918
241581
|
const suppressed = session3.suppressedResult;
|
|
240919
241582
|
session3.suppressedResult = undefined;
|
|
240920
241583
|
finishResult(session3, suppressed);
|
|
240921
|
-
} else if (session3.resultCount === resultCount && !session3.settled &&
|
|
241584
|
+
} else if (session3.resultCount === resultCount && !session3.settled && sessions2.get(session3.sessionId) === session3) {
|
|
240922
241585
|
markTurnStarted(session3);
|
|
240923
241586
|
}
|
|
240924
241587
|
throw error4;
|
|
@@ -240948,7 +241611,7 @@ async function deliverClaudeMessage(options, deps, launch) {
|
|
|
240948
241611
|
await pending3;
|
|
240949
241612
|
continue;
|
|
240950
241613
|
}
|
|
240951
|
-
const existing =
|
|
241614
|
+
const existing = sessions2.get(options.sessionId);
|
|
240952
241615
|
if (!existing)
|
|
240953
241616
|
break;
|
|
240954
241617
|
if (existing.settled) {
|
|
@@ -240963,7 +241626,7 @@ async function deliverClaudeMessage(options, deps, launch) {
|
|
|
240963
241626
|
session: existing
|
|
240964
241627
|
};
|
|
240965
241628
|
} catch (error4) {
|
|
240966
|
-
if (
|
|
241629
|
+
if (sessions2.get(options.sessionId) === existing && !existing.settled)
|
|
240967
241630
|
throw error4;
|
|
240968
241631
|
}
|
|
240969
241632
|
}
|
|
@@ -241005,14 +241668,14 @@ async function sendClaudeMessage(options, deps = {}) {
|
|
|
241005
241668
|
return trackedReceipt(delivered.session);
|
|
241006
241669
|
}
|
|
241007
241670
|
async function stopClaudeSession(sessionId) {
|
|
241008
|
-
const session3 =
|
|
241671
|
+
const session3 = sessions2.get(sessionId);
|
|
241009
241672
|
if (!session3)
|
|
241010
241673
|
return false;
|
|
241011
241674
|
session3.abortController.abort(new Error("Stopped by parent"));
|
|
241012
241675
|
await confirmProcessExit(session3.exit, "Claude Code");
|
|
241013
241676
|
return true;
|
|
241014
241677
|
}
|
|
241015
|
-
var
|
|
241678
|
+
var sessions2, pendingResumes, BACKGROUND_TASK_WAIT_CAP_MS, SETTLED_EXIT_GRACE_MS = 1e4;
|
|
241016
241679
|
var init_claude_stream_session = __esm(() => {
|
|
241017
241680
|
init_subagent_process();
|
|
241018
241681
|
init_cloud_repository_roots();
|
|
@@ -241020,7 +241683,7 @@ var init_claude_stream_session = __esm(() => {
|
|
|
241020
241683
|
init_claude_repository_skills();
|
|
241021
241684
|
init_claude_steer_timeouts();
|
|
241022
241685
|
init_external_llm_trace_launch();
|
|
241023
|
-
|
|
241686
|
+
sessions2 = new Map;
|
|
241024
241687
|
pendingResumes = new Map;
|
|
241025
241688
|
BACKGROUND_TASK_WAIT_CAP_MS = 35 * 60000;
|
|
241026
241689
|
});
|
|
@@ -241119,6 +241782,12 @@ function capacityResult(result3) {
|
|
|
241119
241782
|
error: `${CODEX_CAPACITY_ERROR}. Last error: ${result3.error ?? "unknown"}`
|
|
241120
241783
|
};
|
|
241121
241784
|
}
|
|
241785
|
+
function errorMessage4(error4) {
|
|
241786
|
+
return error4 instanceof Error ? error4.message : String(error4);
|
|
241787
|
+
}
|
|
241788
|
+
function textInput(text2) {
|
|
241789
|
+
return [{ type: "text", text: text2 }];
|
|
241790
|
+
}
|
|
241122
241791
|
var CAPACITY_RETRY_DELAYS_MS, CODEX_CAPACITY_ERROR = "Codex is out of capacity for this session; start a new codex session or use claude-code", TOOL_ITEM_TYPES;
|
|
241123
241792
|
var init_codex_app_server_payloads = __esm(() => {
|
|
241124
241793
|
CAPACITY_RETRY_DELAYS_MS = [1000, 2000];
|
|
@@ -241188,8 +241857,8 @@ var init_codex_steer_receipt = __esm(() => {
|
|
|
241188
241857
|
});
|
|
241189
241858
|
|
|
241190
241859
|
// src/tools/impl/codex-app-server.ts
|
|
241191
|
-
import { join as
|
|
241192
|
-
import { createInterface as
|
|
241860
|
+
import { join as join71 } from "node:path";
|
|
241861
|
+
import { createInterface as createInterface10 } from "node:readline";
|
|
241193
241862
|
import { setTimeout as sleep12 } from "node:timers/promises";
|
|
241194
241863
|
async function listCodexModels(cwd2, env6) {
|
|
241195
241864
|
const controller = new AbortController;
|
|
@@ -241243,12 +241912,6 @@ async function listCodexModels(cwd2, env6) {
|
|
|
241243
241912
|
await running.completion;
|
|
241244
241913
|
}
|
|
241245
241914
|
}
|
|
241246
|
-
function errorMessage4(error4) {
|
|
241247
|
-
return error4 instanceof Error ? error4.message : String(error4);
|
|
241248
|
-
}
|
|
241249
|
-
function textInput(text2) {
|
|
241250
|
-
return [{ type: "text", text: text2 }];
|
|
241251
|
-
}
|
|
241252
241915
|
function spawnTransport(options) {
|
|
241253
241916
|
const controller = new AbortController;
|
|
241254
241917
|
const { process: child, completion } = spawnManagedWorkloadProcess("codex", [...options.configArgs ?? [], "app-server", "--stdio"], {
|
|
@@ -241279,7 +241942,7 @@ class CodexAppServerClient {
|
|
|
241279
241942
|
this.transport = transport3;
|
|
241280
241943
|
this.onNotification = onNotification;
|
|
241281
241944
|
this.onClose = onClose;
|
|
241282
|
-
const stdout =
|
|
241945
|
+
const stdout = createInterface10({ input: transport3.stdout });
|
|
241283
241946
|
stdout.once("error", () => void this.close());
|
|
241284
241947
|
stdout.on("line", (line) => {
|
|
241285
241948
|
if (!line.trim())
|
|
@@ -241317,7 +241980,7 @@ class CodexAppServerClient {
|
|
|
241317
241980
|
await this.request("initialize", {
|
|
241318
241981
|
clientInfo: {
|
|
241319
241982
|
name: "letta-code",
|
|
241320
|
-
version: "0.34.
|
|
241983
|
+
version: "0.34.71"
|
|
241321
241984
|
},
|
|
241322
241985
|
capabilities: null
|
|
241323
241986
|
});
|
|
@@ -241377,8 +242040,8 @@ class CodexAppServerClient {
|
|
|
241377
242040
|
}
|
|
241378
242041
|
function failSession(session3, error4) {
|
|
241379
242042
|
clearIdleSessionCleanup(session3);
|
|
241380
|
-
if (
|
|
241381
|
-
|
|
242043
|
+
if (sessions3.get(session3.threadId) === session3)
|
|
242044
|
+
sessions3.delete(session3.threadId);
|
|
241382
242045
|
const waiter = session3.activeWaiter;
|
|
241383
242046
|
session3.activeTurnId = undefined;
|
|
241384
242047
|
session3.activeWaiter = undefined;
|
|
@@ -241521,8 +242184,8 @@ function clearIdleSessionCleanup(session3) {
|
|
|
241521
242184
|
}
|
|
241522
242185
|
function disposeSession(session3) {
|
|
241523
242186
|
clearIdleSessionCleanup(session3);
|
|
241524
|
-
if (
|
|
241525
|
-
|
|
242187
|
+
if (sessions3.get(session3.threadId) === session3)
|
|
242188
|
+
sessions3.delete(session3.threadId);
|
|
241526
242189
|
session3.client.dispose();
|
|
241527
242190
|
}
|
|
241528
242191
|
function scheduleIdleSessionCleanup(session3) {
|
|
@@ -241578,7 +242241,7 @@ async function createSession(options, deps) {
|
|
|
241578
242241
|
try {
|
|
241579
242242
|
await client.initialize();
|
|
241580
242243
|
await assertCodexSignedIn(client);
|
|
241581
|
-
trace = deps.createTransport ? undefined : await traceCodexLaunch(options.traceContext, env6, client);
|
|
242244
|
+
trace = deps.createTransport ? undefined : await traceCodexLaunch(options.traceContext, env6, client, options.resumeThreadId);
|
|
241582
242245
|
if (trace) {
|
|
241583
242246
|
client.dispose();
|
|
241584
242247
|
transport3 = spawnTransport({
|
|
@@ -241595,12 +242258,13 @@ async function createSession(options, deps) {
|
|
|
241595
242258
|
});
|
|
241596
242259
|
if (options.cloudSkillRepositories?.length) {
|
|
241597
242260
|
await client.request("skills/extraRoots/set", {
|
|
241598
|
-
extraRoots: cloudRepositoryRoots(options.cloudSkillRepositories).map((root2) =>
|
|
242261
|
+
extraRoots: cloudRepositoryRoots(options.cloudSkillRepositories).map((root2) => join71(root2, PROJECT_SKILLS_DIR))
|
|
241599
242262
|
});
|
|
241600
242263
|
}
|
|
241601
242264
|
const method2 = options.resumeThreadId ? "thread/resume" : "thread/start";
|
|
241602
242265
|
const params = options.resumeThreadId ? {
|
|
241603
242266
|
threadId: options.resumeThreadId,
|
|
242267
|
+
model: options.model,
|
|
241604
242268
|
...options.mcpReminder ? { developerInstructions: options.mcpReminder } : {}
|
|
241605
242269
|
} : {
|
|
241606
242270
|
cwd: options.cwd,
|
|
@@ -241609,7 +242273,7 @@ async function createSession(options, deps) {
|
|
|
241609
242273
|
sandbox: "danger-full-access",
|
|
241610
242274
|
developerInstructions: options.mcpReminder
|
|
241611
242275
|
};
|
|
241612
|
-
response = await client.request(method2,
|
|
242276
|
+
response = await client.request(method2, params);
|
|
241613
242277
|
} catch (error4) {
|
|
241614
242278
|
trace?.close();
|
|
241615
242279
|
client.dispose();
|
|
@@ -241622,18 +242286,22 @@ async function createSession(options, deps) {
|
|
|
241622
242286
|
throw new Error("Codex app-server returned no native thread ID");
|
|
241623
242287
|
}
|
|
241624
242288
|
trace?.setSessionId(threadId);
|
|
242289
|
+
if (options.threadName && !options.resumeThreadId)
|
|
242290
|
+
await client.request("thread/name/set", { threadId, name: options.threadName }).catch(() => {
|
|
242291
|
+
return;
|
|
242292
|
+
});
|
|
241625
242293
|
session3 = {
|
|
241626
242294
|
threadId,
|
|
241627
242295
|
client,
|
|
241628
242296
|
cwd: readString3(thread, "cwd") ?? options.cwd,
|
|
241629
242297
|
parentAgentId: options.parentAgentId,
|
|
241630
|
-
model: options.model,
|
|
242298
|
+
model: readString3(response, "model") ?? options.model,
|
|
241631
242299
|
startLock: Promise.resolve(),
|
|
241632
242300
|
pendingNotifications,
|
|
241633
242301
|
idleTimeoutMs: deps.idleTimeoutMs ?? DEFAULT_IDLE_TIMEOUT_MS,
|
|
241634
242302
|
sleep: deps.sleep ?? sleep12
|
|
241635
242303
|
};
|
|
241636
|
-
|
|
242304
|
+
sessions3.set(threadId, session3);
|
|
241637
242305
|
return session3;
|
|
241638
242306
|
}
|
|
241639
242307
|
async function startTurnAttempt(session3, prompt, startedAt, listeners6) {
|
|
@@ -241645,7 +242313,6 @@ async function startTurnAttempt(session3, prompt, startedAt, listeners6) {
|
|
|
241645
242313
|
threadId: session3.threadId,
|
|
241646
242314
|
input: textInput(prompt),
|
|
241647
242315
|
cwd: session3.cwd,
|
|
241648
|
-
model: session3.model,
|
|
241649
242316
|
approvalPolicy: "never",
|
|
241650
242317
|
sandboxPolicy: { type: "dangerFullAccess" }
|
|
241651
242318
|
});
|
|
@@ -241754,7 +242421,7 @@ async function startCodexTurn(options, deps = {}) {
|
|
|
241754
242421
|
}
|
|
241755
242422
|
}
|
|
241756
242423
|
async function resumeSession(threadId, options, deps) {
|
|
241757
|
-
const loaded =
|
|
242424
|
+
const loaded = sessions3.get(threadId);
|
|
241758
242425
|
if (loaded) {
|
|
241759
242426
|
clearIdleSessionCleanup(loaded);
|
|
241760
242427
|
return loaded;
|
|
@@ -241814,7 +242481,7 @@ async function sendCodexMessage(options, deps = {}) {
|
|
|
241814
242481
|
};
|
|
241815
242482
|
}));
|
|
241816
242483
|
} catch (error4) {
|
|
241817
|
-
if (!session3.activeTurnId &&
|
|
242484
|
+
if (!session3.activeTurnId && sessions3.get(session3.threadId) === session3) {
|
|
241818
242485
|
scheduleIdleSessionCleanup(session3);
|
|
241819
242486
|
}
|
|
241820
242487
|
throw error4;
|
|
@@ -241835,15 +242502,15 @@ async function runCodexTurn(options, deps = {}) {
|
|
|
241835
242502
|
}
|
|
241836
242503
|
}
|
|
241837
242504
|
async function stopCodexSession(threadId) {
|
|
241838
|
-
const session3 =
|
|
242505
|
+
const session3 = sessions3.get(threadId);
|
|
241839
242506
|
if (!session3)
|
|
241840
242507
|
return false;
|
|
241841
242508
|
await session3.client.stop();
|
|
241842
|
-
if (
|
|
241843
|
-
|
|
242509
|
+
if (sessions3.get(threadId) === session3)
|
|
242510
|
+
sessions3.delete(threadId);
|
|
241844
242511
|
return true;
|
|
241845
242512
|
}
|
|
241846
|
-
var
|
|
242513
|
+
var sessions3, sessionCreations, DEFAULT_IDLE_TIMEOUT_MS, CODEX_NOT_SIGNED_IN_ERROR = "Codex is not signed in. Run `codex login` on this computer.";
|
|
241847
242514
|
var init_codex_app_server = __esm(() => {
|
|
241848
242515
|
init_skills5();
|
|
241849
242516
|
init_subagent_process();
|
|
@@ -241853,7 +242520,7 @@ var init_codex_app_server = __esm(() => {
|
|
|
241853
242520
|
init_codex_steer_receipt();
|
|
241854
242521
|
init_external_llm_trace_launch();
|
|
241855
242522
|
init_external_llm_trace_session();
|
|
241856
|
-
|
|
242523
|
+
sessions3 = new Map;
|
|
241857
242524
|
sessionCreations = new Map;
|
|
241858
242525
|
DEFAULT_IDLE_TIMEOUT_MS = 5 * 60000;
|
|
241859
242526
|
});
|
|
@@ -241861,8 +242528,8 @@ var init_codex_app_server = __esm(() => {
|
|
|
241861
242528
|
// src/tools/impl/cursor-session.ts
|
|
241862
242529
|
import { randomUUID as randomUUID41 } from "node:crypto";
|
|
241863
242530
|
import { existsSync as existsSync47 } from "node:fs";
|
|
241864
|
-
import { join as
|
|
241865
|
-
import { createInterface as
|
|
242531
|
+
import { join as join72 } from "node:path";
|
|
242532
|
+
import { createInterface as createInterface11 } from "node:readline";
|
|
241866
242533
|
import { fileURLToPath as fileURLToPath7 } from "node:url";
|
|
241867
242534
|
function key2(options, id) {
|
|
241868
242535
|
if (!UUID.test(id) || !/^[\w-]+$/.test(options.parentAgentId))
|
|
@@ -241895,7 +242562,7 @@ async function runCursorTurn(options, env6 = process.env, secrets2 = {}) {
|
|
|
241895
242562
|
try {
|
|
241896
242563
|
options.signal?.throwIfAborted();
|
|
241897
242564
|
sessionKey = key2(options, id);
|
|
241898
|
-
if (
|
|
242565
|
+
if (sessions4.has(sessionKey))
|
|
241899
242566
|
throw new Error("Cursor session already has an active turn");
|
|
241900
242567
|
if (!env6.CURSOR_API_KEY)
|
|
241901
242568
|
throw new Error("Cursor is not signed in: add CURSOR_API_KEY to the agent's secrets or the selected computer's environment.");
|
|
@@ -241928,7 +242595,7 @@ async function runCursorTurn(options, env6 = process.env, secrets2 = {}) {
|
|
|
241928
242595
|
let stderr = "";
|
|
241929
242596
|
let requestId = 0;
|
|
241930
242597
|
const pending2 = new Map;
|
|
241931
|
-
const output =
|
|
242598
|
+
const output = createInterface11({ input: running.process.stdout });
|
|
241932
242599
|
running.process.stderr.on("data", (chunk2) => {
|
|
241933
242600
|
stderr = (stderr + chunk2).slice(-8192);
|
|
241934
242601
|
});
|
|
@@ -242012,16 +242679,17 @@ async function runCursorTurn(options, env6 = process.env, secrets2 = {}) {
|
|
|
242012
242679
|
await completion;
|
|
242013
242680
|
}
|
|
242014
242681
|
};
|
|
242015
|
-
|
|
242682
|
+
sessions4.set(sessionKey, active);
|
|
242016
242683
|
const command = {
|
|
242017
242684
|
type: "start",
|
|
242018
242685
|
sessionId: id,
|
|
242019
242686
|
resume: !!options.resumeSessionId,
|
|
242020
|
-
stateDir:
|
|
242687
|
+
stateDir: join72(resolveGlobalConfigDir(), "cursor-sessions", sessionKey),
|
|
242021
242688
|
cwd: options.cwd,
|
|
242022
242689
|
model: options.model,
|
|
242023
242690
|
reminder: options.mcpReminder,
|
|
242024
|
-
prompt: options.prompt
|
|
242691
|
+
prompt: options.prompt,
|
|
242692
|
+
name: options.sessionName
|
|
242025
242693
|
};
|
|
242026
242694
|
running.process.stdin.write(`${JSON.stringify(command)}
|
|
242027
242695
|
`);
|
|
@@ -242035,8 +242703,8 @@ async function runCursorTurn(options, env6 = process.env, secrets2 = {}) {
|
|
|
242035
242703
|
durationMs: Date.now() - startedAt
|
|
242036
242704
|
};
|
|
242037
242705
|
} finally {
|
|
242038
|
-
if (sessionKey && active &&
|
|
242039
|
-
|
|
242706
|
+
if (sessionKey && active && sessions4.get(sessionKey) === active)
|
|
242707
|
+
sessions4.delete(sessionKey);
|
|
242040
242708
|
}
|
|
242041
242709
|
}
|
|
242042
242710
|
async function sendCursorMessage(options, env6 = process.env, secrets2 = {}) {
|
|
@@ -242046,7 +242714,7 @@ async function sendCursorMessage(options, env6 = process.env, secrets2 = {}) {
|
|
|
242046
242714
|
return;
|
|
242047
242715
|
}).then(async () => {
|
|
242048
242716
|
options.signal?.throwIfAborted();
|
|
242049
|
-
const active =
|
|
242717
|
+
const active = sessions4.get(sessionKey);
|
|
242050
242718
|
const tail2 = queued.get(sessionKey);
|
|
242051
242719
|
if ((!tail2 || tail2.started) && active && await active.steer(options.prompt))
|
|
242052
242720
|
return { mode: "steered" };
|
|
@@ -242105,7 +242773,7 @@ async function listCursorModels(cwd2, env6, timeoutMs = 30000) {
|
|
|
242105
242773
|
const running = spawnManagedWorkloadProcess(process.execPath, [resolveCursorWorkerPath()], { cwd: cwd2, env: env6, signal: controller.signal });
|
|
242106
242774
|
let event;
|
|
242107
242775
|
let stderr = "";
|
|
242108
|
-
const output =
|
|
242776
|
+
const output = createInterface11({ input: running.process.stdout });
|
|
242109
242777
|
output.on("line", (line) => {
|
|
242110
242778
|
if (line.startsWith("letta-cursor:"))
|
|
242111
242779
|
event = JSON.parse(line.slice("letta-cursor:".length));
|
|
@@ -242132,14 +242800,14 @@ async function listCursorModels(cwd2, env6, timeoutMs = 30000) {
|
|
|
242132
242800
|
}
|
|
242133
242801
|
throw new Error(controller.signal.aborted ? "Cursor model discovery timed out" : event?.type === "error" ? event.error : `Cursor exited without a model catalog: ${stderr}`);
|
|
242134
242802
|
}
|
|
242135
|
-
var
|
|
242803
|
+
var sessions4, queued, followupControllers, locks, UUID;
|
|
242136
242804
|
var init_cursor_session = __esm(() => {
|
|
242137
242805
|
init_subagent_depth();
|
|
242138
242806
|
init_subagent_process();
|
|
242139
242807
|
init_runtime_context();
|
|
242140
242808
|
init_secret_substitution();
|
|
242141
242809
|
init_settings_path();
|
|
242142
|
-
|
|
242810
|
+
sessions4 = new Map;
|
|
242143
242811
|
queued = new Map;
|
|
242144
242812
|
followupControllers = new Set;
|
|
242145
242813
|
locks = new Map;
|
|
@@ -243115,41 +243783,6 @@ var init_engine = __esm(() => {
|
|
|
243115
243783
|
assertSharedReminderCoverage();
|
|
243116
243784
|
});
|
|
243117
243785
|
|
|
243118
|
-
// src/tools/impl/native-session-owner.ts
|
|
243119
|
-
import { createHash as createHash11 } from "node:crypto";
|
|
243120
|
-
import { mkdirSync as mkdirSync38, readFileSync as readFileSync41, rmSync as rmSync16, writeFileSync as writeFileSync33 } from "node:fs";
|
|
243121
|
-
import { join as join72 } from "node:path";
|
|
243122
|
-
function ownerPath(source, sessionId) {
|
|
243123
|
-
const id = createHash11("sha256").update(`${source}:${sessionId}`).digest("hex");
|
|
243124
|
-
return join72(resolveGlobalConfigDir(), "native-session-owners", `${id}.json`);
|
|
243125
|
-
}
|
|
243126
|
-
function readNativeSessionOwner(source, sessionId) {
|
|
243127
|
-
try {
|
|
243128
|
-
const owner = JSON.parse(readFileSync41(ownerPath(source, sessionId), "utf8"));
|
|
243129
|
-
if (typeof owner.agentId === "string" && typeof owner.conversationId === "string" && (owner.cloudSkillRepositories === undefined || isCloudRepositoryNames(owner.cloudSkillRepositories)))
|
|
243130
|
-
return owner;
|
|
243131
|
-
throw new Error("Invalid native session owner record");
|
|
243132
|
-
} catch (error4) {
|
|
243133
|
-
if (error4.code !== "ENOENT")
|
|
243134
|
-
throw error4;
|
|
243135
|
-
}
|
|
243136
|
-
return;
|
|
243137
|
-
}
|
|
243138
|
-
function persistNativeSessionOwner(source, sessionId, scope) {
|
|
243139
|
-
const path30 = ownerPath(source, sessionId);
|
|
243140
|
-
mkdirSync38(join72(path30, ".."), { recursive: true, mode: 448 });
|
|
243141
|
-
try {
|
|
243142
|
-
writeFileSync33(path30, JSON.stringify(scope), { flag: "wx", mode: 384 });
|
|
243143
|
-
} catch (error4) {
|
|
243144
|
-
if (error4.code !== "EEXIST")
|
|
243145
|
-
throw error4;
|
|
243146
|
-
}
|
|
243147
|
-
}
|
|
243148
|
-
var init_native_session_owner = __esm(() => {
|
|
243149
|
-
init_cloud_repository_roots();
|
|
243150
|
-
init_settings_path();
|
|
243151
|
-
});
|
|
243152
|
-
|
|
243153
243786
|
// src/tools/impl/native-session-capture.ts
|
|
243154
243787
|
import { createHash as createHash12, randomUUID as randomUUID42 } from "node:crypto";
|
|
243155
243788
|
import { readdirSync as readdirSync18, rmSync as rmSync17 } from "node:fs";
|
|
@@ -243939,8 +244572,8 @@ function dispose(session3, error4) {
|
|
|
243939
244572
|
if (session3.stopping)
|
|
243940
244573
|
return session3.stopping;
|
|
243941
244574
|
clearTimeout(session3.idleTimer);
|
|
243942
|
-
if (
|
|
243943
|
-
|
|
244575
|
+
if (sessions5.get(session3.id) === session3)
|
|
244576
|
+
sessions5.delete(session3.id);
|
|
243944
244577
|
session3.stopping = session3.server.close().then(() => {
|
|
243945
244578
|
if (session3.active)
|
|
243946
244579
|
finish(session3, session3.active, {
|
|
@@ -244011,7 +244644,7 @@ async function createSession2(options, env6) {
|
|
|
244011
244644
|
options.signal?.addEventListener("abort", abort, { once: true });
|
|
244012
244645
|
try {
|
|
244013
244646
|
await server2.connect(options.signal);
|
|
244014
|
-
const info = await server2.request(options.resumeSessionId ? `/session/${options.resumeSessionId}` : "/session", options.resumeSessionId ? undefined : {});
|
|
244647
|
+
const info = await server2.request(options.resumeSessionId ? `/session/${options.resumeSessionId}` : "/session", options.resumeSessionId ? undefined : options.sessionName ? { title: options.sessionName } : {});
|
|
244015
244648
|
if (!/^ses_[a-zA-Z0-9]+$/.test(info.id))
|
|
244016
244649
|
throw new Error("OpenCode returned an invalid session ID");
|
|
244017
244650
|
server2.setDirectory(info.directory);
|
|
@@ -244023,7 +244656,7 @@ async function createSession2(options, env6) {
|
|
|
244023
244656
|
lock: Promise.resolve()
|
|
244024
244657
|
};
|
|
244025
244658
|
const stream11 = await server2.events((event) => onEvent(session3, event));
|
|
244026
|
-
|
|
244659
|
+
sessions5.set(session3.id, session3);
|
|
244027
244660
|
stream11.completion.catch((error4) => dispose(session3, message(error4)));
|
|
244028
244661
|
return session3;
|
|
244029
244662
|
} catch (error4) {
|
|
@@ -244037,7 +244670,7 @@ async function getSession(options, env6) {
|
|
|
244037
244670
|
const id = options.resumeSessionId;
|
|
244038
244671
|
if (!id)
|
|
244039
244672
|
return createSession2(options, env6);
|
|
244040
|
-
const loaded =
|
|
244673
|
+
const loaded = sessions5.get(id);
|
|
244041
244674
|
if (loaded)
|
|
244042
244675
|
return loaded;
|
|
244043
244676
|
const pending2 = creations.get(id);
|
|
@@ -244156,11 +244789,11 @@ async function sendOpenCodeMessage(options, env6 = process.env) {
|
|
|
244156
244789
|
};
|
|
244157
244790
|
});
|
|
244158
244791
|
}
|
|
244159
|
-
var
|
|
244792
|
+
var sessions5, creations;
|
|
244160
244793
|
var init_opencode_session = __esm(() => {
|
|
244161
244794
|
init_subagent_depth();
|
|
244162
244795
|
init_opencode_server();
|
|
244163
|
-
|
|
244796
|
+
sessions5 = new Map;
|
|
244164
244797
|
creations = new Map;
|
|
244165
244798
|
});
|
|
244166
244799
|
|
|
@@ -244335,7 +244968,7 @@ async function defaultRunPreflight(executable, args, env6, signal) {
|
|
|
244335
244968
|
function classifyExternalCodingAgentStartupError(error4) {
|
|
244336
244969
|
if (error4.startsWith(MISSING_EXECUTABLE_PREFIX) || error4.startsWith(CODEX_NOT_READY_PREFIX))
|
|
244337
244970
|
return "not_installed";
|
|
244338
|
-
if (error4.startsWith(CLAUDE_NOT_SIGNED_IN_PREFIX) || error4.startsWith(CODEX_NOT_SIGNED_IN_ERROR) || error4.startsWith("Cursor is not signed in:"))
|
|
244971
|
+
if (error4.startsWith(CLAUDE_NOT_SIGNED_IN_PREFIX) || error4.startsWith(CODEX_NOT_SIGNED_IN_ERROR) || error4.startsWith("Cursor is not signed in:") || error4.startsWith("Antigravity is not signed in:"))
|
|
244339
244972
|
return "not_signed_in";
|
|
244340
244973
|
return;
|
|
244341
244974
|
}
|
|
@@ -244463,18 +245096,23 @@ function scrubWorkerListeners(listeners6, secretEnv) {
|
|
|
244463
245096
|
async function runExternalCodingAgent(options, deps = {}) {
|
|
244464
245097
|
const startedAt = Date.now();
|
|
244465
245098
|
const { env: env6, secretEnv, mcpReminder } = await buildExternalWorkerLaunchEnv(options, deps);
|
|
245099
|
+
if (options.type === "antigravity" && env6.GEMINI_API_KEY)
|
|
245100
|
+
secretEnv.GEMINI_API_KEY = env6.GEMINI_API_KEY;
|
|
244466
245101
|
options = {
|
|
244467
245102
|
...options,
|
|
244468
245103
|
...scrubWorkerListeners(options, secretEnv),
|
|
244469
245104
|
mcpReminder
|
|
244470
245105
|
};
|
|
244471
245106
|
const cwd2 = options.cwd ?? getCurrentWorkingDirectory();
|
|
245107
|
+
if (options.type === "antigravity")
|
|
245108
|
+
return runAntigravityTurn({ ...options, cwd: cwd2 }, env6, secretEnv);
|
|
244472
245109
|
const captureActingUserId = options.actingUserId !== undefined ? options.actingUserId : getRuntimeActingUserAttribution();
|
|
244473
245110
|
const scope = options.parentConversationId ? {
|
|
244474
245111
|
agentId: options.parentAgentId,
|
|
244475
245112
|
conversationId: options.parentConversationId,
|
|
244476
245113
|
actingUserId: captureActingUserId,
|
|
244477
|
-
cloudSkillRepositories: options.cloudSkillRepositories
|
|
245114
|
+
cloudSkillRepositories: options.cloudSkillRepositories,
|
|
245115
|
+
...options.description ? { description: options.description } : {}
|
|
244478
245116
|
} : undefined;
|
|
244479
245117
|
const source = options.type === "claude-code" ? "claude_code" : "codex";
|
|
244480
245118
|
let captureReservation;
|
|
@@ -244517,6 +245155,7 @@ async function runExternalCodingAgent(options, deps = {}) {
|
|
|
244517
245155
|
return runOpenCodeTurn({
|
|
244518
245156
|
...options,
|
|
244519
245157
|
cwd: cwd2,
|
|
245158
|
+
sessionName: options.description,
|
|
244520
245159
|
onStarted: (sessionId) => options.onStarted?.(formatExternalCodingAgentId("opencode", sessionId))
|
|
244521
245160
|
}, env6);
|
|
244522
245161
|
}
|
|
@@ -244524,6 +245163,7 @@ async function runExternalCodingAgent(options, deps = {}) {
|
|
|
244524
245163
|
return runCursorTurn({
|
|
244525
245164
|
...options,
|
|
244526
245165
|
cwd: cwd2,
|
|
245166
|
+
sessionName: options.description,
|
|
244527
245167
|
onStarted: (sessionId) => options.onStarted?.(formatExternalCodingAgentId("cursor", sessionId))
|
|
244528
245168
|
}, env6, secretEnv);
|
|
244529
245169
|
}
|
|
@@ -244540,7 +245180,8 @@ async function runExternalCodingAgent(options, deps = {}) {
|
|
|
244540
245180
|
secretValues: Object.values(secretEnv),
|
|
244541
245181
|
parent_agent_id: scope.agentId,
|
|
244542
245182
|
parent_conversation_id: scope.conversationId,
|
|
244543
|
-
task_id: options.taskId ?? randomUUID44()
|
|
245183
|
+
task_id: options.taskId ?? randomUUID44(),
|
|
245184
|
+
task_description: options.description
|
|
244544
245185
|
} : undefined,
|
|
244545
245186
|
prompt: options.prompt,
|
|
244546
245187
|
parentAgentId: options.parentAgentId,
|
|
@@ -244550,6 +245191,7 @@ async function runExternalCodingAgent(options, deps = {}) {
|
|
|
244550
245191
|
mcpReminder: options.mcpReminder,
|
|
244551
245192
|
signal: options.signal,
|
|
244552
245193
|
resumeThreadId: options.resumeSessionId,
|
|
245194
|
+
threadName: options.description,
|
|
244553
245195
|
onToolCall: options.onToolCall,
|
|
244554
245196
|
onText: options.onText,
|
|
244555
245197
|
onToolResult: options.onToolResult,
|
|
@@ -244593,7 +245235,8 @@ async function runExternalCodingAgent(options, deps = {}) {
|
|
|
244593
245235
|
secretValues: Object.values(secretEnv),
|
|
244594
245236
|
parent_agent_id: scope.agentId,
|
|
244595
245237
|
parent_conversation_id: scope.conversationId,
|
|
244596
|
-
task_id: options.taskId ?? randomUUID44()
|
|
245238
|
+
task_id: options.taskId ?? randomUUID44(),
|
|
245239
|
+
task_description: options.description
|
|
244597
245240
|
} : undefined,
|
|
244598
245241
|
prompt: options.prompt,
|
|
244599
245242
|
parentAgentId: options.parentAgentId,
|
|
@@ -244604,6 +245247,7 @@ async function runExternalCodingAgent(options, deps = {}) {
|
|
|
244604
245247
|
signal: options.signal,
|
|
244605
245248
|
resumeSessionId: options.resumeSessionId,
|
|
244606
245249
|
sessionId,
|
|
245250
|
+
sessionName: options.description,
|
|
244607
245251
|
onToolCall: options.onToolCall,
|
|
244608
245252
|
onText: options.onText,
|
|
244609
245253
|
onToolResult: options.onToolResult,
|
|
@@ -244653,18 +245297,21 @@ var init_external_coding_agent = __esm(() => {
|
|
|
244653
245297
|
init_secret_substitution();
|
|
244654
245298
|
init_debug();
|
|
244655
245299
|
init_native_cli_env();
|
|
245300
|
+
init_antigravity_session();
|
|
244656
245301
|
init_claude_stream_session();
|
|
244657
245302
|
init_codex_app_server();
|
|
244658
245303
|
init_cursor_session();
|
|
244659
245304
|
init_native_session_capture();
|
|
244660
245305
|
init_opencode_session();
|
|
244661
245306
|
EXTERNAL_CODING_AGENT_TYPES = [
|
|
245307
|
+
"antigravity",
|
|
244662
245308
|
"claude-code",
|
|
244663
245309
|
"codex",
|
|
244664
245310
|
"opencode",
|
|
244665
245311
|
"cursor"
|
|
244666
245312
|
];
|
|
244667
245313
|
EXTERNAL_AGENT_ID_PREFIXES = {
|
|
245314
|
+
antigravity: "antigravity_",
|
|
244668
245315
|
"claude-code": "claude_",
|
|
244669
245316
|
codex: "codex_",
|
|
244670
245317
|
opencode: "opencode_",
|
|
@@ -244680,15 +245327,8 @@ function deadlineFor(timeoutMs) {
|
|
|
244680
245327
|
function deadlineReached(deadline) {
|
|
244681
245328
|
return deadline !== null && Date.now() >= deadline;
|
|
244682
245329
|
}
|
|
244683
|
-
|
|
244684
|
-
|
|
244685
|
-
while (!signal?.aborted) {
|
|
244686
|
-
const agent = getSnapshot2().agents.find((entry) => entry.id === subagentId);
|
|
244687
|
-
if (!agent || agent.agentURL || agent.conversationId || agent.status === "error" || agent.status === "completed" || deadlineReached(deadline)) {
|
|
244688
|
-
return;
|
|
244689
|
-
}
|
|
244690
|
-
await sleep9(BACKGROUND_STARTUP_POLL_MS);
|
|
244691
|
-
}
|
|
245330
|
+
function waitForBackgroundSubagentLink(subagentId, timeoutMs = null, signal) {
|
|
245331
|
+
return waitForBackgroundSubagentConversationId(subagentId, timeoutMs, signal);
|
|
244692
245332
|
}
|
|
244693
245333
|
async function waitForBackgroundSubagentAgentId(subagentId, timeoutMs = null, signal) {
|
|
244694
245334
|
const deadline = deadlineFor(timeoutMs);
|
|
@@ -245549,6 +246189,7 @@ async function executeSubagent(type, config2, model2, userPrompt, subagentId, is
|
|
|
245549
246189
|
actingUserId: actingUserIdOverride,
|
|
245550
246190
|
transcriptPath,
|
|
245551
246191
|
subagentId,
|
|
246192
|
+
subagentSummary: existingAgentId || existingConversationId ? undefined : getSubagents().find((agent) => agent.id === subagentId)?.description,
|
|
245552
246193
|
subagentName: existingAgentId || existingConversationId ? undefined : allocateSubagentName(parentAgentName)
|
|
245553
246194
|
});
|
|
245554
246195
|
delete childEnv[SUBAGENT_CLOUD_OPTIONS_ENV];
|
|
@@ -245780,7 +246421,6 @@ function spawnSubagent(...args) {
|
|
|
245780
246421
|
}
|
|
245781
246422
|
var NO_BASE_TOOL_SUBAGENT_TYPES;
|
|
245782
246423
|
var init_manager4 = __esm(() => {
|
|
245783
|
-
init_environments3();
|
|
245784
246424
|
init_context();
|
|
245785
246425
|
init_memory_filesystem2();
|
|
245786
246426
|
init_memory_format();
|
|
@@ -245788,6 +246428,7 @@ var init_manager4 = __esm(() => {
|
|
|
245788
246428
|
init_sandbox();
|
|
245789
246429
|
init_org_credentials_session();
|
|
245790
246430
|
init_backend2();
|
|
246431
|
+
init_environments3();
|
|
245791
246432
|
init_app_urls();
|
|
245792
246433
|
init_constants2();
|
|
245793
246434
|
init_cli_permissions_instance();
|
|
@@ -245867,7 +246508,7 @@ async function fetchParentConversationMessages(params) {
|
|
|
245867
246508
|
}
|
|
245868
246509
|
return messages.reverse();
|
|
245869
246510
|
}
|
|
245870
|
-
function
|
|
246511
|
+
function contentText2(content) {
|
|
245871
246512
|
if (typeof content === "string")
|
|
245872
246513
|
return content;
|
|
245873
246514
|
if (!Array.isArray(content))
|
|
@@ -245893,7 +246534,7 @@ function renderToolCall(call) {
|
|
|
245893
246534
|
}
|
|
245894
246535
|
function renderToolResult(result3) {
|
|
245895
246536
|
const raw2 = result3.tool_return ?? result3.func_response;
|
|
245896
|
-
const text2 = typeof raw2 === "string" ? raw2 :
|
|
246537
|
+
const text2 = typeof raw2 === "string" ? raw2 : contentText2(raw2) || (raw2 == null ? "" : JSON.stringify(raw2));
|
|
245897
246538
|
return {
|
|
245898
246539
|
type: "tool_result",
|
|
245899
246540
|
call_id: result3.tool_call_id ?? undefined,
|
|
@@ -245929,11 +246570,11 @@ function userEvents(text2, speaker) {
|
|
|
245929
246570
|
function renderMessage(message2) {
|
|
245930
246571
|
switch (message2.message_type) {
|
|
245931
246572
|
case "user_message": {
|
|
245932
|
-
const text2 =
|
|
246573
|
+
const text2 = contentText2(message2.content).replace(SYSTEM_REMINDER_PATTERN, "").trim();
|
|
245933
246574
|
return userEvents(text2, message2.name ?? undefined);
|
|
245934
246575
|
}
|
|
245935
246576
|
case "assistant_message": {
|
|
245936
|
-
const text2 =
|
|
246577
|
+
const text2 = contentText2(message2.content).trim();
|
|
245937
246578
|
return text2 ? [
|
|
245938
246579
|
{
|
|
245939
246580
|
type: "message",
|
|
@@ -246649,23 +247290,29 @@ var init_remote_connect_retry = __esm(() => {
|
|
|
246649
247290
|
async function resolveExternalWorkerComputer(computer, scope, cloudOptions) {
|
|
246650
247291
|
if (!isCloudEnvironmentSelector(computer))
|
|
246651
247292
|
return resolveEnvironmentConnectionId(computer);
|
|
246652
|
-
const client = await getClient();
|
|
246653
247293
|
const parentConversationId = scope.conversationId && scope.conversationId !== "default" ? scope.conversationId : undefined;
|
|
246654
247294
|
const createParams = {
|
|
246655
247295
|
agent_id: scope.agentId,
|
|
246656
247296
|
hidden: true,
|
|
246657
247297
|
...parentConversationId ? { parent_conversation_id: parentConversationId } : {}
|
|
246658
247298
|
};
|
|
246659
|
-
|
|
246660
|
-
|
|
246661
|
-
|
|
246662
|
-
|
|
246663
|
-
|
|
246664
|
-
|
|
246665
|
-
|
|
247299
|
+
let conversationId;
|
|
247300
|
+
try {
|
|
247301
|
+
const client = await getClient();
|
|
247302
|
+
const conversation = await client.conversations.create(createParams).catch((error4) => {
|
|
247303
|
+
if (!parentConversationId || !error4 || typeof error4 !== "object" || !("status" in error4) || error4.status !== 403) {
|
|
247304
|
+
throw error4;
|
|
247305
|
+
}
|
|
247306
|
+
const fallbackParams = { agent_id: scope.agentId, hidden: true };
|
|
247307
|
+
return client.conversations.create(fallbackParams);
|
|
247308
|
+
});
|
|
247309
|
+
conversationId = conversation.id;
|
|
247310
|
+
} catch (error4) {
|
|
247311
|
+
throw new ComputerResolutionError("cloud_conversation_create_failed", error4 instanceof Error ? error4.message : String(error4), error4);
|
|
247312
|
+
}
|
|
246666
247313
|
return resolveAgentSandboxConnectionId(scope.agentId, {
|
|
246667
247314
|
...cloudOptions,
|
|
246668
|
-
conversationId
|
|
247315
|
+
conversationId
|
|
246669
247316
|
});
|
|
246670
247317
|
}
|
|
246671
247318
|
var init_remote_external_worker_computer = __esm(() => {
|
|
@@ -246798,32 +247445,35 @@ async function defaultConnect(connectionId, scope) {
|
|
|
246798
247445
|
throw error4;
|
|
246799
247446
|
}
|
|
246800
247447
|
}
|
|
246801
|
-
async function resolveQualifiedComputer(deviceId, scope) {
|
|
247448
|
+
async function resolveQualifiedComputer(deviceId, scope, resumeOnly = false) {
|
|
247449
|
+
const prefix = `sandbox-${scope.agentId}-`;
|
|
247450
|
+
const suffix = deviceId.startsWith(prefix) ? deviceId.slice(prefix.length).match(/^(conv-[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})-linux-vm$/i) : null;
|
|
246802
247451
|
let environment;
|
|
246803
247452
|
try {
|
|
246804
247453
|
environment = await getEnvironmentConnection(deviceId);
|
|
246805
|
-
} catch {
|
|
246806
|
-
|
|
246807
|
-
|
|
246808
|
-
|
|
246809
|
-
|
|
246810
|
-
|
|
246811
|
-
|
|
246812
|
-
|
|
246813
|
-
|
|
246814
|
-
|
|
246815
|
-
|
|
246816
|
-
|
|
246817
|
-
|
|
246818
|
-
|
|
246819
|
-
throw new Error(`Computer "${deviceId}" is offline`);
|
|
247454
|
+
} catch (error4) {
|
|
247455
|
+
if (!(resumeOnly && suffix && error4 instanceof ApiRequestError && error4.status === 404))
|
|
247456
|
+
return resolveEnvironmentConnectionId(deviceId);
|
|
247457
|
+
}
|
|
247458
|
+
if (environment && isEnvironmentOnline(environment) && environment.connectionId)
|
|
247459
|
+
return { connectionId: environment.connectionId, environment };
|
|
247460
|
+
if (suffix && (!environment || environment.deviceId === deviceId)) {
|
|
247461
|
+
const resolved = await resolveAgentSandboxConnectionId(scope.agentId, {
|
|
247462
|
+
conversationId: suffix[1],
|
|
247463
|
+
resumeOnly
|
|
247464
|
+
});
|
|
247465
|
+
if (resolved.environment.deviceId !== deviceId)
|
|
247466
|
+
throw new Error("Cloud sandbox device changed while waking worker");
|
|
247467
|
+
return resolved;
|
|
246820
247468
|
}
|
|
246821
|
-
|
|
247469
|
+
throw new Error(`Computer "${deviceId}" is offline`);
|
|
246822
247470
|
}
|
|
246823
247471
|
function errorMessage5(error4) {
|
|
246824
247472
|
return error4 instanceof Error ? error4.message : String(error4);
|
|
246825
247473
|
}
|
|
246826
247474
|
function classifyRemoteExternalWorkerControlError(error4) {
|
|
247475
|
+
if (error4 instanceof WorkerSandboxExpiredError)
|
|
247476
|
+
return "sandbox_expired";
|
|
246827
247477
|
if (error4 instanceof ComputerResolutionError) {
|
|
246828
247478
|
return error4.code === "computer_offline" || error4.code === "computer_not_found" ? error4.code : "other";
|
|
246829
247479
|
}
|
|
@@ -247027,13 +247677,14 @@ class RemoteSubagentFollower {
|
|
|
247027
247677
|
}
|
|
247028
247678
|
async function launchRemoteExternalCodingAgent(params, deps) {
|
|
247029
247679
|
const { type, computer, parentScope } = params;
|
|
247030
|
-
const fail2 = (stage, error4, errorCode) => {
|
|
247680
|
+
const fail2 = (stage, error4, errorCode, httpStatus) => {
|
|
247031
247681
|
reportExternalWorkerLaunchFailure({
|
|
247032
247682
|
stage,
|
|
247033
247683
|
harness: type,
|
|
247034
247684
|
computer: stage === "resolve_computer" ? undefined : computer,
|
|
247035
247685
|
error: error4,
|
|
247036
247686
|
errorCode,
|
|
247687
|
+
httpStatus,
|
|
247037
247688
|
agentId: parentScope.agentId,
|
|
247038
247689
|
conversationId: parentScope.conversationId,
|
|
247039
247690
|
toolCallId: params.toolCallId
|
|
@@ -247062,7 +247713,8 @@ async function launchRemoteExternalCodingAgent(params, deps) {
|
|
|
247062
247713
|
if (outdated)
|
|
247063
247714
|
return fail2("outdated_computer", outdated);
|
|
247064
247715
|
} catch (error4) {
|
|
247065
|
-
|
|
247716
|
+
const resolutionError = error4 instanceof ComputerResolutionError ? error4 : undefined;
|
|
247717
|
+
return fail2("resolve_computer", errorMessage5(error4), resolutionError?.code, resolutionError ? resolutionError.httpStatus ?? null : undefined);
|
|
247066
247718
|
}
|
|
247067
247719
|
params.signal?.throwIfAborted();
|
|
247068
247720
|
const connect = () => (deps.connect ?? defaultConnect)(connectionId, parentScope);
|
|
@@ -247196,17 +247848,17 @@ async function launchRemoteExternalCodingAgent(params, deps) {
|
|
|
247196
247848
|
conversation_id: null
|
|
247197
247849
|
};
|
|
247198
247850
|
}
|
|
247199
|
-
async function connectQualifiedTarget(agentId, parentScope, deps) {
|
|
247851
|
+
async function connectQualifiedTarget(agentId, parentScope, deps, resumeOnly = false) {
|
|
247200
247852
|
const target = parseExternalCodingAgentId(agentId);
|
|
247201
247853
|
if (!target?.computer || target.type === "opencode")
|
|
247202
247854
|
throw new Error(`Invalid remote external coding agent ID: ${agentId}`);
|
|
247203
|
-
const resolved = await (deps.resolveComputer ?? resolveQualifiedComputer)(target.computer, parentScope);
|
|
247855
|
+
const resolved = await (deps.resolveComputer ?? resolveQualifiedComputer)(target.computer, parentScope, resumeOnly);
|
|
247204
247856
|
if (resolved.environment.metadata?.subagent_message !== true)
|
|
247205
247857
|
throw new Error(formatOutdatedSteeringError(target.computer));
|
|
247206
247858
|
return {
|
|
247207
247859
|
target,
|
|
247208
247860
|
lettaCodeVersion: resolved.environment.metadata?.lettaCodeVersion,
|
|
247209
|
-
client: await (deps.connect ?? defaultConnect)(resolved.connectionId, parentScope)
|
|
247861
|
+
client: await connectRemoteWorkerWithRetry(() => (deps.connect ?? defaultConnect)(resolved.connectionId, parentScope))
|
|
247210
247862
|
};
|
|
247211
247863
|
}
|
|
247212
247864
|
async function stopRemoteExternalCodingAgent(params, deps = {}) {
|
|
@@ -247235,6 +247887,8 @@ async function sendRemoteExternalCodingAgentMessage(params, deps = {}) {
|
|
|
247235
247887
|
try {
|
|
247236
247888
|
return await deliverRemoteExternalCodingAgentMessage(params, deps);
|
|
247237
247889
|
} catch (error4) {
|
|
247890
|
+
if (error4 instanceof WorkerSandboxExpiredError)
|
|
247891
|
+
throw error4;
|
|
247238
247892
|
const target = parseExternalCodingAgentId(params.agentId);
|
|
247239
247893
|
reportExternalWorkerLaunchFailure({
|
|
247240
247894
|
stage: error4 instanceof OutdatedRemoteWorkerError ? "outdated_computer" : "follow_up",
|
|
@@ -247251,10 +247905,10 @@ async function sendRemoteExternalCodingAgentMessage(params, deps = {}) {
|
|
|
247251
247905
|
}
|
|
247252
247906
|
async function deliverRemoteExternalCodingAgentMessage(params, deps) {
|
|
247253
247907
|
const requestId = `subagent-message-${randomUUID47()}`;
|
|
247254
|
-
const { target, client, lettaCodeVersion } = await connectQualifiedTarget(params.agentId, params.parentScope, deps);
|
|
247908
|
+
const { target, client, lettaCodeVersion } = await connectQualifiedTarget(params.agentId, params.parentScope, deps, true);
|
|
247255
247909
|
const toolCallId = params.toolCallId ?? `remote-followup-${randomUUID47()}`;
|
|
247256
247910
|
const connect = async () => {
|
|
247257
|
-
const resolved = await (deps.resolveComputer ?? resolveQualifiedComputer)(target.computer, params.parentScope);
|
|
247911
|
+
const resolved = await (deps.resolveComputer ?? resolveQualifiedComputer)(target.computer, params.parentScope, true);
|
|
247258
247912
|
return (deps.connect ?? defaultConnect)(resolved.connectionId, params.parentScope);
|
|
247259
247913
|
};
|
|
247260
247914
|
const follower = new RemoteSubagentFollower(params.parentScope, toolCallId, connect, 2000);
|
|
@@ -247363,6 +248017,7 @@ var init_remote_external_coding_agent = __esm(() => {
|
|
|
247363
248017
|
init_remote_subagent_events();
|
|
247364
248018
|
REMOTE_EXTERNAL_WORKER_STOPPED = Symbol("remote external worker stopped");
|
|
247365
248019
|
DISPLAY_NAMES = {
|
|
248020
|
+
antigravity: "Antigravity",
|
|
247366
248021
|
"claude-code": "Claude Code",
|
|
247367
248022
|
codex: "Codex",
|
|
247368
248023
|
opencode: "OpenCode",
|
|
@@ -247560,6 +248215,7 @@ async function task_stop(args, deps = {}) {
|
|
|
247560
248215
|
return finishPendingWakeCancellation(task);
|
|
247561
248216
|
if (task.status === "running" && task.abortController) {
|
|
247562
248217
|
const initialStop = task.stop;
|
|
248218
|
+
const markStopped = captureSubagentStop(task.subagentId);
|
|
247563
248219
|
const child = getSubagents().find((agent) => agent.id === task.subagentId);
|
|
247564
248220
|
const external3 = parseExternalCodingAgentId(child?.agentId ?? undefined);
|
|
247565
248221
|
let remote;
|
|
@@ -247627,6 +248283,7 @@ async function task_stop(args, deps = {}) {
|
|
|
247627
248283
|
if (!remoteExternalStopped)
|
|
247628
248284
|
throw new Error("Subagent process exit was not confirmed");
|
|
247629
248285
|
task.status = "failed";
|
|
248286
|
+
markStopped();
|
|
247630
248287
|
scheduleBackgroundTaskCleanup(task_id);
|
|
247631
248288
|
return {
|
|
247632
248289
|
killed: true,
|
|
@@ -247656,6 +248313,7 @@ async function task_stop(args, deps = {}) {
|
|
|
247656
248313
|
}
|
|
247657
248314
|
task.status = "failed";
|
|
247658
248315
|
scheduleBackgroundTaskCleanup(task_id);
|
|
248316
|
+
markStopped();
|
|
247659
248317
|
task.cancelPendingWakes = () => runWithRuntimeContext({
|
|
247660
248318
|
...scope,
|
|
247661
248319
|
actingUserId: task.actingUserId ?? undefined,
|
|
@@ -247668,6 +248326,7 @@ async function task_stop(args, deps = {}) {
|
|
|
247668
248326
|
}
|
|
247669
248327
|
task.status = "failed";
|
|
247670
248328
|
scheduleBackgroundTaskCleanup(task_id);
|
|
248329
|
+
markStopped();
|
|
247671
248330
|
return remote ?? { killed: true };
|
|
247672
248331
|
}
|
|
247673
248332
|
return { killed: false };
|
|
@@ -247858,15 +248517,22 @@ var init_Task2 = __esm(() => {
|
|
|
247858
248517
|
properties: {
|
|
247859
248518
|
description: {
|
|
247860
248519
|
type: "string",
|
|
247861
|
-
description:
|
|
248520
|
+
description: `The task this agent owns, in a few words, like a conversation title (for example "Fix websocket reconnect hang"). Saved as the new conversation's summary.`
|
|
247862
248521
|
},
|
|
247863
248522
|
prompt: {
|
|
247864
248523
|
type: "string",
|
|
247865
|
-
description: 'The task for the agent to perform. A forked agent already has this conversation: state the goal, what finished looks like as checks the agent can verify (a measurable threshold, not "no bad output"), and paths, links, or IDs to read. Without forked context, the prompt is all it knows.'
|
|
248524
|
+
description: 'The task for the agent to perform. A forked agent already has this conversation: state the goal, what finished looks like as checks the agent can verify (a measurable threshold, not "no bad output"), and paths, links, or IDs to read. Optional when forking, in which case the description is the assignment. Without forked context, the prompt is all it knows.'
|
|
247866
248525
|
},
|
|
247867
248526
|
harness: {
|
|
247868
248527
|
type: "string",
|
|
247869
|
-
enum: [
|
|
248528
|
+
enum: [
|
|
248529
|
+
"letta",
|
|
248530
|
+
"claude-code",
|
|
248531
|
+
"codex",
|
|
248532
|
+
"cursor",
|
|
248533
|
+
"opencode",
|
|
248534
|
+
"antigravity"
|
|
248535
|
+
],
|
|
247870
248536
|
description: "The harness that executes the task. Defaults to letta (a Letta subagent). Set to override the harness that runs the subagent worker (requires the harness to be installed on the computer)."
|
|
247871
248537
|
},
|
|
247872
248538
|
subagent_type: {
|
|
@@ -247932,7 +248598,7 @@ var init_Task2 = __esm(() => {
|
|
|
247932
248598
|
additionalProperties: false
|
|
247933
248599
|
}
|
|
247934
248600
|
},
|
|
247935
|
-
required: ["description"
|
|
248601
|
+
required: ["description"],
|
|
247936
248602
|
additionalProperties: false,
|
|
247937
248603
|
$schema: "http://json-schema.org/draft-07/schema#"
|
|
247938
248604
|
};
|
|
@@ -247985,6 +248651,36 @@ var init_task_cloud_options = __esm(() => {
|
|
|
247985
248651
|
repositoryPattern = new RegExp(Task_default2.properties.cloud.properties.repositories.items.pattern);
|
|
247986
248652
|
});
|
|
247987
248653
|
|
|
248654
|
+
// src/tools/impl/task-summary.ts
|
|
248655
|
+
function recordTaskSummary(conversationId, description, backend3) {
|
|
248656
|
+
const summary = description.trim();
|
|
248657
|
+
if (!conversationId || conversationId === "default" || !summary) {
|
|
248658
|
+
return Promise.resolve();
|
|
248659
|
+
}
|
|
248660
|
+
return Promise.resolve().then(() => (backend3 ?? getBackend()).updateConversation(conversationId, { summary })).then(() => {
|
|
248661
|
+
return;
|
|
248662
|
+
}).catch(() => {
|
|
248663
|
+
return;
|
|
248664
|
+
});
|
|
248665
|
+
}
|
|
248666
|
+
function resolveTaskInput(args, forked) {
|
|
248667
|
+
const { prompt, description } = args;
|
|
248668
|
+
if (typeof description !== "string" || !description.trim()) {
|
|
248669
|
+
return { error: "description is required" };
|
|
248670
|
+
}
|
|
248671
|
+
if (typeof prompt === "string" && prompt.trim()) {
|
|
248672
|
+
return { description, prompt };
|
|
248673
|
+
}
|
|
248674
|
+
if (forked)
|
|
248675
|
+
return { description, prompt: description };
|
|
248676
|
+
return {
|
|
248677
|
+
error: "prompt is required unless the agent forks this conversation (fork_context)"
|
|
248678
|
+
};
|
|
248679
|
+
}
|
|
248680
|
+
var init_task_summary = __esm(() => {
|
|
248681
|
+
init_backend2();
|
|
248682
|
+
});
|
|
248683
|
+
|
|
247988
248684
|
// src/tools/impl/task.ts
|
|
247989
248685
|
var exports_task = {};
|
|
247990
248686
|
__export(exports_task, {
|
|
@@ -248073,6 +248769,8 @@ function spawnBackgroundSubagentTask(args) {
|
|
|
248073
248769
|
openTaskProgressLog(subagentId, outputFile, resolvedParentScope?.agentId);
|
|
248074
248770
|
if (publishResult)
|
|
248075
248771
|
serveTaskEvents(subagentId);
|
|
248772
|
+
if (args.observePersistedState)
|
|
248773
|
+
observeSubagentState(subagentId, args.observePersistedState());
|
|
248076
248774
|
const parentAgentIdForSpawn = resolvedParentScope?.agentId;
|
|
248077
248775
|
const workerMemoryDir = subagentType === "memory" && resolvedParentScope ? memoryScope?.primaryRoot ?? getScopedMemoryFilesystemRoot(resolvedParentScope.agentId) : undefined;
|
|
248078
248776
|
const effectiveMemoryScope = memoryScope ?? (workerMemoryDir ? { primaryRoot: workerMemoryDir, writableRoots: [workerMemoryDir] } : undefined);
|
|
@@ -248113,7 +248811,10 @@ function spawnBackgroundSubagentTask(args) {
|
|
|
248113
248811
|
...publishResult && result3.success ? {
|
|
248114
248812
|
result: truncateByChars(result3.report || "", LIMITS.TASK_OUTPUT_CHARS, "Task", { workingDirectory: getCurrentWorkingDirectory() }).content
|
|
248115
248813
|
} : {}
|
|
248116
|
-
}
|
|
248814
|
+
}, args.observePersistedState ? {
|
|
248815
|
+
agentId: result3.agentId || existingAgentId,
|
|
248816
|
+
conversationId: result3.conversationId || existingConversationId
|
|
248817
|
+
} : undefined);
|
|
248117
248818
|
try {
|
|
248118
248819
|
await onComplete?.({
|
|
248119
248820
|
success: result3.success,
|
|
@@ -248275,9 +248976,10 @@ async function launchSubagent(args, cloudSkillRepositories) {
|
|
|
248275
248976
|
const mcpValidationError = validateExternalCodingAgentMcpOptions(args.mcp);
|
|
248276
248977
|
if (mcpValidationError)
|
|
248277
248978
|
return { success: false, error: mcpValidationError };
|
|
248278
|
-
|
|
248279
|
-
|
|
248280
|
-
|
|
248979
|
+
const input = resolveTaskInput(args, shouldForkTaskContext(args));
|
|
248980
|
+
if ("error" in input)
|
|
248981
|
+
return { success: false, error: input.error };
|
|
248982
|
+
const { description, prompt: inputPrompt } = input;
|
|
248281
248983
|
const allConfigs = prepared || isExternalCodingAgent ? {} : await getAllSubagentConfigs(getCurrentWorkingDirectory());
|
|
248282
248984
|
const config2 = isExternalCodingAgent ? createExternalCodingAgentConfig(externalCodingAgentType, shouldForkTaskContext(args)) : prepared ? preparedConversationConfig() : allConfigs[configName];
|
|
248283
248985
|
if (!config2) {
|
|
@@ -248306,9 +249008,10 @@ async function launchSubagent(args, cloudSkillRepositories) {
|
|
|
248306
249008
|
if (resolvedComputer.error) {
|
|
248307
249009
|
return { success: false, error: resolvedComputer.error };
|
|
248308
249010
|
}
|
|
248309
|
-
const cloud = parseTaskCloudOptions(
|
|
249011
|
+
const cloud = parseTaskCloudOptions(resolvedComputer.computer, args.cloud);
|
|
248310
249012
|
if ("error" in cloud)
|
|
248311
249013
|
return { success: false, error: cloud.error };
|
|
249014
|
+
const observePersistedState = args.notifyCaller ? undefined : createLaunchSubagentObserver(resolvedParentScope, args, description, inputPrompt, externalCodingAgentType ?? "letta", Boolean(config2.fork), resolvedComputer.computer, cloud.options);
|
|
248312
249015
|
let effectiveAgentId = args.agent_id;
|
|
248313
249016
|
let effectiveConversationId = args.conversation_id;
|
|
248314
249017
|
const callerNotification = args.notifyCaller ? {
|
|
@@ -248341,7 +249044,9 @@ async function launchSubagent(args, cloudSkillRepositories) {
|
|
|
248341
249044
|
agentId: parentAgentId
|
|
248342
249045
|
},
|
|
248343
249046
|
signal
|
|
248344
|
-
}, {
|
|
249047
|
+
}, {
|
|
249048
|
+
spawn: (task) => spawnBackgroundSubagentTask({ ...task, observePersistedState })
|
|
249049
|
+
});
|
|
248345
249050
|
}
|
|
248346
249051
|
const worker = await prepareExternalWorkerPrompt({
|
|
248347
249052
|
prompt: inputPrompt,
|
|
@@ -248364,6 +249069,7 @@ async function launchSubagent(args, cloudSkillRepositories) {
|
|
|
248364
249069
|
const { taskId: taskId2, outputFile: outputFile2, subagentId: subagentId2 } = spawnBackgroundSubagentTask({
|
|
248365
249070
|
subagentType: configName,
|
|
248366
249071
|
config: config2,
|
|
249072
|
+
observePersistedState,
|
|
248367
249073
|
prompt: worker.prompt,
|
|
248368
249074
|
description,
|
|
248369
249075
|
model: model2,
|
|
@@ -248371,10 +249077,11 @@ async function launchSubagent(args, cloudSkillRepositories) {
|
|
|
248371
249077
|
parentScope: resolvedParentScope,
|
|
248372
249078
|
...callerNotification,
|
|
248373
249079
|
deps: {
|
|
248374
|
-
spawnSubagentImpl: async (_type,
|
|
249080
|
+
spawnSubagentImpl: async (_type, prompt, model3, workerSubagentId, childSignal) => runExternalCodingAgent({
|
|
248375
249081
|
type: externalCodingAgentType,
|
|
248376
249082
|
taskId: [...backgroundTasks].find(([, task]) => task.subagentId === workerSubagentId)?.[0],
|
|
248377
|
-
prompt
|
|
249083
|
+
prompt,
|
|
249084
|
+
description,
|
|
248378
249085
|
model: model3,
|
|
248379
249086
|
parentAgentId,
|
|
248380
249087
|
parentConversationId: resolvedParentScope?.conversationId,
|
|
@@ -248457,15 +249164,15 @@ async function launchSubagent(args, cloudSkillRepositories) {
|
|
|
248457
249164
|
};
|
|
248458
249165
|
}
|
|
248459
249166
|
}
|
|
248460
|
-
const prompt = inputPrompt;
|
|
248461
249167
|
signal?.throwIfAborted();
|
|
248462
249168
|
const { taskId, outputFile, subagentId } = spawnBackgroundSubagentTask({
|
|
248463
249169
|
subagentType: configName,
|
|
248464
249170
|
config: config2,
|
|
248465
|
-
prompt,
|
|
249171
|
+
prompt: inputPrompt,
|
|
248466
249172
|
description,
|
|
248467
249173
|
model: model2,
|
|
248468
249174
|
toolCallId,
|
|
249175
|
+
observePersistedState,
|
|
248469
249176
|
existingAgentId: effectiveAgentId,
|
|
248470
249177
|
existingConversationId: effectiveConversationId,
|
|
248471
249178
|
maxTurns: args.max_turns,
|
|
@@ -248478,10 +249185,11 @@ async function launchSubagent(args, cloudSkillRepositories) {
|
|
|
248478
249185
|
});
|
|
248479
249186
|
const abortStartup = () => backgroundTasks.get(taskId)?.abortController?.abort(signal?.reason);
|
|
248480
249187
|
signal?.addEventListener("abort", abortStartup, { once: true });
|
|
249188
|
+
let linkedConversationId;
|
|
248481
249189
|
try {
|
|
248482
249190
|
if (signal?.aborted)
|
|
248483
249191
|
abortStartup();
|
|
248484
|
-
await waitForBackgroundSubagentLink(subagentId, null, signal);
|
|
249192
|
+
linkedConversationId = await waitForBackgroundSubagentLink(subagentId, null, signal);
|
|
248485
249193
|
signal?.throwIfAborted();
|
|
248486
249194
|
} finally {
|
|
248487
249195
|
signal?.removeEventListener("abort", abortStartup);
|
|
@@ -248493,12 +249201,15 @@ async function launchSubagent(args, cloudSkillRepositories) {
|
|
|
248493
249201
|
error: backgroundTasks.get(taskId)?.error ?? "Subagent launch failed"
|
|
248494
249202
|
};
|
|
248495
249203
|
}
|
|
249204
|
+
const conversationId = linkedConversationId ?? linkedAgent?.conversationId ?? effectiveConversationId ?? null;
|
|
249205
|
+
if (!isDeployingExisting)
|
|
249206
|
+
recordTaskSummary(conversationId, description);
|
|
248496
249207
|
return {
|
|
248497
249208
|
success: true,
|
|
248498
249209
|
task_id: taskId,
|
|
248499
249210
|
output_file: outputFile,
|
|
248500
249211
|
agent_id: linkedAgent?.agentId ?? effectiveAgentId ?? null,
|
|
248501
|
-
conversation_id:
|
|
249212
|
+
conversation_id: conversationId
|
|
248502
249213
|
};
|
|
248503
249214
|
}
|
|
248504
249215
|
async function task(args) {
|
|
@@ -248547,9 +249258,11 @@ var init_task = __esm(() => {
|
|
|
248547
249258
|
init_process_manager();
|
|
248548
249259
|
init_remote_external_coding_agent();
|
|
248549
249260
|
init_subagent_computer();
|
|
249261
|
+
init_subagent_persistence();
|
|
248550
249262
|
init_task_abort_hook();
|
|
248551
249263
|
init_task_agent_selection();
|
|
248552
249264
|
init_task_cloud_options();
|
|
249265
|
+
init_task_summary();
|
|
248553
249266
|
init_task_transcript();
|
|
248554
249267
|
init_truncation();
|
|
248555
249268
|
init_background_link();
|
|
@@ -248558,6 +249271,15 @@ var init_task = __esm(() => {
|
|
|
248558
249271
|
// src/tools/impl/external-coding-agent-task.ts
|
|
248559
249272
|
function trackExternalFollowupCompletion(args) {
|
|
248560
249273
|
return spawnBackgroundSubagentTask({
|
|
249274
|
+
observePersistedState: args.publishResult ? undefined : () => {
|
|
249275
|
+
const writer = resumeSubagentWriter(args.parentScope.conversationId, { worker_session_id: args.agentId }, args.parentScope.actingUserId === undefined ? getRuntimeActingUserAttribution() : args.parentScope.actingUserId);
|
|
249276
|
+
let stopped = false;
|
|
249277
|
+
return (state2) => {
|
|
249278
|
+
const status = stopped ? "stopped" : persistedSubagentStatus(state2);
|
|
249279
|
+
stopped = status === "stopped";
|
|
249280
|
+
writer?.update({ status, worker_session_id: args.agentId });
|
|
249281
|
+
};
|
|
249282
|
+
},
|
|
248561
249283
|
taskId: args.taskId,
|
|
248562
249284
|
subagentType: args.type,
|
|
248563
249285
|
config: createExternalCodingAgentConfig(args.type),
|
|
@@ -248612,10 +249334,12 @@ function trackExternalFollowupCompletion(args) {
|
|
|
248612
249334
|
});
|
|
248613
249335
|
}
|
|
248614
249336
|
var init_external_coding_agent_task = __esm(() => {
|
|
249337
|
+
init_subagents3();
|
|
248615
249338
|
init_runtime_context();
|
|
248616
249339
|
init_external_coding_agent();
|
|
248617
249340
|
init_native_session_capture();
|
|
248618
249341
|
init_process_manager();
|
|
249342
|
+
init_subagent_persistence();
|
|
248619
249343
|
init_task();
|
|
248620
249344
|
init_task_transcript();
|
|
248621
249345
|
});
|
|
@@ -248704,6 +249428,8 @@ async function send_agent_message(args, deps = {}) {
|
|
|
248704
249428
|
}
|
|
248705
249429
|
args.signal?.throwIfAborted();
|
|
248706
249430
|
const parentScope = sender;
|
|
249431
|
+
const steerActingUserId = getRuntimeActingUserAttribution();
|
|
249432
|
+
const recordSteer = () => resumeSubagentWriter(parentScope.conversationId, { worker_session_id: args.agent_id }, steerActingUserId);
|
|
248707
249433
|
if (externalTarget.computer) {
|
|
248708
249434
|
const receipt3 = await (deps.sendRemoteExternalMessage ?? sendRemoteExternalCodingAgentMessage)({
|
|
248709
249435
|
agentId: args.agent_id,
|
|
@@ -248715,6 +249441,8 @@ async function send_agent_message(args, deps = {}) {
|
|
|
248715
249441
|
}, {
|
|
248716
249442
|
track: deps.trackExternalFollowup ?? trackExternalFollowupCompletion
|
|
248717
249443
|
});
|
|
249444
|
+
if (receipt3.delivery !== "resumed")
|
|
249445
|
+
recordSteer();
|
|
248718
249446
|
return {
|
|
248719
249447
|
content: JSON.stringify({
|
|
248720
249448
|
status: "accepted",
|
|
@@ -248727,7 +249455,7 @@ async function send_agent_message(args, deps = {}) {
|
|
|
248727
249455
|
status: "success"
|
|
248728
249456
|
};
|
|
248729
249457
|
}
|
|
248730
|
-
if (externalTarget.type === "opencode" || externalTarget.type === "cursor") {
|
|
249458
|
+
if (externalTarget.type === "antigravity" || externalTarget.type === "opencode" || externalTarget.type === "cursor") {
|
|
248731
249459
|
const messageOptions = {
|
|
248732
249460
|
sessionId: externalTarget.sessionId,
|
|
248733
249461
|
prompt: args.message,
|
|
@@ -248736,13 +249464,22 @@ async function send_agent_message(args, deps = {}) {
|
|
|
248736
249464
|
signal: args.signal
|
|
248737
249465
|
};
|
|
248738
249466
|
const secrets2 = externalTarget.type === "cursor" ? await resolveExternalCodingAgentSecretEnv(parentScope.agentId) : {};
|
|
248739
|
-
const
|
|
249467
|
+
const worker2 = externalTarget.type === "antigravity" ? await buildExternalWorkerResumeEnv({
|
|
249468
|
+
parentAgentId: parentScope.agentId,
|
|
249469
|
+
actingUserId: getRuntimeActingUserAttribution()
|
|
249470
|
+
}, deps.workerEnv) : undefined;
|
|
249471
|
+
const receipt3 = worker2 ? sendAntigravityMessage({
|
|
249472
|
+
...messageOptions,
|
|
249473
|
+
resumeSessionId: externalTarget.sessionId,
|
|
249474
|
+
mcpReminder: worker2.mcpReminder
|
|
249475
|
+
}, worker2.env, worker2.secretEnv) : externalTarget.type === "cursor" ? await sendCursorMessage(messageOptions, { ...process.env, ...secrets2 }, secrets2) : await sendOpenCodeMessage(messageOptions);
|
|
248740
249476
|
if (receipt3.mode === "steered") {
|
|
249477
|
+
recordSteer();
|
|
248741
249478
|
return {
|
|
248742
249479
|
content: JSON.stringify({
|
|
248743
249480
|
status: "accepted",
|
|
248744
249481
|
agent_id: args.agent_id,
|
|
248745
|
-
delivery: externalTarget.type === "cursor" ? "run/steer" : "session/abort+prompt"
|
|
249482
|
+
delivery: externalTarget.type === "antigravity" ? "queued" : externalTarget.type === "cursor" ? "run/steer" : "session/abort+prompt"
|
|
248746
249483
|
}),
|
|
248747
249484
|
status: "success"
|
|
248748
249485
|
};
|
|
@@ -248811,6 +249548,7 @@ async function send_agent_message(args, deps = {}) {
|
|
|
248811
249548
|
throw error4;
|
|
248812
249549
|
}
|
|
248813
249550
|
if (receipt3.mode === "steered") {
|
|
249551
|
+
recordSteer();
|
|
248814
249552
|
return {
|
|
248815
249553
|
content: JSON.stringify({
|
|
248816
249554
|
status: "accepted",
|
|
@@ -248882,6 +249620,7 @@ async function send_agent_message(args, deps = {}) {
|
|
|
248882
249620
|
throw error4;
|
|
248883
249621
|
}
|
|
248884
249622
|
if (receipt2.mode === "steered") {
|
|
249623
|
+
recordSteer();
|
|
248885
249624
|
return {
|
|
248886
249625
|
content: JSON.stringify({
|
|
248887
249626
|
status: "accepted",
|
|
@@ -248975,16 +249714,20 @@ async function send_agent_message(args, deps = {}) {
|
|
|
248975
249714
|
actingUserId
|
|
248976
249715
|
}, signal);
|
|
248977
249716
|
const child = receipt.agent_id ? await resolveChildSubagent(backend3, receipt.agent_id, sender.agentId) : null;
|
|
249717
|
+
const persistRun = resumeSubagentWriter(sender.conversationId, { conversation_id: receipt.conversation_id }, actingUserId);
|
|
248978
249718
|
if (child) {
|
|
248979
249719
|
(deps.trackChildSend ?? trackChildSend)({
|
|
248980
249720
|
receipt,
|
|
248981
249721
|
child,
|
|
249722
|
+
...persistRun && { persistRun: persistRun.update },
|
|
248982
249723
|
prompt: args.message,
|
|
248983
249724
|
parentScope: {
|
|
248984
249725
|
agentId: sender.agentId,
|
|
248985
249726
|
conversationId: sender.conversationId
|
|
248986
249727
|
}
|
|
248987
249728
|
});
|
|
249729
|
+
} else if (persistRun) {
|
|
249730
|
+
trackPersistedChildSend(receipt, persistRun);
|
|
248988
249731
|
}
|
|
248989
249732
|
return {
|
|
248990
249733
|
content: JSON.stringify({
|
|
@@ -249024,9 +249767,11 @@ var init_send_agent_message = __esm(() => {
|
|
|
249024
249767
|
init_agent_message();
|
|
249025
249768
|
init_conversation_enqueue();
|
|
249026
249769
|
init_request();
|
|
249770
|
+
init_subagents3();
|
|
249027
249771
|
init_runtime_context();
|
|
249028
249772
|
init_runtime_execution_settings();
|
|
249029
249773
|
init_debug();
|
|
249774
|
+
init_antigravity_session();
|
|
249030
249775
|
init_claude_stream_session();
|
|
249031
249776
|
init_codex_app_server();
|
|
249032
249777
|
init_cursor_session();
|
|
@@ -253425,6 +254170,27 @@ function buildBashDescriptionForPlatform(platform9 = process.platform) {
|
|
|
253425
254170
|
|
|
253426
254171
|
${WINDOWS_BASH_EXECUTION_GUIDANCE}` : baseDescription;
|
|
253427
254172
|
}
|
|
254173
|
+
function buildTaskSchema(env6 = process.env) {
|
|
254174
|
+
const { computer } = resolveSubagentComputer({
|
|
254175
|
+
requested: undefined,
|
|
254176
|
+
subagentType: "general-purpose",
|
|
254177
|
+
config: { fork: false, launchProfile: "default" },
|
|
254178
|
+
env: env6
|
|
254179
|
+
});
|
|
254180
|
+
if (!computer)
|
|
254181
|
+
return Task_default2;
|
|
254182
|
+
const destination = computer.toLowerCase() === "cloud" ? "a fresh Cloud sandbox, where this machine's files are unavailable" : `the connected computer ${JSON.stringify(computer)}; unless that is this machine, this machine's files are unavailable there`;
|
|
254183
|
+
return {
|
|
254184
|
+
...Task_default2,
|
|
254185
|
+
properties: {
|
|
254186
|
+
...Task_default2.properties,
|
|
254187
|
+
computer: {
|
|
254188
|
+
...Task_default2.properties.computer,
|
|
254189
|
+
description: `Omitting computer sends subagents to ${destination}. memory and recall subagents always stay on this machine. Pass "local" to stay on this machine, "cloud" for a fresh Cloud sandbox, or a connected computer ID or name. Prefer a stable device ID or computer name; ephemeral connection IDs are also supported to pin a specific listener. Fails fast if the device is offline or does not support routing.`
|
|
254190
|
+
}
|
|
254191
|
+
}
|
|
254192
|
+
};
|
|
254193
|
+
}
|
|
253428
254194
|
function execCommandDescription() {
|
|
253429
254195
|
const baseDescription = applyCommitTrailer(ExecCommand_default.trim());
|
|
253430
254196
|
return process.platform === "win32" ? `${baseDescription}
|
|
@@ -253447,6 +254213,7 @@ var init_tool_definitions = __esm(() => {
|
|
|
253447
254213
|
init_ExitWorktree();
|
|
253448
254214
|
init_Glob();
|
|
253449
254215
|
init_Grep();
|
|
254216
|
+
init_ListAgents();
|
|
253450
254217
|
init_LS();
|
|
253451
254218
|
init_Memory();
|
|
253452
254219
|
init_Monitor();
|
|
@@ -253481,6 +254248,7 @@ var init_tool_definitions = __esm(() => {
|
|
|
253481
254248
|
init_exit_worktree();
|
|
253482
254249
|
init_glob();
|
|
253483
254250
|
init_grep();
|
|
254251
|
+
init_list_agents();
|
|
253484
254252
|
init_ls();
|
|
253485
254253
|
init_memory4();
|
|
253486
254254
|
init_monitor();
|
|
@@ -253490,6 +254258,7 @@ var init_tool_definitions = __esm(() => {
|
|
|
253490
254258
|
init_send_agent_message();
|
|
253491
254259
|
init_set_working_directory();
|
|
253492
254260
|
init_skill();
|
|
254261
|
+
init_subagent_computer();
|
|
253493
254262
|
init_task();
|
|
253494
254263
|
init_task_create();
|
|
253495
254264
|
init_task_get();
|
|
@@ -253511,6 +254280,7 @@ var init_tool_definitions = __esm(() => {
|
|
|
253511
254280
|
init_ExitWorktree2();
|
|
253512
254281
|
init_Glob2();
|
|
253513
254282
|
init_Grep2();
|
|
254283
|
+
init_ListAgents2();
|
|
253514
254284
|
init_LS2();
|
|
253515
254285
|
init_Memory2();
|
|
253516
254286
|
init_Monitor2();
|
|
@@ -253620,6 +254390,11 @@ ${WINDOWS_UNIFIED_EXEC_GUIDANCE}`;
|
|
|
253620
254390
|
description: ReadLSP_default.trim(),
|
|
253621
254391
|
impl: read_lsp
|
|
253622
254392
|
}),
|
|
254393
|
+
ListAgents: defineTool({
|
|
254394
|
+
schema: ListAgents_default2,
|
|
254395
|
+
description: ListAgents_default.trim(),
|
|
254396
|
+
impl: list_agents
|
|
254397
|
+
}),
|
|
253623
254398
|
SendAgentMessage: defineTool({
|
|
253624
254399
|
schema: SendAgentMessage_default2,
|
|
253625
254400
|
description: SendAgentMessage_default.trim(),
|
|
@@ -253641,7 +254416,7 @@ ${WINDOWS_UNIFIED_EXEC_GUIDANCE}`;
|
|
|
253641
254416
|
impl: skill
|
|
253642
254417
|
}),
|
|
253643
254418
|
Task: defineTool({
|
|
253644
|
-
schema:
|
|
254419
|
+
schema: buildTaskSchema(),
|
|
253645
254420
|
description: Task_default.trim(),
|
|
253646
254421
|
impl: task
|
|
253647
254422
|
}),
|
|
@@ -264271,7 +265046,8 @@ function toExternalToolDefinition(listener, tool, connectionId, runtimeScope) {
|
|
|
264271
265046
|
}
|
|
264272
265047
|
};
|
|
264273
265048
|
return enableListenerExternalToolBackground(toolDefinition, {
|
|
264274
|
-
createNotificationGuard: () => captureExternalToolNotificationGuard(listener, runtimeScope)
|
|
265049
|
+
createNotificationGuard: () => captureExternalToolNotificationGuard(listener, runtimeScope),
|
|
265050
|
+
...tool.foreground_yield_ms !== undefined ? { yieldMs: clampForegroundYieldMs(tool.foreground_yield_ms) } : {}
|
|
264275
265051
|
});
|
|
264276
265052
|
}
|
|
264277
265053
|
function installExternalToolBridge(runtime, options) {
|
|
@@ -264557,6 +265333,7 @@ function rejectPendingExternalToolCalls(runtime, reason) {
|
|
|
264557
265333
|
var EXTERNAL_TOOL_CALL_TIMEOUT_MS, registeredToolsByRuntime, lastSubmittingConnectionByRuntime, nextRegistrationSequence = 0, connectionIdByRegistrationKey;
|
|
264558
265334
|
var init_external_tools = __esm(() => {
|
|
264559
265335
|
init_external_tool_background_eligibility();
|
|
265336
|
+
init_foreground_yield();
|
|
264560
265337
|
init_manager2();
|
|
264561
265338
|
init_debug();
|
|
264562
265339
|
init_connection();
|
|
@@ -447655,12 +448432,12 @@ function rowToolCalls(row, index, diagnostics2) {
|
|
|
447655
448432
|
}
|
|
447656
448433
|
return calls;
|
|
447657
448434
|
}
|
|
447658
|
-
function
|
|
448435
|
+
function contentText3(content) {
|
|
447659
448436
|
if (typeof content === "string") {
|
|
447660
448437
|
if (content.startsWith(CONTENT_JSON_PREFIX)) {
|
|
447661
448438
|
const encoded = content.slice(CONTENT_JSON_PREFIX.length);
|
|
447662
448439
|
try {
|
|
447663
|
-
return
|
|
448440
|
+
return contentText3(JSON.parse(encoded));
|
|
447664
448441
|
} catch {
|
|
447665
448442
|
return encoded;
|
|
447666
448443
|
}
|
|
@@ -447746,7 +448523,7 @@ var init_hermes = __esm(() => {
|
|
|
447746
448523
|
});
|
|
447747
448524
|
};
|
|
447748
448525
|
if (row.role === "user") {
|
|
447749
|
-
const content =
|
|
448526
|
+
const content = contentText3(row.content);
|
|
447750
448527
|
if (content) {
|
|
447751
448528
|
emit({
|
|
447752
448529
|
type: "message",
|
|
@@ -447766,7 +448543,7 @@ var init_hermes = __esm(() => {
|
|
|
447766
448543
|
...timestamp ? { timestamp } : {}
|
|
447767
448544
|
});
|
|
447768
448545
|
}
|
|
447769
|
-
const content =
|
|
448546
|
+
const content = contentText3(row.content);
|
|
447770
448547
|
if (content) {
|
|
447771
448548
|
emit({
|
|
447772
448549
|
type: "message",
|
|
@@ -447789,7 +448566,7 @@ var init_hermes = __esm(() => {
|
|
|
447789
448566
|
if (row.role === "tool") {
|
|
447790
448567
|
emit({
|
|
447791
448568
|
type: "tool_result",
|
|
447792
|
-
content:
|
|
448569
|
+
content: contentText3(row.content),
|
|
447793
448570
|
...typeof row.tool_call_id === "string" && row.tool_call_id ? { callId: row.tool_call_id } : {},
|
|
447794
448571
|
...timestamp ? { timestamp } : {}
|
|
447795
448572
|
});
|
|
@@ -456014,7 +456791,7 @@ function isRuntimeScope2(value) {
|
|
|
456014
456791
|
function isExternalToolDefinitionPayload(value) {
|
|
456015
456792
|
if (!isRecord18(value))
|
|
456016
456793
|
return false;
|
|
456017
|
-
return typeof value.name === "string" && (value.label === undefined || typeof value.label === "string") && typeof value.description === "string" && isRecord18(value.parameters) && (value.auto_background === undefined || typeof value.auto_background === "boolean") && (value.timeout_ms === undefined || typeof value.timeout_ms === "number" && Number.isSafeInteger(value.timeout_ms) && value.timeout_ms >= 1000 && value.timeout_ms <= 300000);
|
|
456794
|
+
return typeof value.name === "string" && (value.label === undefined || typeof value.label === "string") && typeof value.description === "string" && isRecord18(value.parameters) && (value.auto_background === undefined || typeof value.auto_background === "boolean") && (value.foreground_yield_ms === undefined || typeof value.foreground_yield_ms === "number" && Number.isFinite(value.foreground_yield_ms) && value.foreground_yield_ms > 0) && (value.timeout_ms === undefined || typeof value.timeout_ms === "number" && Number.isSafeInteger(value.timeout_ms) && value.timeout_ms >= 1000 && value.timeout_ms <= 300000);
|
|
456018
456795
|
}
|
|
456019
456796
|
function isStringList(value) {
|
|
456020
456797
|
return Array.isArray(value) && value.every((entry) => typeof entry === "string");
|
|
@@ -456226,6 +457003,7 @@ var init_subagent_protocol_inbound = __esm(() => {
|
|
|
456226
457003
|
"mcp"
|
|
456227
457004
|
]);
|
|
456228
457005
|
LEGACY_EXTERNAL_SUBAGENT_TYPES = new Set([
|
|
457006
|
+
"antigravity",
|
|
456229
457007
|
"claude-code",
|
|
456230
457008
|
"codex",
|
|
456231
457009
|
"cursor",
|
|
@@ -459640,6 +460418,7 @@ function buildAppServerInfoResponse(command, options) {
|
|
|
459640
460418
|
runtime_external_tools_update: true,
|
|
459641
460419
|
runtime_tool_policy: true,
|
|
459642
460420
|
runtime_tool_policy_foreground_yield: true,
|
|
460421
|
+
external_tool_foreground_yield: true,
|
|
459643
460422
|
structured_outputs: options.backend === "api",
|
|
459644
460423
|
write_file_base64: true,
|
|
459645
460424
|
split_channels: false
|
|
@@ -462765,6 +463544,7 @@ async function applyRuntimeStartState(parsed, context3, scope, scopedRuntime) {
|
|
|
462765
463544
|
if (!mode) {
|
|
462766
463545
|
throw new Error(`Unsupported permission mode: ${parsed.mode}`);
|
|
462767
463546
|
}
|
|
463547
|
+
const hadPermissionMode = context3.runtime.permissionModeByConversation.has(getPermissionModeScopeKey(scope.agent_id, scope.conversation_id));
|
|
462768
463548
|
const state2 = getOrCreateConversationPermissionModeStateRef(context3.runtime, scope.agent_id, scope.conversation_id);
|
|
462769
463549
|
if (!(parsed.mode_is_default && state2.explicit)) {
|
|
462770
463550
|
const previousMode = state2.mode;
|
|
@@ -462772,7 +463552,7 @@ async function applyRuntimeStartState(parsed, context3, scope, scopedRuntime) {
|
|
|
462772
463552
|
if (!parsed.mode_is_default)
|
|
462773
463553
|
state2.explicit = true;
|
|
462774
463554
|
persistPermissionModeMapForRuntime(context3.runtime);
|
|
462775
|
-
if (previousMode !== mode) {
|
|
463555
|
+
if (hadPermissionMode && previousMode !== mode) {
|
|
462776
463556
|
telemetry.trackPermissionModeChanged({
|
|
462777
463557
|
agent_id: scope.agent_id,
|
|
462778
463558
|
conversation_id: scope.conversation_id,
|
|
@@ -464225,6 +465005,8 @@ function nativeSessionOwner(agentId) {
|
|
|
464225
465005
|
const target = parseExternalCodingAgentId(agentId);
|
|
464226
465006
|
if (!target || target.computer)
|
|
464227
465007
|
return;
|
|
465008
|
+
if (target.type === "antigravity")
|
|
465009
|
+
return readNativeSessionOwner(target.type, target.sessionId);
|
|
464228
465010
|
if (target.type !== "claude-code" && target.type !== "codex")
|
|
464229
465011
|
return;
|
|
464230
465012
|
return getNativeSessionOwner(target.type === "claude-code" ? "claude_code" : "codex", target.sessionId);
|
|
@@ -464294,6 +465076,14 @@ async function handleSubagentMessageCommand(command, parent, deps = {}) {
|
|
|
464294
465076
|
parentAgentId: command.runtime.agent_id,
|
|
464295
465077
|
actingUserId: command.runtime.acting_user_id
|
|
464296
465078
|
}, deps.workerEnv);
|
|
465079
|
+
if (target.type === "antigravity" && worker)
|
|
465080
|
+
return sendAntigravityMessage({
|
|
465081
|
+
resumeSessionId: sessionId,
|
|
465082
|
+
prompt: command.message,
|
|
465083
|
+
parentAgentId: command.runtime.agent_id,
|
|
465084
|
+
cwd: getCurrentWorkingDirectory(),
|
|
465085
|
+
mcpReminder: worker.mcpReminder
|
|
465086
|
+
}, worker.env, worker.secretEnv);
|
|
464297
465087
|
return target.type === "cursor" ? sendCursorMessage({
|
|
464298
465088
|
sessionId,
|
|
464299
465089
|
prompt: command.message,
|
|
@@ -464455,6 +465245,7 @@ var DEDUPE_TTL_MS = 30000, responses;
|
|
|
464455
465245
|
var init_subagent_control = __esm(() => {
|
|
464456
465246
|
init_subagent_state();
|
|
464457
465247
|
init_runtime_context();
|
|
465248
|
+
init_antigravity_session();
|
|
464458
465249
|
init_claude_steer_timeouts();
|
|
464459
465250
|
init_claude_stream_session();
|
|
464460
465251
|
init_codex_app_server();
|
|
@@ -464462,6 +465253,7 @@ var init_subagent_control = __esm(() => {
|
|
|
464462
465253
|
init_external_coding_agent();
|
|
464463
465254
|
init_external_coding_agent_task();
|
|
464464
465255
|
init_native_session_capture();
|
|
465256
|
+
init_native_session_owner();
|
|
464465
465257
|
init_process_manager();
|
|
464466
465258
|
init_task_stop();
|
|
464467
465259
|
init_cwd();
|
|
@@ -464560,7 +465352,7 @@ async function handleLaunchSubagentCommand(command, parent, connectionId, launch
|
|
|
464560
465352
|
signal.removeEventListener("abort", onAbort);
|
|
464561
465353
|
}
|
|
464562
465354
|
}
|
|
464563
|
-
var
|
|
465355
|
+
var init_subagents4 = __esm(() => {
|
|
464564
465356
|
init_runtime_context();
|
|
464565
465357
|
init_task();
|
|
464566
465358
|
init_cwd();
|
|
@@ -464620,7 +465412,7 @@ var init_task_control = __esm(() => {
|
|
|
464620
465412
|
init_stop_conversation();
|
|
464621
465413
|
init_subagent_control();
|
|
464622
465414
|
init_subagent_events2();
|
|
464623
|
-
|
|
465415
|
+
init_subagents4();
|
|
464624
465416
|
});
|
|
464625
465417
|
|
|
464626
465418
|
// src/websocket/listener/message-router.ts
|
|
@@ -472311,7 +473103,7 @@ var exports_external_worker_models = {};
|
|
|
472311
473103
|
__export(exports_external_worker_models, {
|
|
472312
473104
|
listExternalWorkerModels: () => listExternalWorkerModels
|
|
472313
473105
|
});
|
|
472314
|
-
import { createInterface as
|
|
473106
|
+
import { createInterface as createInterface12 } from "node:readline";
|
|
472315
473107
|
async function listClaudeModels(cwd2, env6) {
|
|
472316
473108
|
const controller = new AbortController;
|
|
472317
473109
|
const running = spawnManagedWorkloadProcess("claude", [
|
|
@@ -472329,7 +473121,7 @@ async function listClaudeModels(cwd2, env6) {
|
|
|
472329
473121
|
'{"disableAllHooks":true}'
|
|
472330
473122
|
], { cwd: cwd2, env: env6, signal: controller.signal });
|
|
472331
473123
|
const timer = setTimeout(() => controller.abort(), 30000);
|
|
472332
|
-
const lines =
|
|
473124
|
+
const lines = createInterface12({ input: running.process.stdout });
|
|
472333
473125
|
let stderr = "";
|
|
472334
473126
|
running.process.once("error", (error4) => {
|
|
472335
473127
|
stderr = error4.message;
|
|
@@ -478445,10 +479237,10 @@ async function openReadOnlyDatabase(path49) {
|
|
|
478445
479237
|
async function exportHermesSession(storePath, sessionId) {
|
|
478446
479238
|
const database = await openReadOnlyDatabase(storePath);
|
|
478447
479239
|
try {
|
|
478448
|
-
const
|
|
479240
|
+
const sessions6 = database.all("SELECT * FROM sessions WHERE id = ?", sessionId);
|
|
478449
479241
|
const messages = database.all("SELECT * FROM messages WHERE session_id = ? ORDER BY id", sessionId);
|
|
478450
479242
|
return JSON.stringify({
|
|
478451
|
-
session:
|
|
479243
|
+
session: sessions6[0] ?? { id: sessionId },
|
|
478452
479244
|
messages
|
|
478453
479245
|
});
|
|
478454
479246
|
} finally {
|
|
@@ -478692,8 +479484,8 @@ async function readManifest(dir) {
|
|
|
478692
479484
|
}
|
|
478693
479485
|
return JSON.parse(raw2);
|
|
478694
479486
|
}
|
|
478695
|
-
function filterSessions(
|
|
478696
|
-
return
|
|
479487
|
+
function filterSessions(sessions6, filter3) {
|
|
479488
|
+
return sessions6.filter((session3) => (!filter3.source || session3.source === filter3.source) && (!filter3.project || (session3.project ?? "").startsWith(filter3.project)));
|
|
478697
479489
|
}
|
|
478698
479490
|
async function resolveSessionFile(dir, target) {
|
|
478699
479491
|
if (target.endsWith(".json")) {
|
|
@@ -478868,19 +479660,19 @@ async function runDetect(asJson) {
|
|
|
478868
479660
|
}
|
|
478869
479661
|
async function runList4(flags) {
|
|
478870
479662
|
const manifest2 = await readManifest(flags.dir);
|
|
478871
|
-
const
|
|
479663
|
+
const sessions6 = filterSessions(manifest2.sessions, flags);
|
|
478872
479664
|
if (flags.asJson) {
|
|
478873
|
-
console.log(JSON.stringify({ sessions:
|
|
479665
|
+
console.log(JSON.stringify({ sessions: sessions6 }, null, 2));
|
|
478874
479666
|
return 0;
|
|
478875
479667
|
}
|
|
478876
|
-
for (const session3 of
|
|
479668
|
+
for (const session3 of sessions6) {
|
|
478877
479669
|
console.log(`${(session3.startedAt ?? "unknown").slice(0, 19)} ${session3.source} msgs:${session3.userMessages} ${session3.file}`);
|
|
478878
479670
|
if (session3.firstUserPrompt) {
|
|
478879
479671
|
console.log(` ${session3.firstUserPrompt.replace(/\s+/g, " ").slice(0, 90)}`);
|
|
478880
479672
|
}
|
|
478881
479673
|
}
|
|
478882
479674
|
console.log(`
|
|
478883
|
-
Total: ${
|
|
479675
|
+
Total: ${sessions6.length} session(s); errors: ${manifest2.errors.length}; sources: ${Object.keys(manifest2.sources).join(", ")}`);
|
|
478884
479676
|
return 0;
|
|
478885
479677
|
}
|
|
478886
479678
|
async function runView(flags, target, options) {
|
|
@@ -484273,13 +485065,16 @@ async function createSubagentConversation(cloudBackend, parentConversationId, ag
|
|
|
484273
485065
|
if (!cloudBackend || !parentConversationId || parentConversationId === "default") {
|
|
484274
485066
|
return "default";
|
|
484275
485067
|
}
|
|
485068
|
+
const summary = process.env[SUBAGENT_SUMMARY_ENV]?.trim();
|
|
484276
485069
|
const body3 = {
|
|
484277
485070
|
agent_id: agentId,
|
|
484278
485071
|
parent_conversation_id: parentConversationId,
|
|
484279
|
-
is_subagent: true
|
|
485072
|
+
is_subagent: true,
|
|
485073
|
+
...summary ? { summary } : {}
|
|
484280
485074
|
};
|
|
484281
485075
|
return (await create4(body3)).id;
|
|
484282
485076
|
}
|
|
485077
|
+
var init_subagent_conversation = () => {};
|
|
484283
485078
|
|
|
484284
485079
|
// src/stream-json-writer.ts
|
|
484285
485080
|
function stampWireMessage(msg) {
|
|
@@ -488555,6 +489350,7 @@ var LLM_API_ERROR_MAX_RETRIES2 = 3, EMPTY_RESPONSE_MAX_RETRIES2 = 2, HEADLESS_ST
|
|
|
488555
489350
|
var init_headless = __esm(() => {
|
|
488556
489351
|
init_error();
|
|
488557
489352
|
init_preloaded_skills();
|
|
489353
|
+
init_subagent_conversation();
|
|
488558
489354
|
init_subagent_launcher();
|
|
488559
489355
|
init_paths();
|
|
488560
489356
|
init_constants2();
|
|
@@ -538473,4 +539269,4 @@ function registerBunOAuthFlows() {
|
|
|
538473
539269
|
registerBunOAuthFlows();
|
|
538474
539270
|
await init_src5().then(() => exports_src2);
|
|
538475
539271
|
|
|
538476
|
-
//# debugId=
|
|
539272
|
+
//# debugId=51AADFFB825ABBC564756E2164756E21
|