@ouro.bot/cli 0.1.0-alpha.1510 → 0.1.0-alpha.1511
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 +10 -0
- package/deploy/unraid/sanctuary.ouro/bundle-meta.json +1 -1
- package/deploy/unraid/sanctuary.xml +1 -1
- package/dist/heart/daemon/app-sessions-record.js +69 -0
- package/dist/heart/daemon/daemon-entry.js +2 -11
- package/dist/heart/daemon/presence-roster.js +1 -1
- package/dist/heart/session-events.js +10 -3
- package/dist/mind/where-am-i.js +12 -1
- package/dist/senses/teams.js +3 -0
- package/npm-shrinkwrap.json +2 -2
- package/package.json +1 -1
package/changelog.json
CHANGED
|
@@ -1,6 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"_note": "Each pull request writes its own change note under changes/; the release job on main gives each landed change its version and adds the notes here (scripts/release-version.cjs). On main this file stops at the last version set by hand; the published package has every release. Agents read this file directly via read_file to understand what changed between versions.",
|
|
3
3
|
"versions": [
|
|
4
|
+
{
|
|
5
|
+
"version": "0.1.0-alpha.1511",
|
|
6
|
+
"changes": [
|
|
7
|
+
"A pending Teams message that is sent again (a file that reappears) is now recorded in the conversation once, so the same old proactive message no longer piles up in the agent's context.",
|
|
8
|
+
"The STALE marker on a peer's presence now names where that data comes from (the bundle's presence record, delivered only by git sync) and which commands to check.",
|
|
9
|
+
"\"where i am\" now lists the Copilot app sessions each peer machine published, so what runs on the other machine is visible from the bundle alone.",
|
|
10
|
+
"Proactive notices older than 6 hours stay in the conversation history but are no longer replayed to the model.",
|
|
11
|
+
"Each machine's published app sessions now carry their desk card (track, slug, status), shown by \"where i am\"."
|
|
12
|
+
]
|
|
13
|
+
},
|
|
4
14
|
{
|
|
5
15
|
"version": "0.1.0-alpha.1510",
|
|
6
16
|
"changes": [
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<?xml version="1.0"?>
|
|
2
2
|
<Container version="2">
|
|
3
3
|
<Name>ouro-butler</Name>
|
|
4
|
-
<Repository>ghcr.io/ourostack/ouroboros-butler:0.1.0-alpha.
|
|
4
|
+
<Repository>ghcr.io/ourostack/ouroboros-butler:0.1.0-alpha.1511</Repository>
|
|
5
5
|
<Registry>https://github.com/ourostack/ouroboros/pkgs/container/ouroboros-butler</Registry>
|
|
6
6
|
<Network>host</Network>
|
|
7
7
|
<Shell>sh</Shell>
|
|
@@ -0,0 +1,69 @@
|
|
|
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.appSessionsRecord = appSessionsRecord;
|
|
37
|
+
const fs = __importStar(require("node:fs"));
|
|
38
|
+
const runtime_1 = require("../../nerves/runtime");
|
|
39
|
+
const store_1 = require("../../senses/app-sessions/store");
|
|
40
|
+
const path = __importStar(require("node:path"));
|
|
41
|
+
const SNAPSHOT_MAX_AGE_MS = 10 * 60_000;
|
|
42
|
+
const DIGEST_MAX_AGE_MS = 60 * 60_000;
|
|
43
|
+
function readJson(file) {
|
|
44
|
+
try {
|
|
45
|
+
return JSON.parse(fs.readFileSync(file, "utf-8"));
|
|
46
|
+
}
|
|
47
|
+
catch {
|
|
48
|
+
return null;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* This machine's Copilot app sessions for its peer record, from the app-sessions sense's last snapshot. Each session
|
|
53
|
+
* the digest tied to a desk card carries that card's track, slug and status, so a peer sees what work runs here and
|
|
54
|
+
* where its source of truth lives (the desk), without reaching this machine. Stale snapshots publish nothing.
|
|
55
|
+
*/
|
|
56
|
+
function appSessionsRecord(agentRoot, nowMs) {
|
|
57
|
+
const snap = readJson(path.join((0, store_1.appSessionsStateDir)(agentRoot), "snapshot.json"));
|
|
58
|
+
if (!snap?.at || !snap.counts || nowMs - Date.parse(snap.at) > SNAPSHOT_MAX_AGE_MS)
|
|
59
|
+
return {};
|
|
60
|
+
const digest = readJson(path.join((0, store_1.appSessionsStateDir)(agentRoot), "digest.json"));
|
|
61
|
+
const digestFresh = !!digest?.at && nowMs - Date.parse(digest.at) <= DIGEST_MAX_AGE_MS;
|
|
62
|
+
const cards = new Map((digestFresh ? digest?.sessions ?? [] : []).filter((s) => s.card).map((s) => [s.id, s.card]));
|
|
63
|
+
const sessions = (snap.sessions ?? []).map(({ id, name, state }) => {
|
|
64
|
+
const card = cards.get(id);
|
|
65
|
+
return { id, name, state, ...(card ? { desk: { track: card.track, slug: card.slug, status: card.status, via: "desk" } } : {}) };
|
|
66
|
+
});
|
|
67
|
+
(0, runtime_1.emitNervesEvent)({ component: "daemon", event: "daemon.app_sessions_record_built", message: "built the app sessions part of the peer record", meta: { sessions: sessions.length, withDeskCard: cards.size } });
|
|
68
|
+
return { appSessions: { at: snap.at, counts: snap.counts, sessions } };
|
|
69
|
+
}
|
|
@@ -51,6 +51,7 @@ const sense_manager_1 = require("./sense-manager");
|
|
|
51
51
|
const agent_discovery_1 = require("./agent-discovery");
|
|
52
52
|
const agent_home_1 = require("./agent-home");
|
|
53
53
|
const identity_1 = require("../identity");
|
|
54
|
+
const app_sessions_record_1 = require("./app-sessions-record");
|
|
54
55
|
const runtime_mode_1 = require("./runtime-mode");
|
|
55
56
|
const habit_scheduler_1 = require("../habits/habit-scheduler");
|
|
56
57
|
const habit_migration_1 = require("../habits/habit-migration");
|
|
@@ -334,17 +335,7 @@ const presenceTicker = new presence_daemon_1.PresenceTicker({
|
|
|
334
335
|
},
|
|
335
336
|
schedulersRunning: (agent) => agentSchedulers.has(agent),
|
|
336
337
|
// This machine's Copilot app sessions, from the app-sessions sense's last snapshot, so peers see them too.
|
|
337
|
-
extraRecord: (agent) => {
|
|
338
|
-
try {
|
|
339
|
-
const snap = JSON.parse(fs.readFileSync(path.join((0, identity_1.getAgentBundlesRoot)(), `${agent}.ouro`, "state", "senses", "app-sessions", "snapshot.json"), "utf-8"));
|
|
340
|
-
if (!snap.at || !snap.counts || Date.now() - Date.parse(snap.at) > 10 * 60_000)
|
|
341
|
-
return {};
|
|
342
|
-
return { appSessions: { at: snap.at, counts: snap.counts, sessions: (snap.sessions ?? []).map(({ id, name, state }) => ({ id, name, state })) } };
|
|
343
|
-
}
|
|
344
|
-
catch {
|
|
345
|
-
return {};
|
|
346
|
-
}
|
|
347
|
-
},
|
|
338
|
+
extraRecord: (agent) => (0, app_sessions_record_1.appSessionsRecord)(path.join((0, identity_1.getAgentBundlesRoot)(), `${agent}.ouro`), Date.now()),
|
|
348
339
|
notify: async (agent, text) => {
|
|
349
340
|
await (0, socket_client_1.sendDaemonCommand)(socketPath, { kind: "message.send", from: "presence", to: agent, content: text });
|
|
350
341
|
await (0, socket_client_1.sendDaemonCommand)(socketPath, {
|
|
@@ -238,7 +238,7 @@ function renderPresenceStatus(options) {
|
|
|
238
238
|
for (const machine of presence.block.machines) {
|
|
239
239
|
const record = presence.peers.find((peer) => peer.machineId === machine.machineId);
|
|
240
240
|
const me = machine.machineId === machineId ? " (this machine)" : "";
|
|
241
|
-
const stale = record && (0, presence_1.isStaleSeenAt)(record.seenAt, now.getTime()) ? " [STALE:
|
|
241
|
+
const stale = record && (0, presence_1.isStaleSeenAt)(record.seenAt, now.getTime()) ? " [STALE: bundle sync has not delivered a newer presence record; check sync health before routing work here]" : "";
|
|
242
242
|
const seen = record ? `${record.version}, seen ${ago(record.seenAt, now)}${stale}` : "no presence record yet";
|
|
243
243
|
const legacy = presence.legacy.includes(machine.machineId) ? "; may run a home-only daemon" : "";
|
|
244
244
|
lines.push(`- ${machine.name}${me}: ${machine.role}; ${seen}${legacy}`);
|
|
@@ -33,7 +33,7 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
33
33
|
};
|
|
34
34
|
})();
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
-
exports.EVENT_CONTENT_MAX_CHARS = exports.OUTBOUND_ORIGINS = void 0;
|
|
36
|
+
exports.PROACTIVE_REPLAY_MAX_AGE_MS = exports.EVENT_CONTENT_MAX_CHARS = exports.OUTBOUND_ORIGINS = void 0;
|
|
37
37
|
exports.materializeApprovalTerminal = materializeApprovalTerminal;
|
|
38
38
|
exports.attachApprovalSuspensionCheckpoint = attachApprovalSuspensionCheckpoint;
|
|
39
39
|
exports.listApprovalSuspensionCheckpoints = listApprovalSuspensionCheckpoints;
|
|
@@ -1021,8 +1021,15 @@ function buildEventFromMessage(message, sequence, recordedAt, captureKind, sourc
|
|
|
1021
1021
|
function projectedSessionEventIds(envelope) {
|
|
1022
1022
|
return providerProjectionEvents(envelope).map((event) => event.id);
|
|
1023
1023
|
}
|
|
1024
|
-
|
|
1025
|
-
|
|
1024
|
+
/** A proactive notice this old is no longer news. It stays in the durable history but is not replayed to the model. */
|
|
1025
|
+
exports.PROACTIVE_REPLAY_MAX_AGE_MS = 6 * 60 * 60_000;
|
|
1026
|
+
function isDeadProactiveNotice(event, nowMs) {
|
|
1027
|
+
if (event.provenance.outbound?.origin !== "proactive")
|
|
1028
|
+
return false;
|
|
1029
|
+
return nowMs - Date.parse(bestEventTimestamp(event)) > exports.PROACTIVE_REPLAY_MAX_AGE_MS;
|
|
1030
|
+
}
|
|
1031
|
+
function providerProjectionEvents(envelope, nowMs = Date.now()) {
|
|
1032
|
+
const events = selectEffectiveSessionEvents(envelope.events).filter((event) => !isDeadProactiveNotice(event, nowMs));
|
|
1026
1033
|
if (envelope.projection.eventIds.length === 0)
|
|
1027
1034
|
return envelope.projection.trimmed ? [] : events;
|
|
1028
1035
|
const byId = new Map(events.map((event) => [event.id, event]));
|
package/dist/mind/where-am-i.js
CHANGED
|
@@ -59,7 +59,7 @@ function ago(seenAt, nowMs) {
|
|
|
59
59
|
return hours < 48 ? `${hours} h ago` : `${Math.round(hours / 24)} days ago`;
|
|
60
60
|
}
|
|
61
61
|
function staleNote(seenAt, nowMs) {
|
|
62
|
-
return (0, presence_1.isStaleSeenAt)(seenAt, nowMs) ? " [STALE: this record is old, so its sessions, counts and ownership may be out of date;
|
|
62
|
+
return (0, presence_1.isStaleSeenAt)(seenAt, nowMs) ? " [STALE: this record is old, so its sessions, counts and ownership may be out of date; its newest data is the bundle's presence/<machineId>.json, which only arrives through git sync, so run `ouro presence status` and check `ouro status` sync health before routing work to it]" : "";
|
|
63
63
|
}
|
|
64
64
|
function sessionCounts(record) {
|
|
65
65
|
const counts = record?.appSessions?.counts;
|
|
@@ -68,6 +68,16 @@ function sessionCounts(record) {
|
|
|
68
68
|
const parts = Object.entries(counts).filter(([, count]) => typeof count === "number").map(([state, count]) => `${count} ${state}`);
|
|
69
69
|
return parts.length > 0 ? `; copilot app sessions: ${parts.join(", ")}` : "";
|
|
70
70
|
}
|
|
71
|
+
const PEER_SESSIONS_SHOWN = 8;
|
|
72
|
+
/** The Copilot app sessions a peer last published, so work running there is visible without reaching the machine. */
|
|
73
|
+
function peerSessionLines(record, nowMs) {
|
|
74
|
+
const sessions = record?.appSessions?.sessions ?? [];
|
|
75
|
+
if (!record?.appSessions || sessions.length === 0)
|
|
76
|
+
return [];
|
|
77
|
+
const shown = sessions.slice(0, PEER_SESSIONS_SHOWN).map((session) => ` - ${session.name ?? session.id}${session.state ? ` (${session.state})` : ""}${session.desk?.track ? `, desk card ${session.desk.track}/${session.desk.slug ?? "?"}${session.desk.status ? ` [${session.desk.status}]` : ""}` : ""}`);
|
|
78
|
+
const more = sessions.length > shown.length ? [` - and ${sessions.length - shown.length} more`] : [];
|
|
79
|
+
return [` its copilot app sessions as of ${ago(record.appSessions.at, nowMs)}:`, ...shown, ...more];
|
|
80
|
+
}
|
|
71
81
|
/** Senses every presence runs for its own machine. */
|
|
72
82
|
const MACHINE_SENSES = ["cli", "shepherd", "app-sessions"];
|
|
73
83
|
/** What a person calls a sense whose name is the integration's. */
|
|
@@ -91,6 +101,7 @@ function renderWhereAmI(presence, self, nowMs = Date.now()) {
|
|
|
91
101
|
const facts = [peer.role, record?.os, record?.location].filter(Boolean).join(", ");
|
|
92
102
|
const seen = record ? `last seen ${ago(record.seenAt, nowMs)} on ${record.version}${sessionCounts(record)}${staleNote(record.seenAt, nowMs)}` : "not seen yet (no presence record)";
|
|
93
103
|
lines.push(`- ${peer.name} (${facts}): ${seen}`);
|
|
104
|
+
lines.push(...peerSessionLines(record, nowMs));
|
|
94
105
|
}
|
|
95
106
|
}
|
|
96
107
|
// Only senses agent.json turns on: a disabled sense runs on no machine, whatever the roster's owners say.
|
package/dist/senses/teams.js
CHANGED
|
@@ -2133,6 +2133,9 @@ async function drainAndSendPendingTeams(store, botApi, pendingRoot) {
|
|
|
2133
2133
|
sessionKey: key,
|
|
2134
2134
|
text: messageText,
|
|
2135
2135
|
intent: "generic_outreach",
|
|
2136
|
+
// Stable per file: a pending file that reappears (a restored checkout, a failed unlink) is recognised by the
|
|
2137
|
+
// session and not recorded into the conversation a second time.
|
|
2138
|
+
deliveryId: `pending:${(0, node_crypto_1.createHash)("sha256").update(path.relative(root, filePath)).digest("hex").slice(0, 32)}`,
|
|
2136
2139
|
}, {
|
|
2137
2140
|
botApi,
|
|
2138
2141
|
store,
|
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ouro.bot/cli",
|
|
3
|
-
"version": "0.1.0-alpha.
|
|
3
|
+
"version": "0.1.0-alpha.1511",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "@ouro.bot/cli",
|
|
9
|
-
"version": "0.1.0-alpha.
|
|
9
|
+
"version": "0.1.0-alpha.1511",
|
|
10
10
|
"bundleDependencies": [
|
|
11
11
|
"@ouro.bot/friends"
|
|
12
12
|
],
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ouro.bot/cli",
|
|
3
|
-
"version": "0.1.0-alpha.
|
|
3
|
+
"version": "0.1.0-alpha.1511",
|
|
4
4
|
"description": "Ouroboros, the agent harness: agents with durable memory that live where you talk (terminal, Teams, iMessage, mail, voice) and use real tools. Start with npx ouro.bot@latest.",
|
|
5
5
|
"homepage": "https://ouroboros.bot/",
|
|
6
6
|
"engines": {
|