@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
|
@@ -2171,7 +2171,6 @@ var client_wire_contract_default = {
|
|
|
2171
2171
|
length: 72,
|
|
2172
2172
|
pattern: "^catalog:[a-f0-9]{64}$"
|
|
2173
2173
|
},
|
|
2174
|
-
max_bytes: 4194304,
|
|
2175
2174
|
envelope_max_bytes: 389
|
|
2176
2175
|
},
|
|
2177
2176
|
command_request: {
|
|
@@ -2252,14 +2251,13 @@ var client_wire_contract_default = {
|
|
|
2252
2251
|
"prompt"
|
|
2253
2252
|
],
|
|
2254
2253
|
discovery_command: "discovery",
|
|
2255
|
-
discovery_manifest_schema_version: "ceal.discovery_manifest.
|
|
2254
|
+
discovery_manifest_schema_version: "ceal.discovery_manifest.v1",
|
|
2256
2255
|
discovery_manifest_document_fields: [
|
|
2257
2256
|
"discovery_manifest"
|
|
2258
2257
|
],
|
|
2259
2258
|
exit_code_max: 125,
|
|
2260
2259
|
bare_document_max_bytes: 65536,
|
|
2261
|
-
complete_max_bytes: 66019
|
|
2262
|
-
absolute_transport_max_bytes: 4194304
|
|
2260
|
+
complete_max_bytes: 66019
|
|
2263
2261
|
},
|
|
2264
2262
|
resource_stream: {
|
|
2265
2263
|
path: "/api/ceal/v2/resources",
|
|
@@ -2274,6 +2272,9 @@ var client_wire_contract_default = {
|
|
|
2274
2272
|
"fetch"
|
|
2275
2273
|
],
|
|
2276
2274
|
ref_flag: "--ref"
|
|
2275
|
+
},
|
|
2276
|
+
encoded_json_document: {
|
|
2277
|
+
max_bytes: 4194304
|
|
2277
2278
|
}
|
|
2278
2279
|
};
|
|
2279
2280
|
|
|
@@ -2283,6 +2284,7 @@ var commandResolution = CEAL_CLIENT_WIRE_CONTRACT.command_resolution;
|
|
|
2283
2284
|
var commandResolutionAuthority = commandResolution.authority;
|
|
2284
2285
|
var commandResolutionSemanticOptions = commandResolution.semantic_options;
|
|
2285
2286
|
var CEAL_GATEWAY_COMMAND_RESOLUTION_SCHEMA_VERSION = commandResolution.schema_version;
|
|
2287
|
+
var CEAL_ENCODED_JSON_DOCUMENT_MAX_BYTES = CEAL_CLIENT_WIRE_CONTRACT.encoded_json_document.max_bytes;
|
|
2286
2288
|
var artifact = CEAL_CLIENT_WIRE_CONTRACT.artifact_descriptor;
|
|
2287
2289
|
var request = CEAL_CLIENT_WIRE_CONTRACT.command_request;
|
|
2288
2290
|
var response = CEAL_CLIENT_WIRE_CONTRACT.command_response;
|
|
@@ -2296,7 +2298,7 @@ var CEAL_VERIFIED_ARTIFACT_DIGEST_LENGTH = artifact.digest.length;
|
|
|
2296
2298
|
var CEAL_VERIFIED_ARTIFACT_DIGEST_PATTERN = artifact.digest.pattern;
|
|
2297
2299
|
var CEAL_VERIFIED_ARTIFACT_CATALOG_REVISION_LENGTH = artifact.catalog_revision.length;
|
|
2298
2300
|
var CEAL_VERIFIED_ARTIFACT_CATALOG_REVISION_PATTERN = artifact.catalog_revision.pattern;
|
|
2299
|
-
var CEAL_VERIFIED_ARTIFACT_MAX_BYTES =
|
|
2301
|
+
var CEAL_VERIFIED_ARTIFACT_MAX_BYTES = CEAL_ENCODED_JSON_DOCUMENT_MAX_BYTES;
|
|
2300
2302
|
var CEAL_VERIFIED_ARTIFACT_DESCRIPTOR_MAX_BYTES = artifact.envelope_max_bytes;
|
|
2301
2303
|
var CEAL_COMMAND_REQUEST_SCHEMA_VERSION = request.schema_version;
|
|
2302
2304
|
var CEAL_COMMAND_REQUEST_MAX_BYTES = request.absolute_transport_max_bytes;
|
|
@@ -2310,7 +2312,6 @@ var CEAL_COMMAND_RESPONSE_FOCUSED_PROMPT_CONTINUATION_DOCUMENT_FIELDS = Object.f
|
|
|
2310
2312
|
var CEAL_COMMAND_RESPONSE_DISCOVERY_COMMAND = response.discovery_command;
|
|
2311
2313
|
var CEAL_COMMAND_RESPONSE_DISCOVERY_MANIFEST_SCHEMA_VERSION = response.discovery_manifest_schema_version;
|
|
2312
2314
|
var CEAL_COMMAND_RESPONSE_DISCOVERY_MANIFEST_DOCUMENT_FIELDS = Object.freeze([...response.discovery_manifest_document_fields]);
|
|
2313
|
-
var CEAL_COMMAND_RESPONSE_MAX_BYTES = response.absolute_transport_max_bytes;
|
|
2314
2315
|
|
|
2315
2316
|
// packages/ceal-client-protocol/src/vocabulary.ts
|
|
2316
2317
|
function vocabulary(words) {
|
|
@@ -2324,6 +2325,7 @@ var CEAL_AUDIT_OUTCOMES = vocabulary(["succeeded", "denied", "failed"]);
|
|
|
2324
2325
|
var CEAL_GATEWAY_PROVIDER_STEP_OUTCOMES = vocabulary(["completed", "rejected", "throttled", "failed"]);
|
|
2325
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"]);
|
|
2326
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"]);
|
|
2327
2329
|
var CEAL_POLICY_DECISIONS = vocabulary(["allowed", "denied", "not_evaluated"]);
|
|
2328
2330
|
var CEAL_CONNECTOR_ROUTE_PHASES = vocabulary(["scope_observation", "target_selection", "route_resolution"]);
|
|
2329
2331
|
var CEAL_CONNECTOR_ROUTE_CAUSES = vocabulary(["provider_throttled", "provider_unavailable", "binding_invalid", "scope_limit_exceeded"]);
|
|
@@ -2337,6 +2339,17 @@ var CEAL_WRITE_RECEIPT_PROVIDER_STATES = vocabulary(["outcome_unknown", "verifie
|
|
|
2337
2339
|
var CEAL_WRITE_RECEIPT_PROVIDER_READBACKS = vocabulary(["outcome_unknown", "verified", "not_applied"]);
|
|
2338
2340
|
var CEAL_PROTOCOL_VERSION = "1.4.0";
|
|
2339
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
|
+
]);
|
|
2340
2353
|
var CEAL_CONNECTOR_ROUTE_FAILURE_KEYS = vocabulary(["connector_kind", "phase", "schema_version"]);
|
|
2341
2354
|
var CEAL_CLASSIFIED_CONNECTOR_ROUTE_FAILURE_KEYS = vocabulary(["cause", ...CEAL_CONNECTOR_ROUTE_FAILURE_KEYS]);
|
|
2342
2355
|
var CEAL_UNCLASSIFIED_CONNECTOR_ROUTE_FAILURE_KEYS = vocabulary(["connector_kind", "error_class", "phase", "schema_version"]);
|
|
@@ -2346,10 +2359,129 @@ var CEAL_GATEWAY_ORGANIZATION_ROUTE_FACT_CALL_KEYS = Object.freeze([
|
|
|
2346
2359
|
"policy_decision_revision"
|
|
2347
2360
|
]);
|
|
2348
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
|
+
|
|
2349
2482
|
// packages/ceal-client-protocol/src/operation-contract-types.ts
|
|
2350
2483
|
var CEAL_JSON_SCHEMA_2020_12 = "https://json-schema.org/draft/2020-12/schema";
|
|
2351
2484
|
var CEAL_OPERATION_ERROR_SCHEMA_VERSION = "ceal.operation_error.v1";
|
|
2352
|
-
var CEAL_OPERATION_WITHHELD_CAUSES = vocabulary(["provider_permission", "access_level", "personal_authorization_required"]);
|
|
2353
2485
|
var CEAL_RETRY_AFTER_MAX_MS = 60 * 60 * 1e3;
|
|
2354
2486
|
var CEAL_JSON_SCHEMA_TYPES = vocabulary(["object", "array", "string", "integer", "number", "boolean", "null"]);
|
|
2355
2487
|
var OBSERVATION_POSTURES = vocabulary(["direct_readback", "approved_no_readback", "operator_mediated", "excluded"]);
|
|
@@ -2601,7 +2733,6 @@ function cut(text) {
|
|
|
2601
2733
|
var CEAL_OPERATION_ACCESS_CLASSES = vocabulary(["read", "write"]);
|
|
2602
2734
|
|
|
2603
2735
|
// packages/ceal-client-protocol/src/domain-vocabulary.ts
|
|
2604
|
-
var CEAL_INTEGRATION_KINDS = vocabulary(["github", "google-workspace", "notion", "slack"]);
|
|
2605
2736
|
var CEAL_CONNECTOR_STATUSES = vocabulary(["active", "disabled", "disconnected"]);
|
|
2606
2737
|
var CEAL_CONNECTOR_CUSTODIES = vocabulary(["organization", "personal"]);
|
|
2607
2738
|
var CEAL_PROVIDER_BOUNDARY_KINDS = vocabulary([
|
|
@@ -2614,6 +2745,8 @@ var CEAL_PROVIDER_BOUNDARY_KINDS = vocabulary([
|
|
|
2614
2745
|
var CEAL_PROVIDER_BOUNDARY_EVIDENCE = vocabulary(["provider_readback", "operator_stated"]);
|
|
2615
2746
|
var CEAL_ACCESS_LEVELS = vocabulary(["none", "read", "read_write"]);
|
|
2616
2747
|
var CEAL_PERSONAL_ACCESS_CEILINGS = vocabulary(["disabled", "read", "read_write"]);
|
|
2748
|
+
var CEAL_TARGET_REF_PATTERN = "^[^\\p{Cc}]+$";
|
|
2749
|
+
var TARGET_REF = new RegExp(CEAL_TARGET_REF_PATTERN, "u");
|
|
2617
2750
|
var CEAL_TARGET_VISIBILITIES = vocabulary(["public", "private"]);
|
|
2618
2751
|
var CEAL_PRINCIPAL_KINDS = vocabulary(["human", "service", "runtime"]);
|
|
2619
2752
|
var CEAL_ORGANIZATION_ROLES = vocabulary(["member", "admin"]);
|
|
@@ -2724,6 +2857,7 @@ var CEAL_OPERATION_DESCRIPTOR_REQUIRED_ENVELOPE_KEYS = Object.freeze(["schema_ve
|
|
|
2724
2857
|
var CEAL_OPERATION_DESCRIPTOR_OPTIONAL_ENVELOPE_KEYS = Object.freeze(["input_resolution", "summary"]);
|
|
2725
2858
|
var CEAL_OPERATION_RESULT_KEYS = vocabulary(["ok", "operation_id", "operation_receipt", "schema_version", "value"]);
|
|
2726
2859
|
var CEAL_OPERATION_COMPACT_RESULT_KEYS = vocabulary(["ok", "operation_evidence", "operation_id", "schema_version", "value"]);
|
|
2860
|
+
var CEAL_OPERATION_RESULT_OPTIONAL_KEYS = vocabulary(["model_disclosure", "result_complete", "resume"]);
|
|
2727
2861
|
|
|
2728
2862
|
// packages/ceal-client-protocol/src/operation-catalog.ts
|
|
2729
2863
|
var CEAL_OPERATION_CATALOG_SCHEMA_VERSION = "ceal.catalog.v3";
|
|
@@ -2735,8 +2869,8 @@ var CEAL_SCHEMA_LITERALS = [
|
|
|
2735
2869
|
"ceal.activation_transport.v1",
|
|
2736
2870
|
CEAL_OPERATION_ACCESS_SCHEMA_VERSION,
|
|
2737
2871
|
CEAL_OPERATION_CATALOG_SCHEMA_VERSION,
|
|
2738
|
-
"ceal.client_refresh_request.
|
|
2739
|
-
"ceal.client_refresh_result.
|
|
2872
|
+
"ceal.client_refresh_request.v1",
|
|
2873
|
+
"ceal.client_refresh_result.v1",
|
|
2740
2874
|
"ceal.client_revoke_request.v1",
|
|
2741
2875
|
"ceal.client_revoke_result.v1",
|
|
2742
2876
|
CEAL_COMMAND_REQUEST_SCHEMA_VERSION,
|
|
@@ -2765,7 +2899,7 @@ var CEAL_SCHEMA_LITERALS = [
|
|
|
2765
2899
|
"ceal.gateway_call_result.v1",
|
|
2766
2900
|
CEAL_GATEWAY_COMMAND_RESOLUTION_SCHEMA_VERSION,
|
|
2767
2901
|
"ceal.gateway_connector_route_failure.v1",
|
|
2768
|
-
"ceal.gateway_discovery.
|
|
2902
|
+
"ceal.gateway_discovery.v1",
|
|
2769
2903
|
"ceal.gateway_handshake.v1",
|
|
2770
2904
|
"ceal.gateway_installation_activation_code_issue_request.v1",
|
|
2771
2905
|
"ceal.gateway_installation_activation_code_issue_result.v1",
|
|
@@ -2787,10 +2921,10 @@ var CEAL_SCHEMA_LITERALS = [
|
|
|
2787
2921
|
"ceal.host_observation.v1",
|
|
2788
2922
|
"ceal.host_registration_request.v1",
|
|
2789
2923
|
"ceal.host_registration_result.v1",
|
|
2790
|
-
"ceal.leased-resource-stream.
|
|
2791
|
-
"ceal.leased_consumer_attachment_stream_frame.
|
|
2792
|
-
"ceal.leased_consumer_attachment_stream_request.
|
|
2793
|
-
"ceal.leased_consumer_attachment_stream_transport.
|
|
2924
|
+
"ceal.leased-resource-stream.v1",
|
|
2925
|
+
"ceal.leased_consumer_attachment_stream_frame.v1",
|
|
2926
|
+
"ceal.leased_consumer_attachment_stream_request.v1",
|
|
2927
|
+
"ceal.leased_consumer_attachment_stream_transport.v1",
|
|
2794
2928
|
"ceal.operation_descriptor.v1",
|
|
2795
2929
|
"ceal.operation_error.v1",
|
|
2796
2930
|
"ceal.operation_failure.v1",
|
|
@@ -2798,7 +2932,7 @@ var CEAL_SCHEMA_LITERALS = [
|
|
|
2798
2932
|
"ceal.operation_receipt.v1",
|
|
2799
2933
|
"ceal.operation_result.v1",
|
|
2800
2934
|
"ceal.operation_result.compact.v1",
|
|
2801
|
-
"ceal.local_result_materialization.
|
|
2935
|
+
"ceal.local_result_materialization.v1",
|
|
2802
2936
|
"ceal.local_result_root.v1",
|
|
2803
2937
|
"ceal.owner_bootstrap_exchange_request.v1",
|
|
2804
2938
|
"ceal.owner_bootstrap_exchange_result.v1",
|
|
@@ -2884,117 +3018,8 @@ var CEAL_AGENT_SERVICE_SESSION_RECORD_KEYS = vocabulary([
|
|
|
2884
3018
|
]);
|
|
2885
3019
|
var CEAL_AGENT_SESSION_COMMIT_KEYS = vocabulary(["attempt_ref", "expected_session_revision", "session_revision"]);
|
|
2886
3020
|
|
|
2887
|
-
// packages/ceal-client-protocol/src/operation-
|
|
2888
|
-
var
|
|
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: a legacy
|
|
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
|
-
});
|
|
3021
|
+
// packages/ceal-client-protocol/src/operation-result-completeness.ts
|
|
3022
|
+
var CEAL_READ_VALUE_CONTINUATION_KEYS = vocabulary(["continuation", "continuation_ref", "next_cursor"]);
|
|
2998
3023
|
|
|
2999
3024
|
// packages/ceal-client-protocol/src/operation-contract-artifact.ts
|
|
3000
3025
|
var CATALOG_REVISION = new RegExp(CEAL_VERIFIED_ARTIFACT_CATALOG_REVISION_PATTERN, "u");
|
|
@@ -3058,7 +3083,8 @@ var CEAL_ACTIVITY_GAP_CODES = vocabulary([
|
|
|
3058
3083
|
"provider_cursor_unavailable",
|
|
3059
3084
|
"malformed_provider_page",
|
|
3060
3085
|
"visibility_incomplete",
|
|
3061
|
-
"unsupported_event_kind"
|
|
3086
|
+
"unsupported_event_kind",
|
|
3087
|
+
"direct_messages_excluded"
|
|
3062
3088
|
]);
|
|
3063
3089
|
var CEAL_ACTIVITY_CONNECTOR_KINDS = vocabulary(["slack", "github", "google-calendar", "google-drive", "notion"]);
|
|
3064
3090
|
var CEAL_ACTIVITY_COVERAGE_STATUSES = vocabulary(["complete_for_target", "continuation_required", "blocked"]);
|
|
@@ -3069,6 +3095,8 @@ var CEAL_ACTIVITY_EVENT_KINDS = vocabulary([
|
|
|
3069
3095
|
"github.commit.authored",
|
|
3070
3096
|
"github.issue.opened",
|
|
3071
3097
|
"github.pull_request.opened",
|
|
3098
|
+
"github.issue.edited",
|
|
3099
|
+
"github.pull_request.edited",
|
|
3072
3100
|
"github.review.submitted",
|
|
3073
3101
|
"github.issue_comment.created",
|
|
3074
3102
|
"github.review_comment.created",
|
|
@@ -3081,6 +3109,25 @@ var CEAL_ACTIVITY_EVENT_KINDS = vocabulary([
|
|
|
3081
3109
|
"notion.page.created",
|
|
3082
3110
|
"notion.page.edited"
|
|
3083
3111
|
]);
|
|
3112
|
+
var CEAL_ACTIVITY_EVENT_TIMESTAMP_BASIS_MAP = Object.freeze({
|
|
3113
|
+
"slack.message": "message_created",
|
|
3114
|
+
"slack.reply": "message_created",
|
|
3115
|
+
"slack.direct_message": "message_created",
|
|
3116
|
+
"github.commit.authored": "commit_authored",
|
|
3117
|
+
"github.review.submitted": "review_submitted",
|
|
3118
|
+
"github.issue_comment.created": "comment_created",
|
|
3119
|
+
"github.review_comment.created": "comment_created",
|
|
3120
|
+
"github.issue.opened": "resource_created",
|
|
3121
|
+
"github.pull_request.opened": "resource_created",
|
|
3122
|
+
"github.issue.edited": "resource_modified",
|
|
3123
|
+
"github.pull_request.edited": "resource_modified",
|
|
3124
|
+
"calendar.organized": "resource_created",
|
|
3125
|
+
"drive.file.created": "file_created",
|
|
3126
|
+
"drive.file.modified": "file_modified_by_me",
|
|
3127
|
+
"drive.file.viewed": "file_viewed_by_me",
|
|
3128
|
+
"notion.page.created": "page_created",
|
|
3129
|
+
"notion.page.edited": "page_last_edited"
|
|
3130
|
+
});
|
|
3084
3131
|
var CEAL_ACTIVITY_TIMESTAMP_BASES = vocabulary([
|
|
3085
3132
|
"message_created",
|
|
3086
3133
|
"commit_authored",
|
|
@@ -3101,11 +3148,12 @@ var CEAL_ACTIVITY_V3_KINDS = vocabulary(["authored", "edited", "messaged", "resp
|
|
|
3101
3148
|
var CEAL_RESOURCE_TIME_BASES = vocabulary(["created", "modified", "viewed"]);
|
|
3102
3149
|
var CEAL_RESOURCE_SEARCH_ORDERS = vocabulary(["relevance", "modified", "viewed", "created"]);
|
|
3103
3150
|
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", "addressed_to_me", "unread"]);
|
|
3151
|
+
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
3152
|
var CEAL_ARTIFACT_STAGE_TERMINALS = vocabulary(["chunk_accepted", "artifact_ready", "idempotency_replayed"]);
|
|
3106
3153
|
var CEAL_READ_ITEM_KINDS = vocabulary(["conversation", "identity", "usergroup", "message", "file", "document"]);
|
|
3107
3154
|
var CEAL_LEASED_MESSAGE_SEARCH_COMPLETENESS = vocabulary(["complete", "continuation_available", "truncated"]);
|
|
3108
|
-
var CEAL_OPAQUE_HANDLE_KINDS = vocabulary(["target", "message", "thread", "artifact", "document", "object"]);
|
|
3155
|
+
var CEAL_OPAQUE_HANDLE_KINDS = vocabulary(["target", "message", "thread", "artifact", "document", "block", "object"]);
|
|
3156
|
+
var CEAL_OPAQUE_REF_KINDS = vocabulary([...CEAL_OPAQUE_HANDLE_KINDS, "result", "operation-receipt", "reply-receipt", "field", "notion-data-source"]);
|
|
3109
3157
|
var CEAL_WRITE_OBJECT_KINDS = vocabulary(["document", "comment", "cell_range"]);
|
|
3110
3158
|
var CEAL_CONVERSATION_KINDS = vocabulary(["channel", "dm", "group"]);
|
|
3111
3159
|
var CEAL_FILE_TYPE_FAMILIES = vocabulary(["all", "image", "pdf"]);
|
|
@@ -3147,6 +3195,9 @@ var CEAL_FINAL_PRESENTATION_INTENTS = vocabulary(["final", "stop", "transient_no
|
|
|
3147
3195
|
var CEAL_PRESENTATION_INTENTS = vocabulary(["progress", ...CEAL_FINAL_PRESENTATION_INTENTS]);
|
|
3148
3196
|
|
|
3149
3197
|
// packages/ceal-client-protocol/src/resource-row.ts
|
|
3198
|
+
var CEAL_DATED_NOTE_BASES = vocabulary(["recording", "calendar_event", "created_time"]);
|
|
3199
|
+
var CEAL_DATED_NOTE_TRANSCRIPT_STATES = vocabulary(["present", "absent", "unestablished"]);
|
|
3200
|
+
var CEAL_READ_SEARCH_COST_CLASSES = vocabulary(["native_index", "scan"]);
|
|
3150
3201
|
var RESOURCE_ROW_KEY_RULES = Object.freeze({
|
|
3151
3202
|
schema_version: { required: true, timestamp: false },
|
|
3152
3203
|
ref: { required: true, timestamp: false },
|
|
@@ -3155,9 +3206,11 @@ var RESOURCE_ROW_KEY_RULES = Object.freeze({
|
|
|
3155
3206
|
title: { required: true, timestamp: false },
|
|
3156
3207
|
container_label: { required: true, timestamp: false },
|
|
3157
3208
|
container_ref: { required: false, timestamp: false },
|
|
3209
|
+
source_url: { required: false, timestamp: false },
|
|
3158
3210
|
source: { required: true, timestamp: false },
|
|
3159
3211
|
owner: { required: false, timestamp: false },
|
|
3160
3212
|
counterparts: { required: false, timestamp: false },
|
|
3213
|
+
attachments: { required: false, timestamp: false },
|
|
3161
3214
|
created_at: { required: false, timestamp: true },
|
|
3162
3215
|
created_at_local: { required: false, timestamp: true },
|
|
3163
3216
|
modified_at: { required: false, timestamp: true },
|
|
@@ -3168,6 +3221,7 @@ var RESOURCE_ROW_KEY_RULES = Object.freeze({
|
|
|
3168
3221
|
end: { required: false, timestamp: false },
|
|
3169
3222
|
status: { required: false, timestamp: false },
|
|
3170
3223
|
snippet: { required: false, timestamp: false },
|
|
3224
|
+
dated_notes: { required: false, timestamp: false },
|
|
3171
3225
|
state: { required: true, timestamp: false },
|
|
3172
3226
|
timestamp_basis: { required: true, timestamp: false }
|
|
3173
3227
|
});
|
|
@@ -3204,6 +3258,27 @@ var CEAL_WRITE_SAFETY_UNCHECKED_REASONS = vocabulary(["authority_unavailable"]);
|
|
|
3204
3258
|
// packages/ceal-client-protocol/src/operation-occurrence.ts
|
|
3205
3259
|
var MAX_RECEIPT_REVISION = Number.MAX_SAFE_INTEGER - 1;
|
|
3206
3260
|
|
|
3261
|
+
// packages/ceal-client-protocol/src/personal-client-vocabulary.ts
|
|
3262
|
+
var CEAL_PERSONAL_CLIENT_BINDING_KEYS = vocabulary([
|
|
3263
|
+
"access_group_ref",
|
|
3264
|
+
"membership_ref",
|
|
3265
|
+
"registration_ref",
|
|
3266
|
+
"client_ref",
|
|
3267
|
+
"subject_ref",
|
|
3268
|
+
"instance_ref"
|
|
3269
|
+
]);
|
|
3270
|
+
var CEAL_ENROLLMENT_FAILURE_CODES = vocabulary(["enrollment_invalid", "enrollment_expired", "enrollment_used"]);
|
|
3271
|
+
var CEAL_REFRESH_FAILURE_CODES = vocabulary([
|
|
3272
|
+
"refresh_invalid",
|
|
3273
|
+
"refresh_expired",
|
|
3274
|
+
"refresh_inactive",
|
|
3275
|
+
"refresh_replayed",
|
|
3276
|
+
"refresh_revoked",
|
|
3277
|
+
"authority_replaced",
|
|
3278
|
+
"refresh_recovery_unavailable",
|
|
3279
|
+
"refresh_recovery_expired"
|
|
3280
|
+
]);
|
|
3281
|
+
|
|
3207
3282
|
// packages/ceal-client-protocol/src/leased-artifact-contract.ts
|
|
3208
3283
|
var CEAL_LEASED_CONSUMER_ARTIFACT_CHUNK_MAX_BYTES = 12 * 1024;
|
|
3209
3284
|
|
|
@@ -3299,7 +3374,7 @@ var CEAL_REQUEST_MAX_GRAPH_NODES = 128;
|
|
|
3299
3374
|
|
|
3300
3375
|
// packages/ceal-client-protocol/src/request-run.ts
|
|
3301
3376
|
var CEAL_REQUEST_NODE_STANDING_OCCURRENCE_SCHEMA_VERSION = "ceal.request_node_standing_occurrence.v1";
|
|
3302
|
-
var CEAL_REQUEST_RUN_BATCH_SCHEMA_VERSION = "ceal.request_run_batch.
|
|
3377
|
+
var CEAL_REQUEST_RUN_BATCH_SCHEMA_VERSION = "ceal.request_run_batch.v1";
|
|
3303
3378
|
var REQUEST_ACTION_SAFE_REF_SCHEMA = { type: "string", minLength: 1, maxLength: 128, pattern: SAFE_REF.source };
|
|
3304
3379
|
var REQUEST_ACTION_DIGEST_SCHEMA = { type: "string", minLength: 64, maxLength: 64, pattern: "^[a-f0-9]{64}$" };
|
|
3305
3380
|
var REQUEST_NODE_STANDING_OCCURRENCE_SCHEMA = {
|
|
@@ -3526,12 +3601,22 @@ var CEAL_REQUEST_GRAPH_NODE_PREPARE_READINESS_JSON_SCHEMA = {
|
|
|
3526
3601
|
};
|
|
3527
3602
|
|
|
3528
3603
|
// packages/ceal-client-protocol/src/host-invocation-authentication.ts
|
|
3604
|
+
var CEAL_HOST_INVOCATION_AUTHENTICATION_RESULT_SCHEMA = "ceal.host_invocation_authentication_result.v1";
|
|
3529
3605
|
var CEAL_HOST_INGRESS_PATH = "/api/ceal/v2/host-ingress";
|
|
3606
|
+
var CEAL_HOST_NONCE_ENCODED_CHARACTERS = 43;
|
|
3607
|
+
var CEAL_HOST_CLIENT_NONCE_PATTERN = new RegExp(`^[A-Za-z0-9_-]{${CEAL_HOST_NONCE_ENCODED_CHARACTERS}}$`, "u");
|
|
3608
|
+
var CEAL_HOST_CONTEXT_TOKEN_PATTERN = new RegExp(`^ceal_context_[A-Za-z0-9_-]{${CEAL_HOST_NONCE_ENCODED_CHARACTERS}}$`, "u");
|
|
3609
|
+
var CEAL_HOST_INVOCATION_AUTHENTICATION_RESULT_MAX_BYTES = new TextEncoder().encode(`${JSON.stringify({
|
|
3610
|
+
schema_version: CEAL_HOST_INVOCATION_AUTHENTICATION_RESULT_SCHEMA,
|
|
3611
|
+
context_token: `ceal_context_${"A".repeat(CEAL_HOST_NONCE_ENCODED_CHARACTERS)}`,
|
|
3612
|
+
expires_at: (/* @__PURE__ */ new Date("+010000-01-01T00:00:00.000Z")).toISOString()
|
|
3613
|
+
})}
|
|
3614
|
+
`).byteLength;
|
|
3530
3615
|
|
|
3531
3616
|
// packages/ceal-client-protocol/src/client-result-materialization.ts
|
|
3532
3617
|
var CEAL_MODEL_VISIBLE_COMMAND_OUTPUT_MAX_BYTES = 32 * 1024;
|
|
3533
|
-
var REQUIRED_FIELDS2 = Object.freeze(["schema_version", "operation_id"
|
|
3534
|
-
var FIELDS = /* @__PURE__ */ new Set([...REQUIRED_FIELDS2, "local_result_root", "continue_argv"]);
|
|
3618
|
+
var REQUIRED_FIELDS2 = Object.freeze(["schema_version", "operation_id"]);
|
|
3619
|
+
var FIELDS = /* @__PURE__ */ new Set([...REQUIRED_FIELDS2, "read_argv", "local_result_root", "continue_argv", "model_disclosure", "item_read_argv"]);
|
|
3535
3620
|
|
|
3536
3621
|
// packages/ceal-client-protocol/src/session-start-affordance.ts
|
|
3537
3622
|
var CEAL_SESSION_ENTRY_INVOCATION = "ceal";
|
|
@@ -3632,27 +3717,6 @@ var ADMIN_LINEAGE_NODE_KINDS = vocabulary(["source_read", "synthesis_preview", "
|
|
|
3632
3717
|
// packages/ceal-client-protocol/src/actor-kind.ts
|
|
3633
3718
|
var CEAL_ACTOR_KINDS = vocabulary(["human", "bot", "app", "unknown"]);
|
|
3634
3719
|
|
|
3635
|
-
// packages/ceal-client-protocol/src/personal-client-vocabulary.ts
|
|
3636
|
-
var CEAL_PERSONAL_CLIENT_BINDING_KEYS = vocabulary([
|
|
3637
|
-
"access_group_ref",
|
|
3638
|
-
"membership_ref",
|
|
3639
|
-
"registration_ref",
|
|
3640
|
-
"client_ref",
|
|
3641
|
-
"subject_ref",
|
|
3642
|
-
"instance_ref"
|
|
3643
|
-
]);
|
|
3644
|
-
var CEAL_ENROLLMENT_FAILURE_CODES = vocabulary(["enrollment_invalid", "enrollment_expired", "enrollment_used"]);
|
|
3645
|
-
var CEAL_REFRESH_FAILURE_CODES = vocabulary([
|
|
3646
|
-
"refresh_invalid",
|
|
3647
|
-
"refresh_expired",
|
|
3648
|
-
"refresh_inactive",
|
|
3649
|
-
"refresh_replayed",
|
|
3650
|
-
"refresh_revoked",
|
|
3651
|
-
"authority_replaced",
|
|
3652
|
-
"refresh_recovery_unavailable",
|
|
3653
|
-
"refresh_recovery_expired"
|
|
3654
|
-
]);
|
|
3655
|
-
|
|
3656
3720
|
// packages/ceal-client-protocol/src/device-enrollment.ts
|
|
3657
3721
|
var CEAL_DEVICE_ENROLLMENT_POLL_FAILURE_CODES = Object.freeze(["unsupported_feature", "recovery_required", "expired", "denied"]);
|
|
3658
3722
|
var POLL_RESULT_KEYS = Object.freeze(["retry_after_ms", "schema_version", "status"]);
|
|
@@ -4022,7 +4086,6 @@ function ownerPrivate2(stats) {
|
|
|
4022
4086
|
import { posix as posix4, win32 as win324 } from "node:path";
|
|
4023
4087
|
import { constants } from "node:fs";
|
|
4024
4088
|
import { lstat as lstat4, open as open3 } from "node:fs/promises";
|
|
4025
|
-
var MAX_CONFIG_BYTES = 32 * 1024;
|
|
4026
4089
|
var SAFE_REF3 = /^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$/u;
|
|
4027
4090
|
var HOST_PRODUCER_CONFIG_FLAG = "--ceal-host-config";
|
|
4028
4091
|
var HostProducerServiceError = class extends Error {
|
|
@@ -4033,7 +4096,8 @@ var HostProducerServiceError = class extends Error {
|
|
|
4033
4096
|
this.code = code3;
|
|
4034
4097
|
}
|
|
4035
4098
|
};
|
|
4036
|
-
var HOST_PRODUCER_CONFIG_KEYS = ["schema_version", "host_source_ref", "producer_installation_ref", "producer_epoch", "outbox_dir", "relay_endpoint"
|
|
4099
|
+
var HOST_PRODUCER_CONFIG_KEYS = ["schema_version", "host_source_ref", "producer_installation_ref", "producer_epoch", "outbox_dir", "relay_endpoint"];
|
|
4100
|
+
var HOST_PRODUCER_TIMING_DEFAULTS = Object.freeze({ reconcile_interval_ms: 250, retry_backoff_ms: 1e3, ipc_timeout_ms: 5e3 });
|
|
4037
4101
|
function hostProducerExtraPath(extras, key) {
|
|
4038
4102
|
const value = extras[key];
|
|
4039
4103
|
if (value === void 0) throw hostProducerError("invalid_config");
|
|
@@ -4066,15 +4130,17 @@ async function readProducerConfigText(configPath, platform, error) {
|
|
|
4066
4130
|
const noFollow = typeof constants.O_NOFOLLOW === "number" ? constants.O_NOFOLLOW : 0;
|
|
4067
4131
|
const handle = await openConfigFile(configPath, constants.O_RDONLY | noFollow, error);
|
|
4068
4132
|
try {
|
|
4069
|
-
|
|
4070
|
-
|
|
4133
|
+
const opened = await handle.stat();
|
|
4134
|
+
validateConfigFile(opened, platform, error);
|
|
4135
|
+
validateOpenedFile(opened, pathStat, platform, error);
|
|
4136
|
+
return await readBoundedConfig(handle, opened.size, error);
|
|
4071
4137
|
} finally {
|
|
4072
4138
|
await handle.close();
|
|
4073
4139
|
}
|
|
4074
4140
|
}
|
|
4075
4141
|
function decodeProducerConfigCore(text, options) {
|
|
4076
4142
|
const value = parseCanonicalJson(text, options.error);
|
|
4077
|
-
if (!isRecord(value) || !
|
|
4143
|
+
if (!isRecord(value) || !hasConfigKeys(value, options.keys) || value.schema_version !== options.schema) throw options.error("invalid_config");
|
|
4078
4144
|
const hostSourceRef = typeof value.host_source_ref === "string" ? value.host_source_ref : "";
|
|
4079
4145
|
const installationRef = typeof value.producer_installation_ref === "string" ? value.producer_installation_ref : "";
|
|
4080
4146
|
const producerEpoch = validateIdentity(hostSourceRef, installationRef, value.producer_epoch, options.error);
|
|
@@ -4085,7 +4151,7 @@ function decodeProducerConfigCore(text, options) {
|
|
|
4085
4151
|
assertProducerAbsolutePath(value[key], options.platform, "runtime", options.error);
|
|
4086
4152
|
extraPaths[key] = value[key];
|
|
4087
4153
|
}
|
|
4088
|
-
const intervals = validateIntervals(value.reconcile_interval_ms, value.retry_backoff_ms, value.ipc_timeout_ms, options.error);
|
|
4154
|
+
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);
|
|
4089
4155
|
return {
|
|
4090
4156
|
extra_paths: Object.freeze(extraPaths),
|
|
4091
4157
|
host_source_ref: hostSourceRef,
|
|
@@ -4114,7 +4180,7 @@ async function configPathStat(configPath, error) {
|
|
|
4114
4180
|
}
|
|
4115
4181
|
function validateConfigFile(value, platform, error) {
|
|
4116
4182
|
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" }]));
|
|
4117
|
-
if (value.size <= 0 || value.size >
|
|
4183
|
+
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}`));
|
|
4118
4184
|
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" }]));
|
|
4119
4185
|
}
|
|
4120
4186
|
async function openConfigFile(configPath, flags, error) {
|
|
@@ -4128,12 +4194,17 @@ function validateOpenedFile(opened, pathStat, platform, error) {
|
|
|
4128
4194
|
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" }]));
|
|
4129
4195
|
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) }]));
|
|
4130
4196
|
}
|
|
4131
|
-
async function readBoundedConfig(handle, error) {
|
|
4132
|
-
const buffer = Buffer.allocUnsafe(
|
|
4133
|
-
|
|
4134
|
-
|
|
4197
|
+
async function readBoundedConfig(handle, expectedBytes, error) {
|
|
4198
|
+
const buffer = Buffer.allocUnsafe(expectedBytes + 1);
|
|
4199
|
+
let offset = 0;
|
|
4200
|
+
while (offset < buffer.byteLength) {
|
|
4201
|
+
const { bytesRead } = await handle.read(buffer, offset, buffer.byteLength - offset, offset);
|
|
4202
|
+
if (bytesRead === 0) break;
|
|
4203
|
+
offset += bytesRead;
|
|
4204
|
+
}
|
|
4205
|
+
if (offset !== expectedBytes) throw error("invalid_config", refusalFact("bytes_read", offset, `the opened file's ${expectedBytes} bytes without growth or truncation`));
|
|
4135
4206
|
try {
|
|
4136
|
-
return new TextDecoder("utf-8", { fatal: true }).decode(buffer.subarray(0,
|
|
4207
|
+
return new TextDecoder("utf-8", { fatal: true }).decode(buffer.subarray(0, offset));
|
|
4137
4208
|
} catch {
|
|
4138
4209
|
throw error("invalid_config");
|
|
4139
4210
|
}
|
|
@@ -4161,9 +4232,8 @@ function validateIntervals(reconcile, retry, timeout, error) {
|
|
|
4161
4232
|
if (!boundedMilliseconds(reconcile) || !boundedMilliseconds(retry) || !boundedMilliseconds(timeout)) throw error("invalid_config");
|
|
4162
4233
|
return [reconcile, retry, timeout];
|
|
4163
4234
|
}
|
|
4164
|
-
function
|
|
4165
|
-
|
|
4166
|
-
return observed.length === keys.length && keys.every((key) => Object.hasOwn(value, key));
|
|
4235
|
+
function hasConfigKeys(value, required) {
|
|
4236
|
+
return required.every((key) => Object.hasOwn(value, key)) && Object.keys(value).every((key) => required.includes(key) || Object.hasOwn(HOST_PRODUCER_TIMING_DEFAULTS, key));
|
|
4167
4237
|
}
|
|
4168
4238
|
function isRecord(value) {
|
|
4169
4239
|
return value !== null && typeof value === "object" && !Array.isArray(value);
|
|
@@ -7712,6 +7782,8 @@ function configurationError(message) {
|
|
|
7712
7782
|
}
|
|
7713
7783
|
|
|
7714
7784
|
// host/lifecycle/src/host-bundle-manifest.ts
|
|
7785
|
+
var HOST_BUNDLE_MAX_SELECTED_BYTES = 256 * 1024 * 1024;
|
|
7786
|
+
var HOST_BUNDLE_MAX_SIGSTORE_BYTES = 16 * 1024 * 1024;
|
|
7715
7787
|
var HOST_BUNDLE_TARGETS = Object.freeze(["linux-x64", "linux-arm64", "darwin-arm64", "windows-x64"]);
|
|
7716
7788
|
var HOST_BUNDLE_COMPONENTS = Object.freeze(["lifecycle", "relay", "codex", "claude"]);
|
|
7717
7789
|
var HOST_BUNDLE_PRODUCERS = Object.freeze(["codex", "claude"]);
|
|
@@ -7737,8 +7809,8 @@ function hostBundleComponentsForProducers(producers) {
|
|
|
7737
7809
|
// host/lifecycle/src/host-runtime-control.ts
|
|
7738
7810
|
import { Buffer as Buffer2 } from "node:buffer";
|
|
7739
7811
|
import { join as join11 } from "node:path";
|
|
7740
|
-
var HOST_RUNTIME_CONTROL_REQUEST_SCHEMA = "ceal.host_runtime_control_request.
|
|
7741
|
-
var HOST_RUNTIME_CONTROL_RESULT_SCHEMA = "ceal.host_runtime_control_result.
|
|
7812
|
+
var HOST_RUNTIME_CONTROL_REQUEST_SCHEMA = "ceal.host_runtime_control_request.v1";
|
|
7813
|
+
var HOST_RUNTIME_CONTROL_RESULT_SCHEMA = "ceal.host_runtime_control_result.v1";
|
|
7742
7814
|
var HOST_RUNTIME_CONTROL_MAX_INPUT_BYTES = 64 * 1024;
|
|
7743
7815
|
var HOST_RUNTIME_CONTROL_MAX_OUTPUT_BYTES = 16 * 1024;
|
|
7744
7816
|
var CANDIDATE_REF = /^[a-f0-9]{64}$/u;
|
|
@@ -7779,7 +7851,7 @@ function resolveInstalledHostRuntimePaths(prefix, platform = process.platform) {
|
|
|
7779
7851
|
};
|
|
7780
7852
|
}
|
|
7781
7853
|
function parseHostRuntimeControlRequest(value) {
|
|
7782
|
-
if (!isCealJsonRecord(value) || !
|
|
7854
|
+
if (!isCealJsonRecord(value) || !hasExactKeys2(value, REQUEST_REQUIRED_KEYS, ["component"])) throw invalid2("invalid_request_fields");
|
|
7783
7855
|
if (value.schema_version !== HOST_RUNTIME_CONTROL_REQUEST_SCHEMA) throw invalid2("invalid_request_schema", [`expected:${HOST_RUNTIME_CONTROL_REQUEST_SCHEMA}`]);
|
|
7784
7856
|
if (!isOperation2(value.operation)) throw invalid2("invalid_request_schema");
|
|
7785
7857
|
assertPrefix(value.prefix);
|
|
@@ -7936,7 +8008,7 @@ function sameSelection(left, right) {
|
|
|
7936
8008
|
function assertPrefix(value) {
|
|
7937
8009
|
if (!isAbsoluteNormalizedNonRootPath(value) || /[\r\n]/u.test(value)) throw invalid2("invalid_prefix");
|
|
7938
8010
|
}
|
|
7939
|
-
function
|
|
8011
|
+
function hasExactKeys2(value, required, optional) {
|
|
7940
8012
|
const allowed = /* @__PURE__ */ new Set([...required, ...optional]);
|
|
7941
8013
|
const keys = Object.keys(value);
|
|
7942
8014
|
return required.every((key) => Object.hasOwn(value, key)) && keys.every((key) => allowed.has(key));
|