@corca-org/ceal-host-linux-arm64 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.
@@ -2251,7 +2251,7 @@ var client_wire_contract_default = {
2251
2251
  "prompt"
2252
2252
  ],
2253
2253
  discovery_command: "discovery",
2254
- discovery_manifest_schema_version: "ceal.discovery_manifest.v2",
2254
+ discovery_manifest_schema_version: "ceal.discovery_manifest.v1",
2255
2255
  discovery_manifest_document_fields: [
2256
2256
  "discovery_manifest"
2257
2257
  ],
@@ -2325,10 +2325,11 @@ var CEAL_AUDIT_OUTCOMES = vocabulary(["succeeded", "denied", "failed"]);
2325
2325
  var CEAL_GATEWAY_PROVIDER_STEP_OUTCOMES = vocabulary(["completed", "rejected", "throttled", "failed"]);
2326
2326
  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"]);
2327
2327
  var CEAL_GATEWAY_READ_REUSE_UNAVAILABLE_REASONS = vocabulary(["not_reported", "storage_unavailable", "coverage_incomplete", "freshness_refresh_required", "not_reusable", "bypassed"]);
2328
+ var CEAL_GATEWAY_DERIVED_STORE_FAILURE_CLASSES = vocabulary(["storage_unavailable", "decode_mismatch", "write_conflict", "quota", "store_error"]);
2328
2329
  var CEAL_POLICY_DECISIONS = vocabulary(["allowed", "denied", "not_evaluated"]);
2329
2330
  var CEAL_CONNECTOR_ROUTE_PHASES = vocabulary(["scope_observation", "target_selection", "route_resolution"]);
2330
2331
  var CEAL_CONNECTOR_ROUTE_CAUSES = vocabulary(["provider_throttled", "provider_unavailable", "binding_invalid", "scope_limit_exceeded"]);
2331
- var CEAL_WRITE_SOURCE_KINDS = vocabulary(["authenticated_registered_client", "agent_lease_admission", "provider_authenticated_event"]);
2332
+ var CEAL_WRITE_SOURCE_KINDS = vocabulary(["authenticated_registered_client", "provider_authenticated_event"]);
2332
2333
  var CEAL_REFRESH_DELIVERIES = vocabulary(["initial", "recovery", "replay", "terminal_failure", "recovery_unavailable"]);
2333
2334
  var CEAL_CLIENT_OPERATIONS = vocabulary(["handshake", "discover", "call", "readback"]);
2334
2335
  var CEAL_WRITE_IDEMPOTENCY_POSTURES = vocabulary(["required", "optional", "not_required"]);
@@ -2338,6 +2339,17 @@ var CEAL_WRITE_RECEIPT_PROVIDER_STATES = vocabulary(["outcome_unknown", "verifie
2338
2339
  var CEAL_WRITE_RECEIPT_PROVIDER_READBACKS = vocabulary(["outcome_unknown", "verified", "not_applied"]);
2339
2340
  var CEAL_PROTOCOL_VERSION = "1.4.0";
2340
2341
  var CEAL_OPERATION_ACCESS_SCHEMA_VERSION = "ceal.operation_access.v1";
2342
+ var CEAL_GATEWAY_ACTIVE_CALL_PHASES = vocabulary([
2343
+ "audited_call_pending",
2344
+ "continuation_read_pending",
2345
+ "continuation_write_pending",
2346
+ "provider_pacing_pending",
2347
+ "corpus_replay_pending",
2348
+ "corpus_append_pending",
2349
+ "corpus_fence_pending",
2350
+ "corpus_content_pending",
2351
+ "corpus_transaction_pending"
2352
+ ]);
2341
2353
  var CEAL_CONNECTOR_ROUTE_FAILURE_KEYS = vocabulary(["connector_kind", "phase", "schema_version"]);
2342
2354
  var CEAL_CLASSIFIED_CONNECTOR_ROUTE_FAILURE_KEYS = vocabulary(["cause", ...CEAL_CONNECTOR_ROUTE_FAILURE_KEYS]);
2343
2355
  var CEAL_UNCLASSIFIED_CONNECTOR_ROUTE_FAILURE_KEYS = vocabulary(["connector_kind", "error_class", "phase", "schema_version"]);
@@ -2347,10 +2359,130 @@ var CEAL_GATEWAY_ORGANIZATION_ROUTE_FACT_CALL_KEYS = Object.freeze([
2347
2359
  "policy_decision_revision"
2348
2360
  ]);
2349
2361
 
2362
+ // packages/ceal-client-protocol/src/operation-next-actions.ts
2363
+ var CEAL_REPEAT_REQUEST_NEXT_ACTION = "repeat_request";
2364
+ var CEAL_INSPECT_RECEIPT_NEXT_ACTION = "inspect_receipt";
2365
+ var CALLER_RECOVERABLE_NEXT_ACTION_VALUES = [
2366
+ "select_did_you_mean",
2367
+ "choose_new_output_path",
2368
+ "choose_new_idempotency_key",
2369
+ "restart_search",
2370
+ "repeat_original_arguments",
2371
+ // The occurrence this call addressed is settled and cannot move again -- a
2372
+ // denied effect approval, an expired continuation -- so the caller runs the
2373
+ // same call again as a new request. The refusal names the re-request; this
2374
+ // word is the re-request.
2375
+ CEAL_REPEAT_REQUEST_NEXT_ACTION,
2376
+ "choose_new_request_identity",
2377
+ // A refusal that names the argument (invalid_argument with `property`) tells the caller exactly what to change.
2378
+ "correct_argument",
2379
+ // A resolver-owned input must move from caller operands into the declared
2380
+ // resolver selection field.
2381
+ "supply_resolver_selections",
2382
+ // The graph names an upstream node whose Operation produces the resolver's
2383
+ // occurrence, and it has not produced one yet. The caller runs that node
2384
+ // first; the refusal used to share a code with a malformed resolver result,
2385
+ // which is not fixable, so neither could carry a remedy.
2386
+ "run_resolver_dependency",
2387
+ // A replay carries the input the occurrence durably admitted, and this one
2388
+ // carries a different one. The caller fixes it by presenting the original
2389
+ // invocation, so it is a remedy; the coordinator minted the word at the
2390
+ // replay guard and never declared it, which read as unguided to the scorer.
2391
+ "use_original_input",
2392
+ // The same mismatch on the Request binding rather than the input: the
2393
+ // occurrence was admitted under one binding and the replay presents another.
2394
+ "use_original_request_binding",
2395
+ // The client's own filesystem write was refused -- EACCES, EPERM, or a
2396
+ // read-only mount -- which is how an agent sandbox fences writes outside its
2397
+ // workspace. The caller reruns the same command with unsandboxed or escalated
2398
+ // execution; re-adopting the session cannot help, because the sandbox refuses
2399
+ // that write too.
2400
+ "rerun_outside_agent_sandbox",
2401
+ // The refusal names the one Operation to read next in `describe_command`:
2402
+ // an absent Operation id with a sole catalog-ranked candidate, or a known
2403
+ // Operation invoked without its input. Describing only reads the verified
2404
+ // contract and dispatches nothing, and the caller then retries with the
2405
+ // named Operation or input, so it is guidance the scorer counts.
2406
+ "describe_operation",
2407
+ // The refusal names the caller's own personal connect Operation in
2408
+ // `required_action_sequence`: the Operation asked for, or the credential
2409
+ // the call ran on, needs a personal connection the caller does not hold
2410
+ // (never connected, revoked, or expired). The caller runs that exact
2411
+ // Operation, completes the consent it hands back, and retries the same call.
2412
+ "connect_personal_account",
2413
+ // The provider or Gateway named a bounded wait; the caller waits that long
2414
+ // and submits the same read again.
2415
+ "retry_after",
2416
+ // The ref names a container of rows (a Notion database or data source), which
2417
+ // has no body of its own; the caller searches its rows instead of reading it.
2418
+ "search_container_rows"
2419
+ ];
2420
+ var CEAL_CALLER_RECOVERABLE_NEXT_ACTIONS = Object.freeze(CALLER_RECOVERABLE_NEXT_ACTION_VALUES);
2421
+ var NON_REMEDY_NEXT_ACTION_VALUES = [
2422
+ // Only an administrator can take the named step -- approving a place for an
2423
+ // Operation, granting a withheld capability -- so a non-administrator asks
2424
+ // one. The refusal names the administrator step; this word is the ask.
2425
+ "ask_admin",
2426
+ "await_pending_approval",
2427
+ "check_gateway",
2428
+ "inspect_context_store",
2429
+ "inspect_gateway",
2430
+ "inspect_local_cache",
2431
+ // The thin client prints these on its own behalf, before or after the wire.
2432
+ // They were declared only as `CealClientLocalRemedy` keys and, for two of
2433
+ // them, only as Go string literals -- a second and third vocabulary for one
2434
+ // thing. `CealClientLocalRemedy` derives from this list now, so the client's
2435
+ // remedies cannot drift from the words the protocol knows.
2436
+ "inspect_local_client",
2437
+ "inspect_local_command",
2438
+ "inspect_local_output",
2439
+ "inspect_local_route",
2440
+ CEAL_INSPECT_RECEIPT_NEXT_ACTION,
2441
+ "inspect_request",
2442
+ "none",
2443
+ // The provider refused because of its own configuration -- an API not
2444
+ // enabled, an app scope missing -- which an operator changes in that
2445
+ // provider's console. No caller edit and no retry fixes it.
2446
+ "operator_action",
2447
+ "recover",
2448
+ "reconcile",
2449
+ // Reconciliation of one named occurrence, not of the deployment: an
2450
+ // occurrence with no admitted input commitment cannot be replayed safely and
2451
+ // no edit to the call changes that. `reconcile` is the deployment-wide word.
2452
+ "reconcile_occurrence",
2453
+ "reduce_request_size",
2454
+ // The Host's invocation context for this turn is stale or expired at the
2455
+ // Gateway. The Host's next turn rebinds it and the same call then succeeds;
2456
+ // nothing in the call changes, so it is not a remedy the scorer may count.
2457
+ "refresh_host_invocation_context",
2458
+ "repair_or_adopt_session",
2459
+ "retry",
2460
+ // The owner -- a correlation hook, an approval hook -- is not serving right
2461
+ // now. The caller changes nothing and the same call succeeds once the owner
2462
+ // is back, so this is not a remedy the scorer may count as guidance.
2463
+ "retry_after_owner_recovery",
2464
+ "retry_same_receipt_read",
2465
+ "run_file_search_again",
2466
+ "select_exact_approval"
2467
+ ];
2468
+ var CEAL_NON_REMEDY_NEXT_ACTIONS = Object.freeze(NON_REMEDY_NEXT_ACTION_VALUES);
2469
+ var DECLARED = /* @__PURE__ */ new Set([...CEAL_CALLER_RECOVERABLE_NEXT_ACTIONS, ...CEAL_NON_REMEDY_NEXT_ACTIONS]);
2470
+ var RETRY_PROMISE_NEXT_ACTIONS = ["retry", "retry_after"];
2471
+ var RETRY_PROMISE = new Set(RETRY_PROMISE_NEXT_ACTIONS);
2472
+ var RECOVERABLE = new Set(CEAL_CALLER_RECOVERABLE_NEXT_ACTIONS);
2473
+ var CEAL_OPERATION_WITHHELD_NEXT_ACTIONS = Object.freeze({
2474
+ provider_permission: "ask_admin",
2475
+ access_level: "ask_admin",
2476
+ personal_authorization_required: "connect_personal_account"
2477
+ });
2478
+
2479
+ // packages/ceal-client-protocol/src/operation-withheld-cause.ts
2480
+ var CEAL_OPERATION_WITHHELD_CAUSES = vocabulary(["provider_permission", "access_level", "personal_authorization_required"]);
2481
+
2350
2482
  // packages/ceal-client-protocol/src/operation-contract-types.ts
2351
2483
  var CEAL_JSON_SCHEMA_2020_12 = "https://json-schema.org/draft/2020-12/schema";
2352
2484
  var CEAL_OPERATION_ERROR_SCHEMA_VERSION = "ceal.operation_error.v1";
2353
- var CEAL_OPERATION_WITHHELD_CAUSES = vocabulary(["provider_permission", "access_level", "personal_authorization_required"]);
2485
+ var CEAL_ARTIFACT_STAGE_TERMINALS = vocabulary(["chunk_accepted", "artifact_ready", "idempotency_replayed"]);
2354
2486
  var CEAL_RETRY_AFTER_MAX_MS = 60 * 60 * 1e3;
2355
2487
  var CEAL_JSON_SCHEMA_TYPES = vocabulary(["object", "array", "string", "integer", "number", "boolean", "null"]);
2356
2488
  var OBSERVATION_POSTURES = vocabulary(["direct_readback", "approved_no_readback", "operator_mediated", "excluded"]);
@@ -2614,6 +2746,8 @@ var CEAL_PROVIDER_BOUNDARY_KINDS = vocabulary([
2614
2746
  var CEAL_PROVIDER_BOUNDARY_EVIDENCE = vocabulary(["provider_readback", "operator_stated"]);
2615
2747
  var CEAL_ACCESS_LEVELS = vocabulary(["none", "read", "read_write"]);
2616
2748
  var CEAL_PERSONAL_ACCESS_CEILINGS = vocabulary(["disabled", "read", "read_write"]);
2749
+ var CEAL_TARGET_REF_PATTERN = "^[^\\p{Cc}]+$";
2750
+ var TARGET_REF = new RegExp(CEAL_TARGET_REF_PATTERN, "u");
2617
2751
  var CEAL_TARGET_VISIBILITIES = vocabulary(["public", "private"]);
2618
2752
  var CEAL_PRINCIPAL_KINDS = vocabulary(["human", "service", "runtime"]);
2619
2753
  var CEAL_ORGANIZATION_ROLES = vocabulary(["member", "admin"]);
@@ -2722,8 +2856,6 @@ var CEAL_OPERATION_AUTHORITY_POLICY_KEYS = Object.freeze(["access_group", "insta
2722
2856
  var MAX_OPERATION_INPUT_RESOLVER_BINDINGS = 96;
2723
2857
  var CEAL_OPERATION_DESCRIPTOR_REQUIRED_ENVELOPE_KEYS = Object.freeze(["schema_version", "id", "input_contract", "result_contract", "policy"]);
2724
2858
  var CEAL_OPERATION_DESCRIPTOR_OPTIONAL_ENVELOPE_KEYS = Object.freeze(["input_resolution", "summary"]);
2725
- var CEAL_OPERATION_RESULT_KEYS = vocabulary(["ok", "operation_id", "operation_receipt", "schema_version", "value"]);
2726
- var CEAL_OPERATION_COMPACT_RESULT_KEYS = vocabulary(["ok", "operation_evidence", "operation_id", "schema_version", "value"]);
2727
2859
 
2728
2860
  // packages/ceal-client-protocol/src/operation-catalog.ts
2729
2861
  var CEAL_OPERATION_CATALOG_SCHEMA_VERSION = "ceal.catalog.v3";
@@ -2735,8 +2867,8 @@ var CEAL_SCHEMA_LITERALS = [
2735
2867
  "ceal.activation_transport.v1",
2736
2868
  CEAL_OPERATION_ACCESS_SCHEMA_VERSION,
2737
2869
  CEAL_OPERATION_CATALOG_SCHEMA_VERSION,
2738
- "ceal.client_refresh_request.v2",
2739
- "ceal.client_refresh_result.v2",
2870
+ "ceal.client_refresh_request.v1",
2871
+ "ceal.client_refresh_result.v1",
2740
2872
  "ceal.client_revoke_request.v1",
2741
2873
  "ceal.client_revoke_result.v1",
2742
2874
  CEAL_COMMAND_REQUEST_SCHEMA_VERSION,
@@ -2765,7 +2897,7 @@ var CEAL_SCHEMA_LITERALS = [
2765
2897
  "ceal.gateway_call_result.v1",
2766
2898
  CEAL_GATEWAY_COMMAND_RESOLUTION_SCHEMA_VERSION,
2767
2899
  "ceal.gateway_connector_route_failure.v1",
2768
- "ceal.gateway_discovery.v3",
2900
+ "ceal.gateway_discovery.v1",
2769
2901
  "ceal.gateway_handshake.v1",
2770
2902
  "ceal.gateway_installation_activation_code_issue_request.v1",
2771
2903
  "ceal.gateway_installation_activation_code_issue_result.v1",
@@ -2787,10 +2919,6 @@ var CEAL_SCHEMA_LITERALS = [
2787
2919
  "ceal.host_observation.v1",
2788
2920
  "ceal.host_registration_request.v1",
2789
2921
  "ceal.host_registration_result.v1",
2790
- "ceal.leased-resource-stream.v2",
2791
- "ceal.leased_consumer_attachment_stream_frame.v2",
2792
- "ceal.leased_consumer_attachment_stream_request.v2",
2793
- "ceal.leased_consumer_attachment_stream_transport.v2",
2794
2922
  "ceal.operation_descriptor.v1",
2795
2923
  "ceal.operation_error.v1",
2796
2924
  "ceal.operation_failure.v1",
@@ -2798,7 +2926,7 @@ var CEAL_SCHEMA_LITERALS = [
2798
2926
  "ceal.operation_receipt.v1",
2799
2927
  "ceal.operation_result.v1",
2800
2928
  "ceal.operation_result.compact.v1",
2801
- "ceal.local_result_materialization.v2",
2929
+ "ceal.local_result_materialization.v1",
2802
2930
  "ceal.local_result_root.v1",
2803
2931
  "ceal.owner_bootstrap_exchange_request.v1",
2804
2932
  "ceal.owner_bootstrap_exchange_result.v1",
@@ -2816,12 +2944,6 @@ var CEAL_SCHEMA_LITERAL_SET = new Set(CEAL_SCHEMA_LITERALS);
2816
2944
  // packages/ceal-client-protocol/src/bounded-series.ts
2817
2945
  import { join } from "node:path";
2818
2946
  var CEAL_BOUNDED_SERIES_CATALOG = Object.freeze({
2819
- usage_record: (root) => join(root, "run-usage.jsonl"),
2820
- control_commit: (root) => join(root, "control-auto-commit.jsonl"),
2821
- engagement_signal: (root) => join(root, "runtime-state", "slack-feedback.jsonl"),
2822
- runtime_error: (root) => join(root, "runtime-state", "runtime-errors.jsonl"),
2823
- turn_bridge_request: (root) => join(root, ".ceal", "turn-bridge", "requests.jsonl"),
2824
- thread_run_events: (root) => join(root, "run-events.jsonl"),
2825
2947
  bounded_store_sidecar: (root) => `${root}.jsonl`,
2826
2948
  gateway_audit_archive: (root) => `${root}.jsonl`,
2827
2949
  gateway_access_group_connector_control_audit: (root) => `${root}.audit.jsonl`,
@@ -2855,146 +2977,8 @@ var CEAL_HOST_INSTALLATION_REF_PATTERN = new RegExp(`^host-installation:${CEAL_L
2855
2977
  var CEAL_HOST_SOURCE_REF_PATTERN = new RegExp(`^host-source:${CEAL_LOWERCASE_UUID_PATTERN}$`, "u");
2856
2978
  var CEAL_HOST_ACCESS_TOKEN_PATTERN = /^ceal_host_[A-Za-z0-9_-]{43}$/u;
2857
2979
 
2858
- // packages/ceal-client-protocol/src/agent-session-handoff.ts
2859
- var CEAL_AGENT_ADMISSION_PHASES = vocabulary([
2860
- "incumbent_admitted",
2861
- "incumbent_draining",
2862
- "drained",
2863
- "candidate_admitted",
2864
- "candidate_draining",
2865
- "rollback_admitted"
2866
- ]);
2867
- var CEAL_AGENT_SERVICE_SESSION_RECORD_KEYS = vocabulary([
2868
- "admission_fence",
2869
- "admission_state",
2870
- "admission_state_generation",
2871
- "bearer",
2872
- "consumer_ref",
2873
- "credential_generation",
2874
- "expires_at",
2875
- "gateway_instance",
2876
- "gateway_origin",
2877
- "gateway_serving_generation",
2878
- "issued_at",
2879
- "record_sha256",
2880
- "renew_after",
2881
- "renew_by",
2882
- "schema_version",
2883
- "session_revision"
2884
- ]);
2885
- var CEAL_AGENT_SESSION_COMMIT_KEYS = vocabulary(["attempt_ref", "expected_session_revision", "session_revision"]);
2886
-
2887
- // packages/ceal-client-protocol/src/operation-next-actions.ts
2888
- var CEAL_REPEAT_REQUEST_NEXT_ACTION = "repeat_request";
2889
- var CEAL_INSPECT_RECEIPT_NEXT_ACTION = "inspect_receipt";
2890
- var CALLER_RECOVERABLE_NEXT_ACTION_VALUES = [
2891
- "select_did_you_mean",
2892
- "choose_new_output_path",
2893
- "choose_new_idempotency_key",
2894
- "restart_search",
2895
- "repeat_original_arguments",
2896
- // The occurrence this call addressed is settled and cannot move again -- a
2897
- // denied effect approval, an expired continuation -- so the caller runs the
2898
- // same call again as a new request. The refusal names the re-request; this
2899
- // word is the re-request.
2900
- CEAL_REPEAT_REQUEST_NEXT_ACTION,
2901
- "choose_new_request_identity",
2902
- // A refusal that names the argument (invalid_argument with `property`) tells the caller exactly what to change.
2903
- "correct_argument",
2904
- // A resolver-owned input must move from caller operands into the declared
2905
- // resolver selection field.
2906
- "supply_resolver_selections",
2907
- // The graph names an upstream node whose Operation produces the resolver's
2908
- // occurrence, and it has not produced one yet. The caller runs that node
2909
- // first; the refusal used to share a code with a malformed resolver result,
2910
- // which is not fixable, so neither could carry a remedy.
2911
- "run_resolver_dependency",
2912
- // A replay carries the input the occurrence durably admitted, and this one
2913
- // carries a different one. The caller fixes it by presenting the original
2914
- // invocation, so it is a remedy; the coordinator minted the word at the
2915
- // replay guard and never declared it, which read as unguided to the scorer.
2916
- "use_original_input",
2917
- // The same mismatch on the Request binding rather than the input: the
2918
- // occurrence was admitted under one binding and the replay presents another.
2919
- "use_original_request_binding",
2920
- // The client's own filesystem write was refused -- EACCES, EPERM, or a
2921
- // read-only mount -- which is how an agent sandbox fences writes outside its
2922
- // workspace. The caller reruns the same command with unsandboxed or escalated
2923
- // execution; re-adopting the session cannot help, because the sandbox refuses
2924
- // that write too.
2925
- "rerun_outside_agent_sandbox",
2926
- // The refusal names the one Operation to read next in `describe_command`:
2927
- // an absent Operation id with a sole catalog-ranked candidate, or a known
2928
- // Operation invoked without its input. Describing only reads the verified
2929
- // contract and dispatches nothing, and the caller then retries with the
2930
- // named Operation or input, so it is guidance the scorer counts.
2931
- "describe_operation",
2932
- // The refusal names the caller's own personal connect Operation in
2933
- // `required_action_sequence`: the Operation asked for, or the credential
2934
- // the call ran on, needs a personal connection the caller does not hold
2935
- // (never connected, revoked, or expired). The caller runs that exact
2936
- // Operation, completes the consent it hands back, and retries the same call.
2937
- "connect_personal_account",
2938
- // The provider or Gateway named a bounded wait; the caller waits that long
2939
- // and submits the same read again.
2940
- "retry_after"
2941
- ];
2942
- var CEAL_CALLER_RECOVERABLE_NEXT_ACTIONS = Object.freeze(CALLER_RECOVERABLE_NEXT_ACTION_VALUES);
2943
- var NON_REMEDY_NEXT_ACTION_VALUES = [
2944
- // Only an administrator can take the named step -- approving a place for an
2945
- // Operation, granting a withheld capability -- so a non-administrator asks
2946
- // one. The refusal names the administrator step; this word is the ask.
2947
- "ask_admin",
2948
- "await_pending_approval",
2949
- "check_gateway",
2950
- "inspect_context_store",
2951
- "inspect_gateway",
2952
- "inspect_local_cache",
2953
- // The thin client prints these on its own behalf, before or after the wire.
2954
- // They were declared only as `CealClientLocalRemedy` keys and, for two of
2955
- // them, only as Go string literals -- a second and third vocabulary for one
2956
- // thing. `CealClientLocalRemedy` derives from this list now, so the client's
2957
- // remedies cannot drift from the words the protocol knows.
2958
- "inspect_local_client",
2959
- "inspect_local_command",
2960
- "inspect_local_output",
2961
- "inspect_local_route",
2962
- CEAL_INSPECT_RECEIPT_NEXT_ACTION,
2963
- "inspect_request",
2964
- "none",
2965
- // The provider refused because of its own configuration -- an API not
2966
- // enabled, an app scope missing -- which an operator changes in that
2967
- // provider's console. No caller edit and no retry fixes it.
2968
- "operator_action",
2969
- "recover",
2970
- "reconcile",
2971
- // Reconciliation of one named occurrence, not of the deployment: an
2972
- // occurrence with no admitted input commitment cannot be replayed safely and
2973
- // no edit to the call changes that. `reconcile` is the deployment-wide word.
2974
- "reconcile_occurrence",
2975
- "reduce_request_size",
2976
- // The Host's invocation context for this turn is stale or expired at the
2977
- // Gateway. The Host's next turn rebinds it and the same call then succeeds;
2978
- // nothing in the call changes, so it is not a remedy the scorer may count.
2979
- "refresh_host_invocation_context",
2980
- "repair_or_adopt_session",
2981
- "retry",
2982
- // The owner -- a correlation hook, an approval hook -- is not serving right
2983
- // now. The caller changes nothing and the same call succeeds once the owner
2984
- // is back, so this is not a remedy the scorer may count as guidance.
2985
- "retry_after_owner_recovery",
2986
- "retry_same_receipt_read",
2987
- "run_file_search_again",
2988
- "select_exact_approval"
2989
- ];
2990
- var CEAL_NON_REMEDY_NEXT_ACTIONS = Object.freeze(NON_REMEDY_NEXT_ACTION_VALUES);
2991
- var DECLARED = /* @__PURE__ */ new Set([...CEAL_CALLER_RECOVERABLE_NEXT_ACTIONS, ...CEAL_NON_REMEDY_NEXT_ACTIONS]);
2992
- var RECOVERABLE = new Set(CEAL_CALLER_RECOVERABLE_NEXT_ACTIONS);
2993
- var CEAL_OPERATION_WITHHELD_NEXT_ACTIONS = Object.freeze({
2994
- provider_permission: "ask_admin",
2995
- access_level: "ask_admin",
2996
- personal_authorization_required: "connect_personal_account"
2997
- });
2980
+ // packages/ceal-client-protocol/src/operation-result-completeness.ts
2981
+ var CEAL_READ_VALUE_CONTINUATION_KEYS = vocabulary(["continuation", "continuation_ref", "next_cursor"]);
2998
2982
 
2999
2983
  // packages/ceal-client-protocol/src/operation-contract-artifact.ts
3000
2984
  var CATALOG_REVISION = new RegExp(CEAL_VERIFIED_ARTIFACT_CATALOG_REVISION_PATTERN, "u");
@@ -3003,7 +2987,9 @@ var CEAL_OPERATION_INVOKE_COMMAND = "invoke";
3003
2987
  var CEAL_OPERATION_INPUT_FLAG = "--input";
3004
2988
  var CEAL_OPERATION_ID_PLACEHOLDER = "<operation-id>";
3005
2989
  var CEAL_OPERATION_INPUT_PLACEHOLDER = "<json-object>";
3006
- var CEAL_MODEL_INVOCATION_ARGUMENTS = [CEAL_OPERATION_INVOKE_COMMAND, CEAL_OPERATION_ID_PLACEHOLDER, CEAL_OPERATION_INPUT_FLAG, shellSingleQuoted(CEAL_OPERATION_INPUT_PLACEHOLDER)].join(" ");
2990
+ var MODEL_INVOCATION_BASE_ARGUMENTS = [CEAL_OPERATION_INVOKE_COMMAND, CEAL_OPERATION_ID_PLACEHOLDER].join(" ");
2991
+ var CEAL_MODEL_INVOCATION_ARGUMENTS = [MODEL_INVOCATION_BASE_ARGUMENTS, CEAL_OPERATION_INPUT_FLAG, shellSingleQuoted(CEAL_OPERATION_INPUT_PLACEHOLDER)].join(" ");
2992
+ 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.`;
3007
2993
  function shellSingleQuoted(value) {
3008
2994
  return `'${value.replaceAll("'", "'\\''")}'`;
3009
2995
  }
@@ -3035,79 +3021,7 @@ var CEAL_VERIFIED_ARTIFACT_DESCRIPTOR_JSON_SCHEMA = Object.freeze({
3035
3021
  }
3036
3022
  });
3037
3023
 
3038
- // packages/ceal-client-protocol/src/bare-document.ts
3039
- var REQUIRED_FIELDS = CEAL_CLIENT_WIRE_CONTRACT.command_response.bare_document_fields;
3040
- var OPTIONAL_FIELDS = CEAL_CLIENT_WIRE_CONTRACT.command_response.bare_document_optional_fields;
3041
-
3042
- // packages/ceal-client-protocol/src/runtime-executable-paths.ts
3043
- var CEAL_SYSTEMCTL_EXECUTABLE_PATH = "/usr/bin/systemctl";
3044
-
3045
- // packages/ceal-client-protocol/src/leased-consumer-vocabulary.ts
3046
- var CEAL_TERMINAL_DISPOSITIONS = vocabulary(["completed", "failed", "cancelled"]);
3047
- var CEAL_LEASE_DISPOSITIONS = vocabulary([...CEAL_TERMINAL_DISPOSITIONS, "deferred"]);
3048
- var CEAL_AUTOMATIC_FEEDBACK_INTENTS = vocabulary(["initial"]);
3049
- var CEAL_LEASED_MESSAGE_DELIVERY_OPERATION_IDS = vocabulary(["message.send", "message.update", "message.delete"]);
3050
- var CEAL_REPOSITORY_VISIBILITIES = vocabulary(["public", "private", "internal"]);
3051
- var CEAL_RESULT_DELIVERY_OFFERS = vocabulary(["pending", "offered", "transport_lost"]);
3052
- var CEAL_RESULT_DELIVERY_STATES = vocabulary(["unavailable", ...CEAL_RESULT_DELIVERY_OFFERS]);
3053
- var CEAL_PROVIDER_OUTCOMES = vocabulary(["not_attempted", "outcome_unknown", "verified"]);
3054
- var CEAL_ACTIVITY_GAP_CODES = vocabulary([
3055
- "provider_page_budget",
3056
- "call_deadline",
3057
- "related_item_budget",
3058
- "provider_cursor_unavailable",
3059
- "malformed_provider_page",
3060
- "visibility_incomplete",
3061
- "unsupported_event_kind"
3062
- ]);
3063
- var CEAL_ACTIVITY_CONNECTOR_KINDS = vocabulary(["slack", "github", "google-calendar", "google-drive", "notion"]);
3064
- var CEAL_ACTIVITY_COVERAGE_STATUSES = vocabulary(["complete_for_target", "continuation_required", "blocked"]);
3065
- var CEAL_ACTIVITY_EVENT_KINDS = vocabulary([
3066
- "slack.message",
3067
- "slack.reply",
3068
- "slack.direct_message",
3069
- "github.commit.authored",
3070
- "github.issue.opened",
3071
- "github.pull_request.opened",
3072
- "github.review.submitted",
3073
- "github.issue_comment.created",
3074
- "github.review_comment.created",
3075
- "calendar.organized",
3076
- "calendar.accepted_invite",
3077
- "calendar.recorded",
3078
- "drive.file.created",
3079
- "drive.file.modified",
3080
- "drive.file.viewed",
3081
- "notion.page.created",
3082
- "notion.page.edited"
3083
- ]);
3084
- var CEAL_ACTIVITY_TIMESTAMP_BASES = vocabulary([
3085
- "message_created",
3086
- "commit_authored",
3087
- "resource_created",
3088
- "review_submitted",
3089
- "comment_created",
3090
- "event_start",
3091
- "all_day_start",
3092
- "file_created",
3093
- "file_modified",
3094
- "file_modified_by_me",
3095
- "file_viewed_by_me",
3096
- "page_created",
3097
- "page_last_edited",
3098
- "resource_modified"
3099
- ]);
3100
- var CEAL_ACTIVITY_V3_KINDS = vocabulary(["authored", "edited", "messaged", "responded"]);
3101
- var CEAL_RESOURCE_TIME_BASES = vocabulary(["created", "modified", "viewed"]);
3102
- var CEAL_RESOURCE_SEARCH_ORDERS = vocabulary(["relevance", "modified", "viewed", "created"]);
3103
- var CEAL_RESOURCE_SEARCH_DIRECTIONS = vocabulary(["ascending", "descending"]);
3104
- 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"]);
3105
- var CEAL_ARTIFACT_STAGE_TERMINALS = vocabulary(["chunk_accepted", "artifact_ready", "idempotency_replayed"]);
3106
- var CEAL_READ_ITEM_KINDS = vocabulary(["conversation", "identity", "usergroup", "message", "file", "document"]);
3107
- var CEAL_LEASED_MESSAGE_SEARCH_COMPLETENESS = vocabulary(["complete", "continuation_available", "truncated"]);
3108
- var CEAL_OPAQUE_HANDLE_KINDS = vocabulary(["target", "message", "thread", "artifact", "document", "object"]);
3109
- var CEAL_WRITE_OBJECT_KINDS = vocabulary(["document", "comment", "cell_range"]);
3110
- var CEAL_CONVERSATION_KINDS = vocabulary(["channel", "dm", "group"]);
3024
+ // packages/ceal-client-protocol/src/provider-operation-vocabulary.ts
3111
3025
  var CEAL_FILE_TYPE_FAMILIES = vocabulary(["all", "image", "pdf"]);
3112
3026
  var CEAL_GITHUB_ISSUE_STATES = vocabulary(["open", "closed", "all"]);
3113
3027
  var CEAL_NOTION_UPDATABLE_BLOCK_TYPES = vocabulary([
@@ -3141,12 +3055,95 @@ var CEAL_NOTION_IDENTITY_GAP_REASONS = vocabulary([
3141
3055
  "identity_unlinked"
3142
3056
  ]);
3143
3057
  var CEAL_NOTION_STRING_VALUE_TYPES = vocabulary(["text", "select", "url", "email", "phone"]);
3144
- var CEAL_UNREAD_REASONS = vocabulary(["blocked", "unavailable", "too_large", "unsupported", "download_failed", "permission_denied"]);
3145
- var CEAL_PLAN_ITEM_STATUSES = vocabulary(["pending", "active", "completed"]);
3146
- var CEAL_FINAL_PRESENTATION_INTENTS = vocabulary(["final", "stop", "transient_notice"]);
3147
- var CEAL_PRESENTATION_INTENTS = vocabulary(["progress", ...CEAL_FINAL_PRESENTATION_INTENTS]);
3058
+
3059
+ // packages/ceal-client-protocol/src/opaque-reference.ts
3060
+ var CEAL_OPAQUE_HANDLE_KINDS = vocabulary(["target", "message", "thread", "artifact", "document", "block", "object"]);
3061
+ var CEAL_OPAQUE_REF_KINDS = vocabulary([...CEAL_OPAQUE_HANDLE_KINDS, "result", "operation-receipt", "reply-receipt", "field", "notion-data-source"]);
3062
+
3063
+ // packages/ceal-client-protocol/src/bare-document.ts
3064
+ var REQUIRED_FIELDS = CEAL_CLIENT_WIRE_CONTRACT.command_response.bare_document_fields;
3065
+ var OPTIONAL_FIELDS = CEAL_CLIENT_WIRE_CONTRACT.command_response.bare_document_optional_fields;
3066
+
3067
+ // packages/ceal-client-protocol/src/runtime-executable-paths.ts
3068
+ var CEAL_SYSTEMCTL_EXECUTABLE_PATH = "/usr/bin/systemctl";
3148
3069
 
3149
3070
  // packages/ceal-client-protocol/src/resource-row.ts
3071
+ var CEAL_RESOURCE_SEARCH_ORDERS = vocabulary(["relevance", "modified", "viewed", "created"]);
3072
+ var CEAL_RESOURCE_SEARCH_DIRECTIONS = vocabulary(["ascending", "descending"]);
3073
+ 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"]);
3074
+ var CEAL_RESOURCE_TIME_BASES = vocabulary(["created", "modified", "viewed"]);
3075
+ var CEAL_REPOSITORY_VISIBILITIES = vocabulary(["public", "private", "internal"]);
3076
+ var CEAL_ACTIVITY_V3_KINDS = vocabulary(["authored", "edited", "messaged", "responded"]);
3077
+ var CEAL_ACTIVITY_TIMESTAMP_BASES = vocabulary([
3078
+ "message_created",
3079
+ "commit_authored",
3080
+ "resource_created",
3081
+ "review_submitted",
3082
+ "comment_created",
3083
+ "event_start",
3084
+ "all_day_start",
3085
+ "file_created",
3086
+ "file_modified",
3087
+ "file_modified_by_me",
3088
+ "file_viewed_by_me",
3089
+ "page_created",
3090
+ "page_last_edited",
3091
+ "resource_modified"
3092
+ ]);
3093
+ var CEAL_ACTIVITY_CONNECTOR_KINDS = vocabulary(["slack", "github", "google-calendar", "google-drive", "notion"]);
3094
+ var CEAL_ACTIVITY_GAP_CODES = vocabulary([
3095
+ "provider_page_budget",
3096
+ "call_deadline",
3097
+ "related_item_budget",
3098
+ "provider_cursor_unavailable",
3099
+ "malformed_provider_page",
3100
+ "visibility_incomplete",
3101
+ "unsupported_event_kind",
3102
+ "direct_messages_excluded"
3103
+ ]);
3104
+ var CEAL_ACTIVITY_EVENT_KINDS = vocabulary([
3105
+ "slack.message",
3106
+ "slack.reply",
3107
+ "slack.direct_message",
3108
+ "github.commit.authored",
3109
+ "github.issue.opened",
3110
+ "github.pull_request.opened",
3111
+ "github.issue.edited",
3112
+ "github.pull_request.edited",
3113
+ "github.review.submitted",
3114
+ "github.issue_comment.created",
3115
+ "github.review_comment.created",
3116
+ "calendar.organized",
3117
+ "calendar.accepted_invite",
3118
+ "calendar.recorded",
3119
+ "drive.file.created",
3120
+ "drive.file.modified",
3121
+ "drive.file.viewed",
3122
+ "notion.page.created",
3123
+ "notion.page.edited"
3124
+ ]);
3125
+ var CEAL_ACTIVITY_EVENT_TIMESTAMP_BASIS_MAP = Object.freeze({
3126
+ "slack.message": "message_created",
3127
+ "slack.reply": "message_created",
3128
+ "slack.direct_message": "message_created",
3129
+ "github.commit.authored": "commit_authored",
3130
+ "github.review.submitted": "review_submitted",
3131
+ "github.issue_comment.created": "comment_created",
3132
+ "github.review_comment.created": "comment_created",
3133
+ "github.issue.opened": "resource_created",
3134
+ "github.pull_request.opened": "resource_created",
3135
+ "github.issue.edited": "resource_modified",
3136
+ "github.pull_request.edited": "resource_modified",
3137
+ "calendar.organized": "resource_created",
3138
+ "drive.file.created": "file_created",
3139
+ "drive.file.modified": "file_modified_by_me",
3140
+ "drive.file.viewed": "file_viewed_by_me",
3141
+ "notion.page.created": "page_created",
3142
+ "notion.page.edited": "page_last_edited"
3143
+ });
3144
+ var CEAL_DATED_NOTE_BASES = vocabulary(["recording", "calendar_event", "created_time"]);
3145
+ var CEAL_DATED_NOTE_TRANSCRIPT_STATES = vocabulary(["present", "absent", "unestablished"]);
3146
+ var CEAL_READ_SEARCH_COST_CLASSES = vocabulary(["native_index", "scan"]);
3150
3147
  var RESOURCE_ROW_KEY_RULES = Object.freeze({
3151
3148
  schema_version: { required: true, timestamp: false },
3152
3149
  ref: { required: true, timestamp: false },
@@ -3159,6 +3156,7 @@ var RESOURCE_ROW_KEY_RULES = Object.freeze({
3159
3156
  source: { required: true, timestamp: false },
3160
3157
  owner: { required: false, timestamp: false },
3161
3158
  counterparts: { required: false, timestamp: false },
3159
+ attachments: { required: false, timestamp: false },
3162
3160
  created_at: { required: false, timestamp: true },
3163
3161
  created_at_local: { required: false, timestamp: true },
3164
3162
  modified_at: { required: false, timestamp: true },
@@ -3169,6 +3167,7 @@ var RESOURCE_ROW_KEY_RULES = Object.freeze({
3169
3167
  end: { required: false, timestamp: false },
3170
3168
  status: { required: false, timestamp: false },
3171
3169
  snippet: { required: false, timestamp: false },
3170
+ dated_notes: { required: false, timestamp: false },
3172
3171
  state: { required: true, timestamp: false },
3173
3172
  timestamp_basis: { required: true, timestamp: false }
3174
3173
  });
@@ -3205,16 +3204,26 @@ var CEAL_WRITE_SAFETY_UNCHECKED_REASONS = vocabulary(["authority_unavailable"]);
3205
3204
  // packages/ceal-client-protocol/src/operation-occurrence.ts
3206
3205
  var MAX_RECEIPT_REVISION = Number.MAX_SAFE_INTEGER - 1;
3207
3206
 
3208
- // packages/ceal-client-protocol/src/leased-artifact-contract.ts
3209
- var CEAL_LEASED_CONSUMER_ARTIFACT_CHUNK_MAX_BYTES = 12 * 1024;
3210
-
3211
- // packages/ceal-client-protocol/src/leased-resource-stream.ts
3212
- var CEAL_LEASED_CONSUMER_ATTACHMENT_STREAM_MAGIC = new Uint8Array([67, 69, 65, 76, 82, 83, 50, 0]);
3213
- var CEAL_LEASED_CONSUMER_ATTACHMENT_STREAM_RECORD_PREFIX_BYTES = 8;
3214
- var CEAL_LEASED_CONSUMER_ATTACHMENT_STREAM_MAX_HEADER_BYTES = 16 * 1024;
3215
- var CEAL_LEASED_CONSUMER_ATTACHMENT_STREAM_CHUNK_BYTES = 64 * 1024;
3216
- 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;
3217
- var CEAL_ATTACHMENT_UNREAD_REASONS = vocabulary(["blocked", "unavailable", "too_large", "unsupported", "download_failed", "digest_mismatch"]);
3207
+ // packages/ceal-client-protocol/src/personal-client-vocabulary.ts
3208
+ var CEAL_PERSONAL_CLIENT_BINDING_KEYS = vocabulary([
3209
+ "access_group_ref",
3210
+ "membership_ref",
3211
+ "registration_ref",
3212
+ "client_ref",
3213
+ "subject_ref",
3214
+ "instance_ref"
3215
+ ]);
3216
+ var CEAL_ENROLLMENT_FAILURE_CODES = vocabulary(["enrollment_invalid", "enrollment_expired", "enrollment_used"]);
3217
+ var CEAL_REFRESH_FAILURE_CODES = vocabulary([
3218
+ "refresh_invalid",
3219
+ "refresh_expired",
3220
+ "refresh_inactive",
3221
+ "refresh_replayed",
3222
+ "refresh_revoked",
3223
+ "authority_replaced",
3224
+ "refresh_recovery_unavailable",
3225
+ "refresh_recovery_expired"
3226
+ ]);
3218
3227
 
3219
3228
  // packages/ceal-client-protocol/src/request-validation-primitives.ts
3220
3229
  import { createHash as createHash2 } from "node:crypto";
@@ -3300,7 +3309,7 @@ var CEAL_REQUEST_MAX_GRAPH_NODES = 128;
3300
3309
 
3301
3310
  // packages/ceal-client-protocol/src/request-run.ts
3302
3311
  var CEAL_REQUEST_NODE_STANDING_OCCURRENCE_SCHEMA_VERSION = "ceal.request_node_standing_occurrence.v1";
3303
- var CEAL_REQUEST_RUN_BATCH_SCHEMA_VERSION = "ceal.request_run_batch.v3";
3312
+ var CEAL_REQUEST_RUN_BATCH_SCHEMA_VERSION = "ceal.request_run_batch.v1";
3304
3313
  var REQUEST_ACTION_SAFE_REF_SCHEMA = { type: "string", minLength: 1, maxLength: 128, pattern: SAFE_REF.source };
3305
3314
  var REQUEST_ACTION_DIGEST_SCHEMA = { type: "string", minLength: 64, maxLength: 64, pattern: "^[a-f0-9]{64}$" };
3306
3315
  var REQUEST_NODE_STANDING_OCCURRENCE_SCHEMA = {
@@ -3383,6 +3392,10 @@ var CEAL_REQUEST_RUN_BATCH_JSON_SCHEMA = {
3383
3392
 
3384
3393
  // packages/ceal-client-protocol/src/host-observation.ts
3385
3394
  var CEAL_LOCAL_HOST_CAPABILITIES_SCHEMA_VERSION = "ceal.local_host_capabilities.v7";
3395
+ var CEAL_HOST_INPUT_KINDS = vocabulary(["human", "host_automatic"]);
3396
+ function isCealHostInputKind(value) {
3397
+ return typeof value === "string" && CEAL_HOST_INPUT_KINDS.some((kind) => kind === value);
3398
+ }
3386
3399
  var CEAL_HOST_OBSERVATION_REF_PREFIX = "host-observation:";
3387
3400
  var HOST_OBSERVATION_PRODUCER = /^[a-z][a-z0-9]{0,31}$/u;
3388
3401
  var HOST_OBSERVATION_DIGEST = /^[a-f0-9]{8,64}$/u;
@@ -3445,12 +3458,6 @@ var OWNER_WRITE_STATES = Object.freeze(["attempt_started", "provider_acknowledge
3445
3458
  var OWNER_EFFECT_STATES = Object.freeze(["none", "applied", "failed", "unknown", "reconciled"]);
3446
3459
  var OWNER_RECEIPT_STATES = Object.freeze(["pending", "available", "failed", "unknown", "reconciled"]);
3447
3460
 
3448
- // packages/ceal-client-protocol/src/thread-excerpt.ts
3449
- var CEAL_THREAD_RECENT_WINDOW = 6;
3450
- var CEAL_THREAD_LAST_APP_MESSAGES_WINDOW = 3;
3451
- var CEAL_THREAD_OLDER_SUMMARY_WINDOW = 4;
3452
- var CEAL_FED_THREAD_MESSAGE_LIMIT = CEAL_THREAD_RECENT_WINDOW + CEAL_THREAD_OLDER_SUMMARY_WINDOW + CEAL_THREAD_LAST_APP_MESSAGES_WINDOW;
3453
-
3454
3461
  // packages/ceal-client-protocol/src/request-graph-readiness.ts
3455
3462
  var REQUEST_GRAPH_PRODUCER_TO_APPEND_SCHEMA = {
3456
3463
  type: "object",
@@ -3540,27 +3547,15 @@ var CEAL_HOST_INVOCATION_AUTHENTICATION_RESULT_MAX_BYTES = new TextEncoder().enc
3540
3547
  `).byteLength;
3541
3548
 
3542
3549
  // packages/ceal-client-protocol/src/client-result-materialization.ts
3550
+ var CEAL_UNREAD_REASONS = vocabulary(["blocked", "unavailable", "too_large", "unsupported", "download_failed", "permission_denied"]);
3543
3551
  var CEAL_MODEL_VISIBLE_COMMAND_OUTPUT_MAX_BYTES = 32 * 1024;
3544
- var REQUIRED_FIELDS2 = Object.freeze(["schema_version", "operation_id", "read_argv"]);
3545
- var FIELDS = /* @__PURE__ */ new Set([...REQUIRED_FIELDS2, "local_result_root", "continue_argv"]);
3552
+ var REQUIRED_FIELDS2 = Object.freeze(["schema_version", "operation_id"]);
3553
+ var FIELDS = /* @__PURE__ */ new Set([...REQUIRED_FIELDS2, "read_argv", "local_result_root", "continue_argv", "model_disclosure", "item_read_argv"]);
3546
3554
 
3547
3555
  // packages/ceal-client-protocol/src/session-start-affordance.ts
3548
3556
  var CEAL_SESSION_ENTRY_INVOCATION = "ceal";
3549
- 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.`;
3550
3557
  var HOST_HOOK_TIMEOUT_SECONDS = 1;
3551
3558
 
3552
- // packages/ceal-client-protocol/src/conversation-contracts.ts
3553
- var CEAL_APPROVAL_POLICY_KINDS = vocabulary(["requester_only", "named_users", "role_based"]);
3554
- var CEAL_APPROVAL_TARGET_KINDS = vocabulary([
3555
- "repo_change",
3556
- "investigation",
3557
- "skill_creation",
3558
- "command_creation",
3559
- "connector_creation",
3560
- "generic"
3561
- ]);
3562
- var CEAL_PROGRESS_PHASES = vocabulary(["request_review", "information_gathering", "work_execution", "result_check"]);
3563
-
3564
3559
  // packages/ceal-client-protocol/src/gateway-cache-origin-validation.ts
3565
3560
  var CEAL_MAX_CACHE_ORIGIN_AGE_MS = 30 * 24 * 60 * 60 * 1e3;
3566
3561
 
@@ -3643,27 +3638,6 @@ var ADMIN_LINEAGE_NODE_KINDS = vocabulary(["source_read", "synthesis_preview", "
3643
3638
  // packages/ceal-client-protocol/src/actor-kind.ts
3644
3639
  var CEAL_ACTOR_KINDS = vocabulary(["human", "bot", "app", "unknown"]);
3645
3640
 
3646
- // packages/ceal-client-protocol/src/personal-client-vocabulary.ts
3647
- var CEAL_PERSONAL_CLIENT_BINDING_KEYS = vocabulary([
3648
- "access_group_ref",
3649
- "membership_ref",
3650
- "registration_ref",
3651
- "client_ref",
3652
- "subject_ref",
3653
- "instance_ref"
3654
- ]);
3655
- var CEAL_ENROLLMENT_FAILURE_CODES = vocabulary(["enrollment_invalid", "enrollment_expired", "enrollment_used"]);
3656
- var CEAL_REFRESH_FAILURE_CODES = vocabulary([
3657
- "refresh_invalid",
3658
- "refresh_expired",
3659
- "refresh_inactive",
3660
- "refresh_replayed",
3661
- "refresh_revoked",
3662
- "authority_replaced",
3663
- "refresh_recovery_unavailable",
3664
- "refresh_recovery_expired"
3665
- ]);
3666
-
3667
3641
  // packages/ceal-client-protocol/src/device-enrollment.ts
3668
3642
  var CEAL_DEVICE_ENROLLMENT_POLL_FAILURE_CODES = Object.freeze(["unsupported_feature", "recovery_required", "expired", "denied"]);
3669
3643
  var POLL_RESULT_KEYS = Object.freeze(["retry_after_ms", "schema_version", "status"]);
@@ -3830,13 +3804,13 @@ function validTurn(value) {
3830
3804
  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);
3831
3805
  }
3832
3806
  function validInput(value) {
3833
- 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);
3807
+ 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);
3834
3808
  }
3835
3809
  function validInputObservations(value) {
3836
3810
  return validObservations(value) && Array.isArray(value) && value.filter((item) => record(item) && item.observation_kind === "prompt").length === 1;
3837
3811
  }
3838
3812
  function validInputOptionals(value) {
3839
- return validDecision(value.decision) && optionalRefs(value.local_turn_aliases) && (value.context_expires_at === void 0 || timestamp(value.context_expires_at));
3813
+ return optionalRefs(value.local_turn_aliases) && (value.context_expires_at === void 0 || timestamp(value.context_expires_at));
3840
3814
  }
3841
3815
  function validTerminal(value) {
3842
3816
  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);
@@ -3847,9 +3821,6 @@ function validTerminalDisposition(state, reason) {
3847
3821
  function validStatus(value) {
3848
3822
  return exactOptional(value, ["status", "reason_code"], ["detail"]) && ["ready", "degraded", "stopping"].includes(String(value.status)) && safeRef(value.reason_code) && optionalText(value.detail, 4096);
3849
3823
  }
3850
- function validDecision(value) {
3851
- return value === void 0 || record(value) && exactKeys(value, ["decision", "approval_ref"]) && (value.decision === "approved" || value.decision === "denied") && safeRef(value.approval_ref);
3852
- }
3853
3824
  function optionalText(value, maxLength) {
3854
3825
  return value === void 0 || typeof value === "string" && value.length > 0 && value.length <= maxLength;
3855
3826
  }
@@ -5050,10 +5021,6 @@ var CodexOutboxStore = class {
5050
5021
  await removeOwnerState(this.registrationPath(registration.host_source_ref, registration.host_session_ref), "registration");
5051
5022
  await removeOwnerState(this.cursorPath(registration.host_source_ref, registration.host_session_ref), "cursor");
5052
5023
  }
5053
- async relayWakeDirectories() {
5054
- await this.prepare();
5055
- return { entries: this.entriesDirectory, registrations: this.registrationsDirectory };
5056
- }
5057
5024
  async listTranscriptRegistrations() {
5058
5025
  await this.prepare();
5059
5026
  const registrations = [];
@@ -5243,7 +5210,7 @@ async function readPrivateFile(path) {
5243
5210
  }
5244
5211
  function validateEnvelope(value) {
5245
5212
  if (!isRecord3(value)) throw storageError("Codex outbox entry is malformed.");
5246
- 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")}).`);
5213
+ 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")}).`);
5247
5214
  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}`)}).`);
5248
5215
  validateIdentity4(value.identity);
5249
5216
  validateEnvelopeReferences(value);
@@ -5252,6 +5219,7 @@ function validateEnvelope(value) {
5252
5219
  }
5253
5220
  function validateEnvelopeReferences(value) {
5254
5221
  if (!SAFE_REF6.test(String(value.host_input_ref))) throw storageError("Codex outbox input reference is malformed.");
5222
+ if (!isCealHostInputKind(value.input_kind)) throw storageError("Codex outbox input provenance is malformed.");
5255
5223
  if (!SAFE_REF6.test(String(value.prompt_ref))) throw storageError("Codex outbox references are malformed.");
5256
5224
  if (!SAFE_REF6.test(String(value.submission_ref))) throw storageError("Codex outbox references are malformed.");
5257
5225
  if (value.request_ref !== void 0 && !SAFE_REF6.test(String(value.request_ref))) throw storageError("Codex outbox Request reference is malformed.");
@@ -5491,6 +5459,7 @@ var CodexProducer = class {
5491
5459
  local_session_ref: envelope.identity.host_session_ref,
5492
5460
  local_turn_ref: localTurnRef(envelope),
5493
5461
  local_input_ref: envelope.host_input_ref,
5462
+ input_kind: envelope.input_kind,
5494
5463
  origin_input: envelope.origin_input,
5495
5464
  observations: [prompt],
5496
5465
  local_turn_aliases: envelope.codex_turn_id === void 0 ? void 0 : [envelope.codex_turn_id],
@@ -5738,18 +5707,24 @@ function decodeTokenUsage(value) {
5738
5707
  function decodeResponseItem(payload, ordinal, timestamp7) {
5739
5708
  if (payload.type !== "message" || payload.role !== "user") return { kind: "ignored", ordinal, timestamp: timestamp7 };
5740
5709
  const metadata = userMessageMetadata(payload.internal_chat_message_metadata_passthrough);
5741
- const kinds = metadata.content_item_kinds;
5742
- if (kinds.length !== 1 || kinds[0] !== "user.text") return { kind: "ignored", ordinal, timestamp: timestamp7 };
5710
+ const inputKind = inputKindFromContentItems(metadata.content_item_kinds);
5711
+ if (inputKind === void 0) return { kind: "ignored", ordinal, timestamp: timestamp7 };
5743
5712
  const prompt = userTextContent(payload.content);
5744
5713
  return {
5745
5714
  kind: "user_text",
5746
5715
  ordinal,
5747
5716
  timestamp: timestamp7,
5748
5717
  prompt,
5718
+ input_kind: inputKind,
5749
5719
  message_id: safeRef5(payload.id, "Codex user message identity is invalid."),
5750
5720
  turn_id: safeRef5(metadata.turn_id, "Codex user message task identity is invalid.")
5751
5721
  };
5752
5722
  }
5723
+ function inputKindFromContentItems(kinds) {
5724
+ if (kinds.length !== 1) return void 0;
5725
+ if (kinds[0] === "user.text") return "human";
5726
+ return kinds[0] === "goal.internal_context" ? "host_automatic" : void 0;
5727
+ }
5753
5728
  function userMessageMetadata(value) {
5754
5729
  if (!isRecord5(value) || !Array.isArray(value.content_item_kinds)) reject("Codex user message provenance is malformed.");
5755
5730
  return { ...value, content_item_kinds: value.content_item_kinds };
@@ -6334,6 +6309,7 @@ var CodexTranscriptWatcher = class {
6334
6309
  schema_version: "ceal.codex_observation_outbox.v1",
6335
6310
  identity,
6336
6311
  host_input_ref: hostInputRef,
6312
+ input_kind: record8.input_kind,
6337
6313
  prompt_ref: promptRef,
6338
6314
  observations,
6339
6315
  codex_turn_id: record8.turn_id,
@@ -6360,6 +6336,7 @@ var CodexTranscriptWatcher = class {
6360
6336
  schema_version: "ceal.codex_observation_outbox.v1",
6361
6337
  identity,
6362
6338
  host_input_ref: activeTask.origin_host_input_ref,
6339
+ input_kind: "host_automatic",
6363
6340
  prompt_ref: activeTask.prompt_ref,
6364
6341
  observations,
6365
6342
  codex_turn_id: record8.turn_id,
@@ -6766,9 +6743,9 @@ function hookDriftRemedy(reasons) {
6766
6743
  }
6767
6744
 
6768
6745
  // host/host-entry-links.ts
6769
- import { lstat as lstat7, mkdir as mkdir6, readlink, rename as rename5, rm as rm2, symlink } from "node:fs/promises";
6746
+ import { lstat as lstat7, mkdir as mkdir6, readlink, realpath, rename as rename5, rm as rm2, stat, symlink } from "node:fs/promises";
6770
6747
  import { homedir } from "node:os";
6771
- import { basename, dirname as dirname5, isAbsolute as isAbsolute2, join as join7 } from "node:path";
6748
+ import { basename, dirname as dirname5, isAbsolute as isAbsolute2, join as join7, normalize, parse } from "node:path";
6772
6749
  var HOST_ENTRY_RUNTIME_LINK = "runtime";
6773
6750
  var HOST_ENTRY_SERVICES_LINK = "services";
6774
6751
  var HOST_ENTRY_DIRECTORY = [".ceal", "host-entry"];
@@ -7327,9 +7304,7 @@ function validateOptionalInstallerPaths(options) {
7327
7304
  }
7328
7305
  var CODEX_LOCAL_CAPABILITY_OWNER = CODEX_HOOK_OWNER;
7329
7306
  function resolveCodexLocalCapabilityPath(configPath) {
7330
- const configDirectory = dirname7(configPath);
7331
- const userRoot = basename2(configDirectory) === ".codex" ? dirname7(configDirectory) : configDirectory;
7332
- return join10(userRoot, ".ceal", "local-capabilities", "codex.json");
7307
+ return join10(resolveHostEntryRoot(dirname7(configPath), ".codex"), "..", "local-capabilities", "codex.json");
7333
7308
  }
7334
7309
  function resolveLocalCapabilityInstallation(options, configPath) {
7335
7310
  return { authenticationCommand: { executable: options.invocation_authentication_executable ?? resolveRepoCodexInvocationAuthenticationExecutable(), args: options.invocation_authentication_arguments ?? [] }, localCapabilityPath: options.local_capability_path ?? resolveCodexLocalCapabilityPath(configPath) };
@@ -7756,8 +7731,8 @@ function hostBundleComponentsForProducers(producers) {
7756
7731
  // host/lifecycle/src/host-runtime-control.ts
7757
7732
  import { Buffer as Buffer2 } from "node:buffer";
7758
7733
  import { join as join11 } from "node:path";
7759
- var HOST_RUNTIME_CONTROL_REQUEST_SCHEMA = "ceal.host_runtime_control_request.v3";
7760
- var HOST_RUNTIME_CONTROL_RESULT_SCHEMA = "ceal.host_runtime_control_result.v3";
7734
+ var HOST_RUNTIME_CONTROL_REQUEST_SCHEMA = "ceal.host_runtime_control_request.v1";
7735
+ var HOST_RUNTIME_CONTROL_RESULT_SCHEMA = "ceal.host_runtime_control_result.v1";
7761
7736
  var HOST_RUNTIME_CONTROL_MAX_INPUT_BYTES = 64 * 1024;
7762
7737
  var HOST_RUNTIME_CONTROL_MAX_OUTPUT_BYTES = 16 * 1024;
7763
7738
  var CANDIDATE_REF = /^[a-f0-9]{64}$/u;
@@ -8147,7 +8122,7 @@ import { createHash as createHash9 } from "node:crypto";
8147
8122
 
8148
8123
  // host/service-log.ts
8149
8124
  import { constants as constants3 } from "node:fs";
8150
- import { copyFile as copyFile3, open as open10, stat, truncate } from "node:fs/promises";
8125
+ import { copyFile as copyFile3, open as open10, stat as stat2, truncate } from "node:fs/promises";
8151
8126
  var HOST_SERVICE_LOG_ENVIRONMENT = "CEAL_HOST_SERVICE_LOG";
8152
8127
  var HOST_SERVICE_LOG_MAX_BYTES = 1024 * 1024;
8153
8128
  function hostServiceLogPreviousPath(path) {
@@ -8902,11 +8877,10 @@ function createLinuxUserSystemdAdapter(options) {
8902
8877
  const previousByComponent = serviceMap(previous);
8903
8878
  const targetByComponent = serviceMap(target);
8904
8879
  await ensurePrivateUnitDirectory(unitDirectory);
8905
- const ownedUnits = await ownedHostUnits(unitDirectory);
8880
+ const removableUnits = await ownedHostUnits(unitDirectory, identity);
8906
8881
  for (const service of target.services) await replaceOwnedUnit(unitDirectory, identity, service);
8907
- const removableUnits = target.services.length === 0 ? ownedUnits.filter((unit) => unit.identity === identity) : ownedUnits;
8908
8882
  for (const unit of removableUnits) {
8909
- if (unit.identity === identity && targetByComponent.has(unit.component)) continue;
8883
+ if (targetByComponent.has(unit.component)) continue;
8910
8884
  await invokeSystemctl(run, systemctl, ["--user", "disable", "--now", unitName(unit.identity, unit.component)]);
8911
8885
  await removeOwnedUnit(unitDirectory, unit.identity, unit.component);
8912
8886
  }
@@ -8917,7 +8891,7 @@ function createLinuxUserSystemdAdapter(options) {
8917
8891
  if (previousByComponent.has(service.component)) await invokeSystemctl(run, systemctl, ["--user", "restart", name]);
8918
8892
  await requireExpectedReadback(run, systemctl, unitDirectory, identity, service, "running");
8919
8893
  }
8920
- for (const unit of removableUnits) if (unit.identity !== identity || !targetByComponent.has(unit.component)) await requireAbsentReadback(run, systemctl, unitDirectory, unit.identity, unit.component);
8894
+ for (const unit of removableUnits) if (!targetByComponent.has(unit.component)) await requireAbsentReadback(run, systemctl, unitDirectory, unit.identity, unit.component);
8921
8895
  },
8922
8896
  async restart({ target, service }) {
8923
8897
  const identity = prefixIdentity(target.prefix);
@@ -8967,15 +8941,15 @@ function unitPath(directory, identity, component) {
8967
8941
  function serviceMap(set) {
8968
8942
  return new Map(set.services.map((service) => [service.component, service]));
8969
8943
  }
8970
- async function ownedHostUnits(directory) {
8944
+ async function ownedHostUnits(directory, identity) {
8971
8945
  const owned = [];
8972
8946
  for (const name of await readdir3(directory)) {
8973
8947
  const match = /^ceal-host-([a-f0-9]{64})-(lifecycle|relay|codex|claude)\.service$/u.exec(name);
8974
8948
  if (match === null) continue;
8975
- const identity = match[1];
8949
+ const unitIdentity = match[1];
8976
8950
  const component = match[2];
8977
- if (identity === void 0 || !UNIT_ID_PATTERN.test(identity) || !isHostRuntimeServiceComponent(component)) continue;
8978
- if (await ownedUnitPresent(unitPath(directory, identity, component), identity, component)) owned.push({ identity, component });
8951
+ if (unitIdentity !== identity || !UNIT_ID_PATTERN.test(unitIdentity) || !isHostRuntimeServiceComponent(component)) continue;
8952
+ if (await ownedUnitPresent(unitPath(directory, unitIdentity, component), unitIdentity, component)) owned.push({ identity: unitIdentity, component });
8979
8953
  }
8980
8954
  return owned.sort((left, right) => unitName(left.identity, left.component).localeCompare(unitName(right.identity, right.component)));
8981
8955
  }
@@ -8985,8 +8959,8 @@ function isHostRuntimeServiceComponent(value) {
8985
8959
  async function ensurePrivateUnitDirectory(directory) {
8986
8960
  try {
8987
8961
  await mkdir10(directory, { recursive: true, mode: 448 });
8988
- const stat2 = await lstat12(directory);
8989
- if (!stat2.isDirectory() || stat2.isSymbolicLink() || typeof process.getuid === "function" && stat2.uid !== process.getuid()) throw projectionError();
8962
+ const stat3 = await lstat12(directory);
8963
+ if (!stat3.isDirectory() || stat3.isSymbolicLink() || typeof process.getuid === "function" && stat3.uid !== process.getuid()) throw projectionError();
8990
8964
  await chmod3(directory, 448);
8991
8965
  } catch (error) {
8992
8966
  if (isAdapterError(error)) throw error;
@@ -8995,8 +8969,8 @@ async function ensurePrivateUnitDirectory(directory) {
8995
8969
  }
8996
8970
  async function ownedUnitPresent(path, identity, component) {
8997
8971
  try {
8998
- const stat2 = await lstat12(path);
8999
- if (!stat2.isFile() || stat2.isSymbolicLink() || (stat2.mode & 63) !== 0 || typeof process.getuid === "function" && stat2.uid !== process.getuid()) throw projectionError();
8972
+ const stat3 = await lstat12(path);
8973
+ if (!stat3.isFile() || stat3.isSymbolicLink() || (stat3.mode & 63) !== 0 || typeof process.getuid === "function" && stat3.uid !== process.getuid()) throw projectionError();
9000
8974
  const bytes = await readFile6(path);
9001
8975
  if (bytes.byteLength > MAX_COMMAND_OUTPUT_BYTES) throw projectionError(refusalFact("unit_bytes", bytes.byteLength, `at most ${MAX_COMMAND_OUTPUT_BYTES}`));
9002
8976
  if (!bytes.toString("utf8").startsWith(ownerPreamble(identity, component))) throw projectionError(refusalFact("owner_preamble", ownerPreamble(identity, component), "the first line of the projected unit"));