mixdog 0.9.95 → 0.9.96
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/LICENSES/Apache-2.0.txt +201 -0
- package/LICENSES/MIT.txt +56 -0
- package/LICENSES/codex-NOTICE.txt +6 -0
- package/NOTICE.md +46 -9
- package/package.json +12 -9
- package/scripts/.tmp-coverage-report.mjs +96 -0
- package/scripts/build-tui.mjs +17 -1
- package/scripts/fixtures/patch-replay-corpus.json +98 -0
- package/src/defaults/mixdog-config.template.json +5 -8
- package/src/rules/agent/30-explorer.md +7 -4
- package/src/rules/shared/01-tool.md +20 -29
- package/src/runtime/agent/orchestrator/agent-runtime/agent-dispatch.mjs +18 -2
- package/src/runtime/agent/orchestrator/agent-runtime/agent-progress-watchdog.mjs +31 -1
- package/src/runtime/agent/orchestrator/agent-runtime/maintenance-route.mjs +6 -17
- package/src/runtime/agent/orchestrator/agent-trace-format.mjs +12 -1
- package/src/runtime/agent/orchestrator/config.mjs +246 -67
- package/src/runtime/agent/orchestrator/mcp/client.mjs +26 -11
- package/src/runtime/agent/orchestrator/mcp/reconnect-singleflight.mjs +23 -0
- package/src/runtime/agent/orchestrator/providers/admission-scheduler.mjs +113 -14
- package/src/runtime/agent/orchestrator/providers/anthropic-sse.mjs +5 -1
- package/src/runtime/agent/orchestrator/providers/gemini-stream.mjs +32 -11
- package/src/runtime/agent/orchestrator/providers/gemini.mjs +89 -2
- package/src/runtime/agent/orchestrator/providers/grok-oauth.mjs +12 -1
- package/src/runtime/agent/orchestrator/providers/openai-compat-xai.mjs +19 -1
- package/src/runtime/agent/orchestrator/providers/openai-compat.mjs +144 -39
- package/src/runtime/agent/orchestrator/providers/openai-oauth-http-sse.mjs +22 -8
- package/src/runtime/agent/orchestrator/providers/openai-oauth.mjs +15 -1
- package/src/runtime/agent/orchestrator/providers/openai-transport-policy.mjs +1 -1
- package/src/runtime/agent/orchestrator/providers/openai-ws-pool.mjs +3 -4
- package/src/runtime/agent/orchestrator/providers/retry-classifier.mjs +67 -7
- package/src/runtime/agent/orchestrator/providers/stream-json-pool.mjs +291 -0
- package/src/runtime/agent/orchestrator/providers/stream-json-worker.mjs +21 -0
- package/src/runtime/agent/orchestrator/session/agent-loop.mjs +28 -4
- package/src/runtime/agent/orchestrator/session/eager-dispatch.mjs +4 -33
- package/src/runtime/agent/orchestrator/session/loop/pre-dispatch-deny.mjs +13 -0
- package/src/runtime/agent/orchestrator/session/loop/termination.mjs +2 -2
- package/src/runtime/agent/orchestrator/session/loop/tool-classify.mjs +0 -24
- package/src/runtime/agent/orchestrator/session/loop/tool-exec.mjs +1 -27
- package/src/runtime/agent/orchestrator/session/loop/tool-helpers.mjs +6 -10
- package/src/runtime/agent/orchestrator/session/manager/ask-session.mjs +5 -0
- package/src/runtime/agent/orchestrator/session/manager/pending-messages.mjs +142 -84
- package/src/runtime/agent/orchestrator/session/manager/runtime-loaders.mjs +4 -0
- package/src/runtime/agent/orchestrator/session/manager/session-crud.mjs +31 -1
- package/src/runtime/agent/orchestrator/session/manager/turn-interruption.mjs +29 -9
- package/src/runtime/agent/orchestrator/session/manager.mjs +2 -0
- package/src/runtime/agent/orchestrator/session/result-classification.mjs +65 -0
- package/src/runtime/agent/orchestrator/session/send-with-recovery.mjs +86 -8
- package/src/runtime/agent/orchestrator/session/store-summary-reader.mjs +12 -0
- package/src/runtime/agent/orchestrator/session/tool-batch.mjs +3 -33
- package/src/runtime/agent/orchestrator/session/tool-result-offload.mjs +4 -5
- package/src/runtime/agent/orchestrator/stall-policy.mjs +1 -1
- package/src/runtime/agent/orchestrator/tools/bash-session.mjs +2 -2
- package/src/runtime/agent/orchestrator/tools/builtin/arg-guard.mjs +35 -1
- package/src/runtime/agent/orchestrator/tools/builtin/bash-tool.mjs +118 -18
- package/src/runtime/agent/orchestrator/tools/builtin/builtin-tools.mjs +8 -9
- package/src/runtime/agent/orchestrator/tools/builtin/cache-layers.mjs +2 -2
- package/src/runtime/agent/orchestrator/tools/builtin/device-paths.mjs +2 -2
- package/src/runtime/agent/orchestrator/tools/builtin/lib/grep-context-expander.mjs +6 -15
- package/src/runtime/agent/orchestrator/tools/builtin/list-tool.mjs +10 -26
- package/src/runtime/agent/orchestrator/tools/builtin/read-image.mjs +1 -1
- package/src/runtime/agent/orchestrator/tools/builtin/read-single-tool.mjs +3 -3
- package/src/runtime/agent/orchestrator/tools/builtin/read-tool.mjs +1 -23
- package/src/runtime/agent/orchestrator/tools/builtin/rg-runner.mjs +23 -9
- package/src/runtime/agent/orchestrator/tools/builtin/search-path-diagnostics.mjs +7 -0
- package/src/runtime/agent/orchestrator/tools/builtin/search-tool.mjs +17 -39
- package/src/runtime/agent/orchestrator/tools/builtin/shell-analysis.mjs +73 -0
- package/src/runtime/agent/orchestrator/tools/builtin/shell-job-paths.mjs +1 -1
- package/src/runtime/agent/orchestrator/tools/builtin/shell-job-spawn.mjs +0 -2
- package/src/runtime/agent/orchestrator/tools/builtin/shell-jobs.mjs +3 -8
- package/src/runtime/agent/orchestrator/tools/builtin/shell-runtime.mjs +30 -0
- package/src/runtime/agent/orchestrator/tools/code-graph/build.mjs +5 -5
- package/src/runtime/agent/orchestrator/tools/code-graph/dispatch.mjs +87 -15
- package/src/runtime/agent/orchestrator/tools/code-graph/search.mjs +6 -15
- package/src/runtime/agent/orchestrator/tools/code-graph-tool-defs.mjs +2 -2
- package/src/runtime/agent/orchestrator/tools/lib/pwsh-standby-pool.mjs +83 -13
- package/src/runtime/agent/orchestrator/tools/patch/matcher.mjs +39 -1
- package/src/runtime/agent/orchestrator/tools/patch/orchestrator.mjs +29 -1
- package/src/runtime/agent/orchestrator/tools/patch/parsing.mjs +16 -0
- package/src/runtime/agent/orchestrator/tools/patch/v4a-convert.mjs +108 -12
- package/src/runtime/agent/orchestrator/tools/patch-tool-defs.mjs +10 -10
- package/src/runtime/agent/orchestrator/tools/shell-command.mjs +56 -8
- package/src/runtime/agent/orchestrator/tools/shell-exec-output.mjs +2 -2
- package/src/runtime/channels/lib/config.mjs +2 -2
- package/src/runtime/channels/lib/inbound-handler.mjs +1 -1
- package/src/runtime/channels/lib/scheduler.mjs +2 -2
- package/src/runtime/memory/index.mjs +5 -38
- package/src/runtime/memory/lib/agent-ipc.mjs +145 -81
- package/src/runtime/memory/lib/compact-vector-cache.mjs +88 -0
- package/src/runtime/memory/lib/core-memory-store.mjs +18 -1
- package/src/runtime/memory/lib/cycle-llm-adapters.mjs +12 -33
- package/src/runtime/memory/lib/embedding-provider.mjs +47 -26
- package/src/runtime/memory/lib/embedding-worker.mjs +30 -34
- package/src/runtime/memory/lib/http-router.mjs +8 -0
- package/src/runtime/memory/lib/ko-morph.mjs +3 -20
- package/src/runtime/memory/lib/memory-action-handlers.mjs +2 -1
- package/src/runtime/memory/lib/memory-cycle1.mjs +1 -0
- package/src/runtime/memory/lib/memory-cycle2-gate.mjs +4 -2
- package/src/runtime/memory/lib/memory-cycle2-mutations.mjs +1 -0
- package/src/runtime/memory/lib/memory-cycle3.mjs +3 -1
- package/src/runtime/memory/lib/pg/process.mjs +32 -9
- package/src/runtime/memory/tool-defs.mjs +1 -5
- package/src/runtime/search/tool-defs.mjs +2 -2
- package/src/runtime/shared/agent-route-config.mjs +119 -0
- package/src/runtime/shared/atomic-file.mjs +80 -4
- package/src/runtime/shared/channel-notification-routing.mjs +2 -2
- package/src/runtime/shared/child-guardian.mjs +204 -108
- package/src/runtime/shared/child-spawn-gate.mjs +60 -31
- package/src/runtime/shared/config.mjs +130 -44
- package/src/runtime/shared/resource-admission.mjs +146 -97
- package/src/runtime/shared/stream-progress.mjs +6 -0
- package/src/runtime/shared/tool-surface.mjs +0 -5
- package/src/runtime/shared/turn-snapshot.mjs +31 -5
- package/src/runtime/shared/turn-worktree-snapshot.mjs +14 -2
- package/src/session-runtime/config-helpers.mjs +39 -37
- package/src/session-runtime/model-route-api.mjs +7 -5
- package/src/session-runtime/provider-auth-api.mjs +0 -7
- package/src/session-runtime/runtime-core.mjs +11 -11
- package/src/session-runtime/runtime-tunables.mjs +4 -4
- package/src/session-runtime/session-lifecycle.mjs +9 -2
- package/src/session-runtime/session-turn-api.mjs +41 -9
- package/src/session-runtime/settings-api.mjs +5 -17
- package/src/session-runtime/tool-defs.mjs +3 -3
- package/src/session-runtime/workflow-agents-api.mjs +55 -81
- package/src/session-runtime/workflow.mjs +14 -24
- package/src/standalone/agent-dispatch-broker.mjs +198 -0
- package/src/standalone/agent-tool/helpers.mjs +2 -2
- package/src/standalone/agent-tool/spawn-flow.mjs +2 -0
- package/src/standalone/agent-tool/spawn-preset.mjs +11 -21
- package/src/standalone/agent-tool/tool-def.mjs +0 -14
- package/src/standalone/backend-daemon.mjs +97 -36
- package/src/standalone/channel-admin.mjs +12 -12
- package/src/standalone/channel-daemon-client.mjs +17 -1
- package/src/standalone/channel-daemon-transport.mjs +90 -8
- package/src/standalone/engine-daemon-client.mjs +380 -205
- package/src/standalone/engine-daemon-protocol.mjs +3 -4
- package/src/standalone/engine-daemon-service.mjs +378 -134
- package/src/standalone/engine-daemon-transport.mjs +268 -77
- package/src/standalone/explore-tool.mjs +187 -70
- package/src/standalone/fair-call-scheduler.mjs +264 -0
- package/src/standalone/session-protocol.mjs +188 -0
- package/src/tui/App.jsx +30 -17
- package/src/tui/app/app-view.jsx +5 -2
- package/src/tui/app/core-memory-picker.mjs +19 -19
- package/src/tui/app/doctor.mjs +5 -11
- package/src/tui/app/message-selector.mjs +103 -0
- package/src/tui/app/onboarding-steps.mjs +1 -2
- package/src/tui/app/project-picker.mjs +80 -56
- package/src/tui/app/prompt-submit.mjs +46 -41
- package/src/tui/app/resume-picker.mjs +2 -2
- package/src/tui/app/route-pickers.mjs +3 -1
- package/src/tui/app/settings-picker.mjs +6 -8
- package/src/tui/app/transcript-window.mjs +38 -0
- package/src/tui/app/use-prompt-draft-flow.mjs +5 -7
- package/src/tui/app/use-prompt-handlers.mjs +86 -21
- package/src/tui/app/use-prompt-hint.mjs +3 -2
- package/src/tui/app/use-prompt-queue-history.mjs +10 -3
- package/src/tui/app/use-transcript-scroll.mjs +9 -2
- package/src/tui/app/use-transcript-window.mjs +50 -17
- package/src/tui/components/PromptInput.jsx +71 -38
- package/src/tui/components/Spinner.jsx +1 -1
- package/src/tui/components/prompt-input/edit-helpers.mjs +9 -11
- package/src/tui/components/prompt-input/escape-policy.mjs +42 -0
- package/src/tui/components/prompt-input/immediate-render.mjs +0 -10
- package/src/tui/components/prompt-input/interrupt-policy.mjs +10 -0
- package/src/tui/components/prompt-input/restore-policy.mjs +10 -0
- package/src/tui/dist/index.mjs +920 -1592
- package/src/tui/engine/live-share.mjs +34 -0
- package/src/tui/engine/session-api-ext.mjs +1 -4
- package/src/tui/engine/session-api.mjs +103 -33
- package/src/tui/engine/session-flow.mjs +7 -1
- package/src/tui/engine/tool-card-results.mjs +4 -2
- package/src/tui/engine/tool-result-text.mjs +10 -0
- package/src/tui/engine/turn.mjs +9 -69
- package/src/tui/engine-local-session.mjs +47 -31
- package/src/tui/index.jsx +1 -2
- package/src/tui/spinner-meta.mjs +4 -4
- package/src/tui/spinner-verbs.mjs +51 -3
- package/src/standalone/engine-daemon-local-bridge.mjs +0 -20
|
@@ -48,6 +48,40 @@ export const SPINNER_VERBS = [
|
|
|
48
48
|
/** How long one phrase holds before the pool advances. */
|
|
49
49
|
export const SPINNER_VERB_ROTATE_MS = 30_000;
|
|
50
50
|
|
|
51
|
+
/** Odds that a 30s boundary actually swaps the phrase (user: 바꿀지 말지만
|
|
52
|
+
* 랜덤 돌리면 되잖아). Below 1 the window stretches: ~half the boundaries
|
|
53
|
+
* hold, so a phrase lives 30s, 60s, 90s… and the rhythm stops being a
|
|
54
|
+
* metronome. */
|
|
55
|
+
export const SPINNER_VERB_CHANGE_ODDS = 0.5;
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Deterministic coin for ONE (turn, boundary) pair.
|
|
59
|
+
*
|
|
60
|
+
* Math.random() is not an option here: spinnerVerbFor runs on every render
|
|
61
|
+
* tick (~1/s) and the TUI and the desktop each call it for themselves, so a
|
|
62
|
+
* real RNG would reroll the word every second AND let the two surfaces
|
|
63
|
+
* disagree. An integer hash keeps each boundary's answer fixed forever while
|
|
64
|
+
* making the SEQUENCE of answers unpredictable — which is the part that reads
|
|
65
|
+
* as random.
|
|
66
|
+
*/
|
|
67
|
+
function boundarySwaps(anchor, boundary) {
|
|
68
|
+
let h = (Math.floor(anchor / 1000) + Math.imul(boundary, 0x9e3779b1)) | 0;
|
|
69
|
+
h = Math.imul(h ^ (h >>> 16), 0x21f0aaad);
|
|
70
|
+
h = Math.imul(h ^ (h >>> 15), 0x735a2d97);
|
|
71
|
+
h = (h ^ (h >>> 15)) >>> 0;
|
|
72
|
+
return h / 0x100000000 < SPINNER_VERB_CHANGE_ODDS;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
/** Past this many boundaries (~34h) every boundary simply swaps; the walk is
|
|
76
|
+
* re-counted each render and must not grow without bound. */
|
|
77
|
+
const MAX_COUNTED_BOUNDARIES = 4096;
|
|
78
|
+
|
|
79
|
+
/** A coin streak can hold a phrase for a very long time (measured: up to 9
|
|
80
|
+
* minutes over 300 turns). After this many consecutive holds the next
|
|
81
|
+
* boundary swaps regardless of its coin, capping one phrase at 4 windows
|
|
82
|
+
* (~2 min) while leaving the 30/60/90/120s variety intact. */
|
|
83
|
+
const MAX_HELD_BOUNDARIES = 3;
|
|
84
|
+
|
|
51
85
|
/**
|
|
52
86
|
* Modes that describe a STATE rather than ongoing work: they replace the pool
|
|
53
87
|
* phrase for as long as the mode lasts, then the rotation resumes. Everything
|
|
@@ -64,14 +98,28 @@ export const SPINNER_MODE_OVERRIDE_VERBS = {
|
|
|
64
98
|
/**
|
|
65
99
|
* The phrase for a turn at a point in time. Derived from the turn's
|
|
66
100
|
* `startedAt` so the TUI and the desktop show the SAME word at the same
|
|
67
|
-
* second, and so mode flips cannot change it — only
|
|
101
|
+
* second, and so mode flips cannot change it — only a 30s boundary can, and
|
|
102
|
+
* only when that boundary's coin says so.
|
|
68
103
|
*/
|
|
69
104
|
export function spinnerVerbFor(startedAt = 0, now = 0, pool = SPINNER_VERBS) {
|
|
70
105
|
const list = Array.isArray(pool) && pool.length ? pool : SPINNER_VERBS;
|
|
71
106
|
const anchor = Math.max(0, Number(startedAt) || 0);
|
|
72
107
|
const elapsed = anchor > 0 ? Math.max(0, (Number(now) || 0) - anchor) : 0;
|
|
73
|
-
const
|
|
74
|
-
|
|
108
|
+
const boundaries = Math.floor(elapsed / SPINNER_VERB_ROTATE_MS);
|
|
109
|
+
// Only the boundaries that FIRED advance the pool; a held boundary leaves
|
|
110
|
+
// the phrase exactly where it was, which is what stretches the window.
|
|
111
|
+
const counted = Math.min(boundaries, MAX_COUNTED_BOUNDARIES);
|
|
112
|
+
let swaps = boundaries - counted;
|
|
113
|
+
let held = 0;
|
|
114
|
+
for (let boundary = 1; boundary <= counted; boundary += 1) {
|
|
115
|
+
if (held >= MAX_HELD_BOUNDARIES || boundarySwaps(anchor, boundary)) {
|
|
116
|
+
swaps += 1;
|
|
117
|
+
held = 0;
|
|
118
|
+
} else {
|
|
119
|
+
held += 1;
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
const seed = Math.floor(anchor / 1000) + swaps;
|
|
75
123
|
return list[((seed * 7) + 3) % list.length];
|
|
76
124
|
}
|
|
77
125
|
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
const LOCAL_ENGINE_BRIDGE_KEY = Symbol.for('mixdog.engine-daemon.local-bridge.v1');
|
|
2
|
-
|
|
3
|
-
/** Return the daemon-process-local session bridge, when this module is running
|
|
4
|
-
* inside the singleton backend process. External TUI/Electron clients never
|
|
5
|
-
* see this registry and keep using the authenticated loopback transport. */
|
|
6
|
-
export function engineDaemonLocalBridge() {
|
|
7
|
-
return globalThis[LOCAL_ENGINE_BRIDGE_KEY] ?? null;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
export function installEngineDaemonLocalBridge(bridge) {
|
|
11
|
-
if (!bridge || typeof bridge.attach !== 'function') {
|
|
12
|
-
throw new TypeError('engine daemon local bridge is invalid');
|
|
13
|
-
}
|
|
14
|
-
globalThis[LOCAL_ENGINE_BRIDGE_KEY] = bridge;
|
|
15
|
-
return () => {
|
|
16
|
-
if (globalThis[LOCAL_ENGINE_BRIDGE_KEY] === bridge) {
|
|
17
|
-
delete globalThis[LOCAL_ENGINE_BRIDGE_KEY];
|
|
18
|
-
}
|
|
19
|
-
};
|
|
20
|
-
}
|