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.
- package/LICENSE +661 -0
- package/README.md +465 -0
- package/config/devos.config.json +186 -0
- package/config/hardware.json +9 -0
- package/config/model-selection.json +7 -0
- package/config/setup-complete.json +20 -0
- package/dist/api/routes/computerUse.js +112 -0
- package/dist/api/server.js +6870 -0
- package/dist/bin/npx-init.js +71 -0
- package/dist/coordination/commandGate.js +115 -0
- package/dist/coordination/livePulse.js +127 -0
- package/dist/core/agentLoop.js +2718 -0
- package/dist/core/agentShield.js +231 -0
- package/dist/core/aidenIdentity.js +215 -0
- package/dist/core/aidenPersonality.js +166 -0
- package/dist/core/aidenSdk.js +374 -0
- package/dist/core/asyncTasks.js +82 -0
- package/dist/core/auditTrail.js +61 -0
- package/dist/core/auxiliaryClient.js +114 -0
- package/dist/core/bgLLM.js +108 -0
- package/dist/core/bm25.js +68 -0
- package/dist/core/callbackSystem.js +64 -0
- package/dist/core/channels/adapter.js +6 -0
- package/dist/core/channels/discord.js +173 -0
- package/dist/core/channels/email.js +253 -0
- package/dist/core/channels/imessage.js +164 -0
- package/dist/core/channels/manager.js +96 -0
- package/dist/core/channels/signal.js +140 -0
- package/dist/core/channels/slack.js +139 -0
- package/dist/core/channels/twilio.js +144 -0
- package/dist/core/channels/webhook.js +186 -0
- package/dist/core/channels/whatsapp.js +185 -0
- package/dist/core/clarifyBus.js +75 -0
- package/dist/core/codeInterpreter.js +82 -0
- package/dist/core/computerControl.js +439 -0
- package/dist/core/conversationMemory.js +334 -0
- package/dist/core/costTracker.js +221 -0
- package/dist/core/cronManager.js +217 -0
- package/dist/core/deepKB.js +77 -0
- package/dist/core/doctor.js +279 -0
- package/dist/core/dreamEngine.js +334 -0
- package/dist/core/entityGraph.js +169 -0
- package/dist/core/eventBus.js +16 -0
- package/dist/core/evolutionAnalyzer.js +153 -0
- package/dist/core/executionLoop.js +309 -0
- package/dist/core/executor.js +224 -0
- package/dist/core/failureAnalyzer.js +166 -0
- package/dist/core/fastPathExpansion.js +82 -0
- package/dist/core/faultEngine.js +106 -0
- package/dist/core/featureGates.js +70 -0
- package/dist/core/fileIngestion.js +113 -0
- package/dist/core/gateway.js +97 -0
- package/dist/core/goalTracker.js +75 -0
- package/dist/core/growthEngine.js +168 -0
- package/dist/core/hardwareDetector.js +98 -0
- package/dist/core/hooks.js +45 -0
- package/dist/core/httpKeepalive.js +46 -0
- package/dist/core/hybridSearch.js +101 -0
- package/dist/core/importers.js +164 -0
- package/dist/core/instinctSystem.js +223 -0
- package/dist/core/knowledgeBase.js +351 -0
- package/dist/core/learningMemory.js +121 -0
- package/dist/core/lessonsBrowser.js +125 -0
- package/dist/core/licenseManager.js +399 -0
- package/dist/core/logBuffer.js +85 -0
- package/dist/core/machineId.js +87 -0
- package/dist/core/mcpClient.js +442 -0
- package/dist/core/memoryDistiller.js +165 -0
- package/dist/core/memoryExtractor.js +212 -0
- package/dist/core/memoryIds.js +213 -0
- package/dist/core/memoryPreamble.js +113 -0
- package/dist/core/memoryQuery.js +136 -0
- package/dist/core/memoryRecall.js +140 -0
- package/dist/core/memoryStrategy.js +201 -0
- package/dist/core/messageValidator.js +85 -0
- package/dist/core/modelDiscovery.js +108 -0
- package/dist/core/modelRouter.js +118 -0
- package/dist/core/morningBriefing.js +203 -0
- package/dist/core/multiGoalValidator.js +51 -0
- package/dist/core/parallelExecutor.js +43 -0
- package/dist/core/passiveSkillObserver.js +204 -0
- package/dist/core/paths.js +57 -0
- package/dist/core/patternDetector.js +83 -0
- package/dist/core/planResponseRepair.js +64 -0
- package/dist/core/planTool.js +111 -0
- package/dist/core/playwrightBridge.js +356 -0
- package/dist/core/pluginSystem.js +121 -0
- package/dist/core/privateMode.js +85 -0
- package/dist/core/reactLoop.js +156 -0
- package/dist/core/recipeEngine.js +166 -0
- package/dist/core/responseCache.js +128 -0
- package/dist/core/runSandbox.js +132 -0
- package/dist/core/sandboxRunner.js +200 -0
- package/dist/core/scheduler.js +543 -0
- package/dist/core/secretScanner.js +49 -0
- package/dist/core/semanticMemory.js +223 -0
- package/dist/core/sessionMemory.js +259 -0
- package/dist/core/sessionRouter.js +91 -0
- package/dist/core/sessionSearch.js +163 -0
- package/dist/core/setupWizard.js +225 -0
- package/dist/core/skillImporter.js +303 -0
- package/dist/core/skillLibrary.js +144 -0
- package/dist/core/skillLoader.js +471 -0
- package/dist/core/skillTeacher.js +352 -0
- package/dist/core/skillValidator.js +210 -0
- package/dist/core/skillWriter.js +384 -0
- package/dist/core/slashAsTool.js +226 -0
- package/dist/core/spawnManager.js +197 -0
- package/dist/core/statusVerbs.js +43 -0
- package/dist/core/swarmManager.js +109 -0
- package/dist/core/taskQueue.js +119 -0
- package/dist/core/taskRecovery.js +128 -0
- package/dist/core/taskState.js +168 -0
- package/dist/core/telegramBot.js +152 -0
- package/dist/core/todoManager.js +70 -0
- package/dist/core/toolNameRepair.js +71 -0
- package/dist/core/toolRegistry.js +2730 -0
- package/dist/core/tools/calendarTool.js +98 -0
- package/dist/core/tools/companyFilingsTool.js +98 -0
- package/dist/core/tools/gmailTool.js +87 -0
- package/dist/core/tools/marketDataTool.js +135 -0
- package/dist/core/tools/socialResearchTool.js +121 -0
- package/dist/core/truthCheck.js +57 -0
- package/dist/core/updateChecker.js +74 -0
- package/dist/core/userCognitionProfile.js +238 -0
- package/dist/core/userProfile.js +341 -0
- package/dist/core/version.js +5 -0
- package/dist/core/visionAnalyze.js +161 -0
- package/dist/core/voice/audio.js +187 -0
- package/dist/core/voice/stt.js +226 -0
- package/dist/core/voice/tts.js +310 -0
- package/dist/core/voiceInput.js +118 -0
- package/dist/core/voiceOutput.js +130 -0
- package/dist/core/webSearch.js +326 -0
- package/dist/core/workflowTracker.js +72 -0
- package/dist/core/workspaceMemory.js +54 -0
- package/dist/core/youtubeTranscript.js +224 -0
- package/dist/integrations/computerUse/apiRegistry.js +113 -0
- package/dist/integrations/computerUse/screenAgent.js +203 -0
- package/dist/integrations/computerUse/visionLoop.js +296 -0
- package/dist/memory/memoryLayers.js +143 -0
- package/dist/providers/boa.js +93 -0
- package/dist/providers/cerebras.js +70 -0
- package/dist/providers/custom.js +89 -0
- package/dist/providers/gemini.js +82 -0
- package/dist/providers/groq.js +92 -0
- package/dist/providers/index.js +149 -0
- package/dist/providers/nvidia.js +70 -0
- package/dist/providers/ollama.js +99 -0
- package/dist/providers/openrouter.js +74 -0
- package/dist/providers/router.js +497 -0
- package/dist/providers/types.js +6 -0
- package/dist/security/browserVault.js +129 -0
- package/dist/security/dataGuard.js +89 -0
- package/dist/tools/eonetTool.js +72 -0
- package/dist/types/computerUse.js +2 -0
- package/dist/types/executor.js +2 -0
- package/dist-bundle/cli.js +357859 -0
- package/package.json +256 -0
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// ============================================================
|
|
3
|
+
// DevOS — Autonomous AI Execution System
|
|
4
|
+
// Copyright (c) 2026 Shiva Deore. All rights reserved.
|
|
5
|
+
// ============================================================
|
|
6
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
7
|
+
if (k2 === undefined) k2 = k;
|
|
8
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
9
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
10
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
11
|
+
}
|
|
12
|
+
Object.defineProperty(o, k2, desc);
|
|
13
|
+
}) : (function(o, m, k, k2) {
|
|
14
|
+
if (k2 === undefined) k2 = k;
|
|
15
|
+
o[k2] = m[k];
|
|
16
|
+
}));
|
|
17
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
18
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
19
|
+
}) : function(o, v) {
|
|
20
|
+
o["default"] = v;
|
|
21
|
+
});
|
|
22
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
23
|
+
var ownKeys = function(o) {
|
|
24
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
25
|
+
var ar = [];
|
|
26
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
27
|
+
return ar;
|
|
28
|
+
};
|
|
29
|
+
return ownKeys(o);
|
|
30
|
+
};
|
|
31
|
+
return function (mod) {
|
|
32
|
+
if (mod && mod.__esModule) return mod;
|
|
33
|
+
var result = {};
|
|
34
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
35
|
+
__setModuleDefault(result, mod);
|
|
36
|
+
return result;
|
|
37
|
+
};
|
|
38
|
+
})();
|
|
39
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
40
|
+
// bin/npx-init.ts — Entry point for `npx devos` / first-run bootstrap.
|
|
41
|
+
//
|
|
42
|
+
// Sprint 24: Setup wizard runs as FIRST step before coreBoot, so every
|
|
43
|
+
// new user gets hardware detection + model selection on their first run.
|
|
44
|
+
const setupWizard_1 = require("../core/setupWizard");
|
|
45
|
+
async function main() {
|
|
46
|
+
// ── Step 1: First-boot setup (Sprint 24) ──────────────────
|
|
47
|
+
// Runs on every fresh machine; skipped immediately if already complete.
|
|
48
|
+
if (!(0, setupWizard_1.isSetupComplete)()) {
|
|
49
|
+
await (0, setupWizard_1.runSetupWizard)();
|
|
50
|
+
}
|
|
51
|
+
// ── Step 2: Core boot (full DevOS initialisation) ─────────
|
|
52
|
+
// coreBoot() is defined in the full host implementation.
|
|
53
|
+
// Importing dynamically so this file compiles in the sandbox
|
|
54
|
+
// without the full module graph.
|
|
55
|
+
try {
|
|
56
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
57
|
+
// @ts-ignore — coreBoot is only available in the full host implementation
|
|
58
|
+
const { coreBoot } = await Promise.resolve().then(() => __importStar(require('../core/coreBoot')));
|
|
59
|
+
await coreBoot();
|
|
60
|
+
}
|
|
61
|
+
catch (err) {
|
|
62
|
+
// coreBoot not available in sandbox — this is expected
|
|
63
|
+
if (process.env.NODE_ENV !== 'test') {
|
|
64
|
+
console.error(`[npx-init] coreBoot unavailable: ${err?.message}`);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
main().catch(err => {
|
|
69
|
+
console.error('[npx-init] Fatal:', err);
|
|
70
|
+
process.exit(1);
|
|
71
|
+
});
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// ============================================================
|
|
3
|
+
// DevOS — Autonomous AI Execution System
|
|
4
|
+
// Copyright (c) 2026 Shiva Deore. All rights reserved.
|
|
5
|
+
// ============================================================
|
|
6
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
7
|
+
if (k2 === undefined) k2 = k;
|
|
8
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
9
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
10
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
11
|
+
}
|
|
12
|
+
Object.defineProperty(o, k2, desc);
|
|
13
|
+
}) : (function(o, m, k, k2) {
|
|
14
|
+
if (k2 === undefined) k2 = k;
|
|
15
|
+
o[k2] = m[k];
|
|
16
|
+
}));
|
|
17
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
18
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
19
|
+
}) : function(o, v) {
|
|
20
|
+
o["default"] = v;
|
|
21
|
+
});
|
|
22
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
23
|
+
var ownKeys = function(o) {
|
|
24
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
25
|
+
var ar = [];
|
|
26
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
27
|
+
return ar;
|
|
28
|
+
};
|
|
29
|
+
return ownKeys(o);
|
|
30
|
+
};
|
|
31
|
+
return function (mod) {
|
|
32
|
+
if (mod && mod.__esModule) return mod;
|
|
33
|
+
var result = {};
|
|
34
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
35
|
+
__setModuleDefault(result, mod);
|
|
36
|
+
return result;
|
|
37
|
+
};
|
|
38
|
+
})();
|
|
39
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
40
|
+
exports.commandGate = void 0;
|
|
41
|
+
// coordination/commandGate.ts — Approval gate for potentially dangerous operations.
|
|
42
|
+
//
|
|
43
|
+
// Any subsystem that is about to take an irreversible or high-impact action
|
|
44
|
+
// (e.g. computer control, file deletion, external API calls with side effects)
|
|
45
|
+
// must call commandGate.requestApproval() first.
|
|
46
|
+
//
|
|
47
|
+
// In interactive mode (DEVOS_AUTO_APPROVE not set) approval is requested via
|
|
48
|
+
// stdout/stdin prompt. In headless/CI mode (DEVOS_AUTO_APPROVE=true) all
|
|
49
|
+
// requests are approved automatically and logged.
|
|
50
|
+
const readline = __importStar(require("readline"));
|
|
51
|
+
// ── CommandGate ───────────────────────────────────────────────
|
|
52
|
+
class CommandGate {
|
|
53
|
+
constructor() {
|
|
54
|
+
this.log = [];
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Request approval before executing a potentially dangerous operation.
|
|
58
|
+
*
|
|
59
|
+
* - DEVOS_AUTO_APPROVE=true → always approves (CI/headless mode)
|
|
60
|
+
* - DEVOS_HEADLESS=true → always approves with a warning log
|
|
61
|
+
* - Interactive → prompts on stdout/stdin (y/N)
|
|
62
|
+
*
|
|
63
|
+
* @param action Short human-readable description of what will happen.
|
|
64
|
+
* @param reason Context: why this action is being requested.
|
|
65
|
+
* @param taskId Optional task identifier for audit trail.
|
|
66
|
+
*/
|
|
67
|
+
async requestApproval(action, reason, taskId) {
|
|
68
|
+
const request = {
|
|
69
|
+
action,
|
|
70
|
+
reason,
|
|
71
|
+
taskId,
|
|
72
|
+
timestamp: new Date().toISOString(),
|
|
73
|
+
};
|
|
74
|
+
this.log.push(request);
|
|
75
|
+
// Auto-approve in CI / headless environments
|
|
76
|
+
if (process.env.DEVOS_AUTO_APPROVE === 'true' ||
|
|
77
|
+
process.env.DEVOS_HEADLESS === 'true' ||
|
|
78
|
+
process.env.CI === 'true') {
|
|
79
|
+
console.log(`[CommandGate] ✅ Auto-approved: ${action}`);
|
|
80
|
+
return true;
|
|
81
|
+
}
|
|
82
|
+
// Interactive prompt
|
|
83
|
+
return new Promise((resolve) => {
|
|
84
|
+
const rl = readline.createInterface({
|
|
85
|
+
input: process.stdin,
|
|
86
|
+
output: process.stdout,
|
|
87
|
+
});
|
|
88
|
+
console.log('\n┌─────────────────────────────────────────────────┐');
|
|
89
|
+
console.log('│ ⚠️ DevOS CommandGate — Approval Required │');
|
|
90
|
+
console.log('└─────────────────────────────────────────────────┘');
|
|
91
|
+
console.log(` Action : ${action}`);
|
|
92
|
+
console.log(` Reason : ${reason}`);
|
|
93
|
+
if (taskId)
|
|
94
|
+
console.log(` Task : ${taskId}`);
|
|
95
|
+
console.log();
|
|
96
|
+
rl.question(' Approve? [y/N] ', (answer) => {
|
|
97
|
+
rl.close();
|
|
98
|
+
const approved = answer.trim().toLowerCase() === 'y';
|
|
99
|
+
console.log(approved ? ' ✅ Approved\n' : ' ❌ Rejected\n');
|
|
100
|
+
resolve(approved);
|
|
101
|
+
});
|
|
102
|
+
// Timeout: auto-reject after 30 s if no input
|
|
103
|
+
setTimeout(() => {
|
|
104
|
+
rl.close();
|
|
105
|
+
console.log(' ⏱ Timed out — rejected\n');
|
|
106
|
+
resolve(false);
|
|
107
|
+
}, 30000);
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
/** Return the full audit log of all approval requests. */
|
|
111
|
+
getLog() {
|
|
112
|
+
return this.log;
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
exports.commandGate = new CommandGate();
|
|
@@ -0,0 +1,127 @@
|
|
|
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.livePulse = void 0;
|
|
8
|
+
// coordination/livePulse.ts — Real-time agent pulse / activity log.
|
|
9
|
+
// Extends EventEmitter so subscribers (e.g. /api/chat) can stream
|
|
10
|
+
// live execution progress directly to the UI.
|
|
11
|
+
//
|
|
12
|
+
// Every public method fires both a named event AND a universal
|
|
13
|
+
// 'any' event carrying a typed PulseEvent — one subscriber
|
|
14
|
+
// handles everything.
|
|
15
|
+
const events_1 = require("events");
|
|
16
|
+
// ── Implementation ────────────────────────────────────────────
|
|
17
|
+
const HISTORY_MAX = 100;
|
|
18
|
+
class LivePulse extends events_1.EventEmitter {
|
|
19
|
+
constructor() {
|
|
20
|
+
super();
|
|
21
|
+
this.history = [];
|
|
22
|
+
// CRITICAL: register a no-op 'error' listener so Node doesn't throw
|
|
23
|
+
// unhandled 'error' events when livePulse.emit('error', ...) is called.
|
|
24
|
+
this.on('error', () => { });
|
|
25
|
+
}
|
|
26
|
+
// ── Private event dispatcher ──────────────────────────────
|
|
27
|
+
emit_event(event) {
|
|
28
|
+
try {
|
|
29
|
+
this.history.push(event);
|
|
30
|
+
if (this.history.length > HISTORY_MAX)
|
|
31
|
+
this.history.shift();
|
|
32
|
+
// Named event (backwards compat) — skip 'error' type to avoid throwing
|
|
33
|
+
if (event.type !== 'error') {
|
|
34
|
+
this.emit(event.type, event.agent, event.message);
|
|
35
|
+
}
|
|
36
|
+
// Universal subscriber — always fires
|
|
37
|
+
this.emit('any', event);
|
|
38
|
+
}
|
|
39
|
+
catch {
|
|
40
|
+
// Never throw from event dispatch
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
// ── Public methods — all wrapped in try-catch so they NEVER throw ──
|
|
44
|
+
act(agent, message, missionId) {
|
|
45
|
+
try {
|
|
46
|
+
console.log(`[${agent}] ${message}`);
|
|
47
|
+
this.emit_event({ type: 'act', agent, message, timestamp: Date.now(), missionId });
|
|
48
|
+
}
|
|
49
|
+
catch {
|
|
50
|
+
// Silent fail — never throw from pulse methods
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
done(agent, message, missionId) {
|
|
54
|
+
try {
|
|
55
|
+
console.log(`[${agent}] ✓ ${message}`);
|
|
56
|
+
this.emit_event({ type: 'done', agent, message, timestamp: Date.now(), missionId });
|
|
57
|
+
}
|
|
58
|
+
catch {
|
|
59
|
+
// Silent fail — never throw from pulse methods
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
error(agent, message, missionId) {
|
|
63
|
+
try {
|
|
64
|
+
console.error(`[${agent}] ✗ ${message}`);
|
|
65
|
+
this.emit_event({ type: 'error', agent, message, timestamp: Date.now(), missionId });
|
|
66
|
+
}
|
|
67
|
+
catch {
|
|
68
|
+
// Never throw from error handler — log to console only
|
|
69
|
+
console.error(`[LivePulse] emit_event failed for error: ${message}`);
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
warn(agent, message, missionId) {
|
|
73
|
+
try {
|
|
74
|
+
console.warn(`[${agent}] ⚠ ${message}`);
|
|
75
|
+
this.emit_event({ type: 'warn', agent, message, timestamp: Date.now(), missionId });
|
|
76
|
+
}
|
|
77
|
+
catch {
|
|
78
|
+
// Silent fail — never throw from pulse methods
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
info(agent, message, missionId) {
|
|
82
|
+
try {
|
|
83
|
+
console.log(`[${agent}] ℹ ${message}`);
|
|
84
|
+
this.emit_event({ type: 'info', agent, message, timestamp: Date.now(), missionId });
|
|
85
|
+
}
|
|
86
|
+
catch {
|
|
87
|
+
// Silent fail — never throw from pulse methods
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
thinking(agent, message, missionId) {
|
|
91
|
+
try {
|
|
92
|
+
console.log(`[${agent}] 💭 ${message}`);
|
|
93
|
+
this.emit_event({ type: 'thinking', agent, message, timestamp: Date.now(), missionId });
|
|
94
|
+
}
|
|
95
|
+
catch {
|
|
96
|
+
// Silent fail — never throw from pulse methods
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
tool(agent, toolName, command, output) {
|
|
100
|
+
try {
|
|
101
|
+
const message = output
|
|
102
|
+
? `${toolName}: ${command} → ${output.slice(0, 120)}`
|
|
103
|
+
: `${toolName}: ${command}`;
|
|
104
|
+
console.log(`[${agent}] 🔧 ${message}`);
|
|
105
|
+
this.emit_event({
|
|
106
|
+
type: 'tool',
|
|
107
|
+
agent,
|
|
108
|
+
message,
|
|
109
|
+
timestamp: Date.now(),
|
|
110
|
+
tool: toolName,
|
|
111
|
+
command,
|
|
112
|
+
output,
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
catch {
|
|
116
|
+
// Silent fail — never throw from pulse methods
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
// ── History helpers ───────────────────────────────────────
|
|
120
|
+
getHistory() {
|
|
121
|
+
return [...this.history];
|
|
122
|
+
}
|
|
123
|
+
clear() {
|
|
124
|
+
this.history = [];
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
exports.livePulse = new LivePulse();
|