mixdog 0.9.149 → 0.9.151
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 +28 -12
- package/package.json +1 -1
- package/src/headless-exec.mjs +40 -4
- package/src/headless-exec.test.mjs +116 -1
- package/src/rules/lead/01-general.md +3 -2
- package/src/rules/shared/00-general.md +1 -0
- package/src/rules/shared/10-tool-workflow.md +11 -12
- package/src/rules/shared/30-exploration.md +4 -3
- package/src/rules/shared/60-verification.md +4 -3
- package/src/runtime/agent/orchestrator/providers/openai-codex-identity.test.mjs +0 -2
- package/src/runtime/agent/orchestrator/providers/openai-codex-metadata.mjs +1 -4
- package/src/runtime/agent/orchestrator/providers/openai-codex-model.mjs +0 -18
- package/src/runtime/agent/orchestrator/providers/openai-oauth-http-sse.mjs +0 -3
- package/src/runtime/agent/orchestrator/providers/openai-oauth-ws.mjs +0 -1
- package/src/runtime/agent/orchestrator/providers/openai-responses-payload.mjs +4 -72
- package/src/runtime/agent/orchestrator/session/approval-mode.mjs +0 -8
- package/src/runtime/agent/orchestrator/session/compact/handoff.mjs +2 -4
- package/src/runtime/agent/orchestrator/session/compact/runner.mjs +18 -33
- package/src/runtime/agent/orchestrator/session/loop/recall-fasttrack.mjs +21 -42
- package/src/runtime/agent/orchestrator/session/manager/compaction-runner.mjs +20 -125
- package/src/runtime/agent/orchestrator/session/manager/session-lifecycle.mjs +50 -8
- package/src/runtime/agent/orchestrator/session/manager/session-lifecycle.test.mjs +31 -1
- package/src/runtime/agent/orchestrator/session/store/serialize.mjs +27 -4
- package/src/runtime/agent/orchestrator/session/store/serialize.test.mjs +60 -0
- package/src/runtime/agent/orchestrator/session/task-wait-control.mjs +78 -0
- package/src/runtime/agent/orchestrator/session/task-wait-control.test.mjs +78 -0
- package/src/runtime/agent/orchestrator/tools/builtin/absence-absorption.test.mjs +43 -0
- package/src/runtime/agent/orchestrator/tools/builtin/absolute-glob-expand.test.mjs +63 -0
- package/src/runtime/agent/orchestrator/tools/builtin/arg-guard.mjs +8 -0
- package/src/runtime/agent/orchestrator/tools/builtin/atomic-write.mjs +29 -10
- package/src/runtime/agent/orchestrator/tools/builtin/builtin-tools.mjs +7 -7
- package/src/runtime/agent/orchestrator/tools/builtin/enoent-outside-project.test.mjs +56 -0
- package/src/runtime/agent/orchestrator/tools/builtin/external-tool-adapters.mjs +6 -2
- package/src/runtime/agent/orchestrator/tools/builtin/git-command-tool.mjs +50 -23
- package/src/runtime/agent/orchestrator/tools/builtin/git-command-tool.test.mjs +50 -1
- package/src/runtime/agent/orchestrator/tools/builtin/grep-output-budget.test.mjs +31 -0
- package/src/runtime/agent/orchestrator/tools/builtin/grep-single-file-rescue.test.mjs +106 -0
- package/src/runtime/agent/orchestrator/tools/builtin/lib/absolute-glob-expand.mjs +129 -0
- package/src/runtime/agent/orchestrator/tools/builtin/lib/grep-context-expander.mjs +2 -1
- package/src/runtime/agent/orchestrator/tools/builtin/lib/grep-single-file-rescue.mjs +218 -0
- package/src/runtime/agent/orchestrator/tools/builtin/lib/list-helpers.mjs +9 -2
- package/src/runtime/agent/orchestrator/tools/builtin/list-tool-integrity.test.mjs +6 -0
- package/src/runtime/agent/orchestrator/tools/builtin/list-tool.mjs +50 -2
- package/src/runtime/agent/orchestrator/tools/builtin/native-search-client.mjs +7 -1
- package/src/runtime/agent/orchestrator/tools/builtin/noise-dir-visibility.test.mjs +69 -0
- package/src/runtime/agent/orchestrator/tools/builtin/path-diagnostics.mjs +33 -6
- package/src/runtime/agent/orchestrator/tools/builtin/read-glob-survey.test.mjs +71 -0
- package/src/runtime/agent/orchestrator/tools/builtin/read-image-resize.mjs +6 -1
- package/src/runtime/agent/orchestrator/tools/builtin/read-single-tool.mjs +7 -0
- package/src/runtime/agent/orchestrator/tools/builtin/read-tool.mjs +54 -8
- package/src/runtime/agent/orchestrator/tools/builtin/runtime-capabilities.mjs +90 -51
- package/src/runtime/agent/orchestrator/tools/builtin/runtime-capabilities.test.mjs +56 -0
- package/src/runtime/agent/orchestrator/tools/builtin/search-builders.mjs +25 -0
- package/src/runtime/agent/orchestrator/tools/builtin/search-builders.test.mjs +16 -0
- package/src/runtime/agent/orchestrator/tools/builtin/search-glob-tool.mjs +30 -1
- package/src/runtime/agent/orchestrator/tools/builtin/search-grep-tool.mjs +60 -5
- package/src/runtime/agent/orchestrator/tools/builtin/search-path-diagnostics.mjs +54 -1
- package/src/runtime/agent/orchestrator/tools/builtin/task-tool.mjs +49 -24
- package/src/runtime/agent/orchestrator/tools/builtin/tool-output-limit.mjs +1 -0
- package/src/runtime/agent/orchestrator/tools/builtin/write-symlink.test.mjs +153 -0
- package/src/runtime/agent/orchestrator/tools/builtin.mjs +11 -1
- package/src/runtime/agent/orchestrator/tools/code-graph/aggregate-anchor-relocation.test.mjs +55 -0
- package/src/runtime/agent/orchestrator/tools/code-graph/dispatch.mjs +54 -3
- package/src/runtime/agent/orchestrator/tools/env-scrub.mjs +16 -0
- package/src/runtime/agent/orchestrator/tools/env-scrub.test.mjs +33 -1
- package/src/runtime/agent/orchestrator/tools/graph-manifest.json +11 -11
- package/src/runtime/agent/orchestrator/tools/lib/native-spawn-client.mjs +9 -1
- package/src/runtime/agent/orchestrator/tools/patch/dispatch.mjs +44 -10
- package/src/runtime/agent/orchestrator/tools/patch/orchestrator.mjs +57 -5
- package/src/runtime/agent/orchestrator/tools/patch/patch-symlink.test.mjs +141 -0
- package/src/runtime/agent/orchestrator/tools/patch/v4a-convert.mjs +7 -3
- package/src/runtime/agent/orchestrator/tools/patch/v4a-pure-move.test.mjs +57 -0
- package/src/runtime/agent/orchestrator/tools/patch/v4a-section-coalesce.test.mjs +81 -0
- package/src/runtime/agent/orchestrator/tools/shell-command.mjs +42 -23
- package/src/runtime/media/renditions.mjs +7 -1
- package/src/runtime/memory/index.mjs +2 -4
- package/src/runtime/memory/lib/pg/process.mjs +29 -2
- package/src/runtime/memory/lib/pg/process.test.mjs +36 -0
- package/src/runtime/memory/lib/pg/supervisor.mjs +5 -1
- package/src/runtime/memory/lib/query-handlers.mjs +13 -19
- package/src/runtime/memory/lib/recall-format.mjs +13 -31
- package/src/runtime/memory/tool-defs.mjs +2 -2
- package/src/runtime/shared/memory-snapshot.mjs +57 -4
- package/src/runtime/shared/pristine-execution-contract.json +3 -0
- package/src/runtime/shared/pristine-execution.mjs +6 -3
- package/src/runtime/shared/tool-surface.mjs +6 -0
- package/src/runtime/shared/tool-surface.test.mjs +8 -0
- package/src/session-runtime/lifecycle-api.mjs +1 -0
- package/src/session-runtime/session-turn-api.mjs +5 -0
- package/src/standalone/agent-dispatch-broker.mjs +25 -80
- package/src/standalone/channel-worker-heartbeat.test.mjs +30 -0
- package/src/standalone/channel-worker.mjs +31 -1
- package/src/standalone/daemon.mjs +9 -9
- package/src/standalone/memory-runtime-proxy.mjs +5 -2
- package/src/standalone/session-client.mjs +23 -3
- package/src/standalone/session-runtime-host-health.test.mjs +36 -0
- package/src/standalone/session-runtime-host.mjs +26 -76
- package/src/standalone/session-runtime-worker.mjs +97 -0
- package/src/tui/App.jsx +3 -2
- package/src/tui/app/use-global-key-input.mjs +9 -0
- package/src/tui/app/use-mouse-input.mjs +77 -14
- package/src/tui/components/Spinner.jsx +1 -1
- package/src/tui/dist/index.mjs +83 -23
- package/src/tui/lib/voice-setup.mjs +3 -2
- package/src/tui/session/completion-card-restore.test.mjs +18 -0
- package/src/tui/session/session-api-ext.mjs +2 -1
- package/src/tui/session/session-api.mjs +8 -1
- package/src/tui/session/task-wait-submit.test.mjs +80 -0
- package/src/tui/session/turn.mjs +58 -6
- package/src/tui/spinner-verbs.mjs +1 -0
- package/src/workflows/default/WORKFLOW.md +12 -19
- package/src/workflows/headless/WORKFLOW.md +11 -0
- package/src/workflows/solo/WORKFLOW.md +6 -11
package/src/tui/session/turn.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* src/tui/session/turn.mjs - lead TUI turn session runtime (createRunTurn). Extracted from session-local.mjs.
|
|
3
3
|
*/
|
|
4
|
-
import { aggregateToolCategoryEntries, aggregateDoneCategories, classifyToolCategory, formatAggregateDetail, summarizeToolResult, toolLoadingTargets } from '../../runtime/shared/tool-surface.mjs';
|
|
4
|
+
import { aggregateToolCategoryEntries, aggregateDoneCategories, classifyToolCategory, formatAggregateDetail, isTaskWaitToolCall, summarizeToolResult, toolLoadingTargets } from '../../runtime/shared/tool-surface.mjs';
|
|
5
5
|
import { applyUsageDelta } from './session-stats.mjs';
|
|
6
6
|
import { pickVerb, pickDoneVerb, compactEventLabel, compactEventDetail } from './labels.mjs';
|
|
7
7
|
import { toolResultText, toolErrorDisplay, stripShellExitHeader } from './tool-result-text.mjs';
|
|
@@ -109,6 +109,19 @@ export function createRunTurn(bag) {
|
|
|
109
109
|
const toolCards = [];
|
|
110
110
|
const toolGroups = new Map();
|
|
111
111
|
const resultsDone = new Set();
|
|
112
|
+
// `task wait` is passive control flow, not user-visible work. Keep its call
|
|
113
|
+
// ids only long enough to suppress live/result cards and drive the spinner.
|
|
114
|
+
const suppressedTaskWaitCallIds = new Set();
|
|
115
|
+
const activeTaskWaitCallIds = new Set();
|
|
116
|
+
const refreshTaskWaitSpinner = () => {
|
|
117
|
+
if (!getState().spinner) return;
|
|
118
|
+
set({
|
|
119
|
+
spinner: {
|
|
120
|
+
...getState().spinner,
|
|
121
|
+
mode: activeTaskWaitCallIds.size > 0 ? 'task-wait' : 'tool-use',
|
|
122
|
+
},
|
|
123
|
+
});
|
|
124
|
+
};
|
|
112
125
|
// ── Live shell-output tail → running tool card ─────────────────────────
|
|
113
126
|
// 1 s poll of orchestrator liveness while this turn runs. When exactly one
|
|
114
127
|
// standalone (non-aggregate) card is unresolved and the runtime reports a
|
|
@@ -728,6 +741,12 @@ export function createRunTurn(bag) {
|
|
|
728
741
|
};
|
|
729
742
|
|
|
730
743
|
const deliverToolResultMessage = (message) => {
|
|
744
|
+
const suppressedCallId = toolResultCallId(message);
|
|
745
|
+
if (suppressedCallId && suppressedTaskWaitCallIds.has(suppressedCallId)) {
|
|
746
|
+
activeTaskWaitCallIds.delete(suppressedCallId);
|
|
747
|
+
refreshTaskWaitSpinner();
|
|
748
|
+
return;
|
|
749
|
+
}
|
|
731
750
|
if (message?.__earlyNotify === true) {
|
|
732
751
|
const earlyCallId = toolResultCallId(message);
|
|
733
752
|
if (earlyCallId) {
|
|
@@ -794,16 +813,32 @@ export function createRunTurn(bag) {
|
|
|
794
813
|
// spinner is active the buffered text was dropped by the following
|
|
795
814
|
// closeAssistantSegment(), so the message above the tool card vanished.
|
|
796
815
|
flushStreamBatch();
|
|
816
|
+
const batchCalls = (calls || []).filter(Boolean);
|
|
817
|
+
if (batchCalls.length === 0) return;
|
|
818
|
+
const displayCalls = [];
|
|
819
|
+
for (const call of batchCalls) {
|
|
820
|
+
if (!isTaskWaitToolCall(toolCallName(call), toolCallArgs(call))) {
|
|
821
|
+
displayCalls.push(call);
|
|
822
|
+
continue;
|
|
823
|
+
}
|
|
824
|
+
const callId = toolCallId(call);
|
|
825
|
+
// Tool protocol calls normally always carry ids. If a malformed
|
|
826
|
+
// provider omits one, keep the ordinary card so its result cannot
|
|
827
|
+
// strand an unaddressable hidden spinner.
|
|
828
|
+
if (!callId) {
|
|
829
|
+
displayCalls.push(call);
|
|
830
|
+
continue;
|
|
831
|
+
}
|
|
832
|
+
suppressedTaskWaitCallIds.add(callId);
|
|
833
|
+
activeTaskWaitCallIds.add(callId);
|
|
834
|
+
}
|
|
797
835
|
if (thinkingText && getState().thinking) {
|
|
798
836
|
const thinkingLastEndedAt = closeThinkingSegment();
|
|
799
|
-
set({ thinking: null, spinner: getState().spinner ? { ...getState().spinner, thinking: false, thinkingAccumulatedMs: accumulatedThinkingMs, thinkingLastEndedAt, mode: 'tool-use' } : getState().spinner });
|
|
837
|
+
set({ thinking: null, spinner: getState().spinner ? { ...getState().spinner, thinking: false, thinkingAccumulatedMs: accumulatedThinkingMs, thinkingLastEndedAt, mode: activeTaskWaitCallIds.size > 0 ? 'task-wait' : 'tool-use' } : getState().spinner });
|
|
800
838
|
_publishedThinkingActive = false;
|
|
801
839
|
} else if (getState().spinner) {
|
|
802
|
-
|
|
840
|
+
refreshTaskWaitSpinner();
|
|
803
841
|
}
|
|
804
|
-
const batchCalls = (calls || []).filter(Boolean);
|
|
805
|
-
if (batchCalls.length === 0) return;
|
|
806
|
-
const displayCalls = batchCalls;
|
|
807
842
|
const agentBatch = ++providerToolBatch;
|
|
808
843
|
commitAssistantSegment({ sealToolBlock: true });
|
|
809
844
|
|
|
@@ -914,6 +949,11 @@ export function createRunTurn(bag) {
|
|
|
914
949
|
const lastTouchedAggregate = [...touchedAggregates].at(-1) || null;
|
|
915
950
|
lastTouchedAggregate?.ensureVisible?.();
|
|
916
951
|
for (const [bufferedCallId, bufferedMessage] of earlyResultBuffer) {
|
|
952
|
+
if (suppressedTaskWaitCallIds.has(bufferedCallId)) {
|
|
953
|
+
deliverToolResultMessage(bufferedMessage);
|
|
954
|
+
earlyResultBuffer.delete(bufferedCallId);
|
|
955
|
+
continue;
|
|
956
|
+
}
|
|
917
957
|
if (!cardByCallId.has(bufferedCallId)) continue;
|
|
918
958
|
deliverToolResultMessage(bufferedMessage);
|
|
919
959
|
earlyResultBuffer.delete(bufferedCallId);
|
|
@@ -993,6 +1033,14 @@ export function createRunTurn(bag) {
|
|
|
993
1033
|
invalidateExact: compactChanged,
|
|
994
1034
|
compactedEstimateTokens: compactChanged ? event?.afterTokens : null,
|
|
995
1035
|
});
|
|
1036
|
+
// syncContextStats only STAGES its patch on the draft (context-state
|
|
1037
|
+
// mjs stages through updateState); publication is the caller's, and
|
|
1038
|
+
// every other compact path already follows with this exact set. The
|
|
1039
|
+
// auto path did not, so the post-compact gauge reached React only if
|
|
1040
|
+
// some later mutation happened to carry it — the manual path
|
|
1041
|
+
// repainted immediately while auto looked stuck on the pre-compact
|
|
1042
|
+
// number (user: 오토 컴팩트 이후에 컨텍스트 원형바가 동기화가 안됨).
|
|
1043
|
+
set({ ...routeState(), stats: { ...getState().stats } });
|
|
996
1044
|
},
|
|
997
1045
|
onStageChange: async (stage, detail = null) => {
|
|
998
1046
|
if (!markTurnProgress(`stage:${String(stage || '')}`)) return;
|
|
@@ -1160,6 +1208,10 @@ export function createRunTurn(bag) {
|
|
|
1160
1208
|
finalizeToolHeaders();
|
|
1161
1209
|
flushStreamBatch(); // force-flush any batched streaming text before finalization writes
|
|
1162
1210
|
syncContextStats({ allowEstimated: true });
|
|
1211
|
+
// Terminal reading for the turn. Without its own publication the last
|
|
1212
|
+
// gauge number React ever saw is the one the previous usage delta
|
|
1213
|
+
// carried, so an idle session sat on a stale count until the next turn.
|
|
1214
|
+
set({ stats: { ...getState().stats } });
|
|
1163
1215
|
|
|
1164
1216
|
const finalText = result?.content != null ? String(result.content) : '';
|
|
1165
1217
|
// Strip text already sealed as its own item(s) this turn (a tool
|
|
@@ -6,24 +6,17 @@ description: "Parallel delegation."
|
|
|
6
6
|
|
|
7
7
|
# Cowork
|
|
8
8
|
|
|
9
|
-
Consult the user and build the plan together.
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
planning; a scope change requires fresh approval. Explicit read-only requests
|
|
13
|
-
proceed immediately; approval precedes edits, state mutation, and delegation,
|
|
14
|
-
and on approval all in-scope work completes without reapproval. Ask the user
|
|
15
|
-
only for decisions.
|
|
9
|
+
Consult the user and build the work plan together. Explicit read-only requests
|
|
10
|
+
proceed immediately. When file edits, state mutation, or delegation are
|
|
11
|
+
required, investigate and plan only until the user approves the latest plan.
|
|
16
12
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
many scopes as possible: disjoint file/module sets are independent; merge only
|
|
21
|
-
on a true output dependency. Prefer parallel scopes over sequential slices in
|
|
22
|
-
one agent. Brief each agent per the Lead Brief contract. A plan that yields
|
|
23
|
-
only one scope buys no parallelism: Lead executes it itself instead of
|
|
24
|
-
wrapping a single agent.
|
|
13
|
+
After approval, complete every in-scope step before reporting the result. If
|
|
14
|
+
the request or scope changes during execution, pause and obtain approval for
|
|
15
|
+
the revised plan.
|
|
25
16
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
17
|
+
Delegate maximally: assign one suitable agent to each independent scope and
|
|
18
|
+
spawn them in one turn. Only a scope that depends on another's output waits.
|
|
19
|
+
Treat disjoint file or module sets as independent and merge scopes only on a
|
|
20
|
+
true output dependency. Prefer parallel scopes over sequential slices in one
|
|
21
|
+
agent, and brief each agent using the Lead Brief contract. If the plan has only
|
|
22
|
+
one scope, Lead executes it directly.
|
|
@@ -7,15 +7,10 @@ delegation: none
|
|
|
7
7
|
|
|
8
8
|
# Solo
|
|
9
9
|
|
|
10
|
-
Consult the user and build the plan together.
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
planning; a scope change requires fresh approval. Explicit read-only requests
|
|
14
|
-
proceed immediately; approval precedes edits and state mutation, and on
|
|
15
|
-
approval all in-scope work completes without reapproval. Ask the user only for
|
|
16
|
-
decisions. Lead executes every scope itself.
|
|
10
|
+
Consult the user and build the work plan together. Explicit read-only requests
|
|
11
|
+
proceed immediately. When file edits or state mutation are required,
|
|
12
|
+
investigate and plan only until the user approves the latest plan.
|
|
17
13
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
On direction change, pause and re-consult the user.
|
|
14
|
+
After approval, complete every in-scope step before reporting the result. If
|
|
15
|
+
the request or scope changes during execution, pause and obtain approval for
|
|
16
|
+
the revised plan.
|