@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
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 交互界面的底部区域:提示行、速率行(status-line.ts)与状态栏(status-bar.ts)的装配。[W5-A]
|
|
3
|
+
*
|
|
4
|
+
* - 布局 `ui.statusLine`(独立终端缺省 full;有 profile 时 PROFILE_DEFAULTS 给 compact);运行时 Ctrl+G
|
|
5
|
+
* (`app.statusLine.toggle`)或 `/statusline [full|compact]` 切换,只影响本会话(本进程),不写配置。
|
|
6
|
+
* - 会话时长从本进程打开当前会话(含 /new /resume /fork 切换)起算,用界面的时钟。
|
|
7
|
+
* - git:`GitInfoWatcher` 在回合边界刷新——agent_settled、写类工具(write / edit / bash / task)结束、
|
|
8
|
+
* session_rewound、/tree 之后;结果变化时重画。
|
|
9
|
+
* - [W5-U] `model_fallback` 之后状态栏模型项显示 `主模型 → 回退模型`,切回主模型(`model_changed`)后消失。
|
|
10
|
+
* - `telemetry_tick`(流式中 ≤ 2 Hz)只重取统计并重画(速率行),状态栏的内容这时不变。
|
|
11
|
+
*/
|
|
12
|
+
import { basename } from "node:path";
|
|
13
|
+
import { sandboxCapabilityFor } from "../../codemode/capability.js";
|
|
14
|
+
import { formatModelRef } from "../../ai/providers/channels.js";
|
|
15
|
+
import { GitInfoWatcher } from "../../git/info.js";
|
|
16
|
+
import { resolveBashSandbox } from "../../sandbox/bash.js";
|
|
17
|
+
import { osSandboxStatus } from "../../sandbox/detect.js";
|
|
18
|
+
import { effectiveCodemodeMode } from "../../tools/presets.js";
|
|
19
|
+
import { truncateToWidth } from "../../tui.js";
|
|
20
|
+
import { StatusBar } from "./status-bar.js";
|
|
21
|
+
import { StatusLine } from "./status-line.js";
|
|
22
|
+
/** 结束后可能改了工作区的工具。 */
|
|
23
|
+
const WRITE_TOOLS = new Set(["write", "edit", "bash", "task"]);
|
|
24
|
+
/** 一行提示;空时不占行。 */
|
|
25
|
+
export class HintLine {
|
|
26
|
+
text = "";
|
|
27
|
+
setText(text) {
|
|
28
|
+
this.text = text;
|
|
29
|
+
}
|
|
30
|
+
render(width) {
|
|
31
|
+
return this.text === "" ? [] : [truncateToWidth(this.text, width)];
|
|
32
|
+
}
|
|
33
|
+
invalidate() { }
|
|
34
|
+
}
|
|
35
|
+
export class StatusArea {
|
|
36
|
+
deps;
|
|
37
|
+
hint = new HintLine();
|
|
38
|
+
bar;
|
|
39
|
+
rate;
|
|
40
|
+
mode;
|
|
41
|
+
startedAt;
|
|
42
|
+
git;
|
|
43
|
+
gitCwd;
|
|
44
|
+
offGit = () => undefined;
|
|
45
|
+
sandboxStrict;
|
|
46
|
+
/** [W5-U] 模型回退中(`model_fallback` 到切回主模型)。 */
|
|
47
|
+
fallback;
|
|
48
|
+
bashSandbox;
|
|
49
|
+
constructor(deps) {
|
|
50
|
+
this.deps = deps;
|
|
51
|
+
const { runtime } = deps;
|
|
52
|
+
this.mode = deps.layout ?? runtime.config.ui?.statusLine ?? "full";
|
|
53
|
+
this.startedAt = deps.now();
|
|
54
|
+
const source = {
|
|
55
|
+
session: () => deps.session(),
|
|
56
|
+
preset: () => runtime.config.tools?.preset ?? "default",
|
|
57
|
+
hostStatus: () => runtime.host?.status(),
|
|
58
|
+
codemode: () => {
|
|
59
|
+
const mode = effectiveCodemodeMode(runtime.config);
|
|
60
|
+
const active = deps
|
|
61
|
+
.session()
|
|
62
|
+
.getTools()
|
|
63
|
+
.some((tool) => tool.name === "codemode");
|
|
64
|
+
return mode === "off" || !active ? undefined : mode;
|
|
65
|
+
},
|
|
66
|
+
// S2:Node 权限模型与 OS 沙箱都不隔离网络时才标 net!(尊重 sandbox.enabled)
|
|
67
|
+
sandboxStrict: () => (this.sandboxStrict ??= sandboxCapabilityFor(runtime.config).strict),
|
|
68
|
+
layout: () => this.mode,
|
|
69
|
+
git: () => this.gitView(),
|
|
70
|
+
now: () => deps.now(),
|
|
71
|
+
sessionStartedAt: () => this.startedAt,
|
|
72
|
+
fallback: () => this.fallback,
|
|
73
|
+
// S2:bash 沙箱生效(配置 + 本机能力,与 compose 同一结论)且 bash 工具活动
|
|
74
|
+
bashSandbox: () => (this.bashSandbox ??= resolveBashSandbox(runtime.config.sandbox, {
|
|
75
|
+
status: osSandboxStatus(),
|
|
76
|
+
}).active) &&
|
|
77
|
+
deps
|
|
78
|
+
.session()
|
|
79
|
+
.getTools()
|
|
80
|
+
.some((tool) => tool.name === "bash"),
|
|
81
|
+
};
|
|
82
|
+
this.bar = new StatusBar(source, deps.theme);
|
|
83
|
+
this.rate = new StatusLine(this.bar, source, deps.theme);
|
|
84
|
+
this.watchGit();
|
|
85
|
+
}
|
|
86
|
+
layout() {
|
|
87
|
+
return this.mode;
|
|
88
|
+
}
|
|
89
|
+
setLayout(mode) {
|
|
90
|
+
if (mode === this.mode)
|
|
91
|
+
return;
|
|
92
|
+
this.mode = mode;
|
|
93
|
+
(this.deps.redraw ?? this.deps.render)();
|
|
94
|
+
}
|
|
95
|
+
toggle() {
|
|
96
|
+
this.setLayout(this.mode === "full" ? "compact" : "full");
|
|
97
|
+
return this.mode;
|
|
98
|
+
}
|
|
99
|
+
refresh() {
|
|
100
|
+
this.bar.refresh();
|
|
101
|
+
}
|
|
102
|
+
/** 换了会话(/new /resume /fork):时长重新起算,cwd 变了就换 git 监视。 */
|
|
103
|
+
rebind() {
|
|
104
|
+
this.startedAt = this.deps.now();
|
|
105
|
+
this.fallback = undefined;
|
|
106
|
+
this.watchGit();
|
|
107
|
+
this.bar.refresh();
|
|
108
|
+
}
|
|
109
|
+
refreshGit() {
|
|
110
|
+
void this.git?.refresh();
|
|
111
|
+
}
|
|
112
|
+
/** 返回 true:事件已处理完(只需重画),调用方不再分派。 */
|
|
113
|
+
onEvent(event) {
|
|
114
|
+
switch (event.type) {
|
|
115
|
+
case "telemetry_tick":
|
|
116
|
+
this.bar.refresh();
|
|
117
|
+
return true;
|
|
118
|
+
case "agent_settled":
|
|
119
|
+
case "session_rewound":
|
|
120
|
+
this.refreshGit();
|
|
121
|
+
return false;
|
|
122
|
+
case "tool_execution_end":
|
|
123
|
+
if (WRITE_TOOLS.has(event.toolName))
|
|
124
|
+
this.refreshGit();
|
|
125
|
+
return false;
|
|
126
|
+
case "model_fallback":
|
|
127
|
+
this.fallback = {
|
|
128
|
+
from: formatModelRef(event.from),
|
|
129
|
+
to: formatModelRef(event.to),
|
|
130
|
+
};
|
|
131
|
+
this.bar.refresh();
|
|
132
|
+
return false;
|
|
133
|
+
case "model_changed": {
|
|
134
|
+
const model = this.deps.session().state.model;
|
|
135
|
+
if (this.fallback !== undefined && model !== undefined) {
|
|
136
|
+
if (formatModelRef(model) === this.fallback.from)
|
|
137
|
+
this.fallback = undefined;
|
|
138
|
+
}
|
|
139
|
+
return false;
|
|
140
|
+
}
|
|
141
|
+
default:
|
|
142
|
+
return false;
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
dispose() {
|
|
146
|
+
this.offGit();
|
|
147
|
+
this.git?.dispose();
|
|
148
|
+
this.git = undefined;
|
|
149
|
+
}
|
|
150
|
+
gitView() {
|
|
151
|
+
const cwd = this.gitCwd;
|
|
152
|
+
if (cwd === undefined)
|
|
153
|
+
return undefined;
|
|
154
|
+
return { dir: basename(cwd), info: this.git?.current() };
|
|
155
|
+
}
|
|
156
|
+
watchGit() {
|
|
157
|
+
const cwd = this.deps.session().state.cwd;
|
|
158
|
+
if (cwd === this.gitCwd && this.git !== undefined)
|
|
159
|
+
return;
|
|
160
|
+
this.dispose();
|
|
161
|
+
this.gitCwd = cwd;
|
|
162
|
+
const git = new GitInfoWatcher(cwd, this.deps.env !== undefined ? { env: this.deps.env } : {});
|
|
163
|
+
this.git = git;
|
|
164
|
+
this.offGit = git.onChange(() => this.deps.render());
|
|
165
|
+
void git.refresh();
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
/**
|
|
169
|
+
* `/statusline [full|compact]`(无参数切换):是这条命令就处理并返回 true,否则 false 交给其它命令。
|
|
170
|
+
* line 模式没有底部信息行,commands-core 只登记命令名、回一句说明。
|
|
171
|
+
*/
|
|
172
|
+
export function statusLineSlash(area, line, notice) {
|
|
173
|
+
const match = /^\/statusline(?:\s+(.*))?$/i.exec(line.trim());
|
|
174
|
+
if (match === null)
|
|
175
|
+
return false;
|
|
176
|
+
const value = (match[1] ?? "").trim();
|
|
177
|
+
if (value === "")
|
|
178
|
+
area.toggle();
|
|
179
|
+
else if (value === "full" || value === "compact")
|
|
180
|
+
area.setLayout(value);
|
|
181
|
+
else {
|
|
182
|
+
notice("error", "用法:/statusline [full|compact]");
|
|
183
|
+
return true;
|
|
184
|
+
}
|
|
185
|
+
notice("info", statusLineText(area.layout()));
|
|
186
|
+
return true;
|
|
187
|
+
}
|
|
188
|
+
export function statusLineText(mode) {
|
|
189
|
+
return mode === "full" ? "状态栏:完整(两行)" : "状态栏:精简(一行)";
|
|
190
|
+
}
|
|
@@ -1,22 +1,34 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* 状态栏(设计 §12.6
|
|
2
|
+
* 状态栏(设计 §12.6;终端界面视觉设计 v1 §3.10;第五波 §1):编辑器下方,永远是最后一行。[B7][W5-A]
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
4
|
+
* 两区:左区「权限模式 + shift+tab 切换」,右区信息,中间用空格撑开;空隙不足 4 列时退回单区。模式永远在最左;
|
|
5
|
+
* 同组项(模型与思考级别、目录与 git)以空格相连。compact 分隔符固定为 ` · `(tmux 宿主按此解析),full 按用户
|
|
6
|
+
* 样例用 ` | `。
|
|
6
7
|
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
* -
|
|
16
|
-
*
|
|
17
|
-
*
|
|
8
|
+
* 两种布局(`ui.statusLine`,§1.1):
|
|
9
|
+
* - `compact`(嵌入宿主缺省,即原单行状态栏):
|
|
10
|
+
* `Manual · shift+tab 切换 sonnet-4-5 · medium · ↑12.3k ↓1.2k · cache 80% ♨ · $0.12 · ctx 34% · proj ⎇ main 5ae9e54 +12 −3 · 2h24m`
|
|
11
|
+
* 右区顺序:模型 · 思考 · `↑ ↓` · cache · 费用 · rebill · ctx · git · 时长 · queue · codemode · 预设 · [宿主]。
|
|
12
|
+
* - `full`(独立终端缺省,用户样例):用量类项移到上方速率行(status-line.ts),本行为
|
|
13
|
+
* `Manual | 模型 思考 | Ctx 3.0% | 目录 ⎇ 分支 短提交 (+a,-d) | $费用 | 会话时长`;Ctx 一位小数、不换余量表。
|
|
14
|
+
*
|
|
15
|
+
* - 用量来自 `session.getStats()`,只在 `refresh()` 时读取(事件驱动),渲染只拼字符串;时长按渲染时刻算。
|
|
16
|
+
* - [W3-C2] `cache` 是**最近一次**请求的命中率;端点三态 `cache —` / `cache 未报告`;保温中追加 `♨`;
|
|
17
|
+
* 重计费 `rebill $x`(无价模型显示 token);codemode 生效时 `codemode on|only`,网络未隔离追加 `net!`
|
|
18
|
+
* (S2:Node 权限模型与 OS 沙箱都不隔离网络时)。
|
|
19
|
+
* - 费用 = `stats.cost` + 外部 Agent 以美元计的用量(`stats.external`,W5-E;其它单位只在 /session 显示)。
|
|
20
|
+
* - 着色:整行 dim;模式名正文色(Bypass permissions warning、Plan accent);模型 accent;ctx 按阈值
|
|
21
|
+
* success / warning / error;rebill、queue warning;`net!` error。宽 ≥ 110 时 ctx 用余量表。
|
|
22
|
+
* - [W5-U] bash 在操作系统沙箱里跑时(S2)用量类项多一个 `沙箱`(与 codemode 同一丢弃优先级)。
|
|
23
|
+
* - [W5-U] 模型回退中(`model_fallback`)模型项显示 `主模型 → 回退模型`,切回主模型后恢复。
|
|
24
|
+
* - 模型名缩写:宽 < 100 去掉供应商前缀,< 60 再去掉 `@渠道`,< 48 去掉版本后缀(第一个 `-数字` 起)。
|
|
25
|
+
* - ASCII:`⎇` → `git`(字形表 `branch`)、`−` → `-`、`♨` → `~`。
|
|
26
|
+
* - 宽度不够时按优先级丢弃(数字大的先丢,表见 §1.2);会变的数字按最宽形状占位(`reserve`),
|
|
27
|
+
* 数字变化不会让某项时有时无(40 列不抖动)。
|
|
18
28
|
*/
|
|
19
|
-
import type { AgentSession, SessionCacheStats } from "../../agent/types.js";
|
|
29
|
+
import type { AgentSession, SessionCacheStats, SessionStats } from "../../agent/types.js";
|
|
30
|
+
import type { StatusLineMode } from "../../config/types.js";
|
|
31
|
+
import type { GitInfo } from "../../git/info.js";
|
|
20
32
|
import { type Component, type Theme } from "../../tui.js";
|
|
21
33
|
export interface StatusBarSource {
|
|
22
34
|
session(): AgentSession;
|
|
@@ -28,11 +40,83 @@ export interface StatusBarSource {
|
|
|
28
40
|
codemode?(): "on" | "only" | undefined;
|
|
29
41
|
/** 沙箱是否隔离网络(缺省 true,不标 `net!`)。 */
|
|
30
42
|
sandboxStrict?(): boolean;
|
|
43
|
+
/** 布局;缺省 `compact`(单行)。 */
|
|
44
|
+
layout?(): StatusLineMode;
|
|
45
|
+
/** 工作目录名与 git 信息;没有时不显示目录与 git。 */
|
|
46
|
+
git?(): {
|
|
47
|
+
dir: string;
|
|
48
|
+
info: GitInfo | undefined;
|
|
49
|
+
} | undefined;
|
|
50
|
+
/** 会话时长的时钟(缺省 Date.now)。 */
|
|
51
|
+
now?(): number;
|
|
52
|
+
/** 会话时长的起点;缺省取 `getStats().telemetry.sessionStartedAt`。 */
|
|
53
|
+
sessionStartedAt?(): number | undefined;
|
|
54
|
+
/** [W5-U] bash 命令在操作系统沙箱里跑(S2 第二阶段,`sandbox.bash: auto` 且可用、bash 工具活动)。 */
|
|
55
|
+
bashSandbox?(): boolean;
|
|
56
|
+
/** [W5-U] 模型回退中(`model_fallback` 之后、切回主模型之前):主模型与回退模型的引用。 */
|
|
57
|
+
fallback?(): {
|
|
58
|
+
from: string;
|
|
59
|
+
to: string;
|
|
60
|
+
} | undefined;
|
|
31
61
|
}
|
|
32
62
|
export declare function formatTokens(count: number): string;
|
|
33
63
|
export declare function formatCost(cost: number): string;
|
|
64
|
+
/** 会话时长:`Ns` / `Nm` / `NhMm`。 */
|
|
65
|
+
export declare function formatDuration(ms: number): string;
|
|
34
66
|
/** `cache 83%` / `cache —` / `cache 未报告`,保温计时中追加 ` ♨`。 */
|
|
35
|
-
export declare function cacheText(cache: SessionCacheStats): string;
|
|
67
|
+
export declare function cacheText(cache: SessionCacheStats, warm?: string): string;
|
|
68
|
+
/** 状态费用:会话费用 + 外部 Agent 以美元计的用量;会话费用未知为 undefined。 */
|
|
69
|
+
export declare function statusCost(stats: SessionStats): number | undefined;
|
|
70
|
+
export interface Part {
|
|
71
|
+
text: string;
|
|
72
|
+
/** 越小越重要(最后丢);undefined = 永不丢。 */
|
|
73
|
+
priority: number | undefined;
|
|
74
|
+
zone: "left" | "right";
|
|
75
|
+
/** 同组相邻项连成一段(组内用 `RowStyle.groups[组].glue`,缺省空格)。 */
|
|
76
|
+
group?: string;
|
|
77
|
+
/** 这一段前面的连接符(缺省行分隔符);段首项的值生效。 */
|
|
78
|
+
lead?: string;
|
|
79
|
+
/** 判断放不放得下时按这个宽度算(会变的数字取最宽形状,避免抖动)。 */
|
|
80
|
+
reserve?: number;
|
|
81
|
+
}
|
|
82
|
+
export interface RowStyle {
|
|
83
|
+
/** 段间分隔符,缺省 ` · `。 */
|
|
84
|
+
sep?: string;
|
|
85
|
+
/** 组的连接方式:组内连接符与包围(如 `(avg 100 · ttft 1.4s)`)。 */
|
|
86
|
+
groups?: Readonly<Record<string, {
|
|
87
|
+
glue?: string;
|
|
88
|
+
open?: string;
|
|
89
|
+
close?: string;
|
|
90
|
+
}>>;
|
|
91
|
+
}
|
|
92
|
+
/** 按优先级丢弃后排成一行(两区 / 单区);连接符都是 dim。 */
|
|
93
|
+
export declare function layoutRow(parts: readonly Part[], width: number, theme: Theme, style?: RowStyle): string;
|
|
94
|
+
/** 按终端宽度缩写模型名(§3.10)。 */
|
|
95
|
+
export declare function abbreviateModel(ref: string, width: number): string;
|
|
96
|
+
/** 用量类项(compact 在本行、full 在速率行)的优先级表。 */
|
|
97
|
+
export interface UsagePriorities {
|
|
98
|
+
tokens: number;
|
|
99
|
+
cache: number;
|
|
100
|
+
cost?: number;
|
|
101
|
+
rebill: number;
|
|
102
|
+
queue: number;
|
|
103
|
+
codemode: number;
|
|
104
|
+
preset: number;
|
|
105
|
+
host: number;
|
|
106
|
+
}
|
|
107
|
+
export interface UsageItems {
|
|
108
|
+
tokens?: string;
|
|
109
|
+
cache?: string;
|
|
110
|
+
cost?: string;
|
|
111
|
+
rebill?: string;
|
|
112
|
+
queue?: string;
|
|
113
|
+
codemode?: string;
|
|
114
|
+
sandbox?: string;
|
|
115
|
+
preset?: string;
|
|
116
|
+
host?: string;
|
|
117
|
+
}
|
|
118
|
+
/** 用量类项的文本(已着色;普通项 dim)。 */
|
|
119
|
+
export declare function usageItems(stats: SessionStats, queue: number, source: StatusBarSource, theme: Theme): UsageItems;
|
|
36
120
|
export declare class StatusBar implements Component {
|
|
37
121
|
private readonly source;
|
|
38
122
|
private readonly theme;
|
|
@@ -42,7 +126,14 @@ export declare class StatusBar implements Component {
|
|
|
42
126
|
/** 用量、模型等变化后调用(事件驱动;流式期间不必每帧算)。 */
|
|
43
127
|
refresh(): void;
|
|
44
128
|
setQueue(steering: number, followUp: number): void;
|
|
129
|
+
/** 当前统计(速率行共用,避免重复 getStats)。 */
|
|
130
|
+
current(): SessionStats;
|
|
131
|
+
queued(): number;
|
|
132
|
+
layout(): StatusLineMode;
|
|
45
133
|
private parts;
|
|
134
|
+
/** `目录 ⎇ 分支 短提交 +a −b`:三项同组、各自按优先级丢弃。 */
|
|
135
|
+
private gitParts;
|
|
136
|
+
private ctxText;
|
|
46
137
|
render(width: number): string[];
|
|
47
138
|
invalidate(): void;
|
|
48
139
|
}
|