@liangjie559567/ultrapower 5.5.12 → 5.5.13
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/.claude-plugin/marketplace.json +2 -2
- package/.claude-plugin/plugin.json +2 -2
- package/LICENSE +21 -21
- package/bridge/gyoshu_bridge.py +846 -846
- package/bridge/mcp-server.cjs +145 -38
- package/commands/wizard.md +5 -0
- package/dist/agents/__tests__/agent-wrapper.test.d.ts +2 -0
- package/dist/agents/__tests__/agent-wrapper.test.d.ts.map +1 -0
- package/dist/agents/__tests__/agent-wrapper.test.js +37 -0
- package/dist/agents/__tests__/agent-wrapper.test.js.map +1 -0
- package/dist/agents/__tests__/timeout-config.test.d.ts +2 -0
- package/dist/agents/__tests__/timeout-config.test.d.ts.map +1 -0
- package/dist/agents/__tests__/timeout-config.test.js +35 -0
- package/dist/agents/__tests__/timeout-config.test.js.map +1 -0
- package/dist/agents/__tests__/timeout-manager.test.d.ts +2 -0
- package/dist/agents/__tests__/timeout-manager.test.d.ts.map +1 -0
- package/dist/agents/__tests__/timeout-manager.test.js +37 -0
- package/dist/agents/__tests__/timeout-manager.test.js.map +1 -0
- package/dist/agents/agent-wrapper.d.ts +22 -0
- package/dist/agents/agent-wrapper.d.ts.map +1 -0
- package/dist/agents/agent-wrapper.js +51 -0
- package/dist/agents/agent-wrapper.js.map +1 -0
- package/dist/agents/coordinator-deprecated.d.ts +18 -0
- package/dist/agents/coordinator-deprecated.d.ts.map +1 -0
- package/dist/agents/coordinator-deprecated.js +38 -0
- package/dist/agents/coordinator-deprecated.js.map +1 -0
- package/dist/agents/index.d.ts +3 -0
- package/dist/agents/index.d.ts.map +1 -1
- package/dist/agents/index.js +4 -0
- package/dist/agents/index.js.map +1 -1
- package/dist/agents/timeout-config.d.ts +19 -0
- package/dist/agents/timeout-config.d.ts.map +1 -0
- package/dist/agents/timeout-config.js +57 -0
- package/dist/agents/timeout-config.js.map +1 -0
- package/dist/agents/timeout-manager.d.ts +30 -0
- package/dist/agents/timeout-manager.d.ts.map +1 -0
- package/dist/agents/timeout-manager.js +47 -0
- package/dist/agents/timeout-manager.js.map +1 -0
- package/dist/analytics/analytics-summary.d.ts.map +1 -1
- package/dist/analytics/analytics-summary.js +7 -1
- package/dist/analytics/analytics-summary.js.map +1 -1
- package/dist/analytics/metrics-collector.d.ts.map +1 -1
- package/dist/analytics/metrics-collector.js +9 -1
- package/dist/analytics/metrics-collector.js.map +1 -1
- package/dist/analytics/query-engine.d.ts.map +1 -1
- package/dist/analytics/query-engine.js +21 -3
- package/dist/analytics/query-engine.js.map +1 -1
- package/dist/analytics/token-tracker.js +3 -3
- package/dist/analytics/token-tracker.js.map +1 -1
- package/dist/analytics/transcript-scanner.d.ts.map +1 -1
- package/dist/analytics/transcript-scanner.js +1 -0
- package/dist/analytics/transcript-scanner.js.map +1 -1
- package/dist/audit/logger.d.ts +28 -0
- package/dist/audit/logger.d.ts.map +1 -0
- package/dist/audit/logger.js +78 -0
- package/dist/audit/logger.js.map +1 -0
- package/dist/audit/verify-cli.d.ts +2 -0
- package/dist/audit/verify-cli.d.ts.map +1 -0
- package/dist/audit/verify-cli.js +10 -0
- package/dist/audit/verify-cli.js.map +1 -0
- package/dist/core/hud-config.d.ts +19 -0
- package/dist/core/hud-config.d.ts.map +1 -0
- package/dist/core/hud-config.js +6 -0
- package/dist/core/hud-config.js.map +1 -0
- package/dist/core/job-types.d.ts +22 -0
- package/dist/core/job-types.d.ts.map +1 -0
- package/dist/core/job-types.js +6 -0
- package/dist/core/job-types.js.map +1 -0
- package/dist/features/diagnostics/error-matcher.d.ts +12 -0
- package/dist/features/diagnostics/error-matcher.d.ts.map +1 -0
- package/dist/features/diagnostics/error-matcher.js +41 -0
- package/dist/features/diagnostics/error-matcher.js.map +1 -0
- package/dist/features/diagnostics/index.d.ts +3 -0
- package/dist/features/diagnostics/index.d.ts.map +1 -0
- package/dist/features/diagnostics/index.js +3 -0
- package/dist/features/diagnostics/index.js.map +1 -0
- package/dist/features/diagnostics/solution-suggester.d.ts +12 -0
- package/dist/features/diagnostics/solution-suggester.d.ts.map +1 -0
- package/dist/features/diagnostics/solution-suggester.js +46 -0
- package/dist/features/diagnostics/solution-suggester.js.map +1 -0
- package/dist/features/diagnostics/types.d.ts +25 -0
- package/dist/features/diagnostics/types.d.ts.map +1 -0
- package/dist/features/diagnostics/types.js +5 -0
- package/dist/features/diagnostics/types.js.map +1 -0
- package/dist/features/state-manager/__tests__/cache.test.js +17 -17
- package/dist/features/state-manager/__tests__/cache.test.js.map +1 -1
- package/dist/features/state-manager/__tests__/encryption-performance.test.d.ts +2 -0
- package/dist/features/state-manager/__tests__/encryption-performance.test.d.ts.map +1 -0
- package/dist/features/state-manager/__tests__/encryption-performance.test.js +42 -0
- package/dist/features/state-manager/__tests__/encryption-performance.test.js.map +1 -0
- package/dist/features/state-manager/__tests__/encryption.test.d.ts +2 -0
- package/dist/features/state-manager/__tests__/encryption.test.d.ts.map +1 -0
- package/dist/features/state-manager/__tests__/encryption.test.js +68 -0
- package/dist/features/state-manager/__tests__/encryption.test.js.map +1 -0
- package/dist/features/state-manager/encryption.d.ts +24 -0
- package/dist/features/state-manager/encryption.d.ts.map +1 -0
- package/dist/features/state-manager/encryption.js +86 -0
- package/dist/features/state-manager/encryption.js.map +1 -0
- package/dist/features/state-manager/index.d.ts +4 -0
- package/dist/features/state-manager/index.d.ts.map +1 -1
- package/dist/features/state-manager/index.js +94 -6
- package/dist/features/state-manager/index.js.map +1 -1
- package/dist/features/state-manager/tiered-writer.d.ts +44 -0
- package/dist/features/state-manager/tiered-writer.d.ts.map +1 -0
- package/dist/features/state-manager/tiered-writer.js +76 -0
- package/dist/features/state-manager/tiered-writer.js.map +1 -0
- package/dist/features/state-manager/wal.d.ts +21 -0
- package/dist/features/state-manager/wal.d.ts.map +1 -0
- package/dist/features/state-manager/wal.js +75 -0
- package/dist/features/state-manager/wal.js.map +1 -0
- package/dist/features/task-templates/index.d.ts +13 -0
- package/dist/features/task-templates/index.d.ts.map +1 -0
- package/dist/features/task-templates/index.js +31 -0
- package/dist/features/task-templates/index.js.map +1 -0
- package/dist/features/task-templates/wizard-integration.d.ts +15 -0
- package/dist/features/task-templates/wizard-integration.d.ts.map +1 -0
- package/dist/features/task-templates/wizard-integration.js +27 -0
- package/dist/features/task-templates/wizard-integration.js.map +1 -0
- package/dist/features/wizard/__tests__/engine.test.d.ts +2 -0
- package/dist/features/wizard/__tests__/engine.test.d.ts.map +1 -0
- package/dist/features/wizard/__tests__/engine.test.js +78 -0
- package/dist/features/wizard/__tests__/engine.test.js.map +1 -0
- package/dist/features/wizard/__tests__/recommendation-engine.test.d.ts +2 -0
- package/dist/features/wizard/__tests__/recommendation-engine.test.d.ts.map +1 -0
- package/dist/features/wizard/__tests__/recommendation-engine.test.js +43 -0
- package/dist/features/wizard/__tests__/recommendation-engine.test.js.map +1 -0
- package/dist/features/wizard/engine.d.ts +15 -0
- package/dist/features/wizard/engine.d.ts.map +1 -0
- package/dist/features/wizard/engine.js +74 -0
- package/dist/features/wizard/engine.js.map +1 -0
- package/dist/features/wizard/index.d.ts +8 -0
- package/dist/features/wizard/index.d.ts.map +1 -0
- package/dist/features/wizard/index.js +7 -0
- package/dist/features/wizard/index.js.map +1 -0
- package/dist/features/wizard/questions.d.ts +6 -0
- package/dist/features/wizard/questions.d.ts.map +1 -0
- package/dist/features/wizard/questions.js +64 -0
- package/dist/features/wizard/questions.js.map +1 -0
- package/dist/features/wizard/recommendation-engine.d.ts +6 -0
- package/dist/features/wizard/recommendation-engine.d.ts.map +1 -0
- package/dist/features/wizard/recommendation-engine.js +33 -0
- package/dist/features/wizard/recommendation-engine.js.map +1 -0
- package/dist/features/wizard/types.d.ts +23 -0
- package/dist/features/wizard/types.d.ts.map +1 -0
- package/dist/features/wizard/types.js +5 -0
- package/dist/features/wizard/types.js.map +1 -0
- package/dist/features/workflow-recommender/context-analyzer.d.ts +6 -0
- package/dist/features/workflow-recommender/context-analyzer.d.ts.map +1 -0
- package/dist/features/workflow-recommender/context-analyzer.js +20 -0
- package/dist/features/workflow-recommender/context-analyzer.js.map +1 -0
- package/dist/features/workflow-recommender/index.d.ts +8 -0
- package/dist/features/workflow-recommender/index.d.ts.map +1 -0
- package/dist/features/workflow-recommender/index.js +7 -0
- package/dist/features/workflow-recommender/index.js.map +1 -0
- package/dist/features/workflow-recommender/intent-classifier.d.ts +6 -0
- package/dist/features/workflow-recommender/intent-classifier.d.ts.map +1 -0
- package/dist/features/workflow-recommender/intent-classifier.js +24 -0
- package/dist/features/workflow-recommender/intent-classifier.js.map +1 -0
- package/dist/features/workflow-recommender/recommendation-engine.d.ts +6 -0
- package/dist/features/workflow-recommender/recommendation-engine.d.ts.map +1 -0
- package/dist/features/workflow-recommender/recommendation-engine.js +110 -0
- package/dist/features/workflow-recommender/recommendation-engine.js.map +1 -0
- package/dist/features/workflow-recommender/types.d.ts +20 -0
- package/dist/features/workflow-recommender/types.d.ts.map +1 -0
- package/dist/features/workflow-recommender/types.js +5 -0
- package/dist/features/workflow-recommender/types.js.map +1 -0
- package/dist/hooks/__tests__/bridge-normalize.test.d.ts +2 -0
- package/dist/hooks/__tests__/bridge-normalize.test.d.ts.map +1 -0
- package/dist/hooks/__tests__/bridge-normalize.test.js +90 -0
- package/dist/hooks/__tests__/bridge-normalize.test.js.map +1 -0
- package/dist/hooks/__tests__/bridge-security.test.js +23 -41
- package/dist/hooks/__tests__/bridge-security.test.js.map +1 -1
- package/dist/hooks/auto-slash-command/__tests__/detector.test.d.ts +2 -0
- package/dist/hooks/auto-slash-command/__tests__/detector.test.d.ts.map +1 -0
- package/dist/hooks/auto-slash-command/__tests__/detector.test.js +70 -0
- package/dist/hooks/auto-slash-command/__tests__/detector.test.js.map +1 -0
- package/dist/hooks/auto-slash-command/__tests__/executor.test.d.ts +2 -0
- package/dist/hooks/auto-slash-command/__tests__/executor.test.d.ts.map +1 -0
- package/dist/hooks/auto-slash-command/__tests__/executor.test.js +55 -0
- package/dist/hooks/auto-slash-command/__tests__/executor.test.js.map +1 -0
- package/dist/hooks/auto-slash-command/__tests__/index.test.d.ts +2 -0
- package/dist/hooks/auto-slash-command/__tests__/index.test.d.ts.map +1 -0
- package/dist/hooks/auto-slash-command/__tests__/index.test.js +50 -0
- package/dist/hooks/auto-slash-command/__tests__/index.test.js.map +1 -0
- package/dist/hooks/autopilot/__tests__/prompts.test.js +19 -1
- package/dist/hooks/autopilot/__tests__/prompts.test.js.map +1 -1
- package/dist/hooks/autopilot/enforcement.d.ts +1 -1
- package/dist/hooks/autopilot/enforcement.d.ts.map +1 -1
- package/dist/hooks/autopilot/enforcement.js +1 -1
- package/dist/hooks/autopilot/enforcement.js.map +1 -1
- package/dist/hooks/bridge-normalize.d.ts +43 -3
- package/dist/hooks/bridge-normalize.d.ts.map +1 -1
- package/dist/hooks/bridge-normalize.js +110 -15
- package/dist/hooks/bridge-normalize.js.map +1 -1
- package/dist/hooks/bridge-types.d.ts +48 -0
- package/dist/hooks/bridge-types.d.ts.map +1 -0
- package/dist/hooks/bridge-types.js +6 -0
- package/dist/hooks/bridge-types.js.map +1 -0
- package/dist/hooks/bridge.d.ts +1 -43
- package/dist/hooks/bridge.d.ts.map +1 -1
- package/dist/hooks/bridge.js +18 -2
- package/dist/hooks/bridge.js.map +1 -1
- package/dist/hooks/dependency-analyzer.d.ts +32 -0
- package/dist/hooks/dependency-analyzer.d.ts.map +1 -0
- package/dist/hooks/dependency-analyzer.js +199 -0
- package/dist/hooks/dependency-analyzer.js.map +1 -0
- package/dist/hooks/index.d.ts +2 -1
- package/dist/hooks/index.d.ts.map +1 -1
- package/dist/hooks/index.js.map +1 -1
- package/dist/hooks/learner/__tests__/detector.test.d.ts +2 -0
- package/dist/hooks/learner/__tests__/detector.test.d.ts.map +1 -0
- package/dist/hooks/learner/__tests__/detector.test.js +170 -0
- package/dist/hooks/learner/__tests__/detector.test.js.map +1 -0
- package/dist/hooks/learner/__tests__/index.test.d.ts +2 -0
- package/dist/hooks/learner/__tests__/index.test.d.ts.map +1 -0
- package/dist/hooks/learner/__tests__/index.test.js +48 -0
- package/dist/hooks/learner/__tests__/index.test.js.map +1 -0
- package/dist/hooks/learner/__tests__/matcher.test.d.ts +2 -0
- package/dist/hooks/learner/__tests__/matcher.test.d.ts.map +1 -0
- package/dist/hooks/learner/__tests__/matcher.test.js +114 -0
- package/dist/hooks/learner/__tests__/matcher.test.js.map +1 -0
- package/dist/hooks/learner/__tests__/promotion.test.d.ts +2 -0
- package/dist/hooks/learner/__tests__/promotion.test.d.ts.map +1 -0
- package/dist/hooks/learner/__tests__/promotion.test.js +146 -0
- package/dist/hooks/learner/__tests__/promotion.test.js.map +1 -0
- package/dist/hooks/learner/__tests__/validator.test.d.ts +2 -0
- package/dist/hooks/learner/__tests__/validator.test.d.ts.map +1 -0
- package/dist/hooks/learner/__tests__/validator.test.js +123 -0
- package/dist/hooks/learner/__tests__/validator.test.js.map +1 -0
- package/dist/hooks/learner/__tests__/writer.test.d.ts +2 -0
- package/dist/hooks/learner/__tests__/writer.test.d.ts.map +1 -0
- package/dist/hooks/learner/__tests__/writer.test.js +141 -0
- package/dist/hooks/learner/__tests__/writer.test.js.map +1 -0
- package/dist/hooks/learner/detection-hook.js +2 -2
- package/dist/hooks/learner/detection-hook.js.map +1 -1
- package/dist/hooks/parallel-executor.d.ts +24 -0
- package/dist/hooks/parallel-executor.d.ts.map +1 -0
- package/dist/hooks/parallel-executor.js +82 -0
- package/dist/hooks/parallel-executor.js.map +1 -0
- package/dist/hooks/persistent-mode/index.d.ts +2 -21
- package/dist/hooks/persistent-mode/index.d.ts.map +1 -1
- package/dist/hooks/persistent-mode/index.js +4 -85
- package/dist/hooks/persistent-mode/index.js.map +1 -1
- package/dist/hooks/persistent-mode/tool-error.d.ts +15 -0
- package/dist/hooks/persistent-mode/tool-error.d.ts.map +1 -0
- package/dist/hooks/persistent-mode/tool-error.js +80 -0
- package/dist/hooks/persistent-mode/tool-error.js.map +1 -0
- package/dist/hooks/pre-compact/index.d.ts.map +1 -1
- package/dist/hooks/pre-compact/index.js +0 -1
- package/dist/hooks/pre-compact/index.js.map +1 -1
- package/dist/hooks/project-memory/learner.d.ts +13 -1
- package/dist/hooks/project-memory/learner.d.ts.map +1 -1
- package/dist/hooks/project-memory/learner.js +24 -12
- package/dist/hooks/project-memory/learner.js.map +1 -1
- package/dist/hooks/race-detector.d.ts +51 -0
- package/dist/hooks/race-detector.d.ts.map +1 -0
- package/dist/hooks/race-detector.js +121 -0
- package/dist/hooks/race-detector.js.map +1 -0
- package/dist/hooks/ralph/__tests__/loop.test.d.ts +2 -0
- package/dist/hooks/ralph/__tests__/loop.test.d.ts.map +1 -0
- package/dist/hooks/ralph/__tests__/loop.test.js +268 -0
- package/dist/hooks/ralph/__tests__/loop.test.js.map +1 -0
- package/dist/hooks/ralph/__tests__/prd.test.d.ts +2 -0
- package/dist/hooks/ralph/__tests__/prd.test.d.ts.map +1 -0
- package/dist/hooks/ralph/__tests__/prd.test.js +197 -0
- package/dist/hooks/ralph/__tests__/prd.test.js.map +1 -0
- package/dist/hooks/ralph/__tests__/progress.test.d.ts +2 -0
- package/dist/hooks/ralph/__tests__/progress.test.d.ts.map +1 -0
- package/dist/hooks/ralph/__tests__/progress.test.js +120 -0
- package/dist/hooks/ralph/__tests__/progress.test.js.map +1 -0
- package/dist/hooks/ralph/__tests__/verifier.test.d.ts +2 -0
- package/dist/hooks/ralph/__tests__/verifier.test.d.ts.map +1 -0
- package/dist/hooks/ralph/__tests__/verifier.test.js +75 -0
- package/dist/hooks/ralph/__tests__/verifier.test.js.map +1 -0
- package/dist/hooks/recovery/__tests__/context-window.test.d.ts +2 -0
- package/dist/hooks/recovery/__tests__/context-window.test.d.ts.map +1 -0
- package/dist/hooks/recovery/__tests__/context-window.test.js +131 -0
- package/dist/hooks/recovery/__tests__/context-window.test.js.map +1 -0
- package/dist/hooks/recovery/__tests__/edit-error.test.d.ts +2 -0
- package/dist/hooks/recovery/__tests__/edit-error.test.d.ts.map +1 -0
- package/dist/hooks/recovery/__tests__/edit-error.test.js +88 -0
- package/dist/hooks/recovery/__tests__/edit-error.test.js.map +1 -0
- package/dist/hooks/recovery/__tests__/index.test.d.ts +2 -0
- package/dist/hooks/recovery/__tests__/index.test.d.ts.map +1 -0
- package/dist/hooks/recovery/__tests__/index.test.js +270 -0
- package/dist/hooks/recovery/__tests__/index.test.js.map +1 -0
- package/dist/hooks/recovery/__tests__/session-recovery.test.d.ts +2 -0
- package/dist/hooks/recovery/__tests__/session-recovery.test.d.ts.map +1 -0
- package/dist/hooks/recovery/__tests__/session-recovery.test.js +129 -0
- package/dist/hooks/recovery/__tests__/session-recovery.test.js.map +1 -0
- package/dist/hooks/recovery/__tests__/storage.test.d.ts +2 -0
- package/dist/hooks/recovery/__tests__/storage.test.d.ts.map +1 -0
- package/dist/hooks/recovery/__tests__/storage.test.js +549 -0
- package/dist/hooks/recovery/__tests__/storage.test.js.map +1 -0
- package/dist/hooks/rules-injector/__tests__/finder.test.d.ts +2 -0
- package/dist/hooks/rules-injector/__tests__/finder.test.d.ts.map +1 -0
- package/dist/hooks/rules-injector/__tests__/finder.test.js +68 -0
- package/dist/hooks/rules-injector/__tests__/finder.test.js.map +1 -0
- package/dist/hooks/rules-injector/__tests__/index.test.d.ts +2 -0
- package/dist/hooks/rules-injector/__tests__/index.test.d.ts.map +1 -0
- package/dist/hooks/rules-injector/__tests__/index.test.js +58 -0
- package/dist/hooks/rules-injector/__tests__/index.test.js.map +1 -0
- package/dist/hooks/rules-injector/__tests__/matcher.test.d.ts +2 -0
- package/dist/hooks/rules-injector/__tests__/matcher.test.d.ts.map +1 -0
- package/dist/hooks/rules-injector/__tests__/matcher.test.js +86 -0
- package/dist/hooks/rules-injector/__tests__/matcher.test.js.map +1 -0
- package/dist/hooks/rules-injector/__tests__/parser.test.d.ts +2 -0
- package/dist/hooks/rules-injector/__tests__/parser.test.d.ts.map +1 -0
- package/dist/hooks/rules-injector/__tests__/parser.test.js +86 -0
- package/dist/hooks/rules-injector/__tests__/parser.test.js.map +1 -0
- package/dist/hooks/session-end/__tests__/index.test.d.ts +2 -0
- package/dist/hooks/session-end/__tests__/index.test.d.ts.map +1 -0
- package/dist/hooks/session-end/__tests__/index.test.js +77 -0
- package/dist/hooks/session-end/__tests__/index.test.js.map +1 -0
- package/dist/hooks/session-end/callbacks.d.ts +1 -1
- package/dist/hooks/session-end/index.d.ts +2 -21
- package/dist/hooks/session-end/index.d.ts.map +1 -1
- package/dist/hooks/session-end/index.js.map +1 -1
- package/dist/hooks/session-end/types.d.ts +26 -0
- package/dist/hooks/session-end/types.d.ts.map +1 -0
- package/dist/hooks/session-end/types.js +6 -0
- package/dist/hooks/session-end/types.js.map +1 -0
- package/dist/hooks/setup/__tests__/index.test.d.ts +2 -0
- package/dist/hooks/setup/__tests__/index.test.d.ts.map +1 -0
- package/dist/hooks/setup/__tests__/index.test.js +68 -0
- package/dist/hooks/setup/__tests__/index.test.js.map +1 -0
- package/dist/hooks/team-pipeline/__tests__/state.test.d.ts +2 -0
- package/dist/hooks/team-pipeline/__tests__/state.test.d.ts.map +1 -0
- package/dist/hooks/team-pipeline/__tests__/state.test.js +94 -0
- package/dist/hooks/team-pipeline/__tests__/state.test.js.map +1 -0
- package/dist/hud/elements/autopilot.d.ts +1 -1
- package/dist/hud/elements/autopilot.d.ts.map +1 -1
- package/dist/hud/state.d.ts.map +1 -1
- package/dist/hud/state.js +69 -1
- package/dist/hud/state.js.map +1 -1
- package/dist/hud/types.d.ts +2 -15
- package/dist/hud/types.d.ts.map +1 -1
- package/dist/hud/types.js.map +1 -1
- package/dist/lib/__tests__/validateMode.test.d.ts +2 -0
- package/dist/lib/__tests__/validateMode.test.d.ts.map +1 -0
- package/dist/lib/__tests__/validateMode.test.js +61 -0
- package/dist/lib/__tests__/validateMode.test.js.map +1 -0
- package/dist/lib/path-validator.d.ts +25 -0
- package/dist/lib/path-validator.d.ts.map +1 -0
- package/dist/lib/path-validator.js +81 -0
- package/dist/lib/path-validator.js.map +1 -0
- package/dist/lib/validateMode.d.ts +3 -0
- package/dist/lib/validateMode.d.ts.map +1 -1
- package/dist/lib/validateMode.js +28 -2
- package/dist/lib/validateMode.js.map +1 -1
- package/dist/mcp/__tests__/codex-core.test.d.ts +2 -0
- package/dist/mcp/__tests__/codex-core.test.d.ts.map +1 -0
- package/dist/mcp/__tests__/codex-core.test.js +143 -0
- package/dist/mcp/__tests__/codex-core.test.js.map +1 -0
- package/dist/mcp/__tests__/gemini-core.test.d.ts +2 -0
- package/dist/mcp/__tests__/gemini-core.test.d.ts.map +1 -0
- package/dist/mcp/__tests__/gemini-core.test.js +53 -0
- package/dist/mcp/__tests__/gemini-core.test.js.map +1 -0
- package/dist/mcp/__tests__/job-state-db-deprecation.test.js +48 -1
- package/dist/mcp/__tests__/job-state-db-deprecation.test.js.map +1 -1
- package/dist/mcp/__tests__/omc-tools-server.test.d.ts +2 -0
- package/dist/mcp/__tests__/omc-tools-server.test.d.ts.map +1 -0
- package/dist/mcp/__tests__/omc-tools-server.test.js +108 -0
- package/dist/mcp/__tests__/omc-tools-server.test.js.map +1 -0
- package/dist/mcp/job-state-db.d.ts +1 -1
- package/dist/mcp/job-state-db.d.ts.map +1 -1
- package/dist/mcp/prompt-persistence.d.ts +2 -17
- package/dist/mcp/prompt-persistence.d.ts.map +1 -1
- package/dist/mcp/prompt-persistence.js.map +1 -1
- package/dist/team/__tests__/deadlock-detector.test.d.ts +2 -0
- package/dist/team/__tests__/deadlock-detector.test.d.ts.map +1 -0
- package/dist/team/__tests__/deadlock-detector.test.js +50 -0
- package/dist/team/__tests__/deadlock-detector.test.js.map +1 -0
- package/dist/team/__tests__/dependency-graph.test.d.ts +2 -0
- package/dist/team/__tests__/dependency-graph.test.d.ts.map +1 -0
- package/dist/team/__tests__/dependency-graph.test.js +29 -0
- package/dist/team/__tests__/dependency-graph.test.js.map +1 -0
- package/dist/team/capabilities.d.ts +1 -2
- package/dist/team/capabilities.d.ts.map +1 -1
- package/dist/team/capabilities.js.map +1 -1
- package/dist/team/deadlock-detector.d.ts +16 -0
- package/dist/team/deadlock-detector.d.ts.map +1 -0
- package/dist/team/deadlock-detector.js +52 -0
- package/dist/team/deadlock-detector.js.map +1 -0
- package/dist/team/dependency-graph.d.ts +23 -0
- package/dist/team/dependency-graph.d.ts.map +1 -0
- package/dist/team/dependency-graph.js +35 -0
- package/dist/team/dependency-graph.js.map +1 -0
- package/dist/team/index.d.ts +3 -0
- package/dist/team/index.d.ts.map +1 -1
- package/dist/team/index.js +2 -0
- package/dist/team/index.js.map +1 -1
- package/dist/team/types.d.ts +15 -4
- package/dist/team/types.d.ts.map +1 -1
- package/dist/team/types.js +0 -1
- package/dist/team/types.js.map +1 -1
- package/dist/team/unified-team.d.ts +2 -11
- package/dist/team/unified-team.d.ts.map +1 -1
- package/dist/team/unified-team.js.map +1 -1
- package/dist/tools/__tests__/ast-tools.test.d.ts +2 -0
- package/dist/tools/__tests__/ast-tools.test.d.ts.map +1 -0
- package/dist/tools/__tests__/ast-tools.test.js +178 -0
- package/dist/tools/__tests__/ast-tools.test.js.map +1 -0
- package/dist/tools/__tests__/lsp-tools.test.d.ts +2 -0
- package/dist/tools/__tests__/lsp-tools.test.d.ts.map +1 -0
- package/dist/tools/__tests__/lsp-tools.test.js +252 -0
- package/dist/tools/__tests__/lsp-tools.test.js.map +1 -0
- package/dist/tools/diagnostics/__tests__/index.test.d.ts +2 -0
- package/dist/tools/diagnostics/__tests__/index.test.d.ts.map +1 -0
- package/dist/tools/diagnostics/__tests__/index.test.js +111 -0
- package/dist/tools/diagnostics/__tests__/index.test.js.map +1 -0
- package/dist/tools/diagnostics/__tests__/lsp-aggregator.test.d.ts +2 -0
- package/dist/tools/diagnostics/__tests__/lsp-aggregator.test.d.ts.map +1 -0
- package/dist/tools/diagnostics/__tests__/lsp-aggregator.test.js +120 -0
- package/dist/tools/diagnostics/__tests__/lsp-aggregator.test.js.map +1 -0
- package/dist/tools/diagnostics/__tests__/tsc-runner.test.d.ts +2 -0
- package/dist/tools/diagnostics/__tests__/tsc-runner.test.d.ts.map +1 -0
- package/dist/tools/diagnostics/__tests__/tsc-runner.test.js +86 -0
- package/dist/tools/diagnostics/__tests__/tsc-runner.test.js.map +1 -0
- package/dist/tools/diagnostics/constants.d.ts +5 -0
- package/dist/tools/diagnostics/constants.d.ts.map +1 -0
- package/dist/tools/diagnostics/constants.js +5 -0
- package/dist/tools/diagnostics/constants.js.map +1 -0
- package/dist/tools/diagnostics/index.d.ts +2 -1
- package/dist/tools/diagnostics/index.d.ts.map +1 -1
- package/dist/tools/diagnostics/index.js +2 -1
- package/dist/tools/diagnostics/index.js.map +1 -1
- package/dist/tools/diagnostics/lsp-aggregator.js +1 -1
- package/dist/tools/diagnostics/lsp-aggregator.js.map +1 -1
- package/dist/tools/lsp/__tests__/utils.test.d.ts +2 -0
- package/dist/tools/lsp/__tests__/utils.test.d.ts.map +1 -0
- package/dist/tools/lsp/__tests__/utils.test.js +338 -0
- package/dist/tools/lsp/__tests__/utils.test.js.map +1 -0
- package/dist/tools/lsp/utils.d.ts.map +1 -1
- package/dist/tools/lsp/utils.js +2 -2
- package/dist/tools/lsp/utils.js.map +1 -1
- package/dist/tools/python-repl/__tests__/bridge-manager.test.d.ts +2 -0
- package/dist/tools/python-repl/__tests__/bridge-manager.test.d.ts.map +1 -0
- package/dist/tools/python-repl/__tests__/bridge-manager.test.js +338 -0
- package/dist/tools/python-repl/__tests__/bridge-manager.test.js.map +1 -0
- package/dist/tools/python-repl/__tests__/socket-client.test.d.ts +2 -0
- package/dist/tools/python-repl/__tests__/socket-client.test.d.ts.map +1 -0
- package/dist/tools/python-repl/__tests__/socket-client.test.js +155 -0
- package/dist/tools/python-repl/__tests__/socket-client.test.js.map +1 -0
- package/dist/tools/python-repl/bridge-manager.d.ts +4 -0
- package/dist/tools/python-repl/bridge-manager.d.ts.map +1 -1
- package/dist/tools/python-repl/bridge-manager.js +4 -1
- package/dist/tools/python-repl/bridge-manager.js.map +1 -1
- package/docs/guides/task-templates-guide.md +153 -0
- package/docs/guides/troubleshooting-guide.md +110 -0
- package/docs/guides/wizard-user-guide.md +85 -0
- package/docs/guides/workflow-recommendation-guide.md +97 -0
- package/docs/reviews/ultrapower-security/review_critic.md +450 -0
- package/docs/reviews/ultrapower-tech-review/review_tech.md +180 -0
- package/docs/troubleshooting/agent-timeouts.md +37 -0
- package/docs/troubleshooting/common-errors.md +37 -0
- package/docs/troubleshooting/hook-failures.md +29 -0
- package/docs/troubleshooting/performance-issues.md +41 -0
- package/docs/troubleshooting/state-corruption.md +36 -0
- package/hooks/run-hook.cmd +0 -0
- package/hooks/session-start +0 -0
- package/package.json +1 -1
- package/scripts/analyze-dependencies.ts +47 -0
- package/scripts/analyze-hook-coverage.ts +55 -0
- package/scripts/performance-regression.ts +28 -0
- package/scripts/persistent-mode.cjs +605 -605
- package/scripts/profiling.ts +95 -0
- package/scripts/run-profiling.ts +64 -0
- package/scripts/test-parallel-execution.ts +72 -0
- package/scripts/test-race-detection.ts +57 -0
- package/scripts/test-tiered-writer.ts +60 -0
- package/scripts/test-wal-integration.ts +29 -0
- package/scripts/test-wal.ts +48 -0
- package/skills/next-step-router/SKILL.md +17 -0
- package/skills/systematic-debugging/find-polluter.sh +0 -0
- package/skills/wizard/SKILL.md +103 -72
- package/skills/writing-skills/graphviz-conventions.dot +171 -171
- package/skills/writing-skills/render-graphs.js +0 -0
- package/templates/axiom/scripts/Check-Memory.ps1 +68 -68
- package/templates/axiom/scripts/Poll-Memory.ps1 +36 -36
- package/templates/axiom/scripts/Watch-Memory.ps1 +149 -149
- package/templates/axiom/scripts/agent-runner.ps1 +101 -101
- package/templates/axiom/scripts/start-reviews.ps1 +19 -19
- package/templates/tasks/README.md +45 -0
- package/templates/tasks/bug-fix.md +37 -0
- package/templates/tasks/code-review.md +36 -0
- package/templates/tasks/feature-development.md +43 -0
- package/templates/tasks/refactoring.md +37 -0
- package/templates/tasks/security-audit.md +37 -0
package/bridge/mcp-server.cjs
CHANGED
|
@@ -2245,8 +2245,8 @@ var require_resolve = __commonJS({
|
|
|
2245
2245
|
}
|
|
2246
2246
|
return count;
|
|
2247
2247
|
}
|
|
2248
|
-
function getFullPath(resolver, id = "",
|
|
2249
|
-
if (
|
|
2248
|
+
function getFullPath(resolver, id = "", normalize3) {
|
|
2249
|
+
if (normalize3 !== false)
|
|
2250
2250
|
id = normalizeId(id);
|
|
2251
2251
|
const p = resolver.parse(id);
|
|
2252
2252
|
return _getFullPath(resolver, p);
|
|
@@ -3236,8 +3236,8 @@ var require_utils = __commonJS({
|
|
|
3236
3236
|
}
|
|
3237
3237
|
return ind;
|
|
3238
3238
|
}
|
|
3239
|
-
function removeDotSegments(
|
|
3240
|
-
let input =
|
|
3239
|
+
function removeDotSegments(path12) {
|
|
3240
|
+
let input = path12;
|
|
3241
3241
|
const output = [];
|
|
3242
3242
|
let nextSlash = -1;
|
|
3243
3243
|
let len = 0;
|
|
@@ -3436,8 +3436,8 @@ var require_schemes = __commonJS({
|
|
|
3436
3436
|
wsComponent.secure = void 0;
|
|
3437
3437
|
}
|
|
3438
3438
|
if (wsComponent.resourceName) {
|
|
3439
|
-
const [
|
|
3440
|
-
wsComponent.path =
|
|
3439
|
+
const [path12, query] = wsComponent.resourceName.split("?");
|
|
3440
|
+
wsComponent.path = path12 && path12 !== "/" ? path12 : void 0;
|
|
3441
3441
|
wsComponent.query = query;
|
|
3442
3442
|
wsComponent.resourceName = void 0;
|
|
3443
3443
|
}
|
|
@@ -3586,7 +3586,7 @@ var require_fast_uri = __commonJS({
|
|
|
3586
3586
|
"use strict";
|
|
3587
3587
|
var { normalizeIPv6, removeDotSegments, recomposeAuthority, normalizeComponentEncoding, isIPv4, nonSimpleDomain } = require_utils();
|
|
3588
3588
|
var { SCHEMES, getSchemeHandler } = require_schemes();
|
|
3589
|
-
function
|
|
3589
|
+
function normalize3(uri, options) {
|
|
3590
3590
|
if (typeof uri === "string") {
|
|
3591
3591
|
uri = /** @type {T} */
|
|
3592
3592
|
serialize(parse5(uri, options), options);
|
|
@@ -3822,7 +3822,7 @@ var require_fast_uri = __commonJS({
|
|
|
3822
3822
|
}
|
|
3823
3823
|
var fastUri = {
|
|
3824
3824
|
SCHEMES,
|
|
3825
|
-
normalize:
|
|
3825
|
+
normalize: normalize3,
|
|
3826
3826
|
resolve: resolve5,
|
|
3827
3827
|
resolveComponent,
|
|
3828
3828
|
equal,
|
|
@@ -6799,12 +6799,12 @@ var require_dist = __commonJS({
|
|
|
6799
6799
|
throw new Error(`Unknown format "${name}"`);
|
|
6800
6800
|
return f;
|
|
6801
6801
|
};
|
|
6802
|
-
function addFormats(ajv, list,
|
|
6802
|
+
function addFormats(ajv, list, fs10, exportName) {
|
|
6803
6803
|
var _a;
|
|
6804
6804
|
var _b;
|
|
6805
6805
|
(_a = (_b = ajv.opts.code).formats) !== null && _a !== void 0 ? _a : _b.formats = (0, codegen_1._)`require("ajv-formats/dist/formats").${exportName}`;
|
|
6806
6806
|
for (const f of list)
|
|
6807
|
-
ajv.addFormat(f,
|
|
6807
|
+
ajv.addFormat(f, fs10[f]);
|
|
6808
6808
|
}
|
|
6809
6809
|
module2.exports = exports2 = formatsPlugin;
|
|
6810
6810
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
@@ -7290,8 +7290,8 @@ function getErrorMap() {
|
|
|
7290
7290
|
|
|
7291
7291
|
// node_modules/zod/v3/helpers/parseUtil.js
|
|
7292
7292
|
var makeIssue = (params) => {
|
|
7293
|
-
const { data, path:
|
|
7294
|
-
const fullPath = [...
|
|
7293
|
+
const { data, path: path12, errorMaps, issueData } = params;
|
|
7294
|
+
const fullPath = [...path12, ...issueData.path || []];
|
|
7295
7295
|
const fullIssue = {
|
|
7296
7296
|
...issueData,
|
|
7297
7297
|
path: fullPath
|
|
@@ -7407,11 +7407,11 @@ var errorUtil;
|
|
|
7407
7407
|
|
|
7408
7408
|
// node_modules/zod/v3/types.js
|
|
7409
7409
|
var ParseInputLazyPath = class {
|
|
7410
|
-
constructor(parent, value,
|
|
7410
|
+
constructor(parent, value, path12, key) {
|
|
7411
7411
|
this._cachedPath = [];
|
|
7412
7412
|
this.parent = parent;
|
|
7413
7413
|
this.data = value;
|
|
7414
|
-
this._path =
|
|
7414
|
+
this._path = path12;
|
|
7415
7415
|
this._key = key;
|
|
7416
7416
|
}
|
|
7417
7417
|
get path() {
|
|
@@ -11048,15 +11048,15 @@ function assignProp(target, prop, value) {
|
|
|
11048
11048
|
configurable: true
|
|
11049
11049
|
});
|
|
11050
11050
|
}
|
|
11051
|
-
function getElementAtPath(obj,
|
|
11052
|
-
if (!
|
|
11051
|
+
function getElementAtPath(obj, path12) {
|
|
11052
|
+
if (!path12)
|
|
11053
11053
|
return obj;
|
|
11054
|
-
return
|
|
11054
|
+
return path12.reduce((acc, key) => acc?.[key], obj);
|
|
11055
11055
|
}
|
|
11056
11056
|
function promiseAllObject(promisesObj) {
|
|
11057
11057
|
const keys = Object.keys(promisesObj);
|
|
11058
|
-
const
|
|
11059
|
-
return Promise.all(
|
|
11058
|
+
const promises2 = keys.map((key) => promisesObj[key]);
|
|
11059
|
+
return Promise.all(promises2).then((results) => {
|
|
11060
11060
|
const resolvedObj = {};
|
|
11061
11061
|
for (let i = 0; i < keys.length; i++) {
|
|
11062
11062
|
resolvedObj[keys[i]] = results[i];
|
|
@@ -11371,11 +11371,11 @@ function aborted(x, startIndex = 0) {
|
|
|
11371
11371
|
}
|
|
11372
11372
|
return false;
|
|
11373
11373
|
}
|
|
11374
|
-
function prefixIssues(
|
|
11374
|
+
function prefixIssues(path12, issues) {
|
|
11375
11375
|
return issues.map((iss) => {
|
|
11376
11376
|
var _a;
|
|
11377
11377
|
(_a = iss).path ?? (_a.path = []);
|
|
11378
|
-
iss.path.unshift(
|
|
11378
|
+
iss.path.unshift(path12);
|
|
11379
11379
|
return iss;
|
|
11380
11380
|
});
|
|
11381
11381
|
}
|
|
@@ -18548,11 +18548,12 @@ function formatRange(range) {
|
|
|
18548
18548
|
function formatLocation(location) {
|
|
18549
18549
|
const uri = location.uri || location.targetUri;
|
|
18550
18550
|
if (!uri) return "Unknown location";
|
|
18551
|
-
const
|
|
18552
|
-
const
|
|
18553
|
-
|
|
18551
|
+
const path12 = uriToPath(uri);
|
|
18552
|
+
const loc = location;
|
|
18553
|
+
const locationRange = loc.range || loc.targetRange || loc.targetSelectionRange;
|
|
18554
|
+
if (!locationRange) return path12;
|
|
18554
18555
|
const range = formatRange(locationRange);
|
|
18555
|
-
return `${
|
|
18556
|
+
return `${path12}:${range}`;
|
|
18556
18557
|
}
|
|
18557
18558
|
function formatHover(hover) {
|
|
18558
18559
|
if (!hover) return "No hover information available";
|
|
@@ -18638,8 +18639,8 @@ function formatWorkspaceEdit(edit) {
|
|
|
18638
18639
|
const lines = [];
|
|
18639
18640
|
if (edit.changes) {
|
|
18640
18641
|
for (const [uri, changes] of Object.entries(edit.changes)) {
|
|
18641
|
-
const
|
|
18642
|
-
lines.push(`File: ${
|
|
18642
|
+
const path12 = uriToPath(uri);
|
|
18643
|
+
lines.push(`File: ${path12}`);
|
|
18643
18644
|
for (const change of changes) {
|
|
18644
18645
|
const range = formatRange(change.range);
|
|
18645
18646
|
const preview = change.newText.length > 50 ? change.newText.slice(0, 50) + "..." : change.newText;
|
|
@@ -18649,8 +18650,8 @@ function formatWorkspaceEdit(edit) {
|
|
|
18649
18650
|
}
|
|
18650
18651
|
if (edit.documentChanges) {
|
|
18651
18652
|
for (const docChange of edit.documentChanges) {
|
|
18652
|
-
const
|
|
18653
|
-
lines.push(`File: ${
|
|
18653
|
+
const path12 = uriToPath(docChange.textDocument.uri);
|
|
18654
|
+
lines.push(`File: ${path12}`);
|
|
18654
18655
|
for (const change of docChange.edits) {
|
|
18655
18656
|
const range = formatRange(change.range);
|
|
18656
18657
|
const preview = change.newText.length > 50 ? change.newText.slice(0, 50) + "..." : change.newText;
|
|
@@ -18738,6 +18739,11 @@ function parseTscOutput(output) {
|
|
|
18738
18739
|
// src/tools/diagnostics/lsp-aggregator.ts
|
|
18739
18740
|
var import_fs3 = require("fs");
|
|
18740
18741
|
var import_path4 = require("path");
|
|
18742
|
+
|
|
18743
|
+
// src/tools/diagnostics/constants.ts
|
|
18744
|
+
var LSP_DIAGNOSTICS_WAIT_MS = 300;
|
|
18745
|
+
|
|
18746
|
+
// src/tools/diagnostics/lsp-aggregator.ts
|
|
18741
18747
|
function findFiles(directory, extensions, ignoreDirs = []) {
|
|
18742
18748
|
const results = [];
|
|
18743
18749
|
const ignoreDirSet = new Set(ignoreDirs);
|
|
@@ -18803,7 +18809,6 @@ async function runLspAggregatedDiagnostics(directory, extensions = [".ts", ".tsx
|
|
|
18803
18809
|
}
|
|
18804
18810
|
|
|
18805
18811
|
// src/tools/diagnostics/index.ts
|
|
18806
|
-
var LSP_DIAGNOSTICS_WAIT_MS = 300;
|
|
18807
18812
|
async function runDirectoryDiagnostics(directory, strategy = "auto") {
|
|
18808
18813
|
const tsconfigPath = (0, import_path5.join)(directory, "tsconfig.json");
|
|
18809
18814
|
const hasTsconfig = (0, import_fs4.existsSync)(tsconfigPath);
|
|
@@ -19440,7 +19445,7 @@ Note: Patterns must be valid AST nodes for the language.`,
|
|
|
19440
19445
|
const {
|
|
19441
19446
|
pattern,
|
|
19442
19447
|
language,
|
|
19443
|
-
path:
|
|
19448
|
+
path: path12 = ".",
|
|
19444
19449
|
context = 2,
|
|
19445
19450
|
maxResults = 20
|
|
19446
19451
|
} = args;
|
|
@@ -19457,13 +19462,13 @@ Error: ${sgLoadError}`
|
|
|
19457
19462
|
]
|
|
19458
19463
|
};
|
|
19459
19464
|
}
|
|
19460
|
-
const files = getFilesForLanguage(
|
|
19465
|
+
const files = getFilesForLanguage(path12, language);
|
|
19461
19466
|
if (files.length === 0) {
|
|
19462
19467
|
return {
|
|
19463
19468
|
content: [
|
|
19464
19469
|
{
|
|
19465
19470
|
type: "text",
|
|
19466
|
-
text: `No ${language} files found in ${
|
|
19471
|
+
text: `No ${language} files found in ${path12}`
|
|
19467
19472
|
}
|
|
19468
19473
|
]
|
|
19469
19474
|
};
|
|
@@ -19503,7 +19508,7 @@ Error: ${sgLoadError}`
|
|
|
19503
19508
|
type: "text",
|
|
19504
19509
|
text: `No matches found for pattern: ${pattern}
|
|
19505
19510
|
|
|
19506
|
-
Searched ${files.length} ${language} file(s) in ${
|
|
19511
|
+
Searched ${files.length} ${language} file(s) in ${path12}
|
|
19507
19512
|
|
|
19508
19513
|
Tip: Ensure the pattern is a valid AST node. For example:
|
|
19509
19514
|
- Use "function $NAME" not just "$NAME"
|
|
@@ -19563,7 +19568,7 @@ IMPORTANT: dryRun=true (default) only previews changes. Set dryRun=false to appl
|
|
|
19563
19568
|
dryRun: external_exports.boolean().optional().describe("Preview only, don't apply changes (default: true)")
|
|
19564
19569
|
},
|
|
19565
19570
|
handler: async (args) => {
|
|
19566
|
-
const { pattern, replacement, language, path:
|
|
19571
|
+
const { pattern, replacement, language, path: path12 = ".", dryRun = true } = args;
|
|
19567
19572
|
try {
|
|
19568
19573
|
const sg = await getSgModule();
|
|
19569
19574
|
if (!sg) {
|
|
@@ -19577,13 +19582,13 @@ Error: ${sgLoadError}`
|
|
|
19577
19582
|
]
|
|
19578
19583
|
};
|
|
19579
19584
|
}
|
|
19580
|
-
const files = getFilesForLanguage(
|
|
19585
|
+
const files = getFilesForLanguage(path12, language);
|
|
19581
19586
|
if (files.length === 0) {
|
|
19582
19587
|
return {
|
|
19583
19588
|
content: [
|
|
19584
19589
|
{
|
|
19585
19590
|
type: "text",
|
|
19586
|
-
text: `No ${language} files found in ${
|
|
19591
|
+
text: `No ${language} files found in ${path12}`
|
|
19587
19592
|
}
|
|
19588
19593
|
]
|
|
19589
19594
|
};
|
|
@@ -19651,7 +19656,7 @@ Error: ${sgLoadError}`
|
|
|
19651
19656
|
type: "text",
|
|
19652
19657
|
text: `No matches found for pattern: ${pattern}
|
|
19653
19658
|
|
|
19654
|
-
Searched ${files.length} ${language} file(s) in ${
|
|
19659
|
+
Searched ${files.length} ${language} file(s) in ${path12}`
|
|
19655
19660
|
}
|
|
19656
19661
|
]
|
|
19657
19662
|
};
|
|
@@ -20566,6 +20571,9 @@ async function spawnBridgeServer(sessionId, projectDir) {
|
|
|
20566
20571
|
env: { ...process.env, PYTHONUNBUFFERED: "1" },
|
|
20567
20572
|
detached: true
|
|
20568
20573
|
});
|
|
20574
|
+
if (!proc.pid) {
|
|
20575
|
+
throw new Error("Failed to spawn bridge server: no PID assigned");
|
|
20576
|
+
}
|
|
20569
20577
|
proc.unref();
|
|
20570
20578
|
const MAX_STDERR_CHARS = 64 * 1024;
|
|
20571
20579
|
let stderrBuffer = "";
|
|
@@ -21513,6 +21521,84 @@ function getActiveSessionsForMode(mode, cwd) {
|
|
|
21513
21521
|
return sessionIds.filter((sid) => isJsonModeActive(cwd, mode, sid));
|
|
21514
21522
|
}
|
|
21515
21523
|
|
|
21524
|
+
// src/audit/logger.ts
|
|
21525
|
+
var import_crypto2 = require("crypto");
|
|
21526
|
+
var fs5 = __toESM(require("fs"), 1);
|
|
21527
|
+
var path6 = __toESM(require("path"), 1);
|
|
21528
|
+
var AuditLogger = class {
|
|
21529
|
+
logPath;
|
|
21530
|
+
secretKey;
|
|
21531
|
+
maxSize = 10 * 1024 * 1024;
|
|
21532
|
+
constructor(logDir) {
|
|
21533
|
+
this.logPath = path6.join(logDir, "audit.log");
|
|
21534
|
+
this.secretKey = this.deriveSecretKey();
|
|
21535
|
+
this.ensureLogDir(logDir);
|
|
21536
|
+
}
|
|
21537
|
+
deriveSecretKey() {
|
|
21538
|
+
const seed = process.env.OMC_AUDIT_SECRET || "default-seed";
|
|
21539
|
+
return Buffer.from((0, import_crypto2.createHmac)("sha256", "omc-audit").update(seed).digest("hex"));
|
|
21540
|
+
}
|
|
21541
|
+
sign(entry) {
|
|
21542
|
+
const payload = JSON.stringify(entry);
|
|
21543
|
+
return (0, import_crypto2.createHmac)("sha256", this.secretKey).update(payload).digest("hex");
|
|
21544
|
+
}
|
|
21545
|
+
async log(entry) {
|
|
21546
|
+
const fullEntry = {
|
|
21547
|
+
...entry,
|
|
21548
|
+
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
21549
|
+
};
|
|
21550
|
+
fullEntry.signature = this.sign(fullEntry);
|
|
21551
|
+
await this.appendLog(JSON.stringify(fullEntry) + "\n");
|
|
21552
|
+
await this.rotateIfNeeded();
|
|
21553
|
+
}
|
|
21554
|
+
async appendLog(line) {
|
|
21555
|
+
await fs5.promises.appendFile(this.logPath, line, "utf8");
|
|
21556
|
+
}
|
|
21557
|
+
async rotateIfNeeded() {
|
|
21558
|
+
try {
|
|
21559
|
+
const stats = await fs5.promises.stat(this.logPath);
|
|
21560
|
+
if (stats.size >= this.maxSize) {
|
|
21561
|
+
const rotatedPath = `${this.logPath}.${Date.now()}`;
|
|
21562
|
+
await fs5.promises.rename(this.logPath, rotatedPath);
|
|
21563
|
+
}
|
|
21564
|
+
} catch (err) {
|
|
21565
|
+
if (err.code !== "ENOENT") throw err;
|
|
21566
|
+
}
|
|
21567
|
+
}
|
|
21568
|
+
async verify() {
|
|
21569
|
+
try {
|
|
21570
|
+
const content = await fs5.promises.readFile(this.logPath, "utf8");
|
|
21571
|
+
const lines = content.split("\n").filter(Boolean);
|
|
21572
|
+
let valid = 0, invalid = 0;
|
|
21573
|
+
for (const line of lines) {
|
|
21574
|
+
const entry = JSON.parse(line);
|
|
21575
|
+
const { signature, ...payload } = entry;
|
|
21576
|
+
const expectedSig = this.sign(payload);
|
|
21577
|
+
if (signature === expectedSig) {
|
|
21578
|
+
valid++;
|
|
21579
|
+
} else {
|
|
21580
|
+
invalid++;
|
|
21581
|
+
console.error(`[audit] Invalid signature at ${entry.timestamp}`);
|
|
21582
|
+
}
|
|
21583
|
+
}
|
|
21584
|
+
return { valid, invalid };
|
|
21585
|
+
} catch (err) {
|
|
21586
|
+
if (err.code === "ENOENT") return { valid: 0, invalid: 0 };
|
|
21587
|
+
throw err;
|
|
21588
|
+
}
|
|
21589
|
+
}
|
|
21590
|
+
ensureLogDir(dir) {
|
|
21591
|
+
if (!fs5.existsSync(dir)) {
|
|
21592
|
+
fs5.mkdirSync(dir, { recursive: true });
|
|
21593
|
+
}
|
|
21594
|
+
}
|
|
21595
|
+
};
|
|
21596
|
+
var auditLogger = new AuditLogger(".omc/logs");
|
|
21597
|
+
|
|
21598
|
+
// src/lib/path-validator.ts
|
|
21599
|
+
var path7 = __toESM(require("path"), 1);
|
|
21600
|
+
var fs6 = __toESM(require("fs"), 1);
|
|
21601
|
+
|
|
21516
21602
|
// src/lib/validateMode.ts
|
|
21517
21603
|
var VALID_MODES = [
|
|
21518
21604
|
"autopilot",
|
|
@@ -21531,6 +21617,27 @@ function assertValidMode(mode) {
|
|
|
21531
21617
|
if (!validateMode(mode)) {
|
|
21532
21618
|
const raw = typeof mode === "string" ? mode : String(mode);
|
|
21533
21619
|
const display = raw.length > 50 ? `${raw.slice(0, 50)}...(truncated)` : raw;
|
|
21620
|
+
if (typeof mode === "string" && (mode.includes("..") || mode.includes("/") || mode.includes("\\") || mode.startsWith(".") || /^[a-zA-Z]:/.test(mode))) {
|
|
21621
|
+
auditLogger.log({
|
|
21622
|
+
actor: "system",
|
|
21623
|
+
action: "path_validation_failed",
|
|
21624
|
+
resource: display,
|
|
21625
|
+
result: "failure",
|
|
21626
|
+
metadata: { reason: "path_traversal_attempt" }
|
|
21627
|
+
}).catch(() => {
|
|
21628
|
+
});
|
|
21629
|
+
throw new Error(
|
|
21630
|
+
`Path traversal attempt detected: "${display}". Valid modes are: ${VALID_MODES.join(", ")}`
|
|
21631
|
+
);
|
|
21632
|
+
}
|
|
21633
|
+
auditLogger.log({
|
|
21634
|
+
actor: "system",
|
|
21635
|
+
action: "path_validation_failed",
|
|
21636
|
+
resource: display,
|
|
21637
|
+
result: "failure",
|
|
21638
|
+
metadata: { reason: "invalid_mode" }
|
|
21639
|
+
}).catch(() => {
|
|
21640
|
+
});
|
|
21534
21641
|
throw new Error(
|
|
21535
21642
|
`Invalid mode: "${display}". Valid modes are: ${VALID_MODES.join(", ")}`
|
|
21536
21643
|
);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent-wrapper.test.d.ts","sourceRoot":"","sources":["../../../src/agents/__tests__/agent-wrapper.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { describe, it, expect, vi } from 'vitest';
|
|
2
|
+
import { callAgentWithTimeout } from '../agent-wrapper.js';
|
|
3
|
+
describe('agent-wrapper', () => {
|
|
4
|
+
it('成功调用返回输出', async () => {
|
|
5
|
+
const agentFn = vi.fn().mockResolvedValue('success output');
|
|
6
|
+
const result = await callAgentWithTimeout(agentFn, {
|
|
7
|
+
agentType: 'executor',
|
|
8
|
+
prompt: 'test',
|
|
9
|
+
});
|
|
10
|
+
expect(result.success).toBe(true);
|
|
11
|
+
expect(result.output).toBe('success output');
|
|
12
|
+
expect(result.timedOut).toBeUndefined();
|
|
13
|
+
});
|
|
14
|
+
it('超时后返回错误', async () => {
|
|
15
|
+
const error = new Error('Aborted');
|
|
16
|
+
error.name = 'AbortError';
|
|
17
|
+
const agentFn = vi.fn().mockRejectedValue(error);
|
|
18
|
+
const result = await callAgentWithTimeout(agentFn, {
|
|
19
|
+
agentType: 'explore',
|
|
20
|
+
prompt: 'test',
|
|
21
|
+
maxRetries: 0,
|
|
22
|
+
});
|
|
23
|
+
expect(result.success).toBe(false);
|
|
24
|
+
expect(result.timedOut).toBe(true);
|
|
25
|
+
});
|
|
26
|
+
it('捕获其他错误', async () => {
|
|
27
|
+
const agentFn = vi.fn().mockRejectedValue(new Error('test error'));
|
|
28
|
+
const result = await callAgentWithTimeout(agentFn, {
|
|
29
|
+
agentType: 'executor',
|
|
30
|
+
prompt: 'test',
|
|
31
|
+
});
|
|
32
|
+
expect(result.success).toBe(false);
|
|
33
|
+
expect(result.error).toBe('test error');
|
|
34
|
+
expect(result.timedOut).toBeUndefined();
|
|
35
|
+
});
|
|
36
|
+
});
|
|
37
|
+
//# sourceMappingURL=agent-wrapper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MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QACnC,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACrC,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,QAAQ,EAAE,KAAK,IAAI,EAAE;QACtB,MAAM,OAAO,GAAG,EAAE,CAAC,EAAE,EAAE,CAAC,iBAAiB,CAAC,IAAI,KAAK,CAAC,YAAY,CAAC,CAAC,CAAC;QAEnE,MAAM,MAAM,GAAG,MAAM,oBAAoB,CAAC,OAAO,EAAE;YACjD,SAAS,EAAE,UAAU;YACrB,MAAM,EAAE,MAAM;SACf,CAAC,CAAC;QAEH,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QACnC,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;QACxC,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,aAAa,EAAE,CAAC;IAC1C,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"timeout-config.test.d.ts","sourceRoot":"","sources":["../../../src/agents/__tests__/timeout-config.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { describe, it, expect, beforeEach } from 'vitest';
|
|
2
|
+
import { getAgentTimeout } from '../timeout-config.js';
|
|
3
|
+
describe('timeout-config', () => {
|
|
4
|
+
beforeEach(() => {
|
|
5
|
+
delete process.env.OMC_AGENT_TIMEOUT;
|
|
6
|
+
});
|
|
7
|
+
describe('getAgentTimeout', () => {
|
|
8
|
+
it('返回 Agent 类型特定超时', () => {
|
|
9
|
+
expect(getAgentTimeout('explore')).toBe(60000);
|
|
10
|
+
expect(getAgentTimeout('executor')).toBe(600000);
|
|
11
|
+
expect(getAgentTimeout('deep-executor')).toBe(1800000);
|
|
12
|
+
});
|
|
13
|
+
it('返回模型特定超时', () => {
|
|
14
|
+
expect(getAgentTimeout('unknown', 'haiku')).toBe(120000);
|
|
15
|
+
expect(getAgentTimeout('unknown', 'sonnet')).toBe(600000);
|
|
16
|
+
expect(getAgentTimeout('unknown', 'opus')).toBe(1800000);
|
|
17
|
+
});
|
|
18
|
+
it('Agent 类型优先于模型', () => {
|
|
19
|
+
expect(getAgentTimeout('explore', 'opus')).toBe(60000);
|
|
20
|
+
});
|
|
21
|
+
it('返回默认超时', () => {
|
|
22
|
+
expect(getAgentTimeout('unknown')).toBe(300000);
|
|
23
|
+
});
|
|
24
|
+
it('环境变量覆盖所有配置', () => {
|
|
25
|
+
process.env.OMC_AGENT_TIMEOUT = '999999';
|
|
26
|
+
expect(getAgentTimeout('explore')).toBe(999999);
|
|
27
|
+
expect(getAgentTimeout('unknown', 'opus')).toBe(999999);
|
|
28
|
+
});
|
|
29
|
+
it('忽略无效环境变量', () => {
|
|
30
|
+
process.env.OMC_AGENT_TIMEOUT = 'invalid';
|
|
31
|
+
expect(getAgentTimeout('explore')).toBe(60000);
|
|
32
|
+
});
|
|
33
|
+
});
|
|
34
|
+
});
|
|
35
|
+
//# sourceMappingURL=timeout-config.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"timeout-config.test.js","sourceRoot":"","sources":["../../../src/agents/__tests__/timeout-config.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,UAAU,EAAM,MAAM,QAAQ,CAAC;AAC9D,OAAO,EAAE,eAAe,EAA0B,MAAM,sBAAsB,CAAC;AAE/E,QAAQ,CAAC,gBAAgB,EAAE,GAAG,EAAE;IAC9B,UAAU,CAAC,GAAG,EAAE;QACd,OAAO,OAAO,CAAC,GAAG,CAAC,iBAAiB,CAAC;IACvC,CAAC,CAAC,CAAC;IAEH,QAAQ,CAAC,iBAAiB,E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,EAAE,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QAC1D,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,UAAU,EAAE,GAAG,EAAE;YAClB,OAAO,CAAC,GAAG,CAAC,iBAAiB,GAAG,SAAS,CAAC;YAC1C,MAAM,CAAC,eAAe,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QACjD,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"timeout-manager.test.d.ts","sourceRoot":"","sources":["../../../src/agents/__tests__/timeout-manager.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { describe, it, expect, beforeEach, afterEach, vi } from 'vitest';
|
|
2
|
+
import { TimeoutManager } from '../timeout-manager.js';
|
|
3
|
+
describe('TimeoutManager', () => {
|
|
4
|
+
let manager;
|
|
5
|
+
beforeEach(() => {
|
|
6
|
+
manager = new TimeoutManager();
|
|
7
|
+
vi.useFakeTimers();
|
|
8
|
+
});
|
|
9
|
+
afterEach(() => {
|
|
10
|
+
vi.useRealTimers();
|
|
11
|
+
});
|
|
12
|
+
it('启动超时监控', () => {
|
|
13
|
+
const controller = manager.start('task-1', 'executor');
|
|
14
|
+
expect(controller).toBeInstanceOf(AbortController);
|
|
15
|
+
expect(controller.signal.aborted).toBe(false);
|
|
16
|
+
});
|
|
17
|
+
it('超时后中断信号', () => {
|
|
18
|
+
const controller = manager.start('task-1', 'explore'); // 60s timeout
|
|
19
|
+
vi.advanceTimersByTime(60000);
|
|
20
|
+
expect(controller.signal.aborted).toBe(true);
|
|
21
|
+
});
|
|
22
|
+
it('手动停止超时监控', () => {
|
|
23
|
+
const controller = manager.start('task-1', 'executor');
|
|
24
|
+
manager.stop('task-1');
|
|
25
|
+
vi.advanceTimersByTime(600000);
|
|
26
|
+
expect(controller.signal.aborted).toBe(false);
|
|
27
|
+
});
|
|
28
|
+
it('获取已运行时间', () => {
|
|
29
|
+
manager.start('task-1', 'executor');
|
|
30
|
+
vi.advanceTimersByTime(5000);
|
|
31
|
+
expect(manager.getElapsed('task-1')).toBe(5000);
|
|
32
|
+
});
|
|
33
|
+
it('未启动的任务返回 0', () => {
|
|
34
|
+
expect(manager.getElapsed('unknown')).toBe(0);
|
|
35
|
+
});
|
|
36
|
+
});
|
|
37
|
+
//# sourceMappingURL=timeout-manager.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"timeout-manager.test.js","sourceRoot":"","sources":["../../../src/agents/__tests__/timeout-manager.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,UAAU,EAAE,SAAS,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AACzE,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAEvD,QAAQ,CAAC,gBAAgB,EAAE,GAAG,EAAE;IAC9B,IAAI,OAAuB,CAAC;IAE5B,UAAU,CAAC,GAAG,EAAE;QACd,OAAO,GAAG,IAAI,cAAc,EAAE,CAAC;QAC/B,EAAE,CAAC,aAAa,EAAE,CAAC;IACrB,CAAC,CAAC,CAAC;IAEH,SAAS,CAAC,GAAG,EAAE;QACb,EAAE,CAAC,aAAa,EAAE,CAAC;IACrB,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,QAAQ,EAAE,GAAG,EAAE;QAChB,MAAM,UAAU,GAAG,OAAO,CAAC,KAAK,CAAC,QAAQ,EAAE,UAAU,CAAC,CAAC;QACvD,MAAM,CAAC,UAAU,CAAC,CAAC,cAAc,CAAC,eAAe,CAAC,CAAC;QACnD,MAAM,CAAC,UAAU,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAChD,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,S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{
|
|
6
|
+
agentType: string;
|
|
7
|
+
model?: string;
|
|
8
|
+
prompt: string;
|
|
9
|
+
maxRetries?: number;
|
|
10
|
+
}
|
|
11
|
+
export interface AgentCallResult {
|
|
12
|
+
success: boolean;
|
|
13
|
+
output?: string;
|
|
14
|
+
error?: string;
|
|
15
|
+
timedOut?: boolean;
|
|
16
|
+
retried?: boolean;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* 带超时保护的 Agent 调用
|
|
20
|
+
*/
|
|
21
|
+
export declare function callAgentWithTimeout(agentFn: (signal: AbortSignal) => Promise<string>, options: AgentCallOptions): Promise<AgentCallResult>;
|
|
22
|
+
//# sourceMappingURL=agent-wrapper.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent-wrapper.d.ts","sourceRoot":"","sources":["../../src/agents/agent-wrapper.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH,MAAM,WAAW,gBAAgB;IAC/B,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,eAAe;IAC9B,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED;;GAEG;AACH,wBAAsB,oBAAoB,CACxC,OAAO,EAAE,CAAC,MAAM,EAAE,WAAW,KAAK,OAAO,CAAC,MAAM,CAAC,EACjD,OAAO,EAAE,gBAAgB,GACxB,OAAO,CAAC,eAAe,CAAC,CA+C1B"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Agent 调用包装器
|
|
3
|
+
* 为 Agent 调用添加超时保护和降级策略
|
|
4
|
+
*/
|
|
5
|
+
import { timeoutManager } from './timeout-manager.js';
|
|
6
|
+
import { getAgentTimeout } from './timeout-config.js';
|
|
7
|
+
/**
|
|
8
|
+
* 带超时保护的 Agent 调用
|
|
9
|
+
*/
|
|
10
|
+
export async function callAgentWithTimeout(agentFn, options) {
|
|
11
|
+
const { agentType, model, maxRetries = 1 } = options;
|
|
12
|
+
const taskId = `${agentType}-${Date.now()}`;
|
|
13
|
+
let attempt = 0;
|
|
14
|
+
while (attempt <= maxRetries) {
|
|
15
|
+
const controller = timeoutManager.start(taskId, agentType, model);
|
|
16
|
+
try {
|
|
17
|
+
const output = await agentFn(controller.signal);
|
|
18
|
+
timeoutManager.stop(taskId);
|
|
19
|
+
return {
|
|
20
|
+
success: true,
|
|
21
|
+
output,
|
|
22
|
+
retried: attempt > 0,
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
catch (error) {
|
|
26
|
+
timeoutManager.stop(taskId);
|
|
27
|
+
if (error instanceof Error && error.name === 'AbortError') {
|
|
28
|
+
// 超时
|
|
29
|
+
if (attempt < maxRetries) {
|
|
30
|
+
attempt++;
|
|
31
|
+
continue;
|
|
32
|
+
}
|
|
33
|
+
return {
|
|
34
|
+
success: false,
|
|
35
|
+
error: `Agent timeout after ${getAgentTimeout(agentType, model)}ms`,
|
|
36
|
+
timedOut: true,
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
// 其他错误
|
|
40
|
+
return {
|
|
41
|
+
success: false,
|
|
42
|
+
error: error instanceof Error ? error.message : String(error),
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
return {
|
|
47
|
+
success: false,
|
|
48
|
+
error: 'Max retries exceeded',
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
//# sourceMappingURL=agent-wrapper.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent-wrapper.js","sourceRoot":"","sources":["../../src/agents/agent-wrapper.ts"],"names":[],"mappings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AAE,KAAK;gBACd,KAAK,EAAE,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC;aAC9D,CAAC;QACJ,CAAC;IACH,CAAC;IAED,OAAO;QACL,OAAO,EAAE,KAAK;QACd,KAAK,EAAE,sBAAsB;KAC9B,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Coordinator Agent - DEPRECATED
|
|
3
|
+
*
|
|
4
|
+
* This file provides deprecated stubs for backward compatibility.
|
|
5
|
+
* The coordinator agent was never registered in the runtime agent registry.
|
|
6
|
+
*
|
|
7
|
+
* @deprecated Will be removed in v4.0.0
|
|
8
|
+
*/
|
|
9
|
+
import type { AgentConfig, AgentPromptMetadata } from './types.js';
|
|
10
|
+
/**
|
|
11
|
+
* @deprecated Will be removed in v4.0.0. The coordinator was never a runtime agent.
|
|
12
|
+
*/
|
|
13
|
+
export declare const ORCHESTRATOR_SISYPHUS_PROMPT_METADATA: AgentPromptMetadata;
|
|
14
|
+
/**
|
|
15
|
+
* @deprecated Will be removed in v4.0.0. The coordinator was never a runtime agent.
|
|
16
|
+
*/
|
|
17
|
+
export declare const coordinatorAgent: AgentConfig;
|
|
18
|
+
//# sourceMappingURL=coordinator-deprecated.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"coordinator-deprecated.d.ts","sourceRoot":"","sources":["../../src/agents/coordinator-deprecated.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAYnE;;GAEG;AACH,eAAO,MAAM,qCAAqC,EAAE,mBAOnD,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,gBAAgB,EAAE,WAO9B,CAAC"}
|