@ouro.bot/cli 0.1.0-alpha.1300 → 0.1.0-alpha.1302
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 +13 -0
- package/deploy/unraid/sanctuary.ouro/bundle-meta.json +1 -1
- package/deploy/unraid/sanctuary.xml +1 -1
- package/dist/eval/assertions/index.js +8 -1
- package/dist/eval/guest-entry.js +16 -0
- package/dist/eval/sandbox/docker.js +303 -0
- package/dist/eval/sandbox/guest.js +41 -0
- package/dist/eval/sandbox/projection.js +105 -0
- package/dist/eval/sandbox/readback.js +137 -0
- package/dist/eval/transport/provider-proxy.js +1 -0
- package/dist/heart/agent-entry.js +2 -1
- package/dist/heart/daemon/cli-commands/entry-points.js +164 -0
- package/dist/heart/daemon/cli-commands/failure-code.js +11 -0
- package/dist/heart/daemon/cli-manifest.js +22 -6
- package/dist/heart/daemon/container-healthcheck.js +14 -3
- package/dist/heart/daemon/container-spec-auditor-main.js +1 -1
- package/dist/heart/daemon/daemon-entry.js +2 -1
- package/dist/heart/daemon/sanctuary-authority-root-lifecycle.js +13 -5
- package/dist/heart/daemon/sanctuary-host-supervisor-entry.js +5 -2
- package/dist/heart/daemon/sanctuary-telegram-authority-entry.js +5 -2
- package/dist/heart/daemon/sanctuary-telegram-test-driver-entry.js +5 -2
- package/dist/heart/session-playback-cli-main.js +6 -1
- package/dist/heart/session-redaction-repair-cli-main.js +7 -4
- package/dist/heart/session-stats-cli-main.js +6 -1
- package/dist/mailroom/entry.js +13 -4
- package/dist/nerves/coverage/cli-main.js +6 -1
- package/dist/nerves/review/cli-main.js +6 -1
- package/dist/senses/a2a-entry.js +2 -1
- package/dist/senses/app-sessions-entry.js +2 -1
- package/dist/senses/bluebubbles/entry.js +2 -1
- package/dist/senses/cli-entry.js +2 -1
- package/dist/senses/mail-entry.js +2 -1
- package/dist/senses/sanctuary-health-acceptance-probe-entry.js +10 -1
- package/dist/senses/sanctuary-health-acceptance-probe.js +22 -6
- package/dist/senses/shepherd/judge-evaluation-command.js +4 -2
- package/dist/senses/shepherd/judge-evaluation-entry.js +9 -2
- package/dist/senses/shepherd-entry.js +2 -1
- package/dist/senses/teams-entry.js +2 -1
- package/dist/senses/telegram-entry.js +2 -1
- package/dist/senses/voice-entry.js +2 -1
- package/dist/senses/voice-realtime-eval-entry.js +6 -2
- package/dist/senses/voice-twilio-entry.js +2 -1
- package/npm-shrinkwrap.json +2 -2
- package/package.json +1 -1
|
@@ -42,6 +42,7 @@ const telegram_client_1 = require("../../senses/telegram-client");
|
|
|
42
42
|
const sanctuary_telegram_authority_entry_1 = require("./sanctuary-telegram-authority-entry");
|
|
43
43
|
const sanctuary_telegram_authority_gateway_1 = require("./sanctuary-telegram-authority-gateway");
|
|
44
44
|
const sanctuary_telegram_test_driver_1 = require("./sanctuary-telegram-test-driver");
|
|
45
|
+
const failure_code_1 = require("./cli-commands/failure-code");
|
|
45
46
|
/**
|
|
46
47
|
* Root-only entry for the owner-turn test driver. It reads the live authority's own config and signing key, which
|
|
47
48
|
* only root can read, and talks to nothing but the authority's state files and, for the visible echo, Telegram.
|
|
@@ -51,7 +52,7 @@ async function runSanctuaryTelegramTestDriverCli(options = {}) {
|
|
|
51
52
|
const configIndex = argv.indexOf("--config");
|
|
52
53
|
const configPath = configIndex >= 0 ? argv[configIndex + 1] : undefined;
|
|
53
54
|
if (!configPath)
|
|
54
|
-
throw new Error(sanctuary_telegram_test_driver_1.SANCTUARY_TELEGRAM_TEST_DRIVER_USAGE);
|
|
55
|
+
throw Object.assign(new Error(sanctuary_telegram_test_driver_1.SANCTUARY_TELEGRAM_TEST_DRIVER_USAGE), { code: "missing-config" });
|
|
55
56
|
const rest = [...argv.slice(0, configIndex), ...argv.slice(configIndex + 2)];
|
|
56
57
|
const expectedUid = options.expectedUid ?? 0;
|
|
57
58
|
(0, runtime_1.emitNervesEvent)({ component: "daemon", event: "daemon.sanctuary_telegram_test_driver_started", message: "Sanctuary owner-turn test driver started", meta: {} });
|
|
@@ -84,10 +85,12 @@ async function runSanctuaryTelegramTestDriverCli(options = {}) {
|
|
|
84
85
|
api?.stop();
|
|
85
86
|
}
|
|
86
87
|
}
|
|
88
|
+
/** The codes this program's card names; only these end its stderr (see failure-code.ts). */
|
|
89
|
+
const CARD_CODES = ["missing-config"];
|
|
87
90
|
/* v8 ignore start -- process entry wiring; runSanctuaryTelegramTestDriverCli is tested directly @preserve */
|
|
88
91
|
if (process.argv[1] && fs.existsSync(process.argv[1]) && fs.realpathSync(process.argv[1]) === __filename) {
|
|
89
92
|
void runSanctuaryTelegramTestDriverCli().catch((error) => {
|
|
90
|
-
process.stderr.write(`${error instanceof Error ? error.message : "Sanctuary test driver failed"}\n`);
|
|
93
|
+
process.stderr.write(`${error instanceof Error ? error.message : "Sanctuary test driver failed"}\n${(0, failure_code_1.failureCodeLine)(error, CARD_CODES)}`);
|
|
91
94
|
process.exitCode = 1;
|
|
92
95
|
});
|
|
93
96
|
}
|
|
@@ -2,4 +2,9 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const session_playback_cli_1 = require("./session-playback-cli");
|
|
4
4
|
const code = (0, session_playback_cli_1.runSessionPlaybackCli)(process.argv.slice(2));
|
|
5
|
-
|
|
5
|
+
// A failure ends stderr with its code, as every ouro command's does.
|
|
6
|
+
const failure = { 2: "usage" }[code];
|
|
7
|
+
if (failure)
|
|
8
|
+
process.stderr.write(`code: ${failure}\n`);
|
|
9
|
+
// exitCode, not process.exit: exit can drop the stderr line on a macOS pipe.
|
|
10
|
+
process.exitCode = code;
|
|
@@ -18,13 +18,16 @@ async function main() {
|
|
|
18
18
|
result = await (0, session_redaction_repair_1.rollbackA003SessionRepair)({ manifestSha256: args[2], manifestPath: args[3], preimagePath: args[4] });
|
|
19
19
|
}
|
|
20
20
|
else {
|
|
21
|
-
throw new Error("expected fixed inspect, apply, or rollback arguments");
|
|
21
|
+
throw Object.assign(new Error("expected fixed inspect, apply, or rollback arguments"), { code: "usage" });
|
|
22
22
|
}
|
|
23
|
-
|
|
24
|
-
|
|
23
|
+
// A step that didn't finish says so in its code: not-applied left the session as it was, indeterminate can't tell.
|
|
24
|
+
const unfinished = result.status === "indeterminate" ? "indeterminate" : result.status === "not_applied" ? "not-applied" : undefined;
|
|
25
|
+
process.stdout.write(`${JSON.stringify(unfinished ? { ...result, code: unfinished } : result)}\n`);
|
|
26
|
+
process.exitCode = unfinished ? 1 : 0;
|
|
25
27
|
}
|
|
26
28
|
catch (error) {
|
|
27
|
-
|
|
29
|
+
const code = error?.code === "usage" ? "usage" : "repair-refused";
|
|
30
|
+
process.stdout.write(`${JSON.stringify({ status: "refused", code, error: (error instanceof Error ? error.message : String(error)).slice(0, 512) })}\n`);
|
|
28
31
|
process.exitCode = 2;
|
|
29
32
|
}
|
|
30
33
|
}
|
|
@@ -2,4 +2,9 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const session_stats_1 = require("./session-stats");
|
|
4
4
|
const code = (0, session_stats_1.runSessionStatsCli)(process.argv.slice(2));
|
|
5
|
-
|
|
5
|
+
// A failure ends stderr with its code, as every ouro command's does.
|
|
6
|
+
const failure = { 2: "usage" }[code];
|
|
7
|
+
if (failure)
|
|
8
|
+
process.stderr.write(`code: ${failure}\n`);
|
|
9
|
+
// exitCode, not process.exit: exit can drop the stderr line on a macOS pipe.
|
|
10
|
+
process.exitCode = code;
|
package/dist/mailroom/entry.js
CHANGED
|
@@ -42,6 +42,7 @@ const runtime_1 = require("../nerves/runtime");
|
|
|
42
42
|
const blob_store_1 = require("./blob-store");
|
|
43
43
|
const file_store_1 = require("./file-store");
|
|
44
44
|
const smtp_ingress_1 = require("./smtp-ingress");
|
|
45
|
+
const failure_code_1 = require("../heart/daemon/cli-commands/failure-code");
|
|
45
46
|
const KEY_VALUE_ARGS = new Map([
|
|
46
47
|
["registry", "--registry"],
|
|
47
48
|
["registry-base64", "--registry-base64"],
|
|
@@ -79,7 +80,7 @@ function optionalNumber(args, flag, fallback) {
|
|
|
79
80
|
return fallback;
|
|
80
81
|
const value = Number.parseInt(args[index + 1] ?? "", 10);
|
|
81
82
|
if (!Number.isInteger(value) || value < 0 || value > 65535) {
|
|
82
|
-
throw new Error(`${flag} must be a TCP port`);
|
|
83
|
+
throw Object.assign(new Error(`${flag} must be a TCP port`), { code: "bad-port" });
|
|
83
84
|
}
|
|
84
85
|
return value;
|
|
85
86
|
}
|
|
@@ -91,12 +92,12 @@ function parseMailroomEntryArgs(args) {
|
|
|
91
92
|
const storePath = optionalValue(expanded, "--store");
|
|
92
93
|
const azureAccountUrl = optionalValue(expanded, "--azure-account-url");
|
|
93
94
|
if (!storePath && !azureAccountUrl) {
|
|
94
|
-
throw new Error("Missing --store or --azure-account-url");
|
|
95
|
+
throw Object.assign(new Error("Missing --store or --azure-account-url"), { code: "missing-store" });
|
|
95
96
|
}
|
|
96
97
|
const registryPath = optionalValue(expanded, "--registry");
|
|
97
98
|
const registryBase64 = optionalValue(expanded, "--registry-base64");
|
|
98
99
|
if (!registryPath && !registryBase64) {
|
|
99
|
-
throw new Error("Missing --registry or --registry-base64");
|
|
100
|
+
throw Object.assign(new Error("Missing --registry or --registry-base64"), { code: "missing-registry" });
|
|
100
101
|
}
|
|
101
102
|
const parsed = {
|
|
102
103
|
...(registryPath ? { registryPath } : {}),
|
|
@@ -153,8 +154,16 @@ function runMailroomEntry(args = process.argv.slice(2)) {
|
|
|
153
154
|
});
|
|
154
155
|
return servers;
|
|
155
156
|
}
|
|
157
|
+
/** The codes this program's card names; only these end its stderr (see failure-code.ts). */
|
|
158
|
+
const CARD_CODES = ["missing-store", "missing-registry", "bad-port"];
|
|
156
159
|
/* v8 ignore start -- exercised by packaged/container entrypoint smoke rather than in-process unit tests. @preserve */
|
|
157
160
|
if (require.main === module) {
|
|
158
|
-
|
|
161
|
+
try {
|
|
162
|
+
runMailroomEntry();
|
|
163
|
+
}
|
|
164
|
+
catch (error) {
|
|
165
|
+
process.stderr.write(`${error instanceof Error ? error.message : String(error)}\n${(0, failure_code_1.failureCodeLine)(error, CARD_CODES)}`);
|
|
166
|
+
process.exit(1);
|
|
167
|
+
}
|
|
159
168
|
}
|
|
160
169
|
/* v8 ignore stop */
|
|
@@ -2,4 +2,9 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const cli_1 = require("./cli");
|
|
4
4
|
const code = (0, cli_1.runAuditCli)(process.argv.slice(2));
|
|
5
|
-
|
|
5
|
+
// A failure ends stderr with its code, as every ouro command's does.
|
|
6
|
+
const failure = { 1: "audit-failed", 2: "no-run-dir" }[code];
|
|
7
|
+
if (failure)
|
|
8
|
+
process.stderr.write(`code: ${failure}\n`);
|
|
9
|
+
// exitCode, not process.exit: exit can drop the stderr line on a macOS pipe.
|
|
10
|
+
process.exitCode = code;
|
|
@@ -2,4 +2,9 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const cli_1 = require("./cli");
|
|
4
4
|
const code = (0, cli_1.runNervesReviewCli)(process.argv.slice(2));
|
|
5
|
-
|
|
5
|
+
// A failure ends stderr with its code, as every ouro command's does.
|
|
6
|
+
const failure = { 2: "bad-duration" }[code];
|
|
7
|
+
if (failure)
|
|
8
|
+
process.stderr.write(`code: ${failure}\n`);
|
|
9
|
+
// exitCode, not process.exit: exit can drop the stderr line on a macOS pipe.
|
|
10
|
+
process.exitCode = code;
|
package/dist/senses/a2a-entry.js
CHANGED
|
@@ -33,11 +33,12 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
33
33
|
};
|
|
34
34
|
})();
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
const MISSING_AGENT = "missing-agent";
|
|
36
37
|
const agentArgIndex = process.argv.indexOf("--agent");
|
|
37
38
|
const agentName = agentArgIndex >= 0 ? process.argv[agentArgIndex + 1] : undefined;
|
|
38
39
|
if (!agentName) {
|
|
39
40
|
// eslint-disable-next-line no-console -- pre-boot guard: --agent check before imports
|
|
40
|
-
console.error(
|
|
41
|
+
console.error(`Missing required --agent <name> argument.\nUsage: node dist/senses/a2a-entry.js --agent ouroboros [--port 18920] [--base-url https://agent.example]\ncode: ${MISSING_AGENT}`);
|
|
41
42
|
process.exit(1);
|
|
42
43
|
}
|
|
43
44
|
function argValue(name) {
|
|
@@ -33,11 +33,12 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
33
33
|
};
|
|
34
34
|
})();
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
const MISSING_AGENT = "missing-agent";
|
|
36
37
|
const agentArgIndex = process.argv.indexOf("--agent");
|
|
37
38
|
const agentName = agentArgIndex >= 0 ? process.argv[agentArgIndex + 1] : undefined;
|
|
38
39
|
if (!agentName) {
|
|
39
40
|
// eslint-disable-next-line no-console -- pre-boot guard: --agent check before imports
|
|
40
|
-
console.error(
|
|
41
|
+
console.error(`Missing required --agent <name> argument.\nUsage: node dist/senses/app-sessions-entry.js --agent ouroboros\ncode: ${MISSING_AGENT}`);
|
|
41
42
|
process.exit(1);
|
|
42
43
|
}
|
|
43
44
|
const runtime_logging_1 = require("../heart/daemon/runtime-logging");
|
|
@@ -35,11 +35,12 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
35
35
|
};
|
|
36
36
|
})();
|
|
37
37
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
38
|
+
const MISSING_AGENT = "missing-agent";
|
|
38
39
|
const agentArgIndex = process.argv.indexOf("--agent");
|
|
39
40
|
const agentName = agentArgIndex >= 0 ? process.argv[agentArgIndex + 1] : undefined;
|
|
40
41
|
if (!agentName) {
|
|
41
42
|
// eslint-disable-next-line no-console -- pre-boot guard: --agent check before imports
|
|
42
|
-
console.error(
|
|
43
|
+
console.error(`Missing required --agent <name> argument.\nUsage: node dist/senses/bluebubbles/entry.js --agent ouroboros\ncode: ${MISSING_AGENT}`);
|
|
43
44
|
process.exit(1);
|
|
44
45
|
}
|
|
45
46
|
const runtime_logging_1 = require("../../heart/daemon/runtime-logging");
|
package/dist/senses/cli-entry.js
CHANGED
|
@@ -35,11 +35,12 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
36
|
const runtime_1 = require("../nerves/runtime");
|
|
37
37
|
// Fail fast if --agent is missing (before any src/ code tries getAgentName())
|
|
38
|
+
const MISSING_AGENT = "missing-agent";
|
|
38
39
|
const agentArgIndex = process.argv.indexOf("--agent");
|
|
39
40
|
const agentName = agentArgIndex >= 0 ? process.argv[agentArgIndex + 1] : undefined;
|
|
40
41
|
if (!agentName) {
|
|
41
42
|
// eslint-disable-next-line no-console -- pre-boot guard: --agent check before imports
|
|
42
|
-
console.error(
|
|
43
|
+
console.error(`Missing required --agent <name> argument.\nUsage: node dist/senses/cli-entry.js --agent ouroboros\ncode: ${MISSING_AGENT}`);
|
|
43
44
|
process.exit(1);
|
|
44
45
|
}
|
|
45
46
|
(0, runtime_1.emitNervesEvent)({
|
|
@@ -33,11 +33,12 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
33
33
|
};
|
|
34
34
|
})();
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
const MISSING_AGENT = "missing-agent";
|
|
36
37
|
const agentArgIndex = process.argv.indexOf("--agent");
|
|
37
38
|
const agentName = agentArgIndex >= 0 ? process.argv[agentArgIndex + 1] : undefined;
|
|
38
39
|
if (!agentName) {
|
|
39
40
|
// eslint-disable-next-line no-console -- pre-boot guard: --agent check before imports
|
|
40
|
-
console.error(
|
|
41
|
+
console.error(`Missing required --agent <name> argument.\nUsage: node dist/senses/mail-entry.js --agent ouroboros\ncode: ${MISSING_AGENT}`);
|
|
41
42
|
process.exit(1);
|
|
42
43
|
}
|
|
43
44
|
const runtime_logging_1 = require("../heart/daemon/runtime-logging");
|
|
@@ -9,4 +9,13 @@ const runtime_1 = require("../nerves/runtime");
|
|
|
9
9
|
message: "booting Sanctuary health acceptance probe entrypoint",
|
|
10
10
|
meta: { entry: "sanctuary-health-acceptance-probe" },
|
|
11
11
|
});
|
|
12
|
-
|
|
12
|
+
const argv = process.argv.slice(2);
|
|
13
|
+
// No step, or a word that isn't one: say so before the probe starts. A step's coordinates are the probe's to refuse.
|
|
14
|
+
if (!(0, sanctuary_health_acceptance_probe_1.isSanctuaryHealthAcceptanceProbeMode)(argv[0])) {
|
|
15
|
+
const code = argv.length === 0 ? "missing-mode" : "usage";
|
|
16
|
+
process.stderr.write(`${sanctuary_health_acceptance_probe_1.SANCTUARY_HEALTH_ACCEPTANCE_PROBE_USAGE}\ncode: ${code}\n`);
|
|
17
|
+
process.exitCode = 1;
|
|
18
|
+
}
|
|
19
|
+
else {
|
|
20
|
+
(0, sanctuary_health_acceptance_probe_1.startSanctuaryHealthAcceptanceProbeCli)(argv, (0, sanctuary_health_acceptance_probe_1.createSanctuaryHealthAcceptanceProbeCliOutput)());
|
|
21
|
+
}
|
|
@@ -34,6 +34,7 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
34
34
|
};
|
|
35
35
|
})();
|
|
36
36
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
37
|
+
exports.SANCTUARY_HEALTH_ACCEPTANCE_PROBE_USAGE = void 0;
|
|
37
38
|
exports.acceptanceTargetEndpoint = acceptanceTargetEndpoint;
|
|
38
39
|
exports.registerSanctuaryHealthAcceptanceProbeProcess = registerSanctuaryHealthAcceptanceProbeProcess;
|
|
39
40
|
exports.createSanctuaryHealthAcceptanceProbeProcessHost = createSanctuaryHealthAcceptanceProbeProcessHost;
|
|
@@ -45,6 +46,7 @@ exports.createSanctuaryHealthAcceptanceProbeDependencies = createSanctuaryHealth
|
|
|
45
46
|
exports.runSanctuaryHealthAcceptanceProbe = runSanctuaryHealthAcceptanceProbe;
|
|
46
47
|
exports.finalizeSanctuaryHealthAcceptanceProbe = finalizeSanctuaryHealthAcceptanceProbe;
|
|
47
48
|
exports.recoverSanctuaryHealthAcceptanceProbe = recoverSanctuaryHealthAcceptanceProbe;
|
|
49
|
+
exports.isSanctuaryHealthAcceptanceProbeMode = isSanctuaryHealthAcceptanceProbeMode;
|
|
48
50
|
exports.createSanctuaryHealthAcceptanceProbeCliHost = createSanctuaryHealthAcceptanceProbeCliHost;
|
|
49
51
|
exports.runSanctuaryHealthAcceptanceProbeCli = runSanctuaryHealthAcceptanceProbeCli;
|
|
50
52
|
exports.createSanctuaryHealthAcceptanceProbeCliOutput = createSanctuaryHealthAcceptanceProbeCliOutput;
|
|
@@ -62,6 +64,7 @@ const sanctuary_health_runner_1 = require("./sanctuary-health-runner");
|
|
|
62
64
|
const sanctuary_runtime_1 = require("./sanctuary-runtime");
|
|
63
65
|
const sanctuary_scheduler_liveness_1 = require("../heart/daemon/sanctuary-scheduler-liveness");
|
|
64
66
|
const telegram_1 = require("./telegram");
|
|
67
|
+
const failure_code_1 = require("../heart/daemon/cli-commands/failure-code");
|
|
65
68
|
const SHA256 = /^[0-9a-f]{64}$/u;
|
|
66
69
|
/** The probe faults the household's Books endpoint, else its first public endpoint. */
|
|
67
70
|
function acceptanceTargetEndpoint(house) {
|
|
@@ -718,20 +721,31 @@ async function recoverSanctuaryHealthAcceptanceProbe(input, dependencies = creat
|
|
|
718
721
|
(0, runtime_1.emitNervesEvent)({ component: "senses", event: "senses.sanctuary_health_acceptance_recovered", message: "Sanctuary health acceptance probe state was restored", meta: { label: input.label, scenarioHandleDigest: input.scenarioHandleDigest } });
|
|
719
722
|
return { recovered: true };
|
|
720
723
|
}
|
|
724
|
+
/** The probe's usage line, which a malformed command line gets back. */
|
|
725
|
+
exports.SANCTUARY_HEALTH_ACCEPTANCE_PROBE_USAGE = "usage: sanctuary-health-acceptance-probe <run|stop|recover|finalize> --label <label> --scenario <digest> --owner-image <digest> --owner-container <digest> [--owner-image-after <digest> --owner-container-after <digest>]";
|
|
726
|
+
/** Whether a word is one of the probe's steps: run, stop, recover or finalize. */
|
|
727
|
+
function isSanctuaryHealthAcceptanceProbeMode(word) {
|
|
728
|
+
return word === "run" || word === "stop" || word === "recover" || word === "finalize";
|
|
729
|
+
}
|
|
721
730
|
function parseCli(argv) {
|
|
722
731
|
if ((argv.length !== 9 && argv.length !== 13) || (argv[0] !== "run" && argv[0] !== "stop" && argv[0] !== "recover" && argv[0] !== "finalize")
|
|
723
732
|
|| argv[1] !== "--label" || argv[3] !== "--scenario" || argv[5] !== "--owner-image" || argv[7] !== "--owner-container") {
|
|
724
|
-
throw new Error(
|
|
733
|
+
throw Object.assign(new Error(exports.SANCTUARY_HEALTH_ACCEPTANCE_PROBE_USAGE), { code: "usage" });
|
|
725
734
|
}
|
|
726
735
|
const input = { label: argv[2], scenarioHandleDigest: argv[4], ownerImageDigest: argv[6], ownerContainerDigest: argv[8] };
|
|
727
|
-
|
|
736
|
+
try {
|
|
737
|
+
canonicalInput(input);
|
|
738
|
+
}
|
|
739
|
+
catch (error) {
|
|
740
|
+
throw Object.assign(new Error(error.message), { code: "usage" });
|
|
741
|
+
}
|
|
728
742
|
if (argv[0] === "finalize") {
|
|
729
|
-
if (argv.length !== 13 || argv[9] !== "--owner-image-after" || argv[11] !== "--owner-container-after")
|
|
730
|
-
throw new Error("Sanctuary health acceptance finalize coordinates are invalid");
|
|
743
|
+
if (argv.length !== 13 || argv[9] !== "--owner-image-after" || argv[11] !== "--owner-container-after" || !SHA256.test(argv[10]) || !SHA256.test(argv[12]))
|
|
744
|
+
throw Object.assign(new Error("Sanctuary health acceptance finalize coordinates are invalid"), { code: "usage" });
|
|
731
745
|
return { mode: argv[0], input, after: { ownerImageDigest: argv[10], ownerContainerDigest: argv[12] } };
|
|
732
746
|
}
|
|
733
747
|
if (argv.length !== 9)
|
|
734
|
-
throw new Error("Sanctuary health acceptance probe coordinates are invalid");
|
|
748
|
+
throw Object.assign(new Error("Sanctuary health acceptance probe coordinates are invalid"), { code: "usage" });
|
|
735
749
|
return { mode: argv[0], input };
|
|
736
750
|
}
|
|
737
751
|
function createSanctuaryHealthAcceptanceProbeCliHost(target = process) {
|
|
@@ -778,9 +792,11 @@ function createSanctuaryHealthAcceptanceProbeCliOutput(target = process) {
|
|
|
778
792
|
setExitCode: (code) => { target.exitCode = code; },
|
|
779
793
|
};
|
|
780
794
|
}
|
|
795
|
+
/** The codes this program's card names; only these end its stderr (see failure-code.ts). */
|
|
796
|
+
const CARD_CODES = ["usage"];
|
|
781
797
|
function startSanctuaryHealthAcceptanceProbeCli(argv, output, options = {}) {
|
|
782
798
|
void runSanctuaryHealthAcceptanceProbeCli(argv, options).catch((error) => {
|
|
783
|
-
output.writeError(`${error instanceof Error ? error.message : String(error)}\n`);
|
|
799
|
+
output.writeError(`${error instanceof Error ? error.message : String(error)}\n${(0, failure_code_1.failureCodeLine)(error, CARD_CODES)}`);
|
|
784
800
|
output.setExitCode(1);
|
|
785
801
|
});
|
|
786
802
|
}
|
|
@@ -147,8 +147,10 @@ async function runShepherdJudgeEvaluationCommand(argv, dependencies = {
|
|
|
147
147
|
exitCode = report.classificationPassed ? 0 : 1;
|
|
148
148
|
}
|
|
149
149
|
catch (error) {
|
|
150
|
+
// 2: the evaluation couldn't run (bad arguments, no judge, a bad corpus or output), apart from 1, a failed run.
|
|
151
|
+
exitCode = 2;
|
|
150
152
|
const detail = (0, redact_1.redactSecrets)(String(error)).slice(0, 2000);
|
|
151
|
-
dependencies.print(JSON.stringify({ error: detail, v1Qualified: false }));
|
|
153
|
+
dependencies.print(JSON.stringify({ error: detail, code: "evaluation-error", v1Qualified: false }));
|
|
152
154
|
if (output) {
|
|
153
155
|
try {
|
|
154
156
|
output.write({ schemaVersion: 1, phase: "judge-classification-only", state: "error", error: detail, v1Qualified: false });
|
|
@@ -167,7 +169,7 @@ async function runShepherdJudgeEvaluationCommand(argv, dependencies = {
|
|
|
167
169
|
outputClosed = output !== null;
|
|
168
170
|
}
|
|
169
171
|
catch (error) {
|
|
170
|
-
exitCode = 1;
|
|
172
|
+
exitCode = Math.max(exitCode, 1);
|
|
171
173
|
const detail = (0, redact_1.redactSecrets)(String(error)).slice(0, 2000);
|
|
172
174
|
dependencies.print(JSON.stringify({ error: `Could not close evaluation output: ${detail}`, v1Qualified: false }));
|
|
173
175
|
(0, runtime_1.emitNervesEvent)({ component: "senses", level: "error", event: "senses.shepherd_judge_evaluation_output_close_error",
|
|
@@ -3,11 +3,18 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
const judge_evaluation_command_1 = require("./judge-evaluation-command");
|
|
4
4
|
const runtime_1 = require("../../nerves/runtime");
|
|
5
5
|
const redact_1 = require("./redact");
|
|
6
|
-
void (0, judge_evaluation_command_1.runShepherdJudgeEvaluationCommand)(process.argv.slice(2)).then(code => {
|
|
6
|
+
void (0, judge_evaluation_command_1.runShepherdJudgeEvaluationCommand)(process.argv.slice(2)).then(code => {
|
|
7
|
+
// The JSON on stdout says why; stderr's last line names the failure for a script: 1 a run that finished and
|
|
8
|
+
// failed, 2 a run that couldn't start or finish.
|
|
9
|
+
const failure = code === 1 ? "not-passed" : "evaluation-error";
|
|
10
|
+
if (code !== 0)
|
|
11
|
+
process.stderr.write(`code: ${failure}\n`);
|
|
12
|
+
process.exitCode = code;
|
|
13
|
+
}).catch(error => {
|
|
7
14
|
const detail = (0, redact_1.redactSecrets)(String(error)).slice(0, 2000);
|
|
8
15
|
(0, runtime_1.emitNervesEvent)({ component: "senses", level: "error", event: "senses.shepherd_judge_evaluation_entry_error",
|
|
9
16
|
message: "classification command rejected unexpectedly", meta: { phase: "judge-classification-only", error: detail } });
|
|
10
17
|
// eslint-disable-next-line no-console -- terminal UX: last-resort nonzero evaluation failure
|
|
11
|
-
console.error(JSON.stringify({ error: detail, v1Qualified: false }));
|
|
18
|
+
console.error(JSON.stringify({ error: detail, code: "evaluation-crashed", v1Qualified: false }));
|
|
12
19
|
process.exitCode = 1;
|
|
13
20
|
});
|
|
@@ -33,11 +33,12 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
33
33
|
};
|
|
34
34
|
})();
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
const MISSING_AGENT = "missing-agent";
|
|
36
37
|
const agentArgIndex = process.argv.indexOf("--agent");
|
|
37
38
|
const agentName = agentArgIndex >= 0 ? process.argv[agentArgIndex + 1] : undefined;
|
|
38
39
|
if (!agentName) {
|
|
39
40
|
// eslint-disable-next-line no-console -- pre-boot guard: --agent check before imports
|
|
40
|
-
console.error(
|
|
41
|
+
console.error(`Missing required --agent <name> argument.\nUsage: node dist/senses/shepherd-entry.js --agent ouroboros\ncode: ${MISSING_AGENT}`);
|
|
41
42
|
process.exit(1);
|
|
42
43
|
}
|
|
43
44
|
const runtime_logging_1 = require("../heart/daemon/runtime-logging");
|
|
@@ -36,11 +36,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
36
36
|
const runtime_logging_1 = require("../heart/daemon/runtime-logging");
|
|
37
37
|
const runtime_1 = require("../nerves/runtime");
|
|
38
38
|
// Fail fast if --agent is missing (before any src/ code tries getAgentName())
|
|
39
|
+
const MISSING_AGENT = "missing-agent";
|
|
39
40
|
const agentArgIndex = process.argv.indexOf("--agent");
|
|
40
41
|
const agentName = agentArgIndex >= 0 ? process.argv[agentArgIndex + 1] : undefined;
|
|
41
42
|
if (!agentName) {
|
|
42
43
|
// eslint-disable-next-line no-console -- pre-boot guard: --agent check before imports
|
|
43
|
-
console.error(
|
|
44
|
+
console.error(`Missing required --agent <name> argument.\nUsage: node dist/senses/teams-entry.js --agent ouroboros\ncode: ${MISSING_AGENT}`);
|
|
44
45
|
process.exit(1);
|
|
45
46
|
}
|
|
46
47
|
// Without this the sense's events go to a console nobody reads: the daemon discards its output.
|
|
@@ -33,11 +33,12 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
33
33
|
};
|
|
34
34
|
})();
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
const MISSING_AGENT = "missing-agent";
|
|
36
37
|
const agentArgIndex = process.argv.indexOf("--agent");
|
|
37
38
|
const agentName = agentArgIndex >= 0 ? process.argv[agentArgIndex + 1] : undefined;
|
|
38
39
|
if (!agentName) {
|
|
39
40
|
// eslint-disable-next-line no-console -- pre-boot guard: --agent check before imports
|
|
40
|
-
console.error(
|
|
41
|
+
console.error(`Missing required --agent <name> argument.\nUsage: node dist/senses/telegram-entry.js --agent butler\ncode: ${MISSING_AGENT}`);
|
|
41
42
|
process.exit(1);
|
|
42
43
|
}
|
|
43
44
|
const runtime_logging_1 = require("../heart/daemon/runtime-logging");
|
|
@@ -33,11 +33,12 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
33
33
|
};
|
|
34
34
|
})();
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
const MISSING_AGENT = "missing-agent";
|
|
36
37
|
const agentArgIndex = process.argv.indexOf("--agent");
|
|
37
38
|
const agentName = agentArgIndex >= 0 ? process.argv[agentArgIndex + 1] : undefined;
|
|
38
39
|
if (!agentName) {
|
|
39
40
|
// eslint-disable-next-line no-console -- pre-boot guard: --agent check before imports
|
|
40
|
-
console.error(
|
|
41
|
+
console.error(`Missing required --agent <name> argument.\nUsage: node dist/senses/voice-entry.js --agent ouroboros\ncode: ${MISSING_AGENT}`);
|
|
41
42
|
process.exit(1);
|
|
42
43
|
}
|
|
43
44
|
const runtime_logging_1 = require("../heart/daemon/runtime-logging");
|
|
@@ -17,5 +17,9 @@ const result = (0, voice_realtime_eval_command_1.runVoiceRealtimeEvalCommand)(pr
|
|
|
17
17
|
});
|
|
18
18
|
// eslint-disable-next-line no-console -- terminal UX: eval command summary
|
|
19
19
|
console.log(JSON.stringify(result.payload, null, 2));
|
|
20
|
-
if (result.exitCode !== 0)
|
|
21
|
-
|
|
20
|
+
if (result.exitCode !== 0) {
|
|
21
|
+
// stderr's last line names the failure: a bad --trace argument or file, or a scenario that didn't match.
|
|
22
|
+
process.stderr.write(`code: ${result.payload.error === undefined ? "eval-failed" : "eval-error"}\n`);
|
|
23
|
+
// exitCode, not process.exit: exit can drop the stderr line on a macOS pipe.
|
|
24
|
+
process.exitCode = result.exitCode;
|
|
25
|
+
}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const MISSING_AGENT = "missing-agent";
|
|
3
4
|
function readRequiredAgentName() {
|
|
4
5
|
const agentArgIndex = process.argv.indexOf("--agent");
|
|
5
6
|
const value = agentArgIndex >= 0 ? process.argv[agentArgIndex + 1] : undefined;
|
|
6
7
|
if (value)
|
|
7
8
|
return value;
|
|
8
|
-
process.stderr.write(
|
|
9
|
+
process.stderr.write(`Missing required --agent <name> argument.\nUsage: node dist/senses/voice-twilio-entry.js --agent ouroboros --public-url https://<tunnel>\ncode: ${MISSING_AGENT}\n`);
|
|
9
10
|
process.exit(1);
|
|
10
11
|
}
|
|
11
12
|
const agentName = readRequiredAgentName();
|
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.1302",
|
|
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.1302",
|
|
10
10
|
"bundleDependencies": [
|
|
11
11
|
"@ouro.bot/friends"
|
|
12
12
|
],
|