lazyclaw 5.4.4 → 6.0.1
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/channels-discord/index.mjs +76 -0
- package/channels-discord/package.json +14 -0
- package/channels-email/index.mjs +109 -0
- package/channels-email/package.json +14 -0
- package/channels-signal/index.mjs +69 -0
- package/channels-signal/package.json +9 -0
- package/channels-voice/index.mjs +81 -0
- package/channels-voice/package.json +9 -0
- package/channels-whatsapp/index.mjs +70 -0
- package/channels-whatsapp/package.json +13 -0
- package/cli.mjs +73 -7399
- package/commands/agents.mjs +669 -0
- package/commands/auth_nodes.mjs +323 -0
- package/commands/automation.mjs +582 -0
- package/commands/channels.mjs +255 -0
- package/commands/chat.mjs +1217 -0
- package/commands/config.mjs +315 -0
- package/commands/daemon.mjs +260 -0
- package/commands/misc.mjs +128 -0
- package/commands/providers.mjs +511 -0
- package/commands/sessions.mjs +343 -0
- package/commands/setup.mjs +741 -0
- package/commands/skills.mjs +218 -0
- package/commands/workflow.mjs +661 -0
- package/daemon/lib/auth.mjs +58 -0
- package/daemon/lib/cost.mjs +30 -0
- package/daemon/lib/provider.mjs +69 -0
- package/daemon/lib/respond.mjs +83 -0
- package/daemon/route_table.mjs +96 -0
- package/daemon/routes/_deps.mjs +36 -0
- package/daemon/routes/config.mjs +99 -0
- package/daemon/routes/conversation.mjs +371 -0
- package/daemon/routes/meta.mjs +239 -0
- package/daemon/routes/ops.mjs +185 -0
- package/daemon/routes/providers.mjs +211 -0
- package/daemon/routes/rates.mjs +90 -0
- package/daemon/routes/registry.mjs +223 -0
- package/daemon/routes/sessions.mjs +213 -0
- package/daemon/routes/skills.mjs +260 -0
- package/daemon/routes/workflows.mjs +224 -0
- package/daemon.mjs +23 -2085
- package/dotenv_min.mjs +23 -0
- package/first_run.mjs +15 -0
- package/goals_cron.mjs +37 -0
- package/lib/args.mjs +216 -0
- package/lib/config.mjs +113 -0
- package/lib/registry_boot.mjs +55 -0
- 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 +16 -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/secure_write.mjs +46 -0
- package/sessions.mjs +0 -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 +2 -1
- package/tui/slash_dispatcher.mjs +717 -58
- 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/tui/modal_picker.mjs
CHANGED
|
@@ -15,44 +15,14 @@ import React from 'react';
|
|
|
15
15
|
import { Box, Text } from 'ink';
|
|
16
16
|
import stringWidth from 'string-width';
|
|
17
17
|
import { theme } from './theme.mjs';
|
|
18
|
+
// Pure (react-free) primitives live in modal_filter.mjs so they can be unit
|
|
19
|
+
// tested without the Ink runtime. Re-exported here for back-compat with
|
|
20
|
+
// existing importers (tui/repl.mjs).
|
|
21
|
+
import { filterModalItems, _computeWindow, resolveModalPick } from './modal_filter.mjs';
|
|
18
22
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
// Pure filter — prefix > substring > subsequence. Stable order within
|
|
22
|
-
// each tier (original list order is the tiebreaker).
|
|
23
|
-
export function filterModalItems(query, items) {
|
|
24
|
-
const q = String(query || '').trim().toLowerCase();
|
|
25
|
-
const list = Array.isArray(items) ? items : [];
|
|
26
|
-
if (!q) return list.slice();
|
|
27
|
-
const prefix = [], substr = [], subseq = [];
|
|
28
|
-
for (const it of list) {
|
|
29
|
-
const hay = `${it.label || it.id || ''} ${it.desc || ''}`.toLowerCase();
|
|
30
|
-
if (hay.startsWith(q)) prefix.push(it);
|
|
31
|
-
else if (hay.includes(q)) substr.push(it);
|
|
32
|
-
else if (_isSubseq(q, hay)) subseq.push(it);
|
|
33
|
-
}
|
|
34
|
-
return [...prefix, ...substr, ...subseq];
|
|
35
|
-
}
|
|
23
|
+
export { filterModalItems, _computeWindow, resolveModalPick };
|
|
36
24
|
|
|
37
|
-
|
|
38
|
-
let i = 0;
|
|
39
|
-
for (const ch of hay) {
|
|
40
|
-
if (ch === needle[i]) i++;
|
|
41
|
-
if (i === needle.length) return true;
|
|
42
|
-
}
|
|
43
|
-
return false;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
// Pure window computation — slide a window of `maxRows` items so that
|
|
47
|
-
// `selectedIndex` is always visible. Mirrors the pattern in
|
|
48
|
-
// tui/slash_popup.mjs._computeWindow.
|
|
49
|
-
export function _computeWindow(idx, total, maxRows) {
|
|
50
|
-
const n = Math.max(0, total);
|
|
51
|
-
const m = Math.max(1, maxRows);
|
|
52
|
-
if (n <= m) return { start: 0, end: n };
|
|
53
|
-
let start = Math.max(0, Math.min(n - m, idx - Math.floor(m / 2)));
|
|
54
|
-
return { start, end: start + m };
|
|
55
|
-
}
|
|
25
|
+
const DEFAULT_MAX_ROWS = 12;
|
|
56
26
|
|
|
57
27
|
// Presentational component.
|
|
58
28
|
//
|
|
@@ -126,11 +96,16 @@ export function ModalPicker({
|
|
|
126
96
|
const marker = selected ? '❯ ' : ' ';
|
|
127
97
|
const label = String(it.label || it.id || '').padEnd(labelW);
|
|
128
98
|
const desc = it.desc ? ` ${it.desc}` : '';
|
|
129
|
-
// Render selected row inverse-bold for contrast.
|
|
99
|
+
// Render selected row inverse-bold for contrast. A row `tag` (e.g.
|
|
100
|
+
// "api key" / "no key" / "custom") renders as a dim trailing pill so
|
|
101
|
+
// the picker signals at a glance which providers need a key.
|
|
130
102
|
rows.push(React.createElement(
|
|
131
103
|
Text,
|
|
132
104
|
{ key: `it-${absoluteIdx}`, bold: selected, inverse: selected },
|
|
133
105
|
`${marker}${label}${desc}`,
|
|
106
|
+
it.tag
|
|
107
|
+
? React.createElement(Text, { key: 'tag', dimColor: true }, ` [${it.tag}]`)
|
|
108
|
+
: null,
|
|
134
109
|
));
|
|
135
110
|
}
|
|
136
111
|
if (end < total) {
|