@corca-org/ceal-host-linux-arm64 1.0.14 → 1.0.16

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.
@@ -54,7 +54,6 @@ var client_wire_contract_default = {
54
54
  length: 72,
55
55
  pattern: "^catalog:[a-f0-9]{64}$"
56
56
  },
57
- max_bytes: 4194304,
58
57
  envelope_max_bytes: 389
59
58
  },
60
59
  command_request: {
@@ -135,14 +134,13 @@ var client_wire_contract_default = {
135
134
  "prompt"
136
135
  ],
137
136
  discovery_command: "discovery",
138
- discovery_manifest_schema_version: "ceal.discovery_manifest.v2",
137
+ discovery_manifest_schema_version: "ceal.discovery_manifest.v1",
139
138
  discovery_manifest_document_fields: [
140
139
  "discovery_manifest"
141
140
  ],
142
141
  exit_code_max: 125,
143
142
  bare_document_max_bytes: 65536,
144
- complete_max_bytes: 66019,
145
- absolute_transport_max_bytes: 4194304
143
+ complete_max_bytes: 66019
146
144
  },
147
145
  resource_stream: {
148
146
  path: "/api/ceal/v2/resources",
@@ -157,6 +155,9 @@ var client_wire_contract_default = {
157
155
  "fetch"
158
156
  ],
159
157
  ref_flag: "--ref"
158
+ },
159
+ encoded_json_document: {
160
+ max_bytes: 4194304
160
161
  }
161
162
  };
162
163
 
@@ -166,6 +167,7 @@ var commandResolution = CEAL_CLIENT_WIRE_CONTRACT.command_resolution;
166
167
  var commandResolutionAuthority = commandResolution.authority;
167
168
  var commandResolutionSemanticOptions = commandResolution.semantic_options;
168
169
  var CEAL_GATEWAY_COMMAND_RESOLUTION_SCHEMA_VERSION = commandResolution.schema_version;
170
+ var CEAL_ENCODED_JSON_DOCUMENT_MAX_BYTES = CEAL_CLIENT_WIRE_CONTRACT.encoded_json_document.max_bytes;
169
171
  var artifact = CEAL_CLIENT_WIRE_CONTRACT.artifact_descriptor;
170
172
  var request = CEAL_CLIENT_WIRE_CONTRACT.command_request;
171
173
  var response = CEAL_CLIENT_WIRE_CONTRACT.command_response;
@@ -179,7 +181,7 @@ var CEAL_VERIFIED_ARTIFACT_DIGEST_LENGTH = artifact.digest.length;
179
181
  var CEAL_VERIFIED_ARTIFACT_DIGEST_PATTERN = artifact.digest.pattern;
180
182
  var CEAL_VERIFIED_ARTIFACT_CATALOG_REVISION_LENGTH = artifact.catalog_revision.length;
181
183
  var CEAL_VERIFIED_ARTIFACT_CATALOG_REVISION_PATTERN = artifact.catalog_revision.pattern;
182
- var CEAL_VERIFIED_ARTIFACT_MAX_BYTES = artifact.max_bytes;
184
+ var CEAL_VERIFIED_ARTIFACT_MAX_BYTES = CEAL_ENCODED_JSON_DOCUMENT_MAX_BYTES;
183
185
  var CEAL_VERIFIED_ARTIFACT_DESCRIPTOR_MAX_BYTES = artifact.envelope_max_bytes;
184
186
  var CEAL_COMMAND_REQUEST_SCHEMA_VERSION = request.schema_version;
185
187
  var CEAL_COMMAND_REQUEST_MAX_BYTES = request.absolute_transport_max_bytes;
@@ -193,7 +195,6 @@ var CEAL_COMMAND_RESPONSE_FOCUSED_PROMPT_CONTINUATION_DOCUMENT_FIELDS = Object.f
193
195
  var CEAL_COMMAND_RESPONSE_DISCOVERY_COMMAND = response.discovery_command;
194
196
  var CEAL_COMMAND_RESPONSE_DISCOVERY_MANIFEST_SCHEMA_VERSION = response.discovery_manifest_schema_version;
195
197
  var CEAL_COMMAND_RESPONSE_DISCOVERY_MANIFEST_DOCUMENT_FIELDS = Object.freeze([...response.discovery_manifest_document_fields]);
196
- var CEAL_COMMAND_RESPONSE_MAX_BYTES = response.absolute_transport_max_bytes;
197
198
 
198
199
  // packages/ceal-client-protocol/src/vocabulary.ts
199
200
  function vocabulary(words) {
@@ -210,6 +211,7 @@ var CEAL_AUDIT_OUTCOMES = vocabulary(["succeeded", "denied", "failed"]);
210
211
  var CEAL_GATEWAY_PROVIDER_STEP_OUTCOMES = vocabulary(["completed", "rejected", "throttled", "failed"]);
211
212
  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"]);
212
213
  var CEAL_GATEWAY_READ_REUSE_UNAVAILABLE_REASONS = vocabulary(["not_reported", "storage_unavailable", "coverage_incomplete", "freshness_refresh_required", "not_reusable", "bypassed"]);
214
+ var CEAL_GATEWAY_DERIVED_STORE_FAILURE_CLASSES = vocabulary(["storage_unavailable", "decode_mismatch", "write_conflict", "quota", "store_error"]);
213
215
  var CEAL_POLICY_DECISIONS = vocabulary(["allowed", "denied", "not_evaluated"]);
214
216
  var CEAL_CONNECTOR_ROUTE_PHASES = vocabulary(["scope_observation", "target_selection", "route_resolution"]);
215
217
  var CEAL_CONNECTOR_ROUTE_CAUSES = vocabulary(["provider_throttled", "provider_unavailable", "binding_invalid", "scope_limit_exceeded"]);
@@ -223,6 +225,17 @@ var CEAL_WRITE_RECEIPT_PROVIDER_STATES = vocabulary(["outcome_unknown", "verifie
223
225
  var CEAL_WRITE_RECEIPT_PROVIDER_READBACKS = vocabulary(["outcome_unknown", "verified", "not_applied"]);
224
226
  var CEAL_PROTOCOL_VERSION = "1.4.0";
225
227
  var CEAL_OPERATION_ACCESS_SCHEMA_VERSION = "ceal.operation_access.v1";
228
+ var CEAL_GATEWAY_ACTIVE_CALL_PHASES = vocabulary([
229
+ "audited_call_pending",
230
+ "continuation_read_pending",
231
+ "continuation_write_pending",
232
+ "provider_pacing_pending",
233
+ "corpus_replay_pending",
234
+ "corpus_append_pending",
235
+ "corpus_fence_pending",
236
+ "corpus_content_pending",
237
+ "corpus_transaction_pending"
238
+ ]);
226
239
  var CEAL_CONNECTOR_ROUTE_FAILURE_KEYS = vocabulary(["connector_kind", "phase", "schema_version"]);
227
240
  var CEAL_CLASSIFIED_CONNECTOR_ROUTE_FAILURE_KEYS = vocabulary(["cause", ...CEAL_CONNECTOR_ROUTE_FAILURE_KEYS]);
228
241
  var CEAL_UNCLASSIFIED_CONNECTOR_ROUTE_FAILURE_KEYS = vocabulary(["connector_kind", "error_class", "phase", "schema_version"]);
@@ -232,10 +245,129 @@ var CEAL_GATEWAY_ORGANIZATION_ROUTE_FACT_CALL_KEYS = Object.freeze([
232
245
  "policy_decision_revision"
233
246
  ]);
234
247
 
248
+ // packages/ceal-client-protocol/src/operation-next-actions.ts
249
+ var CEAL_REPEAT_REQUEST_NEXT_ACTION = "repeat_request";
250
+ var CEAL_INSPECT_RECEIPT_NEXT_ACTION = "inspect_receipt";
251
+ var CALLER_RECOVERABLE_NEXT_ACTION_VALUES = [
252
+ "select_did_you_mean",
253
+ "choose_new_output_path",
254
+ "choose_new_idempotency_key",
255
+ "restart_search",
256
+ "repeat_original_arguments",
257
+ // The occurrence this call addressed is settled and cannot move again -- a
258
+ // denied effect approval, an expired continuation -- so the caller runs the
259
+ // same call again as a new request. The refusal names the re-request; this
260
+ // word is the re-request.
261
+ CEAL_REPEAT_REQUEST_NEXT_ACTION,
262
+ "choose_new_request_identity",
263
+ // A refusal that names the argument (invalid_argument with `property`) tells the caller exactly what to change.
264
+ "correct_argument",
265
+ // A resolver-owned input must move from caller operands into the declared
266
+ // resolver selection field.
267
+ "supply_resolver_selections",
268
+ // The graph names an upstream node whose Operation produces the resolver's
269
+ // occurrence, and it has not produced one yet. The caller runs that node
270
+ // first; the refusal used to share a code with a malformed resolver result,
271
+ // which is not fixable, so neither could carry a remedy.
272
+ "run_resolver_dependency",
273
+ // A replay carries the input the occurrence durably admitted, and this one
274
+ // carries a different one. The caller fixes it by presenting the original
275
+ // invocation, so it is a remedy; the coordinator minted the word at the
276
+ // replay guard and never declared it, which read as unguided to the scorer.
277
+ "use_original_input",
278
+ // The same mismatch on the Request binding rather than the input: the
279
+ // occurrence was admitted under one binding and the replay presents another.
280
+ "use_original_request_binding",
281
+ // The client's own filesystem write was refused -- EACCES, EPERM, or a
282
+ // read-only mount -- which is how an agent sandbox fences writes outside its
283
+ // workspace. The caller reruns the same command with unsandboxed or escalated
284
+ // execution; re-adopting the session cannot help, because the sandbox refuses
285
+ // that write too.
286
+ "rerun_outside_agent_sandbox",
287
+ // The refusal names the one Operation to read next in `describe_command`:
288
+ // an absent Operation id with a sole catalog-ranked candidate, or a known
289
+ // Operation invoked without its input. Describing only reads the verified
290
+ // contract and dispatches nothing, and the caller then retries with the
291
+ // named Operation or input, so it is guidance the scorer counts.
292
+ "describe_operation",
293
+ // The refusal names the caller's own personal connect Operation in
294
+ // `required_action_sequence`: the Operation asked for, or the credential
295
+ // the call ran on, needs a personal connection the caller does not hold
296
+ // (never connected, revoked, or expired). The caller runs that exact
297
+ // Operation, completes the consent it hands back, and retries the same call.
298
+ "connect_personal_account",
299
+ // The provider or Gateway named a bounded wait; the caller waits that long
300
+ // and submits the same read again.
301
+ "retry_after",
302
+ // The ref names a container of rows (a Notion database or data source), which
303
+ // has no body of its own; the caller searches its rows instead of reading it.
304
+ "search_container_rows"
305
+ ];
306
+ var CEAL_CALLER_RECOVERABLE_NEXT_ACTIONS = Object.freeze(CALLER_RECOVERABLE_NEXT_ACTION_VALUES);
307
+ var NON_REMEDY_NEXT_ACTION_VALUES = [
308
+ // Only an administrator can take the named step -- approving a place for an
309
+ // Operation, granting a withheld capability -- so a non-administrator asks
310
+ // one. The refusal names the administrator step; this word is the ask.
311
+ "ask_admin",
312
+ "await_pending_approval",
313
+ "check_gateway",
314
+ "inspect_context_store",
315
+ "inspect_gateway",
316
+ "inspect_local_cache",
317
+ // The thin client prints these on its own behalf, before or after the wire.
318
+ // They were declared only as `CealClientLocalRemedy` keys and, for two of
319
+ // them, only as Go string literals -- a second and third vocabulary for one
320
+ // thing. `CealClientLocalRemedy` derives from this list now, so the client's
321
+ // remedies cannot drift from the words the protocol knows.
322
+ "inspect_local_client",
323
+ "inspect_local_command",
324
+ "inspect_local_output",
325
+ "inspect_local_route",
326
+ CEAL_INSPECT_RECEIPT_NEXT_ACTION,
327
+ "inspect_request",
328
+ "none",
329
+ // The provider refused because of its own configuration -- an API not
330
+ // enabled, an app scope missing -- which an operator changes in that
331
+ // provider's console. No caller edit and no retry fixes it.
332
+ "operator_action",
333
+ "recover",
334
+ "reconcile",
335
+ // Reconciliation of one named occurrence, not of the deployment: an
336
+ // occurrence with no admitted input commitment cannot be replayed safely and
337
+ // no edit to the call changes that. `reconcile` is the deployment-wide word.
338
+ "reconcile_occurrence",
339
+ "reduce_request_size",
340
+ // The Host's invocation context for this turn is stale or expired at the
341
+ // Gateway. The Host's next turn rebinds it and the same call then succeeds;
342
+ // nothing in the call changes, so it is not a remedy the scorer may count.
343
+ "refresh_host_invocation_context",
344
+ "repair_or_adopt_session",
345
+ "retry",
346
+ // The owner -- a correlation hook, an approval hook -- is not serving right
347
+ // now. The caller changes nothing and the same call succeeds once the owner
348
+ // is back, so this is not a remedy the scorer may count as guidance.
349
+ "retry_after_owner_recovery",
350
+ "retry_same_receipt_read",
351
+ "run_file_search_again",
352
+ "select_exact_approval"
353
+ ];
354
+ var CEAL_NON_REMEDY_NEXT_ACTIONS = Object.freeze(NON_REMEDY_NEXT_ACTION_VALUES);
355
+ var DECLARED = /* @__PURE__ */ new Set([...CEAL_CALLER_RECOVERABLE_NEXT_ACTIONS, ...CEAL_NON_REMEDY_NEXT_ACTIONS]);
356
+ var RETRY_PROMISE_NEXT_ACTIONS = ["retry", "retry_after"];
357
+ var RETRY_PROMISE = new Set(RETRY_PROMISE_NEXT_ACTIONS);
358
+ var RECOVERABLE = new Set(CEAL_CALLER_RECOVERABLE_NEXT_ACTIONS);
359
+ var CEAL_OPERATION_WITHHELD_NEXT_ACTIONS = Object.freeze({
360
+ provider_permission: "ask_admin",
361
+ access_level: "ask_admin",
362
+ personal_authorization_required: "connect_personal_account"
363
+ });
364
+
365
+ // packages/ceal-client-protocol/src/operation-withheld-cause.ts
366
+ var CEAL_OPERATION_WITHHELD_CAUSES = vocabulary(["provider_permission", "access_level", "personal_authorization_required"]);
367
+
235
368
  // packages/ceal-client-protocol/src/operation-contract-types.ts
236
369
  var CEAL_JSON_SCHEMA_2020_12 = "https://json-schema.org/draft/2020-12/schema";
237
370
  var CEAL_OPERATION_ERROR_SCHEMA_VERSION = "ceal.operation_error.v1";
238
- var CEAL_OPERATION_WITHHELD_CAUSES = vocabulary(["provider_permission", "access_level", "personal_authorization_required"]);
239
371
  var CEAL_RETRY_AFTER_MAX_MS = 60 * 60 * 1e3;
240
372
  var CEAL_JSON_SCHEMA_TYPES = vocabulary(["object", "array", "string", "integer", "number", "boolean", "null"]);
241
373
  var OBSERVATION_POSTURES = vocabulary(["direct_readback", "approved_no_readback", "operator_mediated", "excluded"]);
@@ -487,7 +619,6 @@ function cut(text) {
487
619
  var CEAL_OPERATION_ACCESS_CLASSES = vocabulary(["read", "write"]);
488
620
 
489
621
  // packages/ceal-client-protocol/src/domain-vocabulary.ts
490
- var CEAL_INTEGRATION_KINDS = vocabulary(["github", "google-workspace", "notion", "slack"]);
491
622
  var CEAL_CONNECTOR_STATUSES = vocabulary(["active", "disabled", "disconnected"]);
492
623
  var CEAL_CONNECTOR_CUSTODIES = vocabulary(["organization", "personal"]);
493
624
  var CEAL_PROVIDER_BOUNDARY_KINDS = vocabulary([
@@ -500,6 +631,8 @@ var CEAL_PROVIDER_BOUNDARY_KINDS = vocabulary([
500
631
  var CEAL_PROVIDER_BOUNDARY_EVIDENCE = vocabulary(["provider_readback", "operator_stated"]);
501
632
  var CEAL_ACCESS_LEVELS = vocabulary(["none", "read", "read_write"]);
502
633
  var CEAL_PERSONAL_ACCESS_CEILINGS = vocabulary(["disabled", "read", "read_write"]);
634
+ var CEAL_TARGET_REF_PATTERN = "^[^\\p{Cc}]+$";
635
+ var TARGET_REF = new RegExp(CEAL_TARGET_REF_PATTERN, "u");
503
636
  var CEAL_TARGET_VISIBILITIES = vocabulary(["public", "private"]);
504
637
  var CEAL_PRINCIPAL_KINDS = vocabulary(["human", "service", "runtime"]);
505
638
  var CEAL_ORGANIZATION_ROLES = vocabulary(["member", "admin"]);
@@ -610,6 +743,7 @@ var CEAL_OPERATION_DESCRIPTOR_REQUIRED_ENVELOPE_KEYS = Object.freeze(["schema_ve
610
743
  var CEAL_OPERATION_DESCRIPTOR_OPTIONAL_ENVELOPE_KEYS = Object.freeze(["input_resolution", "summary"]);
611
744
  var CEAL_OPERATION_RESULT_KEYS = vocabulary(["ok", "operation_id", "operation_receipt", "schema_version", "value"]);
612
745
  var CEAL_OPERATION_COMPACT_RESULT_KEYS = vocabulary(["ok", "operation_evidence", "operation_id", "schema_version", "value"]);
746
+ var CEAL_OPERATION_RESULT_OPTIONAL_KEYS = vocabulary(["model_disclosure", "result_complete", "resume"]);
613
747
 
614
748
  // packages/ceal-client-protocol/src/operation-catalog.ts
615
749
  var CEAL_OPERATION_CATALOG_SCHEMA_VERSION = "ceal.catalog.v3";
@@ -621,8 +755,8 @@ var CEAL_SCHEMA_LITERALS = [
621
755
  "ceal.activation_transport.v1",
622
756
  CEAL_OPERATION_ACCESS_SCHEMA_VERSION,
623
757
  CEAL_OPERATION_CATALOG_SCHEMA_VERSION,
624
- "ceal.client_refresh_request.v2",
625
- "ceal.client_refresh_result.v2",
758
+ "ceal.client_refresh_request.v1",
759
+ "ceal.client_refresh_result.v1",
626
760
  "ceal.client_revoke_request.v1",
627
761
  "ceal.client_revoke_result.v1",
628
762
  CEAL_COMMAND_REQUEST_SCHEMA_VERSION,
@@ -651,7 +785,7 @@ var CEAL_SCHEMA_LITERALS = [
651
785
  "ceal.gateway_call_result.v1",
652
786
  CEAL_GATEWAY_COMMAND_RESOLUTION_SCHEMA_VERSION,
653
787
  "ceal.gateway_connector_route_failure.v1",
654
- "ceal.gateway_discovery.v3",
788
+ "ceal.gateway_discovery.v1",
655
789
  "ceal.gateway_handshake.v1",
656
790
  "ceal.gateway_installation_activation_code_issue_request.v1",
657
791
  "ceal.gateway_installation_activation_code_issue_result.v1",
@@ -673,10 +807,10 @@ var CEAL_SCHEMA_LITERALS = [
673
807
  "ceal.host_observation.v1",
674
808
  "ceal.host_registration_request.v1",
675
809
  "ceal.host_registration_result.v1",
676
- "ceal.leased-resource-stream.v2",
677
- "ceal.leased_consumer_attachment_stream_frame.v2",
678
- "ceal.leased_consumer_attachment_stream_request.v2",
679
- "ceal.leased_consumer_attachment_stream_transport.v2",
810
+ "ceal.leased-resource-stream.v1",
811
+ "ceal.leased_consumer_attachment_stream_frame.v1",
812
+ "ceal.leased_consumer_attachment_stream_request.v1",
813
+ "ceal.leased_consumer_attachment_stream_transport.v1",
680
814
  "ceal.operation_descriptor.v1",
681
815
  "ceal.operation_error.v1",
682
816
  "ceal.operation_failure.v1",
@@ -684,7 +818,7 @@ var CEAL_SCHEMA_LITERALS = [
684
818
  "ceal.operation_receipt.v1",
685
819
  "ceal.operation_result.v1",
686
820
  "ceal.operation_result.compact.v1",
687
- "ceal.local_result_materialization.v2",
821
+ "ceal.local_result_materialization.v1",
688
822
  "ceal.local_result_root.v1",
689
823
  "ceal.owner_bootstrap_exchange_request.v1",
690
824
  "ceal.owner_bootstrap_exchange_result.v1",
@@ -769,117 +903,8 @@ var CEAL_AGENT_SERVICE_SESSION_RECORD_KEYS = vocabulary([
769
903
  ]);
770
904
  var CEAL_AGENT_SESSION_COMMIT_KEYS = vocabulary(["attempt_ref", "expected_session_revision", "session_revision"]);
771
905
 
772
- // packages/ceal-client-protocol/src/operation-next-actions.ts
773
- var CEAL_REPEAT_REQUEST_NEXT_ACTION = "repeat_request";
774
- var CEAL_INSPECT_RECEIPT_NEXT_ACTION = "inspect_receipt";
775
- var CALLER_RECOVERABLE_NEXT_ACTION_VALUES = [
776
- "select_did_you_mean",
777
- "choose_new_output_path",
778
- "choose_new_idempotency_key",
779
- "restart_search",
780
- "repeat_original_arguments",
781
- // The occurrence this call addressed is settled and cannot move again -- a
782
- // denied effect approval, an expired continuation -- so the caller runs the
783
- // same call again as a new request. The refusal names the re-request; this
784
- // word is the re-request.
785
- CEAL_REPEAT_REQUEST_NEXT_ACTION,
786
- "choose_new_request_identity",
787
- // A refusal that names the argument (invalid_argument with `property`) tells the caller exactly what to change.
788
- "correct_argument",
789
- // A resolver-owned input must move from caller operands into the declared
790
- // resolver selection field.
791
- "supply_resolver_selections",
792
- // The graph names an upstream node whose Operation produces the resolver's
793
- // occurrence, and it has not produced one yet. The caller runs that node
794
- // first; the refusal used to share a code with a malformed resolver result,
795
- // which is not fixable, so neither could carry a remedy.
796
- "run_resolver_dependency",
797
- // A replay carries the input the occurrence durably admitted, and this one
798
- // carries a different one. The caller fixes it by presenting the original
799
- // invocation, so it is a remedy; the coordinator minted the word at the
800
- // replay guard and never declared it, which read as unguided to the scorer.
801
- "use_original_input",
802
- // The same mismatch on the Request binding rather than the input: the
803
- // occurrence was admitted under one binding and the replay presents another.
804
- "use_original_request_binding",
805
- // The client's own filesystem write was refused -- EACCES, EPERM, or a
806
- // read-only mount -- which is how an agent sandbox fences writes outside its
807
- // workspace. The caller reruns the same command with unsandboxed or escalated
808
- // execution; re-adopting the session cannot help, because the sandbox refuses
809
- // that write too.
810
- "rerun_outside_agent_sandbox",
811
- // The refusal names the one Operation to read next in `describe_command`:
812
- // an absent Operation id with a sole catalog-ranked candidate, or a known
813
- // Operation invoked without its input. Describing only reads the verified
814
- // contract and dispatches nothing, and the caller then retries with the
815
- // named Operation or input, so it is guidance the scorer counts.
816
- "describe_operation",
817
- // The refusal names the caller's own personal connect Operation in
818
- // `required_action_sequence`: the Operation asked for, or the credential
819
- // the call ran on, needs a personal connection the caller does not hold
820
- // (never connected, revoked, or expired). The caller runs that exact
821
- // Operation, completes the consent it hands back, and retries the same call.
822
- "connect_personal_account",
823
- // The provider or Gateway named a bounded wait; the caller waits that long
824
- // and submits the same read again.
825
- "retry_after"
826
- ];
827
- var CEAL_CALLER_RECOVERABLE_NEXT_ACTIONS = Object.freeze(CALLER_RECOVERABLE_NEXT_ACTION_VALUES);
828
- var NON_REMEDY_NEXT_ACTION_VALUES = [
829
- // Only an administrator can take the named step -- approving a place for an
830
- // Operation, granting a withheld capability -- so a non-administrator asks
831
- // one. The refusal names the administrator step; this word is the ask.
832
- "ask_admin",
833
- "await_pending_approval",
834
- "check_gateway",
835
- "inspect_context_store",
836
- "inspect_gateway",
837
- "inspect_local_cache",
838
- // The thin client prints these on its own behalf, before or after the wire.
839
- // They were declared only as `CealClientLocalRemedy` keys and, for two of
840
- // them, only as Go string literals -- a second and third vocabulary for one
841
- // thing. `CealClientLocalRemedy` derives from this list now, so the client's
842
- // remedies cannot drift from the words the protocol knows.
843
- "inspect_local_client",
844
- "inspect_local_command",
845
- "inspect_local_output",
846
- "inspect_local_route",
847
- CEAL_INSPECT_RECEIPT_NEXT_ACTION,
848
- "inspect_request",
849
- "none",
850
- // The provider refused because of its own configuration -- an API not
851
- // enabled, an app scope missing -- which an operator changes in that
852
- // provider's console. No caller edit and no retry fixes it.
853
- "operator_action",
854
- "recover",
855
- "reconcile",
856
- // Reconciliation of one named occurrence, not of the deployment: a legacy
857
- // occurrence with no admitted input commitment cannot be replayed safely and
858
- // no edit to the call changes that. `reconcile` is the deployment-wide word.
859
- "reconcile_occurrence",
860
- "reduce_request_size",
861
- // The Host's invocation context for this turn is stale or expired at the
862
- // Gateway. The Host's next turn rebinds it and the same call then succeeds;
863
- // nothing in the call changes, so it is not a remedy the scorer may count.
864
- "refresh_host_invocation_context",
865
- "repair_or_adopt_session",
866
- "retry",
867
- // The owner -- a correlation hook, an approval hook -- is not serving right
868
- // now. The caller changes nothing and the same call succeeds once the owner
869
- // is back, so this is not a remedy the scorer may count as guidance.
870
- "retry_after_owner_recovery",
871
- "retry_same_receipt_read",
872
- "run_file_search_again",
873
- "select_exact_approval"
874
- ];
875
- var CEAL_NON_REMEDY_NEXT_ACTIONS = Object.freeze(NON_REMEDY_NEXT_ACTION_VALUES);
876
- var DECLARED = /* @__PURE__ */ new Set([...CEAL_CALLER_RECOVERABLE_NEXT_ACTIONS, ...CEAL_NON_REMEDY_NEXT_ACTIONS]);
877
- var RECOVERABLE = new Set(CEAL_CALLER_RECOVERABLE_NEXT_ACTIONS);
878
- var CEAL_OPERATION_WITHHELD_NEXT_ACTIONS = Object.freeze({
879
- provider_permission: "ask_admin",
880
- access_level: "ask_admin",
881
- personal_authorization_required: "connect_personal_account"
882
- });
906
+ // packages/ceal-client-protocol/src/operation-result-completeness.ts
907
+ var CEAL_READ_VALUE_CONTINUATION_KEYS = vocabulary(["continuation", "continuation_ref", "next_cursor"]);
883
908
 
884
909
  // packages/ceal-client-protocol/src/operation-contract-artifact.ts
885
910
  var CATALOG_REVISION = new RegExp(CEAL_VERIFIED_ARTIFACT_CATALOG_REVISION_PATTERN, "u");
@@ -940,7 +965,8 @@ var CEAL_ACTIVITY_GAP_CODES = vocabulary([
940
965
  "provider_cursor_unavailable",
941
966
  "malformed_provider_page",
942
967
  "visibility_incomplete",
943
- "unsupported_event_kind"
968
+ "unsupported_event_kind",
969
+ "direct_messages_excluded"
944
970
  ]);
945
971
  var CEAL_ACTIVITY_CONNECTOR_KINDS = vocabulary(["slack", "github", "google-calendar", "google-drive", "notion"]);
946
972
  var CEAL_ACTIVITY_COVERAGE_STATUSES = vocabulary(["complete_for_target", "continuation_required", "blocked"]);
@@ -951,6 +977,8 @@ var CEAL_ACTIVITY_EVENT_KINDS = vocabulary([
951
977
  "github.commit.authored",
952
978
  "github.issue.opened",
953
979
  "github.pull_request.opened",
980
+ "github.issue.edited",
981
+ "github.pull_request.edited",
954
982
  "github.review.submitted",
955
983
  "github.issue_comment.created",
956
984
  "github.review_comment.created",
@@ -963,6 +991,25 @@ var CEAL_ACTIVITY_EVENT_KINDS = vocabulary([
963
991
  "notion.page.created",
964
992
  "notion.page.edited"
965
993
  ]);
994
+ var CEAL_ACTIVITY_EVENT_TIMESTAMP_BASIS_MAP = Object.freeze({
995
+ "slack.message": "message_created",
996
+ "slack.reply": "message_created",
997
+ "slack.direct_message": "message_created",
998
+ "github.commit.authored": "commit_authored",
999
+ "github.review.submitted": "review_submitted",
1000
+ "github.issue_comment.created": "comment_created",
1001
+ "github.review_comment.created": "comment_created",
1002
+ "github.issue.opened": "resource_created",
1003
+ "github.pull_request.opened": "resource_created",
1004
+ "github.issue.edited": "resource_modified",
1005
+ "github.pull_request.edited": "resource_modified",
1006
+ "calendar.organized": "resource_created",
1007
+ "drive.file.created": "file_created",
1008
+ "drive.file.modified": "file_modified_by_me",
1009
+ "drive.file.viewed": "file_viewed_by_me",
1010
+ "notion.page.created": "page_created",
1011
+ "notion.page.edited": "page_last_edited"
1012
+ });
966
1013
  var CEAL_ACTIVITY_TIMESTAMP_BASES = vocabulary([
967
1014
  "message_created",
968
1015
  "commit_authored",
@@ -983,11 +1030,12 @@ var CEAL_ACTIVITY_V3_KINDS = vocabulary(["authored", "edited", "messaged", "resp
983
1030
  var CEAL_RESOURCE_TIME_BASES = vocabulary(["created", "modified", "viewed"]);
984
1031
  var CEAL_RESOURCE_SEARCH_ORDERS = vocabulary(["relevance", "modified", "viewed", "created"]);
985
1032
  var CEAL_RESOURCE_SEARCH_DIRECTIONS = vocabulary(["ascending", "descending"]);
986
- var CEAL_RESOURCE_SEARCH_FILTERS = vocabulary(["query", "modified_since", "since", "until", "authored_by_me", "include_replies", "kinds", "container_ref", "container_refs", "addressed_to_me", "unread"]);
1033
+ var CEAL_RESOURCE_SEARCH_FILTERS = vocabulary(["query", "modified_since", "since", "until", "authored_by_me", "include_replies", "kinds", "container_ref", "container_refs", "container_names", "addressed_to_me", "unread"]);
987
1034
  var CEAL_ARTIFACT_STAGE_TERMINALS = vocabulary(["chunk_accepted", "artifact_ready", "idempotency_replayed"]);
988
1035
  var CEAL_READ_ITEM_KINDS = vocabulary(["conversation", "identity", "usergroup", "message", "file", "document"]);
989
1036
  var CEAL_LEASED_MESSAGE_SEARCH_COMPLETENESS = vocabulary(["complete", "continuation_available", "truncated"]);
990
- var CEAL_OPAQUE_HANDLE_KINDS = vocabulary(["target", "message", "thread", "artifact", "document", "object"]);
1037
+ var CEAL_OPAQUE_HANDLE_KINDS = vocabulary(["target", "message", "thread", "artifact", "document", "block", "object"]);
1038
+ var CEAL_OPAQUE_REF_KINDS = vocabulary([...CEAL_OPAQUE_HANDLE_KINDS, "result", "operation-receipt", "reply-receipt", "field", "notion-data-source"]);
991
1039
  var CEAL_WRITE_OBJECT_KINDS = vocabulary(["document", "comment", "cell_range"]);
992
1040
  var CEAL_CONVERSATION_KINDS = vocabulary(["channel", "dm", "group"]);
993
1041
  var CEAL_FILE_TYPE_FAMILIES = vocabulary(["all", "image", "pdf"]);
@@ -1029,6 +1077,9 @@ var CEAL_FINAL_PRESENTATION_INTENTS = vocabulary(["final", "stop", "transient_no
1029
1077
  var CEAL_PRESENTATION_INTENTS = vocabulary(["progress", ...CEAL_FINAL_PRESENTATION_INTENTS]);
1030
1078
 
1031
1079
  // packages/ceal-client-protocol/src/resource-row.ts
1080
+ var CEAL_DATED_NOTE_BASES = vocabulary(["recording", "calendar_event", "created_time"]);
1081
+ var CEAL_DATED_NOTE_TRANSCRIPT_STATES = vocabulary(["present", "absent", "unestablished"]);
1082
+ var CEAL_READ_SEARCH_COST_CLASSES = vocabulary(["native_index", "scan"]);
1032
1083
  var RESOURCE_ROW_KEY_RULES = Object.freeze({
1033
1084
  schema_version: { required: true, timestamp: false },
1034
1085
  ref: { required: true, timestamp: false },
@@ -1037,9 +1088,11 @@ var RESOURCE_ROW_KEY_RULES = Object.freeze({
1037
1088
  title: { required: true, timestamp: false },
1038
1089
  container_label: { required: true, timestamp: false },
1039
1090
  container_ref: { required: false, timestamp: false },
1091
+ source_url: { required: false, timestamp: false },
1040
1092
  source: { required: true, timestamp: false },
1041
1093
  owner: { required: false, timestamp: false },
1042
1094
  counterparts: { required: false, timestamp: false },
1095
+ attachments: { required: false, timestamp: false },
1043
1096
  created_at: { required: false, timestamp: true },
1044
1097
  created_at_local: { required: false, timestamp: true },
1045
1098
  modified_at: { required: false, timestamp: true },
@@ -1050,6 +1103,7 @@ var RESOURCE_ROW_KEY_RULES = Object.freeze({
1050
1103
  end: { required: false, timestamp: false },
1051
1104
  status: { required: false, timestamp: false },
1052
1105
  snippet: { required: false, timestamp: false },
1106
+ dated_notes: { required: false, timestamp: false },
1053
1107
  state: { required: true, timestamp: false },
1054
1108
  timestamp_basis: { required: true, timestamp: false }
1055
1109
  });
@@ -1086,6 +1140,27 @@ var CEAL_WRITE_SAFETY_UNCHECKED_REASONS = vocabulary(["authority_unavailable"]);
1086
1140
  // packages/ceal-client-protocol/src/operation-occurrence.ts
1087
1141
  var MAX_RECEIPT_REVISION = Number.MAX_SAFE_INTEGER - 1;
1088
1142
 
1143
+ // packages/ceal-client-protocol/src/personal-client-vocabulary.ts
1144
+ var CEAL_PERSONAL_CLIENT_BINDING_KEYS = vocabulary([
1145
+ "access_group_ref",
1146
+ "membership_ref",
1147
+ "registration_ref",
1148
+ "client_ref",
1149
+ "subject_ref",
1150
+ "instance_ref"
1151
+ ]);
1152
+ var CEAL_ENROLLMENT_FAILURE_CODES = vocabulary(["enrollment_invalid", "enrollment_expired", "enrollment_used"]);
1153
+ var CEAL_REFRESH_FAILURE_CODES = vocabulary([
1154
+ "refresh_invalid",
1155
+ "refresh_expired",
1156
+ "refresh_inactive",
1157
+ "refresh_replayed",
1158
+ "refresh_revoked",
1159
+ "authority_replaced",
1160
+ "refresh_recovery_unavailable",
1161
+ "refresh_recovery_expired"
1162
+ ]);
1163
+
1089
1164
  // packages/ceal-client-protocol/src/leased-artifact-contract.ts
1090
1165
  var CEAL_LEASED_CONSUMER_ARTIFACT_CHUNK_MAX_BYTES = 12 * 1024;
1091
1166
 
@@ -1181,7 +1256,7 @@ var CEAL_REQUEST_MAX_GRAPH_NODES = 128;
1181
1256
 
1182
1257
  // packages/ceal-client-protocol/src/request-run.ts
1183
1258
  var CEAL_REQUEST_NODE_STANDING_OCCURRENCE_SCHEMA_VERSION = "ceal.request_node_standing_occurrence.v1";
1184
- var CEAL_REQUEST_RUN_BATCH_SCHEMA_VERSION = "ceal.request_run_batch.v3";
1259
+ var CEAL_REQUEST_RUN_BATCH_SCHEMA_VERSION = "ceal.request_run_batch.v1";
1185
1260
  var REQUEST_ACTION_SAFE_REF_SCHEMA = { type: "string", minLength: 1, maxLength: 128, pattern: SAFE_REF.source };
1186
1261
  var REQUEST_ACTION_DIGEST_SCHEMA = { type: "string", minLength: 64, maxLength: 64, pattern: "^[a-f0-9]{64}$" };
1187
1262
  var REQUEST_NODE_STANDING_OCCURRENCE_SCHEMA = {
@@ -1399,8 +1474,15 @@ var CEAL_REQUEST_GRAPH_NODE_PREPARE_READINESS_JSON_SCHEMA = {
1399
1474
  // packages/ceal-client-protocol/src/host-invocation-authentication.ts
1400
1475
  var CEAL_HOST_INVOCATION_AUTHENTICATION_REQUEST_SCHEMA = "ceal.host_invocation_authentication_request.v1";
1401
1476
  var CEAL_HOST_INVOCATION_AUTHENTICATION_RESULT_SCHEMA = "ceal.host_invocation_authentication_result.v1";
1402
- var CEAL_HOST_CLIENT_NONCE_PATTERN = /^[A-Za-z0-9_-]{43}$/u;
1403
- var CEAL_HOST_CONTEXT_TOKEN_PATTERN = /^ceal_context_[A-Za-z0-9_-]{43}$/u;
1477
+ var CEAL_HOST_NONCE_ENCODED_CHARACTERS = 43;
1478
+ var CEAL_HOST_CLIENT_NONCE_PATTERN = new RegExp(`^[A-Za-z0-9_-]{${CEAL_HOST_NONCE_ENCODED_CHARACTERS}}$`, "u");
1479
+ var CEAL_HOST_CONTEXT_TOKEN_PATTERN = new RegExp(`^ceal_context_[A-Za-z0-9_-]{${CEAL_HOST_NONCE_ENCODED_CHARACTERS}}$`, "u");
1480
+ var CEAL_HOST_INVOCATION_AUTHENTICATION_RESULT_MAX_BYTES = new TextEncoder().encode(`${JSON.stringify({
1481
+ schema_version: CEAL_HOST_INVOCATION_AUTHENTICATION_RESULT_SCHEMA,
1482
+ context_token: `ceal_context_${"A".repeat(CEAL_HOST_NONCE_ENCODED_CHARACTERS)}`,
1483
+ expires_at: (/* @__PURE__ */ new Date("+010000-01-01T00:00:00.000Z")).toISOString()
1484
+ })}
1485
+ `).byteLength;
1404
1486
  function decodeCealHostInvocationAuthenticationRequest(value) {
1405
1487
  if (!isCealJsonRecord(value) || !exactKeys(value, ["schema_version", "client_nonce"]) || value.schema_version !== CEAL_HOST_INVOCATION_AUTHENTICATION_REQUEST_SCHEMA || typeof value.client_nonce !== "string" || !CEAL_HOST_CLIENT_NONCE_PATTERN.test(value.client_nonce)) {
1406
1488
  throw new TypeError("The Host invocation authentication request is invalid.");
@@ -1424,8 +1506,8 @@ function exactKeys(value, expected) {
1424
1506
 
1425
1507
  // packages/ceal-client-protocol/src/client-result-materialization.ts
1426
1508
  var CEAL_MODEL_VISIBLE_COMMAND_OUTPUT_MAX_BYTES = 32 * 1024;
1427
- var REQUIRED_FIELDS2 = Object.freeze(["schema_version", "operation_id", "read_argv"]);
1428
- var FIELDS = /* @__PURE__ */ new Set([...REQUIRED_FIELDS2, "local_result_root", "continue_argv"]);
1509
+ var REQUIRED_FIELDS2 = Object.freeze(["schema_version", "operation_id"]);
1510
+ var FIELDS = /* @__PURE__ */ new Set([...REQUIRED_FIELDS2, "read_argv", "local_result_root", "continue_argv", "model_disclosure", "item_read_argv"]);
1429
1511
 
1430
1512
  // packages/ceal-client-protocol/src/session-start-affordance.ts
1431
1513
  var CEAL_SESSION_ENTRY_INVOCATION = "ceal";
@@ -1525,27 +1607,6 @@ var ADMIN_LINEAGE_NODE_KINDS = vocabulary(["source_read", "synthesis_preview", "
1525
1607
  // packages/ceal-client-protocol/src/actor-kind.ts
1526
1608
  var CEAL_ACTOR_KINDS = vocabulary(["human", "bot", "app", "unknown"]);
1527
1609
 
1528
- // packages/ceal-client-protocol/src/personal-client-vocabulary.ts
1529
- var CEAL_PERSONAL_CLIENT_BINDING_KEYS = vocabulary([
1530
- "access_group_ref",
1531
- "membership_ref",
1532
- "registration_ref",
1533
- "client_ref",
1534
- "subject_ref",
1535
- "instance_ref"
1536
- ]);
1537
- var CEAL_ENROLLMENT_FAILURE_CODES = vocabulary(["enrollment_invalid", "enrollment_expired", "enrollment_used"]);
1538
- var CEAL_REFRESH_FAILURE_CODES = vocabulary([
1539
- "refresh_invalid",
1540
- "refresh_expired",
1541
- "refresh_inactive",
1542
- "refresh_replayed",
1543
- "refresh_revoked",
1544
- "authority_replaced",
1545
- "refresh_recovery_unavailable",
1546
- "refresh_recovery_expired"
1547
- ]);
1548
-
1549
1610
  // packages/ceal-client-protocol/src/device-enrollment.ts
1550
1611
  var CEAL_DEVICE_ENROLLMENT_POLL_FAILURE_CODES = Object.freeze(["unsupported_feature", "recovery_required", "expired", "denied"]);
1551
1612
  var POLL_RESULT_KEYS = Object.freeze(["retry_after_ms", "schema_version", "status"]);
@@ -2254,7 +2315,6 @@ function assertHostProducerSourcePaths(stateRoot, config, producer, platform = p
2254
2315
  // host/producer-service.ts
2255
2316
  import { constants } from "node:fs";
2256
2317
  import { lstat as lstat2, open as open2 } from "node:fs/promises";
2257
- var MAX_CONFIG_BYTES = 32 * 1024;
2258
2318
  var SAFE_REF3 = /^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$/u;
2259
2319
  var HOST_PRODUCER_CONFIG_FLAG = "--ceal-host-config";
2260
2320
  var HostProducerServiceError = class extends Error {
@@ -2265,7 +2325,8 @@ var HostProducerServiceError = class extends Error {
2265
2325
  this.code = code3;
2266
2326
  }
2267
2327
  };
2268
- var HOST_PRODUCER_CONFIG_KEYS = ["schema_version", "host_source_ref", "producer_installation_ref", "producer_epoch", "outbox_dir", "relay_endpoint", "reconcile_interval_ms", "retry_backoff_ms", "ipc_timeout_ms"];
2328
+ var HOST_PRODUCER_CONFIG_KEYS = ["schema_version", "host_source_ref", "producer_installation_ref", "producer_epoch", "outbox_dir", "relay_endpoint"];
2329
+ var HOST_PRODUCER_TIMING_DEFAULTS = Object.freeze({ reconcile_interval_ms: 250, retry_backoff_ms: 1e3, ipc_timeout_ms: 5e3 });
2269
2330
  function parseHostProducerConfigFlag(args, platform = process.platform) {
2270
2331
  return parseProducerHostConfigFlag(args, HOST_PRODUCER_CONFIG_FLAG, platform, hostProducerError);
2271
2332
  }
@@ -2304,15 +2365,17 @@ async function readProducerConfigText(configPath, platform, error) {
2304
2365
  const noFollow = typeof constants.O_NOFOLLOW === "number" ? constants.O_NOFOLLOW : 0;
2305
2366
  const handle = await openConfigFile(configPath, constants.O_RDONLY | noFollow, error);
2306
2367
  try {
2307
- validateOpenedFile(await handle.stat(), pathStat, platform, error);
2308
- return await readBoundedConfig(handle, error);
2368
+ const opened = await handle.stat();
2369
+ validateConfigFile(opened, platform, error);
2370
+ validateOpenedFile(opened, pathStat, platform, error);
2371
+ return await readBoundedConfig(handle, opened.size, error);
2309
2372
  } finally {
2310
2373
  await handle.close();
2311
2374
  }
2312
2375
  }
2313
2376
  function decodeProducerConfigCore(text, options) {
2314
2377
  const value = parseCanonicalJson(text, options.error);
2315
- if (!isRecord(value) || !hasExactKeys2(value, options.keys) || value.schema_version !== options.schema) throw options.error("invalid_config");
2378
+ if (!isRecord(value) || !hasConfigKeys(value, options.keys) || value.schema_version !== options.schema) throw options.error("invalid_config");
2316
2379
  const hostSourceRef = typeof value.host_source_ref === "string" ? value.host_source_ref : "";
2317
2380
  const installationRef = typeof value.producer_installation_ref === "string" ? value.producer_installation_ref : "";
2318
2381
  const producerEpoch = validateIdentity(hostSourceRef, installationRef, value.producer_epoch, options.error);
@@ -2323,7 +2386,7 @@ function decodeProducerConfigCore(text, options) {
2323
2386
  assertProducerAbsolutePath(value[key], options.platform, "runtime", options.error);
2324
2387
  extraPaths[key] = value[key];
2325
2388
  }
2326
- const intervals = validateIntervals(value.reconcile_interval_ms, value.retry_backoff_ms, value.ipc_timeout_ms, options.error);
2389
+ const intervals = validateIntervals(value.reconcile_interval_ms === void 0 ? HOST_PRODUCER_TIMING_DEFAULTS.reconcile_interval_ms : value.reconcile_interval_ms, value.retry_backoff_ms === void 0 ? HOST_PRODUCER_TIMING_DEFAULTS.retry_backoff_ms : value.retry_backoff_ms, value.ipc_timeout_ms === void 0 ? HOST_PRODUCER_TIMING_DEFAULTS.ipc_timeout_ms : value.ipc_timeout_ms, options.error);
2327
2390
  return {
2328
2391
  extra_paths: Object.freeze(extraPaths),
2329
2392
  host_source_ref: hostSourceRef,
@@ -2352,7 +2415,7 @@ async function configPathStat(configPath, error) {
2352
2415
  }
2353
2416
  function validateConfigFile(value, platform, error) {
2354
2417
  if (!value.isFile() || value.isSymbolicLink()) throw error("invalid_config", refusalFacts([{ name: "config_is_file", value: value.isFile(), expected: "true" }, { name: "config_is_symlink", value: value.isSymbolicLink(), expected: "false" }]));
2355
- if (value.size <= 0 || value.size > MAX_CONFIG_BYTES) throw error("invalid_config", refusalFact("config_bytes", value.size, `between 1 and ${MAX_CONFIG_BYTES}`));
2418
+ if (value.size <= 0 || value.size > CEAL_ENCODED_JSON_DOCUMENT_MAX_BYTES) throw error("invalid_config", refusalFact("config_bytes", value.size, `between 1 and ${CEAL_ENCODED_JSON_DOCUMENT_MAX_BYTES}`));
2356
2419
  if (platform !== "win32" && (value.uid !== process.getuid?.() || (value.mode & 63) !== 0)) throw error("config_not_private", refusalFacts([{ name: "platform", value: platform, expected: "win32 or owner-private" }, { name: "config_uid", value: value.uid, expected: "the current user" }, { name: "config_mode", value: value.mode, expected: "owner-private" }]));
2357
2420
  }
2358
2421
  async function openConfigFile(configPath, flags, error) {
@@ -2366,12 +2429,17 @@ function validateOpenedFile(opened, pathStat, platform, error) {
2366
2429
  if (!opened.isFile()) throw error("config_unavailable", refusalFacts([{ name: "opened_is_file", value: opened.isFile(), expected: "true" }, { name: "opened_mode", value: opened.mode.toString(8), expected: "a regular file mode" }]));
2367
2430
  if (platform !== "win32" && (opened.dev !== pathStat.dev || opened.ino !== pathStat.ino)) throw error("config_unavailable", refusalFacts([{ name: "platform", value: platform, expected: "win32, or the same file the path named" }, { name: "opened_device", value: opened.dev, expected: String(pathStat.dev) }, { name: "opened_inode", value: opened.ino, expected: String(pathStat.ino) }]));
2368
2431
  }
2369
- async function readBoundedConfig(handle, error) {
2370
- const buffer = Buffer.allocUnsafe(MAX_CONFIG_BYTES + 1);
2371
- const { bytesRead } = await handle.read(buffer, 0, buffer.byteLength, 0);
2372
- if (bytesRead === 0 || bytesRead > MAX_CONFIG_BYTES) throw error("invalid_config", refusalFact("bytes_read", bytesRead, `between 1 and ${MAX_CONFIG_BYTES}`));
2432
+ async function readBoundedConfig(handle, expectedBytes, error) {
2433
+ const buffer = Buffer.allocUnsafe(expectedBytes + 1);
2434
+ let offset = 0;
2435
+ while (offset < buffer.byteLength) {
2436
+ const { bytesRead } = await handle.read(buffer, offset, buffer.byteLength - offset, offset);
2437
+ if (bytesRead === 0) break;
2438
+ offset += bytesRead;
2439
+ }
2440
+ if (offset !== expectedBytes) throw error("invalid_config", refusalFact("bytes_read", offset, `the opened file's ${expectedBytes} bytes without growth or truncation`));
2373
2441
  try {
2374
- return new TextDecoder("utf-8", { fatal: true }).decode(buffer.subarray(0, bytesRead));
2442
+ return new TextDecoder("utf-8", { fatal: true }).decode(buffer.subarray(0, offset));
2375
2443
  } catch {
2376
2444
  throw error("invalid_config");
2377
2445
  }
@@ -2399,9 +2467,8 @@ function validateIntervals(reconcile, retry, timeout, error) {
2399
2467
  if (!boundedMilliseconds(reconcile) || !boundedMilliseconds(retry) || !boundedMilliseconds(timeout)) throw error("invalid_config");
2400
2468
  return [reconcile, retry, timeout];
2401
2469
  }
2402
- function hasExactKeys2(value, keys) {
2403
- const observed = Object.keys(value);
2404
- return observed.length === keys.length && keys.every((key) => Object.hasOwn(value, key));
2470
+ function hasConfigKeys(value, required) {
2471
+ return required.every((key) => Object.hasOwn(value, key)) && Object.keys(value).every((key) => required.includes(key) || Object.hasOwn(HOST_PRODUCER_TIMING_DEFAULTS, key));
2405
2472
  }
2406
2473
  function isRecord(value) {
2407
2474
  return value !== null && typeof value === "object" && !Array.isArray(value);