@armadra/agent 0.7.6 → 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 +51 -31
- package/CHANGELOG.zh-CN.md +68 -48
- 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 +4 -2
- package/dist/ai/apis/chatgpt-backend.js +11 -2
- 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 +1041 -359
- 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 +23 -2
- package/dist/drivers/acp/driver.js +60 -6
- 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 +4 -1
- package/dist/drivers/base.d.ts +1 -1
- package/dist/drivers/base.js +1 -1
- package/dist/drivers/catalog.d.ts +3 -1
- package/dist/drivers/catalog.js +95 -5
- 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 +9 -1
- package/dist/drivers/native/claude-normalize.js +28 -1
- package/dist/drivers/native/claude-stream.d.ts +1 -1
- package/dist/drivers/native/claude-stream.js +17 -2
- package/dist/drivers/native/codex-app-server.d.ts +1 -1
- package/dist/drivers/native/codex-app-server.js +5 -3
- 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 +13 -3
- package/dist/drivers/native/pi-gate.d.ts +19 -0
- package/dist/drivers/native/pi-gate.js +39 -0
- package/dist/drivers/native/pi-rpc.d.ts +29 -0
- package/dist/drivers/native/pi-rpc.js +483 -0
- 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 +2 -1
- package/dist/drivers/store.d.ts +1 -1
- package/dist/drivers/store.js +1 -1
- package/dist/drivers/types.d.ts +2 -2
- 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 +5 -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 +3 -1
- package/dist/i18n/messages/auth.js +3 -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 +5 -1
- package/dist/i18n/messages/drivers.js +5 -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} +13 -12
- 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} +68 -23
- 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} +11 -10
- 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
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* - 时间:`--since` / `--until` 接受 `7d`(含今天的最近 7 天)、`today`、`YYYY-MM-DD`(本地日期,含当天)。
|
|
6
6
|
* - 分组:`--by day|week|month|provider|channel|model|project`。
|
|
7
7
|
* - 缓存:`<数据目录>/stats-index.json`,按文件 mtime / size 失效;`--no-cache` 不读也不写。
|
|
8
|
-
* - 口径见 session/stats-aggregate.ts 与 docs/sessions.md「统计」。
|
|
8
|
+
* - 口径见 session/stats-aggregate.ts 与 docs/guides/sessions.md「统计」。
|
|
9
9
|
*/
|
|
10
10
|
import { join, resolve } from "node:path";
|
|
11
11
|
import { expandHome, resolveDataDir } from "../../config/paths.js";
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* - 命令行:`<node> --max-old-space-size=<MB> --permission --allow-fs-read=<入口>
|
|
5
5
|
* --disallow-code-generation-from-strings <入口> --ama-codemode-sandbox`;堆上限取 `codemode.maxHeapMb`
|
|
6
|
-
* (缺省 256,0 不加),超出时子进程 OOM 退出,映射为脚本错误(docs/memory-plan.md D10);Node 22.0–22.12 用 `--experimental-permission`。不授予文件写、
|
|
6
|
+
* (缺省 256,0 不加),超出时子进程 OOM 退出,映射为脚本错误(docs/history/memory-plan.md D10);Node 22.0–22.12 用 `--experimental-permission`。不授予文件写、
|
|
7
7
|
* 子进程、worker、addon、inspector 权限;以空环境启动(拿不到密钥与会话路径);嵌入 Electron
|
|
8
8
|
* 时设 `ELECTRON_RUN_AS_NODE=1` 运行同一可执行文件。
|
|
9
9
|
* - 入口:bundle 里是 ama.cjs 同目录的 `ama-sandbox.cjs`(构建脚本定义 `__AMA_SANDBOX_ENTRY__`);
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
* (完整门禁);名字是 `codemode` 直接拒绝。脚本结束时 abort 仍在跑的调用。
|
|
14
14
|
* - 超时:父进程计时,到点杀子进程树(POSIX 进程组 / Windows taskkill);外层 abort:先发
|
|
15
15
|
* `abort`,宽限后杀树。
|
|
16
|
-
* - OS 沙箱(docs/sandbox.md):有可用的 sandbox-exec / bwrap / unshare 时,整条命令行经它启动,拒绝
|
|
16
|
+
* - OS 沙箱(docs/guides/sandbox.md):有可用的 sandbox-exec / bwrap / unshare 时,整条命令行经它启动,拒绝
|
|
17
17
|
* 网络与一切写入(`CODEMODE_OS_POLICY`;子进程本来就没有写权限)。Node 22 / 24 的 strict 依赖这一层
|
|
18
18
|
* (`requireOsSandbox`),包装不了就报错,不裸跑;Node ≥ 25 是叠加的纵深防御。
|
|
19
19
|
*/
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* - 命令行:`<node> --max-old-space-size=<MB> --permission --allow-fs-read=<入口>
|
|
5
5
|
* --disallow-code-generation-from-strings <入口> --ama-codemode-sandbox`;堆上限取 `codemode.maxHeapMb`
|
|
6
|
-
* (缺省 256,0 不加),超出时子进程 OOM 退出,映射为脚本错误(docs/memory-plan.md D10);Node 22.0–22.12 用 `--experimental-permission`。不授予文件写、
|
|
6
|
+
* (缺省 256,0 不加),超出时子进程 OOM 退出,映射为脚本错误(docs/history/memory-plan.md D10);Node 22.0–22.12 用 `--experimental-permission`。不授予文件写、
|
|
7
7
|
* 子进程、worker、addon、inspector 权限;以空环境启动(拿不到密钥与会话路径);嵌入 Electron
|
|
8
8
|
* 时设 `ELECTRON_RUN_AS_NODE=1` 运行同一可执行文件。
|
|
9
9
|
* - 入口:bundle 里是 ama.cjs 同目录的 `ama-sandbox.cjs`(构建脚本定义 `__AMA_SANDBOX_ENTRY__`);
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
* (完整门禁);名字是 `codemode` 直接拒绝。脚本结束时 abort 仍在跑的调用。
|
|
14
14
|
* - 超时:父进程计时,到点杀子进程树(POSIX 进程组 / Windows taskkill);外层 abort:先发
|
|
15
15
|
* `abort`,宽限后杀树。
|
|
16
|
-
* - OS 沙箱(docs/sandbox.md):有可用的 sandbox-exec / bwrap / unshare 时,整条命令行经它启动,拒绝
|
|
16
|
+
* - OS 沙箱(docs/guides/sandbox.md):有可用的 sandbox-exec / bwrap / unshare 时,整条命令行经它启动,拒绝
|
|
17
17
|
* 网络与一切写入(`CODEMODE_OS_POLICY`;子进程本来就没有写权限)。Node 22 / 24 的 strict 依赖这一层
|
|
18
18
|
* (`requireOsSandbox`),包装不了就报错,不裸跑;Node ≥ 25 是叠加的纵深防御。
|
|
19
19
|
*/
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* 单请求图片总量预算(docs/wave5-plan.md §4、D11)。[W5-I] 纯函数,无模型调用。
|
|
2
|
+
* 单请求图片总量预算(docs/history/wave5-plan.md §4、D11)。[W5-I] 纯函数,无模型调用。
|
|
3
3
|
*
|
|
4
4
|
* base64 图片在历史里每轮重发,几张截图就可能撞上 Anthropic 32 MB / Gemini 20 MB 的请求上限。
|
|
5
5
|
* `planImageBudget` 给出要降级的消息:调用方把每条写成 `context_edit{reason:"image_budget"}`,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* 单请求图片总量预算(docs/wave5-plan.md §4、D11)。[W5-I] 纯函数,无模型调用。
|
|
2
|
+
* 单请求图片总量预算(docs/history/wave5-plan.md §4、D11)。[W5-I] 纯函数,无模型调用。
|
|
3
3
|
*
|
|
4
4
|
* base64 图片在历史里每轮重发,几张截图就可能撞上 Anthropic 32 MB / Gemini 20 MB 的请求上限。
|
|
5
5
|
* `planImageBudget` 给出要降级的消息:调用方把每条写成 `context_edit{reason:"image_budget"}`,
|
package/dist/config/edit.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Settings edit core (docs/wave6-plan.md §6.2, D24-D26). [W6-S]
|
|
2
|
+
* Settings edit core (docs/history/wave6-plan.md §6.2, D24-D26). [W6-S]
|
|
3
3
|
*
|
|
4
4
|
* Shared by the `/config` panel, `/config key=value` and `ama config get | set | unset | list`:
|
|
5
5
|
* - `readSnapshot()` reads the user and project files fresh and merges them with the profile / command
|
package/dist/config/edit.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Settings edit core (docs/wave6-plan.md §6.2, D24-D26). [W6-S]
|
|
2
|
+
* Settings edit core (docs/history/wave6-plan.md §6.2, D24-D26). [W6-S]
|
|
3
3
|
*
|
|
4
4
|
* Shared by the `/config` panel, `/config key=value` and `ama config get | set | unset | list`:
|
|
5
5
|
* - `readSnapshot()` reads the user and project files fresh and merges them with the profile / command
|
package/dist/config/init.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* 配置目录初始化(docs/providers.md「配置目录」):`ama init` 与 CLI 首次运行的自动初始化。
|
|
2
|
+
* 配置目录初始化(docs/guides/providers.md「配置目录」):`ama init` 与 CLI 首次运行的自动初始化。
|
|
3
3
|
*
|
|
4
4
|
* - 目录 0700;`config.json` 只在不存在时写最小内容(`--force` 时先备份再重写):只有 `$schema`、
|
|
5
5
|
* `version` 与空 `providers`,不写死任何缺省值——缺省值以后调整(例如 codemode 跟随预设)对老用户
|
package/dist/config/init.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* 配置目录初始化(docs/providers.md「配置目录」):`ama init` 与 CLI 首次运行的自动初始化。
|
|
2
|
+
* 配置目录初始化(docs/guides/providers.md「配置目录」):`ama init` 与 CLI 首次运行的自动初始化。
|
|
3
3
|
*
|
|
4
4
|
* - 目录 0700;`config.json` 只在不存在时写最小内容(`--force` 时先备份再重写):只有 `$schema`、
|
|
5
5
|
* `version` 与空 `providers`,不写死任何缺省值——缺省值以后调整(例如 codemode 跟随预设)对老用户
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* config.json 的 JSON Schema(draft-07 子集),写到配置目录的 `config.schema.json` 给编辑器补全与校验
|
|
3
|
-
* (docs/providers.md「配置目录」)。规则与 schema.ts 的 `validateConfig` 一一对应:未知字段在那里是
|
|
3
|
+
* (docs/guides/providers.md「配置目录」)。规则与 schema.ts 的 `validateConfig` 一一对应:未知字段在那里是
|
|
4
4
|
* warning、这里是 `additionalProperties: false`;渠道引用(模型 `channels` 指向已定义的渠道)这类跨字段
|
|
5
5
|
* 规则 JSON Schema 表达不了,只在 `validateConfig` 里查。一致性由 json-schema.test.ts 的正反例守住。
|
|
6
6
|
* 顶层与各段的键(供应商内部除外)的 description / default 来自 key-docs.ts(`annotate`);说明跟随界面
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
*/
|
|
9
9
|
type Schema = Record<string, unknown>;
|
|
10
10
|
export declare const CONFIG_SCHEMA_FILE = "config.schema.json";
|
|
11
|
-
export declare const CONFIG_SCHEMA_ID = "https://github.com/
|
|
11
|
+
export declare const CONFIG_SCHEMA_ID = "https://github.com/AMA-Link/armadra-agent/config.schema.json";
|
|
12
12
|
/** 生成 config.json 的 JSON Schema。 */
|
|
13
13
|
export declare function buildConfigJsonSchema(): Schema;
|
|
14
14
|
/** 写进文件的文本(2 空格缩进 + 换行结尾)。 */
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* config.json 的 JSON Schema(draft-07 子集),写到配置目录的 `config.schema.json` 给编辑器补全与校验
|
|
3
|
-
* (docs/providers.md「配置目录」)。规则与 schema.ts 的 `validateConfig` 一一对应:未知字段在那里是
|
|
3
|
+
* (docs/guides/providers.md「配置目录」)。规则与 schema.ts 的 `validateConfig` 一一对应:未知字段在那里是
|
|
4
4
|
* warning、这里是 `additionalProperties: false`;渠道引用(模型 `channels` 指向已定义的渠道)这类跨字段
|
|
5
5
|
* 规则 JSON Schema 表达不了,只在 `validateConfig` 里查。一致性由 json-schema.test.ts 的正反例守住。
|
|
6
6
|
* 顶层与各段的键(供应商内部除外)的 description / default 来自 key-docs.ts(`annotate`);说明跟随界面
|
|
@@ -15,7 +15,7 @@ import { CACHE_RETENTIONS, CHANNEL_NAME_PATTERN, CHECKPOINT_MODES, SANDBOX_ENABL
|
|
|
15
15
|
import { AGENT_ID_PATTERN } from "./schema-w5.js";
|
|
16
16
|
import { AGENTS_RESERVED_KEYS, SUBAGENT_BACKGROUND_MODES } from "./types-w5.js";
|
|
17
17
|
export const CONFIG_SCHEMA_FILE = "config.schema.json";
|
|
18
|
-
export const CONFIG_SCHEMA_ID = "https://github.com/
|
|
18
|
+
export const CONFIG_SCHEMA_ID = "https://github.com/AMA-Link/armadra-agent/config.schema.json";
|
|
19
19
|
const KNOWN_APIS = [
|
|
20
20
|
"openai-completions",
|
|
21
21
|
"openai-responses",
|
package/dist/config/schema-w5.js
CHANGED
package/dist/config/schema-w6.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Settings registry (docs/wave6-plan.md §6.1, D24-D26). [W6-S]
|
|
2
|
+
* Settings registry (docs/history/wave6-plan.md §6.1, D24-D26). [W6-S]
|
|
3
3
|
*
|
|
4
4
|
* One row per key that the `/config` panel and `ama config set` treat as a scalar setting: group, apply
|
|
5
5
|
* tier (now / next session / restart), whether it changes the cache prefix, project-level writability
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Settings registry (docs/wave6-plan.md §6.1, D24-D26). [W6-S]
|
|
2
|
+
* Settings registry (docs/history/wave6-plan.md §6.1, D24-D26). [W6-S]
|
|
3
3
|
*
|
|
4
4
|
* One row per key that the `/config` panel and `ama config set` treat as a scalar setting: group, apply
|
|
5
5
|
* tier (now / next session / restart), whether it changes the cache prefix, project-level writability
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* 第五波配置键的形状(docs/wave5-plan.md §9)。[W5-C0] 契约文件:C0 只定形状、校验(schema-w5.ts)、
|
|
2
|
+
* 第五波配置键的形状(docs/history/wave5-plan.md §9)。[W5-C0] 契约文件:C0 只定形状、校验(schema-w5.ts)、
|
|
3
3
|
* 说明与缺省(key-docs.ts)、JSON Schema;行为由各批次实现,未实现前这些键被接受但不起作用。
|
|
4
4
|
*
|
|
5
5
|
* 层级:项目级只接受 `plan.bash`(只能更严)、`reminders`、`ui.statusLine`(随 `ui` 段);其余只认
|
|
@@ -59,7 +59,7 @@ export interface AgentsConfig {
|
|
|
59
59
|
}
|
|
60
60
|
/** 取 `agents.<id>`(保留键返回 undefined)。 */
|
|
61
61
|
export declare function agentEntry(agents: AgentsConfig | undefined, agentId: string): AgentEntryConfig | undefined;
|
|
62
|
-
/** [W7-B2] 子 Agent 缺省前台还是后台(docs/agents-concurrency-plan.md §2.6)。 */
|
|
62
|
+
/** [W7-B2] 子 Agent 缺省前台还是后台(docs/history/agents-concurrency-plan.md §2.6)。 */
|
|
63
63
|
export declare const SUBAGENT_BACKGROUND_MODES: readonly ["auto", "always", "never"];
|
|
64
64
|
export type SubagentBackgroundMode = (typeof SUBAGENT_BACKGROUND_MODES)[number];
|
|
65
65
|
/** [W5-G] ama 自己的子会话。 */
|
package/dist/config/types-w5.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* 第五波配置键的形状(docs/wave5-plan.md §9)。[W5-C0] 契约文件:C0 只定形状、校验(schema-w5.ts)、
|
|
2
|
+
* 第五波配置键的形状(docs/history/wave5-plan.md §9)。[W5-C0] 契约文件:C0 只定形状、校验(schema-w5.ts)、
|
|
3
3
|
* 说明与缺省(key-docs.ts)、JSON Schema;行为由各批次实现,未实现前这些键被接受但不起作用。
|
|
4
4
|
*
|
|
5
5
|
* 层级:项目级只接受 `plan.bash`(只能更严)、`reminders`、`ui.statusLine`(随 `ui` 段);其余只认
|
|
@@ -18,7 +18,7 @@ export function agentEntry(agents, agentId) {
|
|
|
18
18
|
const entry = agents[agentId];
|
|
19
19
|
return typeof entry === "object" && !Array.isArray(entry) ? entry : undefined;
|
|
20
20
|
}
|
|
21
|
-
/** [W7-B2] 子 Agent 缺省前台还是后台(docs/agents-concurrency-plan.md §2.6)。 */
|
|
21
|
+
/** [W7-B2] 子 Agent 缺省前台还是后台(docs/history/agents-concurrency-plan.md §2.6)。 */
|
|
22
22
|
export const SUBAGENT_BACKGROUND_MODES = ["auto", "always", "never"];
|
|
23
23
|
/** `models.enabled` 的一项:`provider/model[@channel]` 或 `provider/*`。 */
|
|
24
24
|
export const MODELS_ENABLED_REF = /^[^/\s]+\/\S+$/;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* 第六波配置键的形状(docs/wave6-plan.md §7、§1.3、§3.1、§4.3、§4.4、§5.2)。[W6-C0] 契约文件:C0 只定形状、
|
|
2
|
+
* 第六波配置键的形状(docs/history/wave6-plan.md §7、§1.3、§3.1、§4.3、§4.4、§5.2)。[W6-C0] 契约文件:C0 只定形状、
|
|
3
3
|
* 校验(schema-w6.ts)、说明与缺省(key-docs.ts)、JSON Schema;行为由各批次实现,未实现前这些键被接受但不起作用。
|
|
4
4
|
*
|
|
5
5
|
* 层级(merge.ts):项目级可设 `ui.language`、`ui.agentBar`,`memory` 只接受 `enabled: false`;`ui.replyLanguage`、
|
|
6
6
|
* `memory` 其余键、`auth` 只认用户级 / profile(项目级忽略并 warning)。
|
|
7
7
|
*/
|
|
8
|
-
/** `ui.language`:auto 按 `LC_ALL` / `LC_MESSAGES` / `LANG` 判断,判断不出用 en(docs/i18n.md)。 */
|
|
8
|
+
/** `ui.language`:auto 按 `LC_ALL` / `LC_MESSAGES` / `LANG` 判断,判断不出用 en(docs/guides/i18n.md)。 */
|
|
9
9
|
export type LanguageSetting = "auto" | "zh" | "en";
|
|
10
10
|
export declare const LANGUAGE_SETTINGS: readonly LanguageSetting[];
|
|
11
11
|
/** [W6-A] Agent 栏:auto 有任务时显示;off 不显示(嵌入宿主缺省 off)。 */
|
|
@@ -27,7 +27,7 @@ export interface UiConfigW6 {
|
|
|
27
27
|
export type MemoryScopeName = "user" | "project";
|
|
28
28
|
export declare const MEMORY_SCOPES: readonly MemoryScopeName[];
|
|
29
29
|
export declare const MEMORY_SUBAGENT_MODES: readonly ["off", "read"];
|
|
30
|
-
/** [W6-M] `memory` 段(docs/wave6-plan.md §3.1)。缺省关闭;关闭时系统提示、工具表、请求体逐字节不变。 */
|
|
30
|
+
/** [W6-M] `memory` 段(docs/history/wave6-plan.md §3.1)。缺省关闭;关闭时系统提示、工具表、请求体逐字节不变。 */
|
|
31
31
|
export interface MemoryConfig {
|
|
32
32
|
/** 总开关,缺省 false;项目级只能设为 false;`--memory` / `--no-memory`、`AMA_MEMORY=0|1` 覆盖。 */
|
|
33
33
|
enabled?: boolean;
|
|
@@ -42,7 +42,7 @@ export interface MemoryConfig {
|
|
|
42
42
|
/** 子会话:read(缺省,写命令执行层拒绝)/ off(view 也拒绝)。 */
|
|
43
43
|
subagents?: (typeof MEMORY_SUBAGENT_MODES)[number];
|
|
44
44
|
}
|
|
45
|
-
/** [W6-O] ChatGPT 登录的两条路径(docs/wave6-plan.md §4.1、D13)。 */
|
|
45
|
+
/** [W6-O] ChatGPT 登录的两条路径(docs/history/wave6-plan.md §4.1、D13)。 */
|
|
46
46
|
export type ChatGptFlavor = "siwc" | "codex";
|
|
47
47
|
export declare const CHATGPT_FLAVORS: readonly ChatGptFlavor[];
|
|
48
48
|
/** [W6-O] `auth.chatgpt`:不含密钥;只认用户级 / profile。 */
|
|
@@ -85,7 +85,7 @@ export interface ApiKeyAuthEntry {
|
|
|
85
85
|
baseUrl?: string;
|
|
86
86
|
}
|
|
87
87
|
/**
|
|
88
|
-
* [W6-O] auth.json 里的 OAuth 条目(docs/wave6-plan.md §4.3、D15)。token 与 id_token 原文绝不进日志、错误、
|
|
88
|
+
* [W6-O] auth.json 里的 OAuth 条目(docs/history/wave6-plan.md §4.3、D15)。token 与 id_token 原文绝不进日志、错误、
|
|
89
89
|
* 事件、会话;`describeAuthFile` 只给 `{ kind: "oauth", flavor, plan, expiresIn, needsLogin }`。
|
|
90
90
|
*/
|
|
91
91
|
export interface OAuthAuthEntry {
|
package/dist/config/types-w6.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* 第六波配置键的形状(docs/wave6-plan.md §7、§1.3、§3.1、§4.3、§4.4、§5.2)。[W6-C0] 契约文件:C0 只定形状、
|
|
2
|
+
* 第六波配置键的形状(docs/history/wave6-plan.md §7、§1.3、§3.1、§4.3、§4.4、§5.2)。[W6-C0] 契约文件:C0 只定形状、
|
|
3
3
|
* 校验(schema-w6.ts)、说明与缺省(key-docs.ts)、JSON Schema;行为由各批次实现,未实现前这些键被接受但不起作用。
|
|
4
4
|
*
|
|
5
5
|
* 层级(merge.ts):项目级可设 `ui.language`、`ui.agentBar`,`memory` 只接受 `enabled: false`;`ui.replyLanguage`、
|
package/dist/config/types.d.ts
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* hooks.json 的形状是 `HookConfig`(hooks/types.ts)。
|
|
8
8
|
* (W3-C0)第三波:`cache` 段(§1.12,只认用户级 / profile);`ModelConfig` / `ModelOverride`
|
|
9
9
|
* 允许模型级 `api`(§2.3,同一中转的模型走不同协议),由 W3-B12 在注册表里生效。
|
|
10
|
-
* (W5-C0)第五波配置键(docs/wave5-plan.md §9):新段的形状在 types-w5.ts(`AmaConfigW5` 并入
|
|
10
|
+
* (W5-C0)第五波配置键(docs/history/wave5-plan.md §9):新段的形状在 types-w5.ts(`AmaConfigW5` 并入
|
|
11
11
|
* `AmaConfig`),已有段加 `ui.statusLine`、`compaction.prune / pruneExclude`、profile `agentDirs`。
|
|
12
12
|
*/
|
|
13
13
|
import type { WarmingMode } from "../ai/cache/types.js";
|
|
@@ -27,13 +27,13 @@ export declare const CONFIG_FILE_VERSION: 1;
|
|
|
27
27
|
*/
|
|
28
28
|
export type ModelConfig = Partial<Omit<Model, "id" | "provider" | "channel" | "channels">> & {
|
|
29
29
|
id: string;
|
|
30
|
-
/** 挂载的渠道名,第一个是首选;缺省 `defaultChannel`(docs/providers.md「渠道」)。 */
|
|
30
|
+
/** 挂载的渠道名,第一个是首选;缺省 `defaultChannel`(docs/guides/providers.md「渠道」)。 */
|
|
31
31
|
channels?: string[];
|
|
32
32
|
/** models.dev 条目 `provider/model`(显式匹配);false 关闭 models.dev 补全。 */
|
|
33
33
|
modelsDev?: string | false;
|
|
34
34
|
/**
|
|
35
35
|
* [ME-C0] 从内置目录继承模型固有属性:缺省按 id 别名自动匹配;`"provider/id"` 显式指定;false 关闭
|
|
36
|
-
* (docs/model-efficiency-plan.md D10,实现归 ME-D)。
|
|
36
|
+
* (docs/history/model-efficiency-plan.md D10,实现归 ME-D)。
|
|
37
37
|
*/
|
|
38
38
|
catalog?: string | false;
|
|
39
39
|
};
|
|
@@ -63,7 +63,7 @@ export interface ProviderConfig {
|
|
|
63
63
|
headers?: Record<string, string>;
|
|
64
64
|
compat?: ProviderCompat;
|
|
65
65
|
requiresApiKey?: boolean;
|
|
66
|
-
/** 多渠道(docs/providers.md「渠道」);不写时 `api` + `baseUrl` 是隐式的 `default` 渠道。 */
|
|
66
|
+
/** 多渠道(docs/guides/providers.md「渠道」);不写时 `api` + `baseUrl` 是隐式的 `default` 渠道。 */
|
|
67
67
|
channels?: Record<string, ChannelConfig>;
|
|
68
68
|
/** 缺省 `channels` 的第一个键。 */
|
|
69
69
|
defaultChannel?: string;
|
|
@@ -206,7 +206,7 @@ export declare const MIN_CONTEXT_BUDGET = 32768;
|
|
|
206
206
|
export declare const DEFAULT_STREAM_IDLE_TIMEOUT_MS = 180000;
|
|
207
207
|
export declare const CHECKPOINT_MODES: readonly CheckpointMode[];
|
|
208
208
|
/**
|
|
209
|
-
* 检查点(docs/rewind-plan.md §5)。环境变量 `AMA_CHECKPOINTS` 覆盖 `mode`;项目级只接受
|
|
209
|
+
* 检查点(docs/history/rewind-plan.md §5)。环境变量 `AMA_CHECKPOINTS` 覆盖 `mode`;项目级只接受
|
|
210
210
|
* `mode: "off"` 与调小 `maxFileBytes`(只能收紧)。
|
|
211
211
|
*/
|
|
212
212
|
export interface CheckpointsConfig {
|
|
@@ -222,7 +222,7 @@ export declare const SANDBOX_ENABLED_MODES: readonly ("auto" | "off")[];
|
|
|
222
222
|
/** [S2] `sandbox.network` 的取值。 */
|
|
223
223
|
export declare const SANDBOX_NETWORK_MODES: readonly ("deny" | "allow")[];
|
|
224
224
|
/**
|
|
225
|
-
* 操作系统级沙箱(docs/sandbox.md)。只认用户级 / profile;项目级只接受收紧的 `network: "deny"`,其余忽略
|
|
225
|
+
* 操作系统级沙箱(docs/guides/sandbox.md)。只认用户级 / profile;项目级只接受收紧的 `network: "deny"`,其余忽略
|
|
226
226
|
* 并 warning。环境变量 `AMA_SANDBOX=off` 覆盖 `enabled`。
|
|
227
227
|
*/
|
|
228
228
|
export interface SandboxConfig {
|
package/dist/config/types.js
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* hooks.json 的形状是 `HookConfig`(hooks/types.ts)。
|
|
8
8
|
* (W3-C0)第三波:`cache` 段(§1.12,只认用户级 / profile);`ModelConfig` / `ModelOverride`
|
|
9
9
|
* 允许模型级 `api`(§2.3,同一中转的模型走不同协议),由 W3-B12 在注册表里生效。
|
|
10
|
-
* (W5-C0)第五波配置键(docs/wave5-plan.md §9):新段的形状在 types-w5.ts(`AmaConfigW5` 并入
|
|
10
|
+
* (W5-C0)第五波配置键(docs/history/wave5-plan.md §9):新段的形状在 types-w5.ts(`AmaConfigW5` 并入
|
|
11
11
|
* `AmaConfig`),已有段加 `ui.statusLine`、`compaction.prune / pruneExclude`、profile `agentDirs`。
|
|
12
12
|
*/
|
|
13
13
|
export { AGENT_BAR_MODES, CHATGPT_FLAVORS, LANGUAGE_SETTINGS, MEMORY_SCOPES, MEMORY_SUBAGENT_MODES, apiKeyEntry, isOAuthEntry, } from "./types-w6.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* AcpDriver:经 ACP 驱动外部 Agent(docs/wave5-plan.md §5.1–§5.2,D14)。[W5-E]
|
|
2
|
+
* AcpDriver:经 ACP 驱动外部 Agent(docs/history/wave5-plan.md §5.1–§5.2,D14)。[W5-E]
|
|
3
3
|
*
|
|
4
4
|
* open:起进程 → `initialize` → 续聊优先 `session/resume`(不回放),其次 `session/load`
|
|
5
5
|
* (回放的历史通知在 open 期间丢弃),都不支持则新开并发 notice「已新开」→ 按 ama 模式
|
|
@@ -19,16 +19,36 @@ import { type DriverDeps } from "../base.js";
|
|
|
19
19
|
import type { CatalogCandidate } from "../catalog.js";
|
|
20
20
|
import { TurnCollector } from "../turn.js";
|
|
21
21
|
import type { AgentDriver, DriverOpenOptions, DriverProbe, DriverSession } from "../types.js";
|
|
22
|
-
import { type AcpAuthMethod, type AcpContentBlock, type AcpSessionConfigOption, type AcpSessionModeState, type AcpSessionUpdate } from "./types.js";
|
|
22
|
+
import { type AcpAuthMethod, type AcpContentBlock, type AcpPromptUsage, type AcpSessionConfigOption, type AcpSessionModeState, type AcpSessionUpdate } from "./types.js";
|
|
23
23
|
export declare function toAcpContent(blocks: readonly ContentBlock[], images: boolean): AcpContentBlock[];
|
|
24
24
|
/** session/update → DriverEvent(用户消息回放、命令表等忽略)。 */
|
|
25
25
|
export declare function pushAcpUpdate(update: AcpSessionUpdate, turn: TurnCollector): void;
|
|
26
|
+
type TurnUsage = {
|
|
27
|
+
input?: number;
|
|
28
|
+
output?: number;
|
|
29
|
+
cacheRead?: number;
|
|
30
|
+
};
|
|
31
|
+
/**
|
|
32
|
+
* `session/prompt` 答复的 usage → 本回合用量(ama 口径:input 不含缓存命中)。
|
|
33
|
+
* - `previous`:Agent 报的是会话累计(如 Copilot)时,上一回合的原始累计值,相减得本回合;
|
|
34
|
+
* - 有 `totalTokens` 且它等于 input + output 时,input 含缓存命中部分,减去 cachedRead。
|
|
35
|
+
*/
|
|
36
|
+
export declare function acpTurnUsage(usage: AcpPromptUsage, previous?: AcpPromptUsage): TurnUsage;
|
|
26
37
|
/** ama 模式 → 该 Agent 的模式 id(显式映射 > 同名)。 */
|
|
27
38
|
export declare function pickModeId(mode: PermissionMode, candidate: CatalogCandidate, state: AcpSessionModeState | null | undefined): string | undefined;
|
|
28
39
|
/** `configOptions` 里 category `mode` 的选择项(没有 `modes` 的 Agent 用它表达模式)。 */
|
|
29
40
|
export declare function modeConfigOption(options: readonly AcpSessionConfigOption[] | null | undefined): AcpSessionConfigOption | undefined;
|
|
30
41
|
/** 与 {@link pickModeId} 同一映射,在 mode 类配置项的可选值里找(分组的展开)。 */
|
|
31
42
|
export declare function pickConfigModeValue(mode: PermissionMode, candidate: CatalogCandidate, option: AcpSessionConfigOption | undefined): string | undefined;
|
|
43
|
+
/**
|
|
44
|
+
* `agents.<id>.model` / task 的 `model` → configOptions 里 category `model` 的可选值:先精确匹配值,
|
|
45
|
+
* 再不分大小写匹配值或名称,最后匹配 `provider/model` 的模型部分。没有就返回 undefined(用 Agent 的缺省)。
|
|
46
|
+
*/
|
|
47
|
+
export declare function pickModelValue(model: string, options: readonly AcpSessionConfigOption[] | null | undefined): {
|
|
48
|
+
configId: string;
|
|
49
|
+
value: string;
|
|
50
|
+
current: boolean;
|
|
51
|
+
} | undefined;
|
|
32
52
|
/** 开会话回 -32000 → `agent_auth_required`,列出 `initialize` 给的认证方法。 */
|
|
33
53
|
export declare function authRequiredError(agentId: string, methods: readonly AcpAuthMethod[], command: readonly string[], cause: unknown): AmaError;
|
|
34
54
|
export declare class AcpDriver implements AgentDriver {
|
|
@@ -40,3 +60,4 @@ export declare class AcpDriver implements AgentDriver {
|
|
|
40
60
|
probe(): Promise<DriverProbe>;
|
|
41
61
|
open(options: DriverOpenOptions): Promise<DriverSession>;
|
|
42
62
|
}
|
|
63
|
+
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* AcpDriver:经 ACP 驱动外部 Agent(docs/wave5-plan.md §5.1–§5.2,D14)。[W5-E]
|
|
2
|
+
* AcpDriver:经 ACP 驱动外部 Agent(docs/history/wave5-plan.md §5.1–§5.2,D14)。[W5-E]
|
|
3
3
|
*
|
|
4
4
|
* open:起进程 → `initialize` → 续聊优先 `session/resume`(不回放),其次 `session/load`
|
|
5
5
|
* (回放的历史通知在 open 期间丢弃),都不支持则新开并发 notice「已新开」→ 按 ama 模式
|
|
@@ -90,6 +90,34 @@ export function pushAcpUpdate(update, turn) {
|
|
|
90
90
|
return;
|
|
91
91
|
}
|
|
92
92
|
}
|
|
93
|
+
/**
|
|
94
|
+
* `session/prompt` 答复的 usage → 本回合用量(ama 口径:input 不含缓存命中)。
|
|
95
|
+
* - `previous`:Agent 报的是会话累计(如 Copilot)时,上一回合的原始累计值,相减得本回合;
|
|
96
|
+
* - 有 `totalTokens` 且它等于 input + output 时,input 含缓存命中部分,减去 cachedRead。
|
|
97
|
+
*/
|
|
98
|
+
export function acpTurnUsage(usage, previous) {
|
|
99
|
+
const diff = (key) => {
|
|
100
|
+
const now = usage[key];
|
|
101
|
+
if (now === undefined)
|
|
102
|
+
return undefined;
|
|
103
|
+
return previous === undefined ? now : Math.max(0, now - (previous[key] ?? 0));
|
|
104
|
+
};
|
|
105
|
+
const input = diff("inputTokens");
|
|
106
|
+
const output = diff("outputTokens");
|
|
107
|
+
const cacheRead = diff("cachedReadTokens");
|
|
108
|
+
const { totalTokens: total, inputTokens: rawIn = 0, outputTokens: rawOut = 0 } = usage;
|
|
109
|
+
const cached = usage.cachedReadTokens ?? 0;
|
|
110
|
+
const includesCache = total !== undefined &&
|
|
111
|
+
cached > 0 &&
|
|
112
|
+
Math.abs(total - (rawIn + rawOut)) < Math.abs(total - (rawIn + rawOut + cached));
|
|
113
|
+
return {
|
|
114
|
+
...(input !== undefined
|
|
115
|
+
? { input: includesCache ? Math.max(0, input - (cacheRead ?? 0)) : input }
|
|
116
|
+
: {}),
|
|
117
|
+
...(output !== undefined ? { output } : {}),
|
|
118
|
+
...(cacheRead !== undefined ? { cacheRead } : {}),
|
|
119
|
+
};
|
|
120
|
+
}
|
|
93
121
|
/** ama 模式在 Agent 那边想要的模式 id,按优先级(显式映射 > 同名)。 */
|
|
94
122
|
function wantedModeIds(mode, candidate) {
|
|
95
123
|
const wanted = [candidate.modes?.[mode] ?? mode];
|
|
@@ -113,6 +141,23 @@ export function pickConfigModeValue(mode, candidate, option) {
|
|
|
113
141
|
const values = option.options.flatMap((o) => "options" in o ? o.options.map((x) => x.value) : [o.value]);
|
|
114
142
|
return wantedModeIds(mode, candidate).find((id) => values.includes(id));
|
|
115
143
|
}
|
|
144
|
+
/**
|
|
145
|
+
* `agents.<id>.model` / task 的 `model` → configOptions 里 category `model` 的可选值:先精确匹配值,
|
|
146
|
+
* 再不分大小写匹配值或名称,最后匹配 `provider/model` 的模型部分。没有就返回 undefined(用 Agent 的缺省)。
|
|
147
|
+
*/
|
|
148
|
+
export function pickModelValue(model, options) {
|
|
149
|
+
const option = options?.find((o) => o.category === "model" && o.type === "select");
|
|
150
|
+
if (option === undefined)
|
|
151
|
+
return undefined;
|
|
152
|
+
const values = option.options.flatMap((o) => ("options" in o ? o.options : [o]));
|
|
153
|
+
const lower = model.toLowerCase();
|
|
154
|
+
const hit = values.find((v) => v.value === model) ??
|
|
155
|
+
values.find((v) => v.value.toLowerCase() === lower || v.name.toLowerCase() === lower) ??
|
|
156
|
+
values.find((v) => v.value.toLowerCase().split("/").at(-1) === lower);
|
|
157
|
+
return hit === undefined
|
|
158
|
+
? undefined
|
|
159
|
+
: { configId: option.id, value: hit.value, current: option.currentValue === hit.value };
|
|
160
|
+
}
|
|
116
161
|
/** 一条认证方法给人看的样子:terminal 型附上要在终端里跑的命令。 */
|
|
117
162
|
function authMethodText(method, command) {
|
|
118
163
|
if (method.type !== "terminal")
|
|
@@ -181,6 +226,9 @@ class AcpDriverSession {
|
|
|
181
226
|
notices = [];
|
|
182
227
|
/** 本回合已发过 cancel。 */
|
|
183
228
|
cancelling = false;
|
|
229
|
+
/** Agent 的 usage 是会话累计时,上一回合的原始值({@link acpTurnUsage})。 */
|
|
230
|
+
usageTotals;
|
|
231
|
+
cumulativeUsage = false;
|
|
184
232
|
constructor(agentId, transport, deps) {
|
|
185
233
|
this.agentId = agentId;
|
|
186
234
|
this.transport = transport;
|
|
@@ -200,6 +248,7 @@ class AcpDriverSession {
|
|
|
200
248
|
onProtocolError: (_line, reason) => this.deps.log?.("debug", `${this.agentId}: ${reason}`),
|
|
201
249
|
});
|
|
202
250
|
const signal = options.signal;
|
|
251
|
+
this.cumulativeUsage = candidate.acpUsage === "session";
|
|
203
252
|
await this.client.initialize(signal);
|
|
204
253
|
let opened;
|
|
205
254
|
try {
|
|
@@ -228,6 +277,13 @@ class AcpDriverSession {
|
|
|
228
277
|
else if (modes != null || modeOption !== undefined) {
|
|
229
278
|
this.notices.push(msg().drivers.agent.noMatchingMode(this.agentId, options.mode));
|
|
230
279
|
}
|
|
280
|
+
if (options.model !== undefined) {
|
|
281
|
+
const model = pickModelValue(options.model, opened.configOptions);
|
|
282
|
+
if (model === undefined)
|
|
283
|
+
this.notices.push(msg().drivers.agent.noMatchingModel(this.agentId, options.model));
|
|
284
|
+
else if (!model.current)
|
|
285
|
+
await this.client.setConfigOption(this.id, model.configId, model.value);
|
|
286
|
+
}
|
|
231
287
|
}
|
|
232
288
|
/** 续聊优先 resume(不回放),其次 load(回放丢弃),都不行就新开;设好 `this.id`。 */
|
|
233
289
|
async openSession(options) {
|
|
@@ -291,11 +347,9 @@ class AcpDriverSession {
|
|
|
291
347
|
});
|
|
292
348
|
const usage = result.usage;
|
|
293
349
|
if (usage != null) {
|
|
294
|
-
turn.mergeUsage({
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
...(usage.cachedReadTokens !== undefined ? { cacheRead: usage.cachedReadTokens } : {}),
|
|
298
|
-
});
|
|
350
|
+
turn.mergeUsage(acpTurnUsage(usage, this.cumulativeUsage ? (this.usageTotals ?? {}) : undefined));
|
|
351
|
+
if (this.cumulativeUsage)
|
|
352
|
+
this.usageTotals = usage;
|
|
299
353
|
}
|
|
300
354
|
return turn.result(result.stopReason);
|
|
301
355
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* ACP(Agent Client Protocol)v1 的子集类型(docs/wave5-plan.md §5.1,D14)。[W5-E]
|
|
2
|
+
* ACP(Agent Client Protocol)v1 的子集类型(docs/history/wave5-plan.md §5.1,D14)。[W5-E]
|
|
3
3
|
*
|
|
4
4
|
* 手写、零依赖;只收 ama 作为客户端(驱动外部 Agent)与服务端(`ama --mode acp`)两侧用到的部分:
|
|
5
5
|
* `initialize`、`authenticate`、`session/new|load|resume|list|close`、`session/prompt|cancel|set_mode|set_config_option`、
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* ACP(Agent Client Protocol)v1 的子集类型(docs/wave5-plan.md §5.1,D14)。[W5-E]
|
|
2
|
+
* ACP(Agent Client Protocol)v1 的子集类型(docs/history/wave5-plan.md §5.1,D14)。[W5-E]
|
|
3
3
|
*
|
|
4
4
|
* 手写、零依赖;只收 ama 作为客户端(驱动外部 Agent)与服务端(`ama --mode acp`)两侧用到的部分:
|
|
5
5
|
* `initialize`、`authenticate`、`session/new|load|resume|list|close`、`session/prompt|cancel|set_mode|set_config_option`、
|
package/dist/drivers/agents.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* 外部 Agent 的入口(W5-G 的 `task(agent=…)` 经它拿 runner,docs/wave5-plan.md §5.5、§7.6、D13、D17)。[W5-E]
|
|
2
|
+
* 外部 Agent 的入口(W5-G 的 `task(agent=…)` 经它拿 runner,docs/history/wave5-plan.md §5.5、§7.6、D13、D17)。[W5-E]
|
|
3
3
|
*
|
|
4
4
|
* - `resolve("claude" | "codex" | "acp:<program>" | 表里的 id)` → {@link ProcessRunner}(按驱动表候选链,
|
|
5
5
|
* 每次 `start` 时按模式与安装情况选驱动);同一 spec 复用同一个 runner。
|
package/dist/drivers/agents.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* 外部 Agent 的入口(W5-G 的 `task(agent=…)` 经它拿 runner,docs/wave5-plan.md §5.5、§7.6、D13、D17)。[W5-E]
|
|
2
|
+
* 外部 Agent 的入口(W5-G 的 `task(agent=…)` 经它拿 runner,docs/history/wave5-plan.md §5.5、§7.6、D13、D17)。[W5-E]
|
|
3
3
|
*
|
|
4
4
|
* - `resolve("claude" | "codex" | "acp:<program>" | 表里的 id)` → {@link ProcessRunner}(按驱动表候选链,
|
|
5
5
|
* 每次 `start` 时按模式与安装情况选驱动);同一 spec 复用同一个 runner。
|
|
@@ -17,6 +17,7 @@ import { HostRunnerRegistry } from "./host-runners.js";
|
|
|
17
17
|
import { ClaudeStreamDriver } from "./native/claude-stream.js";
|
|
18
18
|
import { CodexAppServerDriver } from "./native/codex-app-server.js";
|
|
19
19
|
import { OneshotDriver } from "./native/oneshot.js";
|
|
20
|
+
import { PiRpcDriver } from "./native/pi-rpc.js";
|
|
20
21
|
import { PidRegistry, pidsFile } from "./pids.js";
|
|
21
22
|
import { poolFromConfig } from "./pool.js";
|
|
22
23
|
import { ProgramProbe } from "./probe.js";
|
|
@@ -33,6 +34,8 @@ export function createDriver(agentId, candidate, deps) {
|
|
|
33
34
|
return new ClaudeStreamDriver(agentId, candidate, deps);
|
|
34
35
|
case "codex-app-server":
|
|
35
36
|
return new CodexAppServerDriver(agentId, candidate, deps);
|
|
37
|
+
case "pi-rpc":
|
|
38
|
+
return new PiRpcDriver(agentId, candidate, deps);
|
|
36
39
|
case "oneshot":
|
|
37
40
|
return new OneshotDriver(agentId, candidate, deps);
|
|
38
41
|
}
|
package/dist/drivers/base.d.ts
CHANGED
package/dist/drivers/base.js
CHANGED