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
|
@@ -6,9 +6,9 @@ import { randomUUID } from "crypto";
|
|
|
6
6
|
import { DATA_DIR, DEFAULT_HOLIDAY_COUNTRY, isInQuietWindow } from "./config.mjs";
|
|
7
7
|
import { runScript as execScript, ensureNopluginDir } from "./executor.mjs";
|
|
8
8
|
import { withFileLockSync } from "../../shared/atomic-file.mjs";
|
|
9
|
-
import {
|
|
9
|
+
import { makeAgentDispatch } from '../../agent/orchestrator/agent-runtime/agent-dispatch.mjs';
|
|
10
10
|
|
|
11
|
-
const schedulerLlm =
|
|
11
|
+
const schedulerLlm = makeAgentDispatch({ taskType: 'scheduler-task', role: 'scheduler-task', sourceType: 'scheduler' });
|
|
12
12
|
const SCHEDULE_LOG = join(DATA_DIR, "schedule.log");
|
|
13
13
|
// Buffered async logger — coalesces per-line appends into batched writes.
|
|
14
14
|
let _schedLogBuf = [];
|
|
@@ -265,6 +265,7 @@ ${prompt}`;
|
|
|
265
265
|
}
|
|
266
266
|
static SCHEDULER_LOCK = join(tmpdir(), "mixdog-scheduler.lock");
|
|
267
267
|
static INSTANCE_UUID = randomUUID();
|
|
268
|
+
static _exitHookInstalled = false;
|
|
268
269
|
start() {
|
|
269
270
|
if (this.tickTimer) return;
|
|
270
271
|
const total = this.nonInteractive.length + this.interactive.length;
|
|
@@ -328,18 +329,21 @@ ${Scheduler.INSTANCE_UUID}`;
|
|
|
328
329
|
}
|
|
329
330
|
}, { timeoutMs: 60000, staleMs: 30000 });
|
|
330
331
|
if (!acquiredSchedulerLock) return;
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
332
|
+
if (!Scheduler._exitHookInstalled) {
|
|
333
|
+
Scheduler._exitHookInstalled = true;
|
|
334
|
+
process.on("exit", () => {
|
|
335
|
+
// Verify ownership before unlink: an exiting process whose lock
|
|
336
|
+
// was already reclaimed by a newer owner (PID-reuse / restart race)
|
|
337
|
+
// must NOT delete the new owner's lock file. Read-verify-then-unlink
|
|
338
|
+
// mirrors memory/index.mjs releaseLock().
|
|
339
|
+
try {
|
|
340
|
+
const content = readFileSync(Scheduler.SCHEDULER_LOCK, "utf8");
|
|
341
|
+
const lockedPid = parseInt(content.split("\n")[0]);
|
|
342
|
+
if (lockedPid === process.pid) unlinkSync(Scheduler.SCHEDULER_LOCK);
|
|
343
|
+
} catch {
|
|
344
|
+
}
|
|
345
|
+
});
|
|
346
|
+
}
|
|
343
347
|
logSchedule(`${this.nonInteractive.length} non-interactive, ${this.interactive.length} interactive
|
|
344
348
|
`);
|
|
345
349
|
this.registerCronJobs();
|
|
@@ -2,6 +2,7 @@ import { readFileSync, readdirSync, statSync } from "fs";
|
|
|
2
2
|
import { execFileSync } from "child_process";
|
|
3
3
|
import { basename, join, resolve } from "path";
|
|
4
4
|
import { homedir } from "os";
|
|
5
|
+
import { mixdogHome } from "../../shared/plugin-paths.mjs";
|
|
5
6
|
|
|
6
7
|
function cwdToProjectSlug(cwd) {
|
|
7
8
|
return resolve(cwd).replace(/\\/g, "/").replace(/^([A-Za-z]):/, "$1-").replace(/\//g, "-");
|
|
@@ -41,7 +42,7 @@ function getParentPid(pid) {
|
|
|
41
42
|
}
|
|
42
43
|
}
|
|
43
44
|
function readSessionRecord(pid) {
|
|
44
|
-
const sessionFile = join(
|
|
45
|
+
const sessionFile = join(mixdogHome(), "sessions", `${pid}.json`);
|
|
45
46
|
try {
|
|
46
47
|
const sessionFileStat = statSync(sessionFile);
|
|
47
48
|
const session = JSON.parse(readFileSync(sessionFile, "utf8"));
|
|
@@ -77,7 +78,7 @@ function discoverCurrentClaudeSession() {
|
|
|
77
78
|
return null;
|
|
78
79
|
}
|
|
79
80
|
function listInteractiveClaudeSessions() {
|
|
80
|
-
const sessionsDir = join(
|
|
81
|
+
const sessionsDir = join(mixdogHome(), "sessions");
|
|
81
82
|
try {
|
|
82
83
|
return readdirSync(sessionsDir).filter((file) => file.endsWith(".json")).map((file) => parseInt(basename(file, ".json"), 10)).filter((pid) => Number.isFinite(pid)).map((pid) => readSessionRecord(pid)).filter(isInteractiveSession).sort((a, b) => {
|
|
83
84
|
if (b.startedAt !== a.startedAt) return b.startedAt - a.startedAt;
|
|
@@ -6,9 +6,10 @@ import {
|
|
|
6
6
|
discoverCurrentClaudeSession,
|
|
7
7
|
listInteractiveClaudeSessions
|
|
8
8
|
} from "./session-discovery.mjs";
|
|
9
|
+
import { mixdogHome } from "../../shared/plugin-paths.mjs";
|
|
9
10
|
|
|
10
11
|
function resolveTranscriptForSession(session) {
|
|
11
|
-
const projectsDir = join(
|
|
12
|
+
const projectsDir = join(mixdogHome(), "projects");
|
|
12
13
|
const projectSlug = cwdToProjectSlug(process.cwd());
|
|
13
14
|
const directTranscript = session.transcriptPath ? resolve(session.transcriptPath) : "";
|
|
14
15
|
if (directTranscript && existsSync(directTranscript)) {
|
|
@@ -49,7 +50,7 @@ function resolveTranscriptForSession(session) {
|
|
|
49
50
|
};
|
|
50
51
|
}
|
|
51
52
|
function findLatestTranscriptByMtime(cwd) {
|
|
52
|
-
const projectsDir = join(
|
|
53
|
+
const projectsDir = join(mixdogHome(), "projects");
|
|
53
54
|
const slug = cwdToProjectSlug(cwd ?? process.cwd());
|
|
54
55
|
const projectDir = join(projectsDir, slug);
|
|
55
56
|
try {
|
|
@@ -410,7 +410,7 @@ function resolveNgrokBin() {
|
|
|
410
410
|
// are candidate sources. process.env is the shell-start snapshot; registry
|
|
411
411
|
// is the live user definition. Each candidate is tried in order and the
|
|
412
412
|
// first that resolves to an existing file wins. This recovers two distinct
|
|
413
|
-
// post-setx cases without a
|
|
413
|
+
// post-setx cases without a host-agent restart:
|
|
414
414
|
// (a) env unset, registry set — fresh install + setx after process start
|
|
415
415
|
// (b) env set to stale old path, registry set to new — user moved or
|
|
416
416
|
// re-installed ngrok and setx'd the new path; the old env value would
|
|
@@ -3,27 +3,27 @@ export const TOOL_DEFS = [
|
|
|
3
3
|
name: "reply",
|
|
4
4
|
title: "Discord Reply",
|
|
5
5
|
annotations: { title: "Discord Reply", readOnlyHint: false, destructiveHint: true, idempotentHint: false, openWorldHint: true },
|
|
6
|
-
description: "Send
|
|
6
|
+
description: "Send message to configured channel. files are local paths.",
|
|
7
7
|
inputSchema: {
|
|
8
8
|
type: "object",
|
|
9
9
|
properties: {
|
|
10
|
-
chat_id: { type: "string", description: "Target channel/chat id
|
|
11
|
-
text: { type: "string", description: "Message text
|
|
12
|
-
reply_to: { type: "string", description: "
|
|
10
|
+
chat_id: { type: "string", description: "Target channel/chat id." },
|
|
11
|
+
text: { type: "string", description: "Message text." },
|
|
12
|
+
reply_to: { type: "string", description: "Reply message id." },
|
|
13
13
|
files: {
|
|
14
14
|
type: "array",
|
|
15
15
|
items: { type: "string" },
|
|
16
|
-
description: "Local file paths
|
|
16
|
+
description: "Local file paths."
|
|
17
17
|
},
|
|
18
18
|
embeds: {
|
|
19
19
|
type: "array",
|
|
20
20
|
items: { type: "object", additionalProperties: true },
|
|
21
|
-
description: "Discord
|
|
21
|
+
description: "Discord embeds."
|
|
22
22
|
},
|
|
23
23
|
components: {
|
|
24
24
|
type: "array",
|
|
25
25
|
items: { type: "object", additionalProperties: true },
|
|
26
|
-
description: "Discord
|
|
26
|
+
description: "Discord components."
|
|
27
27
|
}
|
|
28
28
|
},
|
|
29
29
|
required: ["chat_id", "text"]
|
|
@@ -33,13 +33,13 @@ export const TOOL_DEFS = [
|
|
|
33
33
|
name: "react",
|
|
34
34
|
title: "Reaction",
|
|
35
35
|
annotations: { title: "Reaction", readOnlyHint: false, destructiveHint: false, idempotentHint: true, openWorldHint: true },
|
|
36
|
-
description: "
|
|
36
|
+
description: "React to channel message.",
|
|
37
37
|
inputSchema: {
|
|
38
38
|
type: "object",
|
|
39
39
|
properties: {
|
|
40
40
|
chat_id: { type: "string", description: "Target channel/chat id." },
|
|
41
|
-
message_id: { type: "string", description: "Message id
|
|
42
|
-
emoji: { type: "string", description: "Emoji
|
|
41
|
+
message_id: { type: "string", description: "Message id." },
|
|
42
|
+
emoji: { type: "string", description: "Emoji." }
|
|
43
43
|
},
|
|
44
44
|
required: ["chat_id", "message_id", "emoji"]
|
|
45
45
|
}
|
|
@@ -48,22 +48,22 @@ export const TOOL_DEFS = [
|
|
|
48
48
|
name: "edit_message",
|
|
49
49
|
title: "Edit Message",
|
|
50
50
|
annotations: { title: "Edit Message", readOnlyHint: false, destructiveHint: true, idempotentHint: true, openWorldHint: true },
|
|
51
|
-
description: "Edit
|
|
51
|
+
description: "Edit bot-authored channel message.",
|
|
52
52
|
inputSchema: {
|
|
53
53
|
type: "object",
|
|
54
54
|
properties: {
|
|
55
55
|
chat_id: { type: "string", description: "Target channel/chat id." },
|
|
56
|
-
message_id: { type: "string", description: "Bot message id
|
|
57
|
-
text: { type: "string", description: "Replacement
|
|
56
|
+
message_id: { type: "string", description: "Bot message id." },
|
|
57
|
+
text: { type: "string", description: "Replacement text." },
|
|
58
58
|
embeds: {
|
|
59
59
|
type: "array",
|
|
60
60
|
items: { type: "object", additionalProperties: true },
|
|
61
|
-
description: "Replacement
|
|
61
|
+
description: "Replacement embeds."
|
|
62
62
|
},
|
|
63
63
|
components: {
|
|
64
64
|
type: "array",
|
|
65
65
|
items: { type: "object", additionalProperties: true },
|
|
66
|
-
description: "Replacement
|
|
66
|
+
description: "Replacement components."
|
|
67
67
|
}
|
|
68
68
|
},
|
|
69
69
|
required: ["chat_id", "message_id", "text"]
|
|
@@ -73,12 +73,12 @@ export const TOOL_DEFS = [
|
|
|
73
73
|
name: "download_attachment",
|
|
74
74
|
title: "Download Attachment",
|
|
75
75
|
annotations: { title: "Download Attachment", readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: true },
|
|
76
|
-
description: "Download
|
|
76
|
+
description: "Download message attachments.",
|
|
77
77
|
inputSchema: {
|
|
78
78
|
type: "object",
|
|
79
79
|
properties: {
|
|
80
80
|
chat_id: { type: "string", description: "Source channel/chat id." },
|
|
81
|
-
message_id: { type: "string", description: "Message id
|
|
81
|
+
message_id: { type: "string", description: "Message id." }
|
|
82
82
|
},
|
|
83
83
|
required: ["chat_id", "message_id"]
|
|
84
84
|
}
|
|
@@ -87,12 +87,12 @@ export const TOOL_DEFS = [
|
|
|
87
87
|
name: "fetch",
|
|
88
88
|
title: "Fetch",
|
|
89
89
|
annotations: { title: "Fetch", readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: true },
|
|
90
|
-
description: "Discord-only
|
|
90
|
+
description: "Discord-only recent messages. NOT for URLs; use web_fetch.",
|
|
91
91
|
inputSchema: {
|
|
92
92
|
type: "object",
|
|
93
93
|
properties: {
|
|
94
94
|
channel: { type: "string", description: "Discord channel id." },
|
|
95
|
-
limit: { type: "number", description: "
|
|
95
|
+
limit: { type: "number", description: "Max messages." }
|
|
96
96
|
},
|
|
97
97
|
required: ["channel"]
|
|
98
98
|
}
|
|
@@ -101,7 +101,7 @@ export const TOOL_DEFS = [
|
|
|
101
101
|
name: "schedule_status",
|
|
102
102
|
title: "Schedule Status",
|
|
103
103
|
annotations: { title: "Schedule Status", readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false },
|
|
104
|
-
description: "Show
|
|
104
|
+
description: "Show schedule status.",
|
|
105
105
|
inputSchema: {
|
|
106
106
|
type: "object",
|
|
107
107
|
properties: {},
|
|
@@ -112,7 +112,7 @@ export const TOOL_DEFS = [
|
|
|
112
112
|
name: "trigger_schedule",
|
|
113
113
|
title: "Trigger Schedule",
|
|
114
114
|
annotations: { title: "Trigger Schedule", readOnlyHint: false, destructiveHint: false, idempotentHint: false, openWorldHint: false },
|
|
115
|
-
description: "Run
|
|
115
|
+
description: "Run schedule now.",
|
|
116
116
|
inputSchema: {
|
|
117
117
|
type: "object",
|
|
118
118
|
properties: {
|
|
@@ -125,13 +125,13 @@ export const TOOL_DEFS = [
|
|
|
125
125
|
name: "schedule_control",
|
|
126
126
|
title: "Schedule Control",
|
|
127
127
|
annotations: { title: "Schedule Control", readOnlyHint: false, destructiveHint: false, idempotentHint: false, openWorldHint: false },
|
|
128
|
-
description: 'Defer or skip a schedule
|
|
128
|
+
description: 'Defer or skip a schedule.',
|
|
129
129
|
inputSchema: {
|
|
130
130
|
type: "object",
|
|
131
131
|
properties: {
|
|
132
132
|
name: { type: "string", description: "Schedule name." },
|
|
133
|
-
action: { type: "string", enum: ["defer", "skip_today"], description: "
|
|
134
|
-
minutes: { type: "number", description: "
|
|
133
|
+
action: { type: "string", enum: ["defer", "skip_today"], description: "Control action." },
|
|
134
|
+
minutes: { type: "number", description: "Defer minutes." }
|
|
135
135
|
},
|
|
136
136
|
required: ["name", "action"]
|
|
137
137
|
}
|
|
@@ -140,11 +140,11 @@ export const TOOL_DEFS = [
|
|
|
140
140
|
name: "activate_channel_bridge",
|
|
141
141
|
title: "Activate Channel Bridge",
|
|
142
142
|
annotations: { title: "Activate Channel Bridge", readOnlyHint: false, destructiveHint: false, idempotentHint: true, openWorldHint: false },
|
|
143
|
-
description: "
|
|
143
|
+
description: "Toggle channel bridge.",
|
|
144
144
|
inputSchema: {
|
|
145
145
|
type: "object",
|
|
146
146
|
properties: {
|
|
147
|
-
active: { type: "boolean", description: "
|
|
147
|
+
active: { type: "boolean", description: "Activate forwarding." }
|
|
148
148
|
},
|
|
149
149
|
required: ["active"]
|
|
150
150
|
}
|
|
@@ -154,21 +154,21 @@ export const TOOL_DEFS = [
|
|
|
154
154
|
name: "reload_config",
|
|
155
155
|
title: "Reload Config",
|
|
156
156
|
annotations: { title: "Reload Config", readOnlyHint: false, destructiveHint: false, idempotentHint: true, openWorldHint: false },
|
|
157
|
-
description: "Reload channel/runtime
|
|
157
|
+
description: "Reload channel/runtime config.",
|
|
158
158
|
inputSchema: { type: "object", properties: {}, additionalProperties: false }
|
|
159
159
|
},
|
|
160
160
|
{
|
|
161
161
|
name: "inject_command",
|
|
162
162
|
title: "Inject Mixdog Slash Command",
|
|
163
163
|
annotations: { title: "Inject Mixdog Slash Command", readOnlyHint: false, destructiveHint: false, idempotentHint: false, openWorldHint: true },
|
|
164
|
-
description: "Inject
|
|
164
|
+
description: "Inject supported Mixdog slash command.",
|
|
165
165
|
inputSchema: {
|
|
166
166
|
type: "object",
|
|
167
167
|
properties: {
|
|
168
168
|
command: {
|
|
169
169
|
type: "string",
|
|
170
170
|
enum: ["reload-plugins", "clear"],
|
|
171
|
-
description: "Slash command
|
|
171
|
+
description: "Slash command."
|
|
172
172
|
}
|
|
173
173
|
},
|
|
174
174
|
required: ["command"]
|