@ouro.bot/cli 0.1.0-alpha.1634 → 0.1.0-alpha.1635
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 +11 -3
- package/deploy/unraid/sanctuary.ouro/bundle-meta.json +1 -1
- package/deploy/unraid/sanctuary.xml +1 -1
- package/dist/heart/butler-agent.js +6 -0
- package/dist/heart/daemon/container-healthcheck.js +1 -6
- package/dist/heart/daemon/daemon.js +2 -1
- package/dist/heart/daemon/sanctuary-authority-vault-migration.js +46 -8
- package/dist/heart/external-events/router.js +17 -14
- package/dist/senses/root-host-approval-runtime.js +2 -1
- package/dist/senses/sanctuary-health-runner.js +1 -0
- package/dist/senses/sanctuary-health.js +1 -1
- package/dist/senses/telegram.js +9 -8
- package/npm-shrinkwrap.json +2 -2
- package/package.json +1 -1
package/changelog.json
CHANGED
|
@@ -2,13 +2,21 @@
|
|
|
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
4
|
{
|
|
5
|
-
"version": "0.1.0-alpha.
|
|
5
|
+
"version": "0.1.0-alpha.1635",
|
|
6
|
+
"changes": [
|
|
7
|
+
"Update the Ouro UI files to Ouro UI v1.3.589.",
|
|
8
|
+
"The Butler's Telegram front door runs under either of the Butler's names. This covers the root gateway's transport, the owner's and household's privileges, the Butler tools, the privileged failsafe, and the SABnzbd key it reads to verify a protective pause.",
|
|
9
|
+
"The privileged event spool keeps its events and replay manifest under the name of the Butler the daemon runs. An envelope from the host's emitter that still names the Butler by its other name is filed there too, so usenet alerts survive the rename.",
|
|
10
|
+
"The vault handoff, root-host approvals and the health sweep's acceptance marker each follow the Butler's bundle name. The vault's machine id stays `sanctuary`."
|
|
11
|
+
]
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
"version": "0.1.0-alpha.1633",
|
|
6
15
|
"changes": [
|
|
7
16
|
"The agent can no longer write something that passes for a letter into the person's letters chat (the one-to-one iMessage chat with their answering handle). The BlueBubbles client refuses agent text there that folds to a letter code such as `L7`, `L8` or `letter 3`, or to `Options (from Ouro):`, before anything reaches the server. It does the same for an attachment's file name, and for an edit that would turn any message into a letter. Only Ouro's own rendered letters carry the mark that lets them through. Ordinary text, other chats and group chats are unaffected.",
|
|
8
17
|
"The letters chat is found however a send names it: by its chat GUID in any field, by the GUID's own one-to-one shape even when a display name marks the chat as a group, and by the handle frozen on any letter still open, after the person's handle has changed. If `answering.json` doesn't read, coded text is refused in every one-to-one chat rather than let through.",
|
|
9
18
|
"When the letters chat refuses the agent's text, the agent hears why. A refused reply ends that turn without a retry, and a note in the agent's private runtime says the person hasn't heard back. `send_message` and `surface` return the refusal's own words. A caption is checked before its image or file goes, so a refusal never leaves half a message.",
|
|
10
|
-
"A proactive message the guard refuses is dropped from the outbox rather than retried on every drain, and the agent is told why. A mid-turn message the guard refuses is refused before it is counted as seen, so a later timeout or restart still replays the turn. A chat marked as a group decides nothing on its own: its handle does."
|
|
11
|
-
"Update the Ouro UI files to Ouro UI v1.3.589."
|
|
19
|
+
"A proactive message the guard refuses is dropped from the outbox rather than retried on every drain, and the agent is told why. A mid-turn message the guard refuses is refused before it is counted as seen, so a later timeout or restart still replays the turn. A chat marked as a group decides nothing on its own: its handle does."
|
|
12
20
|
]
|
|
13
21
|
},
|
|
14
22
|
{
|
|
@@ -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.1635</Repository>
|
|
5
5
|
<Registry>https://github.com/ourostack/ouroboros/pkgs/container/ouroboros-butler</Registry>
|
|
6
6
|
<Network>host</Network>
|
|
7
7
|
<Shell>sh</Shell>
|
|
@@ -4,6 +4,7 @@ exports.BUTLER_AGENT_NAMES = void 0;
|
|
|
4
4
|
exports.isButlerAgent = isButlerAgent;
|
|
5
5
|
exports.butlerContainerPaths = butlerContainerPaths;
|
|
6
6
|
exports.managedButlerAgent = managedButlerAgent;
|
|
7
|
+
exports.butlerOnDisk = butlerOnDisk;
|
|
7
8
|
/**
|
|
8
9
|
* The Butler's agent names: `butler`, and `sanctuary` from before the rename (M2). Every check that picks Butler behaviour
|
|
9
10
|
* asks this, so an install runs the same whichever name its bundle has.
|
|
@@ -32,3 +33,8 @@ function managedButlerAgent(managedAgents) {
|
|
|
32
33
|
const butlers = managedAgents.filter(isButlerAgent);
|
|
33
34
|
return butlers.length === 1 ? butlers[0] : null;
|
|
34
35
|
}
|
|
36
|
+
/** The Butler named by the one bundle under `bundlesRoot`; null with both bundles there, or neither. */
|
|
37
|
+
function butlerOnDisk(bundlesRoot, exists) {
|
|
38
|
+
const present = exports.BUTLER_AGENT_NAMES.filter((name) => exists(`${bundlesRoot}/${name}.ouro`));
|
|
39
|
+
return present.length === 1 ? present[0] : null;
|
|
40
|
+
}
|
|
@@ -52,17 +52,12 @@ function fail(reason) {
|
|
|
52
52
|
process.exitCode = 1;
|
|
53
53
|
throw Object.assign(new Error(reason), { code: reason === "missing agent" ? "missing-agent" : "unhealthy" });
|
|
54
54
|
}
|
|
55
|
-
/** The Butler's name is the one its bundle on disk has; with both bundles, or neither, there is no Butler to check. */
|
|
56
|
-
function butlerOnDisk(bundlesRoot) {
|
|
57
|
-
const present = butler_agent_1.BUTLER_AGENT_NAMES.filter((name) => fs.existsSync(path.join(bundlesRoot, `${name}.ouro`)));
|
|
58
|
-
return present.length === 1 ? present[0] : undefined;
|
|
59
|
-
}
|
|
60
55
|
function runContainerHealthcheck(options = {}) {
|
|
61
56
|
const argv = options.argv ?? process.argv;
|
|
62
57
|
const now = options.now ?? Date.now;
|
|
63
58
|
const index = argv.indexOf("--agent");
|
|
64
59
|
const given = index >= 0 ? argv[index + 1] : undefined;
|
|
65
|
-
const agent = (0, butler_agent_1.isButlerAgent)(given) ? butlerOnDisk((0, identity_1.getAgentBundlesRoot)()) : given;
|
|
60
|
+
const agent = (0, butler_agent_1.isButlerAgent)(given) ? (0, butler_agent_1.butlerOnDisk)((0, identity_1.getAgentBundlesRoot)(), fs.existsSync) ?? undefined : given;
|
|
66
61
|
if (!agent)
|
|
67
62
|
fail("missing agent");
|
|
68
63
|
const packageManagement = (0, sanctuary_package_management_1.resolveSanctuaryPackageManagementActivation)({ mode: "production", argv, managedAgents: [agent], repoRoot: (0, identity_1.getRepoRoot)(), bundlesRoot: (0, identity_1.getAgentBundlesRoot)(), runtimePackageVersion: (0, bundle_manifest_1.getPackageVersion)() });
|
|
@@ -1783,7 +1783,8 @@ class OuroDaemon {
|
|
|
1783
1783
|
try {
|
|
1784
1784
|
const now = new Date().toISOString();
|
|
1785
1785
|
if (fs.existsSync(this.privilegedEventSpoolRoot)) {
|
|
1786
|
-
|
|
1786
|
+
const butler = (0, butler_agent_1.managedButlerAgent)(this.processManager.listAgentSnapshots().map((snapshot) => snapshot.name));
|
|
1787
|
+
this.privilegedEventScanner({ spoolRoot: this.privilegedEventSpoolRoot, eventRoot: this.externalEventRootPath(), ...(butler ? { agent: butler } : {}) });
|
|
1787
1788
|
}
|
|
1788
1789
|
const scanned = this.externalEventScanCache.scan(this.externalEventRootPath());
|
|
1789
1790
|
const readinessKeys = new Set();
|
|
@@ -1,8 +1,44 @@
|
|
|
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
|
exports.migrateSanctuaryAuthorityVault = migrateSanctuaryAuthorityVault;
|
|
4
37
|
const runtime_credentials_1 = require("../runtime-credentials");
|
|
38
|
+
const fs = __importStar(require("node:fs"));
|
|
5
39
|
const runtime_1 = require("../../nerves/runtime");
|
|
40
|
+
const identity_1 = require("../identity");
|
|
41
|
+
const butler_agent_1 = require("../butler-agent");
|
|
6
42
|
function identity(value) {
|
|
7
43
|
const candidate = value;
|
|
8
44
|
if (!candidate || typeof candidate.token !== "string" || !/^[1-9][0-9]*:[A-Za-z0-9_-]{20,}$/u.test(candidate.token)
|
|
@@ -11,10 +47,11 @@ function identity(value) {
|
|
|
11
47
|
throw new Error("Sanctuary vault token identity is invalid");
|
|
12
48
|
return candidate;
|
|
13
49
|
}
|
|
14
|
-
async function readOwners() {
|
|
50
|
+
async function readOwners(agent) {
|
|
51
|
+
// The second argument is the machine id, which stays "sanctuary" through the rename.
|
|
15
52
|
const results = [
|
|
16
|
-
await (0, runtime_credentials_1.refreshRuntimeCredentialConfig)(
|
|
17
|
-
await (0, runtime_credentials_1.refreshMachineRuntimeCredentialConfig)(
|
|
53
|
+
await (0, runtime_credentials_1.refreshRuntimeCredentialConfig)(agent),
|
|
54
|
+
await (0, runtime_credentials_1.refreshMachineRuntimeCredentialConfig)(agent, "sanctuary"),
|
|
18
55
|
];
|
|
19
56
|
return results.map((result) => {
|
|
20
57
|
if (result.ok)
|
|
@@ -31,14 +68,15 @@ function absent(owners) {
|
|
|
31
68
|
}
|
|
32
69
|
// Invoked only by the fixed root migration process, never by the resident daemon.
|
|
33
70
|
// Snapshot output travels through a private pipe to the root transaction, not logs.
|
|
34
|
-
|
|
71
|
+
/** `agent` defaults to the Butler whose bundle the vault container mounts, and to its name from before the rename. */
|
|
72
|
+
async function migrateSanctuaryAuthorityVault(operation, input, agent = (0, butler_agent_1.butlerOnDisk)((0, identity_1.getAgentBundlesRoot)(), fs.existsSync) ?? "sanctuary") {
|
|
35
73
|
if (process.getuid() !== 0 || process.getgid() !== 0)
|
|
36
74
|
throw new Error("Sanctuary vault migration requires root");
|
|
37
75
|
if (!["snapshot", "presence", "absent", "remove", "restore"].includes(operation))
|
|
38
76
|
throw new Error("Sanctuary vault migration operation is invalid");
|
|
39
77
|
(0, runtime_1.emitNervesEvent)({ component: "daemon", event: "daemon.sanctuary_vault_handoff_requested", message: "Sanctuary vault handoff requested", meta: { operation } });
|
|
40
78
|
const supplied = operation === "restore" ? identity(input) : null;
|
|
41
|
-
const owners = await readOwners();
|
|
79
|
+
const owners = await readOwners(agent);
|
|
42
80
|
if (operation === "presence")
|
|
43
81
|
return { tokenPresent: owners.some((owner) => Object.hasOwn(owner, "telegramBotToken")) };
|
|
44
82
|
if (operation === "absent")
|
|
@@ -66,9 +104,9 @@ async function migrateSanctuaryAuthorityVault(operation, input) {
|
|
|
66
104
|
}
|
|
67
105
|
// Full replacement is intentional here: merge cannot remove a credential.
|
|
68
106
|
// Each replacement starts from a fresh read of its own canonical owner.
|
|
69
|
-
await (0, runtime_credentials_1.upsertRuntimeCredentialConfig)(
|
|
70
|
-
await (0, runtime_credentials_1.upsertMachineRuntimeCredentialConfig)(
|
|
71
|
-
const readback = await readOwners();
|
|
107
|
+
await (0, runtime_credentials_1.upsertRuntimeCredentialConfig)(agent, next[0]);
|
|
108
|
+
await (0, runtime_credentials_1.upsertMachineRuntimeCredentialConfig)(agent, "sanctuary", next[1]);
|
|
109
|
+
const readback = await readOwners(agent);
|
|
72
110
|
if (!supplied)
|
|
73
111
|
return absent(readback);
|
|
74
112
|
absent([readback[1]]);
|
|
@@ -1019,11 +1019,11 @@ function acquirePrivilegedReplayLock(sourceDir) {
|
|
|
1019
1019
|
}
|
|
1020
1020
|
return null;
|
|
1021
1021
|
}
|
|
1022
|
-
function replayStatePath(eventRoot) {
|
|
1023
|
-
return path.join(eventRoot,
|
|
1022
|
+
function replayStatePath(eventRoot, agent) {
|
|
1023
|
+
return path.join(eventRoot, agent, PRIVILEGED_EVENT_SOURCE, PRIVILEGED_REPLAY_STATE_FILE);
|
|
1024
1024
|
}
|
|
1025
|
-
function replayStateFromManifest(manifest, updatedAt) {
|
|
1026
|
-
return { schemaVersion: 1, agent
|
|
1025
|
+
function replayStateFromManifest(manifest, updatedAt, agent) {
|
|
1026
|
+
return { schemaVersion: 1, agent, source: PRIVILEGED_EVENT_SOURCE, ...manifest, updatedAt };
|
|
1027
1027
|
}
|
|
1028
1028
|
function isReplayState(value) {
|
|
1029
1029
|
if (!value || typeof value !== "object" || Array.isArray(value))
|
|
@@ -1039,8 +1039,8 @@ function isReplayState(value) {
|
|
|
1039
1039
|
return false;
|
|
1040
1040
|
}
|
|
1041
1041
|
}
|
|
1042
|
-
function loadReplayState(eventRoot, sourceExisted, now) {
|
|
1043
|
-
const statePath = replayStatePath(eventRoot);
|
|
1042
|
+
function loadReplayState(eventRoot, agent, sourceExisted, now) {
|
|
1043
|
+
const statePath = replayStatePath(eventRoot, agent);
|
|
1044
1044
|
const sourceDir = path.dirname(statePath);
|
|
1045
1045
|
const stateExists = fs.existsSync(statePath);
|
|
1046
1046
|
let state = null;
|
|
@@ -1082,7 +1082,7 @@ function loadReplayState(eventRoot, sourceExisted, now) {
|
|
|
1082
1082
|
}
|
|
1083
1083
|
if (!state && sourceExisted && !legacyFound)
|
|
1084
1084
|
throw new Error("Privileged replay manifest is missing");
|
|
1085
|
-
const next = replayStateFromManifest(authority, now);
|
|
1085
|
+
const next = replayStateFromManifest(authority, now, agent);
|
|
1086
1086
|
atomicWriteJson(statePath, next, "Privileged replay manifest");
|
|
1087
1087
|
for (const migration of migrations) {
|
|
1088
1088
|
const retentionSummary = migration.record.retentionSummary ? retentionWithoutReplayManifest(migration.record.retentionSummary) : undefined;
|
|
@@ -1095,13 +1095,15 @@ function loadReplayState(eventRoot, sourceExisted, now) {
|
|
|
1095
1095
|
}
|
|
1096
1096
|
return next;
|
|
1097
1097
|
}
|
|
1098
|
+
/** `agent` is the Butler the daemon runs: its events, and the replay manifest that guards them, live under its name. */
|
|
1098
1099
|
function scanPrivilegedEventSpool(options) {
|
|
1099
1100
|
const entries = safeSpoolEntries(options.spoolRoot);
|
|
1100
1101
|
let accepted = 0;
|
|
1101
1102
|
let rejected = 0;
|
|
1102
1103
|
let replayed = 0;
|
|
1103
1104
|
const eventRoot = options.eventRoot ?? getExternalEventRoot();
|
|
1104
|
-
const
|
|
1105
|
+
const agent = options.agent ?? "sanctuary";
|
|
1106
|
+
const sourceDir = path.dirname(replayStatePath(eventRoot, agent));
|
|
1105
1107
|
const sourceExisted = fs.existsSync(sourceDir);
|
|
1106
1108
|
let rootSafe = false;
|
|
1107
1109
|
try {
|
|
@@ -1120,11 +1122,11 @@ function scanPrivilegedEventSpool(options) {
|
|
|
1120
1122
|
const initialNow = options.now?.() ?? new Date().toISOString();
|
|
1121
1123
|
let replayState;
|
|
1122
1124
|
try {
|
|
1123
|
-
replayState = loadReplayState(eventRoot, sourceExisted, initialNow);
|
|
1125
|
+
replayState = loadReplayState(eventRoot, agent, sourceExisted, initialNow);
|
|
1124
1126
|
}
|
|
1125
1127
|
catch {
|
|
1126
1128
|
rejected = Math.max(1, entries.length);
|
|
1127
|
-
replayState = replayStateFromManifest(emptyReplayManifest(), initialNow);
|
|
1129
|
+
replayState = replayStateFromManifest(emptyReplayManifest(), initialNow, agent);
|
|
1128
1130
|
}
|
|
1129
1131
|
if (rejected === 0)
|
|
1130
1132
|
for (const entry of entries) {
|
|
@@ -1160,9 +1162,10 @@ function scanPrivilegedEventSpool(options) {
|
|
|
1160
1162
|
verification: { verified: envelope.protectiveStateVerified, digest: envelope.protectiveStateDigest, observedAt: envelope.protectiveStateObservedAt },
|
|
1161
1163
|
};
|
|
1162
1164
|
const transition = envelope.eventType === "usenet.health_observation" && envelope.transitionId.startsWith("recovered:") ? "recovered" : "opened";
|
|
1163
|
-
const quietInitialReceipt = transition === "recovered" && !fs.existsSync(externalEventRecordPath(eventRoot, { agent
|
|
1165
|
+
const quietInitialReceipt = transition === "recovered" && !fs.existsSync(externalEventRecordPath(eventRoot, { agent, source: envelope.source, eventId: envelope.incidentKey }));
|
|
1166
|
+
// The host's emitter may still name the Butler by its other name; the event is filed under the Butler this daemon runs.
|
|
1164
1167
|
recordExternalEventInternal({
|
|
1165
|
-
agent
|
|
1168
|
+
agent,
|
|
1166
1169
|
source: envelope.source,
|
|
1167
1170
|
eventType: envelope.eventType,
|
|
1168
1171
|
eventId: envelope.incidentKey,
|
|
@@ -1173,8 +1176,8 @@ function scanPrivilegedEventSpool(options) {
|
|
|
1173
1176
|
observationRevision: envelope.observationRevision,
|
|
1174
1177
|
transition,
|
|
1175
1178
|
}, { root: eventRoot, now: () => now, quietInitialReceipt, [privilegedIngress]: { nonce: envelope.nonce, protectiveAction } });
|
|
1176
|
-
replayState = replayStateFromManifest(replayAdd(replayState, envelope.nonce), now);
|
|
1177
|
-
atomicWriteJson(replayStatePath(eventRoot), replayState, "Privileged replay manifest");
|
|
1179
|
+
replayState = replayStateFromManifest(replayAdd(replayState, envelope.nonce), now, agent);
|
|
1180
|
+
atomicWriteJson(replayStatePath(eventRoot, agent), replayState, "Privileged replay manifest");
|
|
1178
1181
|
accepted += 1;
|
|
1179
1182
|
}
|
|
1180
1183
|
catch (error) {
|
|
@@ -208,7 +208,8 @@ function createRootHostApprovalRuntime(options) {
|
|
|
208
208
|
const context = await options.resolveContext(record.binding);
|
|
209
209
|
requireValid(context.rootHost?.port === port);
|
|
210
210
|
await (0, tools_sanctuary_host_1.authorizeRootHostContext)(context, record.binding);
|
|
211
|
-
|
|
211
|
+
// The Butler is named after its bundle folder, the rule its host tool enforces.
|
|
212
|
+
const owner = { agentName: path.basename(options.agentRoot, ".ouro"), agentRoot: options.agentRoot };
|
|
212
213
|
const runtime = await (options.dependencies?.getProviderRuntime ?? core_1.getProviderRuntime)("human", owner);
|
|
213
214
|
const mcp = await (options.dependencies?.getMcp ?? mcp_manager_1.getSharedMcpManager)(owner) ?? undefined;
|
|
214
215
|
if (!port.isHealthy() && !await port.refresh())
|
|
@@ -74,6 +74,7 @@ async function runSanctuaryHealthHabit(agentName, options = {}) {
|
|
|
74
74
|
await (0, runtime_credentials_1.refreshMachineRuntimeCredentialConfig)(agentName, machine.machineId, { preserveCachedOnFailure: true });
|
|
75
75
|
}
|
|
76
76
|
const sweep = options.createSweep?.(agentName) ?? (0, sanctuary_health_1.createSanctuaryHealthSweep)({
|
|
77
|
+
agentName,
|
|
77
78
|
toolContext: (0, sanctuary_runtime_1.createSanctuaryToolContext)(agentName),
|
|
78
79
|
house: (0, sanctuary_house_1.readSanctuaryHouse)((0, identity_1.getAgentRoot)(agentName)),
|
|
79
80
|
statePath: path.join((0, identity_1.getAgentRoot)(agentName), "state", "health", "sanctuary-health.json"),
|
|
@@ -308,7 +308,7 @@ function createSanctuaryHealthSweep(options) {
|
|
|
308
308
|
const publicEndpoints = (options.house?.publicEndpoints ?? []).map((endpoint) => endpoint.url);
|
|
309
309
|
const requiredContainers = new Set(options.house?.requiredContainers ?? []);
|
|
310
310
|
const now = options.now ?? (() => new Date());
|
|
311
|
-
const acceptanceEventMeta = options.acceptanceEventMeta ?? (() => (0, sanctuary_acceptance_marker_1.sanctuaryAcceptanceEventMeta)("sanctuary"));
|
|
311
|
+
const acceptanceEventMeta = options.acceptanceEventMeta ?? (() => (0, sanctuary_acceptance_marker_1.sanctuaryAcceptanceEventMeta)(options.agentName ?? "sanctuary"));
|
|
312
312
|
const runSweep = async () => {
|
|
313
313
|
const sweepId = (0, node_crypto_1.randomUUID)();
|
|
314
314
|
const startedAt = now().toISOString();
|
package/dist/senses/telegram.js
CHANGED
|
@@ -112,6 +112,7 @@ const telegram_effect_adapter_1 = require("./telegram-effect-adapter");
|
|
|
112
112
|
const telegram_chat_actions_1 = require("./telegram-chat-actions");
|
|
113
113
|
const atomic_file_1 = require("../heart/atomic-file");
|
|
114
114
|
const repeat_while_1 = require("./repeat-while");
|
|
115
|
+
const butler_agent_1 = require("../heart/butler-agent");
|
|
115
116
|
const EMPTY_SHARED_TURN_DIAGNOSTIC = "(agent responded but response was empty)";
|
|
116
117
|
function hasUserVisibleTurnResponse(response) {
|
|
117
118
|
const text = response.trim();
|
|
@@ -129,7 +130,7 @@ function createFullVisibilityProgress() {
|
|
|
129
130
|
function createSabQueueProtectiveStateVerifier(options = {}) {
|
|
130
131
|
let client = null;
|
|
131
132
|
return async (action) => {
|
|
132
|
-
client ??= (0, sanctuary_sab_1.createSanctuarySabClient)({ loadApiKey: options.loadApiKey ?? (() => (0, sanctuary_runtime_1.loadSanctuarySabApiKey)("sanctuary")), fetch: options.fetch, now: options.now });
|
|
133
|
+
client ??= (0, sanctuary_sab_1.createSanctuarySabClient)({ loadApiKey: options.loadApiKey ?? (() => (0, sanctuary_runtime_1.loadSanctuarySabApiKey)(options.agentName ?? "sanctuary")), fetch: options.fetch, now: options.now });
|
|
133
134
|
const snapshot = await client.readQueue();
|
|
134
135
|
const paused = snapshot.paused;
|
|
135
136
|
const digest = (0, node_crypto_1.createHash)("sha256").update(`sabnzbd.queue.paused=${String(paused)}`).digest("hex");
|
|
@@ -616,7 +617,7 @@ function parseTelegramSenseCredentials(value) {
|
|
|
616
617
|
}
|
|
617
618
|
function createTelegramSenseApp(options) {
|
|
618
619
|
const authorityTransport = options.authorityTransport;
|
|
619
|
-
if (authorityTransport && options.agentName
|
|
620
|
+
if (authorityTransport && !(0, butler_agent_1.isButlerAgent)(options.agentName)) {
|
|
620
621
|
throw new Error("Sanctuary Telegram authority transport cannot serve another agent");
|
|
621
622
|
}
|
|
622
623
|
if (authorityTransport && options.credentials.botToken !== undefined) {
|
|
@@ -653,7 +654,7 @@ function createTelegramSenseApp(options) {
|
|
|
653
654
|
: undefined;
|
|
654
655
|
const runTurn = options.runTurn ?? options._runTurn ?? shared_turn_1.runSenseTurn;
|
|
655
656
|
const collectToolReceipts = options._runWithToolReceiptCollection ?? sanctuary_runtime_2.runWithSanctuaryToolReceiptCollection;
|
|
656
|
-
const useSanctuaryRuntime = options.agentName
|
|
657
|
+
const useSanctuaryRuntime = (0, butler_agent_1.isButlerAgent)(options.agentName) && !options.runTurn;
|
|
657
658
|
const readScenarioHandleDigest = () => (options.acceptanceMarker
|
|
658
659
|
? options.acceptanceMarker()
|
|
659
660
|
: (0, sanctuary_acceptance_marker_1.readSanctuaryAcceptanceMarker)(options.agentName))?.scenarioHandleDigest;
|
|
@@ -1429,8 +1430,8 @@ function createTelegramSenseApp(options) {
|
|
|
1429
1430
|
const relationshipCoordinates = { ...input, botId: botId };
|
|
1430
1431
|
return async ({ runAgentOptions, activeCares = [], careEvidenceNow = Date.now() }) => {
|
|
1431
1432
|
const relationshipAuthorization = await resolveLiveRelationshipAuthorization(relationshipCoordinates);
|
|
1432
|
-
const isSanctuaryOwner = options.agentName
|
|
1433
|
-
const isSanctuaryHouseholdConversation = options.agentName
|
|
1433
|
+
const isSanctuaryOwner = (0, butler_agent_1.isButlerAgent)(options.agentName) && relationshipAuthorization.profileId === "sanctuary-owner";
|
|
1434
|
+
const isSanctuaryHouseholdConversation = (0, butler_agent_1.isButlerAgent)(options.agentName)
|
|
1434
1435
|
&& (relationshipAuthorization.profileId === "sanctuary-owner" || relationshipAuthorization.profileId === "sanctuary-household");
|
|
1435
1436
|
const storageOptimization = isSanctuaryOwner
|
|
1436
1437
|
? (0, sanctuary_storage_optimization_contract_1.sanctuaryStorageOptimizationRequiredToolCalls)(input.userMessage, relationshipAuthorization.advertisedToolNames)
|
|
@@ -2648,7 +2649,7 @@ async function createProductionTelegramRelationshipComposition(agentName, creden
|
|
|
2648
2649
|
async function startTelegramSenseApp(agentName, waitForAuthority = false) {
|
|
2649
2650
|
let authorityTransport;
|
|
2650
2651
|
let credentials;
|
|
2651
|
-
if (
|
|
2652
|
+
if ((0, butler_agent_1.isButlerAgent)(agentName)) {
|
|
2652
2653
|
const runtime = (0, runtime_credentials_1.readRuntimeCredentialConfig)(agentName);
|
|
2653
2654
|
const machine = (0, runtime_credentials_1.readMachineRuntimeCredentialConfig)(agentName);
|
|
2654
2655
|
if (!runtime.ok || !machine.ok)
|
|
@@ -2685,9 +2686,9 @@ async function startTelegramSenseApp(agentName, waitForAuthority = false) {
|
|
|
2685
2686
|
proactivePacing: { timeZone: process.env.TZ || "America/Los_Angeles" },
|
|
2686
2687
|
...(() => { const ownerRoute = (0, telegram_owner_route_1.ownerRouteForAgent)(agentName, (0, identity_1.getAgentRoot)(agentName)); return ownerRoute ? { ownerRoute } : {}; })(),
|
|
2687
2688
|
...(await createProductionTelegramRelationshipComposition(agentName, credentials, undefined, authorityTransport)),
|
|
2688
|
-
...(agentName
|
|
2689
|
+
...((0, butler_agent_1.isButlerAgent)(agentName) ? { privilegedFailsafe: {
|
|
2689
2690
|
eventRoot: (0, router_1.getExternalEventRoot)(),
|
|
2690
|
-
verifyProtectiveState: createSabQueueProtectiveStateVerifier(),
|
|
2691
|
+
verifyProtectiveState: createSabQueueProtectiveStateVerifier({ agentName }),
|
|
2691
2692
|
} } : {}),
|
|
2692
2693
|
});
|
|
2693
2694
|
}
|
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.1635",
|
|
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.1635",
|
|
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.1635",
|
|
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": {
|