create-walle 0.9.25 → 0.9.26
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/bin/create-walle.js +815 -45
- package/package.json +2 -2
- package/template/bin/ctm-dev-cleanup.js +90 -4
- package/template/bin/ctm-launch.sh +49 -1
- package/template/bin/dev.sh +45 -1
- package/template/bin/ensure-stable-node.js +132 -0
- package/template/bin/install-service.sh +9 -0
- package/template/claude-task-manager/api-prompts.js +899 -119
- package/template/claude-task-manager/approval-agent.js +360 -40
- package/template/claude-task-manager/bin/ctm-disclaim.c +42 -0
- package/template/claude-task-manager/bin/ctm-hotkey.swift +67 -81
- package/template/claude-task-manager/bin/ctm-screen-auth.swift +37 -0
- package/template/claude-task-manager/bin/install-hotkey.sh +97 -49
- package/template/claude-task-manager/bin/restart-ctm.sh +14 -0
- package/template/claude-task-manager/db.js +399 -48
- package/template/claude-task-manager/docs/approval-hook-sandbox.md +84 -0
- package/template/claude-task-manager/docs/codex-app-server-approvals.md +72 -0
- package/template/claude-task-manager/docs/codex-native-sandbox.md +47 -0
- package/template/claude-task-manager/docs/prompt-editing-tree-design.md +18 -1
- package/template/claude-task-manager/lib/approval-hook.js +200 -0
- package/template/claude-task-manager/lib/approval-self-adapt.js +1 -0
- package/template/claude-task-manager/lib/auth-rules.js +11 -0
- package/template/claude-task-manager/lib/background-llm.js +32 -4
- package/template/claude-task-manager/lib/codesign-identity.js +140 -0
- package/template/claude-task-manager/lib/codex-app-server-client.js +119 -0
- package/template/claude-task-manager/lib/codex-approval-bridge.js +118 -0
- package/template/claude-task-manager/lib/codex-history-terminal-renderer.js +571 -0
- package/template/claude-task-manager/lib/codex-paths.js +73 -0
- package/template/claude-task-manager/lib/codex-rollout-snapshot.js +164 -0
- package/template/claude-task-manager/lib/codex-rollout-tail.js +72 -0
- package/template/claude-task-manager/lib/codex-sandbox-args.js +47 -0
- package/template/claude-task-manager/lib/coding-agent-models.js +118 -71
- package/template/claude-task-manager/lib/command-targets.js +163 -0
- package/template/claude-task-manager/lib/conversation-tail-merge.js +61 -19
- package/template/claude-task-manager/lib/db-owner-worker-client.js +29 -1
- package/template/claude-task-manager/lib/escalation-review.js +80 -3
- package/template/claude-task-manager/lib/flow-control.js +52 -0
- package/template/claude-task-manager/lib/fs-watcher.js +24 -15
- package/template/claude-task-manager/lib/ingest-cooldown.js +68 -0
- package/template/claude-task-manager/lib/jsonl-conversation-parser.js +8 -4
- package/template/claude-task-manager/lib/launchd-recovery.js +92 -0
- package/template/claude-task-manager/lib/microsoft-dev-tunnel-setup.js +207 -52
- package/template/claude-task-manager/lib/mobile-push-store.js +7 -0
- package/template/claude-task-manager/lib/model-overview-brain-fallback.js +102 -1
- package/template/claude-task-manager/lib/model-overview-cache.js +1 -0
- package/template/claude-task-manager/lib/oauth-proxy-supervisor.js +2 -1
- package/template/claude-task-manager/lib/perf-tracker.js +29 -2
- package/template/claude-task-manager/lib/permission-match.js +146 -16
- package/template/claude-task-manager/lib/project-slug.js +33 -0
- package/template/claude-task-manager/lib/prompt-intent.js +51 -4
- package/template/claude-task-manager/lib/read-pool-client.js +48 -3
- package/template/claude-task-manager/lib/real-node.js +73 -0
- package/template/claude-task-manager/lib/runtime-work-registry.js +131 -14
- package/template/claude-task-manager/lib/session-content-backfill.js +24 -5
- package/template/claude-task-manager/lib/session-diagnostics-batch.js +87 -0
- package/template/claude-task-manager/lib/session-history.js +5 -7
- package/template/claude-task-manager/lib/session-host-manager.js +19 -0
- package/template/claude-task-manager/lib/session-jobs.js +6 -0
- package/template/claude-task-manager/lib/session-message-response-cache.js +89 -0
- package/template/claude-task-manager/lib/session-messages-page.js +211 -0
- package/template/claude-task-manager/lib/session-messages-projection.js +170 -0
- package/template/claude-task-manager/lib/session-standup.js +8 -0
- package/template/claude-task-manager/lib/session-timeline-summary.js +16 -2
- package/template/claude-task-manager/lib/session-token-usage.js +30 -8
- package/template/claude-task-manager/lib/session-workspace-binding.js +29 -15
- package/template/claude-task-manager/lib/storage-migration.js +2 -1
- package/template/claude-task-manager/lib/transcript-store.js +179 -12
- package/template/claude-task-manager/lib/walle-ctm-history.js +298 -11
- package/template/claude-task-manager/lib/walle-permission-reply.js +49 -0
- package/template/claude-task-manager/lib/walle-session-cache.js +22 -1
- package/template/claude-task-manager/lib/walle-supervisor.js +42 -3
- package/template/claude-task-manager/package.json +5 -2
- package/template/claude-task-manager/prompt-harvest.js +31 -11
- package/template/claude-task-manager/providers/claude-code.js +29 -1
- package/template/claude-task-manager/providers/codex.js +13 -1
- package/template/claude-task-manager/public/css/setup.css +11 -0
- package/template/claude-task-manager/public/css/walle-session.css +132 -4
- package/template/claude-task-manager/public/css/walle.css +89 -0
- package/template/claude-task-manager/public/icon-16.png +0 -0
- package/template/claude-task-manager/public/icon-32.png +0 -0
- package/template/claude-task-manager/public/icon-512.png +0 -0
- package/template/claude-task-manager/public/index.html +2483 -165
- package/template/claude-task-manager/public/js/activation-render-check.js +55 -0
- package/template/claude-task-manager/public/js/flow-control-policy.js +52 -0
- package/template/claude-task-manager/public/js/message-renderer.js +60 -1
- package/template/claude-task-manager/public/js/prompts.js +13 -1
- package/template/claude-task-manager/public/js/session-status-precedence.js +9 -3
- package/template/claude-task-manager/public/js/setup.js +54 -10
- package/template/claude-task-manager/public/js/stream-resize-policy.js +80 -0
- package/template/claude-task-manager/public/js/stream-view.js +78 -0
- package/template/claude-task-manager/public/js/terminal-reconciler.js +52 -2
- package/template/claude-task-manager/public/js/tool-state.js +155 -0
- package/template/claude-task-manager/public/js/walle-session.js +887 -326
- package/template/claude-task-manager/public/js/walle.js +306 -195
- package/template/claude-task-manager/public/m/app.css +1 -0
- package/template/claude-task-manager/public/m/app.js +33 -3
- package/template/claude-task-manager/queue-engine.js +45 -1
- package/template/claude-task-manager/server.js +3367 -540
- package/template/claude-task-manager/workers/approval-blocklist.js +130 -17
- package/template/claude-task-manager/workers/db-owner-worker.js +31 -1
- package/template/claude-task-manager/workers/read-pool-worker.js +92 -5
- package/template/claude-task-manager/workers/session-host-process.js +10 -0
- package/template/claude-task-manager/workers/state-detectors/codex.js +58 -7
- package/template/package.json +2 -3
- package/template/shared/icons/AppIcon-ctm.icns +0 -0
- package/template/shared/icons/AppIcon-walle.icns +0 -0
- package/template/wall-e/agent.js +139 -18
- package/template/wall-e/api-walle.js +201 -22
- package/template/wall-e/bin/train-gemma-e4b-tooluse.js +1981 -0
- package/template/wall-e/brain.js +1049 -39
- package/template/wall-e/chat.js +427 -86
- package/template/wall-e/coding/acceptance-contract.js +26 -1
- package/template/wall-e/coding/action-memory-policy.js +353 -0
- package/template/wall-e/coding/action-memory-store.js +814 -0
- package/template/wall-e/coding/initial-messages.js +197 -0
- package/template/wall-e/coding/no-progress-guard.js +327 -0
- package/template/wall-e/coding/permission-service.js +88 -22
- package/template/wall-e/coding/session-workspaces.js +81 -0
- package/template/wall-e/coding/shell-sandbox.js +124 -0
- package/template/wall-e/coding/stream-processor.js +63 -2
- package/template/wall-e/coding/tool-execution-controller.js +14 -1
- package/template/wall-e/coding/tool-registry.js +1 -1
- package/template/wall-e/coding/transcript-writer.js +3 -0
- package/template/wall-e/coding-orchestrator.js +636 -35
- package/template/wall-e/coding-prompts.js +51 -2
- package/template/wall-e/docs/model-routing-policy.md +59 -0
- package/template/wall-e/docs/walle-shell-sandbox.md +61 -0
- package/template/wall-e/extraction/knowledge-extractor.js +76 -23
- package/template/wall-e/http/chat-api.js +30 -12
- package/template/wall-e/http/model-admin.js +93 -1
- package/template/wall-e/lib/background-lanes.js +133 -0
- package/template/wall-e/lib/boot-profile.js +11 -0
- package/template/wall-e/lib/brain-owner-worker-client.js +324 -0
- package/template/wall-e/lib/brain-read-pool-client.js +311 -0
- package/template/wall-e/lib/diagnostics-flags.js +87 -0
- package/template/wall-e/lib/event-loop-monitor.js +74 -3
- package/template/wall-e/lib/mcp-integration.js +7 -1
- package/template/wall-e/lib/real-node.js +98 -0
- package/template/wall-e/lib/runtime-health.js +206 -0
- package/template/wall-e/lib/runtime-worker-pool.js +101 -0
- package/template/wall-e/lib/scheduler-worker-jobs.js +231 -0
- package/template/wall-e/lib/scheduler.js +446 -17
- package/template/wall-e/lib/service-health.js +61 -2
- package/template/wall-e/lib/service-readiness.js +258 -0
- package/template/wall-e/lib/usage.js +152 -0
- package/template/wall-e/lib/worker-thread-pool.js +389 -0
- package/template/wall-e/llm/client.js +81 -4
- package/template/wall-e/llm/default-fallback.js +54 -8
- package/template/wall-e/llm/mlx.js +536 -73
- package/template/wall-e/llm/mlx.plugin.json +1 -1
- package/template/wall-e/llm/ollama.js +342 -43
- package/template/wall-e/llm/provider-error.js +18 -1
- package/template/wall-e/llm/provider-health-state.js +176 -0
- package/template/wall-e/llm/routing-policy.js +796 -0
- package/template/wall-e/llm/supported-models.js +5 -0
- package/template/wall-e/loops/tasks.js +60 -14
- package/template/wall-e/loops/think.js +89 -24
- package/template/wall-e/mcp-server.js +192 -28
- package/template/wall-e/server.js +32 -7
- package/template/wall-e/skills/script-skill-runner.js +8 -1
- package/template/wall-e/skills/skill-planner.js +64 -1
- package/template/wall-e/tools/builtin-middleware.js +67 -2
- package/template/wall-e/tools/local-tools.js +116 -26
- package/template/wall-e/tools/permission-checker.js +52 -4
- package/template/wall-e/tools/permission-rules.js +36 -0
- package/template/wall-e/tools/shell-analyzer.js +46 -1
- package/template/wall-e/training/gemma-e4b-qlora.js +314 -0
- package/template/wall-e/training/real-trajectory-miner.js +2617 -0
- package/template/wall-e/training/replay-eval-analysis.js +151 -0
- package/template/wall-e/training/run-shell-command-selector.js +277 -0
- package/template/wall-e/training/tool-sft-dataset.js +312 -0
- package/template/wall-e/training/tool-sft-renderers.js +144 -0
- package/template/wall-e/training/tool-trace-harvester.js +1440 -0
- package/template/wall-e/training/trajectory-action-selector.js +364 -0
- package/template/wall-e/weather-runtime.js +232 -0
- package/template/wall-e/workers/brain-owner-worker.js +162 -0
- package/template/wall-e/workers/brain-read-worker.js +148 -0
- package/template/wall-e/workers/runtime-worker.js +145 -0
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
// Canonical Wall-E tool-state machine — the SINGLE source of truth for how a
|
|
2
|
+
// tool call's status evolves from the progress events Wall-E streams. Both
|
|
3
|
+
// server-side projections (the per-message transcript `toolCalls` in
|
|
4
|
+
// lib/walle-ctm-history.js AND the WORK-bar lib/runtime-work-registry.js) and
|
|
5
|
+
// the browser (public/js/walle-session.js) consume this one module, so they can
|
|
6
|
+
// never disagree about whether a tool is running, awaiting approval, or done.
|
|
7
|
+
//
|
|
8
|
+
// UMD: `module.exports` under Node (the server libs `require()` it), `window
|
|
9
|
+
// .CTMToolState` in the browser (index.html loads it before walle-session.js).
|
|
10
|
+
//
|
|
11
|
+
// Status set (the machine):
|
|
12
|
+
// pending tool announced, not yet executing/approved
|
|
13
|
+
// awaiting_permission blocked on the user's approval (NOT "running")
|
|
14
|
+
// running actively executing
|
|
15
|
+
// completed finished OK
|
|
16
|
+
// error failed, denied, or gateway-blocked
|
|
17
|
+
//
|
|
18
|
+
// Transitions (driven by the actual events emitWalleProgress relays):
|
|
19
|
+
// tool_call -> running (unless already awaiting_permission)
|
|
20
|
+
// permission_request -> awaiting_permission
|
|
21
|
+
// permission_resolved -> running (allow) | error (deny)
|
|
22
|
+
// tool_result/tool_done-> completed | error (on failure/blocked)
|
|
23
|
+
(function (root, factory) {
|
|
24
|
+
if (typeof module === 'object' && module.exports) module.exports = factory();
|
|
25
|
+
else root.CTMToolState = factory();
|
|
26
|
+
})(typeof self !== 'undefined' ? self : this, function () {
|
|
27
|
+
'use strict';
|
|
28
|
+
|
|
29
|
+
var STATUS = {
|
|
30
|
+
PENDING: 'pending',
|
|
31
|
+
AWAITING_PERMISSION: 'awaiting_permission',
|
|
32
|
+
RUNNING: 'running',
|
|
33
|
+
COMPLETED: 'completed',
|
|
34
|
+
ERROR: 'error',
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
var ACTIVE = { pending: true, awaiting_permission: true, running: true };
|
|
38
|
+
var TERMINAL = { completed: true, error: true };
|
|
39
|
+
|
|
40
|
+
// The five tool-lifecycle event types this machine reacts to. Everything else
|
|
41
|
+
// (thinking, skill_loaded, cancelled, …) is NOT part of a single tool's state
|
|
42
|
+
// and is left to each projection to handle.
|
|
43
|
+
var LIFECYCLE = {
|
|
44
|
+
tool_call: true,
|
|
45
|
+
permission_request: true,
|
|
46
|
+
permission_resolved: true,
|
|
47
|
+
tool_result: true,
|
|
48
|
+
tool_done: true,
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
function isLifecycleEvent(event) {
|
|
52
|
+
return !!(event && LIFECYCLE[String(event.type || '')]);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
// Canonical id extraction — superset of every variant the two server files and
|
|
56
|
+
// the client used independently.
|
|
57
|
+
function toolEventId(event) {
|
|
58
|
+
if (!event) return '';
|
|
59
|
+
return String(event.id || event.toolCallId || event.tool_call_id || event.callId || event.call_id || '');
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
// Canonical name — returns '' when the event carries no name yet (a bare
|
|
63
|
+
// id-only block open). Callers decide what to do with the empty case (the
|
|
64
|
+
// phantom-'tool' kill skips creating anything until a named event arrives).
|
|
65
|
+
function toolEventName(event) {
|
|
66
|
+
if (!event) return '';
|
|
67
|
+
return String(event.tool || event.name || event.toolName || event.tool_name || event.skill || '');
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
function isFailureResult(event) {
|
|
71
|
+
if (!event) return false;
|
|
72
|
+
if (event.error || event.failed) return true;
|
|
73
|
+
if (String(event.status || '').toLowerCase() === 'error') return true;
|
|
74
|
+
// The stream processor emits a `Blocked <tool>` / `Failed <tool>` summary for
|
|
75
|
+
// gateway-blocked and errored tools.
|
|
76
|
+
return /^(Blocked|Failed)\b/i.test(String(event.summary || ''));
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
function isAllowDecision(event) {
|
|
80
|
+
return String(event && event.decision || '').toLowerCase() === 'allow';
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
// The core transition. Given the PREVIOUS canonical status (or '' if new) and a
|
|
84
|
+
// raw event, return the next canonical status — or null if the event is not a
|
|
85
|
+
// tool-lifecycle event (caller should ignore it for tool-state purposes).
|
|
86
|
+
function nextStatus(prevStatus, event) {
|
|
87
|
+
if (!isLifecycleEvent(event)) return null;
|
|
88
|
+
switch (String(event.type)) {
|
|
89
|
+
case 'tool_call':
|
|
90
|
+
// A tool that's already waiting on approval stays waiting until resolved.
|
|
91
|
+
return prevStatus === STATUS.AWAITING_PERMISSION ? STATUS.AWAITING_PERMISSION : STATUS.RUNNING;
|
|
92
|
+
case 'permission_request':
|
|
93
|
+
return STATUS.AWAITING_PERMISSION;
|
|
94
|
+
case 'permission_resolved':
|
|
95
|
+
return isAllowDecision(event) ? STATUS.RUNNING : STATUS.ERROR;
|
|
96
|
+
case 'tool_result':
|
|
97
|
+
case 'tool_done':
|
|
98
|
+
return isFailureResult(event) ? STATUS.ERROR : STATUS.COMPLETED;
|
|
99
|
+
default:
|
|
100
|
+
return null;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
function isActive(status) { return !!ACTIVE[status]; }
|
|
105
|
+
function isTerminal(status) { return !!TERMINAL[status]; }
|
|
106
|
+
|
|
107
|
+
// Human label for a status, used identically by the WORK bar and the cards.
|
|
108
|
+
function statusLabel(status, name, command) {
|
|
109
|
+
var n = name || 'tool';
|
|
110
|
+
switch (status) {
|
|
111
|
+
case STATUS.AWAITING_PERMISSION:
|
|
112
|
+
return command ? 'Awaiting approval: ' + command : 'Awaiting approval for ' + n;
|
|
113
|
+
case STATUS.RUNNING:
|
|
114
|
+
case STATUS.PENDING:
|
|
115
|
+
return 'Running ' + n;
|
|
116
|
+
case STATUS.COMPLETED:
|
|
117
|
+
return 'Completed ' + n;
|
|
118
|
+
case STATUS.ERROR:
|
|
119
|
+
return 'Failed ' + n;
|
|
120
|
+
default:
|
|
121
|
+
return n;
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
// Projection mappers — each store keeps its own historical vocabulary; these
|
|
126
|
+
// translate the ONE canonical status into it so the decision stays centralized.
|
|
127
|
+
// WORK-bar registry: running | awaiting_permission | completed | failed.
|
|
128
|
+
function toRegistryStatus(status) {
|
|
129
|
+
if (status === STATUS.ERROR) return 'failed';
|
|
130
|
+
if (status === STATUS.PENDING) return 'running';
|
|
131
|
+
return status; // running | awaiting_permission | completed pass through
|
|
132
|
+
}
|
|
133
|
+
// Per-message transcript toolCalls: working | awaiting_permission | done | error.
|
|
134
|
+
function toLegacyToolStatus(status) {
|
|
135
|
+
if (status === STATUS.COMPLETED) return 'done';
|
|
136
|
+
if (status === STATUS.ERROR) return 'error';
|
|
137
|
+
if (status === STATUS.AWAITING_PERMISSION) return 'awaiting_permission';
|
|
138
|
+
return 'working'; // pending | running
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
return {
|
|
142
|
+
STATUS: STATUS,
|
|
143
|
+
isLifecycleEvent: isLifecycleEvent,
|
|
144
|
+
toolEventId: toolEventId,
|
|
145
|
+
toolEventName: toolEventName,
|
|
146
|
+
isFailureResult: isFailureResult,
|
|
147
|
+
isAllowDecision: isAllowDecision,
|
|
148
|
+
nextStatus: nextStatus,
|
|
149
|
+
isActive: isActive,
|
|
150
|
+
isTerminal: isTerminal,
|
|
151
|
+
statusLabel: statusLabel,
|
|
152
|
+
toRegistryStatus: toRegistryStatus,
|
|
153
|
+
toLegacyToolStatus: toLegacyToolStatus,
|
|
154
|
+
};
|
|
155
|
+
});
|