aiden-runtime 4.1.1 → 4.1.3

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 (68) hide show
  1. package/README.md +78 -26
  2. package/dist/cli/v4/aidenCLI.js +169 -9
  3. package/dist/cli/v4/callbacks.js +20 -2
  4. package/dist/cli/v4/chatSession.js +644 -16
  5. package/dist/cli/v4/commands/auth.js +6 -3
  6. package/dist/cli/v4/commands/doctor.js +23 -27
  7. package/dist/cli/v4/commands/help.js +4 -0
  8. package/dist/cli/v4/commands/index.js +10 -1
  9. package/dist/cli/v4/commands/model.js +30 -1
  10. package/dist/cli/v4/commands/reloadSoul.js +37 -0
  11. package/dist/cli/v4/commands/update.js +102 -0
  12. package/dist/cli/v4/defaultSoul.js +68 -2
  13. package/dist/cli/v4/display/capabilityCard.js +135 -0
  14. package/dist/cli/v4/display/sessionEndCard.js +127 -0
  15. package/dist/cli/v4/display/toolTrail.js +172 -0
  16. package/dist/cli/v4/display.js +492 -142
  17. package/dist/cli/v4/doctor.js +472 -58
  18. package/dist/cli/v4/doctorLiveness.js +65 -10
  19. package/dist/cli/v4/promotionPrompt.js +332 -0
  20. package/dist/cli/v4/providerBootSelector.js +144 -0
  21. package/dist/cli/v4/replyRenderer.js +311 -20
  22. package/dist/cli/v4/sessionSummaryGate.js +66 -0
  23. package/dist/cli/v4/skinEngine.js +14 -3
  24. package/dist/cli/v4/toolPreview.js +153 -0
  25. package/dist/core/tools/nowPlaying.js +7 -15
  26. package/dist/core/v4/aidenAgent.js +91 -29
  27. package/dist/core/v4/capabilities.js +89 -0
  28. package/dist/core/v4/contextCompressor.js +25 -8
  29. package/dist/core/v4/distillationIndex.js +167 -0
  30. package/dist/core/v4/distillationStore.js +98 -0
  31. package/dist/core/v4/logger/logger.js +40 -9
  32. package/dist/core/v4/promotionCandidates.js +234 -0
  33. package/dist/core/v4/promptBuilder.js +145 -1
  34. package/dist/core/v4/sessionDistiller.js +452 -0
  35. package/dist/core/v4/skillMining/skillMiner.js +43 -6
  36. package/dist/core/v4/skillOutcomeTracker.js +323 -0
  37. package/dist/core/v4/subsystemHealth.js +143 -0
  38. package/dist/core/v4/toolRegistry.js +16 -1
  39. package/dist/core/v4/update/executeInstall.js +233 -0
  40. package/dist/core/version.js +1 -1
  41. package/dist/moat/memoryGuard.js +111 -0
  42. package/dist/moat/plannerGuard.js +19 -0
  43. package/dist/moat/skillTeacher.js +14 -5
  44. package/dist/providers/v4/chatCompletionsAdapter.js +9 -0
  45. package/dist/providers/v4/errors.js +112 -4
  46. package/dist/providers/v4/modelDefaults.js +65 -0
  47. package/dist/providers/v4/registry.js +9 -2
  48. package/dist/providers/v4/runtimeResolver.js +6 -0
  49. package/dist/tools/v4/index.js +80 -1
  50. package/dist/tools/v4/memory/memoryRemove.js +57 -2
  51. package/dist/tools/v4/memory/sessionSummary.js +151 -0
  52. package/dist/tools/v4/sessions/recallSession.js +177 -0
  53. package/dist/tools/v4/sessions/sessionSearch.js +5 -1
  54. package/dist/tools/v4/system/_psHelpers.js +123 -0
  55. package/dist/tools/v4/system/aidenSelfUpdate.js +162 -0
  56. package/dist/tools/v4/system/appClose.js +79 -0
  57. package/dist/tools/v4/system/appInput.js +154 -0
  58. package/dist/tools/v4/system/appLaunch.js +218 -0
  59. package/dist/tools/v4/system/clipboardRead.js +54 -0
  60. package/dist/tools/v4/system/clipboardWrite.js +84 -0
  61. package/dist/tools/v4/system/mediaKey.js +109 -0
  62. package/dist/tools/v4/system/mediaSessions.js +163 -0
  63. package/dist/tools/v4/system/mediaTransport.js +211 -0
  64. package/dist/tools/v4/system/osProcessList.js +99 -0
  65. package/dist/tools/v4/system/screenshot.js +106 -0
  66. package/dist/tools/v4/system/volumeSet.js +157 -0
  67. package/package.json +4 -1
  68. package/skills/system_control.md +185 -69
@@ -0,0 +1,172 @@
1
+ "use strict";
2
+ /**
3
+ * Copyright (c) 2026 Shiva Deore (Taracod).
4
+ * Licensed under AGPL-3.0. See LICENSE for details.
5
+ *
6
+ * Aiden — local-first agent.
7
+ */
8
+ /**
9
+ * cli/v4/display/toolTrail.ts — Aiden v4.1.3-repl-polish
10
+ *
11
+ * Icon + verb lookup for the compact tool-trail rows.
12
+ *
13
+ * Format rendered by Display.toolRow():
14
+ *
15
+ * ┊ {icon} {verb:12} {detail:40}
16
+ *
17
+ * Rules:
18
+ * - Exact tool-name match tried first (lowercased), then substring,
19
+ * then the '·' / 'calling' fallback.
20
+ * - Success outcomes are SILENT — the running row is erased and nothing
21
+ * persists. Only failed/degraded/blocked rows leave a trace.
22
+ * - This module is pure (no I/O, no side effects) so it can be tested
23
+ * in full isolation.
24
+ */
25
+ Object.defineProperty(exports, "__esModule", { value: true });
26
+ exports.TRAIL_PIPE = exports.TRAIL_DETAIL_CAP = exports.TRAIL_VERB_PAD = void 0;
27
+ exports.iconForTool = iconForTool;
28
+ exports.padVerb = padVerb;
29
+ exports.truncDetail = truncDetail;
30
+ /** Width the verb field is padded / trimmed to. */
31
+ exports.TRAIL_VERB_PAD = 12;
32
+ /** Hard cap on the detail (arg-preview) field. */
33
+ exports.TRAIL_DETAIL_CAP = 40;
34
+ /** Row-prefix glyph that replaces the old indent dots. */
35
+ exports.TRAIL_PIPE = '┊';
36
+ /**
37
+ * Ordered lookup table: tool name patterns → { icon, verb }.
38
+ *
39
+ * Exact match (lowercased tool name present in `keys`) is tried before
40
+ * substring match. Entries are ordered from most-specific to most-generic
41
+ * so that e.g. `recall_session` matches 'recalling' before the generic
42
+ * `memory` → 'recalling' entry would.
43
+ *
44
+ * Keep entries grouped by semantic category to make auditing easy.
45
+ */
46
+ const TRAIL_MAP = [
47
+ // ── Observe / read / list ────────────────────────────────────────────
48
+ { keys: ['file_read', 'read_file', 'read_text_file', 'read_multiple_files',
49
+ 'file_list', 'list_directory', 'list_directory_with_sizes',
50
+ 'directory_tree', 'file_info', 'get_file_info',
51
+ 'observe', 'read', 'list'],
52
+ icon: '👁', verb: 'reading' },
53
+ // ── Write / edit / create ────────────────────────────────────────────
54
+ { keys: ['file_write', 'write_file', 'edit_file', 'move_file',
55
+ 'notebook_edit', 'create_directory',
56
+ 'write', 'edit', 'create', 'save'],
57
+ icon: '✏', verb: 'writing' },
58
+ // ── Execute / run / shell ────────────────────────────────────────────
59
+ { keys: ['bash', 'powershell', 'execute_code', 'skill_view',
60
+ 'shortcuts_execute', 'javascript_tool',
61
+ 'shell_exec', 'process_spawn', 'process_kill',
62
+ 'run', 'execute', 'exec'],
63
+ icon: '⚡', verb: 'running' },
64
+ // ── Clipboard ────────────────────────────────────────────────────────
65
+ { keys: ['clipboard_read', 'clipboard_write', 'clipboard'],
66
+ icon: '📋', verb: 'copying' },
67
+ // ── Web / fetch / browse ─────────────────────────────────────────────
68
+ { keys: ['web_search', 'web_fetch', 'fetch_url', 'fetch_page',
69
+ 'open_url', 'navigate', 'get_page_text', 'read_page',
70
+ 'browser_extract', 'browser_get_url',
71
+ 'search_cloudflare_documentation', 'search_vercel_documentation',
72
+ 'search_mcp_registry',
73
+ 'browser', 'fetch', 'search'],
74
+ icon: '🌐', verb: 'fetching' },
75
+ // ── Memory / recall ──────────────────────────────────────────────────
76
+ { keys: ['recall_session', 'session_search', 'session_list',
77
+ 'memory_add', 'memory_search',
78
+ 'recall', 'memory'],
79
+ icon: '🧠', verb: 'recalling' },
80
+ // ── Think / analyse / summarise ──────────────────────────────────────
81
+ { keys: ['session_summary', 'deep_research', 'analyze', 'think', 'plan'],
82
+ icon: '🧠', verb: 'thinking' },
83
+ // ── Skills / tools / catalog ─────────────────────────────────────────
84
+ { keys: ['skills_list', 'list_connectors', 'suggest_connectors',
85
+ 'skill'],
86
+ icon: '📋', verb: 'listing' },
87
+ // ── Screen / capture / inspect ───────────────────────────────────────
88
+ { keys: ['screenshot', 'browser_screenshot', 'aiden__screenshot',
89
+ 'preview_screenshot', 'preview_snapshot', 'preview_inspect',
90
+ 'computer', 'upload_image', 'read_media_file'],
91
+ icon: '🖥', verb: 'capturing' },
92
+ // ── Media control ────────────────────────────────────────────────────
93
+ // v4.1.4-media: the new three-layer media-control bundle.
94
+ // Listed BEFORE the launch category so substring matching on `media_*`
95
+ // tool names hits this category first — without this split, every
96
+ // media_* name's substring would collide with the 'media' key in the
97
+ // launch bucket and render as verb "launching".
98
+ { keys: ['media_key', 'media_sessions', 'media_transport',
99
+ 'now_playing', 'youtube_search'],
100
+ icon: '▶', verb: 'media' },
101
+ // ── Media launch / open ──────────────────────────────────────────────
102
+ // Note: `'media'` as a substring key was removed in v4.1.4 because it
103
+ // false-matched the new media_* control tools above. Launch tools
104
+ // (`app_launch`, `open_url`, etc.) are explicit-keyed.
105
+ { keys: ['app_launch', 'open_url', 'open', 'launch'],
106
+ icon: '▶', verb: 'launching' },
107
+ // ── Deploy / build / publish ─────────────────────────────────────────
108
+ { keys: ['deploy_to_vercel', 'deploy_edge_function', 'apply_migration',
109
+ 'push_notification',
110
+ 'deploy', 'build', 'package', 'push'],
111
+ icon: '📦', verb: 'deploying' },
112
+ // ── Message / notify / send ──────────────────────────────────────────
113
+ { keys: ['create_draft', 'reply_to_toolbar_thread',
114
+ 'send', 'message', 'notify', 'email', 'reply'],
115
+ icon: '💬', verb: 'sending' },
116
+ // ── Verify / test / health ───────────────────────────────────────────
117
+ { keys: ['get_advisors', 'confirm_cost', 'subsystem_health',
118
+ 'verify', 'test', 'doctor', 'health'],
119
+ icon: '🛡', verb: 'verifying' },
120
+ // ── Database / query ─────────────────────────────────────────────────
121
+ { keys: ['execute_sql', 'd1_database_query',
122
+ 'query', 'sql'],
123
+ icon: '🗄', verb: 'querying' },
124
+ ];
125
+ /**
126
+ * Return the trail icon and verb for `name`.
127
+ *
128
+ * 1. Exact match — lowercased tool name is in `entry.keys`
129
+ * 2. Substring match — any key appears in the lowercased name
130
+ * 3. Default fallback: `{ icon: '⚡', verb: 'calling' }` — generic
131
+ * energy glyph for unmapped tools so the row still visually parses
132
+ * as a tool event even when the category is unknown.
133
+ *
134
+ * Pure — no side effects. Safe to call in hot paths.
135
+ */
136
+ function iconForTool(name) {
137
+ const lc = name.toLowerCase();
138
+ // Pass 1 — exact match
139
+ for (const entry of TRAIL_MAP) {
140
+ if (entry.keys.includes(lc)) {
141
+ return { icon: entry.icon, verb: entry.verb };
142
+ }
143
+ }
144
+ // Pass 2 — substring match (insertion order = priority)
145
+ for (const entry of TRAIL_MAP) {
146
+ for (const key of entry.keys) {
147
+ if (lc.includes(key)) {
148
+ return { icon: entry.icon, verb: entry.verb };
149
+ }
150
+ }
151
+ }
152
+ return { icon: '⚡', verb: 'calling' };
153
+ }
154
+ /**
155
+ * Pad or trim `verb` to exactly TRAIL_VERB_PAD characters.
156
+ * Pure helper used by Display.toolRow() to keep columns aligned.
157
+ */
158
+ function padVerb(verb) {
159
+ if (verb.length > exports.TRAIL_VERB_PAD)
160
+ return verb.slice(0, exports.TRAIL_VERB_PAD);
161
+ return verb.padEnd(exports.TRAIL_VERB_PAD);
162
+ }
163
+ /**
164
+ * Truncate `s` to TRAIL_DETAIL_CAP chars, appending '…' when cut.
165
+ * Collapses internal whitespace first so multi-line args stay on one line.
166
+ */
167
+ function truncDetail(s) {
168
+ const flat = s.replace(/\s+/g, ' ').trim();
169
+ if (flat.length <= exports.TRAIL_DETAIL_CAP)
170
+ return flat;
171
+ return flat.slice(0, exports.TRAIL_DETAIL_CAP - 1) + '…';
172
+ }