@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.
@@ -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", "agent_lease_admission", "provider_authenticated_event"]);
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 CEAL_MODEL_INVOCATION_ARGUMENTS = [CEAL_OPERATION_INVOKE_COMMAND, CEAL_OPERATION_ID_PLACEHOLDER, CEAL_OPERATION_INPUT_FLAG, shellSingleQuoted(CEAL_OPERATION_INPUT_PLACEHOLDER)].join(" ");
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/leased-consumer-vocabulary.ts
953
- var CEAL_TERMINAL_DISPOSITIONS = vocabulary(["completed", "failed", "cancelled"]);
954
- var CEAL_LEASE_DISPOSITIONS = vocabulary([...CEAL_TERMINAL_DISPOSITIONS, "deferred"]);
955
- var CEAL_AUTOMATIC_FEEDBACK_INTENTS = vocabulary(["initial"]);
956
- var CEAL_LEASED_MESSAGE_DELIVERY_OPERATION_IDS = vocabulary(["message.send", "message.update", "message.delete"]);
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", "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 CEAL_RESULT_DELIVERY_OFFERS = vocabulary(["pending", "offered", "transport_lost"]);
959
- var CEAL_RESULT_DELIVERY_STATES = vocabulary(["unavailable", ...CEAL_RESULT_DELIVERY_OFFERS]);
960
- var CEAL_PROVIDER_OUTCOMES = vocabulary(["not_attempted", "outcome_unknown", "verified"]);
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"]);
@@ -1161,17 +1107,6 @@ var CEAL_REFRESH_FAILURE_CODES = vocabulary([
1161
1107
  "refresh_recovery_expired"
1162
1108
  ]);
1163
1109
 
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
1110
  // packages/ceal-client-protocol/src/request-validation-primitives.ts
1176
1111
  import { createHash } from "node:crypto";
1177
1112
  var DIGEST = /^[a-f0-9]{64}$/u;
@@ -1338,6 +1273,10 @@ var CEAL_REQUEST_RUN_BATCH_JSON_SCHEMA = {
1338
1273
  };
1339
1274
 
1340
1275
  // packages/ceal-client-protocol/src/host-observation.ts
1276
+ var CEAL_HOST_INPUT_KINDS = vocabulary(["human", "host_automatic"]);
1277
+ function isCealHostInputKind(value) {
1278
+ return typeof value === "string" && CEAL_HOST_INPUT_KINDS.some((kind) => kind === value);
1279
+ }
1341
1280
  var CEAL_HOST_OBSERVATION_REF_PREFIX = "host-observation:";
1342
1281
  var HOST_OBSERVATION_PRODUCER = /^[a-z][a-z0-9]{0,31}$/u;
1343
1282
  var HOST_OBSERVATION_DIGEST = /^[a-f0-9]{8,64}$/u;
@@ -1400,12 +1339,6 @@ var OWNER_WRITE_STATES = Object.freeze(["attempt_started", "provider_acknowledge
1400
1339
  var OWNER_EFFECT_STATES = Object.freeze(["none", "applied", "failed", "unknown", "reconciled"]);
1401
1340
  var OWNER_RECEIPT_STATES = Object.freeze(["pending", "available", "failed", "unknown", "reconciled"]);
1402
1341
 
1403
- // packages/ceal-client-protocol/src/thread-excerpt.ts
1404
- var CEAL_THREAD_RECENT_WINDOW = 6;
1405
- var CEAL_THREAD_LAST_APP_MESSAGES_WINDOW = 3;
1406
- var CEAL_THREAD_OLDER_SUMMARY_WINDOW = 4;
1407
- var CEAL_FED_THREAD_MESSAGE_LIMIT = CEAL_THREAD_RECENT_WINDOW + CEAL_THREAD_OLDER_SUMMARY_WINDOW + CEAL_THREAD_LAST_APP_MESSAGES_WINDOW;
1408
-
1409
1342
  // packages/ceal-client-protocol/src/request-graph-readiness.ts
1410
1343
  var REQUEST_GRAPH_PRODUCER_TO_APPEND_SCHEMA = {
1411
1344
  type: "object",
@@ -1515,26 +1448,11 @@ function exactKeys(value, expected) {
1515
1448
  }
1516
1449
 
1517
1450
  // packages/ceal-client-protocol/src/client-result-materialization.ts
1451
+ var CEAL_UNREAD_REASONS = vocabulary(["blocked", "unavailable", "too_large", "unsupported", "download_failed", "permission_denied"]);
1518
1452
  var CEAL_MODEL_VISIBLE_COMMAND_OUTPUT_MAX_BYTES = 32 * 1024;
1519
1453
  var REQUIRED_FIELDS2 = Object.freeze(["schema_version", "operation_id"]);
1520
1454
  var FIELDS = /* @__PURE__ */ new Set([...REQUIRED_FIELDS2, "read_argv", "local_result_root", "continue_argv", "model_disclosure", "item_read_argv"]);
1521
1455
 
1522
- // packages/ceal-client-protocol/src/session-start-affordance.ts
1523
- var CEAL_SESSION_ENTRY_INVOCATION = "ceal";
1524
- 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.`;
1525
-
1526
- // packages/ceal-client-protocol/src/conversation-contracts.ts
1527
- var CEAL_APPROVAL_POLICY_KINDS = vocabulary(["requester_only", "named_users", "role_based"]);
1528
- var CEAL_APPROVAL_TARGET_KINDS = vocabulary([
1529
- "repo_change",
1530
- "investigation",
1531
- "skill_creation",
1532
- "command_creation",
1533
- "connector_creation",
1534
- "generic"
1535
- ]);
1536
- var CEAL_PROGRESS_PHASES = vocabulary(["request_review", "information_gathering", "work_execution", "result_check"]);
1537
-
1538
1456
  // packages/ceal-client-protocol/src/gateway-cache-origin-validation.ts
1539
1457
  var CEAL_MAX_CACHE_ORIGIN_AGE_MS = 30 * 24 * 60 * 60 * 1e3;
1540
1458
 
@@ -1948,13 +1866,13 @@ function validTurn(value) {
1948
1866
  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);
1949
1867
  }
1950
1868
  function validInput(value) {
1951
- return exactOptional(value, ["local_session_ref", "local_turn_ref", "local_input_ref", "origin_input", "observations"], ["decision", "local_turn_aliases", "context_expires_at"]) && safeRef(value.local_session_ref) && safeRef(value.local_turn_ref) && safeRef(value.local_input_ref) && validInputObservations(value.observations) && typeof value.origin_input === "boolean" && validInputOptionals(value);
1869
+ 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);
1952
1870
  }
1953
1871
  function validInputObservations(value) {
1954
1872
  return validObservations(value) && Array.isArray(value) && value.filter((item) => record(item) && item.observation_kind === "prompt").length === 1;
1955
1873
  }
1956
1874
  function validInputOptionals(value) {
1957
- return validDecision(value.decision) && optionalRefs(value.local_turn_aliases) && (value.context_expires_at === void 0 || timestamp(value.context_expires_at));
1875
+ return optionalRefs(value.local_turn_aliases) && (value.context_expires_at === void 0 || timestamp(value.context_expires_at));
1958
1876
  }
1959
1877
  function validTerminal(value) {
1960
1878
  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);
@@ -1965,9 +1883,6 @@ function validTerminalDisposition(state, reason) {
1965
1883
  function validStatus(value) {
1966
1884
  return exactOptional(value, ["status", "reason_code"], ["detail"]) && ["ready", "degraded", "stopping"].includes(String(value.status)) && safeRef(value.reason_code) && optionalText(value.detail, 4096);
1967
1885
  }
1968
- function validDecision(value) {
1969
- return value === void 0 || record(value) && exactKeys2(value, ["decision", "approval_ref"]) && (value.decision === "approved" || value.decision === "denied") && safeRef(value.approval_ref);
1970
- }
1971
1886
  function optionalText(value, maxLength) {
1972
1887
  return value === void 0 || typeof value === "string" && value.length > 0 && value.length <= maxLength;
1973
1888
  }
@@ -2925,10 +2840,6 @@ var CodexOutboxStore = class {
2925
2840
  await removeOwnerState(this.registrationPath(registration.host_source_ref, registration.host_session_ref), "registration");
2926
2841
  await removeOwnerState(this.cursorPath(registration.host_source_ref, registration.host_session_ref), "cursor");
2927
2842
  }
2928
- async relayWakeDirectories() {
2929
- await this.prepare();
2930
- return { entries: this.entriesDirectory, registrations: this.registrationsDirectory };
2931
- }
2932
2843
  async listTranscriptRegistrations() {
2933
2844
  await this.prepare();
2934
2845
  const registrations = [];
@@ -3118,7 +3029,7 @@ async function readPrivateFile(path) {
3118
3029
  }
3119
3030
  function validateEnvelope(value) {
3120
3031
  if (!isRecord4(value)) throw storageError("Codex outbox entry is malformed.");
3121
- 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")}).`);
3032
+ 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")}).`);
3122
3033
  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}`)}).`);
3123
3034
  validateIdentity3(value.identity);
3124
3035
  validateEnvelopeReferences(value);
@@ -3127,6 +3038,7 @@ function validateEnvelope(value) {
3127
3038
  }
3128
3039
  function validateEnvelopeReferences(value) {
3129
3040
  if (!SAFE_REF6.test(String(value.host_input_ref))) throw storageError("Codex outbox input reference is malformed.");
3041
+ if (!isCealHostInputKind(value.input_kind)) throw storageError("Codex outbox input provenance is malformed.");
3130
3042
  if (!SAFE_REF6.test(String(value.prompt_ref))) throw storageError("Codex outbox references are malformed.");
3131
3043
  if (!SAFE_REF6.test(String(value.submission_ref))) throw storageError("Codex outbox references are malformed.");
3132
3044
  if (value.request_ref !== void 0 && !SAFE_REF6.test(String(value.request_ref))) throw storageError("Codex outbox Request reference is malformed.");
@@ -3369,6 +3281,7 @@ var CodexProducer = class {
3369
3281
  local_session_ref: envelope.identity.host_session_ref,
3370
3282
  local_turn_ref: localTurnRef(envelope),
3371
3283
  local_input_ref: envelope.host_input_ref,
3284
+ input_kind: envelope.input_kind,
3372
3285
  origin_input: envelope.origin_input,
3373
3286
  observations: [prompt],
3374
3287
  local_turn_aliases: envelope.codex_turn_id === void 0 ? void 0 : [envelope.codex_turn_id],
@@ -3586,18 +3499,24 @@ function decodeTokenUsage(value) {
3586
3499
  function decodeResponseItem(payload, ordinal, timestamp5) {
3587
3500
  if (payload.type !== "message" || payload.role !== "user") return { kind: "ignored", ordinal, timestamp: timestamp5 };
3588
3501
  const metadata = userMessageMetadata(payload.internal_chat_message_metadata_passthrough);
3589
- const kinds = metadata.content_item_kinds;
3590
- if (kinds.length !== 1 || kinds[0] !== "user.text") return { kind: "ignored", ordinal, timestamp: timestamp5 };
3502
+ const inputKind = inputKindFromContentItems(metadata.content_item_kinds);
3503
+ if (inputKind === void 0) return { kind: "ignored", ordinal, timestamp: timestamp5 };
3591
3504
  const prompt = userTextContent(payload.content);
3592
3505
  return {
3593
3506
  kind: "user_text",
3594
3507
  ordinal,
3595
3508
  timestamp: timestamp5,
3596
3509
  prompt,
3510
+ input_kind: inputKind,
3597
3511
  message_id: safeRef4(payload.id, "Codex user message identity is invalid."),
3598
3512
  turn_id: safeRef4(metadata.turn_id, "Codex user message task identity is invalid.")
3599
3513
  };
3600
3514
  }
3515
+ function inputKindFromContentItems(kinds) {
3516
+ if (kinds.length !== 1) return void 0;
3517
+ if (kinds[0] === "user.text") return "human";
3518
+ return kinds[0] === "goal.internal_context" ? "host_automatic" : void 0;
3519
+ }
3601
3520
  function userMessageMetadata(value) {
3602
3521
  if (!isRecord6(value) || !Array.isArray(value.content_item_kinds)) reject("Codex user message provenance is malformed.");
3603
3522
  return { ...value, content_item_kinds: value.content_item_kinds };
@@ -4182,6 +4101,7 @@ var CodexTranscriptWatcher = class {
4182
4101
  schema_version: "ceal.codex_observation_outbox.v1",
4183
4102
  identity,
4184
4103
  host_input_ref: hostInputRef,
4104
+ input_kind: record3.input_kind,
4185
4105
  prompt_ref: promptRef,
4186
4106
  observations,
4187
4107
  codex_turn_id: record3.turn_id,
@@ -4208,6 +4128,7 @@ var CodexTranscriptWatcher = class {
4208
4128
  schema_version: "ceal.codex_observation_outbox.v1",
4209
4129
  identity,
4210
4130
  host_input_ref: activeTask.origin_host_input_ref,
4131
+ input_kind: "host_automatic",
4211
4132
  prompt_ref: activeTask.prompt_ref,
4212
4133
  observations,
4213
4134
  codex_turn_id: record3.turn_id,