aiden-runtime 3.19.4 → 3.19.6

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 (108) hide show
  1. package/config/devos.config.backup.json +224 -224
  2. package/config/devos.config.json +1 -1
  3. package/dist/api/server.js +7 -1
  4. package/dist/core/agentLoop.js +8 -3
  5. package/dist/core/skillLoader.js +2 -0
  6. package/dist/core/slashAsTool.js +2 -0
  7. package/dist/core/toolRegistry.js +16 -0
  8. package/dist/core/version.js +1 -1
  9. package/dist/providers/router.js +46 -6
  10. package/dist-bundle/cli.js +911 -557
  11. package/dist-bundle/index.js +758 -658
  12. package/package.json +268 -266
  13. package/scripts/postinstall.js +58 -1
  14. package/workspace-templates/HEARTBEAT.md +16 -0
  15. package/workspace-templates/SOUL.md +267 -0
  16. package/workspace-templates/STANDING_ORDERS.md +21 -0
  17. package/workspace-templates/permissions.yaml +180 -0
  18. package/workspace-templates/skills/architecture-diagram/SKILL.md +126 -0
  19. package/workspace-templates/skills/architecture-diagram/skill.json +25 -0
  20. package/workspace-templates/skills/arxiv/SKILL.md +124 -0
  21. package/workspace-templates/skills/arxiv/skill.json +26 -0
  22. package/workspace-templates/skills/ascii-art/SKILL.md +142 -0
  23. package/workspace-templates/skills/ascii-art/skill.json +26 -0
  24. package/workspace-templates/skills/blogwatcher/SKILL.md +147 -0
  25. package/workspace-templates/skills/blogwatcher/skill.json +26 -0
  26. package/workspace-templates/skills/censys/SKILL.md +104 -0
  27. package/workspace-templates/skills/censys/index.ts +133 -0
  28. package/workspace-templates/skills/censys/skill.json +25 -0
  29. package/workspace-templates/skills/clipboard-history/SKILL.md +101 -0
  30. package/workspace-templates/skills/clipboard-history/skill.json +23 -0
  31. package/workspace-templates/skills/crt-sh/SKILL.md +102 -0
  32. package/workspace-templates/skills/crt-sh/index.ts +59 -0
  33. package/workspace-templates/skills/crt-sh/skill.json +25 -0
  34. package/workspace-templates/skills/cveapi/SKILL.md +114 -0
  35. package/workspace-templates/skills/cveapi/index.ts +249 -0
  36. package/workspace-templates/skills/cveapi/skill.json +25 -0
  37. package/workspace-templates/skills/docker-management/SKILL.md +156 -0
  38. package/workspace-templates/skills/docker-management/skill.json +25 -0
  39. package/workspace-templates/skills/excalidraw/SKILL.md +148 -0
  40. package/workspace-templates/skills/excalidraw/skill.json +25 -0
  41. package/workspace-templates/skills/explainshell/SKILL.md +93 -0
  42. package/workspace-templates/skills/explainshell/index.ts +132 -0
  43. package/workspace-templates/skills/explainshell/skill.json +25 -0
  44. package/workspace-templates/skills/financial_research/SKILL.md +21 -0
  45. package/workspace-templates/skills/financial_research/skill.json +24 -0
  46. package/workspace-templates/skills/gif-search/SKILL.md +122 -0
  47. package/workspace-templates/skills/gif-search/skill.json +25 -0
  48. package/workspace-templates/skills/github-auth/SKILL.md +134 -0
  49. package/workspace-templates/skills/github-auth/skill.json +26 -0
  50. package/workspace-templates/skills/github-issues/SKILL.md +130 -0
  51. package/workspace-templates/skills/github-issues/skill.json +25 -0
  52. package/workspace-templates/skills/github-pr-workflow/SKILL.md +143 -0
  53. package/workspace-templates/skills/github-pr-workflow/skill.json +26 -0
  54. package/workspace-templates/skills/github-repo-management/SKILL.md +147 -0
  55. package/workspace-templates/skills/github-repo-management/skill.json +26 -0
  56. package/workspace-templates/skills/google-workspace/SKILL.md +110 -0
  57. package/workspace-templates/skills/google-workspace/skill.json +26 -0
  58. package/workspace-templates/skills/greynoise/SKILL.md +96 -0
  59. package/workspace-templates/skills/greynoise/index.ts +107 -0
  60. package/workspace-templates/skills/greynoise/skill.json +25 -0
  61. package/workspace-templates/skills/haveibeenpwned/SKILL.md +100 -0
  62. package/workspace-templates/skills/haveibeenpwned/index.ts +72 -0
  63. package/workspace-templates/skills/haveibeenpwned/skill.json +24 -0
  64. package/workspace-templates/skills/jupyter-live-kernel/SKILL.md +116 -0
  65. package/workspace-templates/skills/jupyter-live-kernel/skill.json +25 -0
  66. package/workspace-templates/skills/linear/SKILL.md +107 -0
  67. package/workspace-templates/skills/linear/skill.json +25 -0
  68. package/workspace-templates/skills/nano-pdf/SKILL.md +113 -0
  69. package/workspace-templates/skills/nano-pdf/skill.json +26 -0
  70. package/workspace-templates/skills/notion/SKILL.md +108 -0
  71. package/workspace-templates/skills/notion/skill.json +24 -0
  72. package/workspace-templates/skills/obsidian/SKILL.md +115 -0
  73. package/workspace-templates/skills/obsidian/skill.json +24 -0
  74. package/workspace-templates/skills/ocr-and-documents/SKILL.md +125 -0
  75. package/workspace-templates/skills/ocr-and-documents/skill.json +26 -0
  76. package/workspace-templates/skills/p5js/SKILL.md +163 -0
  77. package/workspace-templates/skills/p5js/skill.json +24 -0
  78. package/workspace-templates/skills/research-paper-writing/SKILL.md +158 -0
  79. package/workspace-templates/skills/research-paper-writing/skill.json +26 -0
  80. package/workspace-templates/skills/securityheaders/SKILL.md +99 -0
  81. package/workspace-templates/skills/securityheaders/index.ts +213 -0
  82. package/workspace-templates/skills/securityheaders/skill.json +26 -0
  83. package/workspace-templates/skills/shodan/SKILL.md +113 -0
  84. package/workspace-templates/skills/shodan/index.ts +94 -0
  85. package/workspace-templates/skills/shodan/skill.json +26 -0
  86. package/workspace-templates/skills/songsee/SKILL.md +152 -0
  87. package/workspace-templates/skills/songsee/skill.json +25 -0
  88. package/workspace-templates/skills/ssllabs/SKILL.md +107 -0
  89. package/workspace-templates/skills/ssllabs/index.ts +208 -0
  90. package/workspace-templates/skills/ssllabs/skill.json +27 -0
  91. package/workspace-templates/skills/stable-diffusion-image-generation/SKILL.md +136 -0
  92. package/workspace-templates/skills/stable-diffusion-image-generation/skill.json +24 -0
  93. package/workspace-templates/skills/systematic-debugging/SKILL.md +131 -0
  94. package/workspace-templates/skills/systematic-debugging/skill.json +25 -0
  95. package/workspace-templates/skills/test-driven-development/SKILL.md +164 -0
  96. package/workspace-templates/skills/test-driven-development/skill.json +25 -0
  97. package/workspace-templates/skills/urlscan/SKILL.md +118 -0
  98. package/workspace-templates/skills/urlscan/index.ts +94 -0
  99. package/workspace-templates/skills/urlscan/skill.json +24 -0
  100. package/workspace-templates/skills/virustotal/SKILL.md +120 -0
  101. package/workspace-templates/skills/virustotal/index.ts +124 -0
  102. package/workspace-templates/skills/virustotal/skill.json +26 -0
  103. package/workspace-templates/skills/web_research/SKILL.md +18 -0
  104. package/workspace-templates/skills/web_research/skill.json +20 -0
  105. package/workspace-templates/skills/xitter/SKILL.md +148 -0
  106. package/workspace-templates/skills/xitter/skill.json +26 -0
  107. package/workspace-templates/skills/youtube-content/SKILL.md +121 -0
  108. package/workspace-templates/skills/youtube-content/skill.json +25 -0
@@ -7,6 +7,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
7
7
  exports.getLocalModels = getLocalModels;
8
8
  exports.initLocalModels = initLocalModels;
9
9
  exports.getOllamaModelForTask = getOllamaModelForTask;
10
+ exports.diagnoseProviderPool = diagnoseProviderPool;
10
11
  exports.getNextAvailableAPI = getNextAvailableAPI;
11
12
  exports.markRateLimited = markRateLimited;
12
13
  exports.markHealthy = markHealthy;
@@ -175,6 +176,36 @@ function autoResetExpiredLimits() {
175
176
  (0, index_1.saveConfig)(config);
176
177
  return changed;
177
178
  }
179
+ // ── Diagnose WHY the provider pool is empty ─────────────────
180
+ function diagnoseProviderPool() {
181
+ const config = (0, index_1.loadConfig)();
182
+ const allApis = mergeCustomProviders(config.providers.apis);
183
+ const enabled = allApis.filter(a => a.enabled);
184
+ const disabledCount = allApis.length - enabled.length;
185
+ let noKey = 0, rateLimited = 0;
186
+ for (const a of enabled) {
187
+ if (a.rateLimited) {
188
+ rateLimited++;
189
+ continue;
190
+ }
191
+ if (a.provider === 'custom')
192
+ continue;
193
+ const k = a.key.startsWith('env:') ? (process.env[a.key.replace('env:', '')] || '') : a.key;
194
+ if (k.length === 0)
195
+ noKey++;
196
+ }
197
+ const active = enabled.length - noKey - rateLimited;
198
+ if (active > 0)
199
+ return { state: 'ok', noKeyCount: noKey, rateLimitedCount: rateLimited, disabledCount: disabledCount, enabledCount: enabled.length, message: '' };
200
+ if (noKey > 0 && rateLimited === 0)
201
+ return { state: 'unconfigured', noKeyCount: noKey, rateLimitedCount: 0, disabledCount: disabledCount, enabledCount: enabled.length,
202
+ message: 'No API keys configured - add keys in Settings > API Keys or set env vars' };
203
+ if (rateLimited > 0 && noKey === 0)
204
+ return { state: 'rate-limited', noKeyCount: 0, rateLimitedCount: rateLimited, disabledCount: disabledCount, enabledCount: enabled.length,
205
+ message: `All ${rateLimited} cloud provider(s) rate-limited - retrying automatically` };
206
+ return { state: 'mixed', noKeyCount: noKey, rateLimitedCount: rateLimited, disabledCount: disabledCount, enabledCount: enabled.length,
207
+ message: `${noKey} provider(s) have no key, ${rateLimited} rate-limited` };
208
+ }
178
209
  // ── Get next available API — scored by response time + failures ──
179
210
  function getNextAvailableAPI() {
180
211
  autoResetExpiredLimits();
@@ -192,8 +223,12 @@ function getNextAvailableAPI() {
192
223
  : api.key;
193
224
  return resolvedKey.length > 0;
194
225
  });
195
- if (!available.length)
226
+ if (!available.length) {
227
+ const diag = diagnoseProviderPool();
228
+ if (diag.message)
229
+ console.log(`[Router] ${diag.message}`);
196
230
  return null;
231
+ }
197
232
  // Score: lower is better — blend usage count, response time, and failure history
198
233
  const primary = config.primaryProvider;
199
234
  const scored = available
@@ -390,7 +425,8 @@ function getModelForTask(task, message) {
390
425
  return resolveKey(chosen);
391
426
  }
392
427
  const model = getOllamaModelForTask(task === 'planner' ? 'planner' : 'responder');
393
- console.log(`[Router] ${task}: all cloud providers rate-limited - using Ollama ${model}`);
428
+ const diag = diagnoseProviderPool();
429
+ console.log(`[Router] ${task}: ${diag.message || 'all cloud providers unavailable'} - using Ollama ${model}`);
394
430
  return { apiKey: '', model, providerName: 'ollama', apiName: 'ollama' };
395
431
  }
396
432
  // Executor: fastest — cerebras > groq > nvidia → discovered fast model
@@ -401,7 +437,8 @@ function getModelForTask(task, message) {
401
437
  return resolveKey(api);
402
438
  }
403
439
  const model = getOllamaModelForTask('executor');
404
- console.log(`[Router] Executor: all cloud providers unavailable - falling back to Ollama ${model}`);
440
+ const diag = diagnoseProviderPool();
441
+ console.log(`[Router] Executor: ${diag.message || 'all cloud providers unavailable'} - falling back to Ollama ${model}`);
405
442
  return { apiKey: '', model, providerName: 'ollama', apiName: 'ollama' };
406
443
  }
407
444
  // Generic fallback — any available API, then gemma4:e4b
@@ -432,7 +469,8 @@ function getSmartProvider() {
432
469
  // FALLBACK: best discovered Ollama model
433
470
  if (config.routing?.fallbackToOllama !== false) {
434
471
  const model = getOllamaModelForTask('responder');
435
- console.log(`[Router] All APIs unavailable — falling back to Ollama ${model}`);
472
+ const diag = diagnoseProviderPool();
473
+ console.log(`[Router] ${diag.message || 'All APIs unavailable'} - falling back to Ollama ${model}`);
436
474
  return { provider: ollama_1.ollamaProvider, model, userName, apiName: 'ollama' };
437
475
  }
438
476
  // Last resort
@@ -477,8 +515,10 @@ function enterDegradedMode(reason) {
477
515
  }
478
516
  return {
479
517
  mode: 'degraded',
480
- message: `I'm temporarily running in limited mode — my AI providers ` +
481
- `are at capacity. I can still:\n` +
518
+ message: `I'm temporarily running in limited mode — ` +
519
+ `${diagnoseProviderPool().state === 'unconfigured'
520
+ ? 'no API keys are configured'
521
+ : 'my AI providers are at capacity'}. I can still:\n` +
482
522
  `• Search your files and memory\n` +
483
523
  `• Run scheduled tasks\n` +
484
524
  `• Execute shell commands and scripts\n` +