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.
Files changed (91) hide show
  1. package/channels/handoff.mjs +36 -0
  2. package/channels-discord/index.mjs +76 -0
  3. package/channels-discord/package.json +14 -0
  4. package/channels-email/index.mjs +109 -0
  5. package/channels-email/package.json +14 -0
  6. package/channels-signal/index.mjs +69 -0
  7. package/channels-signal/package.json +9 -0
  8. package/channels-voice/index.mjs +81 -0
  9. package/channels-voice/package.json +9 -0
  10. package/channels-whatsapp/index.mjs +70 -0
  11. package/channels-whatsapp/package.json +13 -0
  12. package/cli.mjs +73 -7399
  13. package/commands/agents.mjs +669 -0
  14. package/commands/auth_nodes.mjs +323 -0
  15. package/commands/automation.mjs +582 -0
  16. package/commands/channels.mjs +255 -0
  17. package/commands/chat.mjs +1217 -0
  18. package/commands/config.mjs +315 -0
  19. package/commands/daemon.mjs +260 -0
  20. package/commands/misc.mjs +128 -0
  21. package/commands/providers.mjs +511 -0
  22. package/commands/sessions.mjs +343 -0
  23. package/commands/setup.mjs +741 -0
  24. package/commands/skills.mjs +218 -0
  25. package/commands/workflow.mjs +661 -0
  26. package/daemon/lib/auth.mjs +58 -0
  27. package/daemon/lib/cost.mjs +30 -0
  28. package/daemon/lib/provider.mjs +69 -0
  29. package/daemon/lib/respond.mjs +83 -0
  30. package/daemon/route_table.mjs +96 -0
  31. package/daemon/routes/_deps.mjs +36 -0
  32. package/daemon/routes/config.mjs +99 -0
  33. package/daemon/routes/conversation.mjs +371 -0
  34. package/daemon/routes/meta.mjs +239 -0
  35. package/daemon/routes/ops.mjs +185 -0
  36. package/daemon/routes/providers.mjs +211 -0
  37. package/daemon/routes/rates.mjs +90 -0
  38. package/daemon/routes/registry.mjs +223 -0
  39. package/daemon/routes/sessions.mjs +213 -0
  40. package/daemon/routes/skills.mjs +260 -0
  41. package/daemon/routes/workflows.mjs +224 -0
  42. package/daemon.mjs +23 -2085
  43. package/dotenv_min.mjs +23 -0
  44. package/first_run.mjs +15 -0
  45. package/goals_cron.mjs +37 -0
  46. package/lib/args.mjs +216 -0
  47. package/lib/config.mjs +113 -0
  48. package/lib/registry_boot.mjs +55 -0
  49. package/mas/agent_turn.mjs +2 -1
  50. package/mas/index_db.mjs +82 -0
  51. package/mas/learning.mjs +17 -1
  52. package/mas/mention_router.mjs +38 -10
  53. package/mas/provider_adapters.mjs +28 -4
  54. package/mas/scrub_env.mjs +34 -0
  55. package/mas/tool_runner.mjs +23 -7
  56. package/mas/tools/bash.mjs +10 -5
  57. package/mas/tools/browser.mjs +18 -0
  58. package/mas/tools/learning.mjs +24 -14
  59. package/mas/tools/recall.mjs +5 -1
  60. package/mas/tools/web.mjs +47 -11
  61. package/mas/trajectory_store.mjs +7 -4
  62. package/package.json +16 -2
  63. package/providers/auth_store.mjs +22 -0
  64. package/providers/claude_cli.mjs +28 -2
  65. package/providers/claude_cli_detect.mjs +46 -0
  66. package/providers/custom_provider.mjs +70 -0
  67. package/providers/model_catalogue.mjs +86 -0
  68. package/providers/orchestrator.mjs +30 -9
  69. package/providers/rates.mjs +12 -2
  70. package/providers/registry.mjs +10 -7
  71. package/sandbox/confiners/landlock.mjs +14 -8
  72. package/sandbox/confiners/seatbelt.mjs +18 -2
  73. package/scripts/loop-worker.mjs +18 -7
  74. package/scripts/migrate-v5.mjs +5 -61
  75. package/secure_write.mjs +46 -0
  76. package/sessions.mjs +0 -0
  77. package/tui/modal_filter.mjs +59 -0
  78. package/tui/modal_picker.mjs +12 -37
  79. package/tui/pickers.mjs +917 -0
  80. package/tui/provider_families.mjs +41 -0
  81. package/tui/repl.mjs +67 -36
  82. package/tui/slash_commands.mjs +2 -1
  83. package/tui/slash_dispatcher.mjs +717 -58
  84. package/tui/splash.mjs +5 -12
  85. package/tui/subcommands.mjs +17 -0
  86. package/tui/terminal_approve.mjs +37 -0
  87. package/web/dashboard.css +275 -0
  88. package/web/dashboard.html +2 -1685
  89. package/web/dashboard.js +1406 -0
  90. package/workflow/persistent.mjs +13 -6
  91. package/mas/tools/skill_view.mjs +0 -43
@@ -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
- const DEFAULT_MAX_ROWS = 12;
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
- function _isSubseq(needle, hay) {
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) {