@corca-org/ceal-host-win32-x64 1.0.22 → 1.0.24
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/ceal-host-background.exe +0 -0
- package/libexec/ceal-host/claude-hook.mjs +682 -331
- package/libexec/ceal-host/claude-invocation-authentication.mjs +730 -349
- package/libexec/ceal-host/claude-producer.mjs +472 -125
- package/libexec/ceal-host/codex-hook.mjs +604 -317
- package/libexec/ceal-host/codex-invocation-authentication.mjs +653 -333
- package/libexec/ceal-host/codex-producer.mjs +396 -109
- package/libexec/ceal-host/control.mjs +589 -206
- package/libexec/ceal-host/relay.mjs +113 -61
- package/package.json +1 -1
- package/share/ceal-host/bundle-manifest.json +22 -12
- package/share/ceal-host/bundle-manifest.sigstore.json +1 -1
|
@@ -2,6 +2,18 @@
|
|
|
2
2
|
import { createRequire as __cealCreateRequire } from "node:module";
|
|
3
3
|
const require = __cealCreateRequire(import.meta.url);
|
|
4
4
|
|
|
5
|
+
// packages/ceal-client-protocol/src/vocabulary.ts
|
|
6
|
+
function vocabulary(words) {
|
|
7
|
+
return Object.freeze(words);
|
|
8
|
+
}
|
|
9
|
+
function isVocabularyWord(words, value) {
|
|
10
|
+
return words.some((word) => word === value);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
// packages/ceal-client-protocol/src/host-usage-fields.ts
|
|
14
|
+
var CEAL_CODEX_USAGE_COUNT_FIELDS = vocabulary(["input_tokens", "cached_input_tokens", "cache_write_input_tokens", "output_tokens", "reasoning_output_tokens", "total_tokens"]);
|
|
15
|
+
var CEAL_CLAUDE_USAGE_COUNT_FIELDS = vocabulary(["input_tokens", "cache_read_input_tokens", "cache_creation_input_tokens", "output_tokens"]);
|
|
16
|
+
|
|
5
17
|
// packages/ceal-client-protocol/src/canonical-json.ts
|
|
6
18
|
function cealCanonicalJson(value) {
|
|
7
19
|
if (value === null || typeof value === "string" || typeof value === "boolean") return JSON.stringify(value);
|
|
@@ -76,7 +88,7 @@ var client_wire_contract_default = {
|
|
|
76
88
|
},
|
|
77
89
|
command_request: {
|
|
78
90
|
schema_name: "ceal.command_request",
|
|
79
|
-
fields: ["schema_version", "argv", "operation", "client_nonce", "context_token", "request_context"],
|
|
91
|
+
fields: ["schema_version", "argv", "operation", "client_nonce", "context_token", "request_context", "materialize_result"],
|
|
80
92
|
absolute_transport_max_bytes: 65536
|
|
81
93
|
},
|
|
82
94
|
command_resolution: {
|
|
@@ -122,7 +134,7 @@ var client_wire_contract_default = {
|
|
|
122
134
|
},
|
|
123
135
|
command_response: {
|
|
124
136
|
schema_name: "ceal.command_response",
|
|
125
|
-
fields: ["schema_version", "exit_code", "document", "operation_id", "visible_output_max_bytes", "local_delivery", "verified_artifact", "request_context"],
|
|
137
|
+
fields: ["schema_version", "exit_code", "document", "operation_id", "visible_output_max_bytes", "local_delivery", "verified_artifact", "request_context", "result_file"],
|
|
126
138
|
descriptor_field: "verified_artifact",
|
|
127
139
|
request_context_field: "request_context",
|
|
128
140
|
required_fields: [
|
|
@@ -135,7 +147,8 @@ var client_wire_contract_default = {
|
|
|
135
147
|
"visible_output_max_bytes",
|
|
136
148
|
"local_delivery",
|
|
137
149
|
"verified_artifact",
|
|
138
|
-
"request_context"
|
|
150
|
+
"request_context",
|
|
151
|
+
"result_file"
|
|
139
152
|
],
|
|
140
153
|
bare_document_fields: [
|
|
141
154
|
"invocation",
|
|
@@ -176,8 +189,11 @@ var client_wire_contract_default = {
|
|
|
176
189
|
"ok",
|
|
177
190
|
"code",
|
|
178
191
|
"reason",
|
|
179
|
-
"gateway_status"
|
|
192
|
+
"gateway_status",
|
|
193
|
+
"retry_after_ms"
|
|
180
194
|
],
|
|
195
|
+
refusal_required_fields: ["schema_version", "ok", "code", "reason"],
|
|
196
|
+
refusal_optional_fields: ["gateway_status", "retry_after_ms"],
|
|
181
197
|
client_nonce: {
|
|
182
198
|
character_class_source: "A-Za-z0-9_-",
|
|
183
199
|
encoded_characters: 43
|
|
@@ -396,19 +412,14 @@ var CEAL_OPERATION_WITHHELD_NEXT_ACTIONS = Object.freeze({
|
|
|
396
412
|
personal_authorization_required: "connect_personal_account"
|
|
397
413
|
});
|
|
398
414
|
|
|
399
|
-
// packages/ceal-client-protocol/src/vocabulary.ts
|
|
400
|
-
function vocabulary(words) {
|
|
401
|
-
return Object.freeze(words);
|
|
402
|
-
}
|
|
403
|
-
function isVocabularyWord(words, value) {
|
|
404
|
-
return words.some((word) => word === value);
|
|
405
|
-
}
|
|
406
|
-
|
|
407
415
|
// packages/ceal-client-protocol/src/gateway-response-types.ts
|
|
408
416
|
var CEAL_OPERATION_READINESS_VALUES = vocabulary(["ready", "degraded", "unavailable", "unknown"]);
|
|
409
417
|
var CEAL_TARGET_REQUIREMENTS = vocabulary(["required", "optional", "none"]);
|
|
410
418
|
var CEAL_AUDIT_OUTCOMES = vocabulary(["succeeded", "denied", "failed"]);
|
|
411
419
|
var CEAL_GATEWAY_PROVIDER_STEP_OUTCOMES = vocabulary(["completed", "rejected", "throttled", "failed"]);
|
|
420
|
+
var CEAL_GATEWAY_CORPUS_READ_PROVIDERS = vocabulary(["slack", "google_drive", "notion"]);
|
|
421
|
+
var CEAL_GATEWAY_CORPUS_READ_OUTCOMES = vocabulary(["answered_from_corpus", "live_fallback"]);
|
|
422
|
+
var CEAL_GATEWAY_CORPUS_READ_FALLBACK_REASONS = vocabulary(["uncovered_window", "stale", "not_organization_public", "partition_missing"]);
|
|
412
423
|
var CEAL_GATEWAY_READ_REUSE_DISPOSITIONS = vocabulary(["response_cache_hit", "corpus_hit", "corpus_hit_after_revalidation", "corpus_partial_provider_supplement", "provider_direct", "provider_continuation", "reuse_unavailable"]);
|
|
413
424
|
var CEAL_GATEWAY_READ_REUSE_UNAVAILABLE_REASONS = vocabulary(["not_reported", "storage_unavailable", "coverage_incomplete", "freshness_refresh_required", "not_reusable", "bypassed"]);
|
|
414
425
|
var CEAL_GATEWAY_DERIVED_STORE_FAILURE_CLASSES = vocabulary(["storage_unavailable", "decode_mismatch", "write_conflict", "quota", "store_error"]);
|
|
@@ -449,6 +460,21 @@ var CEAL_GATEWAY_ORGANIZATION_ROUTE_FACT_CALL_KEYS = Object.freeze([
|
|
|
449
460
|
]);
|
|
450
461
|
|
|
451
462
|
// packages/ceal-client-protocol/src/gateway-validation-primitives.ts
|
|
463
|
+
var POSIX_HOME_ROOTS = [["/", "home"].join(""), ["/", "Users"].join("")];
|
|
464
|
+
var WINDOWS_HOME_ROOT = ["C:", "\\", "Users"].join("");
|
|
465
|
+
var USER_SEGMENT_BODY = "[^/\\\\ \\t\\r\\n\"'`${}]+";
|
|
466
|
+
var POSIX_SEGMENT_END = "(?:/|$|(?=[\\s\"'`]))";
|
|
467
|
+
var WINDOWS_SEGMENT_END = "(?:\\\\+|$|(?=[\\s\"'`]))";
|
|
468
|
+
var WINDOWS_USER_SEGMENT_BODY = "[^\\\\ \\t\\r\\n\"'`${}]+";
|
|
469
|
+
var ABSOLUTE_PATH_BOUNDARY = "(?<![A-Za-z0-9_])";
|
|
470
|
+
function escapePathPattern(value) {
|
|
471
|
+
return value.replace(/[.*+?^${}()|[\]\\]/gu, "\\$&");
|
|
472
|
+
}
|
|
473
|
+
function machineHomePathPatterns(flags) {
|
|
474
|
+
const posix4 = `${ABSOLUTE_PATH_BOUNDARY}(?:${POSIX_HOME_ROOTS.map(escapePathPattern).join("|")})/${USER_SEGMENT_BODY}${POSIX_SEGMENT_END}`;
|
|
475
|
+
const windows = `${ABSOLUTE_PATH_BOUNDARY}${escapePathPattern(WINDOWS_HOME_ROOT)}\\\\+${WINDOWS_USER_SEGMENT_BODY}${WINDOWS_SEGMENT_END}`;
|
|
476
|
+
return [new RegExp(posix4, flags), new RegExp(windows, flags)];
|
|
477
|
+
}
|
|
452
478
|
var CealProtocolValidationError = class extends Error {
|
|
453
479
|
name = "CealProtocolValidationError";
|
|
454
480
|
code;
|
|
@@ -799,8 +825,9 @@ var GATEWAY_TRANSPORT_UNAVAILABLE = "The Gateway transport is unavailable; ask a
|
|
|
799
825
|
var HOST_AUTHENTICATION_UNAVAILABLE = "The Host could not authenticate this invocation; report this as a gap.";
|
|
800
826
|
var CLIENT_HOST_RELEASE_MISMATCH = "Install or upgrade the Ceal CLI and Host Relay to the same release as the Gateway, then retry.";
|
|
801
827
|
var HOST_INSTALL_REPAIR = "The local Host or Relay is missing, stale, or unavailable. Run `ceal-host install`, then `ceal-host discovery sync`, and retry from a new producer conversation.";
|
|
802
|
-
var HOST_CONTEXT_UNAVAILABLE = "The Host could not select
|
|
828
|
+
var HOST_CONTEXT_UNAVAILABLE = "The Host could not select this turn; reason uncertain. Host mode is unavailable in an ephemeral side conversation. When you know you are in one, `ceal --standalone ...` uses your configured Ceal session/Gateway permissions, without Host session/turn correlation or Host usage attribution. Unknown-outcome `repeat_request` needs the same Host turn or explicit `--request-context`. Otherwise return to the original regular conversation. Host refusal never switches modes; report intended Host calls as a gap.";
|
|
803
829
|
var SESSION_CONTEXT_UNAVAILABLE = "The local Gateway session context is unavailable.";
|
|
830
|
+
var SESSION_ADOPT_RECOVERY = "The refresh Session is no longer usable. Run `ceal session adopt --gateway <origin> --email <email>` to complete mailbox-confirmed recovery.";
|
|
804
831
|
function guidance(message, next_action, http_status, retryable = false, redaction_class = "model_safe") {
|
|
805
832
|
return Object.freeze({ message, next_action, http_status, retryable, redaction_class });
|
|
806
833
|
}
|
|
@@ -821,13 +848,18 @@ var CEAL_FAILURE_GUIDANCE_TABLE = Object.freeze({
|
|
|
821
848
|
context_not_selected: guidance(SESSION_CONTEXT_UNAVAILABLE, "repair_or_adopt_session", 401),
|
|
822
849
|
context_store_invalid: guidance(SESSION_CONTEXT_UNAVAILABLE, "repair_or_adopt_session", 401),
|
|
823
850
|
context_store_conflict: guidance(SESSION_CONTEXT_UNAVAILABLE, "repair_or_adopt_session", 401),
|
|
824
|
-
refresh_invalid: guidance(
|
|
825
|
-
refresh_expired: guidance(
|
|
826
|
-
refresh_replayed: guidance(
|
|
827
|
-
refresh_revoked: guidance(
|
|
828
|
-
person_inactive: guidance("The Person is inactive, so the Gateway refused this refresh without revoking the Session family.", "ask_admin", 403),
|
|
829
|
-
principal_inactive: guidance("The Principal is inactive, so the Gateway refused this refresh without revoking the Session family.", "ask_admin", 403),
|
|
830
|
-
|
|
851
|
+
refresh_invalid: guidance(SESSION_ADOPT_RECOVERY, "repair_or_adopt_session", 401),
|
|
852
|
+
refresh_expired: guidance(SESSION_ADOPT_RECOVERY, "repair_or_adopt_session", 401),
|
|
853
|
+
refresh_replayed: guidance(SESSION_ADOPT_RECOVERY, "repair_or_adopt_session", 401),
|
|
854
|
+
refresh_revoked: guidance(SESSION_ADOPT_RECOVERY, "repair_or_adopt_session", 401),
|
|
855
|
+
person_inactive: guidance("The Person is inactive, so the Gateway refused this refresh without revoking the Session family. Ask an Admin to reactivate the Person, then retry this same session refresh.", "ask_admin", 403),
|
|
856
|
+
principal_inactive: guidance("The Principal is inactive, so the Gateway refused this refresh without revoking the Session family. Ask an Admin to reactivate the Principal, then retry this same session refresh.", "ask_admin", 403),
|
|
857
|
+
authority_replaced: guidance("The Gateway authority has been replaced; this session is no longer valid here. Run `ceal session adopt --gateway <origin> --email <email>` against the current Gateway to complete mailbox-confirmed recovery.", "repair_or_adopt_session", 409),
|
|
858
|
+
refresh_inactive: guidance(SESSION_ADOPT_RECOVERY, "repair_or_adopt_session", 410),
|
|
859
|
+
refresh_recovery_unavailable: guidance("The Gateway's durable refresh-recovery key is unavailable. Retry the same refresh attempt after the key is available.", "retry", 503, true),
|
|
860
|
+
refresh_recovery_outcome_unavailable: guidance("The Gateway could not safely recover the outcome of a prior refresh. Ask an administrator to inspect the Gateway session state before retrying or adopting this session.", "ask_admin", 503),
|
|
861
|
+
refresh_state_unavailable: guidance("The Gateway session state store is temporarily unavailable; retry the same refresh attempt when it is available.", "retry", 503, true),
|
|
862
|
+
refresh_recovery_expired: guidance(SESSION_ADOPT_RECOVERY, "repair_or_adopt_session", 410),
|
|
831
863
|
refresh_custody_invalid: guidance(SESSION_CONTEXT_UNAVAILABLE, "repair_or_adopt_session", 401),
|
|
832
864
|
session_store_unwritable: guidance("The Ceal client could not write its local session store; the operating system refused the write (EACCES, EPERM, or EROFS). rerun_outside_agent_sandbox reruns it with escalated execution.", "rerun_outside_agent_sandbox", 500),
|
|
833
865
|
local_output_exists: guidance("The selected local output path already exists; nothing was written to it.", "choose_new_output_path", 400),
|
|
@@ -842,23 +874,21 @@ var CEAL_FAILURE_GUIDANCE_TABLE = Object.freeze({
|
|
|
842
874
|
resource_stream_failed: guidance("The provider resource stream failed; ask an administrator to inspect the Gateway failure log.", "ask_admin", 500),
|
|
843
875
|
gateway_unavailable: guidance(GATEWAY_TRANSPORT_UNAVAILABLE, "ask_admin", 503, true),
|
|
844
876
|
contract_mismatch: guidance(CLIENT_HOST_RELEASE_MISMATCH, "upgrade_ceal_client", 409),
|
|
845
|
-
//
|
|
846
|
-
|
|
847
|
-
// when the wait ends still unserved, moved from the `localFailureText` default branch.
|
|
848
|
-
[CEAL_GATEWAY_STARTING_FAILURE_CODE]: guidance(LOCAL_TRANSPORT_INCOMPLETE, "answer_with_gap", 503, true),
|
|
877
|
+
// The serving gate answers before refresh execution, so retrying the same attempt is safe.
|
|
878
|
+
[CEAL_GATEWAY_STARTING_FAILURE_CODE]: guidance("The Gateway is still starting; the refresh was not attempted and the refresh token was not consumed. Retry the same refresh attempt after the Gateway is serving.", "retry", 503, true),
|
|
849
879
|
gateway_internal_error: guidance("The Gateway failed without exposing internal state; report this as a gap.", "answer_with_gap", 500),
|
|
850
880
|
// The serving gate emits this code with no message; the sentence is the owner-normalized form of the
|
|
851
881
|
// `gateway_internal_error` guidance (decided with the operator 2026-10-13).
|
|
852
882
|
internal_error: guidance("The Gateway failed without exposing internal state.", "answer_with_gap", 500),
|
|
853
883
|
// Owned by the Gateway canonical adapter (`gateway/core/src/gateway-canonical-operation-http-adapter.ts`):
|
|
854
|
-
// the client variant
|
|
884
|
+
// the static client variant was retired when the client started reading this table.
|
|
855
885
|
request_body_too_large: guidance("The Gateway request body exceeds its bounded limit.", "reduce_request_size", 413),
|
|
856
886
|
gateway_response_too_large: guidance("The Gateway response exceeds its bounded limit; reduce the requested page or result size.", "reduce_request_size", 500),
|
|
857
|
-
//
|
|
858
|
-
//
|
|
859
|
-
|
|
860
|
-
//
|
|
861
|
-
|
|
887
|
+
// The safe move varies by request. Keep the sentence conditional on the
|
|
888
|
+
// same `retryable` and `next_action` facts the response exposes.
|
|
889
|
+
unknown_outcome: guidance("The transport outcome is unknown; use retryable and next_action to decide whether it can be repeated.", "answer_with_gap", 500),
|
|
890
|
+
// A provider write the Gateway command deadline cut after its dispatch: the write left and its receipt is still settling, so the caller reads the receipt instead of repeating the write.
|
|
891
|
+
write_in_progress: guidance("The provider write was dispatched but the Gateway command deadline cut the wait before its outcome settled. Do not repeat the write; read the durable receipt named by write_request_ref with write_receipt.get.", "write_receipt.get", 500),
|
|
862
892
|
// Restored verbatim from the retired `localFailureText`
|
|
863
893
|
// `refresh_unknown_outcome` case: a refresh that ends unknown leaves the
|
|
864
894
|
// session context unavailable, so the caller repairs or adopts the
|
|
@@ -939,8 +969,8 @@ var CEAL_FAILURE_GUIDANCE_TABLE = Object.freeze({
|
|
|
939
969
|
// Host mint classifications. The CLI emits `invocation_authentication_unavailable` with the classification
|
|
940
970
|
// in its detail fact; rows without their own sentence share that code's moved sentence, while `next_action`
|
|
941
971
|
// is moved from `canonicalHostAuthenticationNextActions` (generated from `CEAL_HOST_AUTHENTICATION_POLICY`)
|
|
942
|
-
// and `retryable` from `hostAuthenticationFailureForCause` (
|
|
943
|
-
// sentences carry the
|
|
972
|
+
// and `retryable` from `hostAuthenticationFailureForCause` (the table's explicit retry verdict). Cause-specific
|
|
973
|
+
// sentences carry only remedies proved by the Host or Relay cause; generic Gateway refusals do not prove a release mismatch.
|
|
944
974
|
// Statuses are the
|
|
945
975
|
// Gateway-owned mapping decided with the operator 2026-10-13. This covers every wire cause the maps at
|
|
946
976
|
// `host/invocation-authentication-command.ts:217-242` emit, through their policy classifications.
|
|
@@ -950,21 +980,23 @@ var CEAL_FAILURE_GUIDANCE_TABLE = Object.freeze({
|
|
|
950
980
|
// The bounded Host reason does not prove ephemerality. A Host refusal never
|
|
951
981
|
// changes mode; standalone remains the separate Client authority path.
|
|
952
982
|
host_context_unavailable: guidance(HOST_CONTEXT_UNAVAILABLE, "answer_with_gap", 401),
|
|
953
|
-
|
|
954
|
-
|
|
983
|
+
host_context_activation_wait_exhausted: guidance("The Host selected this turn, but its invocation context did not activate before the bounded wait ended. Wait for the supplied retry_after_ms value, then retry the same command.", "retry_after", 401, true),
|
|
984
|
+
host_invocation_context_stale: guidance("The Host turn changed while this invocation was authenticating. Its command cannot be rebound safely; report this invocation as a gap.", "answer_with_gap", 401),
|
|
985
|
+
host_invocation_context_expired: guidance("The Host invocation context expired before authentication completed. This invocation cannot be retried in the expired turn; report it as a gap.", "answer_with_gap", 401),
|
|
955
986
|
host_source_refused: guidance(HOST_AUTHENTICATION_UNAVAILABLE, "answer_with_gap", 403),
|
|
956
987
|
host_registration_credential_refused: guidance(HOST_AUTHENTICATION_UNAVAILABLE, "ask_admin", 403),
|
|
957
988
|
host_mint_gateway_unavailable: guidance(HOST_AUTHENTICATION_UNAVAILABLE, "ask_admin", 503),
|
|
958
989
|
host_mint_gateway_rate_limited: guidance(HOST_AUTHENTICATION_UNAVAILABLE, "answer_with_gap", 429),
|
|
959
|
-
host_mint_gateway_refused: guidance(
|
|
990
|
+
host_mint_gateway_refused: guidance(HOST_AUTHENTICATION_UNAVAILABLE, "answer_with_gap", 502),
|
|
960
991
|
host_mint_gateway_response_invalid: guidance(HOST_AUTHENTICATION_UNAVAILABLE, "answer_with_gap", 502),
|
|
992
|
+
host_contract_mismatch: guidance(CLIENT_HOST_RELEASE_MISMATCH, "upgrade_ceal_client", 502),
|
|
961
993
|
// Moved from the retired `CEAL_HOST_AUTHENTICATION_POLICY` remedy: the
|
|
962
994
|
// producer-frame fault names the administrator repair step.
|
|
963
995
|
host_producer_frame_invalid: guidance("Ask an administrator to inspect and repair the producer frame, then start a fresh Host turn.", "ask_admin", 400),
|
|
964
996
|
// Moved from the retired `CEAL_HOST_AUTHENTICATION_POLICY` remedy: the
|
|
965
997
|
// sandboxed Relay socket names the run-alone retry.
|
|
966
998
|
host_relay_permission_denied: guidance("An agent sandbox denied the Host Relay socket; run `ceal` as the only command, with no pipe, redirect, or `&&`, so the Host allow rule runs it outside the sandbox.", "rerun_outside_agent_sandbox", 403),
|
|
967
|
-
host_relay_unavailable: guidance(
|
|
999
|
+
host_relay_unavailable: guidance(HOST_AUTHENTICATION_UNAVAILABLE, "answer_with_gap", 503),
|
|
968
1000
|
host_mint_transient_retryable: guidance(HOST_AUTHENTICATION_UNAVAILABLE, "retry", 503, true),
|
|
969
1001
|
host_mint_failed: guidance(HOST_AUTHENTICATION_UNAVAILABLE, "answer_with_gap", 500),
|
|
970
1002
|
host_relay_failed: guidance(HOST_INSTALL_REPAIR, "install_ceal_host", 502),
|
|
@@ -1007,7 +1039,7 @@ var UNKNOWN_OUTCOMES = vocabulary(["reconcile", "operator_action", "excluded"]);
|
|
|
1007
1039
|
var RECOVERY_OWNERS = vocabulary(["gateway", "connector", "operator"]);
|
|
1008
1040
|
var CEAL_OPERATION_ADMISSION_STATES = vocabulary(["proposed", "refused", "admitted"]);
|
|
1009
1041
|
var CEAL_OPERATION_EXECUTION_STATES = vocabulary(["not_started", "started", "completed"]);
|
|
1010
|
-
var CEAL_OPERATION_PROVIDER_HANDOFF_STATES = vocabulary(["not_offered", "offered", "accepted", "rejected", "unknown"]);
|
|
1042
|
+
var CEAL_OPERATION_PROVIDER_HANDOFF_STATES = vocabulary(["not_applicable", "not_offered", "offered", "accepted", "rejected", "unknown"]);
|
|
1011
1043
|
var CEAL_OPERATION_EFFECT_STATES = vocabulary(["none", "applied", "failed", "unknown", "compensated"]);
|
|
1012
1044
|
var CEAL_OPERATION_OBSERVATION_STATES = vocabulary(["not_started", "not_required", "pending", "observed", "unavailable"]);
|
|
1013
1045
|
var CEAL_OPERATION_RECOVERY_KINDS = vocabulary(["none", "reconcile", "compensate", "operator_action"]);
|
|
@@ -1183,6 +1215,7 @@ var CEAL_OPERATION_ACCESS_CLASSES = vocabulary(["read", "write"]);
|
|
|
1183
1215
|
// packages/ceal-client-protocol/src/domain-vocabulary.ts
|
|
1184
1216
|
var CEAL_CONNECTOR_STATUSES = vocabulary(["active", "disabled", "disconnected"]);
|
|
1185
1217
|
var CEAL_CONNECTOR_CUSTODIES = vocabulary(["organization", "personal"]);
|
|
1218
|
+
var CEAL_PROVIDER_BOUNDARY_FIELDS = vocabulary(["provider_boundary_ref", "provider_boundary_kind", "provider_boundary_label", "provider_native_id", "provider_boundary_evidence"]);
|
|
1186
1219
|
var CEAL_PERSONAL_ACCESS_CEILINGS = vocabulary(["disabled", "read", "read_write"]);
|
|
1187
1220
|
var CEAL_TARGET_REF_PATTERN = "^[^\\p{Cc}]+$";
|
|
1188
1221
|
var TARGET_REF = new RegExp(CEAL_TARGET_REF_PATTERN, "u");
|
|
@@ -1228,7 +1261,7 @@ var JSON_DESCRIPTION_CONTROL_CHARACTER = new RegExp("\\p{Cc}", "u");
|
|
|
1228
1261
|
var CEAL_OPERATION_AUTHORITY_POLICY_KEYS = Object.freeze(["access_group", "instance_binding", "target", "admission_recheck"]);
|
|
1229
1262
|
var MAX_OPERATION_INPUT_RESOLVER_BINDINGS = 96;
|
|
1230
1263
|
var CEAL_OPERATION_DESCRIPTOR_REQUIRED_ENVELOPE_KEYS = Object.freeze(["schema_version", "id", "input_contract", "result_contract", "policy"]);
|
|
1231
|
-
var CEAL_OPERATION_DESCRIPTOR_OPTIONAL_ENVELOPE_KEYS = Object.freeze(["input_resolution", "summary"]);
|
|
1264
|
+
var CEAL_OPERATION_DESCRIPTOR_OPTIONAL_ENVELOPE_KEYS = Object.freeze(["input_resolution", "summary", "standard_names"]);
|
|
1232
1265
|
|
|
1233
1266
|
// packages/ceal-client-protocol/src/operation-catalog.ts
|
|
1234
1267
|
var CEAL_OPERATION_CATALOG_SCHEMA_VERSION = "ceal.catalog.v3";
|
|
@@ -1324,6 +1357,7 @@ var CEAL_BOUNDED_SERIES_CATALOG = Object.freeze({
|
|
|
1324
1357
|
gateway_access_group_connector_activity_scope_audit: (root) => join(root, "profile-connector-activity-scope-audit.jsonl"),
|
|
1325
1358
|
gateway_access_group_connector_calendar_scope_audit: (root) => join(root, "profile-connector-calendar-scope-audit.jsonl"),
|
|
1326
1359
|
gateway_access_group_connector_readiness_audit: (root) => join(root, "profile-connector-readiness.audit.jsonl"),
|
|
1360
|
+
gateway_deployment_events: (root) => join(root, "gateway-deployments.jsonl"),
|
|
1327
1361
|
gateway_organization_audit_ledger: (root) => join(root, "organization-ledger.jsonl"),
|
|
1328
1362
|
gateway_personal_client_audit: (root) => join(root, "audit.jsonl"),
|
|
1329
1363
|
gateway_personal_client_access_audit: (root) => join(root, "access-audit.jsonl")
|
|
@@ -1357,6 +1391,11 @@ var CEAL_HOST_INSTALLATION_REF_PATTERN = new RegExp(`^host-installation:${CEAL_L
|
|
|
1357
1391
|
var CEAL_HOST_SOURCE_REF_PATTERN = new RegExp(`^host-source:${CEAL_LOWERCASE_UUID_PATTERN}$`, "u");
|
|
1358
1392
|
var CEAL_HOST_ACCESS_TOKEN_PATTERN = /^ceal_host_[A-Za-z0-9_-]{43}$/u;
|
|
1359
1393
|
|
|
1394
|
+
// packages/ceal-client-protocol/src/resource-read-result.ts
|
|
1395
|
+
var CEAL_RESOURCE_GET_NOTION_CONTENT_GAP_KINDS = Object.freeze(["subtree", "media", "property_schema", "properties"]);
|
|
1396
|
+
var CEAL_RESOURCE_SEARCH_PROVIDER_STATUSES = vocabulary(["done", "pending", "deferred"]);
|
|
1397
|
+
var CEAL_RESOURCE_GET_COVERAGE_NEXT_ACTIONS = vocabulary(["reduce_request_size", "read_resource_again"]);
|
|
1398
|
+
|
|
1360
1399
|
// packages/ceal-client-protocol/src/operation-result-completeness.ts
|
|
1361
1400
|
var CEAL_READ_VALUE_CONTINUATION_KEYS = vocabulary(["continuation", "continuation_ref", "next_cursor"]);
|
|
1362
1401
|
|
|
@@ -1441,6 +1480,7 @@ var PROVIDER_LINK_CONFORMANCE_TABLE = Object.freeze([
|
|
|
1441
1480
|
{ provider: "google-workspace", result_kind: "calendar_event_read_row", field: "source_url", status: "required_when_provider_supplies", provider_shape: "htmlLink", source: "https://developers.google.com/workspace/calendar/api/v3/reference/events" },
|
|
1442
1481
|
{ provider: "google-workspace", result_kind: "drive_document_calendar_write_result", field: "user_openable_url", status: "required_when_provider_supplies", provider_shape: "verified readback webViewLink or htmlLink", source: "https://developers.google.com/workspace/drive/api/reference/rest/v3/files" },
|
|
1443
1482
|
{ provider: "google-workspace", result_kind: "drive_file_write_result", field: "user_openable_url", status: "required_when_provider_supplies", provider_shape: "verified readback webViewLink", source: "https://developers.google.com/workspace/drive/api/reference/rest/v3/files" },
|
|
1483
|
+
{ provider: "google-workspace", result_kind: "form_write_result", field: "user_openable_url", status: "required_when_provider_supplies", provider_shape: "verified Forms responderUri", source: "https://developers.google.com/workspace/forms/api/reference/rest/v1/forms" },
|
|
1444
1484
|
{ provider: "google-workspace", result_kind: "spreadsheet_write_result", field: "spreadsheet_url", status: "required_when_provider_supplies", provider_shape: "verified readback webViewLink", source: "https://developers.google.com/workspace/drive/api/reference/rest/v3/files" },
|
|
1445
1485
|
{ provider: "google-workspace", result_kind: "calendar_meet_link_write_result", field: "meet_url", status: "required_when_provider_supplies", provider_shape: "verified conferenceData entryPoint uri", source: "https://developers.google.com/workspace/calendar/api/v3/reference/events" },
|
|
1446
1486
|
{ provider: "google-workspace", result_kind: "gmail_message_read_row", field: "source_url", status: "not_available", reason: "The Gmail API Message representation exposes id and threadId but no human UI URL; cite by title and date.", source: "https://developers.google.com/workspace/gmail/api/reference/rest/v1/users.messages#Message" },
|
|
@@ -1515,6 +1555,8 @@ var CEAL_ACTIVITY_TIMESTAMP_BASES = vocabulary([
|
|
|
1515
1555
|
"review_submitted",
|
|
1516
1556
|
"comment_created",
|
|
1517
1557
|
"reaction_created",
|
|
1558
|
+
"pull_request_merged",
|
|
1559
|
+
"release_published",
|
|
1518
1560
|
"ceal_write_completed",
|
|
1519
1561
|
"event_start",
|
|
1520
1562
|
"all_day_start",
|
|
@@ -1526,7 +1568,7 @@ var CEAL_ACTIVITY_TIMESTAMP_BASES = vocabulary([
|
|
|
1526
1568
|
"page_last_edited",
|
|
1527
1569
|
"resource_modified"
|
|
1528
1570
|
]);
|
|
1529
|
-
var CEAL_ACTIVITY_CONNECTOR_KINDS = vocabulary(["slack", "github", "google-calendar", "google-drive", "notion"]);
|
|
1571
|
+
var CEAL_ACTIVITY_CONNECTOR_KINDS = vocabulary(["slack", "github", "google-calendar", "google-drive", "google-mail", "notion"]);
|
|
1530
1572
|
var CEAL_ACTIVITY_UNSUPPORTED_EVENT_KIND_CODE = "unsupported_event_kind";
|
|
1531
1573
|
var CEAL_ACTIVITY_GAP_CODES = vocabulary([
|
|
1532
1574
|
"provider_page_budget",
|
|
@@ -1547,6 +1589,8 @@ var CEAL_ACTIVITY_EVENT_KINDS = vocabulary([
|
|
|
1547
1589
|
"github.pull_request.opened",
|
|
1548
1590
|
"github.issue.edited",
|
|
1549
1591
|
"github.pull_request.edited",
|
|
1592
|
+
"github.pull_request.merged",
|
|
1593
|
+
"github.release.published",
|
|
1550
1594
|
"github.review.submitted",
|
|
1551
1595
|
"github.issue_comment.created",
|
|
1552
1596
|
"github.review_comment.created",
|
|
@@ -1560,6 +1604,7 @@ var CEAL_ACTIVITY_EVENT_KINDS = vocabulary([
|
|
|
1560
1604
|
"drive.file.created",
|
|
1561
1605
|
"drive.file.modified",
|
|
1562
1606
|
"drive.file.viewed",
|
|
1607
|
+
"mail.sent",
|
|
1563
1608
|
"notion.page.created",
|
|
1564
1609
|
"notion.page.edited"
|
|
1565
1610
|
]);
|
|
@@ -1573,6 +1618,8 @@ var CEAL_ACTIVITY_EVENT_TIMESTAMP_BASIS_MAP = Object.freeze({
|
|
|
1573
1618
|
"github.review_comment.created": "comment_created",
|
|
1574
1619
|
"github.issue.opened": "resource_created",
|
|
1575
1620
|
"github.pull_request.opened": "resource_created",
|
|
1621
|
+
"github.pull_request.merged": "pull_request_merged",
|
|
1622
|
+
"github.release.published": "release_published",
|
|
1576
1623
|
"github.issue.edited": "resource_modified",
|
|
1577
1624
|
"github.pull_request.edited": "resource_modified",
|
|
1578
1625
|
"github.reaction.created": "reaction_created",
|
|
@@ -1583,6 +1630,7 @@ var CEAL_ACTIVITY_EVENT_TIMESTAMP_BASIS_MAP = Object.freeze({
|
|
|
1583
1630
|
"drive.file.created": "file_created",
|
|
1584
1631
|
"drive.file.modified": "file_modified_by_me",
|
|
1585
1632
|
"drive.file.viewed": "file_viewed_by_me",
|
|
1633
|
+
"mail.sent": "message_created",
|
|
1586
1634
|
"notion.page.created": "page_created",
|
|
1587
1635
|
"notion.page.edited": "page_last_edited"
|
|
1588
1636
|
});
|
|
@@ -1610,6 +1658,7 @@ var RESOURCE_ROW_KEY_RULES = Object.freeze({
|
|
|
1610
1658
|
created_at: { required: false, timestamp: true },
|
|
1611
1659
|
created_at_local: { required: false, timestamp: true },
|
|
1612
1660
|
modified_at: { required: false, timestamp: true },
|
|
1661
|
+
observed_at: { required: false, timestamp: true },
|
|
1613
1662
|
modified_at_local: { required: false, timestamp: true },
|
|
1614
1663
|
viewed_by_me_at: { required: false, timestamp: true },
|
|
1615
1664
|
modified_by_me_at: { required: false, timestamp: true },
|
|
@@ -1637,9 +1686,6 @@ var RESOURCE_ROW_REQUIRED_KEYS = Object.entries(RESOURCE_ROW_KEY_RULES).flatMap(
|
|
|
1637
1686
|
var RESOURCE_ROW_KEYS = new Set(Object.keys(RESOURCE_ROW_KEY_RULES));
|
|
1638
1687
|
var RESOURCE_ROW_TIMESTAMP_KEYS = Object.entries(RESOURCE_ROW_KEY_RULES).flatMap(([key, rule]) => rule.timestamp ? [key] : []);
|
|
1639
1688
|
|
|
1640
|
-
// packages/ceal-client-protocol/src/resource-read-result.ts
|
|
1641
|
-
var CEAL_RESOURCE_GET_COVERAGE_NEXT_ACTIONS = vocabulary(["reduce_request_size", "read_resource_again"]);
|
|
1642
|
-
|
|
1643
1689
|
// packages/ceal-client-protocol/src/excluded-target-coverage.ts
|
|
1644
1690
|
var CEAL_EXCLUDED_TARGET_COVERAGE_MAX_ENTRIES = 64;
|
|
1645
1691
|
function cealExcludedTargetCoverageJsonSchema() {
|
|
@@ -1695,6 +1741,8 @@ var CEAL_REFRESH_FAILURE_CODES = vocabulary([
|
|
|
1695
1741
|
"principal_inactive",
|
|
1696
1742
|
"authority_replaced",
|
|
1697
1743
|
"refresh_recovery_unavailable",
|
|
1744
|
+
"refresh_recovery_outcome_unavailable",
|
|
1745
|
+
"refresh_state_unavailable",
|
|
1698
1746
|
"refresh_recovery_expired",
|
|
1699
1747
|
// The serving gate answers this while the Gateway is still starting and the
|
|
1700
1748
|
// refresh was never attempted; the same attempt stays retryable. It is never
|
|
@@ -2066,6 +2114,7 @@ var CEAL_HOST_AUTHENTICATION_CAUSES = vocabulary([
|
|
|
2066
2114
|
"options_invalid",
|
|
2067
2115
|
"session_unavailable",
|
|
2068
2116
|
"context_unavailable",
|
|
2117
|
+
"activation_wait_exhausted",
|
|
2069
2118
|
"context_replaced",
|
|
2070
2119
|
"no_binding",
|
|
2071
2120
|
"context_expired",
|
|
@@ -2101,22 +2150,23 @@ var CEAL_HOST_AUTHENTICATION_POLICY = Object.freeze({
|
|
|
2101
2150
|
// This reason cannot distinguish a Codex side conversation from a missing
|
|
2102
2151
|
// context in a regular session, so guidance must leave that choice to the caller.
|
|
2103
2152
|
context_unavailable: Object.freeze({ classification: "host_context_unavailable", next_action: "answer_with_gap" }),
|
|
2104
|
-
|
|
2153
|
+
activation_wait_exhausted: Object.freeze({ classification: "host_context_activation_wait_exhausted", next_action: "retry_after" }),
|
|
2154
|
+
context_replaced: Object.freeze({ classification: "host_invocation_context_stale", next_action: "answer_with_gap" }),
|
|
2105
2155
|
// `no_binding` now means the producer has no real current Host session. The
|
|
2106
2156
|
// Host Relay never uses it for an uncreated Gateway Request; there is no
|
|
2107
2157
|
// useful retry until the consumer is running inside a Host session.
|
|
2108
2158
|
no_binding: Object.freeze({ classification: "host_session_unavailable", next_action: "answer_with_gap" }),
|
|
2109
|
-
context_expired: Object.freeze({ classification: "host_invocation_context_expired", next_action: "
|
|
2159
|
+
context_expired: Object.freeze({ classification: "host_invocation_context_expired", next_action: "answer_with_gap" }),
|
|
2110
2160
|
host_source_refused: Object.freeze({ classification: "host_source_refused", next_action: "answer_with_gap" }),
|
|
2111
2161
|
host_credential_refused: Object.freeze({ classification: "host_registration_credential_refused", next_action: "ask_admin" }),
|
|
2112
2162
|
gateway_unavailable: Object.freeze({ classification: "host_mint_gateway_unavailable", next_action: "ask_admin" }),
|
|
2113
2163
|
gateway_rate_limited: Object.freeze({ classification: "host_mint_gateway_rate_limited", next_action: "answer_with_gap" }),
|
|
2114
|
-
contract_mismatch: Object.freeze({ classification: "
|
|
2115
|
-
gateway_refused: Object.freeze({ classification: "host_mint_gateway_refused", next_action: "
|
|
2164
|
+
contract_mismatch: Object.freeze({ classification: "host_contract_mismatch", next_action: "upgrade_ceal_client" }),
|
|
2165
|
+
gateway_refused: Object.freeze({ classification: "host_mint_gateway_refused", next_action: "answer_with_gap" }),
|
|
2116
2166
|
gateway_response_invalid: Object.freeze({ classification: "host_mint_gateway_response_invalid", next_action: "answer_with_gap" }),
|
|
2117
2167
|
producer_frame_invalid: Object.freeze({ classification: "host_producer_frame_invalid", next_action: "ask_admin" }),
|
|
2118
2168
|
relay_permission_denied: Object.freeze({ classification: "host_relay_permission_denied", next_action: "rerun_outside_agent_sandbox" }),
|
|
2119
|
-
relay_unavailable: Object.freeze({ classification: "host_relay_unavailable", next_action: "
|
|
2169
|
+
relay_unavailable: Object.freeze({ classification: "host_relay_unavailable", next_action: "answer_with_gap" }),
|
|
2120
2170
|
transient_retryable: Object.freeze({ classification: "host_mint_transient_retryable", next_action: "retry" }),
|
|
2121
2171
|
mint_failed: Object.freeze({ classification: "host_mint_failed", next_action: "answer_with_gap" }),
|
|
2122
2172
|
relay_failed: Object.freeze({ classification: "host_relay_failed", next_action: "install_ceal_host" }),
|
|
@@ -2179,7 +2229,7 @@ var hostServiceDiagnosticCausePattern = new RegExp(CEAL_HOST_SERVICE_DIAGNOSTIC_
|
|
|
2179
2229
|
// packages/ceal-client-protocol/src/client-result-materialization.ts
|
|
2180
2230
|
var CEAL_UNREAD_REASONS = vocabulary(["blocked", "unavailable", "too_large", "unsupported", "download_failed", "permission_denied"]);
|
|
2181
2231
|
var REQUIRED_FIELDS2 = Object.freeze(["schema_version", "operation_id", "path", "sha256"]);
|
|
2182
|
-
var FIELDS = /* @__PURE__ */ new Set([...REQUIRED_FIELDS2, "
|
|
2232
|
+
var FIELDS = /* @__PURE__ */ new Set([...REQUIRED_FIELDS2, "local_result_root", "request_context_argv", "how_to_read"]);
|
|
2183
2233
|
|
|
2184
2234
|
// packages/ceal-client-protocol/src/discovery-manifest.ts
|
|
2185
2235
|
var DISCOVERY_MANIFEST_KEYS = CEAL_CLIENT_WIRE_CONTRACT.command_response.discovery_manifest_fields;
|
|
@@ -2221,6 +2271,9 @@ var CEAL_SUPPORTED_GATEWAY_PROTOCOL_RANGE = Object.freeze({
|
|
|
2221
2271
|
maximum: CEAL_PROTOCOL_VERSION
|
|
2222
2272
|
});
|
|
2223
2273
|
|
|
2274
|
+
// packages/ceal-client-protocol/src/operator-diagnostic.ts
|
|
2275
|
+
var OPERATOR_DIAGNOSTIC_HOME_PATHS = machineHomePathPatterns("gu");
|
|
2276
|
+
|
|
2224
2277
|
// packages/ceal-client-protocol/src/admin-projection-vocabulary.ts
|
|
2225
2278
|
var ADMIN_PROJECTION_STATES = vocabulary(["ready", "empty", "partial", "unknown"]);
|
|
2226
2279
|
var ADMIN_VIEW_KINDS = vocabulary(["request_detail", "resource_access_timeline", "weekly_usage"]);
|
|
@@ -2427,7 +2480,7 @@ async function runSecurefsCommand(args, maxBytes, custody, stdin) {
|
|
|
2427
2480
|
const executable = custody.securefs_executable ?? resolveInstalledHostExecutable(process.platform);
|
|
2428
2481
|
const processArgs = [...custody.securefs_args_prefix ?? [], ...args];
|
|
2429
2482
|
return await new Promise((resolve, reject) => {
|
|
2430
|
-
const child = execFile(executable, processArgs, { encoding: "buffer", timeout: WINDOWS_SECUREFS_TIMEOUT_MS, maxBuffer: maxBytes + WINDOWS_SECUREFS_DIAGNOSTIC_BYTES }, (error, stdout, stderr) => {
|
|
2483
|
+
const child = execFile(executable, processArgs, { encoding: "buffer", windowsHide: true, timeout: WINDOWS_SECUREFS_TIMEOUT_MS, maxBuffer: maxBytes + WINDOWS_SECUREFS_DIAGNOSTIC_BYTES }, (error, stdout, stderr) => {
|
|
2431
2484
|
const exitCode = error === null ? 0 : typeof error.code === "number" ? error.code : null;
|
|
2432
2485
|
if (exitCode === null) {
|
|
2433
2486
|
reject(new SecureFileCustodyError("unavailable", "The installed Windows Host securefs command could not run."));
|
|
@@ -4572,7 +4625,7 @@ var HOST_RELAY_INVOCATION_MINT_ORIGIN_HOST_PATTERN = /^[A-Za-z0-9.:[\]-]{1,255}$
|
|
|
4572
4625
|
var HOST_RELAY_CLIENT_EXCHANGE_REF_PATTERN = new RegExp(CEAL_HTTP_CLIENT_EXCHANGE_REF_PATTERN_SOURCE, "u");
|
|
4573
4626
|
var HOST_RELAY_GATEWAY_HTTP_REQUEST_REF_PATTERN = new RegExp(CEAL_HTTP_GATEWAY_REQUEST_REF_PATTERN_SOURCE, "u");
|
|
4574
4627
|
function formatHostRelayInvocationMintLine(result2, context) {
|
|
4575
|
-
const gatewayStatus =
|
|
4628
|
+
const gatewayStatus = context.stage === "gateway_response" ? boundedGatewayStatus(context.gateway_status) : void 0;
|
|
4576
4629
|
const originHost = boundedOriginHost(context.gateway_origin_host);
|
|
4577
4630
|
const clientExchangeRef = boundedDiagnosticRef(context.client_exchange_ref, HOST_RELAY_CLIENT_EXCHANGE_REF_PATTERN);
|
|
4578
4631
|
const gatewayHttpRequestRef = boundedDiagnosticRef(context.gateway_http_request_ref, HOST_RELAY_GATEWAY_HTTP_REQUEST_REF_PATTERN);
|
|
@@ -4581,9 +4634,8 @@ function formatHostRelayInvocationMintLine(result2, context) {
|
|
|
4581
4634
|
const outcome = result2.status === "ready" ? "completed" : "failed";
|
|
4582
4635
|
return `${HOST_RELAY_INVOCATION_MINT_LOG_TAG} timestamp=${context.timestamp} outcome=${outcome} stage=${context.stage} latency_ms=${latency}${optionalField("gateway_origin_host", originHost)}${optionalField("client_exchange_ref", clientExchangeRef)}${optionalField("gateway_http_request_ref", gatewayHttpRequestRef)}${optionalField("reason", reason)}${optionalField("gateway_status", gatewayStatus)}`;
|
|
4583
4636
|
}
|
|
4584
|
-
function
|
|
4585
|
-
|
|
4586
|
-
return result2.gateway_status;
|
|
4637
|
+
function boundedGatewayStatus(value) {
|
|
4638
|
+
return Number.isSafeInteger(value) && Number(value) >= 100 && Number(value) <= 599 ? value : void 0;
|
|
4587
4639
|
}
|
|
4588
4640
|
function boundedOriginHost(value) {
|
|
4589
4641
|
if (value === void 0 || !HOST_RELAY_INVOCATION_MINT_ORIGIN_HOST_PATTERN.test(value)) return void 0;
|
|
@@ -4607,7 +4659,7 @@ function optionalField(name, value) {
|
|
|
4607
4659
|
function reportInvocationMintLine(line) {
|
|
4608
4660
|
writeHostServiceLogLine(line);
|
|
4609
4661
|
}
|
|
4610
|
-
async function serveHostRelay(config, signal, dependencies
|
|
4662
|
+
async function serveHostRelay(config, signal, dependencies) {
|
|
4611
4663
|
const admission = new RelayAdmissionStore(join7(config.state_root, "admission"));
|
|
4612
4664
|
let server;
|
|
4613
4665
|
try {
|
|
@@ -4633,13 +4685,13 @@ async function startHostRelayRuntimeIpc(config, admission, dependencies, pipeKey
|
|
|
4633
4685
|
const started = performance.now();
|
|
4634
4686
|
const observation = { stage: "registration" };
|
|
4635
4687
|
const logResult = (result3) => {
|
|
4636
|
-
const context = { timestamp: (/* @__PURE__ */ new Date()).toISOString(), stage: observation.stage, latency_ms: Math.max(0, Math.round(performance.now() - started)), ...observation.gateway_origin_host === void 0 ? {} : { gateway_origin_host: observation.gateway_origin_host }, ...observation.client_exchange_ref === void 0 ? {} : { client_exchange_ref: observation.client_exchange_ref }, ...observation.gateway_http_request_ref === void 0 ? {} : { gateway_http_request_ref: observation.gateway_http_request_ref } };
|
|
4688
|
+
const context = { timestamp: (/* @__PURE__ */ new Date()).toISOString(), stage: observation.stage, latency_ms: Math.max(0, Math.round(performance.now() - started)), ...observation.gateway_origin_host === void 0 ? {} : { gateway_origin_host: observation.gateway_origin_host }, ...observation.client_exchange_ref === void 0 ? {} : { client_exchange_ref: observation.client_exchange_ref }, ...observation.gateway_http_request_ref === void 0 ? {} : { gateway_http_request_ref: observation.gateway_http_request_ref }, ...observation.gateway_status === void 0 ? {} : { gateway_status: observation.gateway_status } };
|
|
4637
4689
|
(dependencies.logInvocationMint ?? reportInvocationMintLine)(`${formatHostRelayInvocationMintLine(result3, context)}
|
|
4638
4690
|
`);
|
|
4639
4691
|
};
|
|
4640
4692
|
let result2;
|
|
4641
4693
|
try {
|
|
4642
|
-
result2 = await mintInvocationContextAtGateway(config, input, signal, dependencies.fetch
|
|
4694
|
+
result2 = await mintInvocationContextAtGateway(config, input, signal, dependencies.fetch, observation, dependencies.custody);
|
|
4643
4695
|
} catch (error) {
|
|
4644
4696
|
const refused = { schema_version: HOST_RELAY_INVOCATION_CONTEXT_RESULT_SCHEMA, status: "refused", reason: "gateway_unavailable" };
|
|
4645
4697
|
logResult(refused);
|
|
@@ -4660,9 +4712,7 @@ async function mintInvocationContextAtGateway(config, input, signal, fetchGatewa
|
|
|
4660
4712
|
try {
|
|
4661
4713
|
observation.gateway_origin_host = new URL(registration.gateway_request_origin).hostname;
|
|
4662
4714
|
observation.stage = "gateway_request";
|
|
4663
|
-
|
|
4664
|
-
observation.stage = "gateway_response";
|
|
4665
|
-
return result2;
|
|
4715
|
+
return await gatewayMintPost(registration, input, signal, fetchGateway, observation);
|
|
4666
4716
|
} catch (error) {
|
|
4667
4717
|
return gatewayMintFailure(signal, error);
|
|
4668
4718
|
}
|
|
@@ -4678,6 +4728,8 @@ async function gatewayMintPost(registration, input, signal, fetchGateway, observ
|
|
|
4678
4728
|
body: serialized,
|
|
4679
4729
|
signal
|
|
4680
4730
|
});
|
|
4731
|
+
observation.stage = "gateway_response";
|
|
4732
|
+
observation.gateway_status = boundedGatewayStatus(response2.status);
|
|
4681
4733
|
try {
|
|
4682
4734
|
const gatewayHttpRequestRef = response2.headers.get(CEAL_HTTP_GATEWAY_REQUEST_REF_HEADER);
|
|
4683
4735
|
if (gatewayHttpRequestRef !== null && HOST_RELAY_GATEWAY_HTTP_REQUEST_REF_PATTERN.test(gatewayHttpRequestRef)) observation.gateway_http_request_ref = gatewayHttpRequestRef;
|
|
@@ -4765,7 +4817,7 @@ function gatewayMintRefusal(status, value) {
|
|
|
4765
4817
|
if (status >= 500) return "gateway_unavailable";
|
|
4766
4818
|
return "gateway_refused";
|
|
4767
4819
|
}
|
|
4768
|
-
async function runHostRelayCli(args, signal, dependencies
|
|
4820
|
+
async function runHostRelayCli(args, signal, dependencies) {
|
|
4769
4821
|
try {
|
|
4770
4822
|
const configPath = parseServeArgs(args);
|
|
4771
4823
|
const config = await (dependencies.readConfig ?? readHostRelayConfig)(configPath);
|
|
@@ -4808,7 +4860,7 @@ var stop = () => controller.abort();
|
|
|
4808
4860
|
process.once("SIGINT", stop);
|
|
4809
4861
|
process.once("SIGTERM", stop);
|
|
4810
4862
|
var stopLogBound = boundHostServiceLog();
|
|
4811
|
-
void runHostRelayCli(serviceArguments.args, controller.signal).then(async (result2) => {
|
|
4863
|
+
void runHostRelayCli(serviceArguments.args, controller.signal, { fetch: globalThis.fetch }).then(async (result2) => {
|
|
4812
4864
|
await writeHostServiceCommandResult(RELAY_COMMAND_SCHEMA, result2, (line) => process.stdout.write(line));
|
|
4813
4865
|
process.exitCode = result2.ok ? 0 : 1;
|
|
4814
4866
|
}).catch(async (error) => {
|
package/package.json
CHANGED
|
@@ -3,12 +3,12 @@
|
|
|
3
3
|
"product": "ceal-host",
|
|
4
4
|
"version_source": {
|
|
5
5
|
"product": "ceal-host",
|
|
6
|
-
"version": "1.0.
|
|
6
|
+
"version": "1.0.24"
|
|
7
7
|
},
|
|
8
8
|
"source": {
|
|
9
9
|
"repository": "corca-ai/ceal",
|
|
10
|
-
"commit": "
|
|
11
|
-
"tree": "
|
|
10
|
+
"commit": "befa7a1f7dd6d0cf38121169a753af0bd48d9bd2",
|
|
11
|
+
"tree": "38d13f4c4772e960070fc0a6dd7b52534f3f3f79"
|
|
12
12
|
},
|
|
13
13
|
"target": "windows-x64",
|
|
14
14
|
"required_features": [],
|
|
@@ -19,7 +19,17 @@
|
|
|
19
19
|
],
|
|
20
20
|
"executable": true,
|
|
21
21
|
"path": "bin/ceal-host.exe",
|
|
22
|
-
"sha256": "
|
|
22
|
+
"sha256": "b8db9cd232f688103e7da7bee4b70f6217b34659d4046c7512c6d9275958b726"
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
"owners": [
|
|
26
|
+
"relay",
|
|
27
|
+
"codex",
|
|
28
|
+
"claude"
|
|
29
|
+
],
|
|
30
|
+
"executable": true,
|
|
31
|
+
"path": "libexec/ceal-host/ceal-host-background.exe",
|
|
32
|
+
"sha256": "5d68f30b40b1e3891e1602be9bbc8502990127c4b69576f64c3b67ab3c262d35"
|
|
23
33
|
},
|
|
24
34
|
{
|
|
25
35
|
"owners": [
|
|
@@ -27,7 +37,7 @@
|
|
|
27
37
|
],
|
|
28
38
|
"executable": false,
|
|
29
39
|
"path": "libexec/ceal-host/claude-hook.mjs",
|
|
30
|
-
"sha256": "
|
|
40
|
+
"sha256": "6517529f8835230ced8760d330b195c51ddfb963117f14a9cd61805010026a0d"
|
|
31
41
|
},
|
|
32
42
|
{
|
|
33
43
|
"owners": [
|
|
@@ -35,7 +45,7 @@
|
|
|
35
45
|
],
|
|
36
46
|
"executable": false,
|
|
37
47
|
"path": "libexec/ceal-host/claude-invocation-authentication.mjs",
|
|
38
|
-
"sha256": "
|
|
48
|
+
"sha256": "fa63be3c835269a63dc19aa83381fee4a4fc25d992327d8d3af3edf8a7340211"
|
|
39
49
|
},
|
|
40
50
|
{
|
|
41
51
|
"owners": [
|
|
@@ -43,7 +53,7 @@
|
|
|
43
53
|
],
|
|
44
54
|
"executable": false,
|
|
45
55
|
"path": "libexec/ceal-host/claude-producer.mjs",
|
|
46
|
-
"sha256": "
|
|
56
|
+
"sha256": "2c8b47f1d060de63a0b49f279a59fa244753ebde1429c83510c94e7cbbfcfa3a"
|
|
47
57
|
},
|
|
48
58
|
{
|
|
49
59
|
"owners": [
|
|
@@ -51,7 +61,7 @@
|
|
|
51
61
|
],
|
|
52
62
|
"executable": false,
|
|
53
63
|
"path": "libexec/ceal-host/codex-hook.mjs",
|
|
54
|
-
"sha256": "
|
|
64
|
+
"sha256": "06fd01ac491a5d26787369a10d5028b4564c8d2fda0ef801f6a8bff9035b6dc4"
|
|
55
65
|
},
|
|
56
66
|
{
|
|
57
67
|
"owners": [
|
|
@@ -59,7 +69,7 @@
|
|
|
59
69
|
],
|
|
60
70
|
"executable": false,
|
|
61
71
|
"path": "libexec/ceal-host/codex-invocation-authentication.mjs",
|
|
62
|
-
"sha256": "
|
|
72
|
+
"sha256": "95903457647a8cbd0332b549be5d76d6dd38e12af7b27333247ab6c9a09bacb4"
|
|
63
73
|
},
|
|
64
74
|
{
|
|
65
75
|
"owners": [
|
|
@@ -67,7 +77,7 @@
|
|
|
67
77
|
],
|
|
68
78
|
"executable": false,
|
|
69
79
|
"path": "libexec/ceal-host/codex-producer.mjs",
|
|
70
|
-
"sha256": "
|
|
80
|
+
"sha256": "e9587169f68eae4cdfd9e332e29880269dfd2c4c7a8fb9141474e0d9dc0c7b15"
|
|
71
81
|
},
|
|
72
82
|
{
|
|
73
83
|
"owners": [
|
|
@@ -75,7 +85,7 @@
|
|
|
75
85
|
],
|
|
76
86
|
"executable": false,
|
|
77
87
|
"path": "libexec/ceal-host/control.mjs",
|
|
78
|
-
"sha256": "
|
|
88
|
+
"sha256": "e675112a3ff873290f62387584fc55bc42bd7348be6de65f629fc49a594065e2"
|
|
79
89
|
},
|
|
80
90
|
{
|
|
81
91
|
"owners": [
|
|
@@ -91,7 +101,7 @@
|
|
|
91
101
|
],
|
|
92
102
|
"executable": false,
|
|
93
103
|
"path": "libexec/ceal-host/relay.mjs",
|
|
94
|
-
"sha256": "
|
|
104
|
+
"sha256": "d0699f2466ad1c4c6a22cced25d3b03ed03fb0e6ebed28c630ef4055e5026d86"
|
|
95
105
|
}
|
|
96
106
|
]
|
|
97
107
|
}
|