@jini-ai/agent-runtime 0.1.0
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/LICENSE +201 -0
- package/README.md +43 -0
- package/dist/acp-model-probe.d.ts +48 -0
- package/dist/acp-model-probe.d.ts.map +1 -0
- package/dist/acp-model-probe.js +15 -0
- package/dist/acp-model-probe.js.map +1 -0
- package/dist/agent-protocol/acp/account-failure.d.ts +54 -0
- package/dist/agent-protocol/acp/account-failure.d.ts.map +1 -0
- package/dist/agent-protocol/acp/account-failure.js +37 -0
- package/dist/agent-protocol/acp/account-failure.js.map +1 -0
- package/dist/agent-protocol/acp/constants.d.ts +26 -0
- package/dist/agent-protocol/acp/constants.d.ts.map +1 -0
- package/dist/agent-protocol/acp/constants.js +39 -0
- package/dist/agent-protocol/acp/constants.js.map +1 -0
- package/dist/agent-protocol/acp/index.d.ts +14 -0
- package/dist/agent-protocol/acp/index.d.ts.map +1 -0
- package/dist/agent-protocol/acp/index.js +14 -0
- package/dist/agent-protocol/acp/index.js.map +1 -0
- package/dist/agent-protocol/acp/json.d.ts +82 -0
- package/dist/agent-protocol/acp/json.d.ts.map +1 -0
- package/dist/agent-protocol/acp/json.js +144 -0
- package/dist/agent-protocol/acp/json.js.map +1 -0
- package/dist/agent-protocol/acp/models.d.ts +112 -0
- package/dist/agent-protocol/acp/models.d.ts.map +1 -0
- package/dist/agent-protocol/acp/models.js +293 -0
- package/dist/agent-protocol/acp/models.js.map +1 -0
- package/dist/agent-protocol/acp/rpc.d.ts +107 -0
- package/dist/agent-protocol/acp/rpc.d.ts.map +1 -0
- package/dist/agent-protocol/acp/rpc.js +162 -0
- package/dist/agent-protocol/acp/rpc.js.map +1 -0
- package/dist/agent-protocol/acp/session-params.d.ts +55 -0
- package/dist/agent-protocol/acp/session-params.d.ts.map +1 -0
- package/dist/agent-protocol/acp/session-params.js +81 -0
- package/dist/agent-protocol/acp/session-params.js.map +1 -0
- package/dist/agent-protocol/acp/session.d.ts +101 -0
- package/dist/agent-protocol/acp/session.d.ts.map +1 -0
- package/dist/agent-protocol/acp/session.js +832 -0
- package/dist/agent-protocol/acp/session.js.map +1 -0
- package/dist/agent-protocol/acp/text-suppression.d.ts +73 -0
- package/dist/agent-protocol/acp/text-suppression.d.ts.map +1 -0
- package/dist/agent-protocol/acp/text-suppression.js +229 -0
- package/dist/agent-protocol/acp/text-suppression.js.map +1 -0
- package/dist/agent-protocol/acp/types.d.ts +27 -0
- package/dist/agent-protocol/acp/types.d.ts.map +1 -0
- package/dist/agent-protocol/acp/types.js +2 -0
- package/dist/agent-protocol/acp/types.js.map +1 -0
- package/dist/agent-protocol/acp/updates.d.ts +166 -0
- package/dist/agent-protocol/acp/updates.d.ts.map +1 -0
- package/dist/agent-protocol/acp/updates.js +268 -0
- package/dist/agent-protocol/acp/updates.js.map +1 -0
- package/dist/agent-protocol/core/index.d.ts +6 -0
- package/dist/agent-protocol/core/index.d.ts.map +1 -0
- package/dist/agent-protocol/core/index.js +6 -0
- package/dist/agent-protocol/core/index.js.map +1 -0
- package/dist/agent-protocol/core/json-line-stream.d.ts +42 -0
- package/dist/agent-protocol/core/json-line-stream.d.ts.map +1 -0
- package/dist/agent-protocol/core/json-line-stream.js +333 -0
- package/dist/agent-protocol/core/json-line-stream.js.map +1 -0
- package/dist/agent-protocol/index.d.ts +8 -0
- package/dist/agent-protocol/index.d.ts.map +1 -0
- package/dist/agent-protocol/index.js +8 -0
- package/dist/agent-protocol/index.js.map +1 -0
- package/dist/agent-protocol/pi-rpc/events.d.ts +26 -0
- package/dist/agent-protocol/pi-rpc/events.d.ts.map +1 -0
- package/dist/agent-protocol/pi-rpc/events.js +167 -0
- package/dist/agent-protocol/pi-rpc/events.js.map +1 -0
- package/dist/agent-protocol/pi-rpc/index.d.ts +11 -0
- package/dist/agent-protocol/pi-rpc/index.d.ts.map +1 -0
- package/dist/agent-protocol/pi-rpc/index.js +11 -0
- package/dist/agent-protocol/pi-rpc/index.js.map +1 -0
- package/dist/agent-protocol/pi-rpc/internal.d.ts +45 -0
- package/dist/agent-protocol/pi-rpc/internal.d.ts.map +1 -0
- package/dist/agent-protocol/pi-rpc/internal.js +41 -0
- package/dist/agent-protocol/pi-rpc/internal.js.map +1 -0
- package/dist/agent-protocol/pi-rpc/models.d.ts +21 -0
- package/dist/agent-protocol/pi-rpc/models.d.ts.map +1 -0
- package/dist/agent-protocol/pi-rpc/models.js +48 -0
- package/dist/agent-protocol/pi-rpc/models.js.map +1 -0
- package/dist/agent-protocol/pi-rpc/session.d.ts +106 -0
- package/dist/agent-protocol/pi-rpc/session.d.ts.map +1 -0
- package/dist/agent-protocol/pi-rpc/session.js +371 -0
- package/dist/agent-protocol/pi-rpc/session.js.map +1 -0
- package/dist/amr-model-cache.d.ts +40 -0
- package/dist/amr-model-cache.d.ts.map +1 -0
- package/dist/amr-model-cache.js +79 -0
- package/dist/amr-model-cache.js.map +1 -0
- package/dist/amr-profile-resolver.d.ts +21 -0
- package/dist/amr-profile-resolver.d.ts.map +1 -0
- package/dist/amr-profile-resolver.js +4 -0
- package/dist/amr-profile-resolver.js.map +1 -0
- package/dist/artifact-taxonomy.d.ts +27 -0
- package/dist/artifact-taxonomy.d.ts.map +1 -0
- package/dist/artifact-taxonomy.js +5 -0
- package/dist/artifact-taxonomy.js.map +1 -0
- package/dist/auth.d.ts +25 -0
- package/dist/auth.d.ts.map +1 -0
- package/dist/auth.js +332 -0
- package/dist/auth.js.map +1 -0
- package/dist/capabilities.d.ts +9 -0
- package/dist/capabilities.d.ts.map +1 -0
- package/dist/capabilities.js +2 -0
- package/dist/capabilities.js.map +1 -0
- package/dist/claude-stream.d.ts +37 -0
- package/dist/claude-stream.d.ts.map +1 -0
- package/dist/claude-stream.js +660 -0
- package/dist/claude-stream.js.map +1 -0
- package/dist/copilot-stream.d.ts +37 -0
- package/dist/copilot-stream.d.ts.map +1 -0
- package/dist/copilot-stream.js +136 -0
- package/dist/copilot-stream.js.map +1 -0
- package/dist/defs/aider.d.ts +13 -0
- package/dist/defs/aider.d.ts.map +1 -0
- package/dist/defs/aider.js +63 -0
- package/dist/defs/aider.js.map +1 -0
- package/dist/defs/amp.d.ts +12 -0
- package/dist/defs/amp.d.ts.map +1 -0
- package/dist/defs/amp.js +56 -0
- package/dist/defs/amp.js.map +1 -0
- package/dist/defs/amr.d.ts +37 -0
- package/dist/defs/amr.d.ts.map +1 -0
- package/dist/defs/amr.js +303 -0
- package/dist/defs/amr.js.map +1 -0
- package/dist/defs/antigravity.d.ts +25 -0
- package/dist/defs/antigravity.d.ts.map +1 -0
- package/dist/defs/antigravity.js +213 -0
- package/dist/defs/antigravity.js.map +1 -0
- package/dist/defs/claude.d.ts +30 -0
- package/dist/defs/claude.d.ts.map +1 -0
- package/dist/defs/claude.js +130 -0
- package/dist/defs/claude.js.map +1 -0
- package/dist/defs/codebuddy.d.ts +26 -0
- package/dist/defs/codebuddy.d.ts.map +1 -0
- package/dist/defs/codebuddy.js +124 -0
- package/dist/defs/codebuddy.js.map +1 -0
- package/dist/defs/codex.d.ts +30 -0
- package/dist/defs/codex.d.ts.map +1 -0
- package/dist/defs/codex.js +196 -0
- package/dist/defs/codex.js.map +1 -0
- package/dist/defs/copilot.d.ts +12 -0
- package/dist/defs/copilot.d.ts.map +1 -0
- package/dist/defs/copilot.js +88 -0
- package/dist/defs/copilot.js.map +1 -0
- package/dist/defs/cursor-agent.d.ts +27 -0
- package/dist/defs/cursor-agent.d.ts.map +1 -0
- package/dist/defs/cursor-agent.js +93 -0
- package/dist/defs/cursor-agent.js.map +1 -0
- package/dist/defs/deepseek.d.ts +12 -0
- package/dist/defs/deepseek.d.ts.map +1 -0
- package/dist/defs/deepseek.js +53 -0
- package/dist/defs/deepseek.js.map +1 -0
- package/dist/defs/devin.d.ts +12 -0
- package/dist/defs/devin.d.ts.map +1 -0
- package/dist/defs/devin.js +45 -0
- package/dist/defs/devin.js.map +1 -0
- package/dist/defs/grok-build.d.ts +26 -0
- package/dist/defs/grok-build.d.ts.map +1 -0
- package/dist/defs/grok-build.js +105 -0
- package/dist/defs/grok-build.js.map +1 -0
- package/dist/defs/hermes.d.ts +13 -0
- package/dist/defs/hermes.d.ts.map +1 -0
- package/dist/defs/hermes.js +51 -0
- package/dist/defs/hermes.js.map +1 -0
- package/dist/defs/index.d.ts +33 -0
- package/dist/defs/index.d.ts.map +1 -0
- package/dist/defs/index.js +33 -0
- package/dist/defs/index.js.map +1 -0
- package/dist/defs/kilo.d.ts +12 -0
- package/dist/defs/kilo.d.ts.map +1 -0
- package/dist/defs/kilo.js +20 -0
- package/dist/defs/kilo.js.map +1 -0
- package/dist/defs/kimi.d.ts +13 -0
- package/dist/defs/kimi.d.ts.map +1 -0
- package/dist/defs/kimi.js +26 -0
- package/dist/defs/kimi.js.map +1 -0
- package/dist/defs/kiro.d.ts +12 -0
- package/dist/defs/kiro.d.ts.map +1 -0
- package/dist/defs/kiro.js +20 -0
- package/dist/defs/kiro.js.map +1 -0
- package/dist/defs/mimo.d.ts +13 -0
- package/dist/defs/mimo.d.ts.map +1 -0
- package/dist/defs/mimo.js +26 -0
- package/dist/defs/mimo.js.map +1 -0
- package/dist/defs/opencode.d.ts +27 -0
- package/dist/defs/opencode.d.ts.map +1 -0
- package/dist/defs/opencode.js +89 -0
- package/dist/defs/opencode.js.map +1 -0
- package/dist/defs/pi.d.ts +18 -0
- package/dist/defs/pi.d.ts.map +1 -0
- package/dist/defs/pi.js +94 -0
- package/dist/defs/pi.js.map +1 -0
- package/dist/defs/qoder.d.ts +11 -0
- package/dist/defs/qoder.d.ts.map +1 -0
- package/dist/defs/qoder.js +50 -0
- package/dist/defs/qoder.js.map +1 -0
- package/dist/defs/qwen.d.ts +11 -0
- package/dist/defs/qwen.d.ts.map +1 -0
- package/dist/defs/qwen.js +28 -0
- package/dist/defs/qwen.js.map +1 -0
- package/dist/defs/reasonix.d.ts +20 -0
- package/dist/defs/reasonix.d.ts.map +1 -0
- package/dist/defs/reasonix.js +60 -0
- package/dist/defs/reasonix.js.map +1 -0
- package/dist/defs/shared.d.ts +23 -0
- package/dist/defs/shared.d.ts.map +1 -0
- package/dist/defs/shared.js +58 -0
- package/dist/defs/shared.js.map +1 -0
- package/dist/defs/trae-cli.d.ts +14 -0
- package/dist/defs/trae-cli.d.ts.map +1 -0
- package/dist/defs/trae-cli.js +22 -0
- package/dist/defs/trae-cli.js.map +1 -0
- package/dist/defs/vibe.d.ts +12 -0
- package/dist/defs/vibe.d.ts.map +1 -0
- package/dist/defs/vibe.js +20 -0
- package/dist/defs/vibe.js.map +1 -0
- package/dist/detection.d.ts +14 -0
- package/dist/detection.d.ts.map +1 -0
- package/dist/detection.js +266 -0
- package/dist/detection.js.map +1 -0
- package/dist/diagnostics.d.ts +8 -0
- package/dist/diagnostics.d.ts.map +1 -0
- package/dist/diagnostics.js +95 -0
- package/dist/diagnostics.js.map +1 -0
- package/dist/env.d.ts +19 -0
- package/dist/env.d.ts.map +1 -0
- package/dist/env.js +95 -0
- package/dist/env.js.map +1 -0
- package/dist/executables.d.ts +24 -0
- package/dist/executables.d.ts.map +1 -0
- package/dist/executables.js +349 -0
- package/dist/executables.js.map +1 -0
- package/dist/index.d.ts +74 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +102 -0
- package/dist/index.js.map +1 -0
- package/dist/invocation.d.ts +6 -0
- package/dist/invocation.d.ts.map +1 -0
- package/dist/invocation.js +47 -0
- package/dist/invocation.js.map +1 -0
- package/dist/json-event-stream.d.ts +9 -0
- package/dist/json-event-stream.d.ts.map +1 -0
- package/dist/json-event-stream.js +856 -0
- package/dist/json-event-stream.js.map +1 -0
- package/dist/launch.d.ts +12 -0
- package/dist/launch.d.ts.map +1 -0
- package/dist/launch.js +221 -0
- package/dist/launch.js.map +1 -0
- package/dist/mcp.d.ts +44 -0
- package/dist/mcp.d.ts.map +1 -0
- package/dist/mcp.js +12 -0
- package/dist/mcp.js.map +1 -0
- package/dist/metadata.d.ts +24 -0
- package/dist/metadata.d.ts.map +1 -0
- package/dist/metadata.js +100 -0
- package/dist/metadata.js.map +1 -0
- package/dist/mmd-routes.d.ts +12 -0
- package/dist/mmd-routes.d.ts.map +1 -0
- package/dist/mmd-routes.js +146 -0
- package/dist/mmd-routes.js.map +1 -0
- package/dist/model-registry.d.ts +120 -0
- package/dist/model-registry.d.ts.map +1 -0
- package/dist/model-registry.js +77 -0
- package/dist/model-registry.js.map +1 -0
- package/dist/models.d.ts +16 -0
- package/dist/models.d.ts.map +1 -0
- package/dist/models.js +93 -0
- package/dist/models.js.map +1 -0
- package/dist/opencode-log.d.ts +16 -0
- package/dist/opencode-log.d.ts.map +1 -0
- package/dist/opencode-log.js +163 -0
- package/dist/opencode-log.js.map +1 -0
- package/dist/paths.d.ts +3 -0
- package/dist/paths.d.ts.map +1 -0
- package/dist/paths.js +29 -0
- package/dist/paths.js.map +1 -0
- package/dist/pi-models.d.ts +13 -0
- package/dist/pi-models.d.ts.map +1 -0
- package/dist/pi-models.js +36 -0
- package/dist/pi-models.js.map +1 -0
- package/dist/prompt-augmenter.d.ts +60 -0
- package/dist/prompt-augmenter.d.ts.map +1 -0
- package/dist/prompt-augmenter.js +26 -0
- package/dist/prompt-augmenter.js.map +1 -0
- package/dist/prompt-budget.d.ts +20 -0
- package/dist/prompt-budget.d.ts.map +1 -0
- package/dist/prompt-budget.js +226 -0
- package/dist/prompt-budget.js.map +1 -0
- package/dist/prompt-file.d.ts +7 -0
- package/dist/prompt-file.d.ts.map +1 -0
- package/dist/prompt-file.js +27 -0
- package/dist/prompt-file.js.map +1 -0
- package/dist/providers/aihubmix.d.ts +99 -0
- package/dist/providers/aihubmix.d.ts.map +1 -0
- package/dist/providers/aihubmix.js +239 -0
- package/dist/providers/aihubmix.js.map +1 -0
- package/dist/providers/anthropic-messages.d.ts +116 -0
- package/dist/providers/anthropic-messages.d.ts.map +1 -0
- package/dist/providers/anthropic-messages.js +313 -0
- package/dist/providers/anthropic-messages.js.map +1 -0
- package/dist/providers/azure-chat.d.ts +99 -0
- package/dist/providers/azure-chat.d.ts.map +1 -0
- package/dist/providers/azure-chat.js +164 -0
- package/dist/providers/azure-chat.js.map +1 -0
- package/dist/providers/connection-guard.d.ts +67 -0
- package/dist/providers/connection-guard.d.ts.map +1 -0
- package/dist/providers/connection-guard.js +211 -0
- package/dist/providers/connection-guard.js.map +1 -0
- package/dist/providers/elevenlabs.d.ts +28 -0
- package/dist/providers/elevenlabs.d.ts.map +1 -0
- package/dist/providers/elevenlabs.js +138 -0
- package/dist/providers/elevenlabs.js.map +1 -0
- package/dist/providers/google-messages.d.ts +108 -0
- package/dist/providers/google-messages.d.ts.map +1 -0
- package/dist/providers/google-messages.js +284 -0
- package/dist/providers/google-messages.js.map +1 -0
- package/dist/providers/google.d.ts +20 -0
- package/dist/providers/google.d.ts.map +1 -0
- package/dist/providers/google.js +42 -0
- package/dist/providers/google.js.map +1 -0
- package/dist/providers/index.d.ts +39 -0
- package/dist/providers/index.d.ts.map +1 -0
- package/dist/providers/index.js +39 -0
- package/dist/providers/index.js.map +1 -0
- package/dist/providers/model-catalog.d.ts +32 -0
- package/dist/providers/model-catalog.d.ts.map +1 -0
- package/dist/providers/model-catalog.js +394 -0
- package/dist/providers/model-catalog.js.map +1 -0
- package/dist/providers/oauth-callback-server.d.ts +35 -0
- package/dist/providers/oauth-callback-server.d.ts.map +1 -0
- package/dist/providers/oauth-callback-server.js +217 -0
- package/dist/providers/oauth-callback-server.js.map +1 -0
- package/dist/providers/oauth-credentials.d.ts +29 -0
- package/dist/providers/oauth-credentials.d.ts.map +1 -0
- package/dist/providers/oauth-credentials.js +70 -0
- package/dist/providers/oauth-credentials.js.map +1 -0
- package/dist/providers/oauth-provider.d.ts +95 -0
- package/dist/providers/oauth-provider.d.ts.map +1 -0
- package/dist/providers/oauth-provider.js +130 -0
- package/dist/providers/oauth-provider.js.map +1 -0
- package/dist/providers/oauth-tokens.d.ts +35 -0
- package/dist/providers/oauth-tokens.d.ts.map +1 -0
- package/dist/providers/oauth-tokens.js +136 -0
- package/dist/providers/oauth-tokens.js.map +1 -0
- package/dist/providers/ollama-chat.d.ts +106 -0
- package/dist/providers/ollama-chat.d.ts.map +1 -0
- package/dist/providers/ollama-chat.js +292 -0
- package/dist/providers/ollama-chat.js.map +1 -0
- package/dist/providers/openai-chat.d.ts +147 -0
- package/dist/providers/openai-chat.d.ts.map +1 -0
- package/dist/providers/openai-chat.js +302 -0
- package/dist/providers/openai-chat.js.map +1 -0
- package/dist/providers/pkce.d.ts +81 -0
- package/dist/providers/pkce.d.ts.map +1 -0
- package/dist/providers/pkce.js +176 -0
- package/dist/providers/pkce.js.map +1 -0
- package/dist/providers/sse-decode.d.ts +47 -0
- package/dist/providers/sse-decode.d.ts.map +1 -0
- package/dist/providers/sse-decode.js +109 -0
- package/dist/providers/sse-decode.js.map +1 -0
- package/dist/providers/token-params.d.ts +29 -0
- package/dist/providers/token-params.d.ts.map +1 -0
- package/dist/providers/token-params.js +41 -0
- package/dist/providers/token-params.js.map +1 -0
- package/dist/providers/turn-end-guard.d.ts +37 -0
- package/dist/providers/turn-end-guard.d.ts.map +1 -0
- package/dist/providers/turn-end-guard.js +42 -0
- package/dist/providers/turn-end-guard.js.map +1 -0
- package/dist/providers/types.d.ts +36 -0
- package/dist/providers/types.d.ts.map +1 -0
- package/dist/providers/types.js +13 -0
- package/dist/providers/types.js.map +1 -0
- package/dist/qoder-stream.d.ts +19 -0
- package/dist/qoder-stream.d.ts.map +1 -0
- package/dist/qoder-stream.js +167 -0
- package/dist/qoder-stream.js.map +1 -0
- package/dist/registry.d.ts +5 -0
- package/dist/registry.d.ts.map +1 -0
- package/dist/registry.js +58 -0
- package/dist/registry.js.map +1 -0
- package/dist/resolution.d.ts +2 -0
- package/dist/resolution.d.ts.map +1 -0
- package/dist/resolution.js +19 -0
- package/dist/resolution.js.map +1 -0
- package/dist/role-marker-guard.d.ts +53 -0
- package/dist/role-marker-guard.d.ts.map +1 -0
- package/dist/role-marker-guard.js +280 -0
- package/dist/role-marker-guard.js.map +1 -0
- package/dist/telemetry-sink.d.ts +35 -0
- package/dist/telemetry-sink.d.ts.map +1 -0
- package/dist/telemetry-sink.js +5 -0
- package/dist/telemetry-sink.js.map +1 -0
- package/dist/terminal-launch.d.ts +11 -0
- package/dist/terminal-launch.d.ts.map +1 -0
- package/dist/terminal-launch.js +123 -0
- package/dist/terminal-launch.js.map +1 -0
- package/dist/types.d.ts +185 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +2 -0
- package/dist/types.js.map +1 -0
- package/package.json +47 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for describing the origin of the Work and
|
|
141
|
+
reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Support. While redistributing the Work or
|
|
166
|
+
Derivative Works thereof, You may choose to offer, and charge a
|
|
167
|
+
fee for, acceptance of support, warranty, indemnity, or other
|
|
168
|
+
liability obligations and/or rights consistent with this License.
|
|
169
|
+
However, in accepting such obligations, You may act only on Your
|
|
170
|
+
own behalf and on Your sole responsibility, not on behalf of any
|
|
171
|
+
other Contributor, and only if You agree to indemnify, defend,
|
|
172
|
+
and hold each Contributor harmless for any liability incurred by,
|
|
173
|
+
or claims asserted against, such Contributor by reason of your
|
|
174
|
+
accepting any such warranty or support.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright 2026 Open Design contributors
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|
package/README.md
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# `@jini/agent-runtime`
|
|
2
|
+
|
|
3
|
+
Runtime-side content and execution code for agent-driven artifact
|
|
4
|
+
generation: brand-agnostic craft knowledge and portable skill packages
|
|
5
|
+
(both product-neutral per root `AGENTS.md`) plus a real TypeScript runtime
|
|
6
|
+
surface — the `runtimes/` -> agent-runtime adapter registry/detection/
|
|
7
|
+
launch/stream-parser port and the `agent-protocol/` ACP + pi-rpc subprocess
|
|
8
|
+
transport (see `src/index.ts`'s own header comment and `source-map.md`'s
|
|
9
|
+
"Barrel merge" section for the full inventory), plus `src/model-registry.ts`
|
|
10
|
+
below. This top-level blurb has historically lagged that TS surface's
|
|
11
|
+
growth — treat `src/index.ts` and `source-map.md` as the source of truth
|
|
12
|
+
for what's actually implemented.
|
|
13
|
+
|
|
14
|
+
## `src/model-registry.ts`
|
|
15
|
+
|
|
16
|
+
The provider/model/agent-picker vocabulary (`ModelProvider`,
|
|
17
|
+
`ModelCatalogOption` — exported as `ModelOption` is already taken by
|
|
18
|
+
`agent-protocol/acp/models.ts`'s narrower ACP-probe shape —,
|
|
19
|
+
`AgentDefinition`, `AgentDiagnostic`, `CredentialStatus`, ...) and a handful
|
|
20
|
+
of pure helpers (credential-status resolution, model-list merging, a stable
|
|
21
|
+
model-catalogue cache key, model-choice normalization against a live
|
|
22
|
+
catalogue) for any consumer building a "pick a model/agent" UI — e.g.
|
|
23
|
+
`@jini/chat-react`'s `features/model-picker/` slice. Distinct from
|
|
24
|
+
`src/registry.ts` (the static `BASE_AGENT_DEFS` CLI-adapter catalog). See
|
|
25
|
+
`source-map.md` for full provenance.
|
|
26
|
+
|
|
27
|
+
## `src/craft/`
|
|
28
|
+
|
|
29
|
+
Universal UI-craft rulebooks (typography, color, motion, accessibility,
|
|
30
|
+
forms, RTL, anti-AI-slop, …) that a skill can opt into via a
|
|
31
|
+
`craft.requires` front-matter array. See `src/craft/README.md` for the
|
|
32
|
+
full mechanism and `source-map.md` for provenance.
|
|
33
|
+
|
|
34
|
+
## `src/skills/`
|
|
35
|
+
|
|
36
|
+
160 portable Skill packages ported from OD's 162-skill catalog (2 excluded
|
|
37
|
+
as OD-internal — see `source-map.md`), each a `SKILL.md` + optional
|
|
38
|
+
`assets/`/`scripts/`/`references/`. Frontmatter uses the same flat
|
|
39
|
+
`craft.requires`/`design_system.requires`/`mode`/etc. key convention as
|
|
40
|
+
`src/craft/`, not OD's original nested `od:` block. No TypeScript lives
|
|
41
|
+
inside `src/skills/` itself — this directory is content only; the
|
|
42
|
+
package's TypeScript runtime surface lives at `src/`'s top level, see
|
|
43
|
+
above.
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module acp-model-probe
|
|
3
|
+
*
|
|
4
|
+
* Port replacing OD's `detectAcpModels` import
|
|
5
|
+
* (`apps/daemon/src/acp.js`) inside `defs/shared.ts`. Eight of this
|
|
6
|
+
* package's def literals (devin, hermes, kilo, kimi, kiro, reasonix,
|
|
7
|
+
* trae-cli, vibe) fetch their live model list by speaking a session/new →
|
|
8
|
+
* session/list_models-shaped ACP JSON-RPC handshake to the spawned CLI.
|
|
9
|
+
*
|
|
10
|
+
* That handshake lives in OD's `acp.ts` (1744 lines) — the full ACP
|
|
11
|
+
* subprocess transport, which r1's recon classifies as its own separate
|
|
12
|
+
* GENERIC-ENGINE zone (`agent-protocol/`, 17 files) and a *later*
|
|
13
|
+
* extraction task, not this one. Porting it here would blow this task's
|
|
14
|
+
* scope far past "harvest wholesale" for what is genuinely a large,
|
|
15
|
+
* separate subsystem.
|
|
16
|
+
*
|
|
17
|
+
* So `detectAcpModels` becomes an injectable port: an `AcpModelProbe` with
|
|
18
|
+
* a single `detectModels(request)` method, matching the real call shape
|
|
19
|
+
* every ACP-based def literal already uses. The default implementation is
|
|
20
|
+
* a no-op that resolves to `[]`, which makes `detection.ts`'s `fetchModels`
|
|
21
|
+
* step treat the live-fetch as "returned nothing" and fall back to the
|
|
22
|
+
* def's static `fallbackModels` — the same behavior OD gets when the vela
|
|
23
|
+
* probe times out or errors. A future task that ports the ACP transport
|
|
24
|
+
* (or the OD adapter, sooner) calls `setAcpModelProbe()` once at startup to
|
|
25
|
+
* wire in the real implementation; every def literal that calls
|
|
26
|
+
* `detectAcpModels(...)` picks it up automatically, no per-def changes
|
|
27
|
+
* needed.
|
|
28
|
+
*/
|
|
29
|
+
import type { RuntimeEnv, RuntimeModelOption } from './types.js';
|
|
30
|
+
export interface AcpModelProbeRequest {
|
|
31
|
+
bin: string;
|
|
32
|
+
args: string[];
|
|
33
|
+
cwd?: string;
|
|
34
|
+
env?: RuntimeEnv;
|
|
35
|
+
timeoutMs?: number;
|
|
36
|
+
clientName?: string;
|
|
37
|
+
clientVersion?: string;
|
|
38
|
+
defaultModelOption?: RuntimeModelOption;
|
|
39
|
+
}
|
|
40
|
+
export interface AcpModelProbe {
|
|
41
|
+
detectModels(request: AcpModelProbeRequest): Promise<RuntimeModelOption[]>;
|
|
42
|
+
}
|
|
43
|
+
export declare const noopAcpModelProbe: AcpModelProbe;
|
|
44
|
+
/** Install the real ACP transport (or a test double). Pass `null` to restore the no-op default. */
|
|
45
|
+
export declare function setAcpModelProbe(probe: AcpModelProbe | null): void;
|
|
46
|
+
/** Drop-in replacement for OD's `detectAcpModels` — delegates to whatever probe is currently installed. */
|
|
47
|
+
export declare function detectAcpModels(request: AcpModelProbeRequest): Promise<RuntimeModelOption[]>;
|
|
48
|
+
//# sourceMappingURL=acp-model-probe.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"acp-model-probe.d.ts","sourceRoot":"","sources":["../src/acp-model-probe.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,OAAO,KAAK,EAAE,UAAU,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAEjE,MAAM,WAAW,oBAAoB;IACnC,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,UAAU,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,kBAAkB,CAAC,EAAE,kBAAkB,CAAC;CACzC;AAED,MAAM,WAAW,aAAa;IAC5B,YAAY,CAAC,OAAO,EAAE,oBAAoB,GAAG,OAAO,CAAC,kBAAkB,EAAE,CAAC,CAAC;CAC5E;AAED,eAAO,MAAM,iBAAiB,EAAE,aAI/B,CAAC;AAIF,mGAAmG;AACnG,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,aAAa,GAAG,IAAI,GAAG,IAAI,CAElE;AAED,2GAA2G;AAC3G,wBAAsB,eAAe,CAAC,OAAO,EAAE,oBAAoB,GAAG,OAAO,CAAC,kBAAkB,EAAE,CAAC,CAElG"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export const noopAcpModelProbe = {
|
|
2
|
+
async detectModels() {
|
|
3
|
+
return [];
|
|
4
|
+
},
|
|
5
|
+
};
|
|
6
|
+
let activeAcpModelProbe = noopAcpModelProbe;
|
|
7
|
+
/** Install the real ACP transport (or a test double). Pass `null` to restore the no-op default. */
|
|
8
|
+
export function setAcpModelProbe(probe) {
|
|
9
|
+
activeAcpModelProbe = probe ?? noopAcpModelProbe;
|
|
10
|
+
}
|
|
11
|
+
/** Drop-in replacement for OD's `detectAcpModels` — delegates to whatever probe is currently installed. */
|
|
12
|
+
export async function detectAcpModels(request) {
|
|
13
|
+
return activeAcpModelProbe.detectModels(request);
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=acp-model-probe.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"acp-model-probe.js","sourceRoot":"","sources":["../src/acp-model-probe.ts"],"names":[],"mappings":"AA6CA,MAAM,CAAC,MAAM,iBAAiB,GAAkB;IAC9C,KAAK,CAAC,YAAY;QAChB,OAAO,EAAE,CAAC;IACZ,CAAC;CACF,CAAC;AAEF,IAAI,mBAAmB,GAAkB,iBAAiB,CAAC;AAE3D,mGAAmG;AACnG,MAAM,UAAU,gBAAgB,CAAC,KAA2B;IAC1D,mBAAmB,GAAG,KAAK,IAAI,iBAAiB,CAAC;AACnD,CAAC;AAED,2GAA2G;AAC3G,MAAM,CAAC,KAAK,UAAU,eAAe,CAAC,OAA6B;IACjE,OAAO,mBAAmB,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC;AACnD,CAAC"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/** @module agent-protocol/acp/account-failure
|
|
2
|
+
* Injection seam for classifying agent-provider account-failure text (auth
|
|
3
|
+
* required, insufficient balance, quota exhausted, etc.) into a structured,
|
|
4
|
+
* actionable error. OD's real implementation classifies vela/AMR-branded
|
|
5
|
+
* failure text against a hardcoded, product-branded recharge URL — that
|
|
6
|
+
* adapter is product-specific and must not live in this package (see
|
|
7
|
+
* source-map.md for the full account of what was left behind and why).
|
|
8
|
+
* Callers inject their own `AccountFailureClassifier` through
|
|
9
|
+
* `AttachAcpSessionOptions.accountFailureClassifier`; the default
|
|
10
|
+
* `noopAccountFailureClassifier` always returns `null`, which reproduces the
|
|
11
|
+
* behavior of not having this feature at all — no promotion ever fires.
|
|
12
|
+
* Depends on nothing; consumed by acp/updates.ts and acp/session.ts.
|
|
13
|
+
*/
|
|
14
|
+
/**
|
|
15
|
+
* A structured, provider-agnostic account failure classification. Shaped
|
|
16
|
+
* generically (not AMR-specific field names) so any provider's classifier can
|
|
17
|
+
* satisfy this contract.
|
|
18
|
+
*/
|
|
19
|
+
export interface AccountFailure {
|
|
20
|
+
/** A stable machine-readable failure code (e.g. `'AUTH_REQUIRED'`). */
|
|
21
|
+
code: string;
|
|
22
|
+
/** A human-readable message describing the failure and how to recover. */
|
|
23
|
+
message: string;
|
|
24
|
+
/** The recovery action the caller should surface to the end user. */
|
|
25
|
+
action: string;
|
|
26
|
+
/** Optional URL to send the user to for taking `action` (e.g. a billing page). */
|
|
27
|
+
actionUrl?: string;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Injectable port: classifies free-form diagnostic text (drawn from an ACP
|
|
31
|
+
* session update or a stderr tail) into a structured `AccountFailure`, or
|
|
32
|
+
* `null` when the text does not match a known account-failure pattern.
|
|
33
|
+
*/
|
|
34
|
+
export interface AccountFailureClassifier {
|
|
35
|
+
classify(text: string): AccountFailure | null;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Default no-op classifier used when a caller does not inject a real one.
|
|
39
|
+
* Always returns `null`, meaning no account-failure promotion ever fires —
|
|
40
|
+
* identical observable behavior to not having the feature at all.
|
|
41
|
+
*/
|
|
42
|
+
export declare const noopAccountFailureClassifier: AccountFailureClassifier;
|
|
43
|
+
/**
|
|
44
|
+
* Builds the `details` payload attached to a promoted account-failure error.
|
|
45
|
+
*
|
|
46
|
+
* @param failure - The classification result to describe.
|
|
47
|
+
* @returns A details object carrying `action` and, when present, `actionUrl`.
|
|
48
|
+
*/
|
|
49
|
+
export declare function accountFailureDetails(failure: AccountFailure): {
|
|
50
|
+
kind: 'account_failure';
|
|
51
|
+
action: string;
|
|
52
|
+
actionUrl?: string;
|
|
53
|
+
};
|
|
54
|
+
//# sourceMappingURL=account-failure.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"account-failure.d.ts","sourceRoot":"","sources":["../../../src/agent-protocol/acp/account-failure.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH;;;;GAIG;AACH,MAAM,WAAW,cAAc;IAC7B,uEAAuE;IACvE,IAAI,EAAE,MAAM,CAAC;IACb,0EAA0E;IAC1E,OAAO,EAAE,MAAM,CAAC;IAChB,qEAAqE;IACrE,MAAM,EAAE,MAAM,CAAC;IACf,kFAAkF;IAClF,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;GAIG;AACH,MAAM,WAAW,wBAAwB;IACvC,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,cAAc,GAAG,IAAI,CAAC;CAC/C;AAED;;;;GAIG;AACH,eAAO,MAAM,4BAA4B,EAAE,wBAI1C,CAAC;AAEF;;;;;GAKG;AACH,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,cAAc,GAAG;IAC9D,IAAI,EAAE,iBAAiB,CAAC;IACxB,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAMA"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/** @module agent-protocol/acp/account-failure
|
|
2
|
+
* Injection seam for classifying agent-provider account-failure text (auth
|
|
3
|
+
* required, insufficient balance, quota exhausted, etc.) into a structured,
|
|
4
|
+
* actionable error. OD's real implementation classifies vela/AMR-branded
|
|
5
|
+
* failure text against a hardcoded, product-branded recharge URL — that
|
|
6
|
+
* adapter is product-specific and must not live in this package (see
|
|
7
|
+
* source-map.md for the full account of what was left behind and why).
|
|
8
|
+
* Callers inject their own `AccountFailureClassifier` through
|
|
9
|
+
* `AttachAcpSessionOptions.accountFailureClassifier`; the default
|
|
10
|
+
* `noopAccountFailureClassifier` always returns `null`, which reproduces the
|
|
11
|
+
* behavior of not having this feature at all — no promotion ever fires.
|
|
12
|
+
* Depends on nothing; consumed by acp/updates.ts and acp/session.ts.
|
|
13
|
+
*/
|
|
14
|
+
/**
|
|
15
|
+
* Default no-op classifier used when a caller does not inject a real one.
|
|
16
|
+
* Always returns `null`, meaning no account-failure promotion ever fires —
|
|
17
|
+
* identical observable behavior to not having the feature at all.
|
|
18
|
+
*/
|
|
19
|
+
export const noopAccountFailureClassifier = {
|
|
20
|
+
classify() {
|
|
21
|
+
return null;
|
|
22
|
+
},
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* Builds the `details` payload attached to a promoted account-failure error.
|
|
26
|
+
*
|
|
27
|
+
* @param failure - The classification result to describe.
|
|
28
|
+
* @returns A details object carrying `action` and, when present, `actionUrl`.
|
|
29
|
+
*/
|
|
30
|
+
export function accountFailureDetails(failure) {
|
|
31
|
+
return {
|
|
32
|
+
kind: 'account_failure',
|
|
33
|
+
action: failure.action,
|
|
34
|
+
...(failure.actionUrl ? { actionUrl: failure.actionUrl } : {}),
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=account-failure.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"account-failure.js","sourceRoot":"","sources":["../../../src/agent-protocol/acp/account-failure.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AA2BH;;;;GAIG;AACH,MAAM,CAAC,MAAM,4BAA4B,GAA6B;IACpE,QAAQ;QACN,OAAO,IAAI,CAAC;IACd,CAAC;CACF,CAAC;AAEF;;;;;GAKG;AACH,MAAM,UAAU,qBAAqB,CAAC,OAAuB;IAK3D,OAAO;QACL,IAAI,EAAE,iBAAiB;QACvB,MAAM,EAAE,OAAO,CAAC,MAAM;QACtB,GAAG,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,SAAS,EAAE,OAAO,CAAC,SAAS,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;KAC/D,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/** @module agent-protocol/acp/constants
|
|
2
|
+
* Protocol version, timeout defaults, artifact-detection patterns, and
|
|
3
|
+
* model-config identifier sets used across all acp/ files. No dependencies
|
|
4
|
+
* on other agent-protocol modules — safe to import from anywhere in acp/.
|
|
5
|
+
*/
|
|
6
|
+
/** ACP JSON-RPC protocol version sent in every `initialize` handshake. */
|
|
7
|
+
export declare const ACP_PROTOCOL_VERSION = 1;
|
|
8
|
+
/** Default timeout in milliseconds for short-lived ACP operations such as model detection. */
|
|
9
|
+
export declare const DEFAULT_TIMEOUT_MS = 15000;
|
|
10
|
+
/** Absolute upper ceiling for any ACP-derived timeout value (24 hours). */
|
|
11
|
+
export declare const MAX_TIMEOUT_MS: number;
|
|
12
|
+
/** Default per-stage inactivity watchdog timeout (10 minutes) for an ACP session; resets on every received line from the agent subprocess. */
|
|
13
|
+
export declare const DEFAULT_STAGE_TIMEOUT_MS: number;
|
|
14
|
+
/** Regex source fragment matching an opening DSML artifact or plain `artifact` tag in an ACP agent's text output. */
|
|
15
|
+
export declare const ACP_ARTIFACT_OPEN_PATTERN: string;
|
|
16
|
+
/** Regex source fragment matching agent preamble text like "here is the generated file:" that precedes an artifact open tag. */
|
|
17
|
+
export declare const ACP_GENERATED_FILE_PREFIX_PATTERN: string;
|
|
18
|
+
/** Compiled regex that detects the start of an ACP artifact echo in an `agent_message_chunk` delta; used to arm the DSML text suppressor. */
|
|
19
|
+
export declare const ACP_ARTIFACT_ECHO_START_RE: RegExp;
|
|
20
|
+
/** Maximum number of `acp_raw_event_shape` and `acp_artifact_text_suppression` diagnostic events emitted per session to avoid flooding the event stream. */
|
|
21
|
+
export declare const ACP_RAW_EVENT_SHAPE_DIAGNOSTIC_LIMIT = 8;
|
|
22
|
+
/** Maximum number of bytes retained from stderr to detect AMR retry/failure signals; older bytes are discarded to bound memory use. */
|
|
23
|
+
export declare const AMR_STDERR_RETRY_TAIL_LIMIT = 16000;
|
|
24
|
+
/** Normalised token IDs that identify a model-selection config option in an ACP `session/new` response's `configOptions` array. */
|
|
25
|
+
export declare const MODEL_CONFIG_OPTION_IDS: Set<string>;
|
|
26
|
+
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/agent-protocol/acp/constants.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,0EAA0E;AAC1E,eAAO,MAAM,oBAAoB,IAAI,CAAC;AACtC,8FAA8F;AAC9F,eAAO,MAAM,kBAAkB,QAAS,CAAC;AACzC,2EAA2E;AAC3E,eAAO,MAAM,cAAc,QAAsB,CAAC;AAclD,8IAA8I;AAC9I,eAAO,MAAM,wBAAwB,QAAiB,CAAC;AACvD,qHAAqH;AACrH,eAAO,MAAM,yBAAyB,QAA4D,CAAC;AACnG,gIAAgI;AAChI,eAAO,MAAM,iCAAiC,QACmC,CAAC;AAClF,6IAA6I;AAC7I,eAAO,MAAM,0BAA0B,QAGtC,CAAC;AACF,4JAA4J;AAC5J,eAAO,MAAM,oCAAoC,IAAI,CAAC;AACtD,uIAAuI;AACvI,eAAO,MAAM,2BAA2B,QAAS,CAAC;AAClD,mIAAmI;AACnI,eAAO,MAAM,uBAAuB,aAAsD,CAAC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/** @module agent-protocol/acp/constants
|
|
2
|
+
* Protocol version, timeout defaults, artifact-detection patterns, and
|
|
3
|
+
* model-config identifier sets used across all acp/ files. No dependencies
|
|
4
|
+
* on other agent-protocol modules — safe to import from anywhere in acp/.
|
|
5
|
+
*/
|
|
6
|
+
/** ACP JSON-RPC protocol version sent in every `initialize` handshake. */
|
|
7
|
+
export const ACP_PROTOCOL_VERSION = 1;
|
|
8
|
+
/** Default timeout in milliseconds for short-lived ACP operations such as model detection. */
|
|
9
|
+
export const DEFAULT_TIMEOUT_MS = 15_000;
|
|
10
|
+
/** Absolute upper ceiling for any ACP-derived timeout value (24 hours). */
|
|
11
|
+
export const MAX_TIMEOUT_MS = 24 * 60 * 60 * 1000;
|
|
12
|
+
// Gap-between-chunks watchdog for an ACP session stage. The timer resets on
|
|
13
|
+
// every line received from the agent, so this bounds *silent* periods, not
|
|
14
|
+
// total runtime. Default kept in line with a typical outer run-level
|
|
15
|
+
// inactivity watchdog (10 min) so agents that spend several minutes silently
|
|
16
|
+
// writing large artifacts do not get killed before that outer watchdog can
|
|
17
|
+
// apply. Callers can override via `stageTimeoutMs`; a host application may
|
|
18
|
+
// resolve its own branded environment variable to a value it passes in here
|
|
19
|
+
// (this package does not read any env var directly for this default).
|
|
20
|
+
// A non-positive `stageTimeoutMs` (`<= 0`) disables the watchdog entirely,
|
|
21
|
+
// mirroring a typical outer run-level watchdog's escape-hatch semantics —
|
|
22
|
+
// without this, a caller passing `stageTimeoutMs: 0` would call
|
|
23
|
+
// `setTimeout(..., 0)` and fail every ACP session on the next tick instead of
|
|
24
|
+
// disabling the watchdog.
|
|
25
|
+
/** Default per-stage inactivity watchdog timeout (10 minutes) for an ACP session; resets on every received line from the agent subprocess. */
|
|
26
|
+
export const DEFAULT_STAGE_TIMEOUT_MS = 10 * 60 * 1000;
|
|
27
|
+
/** Regex source fragment matching an opening DSML artifact or plain `artifact` tag in an ACP agent's text output. */
|
|
28
|
+
export const ACP_ARTIFACT_OPEN_PATTERN = String.raw `<\s*(?:\|?\s*DSML[\s,]+artifact\b|artifact\b)`;
|
|
29
|
+
/** Regex source fragment matching agent preamble text like "here is the generated file:" that precedes an artifact open tag. */
|
|
30
|
+
export const ACP_GENERATED_FILE_PREFIX_PATTERN = String.raw `(?:here\s+is|here'?s)\s+the\s+generated\s+file\s*:?\s*(?:\r?\n|\s)*`;
|
|
31
|
+
/** Compiled regex that detects the start of an ACP artifact echo in an `agent_message_chunk` delta; used to arm the DSML text suppressor. */
|
|
32
|
+
export const ACP_ARTIFACT_ECHO_START_RE = new RegExp(String.raw `^\s*(?:${ACP_ARTIFACT_OPEN_PATTERN}|${ACP_GENERATED_FILE_PREFIX_PATTERN}${ACP_ARTIFACT_OPEN_PATTERN})`, 'i');
|
|
33
|
+
/** Maximum number of `acp_raw_event_shape` and `acp_artifact_text_suppression` diagnostic events emitted per session to avoid flooding the event stream. */
|
|
34
|
+
export const ACP_RAW_EVENT_SHAPE_DIAGNOSTIC_LIMIT = 8;
|
|
35
|
+
/** Maximum number of bytes retained from stderr to detect AMR retry/failure signals; older bytes are discarded to bound memory use. */
|
|
36
|
+
export const AMR_STDERR_RETRY_TAIL_LIMIT = 16_000;
|
|
37
|
+
/** Normalised token IDs that identify a model-selection config option in an ACP `session/new` response's `configOptions` array. */
|
|
38
|
+
export const MODEL_CONFIG_OPTION_IDS = new Set(['model', 'models', 'modelid', 'modelids']);
|
|
39
|
+
//# sourceMappingURL=constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../src/agent-protocol/acp/constants.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,0EAA0E;AAC1E,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,CAAC;AACtC,8FAA8F;AAC9F,MAAM,CAAC,MAAM,kBAAkB,GAAG,MAAM,CAAC;AACzC,2EAA2E;AAC3E,MAAM,CAAC,MAAM,cAAc,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC;AAClD,4EAA4E;AAC5E,2EAA2E;AAC3E,qEAAqE;AACrE,6EAA6E;AAC7E,2EAA2E;AAC3E,2EAA2E;AAC3E,4EAA4E;AAC5E,sEAAsE;AACtE,2EAA2E;AAC3E,0EAA0E;AAC1E,gEAAgE;AAChE,8EAA8E;AAC9E,0BAA0B;AAC1B,8IAA8I;AAC9I,MAAM,CAAC,MAAM,wBAAwB,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC;AACvD,qHAAqH;AACrH,MAAM,CAAC,MAAM,yBAAyB,GAAG,MAAM,CAAC,GAAG,CAAA,+CAA+C,CAAC;AACnG,gIAAgI;AAChI,MAAM,CAAC,MAAM,iCAAiC,GAC5C,MAAM,CAAC,GAAG,CAAA,qEAAqE,CAAC;AAClF,6IAA6I;AAC7I,MAAM,CAAC,MAAM,0BAA0B,GAAG,IAAI,MAAM,CAClD,MAAM,CAAC,GAAG,CAAA,UAAU,yBAAyB,IAAI,iCAAiC,GAAG,yBAAyB,GAAG,EACjH,GAAG,CACJ,CAAC;AACF,4JAA4J;AAC5J,MAAM,CAAC,MAAM,oCAAoC,GAAG,CAAC,CAAC;AACtD,uIAAuI;AACvI,MAAM,CAAC,MAAM,2BAA2B,GAAG,MAAM,CAAC;AAClD,mIAAmI;AACnI,MAAM,CAAC,MAAM,uBAAuB,GAAG,IAAI,GAAG,CAAC,CAAC,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,UAAU,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/** @module agent-protocol/acp
|
|
2
|
+
* Public barrel for the ACP (Agent Client Protocol) JSON-RPC subprocess
|
|
3
|
+
* transport. Re-exports the surface consumed by runtime adapter definitions
|
|
4
|
+
* (detectAcpModels, normalizeModels, ModelOption), a host's connection-test
|
|
5
|
+
* and chat-server entry points (attachAcpSession, buildAcpSessionNewParams,
|
|
6
|
+
* AcpMcpServerInput), and the account-failure injection seam
|
|
7
|
+
* (AccountFailure, AccountFailureClassifier, noopAccountFailureClassifier) a
|
|
8
|
+
* host application uses to plug in its own provider-specific classifier.
|
|
9
|
+
*/
|
|
10
|
+
export { type AcpMcpServerInput, buildAcpSessionNewParams } from './session-params.js';
|
|
11
|
+
export { type ModelOption, normalizeModels, detectAcpModels } from './models.js';
|
|
12
|
+
export { attachAcpSession, type AcpPermissionDecision, type AcpPermissionHandler, type AcpPermissionOption, type AcpPermissionRequest, type AcpSessionController, type AttachAcpSessionOptions, } from './session.js';
|
|
13
|
+
export { type AccountFailure, type AccountFailureClassifier, noopAccountFailureClassifier, } from './account-failure.js';
|
|
14
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/agent-protocol/acp/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,EAAE,KAAK,iBAAiB,EAAE,wBAAwB,EAAE,MAAM,qBAAqB,CAAC;AACvF,OAAO,EAAE,KAAK,WAAW,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AACjF,OAAO,EACL,gBAAgB,EAChB,KAAK,qBAAqB,EAC1B,KAAK,oBAAoB,EACzB,KAAK,mBAAmB,EACxB,KAAK,oBAAoB,EACzB,KAAK,oBAAoB,EACzB,KAAK,uBAAuB,GAC7B,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,KAAK,cAAc,EACnB,KAAK,wBAAwB,EAC7B,4BAA4B,GAC7B,MAAM,sBAAsB,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/** @module agent-protocol/acp
|
|
2
|
+
* Public barrel for the ACP (Agent Client Protocol) JSON-RPC subprocess
|
|
3
|
+
* transport. Re-exports the surface consumed by runtime adapter definitions
|
|
4
|
+
* (detectAcpModels, normalizeModels, ModelOption), a host's connection-test
|
|
5
|
+
* and chat-server entry points (attachAcpSession, buildAcpSessionNewParams,
|
|
6
|
+
* AcpMcpServerInput), and the account-failure injection seam
|
|
7
|
+
* (AccountFailure, AccountFailureClassifier, noopAccountFailureClassifier) a
|
|
8
|
+
* host application uses to plug in its own provider-specific classifier.
|
|
9
|
+
*/
|
|
10
|
+
export { buildAcpSessionNewParams } from './session-params.js';
|
|
11
|
+
export { normalizeModels, detectAcpModels } from './models.js';
|
|
12
|
+
export { attachAcpSession, } from './session.js';
|
|
13
|
+
export { noopAccountFailureClassifier, } from './account-failure.js';
|
|
14
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/agent-protocol/acp/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,EAA0B,wBAAwB,EAAE,MAAM,qBAAqB,CAAC;AACvF,OAAO,EAAoB,eAAe,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AACjF,OAAO,EACL,gBAAgB,GAOjB,MAAM,cAAc,CAAC;AACtB,OAAO,EAGL,4BAA4B,GAC7B,MAAM,sBAAsB,CAAC"}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
/** @module agent-protocol/acp/json
|
|
2
|
+
* Pure JSON value-extraction and text-traversal helpers for the ACP layer,
|
|
3
|
+
* plus the ACP timeout environment resolver. Has no side effects and
|
|
4
|
+
* performs no I/O; depends only on acp/types and acp/constants.
|
|
5
|
+
* Consumed by acp/rpc.ts, acp/session.ts, acp/models.ts, and acp/updates.ts.
|
|
6
|
+
*/
|
|
7
|
+
import type { JsonObject } from './types.js';
|
|
8
|
+
/** Default environment variable name `resolveAcpTimeoutMs` reads when the
|
|
9
|
+
* caller does not supply its own. A host application with its own branded
|
|
10
|
+
* env var naming convention should pass its own name explicitly rather than
|
|
11
|
+
* rely on this default. */
|
|
12
|
+
export declare const DEFAULT_ACP_TIMEOUT_ENV_VAR = "AGENT_RUNTIME_ACP_TIMEOUT_MS";
|
|
13
|
+
/**
|
|
14
|
+
* Extracts a human-readable error message from an unknown thrown value.
|
|
15
|
+
* Returns `err.message` for `Error` instances, `String(err)` otherwise.
|
|
16
|
+
*
|
|
17
|
+
* @param err - Any caught value (typically an `Error` but may be anything).
|
|
18
|
+
*/
|
|
19
|
+
export declare function errorMessage(err: unknown): string;
|
|
20
|
+
/**
|
|
21
|
+
* Resolves the effective ACP timeout from an environment variable, falling
|
|
22
|
+
* back to `fallbackMs` when the variable is absent or non-finite. Clamps the
|
|
23
|
+
* result to `[0, MAX_TIMEOUT_MS]`.
|
|
24
|
+
*
|
|
25
|
+
* @param env - The process environment object to read the timeout var from.
|
|
26
|
+
* @param fallbackMs - The default timeout to use when the env var is unset.
|
|
27
|
+
* @param envVarName - The environment variable name to read. Defaults to
|
|
28
|
+
* `DEFAULT_ACP_TIMEOUT_ENV_VAR`; a host application may pass its own
|
|
29
|
+
* branded name (its own `<PRODUCT>_ACP_TIMEOUT_MS`-style variable) here
|
|
30
|
+
* without this package hardcoding any one product's naming convention.
|
|
31
|
+
* @returns The resolved timeout in milliseconds.
|
|
32
|
+
*/
|
|
33
|
+
export declare function resolveAcpTimeoutMs(env: NodeJS.ProcessEnv, fallbackMs: number, envVarName?: string): number;
|
|
34
|
+
/**
|
|
35
|
+
* Coerces an unknown value to a `JsonObject` if it is a non-null, non-array
|
|
36
|
+
* plain object, or returns `null` otherwise. The primary guard used throughout
|
|
37
|
+
* the ACP layer before accessing named properties on parsed JSON frames.
|
|
38
|
+
*
|
|
39
|
+
* @param value - Any value from a JSON parse result.
|
|
40
|
+
* @returns The value cast as `JsonObject`, or `null` when the cast is unsafe.
|
|
41
|
+
*/
|
|
42
|
+
export declare function asObject(value: unknown): JsonObject | null;
|
|
43
|
+
/**
|
|
44
|
+
* Returns a short diagnostic string describing the JSON kind of `value`:
|
|
45
|
+
* `'array'`, `'null'`, or the result of `typeof`. Used to build
|
|
46
|
+
* `acp_raw_event_shape` diagnostics without touching the value.
|
|
47
|
+
*
|
|
48
|
+
* @param value - Any value from a parsed ACP update object.
|
|
49
|
+
*/
|
|
50
|
+
export declare function acpValueKind(value: unknown): string;
|
|
51
|
+
/**
|
|
52
|
+
* Returns a sorted array of own string keys from `value` if it is a
|
|
53
|
+
* `JsonObject`, or an empty array otherwise. Used to snapshot object
|
|
54
|
+
* structure for diagnostic payloads without risking a throw.
|
|
55
|
+
*
|
|
56
|
+
* @param value - Any value from a parsed ACP update object.
|
|
57
|
+
*/
|
|
58
|
+
export declare function objectKeys(value: unknown): string[];
|
|
59
|
+
/**
|
|
60
|
+
* Recursively traverses an ACP update value up to 4 levels deep and returns
|
|
61
|
+
* the first non-empty string found, checking common text-bearing keys in order:
|
|
62
|
+
* `text`, `delta`, `content`, `message`, `output`, `answer`, `value`, `body`,
|
|
63
|
+
* `parts`, `choices`. Handles string scalars, flat arrays, and nested objects.
|
|
64
|
+
*
|
|
65
|
+
* Used as the extraction primitive by `extractAcpUpdateText`.
|
|
66
|
+
*
|
|
67
|
+
* @param value - A value from a parsed ACP session update.
|
|
68
|
+
* @param depth - Current recursion depth (max 4); callers omit this.
|
|
69
|
+
* @returns The first non-empty string found, or `null` when none is present.
|
|
70
|
+
*/
|
|
71
|
+
export declare function extractAcpTextValue(value: unknown, depth?: number): string | null;
|
|
72
|
+
/**
|
|
73
|
+
* Extracts the first non-empty text string from the top-level properties of a
|
|
74
|
+
* parsed ACP session update object. Checks the same key list as
|
|
75
|
+
* `extractAcpTextValue` but at only one level of depth (the update object
|
|
76
|
+
* itself), delegating deep traversal to that helper.
|
|
77
|
+
*
|
|
78
|
+
* @param update - A parsed ACP `session/update` params object.
|
|
79
|
+
* @returns The first non-empty text string, or `null` when none is present.
|
|
80
|
+
*/
|
|
81
|
+
export declare function extractAcpUpdateText(update: JsonObject): string | null;
|
|
82
|
+
//# sourceMappingURL=json.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"json.d.ts","sourceRoot":"","sources":["../../../src/agent-protocol/acp/json.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAG7C;;;2BAG2B;AAC3B,eAAO,MAAM,2BAA2B,iCAAiC,CAAC;AAE1E;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,GAAG,EAAE,OAAO,GAAG,MAAM,CAEjD;AACD;;;;;;;;;;;;GAYG;AACH,wBAAgB,mBAAmB,CACjC,GAAG,EAAE,MAAM,CAAC,UAAU,EACtB,UAAU,EAAE,MAAM,EAClB,UAAU,GAAE,MAAoC,GAC/C,MAAM,CAIR;AACD;;;;;;;GAOG;AACH,wBAAgB,QAAQ,CAAC,KAAK,EAAE,OAAO,GAAG,UAAU,GAAG,IAAI,CAE1D;AACD;;;;;;GAMG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAInD;AACD;;;;;;GAMG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,EAAE,CAGnD;AACD;;;;;;;;;;;GAWG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,OAAO,EAAE,KAAK,SAAI,GAAG,MAAM,GAAG,IAAI,CA4B5E;AACD;;;;;;;;GAQG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,UAAU,GAAG,MAAM,GAAG,IAAI,CAiBtE"}
|