@orion-agents/orion-code 0.1.1 → 0.1.3
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 +165 -68
- package/README.zh-CN.md +252 -212
- package/dist/cli.js +13 -17
- package/dist/cli.js.map +1 -1
- package/dist/commands/index.d.ts.map +1 -1
- package/dist/commands/index.js +381 -168
- package/dist/commands/index.js.map +1 -1
- package/dist/commands/target-command.d.ts.map +1 -1
- package/dist/commands/target-command.js +42 -8
- package/dist/commands/target-command.js.map +1 -1
- package/dist/commands/types.d.ts +3 -1
- package/dist/commands/types.d.ts.map +1 -1
- package/dist/commands/types.js.map +1 -1
- package/dist/core/agent.d.ts.map +1 -1
- package/dist/core/agent.js +2 -2
- package/dist/core/agent.js.map +1 -1
- package/dist/framework/external-assertion.d.ts +65 -0
- package/dist/framework/external-assertion.d.ts.map +1 -0
- package/dist/framework/external-assertion.js +571 -0
- package/dist/framework/external-assertion.js.map +1 -0
- package/dist/framework/index.d.ts +6 -4
- package/dist/framework/index.d.ts.map +1 -1
- package/dist/framework/index.js +4 -1
- package/dist/framework/index.js.map +1 -1
- package/dist/framework/query.d.ts +18 -1
- package/dist/framework/query.d.ts.map +1 -1
- package/dist/framework/query.js +43 -23
- package/dist/framework/query.js.map +1 -1
- package/dist/framework/tool-scheduler.d.ts +63 -1
- package/dist/framework/tool-scheduler.d.ts.map +1 -1
- package/dist/framework/tool-scheduler.js +183 -51
- package/dist/framework/tool-scheduler.js.map +1 -1
- package/dist/framework/tool-serializer.d.ts.map +1 -1
- package/dist/framework/tool-serializer.js +20 -4
- package/dist/framework/tool-serializer.js.map +1 -1
- package/dist/framework/tool.d.ts +17 -5
- package/dist/framework/tool.d.ts.map +1 -1
- package/dist/framework/tool.js +2 -0
- package/dist/framework/tool.js.map +1 -1
- package/dist/harness/safety.d.ts.map +1 -1
- package/dist/harness/safety.js +19 -3
- package/dist/harness/safety.js.map +1 -1
- package/dist/init.d.ts +1 -1
- package/dist/init.d.ts.map +1 -1
- package/dist/init.js +115 -34
- package/dist/init.js.map +1 -1
- package/dist/ink-ui/screens/ReplScreen.d.ts +2 -1
- package/dist/ink-ui/screens/ReplScreen.d.ts.map +1 -1
- package/dist/ink-ui/screens/ReplScreen.js +65 -0
- package/dist/ink-ui/screens/ReplScreen.js.map +1 -1
- package/dist/memory/storage.d.ts.map +1 -1
- package/dist/memory/storage.js +1 -0
- package/dist/memory/storage.js.map +1 -1
- package/dist/memory/store.d.ts.map +1 -1
- package/dist/memory/store.js +11 -5
- package/dist/memory/store.js.map +1 -1
- package/dist/print-ui/launch.d.ts +6 -1
- package/dist/print-ui/launch.d.ts.map +1 -1
- package/dist/print-ui/launch.js +109 -9
- package/dist/print-ui/launch.js.map +1 -1
- package/dist/product/identity.d.ts +2 -2
- package/dist/product/identity.d.ts.map +1 -1
- package/dist/product/identity.js +2 -2
- package/dist/product/identity.js.map +1 -1
- package/dist/product/index.d.ts +2 -1
- package/dist/product/index.d.ts.map +1 -1
- package/dist/product/index.js +5 -1
- package/dist/product/index.js.map +1 -1
- package/dist/product/version.d.ts +12 -0
- package/dist/product/version.d.ts.map +1 -0
- package/dist/product/version.js +31 -0
- package/dist/product/version.js.map +1 -0
- package/dist/runtime/agent-runtime-controller.d.ts +35 -0
- package/dist/runtime/agent-runtime-controller.d.ts.map +1 -1
- package/dist/runtime/agent-runtime-controller.js +975 -149
- package/dist/runtime/agent-runtime-controller.js.map +1 -1
- package/dist/runtime/agent-runtime-protocol.d.ts +20 -3
- package/dist/runtime/agent-runtime-protocol.d.ts.map +1 -1
- package/dist/runtime/agent-runtime-protocol.js +12 -0
- package/dist/runtime/agent-runtime-protocol.js.map +1 -1
- package/dist/runtime/chat-controller.d.ts +12 -0
- package/dist/runtime/chat-controller.d.ts.map +1 -1
- package/dist/runtime/chat-controller.js +213 -19
- package/dist/runtime/chat-controller.js.map +1 -1
- package/dist/runtime/goals/accounting.d.ts +28 -0
- package/dist/runtime/goals/accounting.d.ts.map +1 -1
- package/dist/runtime/goals/accounting.js +69 -0
- package/dist/runtime/goals/accounting.js.map +1 -1
- package/dist/runtime/goals/completion-audit.d.ts +13 -8
- package/dist/runtime/goals/completion-audit.d.ts.map +1 -1
- package/dist/runtime/goals/completion-audit.js +598 -16
- package/dist/runtime/goals/completion-audit.js.map +1 -1
- package/dist/runtime/goals/coordinator.d.ts +44 -5
- package/dist/runtime/goals/coordinator.d.ts.map +1 -1
- package/dist/runtime/goals/coordinator.js +1124 -58
- package/dist/runtime/goals/coordinator.js.map +1 -1
- package/dist/runtime/goals/evidence.d.ts +37 -0
- package/dist/runtime/goals/evidence.d.ts.map +1 -0
- package/dist/runtime/goals/evidence.js +300 -0
- package/dist/runtime/goals/evidence.js.map +1 -0
- package/dist/runtime/goals/presentation.d.ts +4 -0
- package/dist/runtime/goals/presentation.d.ts.map +1 -0
- package/dist/runtime/goals/presentation.js +50 -0
- package/dist/runtime/goals/presentation.js.map +1 -0
- package/dist/runtime/goals/prompt.d.ts.map +1 -1
- package/dist/runtime/goals/prompt.js +38 -8
- package/dist/runtime/goals/prompt.js.map +1 -1
- package/dist/runtime/goals/tools.d.ts +18 -1
- package/dist/runtime/goals/tools.d.ts.map +1 -1
- package/dist/runtime/goals/tools.js +310 -30
- package/dist/runtime/goals/tools.js.map +1 -1
- package/dist/runtime/goals/types.d.ts +247 -7
- package/dist/runtime/goals/types.d.ts.map +1 -1
- package/dist/runtime/goals/types.js +8 -2
- package/dist/runtime/goals/types.js.map +1 -1
- package/dist/runtime/subagents/child-executor-guard.d.ts +12 -4
- package/dist/runtime/subagents/child-executor-guard.d.ts.map +1 -1
- package/dist/runtime/subagents/child-executor-guard.js +397 -61
- package/dist/runtime/subagents/child-executor-guard.js.map +1 -1
- package/dist/runtime/subagents/presets.d.ts +4 -5
- package/dist/runtime/subagents/presets.d.ts.map +1 -1
- package/dist/runtime/subagents/presets.js +18 -33
- package/dist/runtime/subagents/presets.js.map +1 -1
- package/dist/runtime/subagents/production.d.ts +3 -1
- package/dist/runtime/subagents/production.d.ts.map +1 -1
- package/dist/runtime/subagents/production.js +37 -7
- package/dist/runtime/subagents/production.js.map +1 -1
- package/dist/runtime/subagents/runner.d.ts.map +1 -1
- package/dist/runtime/subagents/runner.js +24 -3
- package/dist/runtime/subagents/runner.js.map +1 -1
- package/dist/runtime/subagents/runtime-integration.d.ts +3 -0
- package/dist/runtime/subagents/runtime-integration.d.ts.map +1 -1
- package/dist/runtime/subagents/runtime-integration.js +18 -7
- package/dist/runtime/subagents/runtime-integration.js.map +1 -1
- package/dist/runtime/subagents/supervisor.d.ts +4 -4
- package/dist/runtime/subagents/supervisor.d.ts.map +1 -1
- package/dist/runtime/subagents/supervisor.js +39 -19
- package/dist/runtime/subagents/supervisor.js.map +1 -1
- package/dist/runtime/subagents/types.d.ts +7 -0
- package/dist/runtime/subagents/types.d.ts.map +1 -1
- package/dist/runtime/subagents/types.js +12 -1
- package/dist/runtime/subagents/types.js.map +1 -1
- package/dist/runtime/turn-controller.d.ts.map +1 -1
- package/dist/runtime/turn-controller.js +3 -1
- package/dist/runtime/turn-controller.js.map +1 -1
- package/dist/runtime/ui-events.d.ts +23 -0
- package/dist/runtime/ui-events.d.ts.map +1 -1
- package/dist/runtime/ui-events.js +5 -5
- package/dist/runtime/ui-events.js.map +1 -1
- package/dist/services/config.d.ts +1 -1
- package/dist/services/config.d.ts.map +1 -1
- package/dist/services/config.js +55 -49
- package/dist/services/config.js.map +1 -1
- package/dist/services/doctor.d.ts.map +1 -1
- package/dist/services/doctor.js +163 -17
- package/dist/services/doctor.js.map +1 -1
- package/dist/services/global-config.d.ts +31 -0
- package/dist/services/global-config.d.ts.map +1 -1
- package/dist/services/global-config.js.map +1 -1
- package/dist/services/goal-storage.d.ts +9 -4
- package/dist/services/goal-storage.d.ts.map +1 -1
- package/dist/services/goal-storage.js +1113 -75
- package/dist/services/goal-storage.js.map +1 -1
- package/dist/services/llm.d.ts +19 -0
- package/dist/services/llm.d.ts.map +1 -1
- package/dist/services/llm.js +153 -20
- package/dist/services/llm.js.map +1 -1
- package/dist/services/model-catalog.d.ts +2 -0
- package/dist/services/model-catalog.d.ts.map +1 -1
- package/dist/services/model-catalog.js +25 -15
- package/dist/services/model-catalog.js.map +1 -1
- package/dist/services/model-context.d.ts.map +1 -1
- package/dist/services/model-context.js +36 -0
- package/dist/services/model-context.js.map +1 -1
- package/dist/services/model-registry.d.ts +1 -1
- package/dist/services/model-registry.d.ts.map +1 -1
- package/dist/services/model-registry.js +101 -19
- package/dist/services/model-registry.js.map +1 -1
- package/dist/services/provider-resilience/coordinator.d.ts +2 -1
- package/dist/services/provider-resilience/coordinator.d.ts.map +1 -1
- package/dist/services/provider-resilience/coordinator.js +7 -6
- package/dist/services/provider-resilience/coordinator.js.map +1 -1
- package/dist/services/provider-resilience/error-classifier.d.ts.map +1 -1
- package/dist/services/provider-resilience/error-classifier.js +67 -17
- package/dist/services/provider-resilience/error-classifier.js.map +1 -1
- package/dist/services/provider-resilience/types.d.ts +1 -1
- package/dist/services/provider-resilience/types.d.ts.map +1 -1
- package/dist/services/provider-resilience/types.js.map +1 -1
- package/dist/services/redaction.d.ts.map +1 -1
- package/dist/services/redaction.js +9 -1
- package/dist/services/redaction.js.map +1 -1
- package/dist/services/session-storage.d.ts +12 -1
- package/dist/services/session-storage.d.ts.map +1 -1
- package/dist/services/session-storage.js +23 -7
- package/dist/services/session-storage.js.map +1 -1
- package/dist/services/storage-maintenance.d.ts +73 -3
- package/dist/services/storage-maintenance.d.ts.map +1 -1
- package/dist/services/storage-maintenance.js +771 -104
- package/dist/services/storage-maintenance.js.map +1 -1
- package/dist/services/task-manager.d.ts.map +1 -1
- package/dist/services/task-manager.js +2 -2
- package/dist/services/task-manager.js.map +1 -1
- package/dist/services/tool-allowlist.d.ts +100 -0
- package/dist/services/tool-allowlist.d.ts.map +1 -0
- package/dist/services/tool-allowlist.js +250 -0
- package/dist/services/tool-allowlist.js.map +1 -0
- package/dist/services/web-search-adapters.d.ts.map +1 -1
- package/dist/services/web-search-adapters.js +89 -49
- package/dist/services/web-search-adapters.js.map +1 -1
- package/dist/services/web-search-mcp.d.ts.map +1 -1
- package/dist/services/web-search-mcp.js +34 -37
- package/dist/services/web-search-mcp.js.map +1 -1
- package/dist/services/workspace-state.d.ts +4 -0
- package/dist/services/workspace-state.d.ts.map +1 -1
- package/dist/services/workspace-state.js +30 -9
- package/dist/services/workspace-state.js.map +1 -1
- package/dist/terminal-ui/launch.d.ts +24 -2
- package/dist/terminal-ui/launch.d.ts.map +1 -1
- package/dist/terminal-ui/launch.js +166 -8
- package/dist/terminal-ui/launch.js.map +1 -1
- package/dist/tools/git.d.ts +4 -0
- package/dist/tools/git.d.ts.map +1 -1
- package/dist/tools/git.js +585 -30
- package/dist/tools/git.js.map +1 -1
- package/dist/tools/index.d.ts.map +1 -1
- package/dist/tools/index.js +79 -11
- package/dist/tools/index.js.map +1 -1
- package/dist/tools/mcp.d.ts.map +1 -1
- package/dist/tools/mcp.js +20 -12
- package/dist/tools/mcp.js.map +1 -1
- package/dist/tools/sandbox.d.ts +139 -0
- package/dist/tools/sandbox.d.ts.map +1 -0
- package/dist/tools/sandbox.js +485 -0
- package/dist/tools/sandbox.js.map +1 -0
- package/dist/tools/web.d.ts.map +1 -1
- package/dist/tools/web.js +149 -54
- package/dist/tools/web.js.map +1 -1
- package/dist/tui-ui/launch.d.ts.map +1 -1
- package/dist/tui-ui/launch.js +46 -8
- package/dist/tui-ui/launch.js.map +1 -1
- package/dist/tui-ui/layout.d.ts.map +1 -1
- package/dist/tui-ui/layout.js +98 -23
- package/dist/tui-ui/layout.js.map +1 -1
- package/dist/tui-ui/pickers.d.ts.map +1 -1
- package/dist/tui-ui/pickers.js +4 -3
- package/dist/tui-ui/pickers.js.map +1 -1
- package/dist/tui-ui/runner.d.ts +7 -0
- package/dist/tui-ui/runner.d.ts.map +1 -1
- package/dist/tui-ui/runner.js +95 -1
- package/dist/tui-ui/runner.js.map +1 -1
- package/dist/tui-ui/state.d.ts +25 -1
- package/dist/tui-ui/state.d.ts.map +1 -1
- package/dist/tui-ui/state.js +95 -37
- package/dist/tui-ui/state.js.map +1 -1
- package/dist/tui-ui/terminal-image.d.ts +3 -13
- package/dist/tui-ui/terminal-image.d.ts.map +1 -1
- package/dist/tui-ui/terminal-image.js +5 -160
- package/dist/tui-ui/terminal-image.js.map +1 -1
- package/dist/utils/mask.d.ts +28 -0
- package/dist/utils/mask.d.ts.map +1 -0
- package/dist/utils/mask.js +54 -0
- package/dist/utils/mask.js.map +1 -0
- package/package.json +14 -9
- package/dist/core/state.d.ts +0 -94
- package/dist/core/state.d.ts.map +0 -1
- package/dist/core/state.js +0 -178
- package/dist/core/state.js.map +0 -1
- package/dist/ink/bidi.d.ts +0 -16
- package/dist/ink/bidi.d.ts.map +0 -1
- package/dist/ink/bidi.js +0 -124
- package/dist/ink/bidi.js.map +0 -1
- package/dist/ink/clearTerminal.d.ts +0 -14
- package/dist/ink/clearTerminal.d.ts.map +0 -1
- package/dist/ink/clearTerminal.js +0 -63
- package/dist/ink/clearTerminal.js.map +0 -1
- package/dist/ink/colorize.d.ts +0 -17
- package/dist/ink/colorize.d.ts.map +0 -1
- package/dist/ink/colorize.js +0 -208
- package/dist/ink/colorize.js.map +0 -1
- package/dist/ink/components/App.d.ts +0 -73
- package/dist/ink/components/App.d.ts.map +0 -1
- package/dist/ink/components/App.js +0 -646
- package/dist/ink/components/App.js.map +0 -1
- package/dist/ink/components/AppContext.d.ts +0 -12
- package/dist/ink/components/AppContext.d.ts.map +0 -1
- package/dist/ink/components/AppContext.js +0 -14
- package/dist/ink/components/AppContext.js.map +0 -1
- package/dist/ink/components/Box.d.ts +0 -44
- package/dist/ink/components/Box.d.ts.map +0 -1
- package/dist/ink/components/Box.js +0 -191
- package/dist/ink/components/Box.js.map +0 -1
- package/dist/ink/components/ClockContext.d.ts +0 -9
- package/dist/ink/components/ClockContext.d.ts.map +0 -1
- package/dist/ink/components/ClockContext.js +0 -146
- package/dist/ink/components/ClockContext.js.map +0 -1
- package/dist/ink/components/CursorDeclarationContext.d.ts +0 -23
- package/dist/ink/components/CursorDeclarationContext.d.ts.map +0 -1
- package/dist/ink/components/CursorDeclarationContext.js +0 -6
- package/dist/ink/components/CursorDeclarationContext.js.map +0 -1
- package/dist/ink/components/ErrorOverview.d.ts +0 -6
- package/dist/ink/components/ErrorOverview.d.ts.map +0 -1
- package/dist/ink/components/ErrorOverview.js +0 -27
- package/dist/ink/components/ErrorOverview.js.map +0 -1
- package/dist/ink/components/Newline.d.ts +0 -13
- package/dist/ink/components/Newline.d.ts.map +0 -1
- package/dist/ink/components/Newline.js +0 -36
- package/dist/ink/components/Newline.js.map +0 -1
- package/dist/ink/components/NoSelect.d.ts +0 -20
- package/dist/ink/components/NoSelect.d.ts.map +0 -1
- package/dist/ink/components/NoSelect.js +0 -63
- package/dist/ink/components/NoSelect.js.map +0 -1
- package/dist/ink/components/RawAnsi.d.ts +0 -17
- package/dist/ink/components/RawAnsi.d.ts.map +0 -1
- package/dist/ink/components/RawAnsi.js +0 -52
- package/dist/ink/components/RawAnsi.js.map +0 -1
- package/dist/ink/components/Spacer.d.ts +0 -6
- package/dist/ink/components/Spacer.d.ts.map +0 -1
- package/dist/ink/components/Spacer.js +0 -26
- package/dist/ink/components/Spacer.js.map +0 -1
- package/dist/ink/components/StdinContext.d.ts +0 -28
- package/dist/ink/components/StdinContext.d.ts.map +0 -1
- package/dist/ink/components/StdinContext.js +0 -19
- package/dist/ink/components/StdinContext.js.map +0 -1
- package/dist/ink/components/TerminalFocusContext.d.ts +0 -10
- package/dist/ink/components/TerminalFocusContext.d.ts.map +0 -1
- package/dist/ink/components/TerminalFocusContext.js +0 -81
- package/dist/ink/components/TerminalFocusContext.js.map +0 -1
- package/dist/ink/components/TerminalSizeContext.d.ts +0 -6
- package/dist/ink/components/TerminalSizeContext.d.ts.map +0 -1
- package/dist/ink/components/TerminalSizeContext.js +0 -6
- package/dist/ink/components/TerminalSizeContext.js.map +0 -1
- package/dist/ink/components/Text.d.ts +0 -56
- package/dist/ink/components/Text.d.ts.map +0 -1
- package/dist/ink/components/Text.js +0 -201
- package/dist/ink/components/Text.js.map +0 -1
- package/dist/ink/constants.d.ts +0 -2
- package/dist/ink/constants.d.ts.map +0 -1
- package/dist/ink/constants.js +0 -6
- package/dist/ink/constants.js.map +0 -1
- package/dist/ink/devtools.d.ts +0 -3
- package/dist/ink/devtools.d.ts.map +0 -1
- package/dist/ink/devtools.js +0 -5
- package/dist/ink/devtools.js.map +0 -1
- package/dist/ink/dom.d.ts +0 -77
- package/dist/ink/dom.d.ts.map +0 -1
- package/dist/ink/dom.js +0 -322
- package/dist/ink/dom.js.map +0 -1
- package/dist/ink/events/click-event.d.ts +0 -32
- package/dist/ink/events/click-event.d.ts.map +0 -1
- package/dist/ink/events/click-event.js +0 -30
- package/dist/ink/events/click-event.js.map +0 -1
- package/dist/ink/events/dispatcher.d.ts +0 -41
- package/dist/ink/events/dispatcher.d.ts.map +0 -1
- package/dist/ink/events/dispatcher.js +0 -181
- package/dist/ink/events/dispatcher.js.map +0 -1
- package/dist/ink/events/emitter.d.ts +0 -6
- package/dist/ink/events/emitter.d.ts.map +0 -1
- package/dist/ink/events/emitter.js +0 -36
- package/dist/ink/events/emitter.js.map +0 -1
- package/dist/ink/events/event-handlers.d.ts +0 -47
- package/dist/ink/events/event-handlers.d.ts.map +0 -1
- package/dist/ink/events/event-handlers.js +0 -34
- package/dist/ink/events/event-handlers.js.map +0 -1
- package/dist/ink/events/event.d.ts +0 -6
- package/dist/ink/events/event.d.ts.map +0 -1
- package/dist/ink/events/event.js +0 -16
- package/dist/ink/events/event.js.map +0 -1
- package/dist/ink/events/focus-event.d.ts +0 -14
- package/dist/ink/events/focus-event.d.ts.map +0 -1
- package/dist/ink/events/focus-event.js +0 -20
- package/dist/ink/events/focus-event.js.map +0 -1
- package/dist/ink/events/input-event.d.ts +0 -31
- package/dist/ink/events/input-event.d.ts.map +0 -1
- package/dist/ink/events/input-event.js +0 -163
- package/dist/ink/events/input-event.js.map +0 -1
- package/dist/ink/events/keyboard-event.d.ts +0 -20
- package/dist/ink/events/keyboard-event.d.ts.map +0 -1
- package/dist/ink/events/keyboard-event.js +0 -44
- package/dist/ink/events/keyboard-event.js.map +0 -1
- package/dist/ink/events/terminal-event.d.ts +0 -55
- package/dist/ink/events/terminal-event.d.ts.map +0 -1
- package/dist/ink/events/terminal-event.js +0 -79
- package/dist/ink/events/terminal-event.js.map +0 -1
- package/dist/ink/events/terminal-focus-event.d.ts +0 -14
- package/dist/ink/events/terminal-focus-event.d.ts.map +0 -1
- package/dist/ink/events/terminal-focus-event.js +0 -19
- package/dist/ink/events/terminal-focus-event.js.map +0 -1
- package/dist/ink/focus.d.ts +0 -44
- package/dist/ink/focus.d.ts.map +0 -1
- package/dist/ink/focus.js +0 -164
- package/dist/ink/focus.js.map +0 -1
- package/dist/ink/frame.d.ts +0 -95
- package/dist/ink/frame.d.ts.map +0 -1
- package/dist/ink/frame.js +0 -35
- package/dist/ink/frame.js.map +0 -1
- package/dist/ink/get-max-width.d.ts +0 -18
- package/dist/ink/get-max-width.d.ts.map +0 -1
- package/dist/ink/get-max-width.js +0 -26
- package/dist/ink/get-max-width.js.map +0 -1
- package/dist/ink/hit-test.d.ts +0 -34
- package/dist/ink/hit-test.d.ts.map +0 -1
- package/dist/ink/hit-test.js +0 -119
- package/dist/ink/hit-test.js.map +0 -1
- package/dist/ink/hooks/use-animation-frame.d.ts +0 -27
- package/dist/ink/hooks/use-animation-frame.d.ts.map +0 -1
- package/dist/ink/hooks/use-animation-frame.js +0 -52
- package/dist/ink/hooks/use-animation-frame.js.map +0 -1
- package/dist/ink/hooks/use-app.d.ts +0 -6
- package/dist/ink/hooks/use-app.d.ts.map +0 -1
- package/dist/ink/hooks/use-app.js +0 -13
- package/dist/ink/hooks/use-app.js.map +0 -1
- package/dist/ink/hooks/use-declared-cursor.d.ts +0 -27
- package/dist/ink/hooks/use-declared-cursor.d.ts.map +0 -1
- package/dist/ink/hooks/use-declared-cursor.js +0 -67
- package/dist/ink/hooks/use-declared-cursor.js.map +0 -1
- package/dist/ink/hooks/use-input.d.ts +0 -38
- package/dist/ink/hooks/use-input.d.ts.map +0 -1
- package/dist/ink/hooks/use-input.js +0 -86
- package/dist/ink/hooks/use-input.js.map +0 -1
- package/dist/ink/hooks/use-interval.d.ts +0 -19
- package/dist/ink/hooks/use-interval.d.ts.map +0 -1
- package/dist/ink/hooks/use-interval.js +0 -59
- package/dist/ink/hooks/use-interval.js.map +0 -1
- package/dist/ink/hooks/use-search-highlight.d.ts +0 -31
- package/dist/ink/hooks/use-search-highlight.d.ts.map +0 -1
- package/dist/ink/hooks/use-search-highlight.js +0 -39
- package/dist/ink/hooks/use-search-highlight.js.map +0 -1
- package/dist/ink/hooks/use-selection.d.ts +0 -40
- package/dist/ink/hooks/use-selection.d.ts.map +0 -1
- package/dist/ink/hooks/use-selection.js +0 -68
- package/dist/ink/hooks/use-selection.js.map +0 -1
- package/dist/ink/hooks/use-stdin.d.ts +0 -6
- package/dist/ink/hooks/use-stdin.d.ts.map +0 -1
- package/dist/ink/hooks/use-stdin.js +0 -13
- package/dist/ink/hooks/use-stdin.js.map +0 -1
- package/dist/ink/hooks/use-tab-status.d.ts +0 -14
- package/dist/ink/hooks/use-tab-status.d.ts.map +0 -1
- package/dist/ink/hooks/use-tab-status.js +0 -61
- package/dist/ink/hooks/use-tab-status.js.map +0 -1
- package/dist/ink/hooks/use-terminal-focus.d.ts +0 -11
- package/dist/ink/hooks/use-terminal-focus.d.ts.map +0 -1
- package/dist/ink/hooks/use-terminal-focus.js +0 -22
- package/dist/ink/hooks/use-terminal-focus.js.map +0 -1
- package/dist/ink/hooks/use-terminal-title.d.ts +0 -13
- package/dist/ink/hooks/use-terminal-title.d.ts.map +0 -1
- package/dist/ink/hooks/use-terminal-title.js +0 -36
- package/dist/ink/hooks/use-terminal-title.js.map +0 -1
- package/dist/ink/hooks/use-terminal-viewport.d.ts +0 -30
- package/dist/ink/hooks/use-terminal-viewport.d.ts.map +0 -1
- package/dist/ink/hooks/use-terminal-viewport.js +0 -81
- package/dist/ink/hooks/use-terminal-viewport.js.map +0 -1
- package/dist/ink/ink.d.ts +0 -371
- package/dist/ink/ink.d.ts.map +0 -1
- package/dist/ink/ink.js +0 -1686
- package/dist/ink/ink.js.map +0 -1
- package/dist/ink/instances.d.ts +0 -4
- package/dist/ink/instances.d.ts.map +0 -1
- package/dist/ink/instances.js +0 -10
- package/dist/ink/instances.js.map +0 -1
- package/dist/ink/line-width-cache.d.ts +0 -2
- package/dist/ink/line-width-cache.d.ts.map +0 -1
- package/dist/ink/line-width-cache.js +0 -23
- package/dist/ink/line-width-cache.js.map +0 -1
- package/dist/ink/log-update.d.ts +0 -18
- package/dist/ink/log-update.d.ts.map +0 -1
- package/dist/ink/log-update.js +0 -637
- package/dist/ink/log-update.js.map +0 -1
- package/dist/ink/measure-element.d.ts +0 -17
- package/dist/ink/measure-element.d.ts.map +0 -1
- package/dist/ink/measure-element.js +0 -11
- package/dist/ink/measure-element.js.map +0 -1
- package/dist/ink/measure-text.d.ts +0 -7
- package/dist/ink/measure-text.d.ts.map +0 -1
- package/dist/ink/measure-text.js +0 -38
- package/dist/ink/measure-text.js.map +0 -1
- package/dist/ink/node-cache.d.ts +0 -21
- package/dist/ink/node-cache.d.ts.map +0 -1
- package/dist/ink/node-cache.js +0 -36
- package/dist/ink/node-cache.js.map +0 -1
- package/dist/ink/optimizer.d.ts +0 -16
- package/dist/ink/optimizer.d.ts.map +0 -1
- package/dist/ink/optimizer.js +0 -85
- package/dist/ink/optimizer.js.map +0 -1
- package/dist/ink/output.d.ts +0 -120
- package/dist/ink/output.d.ts.map +0 -1
- package/dist/ink/output.js +0 -559
- package/dist/ink/output.js.map +0 -1
- package/dist/ink/parse-keypress.d.ts +0 -112
- package/dist/ink/parse-keypress.d.ts.map +0 -1
- package/dist/ink/parse-keypress.js +0 -719
- package/dist/ink/parse-keypress.js.map +0 -1
- package/dist/ink/parse-keypress.test.d.ts +0 -2
- package/dist/ink/parse-keypress.test.d.ts.map +0 -1
- package/dist/ink/parse-keypress.test.js +0 -37
- package/dist/ink/parse-keypress.test.js.map +0 -1
- package/dist/ink/reconciler.d.ts +0 -12
- package/dist/ink/reconciler.d.ts.map +0 -1
- package/dist/ink/reconciler.js +0 -456
- package/dist/ink/reconciler.js.map +0 -1
- package/dist/ink/render-border.d.ts +0 -25
- package/dist/ink/render-border.d.ts.map +0 -1
- package/dist/ink/render-border.js +0 -141
- package/dist/ink/render-border.js.map +0 -1
- package/dist/ink/render-node-to-output.d.ts +0 -46
- package/dist/ink/render-node-to-output.d.ts.map +0 -1
- package/dist/ink/render-node-to-output.js +0 -1257
- package/dist/ink/render-node-to-output.js.map +0 -1
- package/dist/ink/render-to-screen.d.ts +0 -47
- package/dist/ink/render-to-screen.d.ts.map +0 -1
- package/dist/ink/render-to-screen.js +0 -213
- package/dist/ink/render-to-screen.js.map +0 -1
- package/dist/ink/renderer.d.ts +0 -15
- package/dist/ink/renderer.d.ts.map +0 -1
- package/dist/ink/renderer.js +0 -169
- package/dist/ink/renderer.js.map +0 -1
- package/dist/ink/root.d.ts +0 -75
- package/dist/ink/root.d.ts.map +0 -1
- package/dist/ink/root.js +0 -89
- package/dist/ink/root.js.map +0 -1
- package/dist/ink/screen.d.ts +0 -270
- package/dist/ink/screen.d.ts.map +0 -1
- package/dist/ink/screen.js +0 -1194
- package/dist/ink/screen.js.map +0 -1
- package/dist/ink/searchHighlight.d.ts +0 -21
- package/dist/ink/searchHighlight.d.ts.map +0 -1
- package/dist/ink/searchHighlight.js +0 -82
- package/dist/ink/searchHighlight.js.map +0 -1
- package/dist/ink/selection.d.ts +0 -230
- package/dist/ink/selection.d.ts.map +0 -1
- package/dist/ink/selection.js +0 -814
- package/dist/ink/selection.js.map +0 -1
- package/dist/ink/squash-text-nodes.d.ts +0 -23
- package/dist/ink/squash-text-nodes.d.ts.map +0 -1
- package/dist/ink/squash-text-nodes.js +0 -60
- package/dist/ink/squash-text-nodes.js.map +0 -1
- package/dist/ink/stringWidth.d.ts +0 -2
- package/dist/ink/stringWidth.d.ts.map +0 -1
- package/dist/ink/stringWidth.js +0 -207
- package/dist/ink/stringWidth.js.map +0 -1
- package/dist/ink/styles.d.ts +0 -307
- package/dist/ink/styles.d.ts.map +0 -1
- package/dist/ink/styles.js +0 -302
- package/dist/ink/styles.js.map +0 -1
- package/dist/ink/supports-hyperlinks.d.ts +0 -14
- package/dist/ink/supports-hyperlinks.d.ts.map +0 -1
- package/dist/ink/supports-hyperlinks.js +0 -48
- package/dist/ink/supports-hyperlinks.js.map +0 -1
- package/dist/ink/tabstops.d.ts +0 -2
- package/dist/ink/tabstops.d.ts.map +0 -1
- package/dist/ink/tabstops.js +0 -43
- package/dist/ink/tabstops.js.map +0 -1
- package/dist/ink/terminal-focus-state.d.ts +0 -7
- package/dist/ink/terminal-focus-state.d.ts.map +0 -1
- package/dist/ink/terminal-focus-state.js +0 -43
- package/dist/ink/terminal-focus-state.js.map +0 -1
- package/dist/ink/terminal-querier.d.ts +0 -130
- package/dist/ink/terminal-querier.d.ts.map +0 -1
- package/dist/ink/terminal-querier.js +0 -184
- package/dist/ink/terminal-querier.js.map +0 -1
- package/dist/ink/terminal.d.ts +0 -56
- package/dist/ink/terminal.d.ts.map +0 -1
- package/dist/ink/terminal.js +0 -249
- package/dist/ink/terminal.js.map +0 -1
- package/dist/ink/termio/csi.d.ts +0 -166
- package/dist/ink/termio/csi.d.ts.map +0 -1
- package/dist/ink/termio/csi.js +0 -285
- package/dist/ink/termio/csi.js.map +0 -1
- package/dist/ink/termio/dec.d.ts +0 -38
- package/dist/ink/termio/dec.d.ts.map +0 -1
- package/dist/ink/termio/dec.js +0 -59
- package/dist/ink/termio/dec.js.map +0 -1
- package/dist/ink/termio.d.ts +0 -25
- package/dist/ink/termio.d.ts.map +0 -1
- package/dist/ink/termio.js +0 -32
- package/dist/ink/termio.js.map +0 -1
- package/dist/ink/useTerminalNotification.d.ts +0 -27
- package/dist/ink/useTerminalNotification.d.ts.map +0 -1
- package/dist/ink/useTerminalNotification.js +0 -62
- package/dist/ink/useTerminalNotification.js.map +0 -1
- package/dist/ink/warn.d.ts +0 -2
- package/dist/ink/warn.d.ts.map +0 -1
- package/dist/ink/warn.js +0 -14
- package/dist/ink/warn.js.map +0 -1
- package/dist/ink/widest-line.d.ts +0 -2
- package/dist/ink/widest-line.d.ts.map +0 -1
- package/dist/ink/widest-line.js +0 -18
- package/dist/ink/widest-line.js.map +0 -1
- package/dist/ink/wrap-text.d.ts +0 -3
- package/dist/ink/wrap-text.d.ts.map +0 -1
- package/dist/ink/wrap-text.js +0 -61
- package/dist/ink/wrap-text.js.map +0 -1
- package/dist/ink/wrapAnsi.d.ts +0 -8
- package/dist/ink/wrapAnsi.d.ts.map +0 -1
- package/dist/ink/wrapAnsi.js +0 -13
- package/dist/ink/wrapAnsi.js.map +0 -1
- package/dist/ink-ui/components/TerminalCursor.d.ts +0 -15
- package/dist/ink-ui/components/TerminalCursor.d.ts.map +0 -1
- package/dist/ink-ui/components/TerminalCursor.js +0 -49
- package/dist/ink-ui/components/TerminalCursor.js.map +0 -1
- package/dist/ink-ui/runtime/stdout.d.ts +0 -11
- package/dist/ink-ui/runtime/stdout.d.ts.map +0 -1
- package/dist/ink-ui/runtime/stdout.js +0 -82
- package/dist/ink-ui/runtime/stdout.js.map +0 -1
- package/dist/runtime/goal-coordinator.d.ts +0 -66
- package/dist/runtime/goal-coordinator.d.ts.map +0 -1
- package/dist/runtime/goal-coordinator.js +0 -200
- package/dist/runtime/goal-coordinator.js.map +0 -1
- package/dist/screens/REPL.d.ts +0 -21
- package/dist/screens/REPL.d.ts.map +0 -1
- package/dist/screens/REPL.js +0 -139
- package/dist/screens/REPL.js.map +0 -1
- package/dist/services/goal-sidecar.d.ts +0 -96
- package/dist/services/goal-sidecar.d.ts.map +0 -1
- package/dist/services/goal-sidecar.js +0 -145
- package/dist/services/goal-sidecar.js.map +0 -1
- package/dist/tools/goal.d.ts +0 -17
- package/dist/tools/goal.d.ts.map +0 -1
- package/dist/tools/goal.js +0 -191
- package/dist/tools/goal.js.map +0 -1
- package/dist/ui/ink/components/App.d.ts +0 -6
- package/dist/ui/ink/components/App.d.ts.map +0 -1
- package/dist/ui/ink/components/App.js +0 -38
- package/dist/ui/ink/components/App.js.map +0 -1
- package/dist/ui/ink/components/CommandPanel.d.ts +0 -13
- package/dist/ui/ink/components/CommandPanel.d.ts.map +0 -1
- package/dist/ui/ink/components/CommandPanel.js +0 -41
- package/dist/ui/ink/components/CommandPanel.js.map +0 -1
- package/dist/ui/ink/components/InputLine.d.ts +0 -8
- package/dist/ui/ink/components/InputLine.d.ts.map +0 -1
- package/dist/ui/ink/components/InputLine.js +0 -15
- package/dist/ui/ink/components/InputLine.js.map +0 -1
- package/dist/ui/ink/components/StatusBar.d.ts +0 -9
- package/dist/ui/ink/components/StatusBar.d.ts.map +0 -1
- package/dist/ui/ink/components/StatusBar.js +0 -18
- package/dist/ui/ink/components/StatusBar.js.map +0 -1
- package/dist/ui/ink/components/index.d.ts +0 -5
- package/dist/ui/ink/components/index.d.ts.map +0 -1
- package/dist/ui/ink/components/index.js +0 -5
- package/dist/ui/ink/components/index.js.map +0 -1
- package/dist/utils/chalk.d.ts +0 -9
- package/dist/utils/chalk.d.ts.map +0 -1
- package/dist/utils/chalk.js +0 -16
- package/dist/utils/chalk.js.map +0 -1
package/dist/commands/index.js
CHANGED
|
@@ -21,6 +21,7 @@ const ui_view_model_1 = require("../runtime/ui-view-model");
|
|
|
21
21
|
const task_manager_1 = require("../services/task-manager");
|
|
22
22
|
const agent_runner_1 = require("../services/agent-runner");
|
|
23
23
|
const config_1 = require("../services/config");
|
|
24
|
+
const tool_allowlist_1 = require("../services/tool-allowlist");
|
|
24
25
|
const box_1 = require("../ui/box");
|
|
25
26
|
const stream_markdown_1 = require("../ui/stream-markdown");
|
|
26
27
|
const progress_1 = require("../ui/progress");
|
|
@@ -40,7 +41,9 @@ const prompt_context_1 = require("../services/prompt-context");
|
|
|
40
41
|
const doctor_1 = require("../services/doctor");
|
|
41
42
|
const model_context_1 = require("../services/model-context");
|
|
42
43
|
const token_estimate_1 = require("../utils/token-estimate");
|
|
44
|
+
const mask_1 = require("../utils/mask");
|
|
43
45
|
const model_catalog_1 = require("../services/model-catalog");
|
|
46
|
+
const model_registry_1 = require("../services/model-registry");
|
|
44
47
|
const workspace_diff_1 = require("../services/workspace-diff");
|
|
45
48
|
const commit_plan_1 = require("../services/commit-plan");
|
|
46
49
|
const tool_artifacts_1 = require("../core/tool-artifacts");
|
|
@@ -107,8 +110,42 @@ function formatRendererStatus(ctx) {
|
|
|
107
110
|
: DIM('custom');
|
|
108
111
|
return `${BRAND(snapshot.renderer.name)} ${status} ${DIM(snapshot.renderer.capabilityLabels.join(', '))}`;
|
|
109
112
|
}
|
|
110
|
-
function
|
|
111
|
-
|
|
113
|
+
function getProfileByModelId(registry, modelId) {
|
|
114
|
+
if (!registry)
|
|
115
|
+
return undefined;
|
|
116
|
+
const normalized = modelId.trim();
|
|
117
|
+
if (!normalized)
|
|
118
|
+
return undefined;
|
|
119
|
+
if (registry.profiles.has(normalized))
|
|
120
|
+
return registry.profiles.get(normalized);
|
|
121
|
+
for (const profile of registry.profiles.values()) {
|
|
122
|
+
if (modelId === profile.model)
|
|
123
|
+
return profile;
|
|
124
|
+
}
|
|
125
|
+
return undefined;
|
|
126
|
+
}
|
|
127
|
+
function resolveModelFromRegistry(config, selector) {
|
|
128
|
+
if (!config.modelRegistry)
|
|
129
|
+
return undefined;
|
|
130
|
+
const trimmed = selector.trim();
|
|
131
|
+
if (!trimmed)
|
|
132
|
+
return undefined;
|
|
133
|
+
return (0, model_registry_1.lookupProfile)(config.modelRegistry, trimmed) ?? undefined;
|
|
134
|
+
}
|
|
135
|
+
function listConfiguredModelCatalogEntries(registry) {
|
|
136
|
+
if (!registry)
|
|
137
|
+
return [];
|
|
138
|
+
return registry.enabledProfiles.map(profile => {
|
|
139
|
+
const provider = registry.providers.get(profile.provider);
|
|
140
|
+
return {
|
|
141
|
+
name: profile.id,
|
|
142
|
+
alias: profile.aliases?.[0],
|
|
143
|
+
provider: provider?.displayName ?? profile.provider,
|
|
144
|
+
contextWindow: profile.resolvedContextWindow,
|
|
145
|
+
maxOutputTokens: profile.resolvedMaxOutputTokens,
|
|
146
|
+
source: `${profile.contextSource}/${profile.outputSource}`,
|
|
147
|
+
};
|
|
148
|
+
});
|
|
112
149
|
}
|
|
113
150
|
function formatLoopBudgetSource(stats) {
|
|
114
151
|
const source = stats.loopBudgetSource ?? 'unknown';
|
|
@@ -168,9 +205,9 @@ function formatLoopStatsLines(stats, detail = false) {
|
|
|
168
205
|
];
|
|
169
206
|
lines.push(`Verify ${verificationParts.join(' ')}`);
|
|
170
207
|
}
|
|
171
|
-
if (typeof stats.loopBudgetMaxLlmRequests === 'number'
|
|
172
|
-
|
|
173
|
-
|
|
208
|
+
if (typeof stats.loopBudgetMaxLlmRequests === 'number' ||
|
|
209
|
+
typeof stats.loopBudgetMaxToolCalls === 'number' ||
|
|
210
|
+
typeof stats.loopBudgetMaxModelVisibleBytes === 'number') {
|
|
174
211
|
const caps = [
|
|
175
212
|
typeof stats.loopBudgetMaxLlmRequests === 'number'
|
|
176
213
|
? `${stats.llmRequests}/${stats.loopBudgetMaxLlmRequests} LLM`
|
|
@@ -386,7 +423,9 @@ function formatTraceEventLine(event) {
|
|
|
386
423
|
event.providerLastRetryErrorType
|
|
387
424
|
? `last=${event.providerLastRetryErrorType}${event.providerLastRetryStatus ? `/${event.providerLastRetryStatus}` : ''}`
|
|
388
425
|
: '',
|
|
389
|
-
event.providerRetryErrorTypes?.length
|
|
426
|
+
event.providerRetryErrorTypes?.length
|
|
427
|
+
? `types=${event.providerRetryErrorTypes.join(',')}`
|
|
428
|
+
: '',
|
|
390
429
|
event.providerFinalModel ? `final=${event.providerFinalModel}` : '',
|
|
391
430
|
].filter(Boolean);
|
|
392
431
|
return `${prefix} ${parts.join(' ')}`;
|
|
@@ -394,7 +433,7 @@ function formatTraceEventLine(event) {
|
|
|
394
433
|
case 'provider_fallback': {
|
|
395
434
|
const path = event.providerFallbackFromModel && event.providerFallbackToModel
|
|
396
435
|
? `${event.providerFallbackFromModel}->${event.providerFallbackToModel}`
|
|
397
|
-
: event.providerFinalModel ?? 'active';
|
|
436
|
+
: (event.providerFinalModel ?? 'active');
|
|
398
437
|
const parts = [
|
|
399
438
|
`count=${event.providerFallbackCount ?? 0}`,
|
|
400
439
|
`path=${path}`,
|
|
@@ -464,13 +503,13 @@ function formatTraceEventLine(event) {
|
|
|
464
503
|
`llm=${typeof event.llmRequests === 'number' ? event.llmRequests : 'unknown'}`,
|
|
465
504
|
`tools=${typeof event.toolCalls === 'number' ? event.toolCalls : 'unknown'}`,
|
|
466
505
|
];
|
|
467
|
-
if (event.loopBudgetSource
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
506
|
+
if (event.loopBudgetSource ||
|
|
507
|
+
typeof event.loopBudgetMaxLlmRequests === 'number' ||
|
|
508
|
+
typeof event.loopBudgetMaxToolCalls === 'number' ||
|
|
509
|
+
typeof event.loopBudgetMaxModelVisibleBytes === 'number') {
|
|
471
510
|
const source = event.loopBudgetSource === 'config' && event.loopBudgetBaseProfile
|
|
472
511
|
? `config/${event.loopBudgetBaseProfile}`
|
|
473
|
-
: event.loopBudgetSource ?? 'unknown';
|
|
512
|
+
: (event.loopBudgetSource ?? 'unknown');
|
|
474
513
|
const caps = [
|
|
475
514
|
typeof event.loopBudgetMaxLlmRequests === 'number'
|
|
476
515
|
? `${typeof event.llmRequests === 'number' ? event.llmRequests : '?'}/${event.loopBudgetMaxLlmRequests}llm`
|
|
@@ -503,7 +542,9 @@ function formatTraceEventLine(event) {
|
|
|
503
542
|
case 'workspace_snapshot': {
|
|
504
543
|
const state = event.workspaceGitAvailable === false
|
|
505
544
|
? WARN('not-git')
|
|
506
|
-
: event.workspaceDirty
|
|
545
|
+
: event.workspaceDirty
|
|
546
|
+
? WARN('dirty')
|
|
547
|
+
: SUCCESS('clean');
|
|
507
548
|
const files = event.workspaceFiles?.length
|
|
508
549
|
? ` files=${event.workspaceFiles.slice(0, 6).join(', ')}${event.workspaceFiles.length > 6 ? ', ...' : ''}`
|
|
509
550
|
: '';
|
|
@@ -522,11 +563,21 @@ function formatTraceEventLine(event) {
|
|
|
522
563
|
`resolved=${resolved.length}`,
|
|
523
564
|
];
|
|
524
565
|
const details = [
|
|
525
|
-
added.length
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
566
|
+
added.length
|
|
567
|
+
? `new: ${added.slice(0, 6).join(', ')}${added.length > 6 ? ', ...' : ''}`
|
|
568
|
+
: '',
|
|
569
|
+
changed.length
|
|
570
|
+
? `changed: ${changed.slice(0, 6).join(', ')}${changed.length > 6 ? ', ...' : ''}`
|
|
571
|
+
: '',
|
|
572
|
+
modifiedPreExisting.length
|
|
573
|
+
? `pre-existing modified: ${modifiedPreExisting.slice(0, 6).join(', ')}${modifiedPreExisting.length > 6 ? ', ...' : ''}`
|
|
574
|
+
: '',
|
|
575
|
+
resolved.length
|
|
576
|
+
? `resolved: ${resolved.slice(0, 6).join(', ')}${resolved.length > 6 ? ', ...' : ''}`
|
|
577
|
+
: '',
|
|
578
|
+
]
|
|
579
|
+
.filter(Boolean)
|
|
580
|
+
.join(' | ');
|
|
530
581
|
return `${prefix} ${parts.join(' ')}${details ? ` ${DIM(details)}` : ''}${event.note ? ` ${DIM(event.note)}` : ''}`;
|
|
531
582
|
}
|
|
532
583
|
case 'verification_profile': {
|
|
@@ -617,7 +668,10 @@ function latestToolTrace(events) {
|
|
|
617
668
|
const call = event.type === 'tool_call'
|
|
618
669
|
? event
|
|
619
670
|
: callId
|
|
620
|
-
? events
|
|
671
|
+
? events
|
|
672
|
+
.slice(0, index)
|
|
673
|
+
.reverse()
|
|
674
|
+
.find(candidate => candidate.type === 'tool_call' && candidate.callId === callId)
|
|
621
675
|
: undefined;
|
|
622
676
|
return { call, result };
|
|
623
677
|
}
|
|
@@ -776,9 +830,7 @@ function handleLastTool(ctx, args = '') {
|
|
|
776
830
|
for (const pair of pairs.slice(-30)) {
|
|
777
831
|
const source = pair.result ?? pair.call;
|
|
778
832
|
const name = source?.name ?? 'tool';
|
|
779
|
-
const status = pair.result
|
|
780
|
-
? (pair.result.success === false ? '✗' : '✓')
|
|
781
|
-
: '…';
|
|
833
|
+
const status = pair.result ? (pair.result.success === false ? '✗' : '✓') : '…';
|
|
782
834
|
const duration = typeof pair.result?.duration === 'number'
|
|
783
835
|
? ` (${formatDurationMs(pair.result.duration)})`
|
|
784
836
|
: '';
|
|
@@ -796,7 +848,11 @@ function handleLastTool(ctx, args = '') {
|
|
|
796
848
|
const name = source?.name ?? 'tool';
|
|
797
849
|
const inputLabel = lastToolInputLabel(name);
|
|
798
850
|
const callId = source?.callId ?? call?.callId;
|
|
799
|
-
const status = result
|
|
851
|
+
const status = result
|
|
852
|
+
? result.success === false
|
|
853
|
+
? ERROR('error')
|
|
854
|
+
: SUCCESS('ok')
|
|
855
|
+
: WARN('running');
|
|
800
856
|
// Resolve sequence number from the trace events
|
|
801
857
|
let seqLabel = '';
|
|
802
858
|
if (options.ref && /^#?\d+$/.test(options.ref)) {
|
|
@@ -958,7 +1014,10 @@ function handleCheckpoint(ctx, args = '') {
|
|
|
958
1014
|
}
|
|
959
1015
|
for (const checkpoint of checkpoints.slice(0, 20)) {
|
|
960
1016
|
console.log(`${ACCENT(checkpoint.turnId)} ${DIM(formatDateTime(checkpoint.createdAt))}`);
|
|
961
|
-
const files = checkpoint.files
|
|
1017
|
+
const files = checkpoint.files
|
|
1018
|
+
.map(file => file.path)
|
|
1019
|
+
.slice(0, 8)
|
|
1020
|
+
.join(', ');
|
|
962
1021
|
console.log(` ${DIM(`${checkpoint.files.length} file(s)${files ? `: ${files}` : ''}`)}`);
|
|
963
1022
|
}
|
|
964
1023
|
console.log();
|
|
@@ -977,9 +1036,7 @@ function handleCheckpoint(ctx, args = '') {
|
|
|
977
1036
|
}
|
|
978
1037
|
const { checkpoint, ambiguous } = findCheckpointByRef(ctx, ref);
|
|
979
1038
|
if (!checkpoint) {
|
|
980
|
-
console.log(ERROR(ambiguous
|
|
981
|
-
? `Checkpoint prefix is ambiguous: ${ref}`
|
|
982
|
-
: `Checkpoint not found: ${ref}`));
|
|
1039
|
+
console.log(ERROR(ambiguous ? `Checkpoint prefix is ambiguous: ${ref}` : `Checkpoint not found: ${ref}`));
|
|
983
1040
|
console.log(DIM('Run /checkpoint to list available checkpoint ids.'));
|
|
984
1041
|
return { success: false };
|
|
985
1042
|
}
|
|
@@ -1299,19 +1356,35 @@ function showConfig(ctx) {
|
|
|
1299
1356
|
console.log();
|
|
1300
1357
|
console.log(HEADER('Configuration'));
|
|
1301
1358
|
console.log(DIM('─'.repeat(40)));
|
|
1359
|
+
const allowlist = (0, tool_allowlist_1.resolveProjectToolAllowlist)(ctx.cwd);
|
|
1360
|
+
const allowlistSummary = allowlist.rules.length === 0 && allowlist.invalid.length === 0
|
|
1361
|
+
? '(none)'
|
|
1362
|
+
: `${allowlist.rules.length} rule(s)` +
|
|
1363
|
+
(allowlist.invalid.length > 0 ? `, ${allowlist.invalid.length} invalid (ignored)` : '');
|
|
1302
1364
|
const summary = {
|
|
1303
1365
|
name: ctx.config.name,
|
|
1304
1366
|
model: ctx.config.model,
|
|
1305
1367
|
apiBaseUrl: ctx.config.apiBaseUrl || '(default OpenAI)',
|
|
1306
|
-
apiKey:
|
|
1368
|
+
apiKey: (0, mask_1.maskSecret)(ctx.config.apiKey),
|
|
1307
1369
|
mode: ctx.config.mode,
|
|
1308
1370
|
logLevel: ctx.config.logLevel,
|
|
1309
1371
|
toolConfirmation: ctx.config.toolConfirmation,
|
|
1372
|
+
allowedTools: allowlistSummary,
|
|
1310
1373
|
};
|
|
1311
1374
|
const llmSummary = ctx.llm?.getConfigSummary() ?? {};
|
|
1312
1375
|
for (const [key, val] of Object.entries(summary)) {
|
|
1313
1376
|
console.log(` ${ACCENT(key.padEnd(16))} ${DIM(val)}`);
|
|
1314
1377
|
}
|
|
1378
|
+
if (allowlist.rules.length > 0 || allowlist.invalid.length > 0) {
|
|
1379
|
+
console.log();
|
|
1380
|
+
console.log(HEADER(' Project allowedTools:'));
|
|
1381
|
+
for (const rule of allowlist.rules) {
|
|
1382
|
+
console.log(` ${ACCENT(rule.effect.padEnd(6))} ${DIM(rule.tool)}${DIM(rule.pattern ? `(${rule.pattern})` : '')}`);
|
|
1383
|
+
}
|
|
1384
|
+
for (const entry of allowlist.invalid) {
|
|
1385
|
+
console.log(` ${WARN('invalid')} ${DIM(entry)}`);
|
|
1386
|
+
}
|
|
1387
|
+
}
|
|
1315
1388
|
console.log();
|
|
1316
1389
|
console.log(HEADER(' LLM Settings:'));
|
|
1317
1390
|
for (const [key, val] of Object.entries(llmSummary)) {
|
|
@@ -1326,14 +1399,29 @@ function handleModel(ctx, args) {
|
|
|
1326
1399
|
if (!args || trimmedArgs === '?' || trimmedArgs === 'info') {
|
|
1327
1400
|
console.log();
|
|
1328
1401
|
if (ctx.llm) {
|
|
1329
|
-
const currentModel = ctx.llm.getModel();
|
|
1402
|
+
const currentModel = ctx.store.getSnapshot().currentModel || ctx.llm.getModel();
|
|
1403
|
+
const profile = getProfileByModelId(ctx.config.modelRegistry, currentModel);
|
|
1330
1404
|
const aliasEntry = (0, model_catalog_1.getModelCatalogEntry)(currentModel);
|
|
1331
|
-
const contextInfo =
|
|
1405
|
+
const contextInfo = profile
|
|
1406
|
+
? {
|
|
1407
|
+
id: profile.model,
|
|
1408
|
+
label: profile.displayName || profile.id,
|
|
1409
|
+
contextWindow: profile.resolvedContextWindow,
|
|
1410
|
+
maxOutputTokens: profile.resolvedMaxOutputTokens,
|
|
1411
|
+
source: 'config',
|
|
1412
|
+
matchedId: profile.model,
|
|
1413
|
+
}
|
|
1414
|
+
: (0, model_context_1.resolveModelContext)(currentModel);
|
|
1332
1415
|
const compactStats = getCommandAutoCompact(ctx, currentModel).getStats();
|
|
1333
1416
|
console.log(HEADER('Current Model'));
|
|
1334
1417
|
console.log(DIM('─'.repeat(40)));
|
|
1335
1418
|
console.log(` Model ${BRAND(currentModel)}`);
|
|
1336
|
-
if (
|
|
1419
|
+
if (profile) {
|
|
1420
|
+
console.log(` Alias ${ACCENT(profile.aliases?.[0] ? `(${profile.aliases[0]})` : 'none')}`);
|
|
1421
|
+
const provider = ctx.config.modelRegistry?.providers.get(profile.provider);
|
|
1422
|
+
console.log(` Provider ${DIM(provider?.displayName || profile.provider)}`);
|
|
1423
|
+
}
|
|
1424
|
+
else if (aliasEntry) {
|
|
1337
1425
|
console.log(` Alias ${ACCENT(aliasEntry.alias)}`);
|
|
1338
1426
|
console.log(` Provider ${DIM(aliasEntry.provider)}`);
|
|
1339
1427
|
}
|
|
@@ -1350,49 +1438,12 @@ function handleModel(ctx, args) {
|
|
|
1350
1438
|
console.log();
|
|
1351
1439
|
return { success: true };
|
|
1352
1440
|
}
|
|
1353
|
-
//
|
|
1354
|
-
if (trimmedArgs === 'list' || trimmedArgs === 'ls') {
|
|
1441
|
+
// /model list|ls|help 已移除,统一由 /models 承接(交互式选择切换)
|
|
1442
|
+
if (trimmedArgs === 'list' || trimmedArgs === 'ls' || trimmedArgs === 'help') {
|
|
1355
1443
|
console.log();
|
|
1356
|
-
console.log(
|
|
1357
|
-
console.log(DIM('
|
|
1358
|
-
|
|
1359
|
-
const modelPicker = (0, ui_view_model_1.createModelPickerState)({
|
|
1360
|
-
currentModel,
|
|
1361
|
-
models: (0, model_catalog_1.listModelCatalogEntries)().map(model => {
|
|
1362
|
-
const contextInfo = (0, model_context_1.resolveModelContext)(model.name);
|
|
1363
|
-
return {
|
|
1364
|
-
...model,
|
|
1365
|
-
contextWindow: contextInfo.contextWindow,
|
|
1366
|
-
maxOutputTokens: contextInfo.maxOutputTokens,
|
|
1367
|
-
source: contextInfo.source,
|
|
1368
|
-
};
|
|
1369
|
-
}),
|
|
1370
|
-
});
|
|
1371
|
-
for (const item of modelPicker.visibleItems) {
|
|
1372
|
-
const marker = item.isCurrent ? SUCCESS('●') : DIM('○');
|
|
1373
|
-
const alias = item.alias ? `(${item.alias})` : '';
|
|
1374
|
-
const context = `${formatTokenCount(item.contextWindow ?? 0)} ctx`;
|
|
1375
|
-
const current = item.isCurrent ? BRAND('(current)') : '';
|
|
1376
|
-
console.log(` ${marker} ${ACCENT(item.name)} ${DIM(alias)} ${DIM(context)} ${current}`);
|
|
1377
|
-
console.log(` ${DIM(item.provider ?? 'unknown')}`);
|
|
1378
|
-
}
|
|
1379
|
-
console.log();
|
|
1380
|
-
console.log(DIM('Use /model <name|alias> to switch, e.g. /model sonnet'));
|
|
1381
|
-
console.log();
|
|
1382
|
-
return { success: true };
|
|
1383
|
-
}
|
|
1384
|
-
// 显示帮助
|
|
1385
|
-
if (trimmedArgs === 'help') {
|
|
1386
|
-
console.log();
|
|
1387
|
-
console.log(HEADER('/model Command Help'));
|
|
1388
|
-
console.log(DIM('─'.repeat(40)));
|
|
1389
|
-
console.log();
|
|
1390
|
-
console.log(` ${ACCENT('/model')} Show current model`);
|
|
1391
|
-
console.log(` ${ACCENT('/model list')} Show available models`);
|
|
1392
|
-
console.log(` ${ACCENT('/model <name>')} Switch to specific model`);
|
|
1393
|
-
console.log(` ${ACCENT('/model <alias>')} Switch using alias (opus, sonnet, haiku)`);
|
|
1394
|
-
console.log();
|
|
1395
|
-
console.log(DIM(`Aliases: ${formatModelAliasHelp()}`));
|
|
1444
|
+
console.log(WARN(`/model ${trimmedArgs} was removed.`));
|
|
1445
|
+
console.log(DIM('Use /models to switch models interactively,'));
|
|
1446
|
+
console.log(DIM('or /model <name|alias> to switch directly, e.g. /model sonnet'));
|
|
1396
1447
|
console.log();
|
|
1397
1448
|
return { success: true };
|
|
1398
1449
|
}
|
|
@@ -1403,21 +1454,83 @@ function handleModel(ctx, args) {
|
|
|
1403
1454
|
return { success: false };
|
|
1404
1455
|
}
|
|
1405
1456
|
// 解析别名
|
|
1406
|
-
const
|
|
1457
|
+
const registryProfile = resolveModelFromRegistry(ctx.config, args);
|
|
1458
|
+
const resolvedModel = registryProfile ? registryProfile.model : (0, model_catalog_1.resolveModelAlias)(args);
|
|
1459
|
+
const resolvedProfileId = registryProfile ? registryProfile.id : resolvedModel;
|
|
1407
1460
|
ctx.llm.setModel(resolvedModel);
|
|
1408
1461
|
getCommandAutoCompact(ctx, resolvedModel);
|
|
1409
|
-
ctx.store.setState({ currentModel:
|
|
1410
|
-
console.log(SUCCESS(`✔ Model changed to ${BRAND(
|
|
1411
|
-
const contextInfo =
|
|
1462
|
+
ctx.store.setState({ currentModel: resolvedProfileId });
|
|
1463
|
+
console.log(SUCCESS(`✔ Model changed to ${BRAND(resolvedProfileId)}`));
|
|
1464
|
+
const contextInfo = registryProfile
|
|
1465
|
+
? {
|
|
1466
|
+
contextWindow: registryProfile.resolvedContextWindow,
|
|
1467
|
+
maxOutputTokens: registryProfile.resolvedMaxOutputTokens,
|
|
1468
|
+
source: 'resolved',
|
|
1469
|
+
}
|
|
1470
|
+
: (0, model_context_1.resolveModelContext)(resolvedModel);
|
|
1412
1471
|
console.log(DIM(` Context window ${formatTokenCount(contextInfo.contextWindow)} tokens (${contextInfo.source})`));
|
|
1413
1472
|
console.log();
|
|
1414
1473
|
return { success: true };
|
|
1415
1474
|
}
|
|
1475
|
+
/**
|
|
1476
|
+
* /models — 交互式选择切换模型。
|
|
1477
|
+
* 交互式渲染器返回结构化 modelPicker 请求(渲染器弹出选择层,选中即 /model <id>);
|
|
1478
|
+
* 非交互式渲染器直接打印候选列表并提示 /model <name|alias>。
|
|
1479
|
+
*/
|
|
1480
|
+
function handleModels(ctx, _args) {
|
|
1481
|
+
console.log();
|
|
1482
|
+
const currentModel = ctx.store.getSnapshot().currentModel || ctx.llm?.getModel() || '';
|
|
1483
|
+
const configuredModels = listConfiguredModelCatalogEntries(ctx.config.modelRegistry);
|
|
1484
|
+
const candidates = configuredModels.length > 0
|
|
1485
|
+
? configuredModels
|
|
1486
|
+
: (0, model_catalog_1.listModelCatalogEntries)().map(model => {
|
|
1487
|
+
const contextInfo = (0, model_context_1.resolveModelContext)(model.name);
|
|
1488
|
+
return {
|
|
1489
|
+
name: model.name,
|
|
1490
|
+
alias: model.alias,
|
|
1491
|
+
provider: model.provider,
|
|
1492
|
+
contextWindow: contextInfo.contextWindow,
|
|
1493
|
+
maxOutputTokens: contextInfo.maxOutputTokens,
|
|
1494
|
+
source: contextInfo.source,
|
|
1495
|
+
};
|
|
1496
|
+
});
|
|
1497
|
+
const ui = commandUICapabilities(ctx);
|
|
1498
|
+
if (ui.structuredPickers) {
|
|
1499
|
+
return {
|
|
1500
|
+
success: true,
|
|
1501
|
+
modelPicker: {
|
|
1502
|
+
models: candidates,
|
|
1503
|
+
currentModel,
|
|
1504
|
+
title: 'Switch Model',
|
|
1505
|
+
maxVisibleItems: 12,
|
|
1506
|
+
},
|
|
1507
|
+
};
|
|
1508
|
+
}
|
|
1509
|
+
// 非交互式渲染器:打印候选列表
|
|
1510
|
+
console.log(HEADER('Available Models'));
|
|
1511
|
+
console.log(DIM('─'.repeat(40)));
|
|
1512
|
+
const modelPicker = (0, ui_view_model_1.createModelPickerState)({ currentModel, models: candidates });
|
|
1513
|
+
for (const item of modelPicker.visibleItems) {
|
|
1514
|
+
const marker = item.isCurrent ? SUCCESS('●') : DIM('○');
|
|
1515
|
+
const alias = item.alias ? `(${item.alias})` : '';
|
|
1516
|
+
const context = `${formatTokenCount(item.contextWindow ?? 0)} ctx`;
|
|
1517
|
+
const current = item.isCurrent ? BRAND('(current)') : '';
|
|
1518
|
+
console.log(` ${marker} ${ACCENT(item.name)} ${DIM(alias)} ${DIM(context)} ${current}`);
|
|
1519
|
+
console.log(` ${DIM(item.provider ?? 'unknown')}`);
|
|
1520
|
+
}
|
|
1521
|
+
console.log();
|
|
1522
|
+
console.log(DIM('Use /model <name|alias> to switch, e.g. /model sonnet'));
|
|
1523
|
+
console.log();
|
|
1524
|
+
return { success: true };
|
|
1525
|
+
}
|
|
1416
1526
|
function normalizePermissionMode(raw) {
|
|
1417
1527
|
const value = raw.trim().toLowerCase();
|
|
1418
1528
|
if (!value)
|
|
1419
1529
|
return null;
|
|
1420
|
-
if (value === 'accept' ||
|
|
1530
|
+
if (value === 'accept' ||
|
|
1531
|
+
value === 'acceptedits' ||
|
|
1532
|
+
value === 'accept-edits' ||
|
|
1533
|
+
value === 'edit') {
|
|
1421
1534
|
return 'acceptEdits';
|
|
1422
1535
|
}
|
|
1423
1536
|
if (value === 'default' || value === 'ask')
|
|
@@ -1445,9 +1558,7 @@ function handleMode(ctx, args) {
|
|
|
1445
1558
|
console.log();
|
|
1446
1559
|
return { success: true };
|
|
1447
1560
|
}
|
|
1448
|
-
const next = trimmed === 'next'
|
|
1449
|
-
? (0, types_1.getNextPermissionMode)(current)
|
|
1450
|
-
: normalizePermissionMode(trimmed);
|
|
1561
|
+
const next = trimmed === 'next' ? (0, types_1.getNextPermissionMode)(current) : normalizePermissionMode(trimmed);
|
|
1451
1562
|
if (!next || !types_1.PERMISSION_MODES.includes(next)) {
|
|
1452
1563
|
return {
|
|
1453
1564
|
success: false,
|
|
@@ -1481,10 +1592,14 @@ function handleTask(ctx, args) {
|
|
|
1481
1592
|
if (tasks.length > 0) {
|
|
1482
1593
|
console.log();
|
|
1483
1594
|
for (const t of tasks) {
|
|
1484
|
-
const statusIcon = t.status === 'completed'
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
|
|
1595
|
+
const statusIcon = t.status === 'completed'
|
|
1596
|
+
? SUCCESS('✓')
|
|
1597
|
+
: t.status === 'failed'
|
|
1598
|
+
? ERROR('✗')
|
|
1599
|
+
: t.status === 'running'
|
|
1600
|
+
? WARN('◌')
|
|
1601
|
+
: t.status === 'cancelled'
|
|
1602
|
+
? DIM('⊘')
|
|
1488
1603
|
: DIM('○');
|
|
1489
1604
|
console.log(` ${statusIcon} ${ACCENT(t.name)} ${DIM(`(${t.id.slice(0, 8)})`)}`);
|
|
1490
1605
|
console.log(` ${DIM(`[${t.priority}]`)} ${t.description.slice(0, 60)}`);
|
|
@@ -1583,7 +1698,9 @@ async function handleChat(ctx, input) {
|
|
|
1583
1698
|
console.log();
|
|
1584
1699
|
return { success: false };
|
|
1585
1700
|
}
|
|
1586
|
-
const activeSession = ctx.getSession?.() ??
|
|
1701
|
+
const activeSession = ctx.getSession?.() ??
|
|
1702
|
+
ctx.ensureSession?.() ??
|
|
1703
|
+
(ctx.sessionId ? (0, session_storage_1.loadSessionMeta)(ctx.sessionId) : null);
|
|
1587
1704
|
const sessionId = activeSession?.id ?? ctx.sessionId;
|
|
1588
1705
|
const runtimeTools = (0, tools_1.getRuntimeTools)();
|
|
1589
1706
|
const skillResolution = (0, skills_1.resolveSkillsForTurn)({
|
|
@@ -1693,7 +1810,10 @@ async function handleChat(ctx, input) {
|
|
|
1693
1810
|
},
|
|
1694
1811
|
};
|
|
1695
1812
|
try {
|
|
1696
|
-
const messages = [
|
|
1813
|
+
const messages = [
|
|
1814
|
+
{ role: 'system', content: systemPrompt },
|
|
1815
|
+
...snapshot.conversationHistory,
|
|
1816
|
+
];
|
|
1697
1817
|
for await (const event of (0, framework_1.query)({
|
|
1698
1818
|
messages,
|
|
1699
1819
|
tools: skillResolution.tools,
|
|
@@ -1703,6 +1823,7 @@ async function handleChat(ctx, input) {
|
|
|
1703
1823
|
costTracker: snapshot.costTracker,
|
|
1704
1824
|
permissionMode: snapshot.permissionMode,
|
|
1705
1825
|
toolConfirmation: ctx.config.toolConfirmation,
|
|
1826
|
+
toolAllowlist: (0, tool_allowlist_1.resolveProjectToolAllowlist)(ctx.cwd).evaluator,
|
|
1706
1827
|
toolContext: {
|
|
1707
1828
|
cwd: ctx.cwd,
|
|
1708
1829
|
config: {
|
|
@@ -1839,7 +1960,9 @@ async function handleChat(ctx, input) {
|
|
|
1839
1960
|
const stats = [
|
|
1840
1961
|
finalUsage ? `tokens: ${finalUsage.promptTokens}+${finalUsage.completionTokens}` : '',
|
|
1841
1962
|
finalModel ? finalModel : '',
|
|
1842
|
-
]
|
|
1963
|
+
]
|
|
1964
|
+
.filter(Boolean)
|
|
1965
|
+
.join(' ');
|
|
1843
1966
|
if (stats) {
|
|
1844
1967
|
writeLine(DIM(stats));
|
|
1845
1968
|
}
|
|
@@ -1982,13 +2105,13 @@ function handleSkill(ctx, args) {
|
|
|
1982
2105
|
const registry = (0, skills_1.getSkillsRegistry)();
|
|
1983
2106
|
registry.initialize();
|
|
1984
2107
|
if (!trimmed) {
|
|
1985
|
-
const names = registry
|
|
2108
|
+
const names = registry
|
|
2109
|
+
.getAllSkills()
|
|
2110
|
+
.map(skill => skill.name)
|
|
2111
|
+
.sort();
|
|
1986
2112
|
return {
|
|
1987
2113
|
success: false,
|
|
1988
|
-
error: [
|
|
1989
|
-
'Usage: /skill <name> <task>',
|
|
1990
|
-
`Loaded skills: ${names.join(', ') || 'none'}`,
|
|
1991
|
-
].join('\n'),
|
|
2114
|
+
error: ['Usage: /skill <name> <task>', `Loaded skills: ${names.join(', ') || 'none'}`].join('\n'),
|
|
1992
2115
|
};
|
|
1993
2116
|
}
|
|
1994
2117
|
const parsed = (0, skills_1.parseSkillCommandInput)(`/skill ${trimmed}`);
|
|
@@ -2001,11 +2124,13 @@ function handleSkill(ctx, args) {
|
|
|
2001
2124
|
error: `Invalid skill reference: ${parsed.skillPath}`,
|
|
2002
2125
|
};
|
|
2003
2126
|
}
|
|
2004
|
-
const skill = referencedSkill ||
|
|
2005
|
-
|
|
2006
|
-
|
|
2127
|
+
const skill = referencedSkill ||
|
|
2128
|
+
registry
|
|
2129
|
+
.getAllSkills()
|
|
2130
|
+
.find(candidate => (0, skills_1.skillActivationNames)(candidate).some(name => (0, skills_1.normalizeRequestedSkillName)(name) === requestedName));
|
|
2007
2131
|
if (!skill) {
|
|
2008
|
-
const suggestions = registry
|
|
2132
|
+
const suggestions = registry
|
|
2133
|
+
.getAllSkills()
|
|
2009
2134
|
.map(candidate => candidate.name)
|
|
2010
2135
|
.filter(name => name.includes(requestedName) || requestedName.includes(name))
|
|
2011
2136
|
.slice(0, 5);
|
|
@@ -2035,7 +2160,9 @@ function handleSkill(ctx, args) {
|
|
|
2035
2160
|
skillFile ? `SKILL.md ${skillFile}` : '',
|
|
2036
2161
|
resourceRoot ? `Root ${resourceRoot}` : '',
|
|
2037
2162
|
`Use: /skill ${usageSelector} <task>`,
|
|
2038
|
-
]
|
|
2163
|
+
]
|
|
2164
|
+
.filter(Boolean)
|
|
2165
|
+
.join('\n'),
|
|
2039
2166
|
};
|
|
2040
2167
|
}
|
|
2041
2168
|
return {
|
|
@@ -2080,54 +2207,103 @@ function handleDoctor(ctx) {
|
|
|
2080
2207
|
return { success: !(0, doctor_1.hasDoctorFailures)(report) };
|
|
2081
2208
|
}
|
|
2082
2209
|
function handleStorage(_ctx, args) {
|
|
2210
|
+
const usage = '/storage [doctor|status|repair [--dry-run|--yes] [--plan=<token>]|cleanup [--dry-run|--yes] [--plan=<token>]]';
|
|
2083
2211
|
const trimmed = args.trim();
|
|
2084
|
-
const
|
|
2085
|
-
const
|
|
2212
|
+
const tokens = trimmed ? trimmed.split(/\s+/u) : [];
|
|
2213
|
+
const action = tokens[0] ?? 'doctor';
|
|
2214
|
+
const flags = tokens.slice(1);
|
|
2215
|
+
const acceptsMutationFlags = action === 'cleanup' || action === 'repair';
|
|
2216
|
+
const planFlags = flags.filter(flag => flag.startsWith('--plan='));
|
|
2217
|
+
const invalidTokens = flags.filter(flag => !acceptsMutationFlags ||
|
|
2218
|
+
(flag !== '--dry-run' && flag !== '--yes' && !flag.startsWith('--plan=')) ||
|
|
2219
|
+
(flag.startsWith('--plan=') && flag.length === '--plan='.length));
|
|
2220
|
+
if (planFlags.length > 1)
|
|
2221
|
+
invalidTokens.push(...planFlags.slice(1));
|
|
2222
|
+
if (invalidTokens.length > 0) {
|
|
2223
|
+
return {
|
|
2224
|
+
success: false,
|
|
2225
|
+
error: `Unknown /storage option: ${invalidTokens.join(', ')}. Usage: ${usage}`,
|
|
2226
|
+
};
|
|
2227
|
+
}
|
|
2228
|
+
const confirmed = flags.includes('--yes');
|
|
2229
|
+
const explicitDryRun = flags.includes('--dry-run');
|
|
2230
|
+
const planToken = planFlags[0]?.slice('--plan='.length);
|
|
2231
|
+
const decodedPlan = planToken ? (0, storage_maintenance_1.deserializeStorageMaintenancePlan)(planToken) : undefined;
|
|
2232
|
+
if (planToken && !decodedPlan) {
|
|
2233
|
+
return { success: false, error: `Invalid or corrupted storage plan token. Usage: ${usage}` };
|
|
2234
|
+
}
|
|
2086
2235
|
if (action === 'cleanup') {
|
|
2087
|
-
|
|
2088
|
-
|
|
2236
|
+
if (decodedPlan && decodedPlan.kind !== 'cleanup') {
|
|
2237
|
+
return { success: false, error: 'The supplied storage plan is not a cleanup plan.' };
|
|
2238
|
+
}
|
|
2239
|
+
const dryRun = explicitDryRun || !confirmed;
|
|
2240
|
+
if (!dryRun && !decodedPlan) {
|
|
2241
|
+
return {
|
|
2242
|
+
success: false,
|
|
2243
|
+
error: 'Cleanup requires the exact preview plan. Run /storage cleanup first.',
|
|
2244
|
+
};
|
|
2245
|
+
}
|
|
2246
|
+
const consumedPlan = !dryRun && planToken ? (0, storage_maintenance_1.consumeStorageMaintenancePlan)(planToken) : undefined;
|
|
2247
|
+
if (!dryRun && (!consumedPlan || consumedPlan.kind !== 'cleanup')) {
|
|
2248
|
+
return {
|
|
2249
|
+
success: false,
|
|
2250
|
+
error: 'The storage cleanup plan expired, was already used, or is not valid in this process.',
|
|
2251
|
+
};
|
|
2252
|
+
}
|
|
2253
|
+
const plan = dryRun
|
|
2254
|
+
? decodedPlan?.kind === 'cleanup'
|
|
2255
|
+
? decodedPlan.plan
|
|
2256
|
+
: (0, storage_maintenance_1.collectStorageCleanupPlan)()
|
|
2257
|
+
: consumedPlan
|
|
2258
|
+
.plan;
|
|
2259
|
+
const result = (0, storage_maintenance_1.cleanupStorage)({ dryRun }, plan);
|
|
2089
2260
|
console.log();
|
|
2090
2261
|
console.log((0, storage_maintenance_1.formatStorageCleanupResult)(result));
|
|
2091
|
-
if (
|
|
2092
|
-
|
|
2262
|
+
if (dryRun) {
|
|
2263
|
+
const portablePlan = planToken ?? (0, storage_maintenance_1.serializeStorageMaintenancePlan)({ kind: 'cleanup', plan });
|
|
2264
|
+
console.log(DIM(`Preview only. Run /storage cleanup --plan=${portablePlan} --yes to apply this plan.`));
|
|
2093
2265
|
}
|
|
2094
2266
|
console.log();
|
|
2095
2267
|
return { success: true };
|
|
2096
2268
|
}
|
|
2097
2269
|
if (action === 'repair') {
|
|
2098
|
-
if (
|
|
2099
|
-
|
|
2100
|
-
|
|
2270
|
+
if (decodedPlan && decodedPlan.kind !== 'repair') {
|
|
2271
|
+
return { success: false, error: 'The supplied storage plan is not a repair plan.' };
|
|
2272
|
+
}
|
|
2273
|
+
const plan = decodedPlan?.kind === 'repair' ? decodedPlan.plan : (0, storage_maintenance_1.collectProjectMetadataRepairPlan)();
|
|
2274
|
+
if (explicitDryRun || !confirmed) {
|
|
2101
2275
|
console.log();
|
|
2102
2276
|
console.log(HEADER('Orion Code Storage Repair Preview'));
|
|
2103
2277
|
console.log(DIM('─'.repeat(40)));
|
|
2104
|
-
console.log(` Repairable metadata entries ${ACCENT(String(
|
|
2105
|
-
for (const
|
|
2106
|
-
console.log(` ${DIM('•')} ${DIM(
|
|
2278
|
+
console.log(` Repairable metadata entries ${ACCENT(String(plan.actions.length))}`);
|
|
2279
|
+
for (const action of plan.actions.slice(0, 12)) {
|
|
2280
|
+
console.log(` ${DIM('•')} ${DIM(action.metadataPath)}`);
|
|
2107
2281
|
}
|
|
2108
|
-
|
|
2282
|
+
const portablePlan = planToken ?? (0, storage_maintenance_1.serializeStorageMaintenancePlan)({ kind: 'repair', plan });
|
|
2283
|
+
console.log(DIM(` Preview only. Writable repair is disabled; /storage repair --plan=${portablePlan} --yes will fail closed.`));
|
|
2109
2284
|
console.log();
|
|
2110
2285
|
return { success: true };
|
|
2111
2286
|
}
|
|
2112
|
-
|
|
2113
|
-
|
|
2114
|
-
|
|
2115
|
-
|
|
2116
|
-
|
|
2117
|
-
console.log(` Skipped ${DIM(String(result.skipped.length))}`);
|
|
2118
|
-
for (const project of result.repaired.slice(0, 12)) {
|
|
2119
|
-
console.log(` ${SUCCESS('✓')} ${DIM(project)}`);
|
|
2287
|
+
if (!decodedPlan) {
|
|
2288
|
+
return {
|
|
2289
|
+
success: false,
|
|
2290
|
+
error: 'Repair requires the exact preview plan. Run /storage repair first.',
|
|
2291
|
+
};
|
|
2120
2292
|
}
|
|
2121
|
-
|
|
2122
|
-
|
|
2293
|
+
const consumedPlan = planToken ? (0, storage_maintenance_1.consumeStorageMaintenancePlan)(planToken) : undefined;
|
|
2294
|
+
if (!consumedPlan || consumedPlan.kind !== 'repair') {
|
|
2295
|
+
return {
|
|
2296
|
+
success: false,
|
|
2297
|
+
error: 'The storage repair plan expired, was already used, or is not valid in this process.',
|
|
2298
|
+
};
|
|
2123
2299
|
}
|
|
2124
|
-
|
|
2125
|
-
return { success:
|
|
2300
|
+
const result = (0, storage_maintenance_1.repairProjectMetadata)(consumedPlan.plan);
|
|
2301
|
+
return { success: false, error: result.blockedReason };
|
|
2126
2302
|
}
|
|
2127
2303
|
if (action !== 'doctor' && action !== 'status') {
|
|
2128
2304
|
return {
|
|
2129
2305
|
success: false,
|
|
2130
|
-
error:
|
|
2306
|
+
error: `Usage: ${usage}`,
|
|
2131
2307
|
};
|
|
2132
2308
|
}
|
|
2133
2309
|
const report = (0, storage_maintenance_1.collectStorageReport)();
|
|
@@ -2155,9 +2331,7 @@ function handleCommitPlan(ctx, args) {
|
|
|
2155
2331
|
return { success: plan.diff.isGitRepo };
|
|
2156
2332
|
}
|
|
2157
2333
|
function handleTools(ctx) {
|
|
2158
|
-
const tools = ctx.store.getSnapshot().tools.length > 0
|
|
2159
|
-
? ctx.store.getSnapshot().tools
|
|
2160
|
-
: (0, tools_1.getRuntimeTools)();
|
|
2334
|
+
const tools = ctx.store.getSnapshot().tools.length > 0 ? ctx.store.getSnapshot().tools : (0, tools_1.getRuntimeTools)();
|
|
2161
2335
|
const staticTools = tools.filter(tool => !tool.name.startsWith('mcp__'));
|
|
2162
2336
|
const mcpTools = tools.filter(tool => tool.name.startsWith('mcp__'));
|
|
2163
2337
|
console.log();
|
|
@@ -2190,8 +2364,10 @@ function handleTodos(ctx) {
|
|
|
2190
2364
|
return { success: true };
|
|
2191
2365
|
}
|
|
2192
2366
|
for (const todo of todos) {
|
|
2193
|
-
const marker = todo.status === 'completed'
|
|
2194
|
-
|
|
2367
|
+
const marker = todo.status === 'completed'
|
|
2368
|
+
? SUCCESS('✓')
|
|
2369
|
+
: todo.status === 'in_progress'
|
|
2370
|
+
? WARN('›')
|
|
2195
2371
|
: DIM('○');
|
|
2196
2372
|
console.log(` ${marker} ${todo.content}`);
|
|
2197
2373
|
if (todo.activeForm && todo.activeForm !== todo.content) {
|
|
@@ -2250,13 +2426,14 @@ async function handleCompact(ctx, args) {
|
|
|
2250
2426
|
console.log(DIM((0, agent_status_1.compactStatus)()));
|
|
2251
2427
|
try {
|
|
2252
2428
|
const modelId = ctx.llm?.getModel() ?? ctx.store.getSnapshot().currentModel;
|
|
2253
|
-
const coordinator = ctx.compactCoordinator ??
|
|
2254
|
-
|
|
2255
|
-
|
|
2256
|
-
|
|
2257
|
-
|
|
2258
|
-
|
|
2259
|
-
|
|
2429
|
+
const coordinator = ctx.compactCoordinator ??
|
|
2430
|
+
new coordinator_1.CompactCoordinator({
|
|
2431
|
+
modelId,
|
|
2432
|
+
llm: ctx.llm,
|
|
2433
|
+
outputReserveTokens: ctx.llm?.getMaxTokens?.(),
|
|
2434
|
+
getContextCapsule: () => ctx.store.getSnapshot().harnessState?.capsule,
|
|
2435
|
+
getHarnessState: () => ctx.store.getSnapshot().harnessState,
|
|
2436
|
+
});
|
|
2260
2437
|
coordinator.configure({
|
|
2261
2438
|
modelId,
|
|
2262
2439
|
llm: ctx.llm,
|
|
@@ -2470,9 +2647,7 @@ function handleSessions(ctx, args = '') {
|
|
|
2470
2647
|
const query = scope.query?.trim();
|
|
2471
2648
|
// If there's a search query, use the session index
|
|
2472
2649
|
if (query && !query.startsWith('--')) {
|
|
2473
|
-
const allSessions = scope.allProjects
|
|
2474
|
-
? (0, session_storage_1.listSessions)()
|
|
2475
|
-
: (0, session_storage_1.listProjectSessions)(scope.projectPath);
|
|
2650
|
+
const allSessions = scope.allProjects ? (0, session_storage_1.listSessions)() : (0, session_storage_1.listProjectSessions)(scope.projectPath);
|
|
2476
2651
|
const matchedIds = (0, session_index_1.searchSessions)(query, allSessions.map(session => ({
|
|
2477
2652
|
id: session.id,
|
|
2478
2653
|
projectPath: session.projectPath,
|
|
@@ -2489,12 +2664,18 @@ function handleSessions(ctx, args = '') {
|
|
|
2489
2664
|
}
|
|
2490
2665
|
// Rebuild session list in matched order
|
|
2491
2666
|
const sessionMap = new Map(allSessions.map(s => [s.id, s]));
|
|
2492
|
-
const matchedSessions = matchedIds
|
|
2667
|
+
const matchedSessions = matchedIds
|
|
2668
|
+
.map(id => sessionMap.get(id))
|
|
2669
|
+
.filter(Boolean);
|
|
2493
2670
|
console.log();
|
|
2494
2671
|
console.log(HEADER(`Sessions (search: "${query}") — ${matchedSessions.length} matches`));
|
|
2495
2672
|
console.log(DIM('─'.repeat(40)));
|
|
2496
2673
|
console.log();
|
|
2497
|
-
printSessionRows(matchedSessions, {
|
|
2674
|
+
printSessionRows(matchedSessions, {
|
|
2675
|
+
indexed: true,
|
|
2676
|
+
showProject: scope.allProjects,
|
|
2677
|
+
showIndexSummary: true,
|
|
2678
|
+
});
|
|
2498
2679
|
console.log();
|
|
2499
2680
|
console.log(DIM(`Searched ${allSessions.length} sessions, found ${matchedSessions.length} matches`));
|
|
2500
2681
|
console.log(DIM('Use /resume <number|session-id|name> to restore a session'));
|
|
@@ -2525,8 +2706,7 @@ function handleResume(ctx, args) {
|
|
|
2525
2706
|
const ui = commandUICapabilities(ctx);
|
|
2526
2707
|
const scope = parseSessionScopeArgs(args, ctx.cwd);
|
|
2527
2708
|
const sessionRef = scope.query;
|
|
2528
|
-
const scopedSessions = (scope.allProjects ? (0, session_storage_1.listSessions)() : (0, session_storage_1.listProjectSessions)(scope.projectPath))
|
|
2529
|
-
.filter(session => (session.messageCount ?? 0) > 0);
|
|
2709
|
+
const scopedSessions = (scope.allProjects ? (0, session_storage_1.listSessions)() : (0, session_storage_1.listProjectSessions)(scope.projectPath)).filter(session => (session.messageCount ?? 0) > 0);
|
|
2530
2710
|
if (!sessionRef) {
|
|
2531
2711
|
const lastSession = scopedSessions[0];
|
|
2532
2712
|
if (!lastSession) {
|
|
@@ -2564,14 +2744,18 @@ function handleResume(ctx, args) {
|
|
|
2564
2744
|
return restoreSession(ctx, scopedSessions[pickerIndex], false);
|
|
2565
2745
|
}
|
|
2566
2746
|
// Resume specific session
|
|
2567
|
-
const result = (0, session_storage_1.lookupSessionRef)(sessionRef, scope.projectPath, {
|
|
2747
|
+
const result = (0, session_storage_1.lookupSessionRef)(sessionRef, scope.projectPath, {
|
|
2748
|
+
allProjects: scope.allProjects,
|
|
2749
|
+
});
|
|
2568
2750
|
if (result.status === 'ambiguous') {
|
|
2569
2751
|
printSessionConflict(sessionRef, result.matches);
|
|
2570
2752
|
return { success: false };
|
|
2571
2753
|
}
|
|
2572
2754
|
if (result.status === 'not_found') {
|
|
2573
2755
|
console.log(ERROR(`Session not found: ${sessionRef}`));
|
|
2574
|
-
console.log(DIM(scope.allProjects
|
|
2756
|
+
console.log(DIM(scope.allProjects
|
|
2757
|
+
? 'Use /sessions --all to list sessions'
|
|
2758
|
+
: 'Use /sessions to list project sessions, or /resume <id> --all'));
|
|
2575
2759
|
console.log();
|
|
2576
2760
|
return { success: false };
|
|
2577
2761
|
}
|
|
@@ -2596,7 +2780,9 @@ function restoreSession(ctx, session, isLast) {
|
|
|
2596
2780
|
if (history.length > 0) {
|
|
2597
2781
|
const eventSummary = checkpoint?.summary.text ?? generateRestoredSessionEventSummary(history);
|
|
2598
2782
|
ctx.store.setState({ conversationHistory: history });
|
|
2599
|
-
ctx.store.setState({
|
|
2783
|
+
ctx.store.setState({
|
|
2784
|
+
harnessState: (0, session_storage_1.loadSessionHarnessState)(resumed.id) ?? resumed.harnessState,
|
|
2785
|
+
});
|
|
2600
2786
|
(0, framework_1.resetToolState)();
|
|
2601
2787
|
ctx.sessionRestored?.({
|
|
2602
2788
|
sessionId: resumed.id,
|
|
@@ -2674,7 +2860,9 @@ function handleSessionRename(ctx, args) {
|
|
|
2674
2860
|
console.log();
|
|
2675
2861
|
return { success: false };
|
|
2676
2862
|
}
|
|
2677
|
-
const scopedSessions = scope.allProjects
|
|
2863
|
+
const scopedSessions = scope.allProjects
|
|
2864
|
+
? (0, session_storage_1.listSessions)()
|
|
2865
|
+
: (0, session_storage_1.listProjectSessions)(scope.projectPath);
|
|
2678
2866
|
const pickerIndex = parsePickerIndex(ref, scopedSessions.length);
|
|
2679
2867
|
let session = pickerIndex !== null ? scopedSessions[pickerIndex] : null;
|
|
2680
2868
|
if (!session) {
|
|
@@ -2685,7 +2873,9 @@ function handleSessionRename(ctx, args) {
|
|
|
2685
2873
|
}
|
|
2686
2874
|
if (result.status === 'not_found') {
|
|
2687
2875
|
console.log(ERROR(`Session not found: ${ref}`));
|
|
2688
|
-
console.log(DIM(scope.allProjects
|
|
2876
|
+
console.log(DIM(scope.allProjects
|
|
2877
|
+
? 'Use /sessions --all to list sessions'
|
|
2878
|
+
: 'Use /sessions to list project sessions'));
|
|
2689
2879
|
console.log();
|
|
2690
2880
|
return { success: false };
|
|
2691
2881
|
}
|
|
@@ -2844,7 +3034,7 @@ const COMMANDS = [
|
|
|
2844
3034
|
name: 'target',
|
|
2845
3035
|
aliases: ['goal'],
|
|
2846
3036
|
description: 'Create, view, pause, resume, or clear a persistent goal target',
|
|
2847
|
-
argumentHint: '[objective | pause | resume | clear --yes | status | edit <text> | budget <tokens>]',
|
|
3037
|
+
argumentHint: '[objective | pause | resume | clear --yes | status | edit <text> | replace <text> | confirm <criterion-id> | budget <tokens>]',
|
|
2848
3038
|
category: 'workflow',
|
|
2849
3039
|
priority: 3,
|
|
2850
3040
|
type: 'builtin',
|
|
@@ -2921,7 +3111,7 @@ const COMMANDS = [
|
|
|
2921
3111
|
type: 'builtin',
|
|
2922
3112
|
execution: 'builtin',
|
|
2923
3113
|
risk: 'read-only',
|
|
2924
|
-
execute:
|
|
3114
|
+
execute: ctx => handleTodos(ctx),
|
|
2925
3115
|
},
|
|
2926
3116
|
// Sessions and context lifecycle
|
|
2927
3117
|
{
|
|
@@ -3014,7 +3204,7 @@ const COMMANDS = [
|
|
|
3014
3204
|
type: 'builtin',
|
|
3015
3205
|
execution: 'builtin',
|
|
3016
3206
|
risk: 'read-only',
|
|
3017
|
-
execute:
|
|
3207
|
+
execute: ctx => handleSkills(ctx),
|
|
3018
3208
|
},
|
|
3019
3209
|
{
|
|
3020
3210
|
name: 'skill',
|
|
@@ -3049,7 +3239,7 @@ const COMMANDS = [
|
|
|
3049
3239
|
type: 'builtin',
|
|
3050
3240
|
execution: 'builtin',
|
|
3051
3241
|
risk: 'read-only',
|
|
3052
|
-
execute:
|
|
3242
|
+
execute: ctx => handleTools(ctx),
|
|
3053
3243
|
},
|
|
3054
3244
|
{
|
|
3055
3245
|
name: 'edit-preview',
|
|
@@ -3059,7 +3249,7 @@ const COMMANDS = [
|
|
|
3059
3249
|
type: 'builtin',
|
|
3060
3250
|
execution: 'builtin',
|
|
3061
3251
|
risk: 'read-only',
|
|
3062
|
-
execute:
|
|
3252
|
+
execute: ctx => handleEditPreview(ctx),
|
|
3063
3253
|
},
|
|
3064
3254
|
{
|
|
3065
3255
|
name: 'mcp',
|
|
@@ -3069,7 +3259,7 @@ const COMMANDS = [
|
|
|
3069
3259
|
type: 'builtin',
|
|
3070
3260
|
execution: 'builtin',
|
|
3071
3261
|
risk: 'read-only',
|
|
3072
|
-
execute:
|
|
3262
|
+
execute: ctx => handleMcp(ctx),
|
|
3073
3263
|
},
|
|
3074
3264
|
{
|
|
3075
3265
|
name: 'safety',
|
|
@@ -3079,13 +3269,13 @@ const COMMANDS = [
|
|
|
3079
3269
|
type: 'builtin',
|
|
3080
3270
|
execution: 'builtin',
|
|
3081
3271
|
risk: 'read-only',
|
|
3082
|
-
execute:
|
|
3272
|
+
execute: ctx => showSafety(ctx),
|
|
3083
3273
|
},
|
|
3084
3274
|
// Model and runtime configuration
|
|
3085
3275
|
{
|
|
3086
3276
|
name: 'model',
|
|
3087
3277
|
description: 'Show or change the current model',
|
|
3088
|
-
argumentHint: '[model|
|
|
3278
|
+
argumentHint: '[model|info]',
|
|
3089
3279
|
category: 'model',
|
|
3090
3280
|
priority: 10,
|
|
3091
3281
|
type: 'builtin',
|
|
@@ -3093,9 +3283,20 @@ const COMMANDS = [
|
|
|
3093
3283
|
risk: 'state-write',
|
|
3094
3284
|
execute: (ctx, args) => handleModel(ctx, args),
|
|
3095
3285
|
},
|
|
3286
|
+
{
|
|
3287
|
+
name: 'models',
|
|
3288
|
+
description: 'Switch the current model interactively',
|
|
3289
|
+
argumentHint: '',
|
|
3290
|
+
category: 'model',
|
|
3291
|
+
priority: 10,
|
|
3292
|
+
type: 'builtin',
|
|
3293
|
+
execution: 'builtin',
|
|
3294
|
+
risk: 'state-write',
|
|
3295
|
+
execute: (ctx, args) => handleModels(ctx, args),
|
|
3296
|
+
},
|
|
3096
3297
|
{
|
|
3097
3298
|
name: 'mode',
|
|
3098
|
-
aliases: ['
|
|
3299
|
+
aliases: ['perm'],
|
|
3099
3300
|
description: 'Show or change tool permission mode',
|
|
3100
3301
|
argumentHint: '[default|accept-edits|plan|auto|next]',
|
|
3101
3302
|
category: 'model',
|
|
@@ -3113,7 +3314,7 @@ const COMMANDS = [
|
|
|
3113
3314
|
type: 'builtin',
|
|
3114
3315
|
execution: 'builtin',
|
|
3115
3316
|
risk: 'read-only',
|
|
3116
|
-
execute:
|
|
3317
|
+
execute: ctx => showConfig(ctx),
|
|
3117
3318
|
},
|
|
3118
3319
|
// System commands
|
|
3119
3320
|
{
|
|
@@ -3136,7 +3337,7 @@ const COMMANDS = [
|
|
|
3136
3337
|
type: 'builtin',
|
|
3137
3338
|
execution: 'builtin',
|
|
3138
3339
|
risk: 'read-only',
|
|
3139
|
-
execute:
|
|
3340
|
+
execute: ctx => showStatus(ctx),
|
|
3140
3341
|
},
|
|
3141
3342
|
{
|
|
3142
3343
|
name: 'clear',
|
|
@@ -3164,6 +3365,18 @@ const COMMANDS = [
|
|
|
3164
3365
|
rendererScope: ['tui'],
|
|
3165
3366
|
execute: () => ({ success: true }),
|
|
3166
3367
|
},
|
|
3368
|
+
{
|
|
3369
|
+
name: 'permissions',
|
|
3370
|
+
description: 'Set the tool confirmation policy (TUI). No argument opens a picker; with an argument applies immediately.',
|
|
3371
|
+
argumentHint: '[allow|ask|deny]',
|
|
3372
|
+
category: 'system',
|
|
3373
|
+
priority: 33,
|
|
3374
|
+
type: 'builtin',
|
|
3375
|
+
execution: 'renderer-local',
|
|
3376
|
+
risk: 'state-write',
|
|
3377
|
+
rendererScope: ['tui'],
|
|
3378
|
+
execute: () => ({ success: true }),
|
|
3379
|
+
},
|
|
3167
3380
|
{
|
|
3168
3381
|
name: 'redraw',
|
|
3169
3382
|
description: 'Redraw the TUI-owned live region',
|
|
@@ -3184,7 +3397,7 @@ const COMMANDS = [
|
|
|
3184
3397
|
type: 'builtin',
|
|
3185
3398
|
execution: 'builtin',
|
|
3186
3399
|
risk: 'state-write',
|
|
3187
|
-
execute:
|
|
3400
|
+
execute: ctx => handleExit(ctx),
|
|
3188
3401
|
},
|
|
3189
3402
|
// Diagnostics
|
|
3190
3403
|
{
|
|
@@ -3196,12 +3409,12 @@ const COMMANDS = [
|
|
|
3196
3409
|
type: 'builtin',
|
|
3197
3410
|
execution: 'builtin',
|
|
3198
3411
|
risk: 'read-only',
|
|
3199
|
-
execute:
|
|
3412
|
+
execute: ctx => handleDoctor(ctx),
|
|
3200
3413
|
},
|
|
3201
3414
|
{
|
|
3202
3415
|
name: 'storage',
|
|
3203
3416
|
description: 'Inspect, repair, or clean Orion Code storage layout',
|
|
3204
|
-
argumentHint: '[doctor|repair [--yes]|cleanup [--dry-run|--yes]]',
|
|
3417
|
+
argumentHint: '[doctor|repair [--dry-run|--yes] [--plan=<token>]|cleanup [--dry-run|--yes] [--plan=<token>]]',
|
|
3205
3418
|
category: 'diagnostics',
|
|
3206
3419
|
priority: 8,
|
|
3207
3420
|
type: 'builtin',
|
|
@@ -3218,7 +3431,7 @@ const COMMANDS = [
|
|
|
3218
3431
|
type: 'builtin',
|
|
3219
3432
|
execution: 'builtin',
|
|
3220
3433
|
risk: 'read-only',
|
|
3221
|
-
execute:
|
|
3434
|
+
execute: ctx => handleUsage(ctx),
|
|
3222
3435
|
},
|
|
3223
3436
|
{
|
|
3224
3437
|
name: 'loop-stats',
|
|
@@ -3229,7 +3442,7 @@ const COMMANDS = [
|
|
|
3229
3442
|
type: 'builtin',
|
|
3230
3443
|
execution: 'builtin',
|
|
3231
3444
|
risk: 'read-only',
|
|
3232
|
-
execute:
|
|
3445
|
+
execute: ctx => handleLoopStats(ctx),
|
|
3233
3446
|
},
|
|
3234
3447
|
{
|
|
3235
3448
|
name: 'trace',
|
|
@@ -3286,7 +3499,7 @@ const COMMANDS = [
|
|
|
3286
3499
|
execution: 'builtin',
|
|
3287
3500
|
risk: 'read-only',
|
|
3288
3501
|
deprecated: { since: 'v0.1.1', replacement: '/usage', removeIn: 'v0.3.0' },
|
|
3289
|
-
execute:
|
|
3502
|
+
execute: ctx => handleCost(ctx),
|
|
3290
3503
|
},
|
|
3291
3504
|
{
|
|
3292
3505
|
name: 'agents',
|
|
@@ -3297,7 +3510,7 @@ const COMMANDS = [
|
|
|
3297
3510
|
execution: 'builtin',
|
|
3298
3511
|
risk: 'read-only',
|
|
3299
3512
|
isHidden: true,
|
|
3300
|
-
execute:
|
|
3513
|
+
execute: ctx => showAgents(ctx),
|
|
3301
3514
|
},
|
|
3302
3515
|
{
|
|
3303
3516
|
name: 'migrate',
|
|
@@ -3355,8 +3568,8 @@ function getCommands() {
|
|
|
3355
3568
|
return sortCommands(COMMANDS);
|
|
3356
3569
|
}
|
|
3357
3570
|
function getVisibleCommands(renderer) {
|
|
3358
|
-
return sortCommands(COMMANDS.filter(command => !command.isHidden
|
|
3359
|
-
|
|
3571
|
+
return sortCommands(COMMANDS.filter(command => !command.isHidden &&
|
|
3572
|
+
(!renderer || !command.rendererScope || command.rendererScope.includes(renderer))));
|
|
3360
3573
|
}
|
|
3361
3574
|
function findCommand(name) {
|
|
3362
3575
|
return COMMANDS.find(c => c.name === name || c.aliases?.includes(name));
|