@armadra/agent 0.8.0 → 0.8.1
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 +39 -32
- package/CHANGELOG.zh-CN.md +56 -49
- package/README.md +162 -204
- package/README.zh-CN.md +150 -199
- package/dist/acp.d.ts +1 -1
- package/dist/acp.js +1 -1
- package/dist/agent/limits.d.ts +1 -1
- package/dist/agent/limits.js +1 -1
- package/dist/agent/loop-guard.d.ts +1 -1
- package/dist/agent/loop-guard.js +1 -1
- package/dist/agent/prompt-rules.d.ts +1 -1
- package/dist/agent/prompt-rules.js +1 -1
- package/dist/agent/reminders.d.ts +1 -1
- package/dist/agent/reminders.js +1 -1
- package/dist/agent/session-cache-key.d.ts +1 -1
- package/dist/agent/session-cache-key.js +1 -1
- package/dist/agent/session-extensions.d.ts +1 -1
- package/dist/agent/session-extensions.js +1 -1
- package/dist/agent/session-images.d.ts +1 -1
- package/dist/agent/session-images.js +1 -1
- package/dist/agent/session-plan.d.ts +1 -1
- package/dist/agent/session-plan.js +1 -1
- package/dist/agent/session-rewind.d.ts +1 -1
- package/dist/agent/session-rewind.js +1 -1
- package/dist/agent/session-settings.d.ts +1 -1
- package/dist/agent/session-settings.js +1 -1
- package/dist/agent/session-subagent.d.ts +1 -1
- package/dist/agent/session-subagent.js +1 -1
- package/dist/agent/session-telemetry.d.ts +1 -1
- package/dist/agent/session-telemetry.js +1 -1
- package/dist/agent/session-trace-writer.d.ts +1 -1
- package/dist/agent/session-trace-writer.js +1 -1
- package/dist/agent/session.js +1 -1
- package/dist/agent/subagent-background.d.ts +1 -1
- package/dist/agent/subagent-background.js +1 -1
- package/dist/agent/subagent-direct.d.ts +1 -1
- package/dist/agent/subagent-direct.js +1 -1
- package/dist/agent/subagent-fork.d.ts +1 -1
- package/dist/agent/subagent-fork.js +1 -1
- package/dist/agent/subagent-registry.d.ts +1 -1
- package/dist/agent/subagent-registry.js +1 -1
- package/dist/agent/system-prompt.js +1 -1
- package/dist/agent/tool-availability.d.ts +1 -1
- package/dist/agent/tool-availability.js +1 -1
- package/dist/agent/types-w5.d.ts +2 -2
- package/dist/agent/types-w5.js +1 -1
- package/dist/agent/types-w6.d.ts +1 -1
- package/dist/agent/types-w6.js +1 -1
- package/dist/agent/types.d.ts +1 -1
- package/dist/agent/worktree.d.ts +1 -1
- package/dist/agent/worktree.js +1 -1
- package/dist/agents/builtin.d.ts +1 -1
- package/dist/agents/builtin.js +1 -1
- package/dist/agents/catalog.d.ts +1 -1
- package/dist/agents/catalog.js +1 -1
- package/dist/agents/discover.d.ts +1 -1
- package/dist/agents/discover.js +1 -1
- package/dist/agents/external.d.ts +1 -1
- package/dist/agents/external.js +1 -1
- package/dist/agents/parse.d.ts +1 -1
- package/dist/agents/parse.js +1 -1
- package/dist/agents/result.d.ts +1 -1
- package/dist/agents/result.js +2 -2
- package/dist/agents/task-record.d.ts +3 -3
- package/dist/agents/task-record.js +2 -2
- package/dist/agents/types.d.ts +1 -1
- package/dist/agents/types.js +1 -1
- package/dist/ai/apis/anthropic-compat.d.ts +2 -2
- package/dist/ai/apis/anthropic-compat.js +2 -2
- package/dist/ai/apis/cache-params.d.ts +1 -1
- package/dist/ai/apis/cache-params.js +1 -1
- package/dist/ai/apis/chatgpt-backend.d.ts +1 -1
- package/dist/ai/apis/chatgpt-backend.js +1 -1
- package/dist/ai/apis/chatgpt-rate-limits.d.ts +1 -1
- package/dist/ai/apis/chatgpt-rate-limits.js +1 -1
- package/dist/ai/apis/max-tokens.d.ts +1 -1
- package/dist/ai/apis/max-tokens.js +1 -1
- package/dist/ai/apis/shared.d.ts +1 -1
- package/dist/ai/apis/shared.js +1 -1
- package/dist/ai/image-intern.d.ts +2 -2
- package/dist/ai/image-intern.js +1 -1
- package/dist/ai/image-limits.d.ts +1 -1
- package/dist/ai/image-limits.js +1 -1
- package/dist/ai/json-body.d.ts +1 -1
- package/dist/ai/json-body.js +1 -1
- package/dist/ai/providers/builtin.d.ts +2 -2
- package/dist/ai/providers/builtin.js +4 -4
- package/dist/ai/providers/catalog.d.ts +2 -2
- package/dist/ai/providers/catalog.js +1 -1
- package/dist/ai/providers/channels.d.ts +1 -1
- package/dist/ai/providers/channels.js +1 -1
- package/dist/ai/providers/enrich.d.ts +1 -1
- package/dist/ai/providers/enrich.js +1 -1
- package/dist/ai/providers/models-dev-cache.d.ts +1 -1
- package/dist/ai/providers/models-dev-cache.js +1 -1
- package/dist/ai/providers/models-dev-data.d.ts +1 -1
- package/dist/ai/providers/models-dev-data.js +1 -1
- package/dist/ai/providers/models-dev-snapshot.d.ts +1 -1
- package/dist/ai/providers/models-dev-snapshot.js +1 -1
- package/dist/ai/providers/models-dev.d.ts +4 -4
- package/dist/ai/providers/models-dev.js +3 -3
- package/dist/ai/types.d.ts +2 -2
- package/dist/ai/types.js +1 -1
- package/dist/auth/chatgpt/cli.d.ts +1 -1
- package/dist/auth/chatgpt/cli.js +1 -1
- package/dist/auth/chatgpt/host-id.d.ts +1 -1
- package/dist/auth/chatgpt/host-id.js +1 -1
- package/dist/auth/chatgpt/login.d.ts +1 -1
- package/dist/auth/chatgpt/login.js +1 -1
- package/dist/auth/chatgpt/presets.d.ts +1 -1
- package/dist/auth/chatgpt/presets.js +1 -1
- package/dist/auth/oauth/callback-server.d.ts +1 -1
- package/dist/auth/oauth/callback-server.js +1 -1
- package/dist/auth/oauth/flows.d.ts +1 -1
- package/dist/auth/oauth/flows.js +1 -1
- package/dist/auth/oauth/oidc.d.ts +1 -1
- package/dist/auth/oauth/oidc.js +1 -1
- package/dist/auth/oauth/pkce.d.ts +1 -1
- package/dist/auth/oauth/pkce.js +1 -1
- package/dist/auth/oauth/refresh.d.ts +1 -1
- package/dist/auth/oauth/refresh.js +1 -1
- package/dist/auth/oauth/token-client.d.ts +1 -1
- package/dist/auth/oauth/token-client.js +1 -1
- package/dist/auth/oauth/token-store.d.ts +1 -1
- package/dist/auth/oauth/token-store.js +1 -1
- package/dist/auth/testing/fake-oauth.d.ts +1 -1
- package/dist/auth/testing/fake-oauth.js +1 -1
- package/dist/bundle/ama.cjs +24 -24
- package/dist/checkpoints/blobs.d.ts +1 -1
- package/dist/checkpoints/blobs.js +1 -1
- package/dist/checkpoints/gc.d.ts +1 -1
- package/dist/checkpoints/gc.js +1 -1
- package/dist/checkpoints/git-head.d.ts +1 -1
- package/dist/checkpoints/git-head.js +1 -1
- package/dist/checkpoints/index.d.ts +1 -1
- package/dist/checkpoints/index.js +1 -1
- package/dist/checkpoints/replay.d.ts +1 -1
- package/dist/checkpoints/replay.js +1 -1
- package/dist/checkpoints/restore.d.ts +1 -1
- package/dist/checkpoints/restore.js +1 -1
- package/dist/checkpoints/settings.d.ts +1 -1
- package/dist/checkpoints/settings.js +1 -1
- package/dist/checkpoints/shadow-git.d.ts +1 -1
- package/dist/checkpoints/shadow-git.js +1 -1
- package/dist/checkpoints/shadow-restore.d.ts +1 -1
- package/dist/checkpoints/shadow-restore.js +1 -1
- package/dist/checkpoints/tracker.d.ts +1 -1
- package/dist/checkpoints/tracker.js +1 -1
- package/dist/checkpoints/types.d.ts +1 -1
- package/dist/checkpoints/types.js +1 -1
- package/dist/cli/args.d.ts +2 -2
- package/dist/cli/args.js +1 -1
- package/dist/cli/bootstrap.js +1 -1
- package/dist/cli/choice-prompt.d.ts +1 -1
- package/dist/cli/choice-prompt.js +1 -1
- package/dist/cli/codemode-notice.d.ts +1 -1
- package/dist/cli/codemode-notice.js +1 -1
- package/dist/cli/compose-agents.d.ts +1 -1
- package/dist/cli/compose-agents.js +1 -1
- package/dist/cli/compose-extensions.d.ts +1 -1
- package/dist/cli/compose-extensions.js +1 -1
- package/dist/cli/compose-memory.d.ts +1 -1
- package/dist/cli/compose-memory.js +1 -1
- package/dist/cli/compose-providers.d.ts +1 -1
- package/dist/cli/compose-providers.js +1 -1
- package/dist/cli/compose-request.d.ts +1 -1
- package/dist/cli/compose-request.js +1 -1
- package/dist/cli/from-prompt.d.ts +1 -1
- package/dist/cli/from-prompt.js +1 -1
- package/dist/cli/main.d.ts +1 -1
- package/dist/cli/main.js +1 -1
- package/dist/cli/subcommands/auth.d.ts +1 -1
- package/dist/cli/subcommands/auth.js +1 -1
- package/dist/cli/subcommands/config-set.d.ts +1 -1
- package/dist/cli/subcommands/config-set.js +1 -1
- package/dist/cli/subcommands/doctor.js +1 -1
- package/dist/cli/subcommands/init.d.ts +1 -1
- package/dist/cli/subcommands/init.js +1 -1
- package/dist/cli/subcommands/memory.d.ts +1 -1
- package/dist/cli/subcommands/memory.js +1 -1
- package/dist/cli/subcommands/models.js +1 -1
- package/dist/cli/subcommands/providers-list.d.ts +1 -1
- package/dist/cli/subcommands/providers-list.js +1 -1
- package/dist/cli/subcommands/providers-plan.d.ts +1 -1
- package/dist/cli/subcommands/providers-plan.js +1 -1
- package/dist/cli/subcommands/providers.d.ts +1 -1
- package/dist/cli/subcommands/providers.js +1 -1
- package/dist/cli/subcommands/sessions-export.d.ts +1 -1
- package/dist/cli/subcommands/sessions-export.js +1 -1
- package/dist/cli/subcommands/sessions-trace.d.ts +1 -1
- package/dist/cli/subcommands/sessions-trace.js +1 -1
- package/dist/cli/subcommands/sessions.d.ts +1 -1
- package/dist/cli/subcommands/sessions.js +1 -1
- package/dist/cli/subcommands/stats.d.ts +1 -1
- package/dist/cli/subcommands/stats.js +1 -1
- package/dist/codemode/capability.d.ts +1 -1
- package/dist/codemode/capability.js +1 -1
- package/dist/codemode/host-side.d.ts +2 -2
- package/dist/codemode/host-side.js +2 -2
- package/dist/compaction/image-budget.d.ts +1 -1
- package/dist/compaction/image-budget.js +1 -1
- package/dist/config/edit.d.ts +1 -1
- package/dist/config/edit.js +1 -1
- package/dist/config/init.d.ts +1 -1
- package/dist/config/init.js +1 -1
- package/dist/config/json-schema.d.ts +2 -2
- package/dist/config/json-schema.js +2 -2
- package/dist/config/schema-w5.d.ts +1 -1
- package/dist/config/schema-w5.js +1 -1
- package/dist/config/schema-w6.d.ts +1 -1
- package/dist/config/schema-w6.js +1 -1
- package/dist/config/settings-registry.d.ts +1 -1
- package/dist/config/settings-registry.js +1 -1
- package/dist/config/types-w5.d.ts +2 -2
- package/dist/config/types-w5.js +2 -2
- package/dist/config/types-w6.d.ts +5 -5
- package/dist/config/types-w6.js +1 -1
- package/dist/config/types.d.ts +6 -6
- package/dist/config/types.js +1 -1
- package/dist/drivers/acp/client.d.ts +1 -1
- package/dist/drivers/acp/client.js +1 -1
- package/dist/drivers/acp/driver.d.ts +1 -1
- package/dist/drivers/acp/driver.js +1 -1
- package/dist/drivers/acp/testing/fake-agent.d.ts +1 -1
- package/dist/drivers/acp/testing/fake-agent.js +1 -1
- package/dist/drivers/acp/types.d.ts +1 -1
- package/dist/drivers/acp/types.js +1 -1
- package/dist/drivers/agents.d.ts +1 -1
- package/dist/drivers/agents.js +1 -1
- package/dist/drivers/base.d.ts +1 -1
- package/dist/drivers/base.js +1 -1
- package/dist/drivers/catalog.d.ts +1 -1
- package/dist/drivers/catalog.js +1 -1
- package/dist/drivers/env.d.ts +1 -1
- package/dist/drivers/env.js +1 -1
- package/dist/drivers/host-runners.d.ts +1 -1
- package/dist/drivers/host-runners.js +1 -1
- package/dist/drivers/jsonrpc.d.ts +1 -1
- package/dist/drivers/jsonrpc.js +1 -1
- package/dist/drivers/native/claude-normalize.d.ts +1 -1
- package/dist/drivers/native/claude-normalize.js +1 -1
- package/dist/drivers/native/claude-stream.d.ts +1 -1
- package/dist/drivers/native/claude-stream.js +1 -1
- package/dist/drivers/native/codex-app-server.d.ts +1 -1
- package/dist/drivers/native/codex-app-server.js +1 -1
- package/dist/drivers/native/codex-normalize.d.ts +1 -1
- package/dist/drivers/native/codex-normalize.js +1 -1
- package/dist/drivers/native/oneshot.d.ts +1 -1
- package/dist/drivers/native/oneshot.js +1 -1
- package/dist/drivers/permissions.d.ts +1 -1
- package/dist/drivers/permissions.js +1 -1
- package/dist/drivers/pids.d.ts +1 -1
- package/dist/drivers/pids.js +1 -1
- package/dist/drivers/pool.d.ts +1 -1
- package/dist/drivers/pool.js +1 -1
- package/dist/drivers/probe.d.ts +1 -1
- package/dist/drivers/probe.js +1 -1
- package/dist/drivers/process.d.ts +1 -1
- package/dist/drivers/process.js +1 -1
- package/dist/drivers/runner.d.ts +1 -1
- package/dist/drivers/runner.js +1 -1
- package/dist/drivers/store.d.ts +1 -1
- package/dist/drivers/store.js +1 -1
- package/dist/drivers/types.d.ts +1 -1
- package/dist/drivers/types.js +1 -1
- package/dist/git/info.d.ts +1 -1
- package/dist/git/info.js +1 -1
- package/dist/host/api-impl.d.ts +1 -1
- package/dist/host/api-impl.js +1 -1
- package/dist/host/types.d.ts +2 -2
- package/dist/i18n/catalog.d.ts +2 -2
- package/dist/i18n/catalog.js +2 -2
- package/dist/i18n/format.d.ts +1 -1
- package/dist/i18n/format.js +1 -1
- package/dist/i18n/index.d.ts +1 -1
- package/dist/i18n/index.js +1 -1
- package/dist/i18n/messages/acp.d.ts +1 -1
- package/dist/i18n/messages/acp.js +1 -1
- package/dist/i18n/messages/agents.d.ts +1 -1
- package/dist/i18n/messages/agents.js +1 -1
- package/dist/i18n/messages/approval.d.ts +1 -1
- package/dist/i18n/messages/approval.js +1 -1
- package/dist/i18n/messages/auth.d.ts +1 -1
- package/dist/i18n/messages/auth.js +1 -1
- package/dist/i18n/messages/cli.d.ts +1 -1
- package/dist/i18n/messages/cli.js +1 -1
- package/dist/i18n/messages/config-keys.js +12 -12
- package/dist/i18n/messages/config.d.ts +1 -1
- package/dist/i18n/messages/config.js +3 -3
- package/dist/i18n/messages/drivers.d.ts +1 -1
- package/dist/i18n/messages/drivers.js +1 -1
- package/dist/i18n/messages/errors.d.ts +1 -1
- package/dist/i18n/messages/errors.js +1 -1
- package/dist/i18n/messages/interactive-line.d.ts +1 -1
- package/dist/i18n/messages/interactive-line.js +1 -1
- package/dist/i18n/messages/interactive-startup.d.ts +1 -1
- package/dist/i18n/messages/interactive-startup.js +1 -1
- package/dist/i18n/messages/interactive-view.d.ts +1 -1
- package/dist/i18n/messages/interactive-view.js +1 -1
- package/dist/i18n/messages/interactive.d.ts +1 -1
- package/dist/i18n/messages/interactive.js +1 -1
- package/dist/i18n/messages/memory.d.ts +1 -1
- package/dist/i18n/messages/memory.js +1 -1
- package/dist/i18n/messages/panels.d.ts +1 -1
- package/dist/i18n/messages/panels.js +1 -1
- package/dist/i18n/messages/permissions.d.ts +1 -1
- package/dist/i18n/messages/permissions.js +1 -1
- package/dist/i18n/messages/plan.d.ts +1 -1
- package/dist/i18n/messages/plan.js +1 -1
- package/dist/i18n/messages/print.d.ts +2 -2
- package/dist/i18n/messages/print.js +2 -2
- package/dist/i18n/messages/report-context.d.ts +1 -1
- package/dist/i18n/messages/report-context.js +1 -1
- package/dist/i18n/messages/report.d.ts +1 -1
- package/dist/i18n/messages/report.js +1 -1
- package/dist/i18n/messages/rewind.d.ts +1 -1
- package/dist/i18n/messages/rewind.js +1 -1
- package/dist/i18n/messages/session.d.ts +1 -1
- package/dist/i18n/messages/session.js +1 -1
- package/dist/i18n/messages/settings.d.ts +1 -1
- package/dist/i18n/messages/settings.js +1 -1
- package/dist/i18n/messages/subcommands.d.ts +1 -1
- package/dist/i18n/messages/subcommands.js +1 -1
- package/dist/i18n/messages/trace.d.ts +1 -1
- package/dist/i18n/messages/trace.js +1 -1
- package/dist/i18n/types.d.ts +1 -1
- package/dist/i18n/types.js +1 -1
- package/dist/memory/frontmatter.d.ts +1 -1
- package/dist/memory/frontmatter.js +1 -1
- package/dist/memory/index.d.ts +1 -1
- package/dist/memory/index.js +1 -1
- package/dist/memory/lock.d.ts +1 -1
- package/dist/memory/lock.js +1 -1
- package/dist/memory/paths.d.ts +1 -1
- package/dist/memory/paths.js +1 -1
- package/dist/memory/runtime.d.ts +1 -1
- package/dist/memory/runtime.js +1 -1
- package/dist/memory/secrets.d.ts +1 -1
- package/dist/memory/secrets.js +1 -1
- package/dist/memory/section.d.ts +1 -1
- package/dist/memory/section.js +1 -1
- package/dist/memory/store.d.ts +1 -1
- package/dist/memory/store.js +1 -1
- package/dist/memory/tool.d.ts +1 -1
- package/dist/memory/tool.js +1 -1
- package/dist/modes/acp/acp-auth-gate.d.ts +1 -1
- package/dist/modes/acp/acp-auth-gate.js +1 -1
- package/dist/modes/acp/acp-config.d.ts +1 -1
- package/dist/modes/acp/acp-config.js +1 -1
- package/dist/modes/acp/acp-connection.d.ts +1 -1
- package/dist/modes/acp/acp-connection.js +1 -1
- package/dist/modes/acp/acp-events.d.ts +1 -1
- package/dist/modes/acp/acp-events.js +1 -1
- package/dist/modes/acp/acp-mode.d.ts +1 -1
- package/dist/modes/acp/acp-mode.js +1 -1
- package/dist/modes/acp/acp-server.d.ts +2 -2
- package/dist/modes/acp/acp-server.js +2 -2
- package/dist/modes/acp/acp-sessions.d.ts +2 -2
- package/dist/modes/acp/acp-sessions.js +2 -2
- package/dist/modes/acp/acp-tool-text.d.ts +1 -1
- package/dist/modes/acp/acp-tool-text.js +1 -1
- package/dist/modes/commands-core.js +1 -1
- package/dist/modes/image-input.d.ts +1 -1
- package/dist/modes/image-input.js +1 -1
- package/dist/modes/interactive/agent-bar.d.ts +1 -1
- package/dist/modes/interactive/agent-bar.js +1 -1
- package/dist/modes/interactive/agent-transcript.d.ts +1 -1
- package/dist/modes/interactive/agent-transcript.js +1 -1
- package/dist/modes/interactive/agent-view.d.ts +1 -1
- package/dist/modes/interactive/agent-view.js +1 -1
- package/dist/modes/interactive/approval-dock.d.ts +1 -1
- package/dist/modes/interactive/approval-dock.js +1 -1
- package/dist/modes/interactive/config-panel.d.ts +1 -1
- package/dist/modes/interactive/config-panel.js +1 -1
- package/dist/modes/interactive/config-ui.d.ts +1 -1
- package/dist/modes/interactive/config-ui.js +1 -1
- package/dist/modes/interactive/memory-panel.d.ts +1 -1
- package/dist/modes/interactive/memory-panel.js +1 -1
- package/dist/modes/interactive/plan-command.d.ts +1 -1
- package/dist/modes/interactive/plan-command.js +1 -1
- package/dist/modes/interactive/plan-dialog.d.ts +1 -1
- package/dist/modes/interactive/plan-dialog.js +1 -1
- package/dist/modes/interactive/plan-flow.d.ts +1 -1
- package/dist/modes/interactive/plan-flow.js +1 -1
- package/dist/modes/interactive/subagent-view.d.ts +1 -1
- package/dist/modes/interactive/subagent-view.js +1 -1
- package/dist/modes/interactive/task-background.d.ts +1 -1
- package/dist/modes/interactive/task-background.js +1 -1
- package/dist/modes/interactive/trace-view.d.ts +1 -1
- package/dist/modes/interactive/trace-view.js +1 -1
- package/dist/modes/print/json-event.d.ts +1 -1
- package/dist/modes/print/json-event.js +2 -2
- package/dist/modes/print/print-mode.d.ts +1 -1
- package/dist/modes/print/print-mode.js +1 -1
- package/dist/modes/print/search-hint.d.ts +1 -1
- package/dist/modes/print/search-hint.js +1 -1
- package/dist/modes/rpc/commands.js +2 -2
- package/dist/permissions/auto-safe.d.ts +1 -1
- package/dist/permissions/auto-safe.js +1 -1
- package/dist/permissions/bypass.d.ts +1 -1
- package/dist/permissions/bypass.js +1 -1
- package/dist/permissions/classifier.d.ts +1 -1
- package/dist/permissions/classifier.js +1 -1
- package/dist/permissions/memory-class.d.ts +1 -1
- package/dist/permissions/memory-class.js +1 -1
- package/dist/permissions/pipeline.d.ts +2 -2
- package/dist/permissions/pipeline.js +2 -2
- package/dist/permissions/protected.d.ts +1 -1
- package/dist/permissions/protected.js +1 -1
- package/dist/permissions/readonly-bash.d.ts +1 -1
- package/dist/permissions/readonly-bash.js +1 -1
- package/dist/permissions/types.d.ts +2 -2
- package/dist/plan/done-markers.d.ts +1 -1
- package/dist/plan/done-markers.js +1 -1
- package/dist/plan/extract.d.ts +1 -1
- package/dist/plan/extract.js +1 -1
- package/dist/plan/prompts.d.ts +1 -1
- package/dist/plan/prompts.js +1 -1
- package/dist/plan/store.d.ts +1 -1
- package/dist/plan/store.js +1 -1
- package/dist/rpc.d.ts +3 -3
- package/dist/rpc.js +3 -3
- package/dist/sandbox/bash.d.ts +1 -1
- package/dist/sandbox/bash.js +1 -1
- package/dist/sandbox/detect.d.ts +1 -1
- package/dist/sandbox/detect.js +1 -1
- package/dist/sandbox/index.d.ts +1 -1
- package/dist/sandbox/index.js +1 -1
- package/dist/sandbox/profile.d.ts +1 -1
- package/dist/sandbox/profile.js +1 -1
- package/dist/sandbox/wrap.d.ts +1 -1
- package/dist/sandbox/wrap.js +1 -1
- package/dist/sdk.d.ts +3 -3
- package/dist/sdk.js +2 -2
- package/dist/session/line-reader.d.ts +1 -1
- package/dist/session/line-reader.js +1 -1
- package/dist/session/list.d.ts +1 -1
- package/dist/session/list.js +1 -1
- package/dist/session/migrate.d.ts +1 -1
- package/dist/session/migrate.js +1 -1
- package/dist/session/store.d.ts +1 -1
- package/dist/session/store.js +1 -1
- package/dist/skills/builtin.js +2 -2
- package/dist/tools/background-jobs.d.ts +1 -1
- package/dist/tools/background-jobs.js +1 -1
- package/dist/tools/clipboard-image.d.ts +1 -1
- package/dist/tools/clipboard-image.js +1 -1
- package/dist/tools/edit.d.ts +1 -1
- package/dist/tools/edit.js +1 -1
- package/dist/tools/grep.d.ts +1 -1
- package/dist/tools/grep.js +1 -1
- package/dist/tools/image-resize.d.ts +1 -1
- package/dist/tools/image-resize.js +1 -1
- package/dist/tools/read-lines.d.ts +1 -1
- package/dist/tools/read-lines.js +1 -1
- package/dist/tools/read.d.ts +1 -1
- package/dist/tools/read.js +1 -1
- package/dist/tools/task-ctl.d.ts +1 -1
- package/dist/tools/task-ctl.js +1 -1
- package/dist/tools/task.d.ts +2 -2
- package/dist/tools/task.js +2 -2
- package/dist/tools/types.d.ts +3 -3
- package/dist/tools/types.js +1 -1
- package/dist/trace/build.d.ts +1 -1
- package/dist/trace/build.js +1 -1
- package/dist/trace/detail.d.ts +1 -1
- package/dist/trace/detail.js +1 -1
- package/dist/trace/flatten.d.ts +1 -1
- package/dist/trace/flatten.js +1 -1
- package/dist/trace/format.d.ts +1 -1
- package/dist/trace/format.js +1 -1
- package/dist/trace/html-template.d.ts +1 -1
- package/dist/trace/html-template.js +1 -1
- package/dist/trace/html.d.ts +1 -1
- package/dist/trace/html.js +1 -1
- package/dist/trace/query-session.d.ts +1 -1
- package/dist/trace/query-session.js +1 -1
- package/dist/trace/query.d.ts +1 -1
- package/dist/trace/query.js +1 -1
- package/dist/trace/types.d.ts +1 -1
- package/dist/trace/types.js +1 -1
- package/dist/tui/components/settings-list.d.ts +1 -1
- package/dist/tui/components/settings-list.js +1 -1
- package/docs/README.md +85 -0
- package/docs/assets/ama-wordmark-dark.svg +37 -0
- package/docs/assets/ama-wordmark-light.svg +37 -0
- package/docs/en/README.md +39 -0
- package/docs/en/{permissions.md → guides/permissions.md} +14 -14
- package/docs/en/{providers.md → guides/providers.md} +6 -6
- package/docs/en/{sessions.md → guides/sessions.md} +6 -6
- package/docs/en/{tui.md → guides/tui.md} +15 -15
- package/docs/en/{acp.md → reference/acp.md} +6 -6
- package/docs/en/{host-api.md → reference/host-api.md} +7 -7
- package/docs/en/{rpc.md → reference/rpc.md} +13 -13
- package/docs/{agents.md → guides/agents.md} +13 -13
- package/docs/{codemode.md → guides/codemode.md} +3 -3
- package/docs/{hooks.md → guides/hooks.md} +2 -2
- package/docs/guides/i18n.md +93 -0
- package/docs/{memory.md → guides/memory.md} +1 -1
- package/docs/{permissions.md → guides/permissions.md} +2 -2
- package/docs/{plan.md → guides/plan.md} +4 -4
- package/docs/{providers.md → guides/providers.md} +4 -4
- package/docs/{sessions.md → guides/sessions.md} +5 -5
- package/docs/{tui.md → guides/tui.md} +8 -8
- package/docs/{acp.md → reference/acp.md} +5 -5
- package/docs/{host-api.md → reference/host-api.md} +4 -4
- package/docs/{rpc.md → reference/rpc.md} +11 -11
- package/docs/{session-format.md → reference/session-format.md} +7 -7
- package/package.json +12 -23
- package/docs/rewind-plan.md +0 -181
- package/docs/tui-design.md +0 -764
- /package/docs/{sandbox.md → guides/sandbox.md} +0 -0
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
# Terminal UI
|
|
2
2
|
|
|
3
|
-
English · [简体中文](
|
|
3
|
+
English · [简体中文](../../guides/tui.md)
|
|
4
4
|
|
|
5
|
-
> Translated from the Chinese [docs/tui.md](
|
|
5
|
+
> Translated from the Chinese [docs/guides/tui.md](../../guides/tui.md) as of commit `4b85f89`. When the two differ, the Chinese version is
|
|
6
6
|
> authoritative. Screens below are illustrative; the exact interface wording follows the interface language
|
|
7
7
|
> (`ui.language`, `--lang`, `AMA_LANG`).
|
|
8
8
|
|
|
9
|
-
How to use interactive mode, plus the API of the terminal component library `@armadra/agent/tui`. The design rationale is in [design.md](
|
|
9
|
+
How to use interactive mode, plus the API of the terminal component library `@armadra/agent/tui`. The design rationale is in [design.md](../../design/design.md) §12 (Chinese).
|
|
10
10
|
|
|
11
11
|
Running `ama` directly in a terminal (stdin / stdout both TTYs, `TERM` not `dumb`, no `--no-tui`) enters interactive mode. The interface uses the **main screen** only: the conversation history scrolls into the terminal scrollback without switching to the alternate screen, so `capture-pane` in tmux can read the whole conversation, and it stays on screen after exit.
|
|
12
12
|
|
|
13
13
|
## Layout
|
|
14
14
|
|
|
15
|
-
The visual spec (colors, glyphs, screen-by-screen mockups) is in [tui-design.md](
|
|
15
|
+
The visual spec (colors, glyphs, screen-by-screen mockups) is in [tui-design.md](../../design/tui-design.md) (Chinese). Hierarchy is expressed by indentation: column 0 holds the user `›`, the tool `⏺` and notice symbols, column 2 the result connector `⎿`, column 4 the tool output; the structure stays readable without colors (`NO_COLOR`, `capture-pane` without `-e`).
|
|
16
16
|
|
|
17
17
|
```
|
|
18
18
|
▄███▄ ██▄ ▄██ ▄███▄ ama 0.6.2 ← startup header (normal)
|
|
@@ -57,7 +57,7 @@ Accept edits | shift+tab to cycle claude-opus-5-5 medium | Ctx 3.0% 8.2k/272k
|
|
|
57
57
|
- **`compact`**: one line; on the right model · thinking level · `↑ ↓` · cache · cost · re-billing · context usage · dir ⎇ branch commit +a −b · session duration · queue count · codemode · preset · host status · a short subscription quota item (`5h 10% wk 31%`, only with quota data; no `·` inside the item); when narrow, these drop in order: the quota item, the switch hint, host status, preset, re-billing, cost, cache, tokens, thinking level, queue count, codemode, line changes, directory name, branch and commit, duration, context, model.
|
|
58
58
|
- **git**: branch and short commit are read directly from `.git/HEAD` (worktrees understood; detached shows only the short commit; outside git the whole part is omitted, leaving only the directory name). `+a −b` is the working tree (staged included) line diff against HEAD, computed in the background with `git diff --numstat HEAD` after a turn ends, a writing tool finishes, a rewind or `/tree`, at most once every 10 seconds; if it takes longer than 2 seconds or fails, line changes are hidden for the rest of the session; `AMA_STATUS_GIT=0` turns it off. In `full`, `↑N` / `↓N` count the commits the current branch is ahead of / behind its upstream: when the branch has an upstream in the git config (`branch.<name>.merge`), the same throttled cycle then runs `git rev-list --left-right --count @{upstream}...HEAD` (same 2-second timeout; after a timeout it stops for the session); zero, no upstream or detached shows nothing; ASCII uses `^N` / `vN`.
|
|
59
59
|
- **Cost** includes sub-tasks, warming, the classifier and external agent usage priced in USD (other units only in `/session`); **duration** counts from when this process opened the current session (`Ns` / `Nm` / `NhMm`).
|
|
60
|
-
- When bash commands run in the OS sandbox (`sandbox.bash: "auto"` and available on this machine, see [sandbox.md](
|
|
60
|
+
- When bash commands run in the OS sandbox (`sandbox.bash: "auto"` and available on this machine, see [sandbox.md](../../guides/sandbox.md), Chinese), the usage items gain a sandbox marker, dropped first together with codemode when space runs out.
|
|
61
61
|
- During a model fallback (`fallbackModel`: when the main model is overloaded or retries are exhausted, one retry with the fallback model) the `compact` model item shows `main model → fallback model` (the fallback in yellow), while `full` keeps only the main model there and shows `→ fallback model` on the left of the rate line; it disappears once the fallback model replies and the main model is restored, and the message area gets an explanatory line.
|
|
62
62
|
- **Context refresh**: it updates right after a message is submitted (the new message counted as an estimate); while streaming, once the reply carries usage (some protocols report input tokens at the start) it switches to the measured value of the in-flight request, at most twice a second; after the reply ends, a compaction or a model change it goes back to the session stats.
|
|
63
63
|
- Model names abbreviate with width (provider dropped below 100 columns, channel below 60, version suffix below 48); `compact` at ≥ 110 columns shows context as a meter `ctx ▮▮▮▯▯▯▯▯▯▯ 34%`, keeping one decimal below 1% (`ctx ≈0.4%` rather than 0%), with the same `≈` for estimates; changing numbers reserve their widest shape, so items never flicker in and out as values change. In ASCII mode `⎇` → `git`, `−` → `-`, `♨` → `~`, `↻` → `@`.
|
|
@@ -154,11 +154,11 @@ While running, Enter **queues** by default (steer): the message waits for the ne
|
|
|
154
154
|
|
|
155
155
|
Why `Ctrl+X` by default: macOS Terminal, iTerm2, tmux and Windows Terminal all pass it through and nothing else is bound to it; `Ctrl+Enter` is indistinguishable from Enter without the kitty keyboard protocol, `Ctrl+S` may be swallowed by XOFF flow control, `Alt+Enter` is already followUp, `Alt+letter` sends no Meta by default on macOS, and `Ctrl+]` is awkward on non-US layouts. Rebind it in `keybindings.json`.
|
|
156
156
|
|
|
157
|
-
In line mode (`--no-tui`), typing `/interrupt <text>` while running does the same (when idle it is an ordinary prompt); the TUI accepts the command too. Over RPC it is `interrupt: true` on `prompt` / `steer`, see [rpc.md](rpc.md).
|
|
157
|
+
In line mode (`--no-tui`), typing `/interrupt <text>` while running does the same (when idle it is an ordinary prompt); the TUI accepts the command too. Over RPC it is `interrupt: true` on `prompt` / `steer`, see [rpc.md](../reference/rpc.md).
|
|
158
158
|
|
|
159
159
|
## Rewind
|
|
160
160
|
|
|
161
|
-
Design in [rewind-plan.md](
|
|
161
|
+
Design in [rewind-plan.md](../../history/rewind-plan.md) (Chinese). Every user message that starts a new turn is a rewind point; files changed by edit / write have a checkpoint before the message is sent (`checkpoints.mode`; bash changes are only picked up when the next turn re-snapshots tracked files).
|
|
162
162
|
|
|
163
163
|
- **Entry**: `/rewind`, or double Esc while idle with an empty input box: the first press shows a hint at the bottom to press Esc again to rewind (gone after 1 second), and a second press within 800 ms opens the list. With text in the input box, double Esc clears it instead (with a matching hint), and the text goes into input history, recallable with ↑. While running, Esc still interrupts; when an approval dialog or a picker is open, Esc belongs to them.
|
|
164
164
|
- **Interrupt to withdraw**: when Esc interrupts a run and this turn has no reply text or tool call yet and the input box is empty (`ui.restoreOnCancel`, default true), the message is withdrawn automatically and the original text put back into the input box, with a line in the message area saying the interrupted message was withdrawn.
|
|
@@ -326,11 +326,11 @@ After the input summary comes the **pre-execution preview**: what this step will
|
|
|
326
326
|
- write: whether the target exists, its current line count and size → the new content; overwriting a file not read in this session is marked yellow.
|
|
327
327
|
- edit: a dry run against the original, listing −n/+m lines per change and the total; when a match fails or is not unique, this is said up front.
|
|
328
328
|
|
|
329
|
-
The preview is colored by severity (danger red, warning yellow, the rest dim), read-only and bounded: at most 2000 entries counted per directory and a 200 ms budget for the whole preview; beyond that it only gives a hint without lowering severity; files over 2 MiB only report their size. A failed preview does not affect the approval. Line mode prints the same preview line by line before the question; RPC clients get it from `permission_request.preview` ([rpc.md](rpc.md) "Approvals").
|
|
329
|
+
The preview is colored by severity (danger red, warning yellow, the rest dim), read-only and bounded: at most 2000 entries counted per directory and a 200 ms budget for the whole preview; beyond that it only gives a hint without lowering severity; files over 2 MiB only report their size. A failed preview does not affect the approval. Line mode prints the same preview line by line before the question; RPC clients get it from `permission_request.preview` ([rpc.md](../reference/rpc.md) "Approvals").
|
|
330
330
|
|
|
331
331
|
## Plan approval
|
|
332
332
|
|
|
333
|
-
In Plan mode (Shift+Tab, `/permission plan`, `/plan <goal>`, `--permission-mode plan`) the model researches read-only and ends with a `<proposed_plan>` block (rules in [plan.md](
|
|
333
|
+
In Plan mode (Shift+Tab, `/permission plan`, `/plan <goal>`, `--permission-mode plan`) the model researches read-only and ends with a `<proposed_plan>` block (rules in [plan.md](../../guides/plan.md), Chinese). When the turn ends and the session is idle, an approval box pops up at the bottom:
|
|
334
334
|
|
|
335
335
|
```
|
|
336
336
|
╭─ Plan awaiting approval ─────────────────────────────────────────────────────╮
|
|
@@ -359,7 +359,7 @@ In Plan mode (Shift+Tab, `/permission plan`, `/plan <goal>`, `--permission-mode
|
|
|
359
359
|
|
|
360
360
|
## Sub-agents
|
|
361
361
|
|
|
362
|
-
Sub-agents started by the `task` tool ([agents.md](
|
|
362
|
+
Sub-agents started by the `task` tool ([agents.md](../../guides/agents.md), Chinese) fold into a task tool line in the message area, with one status line while running:
|
|
363
363
|
|
|
364
364
|
```
|
|
365
365
|
⏺ task check test coverage gaps in src/tui
|
|
@@ -372,7 +372,7 @@ Sub-agents started by the `task` tool ([agents.md](../agents.md), Chinese) fold
|
|
|
372
372
|
↳ t3 explore · running 30s · 2 turns · grep
|
|
373
373
|
```
|
|
374
374
|
|
|
375
|
-
- The status line shows the type (external agents show a runner such as `claude (claude)`), status and elapsed time, turns, the latest 3 tools and usage; after a foreground task ends it is replaced by the result summary. A background task's tool call (background is the default in the interactive UI, see [agents.md](
|
|
375
|
+
- The status line shows the type (external agents show a runner such as `claude (claude)`), status and elapsed time, turns, the latest 3 tools and usage; after a foreground task ends it is replaced by the result summary. A background task's tool call (background is the default in the interactive UI, see [agents.md](../../guides/agents.md) "foreground and background", Chinese) returns immediately; the summary line says "started in the background", with an extra follow-up status line below (refreshed every second while running). A foreground task moved to the background shows "moved to the background · elapsed" with the same follow-up line (the explanation meant for the model is hidden; `Ctrl+O` shows it). A task moved by the auto timeout (`subagents.autoBackgroundAfterMs`) or by the host also gets a one-line notice; when it completes, the `<task-notification>` the model receives shows in the message area as a single line (e.g. "↳ sub-agent notification: t2 explore done · 7 turns · see /tasks for output"), plus a yellow notice on failure or stop.
|
|
376
376
|
- `/tasks`: focus the agent bar (below); `/tasks <id>` opens that task's sub-agent view directly; `/tasks stop <id>` stops it; `/tasks bg [id]` moves it to the background (without an id: every blocking foreground task, same as `Ctrl+B`). With `ui.agentBar: "off"` `/tasks` is still the task picker (newest on top, Enter shows the output, running tasks can be stopped). Line mode: `/tasks` lists, `/tasks <id>` shows output, `/tasks stop <id>` stops, `/tasks bg [id]` moves to the background (typed while running it is still a command, not a steer).
|
|
377
377
|
- Moving to the background (`Ctrl+B`, key action `app.tasks.background`): while the main turn waits for a foreground task (`task` with `background: false`, the `-p` default, or `task_ctl wait`), press it and the tool call returns at once, the task keeps running, the main turn carries on and you can keep sending messages; when the task ends the `<task-notification>` arrives and opens a turn as usual. The hint says "Moved to the background: t2; you'll be notified when it finishes". With nothing to move, `Ctrl+B` falls through to the editor (cursor left) and is not swallowed. tmux's default prefix is `C-b`: in tmux press `C-b C-b` (default `send-prefix`) to pass it to ama, or press `b` in the agent bar; you can also rebind it in `keybindings.json`.
|
|
378
378
|
- Esc interrupts only the foreground: Esc while running stops the main turn and the sub-tasks still in the foreground; tasks already in the background keep running, and the hint says "Interrupted (background task t2 keeps running; Esc doesn't affect it)".
|
|
@@ -396,7 +396,7 @@ Above the status line (below the hint line) the bar lists sub-agent tasks, one l
|
|
|
396
396
|
- When the key does not get you in, a one-line hint shows for 3 seconds: text in the input box — "Input is not empty; clear it and press ↓ for the Agent bar" (once per draft, with the cursor on the last line; `↓` still moves down); the bar is off — "Agent bar is off (ui.agentBar); use /tasks"; no tasks — "No sub-agent tasks yet". While browsing input history with `↑` `↓`, `↓` only steps through history.
|
|
397
397
|
- `Ctrl+B` does not enter the bar; it moves foreground tasks to the background (above). For the old "`Ctrl+B` enters the bar", set `"app.agents.focus": ["down", "ctrl+b"]` in `keybindings.json` and rebind `app.tasks.background`.
|
|
398
398
|
- In the bar: `↑` `↓` select (lists every task of the session, the window scrolls along; `↑` on the first item returns to the input box), Enter opens the sub-agent view (a docked approval of the selected task pops up right away), `b` / `Ctrl+B` moves the selected foreground task to the background (a one-line hint when it is not running in the foreground), `x` stops the selected task (the first press hints "Press x again to stop t2"; it stops only on a second press within 1.5 seconds), Esc returns to the input box; other letters return to the input box with the text filled in. The last line is the key hint `↑↓ select · Enter open · b background · x stop · Esc back`; narrow screens drop the `b` / `x` items.
|
|
399
|
-
- Embedding hosts (with a profile) no longer turn the bar off by default; a host that shows sub-tasks itself and does not want the bar sets `ui.agentBar: "off"` in its profile (see [host-api.md](host-api.md) "Embedding in Armadra"). With the bar off it is not shown, and `↓` with tasks points to `/tasks`.
|
|
399
|
+
- Embedding hosts (with a profile) no longer turn the bar off by default; a host that shows sub-tasks itself and does not want the bar sets `ui.agentBar: "off"` in its profile (see [host-api.md](../reference/host-api.md) "Embedding in Armadra"). With the bar off it is not shown, and `↓` with tasks points to `/tasks`.
|
|
400
400
|
|
|
401
401
|
### Sub-agent view
|
|
402
402
|
|
|
@@ -416,7 +416,7 @@ t2 explore · running 1m05s · 3 turns · ↑12k ↓3.4k · Esc back · /tasks s
|
|
|
416
416
|
|
|
417
417
|
- The body follows live: for ama sub-agents it shows every message and tool call of the sub-session (rendered like the message area); when the sub-session handle has been released (at most 16 are kept) or the session was resumed, the sub-session file is loaded read-only and live events are attached when the task runs again. External agents (claude / codex / ACP) show the live output held in this process's memory (text, thinking, tool start / end, turns, notices; at most 2000 items / 1 MB, never written to disk); after ama restarts only one line remains, saying to use the original CLI's resume <session id> for the full text.
|
|
418
418
|
- With an empty input box: `↑` / PgUp scroll up (pausing follow, with "follow paused · End to resume" at the bottom), `↓` / PgDn scroll down, End (or `f` while paused) resumes following; `←` `→` switch to the previous / next task; Esc returns to the main screen. With text in the input box, Esc clears it first.
|
|
419
|
-
- Enter sends the input to this sub-agent (recorded in the sub-session as a user message with `origin: "direct"`, see [session-format.md](
|
|
419
|
+
- Enter sends the input to this sub-agent (recorded in the sub-session as a user message with `origin: "direct"`, see [session-format.md](../../reference/session-format.md), Chinese): ama sub-agent running → delivered when its current turn ends; external agent running or task still queued → continued after this run ends; finished → continued in the background (like `task_ctl send`; the main session receives the `<task-notification>` as usual when it completes). A line at the bottom reports the result. The parent session's model does not know you talked to the sub-agent directly; the result comes back through the completion notification.
|
|
420
420
|
- `Ctrl+X` interrupts this sub-agent and sends now: an ama sub-agent that is running stops its current turn (tools finish as interrupted) and starts a new turn with the message at once; the task completes and notifies the main session as usual. An external agent whose driver can interrupt a single turn (ACP `session/cancel`, Claude stream-json interrupt, Codex `turn/interrupt`) is interrupted and its next turn starts with the message (and any messages queued before it); when it cannot (oneshot, host drivers) or the task is still waiting in the concurrency pool, the message is queued instead with a hint; a finished task continues in the background as with Enter. Swapped with Enter under `ui.enterWhileRunning: "interrupt"`. The main session is not affected.
|
|
421
421
|
- Esc in the view interrupts nothing: it only goes back. To stop the task use `/tasks stop <id>`; to move it to the background use `Ctrl+B` or `/tasks bg [id]`. Both work in the view's input box (the only commands the view accepts).
|
|
422
422
|
- When the viewed task waits for approval the title says "awaiting approval", and the approval dialog pops up over the view as usual (with the `[task:<type>]` origin); if its approval is docked in the bar, opening the view pops it up.
|
|
@@ -466,11 +466,11 @@ Trace · 1 turn · 2 requests · 3 tool calls · 12s · ↑8.1k ↓240 · cache
|
|
|
466
466
|
- Auxiliary requests such as warming and permission classification are grouped at the end under "N auxiliary requests", collapsed by default.
|
|
467
467
|
- In line mode (`--ui line`, pipes) `/trace [task id]` prints the same tree as text (fully expanded, no bars).
|
|
468
468
|
|
|
469
|
-
Timing comes from `custom{customType:"ama.trace"}` entries in the session file ([session-format.md](
|
|
469
|
+
Timing comes from `custom{customType:"ama.trace"}` entries in the session file ([session-format.md](../../reference/session-format.md), Chinese), which hold only ids, times and counts; previews of prompts, arguments and results are read from session entries on demand and never enter the trace itself. The HTML export `ama sessions trace` and RPC `get_trace` are described in [sessions.md](sessions.md) and [rpc.md](../reference/rpc.md).
|
|
470
470
|
|
|
471
471
|
## Memory
|
|
472
472
|
|
|
473
|
-
Requires memory to be enabled (`ama memory enable` or `--memory`, see [memory.md](
|
|
473
|
+
Requires memory to be enabled (`ama memory enable` or `--memory`, see [memory.md](../../guides/memory.md), Chinese). `/memory` draws a card in the message area: one section per scope (`user /memories/user/ · N entries · index X / 4.0 KiB`), one line per entry "name — description updated date", entries not updated for over 90 days greyed out; when the index exceeds its limit a yellow line says how many entries did not make it into the system prompt; an untrusted project and writes disabled for this session each add a line at the bottom of the card.
|
|
474
474
|
|
|
475
475
|
`/memory show <name>` renders the body as a card; `/memory edit [name|scope]` suspends the interface and opens `$VISUAL` / `$EDITOR` (on a temporary copy, saved back and the index rebuilt after you save and quit, with the same credential and size checks as model writes); `/memory rm <name>` asks for confirmation (default "Cancel", `y` deletes, `n` / Esc cancels); `/memory on|off` toggles writes for this session; `/memory reload` re-renders the system prompt's `memory` section (breaking the cache once). Line mode has the same commands with text output; `edit` uses `ama memory edit` instead and `rm` needs `--yes`. When memory is not enabled for the session it only explains how to enable it.
|
|
476
476
|
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
# ACP (Agent Client Protocol)
|
|
2
2
|
|
|
3
|
-
English · [简体中文](
|
|
3
|
+
English · [简体中文](../../reference/acp.md)
|
|
4
4
|
|
|
5
|
-
> Translated from the Chinese [docs/acp.md](
|
|
5
|
+
> Translated from the Chinese [docs/reference/acp.md](../../reference/acp.md) as of commit `f6419be`. When the two differ, the Chinese version is
|
|
6
6
|
> authoritative.
|
|
7
7
|
|
|
8
8
|
ama works on both sides of ACP:
|
|
9
9
|
|
|
10
10
|
- **Agent**: `ama --mode acp` exposes ama as an ACP agent for Zed, JetBrains and Armadra's ACP nodes;
|
|
11
|
-
- **Client**: ama drives external agents over ACP (native ACP agents such as Gemini CLI, OpenCode, Kimi and Copilot, or Claude Code / Codex with an adapter installed); see [agents.md](
|
|
11
|
+
- **Client**: ama drives external agents over ACP (native ACP agents such as Gemini CLI, OpenCode, Kimi and Copilot, or Claude Code / Codex with an adapter installed); see [agents.md](../../guides/agents.md) (Chinese).
|
|
12
12
|
|
|
13
|
-
The protocol stack is hand-written with no dependencies and maintained in one place: `@armadra/agent/acp` exports the types, framing, client and fake agent, and Armadra reuses them directly. The design rationale is in [wave5-plan.md](
|
|
13
|
+
The protocol stack is hand-written with no dependencies and maintained in one place: `@armadra/agent/acp` exports the types, framing, client and fake agent, and Armadra reuses them directly. The design rationale is in [wave5-plan.md](../../history/wave5-plan.md) §5 (D14, Chinese).
|
|
14
14
|
|
|
15
15
|
## Wire
|
|
16
16
|
|
|
@@ -73,7 +73,7 @@ The full before / after text of a diff only travels with live events and is neve
|
|
|
73
73
|
|
|
74
74
|
### Approvals
|
|
75
75
|
|
|
76
|
-
Calls that ama needs to ask about go to the client as `session/request_permission` with three options: `allow_once` (Allow), `allow_always` (Allow for this session) and `reject_once` (Deny). `toolCall.toolCallId` refers to the id of an earlier `tool_call` — including calls inside codemode, which point at the inner `tool_call`, not the outer `codemode` one. While the question is open the call goes back to `pending`, then `in_progress` once allowed (so an approved call goes `pending → in_progress → pending → in_progress → completed`); a denied call goes straight to `failed`. When the client answers `cancelled`, the connection drops or the turn is interrupted, it counts as unanswered (denied). When ama no longer needs an answer (the turn was interrupted by `session/cancel` / `$/cancel_request`, or the 10-minute approval timeout passed), it withdraws the pending `session/request_permission` with `$/cancel_request { requestId }` so the client can close its dialog. In auto mode ama's own classifier still works — this only applies to ama's own tools; requests from external agents that ama drives go to a human only (see [agents.md](
|
|
76
|
+
Calls that ama needs to ask about go to the client as `session/request_permission` with three options: `allow_once` (Allow), `allow_always` (Allow for this session) and `reject_once` (Deny). `toolCall.toolCallId` refers to the id of an earlier `tool_call` — including calls inside codemode, which point at the inner `tool_call`, not the outer `codemode` one. While the question is open the call goes back to `pending`, then `in_progress` once allowed (so an approved call goes `pending → in_progress → pending → in_progress → completed`); a denied call goes straight to `failed`. When the client answers `cancelled`, the connection drops or the turn is interrupted, it counts as unanswered (denied). When ama no longer needs an answer (the turn was interrupted by `session/cancel` / `$/cancel_request`, or the 10-minute approval timeout passed), it withdraws the pending `session/request_permission` with `$/cancel_request { requestId }` so the client can close its dialog. In auto mode ama's own classifier still works — this only applies to ama's own tools; requests from external agents that ama drives go to a human only (see [agents.md](../../guides/agents.md), Chinese).
|
|
77
77
|
|
|
78
78
|
### Without a model
|
|
79
79
|
|
|
@@ -145,7 +145,7 @@ These are deliberate choices, not omissions:
|
|
|
145
145
|
|
|
146
146
|
## As a client
|
|
147
147
|
|
|
148
|
-
The model uses ACP agents through `task(agent="acp:<program>")` (ama itself is `task(agent="acp:ama")`; see "Using them in task" in [agents.md](
|
|
148
|
+
The model uses ACP agents through `task(agent="acp:<program>")` (ama itself is `task(agent="acp:ama")`; see "Using them in task" in [agents.md](../../guides/agents.md), Chinese).
|
|
149
149
|
|
|
150
150
|
`AcpClient` (`@armadra/agent/acp`): `initialize`, `newSession`, `resumeSession` (preferred, no replay), `loadSession`, `listSessions`, `closeSession`, `prompt`, `setMode`, `cancel`.
|
|
151
151
|
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
# Host adapter API (@armadra/agent/host)
|
|
2
2
|
|
|
3
|
-
English · [简体中文](
|
|
3
|
+
English · [简体中文](../../reference/host-api.md)
|
|
4
4
|
|
|
5
|
-
> Translated from the Chinese [docs/host-api.md](
|
|
5
|
+
> Translated from the Chinese [docs/reference/host-api.md](../../reference/host-api.md) as of commit `979608b`. When the two differ, the Chinese
|
|
6
6
|
> version is authoritative.
|
|
7
7
|
|
|
8
|
-
A host adapter is a local JS module that ama loads at startup and hands a `HostApi`. With it the adapter can register tools, append to the system prompt, observe events, answer approvals, inject user messages and show notifications and status in the interface. The Armadra canvas plugs in as a host adapter (the canvas tools `canvas_*` / `context_*` are all registered by the adapter). The types are defined in `src/host/types.ts` and exported from `@armadra/agent/host`; `HOST_API_VERSION = 1`. The design rationale is in [design.md](
|
|
8
|
+
A host adapter is a local JS module that ama loads at startup and hands a `HostApi`. With it the adapter can register tools, append to the system prompt, observe events, answer approvals, inject user messages and show notifications and status in the interface. The Armadra canvas plugs in as a host adapter (the canvas tools `canvas_*` / `context_*` are all registered by the adapter). The types are defined in `src/host/types.ts` and exported from `@armadra/agent/host`; `HOST_API_VERSION = 1`. The design rationale is in [design.md](../../design/design.md) §6.2, §6.3 and §11.1 step 13 (Chinese).
|
|
9
9
|
|
|
10
10
|
## Module shape
|
|
11
11
|
|
|
@@ -100,7 +100,7 @@ interface ToolResult {
|
|
|
100
100
|
}
|
|
101
101
|
```
|
|
102
102
|
|
|
103
|
-
`ToolContext` provides `toolCallId`, `cwd`, `sessionId`, `sessionFile?`, `signal`, `depth`, `model?`, `thinkingLevel?`, `outputDir?`, `onUpdate(partial)` (output while running), `readFiles` / `markRead`, `activeTools?` (read-only snapshot of the session's active tool set, so tools can give actionable hints), `tools.executeTool(name, input)` (nested calls through the same pipeline), `session.appendCustom` / `lastCustom` (custom entries that never enter the context, see [session-format.md](
|
|
103
|
+
`ToolContext` provides `toolCallId`, `cwd`, `sessionId`, `sessionFile?`, `signal`, `depth`, `model?`, `thinkingLevel?`, `outputDir?`, `onUpdate(partial)` (output while running), `readFiles` / `markRead`, `activeTools?` (read-only snapshot of the session's active tool set, so tools can give actionable hints), `tools.executeTool(name, input)` (nested calls through the same pipeline), `session.appendCustom` / `lastCustom` (custom entries that never enter the context, see [session-format.md](../../reference/session-format.md), Chinese), `spawnSubagent?` and `log`.
|
|
104
104
|
|
|
105
105
|
Host tools take the same path as built-in tools: schema validation → command hook PreToolUse → permission pipeline (classified by `permission`) → approval → execution → PostToolUse. They can also be called from codemode scripts as `tools.<name>()`.
|
|
106
106
|
|
|
@@ -137,7 +137,7 @@ For token-level streaming content or the full event stream, use RPC or the SDK's
|
|
|
137
137
|
- `request`: `requestId`, `toolName`, `input`, `reason: "mode" | "dangerous" | "hook"`, `hookReason?`, `preview?` (the pre-execution preview, see [rpc.md](rpc.md) "Approvals"), `context?` (`depth > 0` means it comes from a `task` sub-agent; codemode inner calls carry `parentToolCallId`).
|
|
138
138
|
- On timeout (10 minutes by default, `AMA_APPROVAL_TIMEOUT_MS`) or when the run is interrupted, `signal` aborts and the decision is deny. Approvals are serial: only one request waits at a time.
|
|
139
139
|
- Timing: the broker is looked up at each approval, so it can be set in `create()` or set / replaced at any later time; the last `setBroker` wins.
|
|
140
|
-
- The host broker only decides "who answers an ask"; it cannot loosen deny rules, command hook denies or dangerous-command detection ([design.md](
|
|
140
|
+
- The host broker only decides "who answers an ask"; it cannot loosen deny rules, command hook denies or dangerous-command detection ([design.md](../../design/design.md) §6.3, Chinese).
|
|
141
141
|
|
|
142
142
|
## Cache warming
|
|
143
143
|
|
|
@@ -155,7 +155,7 @@ interface WarmDecision {
|
|
|
155
155
|
}
|
|
156
156
|
```
|
|
157
157
|
|
|
158
|
-
Return `"warm"` / `"stop"` (a Promise is fine). `"stop"` skips the request and stops this warming round (when the built-in decision was warm, the stop reason is recorded as `declined`); `"warm"` can override a built-in stop. If the handler fails, the built-in decision applies. With several handlers, the last one registered and not unsubscribed wins; the return value is an unsubscribe function. The warming mechanism itself is described in [providers.md](providers.md) "Caching".
|
|
158
|
+
Return `"warm"` / `"stop"` (a Promise is fine). `"stop"` skips the request and stops this warming round (when the built-in decision was warm, the stop reason is recorded as `declined`); `"warm"` can override a built-in stop. If the handler fails, the built-in decision applies. With several handlers, the last one registered and not unsubscribed wins; the return value is an unsubscribe function. The warming mechanism itself is described in [providers.md](../guides/providers.md) "Caching".
|
|
159
159
|
|
|
160
160
|
## Exit
|
|
161
161
|
|
|
@@ -168,4 +168,4 @@ Armadra starts ama with a profile: `ama --profile <path>`. The profile's `host`
|
|
|
168
168
|
|
|
169
169
|
Interface defaults with a profile: `ui.quietStartup: "header"` and `ui.statusLine: "compact"` (the last line is the status bar, which the host parses by `·`). The agent bar (`ui.agentBar`) is no longer off by default; it is `auto` as in a standalone terminal. A host that shows sub-tasks itself and does not want the bar writes `{ "ui": { "agentBar": "off" } }` into the config file its profile's `config` points to.
|
|
170
170
|
|
|
171
|
-
Contract details are in [docs/design/coordinator-agent.md](https://github.com/
|
|
171
|
+
Contract details are in [docs/design/coordinator-agent.md](https://github.com/AMA-Link/Armadra/blob/main/docs/design/coordinator-agent.md) in the Armadra repository.
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
# RPC protocol (stdio JSONL)
|
|
2
2
|
|
|
3
|
-
English · [简体中文](
|
|
3
|
+
English · [简体中文](../../reference/rpc.md)
|
|
4
4
|
|
|
5
|
-
> Translated from the Chinese [docs/rpc.md](
|
|
5
|
+
> Translated from the Chinese [docs/reference/rpc.md](../../reference/rpc.md) as of commit `a567833`. When the two differ, the Chinese version is
|
|
6
6
|
> authoritative.
|
|
7
7
|
|
|
8
|
-
`ama --mode rpc` reads commands from stdin and writes responses and events to stdout, one JSON value per line. The types are defined in `@armadra/agent/rpc` (`src/rpc.ts`) and implemented in `src/modes/rpc/`. The events printed by `ama -p --output-format stream-json` have the same shapes. The design rationale is in [design.md](
|
|
8
|
+
`ama --mode rpc` reads commands from stdin and writes responses and events to stdout, one JSON value per line. The types are defined in `@armadra/agent/rpc` (`src/rpc.ts`) and implemented in `src/modes/rpc/`. The events printed by `ama -p --output-format stream-json` have the same shapes. The design rationale is in [design.md](../../design/design.md) §13.2 (Chinese).
|
|
9
9
|
|
|
10
10
|
## Wire
|
|
11
11
|
|
|
@@ -35,7 +35,7 @@ A command has the shape `{ "id"?: string, "type": <command name>, ...parameters
|
|
|
35
35
|
|
|
36
36
|
- A response carries the request's `id` back (only string ids). Commands are processed concurrently: `prompt` does not block later commands, so responses may arrive in a different order than requests; match them by `id`.
|
|
37
37
|
- On failure `error` is human-readable text and `code` is the `AmaError.code` (when there is one). Unknown commands → `code: "invalid_arguments"`.
|
|
38
|
-
**Hosts must decide by `code` and never parse `error` / `message`**: human-readable text follows the interface language (`AMA_LANG`, `--lang`, `ui.language`; bilingual since wave 6, see [i18n.md](
|
|
38
|
+
**Hosts must decide by `code` and never parse `error` / `message`**: human-readable text follows the interface language (`AMA_LANG`, `--lang`, `ui.language`; bilingual since wave 6, see [i18n.md](../../guides/i18n.md), Chinese). The same holds for the `message` of `notification` events.
|
|
39
39
|
- A line that is not valid JSON or lacks `type` → `{ "type": "response", "command": "parse", "success": false, "error": … }`, without `id`.
|
|
40
40
|
- Commands that need extension methods of the session implementation (marked † below) return `code: "not_implemented"` on sessions that are not `AgentSessionImpl`; sessions created by the CLI and the SDK are all `AgentSessionImpl`.
|
|
41
41
|
|
|
@@ -100,7 +100,7 @@ Prompt commands **do not wait for the run to finish**: they are answered as soon
|
|
|
100
100
|
|
|
101
101
|
### Rewind
|
|
102
102
|
|
|
103
|
-
Details in [rewind-plan.md](
|
|
103
|
+
Details in [rewind-plan.md](../../history/rewind-plan.md) §3 (Chinese). Rewind points are the user messages on the active path that start new turns (steers and queued messages belong to the current turn and are not listed). Calling while running returns `busy`.
|
|
104
104
|
|
|
105
105
|
| Command | Parameters | `data` |
|
|
106
106
|
| ------------------- | --------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
@@ -111,7 +111,7 @@ Details in [rewind-plan.md](../rewind-plan.md) §3 (Chinese). Rewind points are
|
|
|
111
111
|
|
|
112
112
|
`CodeRestoreResult`: `restored` / `deleted` / `conflicts` (left untouched with `skip`, overwritten with `overwrite`) / `skipped: { path, reason }[]` (`symlink` / `hardlink` / `not_regular` / `parent_moved` / `too_large` / `backup_missing`) / `failed: { path, message }[]` / `insertions` / `deletions`; paths inside cwd are relative (`/`-separated). Error codes: restoring code without a checkpoint → `no_checkpoint`; everything failed and nothing was restored → `rewind_failed` (the conversation is left alone); the entry is not a rewind point on the active path → `invalid_arguments`. For conversation-only or code-only rewinds, a `custom_message{customType: "ama.rewind-note"}` is appended to the end of the context before the next prompt, telling the model which files disagree with the conversation.
|
|
113
113
|
|
|
114
|
-
After a session switch the server re-subscribes to events and sends `session_start` for the new session (`reason` `new` / `resume` / `fork`). `new_session` does not use the `parentSession` parameter yet. Entry shapes are in [session-format.md](
|
|
114
|
+
After a session switch the server re-subscribes to events and sends `session_start` for the new session (`reason` `new` / `resume` / `fork`). `new_session` does not use the `parentSession` parameter yet. Entry shapes are in [session-format.md](../../reference/session-format.md) (Chinese).
|
|
115
115
|
|
|
116
116
|
### Approvals
|
|
117
117
|
|
|
@@ -120,7 +120,7 @@ After a session switch the server re-subscribes to events and sends `session_sta
|
|
|
120
120
|
| `set_client_capabilities` | `capabilities: ("approvals" \| "images" \| "hooks" \| "plans" \| "compact_events")[]` | `{ capabilities }` |
|
|
121
121
|
| `permission_response` | `requestId: string`, `decision: "allow" \| "deny" \| "allow_session"` | `{ accepted: boolean }` (false = not currently waiting for this id; kept and applied when that request is asked) |
|
|
122
122
|
|
|
123
|
-
`compact_events` (docs/memory-plan.md D9, Chinese): once declared, `turn_end.toolResults`, `message_start` and `entry_appended` no longer repeat the body of tool results and of user messages with images (marked `contentOmitted: true`); the body is sent only in `message_end` and `tool_execution_end`. Without it the event shapes are byte-for-byte unchanged. Shapes are in [Compact events](#compact-events-compact_events). `stream-json` has no such switch and always emits the full shapes.
|
|
123
|
+
`compact_events` (docs/history/memory-plan.md D9, Chinese): once declared, `turn_end.toolResults`, `message_start` and `entry_appended` no longer repeat the body of tool results and of user messages with images (marked `contentOmitted: true`); the body is sent only in `message_end` and `tool_execution_end`. Without it the event shapes are byte-for-byte unchanged. Shapes are in [Compact events](#compact-events-compact_events). `stream-json` has no such switch and always emits the full shapes.
|
|
124
124
|
|
|
125
125
|
### Tools, permissions, discovery
|
|
126
126
|
|
|
@@ -144,7 +144,7 @@ After a session switch the server re-subscribes to events and sends `session_sta
|
|
|
144
144
|
|
|
145
145
|
### Traces (wave 6)
|
|
146
146
|
|
|
147
|
-
`get_trace` returns the session trace (the same tree as the TUI `/trace` and `ama sessions trace`, see [tui.md](tui.md)
|
|
147
|
+
`get_trace` returns the session trace (the same tree as the TUI `/trace` and `ama sessions trace`, see [tui.md](../guides/tui.md)
|
|
148
148
|
"Traces"). There is no new event: after `entry_appended`, fetch again with the previous `cursor.since` to refresh incrementally.
|
|
149
149
|
|
|
150
150
|
| Parameter | Meaning |
|
|
@@ -227,7 +227,7 @@ There is also the non-session event `{"type":"notification","level":"info"|"warn
|
|
|
227
227
|
|
|
228
228
|
`parentToolCallId` appears only on inner calls made through `tools.*` inside codemode scripts; its value is the id of the outer `codemode` call, which clients use to fold the display. Inner calls do not enter the transcript.
|
|
229
229
|
|
|
230
|
-
Assistant messages in `message_end`, `turn_end`, `done` / `error` and in replays (`get_messages`, `get_entries`) may carry two optional fields (model efficiency batch, docs/model-efficiency-plan.md §1.10, Chinese): `retryAfterMs` on failed messages (`Retry-After`, in ms) and `rawArguments` on tool-call blocks (the raw argument string the model produced). `subagent_*` events are unchanged; `TaskInfo` from `get_tasks` may carry `context?: "fork" | "fresh"` (the sub-session's actual context mode). All are new optional fields, `RPC_PROTOCOL_VERSION` is unchanged, and clients can ignore fields they do not know.
|
|
230
|
+
Assistant messages in `message_end`, `turn_end`, `done` / `error` and in replays (`get_messages`, `get_entries`) may carry two optional fields (model efficiency batch, docs/history/model-efficiency-plan.md §1.10, Chinese): `retryAfterMs` on failed messages (`Retry-After`, in ms) and `rawArguments` on tool-call blocks (the raw argument string the model produced). `subagent_*` events are unchanged; `TaskInfo` from `get_tasks` may carry `context?: "fork" | "fresh"` (the sub-session's actual context mode). All are new optional fields, `RPC_PROTOCOL_VERSION` is unchanged, and clients can ignore fields they do not know.
|
|
231
231
|
|
|
232
232
|
### Compact events (`compact_events`)
|
|
233
233
|
|
|
@@ -243,7 +243,7 @@ In the full shapes, the result of one tool call appears once each in `message_st
|
|
|
243
243
|
|
|
244
244
|
### Sub-agent events (wave 5)
|
|
245
245
|
|
|
246
|
-
Sub-agents started by `task` / `task_ctl` (ama sub-sessions and external agents share the same events, see [agents.md](
|
|
246
|
+
Sub-agents started by `task` / `task_ctl` (ama sub-sessions and external agents share the same events, see [agents.md](../../guides/agents.md), Chinese):
|
|
247
247
|
|
|
248
248
|
| Event | Fields |
|
|
249
249
|
| --------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
@@ -349,7 +349,7 @@ The `data` of `get_session_stats` is `SessionStats`:
|
|
|
349
349
|
{"type":"context_pressure","percent":71,"threshold":70,"remainingTokens":57990,"estimatedTurnsLeft":6}
|
|
350
350
|
```
|
|
351
351
|
|
|
352
|
-
`cache_miss` gives `detail` only for `prefix_changed` (`tools`, `system`, or `system:<section,…>` naming the changed sections, such as `system:hooks,memory`). The values and meanings of `reason` for `cache_warm{stopped}` are in [tui.md](tui.md) "Cache and context". The result object of `ama -p --output-format json` also has a `cache` field of the same shape.
|
|
352
|
+
`cache_miss` gives `detail` only for `prefix_changed` (`tools`, `system`, or `system:<section,…>` naming the changed sections, such as `system:hooks,memory`). The values and meanings of `reason` for `cache_warm{stopped}` are in [tui.md](../guides/tui.md) "Cache and context". The result object of `ama -p --output-format json` also has a `cache` field of the same shape.
|
|
353
353
|
|
|
354
354
|
It also carries `context: { tokens, window, percent }` (context used, window size and usage 0–100, defined like `contextTokens` / `contextWindow` / `contextPercent` in the table above); an unknown item is omitted (for a model without a window only `tokens` is present), and when all are unknown there is no `context`.
|
|
355
355
|
|
|
@@ -363,7 +363,7 @@ It also carries `context: { tokens, window, percent }` (context used, window siz
|
|
|
363
363
|
|
|
364
364
|
## Plan approval
|
|
365
365
|
|
|
366
|
-
Plan mode and the plan format are described in [plan.md](
|
|
366
|
+
Plan mode and the plan format are described in [plan.md](../../guides/plan.md) (Chinese).
|
|
367
367
|
|
|
368
368
|
1. When a turn ends in plan mode with plain text and the reply contains a `<proposed_plan>` block, the server saves the plan and sends `plan_proposed{ planId, version, markdown, steps, filePath? }` (`steps[]`: `{ id, text, dependsOn?, agent? }`), followed by `agent_settled` as usual.
|
|
369
369
|
2. The client answers only if it declared `set_client_capabilities{capabilities:["plans"]}`; otherwise the config `plan.unattended` applies: `stop` by default (the plan stays proposed, no mode switch, no execution; the client can still answer later with `plan_response`), and `approve` approves and executes within the same run.
|
|
@@ -381,7 +381,7 @@ Plan mode and the plan format are described in [plan.md](../plan.md) (Chinese).
|
|
|
381
381
|
|
|
382
382
|
- stdin closed: no more commands are accepted and approvals are withdrawn (later asks resolve as unanswered → deny); in-flight commands and started runs finish and their responses are written, then the exit code is 0. So `printf '{"type":"prompt","message":"hi"}\n' | ama --mode rpc` gets a complete reply; to stop early, send `abort` first.
|
|
383
383
|
- SIGINT / SIGTERM: the current run is interrupted and the process exits in order, with exit code 130 / 143.
|
|
384
|
-
- Startup failures use the CLI exit codes ([design.md](
|
|
384
|
+
- Startup failures use the CLI exit codes ([design.md](../../design/design.md) §11.3, Chinese): config error 3, no model or key 4, session error 5, host / hook startup failure 6, host API version mismatch 78.
|
|
385
385
|
|
|
386
386
|
## Examples
|
|
387
387
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# Agent:子 Agent 与外部 Agent
|
|
2
2
|
|
|
3
3
|
模型只认识两个工具:`task`(委派)与 `task_ctl`(管理后台任务)。`task(agent=…)` 的 `agent` 既可以是 ama 自己的子 Agent
|
|
4
|
-
类型,也可以是外部 CLI Agent(外部部分见下文「外部 Agent」节)。设计依据:[wave5-plan.md](wave5-plan.md) §7、D13、D22–D24。
|
|
4
|
+
类型,也可以是外部 CLI Agent(外部部分见下文「外部 Agent」节)。设计依据:[wave5-plan.md](../history/wave5-plan.md) §7、D13、D22–D24。
|
|
5
5
|
|
|
6
6
|
## 子 Agent
|
|
7
7
|
|
|
@@ -92,7 +92,7 @@ ama 再跑一轮、在消息里要求「不要调用工具、直接给最终报
|
|
|
92
92
|
`<task-notification>`:
|
|
93
93
|
|
|
94
94
|
- 交互界面:`Ctrl+B` / `/tasks bg [id]` / Agent 栏里按 `b`(见 [tui.md](tui.md)「子 Agent」);
|
|
95
|
-
- RPC:`background_task { taskId? }`([rpc.md](rpc.md)),SDK:`session.backgroundTask(taskId?)`,返回实际转了的 `taskId`;
|
|
95
|
+
- RPC:`background_task { taskId? }`([rpc.md](../reference/rpc.md)),SDK:`session.backgroundTask(taskId?)`,返回实际转了的 `taskId`;
|
|
96
96
|
不给 `taskId` 时转全部前台运行中任务,正在 `task_ctl wait` 的等待也一并打断;
|
|
97
97
|
- 自动:`subagents.autoBackgroundAfterMs` 大于 0 时,前台任务运行超过该毫秒数自动转后台(缺省 0 关闭)。
|
|
98
98
|
|
|
@@ -133,7 +133,7 @@ ama 再跑一轮、在消息里要求「不要调用工具、直接给最终报
|
|
|
133
133
|
每个任务有会话内唯一的 `taskId`(`t1`、`t2` …)。子会话结束后不立即释放,最多保留 4 个(`subagents.retainSessions`;
|
|
134
134
|
最久未用的先释放内存,JSONL 一直在)。`task{taskId}` / `task_ctl send` 续聊时,保留中的直接追加消息,已释放的按会话文件重新打开再追加——
|
|
135
135
|
同一个任务始终写同一个 JSONL。父会话在任务开始、每次续聊与结束时写一条 `custom{ama.task}`
|
|
136
|
-
([session-format.md](session-format.md));`--resume` 时据此重建任务列表,当时还在运行的标 `interrupted`,仍可续聊。
|
|
136
|
+
([session-format.md](../reference/session-format.md));`--resume` 时据此重建任务列表,当时还在运行的标 `interrupted`,仍可续聊。
|
|
137
137
|
内存会话(`--no-session`)的任务被释放后不能续聊。子会话转录常达数十 MB,保留得越多常驻内存越大;频繁轮换续聊
|
|
138
138
|
5 个以上任务时可调大保留数,代价只是被释放的任务续聊时多一次从磁盘重开。
|
|
139
139
|
|
|
@@ -159,7 +159,7 @@ worktree 里与父 cwd 对应的目录。结束时没有改动(工作区干净
|
|
|
159
159
|
- 类型声明了 `tools` / `disallowed-tools`(或参数给了 `tools`)时,工具表不变,不可用的工具在执行层拒绝
|
|
160
160
|
(`Tool "X" is not available in this session.`),并在 `<task>` 里列出。只读类型照旧走只读管线。
|
|
161
161
|
- `<task>` 同时列出按深度拒绝的 `task` / `task_ctl` 并要求不要调用它们(执行层仍是深度拒绝的文案)。实测仍有模型把父消息里
|
|
162
|
-
「调用 task」的指令当成自己的:调一次被拒,多一轮请求,有时随后只回报失败、不做子任务(见 [benchmarks](benchmarks/efficiency-2026-10.md)「F2」)。
|
|
162
|
+
「调用 task」的指令当成自己的:调一次被拒,多一轮请求,有时随后只回报失败、不做子任务(见 [benchmarks](../benchmarks/efficiency-2026-10.md)「F2」)。
|
|
163
163
|
- `isolation: "worktree"` 时子会话的 cwd 是 worktree,`<task>` 里说明上文的相对路径指父目录;cwd 节变化以尾部补丁发送,
|
|
164
164
|
不影响已缓存的前缀。
|
|
165
165
|
|
|
@@ -171,12 +171,12 @@ worktree 里与父 cwd 对应的目录。结束时没有改动(工作区干净
|
|
|
171
171
|
何时用 fork:子任务需要你已经读过、讨论过的内容时。fork 的首个请求把父上下文整段带上,按命中价计费;fresh 只发系统提示、
|
|
172
172
|
工具表与任务说明,但你得在 `prompt` 里写清全部背景,子 Agent 往往还要重新读文件。
|
|
173
173
|
|
|
174
|
-
| 供应商(命中价 / 未命中价) | 8k 父上下文 fork 一次(实测,见 [benchmarks](benchmarks/efficiency-2026-10.md)「F」) | 适合 |
|
|
175
|
-
| ------------------------------- |
|
|
176
|
-
| DeepSeek(约 1/50) | 命中 77%,与父自己的下一回合相同;折合约 1.9k 全价 token
|
|
177
|
-
| Kimi(约 1/4–1/10) | 命中 97.5%
|
|
178
|
-
| OpenAI 系(经中转,不发路由键) | 两次分别 0% 与 85%,取决于中转把请求路由到哪个上游
|
|
179
|
-
| Anthropic(1/10,写入 1.25×) | 未实测;前缀相同,命中应与父的下一回合相同
|
|
174
|
+
| 供应商(命中价 / 未命中价) | 8k 父上下文 fork 一次(实测,见 [benchmarks](../benchmarks/efficiency-2026-10.md)「F」) | 适合 |
|
|
175
|
+
| ------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------- |
|
|
176
|
+
| DeepSeek(约 1/50) | 命中 77%,与父自己的下一回合相同;折合约 1.9k 全价 token | 需要父上下文时几乎总划算 |
|
|
177
|
+
| Kimi(约 1/4–1/10) | 命中 97.5% | 需要父上下文、且要重读较多时 |
|
|
178
|
+
| OpenAI 系(经中转,不发路由键) | 两次分别 0% 与 85%,取决于中转把请求路由到哪个上游 | 视中转而定 |
|
|
179
|
+
| Anthropic(1/10,写入 1.25×) | 未实测;前缀相同,命中应与父的下一回合相同 | 需要父上下文时 |
|
|
180
180
|
|
|
181
181
|
fork 的成本不止首请求:子会话**每一回合**都重读整段父前缀。按命中价折算,8k 父上下文 × 30 回合在 DeepSeek(1/50)上约
|
|
182
182
|
4.8k 全价 token,在 Kimi / Anthropic(1/4–1/10)上约 24k–60k,中转落空时全价。所以 DeepSeek 上子任务只要重读 ≥ 1 份
|
|
@@ -189,7 +189,7 @@ fork 的成本不止首请求:子会话**每一回合**都重读整段父前
|
|
|
189
189
|
|
|
190
190
|
### 事件与统计
|
|
191
191
|
|
|
192
|
-
RPC / SDK 事件 `subagent_start` / `subagent_update` / `subagent_background` / `subagent_end` 见 [rpc.md](rpc.md)「子 Agent 事件」。
|
|
192
|
+
RPC / SDK 事件 `subagent_start` / `subagent_update` / `subagent_background` / `subagent_end` 见 [rpc.md](../reference/rpc.md)「子 Agent 事件」。
|
|
193
193
|
`getStats().tasks` 给出任务总数、运行中数量与按状态的计数;子会话的缓存命中与重计费仍汇总在 `cache.subagents`。
|
|
194
194
|
RPC `get_tasks` / `get_agents` 返回任务快照与可用类型(来源、定义文件路径)。交互界面的 `/tasks`、`/agents` 与 task 工具行的折叠显示见 [tui.md](tui.md)「子 Agent」。
|
|
195
195
|
|
|
@@ -245,7 +245,7 @@ ama 改为直接驱动 `pi --mode rpc`,并以 `-e` 给这一次运行加载一
|
|
|
245
245
|
|
|
246
246
|
每条路径在临时目录各跑两个会话:非 git 目录里两轮「只回 OK」+ 一次触发审批的写文件(`default` 模式);git 目录里长输出时中断,再续一轮。
|
|
247
247
|
模型用各家最便宜的:Claude `haiku`、Codex `gpt-6-luna`、Copilot `gpt-5-mini`、OpenCode `opencode/mimo-v2.6-flash-free`、pi `openai-codex/gpt-6-luna`。
|
|
248
|
-
记录与原始数字见 [benchmarks/external-agents-2026-10.md](benchmarks/external-agents-2026-10.md)。
|
|
248
|
+
记录与原始数字见 [benchmarks/external-agents-2026-10.md](../benchmarks/external-agents-2026-10.md)。
|
|
249
249
|
|
|
250
250
|
| 路径 | 两轮续聊 | 审批写文件 | 中断后续聊 | 用量 / 上下文 | 非 git 目录 |
|
|
251
251
|
| -------------------------- | -------- | ------------------------------------------------- | ------------- | --------------------------------- | -------------- |
|
|
@@ -313,7 +313,7 @@ ama 改为直接驱动 `pi --mode rpc`,并以 `-e` 给这一次运行加载一
|
|
|
313
313
|
| `full-auto` | `auto`(从不给 `bypassPermissions`) | `never` / `workspace-write`(从不给 `danger-full-access`) | 同上 |
|
|
314
314
|
|
|
315
315
|
上表 ACP 一列是缺省规则;模式 id 与 ama 不同名的 Agent 在驱动表里有显式映射(见上文「实测能力矩阵」后的说明)。
|
|
316
|
-
ACP Agent 不给 `modes`、改用 category `mode` 的配置项表达模式时,按上表同一映射在配置项的可选值里找,经 `session/set_config_option` 设置(见 [acp.md](acp.md)「作为客户端」)。
|
|
316
|
+
ACP Agent 不给 `modes`、改用 category `mode` 的配置项表达模式时,按上表同一映射在配置项的可选值里找,经 `session/set_config_option` 设置(见 [acp.md](../reference/acp.md)「作为客户端」)。
|
|
317
317
|
|
|
318
318
|
一次性打印模式不能审批,只在只读任务下用。
|
|
319
319
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# codemode
|
|
2
2
|
|
|
3
|
-
设计依据见 [design.md](design.md) §5.5、§5.6、§9.1。
|
|
3
|
+
设计依据见 [design.md](../design/design.md) §5.5、§5.6、§9.1。
|
|
4
4
|
|
|
5
5
|
`codemode` 工具让模型写一段 JavaScript,在脚本里经 `tools.*` 编排多次工具调用,只有脚本输出回到模型。长流程、工具密集的任务里,它把多次往返合成一次,减少往返次数与缓存读取;短任务里模型照常直接调用工具,codemode 只多占约 400 token 前缀,所以 `default` 预设在网络隔离的运行时上缺省开着它。
|
|
6
6
|
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
|
|
25
25
|
缺省配置里不写 `codemode.mode`(`ama init` 生成的 `config.json` 也不写),所以这张映射以后调整时老用户同样生效。`ama config show` / `ama doctor` 显示生效模式与原因(跟随哪个预设、网络由 Node 还是操作系统沙箱隔离);`ama doctor` 另列操作系统沙箱能力。
|
|
26
26
|
|
|
27
|
-
`minimal` / `coordinator` 预设缺省不带 codemode,也没有 grep / glob:模型找代码只能用 bash(`default` 权限模式下每次审批、`-p` 下被拒)。要检索就 `tools.default: ["+grep","+glob"]` 直接加上,比为了检索打开 codemode 便宜(见 [design.md](design.md) §5.6);`codemode-only` 的脚本里 `tools.grep()` / `tools.glob()` / `tools.ls()` 都可调用。
|
|
27
|
+
`minimal` / `coordinator` 预设缺省不带 codemode,也没有 grep / glob:模型找代码只能用 bash(`default` 权限模式下每次审批、`-p` 下被拒)。要检索就 `tools.default: ["+grep","+glob"]` 直接加上,比为了检索打开 codemode 便宜(见 [design.md](../design/design.md) §5.6);`codemode-only` 的脚本里 `tools.grep()` / `tools.glob()` / `tools.ls()` 都可调用。
|
|
28
28
|
|
|
29
29
|
`coordinator` 预设即使显式 `on`,脚本里能调用的工具也只限它的活动集(read 与宿主工具):`tools.bash`、`tools.write` 在脚本里同样不存在,协调者「不写文件、不跑 bash」的约定不能经 codemode 绕过。
|
|
30
30
|
|
|
@@ -87,7 +87,7 @@
|
|
|
87
87
|
|
|
88
88
|
- `codemode` 本身作为一次工具调用经过 PreToolUse、权限与 PostToolUse。
|
|
89
89
|
- 脚本里的每次 `tools.*` 再各自经过完整流程,Hook 按**真实工具名**匹配(`bash`,不是 `codemode`);Hook 输入多两个字段:`viaCodemode: true` 与 `parentToolCallId`(外层 `codemode` 调用的 id)。
|
|
90
|
-
- 事件:`tool_execution_update` 透传脚本输出(最近 4000 字符);内层调用发 `tool_execution_start / end`,带 `parentToolCallId`,不进转录、不进模型上下文。`ama --mode acp` 把每次内层调用单列为一条 `tool_call`(标题前缀 `codemode › `,`_meta.ama.parentToolCallId` 指向外层),其权限请求关联到这条内层调用(见 [acp.md](acp.md))。
|
|
90
|
+
- 事件:`tool_execution_update` 透传脚本输出(最近 4000 字符);内层调用发 `tool_execution_start / end`,带 `parentToolCallId`,不进转录、不进模型上下文。`ama --mode acp` 把每次内层调用单列为一条 `tool_call`(标题前缀 `codemode › `,`_meta.ama.parentToolCallId` 指向外层),其权限请求关联到这条内层调用(见 [acp.md](../reference/acp.md))。
|
|
91
91
|
|
|
92
92
|
## 沙箱
|
|
93
93
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# 命令式 Hook(hooks.json)
|
|
2
2
|
|
|
3
|
-
命令式 Hook 是在固定时机运行的 shell 命令:ama 把事件写成 JSON 交给命令的 stdin,按退出码与 stdout JSON 决定放行、阻止或改写。它是**用户策略**层——可以改工具输入、一票否决工具调用、给提示追加上下文、让运行再跑一轮。类型定义在 `src/hooks/types.ts`(经 `@armadra/agent` 导出 `HookInput`、`HookOutput`、`HookConfig` 等)。设计依据见 [design.md](design.md) §6.1、§6.3、§7.3。
|
|
3
|
+
命令式 Hook 是在固定时机运行的 shell 命令:ama 把事件写成 JSON 交给命令的 stdin,按退出码与 stdout JSON 决定放行、阻止或改写。它是**用户策略**层——可以改工具输入、一票否决工具调用、给提示追加上下文、让运行再跑一轮。类型定义在 `src/hooks/types.ts`(经 `@armadra/agent` 导出 `HookInput`、`HookOutput`、`HookConfig` 等)。设计依据见 [design.md](../design/design.md) §6.1、§6.3、§7.3。
|
|
4
4
|
|
|
5
5
|
## 配置
|
|
6
6
|
|
|
@@ -125,7 +125,7 @@ interface HookOutput {
|
|
|
125
125
|
- `additionalContext` / `customInstructions` 按配置顺序拼接。
|
|
126
126
|
- 任一 Hook 返回 `continue: false` 即请求结束运行。
|
|
127
127
|
|
|
128
|
-
一次工具调用的完整顺序([design.md](design.md) §6.3):
|
|
128
|
+
一次工具调用的完整顺序([design.md](../design/design.md) §6.3):
|
|
129
129
|
|
|
130
130
|
```text
|
|
131
131
|
模型产出工具调用
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
# 界面语言(中英双语)
|
|
2
|
+
|
|
3
|
+
> 第六波(docs/history/wave6-plan.md §5、D18–D23)。本文是开发约定:怎么选语言、文案放哪、键怎么起名、怎么测。
|
|
4
|
+
> 调研依据见 [research/wave6/R8-i18n.md](../research/wave6/R8-i18n.md)。
|
|
5
|
+
|
|
6
|
+
## 语言怎么定
|
|
7
|
+
|
|
8
|
+
优先级从高到低,**进程启动时定一次**,不做运行中切换:
|
|
9
|
+
|
|
10
|
+
1. 环境变量 `AMA_LANG`(`zh` / `en`,`zh_CN` 之类也认;写错的值忽略);
|
|
11
|
+
2. 命令行 `--lang zh|en`(也可写在子命令前:`ama --lang en doctor`);SDK `createRuntime({ language })` / `createAgentSession({ language })` 等价;
|
|
12
|
+
3. profile 的 `language`(嵌入宿主跟随画布界面语言);
|
|
13
|
+
4. 配置 `ui.language`(`auto` / `zh` / `en`,缺省 `auto`;用户级 / 项目级都可设);
|
|
14
|
+
5. `LC_ALL` → `LC_MESSAGES` → `LANG` 第一个非空值:`zh*` 为中文,其余(含 `C`、`POSIX`、`en_*`)为英文;
|
|
15
|
+
6. 都没有:英文。
|
|
16
|
+
|
|
17
|
+
`cli/main.ts` 在解析参数后、任何输出前按 1、2、用户级 `ui.language`、5 定语言;bootstrap 合并 profile 与项目级后,若它们给了 `ui.language` / `language`,再补定一次(仍以 1、2 为准)。`ama doctor` 显示「界面语言:zh(来源 LANG=zh_CN.UTF-8)」(`resolveLocaleWithSource`)。
|
|
18
|
+
|
|
19
|
+
**界面语言只影响给人看的文字。** 发给模型的一切(系统提示、工具描述、工具结果里的标记、截断 / 裁剪占位、外部 Agent 报告、Hook 阻止理由、拒绝理由)固定英文,两种语言下请求逐字节相同。想让模型用某种语言回复,用 `ui.replyLanguage`(在 `rules` 节末尾追加一句英文规则,不设时零字节变化)。
|
|
20
|
+
|
|
21
|
+
## 文案放哪
|
|
22
|
+
|
|
23
|
+
```text
|
|
24
|
+
src/i18n/
|
|
25
|
+
index.ts Locale、resolveLocale / resolveLocaleWithSource、setLocale / getLocale、msg()、messagesFor()
|
|
26
|
+
types.ts Messages<T>
|
|
27
|
+
format.ts plural()、formatDuration()
|
|
28
|
+
catalog.ts 汇总全部领域(第六波 C0 一次登记,之后无人再改)
|
|
29
|
+
messages/<领域>.ts
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
| 领域文件 | 归属批次 |
|
|
33
|
+
| --------------------------------------------------------------------------- | ------------------------------------- |
|
|
34
|
+
| `cli`、`subcommands` | W6-I1 |
|
|
35
|
+
| `interactive`、`approval`、`plan`、`rewind`、`panels`、`permissions` | W6-I2 |
|
|
36
|
+
| `report`、`print`、`drivers`、`session`、`errors` | W6-I3 |
|
|
37
|
+
| `config` | W6-I4 |
|
|
38
|
+
| `agents` / `trace` / `memory` / `auth` / `settings` | W6-A / W6-T1、T2 / W6-M / W6-O / W6-S |
|
|
39
|
+
| `acp`(子对象 `core` / `auth` / `session` / `tools` / `config` / `client`) | ACP-C0 建,各子对象归 ACP 补全的批次 |
|
|
40
|
+
|
|
41
|
+
每个领域文件同时导出 `en`(形状源)与 `zh`:
|
|
42
|
+
|
|
43
|
+
```ts
|
|
44
|
+
import { plural } from "../format.js";
|
|
45
|
+
import type { Messages } from "../types.js";
|
|
46
|
+
|
|
47
|
+
export const en = {
|
|
48
|
+
limitTurns: (limit: number) => `ama: reached the turn limit ${limit}; run ended early`,
|
|
49
|
+
dirSummary: (files: number, size: string) => `directory, ${plural(files, "file")}, ${size}`,
|
|
50
|
+
approval: { title: "Approve tool call", keys: { allow: "allow", deny: "deny" } },
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
export const zh = {
|
|
54
|
+
limitTurns: (limit) => `ama: 已达到回合上限 ${limit},运行在完成前结束`,
|
|
55
|
+
dirSummary: (files, size) => `目录,${files} 个文件,${size}`,
|
|
56
|
+
approval: { title: "Approve tool call", keys: { allow: "allow", deny: "deny" } },
|
|
57
|
+
} satisfies Messages<typeof en>;
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
`satisfies Messages<typeof en>` 让缺键、多键、参数个数 / 类型不符都在 `tsc` 期报错——两种语言必须同时给。
|
|
61
|
+
|
|
62
|
+
取用:`const m = msg().print; io.stderr(m.limitTurns(limit))`。用嵌套属性访问,不用字符串键。
|
|
63
|
+
|
|
64
|
+
## 键名规范
|
|
65
|
+
|
|
66
|
+
- 领域文件名即一级命名空间(`msg().approval…`);
|
|
67
|
+
- 叶子 camelCase,按「组件.用途」分组:`approval.title`、`approval.keys.allow`、`rewind.skip.failed`;
|
|
68
|
+
- 不以文案内容命名(`notInstalled` 可以,`weiAnZhuang` 不行);
|
|
69
|
+
- **整句一个键,禁止片段拼接**:英文语序不同,`"追加写入" + 词 + 路径` 这种要写成一个函数,条件分支写进函数体;
|
|
70
|
+
- 插值写成箭头函数,参数类型写在 en 上;复数只英文需要,用 `plural(n, "file")`(不规则词给第三参数);
|
|
71
|
+
- 紧凑时长 `formatDuration(ms)`(`45s` / `2m 10s` / `1h24m`)两种语言共用;`formatTokens` / `formatUsd` / `formatPercent`、日期(ISO)与 compact 状态行记号(`ctx`、`cache`、`$`、`↑ ↓`、`⎇`、`·`)不译;
|
|
72
|
+
- 枚举值、命令名、配置键、动作 id、错误码不译。
|
|
73
|
+
|
|
74
|
+
## 不要这样做
|
|
75
|
+
|
|
76
|
+
- **模块顶层求值**:`const HELP = msg().cli.help` 会按 import 时的语言定死(SDK / 嵌入场景显示错语言)。改成函数或 getter;`scripts/check-i18n.mjs` 会拦。
|
|
77
|
+
- **按文案判断逻辑**:`text === "未安装"`、`reason.startsWith("失败")`。界面文案会随语言变,逻辑用枚举 / 码(第六波 C0 已把三处改掉)。用户**输入**的别名(`批准`、`步骤`、粘贴标记 `[粘贴 #` / `[paste #`)两种语言同时识别,与界面语言无关。
|
|
78
|
+
- **模型侧模块 import `src/i18n`**:系统提示、工具(`src/tools/**`)、Plan 提示、内置子 Agent、Skill、压缩、codemode 声明、Memory 工具不得 import——`src/i18n/guard.test.ts` 守着。这些模块需要给人看的错误时抛 `AmaError(code, englishMessage, { detail })`,由界面层按 `detail` 渲染(例:`tools/image-file.ts` → `modes/image-input.ts` 的 `msg().errors.imageFile(detail)`)。
|
|
79
|
+
- **宿主解析 `message`**:RPC / ACP 的 `error.message`、`-p` 的 stderr 是人读文本,会随语言变;宿主按 `code` 判断。
|
|
80
|
+
|
|
81
|
+
## 测试
|
|
82
|
+
|
|
83
|
+
- 测试缺省钉 zh:`test/helpers/setup.ts` 设 `AMA_LANG=zh` 并 `setLocale("zh")`,子进程也是 zh。迁移批次的验收是现有 zh 帧黄金与断言**字节不变**。
|
|
84
|
+
- en 用例自己 `setLocale("en")`(或传 `AMA_LANG=en`),用完在 `afterEach` 里 `setLocale("zh")`;en 帧黄金放 `test/fixtures/tui/en/`。
|
|
85
|
+
- `src/cli/lang-independence.test.ts`:同一脚本在 zh / en 下各跑一遍,发给供应商的请求逐字节相同。
|
|
86
|
+
- `scripts/check-i18n.mjs`(`pnpm check:i18n`,在 `pnpm ci` 里):
|
|
87
|
+
1. 严格(W6-I5 起,基线已清零删除):`src/**` 源码里含汉字的代码行(注释不算)**出现即失败**。不扫的文件(测试、测试支撑、`src/i18n/`、models.dev 上游快照)在脚本的 `SKIPPED`,允许的行(用户输入别名、粘贴标记识别、价格覆盖数据的 `_reason`)在 `ALLOWED_LINES`,每条都写了理由;新增条目要在 PR 里说明;
|
|
88
|
+
2. `en` 目录里不得有汉字,`zh` 目录里不得留 `TODO`;
|
|
89
|
+
3. 顶层常量不得立即调用 `msg()`。
|
|
90
|
+
|
|
91
|
+
## 体积
|
|
92
|
+
|
|
93
|
+
bundle 用 `charset: "utf8"` 输出(中文按 UTF-8 原样,不转 `\uXXXX`),抵消英文目录带来的增量。
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# 记忆(Memory)
|
|
2
2
|
|
|
3
|
-
> 第六波 W6-M(设计见 [wave6-plan.md](wave6-plan.md) §3、D8–D12;调研 [research/wave6/R7-memory.md](research/wave6/R7-memory.md))。
|
|
3
|
+
> 第六波 W6-M(设计见 [wave6-plan.md](../history/wave6-plan.md) §3、D8–D12;调研 [research/wave6/R7-memory.md](../research/wave6/R7-memory.md))。
|
|
4
4
|
|
|
5
5
|
跨会话的个人笔记:你说「记住……」,模型把它写成一条 Markdown,下次会话开始时索引进系统提示,正文按需读取。
|
|
6
6
|
**缺省关闭**;关闭时不读盘、不注册工具、不渲染节,发给模型的请求与没有这个功能时逐字节相同。
|