@ouro.bot/cli 0.1.0-alpha.204 → 0.1.0-alpha.205
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/changelog.json +6 -0
- package/dist/heart/agent-entry.js +37 -2
- package/dist/heart/attention-types.js +8 -0
- package/dist/heart/core.js +7 -7
- package/dist/heart/daemon/sense-manager.js +23 -2
- package/dist/repertoire/tools.js +28 -2
- package/dist/senses/surface-tool.js +0 -27
- package/package.json +1 -1
package/changelog.json
CHANGED
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"_note": "This changelog is maintained as part of the PR/version-bump workflow. Agent-curated, not auto-generated. Agents read this file directly via read_file to understand what changed between versions.",
|
|
3
3
|
"versions": [
|
|
4
|
+
{
|
|
5
|
+
"version": "0.1.0-alpha.205",
|
|
6
|
+
"changes": [
|
|
7
|
+
"refactor: enforce subsystem boundaries — eliminate all heart/ and nerves/ static imports from senses/, move AttentionItem type to heart/, surfaceToolDef to repertoire/, SteeringFollowUpEffect to heart/turn-coordinator, inline BlueBubbles runtime state reader in daemon"
|
|
8
|
+
]
|
|
9
|
+
},
|
|
4
10
|
{
|
|
5
11
|
"version": "0.1.0-alpha.204",
|
|
6
12
|
"changes": [
|
|
@@ -1,4 +1,37 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
2
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
36
|
// Unified agent runtime entrypoint.
|
|
4
37
|
// Requires --agent before importing runtime modules that rely on identity.
|
|
@@ -7,10 +40,12 @@ if (!process.argv.includes("--agent")) {
|
|
|
7
40
|
console.error("Missing required --agent <name> argument.\nUsage: node dist/heart/agent-entry.js --agent ouroboros");
|
|
8
41
|
process.exit(1);
|
|
9
42
|
}
|
|
10
|
-
const inner_dialog_worker_1 = require("../senses/inner-dialog-worker");
|
|
11
43
|
const cli_logging_1 = require("../nerves/cli-logging");
|
|
12
44
|
(0, cli_logging_1.configureCliRuntimeLogger)("self");
|
|
13
|
-
|
|
45
|
+
// Dynamic import: agent-entry is boot-time wiring that starts a sense process.
|
|
46
|
+
// Using dynamic import avoids a static heart/ -> senses/ dependency.
|
|
47
|
+
Promise.resolve().then(() => __importStar(require("../senses/inner-dialog-worker"))).then(({ startInnerDialogWorker }) => startInnerDialogWorker())
|
|
48
|
+
.catch((error) => {
|
|
14
49
|
// eslint-disable-next-line no-console -- fatal startup guard for worker process
|
|
15
50
|
console.error(error instanceof Error ? error.message : String(error));
|
|
16
51
|
process.exit(1);
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Shared attention queue types.
|
|
4
|
+
*
|
|
5
|
+
* Canonical home for the AttentionItem interface — consumed by heart/, repertoire/, nerves/, and senses/.
|
|
6
|
+
* Placed in heart/ because attention is a turn-coordination concern.
|
|
7
|
+
*/
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
package/dist/heart/core.js
CHANGED
|
@@ -18,7 +18,7 @@ const config_1 = require("./config");
|
|
|
18
18
|
const identity_1 = require("./identity");
|
|
19
19
|
const tools_1 = require("../repertoire/tools");
|
|
20
20
|
const channel_1 = require("../mind/friends/channel");
|
|
21
|
-
const
|
|
21
|
+
const tools_2 = require("../repertoire/tools");
|
|
22
22
|
const runtime_1 = require("../nerves/runtime");
|
|
23
23
|
const context_1 = require("../mind/context");
|
|
24
24
|
const prompt_1 = require("../mind/prompt");
|
|
@@ -148,11 +148,11 @@ function getProviderDisplayLabel(facing = "human") {
|
|
|
148
148
|
return providerLabelBuilders[provider]();
|
|
149
149
|
}
|
|
150
150
|
// Re-export tools, execTool, summarizeArgs from ./tools for backward compat
|
|
151
|
-
var
|
|
152
|
-
Object.defineProperty(exports, "tools", { enumerable: true, get: function () { return
|
|
153
|
-
Object.defineProperty(exports, "execTool", { enumerable: true, get: function () { return
|
|
154
|
-
Object.defineProperty(exports, "summarizeArgs", { enumerable: true, get: function () { return
|
|
155
|
-
Object.defineProperty(exports, "getToolsForChannel", { enumerable: true, get: function () { return
|
|
151
|
+
var tools_3 = require("../repertoire/tools");
|
|
152
|
+
Object.defineProperty(exports, "tools", { enumerable: true, get: function () { return tools_3.tools; } });
|
|
153
|
+
Object.defineProperty(exports, "execTool", { enumerable: true, get: function () { return tools_3.execTool; } });
|
|
154
|
+
Object.defineProperty(exports, "summarizeArgs", { enumerable: true, get: function () { return tools_3.summarizeArgs; } });
|
|
155
|
+
Object.defineProperty(exports, "getToolsForChannel", { enumerable: true, get: function () { return tools_3.getToolsForChannel; } });
|
|
156
156
|
// Re-export streaming functions for backward compat
|
|
157
157
|
var streaming_1 = require("./streaming");
|
|
158
158
|
Object.defineProperty(exports, "streamChatCompletion", { enumerable: true, get: function () { return streaming_1.streamChatCompletion; } });
|
|
@@ -530,7 +530,7 @@ async function runAgent(messages, callbacks, channel, signal, options) {
|
|
|
530
530
|
const activeTools = [
|
|
531
531
|
...filteredBaseTools,
|
|
532
532
|
tools_1.ponderTool,
|
|
533
|
-
...(isInnerDialog ? [
|
|
533
|
+
...(isInnerDialog ? [tools_2.surfaceToolDef, tools_1.restTool] : []),
|
|
534
534
|
...((currentContext?.isGroupChat || options?.isReactionSignal) && !isInnerDialog ? [tools_1.observeTool] : []),
|
|
535
535
|
...(!isInnerDialog ? [tools_1.settleTool] : []),
|
|
536
536
|
];
|
|
@@ -38,7 +38,6 @@ const fs = __importStar(require("fs"));
|
|
|
38
38
|
const os = __importStar(require("os"));
|
|
39
39
|
const path = __importStar(require("path"));
|
|
40
40
|
const runtime_1 = require("../../nerves/runtime");
|
|
41
|
-
const bluebubbles_runtime_state_1 = require("../../senses/bluebubbles-runtime-state");
|
|
42
41
|
const identity_1 = require("../identity");
|
|
43
42
|
const sense_truth_1 = require("../sense-truth");
|
|
44
43
|
const process_manager_1 = require("./process-manager");
|
|
@@ -187,13 +186,35 @@ function blueBubblesRuntimeStateIsFresh(lastCheckedAt, now = Date.now()) {
|
|
|
187
186
|
}
|
|
188
187
|
return checkedAt >= now - BLUEBUBBLES_RUNTIME_FRESHNESS_WINDOW_MS;
|
|
189
188
|
}
|
|
189
|
+
function readBlueBubblesRuntimeJson(runtimePath) {
|
|
190
|
+
try {
|
|
191
|
+
const raw = fs.readFileSync(runtimePath, "utf-8");
|
|
192
|
+
const parsed = JSON.parse(raw);
|
|
193
|
+
/* v8 ignore start -- branches: ternary fallbacks for missing/malformed BB runtime fields @preserve */
|
|
194
|
+
return {
|
|
195
|
+
upstreamStatus: parsed.upstreamStatus === "ok" || parsed.upstreamStatus === "error"
|
|
196
|
+
? parsed.upstreamStatus
|
|
197
|
+
: "unknown",
|
|
198
|
+
detail: typeof parsed.detail === "string" && parsed.detail.trim()
|
|
199
|
+
? parsed.detail
|
|
200
|
+
: "startup health probe pending",
|
|
201
|
+
lastCheckedAt: typeof parsed.lastCheckedAt === "string" ? parsed.lastCheckedAt : undefined,
|
|
202
|
+
};
|
|
203
|
+
/* v8 ignore stop */
|
|
204
|
+
/* v8 ignore start -- defensive: catch for missing/corrupt BB runtime state file @preserve */
|
|
205
|
+
}
|
|
206
|
+
catch {
|
|
207
|
+
return { upstreamStatus: "unknown", detail: "startup health probe pending" };
|
|
208
|
+
}
|
|
209
|
+
/* v8 ignore stop */
|
|
210
|
+
}
|
|
190
211
|
function readBlueBubblesRuntimeFacts(agent, bundlesRoot, snapshot) {
|
|
191
212
|
const agentRoot = path.join(bundlesRoot, `${agent}.ouro`);
|
|
192
213
|
const runtimePath = path.join(agentRoot, "state", "senses", "bluebubbles", "runtime.json");
|
|
193
214
|
if (!fs.existsSync(runtimePath)) {
|
|
194
215
|
return { runtime: snapshot?.runtime };
|
|
195
216
|
}
|
|
196
|
-
const state = (
|
|
217
|
+
const state = readBlueBubblesRuntimeJson(runtimePath);
|
|
197
218
|
if (!blueBubblesRuntimeStateIsFresh(state.lastCheckedAt)) {
|
|
198
219
|
return { runtime: snapshot?.runtime };
|
|
199
220
|
}
|
package/dist/repertoire/tools.js
CHANGED
|
@@ -33,7 +33,7 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
33
33
|
};
|
|
34
34
|
})();
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
-
exports.restTool = exports.ponderTool = exports.observeTool = exports.settleTool = exports.tools = void 0;
|
|
36
|
+
exports.surfaceToolDef = exports.restTool = exports.ponderTool = exports.observeTool = exports.settleTool = exports.tools = void 0;
|
|
37
37
|
exports.getToolsForChannel = getToolsForChannel;
|
|
38
38
|
exports.isConfirmationRequired = isConfirmationRequired;
|
|
39
39
|
exports.execTool = execTool;
|
|
@@ -66,10 +66,36 @@ Object.defineProperty(exports, "settleTool", { enumerable: true, get: function (
|
|
|
66
66
|
Object.defineProperty(exports, "observeTool", { enumerable: true, get: function () { return tools_base_2.observeTool; } });
|
|
67
67
|
Object.defineProperty(exports, "ponderTool", { enumerable: true, get: function () { return tools_base_2.ponderTool; } });
|
|
68
68
|
Object.defineProperty(exports, "restTool", { enumerable: true, get: function () { return tools_base_2.restTool; } });
|
|
69
|
+
// Surface tool schema — canonical home. Handler lives in senses/surface-tool.ts.
|
|
70
|
+
exports.surfaceToolDef = {
|
|
71
|
+
type: "function",
|
|
72
|
+
function: {
|
|
73
|
+
name: "surface",
|
|
74
|
+
description: "share a thought outward — deliver an answer, ask a follow-up, or surface progress to whoever needs to hear it. pass delegationId to address a held thought (see your attention queue above), or friendId for spontaneous outreach. does not end your turn.",
|
|
75
|
+
parameters: {
|
|
76
|
+
type: "object",
|
|
77
|
+
properties: {
|
|
78
|
+
content: {
|
|
79
|
+
type: "string",
|
|
80
|
+
description: "the message to deliver",
|
|
81
|
+
},
|
|
82
|
+
delegationId: {
|
|
83
|
+
type: "string",
|
|
84
|
+
description: "ID from your attention queue — addresses a specific held thought",
|
|
85
|
+
},
|
|
86
|
+
friendId: {
|
|
87
|
+
type: "string",
|
|
88
|
+
description: "friend to reach out to spontaneously (when not addressing a held thought)",
|
|
89
|
+
},
|
|
90
|
+
},
|
|
91
|
+
required: ["content"],
|
|
92
|
+
},
|
|
93
|
+
},
|
|
94
|
+
};
|
|
69
95
|
// Surface tool handler: routes content to friend's freshest session
|
|
70
96
|
/* v8 ignore start -- surface handler wiring: core logic tested via surface-tool.test.ts; this wires identity/routing deps @preserve */
|
|
71
97
|
const surfaceToolDefinition = {
|
|
72
|
-
tool:
|
|
98
|
+
tool: exports.surfaceToolDef,
|
|
73
99
|
handler: async (args, ctx) => {
|
|
74
100
|
const queue = ctx?.delegatedOrigins ?? [];
|
|
75
101
|
const agentName = (() => { try {
|
|
@@ -1,35 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.surfaceToolDef = void 0;
|
|
4
3
|
exports.handleSurface = handleSurface;
|
|
5
4
|
const attention_queue_1 = require("./attention-queue");
|
|
6
5
|
const runtime_1 = require("../nerves/runtime");
|
|
7
|
-
// ── Tool definition ──────────────────────────────────────────────
|
|
8
|
-
exports.surfaceToolDef = {
|
|
9
|
-
type: "function",
|
|
10
|
-
function: {
|
|
11
|
-
name: "surface",
|
|
12
|
-
description: "share a thought outward — deliver an answer, ask a follow-up, or surface progress to whoever needs to hear it. pass delegationId to address a held thought (see your attention queue above), or friendId for spontaneous outreach. does not end your turn.",
|
|
13
|
-
parameters: {
|
|
14
|
-
type: "object",
|
|
15
|
-
properties: {
|
|
16
|
-
content: {
|
|
17
|
-
type: "string",
|
|
18
|
-
description: "the message to deliver",
|
|
19
|
-
},
|
|
20
|
-
delegationId: {
|
|
21
|
-
type: "string",
|
|
22
|
-
description: "ID from your attention queue — addresses a specific held thought",
|
|
23
|
-
},
|
|
24
|
-
friendId: {
|
|
25
|
-
type: "string",
|
|
26
|
-
description: "friend to reach out to spontaneously (when not addressing a held thought)",
|
|
27
|
-
},
|
|
28
|
-
},
|
|
29
|
-
required: ["content"],
|
|
30
|
-
},
|
|
31
|
-
},
|
|
32
|
-
};
|
|
33
6
|
async function handleSurface(input) {
|
|
34
7
|
const { content, delegationId, friendId, queue, routeToFriend, advanceObligation, fulfillHeartObligation } = input;
|
|
35
8
|
// Resolve target friend
|