@armadra/agent 0.3.0 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +257 -0
- package/README.md +263 -95
- package/THIRD_PARTY_NOTICES.md +34 -0
- package/dist/acp.d.ts +18 -0
- package/dist/acp.js +19 -0
- package/dist/agent/limits.d.ts +38 -0
- package/dist/agent/limits.js +127 -0
- package/dist/agent/loop-guard.d.ts +38 -0
- package/dist/agent/loop-guard.js +95 -0
- package/dist/agent/loop.d.ts +4 -0
- package/dist/agent/loop.js +7 -0
- package/dist/agent/prompt-rules.d.ts +12 -0
- package/dist/agent/prompt-rules.js +18 -0
- package/dist/agent/reminders.d.ts +59 -0
- package/dist/agent/reminders.js +327 -0
- package/dist/agent/retry.d.ts +1 -1
- package/dist/agent/retry.js +2 -1
- package/dist/agent/session-cache.d.ts +5 -0
- package/dist/agent/session-cache.js +18 -2
- package/dist/agent/session-classifier.d.ts +18 -0
- package/dist/agent/session-classifier.js +105 -0
- package/dist/agent/session-compaction.d.ts +35 -6
- package/dist/agent/session-compaction.js +157 -31
- package/dist/agent/session-core.d.ts +40 -1
- package/dist/agent/session-extensions.d.ts +61 -0
- package/dist/agent/session-extensions.js +129 -0
- package/dist/agent/session-images.d.ts +23 -0
- package/dist/agent/session-images.js +97 -0
- package/dist/agent/session-plan.d.ts +21 -0
- package/dist/agent/session-plan.js +524 -0
- package/dist/agent/session-rewind.d.ts +81 -0
- package/dist/agent/session-rewind.js +354 -0
- package/dist/agent/session-run.d.ts +28 -1
- package/dist/agent/session-run.js +157 -6
- package/dist/agent/session-settings.d.ts +49 -0
- package/dist/agent/session-settings.js +95 -0
- package/dist/agent/session-subagent.d.ts +36 -24
- package/dist/agent/session-subagent.js +259 -129
- package/dist/agent/session-sync.d.ts +10 -3
- package/dist/agent/session-sync.js +37 -8
- package/dist/agent/session-telemetry.d.ts +39 -0
- package/dist/agent/session-telemetry.js +231 -0
- package/dist/agent/session-tools.js +63 -3
- package/dist/agent/session.d.ts +33 -29
- package/dist/agent/session.js +91 -126
- package/dist/agent/subagent-registry.d.ts +91 -0
- package/dist/agent/subagent-registry.js +494 -0
- package/dist/agent/system-prompt.d.ts +6 -3
- package/dist/agent/system-prompt.js +7 -2
- package/dist/agent/tool-runner.d.ts +8 -1
- package/dist/agent/tool-runner.js +72 -6
- package/dist/agent/types-w5.d.ts +192 -0
- package/dist/agent/types-w5.js +10 -0
- package/dist/agent/types.d.ts +55 -4
- package/dist/agent/types.js +2 -0
- package/dist/agent/worktree.d.ts +36 -0
- package/dist/agent/worktree.js +86 -0
- package/dist/agents/builtin.d.ts +14 -0
- package/dist/agents/builtin.js +39 -0
- package/dist/agents/catalog.d.ts +43 -0
- package/dist/agents/catalog.js +82 -0
- package/dist/agents/discover.d.ts +35 -0
- package/dist/agents/discover.js +83 -0
- package/dist/agents/external.d.ts +82 -0
- package/dist/agents/external.js +326 -0
- package/dist/agents/parse.d.ts +18 -0
- package/dist/agents/parse.js +116 -0
- package/dist/agents/result.d.ts +32 -0
- package/dist/agents/result.js +67 -0
- package/dist/agents/task-control.d.ts +17 -0
- package/dist/agents/task-control.js +17 -0
- package/dist/agents/task-record.d.ts +78 -0
- package/dist/agents/task-record.js +141 -0
- package/dist/agents/types.d.ts +46 -0
- package/dist/agents/types.js +8 -0
- package/dist/ai/apis/anthropic-compat.d.ts +36 -0
- package/dist/ai/apis/anthropic-compat.js +92 -0
- package/dist/ai/apis/anthropic-messages.js +3 -2
- package/dist/ai/apis/anthropic-request.d.ts +7 -6
- package/dist/ai/apis/anthropic-request.js +10 -28
- package/dist/ai/apis/cache-params.d.ts +11 -2
- package/dist/ai/apis/cache-params.js +25 -6
- package/dist/ai/apis/google-generative-ai.js +3 -2
- package/dist/ai/apis/openai-compat.d.ts +4 -1
- package/dist/ai/apis/openai-compat.js +8 -1
- package/dist/ai/apis/openai-completions.js +3 -2
- package/dist/ai/apis/openai-responses.js +3 -2
- package/dist/ai/http.d.ts +28 -6
- package/dist/ai/http.js +41 -8
- package/dist/ai/image-limits.d.ts +45 -0
- package/dist/ai/image-limits.js +68 -0
- package/dist/ai/providers/builtin.d.ts +18 -6
- package/dist/ai/providers/builtin.js +135 -6
- package/dist/ai/providers/catalog-data.js +17 -13
- package/dist/ai/providers/catalog.d.ts +60 -7
- package/dist/ai/providers/catalog.js +197 -38
- package/dist/ai/providers/channels.d.ts +33 -3
- package/dist/ai/providers/channels.js +108 -7
- package/dist/ai/providers/enrich.d.ts +6 -3
- package/dist/ai/providers/enrich.js +19 -4
- package/dist/ai/providers/models-dev-cache.d.ts +28 -24
- package/dist/ai/providers/models-dev-cache.js +92 -78
- package/dist/ai/providers/models-dev-data.d.ts +7 -0
- package/dist/ai/providers/models-dev-data.js +32 -0
- package/dist/ai/providers/models-dev-snapshot.d.ts +50 -0
- package/dist/ai/providers/models-dev-snapshot.js +137 -0
- package/dist/ai/providers/models-dev.d.ts +51 -10
- package/dist/ai/providers/models-dev.js +132 -39
- package/dist/ai/providers/registry.d.ts +28 -11
- package/dist/ai/providers/registry.js +112 -65
- package/dist/ai/providers/suggest.d.ts +18 -0
- package/dist/ai/providers/suggest.js +72 -0
- package/dist/ai/sse.d.ts +6 -2
- package/dist/ai/sse.js +22 -2
- package/dist/ai/types.d.ts +37 -4
- package/dist/ai/types.js +5 -0
- package/dist/bundle/ama.cjs +41979 -21147
- package/dist/checkpoints/backend.d.ts +61 -0
- package/dist/checkpoints/backend.js +135 -0
- package/dist/checkpoints/blobs.d.ts +60 -0
- package/dist/checkpoints/blobs.js +203 -0
- package/dist/checkpoints/gc.d.ts +47 -0
- package/dist/checkpoints/gc.js +144 -0
- package/dist/checkpoints/git-head.d.ts +15 -0
- package/dist/checkpoints/git-head.js +89 -0
- package/dist/checkpoints/index.d.ts +17 -0
- package/dist/checkpoints/index.js +17 -0
- package/dist/checkpoints/replay.d.ts +48 -0
- package/dist/checkpoints/replay.js +154 -0
- package/dist/checkpoints/restore.d.ts +86 -0
- package/dist/checkpoints/restore.js +263 -0
- package/dist/checkpoints/settings.d.ts +14 -0
- package/dist/checkpoints/settings.js +23 -0
- package/dist/checkpoints/shadow-git.d.ts +108 -0
- package/dist/checkpoints/shadow-git.js +491 -0
- package/dist/checkpoints/shadow-restore.d.ts +25 -0
- package/dist/checkpoints/shadow-restore.js +128 -0
- package/dist/checkpoints/tracker.d.ts +64 -0
- package/dist/checkpoints/tracker.js +192 -0
- package/dist/checkpoints/types.d.ts +99 -0
- package/dist/checkpoints/types.js +12 -0
- package/dist/cli/args.d.ts +26 -7
- package/dist/cli/args.js +75 -82
- package/dist/cli/bootstrap.js +40 -4
- package/dist/cli/codemode-notice.d.ts +21 -0
- package/dist/cli/codemode-notice.js +56 -0
- package/dist/cli/compose-agents.d.ts +27 -0
- package/dist/cli/compose-agents.js +111 -0
- package/dist/cli/compose-extensions.d.ts +29 -0
- package/dist/cli/compose-extensions.js +44 -0
- package/dist/cli/compose-session.d.ts +8 -0
- package/dist/cli/compose-session.js +76 -2
- package/dist/cli/compose-store.d.ts +1 -1
- package/dist/cli/compose-store.js +3 -1
- package/dist/cli/compose.d.ts +17 -4
- package/dist/cli/compose.js +60 -14
- package/dist/cli/default-model.d.ts +38 -1
- package/dist/cli/default-model.js +96 -9
- package/dist/cli/deps.d.ts +42 -0
- package/dist/cli/exit-codes.d.ts +12 -0
- package/dist/cli/exit-codes.js +15 -0
- package/dist/cli/fake-visibility.d.ts +13 -0
- package/dist/cli/fake-visibility.js +26 -0
- package/dist/cli/from-prompt.d.ts +18 -0
- package/dist/cli/from-prompt.js +49 -0
- package/dist/cli/help-text.d.ts +4 -0
- package/dist/cli/help-text.js +102 -0
- package/dist/cli/main.d.ts +9 -2
- package/dist/cli/main.js +77 -3
- package/dist/cli/proxy.d.ts +51 -0
- package/dist/cli/proxy.js +135 -0
- package/dist/cli/startup-screen.d.ts +29 -0
- package/dist/cli/startup-screen.js +51 -2
- package/dist/cli/startup-steps.d.ts +1 -1
- package/dist/cli/startup-steps.js +21 -13
- package/dist/cli/subcommands/config.d.ts +22 -3
- package/dist/cli/subcommands/config.js +119 -21
- package/dist/cli/subcommands/context.js +4 -1
- package/dist/cli/subcommands/doctor.js +33 -1
- package/dist/cli/subcommands/init.js +2 -1
- package/dist/cli/subcommands/models-discover.d.ts +15 -9
- package/dist/cli/subcommands/models-discover.js +58 -52
- package/dist/cli/subcommands/models.d.ts +2 -0
- package/dist/cli/subcommands/models.js +33 -14
- package/dist/cli/subcommands/probe-runner.d.ts +96 -0
- package/dist/cli/subcommands/probe-runner.js +264 -0
- package/dist/cli/subcommands/providers-probe.d.ts +34 -0
- package/dist/cli/subcommands/providers-probe.js +87 -0
- package/dist/cli/subcommands/providers.d.ts +3 -2
- package/dist/cli/subcommands/providers.js +53 -51
- package/dist/cli/subcommands/sessions-export.d.ts +10 -0
- package/dist/cli/subcommands/sessions-export.js +59 -0
- package/dist/cli/subcommands/sessions-search.d.ts +13 -0
- package/dist/cli/subcommands/sessions-search.js +103 -0
- package/dist/cli/subcommands/sessions.d.ts +6 -3
- package/dist/cli/subcommands/sessions.js +58 -3
- package/dist/cli/subcommands/stats.d.ts +17 -0
- package/dist/cli/subcommands/stats.js +198 -0
- package/dist/cli/system-prompt-arg.d.ts +11 -0
- package/dist/cli/system-prompt-arg.js +34 -0
- package/dist/codemode/capability.d.ts +24 -7
- package/dist/codemode/capability.js +38 -10
- package/dist/codemode/host-side.d.ts +14 -0
- package/dist/codemode/host-side.js +24 -1
- package/dist/codemode/modes.d.ts +4 -11
- package/dist/codemode/modes.js +5 -27
- package/dist/codemode/tool.d.ts +18 -14
- package/dist/codemode/tool.js +76 -31
- package/dist/compaction/breaker.d.ts +25 -9
- package/dist/compaction/breaker.js +47 -17
- package/dist/compaction/estimate.d.ts +11 -3
- package/dist/compaction/estimate.js +64 -22
- package/dist/compaction/image-budget.d.ts +45 -0
- package/dist/compaction/image-budget.js +115 -0
- package/dist/compaction/post-compact.d.ts +38 -0
- package/dist/compaction/post-compact.js +152 -0
- package/dist/compaction/protect.d.ts +27 -0
- package/dist/compaction/protect.js +56 -0
- package/dist/compaction/prune-tier.d.ts +58 -12
- package/dist/compaction/prune-tier.js +120 -54
- package/dist/compaction/summarize-tier.d.ts +23 -4
- package/dist/compaction/summarize-tier.js +100 -29
- package/dist/config/checker.d.ts +28 -0
- package/dist/config/checker.js +97 -0
- package/dist/config/init.d.ts +6 -2
- package/dist/config/init.js +12 -5
- package/dist/config/json-schema.d.ts +1 -0
- package/dist/config/json-schema.js +98 -4
- package/dist/config/key-docs.d.ts +22 -0
- package/dist/config/key-docs.js +174 -0
- package/dist/config/merge.d.ts +12 -9
- package/dist/config/merge.js +102 -13
- package/dist/config/profile.d.ts +2 -0
- package/dist/config/profile.js +2 -0
- package/dist/config/schema-w5.d.ts +18 -0
- package/dist/config/schema-w5.js +109 -0
- package/dist/config/schema.d.ts +5 -9
- package/dist/config/schema.js +91 -118
- package/dist/config/types-w5.d.ts +118 -0
- package/dist/config/types-w5.js +20 -0
- package/dist/config/types.d.ts +84 -7
- package/dist/config/types.js +29 -1
- package/dist/drivers/acp/client.d.ts +57 -0
- package/dist/drivers/acp/client.js +160 -0
- package/dist/drivers/acp/driver.d.ts +31 -0
- package/dist/drivers/acp/driver.js +274 -0
- package/dist/drivers/acp/testing/fake-agent-main.d.ts +5 -0
- package/dist/drivers/acp/testing/fake-agent-main.js +7 -0
- package/dist/drivers/acp/testing/fake-agent.d.ts +27 -0
- package/dist/drivers/acp/testing/fake-agent.js +211 -0
- package/dist/drivers/acp/types.d.ts +285 -0
- package/dist/drivers/acp/types.js +36 -0
- package/dist/drivers/agents.d.ts +58 -0
- package/dist/drivers/agents.js +142 -0
- package/dist/drivers/base.d.ts +35 -0
- package/dist/drivers/base.js +59 -0
- package/dist/drivers/catalog.d.ts +46 -0
- package/dist/drivers/catalog.js +167 -0
- package/dist/drivers/env.d.ts +20 -0
- package/dist/drivers/env.js +46 -0
- package/dist/drivers/host-runners.d.ts +18 -0
- package/dist/drivers/host-runners.js +45 -0
- package/dist/drivers/jsonrpc.d.ts +58 -0
- package/dist/drivers/jsonrpc.js +180 -0
- package/dist/drivers/native/claude-normalize.d.ts +46 -0
- package/dist/drivers/native/claude-normalize.js +106 -0
- package/dist/drivers/native/claude-stream.d.ts +29 -0
- package/dist/drivers/native/claude-stream.js +456 -0
- package/dist/drivers/native/codex-app-server.d.ts +26 -0
- package/dist/drivers/native/codex-app-server.js +407 -0
- package/dist/drivers/native/codex-normalize.d.ts +38 -0
- package/dist/drivers/native/codex-normalize.js +124 -0
- package/dist/drivers/native/oneshot.d.ts +28 -0
- package/dist/drivers/native/oneshot.js +312 -0
- package/dist/drivers/permissions.d.ts +40 -0
- package/dist/drivers/permissions.js +92 -0
- package/dist/drivers/pids.d.ts +32 -0
- package/dist/drivers/pids.js +93 -0
- package/dist/drivers/pool.d.ts +28 -0
- package/dist/drivers/pool.js +96 -0
- package/dist/drivers/probe.d.ts +47 -0
- package/dist/drivers/probe.js +172 -0
- package/dist/drivers/process.d.ts +48 -0
- package/dist/drivers/process.js +100 -0
- package/dist/drivers/runner.d.ts +61 -0
- package/dist/drivers/runner.js +388 -0
- package/dist/drivers/store.d.ts +49 -0
- package/dist/drivers/store.js +91 -0
- package/dist/drivers/turn.d.ts +41 -0
- package/dist/drivers/turn.js +99 -0
- package/dist/drivers/types.d.ts +122 -0
- package/dist/drivers/types.js +11 -0
- package/dist/git/info.d.ts +75 -0
- package/dist/git/info.js +191 -0
- package/dist/hooks/protocol.js +6 -1
- package/dist/hooks/types.d.ts +10 -1
- package/dist/hooks/types.js +2 -0
- package/dist/host/api-impl.d.ts +7 -0
- package/dist/host/api-impl.js +15 -0
- package/dist/host/types.d.ts +24 -2
- package/dist/host/types.js +4 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +1 -0
- package/dist/modes/acp/acp-events.d.ts +46 -0
- package/dist/modes/acp/acp-events.js +233 -0
- package/dist/modes/acp/acp-mode.d.ts +17 -0
- package/dist/modes/acp/acp-mode.js +47 -0
- package/dist/modes/acp/acp-server.d.ts +79 -0
- package/dist/modes/acp/acp-server.js +315 -0
- package/dist/modes/commands-core.d.ts +7 -1
- package/dist/modes/commands-core.js +61 -5
- package/dist/modes/image-input.d.ts +12 -4
- package/dist/modes/image-input.js +22 -5
- package/dist/modes/interactive/agent-panels.d.ts +14 -0
- package/dist/modes/interactive/agent-panels.js +103 -0
- package/dist/modes/interactive/agent-ui.d.ts +73 -0
- package/dist/modes/interactive/agent-ui.js +234 -0
- package/dist/modes/interactive/approval-dialog.d.ts +40 -7
- package/dist/modes/interactive/approval-dialog.js +192 -35
- package/dist/modes/interactive/approval-merge.d.ts +41 -0
- package/dist/modes/interactive/approval-merge.js +89 -0
- package/dist/modes/interactive/clipboard-paste.d.ts +18 -0
- package/dist/modes/interactive/clipboard-paste.js +28 -0
- package/dist/modes/interactive/commands.d.ts +20 -3
- package/dist/modes/interactive/commands.js +75 -16
- package/dist/modes/interactive/double-esc.d.ts +20 -0
- package/dist/modes/interactive/double-esc.js +34 -0
- package/dist/modes/interactive/event-notices.d.ts +32 -0
- package/dist/modes/interactive/event-notices.js +79 -0
- package/dist/modes/interactive/external-editor.d.ts +16 -0
- package/dist/modes/interactive/external-editor.js +39 -0
- package/dist/modes/interactive/interactive-mode.d.ts +16 -2
- package/dist/modes/interactive/interactive-mode.js +184 -202
- package/dist/modes/interactive/key-dispatch.d.ts +18 -2
- package/dist/modes/interactive/key-dispatch.js +53 -6
- package/dist/modes/interactive/line/line-mode.d.ts +3 -1
- package/dist/modes/interactive/line/line-mode.js +28 -9
- package/dist/modes/interactive/line/line-render.d.ts +6 -1
- package/dist/modes/interactive/line/line-render.js +66 -8
- package/dist/modes/interactive/message-view.d.ts +49 -10
- package/dist/modes/interactive/message-view.js +262 -46
- package/dist/modes/interactive/panels.d.ts +35 -0
- package/dist/modes/interactive/panels.js +157 -0
- package/dist/modes/interactive/pickers.d.ts +23 -2
- package/dist/modes/interactive/pickers.js +48 -15
- package/dist/modes/interactive/plan-command.d.ts +40 -0
- package/dist/modes/interactive/plan-command.js +129 -0
- package/dist/modes/interactive/plan-dialog.d.ts +98 -0
- package/dist/modes/interactive/plan-dialog.js +290 -0
- package/dist/modes/interactive/plan-flow.d.ts +34 -0
- package/dist/modes/interactive/plan-flow.js +98 -0
- package/dist/modes/interactive/rewind-command.d.ts +31 -0
- package/dist/modes/interactive/rewind-command.js +106 -0
- package/dist/modes/interactive/rewind-flow.d.ts +37 -0
- package/dist/modes/interactive/rewind-flow.js +151 -0
- package/dist/modes/interactive/rewind-list.d.ts +36 -0
- package/dist/modes/interactive/rewind-list.js +123 -0
- package/dist/modes/interactive/rewind-panel.d.ts +77 -0
- package/dist/modes/interactive/rewind-panel.js +309 -0
- package/dist/modes/interactive/rewind-text.d.ts +40 -0
- package/dist/modes/interactive/rewind-text.js +139 -0
- package/dist/modes/interactive/run-indicator.d.ts +51 -0
- package/dist/modes/interactive/run-indicator.js +189 -0
- package/dist/modes/interactive/session-events.d.ts +24 -0
- package/dist/modes/interactive/session-events.js +96 -0
- package/dist/modes/interactive/startup-header.d.ts +40 -0
- package/dist/modes/interactive/startup-header.js +169 -0
- package/dist/modes/interactive/status-area.d.ts +73 -0
- package/dist/modes/interactive/status-area.js +190 -0
- package/dist/modes/interactive/status-bar.d.ts +107 -16
- package/dist/modes/interactive/status-bar.js +306 -81
- package/dist/modes/interactive/status-line.d.ts +33 -0
- package/dist/modes/interactive/status-line.js +113 -0
- package/dist/modes/interactive/subagent-view.d.ts +56 -0
- package/dist/modes/interactive/subagent-view.js +154 -0
- package/dist/modes/interactive/tasks-report.d.ts +27 -0
- package/dist/modes/interactive/tasks-report.js +114 -0
- package/dist/modes/interactive/tool-summary.d.ts +46 -0
- package/dist/modes/interactive/tool-summary.js +218 -0
- package/dist/modes/interactive/tool-view.d.ts +58 -15
- package/dist/modes/interactive/tool-view.js +233 -145
- package/dist/modes/print/print-mode.d.ts +40 -4
- package/dist/modes/print/print-mode.js +161 -8
- package/dist/modes/rpc/commands.d.ts +9 -0
- package/dist/modes/rpc/commands.js +49 -0
- package/dist/modes/rpc/rpc-mode.js +7 -1
- package/dist/modes/session-report.d.ts +11 -0
- package/dist/modes/session-report.js +48 -1
- package/dist/permissions/auto-safe.d.ts +65 -0
- package/dist/permissions/auto-safe.js +547 -0
- package/dist/permissions/classifier.d.ts +68 -0
- package/dist/permissions/classifier.js +186 -0
- package/dist/permissions/dangerous.d.ts +5 -0
- package/dist/permissions/dangerous.js +1 -1
- package/dist/permissions/modes.d.ts +30 -0
- package/dist/permissions/modes.js +78 -0
- package/dist/permissions/pipeline.d.ts +72 -6
- package/dist/permissions/pipeline.js +306 -11
- package/dist/permissions/protected.d.ts +19 -0
- package/dist/permissions/protected.js +74 -0
- package/dist/permissions/readonly-bash.d.ts +30 -0
- package/dist/permissions/readonly-bash.js +118 -0
- package/dist/permissions/rules.js +3 -0
- package/dist/permissions/types.d.ts +92 -3
- package/dist/permissions/types.js +3 -0
- package/dist/plan/compose.d.ts +9 -0
- package/dist/plan/compose.js +19 -0
- package/dist/plan/controller.d.ts +71 -0
- package/dist/plan/controller.js +27 -0
- package/dist/plan/done-markers.d.ts +17 -0
- package/dist/plan/done-markers.js +51 -0
- package/dist/plan/extract.d.ts +29 -0
- package/dist/plan/extract.js +160 -0
- package/dist/plan/prompts.d.ts +36 -0
- package/dist/plan/prompts.js +89 -0
- package/dist/plan/store.d.ts +37 -0
- package/dist/plan/store.js +90 -0
- package/dist/rpc.d.ts +58 -2
- package/dist/rpc.js +7 -0
- package/dist/sandbox/bash.d.ts +74 -0
- package/dist/sandbox/bash.js +126 -0
- package/dist/sandbox/detect.d.ts +48 -0
- package/dist/sandbox/detect.js +149 -0
- package/dist/sandbox/index.d.ts +5 -0
- package/dist/sandbox/index.js +5 -0
- package/dist/sandbox/profile.d.ts +33 -0
- package/dist/sandbox/profile.js +76 -0
- package/dist/sandbox/wrap.d.ts +29 -0
- package/dist/sandbox/wrap.js +117 -0
- package/dist/sdk.d.ts +42 -5
- package/dist/sdk.js +34 -4
- package/dist/session/export.d.ts +32 -0
- package/dist/session/export.js +187 -0
- package/dist/session/redact.d.ts +15 -0
- package/dist/session/redact.js +55 -0
- package/dist/session/reuse.d.ts +33 -0
- package/dist/session/reuse.js +86 -0
- package/dist/session/scan.d.ts +34 -0
- package/dist/session/scan.js +140 -0
- package/dist/session/search.d.ts +52 -0
- package/dist/session/search.js +211 -0
- package/dist/session/stats-aggregate.d.ts +63 -0
- package/dist/session/stats-aggregate.js +163 -0
- package/dist/session/stats-index.d.ts +26 -0
- package/dist/session/stats-index.js +91 -0
- package/dist/session/stats-scan.d.ts +54 -0
- package/dist/session/stats-scan.js +236 -0
- package/dist/session/types.d.ts +3 -1
- package/dist/session/types.js +1 -0
- package/dist/skills/builtin.d.ts +31 -0
- package/dist/skills/builtin.js +109 -0
- package/dist/skills/discover.d.ts +2 -1
- package/dist/skills/index-prompt.js +5 -8
- package/dist/tools/background-jobs.d.ts +71 -0
- package/dist/tools/background-jobs.js +198 -0
- package/dist/tools/bash.d.ts +53 -1
- package/dist/tools/bash.js +158 -7
- package/dist/tools/clipboard-image.d.ts +44 -0
- package/dist/tools/clipboard-image.js +148 -0
- package/dist/tools/edit.d.ts +2 -0
- package/dist/tools/edit.js +18 -3
- package/dist/tools/image-file.d.ts +38 -3
- package/dist/tools/image-file.js +81 -10
- package/dist/tools/image-resize.d.ts +58 -0
- package/dist/tools/image-resize.js +97 -0
- package/dist/tools/presets.d.ts +40 -8
- package/dist/tools/presets.js +65 -19
- package/dist/tools/read.d.ts +5 -2
- package/dist/tools/read.js +13 -10
- package/dist/tools/registry.d.ts +7 -1
- package/dist/tools/registry.js +27 -4
- package/dist/tools/task-ctl.d.ts +22 -0
- package/dist/tools/task-ctl.js +116 -0
- package/dist/tools/task.d.ts +22 -10
- package/dist/tools/task.js +66 -26
- package/dist/tools/todo.d.ts +22 -2
- package/dist/tools/todo.js +58 -14
- package/dist/tools/truncate.d.ts +15 -0
- package/dist/tools/truncate.js +25 -0
- package/dist/tools/types.d.ts +113 -0
- package/dist/tools/types.js +5 -0
- package/dist/tools/write.js +3 -0
- package/dist/tui/component.d.ts +8 -2
- package/dist/tui/component.js +3 -1
- package/dist/tui/components/box.d.ts +6 -1
- package/dist/tui/components/box.js +16 -6
- package/dist/tui/components/card.d.ts +23 -0
- package/dist/tui/components/card.js +37 -0
- package/dist/tui/components/editor-history.d.ts +6 -0
- package/dist/tui/components/editor-history.js +45 -0
- package/dist/tui/components/editor-paste.d.ts +1 -1
- package/dist/tui/components/editor-paste.js +4 -4
- package/dist/tui/components/editor.d.ts +11 -5
- package/dist/tui/components/editor.js +52 -58
- package/dist/tui/components/key-value.d.ts +3 -0
- package/dist/tui/components/key-value.js +16 -6
- package/dist/tui/components/loader.d.ts +37 -7
- package/dist/tui/components/loader.js +84 -21
- package/dist/tui/components/markdown.d.ts +5 -1
- package/dist/tui/components/markdown.js +45 -21
- package/dist/tui/components/meter.d.ts +3 -3
- package/dist/tui/components/meter.js +13 -11
- package/dist/tui/components/select-list.d.ts +23 -1
- package/dist/tui/components/select-list.js +76 -13
- package/dist/tui/glyphs.d.ts +72 -0
- package/dist/tui/glyphs.js +118 -0
- package/dist/tui/keybindings.d.ts +5 -0
- package/dist/tui/keybindings.js +5 -0
- package/dist/tui/theme.d.ts +30 -6
- package/dist/tui/theme.js +103 -17
- package/dist/tui.d.ts +4 -2
- package/dist/tui.js +3 -1
- package/docs/acp.md +78 -0
- package/docs/agents.md +250 -0
- package/docs/codemode.md +28 -10
- package/docs/hooks.md +36 -32
- package/docs/permissions.md +212 -0
- package/docs/plan.md +107 -0
- package/docs/providers.md +261 -62
- package/docs/rewind-plan.md +181 -0
- package/docs/rpc.md +127 -40
- package/docs/sandbox.md +215 -0
- package/docs/session-format.md +43 -22
- package/docs/sessions.md +174 -0
- package/docs/tui-design.md +751 -0
- package/docs/tui.md +260 -64
- package/package.json +15 -2
|
@@ -1,17 +1,53 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* print 模式(`ama -p`,设计 §11.1 第 15–16 步)。[B6]
|
|
3
3
|
*
|
|
4
|
-
* - 提示 = 位置参数 + stdin
|
|
4
|
+
* - 提示 = 位置参数 + stdin,两者都有时空一行拼接;都没有 → 用法错误 2。stdin 的读法:
|
|
5
|
+
* - 没有提示参数,或显式写了位置参数 `-`:读到 EOF(超过 3 s 时 stderr 提示一次正在等待);
|
|
6
|
+
* - 有提示参数且 stdin 是管道(shell 管道或父进程留的管道):等首字节,`AMA_STDIN_WAIT_MS`
|
|
7
|
+
* (缺省 2000,0 = 不等)内一个字节都没有 → 忽略 stdin 并在 stderr 提示;收到首字节后读到 EOF;
|
|
8
|
+
* - stdin 是普通文件 / 空设备:直接读(不会卡);TTY 或 `--no-stdin`:不读。
|
|
5
9
|
* - 图片:`--image`(可重复)与提示里的 `@图片路径` / 图片文件路径作为附件(modes/image-input.ts);
|
|
6
10
|
* 显式附件遇到当前模型不收图片、文件不存在或超限 → 用法错误 2,不发请求。
|
|
7
11
|
* - `--output-format text`(缺省):运行结束后输出最后一条助手文本;`json`:一个结果对象(文本、
|
|
8
12
|
* 停止原因、用量、缓存命中率、[W3-C2] `cache` 统计(同 `get_session_stats.cache`)、全部条目);
|
|
9
13
|
* `stream-json`:每个会话事件一行(线上形状同 RPC,含 `cache_miss` / `cache_warm` /
|
|
10
14
|
* `context_pressure`)。
|
|
11
|
-
* -
|
|
12
|
-
* -
|
|
15
|
+
* - 重试:text / json 格式在 stderr 打一行 `↻ 重试 n/m`(stream-json 里本来就有事件),等待期间不再无声。
|
|
16
|
+
* - 无人值守:ask → deny(bootstrap 已按 print 设 unattended)。被拒的调用(`tool_execution_end`
|
|
17
|
+
* 带 `denied`)在 stderr 汇总一行(工具 ×次数、首个原因、放行办法),json 结果带 `deniedTools`。
|
|
18
|
+
* - [W5-H2] 预算(`--max-turns N` / `--max-cost USD` / config `limits.*`,agent/limits.ts):到限
|
|
19
|
+
* (会话发 `limit_reached`)→ stderr 一行、json 带 `limitReached{kind, value, limit}`(回合到限另带
|
|
20
|
+
* `maxTurnsReached: true`)、退出码 8。
|
|
21
|
+
* - [W5-H2] plan 模式产出计划、`plan.unattended: stop`(缺省)没人审批:stderr 一行(计划文件与审批办法)、
|
|
22
|
+
* json 带 `planPending{planId, version, filePath}`、退出码 9。
|
|
23
|
+
* - [W5-H2] `--image` / `@图片` 超限时按 config `images.resize` 缩放(缺省 auto)。
|
|
24
|
+
* - 退出码:最终助手消息 `error / aborted` 或提示被拒 → 1;有工具调用被拒 → 7;到达预算 → 8;
|
|
25
|
+
* 计划待审批 → 9;SIGINT 130、SIGTERM 143(先 abort)。
|
|
13
26
|
*/
|
|
14
|
-
import type { ModeContext } from "../../cli/deps.js";
|
|
27
|
+
import type { CliIo, ModeContext } from "../../cli/deps.js";
|
|
15
28
|
import type { Runtime } from "../../cli/runtime.js";
|
|
29
|
+
import type { LimitReachedEvent, PlanProposedEvent } from "../../agent/types.js";
|
|
16
30
|
export declare function joinPrompt(argument: string | undefined, piped: string): string;
|
|
31
|
+
/** 等 stdin 多久后提示一次「正在等待」。 */
|
|
32
|
+
export declare const STDIN_WAIT_HINT_MS = 3000;
|
|
33
|
+
/** 有提示参数时等管道首字节的缺省上限;`AMA_STDIN_WAIT_MS` 覆盖,0 = 不等待。 */
|
|
34
|
+
export declare const STDIN_FIRST_BYTE_MS = 2000;
|
|
35
|
+
export declare function stdinWaitMs(env: Readonly<Record<string, string | undefined>>): number;
|
|
36
|
+
/**
|
|
37
|
+
* 决定读不读 stdin(规则见文件头)。`mode`:`auto` 按提示参数与 stdin 类型决定,`explicit`
|
|
38
|
+
* (位置参数 `-`)一直等到 EOF,`off`(`--no-stdin`)不读。
|
|
39
|
+
*/
|
|
40
|
+
export declare function readPromptStdin(io: CliIo, prompt: string | undefined, mode: "auto" | "explicit" | "off", hintMs?: number): Promise<string>;
|
|
17
41
|
export declare function runPrintMode(runtime: Runtime, context: ModeContext): Promise<number>;
|
|
42
|
+
/** stderr 一行:计划已落盘待审批(-p 不替人批准)。 */
|
|
43
|
+
export declare function describePlanPending(plan: PlanProposedEvent): string;
|
|
44
|
+
/** stderr 一行:哪个预算到限。 */
|
|
45
|
+
export declare function describeLimit(event: LimitReachedEvent): string;
|
|
46
|
+
/** 被拒的一次工具调用(json 结果的 `deniedTools` 元素)。 */
|
|
47
|
+
export interface DeniedTool {
|
|
48
|
+
toolCallId: string;
|
|
49
|
+
toolName: string;
|
|
50
|
+
reason: string;
|
|
51
|
+
}
|
|
52
|
+
/** stderr 一行:被拒的工具 ×次数、首个原因、放行办法。 */
|
|
53
|
+
export declare function describeDenied(denied: readonly DeniedTool[]): string;
|
|
@@ -1,29 +1,103 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* print 模式(`ama -p`,设计 §11.1 第 15–16 步)。[B6]
|
|
3
3
|
*
|
|
4
|
-
* - 提示 = 位置参数 + stdin
|
|
4
|
+
* - 提示 = 位置参数 + stdin,两者都有时空一行拼接;都没有 → 用法错误 2。stdin 的读法:
|
|
5
|
+
* - 没有提示参数,或显式写了位置参数 `-`:读到 EOF(超过 3 s 时 stderr 提示一次正在等待);
|
|
6
|
+
* - 有提示参数且 stdin 是管道(shell 管道或父进程留的管道):等首字节,`AMA_STDIN_WAIT_MS`
|
|
7
|
+
* (缺省 2000,0 = 不等)内一个字节都没有 → 忽略 stdin 并在 stderr 提示;收到首字节后读到 EOF;
|
|
8
|
+
* - stdin 是普通文件 / 空设备:直接读(不会卡);TTY 或 `--no-stdin`:不读。
|
|
5
9
|
* - 图片:`--image`(可重复)与提示里的 `@图片路径` / 图片文件路径作为附件(modes/image-input.ts);
|
|
6
10
|
* 显式附件遇到当前模型不收图片、文件不存在或超限 → 用法错误 2,不发请求。
|
|
7
11
|
* - `--output-format text`(缺省):运行结束后输出最后一条助手文本;`json`:一个结果对象(文本、
|
|
8
12
|
* 停止原因、用量、缓存命中率、[W3-C2] `cache` 统计(同 `get_session_stats.cache`)、全部条目);
|
|
9
13
|
* `stream-json`:每个会话事件一行(线上形状同 RPC,含 `cache_miss` / `cache_warm` /
|
|
10
14
|
* `context_pressure`)。
|
|
11
|
-
* -
|
|
12
|
-
* -
|
|
15
|
+
* - 重试:text / json 格式在 stderr 打一行 `↻ 重试 n/m`(stream-json 里本来就有事件),等待期间不再无声。
|
|
16
|
+
* - 无人值守:ask → deny(bootstrap 已按 print 设 unattended)。被拒的调用(`tool_execution_end`
|
|
17
|
+
* 带 `denied`)在 stderr 汇总一行(工具 ×次数、首个原因、放行办法),json 结果带 `deniedTools`。
|
|
18
|
+
* - [W5-H2] 预算(`--max-turns N` / `--max-cost USD` / config `limits.*`,agent/limits.ts):到限
|
|
19
|
+
* (会话发 `limit_reached`)→ stderr 一行、json 带 `limitReached{kind, value, limit}`(回合到限另带
|
|
20
|
+
* `maxTurnsReached: true`)、退出码 8。
|
|
21
|
+
* - [W5-H2] plan 模式产出计划、`plan.unattended: stop`(缺省)没人审批:stderr 一行(计划文件与审批办法)、
|
|
22
|
+
* json 带 `planPending{planId, version, filePath}`、退出码 9。
|
|
23
|
+
* - [W5-H2] `--image` / `@图片` 超限时按 config `images.resize` 缩放(缺省 auto)。
|
|
24
|
+
* - 退出码:最终助手消息 `error / aborted` 或提示被拒 → 1;有工具调用被拒 → 7;到达预算 → 8;
|
|
25
|
+
* 计划待审批 → 9;SIGINT 130、SIGTERM 143(先 abort)。
|
|
13
26
|
*/
|
|
14
27
|
import { currentSession } from "../../cli/compose-session.js";
|
|
15
28
|
import { ExitCode } from "../../cli/exit-codes.js";
|
|
16
29
|
import { errorText, lastAssistant, onStdoutClosed, onTerminationSignals } from "../shared.js";
|
|
17
30
|
import { toJsonLine, toWireEvent } from "./json-event.js";
|
|
31
|
+
import { formatUsd } from "../../agent/limits.js";
|
|
18
32
|
import { promptImages, sessionModel } from "../image-input.js";
|
|
19
33
|
export function joinPrompt(argument, piped) {
|
|
20
34
|
const parts = [argument ?? "", piped.replace(/\s+$/, "")].filter((p) => p.trim() !== "");
|
|
21
35
|
return parts.join("\n\n");
|
|
22
36
|
}
|
|
37
|
+
/** 等 stdin 多久后提示一次「正在等待」。 */
|
|
38
|
+
export const STDIN_WAIT_HINT_MS = 3_000;
|
|
39
|
+
/** 有提示参数时等管道首字节的缺省上限;`AMA_STDIN_WAIT_MS` 覆盖,0 = 不等待。 */
|
|
40
|
+
export const STDIN_FIRST_BYTE_MS = 2_000;
|
|
41
|
+
export function stdinWaitMs(env) {
|
|
42
|
+
const raw = env["AMA_STDIN_WAIT_MS"];
|
|
43
|
+
if (raw === undefined || raw.trim() === "")
|
|
44
|
+
return STDIN_FIRST_BYTE_MS;
|
|
45
|
+
const value = Number(raw);
|
|
46
|
+
return Number.isFinite(value) && value >= 0 ? value : STDIN_FIRST_BYTE_MS;
|
|
47
|
+
}
|
|
48
|
+
/** io 没有首字节读取时的退化:整段读取与超时赛跑。 */
|
|
49
|
+
function readWithin(io, ms) {
|
|
50
|
+
if (io.readStdinFirstByte !== undefined)
|
|
51
|
+
return io.readStdinFirstByte(ms);
|
|
52
|
+
return new Promise((resolve, reject) => {
|
|
53
|
+
const timer = setTimeout(() => resolve(undefined), ms);
|
|
54
|
+
io.readStdin().then((text) => {
|
|
55
|
+
clearTimeout(timer);
|
|
56
|
+
resolve(text);
|
|
57
|
+
}, (error) => {
|
|
58
|
+
clearTimeout(timer);
|
|
59
|
+
reject(error);
|
|
60
|
+
});
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* 决定读不读 stdin(规则见文件头)。`mode`:`auto` 按提示参数与 stdin 类型决定,`explicit`
|
|
65
|
+
* (位置参数 `-`)一直等到 EOF,`off`(`--no-stdin`)不读。
|
|
66
|
+
*/
|
|
67
|
+
export async function readPromptStdin(io, prompt, mode, hintMs = STDIN_WAIT_HINT_MS) {
|
|
68
|
+
if (io.stdinIsTTY || mode === "off")
|
|
69
|
+
return "";
|
|
70
|
+
const kind = io.stdinKind?.() ?? "other";
|
|
71
|
+
const safe = kind === "file" || kind === "null";
|
|
72
|
+
if (prompt !== undefined && prompt !== "" && mode === "auto" && !safe) {
|
|
73
|
+
const waitMs = stdinWaitMs(io.env);
|
|
74
|
+
if (waitMs === 0)
|
|
75
|
+
return "";
|
|
76
|
+
const text = await readWithin(io, waitMs);
|
|
77
|
+
if (text === undefined) {
|
|
78
|
+
io.stderr(`ama: 未在 ${formatSeconds(waitMs)}内收到管道输入,已忽略;需要等待请在末尾加 -\n`);
|
|
79
|
+
return "";
|
|
80
|
+
}
|
|
81
|
+
return text;
|
|
82
|
+
}
|
|
83
|
+
const timer = safe
|
|
84
|
+
? undefined
|
|
85
|
+
: setTimeout(() => io.stderr("ama: 正在等待 stdin 输入结束(Ctrl+D 结束;提示也可以直接写成参数)…\n"), hintMs);
|
|
86
|
+
try {
|
|
87
|
+
return await io.readStdin();
|
|
88
|
+
}
|
|
89
|
+
finally {
|
|
90
|
+
clearTimeout(timer);
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
function formatSeconds(ms) {
|
|
94
|
+
return ms % 1000 === 0 ? `${ms / 1000} 秒` : `${ms} 毫秒`;
|
|
95
|
+
}
|
|
23
96
|
export async function runPrintMode(runtime, context) {
|
|
24
97
|
const { io } = context;
|
|
25
98
|
const format = context.args.outputFormat ?? "text";
|
|
26
|
-
const
|
|
99
|
+
const stdinMode = context.args.noStdin ? "off" : context.args.stdin ? "explicit" : "auto";
|
|
100
|
+
const piped = await readPromptStdin(io, context.prompt, stdinMode);
|
|
27
101
|
const prompt = joinPrompt(context.prompt, piped);
|
|
28
102
|
if (prompt === "") {
|
|
29
103
|
io.stderr("ama: -p 需要提示(位置参数或 stdin 管道)\n");
|
|
@@ -31,16 +105,35 @@ export async function runPrintMode(runtime, context) {
|
|
|
31
105
|
}
|
|
32
106
|
const session = currentSession(runtime);
|
|
33
107
|
let images;
|
|
108
|
+
const resize = runtime.config.images?.resize;
|
|
34
109
|
try {
|
|
35
|
-
images = await promptImages(prompt, context.args.images, io.cwd, sessionModel(runtime.providers, session));
|
|
110
|
+
images = await promptImages(prompt, context.args.images, io.cwd, sessionModel(runtime.providers, session), resize === undefined ? {} : { resize });
|
|
36
111
|
}
|
|
37
112
|
catch (error) {
|
|
38
113
|
io.stderr(`ama: ${errorText(error)}\n`);
|
|
39
114
|
return ExitCode.Usage;
|
|
40
115
|
}
|
|
41
|
-
const
|
|
42
|
-
|
|
43
|
-
|
|
116
|
+
const denied = [];
|
|
117
|
+
let limit;
|
|
118
|
+
let plan;
|
|
119
|
+
const unsubscribe = session.subscribe((event) => {
|
|
120
|
+
if (event.type === "limit_reached")
|
|
121
|
+
limit ??= event;
|
|
122
|
+
else if (event.type === "plan_proposed")
|
|
123
|
+
plan = event;
|
|
124
|
+
else if (event.type === "plan_resolved" && event.planId === plan?.planId)
|
|
125
|
+
plan = undefined;
|
|
126
|
+
if (event.type === "tool_execution_end" && event.denied === true)
|
|
127
|
+
denied.push({
|
|
128
|
+
toolCallId: event.toolCallId,
|
|
129
|
+
toolName: event.toolName,
|
|
130
|
+
reason: textOf(event),
|
|
131
|
+
});
|
|
132
|
+
if (format === "stream-json")
|
|
133
|
+
io.stdout(`${toJsonLine(toWireEvent(event))}\n`);
|
|
134
|
+
else if (event.type === "auto_retry_start")
|
|
135
|
+
io.stderr(`ama: ↻ 重试 ${event.attempt}/${event.maxAttempts}(${Math.round(event.delayMs / 1000)}s 后):${event.errorMessage}\n`);
|
|
136
|
+
});
|
|
44
137
|
let signalled;
|
|
45
138
|
const offSignals = onTerminationSignals((code) => {
|
|
46
139
|
signalled ??= code;
|
|
@@ -88,6 +181,22 @@ export async function runPrintMode(runtime, context) {
|
|
|
88
181
|
cost: stats.cost,
|
|
89
182
|
cacheHitRate: stats.cacheHitRate,
|
|
90
183
|
...(stats.cache !== undefined ? { cache: stats.cache } : {}),
|
|
184
|
+
...(denied.length > 0 ? { deniedTools: denied } : {}),
|
|
185
|
+
...(plan !== undefined
|
|
186
|
+
? {
|
|
187
|
+
planPending: {
|
|
188
|
+
planId: plan.planId,
|
|
189
|
+
version: plan.version,
|
|
190
|
+
...(plan.filePath === undefined ? {} : { filePath: plan.filePath }),
|
|
191
|
+
},
|
|
192
|
+
}
|
|
193
|
+
: {}),
|
|
194
|
+
...(limit !== undefined
|
|
195
|
+
? {
|
|
196
|
+
limitReached: { kind: limit.kind, value: limit.value, limit: limit.limit },
|
|
197
|
+
...(limit.kind === "turns" ? { maxTurnsReached: true } : {}),
|
|
198
|
+
}
|
|
199
|
+
: {}),
|
|
91
200
|
entries: session.entries,
|
|
92
201
|
})}\n`);
|
|
93
202
|
}
|
|
@@ -99,9 +208,53 @@ export async function runPrintMode(runtime, context) {
|
|
|
99
208
|
io.stderr(`ama: ${failure}\n`);
|
|
100
209
|
return ExitCode.RuntimeError;
|
|
101
210
|
}
|
|
211
|
+
if (limit !== undefined) {
|
|
212
|
+
if (denied.length > 0)
|
|
213
|
+
io.stderr(`${describeDenied(denied)}\n`);
|
|
214
|
+
io.stderr(`${describeLimit(limit)}\n`);
|
|
215
|
+
return ExitCode.LimitReached;
|
|
216
|
+
}
|
|
102
217
|
if (last?.stopReason === "error" || last?.stopReason === "aborted") {
|
|
103
218
|
io.stderr(`ama: ${last.errorMessage ?? "模型调用失败"}\n`);
|
|
104
219
|
return ExitCode.RuntimeError;
|
|
105
220
|
}
|
|
221
|
+
if (denied.length > 0)
|
|
222
|
+
io.stderr(`${describeDenied(denied)}\n`);
|
|
223
|
+
if (plan !== undefined) {
|
|
224
|
+
io.stderr(`${describePlanPending(plan)}\n`);
|
|
225
|
+
return ExitCode.PlanPending;
|
|
226
|
+
}
|
|
227
|
+
if (denied.length > 0)
|
|
228
|
+
return ExitCode.ToolDenied;
|
|
106
229
|
return ExitCode.Ok;
|
|
107
230
|
}
|
|
231
|
+
/** stderr 一行:计划已落盘待审批(-p 不替人批准)。 */
|
|
232
|
+
export function describePlanPending(plan) {
|
|
233
|
+
const where = plan.filePath ?? plan.planId;
|
|
234
|
+
return (`ama: 计划 v${plan.version} 已落盘、待审批(未执行):${where};-p 不替人批准——` +
|
|
235
|
+
"在交互界面或 RPC plan_response 里审批,或设 plan.unattended: approve 让 -p 批准后接着执行");
|
|
236
|
+
}
|
|
237
|
+
/** stderr 一行:哪个预算到限。 */
|
|
238
|
+
export function describeLimit(event) {
|
|
239
|
+
return event.kind === "turns"
|
|
240
|
+
? `ama: 已达到回合上限 ${event.limit}(--max-turns / limits.maxTurns),运行在完成前结束`
|
|
241
|
+
: `ama: 已达到费用上限 ${formatUsd(event.limit)}(累计 ${formatUsd(event.value)};` +
|
|
242
|
+
"--max-cost / limits.maxCostUsd),运行在完成前结束";
|
|
243
|
+
}
|
|
244
|
+
function textOf(event) {
|
|
245
|
+
const content = event.result.content;
|
|
246
|
+
const text = typeof content === "string"
|
|
247
|
+
? content
|
|
248
|
+
: content.map((b) => (b.type === "text" ? b.text : "")).join("");
|
|
249
|
+
return text.split("\n")[0]?.trim().slice(0, 200) ?? "";
|
|
250
|
+
}
|
|
251
|
+
/** stderr 一行:被拒的工具 ×次数、首个原因、放行办法。 */
|
|
252
|
+
export function describeDenied(denied) {
|
|
253
|
+
const counts = new Map();
|
|
254
|
+
for (const item of denied)
|
|
255
|
+
counts.set(item.toolName, (counts.get(item.toolName) ?? 0) + 1);
|
|
256
|
+
const tools = [...counts].map(([name, n]) => `${name} ×${n}`).join("、");
|
|
257
|
+
const reason = denied[0]?.reason ?? "";
|
|
258
|
+
return (`ama: ${denied.length} 次工具调用被拒:${tools}${reason !== "" ? `(${reason})` : ""};` +
|
|
259
|
+
"-p 没有人审批,需要放行时用 --permission-mode auto-edit|auto 或 --allow <规则>");
|
|
260
|
+
}
|
|
@@ -8,7 +8,12 @@
|
|
|
8
8
|
* - 审批:`RpcApprovals` 是 UI broker(`set_client_capabilities` 声明 approvals 后挂上),
|
|
9
9
|
* `permission_response` 按 requestId 作答;先到的回答暂存,等 broker 被问到时取用。
|
|
10
10
|
* - 密钥不离开进程:`get_available_models` 只回 `hasKey` 与 `keySource`。
|
|
11
|
+
* - [W5-F] 计划:声明 `plans` 能力后计划审批交客户端(`plan_proposed` → `plan_response`),未声明按
|
|
12
|
+
* `plan.unattended`;`approve_fresh` 在这里新建会话并以计划全文开新回合。`get_tasks / get_agents`
|
|
13
|
+
* 读 `RpcContext.tasks / agents`(W5-G 的注册表与发现结果;未装配时回空表)。
|
|
11
14
|
*/
|
|
15
|
+
import type { AgentInfo } from "../../agents/types.js";
|
|
16
|
+
import type { TaskRegistryView } from "../../tools/types.js";
|
|
12
17
|
import type { AgentSession } from "../../agent/types.js";
|
|
13
18
|
import type { Runtime } from "../../cli/runtime.js";
|
|
14
19
|
import type { ApprovalBroker, ApprovalDecision, ApprovalRequest } from "../../permissions/types.js";
|
|
@@ -32,6 +37,10 @@ export interface RpcContext {
|
|
|
32
37
|
onSessionChanged(next: AgentSession): void;
|
|
33
38
|
/** 运行开始后提示命令自身的失败(应答已发出)。 */
|
|
34
39
|
onBackgroundError(error: unknown): void;
|
|
40
|
+
/** [W5-F] `get_tasks`:子 Agent 任务注册表的只读视图(W5-G 装配;缺省回空表)。 */
|
|
41
|
+
tasks?(): TaskRegistryView | undefined;
|
|
42
|
+
/** [W5-F] `get_agents`:可用的子 Agent 类型与外部 Agent(W5-G / W5-E 装配;缺省回空表)。 */
|
|
43
|
+
agents?(): readonly AgentInfo[];
|
|
35
44
|
}
|
|
36
45
|
export type RpcHandlers = {
|
|
37
46
|
[K in RpcCommandType]: (params: RpcCommandMap[K], ctx: RpcContext) => Promise<unknown>;
|
|
@@ -8,12 +8,19 @@
|
|
|
8
8
|
* - 审批:`RpcApprovals` 是 UI broker(`set_client_capabilities` 声明 approvals 后挂上),
|
|
9
9
|
* `permission_response` 按 requestId 作答;先到的回答暂存,等 broker 被问到时取用。
|
|
10
10
|
* - 密钥不离开进程:`get_available_models` 只回 `hasKey` 与 `keySource`。
|
|
11
|
+
* - [W5-F] 计划:声明 `plans` 能力后计划审批交客户端(`plan_proposed` → `plan_response`),未声明按
|
|
12
|
+
* `plan.unattended`;`approve_fresh` 在这里新建会话并以计划全文开新回合。`get_tasks / get_agents`
|
|
13
|
+
* 读 `RpcContext.tasks / agents`(W5-G 的注册表与发现结果;未装配时回空表)。
|
|
11
14
|
*/
|
|
12
15
|
import { formatModelRef } from "../../ai/providers/channels.js";
|
|
13
16
|
import { AgentSessionImpl } from "../../agent/session.js";
|
|
17
|
+
import { planController } from "../../agent/session-plan.js";
|
|
18
|
+
import { currentTodos } from "../../plan/store.js";
|
|
14
19
|
import { getSupportedLevels } from "../../ai/thinking.js";
|
|
15
20
|
import { switchSession } from "../../cli/compose-session.js";
|
|
16
21
|
import { AmaError } from "../../errors.js";
|
|
22
|
+
import { isPermissionMode } from "../../permissions/modes.js";
|
|
23
|
+
import { PERMISSION_MODES_STRICT_FIRST } from "../../permissions/types.js";
|
|
17
24
|
import { BUILTIN_COMMANDS } from "../commands-core.js";
|
|
18
25
|
/** 审批 broker:等客户端 `permission_response`。 */
|
|
19
26
|
export class RpcApprovals {
|
|
@@ -60,6 +67,17 @@ function impl(session) {
|
|
|
60
67
|
return session;
|
|
61
68
|
throw new AmaError("not_implemented", "该会话不支持此命令");
|
|
62
69
|
}
|
|
70
|
+
/** [W5-F] 当前会话的计划控制面;会话没有装配 plan 扩展时报 not_implemented。 */
|
|
71
|
+
function plans(ctx) {
|
|
72
|
+
const controller = planController(ctx.session());
|
|
73
|
+
if (controller === undefined)
|
|
74
|
+
throw new AmaError("not_implemented", "该会话没有装配 plan 扩展");
|
|
75
|
+
return controller;
|
|
76
|
+
}
|
|
77
|
+
/** 声明了 `plans` 能力 → 客户端作答;否则按 `plan.unattended`。换会话后重新应用。 */
|
|
78
|
+
function applyPlanAttendance(ctx) {
|
|
79
|
+
planController(ctx.session())?.setAttendance(ctx.capabilities.has("plans") ? "client" : "unattended");
|
|
80
|
+
}
|
|
63
81
|
/** 开始一次运行:开始 / 入队 / 被处理后即返回,不等运行结束。 */
|
|
64
82
|
async function startRun(ctx, run) {
|
|
65
83
|
const session = ctx.session();
|
|
@@ -87,6 +105,7 @@ async function startRun(ctx, run) {
|
|
|
87
105
|
async function switched(ctx, next, reason) {
|
|
88
106
|
const session = await next;
|
|
89
107
|
ctx.onSessionChanged(session);
|
|
108
|
+
applyPlanAttendance(ctx);
|
|
90
109
|
if (session instanceof AgentSessionImpl)
|
|
91
110
|
session.announceStart(reason);
|
|
92
111
|
return { sessionId: session.state.sessionId, sessionFile: session.state.sessionFile };
|
|
@@ -211,12 +230,24 @@ export const handlers = {
|
|
|
211
230
|
]
|
|
212
231
|
: []),
|
|
213
232
|
}),
|
|
233
|
+
get_rewind_points: async (_p, ctx) => ({ points: ctx.session().rewindPoints() }),
|
|
234
|
+
rewind: async (p, ctx) => {
|
|
235
|
+
const request = { entryId: p.entryId, mode: p.mode };
|
|
236
|
+
if (p.dryRun !== undefined)
|
|
237
|
+
request.dryRun = p.dryRun;
|
|
238
|
+
if (p.onConflict !== undefined)
|
|
239
|
+
request.onConflict = p.onConflict;
|
|
240
|
+
return ctx.session().rewind(request);
|
|
241
|
+
},
|
|
242
|
+
summarize_from: async (p, ctx) => ctx.session().summarizeFrom(p.entryId, p.instructions),
|
|
243
|
+
summarize_up_to: async (p, ctx) => ctx.session().summarizeUpTo(p.entryId, p.instructions),
|
|
214
244
|
set_client_capabilities: async (p, ctx) => {
|
|
215
245
|
ctx.capabilities = new Set(p.capabilities);
|
|
216
246
|
const approvals = ctx.capabilities.has("approvals");
|
|
217
247
|
ctx.runtime.approvals.setUiBroker(approvals ? ctx.approvals : undefined);
|
|
218
248
|
if (!approvals)
|
|
219
249
|
ctx.approvals.cancelAll();
|
|
250
|
+
applyPlanAttendance(ctx);
|
|
220
251
|
return { capabilities: [...ctx.capabilities] };
|
|
221
252
|
},
|
|
222
253
|
permission_response: async (p, ctx) => ({
|
|
@@ -254,10 +285,28 @@ export const handlers = {
|
|
|
254
285
|
};
|
|
255
286
|
},
|
|
256
287
|
set_permission_mode: async (p, ctx) => {
|
|
288
|
+
if (!isPermissionMode(p.mode)) {
|
|
289
|
+
throw new AmaError("invalid_arguments", `mode 应为 ${PERMISSION_MODES_STRICT_FIRST.join(" | ")}`);
|
|
290
|
+
}
|
|
257
291
|
ctx.session().setPermissionMode(p.mode);
|
|
258
292
|
return { mode: p.mode };
|
|
259
293
|
},
|
|
260
294
|
get_commands: async (_p, ctx) => ({ commands: commands(ctx.runtime) }),
|
|
261
295
|
get_skills: async (_p, ctx) => ({ skills: ctx.runtime.resources.skills }),
|
|
296
|
+
// [W5-F] 计划 / 任务命令(docs/wave5-plan.md §6.5、§7.5)
|
|
297
|
+
plan_response: async (p, ctx) => {
|
|
298
|
+
const result = await plans(ctx).respond(p);
|
|
299
|
+
if (result.freshPrompt !== undefined) {
|
|
300
|
+
const prompt = result.freshPrompt;
|
|
301
|
+
await switched(ctx, switchSession(ctx.runtime, { kind: "new" }), "new");
|
|
302
|
+
planController(ctx.session())?.adopt(result.plan);
|
|
303
|
+
await startRun(ctx, () => ctx.session().prompt(prompt, { origin: "plan" }));
|
|
304
|
+
}
|
|
305
|
+
return { planId: result.planId, decision: result.decision };
|
|
306
|
+
},
|
|
307
|
+
get_plan: async (p, ctx) => plans(ctx).get(p.planId),
|
|
308
|
+
get_todos: async (_p, ctx) => ({ items: currentTodos(impl(ctx.session()).manager.branch()) }),
|
|
309
|
+
get_tasks: async (_p, ctx) => ({ tasks: [...(ctx.tasks?.()?.list() ?? [])] }),
|
|
310
|
+
get_agents: async (_p, ctx) => ({ agents: [...(ctx.agents?.() ?? [])] }),
|
|
262
311
|
};
|
|
263
312
|
export const RPC_COMMAND_TYPES = Object.keys(handlers);
|
|
@@ -19,9 +19,11 @@ import { RPC_PROTOCOL_VERSION } from "../../rpc.js";
|
|
|
19
19
|
import { AMA_VERSION } from "../../version.js";
|
|
20
20
|
import { toJsonLine, toWireEvent } from "../print/json-event.js";
|
|
21
21
|
import { errorText, onTerminationSignals } from "../shared.js";
|
|
22
|
+
import { sessionAgents, taskRegistryView } from "../../agent/subagent-registry.js";
|
|
23
|
+
import { cachedAgentInfos } from "../../agents/external.js";
|
|
22
24
|
import { RpcApprovals, handlers } from "./commands.js";
|
|
23
25
|
import { createLineReader, writeChunked } from "./jsonl.js";
|
|
24
|
-
export const RPC_CAPABILITIES = ["approvals", "images", "hooks"];
|
|
26
|
+
export const RPC_CAPABILITIES = ["approvals", "images", "hooks", "plans"];
|
|
25
27
|
export async function runRpcMode(runtime, context, options = {}) {
|
|
26
28
|
const stdin = options.stdin ?? process.stdin;
|
|
27
29
|
const stdout = options.stdout ?? process.stdout;
|
|
@@ -48,6 +50,10 @@ export async function runRpcMode(runtime, context, options = {}) {
|
|
|
48
50
|
onBackgroundError(error) {
|
|
49
51
|
void write({ type: "notification", level: "error", message: errorText(error) });
|
|
50
52
|
},
|
|
53
|
+
// [W5-G] get_tasks / get_agents:当前会话的任务注册表与可用类型
|
|
54
|
+
tasks: () => taskRegistryView(session.state.sessionId),
|
|
55
|
+
// [W5-EG] 外部 Agent 的安装 / 版本要异步探测:会话建立时缓存、变化时刷新,未就绪时只列类型目录
|
|
56
|
+
agents: () => cachedAgentInfos(session.state.sessionId) ?? sessionAgents(session.state.sessionId),
|
|
51
57
|
};
|
|
52
58
|
runtime.notifier.set((message, level) => {
|
|
53
59
|
void write({ type: "notification", level, message });
|
|
@@ -47,6 +47,17 @@ export declare function warmStopText(reason: string | undefined): string;
|
|
|
47
47
|
export declare function warmingText(status: WarmerStatus, now: number, minSavingsUsd: number | undefined): string;
|
|
48
48
|
/** 缓存段的键值行(`/session` 与 `/cache` 共用)。 */
|
|
49
49
|
export declare function cacheRows(session: AgentSession, now?: number): KeyValueRow[];
|
|
50
|
+
/** [W5-U] 外部 Agent 用量一项:美元 / token / 请求数按各自单位,不换算。 */
|
|
51
|
+
export declare function externalUsageText(usage: {
|
|
52
|
+
runs: number;
|
|
53
|
+
unit: "usd" | "tokens" | "requests";
|
|
54
|
+
amount: number;
|
|
55
|
+
tokens?: number;
|
|
56
|
+
}): string;
|
|
57
|
+
/** [W5-U] 「外部 Agent」段(`getStats().external.byAgent`);没有外部运行时为空。 */
|
|
58
|
+
export declare function externalRows(session: AgentSession): KeyValueRow[];
|
|
59
|
+
/** [W5-U] 子 Agent 任务汇总(`getStats().tasks`);没有任务时 undefined。 */
|
|
60
|
+
export declare function taskStatsText(session: AgentSession): string | undefined;
|
|
50
61
|
/** 键值行 → 纯文本(键列对齐、去行尾空白)。 */
|
|
51
62
|
export declare function renderRows(rows: readonly KeyValueRow[], indent?: string): string[];
|
|
52
63
|
export declare function describeCache(session: AgentSession, now?: number): string;
|
|
@@ -219,6 +219,45 @@ export function cacheRows(session, now = Date.now()) {
|
|
|
219
219
|
}
|
|
220
220
|
return rows;
|
|
221
221
|
}
|
|
222
|
+
/** [W5-U] 外部 Agent 用量一项:美元 / token / 请求数按各自单位,不换算。 */
|
|
223
|
+
export function externalUsageText(usage) {
|
|
224
|
+
const amount = usage.unit === "usd"
|
|
225
|
+
? formatUsd(usage.amount)
|
|
226
|
+
: usage.unit === "tokens"
|
|
227
|
+
? `${formatTokenCount(usage.amount)} token`
|
|
228
|
+
: `${usage.amount} 次请求`;
|
|
229
|
+
const tokens = usage.unit !== "tokens" && usage.tokens !== undefined && usage.tokens > 0
|
|
230
|
+
? ` · ${formatTokenCount(usage.tokens)} token`
|
|
231
|
+
: "";
|
|
232
|
+
return `${usage.runs} 次运行 · ${amount}${tokens}`;
|
|
233
|
+
}
|
|
234
|
+
/** [W5-U] 「外部 Agent」段(`getStats().external.byAgent`);没有外部运行时为空。 */
|
|
235
|
+
export function externalRows(session) {
|
|
236
|
+
const byAgent = session.getStats().external?.byAgent ?? {};
|
|
237
|
+
return Object.entries(byAgent)
|
|
238
|
+
.sort(([a], [b]) => a.localeCompare(b))
|
|
239
|
+
.map(([agent, usage]) => ({ key: agent, value: externalUsageText(usage) }));
|
|
240
|
+
}
|
|
241
|
+
/** [W5-U] 子 Agent 任务汇总(`getStats().tasks`);没有任务时 undefined。 */
|
|
242
|
+
export function taskStatsText(session) {
|
|
243
|
+
const tasks = session.getStats().tasks;
|
|
244
|
+
if (tasks === undefined || tasks.total === 0)
|
|
245
|
+
return undefined;
|
|
246
|
+
const parts = [`${tasks.total} 个任务`];
|
|
247
|
+
if (tasks.running > 0)
|
|
248
|
+
parts.push(`运行中 ${tasks.running}`);
|
|
249
|
+
const labels = {
|
|
250
|
+
completed: "完成",
|
|
251
|
+
failed: "失败",
|
|
252
|
+
aborted: "已停止",
|
|
253
|
+
max_turns: "轮数耗尽",
|
|
254
|
+
interrupted: "已中断",
|
|
255
|
+
};
|
|
256
|
+
for (const [status, count] of Object.entries(tasks.byStatus))
|
|
257
|
+
if (count !== undefined && count > 0)
|
|
258
|
+
parts.push(`${labels[status] ?? status} ${count}`);
|
|
259
|
+
return `${parts.join(" · ")}(/tasks)`;
|
|
260
|
+
}
|
|
222
261
|
/** 键值行 → 纯文本(键列对齐、去行尾空白)。 */
|
|
223
262
|
export function renderRows(rows, indent = "") {
|
|
224
263
|
return new KeyValue(rows)
|
|
@@ -257,7 +296,15 @@ export function describeSession(session, now = Date.now()) {
|
|
|
257
296
|
value: `${stats.contextTokens ?? "?"} / ${stats.contextWindow ?? "?"}(${percent}%)`,
|
|
258
297
|
},
|
|
259
298
|
];
|
|
260
|
-
|
|
299
|
+
const tasks = taskStatsText(session);
|
|
300
|
+
if (tasks !== undefined)
|
|
301
|
+
rows.push({ key: "子 Agent", value: tasks });
|
|
302
|
+
const external = externalRows(session);
|
|
303
|
+
return [
|
|
304
|
+
...renderRows(rows),
|
|
305
|
+
describeCache(session, now),
|
|
306
|
+
...(external.length > 0 ? ["外部 Agent", ...renderRows(external, " ")] : []),
|
|
307
|
+
].join("\n");
|
|
261
308
|
}
|
|
262
309
|
/** `/cache fingerprint`:最近一次真实请求的前缀指纹(system / tools 哈希与模型)。 */
|
|
263
310
|
export function describeFingerprint(session) {
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* auto 模式下 bash 的规则层与静态判定(§7.4,docs/permissions.md)。
|
|
3
|
+
*
|
|
4
|
+
* 规则层(命中即询问,不调模型)——外层与每层嵌套命令(`sh -c`、`eval`、`xargs`、`find -exec`,
|
|
5
|
+
* 见 dangerous.ts)的每一段都查:
|
|
6
|
+
* - 网络命令({@link networkReason}):curl / wget / ssh / git push|pull|fetch|clone / npm install / npx …
|
|
7
|
+
* - 删除与回退({@link destructiveReason}):rm -r|-f、find -delete、git clean / restore / checkout -- …
|
|
8
|
+
* - 写入目标:重定向(`>`、`>>`、`&>`)、tee、cp / mv / mkdir / touch / ln / chmod 等的目标在项目外或受保护;
|
|
9
|
+
* - 参数里出现机密路径(`cat .env`、`< ~/.ssh/id_rsa`、`--env-file=.env`)。
|
|
10
|
+
*
|
|
11
|
+
* 静态判定(全部满足即放行):每一段都命中安全名单({@link AUTO_SAFE_COMMANDS} + 用户追加),整条命令
|
|
12
|
+
* 没有命令替换、参数没有变量展开 `$X`、没有可能匹配点文件的通配、没有超深嵌套。
|
|
13
|
+
*
|
|
14
|
+
* 分段与分词复用 rules.ts / dangerous.ts(引号内不切、剥环境赋值与 env / nohup / time 等前缀)。
|
|
15
|
+
*/
|
|
16
|
+
export interface SafeCommandSpec {
|
|
17
|
+
/** 词前缀:`["git", "status"]` 命中 `git status -s`。git 的全局选项只允许 `-C <dir>` 与 `--no-pager`。 */
|
|
18
|
+
words: readonly string[];
|
|
19
|
+
/** 前缀之后任一参数命中即不安全。 */
|
|
20
|
+
forbid?: RegExp;
|
|
21
|
+
/** 前缀之后必须出现的参数。 */
|
|
22
|
+
require?: string;
|
|
23
|
+
}
|
|
24
|
+
/** 初始安全名单(每条在 auto-safe.test.ts 有正反例)。 */
|
|
25
|
+
export declare const AUTO_SAFE_COMMANDS: readonly SafeCommandSpec[];
|
|
26
|
+
/**
|
|
27
|
+
* 用户追加的安全命令(`permission.autoSafeCommands`):不含 `*` 按词前缀;含 `*` 按通配匹配整段
|
|
28
|
+
* (剥过前缀、重定向之后的命令文本)。
|
|
29
|
+
*/
|
|
30
|
+
export declare function extraSafeMatches(argv: readonly string[], entry: string): boolean;
|
|
31
|
+
/** 网络命令:返回说明;不是返回 undefined。 */
|
|
32
|
+
export declare function networkReason(argv: readonly string[]): string | undefined;
|
|
33
|
+
/** 删除与丢弃改动的命令:返回说明;不是返回 undefined。 */
|
|
34
|
+
export declare function destructiveReason(argv: readonly string[]): string | undefined;
|
|
35
|
+
export interface Redirects {
|
|
36
|
+
/** 输出重定向目标(`>`、`>>`、`>|`、`&>`)。 */
|
|
37
|
+
outputs: string[];
|
|
38
|
+
/** 输入重定向来源(`<`)。 */
|
|
39
|
+
inputs: string[];
|
|
40
|
+
/** 去掉重定向之后的段文本。 */
|
|
41
|
+
rest: string;
|
|
42
|
+
}
|
|
43
|
+
/** 从一段命令里取出重定向(引号内不算);`2>&1`、`>&2` 是复制描述符,没有目标。 */
|
|
44
|
+
export declare function extractRedirects(segment: string): Redirects;
|
|
45
|
+
export interface BashAutoOptions {
|
|
46
|
+
cwd: string;
|
|
47
|
+
projectRoot: string;
|
|
48
|
+
/** `permission.autoSafeCommands`。 */
|
|
49
|
+
extraSafe?: readonly string[];
|
|
50
|
+
}
|
|
51
|
+
export interface BashAutoAnalysis {
|
|
52
|
+
/** 规则层要询问的原因;undefined = 规则层不管。 */
|
|
53
|
+
ask?: string;
|
|
54
|
+
/** 静态判定放行。 */
|
|
55
|
+
safe: boolean;
|
|
56
|
+
/** 不安全(交给分类器)的原因,审计用。 */
|
|
57
|
+
reason: string;
|
|
58
|
+
}
|
|
59
|
+
/** auto 模式下一条 bash 命令的规则层与静态判定结论。 */
|
|
60
|
+
export declare function analyzeBashForAuto(command: string, options: BashAutoOptions): BashAutoAnalysis;
|
|
61
|
+
/**
|
|
62
|
+
* [S2] 命令文本里出现的机密路径(读写都算,含嵌套命令);没有返回 undefined。default 模式「沙箱内免审批」
|
|
63
|
+
* 用它把 `cat .env` 之类留给正常审批:OS 沙箱挡不住读工作区里的机密文件,输出会进模型上下文。
|
|
64
|
+
*/
|
|
65
|
+
export declare function secretReferenceReason(command: string, cwd: string): string | undefined;
|