mixdog 0.9.91 → 0.9.93
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 +147 -51
- package/package.json +6 -5
- package/scripts/code-graph-description-contract.mjs +6 -8
- package/scripts/tmp-cdp-errors.mjs +41 -0
- package/scripts/tmp-cdp-inspect.mjs +41 -0
- package/scripts/tool-overhead-microbench.mjs +60 -0
- package/scripts/tui-transcript-jitter-harness.mjs +2 -18
- package/src/agents/debugger/agent.json +1 -1
- package/src/agents/explore/agent.json +1 -1
- package/src/agents/heavy-worker/agent.json +1 -1
- package/src/agents/maintainer/agent.json +1 -1
- package/src/agents/reviewer/agent.json +1 -1
- package/src/agents/worker/agent.json +1 -1
- package/src/lib/rules-builder.cjs +5 -5
- package/src/output-styles/simple.md +1 -1
- package/src/rules/agent/00-core.md +1 -2
- package/src/rules/lead/01-general.md +1 -0
- package/src/rules/shared/01-tool.md +19 -21
- package/src/runtime/agent/orchestrator/agent-runtime/cache-strategy.mjs +16 -3
- package/src/runtime/agent/orchestrator/agent-trace.mjs +17 -0
- package/src/runtime/agent/orchestrator/context/collect.mjs +2 -1
- package/src/runtime/agent/orchestrator/providers/anthropic-effort.mjs +9 -1
- package/src/runtime/agent/orchestrator/providers/anthropic-oauth.mjs +90 -22
- package/src/runtime/agent/orchestrator/providers/anthropic.mjs +54 -19
- package/src/runtime/agent/orchestrator/providers/lib/anthropic-request-utils.mjs +18 -1
- package/src/runtime/agent/orchestrator/providers/openai-oauth-http-sse.mjs +44 -8
- package/src/runtime/agent/orchestrator/providers/openai-oauth-ws.mjs +10 -0
- package/src/runtime/agent/orchestrator/providers/openai-ws-events.mjs +3 -0
- package/src/runtime/agent/orchestrator/providers/openai-ws-stream.mjs +2 -0
- package/src/runtime/agent/orchestrator/providers/retry-classifier.mjs +35 -0
- package/src/runtime/agent/orchestrator/session/agent-loop.mjs +34 -5
- package/src/runtime/agent/orchestrator/session/eager-dispatch.mjs +35 -29
- package/src/runtime/agent/orchestrator/session/loop/stop-hooks.mjs +9 -0
- package/src/runtime/agent/orchestrator/session/loop/stored-tool-args.mjs +11 -2
- package/src/runtime/agent/orchestrator/session/loop/tool-classify.mjs +5 -6
- package/src/runtime/agent/orchestrator/session/loop/tool-exec.mjs +31 -2
- package/src/runtime/agent/orchestrator/session/manager/compaction-runner.mjs +60 -0
- package/src/runtime/agent/orchestrator/session/manager/pending-messages.mjs +60 -31
- package/src/runtime/agent/orchestrator/session/manager.mjs +1 -1
- package/src/runtime/agent/orchestrator/session/result-classification.mjs +28 -0
- package/src/runtime/agent/orchestrator/session/send-with-recovery.mjs +71 -2
- package/src/runtime/agent/orchestrator/session/store/listing.mjs +17 -0
- package/src/runtime/agent/orchestrator/session/store-summary-reader.mjs +101 -0
- package/src/runtime/agent/orchestrator/session/store.mjs +30 -0
- package/src/runtime/agent/orchestrator/session/tool-batch.mjs +19 -23
- package/src/runtime/agent/orchestrator/stall-policy.mjs +31 -21
- package/src/runtime/agent/orchestrator/tools/builtin/bash-tool.mjs +4 -1
- package/src/runtime/agent/orchestrator/tools/builtin/builtin-tools.mjs +12 -6
- package/src/runtime/agent/orchestrator/tools/builtin/task-tool.mjs +5 -0
- package/src/runtime/agent/orchestrator/tools/code-graph-tool-defs.mjs +4 -3
- package/src/runtime/agent/orchestrator/tools/lib/pwsh-standby-pool.mjs +47 -14
- package/src/runtime/agent/orchestrator/tools/patch/v4a-convert.mjs +100 -0
- package/src/runtime/agent/orchestrator/tools/patch-tool-defs.mjs +6 -5
- package/src/runtime/agent/orchestrator/tools/shell-command.mjs +9 -0
- package/src/runtime/agent/orchestrator/tools/shell-state.mjs +32 -2
- package/src/runtime/channels/backends/discord-gateway.mjs +6 -32
- package/src/runtime/channels/lib/inbound-handler.mjs +19 -3
- package/src/runtime/channels/lib/scheduler.mjs +51 -3
- package/src/runtime/channels/lib/worker-main.mjs +4 -0
- package/src/runtime/channels/tool-defs.mjs +4 -2
- package/src/runtime/memory/lib/query-handlers.mjs +11 -3
- package/src/runtime/memory/tool-defs.mjs +5 -5
- package/src/runtime/shared/channel-notification-routing.mjs +8 -2
- package/src/runtime/shared/llm/http-agent.mjs +11 -0
- package/src/session-runtime/lifecycle-api.mjs +26 -1
- package/src/session-runtime/output-styles.mjs +1 -4
- package/src/session-runtime/tool-catalog-data.mjs +5 -2
- package/src/session-runtime/workflow.mjs +25 -13
- package/src/standalone/agent-tool/tag-registry.mjs +5 -1
- package/src/standalone/explore-tool.mjs +1 -1
- package/src/tui/dist/index.mjs +100 -46
- package/src/tui/engine/agent-envelope.mjs +52 -3
- package/src/tui/engine/session-api.mjs +17 -0
- package/src/tui/engine/tui-steering-persist.mjs +24 -1
- package/src/tui/engine/turn.mjs +8 -9
- package/src/tui/engine.mjs +18 -41
- package/src/workflows/default/WORKFLOW.md +7 -18
- package/src/workflows/solo/WORKFLOW.md +0 -6
- package/src/workflows/solo-bench/WORKFLOW.md +17 -0
package/src/tui/engine/turn.mjs
CHANGED
|
@@ -7,10 +7,12 @@ import { pickVerb, pickDoneVerb, compactEventLabel, compactEventDetail } from '.
|
|
|
7
7
|
import { toolResultText, toolErrorDisplay } from './tool-result-text.mjs';
|
|
8
8
|
import { toolCallId, toolResultCallId, toolCallName, toolCallArgs } from './tool-call-fields.mjs';
|
|
9
9
|
import { promptDisplayText, STEERING_SUPPRESSED_DISPLAY } from './queue-helpers.mjs';
|
|
10
|
-
import { yieldToRenderer } from './render-timing.mjs';
|
|
10
|
+
import { TUI_FRAME_MS, yieldToRenderer } from './render-timing.mjs';
|
|
11
11
|
import { createTurnWatchdog } from './turn-watchdog.mjs';
|
|
12
12
|
import { aggregateRawResult, aggregateBucketForCategory, aggregateSummaries, assignAggregateSummaryOrder, failureDetailText, toolCallOutcome } from './tool-result-status.mjs';
|
|
13
13
|
|
|
14
|
+
export const STREAM_BATCH_INTERVAL_MS = TUI_FRAME_MS;
|
|
15
|
+
|
|
14
16
|
export function createRunTurn(bag) {
|
|
15
17
|
const {
|
|
16
18
|
runtime, nextId, tuiDebug, LEAD_TURN_TIMEOUT_MS, flags, pending, itemIndexById, getState, set, flushEmit, flushEmitImmediate, pushItem, appendItems, patchItem, replaceItems, updateStreamingTail: updateStreamingTailFromStore, settleStreamingTail: settleStreamingTailFromStore, clearStreamingTail: clearStreamingTailFromStore, pushNotice, pushUserOrSyntheticItem, markToolCallActive, markToolCallDone, clearActiveToolSummary, agentStatusState, routeState, transcriptRouteMetadata, syncContextStats, denyAllToolApprovals, requestToolApproval, patchToolCardResult, flushToolResults, flushDeferredExecutionPendingResumeKick, drain, drainPendingSteering,
|
|
@@ -563,15 +565,12 @@ export function createRunTurn(bag) {
|
|
|
563
565
|
// --- Streaming-delta batcher ---
|
|
564
566
|
// onTextDelta and onReasoningDelta fire on every tiny chunk (often <10 chars).
|
|
565
567
|
// Each call previously called set() → emit() → full React reconcile. We
|
|
566
|
-
// batch accumulated text and flush at most once per STREAM_BATCH_INTERVAL_MS
|
|
567
|
-
//
|
|
568
|
+
// batch accumulated text and flush at most once per STREAM_BATCH_INTERVAL_MS.
|
|
569
|
+
// A forced flush happens before any tool call,
|
|
568
570
|
// finalization, or error so those code paths see the correct text getState().
|
|
569
|
-
//
|
|
570
|
-
//
|
|
571
|
-
//
|
|
572
|
-
// other Ink frame idle, which made fast provider streams visibly land in
|
|
573
|
-
// coarse chunks ("10 chars at a time").
|
|
574
|
-
const STREAM_BATCH_INTERVAL_MS = 16;
|
|
571
|
+
// Share Ink's exact 120fps cadence with the frame-batched store. A separate
|
|
572
|
+
// 16ms timer left every other terminal frame idle, so completed script lines
|
|
573
|
+
// accumulated and then climbed into view in coarse two-step chunks.
|
|
575
574
|
let _batchTimer = null;
|
|
576
575
|
let _pendingTextFlush = false; // true when a text/spinner update is queued
|
|
577
576
|
let _pendingThinkFlush = false; // true when a thinking update is queued
|
package/src/tui/engine.mjs
CHANGED
|
@@ -55,6 +55,7 @@ import {
|
|
|
55
55
|
toolCallArgs,
|
|
56
56
|
} from './engine/tool-call-fields.mjs';
|
|
57
57
|
import {
|
|
58
|
+
buildExecutionResponseToolItem,
|
|
58
59
|
parseBackgroundTaskEnvelope,
|
|
59
60
|
parseSyntheticAgentMessage,
|
|
60
61
|
toolResultStatus,
|
|
@@ -179,6 +180,7 @@ const LEAD_TURN_TIMEOUT_MS = (() => {
|
|
|
179
180
|
// the alternate-screen render; enable with MIXDOG_TUI_DEBUG=1.
|
|
180
181
|
import { tuiDebug, nextId, cleanupStaleTranscriptSpillDirs, createTranscriptSpillBuffer, refillTranscriptViewOverlap, replaceEngineItemsState, createEngineItemMutators, TRANSCRIPT_LIVE_ITEM_CAP, TRANSCRIPT_SPILL_CHUNK_ITEMS } from './engine/transcript-spill.mjs';
|
|
181
182
|
export { cleanupStaleTranscriptSpillDirs, createTranscriptSpillBuffer, refillTranscriptViewOverlap, replaceEngineItemsState, createEngineItemMutators, TRANSCRIPT_LIVE_ITEM_CAP, TRANSCRIPT_SPILL_CHUNK_ITEMS } from './engine/transcript-spill.mjs';
|
|
183
|
+
export { parseBackgroundTaskEnvelope } from './engine/agent-envelope.mjs';
|
|
182
184
|
|
|
183
185
|
export async function createEngineSession({
|
|
184
186
|
provider: providerName,
|
|
@@ -647,16 +649,15 @@ export async function createEngineSession({
|
|
|
647
649
|
});
|
|
648
650
|
};
|
|
649
651
|
const pushAsyncAgentResponse = (text, id = nextId(), origin = 'injected', metadata = {}) => {
|
|
650
|
-
const
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
}
|
|
659
|
-
const responseKey = String(metadata.responseKey || metadata.executionId || args.task_id || '').trim();
|
|
652
|
+
const responseItem = buildExecutionResponseToolItem(text, {
|
|
653
|
+
id,
|
|
654
|
+
responseKey: metadata.responseKey || metadata.executionId,
|
|
655
|
+
});
|
|
656
|
+
if (!responseItem) return pushUserOrSyntheticItem(text, id, origin);
|
|
657
|
+
if (responseItem.name !== 'agent') {
|
|
658
|
+
pushItem(responseItem);
|
|
659
|
+
return true;
|
|
660
|
+
}
|
|
660
661
|
const previous = state.items.at(-1);
|
|
661
662
|
// Tail-only aggregation prevents a later completion from mutating a card
|
|
662
663
|
// above any outbound tool, assistant, user, or preview/body boundary.
|
|
@@ -665,43 +666,19 @@ export async function createEngineSession({
|
|
|
665
666
|
&& previous.agentDirection === 'inbound'
|
|
666
667
|
) {
|
|
667
668
|
const patch = appendAgentResponseTail(previous, {
|
|
668
|
-
key:
|
|
669
|
-
args,
|
|
670
|
-
result:
|
|
671
|
-
rawResult,
|
|
672
|
-
hasBody:
|
|
673
|
-
isError:
|
|
669
|
+
key: responseItem.agentResponseKey,
|
|
670
|
+
args: responseItem.args,
|
|
671
|
+
result: responseItem.result,
|
|
672
|
+
rawResult: responseItem.rawResult,
|
|
673
|
+
hasBody: responseItem.agentResponseHasBody,
|
|
674
|
+
isError: responseItem.isError,
|
|
674
675
|
});
|
|
675
676
|
if (patch) {
|
|
676
677
|
patchItem(previous.id, patch);
|
|
677
678
|
return true;
|
|
678
679
|
}
|
|
679
680
|
}
|
|
680
|
-
pushItem(
|
|
681
|
-
kind: 'tool',
|
|
682
|
-
id,
|
|
683
|
-
name: 'agent',
|
|
684
|
-
args,
|
|
685
|
-
result: synthetic.result,
|
|
686
|
-
rawResult,
|
|
687
|
-
isError: synthetic.isError === true,
|
|
688
|
-
expanded: false,
|
|
689
|
-
count: 1,
|
|
690
|
-
completedCount: 1,
|
|
691
|
-
startedAt: Date.now(),
|
|
692
|
-
completedAt: Date.now(),
|
|
693
|
-
agentDirection: 'inbound',
|
|
694
|
-
agentResponseKey: responseKey,
|
|
695
|
-
agentResponseHasBody: responseHasBody,
|
|
696
|
-
agentResponseAggregate: false,
|
|
697
|
-
agentResponseEntries: [{
|
|
698
|
-
key: responseKey,
|
|
699
|
-
raw: String(rawResult ?? '').trim(),
|
|
700
|
-
result: synthetic.result,
|
|
701
|
-
hasBody: responseHasBody,
|
|
702
|
-
isError: synthetic.isError === true,
|
|
703
|
-
}],
|
|
704
|
-
});
|
|
681
|
+
pushItem(responseItem);
|
|
705
682
|
return true;
|
|
706
683
|
};
|
|
707
684
|
const pushToast = (text, tone = 'info', ttlMs = 3000) => {
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
id: default
|
|
3
3
|
name: Cowork
|
|
4
4
|
description: "Parallel delegation."
|
|
5
|
-
agents: worker, heavy-worker, reviewer, debugger
|
|
5
|
+
agents: worker, heavy-worker, reviewer, debugger
|
|
6
6
|
---
|
|
7
7
|
|
|
8
8
|
# Cowork
|
|
@@ -13,23 +13,12 @@ investigation and planning — no edits, no state mutation, no delegation.
|
|
|
13
13
|
A new or changed request resets planning; a scope change requires fresh
|
|
14
14
|
approval.
|
|
15
15
|
|
|
16
|
-
On approval,
|
|
17
|
-
spawned in one turn; only a scope that depends on another's
|
|
18
|
-
Split the plan into as many scopes as possible: disjoint
|
|
19
|
-
are independent; merge only on a true output dependency.
|
|
20
|
-
scopes over sequential slices in one agent. Brief each agent
|
|
21
|
-
Brief contract.
|
|
22
|
-
|
|
23
|
-
Route by complexity: simple, well-understood implementation goes to Worker;
|
|
24
|
-
complex or investigative implementation goes to Heavy Worker; Lead itself
|
|
25
|
-
edits only a local, one-turn configuration/git change. Debugger only on a
|
|
26
|
-
defect needing deep root-cause analysis or a bug surviving 2+ review/fix
|
|
27
|
-
cycles.
|
|
28
|
-
|
|
29
|
-
Every implementation gets its own Reviewer, attached per scope — only the
|
|
30
|
-
local Lead-direct edits above are exempt. Keep the same reviewer through the
|
|
31
|
-
fix loop and repeat fix -> re-verify until clean; Lead cross-verifies in
|
|
32
|
-
parallel with the Reviewer.
|
|
16
|
+
On approval, delegate maximally: one agent per independent scope, fit to the
|
|
17
|
+
situation, all spawned in one turn; only a scope that depends on another's
|
|
18
|
+
output waits. Split the plan into as many scopes as possible: disjoint
|
|
19
|
+
file/module sets are independent; merge only on a true output dependency.
|
|
20
|
+
Prefer parallel scopes over sequential slices in one agent. Brief each agent
|
|
21
|
+
per the Lead Brief contract.
|
|
33
22
|
|
|
34
23
|
Report the verified result against the approved plan. Build, deploy, commit,
|
|
35
24
|
and push happen only on an explicit user request.
|
|
@@ -15,12 +15,6 @@ changed request resets planning; a scope change requires fresh approval.
|
|
|
15
15
|
On approval, Lead executes all work itself — never spawn, send, or delegate
|
|
16
16
|
to agents. Complete in-scope fixes without reapproval.
|
|
17
17
|
|
|
18
|
-
Verification is single-pass and risk-proportional: exactly one check that
|
|
19
|
-
most directly proves the deliverable — a direct result check for trivial or
|
|
20
|
-
read-only work, full test/build runs only for risky or behavior-changing
|
|
21
|
-
work. A pass is final. Iterate only on a failing check, re-running just that
|
|
22
|
-
check after each fix, or report the blocker.
|
|
23
|
-
|
|
24
18
|
Report the result against the approved plan. Build, deploy, commit, and push
|
|
25
19
|
happen only on an explicit user request.
|
|
26
20
|
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: solo-bench
|
|
3
|
+
name: Solo Bench
|
|
4
|
+
description: "Benchmark-only Solo without the planning approval gate."
|
|
5
|
+
agents:
|
|
6
|
+
hidden: true
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Solo Bench
|
|
10
|
+
|
|
11
|
+
Lead executes all work itself — never spawn, send, or delegate to agents.
|
|
12
|
+
Complete in-scope fixes without reapproval.
|
|
13
|
+
|
|
14
|
+
Report the result. Build, deploy, commit, and push happen only on an explicit
|
|
15
|
+
user request.
|
|
16
|
+
|
|
17
|
+
On direction change, pause and re-consult the user.
|