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,176 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const DEFAULT_PROVIDER_STATUS_MAX_AGE_MS = 10 * 60 * 1000;
|
|
4
|
+
|
|
5
|
+
function nowIso() {
|
|
6
|
+
return new Date().toISOString();
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
function canonicalProvider(value) {
|
|
10
|
+
return String(value || '').trim().toLowerCase();
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
function canonicalModel(value) {
|
|
14
|
+
return String(value || '').trim().toLowerCase();
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
function providerModelKey(provider, model) {
|
|
18
|
+
const p = canonicalProvider(provider || 'default');
|
|
19
|
+
const m = canonicalModel(model || 'default');
|
|
20
|
+
return `${p}:${m}`;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
function providerStatusIssueId(provider, model) {
|
|
24
|
+
const p = encodeURIComponent(canonicalProvider(provider || 'default'));
|
|
25
|
+
const m = encodeURIComponent(canonicalModel(model || 'default'));
|
|
26
|
+
return `provider_status:${p}:${m}`;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
function parseProviderStatusIssueId(value) {
|
|
30
|
+
const id = String(value || '');
|
|
31
|
+
if (!id.startsWith('provider_status:')) return null;
|
|
32
|
+
const rest = id.slice('provider_status:'.length);
|
|
33
|
+
const firstColon = rest.indexOf(':');
|
|
34
|
+
if (firstColon < 0) return null;
|
|
35
|
+
try {
|
|
36
|
+
return {
|
|
37
|
+
provider: decodeURIComponent(rest.slice(0, firstColon)),
|
|
38
|
+
model: decodeURIComponent(rest.slice(firstColon + 1)),
|
|
39
|
+
};
|
|
40
|
+
} catch {
|
|
41
|
+
return null;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
function parseStatusMap(brain) {
|
|
46
|
+
if (!brain || typeof brain.getKv !== 'function') return {};
|
|
47
|
+
try {
|
|
48
|
+
const raw = brain.getKv('provider_health_status');
|
|
49
|
+
const parsed = raw ? JSON.parse(raw) : {};
|
|
50
|
+
return parsed && typeof parsed === 'object' && !Array.isArray(parsed) ? parsed : {};
|
|
51
|
+
} catch {
|
|
52
|
+
return {};
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
function writeStatusMap(brain, statuses) {
|
|
57
|
+
if (!brain || typeof brain.setKv !== 'function') return false;
|
|
58
|
+
brain.setKv('provider_health_status', JSON.stringify(statuses || {}));
|
|
59
|
+
return true;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
function publicProviderStatus(status, nowMs = Date.now()) {
|
|
63
|
+
if (!status || typeof status !== 'object') return null;
|
|
64
|
+
const checkedAt = status.checked_at || status.checkedAt || '';
|
|
65
|
+
const checkedMs = checkedAt ? Date.parse(checkedAt) : 0;
|
|
66
|
+
return {
|
|
67
|
+
provider: status.provider || '',
|
|
68
|
+
model: status.model || '',
|
|
69
|
+
issue_id: providerStatusIssueId(status.provider, status.model),
|
|
70
|
+
ok: status.ok === true,
|
|
71
|
+
status: status.ok === true ? 'ok' : 'error',
|
|
72
|
+
source: status.source || '',
|
|
73
|
+
error_type: status.error_type || '',
|
|
74
|
+
error: status.error || '',
|
|
75
|
+
latency_ms: Number.isFinite(Number(status.latency_ms)) ? Number(status.latency_ms) : null,
|
|
76
|
+
checked_at: checkedAt,
|
|
77
|
+
age_ms: checkedMs ? Math.max(0, nowMs - checkedMs) : null,
|
|
78
|
+
diagnostics: status.diagnostics && typeof status.diagnostics === 'object' ? status.diagnostics : null,
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
function recordProviderHealthStatus(status, opts = {}) {
|
|
83
|
+
if (!status || !status.provider) return { recorded: false };
|
|
84
|
+
let brain = opts.brain;
|
|
85
|
+
if (!brain) {
|
|
86
|
+
try { brain = require('../brain'); } catch { brain = null; }
|
|
87
|
+
}
|
|
88
|
+
if (!brain) return { recorded: false };
|
|
89
|
+
|
|
90
|
+
const provider = canonicalProvider(status.provider);
|
|
91
|
+
const model = String(status.model || '').trim();
|
|
92
|
+
const key = providerModelKey(provider, model);
|
|
93
|
+
const statuses = parseStatusMap(brain);
|
|
94
|
+
const entry = {
|
|
95
|
+
provider,
|
|
96
|
+
model,
|
|
97
|
+
ok: status.ok === true,
|
|
98
|
+
source: String(status.source || 'provider').slice(0, 80),
|
|
99
|
+
error_type: String(status.error_type || status.type || '').slice(0, 80),
|
|
100
|
+
error: String(status.error || status.message || '').slice(0, 240),
|
|
101
|
+
latency_ms: Number.isFinite(Number(status.latency_ms)) ? Number(status.latency_ms) : null,
|
|
102
|
+
checked_at: status.checked_at || status.checkedAt || nowIso(),
|
|
103
|
+
diagnostics: status.diagnostics && typeof status.diagnostics === 'object' ? status.diagnostics : null,
|
|
104
|
+
};
|
|
105
|
+
statuses[key] = entry;
|
|
106
|
+
writeStatusMap(brain, statuses);
|
|
107
|
+
|
|
108
|
+
let cleared = 0;
|
|
109
|
+
if (entry.ok && opts.clearTransientAlerts !== false) {
|
|
110
|
+
try {
|
|
111
|
+
const planner = require('../skills/skill-planner');
|
|
112
|
+
cleared = planner.clearRecoveredProviderAlerts({ provider, model }).cleared || 0;
|
|
113
|
+
} catch {}
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
return { recorded: true, key, cleared };
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
function getProviderHealthStatus(provider, model, opts = {}) {
|
|
120
|
+
let brain = opts.brain;
|
|
121
|
+
if (!brain) {
|
|
122
|
+
try { brain = require('../brain'); } catch { brain = null; }
|
|
123
|
+
}
|
|
124
|
+
if (!brain) return null;
|
|
125
|
+
const statuses = parseStatusMap(brain);
|
|
126
|
+
const providerKey = canonicalProvider(provider);
|
|
127
|
+
const modelKey = canonicalModel(model);
|
|
128
|
+
const exact = statuses[providerModelKey(providerKey, modelKey)];
|
|
129
|
+
const providerOnly = Object.values(statuses)
|
|
130
|
+
.filter((status) => canonicalProvider(status.provider) === providerKey)
|
|
131
|
+
.sort((a, b) => Date.parse(b.checked_at || '') - Date.parse(a.checked_at || ''))[0];
|
|
132
|
+
const status = exact || providerOnly || null;
|
|
133
|
+
if (!status) return null;
|
|
134
|
+
const maxAgeMs = opts.maxAgeMs ?? DEFAULT_PROVIDER_STATUS_MAX_AGE_MS;
|
|
135
|
+
const checkedMs = Date.parse(status.checked_at || '');
|
|
136
|
+
const referenceMs = opts.nowMs || Date.now();
|
|
137
|
+
if (Number.isFinite(maxAgeMs) && maxAgeMs > 0 && checkedMs && referenceMs - checkedMs > maxAgeMs) {
|
|
138
|
+
return null;
|
|
139
|
+
}
|
|
140
|
+
return publicProviderStatus(status, referenceMs);
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
function clearProviderHealthStatus(target = {}, opts = {}) {
|
|
144
|
+
const provider = canonicalProvider(target.provider);
|
|
145
|
+
const model = canonicalModel(target.model);
|
|
146
|
+
if (!provider) return { cleared: 0 };
|
|
147
|
+
let brain = opts.brain;
|
|
148
|
+
if (!brain) {
|
|
149
|
+
try { brain = require('../brain'); } catch { brain = null; }
|
|
150
|
+
}
|
|
151
|
+
if (!brain) return { cleared: 0 };
|
|
152
|
+
|
|
153
|
+
const statuses = parseStatusMap(brain);
|
|
154
|
+
let cleared = 0;
|
|
155
|
+
for (const [key, status] of Object.entries(statuses)) {
|
|
156
|
+
const sameProvider = canonicalProvider(status?.provider) === provider || key.startsWith(`${provider}:`);
|
|
157
|
+
if (!sameProvider) continue;
|
|
158
|
+
const sameModel = !model || canonicalModel(status?.model) === model || key === providerModelKey(provider, model);
|
|
159
|
+
if (!sameModel) continue;
|
|
160
|
+
delete statuses[key];
|
|
161
|
+
cleared += 1;
|
|
162
|
+
}
|
|
163
|
+
if (cleared) writeStatusMap(brain, statuses);
|
|
164
|
+
return { cleared };
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
module.exports = {
|
|
168
|
+
clearProviderHealthStatus,
|
|
169
|
+
DEFAULT_PROVIDER_STATUS_MAX_AGE_MS,
|
|
170
|
+
getProviderHealthStatus,
|
|
171
|
+
parseProviderStatusIssueId,
|
|
172
|
+
providerModelKey,
|
|
173
|
+
providerStatusIssueId,
|
|
174
|
+
publicProviderStatus,
|
|
175
|
+
recordProviderHealthStatus,
|
|
176
|
+
};
|