@corca-org/ceal-host-win32-x64 1.0.15 → 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.
@@ -158,7 +158,7 @@ var client_wire_contract_default = {
158
158
  "prompt"
159
159
  ],
160
160
  discovery_command: "discovery",
161
- discovery_manifest_schema_version: "ceal.discovery_manifest.v2",
161
+ discovery_manifest_schema_version: "ceal.discovery_manifest.v1",
162
162
  discovery_manifest_document_fields: [
163
163
  "discovery_manifest"
164
164
  ],
@@ -232,10 +232,11 @@ var CEAL_AUDIT_OUTCOMES = vocabulary(["succeeded", "denied", "failed"]);
232
232
  var CEAL_GATEWAY_PROVIDER_STEP_OUTCOMES = vocabulary(["completed", "rejected", "throttled", "failed"]);
233
233
  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"]);
234
234
  var CEAL_GATEWAY_READ_REUSE_UNAVAILABLE_REASONS = vocabulary(["not_reported", "storage_unavailable", "coverage_incomplete", "freshness_refresh_required", "not_reusable", "bypassed"]);
235
+ var CEAL_GATEWAY_DERIVED_STORE_FAILURE_CLASSES = vocabulary(["storage_unavailable", "decode_mismatch", "write_conflict", "quota", "store_error"]);
235
236
  var CEAL_POLICY_DECISIONS = vocabulary(["allowed", "denied", "not_evaluated"]);
236
237
  var CEAL_CONNECTOR_ROUTE_PHASES = vocabulary(["scope_observation", "target_selection", "route_resolution"]);
237
238
  var CEAL_CONNECTOR_ROUTE_CAUSES = vocabulary(["provider_throttled", "provider_unavailable", "binding_invalid", "scope_limit_exceeded"]);
238
- var CEAL_WRITE_SOURCE_KINDS = vocabulary(["authenticated_registered_client", "agent_lease_admission", "provider_authenticated_event"]);
239
+ var CEAL_WRITE_SOURCE_KINDS = vocabulary(["authenticated_registered_client", "provider_authenticated_event"]);
239
240
  var CEAL_REFRESH_DELIVERIES = vocabulary(["initial", "recovery", "replay", "terminal_failure", "recovery_unavailable"]);
240
241
  var CEAL_CLIENT_OPERATIONS = vocabulary(["handshake", "discover", "call", "readback"]);
241
242
  var CEAL_WRITE_IDEMPOTENCY_POSTURES = vocabulary(["required", "optional", "not_required"]);
@@ -245,6 +246,17 @@ var CEAL_WRITE_RECEIPT_PROVIDER_STATES = vocabulary(["outcome_unknown", "verifie
245
246
  var CEAL_WRITE_RECEIPT_PROVIDER_READBACKS = vocabulary(["outcome_unknown", "verified", "not_applied"]);
246
247
  var CEAL_PROTOCOL_VERSION = "1.4.0";
247
248
  var CEAL_OPERATION_ACCESS_SCHEMA_VERSION = "ceal.operation_access.v1";
249
+ var CEAL_GATEWAY_ACTIVE_CALL_PHASES = vocabulary([
250
+ "audited_call_pending",
251
+ "continuation_read_pending",
252
+ "continuation_write_pending",
253
+ "provider_pacing_pending",
254
+ "corpus_replay_pending",
255
+ "corpus_append_pending",
256
+ "corpus_fence_pending",
257
+ "corpus_content_pending",
258
+ "corpus_transaction_pending"
259
+ ]);
248
260
  var CEAL_CONNECTOR_ROUTE_FAILURE_KEYS = vocabulary(["connector_kind", "phase", "schema_version"]);
249
261
  var CEAL_CLASSIFIED_CONNECTOR_ROUTE_FAILURE_KEYS = vocabulary(["cause", ...CEAL_CONNECTOR_ROUTE_FAILURE_KEYS]);
250
262
  var CEAL_UNCLASSIFIED_CONNECTOR_ROUTE_FAILURE_KEYS = vocabulary(["connector_kind", "error_class", "phase", "schema_version"]);
@@ -254,10 +266,130 @@ var CEAL_GATEWAY_ORGANIZATION_ROUTE_FACT_CALL_KEYS = Object.freeze([
254
266
  "policy_decision_revision"
255
267
  ]);
256
268
 
269
+ // packages/ceal-client-protocol/src/operation-next-actions.ts
270
+ var CEAL_REPEAT_REQUEST_NEXT_ACTION = "repeat_request";
271
+ var CEAL_INSPECT_RECEIPT_NEXT_ACTION = "inspect_receipt";
272
+ var CALLER_RECOVERABLE_NEXT_ACTION_VALUES = [
273
+ "select_did_you_mean",
274
+ "choose_new_output_path",
275
+ "choose_new_idempotency_key",
276
+ "restart_search",
277
+ "repeat_original_arguments",
278
+ // The occurrence this call addressed is settled and cannot move again -- a
279
+ // denied effect approval, an expired continuation -- so the caller runs the
280
+ // same call again as a new request. The refusal names the re-request; this
281
+ // word is the re-request.
282
+ CEAL_REPEAT_REQUEST_NEXT_ACTION,
283
+ "choose_new_request_identity",
284
+ // A refusal that names the argument (invalid_argument with `property`) tells the caller exactly what to change.
285
+ "correct_argument",
286
+ // A resolver-owned input must move from caller operands into the declared
287
+ // resolver selection field.
288
+ "supply_resolver_selections",
289
+ // The graph names an upstream node whose Operation produces the resolver's
290
+ // occurrence, and it has not produced one yet. The caller runs that node
291
+ // first; the refusal used to share a code with a malformed resolver result,
292
+ // which is not fixable, so neither could carry a remedy.
293
+ "run_resolver_dependency",
294
+ // A replay carries the input the occurrence durably admitted, and this one
295
+ // carries a different one. The caller fixes it by presenting the original
296
+ // invocation, so it is a remedy; the coordinator minted the word at the
297
+ // replay guard and never declared it, which read as unguided to the scorer.
298
+ "use_original_input",
299
+ // The same mismatch on the Request binding rather than the input: the
300
+ // occurrence was admitted under one binding and the replay presents another.
301
+ "use_original_request_binding",
302
+ // The client's own filesystem write was refused -- EACCES, EPERM, or a
303
+ // read-only mount -- which is how an agent sandbox fences writes outside its
304
+ // workspace. The caller reruns the same command with unsandboxed or escalated
305
+ // execution; re-adopting the session cannot help, because the sandbox refuses
306
+ // that write too.
307
+ "rerun_outside_agent_sandbox",
308
+ // The refusal names the one Operation to read next in `describe_command`:
309
+ // an absent Operation id with a sole catalog-ranked candidate, or a known
310
+ // Operation invoked without its input. Describing only reads the verified
311
+ // contract and dispatches nothing, and the caller then retries with the
312
+ // named Operation or input, so it is guidance the scorer counts.
313
+ "describe_operation",
314
+ // The refusal names the caller's own personal connect Operation in
315
+ // `required_action_sequence`: the Operation asked for, or the credential
316
+ // the call ran on, needs a personal connection the caller does not hold
317
+ // (never connected, revoked, or expired). The caller runs that exact
318
+ // Operation, completes the consent it hands back, and retries the same call.
319
+ "connect_personal_account",
320
+ // The provider or Gateway named a bounded wait; the caller waits that long
321
+ // and submits the same read again.
322
+ "retry_after",
323
+ // The ref names a container of rows (a Notion database or data source), which
324
+ // has no body of its own; the caller searches its rows instead of reading it.
325
+ "search_container_rows"
326
+ ];
327
+ var CEAL_CALLER_RECOVERABLE_NEXT_ACTIONS = Object.freeze(CALLER_RECOVERABLE_NEXT_ACTION_VALUES);
328
+ var NON_REMEDY_NEXT_ACTION_VALUES = [
329
+ // Only an administrator can take the named step -- approving a place for an
330
+ // Operation, granting a withheld capability -- so a non-administrator asks
331
+ // one. The refusal names the administrator step; this word is the ask.
332
+ "ask_admin",
333
+ "await_pending_approval",
334
+ "check_gateway",
335
+ "inspect_context_store",
336
+ "inspect_gateway",
337
+ "inspect_local_cache",
338
+ // The thin client prints these on its own behalf, before or after the wire.
339
+ // They were declared only as `CealClientLocalRemedy` keys and, for two of
340
+ // them, only as Go string literals -- a second and third vocabulary for one
341
+ // thing. `CealClientLocalRemedy` derives from this list now, so the client's
342
+ // remedies cannot drift from the words the protocol knows.
343
+ "inspect_local_client",
344
+ "inspect_local_command",
345
+ "inspect_local_output",
346
+ "inspect_local_route",
347
+ CEAL_INSPECT_RECEIPT_NEXT_ACTION,
348
+ "inspect_request",
349
+ "none",
350
+ // The provider refused because of its own configuration -- an API not
351
+ // enabled, an app scope missing -- which an operator changes in that
352
+ // provider's console. No caller edit and no retry fixes it.
353
+ "operator_action",
354
+ "recover",
355
+ "reconcile",
356
+ // Reconciliation of one named occurrence, not of the deployment: an
357
+ // occurrence with no admitted input commitment cannot be replayed safely and
358
+ // no edit to the call changes that. `reconcile` is the deployment-wide word.
359
+ "reconcile_occurrence",
360
+ "reduce_request_size",
361
+ // The Host's invocation context for this turn is stale or expired at the
362
+ // Gateway. The Host's next turn rebinds it and the same call then succeeds;
363
+ // nothing in the call changes, so it is not a remedy the scorer may count.
364
+ "refresh_host_invocation_context",
365
+ "repair_or_adopt_session",
366
+ "retry",
367
+ // The owner -- a correlation hook, an approval hook -- is not serving right
368
+ // now. The caller changes nothing and the same call succeeds once the owner
369
+ // is back, so this is not a remedy the scorer may count as guidance.
370
+ "retry_after_owner_recovery",
371
+ "retry_same_receipt_read",
372
+ "run_file_search_again",
373
+ "select_exact_approval"
374
+ ];
375
+ var CEAL_NON_REMEDY_NEXT_ACTIONS = Object.freeze(NON_REMEDY_NEXT_ACTION_VALUES);
376
+ var DECLARED = /* @__PURE__ */ new Set([...CEAL_CALLER_RECOVERABLE_NEXT_ACTIONS, ...CEAL_NON_REMEDY_NEXT_ACTIONS]);
377
+ var RETRY_PROMISE_NEXT_ACTIONS = ["retry", "retry_after"];
378
+ var RETRY_PROMISE = new Set(RETRY_PROMISE_NEXT_ACTIONS);
379
+ var RECOVERABLE = new Set(CEAL_CALLER_RECOVERABLE_NEXT_ACTIONS);
380
+ var CEAL_OPERATION_WITHHELD_NEXT_ACTIONS = Object.freeze({
381
+ provider_permission: "ask_admin",
382
+ access_level: "ask_admin",
383
+ personal_authorization_required: "connect_personal_account"
384
+ });
385
+
386
+ // packages/ceal-client-protocol/src/operation-withheld-cause.ts
387
+ var CEAL_OPERATION_WITHHELD_CAUSES = vocabulary(["provider_permission", "access_level", "personal_authorization_required"]);
388
+
257
389
  // packages/ceal-client-protocol/src/operation-contract-types.ts
258
390
  var CEAL_JSON_SCHEMA_2020_12 = "https://json-schema.org/draft/2020-12/schema";
259
391
  var CEAL_OPERATION_ERROR_SCHEMA_VERSION = "ceal.operation_error.v1";
260
- var CEAL_OPERATION_WITHHELD_CAUSES = vocabulary(["provider_permission", "access_level", "personal_authorization_required"]);
392
+ var CEAL_ARTIFACT_STAGE_TERMINALS = vocabulary(["chunk_accepted", "artifact_ready", "idempotency_replayed"]);
261
393
  var CEAL_RETRY_AFTER_MAX_MS = 60 * 60 * 1e3;
262
394
  var CEAL_JSON_SCHEMA_TYPES = vocabulary(["object", "array", "string", "integer", "number", "boolean", "null"]);
263
395
  var OBSERVATION_POSTURES = vocabulary(["direct_readback", "approved_no_readback", "operator_mediated", "excluded"]);
@@ -521,6 +653,8 @@ var CEAL_PROVIDER_BOUNDARY_KINDS = vocabulary([
521
653
  var CEAL_PROVIDER_BOUNDARY_EVIDENCE = vocabulary(["provider_readback", "operator_stated"]);
522
654
  var CEAL_ACCESS_LEVELS = vocabulary(["none", "read", "read_write"]);
523
655
  var CEAL_PERSONAL_ACCESS_CEILINGS = vocabulary(["disabled", "read", "read_write"]);
656
+ var CEAL_TARGET_REF_PATTERN = "^[^\\p{Cc}]+$";
657
+ var TARGET_REF = new RegExp(CEAL_TARGET_REF_PATTERN, "u");
524
658
  var CEAL_TARGET_VISIBILITIES = vocabulary(["public", "private"]);
525
659
  var CEAL_PRINCIPAL_KINDS = vocabulary(["human", "service", "runtime"]);
526
660
  var CEAL_ORGANIZATION_ROLES = vocabulary(["member", "admin"]);
@@ -629,8 +763,6 @@ var CEAL_OPERATION_AUTHORITY_POLICY_KEYS = Object.freeze(["access_group", "insta
629
763
  var MAX_OPERATION_INPUT_RESOLVER_BINDINGS = 96;
630
764
  var CEAL_OPERATION_DESCRIPTOR_REQUIRED_ENVELOPE_KEYS = Object.freeze(["schema_version", "id", "input_contract", "result_contract", "policy"]);
631
765
  var CEAL_OPERATION_DESCRIPTOR_OPTIONAL_ENVELOPE_KEYS = Object.freeze(["input_resolution", "summary"]);
632
- var CEAL_OPERATION_RESULT_KEYS = vocabulary(["ok", "operation_id", "operation_receipt", "schema_version", "value"]);
633
- var CEAL_OPERATION_COMPACT_RESULT_KEYS = vocabulary(["ok", "operation_evidence", "operation_id", "schema_version", "value"]);
634
766
 
635
767
  // packages/ceal-client-protocol/src/operation-catalog.ts
636
768
  var CEAL_OPERATION_CATALOG_SCHEMA_VERSION = "ceal.catalog.v3";
@@ -642,8 +774,8 @@ var CEAL_SCHEMA_LITERALS = [
642
774
  "ceal.activation_transport.v1",
643
775
  CEAL_OPERATION_ACCESS_SCHEMA_VERSION,
644
776
  CEAL_OPERATION_CATALOG_SCHEMA_VERSION,
645
- "ceal.client_refresh_request.v2",
646
- "ceal.client_refresh_result.v2",
777
+ "ceal.client_refresh_request.v1",
778
+ "ceal.client_refresh_result.v1",
647
779
  "ceal.client_revoke_request.v1",
648
780
  "ceal.client_revoke_result.v1",
649
781
  CEAL_COMMAND_REQUEST_SCHEMA_VERSION,
@@ -672,7 +804,7 @@ var CEAL_SCHEMA_LITERALS = [
672
804
  "ceal.gateway_call_result.v1",
673
805
  CEAL_GATEWAY_COMMAND_RESOLUTION_SCHEMA_VERSION,
674
806
  "ceal.gateway_connector_route_failure.v1",
675
- "ceal.gateway_discovery.v3",
807
+ "ceal.gateway_discovery.v1",
676
808
  "ceal.gateway_handshake.v1",
677
809
  "ceal.gateway_installation_activation_code_issue_request.v1",
678
810
  "ceal.gateway_installation_activation_code_issue_result.v1",
@@ -694,10 +826,6 @@ var CEAL_SCHEMA_LITERALS = [
694
826
  "ceal.host_observation.v1",
695
827
  "ceal.host_registration_request.v1",
696
828
  "ceal.host_registration_result.v1",
697
- "ceal.leased-resource-stream.v2",
698
- "ceal.leased_consumer_attachment_stream_frame.v2",
699
- "ceal.leased_consumer_attachment_stream_request.v2",
700
- "ceal.leased_consumer_attachment_stream_transport.v2",
701
829
  "ceal.operation_descriptor.v1",
702
830
  "ceal.operation_error.v1",
703
831
  "ceal.operation_failure.v1",
@@ -705,7 +833,7 @@ var CEAL_SCHEMA_LITERALS = [
705
833
  "ceal.operation_receipt.v1",
706
834
  "ceal.operation_result.v1",
707
835
  "ceal.operation_result.compact.v1",
708
- "ceal.local_result_materialization.v2",
836
+ "ceal.local_result_materialization.v1",
709
837
  "ceal.local_result_root.v1",
710
838
  "ceal.owner_bootstrap_exchange_request.v1",
711
839
  "ceal.owner_bootstrap_exchange_result.v1",
@@ -723,12 +851,6 @@ var CEAL_SCHEMA_LITERAL_SET = new Set(CEAL_SCHEMA_LITERALS);
723
851
  // packages/ceal-client-protocol/src/bounded-series.ts
724
852
  import { join } from "node:path";
725
853
  var CEAL_BOUNDED_SERIES_CATALOG = Object.freeze({
726
- usage_record: (root) => join(root, "run-usage.jsonl"),
727
- control_commit: (root) => join(root, "control-auto-commit.jsonl"),
728
- engagement_signal: (root) => join(root, "runtime-state", "slack-feedback.jsonl"),
729
- runtime_error: (root) => join(root, "runtime-state", "runtime-errors.jsonl"),
730
- turn_bridge_request: (root) => join(root, ".ceal", "turn-bridge", "requests.jsonl"),
731
- thread_run_events: (root) => join(root, "run-events.jsonl"),
732
854
  bounded_store_sidecar: (root) => `${root}.jsonl`,
733
855
  gateway_audit_archive: (root) => `${root}.jsonl`,
734
856
  gateway_access_group_connector_control_audit: (root) => `${root}.audit.jsonl`,
@@ -761,146 +883,8 @@ var CEAL_HOST_REGISTRATION_ATTEMPT_REF_PATTERN = new RegExp(`^host-registration-
761
883
  var CEAL_HOST_INSTALLATION_REF_PATTERN = new RegExp(`^host-installation:${CEAL_LOWERCASE_UUID_PATTERN}$`, "u");
762
884
  var CEAL_HOST_SOURCE_REF_PATTERN = new RegExp(`^host-source:${CEAL_LOWERCASE_UUID_PATTERN}$`, "u");
763
885
 
764
- // packages/ceal-client-protocol/src/agent-session-handoff.ts
765
- var CEAL_AGENT_ADMISSION_PHASES = vocabulary([
766
- "incumbent_admitted",
767
- "incumbent_draining",
768
- "drained",
769
- "candidate_admitted",
770
- "candidate_draining",
771
- "rollback_admitted"
772
- ]);
773
- var CEAL_AGENT_SERVICE_SESSION_RECORD_KEYS = vocabulary([
774
- "admission_fence",
775
- "admission_state",
776
- "admission_state_generation",
777
- "bearer",
778
- "consumer_ref",
779
- "credential_generation",
780
- "expires_at",
781
- "gateway_instance",
782
- "gateway_origin",
783
- "gateway_serving_generation",
784
- "issued_at",
785
- "record_sha256",
786
- "renew_after",
787
- "renew_by",
788
- "schema_version",
789
- "session_revision"
790
- ]);
791
- var CEAL_AGENT_SESSION_COMMIT_KEYS = vocabulary(["attempt_ref", "expected_session_revision", "session_revision"]);
792
-
793
- // packages/ceal-client-protocol/src/operation-next-actions.ts
794
- var CEAL_REPEAT_REQUEST_NEXT_ACTION = "repeat_request";
795
- var CEAL_INSPECT_RECEIPT_NEXT_ACTION = "inspect_receipt";
796
- var CALLER_RECOVERABLE_NEXT_ACTION_VALUES = [
797
- "select_did_you_mean",
798
- "choose_new_output_path",
799
- "choose_new_idempotency_key",
800
- "restart_search",
801
- "repeat_original_arguments",
802
- // The occurrence this call addressed is settled and cannot move again -- a
803
- // denied effect approval, an expired continuation -- so the caller runs the
804
- // same call again as a new request. The refusal names the re-request; this
805
- // word is the re-request.
806
- CEAL_REPEAT_REQUEST_NEXT_ACTION,
807
- "choose_new_request_identity",
808
- // A refusal that names the argument (invalid_argument with `property`) tells the caller exactly what to change.
809
- "correct_argument",
810
- // A resolver-owned input must move from caller operands into the declared
811
- // resolver selection field.
812
- "supply_resolver_selections",
813
- // The graph names an upstream node whose Operation produces the resolver's
814
- // occurrence, and it has not produced one yet. The caller runs that node
815
- // first; the refusal used to share a code with a malformed resolver result,
816
- // which is not fixable, so neither could carry a remedy.
817
- "run_resolver_dependency",
818
- // A replay carries the input the occurrence durably admitted, and this one
819
- // carries a different one. The caller fixes it by presenting the original
820
- // invocation, so it is a remedy; the coordinator minted the word at the
821
- // replay guard and never declared it, which read as unguided to the scorer.
822
- "use_original_input",
823
- // The same mismatch on the Request binding rather than the input: the
824
- // occurrence was admitted under one binding and the replay presents another.
825
- "use_original_request_binding",
826
- // The client's own filesystem write was refused -- EACCES, EPERM, or a
827
- // read-only mount -- which is how an agent sandbox fences writes outside its
828
- // workspace. The caller reruns the same command with unsandboxed or escalated
829
- // execution; re-adopting the session cannot help, because the sandbox refuses
830
- // that write too.
831
- "rerun_outside_agent_sandbox",
832
- // The refusal names the one Operation to read next in `describe_command`:
833
- // an absent Operation id with a sole catalog-ranked candidate, or a known
834
- // Operation invoked without its input. Describing only reads the verified
835
- // contract and dispatches nothing, and the caller then retries with the
836
- // named Operation or input, so it is guidance the scorer counts.
837
- "describe_operation",
838
- // The refusal names the caller's own personal connect Operation in
839
- // `required_action_sequence`: the Operation asked for, or the credential
840
- // the call ran on, needs a personal connection the caller does not hold
841
- // (never connected, revoked, or expired). The caller runs that exact
842
- // Operation, completes the consent it hands back, and retries the same call.
843
- "connect_personal_account",
844
- // The provider or Gateway named a bounded wait; the caller waits that long
845
- // and submits the same read again.
846
- "retry_after"
847
- ];
848
- var CEAL_CALLER_RECOVERABLE_NEXT_ACTIONS = Object.freeze(CALLER_RECOVERABLE_NEXT_ACTION_VALUES);
849
- var NON_REMEDY_NEXT_ACTION_VALUES = [
850
- // Only an administrator can take the named step -- approving a place for an
851
- // Operation, granting a withheld capability -- so a non-administrator asks
852
- // one. The refusal names the administrator step; this word is the ask.
853
- "ask_admin",
854
- "await_pending_approval",
855
- "check_gateway",
856
- "inspect_context_store",
857
- "inspect_gateway",
858
- "inspect_local_cache",
859
- // The thin client prints these on its own behalf, before or after the wire.
860
- // They were declared only as `CealClientLocalRemedy` keys and, for two of
861
- // them, only as Go string literals -- a second and third vocabulary for one
862
- // thing. `CealClientLocalRemedy` derives from this list now, so the client's
863
- // remedies cannot drift from the words the protocol knows.
864
- "inspect_local_client",
865
- "inspect_local_command",
866
- "inspect_local_output",
867
- "inspect_local_route",
868
- CEAL_INSPECT_RECEIPT_NEXT_ACTION,
869
- "inspect_request",
870
- "none",
871
- // The provider refused because of its own configuration -- an API not
872
- // enabled, an app scope missing -- which an operator changes in that
873
- // provider's console. No caller edit and no retry fixes it.
874
- "operator_action",
875
- "recover",
876
- "reconcile",
877
- // Reconciliation of one named occurrence, not of the deployment: an
878
- // occurrence with no admitted input commitment cannot be replayed safely and
879
- // no edit to the call changes that. `reconcile` is the deployment-wide word.
880
- "reconcile_occurrence",
881
- "reduce_request_size",
882
- // The Host's invocation context for this turn is stale or expired at the
883
- // Gateway. The Host's next turn rebinds it and the same call then succeeds;
884
- // nothing in the call changes, so it is not a remedy the scorer may count.
885
- "refresh_host_invocation_context",
886
- "repair_or_adopt_session",
887
- "retry",
888
- // The owner -- a correlation hook, an approval hook -- is not serving right
889
- // now. The caller changes nothing and the same call succeeds once the owner
890
- // is back, so this is not a remedy the scorer may count as guidance.
891
- "retry_after_owner_recovery",
892
- "retry_same_receipt_read",
893
- "run_file_search_again",
894
- "select_exact_approval"
895
- ];
896
- var CEAL_NON_REMEDY_NEXT_ACTIONS = Object.freeze(NON_REMEDY_NEXT_ACTION_VALUES);
897
- var DECLARED = /* @__PURE__ */ new Set([...CEAL_CALLER_RECOVERABLE_NEXT_ACTIONS, ...CEAL_NON_REMEDY_NEXT_ACTIONS]);
898
- var RECOVERABLE = new Set(CEAL_CALLER_RECOVERABLE_NEXT_ACTIONS);
899
- var CEAL_OPERATION_WITHHELD_NEXT_ACTIONS = Object.freeze({
900
- provider_permission: "ask_admin",
901
- access_level: "ask_admin",
902
- personal_authorization_required: "connect_personal_account"
903
- });
886
+ // packages/ceal-client-protocol/src/operation-result-completeness.ts
887
+ var CEAL_READ_VALUE_CONTINUATION_KEYS = vocabulary(["continuation", "continuation_ref", "next_cursor"]);
904
888
 
905
889
  // packages/ceal-client-protocol/src/operation-contract-artifact.ts
906
890
  var CATALOG_REVISION = new RegExp(CEAL_VERIFIED_ARTIFACT_CATALOG_REVISION_PATTERN, "u");
@@ -909,7 +893,9 @@ var CEAL_OPERATION_INVOKE_COMMAND = "invoke";
909
893
  var CEAL_OPERATION_INPUT_FLAG = "--input";
910
894
  var CEAL_OPERATION_ID_PLACEHOLDER = "<operation-id>";
911
895
  var CEAL_OPERATION_INPUT_PLACEHOLDER = "<json-object>";
912
- var CEAL_MODEL_INVOCATION_ARGUMENTS = [CEAL_OPERATION_INVOKE_COMMAND, CEAL_OPERATION_ID_PLACEHOLDER, CEAL_OPERATION_INPUT_FLAG, shellSingleQuoted(CEAL_OPERATION_INPUT_PLACEHOLDER)].join(" ");
896
+ var MODEL_INVOCATION_BASE_ARGUMENTS = [CEAL_OPERATION_INVOKE_COMMAND, CEAL_OPERATION_ID_PLACEHOLDER].join(" ");
897
+ var CEAL_MODEL_INVOCATION_ARGUMENTS = [MODEL_INVOCATION_BASE_ARGUMENTS, CEAL_OPERATION_INPUT_FLAG, shellSingleQuoted(CEAL_OPERATION_INPUT_PLACEHOLDER)].join(" ");
898
+ 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.`;
913
899
  function shellSingleQuoted(value) {
914
900
  return `'${value.replaceAll("'", "'\\''")}'`;
915
901
  }
@@ -941,76 +927,7 @@ var CEAL_VERIFIED_ARTIFACT_DESCRIPTOR_JSON_SCHEMA = Object.freeze({
941
927
  }
942
928
  });
943
929
 
944
- // packages/ceal-client-protocol/src/bare-document.ts
945
- var REQUIRED_FIELDS = CEAL_CLIENT_WIRE_CONTRACT.command_response.bare_document_fields;
946
- var OPTIONAL_FIELDS = CEAL_CLIENT_WIRE_CONTRACT.command_response.bare_document_optional_fields;
947
-
948
- // packages/ceal-client-protocol/src/leased-consumer-vocabulary.ts
949
- var CEAL_TERMINAL_DISPOSITIONS = vocabulary(["completed", "failed", "cancelled"]);
950
- var CEAL_LEASE_DISPOSITIONS = vocabulary([...CEAL_TERMINAL_DISPOSITIONS, "deferred"]);
951
- var CEAL_AUTOMATIC_FEEDBACK_INTENTS = vocabulary(["initial"]);
952
- var CEAL_LEASED_MESSAGE_DELIVERY_OPERATION_IDS = vocabulary(["message.send", "message.update", "message.delete"]);
953
- var CEAL_REPOSITORY_VISIBILITIES = vocabulary(["public", "private", "internal"]);
954
- var CEAL_RESULT_DELIVERY_OFFERS = vocabulary(["pending", "offered", "transport_lost"]);
955
- var CEAL_RESULT_DELIVERY_STATES = vocabulary(["unavailable", ...CEAL_RESULT_DELIVERY_OFFERS]);
956
- var CEAL_PROVIDER_OUTCOMES = vocabulary(["not_attempted", "outcome_unknown", "verified"]);
957
- var CEAL_ACTIVITY_GAP_CODES = vocabulary([
958
- "provider_page_budget",
959
- "call_deadline",
960
- "related_item_budget",
961
- "provider_cursor_unavailable",
962
- "malformed_provider_page",
963
- "visibility_incomplete",
964
- "unsupported_event_kind"
965
- ]);
966
- var CEAL_ACTIVITY_CONNECTOR_KINDS = vocabulary(["slack", "github", "google-calendar", "google-drive", "notion"]);
967
- var CEAL_ACTIVITY_COVERAGE_STATUSES = vocabulary(["complete_for_target", "continuation_required", "blocked"]);
968
- var CEAL_ACTIVITY_EVENT_KINDS = vocabulary([
969
- "slack.message",
970
- "slack.reply",
971
- "slack.direct_message",
972
- "github.commit.authored",
973
- "github.issue.opened",
974
- "github.pull_request.opened",
975
- "github.review.submitted",
976
- "github.issue_comment.created",
977
- "github.review_comment.created",
978
- "calendar.organized",
979
- "calendar.accepted_invite",
980
- "calendar.recorded",
981
- "drive.file.created",
982
- "drive.file.modified",
983
- "drive.file.viewed",
984
- "notion.page.created",
985
- "notion.page.edited"
986
- ]);
987
- var CEAL_ACTIVITY_TIMESTAMP_BASES = vocabulary([
988
- "message_created",
989
- "commit_authored",
990
- "resource_created",
991
- "review_submitted",
992
- "comment_created",
993
- "event_start",
994
- "all_day_start",
995
- "file_created",
996
- "file_modified",
997
- "file_modified_by_me",
998
- "file_viewed_by_me",
999
- "page_created",
1000
- "page_last_edited",
1001
- "resource_modified"
1002
- ]);
1003
- var CEAL_ACTIVITY_V3_KINDS = vocabulary(["authored", "edited", "messaged", "responded"]);
1004
- var CEAL_RESOURCE_TIME_BASES = vocabulary(["created", "modified", "viewed"]);
1005
- var CEAL_RESOURCE_SEARCH_ORDERS = vocabulary(["relevance", "modified", "viewed", "created"]);
1006
- var CEAL_RESOURCE_SEARCH_DIRECTIONS = vocabulary(["ascending", "descending"]);
1007
- 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"]);
1008
- var CEAL_ARTIFACT_STAGE_TERMINALS = vocabulary(["chunk_accepted", "artifact_ready", "idempotency_replayed"]);
1009
- var CEAL_READ_ITEM_KINDS = vocabulary(["conversation", "identity", "usergroup", "message", "file", "document"]);
1010
- var CEAL_LEASED_MESSAGE_SEARCH_COMPLETENESS = vocabulary(["complete", "continuation_available", "truncated"]);
1011
- var CEAL_OPAQUE_HANDLE_KINDS = vocabulary(["target", "message", "thread", "artifact", "document", "object"]);
1012
- var CEAL_WRITE_OBJECT_KINDS = vocabulary(["document", "comment", "cell_range"]);
1013
- var CEAL_CONVERSATION_KINDS = vocabulary(["channel", "dm", "group"]);
930
+ // packages/ceal-client-protocol/src/provider-operation-vocabulary.ts
1014
931
  var CEAL_FILE_TYPE_FAMILIES = vocabulary(["all", "image", "pdf"]);
1015
932
  var CEAL_GITHUB_ISSUE_STATES = vocabulary(["open", "closed", "all"]);
1016
933
  var CEAL_NOTION_UPDATABLE_BLOCK_TYPES = vocabulary([
@@ -1044,12 +961,92 @@ var CEAL_NOTION_IDENTITY_GAP_REASONS = vocabulary([
1044
961
  "identity_unlinked"
1045
962
  ]);
1046
963
  var CEAL_NOTION_STRING_VALUE_TYPES = vocabulary(["text", "select", "url", "email", "phone"]);
1047
- var CEAL_UNREAD_REASONS = vocabulary(["blocked", "unavailable", "too_large", "unsupported", "download_failed", "permission_denied"]);
1048
- var CEAL_PLAN_ITEM_STATUSES = vocabulary(["pending", "active", "completed"]);
1049
- var CEAL_FINAL_PRESENTATION_INTENTS = vocabulary(["final", "stop", "transient_notice"]);
1050
- var CEAL_PRESENTATION_INTENTS = vocabulary(["progress", ...CEAL_FINAL_PRESENTATION_INTENTS]);
964
+
965
+ // packages/ceal-client-protocol/src/opaque-reference.ts
966
+ var CEAL_OPAQUE_HANDLE_KINDS = vocabulary(["target", "message", "thread", "artifact", "document", "block", "object"]);
967
+ var CEAL_OPAQUE_REF_KINDS = vocabulary([...CEAL_OPAQUE_HANDLE_KINDS, "result", "operation-receipt", "reply-receipt", "field", "notion-data-source"]);
968
+
969
+ // packages/ceal-client-protocol/src/bare-document.ts
970
+ var REQUIRED_FIELDS = CEAL_CLIENT_WIRE_CONTRACT.command_response.bare_document_fields;
971
+ var OPTIONAL_FIELDS = CEAL_CLIENT_WIRE_CONTRACT.command_response.bare_document_optional_fields;
1051
972
 
1052
973
  // packages/ceal-client-protocol/src/resource-row.ts
974
+ var CEAL_RESOURCE_SEARCH_ORDERS = vocabulary(["relevance", "modified", "viewed", "created"]);
975
+ var CEAL_RESOURCE_SEARCH_DIRECTIONS = vocabulary(["ascending", "descending"]);
976
+ 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"]);
977
+ var CEAL_RESOURCE_TIME_BASES = vocabulary(["created", "modified", "viewed"]);
978
+ var CEAL_REPOSITORY_VISIBILITIES = vocabulary(["public", "private", "internal"]);
979
+ var CEAL_ACTIVITY_V3_KINDS = vocabulary(["authored", "edited", "messaged", "responded"]);
980
+ var CEAL_ACTIVITY_TIMESTAMP_BASES = vocabulary([
981
+ "message_created",
982
+ "commit_authored",
983
+ "resource_created",
984
+ "review_submitted",
985
+ "comment_created",
986
+ "event_start",
987
+ "all_day_start",
988
+ "file_created",
989
+ "file_modified",
990
+ "file_modified_by_me",
991
+ "file_viewed_by_me",
992
+ "page_created",
993
+ "page_last_edited",
994
+ "resource_modified"
995
+ ]);
996
+ var CEAL_ACTIVITY_CONNECTOR_KINDS = vocabulary(["slack", "github", "google-calendar", "google-drive", "notion"]);
997
+ var CEAL_ACTIVITY_GAP_CODES = vocabulary([
998
+ "provider_page_budget",
999
+ "call_deadline",
1000
+ "related_item_budget",
1001
+ "provider_cursor_unavailable",
1002
+ "malformed_provider_page",
1003
+ "visibility_incomplete",
1004
+ "unsupported_event_kind",
1005
+ "direct_messages_excluded"
1006
+ ]);
1007
+ var CEAL_ACTIVITY_EVENT_KINDS = vocabulary([
1008
+ "slack.message",
1009
+ "slack.reply",
1010
+ "slack.direct_message",
1011
+ "github.commit.authored",
1012
+ "github.issue.opened",
1013
+ "github.pull_request.opened",
1014
+ "github.issue.edited",
1015
+ "github.pull_request.edited",
1016
+ "github.review.submitted",
1017
+ "github.issue_comment.created",
1018
+ "github.review_comment.created",
1019
+ "calendar.organized",
1020
+ "calendar.accepted_invite",
1021
+ "calendar.recorded",
1022
+ "drive.file.created",
1023
+ "drive.file.modified",
1024
+ "drive.file.viewed",
1025
+ "notion.page.created",
1026
+ "notion.page.edited"
1027
+ ]);
1028
+ var CEAL_ACTIVITY_EVENT_TIMESTAMP_BASIS_MAP = Object.freeze({
1029
+ "slack.message": "message_created",
1030
+ "slack.reply": "message_created",
1031
+ "slack.direct_message": "message_created",
1032
+ "github.commit.authored": "commit_authored",
1033
+ "github.review.submitted": "review_submitted",
1034
+ "github.issue_comment.created": "comment_created",
1035
+ "github.review_comment.created": "comment_created",
1036
+ "github.issue.opened": "resource_created",
1037
+ "github.pull_request.opened": "resource_created",
1038
+ "github.issue.edited": "resource_modified",
1039
+ "github.pull_request.edited": "resource_modified",
1040
+ "calendar.organized": "resource_created",
1041
+ "drive.file.created": "file_created",
1042
+ "drive.file.modified": "file_modified_by_me",
1043
+ "drive.file.viewed": "file_viewed_by_me",
1044
+ "notion.page.created": "page_created",
1045
+ "notion.page.edited": "page_last_edited"
1046
+ });
1047
+ var CEAL_DATED_NOTE_BASES = vocabulary(["recording", "calendar_event", "created_time"]);
1048
+ var CEAL_DATED_NOTE_TRANSCRIPT_STATES = vocabulary(["present", "absent", "unestablished"]);
1049
+ var CEAL_READ_SEARCH_COST_CLASSES = vocabulary(["native_index", "scan"]);
1053
1050
  var RESOURCE_ROW_KEY_RULES = Object.freeze({
1054
1051
  schema_version: { required: true, timestamp: false },
1055
1052
  ref: { required: true, timestamp: false },
@@ -1062,6 +1059,7 @@ var RESOURCE_ROW_KEY_RULES = Object.freeze({
1062
1059
  source: { required: true, timestamp: false },
1063
1060
  owner: { required: false, timestamp: false },
1064
1061
  counterparts: { required: false, timestamp: false },
1062
+ attachments: { required: false, timestamp: false },
1065
1063
  created_at: { required: false, timestamp: true },
1066
1064
  created_at_local: { required: false, timestamp: true },
1067
1065
  modified_at: { required: false, timestamp: true },
@@ -1072,6 +1070,7 @@ var RESOURCE_ROW_KEY_RULES = Object.freeze({
1072
1070
  end: { required: false, timestamp: false },
1073
1071
  status: { required: false, timestamp: false },
1074
1072
  snippet: { required: false, timestamp: false },
1073
+ dated_notes: { required: false, timestamp: false },
1075
1074
  state: { required: true, timestamp: false },
1076
1075
  timestamp_basis: { required: true, timestamp: false }
1077
1076
  });
@@ -1108,16 +1107,26 @@ var CEAL_WRITE_SAFETY_UNCHECKED_REASONS = vocabulary(["authority_unavailable"]);
1108
1107
  // packages/ceal-client-protocol/src/operation-occurrence.ts
1109
1108
  var MAX_RECEIPT_REVISION = Number.MAX_SAFE_INTEGER - 1;
1110
1109
 
1111
- // packages/ceal-client-protocol/src/leased-artifact-contract.ts
1112
- var CEAL_LEASED_CONSUMER_ARTIFACT_CHUNK_MAX_BYTES = 12 * 1024;
1113
-
1114
- // packages/ceal-client-protocol/src/leased-resource-stream.ts
1115
- var CEAL_LEASED_CONSUMER_ATTACHMENT_STREAM_MAGIC = new Uint8Array([67, 69, 65, 76, 82, 83, 50, 0]);
1116
- var CEAL_LEASED_CONSUMER_ATTACHMENT_STREAM_RECORD_PREFIX_BYTES = 8;
1117
- var CEAL_LEASED_CONSUMER_ATTACHMENT_STREAM_MAX_HEADER_BYTES = 16 * 1024;
1118
- var CEAL_LEASED_CONSUMER_ATTACHMENT_STREAM_CHUNK_BYTES = 64 * 1024;
1119
- 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;
1120
- var CEAL_ATTACHMENT_UNREAD_REASONS = vocabulary(["blocked", "unavailable", "too_large", "unsupported", "download_failed", "digest_mismatch"]);
1110
+ // packages/ceal-client-protocol/src/personal-client-vocabulary.ts
1111
+ var CEAL_PERSONAL_CLIENT_BINDING_KEYS = vocabulary([
1112
+ "access_group_ref",
1113
+ "membership_ref",
1114
+ "registration_ref",
1115
+ "client_ref",
1116
+ "subject_ref",
1117
+ "instance_ref"
1118
+ ]);
1119
+ var CEAL_ENROLLMENT_FAILURE_CODES = vocabulary(["enrollment_invalid", "enrollment_expired", "enrollment_used"]);
1120
+ var CEAL_REFRESH_FAILURE_CODES = vocabulary([
1121
+ "refresh_invalid",
1122
+ "refresh_expired",
1123
+ "refresh_inactive",
1124
+ "refresh_replayed",
1125
+ "refresh_revoked",
1126
+ "authority_replaced",
1127
+ "refresh_recovery_unavailable",
1128
+ "refresh_recovery_expired"
1129
+ ]);
1121
1130
 
1122
1131
  // packages/ceal-client-protocol/src/request-validation-primitives.ts
1123
1132
  import { createHash } from "node:crypto";
@@ -1203,7 +1212,7 @@ var CEAL_REQUEST_MAX_GRAPH_NODES = 128;
1203
1212
 
1204
1213
  // packages/ceal-client-protocol/src/request-run.ts
1205
1214
  var CEAL_REQUEST_NODE_STANDING_OCCURRENCE_SCHEMA_VERSION = "ceal.request_node_standing_occurrence.v1";
1206
- var CEAL_REQUEST_RUN_BATCH_SCHEMA_VERSION = "ceal.request_run_batch.v3";
1215
+ var CEAL_REQUEST_RUN_BATCH_SCHEMA_VERSION = "ceal.request_run_batch.v1";
1207
1216
  var REQUEST_ACTION_SAFE_REF_SCHEMA = { type: "string", minLength: 1, maxLength: 128, pattern: SAFE_REF.source };
1208
1217
  var REQUEST_ACTION_DIGEST_SCHEMA = { type: "string", minLength: 64, maxLength: 64, pattern: "^[a-f0-9]{64}$" };
1209
1218
  var REQUEST_NODE_STANDING_OCCURRENCE_SCHEMA = {
@@ -1285,6 +1294,10 @@ var CEAL_REQUEST_RUN_BATCH_JSON_SCHEMA = {
1285
1294
  };
1286
1295
 
1287
1296
  // packages/ceal-client-protocol/src/host-observation.ts
1297
+ var CEAL_HOST_INPUT_KINDS = vocabulary(["human", "host_automatic"]);
1298
+ function isCealHostInputKind(value) {
1299
+ return typeof value === "string" && CEAL_HOST_INPUT_KINDS.some((kind) => kind === value);
1300
+ }
1288
1301
  var CEAL_HOST_OBSERVATION_REF_PREFIX = "host-observation:";
1289
1302
  var HOST_OBSERVATION_PRODUCER = /^[a-z][a-z0-9]{0,31}$/u;
1290
1303
  var HOST_OBSERVATION_DIGEST = /^[a-f0-9]{8,64}$/u;
@@ -1347,12 +1360,6 @@ var OWNER_WRITE_STATES = Object.freeze(["attempt_started", "provider_acknowledge
1347
1360
  var OWNER_EFFECT_STATES = Object.freeze(["none", "applied", "failed", "unknown", "reconciled"]);
1348
1361
  var OWNER_RECEIPT_STATES = Object.freeze(["pending", "available", "failed", "unknown", "reconciled"]);
1349
1362
 
1350
- // packages/ceal-client-protocol/src/thread-excerpt.ts
1351
- var CEAL_THREAD_RECENT_WINDOW = 6;
1352
- var CEAL_THREAD_LAST_APP_MESSAGES_WINDOW = 3;
1353
- var CEAL_THREAD_OLDER_SUMMARY_WINDOW = 4;
1354
- var CEAL_FED_THREAD_MESSAGE_LIMIT = CEAL_THREAD_RECENT_WINDOW + CEAL_THREAD_OLDER_SUMMARY_WINDOW + CEAL_THREAD_LAST_APP_MESSAGES_WINDOW;
1355
-
1356
1363
  // packages/ceal-client-protocol/src/request-graph-readiness.ts
1357
1364
  var REQUEST_GRAPH_PRODUCER_TO_APPEND_SCHEMA = {
1358
1365
  type: "object",
@@ -1441,25 +1448,13 @@ var CEAL_HOST_INVOCATION_AUTHENTICATION_RESULT_MAX_BYTES = new TextEncoder().enc
1441
1448
  `).byteLength;
1442
1449
 
1443
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"]);
1444
1452
  var CEAL_MODEL_VISIBLE_COMMAND_OUTPUT_MAX_BYTES = 32 * 1024;
1445
- var REQUIRED_FIELDS2 = Object.freeze(["schema_version", "operation_id", "read_argv"]);
1446
- var FIELDS = /* @__PURE__ */ new Set([...REQUIRED_FIELDS2, "local_result_root", "continue_argv"]);
1453
+ var REQUIRED_FIELDS2 = Object.freeze(["schema_version", "operation_id"]);
1454
+ var FIELDS = /* @__PURE__ */ new Set([...REQUIRED_FIELDS2, "read_argv", "local_result_root", "continue_argv", "model_disclosure", "item_read_argv"]);
1447
1455
 
1448
1456
  // packages/ceal-client-protocol/src/session-start-affordance.ts
1449
1457
  var CEAL_SESSION_ENTRY_INVOCATION = "ceal";
1450
- 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.`;
1451
-
1452
- // packages/ceal-client-protocol/src/conversation-contracts.ts
1453
- var CEAL_APPROVAL_POLICY_KINDS = vocabulary(["requester_only", "named_users", "role_based"]);
1454
- var CEAL_APPROVAL_TARGET_KINDS = vocabulary([
1455
- "repo_change",
1456
- "investigation",
1457
- "skill_creation",
1458
- "command_creation",
1459
- "connector_creation",
1460
- "generic"
1461
- ]);
1462
- var CEAL_PROGRESS_PHASES = vocabulary(["request_review", "information_gathering", "work_execution", "result_check"]);
1463
1458
 
1464
1459
  // packages/ceal-client-protocol/src/gateway-cache-origin-validation.ts
1465
1460
  var CEAL_MAX_CACHE_ORIGIN_AGE_MS = 30 * 24 * 60 * 60 * 1e3;
@@ -1543,27 +1538,6 @@ var ADMIN_LINEAGE_NODE_KINDS = vocabulary(["source_read", "synthesis_preview", "
1543
1538
  // packages/ceal-client-protocol/src/actor-kind.ts
1544
1539
  var CEAL_ACTOR_KINDS = vocabulary(["human", "bot", "app", "unknown"]);
1545
1540
 
1546
- // packages/ceal-client-protocol/src/personal-client-vocabulary.ts
1547
- var CEAL_PERSONAL_CLIENT_BINDING_KEYS = vocabulary([
1548
- "access_group_ref",
1549
- "membership_ref",
1550
- "registration_ref",
1551
- "client_ref",
1552
- "subject_ref",
1553
- "instance_ref"
1554
- ]);
1555
- var CEAL_ENROLLMENT_FAILURE_CODES = vocabulary(["enrollment_invalid", "enrollment_expired", "enrollment_used"]);
1556
- var CEAL_REFRESH_FAILURE_CODES = vocabulary([
1557
- "refresh_invalid",
1558
- "refresh_expired",
1559
- "refresh_inactive",
1560
- "refresh_replayed",
1561
- "refresh_revoked",
1562
- "authority_replaced",
1563
- "refresh_recovery_unavailable",
1564
- "refresh_recovery_expired"
1565
- ]);
1566
-
1567
1541
  // packages/ceal-client-protocol/src/device-enrollment.ts
1568
1542
  var CEAL_DEVICE_ENROLLMENT_POLL_FAILURE_CODES = Object.freeze(["unsupported_feature", "recovery_required", "expired", "denied"]);
1569
1543
  var POLL_RESULT_KEYS = Object.freeze(["retry_after_ms", "schema_version", "status"]);
@@ -1752,13 +1726,13 @@ function validTurn(value) {
1752
1726
  return exactOptional(value, ["local_session_ref", "local_turn_ref"], ["model", "observations"]) && safeRef(value.local_session_ref) && safeRef(value.local_turn_ref) && optionalText2(value.model, 256) && validObservations(value.observations);
1753
1727
  }
1754
1728
  function validInput(value) {
1755
- 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);
1729
+ 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);
1756
1730
  }
1757
1731
  function validInputObservations(value) {
1758
1732
  return validObservations(value) && Array.isArray(value) && value.filter((item) => record2(item) && item.observation_kind === "prompt").length === 1;
1759
1733
  }
1760
1734
  function validInputOptionals(value) {
1761
- return validDecision(value.decision) && optionalRefs(value.local_turn_aliases) && (value.context_expires_at === void 0 || timestamp(value.context_expires_at));
1735
+ return optionalRefs(value.local_turn_aliases) && (value.context_expires_at === void 0 || timestamp(value.context_expires_at));
1762
1736
  }
1763
1737
  function validTerminal(value) {
1764
1738
  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);
@@ -1769,9 +1743,6 @@ function validTerminalDisposition(state, reason) {
1769
1743
  function validStatus(value) {
1770
1744
  return exactOptional(value, ["status", "reason_code"], ["detail"]) && ["ready", "degraded", "stopping"].includes(String(value.status)) && safeRef(value.reason_code) && optionalText2(value.detail, 4096);
1771
1745
  }
1772
- function validDecision(value) {
1773
- return value === void 0 || record2(value) && exactKeys(value, ["decision", "approval_ref"]) && (value.decision === "approved" || value.decision === "denied") && safeRef(value.approval_ref);
1774
- }
1775
1746
  function optionalText2(value, maxLength) {
1776
1747
  return value === void 0 || typeof value === "string" && value.length > 0 && value.length <= maxLength;
1777
1748
  }
@@ -2421,7 +2392,7 @@ function inputFrames(input, at) {
2421
2392
  const promptDigest = createHash3("sha256").update(input.prompt, "utf8").digest("hex");
2422
2393
  const turn = obs("turn", turnRef, at, { status: "started", prompt_id_sha256: createHash3("sha256").update(input.prompt_id, "utf8").digest("hex"), effort: input.effort?.level ?? "unavailable" });
2423
2394
  const prompt = obs("prompt", claudeLocalInputRef(input.session_id, input.prompt_id), at, { body_sha256: promptDigest });
2424
- return [{ frame_kind: "turn_started", payload: { local_session_ref: sessionRef, local_turn_ref: turnRef, observations: [turn] } }, { frame_kind: "user_input", payload: compact({ local_session_ref: sessionRef, local_turn_ref: turnRef, local_input_ref: claudeLocalInputRef(input.session_id, input.prompt_id), origin_input: true, local_turn_aliases: [safeAlias(input.prompt_id)], context_expires_at: new Date(Date.parse(at) + 24 * 60 * 60 * 1e3).toISOString(), observations: [prompt] }) }];
2395
+ return [{ frame_kind: "turn_started", payload: { local_session_ref: sessionRef, local_turn_ref: turnRef, observations: [turn] } }, { frame_kind: "user_input", payload: compact({ local_session_ref: sessionRef, local_turn_ref: turnRef, local_input_ref: claudeLocalInputRef(input.session_id, input.prompt_id), input_kind: "human", origin_input: true, local_turn_aliases: [safeAlias(input.prompt_id)], context_expires_at: new Date(Date.parse(at) + 24 * 60 * 60 * 1e3).toISOString(), observations: [prompt] }) }];
2425
2396
  }
2426
2397
  function terminalFrames(input, at) {
2427
2398
  const sessionRef = claudeLocalSessionRef(input.session_id);