dominds 1.15.4 → 1.16.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/apps/assigned-port.d.ts +3 -3
- package/dist/apps/resolution-file.d.ts +2 -2
- package/dist/apps/run-app-json.d.ts +3 -3
- package/dist/apps-host/client.d.ts +2 -2
- package/dist/apps-host/host.js +6 -7
- package/dist/apps-host/ipc-types.d.ts +2 -2
- package/dist/dialog-display-state.d.ts +3 -0
- package/dist/dialog-display-state.js +30 -11
- package/dist/dialog-fork.js +1 -1
- package/dist/docs/app-constitution.md +1 -1
- package/dist/docs/app-constitution.zh.md +1 -1
- package/dist/llm/api-quirks.d.ts +35 -0
- package/dist/llm/api-quirks.js +82 -0
- package/dist/llm/defaults.yaml +3 -1
- package/dist/llm/gen/failure-classifier.d.ts +7 -0
- package/dist/llm/gen/failure-classifier.js +137 -1
- package/dist/llm/gen/openai.js +3 -12
- package/dist/llm/gen.d.ts +2 -1
- package/dist/llm/kernel-driver/drive.js +86 -42
- package/dist/llm/kernel-driver/fbr.d.ts +1 -1
- package/dist/llm/kernel-driver/fbr.js +2 -1
- package/dist/llm/kernel-driver/runtime.d.ts +8 -0
- package/dist/llm/kernel-driver/runtime.js +496 -144
- package/dist/main/access-control.d.ts +54 -0
- package/dist/main/access-control.js +357 -0
- package/dist/main/apps/app-id.d.ts +6 -0
- package/dist/main/apps/app-id.js +36 -0
- package/dist/main/apps/app-lock-file.d.ts +45 -0
- package/dist/main/apps/app-lock-file.js +204 -0
- package/dist/main/apps/assigned-port.d.ts +28 -0
- package/dist/main/apps/assigned-port.js +124 -0
- package/dist/main/apps/configuration-file.d.ts +51 -0
- package/dist/main/apps/configuration-file.js +288 -0
- package/dist/main/apps/dialog-run-controls.d.ts +16 -0
- package/dist/main/apps/dialog-run-controls.js +35 -0
- package/dist/main/apps/enabled-apps.d.ts +35 -0
- package/dist/main/apps/enabled-apps.js +416 -0
- package/dist/main/apps/local-package-root.d.ts +7 -0
- package/dist/main/apps/local-package-root.js +42 -0
- package/dist/main/apps/manifest.d.ts +101 -0
- package/dist/main/apps/manifest.js +422 -0
- package/dist/main/apps/npx-resolve.d.ts +11 -0
- package/dist/main/apps/npx-resolve.js +102 -0
- package/dist/main/apps/override-paths.d.ts +25 -0
- package/dist/main/apps/override-paths.js +59 -0
- package/dist/main/apps/package-info.d.ts +8 -0
- package/dist/main/apps/package-info.js +55 -0
- package/dist/main/apps/problems.d.ts +4 -0
- package/dist/main/apps/problems.js +43 -0
- package/dist/main/apps/resolution-file.d.ts +60 -0
- package/dist/main/apps/resolution-file.js +258 -0
- package/dist/main/apps/rtws-seed.d.ts +7 -0
- package/dist/main/apps/rtws-seed.js +51 -0
- package/dist/main/apps/run-app-json.d.ts +8 -0
- package/dist/main/apps/run-app-json.js +86 -0
- package/dist/main/apps/run-control.d.ts +7 -0
- package/dist/main/apps/run-control.js +91 -0
- package/dist/main/apps/runtime.d.ts +19 -0
- package/dist/main/apps/runtime.js +470 -0
- package/dist/main/apps/teammates.d.ts +7 -0
- package/dist/main/apps/teammates.js +154 -0
- package/dist/main/apps/workspace-app-state.d.ts +4 -0
- package/dist/main/apps/workspace-app-state.js +8 -0
- package/dist/main/apps-host/client.d.ts +41 -0
- package/dist/main/apps-host/client.js +515 -0
- package/dist/main/apps-host/host.d.ts +2 -0
- package/dist/main/apps-host/host.js +738 -0
- package/dist/main/apps-host/ipc-types.d.ts +190 -0
- package/dist/main/apps-host/ipc-types.js +454 -0
- package/dist/main/bootstrap/dotenv.d.ts +13 -0
- package/dist/main/bootstrap/dotenv.js +144 -0
- package/dist/main/bootstrap/global-dialog-event-broadcaster.d.ts +18 -0
- package/dist/main/bootstrap/global-dialog-event-broadcaster.js +81 -0
- package/dist/main/bootstrap/rtws-cli.d.ts +8 -0
- package/dist/main/bootstrap/rtws-cli.js +73 -0
- package/dist/main/cli/apps-cli-hints.d.ts +11 -0
- package/dist/main/cli/apps-cli-hints.js +24 -0
- package/dist/main/cli/create.d.ts +14 -0
- package/dist/main/cli/create.js +263 -0
- package/dist/main/cli/disable.d.ts +3 -0
- package/dist/main/cli/disable.js +80 -0
- package/dist/main/cli/doctor.d.ts +45 -0
- package/dist/main/cli/doctor.js +283 -0
- package/dist/main/cli/enable.d.ts +3 -0
- package/dist/main/cli/enable.js +80 -0
- package/dist/main/cli/install.d.ts +9 -0
- package/dist/main/cli/install.js +244 -0
- package/dist/main/cli/manual.d.ts +14 -0
- package/dist/main/cli/manual.js +185 -0
- package/dist/main/cli/read.d.ts +18 -0
- package/dist/main/cli/read.js +534 -0
- package/dist/main/cli/team-definition-audit.d.ts +35 -0
- package/dist/main/cli/team-definition-audit.js +159 -0
- package/dist/main/cli/tui.d.ts +18 -0
- package/dist/main/cli/tui.js +199 -0
- package/dist/main/cli/uninstall.d.ts +3 -0
- package/dist/main/cli/uninstall.js +126 -0
- package/dist/main/cli/update.d.ts +3 -0
- package/dist/main/cli/update.js +104 -0
- package/dist/main/cli/validate-team-def.d.ts +2 -0
- package/dist/main/cli/validate-team-def.js +89 -0
- package/dist/main/cli/webui.d.ts +15 -0
- package/dist/main/cli/webui.js +169 -0
- package/dist/main/cli.d.ts +31 -0
- package/dist/main/cli.js +353 -0
- package/dist/main/dialog-display-state.d.ts +55 -0
- package/dist/main/dialog-display-state.js +454 -0
- package/dist/main/dialog-factory.d.ts +37 -0
- package/dist/main/dialog-factory.js +63 -0
- package/dist/main/dialog-fork.d.ts +25 -0
- package/dist/main/dialog-fork.js +654 -0
- package/dist/main/dialog-global-registry.d.ts +37 -0
- package/dist/main/dialog-global-registry.js +129 -0
- package/dist/main/dialog-instance-registry.d.ts +4 -0
- package/dist/main/dialog-instance-registry.js +121 -0
- package/dist/main/dialog.d.ts +684 -0
- package/dist/main/dialog.js +1631 -0
- package/dist/main/evt-registry.d.ts +68 -0
- package/dist/main/evt-registry.js +167 -0
- package/dist/main/llm/api-quirks.d.ts +35 -0
- package/dist/main/llm/api-quirks.js +82 -0
- package/dist/main/llm/client.d.ts +82 -0
- package/dist/main/llm/client.js +69 -0
- package/dist/main/llm/gen/anthropic.d.ts +34 -0
- package/dist/main/llm/gen/anthropic.js +948 -0
- package/dist/main/llm/gen/artifacts.d.ts +25 -0
- package/dist/main/llm/gen/artifacts.js +129 -0
- package/dist/main/llm/gen/codex.d.ts +28 -0
- package/dist/main/llm/gen/codex.js +831 -0
- package/dist/main/llm/gen/failure-classifier.d.ts +10 -0
- package/dist/main/llm/gen/failure-classifier.js +309 -0
- package/dist/main/llm/gen/mock.d.ts +77 -0
- package/dist/main/llm/gen/mock.js +579 -0
- package/dist/main/llm/gen/openai-compatible.d.ts +27 -0
- package/dist/main/llm/gen/openai-compatible.js +759 -0
- package/dist/main/llm/gen/openai.d.ts +19 -0
- package/dist/main/llm/gen/openai.js +1782 -0
- package/dist/main/llm/gen/registry.d.ts +10 -0
- package/dist/main/llm/gen/registry.js +28 -0
- package/dist/main/llm/gen/tool-call-context.d.ts +24 -0
- package/dist/main/llm/gen/tool-call-context.js +160 -0
- package/dist/main/llm/gen/tool-output-limit.d.ts +9 -0
- package/dist/main/llm/gen/tool-output-limit.js +50 -0
- package/dist/main/llm/gen.d.ts +120 -0
- package/dist/main/llm/gen.js +2 -0
- package/dist/main/llm/kernel-driver/context-health.d.ts +24 -0
- package/dist/main/llm/kernel-driver/context-health.js +120 -0
- package/dist/main/llm/kernel-driver/context.d.ts +23 -0
- package/dist/main/llm/kernel-driver/context.js +50 -0
- package/dist/main/llm/kernel-driver/drive.d.ts +3 -0
- package/dist/main/llm/kernel-driver/drive.js +2154 -0
- package/dist/main/llm/kernel-driver/engine.d.ts +10 -0
- package/dist/main/llm/kernel-driver/engine.js +67 -0
- package/dist/main/llm/kernel-driver/events.d.ts +4 -0
- package/dist/main/llm/kernel-driver/events.js +18 -0
- package/dist/main/llm/kernel-driver/fbr.d.ts +52 -0
- package/dist/main/llm/kernel-driver/fbr.js +390 -0
- package/dist/main/llm/kernel-driver/flow.d.ts +8 -0
- package/dist/main/llm/kernel-driver/flow.js +692 -0
- package/dist/main/llm/kernel-driver/guardrails.d.ts +36 -0
- package/dist/main/llm/kernel-driver/guardrails.js +128 -0
- package/dist/main/llm/kernel-driver/index.d.ts +4 -0
- package/dist/main/llm/kernel-driver/index.js +11 -0
- package/dist/main/llm/kernel-driver/loop.d.ts +2 -0
- package/dist/main/llm/kernel-driver/loop.js +130 -0
- package/dist/main/llm/kernel-driver/reply-guidance.d.ts +27 -0
- package/dist/main/llm/kernel-driver/reply-guidance.js +143 -0
- package/dist/main/llm/kernel-driver/restore.d.ts +13 -0
- package/dist/main/llm/kernel-driver/restore.js +73 -0
- package/dist/main/llm/kernel-driver/runtime.d.ts +57 -0
- package/dist/main/llm/kernel-driver/runtime.js +1084 -0
- package/dist/main/llm/kernel-driver/subdialog-txn.d.ts +8 -0
- package/dist/main/llm/kernel-driver/subdialog-txn.js +58 -0
- package/dist/main/llm/kernel-driver/subdialog.d.ts +48 -0
- package/dist/main/llm/kernel-driver/subdialog.js +621 -0
- package/dist/main/llm/kernel-driver/tellask-special.d.ts +117 -0
- package/dist/main/llm/kernel-driver/tellask-special.js +2149 -0
- package/dist/main/llm/kernel-driver/types.d.ts +106 -0
- package/dist/main/llm/kernel-driver/types.js +10 -0
- package/dist/main/llm/kernel-driver.d.ts +1 -0
- package/dist/main/llm/kernel-driver.js +17 -0
- package/dist/main/llm/tools-projection.d.ts +13 -0
- package/dist/main/llm/tools-projection.js +12 -0
- package/dist/main/log.d.ts +30 -0
- package/dist/main/log.js +587 -0
- package/dist/main/markdown/frontmatter.d.ts +7 -0
- package/dist/main/markdown/frontmatter.js +44 -0
- package/dist/main/mcp/config.d.ts +75 -0
- package/dist/main/mcp/config.js +256 -0
- package/dist/main/mcp/sdk-client.d.ts +40 -0
- package/dist/main/mcp/sdk-client.js +359 -0
- package/dist/main/mcp/server-runtime.d.ts +23 -0
- package/dist/main/mcp/server-runtime.js +72 -0
- package/dist/main/mcp/stdio-client.d.ts +27 -0
- package/dist/main/mcp/stdio-client.js +280 -0
- package/dist/main/mcp/supervisor.d.ts +29 -0
- package/dist/main/mcp/supervisor.js +1375 -0
- package/dist/main/mcp/tool-names.d.ts +29 -0
- package/dist/main/mcp/tool-names.js +109 -0
- package/dist/main/minds/load.d.ts +13 -0
- package/dist/main/minds/load.js +508 -0
- package/dist/main/minds/minds-i18n.d.ts +30 -0
- package/dist/main/minds/minds-i18n.js +131 -0
- package/dist/main/minds/system-prompt-parts.d.ts +20 -0
- package/dist/main/minds/system-prompt-parts.js +269 -0
- package/dist/main/minds/system-prompt.d.ts +28 -0
- package/dist/main/minds/system-prompt.js +539 -0
- package/dist/main/persistence.d.ts +582 -0
- package/dist/main/persistence.js +5329 -0
- package/dist/main/priming.d.ts +83 -0
- package/dist/main/priming.js +2448 -0
- package/dist/main/problems.d.ts +21 -0
- package/dist/main/problems.js +236 -0
- package/dist/main/recovery/reply-special.d.ts +3 -0
- package/dist/main/recovery/reply-special.js +106 -0
- package/dist/main/runtime/async-fifo-mutex.d.ts +12 -0
- package/dist/main/runtime/async-fifo-mutex.js +36 -0
- package/dist/main/runtime/driver-messages.d.ts +40 -0
- package/dist/main/runtime/driver-messages.js +465 -0
- package/dist/main/runtime/fbr-body.d.ts +10 -0
- package/dist/main/runtime/fbr-body.js +42 -0
- package/dist/main/runtime/i18n-text.d.ts +6 -0
- package/dist/main/runtime/i18n-text.js +9 -0
- package/dist/main/runtime/inter-dialog-format.d.ts +85 -0
- package/dist/main/runtime/inter-dialog-format.js +374 -0
- package/dist/main/runtime/markdown-format.d.ts +1 -0
- package/dist/main/runtime/markdown-format.js +9 -0
- package/dist/main/runtime/reply-prompt-copy.d.ts +33 -0
- package/dist/main/runtime/reply-prompt-copy.js +140 -0
- package/dist/main/runtime/tellask-labels.d.ts +8 -0
- package/dist/main/runtime/tellask-labels.js +47 -0
- package/dist/main/runtime/tool-result-messages.d.ts +6 -0
- package/dist/main/runtime/tool-result-messages.js +52 -0
- package/dist/main/runtime/work-language.d.ts +11 -0
- package/dist/main/runtime/work-language.js +47 -0
- package/dist/main/server/api-routes.d.ts +11 -0
- package/dist/main/server/api-routes.js +2741 -0
- package/dist/main/server/auth.d.ts +44 -0
- package/dist/main/server/auth.js +201 -0
- package/dist/main/server/create-dialog-contract.d.ts +12 -0
- package/dist/main/server/create-dialog-contract.js +89 -0
- package/dist/main/server/dominds-running-version.d.ts +1 -0
- package/dist/main/server/dominds-running-version.js +9 -0
- package/dist/main/server/dominds-runtime-status.d.ts +3 -0
- package/dist/main/server/dominds-runtime-status.js +22 -0
- package/dist/main/server/dominds-self-update.d.ts +13 -0
- package/dist/main/server/dominds-self-update.js +521 -0
- package/dist/main/server/mime-types.d.ts +8 -0
- package/dist/main/server/mime-types.js +135 -0
- package/dist/main/server/server-core.d.ts +80 -0
- package/dist/main/server/server-core.js +269 -0
- package/dist/main/server/setup-routes.d.ts +45 -0
- package/dist/main/server/setup-routes.js +803 -0
- package/dist/main/server/snippets-routes.d.ts +61 -0
- package/dist/main/server/snippets-routes.js +685 -0
- package/dist/main/server/static-server.d.ts +14 -0
- package/dist/main/server/static-server.js +136 -0
- package/dist/main/server/websocket-handler.d.ts +17 -0
- package/dist/main/server/websocket-handler.js +1530 -0
- package/dist/main/server.d.ts +17 -0
- package/dist/main/server.js +186 -0
- package/dist/main/shared-reminders.d.ts +4 -0
- package/dist/main/shared-reminders.js +176 -0
- package/dist/main/skills/load.d.ts +24 -0
- package/dist/main/skills/load.js +281 -0
- package/dist/main/team-config-updates.d.ts +21 -0
- package/dist/main/team-config-updates.js +206 -0
- package/dist/main/team.d.ts +187 -0
- package/dist/main/team.js +2300 -0
- package/dist/main/tool.d.ts +110 -0
- package/dist/main/tool.js +395 -0
- package/dist/main/tools/app-reminders.d.ts +16 -0
- package/dist/main/tools/app-reminders.js +310 -0
- package/dist/main/tools/apply-patch.d.ts +2 -0
- package/dist/main/tools/apply-patch.js +547 -0
- package/dist/main/tools/builtins.d.ts +1 -0
- package/dist/main/tools/builtins.js +260 -0
- package/dist/main/tools/cmd-runner-protocol.d.ts +94 -0
- package/dist/main/tools/cmd-runner-protocol.js +278 -0
- package/dist/main/tools/cmd-runner.d.ts +1 -0
- package/dist/main/tools/cmd-runner.js +320 -0
- package/dist/main/tools/ctrl.d.ts +34 -0
- package/dist/main/tools/ctrl.js +796 -0
- package/dist/main/tools/env.d.ts +12 -0
- package/dist/main/tools/env.js +193 -0
- package/dist/main/tools/fs.d.ts +7 -0
- package/dist/main/tools/fs.js +967 -0
- package/dist/main/tools/manual/render.d.ts +16 -0
- package/dist/main/tools/manual/render.js +364 -0
- package/dist/main/tools/manual/schema.d.ts +3 -0
- package/dist/main/tools/manual/schema.js +163 -0
- package/dist/main/tools/manual/spec.d.ts +53 -0
- package/dist/main/tools/manual/spec.js +151 -0
- package/dist/main/tools/mcp.d.ts +9 -0
- package/dist/main/tools/mcp.js +183 -0
- package/dist/main/tools/mem.d.ts +9 -0
- package/dist/main/tools/mem.js +355 -0
- package/dist/main/tools/os.d.ts +13 -0
- package/dist/main/tools/os.js +2014 -0
- package/dist/main/tools/output-limit.d.ts +16 -0
- package/dist/main/tools/output-limit.js +101 -0
- package/dist/main/tools/pending-tellask-reminder.d.ts +4 -0
- package/dist/main/tools/pending-tellask-reminder.js +228 -0
- package/dist/main/tools/plan.d.ts +2 -0
- package/dist/main/tools/plan.js +171 -0
- package/dist/main/tools/registry-snapshot.d.ts +4 -0
- package/dist/main/tools/registry-snapshot.js +35 -0
- package/dist/main/tools/registry.d.ts +48 -0
- package/dist/main/tools/registry.js +116 -0
- package/dist/main/tools/ripgrep.d.ts +6 -0
- package/dist/main/tools/ripgrep.js +1083 -0
- package/dist/main/tools/shell-tools.d.ts +5 -0
- package/dist/main/tools/shell-tools.js +21 -0
- package/dist/main/tools/team_mgmt.d.ts +43 -0
- package/dist/main/tools/team_mgmt.js +5413 -0
- package/dist/main/tools/toolset-manual.d.ts +20 -0
- package/dist/main/tools/toolset-manual.js +368 -0
- package/dist/main/tools/txt.d.ts +43 -0
- package/dist/main/tools/txt.js +3316 -0
- package/dist/main/utils/id.d.ts +20 -0
- package/dist/main/utils/id.js +72 -0
- package/dist/main/utils/task-package.d.ts +140 -0
- package/dist/main/utils/task-package.js +522 -0
- package/dist/main/utils/taskdoc-search.d.ts +19 -0
- package/dist/main/utils/taskdoc-search.js +295 -0
- package/dist/main/utils/taskdoc.d.ts +7 -0
- package/dist/main/utils/taskdoc.js +402 -0
- package/dist/mcp/supervisor.js +4 -6
- package/dist/package.json +91 -0
- package/dist/persistence.js +77 -43
- package/dist/runtime/tool-result-messages.d.ts +2 -1
- package/dist/runtime/tool-result-messages.js +13 -12
- package/dist/server/websocket-handler.js +23 -27
- package/dist/tool.d.ts +9 -1
- package/dist/tool.js +20 -0
- package/dist/tools/apply-patch.js +2 -1
- package/dist/tools/ctrl.js +53 -50
- package/dist/tools/env.js +7 -6
- package/dist/tools/fs.js +64 -59
- package/dist/tools/mcp.js +6 -5
- package/dist/tools/mem.js +35 -34
- package/dist/tools/os.js +30 -29
- package/dist/tools/plan.js +12 -10
- package/dist/tools/ripgrep.js +17 -10
- package/dist/tools/team_mgmt.js +25 -24
- package/dist/tools/toolset-manual.js +12 -11
- package/dist/tools/txt.d.ts +2 -2
- package/dist/tools/txt.js +61 -77
- package/package.json +4 -4
- package/webapp/dist/assets/{_basePickBy-DsirmCgI.js → _basePickBy-Q203DmRN.js} +3 -3
- package/webapp/dist/assets/{_basePickBy-DsirmCgI.js.map → _basePickBy-Q203DmRN.js.map} +1 -1
- package/webapp/dist/assets/{_baseUniq-tR6G8loB.js → _baseUniq-Be8kQUYz.js} +2 -2
- package/webapp/dist/assets/{_baseUniq-tR6G8loB.js.map → _baseUniq-Be8kQUYz.js.map} +1 -1
- package/webapp/dist/assets/{arc-CzxpASkZ.js → arc-6xSICGFS.js} +2 -2
- package/webapp/dist/assets/{arc-CzxpASkZ.js.map → arc-6xSICGFS.js.map} +1 -1
- package/webapp/dist/assets/{architectureDiagram-2XIMDMQ5-BSH7H5oI.js → architectureDiagram-2XIMDMQ5-DNHfOnE-.js} +7 -7
- package/webapp/dist/assets/{architectureDiagram-2XIMDMQ5-BSH7H5oI.js.map → architectureDiagram-2XIMDMQ5-DNHfOnE-.js.map} +1 -1
- package/webapp/dist/assets/{blockDiagram-WCTKOSBZ-DpLIr7yO.js → blockDiagram-WCTKOSBZ-CYMJiPsJ.js} +7 -7
- package/webapp/dist/assets/{blockDiagram-WCTKOSBZ-DpLIr7yO.js.map → blockDiagram-WCTKOSBZ-CYMJiPsJ.js.map} +1 -1
- package/webapp/dist/assets/{c4Diagram-IC4MRINW-WuYKgWfY.js → c4Diagram-IC4MRINW-BvqRsE5C.js} +3 -3
- package/webapp/dist/assets/{c4Diagram-IC4MRINW-WuYKgWfY.js.map → c4Diagram-IC4MRINW-BvqRsE5C.js.map} +1 -1
- package/webapp/dist/assets/{channel-B-v9dqLN.js → channel-GAdDc_yy.js} +2 -2
- package/webapp/dist/assets/{channel-B-v9dqLN.js.map → channel-GAdDc_yy.js.map} +1 -1
- package/webapp/dist/assets/{chunk-4BX2VUAB-MtFUfKZy.js → chunk-4BX2VUAB-CYJrLCGp.js} +2 -2
- package/webapp/dist/assets/{chunk-4BX2VUAB-MtFUfKZy.js.map → chunk-4BX2VUAB-CYJrLCGp.js.map} +1 -1
- package/webapp/dist/assets/{chunk-55IACEB6-rY9AJdzj.js → chunk-55IACEB6-DFaHS4Ma.js} +2 -2
- package/webapp/dist/assets/{chunk-55IACEB6-rY9AJdzj.js.map → chunk-55IACEB6-DFaHS4Ma.js.map} +1 -1
- package/webapp/dist/assets/{chunk-FMBD7UC4-B-RtOs7e.js → chunk-FMBD7UC4-ynhrYc5z.js} +2 -2
- package/webapp/dist/assets/{chunk-FMBD7UC4-B-RtOs7e.js.map → chunk-FMBD7UC4-ynhrYc5z.js.map} +1 -1
- package/webapp/dist/assets/{chunk-JSJVCQXG-Da1d3uS4.js → chunk-JSJVCQXG-BBgi_Jq7.js} +2 -2
- package/webapp/dist/assets/{chunk-JSJVCQXG-Da1d3uS4.js.map → chunk-JSJVCQXG-BBgi_Jq7.js.map} +1 -1
- package/webapp/dist/assets/{chunk-KX2RTZJC-DH9UrpuG.js → chunk-KX2RTZJC-CLimzawP.js} +2 -2
- package/webapp/dist/assets/{chunk-KX2RTZJC-DH9UrpuG.js.map → chunk-KX2RTZJC-CLimzawP.js.map} +1 -1
- package/webapp/dist/assets/{chunk-NQ4KR5QH-CK365lrr.js → chunk-NQ4KR5QH-DO4qGcdv.js} +4 -4
- package/webapp/dist/assets/{chunk-NQ4KR5QH-CK365lrr.js.map → chunk-NQ4KR5QH-DO4qGcdv.js.map} +1 -1
- package/webapp/dist/assets/{chunk-QZHKN3VN-BCaWPGDm.js → chunk-QZHKN3VN-Cb-0-hlo.js} +2 -2
- package/webapp/dist/assets/{chunk-QZHKN3VN-BCaWPGDm.js.map → chunk-QZHKN3VN-Cb-0-hlo.js.map} +1 -1
- package/webapp/dist/assets/{chunk-WL4C6EOR-DDCnEwft.js → chunk-WL4C6EOR-CwJGUOIB.js} +6 -6
- package/webapp/dist/assets/{chunk-WL4C6EOR-DDCnEwft.js.map → chunk-WL4C6EOR-CwJGUOIB.js.map} +1 -1
- package/webapp/dist/assets/{classDiagram-VBA2DB6C-CvMBU4WA.js → classDiagram-VBA2DB6C-Ce74VnqH.js} +7 -7
- package/webapp/dist/assets/{classDiagram-VBA2DB6C-CvMBU4WA.js.map → classDiagram-VBA2DB6C-Ce74VnqH.js.map} +1 -1
- package/webapp/dist/assets/{classDiagram-v2-RAHNMMFH-CvMBU4WA.js → classDiagram-v2-RAHNMMFH-Ce74VnqH.js} +7 -7
- package/webapp/dist/assets/{classDiagram-v2-RAHNMMFH-CvMBU4WA.js.map → classDiagram-v2-RAHNMMFH-Ce74VnqH.js.map} +1 -1
- package/webapp/dist/assets/{clone-r98jR0MC.js → clone-Bg0lMfZU.js} +2 -2
- package/webapp/dist/assets/{clone-r98jR0MC.js.map → clone-Bg0lMfZU.js.map} +1 -1
- package/webapp/dist/assets/{cose-bilkent-S5V4N54A-t6J60Ogk.js → cose-bilkent-S5V4N54A-G8K9A1UF.js} +2 -2
- package/webapp/dist/assets/{cose-bilkent-S5V4N54A-t6J60Ogk.js.map → cose-bilkent-S5V4N54A-G8K9A1UF.js.map} +1 -1
- package/webapp/dist/assets/{dagre-KLK3FWXG-BlqmY2DV.js → dagre-KLK3FWXG-cdleQdp9.js} +7 -7
- package/webapp/dist/assets/{dagre-KLK3FWXG-BlqmY2DV.js.map → dagre-KLK3FWXG-cdleQdp9.js.map} +1 -1
- package/webapp/dist/assets/{diagram-E7M64L7V-FwCHeIUD.js → diagram-E7M64L7V-DcUifE0l.js} +8 -8
- package/webapp/dist/assets/{diagram-E7M64L7V-FwCHeIUD.js.map → diagram-E7M64L7V-DcUifE0l.js.map} +1 -1
- package/webapp/dist/assets/{diagram-IFDJBPK2-NhtmkuZG.js → diagram-IFDJBPK2-B8ao825o.js} +7 -7
- package/webapp/dist/assets/{diagram-IFDJBPK2-NhtmkuZG.js.map → diagram-IFDJBPK2-B8ao825o.js.map} +1 -1
- package/webapp/dist/assets/{diagram-P4PSJMXO-B9FcmokX.js → diagram-P4PSJMXO-dLzEGj29.js} +7 -7
- package/webapp/dist/assets/{diagram-P4PSJMXO-B9FcmokX.js.map → diagram-P4PSJMXO-dLzEGj29.js.map} +1 -1
- package/webapp/dist/assets/{erDiagram-INFDFZHY-DHKmWvtB.js → erDiagram-INFDFZHY-U1yKOjA_.js} +5 -5
- package/webapp/dist/assets/{erDiagram-INFDFZHY-DHKmWvtB.js.map → erDiagram-INFDFZHY-U1yKOjA_.js.map} +1 -1
- package/webapp/dist/assets/{flowDiagram-PKNHOUZH-C7Zi8I7T.js → flowDiagram-PKNHOUZH-BUfRnh1D.js} +7 -7
- package/webapp/dist/assets/{flowDiagram-PKNHOUZH-C7Zi8I7T.js.map → flowDiagram-PKNHOUZH-BUfRnh1D.js.map} +1 -1
- package/webapp/dist/assets/{ganttDiagram-A5KZAMGK-Cv2T8tz_.js → ganttDiagram-A5KZAMGK-CplbNx1T.js} +3 -3
- package/webapp/dist/assets/{ganttDiagram-A5KZAMGK-Cv2T8tz_.js.map → ganttDiagram-A5KZAMGK-CplbNx1T.js.map} +1 -1
- package/webapp/dist/assets/{gitGraphDiagram-K3NZZRJ6-DztaipJU.js → gitGraphDiagram-K3NZZRJ6-CpFa6Gm4.js} +8 -8
- package/webapp/dist/assets/{gitGraphDiagram-K3NZZRJ6-DztaipJU.js.map → gitGraphDiagram-K3NZZRJ6-CpFa6Gm4.js.map} +1 -1
- package/webapp/dist/assets/{graph-C5yf62Vs.js → graph-X4xh5254.js} +3 -3
- package/webapp/dist/assets/{graph-C5yf62Vs.js.map → graph-X4xh5254.js.map} +1 -1
- package/webapp/dist/assets/{index-hve5MWPs.js → index-VrF4deb4.js} +680 -405
- package/webapp/dist/assets/{index-hve5MWPs.js.map → index-VrF4deb4.js.map} +1 -1
- package/webapp/dist/assets/{infoDiagram-LFFYTUFH-VgsbBPZP.js → infoDiagram-LFFYTUFH-DLqJrnX2.js} +6 -6
- package/webapp/dist/assets/{infoDiagram-LFFYTUFH-VgsbBPZP.js.map → infoDiagram-LFFYTUFH-DLqJrnX2.js.map} +1 -1
- package/webapp/dist/assets/{ishikawaDiagram-PHBUUO56-C7j3YWdw.js → ishikawaDiagram-PHBUUO56-DS0xVc39.js} +2 -2
- package/webapp/dist/assets/{ishikawaDiagram-PHBUUO56-C7j3YWdw.js.map → ishikawaDiagram-PHBUUO56-DS0xVc39.js.map} +1 -1
- package/webapp/dist/assets/{journeyDiagram-4ABVD52K-OO8sev-Y.js → journeyDiagram-4ABVD52K-CoKHZIli.js} +5 -5
- package/webapp/dist/assets/{journeyDiagram-4ABVD52K-OO8sev-Y.js.map → journeyDiagram-4ABVD52K-CoKHZIli.js.map} +1 -1
- package/webapp/dist/assets/{kanban-definition-K7BYSVSG-DiYCC1Ig.js → kanban-definition-K7BYSVSG-CkhxYQD4.js} +3 -3
- package/webapp/dist/assets/{kanban-definition-K7BYSVSG-DiYCC1Ig.js.map → kanban-definition-K7BYSVSG-CkhxYQD4.js.map} +1 -1
- package/webapp/dist/assets/{layout-DdZSgGdu.js → layout-BGbl5ERx.js} +5 -5
- package/webapp/dist/assets/{layout-DdZSgGdu.js.map → layout-BGbl5ERx.js.map} +1 -1
- package/webapp/dist/assets/{linear-7-aHtaFi.js → linear-DYR4qG3c.js} +2 -2
- package/webapp/dist/assets/{linear-7-aHtaFi.js.map → linear-DYR4qG3c.js.map} +1 -1
- package/webapp/dist/assets/{mindmap-definition-YRQLILUH-IG3I-RdD.js → mindmap-definition-YRQLILUH-CI6s6HGL.js} +4 -4
- package/webapp/dist/assets/{mindmap-definition-YRQLILUH-IG3I-RdD.js.map → mindmap-definition-YRQLILUH-CI6s6HGL.js.map} +1 -1
- package/webapp/dist/assets/{pieDiagram-SKSYHLDU-z68KJT5r.js → pieDiagram-SKSYHLDU-D7hBaJ3p.js} +8 -8
- package/webapp/dist/assets/{pieDiagram-SKSYHLDU-z68KJT5r.js.map → pieDiagram-SKSYHLDU-D7hBaJ3p.js.map} +1 -1
- package/webapp/dist/assets/{quadrantDiagram-337W2JSQ-DaENWdO6.js → quadrantDiagram-337W2JSQ-C2FhBe5h.js} +3 -3
- package/webapp/dist/assets/{quadrantDiagram-337W2JSQ-DaENWdO6.js.map → quadrantDiagram-337W2JSQ-C2FhBe5h.js.map} +1 -1
- package/webapp/dist/assets/{requirementDiagram-Z7DCOOCP-ROTFv4sa.js → requirementDiagram-Z7DCOOCP-D3055xhP.js} +4 -4
- package/webapp/dist/assets/{requirementDiagram-Z7DCOOCP-ROTFv4sa.js.map → requirementDiagram-Z7DCOOCP-D3055xhP.js.map} +1 -1
- package/webapp/dist/assets/{sankeyDiagram-WA2Y5GQK-CK7qtpzw.js → sankeyDiagram-WA2Y5GQK-N-xzUXIx.js} +2 -2
- package/webapp/dist/assets/{sankeyDiagram-WA2Y5GQK-CK7qtpzw.js.map → sankeyDiagram-WA2Y5GQK-N-xzUXIx.js.map} +1 -1
- package/webapp/dist/assets/{sequenceDiagram-2WXFIKYE-R5lDySeI.js → sequenceDiagram-2WXFIKYE-MaaWXY3J.js} +4 -4
- package/webapp/dist/assets/{sequenceDiagram-2WXFIKYE-R5lDySeI.js.map → sequenceDiagram-2WXFIKYE-MaaWXY3J.js.map} +1 -1
- package/webapp/dist/assets/{stateDiagram-RAJIS63D-sr7msF5U.js → stateDiagram-RAJIS63D-Cbh4Y23d.js} +9 -9
- package/webapp/dist/assets/{stateDiagram-RAJIS63D-sr7msF5U.js.map → stateDiagram-RAJIS63D-Cbh4Y23d.js.map} +1 -1
- package/webapp/dist/assets/{stateDiagram-v2-FVOUBMTO-X663liwS.js → stateDiagram-v2-FVOUBMTO-C8FJ5C15.js} +5 -5
- package/webapp/dist/assets/{stateDiagram-v2-FVOUBMTO-X663liwS.js.map → stateDiagram-v2-FVOUBMTO-C8FJ5C15.js.map} +1 -1
- package/webapp/dist/assets/{timeline-definition-YZTLITO2-Bw0TdG26.js → timeline-definition-YZTLITO2-mQ5VlR3Y.js} +3 -3
- package/webapp/dist/assets/{timeline-definition-YZTLITO2-Bw0TdG26.js.map → timeline-definition-YZTLITO2-mQ5VlR3Y.js.map} +1 -1
- package/webapp/dist/assets/{treemap-KZPCXAKY-D_sjKwI7.js → treemap-KZPCXAKY-B42URX3s.js} +5 -5
- package/webapp/dist/assets/{treemap-KZPCXAKY-D_sjKwI7.js.map → treemap-KZPCXAKY-B42URX3s.js.map} +1 -1
- package/webapp/dist/assets/{vennDiagram-LZ73GAT5-DhlHIHid.js → vennDiagram-LZ73GAT5-Ld7mOnHA.js} +2 -2
- package/webapp/dist/assets/{vennDiagram-LZ73GAT5-DhlHIHid.js.map → vennDiagram-LZ73GAT5-Ld7mOnHA.js.map} +1 -1
- package/webapp/dist/assets/{xychartDiagram-JWTSCODW-C65ESjTc.js → xychartDiagram-JWTSCODW-CQy5At2t.js} +3 -3
- package/webapp/dist/assets/{xychartDiagram-JWTSCODW-C65ESjTc.js.map → xychartDiagram-JWTSCODW-CQy5At2t.js.map} +1 -1
- package/webapp/dist/index.html +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { DomindsAppInstallJson } from '@longrun-ai/kernel/app-json';
|
|
2
2
|
import type { AppsResolutionEntry } from './resolution-file';
|
|
3
3
|
export type AssignedPortResolutionReason = 'no_frontend' | 'kept_existing' | 'selected_default' | 'allocated_stable_range' | 'reassigned_from_existing_conflict' | 'reassigned_from_existing_unbindable';
|
|
4
4
|
export type AssignedPortResolution = Readonly<{
|
|
@@ -16,13 +16,13 @@ export type AssignedPortResolution = Readonly<{
|
|
|
16
16
|
*/
|
|
17
17
|
export declare function resolveStableAssignedPort(params: {
|
|
18
18
|
appId: string;
|
|
19
|
-
installJson:
|
|
19
|
+
installJson: DomindsAppInstallJson;
|
|
20
20
|
existingApps: ReadonlyArray<AppsResolutionEntry>;
|
|
21
21
|
existingAssignedPort: number | null;
|
|
22
22
|
}): Promise<number | null>;
|
|
23
23
|
export declare function resolveStableAssignedPortWithReason(params: {
|
|
24
24
|
appId: string;
|
|
25
|
-
installJson:
|
|
25
|
+
installJson: DomindsAppInstallJson;
|
|
26
26
|
existingApps: ReadonlyArray<AppsResolutionEntry>;
|
|
27
27
|
existingAssignedPort: number | null;
|
|
28
28
|
}): Promise<AssignedPortResolution>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type DomindsAppInstallJson } from '@longrun-ai/kernel/app-json';
|
|
2
2
|
export type AppsResolutionSchemaVersion = 1;
|
|
3
3
|
export type AppsResolutionSource = Readonly<{
|
|
4
4
|
kind: 'npx';
|
|
@@ -12,7 +12,7 @@ export type AppsResolutionEntry = Readonly<{
|
|
|
12
12
|
enabled: boolean;
|
|
13
13
|
source: AppsResolutionSource;
|
|
14
14
|
assignedPort: number | null;
|
|
15
|
-
installJson:
|
|
15
|
+
installJson: DomindsAppInstallJson;
|
|
16
16
|
}>;
|
|
17
17
|
export type AppsResolutionFile = Readonly<{
|
|
18
18
|
schemaVersion: AppsResolutionSchemaVersion;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type DomindsAppInstallJson } from '@longrun-ai/kernel/app-json';
|
|
2
2
|
export declare function runDomindsAppJsonViaNpx(params: {
|
|
3
3
|
spec: string;
|
|
4
4
|
cwdAbs: string;
|
|
5
|
-
}): Promise<
|
|
5
|
+
}): Promise<DomindsAppInstallJson>;
|
|
6
6
|
export declare function runDomindsAppJsonViaLocalPackage(params: {
|
|
7
7
|
packageRootAbs: string;
|
|
8
|
-
}): Promise<
|
|
8
|
+
}): Promise<DomindsAppInstallJson>;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import type { DomindsAppDynamicToolsetsContext, DomindsAppReminderOwnerApplyContext, DomindsAppReminderOwnerRenderContext, DomindsAppReminderOwnerUpdateContext, DomindsAppRunControlContext, DomindsAppRunControlResult } from '@longrun-ai/kernel/app-host-contract';
|
|
2
|
-
import type { DomindsAppHostReminderUpdateResult, DomindsAppHostToolResult,
|
|
2
|
+
import type { DomindsAppHostReminderUpdateResult, DomindsAppHostToolResult, DomindsAppInstallJson, DomindsAppReminderApplyRequest, DomindsAppReminderApplyResult } from '@longrun-ai/kernel/app-json';
|
|
3
3
|
import type { ChatMessage } from '../llm/client';
|
|
4
4
|
import type { ToolArguments } from '../tool';
|
|
5
5
|
import type { AppsHostMessageToKernel } from './ipc-types';
|
|
6
6
|
export type EnabledAppForHost = Readonly<{
|
|
7
7
|
appId: string;
|
|
8
8
|
runtimePort: number | null;
|
|
9
|
-
installJson:
|
|
9
|
+
installJson: DomindsAppInstallJson;
|
|
10
10
|
hostSourceVersion: string | null;
|
|
11
11
|
}>;
|
|
12
12
|
export type AppsHostClient = Readonly<{
|
package/dist/apps-host/host.js
CHANGED
|
@@ -33,12 +33,14 @@ function isStringArray(value) {
|
|
|
33
33
|
return Array.isArray(value) && value.every((item) => typeof item === 'string');
|
|
34
34
|
}
|
|
35
35
|
function isToolCallOutput(value) {
|
|
36
|
-
if (typeof value === 'string')
|
|
37
|
-
return true;
|
|
38
36
|
if (!isRecord(value))
|
|
39
37
|
return false;
|
|
40
38
|
if (typeof value['content'] !== 'string')
|
|
41
39
|
return false;
|
|
40
|
+
const outcome = value['outcome'];
|
|
41
|
+
if (outcome !== 'success' && outcome !== 'failure' && outcome !== 'partial_failure') {
|
|
42
|
+
return false;
|
|
43
|
+
}
|
|
42
44
|
const contentItems = value['contentItems'];
|
|
43
45
|
return contentItems === undefined || Array.isArray(contentItems);
|
|
44
46
|
}
|
|
@@ -183,15 +185,12 @@ function isChatMessage(value) {
|
|
|
183
185
|
return true;
|
|
184
186
|
}
|
|
185
187
|
function normalizeToolResult(value) {
|
|
186
|
-
if (isToolCallOutput(value)) {
|
|
187
|
-
return { output: value };
|
|
188
|
-
}
|
|
189
188
|
if (!isRecord(value)) {
|
|
190
|
-
throw new Error('Invalid app tool result: expected
|
|
189
|
+
throw new Error('Invalid app tool result: expected { output: { content, outcome, contentItems? }, ... }');
|
|
191
190
|
}
|
|
192
191
|
const output = value['output'];
|
|
193
192
|
if (!isToolCallOutput(output)) {
|
|
194
|
-
throw new Error('Invalid app tool result: output must be
|
|
193
|
+
throw new Error('Invalid app tool result: output must be { content, outcome, contentItems? }');
|
|
195
194
|
}
|
|
196
195
|
const reminderRequestsRaw = value['reminderRequests'];
|
|
197
196
|
if (reminderRequestsRaw !== undefined && !Array.isArray(reminderRequestsRaw)) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { DomindsAppRunControlResult } from '@longrun-ai/kernel/app-host-contract';
|
|
2
|
-
import type { DomindsAppDialogReminderRequestBatch, DomindsAppHostReminderUpdateResult,
|
|
2
|
+
import type { DomindsAppDialogReminderRequestBatch, DomindsAppHostReminderUpdateResult, DomindsAppInstallJson, DomindsAppReminderApplyRequest, DomindsAppReminderApplyResult, DomindsAppReminderState } from '@longrun-ai/kernel/app-json';
|
|
3
3
|
import type { LanguageCode } from '@longrun-ai/kernel/types/language';
|
|
4
4
|
import type { ChatMessage } from '../llm/client';
|
|
5
5
|
import type { ToolArguments, ToolCallOutput } from '../tool';
|
|
@@ -13,7 +13,7 @@ export type AppsHostKernelInitMessage = Readonly<{
|
|
|
13
13
|
apps: ReadonlyArray<Readonly<{
|
|
14
14
|
appId: string;
|
|
15
15
|
runtimePort: number | null;
|
|
16
|
-
installJson:
|
|
16
|
+
installJson: DomindsAppInstallJson;
|
|
17
17
|
}>>;
|
|
18
18
|
}>;
|
|
19
19
|
export type AppsHostKernelToolCallMessage = Readonly<{
|
|
@@ -25,6 +25,9 @@ export type RunControlCountsSnapshot = {
|
|
|
25
25
|
resumable: number;
|
|
26
26
|
};
|
|
27
27
|
export declare function setDisplayStateBroadcaster(fn: (msg: WebSocketMessage) => void): void;
|
|
28
|
+
export declare function isStoppedReasonResumable(reason: DialogInterruptionReason): boolean;
|
|
29
|
+
export declare function isDisplayStateResumable(state: DialogDisplayState | undefined): boolean;
|
|
30
|
+
export declare function isExecutionMarkerResumable(executionMarker: DialogExecutionMarker | undefined): boolean;
|
|
28
31
|
export declare function getRunControlCountsSnapshot(): Promise<RunControlCountsSnapshot>;
|
|
29
32
|
export declare function broadcastRunControlCountsSnapshot(): Promise<void>;
|
|
30
33
|
export declare function hasActiveRun(dialogId: DialogID): boolean;
|
|
@@ -18,6 +18,9 @@
|
|
|
18
18
|
*/
|
|
19
19
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20
20
|
exports.setDisplayStateBroadcaster = setDisplayStateBroadcaster;
|
|
21
|
+
exports.isStoppedReasonResumable = isStoppedReasonResumable;
|
|
22
|
+
exports.isDisplayStateResumable = isDisplayStateResumable;
|
|
23
|
+
exports.isExecutionMarkerResumable = isExecutionMarkerResumable;
|
|
21
24
|
exports.getRunControlCountsSnapshot = getRunControlCountsSnapshot;
|
|
22
25
|
exports.broadcastRunControlCountsSnapshot = broadcastRunControlCountsSnapshot;
|
|
23
26
|
exports.hasActiveRun = hasActiveRun;
|
|
@@ -58,13 +61,22 @@ function syncRunControlCountsAfterActiveRunChange(trigger, dialogId) {
|
|
|
58
61
|
}
|
|
59
62
|
})();
|
|
60
63
|
}
|
|
64
|
+
function isStoppedReasonResumable(reason) {
|
|
65
|
+
return reason.kind !== 'llm_retry_stopped';
|
|
66
|
+
}
|
|
67
|
+
function isDisplayStateResumable(state) {
|
|
68
|
+
return state?.kind === 'stopped' && state.continueEnabled;
|
|
69
|
+
}
|
|
70
|
+
function isExecutionMarkerResumable(executionMarker) {
|
|
71
|
+
return (executionMarker?.kind === 'interrupted' && isStoppedReasonResumable(executionMarker.reason));
|
|
72
|
+
}
|
|
61
73
|
function classifyRunControlBucket(state) {
|
|
62
74
|
if (!state)
|
|
63
75
|
return 'none';
|
|
64
76
|
if (state.kind === 'proceeding' || state.kind === 'proceeding_stop_requested') {
|
|
65
77
|
return 'proceeding';
|
|
66
78
|
}
|
|
67
|
-
if (state
|
|
79
|
+
if (isDisplayStateResumable(state)) {
|
|
68
80
|
return 'resumable';
|
|
69
81
|
}
|
|
70
82
|
return 'none';
|
|
@@ -91,7 +103,7 @@ async function getRunControlCountsSnapshot() {
|
|
|
91
103
|
if (latest?.generating === true) {
|
|
92
104
|
proceeding++;
|
|
93
105
|
}
|
|
94
|
-
else if (latest?.executionMarker
|
|
106
|
+
else if (isExecutionMarkerResumable(latest?.executionMarker)) {
|
|
95
107
|
resumable++;
|
|
96
108
|
}
|
|
97
109
|
}
|
|
@@ -219,7 +231,7 @@ async function setDialogDisplayState(dialogId, displayState) {
|
|
|
219
231
|
dialogId: dialogId.valueOf(),
|
|
220
232
|
});
|
|
221
233
|
}
|
|
222
|
-
const nextExecutionMarker = displayState.kind === '
|
|
234
|
+
const nextExecutionMarker = displayState.kind === 'stopped'
|
|
223
235
|
? { kind: 'interrupted', reason: displayState.reason }
|
|
224
236
|
: displayState.kind === 'dead'
|
|
225
237
|
? { kind: 'dead', reason: displayState.reason }
|
|
@@ -270,7 +282,7 @@ function broadcastDisplayStateMarker(dialogId, marker) {
|
|
|
270
282
|
}
|
|
271
283
|
async function computeIdleDisplayState(dlg) {
|
|
272
284
|
if (dlg.status === 'completed' || dlg.status === 'archived') {
|
|
273
|
-
return { kind: '
|
|
285
|
+
return { kind: 'idle_waiting_user' };
|
|
274
286
|
}
|
|
275
287
|
const latest = await persistence_1.DialogPersistence.loadDialogLatest(dlg.id, 'running');
|
|
276
288
|
if (dlg.id.selfId !== dlg.id.rootId &&
|
|
@@ -279,7 +291,11 @@ async function computeIdleDisplayState(dlg) {
|
|
|
279
291
|
return { kind: 'dead', reason: latest.executionMarker.reason };
|
|
280
292
|
}
|
|
281
293
|
if (latest?.executionMarker?.kind === 'interrupted') {
|
|
282
|
-
return {
|
|
294
|
+
return {
|
|
295
|
+
kind: 'stopped',
|
|
296
|
+
reason: latest.executionMarker.reason,
|
|
297
|
+
continueEnabled: isStoppedReasonResumable(latest.executionMarker.reason),
|
|
298
|
+
};
|
|
283
299
|
}
|
|
284
300
|
const hasQ4H = await dlg.hasPendingQ4H();
|
|
285
301
|
const hasSubdialogs = await dlg.hasPendingSubdialogs();
|
|
@@ -298,7 +314,7 @@ async function computeIdleDisplayStateFromPersistence(dialogId) {
|
|
|
298
314
|
const latest = await persistence_1.DialogPersistence.loadDialogLatest(dialogId, 'running');
|
|
299
315
|
const status = latest?.status;
|
|
300
316
|
if (status === 'completed' || status === 'archived') {
|
|
301
|
-
return { kind: '
|
|
317
|
+
return { kind: 'idle_waiting_user' };
|
|
302
318
|
}
|
|
303
319
|
if (dialogId.selfId !== dialogId.rootId &&
|
|
304
320
|
latest &&
|
|
@@ -307,7 +323,11 @@ async function computeIdleDisplayStateFromPersistence(dialogId) {
|
|
|
307
323
|
return { kind: 'dead', reason: latest.executionMarker.reason };
|
|
308
324
|
}
|
|
309
325
|
if (latest?.executionMarker?.kind === 'interrupted') {
|
|
310
|
-
return {
|
|
326
|
+
return {
|
|
327
|
+
kind: 'stopped',
|
|
328
|
+
reason: latest.executionMarker.reason,
|
|
329
|
+
continueEnabled: isStoppedReasonResumable(latest.executionMarker.reason),
|
|
330
|
+
};
|
|
311
331
|
}
|
|
312
332
|
const q4h = await persistence_1.DialogPersistence.loadQuestions4HumanState(dialogId, 'running');
|
|
313
333
|
const pendingSubdialogs = await persistence_1.DialogPersistence.loadPendingSubdialogs(dialogId, 'running');
|
|
@@ -358,8 +378,9 @@ async function reconcileDisplayStatesAfterRestart() {
|
|
|
358
378
|
const next = nextIdle.kind === 'blocked'
|
|
359
379
|
? nextIdle
|
|
360
380
|
: {
|
|
361
|
-
kind: '
|
|
381
|
+
kind: 'stopped',
|
|
362
382
|
reason: { kind: 'server_restart' },
|
|
383
|
+
continueEnabled: true,
|
|
363
384
|
};
|
|
364
385
|
try {
|
|
365
386
|
await persistence_1.DialogPersistence.mutateDialogLatest(dialogId, () => ({
|
|
@@ -367,9 +388,7 @@ async function reconcileDisplayStatesAfterRestart() {
|
|
|
367
388
|
patch: {
|
|
368
389
|
generating: false,
|
|
369
390
|
displayState: next,
|
|
370
|
-
executionMarker: next.kind === 'interrupted'
|
|
371
|
-
? { kind: 'interrupted', reason: next.reason }
|
|
372
|
-
: undefined,
|
|
391
|
+
executionMarker: next.kind === 'stopped' ? { kind: 'interrupted', reason: next.reason } : undefined,
|
|
373
392
|
},
|
|
374
393
|
}));
|
|
375
394
|
}
|
package/dist/dialog-fork.js
CHANGED
|
@@ -245,7 +245,7 @@ function computeRootForkDisplayState(args) {
|
|
|
245
245
|
if (hasSubdialogs) {
|
|
246
246
|
return { kind: 'blocked', reason: { kind: 'waiting_for_subdialogs' } };
|
|
247
247
|
}
|
|
248
|
-
return { kind: '
|
|
248
|
+
return { kind: 'stopped', reason: { kind: 'fork_continue_ready' }, continueEnabled: true };
|
|
249
249
|
}
|
|
250
250
|
async function copyArtifactsIfPresent(sourceId, targetId, sourceStatus) {
|
|
251
251
|
const sourceDir = node_path_1.default.join(persistence_1.DialogPersistence.getDialogEventsPath(sourceId, sourceStatus), 'artifacts');
|
|
@@ -222,7 +222,7 @@ Recommended user mental model:
|
|
|
222
222
|
|
|
223
223
|
(Current: implemented) existing anchors:
|
|
224
224
|
|
|
225
|
-
- JSON schema: `dominds/main/apps/app-json.ts` (`
|
|
225
|
+
- JSON schema: `dominds/main/apps/app-json.ts` (`DomindsAppInstallJson`).
|
|
226
226
|
- Apps configuration file: `dominds/main/apps/configuration-file.ts`.
|
|
227
227
|
- Apps resolution file: `dominds/main/apps/resolution-file.ts`.
|
|
228
228
|
|
|
@@ -221,7 +221,7 @@ Install JSON 是 app 与 Kernel/CLI 之间的**安装/运行握手载荷**。它
|
|
|
221
221
|
|
|
222
222
|
(现状:已实现)install json schema 与 apps 配置/解析锚点仍可参考:
|
|
223
223
|
|
|
224
|
-
- JSON schema:`dominds/main/apps/app-json.ts`(`
|
|
224
|
+
- JSON schema:`dominds/main/apps/app-json.ts`(`DomindsAppInstallJson`)。
|
|
225
225
|
- `.apps/configuration.yaml`:`dominds/main/apps/configuration-file.ts`。
|
|
226
226
|
- `.apps/resolution.yaml`:`dominds/main/apps/resolution-file.ts`。
|
|
227
227
|
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { LanguageCode } from '@longrun-ai/kernel/types/language';
|
|
2
|
+
import type { ProviderConfig } from './client';
|
|
3
|
+
import type { LlmRetryStrategy } from './gen';
|
|
4
|
+
export type LlmFailureKind = 'retriable' | 'rejected' | 'fatal';
|
|
5
|
+
export type LlmFailureSummary = {
|
|
6
|
+
kind: LlmFailureKind;
|
|
7
|
+
message: string;
|
|
8
|
+
status?: number;
|
|
9
|
+
code?: string;
|
|
10
|
+
};
|
|
11
|
+
export type LlmQuirkFailureHandling = {
|
|
12
|
+
kind: 'default';
|
|
13
|
+
} | {
|
|
14
|
+
kind: 'give_up';
|
|
15
|
+
message?: string;
|
|
16
|
+
summaryTextI18n?: Partial<Record<LanguageCode, string>>;
|
|
17
|
+
} | {
|
|
18
|
+
kind: 'retry_strategy';
|
|
19
|
+
retryStrategy: LlmRetryStrategy;
|
|
20
|
+
message?: string;
|
|
21
|
+
} | {
|
|
22
|
+
kind: 'single_retry';
|
|
23
|
+
delayMs: number;
|
|
24
|
+
message?: string;
|
|
25
|
+
};
|
|
26
|
+
export type LlmFailureQuirkHandlerSession = {
|
|
27
|
+
onFailure: (args: {
|
|
28
|
+
provider: string;
|
|
29
|
+
providerConfig: ProviderConfig;
|
|
30
|
+
failure: LlmFailureSummary;
|
|
31
|
+
error: unknown;
|
|
32
|
+
}) => LlmQuirkFailureHandling;
|
|
33
|
+
};
|
|
34
|
+
export declare function normalizeProviderApiQuirks(providerConfig: ProviderConfig): Set<string>;
|
|
35
|
+
export declare function createLlmFailureQuirkHandlerSession(providerConfig: ProviderConfig): LlmFailureQuirkHandlerSession | undefined;
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.normalizeProviderApiQuirks = normalizeProviderApiQuirks;
|
|
4
|
+
exports.createLlmFailureQuirkHandlerSession = createLlmFailureQuirkHandlerSession;
|
|
5
|
+
const DOMINDS_LLM_EMPTY_RESPONSE_ERROR_CODE = 'DOMINDS_LLM_EMPTY_RESPONSE';
|
|
6
|
+
const XCODE_BEST_EMPTY_RESPONSE_SINGLE_RETRY_DELAY_MS = 3000;
|
|
7
|
+
const XCODE_BEST_EMPTY_RESPONSE_GIVE_UP_THRESHOLD = 5;
|
|
8
|
+
function createXcodeBestFailureQuirkHandlerSession(providerConfig) {
|
|
9
|
+
let consecutiveEmptyResponseCount = 0;
|
|
10
|
+
return {
|
|
11
|
+
onFailure(args) {
|
|
12
|
+
if (args.failure.code !== DOMINDS_LLM_EMPTY_RESPONSE_ERROR_CODE) {
|
|
13
|
+
consecutiveEmptyResponseCount = 0;
|
|
14
|
+
return { kind: 'default' };
|
|
15
|
+
}
|
|
16
|
+
consecutiveEmptyResponseCount += 1;
|
|
17
|
+
if (consecutiveEmptyResponseCount < XCODE_BEST_EMPTY_RESPONSE_GIVE_UP_THRESHOLD) {
|
|
18
|
+
return {
|
|
19
|
+
kind: 'single_retry',
|
|
20
|
+
delayMs: XCODE_BEST_EMPTY_RESPONSE_SINGLE_RETRY_DELAY_MS,
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
const providerName = providerConfig.name.trim().length > 0 ? providerConfig.name : args.provider;
|
|
24
|
+
const summaryTextI18n = {
|
|
25
|
+
zh: `${providerName} 在同一对话上下文中连续返回 empty response。` +
|
|
26
|
+
`Dominds 已在 ${String(XCODE_BEST_EMPTY_RESPONSE_GIVE_UP_THRESHOLD)} 次 empty response 后停止继续重试,因为这通常表示 provider 侧该对话上下文已经卡住;` +
|
|
27
|
+
'继续调整常规重试策略也无助于恢复。请新开对话继续。',
|
|
28
|
+
en: `${providerName} returned empty responses repeatedly for the same dialog context. ` +
|
|
29
|
+
`Dominds stopped retrying after ${String(XCODE_BEST_EMPTY_RESPONSE_GIVE_UP_THRESHOLD)} empty responses because this usually means the provider-side conversation ` +
|
|
30
|
+
'context is stuck; adjusting the normal retry policies will not recover it. ' +
|
|
31
|
+
'Start a new dialog to continue.',
|
|
32
|
+
};
|
|
33
|
+
return {
|
|
34
|
+
kind: 'give_up',
|
|
35
|
+
message: `${providerName} returned empty responses repeatedly for the same dialog context; ` +
|
|
36
|
+
'automatic retries will not help until a new dialog is started.',
|
|
37
|
+
summaryTextI18n,
|
|
38
|
+
};
|
|
39
|
+
},
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
const FAILURE_QUIRK_HANDLER_FACTORIES = {
|
|
43
|
+
'xcode.best': createXcodeBestFailureQuirkHandlerSession,
|
|
44
|
+
};
|
|
45
|
+
function normalizeProviderApiQuirks(providerConfig) {
|
|
46
|
+
const raw = providerConfig.apiQuirks;
|
|
47
|
+
if (typeof raw === 'string') {
|
|
48
|
+
return raw.trim().length > 0 ? new Set([raw.trim()]) : new Set();
|
|
49
|
+
}
|
|
50
|
+
if (Array.isArray(raw)) {
|
|
51
|
+
return new Set(raw.flatMap((entry) => {
|
|
52
|
+
if (typeof entry !== 'string')
|
|
53
|
+
return [];
|
|
54
|
+
const trimmed = entry.trim();
|
|
55
|
+
return trimmed === '' ? [] : [trimmed];
|
|
56
|
+
}));
|
|
57
|
+
}
|
|
58
|
+
return new Set();
|
|
59
|
+
}
|
|
60
|
+
function createLlmFailureQuirkHandlerSession(providerConfig) {
|
|
61
|
+
const sessions = [];
|
|
62
|
+
for (const quirk of normalizeProviderApiQuirks(providerConfig)) {
|
|
63
|
+
const factory = FAILURE_QUIRK_HANDLER_FACTORIES[quirk];
|
|
64
|
+
if (!factory)
|
|
65
|
+
continue;
|
|
66
|
+
sessions.push(factory(providerConfig));
|
|
67
|
+
}
|
|
68
|
+
if (sessions.length === 0) {
|
|
69
|
+
return undefined;
|
|
70
|
+
}
|
|
71
|
+
return {
|
|
72
|
+
onFailure(args) {
|
|
73
|
+
for (const session of sessions) {
|
|
74
|
+
const handling = session.onFailure(args);
|
|
75
|
+
if (handling.kind !== 'default') {
|
|
76
|
+
return handling;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
return { kind: 'default' };
|
|
80
|
+
},
|
|
81
|
+
};
|
|
82
|
+
}
|
package/dist/llm/defaults.yaml
CHANGED
|
@@ -5,7 +5,9 @@
|
|
|
5
5
|
# - llm_retry_backoff_multiplier: exponential factor between retries (default 1.5).
|
|
6
6
|
# - llm_retry_max_delay_ms: upper bound for retry delay (default 1800000 / 30m).
|
|
7
7
|
# - apiQuirks: optional provider/gateway quirk profile(s) for non-standard transport behavior
|
|
8
|
-
# and
|
|
8
|
+
# and provider-specific failure handling that can override the driver's default retry disposition.
|
|
9
|
+
# Example: `apiQuirks: xcode.best` currently covers both keepalive/heartbeat stream quirks and
|
|
10
|
+
# repeated empty-response handling for the same dialog context.
|
|
9
11
|
# - tool_result_max_chars: optional transport-level cap for a single tool-result text payload
|
|
10
12
|
# before Dominds projects it into the provider request. Use this when a provider/gateway enforces
|
|
11
13
|
# a stricter per-item string limit than Dominds' built-in defaults.
|
|
@@ -1,3 +1,10 @@
|
|
|
1
1
|
import type { LlmFailureDisposition } from '../gen';
|
|
2
|
+
export declare function readErrorStatus(error: unknown): number | undefined;
|
|
3
|
+
export declare function readErrorCode(error: unknown): string | undefined;
|
|
4
|
+
export declare function readErrorMessage(error: unknown): string | undefined;
|
|
5
|
+
export declare function readProviderSuggestedRetryAfterMs(error: unknown): number | undefined;
|
|
6
|
+
export declare function isConservativeRetryMessage(lowerMessage: string): boolean;
|
|
7
|
+
export declare function isOpenAiLikeOverloadFailure(error: unknown): boolean;
|
|
8
|
+
export declare function isOpenAiLikeRateLimitFailure(error: unknown): boolean;
|
|
2
9
|
export declare function classifyOpenAiLikeFailure(error: unknown): LlmFailureDisposition | undefined;
|
|
3
10
|
export declare function classifyAnthropicFailure(error: unknown): LlmFailureDisposition | undefined;
|
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.readErrorStatus = readErrorStatus;
|
|
4
|
+
exports.readErrorCode = readErrorCode;
|
|
5
|
+
exports.readErrorMessage = readErrorMessage;
|
|
6
|
+
exports.readProviderSuggestedRetryAfterMs = readProviderSuggestedRetryAfterMs;
|
|
7
|
+
exports.isConservativeRetryMessage = isConservativeRetryMessage;
|
|
8
|
+
exports.isOpenAiLikeOverloadFailure = isOpenAiLikeOverloadFailure;
|
|
9
|
+
exports.isOpenAiLikeRateLimitFailure = isOpenAiLikeRateLimitFailure;
|
|
3
10
|
exports.classifyOpenAiLikeFailure = classifyOpenAiLikeFailure;
|
|
4
11
|
exports.classifyAnthropicFailure = classifyAnthropicFailure;
|
|
5
12
|
function isPlainObject(value) {
|
|
@@ -11,6 +18,12 @@ function readNestedError(error) {
|
|
|
11
18
|
}
|
|
12
19
|
return error.error;
|
|
13
20
|
}
|
|
21
|
+
function readNestedResponse(error) {
|
|
22
|
+
if (!isPlainObject(error) || !('response' in error) || !isPlainObject(error.response)) {
|
|
23
|
+
return undefined;
|
|
24
|
+
}
|
|
25
|
+
return error.response;
|
|
26
|
+
}
|
|
14
27
|
function readErrorStatus(error) {
|
|
15
28
|
if (isPlainObject(error)) {
|
|
16
29
|
if ('status' in error && typeof error.status === 'number') {
|
|
@@ -79,6 +92,96 @@ function readErrorMessage(error) {
|
|
|
79
92
|
}
|
|
80
93
|
return undefined;
|
|
81
94
|
}
|
|
95
|
+
function readErrorHeaders(error) {
|
|
96
|
+
if (isPlainObject(error) && 'headers' in error && isPlainObject(error.headers)) {
|
|
97
|
+
return error.headers;
|
|
98
|
+
}
|
|
99
|
+
const nested = readNestedError(error);
|
|
100
|
+
if (nested && 'headers' in nested && isPlainObject(nested.headers)) {
|
|
101
|
+
return nested.headers;
|
|
102
|
+
}
|
|
103
|
+
const response = readNestedResponse(error);
|
|
104
|
+
if (response && 'headers' in response && isPlainObject(response.headers)) {
|
|
105
|
+
return response.headers;
|
|
106
|
+
}
|
|
107
|
+
return undefined;
|
|
108
|
+
}
|
|
109
|
+
function readHeaderValue(headers, headerName) {
|
|
110
|
+
const target = headerName.toLowerCase();
|
|
111
|
+
for (const [key, value] of Object.entries(headers)) {
|
|
112
|
+
if (key.toLowerCase() === target) {
|
|
113
|
+
return value;
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
return undefined;
|
|
117
|
+
}
|
|
118
|
+
function parseRetryAfterHeaderMs(value) {
|
|
119
|
+
if (typeof value === 'number' && Number.isFinite(value)) {
|
|
120
|
+
return Math.max(0, Math.floor(value * 1000));
|
|
121
|
+
}
|
|
122
|
+
if (typeof value !== 'string')
|
|
123
|
+
return undefined;
|
|
124
|
+
const trimmed = value.trim();
|
|
125
|
+
if (trimmed === '')
|
|
126
|
+
return undefined;
|
|
127
|
+
const numeric = Number(trimmed);
|
|
128
|
+
if (Number.isFinite(numeric)) {
|
|
129
|
+
return Math.max(0, Math.floor(numeric * 1000));
|
|
130
|
+
}
|
|
131
|
+
const parsedDateMs = Date.parse(trimmed);
|
|
132
|
+
if (!Number.isFinite(parsedDateMs))
|
|
133
|
+
return undefined;
|
|
134
|
+
return Math.max(0, parsedDateMs - Date.now());
|
|
135
|
+
}
|
|
136
|
+
function parseDelayFieldMs(value, unit) {
|
|
137
|
+
if (typeof value === 'number' && Number.isFinite(value)) {
|
|
138
|
+
const ms = unit === 'seconds' ? value * 1000 : value;
|
|
139
|
+
return Math.max(0, Math.floor(ms));
|
|
140
|
+
}
|
|
141
|
+
if (typeof value !== 'string')
|
|
142
|
+
return undefined;
|
|
143
|
+
const numeric = Number(value.trim());
|
|
144
|
+
if (!Number.isFinite(numeric))
|
|
145
|
+
return undefined;
|
|
146
|
+
const ms = unit === 'seconds' ? numeric * 1000 : numeric;
|
|
147
|
+
return Math.max(0, Math.floor(ms));
|
|
148
|
+
}
|
|
149
|
+
function readProviderSuggestedRetryAfterMs(error) {
|
|
150
|
+
const headers = readErrorHeaders(error);
|
|
151
|
+
if (headers) {
|
|
152
|
+
const retryAfter = parseRetryAfterHeaderMs(readHeaderValue(headers, 'retry-after'));
|
|
153
|
+
if (retryAfter !== undefined)
|
|
154
|
+
return retryAfter;
|
|
155
|
+
const resetAfter = parseDelayFieldMs(readHeaderValue(headers, 'x-ratelimit-reset-after'), 'seconds') ??
|
|
156
|
+
parseDelayFieldMs(readHeaderValue(headers, 'ratelimit-reset-after'), 'seconds');
|
|
157
|
+
if (resetAfter !== undefined)
|
|
158
|
+
return resetAfter;
|
|
159
|
+
}
|
|
160
|
+
const roots = [];
|
|
161
|
+
if (isPlainObject(error))
|
|
162
|
+
roots.push(error);
|
|
163
|
+
const nested = readNestedError(error);
|
|
164
|
+
if (nested)
|
|
165
|
+
roots.push(nested);
|
|
166
|
+
const response = readNestedResponse(error);
|
|
167
|
+
if (response)
|
|
168
|
+
roots.push(response);
|
|
169
|
+
for (const root of roots) {
|
|
170
|
+
const retryAfterMs = parseDelayFieldMs(root.retryAfterMs, 'milliseconds') ??
|
|
171
|
+
parseDelayFieldMs(root.retry_after_ms, 'milliseconds') ??
|
|
172
|
+
parseDelayFieldMs(root.resetAfterMs, 'milliseconds') ??
|
|
173
|
+
parseDelayFieldMs(root.reset_after_ms, 'milliseconds');
|
|
174
|
+
if (retryAfterMs !== undefined)
|
|
175
|
+
return retryAfterMs;
|
|
176
|
+
const retryAfterSeconds = parseDelayFieldMs(root.retryAfter, 'seconds') ??
|
|
177
|
+
parseDelayFieldMs(root.retry_after, 'seconds') ??
|
|
178
|
+
parseDelayFieldMs(root.resetAfter, 'seconds') ??
|
|
179
|
+
parseDelayFieldMs(root.reset_after, 'seconds');
|
|
180
|
+
if (retryAfterSeconds !== undefined)
|
|
181
|
+
return retryAfterSeconds;
|
|
182
|
+
}
|
|
183
|
+
return undefined;
|
|
184
|
+
}
|
|
82
185
|
function buildFailureMessage(error) {
|
|
83
186
|
return readErrorMessage(error) ?? 'Unknown LLM provider error.';
|
|
84
187
|
}
|
|
@@ -110,6 +213,29 @@ function isConservativeRetryMessage(lowerMessage) {
|
|
|
110
213
|
}
|
|
111
214
|
return lowerMessage.includes('overloaded') && lowerMessage.includes('try again later');
|
|
112
215
|
}
|
|
216
|
+
function isOpenAiLikeOverloadFailure(error) {
|
|
217
|
+
const lowerMessage = buildFailureMessage(error).toLowerCase();
|
|
218
|
+
const status = readErrorStatus(error);
|
|
219
|
+
return status === 503 || status === 529 || isConservativeRetryMessage(lowerMessage);
|
|
220
|
+
}
|
|
221
|
+
function isOpenAiLikeRateLimitFailure(error) {
|
|
222
|
+
const lowerMessage = buildFailureMessage(error).toLowerCase();
|
|
223
|
+
const status = readErrorStatus(error);
|
|
224
|
+
const code = readErrorCode(error)?.toLowerCase();
|
|
225
|
+
if (status === 429) {
|
|
226
|
+
return true;
|
|
227
|
+
}
|
|
228
|
+
if (typeof code === 'string' && code.includes('rate_limit')) {
|
|
229
|
+
return true;
|
|
230
|
+
}
|
|
231
|
+
if (lowerMessage.includes('rate limit')) {
|
|
232
|
+
return true;
|
|
233
|
+
}
|
|
234
|
+
if (lowerMessage.includes('requests per min')) {
|
|
235
|
+
return true;
|
|
236
|
+
}
|
|
237
|
+
return lowerMessage.includes('rpm') && lowerMessage.includes('limit');
|
|
238
|
+
}
|
|
113
239
|
function classifyOpenAiLikeFailure(error) {
|
|
114
240
|
const message = buildFailureMessage(error);
|
|
115
241
|
const lowerMessage = message.toLowerCase();
|
|
@@ -132,7 +258,7 @@ function classifyOpenAiLikeFailure(error) {
|
|
|
132
258
|
retryStrategy: 'aggressive',
|
|
133
259
|
};
|
|
134
260
|
}
|
|
135
|
-
if (
|
|
261
|
+
if (isOpenAiLikeOverloadFailure(error)) {
|
|
136
262
|
return {
|
|
137
263
|
kind: 'retriable',
|
|
138
264
|
message,
|
|
@@ -141,6 +267,16 @@ function classifyOpenAiLikeFailure(error) {
|
|
|
141
267
|
retryStrategy: 'conservative',
|
|
142
268
|
};
|
|
143
269
|
}
|
|
270
|
+
if (isOpenAiLikeRateLimitFailure(error)) {
|
|
271
|
+
return {
|
|
272
|
+
kind: 'retriable',
|
|
273
|
+
message,
|
|
274
|
+
status,
|
|
275
|
+
code,
|
|
276
|
+
retryStrategy: 'smart_rate',
|
|
277
|
+
retryAfterMs: readProviderSuggestedRetryAfterMs(error),
|
|
278
|
+
};
|
|
279
|
+
}
|
|
144
280
|
if (isOpenAiRetriableProcessingFailureMessage(lowerMessage)) {
|
|
145
281
|
return {
|
|
146
282
|
kind: 'retriable',
|
package/dist/llm/gen/openai.js
CHANGED
|
@@ -16,6 +16,7 @@ const openai_1 = __importDefault(require("openai"));
|
|
|
16
16
|
const log_1 = require("../../log");
|
|
17
17
|
const i18n_text_1 = require("../../runtime/i18n-text");
|
|
18
18
|
const work_language_1 = require("../../runtime/work-language");
|
|
19
|
+
const api_quirks_1 = require("../api-quirks");
|
|
19
20
|
const artifacts_1 = require("./artifacts");
|
|
20
21
|
const failure_classifier_1 = require("./failure-classifier");
|
|
21
22
|
const tool_call_context_1 = require("./tool-call-context");
|
|
@@ -86,19 +87,9 @@ function readEventType(value) {
|
|
|
86
87
|
}
|
|
87
88
|
return value.type;
|
|
88
89
|
}
|
|
89
|
-
function normalizeProviderApiQuirks(providerConfig) {
|
|
90
|
-
const raw = providerConfig.apiQuirks;
|
|
91
|
-
if (typeof raw === 'string') {
|
|
92
|
-
return raw.trim().length > 0 ? new Set([raw.trim()]) : new Set();
|
|
93
|
-
}
|
|
94
|
-
if (Array.isArray(raw)) {
|
|
95
|
-
return new Set(raw.filter((entry) => typeof entry === 'string' && entry.trim() !== ''));
|
|
96
|
-
}
|
|
97
|
-
return new Set();
|
|
98
|
-
}
|
|
99
90
|
function resolveOpenAiVendorHeartbeatEventTypes(providerConfig) {
|
|
100
91
|
const eventTypes = new Set();
|
|
101
|
-
for (const quirk of normalizeProviderApiQuirks(providerConfig)) {
|
|
92
|
+
for (const quirk of (0, api_quirks_1.normalizeProviderApiQuirks)(providerConfig)) {
|
|
102
93
|
const vendorEventTypes = OPENAI_API_QUIRK_VENDOR_HEARTBEAT_EVENT_TYPES[quirk];
|
|
103
94
|
if (!vendorEventTypes)
|
|
104
95
|
continue;
|
|
@@ -109,7 +100,7 @@ function resolveOpenAiVendorHeartbeatEventTypes(providerConfig) {
|
|
|
109
100
|
return eventTypes;
|
|
110
101
|
}
|
|
111
102
|
function maybeAnnotateOpenAiQuirkFailure(providerConfig, error) {
|
|
112
|
-
const quirks = normalizeProviderApiQuirks(providerConfig);
|
|
103
|
+
const quirks = (0, api_quirks_1.normalizeProviderApiQuirks)(providerConfig);
|
|
113
104
|
const message = error instanceof Error
|
|
114
105
|
? error.message
|
|
115
106
|
: typeof error === 'string'
|
package/dist/llm/gen.d.ts
CHANGED
|
@@ -23,13 +23,14 @@ export interface LlmBatchResult {
|
|
|
23
23
|
usage: LlmUsageStats;
|
|
24
24
|
llmGenModel?: string;
|
|
25
25
|
}
|
|
26
|
-
export type LlmRetryStrategy = 'aggressive' | 'conservative';
|
|
26
|
+
export type LlmRetryStrategy = 'aggressive' | 'conservative' | 'smart_rate';
|
|
27
27
|
export type LlmFailureDisposition = {
|
|
28
28
|
kind: 'retriable' | 'rejected' | 'fatal';
|
|
29
29
|
message: string;
|
|
30
30
|
status?: number;
|
|
31
31
|
code?: string;
|
|
32
32
|
retryStrategy?: LlmRetryStrategy;
|
|
33
|
+
retryAfterMs?: number;
|
|
33
34
|
};
|
|
34
35
|
export type LlmFailureClassifier = (error: unknown) => LlmFailureDisposition | undefined;
|
|
35
36
|
export interface LlmRequestContext {
|