maka-agent 0.2.0-dev.28.20260911 → 0.2.0-dev.29.20260912
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 +54 -3
- package/THIRD_PARTY_NOTICES.txt +14 -14
- package/dist/onboarding-catalog.js +1 -0
- package/dist/pi-tui-pickers.js +183 -21
- package/dist/pi-tui-runner.js +150 -18
- package/dist/runtime-host-onboarding.js +345 -5
- package/dist/runtime-host-session-driver.js +18 -0
- package/dist/runtime-host-tui-command.js +21 -5
- package/dist/runtime-host-tui-context.js +19 -5
- package/dist/tui-copy-catalog.js +93 -9
- package/native/runtime-host-windows-task-launcher/prebuilds/win32-x64/maka-runtime-host-task-launcher.exe +0 -0
- package/node_modules/@ai-sdk/anthropic/CHANGELOG.md +66 -0
- package/node_modules/@ai-sdk/anthropic/dist/index.js +375 -197
- package/node_modules/@ai-sdk/anthropic/dist/internal/index.js +181 -74
- package/node_modules/@ai-sdk/anthropic/docs/05-anthropic.mdx +123 -43
- package/node_modules/@ai-sdk/{provider → anthropic/node_modules/@ai-sdk/provider}/CHANGELOG.md +32 -0
- package/node_modules/@ai-sdk/{provider → anthropic/node_modules/@ai-sdk/provider}/package.json +1 -1
- package/node_modules/@ai-sdk/anthropic/package.json +3 -3
- package/node_modules/@ai-sdk/cohere/CHANGELOG.md +53 -0
- package/node_modules/@ai-sdk/cohere/dist/index.js +1 -1
- package/node_modules/@ai-sdk/cohere/node_modules/@ai-sdk/provider/CHANGELOG.md +1262 -0
- package/node_modules/@ai-sdk/cohere/node_modules/@ai-sdk/provider/README.md +1 -0
- package/node_modules/@ai-sdk/cohere/node_modules/@ai-sdk/provider/dist/index.js +426 -0
- package/node_modules/@ai-sdk/cohere/node_modules/@ai-sdk/provider/package.json +63 -0
- package/node_modules/@ai-sdk/cohere/package.json +3 -3
- package/node_modules/@ai-sdk/google/CHANGELOG.md +92 -0
- package/node_modules/@ai-sdk/google/dist/index.js +941 -420
- package/node_modules/@ai-sdk/google/dist/internal/index.js +394 -103
- package/node_modules/@ai-sdk/google/docs/15-google.mdx +195 -85
- package/node_modules/@ai-sdk/google/node_modules/@ai-sdk/provider/CHANGELOG.md +1262 -0
- package/node_modules/@ai-sdk/google/node_modules/@ai-sdk/provider/README.md +1 -0
- package/node_modules/@ai-sdk/google/node_modules/@ai-sdk/provider/dist/index.js +426 -0
- package/node_modules/@ai-sdk/google/node_modules/@ai-sdk/provider/package.json +63 -0
- package/node_modules/@ai-sdk/google/package.json +3 -3
- package/node_modules/@ai-sdk/open-responses/CHANGELOG.md +65 -0
- package/node_modules/@ai-sdk/open-responses/dist/index.js +51 -13
- package/node_modules/@ai-sdk/open-responses/docs/06-open-responses.mdx +7 -0
- package/node_modules/@ai-sdk/open-responses/node_modules/@ai-sdk/provider/CHANGELOG.md +1262 -0
- package/node_modules/@ai-sdk/open-responses/node_modules/@ai-sdk/provider/README.md +1 -0
- package/node_modules/@ai-sdk/open-responses/node_modules/@ai-sdk/provider/dist/index.js +426 -0
- package/node_modules/@ai-sdk/open-responses/node_modules/@ai-sdk/provider/package.json +63 -0
- package/node_modules/@ai-sdk/open-responses/package.json +3 -3
- package/node_modules/@ai-sdk/openai/CHANGELOG.md +118 -0
- package/node_modules/@ai-sdk/openai/dist/index.js +1080 -316
- package/node_modules/@ai-sdk/openai/dist/internal/index.js +549 -157
- package/node_modules/@ai-sdk/openai/docs/03-openai.mdx +202 -66
- package/node_modules/@ai-sdk/openai/node_modules/@ai-sdk/provider/CHANGELOG.md +1262 -0
- package/node_modules/@ai-sdk/openai/node_modules/@ai-sdk/provider/LICENSE +13 -0
- package/node_modules/@ai-sdk/openai/node_modules/@ai-sdk/provider/README.md +1 -0
- package/node_modules/@ai-sdk/openai/node_modules/@ai-sdk/provider/dist/index.js +426 -0
- package/node_modules/@ai-sdk/openai/node_modules/@ai-sdk/provider/package.json +63 -0
- package/node_modules/@ai-sdk/openai/package.json +3 -3
- package/node_modules/@ai-sdk/openai-compatible/CHANGELOG.md +60 -0
- package/node_modules/@ai-sdk/openai-compatible/dist/index.js +8 -2
- package/node_modules/@ai-sdk/openai-compatible/docs/index.mdx +0 -1
- package/node_modules/@ai-sdk/openai-compatible/node_modules/@ai-sdk/provider/CHANGELOG.md +1262 -0
- package/node_modules/@ai-sdk/openai-compatible/node_modules/@ai-sdk/provider/LICENSE +13 -0
- package/node_modules/@ai-sdk/openai-compatible/node_modules/@ai-sdk/provider/README.md +1 -0
- package/node_modules/@ai-sdk/openai-compatible/node_modules/@ai-sdk/provider/dist/index.js +426 -0
- package/node_modules/@ai-sdk/openai-compatible/node_modules/@ai-sdk/provider/package.json +63 -0
- package/node_modules/@ai-sdk/openai-compatible/package.json +3 -3
- package/node_modules/@ai-sdk/provider-utils/CHANGELOG.md +48 -0
- package/node_modules/@ai-sdk/provider-utils/dist/index.js +485 -181
- package/node_modules/@ai-sdk/provider-utils/node_modules/@ai-sdk/provider/CHANGELOG.md +1262 -0
- package/node_modules/@ai-sdk/provider-utils/node_modules/@ai-sdk/provider/LICENSE +13 -0
- package/node_modules/@ai-sdk/provider-utils/node_modules/@ai-sdk/provider/README.md +1 -0
- package/node_modules/@ai-sdk/provider-utils/node_modules/@ai-sdk/provider/dist/index.js +426 -0
- package/node_modules/@ai-sdk/provider-utils/node_modules/@ai-sdk/provider/package.json +63 -0
- package/node_modules/@ai-sdk/provider-utils/package.json +3 -3
- package/node_modules/@maka/core/dist/chat-model-choice.js +1 -2
- package/node_modules/@maka/core/dist/collaboration.js +12 -0
- package/node_modules/@maka/core/dist/llm-connections.js +1 -1
- package/node_modules/@maka/core/dist/model-catalog.js +26 -103
- package/node_modules/@maka/core/dist/model-facts.js +0 -74
- package/node_modules/@maka/core/dist/model-thinking.js +70 -38
- package/node_modules/@maka/core/dist/permission-profile.js +17 -0
- package/node_modules/@maka/core/dist/provider-registry.js +1 -3
- package/node_modules/@maka/core/dist/runtime-policy/connection-catalog-codec.js +68 -46
- package/node_modules/@maka/core/dist/runtime-policy/model-catalog-entry-codec.js +21 -12
- package/node_modules/@maka/core/dist/runtime-policy/policy-codec.js +43 -4
- package/node_modules/@maka/core/dist/runtime-policy.js +3 -2
- package/node_modules/@maka/core/dist/scheduled-task.js +8 -2
- package/node_modules/@maka/core/dist/settings.js +12 -0
- package/node_modules/@maka/runtime/dist/agent-run.js +8 -1
- package/node_modules/@maka/runtime/dist/agent-swarm-status-tool.js +0 -1
- package/node_modules/@maka/runtime/dist/ai-sdk-backend.js +1 -0
- package/node_modules/@maka/runtime/dist/ai-sdk-turn.js +42 -50
- package/node_modules/@maka/runtime/dist/ask-user-question-tool.js +0 -1
- package/node_modules/@maka/runtime/dist/bots/dingtalk-bridge.js +86 -19
- package/node_modules/@maka/runtime/dist/code-mode.js +7 -4
- package/node_modules/@maka/runtime/dist/context-budget-policy.js +6 -24
- package/node_modules/@maka/runtime/dist/model-adapter.js +13 -3
- package/node_modules/@maka/runtime/dist/model-factory.js +1 -1
- package/node_modules/@maka/runtime/dist/plan-tools.js +0 -3
- package/node_modules/@maka/runtime/dist/runtime-kernel.js +70 -14
- package/node_modules/@maka/runtime/dist/session-manager.js +137 -23
- package/node_modules/@maka/runtime/dist/session-trace-projection.js +22 -0
- package/node_modules/@maka/runtime/dist/stream-graph-supervisor-tools.js +0 -3
- package/node_modules/@maka/runtime/dist/subagent-tools.js +0 -3
- package/node_modules/@maka/runtime/dist/tool-availability.js +0 -1
- package/node_modules/@maka/runtime/dist/tool-runtime.js +27 -3
- package/node_modules/@maka/runtime/node_modules/@ai-sdk/code-mode/LICENSE +13 -0
- package/node_modules/{@ai-sdk → @maka/runtime/node_modules/@ai-sdk}/code-mode/dist/run-code-mode.js +2 -0
- package/node_modules/{@ai-sdk → @maka/runtime/node_modules/@ai-sdk}/code-mode/package.json +3 -3
- package/node_modules/{@ai-sdk → @maka/runtime/node_modules/@ai-sdk}/gateway/CHANGELOG.md +101 -0
- package/node_modules/@maka/runtime/node_modules/@ai-sdk/gateway/LICENSE +13 -0
- package/node_modules/{@ai-sdk → @maka/runtime/node_modules/@ai-sdk}/gateway/dist/index.js +309 -244
- package/node_modules/{@ai-sdk → @maka/runtime/node_modules/@ai-sdk}/gateway/docs/00-ai-gateway.mdx +29 -16
- package/node_modules/{@ai-sdk → @maka/runtime/node_modules/@ai-sdk}/gateway/package.json +3 -3
- package/node_modules/@maka/runtime/node_modules/@ai-sdk/provider/CHANGELOG.md +1262 -0
- package/node_modules/@maka/runtime/node_modules/@ai-sdk/provider/LICENSE +13 -0
- package/node_modules/@maka/runtime/node_modules/@ai-sdk/provider/README.md +1 -0
- package/node_modules/@maka/runtime/node_modules/@ai-sdk/provider/dist/index.js +426 -0
- package/node_modules/@maka/runtime/node_modules/@ai-sdk/provider/package.json +63 -0
- package/node_modules/{ai → @maka/runtime/node_modules/ai}/CHANGELOG.md +152 -0
- package/node_modules/@maka/runtime/node_modules/ai/LICENSE +13 -0
- package/node_modules/{ai → @maka/runtime/node_modules/ai}/dist/index.js +2505 -1548
- package/node_modules/{ai → @maka/runtime/node_modules/ai}/dist/internal/index.js +129 -107
- package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/02-foundations/02-providers-and-models.mdx +8 -1
- package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/03-agents/04-loop-control.mdx +5 -3
- package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/03-agents/06-policy-tool-approvals.mdx +2 -1
- package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/03-agents/06-tool-approvals.mdx +13 -7
- package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/03-agents/07-workflow-agent.mdx +94 -10
- package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/03-ai-sdk-core/10-generating-structured-data.mdx +15 -3
- package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/03-ai-sdk-core/15-tools-and-tool-calling.mdx +2 -1
- package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/03-ai-sdk-core/16-mcp-tools.mdx +64 -1
- package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/03-ai-sdk-core/35-image-generation.mdx +11 -0
- package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/03-ai-sdk-core/36-transcription.mdx +36 -35
- package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/03-ai-sdk-core/37-speech.mdx +0 -17
- package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/03-ai-sdk-core/39-file-uploads.mdx +25 -0
- package/node_modules/@maka/runtime/node_modules/ai/docs/03-ai-sdk-core/42-batch.mdx +372 -0
- package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/03-ai-sdk-core/50-error-handling.mdx +83 -6
- package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/03-ai-sdk-core/60-telemetry.mdx +28 -5
- package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/03-ai-sdk-core/index.mdx +5 -0
- package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/03-ai-sdk-harnesses/02-harness-agent.mdx +40 -0
- package/node_modules/@maka/runtime/node_modules/ai/docs/03-ai-sdk-harnesses/05-harness-adapters.mdx +47 -0
- package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/04-ai-sdk-ui/03-chatbot-tool-usage.mdx +23 -1
- package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/04-ai-sdk-ui/20-streaming-data.mdx +11 -6
- package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/04-ai-sdk-ui/50-stream-protocol.mdx +6 -2
- package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/06-advanced/04-caching.mdx +7 -0
- package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/06-advanced/11-secure-url-fetching.mdx +7 -1
- package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/07-reference/01-ai-sdk-core/01-generate-text.mdx +14 -0
- package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/07-reference/01-ai-sdk-core/02-stream-text.mdx +39 -5
- package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/07-reference/01-ai-sdk-core/05-embed.mdx +31 -5
- package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/07-reference/01-ai-sdk-core/06-embed-many.mdx +32 -6
- package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/07-reference/01-ai-sdk-core/06-rerank.mdx +19 -5
- package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/07-reference/01-ai-sdk-core/10-generate-image.mdx +2 -1
- package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/07-reference/01-ai-sdk-core/14-upload-file.mdx +37 -4
- package/node_modules/@maka/runtime/node_modules/ai/docs/07-reference/01-ai-sdk-core/20-start-batch.mdx +154 -0
- package/node_modules/@maka/runtime/node_modules/ai/docs/07-reference/01-ai-sdk-core/21-get-batch-status.mdx +133 -0
- package/node_modules/@maka/runtime/node_modules/ai/docs/07-reference/01-ai-sdk-core/22-get-batch-results.mdx +109 -0
- package/node_modules/@maka/runtime/node_modules/ai/docs/07-reference/01-ai-sdk-core/23-cancel-batch.mdx +96 -0
- package/node_modules/@maka/runtime/node_modules/ai/docs/07-reference/01-ai-sdk-core/24-list-batches.mdx +121 -0
- package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/07-reference/01-ai-sdk-core/28-output.mdx +27 -1
- package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/07-reference/01-ai-sdk-core/31-ui-message.mdx +63 -0
- package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/07-reference/01-ai-sdk-core/80-smooth-stream.mdx +1 -1
- package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/07-reference/01-ai-sdk-core/index.mdx +25 -0
- package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/07-reference/02-ai-sdk-ui/01-use-chat.mdx +1 -1
- package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/07-reference/02-ai-sdk-ui/40-create-ui-message-stream.mdx +4 -0
- package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/07-reference/02-ai-sdk-ui/41-create-ui-message-stream-response.mdx +6 -1
- package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/07-reference/04-ai-sdk-workflow/01-workflow-agent.mdx +101 -34
- package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/07-reference/05-ai-sdk-errors/ai-invalid-argument-error.mdx +6 -1
- package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/07-reference/05-ai-sdk-errors/ai-no-image-generated-error.mdx +7 -0
- package/node_modules/@maka/runtime/node_modules/ai/docs/07-reference/05-ai-sdk-errors/ai-tool-choice-violation-error.mdx +38 -0
- package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/07-reference/05-ai-sdk-errors/index.mdx +1 -0
- package/node_modules/{ai → @maka/runtime/node_modules/ai}/package.json +12 -12
- package/node_modules/@maka/runtime/package.json +9 -9
- package/node_modules/@maka/runtime-host/dist/adapter/session-projector.js +17 -36
- package/node_modules/@maka/runtime-host/dist/client/catalog-reader.js +5 -7
- package/node_modules/@maka/runtime-host/dist/protocol/external-agent-setup.js +149 -0
- package/node_modules/@maka/runtime-host/dist/protocol/index.js +13 -1
- package/node_modules/@maka/runtime-host/dist/protocol/oauth.js +23 -4
- package/node_modules/@maka/runtime-host/dist/protocol/operations.js +4 -1
- package/node_modules/@maka/runtime-host/dist/protocol/runtime-policy.js +16 -20
- package/node_modules/@maka/runtime-host/dist/protocol/session-bundle.js +100 -0
- package/node_modules/@maka/runtime-host/dist/server/acp/antigravity-install.js +242 -0
- package/node_modules/@maka/runtime-host/dist/server/acp/antigravity.js +154 -0
- package/node_modules/@maka/runtime-host/dist/server/acp/connection.js +116 -0
- package/node_modules/@maka/runtime-host/dist/server/artifact-coordinator.js +10 -10
- package/node_modules/@maka/runtime-host/dist/server/execution-composition.js +56 -3
- package/node_modules/@maka/runtime-host/dist/server/execution-model-authority.js +2 -2
- package/node_modules/@maka/runtime-host/dist/server/execution-model-composition.js +4 -7
- package/node_modules/@maka/runtime-host/dist/server/external-agent-setup-coordinator.js +190 -0
- package/node_modules/@maka/runtime-host/dist/server/external-session-coordinator.js +7 -7
- package/node_modules/@maka/runtime-host/dist/server/json-array-page-budget.js +48 -0
- package/node_modules/@maka/runtime-host/dist/server/memory-projection.js +14 -15
- package/node_modules/@maka/runtime-host/dist/server/oauth-coordinator.js +13 -1
- package/node_modules/@maka/runtime-host/dist/server/plan-coordinator.js +11 -5
- package/node_modules/@maka/runtime-host/dist/server/plugin-platform-coordinator.js +8 -6
- package/node_modules/@maka/runtime-host/dist/server/project-catalog-coordinator.js +10 -12
- package/node_modules/@maka/runtime-host/dist/server/project-directory-authority.js +4 -3
- package/node_modules/@maka/runtime-host/dist/server/runtime-policy-coordinator.js +23 -25
- package/node_modules/@maka/runtime-host/dist/server/runtime-resource-projection.js +9 -9
- package/node_modules/@maka/runtime-host/dist/server/scheduled-task-coordinator.js +15 -11
- package/node_modules/@maka/runtime-host/dist/server/session-bundle-coordinator.js +163 -0
- package/node_modules/@maka/runtime-host/dist/server/session-catalog-coordinator.js +24 -12
- package/node_modules/@maka/runtime-host/dist/server/session-revision-coordinator.js +1 -0
- package/node_modules/@maka/runtime-host/dist/server/skill-catalog-repository.js +16 -17
- package/node_modules/@maka/runtime-host/dist/server/usage-pricing-coordinator.js +16 -19
- package/node_modules/@maka/runtime-host/dist/server/workhub-coordination-coordinator.js +1 -0
- package/node_modules/@maka/runtime-host/package.json +1 -0
- package/node_modules/@maka/storage/dist/context-offload-snapshot.js +51 -1
- package/node_modules/@maka/storage/dist/model-facts-store.js +5 -28
- package/node_modules/@maka/storage/dist/project-catalog.js +6 -0
- package/node_modules/@maka/storage/dist/runtime-policy/connection-catalog-document.js +111 -38
- package/node_modules/@maka/storage/dist/runtime-policy/coordinator.js +46 -61
- package/node_modules/@maka/storage/dist/runtime-policy/oauth-login-receipt-document.js +25 -6
- package/node_modules/@maka/storage/dist/runtime-policy/onboarding-transaction.js +30 -14
- package/node_modules/@maka/storage/dist/runtime-policy/policy-document.js +10 -4
- package/node_modules/@maka/storage/dist/scheduled-task-store.js +8 -1
- package/node_modules/@maka/storage/dist/session-bundle-policy.js +127 -26
- package/node_modules/@maka/storage/dist/session-store.js +3 -0
- package/node_modules/@maka/storage/dist/sqlite-session-metadata-store.js +3 -7
- package/node_modules/run/README.md +109 -18
- package/node_modules/run/THIRD_PARTY_NOTICES.md +11 -11
- package/node_modules/run/dist/continuation-validation.js +116 -1
- package/node_modules/run/dist/errors.js +12 -2
- package/node_modules/run/dist/host-function-invocation.js +2 -1
- package/node_modules/run/dist/run.js +30 -4
- package/node_modules/run/dist/runtime/guest-serde-source.js +1 -1
- package/node_modules/run/dist/runtime/guest-sources.js +214 -56
- package/node_modules/run/dist/runtime/manager.js +575 -116
- package/node_modules/run/dist/runtime/max-workers.js +8 -4
- package/node_modules/run/dist/runtime/protocol-validation.js +20 -7
- package/node_modules/run/dist/runtime/sync-bridge-protocol.js +135 -0
- package/node_modules/run/dist/runtime/worker-source.js +1 -1
- package/node_modules/run/dist/utils/options.js +7 -0
- package/node_modules/run/dist/utils/promise-with-resolvers.js +13 -1
- package/node_modules/run/dist/utils/serde.js +1 -7
- package/node_modules/run/dist/utils/source-cache.js +83 -13
- package/node_modules/run/package.json +6 -4
- package/package.json +1 -1
- package/node_modules/ai/docs/03-ai-sdk-harnesses/05-harness-adapters.mdx +0 -45
- /package/node_modules/@ai-sdk/{code-mode → anthropic/node_modules/@ai-sdk/provider}/LICENSE +0 -0
- /package/node_modules/@ai-sdk/{provider → anthropic/node_modules/@ai-sdk/provider}/README.md +0 -0
- /package/node_modules/@ai-sdk/{provider → anthropic/node_modules/@ai-sdk/provider}/dist/index.js +0 -0
- /package/node_modules/@ai-sdk/{gateway → cohere/node_modules/@ai-sdk/provider}/LICENSE +0 -0
- /package/node_modules/@ai-sdk/{provider → google/node_modules/@ai-sdk/provider}/LICENSE +0 -0
- /package/node_modules/{ai → @ai-sdk/open-responses/node_modules/@ai-sdk/provider}/LICENSE +0 -0
- /package/node_modules/{@ai-sdk → @maka/runtime/node_modules/@ai-sdk}/code-mode/README.md +0 -0
- /package/node_modules/{@ai-sdk → @maka/runtime/node_modules/@ai-sdk}/code-mode/dist/approval-continuation.js +0 -0
- /package/node_modules/{@ai-sdk → @maka/runtime/node_modules/@ai-sdk}/code-mode/dist/approval.js +0 -0
- /package/node_modules/{@ai-sdk → @maka/runtime/node_modules/@ai-sdk}/code-mode/dist/code-mode-tool.js +0 -0
- /package/node_modules/{@ai-sdk → @maka/runtime/node_modules/@ai-sdk}/code-mode/dist/continuation-capability.js +0 -0
- /package/node_modules/{@ai-sdk → @maka/runtime/node_modules/@ai-sdk}/code-mode/dist/direct-tool-call.js +0 -0
- /package/node_modules/{@ai-sdk → @maka/runtime/node_modules/@ai-sdk}/code-mode/dist/errors.js +0 -0
- /package/node_modules/{@ai-sdk → @maka/runtime/node_modules/@ai-sdk}/code-mode/dist/host-interrupt.js +0 -0
- /package/node_modules/{@ai-sdk → @maka/runtime/node_modules/@ai-sdk}/code-mode/dist/index.js +0 -0
- /package/node_modules/{@ai-sdk → @maka/runtime/node_modules/@ai-sdk}/code-mode/dist/interrupt-continuation.js +0 -0
- /package/node_modules/{@ai-sdk → @maka/runtime/node_modules/@ai-sdk}/code-mode/dist/tool-invocation.js +0 -0
- /package/node_modules/{@ai-sdk → @maka/runtime/node_modules/@ai-sdk}/code-mode/dist/tool-prompt.js +0 -0
- /package/node_modules/{@ai-sdk → @maka/runtime/node_modules/@ai-sdk}/code-mode/dist/types.js +0 -0
- /package/node_modules/{@ai-sdk → @maka/runtime/node_modules/@ai-sdk}/code-mode/dist/utils/serialization.js +0 -0
- /package/node_modules/{@ai-sdk → @maka/runtime/node_modules/@ai-sdk}/code-mode/src/tsconfig.json +0 -0
- /package/node_modules/{@ai-sdk → @maka/runtime/node_modules/@ai-sdk}/gateway/README.md +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/README.md +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/00-introduction/index.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/02-foundations/01-overview.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/02-foundations/03-prompts.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/02-foundations/04-tools.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/02-foundations/05-streaming.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/02-foundations/06-provider-options.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/02-foundations/index.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/02-getting-started/00-choosing-a-provider.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/02-getting-started/01-navigating-the-library.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/02-getting-started/02-nextjs-app-router.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/02-getting-started/03-nextjs-pages-router.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/02-getting-started/04-svelte.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/02-getting-started/05-nuxt.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/02-getting-started/06-nodejs.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/02-getting-started/07-expo.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/02-getting-started/08-tanstack-start.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/02-getting-started/09-coding-agents.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/02-getting-started/index.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/03-agents/01-overview.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/03-agents/02-building-agents.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/03-agents/03-workflows.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/03-agents/05-configuring-call-options.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/03-agents/06-memory.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/03-agents/06-subagents.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/03-agents/08-terminal-ui.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/03-agents/index.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/03-ai-sdk-core/01-overview.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/03-ai-sdk-core/05-generating-text.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/03-ai-sdk-core/17-mcp-apps.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/03-ai-sdk-core/17-runtime-and-tool-context.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/03-ai-sdk-core/18-code-mode.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/03-ai-sdk-core/20-prompt-engineering.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/03-ai-sdk-core/25-settings.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/03-ai-sdk-core/26-reasoning.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/03-ai-sdk-core/30-embeddings.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/03-ai-sdk-core/31-reranking.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/03-ai-sdk-core/36-realtime.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/03-ai-sdk-core/36-translation.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/03-ai-sdk-core/38-video-generation.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/03-ai-sdk-core/40-middleware.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/03-ai-sdk-core/41-skill-uploads.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/03-ai-sdk-core/45-provider-management.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/03-ai-sdk-core/55-testing.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/03-ai-sdk-core/65-devtools.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/03-ai-sdk-core/65-lifecycle-callbacks.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/03-ai-sdk-harnesses/01-overview.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/03-ai-sdk-harnesses/03-tools.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/03-ai-sdk-harnesses/04-skills.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/03-ai-sdk-harnesses/06-workflow-utilities.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/03-ai-sdk-harnesses/07-ui.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/03-ai-sdk-harnesses/08-terminal-ui.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/03-ai-sdk-harnesses/index.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/04-ai-sdk-ui/01-overview.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/04-ai-sdk-ui/02-chatbot.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/04-ai-sdk-ui/03-chatbot-message-persistence.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/04-ai-sdk-ui/03-chatbot-resume-streams.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/04-ai-sdk-ui/04-generative-user-interfaces.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/04-ai-sdk-ui/05-completion.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/04-ai-sdk-ui/08-object-generation.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/04-ai-sdk-ui/21-error-handling.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/04-ai-sdk-ui/21-transport.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/04-ai-sdk-ui/24-reading-ui-message-streams.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/04-ai-sdk-ui/25-message-metadata.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/04-ai-sdk-ui/index.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/05-ai-sdk-rsc/01-overview.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/05-ai-sdk-rsc/02-streaming-react-components.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/05-ai-sdk-rsc/03-generative-ui-state.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/05-ai-sdk-rsc/03-saving-and-restoring-states.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/05-ai-sdk-rsc/04-multistep-interfaces.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/05-ai-sdk-rsc/05-streaming-values.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/05-ai-sdk-rsc/06-loading-state.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/05-ai-sdk-rsc/08-error-handling.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/05-ai-sdk-rsc/09-authentication.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/05-ai-sdk-rsc/10-migrating-to-ui.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/05-ai-sdk-rsc/index.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/06-advanced/01-prompt-engineering.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/06-advanced/02-stopping-streams.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/06-advanced/03-backpressure.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/06-advanced/05-multiple-streamables.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/06-advanced/06-rate-limiting.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/06-advanced/07-rendering-ui-with-language-models.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/06-advanced/08-model-as-router.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/06-advanced/09-multistep-interfaces.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/06-advanced/09-sequential-generations.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/06-advanced/10-vercel-deployment-guide.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/06-advanced/index.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/07-reference/01-ai-sdk-core/11-stream-transcribe.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/07-reference/01-ai-sdk-core/11-stream-translate.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/07-reference/01-ai-sdk-core/11-transcribe.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/07-reference/01-ai-sdk-core/12-generate-speech.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/07-reference/01-ai-sdk-core/13-generate-video.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/07-reference/01-ai-sdk-core/14-upload-skill.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/07-reference/01-ai-sdk-core/15-agent.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/07-reference/01-ai-sdk-core/16-tool-loop-agent.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/07-reference/01-ai-sdk-core/17-create-agent-ui-stream.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/07-reference/01-ai-sdk-core/18-create-agent-ui-stream-response.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/07-reference/01-ai-sdk-core/18-pipe-agent-ui-stream-to-response.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/07-reference/01-ai-sdk-core/20-tool.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/07-reference/01-ai-sdk-core/22-dynamic-tool.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/07-reference/01-ai-sdk-core/23-create-mcp-client.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/07-reference/01-ai-sdk-core/23-get-realtime-tool-definitions.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/07-reference/01-ai-sdk-core/24-mcp-apps.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/07-reference/01-ai-sdk-core/24-mcp-stdio-transport.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/07-reference/01-ai-sdk-core/25-json-schema.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/07-reference/01-ai-sdk-core/26-zod-schema.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/07-reference/01-ai-sdk-core/27-valibot-schema.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/07-reference/01-ai-sdk-core/29-filter-active-tools.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/07-reference/01-ai-sdk-core/30-model-message.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/07-reference/01-ai-sdk-core/32-validate-ui-messages.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/07-reference/01-ai-sdk-core/33-safe-validate-ui-messages.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/07-reference/01-ai-sdk-core/34-sandbox.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/07-reference/01-ai-sdk-core/40-provider-registry.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/07-reference/01-ai-sdk-core/42-custom-provider.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/07-reference/01-ai-sdk-core/50-cosine-similarity.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/07-reference/01-ai-sdk-core/60-wrap-language-model.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/07-reference/01-ai-sdk-core/61-wrap-image-model.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/07-reference/01-ai-sdk-core/65-language-model-v2-middleware.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/07-reference/01-ai-sdk-core/66-extract-reasoning-middleware.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/07-reference/01-ai-sdk-core/67-simulate-streaming-middleware.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/07-reference/01-ai-sdk-core/68-default-instructions-middleware.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/07-reference/01-ai-sdk-core/68-default-settings-middleware.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/07-reference/01-ai-sdk-core/69-add-tool-input-examples-middleware.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/07-reference/01-ai-sdk-core/70-extract-json-middleware.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/07-reference/01-ai-sdk-core/70-is-step-count.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/07-reference/01-ai-sdk-core/71-has-tool-call.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/07-reference/01-ai-sdk-core/72-loop-finished.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/07-reference/01-ai-sdk-core/75-simulate-readable-stream.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/07-reference/01-ai-sdk-core/90-generate-id.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/07-reference/01-ai-sdk-core/91-create-id-generator.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/07-reference/01-ai-sdk-core/92-default-generated-file.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/07-reference/02-ai-sdk-ui/02-use-completion.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/07-reference/02-ai-sdk-ui/03-use-object.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/07-reference/02-ai-sdk-ui/05-use-realtime.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/07-reference/02-ai-sdk-ui/31-convert-to-model-messages.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/07-reference/02-ai-sdk-ui/32-prune-messages.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/07-reference/02-ai-sdk-ui/42-pipe-ui-message-stream-to-response.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/07-reference/02-ai-sdk-ui/43-read-ui-message-stream.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/07-reference/02-ai-sdk-ui/46-infer-ui-tools.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/07-reference/02-ai-sdk-ui/47-infer-ui-tool.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/07-reference/02-ai-sdk-ui/48-mcp-app-renderer.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/07-reference/02-ai-sdk-ui/50-direct-chat-transport.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/07-reference/02-ai-sdk-ui/index.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/07-reference/03-ai-sdk-rsc/01-stream-ui.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/07-reference/03-ai-sdk-rsc/02-create-ai.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/07-reference/03-ai-sdk-rsc/03-create-streamable-ui.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/07-reference/03-ai-sdk-rsc/04-create-streamable-value.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/07-reference/03-ai-sdk-rsc/05-read-streamable-value.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/07-reference/03-ai-sdk-rsc/06-get-ai-state.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/07-reference/03-ai-sdk-rsc/07-get-mutable-ai-state.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/07-reference/03-ai-sdk-rsc/08-use-ai-state.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/07-reference/03-ai-sdk-rsc/09-use-actions.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/07-reference/03-ai-sdk-rsc/10-use-ui-state.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/07-reference/03-ai-sdk-rsc/11-use-streamable-value.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/07-reference/03-ai-sdk-rsc/20-render.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/07-reference/03-ai-sdk-rsc/index.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/07-reference/04-ai-sdk-workflow/02-workflow-chat-transport.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/07-reference/04-ai-sdk-workflow/03-generate-video.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/07-reference/04-ai-sdk-workflow/index.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/07-reference/05-ai-sdk-errors/ai-api-call-error.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/07-reference/05-ai-sdk-errors/ai-download-error.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/07-reference/05-ai-sdk-errors/ai-empty-response-body-error.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/07-reference/05-ai-sdk-errors/ai-invalid-data-content-error.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/07-reference/05-ai-sdk-errors/ai-invalid-message-role-error.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/07-reference/05-ai-sdk-errors/ai-invalid-prompt-error.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/07-reference/05-ai-sdk-errors/ai-invalid-response-data-error.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/07-reference/05-ai-sdk-errors/ai-invalid-tool-approval-error.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/07-reference/05-ai-sdk-errors/ai-invalid-tool-approval-signature-error.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/07-reference/05-ai-sdk-errors/ai-invalid-tool-input-error.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/07-reference/05-ai-sdk-errors/ai-json-parse-error.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/07-reference/05-ai-sdk-errors/ai-load-api-key-error.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/07-reference/05-ai-sdk-errors/ai-load-setting-error.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/07-reference/05-ai-sdk-errors/ai-message-conversion-error.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/07-reference/05-ai-sdk-errors/ai-no-content-generated-error.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/07-reference/05-ai-sdk-errors/ai-no-object-generated-error.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/07-reference/05-ai-sdk-errors/ai-no-output-generated-error.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/07-reference/05-ai-sdk-errors/ai-no-speech-generated-error.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/07-reference/05-ai-sdk-errors/ai-no-such-model-error.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/07-reference/05-ai-sdk-errors/ai-no-such-provider-error.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/07-reference/05-ai-sdk-errors/ai-no-such-provider-reference-error.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/07-reference/05-ai-sdk-errors/ai-no-such-tool-error.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/07-reference/05-ai-sdk-errors/ai-no-transcript-generated-error.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/07-reference/05-ai-sdk-errors/ai-no-translation-generated-error.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/07-reference/05-ai-sdk-errors/ai-no-video-generated-error.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/07-reference/05-ai-sdk-errors/ai-retry-error.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/07-reference/05-ai-sdk-errors/ai-stream-provider-error.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/07-reference/05-ai-sdk-errors/ai-too-many-embedding-values-for-call-error.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/07-reference/05-ai-sdk-errors/ai-tool-call-not-found-for-approval-error.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/07-reference/05-ai-sdk-errors/ai-tool-call-repair-error.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/07-reference/05-ai-sdk-errors/ai-type-validation-error.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/07-reference/05-ai-sdk-errors/ai-ui-message-stream-error.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/07-reference/05-ai-sdk-errors/ai-unsupported-functionality-error.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/07-reference/06-ai-sdk-tui/01-run-agent-tui.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/07-reference/06-ai-sdk-tui/index.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/07-reference/index.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/08-migration-guides/00-versioning.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/08-migration-guides/23-migration-guide-7-0.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/08-migration-guides/24-migration-guide-6-0.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/08-migration-guides/25-migration-guide-5-0-data.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/08-migration-guides/26-migration-guide-5-0.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/08-migration-guides/27-migration-guide-4-2.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/08-migration-guides/28-migration-guide-4-1.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/08-migration-guides/29-migration-guide-4-0.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/08-migration-guides/36-migration-guide-3-4.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/08-migration-guides/37-migration-guide-3-3.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/08-migration-guides/38-migration-guide-3-2.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/08-migration-guides/39-migration-guide-3-1.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/08-migration-guides/index.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/09-troubleshooting/01-azure-stream-slow.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/09-troubleshooting/03-server-actions-in-client-components.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/09-troubleshooting/04-strange-stream-output.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/09-troubleshooting/05-streamable-ui-errors.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/09-troubleshooting/05-tool-invocation-missing-result.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/09-troubleshooting/06-streaming-not-working-when-deployed.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/09-troubleshooting/06-streaming-not-working-when-proxied.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/09-troubleshooting/06-timeout-on-vercel.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/09-troubleshooting/07-unclosed-streams.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/09-troubleshooting/08-use-chat-failed-to-parse-stream.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/09-troubleshooting/09-client-stream-error.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/09-troubleshooting/10-use-chat-tools-no-response.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/09-troubleshooting/11-use-chat-custom-request-options.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/09-troubleshooting/12-typescript-performance-zod.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/09-troubleshooting/12-use-chat-an-error-occurred.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/09-troubleshooting/13-repeated-assistant-messages.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/09-troubleshooting/14-stream-abort-handling.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/09-troubleshooting/14-tool-calling-with-structured-outputs.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/09-troubleshooting/15-abort-breaks-resumable-streams.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/09-troubleshooting/15-stream-text-not-working.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/09-troubleshooting/16-streaming-status-delay.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/09-troubleshooting/17-use-chat-stale-body-data.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/09-troubleshooting/18-ontoolcall-type-narrowing.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/09-troubleshooting/19-unsupported-model-version.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/09-troubleshooting/20-no-object-generated-content-filter.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/09-troubleshooting/21-missing-tool-results-error.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/09-troubleshooting/30-model-is-not-assignable-to-type.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/09-troubleshooting/40-typescript-cannot-find-namespace-jsx.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/09-troubleshooting/50-react-maximum-update-depth-exceeded.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/09-troubleshooting/60-jest-cannot-find-module-ai-rsc.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/09-troubleshooting/70-high-memory-usage-with-images.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/09-troubleshooting/index.mdx +0 -0
package/dist/pi-tui-runner.js
CHANGED
|
@@ -20,7 +20,7 @@ import { randomUUID } from 'node:crypto';
|
|
|
20
20
|
import { Key, ProcessTerminal, SelectList, TuiMainScreen, isKeyRelease, isKeyRepeat, matchesKey, } from '@earendil-works/pi-tui';
|
|
21
21
|
import { CurrentTodoStore, TodoOverlay, renderTodoIndicator } from './pi-tui-todo.js';
|
|
22
22
|
import { isThinkingLevel } from '@maka/core/model-thinking';
|
|
23
|
-
import { deriveConnectionSlug
|
|
23
|
+
import { deriveConnectionSlug } from '@maka/core/llm-connections';
|
|
24
24
|
import { projectRevisionLinkedSessionTree } from '@maka/core/session-revisions';
|
|
25
25
|
import { slashCommandsForSurface, } from '@maka/core/slash-command-catalog';
|
|
26
26
|
import { latestAssistantModelId, } from '@maka/core/session';
|
|
@@ -49,7 +49,7 @@ import { CTX_REFRESH_DEBOUNCE_MS, createCtxRefresher, scheduleCtxRefreshTimeout,
|
|
|
49
49
|
import { sessionStatusBadge } from './tui-session-status.js';
|
|
50
50
|
import { AttentionController, DISABLE_FOCUS_REPORTING, ENABLE_FOCUS_REPORTING, FOCUS_IN_SEQUENCE, FOCUS_OUT_SEQUENCE, } from './tui-attention.js';
|
|
51
51
|
import { MakaActivityStripComponent, MakaPendingQueueComponent, MakaPiLayoutComponent, MakaStatusLineComponent, MakaTranscriptComponent, } from './pi-tui-layout.js';
|
|
52
|
-
import { MakaAutocompleteProvider, DirectoryPickerOverlay, ModelSearchOverlay, SessionSearchOverlay, OnboardingWizard, PickerOverlay, UserQuestionOverlay, modelChoiceConnectionLabels, getTuiPickerCopy, modelPickerItems, onboardingFailureMessage, permissionModePickerItems, skillPickerItems, thinkingLevelPickerItems, } from './pi-tui-pickers.js';
|
|
52
|
+
import { MakaAutocompleteProvider, DirectoryPickerOverlay, ModelSearchOverlay, SessionSearchOverlay, OnboardingWizard, PickerOverlay, UserQuestionOverlay, modelChoiceConnectionLabels, getTuiPickerCopy, modelPickerItems, onboardingFailureMessage, onboardingOAuthFailureMessage, permissionModePickerItems, skillPickerItems, thinkingLevelPickerItems, } from './pi-tui-pickers.js';
|
|
53
53
|
import { formatMakaResumeCommand } from './cli-invocation.js';
|
|
54
54
|
import { goalAttachedNoticeText, goalPausedNoticeText, goalStatusLabel, goalSummaryLines, isLiveGoalStatus, } from './pi-goal.js';
|
|
55
55
|
import { getTuiPrimaryGuidance } from './tui-primary-guidance.js';
|
|
@@ -934,9 +934,8 @@ export async function runMakaPiTui(input) {
|
|
|
934
934
|
requestRender();
|
|
935
935
|
})().catch(reportError);
|
|
936
936
|
};
|
|
937
|
-
// Onboarding wizard (#1098 UX redesign): one overlay spans provider search
|
|
938
|
-
//
|
|
939
|
-
// success notice beside the input field instead of the transcript entry flow.
|
|
937
|
+
// Onboarding wizard (#1098 UX redesign): one overlay spans provider search,
|
|
938
|
+
// authentication, model curation, and success without transcript notices.
|
|
940
939
|
let wizardOverlay;
|
|
941
940
|
let wizard;
|
|
942
941
|
// The user's supplied key from the key step ('' reuses the stored secret for an
|
|
@@ -949,11 +948,7 @@ export async function runMakaPiTui(input) {
|
|
|
949
948
|
// The existing connection the picked provider resolved to, so saving edits
|
|
950
949
|
// it in place (a Desktop-created relay may live under a custom slug).
|
|
951
950
|
let wizardTarget;
|
|
952
|
-
|
|
953
|
-
// target bare so any Host vintage accepts it; an edited slug/name rides on
|
|
954
|
-
// the target and gets `slug_taken` back when it loses.
|
|
955
|
-
let wizardIdentity = { slug: null, name: null };
|
|
956
|
-
let wizardModels = [];
|
|
951
|
+
let wizardOAuthAbort;
|
|
957
952
|
// Authoritative ready model choices for `/model`. A startup snapshot refreshed
|
|
958
953
|
// in place after `/setup` saves so newly configured models are immediately
|
|
959
954
|
// available — the single source the picker and connection/model lookups read.
|
|
@@ -976,7 +971,7 @@ export async function runMakaPiTui(input) {
|
|
|
976
971
|
const currentModelContextWindow = () => currentModelChoice()?.contextWindow ??
|
|
977
972
|
(onInitialTarget() ? input.modelContextWindow : undefined);
|
|
978
973
|
// The Host resolved these when it projected the choice — including a relay's
|
|
979
|
-
// declared `
|
|
974
|
+
// declared `modelOverrides[model].thinkingLevels`. A model no choice
|
|
980
975
|
// describes offers none rather than a locally guessed list.
|
|
981
976
|
const currentThinkingLevels = () => currentModelChoice()?.thinkingLevels ?? [];
|
|
982
977
|
unsubscribeModelCatalogChanges = input.subscribeModelCatalogChanges?.((refresh) => {
|
|
@@ -1673,7 +1668,24 @@ export async function runMakaPiTui(input) {
|
|
|
1673
1668
|
state.entries.push(pendingNotice);
|
|
1674
1669
|
requestRender();
|
|
1675
1670
|
try {
|
|
1676
|
-
const result = await input.driver.rewindToTurn(turnId)
|
|
1671
|
+
const result = await input.driver.rewindToTurn(turnId).catch((error) => {
|
|
1672
|
+
// The driver refuses rewind with a machine code when the selected
|
|
1673
|
+
// turn carries structured context the TUI cannot restore (#5109).
|
|
1674
|
+
// Render the localized catalog copy for that code instead of the
|
|
1675
|
+
// driver's English fallback.
|
|
1676
|
+
const code = error?.code;
|
|
1677
|
+
if (code === 'rewind_unsupported_quotes' ||
|
|
1678
|
+
code === 'rewind_unsupported_attachments' ||
|
|
1679
|
+
code === 'rewind_unsupported_directory_references') {
|
|
1680
|
+
const localized = code === 'rewind_unsupported_quotes'
|
|
1681
|
+
? TUI_REWIND_COPY[locale].unsupportedQuotes
|
|
1682
|
+
: code === 'rewind_unsupported_attachments'
|
|
1683
|
+
? TUI_REWIND_COPY[locale].unsupportedAttachments
|
|
1684
|
+
: TUI_REWIND_COPY[locale].unsupportedDirectoryReferences;
|
|
1685
|
+
throw new Error(localized);
|
|
1686
|
+
}
|
|
1687
|
+
throw error;
|
|
1688
|
+
});
|
|
1677
1689
|
await applySwitchResult(result);
|
|
1678
1690
|
await discardCurrentSidePair();
|
|
1679
1691
|
// Record the discarded turn's prompt in the editor history before
|
|
@@ -1937,6 +1949,8 @@ export async function runMakaPiTui(input) {
|
|
|
1937
1949
|
overlay = showBottomPicker(picker);
|
|
1938
1950
|
};
|
|
1939
1951
|
const closeWizard = () => {
|
|
1952
|
+
wizardOAuthAbort?.abort();
|
|
1953
|
+
wizardOAuthAbort = undefined;
|
|
1940
1954
|
wizardAttempt += 1; // drop any in-flight verify/save before clearing the slots
|
|
1941
1955
|
wizardOverlay?.hide();
|
|
1942
1956
|
wizardOverlay = undefined;
|
|
@@ -1944,8 +1958,108 @@ export async function runMakaPiTui(input) {
|
|
|
1944
1958
|
wizardApiKey = '';
|
|
1945
1959
|
wizardBaseUrl = '';
|
|
1946
1960
|
wizardTarget = undefined;
|
|
1947
|
-
|
|
1948
|
-
|
|
1961
|
+
};
|
|
1962
|
+
const discoverWizardOAuthModels = (targetWizard, attempt, target) => {
|
|
1963
|
+
if (!input.onboarding)
|
|
1964
|
+
return;
|
|
1965
|
+
void input.onboarding.verify({ target }).then((result) => {
|
|
1966
|
+
if (closed || wizard !== targetWizard || attempt !== wizardAttempt)
|
|
1967
|
+
return;
|
|
1968
|
+
if (result.kind !== 'ok') {
|
|
1969
|
+
targetWizard.setOAuthModelError(onboardingFailureMessage(result, locale));
|
|
1970
|
+
requestRender();
|
|
1971
|
+
return;
|
|
1972
|
+
}
|
|
1973
|
+
targetWizard.setModels(result.models);
|
|
1974
|
+
requestRender();
|
|
1975
|
+
}, () => {
|
|
1976
|
+
if (closed || wizard !== targetWizard || attempt !== wizardAttempt)
|
|
1977
|
+
return;
|
|
1978
|
+
targetWizard.setOAuthModelError(onboardingFailureMessage({ kind: 'unavailable' }, locale));
|
|
1979
|
+
requestRender();
|
|
1980
|
+
});
|
|
1981
|
+
};
|
|
1982
|
+
const startWizardOAuth = () => {
|
|
1983
|
+
const target = wizardTarget;
|
|
1984
|
+
const targetWizard = wizard;
|
|
1985
|
+
if (!target || !targetWizard)
|
|
1986
|
+
return;
|
|
1987
|
+
if (!input.onboarding?.loginOAuth) {
|
|
1988
|
+
targetWizard.setOAuthError(pickerCopy.onboardingUnavailable);
|
|
1989
|
+
requestRender();
|
|
1990
|
+
return;
|
|
1991
|
+
}
|
|
1992
|
+
wizardOAuthAbort?.abort();
|
|
1993
|
+
const abort = new AbortController();
|
|
1994
|
+
wizardOAuthAbort = abort;
|
|
1995
|
+
const attempt = ++wizardAttempt;
|
|
1996
|
+
requestRender();
|
|
1997
|
+
void input.onboarding
|
|
1998
|
+
.loginOAuth({
|
|
1999
|
+
target,
|
|
2000
|
+
signal: abort.signal,
|
|
2001
|
+
onPresentation: (presentation) => {
|
|
2002
|
+
if (closed || wizard !== targetWizard || attempt !== wizardAttempt)
|
|
2003
|
+
return;
|
|
2004
|
+
targetWizard.setOAuthPresentation(presentation);
|
|
2005
|
+
requestRender();
|
|
2006
|
+
},
|
|
2007
|
+
})
|
|
2008
|
+
.then((result) => {
|
|
2009
|
+
if (wizardOAuthAbort === abort)
|
|
2010
|
+
wizardOAuthAbort = undefined;
|
|
2011
|
+
if (closed || wizard !== targetWizard || attempt !== wizardAttempt)
|
|
2012
|
+
return;
|
|
2013
|
+
if (result.kind === 'unconfirmed') {
|
|
2014
|
+
targetWizard.setOAuthUnconfirmed();
|
|
2015
|
+
requestRender();
|
|
2016
|
+
return;
|
|
2017
|
+
}
|
|
2018
|
+
if (result.kind === 'cancelled') {
|
|
2019
|
+
targetWizard.setOAuthCancelled();
|
|
2020
|
+
wizardAttempt += 1;
|
|
2021
|
+
requestRender();
|
|
2022
|
+
return;
|
|
2023
|
+
}
|
|
2024
|
+
if (result.kind === 'failed') {
|
|
2025
|
+
const message = onboardingOAuthFailureMessage(result.reason, locale);
|
|
2026
|
+
if (result.reason === 'slug_taken' && target.kind === 'create') {
|
|
2027
|
+
targetWizard.setIdentityError(message);
|
|
2028
|
+
}
|
|
2029
|
+
else {
|
|
2030
|
+
targetWizard.setOAuthError(message);
|
|
2031
|
+
}
|
|
2032
|
+
requestRender();
|
|
2033
|
+
return;
|
|
2034
|
+
}
|
|
2035
|
+
const existingTarget = {
|
|
2036
|
+
kind: 'existing',
|
|
2037
|
+
connectionId: result.connection.connectionId,
|
|
2038
|
+
};
|
|
2039
|
+
// Authentication is the durable create/reauthorize commit point. All
|
|
2040
|
+
// later work addresses that exact Connection and never repeats OAuth.
|
|
2041
|
+
wizardTarget = existingTarget;
|
|
2042
|
+
targetWizard.setOAuthAuthenticated();
|
|
2043
|
+
requestRender();
|
|
2044
|
+
discoverWizardOAuthModels(targetWizard, attempt, existingTarget);
|
|
2045
|
+
}, () => {
|
|
2046
|
+
if (wizardOAuthAbort === abort)
|
|
2047
|
+
wizardOAuthAbort = undefined;
|
|
2048
|
+
if (closed || wizard !== targetWizard || attempt !== wizardAttempt)
|
|
2049
|
+
return;
|
|
2050
|
+
targetWizard.setOAuthError(onboardingOAuthFailureMessage('unavailable', locale));
|
|
2051
|
+
requestRender();
|
|
2052
|
+
});
|
|
2053
|
+
};
|
|
2054
|
+
const continueWizardOAuth = () => {
|
|
2055
|
+
const target = wizardTarget;
|
|
2056
|
+
const targetWizard = wizard;
|
|
2057
|
+
if (!targetWizard || target?.kind !== 'existing')
|
|
2058
|
+
return;
|
|
2059
|
+
const attempt = ++wizardAttempt;
|
|
2060
|
+
targetWizard.setOAuthAuthenticated();
|
|
2061
|
+
requestRender();
|
|
2062
|
+
discoverWizardOAuthModels(targetWizard, attempt, target);
|
|
1949
2063
|
};
|
|
1950
2064
|
// Key submit from the wizard. Slash commands route as commands (so /exit
|
|
1951
2065
|
// still escapes the wizard) instead of being stored as an API key; every
|
|
@@ -1983,7 +2097,6 @@ export async function runMakaPiTui(input) {
|
|
|
1983
2097
|
requestRender();
|
|
1984
2098
|
return;
|
|
1985
2099
|
}
|
|
1986
|
-
wizardModels = result.models;
|
|
1987
2100
|
wizard.setModels(result.models); // advance to the models step
|
|
1988
2101
|
requestRender();
|
|
1989
2102
|
}, () => {
|
|
@@ -2106,15 +2219,12 @@ export async function runMakaPiTui(input) {
|
|
|
2106
2219
|
// reselects the same catalog row. A late save may converge only the
|
|
2107
2220
|
// exact target object captured by its own submit.
|
|
2108
2221
|
wizardTarget = { ...provider.target };
|
|
2109
|
-
wizardIdentity = { slug: null, name: null };
|
|
2110
2222
|
wizardApiKey = '';
|
|
2111
2223
|
wizardBaseUrl = '';
|
|
2112
|
-
wizardModels = [];
|
|
2113
2224
|
wizardAttempt += 1; // a new pick supersedes any in-flight attempt
|
|
2114
2225
|
requestRender();
|
|
2115
2226
|
},
|
|
2116
2227
|
onSubmitIdentity: (identity) => {
|
|
2117
|
-
wizardIdentity = identity;
|
|
2118
2228
|
if (wizardTarget?.kind === 'create') {
|
|
2119
2229
|
wizardTarget = {
|
|
2120
2230
|
kind: 'create',
|
|
@@ -2130,6 +2240,28 @@ export async function runMakaPiTui(input) {
|
|
|
2130
2240
|
requestRender();
|
|
2131
2241
|
},
|
|
2132
2242
|
onSubmitKey: submitWizardKey,
|
|
2243
|
+
onStartOAuth: startWizardOAuth,
|
|
2244
|
+
onCancelOAuth: () => {
|
|
2245
|
+
wizard?.setOAuthCancelling();
|
|
2246
|
+
wizardOAuthAbort?.abort();
|
|
2247
|
+
requestRender();
|
|
2248
|
+
},
|
|
2249
|
+
onContinueOAuth: continueWizardOAuth,
|
|
2250
|
+
onReturnToProviders: () => {
|
|
2251
|
+
const targetWizard = wizard;
|
|
2252
|
+
const attempt = ++wizardAttempt;
|
|
2253
|
+
requestRender();
|
|
2254
|
+
if (!targetWizard || !input.onboarding)
|
|
2255
|
+
return;
|
|
2256
|
+
void input.onboarding.listProviders().then((providers) => {
|
|
2257
|
+
if (closed || wizard !== targetWizard || attempt !== wizardAttempt)
|
|
2258
|
+
return;
|
|
2259
|
+
targetWizard.setProviders(providers);
|
|
2260
|
+
requestRender();
|
|
2261
|
+
}, () => {
|
|
2262
|
+
// Keep the cached list usable if refreshing the saved account fails.
|
|
2263
|
+
});
|
|
2264
|
+
},
|
|
2133
2265
|
onSubmitModels: submitWizardModels,
|
|
2134
2266
|
onCancel: () => {
|
|
2135
2267
|
closeWizard();
|
|
@@ -16,13 +16,58 @@
|
|
|
16
16
|
* specific language governing permissions and limitations
|
|
17
17
|
* under the License.
|
|
18
18
|
*/
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
19
|
+
import { randomUUID } from 'node:crypto';
|
|
20
|
+
import { deriveConnectionSlug, deriveInteractiveOAuthConnectionSlug, offerableCatalogEntries, providerFallbackModelIds, PROVIDER_REGISTRY, } from '@maka/core/llm-connections';
|
|
21
|
+
import { createOAuthPresentationClientProvider, readRuntimeHostConnectionCatalog, RuntimeHostOperationError, RuntimeHostRequestInterruptedError, } from '@maka/runtime-host/client';
|
|
21
22
|
import { listApiKeyOnboardableProviders } from './onboarding-catalog.js';
|
|
22
23
|
/** Adapt the TUI onboarding workflow to Host-owned verification and persistence. */
|
|
23
|
-
export function createRuntimeHostOnboardingSurface(connection) {
|
|
24
|
+
export function createRuntimeHostOnboardingSurface(connection, options = {}) {
|
|
25
|
+
const shutdown = new AbortController();
|
|
26
|
+
// An interrupted observation is not a new login intent. Keep its identity
|
|
27
|
+
// until a later observation establishes a terminal result on the same root.
|
|
28
|
+
const oauthAttempts = new Map();
|
|
24
29
|
return {
|
|
25
|
-
listProviders: async () =>
|
|
30
|
+
listProviders: async () => {
|
|
31
|
+
const catalog = await readRuntimeHostConnectionCatalog(connection);
|
|
32
|
+
let codexOAuthEnabled = false;
|
|
33
|
+
try {
|
|
34
|
+
codexOAuthEnabled = (await connection.request('oauth.enrollment.query', { provider: 'openai-codex' })).enabled;
|
|
35
|
+
}
|
|
36
|
+
catch {
|
|
37
|
+
// The API-key catalog remains useful when an older or temporarily
|
|
38
|
+
// unavailable Host cannot answer the optional OAuth enrollment query.
|
|
39
|
+
}
|
|
40
|
+
return projectProviders(catalog, codexOAuthEnabled);
|
|
41
|
+
},
|
|
42
|
+
loginOAuth: (input) => {
|
|
43
|
+
const target = asOAuthTarget(input.target);
|
|
44
|
+
if (!target)
|
|
45
|
+
return Promise.resolve({ kind: 'failed', reason: 'unavailable' });
|
|
46
|
+
const key = JSON.stringify(target);
|
|
47
|
+
const pending = oauthAttempts.get(key);
|
|
48
|
+
if (input.signal.aborted || shutdown.signal.aborted) {
|
|
49
|
+
return Promise.resolve({ kind: pending?.startRequested ? 'unconfirmed' : 'cancelled' });
|
|
50
|
+
}
|
|
51
|
+
const attempt = pending ?? {
|
|
52
|
+
attemptId: (options.createAttemptId ?? randomUUID)(),
|
|
53
|
+
target,
|
|
54
|
+
startRequested: false,
|
|
55
|
+
};
|
|
56
|
+
// Re-entering the same intent observes its existing result.
|
|
57
|
+
if (attempt.task)
|
|
58
|
+
return attempt.task;
|
|
59
|
+
oauthAttempts.set(key, attempt);
|
|
60
|
+
const task = runOAuthLogin(input, options, shutdown.signal, attempt);
|
|
61
|
+
attempt.task = task;
|
|
62
|
+
void task.then((result) => {
|
|
63
|
+
attempt.task = undefined;
|
|
64
|
+
if (result.kind !== 'unconfirmed')
|
|
65
|
+
oauthAttempts.delete(key);
|
|
66
|
+
}, () => {
|
|
67
|
+
attempt.task = undefined;
|
|
68
|
+
});
|
|
69
|
+
return task;
|
|
70
|
+
},
|
|
26
71
|
verify: async (input) => {
|
|
27
72
|
try {
|
|
28
73
|
const result = await connection.request('connection.onboarding.verify', {
|
|
@@ -79,7 +124,276 @@ export function createRuntimeHostOnboardingSurface(connection) {
|
|
|
79
124
|
return { kind: 'unavailable' };
|
|
80
125
|
}
|
|
81
126
|
},
|
|
127
|
+
close: async () => {
|
|
128
|
+
shutdown.abort();
|
|
129
|
+
await Promise.allSettled([...oauthAttempts.values()].map(({ task }) => task));
|
|
130
|
+
oauthAttempts.clear();
|
|
131
|
+
},
|
|
132
|
+
};
|
|
133
|
+
}
|
|
134
|
+
async function runOAuthLogin(input, options, shutdownSignal, attempt) {
|
|
135
|
+
if (!options.connectOAuth)
|
|
136
|
+
return { kind: 'failed', reason: 'unavailable' };
|
|
137
|
+
const signal = AbortSignal.any([input.signal, shutdownSignal]);
|
|
138
|
+
if (signal.aborted)
|
|
139
|
+
return { kind: attempt.startRequested ? 'unconfirmed' : 'cancelled' };
|
|
140
|
+
const requestTimeoutMs = options.requestTimeoutMs ?? 5_000;
|
|
141
|
+
const shutdownTimeoutMs = options.shutdownTimeoutMs ?? 1_000;
|
|
142
|
+
const observation = new AbortController();
|
|
143
|
+
const pollingSignal = AbortSignal.any([signal, observation.signal]);
|
|
144
|
+
let connected;
|
|
145
|
+
let stopTimer;
|
|
146
|
+
let stopDeadline = Number.POSITIVE_INFINITY;
|
|
147
|
+
const stopAfter = (milliseconds) => {
|
|
148
|
+
const deadline = Date.now() + milliseconds;
|
|
149
|
+
if (deadline >= stopDeadline)
|
|
150
|
+
return;
|
|
151
|
+
stopDeadline = deadline;
|
|
152
|
+
clearTimeout(stopTimer);
|
|
153
|
+
stopTimer = setTimeout(() => observation.abort(), milliseconds);
|
|
82
154
|
};
|
|
155
|
+
const cancelObservation = () => stopAfter(options.cancellationTimeoutMs ?? requestTimeoutMs);
|
|
156
|
+
const closeObservation = () => stopAfter(shutdownTimeoutMs);
|
|
157
|
+
input.signal.addEventListener('abort', cancelObservation, { once: true });
|
|
158
|
+
shutdownSignal.addEventListener('abort', closeObservation, { once: true });
|
|
159
|
+
try {
|
|
160
|
+
const connecting = options.connectOAuth(AbortSignal.any([signal, observation.signal]));
|
|
161
|
+
void connecting.then((resource) => {
|
|
162
|
+
// A connector may finish after its observer timed out. It still needs
|
|
163
|
+
// an owner to release the late connection.
|
|
164
|
+
if (observation.signal.aborted)
|
|
165
|
+
void resource.close().catch(() => undefined);
|
|
166
|
+
}, () => undefined);
|
|
167
|
+
connected = await waitForOAuthOperation(connecting, undefined, observation.signal);
|
|
168
|
+
const connection = connected.connection;
|
|
169
|
+
if (attempt.rootId !== undefined && attempt.rootId !== connection.rootId) {
|
|
170
|
+
return { kind: 'unconfirmed' };
|
|
171
|
+
}
|
|
172
|
+
attempt.rootId = connection.rootId;
|
|
173
|
+
const provider = createOAuthPresentationClientProvider({
|
|
174
|
+
openExternal: async (url, stateHint) => {
|
|
175
|
+
if (!signal.aborted && !observation.signal.aborted) {
|
|
176
|
+
input.onPresentation({ url, ...(stateHint === undefined ? {} : { stateHint }) });
|
|
177
|
+
}
|
|
178
|
+
},
|
|
179
|
+
});
|
|
180
|
+
const connectionKey = () => JSON.stringify([connection.hostEpoch, connection.connectionId]);
|
|
181
|
+
let presentationConnectionKey;
|
|
182
|
+
const request = async (operation, input, deadline) => {
|
|
183
|
+
const remainingTimeout = () => {
|
|
184
|
+
if (observation.signal.aborted)
|
|
185
|
+
throw new Error('OAuth observation ended');
|
|
186
|
+
const remaining = Math.min(deadline ?? Infinity, stopDeadline) - Date.now();
|
|
187
|
+
if (remaining <= 0)
|
|
188
|
+
throw new Error('OAuth reconciliation timed out');
|
|
189
|
+
return Math.min(requestTimeoutMs, remaining);
|
|
190
|
+
};
|
|
191
|
+
if (operation === 'oauth.login.start') {
|
|
192
|
+
const current = connectionKey();
|
|
193
|
+
if (presentationConnectionKey !== current) {
|
|
194
|
+
// Capability ownership follows a physical connection. Queries need
|
|
195
|
+
// no presentation service; only a start must await its publication.
|
|
196
|
+
const timeoutMs = remainingTimeout();
|
|
197
|
+
try {
|
|
198
|
+
await waitForOAuthOperation(connection.replaceClientCapabilities(provider, timeoutMs), timeoutMs, observation.signal);
|
|
199
|
+
}
|
|
200
|
+
catch (error) {
|
|
201
|
+
if (error instanceof RuntimeHostRequestInterruptedError &&
|
|
202
|
+
error.reason === 'connection_lost') {
|
|
203
|
+
throw interruptedOAuthStart();
|
|
204
|
+
}
|
|
205
|
+
throw error;
|
|
206
|
+
}
|
|
207
|
+
if (current !== connectionKey())
|
|
208
|
+
throw interruptedOAuthStart();
|
|
209
|
+
presentationConnectionKey = current;
|
|
210
|
+
}
|
|
211
|
+
remainingTimeout();
|
|
212
|
+
if (signal.aborted && !attempt.startRequested)
|
|
213
|
+
throw new Error('OAuth cancelled before start');
|
|
214
|
+
attempt.startRequested = true;
|
|
215
|
+
}
|
|
216
|
+
const timeoutMs = remainingTimeout();
|
|
217
|
+
return waitForOAuthOperation(connection.request(operation, input, timeoutMs), timeoutMs, observation.signal);
|
|
218
|
+
};
|
|
219
|
+
const { attemptId, target } = attempt;
|
|
220
|
+
let projection = await startOAuthAttempt(request, attemptId, target, requestTimeoutMs, attempt.startRequested);
|
|
221
|
+
let cancellationSent = false;
|
|
222
|
+
while (!isTerminalOAuthProjection(projection)) {
|
|
223
|
+
if (signal.aborted && !cancellationSent) {
|
|
224
|
+
cancellationSent = true;
|
|
225
|
+
const cancelledProjection = await cancelOAuthAttempt(request, attemptId, requestTimeoutMs);
|
|
226
|
+
if (!cancelledProjection)
|
|
227
|
+
return { kind: 'cancelled' };
|
|
228
|
+
projection = cancelledProjection;
|
|
229
|
+
continue;
|
|
230
|
+
}
|
|
231
|
+
// Once cancellation has reached the Host, the aborted UI signal must no
|
|
232
|
+
// longer collapse this delay into a busy query loop while a commit wins.
|
|
233
|
+
await waitForOAuthPoll(options.pollIntervalMs ?? 250, cancellationSent ? observation.signal : pollingSignal);
|
|
234
|
+
if (signal.aborted && !cancellationSent)
|
|
235
|
+
continue;
|
|
236
|
+
projection = await request('oauth.login.query', { attemptId });
|
|
237
|
+
}
|
|
238
|
+
if (projection.phase === 'authenticated') {
|
|
239
|
+
return { kind: 'authenticated', connection: projection.connection };
|
|
240
|
+
}
|
|
241
|
+
if (projection.phase === 'cancelled')
|
|
242
|
+
return { kind: 'cancelled' };
|
|
243
|
+
return { kind: 'failed', reason: projection.failure ?? 'internal_failure' };
|
|
244
|
+
}
|
|
245
|
+
catch (error) {
|
|
246
|
+
if (error instanceof RuntimeHostOperationError) {
|
|
247
|
+
if (attempt.startRequested &&
|
|
248
|
+
(error.code === 'persistence_failed' ||
|
|
249
|
+
error.code === 'internal_failure' ||
|
|
250
|
+
(error.code === 'not_found' && error.operation === 'oauth.login.query')))
|
|
251
|
+
return { kind: 'unconfirmed' };
|
|
252
|
+
if (error.code === 'not_found')
|
|
253
|
+
return { kind: 'failed', reason: 'connection_not_found' };
|
|
254
|
+
if (error.code === 'operation_conflict') {
|
|
255
|
+
return { kind: 'failed', reason: 'operation_conflict' };
|
|
256
|
+
}
|
|
257
|
+
if (error.code === 'slug_taken')
|
|
258
|
+
return { kind: 'failed', reason: 'slug_taken' };
|
|
259
|
+
if (error.code === 'capability_unavailable') {
|
|
260
|
+
return { kind: 'failed', reason: 'capability_unavailable' };
|
|
261
|
+
}
|
|
262
|
+
if (error.code === 'persistence_failed' || error.code === 'internal_failure') {
|
|
263
|
+
return { kind: 'failed', reason: error.code };
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
if (attempt.startRequested)
|
|
267
|
+
return { kind: 'unconfirmed' };
|
|
268
|
+
return signal.aborted ? { kind: 'cancelled' } : { kind: 'failed', reason: 'unavailable' };
|
|
269
|
+
}
|
|
270
|
+
finally {
|
|
271
|
+
observation.abort();
|
|
272
|
+
clearTimeout(stopTimer);
|
|
273
|
+
input.signal.removeEventListener('abort', cancelObservation);
|
|
274
|
+
shutdownSignal.removeEventListener('abort', closeObservation);
|
|
275
|
+
if (connected) {
|
|
276
|
+
const resource = connected;
|
|
277
|
+
await waitForOAuthOperation(Promise.resolve().then(() => resource.close()), Math.max(1, Math.min(shutdownTimeoutMs, stopDeadline - Date.now()))).catch(() => undefined);
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
async function startOAuthAttempt(request, attemptId, target, timeoutMs, resume) {
|
|
282
|
+
const deadline = Date.now() + timeoutMs;
|
|
283
|
+
if (resume) {
|
|
284
|
+
try {
|
|
285
|
+
return await request('oauth.login.query', { attemptId }, deadline);
|
|
286
|
+
}
|
|
287
|
+
catch (error) {
|
|
288
|
+
if (!isOAuthAttemptNotFound(error))
|
|
289
|
+
throw error;
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
while (true) {
|
|
293
|
+
try {
|
|
294
|
+
return await request('oauth.login.start', { attemptId, target }, deadline);
|
|
295
|
+
}
|
|
296
|
+
catch (error) {
|
|
297
|
+
if (!isOAuthRequestInterruption(error, 'oauth.login.start'))
|
|
298
|
+
throw error;
|
|
299
|
+
try {
|
|
300
|
+
// A write acknowledged by the local transport may already be running
|
|
301
|
+
// on the Host. Query the stable attempt identity before retrying the
|
|
302
|
+
// idempotent start so a lost response cannot create a second login.
|
|
303
|
+
return await request('oauth.login.query', { attemptId }, deadline);
|
|
304
|
+
}
|
|
305
|
+
catch (queryError) {
|
|
306
|
+
if (!isOAuthAttemptNotFound(queryError))
|
|
307
|
+
throw queryError;
|
|
308
|
+
// No live or durable state is visible yet. Starting again with the same
|
|
309
|
+
// attemptId is safe and synchronizes with an original handler still
|
|
310
|
+
// behind the Host start gate, even if local cancellation arrived while
|
|
311
|
+
// the outcome was unknown.
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
async function cancelOAuthAttempt(request, attemptId, timeoutMs) {
|
|
317
|
+
const deadline = Date.now() + timeoutMs;
|
|
318
|
+
while (true) {
|
|
319
|
+
try {
|
|
320
|
+
return await request('oauth.login.cancel', { attemptId }, deadline);
|
|
321
|
+
}
|
|
322
|
+
catch (error) {
|
|
323
|
+
if (isOAuthAttemptNotFound(error))
|
|
324
|
+
return null;
|
|
325
|
+
if (!isOAuthRequestInterruption(error, 'oauth.login.cancel'))
|
|
326
|
+
throw error;
|
|
327
|
+
try {
|
|
328
|
+
const projection = await request('oauth.login.query', { attemptId }, deadline);
|
|
329
|
+
if (isTerminalOAuthProjection(projection))
|
|
330
|
+
return projection;
|
|
331
|
+
// A non-terminal query cannot prove that the interrupted cancellation
|
|
332
|
+
// reached the Host. Cancel again; the operation is attempt-idempotent.
|
|
333
|
+
}
|
|
334
|
+
catch (queryError) {
|
|
335
|
+
if (isOAuthAttemptNotFound(queryError))
|
|
336
|
+
return null;
|
|
337
|
+
throw queryError;
|
|
338
|
+
}
|
|
339
|
+
}
|
|
340
|
+
}
|
|
341
|
+
}
|
|
342
|
+
function interruptedOAuthStart() {
|
|
343
|
+
return new RuntimeHostRequestInterruptedError('oauth.login.start', 'command', 'not_dispatched', 'connection_lost');
|
|
344
|
+
}
|
|
345
|
+
/** A local observation deadline says nothing about whether the Host committed. */
|
|
346
|
+
function waitForOAuthOperation(task, timeoutMs, signal) {
|
|
347
|
+
let timeout;
|
|
348
|
+
let stop;
|
|
349
|
+
return new Promise((resolve, reject) => {
|
|
350
|
+
stop = () => reject(new Error('OAuth result could not be confirmed'));
|
|
351
|
+
if (timeoutMs !== undefined)
|
|
352
|
+
timeout = setTimeout(stop, timeoutMs);
|
|
353
|
+
signal?.addEventListener('abort', stop, { once: true });
|
|
354
|
+
void task.then(resolve, reject);
|
|
355
|
+
if (signal?.aborted)
|
|
356
|
+
stop();
|
|
357
|
+
}).finally(() => {
|
|
358
|
+
clearTimeout(timeout);
|
|
359
|
+
signal?.removeEventListener('abort', stop);
|
|
360
|
+
});
|
|
361
|
+
}
|
|
362
|
+
function isOAuthRequestInterruption(error, operation) {
|
|
363
|
+
return error instanceof RuntimeHostRequestInterruptedError && error.operation === operation;
|
|
364
|
+
}
|
|
365
|
+
function isOAuthAttemptNotFound(error) {
|
|
366
|
+
return error instanceof RuntimeHostOperationError && error.code === 'not_found';
|
|
367
|
+
}
|
|
368
|
+
function asOAuthTarget(target) {
|
|
369
|
+
if (target.kind === 'existing')
|
|
370
|
+
return { kind: 'existing', connectionId: target.connectionId };
|
|
371
|
+
return target.providerType === 'openai-codex'
|
|
372
|
+
? {
|
|
373
|
+
kind: 'create',
|
|
374
|
+
providerType: target.providerType,
|
|
375
|
+
...(target.slug === undefined ? {} : { slug: target.slug }),
|
|
376
|
+
...(target.name === undefined ? {} : { name: target.name }),
|
|
377
|
+
}
|
|
378
|
+
: null;
|
|
379
|
+
}
|
|
380
|
+
function isTerminalOAuthProjection(projection) {
|
|
381
|
+
return (projection.phase === 'authenticated' ||
|
|
382
|
+
projection.phase === 'cancelled' ||
|
|
383
|
+
projection.phase === 'failed');
|
|
384
|
+
}
|
|
385
|
+
function waitForOAuthPoll(milliseconds, signal) {
|
|
386
|
+
if (milliseconds <= 0 || signal?.aborted)
|
|
387
|
+
return Promise.resolve();
|
|
388
|
+
return new Promise((resolve) => {
|
|
389
|
+
const timeout = setTimeout(done, milliseconds);
|
|
390
|
+
signal?.addEventListener('abort', done, { once: true });
|
|
391
|
+
function done() {
|
|
392
|
+
clearTimeout(timeout);
|
|
393
|
+
signal?.removeEventListener('abort', done);
|
|
394
|
+
resolve();
|
|
395
|
+
}
|
|
396
|
+
});
|
|
83
397
|
}
|
|
84
398
|
export function projectRuntimeHostModelChoices(catalog) {
|
|
85
399
|
const choices = [];
|
|
@@ -113,7 +427,7 @@ export function projectRuntimeHostConnectionIdentities(catalog) {
|
|
|
113
427
|
enabled: connection.enabled,
|
|
114
428
|
}));
|
|
115
429
|
}
|
|
116
|
-
export function projectProviders(catalog) {
|
|
430
|
+
export function projectProviders(catalog, codexOAuthEnabled = false) {
|
|
117
431
|
const entries = [];
|
|
118
432
|
const existingSlugs = catalog.connections.map((connection) => connection.slug);
|
|
119
433
|
for (const provider of listApiKeyOnboardableProviders()) {
|
|
@@ -135,6 +449,32 @@ export function projectProviders(catalog) {
|
|
|
135
449
|
suggestedSlug: deriveConnectionSlug(provider.providerType, existingSlugs),
|
|
136
450
|
enabledModelIds: [],
|
|
137
451
|
});
|
|
452
|
+
if (provider.providerType === 'openai' && codexOAuthEnabled) {
|
|
453
|
+
const providerType = 'openai-codex';
|
|
454
|
+
const definition = PROVIDER_REGISTRY[providerType];
|
|
455
|
+
for (const connection of catalog.connections) {
|
|
456
|
+
if (connection.providerType !== providerType)
|
|
457
|
+
continue;
|
|
458
|
+
entries.push({
|
|
459
|
+
providerType,
|
|
460
|
+
label: `${connection.name} · ${connection.slug}`,
|
|
461
|
+
requiresBaseUrl: false,
|
|
462
|
+
setupMethod: 'oauth',
|
|
463
|
+
target: { kind: 'existing', connectionId: connection.connectionId },
|
|
464
|
+
connectionSlug: connection.slug,
|
|
465
|
+
enabledModelIds: [...connection.enabledModelIds],
|
|
466
|
+
});
|
|
467
|
+
}
|
|
468
|
+
entries.push({
|
|
469
|
+
providerType,
|
|
470
|
+
label: definition.label,
|
|
471
|
+
requiresBaseUrl: false,
|
|
472
|
+
setupMethod: 'oauth',
|
|
473
|
+
target: { kind: 'create', providerType },
|
|
474
|
+
suggestedSlug: deriveInteractiveOAuthConnectionSlug(providerType, existingSlugs),
|
|
475
|
+
enabledModelIds: [...providerFallbackModelIds(definition)],
|
|
476
|
+
});
|
|
477
|
+
}
|
|
138
478
|
}
|
|
139
479
|
return entries;
|
|
140
480
|
}
|
|
@@ -648,6 +648,24 @@ class RuntimeHostMakaSessionDriverImpl {
|
|
|
648
648
|
if (promptMessage.origin) {
|
|
649
649
|
throw new Error(`Cannot rewind to turn ${turnId}: Host-triggered prompts are read-only.`);
|
|
650
650
|
}
|
|
651
|
+
const unsupported = (promptMessage.quotes?.length ?? 0) > 0
|
|
652
|
+
? 'rewind_unsupported_quotes'
|
|
653
|
+
: (promptMessage.attachments?.length ?? 0) > 0
|
|
654
|
+
? 'rewind_unsupported_attachments'
|
|
655
|
+
: (promptMessage.directoryReferences?.length ?? 0) > 0
|
|
656
|
+
? 'rewind_unsupported_directory_references'
|
|
657
|
+
: null;
|
|
658
|
+
if (unsupported) {
|
|
659
|
+
// Refilling only the human-facing text would silently drop the turn's
|
|
660
|
+
// structured context from the replacement submit (#5109). Fail closed
|
|
661
|
+
// until the TUI can carry it. The machine code lets the runner render
|
|
662
|
+
// a localized notice naming the carrier; the message text is the
|
|
663
|
+
// depth-of-defence fallback and deliberately promises nothing about
|
|
664
|
+
// other surfaces.
|
|
665
|
+
const error = new Error(`Cannot rewind to turn ${turnId}: it carries structured context the TUI cannot restore into the replacement prompt.`);
|
|
666
|
+
error.code = unsupported;
|
|
667
|
+
throw error;
|
|
668
|
+
}
|
|
651
669
|
const targetSessionId = this.#newId();
|
|
652
670
|
for (let attempt = 0; attempt < MAX_CATALOG_ATTEMPTS; attempt += 1) {
|
|
653
671
|
const current = await getRuntimeHostSession(this.#connection, sourceSessionId);
|