@saltpub/oar 0.121.1 → 0.122.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/README.md +51 -43
- package/assets/brands/NOTICE.md +7 -0
- package/assets/brands/cybion.svg +27 -0
- package/dist/capabilities.d.ts +12 -0
- package/dist/capabilities.d.ts.map +1 -0
- package/dist/capabilities.js +7 -0
- package/dist/capabilities.js.map +1 -0
- package/dist/community/cybion/index.d.ts.map +1 -1
- package/dist/community/cybion/index.js +10 -3
- package/dist/community/cybion/index.js.map +1 -1
- package/dist/community/cybion/refused-options.d.ts.map +1 -1
- package/dist/community/cybion/refused-options.js +2 -0
- package/dist/community/cybion/refused-options.js.map +1 -1
- package/dist/community/morph/index.js +1 -1
- package/dist/community/morph/index.js.map +1 -1
- package/dist/community/morph/projection.d.ts.map +1 -1
- package/dist/community/morph/projection.js +14 -2
- package/dist/community/morph/projection.js.map +1 -1
- package/dist/community/morph/session.d.ts.map +1 -1
- package/dist/community/morph/session.js +2 -0
- package/dist/community/morph/session.js.map +1 -1
- package/dist/community/morph/tracker.d.ts.map +1 -1
- package/dist/community/morph/tracker.js +18 -6
- package/dist/community/morph/tracker.js.map +1 -1
- package/dist/contracts/account-usage.d.ts +1 -1
- package/dist/contracts/account-usage.d.ts.map +1 -1
- package/dist/contracts/context-usage.d.ts +12 -0
- package/dist/contracts/context-usage.d.ts.map +1 -1
- package/dist/contracts/credentials.d.ts +61 -0
- package/dist/contracts/credentials.d.ts.map +1 -0
- package/dist/contracts/credentials.js +2 -0
- package/dist/contracts/credentials.js.map +1 -0
- package/dist/contracts/failure.d.ts +4 -1
- package/dist/contracts/failure.d.ts.map +1 -1
- package/dist/contracts/graph.d.ts +1 -1
- package/dist/contracts/graph.d.ts.map +1 -1
- package/dist/contracts/index.d.ts +7 -3
- package/dist/contracts/index.d.ts.map +1 -1
- package/dist/contracts/index.js.map +1 -1
- package/dist/contracts/installation.d.ts +27 -4
- package/dist/contracts/installation.d.ts.map +1 -1
- package/dist/contracts/login.d.ts +3 -1
- package/dist/contracts/login.d.ts.map +1 -1
- package/dist/contracts/model-request.d.ts +14 -0
- package/dist/contracts/model-request.d.ts.map +1 -0
- package/dist/contracts/model-request.js +2 -0
- package/dist/contracts/model-request.js.map +1 -0
- package/dist/contracts/orientation.d.ts +2 -1
- package/dist/contracts/orientation.d.ts.map +1 -1
- package/dist/contracts/records.d.ts +21 -12
- package/dist/contracts/records.d.ts.map +1 -1
- package/dist/contracts/runtime.d.ts +39 -52
- package/dist/contracts/runtime.d.ts.map +1 -1
- package/dist/contracts/runtime.js.map +1 -1
- package/dist/contracts/session-options.d.ts +46 -48
- package/dist/contracts/session-options.d.ts.map +1 -1
- package/dist/contracts/session.d.ts +9 -3
- package/dist/contracts/session.d.ts.map +1 -1
- package/dist/contracts/tasks.d.ts +4 -0
- package/dist/contracts/tasks.d.ts.map +1 -1
- package/dist/contracts/tool-output.d.ts +6 -0
- package/dist/contracts/tool-output.d.ts.map +1 -1
- package/dist/forms/fields.d.ts +6 -3
- package/dist/forms/fields.d.ts.map +1 -1
- package/dist/forms/fields.js +44 -5
- package/dist/forms/fields.js.map +1 -1
- package/dist/forms/map.d.ts.map +1 -1
- package/dist/forms/map.js +18 -14
- package/dist/forms/map.js.map +1 -1
- package/dist/forms/types.d.ts +1 -1
- package/dist/forms/types.d.ts.map +1 -1
- package/dist/forms/validate.d.ts.map +1 -1
- package/dist/forms/validate.js +8 -15
- package/dist/forms/validate.js.map +1 -1
- package/dist/mcp/serve-tools.js +1 -1
- package/dist/mcp/serve-tools.js.map +1 -1
- package/dist/observe/agent-status.js +1 -0
- package/dist/observe/agent-status.js.map +1 -1
- package/dist/observe/conversation.d.ts.map +1 -1
- package/dist/observe/conversation.js +2 -8
- package/dist/observe/conversation.js.map +1 -1
- package/dist/observe/cursor.d.ts +6 -0
- package/dist/observe/cursor.d.ts.map +1 -0
- package/dist/observe/cursor.js +19 -0
- package/dist/observe/cursor.js.map +1 -0
- package/dist/observe/display-text.d.ts.map +1 -1
- package/dist/observe/display-text.js +1 -0
- package/dist/observe/display-text.js.map +1 -1
- package/dist/observe/events.d.ts +1 -1
- package/dist/observe/events.d.ts.map +1 -1
- package/dist/observe/events.js +5 -3
- package/dist/observe/events.js.map +1 -1
- package/dist/observe/failure-advice.d.ts.map +1 -1
- package/dist/observe/failure-advice.js +1 -0
- package/dist/observe/failure-advice.js.map +1 -1
- package/dist/observe/graph.d.ts +2 -0
- package/dist/observe/graph.d.ts.map +1 -1
- package/dist/observe/graph.js +17 -1
- package/dist/observe/graph.js.map +1 -1
- package/dist/observe/index.d.ts +1 -0
- package/dist/observe/index.d.ts.map +1 -1
- package/dist/observe/index.js +1 -0
- package/dist/observe/index.js.map +1 -1
- package/dist/observe/mcp-startup.d.ts +7 -0
- package/dist/observe/mcp-startup.d.ts.map +1 -0
- package/dist/observe/mcp-startup.js +16 -0
- package/dist/observe/mcp-startup.js.map +1 -0
- package/dist/observe/session-view-events.d.ts.map +1 -1
- package/dist/observe/session-view-events.js +6 -6
- package/dist/observe/session-view-events.js.map +1 -1
- package/dist/observe/session-view-fold.d.ts +2 -0
- package/dist/observe/session-view-fold.d.ts.map +1 -1
- package/dist/observe/session-view-fold.js +4 -0
- package/dist/observe/session-view-fold.js.map +1 -1
- package/dist/observe/session-view-root.d.ts +8 -0
- package/dist/observe/session-view-root.d.ts.map +1 -0
- package/dist/observe/session-view-root.js +76 -0
- package/dist/observe/session-view-root.js.map +1 -0
- package/dist/observe/session-view-tools.d.ts +1 -1
- package/dist/observe/session-view-tools.d.ts.map +1 -1
- package/dist/observe/session-view-tools.js +1 -0
- package/dist/observe/session-view-tools.js.map +1 -1
- package/dist/observe/session-view.d.ts +10 -8
- package/dist/observe/session-view.d.ts.map +1 -1
- package/dist/observe/session-view.js +31 -31
- package/dist/observe/session-view.js.map +1 -1
- package/dist/observe/tasks.d.ts +3 -0
- package/dist/observe/tasks.d.ts.map +1 -1
- package/dist/observe/tasks.js +1 -1
- package/dist/observe/tasks.js.map +1 -1
- package/dist/observe/tool-activity.d.ts +2 -2
- package/dist/observe/tool-activity.d.ts.map +1 -1
- package/dist/observe/tool-activity.js +9 -2
- package/dist/observe/tool-activity.js.map +1 -1
- package/dist/observe/usage-totals.d.ts +0 -2
- package/dist/observe/usage-totals.d.ts.map +1 -1
- package/dist/observe/usage-totals.js +1 -15
- package/dist/observe/usage-totals.js.map +1 -1
- package/dist/observe/usage.js +2 -2
- package/dist/observe/usage.js.map +1 -1
- package/dist/runtimes/antigravity/account-usage.d.ts +5 -2
- package/dist/runtimes/antigravity/account-usage.d.ts.map +1 -1
- package/dist/runtimes/antigravity/account-usage.js +13 -9
- package/dist/runtimes/antigravity/account-usage.js.map +1 -1
- package/dist/runtimes/antigravity/account.d.ts +37 -0
- package/dist/runtimes/antigravity/account.d.ts.map +1 -0
- package/dist/runtimes/antigravity/account.js +119 -0
- package/dist/runtimes/antigravity/account.js.map +1 -0
- package/dist/runtimes/antigravity/auth-status.d.ts +9 -0
- package/dist/runtimes/antigravity/auth-status.d.ts.map +1 -0
- package/dist/runtimes/antigravity/auth-status.js +54 -0
- package/dist/runtimes/antigravity/auth-status.js.map +1 -0
- package/dist/runtimes/antigravity/auth.d.ts +2 -6
- package/dist/runtimes/antigravity/auth.d.ts.map +1 -1
- package/dist/runtimes/antigravity/auth.js +10 -50
- package/dist/runtimes/antigravity/auth.js.map +1 -1
- package/dist/runtimes/antigravity/index.d.ts +40 -3
- package/dist/runtimes/antigravity/index.d.ts.map +1 -1
- package/dist/runtimes/antigravity/index.js +19 -4
- package/dist/runtimes/antigravity/index.js.map +1 -1
- package/dist/runtimes/antigravity/installation.d.ts +6 -3
- package/dist/runtimes/antigravity/installation.d.ts.map +1 -1
- package/dist/runtimes/antigravity/installation.js +25 -30
- package/dist/runtimes/antigravity/installation.js.map +1 -1
- package/dist/runtimes/antigravity/logout.d.ts.map +1 -1
- package/dist/runtimes/antigravity/logout.js +2 -0
- package/dist/runtimes/antigravity/logout.js.map +1 -1
- package/dist/runtimes/antigravity/options.d.ts.map +1 -1
- package/dist/runtimes/antigravity/options.js +3 -0
- package/dist/runtimes/antigravity/options.js.map +1 -1
- package/dist/runtimes/antigravity/quota.d.ts +6 -1
- package/dist/runtimes/antigravity/quota.d.ts.map +1 -1
- package/dist/runtimes/antigravity/quota.js +47 -13
- package/dist/runtimes/antigravity/quota.js.map +1 -1
- package/dist/runtimes/antigravity/skill-files.d.ts.map +1 -1
- package/dist/runtimes/antigravity/skill-files.js +2 -1
- package/dist/runtimes/antigravity/skill-files.js.map +1 -1
- package/dist/runtimes/antigravity/token-email.d.ts +37 -0
- package/dist/runtimes/antigravity/token-email.d.ts.map +1 -0
- package/dist/runtimes/antigravity/token-email.js +155 -0
- package/dist/runtimes/antigravity/token-email.js.map +1 -0
- package/dist/runtimes/claude/account-usage.d.ts.map +1 -1
- package/dist/runtimes/claude/account-usage.js +30 -8
- package/dist/runtimes/claude/account-usage.js.map +1 -1
- package/dist/runtimes/claude/auth-status.d.ts.map +1 -1
- package/dist/runtimes/claude/auth-status.js +25 -4
- package/dist/runtimes/claude/auth-status.js.map +1 -1
- package/dist/runtimes/claude/context-usage.d.ts +8 -4
- package/dist/runtimes/claude/context-usage.d.ts.map +1 -1
- package/dist/runtimes/claude/context-usage.js +24 -4
- package/dist/runtimes/claude/context-usage.js.map +1 -1
- package/dist/runtimes/claude/credentials.d.ts +4 -0
- package/dist/runtimes/claude/credentials.d.ts.map +1 -0
- package/dist/runtimes/claude/credentials.js +79 -0
- package/dist/runtimes/claude/credentials.js.map +1 -0
- package/dist/runtimes/claude/failure.d.ts +4 -0
- package/dist/runtimes/claude/failure.d.ts.map +1 -1
- package/dist/runtimes/claude/failure.js +33 -18
- package/dist/runtimes/claude/failure.js.map +1 -1
- package/dist/runtimes/claude/index.d.ts +16 -3
- package/dist/runtimes/claude/index.d.ts.map +1 -1
- package/dist/runtimes/claude/index.js +13 -2
- package/dist/runtimes/claude/index.js.map +1 -1
- package/dist/runtimes/claude/installation.d.ts +1 -0
- package/dist/runtimes/claude/installation.d.ts.map +1 -1
- package/dist/runtimes/claude/installation.js +2 -1
- package/dist/runtimes/claude/installation.js.map +1 -1
- package/dist/runtimes/claude/inventory.js +1 -1
- package/dist/runtimes/claude/inventory.js.map +1 -1
- package/dist/runtimes/claude/last-account.d.ts +21 -0
- package/dist/runtimes/claude/last-account.d.ts.map +1 -1
- package/dist/runtimes/claude/last-account.js +58 -6
- package/dist/runtimes/claude/last-account.js.map +1 -1
- package/dist/runtimes/claude/launch-args.d.ts +3 -0
- package/dist/runtimes/claude/launch-args.d.ts.map +1 -1
- package/dist/runtimes/claude/launch-args.js +26 -8
- package/dist/runtimes/claude/launch-args.js.map +1 -1
- package/dist/runtimes/claude/launch.d.ts +1 -1
- package/dist/runtimes/claude/launch.d.ts.map +1 -1
- package/dist/runtimes/claude/launch.js +9 -6
- package/dist/runtimes/claude/launch.js.map +1 -1
- package/dist/runtimes/claude/list-models.js +1 -1
- package/dist/runtimes/claude/list-models.js.map +1 -1
- package/dist/runtimes/claude/login-url.d.ts +3 -0
- package/dist/runtimes/claude/login-url.d.ts.map +1 -0
- package/dist/runtimes/claude/login-url.js +26 -0
- package/dist/runtimes/claude/login-url.js.map +1 -0
- package/dist/runtimes/claude/login.d.ts.map +1 -1
- package/dist/runtimes/claude/login.js +17 -10
- package/dist/runtimes/claude/login.js.map +1 -1
- package/dist/runtimes/claude/mcp-config.d.ts +2 -6
- package/dist/runtimes/claude/mcp-config.d.ts.map +1 -1
- package/dist/runtimes/claude/mcp-config.js +7 -117
- package/dist/runtimes/claude/mcp-config.js.map +1 -1
- package/dist/runtimes/claude/model-request-files.d.ts +19 -0
- package/dist/runtimes/claude/model-request-files.d.ts.map +1 -0
- package/dist/runtimes/claude/model-request-files.js +104 -0
- package/dist/runtimes/claude/model-request-files.js.map +1 -0
- package/dist/runtimes/claude/model-requests.d.ts +16 -0
- package/dist/runtimes/claude/model-requests.d.ts.map +1 -0
- package/dist/runtimes/claude/model-requests.js +190 -0
- package/dist/runtimes/claude/model-requests.js.map +1 -0
- package/dist/runtimes/claude/open-settings.d.ts +2 -1
- package/dist/runtimes/claude/open-settings.d.ts.map +1 -1
- package/dist/runtimes/claude/open-settings.js +33 -9
- package/dist/runtimes/claude/open-settings.js.map +1 -1
- package/dist/runtimes/claude/options.d.ts +5 -0
- package/dist/runtimes/claude/options.d.ts.map +1 -1
- package/dist/runtimes/claude/options.js +25 -0
- package/dist/runtimes/claude/options.js.map +1 -1
- package/dist/runtimes/claude/projection.d.ts +2 -1
- package/dist/runtimes/claude/projection.d.ts.map +1 -1
- package/dist/runtimes/claude/projection.js +44 -16
- package/dist/runtimes/claude/projection.js.map +1 -1
- package/dist/runtimes/claude/session.d.ts.map +1 -1
- package/dist/runtimes/claude/session.js +30 -7
- package/dist/runtimes/claude/session.js.map +1 -1
- package/dist/runtimes/claude/side-question.js +1 -1
- package/dist/runtimes/claude/side-question.js.map +1 -1
- package/dist/runtimes/claude/update.d.ts +17 -9
- package/dist/runtimes/claude/update.d.ts.map +1 -1
- package/dist/runtimes/claude/update.js +154 -29
- package/dist/runtimes/claude/update.js.map +1 -1
- package/dist/runtimes/claude/user-configuration.d.ts.map +1 -1
- package/dist/runtimes/claude/user-configuration.js +13 -6
- package/dist/runtimes/claude/user-configuration.js.map +1 -1
- package/dist/runtimes/codebuddy/failure.d.ts.map +1 -1
- package/dist/runtimes/codebuddy/failure.js +18 -2
- package/dist/runtimes/codebuddy/failure.js.map +1 -1
- package/dist/runtimes/codebuddy/index.d.ts +60 -1
- package/dist/runtimes/codebuddy/index.d.ts.map +1 -1
- package/dist/runtimes/codebuddy/index.js +25 -1
- package/dist/runtimes/codebuddy/index.js.map +1 -1
- package/dist/runtimes/codebuddy/installation.d.ts.map +1 -1
- package/dist/runtimes/codebuddy/installation.js +5 -4
- package/dist/runtimes/codebuddy/installation.js.map +1 -1
- package/dist/runtimes/codebuddy/options.d.ts.map +1 -1
- package/dist/runtimes/codebuddy/options.js +11 -9
- package/dist/runtimes/codebuddy/options.js.map +1 -1
- package/dist/runtimes/codex/account-id.d.ts +14 -0
- package/dist/runtimes/codex/account-id.d.ts.map +1 -0
- package/dist/runtimes/codex/account-id.js +173 -0
- package/dist/runtimes/codex/account-id.js.map +1 -0
- package/dist/runtimes/codex/account-request.d.ts +1 -0
- package/dist/runtimes/codex/account-request.d.ts.map +1 -1
- package/dist/runtimes/codex/account-request.js +45 -16
- package/dist/runtimes/codex/account-request.js.map +1 -1
- package/dist/runtimes/codex/account-usage.d.ts.map +1 -1
- package/dist/runtimes/codex/account-usage.js +15 -13
- package/dist/runtimes/codex/account-usage.js.map +1 -1
- package/dist/runtimes/codex/app-server-client.d.ts +5 -1
- package/dist/runtimes/codex/app-server-client.d.ts.map +1 -1
- package/dist/runtimes/codex/app-server-client.js +7 -7
- package/dist/runtimes/codex/app-server-client.js.map +1 -1
- package/dist/runtimes/codex/failure.d.ts.map +1 -1
- package/dist/runtimes/codex/failure.js +14 -16
- package/dist/runtimes/codex/failure.js.map +1 -1
- package/dist/runtimes/codex/home-initialization.d.ts +1 -0
- package/dist/runtimes/codex/home-initialization.d.ts.map +1 -1
- package/dist/runtimes/codex/home-initialization.js +49 -58
- package/dist/runtimes/codex/home-initialization.js.map +1 -1
- package/dist/runtimes/codex/index.d.ts +64 -1
- package/dist/runtimes/codex/index.d.ts.map +1 -1
- package/dist/runtimes/codex/index.js +27 -1
- package/dist/runtimes/codex/index.js.map +1 -1
- package/dist/runtimes/codex/installation.d.ts +1 -0
- package/dist/runtimes/codex/installation.d.ts.map +1 -1
- package/dist/runtimes/codex/installation.js +9 -1
- package/dist/runtimes/codex/installation.js.map +1 -1
- package/dist/runtimes/codex/inventory.js +1 -1
- package/dist/runtimes/codex/inventory.js.map +1 -1
- package/dist/runtimes/codex/item-detail.d.ts +4 -0
- package/dist/runtimes/codex/item-detail.d.ts.map +1 -1
- package/dist/runtimes/codex/item-detail.js +39 -0
- package/dist/runtimes/codex/item-detail.js.map +1 -1
- package/dist/runtimes/codex/limit-reset.d.ts.map +1 -1
- package/dist/runtimes/codex/limit-reset.js +3 -2
- package/dist/runtimes/codex/limit-reset.js.map +1 -1
- package/dist/runtimes/codex/list-models.js +1 -1
- package/dist/runtimes/codex/list-models.js.map +1 -1
- package/dist/runtimes/codex/login.d.ts.map +1 -1
- package/dist/runtimes/codex/login.js +24 -10
- package/dist/runtimes/codex/login.js.map +1 -1
- package/dist/runtimes/codex/open-config.d.ts +6 -0
- package/dist/runtimes/codex/open-config.d.ts.map +1 -0
- package/dist/runtimes/codex/open-config.js +28 -0
- package/dist/runtimes/codex/open-config.js.map +1 -0
- package/dist/runtimes/codex/open.d.ts.map +1 -1
- package/dist/runtimes/codex/open.js +3 -2
- package/dist/runtimes/codex/open.js.map +1 -1
- package/dist/runtimes/codex/options.d.ts.map +1 -1
- package/dist/runtimes/codex/options.js +3 -0
- package/dist/runtimes/codex/options.js.map +1 -1
- package/dist/runtimes/codex/projection.d.ts.map +1 -1
- package/dist/runtimes/codex/projection.js +44 -40
- package/dist/runtimes/codex/projection.js.map +1 -1
- package/dist/runtimes/codex/refusal.d.ts +3 -3
- package/dist/runtimes/codex/refusal.js +3 -3
- package/dist/runtimes/codex/session.d.ts.map +1 -1
- package/dist/runtimes/codex/session.js +13 -6
- package/dist/runtimes/codex/session.js.map +1 -1
- package/dist/runtimes/codex/tasks.d.ts.map +1 -1
- package/dist/runtimes/codex/tasks.js +1 -0
- package/dist/runtimes/codex/tasks.js.map +1 -1
- package/dist/runtimes/codex/tool-denials.d.ts +0 -3
- package/dist/runtimes/codex/tool-denials.d.ts.map +1 -1
- package/dist/runtimes/codex/tool-denials.js +0 -8
- package/dist/runtimes/codex/tool-denials.js.map +1 -1
- package/dist/runtimes/cursor/access.d.ts +4 -3
- package/dist/runtimes/cursor/access.d.ts.map +1 -1
- package/dist/runtimes/cursor/access.js +12 -8
- package/dist/runtimes/cursor/access.js.map +1 -1
- package/dist/runtimes/cursor/auth-status.js +1 -1
- package/dist/runtimes/cursor/auth-status.js.map +1 -1
- package/dist/runtimes/cursor/failure.d.ts.map +1 -1
- package/dist/runtimes/cursor/failure.js +4 -6
- package/dist/runtimes/cursor/failure.js.map +1 -1
- package/dist/runtimes/cursor/index.d.ts.map +1 -1
- package/dist/runtimes/cursor/index.js +18 -5
- package/dist/runtimes/cursor/index.js.map +1 -1
- package/dist/runtimes/cursor/installation.d.ts +13 -9
- package/dist/runtimes/cursor/installation.d.ts.map +1 -1
- package/dist/runtimes/cursor/installation.js +29 -14
- package/dist/runtimes/cursor/installation.js.map +1 -1
- package/dist/runtimes/cursor/list-models.js +1 -1
- package/dist/runtimes/cursor/list-models.js.map +1 -1
- package/dist/runtimes/cursor/login.js +1 -1
- package/dist/runtimes/cursor/login.js.map +1 -1
- package/dist/runtimes/cursor/logout.js +1 -1
- package/dist/runtimes/cursor/logout.js.map +1 -1
- package/dist/runtimes/cursor/model.d.ts.map +1 -1
- package/dist/runtimes/cursor/model.js +7 -1
- package/dist/runtimes/cursor/model.js.map +1 -1
- package/dist/runtimes/cursor/run.d.ts +2 -0
- package/dist/runtimes/cursor/run.d.ts.map +1 -1
- package/dist/runtimes/cursor/run.js +31 -0
- package/dist/runtimes/cursor/run.js.map +1 -1
- package/dist/runtimes/cursor/session.d.ts +3 -1
- package/dist/runtimes/cursor/session.d.ts.map +1 -1
- package/dist/runtimes/cursor/session.js +29 -18
- package/dist/runtimes/cursor/session.js.map +1 -1
- package/dist/runtimes/cursor/subprocess/channel.d.ts +1 -1
- package/dist/runtimes/cursor/subprocess/channel.d.ts.map +1 -1
- package/dist/runtimes/cursor/subprocess/channel.js +7 -7
- package/dist/runtimes/cursor/subprocess/channel.js.map +1 -1
- package/dist/runtimes/devin/index.d.ts +19 -0
- package/dist/runtimes/devin/index.d.ts.map +1 -1
- package/dist/runtimes/devin/index.js +10 -1
- package/dist/runtimes/devin/index.js.map +1 -1
- package/dist/runtimes/devin/installation.d.ts.map +1 -1
- package/dist/runtimes/devin/installation.js +7 -2
- package/dist/runtimes/devin/installation.js.map +1 -1
- package/dist/runtimes/devin/options.d.ts.map +1 -1
- package/dist/runtimes/devin/options.js +4 -0
- package/dist/runtimes/devin/options.js.map +1 -1
- package/dist/runtimes/devin/session.d.ts.map +1 -1
- package/dist/runtimes/devin/session.js +2 -0
- package/dist/runtimes/devin/session.js.map +1 -1
- package/dist/runtimes/dsh/bridge-controls.d.ts.map +1 -1
- package/dist/runtimes/dsh/bridge-controls.js +21 -0
- package/dist/runtimes/dsh/bridge-controls.js.map +1 -1
- package/dist/runtimes/dsh/bridge-goal.d.ts.map +1 -1
- package/dist/runtimes/dsh/bridge-goal.js +9 -5
- package/dist/runtimes/dsh/bridge-goal.js.map +1 -1
- package/dist/runtimes/dsh/bridge-input.d.ts.map +1 -1
- package/dist/runtimes/dsh/bridge-input.js +29 -3
- package/dist/runtimes/dsh/bridge-input.js.map +1 -1
- package/dist/runtimes/dsh/bridge.d.ts +1 -1
- package/dist/runtimes/dsh/bridge.d.ts.map +1 -1
- package/dist/runtimes/dsh/bridge.js +43 -8
- package/dist/runtimes/dsh/bridge.js.map +1 -1
- package/dist/runtimes/dsh/control.d.ts +3 -1
- package/dist/runtimes/dsh/control.d.ts.map +1 -1
- package/dist/runtimes/dsh/control.js +20 -6
- package/dist/runtimes/dsh/control.js.map +1 -1
- package/dist/runtimes/dsh/index.d.ts +36 -1
- package/dist/runtimes/dsh/index.d.ts.map +1 -1
- package/dist/runtimes/dsh/index.js +19 -3
- package/dist/runtimes/dsh/index.js.map +1 -1
- package/dist/runtimes/dsh/installation.d.ts +2 -3
- package/dist/runtimes/dsh/installation.d.ts.map +1 -1
- package/dist/runtimes/dsh/installation.js +11 -11
- package/dist/runtimes/dsh/installation.js.map +1 -1
- package/dist/runtimes/dsh/launch.d.ts +9 -1
- package/dist/runtimes/dsh/launch.d.ts.map +1 -1
- package/dist/runtimes/dsh/launch.js +22 -4
- package/dist/runtimes/dsh/launch.js.map +1 -1
- package/dist/runtimes/dsh/list-models.d.ts +3 -1
- package/dist/runtimes/dsh/list-models.d.ts.map +1 -1
- package/dist/runtimes/dsh/list-models.js +38 -11
- package/dist/runtimes/dsh/list-models.js.map +1 -1
- package/dist/runtimes/dsh/options.d.ts +6 -0
- package/dist/runtimes/dsh/options.d.ts.map +1 -1
- package/dist/runtimes/dsh/options.js +17 -1
- package/dist/runtimes/dsh/options.js.map +1 -1
- package/dist/runtimes/dsh/profile-startup.d.ts +12 -0
- package/dist/runtimes/dsh/profile-startup.d.ts.map +1 -0
- package/dist/runtimes/dsh/profile-startup.js +64 -0
- package/dist/runtimes/dsh/profile-startup.js.map +1 -0
- package/dist/runtimes/dsh/projection.d.ts +2 -0
- package/dist/runtimes/dsh/projection.d.ts.map +1 -1
- package/dist/runtimes/dsh/projection.js +35 -22
- package/dist/runtimes/dsh/projection.js.map +1 -1
- package/dist/runtimes/dsh/session.d.ts.map +1 -1
- package/dist/runtimes/dsh/session.js +76 -15
- package/dist/runtimes/dsh/session.js.map +1 -1
- package/dist/runtimes/dsh/skills.d.ts.map +1 -1
- package/dist/runtimes/dsh/skills.js +7 -5
- package/dist/runtimes/dsh/skills.js.map +1 -1
- package/dist/runtimes/factory/account-credential.d.ts +2 -1
- package/dist/runtimes/factory/account-credential.d.ts.map +1 -1
- package/dist/runtimes/factory/account-credential.js +5 -2
- package/dist/runtimes/factory/account-credential.js.map +1 -1
- package/dist/runtimes/factory/account-usage.d.ts.map +1 -1
- package/dist/runtimes/factory/account-usage.js +6 -3
- package/dist/runtimes/factory/account-usage.js.map +1 -1
- package/dist/runtimes/factory/account.d.ts.map +1 -1
- package/dist/runtimes/factory/account.js +4 -3
- package/dist/runtimes/factory/account.js.map +1 -1
- package/dist/runtimes/factory/client.d.ts.map +1 -1
- package/dist/runtimes/factory/client.js +3 -8
- package/dist/runtimes/factory/client.js.map +1 -1
- package/dist/runtimes/factory/compaction.d.ts +1 -1
- package/dist/runtimes/factory/compaction.d.ts.map +1 -1
- package/dist/runtimes/factory/compaction.js +62 -48
- package/dist/runtimes/factory/compaction.js.map +1 -1
- package/dist/runtimes/factory/context-usage.d.ts +15 -0
- package/dist/runtimes/factory/context-usage.d.ts.map +1 -0
- package/dist/runtimes/factory/context-usage.js +75 -0
- package/dist/runtimes/factory/context-usage.js.map +1 -0
- package/dist/runtimes/factory/index.d.ts +60 -0
- package/dist/runtimes/factory/index.d.ts.map +1 -1
- package/dist/runtimes/factory/index.js +21 -1
- package/dist/runtimes/factory/index.js.map +1 -1
- package/dist/runtimes/factory/installation.d.ts +1 -1
- package/dist/runtimes/factory/installation.d.ts.map +1 -1
- package/dist/runtimes/factory/installation.js +2 -2
- package/dist/runtimes/factory/installation.js.map +1 -1
- package/dist/runtimes/factory/options.d.ts.map +1 -1
- package/dist/runtimes/factory/options.js +6 -8
- package/dist/runtimes/factory/options.js.map +1 -1
- package/dist/runtimes/factory/projection.d.ts.map +1 -1
- package/dist/runtimes/factory/projection.js +31 -11
- package/dist/runtimes/factory/projection.js.map +1 -1
- package/dist/runtimes/factory/session-state.d.ts +9 -0
- package/dist/runtimes/factory/session-state.d.ts.map +1 -1
- package/dist/runtimes/factory/session-state.js +27 -0
- package/dist/runtimes/factory/session-state.js.map +1 -1
- package/dist/runtimes/factory/session.d.ts.map +1 -1
- package/dist/runtimes/factory/session.js +93 -46
- package/dist/runtimes/factory/session.js.map +1 -1
- package/dist/runtimes/grok/account-usage.d.ts.map +1 -1
- package/dist/runtimes/grok/account-usage.js +8 -6
- package/dist/runtimes/grok/account-usage.js.map +1 -1
- package/dist/runtimes/grok/failure.d.ts.map +1 -1
- package/dist/runtimes/grok/failure.js +12 -8
- package/dist/runtimes/grok/failure.js.map +1 -1
- package/dist/runtimes/grok/index.d.ts +32 -4
- package/dist/runtimes/grok/index.d.ts.map +1 -1
- package/dist/runtimes/grok/index.js +15 -2
- package/dist/runtimes/grok/index.js.map +1 -1
- package/dist/runtimes/grok/installation.d.ts +1 -0
- package/dist/runtimes/grok/installation.d.ts.map +1 -1
- package/dist/runtimes/grok/installation.js +8 -1
- package/dist/runtimes/grok/installation.js.map +1 -1
- package/dist/runtimes/grok/mcp-startup.d.ts +5 -0
- package/dist/runtimes/grok/mcp-startup.d.ts.map +1 -0
- package/dist/runtimes/grok/mcp-startup.js +80 -0
- package/dist/runtimes/grok/mcp-startup.js.map +1 -0
- package/dist/runtimes/grok/options.d.ts +3 -1
- package/dist/runtimes/grok/options.d.ts.map +1 -1
- package/dist/runtimes/grok/options.js +12 -0
- package/dist/runtimes/grok/options.js.map +1 -1
- package/dist/runtimes/grok/session.d.ts.map +1 -1
- package/dist/runtimes/grok/session.js +2 -0
- package/dist/runtimes/grok/session.js.map +1 -1
- package/dist/runtimes/grok/tasks.d.ts.map +1 -1
- package/dist/runtimes/grok/tasks.js +3 -1
- package/dist/runtimes/grok/tasks.js.map +1 -1
- package/dist/runtimes/kimi/account-usage.d.ts.map +1 -1
- package/dist/runtimes/kimi/account-usage.js +5 -3
- package/dist/runtimes/kimi/account-usage.js.map +1 -1
- package/dist/runtimes/kimi/index.d.ts +56 -7
- package/dist/runtimes/kimi/index.d.ts.map +1 -1
- package/dist/runtimes/kimi/index.js +21 -3
- package/dist/runtimes/kimi/index.js.map +1 -1
- package/dist/runtimes/kimi/installation.d.ts.map +1 -1
- package/dist/runtimes/kimi/installation.js +5 -1
- package/dist/runtimes/kimi/installation.js.map +1 -1
- package/dist/runtimes/kimi/kap-boot.d.ts +16 -0
- package/dist/runtimes/kimi/kap-boot.d.ts.map +1 -0
- package/dist/runtimes/kimi/kap-boot.js +28 -0
- package/dist/runtimes/kimi/kap-boot.js.map +1 -0
- package/dist/runtimes/kimi/kap-compaction.d.ts +12 -0
- package/dist/runtimes/kimi/kap-compaction.d.ts.map +1 -0
- package/dist/runtimes/kimi/kap-compaction.js +63 -0
- package/dist/runtimes/kimi/kap-compaction.js.map +1 -0
- package/dist/runtimes/kimi/kap-controls.d.ts +48 -0
- package/dist/runtimes/kimi/kap-controls.d.ts.map +1 -0
- package/dist/runtimes/kimi/kap-controls.js +263 -0
- package/dist/runtimes/kimi/kap-controls.js.map +1 -0
- package/dist/runtimes/kimi/kap-dispatch.d.ts +10 -0
- package/dist/runtimes/kimi/kap-dispatch.d.ts.map +1 -0
- package/dist/runtimes/kimi/kap-dispatch.js +146 -0
- package/dist/runtimes/kimi/kap-dispatch.js.map +1 -0
- package/dist/runtimes/kimi/kap-errors.d.ts +24 -0
- package/dist/runtimes/kimi/kap-errors.d.ts.map +1 -0
- package/dist/runtimes/kimi/kap-errors.js +173 -0
- package/dist/runtimes/kimi/kap-errors.js.map +1 -0
- package/dist/runtimes/kimi/kap-failures.d.ts +12 -0
- package/dist/runtimes/kimi/kap-failures.d.ts.map +1 -0
- package/dist/runtimes/kimi/kap-failures.js +177 -0
- package/dist/runtimes/kimi/kap-failures.js.map +1 -0
- package/dist/runtimes/kimi/kap-items.d.ts +10 -0
- package/dist/runtimes/kimi/kap-items.d.ts.map +1 -0
- package/dist/runtimes/kimi/kap-items.js +201 -0
- package/dist/runtimes/kimi/kap-items.js.map +1 -0
- package/dist/runtimes/kimi/kap-negotiate.d.ts +9 -0
- package/dist/runtimes/kimi/kap-negotiate.d.ts.map +1 -0
- package/dist/runtimes/kimi/kap-negotiate.js +83 -0
- package/dist/runtimes/kimi/kap-negotiate.js.map +1 -0
- package/dist/runtimes/kimi/kap-open.d.ts +25 -0
- package/dist/runtimes/kimi/kap-open.d.ts.map +1 -0
- package/dist/runtimes/kimi/kap-open.js +130 -0
- package/dist/runtimes/kimi/kap-open.js.map +1 -0
- package/dist/runtimes/kimi/kap-projection-state.d.ts +68 -0
- package/dist/runtimes/kimi/kap-projection-state.d.ts.map +1 -0
- package/dist/runtimes/kimi/kap-projection-state.js +61 -0
- package/dist/runtimes/kimi/kap-projection-state.js.map +1 -0
- package/dist/runtimes/kimi/kap-projection.d.ts +6 -0
- package/dist/runtimes/kimi/kap-projection.d.ts.map +1 -0
- package/dist/runtimes/kimi/kap-projection.js +223 -0
- package/dist/runtimes/kimi/kap-projection.js.map +1 -0
- package/dist/runtimes/kimi/kap-protocol.d.ts +46 -0
- package/dist/runtimes/kimi/kap-protocol.d.ts.map +1 -0
- package/dist/runtimes/kimi/kap-protocol.js +220 -0
- package/dist/runtimes/kimi/kap-protocol.js.map +1 -0
- package/dist/runtimes/kimi/kap-session.d.ts +11 -0
- package/dist/runtimes/kimi/kap-session.d.ts.map +1 -0
- package/dist/runtimes/kimi/kap-session.js +116 -0
- package/dist/runtimes/kimi/kap-session.js.map +1 -0
- package/dist/runtimes/kimi/kap-socket.d.ts +11 -0
- package/dist/runtimes/kimi/kap-socket.d.ts.map +1 -0
- package/dist/runtimes/kimi/kap-socket.js +147 -0
- package/dist/runtimes/kimi/kap-socket.js.map +1 -0
- package/dist/runtimes/kimi/kap-turns.d.ts +12 -0
- package/dist/runtimes/kimi/kap-turns.d.ts.map +1 -0
- package/dist/runtimes/kimi/kap-turns.js +168 -0
- package/dist/runtimes/kimi/kap-turns.js.map +1 -0
- package/dist/runtimes/kimi/native-usage.d.ts.map +1 -1
- package/dist/runtimes/kimi/native-usage.js +4 -3
- package/dist/runtimes/kimi/native-usage.js.map +1 -1
- package/dist/runtimes/kimi/options.d.ts +5 -1
- package/dist/runtimes/kimi/options.d.ts.map +1 -1
- package/dist/runtimes/kimi/options.js +45 -2
- package/dist/runtimes/kimi/options.js.map +1 -1
- package/dist/runtimes/kimi/session.d.ts.map +1 -1
- package/dist/runtimes/kimi/session.js +15 -3
- package/dist/runtimes/kimi/session.js.map +1 -1
- package/dist/runtimes/kimi/version.d.ts +5 -0
- package/dist/runtimes/kimi/version.d.ts.map +1 -0
- package/dist/runtimes/kimi/version.js +12 -0
- package/dist/runtimes/kimi/version.js.map +1 -0
- package/dist/runtimes/kimi/web-startup.d.ts.map +1 -1
- package/dist/runtimes/kimi/web-startup.js +4 -18
- package/dist/runtimes/kimi/web-startup.js.map +1 -1
- package/dist/runtimes/omp/index.d.ts +4 -0
- package/dist/runtimes/omp/index.d.ts.map +1 -1
- package/dist/runtimes/omp/index.js +1 -0
- package/dist/runtimes/omp/index.js.map +1 -1
- package/dist/runtimes/omp/installation.d.ts.map +1 -1
- package/dist/runtimes/omp/installation.js +3 -0
- package/dist/runtimes/omp/installation.js.map +1 -1
- package/dist/runtimes/opencode/failure.js +6 -6
- package/dist/runtimes/opencode/failure.js.map +1 -1
- package/dist/runtimes/opencode/index.d.ts +120 -5
- package/dist/runtimes/opencode/index.d.ts.map +1 -1
- package/dist/runtimes/opencode/index.js +34 -4
- package/dist/runtimes/opencode/index.js.map +1 -1
- package/dist/runtimes/opencode/inline-prompt-config.d.ts +5 -0
- package/dist/runtimes/opencode/inline-prompt-config.d.ts.map +1 -0
- package/dist/runtimes/opencode/inline-prompt-config.js +82 -0
- package/dist/runtimes/opencode/inline-prompt-config.js.map +1 -0
- package/dist/runtimes/opencode/installation.d.ts +8 -0
- package/dist/runtimes/opencode/installation.d.ts.map +1 -1
- package/dist/runtimes/opencode/installation.js +26 -1
- package/dist/runtimes/opencode/installation.js.map +1 -1
- package/dist/runtimes/opencode/options.d.ts +5 -1
- package/dist/runtimes/opencode/options.d.ts.map +1 -1
- package/dist/runtimes/opencode/options.js +45 -1
- package/dist/runtimes/opencode/options.js.map +1 -1
- package/dist/runtimes/opencode/prompt-config-v2.d.ts.map +1 -1
- package/dist/runtimes/opencode/prompt-config-v2.js +23 -31
- package/dist/runtimes/opencode/prompt-config-v2.js.map +1 -1
- package/dist/runtimes/opencode/prompt-config.d.ts +2 -1
- package/dist/runtimes/opencode/prompt-config.d.ts.map +1 -1
- package/dist/runtimes/opencode/prompt-config.js +45 -23
- package/dist/runtimes/opencode/prompt-config.js.map +1 -1
- package/dist/runtimes/opencode/session.d.ts.map +1 -1
- package/dist/runtimes/opencode/session.js +1 -0
- package/dist/runtimes/opencode/session.js.map +1 -1
- package/dist/runtimes/opencode/shared-session.d.ts.map +1 -1
- package/dist/runtimes/opencode/shared-session.js +3 -0
- package/dist/runtimes/opencode/shared-session.js.map +1 -1
- package/dist/runtimes/opencode/upgrade.d.ts +4 -0
- package/dist/runtimes/opencode/upgrade.d.ts.map +1 -0
- package/dist/runtimes/opencode/upgrade.js +21 -0
- package/dist/runtimes/opencode/upgrade.js.map +1 -0
- package/dist/runtimes/opencode/version.d.ts +5 -0
- package/dist/runtimes/opencode/version.d.ts.map +1 -1
- package/dist/runtimes/opencode/version.js +14 -1
- package/dist/runtimes/opencode/version.js.map +1 -1
- package/dist/runtimes/pi/auth.d.ts +30 -7
- package/dist/runtimes/pi/auth.d.ts.map +1 -1
- package/dist/runtimes/pi/auth.js +2 -0
- package/dist/runtimes/pi/auth.js.map +1 -1
- package/dist/runtimes/pi/catalog.d.ts +1 -1
- package/dist/runtimes/pi/catalog.d.ts.map +1 -1
- package/dist/runtimes/pi/catalog.js.map +1 -1
- package/dist/runtimes/pi/credential-shape.d.ts +9 -0
- package/dist/runtimes/pi/credential-shape.d.ts.map +1 -0
- package/dist/runtimes/pi/credential-shape.js +85 -0
- package/dist/runtimes/pi/credential-shape.js.map +1 -0
- package/dist/runtimes/pi/facade-runtime.d.ts +1 -7
- package/dist/runtimes/pi/facade-runtime.d.ts.map +1 -1
- package/dist/runtimes/pi/facade-runtime.js.map +1 -1
- package/dist/runtimes/pi/failure.d.ts.map +1 -1
- package/dist/runtimes/pi/failure.js.map +1 -1
- package/dist/runtimes/pi/index.d.ts.map +1 -1
- package/dist/runtimes/pi/index.js +3 -1
- package/dist/runtimes/pi/index.js.map +1 -1
- package/dist/runtimes/pi/input-disposition.d.ts +1 -1
- package/dist/runtimes/pi/input-disposition.d.ts.map +1 -1
- package/dist/runtimes/pi/installation.d.ts +15 -3
- package/dist/runtimes/pi/installation.d.ts.map +1 -1
- package/dist/runtimes/pi/installation.js +101 -59
- package/dist/runtimes/pi/installation.js.map +1 -1
- package/dist/runtimes/pi/inventory.d.ts.map +1 -1
- package/dist/runtimes/pi/inventory.js +5 -2
- package/dist/runtimes/pi/inventory.js.map +1 -1
- package/dist/runtimes/pi/list-models.d.ts +3 -2
- package/dist/runtimes/pi/list-models.d.ts.map +1 -1
- package/dist/runtimes/pi/list-models.js +12 -2
- package/dist/runtimes/pi/list-models.js.map +1 -1
- package/dist/runtimes/pi/model-projection.d.ts +2 -0
- package/dist/runtimes/pi/model-projection.d.ts.map +1 -1
- package/dist/runtimes/pi/model-projection.js.map +1 -1
- package/dist/runtimes/pi/model-requests.d.ts +9 -0
- package/dist/runtimes/pi/model-requests.d.ts.map +1 -0
- package/dist/runtimes/pi/model-requests.js +76 -0
- package/dist/runtimes/pi/model-requests.js.map +1 -0
- package/dist/runtimes/pi/open.d.ts.map +1 -1
- package/dist/runtimes/pi/open.js +13 -28
- package/dist/runtimes/pi/open.js.map +1 -1
- package/dist/runtimes/pi/options.d.ts +7 -0
- package/dist/runtimes/pi/options.d.ts.map +1 -1
- package/dist/runtimes/pi/options.js.map +1 -1
- package/dist/runtimes/pi/projection.d.ts.map +1 -1
- package/dist/runtimes/pi/projection.js +11 -4
- package/dist/runtimes/pi/projection.js.map +1 -1
- package/dist/runtimes/pi/rpc/control.d.ts +1 -1
- package/dist/runtimes/pi/rpc/control.d.ts.map +1 -1
- package/dist/runtimes/pi/rpc/control.js +6 -4
- package/dist/runtimes/pi/rpc/control.js.map +1 -1
- package/dist/runtimes/pi/rpc/extension.d.ts.map +1 -1
- package/dist/runtimes/pi/rpc/extension.js +15 -2
- package/dist/runtimes/pi/rpc/extension.js.map +1 -1
- package/dist/runtimes/pi/rpc/open.d.ts.map +1 -1
- package/dist/runtimes/pi/rpc/open.js +11 -6
- package/dist/runtimes/pi/rpc/open.js.map +1 -1
- package/dist/runtimes/pi/rpc/prompt-files.d.ts.map +1 -1
- package/dist/runtimes/pi/rpc/prompt-files.js +14 -5
- package/dist/runtimes/pi/rpc/prompt-files.js.map +1 -1
- package/dist/runtimes/pi/rpc/readers.d.ts.map +1 -1
- package/dist/runtimes/pi/rpc/readers.js +2 -0
- package/dist/runtimes/pi/rpc/readers.js.map +1 -1
- package/dist/runtimes/pi/rpc/session.d.ts.map +1 -1
- package/dist/runtimes/pi/rpc/session.js +18 -12
- package/dist/runtimes/pi/rpc/session.js.map +1 -1
- package/dist/runtimes/pi/session.d.ts.map +1 -1
- package/dist/runtimes/pi/session.js +15 -7
- package/dist/runtimes/pi/session.js.map +1 -1
- package/dist/runtimes/pi/side-question.js +1 -1
- package/dist/runtimes/pi/side-question.js.map +1 -1
- package/dist/runtimes/pi-durable/index.d.ts.map +1 -1
- package/dist/runtimes/pi-durable/index.js +8 -1
- package/dist/runtimes/pi-durable/index.js.map +1 -1
- package/dist/runtimes/pi-durable/options.d.ts.map +1 -1
- package/dist/runtimes/pi-durable/options.js +3 -0
- package/dist/runtimes/pi-durable/options.js.map +1 -1
- package/dist/runtimes/pi-durable/projection.d.ts +4 -2
- package/dist/runtimes/pi-durable/projection.d.ts.map +1 -1
- package/dist/runtimes/pi-durable/projection.js +19 -4
- package/dist/runtimes/pi-durable/projection.js.map +1 -1
- package/dist/runtimes/pi-durable/session.d.ts.map +1 -1
- package/dist/runtimes/pi-durable/session.js +164 -23
- package/dist/runtimes/pi-durable/session.js.map +1 -1
- package/dist/runtimes/qoder/daemon.d.ts +2 -1
- package/dist/runtimes/qoder/daemon.d.ts.map +1 -1
- package/dist/runtimes/qoder/daemon.js +13 -7
- package/dist/runtimes/qoder/daemon.js.map +1 -1
- package/dist/runtimes/qoder/index.d.ts +25 -1
- package/dist/runtimes/qoder/index.d.ts.map +1 -1
- package/dist/runtimes/qoder/index.js +14 -1
- package/dist/runtimes/qoder/index.js.map +1 -1
- package/dist/runtimes/qoder/installation.d.ts +2 -2
- package/dist/runtimes/qoder/installation.d.ts.map +1 -1
- package/dist/runtimes/qoder/installation.js +10 -17
- package/dist/runtimes/qoder/installation.js.map +1 -1
- package/dist/runtimes/qoder/launch.d.ts +4 -4
- package/dist/runtimes/qoder/launch.d.ts.map +1 -1
- package/dist/runtimes/qoder/launch.js +24 -31
- package/dist/runtimes/qoder/launch.js.map +1 -1
- package/dist/runtimes/qoder/list-models.d.ts.map +1 -1
- package/dist/runtimes/qoder/list-models.js +22 -14
- package/dist/runtimes/qoder/list-models.js.map +1 -1
- package/dist/runtimes/qoder/mcp-config.d.ts +13 -0
- package/dist/runtimes/qoder/mcp-config.d.ts.map +1 -0
- package/dist/runtimes/qoder/mcp-config.js +22 -0
- package/dist/runtimes/qoder/mcp-config.js.map +1 -0
- package/dist/runtimes/qoder/options.d.ts.map +1 -1
- package/dist/runtimes/qoder/options.js +16 -10
- package/dist/runtimes/qoder/options.js.map +1 -1
- package/dist/runtimes/qoder/projection.d.ts.map +1 -1
- package/dist/runtimes/qoder/projection.js +5 -3
- package/dist/runtimes/qoder/projection.js.map +1 -1
- package/dist/runtimes/qoder/protocol.d.ts +3 -1
- package/dist/runtimes/qoder/protocol.d.ts.map +1 -1
- package/dist/runtimes/qoder/protocol.js +6 -4
- package/dist/runtimes/qoder/protocol.js.map +1 -1
- package/dist/runtimes/qoder/session.d.ts.map +1 -1
- package/dist/runtimes/qoder/session.js +8 -4
- package/dist/runtimes/qoder/session.js.map +1 -1
- package/dist/runtimes/qwen/control.d.ts +1 -1
- package/dist/runtimes/qwen/control.d.ts.map +1 -1
- package/dist/runtimes/qwen/control.js +3 -5
- package/dist/runtimes/qwen/control.js.map +1 -1
- package/dist/runtimes/qwen/credentials.d.ts +7 -0
- package/dist/runtimes/qwen/credentials.d.ts.map +1 -0
- package/dist/runtimes/qwen/credentials.js +47 -0
- package/dist/runtimes/qwen/credentials.js.map +1 -0
- package/dist/runtimes/qwen/index.d.ts +10 -9
- package/dist/runtimes/qwen/index.d.ts.map +1 -1
- package/dist/runtimes/qwen/index.js +21 -2
- package/dist/runtimes/qwen/index.js.map +1 -1
- package/dist/runtimes/qwen/installation.d.ts +1 -0
- package/dist/runtimes/qwen/installation.d.ts.map +1 -1
- package/dist/runtimes/qwen/installation.js +2 -1
- package/dist/runtimes/qwen/installation.js.map +1 -1
- package/dist/runtimes/qwen/launch.d.ts +3 -1
- package/dist/runtimes/qwen/launch.d.ts.map +1 -1
- package/dist/runtimes/qwen/launch.js +27 -16
- package/dist/runtimes/qwen/launch.js.map +1 -1
- package/dist/runtimes/qwen/list-models.js +2 -2
- package/dist/runtimes/qwen/list-models.js.map +1 -1
- package/dist/runtimes/qwen/native-memory.d.ts +17 -0
- package/dist/runtimes/qwen/native-memory.d.ts.map +1 -0
- package/dist/runtimes/qwen/native-memory.js +252 -0
- package/dist/runtimes/qwen/native-memory.js.map +1 -0
- package/dist/runtimes/qwen/options.d.ts +2 -0
- package/dist/runtimes/qwen/options.d.ts.map +1 -1
- package/dist/runtimes/qwen/options.js +20 -17
- package/dist/runtimes/qwen/options.js.map +1 -1
- package/dist/runtimes/qwen/projection.d.ts.map +1 -1
- package/dist/runtimes/qwen/projection.js +2 -1
- package/dist/runtimes/qwen/projection.js.map +1 -1
- package/dist/runtimes/qwen/session.d.ts.map +1 -1
- package/dist/runtimes/qwen/session.js +16 -7
- package/dist/runtimes/qwen/session.js.map +1 -1
- package/dist/shared/acp/effort.d.ts.map +1 -1
- package/dist/shared/acp/effort.js +5 -0
- package/dist/shared/acp/effort.js.map +1 -1
- package/dist/shared/acp/errors.d.ts +1 -1
- package/dist/shared/acp/errors.d.ts.map +1 -1
- package/dist/shared/acp/errors.js +3 -10
- package/dist/shared/acp/errors.js.map +1 -1
- package/dist/shared/acp/failure.js +5 -5
- package/dist/shared/acp/open-readiness.d.ts +15 -0
- package/dist/shared/acp/open-readiness.d.ts.map +1 -0
- package/dist/shared/acp/open-readiness.js +11 -0
- package/dist/shared/acp/open-readiness.js.map +1 -0
- package/dist/shared/acp/process.d.ts +5 -1
- package/dist/shared/acp/process.d.ts.map +1 -1
- package/dist/shared/acp/process.js +18 -5
- package/dist/shared/acp/process.js.map +1 -1
- package/dist/shared/acp/profile.d.ts +7 -4
- package/dist/shared/acp/profile.d.ts.map +1 -1
- package/dist/shared/acp/profile.js +42 -22
- package/dist/shared/acp/profile.js.map +1 -1
- package/dist/shared/acp/projection.d.ts.map +1 -1
- package/dist/shared/acp/projection.js +8 -3
- package/dist/shared/acp/projection.js.map +1 -1
- package/dist/shared/acp/routing-types.d.ts +3 -1
- package/dist/shared/acp/routing-types.d.ts.map +1 -1
- package/dist/shared/acp/routing.d.ts.map +1 -1
- package/dist/shared/acp/routing.js +5 -3
- package/dist/shared/acp/routing.js.map +1 -1
- package/dist/shared/acp/session-state.d.ts +2 -1
- package/dist/shared/acp/session-state.d.ts.map +1 -1
- package/dist/shared/acp/session-state.js +3 -1
- package/dist/shared/acp/session-state.js.map +1 -1
- package/dist/shared/acp/session.d.ts.map +1 -1
- package/dist/shared/acp/session.js +98 -52
- package/dist/shared/acp/session.js.map +1 -1
- package/dist/shared/acp/shared-session.d.ts.map +1 -1
- package/dist/shared/acp/shared-session.js +18 -6
- package/dist/shared/acp/shared-session.js.map +1 -1
- package/dist/shared/acp/turns.d.ts +1 -1
- package/dist/shared/acp/turns.d.ts.map +1 -1
- package/dist/shared/acp/turns.js +14 -12
- package/dist/shared/acp/turns.js.map +1 -1
- package/dist/shared/credential-redactor.d.ts +8 -0
- package/dist/shared/credential-redactor.d.ts.map +1 -1
- package/dist/shared/credential-redactor.js +22 -0
- package/dist/shared/credential-redactor.js.map +1 -1
- package/dist/shared/executable/close.d.ts +7 -0
- package/dist/shared/executable/close.d.ts.map +1 -0
- package/dist/shared/executable/close.js +26 -0
- package/dist/shared/executable/close.js.map +1 -0
- package/dist/shared/executable/diagnostics.d.ts +6 -0
- package/dist/shared/executable/diagnostics.d.ts.map +1 -1
- package/dist/shared/executable/diagnostics.js +9 -0
- package/dist/shared/executable/diagnostics.js.map +1 -1
- package/dist/shared/executable/index.d.ts +2 -0
- package/dist/shared/executable/index.d.ts.map +1 -1
- package/dist/shared/executable/index.js +1 -0
- package/dist/shared/executable/index.js.map +1 -1
- package/dist/shared/executable/node-script.d.ts +1 -0
- package/dist/shared/executable/node-script.d.ts.map +1 -1
- package/dist/shared/executable/node-script.js +1 -1
- package/dist/shared/executable/node-script.js.map +1 -1
- package/dist/shared/executable/process-cleanup-diagnostics.d.ts +3 -1
- package/dist/shared/executable/process-cleanup-diagnostics.d.ts.map +1 -1
- package/dist/shared/executable/process-cleanup-diagnostics.js.map +1 -1
- package/dist/shared/executable/process-cleanup.d.ts.map +1 -1
- package/dist/shared/executable/process-cleanup.js +41 -12
- package/dist/shared/executable/process-cleanup.js.map +1 -1
- package/dist/shared/executable/process-shutdown.d.ts +1 -0
- package/dist/shared/executable/process-shutdown.d.ts.map +1 -1
- package/dist/shared/executable/process-shutdown.js +27 -4
- package/dist/shared/executable/process-shutdown.js.map +1 -1
- package/dist/shared/executable/process-table-async.js +4 -4
- package/dist/shared/executable/process-table-async.js.map +1 -1
- package/dist/shared/executable/process-table-windows.d.ts.map +1 -1
- package/dist/shared/executable/process-table-windows.js +3 -1
- package/dist/shared/executable/process-table-windows.js.map +1 -1
- package/dist/shared/executable/process-tree.d.ts +8 -4
- package/dist/shared/executable/process-tree.d.ts.map +1 -1
- package/dist/shared/executable/process-tree.js +17 -10
- package/dist/shared/executable/process-tree.js.map +1 -1
- package/dist/shared/executable/process.d.ts +9 -1
- package/dist/shared/executable/process.d.ts.map +1 -1
- package/dist/shared/executable/process.js +2 -1
- package/dist/shared/executable/process.js.map +1 -1
- package/dist/shared/executable/reported-stderr.d.ts +18 -0
- package/dist/shared/executable/reported-stderr.d.ts.map +1 -0
- package/dist/shared/executable/reported-stderr.js +49 -0
- package/dist/shared/executable/reported-stderr.js.map +1 -0
- package/dist/shared/executable/run.d.ts +2 -0
- package/dist/shared/executable/run.d.ts.map +1 -1
- package/dist/shared/executable/run.js +4 -0
- package/dist/shared/executable/run.js.map +1 -1
- package/dist/shared/executable/verify-descendant-exit.d.ts +4 -0
- package/dist/shared/executable/verify-descendant-exit.d.ts.map +1 -0
- package/dist/shared/executable/verify-descendant-exit.js +34 -0
- package/dist/shared/executable/verify-descendant-exit.js.map +1 -0
- package/dist/shared/failure-class.d.ts +2 -0
- package/dist/shared/failure-class.d.ts.map +1 -1
- package/dist/shared/failure-class.js +11 -1
- package/dist/shared/failure-class.js.map +1 -1
- package/dist/shared/held-input.d.ts +9 -0
- package/dist/shared/held-input.d.ts.map +1 -1
- package/dist/shared/held-input.js +8 -0
- package/dist/shared/held-input.js.map +1 -1
- package/dist/shared/host-environment.d.ts +40 -0
- package/dist/shared/host-environment.d.ts.map +1 -0
- package/dist/shared/host-environment.js +74 -0
- package/dist/shared/host-environment.js.map +1 -0
- package/dist/shared/installation.d.ts +14 -3
- package/dist/shared/installation.d.ts.map +1 -1
- package/dist/shared/installation.js +81 -61
- package/dist/shared/installation.js.map +1 -1
- package/dist/shared/launch-args.d.ts +7 -0
- package/dist/shared/launch-args.d.ts.map +1 -0
- package/dist/shared/launch-args.js +25 -0
- package/dist/shared/launch-args.js.map +1 -0
- package/dist/shared/login.d.ts +3 -0
- package/dist/shared/login.d.ts.map +1 -1
- package/dist/shared/login.js +2 -1
- package/dist/shared/login.js.map +1 -1
- package/dist/shared/mcp-config-handoff.d.ts +12 -0
- package/dist/shared/mcp-config-handoff.d.ts.map +1 -0
- package/dist/shared/mcp-config-handoff.js +131 -0
- package/dist/shared/mcp-config-handoff.js.map +1 -0
- package/dist/shared/native-home-initialization.d.ts +20 -0
- package/dist/shared/native-home-initialization.d.ts.map +1 -0
- package/dist/shared/native-home-initialization.js +87 -0
- package/dist/shared/native-home-initialization.js.map +1 -0
- package/dist/shared/native-session-file.d.ts +3 -0
- package/dist/shared/native-session-file.d.ts.map +1 -0
- package/dist/shared/native-session-file.js +22 -0
- package/dist/shared/native-session-file.js.map +1 -0
- package/dist/shared/process-session.d.ts +1 -1
- package/dist/shared/process-session.d.ts.map +1 -1
- package/dist/shared/process-session.js +12 -9
- package/dist/shared/process-session.js.map +1 -1
- package/dist/shared/prompt-run.d.ts +10 -0
- package/dist/shared/prompt-run.d.ts.map +1 -0
- package/dist/shared/prompt-run.js +9 -0
- package/dist/shared/prompt-run.js.map +1 -0
- package/dist/shared/seal-session.d.ts.map +1 -1
- package/dist/shared/seal-session.js +2 -1
- package/dist/shared/seal-session.js.map +1 -1
- package/dist/shared/semver.d.ts +6 -0
- package/dist/shared/semver.d.ts.map +1 -1
- package/dist/shared/semver.js +16 -0
- package/dist/shared/semver.js.map +1 -1
- package/dist/shared/session-credentials.d.ts.map +1 -1
- package/dist/shared/session-credentials.js +2 -0
- package/dist/shared/session-credentials.js.map +1 -1
- package/dist/shared/session-options.d.ts.map +1 -1
- package/dist/shared/session-options.js +7 -4
- package/dist/shared/session-options.js.map +1 -1
- package/dist/shared/stream-json/compaction.d.ts +0 -1
- package/dist/shared/stream-json/compaction.d.ts.map +1 -1
- package/dist/shared/stream-json/compaction.js +1 -1
- package/dist/shared/stream-json/compaction.js.map +1 -1
- package/dist/shared/stream-json/held-input.d.ts.map +1 -1
- package/dist/shared/stream-json/held-input.js +0 -4
- package/dist/shared/stream-json/held-input.js.map +1 -1
- package/dist/shared/stream-json/input-lifecycle.d.ts.map +1 -1
- package/dist/shared/stream-json/input-lifecycle.js +8 -0
- package/dist/shared/stream-json/input-lifecycle.js.map +1 -1
- package/dist/shared/stream-json/profile.d.ts +6 -4
- package/dist/shared/stream-json/profile.d.ts.map +1 -1
- package/dist/shared/stream-json/projection.d.ts.map +1 -1
- package/dist/shared/stream-json/projection.js +23 -6
- package/dist/shared/stream-json/projection.js.map +1 -1
- package/dist/shared/stream-json/session.d.ts.map +1 -1
- package/dist/shared/stream-json/session.js +19 -21
- package/dist/shared/stream-json/session.js.map +1 -1
- package/dist/shared/stream-json/state.d.ts +3 -2
- package/dist/shared/stream-json/state.d.ts.map +1 -1
- package/dist/shared/stream-json/state.js +1 -0
- package/dist/shared/stream-json/state.js.map +1 -1
- package/dist/shared/update.d.ts +2 -0
- package/dist/shared/update.d.ts.map +1 -1
- package/dist/shared/update.js +6 -2
- package/dist/shared/update.js.map +1 -1
- package/dist/shared/usage-ratio.d.ts +16 -0
- package/dist/shared/usage-ratio.d.ts.map +1 -0
- package/dist/shared/usage-ratio.js +52 -0
- package/dist/shared/usage-ratio.js.map +1 -0
- package/dist/shared/user-configuration.d.ts +5 -0
- package/dist/shared/user-configuration.d.ts.map +1 -0
- package/dist/shared/user-configuration.js +19 -0
- package/dist/shared/user-configuration.js.map +1 -0
- package/dist/shared/version-range.d.ts +30 -0
- package/dist/shared/version-range.d.ts.map +1 -0
- package/dist/shared/version-range.js +50 -0
- package/dist/shared/version-range.js.map +1 -0
- package/dist/testing/scripted-runtime.d.ts.map +1 -1
- package/dist/testing/scripted-runtime.js +9 -4
- package/dist/testing/scripted-runtime.js.map +1 -1
- package/dist/testing/scripted-tasks.d.ts +1 -0
- package/dist/testing/scripted-tasks.d.ts.map +1 -1
- package/package.json +15 -8
- package/dist/runtimes/qwen/close.d.ts +0 -4
- package/dist/runtimes/qwen/close.d.ts.map +0 -1
- package/dist/runtimes/qwen/close.js +0 -13
- package/dist/runtimes/qwen/close.js.map +0 -1
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { type JsonRecord } from "../../shared/json.js";
|
|
2
|
+
import { type KapProjectedFrame, type KapProjectionOptions, type KapProjectionState } from "./kap-projection-state.js";
|
|
3
|
+
export { kapFailedTurn } from "./kap-failures.js";
|
|
4
|
+
export { createKapProjection, type KapEndedTurnRef, type KapPendingInteraction, type KapProjectedFrame, type KapProjectionOptions, type KapProjectionState, type KapTurnRef, } from "./kap-projection-state.js";
|
|
5
|
+
export declare function projectKapFrame(state: KapProjectionState, rawFrame: JsonRecord, options: KapProjectionOptions): KapProjectedFrame;
|
|
6
|
+
//# sourceMappingURL=kap-projection.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"kap-projection.d.ts","sources":["../../../src/runtimes/kimi/kap-projection.ts"],"names":[],"mappings":"AACA,OAAO,EAA0B,KAAK,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAI/E,OAAO,EAKL,KAAK,iBAAiB,EACtB,KAAK,oBAAoB,EACzB,KAAK,kBAAkB,EAExB,MAAM,2BAA2B,CAAC;AAQnC,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EACL,mBAAmB,EACnB,KAAK,eAAe,EACpB,KAAK,qBAAqB,EAC1B,KAAK,iBAAiB,EACtB,KAAK,oBAAoB,EACzB,KAAK,kBAAkB,EACvB,KAAK,UAAU,GAChB,MAAM,2BAA2B,CAAC;AAyHnC,wBAAgB,eAAe,CAC7B,KAAK,EAAE,kBAAkB,EACzB,QAAQ,EAAE,UAAU,EACpB,OAAO,EAAE,oBAAoB,GAC5B,iBAAiB,CAuGnB"}
|
|
@@ -0,0 +1,223 @@
|
|
|
1
|
+
import { asRecord, asRecordList } from "../../shared/json.js";
|
|
2
|
+
import { projectContextUsage, projectRetryUpdate, projectStepUsage } from "./kap-failures.js";
|
|
3
|
+
import { projectItemEvents, recordTaskAgent, registerChildAgentsFromRefs } from "./kap-items.js";
|
|
4
|
+
import { asString, asStringArray, stringifyToolInput, } from "./kap-projection-state.js";
|
|
5
|
+
import { projectInteractionEvent, projectTaskEvents, projectTurnEndedEvents, projectTurnStartedEvents, } from "./kap-turns.js";
|
|
6
|
+
export { kapFailedTurn } from "./kap-failures.js";
|
|
7
|
+
export { createKapProjection, } from "./kap-projection-state.js";
|
|
8
|
+
function projectAgentMetaFrame(state, agentId, rawFrame, events) {
|
|
9
|
+
const model = asString(rawFrame.model);
|
|
10
|
+
if (model !== undefined && model.length > 0 && state.lastModelByAgent.get(agentId) !== model) {
|
|
11
|
+
state.lastModelByAgent.set(agentId, model);
|
|
12
|
+
events.push({ kind: "model", model });
|
|
13
|
+
}
|
|
14
|
+
const thinking = asString(rawFrame.thinking);
|
|
15
|
+
if (thinking !== undefined && thinking.length > 0 && state.lastEffortByAgent.get(agentId) !== thinking) {
|
|
16
|
+
state.lastEffortByAgent.set(agentId, thinking);
|
|
17
|
+
events.push({ kind: "effort", effort: thinking });
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
function projectTaskListFrame(state, agentId, agentPath, rawFrame, subscribeAgents) {
|
|
21
|
+
for (const task of asRecordList(rawFrame.tasks)) {
|
|
22
|
+
const taskId = asString(task.task_id);
|
|
23
|
+
if (taskId === undefined) {
|
|
24
|
+
continue;
|
|
25
|
+
}
|
|
26
|
+
recordTaskAgent(state, agentPath, task, taskId, subscribeAgents);
|
|
27
|
+
if (agentId === "main" && asString(task.status) === "ended") {
|
|
28
|
+
state.startedTaskIds.add(taskId);
|
|
29
|
+
state.endedTaskIds.add(taskId);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
function projectTurnsSnapshot(state, agentId, agentPath, rawFrame, options, events, subscribeAgents) {
|
|
34
|
+
const turns = asRecordList(rawFrame.turns);
|
|
35
|
+
const isFirstSnapshot = !state.seenInitialTurns.has(agentId);
|
|
36
|
+
state.seenInitialTurns.add(agentId);
|
|
37
|
+
if (agentId === "main" && isFirstSnapshot) {
|
|
38
|
+
for (const turn of turns) {
|
|
39
|
+
const turnId = asString(turn.turn_id);
|
|
40
|
+
if (turnId === undefined) {
|
|
41
|
+
continue;
|
|
42
|
+
}
|
|
43
|
+
if (asString(turn.status) === "ended" && !state.startedTurnIds.has(turnId)) {
|
|
44
|
+
state.historicalTurnIds.add(turnId);
|
|
45
|
+
if (asString(turn.kind) === "system") {
|
|
46
|
+
state.systemTurnIds.add(turnId);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
let openedTurn = null;
|
|
52
|
+
let endedTurn = null;
|
|
53
|
+
const rootPromptIds = [];
|
|
54
|
+
for (const turn of turns) {
|
|
55
|
+
const turnId = asString(turn.turn_id);
|
|
56
|
+
if (turnId !== undefined && state.historicalTurnIds.has(turnId)) {
|
|
57
|
+
continue;
|
|
58
|
+
}
|
|
59
|
+
const started = projectTurnStartedEvents(state, agentId, turn, events);
|
|
60
|
+
if (started !== undefined) {
|
|
61
|
+
openedTurn = started;
|
|
62
|
+
endedTurn = null;
|
|
63
|
+
}
|
|
64
|
+
for (const item of asRecordList(turn.items)) {
|
|
65
|
+
const evType = asString(item.status) === "running" ? "item.started" : "item.ended";
|
|
66
|
+
projectItemEvents(state, evType, agentPath, turnId, item, options, events, subscribeAgents);
|
|
67
|
+
if (agentId === "main" && asString(item.type) === "user_message") {
|
|
68
|
+
rootPromptIds.push(...asStringArray(item.prompt_ids));
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
if (asString(turn.status) === "ended") {
|
|
72
|
+
const ended = projectTurnEndedEvents(state, agentId, turn, events);
|
|
73
|
+
if (ended !== undefined) {
|
|
74
|
+
endedTurn = ended;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
return {
|
|
79
|
+
...(openedTurn === null ? {} : { openedTurn }),
|
|
80
|
+
...(endedTurn === null ? {} : { endedTurn }),
|
|
81
|
+
...(rootPromptIds.length > 0 ? { rootUserPromptIds: rootPromptIds } : {}),
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
function projectItemDelta(state, frameTurnId, rawFrame, events) {
|
|
85
|
+
const itemId = asString(rawFrame.item_id);
|
|
86
|
+
const field = asString(rawFrame.field);
|
|
87
|
+
const delta = asString(rawFrame.delta);
|
|
88
|
+
if (itemId === undefined || field === undefined || delta === undefined || delta.length === 0) {
|
|
89
|
+
return;
|
|
90
|
+
}
|
|
91
|
+
if (frameTurnId !== undefined && state.historicalTurnIds.has(frameTurnId)) {
|
|
92
|
+
return;
|
|
93
|
+
}
|
|
94
|
+
if (field === "text") {
|
|
95
|
+
const prevLen = state.emittedTextLength.get(itemId) ?? 0;
|
|
96
|
+
state.emittedTextLength.set(itemId, prevLen + delta.length);
|
|
97
|
+
if (state.itemTypes.get(itemId) === "reasoning") {
|
|
98
|
+
events.push({ kind: "reasoning", content: { kind: "text", text: delta }, messageId: itemId });
|
|
99
|
+
}
|
|
100
|
+
else {
|
|
101
|
+
events.push({ kind: "text_delta", text: delta, messageId: itemId });
|
|
102
|
+
}
|
|
103
|
+
return;
|
|
104
|
+
}
|
|
105
|
+
if (field === "input_text") {
|
|
106
|
+
events.push({ kind: "tool_call_input_delta", callId: itemId, delta });
|
|
107
|
+
}
|
|
108
|
+
else if (field === "output") {
|
|
109
|
+
events.push({ kind: "tool_call_progress", callId: itemId, outputDelta: delta });
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
export function projectKapFrame(state, rawFrame, options) {
|
|
113
|
+
const type = asString(rawFrame.type) ?? "unknown";
|
|
114
|
+
const agentId = asString(rawFrame.agent_id) ?? "main";
|
|
115
|
+
const agentPath = agentId === "main" ? [] : (state.agentPaths.get(agentId) ?? [agentId]);
|
|
116
|
+
const turnRecord = asRecord(rawFrame.turn);
|
|
117
|
+
const frameTurnId = asString(rawFrame.turn_id) ?? (turnRecord === null ? undefined : asString(turnRecord.turn_id));
|
|
118
|
+
const resolvedSpan = frameTurnId !== undefined && !state.systemTurnIds.has(frameTurnId)
|
|
119
|
+
? frameTurnId
|
|
120
|
+
: state.activeTurnByAgent.get(agentId);
|
|
121
|
+
const at = { agentPath, ...(resolvedSpan === undefined ? {} : { spanId: resolvedSpan }) };
|
|
122
|
+
const events = [];
|
|
123
|
+
const subscribeAgents = [];
|
|
124
|
+
if (type === "agent") {
|
|
125
|
+
projectAgentMetaFrame(state, agentId, rawFrame, events);
|
|
126
|
+
return { at, body: { type, native: rawFrame, events } };
|
|
127
|
+
}
|
|
128
|
+
if (type === "context") {
|
|
129
|
+
projectContextUsage(rawFrame, events);
|
|
130
|
+
return { at, body: { type, native: rawFrame, events } };
|
|
131
|
+
}
|
|
132
|
+
if (type === "task") {
|
|
133
|
+
projectTaskEvents(state, agentPath, rawFrame, events, subscribeAgents);
|
|
134
|
+
return { at, body: { type, native: rawFrame, events }, ...(subscribeAgents.length > 0 ? { subscribeAgents } : {}) };
|
|
135
|
+
}
|
|
136
|
+
if (type === "task.list") {
|
|
137
|
+
projectTaskListFrame(state, agentId, agentPath, rawFrame, subscribeAgents);
|
|
138
|
+
return { at, body: { type, native: rawFrame, events: [] }, ...(subscribeAgents.length > 0 ? { subscribeAgents } : {}) };
|
|
139
|
+
}
|
|
140
|
+
if (type === "interaction") {
|
|
141
|
+
const outcome = projectInteractionEvent(state, agentId, rawFrame, options, events);
|
|
142
|
+
return { at, body: { type, native: rawFrame, events }, ...outcome };
|
|
143
|
+
}
|
|
144
|
+
if (type === "turns") {
|
|
145
|
+
const snapshot = projectTurnsSnapshot(state, agentId, agentPath, rawFrame, options, events, subscribeAgents);
|
|
146
|
+
const spanId = snapshot.openedTurn?.turnId ?? snapshot.endedTurn?.turnId ?? resolvedSpan;
|
|
147
|
+
return {
|
|
148
|
+
at: { agentPath, ...(spanId === undefined ? {} : { spanId }) },
|
|
149
|
+
body: { type, native: rawFrame, events },
|
|
150
|
+
...(subscribeAgents.length > 0 ? { subscribeAgents } : {}),
|
|
151
|
+
...snapshot,
|
|
152
|
+
};
|
|
153
|
+
}
|
|
154
|
+
if (type === "turn.started" && turnRecord !== null) {
|
|
155
|
+
const openedTurn = projectTurnStartedEvents(state, agentId, turnRecord, events);
|
|
156
|
+
const spanId = openedTurn === undefined ? resolvedSpan : openedTurn.turnId;
|
|
157
|
+
return {
|
|
158
|
+
at: { agentPath, ...(spanId === undefined ? {} : { spanId }) },
|
|
159
|
+
body: { type, native: rawFrame, events },
|
|
160
|
+
...(openedTurn === undefined ? {} : { openedTurn }),
|
|
161
|
+
};
|
|
162
|
+
}
|
|
163
|
+
if (type === "turn.updated") {
|
|
164
|
+
const turnId = asString(rawFrame.turn_id);
|
|
165
|
+
if (turnId !== undefined && !state.historicalTurnIds.has(turnId) && !state.systemTurnIds.has(turnId)) {
|
|
166
|
+
const step = asRecord(rawFrame.step);
|
|
167
|
+
if (step !== null) {
|
|
168
|
+
projectStepUsage(state, agentId, turnId, step, events);
|
|
169
|
+
}
|
|
170
|
+
const retry = asRecord(rawFrame.retry);
|
|
171
|
+
if (retry !== null) {
|
|
172
|
+
projectRetryUpdate(retry, events);
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
return { at, body: { type, native: rawFrame, events } };
|
|
176
|
+
}
|
|
177
|
+
if (type === "turn.ended" && turnRecord !== null) {
|
|
178
|
+
const endedTurn = projectTurnEndedEvents(state, agentId, turnRecord, events);
|
|
179
|
+
return { at, body: { type, native: rawFrame, events }, ...(endedTurn === undefined ? {} : { endedTurn }) };
|
|
180
|
+
}
|
|
181
|
+
if (type === "item.started" || type === "item.ended") {
|
|
182
|
+
const item = asRecord(rawFrame.item);
|
|
183
|
+
let rootUserPromptIds = null;
|
|
184
|
+
if (item !== null) {
|
|
185
|
+
projectItemEvents(state, type, agentPath, frameTurnId, item, options, events, subscribeAgents);
|
|
186
|
+
if (agentId === "main" &&
|
|
187
|
+
asString(item.type) === "user_message" &&
|
|
188
|
+
(frameTurnId === undefined || !state.historicalTurnIds.has(frameTurnId))) {
|
|
189
|
+
const ids = asStringArray(item.prompt_ids);
|
|
190
|
+
if (ids.length > 0) {
|
|
191
|
+
rootUserPromptIds = ids;
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
return {
|
|
196
|
+
at,
|
|
197
|
+
body: { type, native: rawFrame, events },
|
|
198
|
+
...(subscribeAgents.length > 0 ? { subscribeAgents } : {}),
|
|
199
|
+
...(rootUserPromptIds === null ? {} : { rootUserPromptIds }),
|
|
200
|
+
};
|
|
201
|
+
}
|
|
202
|
+
if (type === "item.updated") {
|
|
203
|
+
const itemId = asString(rawFrame.item_id);
|
|
204
|
+
const set = asRecord(rawFrame.set);
|
|
205
|
+
if (itemId !== undefined && set !== null && (frameTurnId === undefined || !state.historicalTurnIds.has(frameTurnId))) {
|
|
206
|
+
registerChildAgentsFromRefs(state, agentPath, itemId, set.agent_refs, subscribeAgents);
|
|
207
|
+
const inputStr = stringifyToolInput(set.input);
|
|
208
|
+
if (inputStr !== undefined) {
|
|
209
|
+
events.push({ kind: "tool_call_input", callId: itemId, input: inputStr });
|
|
210
|
+
}
|
|
211
|
+
const output = asString(set.output);
|
|
212
|
+
if (output !== undefined) {
|
|
213
|
+
events.push({ kind: "tool_call_progress", callId: itemId, output });
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
return { at, body: { type, native: rawFrame, events }, ...(subscribeAgents.length > 0 ? { subscribeAgents } : {}) };
|
|
217
|
+
}
|
|
218
|
+
if (type === "item.delta") {
|
|
219
|
+
projectItemDelta(state, frameTurnId, rawFrame, events);
|
|
220
|
+
}
|
|
221
|
+
return { at, body: { type, native: rawFrame, events } };
|
|
222
|
+
}
|
|
223
|
+
//# sourceMappingURL=kap-projection.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"kap-projection.js","sources":["../../../src/runtimes/kimi/kap-projection.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAmB,MAAM,sBAAsB,CAAC;AAE/E,OAAO,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAC9F,OAAO,EAAE,iBAAiB,EAAE,eAAe,EAAE,2BAA2B,EAAE,MAAM,gBAAgB,CAAC;AACjG,OAAO,EACL,QAAQ,EACR,aAAa,EACb,kBAAkB,GAMnB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EACL,uBAAuB,EACvB,iBAAiB,EACjB,sBAAsB,EACtB,wBAAwB,GACzB,MAAM,gBAAgB,CAAC;AAExB,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EACL,mBAAmB,GAOpB,MAAM,2BAA2B,CAAC;AAEnC,SAAS,qBAAqB,CAC5B,KAAyB,EACzB,OAAe,EACf,QAAoB,EACpB,MAA0B;IAE1B,MAAM,KAAK,GAAG,QAAQ,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;IACvC,IAAI,KAAK,KAAK,SAAS,IAAI,KAAK,CAAC,M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AAiB,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC,CAAC;YAAC,CAAC;YAC1G,MAAM,MAAM,GAAG,QAAQ,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;YACpC,IAAI,MAAM,KAAK,SAAS,EAAE,CAAC;gBAAC,MAAM,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,oBAAoB,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;YAAC,CAAC;QACpG,CAAC;QACD,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,GAAG,CAAC,eAAe,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,eAAe,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC;IACtH,CAAC;IACD,IAAI,IAAI,KAAK,YAAY,EAAE,CAAC;QAC1B,gBAAgB,CAAC,KAAK,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC;IACzD,CAAC;IACD,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,CAAC;AAC1D,CAAC"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import type { McpServer } from "../../contracts/session.js";
|
|
2
|
+
import { type LineProcess } from "../../shared/executable/index.js";
|
|
3
|
+
import type { LoadedImage } from "../../shared/input-images.js";
|
|
4
|
+
import { type JsonRecord } from "../../shared/json.js";
|
|
5
|
+
/** Flags owned by OAR when launching `kimi web --json`; collides with `--json`, bind/port, or remote-control options. */
|
|
6
|
+
export declare const KIMI_KAP_MANAGED_FLAGS: ReadonlySet<string>;
|
|
7
|
+
export declare function checkKimiKapLaunchArgs(args: readonly string[] | undefined): void;
|
|
8
|
+
export interface KapBootInfo {
|
|
9
|
+
readonly origin: string;
|
|
10
|
+
readonly wsUrl: string;
|
|
11
|
+
readonly token: string;
|
|
12
|
+
readonly protocolVersion: string;
|
|
13
|
+
}
|
|
14
|
+
export declare class KapApiError extends Error {
|
|
15
|
+
readonly code: number;
|
|
16
|
+
readonly msg: string;
|
|
17
|
+
readonly httpStatus: number;
|
|
18
|
+
readonly envelope: JsonRecord;
|
|
19
|
+
constructor(code: number, msg: string, httpStatus: number, envelope: JsonRecord);
|
|
20
|
+
}
|
|
21
|
+
export declare const REQUIRED_KAP_CAPABILITIES: readonly ["websocket", "tasks", "session_ephemeral_mcp", "session_append_system_prompt", "steer_parent_correlation"];
|
|
22
|
+
export declare function hasRequiredKapCapabilities(meta: JsonRecord): boolean;
|
|
23
|
+
export type KapProcessStart = {
|
|
24
|
+
readonly kind: "ready";
|
|
25
|
+
readonly child: LineProcess;
|
|
26
|
+
readonly boot: KapBootInfo;
|
|
27
|
+
} | {
|
|
28
|
+
readonly kind: "fallback_acp";
|
|
29
|
+
};
|
|
30
|
+
/**
|
|
31
|
+
* Launch `kimi web --json --host 127.0.0.1 --port 0` and register the ephemeral
|
|
32
|
+
* bearer immediately on receipt of the ready JSON line.
|
|
33
|
+
*/
|
|
34
|
+
export declare function startKimiKapProcess(command: string, cwd: string, env: NodeJS.ProcessEnv, launchArgs: readonly string[] | undefined, onToken: (token: string) => void, redact: (text: string) => string, timeoutMs?: number): Promise<KapProcessStart>;
|
|
35
|
+
export declare function kapRequest(origin: string, token: string, path: string, options?: {
|
|
36
|
+
readonly method?: "GET" | "POST" | "DELETE" | "PATCH";
|
|
37
|
+
readonly body?: JsonRecord;
|
|
38
|
+
readonly timeoutMs?: number;
|
|
39
|
+
readonly signal?: AbortSignal;
|
|
40
|
+
}): Promise<JsonRecord>;
|
|
41
|
+
export declare function checkKimiKapMcpServers(servers: readonly McpServer[] | undefined): void;
|
|
42
|
+
/** Convert OAR `McpServer[]` to KAP's `{ [name]: McpServerConfigWire }` map, avoiding prototype mutation. */
|
|
43
|
+
export declare function toKapMcpServers(servers: readonly McpServer[]): JsonRecord;
|
|
44
|
+
/** Build KAP `content` parts: base64 image blocks before text, omitting an empty text block when images exist. */
|
|
45
|
+
export declare function buildKapContent(text: string, images: readonly LoadedImage[]): JsonRecord[];
|
|
46
|
+
//# sourceMappingURL=kap-protocol.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"kap-protocol.d.ts","sources":["../../../src/runtimes/kimi/kap-protocol.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AAE5D,OAAO,EAAoB,KAAK,WAAW,EAAE,MAAM,kCAAkC,CAAC;AAEtF,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAChE,OAAO,EAAiC,KAAK,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAItF,yHAAyH;AACzH,eAAO,MAAM,sBAAsB,EAAE,WAAW,CAAC,MAAM,CAarD,CAAC;AAEH,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,GAAG,SAAS,GAAG,IAAI,CAEhF;AAED,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,eAAe,EAAE,MAAM,CAAC;CAClC;AAED,qBAAa,WAAY,SAAQ,KAAK;IACpC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,QAAQ,EAAE,UAAU,CAAC;IAE9B,YAAY,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAE,UAAU,EAO9E;CACF;A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B,eAAe,CAAC,OAAO,EAAE,SAAS,SAAS,EAAE,GAAG,UAAU,CAwBzE;AAED,kHAAkH;AAClH,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,WAAW,EAAE,GAAG,UAAU,EAAE,CAS1F"}
|
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
import { requestFailure } from "../../shared/credential-http.js";
|
|
2
|
+
import { spawnLineProcess } from "../../shared/executable/index.js";
|
|
3
|
+
import { appendStartupStderr } from "../../shared/executable/reported-stderr.js";
|
|
4
|
+
import { asNumber, asRecord, parseJson } from "../../shared/json.js";
|
|
5
|
+
import { checkManagedLaunchArgs } from "../../shared/launch-args.js";
|
|
6
|
+
import { checkMcpServerNames, isHttpMcpServer } from "../../shared/mcp-servers.js";
|
|
7
|
+
/** Flags owned by OAR when launching `kimi web --json`; collides with `--json`, bind/port, or remote-control options. */
|
|
8
|
+
export const KIMI_KAP_MANAGED_FLAGS = new Set([
|
|
9
|
+
"--json",
|
|
10
|
+
"--host",
|
|
11
|
+
"--port",
|
|
12
|
+
"--open",
|
|
13
|
+
"--no-open",
|
|
14
|
+
"--socket",
|
|
15
|
+
"--remote-control",
|
|
16
|
+
"--rc",
|
|
17
|
+
"--dangerous-bypass-auth",
|
|
18
|
+
"--allow-remote-shutdown",
|
|
19
|
+
"--debug-endpoints",
|
|
20
|
+
"--managed-by",
|
|
21
|
+
]);
|
|
22
|
+
export function checkKimiKapLaunchArgs(args) {
|
|
23
|
+
checkManagedLaunchArgs(args, KIMI_KAP_MANAGED_FLAGS, (flag) => `Kimi manages ${flag} itself when opening a KAP session`);
|
|
24
|
+
}
|
|
25
|
+
export class KapApiError extends Error {
|
|
26
|
+
code;
|
|
27
|
+
msg;
|
|
28
|
+
httpStatus;
|
|
29
|
+
envelope;
|
|
30
|
+
constructor(code, msg, httpStatus, envelope) {
|
|
31
|
+
super(msg);
|
|
32
|
+
this.name = "KapApiError";
|
|
33
|
+
this.code = code;
|
|
34
|
+
this.msg = msg;
|
|
35
|
+
this.httpStatus = httpStatus;
|
|
36
|
+
this.envelope = envelope;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
export const REQUIRED_KAP_CAPABILITIES = [
|
|
40
|
+
"websocket",
|
|
41
|
+
"tasks",
|
|
42
|
+
"session_ephemeral_mcp",
|
|
43
|
+
"session_append_system_prompt",
|
|
44
|
+
"steer_parent_correlation",
|
|
45
|
+
];
|
|
46
|
+
export function hasRequiredKapCapabilities(meta) {
|
|
47
|
+
const capabilities = asRecord(meta.capabilities);
|
|
48
|
+
if (capabilities === null) {
|
|
49
|
+
return false;
|
|
50
|
+
}
|
|
51
|
+
return REQUIRED_KAP_CAPABILITIES.every((key) => capabilities[key] === true);
|
|
52
|
+
}
|
|
53
|
+
function parseBootLine(line) {
|
|
54
|
+
const record = asRecord(parseJson(line));
|
|
55
|
+
if (record === null) {
|
|
56
|
+
return null;
|
|
57
|
+
}
|
|
58
|
+
const { origin, ws_url: wsUrl, token, kimi_agent_protocol_version: protocolVersion } = record;
|
|
59
|
+
if (typeof origin !== "string" || typeof wsUrl !== "string" || typeof token !== "string" || typeof protocolVersion !== "string") {
|
|
60
|
+
return null;
|
|
61
|
+
}
|
|
62
|
+
if (token.length === 0 || protocolVersion.length === 0) {
|
|
63
|
+
return null;
|
|
64
|
+
}
|
|
65
|
+
if (!/^http:\/\/127\.0\.0\.1:\d+$/u.test(origin) || !/^ws:\/\/127\.0\.0\.1:\d+\/api\/v1\/ws$/u.test(wsUrl)) {
|
|
66
|
+
return null;
|
|
67
|
+
}
|
|
68
|
+
return { origin, wsUrl, token, protocolVersion };
|
|
69
|
+
}
|
|
70
|
+
function isUnsupportedJsonFlag(stderr) {
|
|
71
|
+
return /unknown option[^]*--json|unrecognized option[^]*--json|unexpected argument[^]*--json|unknown flag[^]*--json/iu.test(stderr);
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Launch `kimi web --json --host 127.0.0.1 --port 0` and register the ephemeral
|
|
75
|
+
* bearer immediately on receipt of the ready JSON line.
|
|
76
|
+
*/
|
|
77
|
+
export async function startKimiKapProcess(command, cwd, env, launchArgs, onToken, redact, timeoutMs = 30_000) {
|
|
78
|
+
checkKimiKapLaunchArgs(launchArgs);
|
|
79
|
+
const args = ["web", "--json", "--host", "127.0.0.1", "--port", "0", ...(launchArgs ?? [])];
|
|
80
|
+
const child = spawnLineProcess(command, args, { cwd, env, killTree: true, inheritStderr: false });
|
|
81
|
+
const result = Promise.withResolvers();
|
|
82
|
+
let settled = false;
|
|
83
|
+
const finishOk = (value) => {
|
|
84
|
+
if (settled) {
|
|
85
|
+
return;
|
|
86
|
+
}
|
|
87
|
+
settled = true;
|
|
88
|
+
clearTimeout(timer);
|
|
89
|
+
result.resolve(value);
|
|
90
|
+
};
|
|
91
|
+
const finishErr = (error) => {
|
|
92
|
+
if (settled) {
|
|
93
|
+
return;
|
|
94
|
+
}
|
|
95
|
+
settled = true;
|
|
96
|
+
clearTimeout(timer);
|
|
97
|
+
result.reject(error instanceof Error ? error : new Error(String(error)));
|
|
98
|
+
};
|
|
99
|
+
const timer = setTimeout(() => {
|
|
100
|
+
const err = new Error(`Kimi KAP server did not become ready within ${String(timeoutMs)} ms`);
|
|
101
|
+
finishErr(appendStartupStderr(err, child.diagnostics(), redact));
|
|
102
|
+
}, timeoutMs);
|
|
103
|
+
timer.unref();
|
|
104
|
+
child.onLine((line) => {
|
|
105
|
+
const boot = parseBootLine(line);
|
|
106
|
+
if (boot === null) {
|
|
107
|
+
return;
|
|
108
|
+
}
|
|
109
|
+
onToken(boot.token);
|
|
110
|
+
finishOk({ kind: "ready", child, boot });
|
|
111
|
+
});
|
|
112
|
+
child.onExit((code, reason) => {
|
|
113
|
+
if (settled) {
|
|
114
|
+
return;
|
|
115
|
+
}
|
|
116
|
+
const diagnostics = child.diagnostics();
|
|
117
|
+
if (isUnsupportedJsonFlag(diagnostics.stderr)) {
|
|
118
|
+
finishOk({ kind: "fallback_acp" });
|
|
119
|
+
return;
|
|
120
|
+
}
|
|
121
|
+
const detail = reason ?? (code === null ? "signal" : `code ${String(code)}`);
|
|
122
|
+
finishErr(appendStartupStderr(new Error(`Kimi KAP server exited before readiness (${detail})`), diagnostics, redact));
|
|
123
|
+
});
|
|
124
|
+
try {
|
|
125
|
+
await child.spawned;
|
|
126
|
+
const outcome = await result.promise;
|
|
127
|
+
if (outcome.kind === "fallback_acp") {
|
|
128
|
+
await child.exited;
|
|
129
|
+
}
|
|
130
|
+
return outcome;
|
|
131
|
+
}
|
|
132
|
+
catch (error) {
|
|
133
|
+
child.kill();
|
|
134
|
+
await child.exited;
|
|
135
|
+
throw error;
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
export async function kapRequest(origin, token, path, options = {}) {
|
|
139
|
+
const timeoutSignal = options.timeoutMs === undefined ? undefined : AbortSignal.timeout(options.timeoutMs);
|
|
140
|
+
const signal = options.signal !== undefined && timeoutSignal !== undefined
|
|
141
|
+
? AbortSignal.any([options.signal, timeoutSignal])
|
|
142
|
+
: (options.signal ?? timeoutSignal);
|
|
143
|
+
const response = await fetch(`${origin}/api/v1${path}`, {
|
|
144
|
+
method: options.method ?? "GET",
|
|
145
|
+
redirect: "error",
|
|
146
|
+
...(signal === undefined ? {} : { signal }),
|
|
147
|
+
headers: {
|
|
148
|
+
Authorization: `Bearer ${token}`,
|
|
149
|
+
...(options.body === undefined ? {} : { "Content-Type": "application/json" }),
|
|
150
|
+
},
|
|
151
|
+
...(options.body === undefined ? {} : { body: JSON.stringify(options.body) }),
|
|
152
|
+
}).catch((error) => {
|
|
153
|
+
throw requestFailure("Kimi KAP request failed", error);
|
|
154
|
+
});
|
|
155
|
+
let rawText = "";
|
|
156
|
+
try {
|
|
157
|
+
rawText = await response.text();
|
|
158
|
+
}
|
|
159
|
+
catch (error) {
|
|
160
|
+
throw requestFailure("Kimi KAP response read failed", error);
|
|
161
|
+
}
|
|
162
|
+
const envelope = asRecord(parseJson(rawText));
|
|
163
|
+
if (envelope === null) {
|
|
164
|
+
throw new Error(`Kimi KAP HTTP ${String(response.status)} returned non-JSON body`);
|
|
165
|
+
}
|
|
166
|
+
const code = asNumber(envelope.code);
|
|
167
|
+
const msg = typeof envelope.msg === "string" && envelope.msg.length > 0
|
|
168
|
+
? envelope.msg
|
|
169
|
+
: `Kimi KAP request failed (HTTP ${String(response.status)})`;
|
|
170
|
+
if (code !== null && code !== 0) {
|
|
171
|
+
throw new KapApiError(code, msg, response.status, envelope);
|
|
172
|
+
}
|
|
173
|
+
if (!response.ok || code === null) {
|
|
174
|
+
throw new KapApiError(code ?? response.status, msg, response.status, envelope);
|
|
175
|
+
}
|
|
176
|
+
return asRecord(envelope.data) ?? {};
|
|
177
|
+
}
|
|
178
|
+
export function checkKimiKapMcpServers(servers) {
|
|
179
|
+
if (servers !== undefined) {
|
|
180
|
+
checkMcpServerNames(servers);
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
/** Convert OAR `McpServer[]` to KAP's `{ [name]: McpServerConfigWire }` map, avoiding prototype mutation. */
|
|
184
|
+
export function toKapMcpServers(servers) {
|
|
185
|
+
checkMcpServerNames(servers);
|
|
186
|
+
const map = {};
|
|
187
|
+
for (const server of servers) {
|
|
188
|
+
const entry = isHttpMcpServer(server)
|
|
189
|
+
? {
|
|
190
|
+
transport: "http",
|
|
191
|
+
url: server.url,
|
|
192
|
+
...(server.headers !== undefined && Object.keys(server.headers).length > 0 ? { headers: { ...server.headers } } : {}),
|
|
193
|
+
}
|
|
194
|
+
: {
|
|
195
|
+
transport: "stdio",
|
|
196
|
+
command: server.command,
|
|
197
|
+
...(server.args !== undefined && server.args.length > 0 ? { args: [...server.args] } : {}),
|
|
198
|
+
...(server.env !== undefined && Object.keys(server.env).length > 0 ? { env: { ...server.env } } : {}),
|
|
199
|
+
};
|
|
200
|
+
Object.defineProperty(map, server.name, {
|
|
201
|
+
value: entry,
|
|
202
|
+
enumerable: true,
|
|
203
|
+
configurable: true,
|
|
204
|
+
writable: true,
|
|
205
|
+
});
|
|
206
|
+
}
|
|
207
|
+
return map;
|
|
208
|
+
}
|
|
209
|
+
/** Build KAP `content` parts: base64 image blocks before text, omitting an empty text block when images exist. */
|
|
210
|
+
export function buildKapContent(text, images) {
|
|
211
|
+
const parts = images.map((image) => ({
|
|
212
|
+
type: "image",
|
|
213
|
+
source: { kind: "base64", media_type: image.mediaType, data: image.data },
|
|
214
|
+
}));
|
|
215
|
+
if (text.length > 0 || images.length === 0) {
|
|
216
|
+
parts.push({ type: "text", text });
|
|
217
|
+
}
|
|
218
|
+
return parts;
|
|
219
|
+
}
|
|
220
|
+
//# sourceMappingURL=kap-protocol.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"kap-protocol.js","sources":["../../../src/runtimes/kimi/kap-protocol.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AACjE,OAAO,EAAE,gBAAgB,EAAoB,MAAM,kCAAkC,CAAC;AACtF,OAAO,EAAE,mBAAmB,EAAE,MAAM,4CAA4C,CAAC;AAEjF,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,SAAS,EAAmB,MAAM,sBAAsB,CAAC;AACtF,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AACrE,OAAO,EAAE,mBAAmB,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAEnF,yHAAyH;AACzH,MAAM,CAAC,MAAM,sBAAsB,GAAwB,IAAI,GAAG,CAAC;IACjE,QAAQ;IACR,QAAQ;IACR,QAAQ;IACR,QAAQ;IACR,WAAW;IACX,UAAU;IACV,kBAAkB;IAClB,MAAM;IACN,yBAAyB;IACzB,yBAAyB;IACzB,mBAAmB;IACnB,cAAc;CACf,CAAC,CAAC;AAEH,MAAM,UAAU,sBAAsB,CAAC,IAAmC;IACxE,sBAAsB,CAAC,IAAI,EAAE,sBAAsB,EAAE,CAAC,IAAI,EAAE,EAAE,CA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AM,KAAK,GAAiB,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;QACjD,IAAI,EAAE,OAAO;QACb,MAAM,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,UAAU,EAAE,KAAK,CAAC,SAAS,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,EAAE;KAC1E,CAAC,CAAC,CAAC;IACJ,IAAI,IAAI,CAAC,MAAM,GAAG,CAAC,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC3C,KAAK,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC;IACrC,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { AvailableInstallation } from "../../contracts/installation.js";
|
|
2
|
+
import type { Session, SessionOptions } from "../../contracts/session.js";
|
|
3
|
+
import type { SessionCredentials } from "../../shared/session-credentials.js";
|
|
4
|
+
export type OpenKimiKapResult = {
|
|
5
|
+
readonly kind: "session";
|
|
6
|
+
readonly session: Session;
|
|
7
|
+
} | {
|
|
8
|
+
readonly kind: "fallback_acp";
|
|
9
|
+
};
|
|
10
|
+
export declare function openKimiKapSession(installation: AvailableInstallation, options: SessionOptions, credentials: SessionCredentials): Promise<OpenKimiKapResult>;
|
|
11
|
+
//# sourceMappingURL=kap-session.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"kap-session.d.ts","sources":["../../../src/runtimes/kimi/kap-session.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;AAC7E,OAAO,KAAK,EAAkB,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAE1F,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,qCAAqC,CAAC;AAY9E,MAAM,MAAM,iBAAiB,GACzB;IAAE,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAC;IAAC,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAA;CAAE,GACvD;IAAE,QAAQ,CAAC,IAAI,EAAE,cAAc,CAAA;CAAE,CAAC;AAEtC,wBAAsB,kBAAkB,CACtC,YAAY,EAAE,qBAAqB,EACnC,OAAO,EAAE,cAAc,EACvB,WAAW,EAAE,kBAAkB,GAC9B,OAAO,CAAC,iBAAiB,CAAC,CAiH5B"}
|