mixdog 0.8.0 → 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +47 -23
- package/package.json +33 -27
- package/scripts/_test-folder-dialog.mjs +30 -0
- package/scripts/agent-parallel-smoke.mjs +388 -0
- package/scripts/agent-tag-reuse-smoke.mjs +183 -0
- package/scripts/background-task-meta-smoke.mjs +38 -0
- package/scripts/boot-smoke.mjs +52 -9
- package/scripts/build-runtime-linux.sh +348 -0
- package/scripts/build-runtime-macos.sh +217 -0
- package/scripts/build-runtime-windows.ps1 +242 -0
- package/scripts/compact-active-turn-test.mjs +68 -0
- package/scripts/compact-smoke.mjs +859 -129
- package/scripts/compact-trigger-migration-smoke.mjs +187 -0
- package/scripts/fix-brief-fn.mjs +35 -0
- package/scripts/fix-format-tool-surface.mjs +24 -0
- package/scripts/fix-tool-exec-visible.mjs +42 -0
- package/scripts/generate-runtime-manifest.mjs +166 -0
- package/scripts/hook-bus-test.mjs +330 -0
- package/scripts/lead-workflow-smoke.mjs +33 -39
- package/scripts/live-worker-smoke.mjs +43 -37
- package/scripts/llm-trace-summary.mjs +315 -0
- package/scripts/memory-meta-concurrency-test.mjs +20 -0
- package/scripts/output-style-smoke.mjs +56 -15
- package/scripts/parent-abort-link-test.mjs +44 -0
- package/scripts/patch-agent-brief.mjs +48 -0
- package/scripts/patch-app.mjs +21 -0
- package/scripts/patch-app2.mjs +18 -0
- package/scripts/patch-dist-brief.mjs +96 -0
- package/scripts/patch-tool-exec.mjs +70 -0
- package/scripts/pretool-ask-runtime-test.mjs +54 -0
- package/scripts/provider-toolcall-test.mjs +376 -0
- package/scripts/reactive-compact-persist-smoke.mjs +124 -0
- package/scripts/sanitize-tool-pairs-test.mjs +260 -0
- package/scripts/session-context-bench.mjs +344 -0
- package/scripts/session-ingest-smoke.mjs +177 -0
- package/scripts/set-effort-config-test.mjs +41 -0
- package/scripts/smoke-runtime-negative.ps1 +106 -0
- package/scripts/smoke-runtime-negative.sh +97 -0
- package/scripts/smoke.mjs +25 -0
- package/scripts/tool-result-hook-test.mjs +48 -0
- package/scripts/tool-smoke.mjs +1223 -95
- package/scripts/toolcall-args-test.mjs +150 -0
- package/scripts/tui-background-failure-smoke.mjs +73 -0
- package/scripts/usage-metrics-epoch-smoke.mjs +114 -0
- package/src/agents/debugger/AGENT.md +8 -0
- package/src/agents/explore/AGENT.md +4 -0
- package/src/agents/heavy-worker/AGENT.md +9 -3
- package/src/agents/maintainer/AGENT.md +4 -0
- package/src/agents/reviewer/AGENT.md +8 -0
- package/src/agents/scheduler-task/AGENT.md +12 -0
- package/src/agents/scheduler-task/agent.json +6 -0
- package/src/agents/webhook-handler/AGENT.md +12 -0
- package/src/agents/webhook-handler/agent.json +6 -0
- package/src/agents/worker/AGENT.md +9 -3
- package/src/app.mjs +77 -3
- package/src/defaults/hidden-roles.json +17 -12
- package/src/headless-role.mjs +117 -0
- package/src/help.mjs +30 -0
- package/src/hooks/lib/permission-evaluator.cjs +11 -475
- package/src/lib/keychain-cjs.cjs +9 -1
- package/src/lib/mixdog-debug.cjs +0 -7
- package/src/lib/rules-builder.cjs +240 -96
- package/src/lib/text-utils.cjs +1 -1
- package/src/mixdog-session-runtime.mjs +2325 -450
- package/src/output-styles/default.md +12 -28
- package/src/output-styles/extreme-simple.md +9 -6
- package/src/output-styles/simple.md +22 -9
- package/src/repl.mjs +118 -59
- package/src/rules/agent/00-common.md +15 -0
- package/src/rules/{bridge → agent}/20-skip-protocol.md +1 -2
- package/src/rules/agent/30-explorer.md +22 -0
- package/src/rules/{bridge → agent}/40-cycle1-agent.md +7 -0
- package/src/rules/{bridge → agent}/41-cycle2-agent.md +7 -0
- package/src/rules/{bridge → agent}/42-cycle3-agent.md +7 -0
- package/src/rules/lead/01-general.md +9 -5
- package/src/rules/lead/04-workflow.md +51 -12
- package/src/rules/lead/lead-tool.md +6 -0
- package/src/rules/shared/01-tool.md +12 -1
- package/src/runtime/agent/orchestrator/activity-bus.mjs +7 -18
- package/src/runtime/agent/orchestrator/agent-owner.mjs +11 -0
- package/src/runtime/agent/orchestrator/{smart-bridge/bridge-llm.mjs → agent-runtime/agent-dispatch.mjs} +138 -111
- package/src/runtime/agent/orchestrator/agent-runtime/agent-progress-watchdog.mjs +94 -0
- package/src/runtime/agent/orchestrator/{smart-bridge → agent-runtime}/cache-strategy.mjs +32 -23
- package/src/runtime/agent/orchestrator/{smart-bridge → agent-runtime}/session-builder.mjs +33 -27
- package/src/runtime/agent/orchestrator/{bridge-trace.mjs → agent-trace.mjs} +132 -81
- package/src/runtime/agent/orchestrator/cache-mtime.mjs +0 -21
- package/src/runtime/agent/orchestrator/config.mjs +174 -55
- package/src/runtime/agent/orchestrator/context/collect.mjs +195 -487
- package/src/runtime/agent/orchestrator/dispatch-persist.mjs +1 -1
- package/src/runtime/agent/orchestrator/internal-roles.mjs +77 -29
- package/src/runtime/agent/orchestrator/internal-tools.mjs +5 -6
- package/src/runtime/agent/orchestrator/mcp/client.mjs +15 -9
- package/src/runtime/agent/orchestrator/providers/anthropic-betas.mjs +7 -1
- package/src/runtime/agent/orchestrator/providers/anthropic-oauth.mjs +377 -243
- package/src/runtime/agent/orchestrator/providers/anthropic.mjs +146 -93
- package/src/runtime/agent/orchestrator/providers/api-usage.mjs +236 -4
- package/src/runtime/agent/orchestrator/providers/custom-tool-wire.mjs +49 -0
- package/src/runtime/agent/orchestrator/providers/gemini.mjs +58 -13
- package/src/runtime/agent/orchestrator/providers/grok-oauth.mjs +67 -149
- package/src/runtime/agent/orchestrator/providers/media-normalization.mjs +132 -2
- package/src/runtime/agent/orchestrator/providers/model-catalog.mjs +4 -1
- package/src/runtime/agent/orchestrator/providers/oauth-credential-probes.mjs +45 -0
- package/src/runtime/agent/orchestrator/providers/oauth-usage.mjs +61 -116
- package/src/runtime/agent/orchestrator/providers/openai-compat-presets.mjs +25 -0
- package/src/runtime/agent/orchestrator/providers/openai-compat-stream.mjs +79 -255
- package/src/runtime/agent/orchestrator/providers/openai-compat.mjs +221 -70
- package/src/runtime/agent/orchestrator/providers/openai-oauth-ws.mjs +477 -147
- package/src/runtime/agent/orchestrator/providers/openai-oauth.mjs +343 -496
- package/src/runtime/agent/orchestrator/providers/openai-ws.mjs +6 -6
- package/src/runtime/agent/orchestrator/providers/registry.mjs +88 -51
- package/src/runtime/agent/orchestrator/providers/retry-classifier.mjs +31 -11
- package/src/runtime/agent/orchestrator/providers/statusline-route-meta.mjs +41 -8
- package/src/runtime/agent/orchestrator/session/cache/post-edit-marks.mjs +4 -4
- package/src/runtime/agent/orchestrator/session/cache/read-cache.mjs +1 -1
- package/src/runtime/agent/orchestrator/session/compact.mjs +1173 -267
- package/src/runtime/agent/orchestrator/session/context-utils.mjs +199 -36
- package/src/runtime/agent/orchestrator/session/loop.mjs +851 -674
- package/src/runtime/agent/orchestrator/session/manager.mjs +1593 -466
- package/src/runtime/agent/orchestrator/session/manager.reactive-persist.test.mjs +107 -0
- package/src/runtime/agent/orchestrator/session/store.mjs +291 -46
- package/src/runtime/agent/orchestrator/session/tool-result-offload.mjs +2 -2
- package/src/runtime/agent/orchestrator/stall-policy.mjs +31 -16
- package/src/runtime/agent/orchestrator/tool-loop-guard.mjs +3 -219
- package/src/runtime/agent/orchestrator/tools/bash-session.mjs +34 -7
- package/src/runtime/agent/orchestrator/tools/builtin/advisory-lock.mjs +1 -1
- package/src/runtime/agent/orchestrator/tools/builtin/arg-guard.mjs +19 -0
- package/src/runtime/agent/orchestrator/tools/builtin/bash-tool.mjs +9 -9
- package/src/runtime/agent/orchestrator/tools/builtin/builtin-tools.mjs +60 -37
- package/src/runtime/agent/orchestrator/tools/builtin/cache-layers.mjs +21 -2
- package/src/runtime/agent/orchestrator/tools/builtin/device-paths.mjs +1 -1
- package/src/runtime/agent/orchestrator/tools/builtin/diagnostics-tool.mjs +0 -7
- package/src/runtime/agent/orchestrator/tools/builtin/glob-walk.mjs +1 -3
- package/src/runtime/agent/orchestrator/tools/builtin/list-tool.mjs +36 -12
- package/src/runtime/agent/orchestrator/tools/builtin/read-args.mjs +2 -0
- package/src/runtime/agent/orchestrator/tools/builtin/read-constants.mjs +2 -2
- package/src/runtime/agent/orchestrator/tools/builtin/read-formatting.mjs +5 -12
- package/src/runtime/agent/orchestrator/tools/builtin/read-image-resize.mjs +1 -1
- package/src/runtime/agent/orchestrator/tools/builtin/read-single-tool.mjs +4 -36
- package/src/runtime/agent/orchestrator/tools/builtin/read-tool.mjs +2 -40
- package/src/runtime/agent/orchestrator/tools/builtin/rg-runner.mjs +148 -27
- package/src/runtime/agent/orchestrator/tools/builtin/search-builders.mjs +2 -2
- package/src/runtime/agent/orchestrator/tools/builtin/search-tool.mjs +43 -75
- package/src/runtime/agent/orchestrator/tools/builtin/shell-jobs.mjs +90 -20
- package/src/runtime/agent/orchestrator/tools/builtin/snapshot-store.mjs +1 -1
- package/src/runtime/agent/orchestrator/tools/builtin.mjs +59 -5
- package/src/runtime/agent/orchestrator/tools/code-graph-state.mjs +86 -0
- package/src/runtime/agent/orchestrator/tools/code-graph-tool-defs.mjs +11 -11
- package/src/runtime/agent/orchestrator/tools/code-graph.mjs +4106 -4019
- package/src/runtime/agent/orchestrator/tools/patch-tool-defs.mjs +33 -4
- package/src/runtime/agent/orchestrator/tools/patch.mjs +90 -6
- package/src/runtime/agent/orchestrator/tools/progress-message.mjs +6 -4
- package/src/runtime/agent/orchestrator/tools/result-compression.mjs +4 -4
- package/src/runtime/agent/orchestrator/tools/shell-command.mjs +8 -1
- package/src/runtime/agent/orchestrator/tools/shell-snapshot.mjs +4 -4
- package/src/runtime/channels/index.mjs +152 -24
- package/src/runtime/channels/lib/scheduler.mjs +18 -14
- package/src/runtime/channels/lib/session-discovery.mjs +3 -2
- package/src/runtime/channels/lib/tool-format.mjs +0 -2
- package/src/runtime/channels/lib/transcript-discovery.mjs +3 -2
- package/src/runtime/channels/lib/webhook.mjs +1 -1
- package/src/runtime/channels/tool-defs.mjs +29 -29
- package/src/runtime/memory/index.mjs +635 -107
- package/src/runtime/memory/lib/agent-ipc.mjs +29 -12
- package/src/runtime/memory/lib/core-memory-store.mjs +2 -2
- package/src/runtime/memory/lib/embedding-model-config.mjs +55 -0
- package/src/runtime/memory/lib/embedding-provider.mjs +31 -4
- package/src/runtime/memory/lib/embedding-worker.mjs +19 -10
- package/src/runtime/memory/lib/memory-cycle1.mjs +38 -17
- package/src/runtime/memory/lib/memory-cycle2.mjs +6 -7
- package/src/runtime/memory/lib/memory-cycle3.mjs +4 -4
- package/src/runtime/memory/lib/memory-ops-policy.mjs +2 -1
- package/src/runtime/memory/lib/memory-session-merge.mjs +38 -0
- package/src/runtime/memory/lib/memory.mjs +88 -9
- package/src/runtime/memory/lib/model-profile.mjs +1 -1
- package/src/runtime/memory/lib/pg/adapter.mjs +15 -1
- package/src/runtime/memory/lib/pg/supervisor.mjs +12 -0
- package/src/runtime/memory/lib/runtime-fetcher.mjs +37 -3
- package/src/runtime/memory/lib/session-ingest.mjs +194 -0
- package/src/runtime/memory/lib/trace-store.mjs +96 -51
- package/src/runtime/memory/tool-defs.mjs +46 -37
- package/src/runtime/search/index.mjs +102 -466
- package/src/runtime/search/lib/web-tools.mjs +45 -25
- package/src/runtime/search/tool-defs.mjs +16 -23
- package/src/runtime/shared/abort-controller.mjs +1 -1
- package/src/runtime/shared/atomic-file.mjs +4 -3
- package/src/runtime/shared/background-tasks.mjs +122 -11
- package/src/runtime/shared/child-spawn-gate.mjs +145 -0
- package/src/runtime/shared/config.mjs +7 -4
- package/src/runtime/shared/err-text.mjs +131 -4
- package/src/runtime/shared/llm/cost.mjs +2 -2
- package/src/runtime/shared/llm/http-agent.mjs +23 -7
- package/src/runtime/shared/llm/index.mjs +34 -11
- package/src/runtime/shared/llm/usage-log.mjs +4 -4
- package/src/runtime/shared/markdown-frontmatter.mjs +56 -0
- package/src/runtime/shared/singleton-owner.mjs +104 -0
- package/src/runtime/shared/tool-execution-contract.mjs +199 -20
- package/src/runtime/shared/tool-execution-contract.test.mjs +183 -0
- package/src/runtime/shared/tool-surface.mjs +624 -98
- package/src/runtime/shared/user-data-guard.mjs +0 -2
- package/src/standalone/agent-task-status.mjs +203 -0
- package/src/standalone/agent-task-status.test.mjs +76 -0
- package/src/standalone/agent-tool.mjs +1913 -0
- package/src/standalone/channel-worker.mjs +370 -14
- package/src/standalone/explore-tool.mjs +165 -70
- package/src/standalone/folder-dialog.mjs +314 -0
- package/src/standalone/hook-bus.mjs +898 -22
- package/src/standalone/memory-runtime-proxy.mjs +320 -0
- package/src/standalone/projects.mjs +226 -0
- package/src/standalone/provider-admin.mjs +41 -24
- package/src/standalone/seeds.mjs +2 -69
- package/src/standalone/usage-dashboard.mjs +96 -8
- package/src/tui/App.jsx +4798 -2153
- package/src/tui/components/AnsiText.jsx +39 -28
- package/src/tui/components/ContextPanel.jsx +87 -29
- package/src/tui/components/Markdown.jsx +43 -77
- package/src/tui/components/MarkdownTable.jsx +9 -184
- package/src/tui/components/Message.jsx +28 -11
- package/src/tui/components/Picker.jsx +95 -56
- package/src/tui/components/PromptInput.jsx +367 -239
- package/src/tui/components/QueuedCommands.jsx +1 -1
- package/src/tui/components/SlashCommandPalette.jsx +27 -21
- package/src/tui/components/Spinner.jsx +67 -38
- package/src/tui/components/StatusLine.jsx +606 -38
- package/src/tui/components/TextEntryPanel.jsx +128 -9
- package/src/tui/components/ToolExecution.jsx +617 -368
- package/src/tui/components/TurnDone.jsx +3 -3
- package/src/tui/components/UsagePanel.jsx +3 -5
- package/src/tui/components/tool-output-format.mjs +365 -0
- package/src/tui/components/tool-output-format.test.mjs +220 -0
- package/src/tui/dist/index.mjs +8915 -2418
- package/src/tui/engine-runtime-notification.test.mjs +115 -0
- package/src/tui/engine-tool-result-text.test.mjs +75 -0
- package/src/tui/engine.mjs +1455 -279
- package/src/tui/figures.mjs +21 -40
- package/src/tui/index.jsx +75 -31
- package/src/tui/input-editing.mjs +25 -0
- package/src/tui/markdown/format-token.mjs +511 -68
- package/src/tui/markdown/format-token.test.mjs +216 -0
- package/src/tui/markdown/render-ansi.mjs +94 -0
- package/src/tui/markdown/render-ansi.test.mjs +108 -0
- package/src/tui/markdown/stream-fence.mjs +34 -0
- package/src/tui/markdown/stream-fence.test.mjs +26 -0
- package/src/tui/markdown/table-layout.mjs +250 -0
- package/src/tui/paste-attachments.mjs +0 -7
- package/src/tui/spinner-verbs.mjs +1 -2
- package/src/tui/statusline-ansi-bridge.mjs +172 -0
- package/src/tui/statusline-ansi-bridge.test.mjs +159 -0
- package/src/tui/theme.mjs +746 -24
- package/src/tui/time-format.mjs +1 -1
- package/src/tui/transcript-tool-failures.mjs +67 -0
- package/src/tui/transcript-tool-failures.test.mjs +111 -0
- package/src/ui/ansi.mjs +1 -2
- package/src/ui/markdown.mjs +85 -26
- package/src/ui/markdown.test.mjs +70 -0
- package/src/ui/model-display.mjs +121 -0
- package/src/ui/session-stats.mjs +44 -0
- package/src/ui/statusline-context-label.test.mjs +15 -0
- package/src/ui/statusline.mjs +386 -178
- package/src/ui/tool-card.mjs +3 -16
- package/src/vendor/statusline/bin/statusline-lib.mjs +8 -4
- package/src/vendor/statusline/bin/statusline-route.mjs +169 -37
- package/src/vendor/statusline/bin/statusline-route.test.mjs +80 -0
- package/src/vendor/statusline/scripts/lib/gateway-settings.mjs +3 -3
- package/src/vendor/statusline/src/gateway/claude-current.mjs +1 -1
- package/src/vendor/statusline/src/gateway/route-meta.mjs +44 -6
- package/src/vendor/statusline/src/gateway/session-routes.mjs +1 -1
- package/src/workflows/default/WORKFLOW.md +12 -5
- package/src/workflows/default/workflow.json +0 -1
- package/src/workflows/solo/WORKFLOW.md +15 -0
- package/src/workflows/solo/workflow.json +7 -0
- package/vendor/ink/build/output.js +6 -1
- package/src/agents/scheduler-task.md +0 -3
- package/src/agents/web-researcher/AGENT.md +0 -3
- package/src/agents/web-researcher/agent.json +0 -6
- package/src/agents/webhook-handler.md +0 -3
- package/src/rules/bridge/00-common.md +0 -5
- package/src/rules/bridge/30-explorer.md +0 -4
- package/src/rules/lead/00-tool-lead.md +0 -5
- package/src/rules/shared/00-language.md +0 -3
- package/src/runtime/agent/orchestrator/tools/builtin/native-edit-runner.mjs +0 -110
- package/src/runtime/agent/orchestrator/tools/mutation-content-cache.mjs +0 -67
- package/src/runtime/memory/lib/bridge-trace-queries.mjs +0 -120
- package/src/runtime/shared/llm/pid-cleanup.mjs +0 -27
- package/src/standalone/bridge-tool.mjs +0 -1414
- package/src/tui/runtime/shared/process-shutdown.mjs +0 -1
|
@@ -1,38 +1,22 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: default
|
|
3
|
-
|
|
3
|
+
title: Summary
|
|
4
|
+
description: Concise engineering summaries
|
|
4
5
|
keep-coding-instructions: true
|
|
5
6
|
---
|
|
6
7
|
|
|
7
8
|
# Output Style
|
|
8
9
|
|
|
9
|
-
|
|
10
|
-
Uniformity beats local cleverness.
|
|
10
|
+
Mixdog default — concise engineering summaries.
|
|
11
11
|
|
|
12
|
-
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
-
|
|
18
|
-
|
|
19
|
-
-
|
|
20
|
-
|
|
21
|
-
- Keep the same shape for the same task type: explanation = one sentence;
|
|
22
|
-
implementation = changed + verified in one sentence; diagnosis = cause +
|
|
23
|
-
evidence + fix in one sentence.
|
|
24
|
-
- No report headings/labels, nested bullets, tables, numbered lists, tool traces,
|
|
25
|
-
searched-path lists, agent/model/session metadata, timings, or token counts
|
|
26
|
-
unless user asks or it is decisive evidence.
|
|
27
|
-
- Do not use label prefixes such as `Changed:`, `Verified:`, `변경:`, `검증:`,
|
|
28
|
-
`원인:`, or `결론:`. Use plain clauses instead.
|
|
29
|
-
- Bridge/agent results: synthesize outcome; never forward full report.
|
|
30
|
-
- Explore/retrieval results are evidence only; do not paste their bullets or file
|
|
31
|
-
lists into the answer unless the user explicitly asked for candidates/details.
|
|
12
|
+
- Lead with the outcome plus a single decisive piece of evidence: a path,
|
|
13
|
+
command, error, or verification result. Drop everything non-essential.
|
|
14
|
+
- Use labels such as `바뀐 점`, `확인한 것`, and `남은 리스크/다음 단계`
|
|
15
|
+
only in final reports; do not add titles/labels to interim progress text.
|
|
16
|
+
- Collapse trivial tasks to a single short sentence.
|
|
17
|
+
- Synthesize agent or retrieval results; never forward raw reports, long file
|
|
18
|
+
lists, tool traces, or session metadata.
|
|
19
|
+
- Do not hide blockers, failed verification, or required follow-up; surface them
|
|
20
|
+
in one short clause rather than omitting them.
|
|
32
21
|
- Keep paths, commands, symbols, API names, code, and exact errors verbatim.
|
|
33
|
-
Localize prose only.
|
|
34
|
-
- Quote only the shortest decisive error. No raw logs or long file lists unless
|
|
35
|
-
asked.
|
|
36
|
-
- Relax compression for security, destructive actions, ambiguity, or user
|
|
37
|
-
confusion.
|
|
38
22
|
- Never name this style unless asked.
|
|
@@ -8,10 +8,13 @@ keep-coding-instructions: true
|
|
|
8
8
|
|
|
9
9
|
# Output Style
|
|
10
10
|
|
|
11
|
-
Extreme
|
|
11
|
+
Extreme — one ultra-short completion sentence. The most minimal of the styles.
|
|
12
12
|
|
|
13
|
-
- Reply with
|
|
14
|
-
- Preferred
|
|
15
|
-
- If verification was not run, use one short sentence
|
|
16
|
-
|
|
17
|
-
-
|
|
13
|
+
- Reply with a single completion sentence whenever possible.
|
|
14
|
+
- Preferred pattern: `<target> 변경되었습니다. <verification> 통과 완료입니다.`
|
|
15
|
+
- If verification was not run, use one short sentence saying the change is done
|
|
16
|
+
and verification was not run.
|
|
17
|
+
- No headings, bullets, labels, explanations, tool traces, or metadata unless
|
|
18
|
+
the user explicitly asks.
|
|
19
|
+
- Preserve only the single decisive path, command, symbol, API name, code, or
|
|
20
|
+
error verbatim.
|
|
@@ -1,17 +1,30 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: simple
|
|
3
|
-
title:
|
|
4
|
-
description:
|
|
3
|
+
title: Practical Concise
|
|
4
|
+
description: Outcome-first concise handoffs for coding work
|
|
5
|
+
aliases: summary, concise, handoff
|
|
5
6
|
keep-coding-instructions: true
|
|
6
7
|
---
|
|
7
8
|
|
|
8
9
|
# Output Style
|
|
9
10
|
|
|
10
|
-
|
|
11
|
+
Practical concise — outcome-first handoffs for coding work without report bloat.
|
|
11
12
|
|
|
12
|
-
-
|
|
13
|
-
-
|
|
14
|
-
|
|
15
|
-
-
|
|
16
|
-
-
|
|
17
|
-
|
|
13
|
+
- Open with the outcome in one sentence: done, blocked, or awaiting a decision.
|
|
14
|
+
- Add only high-signal evidence next: changed paths (use `file_path:line_number`
|
|
15
|
+
when it helps navigation), commands, lint/test results, or the exact error —
|
|
16
|
+
not step-by-step narration.
|
|
17
|
+
- Keep controlled detail: usually 1–3 short bullets or 2–4 sentences total.
|
|
18
|
+
Expand only when the user asks, scope is ambiguous, or a blocker needs concrete
|
|
19
|
+
next steps.
|
|
20
|
+
- On final handoffs, optional labels such as `바뀐 점`, `확인한 것`, and
|
|
21
|
+
`남은 리스크/다음 단계` fit Korean-facing profiles; use plain English labels
|
|
22
|
+
when the thread is English. Do not label interim progress.
|
|
23
|
+
- Synthesize agent or retrieval results; never forward raw reports, long file
|
|
24
|
+
lists, tool traces, or session metadata.
|
|
25
|
+
- Do not hide blockers, failed verification, or required follow-up; state them
|
|
26
|
+
in one short clause.
|
|
27
|
+
- Keep paths, commands, symbols, API names, code, and exact errors verbatim.
|
|
28
|
+
- Skip filler, acknowledgments, and repeated conclusions; if verification was
|
|
29
|
+
not run, say so once.
|
|
30
|
+
- Never name this style unless asked.
|
package/src/repl.mjs
CHANGED
|
@@ -25,37 +25,42 @@ import { stdin, stdout } from 'node:process';
|
|
|
25
25
|
import { basename } from 'node:path';
|
|
26
26
|
|
|
27
27
|
import { bold, dim, cyan, green, red, yellow, colorEnabled } from './ui/ansi.mjs';
|
|
28
|
-
import {
|
|
29
|
-
import {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
'
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
export function printHelp(write = (s) => stdout.write(s)) {
|
|
56
|
-
write(HELP_LINES.join('\n') + '\n');
|
|
28
|
+
import { printHelp } from './help.mjs';
|
|
29
|
+
import { createSessionStats, applyUsageDelta } from './ui/session-stats.mjs';
|
|
30
|
+
|
|
31
|
+
let runtimeModulePromise = null;
|
|
32
|
+
let markdownModulePromise = null;
|
|
33
|
+
let toolCardModulePromise = null;
|
|
34
|
+
let statuslineModulePromise = null;
|
|
35
|
+
let shutdownModulePromise = null;
|
|
36
|
+
|
|
37
|
+
function loadRuntimeModule() {
|
|
38
|
+
runtimeModulePromise ??= import('./mixdog-session-runtime.mjs');
|
|
39
|
+
return runtimeModulePromise;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
async function renderMarkdownLazy(text) {
|
|
43
|
+
const mod = await (markdownModulePromise ??= import('./ui/markdown.mjs'));
|
|
44
|
+
return mod.renderMarkdown(text);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
async function renderToolCardLazy(call) {
|
|
48
|
+
const mod = await (toolCardModulePromise ??= import('./ui/tool-card.mjs'));
|
|
49
|
+
return mod.renderToolCard(call);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
async function renderStatuslineLazy(opts) {
|
|
53
|
+
const mod = await (statuslineModulePromise ??= import('./ui/statusline.mjs'));
|
|
54
|
+
return mod.renderStatusline(opts);
|
|
57
55
|
}
|
|
58
56
|
|
|
57
|
+
async function loadShutdownModule() {
|
|
58
|
+
shutdownModulePromise ??= import('./runtime/shared/process-shutdown.mjs');
|
|
59
|
+
return shutdownModulePromise;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export { printHelp };
|
|
63
|
+
|
|
59
64
|
export async function runRepl({ provider: providerName, model, toolMode = 'full' } = {}) {
|
|
60
65
|
// `--help` short-circuits before any provider init so the smoke test (which
|
|
61
66
|
// invokes `src/cli.mjs --help`) gets clean help output and a 0 exit. We read
|
|
@@ -65,19 +70,44 @@ export async function runRepl({ provider: providerName, model, toolMode = 'full'
|
|
|
65
70
|
return 0;
|
|
66
71
|
}
|
|
67
72
|
|
|
68
|
-
const runtime = await createMixdogSessionRuntime({ provider: providerName, model, toolMode });
|
|
69
73
|
const stats = createSessionStats();
|
|
70
74
|
const cwd = process.cwd();
|
|
71
75
|
let rl = null;
|
|
76
|
+
let runtime = null;
|
|
77
|
+
let runtimePromise = null;
|
|
72
78
|
let closed = false;
|
|
79
|
+
|
|
80
|
+
const ensureRuntime = async () => {
|
|
81
|
+
if (closed) throw new Error('runtime closed');
|
|
82
|
+
if (runtime) return runtime;
|
|
83
|
+
if (!runtimePromise) {
|
|
84
|
+
runtimePromise = (async () => {
|
|
85
|
+
const { createMixdogSessionRuntime } = await loadRuntimeModule();
|
|
86
|
+
const next = await createMixdogSessionRuntime({ provider: providerName, model, toolMode });
|
|
87
|
+
runtime = next;
|
|
88
|
+
return next;
|
|
89
|
+
})().finally(() => {
|
|
90
|
+
runtimePromise = null;
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
const next = await runtimePromise;
|
|
94
|
+
if (closed) {
|
|
95
|
+
try { await next.close('cli-exit'); } catch {}
|
|
96
|
+
if (runtime === next) runtime = null;
|
|
97
|
+
throw new Error('runtime closed');
|
|
98
|
+
}
|
|
99
|
+
return next;
|
|
100
|
+
};
|
|
101
|
+
|
|
73
102
|
const closeRuntime = async (reason = 'cli-exit') => {
|
|
74
103
|
if (closed) return;
|
|
75
104
|
closed = true;
|
|
76
105
|
try { rl?.close(); } catch {}
|
|
77
|
-
await
|
|
106
|
+
const pendingRuntime = runtime || (runtimePromise ? await runtimePromise.catch(() => null) : null);
|
|
107
|
+
if (pendingRuntime) await pendingRuntime.close(reason);
|
|
78
108
|
};
|
|
79
109
|
|
|
80
|
-
printBanner(
|
|
110
|
+
printBanner(providerName, model, cwd, toolMode);
|
|
81
111
|
|
|
82
112
|
rl = createInterface({
|
|
83
113
|
input: stdin,
|
|
@@ -86,6 +116,7 @@ export async function runRepl({ provider: providerName, model, toolMode = 'full'
|
|
|
86
116
|
// historySize > 0 enables readline's built-in ↑/↓ recall of prior inputs.
|
|
87
117
|
historySize: 200,
|
|
88
118
|
});
|
|
119
|
+
const { installProcessSignalCleanup } = await loadShutdownModule();
|
|
89
120
|
const signalCleanup = installProcessSignalCleanup({
|
|
90
121
|
name: 'mixdog-repl',
|
|
91
122
|
timeoutMs: 6500,
|
|
@@ -110,9 +141,13 @@ export async function runRepl({ provider: providerName, model, toolMode = 'full'
|
|
|
110
141
|
if (line.startsWith('/')) {
|
|
111
142
|
const handled = await handleSlash(line, {
|
|
112
143
|
rl,
|
|
113
|
-
|
|
144
|
+
ensureRuntime,
|
|
145
|
+
getRuntime: () => runtime,
|
|
114
146
|
stats,
|
|
115
147
|
cwd,
|
|
148
|
+
providerName,
|
|
149
|
+
model,
|
|
150
|
+
toolMode,
|
|
116
151
|
closeRuntime,
|
|
117
152
|
});
|
|
118
153
|
if (handled === 'exit') {
|
|
@@ -128,11 +163,12 @@ export async function runRepl({ provider: providerName, model, toolMode = 'full'
|
|
|
128
163
|
let streamedText = '';
|
|
129
164
|
let printedAny = false;
|
|
130
165
|
try {
|
|
166
|
+
const runtime = await ensureRuntime();
|
|
131
167
|
const { result } = await runtime.ask(
|
|
132
168
|
line,
|
|
133
169
|
{
|
|
134
170
|
onToolCall: async (_iter, calls) => {
|
|
135
|
-
|
|
171
|
+
for (const c of calls || []) stdout.write('\n' + (await renderToolCardLazy(c)) + '\n');
|
|
136
172
|
},
|
|
137
173
|
onTextDelta: (chunk) => {
|
|
138
174
|
printedAny = true;
|
|
@@ -152,10 +188,10 @@ export async function runRepl({ provider: providerName, model, toolMode = 'full'
|
|
|
152
188
|
if (finalText) {
|
|
153
189
|
if (printedAny && colorEnabled()) {
|
|
154
190
|
eraseStreamedBlock(streamedText);
|
|
155
|
-
stdout.write(
|
|
191
|
+
stdout.write(await renderMarkdownLazy(finalText) + '\n');
|
|
156
192
|
} else if (!printedAny) {
|
|
157
193
|
// Nothing streamed live (provider without onTextDelta) — render once.
|
|
158
|
-
stdout.write(
|
|
194
|
+
stdout.write(await renderMarkdownLazy(finalText) + '\n');
|
|
159
195
|
} else {
|
|
160
196
|
// Non-TTY / NO_COLOR: leave the raw stream, just terminate the line.
|
|
161
197
|
stdout.write('\n');
|
|
@@ -163,7 +199,7 @@ export async function runRepl({ provider: providerName, model, toolMode = 'full'
|
|
|
163
199
|
}
|
|
164
200
|
|
|
165
201
|
// Per-turn statusline footer.
|
|
166
|
-
stdout.write('\n' + (await
|
|
202
|
+
stdout.write('\n' + (await renderStatuslineLazy({
|
|
167
203
|
provider: runtime.provider,
|
|
168
204
|
model: runtime.model,
|
|
169
205
|
cwd,
|
|
@@ -195,7 +231,9 @@ function promptText() {
|
|
|
195
231
|
|
|
196
232
|
function printBanner(providerName, model, cwd, toolMode) {
|
|
197
233
|
const title = bold('mixdog');
|
|
198
|
-
const
|
|
234
|
+
const providerLabel = providerName || 'auto';
|
|
235
|
+
const modelLabel = model || 'default';
|
|
236
|
+
const id = cyan(`${providerLabel}/${modelLabel}`);
|
|
199
237
|
stdout.write(`${title} ${dim('—')} ${id} ${dim('·')} ${dim(toolMode)} ${dim('·')} ${dim(basename(cwd))}\n`);
|
|
200
238
|
stdout.write(dim('Type a message, or /help for commands. Ctrl+C to exit.') + '\n\n');
|
|
201
239
|
}
|
|
@@ -236,63 +274,80 @@ async function handleSlash(line, ctx) {
|
|
|
236
274
|
return;
|
|
237
275
|
|
|
238
276
|
case 'clear':
|
|
239
|
-
await ctx.runtime.clear();
|
|
240
277
|
{
|
|
278
|
+
const runtime = await ctx.ensureRuntime();
|
|
279
|
+
await runtime.clear();
|
|
241
280
|
const fresh = createSessionStats();
|
|
242
281
|
for (const k of Object.keys(fresh)) ctx.stats[k] = fresh[k];
|
|
282
|
+
// Clear screen + scrollback and home the cursor.
|
|
283
|
+
stdout.write(colorEnabled() ? '\x1b[2J\x1b[3J\x1b[H' : '\n');
|
|
284
|
+
stdout.write(dim('conversation reset.') + '\n');
|
|
285
|
+
stdout.write((await renderStatuslineLazy({
|
|
286
|
+
provider: runtime.provider,
|
|
287
|
+
model: runtime.model,
|
|
288
|
+
cwd: ctx.cwd,
|
|
289
|
+
stats: ctx.stats,
|
|
290
|
+
contextWindow: runtime.contextWindow,
|
|
291
|
+
rawContextWindow: runtime.rawContextWindow,
|
|
292
|
+
})) + '\n');
|
|
243
293
|
}
|
|
244
|
-
// Clear screen + scrollback and home the cursor.
|
|
245
|
-
stdout.write(colorEnabled() ? '\x1b[2J\x1b[3J\x1b[H' : '\n');
|
|
246
|
-
stdout.write(dim('conversation reset.') + '\n');
|
|
247
|
-
stdout.write((await renderStatusline({
|
|
248
|
-
provider: ctx.runtime.provider,
|
|
249
|
-
model: ctx.runtime.model,
|
|
250
|
-
cwd: ctx.cwd,
|
|
251
|
-
stats: ctx.stats,
|
|
252
|
-
contextWindow: ctx.runtime.contextWindow,
|
|
253
|
-
rawContextWindow: ctx.runtime.rawContextWindow,
|
|
254
|
-
})) + '\n');
|
|
255
294
|
return;
|
|
256
295
|
|
|
257
296
|
case 'compact':
|
|
258
297
|
{
|
|
259
|
-
const
|
|
298
|
+
const runtime = await ctx.ensureRuntime();
|
|
299
|
+
const r = await runtime.compact();
|
|
260
300
|
if (!r) {
|
|
261
301
|
stdout.write(yellow('compact failed') + '\n');
|
|
262
302
|
return;
|
|
263
303
|
}
|
|
304
|
+
if (r.error) {
|
|
305
|
+
stdout.write(red('compact failed') + '\n');
|
|
306
|
+
return;
|
|
307
|
+
}
|
|
264
308
|
if (r.changed === false && r.reason) {
|
|
265
309
|
stdout.write(yellow(r.reason) + '\n');
|
|
266
310
|
return;
|
|
267
311
|
}
|
|
312
|
+
if (r.changed === false) {
|
|
313
|
+
stdout.write(yellow('nothing to compact') + '\n');
|
|
314
|
+
return;
|
|
315
|
+
}
|
|
268
316
|
stdout.write(green(`✓ compacted context: ${r.beforeMessages}→${r.afterMessages} messages, context ${r.beforeTokens}→${r.afterTokens}`) + '\n');
|
|
269
317
|
}
|
|
270
318
|
return;
|
|
271
319
|
|
|
272
320
|
case 'model':
|
|
273
321
|
if (!arg) {
|
|
274
|
-
|
|
322
|
+
const runtime = ctx.getRuntime?.();
|
|
323
|
+
const provider = runtime?.provider || ctx.providerName || 'auto';
|
|
324
|
+
const currentModel = runtime?.model || ctx.model || 'default';
|
|
325
|
+
stdout.write(yellow(`current model: ${provider}/${currentModel}`) + '\n');
|
|
275
326
|
stdout.write(dim('usage: /model <preset-or-model>') + '\n');
|
|
276
327
|
return;
|
|
277
328
|
}
|
|
278
|
-
|
|
279
|
-
|
|
329
|
+
{
|
|
330
|
+
const runtime = await ctx.ensureRuntime();
|
|
331
|
+
await runtime.setRoute({ model: arg });
|
|
332
|
+
stdout.write(green(`✓ model → ${runtime.provider}/${runtime.model}`) + '\n');
|
|
333
|
+
}
|
|
280
334
|
return;
|
|
281
335
|
|
|
282
336
|
case 'outputstyle':
|
|
283
337
|
case 'output-style':
|
|
284
338
|
case 'style':
|
|
285
339
|
{
|
|
340
|
+
const runtime = await ctx.ensureRuntime();
|
|
286
341
|
const lower = arg.toLowerCase();
|
|
287
342
|
if (!arg || lower === 'status' || lower === 'current' || lower === 'show') {
|
|
288
|
-
const status =
|
|
343
|
+
const status = runtime.getOutputStyle?.() || runtime.listOutputStyles?.();
|
|
289
344
|
const label = status?.current?.label || status?.current?.id || status?.configured || 'Default';
|
|
290
345
|
const available = (status?.styles || []).map((style) => style.label || style.id).join(', ');
|
|
291
346
|
stdout.write(yellow(`current output style: ${label}`) + '\n');
|
|
292
347
|
if (available) stdout.write(dim(`available: ${available}`) + '\n');
|
|
293
348
|
return;
|
|
294
349
|
}
|
|
295
|
-
const result = await
|
|
350
|
+
const result = await runtime.setOutputStyle(arg);
|
|
296
351
|
const label = result?.current?.label || result?.current?.id || arg;
|
|
297
352
|
const suffix = result?.appliedToCurrentSession === false ? ' (use /clear to apply to this chat)' : '';
|
|
298
353
|
stdout.write(green(`✓ output style → ${label}${suffix}`) + '\n');
|
|
@@ -301,12 +356,16 @@ async function handleSlash(line, ctx) {
|
|
|
301
356
|
|
|
302
357
|
case 'mode':
|
|
303
358
|
if (!arg) {
|
|
304
|
-
|
|
359
|
+
const runtime = ctx.getRuntime?.();
|
|
360
|
+
stdout.write(yellow(`current mode: ${runtime?.toolMode || ctx.toolMode}`) + '\n');
|
|
305
361
|
stdout.write(dim('usage: /mode full|readonly') + '\n');
|
|
306
362
|
return;
|
|
307
363
|
}
|
|
308
|
-
|
|
309
|
-
|
|
364
|
+
{
|
|
365
|
+
const runtime = await ctx.ensureRuntime();
|
|
366
|
+
await runtime.setToolMode(arg);
|
|
367
|
+
stdout.write(green(`✓ mode → ${runtime.toolMode}`) + '\n');
|
|
368
|
+
}
|
|
310
369
|
return;
|
|
311
370
|
|
|
312
371
|
case 'exit':
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# Agent Constraints
|
|
2
|
+
|
|
3
|
+
- Use English for agent task communication.
|
|
4
|
+
- Do not touch git/Ship. Even when the brief instructs `git add` / `commit` /
|
|
5
|
+
`push` / `stash`, refuse with `git operations deferred to Lead`.
|
|
6
|
+
- NEVER PREAMBLE. Do not generate preamble tokens, including tool-call
|
|
7
|
+
preambles, status/progress narration, "I will..." setup text, or transition
|
|
8
|
+
text before tool calls.
|
|
9
|
+
- If tools are needed, call them immediately. Emit text only for the final
|
|
10
|
+
handoff after tool work is done.
|
|
11
|
+
- Final output style: follow the role's stricter output contract when one is
|
|
12
|
+
defined; otherwise write a compact English handoff for Lead: outcome, key
|
|
13
|
+
files, verification, and only material risks. Avoid report-style headings,
|
|
14
|
+
markdown tables unless explicitly requested, long narration, raw logs, and
|
|
15
|
+
unnecessary next-checks.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Skip Protocol
|
|
2
2
|
|
|
3
|
-
For inbound-event
|
|
3
|
+
For inbound-event agent reports (`webhook-handler`, `scheduler-task`):
|
|
4
4
|
if Lead has nothing actionable to relay
|
|
5
5
|
(label-only, duplicate/dedup, no action needed, nothing to report),
|
|
6
6
|
prefix the whole response with:
|
|
@@ -8,4 +8,3 @@ prefix the whole response with:
|
|
|
8
8
|
```
|
|
9
9
|
[meta:silent]
|
|
10
10
|
```
|
|
11
|
-
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
---
|
|
2
|
+
permission: read
|
|
3
|
+
toolSchemaProfile: read
|
|
4
|
+
kind: retrieval
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Role: explorer
|
|
8
|
+
|
|
9
|
+
Locator only. Find likely file/symbol/line anchors for the query; do not
|
|
10
|
+
analyze, debug, decide, or recommend.
|
|
11
|
+
|
|
12
|
+
Output only:
|
|
13
|
+
- `path:line — symbol/name — short reason`
|
|
14
|
+
- or `EXPLORATION_FAILED`
|
|
15
|
+
|
|
16
|
+
No preambles, including tool-call preambles. No bullets, headings, summaries,
|
|
17
|
+
code quotes, verdicts, or invented coordinates; output anchor lines only.
|
|
18
|
+
Prompt queries need exact function/prompt anchors. Weak anchors: `?`.
|
|
19
|
+
|
|
20
|
+
Work fast: maximize independent read-only fan-out in every lookup turn. Once
|
|
21
|
+
credible anchors are found, you must stop; do not call another tool or
|
|
22
|
+
broaden/verify.
|
|
@@ -1,5 +1,9 @@
|
|
|
1
|
-
# General
|
|
2
|
-
|
|
3
|
-
-
|
|
4
|
-
-
|
|
5
|
-
|
|
1
|
+
# General
|
|
2
|
+
|
|
3
|
+
- Omit direct names, honorifics, headings, and labels in preambles.
|
|
4
|
+
- Preambles are optional: use them only when they add user-visible value, keep
|
|
5
|
+
them to one short sentence, and skip routine lookup narration.
|
|
6
|
+
- When you emit a preamble or other user-facing lead-in, it MUST be in the user's configured response language (see Profile Preferences).
|
|
7
|
+
- Destructive/hard-to-reverse actions require explicit confirmation.
|
|
8
|
+
- Never push, build, or deploy without an explicit user request.
|
|
9
|
+
Implementation approval is not deploy approval.
|
|
@@ -1,12 +1,51 @@
|
|
|
1
|
-
# Workflow
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
1
|
+
# Workflow
|
|
2
|
+
|
|
3
|
+
Priority:
|
|
4
|
+
- When an `# Active Workflow` block is present, it is the binding session
|
|
5
|
+
workflow and takes precedence over all other workflow guidance.
|
|
6
|
+
|
|
7
|
+
Delegation:
|
|
8
|
+
- Lead is the supervisor of agents, responsible for task delegation,
|
|
9
|
+
coordination, judgment, and final decisions.
|
|
10
|
+
- As supervisor, prefer delegating implementation work to an agent; keep direct
|
|
11
|
+
work limited to coordination and User Workflow exceptions such as
|
|
12
|
+
one-or-two-step edits, pre-planning, config changes, and final git deployment.
|
|
13
|
+
- Implementation edits to product/runtime/TUI code MUST be delegated to a
|
|
14
|
+
Worker/Heavy Worker, even when small. Lead may directly edit only rules, docs,
|
|
15
|
+
config, and final deployment/git steps, unless the user explicitly asks Lead
|
|
16
|
+
to patch directly.
|
|
17
|
+
- Delegation split: different code paths / entry points / file groups are
|
|
18
|
+
separate scopes — implementation AND analysis, review, debugging split the
|
|
19
|
+
same way. With 2+ independent scopes, spawn each scoped agent in the
|
|
20
|
+
SAME turn, not one after another. Shared functions or cross-cutting concerns
|
|
21
|
+
do NOT justify collapsing them into one delegation: split per path, and Lead
|
|
22
|
+
verifies the cross-cutting parts (shared state, telemetry consistency, etc.)
|
|
23
|
+
directly. "One agent must see the whole context" is not a valid reason to
|
|
24
|
+
merge; the only legitimate single-scope case is a genuinely inseparable
|
|
25
|
+
dependency — and then state the reason.
|
|
26
|
+
- Follow-up work on the same path or scope MUST reuse the existing agent (same
|
|
27
|
+
tag). Spawn a new agent only for a genuinely separate scope.
|
|
28
|
+
- Pick the agent role defined in the User Workflow section that fits the task
|
|
29
|
+
(worker, heavy-worker, reviewer, debugger, …) when spawning.
|
|
30
|
+
- Write agent-facing briefs and follow-up task messages in English.
|
|
31
|
+
- Agent briefs must be bounded: state the goal/success criteria, known starting
|
|
32
|
+
files or anchors if available, allowed/forbidden changes, expected
|
|
33
|
+
deliverable, and verification boundary. For heavy-worker, include known first
|
|
34
|
+
components to inspect and the stopping condition; complex work must not
|
|
35
|
+
become open-ended.
|
|
36
|
+
|
|
37
|
+
Agent lifecycle:
|
|
38
|
+
- After spawning async agent(s), END THE TURN immediately. Do not poll
|
|
39
|
+
status/read, guess the outcome, or start dependent work — treat the result as
|
|
40
|
+
unknown until the completion notification resumes you. status/read are manual
|
|
41
|
+
recovery only, never progress checks.
|
|
42
|
+
- Unless instructed otherwise, wait for the spawned agent(s); once their results
|
|
43
|
+
are collected, automatically continue with the next turn.
|
|
44
|
+
|
|
45
|
+
Agent result handling:
|
|
46
|
+
- Cross-check material agent responses before using them for decisions or
|
|
47
|
+
summarizing them to the user.
|
|
48
|
+
- When an agent returns, always synthesize its result into a concise report for
|
|
49
|
+
the user (outcome + key changes/evidence). Never forward the raw agent output.
|
|
50
|
+
- If anything here conflicts with the User Workflow section, this Workflow takes
|
|
51
|
+
precedence, except that the `# Active Workflow` block always wins.
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
# Lead Tool Use
|
|
2
|
+
|
|
3
|
+
- Lead owns repo-local shell work: git, build, test, run, and verification commands.
|
|
4
|
+
- Use the current project/workspace selected by the session. Only change the work project when the user asks for a different project or a tool call explicitly needs another project root.
|
|
5
|
+
- Use `shell` directly for approved git/build/test/run work; do not delegate those commands to agents.
|
|
6
|
+
- Use `agent` for scoped implementation, research, review, and debugging, not for git commit/push/stash or Ship.
|
|
@@ -1,3 +1,14 @@
|
|
|
1
1
|
# Tool Use
|
|
2
2
|
|
|
3
|
-
-
|
|
3
|
+
- Run independent tool calls in the same turn. Start source lookup with one
|
|
4
|
+
compact combined batch, not serial probes.
|
|
5
|
+
- Route by clue: `explore` broad unknowns, `code_graph` symbols/deps/callers,
|
|
6
|
+
`grep` exact text, `find` path/name clues, `glob` structure, `list` dirs,
|
|
7
|
+
`read` known file windows.
|
|
8
|
+
- Use available `explore` for broad/uncertain repo anchors; narrow queries.
|
|
9
|
+
- Use available `search` / `web_fetch` only for web/current external info;
|
|
10
|
+
available `recall` only for history.
|
|
11
|
+
- Fan out read-only lookup calls. Batch known independent files with `read`.
|
|
12
|
+
- If editing is available, put related multi-file edits in one `apply_patch`.
|
|
13
|
+
Do not run state-changing edits or shell alongside other tool calls.
|
|
14
|
+
- Use available `shell` only for git/build/test/run/verification, not browsing.
|