lazyclaw 5.4.3 → 6.0.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/channels/handoff.mjs +36 -0
- package/cli.mjs +73 -7399
- package/daemon.mjs +23 -2085
- package/mas/agent_turn.mjs +2 -1
- package/mas/index_db.mjs +82 -0
- package/mas/learning.mjs +17 -1
- package/mas/mention_router.mjs +38 -10
- package/mas/provider_adapters.mjs +28 -4
- package/mas/scrub_env.mjs +34 -0
- package/mas/tool_runner.mjs +23 -7
- package/mas/tools/bash.mjs +10 -5
- package/mas/tools/browser.mjs +18 -0
- package/mas/tools/learning.mjs +24 -14
- package/mas/tools/recall.mjs +5 -1
- package/mas/tools/web.mjs +47 -11
- package/mas/trajectory_store.mjs +7 -4
- package/package.json +3 -2
- package/providers/auth_store.mjs +22 -0
- package/providers/claude_cli.mjs +28 -2
- package/providers/claude_cli_detect.mjs +46 -0
- package/providers/custom_provider.mjs +70 -0
- package/providers/model_catalogue.mjs +86 -0
- package/providers/orchestrator.mjs +30 -9
- package/providers/rates.mjs +12 -2
- package/providers/registry.mjs +10 -7
- package/sandbox/confiners/landlock.mjs +14 -8
- package/sandbox/confiners/seatbelt.mjs +18 -2
- package/scripts/loop-worker.mjs +18 -7
- package/scripts/migrate-v5.mjs +5 -61
- package/sessions.mjs +0 -0
- package/tui/editor.mjs +44 -0
- package/tui/modal_filter.mjs +59 -0
- package/tui/modal_picker.mjs +12 -37
- package/tui/pickers.mjs +917 -0
- package/tui/provider_families.mjs +41 -0
- package/tui/repl.mjs +67 -36
- package/tui/slash_commands.mjs +8 -7
- package/tui/slash_dispatcher.mjs +923 -118
- package/tui/splash.mjs +5 -12
- package/tui/subcommands.mjs +17 -0
- package/tui/terminal_approve.mjs +37 -0
- package/web/dashboard.css +275 -0
- package/web/dashboard.html +2 -1685
- package/web/dashboard.js +1406 -0
- package/workflow/persistent.mjs +13 -6
- package/mas/tools/skill_view.mjs +0 -43
package/channels/handoff.mjs
CHANGED
|
@@ -39,3 +39,39 @@ export async function runHandoff({ threads, channels, threadId, target, external
|
|
|
39
39
|
|
|
40
40
|
return next;
|
|
41
41
|
}
|
|
42
|
+
|
|
43
|
+
// F6 — re-point a thread to `target`/`externalId` and (optionally) notify the
|
|
44
|
+
// target, rolling the binding BACK to its source if that notification throws.
|
|
45
|
+
// Unlike runHandoff, this takes a single `send(externalId, text)` notifier
|
|
46
|
+
// instead of a live channel map, so the daemon HTTP route can use it without a
|
|
47
|
+
// per-platform SDK. When `send` is omitted (the daemon has no live channel map
|
|
48
|
+
// yet) the migration is simply persisted and context follows on the next
|
|
49
|
+
// inbound to the target — there is nothing to roll back. Preserves sessionId.
|
|
50
|
+
export async function handoffWithRollback({ threads, threadId, target, externalId, note = '', send }) {
|
|
51
|
+
const cur = threads.findByThread(threadId);
|
|
52
|
+
if (!cur) {
|
|
53
|
+
const err = new Error(`THREAD_NOT_FOUND: ${threadId}`);
|
|
54
|
+
err.code = 'THREAD_NOT_FOUND';
|
|
55
|
+
throw err;
|
|
56
|
+
}
|
|
57
|
+
if (!target || !externalId) {
|
|
58
|
+
throw new Error('handoff requires target and externalId');
|
|
59
|
+
}
|
|
60
|
+
const prior = { channel: cur.channel, externalId: cur.externalId };
|
|
61
|
+
// Persist the migration first (same ordering as runHandoff).
|
|
62
|
+
const next = threads.handoff(threadId, { channel: target, externalId: String(externalId) });
|
|
63
|
+
if (typeof send === 'function') {
|
|
64
|
+
try {
|
|
65
|
+
const tail = note ? ` — ${note}` : '';
|
|
66
|
+
await send(String(externalId), `resumed from ${prior.channel} (session ${next.sessionId})${tail}`);
|
|
67
|
+
} catch (e) {
|
|
68
|
+
// Target never got the resume marker — roll the binding back so the
|
|
69
|
+
// session isn't stranded on a channel that can't be reached.
|
|
70
|
+
threads.handoff(threadId, prior);
|
|
71
|
+
const err = new Error(`HANDOFF_SEND_FAILED: ${e?.message || e}`);
|
|
72
|
+
err.code = 'HANDOFF_SEND_FAILED';
|
|
73
|
+
throw err;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
return next;
|
|
77
|
+
}
|