@ouro.bot/cli 0.1.0-alpha.1464 → 0.1.0-alpha.1465
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/README.md +2 -2
- package/changelog.json +8 -0
- package/deploy/unraid/sanctuary.ouro/bundle-meta.json +1 -1
- package/deploy/unraid/sanctuary.xml +1 -1
- package/dist/heart/daemon/cli-commands/mail.js +0 -1
- package/dist/heart/daemon/cli-exec.js +0 -33
- package/dist/heart/daemon/cli-help.js +0 -13
- package/dist/heart/daemon/cli-parse.js +0 -3
- package/dist/heart/daemon/cli-render.js +0 -7
- package/dist/heart/daemon/daemon-entry.js +1 -1
- package/dist/heart/daemon/daemon.js +0 -63
- package/dist/heart/{mailbox/mailbox-supervision.js → shepherd/supervision-read.js} +4 -4
- package/dist/nerves/coverage/file-completeness.js +0 -11
- package/dist/nerves/observation.js +2 -4
- package/dist/repertoire/tools-mail.js +2 -2
- package/dist/senses/cli/ouro-tui.js +2 -2
- package/dist/senses/shepherd/operations.js +2 -2
- package/npm-shrinkwrap.json +2 -2
- package/package.json +2 -4
- package/skills/sense-setup.md +1 -1
- package/dist/heart/mailbox/mailbox-http-hooks.js +0 -99
- package/dist/heart/mailbox/mailbox-http-response.js +0 -7
- package/dist/heart/mailbox/mailbox-http-routes.js +0 -406
- package/dist/heart/mailbox/mailbox-http-static.js +0 -103
- package/dist/heart/mailbox/mailbox-http-transport.js +0 -272
- package/dist/heart/mailbox/mailbox-http.js +0 -99
- package/dist/heart/mailbox/mailbox-read.js +0 -41
- package/dist/heart/mailbox/mailbox-types.js +0 -27
- package/dist/heart/mailbox/mailbox-view.js +0 -197
- package/dist/heart/mailbox/readers/agent-machine.js +0 -428
- package/dist/heart/mailbox/readers/continuity-readers.js +0 -329
- package/dist/heart/mailbox/readers/mail.js +0 -375
- package/dist/heart/mailbox/readers/runtime-readers.js +0 -823
- package/dist/heart/mailbox/readers/sessions.js +0 -231
- package/dist/heart/mailbox/readers/shared.js +0 -111
- package/dist/mailbox-ui/assets/geist-cyrillic-ext-wght-normal-DjL33-gN.woff2 +0 -0
- package/dist/mailbox-ui/assets/geist-cyrillic-wght-normal-BEAKL7Jp.woff2 +0 -0
- package/dist/mailbox-ui/assets/geist-latin-ext-wght-normal-DC-KSUi6.woff2 +0 -0
- package/dist/mailbox-ui/assets/geist-latin-wght-normal-BgDaEnEv.woff2 +0 -0
- package/dist/mailbox-ui/assets/geist-vietnamese-wght-normal-6IgcOCM7.woff2 +0 -0
- package/dist/mailbox-ui/assets/index-BQYBPyiH.js +0 -5
- package/dist/mailbox-ui/assets/index-UZ85Lvxp.css +0 -1
- package/dist/mailbox-ui/assets/vendor-BfcLUM_P.js +0 -65
- package/dist/mailbox-ui/index.html +0 -18
|
@@ -1,329 +0,0 @@
|
|
|
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
|
-
})();
|
|
35
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
-
exports.readMailboxContinuity = readMailboxContinuity;
|
|
37
|
-
exports.readOrientationView = readOrientationView;
|
|
38
|
-
exports.readObligationDetailView = readObligationDetailView;
|
|
39
|
-
exports.readChangesView = readChangesView;
|
|
40
|
-
exports.readSelfFixView = readSelfFixView;
|
|
41
|
-
exports.readContextLossGauntletView = readContextLossGauntletView;
|
|
42
|
-
exports.readSentinelView = readSentinelView;
|
|
43
|
-
exports.readNoteDecisionView = readNoteDecisionView;
|
|
44
|
-
const fs = __importStar(require("fs"));
|
|
45
|
-
const path = __importStar(require("path"));
|
|
46
|
-
const runtime_1 = require("../../../nerves/runtime");
|
|
47
|
-
const cares_1 = require("../../../arc/cares");
|
|
48
|
-
const episodes_1 = require("../../../arc/episodes");
|
|
49
|
-
const obligations_1 = require("../../../arc/obligations");
|
|
50
|
-
const presence_1 = require("../../../arc/presence");
|
|
51
|
-
const active_work_1 = require("../../active-work");
|
|
52
|
-
const session_activity_1 = require("../../session-activity");
|
|
53
|
-
const context_loss_gauntlet_1 = require("../../context-loss-gauntlet");
|
|
54
|
-
const context_loss_sentinel_1 = require("../../context-loss-sentinel");
|
|
55
|
-
const agent_machine_1 = require("./agent-machine");
|
|
56
|
-
function sortOpenObligations(obligations) {
|
|
57
|
-
const statusPriority = {
|
|
58
|
-
returning: 0,
|
|
59
|
-
collaborating: 1,
|
|
60
|
-
in_progress: 2,
|
|
61
|
-
delegated: 3,
|
|
62
|
-
accepted: 4,
|
|
63
|
-
pending: 5,
|
|
64
|
-
};
|
|
65
|
-
return obligations
|
|
66
|
-
.map((obligation) => ({
|
|
67
|
-
obligation,
|
|
68
|
-
priority: statusPriority[obligation.status] ?? 99,
|
|
69
|
-
updatedMs: new Date(obligation.updatedAt ?? obligation.createdAt).getTime(),
|
|
70
|
-
}))
|
|
71
|
-
.sort((a, b) => {
|
|
72
|
-
if (a.priority !== b.priority)
|
|
73
|
-
return a.priority - b.priority;
|
|
74
|
-
return b.updatedMs - a.updatedMs;
|
|
75
|
-
})
|
|
76
|
-
.map((entry) => entry.obligation);
|
|
77
|
-
}
|
|
78
|
-
function readMailboxContinuity(agentRoot, agentName) {
|
|
79
|
-
const self = (0, presence_1.readPresence)(agentRoot, agentName);
|
|
80
|
-
const peers = (0, presence_1.readPeerPresence)(agentRoot);
|
|
81
|
-
const cares = (0, cares_1.readActiveCares)(agentRoot);
|
|
82
|
-
const episodes = (0, episodes_1.readRecentEpisodes)(agentRoot, { limit: 10 });
|
|
83
|
-
(0, runtime_1.emitNervesEvent)({
|
|
84
|
-
component: "heart",
|
|
85
|
-
event: "heart.mailbox_continuity_read",
|
|
86
|
-
message: `mailbox continuity: ${cares.length} cares, ${episodes.length} episodes`,
|
|
87
|
-
meta: { careCount: cares.length, episodeCount: episodes.length, hasSelf: self != null, peerCount: peers.length },
|
|
88
|
-
});
|
|
89
|
-
return {
|
|
90
|
-
presence: { self, peers },
|
|
91
|
-
cares: {
|
|
92
|
-
activeCount: cares.length,
|
|
93
|
-
items: cares.map((c) => ({
|
|
94
|
-
id: c.id,
|
|
95
|
-
label: c.label,
|
|
96
|
-
status: c.status,
|
|
97
|
-
salience: c.salience,
|
|
98
|
-
})),
|
|
99
|
-
},
|
|
100
|
-
episodes: {
|
|
101
|
-
recentCount: episodes.length,
|
|
102
|
-
items: episodes.map((ep) => ({
|
|
103
|
-
id: ep.id,
|
|
104
|
-
kind: ep.kind,
|
|
105
|
-
summary: ep.summary,
|
|
106
|
-
timestamp: ep.timestamp,
|
|
107
|
-
})),
|
|
108
|
-
},
|
|
109
|
-
};
|
|
110
|
-
}
|
|
111
|
-
function readOrientationView(agentRoot, agentName) {
|
|
112
|
-
let obligations = [];
|
|
113
|
-
try {
|
|
114
|
-
obligations = (0, obligations_1.readObligations)(agentRoot);
|
|
115
|
-
}
|
|
116
|
-
catch {
|
|
117
|
-
obligations = [];
|
|
118
|
-
}
|
|
119
|
-
const openObligations = obligations.filter(obligations_1.isOpenObligation);
|
|
120
|
-
const sorted = sortOpenObligations(openObligations);
|
|
121
|
-
const primary = sorted[0] ?? null;
|
|
122
|
-
let sessions = [];
|
|
123
|
-
try {
|
|
124
|
-
sessions = (0, session_activity_1.listSessionActivity)({
|
|
125
|
-
sessionsDir: path.join(agentRoot, "state", "sessions"),
|
|
126
|
-
friendsDir: path.join(agentRoot, "friends"),
|
|
127
|
-
agentName,
|
|
128
|
-
});
|
|
129
|
-
}
|
|
130
|
-
catch {
|
|
131
|
-
sessions = [];
|
|
132
|
-
}
|
|
133
|
-
const sortedSessions = [...sessions].sort((a, b) => b.lastActivityMs - a.lastActivityMs);
|
|
134
|
-
const currentSession = sortedSessions.length > 0
|
|
135
|
-
? {
|
|
136
|
-
friendId: sortedSessions[0].friendId,
|
|
137
|
-
channel: sortedSessions[0].channel,
|
|
138
|
-
key: sortedSessions[0].key,
|
|
139
|
-
lastActivityAt: sortedSessions[0].lastActivityAt,
|
|
140
|
-
}
|
|
141
|
-
: null;
|
|
142
|
-
const otherActiveSessions = sortedSessions.slice(1).map((s) => ({
|
|
143
|
-
friendId: s.friendId,
|
|
144
|
-
friendName: s.friendName,
|
|
145
|
-
channel: s.channel,
|
|
146
|
-
key: s.key,
|
|
147
|
-
lastActivityAt: s.lastActivityAt,
|
|
148
|
-
}));
|
|
149
|
-
const parts = [];
|
|
150
|
-
if (primary)
|
|
151
|
-
parts.push(primary.content);
|
|
152
|
-
if (openObligations.length > 1)
|
|
153
|
-
parts.push(`${openObligations.length} open obligations`);
|
|
154
|
-
if (sessions.length > 0)
|
|
155
|
-
parts.push(`${sessions.length} active sessions`);
|
|
156
|
-
const centerOfGravity = parts.length > 0 ? parts.join(" | ") : "idle";
|
|
157
|
-
const primaryObligation = primary
|
|
158
|
-
? {
|
|
159
|
-
id: primary.id,
|
|
160
|
-
content: primary.content,
|
|
161
|
-
status: primary.status,
|
|
162
|
-
nextAction: primary.nextAction ?? null,
|
|
163
|
-
waitingOn: primary.meaning?.waitingOn?.detail ?? null,
|
|
164
|
-
}
|
|
165
|
-
: null;
|
|
166
|
-
(0, runtime_1.emitNervesEvent)({
|
|
167
|
-
component: "heart",
|
|
168
|
-
event: "heart.mailbox_orientation_read",
|
|
169
|
-
message: `mailbox orientation: ${openObligations.length} obligations, ${sessions.length} sessions`,
|
|
170
|
-
meta: { obligationCount: openObligations.length, sessionCount: sessions.length, primaryId: primary?.id ?? null },
|
|
171
|
-
});
|
|
172
|
-
return {
|
|
173
|
-
currentSession,
|
|
174
|
-
centerOfGravity,
|
|
175
|
-
primaryObligation,
|
|
176
|
-
resumeHandle: null,
|
|
177
|
-
otherActiveSessions,
|
|
178
|
-
rawState: null,
|
|
179
|
-
};
|
|
180
|
-
}
|
|
181
|
-
function readObligationDetailView(agentRoot) {
|
|
182
|
-
let obligations = [];
|
|
183
|
-
try {
|
|
184
|
-
obligations = (0, obligations_1.readObligations)(agentRoot);
|
|
185
|
-
}
|
|
186
|
-
catch {
|
|
187
|
-
obligations = [];
|
|
188
|
-
}
|
|
189
|
-
const openObligations = obligations.filter(obligations_1.isOpenObligation);
|
|
190
|
-
const sorted = sortOpenObligations(openObligations);
|
|
191
|
-
const primary = sorted[0] ?? null;
|
|
192
|
-
const normalizedSummary = new Map((0, agent_machine_1.readObligationSummary)(agentRoot).items.map((item) => [item.id, item.currentSurface]));
|
|
193
|
-
const items = openObligations.map((ob) => ({
|
|
194
|
-
id: ob.id,
|
|
195
|
-
status: ob.status,
|
|
196
|
-
content: ob.content,
|
|
197
|
-
updatedAt: ob.updatedAt ?? ob.createdAt,
|
|
198
|
-
nextAction: ob.nextAction ?? null,
|
|
199
|
-
origin: ob.origin ?? null,
|
|
200
|
-
currentSurface: normalizedSummary.has(ob.id)
|
|
201
|
-
? (normalizedSummary.get(ob.id) ?? null)
|
|
202
|
-
: (ob.currentSurface ? { kind: ob.currentSurface.kind, label: ob.currentSurface.label } : null),
|
|
203
|
-
meaning: ob.meaning ? { waitingOn: ob.meaning.waitingOn?.detail ?? null } : null,
|
|
204
|
-
isPrimary: ob.id === primary.id,
|
|
205
|
-
}));
|
|
206
|
-
let primarySelectionReason = null;
|
|
207
|
-
if (primary) {
|
|
208
|
-
if (primary.status !== "pending") {
|
|
209
|
-
primarySelectionReason = `most advanced status: ${primary.status}`;
|
|
210
|
-
}
|
|
211
|
-
else {
|
|
212
|
-
primarySelectionReason = "most recent pending";
|
|
213
|
-
}
|
|
214
|
-
}
|
|
215
|
-
(0, runtime_1.emitNervesEvent)({
|
|
216
|
-
component: "heart",
|
|
217
|
-
event: "heart.mailbox_obligations_read",
|
|
218
|
-
message: `mailbox obligations: ${openObligations.length} open`,
|
|
219
|
-
meta: { openCount: openObligations.length, primaryId: primary?.id ?? null },
|
|
220
|
-
});
|
|
221
|
-
return {
|
|
222
|
-
openCount: openObligations.length,
|
|
223
|
-
primaryId: primary?.id ?? null,
|
|
224
|
-
primarySelectionReason,
|
|
225
|
-
items,
|
|
226
|
-
};
|
|
227
|
-
}
|
|
228
|
-
function readChangesView(agentRoot) {
|
|
229
|
-
const snapshotPath = path.join(agentRoot, "state", "mailbox", "active-work-snapshot.json");
|
|
230
|
-
const legacySnapshotPath = path.join(agentRoot, "state", "outlook", "active-work-snapshot.json");
|
|
231
|
-
let previous = null;
|
|
232
|
-
try {
|
|
233
|
-
const raw = fs.readFileSync(fs.existsSync(snapshotPath) ? snapshotPath : legacySnapshotPath, "utf-8");
|
|
234
|
-
previous = JSON.parse(raw);
|
|
235
|
-
if (!previous.obligationSnapshots || !previous.codingSnapshots)
|
|
236
|
-
previous = null;
|
|
237
|
-
}
|
|
238
|
-
catch {
|
|
239
|
-
previous = null;
|
|
240
|
-
}
|
|
241
|
-
let obligations = [];
|
|
242
|
-
try {
|
|
243
|
-
obligations = (0, obligations_1.readObligations)(agentRoot);
|
|
244
|
-
}
|
|
245
|
-
catch {
|
|
246
|
-
obligations = [];
|
|
247
|
-
}
|
|
248
|
-
const openObligations = obligations.filter(obligations_1.isOpenObligation);
|
|
249
|
-
const current = {
|
|
250
|
-
obligationSnapshots: openObligations.map((ob) => ({
|
|
251
|
-
id: ob.id,
|
|
252
|
-
status: ob.status,
|
|
253
|
-
artifact: ob.currentArtifact?.trim() || null,
|
|
254
|
-
nextAction: ob.nextAction?.trim() || null,
|
|
255
|
-
})),
|
|
256
|
-
codingSnapshots: [],
|
|
257
|
-
timestamp: new Date().toISOString(),
|
|
258
|
-
};
|
|
259
|
-
try {
|
|
260
|
-
fs.mkdirSync(path.dirname(snapshotPath), { recursive: true });
|
|
261
|
-
fs.writeFileSync(snapshotPath, JSON.stringify(current, null, 2) + "\n", "utf-8");
|
|
262
|
-
}
|
|
263
|
-
catch {
|
|
264
|
-
// Best effort
|
|
265
|
-
}
|
|
266
|
-
if (!previous) {
|
|
267
|
-
return { changeCount: 0, items: [], snapshotAge: null, formatted: "" };
|
|
268
|
-
}
|
|
269
|
-
const changes = (0, active_work_1.detectActiveWorkChanges)(previous, current);
|
|
270
|
-
const formatted = (0, active_work_1.formatActiveWorkChanges)(changes);
|
|
271
|
-
(0, runtime_1.emitNervesEvent)({
|
|
272
|
-
component: "heart",
|
|
273
|
-
event: "heart.mailbox_changes_read",
|
|
274
|
-
message: `mailbox changes: ${changes.length} detected`,
|
|
275
|
-
meta: { changeCount: changes.length, snapshotAge: previous.timestamp },
|
|
276
|
-
});
|
|
277
|
-
return {
|
|
278
|
-
changeCount: changes.length,
|
|
279
|
-
items: changes.map((c) => ({ kind: c.kind, id: c.id, from: c.from, to: c.to, summary: c.summary })),
|
|
280
|
-
snapshotAge: previous.timestamp,
|
|
281
|
-
formatted,
|
|
282
|
-
};
|
|
283
|
-
}
|
|
284
|
-
function readSelfFixView(_agentRoot) {
|
|
285
|
-
// W6 Unit 8a: self-fix view used to scan `tasks/` for fix-named tasks.
|
|
286
|
-
// The built-in task module is being retired; the desk MCP server owns
|
|
287
|
-
// task state now. The self-fix surface will be re-derived from desk in a
|
|
288
|
-
// follow-up unit. Return inactive until that wiring lands.
|
|
289
|
-
(0, runtime_1.emitNervesEvent)({
|
|
290
|
-
component: "heart",
|
|
291
|
-
event: "heart.mailbox_selffix_read",
|
|
292
|
-
message: "mailbox self-fix: inactive (desk wiring pending)",
|
|
293
|
-
meta: { taskCount: 0, active: false },
|
|
294
|
-
});
|
|
295
|
-
return { active: false, currentStep: null, steps: [] };
|
|
296
|
-
}
|
|
297
|
-
function readContextLossGauntletView(agentRoot, agentName) {
|
|
298
|
-
return (0, context_loss_gauntlet_1.runContextLossGauntlet)(agentName, agentRoot);
|
|
299
|
-
}
|
|
300
|
-
function readSentinelView(agentRoot) {
|
|
301
|
-
return (0, context_loss_sentinel_1.readContextLossSentinelView)(agentRoot, { limit: 20 });
|
|
302
|
-
}
|
|
303
|
-
function readNoteDecisionView(agentRoot, limit = 50) {
|
|
304
|
-
const logPath = path.join(agentRoot, "state", "mailbox", "note-decisions.jsonl");
|
|
305
|
-
const legacyLogPath = path.join(agentRoot, "state", "outlook", "note-decisions.jsonl");
|
|
306
|
-
let lines = [];
|
|
307
|
-
try {
|
|
308
|
-
const raw = fs.readFileSync(fs.existsSync(logPath) ? logPath : legacyLogPath, "utf-8");
|
|
309
|
-
lines = raw.split("\n").filter((l) => l.trim().length > 0);
|
|
310
|
-
}
|
|
311
|
-
catch {
|
|
312
|
-
return { totalCount: 0, items: [] };
|
|
313
|
-
}
|
|
314
|
-
const items = [];
|
|
315
|
-
for (const line of lines) {
|
|
316
|
-
try {
|
|
317
|
-
const parsed = JSON.parse(line);
|
|
318
|
-
if (parsed.kind && parsed.decision && parsed.timestamp) {
|
|
319
|
-
items.push(parsed);
|
|
320
|
-
}
|
|
321
|
-
}
|
|
322
|
-
catch {
|
|
323
|
-
// Skip malformed lines
|
|
324
|
-
}
|
|
325
|
-
}
|
|
326
|
-
items.reverse();
|
|
327
|
-
const limited = items.slice(0, limit);
|
|
328
|
-
return { totalCount: items.length, items: limited };
|
|
329
|
-
}
|