@corca-org/ceal-host-linux-arm64 1.0.16 → 1.0.18
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 +98 -164
- package/libexec/ceal-host/claude-invocation-authentication.mjs +101 -166
- package/libexec/ceal-host/claude-producer.mjs +101 -166
- package/libexec/ceal-host/codex-hook.mjs +122 -644
- package/libexec/ceal-host/codex-invocation-authentication.mjs +115 -531
- package/libexec/ceal-host/codex-producer.mjs +115 -531
- package/libexec/ceal-host/control.mjs +138 -551
- package/libexec/ceal-host/relay.mjs +471 -220
- package/package.json +1 -1
- package/share/ceal-host/bundle-manifest.json +12 -12
- package/share/ceal-host/bundle-manifest.sigstore.json +1 -1
|
@@ -215,7 +215,7 @@ var CEAL_GATEWAY_DERIVED_STORE_FAILURE_CLASSES = vocabulary(["storage_unavailabl
|
|
|
215
215
|
var CEAL_POLICY_DECISIONS = vocabulary(["allowed", "denied", "not_evaluated"]);
|
|
216
216
|
var CEAL_CONNECTOR_ROUTE_PHASES = vocabulary(["scope_observation", "target_selection", "route_resolution"]);
|
|
217
217
|
var CEAL_CONNECTOR_ROUTE_CAUSES = vocabulary(["provider_throttled", "provider_unavailable", "binding_invalid", "scope_limit_exceeded"]);
|
|
218
|
-
var CEAL_WRITE_SOURCE_KINDS = vocabulary(["authenticated_registered_client", "
|
|
218
|
+
var CEAL_WRITE_SOURCE_KINDS = vocabulary(["authenticated_registered_client", "provider_authenticated_event"]);
|
|
219
219
|
var CEAL_REFRESH_DELIVERIES = vocabulary(["initial", "recovery", "replay", "terminal_failure", "recovery_unavailable"]);
|
|
220
220
|
var CEAL_CLIENT_OPERATIONS = vocabulary(["handshake", "discover", "call", "readback"]);
|
|
221
221
|
var CEAL_WRITE_IDEMPOTENCY_POSTURES = vocabulary(["required", "optional", "not_required"]);
|
|
@@ -368,6 +368,7 @@ var CEAL_OPERATION_WITHHELD_CAUSES = vocabulary(["provider_permission", "access_
|
|
|
368
368
|
// packages/ceal-client-protocol/src/operation-contract-types.ts
|
|
369
369
|
var CEAL_JSON_SCHEMA_2020_12 = "https://json-schema.org/draft/2020-12/schema";
|
|
370
370
|
var CEAL_OPERATION_ERROR_SCHEMA_VERSION = "ceal.operation_error.v1";
|
|
371
|
+
var CEAL_ARTIFACT_STAGE_TERMINALS = vocabulary(["chunk_accepted", "artifact_ready", "idempotency_replayed"]);
|
|
371
372
|
var CEAL_RETRY_AFTER_MAX_MS = 60 * 60 * 1e3;
|
|
372
373
|
var CEAL_JSON_SCHEMA_TYPES = vocabulary(["object", "array", "string", "integer", "number", "boolean", "null"]);
|
|
373
374
|
var OBSERVATION_POSTURES = vocabulary(["direct_readback", "approved_no_readback", "operator_mediated", "excluded"]);
|
|
@@ -741,9 +742,6 @@ var CEAL_OPERATION_AUTHORITY_POLICY_KEYS = Object.freeze(["access_group", "insta
|
|
|
741
742
|
var MAX_OPERATION_INPUT_RESOLVER_BINDINGS = 96;
|
|
742
743
|
var CEAL_OPERATION_DESCRIPTOR_REQUIRED_ENVELOPE_KEYS = Object.freeze(["schema_version", "id", "input_contract", "result_contract", "policy"]);
|
|
743
744
|
var CEAL_OPERATION_DESCRIPTOR_OPTIONAL_ENVELOPE_KEYS = Object.freeze(["input_resolution", "summary"]);
|
|
744
|
-
var CEAL_OPERATION_RESULT_KEYS = vocabulary(["ok", "operation_id", "operation_receipt", "schema_version", "value"]);
|
|
745
|
-
var CEAL_OPERATION_COMPACT_RESULT_KEYS = vocabulary(["ok", "operation_evidence", "operation_id", "schema_version", "value"]);
|
|
746
|
-
var CEAL_OPERATION_RESULT_OPTIONAL_KEYS = vocabulary(["model_disclosure", "result_complete", "resume"]);
|
|
747
745
|
|
|
748
746
|
// packages/ceal-client-protocol/src/operation-catalog.ts
|
|
749
747
|
var CEAL_OPERATION_CATALOG_SCHEMA_VERSION = "ceal.catalog.v3";
|
|
@@ -807,10 +805,6 @@ var CEAL_SCHEMA_LITERALS = [
|
|
|
807
805
|
"ceal.host_observation.v1",
|
|
808
806
|
"ceal.host_registration_request.v1",
|
|
809
807
|
"ceal.host_registration_result.v1",
|
|
810
|
-
"ceal.leased-resource-stream.v1",
|
|
811
|
-
"ceal.leased_consumer_attachment_stream_frame.v1",
|
|
812
|
-
"ceal.leased_consumer_attachment_stream_request.v1",
|
|
813
|
-
"ceal.leased_consumer_attachment_stream_transport.v1",
|
|
814
808
|
"ceal.operation_descriptor.v1",
|
|
815
809
|
"ceal.operation_error.v1",
|
|
816
810
|
"ceal.operation_failure.v1",
|
|
@@ -836,12 +830,6 @@ var CEAL_SCHEMA_LITERAL_SET = new Set(CEAL_SCHEMA_LITERALS);
|
|
|
836
830
|
// packages/ceal-client-protocol/src/bounded-series.ts
|
|
837
831
|
import { join } from "node:path";
|
|
838
832
|
var CEAL_BOUNDED_SERIES_CATALOG = Object.freeze({
|
|
839
|
-
usage_record: (root) => join(root, "run-usage.jsonl"),
|
|
840
|
-
control_commit: (root) => join(root, "control-auto-commit.jsonl"),
|
|
841
|
-
engagement_signal: (root) => join(root, "runtime-state", "slack-feedback.jsonl"),
|
|
842
|
-
runtime_error: (root) => join(root, "runtime-state", "runtime-errors.jsonl"),
|
|
843
|
-
turn_bridge_request: (root) => join(root, ".ceal", "turn-bridge", "requests.jsonl"),
|
|
844
|
-
thread_run_events: (root) => join(root, "run-events.jsonl"),
|
|
845
833
|
bounded_store_sidecar: (root) => `${root}.jsonl`,
|
|
846
834
|
gateway_audit_archive: (root) => `${root}.jsonl`,
|
|
847
835
|
gateway_access_group_connector_control_audit: (root) => `${root}.audit.jsonl`,
|
|
@@ -874,35 +862,6 @@ var CEAL_HOST_REGISTRATION_ATTEMPT_REF_PATTERN = new RegExp(`^host-registration-
|
|
|
874
862
|
var CEAL_HOST_INSTALLATION_REF_PATTERN = new RegExp(`^host-installation:${CEAL_LOWERCASE_UUID_PATTERN}$`, "u");
|
|
875
863
|
var CEAL_HOST_SOURCE_REF_PATTERN = new RegExp(`^host-source:${CEAL_LOWERCASE_UUID_PATTERN}$`, "u");
|
|
876
864
|
|
|
877
|
-
// packages/ceal-client-protocol/src/agent-session-handoff.ts
|
|
878
|
-
var CEAL_AGENT_ADMISSION_PHASES = vocabulary([
|
|
879
|
-
"incumbent_admitted",
|
|
880
|
-
"incumbent_draining",
|
|
881
|
-
"drained",
|
|
882
|
-
"candidate_admitted",
|
|
883
|
-
"candidate_draining",
|
|
884
|
-
"rollback_admitted"
|
|
885
|
-
]);
|
|
886
|
-
var CEAL_AGENT_SERVICE_SESSION_RECORD_KEYS = vocabulary([
|
|
887
|
-
"admission_fence",
|
|
888
|
-
"admission_state",
|
|
889
|
-
"admission_state_generation",
|
|
890
|
-
"bearer",
|
|
891
|
-
"consumer_ref",
|
|
892
|
-
"credential_generation",
|
|
893
|
-
"expires_at",
|
|
894
|
-
"gateway_instance",
|
|
895
|
-
"gateway_origin",
|
|
896
|
-
"gateway_serving_generation",
|
|
897
|
-
"issued_at",
|
|
898
|
-
"record_sha256",
|
|
899
|
-
"renew_after",
|
|
900
|
-
"renew_by",
|
|
901
|
-
"schema_version",
|
|
902
|
-
"session_revision"
|
|
903
|
-
]);
|
|
904
|
-
var CEAL_AGENT_SESSION_COMMIT_KEYS = vocabulary(["attempt_ref", "expected_session_revision", "session_revision"]);
|
|
905
|
-
|
|
906
865
|
// packages/ceal-client-protocol/src/operation-result-completeness.ts
|
|
907
866
|
var CEAL_READ_VALUE_CONTINUATION_KEYS = vocabulary(["continuation", "continuation_ref", "next_cursor"]);
|
|
908
867
|
|
|
@@ -913,7 +872,9 @@ var CEAL_OPERATION_INVOKE_COMMAND = "invoke";
|
|
|
913
872
|
var CEAL_OPERATION_INPUT_FLAG = "--input";
|
|
914
873
|
var CEAL_OPERATION_ID_PLACEHOLDER = "<operation-id>";
|
|
915
874
|
var CEAL_OPERATION_INPUT_PLACEHOLDER = "<json-object>";
|
|
916
|
-
var
|
|
875
|
+
var MODEL_INVOCATION_BASE_ARGUMENTS = [CEAL_OPERATION_INVOKE_COMMAND, CEAL_OPERATION_ID_PLACEHOLDER].join(" ");
|
|
876
|
+
var CEAL_MODEL_INVOCATION_ARGUMENTS = [MODEL_INVOCATION_BASE_ARGUMENTS, CEAL_OPERATION_INPUT_FLAG, shellSingleQuoted(CEAL_OPERATION_INPUT_PLACEHOLDER)].join(" ");
|
|
877
|
+
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.`;
|
|
917
878
|
function shellSingleQuoted(value) {
|
|
918
879
|
return `'${value.replaceAll("'", "'\\''")}'`;
|
|
919
880
|
}
|
|
@@ -945,19 +906,73 @@ var CEAL_VERIFIED_ARTIFACT_DESCRIPTOR_JSON_SCHEMA = Object.freeze({
|
|
|
945
906
|
}
|
|
946
907
|
});
|
|
947
908
|
|
|
909
|
+
// packages/ceal-client-protocol/src/provider-operation-vocabulary.ts
|
|
910
|
+
var CEAL_FILE_TYPE_FAMILIES = vocabulary(["all", "image", "pdf"]);
|
|
911
|
+
var CEAL_GITHUB_ISSUE_STATES = vocabulary(["open", "closed", "all"]);
|
|
912
|
+
var CEAL_NOTION_UPDATABLE_BLOCK_TYPES = vocabulary([
|
|
913
|
+
"paragraph",
|
|
914
|
+
"heading_1",
|
|
915
|
+
"heading_2",
|
|
916
|
+
"heading_3",
|
|
917
|
+
"bulleted_list_item",
|
|
918
|
+
"numbered_list_item",
|
|
919
|
+
"to_do",
|
|
920
|
+
"code"
|
|
921
|
+
]);
|
|
922
|
+
var CEAL_NOTION_NEUTRAL_TYPES = vocabulary([
|
|
923
|
+
"text",
|
|
924
|
+
"number",
|
|
925
|
+
"boolean",
|
|
926
|
+
"date",
|
|
927
|
+
"select",
|
|
928
|
+
"multi_select",
|
|
929
|
+
"people",
|
|
930
|
+
"url",
|
|
931
|
+
"email",
|
|
932
|
+
"phone",
|
|
933
|
+
"unsupported"
|
|
934
|
+
]);
|
|
935
|
+
var CEAL_NOTION_IDENTITY_GAP_REASONS = vocabulary([
|
|
936
|
+
"identity_unavailable",
|
|
937
|
+
"identity_stale",
|
|
938
|
+
"identity_ambiguous",
|
|
939
|
+
"identity_revoked",
|
|
940
|
+
"identity_unlinked"
|
|
941
|
+
]);
|
|
942
|
+
var CEAL_NOTION_STRING_VALUE_TYPES = vocabulary(["text", "select", "url", "email", "phone"]);
|
|
943
|
+
|
|
944
|
+
// packages/ceal-client-protocol/src/opaque-reference.ts
|
|
945
|
+
var CEAL_OPAQUE_HANDLE_KINDS = vocabulary(["target", "message", "thread", "artifact", "document", "block", "object"]);
|
|
946
|
+
var CEAL_OPAQUE_REF_KINDS = vocabulary([...CEAL_OPAQUE_HANDLE_KINDS, "result", "operation-receipt", "reply-receipt", "field", "notion-data-source"]);
|
|
947
|
+
|
|
948
948
|
// packages/ceal-client-protocol/src/bare-document.ts
|
|
949
949
|
var REQUIRED_FIELDS = CEAL_CLIENT_WIRE_CONTRACT.command_response.bare_document_fields;
|
|
950
950
|
var OPTIONAL_FIELDS = CEAL_CLIENT_WIRE_CONTRACT.command_response.bare_document_optional_fields;
|
|
951
951
|
|
|
952
|
-
// packages/ceal-client-protocol/src/
|
|
953
|
-
var
|
|
954
|
-
var
|
|
955
|
-
var
|
|
956
|
-
var
|
|
952
|
+
// packages/ceal-client-protocol/src/resource-row.ts
|
|
953
|
+
var CEAL_RESOURCE_SEARCH_ORDERS = vocabulary(["relevance", "modified", "viewed", "created"]);
|
|
954
|
+
var CEAL_RESOURCE_SEARCH_DIRECTIONS = vocabulary(["ascending", "descending"]);
|
|
955
|
+
var CEAL_RESOURCE_SEARCH_FILTERS = vocabulary(["query", "modified_since", "since", "until", "authored_by_me", "authored_by", "include_replies", "kinds", "container_ref", "container_refs", "container_names", "addressed_to_me", "unread"]);
|
|
956
|
+
var CEAL_RESOURCE_TIME_BASES = vocabulary(["created", "modified", "viewed"]);
|
|
957
957
|
var CEAL_REPOSITORY_VISIBILITIES = vocabulary(["public", "private", "internal"]);
|
|
958
|
-
var
|
|
959
|
-
var
|
|
960
|
-
|
|
958
|
+
var CEAL_ACTIVITY_V3_KINDS = vocabulary(["authored", "edited", "messaged", "responded"]);
|
|
959
|
+
var CEAL_ACTIVITY_TIMESTAMP_BASES = vocabulary([
|
|
960
|
+
"message_created",
|
|
961
|
+
"commit_authored",
|
|
962
|
+
"resource_created",
|
|
963
|
+
"review_submitted",
|
|
964
|
+
"comment_created",
|
|
965
|
+
"event_start",
|
|
966
|
+
"all_day_start",
|
|
967
|
+
"file_created",
|
|
968
|
+
"file_modified",
|
|
969
|
+
"file_modified_by_me",
|
|
970
|
+
"file_viewed_by_me",
|
|
971
|
+
"page_created",
|
|
972
|
+
"page_last_edited",
|
|
973
|
+
"resource_modified"
|
|
974
|
+
]);
|
|
975
|
+
var CEAL_ACTIVITY_CONNECTOR_KINDS = vocabulary(["slack", "github", "google-calendar", "google-drive", "notion"]);
|
|
961
976
|
var CEAL_ACTIVITY_GAP_CODES = vocabulary([
|
|
962
977
|
"provider_page_budget",
|
|
963
978
|
"call_deadline",
|
|
@@ -968,8 +983,6 @@ var CEAL_ACTIVITY_GAP_CODES = vocabulary([
|
|
|
968
983
|
"unsupported_event_kind",
|
|
969
984
|
"direct_messages_excluded"
|
|
970
985
|
]);
|
|
971
|
-
var CEAL_ACTIVITY_CONNECTOR_KINDS = vocabulary(["slack", "github", "google-calendar", "google-drive", "notion"]);
|
|
972
|
-
var CEAL_ACTIVITY_COVERAGE_STATUSES = vocabulary(["complete_for_target", "continuation_required", "blocked"]);
|
|
973
986
|
var CEAL_ACTIVITY_EVENT_KINDS = vocabulary([
|
|
974
987
|
"slack.message",
|
|
975
988
|
"slack.reply",
|
|
@@ -1010,73 +1023,6 @@ var CEAL_ACTIVITY_EVENT_TIMESTAMP_BASIS_MAP = Object.freeze({
|
|
|
1010
1023
|
"notion.page.created": "page_created",
|
|
1011
1024
|
"notion.page.edited": "page_last_edited"
|
|
1012
1025
|
});
|
|
1013
|
-
var CEAL_ACTIVITY_TIMESTAMP_BASES = vocabulary([
|
|
1014
|
-
"message_created",
|
|
1015
|
-
"commit_authored",
|
|
1016
|
-
"resource_created",
|
|
1017
|
-
"review_submitted",
|
|
1018
|
-
"comment_created",
|
|
1019
|
-
"event_start",
|
|
1020
|
-
"all_day_start",
|
|
1021
|
-
"file_created",
|
|
1022
|
-
"file_modified",
|
|
1023
|
-
"file_modified_by_me",
|
|
1024
|
-
"file_viewed_by_me",
|
|
1025
|
-
"page_created",
|
|
1026
|
-
"page_last_edited",
|
|
1027
|
-
"resource_modified"
|
|
1028
|
-
]);
|
|
1029
|
-
var CEAL_ACTIVITY_V3_KINDS = vocabulary(["authored", "edited", "messaged", "responded"]);
|
|
1030
|
-
var CEAL_RESOURCE_TIME_BASES = vocabulary(["created", "modified", "viewed"]);
|
|
1031
|
-
var CEAL_RESOURCE_SEARCH_ORDERS = vocabulary(["relevance", "modified", "viewed", "created"]);
|
|
1032
|
-
var CEAL_RESOURCE_SEARCH_DIRECTIONS = vocabulary(["ascending", "descending"]);
|
|
1033
|
-
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"]);
|
|
1034
|
-
var CEAL_ARTIFACT_STAGE_TERMINALS = vocabulary(["chunk_accepted", "artifact_ready", "idempotency_replayed"]);
|
|
1035
|
-
var CEAL_READ_ITEM_KINDS = vocabulary(["conversation", "identity", "usergroup", "message", "file", "document"]);
|
|
1036
|
-
var CEAL_LEASED_MESSAGE_SEARCH_COMPLETENESS = vocabulary(["complete", "continuation_available", "truncated"]);
|
|
1037
|
-
var CEAL_OPAQUE_HANDLE_KINDS = vocabulary(["target", "message", "thread", "artifact", "document", "block", "object"]);
|
|
1038
|
-
var CEAL_OPAQUE_REF_KINDS = vocabulary([...CEAL_OPAQUE_HANDLE_KINDS, "result", "operation-receipt", "reply-receipt", "field", "notion-data-source"]);
|
|
1039
|
-
var CEAL_WRITE_OBJECT_KINDS = vocabulary(["document", "comment", "cell_range"]);
|
|
1040
|
-
var CEAL_CONVERSATION_KINDS = vocabulary(["channel", "dm", "group"]);
|
|
1041
|
-
var CEAL_FILE_TYPE_FAMILIES = vocabulary(["all", "image", "pdf"]);
|
|
1042
|
-
var CEAL_GITHUB_ISSUE_STATES = vocabulary(["open", "closed", "all"]);
|
|
1043
|
-
var CEAL_NOTION_UPDATABLE_BLOCK_TYPES = vocabulary([
|
|
1044
|
-
"paragraph",
|
|
1045
|
-
"heading_1",
|
|
1046
|
-
"heading_2",
|
|
1047
|
-
"heading_3",
|
|
1048
|
-
"bulleted_list_item",
|
|
1049
|
-
"numbered_list_item",
|
|
1050
|
-
"to_do",
|
|
1051
|
-
"code"
|
|
1052
|
-
]);
|
|
1053
|
-
var CEAL_NOTION_NEUTRAL_TYPES = vocabulary([
|
|
1054
|
-
"text",
|
|
1055
|
-
"number",
|
|
1056
|
-
"boolean",
|
|
1057
|
-
"date",
|
|
1058
|
-
"select",
|
|
1059
|
-
"multi_select",
|
|
1060
|
-
"people",
|
|
1061
|
-
"url",
|
|
1062
|
-
"email",
|
|
1063
|
-
"phone",
|
|
1064
|
-
"unsupported"
|
|
1065
|
-
]);
|
|
1066
|
-
var CEAL_NOTION_IDENTITY_GAP_REASONS = vocabulary([
|
|
1067
|
-
"identity_unavailable",
|
|
1068
|
-
"identity_stale",
|
|
1069
|
-
"identity_ambiguous",
|
|
1070
|
-
"identity_revoked",
|
|
1071
|
-
"identity_unlinked"
|
|
1072
|
-
]);
|
|
1073
|
-
var CEAL_NOTION_STRING_VALUE_TYPES = vocabulary(["text", "select", "url", "email", "phone"]);
|
|
1074
|
-
var CEAL_UNREAD_REASONS = vocabulary(["blocked", "unavailable", "too_large", "unsupported", "download_failed", "permission_denied"]);
|
|
1075
|
-
var CEAL_PLAN_ITEM_STATUSES = vocabulary(["pending", "active", "completed"]);
|
|
1076
|
-
var CEAL_FINAL_PRESENTATION_INTENTS = vocabulary(["final", "stop", "transient_notice"]);
|
|
1077
|
-
var CEAL_PRESENTATION_INTENTS = vocabulary(["progress", ...CEAL_FINAL_PRESENTATION_INTENTS]);
|
|
1078
|
-
|
|
1079
|
-
// packages/ceal-client-protocol/src/resource-row.ts
|
|
1080
1026
|
var CEAL_DATED_NOTE_BASES = vocabulary(["recording", "calendar_event", "created_time"]);
|
|
1081
1027
|
var CEAL_DATED_NOTE_TRANSCRIPT_STATES = vocabulary(["present", "absent", "unestablished"]);
|
|
1082
1028
|
var CEAL_READ_SEARCH_COST_CLASSES = vocabulary(["native_index", "scan"]);
|
|
@@ -1085,6 +1031,7 @@ var RESOURCE_ROW_KEY_RULES = Object.freeze({
|
|
|
1085
1031
|
ref: { required: true, timestamp: false },
|
|
1086
1032
|
next: { required: true, timestamp: false },
|
|
1087
1033
|
kind: { required: true, timestamp: false },
|
|
1034
|
+
matched_kinds: { required: false, timestamp: false },
|
|
1088
1035
|
title: { required: true, timestamp: false },
|
|
1089
1036
|
container_label: { required: true, timestamp: false },
|
|
1090
1037
|
container_ref: { required: false, timestamp: false },
|
|
@@ -1161,17 +1108,6 @@ var CEAL_REFRESH_FAILURE_CODES = vocabulary([
|
|
|
1161
1108
|
"refresh_recovery_expired"
|
|
1162
1109
|
]);
|
|
1163
1110
|
|
|
1164
|
-
// packages/ceal-client-protocol/src/leased-artifact-contract.ts
|
|
1165
|
-
var CEAL_LEASED_CONSUMER_ARTIFACT_CHUNK_MAX_BYTES = 12 * 1024;
|
|
1166
|
-
|
|
1167
|
-
// packages/ceal-client-protocol/src/leased-resource-stream.ts
|
|
1168
|
-
var CEAL_LEASED_CONSUMER_ATTACHMENT_STREAM_MAGIC = new Uint8Array([67, 69, 65, 76, 82, 83, 50, 0]);
|
|
1169
|
-
var CEAL_LEASED_CONSUMER_ATTACHMENT_STREAM_RECORD_PREFIX_BYTES = 8;
|
|
1170
|
-
var CEAL_LEASED_CONSUMER_ATTACHMENT_STREAM_MAX_HEADER_BYTES = 16 * 1024;
|
|
1171
|
-
var CEAL_LEASED_CONSUMER_ATTACHMENT_STREAM_CHUNK_BYTES = 64 * 1024;
|
|
1172
|
-
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;
|
|
1173
|
-
var CEAL_ATTACHMENT_UNREAD_REASONS = vocabulary(["blocked", "unavailable", "too_large", "unsupported", "download_failed", "digest_mismatch"]);
|
|
1174
|
-
|
|
1175
1111
|
// packages/ceal-client-protocol/src/request-validation-primitives.ts
|
|
1176
1112
|
import { createHash } from "node:crypto";
|
|
1177
1113
|
var DIGEST = /^[a-f0-9]{64}$/u;
|
|
@@ -1338,6 +1274,10 @@ var CEAL_REQUEST_RUN_BATCH_JSON_SCHEMA = {
|
|
|
1338
1274
|
};
|
|
1339
1275
|
|
|
1340
1276
|
// packages/ceal-client-protocol/src/host-observation.ts
|
|
1277
|
+
var CEAL_HOST_INPUT_KINDS = vocabulary(["human", "host_automatic"]);
|
|
1278
|
+
function isCealHostInputKind(value) {
|
|
1279
|
+
return typeof value === "string" && CEAL_HOST_INPUT_KINDS.some((kind) => kind === value);
|
|
1280
|
+
}
|
|
1341
1281
|
var CEAL_HOST_OBSERVATION_REF_PREFIX = "host-observation:";
|
|
1342
1282
|
function validateCealHostObservationDraft(value) {
|
|
1343
1283
|
const record6 = operationRecord(value, "Ceal Host observation draft is invalid.");
|
|
@@ -1390,12 +1330,6 @@ var OWNER_WRITE_STATES = Object.freeze(["attempt_started", "provider_acknowledge
|
|
|
1390
1330
|
var OWNER_EFFECT_STATES = Object.freeze(["none", "applied", "failed", "unknown", "reconciled"]);
|
|
1391
1331
|
var OWNER_RECEIPT_STATES = Object.freeze(["pending", "available", "failed", "unknown", "reconciled"]);
|
|
1392
1332
|
|
|
1393
|
-
// packages/ceal-client-protocol/src/thread-excerpt.ts
|
|
1394
|
-
var CEAL_THREAD_RECENT_WINDOW = 6;
|
|
1395
|
-
var CEAL_THREAD_LAST_APP_MESSAGES_WINDOW = 3;
|
|
1396
|
-
var CEAL_THREAD_OLDER_SUMMARY_WINDOW = 4;
|
|
1397
|
-
var CEAL_FED_THREAD_MESSAGE_LIMIT = CEAL_THREAD_RECENT_WINDOW + CEAL_THREAD_OLDER_SUMMARY_WINDOW + CEAL_THREAD_LAST_APP_MESSAGES_WINDOW;
|
|
1398
|
-
|
|
1399
1333
|
// packages/ceal-client-protocol/src/request-graph-readiness.ts
|
|
1400
1334
|
var REQUEST_GRAPH_PRODUCER_TO_APPEND_SCHEMA = {
|
|
1401
1335
|
type: "object",
|
|
@@ -1483,6 +1417,16 @@ var CEAL_HOST_INVOCATION_AUTHENTICATION_RESULT_MAX_BYTES = new TextEncoder().enc
|
|
|
1483
1417
|
expires_at: (/* @__PURE__ */ new Date("+010000-01-01T00:00:00.000Z")).toISOString()
|
|
1484
1418
|
})}
|
|
1485
1419
|
`).byteLength;
|
|
1420
|
+
var CEAL_HOST_MINT_REQUEST_CONTEXT_REFUSAL_REASONS = vocabulary([
|
|
1421
|
+
"request_authority_unavailable",
|
|
1422
|
+
"request_missing",
|
|
1423
|
+
"authority_mismatch",
|
|
1424
|
+
"host_source_mismatch",
|
|
1425
|
+
"host_session_mismatch",
|
|
1426
|
+
"host_turn_mismatch",
|
|
1427
|
+
"host_input_mismatch",
|
|
1428
|
+
"host_prompt_mismatch"
|
|
1429
|
+
]);
|
|
1486
1430
|
function decodeCealHostInvocationAuthenticationRequest(value) {
|
|
1487
1431
|
if (!isCealJsonRecord(value) || !exactKeys(value, ["schema_version", "client_nonce"]) || value.schema_version !== CEAL_HOST_INVOCATION_AUTHENTICATION_REQUEST_SCHEMA || typeof value.client_nonce !== "string" || !CEAL_HOST_CLIENT_NONCE_PATTERN.test(value.client_nonce)) {
|
|
1488
1432
|
throw new TypeError("The Host invocation authentication request is invalid.");
|
|
@@ -1505,25 +1449,10 @@ function exactKeys(value, expected) {
|
|
|
1505
1449
|
}
|
|
1506
1450
|
|
|
1507
1451
|
// packages/ceal-client-protocol/src/client-result-materialization.ts
|
|
1452
|
+
var CEAL_UNREAD_REASONS = vocabulary(["blocked", "unavailable", "too_large", "unsupported", "download_failed", "permission_denied"]);
|
|
1508
1453
|
var CEAL_MODEL_VISIBLE_COMMAND_OUTPUT_MAX_BYTES = 32 * 1024;
|
|
1509
|
-
var REQUIRED_FIELDS2 = Object.freeze(["schema_version", "operation_id"]);
|
|
1510
|
-
var FIELDS = /* @__PURE__ */ new Set([...REQUIRED_FIELDS2, "
|
|
1511
|
-
|
|
1512
|
-
// packages/ceal-client-protocol/src/session-start-affordance.ts
|
|
1513
|
-
var CEAL_SESSION_ENTRY_INVOCATION = "ceal";
|
|
1514
|
-
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.`;
|
|
1515
|
-
|
|
1516
|
-
// packages/ceal-client-protocol/src/conversation-contracts.ts
|
|
1517
|
-
var CEAL_APPROVAL_POLICY_KINDS = vocabulary(["requester_only", "named_users", "role_based"]);
|
|
1518
|
-
var CEAL_APPROVAL_TARGET_KINDS = vocabulary([
|
|
1519
|
-
"repo_change",
|
|
1520
|
-
"investigation",
|
|
1521
|
-
"skill_creation",
|
|
1522
|
-
"command_creation",
|
|
1523
|
-
"connector_creation",
|
|
1524
|
-
"generic"
|
|
1525
|
-
]);
|
|
1526
|
-
var CEAL_PROGRESS_PHASES = vocabulary(["request_review", "information_gathering", "work_execution", "result_check"]);
|
|
1454
|
+
var REQUIRED_FIELDS2 = Object.freeze(["schema_version", "operation_id", "read_argv"]);
|
|
1455
|
+
var FIELDS = /* @__PURE__ */ new Set([...REQUIRED_FIELDS2, "local_result_root", "continue_argv", "model_disclosure"]);
|
|
1527
1456
|
|
|
1528
1457
|
// packages/ceal-client-protocol/src/gateway-cache-origin-validation.ts
|
|
1529
1458
|
var CEAL_MAX_CACHE_ORIGIN_AGE_MS = 30 * 24 * 60 * 60 * 1e3;
|
|
@@ -1767,13 +1696,13 @@ function validTurn(value) {
|
|
|
1767
1696
|
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);
|
|
1768
1697
|
}
|
|
1769
1698
|
function validInput(value) {
|
|
1770
|
-
return exactOptional(value, ["local_session_ref", "local_turn_ref", "local_input_ref", "origin_input", "observations"], ["
|
|
1699
|
+
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);
|
|
1771
1700
|
}
|
|
1772
1701
|
function validInputObservations(value) {
|
|
1773
1702
|
return validObservations(value) && Array.isArray(value) && value.filter((item) => record(item) && item.observation_kind === "prompt").length === 1;
|
|
1774
1703
|
}
|
|
1775
1704
|
function validInputOptionals(value) {
|
|
1776
|
-
return
|
|
1705
|
+
return optionalRefs(value.local_turn_aliases) && (value.context_expires_at === void 0 || timestamp(value.context_expires_at));
|
|
1777
1706
|
}
|
|
1778
1707
|
function validTerminal(value) {
|
|
1779
1708
|
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);
|
|
@@ -1784,9 +1713,6 @@ function validTerminalDisposition(state, reason) {
|
|
|
1784
1713
|
function validStatus(value) {
|
|
1785
1714
|
return exactOptional(value, ["status", "reason_code"], ["detail"]) && ["ready", "degraded", "stopping"].includes(String(value.status)) && safeRef(value.reason_code) && optionalText(value.detail, 4096);
|
|
1786
1715
|
}
|
|
1787
|
-
function validDecision(value) {
|
|
1788
|
-
return value === void 0 || record(value) && exactKeys2(value, ["decision", "approval_ref"]) && (value.decision === "approved" || value.decision === "denied") && safeRef(value.approval_ref);
|
|
1789
|
-
}
|
|
1790
1716
|
function optionalText(value, maxLength) {
|
|
1791
1717
|
return value === void 0 || typeof value === "string" && value.length > 0 && value.length <= maxLength;
|
|
1792
1718
|
}
|
|
@@ -1973,7 +1899,15 @@ var HOST_RELAY_INVOCATION_MINT_REFUSAL_REASONS = vocabulary([
|
|
|
1973
1899
|
"deadline",
|
|
1974
1900
|
"cancelled",
|
|
1975
1901
|
"mint_failed",
|
|
1976
|
-
"relay_failed"
|
|
1902
|
+
"relay_failed",
|
|
1903
|
+
"request_authority_unavailable",
|
|
1904
|
+
"request_missing",
|
|
1905
|
+
"authority_mismatch",
|
|
1906
|
+
"host_source_mismatch",
|
|
1907
|
+
"host_session_mismatch",
|
|
1908
|
+
"host_turn_mismatch",
|
|
1909
|
+
"host_input_mismatch",
|
|
1910
|
+
"host_prompt_mismatch"
|
|
1977
1911
|
]);
|
|
1978
1912
|
var HOST_RELAY_INVOCATION_MINT_OUTCOMES = vocabulary(["completed", "caller_cancelled", "deadline", "failed", "no_binding"]);
|
|
1979
1913
|
var HOST_RELAY_EXCHANGE_FAILURES = vocabulary([
|
|
@@ -2484,6 +2418,7 @@ function boundedMilliseconds(value) {
|
|
|
2484
2418
|
import { createHash as createHash3 } from "node:crypto";
|
|
2485
2419
|
|
|
2486
2420
|
// host/claude/src/claude-types.ts
|
|
2421
|
+
var CLAUDE_HOOK_EVENTS = ["SessionStart", "UserPromptSubmit", "Stop", "StopFailure"];
|
|
2487
2422
|
var CLAUDE_SESSION_ID_ENVIRONMENT = "CLAUDE_CODE_SESSION_ID";
|
|
2488
2423
|
var CLAUDE_HOST_ERROR_CODES = ["invalid_input", "storage", "configuration"];
|
|
2489
2424
|
function isClaudeHostErrorCode(value) {
|
|
@@ -2500,6 +2435,9 @@ var ClaudeHostError = class extends Error {
|
|
|
2500
2435
|
this.code = code3;
|
|
2501
2436
|
}
|
|
2502
2437
|
};
|
|
2438
|
+
function isClaudeHookEvent(value) {
|
|
2439
|
+
return typeof value === "string" && CLAUDE_HOOK_EVENTS.some((event) => event === value);
|
|
2440
|
+
}
|
|
2503
2441
|
|
|
2504
2442
|
// host/claude/src/claude-decoder.ts
|
|
2505
2443
|
var MAX_HOOK_BYTES = 256 * 1024;
|
|
@@ -2714,10 +2652,7 @@ function validateBatch(value) {
|
|
|
2714
2652
|
}
|
|
2715
2653
|
}
|
|
2716
2654
|
function validBatchHeader(value) {
|
|
2717
|
-
return record4(value) && value.schema_version === CLAUDE_OUTBOX_SCHEMA && safeRef4(value.batch_ref) &&
|
|
2718
|
-
}
|
|
2719
|
-
function claudeEvent(value) {
|
|
2720
|
-
return typeof value === "string" && ["SessionStart", "UserPromptSubmit", "Stop", "StopFailure"].includes(value);
|
|
2655
|
+
return record4(value) && value.schema_version === CLAUDE_OUTBOX_SCHEMA && safeRef4(value.batch_ref) && isClaudeHookEvent(value.hook_event) && safeRef4(value.local_session_ref) && optionalRef(value.local_turn_ref) && timestamp3(value.occurred_at) && Array.isArray(value.frames) && value.frames.length > 0 && value.frames.length <= 3;
|
|
2721
2656
|
}
|
|
2722
2657
|
function hostFrameKind(value) {
|
|
2723
2658
|
return isHostProducerFrameKind(value);
|