@ouro.bot/cli 0.1.0-alpha.1721 → 0.1.0-alpha.1723
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 +15 -0
- package/deploy/unraid/sanctuary.ouro/bundle-meta.json +1 -1
- package/deploy/unraid/sanctuary.xml +1 -1
- package/dist/heart/daemon/agent-config-check.js +1 -0
- package/dist/heart/daemon/container-healthcheck.js +3 -0
- package/dist/heart/daemon/daemon-entry.js +17 -3
- package/dist/heart/daemon/vault-outage.js +5 -0
- package/dist/heart/product/active.js +15 -0
- package/dist/products/butler.js +37 -0
- package/dist/senses/telegram.js +10 -27
- package/npm-shrinkwrap.json +2 -2
- package/package.json +1 -1
package/changelog.json
CHANGED
|
@@ -1,6 +1,21 @@
|
|
|
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.1723",
|
|
6
|
+
"changes": [
|
|
7
|
+
"When the provider (for example an out-of-quota Anthropic workspace) fails after a vault outage, the daemon now shows the provider's own repair line instead of \"the agent's vault is unreachable\", and the container healthcheck no longer reports healthy while that provider check is failing."
|
|
8
|
+
]
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
"version": "0.1.0-alpha.1722",
|
|
12
|
+
"changes": [
|
|
13
|
+
"The Butler's product registration now says which tool calls its Telegram turns must make before they answer. Telegram used to build these itself:",
|
|
14
|
+
"The owner's questions about storage, stale Docker care, full visibility, install state and version.",
|
|
15
|
+
"The household's media questions.",
|
|
16
|
+
"On the Butler's image, the same contracts apply in the same order. An agent with no product never gets them."
|
|
17
|
+
]
|
|
18
|
+
},
|
|
4
19
|
{
|
|
5
20
|
"version": "0.1.0-alpha.1721",
|
|
6
21
|
"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.1723</Repository>
|
|
5
5
|
<Registry>https://github.com/ourostack/ouroboros/pkgs/container/ouroboros-butler</Registry>
|
|
6
6
|
<Network>host</Network>
|
|
7
7
|
<Shell>sh</Shell>
|
|
@@ -303,6 +303,7 @@ function failedPingResult(agentName, lane, provider, model, result) {
|
|
|
303
303
|
return {
|
|
304
304
|
ok: false,
|
|
305
305
|
error: `${lane} provider ${provider} model ${model} failed live check: ${result.message}`,
|
|
306
|
+
providerFailure: true,
|
|
306
307
|
fix: (0, readiness_repair_1.providerLiveCheckFix)({
|
|
307
308
|
agentName,
|
|
308
309
|
lane,
|
|
@@ -89,6 +89,9 @@ function runContainerHealthcheck(options = {}) {
|
|
|
89
89
|
fail("daemon is not PID 1");
|
|
90
90
|
if (health.status !== "healthy" && health.status !== "partial")
|
|
91
91
|
fail("daemon status is not ready");
|
|
92
|
+
const degraded = Array.isArray(health.degraded) ? health.degraded : [];
|
|
93
|
+
if (degraded.some((entry) => typeof entry.component === "string" && entry.component.startsWith("provider:")))
|
|
94
|
+
fail("provider failed its live check");
|
|
92
95
|
const agents = health.agents;
|
|
93
96
|
const managed = agents?.[agent];
|
|
94
97
|
if (!managed || managed.status !== "running" || typeof managed.pid !== "number" || managed.pid <= 0)
|
|
@@ -726,10 +726,23 @@ function setVaultDegraded(agent, reason) {
|
|
|
726
726
|
else
|
|
727
727
|
degradedComponents.push({ component, reason: fullReason, since: new Date().toISOString() });
|
|
728
728
|
}
|
|
729
|
+
// The vault answered, so the vault component is cleared and the provider's own failure and repair line are shown instead.
|
|
730
|
+
function setProviderFailed(agent, reason, fix) {
|
|
731
|
+
clearVaultDegraded(agent);
|
|
732
|
+
const component = `provider:${agent}`;
|
|
733
|
+
const fullReason = `${reason}. Fix: ${fix ?? "run 'ouro doctor'; the daemon stays up and retries."}`;
|
|
734
|
+
const existing = degradedComponents.find((entry) => entry.component === component);
|
|
735
|
+
if (existing)
|
|
736
|
+
existing.reason = fullReason;
|
|
737
|
+
else
|
|
738
|
+
degradedComponents.push({ component, reason: fullReason, since: new Date().toISOString() });
|
|
739
|
+
}
|
|
729
740
|
function clearVaultDegraded(agent) {
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
741
|
+
for (const component of [`vault:${agent}`, `provider:${agent}`]) {
|
|
742
|
+
const index = degradedComponents.findIndex((entry) => entry.component === component);
|
|
743
|
+
if (index >= 0)
|
|
744
|
+
degradedComponents.splice(index, 1);
|
|
745
|
+
}
|
|
733
746
|
}
|
|
734
747
|
/* v8 ignore stop */
|
|
735
748
|
async function checkProviderRuntime(agent) {
|
|
@@ -757,6 +770,7 @@ async function prepareProviderRuntime() {
|
|
|
757
770
|
check: checkProviderRuntime,
|
|
758
771
|
onDegraded: setVaultDegraded,
|
|
759
772
|
onRecovered: clearVaultDegraded,
|
|
773
|
+
onProviderFailed: setProviderFailed,
|
|
760
774
|
});
|
|
761
775
|
if (failures.length > 0) {
|
|
762
776
|
throw (0, daemon_bootstrap_startup_1.createProviderReadinessPreparationFailure)(failures);
|
|
@@ -57,6 +57,11 @@ function beginVaultOutageRecovery(agent, reason, deps) {
|
|
|
57
57
|
});
|
|
58
58
|
return;
|
|
59
59
|
}
|
|
60
|
+
if (result.providerFailure) {
|
|
61
|
+
deps.onProviderFailed(agent, result.error ?? reason, result.fix);
|
|
62
|
+
scheduleNext();
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
60
65
|
// A rejection (not just silence) needs a human; it stays degraded and visible while we keep retrying slowly.
|
|
61
66
|
deps.onDegraded(agent, result.error ?? reason);
|
|
62
67
|
scheduleNext();
|
|
@@ -21,6 +21,7 @@ exports.productSenseOwnerReply = productSenseOwnerReply;
|
|
|
21
21
|
exports.productAcceptanceMarker = productAcceptanceMarker;
|
|
22
22
|
exports.productAcceptanceEventMeta = productAcceptanceEventMeta;
|
|
23
23
|
exports.productRunAcceptanceApproved = productRunAcceptanceApproved;
|
|
24
|
+
exports.productSenseTurnContracts = productSenseTurnContracts;
|
|
24
25
|
const runtime_1 = require("../../nerves/runtime");
|
|
25
26
|
const container_runtime_1 = require("../daemon/container-runtime");
|
|
26
27
|
/** The seam version this harness runs. A product built for another stops the start. */
|
|
@@ -311,3 +312,17 @@ function productRunAcceptanceApproved(agentName, approval, operation) {
|
|
|
311
312
|
const acceptance = productFor(agentName)?.acceptance;
|
|
312
313
|
return acceptance ? acceptance.runApproved(approval, operation) : operation();
|
|
313
314
|
}
|
|
315
|
+
/** The tool calls a turn on the sense must make for the product's own agent (J6), or none. A throw from the product fails the turn. */
|
|
316
|
+
async function productSenseTurnContracts(sense, input) {
|
|
317
|
+
const product = productFor(input.agentName);
|
|
318
|
+
const own = product?.senses?.[sense]?.turnContracts;
|
|
319
|
+
if (!own)
|
|
320
|
+
return { contracts: [] };
|
|
321
|
+
try {
|
|
322
|
+
return await own(input);
|
|
323
|
+
}
|
|
324
|
+
catch (error) {
|
|
325
|
+
hookFailed(product, "senses.turnContracts", input.agentName, error, "the product's turn contracts failed, so the turn fails");
|
|
326
|
+
throw error;
|
|
327
|
+
}
|
|
328
|
+
}
|
package/dist/products/butler.js
CHANGED
|
@@ -34,6 +34,7 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
34
34
|
})();
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
36
|
exports.product = exports.BUTLER_HOUSE_CARE_TOOL_NAMES = void 0;
|
|
37
|
+
exports.butlerTurnContracts = butlerTurnContracts;
|
|
37
38
|
exports.selectButlerTools = selectButlerTools;
|
|
38
39
|
const path = __importStar(require("node:path"));
|
|
39
40
|
const butler_agent_1 = require("../heart/butler-agent");
|
|
@@ -106,6 +107,40 @@ async function runSanctuaryHealth(input) {
|
|
|
106
107
|
* core's whole tool registry, and every process on the image loads the product. Core registers them, so a turn gets core's own.
|
|
107
108
|
*/
|
|
108
109
|
exports.BUTLER_HOUSE_CARE_TOOL_NAMES = ["house_sweep", "house_digest_send"];
|
|
110
|
+
/**
|
|
111
|
+
* The tool calls the Butler's Telegram turns must make before they answer. The owner's questions about storage, stale
|
|
112
|
+
* Docker care, full visibility, install state and version, and the household's media questions, each have a contract.
|
|
113
|
+
* Everyone else's turns have none. The contract modules load at the turn, not with the product.
|
|
114
|
+
*/
|
|
115
|
+
async function butlerTurnContracts(input) {
|
|
116
|
+
const owner = input.profileId === "sanctuary-owner";
|
|
117
|
+
if (!owner && input.profileId !== "sanctuary-household")
|
|
118
|
+
return { contracts: [] };
|
|
119
|
+
const [visibility, install, media, storage] = await Promise.all([
|
|
120
|
+
Promise.resolve().then(() => __importStar(require("../senses/sanctuary-full-visibility-contract"))),
|
|
121
|
+
Promise.resolve().then(() => __importStar(require("../senses/sanctuary-install-state-contract"))),
|
|
122
|
+
Promise.resolve().then(() => __importStar(require("../senses/sanctuary-media-catalog-contract"))),
|
|
123
|
+
Promise.resolve().then(() => __importStar(require("../senses/sanctuary-storage-optimization-contract"))),
|
|
124
|
+
]);
|
|
125
|
+
const tools = input.advertisedToolNames;
|
|
126
|
+
if (!owner) {
|
|
127
|
+
const mediaCatalog = media.sanctuaryMediaCatalogRequiredToolCalls(input.userMessage, tools);
|
|
128
|
+
return { contracts: mediaCatalog ? [mediaCatalog] : [] };
|
|
129
|
+
}
|
|
130
|
+
// Built in the order Telegram built them, so their obligation events log in the same order.
|
|
131
|
+
const storageOptimization = storage.sanctuaryStorageOptimizationRequiredToolCalls(input.userMessage, tools);
|
|
132
|
+
const staleDockerCare = visibility.sanctuaryStaleDockerCareRequiredToolCalls(input.activeCares, input.careEvidenceNow, tools);
|
|
133
|
+
const fullVisibility = visibility.sanctuaryFullVisibilityRequiredToolCalls(input.userMessage, tools, () => staleDockerCare?.currentRiskClaims() ?? []);
|
|
134
|
+
const contracts = [
|
|
135
|
+
storageOptimization,
|
|
136
|
+
fullVisibility,
|
|
137
|
+
staleDockerCare,
|
|
138
|
+
media.sanctuaryMediaCatalogRequiredToolCalls(input.userMessage, tools),
|
|
139
|
+
install.sanctuaryInstallStateRequiredToolCalls(input.userMessage, tools),
|
|
140
|
+
install.sanctuaryVersionQuestionRequiredToolCalls(input.userMessage, tools),
|
|
141
|
+
].filter((contract) => contract !== undefined);
|
|
142
|
+
return { contracts, ...(fullVisibility ? { emptyResponseFallback: fullVisibility.emptyResponseFallback } : {}) };
|
|
143
|
+
}
|
|
109
144
|
/** The tools the Butler adds to a turn's menu: the root-host tool in the owner's Telegram chat, and house care on its own private turns. */
|
|
110
145
|
function selectButlerTools(input) {
|
|
111
146
|
if (input.channel === "telegram") {
|
|
@@ -179,6 +214,8 @@ exports.product = {
|
|
|
179
214
|
},
|
|
180
215
|
// "Why aren't my shows downloading?" gets the household's credit top-up reply, never the downloaders' internals.
|
|
181
216
|
presentOwnerReply: (agentName, { request, text }) => (0, sanctuary_download_credit_presentation_1.presentSanctuaryDownloadCreditReply)(agentName, request === "why aren't my shows downloading?", text),
|
|
217
|
+
// The owner's and the household's questions about the house must be answered from the house's tools, not from memory.
|
|
218
|
+
turnContracts: butlerTurnContracts,
|
|
182
219
|
},
|
|
183
220
|
},
|
|
184
221
|
// J8: the Butler takes delegated commands from peers the operator granted, each announced in the owner's own Telegram
|
package/dist/senses/telegram.js
CHANGED
|
@@ -84,10 +84,6 @@ const root_host_approval_runtime_1 = require("./root-host-approval-runtime");
|
|
|
84
84
|
const tools_sanctuary_host_1 = require("../repertoire/tools-sanctuary-host");
|
|
85
85
|
const active_1 = require("../heart/product/active");
|
|
86
86
|
const sanctuary_runtime_2 = require("./sanctuary-runtime");
|
|
87
|
-
const sanctuary_full_visibility_contract_1 = require("./sanctuary-full-visibility-contract");
|
|
88
|
-
const sanctuary_install_state_contract_1 = require("./sanctuary-install-state-contract");
|
|
89
|
-
const sanctuary_media_catalog_contract_1 = require("./sanctuary-media-catalog-contract");
|
|
90
|
-
const sanctuary_storage_optimization_contract_1 = require("./sanctuary-storage-optimization-contract");
|
|
91
87
|
const sanctuary_grounding_1 = require("./sanctuary-grounding");
|
|
92
88
|
const telegram_approval_runtime_1 = require("./telegram-approval-runtime");
|
|
93
89
|
const telegram_audit_ledger_1 = require("./telegram-audit-ledger");
|
|
@@ -1429,29 +1425,16 @@ function createTelegramSenseApp(options) {
|
|
|
1429
1425
|
return async ({ runAgentOptions, activeCares = [], careEvidenceNow = Date.now() }) => {
|
|
1430
1426
|
const relationshipAuthorization = await resolveLiveRelationshipAuthorization(relationshipCoordinates);
|
|
1431
1427
|
const isSanctuaryOwner = (0, butler_agent_1.isButlerAgent)(options.agentName) && relationshipAuthorization.profileId === "sanctuary-owner";
|
|
1432
|
-
const
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
:
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
: undefined;
|
|
1443
|
-
const mediaCatalog = isSanctuaryHouseholdConversation
|
|
1444
|
-
? (0, sanctuary_media_catalog_contract_1.sanctuaryMediaCatalogRequiredToolCalls)(input.userMessage, relationshipAuthorization.advertisedToolNames)
|
|
1445
|
-
: undefined;
|
|
1446
|
-
const installState = isSanctuaryOwner
|
|
1447
|
-
? (0, sanctuary_install_state_contract_1.sanctuaryInstallStateRequiredToolCalls)(input.userMessage, relationshipAuthorization.advertisedToolNames)
|
|
1448
|
-
: undefined;
|
|
1449
|
-
const versionQuestion = isSanctuaryOwner
|
|
1450
|
-
? (0, sanctuary_install_state_contract_1.sanctuaryVersionQuestionRequiredToolCalls)(input.userMessage, relationshipAuthorization.advertisedToolNames)
|
|
1451
|
-
: undefined;
|
|
1452
|
-
if (input.fullVisibilityProgress && fullVisibility)
|
|
1453
|
-
input.fullVisibilityProgress.fallback = fullVisibility.emptyResponseFallback;
|
|
1454
|
-
const contracts = [storageOptimization, fullVisibility, staleDockerCare, mediaCatalog, installState, versionQuestion].filter(Boolean);
|
|
1428
|
+
const { contracts, emptyResponseFallback } = await (0, active_1.productSenseTurnContracts)("telegram", {
|
|
1429
|
+
agentName: options.agentName,
|
|
1430
|
+
profileId: relationshipAuthorization.profileId,
|
|
1431
|
+
userMessage: input.userMessage,
|
|
1432
|
+
advertisedToolNames: relationshipAuthorization.advertisedToolNames,
|
|
1433
|
+
activeCares,
|
|
1434
|
+
careEvidenceNow,
|
|
1435
|
+
});
|
|
1436
|
+
if (input.fullVisibilityProgress && emptyResponseFallback)
|
|
1437
|
+
input.fullVisibilityProgress.fallback = emptyResponseFallback;
|
|
1455
1438
|
const ownedNames = contracts.map((contract) => new Set(contract.names));
|
|
1456
1439
|
const requiredToolCalls = contracts.length === 0 ? undefined : {
|
|
1457
1440
|
names: [...new Set(contracts.flatMap((contract) => [...contract.names]))],
|
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.1723",
|
|
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.1723",
|
|
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.1723",
|
|
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": {
|