maka-agent 0.2.0-dev.39.20260916 → 0.2.0-dev.40.20260917
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 +9 -9
- package/THIRD_PARTY_NOTICES.txt +12 -12
- package/dist/acp/active-promise.js +38 -0
- package/dist/acp/session-event-mapper.js +53 -10
- package/dist/acp/session-registry.js +58 -5
- package/dist/acp/tool-event-mapper.js +366 -0
- package/dist/bounded-chunk-buffer.js +16 -3
- package/dist/runtime-host-session-channel.js +160 -1
- package/dist/runtime-host-tui-command.js +1 -1
- package/native/runtime-host-windows-task-launcher/prebuilds/win32-x64/maka-runtime-host-task-launcher.exe +0 -0
- package/node_modules/@earendil-works/pi-tui/README.md +53 -4
- package/node_modules/@earendil-works/pi-tui/dist/alt-screen-search.js +202 -42
- package/node_modules/@earendil-works/pi-tui/dist/components/box.js +29 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/editor.js +98 -18
- package/node_modules/@earendil-works/pi-tui/dist/components/input.js +44 -5
- package/node_modules/@earendil-works/pi-tui/dist/components/loader.js +10 -3
- package/node_modules/@earendil-works/pi-tui/dist/components/mouse-region.js +21 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/scroll-view.js +8 -2
- package/node_modules/@earendil-works/pi-tui/dist/components/select-list.js +49 -2
- package/node_modules/@earendil-works/pi-tui/dist/components/settings-list.js +55 -5
- package/node_modules/@earendil-works/pi-tui/dist/index.js +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/latex.js +14 -0
- package/node_modules/@earendil-works/pi-tui/dist/layout.js +32 -9
- package/node_modules/@earendil-works/pi-tui/dist/terminal-image.js +1 -4
- package/node_modules/@earendil-works/pi-tui/dist/terminal.js +17 -4
- package/node_modules/@earendil-works/pi-tui/dist/tui-alt-screen.js +342 -41
- package/node_modules/@earendil-works/pi-tui/dist/tui-main-screen.js +6 -5
- package/node_modules/@earendil-works/pi-tui/dist/tui.js +123 -9
- package/node_modules/@earendil-works/pi-tui/dist/utils.js +9 -0
- package/node_modules/@earendil-works/pi-tui/package.json +1 -1
- package/node_modules/@larksuiteoapi/node-sdk/es/index.js +199 -35
- package/node_modules/@larksuiteoapi/node-sdk/lib/index.js +199 -35
- package/node_modules/@larksuiteoapi/node-sdk/package.json +1 -1
- package/node_modules/@maka/core/dist/model-metadata.generated.js +143 -143
- package/node_modules/@maka/core/dist/model-metadata.js +26 -3
- package/node_modules/@maka/core/dist/models-dev-projection.js +21 -3
- package/node_modules/@maka/core/dist/provider-registry.js +49 -10
- package/node_modules/@maka/core/dist/runtime-policy.js +1 -1
- package/node_modules/@maka/core/dist/settings.js +1 -1
- package/node_modules/@maka/core/node_modules/@formatjs/icu-messageformat-parser/index.js +5 -2
- package/node_modules/@maka/core/node_modules/@formatjs/icu-messageformat-parser/package.json +1 -1
- package/node_modules/@maka/core/node_modules/intl-messageformat/intl-messageformat.iife.js +5 -2
- package/node_modules/@maka/core/node_modules/intl-messageformat/package.json +2 -2
- package/node_modules/@maka/core/package.json +1 -1
- package/node_modules/@maka/eval/node_modules/undici/docs/docs/api/Interceptors.md +7 -3
- package/node_modules/@maka/eval/node_modules/undici/docs/docs/api/Socks5ProxyAgent.md +7 -1
- package/node_modules/@maka/eval/node_modules/undici/lib/cache/memory-cache-store.js +1 -1
- package/node_modules/@maka/eval/node_modules/undici/lib/core/symbols.js +2 -0
- package/node_modules/@maka/eval/node_modules/undici/lib/dispatcher/balanced-pool.js +6 -3
- package/node_modules/@maka/eval/node_modules/undici/lib/dispatcher/dispatcher.js +6 -2
- package/node_modules/@maka/eval/node_modules/undici/lib/dispatcher/dispatcher1-wrapper.js +3 -0
- package/node_modules/@maka/eval/node_modules/undici/lib/dispatcher/proxy-agent.js +17 -0
- package/node_modules/@maka/eval/node_modules/undici/lib/dispatcher/retry-agent.js +3 -0
- package/node_modules/@maka/eval/node_modules/undici/lib/dispatcher/socks5-proxy-agent.js +90 -22
- package/node_modules/@maka/eval/node_modules/undici/lib/handler/cache-handler.js +21 -5
- package/node_modules/@maka/eval/node_modules/undici/lib/handler/redirect-handler.js +13 -4
- package/node_modules/@maka/eval/node_modules/undici/lib/handler/retry-handler.js +65 -19
- package/node_modules/@maka/eval/node_modules/undici/lib/interceptor/cache.js +65 -12
- package/node_modules/@maka/eval/node_modules/undici/lib/interceptor/decompress.js +115 -13
- package/node_modules/@maka/eval/node_modules/undici/lib/interceptor/deduplicate.js +5 -4
- package/node_modules/@maka/eval/node_modules/undici/lib/interceptor/dns.js +7 -0
- package/node_modules/@maka/eval/node_modules/undici/lib/interceptor/dump.js +9 -22
- package/node_modules/@maka/eval/node_modules/undici/lib/util/cache.js +45 -3
- package/node_modules/@maka/eval/node_modules/undici/lib/web/cookies/parse.js +150 -149
- package/node_modules/@maka/eval/node_modules/undici/lib/web/eventsource/eventsource.js +9 -2
- package/node_modules/@maka/eval/node_modules/undici/lib/web/fetch/index.js +6 -0
- package/node_modules/@maka/eval/node_modules/undici/lib/web/fetch/util.js +6 -1
- package/node_modules/@maka/eval/node_modules/undici/lib/web/webidl/index.js +3 -3
- package/node_modules/@maka/eval/node_modules/undici/lib/web/websocket/connection.js +1 -1
- package/node_modules/@maka/eval/node_modules/undici/lib/web/websocket/permessage-deflate.js +5 -0
- package/node_modules/@maka/eval/node_modules/undici/lib/web/websocket/stream/websocketstream.js +8 -10
- package/node_modules/@maka/eval/node_modules/undici/package.json +1 -1
- package/node_modules/@maka/eval/package.json +1 -1
- package/node_modules/@maka/runtime/dist/ai-sdk-message-projection.js +17 -28
- package/node_modules/@maka/runtime/dist/ai-sdk-turn.js +4 -6
- package/node_modules/@maka/runtime/dist/commandcode-cli-language-model.js +6 -29
- package/node_modules/@maka/runtime/dist/model-adapter.js +18 -12
- package/node_modules/@maka/runtime/dist/model-factory.js +43 -38
- package/node_modules/@maka/runtime/dist/model-runtime.js +11 -12
- package/node_modules/@maka/runtime/dist/responses-reasoning-state.js +19 -7
- package/node_modules/@maka/runtime/dist/test-connection.js +1 -4
- package/node_modules/@maka/runtime/dist/workers/filesystem-worker.js +1677 -860
- package/node_modules/@maka/runtime/node_modules/undici/docs/docs/api/Interceptors.md +7 -3
- package/node_modules/@maka/runtime/node_modules/undici/docs/docs/api/Socks5ProxyAgent.md +7 -1
- package/node_modules/@maka/runtime/node_modules/undici/lib/cache/memory-cache-store.js +1 -1
- package/node_modules/@maka/runtime/node_modules/undici/lib/core/symbols.js +2 -0
- package/node_modules/@maka/runtime/node_modules/undici/lib/dispatcher/balanced-pool.js +6 -3
- package/node_modules/@maka/runtime/node_modules/undici/lib/dispatcher/dispatcher.js +6 -2
- package/node_modules/@maka/runtime/node_modules/undici/lib/dispatcher/dispatcher1-wrapper.js +3 -0
- package/node_modules/@maka/runtime/node_modules/undici/lib/dispatcher/proxy-agent.js +17 -0
- package/node_modules/@maka/runtime/node_modules/undici/lib/dispatcher/retry-agent.js +3 -0
- package/node_modules/@maka/runtime/node_modules/undici/lib/dispatcher/socks5-proxy-agent.js +90 -22
- package/node_modules/@maka/runtime/node_modules/undici/lib/handler/cache-handler.js +21 -5
- package/node_modules/@maka/runtime/node_modules/undici/lib/handler/redirect-handler.js +13 -4
- package/node_modules/@maka/runtime/node_modules/undici/lib/handler/retry-handler.js +65 -19
- package/node_modules/@maka/runtime/node_modules/undici/lib/interceptor/cache.js +65 -12
- package/node_modules/@maka/runtime/node_modules/undici/lib/interceptor/decompress.js +115 -13
- package/node_modules/@maka/runtime/node_modules/undici/lib/interceptor/deduplicate.js +5 -4
- package/node_modules/@maka/runtime/node_modules/undici/lib/interceptor/dns.js +7 -0
- package/node_modules/@maka/runtime/node_modules/undici/lib/interceptor/dump.js +9 -22
- package/node_modules/@maka/runtime/node_modules/undici/lib/util/cache.js +45 -3
- package/node_modules/@maka/runtime/node_modules/undici/lib/web/cookies/parse.js +150 -149
- package/node_modules/@maka/runtime/node_modules/undici/lib/web/eventsource/eventsource.js +9 -2
- package/node_modules/@maka/runtime/node_modules/undici/lib/web/fetch/index.js +6 -0
- package/node_modules/@maka/runtime/node_modules/undici/lib/web/fetch/util.js +6 -1
- package/node_modules/@maka/runtime/node_modules/undici/lib/web/webidl/index.js +3 -3
- package/node_modules/@maka/runtime/node_modules/undici/lib/web/websocket/connection.js +1 -1
- package/node_modules/@maka/runtime/node_modules/undici/lib/web/websocket/permessage-deflate.js +5 -0
- package/node_modules/@maka/runtime/node_modules/undici/lib/web/websocket/stream/websocketstream.js +8 -10
- package/node_modules/@maka/runtime/node_modules/undici/package.json +1 -1
- package/node_modules/@maka/runtime/package.json +6 -6
- package/node_modules/@maka/runtime-host/dist/client/session-subscription.js +3 -20
- package/node_modules/@maka/runtime-host/dist/protocol/index.js +5 -1
- package/node_modules/@maka/runtime-host/dist/protocol/session-transcript.js +10 -21
- package/node_modules/@maka/runtime-host/dist/protocol/session-turns.js +9 -1
- package/node_modules/@maka/runtime-host/dist/server/session-catalog-coordinator.js +1 -1
- package/node_modules/@maka/runtime-host/dist/server/session-transcript-pager.js +22 -338
- package/node_modules/@maka/runtime-host/dist/server/session-transcript-reader.js +65 -20
- package/node_modules/@maka/runtime-host/package.json +3 -3
- package/node_modules/@maka/storage/dist/conversation-operational-state.js +3 -0
- package/node_modules/@maka/storage/dist/execution-stores.js +2 -1
- package/node_modules/@maka/storage/dist/runtime-transcript-query.js +137 -70
- package/node_modules/@maka/storage/dist/sqlite-runtime-schema.js +17 -2
- package/node_modules/@maka/storage/dist/sqlite-runtime-store.js +9 -4
- package/node_modules/@openai/agents-core/dist/agent.js +8 -10
- package/node_modules/@openai/agents-core/dist/agent.mjs +9 -11
- package/node_modules/@openai/agents-core/dist/agentToolInput.js +2 -30
- package/node_modules/@openai/agents-core/dist/agentToolInput.mjs +1 -29
- package/node_modules/@openai/agents-core/dist/defaultModel.js +23 -3
- package/node_modules/@openai/agents-core/dist/defaultModel.mjs +21 -3
- package/node_modules/@openai/agents-core/dist/handoff.js +5 -5
- package/node_modules/@openai/agents-core/dist/handoff.mjs +5 -5
- package/node_modules/@openai/agents-core/dist/index.js +2 -1
- package/node_modules/@openai/agents-core/dist/index.mjs +1 -1
- package/node_modules/@openai/agents-core/dist/items.js +8 -1
- package/node_modules/@openai/agents-core/dist/items.mjs +8 -1
- package/node_modules/@openai/agents-core/dist/mcp.js +26 -16
- package/node_modules/@openai/agents-core/dist/mcp.mjs +27 -17
- package/node_modules/@openai/agents-core/dist/mcpServers.js +18 -15
- package/node_modules/@openai/agents-core/dist/mcpServers.mjs +18 -15
- package/node_modules/@openai/agents-core/dist/mcpShared.js +12 -0
- package/node_modules/@openai/agents-core/dist/mcpShared.mjs +12 -0
- package/node_modules/@openai/agents-core/dist/memory/session.js +8 -0
- package/node_modules/@openai/agents-core/dist/memory/session.mjs +7 -0
- package/node_modules/@openai/agents-core/dist/metadata.js +2 -2
- package/node_modules/@openai/agents-core/dist/metadata.mjs +2 -2
- package/node_modules/@openai/agents-core/dist/run.js +550 -248
- package/node_modules/@openai/agents-core/dist/run.mjs +555 -253
- package/node_modules/@openai/agents-core/dist/runState.js +747 -420
- package/node_modules/@openai/agents-core/dist/runState.mjs +742 -421
- package/node_modules/@openai/agents-core/dist/runStateLegacyCompaction.js +440 -0
- package/node_modules/@openai/agents-core/dist/runStateLegacyCompaction.mjs +404 -0
- package/node_modules/@openai/agents-core/dist/runner/blockedOutputPersistence.js +274 -78
- package/node_modules/@openai/agents-core/dist/runner/blockedOutputPersistence.mjs +268 -77
- package/node_modules/@openai/agents-core/dist/runner/conversation.js +22 -3
- package/node_modules/@openai/agents-core/dist/runner/conversation.mjs +23 -4
- package/node_modules/@openai/agents-core/dist/runner/guardrails.js +80 -15
- package/node_modules/@openai/agents-core/dist/runner/guardrails.mjs +78 -15
- package/node_modules/@openai/agents-core/dist/runner/items.js +35 -2
- package/node_modules/@openai/agents-core/dist/runner/items.mjs +35 -2
- package/node_modules/@openai/agents-core/dist/runner/modelOutputs.js +47 -18
- package/node_modules/@openai/agents-core/dist/runner/modelOutputs.mjs +50 -21
- package/node_modules/@openai/agents-core/dist/runner/modelPreparation.js +28 -0
- package/node_modules/@openai/agents-core/dist/runner/modelPreparation.mjs +28 -1
- package/node_modules/@openai/agents-core/dist/runner/modelRetry.js +322 -217
- package/node_modules/@openai/agents-core/dist/runner/modelRetry.mjs +322 -217
- package/node_modules/@openai/agents-core/dist/runner/modelSettings.js +15 -22
- package/node_modules/@openai/agents-core/dist/runner/modelSettings.mjs +15 -22
- package/node_modules/@openai/agents-core/dist/runner/outputGuardrailBlockedMessage.js +32 -0
- package/node_modules/@openai/agents-core/dist/runner/outputGuardrailBlockedMessage.mjs +28 -0
- package/node_modules/@openai/agents-core/dist/runner/runLoop.js +53 -8
- package/node_modules/@openai/agents-core/dist/runner/runLoop.mjs +53 -8
- package/node_modules/@openai/agents-core/dist/runner/sessionItems.js +119 -0
- package/node_modules/@openai/agents-core/dist/runner/sessionItems.mjs +114 -0
- package/node_modules/@openai/agents-core/dist/runner/sessionPersistence.js +408 -157
- package/node_modules/@openai/agents-core/dist/runner/sessionPersistence.mjs +388 -142
- package/node_modules/@openai/agents-core/dist/runner/toolExecution.js +42 -3
- package/node_modules/@openai/agents-core/dist/runner/toolExecution.mjs +42 -3
- package/node_modules/@openai/agents-core/dist/runner/toolSearch.js +1 -0
- package/node_modules/@openai/agents-core/dist/runner/toolSearch.mjs +1 -1
- package/node_modules/@openai/agents-core/dist/runner/toolSearchAttribution.js +19 -0
- package/node_modules/@openai/agents-core/dist/runner/toolSearchAttribution.mjs +15 -0
- package/node_modules/@openai/agents-core/dist/runner/turnResolution.js +65 -13
- package/node_modules/@openai/agents-core/dist/runner/turnResolution.mjs +65 -13
- package/node_modules/@openai/agents-core/dist/runner/usageTracking.js +69 -0
- package/node_modules/@openai/agents-core/dist/runner/usageTracking.mjs +65 -0
- package/node_modules/@openai/agents-core/dist/sandbox/manifest.js +4 -0
- package/node_modules/@openai/agents-core/dist/sandbox/manifest.mjs +4 -0
- package/node_modules/@openai/agents-core/dist/sandbox/sandboxes/docker.js +317 -127
- package/node_modules/@openai/agents-core/dist/sandbox/sandboxes/docker.mjs +319 -129
- package/node_modules/@openai/agents-core/dist/sandbox/sandboxes/shared/localWorkspace.js +1 -1
- package/node_modules/@openai/agents-core/dist/sandbox/sandboxes/shared/localWorkspace.mjs +1 -1
- package/node_modules/@openai/agents-core/dist/sandbox/sandboxes/shared/pty.js +27 -13
- package/node_modules/@openai/agents-core/dist/sandbox/sandboxes/shared/pty.mjs +27 -13
- package/node_modules/@openai/agents-core/dist/sandbox/sandboxes/shared/unixLocalFileWorker.js +196 -0
- package/node_modules/@openai/agents-core/dist/sandbox/sandboxes/shared/unixLocalFileWorker.mjs +193 -0
- package/node_modules/@openai/agents-core/dist/sandbox/sandboxes/shared/unixLocalFiles.js +215 -0
- package/node_modules/@openai/agents-core/dist/sandbox/sandboxes/shared/unixLocalFiles.mjs +211 -0
- package/node_modules/@openai/agents-core/dist/sandbox/sandboxes/unixLocal.js +193 -83
- package/node_modules/@openai/agents-core/dist/sandbox/sandboxes/unixLocal.mjs +196 -86
- package/node_modules/@openai/agents-core/dist/sandbox/session.js +2 -1
- package/node_modules/@openai/agents-core/dist/sandbox/session.mjs +2 -1
- package/node_modules/@openai/agents-core/dist/tracing/processor.js +21 -7
- package/node_modules/@openai/agents-core/dist/tracing/processor.mjs +21 -7
- package/node_modules/@openai/agents-core/dist/tracing/spans.js +40 -6
- package/node_modules/@openai/agents-core/dist/tracing/spans.mjs +7 -3
- package/node_modules/@openai/agents-core/dist/types/protocol.js +6 -0
- package/node_modules/@openai/agents-core/dist/types/protocol.mjs +6 -0
- package/node_modules/@openai/agents-core/dist/usage.js +13 -4
- package/node_modules/@openai/agents-core/dist/usage.mjs +13 -4
- package/node_modules/@openai/agents-core/dist/utils/applyDiff.js +24 -7
- package/node_modules/@openai/agents-core/dist/utils/applyDiff.mjs +24 -7
- package/node_modules/@openai/agents-core/dist/utils/internal.js +3 -1
- package/node_modules/@openai/agents-core/dist/utils/internal.mjs +1 -1
- package/node_modules/@openai/agents-core/dist/utils/zodCompat.js +29 -0
- package/node_modules/@openai/agents-core/dist/utils/zodCompat.mjs +28 -0
- package/node_modules/@openai/agents-core/dist/utils/zodJsonSchemaCompat.js +3 -31
- package/node_modules/@openai/agents-core/dist/utils/zodJsonSchemaCompat.mjs +1 -29
- package/node_modules/@openai/agents-core/package.json +1 -1
- package/node_modules/@types/node/README.md +1 -1
- package/node_modules/@types/node/package.json +3 -3
- package/node_modules/socks/build/common/helpers.js +5 -6
- package/node_modules/socks/build/common/util.js +2 -2
- package/node_modules/socks/package.json +7 -7
- package/node_modules/systeminformation/lib/filesystem.js +87 -13
- package/node_modules/systeminformation/lib/processes.js +80 -43
- package/node_modules/systeminformation/package.json +1 -1
- package/node_modules/undici/docs/docs/api/Interceptors.md +7 -3
- package/node_modules/undici/docs/docs/api/Socks5ProxyAgent.md +7 -1
- package/node_modules/undici/lib/cache/memory-cache-store.js +1 -1
- package/node_modules/undici/lib/core/symbols.js +2 -0
- package/node_modules/undici/lib/dispatcher/balanced-pool.js +6 -3
- package/node_modules/undici/lib/dispatcher/dispatcher.js +6 -2
- package/node_modules/undici/lib/dispatcher/dispatcher1-wrapper.js +3 -0
- package/node_modules/undici/lib/dispatcher/proxy-agent.js +17 -0
- package/node_modules/undici/lib/dispatcher/retry-agent.js +3 -0
- package/node_modules/undici/lib/dispatcher/socks5-proxy-agent.js +90 -22
- package/node_modules/undici/lib/handler/cache-handler.js +21 -5
- package/node_modules/undici/lib/handler/redirect-handler.js +13 -4
- package/node_modules/undici/lib/handler/retry-handler.js +65 -19
- package/node_modules/undici/lib/interceptor/cache.js +65 -12
- package/node_modules/undici/lib/interceptor/decompress.js +115 -13
- package/node_modules/undici/lib/interceptor/deduplicate.js +5 -4
- package/node_modules/undici/lib/interceptor/dns.js +7 -0
- package/node_modules/undici/lib/interceptor/dump.js +9 -22
- package/node_modules/undici/lib/util/cache.js +45 -3
- package/node_modules/undici/lib/web/cookies/parse.js +150 -149
- package/node_modules/undici/lib/web/eventsource/eventsource.js +9 -2
- package/node_modules/undici/lib/web/fetch/index.js +6 -0
- package/node_modules/undici/lib/web/fetch/util.js +6 -1
- package/node_modules/undici/lib/web/webidl/index.js +3 -3
- package/node_modules/undici/lib/web/websocket/connection.js +1 -1
- package/node_modules/undici/lib/web/websocket/permessage-deflate.js +5 -0
- package/node_modules/undici/lib/web/websocket/stream/websocketstream.js +8 -10
- package/node_modules/undici/package.json +1 -1
- package/node_modules/undici-types/package.json +1 -1
- package/node_modules/yaml/browser/dist/compose/resolve-flow-scalar.js +19 -18
- package/node_modules/yaml/browser/dist/nodes/Alias.js +25 -23
- package/node_modules/yaml/dist/compose/resolve-flow-scalar.js +19 -18
- package/node_modules/yaml/dist/nodes/Alias.js +25 -23
- package/node_modules/yaml/package.json +1 -1
- package/node_modules/zod/README.md +2 -2
- package/node_modules/zod/compile.cjs +19 -0
- package/node_modules/zod/index.cjs +19 -0
- package/node_modules/zod/locales/index.cjs +19 -0
- package/node_modules/zod/mini/index.cjs +19 -0
- package/node_modules/zod/package.json +8 -7
- package/node_modules/zod/v3/ZodError.cjs +19 -0
- package/node_modules/zod/v3/errors.cjs +19 -0
- package/node_modules/zod/v3/external.cjs +19 -0
- package/node_modules/zod/v3/helpers/enumUtil.cjs +19 -0
- package/node_modules/zod/v3/helpers/errorUtil.cjs +20 -1
- package/node_modules/zod/v3/helpers/errorUtil.js +1 -1
- package/node_modules/zod/v3/helpers/parseUtil.cjs +19 -0
- package/node_modules/zod/v3/helpers/partialUtil.cjs +19 -0
- package/node_modules/zod/v3/helpers/typeAliases.cjs +19 -0
- package/node_modules/zod/v3/helpers/util.cjs +19 -0
- package/node_modules/zod/v3/index.cjs +19 -0
- package/node_modules/zod/v3/standard-schema.cjs +19 -0
- package/node_modules/zod/v3/types.cjs +19 -0
- package/node_modules/zod/v4/classic/checks.cjs +19 -0
- package/node_modules/zod/v4/classic/coerce.cjs +19 -0
- package/node_modules/zod/v4/classic/compat.cjs +19 -0
- package/node_modules/zod/v4/classic/deep-partial.cjs +19 -0
- package/node_modules/zod/v4/classic/errors.cjs +19 -0
- package/node_modules/zod/v4/classic/external.cjs +22 -1
- package/node_modules/zod/v4/classic/external.js +1 -1
- package/node_modules/zod/v4/classic/from-json-schema.cjs +264 -24
- package/node_modules/zod/v4/classic/from-json-schema.js +245 -24
- package/node_modules/zod/v4/classic/in-out.cjs +19 -0
- package/node_modules/zod/v4/classic/index.cjs +19 -0
- package/node_modules/zod/v4/classic/iso.cjs +19 -0
- package/node_modules/zod/v4/classic/parse.cjs +19 -0
- package/node_modules/zod/v4/classic/schemas.cjs +100 -35
- package/node_modules/zod/v4/classic/schemas.js +77 -33
- package/node_modules/zod/v4/core/api.cjs +45 -22
- package/node_modules/zod/v4/core/api.js +25 -22
- package/node_modules/zod/v4/core/checks.cjs +51 -97
- package/node_modules/zod/v4/core/checks.js +31 -96
- package/node_modules/zod/v4/core/compile.cjs +173 -78
- package/node_modules/zod/v4/core/compile.js +154 -79
- package/node_modules/zod/v4/core/core.cjs +20 -1
- package/node_modules/zod/v4/core/core.js +1 -1
- package/node_modules/zod/v4/core/doc.cjs +26 -2
- package/node_modules/zod/v4/core/doc.js +7 -2
- package/node_modules/zod/v4/core/errors.cjs +21 -5
- package/node_modules/zod/v4/core/errors.js +2 -5
- package/node_modules/zod/v4/core/index.cjs +19 -0
- package/node_modules/zod/v4/core/json-schema-generator.cjs +20 -1
- package/node_modules/zod/v4/core/json-schema-generator.js +2 -2
- package/node_modules/zod/v4/core/json-schema-processors.cjs +188 -72
- package/node_modules/zod/v4/core/json-schema-processors.js +170 -74
- package/node_modules/zod/v4/core/json-schema.cjs +19 -0
- package/node_modules/zod/v4/core/memoizer.cjs +110 -22
- package/node_modules/zod/v4/core/memoizer.js +68 -22
- package/node_modules/zod/v4/core/parse.cjs +56 -16
- package/node_modules/zod/v4/core/parse.js +37 -16
- package/node_modules/zod/v4/core/regexes.cjs +31 -6
- package/node_modules/zod/v4/core/regexes.js +10 -4
- package/node_modules/zod/v4/core/registries.cjs +19 -0
- package/node_modules/zod/v4/core/schemas.cjs +302 -114
- package/node_modules/zod/v4/core/schemas.js +279 -113
- package/node_modules/zod/v4/core/standard-schema.cjs +19 -0
- package/node_modules/zod/v4/core/to-json-schema.cjs +28 -7
- package/node_modules/zod/v4/core/to-json-schema.js +7 -6
- package/node_modules/zod/v4/core/util.cjs +177 -143
- package/node_modules/zod/v4/core/util.js +156 -143
- package/node_modules/zod/v4/core/versions.cjs +21 -2
- package/node_modules/zod/v4/core/versions.js +2 -2
- package/node_modules/zod/v4/core/visit.cjs +19 -0
- package/node_modules/zod/v4/index.cjs +19 -0
- package/node_modules/zod/v4/locales/ar.cjs +2 -0
- package/node_modules/zod/v4/locales/ar.js +2 -0
- package/node_modules/zod/v4/locales/az.cjs +2 -0
- package/node_modules/zod/v4/locales/az.js +2 -0
- package/node_modules/zod/v4/locales/be.cjs +2 -0
- package/node_modules/zod/v4/locales/be.js +2 -0
- package/node_modules/zod/v4/locales/bg.cjs +2 -0
- package/node_modules/zod/v4/locales/bg.js +2 -0
- package/node_modules/zod/v4/locales/bn.cjs +2 -0
- package/node_modules/zod/v4/locales/bn.js +2 -0
- package/node_modules/zod/v4/locales/ca.cjs +2 -0
- package/node_modules/zod/v4/locales/ca.js +2 -0
- package/node_modules/zod/v4/locales/ckb.cjs +2 -0
- package/node_modules/zod/v4/locales/ckb.js +2 -0
- package/node_modules/zod/v4/locales/cs.cjs +2 -0
- package/node_modules/zod/v4/locales/cs.js +2 -0
- package/node_modules/zod/v4/locales/da.cjs +2 -0
- package/node_modules/zod/v4/locales/da.js +2 -0
- package/node_modules/zod/v4/locales/de.cjs +2 -0
- package/node_modules/zod/v4/locales/de.js +2 -0
- package/node_modules/zod/v4/locales/el.cjs +2 -0
- package/node_modules/zod/v4/locales/el.js +2 -0
- package/node_modules/zod/v4/locales/en.cjs +2 -0
- package/node_modules/zod/v4/locales/en.js +2 -0
- package/node_modules/zod/v4/locales/eo.cjs +2 -0
- package/node_modules/zod/v4/locales/eo.js +2 -0
- package/node_modules/zod/v4/locales/es.cjs +2 -0
- package/node_modules/zod/v4/locales/es.js +2 -0
- package/node_modules/zod/v4/locales/fa.cjs +2 -0
- package/node_modules/zod/v4/locales/fa.js +2 -0
- package/node_modules/zod/v4/locales/fi.cjs +2 -0
- package/node_modules/zod/v4/locales/fi.js +2 -0
- package/node_modules/zod/v4/locales/fr-CA.cjs +2 -0
- package/node_modules/zod/v4/locales/fr-CA.js +2 -0
- package/node_modules/zod/v4/locales/fr.cjs +2 -0
- package/node_modules/zod/v4/locales/fr.js +2 -0
- package/node_modules/zod/v4/locales/gu.cjs +2 -0
- package/node_modules/zod/v4/locales/gu.js +2 -0
- package/node_modules/zod/v4/locales/he.cjs +2 -0
- package/node_modules/zod/v4/locales/he.js +2 -0
- package/node_modules/zod/v4/locales/hi.cjs +2 -0
- package/node_modules/zod/v4/locales/hi.js +2 -0
- package/node_modules/zod/v4/locales/hr.cjs +2 -0
- package/node_modules/zod/v4/locales/hr.js +2 -0
- package/node_modules/zod/v4/locales/hu.cjs +2 -0
- package/node_modules/zod/v4/locales/hu.js +2 -0
- package/node_modules/zod/v4/locales/hy.cjs +2 -0
- package/node_modules/zod/v4/locales/hy.js +2 -0
- package/node_modules/zod/v4/locales/id.cjs +2 -0
- package/node_modules/zod/v4/locales/id.js +2 -0
- package/node_modules/zod/v4/locales/index.cjs +22 -1
- package/node_modules/zod/v4/locales/index.js +1 -0
- package/node_modules/zod/v4/locales/is.cjs +2 -0
- package/node_modules/zod/v4/locales/is.js +2 -0
- package/node_modules/zod/v4/locales/it.cjs +2 -0
- package/node_modules/zod/v4/locales/it.js +2 -0
- package/node_modules/zod/v4/locales/ja.cjs +2 -0
- package/node_modules/zod/v4/locales/ja.js +2 -0
- package/node_modules/zod/v4/locales/ka.cjs +2 -0
- package/node_modules/zod/v4/locales/ka.js +2 -0
- package/node_modules/zod/v4/locales/km.cjs +2 -0
- package/node_modules/zod/v4/locales/km.js +2 -0
- package/node_modules/zod/v4/locales/kn.cjs +2 -0
- package/node_modules/zod/v4/locales/kn.js +2 -0
- package/node_modules/zod/v4/locales/ko.cjs +2 -0
- package/node_modules/zod/v4/locales/ko.js +2 -0
- package/node_modules/zod/v4/locales/lt.cjs +2 -0
- package/node_modules/zod/v4/locales/lt.js +2 -0
- package/node_modules/zod/v4/locales/mk.cjs +2 -0
- package/node_modules/zod/v4/locales/mk.js +2 -0
- package/node_modules/zod/v4/locales/ms.cjs +2 -0
- package/node_modules/zod/v4/locales/ms.js +2 -0
- package/node_modules/zod/v4/locales/ne.cjs +2 -0
- package/node_modules/zod/v4/locales/ne.js +2 -0
- package/node_modules/zod/v4/locales/nl.cjs +2 -0
- package/node_modules/zod/v4/locales/nl.js +2 -0
- package/node_modules/zod/v4/locales/nn.cjs +2 -0
- package/node_modules/zod/v4/locales/nn.js +2 -0
- package/node_modules/zod/v4/locales/no.cjs +2 -0
- package/node_modules/zod/v4/locales/no.js +2 -0
- package/node_modules/zod/v4/locales/ota.cjs +2 -0
- package/node_modules/zod/v4/locales/ota.js +2 -0
- package/node_modules/zod/v4/locales/pl.cjs +2 -0
- package/node_modules/zod/v4/locales/pl.js +2 -0
- package/node_modules/zod/v4/locales/ps.cjs +2 -0
- package/node_modules/zod/v4/locales/ps.js +2 -0
- package/node_modules/zod/v4/locales/pt-BR.cjs +2 -0
- package/node_modules/zod/v4/locales/pt-BR.js +2 -0
- package/node_modules/zod/v4/locales/pt.cjs +2 -0
- package/node_modules/zod/v4/locales/pt.js +2 -0
- package/node_modules/zod/v4/locales/ro.cjs +2 -0
- package/node_modules/zod/v4/locales/ro.js +2 -0
- package/node_modules/zod/v4/locales/ru.cjs +2 -0
- package/node_modules/zod/v4/locales/ru.js +2 -0
- package/node_modules/zod/v4/locales/sk.cjs +2 -0
- package/node_modules/zod/v4/locales/sk.js +2 -0
- package/node_modules/zod/v4/locales/sl.cjs +2 -0
- package/node_modules/zod/v4/locales/sl.js +2 -0
- package/node_modules/zod/v4/locales/sv.cjs +2 -0
- package/node_modules/zod/v4/locales/sv.js +2 -0
- package/node_modules/zod/v4/locales/ta.cjs +2 -0
- package/node_modules/zod/v4/locales/ta.js +2 -0
- package/node_modules/zod/v4/locales/tg.cjs +144 -0
- package/node_modules/zod/v4/locales/tg.js +117 -0
- package/node_modules/zod/v4/locales/th.cjs +2 -0
- package/node_modules/zod/v4/locales/th.js +2 -0
- package/node_modules/zod/v4/locales/tk.cjs +2 -0
- package/node_modules/zod/v4/locales/tk.js +2 -0
- package/node_modules/zod/v4/locales/tr.cjs +2 -0
- package/node_modules/zod/v4/locales/tr.js +2 -0
- package/node_modules/zod/v4/locales/uk.cjs +2 -0
- package/node_modules/zod/v4/locales/uk.js +2 -0
- package/node_modules/zod/v4/locales/ur.cjs +2 -0
- package/node_modules/zod/v4/locales/ur.js +2 -0
- package/node_modules/zod/v4/locales/uz.cjs +2 -0
- package/node_modules/zod/v4/locales/uz.js +2 -0
- package/node_modules/zod/v4/locales/vi.cjs +2 -0
- package/node_modules/zod/v4/locales/vi.js +2 -0
- package/node_modules/zod/v4/locales/yo.cjs +2 -0
- package/node_modules/zod/v4/locales/yo.js +2 -0
- package/node_modules/zod/v4/locales/zh-CN.cjs +2 -0
- package/node_modules/zod/v4/locales/zh-CN.js +2 -0
- package/node_modules/zod/v4/locales/zh-TW.cjs +2 -0
- package/node_modules/zod/v4/locales/zh-TW.js +2 -0
- package/node_modules/zod/v4/mini/checks.cjs +19 -0
- package/node_modules/zod/v4/mini/coerce.cjs +19 -0
- package/node_modules/zod/v4/mini/deep-partial.cjs +19 -0
- package/node_modules/zod/v4/mini/external.cjs +22 -1
- package/node_modules/zod/v4/mini/external.js +1 -1
- package/node_modules/zod/v4/mini/in-out.cjs +19 -0
- package/node_modules/zod/v4/mini/index.cjs +19 -0
- package/node_modules/zod/v4/mini/iso.cjs +19 -0
- package/node_modules/zod/v4/mini/parse.cjs +19 -0
- package/node_modules/zod/v4/mini/schemas.cjs +44 -8
- package/node_modules/zod/v4/mini/schemas.js +21 -6
- package/node_modules/zod/v4-mini/index.cjs +19 -0
- package/package.json +3 -3
- package/node_modules/@maka/runtime/dist/provider-runtime-policy.js +0 -43
- package/node_modules/socks/.eslintrc.cjs +0 -11
package/LICENSE
CHANGED
|
@@ -252,8 +252,8 @@ Copyright (c) 2026 Meta Platforms, Inc.
|
|
|
252
252
|
License: MIT
|
|
253
253
|
|
|
254
254
|
Maka includes an ejected adaptation of Astryx ChatReasoning v0.1.9 and generated
|
|
255
|
-
theme artifacts based on Astryx theme-neutral v0.
|
|
256
|
-
`patches/@astryxdesign+core+0.
|
|
255
|
+
theme artifacts based on Astryx theme-neutral v0.6.1. Maka also redistributes
|
|
256
|
+
`patches/@astryxdesign+core+0.6.1.patch`, which modifies the MIT-licensed Astryx
|
|
257
257
|
core package. The following MIT License applies to that material:
|
|
258
258
|
|
|
259
259
|
MIT License
|
|
@@ -314,10 +314,10 @@ THE SOFTWARE.
|
|
|
314
314
|
|
|
315
315
|
Pi TUI dependency patch
|
|
316
316
|
|
|
317
|
-
Source: https://www.npmjs.com/package/@earendil-works/pi-tui/v/0.
|
|
318
|
-
Repository: https://github.com/earendil-works/pi/tree/v0.
|
|
319
|
-
Version: 0.
|
|
320
|
-
Dependency patch: patches/@earendil-works+pi-tui+0.
|
|
317
|
+
Source: https://www.npmjs.com/package/@earendil-works/pi-tui/v/0.85.1
|
|
318
|
+
Repository: https://github.com/earendil-works/pi/tree/v0.85.1/packages/tui
|
|
319
|
+
Version: 0.85.1
|
|
320
|
+
Dependency patch: patches/@earendil-works+pi-tui+0.85.1.patch
|
|
321
321
|
Copyright (c) 2025 Mario Zechner
|
|
322
322
|
License: MIT
|
|
323
323
|
|
|
@@ -349,10 +349,10 @@ SOFTWARE.
|
|
|
349
349
|
|
|
350
350
|
Zod dependency patch
|
|
351
351
|
|
|
352
|
-
Source: https://www.npmjs.com/package/zod/v/4.5
|
|
352
|
+
Source: https://www.npmjs.com/package/zod/v/4.6.5
|
|
353
353
|
Repository: https://github.com/colinhacks/zod
|
|
354
|
-
Version: 4.5
|
|
355
|
-
Dependency patch: patches/zod+4.5.
|
|
354
|
+
Version: 4.6.5
|
|
355
|
+
Dependency patch: patches/zod+4.6.5.patch
|
|
356
356
|
Copyright (c) 2025 Colin McDonnell
|
|
357
357
|
License: MIT
|
|
358
358
|
|
package/THIRD_PARTY_NOTICES.txt
CHANGED
|
@@ -616,7 +616,7 @@ Apache License
|
|
|
616
616
|
|
|
617
617
|
================================================================================
|
|
618
618
|
|
|
619
|
-
Package: @earendil-works/pi-tui@0.
|
|
619
|
+
Package: @earendil-works/pi-tui@0.85.1
|
|
620
620
|
Declared license: MIT
|
|
621
621
|
Selected license: MIT
|
|
622
622
|
Repository: git+https://github.com/earendil-works/pi.git#packages/tui
|
|
@@ -664,7 +664,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
|
|
|
664
664
|
|
|
665
665
|
================================================================================
|
|
666
666
|
|
|
667
|
-
Package: @formatjs/icu-messageformat-parser@3.5.
|
|
667
|
+
Package: @formatjs/icu-messageformat-parser@3.5.18
|
|
668
668
|
Declared license: MIT
|
|
669
669
|
Selected license: MIT
|
|
670
670
|
Repository: https://github.com/formatjs/formatjs.git#packages/icu-messageformat-parser
|
|
@@ -700,7 +700,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
|
|
|
700
700
|
|
|
701
701
|
================================================================================
|
|
702
702
|
|
|
703
|
-
Package: @larksuiteoapi/node-sdk@1.73.
|
|
703
|
+
Package: @larksuiteoapi/node-sdk@1.73.3
|
|
704
704
|
Declared license: MIT
|
|
705
705
|
Selected license: MIT
|
|
706
706
|
Repository: https://github.com/larksuite/node-sdk.git
|
|
@@ -1224,7 +1224,7 @@ limitations under the License.
|
|
|
1224
1224
|
|
|
1225
1225
|
================================================================================
|
|
1226
1226
|
|
|
1227
|
-
Package: @openai/agents-core@0.
|
|
1227
|
+
Package: @openai/agents-core@0.18.0
|
|
1228
1228
|
Declared license: MIT
|
|
1229
1229
|
Selected license: MIT
|
|
1230
1230
|
Repository: https://github.com/openai/openai-agents-js
|
|
@@ -1723,7 +1723,7 @@ SOFTWARE.
|
|
|
1723
1723
|
|
|
1724
1724
|
================================================================================
|
|
1725
1725
|
|
|
1726
|
-
Package: @types/node@26.
|
|
1726
|
+
Package: @types/node@26.5.1
|
|
1727
1727
|
Declared license: MIT
|
|
1728
1728
|
Selected license: MIT
|
|
1729
1729
|
Repository: https://github.com/DefinitelyTyped/DefinitelyTyped.git#types/node
|
|
@@ -4739,7 +4739,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
|
|
|
4739
4739
|
|
|
4740
4740
|
================================================================================
|
|
4741
4741
|
|
|
4742
|
-
Package: intl-messageformat@11.2.
|
|
4742
|
+
Package: intl-messageformat@11.2.15
|
|
4743
4743
|
Declared license: BSD-3-Clause
|
|
4744
4744
|
Selected license: BSD-3-Clause
|
|
4745
4745
|
Repository: git@github.com:formatjs/formatjs.git
|
|
@@ -7265,7 +7265,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
|
7265
7265
|
|
|
7266
7266
|
================================================================================
|
|
7267
7267
|
|
|
7268
|
-
Package: socks@2.8.
|
|
7268
|
+
Package: socks@2.8.10
|
|
7269
7269
|
Declared license: MIT
|
|
7270
7270
|
Selected license: MIT
|
|
7271
7271
|
Repository: git+https://github.com/JoshGlazebrook/socks.git
|
|
@@ -7361,7 +7361,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
|
|
|
7361
7361
|
|
|
7362
7362
|
================================================================================
|
|
7363
7363
|
|
|
7364
|
-
Package: systeminformation@5.33.
|
|
7364
|
+
Package: systeminformation@5.33.10
|
|
7365
7365
|
Declared license: MIT
|
|
7366
7366
|
Selected license: MIT
|
|
7367
7367
|
Repository: git+https://github.com/sebhildebrandt/systeminformation.git
|
|
@@ -7474,7 +7474,7 @@ SOFTWARE.
|
|
|
7474
7474
|
|
|
7475
7475
|
================================================================================
|
|
7476
7476
|
|
|
7477
|
-
Package: undici@8.10.
|
|
7477
|
+
Package: undici@8.10.2
|
|
7478
7478
|
Declared license: MIT
|
|
7479
7479
|
Selected license: MIT
|
|
7480
7480
|
Repository: git+https://github.com/nodejs/undici.git
|
|
@@ -7504,7 +7504,7 @@ SOFTWARE.
|
|
|
7504
7504
|
|
|
7505
7505
|
================================================================================
|
|
7506
7506
|
|
|
7507
|
-
Package: undici-types@8.
|
|
7507
|
+
Package: undici-types@8.9.0
|
|
7508
7508
|
Declared license: MIT
|
|
7509
7509
|
Selected license: MIT
|
|
7510
7510
|
Repository: git+https://github.com/nodejs/undici.git
|
|
@@ -7859,7 +7859,7 @@ THIS SOFTWARE.
|
|
|
7859
7859
|
|
|
7860
7860
|
================================================================================
|
|
7861
7861
|
|
|
7862
|
-
Package: yaml@2.9.
|
|
7862
|
+
Package: yaml@2.9.1
|
|
7863
7863
|
Declared license: ISC
|
|
7864
7864
|
Selected license: ISC
|
|
7865
7865
|
Repository: github:eemeli/yaml
|
|
@@ -7934,7 +7934,7 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
|
7934
7934
|
|
|
7935
7935
|
================================================================================
|
|
7936
7936
|
|
|
7937
|
-
Package: zod@4.5
|
|
7937
|
+
Package: zod@4.6.5
|
|
7938
7938
|
Declared license: MIT
|
|
7939
7939
|
Selected license: MIT
|
|
7940
7940
|
Repository: git+https://github.com/colinhacks/zod.git
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Licensed to the Apache Software Foundation (ASF) under one
|
|
3
|
+
* or more contributor license agreements. See the NOTICE file
|
|
4
|
+
* distributed with this work for additional information
|
|
5
|
+
* regarding copyright ownership. The ASF licenses this file
|
|
6
|
+
* to you under the Apache License, Version 2.0 (the
|
|
7
|
+
* "License"); you may not use this file except in compliance
|
|
8
|
+
* with the License. You may obtain a copy of the License at
|
|
9
|
+
*
|
|
10
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
11
|
+
*
|
|
12
|
+
* Unless required by applicable law or agreed to in writing,
|
|
13
|
+
* software distributed under the License is distributed on an
|
|
14
|
+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
15
|
+
* KIND, either express or implied. See the License for the
|
|
16
|
+
* specific language governing permissions and limitations
|
|
17
|
+
* under the License.
|
|
18
|
+
*/
|
|
19
|
+
/** Races cooperative work against cancellation while observing the losing task. */
|
|
20
|
+
export function whileActive(task, signal) {
|
|
21
|
+
return new Promise((resolve, reject) => {
|
|
22
|
+
const cancelled = () => resolve({ active: false });
|
|
23
|
+
if (signal.aborted)
|
|
24
|
+
cancelled();
|
|
25
|
+
else
|
|
26
|
+
signal.addEventListener('abort', cancelled, { once: true });
|
|
27
|
+
task.then((value) => {
|
|
28
|
+
signal.removeEventListener('abort', cancelled);
|
|
29
|
+
resolve(signal.aborted ? { active: false } : { active: true, value });
|
|
30
|
+
}, (error) => {
|
|
31
|
+
signal.removeEventListener('abort', cancelled);
|
|
32
|
+
if (signal.aborted)
|
|
33
|
+
resolve({ active: false });
|
|
34
|
+
else
|
|
35
|
+
reject(error);
|
|
36
|
+
});
|
|
37
|
+
});
|
|
38
|
+
}
|
|
@@ -18,21 +18,26 @@
|
|
|
18
18
|
*/
|
|
19
19
|
import { foldRuntimeHostAssistantDelta } from '@maka/runtime-host/adapter';
|
|
20
20
|
import { RequestError, } from '@agentclientprotocol/sdk';
|
|
21
|
+
import { whileActive } from './active-promise.js';
|
|
22
|
+
import { AcpToolEventMapper } from './tool-event-mapper.js';
|
|
21
23
|
/** Serializes one ACP prompt's live projection delivery. */
|
|
22
24
|
export class AcpSessionEventMapper {
|
|
23
25
|
#sessionId;
|
|
24
26
|
#notify;
|
|
27
|
+
#signal;
|
|
25
28
|
#streams = new Map();
|
|
29
|
+
#tools;
|
|
26
30
|
#tail = Promise.resolve();
|
|
27
31
|
#failure;
|
|
32
|
+
#failed = false;
|
|
28
33
|
constructor(options) {
|
|
29
34
|
this.#sessionId = options.sessionId;
|
|
30
35
|
this.#notify = options.notify;
|
|
36
|
+
this.#signal = options.signal;
|
|
37
|
+
this.#tools = new AcpToolEventMapper((update) => this.#deliver({ sessionId: this.#sessionId, update }));
|
|
31
38
|
}
|
|
32
39
|
accept(event) {
|
|
33
40
|
return this.#enqueue(async () => {
|
|
34
|
-
if (this.#failure)
|
|
35
|
-
throw this.#failure;
|
|
36
41
|
switch (event.type) {
|
|
37
42
|
case 'text_delta':
|
|
38
43
|
await this.#acceptText('text', event.messageId, deltaText(event, this.#streams.get(streamKey('text', event.messageId))));
|
|
@@ -46,26 +51,45 @@ export class AcpSessionEventMapper {
|
|
|
46
51
|
case 'thinking_complete':
|
|
47
52
|
await this.#acceptText('thinking', event.messageId, event.text);
|
|
48
53
|
break;
|
|
54
|
+
case 'tool_start':
|
|
55
|
+
case 'tool_output_delta':
|
|
56
|
+
case 'tool_progress':
|
|
57
|
+
case 'tool_result_preview':
|
|
58
|
+
case 'tool_result':
|
|
59
|
+
await this.#tools.accept(event);
|
|
60
|
+
break;
|
|
49
61
|
default:
|
|
50
62
|
break;
|
|
51
63
|
}
|
|
52
64
|
});
|
|
53
65
|
}
|
|
54
66
|
replaceTranscript(turnId, messages) {
|
|
67
|
+
return this.acceptTranscriptMessages(turnId, messages);
|
|
68
|
+
}
|
|
69
|
+
/** Apply a bounded authoritative batch; absence from one batch never removes a tool. */
|
|
70
|
+
acceptTranscriptMessages(turnId, messages) {
|
|
55
71
|
return this.#enqueue(async () => {
|
|
56
|
-
if (this.#failure)
|
|
57
|
-
throw this.#failure;
|
|
58
72
|
for (const message of messages) {
|
|
59
|
-
if (message.turnId !== turnId
|
|
73
|
+
if (message.turnId !== turnId)
|
|
60
74
|
continue;
|
|
61
|
-
|
|
62
|
-
|
|
75
|
+
if (message.type === 'assistant') {
|
|
76
|
+
await this.#acceptText('thinking', message.id, message.thinking?.text ?? '');
|
|
77
|
+
await this.#acceptText('text', message.id, message.text);
|
|
78
|
+
}
|
|
79
|
+
else
|
|
80
|
+
await this.#tools.acceptMessage(message);
|
|
63
81
|
}
|
|
64
82
|
});
|
|
65
83
|
}
|
|
84
|
+
finishTools(turnId, terminalStatus = 'completed') {
|
|
85
|
+
return this.#enqueue(() => this.#tools.finishTools(turnId, terminalStatus));
|
|
86
|
+
}
|
|
66
87
|
/** Waits until every notification already accepted by this mapper has settled. */
|
|
67
88
|
flush() {
|
|
68
|
-
return this.#tail.then(() =>
|
|
89
|
+
return this.#tail.then(() => {
|
|
90
|
+
if (this.#failed)
|
|
91
|
+
throw this.#failure;
|
|
92
|
+
});
|
|
69
93
|
}
|
|
70
94
|
async #acceptText(kind, hostMessageId, nextText) {
|
|
71
95
|
const key = streamKey(kind, hostMessageId);
|
|
@@ -84,10 +108,29 @@ export class AcpSessionEventMapper {
|
|
|
84
108
|
content: { type: 'text', text: chunk },
|
|
85
109
|
messageId: hostMessageId,
|
|
86
110
|
};
|
|
87
|
-
await this.#
|
|
111
|
+
await this.#deliver({ sessionId: this.#sessionId, update });
|
|
112
|
+
}
|
|
113
|
+
async #deliver(notification) {
|
|
114
|
+
if (this.#signal?.aborted)
|
|
115
|
+
return;
|
|
116
|
+
const delivery = this.#notify(notification);
|
|
117
|
+
if (!this.#signal)
|
|
118
|
+
return delivery;
|
|
119
|
+
await whileActive(delivery, this.#signal);
|
|
88
120
|
}
|
|
89
121
|
#enqueue(operation) {
|
|
90
|
-
const result = this.#tail.then(
|
|
122
|
+
const result = this.#tail.then(async () => {
|
|
123
|
+
if (this.#failed)
|
|
124
|
+
throw this.#failure;
|
|
125
|
+
try {
|
|
126
|
+
return await operation();
|
|
127
|
+
}
|
|
128
|
+
catch (error) {
|
|
129
|
+
this.#failure = error;
|
|
130
|
+
this.#failed = true;
|
|
131
|
+
throw error;
|
|
132
|
+
}
|
|
133
|
+
});
|
|
91
134
|
this.#tail = result.then(() => undefined, () => undefined);
|
|
92
135
|
return result;
|
|
93
136
|
}
|
|
@@ -133,6 +133,8 @@ export class AcpSessionRegistry {
|
|
|
133
133
|
}
|
|
134
134
|
async #prompt(params, context) {
|
|
135
135
|
const turnId = this.#newTurnId();
|
|
136
|
+
const projectionAbort = new AbortController();
|
|
137
|
+
const reconciliationAbort = new AbortController();
|
|
136
138
|
const active = {
|
|
137
139
|
sessionId: params.sessionId,
|
|
138
140
|
turnId,
|
|
@@ -143,8 +145,11 @@ export class AcpSessionRegistry {
|
|
|
143
145
|
await context.notify(notification);
|
|
144
146
|
}
|
|
145
147
|
},
|
|
148
|
+
signal: projectionAbort.signal,
|
|
146
149
|
}),
|
|
147
150
|
waiters: new Set(),
|
|
151
|
+
projectionAbort,
|
|
152
|
+
reconciliationAbort,
|
|
148
153
|
dispatchStarted: false,
|
|
149
154
|
startRequestSettled: false,
|
|
150
155
|
admissionSettled: false,
|
|
@@ -209,6 +214,7 @@ export class AcpSessionRegistry {
|
|
|
209
214
|
}
|
|
210
215
|
if (active.cancelled)
|
|
211
216
|
return { stopReason: await this.#cancelledStopReason(active) };
|
|
217
|
+
active.transcript = attachment.trackPromptTranscript(turnId);
|
|
212
218
|
const observation = this.#consumePromptEvents(active, attachment.eventsForTurn(turnId));
|
|
213
219
|
// Mark the observer as handled immediately: turn.start may still be in flight
|
|
214
220
|
// when the live subscription reports a failure.
|
|
@@ -265,17 +271,37 @@ export class AcpSessionRegistry {
|
|
|
265
271
|
// A terminal subscription event can precede the Stop response. Retain this
|
|
266
272
|
// prompt so close/dispose cannot release its connection while Stop is in flight.
|
|
267
273
|
await active.stopTask?.catch(() => undefined);
|
|
274
|
+
active.projectionAbort.abort();
|
|
275
|
+
active.reconciliationAbort.abort();
|
|
276
|
+
active.transcript?.dispose();
|
|
268
277
|
active.finished = true;
|
|
269
278
|
this.#wake(active);
|
|
270
279
|
this.#removeActivePrompt(active);
|
|
271
280
|
}
|
|
272
281
|
}
|
|
273
282
|
async #consumePromptEvents(active, events) {
|
|
283
|
+
let terminalStatus = 'completed';
|
|
274
284
|
try {
|
|
275
285
|
for await (const event of events) {
|
|
286
|
+
if (event.type === 'abort')
|
|
287
|
+
terminalStatus = 'cancelled';
|
|
288
|
+
else if (event.type === 'error' && !event.recoverable)
|
|
289
|
+
terminalStatus = 'failed';
|
|
290
|
+
if (terminalStatus !== 'completed')
|
|
291
|
+
active.reconciliationAbort.abort();
|
|
276
292
|
if (!active.cancelled)
|
|
277
293
|
await active.mapper.accept(event);
|
|
278
294
|
}
|
|
295
|
+
if (active.cancelled)
|
|
296
|
+
return this.#cancelledStopReason(active);
|
|
297
|
+
if (terminalStatus === 'completed')
|
|
298
|
+
await this.#reconcilePrompt(active, true);
|
|
299
|
+
else
|
|
300
|
+
active.reconciliationAbort.abort();
|
|
301
|
+
if (active.projectionFailure)
|
|
302
|
+
throw active.projectionFailure;
|
|
303
|
+
await active.mapper.finishTools(active.turnId, terminalStatus);
|
|
304
|
+
await active.mapper.flush();
|
|
279
305
|
return active.cancelled ? this.#cancelledStopReason(active) : 'end_turn';
|
|
280
306
|
}
|
|
281
307
|
catch (error) {
|
|
@@ -284,8 +310,29 @@ export class AcpSessionRegistry {
|
|
|
284
310
|
throw error;
|
|
285
311
|
}
|
|
286
312
|
}
|
|
313
|
+
async #reconcilePrompt(active, replay = false) {
|
|
314
|
+
if (active.cancelled || active.finished || !active.transcript)
|
|
315
|
+
return;
|
|
316
|
+
try {
|
|
317
|
+
await active.transcript.reconcile((messages) => active.mapper.acceptTranscriptMessages(active.turnId, messages), AbortSignal.any([active.projectionAbort.signal, active.reconciliationAbort.signal]),
|
|
318
|
+
// One final replay observes revisions below the consumed cut before end_turn.
|
|
319
|
+
{ replay });
|
|
320
|
+
}
|
|
321
|
+
catch (error) {
|
|
322
|
+
if (active.cancelled ||
|
|
323
|
+
active.finished ||
|
|
324
|
+
active.projectionAbort.signal.aborted ||
|
|
325
|
+
active.reconciliationAbort.signal.aborted)
|
|
326
|
+
return;
|
|
327
|
+
active.projectionFailure ??= error;
|
|
328
|
+
active.attachment?.failTurn(active.turnId, error);
|
|
329
|
+
throw error;
|
|
330
|
+
}
|
|
331
|
+
}
|
|
287
332
|
async #cancelledStopReason(active) {
|
|
288
|
-
|
|
333
|
+
// A failed notification must not change the outcome of an explicit Host
|
|
334
|
+
// cancellation. The projection failure still fails uncancelled prompts.
|
|
335
|
+
await active.mapper.flush().catch(() => undefined);
|
|
289
336
|
return 'cancelled';
|
|
290
337
|
}
|
|
291
338
|
#cancelSession(sessionId) {
|
|
@@ -317,9 +364,11 @@ export class AcpSessionRegistry {
|
|
|
317
364
|
if ([...(this.#activePrompts.get(active.sessionId) ?? [])].every((prompt) => prompt.cancelled && !prompt.dispatchStarted)) {
|
|
318
365
|
this.#attachmentOpenControllers.get(active.sessionId)?.abort();
|
|
319
366
|
}
|
|
367
|
+
active.projectionAbort.abort();
|
|
368
|
+
active.reconciliationAbort.abort();
|
|
320
369
|
active.stopTask ??= this.#stopPromptWhenObservable(active);
|
|
321
370
|
await Promise.all([
|
|
322
|
-
active.mapper.flush(),
|
|
371
|
+
active.mapper.flush().catch(() => undefined),
|
|
323
372
|
active.stopTask.catch((error) => {
|
|
324
373
|
// End only this prompt's observation. Failed delivery does not establish
|
|
325
374
|
// a terminal Host Turn, and teardown still receives the original error.
|
|
@@ -490,12 +539,16 @@ export class AcpSessionRegistry {
|
|
|
490
539
|
// identity so a later ACP cancel/close can still stop that root.
|
|
491
540
|
return;
|
|
492
541
|
}
|
|
493
|
-
//
|
|
494
|
-
// Retire observation so the prompt's existing failure path stops its exact Turn.
|
|
542
|
+
// Interaction mapping is added by the next independently reviewable ACP increment.
|
|
495
543
|
failAttachment(RequestError.internalError({ source: 'adapter', code: 'unsupported_interaction', kind: pending.request.kind }, 'This ACP adapter does not support interactions yet; the prompt failed'));
|
|
496
544
|
},
|
|
497
545
|
onInteractionResolved: () => undefined,
|
|
498
|
-
onTranscriptSettlement: () =>
|
|
546
|
+
onTranscriptSettlement: (turnId) => {
|
|
547
|
+
for (const active of this.#activePrompts.get(sessionId) ?? []) {
|
|
548
|
+
if (active.turnId === turnId)
|
|
549
|
+
void this.#reconcilePrompt(active).catch(() => undefined);
|
|
550
|
+
}
|
|
551
|
+
},
|
|
499
552
|
onGoalChanged: () => undefined,
|
|
500
553
|
onFailed: failAttachment,
|
|
501
554
|
onRecovered: () => {
|