aiden-runtime 4.8.0 → 4.9.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.
Files changed (99) hide show
  1. package/README.md +88 -1
  2. package/dist/cli/v4/aidenCLI.js +35 -4
  3. package/dist/cli/v4/chatSession.js +43 -16
  4. package/dist/cli/v4/commands/daemon.js +47 -2
  5. package/dist/cli/v4/commands/daemonDoctor.js +212 -0
  6. package/dist/cli/v4/commands/daemonStatus.js +1 -1
  7. package/dist/cli/v4/commands/help.js +2 -0
  8. package/dist/cli/v4/commands/hooks.js +428 -0
  9. package/dist/cli/v4/commands/index.js +5 -1
  10. package/dist/cli/v4/commands/mcp.js +89 -1
  11. package/dist/cli/v4/commands/mcpClientInstall.js +359 -0
  12. package/dist/cli/v4/commands/memory.js +702 -0
  13. package/dist/cli/v4/commands/recovery.js +1 -1
  14. package/dist/cli/v4/commands/skin.js +7 -0
  15. package/dist/cli/v4/commands/theme.js +217 -0
  16. package/dist/cli/v4/commands/trigger.js +1 -1
  17. package/dist/cli/v4/commands/update.js +14 -2
  18. package/dist/cli/v4/design/tokens.js +52 -4
  19. package/dist/cli/v4/display.js +102 -46
  20. package/dist/cli/v4/pasteIntercept.js +214 -70
  21. package/dist/cli/v4/replyRenderer.js +145 -5
  22. package/dist/cli/v4/skinEngine.js +67 -0
  23. package/dist/core/v4/aidenAgent.js +45 -2
  24. package/dist/core/v4/daemon/api/runs.js +131 -0
  25. package/dist/core/v4/daemon/bootstrap.js +368 -13
  26. package/dist/core/v4/daemon/db/migrations.js +169 -0
  27. package/dist/core/v4/daemon/idempotency/runIdempotencyStore.js +128 -0
  28. package/dist/core/v4/daemon/incarnationStore.js +47 -0
  29. package/dist/core/v4/daemon/runs/attemptStore.js +67 -0
  30. package/dist/core/v4/daemon/runs/reclaim.js +88 -0
  31. package/dist/core/v4/daemon/runs/retryPolicy.js +73 -0
  32. package/dist/core/v4/daemon/runs/runWithRetry.js +80 -0
  33. package/dist/core/v4/daemon/runs/stuckAttemptWatchdog.js +72 -0
  34. package/dist/core/v4/daemon/spans/spanHelpers.js +272 -0
  35. package/dist/core/v4/daemon/spans/spanStore.js +113 -0
  36. package/dist/core/v4/daemon/triggerBus.js +50 -19
  37. package/dist/core/v4/hooks/auditQuery.js +67 -0
  38. package/dist/core/v4/hooks/dispatcher.js +286 -0
  39. package/dist/core/v4/hooks/index.js +46 -0
  40. package/dist/core/v4/hooks/lifecycle.js +27 -0
  41. package/dist/core/v4/hooks/manifest.js +142 -0
  42. package/dist/core/v4/hooks/registry.js +149 -0
  43. package/dist/core/v4/hooks/runtime/subprocessRunner.js +188 -0
  44. package/dist/core/v4/hooks/toolHookGate.js +76 -0
  45. package/dist/core/v4/hooks/trust.js +14 -0
  46. package/dist/core/v4/identity/contextManager.js +83 -0
  47. package/dist/core/v4/identity/daemonId.js +85 -0
  48. package/dist/core/v4/identity/enforcement.js +103 -0
  49. package/dist/core/v4/identity/executionContext.js +153 -0
  50. package/dist/core/v4/identity/hookExecution.js +62 -0
  51. package/dist/core/v4/identity/httpContext.js +68 -0
  52. package/dist/core/v4/identity/ids.js +185 -0
  53. package/dist/core/v4/identity/index.js +60 -0
  54. package/dist/core/v4/identity/subprocessContext.js +98 -0
  55. package/dist/core/v4/identity/traceparent.js +114 -0
  56. package/dist/core/v4/logger/index.js +3 -1
  57. package/dist/core/v4/logger/logger.js +28 -1
  58. package/dist/core/v4/logger/redact.js +149 -0
  59. package/dist/core/v4/logger/sinks/fileSink.js +13 -0
  60. package/dist/core/v4/logger/sinks/stdSink.js +19 -1
  61. package/dist/core/v4/mcp/install/backup.js +78 -0
  62. package/dist/core/v4/mcp/install/clientPaths.js +90 -0
  63. package/dist/core/v4/mcp/install/clients.js +203 -0
  64. package/dist/core/v4/mcp/install/healthCheck.js +83 -0
  65. package/dist/core/v4/mcp/install/jsoncMerge.js +174 -0
  66. package/dist/core/v4/mcp/install/profiles.js +109 -0
  67. package/dist/core/v4/mcp/install/wslDetect.js +62 -0
  68. package/dist/core/v4/memory/namespaceRegistry.js +117 -0
  69. package/dist/core/v4/memory/projectRoot.js +76 -0
  70. package/dist/core/v4/memory/reviewer/index.js +162 -0
  71. package/dist/core/v4/memory/reviewer/pendingStore.js +136 -0
  72. package/dist/core/v4/memory/reviewer/prompt.js +105 -0
  73. package/dist/core/v4/memory/reviewer/skipRules.js +92 -0
  74. package/dist/core/v4/memoryManager.js +57 -10
  75. package/dist/core/v4/paths.js +2 -0
  76. package/dist/core/v4/promptBuilder.js +6 -0
  77. package/dist/core/v4/subagent/spawnSubAgent.js +20 -7
  78. package/dist/core/v4/theme/bundledThemes.js +106 -0
  79. package/dist/core/v4/theme/themeLoader.js +160 -0
  80. package/dist/core/v4/theme/themeRegistry.js +97 -0
  81. package/dist/core/v4/theme/themeWatcher.js +95 -0
  82. package/dist/core/v4/toolRegistry.js +71 -8
  83. package/dist/core/v4/update/executeInstall.js +10 -6
  84. package/dist/core/v4/update/installMethodDetect.js +7 -0
  85. package/dist/core/version.js +67 -2
  86. package/dist/moat/approvalEngine.js +4 -0
  87. package/dist/moat/memoryGuard.js +8 -1
  88. package/dist/providers/v4/anthropicAdapter.js +10 -4
  89. package/dist/tools/v4/backends/local.js +19 -2
  90. package/dist/tools/v4/sessions/recallSession.js +6 -1
  91. package/package.json +3 -3
  92. package/plugins/aiden-plugin-chatgpt-plus/index.js +10 -1
  93. package/themes/default.yaml +52 -0
  94. package/themes/dracula.yaml +32 -0
  95. package/themes/light.yaml +32 -0
  96. package/themes/monochrome.yaml +31 -0
  97. package/themes/tokyo-night.yaml +32 -0
  98. package/dist/core/pluginSystem.js +0 -121
  99. package/dist/tools/v4/ui/_uiSmokeTool.js +0 -60
@@ -0,0 +1,32 @@
1
+ # Aiden Theme — Tokyo Night
2
+ # Palette inspired by the public Tokyo Night theme by Folke Lemaitre
3
+ # (folke/tokyonight.nvim). Cool nocturnal palette widely re-implemented
4
+ # across editors and terminals. Hex values are the public palette.
5
+ # Glyphs unchanged from default.
6
+
7
+ name: "tokyo-night"
8
+ description: "Inspired by Tokyo Night (folke/tokyonight.nvim). Cool nocturnal palette."
9
+
10
+ colors:
11
+ brand:
12
+ primary: "#7AA2F7"
13
+ muted: "#3D59A1"
14
+ content:
15
+ primary: "#C0CAF5"
16
+ secondary: "#9AA5CE"
17
+ tertiary: "#565F89"
18
+ semantic:
19
+ success: "#9ECE6A"
20
+ warn: "#E0AF68"
21
+ error: "#F7768E"
22
+ info: "#7DCFFF"
23
+ metrics:
24
+ model: "#7DCFFF"
25
+ tokens: "#E0AF68"
26
+ timer: "#7DCFFF"
27
+ turnCount: "#BB9AF7"
28
+ surface:
29
+ bg: "#1A1B26"
30
+ elevated: "#24283B"
31
+ border: "#3B4261"
32
+ divider: "#1F2335"
@@ -1,121 +0,0 @@
1
- "use strict";
2
- // ============================================================
3
- // DevOS — Autonomous AI Execution System
4
- // Copyright (c) 2026 Shiva Deore. All rights reserved.
5
- // ============================================================
6
- var __importDefault = (this && this.__importDefault) || function (mod) {
7
- return (mod && mod.__esModule) ? mod : { "default": mod };
8
- };
9
- Object.defineProperty(exports, "__esModule", { value: true });
10
- exports.pluginManager = void 0;
11
- // core/pluginSystem.ts — Plugin system foundation.
12
- // Allows community extensions without modifying core code.
13
- // Scans workspace/plugins/*/plugin.json, loads entry files,
14
- // and calls onLoad(ctx) with a sandboxed PluginContext.
15
- const fs_1 = __importDefault(require("fs"));
16
- const path_1 = __importDefault(require("path"));
17
- const toolRegistry_1 = require("./toolRegistry");
18
- const hooks_1 = require("./hooks");
19
- const PLUGINS_DIR = path_1.default.join(process.cwd(), 'workspace', 'plugins');
20
- // ── PluginManager ──────────────────────────────────────────────
21
- class PluginManager {
22
- constructor() {
23
- this.loaded = [];
24
- }
25
- // ── Load all plugins from workspace/plugins/ ───────────────
26
- async loadAll() {
27
- if (!fs_1.default.existsSync(PLUGINS_DIR)) {
28
- console.log('[Plugins] No plugins directory found — skipping');
29
- return;
30
- }
31
- const dirs = fs_1.default.readdirSync(PLUGINS_DIR, { withFileTypes: true })
32
- .filter(d => d.isDirectory())
33
- .map(d => path_1.default.join(PLUGINS_DIR, d.name));
34
- for (const dir of dirs) {
35
- try {
36
- await this.loadPlugin(dir);
37
- }
38
- catch (e) {
39
- console.error(`[Plugins] Failed to load plugin at ${path_1.default.basename(dir)}:`, e.message);
40
- }
41
- }
42
- console.log(`[Plugins] ${this.loaded.length} plugin(s) active`);
43
- }
44
- // ── Load a single plugin directory ────────────────────────
45
- async loadPlugin(dir) {
46
- const manifestPath = path_1.default.join(dir, 'plugin.json');
47
- if (!fs_1.default.existsSync(manifestPath)) {
48
- console.warn(`[Plugins] No plugin.json in ${path_1.default.basename(dir)} — skipping`);
49
- return;
50
- }
51
- let manifest;
52
- try {
53
- manifest = JSON.parse(fs_1.default.readFileSync(manifestPath, 'utf-8'));
54
- }
55
- catch (e) {
56
- throw new Error(`Invalid plugin.json: ${e.message}`);
57
- }
58
- if (!manifest.name || !manifest.version || !manifest.entry) {
59
- throw new Error('plugin.json missing required fields: name, version, entry');
60
- }
61
- // ── Security: entry must not escape plugin directory ───────
62
- const entryPath = path_1.default.resolve(dir, manifest.entry);
63
- const resolvedBase = path_1.default.resolve(dir);
64
- if (!entryPath.startsWith(resolvedBase + path_1.default.sep) && entryPath !== resolvedBase) {
65
- throw new Error(`Security: entry path escapes plugin directory: ${manifest.entry}`);
66
- }
67
- if (!fs_1.default.existsSync(entryPath)) {
68
- throw new Error(`Entry file not found: ${manifest.entry}`);
69
- }
70
- // ── Load the plugin module ─────────────────────────────────
71
- // eslint-disable-next-line @typescript-eslint/no-var-requires
72
- const mod = require(entryPath);
73
- const plugin = mod.default ?? mod;
74
- if (typeof plugin?.onLoad !== 'function') {
75
- throw new Error(`Plugin "${manifest.name}" must export an object with an onLoad() function`);
76
- }
77
- // ── Build sandboxed context ────────────────────────────────
78
- const ctx = {
79
- registerTool: (def) => {
80
- (0, toolRegistry_1.registerExternalTool)(def.name, def.execute, manifest.name);
81
- },
82
- registerHook: (event, handler) => {
83
- (0, hooks_1.registerExternalHook)(event, handler, manifest.name);
84
- },
85
- log: (msg) => {
86
- console.log(`[Plugin:${manifest.name}] ${msg}`);
87
- },
88
- };
89
- await plugin.onLoad(ctx);
90
- this.loaded.push({ manifest, dir, active: true, plugin });
91
- console.log(`[Plugins] Loaded "${manifest.name}" v${manifest.version}${manifest.author ? ` by ${manifest.author}` : ''}`);
92
- }
93
- // ── List loaded plugins ────────────────────────────────────
94
- list() {
95
- return this.loaded.map(r => ({
96
- name: r.manifest.name,
97
- version: r.manifest.version,
98
- description: r.manifest.description,
99
- author: r.manifest.author,
100
- active: r.active,
101
- }));
102
- }
103
- // ── Unload all plugins ─────────────────────────────────────
104
- async unloadAll() {
105
- for (const record of this.loaded) {
106
- try {
107
- if (record.plugin?.onUnload) {
108
- await record.plugin.onUnload();
109
- }
110
- record.active = false;
111
- }
112
- catch (e) {
113
- console.error(`[Plugins] onUnload error for "${record.manifest.name}":`, e.message);
114
- }
115
- }
116
- console.log(`[Plugins] Unloaded ${this.loaded.length} plugin(s)`);
117
- this.loaded = [];
118
- }
119
- }
120
- // ── Singleton ──────────────────────────────────────────────────
121
- exports.pluginManager = new PluginManager();
@@ -1,60 +0,0 @@
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
- * tools/v4/ui/_uiSmokeTool.ts — v4.7 Slice 1 smoke harness.
10
- *
11
- * Internal tool used ONLY to verify the uiOnly dispatch seam from
12
- * Slice 1 (ToolHandler.uiOnly + resolveUiOnly + onUiEvent +
13
- * Display.renderUiEvent). NOT for end-user LLM workflows.
14
- *
15
- * Registered behind `AIDEN_UI_SMOKE=1` env flag in
16
- * `tools/v4/index.ts::registerAllTools`. Will be deleted once
17
- * Slice 2 lands the real ui_task_update / ui_task_done tools.
18
- *
19
- * When invoked, the agent's dispatch loop:
20
- * - resolves uiOnly=true via the resolveUiOnly closure
21
- * - fires runOptions.onUiEvent('_ui_smoke', args)
22
- * - SKIPS execute() entirely
23
- * - SKIPS turnToolMessages push + toolCallCount increment + verifier
24
- *
25
- * The handler's `execute` MUST never be called by the dispatch path
26
- * when uiOnly is honoured. Throws if reached — that throw is a
27
- * regression alarm.
28
- */
29
- Object.defineProperty(exports, "__esModule", { value: true });
30
- exports.uiSmokeTool = void 0;
31
- exports.uiSmokeTool = {
32
- schema: {
33
- name: '_ui_smoke',
34
- description: 'Internal smoke-test tool for the v4.7 uiOnly dispatch path. ' +
35
- 'Renders a single debug line through the UI event seam. ' +
36
- 'Does NOT round-trip back to the model. Only available when ' +
37
- 'AIDEN_UI_SMOKE=1.',
38
- inputSchema: {
39
- type: 'object',
40
- properties: {
41
- message: {
42
- type: 'string',
43
- description: 'Free-text payload echoed in the rendered debug line.',
44
- },
45
- },
46
- required: ['message'],
47
- },
48
- },
49
- category: 'read',
50
- mutates: false,
51
- uiOnly: true,
52
- execute() {
53
- // Defensive — if `resolveUiOnly` is wired correctly, the
54
- // dispatch loop short-circuits BEFORE reaching this body. A
55
- // call here means the resolver returned false/undefined and
56
- // the seam regressed. Throwing surfaces the regression at
57
- // smoke time instead of silently behaving like a regular tool.
58
- throw new Error('_ui_smoke.execute() should never be called — uiOnly dispatch path regressed');
59
- },
60
- };