mixdog 1.0.2 → 1.0.4
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 +8 -0
- package/package.json +1 -1
- package/src/defaults/skills/browser-use/SKILL.md +14 -6
- package/src/defaults/skills/goal-management/SKILL.md +2 -2
- package/src/runtime/agent/orchestrator/providers/anthropic-midstream-recovery.mjs +10 -1
- package/src/runtime/agent/orchestrator/runtime-core/goal-tool-defs.mjs +1 -1
- package/src/runtime/agent/orchestrator/session/cache/scoped-cache.mjs +40 -99
- package/src/runtime/agent/orchestrator/session/compact/runner.mjs +6 -1
- package/src/runtime/agent/orchestrator/session/loop/fresh-context.mjs +2 -0
- package/src/runtime/agent/orchestrator/session/loop/tool-exec/before-hook.mjs +7 -3
- package/src/runtime/agent/orchestrator/tools/builtin/cache-layers.mjs +18 -38
- package/src/runtime/agent/orchestrator/tools/builtin/lib/grep-path-fanout.mjs +59 -32
- package/src/runtime/agent/orchestrator/tools/builtin/lib/grep-pattern-fanout.mjs +15 -10
- package/src/runtime/agent/orchestrator/tools/builtin/lib/grep-request.mjs +1 -1
- package/src/runtime/agent/orchestrator/tools/builtin/lib/shared-native-scan.mjs +12 -0
- package/src/runtime/agent/orchestrator/tools/builtin/read-source-windows.mjs +14 -0
- package/src/runtime/agent/orchestrator/tools/graph-manifest.json +13 -13
- package/src/runtime/agent/orchestrator/tools/patch/apply-patch/codex-batch.mjs +3 -1
- package/src/runtime/agent/orchestrator/tools/patch/dispatch.mjs +17 -9
- package/src/runtime/agent/orchestrator/tools/patch/orchestrator.mjs +1 -0
- package/src/runtime/agent/orchestrator/tools/patch/wave.mjs +4 -0
- package/src/runtime/browser-bridge/input-fields.mjs +1 -1
- package/src/runtime/browser-bridge/tool-defs.mjs +1 -1
- package/src/runtime/computer-bridge/actions.mjs +0 -13
- package/src/runtime/media/adapters/antigravity-image.mjs +7 -3
- package/src/runtime/media/adapters/codex-image.mjs +12 -1
- package/src/runtime/media/adapters/gemini-image.mjs +17 -6
- package/src/runtime/media/adapters/gemini-video.mjs +19 -9
- package/src/runtime/media/adapters/xai-media.mjs +20 -7
- package/src/runtime/media/jobs.mjs +35 -3
- package/src/runtime/media/media-usage.mjs +126 -0
- package/src/runtime/media/tool.mjs +16 -4
- package/src/runtime/shared/llm/cost.mjs +50 -3
- package/src/runtime/shared/llm/model-catalog-projection.mjs +7 -2
- package/src/runtime/shared/llm/model-catalog.mjs +2 -1
- package/src/runtime/shared/llm/model-pricing-rates.mjs +21 -0
- package/src/runtime/shared/llm/usage-accounting.mjs +25 -5
- package/src/runtime/shared/llm/usage-context.mjs +6 -0
- package/src/runtime/shared/llm/usage-ledger-import.mjs +1 -0
- package/src/session-runtime/internal-tool-executor/feature-tools.mjs +9 -1
- package/src/session-runtime/services/agent-tool/index-write-queue.mjs +38 -6
- package/src/session-runtime/services/agent-tool/worker-index/row-store.mjs +9 -2
- package/src/session-runtime/services/agent-tool/worker-index.mjs +6 -3
- package/src/session-runtime/services/hook-bus/event-runner.mjs +10 -2
- package/src/session-runtime/services/hook-bus/tool-gate.mjs +5 -2
- package/src/tui/dist/index.mjs +7 -3
|
@@ -11,8 +11,8 @@ import { parseHandlerOutput } from './handlers.mjs';
|
|
|
11
11
|
import { createHandlerDispatch } from './handler-dispatch.mjs';
|
|
12
12
|
import { handlerDedupeKey, shellCountFor } from './rules.mjs';
|
|
13
13
|
|
|
14
|
-
// A failed run is reported as a hook:error and
|
|
15
|
-
// or null when the run produced usable output.
|
|
14
|
+
// A failed run is reported as a hook:error and blocks PreToolUse; other events
|
|
15
|
+
// skip it. Returns the message or null when the run produced usable output.
|
|
16
16
|
function runFailure(run, handler) {
|
|
17
17
|
if (run.timedOut)
|
|
18
18
|
return `hook ${shellCountFor(handler)} timed out: ${handler.command || handler.url || handler.type}`;
|
|
@@ -23,6 +23,12 @@ function runFailure(run, handler) {
|
|
|
23
23
|
return null;
|
|
24
24
|
}
|
|
25
25
|
|
|
26
|
+
function failClosed(agg, message) {
|
|
27
|
+
agg.blocked = true;
|
|
28
|
+
agg.reason = `PreToolUse policy check failed: ${message}`;
|
|
29
|
+
return agg;
|
|
30
|
+
}
|
|
31
|
+
|
|
26
32
|
function foldParsedOutput(agg, parsed) {
|
|
27
33
|
if (parsed.additionalContext) agg.additionalContext.push(parsed.additionalContext);
|
|
28
34
|
if (parsed.updatedInput && !agg.updatedInput) agg.updatedInput = parsed.updatedInput;
|
|
@@ -90,12 +96,14 @@ export function createEventRunner({ loadConfig, emit, cursor, pluginData, prompt
|
|
|
90
96
|
} catch (error) {
|
|
91
97
|
throwIfAborted(signal);
|
|
92
98
|
emit('hook:error', { name: payload.tool_name || eventName, error: error?.message || String(error) });
|
|
99
|
+
if (eventName === 'PreToolUse') return failClosed(agg, error?.message || String(error));
|
|
93
100
|
continue;
|
|
94
101
|
}
|
|
95
102
|
if (!run) continue;
|
|
96
103
|
const failure = runFailure(run, handler);
|
|
97
104
|
if (failure) {
|
|
98
105
|
emit('hook:error', { name: payload.tool_name || eventName, error: failure });
|
|
106
|
+
if (eventName === 'PreToolUse') return failClosed(agg, failure);
|
|
99
107
|
continue;
|
|
100
108
|
}
|
|
101
109
|
foldParsedOutput(agg, parseHandlerOutput(run, eventName));
|
|
@@ -65,8 +65,11 @@ export function createToolGate({ loadConfig, loadRules, runEventHandlers, emit,
|
|
|
65
65
|
return standardDecision(agg, input) ?? legacyDecision(cfg, input);
|
|
66
66
|
} catch (error) {
|
|
67
67
|
throwIfAborted(signal);
|
|
68
|
-
|
|
69
|
-
|
|
68
|
+
const message = error?.message || String(error);
|
|
69
|
+
emit('hook:error', { name: input.name || input.tool_name || 'tool', error: message });
|
|
70
|
+
const reason = `PreToolUse policy check failed: ${message}`;
|
|
71
|
+
emit('tool:deny', { ...identityOf(input), reason });
|
|
72
|
+
return { action: 'deny', reason };
|
|
70
73
|
}
|
|
71
74
|
};
|
|
72
75
|
}
|
package/src/tui/dist/index.mjs
CHANGED
|
@@ -47669,7 +47669,11 @@ var LITELLM_NUMBER_FIELDS = [
|
|
|
47669
47669
|
"input_cost_per_token",
|
|
47670
47670
|
"output_cost_per_token",
|
|
47671
47671
|
"cache_read_input_token_cost",
|
|
47672
|
-
"cache_creation_input_token_cost"
|
|
47672
|
+
"cache_creation_input_token_cost",
|
|
47673
|
+
"output_cost_per_image",
|
|
47674
|
+
"output_cost_per_image_token",
|
|
47675
|
+
"output_cost_per_video_token",
|
|
47676
|
+
"output_cost_per_second"
|
|
47673
47677
|
];
|
|
47674
47678
|
var LITELLM_FLAG_FIELDS = [
|
|
47675
47679
|
"supports_vision",
|
|
@@ -47688,9 +47692,9 @@ function projectLitellmRow(row) {
|
|
|
47688
47692
|
if (typeof value === "number" && Number.isFinite(value)) out[field] = value;
|
|
47689
47693
|
}
|
|
47690
47694
|
for (const [field, value] of Object.entries(row)) {
|
|
47691
|
-
if (/^(?:input_cost_per_token|output_cost_per_token|cache_read_input_token_cost|cache_creation_input_token_cost)(?:_above_\d+k_tokens)?(?:_priority)?$/.test(
|
|
47695
|
+
if ((/^(?:input_cost_per_token|output_cost_per_token|cache_read_input_token_cost|cache_creation_input_token_cost)(?:_above_\d+k_tokens)?(?:_priority)?$/.test(
|
|
47692
47696
|
field
|
|
47693
|
-
) && typeof value === "number" && Number.isFinite(value))
|
|
47697
|
+
) || /^output_cost_per_second_\w+$/.test(field)) && typeof value === "number" && Number.isFinite(value))
|
|
47694
47698
|
out[field] = value;
|
|
47695
47699
|
}
|
|
47696
47700
|
for (const field of LITELLM_FLAG_FIELDS) {
|