@armadra/agent 0.5.0 → 0.6.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 +177 -294
- package/CHANGELOG.zh-CN.md +442 -0
- package/README.md +408 -364
- package/README.zh-CN.md +705 -0
- package/dist/agent/session-plan.js +2 -2
- package/dist/agent/session-state.d.ts +3 -0
- package/dist/agent/session-state.js +20 -0
- package/dist/agent/session-subagent.d.ts +15 -1
- package/dist/agent/session-subagent.js +26 -3
- package/dist/agent/session-telemetry.d.ts +16 -2
- package/dist/agent/session-telemetry.js +29 -7
- package/dist/agent/session-tools.js +5 -2
- package/dist/agent/session-trace-writer.d.ts +27 -0
- package/dist/agent/session-trace-writer.js +253 -0
- package/dist/agent/session.d.ts +2 -0
- package/dist/agent/session.js +12 -0
- package/dist/agent/subagent-direct.d.ts +20 -0
- package/dist/agent/subagent-direct.js +76 -0
- package/dist/agent/subagent-registry.d.ts +8 -1
- package/dist/agent/subagent-registry.js +28 -1
- package/dist/agent/system-prompt.d.ts +3 -1
- package/dist/agent/system-prompt.js +3 -0
- package/dist/agent/tool-runner.d.ts +2 -1
- package/dist/agent/tool-runner.js +5 -4
- package/dist/agent/types-w6.d.ts +39 -0
- package/dist/agent/types-w6.js +4 -0
- package/dist/agent/types.d.ts +5 -2
- package/dist/agents/external.js +1 -1
- package/dist/agents/task-record.d.ts +74 -1
- package/dist/agents/task-record.js +100 -0
- package/dist/ai/apis/cache-params.js +2 -1
- package/dist/ai/apis/chatgpt-backend.d.ts +52 -0
- package/dist/ai/apis/chatgpt-backend.js +224 -0
- package/dist/ai/apis/chatgpt-rate-limits.d.ts +26 -0
- package/dist/ai/apis/chatgpt-rate-limits.js +91 -0
- package/dist/ai/apis/openai-responses-request.d.ts +2 -1
- package/dist/ai/apis/openai-responses-request.js +8 -2
- package/dist/ai/apis/openai-responses.d.ts +2 -0
- package/dist/ai/apis/openai-responses.js +51 -16
- package/dist/ai/overflow.d.ts +1 -1
- package/dist/ai/overflow.js +10 -7
- package/dist/ai/providers/auth.d.ts +15 -2
- package/dist/ai/providers/auth.js +69 -2
- package/dist/ai/providers/builtin.js +27 -0
- package/dist/ai/providers/catalog-data.js +1 -0
- package/dist/ai/providers/enrich.js +2 -7
- package/dist/ai/providers/models-dev-cache.js +15 -19
- package/dist/ai/providers/models-dev-snapshot.js +8 -7
- package/dist/ai/providers/models-dev.js +5 -15
- package/dist/ai/providers/suggest.js +2 -16
- package/dist/ai/types.d.ts +27 -1
- package/dist/auth/chatgpt/backend-client.d.ts +26 -0
- package/dist/auth/chatgpt/backend-client.js +74 -0
- package/dist/auth/chatgpt/claims.d.ts +17 -0
- package/dist/auth/chatgpt/claims.js +46 -0
- package/dist/auth/chatgpt/cli.d.ts +33 -0
- package/dist/auth/chatgpt/cli.js +252 -0
- package/dist/auth/chatgpt/doctor.d.ts +17 -0
- package/dist/auth/chatgpt/doctor.js +36 -0
- package/dist/auth/chatgpt/host-id.d.ts +7 -0
- package/dist/auth/chatgpt/host-id.js +26 -0
- package/dist/auth/chatgpt/login.d.ts +30 -0
- package/dist/auth/chatgpt/login.js +130 -0
- package/dist/auth/chatgpt/presets.d.ts +66 -0
- package/dist/auth/chatgpt/presets.js +120 -0
- package/dist/auth/chatgpt/quota-text.d.ts +13 -0
- package/dist/auth/chatgpt/quota-text.js +36 -0
- package/dist/auth/oauth/browser.d.ts +12 -0
- package/dist/auth/oauth/browser.js +27 -0
- package/dist/auth/oauth/callback-server.d.ts +47 -0
- package/dist/auth/oauth/callback-server.js +147 -0
- package/dist/auth/oauth/flows.d.ts +62 -0
- package/dist/auth/oauth/flows.js +113 -0
- package/dist/auth/oauth/jwt.d.ts +24 -0
- package/dist/auth/oauth/jwt.js +81 -0
- package/dist/auth/oauth/live.d.ts +21 -0
- package/dist/auth/oauth/live.js +25 -0
- package/dist/auth/oauth/oidc.d.ts +26 -0
- package/dist/auth/oauth/oidc.js +72 -0
- package/dist/auth/oauth/pkce.d.ts +15 -0
- package/dist/auth/oauth/pkce.js +20 -0
- package/dist/auth/oauth/refresh.d.ts +35 -0
- package/dist/auth/oauth/refresh.js +129 -0
- package/dist/auth/oauth/token-client.d.ts +33 -0
- package/dist/auth/oauth/token-client.js +121 -0
- package/dist/auth/oauth/token-store.d.ts +23 -0
- package/dist/auth/oauth/token-store.js +125 -0
- package/dist/auth/testing/fake-oauth.d.ts +73 -0
- package/dist/auth/testing/fake-oauth.js +271 -0
- package/dist/auth/testing/refresh-child.d.ts +5 -0
- package/dist/auth/testing/refresh-child.js +16 -0
- package/dist/bundle/ama.cjs +28307 -13241
- package/dist/checkpoints/backend.js +6 -5
- package/dist/checkpoints/restore.js +3 -2
- package/dist/checkpoints/settings.js +2 -1
- package/dist/checkpoints/shadow-git.js +7 -6
- package/dist/checkpoints/shadow-restore.js +3 -2
- package/dist/checkpoints/tracker.js +4 -3
- package/dist/cli/args.d.ts +9 -2
- package/dist/cli/args.js +74 -27
- package/dist/cli/bootstrap.js +53 -31
- package/dist/cli/choice-prompt.d.ts +58 -0
- package/dist/cli/choice-prompt.js +142 -0
- package/dist/cli/codemode-notice.js +2 -2
- package/dist/cli/compose-agents.js +2 -1
- package/dist/cli/compose-extensions.js +2 -0
- package/dist/cli/compose-memory.d.ts +53 -0
- package/dist/cli/compose-memory.js +127 -0
- package/dist/cli/compose-providers.d.ts +5 -0
- package/dist/cli/compose-providers.js +32 -2
- package/dist/cli/compose-session.d.ts +5 -0
- package/dist/cli/compose-session.js +27 -13
- package/dist/cli/compose-store.d.ts +2 -0
- package/dist/cli/compose-store.js +9 -5
- package/dist/cli/compose.d.ts +2 -0
- package/dist/cli/compose.js +13 -5
- package/dist/cli/default-model.d.ts +0 -2
- package/dist/cli/default-model.js +5 -8
- package/dist/cli/deps.d.ts +5 -1
- package/dist/cli/exit-codes.d.ts +1 -1
- package/dist/cli/exit-codes.js +7 -16
- package/dist/cli/from-prompt.js +3 -2
- package/dist/cli/help-text.d.ts +2 -1
- package/dist/cli/help-text.js +5 -99
- package/dist/cli/main.d.ts +5 -0
- package/dist/cli/main.js +21 -2
- package/dist/cli/proxy.js +14 -9
- package/dist/cli/runtime.d.ts +5 -0
- package/dist/cli/startup-screen.js +20 -27
- package/dist/cli/startup-steps.js +6 -8
- package/dist/cli/subcommands/auth.d.ts +6 -3
- package/dist/cli/subcommands/auth.js +52 -22
- package/dist/cli/subcommands/config-set.d.ts +21 -0
- package/dist/cli/subcommands/config-set.js +137 -0
- package/dist/cli/subcommands/config.d.ts +2 -1
- package/dist/cli/subcommands/config.js +51 -37
- package/dist/cli/subcommands/doctor.d.ts +2 -1
- package/dist/cli/subcommands/doctor.js +97 -58
- package/dist/cli/subcommands/init.d.ts +1 -1
- package/dist/cli/subcommands/init.js +8 -7
- package/dist/cli/subcommands/memory.d.ts +18 -0
- package/dist/cli/subcommands/memory.js +189 -0
- package/dist/cli/subcommands/model-meta.js +11 -9
- package/dist/cli/subcommands/models-cache-probe.d.ts +1 -1
- package/dist/cli/subcommands/models-cache-probe.js +26 -32
- package/dist/cli/subcommands/models-discover.d.ts +3 -0
- package/dist/cli/subcommands/models-discover.js +44 -21
- package/dist/cli/subcommands/models.d.ts +1 -1
- package/dist/cli/subcommands/models.js +29 -22
- package/dist/cli/subcommands/probe-runner.js +8 -7
- package/dist/cli/subcommands/providers-list.js +32 -21
- package/dist/cli/subcommands/providers-plan.js +24 -25
- package/dist/cli/subcommands/providers-probe.js +5 -6
- package/dist/cli/subcommands/providers.d.ts +2 -2
- package/dist/cli/subcommands/providers.js +48 -59
- package/dist/cli/subcommands/sessions-export.d.ts +1 -1
- package/dist/cli/subcommands/sessions-export.js +10 -9
- package/dist/cli/subcommands/sessions-search.d.ts +1 -1
- package/dist/cli/subcommands/sessions-search.js +11 -10
- package/dist/cli/subcommands/sessions-trace.d.ts +30 -0
- package/dist/cli/subcommands/sessions-trace.js +156 -0
- package/dist/cli/subcommands/sessions.d.ts +4 -3
- package/dist/cli/subcommands/sessions.js +40 -37
- package/dist/cli/subcommands/stats.d.ts +1 -1
- package/dist/cli/subcommands/stats.js +49 -30
- package/dist/cli/system-prompt-arg.js +3 -2
- package/dist/codemode/capability.js +3 -2
- package/dist/compaction/post-compact.d.ts +1 -0
- package/dist/compaction/post-compact.js +15 -1
- package/dist/compaction/prune-tier.d.ts +1 -1
- package/dist/compaction/prune-tier.js +3 -3
- package/dist/compaction/serialize.js +2 -1
- package/dist/config/auth-file.d.ts +12 -2
- package/dist/config/auth-file.js +32 -10
- package/dist/config/checker.js +12 -11
- package/dist/config/context-files.js +3 -2
- package/dist/config/edit.d.ts +106 -0
- package/dist/config/edit.js +350 -0
- package/dist/config/init.d.ts +4 -3
- package/dist/config/init.js +10 -18
- package/dist/config/json-schema.d.ts +2 -1
- package/dist/config/json-schema.js +101 -68
- package/dist/config/key-docs.d.ts +18 -7
- package/dist/config/key-docs.js +43 -128
- package/dist/config/load.js +7 -6
- package/dist/config/merge.d.ts +4 -1
- package/dist/config/merge.js +42 -22
- package/dist/config/paths.js +6 -5
- package/dist/config/profile.d.ts +5 -1
- package/dist/config/profile.js +7 -2
- package/dist/config/schema-w5.js +3 -2
- package/dist/config/schema-w6.d.ts +19 -0
- package/dist/config/schema-w6.js +115 -0
- package/dist/config/schema.js +34 -20
- package/dist/config/settings-registry.d.ts +78 -0
- package/dist/config/settings-registry.js +184 -0
- package/dist/config/types-w6.d.ts +109 -0
- package/dist/config/types-w6.js +19 -0
- package/dist/config/types.d.ts +11 -8
- package/dist/config/types.js +1 -0
- package/dist/drivers/acp/client.js +1 -1
- package/dist/drivers/acp/driver.js +13 -8
- package/dist/drivers/agents.js +4 -3
- package/dist/drivers/base.js +3 -2
- package/dist/drivers/host-runners.js +2 -1
- package/dist/drivers/native/claude-stream.js +12 -11
- package/dist/drivers/native/codex-app-server.js +17 -12
- package/dist/drivers/native/oneshot.js +8 -7
- package/dist/drivers/pool.js +1 -1
- package/dist/drivers/runner.d.ts +3 -1
- package/dist/drivers/runner.js +68 -20
- package/dist/drivers/turn.js +1 -1
- package/dist/hooks/config.js +3 -2
- package/dist/hooks/protocol.js +18 -12
- package/dist/host/api-impl.js +11 -10
- package/dist/host/loader.js +9 -8
- package/dist/host/types.d.ts +3 -0
- package/dist/i18n/catalog.d.ts +2169 -0
- package/dist/i18n/catalog.js +72 -0
- package/dist/i18n/format.d.ts +21 -0
- package/dist/i18n/format.js +58 -0
- package/dist/i18n/index.d.ts +58 -0
- package/dist/i18n/index.js +72 -0
- package/dist/i18n/messages/agents.d.ts +84 -0
- package/dist/i18n/messages/agents.js +85 -0
- package/dist/i18n/messages/approval.d.ts +99 -0
- package/dist/i18n/messages/approval.js +100 -0
- package/dist/i18n/messages/auth.d.ts +187 -0
- package/dist/i18n/messages/auth.js +189 -0
- package/dist/i18n/messages/cli-args.d.ts +46 -0
- package/dist/i18n/messages/cli-args.js +46 -0
- package/dist/i18n/messages/cli-help.d.ts +12 -0
- package/dist/i18n/messages/cli-help.js +244 -0
- package/dist/i18n/messages/cli.d.ts +336 -0
- package/dist/i18n/messages/cli.js +311 -0
- package/dist/i18n/messages/config-keys.d.ts +289 -0
- package/dist/i18n/messages/config-keys.js +292 -0
- package/dist/i18n/messages/config.d.ts +502 -0
- package/dist/i18n/messages/config.js +239 -0
- package/dist/i18n/messages/drivers.d.ts +123 -0
- package/dist/i18n/messages/drivers.js +124 -0
- package/dist/i18n/messages/errors.d.ts +83 -0
- package/dist/i18n/messages/errors.js +171 -0
- package/dist/i18n/messages/interactive-line.d.ts +61 -0
- package/dist/i18n/messages/interactive-line.js +69 -0
- package/dist/i18n/messages/interactive-startup.d.ts +103 -0
- package/dist/i18n/messages/interactive-startup.js +104 -0
- package/dist/i18n/messages/interactive-view.d.ts +140 -0
- package/dist/i18n/messages/interactive-view.js +141 -0
- package/dist/i18n/messages/interactive.d.ts +493 -0
- package/dist/i18n/messages/interactive.js +248 -0
- package/dist/i18n/messages/memory.d.ts +123 -0
- package/dist/i18n/messages/memory.js +128 -0
- package/dist/i18n/messages/panels.d.ts +190 -0
- package/dist/i18n/messages/panels.js +189 -0
- package/dist/i18n/messages/permissions.d.ts +126 -0
- package/dist/i18n/messages/permissions.js +151 -0
- package/dist/i18n/messages/plan.d.ts +123 -0
- package/dist/i18n/messages/plan.js +124 -0
- package/dist/i18n/messages/print.d.ts +86 -0
- package/dist/i18n/messages/print.js +91 -0
- package/dist/i18n/messages/report.d.ts +391 -0
- package/dist/i18n/messages/report.js +490 -0
- package/dist/i18n/messages/rewind.d.ts +198 -0
- package/dist/i18n/messages/rewind.js +217 -0
- package/dist/i18n/messages/session.d.ts +230 -0
- package/dist/i18n/messages/session.js +258 -0
- package/dist/i18n/messages/settings.d.ts +348 -0
- package/dist/i18n/messages/settings.js +336 -0
- package/dist/i18n/messages/subcommands-config.d.ts +111 -0
- package/dist/i18n/messages/subcommands-config.js +127 -0
- package/dist/i18n/messages/subcommands.d.ts +548 -0
- package/dist/i18n/messages/subcommands.js +474 -0
- package/dist/i18n/messages/trace.d.ts +243 -0
- package/dist/i18n/messages/trace.js +238 -0
- package/dist/i18n/types.d.ts +15 -0
- package/dist/i18n/types.js +7 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.js +2 -0
- package/dist/memory/edit.d.ts +24 -0
- package/dist/memory/edit.js +63 -0
- package/dist/memory/frontmatter.d.ts +37 -0
- package/dist/memory/frontmatter.js +79 -0
- package/dist/memory/index.d.ts +28 -0
- package/dist/memory/index.js +126 -0
- package/dist/memory/lock.d.ts +17 -0
- package/dist/memory/lock.js +62 -0
- package/dist/memory/paths.d.ts +57 -0
- package/dist/memory/paths.js +175 -0
- package/dist/memory/report.d.ts +36 -0
- package/dist/memory/report.js +86 -0
- package/dist/memory/runtime.d.ts +42 -0
- package/dist/memory/runtime.js +36 -0
- package/dist/memory/secrets.d.ts +8 -0
- package/dist/memory/secrets.js +27 -0
- package/dist/memory/section.d.ts +28 -0
- package/dist/memory/section.js +59 -0
- package/dist/memory/store.d.ts +70 -0
- package/dist/memory/store.js +284 -0
- package/dist/memory/tool.d.ts +31 -0
- package/dist/memory/tool.js +94 -0
- package/dist/modes/acp/acp-events.js +2 -1
- package/dist/modes/acp/acp-server.js +13 -12
- package/dist/modes/commands-core.d.ts +17 -0
- package/dist/modes/commands-core.js +101 -61
- package/dist/modes/image-input.js +20 -6
- package/dist/modes/interactive/agent-bar.d.ts +95 -0
- package/dist/modes/interactive/agent-bar.js +248 -0
- package/dist/modes/interactive/agent-panels.js +27 -26
- package/dist/modes/interactive/agent-transcript.d.ts +47 -0
- package/dist/modes/interactive/agent-transcript.js +191 -0
- package/dist/modes/interactive/agent-ui.d.ts +36 -1
- package/dist/modes/interactive/agent-ui.js +180 -14
- package/dist/modes/interactive/agent-view.d.ts +72 -0
- package/dist/modes/interactive/agent-view.js +281 -0
- package/dist/modes/interactive/approval-dialog.js +46 -34
- package/dist/modes/interactive/clipboard-paste.d.ts +2 -2
- package/dist/modes/interactive/clipboard-paste.js +9 -4
- package/dist/modes/interactive/commands.d.ts +22 -1
- package/dist/modes/interactive/commands.js +93 -38
- package/dist/modes/interactive/completion.js +2 -1
- package/dist/modes/interactive/config-panel.d.ts +70 -0
- package/dist/modes/interactive/config-panel.js +319 -0
- package/dist/modes/interactive/config-ui.d.ts +96 -0
- package/dist/modes/interactive/config-ui.js +397 -0
- package/dist/modes/interactive/confirm-dialog.d.ts +49 -0
- package/dist/modes/interactive/confirm-dialog.js +120 -0
- package/dist/modes/interactive/event-notices.js +11 -9
- package/dist/modes/interactive/interactive-mode.d.ts +1 -1
- package/dist/modes/interactive/interactive-mode.js +25 -22
- package/dist/modes/interactive/key-dispatch.d.ts +18 -0
- package/dist/modes/interactive/key-dispatch.js +39 -13
- package/dist/modes/interactive/line/line-editor.js +2 -1
- package/dist/modes/interactive/line/line-mode.d.ts +2 -0
- package/dist/modes/interactive/line/line-mode.js +24 -4
- package/dist/modes/interactive/line/line-render.js +25 -24
- package/dist/modes/interactive/memory-panel.d.ts +64 -0
- package/dist/modes/interactive/memory-panel.js +221 -0
- package/dist/modes/interactive/message-view.d.ts +4 -2
- package/dist/modes/interactive/message-view.js +42 -33
- package/dist/modes/interactive/panels.js +39 -31
- package/dist/modes/interactive/pickers.d.ts +2 -1
- package/dist/modes/interactive/pickers.js +10 -6
- package/dist/modes/interactive/plan-command.d.ts +1 -1
- package/dist/modes/interactive/plan-command.js +24 -27
- package/dist/modes/interactive/plan-dialog.js +18 -17
- package/dist/modes/interactive/plan-flow.js +6 -5
- package/dist/modes/interactive/rewind-command.d.ts +1 -1
- package/dist/modes/interactive/rewind-command.js +18 -16
- package/dist/modes/interactive/rewind-flow.d.ts +0 -1
- package/dist/modes/interactive/rewind-flow.js +13 -14
- package/dist/modes/interactive/rewind-list.js +7 -6
- package/dist/modes/interactive/rewind-panel.js +40 -40
- package/dist/modes/interactive/rewind-text.d.ts +5 -3
- package/dist/modes/interactive/rewind-text.js +48 -38
- package/dist/modes/interactive/run-indicator.js +15 -12
- package/dist/modes/interactive/session-events.js +3 -2
- package/dist/modes/interactive/startup-header.js +22 -23
- package/dist/modes/interactive/startup-ui.js +41 -29
- package/dist/modes/interactive/status-area.d.ts +2 -0
- package/dist/modes/interactive/status-area.js +8 -2
- package/dist/modes/interactive/status-bar.js +4 -3
- package/dist/modes/interactive/subagent-view.js +9 -7
- package/dist/modes/interactive/tasks-report.d.ts +6 -0
- package/dist/modes/interactive/tasks-report.js +28 -31
- package/dist/modes/interactive/terminal-setup.d.ts +9 -0
- package/dist/modes/interactive/terminal-setup.js +23 -0
- package/dist/modes/interactive/tool-summary.js +19 -17
- package/dist/modes/interactive/tool-view.js +7 -4
- package/dist/modes/interactive/trace-view.d.ts +89 -0
- package/dist/modes/interactive/trace-view.js +332 -0
- package/dist/modes/print/print-mode.js +14 -15
- package/dist/modes/rpc/commands.js +7 -3
- package/dist/modes/rpc/rpc-mode.js +9 -3
- package/dist/modes/session-report.d.ts +2 -0
- package/dist/modes/session-report.js +101 -105
- package/dist/modes/startup-ui-text.js +11 -6
- package/dist/permissions/bypass.d.ts +30 -0
- package/dist/permissions/bypass.js +45 -0
- package/dist/permissions/memory-class.d.ts +23 -0
- package/dist/permissions/memory-class.js +54 -0
- package/dist/permissions/modes.d.ts +3 -3
- package/dist/permissions/modes.js +21 -16
- package/dist/permissions/pipeline.d.ts +1 -1
- package/dist/permissions/pipeline.js +9 -2
- package/dist/permissions/preview.js +49 -42
- package/dist/permissions/rules.js +5 -2
- package/dist/permissions/types.d.ts +4 -0
- package/dist/plan/store.js +2 -1
- package/dist/rpc.d.ts +39 -1
- package/dist/rpc.js +3 -0
- package/dist/sandbox/bash.js +11 -8
- package/dist/sandbox/detect.js +14 -11
- package/dist/sdk.d.ts +17 -1
- package/dist/sdk.js +29 -7
- package/dist/session/export.js +31 -30
- package/dist/session/manager.d.ts +1 -1
- package/dist/session/manager.js +5 -3
- package/dist/session/reuse.js +5 -4
- package/dist/session/scan.js +3 -2
- package/dist/session/stats-aggregate.d.ts +3 -1
- package/dist/session/stats-aggregate.js +5 -1
- package/dist/session/stats-index.js +2 -1
- package/dist/session/stats-scan.d.ts +4 -1
- package/dist/session/stats-scan.js +6 -2
- package/dist/session/store.d.ts +11 -0
- package/dist/session/store.js +48 -1
- package/dist/session/types.d.ts +2 -0
- package/dist/skills/builtin.js +2 -1
- package/dist/tools/image-file.d.ts +26 -1
- package/dist/tools/image-file.js +55 -13
- package/dist/tools/presets.d.ts +14 -1
- package/dist/tools/presets.js +3 -3
- package/dist/tools/registry.js +1 -1
- package/dist/tools/truncate.d.ts +1 -1
- package/dist/tools/truncate.js +2 -2
- package/dist/tools/types.d.ts +17 -1
- package/dist/trace/build-index.d.ts +91 -0
- package/dist/trace/build-index.js +127 -0
- package/dist/trace/build-nodes.d.ts +24 -0
- package/dist/trace/build-nodes.js +279 -0
- package/dist/trace/build-util.d.ts +43 -0
- package/dist/trace/build-util.js +120 -0
- package/dist/trace/build.d.ts +82 -0
- package/dist/trace/build.js +382 -0
- package/dist/trace/detail.d.ts +35 -0
- package/dist/trace/detail.js +205 -0
- package/dist/trace/flatten.d.ts +69 -0
- package/dist/trace/flatten.js +173 -0
- package/dist/trace/format.d.ts +47 -0
- package/dist/trace/format.js +329 -0
- package/dist/trace/html-template.d.ts +19 -0
- package/dist/trace/html-template.js +150 -0
- package/dist/trace/html.d.ts +104 -0
- package/dist/trace/html.js +292 -0
- package/dist/trace/preview.d.ts +29 -0
- package/dist/trace/preview.js +59 -0
- package/dist/trace/query-session.d.ts +14 -0
- package/dist/trace/query-session.js +38 -0
- package/dist/trace/query.d.ts +55 -0
- package/dist/trace/query.js +188 -0
- package/dist/trace/session.d.ts +40 -0
- package/dist/trace/session.js +168 -0
- package/dist/trace/types.d.ts +243 -0
- package/dist/trace/types.js +13 -0
- package/dist/tui/components/editor-paste.d.ts +2 -0
- package/dist/tui/components/editor-paste.js +6 -3
- package/dist/tui/components/editor.js +2 -2
- package/dist/tui/components/loader.d.ts +3 -0
- package/dist/tui/components/loader.js +14 -0
- package/dist/tui/components/settings-list.d.ts +61 -0
- package/dist/tui/components/settings-list.js +135 -0
- package/dist/tui/keybindings.d.ts +6 -1
- package/dist/tui/keybindings.js +18 -6
- package/dist/tui.d.ts +1 -0
- package/dist/tui.js +2 -0
- package/docs/en/host-api.md +167 -0
- package/docs/en/permissions.md +214 -0
- package/docs/en/providers.md +625 -0
- package/docs/en/rpc.md +361 -0
- package/docs/en/sessions.md +219 -0
- package/docs/en/tui.md +527 -0
- package/docs/host-api.md +18 -17
- package/docs/memory.md +172 -0
- package/docs/permissions.md +3 -2
- package/docs/providers.md +67 -1
- package/docs/rpc.md +31 -3
- package/docs/session-format.md +8 -2
- package/docs/sessions.md +29 -1
- package/docs/tui.md +189 -21
- package/package.json +8 -3
|
@@ -0,0 +1,336 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 消息目录:settings(键名规范见 docs/i18n.md)。[W6-C0 建空壳,归 W6-S]
|
|
3
|
+
*
|
|
4
|
+
* en 是形状源;zh 用 `satisfies Messages<typeof en>`,缺键 / 多键 / 参数不符在 tsc 期报错。
|
|
5
|
+
* 整句一个键、禁止片段拼接;插值写成函数,条件分支写进函数体。
|
|
6
|
+
* `/config` 面板、`/config key=value` 与 `ama config get | set | unset | list`;枚举值、配置键、来源名不译。
|
|
7
|
+
*/
|
|
8
|
+
export const en = {
|
|
9
|
+
groups: {
|
|
10
|
+
ui: "Interface",
|
|
11
|
+
model: "Model",
|
|
12
|
+
permission: "Permissions",
|
|
13
|
+
tools: "Tools",
|
|
14
|
+
context: "Context and cache",
|
|
15
|
+
session: "Session and budget",
|
|
16
|
+
sandbox: "Sandbox",
|
|
17
|
+
agents: "Agents",
|
|
18
|
+
memory: "Memory",
|
|
19
|
+
elsewhere: "Edited elsewhere",
|
|
20
|
+
},
|
|
21
|
+
/** Row labels: the key in plain words. */
|
|
22
|
+
labels: {
|
|
23
|
+
"ui.theme": "Theme",
|
|
24
|
+
"ui.markdown": "Render Markdown",
|
|
25
|
+
"ui.showThinking": "Thinking display",
|
|
26
|
+
"ui.compact": "Compact layout",
|
|
27
|
+
"ui.animation": "Spinner animation",
|
|
28
|
+
"ui.statusLine": "Status line",
|
|
29
|
+
"ui.restoreOnCancel": "Restore on cancel",
|
|
30
|
+
"ui.quietStartup": "Startup screen",
|
|
31
|
+
"ui.ascii": "ASCII glyphs",
|
|
32
|
+
"ui.language": "Interface language",
|
|
33
|
+
"ui.replyLanguage": "Reply language",
|
|
34
|
+
"ui.agentBar": "Agent bar",
|
|
35
|
+
defaultModel: "Default model",
|
|
36
|
+
thinkingLevel: "Thinking level",
|
|
37
|
+
fallbackModel: "Fallback model",
|
|
38
|
+
"plan.model": "Plan model",
|
|
39
|
+
"plan.thinkingLevel": "Plan thinking level",
|
|
40
|
+
"subagents.defaultModel": "Subagent model",
|
|
41
|
+
"models.aliases.fast": "Alias fast",
|
|
42
|
+
"models.aliases.strong": "Alias strong",
|
|
43
|
+
"permission.mode": "Permission mode",
|
|
44
|
+
"permission.autoModel": "Auto mode classifier",
|
|
45
|
+
"plan.bash": "Bash in plan mode",
|
|
46
|
+
"plan.unattended": "Unattended plans",
|
|
47
|
+
"tools.preset": "Tool preset",
|
|
48
|
+
"codemode.mode": "Codemode",
|
|
49
|
+
"codemode.inlineBudget": "Codemode inline budget",
|
|
50
|
+
"codemode.requireStrict": "Codemode needs isolation",
|
|
51
|
+
"tools.maxToolResultChars": "Tool result limit",
|
|
52
|
+
"tools.bashTimeoutMs": "Bash timeout (ms)",
|
|
53
|
+
"images.resize": "Resize images",
|
|
54
|
+
"hooks.timeoutMs": "Hook timeout (ms)",
|
|
55
|
+
"compaction.enabled": "Auto compaction",
|
|
56
|
+
"compaction.reserveTokens": "Reserve tokens",
|
|
57
|
+
"compaction.keepRecentTokens": "Keep recent tokens",
|
|
58
|
+
"compaction.prune.keepResults": "Prune: keep results",
|
|
59
|
+
"compaction.prune.clearAtLeast": "Prune: clear at least",
|
|
60
|
+
"cache.warming": "Cache warming",
|
|
61
|
+
"cache.retention": "Cache retention",
|
|
62
|
+
"cache.minSavingsUsd": "Warming min savings ($)",
|
|
63
|
+
"cache.missNotices": "Cache miss notices",
|
|
64
|
+
"cache.warmSubagents": "Warm subagents",
|
|
65
|
+
"request.idleTimeoutMs": "Stream idle timeout (ms)",
|
|
66
|
+
"retry.enabled": "Auto retry",
|
|
67
|
+
"retry.maxRetries": "Max retries",
|
|
68
|
+
"retry.baseDelayMs": "Retry base delay (ms)",
|
|
69
|
+
"retry.maxDelayMs": "Retry max delay (ms)",
|
|
70
|
+
"limits.maxTurns": "Max turns per run",
|
|
71
|
+
"limits.maxCostUsd": "Max cost per run ($)",
|
|
72
|
+
"reminders.todo": "Todo reminders",
|
|
73
|
+
"reminders.fileChanges": "File change reminders",
|
|
74
|
+
"reminders.contextPressure": "Context reminders",
|
|
75
|
+
"reminders.budget": "Budget reminders",
|
|
76
|
+
"todo.reminder": "Todo reminder (turns)",
|
|
77
|
+
"checkpoints.mode": "Checkpoints",
|
|
78
|
+
"checkpoints.maxFileBytes": "Checkpoint file limit",
|
|
79
|
+
"checkpoints.keep": "Checkpoints kept",
|
|
80
|
+
"sandbox.enabled": "OS sandbox",
|
|
81
|
+
"sandbox.bash": "Bash sandbox",
|
|
82
|
+
"sandbox.network": "Sandbox network",
|
|
83
|
+
"agents.maxConcurrent": "External agent limit",
|
|
84
|
+
"agents.sessionBudgetUsd": "External agent budget",
|
|
85
|
+
"subagents.maxConcurrent": "Subagents in parallel",
|
|
86
|
+
"subagents.maxPending": "Subagent queue limit",
|
|
87
|
+
"memory.enabled": "Memory",
|
|
88
|
+
"memory.subagents": "Memory in subagents",
|
|
89
|
+
},
|
|
90
|
+
apply: { now: "now", nextSession: "new session", restart: "restart" },
|
|
91
|
+
prefixTag: "cache",
|
|
92
|
+
scope: { user: "user", project: "project" },
|
|
93
|
+
title: "Settings",
|
|
94
|
+
writeTo: (scope, path) => `Write: ${scope} ${path}`,
|
|
95
|
+
tabSwitch: "[Tab switch]",
|
|
96
|
+
embedded: "Embedded mode: changes go to the user config",
|
|
97
|
+
searchPlaceholder: "/ to search",
|
|
98
|
+
searchPrompt: (query) => `Search: ${query}`,
|
|
99
|
+
noMatches: "No matching settings",
|
|
100
|
+
unset: "(unset)",
|
|
101
|
+
auto: (value) => `auto (${value})`,
|
|
102
|
+
source: (source) => `from ${source}`,
|
|
103
|
+
locked: (source) => `[locked] ${source}`,
|
|
104
|
+
lockReason: {
|
|
105
|
+
env: (name) => `${name} is set in the environment`,
|
|
106
|
+
cli: "set on the command line",
|
|
107
|
+
profile: "set by the host profile",
|
|
108
|
+
project: "project config takes precedence",
|
|
109
|
+
},
|
|
110
|
+
projectNote: { deny: "user only", tighten: "tighten only" },
|
|
111
|
+
footer: "↑↓ select · Enter change · Tab user/project · Backspace reset · Esc close",
|
|
112
|
+
footerCompact: "↑↓ · Enter · / · Tab · Esc",
|
|
113
|
+
footerSearch: "Type to filter · ↑↓ select · Enter change · Esc clear",
|
|
114
|
+
footerEdit: "Enter save · Esc cancel",
|
|
115
|
+
editPrompt: (label) => `${label}: `,
|
|
116
|
+
confirmUnset: (key) => `Reset ${key} to the lower layer? Press Backspace again`,
|
|
117
|
+
prefixNotice: "This changes the cache prefix; the next request is billed as a cache miss",
|
|
118
|
+
bypassPersist: "Saved to the user config: every future start runs in Bypass permissions",
|
|
119
|
+
pickTitle: (label) => `${label}`,
|
|
120
|
+
defaultChoice: "(unset: default)",
|
|
121
|
+
summaryTitle: "Settings changed",
|
|
122
|
+
summaryLine: (label, from, to, scope) => `${label}: ${from} → ${to} (${scope})`,
|
|
123
|
+
summaryRestart: (labels) => `Takes effect after restart: ${labels}`,
|
|
124
|
+
summaryNextSession: (labels) => `Takes effect in a new session (/new): ${labels}`,
|
|
125
|
+
setDone: (key, value, scope) => `${key} = ${value} (${scope})`,
|
|
126
|
+
unsetDone: (key, value, scope) => `${key} reset (${scope}); now ${value}`,
|
|
127
|
+
stillOverridden: (key, source) => `${key} is still overridden by ${source}; the saved value applies once that is removed`,
|
|
128
|
+
slashUsage: "Usage: /config [key=value | key value]",
|
|
129
|
+
errors: {
|
|
130
|
+
unknownKey: (key) => `${key} isn't a /config setting. Run /config to see what's available.`,
|
|
131
|
+
notSettable: (key) => `${key} can't be set here; use ama config edit`,
|
|
132
|
+
invalidBool: (key, raw) => `${key}: expected true or false (on / off, 1 / 0), got ${raw}`,
|
|
133
|
+
invalidEnum: (key, raw, options) => `${key}: expected one of ${options}, got ${raw}`,
|
|
134
|
+
invalidNumber: (key, raw) => `${key}: expected a number, got ${raw}`,
|
|
135
|
+
outOfRange: (key, range) => `${key}: must be ${range}`,
|
|
136
|
+
invalidModel: (key, raw) => `${key}: expected provider/model[@channel], got ${raw}`,
|
|
137
|
+
emptyText: (key) => `${key}: value is empty`,
|
|
138
|
+
needsJson: (key) => `${key} is a list or object; pass it with --json-value`,
|
|
139
|
+
invalidJson: (key, reason) => `${key}: invalid JSON (${reason})`,
|
|
140
|
+
invalid: (key, detail) => `${key}: ${detail}`,
|
|
141
|
+
projectDenied: (key) => `${key} can only be set in the user config or profile, not at project level`,
|
|
142
|
+
projectTighten: (key, current) => `project level can only tighten ${key} (current ${current})`,
|
|
143
|
+
readFailed: (detail) => `can't read the config file: ${detail}`,
|
|
144
|
+
writeFailed: (path, reason) => `can't write ${path}: ${reason}`,
|
|
145
|
+
locked: (key, reason) => `${key} is locked: ${reason}`,
|
|
146
|
+
},
|
|
147
|
+
hints: {
|
|
148
|
+
providers: "ama providers · ama auth",
|
|
149
|
+
permissionRules: "permission.allow / deny / builtinDeny: /permissions · ama config edit",
|
|
150
|
+
tools: "tools.default / disabled: /tools · ama config set --json-value",
|
|
151
|
+
dirs: "skills.dirs / agents.dirs: ama config set --json-value",
|
|
152
|
+
sandboxWritable: "ama config set sandbox.writable --json-value",
|
|
153
|
+
agents: "agents.<id>: ama config edit",
|
|
154
|
+
hooks: "hooks.json · /hooks",
|
|
155
|
+
auth: "ama auth",
|
|
156
|
+
},
|
|
157
|
+
cli: {
|
|
158
|
+
usage: `Usage: ama config get <key> [--json]
|
|
159
|
+
ama config set <key> <value> [--project] [--json-value] [--yes]
|
|
160
|
+
ama config unset <key> [--project]
|
|
161
|
+
ama config list [prefix] [--json] [--all]
|
|
162
|
+
`,
|
|
163
|
+
getLine: (key, value, source, apply) => `${key} = ${value} (${source}; ${apply})`,
|
|
164
|
+
listHeader: "Settings (key = value source applies)",
|
|
165
|
+
applyNone: "-",
|
|
166
|
+
confirmBypass: "Save permission.mode full-auto to the user config? Every future start runs in Bypass permissions. ",
|
|
167
|
+
needYes: "permission.mode full-auto runs every future start without approvals; pass --yes to confirm",
|
|
168
|
+
cancelled: "Cancelled; nothing written",
|
|
169
|
+
missingKey: "missing <key>",
|
|
170
|
+
missingValue: "missing <value>",
|
|
171
|
+
},
|
|
172
|
+
};
|
|
173
|
+
export const zh = {
|
|
174
|
+
groups: {
|
|
175
|
+
ui: "界面",
|
|
176
|
+
model: "模型",
|
|
177
|
+
permission: "权限",
|
|
178
|
+
tools: "工具",
|
|
179
|
+
context: "上下文与缓存",
|
|
180
|
+
session: "会话与预算",
|
|
181
|
+
sandbox: "沙箱",
|
|
182
|
+
agents: "Agent",
|
|
183
|
+
memory: "记忆",
|
|
184
|
+
elsewhere: "在别处修改",
|
|
185
|
+
},
|
|
186
|
+
labels: {
|
|
187
|
+
"ui.theme": "主题",
|
|
188
|
+
"ui.markdown": "Markdown 渲染",
|
|
189
|
+
"ui.showThinking": "思考内容",
|
|
190
|
+
"ui.compact": "紧凑布局",
|
|
191
|
+
"ui.animation": "spinner 动画",
|
|
192
|
+
"ui.statusLine": "底部信息行",
|
|
193
|
+
"ui.restoreOnCancel": "中断后放回原消息",
|
|
194
|
+
"ui.quietStartup": "启动画面",
|
|
195
|
+
"ui.ascii": "ASCII 字形",
|
|
196
|
+
"ui.language": "界面语言",
|
|
197
|
+
"ui.replyLanguage": "回复语言",
|
|
198
|
+
"ui.agentBar": "Agent 栏",
|
|
199
|
+
defaultModel: "缺省模型",
|
|
200
|
+
thinkingLevel: "思考强度",
|
|
201
|
+
fallbackModel: "回退模型",
|
|
202
|
+
"plan.model": "规划模型",
|
|
203
|
+
"plan.thinkingLevel": "规划思考强度",
|
|
204
|
+
"subagents.defaultModel": "子 Agent 模型",
|
|
205
|
+
"models.aliases.fast": "别名 fast",
|
|
206
|
+
"models.aliases.strong": "别名 strong",
|
|
207
|
+
"permission.mode": "权限模式",
|
|
208
|
+
"permission.autoModel": "auto 分类器模型",
|
|
209
|
+
"plan.bash": "Plan 模式的 bash",
|
|
210
|
+
"plan.unattended": "无人值守的计划",
|
|
211
|
+
"tools.preset": "工具预设",
|
|
212
|
+
"codemode.mode": "codemode",
|
|
213
|
+
"codemode.inlineBudget": "codemode 内联预算",
|
|
214
|
+
"codemode.requireStrict": "codemode 要求隔离",
|
|
215
|
+
"tools.maxToolResultChars": "工具结果上限",
|
|
216
|
+
"tools.bashTimeoutMs": "bash 超时(毫秒)",
|
|
217
|
+
"images.resize": "图片缩放",
|
|
218
|
+
"hooks.timeoutMs": "Hook 超时(毫秒)",
|
|
219
|
+
"compaction.enabled": "自动压缩",
|
|
220
|
+
"compaction.reserveTokens": "预留 token",
|
|
221
|
+
"compaction.keepRecentTokens": "保留最近 token",
|
|
222
|
+
"compaction.prune.keepResults": "裁剪:保留结果数",
|
|
223
|
+
"compaction.prune.clearAtLeast": "裁剪:至少省",
|
|
224
|
+
"cache.warming": "缓存保温",
|
|
225
|
+
"cache.retention": "缓存时长",
|
|
226
|
+
"cache.minSavingsUsd": "保温最低节省(美元)",
|
|
227
|
+
"cache.missNotices": "未命中提示",
|
|
228
|
+
"cache.warmSubagents": "子会话保温",
|
|
229
|
+
"request.idleTimeoutMs": "流空闲超时(毫秒)",
|
|
230
|
+
"retry.enabled": "自动重试",
|
|
231
|
+
"retry.maxRetries": "最多重试次数",
|
|
232
|
+
"retry.baseDelayMs": "重试首次等待(毫秒)",
|
|
233
|
+
"retry.maxDelayMs": "重试等待上限(毫秒)",
|
|
234
|
+
"limits.maxTurns": "每次运行回合上限",
|
|
235
|
+
"limits.maxCostUsd": "每次运行花费上限(美元)",
|
|
236
|
+
"reminders.todo": "todo 提醒",
|
|
237
|
+
"reminders.fileChanges": "文件改动提醒",
|
|
238
|
+
"reminders.contextPressure": "上下文用量提醒",
|
|
239
|
+
"reminders.budget": "预算提醒",
|
|
240
|
+
"todo.reminder": "todo 未更新提醒(回合)",
|
|
241
|
+
"checkpoints.mode": "检查点",
|
|
242
|
+
"checkpoints.maxFileBytes": "检查点单文件上限",
|
|
243
|
+
"checkpoints.keep": "保留检查点数",
|
|
244
|
+
"sandbox.enabled": "系统沙箱",
|
|
245
|
+
"sandbox.bash": "bash 沙箱",
|
|
246
|
+
"sandbox.network": "沙箱网络",
|
|
247
|
+
"agents.maxConcurrent": "外部 Agent 并发",
|
|
248
|
+
"agents.sessionBudgetUsd": "外部 Agent 预算",
|
|
249
|
+
"subagents.maxConcurrent": "子 Agent 并发",
|
|
250
|
+
"subagents.maxPending": "子 Agent 排队上限",
|
|
251
|
+
"memory.enabled": "记忆",
|
|
252
|
+
"memory.subagents": "子 Agent 的记忆",
|
|
253
|
+
},
|
|
254
|
+
apply: { now: "即时", nextSession: "新会话", restart: "重启" },
|
|
255
|
+
prefixTag: "动缓存",
|
|
256
|
+
scope: { user: "用户级", project: "项目级" },
|
|
257
|
+
title: "设置",
|
|
258
|
+
writeTo: (scope, path) => `写入:${scope} ${path}`,
|
|
259
|
+
tabSwitch: "[Tab 切换]",
|
|
260
|
+
embedded: "嵌入模式:写入用户级配置",
|
|
261
|
+
searchPlaceholder: "/ 搜索",
|
|
262
|
+
searchPrompt: (query) => `搜索:${query}`,
|
|
263
|
+
noMatches: "没有匹配的设置",
|
|
264
|
+
unset: "(未设)",
|
|
265
|
+
auto: (value) => `自动(${value})`,
|
|
266
|
+
source: (source) => `来源 ${source}`,
|
|
267
|
+
locked: (source) => `[锁定] ${source}`,
|
|
268
|
+
lockReason: {
|
|
269
|
+
env: (name) => `环境变量 ${name} 生效`,
|
|
270
|
+
cli: "命令行参数生效",
|
|
271
|
+
profile: "宿主 profile 生效",
|
|
272
|
+
project: "项目级配置生效",
|
|
273
|
+
},
|
|
274
|
+
projectNote: { deny: "仅用户级", tighten: "只能收紧" },
|
|
275
|
+
footer: "↑↓ 选择 · Enter/空格 修改 · / 搜索 · Tab 用户级/项目级 · Backspace 恢复缺省 · Esc 关闭",
|
|
276
|
+
footerCompact: "↑↓ · Enter · / · Tab · Esc",
|
|
277
|
+
footerSearch: "输入过滤 · ↑↓ 选择 · Enter 修改 · Esc 清除",
|
|
278
|
+
footerEdit: "Enter 保存 · Esc 取消",
|
|
279
|
+
editPrompt: (label) => `${label}:`,
|
|
280
|
+
confirmUnset: (key) => `把 ${key} 恢复为下层的值?再按一次 Backspace 确认`,
|
|
281
|
+
prefixNotice: "会改变缓存前缀,下一次请求按未命中计费",
|
|
282
|
+
bypassPersist: "写入用户级配置:以后每次启动都在 Bypass permissions 下运行",
|
|
283
|
+
pickTitle: (label) => `${label}`,
|
|
284
|
+
defaultChoice: "(不设:缺省)",
|
|
285
|
+
summaryTitle: "设置已修改",
|
|
286
|
+
summaryLine: (label, from, to, scope) => `${label}:${from} → ${to}(${scope})`,
|
|
287
|
+
summaryRestart: (labels) => `以下项重启后生效:${labels}`,
|
|
288
|
+
summaryNextSession: (labels) => `以下项新会话(/new)生效:${labels}`,
|
|
289
|
+
setDone: (key, value, scope) => `${key} = ${value}(${scope})`,
|
|
290
|
+
unsetDone: (key, value, scope) => `已恢复 ${key}(${scope}),现为 ${value}`,
|
|
291
|
+
stillOverridden: (key, source) => `${key} 仍被 ${source} 覆盖,撤掉后写入的值才生效`,
|
|
292
|
+
slashUsage: "用法:/config [key=value | key value]",
|
|
293
|
+
errors: {
|
|
294
|
+
unknownKey: (key) => `${key} 不是可设置项,用 /config 查看`,
|
|
295
|
+
notSettable: (key) => `${key} 不能在这里设置,用 ama config edit`,
|
|
296
|
+
invalidBool: (key, raw) => `${key}:应为 true 或 false(on / off、1 / 0),收到 ${raw}`,
|
|
297
|
+
invalidEnum: (key, raw, options) => `${key}:应为 ${options} 之一,收到 ${raw}`,
|
|
298
|
+
invalidNumber: (key, raw) => `${key}:应为数字,收到 ${raw}`,
|
|
299
|
+
outOfRange: (key, range) => `${key}:应 ${range}`,
|
|
300
|
+
invalidModel: (key, raw) => `${key}:应为 provider/model[@channel],收到 ${raw}`,
|
|
301
|
+
emptyText: (key) => `${key}:值为空`,
|
|
302
|
+
needsJson: (key) => `${key} 是列表或对象,用 --json-value 传入`,
|
|
303
|
+
invalidJson: (key, reason) => `${key}:JSON 无效(${reason})`,
|
|
304
|
+
invalid: (key, detail) => `${key}:${detail}`,
|
|
305
|
+
projectDenied: (key) => `${key} 只能在用户级配置或 profile 里设,项目级不能设`,
|
|
306
|
+
projectTighten: (key, current) => `项目级只能收紧 ${key}(当前 ${current})`,
|
|
307
|
+
readFailed: (detail) => `读不了配置文件:${detail}`,
|
|
308
|
+
writeFailed: (path, reason) => `写不了 ${path}:${reason}`,
|
|
309
|
+
locked: (key, reason) => `${key} 已锁定:${reason}`,
|
|
310
|
+
},
|
|
311
|
+
hints: {
|
|
312
|
+
providers: "ama providers · ama auth",
|
|
313
|
+
permissionRules: "permission.allow / deny / builtinDeny:/permissions · ama config edit",
|
|
314
|
+
tools: "tools.default / disabled:/tools · ama config set --json-value",
|
|
315
|
+
dirs: "skills.dirs / agents.dirs:ama config set --json-value",
|
|
316
|
+
sandboxWritable: "ama config set sandbox.writable --json-value",
|
|
317
|
+
agents: "agents.<id>:ama config edit",
|
|
318
|
+
hooks: "hooks.json · /hooks",
|
|
319
|
+
auth: "ama auth",
|
|
320
|
+
},
|
|
321
|
+
cli: {
|
|
322
|
+
usage: `用法:ama config get <key> [--json]
|
|
323
|
+
ama config set <key> <value> [--project] [--json-value] [--yes]
|
|
324
|
+
ama config unset <key> [--project]
|
|
325
|
+
ama config list [前缀] [--json] [--all]
|
|
326
|
+
`,
|
|
327
|
+
getLine: (key, value, source, apply) => `${key} = ${value}(${source};${apply})`,
|
|
328
|
+
listHeader: "设置(键 = 值 来源 生效)",
|
|
329
|
+
applyNone: "-",
|
|
330
|
+
confirmBypass: "把 permission.mode full-auto 写入用户级配置?以后每次启动都在 Bypass permissions 下运行。",
|
|
331
|
+
needYes: "permission.mode full-auto 会让以后每次启动都不再审批;确认请加 --yes",
|
|
332
|
+
cancelled: "已取消,没有写入",
|
|
333
|
+
missingKey: "缺少 <key>",
|
|
334
|
+
missingValue: "缺少 <value>",
|
|
335
|
+
},
|
|
336
|
+
};
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 消息目录:subcommands 里 `ama config show|path|edit`(`configShow`,含 doctor 共用的模型 / codemode
|
|
3
|
+
* 说明)与 `ama models discover`(`discover`)。由 messages/subcommands.ts 引用。[W6-I5]
|
|
4
|
+
*
|
|
5
|
+
* zh 逐字节保留迁移前的原文。
|
|
6
|
+
*/
|
|
7
|
+
export declare const en: {
|
|
8
|
+
configShow: {
|
|
9
|
+
usage: string;
|
|
10
|
+
unknownAction: (action: string) => string;
|
|
11
|
+
/** `ama config path`:标签列宽对齐由调用方补空格。 */
|
|
12
|
+
missing: string;
|
|
13
|
+
configDir: string;
|
|
14
|
+
dataDir: string;
|
|
15
|
+
projectLevel: string;
|
|
16
|
+
noEditor: (path: string) => string;
|
|
17
|
+
editorFailed: (editor: string, path: string) => string;
|
|
18
|
+
registryMissing: string;
|
|
19
|
+
zeroConfigLocal: (provider: string, rule: string) => string;
|
|
20
|
+
zeroConfigKey: (provider: string, source: string, rule: string) => string;
|
|
21
|
+
providersHeading: string;
|
|
22
|
+
baseUrlFromEnv: (env: string) => string;
|
|
23
|
+
layerDefault: string;
|
|
24
|
+
layerCli: string;
|
|
25
|
+
sandboxIsolated: (node: number) => string;
|
|
26
|
+
sandboxOs: (node: number, kind: string) => string;
|
|
27
|
+
sandboxNone: (node: number) => string;
|
|
28
|
+
codemodeExplicit: (sandbox: string) => string;
|
|
29
|
+
codemodeFollowsPreset: (preset: string, sandbox: string) => string;
|
|
30
|
+
presetAlias: (layer: string, label: string, preset: string, canonical: string) => string;
|
|
31
|
+
defaultSource: (reason: string) => string;
|
|
32
|
+
heading: string;
|
|
33
|
+
layerLine: (name: string, label: string) => string;
|
|
34
|
+
model: (ref: string | undefined, reason: string) => string;
|
|
35
|
+
tools: (tools: string, preset: string, codemode: string) => string;
|
|
36
|
+
codemode: (mode: string, reason: string) => string;
|
|
37
|
+
bashSandbox: (detail: string) => string;
|
|
38
|
+
note: (text: string) => string;
|
|
39
|
+
warning: (text: string) => string;
|
|
40
|
+
};
|
|
41
|
+
discover: {
|
|
42
|
+
limitPositive: (raw: string) => string;
|
|
43
|
+
notInUserConfig: (provider: string, path: string) => string;
|
|
44
|
+
nothingToWrite: (kept: number) => string;
|
|
45
|
+
written: (path: string, provider: string, added: number, kept: number, backup: boolean) => string;
|
|
46
|
+
skippedNoTools: (ids: string) => string;
|
|
47
|
+
unmatchedWarning: (ids: string) => string;
|
|
48
|
+
listFailed: (provider: string, error: string) => string;
|
|
49
|
+
found: (provider: string, count: number, url: string) => string;
|
|
50
|
+
unmatched: string;
|
|
51
|
+
image: string;
|
|
52
|
+
reasoning: string;
|
|
53
|
+
noTools: string;
|
|
54
|
+
configured: (api: string) => string;
|
|
55
|
+
probeHeader: (count: number, order: string, requests: number, extra: number, limit: number) => string;
|
|
56
|
+
unavailable: string;
|
|
57
|
+
probeStopped: (reason: string) => string;
|
|
58
|
+
};
|
|
59
|
+
};
|
|
60
|
+
export declare const zh: {
|
|
61
|
+
configShow: {
|
|
62
|
+
usage: string;
|
|
63
|
+
unknownAction: (action: string) => string;
|
|
64
|
+
missing: string;
|
|
65
|
+
configDir: string;
|
|
66
|
+
dataDir: string;
|
|
67
|
+
projectLevel: string;
|
|
68
|
+
noEditor: (path: string) => string;
|
|
69
|
+
editorFailed: (editor: string, path: string) => string;
|
|
70
|
+
registryMissing: string;
|
|
71
|
+
zeroConfigLocal: (provider: string, rule: string) => string;
|
|
72
|
+
zeroConfigKey: (provider: string, source: string, rule: string) => string;
|
|
73
|
+
providersHeading: string;
|
|
74
|
+
baseUrlFromEnv: (env: string) => string;
|
|
75
|
+
layerDefault: string;
|
|
76
|
+
layerCli: string;
|
|
77
|
+
sandboxIsolated: (node: number) => string;
|
|
78
|
+
sandboxOs: (node: number, kind: string) => string;
|
|
79
|
+
sandboxNone: (node: number) => string;
|
|
80
|
+
codemodeExplicit: (sandbox: string) => string;
|
|
81
|
+
codemodeFollowsPreset: (preset: string, sandbox: string) => string;
|
|
82
|
+
presetAlias: (layer: string, label: string, preset: string, canonical: string) => string;
|
|
83
|
+
defaultSource: (reason: string) => string;
|
|
84
|
+
heading: string;
|
|
85
|
+
layerLine: (name: string, label: string) => string;
|
|
86
|
+
model: (ref: string | undefined, reason: string) => string;
|
|
87
|
+
tools: (tools: string, preset: string, codemode: string) => string;
|
|
88
|
+
codemode: (mode: string, reason: string) => string;
|
|
89
|
+
bashSandbox: (detail: string) => string;
|
|
90
|
+
note: (text: string) => string;
|
|
91
|
+
warning: (text: string) => string;
|
|
92
|
+
};
|
|
93
|
+
discover: {
|
|
94
|
+
limitPositive: (raw: string) => string;
|
|
95
|
+
notInUserConfig: (provider: string, path: string) => string;
|
|
96
|
+
nothingToWrite: (kept: number) => string;
|
|
97
|
+
written: (path: string, provider: string, added: number, kept: number, backup: boolean) => string;
|
|
98
|
+
skippedNoTools: (ids: string) => string;
|
|
99
|
+
unmatchedWarning: (ids: string) => string;
|
|
100
|
+
listFailed: (provider: string, error: string) => string;
|
|
101
|
+
found: (provider: string, count: number, url: string) => string;
|
|
102
|
+
unmatched: string;
|
|
103
|
+
image: string;
|
|
104
|
+
reasoning: string;
|
|
105
|
+
noTools: string;
|
|
106
|
+
configured: (api: string) => string;
|
|
107
|
+
probeHeader: (count: number, order: string, requests: number, extra: number, limit: number) => string;
|
|
108
|
+
unavailable: string;
|
|
109
|
+
probeStopped: (reason: string) => string;
|
|
110
|
+
};
|
|
111
|
+
};
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 消息目录:subcommands 里 `ama config show|path|edit`(`configShow`,含 doctor 共用的模型 / codemode
|
|
3
|
+
* 说明)与 `ama models discover`(`discover`)。由 messages/subcommands.ts 引用。[W6-I5]
|
|
4
|
+
*
|
|
5
|
+
* zh 逐字节保留迁移前的原文。
|
|
6
|
+
*/
|
|
7
|
+
import { plural } from "../format.js";
|
|
8
|
+
export const en = {
|
|
9
|
+
configShow: {
|
|
10
|
+
usage: `Usage: ama config show [--json] [--profile <file>] [--auth-file <file>]
|
|
11
|
+
[--tools-preset <name>] [--codemode off|on|only]
|
|
12
|
+
ama config path Config directory, data directory and file paths
|
|
13
|
+
ama config edit Open config.json in $VISUAL / $EDITOR (prints the path without an editor)
|
|
14
|
+
`,
|
|
15
|
+
unknownAction: (action) => `Unknown config subcommand: ${action}`,
|
|
16
|
+
/** `ama config path`:标签列宽对齐由调用方补空格。 */
|
|
17
|
+
missing: " (missing)",
|
|
18
|
+
configDir: "Config directory",
|
|
19
|
+
dataDir: "Data directory",
|
|
20
|
+
projectLevel: "Project",
|
|
21
|
+
noEditor: (path) => `${path}\n($VISUAL / $EDITOR is not set; open the file above in an editor)\n`,
|
|
22
|
+
editorFailed: (editor, path) => `ama: the editor exited abnormally (${editor}); the file is at ${path}\n`,
|
|
23
|
+
registryMissing: "provider registry not assembled",
|
|
24
|
+
zeroConfigLocal: (provider, rule) => `zero-config: local ${provider} is reachable; ${rule}`,
|
|
25
|
+
zeroConfigKey: (provider, source, rule) => `zero-config: ${provider} has a key (${source}); ${rule}`,
|
|
26
|
+
providersHeading: "Providers:",
|
|
27
|
+
baseUrlFromEnv: (env) => ` (baseUrl from environment variable ${env})`,
|
|
28
|
+
layerDefault: "built-in defaults",
|
|
29
|
+
layerCli: "command line",
|
|
30
|
+
sandboxIsolated: (node) => `Node ${node} isolates the network`,
|
|
31
|
+
sandboxOs: (node, kind) => `Node ${node}, network isolated by the OS sandbox ${kind}`,
|
|
32
|
+
sandboxNone: (node) => `Node ${node} < 25, network not isolated`,
|
|
33
|
+
codemodeExplicit: (sandbox) => `codemode.mode set explicitly (${sandbox})`,
|
|
34
|
+
codemodeFollowsPreset: (preset, sandbox) => `follows preset ${preset} (${sandbox})`,
|
|
35
|
+
presetAlias: (layer, label, preset, canonical) => `${layer} (${label}) writes tools.preset with the old name ${preset}; the canonical name is ${canonical}`,
|
|
36
|
+
defaultSource: (reason) => `default (${reason})`,
|
|
37
|
+
heading: "Effective config (sources: default built-in ← user ← profile ← project tighten-only ← cli)",
|
|
38
|
+
layerLine: (name, label) => ` ${name}: ${label}`,
|
|
39
|
+
model: (ref, reason) => `Model: ${ref ?? "(none)"} ${reason}`,
|
|
40
|
+
tools: (tools, preset, codemode) => `Tools: ${tools} (preset ${preset}, codemode ${codemode})`,
|
|
41
|
+
codemode: (mode, reason) => `codemode: ${mode} ${reason}`,
|
|
42
|
+
bashSandbox: (detail) => `bash sandbox: ${detail}`,
|
|
43
|
+
note: (text) => `Note: ${text}`,
|
|
44
|
+
warning: (text) => `Warning: ${text}`,
|
|
45
|
+
},
|
|
46
|
+
discover: {
|
|
47
|
+
limitPositive: (raw) => `--limit needs a positive integer: ${raw}`,
|
|
48
|
+
notInUserConfig: (provider, path) => `ama: ${provider} is not in the user config (${path}); nothing written\n`,
|
|
49
|
+
nothingToWrite: (kept) => `\nNo new models to write${kept > 0 ? ` (${plural(kept, "model")} already present, not overwritten)` : ""}\n`,
|
|
50
|
+
written: (path, provider, added, kept, backup) => `\nWrote ${path}: ${provider} +${plural(added, "model")}` +
|
|
51
|
+
`${kept > 0 ? `, ${kept} already present and not overwritten` : ""}` +
|
|
52
|
+
`${backup ? ` (original backed up as ${path}.bak)` : ""}\n`,
|
|
53
|
+
skippedNoTools: (ids) => `Skipped models without tool calling (models.dev): ${ids}\n`,
|
|
54
|
+
unmatchedWarning: (ids) => `ama: warning: ${ids} not matched in models.dev, no contextWindow, auto-compaction off; ` +
|
|
55
|
+
`add it in config.json or set modelsDev when needed\n`,
|
|
56
|
+
listFailed: (provider, error) => `ama: failed to fetch the model list of ${provider}: ${error}\n`,
|
|
57
|
+
found: (provider, count, url) => `${provider}: found ${plural(count, "model")} (${url})\n`,
|
|
58
|
+
unmatched: " models.dev: no match",
|
|
59
|
+
image: " · image",
|
|
60
|
+
reasoning: " · reasoning",
|
|
61
|
+
noTools: " · no tool calling",
|
|
62
|
+
configured: (api) => ` configured (${api})`,
|
|
63
|
+
probeHeader: (count, order, requests, extra, limit) => `\nProbing protocols: ${plural(count, "model")} (${order}), at most ${plural(requests, "request")}` +
|
|
64
|
+
`${extra > 0 ? `; ${extra} more over --limit ${limit} are not probed` : ""}\n`,
|
|
65
|
+
unavailable: "unavailable (all three protocols failed)",
|
|
66
|
+
probeStopped: (reason) => `ama: probing stopped early (${reason})\n`,
|
|
67
|
+
},
|
|
68
|
+
};
|
|
69
|
+
export const zh = {
|
|
70
|
+
configShow: {
|
|
71
|
+
usage: `用法:ama config show [--json] [--profile <文件>] [--auth-file <文件>]
|
|
72
|
+
[--tools-preset <名>] [--codemode off|on|only]
|
|
73
|
+
ama config path 配置目录、数据目录与各文件路径
|
|
74
|
+
ama config edit 用 $VISUAL / $EDITOR 打开 config.json(没有编辑器时打印路径)
|
|
75
|
+
`,
|
|
76
|
+
unknownAction: (action) => `未知的 config 子命令:${action}`,
|
|
77
|
+
missing: " (不存在)",
|
|
78
|
+
configDir: "配置目录",
|
|
79
|
+
dataDir: "数据目录",
|
|
80
|
+
projectLevel: "项目级",
|
|
81
|
+
noEditor: (path) => `${path}\n(没有设置 $VISUAL / $EDITOR,请用编辑器打开上面的文件)\n`,
|
|
82
|
+
editorFailed: (editor, path) => `ama: 编辑器退出异常(${editor});文件在 ${path}\n`,
|
|
83
|
+
registryMissing: "注册表未装配",
|
|
84
|
+
zeroConfigLocal: (provider, rule) => `零配置:本地 ${provider} 可达;${rule}`,
|
|
85
|
+
zeroConfigKey: (provider, source, rule) => `零配置:${provider} 有 key(${source});${rule}`,
|
|
86
|
+
providersHeading: "供应商:",
|
|
87
|
+
baseUrlFromEnv: (env) => `(baseUrl 来自环境变量 ${env})`,
|
|
88
|
+
layerDefault: "内置缺省",
|
|
89
|
+
layerCli: "命令行",
|
|
90
|
+
sandboxIsolated: (node) => `Node ${node} 网络已隔离`,
|
|
91
|
+
sandboxOs: (node, kind) => `Node ${node} 网络由操作系统沙箱 ${kind} 隔离`,
|
|
92
|
+
sandboxNone: (node) => `Node ${node} < 25 网络未隔离`,
|
|
93
|
+
codemodeExplicit: (sandbox) => `codemode.mode 显式设置(${sandbox})`,
|
|
94
|
+
codemodeFollowsPreset: (preset, sandbox) => `跟随预设 ${preset}(${sandbox})`,
|
|
95
|
+
presetAlias: (layer, label, preset, canonical) => `${layer}(${label})的 tools.preset 写的是旧名 ${preset},规范名 ${canonical}`,
|
|
96
|
+
defaultSource: (reason) => `default(${reason})`,
|
|
97
|
+
heading: "生效配置(来源:default 内置 ← user ← profile ← project 只能收紧 ← cli)",
|
|
98
|
+
layerLine: (name, label) => ` ${name}:${label}`,
|
|
99
|
+
model: (ref, reason) => `模型:${ref ?? "(无)"} ${reason}`,
|
|
100
|
+
tools: (tools, preset, codemode) => `工具:${tools}(预设 ${preset},codemode ${codemode})`,
|
|
101
|
+
codemode: (mode, reason) => `codemode:${mode} ${reason}`,
|
|
102
|
+
bashSandbox: (detail) => `bash 沙箱:${detail}`,
|
|
103
|
+
note: (text) => `提示:${text}`,
|
|
104
|
+
warning: (text) => `警告:${text}`,
|
|
105
|
+
},
|
|
106
|
+
discover: {
|
|
107
|
+
limitPositive: (raw) => `--limit 需要正整数:${raw}`,
|
|
108
|
+
notInUserConfig: (provider, path) => `ama: ${provider} 不在用户级配置(${path})里,未写入\n`,
|
|
109
|
+
nothingToWrite: (kept) => `\n没有新模型要写入${kept > 0 ? `(${kept} 个已存在,未覆盖)` : ""}\n`,
|
|
110
|
+
written: (path, provider, added, kept, backup) => `\n已写入 ${path}:${provider} 新增 ${added} 个模型` +
|
|
111
|
+
`${kept > 0 ? `,${kept} 个已存在未覆盖` : ""}${backup ? `(原文件备份为 ${path}.bak)` : ""}\n`,
|
|
112
|
+
skippedNoTools: (ids) => `跳过不支持工具调用的模型(models.dev):${ids}\n`,
|
|
113
|
+
unmatchedWarning: (ids) => `ama: 警告:${ids} 在 models.dev 未匹配,没有 contextWindow,自动压缩关闭;` +
|
|
114
|
+
`需要时在 config.json 里补上或写 modelsDev\n`,
|
|
115
|
+
listFailed: (provider, error) => `ama: ${provider} 模型列表获取失败:${error}\n`,
|
|
116
|
+
found: (provider, count, url) => `${provider}:发现 ${count} 个模型(${url})\n`,
|
|
117
|
+
unmatched: " models.dev 未匹配",
|
|
118
|
+
image: " · 图片",
|
|
119
|
+
reasoning: " · 思考",
|
|
120
|
+
noTools: " · 不支持工具调用",
|
|
121
|
+
configured: (api) => ` 已配置(${api})`,
|
|
122
|
+
probeHeader: (count, order, requests, extra, limit) => `\n探测协议:${count} 个模型(${order}),最多 ${requests} 次请求` +
|
|
123
|
+
`${extra > 0 ? `;另有 ${extra} 个超出 --limit ${limit},未探测` : ""}\n`,
|
|
124
|
+
unavailable: "不可用(三种协议均失败)",
|
|
125
|
+
probeStopped: (reason) => `ama: 探测提前停止(${reason})\n`,
|
|
126
|
+
},
|
|
127
|
+
};
|