@corca-org/ceal-host-win32-x64 1.0.5 → 1.0.7
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/bin/ceal-host.exe +0 -0
- package/libexec/ceal-host/claude-hook.mjs +35 -17
- package/libexec/ceal-host/claude-invocation-authentication.mjs +2680 -0
- package/libexec/ceal-host/claude-producer.mjs +34 -18
- package/libexec/ceal-host/codex-hook.mjs +38 -21
- package/libexec/ceal-host/codex-invocation-authentication.mjs +49 -31
- package/libexec/ceal-host/codex-producer.mjs +38 -21
- package/libexec/ceal-host/control.mjs +97 -68
- package/libexec/ceal-host/relay.mjs +44 -26
- package/package.json +1 -1
- package/share/ceal-host/bundle-manifest.json +19 -11
- package/share/ceal-host/bundle-manifest.sigstore.json +1 -1
|
@@ -146,6 +146,7 @@ var CEAL_OPERATION_RECOVERY_KINDS = vocabulary(["none", "reconcile", "compensate
|
|
|
146
146
|
var CEAL_OPERATION_RECOVERY_STATUSES = vocabulary(["not_started", "active", "completed"]);
|
|
147
147
|
var CEAL_OPERATION_PROVIDER_READBACK_AVAILABILITY = vocabulary(["not_started", "not_applicable", "not_available", "pending", "available"]);
|
|
148
148
|
var CEAL_OPERATION_OFFERED_HANDOFF_STATES = vocabulary(["accepted", "rejected", "unknown"]);
|
|
149
|
+
var CEAL_OPERATION_RECEIPT_AUTHORITY_KEYS = Object.freeze(["instance_ref", "profile_ref", "principal_ref", "execution_subject_ref", "authority_revision_ref"]);
|
|
149
150
|
var CEAL_OPERATION_APPROVAL_DISPOSITIONS = vocabulary([
|
|
150
151
|
"approval_not_required_by_policy",
|
|
151
152
|
"interactive_pending",
|
|
@@ -402,7 +403,13 @@ var CEAL_OPERATION_JSON_SCHEMA_BUDGET = Object.freeze({
|
|
|
402
403
|
max_string_length: OPERATION_SCHEMA_LITERAL_MAX_BYTES / 4,
|
|
403
404
|
max_alternatives: 8,
|
|
404
405
|
max_enum_values: 64,
|
|
405
|
-
max_literal_bytes: OPERATION_SCHEMA_LITERAL_MAX_BYTES
|
|
406
|
+
max_literal_bytes: OPERATION_SCHEMA_LITERAL_MAX_BYTES,
|
|
407
|
+
/** @basis our_policy -- bounds explanatory schema prose carried in one catalog. */
|
|
408
|
+
max_description_characters: 1024,
|
|
409
|
+
/** @basis our_policy -- bounds regular-expression compilation input from one schema. */
|
|
410
|
+
max_pattern_characters: 256,
|
|
411
|
+
/** @basis our_policy -- bounds traversal work inside one already byte-bounded schema literal. */
|
|
412
|
+
max_literal_nodes: 512
|
|
406
413
|
});
|
|
407
414
|
|
|
408
415
|
// packages/ceal-client-protocol/src/operation-validation-primitives.ts
|
|
@@ -422,6 +429,9 @@ function requireIsoTimestamp(value, message) {
|
|
|
422
429
|
if (typeof value !== "string" || !ISO_TIMESTAMP.test(value) || !Number.isFinite(Date.parse(value))) throw new TypeError(message);
|
|
423
430
|
}
|
|
424
431
|
|
|
432
|
+
// packages/ceal-client-protocol/src/operation-json-schema.ts
|
|
433
|
+
var JSON_DESCRIPTION_CONTROL_CHARACTER = new RegExp("\\p{Cc}", "u");
|
|
434
|
+
|
|
425
435
|
// packages/ceal-client-protocol/src/operation-contract-validation.ts
|
|
426
436
|
var CEAL_OPERATION_AUTHORITY_POLICY_KEYS = Object.freeze(["profile", "instance_binding", "target", "admission_recheck"]);
|
|
427
437
|
var MAX_OPERATION_INPUT_RESOLVER_BINDINGS = 96;
|
|
@@ -522,7 +532,6 @@ var CEAL_BOUNDED_SERIES_CATALOG = Object.freeze({
|
|
|
522
532
|
control_commit: (root) => join(root, "control-auto-commit.jsonl"),
|
|
523
533
|
engagement_signal: (root) => join(root, "runtime-state", "slack-feedback.jsonl"),
|
|
524
534
|
runtime_error: (root) => join(root, "runtime-state", "runtime-errors.jsonl"),
|
|
525
|
-
provider_retry: (root) => join(root, "observability", "provider-retry-queue", "queue.jsonl"),
|
|
526
535
|
turn_bridge_request: (root) => join(root, ".ceal", "turn-bridge", "requests.jsonl"),
|
|
527
536
|
channel_log: (root) => join(root, "log.jsonl"),
|
|
528
537
|
thread_run_events: (root) => join(root, "run-events.jsonl"),
|
|
@@ -531,8 +540,6 @@ var CEAL_BOUNDED_SERIES_CATALOG = Object.freeze({
|
|
|
531
540
|
gateway_capability_audit: (root) => join(root, "capability-audit.jsonl"),
|
|
532
541
|
gateway_retrieval_waste_partition: (root) => `${root}.jsonl`,
|
|
533
542
|
gateway_access_policy_publication: (root) => join(root, "access-policy-publications.jsonl"),
|
|
534
|
-
gateway_event_lease_journal: (root) => `${root}.journal.jsonl`,
|
|
535
|
-
gateway_control_audit: (root) => `${root}.control-audits.jsonl`,
|
|
536
543
|
gateway_profile_connector_control_audit: (root) => `${root}.audit.jsonl`,
|
|
537
544
|
gateway_profile_connector_scope_audit: (root) => join(root, "profile-connector-scope-audit.jsonl"),
|
|
538
545
|
gateway_profile_connector_activity_scope_audit: (root) => join(root, "profile-connector-activity-scope-audit.jsonl"),
|
|
@@ -547,6 +554,11 @@ var CEAL_BOUNDED_SERIES_CATALOG = Object.freeze({
|
|
|
547
554
|
gateway_admin_access_token: (root) => join(root, "access-tokens.jsonl")
|
|
548
555
|
});
|
|
549
556
|
|
|
557
|
+
// packages/ceal-client-protocol/src/gateway-installation-activation.ts
|
|
558
|
+
var CEAL_GATEWAY_INSTALLATION_ACTIVATION_CODE_DATA_CHARACTERS = 32;
|
|
559
|
+
var CEAL_GATEWAY_INSTALLATION_ACTIVATION_CODE_CHECK_CHARACTERS = 8;
|
|
560
|
+
var CEAL_GATEWAY_INSTALLATION_ACTIVATION_CODE_COMPACT_CHARACTERS = CEAL_GATEWAY_INSTALLATION_ACTIVATION_CODE_DATA_CHARACTERS + CEAL_GATEWAY_INSTALLATION_ACTIVATION_CODE_CHECK_CHARACTERS;
|
|
561
|
+
|
|
550
562
|
// packages/ceal-client-protocol/src/host-registration.ts
|
|
551
563
|
var CEAL_HOST_REGISTRATION_RESULT_KEYS = Object.freeze(["credential_generation", "host_access_token", "host_installation_ref", "host_source_ref", "ok", "registration_attempt_ref", "schema_version", "status"]);
|
|
552
564
|
|
|
@@ -1121,7 +1133,7 @@ var CEAL_ACTOR_KINDS = vocabulary(["human", "bot", "app", "unknown"]);
|
|
|
1121
1133
|
// packages/ceal-client-protocol/src/leased-consumer-vocabulary.ts
|
|
1122
1134
|
var CEAL_TERMINAL_DISPOSITIONS = vocabulary(["completed", "failed", "cancelled"]);
|
|
1123
1135
|
var CEAL_LEASE_DISPOSITIONS = vocabulary([...CEAL_TERMINAL_DISPOSITIONS, "deferred"]);
|
|
1124
|
-
var CEAL_AUTOMATIC_FEEDBACK_INTENTS = vocabulary(["
|
|
1136
|
+
var CEAL_AUTOMATIC_FEEDBACK_INTENTS = vocabulary(["initial"]);
|
|
1125
1137
|
var CEAL_LEASED_MESSAGE_DELIVERY_CAPABILITY_IDS = vocabulary(["message.create", "message.update", "message.delete"]);
|
|
1126
1138
|
var CEAL_REPOSITORY_VISIBILITIES = vocabulary(["public", "private", "internal"]);
|
|
1127
1139
|
var CEAL_RESULT_DELIVERY_OFFERS = vocabulary(["pending", "offered", "transport_lost"]);
|
|
@@ -1261,6 +1273,7 @@ function isAbsoluteNormalizedNonRootPath(value, flavor = process.platform, allow
|
|
|
1261
1273
|
// host/producer-service.ts
|
|
1262
1274
|
var MAX_CONFIG_BYTES = 32 * 1024;
|
|
1263
1275
|
var SAFE_REF2 = /^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$/u;
|
|
1276
|
+
var HOST_PRODUCER_SERVE_COMMAND_PREFIX = ["serve", "--config"];
|
|
1264
1277
|
var HostProducerServiceError = class extends Error {
|
|
1265
1278
|
code;
|
|
1266
1279
|
constructor(code, message = code) {
|
|
@@ -1297,7 +1310,7 @@ function hostProducerError(code, message = code) {
|
|
|
1297
1310
|
return new HostProducerServiceError(code, message);
|
|
1298
1311
|
}
|
|
1299
1312
|
function parseProducerServeArgs(args, platform, error) {
|
|
1300
|
-
if (args.length !==
|
|
1313
|
+
if (args.length !== HOST_PRODUCER_SERVE_COMMAND_PREFIX.length + 1 || args[0] !== HOST_PRODUCER_SERVE_COMMAND_PREFIX[0] || args[1] !== HOST_PRODUCER_SERVE_COMMAND_PREFIX[1]) throw error("invalid_arguments", refusalFact("args", args, "serve --config <absolute path>"));
|
|
1301
1314
|
assertProducerAbsolutePath(args[2], platform, "config", error);
|
|
1302
1315
|
return args[2];
|
|
1303
1316
|
}
|
|
@@ -1431,6 +1444,7 @@ function boundedMilliseconds(value) {
|
|
|
1431
1444
|
// host/relay/src/producer-frame.ts
|
|
1432
1445
|
var HOST_PRODUCER_FRAME_SCHEMA = "ceal.host_producer_frame.v1";
|
|
1433
1446
|
var HOST_PRODUCER_MAX_JSON_BYTES = 262144;
|
|
1447
|
+
var HOST_PRODUCER_FRAME_LENGTH_BYTES = Uint32Array.BYTES_PER_ELEMENT;
|
|
1434
1448
|
var SAFE_REF3 = /^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$/u;
|
|
1435
1449
|
var DIGEST2 = /^[a-f0-9]{64}$/u;
|
|
1436
1450
|
var PRODUCERS = /* @__PURE__ */ new Set(["codex", "claude"]);
|
|
@@ -1450,18 +1464,18 @@ function encodeHostProducerFrame(frame) {
|
|
|
1450
1464
|
validateFrame(frame);
|
|
1451
1465
|
const json = Buffer.from(JSON.stringify(frame), "utf8");
|
|
1452
1466
|
if (json.byteLength > HOST_PRODUCER_MAX_JSON_BYTES) throw new HostProducerFrameError("frame_too_large", `frame_too_large: ${refusalFact("frame_bytes", json.byteLength, `at most ${HOST_PRODUCER_MAX_JSON_BYTES}`)}`);
|
|
1453
|
-
const result = Buffer.allocUnsafe(json.byteLength +
|
|
1467
|
+
const result = Buffer.allocUnsafe(json.byteLength + HOST_PRODUCER_FRAME_LENGTH_BYTES);
|
|
1454
1468
|
result.writeUInt32BE(json.byteLength, 0);
|
|
1455
|
-
json.copy(result,
|
|
1469
|
+
json.copy(result, HOST_PRODUCER_FRAME_LENGTH_BYTES);
|
|
1456
1470
|
return result;
|
|
1457
1471
|
}
|
|
1458
1472
|
function decodeHostProducerFrame(input) {
|
|
1459
|
-
if (input.byteLength <
|
|
1473
|
+
if (input.byteLength < HOST_PRODUCER_FRAME_LENGTH_BYTES) throw new HostProducerFrameError("frame_truncated", `frame_truncated: ${refusalFact("frame_bytes", input.byteLength, `at least ${HOST_PRODUCER_FRAME_LENGTH_BYTES}`)}`);
|
|
1460
1474
|
const length = input.readUInt32BE(0);
|
|
1461
1475
|
if (length > HOST_PRODUCER_MAX_JSON_BYTES) throw new HostProducerFrameError("frame_too_large", `frame_too_large: ${refusalFact("declared_bytes", length, `at most ${HOST_PRODUCER_MAX_JSON_BYTES}`)}`);
|
|
1462
1476
|
if (length === 0) throw new HostProducerFrameError("invalid_frame_length");
|
|
1463
|
-
if (input.byteLength !== length +
|
|
1464
|
-
const bytes = input.subarray(
|
|
1477
|
+
if (input.byteLength !== length + HOST_PRODUCER_FRAME_LENGTH_BYTES) throw new HostProducerFrameError(input.byteLength < length + HOST_PRODUCER_FRAME_LENGTH_BYTES ? "frame_truncated" : "invalid_frame_length");
|
|
1478
|
+
const bytes = input.subarray(HOST_PRODUCER_FRAME_LENGTH_BYTES);
|
|
1465
1479
|
const text = new TextDecoder("utf-8", { fatal: true });
|
|
1466
1480
|
let value;
|
|
1467
1481
|
try {
|
|
@@ -1608,6 +1622,8 @@ var HOST_RELAY_REQUEST_BINDING_KEYS = Object.freeze([
|
|
|
1608
1622
|
"host_input_ref"
|
|
1609
1623
|
]);
|
|
1610
1624
|
var HOST_RELAY_IPC_RESPONSE_SCHEMA = "ceal.host_relay_admission.v1";
|
|
1625
|
+
var HOST_RELAY_IPC_LENGTH_BYTES = Uint32Array.BYTES_PER_ELEMENT;
|
|
1626
|
+
var HOST_RELAY_ADMISSION_RESPONSE_MAX_BYTES = 4096;
|
|
1611
1627
|
var HostRelayIpcError = class extends Error {
|
|
1612
1628
|
code;
|
|
1613
1629
|
constructor(code, message = code) {
|
|
@@ -1661,12 +1677,12 @@ function exchange(endpoint, encoded, timeoutMs, decode) {
|
|
|
1661
1677
|
});
|
|
1662
1678
|
}
|
|
1663
1679
|
function decodeHostRelayIpcResponse(input) {
|
|
1664
|
-
if (input.length <
|
|
1680
|
+
if (input.length < HOST_RELAY_IPC_LENGTH_BYTES) throw new HostRelayIpcError("relay_unavailable", `Host Relay IPC response is truncated: ${refusalFact("response_bytes", input.byteLength, `at least ${HOST_RELAY_IPC_LENGTH_BYTES}`)}.`);
|
|
1665
1681
|
const length = input.readUInt32BE(0);
|
|
1666
|
-
if (length === 0 || length >
|
|
1682
|
+
if (length === 0 || length > HOST_RELAY_ADMISSION_RESPONSE_MAX_BYTES || input.length !== length + HOST_RELAY_IPC_LENGTH_BYTES) throw new HostRelayIpcError("relay_unavailable", `Host Relay IPC response length is invalid: ${refusalFacts([{ name: "declared_bytes", value: length, expected: `between 1 and ${HOST_RELAY_ADMISSION_RESPONSE_MAX_BYTES}` }, { name: "received_bytes", value: input.byteLength, expected: `exactly ${length + HOST_RELAY_IPC_LENGTH_BYTES}` }])}.`);
|
|
1667
1683
|
let value;
|
|
1668
1684
|
try {
|
|
1669
|
-
value = JSON.parse(new TextDecoder("utf-8", { fatal: true }).decode(input.subarray(
|
|
1685
|
+
value = JSON.parse(new TextDecoder("utf-8", { fatal: true }).decode(input.subarray(HOST_RELAY_IPC_LENGTH_BYTES)));
|
|
1670
1686
|
} catch {
|
|
1671
1687
|
throw new HostRelayIpcError("relay_unavailable", "Host Relay IPC response is invalid.");
|
|
1672
1688
|
}
|
|
@@ -1689,11 +1705,11 @@ function record2(value) {
|
|
|
1689
1705
|
return value !== null && typeof value === "object" && !Array.isArray(value);
|
|
1690
1706
|
}
|
|
1691
1707
|
function decodeResponseBuffer(buffer) {
|
|
1692
|
-
if (buffer.length <
|
|
1708
|
+
if (buffer.length < HOST_RELAY_IPC_LENGTH_BYTES) return null;
|
|
1693
1709
|
const length = buffer.readUInt32BE(0);
|
|
1694
|
-
if (length === 0 || length >
|
|
1695
|
-
if (buffer.length < length +
|
|
1696
|
-
if (buffer.length !== length +
|
|
1710
|
+
if (length === 0 || length > HOST_RELAY_ADMISSION_RESPONSE_MAX_BYTES) throw new HostRelayIpcError("relay_unavailable", `Host Relay IPC response length is invalid: ${refusalFact("declared_bytes", length, `between 1 and ${HOST_RELAY_ADMISSION_RESPONSE_MAX_BYTES}`)}.`);
|
|
1711
|
+
if (buffer.length < length + HOST_RELAY_IPC_LENGTH_BYTES) return null;
|
|
1712
|
+
if (buffer.length !== length + HOST_RELAY_IPC_LENGTH_BYTES) throw new HostRelayIpcError("relay_unavailable", `Host Relay IPC returned trailing bytes: ${refusalFacts([{ name: "declared_bytes", value: length, expected: `the received message length minus ${HOST_RELAY_IPC_LENGTH_BYTES}` }, { name: "received_bytes", value: buffer.byteLength, expected: `exactly ${length + HOST_RELAY_IPC_LENGTH_BYTES}` }])}.`);
|
|
1697
1713
|
return decodeHostRelayIpcResponse(buffer);
|
|
1698
1714
|
}
|
|
1699
1715
|
|
|
@@ -1824,6 +1840,7 @@ function isRecord2(value) {
|
|
|
1824
1840
|
|
|
1825
1841
|
// host/codex/src/codex-outbox.ts
|
|
1826
1842
|
var SAFE_REF4 = /^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$/u;
|
|
1843
|
+
var CODEX_TRANSCRIPT_PATH_MAX_CHARACTERS = 4096;
|
|
1827
1844
|
var CodexOutboxStore = class {
|
|
1828
1845
|
directory;
|
|
1829
1846
|
entriesDirectory;
|
|
@@ -2190,13 +2207,13 @@ function validateRegistration(value) {
|
|
|
2190
2207
|
}
|
|
2191
2208
|
function validateRegistrationFields(value) {
|
|
2192
2209
|
if (![value.host_source_ref, value.host_session_ref, value.codex_session_id].every((candidate) => typeof candidate === "string" && SAFE_REF4.test(candidate))) throw storageError(`Codex transcript registration references are malformed (${refusalFacts([{ name: "host_source_ref", value: value.host_source_ref }, { name: "host_session_ref", value: value.host_session_ref }, { name: "codex_session_id", value: value.codex_session_id }])}).`);
|
|
2193
|
-
if (!validRegistrationCwd(value.cwd)) throw storageError(`Codex transcript registration working directory is malformed (${refusalFact("cwd_characters", typeof value.cwd === "string" ? value.cwd.length : 0,
|
|
2210
|
+
if (!validRegistrationCwd(value.cwd)) throw storageError(`Codex transcript registration working directory is malformed (${refusalFact("cwd_characters", typeof value.cwd === "string" ? value.cwd.length : 0, `an absolute path of at most ${CODEX_TRANSCRIPT_PATH_MAX_CHARACTERS} characters`)}).`);
|
|
2194
2211
|
if (typeof value.transcript_path !== "string") throw storageError(`Codex transcript registration path is malformed (${refusalFact("kind", typeof value.transcript_path, "string")}).`);
|
|
2195
|
-
if (value.transcript_path.length === 0 || value.transcript_path.length >
|
|
2212
|
+
if (value.transcript_path.length === 0 || value.transcript_path.length > CODEX_TRANSCRIPT_PATH_MAX_CHARACTERS) throw storageError(`Codex transcript registration path is malformed (${refusalFact("characters", value.transcript_path.length, `from 1 through ${CODEX_TRANSCRIPT_PATH_MAX_CHARACTERS}`)}).`);
|
|
2196
2213
|
if (!isTimestamp(value.registered_at) || !isTimestamp(value.expires_at)) throw storageError(`Codex transcript registration timestamps are malformed (${refusalFacts([{ name: "registered_at", value: value.registered_at }, { name: "expires_at", value: value.expires_at }])}).`);
|
|
2197
2214
|
}
|
|
2198
2215
|
function validRegistrationCwd(value) {
|
|
2199
|
-
return value === void 0 || typeof value === "string" && isAbsolute(value) && value.length <=
|
|
2216
|
+
return value === void 0 || typeof value === "string" && isAbsolute(value) && value.length <= CODEX_TRANSCRIPT_PATH_MAX_CHARACTERS && !value.includes("\0");
|
|
2200
2217
|
}
|
|
2201
2218
|
function validateCursor(value) {
|
|
2202
2219
|
if (!isRecord3(value)) throw storageError("Codex transcript cursor is malformed.");
|