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.
- package/config/devos.config.backup.json +224 -224
- package/config/devos.config.json +1 -1
- package/dist/api/server.js +7 -1
- package/dist/core/agentLoop.js +8 -3
- package/dist/core/skillLoader.js +2 -0
- package/dist/core/slashAsTool.js +2 -0
- package/dist/core/toolRegistry.js +16 -0
- package/dist/core/version.js +1 -1
- package/dist/providers/router.js +46 -6
- package/dist-bundle/cli.js +911 -557
- package/dist-bundle/index.js +758 -658
- package/package.json +268 -266
- package/scripts/postinstall.js +58 -1
- package/workspace-templates/HEARTBEAT.md +16 -0
- package/workspace-templates/SOUL.md +267 -0
- package/workspace-templates/STANDING_ORDERS.md +21 -0
- package/workspace-templates/permissions.yaml +180 -0
- package/workspace-templates/skills/architecture-diagram/SKILL.md +126 -0
- package/workspace-templates/skills/architecture-diagram/skill.json +25 -0
- package/workspace-templates/skills/arxiv/SKILL.md +124 -0
- package/workspace-templates/skills/arxiv/skill.json +26 -0
- package/workspace-templates/skills/ascii-art/SKILL.md +142 -0
- package/workspace-templates/skills/ascii-art/skill.json +26 -0
- package/workspace-templates/skills/blogwatcher/SKILL.md +147 -0
- package/workspace-templates/skills/blogwatcher/skill.json +26 -0
- package/workspace-templates/skills/censys/SKILL.md +104 -0
- package/workspace-templates/skills/censys/index.ts +133 -0
- package/workspace-templates/skills/censys/skill.json +25 -0
- package/workspace-templates/skills/clipboard-history/SKILL.md +101 -0
- package/workspace-templates/skills/clipboard-history/skill.json +23 -0
- package/workspace-templates/skills/crt-sh/SKILL.md +102 -0
- package/workspace-templates/skills/crt-sh/index.ts +59 -0
- package/workspace-templates/skills/crt-sh/skill.json +25 -0
- package/workspace-templates/skills/cveapi/SKILL.md +114 -0
- package/workspace-templates/skills/cveapi/index.ts +249 -0
- package/workspace-templates/skills/cveapi/skill.json +25 -0
- package/workspace-templates/skills/docker-management/SKILL.md +156 -0
- package/workspace-templates/skills/docker-management/skill.json +25 -0
- package/workspace-templates/skills/excalidraw/SKILL.md +148 -0
- package/workspace-templates/skills/excalidraw/skill.json +25 -0
- package/workspace-templates/skills/explainshell/SKILL.md +93 -0
- package/workspace-templates/skills/explainshell/index.ts +132 -0
- package/workspace-templates/skills/explainshell/skill.json +25 -0
- package/workspace-templates/skills/financial_research/SKILL.md +21 -0
- package/workspace-templates/skills/financial_research/skill.json +24 -0
- package/workspace-templates/skills/gif-search/SKILL.md +122 -0
- package/workspace-templates/skills/gif-search/skill.json +25 -0
- package/workspace-templates/skills/github-auth/SKILL.md +134 -0
- package/workspace-templates/skills/github-auth/skill.json +26 -0
- package/workspace-templates/skills/github-issues/SKILL.md +130 -0
- package/workspace-templates/skills/github-issues/skill.json +25 -0
- package/workspace-templates/skills/github-pr-workflow/SKILL.md +143 -0
- package/workspace-templates/skills/github-pr-workflow/skill.json +26 -0
- package/workspace-templates/skills/github-repo-management/SKILL.md +147 -0
- package/workspace-templates/skills/github-repo-management/skill.json +26 -0
- package/workspace-templates/skills/google-workspace/SKILL.md +110 -0
- package/workspace-templates/skills/google-workspace/skill.json +26 -0
- package/workspace-templates/skills/greynoise/SKILL.md +96 -0
- package/workspace-templates/skills/greynoise/index.ts +107 -0
- package/workspace-templates/skills/greynoise/skill.json +25 -0
- package/workspace-templates/skills/haveibeenpwned/SKILL.md +100 -0
- package/workspace-templates/skills/haveibeenpwned/index.ts +72 -0
- package/workspace-templates/skills/haveibeenpwned/skill.json +24 -0
- package/workspace-templates/skills/jupyter-live-kernel/SKILL.md +116 -0
- package/workspace-templates/skills/jupyter-live-kernel/skill.json +25 -0
- package/workspace-templates/skills/linear/SKILL.md +107 -0
- package/workspace-templates/skills/linear/skill.json +25 -0
- package/workspace-templates/skills/nano-pdf/SKILL.md +113 -0
- package/workspace-templates/skills/nano-pdf/skill.json +26 -0
- package/workspace-templates/skills/notion/SKILL.md +108 -0
- package/workspace-templates/skills/notion/skill.json +24 -0
- package/workspace-templates/skills/obsidian/SKILL.md +115 -0
- package/workspace-templates/skills/obsidian/skill.json +24 -0
- package/workspace-templates/skills/ocr-and-documents/SKILL.md +125 -0
- package/workspace-templates/skills/ocr-and-documents/skill.json +26 -0
- package/workspace-templates/skills/p5js/SKILL.md +163 -0
- package/workspace-templates/skills/p5js/skill.json +24 -0
- package/workspace-templates/skills/research-paper-writing/SKILL.md +158 -0
- package/workspace-templates/skills/research-paper-writing/skill.json +26 -0
- package/workspace-templates/skills/securityheaders/SKILL.md +99 -0
- package/workspace-templates/skills/securityheaders/index.ts +213 -0
- package/workspace-templates/skills/securityheaders/skill.json +26 -0
- package/workspace-templates/skills/shodan/SKILL.md +113 -0
- package/workspace-templates/skills/shodan/index.ts +94 -0
- package/workspace-templates/skills/shodan/skill.json +26 -0
- package/workspace-templates/skills/songsee/SKILL.md +152 -0
- package/workspace-templates/skills/songsee/skill.json +25 -0
- package/workspace-templates/skills/ssllabs/SKILL.md +107 -0
- package/workspace-templates/skills/ssllabs/index.ts +208 -0
- package/workspace-templates/skills/ssllabs/skill.json +27 -0
- package/workspace-templates/skills/stable-diffusion-image-generation/SKILL.md +136 -0
- package/workspace-templates/skills/stable-diffusion-image-generation/skill.json +24 -0
- package/workspace-templates/skills/systematic-debugging/SKILL.md +131 -0
- package/workspace-templates/skills/systematic-debugging/skill.json +25 -0
- package/workspace-templates/skills/test-driven-development/SKILL.md +164 -0
- package/workspace-templates/skills/test-driven-development/skill.json +25 -0
- package/workspace-templates/skills/urlscan/SKILL.md +118 -0
- package/workspace-templates/skills/urlscan/index.ts +94 -0
- package/workspace-templates/skills/urlscan/skill.json +24 -0
- package/workspace-templates/skills/virustotal/SKILL.md +120 -0
- package/workspace-templates/skills/virustotal/index.ts +124 -0
- package/workspace-templates/skills/virustotal/skill.json +26 -0
- package/workspace-templates/skills/web_research/SKILL.md +18 -0
- package/workspace-templates/skills/web_research/skill.json +20 -0
- package/workspace-templates/skills/xitter/SKILL.md +148 -0
- package/workspace-templates/skills/xitter/skill.json +26 -0
- package/workspace-templates/skills/youtube-content/SKILL.md +121 -0
- package/workspace-templates/skills/youtube-content/skill.json +25 -0
package/dist/providers/router.js
CHANGED
|
@@ -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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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 —
|
|
481
|
-
|
|
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` +
|