takt 0.49.0 → 0.51.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +31 -0
- package/builtins/en/config.yaml +6 -0
- package/builtins/en/facets/instructions/ai-antipattern-review.md +5 -0
- package/builtins/en/facets/instructions/findings-manager.md +6 -2
- package/builtins/en/facets/instructions/fix.md +9 -3
- package/builtins/en/facets/instructions/loop-monitor-fix-replan.md +21 -0
- package/builtins/en/facets/instructions/loop-monitor-replan.md +10 -0
- package/builtins/en/facets/instructions/loop-monitor-reviewers-fix.md +6 -0
- package/builtins/en/facets/instructions/plan-maintenance.md +10 -7
- package/builtins/en/facets/instructions/plan.md +17 -8
- package/builtins/en/facets/instructions/review-arch.md +5 -0
- package/builtins/en/facets/instructions/review-coding.md +15 -6
- package/builtins/en/facets/instructions/review-cqrs-es.md +9 -0
- package/builtins/en/facets/instructions/review-implementation-semantics.md +18 -0
- package/builtins/en/facets/instructions/review-merge-readiness.md +14 -0
- package/builtins/en/facets/instructions/supervise-maintenance.md +2 -2
- package/builtins/en/facets/instructions/supervise.md +8 -3
- package/builtins/en/facets/instructions/write-tests-first.md +23 -3
- package/builtins/en/facets/knowledge/architecture.md +36 -0
- package/builtins/en/facets/knowledge/backend.md +74 -0
- package/builtins/en/facets/knowledge/cqrs-es.md +767 -235
- package/builtins/en/facets/knowledge/frontend.md +5 -1
- package/builtins/en/facets/knowledge/implementation-semantics.md +104 -0
- package/builtins/en/facets/knowledge/security.md +3 -0
- package/builtins/en/facets/knowledge/takt.md +10 -2
- package/builtins/en/facets/knowledge/unit-testing.md +14 -0
- package/builtins/en/facets/output-contracts/ai-antipattern-review.md +11 -1
- package/builtins/en/facets/output-contracts/architecture-review.md +6 -1
- package/builtins/en/facets/output-contracts/coding-review.md +11 -1
- package/builtins/en/facets/output-contracts/findings-manager.md +14 -0
- package/builtins/en/facets/output-contracts/implementation-semantics-review-finding-contract.md +28 -0
- package/builtins/en/facets/output-contracts/implementation-semantics-review.md +50 -0
- package/builtins/en/facets/output-contracts/{pure-review-finding-contract.md → merge-readiness-review-finding-contract.md} +14 -8
- package/builtins/en/facets/output-contracts/{pure-review.md → merge-readiness-review.md} +17 -11
- package/builtins/en/facets/output-contracts/supervisor-validation.md +6 -2
- package/builtins/en/facets/output-contracts/test-report.md +25 -0
- package/builtins/en/facets/personas/coder.md +3 -3
- package/builtins/en/facets/personas/implementation-semantics-reviewer.md +27 -0
- package/builtins/en/facets/personas/merge-readiness-reviewer.md +28 -0
- package/builtins/en/facets/personas/supervisor.md +1 -1
- package/builtins/en/facets/policies/ai-antipattern.md +19 -0
- package/builtins/en/facets/policies/coding.md +31 -4
- package/builtins/en/facets/policies/review.md +17 -1
- package/builtins/en/facets/policies/testing.md +6 -2
- package/builtins/en/workflow-categories.yaml +13 -1
- package/builtins/en/workflows/audit-architecture-backend.yaml +1 -0
- package/builtins/en/workflows/audit-architecture-dual.yaml +1 -0
- package/builtins/en/workflows/audit-architecture-frontend.yaml +1 -0
- package/builtins/en/workflows/audit-architecture.yaml +1 -0
- package/builtins/en/workflows/audit-e2e.yaml +1 -0
- package/builtins/en/workflows/audit-security.yaml +1 -0
- package/builtins/en/workflows/audit-unit.yaml +1 -0
- package/builtins/en/workflows/backend-cqrs-for-local-llm.yaml +288 -0
- package/builtins/en/workflows/backend-cqrs-mini.yaml +1 -0
- package/builtins/en/workflows/backend-cqrs.yaml +28 -84
- package/builtins/en/workflows/backend-for-local-llm.yaml +284 -0
- package/builtins/en/workflows/backend-maintenance.yaml +32 -89
- package/builtins/en/workflows/backend-mini.yaml +1 -0
- package/builtins/en/workflows/backend.yaml +25 -83
- package/builtins/en/workflows/{takt-default-with-fc.yaml → cli.yaml} +16 -4
- package/builtins/en/workflows/deep-research.yaml +1 -0
- package/builtins/en/workflows/default-high.yaml +3 -32
- package/builtins/en/workflows/default-peer-review.yaml +16 -52
- package/builtins/en/workflows/default.yaml +2 -1
- package/builtins/en/workflows/draft.yaml +0 -1
- package/builtins/en/workflows/dual-cqrs-mini.yaml +1 -0
- package/builtins/en/workflows/dual-cqrs.yaml +28 -87
- package/builtins/en/workflows/dual-for-local-llm.yaml +312 -0
- package/builtins/en/workflows/dual-mini.yaml +1 -0
- package/builtins/en/workflows/dual.yaml +29 -58
- package/builtins/en/workflows/frontend-for-local-llm.yaml +289 -0
- package/builtins/en/workflows/frontend-maintenance.yaml +34 -91
- package/builtins/en/workflows/frontend-mini.yaml +1 -0
- package/builtins/en/workflows/frontend.yaml +27 -85
- package/builtins/en/workflows/merge-readiness-dual-final-gate.yaml +92 -0
- package/builtins/en/workflows/merge-readiness-final-gate.yaml +79 -0
- package/builtins/en/workflows/{peer-review-with-fc.yaml → peer-review-for-local-llm.yaml} +48 -37
- package/builtins/en/workflows/peer-review.yaml +25 -20
- package/builtins/en/workflows/research.yaml +1 -0
- package/builtins/en/workflows/review-backend-cqrs.yaml +63 -35
- package/builtins/en/workflows/review-backend.yaml +63 -35
- package/builtins/en/workflows/review-default.yaml +138 -107
- package/builtins/en/workflows/review-dual-cqrs.yaml +63 -35
- package/builtins/en/workflows/review-dual.yaml +63 -35
- package/builtins/en/workflows/review-fix-backend-cqrs.yaml +27 -87
- package/builtins/en/workflows/review-fix-backend.yaml +25 -86
- package/builtins/en/workflows/review-fix-default.yaml +17 -87
- package/builtins/en/workflows/review-fix-dual-cqrs.yaml +29 -90
- package/builtins/en/workflows/review-fix-dual.yaml +27 -89
- package/builtins/en/workflows/review-fix-frontend.yaml +25 -87
- package/builtins/en/workflows/review-fix-takt-default.yaml +67 -362
- package/builtins/en/workflows/review-frontend.yaml +63 -35
- package/builtins/en/workflows/review-takt-default.yaml +140 -109
- package/builtins/en/workflows/takt-default-for-local-llm.yaml +283 -0
- package/builtins/en/workflows/takt-default-refresh-all.yaml +20 -59
- package/builtins/en/workflows/takt-default-refresh-fast.yaml +19 -57
- package/builtins/en/workflows/takt-default.yaml +3 -25
- package/builtins/en/workflows/terraform.yaml +81 -44
- package/builtins/ja/config.yaml +6 -0
- package/builtins/ja/facets/instructions/ai-antipattern-review.md +5 -0
- package/builtins/ja/facets/instructions/findings-manager.md +6 -2
- package/builtins/ja/facets/instructions/fix.md +9 -3
- package/builtins/ja/facets/instructions/implement-maintenance.md +4 -15
- package/builtins/ja/facets/instructions/implement.md +2 -14
- package/builtins/ja/facets/instructions/loop-monitor-fix-replan.md +21 -0
- package/builtins/ja/facets/instructions/loop-monitor-replan.md +10 -0
- package/builtins/ja/facets/instructions/loop-monitor-reviewers-fix.md +7 -0
- package/builtins/ja/facets/instructions/plan-maintenance.md +10 -7
- package/builtins/ja/facets/instructions/plan.md +9 -6
- package/builtins/ja/facets/instructions/review-arch.md +5 -0
- package/builtins/ja/facets/instructions/review-coding.md +15 -6
- package/builtins/ja/facets/instructions/review-cqrs-es.md +9 -0
- package/builtins/ja/facets/instructions/review-implementation-semantics.md +17 -0
- package/builtins/ja/facets/instructions/review-merge-readiness.md +14 -0
- package/builtins/ja/facets/instructions/supervise-maintenance.md +2 -2
- package/builtins/ja/facets/instructions/supervise.md +8 -3
- package/builtins/ja/facets/instructions/write-tests-first.md +23 -3
- package/builtins/ja/facets/knowledge/architecture.md +36 -0
- package/builtins/ja/facets/knowledge/backend.md +74 -0
- package/builtins/ja/facets/knowledge/cqrs-es.md +260 -16
- package/builtins/ja/facets/knowledge/frontend.md +5 -1
- package/builtins/ja/facets/knowledge/implementation-semantics.md +104 -0
- package/builtins/ja/facets/knowledge/security.md +3 -0
- package/builtins/ja/facets/knowledge/takt.md +10 -2
- package/builtins/ja/facets/knowledge/unit-testing.md +14 -0
- package/builtins/ja/facets/output-contracts/ai-antipattern-review.md +11 -1
- package/builtins/ja/facets/output-contracts/architecture-review.md +6 -1
- package/builtins/ja/facets/output-contracts/coding-review.md +11 -1
- package/builtins/ja/facets/output-contracts/findings-manager.md +14 -0
- package/builtins/ja/facets/output-contracts/implementation-semantics-review-finding-contract.md +24 -0
- package/builtins/ja/facets/output-contracts/implementation-semantics-review.md +50 -0
- package/builtins/ja/facets/output-contracts/{pure-review-finding-contract.md → merge-readiness-review-finding-contract.md} +14 -8
- package/builtins/ja/facets/output-contracts/{pure-review.md → merge-readiness-review.md} +17 -11
- package/builtins/ja/facets/output-contracts/supervisor-validation.md +6 -2
- package/builtins/ja/facets/output-contracts/test-report.md +25 -0
- package/builtins/ja/facets/partials/instructions/implement-common.md +13 -0
- package/builtins/ja/facets/personas/coder.md +3 -3
- package/builtins/ja/facets/personas/implementation-semantics-reviewer.md +27 -0
- package/builtins/ja/facets/personas/merge-readiness-reviewer.md +28 -0
- package/builtins/ja/facets/personas/supervisor.md +1 -1
- package/builtins/ja/facets/policies/ai-antipattern.md +19 -0
- package/builtins/ja/facets/policies/coding.md +32 -4
- package/builtins/ja/facets/policies/review.md +17 -1
- package/builtins/ja/facets/policies/testing.md +11 -4
- package/builtins/ja/workflow-categories.yaml +13 -1
- package/builtins/ja/workflows/audit-architecture-backend.yaml +1 -0
- package/builtins/ja/workflows/audit-architecture-dual.yaml +1 -0
- package/builtins/ja/workflows/audit-architecture-frontend.yaml +1 -0
- package/builtins/ja/workflows/audit-architecture.yaml +1 -0
- package/builtins/ja/workflows/audit-e2e.yaml +1 -0
- package/builtins/ja/workflows/audit-security.yaml +1 -0
- package/builtins/ja/workflows/audit-unit.yaml +1 -0
- package/builtins/ja/workflows/backend-cqrs-for-local-llm.yaml +287 -0
- package/builtins/ja/workflows/backend-cqrs-mini.yaml +1 -0
- package/builtins/ja/workflows/backend-cqrs.yaml +28 -84
- package/builtins/ja/workflows/backend-for-local-llm.yaml +283 -0
- package/builtins/ja/workflows/backend-maintenance.yaml +32 -89
- package/builtins/ja/workflows/backend-mini.yaml +1 -0
- package/builtins/ja/workflows/backend.yaml +25 -83
- package/builtins/ja/workflows/{takt-default-with-fc.yaml → cli.yaml} +16 -4
- package/builtins/ja/workflows/deep-research.yaml +1 -0
- package/builtins/ja/workflows/default-high.yaml +3 -32
- package/builtins/ja/workflows/default-peer-review.yaml +16 -52
- package/builtins/ja/workflows/default.yaml +2 -1
- package/builtins/ja/workflows/draft.yaml +0 -1
- package/builtins/ja/workflows/dual-cqrs-mini.yaml +1 -0
- package/builtins/ja/workflows/dual-cqrs.yaml +28 -87
- package/builtins/ja/workflows/dual-for-local-llm.yaml +311 -0
- package/builtins/ja/workflows/dual-mini.yaml +1 -0
- package/builtins/ja/workflows/dual.yaml +29 -58
- package/builtins/ja/workflows/frontend-for-local-llm.yaml +288 -0
- package/builtins/ja/workflows/frontend-maintenance.yaml +34 -91
- package/builtins/ja/workflows/frontend-mini.yaml +1 -0
- package/builtins/ja/workflows/frontend.yaml +27 -85
- package/builtins/ja/workflows/merge-readiness-dual-final-gate.yaml +92 -0
- package/builtins/ja/workflows/merge-readiness-final-gate.yaml +79 -0
- package/builtins/ja/workflows/{peer-review-with-fc.yaml → peer-review-for-local-llm.yaml} +48 -37
- package/builtins/ja/workflows/peer-review.yaml +25 -20
- package/builtins/ja/workflows/research.yaml +1 -0
- package/builtins/ja/workflows/review-backend-cqrs.yaml +63 -35
- package/builtins/ja/workflows/review-backend.yaml +63 -35
- package/builtins/ja/workflows/review-default.yaml +111 -79
- package/builtins/ja/workflows/review-dual-cqrs.yaml +63 -35
- package/builtins/ja/workflows/review-dual.yaml +63 -35
- package/builtins/ja/workflows/review-fix-backend-cqrs.yaml +27 -87
- package/builtins/ja/workflows/review-fix-backend.yaml +25 -86
- package/builtins/ja/workflows/review-fix-default.yaml +17 -87
- package/builtins/ja/workflows/review-fix-dual-cqrs.yaml +29 -90
- package/builtins/ja/workflows/review-fix-dual.yaml +27 -89
- package/builtins/ja/workflows/review-fix-frontend.yaml +25 -87
- package/builtins/ja/workflows/review-fix-takt-default.yaml +67 -362
- package/builtins/ja/workflows/review-frontend.yaml +63 -35
- package/builtins/ja/workflows/review-takt-default.yaml +112 -80
- package/builtins/ja/workflows/takt-default-for-local-llm.yaml +282 -0
- package/builtins/ja/workflows/takt-default-refresh-all.yaml +20 -59
- package/builtins/ja/workflows/takt-default-refresh-fast.yaml +19 -57
- package/builtins/ja/workflows/takt-default.yaml +3 -25
- package/builtins/ja/workflows/terraform.yaml +81 -44
- package/builtins/skill/references/yaml-schema.md +21 -1
- package/builtins/skill-codex/references/yaml-schema.md +21 -1
- package/dist/agents/agent-usecases.d.ts +1 -0
- package/dist/agents/agent-usecases.d.ts.map +1 -1
- package/dist/agents/agent-usecases.js +1 -0
- package/dist/agents/agent-usecases.js.map +1 -1
- package/dist/agents/auto-routing-usecase.d.ts +23 -0
- package/dist/agents/auto-routing-usecase.d.ts.map +1 -0
- package/dist/agents/auto-routing-usecase.js +216 -0
- package/dist/agents/auto-routing-usecase.js.map +1 -0
- package/dist/agents/decompose-task-usecase.d.ts +1 -0
- package/dist/agents/decompose-task-usecase.d.ts.map +1 -1
- package/dist/agents/decompose-task-usecase.js +2 -0
- package/dist/agents/decompose-task-usecase.js.map +1 -1
- package/dist/agents/judge-utils.d.ts.map +1 -1
- package/dist/agents/judge-utils.js +4 -3
- package/dist/agents/judge-utils.js.map +1 -1
- package/dist/agents/runner.d.ts.map +1 -1
- package/dist/agents/runner.js +2 -3
- package/dist/agents/runner.js.map +1 -1
- package/dist/agents/structured-caller/prompt-based-structured-caller.d.ts.map +1 -1
- package/dist/agents/structured-caller/prompt-based-structured-caller.js +2 -0
- package/dist/agents/structured-caller/prompt-based-structured-caller.js.map +1 -1
- package/dist/agents/structured-caller/shared.js +1 -1
- package/dist/agents/structured-caller/shared.js.map +1 -1
- package/dist/app/acp/agent.d.ts +28 -0
- package/dist/app/acp/agent.d.ts.map +1 -0
- package/dist/app/acp/agent.js +279 -0
- package/dist/app/acp/agent.js.map +1 -0
- package/dist/app/acp/confirmationBridge.d.ts +5 -0
- package/dist/app/acp/confirmationBridge.d.ts.map +1 -0
- package/dist/app/acp/confirmationBridge.js +194 -0
- package/dist/app/acp/confirmationBridge.js.map +1 -0
- package/dist/app/acp/conversationFactory.d.ts +4 -0
- package/dist/app/acp/conversationFactory.d.ts.map +1 -0
- package/dist/app/acp/conversationFactory.js +33 -0
- package/dist/app/acp/conversationFactory.js.map +1 -0
- package/dist/app/acp/enqueue.d.ts +33 -0
- package/dist/app/acp/enqueue.d.ts.map +1 -0
- package/dist/app/acp/enqueue.js +45 -0
- package/dist/app/acp/enqueue.js.map +1 -0
- package/dist/app/acp/index.d.ts +7 -0
- package/dist/app/acp/index.d.ts.map +1 -0
- package/dist/app/acp/index.js +125 -0
- package/dist/app/acp/index.js.map +1 -0
- package/dist/app/acp/intent.d.ts +10 -0
- package/dist/app/acp/intent.d.ts.map +1 -0
- package/dist/app/acp/intent.js +210 -0
- package/dist/app/acp/intent.js.map +1 -0
- package/dist/app/acp/mcpServers.d.ts +4 -0
- package/dist/app/acp/mcpServers.d.ts.map +1 -0
- package/dist/app/acp/mcpServers.js +51 -0
- package/dist/app/acp/mcpServers.js.map +1 -0
- package/dist/app/acp/promptContent.d.ts +3 -0
- package/dist/app/acp/promptContent.d.ts.map +1 -0
- package/dist/app/acp/promptContent.js +23 -0
- package/dist/app/acp/promptContent.js.map +1 -0
- package/dist/app/acp/sessionStore.d.ts +19 -0
- package/dist/app/acp/sessionStore.d.ts.map +1 -0
- package/dist/app/acp/sessionStore.js +50 -0
- package/dist/app/acp/sessionStore.js.map +1 -0
- package/dist/app/acp/sessionUpdates.d.ts +8 -0
- package/dist/app/acp/sessionUpdates.d.ts.map +1 -0
- package/dist/app/acp/sessionUpdates.js +108 -0
- package/dist/app/acp/sessionUpdates.js.map +1 -0
- package/dist/app/acp/taskContext.d.ts +17 -0
- package/dist/app/acp/taskContext.d.ts.map +1 -0
- package/dist/app/acp/taskContext.js +81 -0
- package/dist/app/acp/taskContext.js.map +1 -0
- package/dist/app/acp/types.d.ts +33 -0
- package/dist/app/acp/types.d.ts.map +1 -0
- package/dist/app/acp/types.js +2 -0
- package/dist/app/acp/types.js.map +1 -0
- package/dist/app/cli/commands.js +28 -1
- package/dist/app/cli/commands.js.map +1 -1
- package/dist/app/cli/helpers.d.ts.map +1 -1
- package/dist/app/cli/helpers.js +13 -1
- package/dist/app/cli/helpers.js.map +1 -1
- package/dist/app/cli/program.d.ts.map +1 -1
- package/dist/app/cli/program.js +6 -5
- package/dist/app/cli/program.js.map +1 -1
- package/dist/app/cli/routing.d.ts.map +1 -1
- package/dist/app/cli/routing.js +56 -47
- package/dist/app/cli/routing.js.map +1 -1
- package/dist/app/mcp/index.d.ts +3 -0
- package/dist/app/mcp/index.d.ts.map +1 -0
- package/dist/app/mcp/index.js +16 -0
- package/dist/app/mcp/index.js.map +1 -0
- package/dist/app/mcp/server.d.ts +2 -0
- package/dist/app/mcp/server.d.ts.map +1 -0
- package/dist/app/mcp/server.js +2 -0
- package/dist/app/mcp/server.js.map +1 -0
- package/dist/core/config/provider-resolution.d.ts +1 -0
- package/dist/core/config/provider-resolution.d.ts.map +1 -1
- package/dist/core/config/provider-resolution.js +19 -0
- package/dist/core/config/provider-resolution.js.map +1 -1
- package/dist/core/logging/providerEvent.d.ts +3 -2
- package/dist/core/logging/providerEvent.d.ts.map +1 -1
- package/dist/core/logging/providerEvent.js.map +1 -1
- package/dist/core/logging/providerEventLogger.d.ts +2 -1
- package/dist/core/logging/providerEventLogger.d.ts.map +1 -1
- package/dist/core/logging/providerEventLogger.js.map +1 -1
- package/dist/core/logging/usageEventLogger.d.ts +2 -1
- package/dist/core/logging/usageEventLogger.d.ts.map +1 -1
- package/dist/core/logging/usageEventLogger.js +3 -0
- package/dist/core/logging/usageEventLogger.js.map +1 -1
- package/dist/core/models/config-schemas.d.ts +301 -97
- package/dist/core/models/config-schemas.d.ts.map +1 -1
- package/dist/core/models/config-schemas.js +8 -5
- package/dist/core/models/config-schemas.js.map +1 -1
- package/dist/core/models/config-types.d.ts +34 -2
- package/dist/core/models/config-types.d.ts.map +1 -1
- package/dist/core/models/finding-schemas.d.ts +167 -24
- package/dist/core/models/finding-schemas.d.ts.map +1 -1
- package/dist/core/models/finding-schemas.js +82 -9
- package/dist/core/models/finding-schemas.js.map +1 -1
- package/dist/core/models/finding-types.d.ts +43 -2
- package/dist/core/models/finding-types.d.ts.map +1 -1
- package/dist/core/models/finding-types.js +3 -2
- package/dist/core/models/finding-types.js.map +1 -1
- package/dist/core/models/index.d.ts +2 -1
- package/dist/core/models/index.d.ts.map +1 -1
- package/dist/core/models/index.js +1 -0
- package/dist/core/models/index.js.map +1 -1
- package/dist/core/models/part.d.ts +1 -0
- package/dist/core/models/part.d.ts.map +1 -1
- package/dist/core/models/schema-base.d.ts +189 -36
- package/dist/core/models/schema-base.d.ts.map +1 -1
- package/dist/core/models/schema-base.js +68 -0
- package/dist/core/models/schema-base.js.map +1 -1
- package/dist/core/models/types.d.ts +3 -2
- package/dist/core/models/types.d.ts.map +1 -1
- package/dist/core/models/types.js +1 -1
- package/dist/core/models/types.js.map +1 -1
- package/dist/core/models/workflow-condition-expression.d.ts +17 -0
- package/dist/core/models/workflow-condition-expression.d.ts.map +1 -1
- package/dist/core/models/workflow-condition-expression.js +85 -2
- package/dist/core/models/workflow-condition-expression.js.map +1 -1
- package/dist/core/models/workflow-provider-options.d.ts +1 -1
- package/dist/core/models/workflow-provider-options.d.ts.map +1 -1
- package/dist/core/models/workflow-schemas.d.ts +1134 -250
- package/dist/core/models/workflow-schemas.d.ts.map +1 -1
- package/dist/core/models/workflow-schemas.js +124 -60
- package/dist/core/models/workflow-schemas.js.map +1 -1
- package/dist/core/models/workflow-session-constraints.d.ts +3 -0
- package/dist/core/models/workflow-session-constraints.d.ts.map +1 -0
- package/dist/core/models/workflow-session-constraints.js +3 -0
- package/dist/core/models/workflow-session-constraints.js.map +1 -0
- package/dist/core/models/workflow-types.d.ts +44 -6
- package/dist/core/models/workflow-types.d.ts.map +1 -1
- package/dist/core/models/workflow-types.js +1 -0
- package/dist/core/models/workflow-types.js.map +1 -1
- package/dist/core/runtime/runtime-environment.d.ts.map +1 -1
- package/dist/core/runtime/runtime-environment.js +19 -0
- package/dist/core/runtime/runtime-environment.js.map +1 -1
- package/dist/core/workflow/auto-routing/resolver.d.ts +43 -0
- package/dist/core/workflow/auto-routing/resolver.d.ts.map +1 -0
- package/dist/core/workflow/auto-routing/resolver.js +218 -0
- package/dist/core/workflow/auto-routing/resolver.js.map +1 -0
- package/dist/core/workflow/auto-routing/workflow-auto-provider.d.ts +16 -0
- package/dist/core/workflow/auto-routing/workflow-auto-provider.d.ts.map +1 -0
- package/dist/core/workflow/auto-routing/workflow-auto-provider.js +64 -0
- package/dist/core/workflow/auto-routing/workflow-auto-provider.js.map +1 -0
- package/dist/core/workflow/engine/LoopMonitorJudgeRunner.d.ts +1 -1
- package/dist/core/workflow/engine/LoopMonitorJudgeRunner.d.ts.map +1 -1
- package/dist/core/workflow/engine/LoopMonitorJudgeRunner.js +15 -1
- package/dist/core/workflow/engine/LoopMonitorJudgeRunner.js.map +1 -1
- package/dist/core/workflow/engine/OptionsBuilder.d.ts +15 -5
- package/dist/core/workflow/engine/OptionsBuilder.d.ts.map +1 -1
- package/dist/core/workflow/engine/OptionsBuilder.js +122 -13
- package/dist/core/workflow/engine/OptionsBuilder.js.map +1 -1
- package/dist/core/workflow/engine/ParallelRunner.d.ts +12 -1
- package/dist/core/workflow/engine/ParallelRunner.d.ts.map +1 -1
- package/dist/core/workflow/engine/ParallelRunner.js +356 -33
- package/dist/core/workflow/engine/ParallelRunner.js.map +1 -1
- package/dist/core/workflow/engine/StepExecutor.d.ts +10 -0
- package/dist/core/workflow/engine/StepExecutor.d.ts.map +1 -1
- package/dist/core/workflow/engine/StepExecutor.js +89 -31
- package/dist/core/workflow/engine/StepExecutor.js.map +1 -1
- package/dist/core/workflow/engine/TeamLeaderRunner.d.ts +10 -2
- package/dist/core/workflow/engine/TeamLeaderRunner.d.ts.map +1 -1
- package/dist/core/workflow/engine/TeamLeaderRunner.js +111 -9
- package/dist/core/workflow/engine/TeamLeaderRunner.js.map +1 -1
- package/dist/core/workflow/engine/WorkflowCallExecutor.d.ts +11 -1
- package/dist/core/workflow/engine/WorkflowCallExecutor.d.ts.map +1 -1
- package/dist/core/workflow/engine/WorkflowCallExecutor.js +43 -7
- package/dist/core/workflow/engine/WorkflowCallExecutor.js.map +1 -1
- package/dist/core/workflow/engine/WorkflowCallRunner.d.ts +9 -0
- package/dist/core/workflow/engine/WorkflowCallRunner.d.ts.map +1 -1
- package/dist/core/workflow/engine/WorkflowCallRunner.js +65 -14
- package/dist/core/workflow/engine/WorkflowCallRunner.js.map +1 -1
- package/dist/core/workflow/engine/WorkflowEngine.d.ts.map +1 -1
- package/dist/core/workflow/engine/WorkflowEngine.js +27 -9
- package/dist/core/workflow/engine/WorkflowEngine.js.map +1 -1
- package/dist/core/workflow/engine/WorkflowEngineSetup.d.ts.map +1 -1
- package/dist/core/workflow/engine/WorkflowEngineSetup.js +29 -20
- package/dist/core/workflow/engine/WorkflowEngineSetup.js.map +1 -1
- package/dist/core/workflow/engine/WorkflowEngineStepCoordinator.d.ts +2 -2
- package/dist/core/workflow/engine/WorkflowEngineStepCoordinator.d.ts.map +1 -1
- package/dist/core/workflow/engine/WorkflowEngineStepCoordinator.js +2 -2
- package/dist/core/workflow/engine/WorkflowEngineStepCoordinator.js.map +1 -1
- package/dist/core/workflow/engine/WorkflowRunLoop.d.ts +1 -1
- package/dist/core/workflow/engine/WorkflowRunLoop.d.ts.map +1 -1
- package/dist/core/workflow/engine/WorkflowRunLoop.js +51 -7
- package/dist/core/workflow/engine/WorkflowRunLoop.js.map +1 -1
- package/dist/core/workflow/engine/WorkflowValidator.d.ts.map +1 -1
- package/dist/core/workflow/engine/WorkflowValidator.js +79 -7
- package/dist/core/workflow/engine/WorkflowValidator.js.map +1 -1
- package/dist/core/workflow/engine/engine-provider-options.d.ts +1 -0
- package/dist/core/workflow/engine/engine-provider-options.d.ts.map +1 -1
- package/dist/core/workflow/engine/engine-provider-options.js +12 -0
- package/dist/core/workflow/engine/engine-provider-options.js.map +1 -1
- package/dist/core/workflow/engine/session-compaction.d.ts +10 -0
- package/dist/core/workflow/engine/session-compaction.d.ts.map +1 -0
- package/dist/core/workflow/engine/session-compaction.js +42 -0
- package/dist/core/workflow/engine/session-compaction.js.map +1 -0
- package/dist/core/workflow/engine/team-leader-part-runner.d.ts.map +1 -1
- package/dist/core/workflow/engine/team-leader-part-runner.js +3 -1
- package/dist/core/workflow/engine/team-leader-part-runner.js.map +1 -1
- package/dist/core/workflow/evaluation/RuleEvaluator.d.ts +0 -1
- package/dist/core/workflow/evaluation/RuleEvaluator.d.ts.map +1 -1
- package/dist/core/workflow/evaluation/RuleEvaluator.js +22 -34
- package/dist/core/workflow/evaluation/RuleEvaluator.js.map +1 -1
- package/dist/core/workflow/evaluation/rule-utils.d.ts +33 -1
- package/dist/core/workflow/evaluation/rule-utils.d.ts.map +1 -1
- package/dist/core/workflow/evaluation/rule-utils.js +77 -5
- package/dist/core/workflow/evaluation/rule-utils.js.map +1 -1
- package/dist/core/workflow/evaluation/when-evaluator.d.ts +1 -0
- package/dist/core/workflow/evaluation/when-evaluator.d.ts.map +1 -1
- package/dist/core/workflow/evaluation/when-evaluator.js +18 -40
- package/dist/core/workflow/evaluation/when-evaluator.js.map +1 -1
- package/dist/core/workflow/findings/context.d.ts +4 -0
- package/dist/core/workflow/findings/context.d.ts.map +1 -1
- package/dist/core/workflow/findings/context.js +27 -0
- package/dist/core/workflow/findings/context.js.map +1 -1
- package/dist/core/workflow/findings/manager-output-validation.d.ts +14 -0
- package/dist/core/workflow/findings/manager-output-validation.d.ts.map +1 -1
- package/dist/core/workflow/findings/manager-output-validation.js +158 -8
- package/dist/core/workflow/findings/manager-output-validation.js.map +1 -1
- package/dist/core/workflow/findings/manager-runner.d.ts +17 -6
- package/dist/core/workflow/findings/manager-runner.d.ts.map +1 -1
- package/dist/core/workflow/findings/manager-runner.js +157 -59
- package/dist/core/workflow/findings/manager-runner.js.map +1 -1
- package/dist/core/workflow/findings/manager-step.d.ts +8 -0
- package/dist/core/workflow/findings/manager-step.d.ts.map +1 -0
- package/dist/core/workflow/findings/manager-step.js +27 -0
- package/dist/core/workflow/findings/manager-step.js.map +1 -0
- package/dist/core/workflow/findings/mechanical-classification.d.ts +24 -0
- package/dist/core/workflow/findings/mechanical-classification.d.ts.map +1 -0
- package/dist/core/workflow/findings/mechanical-classification.js +115 -0
- package/dist/core/workflow/findings/mechanical-classification.js.map +1 -0
- package/dist/core/workflow/findings/reconciler.d.ts +1 -0
- package/dist/core/workflow/findings/reconciler.d.ts.map +1 -1
- package/dist/core/workflow/findings/reconciler.js +90 -4
- package/dist/core/workflow/findings/reconciler.js.map +1 -1
- package/dist/core/workflow/instruction/InstructionBuilder.d.ts.map +1 -1
- package/dist/core/workflow/instruction/InstructionBuilder.js +7 -15
- package/dist/core/workflow/instruction/InstructionBuilder.js.map +1 -1
- package/dist/core/workflow/instruction/ReportInstructionBuilder.d.ts.map +1 -1
- package/dist/core/workflow/instruction/ReportInstructionBuilder.js +9 -11
- package/dist/core/workflow/instruction/ReportInstructionBuilder.js.map +1 -1
- package/dist/core/workflow/instruction/finding-contract-instruction.d.ts +36 -0
- package/dist/core/workflow/instruction/finding-contract-instruction.d.ts.map +1 -0
- package/dist/core/workflow/instruction/finding-contract-instruction.js +39 -0
- package/dist/core/workflow/instruction/finding-contract-instruction.js.map +1 -0
- package/dist/core/workflow/instruction/instruction-context.d.ts +16 -0
- package/dist/core/workflow/instruction/instruction-context.d.ts.map +1 -1
- package/dist/core/workflow/instruction/instruction-context.js +14 -18
- package/dist/core/workflow/instruction/instruction-context.js.map +1 -1
- package/dist/core/workflow/instruction/status-rules.d.ts.map +1 -1
- package/dist/core/workflow/instruction/status-rules.js +7 -2
- package/dist/core/workflow/instruction/status-rules.js.map +1 -1
- package/dist/core/workflow/permission-profile-resolution.d.ts +6 -0
- package/dist/core/workflow/permission-profile-resolution.d.ts.map +1 -1
- package/dist/core/workflow/permission-profile-resolution.js +11 -0
- package/dist/core/workflow/permission-profile-resolution.js.map +1 -1
- package/dist/core/workflow/phase-runner.d.ts +17 -10
- package/dist/core/workflow/phase-runner.d.ts.map +1 -1
- package/dist/core/workflow/phase-runner.js +1 -1
- package/dist/core/workflow/phase-runner.js.map +1 -1
- package/dist/core/workflow/provider-model-requirements.d.ts +6 -0
- package/dist/core/workflow/provider-model-requirements.d.ts.map +1 -0
- package/dist/core/workflow/provider-model-requirements.js +15 -0
- package/dist/core/workflow/provider-model-requirements.js.map +1 -0
- package/dist/core/workflow/provider-options-trace.d.ts +1 -1
- package/dist/core/workflow/provider-options-trace.d.ts.map +1 -1
- package/dist/core/workflow/provider-resolution.d.ts +14 -11
- package/dist/core/workflow/provider-resolution.d.ts.map +1 -1
- package/dist/core/workflow/provider-resolution.js +38 -26
- package/dist/core/workflow/provider-resolution.js.map +1 -1
- package/dist/core/workflow/report-phase-runner.d.ts +5 -2
- package/dist/core/workflow/report-phase-runner.d.ts.map +1 -1
- package/dist/core/workflow/report-phase-runner.js +135 -43
- package/dist/core/workflow/report-phase-runner.js.map +1 -1
- package/dist/core/workflow/status-judgment-phase.d.ts +2 -2
- package/dist/core/workflow/status-judgment-phase.d.ts.map +1 -1
- package/dist/core/workflow/status-judgment-phase.js +1 -7
- package/dist/core/workflow/status-judgment-phase.js.map +1 -1
- package/dist/core/workflow/system/system-step-effect-runner.js +2 -2
- package/dist/core/workflow/system/system-step-effect-runner.js.map +1 -1
- package/dist/core/workflow/system/system-step-services.d.ts +101 -0
- package/dist/core/workflow/system/system-step-services.d.ts.map +1 -1
- package/dist/core/workflow/types.d.ts +25 -8
- package/dist/core/workflow/types.d.ts.map +1 -1
- package/dist/features/analytics/events.d.ts +30 -3
- package/dist/features/analytics/events.d.ts.map +1 -1
- package/dist/features/analytics/events.js +1 -1
- package/dist/features/analytics/index.d.ts +2 -2
- package/dist/features/analytics/index.d.ts.map +1 -1
- package/dist/features/analytics/index.js.map +1 -1
- package/dist/features/analytics/writer.d.ts +8 -14
- package/dist/features/analytics/writer.d.ts.map +1 -1
- package/dist/features/analytics/writer.js +27 -17
- package/dist/features/analytics/writer.js.map +1 -1
- package/dist/features/exec/assistantSession.d.ts +2 -0
- package/dist/features/exec/assistantSession.d.ts.map +1 -1
- package/dist/features/exec/assistantSession.js +1 -1
- package/dist/features/exec/assistantSession.js.map +1 -1
- package/dist/features/exec/command.d.ts.map +1 -1
- package/dist/features/exec/command.js +98 -54
- package/dist/features/exec/command.js.map +1 -1
- package/dist/features/exec/commandAvailability.js +1 -1
- package/dist/features/exec/commandAvailability.js.map +1 -1
- package/dist/features/exec/configOps.d.ts.map +1 -1
- package/dist/features/exec/configOps.js +6 -5
- package/dist/features/exec/configOps.js.map +1 -1
- package/dist/features/exec/configValidation.d.ts +1 -1
- package/dist/features/exec/configValidation.d.ts.map +1 -1
- package/dist/features/exec/configValidation.js +9 -13
- package/dist/features/exec/configValidation.js.map +1 -1
- package/dist/features/exec/runtimeConfig.d.ts.map +1 -1
- package/dist/features/exec/runtimeConfig.js +4 -2
- package/dist/features/exec/runtimeConfig.js.map +1 -1
- package/dist/features/exec/setupMenu.js +2 -2
- package/dist/features/exec/setupMenu.js.map +1 -1
- package/dist/features/exec/workflowRunner.d.ts +2 -1
- package/dist/features/exec/workflowRunner.d.ts.map +1 -1
- package/dist/features/exec/workflowRunner.js +2 -1
- package/dist/features/exec/workflowRunner.js.map +1 -1
- package/dist/features/exec/workflowTemplate.d.ts.map +1 -1
- package/dist/features/exec/workflowTemplate.js +4 -4
- package/dist/features/exec/workflowTemplate.js.map +1 -1
- package/dist/features/interactive/aiCaller.d.ts +4 -2
- package/dist/features/interactive/aiCaller.d.ts.map +1 -1
- package/dist/features/interactive/aiCaller.js +38 -11
- package/dist/features/interactive/aiCaller.js.map +1 -1
- package/dist/features/interactive/assistantConfig.d.ts.map +1 -1
- package/dist/features/interactive/assistantConfig.js +3 -2
- package/dist/features/interactive/assistantConfig.js.map +1 -1
- package/dist/features/interactive/conversationLoop.d.ts.map +1 -1
- package/dist/features/interactive/conversationLoop.js +164 -141
- package/dist/features/interactive/conversationLoop.js.map +1 -1
- package/dist/features/interactive/conversationSession.d.ts +44 -0
- package/dist/features/interactive/conversationSession.d.ts.map +1 -0
- package/dist/features/interactive/conversationSession.js +133 -0
- package/dist/features/interactive/conversationSession.js.map +1 -0
- package/dist/features/interactive/imageAttachments.d.ts +12 -8
- package/dist/features/interactive/imageAttachments.d.ts.map +1 -1
- package/dist/features/interactive/imageAttachments.js +67 -14
- package/dist/features/interactive/imageAttachments.js.map +1 -1
- package/dist/features/interactive/index.d.ts +1 -0
- package/dist/features/interactive/index.d.ts.map +1 -1
- package/dist/features/interactive/index.js +1 -0
- package/dist/features/interactive/index.js.map +1 -1
- package/dist/features/interactive/instructModeTypes.d.ts +2 -2
- package/dist/features/interactive/instructModeTypes.d.ts.map +1 -1
- package/dist/features/interactive/interactive-summary.d.ts.map +1 -1
- package/dist/features/interactive/interactive-summary.js +8 -0
- package/dist/features/interactive/interactive-summary.js.map +1 -1
- package/dist/features/interactive/interactive.d.ts +9 -6
- package/dist/features/interactive/interactive.d.ts.map +1 -1
- package/dist/features/interactive/interactive.js +10 -4
- package/dist/features/interactive/interactive.js.map +1 -1
- package/dist/features/interactive/interactiveApplication.d.ts +5 -0
- package/dist/features/interactive/interactiveApplication.d.ts.map +1 -0
- package/dist/features/interactive/interactiveApplication.js +10 -0
- package/dist/features/interactive/interactiveApplication.js.map +1 -0
- package/dist/features/interactive/passthroughMode.d.ts.map +1 -1
- package/dist/features/interactive/passthroughMode.js +22 -16
- package/dist/features/interactive/passthroughMode.js.map +1 -1
- package/dist/features/interactive/promptSections.js +2 -2
- package/dist/features/interactive/promptSections.js.map +1 -1
- package/dist/features/interactive/quietMode.d.ts.map +1 -1
- package/dist/features/interactive/quietMode.js +55 -40
- package/dist/features/interactive/quietMode.js.map +1 -1
- package/dist/features/interactive/retryMode.d.ts.map +1 -1
- package/dist/features/interactive/retryMode.js +5 -4
- package/dist/features/interactive/retryMode.js.map +1 -1
- package/dist/features/mcp/operations.d.ts +25 -0
- package/dist/features/mcp/operations.d.ts.map +1 -0
- package/dist/features/mcp/operations.js +150 -0
- package/dist/features/mcp/operations.js.map +1 -0
- package/dist/features/mcp/schemas.d.ts +50 -0
- package/dist/features/mcp/schemas.d.ts.map +1 -0
- package/dist/features/mcp/schemas.js +59 -0
- package/dist/features/mcp/schemas.js.map +1 -0
- package/dist/features/mcp/server.d.ts +7 -0
- package/dist/features/mcp/server.d.ts.map +1 -0
- package/dist/features/mcp/server.js +36 -0
- package/dist/features/mcp/server.js.map +1 -0
- package/dist/features/pipeline/steps.d.ts +1 -1
- package/dist/features/pipeline/steps.d.ts.map +1 -1
- package/dist/features/pipeline/steps.js +6 -2
- package/dist/features/pipeline/steps.js.map +1 -1
- package/dist/features/prompt/preview.d.ts.map +1 -1
- package/dist/features/prompt/preview.js +37 -1
- package/dist/features/prompt/preview.js.map +1 -1
- package/dist/features/tasks/add/index.d.ts +8 -20
- package/dist/features/tasks/add/index.d.ts.map +1 -1
- package/dist/features/tasks/add/index.js +42 -61
- package/dist/features/tasks/add/index.js.map +1 -1
- package/dist/features/tasks/attachments.d.ts +4 -10
- package/dist/features/tasks/attachments.d.ts.map +1 -1
- package/dist/features/tasks/attachments.js +14 -42
- package/dist/features/tasks/attachments.js.map +1 -1
- package/dist/features/tasks/execute/analyticsEmitter.d.ts +7 -2
- package/dist/features/tasks/execute/analyticsEmitter.d.ts.map +1 -1
- package/dist/features/tasks/execute/analyticsEmitter.js +76 -2
- package/dist/features/tasks/execute/analyticsEmitter.js.map +1 -1
- package/dist/features/tasks/execute/outputFns.d.ts +1 -1
- package/dist/features/tasks/execute/outputFns.d.ts.map +1 -1
- package/dist/features/tasks/execute/outputFns.js +17 -1
- package/dist/features/tasks/execute/outputFns.js.map +1 -1
- package/dist/features/tasks/execute/postExecution.d.ts +4 -1
- package/dist/features/tasks/execute/postExecution.d.ts.map +1 -1
- package/dist/features/tasks/execute/postExecution.js +33 -14
- package/dist/features/tasks/execute/postExecution.js.map +1 -1
- package/dist/features/tasks/execute/resolveTask.d.ts +9 -3
- package/dist/features/tasks/execute/resolveTask.d.ts.map +1 -1
- package/dist/features/tasks/execute/resolveTask.js +46 -14
- package/dist/features/tasks/execute/resolveTask.js.map +1 -1
- package/dist/features/tasks/execute/runAllTasks.d.ts.map +1 -1
- package/dist/features/tasks/execute/runAllTasks.js +3 -0
- package/dist/features/tasks/execute/runAllTasks.js.map +1 -1
- package/dist/features/tasks/execute/runTaskExecution.d.ts +7 -1
- package/dist/features/tasks/execute/runTaskExecution.d.ts.map +1 -1
- package/dist/features/tasks/execute/runTaskExecution.js +11 -8
- package/dist/features/tasks/execute/runTaskExecution.js.map +1 -1
- package/dist/features/tasks/execute/taskExecution.d.ts +12 -3
- package/dist/features/tasks/execute/taskExecution.d.ts.map +1 -1
- package/dist/features/tasks/execute/taskExecution.js +63 -16
- package/dist/features/tasks/execute/taskExecution.js.map +1 -1
- package/dist/features/tasks/execute/taskResultHandler.d.ts +2 -2
- package/dist/features/tasks/execute/taskResultHandler.d.ts.map +1 -1
- package/dist/features/tasks/execute/taskResultHandler.js +8 -4
- package/dist/features/tasks/execute/taskResultHandler.js.map +1 -1
- package/dist/features/tasks/execute/taskWorkflowExecution.d.ts.map +1 -1
- package/dist/features/tasks/execute/taskWorkflowExecution.js +62 -9
- package/dist/features/tasks/execute/taskWorkflowExecution.js.map +1 -1
- package/dist/features/tasks/execute/traceTaskMetadata.js +3 -6
- package/dist/features/tasks/execute/traceTaskMetadata.js.map +1 -1
- package/dist/features/tasks/execute/types.d.ts +109 -7
- package/dist/features/tasks/execute/types.d.ts.map +1 -1
- package/dist/features/tasks/execute/workflowExecution.d.ts +3 -1
- package/dist/features/tasks/execute/workflowExecution.d.ts.map +1 -1
- package/dist/features/tasks/execute/workflowExecution.js +49 -5
- package/dist/features/tasks/execute/workflowExecution.js.map +1 -1
- package/dist/features/tasks/execute/workflowExecutionApi.d.ts +6 -0
- package/dist/features/tasks/execute/workflowExecutionApi.d.ts.map +1 -0
- package/dist/features/tasks/execute/workflowExecutionApi.js +25 -0
- package/dist/features/tasks/execute/workflowExecutionApi.js.map +1 -0
- package/dist/features/tasks/execute/workflowExecutionBootstrap.d.ts +3 -1
- package/dist/features/tasks/execute/workflowExecutionBootstrap.d.ts.map +1 -1
- package/dist/features/tasks/execute/workflowExecutionBootstrap.js +51 -20
- package/dist/features/tasks/execute/workflowExecutionBootstrap.js.map +1 -1
- package/dist/features/tasks/execute/workflowExecutionContext.d.ts.map +1 -1
- package/dist/features/tasks/execute/workflowExecutionContext.js +1 -1
- package/dist/features/tasks/execute/workflowExecutionContext.js.map +1 -1
- package/dist/features/tasks/execute/workflowExecutionEvents.d.ts +14 -1
- package/dist/features/tasks/execute/workflowExecutionEvents.d.ts.map +1 -1
- package/dist/features/tasks/execute/workflowExecutionEvents.js +246 -4
- package/dist/features/tasks/execute/workflowExecutionEvents.js.map +1 -1
- package/dist/features/tasks/list/instructMode.d.ts.map +1 -1
- package/dist/features/tasks/list/instructMode.js +5 -4
- package/dist/features/tasks/list/instructMode.js.map +1 -1
- package/dist/features/tasks/list/requeueHelpers.d.ts +1 -0
- package/dist/features/tasks/list/requeueHelpers.d.ts.map +1 -1
- package/dist/features/tasks/list/requeueHelpers.js +3 -0
- package/dist/features/tasks/list/requeueHelpers.js.map +1 -1
- package/dist/features/tasks/list/taskInstructionActions.d.ts.map +1 -1
- package/dist/features/tasks/list/taskInstructionActions.js +33 -25
- package/dist/features/tasks/list/taskInstructionActions.js.map +1 -1
- package/dist/features/tasks/list/taskRetryActions.d.ts.map +1 -1
- package/dist/features/tasks/list/taskRetryActions.js +34 -30
- package/dist/features/tasks/list/taskRetryActions.js.map +1 -1
- package/dist/features/tasks/resume/directInstructMode.d.ts.map +1 -1
- package/dist/features/tasks/resume/directInstructMode.js +11 -2
- package/dist/features/tasks/resume/directInstructMode.js.map +1 -1
- package/dist/features/tasks/resume/index.d.ts.map +1 -1
- package/dist/features/tasks/resume/index.js +73 -24
- package/dist/features/tasks/resume/index.js.map +1 -1
- package/dist/features/tasks/{list/retryTaskSpecAttachments.d.ts → retryTaskSpecAttachments.d.ts} +3 -1
- package/dist/features/tasks/retryTaskSpecAttachments.d.ts.map +1 -0
- package/dist/features/tasks/{list/retryTaskSpecAttachments.js → retryTaskSpecAttachments.js} +4 -3
- package/dist/features/tasks/retryTaskSpecAttachments.js.map +1 -0
- package/dist/features/tasks/taskContextValidation.d.ts +10 -0
- package/dist/features/tasks/taskContextValidation.d.ts.map +1 -0
- package/dist/features/tasks/taskContextValidation.js +73 -0
- package/dist/features/tasks/taskContextValidation.js.map +1 -0
- package/dist/features/tasks/watch/index.d.ts.map +1 -1
- package/dist/features/tasks/watch/index.js +1 -0
- package/dist/features/tasks/watch/index.js.map +1 -1
- package/dist/features/workflowAuthoring/doctor.d.ts.map +1 -1
- package/dist/features/workflowAuthoring/doctor.js +56 -1
- package/dist/features/workflowAuthoring/doctor.js.map +1 -1
- package/dist/infra/claude/image-input.d.ts.map +1 -1
- package/dist/infra/claude/image-input.js +3 -2
- package/dist/infra/claude/image-input.js.map +1 -1
- package/dist/infra/codex/client.d.ts.map +1 -1
- package/dist/infra/codex/client.js +29 -10
- package/dist/infra/codex/client.js.map +1 -1
- package/dist/infra/config/configNormalizers.d.ts +24 -2
- package/dist/infra/config/configNormalizers.d.ts.map +1 -1
- package/dist/infra/config/configNormalizers.js +77 -4
- package/dist/infra/config/configNormalizers.js.map +1 -1
- package/dist/infra/config/env/global-current-env-specs.d.ts.map +1 -1
- package/dist/infra/config/env/global-current-env-specs.js +2 -0
- package/dist/infra/config/env/global-current-env-specs.js.map +1 -1
- package/dist/infra/config/env/project-current-env-specs.d.ts.map +1 -1
- package/dist/infra/config/env/project-current-env-specs.js +2 -0
- package/dist/infra/config/env/project-current-env-specs.js.map +1 -1
- package/dist/infra/config/global/globalConfig.d.ts +1 -1
- package/dist/infra/config/global/globalConfig.d.ts.map +1 -1
- package/dist/infra/config/global/globalConfig.js +1 -1
- package/dist/infra/config/global/globalConfig.js.map +1 -1
- package/dist/infra/config/global/globalConfigAccessors.d.ts +6 -0
- package/dist/infra/config/global/globalConfigAccessors.d.ts.map +1 -1
- package/dist/infra/config/global/globalConfigAccessors.js +80 -1
- package/dist/infra/config/global/globalConfigAccessors.js.map +1 -1
- package/dist/infra/config/global/globalConfigCore.d.ts.map +1 -1
- package/dist/infra/config/global/globalConfigCore.js +5 -3
- package/dist/infra/config/global/globalConfigCore.js.map +1 -1
- package/dist/infra/config/global/globalConfigSerializer.d.ts.map +1 -1
- package/dist/infra/config/global/globalConfigSerializer.js +9 -1
- package/dist/infra/config/global/globalConfigSerializer.js.map +1 -1
- package/dist/infra/config/global/index.d.ts +1 -1
- package/dist/infra/config/global/index.d.ts.map +1 -1
- package/dist/infra/config/global/index.js +1 -1
- package/dist/infra/config/global/index.js.map +1 -1
- package/dist/infra/config/loaders/resource-resolver.d.ts.map +1 -1
- package/dist/infra/config/loaders/resource-resolver.js +22 -7
- package/dist/infra/config/loaders/resource-resolver.js.map +1 -1
- package/dist/infra/config/loaders/workflowCallContractValidator.d.ts.map +1 -1
- package/dist/infra/config/loaders/workflowCallContractValidator.js +11 -4
- package/dist/infra/config/loaders/workflowCallContractValidator.js.map +1 -1
- package/dist/infra/config/loaders/workflowCallContracts.d.ts.map +1 -1
- package/dist/infra/config/loaders/workflowCallContracts.js +5 -0
- package/dist/infra/config/loaders/workflowCallContracts.js.map +1 -1
- package/dist/infra/config/loaders/workflowCallResolver.d.ts +2 -2
- package/dist/infra/config/loaders/workflowCallResolver.d.ts.map +1 -1
- package/dist/infra/config/loaders/workflowCallResolver.js +3 -10
- package/dist/infra/config/loaders/workflowCallResolver.js.map +1 -1
- package/dist/infra/config/loaders/workflowCallableArgResolver.d.ts.map +1 -1
- package/dist/infra/config/loaders/workflowCallableArgResolver.js +27 -0
- package/dist/infra/config/loaders/workflowCallableArgResolver.js.map +1 -1
- package/dist/infra/config/loaders/workflowCallableRuleValidation.d.ts.map +1 -1
- package/dist/infra/config/loaders/workflowCallableRuleValidation.js +5 -0
- package/dist/infra/config/loaders/workflowCallableRuleValidation.js.map +1 -1
- package/dist/infra/config/loaders/workflowLoopMonitorNormalizer.d.ts.map +1 -1
- package/dist/infra/config/loaders/workflowLoopMonitorNormalizer.js +12 -1
- package/dist/infra/config/loaders/workflowLoopMonitorNormalizer.js.map +1 -1
- package/dist/infra/config/loaders/workflowPackageScope.d.ts +1 -0
- package/dist/infra/config/loaders/workflowPackageScope.d.ts.map +1 -1
- package/dist/infra/config/loaders/workflowPackageScope.js +20 -2
- package/dist/infra/config/loaders/workflowPackageScope.js.map +1 -1
- package/dist/infra/config/loaders/workflowParser.d.ts.map +1 -1
- package/dist/infra/config/loaders/workflowParser.js +17 -7
- package/dist/infra/config/loaders/workflowParser.js.map +1 -1
- package/dist/infra/config/loaders/workflowPreview.d.ts +3 -0
- package/dist/infra/config/loaders/workflowPreview.d.ts.map +1 -1
- package/dist/infra/config/loaders/workflowPreview.js +43 -5
- package/dist/infra/config/loaders/workflowPreview.js.map +1 -1
- package/dist/infra/config/loaders/workflowRuleNormalizer.d.ts +10 -0
- package/dist/infra/config/loaders/workflowRuleNormalizer.d.ts.map +1 -1
- package/dist/infra/config/loaders/workflowRuleNormalizer.js +70 -1
- package/dist/infra/config/loaders/workflowRuleNormalizer.js.map +1 -1
- package/dist/infra/config/loaders/workflowStepNormalizer.d.ts.map +1 -1
- package/dist/infra/config/loaders/workflowStepNormalizer.js +41 -13
- package/dist/infra/config/loaders/workflowStepNormalizer.js.map +1 -1
- package/dist/infra/config/project/projectConfig.d.ts.map +1 -1
- package/dist/infra/config/project/projectConfig.js +19 -3
- package/dist/infra/config/project/projectConfig.js.map +1 -1
- package/dist/infra/config/project/sessionStore.d.ts +2 -2
- package/dist/infra/config/project/sessionStore.d.ts.map +1 -1
- package/dist/infra/config/project/sessionStore.js +12 -4
- package/dist/infra/config/project/sessionStore.js.map +1 -1
- package/dist/infra/config/providerModelRequirements.d.ts +2 -0
- package/dist/infra/config/providerModelRequirements.d.ts.map +1 -0
- package/dist/infra/config/providerModelRequirements.js +2 -0
- package/dist/infra/config/providerModelRequirements.js.map +1 -0
- package/dist/infra/config/resolveConfigValue.d.ts.map +1 -1
- package/dist/infra/config/resolveConfigValue.js +1 -0
- package/dist/infra/config/resolveConfigValue.js.map +1 -1
- package/dist/infra/config/traced/tracedConfigSchema.d.ts.map +1 -1
- package/dist/infra/config/traced/tracedConfigSchema.js +6 -0
- package/dist/infra/config/traced/tracedConfigSchema.js.map +1 -1
- package/dist/infra/git/format.d.ts +1 -0
- package/dist/infra/git/format.d.ts.map +1 -1
- package/dist/infra/git/format.js +21 -0
- package/dist/infra/git/format.js.map +1 -1
- package/dist/infra/git/index.d.ts +1 -1
- package/dist/infra/git/index.d.ts.map +1 -1
- package/dist/infra/git/types.d.ts +16 -4
- package/dist/infra/git/types.d.ts.map +1 -1
- package/dist/infra/github/GitHubProvider.d.ts +2 -1
- package/dist/infra/github/GitHubProvider.d.ts.map +1 -1
- package/dist/infra/github/GitHubProvider.js +4 -1
- package/dist/infra/github/GitHubProvider.js.map +1 -1
- package/dist/infra/github/issue.d.ts +2 -1
- package/dist/infra/github/issue.d.ts.map +1 -1
- package/dist/infra/github/issue.js +23 -2
- package/dist/infra/github/issue.js.map +1 -1
- package/dist/infra/gitlab/GitLabProvider.d.ts +2 -1
- package/dist/infra/gitlab/GitLabProvider.d.ts.map +1 -1
- package/dist/infra/gitlab/GitLabProvider.js +4 -1
- package/dist/infra/gitlab/GitLabProvider.js.map +1 -1
- package/dist/infra/gitlab/issue.d.ts +2 -1
- package/dist/infra/gitlab/issue.d.ts.map +1 -1
- package/dist/infra/gitlab/issue.js +30 -2
- package/dist/infra/gitlab/issue.js.map +1 -1
- package/dist/infra/opencode/OpenCodeStreamHandler.d.ts +4 -0
- package/dist/infra/opencode/OpenCodeStreamHandler.d.ts.map +1 -1
- package/dist/infra/opencode/OpenCodeStreamHandler.js.map +1 -1
- package/dist/infra/opencode/allowedTools.d.ts.map +1 -1
- package/dist/infra/opencode/allowedTools.js +0 -1
- package/dist/infra/opencode/allowedTools.js.map +1 -1
- package/dist/infra/opencode/client.d.ts +5 -1
- package/dist/infra/opencode/client.d.ts.map +1 -1
- package/dist/infra/opencode/client.js +519 -174
- package/dist/infra/opencode/client.js.map +1 -1
- package/dist/infra/opencode/index.d.ts +2 -2
- package/dist/infra/opencode/index.d.ts.map +1 -1
- package/dist/infra/opencode/index.js +1 -1
- package/dist/infra/opencode/index.js.map +1 -1
- package/dist/infra/opencode/types.d.ts +42 -0
- package/dist/infra/opencode/types.d.ts.map +1 -1
- package/dist/infra/opencode/types.js +88 -1
- package/dist/infra/opencode/types.js.map +1 -1
- package/dist/infra/opencode/unavailable-tool-loop.d.ts +25 -0
- package/dist/infra/opencode/unavailable-tool-loop.d.ts.map +1 -1
- package/dist/infra/opencode/unavailable-tool-loop.js +74 -0
- package/dist/infra/opencode/unavailable-tool-loop.js.map +1 -1
- package/dist/infra/providers/claude-headless.d.ts.map +1 -1
- package/dist/infra/providers/claude-headless.js +0 -2
- package/dist/infra/providers/claude-headless.js.map +1 -1
- package/dist/infra/providers/claude-terminal.d.ts.map +1 -1
- package/dist/infra/providers/claude-terminal.js +0 -2
- package/dist/infra/providers/claude-terminal.js.map +1 -1
- package/dist/infra/providers/claude.d.ts.map +1 -1
- package/dist/infra/providers/claude.js +0 -2
- package/dist/infra/providers/claude.js.map +1 -1
- package/dist/infra/providers/copilot.d.ts.map +1 -1
- package/dist/infra/providers/copilot.js +3 -0
- package/dist/infra/providers/copilot.js.map +1 -1
- package/dist/infra/providers/cursor.d.ts.map +1 -1
- package/dist/infra/providers/cursor.js +3 -0
- package/dist/infra/providers/cursor.js.map +1 -1
- package/dist/infra/providers/imageAttachmentPrompt.d.ts +0 -1
- package/dist/infra/providers/imageAttachmentPrompt.d.ts.map +1 -1
- package/dist/infra/providers/imageAttachmentPrompt.js +19 -2
- package/dist/infra/providers/imageAttachmentPrompt.js.map +1 -1
- package/dist/infra/providers/imageAttachments.d.ts +3 -0
- package/dist/infra/providers/imageAttachments.d.ts.map +1 -0
- package/dist/infra/providers/imageAttachments.js +47 -0
- package/dist/infra/providers/imageAttachments.js.map +1 -0
- package/dist/infra/providers/index.d.ts +1 -1
- package/dist/infra/providers/index.d.ts.map +1 -1
- package/dist/infra/providers/index.js.map +1 -1
- package/dist/infra/providers/mock.d.ts.map +1 -1
- package/dist/infra/providers/mock.js +5 -0
- package/dist/infra/providers/mock.js.map +1 -1
- package/dist/infra/providers/opencode.d.ts +3 -2
- package/dist/infra/providers/opencode.d.ts.map +1 -1
- package/dist/infra/providers/opencode.js +31 -6
- package/dist/infra/providers/opencode.js.map +1 -1
- package/dist/infra/providers/types.d.ts +8 -0
- package/dist/infra/providers/types.d.ts.map +1 -1
- package/dist/infra/task/clone-exec.d.ts.map +1 -1
- package/dist/infra/task/clone-exec.js +31 -0
- package/dist/infra/task/clone-exec.js.map +1 -1
- package/dist/infra/task/enqueueService.d.ts +115 -0
- package/dist/infra/task/enqueueService.d.ts.map +1 -0
- package/dist/infra/task/enqueueService.js +191 -0
- package/dist/infra/task/enqueueService.js.map +1 -0
- package/dist/infra/task/enqueuedTaskFile.d.ts +6 -0
- package/dist/infra/task/enqueuedTaskFile.d.ts.map +1 -0
- package/dist/infra/task/enqueuedTaskFile.js +55 -0
- package/dist/infra/task/enqueuedTaskFile.js.map +1 -0
- package/dist/infra/task/issueTask.d.ts +20 -0
- package/dist/infra/task/issueTask.d.ts.map +1 -0
- package/dist/{features/tasks/add → infra/task}/issueTask.js +61 -43
- package/dist/infra/task/issueTask.js.map +1 -0
- package/dist/infra/task/listSerializer.d.ts +1 -0
- package/dist/infra/task/listSerializer.d.ts.map +1 -1
- package/dist/infra/task/listSerializer.js +1 -0
- package/dist/infra/task/listSerializer.js.map +1 -1
- package/dist/infra/task/mapper.d.ts.map +1 -1
- package/dist/infra/task/mapper.js +1 -0
- package/dist/infra/task/mapper.js.map +1 -1
- package/dist/infra/task/taskExecutionSchemas.d.ts +3 -0
- package/dist/infra/task/taskExecutionSchemas.d.ts.map +1 -1
- package/dist/infra/task/taskExecutionSchemas.js +4 -2
- package/dist/infra/task/taskExecutionSchemas.js.map +1 -1
- package/dist/infra/task/taskRecordSchemas.d.ts +2 -0
- package/dist/infra/task/taskRecordSchemas.d.ts.map +1 -1
- package/dist/infra/workflow/system/DefaultSystemStepServices.d.ts.map +1 -1
- package/dist/infra/workflow/system/DefaultSystemStepServices.js +7 -7
- package/dist/infra/workflow/system/DefaultSystemStepServices.js.map +1 -1
- package/dist/infra/workflow/system/system-enqueue-effect.d.ts.map +1 -1
- package/dist/infra/workflow/system/system-enqueue-effect.js +78 -20
- package/dist/infra/workflow/system/system-enqueue-effect.js.map +1 -1
- package/dist/infra/workflow/system/system-git-context.d.ts +6 -6
- package/dist/infra/workflow/system/system-git-context.d.ts.map +1 -1
- package/dist/infra/workflow/system/system-git-context.js +13 -13
- package/dist/infra/workflow/system/system-git-context.js.map +1 -1
- package/dist/infra/workflow/system/system-issue-input-resolver.d.ts +3 -3
- package/dist/infra/workflow/system/system-issue-input-resolver.d.ts.map +1 -1
- package/dist/infra/workflow/system/system-issue-input-resolver.js +8 -8
- package/dist/infra/workflow/system/system-issue-input-resolver.js.map +1 -1
- package/dist/infra/workflow/system/system-pr-effects.d.ts.map +1 -1
- package/dist/infra/workflow/system/system-pr-effects.js +6 -3
- package/dist/infra/workflow/system/system-pr-effects.js.map +1 -1
- package/dist/infra/workflow/system/system-pr-input-resolver.d.ts +3 -3
- package/dist/infra/workflow/system/system-pr-input-resolver.d.ts.map +1 -1
- package/dist/infra/workflow/system/system-pr-input-resolver.js +8 -8
- package/dist/infra/workflow/system/system-pr-input-resolver.js.map +1 -1
- package/dist/infra/workflow/system/system-sync-effects.js +2 -2
- package/dist/infra/workflow/system/system-sync-effects.js.map +1 -1
- package/dist/shared/package-info.d.ts +2 -0
- package/dist/shared/package-info.d.ts.map +1 -0
- package/dist/shared/package-info.js +5 -0
- package/dist/shared/package-info.js.map +1 -0
- package/dist/shared/prompts/en/exec_assistant_instruct.md +2 -0
- package/dist/shared/prompts/en/finding_manager_instruction.md +9 -2
- package/dist/shared/prompts/en/opencode_review_agent_prompt.md +20 -23
- package/dist/shared/prompts/en/parts/finding_contract_instruction.md +25 -0
- package/dist/shared/prompts/en/parts/git_rules.md +5 -0
- package/dist/shared/prompts/{ja → en/parts}/structured_json_schema_instruction.md +2 -0
- package/dist/shared/prompts/en/{structured_json_step_instruction.md → parts/structured_json_step_instruction.md} +2 -0
- package/dist/shared/prompts/ja/exec_assistant_instruct.md +2 -0
- package/dist/shared/prompts/ja/finding_manager_instruction.md +9 -2
- package/dist/shared/prompts/ja/opencode_review_agent_prompt.md +20 -23
- package/dist/shared/prompts/ja/parts/finding_contract_instruction.md +25 -0
- package/dist/shared/prompts/ja/parts/git_rules.md +5 -0
- package/dist/shared/prompts/{en → ja/parts}/structured_json_schema_instruction.md +4 -2
- package/dist/shared/prompts/ja/{structured_json_step_instruction.md → parts/structured_json_step_instruction.md} +4 -2
- package/dist/shared/types/image-attachments.d.ts +10 -0
- package/dist/shared/types/image-attachments.d.ts.map +1 -0
- package/dist/shared/types/image-attachments.js +2 -0
- package/dist/shared/types/image-attachments.js.map +1 -0
- package/dist/shared/utils/entrypoint.d.ts +2 -0
- package/dist/shared/utils/entrypoint.d.ts.map +1 -0
- package/dist/shared/utils/entrypoint.js +15 -0
- package/dist/shared/utils/entrypoint.js.map +1 -0
- package/dist/shared/utils/imageAttachmentReferences.d.ts +7 -0
- package/dist/shared/utils/imageAttachmentReferences.d.ts.map +1 -0
- package/dist/shared/utils/imageAttachmentReferences.js +64 -0
- package/dist/shared/utils/imageAttachmentReferences.js.map +1 -0
- package/dist/shared/utils/index.d.ts +1 -0
- package/dist/shared/utils/index.d.ts.map +1 -1
- package/dist/shared/utils/index.js +1 -0
- package/dist/shared/utils/index.js.map +1 -1
- package/dist/shared/utils/safeExternalErrorMessage.d.ts +2 -0
- package/dist/shared/utils/safeExternalErrorMessage.d.ts.map +1 -0
- package/dist/shared/utils/safeExternalErrorMessage.js +22 -0
- package/dist/shared/utils/safeExternalErrorMessage.js.map +1 -0
- package/package.json +32 -13
- package/builtins/en/facets/instructions/review-pure.md +0 -9
- package/builtins/en/facets/personas/pure-reviewer.md +0 -22
- package/builtins/ja/facets/instructions/review-pure.md +0 -9
- package/builtins/ja/facets/personas/pure-reviewer.md +0 -22
- package/dist/core/workflow/claude-effort-compatibility.d.ts +0 -3
- package/dist/core/workflow/claude-effort-compatibility.d.ts.map +0 -1
- package/dist/core/workflow/claude-effort-compatibility.js +0 -28
- package/dist/core/workflow/claude-effort-compatibility.js.map +0 -1
- package/dist/core/workflow/provider-model-compatibility.d.ts +0 -6
- package/dist/core/workflow/provider-model-compatibility.d.ts.map +0 -1
- package/dist/core/workflow/provider-model-compatibility.js +0 -20
- package/dist/core/workflow/provider-model-compatibility.js.map +0 -1
- package/dist/features/tasks/add/issueTask.d.ts +0 -7
- package/dist/features/tasks/add/issueTask.d.ts.map +0 -1
- package/dist/features/tasks/add/issueTask.js.map +0 -1
- package/dist/features/tasks/list/retryTaskSpecAttachments.d.ts.map +0 -1
- package/dist/features/tasks/list/retryTaskSpecAttachments.js.map +0 -1
- package/dist/infra/config/providerModelCompatibility.d.ts +0 -2
- package/dist/infra/config/providerModelCompatibility.d.ts.map +0 -1
- package/dist/infra/config/providerModelCompatibility.js +0 -2
- package/dist/infra/config/providerModelCompatibility.js.map +0 -1
- /package/dist/shared/prompts/en/{source_context_section_guidance.md → parts/source_context_section_guidance.md} +0 -0
- /package/dist/shared/prompts/en/{source_context_system_guard.md → parts/source_context_system_guard.md} +0 -0
- /package/dist/shared/prompts/ja/{source_context_section_guidance.md → parts/source_context_section_guidance.md} +0 -0
- /package/dist/shared/prompts/ja/{source_context_system_guard.md → parts/source_context_system_guard.md} +0 -0
|
@@ -9,16 +9,37 @@ import { createServer } from 'node:net';
|
|
|
9
9
|
import { loadTemplate } from '../../shared/prompts/index.js';
|
|
10
10
|
import { mapsToOpenCodeEditPermission } from './allowedTools.js';
|
|
11
11
|
import { AskUserQuestionDeniedError } from '../../core/workflow/ask-user-question-error.js';
|
|
12
|
+
import { parseLastJsonBlock } from '../../agents/structured-caller/shared.js';
|
|
12
13
|
import { createLogger, getErrorMessage, createStreamDiagnostics } from '../../shared/utils/index.js';
|
|
13
14
|
import { getNestedObservabilityEnvFingerprint, runWithNestedObservabilityProcessEnv, } from '../../shared/telemetry/index.js';
|
|
14
15
|
import { parseProviderModel } from '../../shared/utils/providerModel.js';
|
|
15
|
-
import { buildOpenCodePermissionRuleset, resolveOpenCodePermissionReply, } from './types.js';
|
|
16
|
+
import { buildOpenCodePermissionRuleset, buildOpenCodePromptTools, buildOpenCodeSessionPermission, resolveOpenCodePermissionReply, } from './types.js';
|
|
16
17
|
import { createStreamTrackingState, emitInit, emitText, emitPermissionAsked, emitPermissionSummary, emitResult, handlePartUpdated, } from './OpenCodeStreamHandler.js';
|
|
17
|
-
import { UnavailableToolLoopDetector } from './unavailable-tool-loop.js';
|
|
18
|
+
import { InvalidToolArgumentLoopDetector, ToolErrorBudgetDetector, UnavailableToolLoopDetector } from './unavailable-tool-loop.js';
|
|
18
19
|
import { buildRateLimitedResponseFields, containsRateLimitError } from '../rate-limit/detection.js';
|
|
19
20
|
const TAKT_AGENT = 'takt';
|
|
20
21
|
const TAKT_AGENT_REVIEW = 'takt-review';
|
|
21
22
|
const TAKT_AGENT_REPORT = 'takt-report';
|
|
23
|
+
/**
|
|
24
|
+
* イベントが属するセッション ID を取り出す。イベントバスはサーバ全体で
|
|
25
|
+
* 共有されるため、無音検出のリセットは「自セッションの進捗」だけに
|
|
26
|
+
* 反応させる必要がある(LSP・ファイルウォッチャ・兄弟セッションの
|
|
27
|
+
* イベントでリセットすると、生成が死んでいても永遠にハングする)。
|
|
28
|
+
*/
|
|
29
|
+
function extractEventSessionId(event) {
|
|
30
|
+
const props = event.properties;
|
|
31
|
+
if (!props)
|
|
32
|
+
return undefined;
|
|
33
|
+
if (typeof props.sessionID === 'string')
|
|
34
|
+
return props.sessionID;
|
|
35
|
+
const part = props.part;
|
|
36
|
+
if (part !== undefined && typeof part.sessionID === 'string')
|
|
37
|
+
return part.sessionID;
|
|
38
|
+
const info = props.info;
|
|
39
|
+
if (info !== undefined && typeof info.sessionID === 'string')
|
|
40
|
+
return info.sessionID;
|
|
41
|
+
return undefined;
|
|
42
|
+
}
|
|
22
43
|
function selectTaktAgent(allowedTools) {
|
|
23
44
|
if (allowedTools !== undefined && allowedTools.length === 0) {
|
|
24
45
|
return TAKT_AGENT_REPORT;
|
|
@@ -33,7 +54,16 @@ function selectTaktAgent(allowedTools) {
|
|
|
33
54
|
return TAKT_AGENT_REVIEW;
|
|
34
55
|
}
|
|
35
56
|
const log = createLogger('opencode-sdk');
|
|
36
|
-
|
|
57
|
+
/** 呼び出し時に評価する(テストや実験で env から上書きできるようにする) */
|
|
58
|
+
function resolveMessageCycleBudget() {
|
|
59
|
+
const fromEnv = Number(process.env.TAKT_OPENCODE_MESSAGE_CYCLE_BUDGET);
|
|
60
|
+
return fromEnv > 0 ? fromEnv : 120;
|
|
61
|
+
}
|
|
62
|
+
/** 呼び出し時に評価する(テストや実験で env から上書きできるようにする) */
|
|
63
|
+
function resolveStreamIdleTimeoutMs() {
|
|
64
|
+
const fromEnv = Number(process.env.TAKT_OPENCODE_STREAM_IDLE_TIMEOUT_MS);
|
|
65
|
+
return fromEnv > 0 ? fromEnv : 10 * 60 * 1000;
|
|
66
|
+
}
|
|
37
67
|
const OPENCODE_STREAM_ABORTED_MESSAGE = 'OpenCode execution aborted';
|
|
38
68
|
const OPENCODE_RETRY_MAX_ATTEMPTS = 3;
|
|
39
69
|
const OPENCODE_RETRY_BASE_DELAY_MS = 250;
|
|
@@ -95,6 +125,14 @@ async function createSharedServer(model, apiKey, childProcessEnv) {
|
|
|
95
125
|
config: {
|
|
96
126
|
model,
|
|
97
127
|
small_model: model,
|
|
128
|
+
// Session-level permission rules are rewritten whenever a prompt
|
|
129
|
+
// carries a tools map (OpenCode materializes the map into
|
|
130
|
+
// session.permission), so session-scoped denies do not survive the
|
|
131
|
+
// first prompt. Server-config permission is outside that rewrite and
|
|
132
|
+
// is the only layer that reliably keeps out-of-workspace access a
|
|
133
|
+
// soft tool error instead of an ask (which would depend on the
|
|
134
|
+
// user's global OpenCode config).
|
|
135
|
+
permission: { external_directory: 'deny' },
|
|
98
136
|
...(apiKey ? { provider: { opencode: { options: { apiKey } } } } : {}),
|
|
99
137
|
agent: {
|
|
100
138
|
[TAKT_AGENT]: {
|
|
@@ -163,6 +201,93 @@ export async function getOpenCodeSessionSnapshot(model, sessionID, directory, ap
|
|
|
163
201
|
release();
|
|
164
202
|
}
|
|
165
203
|
}
|
|
204
|
+
/** レート制限を示す HTTP ステータス。プロバイダは 429 を返す。 */
|
|
205
|
+
const RATE_LIMIT_STATUS_CODE = 429;
|
|
206
|
+
/**
|
|
207
|
+
* 検死 RPC の上限。検死自体がハングして再度の無限待ちを招かないようにする。
|
|
208
|
+
* 呼び出し時に評価する(テストで env から上書きできるようにする)。
|
|
209
|
+
*/
|
|
210
|
+
function resolvePostmortemTimeoutMs() {
|
|
211
|
+
const fromEnv = Number(process.env.TAKT_OPENCODE_POSTMORTEM_TIMEOUT_MS);
|
|
212
|
+
return fromEnv > 0 ? fromEnv : 5000;
|
|
213
|
+
}
|
|
214
|
+
/** statusCode は数値でも文字列でも来うるため正規化する。 */
|
|
215
|
+
function extractStatusCode(error) {
|
|
216
|
+
if (!error || typeof error !== 'object') {
|
|
217
|
+
return undefined;
|
|
218
|
+
}
|
|
219
|
+
const data = error.data;
|
|
220
|
+
const raw = data?.statusCode;
|
|
221
|
+
if (typeof raw === 'number') {
|
|
222
|
+
return raw;
|
|
223
|
+
}
|
|
224
|
+
if (typeof raw === 'string') {
|
|
225
|
+
const parsed = Number(raw);
|
|
226
|
+
return Number.isFinite(parsed) ? parsed : undefined;
|
|
227
|
+
}
|
|
228
|
+
return undefined;
|
|
229
|
+
}
|
|
230
|
+
/**
|
|
231
|
+
* 直近の assistant メッセージのエラーを検死し、レート制限ならその内容を返す。
|
|
232
|
+
*
|
|
233
|
+
* OpenCode サーバはプロバイダの 429 を内部リトライで握り、イベントバスへ
|
|
234
|
+
* session.error を流さない。takt からは「無音のまま停止したセッション」に
|
|
235
|
+
* 見えるため、無音ウォッチドッグのタイムアウト後にここで死因を確かめる。
|
|
236
|
+
*
|
|
237
|
+
* 判定するのは「最新の assistant メッセージ」だけに限る。sessionId は phase や
|
|
238
|
+
* resume で再利用されるため、過去の assistant に残る古い 429 を今回の死因と
|
|
239
|
+
* 誤認しないようにする。
|
|
240
|
+
*/
|
|
241
|
+
async function postmortemRateLimitError(client, sessionID, directory) {
|
|
242
|
+
let messages;
|
|
243
|
+
try {
|
|
244
|
+
const result = await withTimeout((signal) => client.session.messages({ sessionID, directory }, { signal }), resolvePostmortemTimeoutMs(), 'OpenCode rate limit postmortem timed out');
|
|
245
|
+
if (!result.data) {
|
|
246
|
+
return undefined;
|
|
247
|
+
}
|
|
248
|
+
messages = result.data;
|
|
249
|
+
}
|
|
250
|
+
catch (error) {
|
|
251
|
+
// 検死そのものの失敗(RPC エラー・ハング)で本来のエラーを覆い隠さない。
|
|
252
|
+
log.debug('Rate limit postmortem could not read session messages', {
|
|
253
|
+
sessionID,
|
|
254
|
+
error: getErrorMessage(error),
|
|
255
|
+
});
|
|
256
|
+
return undefined;
|
|
257
|
+
}
|
|
258
|
+
// 末尾が assistant でないなら、今回のターンの応答はまだ作られていない。
|
|
259
|
+
// ここで過去へ遡ると、セッション再利用時に前回ターンの 429 を今回の死因と
|
|
260
|
+
// 誤認する([前回 assistant 429, 今回 user prompt] のまま無音停止する形)。
|
|
261
|
+
const latestInfo = messages[messages.length - 1]?.info;
|
|
262
|
+
if (latestInfo?.role !== 'assistant') {
|
|
263
|
+
return undefined;
|
|
264
|
+
}
|
|
265
|
+
const error = latestInfo.error;
|
|
266
|
+
if (error === undefined) {
|
|
267
|
+
return undefined;
|
|
268
|
+
}
|
|
269
|
+
const message = extractOpenCodeErrorMessage(error);
|
|
270
|
+
if (extractStatusCode(error) === RATE_LIMIT_STATUS_CODE) {
|
|
271
|
+
return message ?? `HTTP ${RATE_LIMIT_STATUS_CODE} Too Many Requests`;
|
|
272
|
+
}
|
|
273
|
+
if (message !== undefined && containsRateLimitError(message)) {
|
|
274
|
+
return message;
|
|
275
|
+
}
|
|
276
|
+
return undefined;
|
|
277
|
+
}
|
|
278
|
+
export async function getOpenCodeSessionMessages(model, sessionID, directory, apiKey) {
|
|
279
|
+
const { client, release } = await acquireClient(model, apiKey, undefined);
|
|
280
|
+
try {
|
|
281
|
+
const result = await client.session.messages({ sessionID, directory });
|
|
282
|
+
if (!result.data) {
|
|
283
|
+
throw new Error(`OpenCode session messages not found: ${sessionID}`);
|
|
284
|
+
}
|
|
285
|
+
return result.data;
|
|
286
|
+
}
|
|
287
|
+
finally {
|
|
288
|
+
release();
|
|
289
|
+
}
|
|
290
|
+
}
|
|
166
291
|
function releaseClient(server) {
|
|
167
292
|
const next = server.queue.shift();
|
|
168
293
|
if (next) {
|
|
@@ -185,6 +310,25 @@ function throwIfAborted(signal) {
|
|
|
185
310
|
throw new Error(OPENCODE_STREAM_ABORTED_MESSAGE);
|
|
186
311
|
}
|
|
187
312
|
}
|
|
313
|
+
function createExternalAbortPromise(controller, externalAbortSignal) {
|
|
314
|
+
if (externalAbortSignal === undefined) {
|
|
315
|
+
return {};
|
|
316
|
+
}
|
|
317
|
+
let removeListener;
|
|
318
|
+
const promise = new Promise((_, reject) => {
|
|
319
|
+
const onExternalAbort = () => {
|
|
320
|
+
reject(new Error(OPENCODE_STREAM_ABORTED_MESSAGE));
|
|
321
|
+
controller.abort();
|
|
322
|
+
};
|
|
323
|
+
if (externalAbortSignal.aborted) {
|
|
324
|
+
onExternalAbort();
|
|
325
|
+
return;
|
|
326
|
+
}
|
|
327
|
+
externalAbortSignal.addEventListener('abort', onExternalAbort, { once: true });
|
|
328
|
+
removeListener = () => externalAbortSignal.removeEventListener('abort', onExternalAbort);
|
|
329
|
+
});
|
|
330
|
+
return { promise, removeListener };
|
|
331
|
+
}
|
|
188
332
|
function createReleaseHandle(server) {
|
|
189
333
|
let released = false;
|
|
190
334
|
return () => {
|
|
@@ -200,25 +344,37 @@ export function resetSharedServer() {
|
|
|
200
344
|
}
|
|
201
345
|
sharedServers.clear();
|
|
202
346
|
}
|
|
203
|
-
async function withTimeout(operation, timeoutMs, timeoutErrorMessage) {
|
|
347
|
+
async function withTimeout(operation, timeoutMs, timeoutErrorMessage, externalAbortSignal) {
|
|
204
348
|
const controller = new AbortController();
|
|
349
|
+
let timedOut = false;
|
|
205
350
|
let timeoutId;
|
|
206
351
|
const timeoutPromise = new Promise((_, reject) => {
|
|
207
352
|
timeoutId = setTimeout(() => {
|
|
353
|
+
timedOut = true;
|
|
208
354
|
controller.abort();
|
|
209
355
|
reject(new Error(timeoutErrorMessage));
|
|
210
356
|
}, timeoutMs);
|
|
211
357
|
});
|
|
358
|
+
const externalAbort = createExternalAbortPromise(controller, externalAbortSignal);
|
|
212
359
|
try {
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
360
|
+
const operationPromise = operation(controller.signal).catch((error) => {
|
|
361
|
+
if (timedOut) {
|
|
362
|
+
return new Promise(() => {
|
|
363
|
+
// The timeout promise owns the rejection after aborting the SDK call.
|
|
364
|
+
});
|
|
365
|
+
}
|
|
366
|
+
throw error;
|
|
367
|
+
});
|
|
368
|
+
const racePromises = externalAbort.promise !== undefined
|
|
369
|
+
? [operationPromise, timeoutPromise, externalAbort.promise]
|
|
370
|
+
: [operationPromise, timeoutPromise];
|
|
371
|
+
return await Promise.race(racePromises);
|
|
217
372
|
}
|
|
218
373
|
finally {
|
|
219
374
|
if (timeoutId !== undefined) {
|
|
220
375
|
clearTimeout(timeoutId);
|
|
221
376
|
}
|
|
377
|
+
externalAbort.removeListener?.();
|
|
222
378
|
}
|
|
223
379
|
}
|
|
224
380
|
function extractOpenCodeErrorMessage(error) {
|
|
@@ -371,10 +527,19 @@ export class OpenCodeClient {
|
|
|
371
527
|
}
|
|
372
528
|
/** Call OpenCode with an agent prompt */
|
|
373
529
|
async call(agentType, prompt, options) {
|
|
374
|
-
|
|
530
|
+
// native format(StructuredOutput ツール)をモデルが呼ばない個体が
|
|
531
|
+
// あるため、その失敗を検出したら format なし(手書き JSON + 下流の
|
|
532
|
+
// 是正リトライ)へフォールバックする。
|
|
533
|
+
let disableNativeStructuredOutput = false;
|
|
534
|
+
// フォールバック(format なし再試行)は transient 再試行の予算とは別枠で
|
|
535
|
+
// 1回だけ確保する: 先行の transient エラーで予算を使い切っていても、
|
|
536
|
+
// 最終試行の format 失敗から救済できるようにする。
|
|
537
|
+
let maxAttempts = OPENCODE_RETRY_MAX_ATTEMPTS;
|
|
538
|
+
for (let attempt = 1; attempt <= maxAttempts; attempt++) {
|
|
375
539
|
let idleTimeoutId;
|
|
376
540
|
const streamAbortController = new AbortController();
|
|
377
|
-
const
|
|
541
|
+
const streamIdleTimeoutMs = resolveStreamIdleTimeoutMs();
|
|
542
|
+
const timeoutMessage = `OpenCode stream timed out after ${Math.round(streamIdleTimeoutMs / 60000)} minutes of inactivity`;
|
|
378
543
|
let abortCause;
|
|
379
544
|
let diagRef;
|
|
380
545
|
let release;
|
|
@@ -418,9 +583,10 @@ export class OpenCodeClient {
|
|
|
418
583
|
}
|
|
419
584
|
idleTimeoutId = setTimeout(() => {
|
|
420
585
|
diagRef?.onIdleTimeoutFired();
|
|
586
|
+
log.warn(timeoutMessage, { sessionId, model: options.model });
|
|
421
587
|
abortCause = 'timeout';
|
|
422
588
|
streamAbortController.abort();
|
|
423
|
-
},
|
|
589
|
+
}, streamIdleTimeoutMs);
|
|
424
590
|
};
|
|
425
591
|
const onExternalAbort = () => {
|
|
426
592
|
abortCause = 'external';
|
|
@@ -455,23 +621,17 @@ export class OpenCodeClient {
|
|
|
455
621
|
throw new Error(OPENCODE_STREAM_ABORTED_MESSAGE);
|
|
456
622
|
}
|
|
457
623
|
const permissionRuleset = buildOpenCodePermissionRuleset(options.permissionMode, options.networkAccess, options.allowedTools);
|
|
458
|
-
|
|
459
|
-
|
|
624
|
+
// The session is created once per step and reused across phases: a
|
|
625
|
+
// session-scoped deny can never be escalated later, and recreating the
|
|
626
|
+
// session drops the conversation history the report/judgment phases
|
|
627
|
+
// depend on. Per-phase tool restriction rides on the explicit prompt
|
|
628
|
+
// tools map below instead.
|
|
629
|
+
const appliedPermissionRuleset = sessionId === undefined;
|
|
630
|
+
const sessionPermission = buildOpenCodeSessionPermission(options.permissionMode, options.networkAccess, options.allowedTools);
|
|
460
631
|
if (sessionId === undefined) {
|
|
461
632
|
const sessionResult = await opencodeApiClient.session.create({
|
|
462
633
|
directory: options.cwd,
|
|
463
|
-
permission:
|
|
464
|
-
});
|
|
465
|
-
sessionId = sessionResult.data?.id;
|
|
466
|
-
if (!sessionId) {
|
|
467
|
-
throw new Error('Failed to create OpenCode session');
|
|
468
|
-
}
|
|
469
|
-
}
|
|
470
|
-
else if (options.allowedTools !== undefined) {
|
|
471
|
-
const sessionResult = await opencodeApiClient.session.create({
|
|
472
|
-
directory: options.cwd,
|
|
473
|
-
parentID: sessionId,
|
|
474
|
-
permission: permissionRuleset,
|
|
634
|
+
permission: sessionPermission,
|
|
475
635
|
});
|
|
476
636
|
sessionId = sessionResult.data?.id;
|
|
477
637
|
if (!sessionId) {
|
|
@@ -491,21 +651,32 @@ export class OpenCodeClient {
|
|
|
491
651
|
...(options.permissionMode !== undefined ? { permissionMode: options.permissionMode } : {}),
|
|
492
652
|
...(options.allowedTools !== undefined ? { allowedTools: options.allowedTools } : {}),
|
|
493
653
|
...(options.networkAccess !== undefined ? { networkAccess: options.networkAccess } : {}),
|
|
494
|
-
resolvedPermissions:
|
|
654
|
+
resolvedPermissions: sessionPermission,
|
|
495
655
|
});
|
|
496
656
|
}
|
|
497
657
|
const agentName = selectTaktAgent(options.allowedTools);
|
|
658
|
+
// OpenCode persists the last explicit tools map on the session, so
|
|
659
|
+
// every prompt sends the full map for its own phase (see
|
|
660
|
+
// buildOpenCodePromptTools).
|
|
661
|
+
const promptTools = buildOpenCodePromptTools(options.permissionMode, options.networkAccess, options.allowedTools);
|
|
498
662
|
log.debug('Selecting OpenCode agent', {
|
|
499
663
|
agentName,
|
|
500
664
|
allowedTools: options.allowedTools,
|
|
665
|
+
promptTools,
|
|
501
666
|
});
|
|
502
667
|
const promptPayload = {
|
|
503
668
|
sessionID: activeSessionId,
|
|
504
669
|
directory: options.cwd,
|
|
505
670
|
model: parsedModel,
|
|
671
|
+
tools: promptTools,
|
|
506
672
|
...(agentName !== undefined ? { agent: agentName } : {}),
|
|
507
673
|
...(options.variant !== undefined ? { variant: options.variant } : {}),
|
|
508
674
|
...(options.systemPrompt !== undefined ? { system: options.systemPrompt } : {}),
|
|
675
|
+
// ネイティブ構造化出力: OpenCode がスキーマのキー構造を強制する
|
|
676
|
+
// (enum 等の値制約までは保証されないため、下流のスキーマ検証は維持)。
|
|
677
|
+
...(options.outputSchema !== undefined && !disableNativeStructuredOutput
|
|
678
|
+
? { format: { type: 'json_schema', schema: options.outputSchema, retryCount: 2 } }
|
|
679
|
+
: {}),
|
|
509
680
|
parts: [{ type: 'text', text: prompt }],
|
|
510
681
|
};
|
|
511
682
|
const promptPayloadForSdk = promptPayload;
|
|
@@ -521,9 +692,12 @@ export class OpenCodeClient {
|
|
|
521
692
|
emitInit(options.onStream, options.model, activeSessionId);
|
|
522
693
|
let content = '';
|
|
523
694
|
let success = true;
|
|
695
|
+
let capturedStructuredOutput;
|
|
524
696
|
let failureMessage = '';
|
|
525
697
|
const state = createStreamTrackingState();
|
|
526
698
|
const unavailableToolLoopDetector = new UnavailableToolLoopDetector();
|
|
699
|
+
const invalidArgumentLoopDetector = new InvalidToolArgumentLoopDetector();
|
|
700
|
+
const toolErrorBudgetDetector = new ToolErrorBudgetDetector();
|
|
527
701
|
const echoState = { remainingPrompts: buildPromptEchoCandidates(prompt, options.systemPrompt) };
|
|
528
702
|
const textOffsets = new Map();
|
|
529
703
|
const textContentParts = new Map();
|
|
@@ -544,198 +718,283 @@ export class OpenCodeClient {
|
|
|
544
718
|
const prevOffset = textOffsets.get(partId) ?? 0;
|
|
545
719
|
textOffsets.set(partId, prevOffset + rawDelta.length);
|
|
546
720
|
};
|
|
547
|
-
for
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
721
|
+
// for-await 単体だと、タイマーが abort してもイベントが来るまで
|
|
722
|
+
// 待ちから戻らない(SDK が signal を尊重しない場合は永久待機)。
|
|
723
|
+
// イテレータと abort をレースさせ、タイマー発火で必ず脱出する。
|
|
724
|
+
const streamIterator = stream[Symbol.asyncIterator]();
|
|
725
|
+
const streamAborted = new Promise((_, reject) => {
|
|
726
|
+
streamAbortController.signal.addEventListener('abort', () => {
|
|
727
|
+
reject(new Error(timeoutMessage));
|
|
728
|
+
}, { once: true });
|
|
729
|
+
});
|
|
730
|
+
streamAborted.catch(() => { });
|
|
731
|
+
// 劣化した生成は「ごく短いアシスタント応答サイクル」を数百回繰り返す
|
|
732
|
+
// (実測: 524〜1211 ループ)。テキスト断片だけの空転はツールエラー
|
|
733
|
+
// 予算にも無音検出にも掛からないため、応答サイクル数で打ち切る。
|
|
734
|
+
// 健全なステップはツール往復込みでも数十サイクルに収まる。
|
|
735
|
+
let assistantMessageCycles = 0;
|
|
736
|
+
const messageCycleBudget = resolveMessageCycleBudget();
|
|
737
|
+
try {
|
|
738
|
+
while (true) {
|
|
739
|
+
if (streamAbortController.signal.aborted)
|
|
740
|
+
break;
|
|
741
|
+
let iteration;
|
|
742
|
+
try {
|
|
743
|
+
iteration = await Promise.race([streamIterator.next(), streamAborted]);
|
|
566
744
|
}
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
const loopError = toolPart.state.status === 'error'
|
|
570
|
-
? unavailableToolLoopDetector.observe(toolPart.callID || toolPart.id, toolPart.tool, toolPart.state.error)
|
|
571
|
-
: undefined;
|
|
572
|
-
if (toolPart.state.status === 'completed') {
|
|
573
|
-
unavailableToolLoopDetector.reset();
|
|
574
|
-
}
|
|
575
|
-
handlePartUpdated(part, delta, options.onStream, state);
|
|
576
|
-
if (loopError !== undefined) {
|
|
577
|
-
success = false;
|
|
578
|
-
failureMessage = loopError;
|
|
579
|
-
diag.onStreamError('message.part.updated', loopError);
|
|
745
|
+
catch (raceError) {
|
|
746
|
+
if (streamAbortController.signal.aborted)
|
|
580
747
|
break;
|
|
581
|
-
|
|
748
|
+
throw raceError;
|
|
749
|
+
}
|
|
750
|
+
if (iteration.done)
|
|
751
|
+
break;
|
|
752
|
+
const event = iteration.value;
|
|
753
|
+
const sseEvent = event;
|
|
754
|
+
// セッション帰属が判明していて自分でないイベントは処理しない。
|
|
755
|
+
// サーバプールは同一モデルで共有されるため(並列レビュー等)、
|
|
756
|
+
// 兄弟セッションの text/tool 更新を通すと content と検出器が
|
|
757
|
+
// 汚染される。帰属不明のイベントは種別ごとの処理に委ねるが、
|
|
758
|
+
// 無音検出のリセット(延命)は自セッションのイベントに限る。
|
|
759
|
+
const eventSessionId = extractEventSessionId(sseEvent);
|
|
760
|
+
if (eventSessionId !== undefined && eventSessionId !== activeSessionId) {
|
|
582
761
|
continue;
|
|
583
762
|
}
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
}
|
|
587
|
-
if (sseEvent.type === 'message.part.delta') {
|
|
588
|
-
const deltaProps = sseEvent.properties;
|
|
589
|
-
if (deltaProps.field === 'text' && deltaProps.delta) {
|
|
590
|
-
unavailableToolLoopDetector.reset();
|
|
591
|
-
consumeTextDelta(deltaProps.partID, deltaProps.delta);
|
|
763
|
+
if (eventSessionId === activeSessionId) {
|
|
764
|
+
resetIdleTimeout();
|
|
592
765
|
}
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
766
|
+
diag.onFirstEvent(sseEvent.type);
|
|
767
|
+
diag.onEvent(sseEvent.type);
|
|
768
|
+
if (sseEvent.type === 'message.part.updated') {
|
|
769
|
+
const props = sseEvent.properties;
|
|
770
|
+
const part = props.part;
|
|
771
|
+
const delta = props.delta;
|
|
772
|
+
if (part.type === 'text') {
|
|
773
|
+
unavailableToolLoopDetector.reset();
|
|
774
|
+
const textPart = part;
|
|
775
|
+
const prev = textOffsets.get(textPart.id) ?? 0;
|
|
776
|
+
const rawDelta = delta
|
|
777
|
+
?? (textPart.text.length > prev ? textPart.text.slice(prev) : '');
|
|
778
|
+
consumeTextDelta(textPart.id, rawDelta);
|
|
779
|
+
continue;
|
|
780
|
+
}
|
|
781
|
+
if (part.type === 'tool') {
|
|
782
|
+
const toolPart = part;
|
|
783
|
+
let loopError;
|
|
784
|
+
if (toolPart.state.status === 'error') {
|
|
785
|
+
// 両検出器に必ず観測させる(?? 短絡だと invalid 側が
|
|
786
|
+
// unavailable エラーを見逃し、連続性の判定が狂う)
|
|
787
|
+
const unavailableError = unavailableToolLoopDetector.observe(toolPart.callID || toolPart.id, toolPart.tool, toolPart.state.error);
|
|
788
|
+
const invalidArgumentError = invalidArgumentLoopDetector.observe(toolPart.callID || toolPart.id, toolPart.tool, toolPart.state.error);
|
|
789
|
+
const budgetError = toolErrorBudgetDetector.observe(toolPart.callID || toolPart.id, toolPart.tool, toolPart.state.error);
|
|
790
|
+
loopError = unavailableError ?? invalidArgumentError ?? budgetError;
|
|
791
|
+
}
|
|
792
|
+
if (toolPart.state.status === 'completed') {
|
|
793
|
+
unavailableToolLoopDetector.reset();
|
|
794
|
+
invalidArgumentLoopDetector.reset();
|
|
795
|
+
}
|
|
796
|
+
handlePartUpdated(part, delta, options.onStream, state);
|
|
797
|
+
if (loopError !== undefined) {
|
|
614
798
|
success = false;
|
|
615
|
-
failureMessage =
|
|
799
|
+
failureMessage = loopError;
|
|
800
|
+
diag.onStreamError('message.part.updated', loopError);
|
|
616
801
|
break;
|
|
617
802
|
}
|
|
803
|
+
continue;
|
|
618
804
|
}
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
805
|
+
handlePartUpdated(part, delta, options.onStream, state);
|
|
806
|
+
continue;
|
|
807
|
+
}
|
|
808
|
+
if (sseEvent.type === 'message.part.delta') {
|
|
809
|
+
const deltaProps = sseEvent.properties;
|
|
810
|
+
if (deltaProps.field === 'text' && deltaProps.delta) {
|
|
811
|
+
unavailableToolLoopDetector.reset();
|
|
812
|
+
consumeTextDelta(deltaProps.partID, deltaProps.delta);
|
|
623
813
|
}
|
|
814
|
+
continue;
|
|
624
815
|
}
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
const questionProps = sseEvent.properties;
|
|
629
|
-
if (questionProps.sessionID === activeSessionId) {
|
|
630
|
-
const rejectQuestion = () => withTimeout((signal) => opencodeApiClient.question.reject({
|
|
631
|
-
requestID: questionProps.id,
|
|
632
|
-
directory: options.cwd,
|
|
633
|
-
}, { signal }), interactionTimeoutMs, 'OpenCode question reject timed out');
|
|
634
|
-
if (!options.onAskUserQuestion) {
|
|
816
|
+
if (sseEvent.type === 'permission.asked') {
|
|
817
|
+
const permProps = sseEvent.properties;
|
|
818
|
+
if (permProps.sessionID === activeSessionId) {
|
|
635
819
|
try {
|
|
636
|
-
|
|
820
|
+
const reply = resolveOpenCodePermissionReply(options.permissionMode, permProps.permission, options.allowedTools !== undefined ? permissionRuleset : undefined);
|
|
821
|
+
emitPermissionAsked(options.onStream, {
|
|
822
|
+
requestId: permProps.id,
|
|
823
|
+
sessionId: permProps.sessionID,
|
|
824
|
+
permission: permProps.permission ?? '',
|
|
825
|
+
patterns: Array.isArray(permProps.patterns) ? permProps.patterns : [],
|
|
826
|
+
always: Array.isArray(permProps.always) ? permProps.always : [],
|
|
827
|
+
reply,
|
|
828
|
+
});
|
|
829
|
+
await withTimeout((signal) => opencodeApiClient.permission.reply({
|
|
830
|
+
requestID: permProps.id,
|
|
831
|
+
directory: options.cwd,
|
|
832
|
+
reply,
|
|
833
|
+
}, { signal }), interactionTimeoutMs, 'OpenCode permission reply timed out');
|
|
834
|
+
if (reply === 'reject') {
|
|
835
|
+
// A rejected permission is a per-tool failure, not a fatal
|
|
836
|
+
// one: OpenCode returns the rejection to the model as a tool
|
|
837
|
+
// error and generation continues (verified against a live
|
|
838
|
+
// server). Aborting here used to turn a single stray
|
|
839
|
+
// out-of-workspace access into a whole-step failure.
|
|
840
|
+
log.info(buildPermissionRejectedMessage(permProps.permission), {
|
|
841
|
+
permission: permProps.permission,
|
|
842
|
+
patterns: permProps.patterns,
|
|
843
|
+
});
|
|
844
|
+
}
|
|
637
845
|
}
|
|
638
846
|
catch (e) {
|
|
639
847
|
success = false;
|
|
640
848
|
failureMessage = getErrorMessage(e);
|
|
641
849
|
break;
|
|
642
850
|
}
|
|
643
|
-
continue;
|
|
644
851
|
}
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
852
|
+
continue;
|
|
853
|
+
}
|
|
854
|
+
if (sseEvent.type === 'question.asked') {
|
|
855
|
+
const questionProps = sseEvent.properties;
|
|
856
|
+
if (questionProps.sessionID === activeSessionId) {
|
|
857
|
+
const rejectQuestion = () => withTimeout((signal) => opencodeApiClient.question.reject({
|
|
648
858
|
requestID: questionProps.id,
|
|
649
859
|
directory: options.cwd,
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
}
|
|
653
|
-
catch (e) {
|
|
654
|
-
if (e instanceof AskUserQuestionDeniedError) {
|
|
860
|
+
}, { signal }), interactionTimeoutMs, 'OpenCode question reject timed out');
|
|
861
|
+
if (!options.onAskUserQuestion) {
|
|
655
862
|
try {
|
|
656
863
|
await rejectQuestion();
|
|
657
864
|
}
|
|
658
|
-
catch (
|
|
865
|
+
catch (e) {
|
|
659
866
|
success = false;
|
|
660
|
-
failureMessage = getErrorMessage(
|
|
867
|
+
failureMessage = getErrorMessage(e);
|
|
661
868
|
break;
|
|
662
869
|
}
|
|
870
|
+
continue;
|
|
871
|
+
}
|
|
872
|
+
try {
|
|
873
|
+
const answers = await options.onAskUserQuestion(toQuestionInput(questionProps));
|
|
874
|
+
await withTimeout((signal) => opencodeApiClient.question.reply({
|
|
875
|
+
requestID: questionProps.id,
|
|
876
|
+
directory: options.cwd,
|
|
877
|
+
answers: toQuestionAnswers(questionProps, answers),
|
|
878
|
+
}, { signal }), interactionTimeoutMs, 'OpenCode question reply timed out');
|
|
663
879
|
}
|
|
664
|
-
|
|
880
|
+
catch (e) {
|
|
881
|
+
if (e instanceof AskUserQuestionDeniedError) {
|
|
882
|
+
try {
|
|
883
|
+
await rejectQuestion();
|
|
884
|
+
}
|
|
885
|
+
catch (rejectErr) {
|
|
886
|
+
success = false;
|
|
887
|
+
failureMessage = getErrorMessage(rejectErr);
|
|
888
|
+
break;
|
|
889
|
+
}
|
|
890
|
+
}
|
|
891
|
+
else {
|
|
892
|
+
success = false;
|
|
893
|
+
failureMessage = getErrorMessage(e);
|
|
894
|
+
break;
|
|
895
|
+
}
|
|
896
|
+
}
|
|
897
|
+
}
|
|
898
|
+
continue;
|
|
899
|
+
}
|
|
900
|
+
if (sseEvent.type === 'message.updated') {
|
|
901
|
+
const messageProps = sseEvent.properties;
|
|
902
|
+
const info = messageProps.info;
|
|
903
|
+
const isCurrentAssistantMessage = info?.sessionID === activeSessionId && info?.role === 'assistant';
|
|
904
|
+
if (isCurrentAssistantMessage) {
|
|
905
|
+
if (info?.structured !== undefined && info.structured !== null && typeof info.structured === 'object' && !Array.isArray(info.structured)) {
|
|
906
|
+
capturedStructuredOutput = info.structured;
|
|
907
|
+
}
|
|
908
|
+
const streamError = extractOpenCodeErrorMessage(info?.error);
|
|
909
|
+
if (streamError) {
|
|
665
910
|
success = false;
|
|
666
|
-
failureMessage =
|
|
911
|
+
failureMessage = streamError;
|
|
912
|
+
diag.onStreamError('message.updated', streamError);
|
|
667
913
|
break;
|
|
668
914
|
}
|
|
915
|
+
if (info?.time?.completed !== undefined) {
|
|
916
|
+
assistantMessageCycles += 1;
|
|
917
|
+
if (assistantMessageCycles >= messageCycleBudget) {
|
|
918
|
+
success = false;
|
|
919
|
+
failureMessage = `OpenCode assistant message cycle budget exceeded (${assistantMessageCycles} cycles in one call)`;
|
|
920
|
+
diag.onStreamError('message.updated', failureMessage);
|
|
921
|
+
break;
|
|
922
|
+
}
|
|
923
|
+
}
|
|
669
924
|
}
|
|
925
|
+
continue;
|
|
670
926
|
}
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
927
|
+
if (sseEvent.type === 'message.completed') {
|
|
928
|
+
const completedProps = sseEvent.properties;
|
|
929
|
+
const info = completedProps.info;
|
|
930
|
+
const isCurrentAssistantMessage = info?.sessionID === activeSessionId && info?.role === 'assistant';
|
|
931
|
+
if (isCurrentAssistantMessage) {
|
|
932
|
+
if (info?.structured !== undefined && info.structured !== null && typeof info.structured === 'object' && !Array.isArray(info.structured)) {
|
|
933
|
+
capturedStructuredOutput = info.structured;
|
|
934
|
+
}
|
|
935
|
+
const streamError = extractOpenCodeErrorMessage(info?.error);
|
|
936
|
+
if (streamError) {
|
|
937
|
+
success = false;
|
|
938
|
+
failureMessage = streamError;
|
|
939
|
+
diag.onStreamError('message.completed', streamError);
|
|
940
|
+
break;
|
|
941
|
+
}
|
|
684
942
|
}
|
|
943
|
+
continue;
|
|
685
944
|
}
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
const isCurrentAssistantMessage = info?.sessionID === activeSessionId && info?.role === 'assistant';
|
|
692
|
-
if (isCurrentAssistantMessage) {
|
|
693
|
-
const streamError = extractOpenCodeErrorMessage(info?.error);
|
|
694
|
-
if (streamError) {
|
|
945
|
+
if (sseEvent.type === 'message.failed') {
|
|
946
|
+
const failedProps = sseEvent.properties;
|
|
947
|
+
const info = failedProps.info;
|
|
948
|
+
const isCurrentAssistantMessage = info?.sessionID === activeSessionId && info?.role === 'assistant';
|
|
949
|
+
if (isCurrentAssistantMessage) {
|
|
695
950
|
success = false;
|
|
696
|
-
failureMessage =
|
|
697
|
-
diag.onStreamError('message.
|
|
951
|
+
failureMessage = extractOpenCodeErrorMessage(info?.error) ?? 'OpenCode message failed';
|
|
952
|
+
diag.onStreamError('message.failed', failureMessage);
|
|
698
953
|
break;
|
|
699
954
|
}
|
|
955
|
+
continue;
|
|
700
956
|
}
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
if (isCurrentAssistantMessage) {
|
|
708
|
-
success = false;
|
|
709
|
-
failureMessage = extractOpenCodeErrorMessage(info?.error) ?? 'OpenCode message failed';
|
|
710
|
-
diag.onStreamError('message.failed', failureMessage);
|
|
711
|
-
break;
|
|
957
|
+
if (sseEvent.type === 'session.status') {
|
|
958
|
+
const statusProps = sseEvent.properties;
|
|
959
|
+
if (statusProps.sessionID === activeSessionId && statusProps.status?.type === 'idle') {
|
|
960
|
+
break;
|
|
961
|
+
}
|
|
962
|
+
continue;
|
|
712
963
|
}
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
964
|
+
if (sseEvent.type === 'session.idle') {
|
|
965
|
+
const idleProps = sseEvent.properties;
|
|
966
|
+
if (idleProps.sessionID === activeSessionId) {
|
|
967
|
+
break;
|
|
968
|
+
}
|
|
969
|
+
continue;
|
|
719
970
|
}
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
971
|
+
if (sseEvent.type === 'session.error') {
|
|
972
|
+
const errorProps = sseEvent.properties;
|
|
973
|
+
if (!errorProps.sessionID || errorProps.sessionID === activeSessionId) {
|
|
974
|
+
success = false;
|
|
975
|
+
failureMessage = extractOpenCodeErrorMessage(errorProps.error) ?? 'OpenCode session error';
|
|
976
|
+
diag.onStreamError('session.error', failureMessage);
|
|
977
|
+
break;
|
|
978
|
+
}
|
|
979
|
+
continue;
|
|
726
980
|
}
|
|
727
|
-
continue;
|
|
728
981
|
}
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
diag.onStreamError('session.error', failureMessage);
|
|
735
|
-
break;
|
|
736
|
-
}
|
|
737
|
-
continue;
|
|
982
|
+
}
|
|
983
|
+
finally {
|
|
984
|
+
// for-await が break 時に行っていた後始末(SSE クローズ)を再現する
|
|
985
|
+
try {
|
|
986
|
+
await streamIterator.return?.(undefined);
|
|
738
987
|
}
|
|
988
|
+
catch { /* クローズ失敗は結果に影響させない */ }
|
|
989
|
+
}
|
|
990
|
+
// The idle watchdog and external aborts cancel the stream. If the
|
|
991
|
+
// iterator ends without throwing, the loop falls through with
|
|
992
|
+
// success still true - do not let a timed-out or aborted stream
|
|
993
|
+
// pass as a completed call (a stalled stream after a rejected
|
|
994
|
+
// permission would otherwise be reported as done).
|
|
995
|
+
if (success && streamAbortController.signal.aborted && (abortCause === 'timeout' || abortCause === 'external')) {
|
|
996
|
+
success = false;
|
|
997
|
+
failureMessage = abortCause === 'timeout' ? timeoutMessage : OPENCODE_STREAM_ABORTED_MESSAGE;
|
|
739
998
|
}
|
|
740
999
|
content = [...textContentParts.values()].join('\n');
|
|
741
1000
|
if (!success && !streamAbortController.signal.aborted) {
|
|
@@ -754,11 +1013,53 @@ export class OpenCodeClient {
|
|
|
754
1013
|
diag.onCompleted(success ? 'normal' : 'error', success ? undefined : failureMessage);
|
|
755
1014
|
if (!success) {
|
|
756
1015
|
const message = failureMessage || 'OpenCode execution failed';
|
|
1016
|
+
// 無音タイムアウトで止めた場合、死因はサーバが握った 429 かもしれない。
|
|
1017
|
+
// メッセージ文字列だけでは判別できないため、セッションを検死する。
|
|
1018
|
+
if (abortCause === 'timeout'
|
|
1019
|
+
&& !containsRateLimitError(message)
|
|
1020
|
+
&& opencodeApiClient !== undefined
|
|
1021
|
+
&& activeSessionId !== undefined) {
|
|
1022
|
+
const rateLimitMessage = await postmortemRateLimitError(opencodeApiClient, activeSessionId, options.cwd);
|
|
1023
|
+
if (rateLimitMessage !== undefined) {
|
|
1024
|
+
// プロバイダ由来の生エラー文はリクエスト内容やアカウント情報を
|
|
1025
|
+
// 含みうるため、分類済みの事実だけを永続化する。
|
|
1026
|
+
log.warn('OpenCode stream stalled on a provider rate limit', {
|
|
1027
|
+
sessionId: activeSessionId,
|
|
1028
|
+
model: options.model,
|
|
1029
|
+
});
|
|
1030
|
+
// 検死で 429 と確定済み。message 文字列に 429 の語が含まれるとは
|
|
1031
|
+
// 限らない(statusCode だけで判定した場合)ため再判定はしない。
|
|
1032
|
+
const rateLimitedResponse = this.buildRateLimitedResponse(agentType, activeSessionId, rateLimitMessage);
|
|
1033
|
+
emitResult(options.onStream, false, rateLimitedResponse.error ?? rateLimitedResponse.content, activeSessionId);
|
|
1034
|
+
return rateLimitedResponse;
|
|
1035
|
+
}
|
|
1036
|
+
}
|
|
757
1037
|
if (containsRateLimitError(message)) {
|
|
758
1038
|
const rateLimitedResponse = this.buildRateLimitedResponse(agentType, activeSessionId, message);
|
|
759
1039
|
emitResult(options.onStream, false, rateLimitedResponse.error ?? rateLimitedResponse.content, activeSessionId);
|
|
760
1040
|
return rateLimitedResponse;
|
|
761
1041
|
}
|
|
1042
|
+
const lowerMessage = message.toLowerCase();
|
|
1043
|
+
// Failures that point at the native json_schema request itself: a
|
|
1044
|
+
// model that never emits the StructuredOutput tool ("did not produce
|
|
1045
|
+
// structured output"), or a gateway/model that rejects the json_schema
|
|
1046
|
+
// response format outright (surfaced as an upstream request error).
|
|
1047
|
+
// These fall back to formatless structured output; generic transient
|
|
1048
|
+
// errors (transport/network) must not, or they would burn the one-shot
|
|
1049
|
+
// fallback budget before a real format failure arrives.
|
|
1050
|
+
const isNativeStructuredOutputFailure = lowerMessage.includes('did not produce structured output')
|
|
1051
|
+
|| lowerMessage.includes('upstream request failed');
|
|
1052
|
+
if (options.outputSchema !== undefined
|
|
1053
|
+
&& !disableNativeStructuredOutput
|
|
1054
|
+
&& isNativeStructuredOutputFailure) {
|
|
1055
|
+
// Fall back to formatless structured output once — hand-written JSON
|
|
1056
|
+
// validated by the downstream correction retry — before giving up.
|
|
1057
|
+
disableNativeStructuredOutput = true;
|
|
1058
|
+
maxAttempts = Math.max(maxAttempts, attempt + 1);
|
|
1059
|
+
log.info('Native structured output failed; retrying without json_schema format', { agentType, attempt, message });
|
|
1060
|
+
await this.waitForRetryDelay(attempt, options.abortSignal);
|
|
1061
|
+
continue;
|
|
1062
|
+
}
|
|
762
1063
|
const retriable = this.isRetriableError(message, streamAbortController.signal.aborted, abortCause);
|
|
763
1064
|
if (retriable && attempt < OPENCODE_RETRY_MAX_ATTEMPTS) {
|
|
764
1065
|
log.info('Retrying OpenCode call after transient failure', { agentType, attempt, message });
|
|
@@ -770,18 +1071,41 @@ export class OpenCodeClient {
|
|
|
770
1071
|
persona: agentType,
|
|
771
1072
|
status: 'error',
|
|
772
1073
|
content: message,
|
|
1074
|
+
error: message,
|
|
773
1075
|
timestamp: new Date(),
|
|
774
1076
|
sessionId: activeSessionId,
|
|
775
1077
|
};
|
|
776
1078
|
}
|
|
777
1079
|
const trimmed = content.trim();
|
|
778
1080
|
emitResult(options.onStream, true, trimmed, activeSessionId);
|
|
1081
|
+
// format 要求時に structured がイベントで捕捉できなかった場合は、
|
|
1082
|
+
// 本文の末尾 JSON をフォールバックとして採取する(検証は下流で行う)。
|
|
1083
|
+
if (capturedStructuredOutput === undefined && options.outputSchema !== undefined) {
|
|
1084
|
+
try {
|
|
1085
|
+
const parsed = parseLastJsonBlock(trimmed);
|
|
1086
|
+
if (typeof parsed === 'object' && parsed !== null && !Array.isArray(parsed)) {
|
|
1087
|
+
capturedStructuredOutput = parsed;
|
|
1088
|
+
}
|
|
1089
|
+
else {
|
|
1090
|
+
log.debug('Structured output fallback found non-object JSON', { agentType });
|
|
1091
|
+
}
|
|
1092
|
+
}
|
|
1093
|
+
catch (fallbackError) {
|
|
1094
|
+
// フォールバック採取の失敗は握りつぶすが、調査用に痕跡は残す
|
|
1095
|
+
// (下流の検証と是正リトライに委ねる)。
|
|
1096
|
+
log.debug('Structured output fallback extraction failed', {
|
|
1097
|
+
agentType,
|
|
1098
|
+
error: getErrorMessage(fallbackError),
|
|
1099
|
+
});
|
|
1100
|
+
}
|
|
1101
|
+
}
|
|
779
1102
|
return {
|
|
780
1103
|
persona: agentType,
|
|
781
1104
|
status: 'done',
|
|
782
1105
|
content: trimmed,
|
|
783
1106
|
timestamp: new Date(),
|
|
784
1107
|
sessionId: activeSessionId,
|
|
1108
|
+
...(capturedStructuredOutput !== undefined ? { structuredOutput: capturedStructuredOutput } : {}),
|
|
785
1109
|
};
|
|
786
1110
|
}
|
|
787
1111
|
catch (error) {
|
|
@@ -814,6 +1138,7 @@ export class OpenCodeClient {
|
|
|
814
1138
|
persona: agentType,
|
|
815
1139
|
status: 'error',
|
|
816
1140
|
content: errorMessage,
|
|
1141
|
+
error: errorMessage,
|
|
817
1142
|
timestamp: new Date(),
|
|
818
1143
|
sessionId,
|
|
819
1144
|
};
|
|
@@ -834,6 +1159,23 @@ export class OpenCodeClient {
|
|
|
834
1159
|
}
|
|
835
1160
|
throw new Error('Unreachable: OpenCode retry loop exhausted without returning');
|
|
836
1161
|
}
|
|
1162
|
+
async compactSession(options) {
|
|
1163
|
+
const parsedModel = parseProviderModel(options.model, 'OpenCode model');
|
|
1164
|
+
const fullModel = `${parsedModel.providerID}/${parsedModel.modelID}`;
|
|
1165
|
+
const acquired = await acquireClient(fullModel, options.opencodeApiKey, options.childProcessEnv, options.abortSignal);
|
|
1166
|
+
try {
|
|
1167
|
+
await withTimeout((signal) => acquired.client.session.summarize({
|
|
1168
|
+
sessionID: options.sessionId,
|
|
1169
|
+
directory: options.cwd,
|
|
1170
|
+
providerID: parsedModel.providerID,
|
|
1171
|
+
modelID: parsedModel.modelID,
|
|
1172
|
+
auto: false,
|
|
1173
|
+
}, { signal }), OPENCODE_INTERACTION_TIMEOUT_MS, 'OpenCode session summarize timed out', options.abortSignal);
|
|
1174
|
+
}
|
|
1175
|
+
finally {
|
|
1176
|
+
acquired.release();
|
|
1177
|
+
}
|
|
1178
|
+
}
|
|
837
1179
|
/** Call OpenCode with a custom agent configuration (system prompt + prompt) */
|
|
838
1180
|
async callCustom(agentName, prompt, systemPrompt, options) {
|
|
839
1181
|
return this.call(agentName, prompt, {
|
|
@@ -849,4 +1191,7 @@ export async function callOpenCode(agentType, prompt, options) {
|
|
|
849
1191
|
export async function callOpenCodeCustom(agentName, prompt, systemPrompt, options) {
|
|
850
1192
|
return defaultClient.callCustom(agentName, prompt, systemPrompt, options);
|
|
851
1193
|
}
|
|
1194
|
+
export async function compactOpenCodeSession(options) {
|
|
1195
|
+
return defaultClient.compactSession(options);
|
|
1196
|
+
}
|
|
852
1197
|
//# sourceMappingURL=client.js.map
|