@corca-org/ceal-host-darwin-arm64 1.0.16 → 1.0.17
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 +0 -0
- package/libexec/ceal-host/claude-hook.mjs +75 -157
- package/libexec/ceal-host/claude-invocation-authentication.mjs +74 -159
- package/libexec/ceal-host/claude-producer.mjs +74 -159
- package/libexec/ceal-host/codex-hook.mjs +94 -277
- package/libexec/ceal-host/codex-invocation-authentication.mjs +87 -166
- package/libexec/ceal-host/codex-producer.mjs +87 -166
- package/libexec/ceal-host/control.mjs +102 -181
- package/libexec/ceal-host/relay.mjs +103 -172
- package/package.json +1 -1
- package/share/ceal-host/bundle-manifest.json +12 -12
- package/share/ceal-host/bundle-manifest.sigstore.json +1 -1
|
@@ -256,7 +256,7 @@ var CEAL_GATEWAY_DERIVED_STORE_FAILURE_CLASSES = vocabulary(["storage_unavailabl
|
|
|
256
256
|
var CEAL_POLICY_DECISIONS = vocabulary(["allowed", "denied", "not_evaluated"]);
|
|
257
257
|
var CEAL_CONNECTOR_ROUTE_PHASES = vocabulary(["scope_observation", "target_selection", "route_resolution"]);
|
|
258
258
|
var CEAL_CONNECTOR_ROUTE_CAUSES = vocabulary(["provider_throttled", "provider_unavailable", "binding_invalid", "scope_limit_exceeded"]);
|
|
259
|
-
var CEAL_WRITE_SOURCE_KINDS = vocabulary(["authenticated_registered_client", "
|
|
259
|
+
var CEAL_WRITE_SOURCE_KINDS = vocabulary(["authenticated_registered_client", "provider_authenticated_event"]);
|
|
260
260
|
var CEAL_REFRESH_DELIVERIES = vocabulary(["initial", "recovery", "replay", "terminal_failure", "recovery_unavailable"]);
|
|
261
261
|
var CEAL_CLIENT_OPERATIONS = vocabulary(["handshake", "discover", "call", "readback"]);
|
|
262
262
|
var CEAL_WRITE_IDEMPOTENCY_POSTURES = vocabulary(["required", "optional", "not_required"]);
|
|
@@ -409,6 +409,7 @@ var CEAL_OPERATION_WITHHELD_CAUSES = vocabulary(["provider_permission", "access_
|
|
|
409
409
|
// packages/ceal-client-protocol/src/operation-contract-types.ts
|
|
410
410
|
var CEAL_JSON_SCHEMA_2020_12 = "https://json-schema.org/draft/2020-12/schema";
|
|
411
411
|
var CEAL_OPERATION_ERROR_SCHEMA_VERSION = "ceal.operation_error.v1";
|
|
412
|
+
var CEAL_ARTIFACT_STAGE_TERMINALS = vocabulary(["chunk_accepted", "artifact_ready", "idempotency_replayed"]);
|
|
412
413
|
var CEAL_RETRY_AFTER_MAX_MS = 60 * 60 * 1e3;
|
|
413
414
|
var CEAL_JSON_SCHEMA_TYPES = vocabulary(["object", "array", "string", "integer", "number", "boolean", "null"]);
|
|
414
415
|
var OBSERVATION_POSTURES = vocabulary(["direct_readback", "approved_no_readback", "operator_mediated", "excluded"]);
|
|
@@ -782,9 +783,6 @@ var CEAL_OPERATION_AUTHORITY_POLICY_KEYS = Object.freeze(["access_group", "insta
|
|
|
782
783
|
var MAX_OPERATION_INPUT_RESOLVER_BINDINGS = 96;
|
|
783
784
|
var CEAL_OPERATION_DESCRIPTOR_REQUIRED_ENVELOPE_KEYS = Object.freeze(["schema_version", "id", "input_contract", "result_contract", "policy"]);
|
|
784
785
|
var CEAL_OPERATION_DESCRIPTOR_OPTIONAL_ENVELOPE_KEYS = Object.freeze(["input_resolution", "summary"]);
|
|
785
|
-
var CEAL_OPERATION_RESULT_KEYS = vocabulary(["ok", "operation_id", "operation_receipt", "schema_version", "value"]);
|
|
786
|
-
var CEAL_OPERATION_COMPACT_RESULT_KEYS = vocabulary(["ok", "operation_evidence", "operation_id", "schema_version", "value"]);
|
|
787
|
-
var CEAL_OPERATION_RESULT_OPTIONAL_KEYS = vocabulary(["model_disclosure", "result_complete", "resume"]);
|
|
788
786
|
|
|
789
787
|
// packages/ceal-client-protocol/src/operation-catalog.ts
|
|
790
788
|
var CEAL_OPERATION_CATALOG_SCHEMA_VERSION = "ceal.catalog.v3";
|
|
@@ -848,10 +846,6 @@ var CEAL_SCHEMA_LITERALS = [
|
|
|
848
846
|
"ceal.host_observation.v1",
|
|
849
847
|
"ceal.host_registration_request.v1",
|
|
850
848
|
"ceal.host_registration_result.v1",
|
|
851
|
-
"ceal.leased-resource-stream.v1",
|
|
852
|
-
"ceal.leased_consumer_attachment_stream_frame.v1",
|
|
853
|
-
"ceal.leased_consumer_attachment_stream_request.v1",
|
|
854
|
-
"ceal.leased_consumer_attachment_stream_transport.v1",
|
|
855
849
|
"ceal.operation_descriptor.v1",
|
|
856
850
|
"ceal.operation_error.v1",
|
|
857
851
|
"ceal.operation_failure.v1",
|
|
@@ -877,12 +871,6 @@ var CEAL_SCHEMA_LITERAL_SET = new Set(CEAL_SCHEMA_LITERALS);
|
|
|
877
871
|
// packages/ceal-client-protocol/src/bounded-series.ts
|
|
878
872
|
import { join } from "node:path";
|
|
879
873
|
var CEAL_BOUNDED_SERIES_CATALOG = Object.freeze({
|
|
880
|
-
usage_record: (root) => join(root, "run-usage.jsonl"),
|
|
881
|
-
control_commit: (root) => join(root, "control-auto-commit.jsonl"),
|
|
882
|
-
engagement_signal: (root) => join(root, "runtime-state", "slack-feedback.jsonl"),
|
|
883
|
-
runtime_error: (root) => join(root, "runtime-state", "runtime-errors.jsonl"),
|
|
884
|
-
turn_bridge_request: (root) => join(root, ".ceal", "turn-bridge", "requests.jsonl"),
|
|
885
|
-
thread_run_events: (root) => join(root, "run-events.jsonl"),
|
|
886
874
|
bounded_store_sidecar: (root) => `${root}.jsonl`,
|
|
887
875
|
gateway_audit_archive: (root) => `${root}.jsonl`,
|
|
888
876
|
gateway_access_group_connector_control_audit: (root) => `${root}.audit.jsonl`,
|
|
@@ -915,35 +903,6 @@ var CEAL_HOST_REGISTRATION_ATTEMPT_REF_PATTERN = new RegExp(`^host-registration-
|
|
|
915
903
|
var CEAL_HOST_INSTALLATION_REF_PATTERN = new RegExp(`^host-installation:${CEAL_LOWERCASE_UUID_PATTERN}$`, "u");
|
|
916
904
|
var CEAL_HOST_SOURCE_REF_PATTERN = new RegExp(`^host-source:${CEAL_LOWERCASE_UUID_PATTERN}$`, "u");
|
|
917
905
|
|
|
918
|
-
// packages/ceal-client-protocol/src/agent-session-handoff.ts
|
|
919
|
-
var CEAL_AGENT_ADMISSION_PHASES = vocabulary([
|
|
920
|
-
"incumbent_admitted",
|
|
921
|
-
"incumbent_draining",
|
|
922
|
-
"drained",
|
|
923
|
-
"candidate_admitted",
|
|
924
|
-
"candidate_draining",
|
|
925
|
-
"rollback_admitted"
|
|
926
|
-
]);
|
|
927
|
-
var CEAL_AGENT_SERVICE_SESSION_RECORD_KEYS = vocabulary([
|
|
928
|
-
"admission_fence",
|
|
929
|
-
"admission_state",
|
|
930
|
-
"admission_state_generation",
|
|
931
|
-
"bearer",
|
|
932
|
-
"consumer_ref",
|
|
933
|
-
"credential_generation",
|
|
934
|
-
"expires_at",
|
|
935
|
-
"gateway_instance",
|
|
936
|
-
"gateway_origin",
|
|
937
|
-
"gateway_serving_generation",
|
|
938
|
-
"issued_at",
|
|
939
|
-
"record_sha256",
|
|
940
|
-
"renew_after",
|
|
941
|
-
"renew_by",
|
|
942
|
-
"schema_version",
|
|
943
|
-
"session_revision"
|
|
944
|
-
]);
|
|
945
|
-
var CEAL_AGENT_SESSION_COMMIT_KEYS = vocabulary(["attempt_ref", "expected_session_revision", "session_revision"]);
|
|
946
|
-
|
|
947
906
|
// packages/ceal-client-protocol/src/operation-result-completeness.ts
|
|
948
907
|
var CEAL_READ_VALUE_CONTINUATION_KEYS = vocabulary(["continuation", "continuation_ref", "next_cursor"]);
|
|
949
908
|
|
|
@@ -954,7 +913,9 @@ var CEAL_OPERATION_INVOKE_COMMAND = "invoke";
|
|
|
954
913
|
var CEAL_OPERATION_INPUT_FLAG = "--input";
|
|
955
914
|
var CEAL_OPERATION_ID_PLACEHOLDER = "<operation-id>";
|
|
956
915
|
var CEAL_OPERATION_INPUT_PLACEHOLDER = "<json-object>";
|
|
957
|
-
var
|
|
916
|
+
var MODEL_INVOCATION_BASE_ARGUMENTS = [CEAL_OPERATION_INVOKE_COMMAND, CEAL_OPERATION_ID_PLACEHOLDER].join(" ");
|
|
917
|
+
var CEAL_MODEL_INVOCATION_ARGUMENTS = [MODEL_INVOCATION_BASE_ARGUMENTS, CEAL_OPERATION_INPUT_FLAG, shellSingleQuoted(CEAL_OPERATION_INPUT_PLACEHOLDER)].join(" ");
|
|
918
|
+
var CEAL_MODEL_INPUT_SOURCE_GUIDANCE = `For caller-owned fields, add ${CEAL_OPERATION_INPUT_FLAG} ${shellSingleQuoted(CEAL_OPERATION_INPUT_PLACEHOLDER)}. Use inline JSON for short input; for longer or generated input, put exactly one JSON object in a caller-owned regular non-symlink UTF-8 JSON file and pass --input @path; relative paths resolve from the command working directory.`;
|
|
958
919
|
function shellSingleQuoted(value) {
|
|
959
920
|
return `'${value.replaceAll("'", "'\\''")}'`;
|
|
960
921
|
}
|
|
@@ -986,19 +947,73 @@ var CEAL_VERIFIED_ARTIFACT_DESCRIPTOR_JSON_SCHEMA = Object.freeze({
|
|
|
986
947
|
}
|
|
987
948
|
});
|
|
988
949
|
|
|
950
|
+
// packages/ceal-client-protocol/src/provider-operation-vocabulary.ts
|
|
951
|
+
var CEAL_FILE_TYPE_FAMILIES = vocabulary(["all", "image", "pdf"]);
|
|
952
|
+
var CEAL_GITHUB_ISSUE_STATES = vocabulary(["open", "closed", "all"]);
|
|
953
|
+
var CEAL_NOTION_UPDATABLE_BLOCK_TYPES = vocabulary([
|
|
954
|
+
"paragraph",
|
|
955
|
+
"heading_1",
|
|
956
|
+
"heading_2",
|
|
957
|
+
"heading_3",
|
|
958
|
+
"bulleted_list_item",
|
|
959
|
+
"numbered_list_item",
|
|
960
|
+
"to_do",
|
|
961
|
+
"code"
|
|
962
|
+
]);
|
|
963
|
+
var CEAL_NOTION_NEUTRAL_TYPES = vocabulary([
|
|
964
|
+
"text",
|
|
965
|
+
"number",
|
|
966
|
+
"boolean",
|
|
967
|
+
"date",
|
|
968
|
+
"select",
|
|
969
|
+
"multi_select",
|
|
970
|
+
"people",
|
|
971
|
+
"url",
|
|
972
|
+
"email",
|
|
973
|
+
"phone",
|
|
974
|
+
"unsupported"
|
|
975
|
+
]);
|
|
976
|
+
var CEAL_NOTION_IDENTITY_GAP_REASONS = vocabulary([
|
|
977
|
+
"identity_unavailable",
|
|
978
|
+
"identity_stale",
|
|
979
|
+
"identity_ambiguous",
|
|
980
|
+
"identity_revoked",
|
|
981
|
+
"identity_unlinked"
|
|
982
|
+
]);
|
|
983
|
+
var CEAL_NOTION_STRING_VALUE_TYPES = vocabulary(["text", "select", "url", "email", "phone"]);
|
|
984
|
+
|
|
985
|
+
// packages/ceal-client-protocol/src/opaque-reference.ts
|
|
986
|
+
var CEAL_OPAQUE_HANDLE_KINDS = vocabulary(["target", "message", "thread", "artifact", "document", "block", "object"]);
|
|
987
|
+
var CEAL_OPAQUE_REF_KINDS = vocabulary([...CEAL_OPAQUE_HANDLE_KINDS, "result", "operation-receipt", "reply-receipt", "field", "notion-data-source"]);
|
|
988
|
+
|
|
989
989
|
// packages/ceal-client-protocol/src/bare-document.ts
|
|
990
990
|
var REQUIRED_FIELDS = CEAL_CLIENT_WIRE_CONTRACT.command_response.bare_document_fields;
|
|
991
991
|
var OPTIONAL_FIELDS = CEAL_CLIENT_WIRE_CONTRACT.command_response.bare_document_optional_fields;
|
|
992
992
|
|
|
993
|
-
// packages/ceal-client-protocol/src/
|
|
994
|
-
var
|
|
995
|
-
var
|
|
996
|
-
var
|
|
997
|
-
var
|
|
993
|
+
// packages/ceal-client-protocol/src/resource-row.ts
|
|
994
|
+
var CEAL_RESOURCE_SEARCH_ORDERS = vocabulary(["relevance", "modified", "viewed", "created"]);
|
|
995
|
+
var CEAL_RESOURCE_SEARCH_DIRECTIONS = vocabulary(["ascending", "descending"]);
|
|
996
|
+
var CEAL_RESOURCE_SEARCH_FILTERS = vocabulary(["query", "modified_since", "since", "until", "authored_by_me", "include_replies", "kinds", "container_ref", "container_refs", "container_names", "addressed_to_me", "unread"]);
|
|
997
|
+
var CEAL_RESOURCE_TIME_BASES = vocabulary(["created", "modified", "viewed"]);
|
|
998
998
|
var CEAL_REPOSITORY_VISIBILITIES = vocabulary(["public", "private", "internal"]);
|
|
999
|
-
var
|
|
1000
|
-
var
|
|
1001
|
-
|
|
999
|
+
var CEAL_ACTIVITY_V3_KINDS = vocabulary(["authored", "edited", "messaged", "responded"]);
|
|
1000
|
+
var CEAL_ACTIVITY_TIMESTAMP_BASES = vocabulary([
|
|
1001
|
+
"message_created",
|
|
1002
|
+
"commit_authored",
|
|
1003
|
+
"resource_created",
|
|
1004
|
+
"review_submitted",
|
|
1005
|
+
"comment_created",
|
|
1006
|
+
"event_start",
|
|
1007
|
+
"all_day_start",
|
|
1008
|
+
"file_created",
|
|
1009
|
+
"file_modified",
|
|
1010
|
+
"file_modified_by_me",
|
|
1011
|
+
"file_viewed_by_me",
|
|
1012
|
+
"page_created",
|
|
1013
|
+
"page_last_edited",
|
|
1014
|
+
"resource_modified"
|
|
1015
|
+
]);
|
|
1016
|
+
var CEAL_ACTIVITY_CONNECTOR_KINDS = vocabulary(["slack", "github", "google-calendar", "google-drive", "notion"]);
|
|
1002
1017
|
var CEAL_ACTIVITY_GAP_CODES = vocabulary([
|
|
1003
1018
|
"provider_page_budget",
|
|
1004
1019
|
"call_deadline",
|
|
@@ -1009,8 +1024,6 @@ var CEAL_ACTIVITY_GAP_CODES = vocabulary([
|
|
|
1009
1024
|
"unsupported_event_kind",
|
|
1010
1025
|
"direct_messages_excluded"
|
|
1011
1026
|
]);
|
|
1012
|
-
var CEAL_ACTIVITY_CONNECTOR_KINDS = vocabulary(["slack", "github", "google-calendar", "google-drive", "notion"]);
|
|
1013
|
-
var CEAL_ACTIVITY_COVERAGE_STATUSES = vocabulary(["complete_for_target", "continuation_required", "blocked"]);
|
|
1014
1027
|
var CEAL_ACTIVITY_EVENT_KINDS = vocabulary([
|
|
1015
1028
|
"slack.message",
|
|
1016
1029
|
"slack.reply",
|
|
@@ -1051,73 +1064,6 @@ var CEAL_ACTIVITY_EVENT_TIMESTAMP_BASIS_MAP = Object.freeze({
|
|
|
1051
1064
|
"notion.page.created": "page_created",
|
|
1052
1065
|
"notion.page.edited": "page_last_edited"
|
|
1053
1066
|
});
|
|
1054
|
-
var CEAL_ACTIVITY_TIMESTAMP_BASES = vocabulary([
|
|
1055
|
-
"message_created",
|
|
1056
|
-
"commit_authored",
|
|
1057
|
-
"resource_created",
|
|
1058
|
-
"review_submitted",
|
|
1059
|
-
"comment_created",
|
|
1060
|
-
"event_start",
|
|
1061
|
-
"all_day_start",
|
|
1062
|
-
"file_created",
|
|
1063
|
-
"file_modified",
|
|
1064
|
-
"file_modified_by_me",
|
|
1065
|
-
"file_viewed_by_me",
|
|
1066
|
-
"page_created",
|
|
1067
|
-
"page_last_edited",
|
|
1068
|
-
"resource_modified"
|
|
1069
|
-
]);
|
|
1070
|
-
var CEAL_ACTIVITY_V3_KINDS = vocabulary(["authored", "edited", "messaged", "responded"]);
|
|
1071
|
-
var CEAL_RESOURCE_TIME_BASES = vocabulary(["created", "modified", "viewed"]);
|
|
1072
|
-
var CEAL_RESOURCE_SEARCH_ORDERS = vocabulary(["relevance", "modified", "viewed", "created"]);
|
|
1073
|
-
var CEAL_RESOURCE_SEARCH_DIRECTIONS = vocabulary(["ascending", "descending"]);
|
|
1074
|
-
var CEAL_RESOURCE_SEARCH_FILTERS = vocabulary(["query", "modified_since", "since", "until", "authored_by_me", "include_replies", "kinds", "container_ref", "container_refs", "container_names", "addressed_to_me", "unread"]);
|
|
1075
|
-
var CEAL_ARTIFACT_STAGE_TERMINALS = vocabulary(["chunk_accepted", "artifact_ready", "idempotency_replayed"]);
|
|
1076
|
-
var CEAL_READ_ITEM_KINDS = vocabulary(["conversation", "identity", "usergroup", "message", "file", "document"]);
|
|
1077
|
-
var CEAL_LEASED_MESSAGE_SEARCH_COMPLETENESS = vocabulary(["complete", "continuation_available", "truncated"]);
|
|
1078
|
-
var CEAL_OPAQUE_HANDLE_KINDS = vocabulary(["target", "message", "thread", "artifact", "document", "block", "object"]);
|
|
1079
|
-
var CEAL_OPAQUE_REF_KINDS = vocabulary([...CEAL_OPAQUE_HANDLE_KINDS, "result", "operation-receipt", "reply-receipt", "field", "notion-data-source"]);
|
|
1080
|
-
var CEAL_WRITE_OBJECT_KINDS = vocabulary(["document", "comment", "cell_range"]);
|
|
1081
|
-
var CEAL_CONVERSATION_KINDS = vocabulary(["channel", "dm", "group"]);
|
|
1082
|
-
var CEAL_FILE_TYPE_FAMILIES = vocabulary(["all", "image", "pdf"]);
|
|
1083
|
-
var CEAL_GITHUB_ISSUE_STATES = vocabulary(["open", "closed", "all"]);
|
|
1084
|
-
var CEAL_NOTION_UPDATABLE_BLOCK_TYPES = vocabulary([
|
|
1085
|
-
"paragraph",
|
|
1086
|
-
"heading_1",
|
|
1087
|
-
"heading_2",
|
|
1088
|
-
"heading_3",
|
|
1089
|
-
"bulleted_list_item",
|
|
1090
|
-
"numbered_list_item",
|
|
1091
|
-
"to_do",
|
|
1092
|
-
"code"
|
|
1093
|
-
]);
|
|
1094
|
-
var CEAL_NOTION_NEUTRAL_TYPES = vocabulary([
|
|
1095
|
-
"text",
|
|
1096
|
-
"number",
|
|
1097
|
-
"boolean",
|
|
1098
|
-
"date",
|
|
1099
|
-
"select",
|
|
1100
|
-
"multi_select",
|
|
1101
|
-
"people",
|
|
1102
|
-
"url",
|
|
1103
|
-
"email",
|
|
1104
|
-
"phone",
|
|
1105
|
-
"unsupported"
|
|
1106
|
-
]);
|
|
1107
|
-
var CEAL_NOTION_IDENTITY_GAP_REASONS = vocabulary([
|
|
1108
|
-
"identity_unavailable",
|
|
1109
|
-
"identity_stale",
|
|
1110
|
-
"identity_ambiguous",
|
|
1111
|
-
"identity_revoked",
|
|
1112
|
-
"identity_unlinked"
|
|
1113
|
-
]);
|
|
1114
|
-
var CEAL_NOTION_STRING_VALUE_TYPES = vocabulary(["text", "select", "url", "email", "phone"]);
|
|
1115
|
-
var CEAL_UNREAD_REASONS = vocabulary(["blocked", "unavailable", "too_large", "unsupported", "download_failed", "permission_denied"]);
|
|
1116
|
-
var CEAL_PLAN_ITEM_STATUSES = vocabulary(["pending", "active", "completed"]);
|
|
1117
|
-
var CEAL_FINAL_PRESENTATION_INTENTS = vocabulary(["final", "stop", "transient_notice"]);
|
|
1118
|
-
var CEAL_PRESENTATION_INTENTS = vocabulary(["progress", ...CEAL_FINAL_PRESENTATION_INTENTS]);
|
|
1119
|
-
|
|
1120
|
-
// packages/ceal-client-protocol/src/resource-row.ts
|
|
1121
1067
|
var CEAL_DATED_NOTE_BASES = vocabulary(["recording", "calendar_event", "created_time"]);
|
|
1122
1068
|
var CEAL_DATED_NOTE_TRANSCRIPT_STATES = vocabulary(["present", "absent", "unestablished"]);
|
|
1123
1069
|
var CEAL_READ_SEARCH_COST_CLASSES = vocabulary(["native_index", "scan"]);
|
|
@@ -1202,17 +1148,6 @@ var CEAL_REFRESH_FAILURE_CODES = vocabulary([
|
|
|
1202
1148
|
"refresh_recovery_expired"
|
|
1203
1149
|
]);
|
|
1204
1150
|
|
|
1205
|
-
// packages/ceal-client-protocol/src/leased-artifact-contract.ts
|
|
1206
|
-
var CEAL_LEASED_CONSUMER_ARTIFACT_CHUNK_MAX_BYTES = 12 * 1024;
|
|
1207
|
-
|
|
1208
|
-
// packages/ceal-client-protocol/src/leased-resource-stream.ts
|
|
1209
|
-
var CEAL_LEASED_CONSUMER_ATTACHMENT_STREAM_MAGIC = new Uint8Array([67, 69, 65, 76, 82, 83, 50, 0]);
|
|
1210
|
-
var CEAL_LEASED_CONSUMER_ATTACHMENT_STREAM_RECORD_PREFIX_BYTES = 8;
|
|
1211
|
-
var CEAL_LEASED_CONSUMER_ATTACHMENT_STREAM_MAX_HEADER_BYTES = 16 * 1024;
|
|
1212
|
-
var CEAL_LEASED_CONSUMER_ATTACHMENT_STREAM_CHUNK_BYTES = 64 * 1024;
|
|
1213
|
-
var CEAL_LEASED_CONSUMER_ATTACHMENT_STREAM_MAX_RECORD_BYTES = CEAL_LEASED_CONSUMER_ATTACHMENT_STREAM_RECORD_PREFIX_BYTES + CEAL_LEASED_CONSUMER_ATTACHMENT_STREAM_MAX_HEADER_BYTES + CEAL_LEASED_CONSUMER_ATTACHMENT_STREAM_CHUNK_BYTES;
|
|
1214
|
-
var CEAL_ATTACHMENT_UNREAD_REASONS = vocabulary(["blocked", "unavailable", "too_large", "unsupported", "download_failed", "digest_mismatch"]);
|
|
1215
|
-
|
|
1216
1151
|
// packages/ceal-client-protocol/src/request-validation-primitives.ts
|
|
1217
1152
|
import { createHash as createHash2 } from "node:crypto";
|
|
1218
1153
|
var DIGEST = /^[a-f0-9]{64}$/u;
|
|
@@ -1379,6 +1314,10 @@ var CEAL_REQUEST_RUN_BATCH_JSON_SCHEMA = {
|
|
|
1379
1314
|
};
|
|
1380
1315
|
|
|
1381
1316
|
// packages/ceal-client-protocol/src/host-observation.ts
|
|
1317
|
+
var CEAL_HOST_INPUT_KINDS = vocabulary(["human", "host_automatic"]);
|
|
1318
|
+
function isCealHostInputKind(value) {
|
|
1319
|
+
return typeof value === "string" && CEAL_HOST_INPUT_KINDS.some((kind) => kind === value);
|
|
1320
|
+
}
|
|
1382
1321
|
var CEAL_HOST_OBSERVATION_REF_PREFIX = "host-observation:";
|
|
1383
1322
|
var HOST_OBSERVATION_PRODUCER = /^[a-z][a-z0-9]{0,31}$/u;
|
|
1384
1323
|
var HOST_OBSERVATION_DIGEST = /^[a-f0-9]{8,64}$/u;
|
|
@@ -1441,12 +1380,6 @@ var OWNER_WRITE_STATES = Object.freeze(["attempt_started", "provider_acknowledge
|
|
|
1441
1380
|
var OWNER_EFFECT_STATES = Object.freeze(["none", "applied", "failed", "unknown", "reconciled"]);
|
|
1442
1381
|
var OWNER_RECEIPT_STATES = Object.freeze(["pending", "available", "failed", "unknown", "reconciled"]);
|
|
1443
1382
|
|
|
1444
|
-
// packages/ceal-client-protocol/src/thread-excerpt.ts
|
|
1445
|
-
var CEAL_THREAD_RECENT_WINDOW = 6;
|
|
1446
|
-
var CEAL_THREAD_LAST_APP_MESSAGES_WINDOW = 3;
|
|
1447
|
-
var CEAL_THREAD_OLDER_SUMMARY_WINDOW = 4;
|
|
1448
|
-
var CEAL_FED_THREAD_MESSAGE_LIMIT = CEAL_THREAD_RECENT_WINDOW + CEAL_THREAD_OLDER_SUMMARY_WINDOW + CEAL_THREAD_LAST_APP_MESSAGES_WINDOW;
|
|
1449
|
-
|
|
1450
1383
|
// packages/ceal-client-protocol/src/request-graph-readiness.ts
|
|
1451
1384
|
var REQUEST_GRAPH_PRODUCER_TO_APPEND_SCHEMA = {
|
|
1452
1385
|
type: "object",
|
|
@@ -1535,26 +1468,11 @@ var CEAL_HOST_INVOCATION_AUTHENTICATION_RESULT_MAX_BYTES = new TextEncoder().enc
|
|
|
1535
1468
|
`).byteLength;
|
|
1536
1469
|
|
|
1537
1470
|
// packages/ceal-client-protocol/src/client-result-materialization.ts
|
|
1471
|
+
var CEAL_UNREAD_REASONS = vocabulary(["blocked", "unavailable", "too_large", "unsupported", "download_failed", "permission_denied"]);
|
|
1538
1472
|
var CEAL_MODEL_VISIBLE_COMMAND_OUTPUT_MAX_BYTES = 32 * 1024;
|
|
1539
1473
|
var REQUIRED_FIELDS2 = Object.freeze(["schema_version", "operation_id"]);
|
|
1540
1474
|
var FIELDS = /* @__PURE__ */ new Set([...REQUIRED_FIELDS2, "read_argv", "local_result_root", "continue_argv", "model_disclosure", "item_read_argv"]);
|
|
1541
1475
|
|
|
1542
|
-
// packages/ceal-client-protocol/src/session-start-affordance.ts
|
|
1543
|
-
var CEAL_SESSION_ENTRY_INVOCATION = "ceal";
|
|
1544
|
-
var CEAL_LINK_RESOURCE_PRECEDENCE = `When the user asks to use Ceal or provides a link to information that may be available through installed organizational capabilities, run bare \`${CEAL_SESSION_ENTRY_INVOCATION}\`. The Host supplies the current user prompt without exposing it to the client command, and the Gateway returns the applicable entry in that one response. Treat a supplied link as a candidate Ceal resource rather than a public web-search target. Reach for a generic web fetch or web search only when the Gateway offered nothing.`;
|
|
1545
|
-
|
|
1546
|
-
// packages/ceal-client-protocol/src/conversation-contracts.ts
|
|
1547
|
-
var CEAL_APPROVAL_POLICY_KINDS = vocabulary(["requester_only", "named_users", "role_based"]);
|
|
1548
|
-
var CEAL_APPROVAL_TARGET_KINDS = vocabulary([
|
|
1549
|
-
"repo_change",
|
|
1550
|
-
"investigation",
|
|
1551
|
-
"skill_creation",
|
|
1552
|
-
"command_creation",
|
|
1553
|
-
"connector_creation",
|
|
1554
|
-
"generic"
|
|
1555
|
-
]);
|
|
1556
|
-
var CEAL_PROGRESS_PHASES = vocabulary(["request_review", "information_gathering", "work_execution", "result_check"]);
|
|
1557
|
-
|
|
1558
1476
|
// packages/ceal-client-protocol/src/gateway-cache-origin-validation.ts
|
|
1559
1477
|
var CEAL_MAX_CACHE_ORIGIN_AGE_MS = 30 * 24 * 60 * 60 * 1e3;
|
|
1560
1478
|
|
|
@@ -1914,13 +1832,13 @@ function validTurn(value) {
|
|
|
1914
1832
|
return exactOptional(value, ["local_session_ref", "local_turn_ref"], ["model", "observations"]) && safeRef(value.local_session_ref) && safeRef(value.local_turn_ref) && optionalText(value.model, 256) && validObservations(value.observations);
|
|
1915
1833
|
}
|
|
1916
1834
|
function validInput(value) {
|
|
1917
|
-
return exactOptional(value, ["local_session_ref", "local_turn_ref", "local_input_ref", "origin_input", "observations"], ["
|
|
1835
|
+
return exactOptional(value, ["local_session_ref", "local_turn_ref", "local_input_ref", "input_kind", "origin_input", "observations"], ["local_turn_aliases", "context_expires_at"]) && safeRef(value.local_session_ref) && safeRef(value.local_turn_ref) && safeRef(value.local_input_ref) && validInputObservations(value.observations) && isCealHostInputKind(value.input_kind) && typeof value.origin_input === "boolean" && validInputOptionals(value);
|
|
1918
1836
|
}
|
|
1919
1837
|
function validInputObservations(value) {
|
|
1920
1838
|
return validObservations(value) && Array.isArray(value) && value.filter((item) => record(item) && item.observation_kind === "prompt").length === 1;
|
|
1921
1839
|
}
|
|
1922
1840
|
function validInputOptionals(value) {
|
|
1923
|
-
return
|
|
1841
|
+
return optionalRefs(value.local_turn_aliases) && (value.context_expires_at === void 0 || timestamp(value.context_expires_at));
|
|
1924
1842
|
}
|
|
1925
1843
|
function validTerminal(value) {
|
|
1926
1844
|
return exactOptional(value, ["local_session_ref", "local_turn_ref", "terminal_state"], ["abort_reason", "duration_ms", "time_to_first_token_ms", "usage", "observations"]) && safeRef(value.local_session_ref) && safeRef(value.local_turn_ref) && validTerminalDisposition(value.terminal_state, value.abort_reason) && optionalNonNegative(value.duration_ms) && optionalNonNegative(value.time_to_first_token_ms) && (value.usage === void 0 || jsonValue(value.usage)) && validObservations(value.observations);
|
|
@@ -1931,9 +1849,6 @@ function validTerminalDisposition(state, reason) {
|
|
|
1931
1849
|
function validStatus(value) {
|
|
1932
1850
|
return exactOptional(value, ["status", "reason_code"], ["detail"]) && ["ready", "degraded", "stopping"].includes(String(value.status)) && safeRef(value.reason_code) && optionalText(value.detail, 4096);
|
|
1933
1851
|
}
|
|
1934
|
-
function validDecision(value) {
|
|
1935
|
-
return value === void 0 || record(value) && exactKeys(value, ["decision", "approval_ref"]) && (value.decision === "approved" || value.decision === "denied") && safeRef(value.approval_ref);
|
|
1936
|
-
}
|
|
1937
1852
|
function optionalText(value, maxLength) {
|
|
1938
1853
|
return value === void 0 || typeof value === "string" && value.length > 0 && value.length <= maxLength;
|
|
1939
1854
|
}
|
|
@@ -2498,10 +2413,6 @@ var CodexOutboxStore = class {
|
|
|
2498
2413
|
await removeOwnerState(this.registrationPath(registration.host_source_ref, registration.host_session_ref), "registration");
|
|
2499
2414
|
await removeOwnerState(this.cursorPath(registration.host_source_ref, registration.host_session_ref), "cursor");
|
|
2500
2415
|
}
|
|
2501
|
-
async relayWakeDirectories() {
|
|
2502
|
-
await this.prepare();
|
|
2503
|
-
return { entries: this.entriesDirectory, registrations: this.registrationsDirectory };
|
|
2504
|
-
}
|
|
2505
2416
|
async listTranscriptRegistrations() {
|
|
2506
2417
|
await this.prepare();
|
|
2507
2418
|
const registrations = [];
|
|
@@ -2691,7 +2602,7 @@ async function readPrivateFile(path) {
|
|
|
2691
2602
|
}
|
|
2692
2603
|
function validateEnvelope(value) {
|
|
2693
2604
|
if (!isRecord3(value)) throw storageError("Codex outbox entry is malformed.");
|
|
2694
|
-
if (!sameKeys(value, ["schema_version", "identity", "host_input_ref", "prompt_ref", "observations", "origin_input", "submission_ref", "created_at", "expires_at"], ["request_ref", "codex_turn_id"])) throw storageError(`Codex outbox entry key set is malformed (${refusalFact("keys", Object.keys(value), "exactly the outbox entry key set")}).`);
|
|
2605
|
+
if (!sameKeys(value, ["schema_version", "identity", "host_input_ref", "input_kind", "prompt_ref", "observations", "origin_input", "submission_ref", "created_at", "expires_at"], ["request_ref", "codex_turn_id"])) throw storageError(`Codex outbox entry key set is malformed (${refusalFact("keys", Object.keys(value), "exactly the outbox entry key set")}).`);
|
|
2695
2606
|
if (value.schema_version !== CODEX_OUTBOX_SCHEMA_VERSION) throw storageError(`Codex outbox entry is malformed (${refusalFact("schema_version", value.schema_version, `expected ${CODEX_OUTBOX_SCHEMA_VERSION}`)}).`);
|
|
2696
2607
|
validateIdentity3(value.identity);
|
|
2697
2608
|
validateEnvelopeReferences(value);
|
|
@@ -2700,6 +2611,7 @@ function validateEnvelope(value) {
|
|
|
2700
2611
|
}
|
|
2701
2612
|
function validateEnvelopeReferences(value) {
|
|
2702
2613
|
if (!SAFE_REF4.test(String(value.host_input_ref))) throw storageError("Codex outbox input reference is malformed.");
|
|
2614
|
+
if (!isCealHostInputKind(value.input_kind)) throw storageError("Codex outbox input provenance is malformed.");
|
|
2703
2615
|
if (!SAFE_REF4.test(String(value.prompt_ref))) throw storageError("Codex outbox references are malformed.");
|
|
2704
2616
|
if (!SAFE_REF4.test(String(value.submission_ref))) throw storageError("Codex outbox references are malformed.");
|
|
2705
2617
|
if (value.request_ref !== void 0 && !SAFE_REF4.test(String(value.request_ref))) throw storageError("Codex outbox Request reference is malformed.");
|
|
@@ -2939,6 +2851,7 @@ var CodexProducer = class {
|
|
|
2939
2851
|
local_session_ref: envelope.identity.host_session_ref,
|
|
2940
2852
|
local_turn_ref: localTurnRef(envelope),
|
|
2941
2853
|
local_input_ref: envelope.host_input_ref,
|
|
2854
|
+
input_kind: envelope.input_kind,
|
|
2942
2855
|
origin_input: envelope.origin_input,
|
|
2943
2856
|
observations: [prompt],
|
|
2944
2857
|
local_turn_aliases: envelope.codex_turn_id === void 0 ? void 0 : [envelope.codex_turn_id],
|
|
@@ -3186,18 +3099,24 @@ function decodeTokenUsage(value) {
|
|
|
3186
3099
|
function decodeResponseItem(payload, ordinal, timestamp5) {
|
|
3187
3100
|
if (payload.type !== "message" || payload.role !== "user") return { kind: "ignored", ordinal, timestamp: timestamp5 };
|
|
3188
3101
|
const metadata = userMessageMetadata(payload.internal_chat_message_metadata_passthrough);
|
|
3189
|
-
const
|
|
3190
|
-
if (
|
|
3102
|
+
const inputKind = inputKindFromContentItems(metadata.content_item_kinds);
|
|
3103
|
+
if (inputKind === void 0) return { kind: "ignored", ordinal, timestamp: timestamp5 };
|
|
3191
3104
|
const prompt = userTextContent(payload.content);
|
|
3192
3105
|
return {
|
|
3193
3106
|
kind: "user_text",
|
|
3194
3107
|
ordinal,
|
|
3195
3108
|
timestamp: timestamp5,
|
|
3196
3109
|
prompt,
|
|
3110
|
+
input_kind: inputKind,
|
|
3197
3111
|
message_id: safeRef3(payload.id, "Codex user message identity is invalid."),
|
|
3198
3112
|
turn_id: safeRef3(metadata.turn_id, "Codex user message task identity is invalid.")
|
|
3199
3113
|
};
|
|
3200
3114
|
}
|
|
3115
|
+
function inputKindFromContentItems(kinds) {
|
|
3116
|
+
if (kinds.length !== 1) return void 0;
|
|
3117
|
+
if (kinds[0] === "user.text") return "human";
|
|
3118
|
+
return kinds[0] === "goal.internal_context" ? "host_automatic" : void 0;
|
|
3119
|
+
}
|
|
3201
3120
|
function userMessageMetadata(value) {
|
|
3202
3121
|
if (!isRecord5(value) || !Array.isArray(value.content_item_kinds)) reject("Codex user message provenance is malformed.");
|
|
3203
3122
|
return { ...value, content_item_kinds: value.content_item_kinds };
|
|
@@ -3782,6 +3701,7 @@ var CodexTranscriptWatcher = class {
|
|
|
3782
3701
|
schema_version: "ceal.codex_observation_outbox.v1",
|
|
3783
3702
|
identity,
|
|
3784
3703
|
host_input_ref: hostInputRef,
|
|
3704
|
+
input_kind: record3.input_kind,
|
|
3785
3705
|
prompt_ref: promptRef,
|
|
3786
3706
|
observations,
|
|
3787
3707
|
codex_turn_id: record3.turn_id,
|
|
@@ -3808,6 +3728,7 @@ var CodexTranscriptWatcher = class {
|
|
|
3808
3728
|
schema_version: "ceal.codex_observation_outbox.v1",
|
|
3809
3729
|
identity,
|
|
3810
3730
|
host_input_ref: activeTask.origin_host_input_ref,
|
|
3731
|
+
input_kind: "host_automatic",
|
|
3811
3732
|
prompt_ref: activeTask.prompt_ref,
|
|
3812
3733
|
observations,
|
|
3813
3734
|
codex_turn_id: record3.turn_id,
|