@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.
- package/bin/ceal-host +0 -0
- package/libexec/ceal-host/claude-hook.mjs +241 -169
- package/libexec/ceal-host/claude-invocation-authentication.mjs +238 -171
- package/libexec/ceal-host/claude-producer.mjs +241 -169
- package/libexec/ceal-host/codex-hook.mjs +241 -169
- package/libexec/ceal-host/codex-invocation-authentication.mjs +238 -171
- package/libexec/ceal-host/codex-producer.mjs +241 -169
- package/libexec/ceal-host/control.mjs +245 -173
- package/libexec/ceal-host/relay.mjs +217 -156
- package/package.json +1 -1
- package/share/ceal-host/bundle-manifest.json +12 -12
- package/share/ceal-host/bundle-manifest.sigstore.json +1 -1
|
@@ -62,7 +62,6 @@ var client_wire_contract_default = {
|
|
|
62
62
|
length: 72,
|
|
63
63
|
pattern: "^catalog:[a-f0-9]{64}$"
|
|
64
64
|
},
|
|
65
|
-
max_bytes: 4194304,
|
|
66
65
|
envelope_max_bytes: 389
|
|
67
66
|
},
|
|
68
67
|
command_request: {
|
|
@@ -143,14 +142,13 @@ var client_wire_contract_default = {
|
|
|
143
142
|
"prompt"
|
|
144
143
|
],
|
|
145
144
|
discovery_command: "discovery",
|
|
146
|
-
discovery_manifest_schema_version: "ceal.discovery_manifest.
|
|
145
|
+
discovery_manifest_schema_version: "ceal.discovery_manifest.v1",
|
|
147
146
|
discovery_manifest_document_fields: [
|
|
148
147
|
"discovery_manifest"
|
|
149
148
|
],
|
|
150
149
|
exit_code_max: 125,
|
|
151
150
|
bare_document_max_bytes: 65536,
|
|
152
|
-
complete_max_bytes: 66019
|
|
153
|
-
absolute_transport_max_bytes: 4194304
|
|
151
|
+
complete_max_bytes: 66019
|
|
154
152
|
},
|
|
155
153
|
resource_stream: {
|
|
156
154
|
path: "/api/ceal/v2/resources",
|
|
@@ -165,6 +163,9 @@ var client_wire_contract_default = {
|
|
|
165
163
|
"fetch"
|
|
166
164
|
],
|
|
167
165
|
ref_flag: "--ref"
|
|
166
|
+
},
|
|
167
|
+
encoded_json_document: {
|
|
168
|
+
max_bytes: 4194304
|
|
168
169
|
}
|
|
169
170
|
};
|
|
170
171
|
|
|
@@ -174,6 +175,7 @@ var commandResolution = CEAL_CLIENT_WIRE_CONTRACT.command_resolution;
|
|
|
174
175
|
var commandResolutionAuthority = commandResolution.authority;
|
|
175
176
|
var commandResolutionSemanticOptions = commandResolution.semantic_options;
|
|
176
177
|
var CEAL_GATEWAY_COMMAND_RESOLUTION_SCHEMA_VERSION = commandResolution.schema_version;
|
|
178
|
+
var CEAL_ENCODED_JSON_DOCUMENT_MAX_BYTES = CEAL_CLIENT_WIRE_CONTRACT.encoded_json_document.max_bytes;
|
|
177
179
|
var artifact = CEAL_CLIENT_WIRE_CONTRACT.artifact_descriptor;
|
|
178
180
|
var request = CEAL_CLIENT_WIRE_CONTRACT.command_request;
|
|
179
181
|
var response = CEAL_CLIENT_WIRE_CONTRACT.command_response;
|
|
@@ -187,7 +189,7 @@ var CEAL_VERIFIED_ARTIFACT_DIGEST_LENGTH = artifact.digest.length;
|
|
|
187
189
|
var CEAL_VERIFIED_ARTIFACT_DIGEST_PATTERN = artifact.digest.pattern;
|
|
188
190
|
var CEAL_VERIFIED_ARTIFACT_CATALOG_REVISION_LENGTH = artifact.catalog_revision.length;
|
|
189
191
|
var CEAL_VERIFIED_ARTIFACT_CATALOG_REVISION_PATTERN = artifact.catalog_revision.pattern;
|
|
190
|
-
var CEAL_VERIFIED_ARTIFACT_MAX_BYTES =
|
|
192
|
+
var CEAL_VERIFIED_ARTIFACT_MAX_BYTES = CEAL_ENCODED_JSON_DOCUMENT_MAX_BYTES;
|
|
191
193
|
var CEAL_VERIFIED_ARTIFACT_DESCRIPTOR_MAX_BYTES = artifact.envelope_max_bytes;
|
|
192
194
|
var CEAL_COMMAND_REQUEST_SCHEMA_VERSION = request.schema_version;
|
|
193
195
|
var CEAL_COMMAND_REQUEST_MAX_BYTES = request.absolute_transport_max_bytes;
|
|
@@ -201,7 +203,6 @@ var CEAL_COMMAND_RESPONSE_FOCUSED_PROMPT_CONTINUATION_DOCUMENT_FIELDS = Object.f
|
|
|
201
203
|
var CEAL_COMMAND_RESPONSE_DISCOVERY_COMMAND = response.discovery_command;
|
|
202
204
|
var CEAL_COMMAND_RESPONSE_DISCOVERY_MANIFEST_SCHEMA_VERSION = response.discovery_manifest_schema_version;
|
|
203
205
|
var CEAL_COMMAND_RESPONSE_DISCOVERY_MANIFEST_DOCUMENT_FIELDS = Object.freeze([...response.discovery_manifest_document_fields]);
|
|
204
|
-
var CEAL_COMMAND_RESPONSE_MAX_BYTES = response.absolute_transport_max_bytes;
|
|
205
206
|
|
|
206
207
|
// packages/ceal-client-protocol/src/vocabulary.ts
|
|
207
208
|
function vocabulary(words) {
|
|
@@ -215,6 +216,7 @@ var CEAL_AUDIT_OUTCOMES = vocabulary(["succeeded", "denied", "failed"]);
|
|
|
215
216
|
var CEAL_GATEWAY_PROVIDER_STEP_OUTCOMES = vocabulary(["completed", "rejected", "throttled", "failed"]);
|
|
216
217
|
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"]);
|
|
217
218
|
var CEAL_GATEWAY_READ_REUSE_UNAVAILABLE_REASONS = vocabulary(["not_reported", "storage_unavailable", "coverage_incomplete", "freshness_refresh_required", "not_reusable", "bypassed"]);
|
|
219
|
+
var CEAL_GATEWAY_DERIVED_STORE_FAILURE_CLASSES = vocabulary(["storage_unavailable", "decode_mismatch", "write_conflict", "quota", "store_error"]);
|
|
218
220
|
var CEAL_POLICY_DECISIONS = vocabulary(["allowed", "denied", "not_evaluated"]);
|
|
219
221
|
var CEAL_CONNECTOR_ROUTE_PHASES = vocabulary(["scope_observation", "target_selection", "route_resolution"]);
|
|
220
222
|
var CEAL_CONNECTOR_ROUTE_CAUSES = vocabulary(["provider_throttled", "provider_unavailable", "binding_invalid", "scope_limit_exceeded"]);
|
|
@@ -228,6 +230,17 @@ var CEAL_WRITE_RECEIPT_PROVIDER_STATES = vocabulary(["outcome_unknown", "verifie
|
|
|
228
230
|
var CEAL_WRITE_RECEIPT_PROVIDER_READBACKS = vocabulary(["outcome_unknown", "verified", "not_applied"]);
|
|
229
231
|
var CEAL_PROTOCOL_VERSION = "1.4.0";
|
|
230
232
|
var CEAL_OPERATION_ACCESS_SCHEMA_VERSION = "ceal.operation_access.v1";
|
|
233
|
+
var CEAL_GATEWAY_ACTIVE_CALL_PHASES = vocabulary([
|
|
234
|
+
"audited_call_pending",
|
|
235
|
+
"continuation_read_pending",
|
|
236
|
+
"continuation_write_pending",
|
|
237
|
+
"provider_pacing_pending",
|
|
238
|
+
"corpus_replay_pending",
|
|
239
|
+
"corpus_append_pending",
|
|
240
|
+
"corpus_fence_pending",
|
|
241
|
+
"corpus_content_pending",
|
|
242
|
+
"corpus_transaction_pending"
|
|
243
|
+
]);
|
|
231
244
|
var CEAL_CONNECTOR_ROUTE_FAILURE_KEYS = vocabulary(["connector_kind", "phase", "schema_version"]);
|
|
232
245
|
var CEAL_CLASSIFIED_CONNECTOR_ROUTE_FAILURE_KEYS = vocabulary(["cause", ...CEAL_CONNECTOR_ROUTE_FAILURE_KEYS]);
|
|
233
246
|
var CEAL_UNCLASSIFIED_CONNECTOR_ROUTE_FAILURE_KEYS = vocabulary(["connector_kind", "error_class", "phase", "schema_version"]);
|
|
@@ -237,10 +250,129 @@ var CEAL_GATEWAY_ORGANIZATION_ROUTE_FACT_CALL_KEYS = Object.freeze([
|
|
|
237
250
|
"policy_decision_revision"
|
|
238
251
|
]);
|
|
239
252
|
|
|
253
|
+
// packages/ceal-client-protocol/src/operation-next-actions.ts
|
|
254
|
+
var CEAL_REPEAT_REQUEST_NEXT_ACTION = "repeat_request";
|
|
255
|
+
var CEAL_INSPECT_RECEIPT_NEXT_ACTION = "inspect_receipt";
|
|
256
|
+
var CALLER_RECOVERABLE_NEXT_ACTION_VALUES = [
|
|
257
|
+
"select_did_you_mean",
|
|
258
|
+
"choose_new_output_path",
|
|
259
|
+
"choose_new_idempotency_key",
|
|
260
|
+
"restart_search",
|
|
261
|
+
"repeat_original_arguments",
|
|
262
|
+
// The occurrence this call addressed is settled and cannot move again -- a
|
|
263
|
+
// denied effect approval, an expired continuation -- so the caller runs the
|
|
264
|
+
// same call again as a new request. The refusal names the re-request; this
|
|
265
|
+
// word is the re-request.
|
|
266
|
+
CEAL_REPEAT_REQUEST_NEXT_ACTION,
|
|
267
|
+
"choose_new_request_identity",
|
|
268
|
+
// A refusal that names the argument (invalid_argument with `property`) tells the caller exactly what to change.
|
|
269
|
+
"correct_argument",
|
|
270
|
+
// A resolver-owned input must move from caller operands into the declared
|
|
271
|
+
// resolver selection field.
|
|
272
|
+
"supply_resolver_selections",
|
|
273
|
+
// The graph names an upstream node whose Operation produces the resolver's
|
|
274
|
+
// occurrence, and it has not produced one yet. The caller runs that node
|
|
275
|
+
// first; the refusal used to share a code with a malformed resolver result,
|
|
276
|
+
// which is not fixable, so neither could carry a remedy.
|
|
277
|
+
"run_resolver_dependency",
|
|
278
|
+
// A replay carries the input the occurrence durably admitted, and this one
|
|
279
|
+
// carries a different one. The caller fixes it by presenting the original
|
|
280
|
+
// invocation, so it is a remedy; the coordinator minted the word at the
|
|
281
|
+
// replay guard and never declared it, which read as unguided to the scorer.
|
|
282
|
+
"use_original_input",
|
|
283
|
+
// The same mismatch on the Request binding rather than the input: the
|
|
284
|
+
// occurrence was admitted under one binding and the replay presents another.
|
|
285
|
+
"use_original_request_binding",
|
|
286
|
+
// The client's own filesystem write was refused -- EACCES, EPERM, or a
|
|
287
|
+
// read-only mount -- which is how an agent sandbox fences writes outside its
|
|
288
|
+
// workspace. The caller reruns the same command with unsandboxed or escalated
|
|
289
|
+
// execution; re-adopting the session cannot help, because the sandbox refuses
|
|
290
|
+
// that write too.
|
|
291
|
+
"rerun_outside_agent_sandbox",
|
|
292
|
+
// The refusal names the one Operation to read next in `describe_command`:
|
|
293
|
+
// an absent Operation id with a sole catalog-ranked candidate, or a known
|
|
294
|
+
// Operation invoked without its input. Describing only reads the verified
|
|
295
|
+
// contract and dispatches nothing, and the caller then retries with the
|
|
296
|
+
// named Operation or input, so it is guidance the scorer counts.
|
|
297
|
+
"describe_operation",
|
|
298
|
+
// The refusal names the caller's own personal connect Operation in
|
|
299
|
+
// `required_action_sequence`: the Operation asked for, or the credential
|
|
300
|
+
// the call ran on, needs a personal connection the caller does not hold
|
|
301
|
+
// (never connected, revoked, or expired). The caller runs that exact
|
|
302
|
+
// Operation, completes the consent it hands back, and retries the same call.
|
|
303
|
+
"connect_personal_account",
|
|
304
|
+
// The provider or Gateway named a bounded wait; the caller waits that long
|
|
305
|
+
// and submits the same read again.
|
|
306
|
+
"retry_after",
|
|
307
|
+
// The ref names a container of rows (a Notion database or data source), which
|
|
308
|
+
// has no body of its own; the caller searches its rows instead of reading it.
|
|
309
|
+
"search_container_rows"
|
|
310
|
+
];
|
|
311
|
+
var CEAL_CALLER_RECOVERABLE_NEXT_ACTIONS = Object.freeze(CALLER_RECOVERABLE_NEXT_ACTION_VALUES);
|
|
312
|
+
var NON_REMEDY_NEXT_ACTION_VALUES = [
|
|
313
|
+
// Only an administrator can take the named step -- approving a place for an
|
|
314
|
+
// Operation, granting a withheld capability -- so a non-administrator asks
|
|
315
|
+
// one. The refusal names the administrator step; this word is the ask.
|
|
316
|
+
"ask_admin",
|
|
317
|
+
"await_pending_approval",
|
|
318
|
+
"check_gateway",
|
|
319
|
+
"inspect_context_store",
|
|
320
|
+
"inspect_gateway",
|
|
321
|
+
"inspect_local_cache",
|
|
322
|
+
// The thin client prints these on its own behalf, before or after the wire.
|
|
323
|
+
// They were declared only as `CealClientLocalRemedy` keys and, for two of
|
|
324
|
+
// them, only as Go string literals -- a second and third vocabulary for one
|
|
325
|
+
// thing. `CealClientLocalRemedy` derives from this list now, so the client's
|
|
326
|
+
// remedies cannot drift from the words the protocol knows.
|
|
327
|
+
"inspect_local_client",
|
|
328
|
+
"inspect_local_command",
|
|
329
|
+
"inspect_local_output",
|
|
330
|
+
"inspect_local_route",
|
|
331
|
+
CEAL_INSPECT_RECEIPT_NEXT_ACTION,
|
|
332
|
+
"inspect_request",
|
|
333
|
+
"none",
|
|
334
|
+
// The provider refused because of its own configuration -- an API not
|
|
335
|
+
// enabled, an app scope missing -- which an operator changes in that
|
|
336
|
+
// provider's console. No caller edit and no retry fixes it.
|
|
337
|
+
"operator_action",
|
|
338
|
+
"recover",
|
|
339
|
+
"reconcile",
|
|
340
|
+
// Reconciliation of one named occurrence, not of the deployment: an
|
|
341
|
+
// occurrence with no admitted input commitment cannot be replayed safely and
|
|
342
|
+
// no edit to the call changes that. `reconcile` is the deployment-wide word.
|
|
343
|
+
"reconcile_occurrence",
|
|
344
|
+
"reduce_request_size",
|
|
345
|
+
// The Host's invocation context for this turn is stale or expired at the
|
|
346
|
+
// Gateway. The Host's next turn rebinds it and the same call then succeeds;
|
|
347
|
+
// nothing in the call changes, so it is not a remedy the scorer may count.
|
|
348
|
+
"refresh_host_invocation_context",
|
|
349
|
+
"repair_or_adopt_session",
|
|
350
|
+
"retry",
|
|
351
|
+
// The owner -- a correlation hook, an approval hook -- is not serving right
|
|
352
|
+
// now. The caller changes nothing and the same call succeeds once the owner
|
|
353
|
+
// is back, so this is not a remedy the scorer may count as guidance.
|
|
354
|
+
"retry_after_owner_recovery",
|
|
355
|
+
"retry_same_receipt_read",
|
|
356
|
+
"run_file_search_again",
|
|
357
|
+
"select_exact_approval"
|
|
358
|
+
];
|
|
359
|
+
var CEAL_NON_REMEDY_NEXT_ACTIONS = Object.freeze(NON_REMEDY_NEXT_ACTION_VALUES);
|
|
360
|
+
var DECLARED = /* @__PURE__ */ new Set([...CEAL_CALLER_RECOVERABLE_NEXT_ACTIONS, ...CEAL_NON_REMEDY_NEXT_ACTIONS]);
|
|
361
|
+
var RETRY_PROMISE_NEXT_ACTIONS = ["retry", "retry_after"];
|
|
362
|
+
var RETRY_PROMISE = new Set(RETRY_PROMISE_NEXT_ACTIONS);
|
|
363
|
+
var RECOVERABLE = new Set(CEAL_CALLER_RECOVERABLE_NEXT_ACTIONS);
|
|
364
|
+
var CEAL_OPERATION_WITHHELD_NEXT_ACTIONS = Object.freeze({
|
|
365
|
+
provider_permission: "ask_admin",
|
|
366
|
+
access_level: "ask_admin",
|
|
367
|
+
personal_authorization_required: "connect_personal_account"
|
|
368
|
+
});
|
|
369
|
+
|
|
370
|
+
// packages/ceal-client-protocol/src/operation-withheld-cause.ts
|
|
371
|
+
var CEAL_OPERATION_WITHHELD_CAUSES = vocabulary(["provider_permission", "access_level", "personal_authorization_required"]);
|
|
372
|
+
|
|
240
373
|
// packages/ceal-client-protocol/src/operation-contract-types.ts
|
|
241
374
|
var CEAL_JSON_SCHEMA_2020_12 = "https://json-schema.org/draft/2020-12/schema";
|
|
242
375
|
var CEAL_OPERATION_ERROR_SCHEMA_VERSION = "ceal.operation_error.v1";
|
|
243
|
-
var CEAL_OPERATION_WITHHELD_CAUSES = vocabulary(["provider_permission", "access_level", "personal_authorization_required"]);
|
|
244
376
|
var CEAL_RETRY_AFTER_MAX_MS = 60 * 60 * 1e3;
|
|
245
377
|
var CEAL_JSON_SCHEMA_TYPES = vocabulary(["object", "array", "string", "integer", "number", "boolean", "null"]);
|
|
246
378
|
var OBSERVATION_POSTURES = vocabulary(["direct_readback", "approved_no_readback", "operator_mediated", "excluded"]);
|
|
@@ -492,7 +624,6 @@ function cut(text) {
|
|
|
492
624
|
var CEAL_OPERATION_ACCESS_CLASSES = vocabulary(["read", "write"]);
|
|
493
625
|
|
|
494
626
|
// packages/ceal-client-protocol/src/domain-vocabulary.ts
|
|
495
|
-
var CEAL_INTEGRATION_KINDS = vocabulary(["github", "google-workspace", "notion", "slack"]);
|
|
496
627
|
var CEAL_CONNECTOR_STATUSES = vocabulary(["active", "disabled", "disconnected"]);
|
|
497
628
|
var CEAL_CONNECTOR_CUSTODIES = vocabulary(["organization", "personal"]);
|
|
498
629
|
var CEAL_PROVIDER_BOUNDARY_KINDS = vocabulary([
|
|
@@ -505,6 +636,8 @@ var CEAL_PROVIDER_BOUNDARY_KINDS = vocabulary([
|
|
|
505
636
|
var CEAL_PROVIDER_BOUNDARY_EVIDENCE = vocabulary(["provider_readback", "operator_stated"]);
|
|
506
637
|
var CEAL_ACCESS_LEVELS = vocabulary(["none", "read", "read_write"]);
|
|
507
638
|
var CEAL_PERSONAL_ACCESS_CEILINGS = vocabulary(["disabled", "read", "read_write"]);
|
|
639
|
+
var CEAL_TARGET_REF_PATTERN = "^[^\\p{Cc}]+$";
|
|
640
|
+
var TARGET_REF = new RegExp(CEAL_TARGET_REF_PATTERN, "u");
|
|
508
641
|
var CEAL_TARGET_VISIBILITIES = vocabulary(["public", "private"]);
|
|
509
642
|
var CEAL_PRINCIPAL_KINDS = vocabulary(["human", "service", "runtime"]);
|
|
510
643
|
var CEAL_ORGANIZATION_ROLES = vocabulary(["member", "admin"]);
|
|
@@ -615,6 +748,7 @@ var CEAL_OPERATION_DESCRIPTOR_REQUIRED_ENVELOPE_KEYS = Object.freeze(["schema_ve
|
|
|
615
748
|
var CEAL_OPERATION_DESCRIPTOR_OPTIONAL_ENVELOPE_KEYS = Object.freeze(["input_resolution", "summary"]);
|
|
616
749
|
var CEAL_OPERATION_RESULT_KEYS = vocabulary(["ok", "operation_id", "operation_receipt", "schema_version", "value"]);
|
|
617
750
|
var CEAL_OPERATION_COMPACT_RESULT_KEYS = vocabulary(["ok", "operation_evidence", "operation_id", "schema_version", "value"]);
|
|
751
|
+
var CEAL_OPERATION_RESULT_OPTIONAL_KEYS = vocabulary(["model_disclosure", "result_complete", "resume"]);
|
|
618
752
|
|
|
619
753
|
// packages/ceal-client-protocol/src/operation-catalog.ts
|
|
620
754
|
var CEAL_OPERATION_CATALOG_SCHEMA_VERSION = "ceal.catalog.v3";
|
|
@@ -626,8 +760,8 @@ var CEAL_SCHEMA_LITERALS = [
|
|
|
626
760
|
"ceal.activation_transport.v1",
|
|
627
761
|
CEAL_OPERATION_ACCESS_SCHEMA_VERSION,
|
|
628
762
|
CEAL_OPERATION_CATALOG_SCHEMA_VERSION,
|
|
629
|
-
"ceal.client_refresh_request.
|
|
630
|
-
"ceal.client_refresh_result.
|
|
763
|
+
"ceal.client_refresh_request.v1",
|
|
764
|
+
"ceal.client_refresh_result.v1",
|
|
631
765
|
"ceal.client_revoke_request.v1",
|
|
632
766
|
"ceal.client_revoke_result.v1",
|
|
633
767
|
CEAL_COMMAND_REQUEST_SCHEMA_VERSION,
|
|
@@ -656,7 +790,7 @@ var CEAL_SCHEMA_LITERALS = [
|
|
|
656
790
|
"ceal.gateway_call_result.v1",
|
|
657
791
|
CEAL_GATEWAY_COMMAND_RESOLUTION_SCHEMA_VERSION,
|
|
658
792
|
"ceal.gateway_connector_route_failure.v1",
|
|
659
|
-
"ceal.gateway_discovery.
|
|
793
|
+
"ceal.gateway_discovery.v1",
|
|
660
794
|
"ceal.gateway_handshake.v1",
|
|
661
795
|
"ceal.gateway_installation_activation_code_issue_request.v1",
|
|
662
796
|
"ceal.gateway_installation_activation_code_issue_result.v1",
|
|
@@ -678,10 +812,10 @@ var CEAL_SCHEMA_LITERALS = [
|
|
|
678
812
|
"ceal.host_observation.v1",
|
|
679
813
|
"ceal.host_registration_request.v1",
|
|
680
814
|
"ceal.host_registration_result.v1",
|
|
681
|
-
"ceal.leased-resource-stream.
|
|
682
|
-
"ceal.leased_consumer_attachment_stream_frame.
|
|
683
|
-
"ceal.leased_consumer_attachment_stream_request.
|
|
684
|
-
"ceal.leased_consumer_attachment_stream_transport.
|
|
815
|
+
"ceal.leased-resource-stream.v1",
|
|
816
|
+
"ceal.leased_consumer_attachment_stream_frame.v1",
|
|
817
|
+
"ceal.leased_consumer_attachment_stream_request.v1",
|
|
818
|
+
"ceal.leased_consumer_attachment_stream_transport.v1",
|
|
685
819
|
"ceal.operation_descriptor.v1",
|
|
686
820
|
"ceal.operation_error.v1",
|
|
687
821
|
"ceal.operation_failure.v1",
|
|
@@ -689,7 +823,7 @@ var CEAL_SCHEMA_LITERALS = [
|
|
|
689
823
|
"ceal.operation_receipt.v1",
|
|
690
824
|
"ceal.operation_result.v1",
|
|
691
825
|
"ceal.operation_result.compact.v1",
|
|
692
|
-
"ceal.local_result_materialization.
|
|
826
|
+
"ceal.local_result_materialization.v1",
|
|
693
827
|
"ceal.local_result_root.v1",
|
|
694
828
|
"ceal.owner_bootstrap_exchange_request.v1",
|
|
695
829
|
"ceal.owner_bootstrap_exchange_result.v1",
|
|
@@ -774,117 +908,8 @@ var CEAL_AGENT_SERVICE_SESSION_RECORD_KEYS = vocabulary([
|
|
|
774
908
|
]);
|
|
775
909
|
var CEAL_AGENT_SESSION_COMMIT_KEYS = vocabulary(["attempt_ref", "expected_session_revision", "session_revision"]);
|
|
776
910
|
|
|
777
|
-
// packages/ceal-client-protocol/src/operation-
|
|
778
|
-
var
|
|
779
|
-
var CEAL_INSPECT_RECEIPT_NEXT_ACTION = "inspect_receipt";
|
|
780
|
-
var CALLER_RECOVERABLE_NEXT_ACTION_VALUES = [
|
|
781
|
-
"select_did_you_mean",
|
|
782
|
-
"choose_new_output_path",
|
|
783
|
-
"choose_new_idempotency_key",
|
|
784
|
-
"restart_search",
|
|
785
|
-
"repeat_original_arguments",
|
|
786
|
-
// The occurrence this call addressed is settled and cannot move again -- a
|
|
787
|
-
// denied effect approval, an expired continuation -- so the caller runs the
|
|
788
|
-
// same call again as a new request. The refusal names the re-request; this
|
|
789
|
-
// word is the re-request.
|
|
790
|
-
CEAL_REPEAT_REQUEST_NEXT_ACTION,
|
|
791
|
-
"choose_new_request_identity",
|
|
792
|
-
// A refusal that names the argument (invalid_argument with `property`) tells the caller exactly what to change.
|
|
793
|
-
"correct_argument",
|
|
794
|
-
// A resolver-owned input must move from caller operands into the declared
|
|
795
|
-
// resolver selection field.
|
|
796
|
-
"supply_resolver_selections",
|
|
797
|
-
// The graph names an upstream node whose Operation produces the resolver's
|
|
798
|
-
// occurrence, and it has not produced one yet. The caller runs that node
|
|
799
|
-
// first; the refusal used to share a code with a malformed resolver result,
|
|
800
|
-
// which is not fixable, so neither could carry a remedy.
|
|
801
|
-
"run_resolver_dependency",
|
|
802
|
-
// A replay carries the input the occurrence durably admitted, and this one
|
|
803
|
-
// carries a different one. The caller fixes it by presenting the original
|
|
804
|
-
// invocation, so it is a remedy; the coordinator minted the word at the
|
|
805
|
-
// replay guard and never declared it, which read as unguided to the scorer.
|
|
806
|
-
"use_original_input",
|
|
807
|
-
// The same mismatch on the Request binding rather than the input: the
|
|
808
|
-
// occurrence was admitted under one binding and the replay presents another.
|
|
809
|
-
"use_original_request_binding",
|
|
810
|
-
// The client's own filesystem write was refused -- EACCES, EPERM, or a
|
|
811
|
-
// read-only mount -- which is how an agent sandbox fences writes outside its
|
|
812
|
-
// workspace. The caller reruns the same command with unsandboxed or escalated
|
|
813
|
-
// execution; re-adopting the session cannot help, because the sandbox refuses
|
|
814
|
-
// that write too.
|
|
815
|
-
"rerun_outside_agent_sandbox",
|
|
816
|
-
// The refusal names the one Operation to read next in `describe_command`:
|
|
817
|
-
// an absent Operation id with a sole catalog-ranked candidate, or a known
|
|
818
|
-
// Operation invoked without its input. Describing only reads the verified
|
|
819
|
-
// contract and dispatches nothing, and the caller then retries with the
|
|
820
|
-
// named Operation or input, so it is guidance the scorer counts.
|
|
821
|
-
"describe_operation",
|
|
822
|
-
// The refusal names the caller's own personal connect Operation in
|
|
823
|
-
// `required_action_sequence`: the Operation asked for, or the credential
|
|
824
|
-
// the call ran on, needs a personal connection the caller does not hold
|
|
825
|
-
// (never connected, revoked, or expired). The caller runs that exact
|
|
826
|
-
// Operation, completes the consent it hands back, and retries the same call.
|
|
827
|
-
"connect_personal_account",
|
|
828
|
-
// The provider or Gateway named a bounded wait; the caller waits that long
|
|
829
|
-
// and submits the same read again.
|
|
830
|
-
"retry_after"
|
|
831
|
-
];
|
|
832
|
-
var CEAL_CALLER_RECOVERABLE_NEXT_ACTIONS = Object.freeze(CALLER_RECOVERABLE_NEXT_ACTION_VALUES);
|
|
833
|
-
var NON_REMEDY_NEXT_ACTION_VALUES = [
|
|
834
|
-
// Only an administrator can take the named step -- approving a place for an
|
|
835
|
-
// Operation, granting a withheld capability -- so a non-administrator asks
|
|
836
|
-
// one. The refusal names the administrator step; this word is the ask.
|
|
837
|
-
"ask_admin",
|
|
838
|
-
"await_pending_approval",
|
|
839
|
-
"check_gateway",
|
|
840
|
-
"inspect_context_store",
|
|
841
|
-
"inspect_gateway",
|
|
842
|
-
"inspect_local_cache",
|
|
843
|
-
// The thin client prints these on its own behalf, before or after the wire.
|
|
844
|
-
// They were declared only as `CealClientLocalRemedy` keys and, for two of
|
|
845
|
-
// them, only as Go string literals -- a second and third vocabulary for one
|
|
846
|
-
// thing. `CealClientLocalRemedy` derives from this list now, so the client's
|
|
847
|
-
// remedies cannot drift from the words the protocol knows.
|
|
848
|
-
"inspect_local_client",
|
|
849
|
-
"inspect_local_command",
|
|
850
|
-
"inspect_local_output",
|
|
851
|
-
"inspect_local_route",
|
|
852
|
-
CEAL_INSPECT_RECEIPT_NEXT_ACTION,
|
|
853
|
-
"inspect_request",
|
|
854
|
-
"none",
|
|
855
|
-
// The provider refused because of its own configuration -- an API not
|
|
856
|
-
// enabled, an app scope missing -- which an operator changes in that
|
|
857
|
-
// provider's console. No caller edit and no retry fixes it.
|
|
858
|
-
"operator_action",
|
|
859
|
-
"recover",
|
|
860
|
-
"reconcile",
|
|
861
|
-
// Reconciliation of one named occurrence, not of the deployment: a legacy
|
|
862
|
-
// occurrence with no admitted input commitment cannot be replayed safely and
|
|
863
|
-
// no edit to the call changes that. `reconcile` is the deployment-wide word.
|
|
864
|
-
"reconcile_occurrence",
|
|
865
|
-
"reduce_request_size",
|
|
866
|
-
// The Host's invocation context for this turn is stale or expired at the
|
|
867
|
-
// Gateway. The Host's next turn rebinds it and the same call then succeeds;
|
|
868
|
-
// nothing in the call changes, so it is not a remedy the scorer may count.
|
|
869
|
-
"refresh_host_invocation_context",
|
|
870
|
-
"repair_or_adopt_session",
|
|
871
|
-
"retry",
|
|
872
|
-
// The owner -- a correlation hook, an approval hook -- is not serving right
|
|
873
|
-
// now. The caller changes nothing and the same call succeeds once the owner
|
|
874
|
-
// is back, so this is not a remedy the scorer may count as guidance.
|
|
875
|
-
"retry_after_owner_recovery",
|
|
876
|
-
"retry_same_receipt_read",
|
|
877
|
-
"run_file_search_again",
|
|
878
|
-
"select_exact_approval"
|
|
879
|
-
];
|
|
880
|
-
var CEAL_NON_REMEDY_NEXT_ACTIONS = Object.freeze(NON_REMEDY_NEXT_ACTION_VALUES);
|
|
881
|
-
var DECLARED = /* @__PURE__ */ new Set([...CEAL_CALLER_RECOVERABLE_NEXT_ACTIONS, ...CEAL_NON_REMEDY_NEXT_ACTIONS]);
|
|
882
|
-
var RECOVERABLE = new Set(CEAL_CALLER_RECOVERABLE_NEXT_ACTIONS);
|
|
883
|
-
var CEAL_OPERATION_WITHHELD_NEXT_ACTIONS = Object.freeze({
|
|
884
|
-
provider_permission: "ask_admin",
|
|
885
|
-
access_level: "ask_admin",
|
|
886
|
-
personal_authorization_required: "connect_personal_account"
|
|
887
|
-
});
|
|
911
|
+
// packages/ceal-client-protocol/src/operation-result-completeness.ts
|
|
912
|
+
var CEAL_READ_VALUE_CONTINUATION_KEYS = vocabulary(["continuation", "continuation_ref", "next_cursor"]);
|
|
888
913
|
|
|
889
914
|
// packages/ceal-client-protocol/src/operation-contract-artifact.ts
|
|
890
915
|
var CATALOG_REVISION = new RegExp(CEAL_VERIFIED_ARTIFACT_CATALOG_REVISION_PATTERN, "u");
|
|
@@ -945,7 +970,8 @@ var CEAL_ACTIVITY_GAP_CODES = vocabulary([
|
|
|
945
970
|
"provider_cursor_unavailable",
|
|
946
971
|
"malformed_provider_page",
|
|
947
972
|
"visibility_incomplete",
|
|
948
|
-
"unsupported_event_kind"
|
|
973
|
+
"unsupported_event_kind",
|
|
974
|
+
"direct_messages_excluded"
|
|
949
975
|
]);
|
|
950
976
|
var CEAL_ACTIVITY_CONNECTOR_KINDS = vocabulary(["slack", "github", "google-calendar", "google-drive", "notion"]);
|
|
951
977
|
var CEAL_ACTIVITY_COVERAGE_STATUSES = vocabulary(["complete_for_target", "continuation_required", "blocked"]);
|
|
@@ -956,6 +982,8 @@ var CEAL_ACTIVITY_EVENT_KINDS = vocabulary([
|
|
|
956
982
|
"github.commit.authored",
|
|
957
983
|
"github.issue.opened",
|
|
958
984
|
"github.pull_request.opened",
|
|
985
|
+
"github.issue.edited",
|
|
986
|
+
"github.pull_request.edited",
|
|
959
987
|
"github.review.submitted",
|
|
960
988
|
"github.issue_comment.created",
|
|
961
989
|
"github.review_comment.created",
|
|
@@ -968,6 +996,25 @@ var CEAL_ACTIVITY_EVENT_KINDS = vocabulary([
|
|
|
968
996
|
"notion.page.created",
|
|
969
997
|
"notion.page.edited"
|
|
970
998
|
]);
|
|
999
|
+
var CEAL_ACTIVITY_EVENT_TIMESTAMP_BASIS_MAP = Object.freeze({
|
|
1000
|
+
"slack.message": "message_created",
|
|
1001
|
+
"slack.reply": "message_created",
|
|
1002
|
+
"slack.direct_message": "message_created",
|
|
1003
|
+
"github.commit.authored": "commit_authored",
|
|
1004
|
+
"github.review.submitted": "review_submitted",
|
|
1005
|
+
"github.issue_comment.created": "comment_created",
|
|
1006
|
+
"github.review_comment.created": "comment_created",
|
|
1007
|
+
"github.issue.opened": "resource_created",
|
|
1008
|
+
"github.pull_request.opened": "resource_created",
|
|
1009
|
+
"github.issue.edited": "resource_modified",
|
|
1010
|
+
"github.pull_request.edited": "resource_modified",
|
|
1011
|
+
"calendar.organized": "resource_created",
|
|
1012
|
+
"drive.file.created": "file_created",
|
|
1013
|
+
"drive.file.modified": "file_modified_by_me",
|
|
1014
|
+
"drive.file.viewed": "file_viewed_by_me",
|
|
1015
|
+
"notion.page.created": "page_created",
|
|
1016
|
+
"notion.page.edited": "page_last_edited"
|
|
1017
|
+
});
|
|
971
1018
|
var CEAL_ACTIVITY_TIMESTAMP_BASES = vocabulary([
|
|
972
1019
|
"message_created",
|
|
973
1020
|
"commit_authored",
|
|
@@ -988,11 +1035,12 @@ var CEAL_ACTIVITY_V3_KINDS = vocabulary(["authored", "edited", "messaged", "resp
|
|
|
988
1035
|
var CEAL_RESOURCE_TIME_BASES = vocabulary(["created", "modified", "viewed"]);
|
|
989
1036
|
var CEAL_RESOURCE_SEARCH_ORDERS = vocabulary(["relevance", "modified", "viewed", "created"]);
|
|
990
1037
|
var CEAL_RESOURCE_SEARCH_DIRECTIONS = vocabulary(["ascending", "descending"]);
|
|
991
|
-
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"]);
|
|
1038
|
+
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"]);
|
|
992
1039
|
var CEAL_ARTIFACT_STAGE_TERMINALS = vocabulary(["chunk_accepted", "artifact_ready", "idempotency_replayed"]);
|
|
993
1040
|
var CEAL_READ_ITEM_KINDS = vocabulary(["conversation", "identity", "usergroup", "message", "file", "document"]);
|
|
994
1041
|
var CEAL_LEASED_MESSAGE_SEARCH_COMPLETENESS = vocabulary(["complete", "continuation_available", "truncated"]);
|
|
995
|
-
var CEAL_OPAQUE_HANDLE_KINDS = vocabulary(["target", "message", "thread", "artifact", "document", "object"]);
|
|
1042
|
+
var CEAL_OPAQUE_HANDLE_KINDS = vocabulary(["target", "message", "thread", "artifact", "document", "block", "object"]);
|
|
1043
|
+
var CEAL_OPAQUE_REF_KINDS = vocabulary([...CEAL_OPAQUE_HANDLE_KINDS, "result", "operation-receipt", "reply-receipt", "field", "notion-data-source"]);
|
|
996
1044
|
var CEAL_WRITE_OBJECT_KINDS = vocabulary(["document", "comment", "cell_range"]);
|
|
997
1045
|
var CEAL_CONVERSATION_KINDS = vocabulary(["channel", "dm", "group"]);
|
|
998
1046
|
var CEAL_FILE_TYPE_FAMILIES = vocabulary(["all", "image", "pdf"]);
|
|
@@ -1034,6 +1082,9 @@ var CEAL_FINAL_PRESENTATION_INTENTS = vocabulary(["final", "stop", "transient_no
|
|
|
1034
1082
|
var CEAL_PRESENTATION_INTENTS = vocabulary(["progress", ...CEAL_FINAL_PRESENTATION_INTENTS]);
|
|
1035
1083
|
|
|
1036
1084
|
// packages/ceal-client-protocol/src/resource-row.ts
|
|
1085
|
+
var CEAL_DATED_NOTE_BASES = vocabulary(["recording", "calendar_event", "created_time"]);
|
|
1086
|
+
var CEAL_DATED_NOTE_TRANSCRIPT_STATES = vocabulary(["present", "absent", "unestablished"]);
|
|
1087
|
+
var CEAL_READ_SEARCH_COST_CLASSES = vocabulary(["native_index", "scan"]);
|
|
1037
1088
|
var RESOURCE_ROW_KEY_RULES = Object.freeze({
|
|
1038
1089
|
schema_version: { required: true, timestamp: false },
|
|
1039
1090
|
ref: { required: true, timestamp: false },
|
|
@@ -1042,9 +1093,11 @@ var RESOURCE_ROW_KEY_RULES = Object.freeze({
|
|
|
1042
1093
|
title: { required: true, timestamp: false },
|
|
1043
1094
|
container_label: { required: true, timestamp: false },
|
|
1044
1095
|
container_ref: { required: false, timestamp: false },
|
|
1096
|
+
source_url: { required: false, timestamp: false },
|
|
1045
1097
|
source: { required: true, timestamp: false },
|
|
1046
1098
|
owner: { required: false, timestamp: false },
|
|
1047
1099
|
counterparts: { required: false, timestamp: false },
|
|
1100
|
+
attachments: { required: false, timestamp: false },
|
|
1048
1101
|
created_at: { required: false, timestamp: true },
|
|
1049
1102
|
created_at_local: { required: false, timestamp: true },
|
|
1050
1103
|
modified_at: { required: false, timestamp: true },
|
|
@@ -1055,6 +1108,7 @@ var RESOURCE_ROW_KEY_RULES = Object.freeze({
|
|
|
1055
1108
|
end: { required: false, timestamp: false },
|
|
1056
1109
|
status: { required: false, timestamp: false },
|
|
1057
1110
|
snippet: { required: false, timestamp: false },
|
|
1111
|
+
dated_notes: { required: false, timestamp: false },
|
|
1058
1112
|
state: { required: true, timestamp: false },
|
|
1059
1113
|
timestamp_basis: { required: true, timestamp: false }
|
|
1060
1114
|
});
|
|
@@ -1091,6 +1145,27 @@ var CEAL_WRITE_SAFETY_UNCHECKED_REASONS = vocabulary(["authority_unavailable"]);
|
|
|
1091
1145
|
// packages/ceal-client-protocol/src/operation-occurrence.ts
|
|
1092
1146
|
var MAX_RECEIPT_REVISION = Number.MAX_SAFE_INTEGER - 1;
|
|
1093
1147
|
|
|
1148
|
+
// packages/ceal-client-protocol/src/personal-client-vocabulary.ts
|
|
1149
|
+
var CEAL_PERSONAL_CLIENT_BINDING_KEYS = vocabulary([
|
|
1150
|
+
"access_group_ref",
|
|
1151
|
+
"membership_ref",
|
|
1152
|
+
"registration_ref",
|
|
1153
|
+
"client_ref",
|
|
1154
|
+
"subject_ref",
|
|
1155
|
+
"instance_ref"
|
|
1156
|
+
]);
|
|
1157
|
+
var CEAL_ENROLLMENT_FAILURE_CODES = vocabulary(["enrollment_invalid", "enrollment_expired", "enrollment_used"]);
|
|
1158
|
+
var CEAL_REFRESH_FAILURE_CODES = vocabulary([
|
|
1159
|
+
"refresh_invalid",
|
|
1160
|
+
"refresh_expired",
|
|
1161
|
+
"refresh_inactive",
|
|
1162
|
+
"refresh_replayed",
|
|
1163
|
+
"refresh_revoked",
|
|
1164
|
+
"authority_replaced",
|
|
1165
|
+
"refresh_recovery_unavailable",
|
|
1166
|
+
"refresh_recovery_expired"
|
|
1167
|
+
]);
|
|
1168
|
+
|
|
1094
1169
|
// packages/ceal-client-protocol/src/leased-artifact-contract.ts
|
|
1095
1170
|
var CEAL_LEASED_CONSUMER_ARTIFACT_CHUNK_MAX_BYTES = 12 * 1024;
|
|
1096
1171
|
|
|
@@ -1186,7 +1261,7 @@ var CEAL_REQUEST_MAX_GRAPH_NODES = 128;
|
|
|
1186
1261
|
|
|
1187
1262
|
// packages/ceal-client-protocol/src/request-run.ts
|
|
1188
1263
|
var CEAL_REQUEST_NODE_STANDING_OCCURRENCE_SCHEMA_VERSION = "ceal.request_node_standing_occurrence.v1";
|
|
1189
|
-
var CEAL_REQUEST_RUN_BATCH_SCHEMA_VERSION = "ceal.request_run_batch.
|
|
1264
|
+
var CEAL_REQUEST_RUN_BATCH_SCHEMA_VERSION = "ceal.request_run_batch.v1";
|
|
1190
1265
|
var REQUEST_ACTION_SAFE_REF_SCHEMA = { type: "string", minLength: 1, maxLength: 128, pattern: SAFE_REF.source };
|
|
1191
1266
|
var REQUEST_ACTION_DIGEST_SCHEMA = { type: "string", minLength: 64, maxLength: 64, pattern: "^[a-f0-9]{64}$" };
|
|
1192
1267
|
var REQUEST_NODE_STANDING_OCCURRENCE_SCHEMA = {
|
|
@@ -1411,10 +1486,22 @@ var CEAL_REQUEST_GRAPH_NODE_PREPARE_READINESS_JSON_SCHEMA = {
|
|
|
1411
1486
|
required: ["node_ref", "operation_id", "resolver_owned", "gateway_derived"]
|
|
1412
1487
|
};
|
|
1413
1488
|
|
|
1489
|
+
// packages/ceal-client-protocol/src/host-invocation-authentication.ts
|
|
1490
|
+
var CEAL_HOST_INVOCATION_AUTHENTICATION_RESULT_SCHEMA = "ceal.host_invocation_authentication_result.v1";
|
|
1491
|
+
var CEAL_HOST_NONCE_ENCODED_CHARACTERS = 43;
|
|
1492
|
+
var CEAL_HOST_CLIENT_NONCE_PATTERN = new RegExp(`^[A-Za-z0-9_-]{${CEAL_HOST_NONCE_ENCODED_CHARACTERS}}$`, "u");
|
|
1493
|
+
var CEAL_HOST_CONTEXT_TOKEN_PATTERN = new RegExp(`^ceal_context_[A-Za-z0-9_-]{${CEAL_HOST_NONCE_ENCODED_CHARACTERS}}$`, "u");
|
|
1494
|
+
var CEAL_HOST_INVOCATION_AUTHENTICATION_RESULT_MAX_BYTES = new TextEncoder().encode(`${JSON.stringify({
|
|
1495
|
+
schema_version: CEAL_HOST_INVOCATION_AUTHENTICATION_RESULT_SCHEMA,
|
|
1496
|
+
context_token: `ceal_context_${"A".repeat(CEAL_HOST_NONCE_ENCODED_CHARACTERS)}`,
|
|
1497
|
+
expires_at: (/* @__PURE__ */ new Date("+010000-01-01T00:00:00.000Z")).toISOString()
|
|
1498
|
+
})}
|
|
1499
|
+
`).byteLength;
|
|
1500
|
+
|
|
1414
1501
|
// packages/ceal-client-protocol/src/client-result-materialization.ts
|
|
1415
1502
|
var CEAL_MODEL_VISIBLE_COMMAND_OUTPUT_MAX_BYTES = 32 * 1024;
|
|
1416
|
-
var REQUIRED_FIELDS2 = Object.freeze(["schema_version", "operation_id"
|
|
1417
|
-
var FIELDS = /* @__PURE__ */ new Set([...REQUIRED_FIELDS2, "local_result_root", "continue_argv"]);
|
|
1503
|
+
var REQUIRED_FIELDS2 = Object.freeze(["schema_version", "operation_id"]);
|
|
1504
|
+
var FIELDS = /* @__PURE__ */ new Set([...REQUIRED_FIELDS2, "read_argv", "local_result_root", "continue_argv", "model_disclosure", "item_read_argv"]);
|
|
1418
1505
|
|
|
1419
1506
|
// packages/ceal-client-protocol/src/session-start-affordance.ts
|
|
1420
1507
|
var CEAL_SESSION_ENTRY_INVOCATION = "ceal";
|
|
@@ -1514,27 +1601,6 @@ var ADMIN_LINEAGE_NODE_KINDS = vocabulary(["source_read", "synthesis_preview", "
|
|
|
1514
1601
|
// packages/ceal-client-protocol/src/actor-kind.ts
|
|
1515
1602
|
var CEAL_ACTOR_KINDS = vocabulary(["human", "bot", "app", "unknown"]);
|
|
1516
1603
|
|
|
1517
|
-
// packages/ceal-client-protocol/src/personal-client-vocabulary.ts
|
|
1518
|
-
var CEAL_PERSONAL_CLIENT_BINDING_KEYS = vocabulary([
|
|
1519
|
-
"access_group_ref",
|
|
1520
|
-
"membership_ref",
|
|
1521
|
-
"registration_ref",
|
|
1522
|
-
"client_ref",
|
|
1523
|
-
"subject_ref",
|
|
1524
|
-
"instance_ref"
|
|
1525
|
-
]);
|
|
1526
|
-
var CEAL_ENROLLMENT_FAILURE_CODES = vocabulary(["enrollment_invalid", "enrollment_expired", "enrollment_used"]);
|
|
1527
|
-
var CEAL_REFRESH_FAILURE_CODES = vocabulary([
|
|
1528
|
-
"refresh_invalid",
|
|
1529
|
-
"refresh_expired",
|
|
1530
|
-
"refresh_inactive",
|
|
1531
|
-
"refresh_replayed",
|
|
1532
|
-
"refresh_revoked",
|
|
1533
|
-
"authority_replaced",
|
|
1534
|
-
"refresh_recovery_unavailable",
|
|
1535
|
-
"refresh_recovery_expired"
|
|
1536
|
-
]);
|
|
1537
|
-
|
|
1538
1604
|
// packages/ceal-client-protocol/src/device-enrollment.ts
|
|
1539
1605
|
var CEAL_DEVICE_ENROLLMENT_POLL_FAILURE_CODES = Object.freeze(["unsupported_feature", "recovery_required", "expired", "denied"]);
|
|
1540
1606
|
var POLL_RESULT_KEYS = Object.freeze(["retry_after_ms", "schema_version", "status"]);
|
|
@@ -2991,7 +3057,6 @@ function assertHostProducerSourcePaths(stateRoot, config, producer, platform = p
|
|
|
2991
3057
|
// host/producer-service.ts
|
|
2992
3058
|
import { constants } from "node:fs";
|
|
2993
3059
|
import { lstat as lstat3, open as open4 } from "node:fs/promises";
|
|
2994
|
-
var MAX_CONFIG_BYTES = 32 * 1024;
|
|
2995
3060
|
var SAFE_REF7 = /^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$/u;
|
|
2996
3061
|
var HOST_PRODUCER_CONFIG_FLAG = "--ceal-host-config";
|
|
2997
3062
|
var HostProducerServiceError = class extends Error {
|
|
@@ -3002,7 +3067,8 @@ var HostProducerServiceError = class extends Error {
|
|
|
3002
3067
|
this.code = code;
|
|
3003
3068
|
}
|
|
3004
3069
|
};
|
|
3005
|
-
var HOST_PRODUCER_CONFIG_KEYS = ["schema_version", "host_source_ref", "producer_installation_ref", "producer_epoch", "outbox_dir", "relay_endpoint"
|
|
3070
|
+
var HOST_PRODUCER_CONFIG_KEYS = ["schema_version", "host_source_ref", "producer_installation_ref", "producer_epoch", "outbox_dir", "relay_endpoint"];
|
|
3071
|
+
var HOST_PRODUCER_TIMING_DEFAULTS = Object.freeze({ reconcile_interval_ms: 250, retry_backoff_ms: 1e3, ipc_timeout_ms: 5e3 });
|
|
3006
3072
|
function hostProducerExtraPath(extras, key) {
|
|
3007
3073
|
const value = extras[key];
|
|
3008
3074
|
if (value === void 0) throw hostProducerError("invalid_config");
|
|
@@ -3046,15 +3112,17 @@ async function readProducerConfigText(configPath, platform, error) {
|
|
|
3046
3112
|
const noFollow = typeof constants.O_NOFOLLOW === "number" ? constants.O_NOFOLLOW : 0;
|
|
3047
3113
|
const handle = await openConfigFile(configPath, constants.O_RDONLY | noFollow, error);
|
|
3048
3114
|
try {
|
|
3049
|
-
|
|
3050
|
-
|
|
3115
|
+
const opened = await handle.stat();
|
|
3116
|
+
validateConfigFile(opened, platform, error);
|
|
3117
|
+
validateOpenedFile(opened, pathStat, platform, error);
|
|
3118
|
+
return await readBoundedConfig(handle, opened.size, error);
|
|
3051
3119
|
} finally {
|
|
3052
3120
|
await handle.close();
|
|
3053
3121
|
}
|
|
3054
3122
|
}
|
|
3055
3123
|
function decodeProducerConfigCore(text, options) {
|
|
3056
3124
|
const value = parseCanonicalJson(text, options.error);
|
|
3057
|
-
if (!isRecord6(value) || !
|
|
3125
|
+
if (!isRecord6(value) || !hasConfigKeys(value, options.keys) || value.schema_version !== options.schema) throw options.error("invalid_config");
|
|
3058
3126
|
const hostSourceRef = typeof value.host_source_ref === "string" ? value.host_source_ref : "";
|
|
3059
3127
|
const installationRef = typeof value.producer_installation_ref === "string" ? value.producer_installation_ref : "";
|
|
3060
3128
|
const producerEpoch = validateIdentity3(hostSourceRef, installationRef, value.producer_epoch, options.error);
|
|
@@ -3065,7 +3133,7 @@ function decodeProducerConfigCore(text, options) {
|
|
|
3065
3133
|
assertProducerAbsolutePath(value[key], options.platform, "runtime", options.error);
|
|
3066
3134
|
extraPaths[key] = value[key];
|
|
3067
3135
|
}
|
|
3068
|
-
const intervals = validateIntervals(value.reconcile_interval_ms, value.retry_backoff_ms, value.ipc_timeout_ms, options.error);
|
|
3136
|
+
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);
|
|
3069
3137
|
return {
|
|
3070
3138
|
extra_paths: Object.freeze(extraPaths),
|
|
3071
3139
|
host_source_ref: hostSourceRef,
|
|
@@ -3094,7 +3162,7 @@ async function configPathStat(configPath, error) {
|
|
|
3094
3162
|
}
|
|
3095
3163
|
function validateConfigFile(value, platform, error) {
|
|
3096
3164
|
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" }]));
|
|
3097
|
-
if (value.size <= 0 || value.size >
|
|
3165
|
+
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}`));
|
|
3098
3166
|
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" }]));
|
|
3099
3167
|
}
|
|
3100
3168
|
async function openConfigFile(configPath, flags, error) {
|
|
@@ -3108,12 +3176,17 @@ function validateOpenedFile(opened, pathStat, platform, error) {
|
|
|
3108
3176
|
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" }]));
|
|
3109
3177
|
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) }]));
|
|
3110
3178
|
}
|
|
3111
|
-
async function readBoundedConfig(handle, error) {
|
|
3112
|
-
const buffer = Buffer.allocUnsafe(
|
|
3113
|
-
|
|
3114
|
-
|
|
3179
|
+
async function readBoundedConfig(handle, expectedBytes, error) {
|
|
3180
|
+
const buffer = Buffer.allocUnsafe(expectedBytes + 1);
|
|
3181
|
+
let offset = 0;
|
|
3182
|
+
while (offset < buffer.byteLength) {
|
|
3183
|
+
const { bytesRead } = await handle.read(buffer, offset, buffer.byteLength - offset, offset);
|
|
3184
|
+
if (bytesRead === 0) break;
|
|
3185
|
+
offset += bytesRead;
|
|
3186
|
+
}
|
|
3187
|
+
if (offset !== expectedBytes) throw error("invalid_config", refusalFact("bytes_read", offset, `the opened file's ${expectedBytes} bytes without growth or truncation`));
|
|
3115
3188
|
try {
|
|
3116
|
-
return new TextDecoder("utf-8", { fatal: true }).decode(buffer.subarray(0,
|
|
3189
|
+
return new TextDecoder("utf-8", { fatal: true }).decode(buffer.subarray(0, offset));
|
|
3117
3190
|
} catch {
|
|
3118
3191
|
throw error("invalid_config");
|
|
3119
3192
|
}
|
|
@@ -3141,9 +3214,8 @@ function validateIntervals(reconcile, retry, timeout, error) {
|
|
|
3141
3214
|
if (!boundedMilliseconds(reconcile) || !boundedMilliseconds(retry) || !boundedMilliseconds(timeout)) throw error("invalid_config");
|
|
3142
3215
|
return [reconcile, retry, timeout];
|
|
3143
3216
|
}
|
|
3144
|
-
function
|
|
3145
|
-
|
|
3146
|
-
return observed.length === keys.length && keys.every((key) => Object.hasOwn(value, key));
|
|
3217
|
+
function hasConfigKeys(value, required) {
|
|
3218
|
+
return required.every((key) => Object.hasOwn(value, key)) && Object.keys(value).every((key) => required.includes(key) || Object.hasOwn(HOST_PRODUCER_TIMING_DEFAULTS, key));
|
|
3147
3219
|
}
|
|
3148
3220
|
function isRecord6(value) {
|
|
3149
3221
|
return value !== null && typeof value === "object" && !Array.isArray(value);
|