aiden-runtime 3.16.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 (159) hide show
  1. package/LICENSE +661 -0
  2. package/README.md +465 -0
  3. package/config/devos.config.json +186 -0
  4. package/config/hardware.json +9 -0
  5. package/config/model-selection.json +7 -0
  6. package/config/setup-complete.json +20 -0
  7. package/dist/api/routes/computerUse.js +112 -0
  8. package/dist/api/server.js +6870 -0
  9. package/dist/bin/npx-init.js +71 -0
  10. package/dist/coordination/commandGate.js +115 -0
  11. package/dist/coordination/livePulse.js +127 -0
  12. package/dist/core/agentLoop.js +2718 -0
  13. package/dist/core/agentShield.js +231 -0
  14. package/dist/core/aidenIdentity.js +215 -0
  15. package/dist/core/aidenPersonality.js +166 -0
  16. package/dist/core/aidenSdk.js +374 -0
  17. package/dist/core/asyncTasks.js +82 -0
  18. package/dist/core/auditTrail.js +61 -0
  19. package/dist/core/auxiliaryClient.js +114 -0
  20. package/dist/core/bgLLM.js +108 -0
  21. package/dist/core/bm25.js +68 -0
  22. package/dist/core/callbackSystem.js +64 -0
  23. package/dist/core/channels/adapter.js +6 -0
  24. package/dist/core/channels/discord.js +173 -0
  25. package/dist/core/channels/email.js +253 -0
  26. package/dist/core/channels/imessage.js +164 -0
  27. package/dist/core/channels/manager.js +96 -0
  28. package/dist/core/channels/signal.js +140 -0
  29. package/dist/core/channels/slack.js +139 -0
  30. package/dist/core/channels/twilio.js +144 -0
  31. package/dist/core/channels/webhook.js +186 -0
  32. package/dist/core/channels/whatsapp.js +185 -0
  33. package/dist/core/clarifyBus.js +75 -0
  34. package/dist/core/codeInterpreter.js +82 -0
  35. package/dist/core/computerControl.js +439 -0
  36. package/dist/core/conversationMemory.js +334 -0
  37. package/dist/core/costTracker.js +221 -0
  38. package/dist/core/cronManager.js +217 -0
  39. package/dist/core/deepKB.js +77 -0
  40. package/dist/core/doctor.js +279 -0
  41. package/dist/core/dreamEngine.js +334 -0
  42. package/dist/core/entityGraph.js +169 -0
  43. package/dist/core/eventBus.js +16 -0
  44. package/dist/core/evolutionAnalyzer.js +153 -0
  45. package/dist/core/executionLoop.js +309 -0
  46. package/dist/core/executor.js +224 -0
  47. package/dist/core/failureAnalyzer.js +166 -0
  48. package/dist/core/fastPathExpansion.js +82 -0
  49. package/dist/core/faultEngine.js +106 -0
  50. package/dist/core/featureGates.js +70 -0
  51. package/dist/core/fileIngestion.js +113 -0
  52. package/dist/core/gateway.js +97 -0
  53. package/dist/core/goalTracker.js +75 -0
  54. package/dist/core/growthEngine.js +168 -0
  55. package/dist/core/hardwareDetector.js +98 -0
  56. package/dist/core/hooks.js +45 -0
  57. package/dist/core/httpKeepalive.js +46 -0
  58. package/dist/core/hybridSearch.js +101 -0
  59. package/dist/core/importers.js +164 -0
  60. package/dist/core/instinctSystem.js +223 -0
  61. package/dist/core/knowledgeBase.js +351 -0
  62. package/dist/core/learningMemory.js +121 -0
  63. package/dist/core/lessonsBrowser.js +125 -0
  64. package/dist/core/licenseManager.js +399 -0
  65. package/dist/core/logBuffer.js +85 -0
  66. package/dist/core/machineId.js +87 -0
  67. package/dist/core/mcpClient.js +442 -0
  68. package/dist/core/memoryDistiller.js +165 -0
  69. package/dist/core/memoryExtractor.js +212 -0
  70. package/dist/core/memoryIds.js +213 -0
  71. package/dist/core/memoryPreamble.js +113 -0
  72. package/dist/core/memoryQuery.js +136 -0
  73. package/dist/core/memoryRecall.js +140 -0
  74. package/dist/core/memoryStrategy.js +201 -0
  75. package/dist/core/messageValidator.js +85 -0
  76. package/dist/core/modelDiscovery.js +108 -0
  77. package/dist/core/modelRouter.js +118 -0
  78. package/dist/core/morningBriefing.js +203 -0
  79. package/dist/core/multiGoalValidator.js +51 -0
  80. package/dist/core/parallelExecutor.js +43 -0
  81. package/dist/core/passiveSkillObserver.js +204 -0
  82. package/dist/core/paths.js +57 -0
  83. package/dist/core/patternDetector.js +83 -0
  84. package/dist/core/planResponseRepair.js +64 -0
  85. package/dist/core/planTool.js +111 -0
  86. package/dist/core/playwrightBridge.js +356 -0
  87. package/dist/core/pluginSystem.js +121 -0
  88. package/dist/core/privateMode.js +85 -0
  89. package/dist/core/reactLoop.js +156 -0
  90. package/dist/core/recipeEngine.js +166 -0
  91. package/dist/core/responseCache.js +128 -0
  92. package/dist/core/runSandbox.js +132 -0
  93. package/dist/core/sandboxRunner.js +200 -0
  94. package/dist/core/scheduler.js +543 -0
  95. package/dist/core/secretScanner.js +49 -0
  96. package/dist/core/semanticMemory.js +223 -0
  97. package/dist/core/sessionMemory.js +259 -0
  98. package/dist/core/sessionRouter.js +91 -0
  99. package/dist/core/sessionSearch.js +163 -0
  100. package/dist/core/setupWizard.js +225 -0
  101. package/dist/core/skillImporter.js +303 -0
  102. package/dist/core/skillLibrary.js +144 -0
  103. package/dist/core/skillLoader.js +471 -0
  104. package/dist/core/skillTeacher.js +352 -0
  105. package/dist/core/skillValidator.js +210 -0
  106. package/dist/core/skillWriter.js +384 -0
  107. package/dist/core/slashAsTool.js +226 -0
  108. package/dist/core/spawnManager.js +197 -0
  109. package/dist/core/statusVerbs.js +43 -0
  110. package/dist/core/swarmManager.js +109 -0
  111. package/dist/core/taskQueue.js +119 -0
  112. package/dist/core/taskRecovery.js +128 -0
  113. package/dist/core/taskState.js +168 -0
  114. package/dist/core/telegramBot.js +152 -0
  115. package/dist/core/todoManager.js +70 -0
  116. package/dist/core/toolNameRepair.js +71 -0
  117. package/dist/core/toolRegistry.js +2730 -0
  118. package/dist/core/tools/calendarTool.js +98 -0
  119. package/dist/core/tools/companyFilingsTool.js +98 -0
  120. package/dist/core/tools/gmailTool.js +87 -0
  121. package/dist/core/tools/marketDataTool.js +135 -0
  122. package/dist/core/tools/socialResearchTool.js +121 -0
  123. package/dist/core/truthCheck.js +57 -0
  124. package/dist/core/updateChecker.js +74 -0
  125. package/dist/core/userCognitionProfile.js +238 -0
  126. package/dist/core/userProfile.js +341 -0
  127. package/dist/core/version.js +5 -0
  128. package/dist/core/visionAnalyze.js +161 -0
  129. package/dist/core/voice/audio.js +187 -0
  130. package/dist/core/voice/stt.js +226 -0
  131. package/dist/core/voice/tts.js +310 -0
  132. package/dist/core/voiceInput.js +118 -0
  133. package/dist/core/voiceOutput.js +130 -0
  134. package/dist/core/webSearch.js +326 -0
  135. package/dist/core/workflowTracker.js +72 -0
  136. package/dist/core/workspaceMemory.js +54 -0
  137. package/dist/core/youtubeTranscript.js +224 -0
  138. package/dist/integrations/computerUse/apiRegistry.js +113 -0
  139. package/dist/integrations/computerUse/screenAgent.js +203 -0
  140. package/dist/integrations/computerUse/visionLoop.js +296 -0
  141. package/dist/memory/memoryLayers.js +143 -0
  142. package/dist/providers/boa.js +93 -0
  143. package/dist/providers/cerebras.js +70 -0
  144. package/dist/providers/custom.js +89 -0
  145. package/dist/providers/gemini.js +82 -0
  146. package/dist/providers/groq.js +92 -0
  147. package/dist/providers/index.js +149 -0
  148. package/dist/providers/nvidia.js +70 -0
  149. package/dist/providers/ollama.js +99 -0
  150. package/dist/providers/openrouter.js +74 -0
  151. package/dist/providers/router.js +497 -0
  152. package/dist/providers/types.js +6 -0
  153. package/dist/security/browserVault.js +129 -0
  154. package/dist/security/dataGuard.js +89 -0
  155. package/dist/tools/eonetTool.js +72 -0
  156. package/dist/types/computerUse.js +2 -0
  157. package/dist/types/executor.js +2 -0
  158. package/dist-bundle/cli.js +357859 -0
  159. package/package.json +256 -0
@@ -0,0 +1,89 @@
1
+ "use strict";
2
+ // ============================================================
3
+ // DevOS — Autonomous AI Execution System
4
+ // Copyright (c) 2026 Shiva Deore. All rights reserved.
5
+ // ============================================================
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ exports.dataGuard = void 0;
8
+ // security/dataGuard.ts — Routes sensitive data to local-only processing.
9
+ //
10
+ // When DevOS handles screenshots, documents, or text that may contain PII,
11
+ // credentials, or financial data, DataGuard decides whether it is safe to
12
+ // send that data to a cloud LLM (e.g. Claude via API) or whether it must
13
+ // stay on-device and be processed by the local Ollama model only.
14
+ //
15
+ // Heuristic sensitivity detection is fast and runs synchronously.
16
+ // For higher-assurance scenarios, set DEVOS_DATAGUARD_STRICT=true to force
17
+ // all data through local models regardless of content.
18
+ // ── Patterns that indicate sensitive content ──────────────────
19
+ const SENSITIVE_PATTERNS = [
20
+ // Credentials
21
+ /password\s*[:=]/i,
22
+ /api[_-]?key\s*[:=]/i,
23
+ /secret[_-]?key\s*[:=]/i,
24
+ /access[_-]?token\s*[:=]/i,
25
+ /auth[_-]?token\s*[:=]/i,
26
+ /bearer\s+[A-Za-z0-9._\-]{20,}/i,
27
+ /-----BEGIN (RSA |EC )?PRIVATE KEY-----/,
28
+ // Financial data
29
+ /\b(?:4[0-9]{12}(?:[0-9]{3})?|5[1-5][0-9]{14}|3[47][0-9]{13})\b/, // credit cards
30
+ /\biban\b/i,
31
+ /\bswift\s*code\b/i,
32
+ /\brouting\s*number\b/i,
33
+ // PII
34
+ /\bssn\b/i,
35
+ /\bsocial\s+security\b/i,
36
+ /\bdate\s+of\s+birth\b/i,
37
+ /\bpassport\s+number\b/i,
38
+ // Dev secrets
39
+ /sk-[A-Za-z0-9]{20,}/, // OpenAI / Anthropic keys
40
+ /ghp_[A-Za-z0-9]{36}/, // GitHub PAT
41
+ /xox[bpra]-[A-Za-z0-9\-]{24,}/, // Slack tokens
42
+ ];
43
+ // ── DataGuard class ────────────────────────────────────────────
44
+ class DataGuard {
45
+ /**
46
+ * Returns true if the given data string appears to contain sensitive
47
+ * information that should not be sent to a cloud LLM.
48
+ *
49
+ * For screenshots, pass a short text description or a sample of any
50
+ * OCR output, not the raw base64 — base64 is never matched.
51
+ *
52
+ * When DEVOS_DATAGUARD_STRICT=true, always returns true (local-only).
53
+ */
54
+ async isSensitive(data) {
55
+ if (process.env.DEVOS_DATAGUARD_STRICT === 'true')
56
+ return true;
57
+ // Limit scan to first 4 KB — avoids scanning huge binary blobs
58
+ const sample = data.slice(0, 4096);
59
+ for (const pattern of SENSITIVE_PATTERNS) {
60
+ if (pattern.test(sample)) {
61
+ console.log(`[DataGuard] Sensitive pattern detected — routing to local model`);
62
+ return true;
63
+ }
64
+ }
65
+ return false;
66
+ }
67
+ /**
68
+ * Synchronous variant for hot paths — no async overhead.
69
+ * Less thorough than the async version (no awaitable plugins).
70
+ */
71
+ isSensitiveSync(data) {
72
+ if (process.env.DEVOS_DATAGUARD_STRICT === 'true')
73
+ return true;
74
+ const sample = data.slice(0, 4096);
75
+ return SENSITIVE_PATTERNS.some(p => p.test(sample));
76
+ }
77
+ /**
78
+ * Redact sensitive values from a string before logging or storage.
79
+ * Replaces matched values with [REDACTED].
80
+ */
81
+ redact(data) {
82
+ let out = data;
83
+ for (const p of SENSITIVE_PATTERNS) {
84
+ out = out.replace(new RegExp(p.source, p.flags.includes('g') ? p.flags : p.flags + 'g'), '[REDACTED]');
85
+ }
86
+ return out;
87
+ }
88
+ }
89
+ exports.dataGuard = new DataGuard();
@@ -0,0 +1,72 @@
1
+ "use strict";
2
+ // tools/eonetTool.ts — NASA EONET natural disaster events (v3 API)
3
+ // Free, no auth required. Fetches open events filtered to high-impact categories.
4
+ Object.defineProperty(exports, "__esModule", { value: true });
5
+ exports.getActiveNaturalEvents = getActiveNaturalEvents;
6
+ exports.formatEonetEvents = formatEonetEvents;
7
+ exports.getEonetSummary = getEonetSummary;
8
+ const undici_1 = require("undici");
9
+ const EONET_BASE = 'https://eonet.gsfc.nasa.gov/api/v3';
10
+ const HIGH_IMPACT_CATEGORIES = [
11
+ 'wildfires',
12
+ 'severeStorms',
13
+ 'volcanoes',
14
+ 'floods',
15
+ 'earthquakes',
16
+ ];
17
+ // ── Fetch active events ────────────────────────────────────────
18
+ async function getActiveNaturalEvents(days = 1, limit = 10) {
19
+ try {
20
+ const url = `${EONET_BASE}/events?status=open&days=${days}&limit=${limit}`;
21
+ const res = await (0, undici_1.fetch)(url, { signal: AbortSignal.timeout(5000) });
22
+ if (!res.ok)
23
+ return [];
24
+ const data = await res.json();
25
+ if (!Array.isArray(data?.events))
26
+ return [];
27
+ // filter to high-impact categories only
28
+ return data.events.filter(ev => ev.categories?.some(c => HIGH_IMPACT_CATEGORIES.includes(c.id)));
29
+ }
30
+ catch {
31
+ return [];
32
+ }
33
+ }
34
+ // ── Format events as a briefing section string ─────────────────
35
+ function formatEonetEvents(events) {
36
+ if (events.length === 0)
37
+ return '';
38
+ const lines = events.slice(0, 8).map(ev => {
39
+ const cat = ev.categories[0];
40
+ const emoji = getCategoryEmoji(cat?.id ?? '');
41
+ const geo = ev.geometry?.[ev.geometry.length - 1];
42
+ const date = geo?.date ? new Date(geo.date).toLocaleDateString('en-IN', { month: 'short', day: 'numeric' }) : '';
43
+ return ` ${emoji} ${ev.title}${date ? ` (${date})` : ''}`;
44
+ });
45
+ return `**🌍 NASA Live Events (${events.length} active):**\n${lines.join('\n')}`;
46
+ }
47
+ // ── One-liner summary for desktop notification ─────────────────
48
+ function getEonetSummary(events) {
49
+ if (events.length === 0)
50
+ return '';
51
+ const counts = {};
52
+ for (const ev of events) {
53
+ const id = ev.categories[0]?.id ?? 'other';
54
+ counts[id] = (counts[id] ?? 0) + 1;
55
+ }
56
+ const parts = Object.entries(counts).map(([id, n]) => {
57
+ const emoji = getCategoryEmoji(id);
58
+ return `${n} ${emoji}${id}`;
59
+ });
60
+ return `NASA: ${parts.join(', ')}`;
61
+ }
62
+ // ── Emoji map ──────────────────────────────────────────────────
63
+ function getCategoryEmoji(categoryId) {
64
+ switch (categoryId) {
65
+ case 'wildfires': return '🔥';
66
+ case 'severeStorms': return '🌪️';
67
+ case 'volcanoes': return '🌋';
68
+ case 'floods': return '🌊';
69
+ case 'earthquakes': return '🫨';
70
+ default: return '⚠️';
71
+ }
72
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });