@corca-org/ceal-host-linux-arm64 1.0.15 → 1.0.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/ceal-host +0 -0
- package/libexec/ceal-host/claude-hook.mjs +264 -293
- package/libexec/ceal-host/claude-invocation-authentication.mjs +263 -295
- package/libexec/ceal-host/claude-producer.mjs +263 -295
- package/libexec/ceal-host/codex-hook.mjs +283 -413
- package/libexec/ceal-host/codex-invocation-authentication.mjs +276 -302
- package/libexec/ceal-host/codex-producer.mjs +276 -302
- package/libexec/ceal-host/control.mjs +296 -322
- package/libexec/ceal-host/relay.mjs +292 -308
- package/package.json +1 -1
- package/share/ceal-host/bundle-manifest.json +12 -12
- package/share/ceal-host/bundle-manifest.sigstore.json +1 -1
|
@@ -178,7 +178,7 @@ var client_wire_contract_default = {
|
|
|
178
178
|
"prompt"
|
|
179
179
|
],
|
|
180
180
|
discovery_command: "discovery",
|
|
181
|
-
discovery_manifest_schema_version: "ceal.discovery_manifest.
|
|
181
|
+
discovery_manifest_schema_version: "ceal.discovery_manifest.v1",
|
|
182
182
|
discovery_manifest_document_fields: [
|
|
183
183
|
"discovery_manifest"
|
|
184
184
|
],
|
|
@@ -252,10 +252,11 @@ var CEAL_AUDIT_OUTCOMES = vocabulary(["succeeded", "denied", "failed"]);
|
|
|
252
252
|
var CEAL_GATEWAY_PROVIDER_STEP_OUTCOMES = vocabulary(["completed", "rejected", "throttled", "failed"]);
|
|
253
253
|
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"]);
|
|
254
254
|
var CEAL_GATEWAY_READ_REUSE_UNAVAILABLE_REASONS = vocabulary(["not_reported", "storage_unavailable", "coverage_incomplete", "freshness_refresh_required", "not_reusable", "bypassed"]);
|
|
255
|
+
var CEAL_GATEWAY_DERIVED_STORE_FAILURE_CLASSES = vocabulary(["storage_unavailable", "decode_mismatch", "write_conflict", "quota", "store_error"]);
|
|
255
256
|
var CEAL_POLICY_DECISIONS = vocabulary(["allowed", "denied", "not_evaluated"]);
|
|
256
257
|
var CEAL_CONNECTOR_ROUTE_PHASES = vocabulary(["scope_observation", "target_selection", "route_resolution"]);
|
|
257
258
|
var CEAL_CONNECTOR_ROUTE_CAUSES = vocabulary(["provider_throttled", "provider_unavailable", "binding_invalid", "scope_limit_exceeded"]);
|
|
258
|
-
var CEAL_WRITE_SOURCE_KINDS = vocabulary(["authenticated_registered_client", "
|
|
259
|
+
var CEAL_WRITE_SOURCE_KINDS = vocabulary(["authenticated_registered_client", "provider_authenticated_event"]);
|
|
259
260
|
var CEAL_REFRESH_DELIVERIES = vocabulary(["initial", "recovery", "replay", "terminal_failure", "recovery_unavailable"]);
|
|
260
261
|
var CEAL_CLIENT_OPERATIONS = vocabulary(["handshake", "discover", "call", "readback"]);
|
|
261
262
|
var CEAL_WRITE_IDEMPOTENCY_POSTURES = vocabulary(["required", "optional", "not_required"]);
|
|
@@ -265,6 +266,17 @@ var CEAL_WRITE_RECEIPT_PROVIDER_STATES = vocabulary(["outcome_unknown", "verifie
|
|
|
265
266
|
var CEAL_WRITE_RECEIPT_PROVIDER_READBACKS = vocabulary(["outcome_unknown", "verified", "not_applied"]);
|
|
266
267
|
var CEAL_PROTOCOL_VERSION = "1.4.0";
|
|
267
268
|
var CEAL_OPERATION_ACCESS_SCHEMA_VERSION = "ceal.operation_access.v1";
|
|
269
|
+
var CEAL_GATEWAY_ACTIVE_CALL_PHASES = vocabulary([
|
|
270
|
+
"audited_call_pending",
|
|
271
|
+
"continuation_read_pending",
|
|
272
|
+
"continuation_write_pending",
|
|
273
|
+
"provider_pacing_pending",
|
|
274
|
+
"corpus_replay_pending",
|
|
275
|
+
"corpus_append_pending",
|
|
276
|
+
"corpus_fence_pending",
|
|
277
|
+
"corpus_content_pending",
|
|
278
|
+
"corpus_transaction_pending"
|
|
279
|
+
]);
|
|
268
280
|
var CEAL_CONNECTOR_ROUTE_FAILURE_KEYS = vocabulary(["connector_kind", "phase", "schema_version"]);
|
|
269
281
|
var CEAL_CLASSIFIED_CONNECTOR_ROUTE_FAILURE_KEYS = vocabulary(["cause", ...CEAL_CONNECTOR_ROUTE_FAILURE_KEYS]);
|
|
270
282
|
var CEAL_UNCLASSIFIED_CONNECTOR_ROUTE_FAILURE_KEYS = vocabulary(["connector_kind", "error_class", "phase", "schema_version"]);
|
|
@@ -274,10 +286,130 @@ var CEAL_GATEWAY_ORGANIZATION_ROUTE_FACT_CALL_KEYS = Object.freeze([
|
|
|
274
286
|
"policy_decision_revision"
|
|
275
287
|
]);
|
|
276
288
|
|
|
289
|
+
// packages/ceal-client-protocol/src/operation-next-actions.ts
|
|
290
|
+
var CEAL_REPEAT_REQUEST_NEXT_ACTION = "repeat_request";
|
|
291
|
+
var CEAL_INSPECT_RECEIPT_NEXT_ACTION = "inspect_receipt";
|
|
292
|
+
var CALLER_RECOVERABLE_NEXT_ACTION_VALUES = [
|
|
293
|
+
"select_did_you_mean",
|
|
294
|
+
"choose_new_output_path",
|
|
295
|
+
"choose_new_idempotency_key",
|
|
296
|
+
"restart_search",
|
|
297
|
+
"repeat_original_arguments",
|
|
298
|
+
// The occurrence this call addressed is settled and cannot move again -- a
|
|
299
|
+
// denied effect approval, an expired continuation -- so the caller runs the
|
|
300
|
+
// same call again as a new request. The refusal names the re-request; this
|
|
301
|
+
// word is the re-request.
|
|
302
|
+
CEAL_REPEAT_REQUEST_NEXT_ACTION,
|
|
303
|
+
"choose_new_request_identity",
|
|
304
|
+
// A refusal that names the argument (invalid_argument with `property`) tells the caller exactly what to change.
|
|
305
|
+
"correct_argument",
|
|
306
|
+
// A resolver-owned input must move from caller operands into the declared
|
|
307
|
+
// resolver selection field.
|
|
308
|
+
"supply_resolver_selections",
|
|
309
|
+
// The graph names an upstream node whose Operation produces the resolver's
|
|
310
|
+
// occurrence, and it has not produced one yet. The caller runs that node
|
|
311
|
+
// first; the refusal used to share a code with a malformed resolver result,
|
|
312
|
+
// which is not fixable, so neither could carry a remedy.
|
|
313
|
+
"run_resolver_dependency",
|
|
314
|
+
// A replay carries the input the occurrence durably admitted, and this one
|
|
315
|
+
// carries a different one. The caller fixes it by presenting the original
|
|
316
|
+
// invocation, so it is a remedy; the coordinator minted the word at the
|
|
317
|
+
// replay guard and never declared it, which read as unguided to the scorer.
|
|
318
|
+
"use_original_input",
|
|
319
|
+
// The same mismatch on the Request binding rather than the input: the
|
|
320
|
+
// occurrence was admitted under one binding and the replay presents another.
|
|
321
|
+
"use_original_request_binding",
|
|
322
|
+
// The client's own filesystem write was refused -- EACCES, EPERM, or a
|
|
323
|
+
// read-only mount -- which is how an agent sandbox fences writes outside its
|
|
324
|
+
// workspace. The caller reruns the same command with unsandboxed or escalated
|
|
325
|
+
// execution; re-adopting the session cannot help, because the sandbox refuses
|
|
326
|
+
// that write too.
|
|
327
|
+
"rerun_outside_agent_sandbox",
|
|
328
|
+
// The refusal names the one Operation to read next in `describe_command`:
|
|
329
|
+
// an absent Operation id with a sole catalog-ranked candidate, or a known
|
|
330
|
+
// Operation invoked without its input. Describing only reads the verified
|
|
331
|
+
// contract and dispatches nothing, and the caller then retries with the
|
|
332
|
+
// named Operation or input, so it is guidance the scorer counts.
|
|
333
|
+
"describe_operation",
|
|
334
|
+
// The refusal names the caller's own personal connect Operation in
|
|
335
|
+
// `required_action_sequence`: the Operation asked for, or the credential
|
|
336
|
+
// the call ran on, needs a personal connection the caller does not hold
|
|
337
|
+
// (never connected, revoked, or expired). The caller runs that exact
|
|
338
|
+
// Operation, completes the consent it hands back, and retries the same call.
|
|
339
|
+
"connect_personal_account",
|
|
340
|
+
// The provider or Gateway named a bounded wait; the caller waits that long
|
|
341
|
+
// and submits the same read again.
|
|
342
|
+
"retry_after",
|
|
343
|
+
// The ref names a container of rows (a Notion database or data source), which
|
|
344
|
+
// has no body of its own; the caller searches its rows instead of reading it.
|
|
345
|
+
"search_container_rows"
|
|
346
|
+
];
|
|
347
|
+
var CEAL_CALLER_RECOVERABLE_NEXT_ACTIONS = Object.freeze(CALLER_RECOVERABLE_NEXT_ACTION_VALUES);
|
|
348
|
+
var NON_REMEDY_NEXT_ACTION_VALUES = [
|
|
349
|
+
// Only an administrator can take the named step -- approving a place for an
|
|
350
|
+
// Operation, granting a withheld capability -- so a non-administrator asks
|
|
351
|
+
// one. The refusal names the administrator step; this word is the ask.
|
|
352
|
+
"ask_admin",
|
|
353
|
+
"await_pending_approval",
|
|
354
|
+
"check_gateway",
|
|
355
|
+
"inspect_context_store",
|
|
356
|
+
"inspect_gateway",
|
|
357
|
+
"inspect_local_cache",
|
|
358
|
+
// The thin client prints these on its own behalf, before or after the wire.
|
|
359
|
+
// They were declared only as `CealClientLocalRemedy` keys and, for two of
|
|
360
|
+
// them, only as Go string literals -- a second and third vocabulary for one
|
|
361
|
+
// thing. `CealClientLocalRemedy` derives from this list now, so the client's
|
|
362
|
+
// remedies cannot drift from the words the protocol knows.
|
|
363
|
+
"inspect_local_client",
|
|
364
|
+
"inspect_local_command",
|
|
365
|
+
"inspect_local_output",
|
|
366
|
+
"inspect_local_route",
|
|
367
|
+
CEAL_INSPECT_RECEIPT_NEXT_ACTION,
|
|
368
|
+
"inspect_request",
|
|
369
|
+
"none",
|
|
370
|
+
// The provider refused because of its own configuration -- an API not
|
|
371
|
+
// enabled, an app scope missing -- which an operator changes in that
|
|
372
|
+
// provider's console. No caller edit and no retry fixes it.
|
|
373
|
+
"operator_action",
|
|
374
|
+
"recover",
|
|
375
|
+
"reconcile",
|
|
376
|
+
// Reconciliation of one named occurrence, not of the deployment: an
|
|
377
|
+
// occurrence with no admitted input commitment cannot be replayed safely and
|
|
378
|
+
// no edit to the call changes that. `reconcile` is the deployment-wide word.
|
|
379
|
+
"reconcile_occurrence",
|
|
380
|
+
"reduce_request_size",
|
|
381
|
+
// The Host's invocation context for this turn is stale or expired at the
|
|
382
|
+
// Gateway. The Host's next turn rebinds it and the same call then succeeds;
|
|
383
|
+
// nothing in the call changes, so it is not a remedy the scorer may count.
|
|
384
|
+
"refresh_host_invocation_context",
|
|
385
|
+
"repair_or_adopt_session",
|
|
386
|
+
"retry",
|
|
387
|
+
// The owner -- a correlation hook, an approval hook -- is not serving right
|
|
388
|
+
// now. The caller changes nothing and the same call succeeds once the owner
|
|
389
|
+
// is back, so this is not a remedy the scorer may count as guidance.
|
|
390
|
+
"retry_after_owner_recovery",
|
|
391
|
+
"retry_same_receipt_read",
|
|
392
|
+
"run_file_search_again",
|
|
393
|
+
"select_exact_approval"
|
|
394
|
+
];
|
|
395
|
+
var CEAL_NON_REMEDY_NEXT_ACTIONS = Object.freeze(NON_REMEDY_NEXT_ACTION_VALUES);
|
|
396
|
+
var DECLARED = /* @__PURE__ */ new Set([...CEAL_CALLER_RECOVERABLE_NEXT_ACTIONS, ...CEAL_NON_REMEDY_NEXT_ACTIONS]);
|
|
397
|
+
var RETRY_PROMISE_NEXT_ACTIONS = ["retry", "retry_after"];
|
|
398
|
+
var RETRY_PROMISE = new Set(RETRY_PROMISE_NEXT_ACTIONS);
|
|
399
|
+
var RECOVERABLE = new Set(CEAL_CALLER_RECOVERABLE_NEXT_ACTIONS);
|
|
400
|
+
var CEAL_OPERATION_WITHHELD_NEXT_ACTIONS = Object.freeze({
|
|
401
|
+
provider_permission: "ask_admin",
|
|
402
|
+
access_level: "ask_admin",
|
|
403
|
+
personal_authorization_required: "connect_personal_account"
|
|
404
|
+
});
|
|
405
|
+
|
|
406
|
+
// packages/ceal-client-protocol/src/operation-withheld-cause.ts
|
|
407
|
+
var CEAL_OPERATION_WITHHELD_CAUSES = vocabulary(["provider_permission", "access_level", "personal_authorization_required"]);
|
|
408
|
+
|
|
277
409
|
// packages/ceal-client-protocol/src/operation-contract-types.ts
|
|
278
410
|
var CEAL_JSON_SCHEMA_2020_12 = "https://json-schema.org/draft/2020-12/schema";
|
|
279
411
|
var CEAL_OPERATION_ERROR_SCHEMA_VERSION = "ceal.operation_error.v1";
|
|
280
|
-
var
|
|
412
|
+
var CEAL_ARTIFACT_STAGE_TERMINALS = vocabulary(["chunk_accepted", "artifact_ready", "idempotency_replayed"]);
|
|
281
413
|
var CEAL_RETRY_AFTER_MAX_MS = 60 * 60 * 1e3;
|
|
282
414
|
var CEAL_JSON_SCHEMA_TYPES = vocabulary(["object", "array", "string", "integer", "number", "boolean", "null"]);
|
|
283
415
|
var OBSERVATION_POSTURES = vocabulary(["direct_readback", "approved_no_readback", "operator_mediated", "excluded"]);
|
|
@@ -541,6 +673,8 @@ var CEAL_PROVIDER_BOUNDARY_KINDS = vocabulary([
|
|
|
541
673
|
var CEAL_PROVIDER_BOUNDARY_EVIDENCE = vocabulary(["provider_readback", "operator_stated"]);
|
|
542
674
|
var CEAL_ACCESS_LEVELS = vocabulary(["none", "read", "read_write"]);
|
|
543
675
|
var CEAL_PERSONAL_ACCESS_CEILINGS = vocabulary(["disabled", "read", "read_write"]);
|
|
676
|
+
var CEAL_TARGET_REF_PATTERN = "^[^\\p{Cc}]+$";
|
|
677
|
+
var TARGET_REF = new RegExp(CEAL_TARGET_REF_PATTERN, "u");
|
|
544
678
|
var CEAL_TARGET_VISIBILITIES = vocabulary(["public", "private"]);
|
|
545
679
|
var CEAL_PRINCIPAL_KINDS = vocabulary(["human", "service", "runtime"]);
|
|
546
680
|
var CEAL_ORGANIZATION_ROLES = vocabulary(["member", "admin"]);
|
|
@@ -649,8 +783,6 @@ var CEAL_OPERATION_AUTHORITY_POLICY_KEYS = Object.freeze(["access_group", "insta
|
|
|
649
783
|
var MAX_OPERATION_INPUT_RESOLVER_BINDINGS = 96;
|
|
650
784
|
var CEAL_OPERATION_DESCRIPTOR_REQUIRED_ENVELOPE_KEYS = Object.freeze(["schema_version", "id", "input_contract", "result_contract", "policy"]);
|
|
651
785
|
var CEAL_OPERATION_DESCRIPTOR_OPTIONAL_ENVELOPE_KEYS = Object.freeze(["input_resolution", "summary"]);
|
|
652
|
-
var CEAL_OPERATION_RESULT_KEYS = vocabulary(["ok", "operation_id", "operation_receipt", "schema_version", "value"]);
|
|
653
|
-
var CEAL_OPERATION_COMPACT_RESULT_KEYS = vocabulary(["ok", "operation_evidence", "operation_id", "schema_version", "value"]);
|
|
654
786
|
|
|
655
787
|
// packages/ceal-client-protocol/src/operation-catalog.ts
|
|
656
788
|
var CEAL_OPERATION_CATALOG_SCHEMA_VERSION = "ceal.catalog.v3";
|
|
@@ -662,8 +794,8 @@ var CEAL_SCHEMA_LITERALS = [
|
|
|
662
794
|
"ceal.activation_transport.v1",
|
|
663
795
|
CEAL_OPERATION_ACCESS_SCHEMA_VERSION,
|
|
664
796
|
CEAL_OPERATION_CATALOG_SCHEMA_VERSION,
|
|
665
|
-
"ceal.client_refresh_request.
|
|
666
|
-
"ceal.client_refresh_result.
|
|
797
|
+
"ceal.client_refresh_request.v1",
|
|
798
|
+
"ceal.client_refresh_result.v1",
|
|
667
799
|
"ceal.client_revoke_request.v1",
|
|
668
800
|
"ceal.client_revoke_result.v1",
|
|
669
801
|
CEAL_COMMAND_REQUEST_SCHEMA_VERSION,
|
|
@@ -692,7 +824,7 @@ var CEAL_SCHEMA_LITERALS = [
|
|
|
692
824
|
"ceal.gateway_call_result.v1",
|
|
693
825
|
CEAL_GATEWAY_COMMAND_RESOLUTION_SCHEMA_VERSION,
|
|
694
826
|
"ceal.gateway_connector_route_failure.v1",
|
|
695
|
-
"ceal.gateway_discovery.
|
|
827
|
+
"ceal.gateway_discovery.v1",
|
|
696
828
|
"ceal.gateway_handshake.v1",
|
|
697
829
|
"ceal.gateway_installation_activation_code_issue_request.v1",
|
|
698
830
|
"ceal.gateway_installation_activation_code_issue_result.v1",
|
|
@@ -714,10 +846,6 @@ var CEAL_SCHEMA_LITERALS = [
|
|
|
714
846
|
"ceal.host_observation.v1",
|
|
715
847
|
"ceal.host_registration_request.v1",
|
|
716
848
|
"ceal.host_registration_result.v1",
|
|
717
|
-
"ceal.leased-resource-stream.v2",
|
|
718
|
-
"ceal.leased_consumer_attachment_stream_frame.v2",
|
|
719
|
-
"ceal.leased_consumer_attachment_stream_request.v2",
|
|
720
|
-
"ceal.leased_consumer_attachment_stream_transport.v2",
|
|
721
849
|
"ceal.operation_descriptor.v1",
|
|
722
850
|
"ceal.operation_error.v1",
|
|
723
851
|
"ceal.operation_failure.v1",
|
|
@@ -725,7 +853,7 @@ var CEAL_SCHEMA_LITERALS = [
|
|
|
725
853
|
"ceal.operation_receipt.v1",
|
|
726
854
|
"ceal.operation_result.v1",
|
|
727
855
|
"ceal.operation_result.compact.v1",
|
|
728
|
-
"ceal.local_result_materialization.
|
|
856
|
+
"ceal.local_result_materialization.v1",
|
|
729
857
|
"ceal.local_result_root.v1",
|
|
730
858
|
"ceal.owner_bootstrap_exchange_request.v1",
|
|
731
859
|
"ceal.owner_bootstrap_exchange_result.v1",
|
|
@@ -743,12 +871,6 @@ var CEAL_SCHEMA_LITERAL_SET = new Set(CEAL_SCHEMA_LITERALS);
|
|
|
743
871
|
// packages/ceal-client-protocol/src/bounded-series.ts
|
|
744
872
|
import { join } from "node:path";
|
|
745
873
|
var CEAL_BOUNDED_SERIES_CATALOG = Object.freeze({
|
|
746
|
-
usage_record: (root) => join(root, "run-usage.jsonl"),
|
|
747
|
-
control_commit: (root) => join(root, "control-auto-commit.jsonl"),
|
|
748
|
-
engagement_signal: (root) => join(root, "runtime-state", "slack-feedback.jsonl"),
|
|
749
|
-
runtime_error: (root) => join(root, "runtime-state", "runtime-errors.jsonl"),
|
|
750
|
-
turn_bridge_request: (root) => join(root, ".ceal", "turn-bridge", "requests.jsonl"),
|
|
751
|
-
thread_run_events: (root) => join(root, "run-events.jsonl"),
|
|
752
874
|
bounded_store_sidecar: (root) => `${root}.jsonl`,
|
|
753
875
|
gateway_audit_archive: (root) => `${root}.jsonl`,
|
|
754
876
|
gateway_access_group_connector_control_audit: (root) => `${root}.audit.jsonl`,
|
|
@@ -781,146 +903,8 @@ var CEAL_HOST_REGISTRATION_ATTEMPT_REF_PATTERN = new RegExp(`^host-registration-
|
|
|
781
903
|
var CEAL_HOST_INSTALLATION_REF_PATTERN = new RegExp(`^host-installation:${CEAL_LOWERCASE_UUID_PATTERN}$`, "u");
|
|
782
904
|
var CEAL_HOST_SOURCE_REF_PATTERN = new RegExp(`^host-source:${CEAL_LOWERCASE_UUID_PATTERN}$`, "u");
|
|
783
905
|
|
|
784
|
-
// packages/ceal-client-protocol/src/
|
|
785
|
-
var
|
|
786
|
-
"incumbent_admitted",
|
|
787
|
-
"incumbent_draining",
|
|
788
|
-
"drained",
|
|
789
|
-
"candidate_admitted",
|
|
790
|
-
"candidate_draining",
|
|
791
|
-
"rollback_admitted"
|
|
792
|
-
]);
|
|
793
|
-
var CEAL_AGENT_SERVICE_SESSION_RECORD_KEYS = vocabulary([
|
|
794
|
-
"admission_fence",
|
|
795
|
-
"admission_state",
|
|
796
|
-
"admission_state_generation",
|
|
797
|
-
"bearer",
|
|
798
|
-
"consumer_ref",
|
|
799
|
-
"credential_generation",
|
|
800
|
-
"expires_at",
|
|
801
|
-
"gateway_instance",
|
|
802
|
-
"gateway_origin",
|
|
803
|
-
"gateway_serving_generation",
|
|
804
|
-
"issued_at",
|
|
805
|
-
"record_sha256",
|
|
806
|
-
"renew_after",
|
|
807
|
-
"renew_by",
|
|
808
|
-
"schema_version",
|
|
809
|
-
"session_revision"
|
|
810
|
-
]);
|
|
811
|
-
var CEAL_AGENT_SESSION_COMMIT_KEYS = vocabulary(["attempt_ref", "expected_session_revision", "session_revision"]);
|
|
812
|
-
|
|
813
|
-
// packages/ceal-client-protocol/src/operation-next-actions.ts
|
|
814
|
-
var CEAL_REPEAT_REQUEST_NEXT_ACTION = "repeat_request";
|
|
815
|
-
var CEAL_INSPECT_RECEIPT_NEXT_ACTION = "inspect_receipt";
|
|
816
|
-
var CALLER_RECOVERABLE_NEXT_ACTION_VALUES = [
|
|
817
|
-
"select_did_you_mean",
|
|
818
|
-
"choose_new_output_path",
|
|
819
|
-
"choose_new_idempotency_key",
|
|
820
|
-
"restart_search",
|
|
821
|
-
"repeat_original_arguments",
|
|
822
|
-
// The occurrence this call addressed is settled and cannot move again -- a
|
|
823
|
-
// denied effect approval, an expired continuation -- so the caller runs the
|
|
824
|
-
// same call again as a new request. The refusal names the re-request; this
|
|
825
|
-
// word is the re-request.
|
|
826
|
-
CEAL_REPEAT_REQUEST_NEXT_ACTION,
|
|
827
|
-
"choose_new_request_identity",
|
|
828
|
-
// A refusal that names the argument (invalid_argument with `property`) tells the caller exactly what to change.
|
|
829
|
-
"correct_argument",
|
|
830
|
-
// A resolver-owned input must move from caller operands into the declared
|
|
831
|
-
// resolver selection field.
|
|
832
|
-
"supply_resolver_selections",
|
|
833
|
-
// The graph names an upstream node whose Operation produces the resolver's
|
|
834
|
-
// occurrence, and it has not produced one yet. The caller runs that node
|
|
835
|
-
// first; the refusal used to share a code with a malformed resolver result,
|
|
836
|
-
// which is not fixable, so neither could carry a remedy.
|
|
837
|
-
"run_resolver_dependency",
|
|
838
|
-
// A replay carries the input the occurrence durably admitted, and this one
|
|
839
|
-
// carries a different one. The caller fixes it by presenting the original
|
|
840
|
-
// invocation, so it is a remedy; the coordinator minted the word at the
|
|
841
|
-
// replay guard and never declared it, which read as unguided to the scorer.
|
|
842
|
-
"use_original_input",
|
|
843
|
-
// The same mismatch on the Request binding rather than the input: the
|
|
844
|
-
// occurrence was admitted under one binding and the replay presents another.
|
|
845
|
-
"use_original_request_binding",
|
|
846
|
-
// The client's own filesystem write was refused -- EACCES, EPERM, or a
|
|
847
|
-
// read-only mount -- which is how an agent sandbox fences writes outside its
|
|
848
|
-
// workspace. The caller reruns the same command with unsandboxed or escalated
|
|
849
|
-
// execution; re-adopting the session cannot help, because the sandbox refuses
|
|
850
|
-
// that write too.
|
|
851
|
-
"rerun_outside_agent_sandbox",
|
|
852
|
-
// The refusal names the one Operation to read next in `describe_command`:
|
|
853
|
-
// an absent Operation id with a sole catalog-ranked candidate, or a known
|
|
854
|
-
// Operation invoked without its input. Describing only reads the verified
|
|
855
|
-
// contract and dispatches nothing, and the caller then retries with the
|
|
856
|
-
// named Operation or input, so it is guidance the scorer counts.
|
|
857
|
-
"describe_operation",
|
|
858
|
-
// The refusal names the caller's own personal connect Operation in
|
|
859
|
-
// `required_action_sequence`: the Operation asked for, or the credential
|
|
860
|
-
// the call ran on, needs a personal connection the caller does not hold
|
|
861
|
-
// (never connected, revoked, or expired). The caller runs that exact
|
|
862
|
-
// Operation, completes the consent it hands back, and retries the same call.
|
|
863
|
-
"connect_personal_account",
|
|
864
|
-
// The provider or Gateway named a bounded wait; the caller waits that long
|
|
865
|
-
// and submits the same read again.
|
|
866
|
-
"retry_after"
|
|
867
|
-
];
|
|
868
|
-
var CEAL_CALLER_RECOVERABLE_NEXT_ACTIONS = Object.freeze(CALLER_RECOVERABLE_NEXT_ACTION_VALUES);
|
|
869
|
-
var NON_REMEDY_NEXT_ACTION_VALUES = [
|
|
870
|
-
// Only an administrator can take the named step -- approving a place for an
|
|
871
|
-
// Operation, granting a withheld capability -- so a non-administrator asks
|
|
872
|
-
// one. The refusal names the administrator step; this word is the ask.
|
|
873
|
-
"ask_admin",
|
|
874
|
-
"await_pending_approval",
|
|
875
|
-
"check_gateway",
|
|
876
|
-
"inspect_context_store",
|
|
877
|
-
"inspect_gateway",
|
|
878
|
-
"inspect_local_cache",
|
|
879
|
-
// The thin client prints these on its own behalf, before or after the wire.
|
|
880
|
-
// They were declared only as `CealClientLocalRemedy` keys and, for two of
|
|
881
|
-
// them, only as Go string literals -- a second and third vocabulary for one
|
|
882
|
-
// thing. `CealClientLocalRemedy` derives from this list now, so the client's
|
|
883
|
-
// remedies cannot drift from the words the protocol knows.
|
|
884
|
-
"inspect_local_client",
|
|
885
|
-
"inspect_local_command",
|
|
886
|
-
"inspect_local_output",
|
|
887
|
-
"inspect_local_route",
|
|
888
|
-
CEAL_INSPECT_RECEIPT_NEXT_ACTION,
|
|
889
|
-
"inspect_request",
|
|
890
|
-
"none",
|
|
891
|
-
// The provider refused because of its own configuration -- an API not
|
|
892
|
-
// enabled, an app scope missing -- which an operator changes in that
|
|
893
|
-
// provider's console. No caller edit and no retry fixes it.
|
|
894
|
-
"operator_action",
|
|
895
|
-
"recover",
|
|
896
|
-
"reconcile",
|
|
897
|
-
// Reconciliation of one named occurrence, not of the deployment: an
|
|
898
|
-
// occurrence with no admitted input commitment cannot be replayed safely and
|
|
899
|
-
// no edit to the call changes that. `reconcile` is the deployment-wide word.
|
|
900
|
-
"reconcile_occurrence",
|
|
901
|
-
"reduce_request_size",
|
|
902
|
-
// The Host's invocation context for this turn is stale or expired at the
|
|
903
|
-
// Gateway. The Host's next turn rebinds it and the same call then succeeds;
|
|
904
|
-
// nothing in the call changes, so it is not a remedy the scorer may count.
|
|
905
|
-
"refresh_host_invocation_context",
|
|
906
|
-
"repair_or_adopt_session",
|
|
907
|
-
"retry",
|
|
908
|
-
// The owner -- a correlation hook, an approval hook -- is not serving right
|
|
909
|
-
// now. The caller changes nothing and the same call succeeds once the owner
|
|
910
|
-
// is back, so this is not a remedy the scorer may count as guidance.
|
|
911
|
-
"retry_after_owner_recovery",
|
|
912
|
-
"retry_same_receipt_read",
|
|
913
|
-
"run_file_search_again",
|
|
914
|
-
"select_exact_approval"
|
|
915
|
-
];
|
|
916
|
-
var CEAL_NON_REMEDY_NEXT_ACTIONS = Object.freeze(NON_REMEDY_NEXT_ACTION_VALUES);
|
|
917
|
-
var DECLARED = /* @__PURE__ */ new Set([...CEAL_CALLER_RECOVERABLE_NEXT_ACTIONS, ...CEAL_NON_REMEDY_NEXT_ACTIONS]);
|
|
918
|
-
var RECOVERABLE = new Set(CEAL_CALLER_RECOVERABLE_NEXT_ACTIONS);
|
|
919
|
-
var CEAL_OPERATION_WITHHELD_NEXT_ACTIONS = Object.freeze({
|
|
920
|
-
provider_permission: "ask_admin",
|
|
921
|
-
access_level: "ask_admin",
|
|
922
|
-
personal_authorization_required: "connect_personal_account"
|
|
923
|
-
});
|
|
906
|
+
// packages/ceal-client-protocol/src/operation-result-completeness.ts
|
|
907
|
+
var CEAL_READ_VALUE_CONTINUATION_KEYS = vocabulary(["continuation", "continuation_ref", "next_cursor"]);
|
|
924
908
|
|
|
925
909
|
// packages/ceal-client-protocol/src/operation-contract-artifact.ts
|
|
926
910
|
var CATALOG_REVISION = new RegExp(CEAL_VERIFIED_ARTIFACT_CATALOG_REVISION_PATTERN, "u");
|
|
@@ -929,7 +913,9 @@ var CEAL_OPERATION_INVOKE_COMMAND = "invoke";
|
|
|
929
913
|
var CEAL_OPERATION_INPUT_FLAG = "--input";
|
|
930
914
|
var CEAL_OPERATION_ID_PLACEHOLDER = "<operation-id>";
|
|
931
915
|
var CEAL_OPERATION_INPUT_PLACEHOLDER = "<json-object>";
|
|
932
|
-
var
|
|
916
|
+
var MODEL_INVOCATION_BASE_ARGUMENTS = [CEAL_OPERATION_INVOKE_COMMAND, CEAL_OPERATION_ID_PLACEHOLDER].join(" ");
|
|
917
|
+
var CEAL_MODEL_INVOCATION_ARGUMENTS = [MODEL_INVOCATION_BASE_ARGUMENTS, CEAL_OPERATION_INPUT_FLAG, shellSingleQuoted(CEAL_OPERATION_INPUT_PLACEHOLDER)].join(" ");
|
|
918
|
+
var CEAL_MODEL_INPUT_SOURCE_GUIDANCE = `For caller-owned fields, add ${CEAL_OPERATION_INPUT_FLAG} ${shellSingleQuoted(CEAL_OPERATION_INPUT_PLACEHOLDER)}. Use inline JSON for short input; for longer or generated input, put exactly one JSON object in a caller-owned regular non-symlink UTF-8 JSON file and pass --input @path; relative paths resolve from the command working directory.`;
|
|
933
919
|
function shellSingleQuoted(value) {
|
|
934
920
|
return `'${value.replaceAll("'", "'\\''")}'`;
|
|
935
921
|
}
|
|
@@ -961,76 +947,7 @@ var CEAL_VERIFIED_ARTIFACT_DESCRIPTOR_JSON_SCHEMA = Object.freeze({
|
|
|
961
947
|
}
|
|
962
948
|
});
|
|
963
949
|
|
|
964
|
-
// packages/ceal-client-protocol/src/
|
|
965
|
-
var REQUIRED_FIELDS = CEAL_CLIENT_WIRE_CONTRACT.command_response.bare_document_fields;
|
|
966
|
-
var OPTIONAL_FIELDS = CEAL_CLIENT_WIRE_CONTRACT.command_response.bare_document_optional_fields;
|
|
967
|
-
|
|
968
|
-
// packages/ceal-client-protocol/src/leased-consumer-vocabulary.ts
|
|
969
|
-
var CEAL_TERMINAL_DISPOSITIONS = vocabulary(["completed", "failed", "cancelled"]);
|
|
970
|
-
var CEAL_LEASE_DISPOSITIONS = vocabulary([...CEAL_TERMINAL_DISPOSITIONS, "deferred"]);
|
|
971
|
-
var CEAL_AUTOMATIC_FEEDBACK_INTENTS = vocabulary(["initial"]);
|
|
972
|
-
var CEAL_LEASED_MESSAGE_DELIVERY_OPERATION_IDS = vocabulary(["message.send", "message.update", "message.delete"]);
|
|
973
|
-
var CEAL_REPOSITORY_VISIBILITIES = vocabulary(["public", "private", "internal"]);
|
|
974
|
-
var CEAL_RESULT_DELIVERY_OFFERS = vocabulary(["pending", "offered", "transport_lost"]);
|
|
975
|
-
var CEAL_RESULT_DELIVERY_STATES = vocabulary(["unavailable", ...CEAL_RESULT_DELIVERY_OFFERS]);
|
|
976
|
-
var CEAL_PROVIDER_OUTCOMES = vocabulary(["not_attempted", "outcome_unknown", "verified"]);
|
|
977
|
-
var CEAL_ACTIVITY_GAP_CODES = vocabulary([
|
|
978
|
-
"provider_page_budget",
|
|
979
|
-
"call_deadline",
|
|
980
|
-
"related_item_budget",
|
|
981
|
-
"provider_cursor_unavailable",
|
|
982
|
-
"malformed_provider_page",
|
|
983
|
-
"visibility_incomplete",
|
|
984
|
-
"unsupported_event_kind"
|
|
985
|
-
]);
|
|
986
|
-
var CEAL_ACTIVITY_CONNECTOR_KINDS = vocabulary(["slack", "github", "google-calendar", "google-drive", "notion"]);
|
|
987
|
-
var CEAL_ACTIVITY_COVERAGE_STATUSES = vocabulary(["complete_for_target", "continuation_required", "blocked"]);
|
|
988
|
-
var CEAL_ACTIVITY_EVENT_KINDS = vocabulary([
|
|
989
|
-
"slack.message",
|
|
990
|
-
"slack.reply",
|
|
991
|
-
"slack.direct_message",
|
|
992
|
-
"github.commit.authored",
|
|
993
|
-
"github.issue.opened",
|
|
994
|
-
"github.pull_request.opened",
|
|
995
|
-
"github.review.submitted",
|
|
996
|
-
"github.issue_comment.created",
|
|
997
|
-
"github.review_comment.created",
|
|
998
|
-
"calendar.organized",
|
|
999
|
-
"calendar.accepted_invite",
|
|
1000
|
-
"calendar.recorded",
|
|
1001
|
-
"drive.file.created",
|
|
1002
|
-
"drive.file.modified",
|
|
1003
|
-
"drive.file.viewed",
|
|
1004
|
-
"notion.page.created",
|
|
1005
|
-
"notion.page.edited"
|
|
1006
|
-
]);
|
|
1007
|
-
var CEAL_ACTIVITY_TIMESTAMP_BASES = vocabulary([
|
|
1008
|
-
"message_created",
|
|
1009
|
-
"commit_authored",
|
|
1010
|
-
"resource_created",
|
|
1011
|
-
"review_submitted",
|
|
1012
|
-
"comment_created",
|
|
1013
|
-
"event_start",
|
|
1014
|
-
"all_day_start",
|
|
1015
|
-
"file_created",
|
|
1016
|
-
"file_modified",
|
|
1017
|
-
"file_modified_by_me",
|
|
1018
|
-
"file_viewed_by_me",
|
|
1019
|
-
"page_created",
|
|
1020
|
-
"page_last_edited",
|
|
1021
|
-
"resource_modified"
|
|
1022
|
-
]);
|
|
1023
|
-
var CEAL_ACTIVITY_V3_KINDS = vocabulary(["authored", "edited", "messaged", "responded"]);
|
|
1024
|
-
var CEAL_RESOURCE_TIME_BASES = vocabulary(["created", "modified", "viewed"]);
|
|
1025
|
-
var CEAL_RESOURCE_SEARCH_ORDERS = vocabulary(["relevance", "modified", "viewed", "created"]);
|
|
1026
|
-
var CEAL_RESOURCE_SEARCH_DIRECTIONS = vocabulary(["ascending", "descending"]);
|
|
1027
|
-
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"]);
|
|
1028
|
-
var CEAL_ARTIFACT_STAGE_TERMINALS = vocabulary(["chunk_accepted", "artifact_ready", "idempotency_replayed"]);
|
|
1029
|
-
var CEAL_READ_ITEM_KINDS = vocabulary(["conversation", "identity", "usergroup", "message", "file", "document"]);
|
|
1030
|
-
var CEAL_LEASED_MESSAGE_SEARCH_COMPLETENESS = vocabulary(["complete", "continuation_available", "truncated"]);
|
|
1031
|
-
var CEAL_OPAQUE_HANDLE_KINDS = vocabulary(["target", "message", "thread", "artifact", "document", "object"]);
|
|
1032
|
-
var CEAL_WRITE_OBJECT_KINDS = vocabulary(["document", "comment", "cell_range"]);
|
|
1033
|
-
var CEAL_CONVERSATION_KINDS = vocabulary(["channel", "dm", "group"]);
|
|
950
|
+
// packages/ceal-client-protocol/src/provider-operation-vocabulary.ts
|
|
1034
951
|
var CEAL_FILE_TYPE_FAMILIES = vocabulary(["all", "image", "pdf"]);
|
|
1035
952
|
var CEAL_GITHUB_ISSUE_STATES = vocabulary(["open", "closed", "all"]);
|
|
1036
953
|
var CEAL_NOTION_UPDATABLE_BLOCK_TYPES = vocabulary([
|
|
@@ -1064,12 +981,92 @@ var CEAL_NOTION_IDENTITY_GAP_REASONS = vocabulary([
|
|
|
1064
981
|
"identity_unlinked"
|
|
1065
982
|
]);
|
|
1066
983
|
var CEAL_NOTION_STRING_VALUE_TYPES = vocabulary(["text", "select", "url", "email", "phone"]);
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
var
|
|
1070
|
-
var
|
|
984
|
+
|
|
985
|
+
// packages/ceal-client-protocol/src/opaque-reference.ts
|
|
986
|
+
var CEAL_OPAQUE_HANDLE_KINDS = vocabulary(["target", "message", "thread", "artifact", "document", "block", "object"]);
|
|
987
|
+
var CEAL_OPAQUE_REF_KINDS = vocabulary([...CEAL_OPAQUE_HANDLE_KINDS, "result", "operation-receipt", "reply-receipt", "field", "notion-data-source"]);
|
|
988
|
+
|
|
989
|
+
// packages/ceal-client-protocol/src/bare-document.ts
|
|
990
|
+
var REQUIRED_FIELDS = CEAL_CLIENT_WIRE_CONTRACT.command_response.bare_document_fields;
|
|
991
|
+
var OPTIONAL_FIELDS = CEAL_CLIENT_WIRE_CONTRACT.command_response.bare_document_optional_fields;
|
|
1071
992
|
|
|
1072
993
|
// packages/ceal-client-protocol/src/resource-row.ts
|
|
994
|
+
var CEAL_RESOURCE_SEARCH_ORDERS = vocabulary(["relevance", "modified", "viewed", "created"]);
|
|
995
|
+
var CEAL_RESOURCE_SEARCH_DIRECTIONS = vocabulary(["ascending", "descending"]);
|
|
996
|
+
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"]);
|
|
997
|
+
var CEAL_RESOURCE_TIME_BASES = vocabulary(["created", "modified", "viewed"]);
|
|
998
|
+
var CEAL_REPOSITORY_VISIBILITIES = vocabulary(["public", "private", "internal"]);
|
|
999
|
+
var CEAL_ACTIVITY_V3_KINDS = vocabulary(["authored", "edited", "messaged", "responded"]);
|
|
1000
|
+
var CEAL_ACTIVITY_TIMESTAMP_BASES = vocabulary([
|
|
1001
|
+
"message_created",
|
|
1002
|
+
"commit_authored",
|
|
1003
|
+
"resource_created",
|
|
1004
|
+
"review_submitted",
|
|
1005
|
+
"comment_created",
|
|
1006
|
+
"event_start",
|
|
1007
|
+
"all_day_start",
|
|
1008
|
+
"file_created",
|
|
1009
|
+
"file_modified",
|
|
1010
|
+
"file_modified_by_me",
|
|
1011
|
+
"file_viewed_by_me",
|
|
1012
|
+
"page_created",
|
|
1013
|
+
"page_last_edited",
|
|
1014
|
+
"resource_modified"
|
|
1015
|
+
]);
|
|
1016
|
+
var CEAL_ACTIVITY_CONNECTOR_KINDS = vocabulary(["slack", "github", "google-calendar", "google-drive", "notion"]);
|
|
1017
|
+
var CEAL_ACTIVITY_GAP_CODES = vocabulary([
|
|
1018
|
+
"provider_page_budget",
|
|
1019
|
+
"call_deadline",
|
|
1020
|
+
"related_item_budget",
|
|
1021
|
+
"provider_cursor_unavailable",
|
|
1022
|
+
"malformed_provider_page",
|
|
1023
|
+
"visibility_incomplete",
|
|
1024
|
+
"unsupported_event_kind",
|
|
1025
|
+
"direct_messages_excluded"
|
|
1026
|
+
]);
|
|
1027
|
+
var CEAL_ACTIVITY_EVENT_KINDS = vocabulary([
|
|
1028
|
+
"slack.message",
|
|
1029
|
+
"slack.reply",
|
|
1030
|
+
"slack.direct_message",
|
|
1031
|
+
"github.commit.authored",
|
|
1032
|
+
"github.issue.opened",
|
|
1033
|
+
"github.pull_request.opened",
|
|
1034
|
+
"github.issue.edited",
|
|
1035
|
+
"github.pull_request.edited",
|
|
1036
|
+
"github.review.submitted",
|
|
1037
|
+
"github.issue_comment.created",
|
|
1038
|
+
"github.review_comment.created",
|
|
1039
|
+
"calendar.organized",
|
|
1040
|
+
"calendar.accepted_invite",
|
|
1041
|
+
"calendar.recorded",
|
|
1042
|
+
"drive.file.created",
|
|
1043
|
+
"drive.file.modified",
|
|
1044
|
+
"drive.file.viewed",
|
|
1045
|
+
"notion.page.created",
|
|
1046
|
+
"notion.page.edited"
|
|
1047
|
+
]);
|
|
1048
|
+
var CEAL_ACTIVITY_EVENT_TIMESTAMP_BASIS_MAP = Object.freeze({
|
|
1049
|
+
"slack.message": "message_created",
|
|
1050
|
+
"slack.reply": "message_created",
|
|
1051
|
+
"slack.direct_message": "message_created",
|
|
1052
|
+
"github.commit.authored": "commit_authored",
|
|
1053
|
+
"github.review.submitted": "review_submitted",
|
|
1054
|
+
"github.issue_comment.created": "comment_created",
|
|
1055
|
+
"github.review_comment.created": "comment_created",
|
|
1056
|
+
"github.issue.opened": "resource_created",
|
|
1057
|
+
"github.pull_request.opened": "resource_created",
|
|
1058
|
+
"github.issue.edited": "resource_modified",
|
|
1059
|
+
"github.pull_request.edited": "resource_modified",
|
|
1060
|
+
"calendar.organized": "resource_created",
|
|
1061
|
+
"drive.file.created": "file_created",
|
|
1062
|
+
"drive.file.modified": "file_modified_by_me",
|
|
1063
|
+
"drive.file.viewed": "file_viewed_by_me",
|
|
1064
|
+
"notion.page.created": "page_created",
|
|
1065
|
+
"notion.page.edited": "page_last_edited"
|
|
1066
|
+
});
|
|
1067
|
+
var CEAL_DATED_NOTE_BASES = vocabulary(["recording", "calendar_event", "created_time"]);
|
|
1068
|
+
var CEAL_DATED_NOTE_TRANSCRIPT_STATES = vocabulary(["present", "absent", "unestablished"]);
|
|
1069
|
+
var CEAL_READ_SEARCH_COST_CLASSES = vocabulary(["native_index", "scan"]);
|
|
1073
1070
|
var RESOURCE_ROW_KEY_RULES = Object.freeze({
|
|
1074
1071
|
schema_version: { required: true, timestamp: false },
|
|
1075
1072
|
ref: { required: true, timestamp: false },
|
|
@@ -1082,6 +1079,7 @@ var RESOURCE_ROW_KEY_RULES = Object.freeze({
|
|
|
1082
1079
|
source: { required: true, timestamp: false },
|
|
1083
1080
|
owner: { required: false, timestamp: false },
|
|
1084
1081
|
counterparts: { required: false, timestamp: false },
|
|
1082
|
+
attachments: { required: false, timestamp: false },
|
|
1085
1083
|
created_at: { required: false, timestamp: true },
|
|
1086
1084
|
created_at_local: { required: false, timestamp: true },
|
|
1087
1085
|
modified_at: { required: false, timestamp: true },
|
|
@@ -1092,6 +1090,7 @@ var RESOURCE_ROW_KEY_RULES = Object.freeze({
|
|
|
1092
1090
|
end: { required: false, timestamp: false },
|
|
1093
1091
|
status: { required: false, timestamp: false },
|
|
1094
1092
|
snippet: { required: false, timestamp: false },
|
|
1093
|
+
dated_notes: { required: false, timestamp: false },
|
|
1095
1094
|
state: { required: true, timestamp: false },
|
|
1096
1095
|
timestamp_basis: { required: true, timestamp: false }
|
|
1097
1096
|
});
|
|
@@ -1128,16 +1127,26 @@ var CEAL_WRITE_SAFETY_UNCHECKED_REASONS = vocabulary(["authority_unavailable"]);
|
|
|
1128
1127
|
// packages/ceal-client-protocol/src/operation-occurrence.ts
|
|
1129
1128
|
var MAX_RECEIPT_REVISION = Number.MAX_SAFE_INTEGER - 1;
|
|
1130
1129
|
|
|
1131
|
-
// packages/ceal-client-protocol/src/
|
|
1132
|
-
var
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
var
|
|
1130
|
+
// packages/ceal-client-protocol/src/personal-client-vocabulary.ts
|
|
1131
|
+
var CEAL_PERSONAL_CLIENT_BINDING_KEYS = vocabulary([
|
|
1132
|
+
"access_group_ref",
|
|
1133
|
+
"membership_ref",
|
|
1134
|
+
"registration_ref",
|
|
1135
|
+
"client_ref",
|
|
1136
|
+
"subject_ref",
|
|
1137
|
+
"instance_ref"
|
|
1138
|
+
]);
|
|
1139
|
+
var CEAL_ENROLLMENT_FAILURE_CODES = vocabulary(["enrollment_invalid", "enrollment_expired", "enrollment_used"]);
|
|
1140
|
+
var CEAL_REFRESH_FAILURE_CODES = vocabulary([
|
|
1141
|
+
"refresh_invalid",
|
|
1142
|
+
"refresh_expired",
|
|
1143
|
+
"refresh_inactive",
|
|
1144
|
+
"refresh_replayed",
|
|
1145
|
+
"refresh_revoked",
|
|
1146
|
+
"authority_replaced",
|
|
1147
|
+
"refresh_recovery_unavailable",
|
|
1148
|
+
"refresh_recovery_expired"
|
|
1149
|
+
]);
|
|
1141
1150
|
|
|
1142
1151
|
// packages/ceal-client-protocol/src/request-validation-primitives.ts
|
|
1143
1152
|
import { createHash as createHash2 } from "node:crypto";
|
|
@@ -1223,7 +1232,7 @@ var CEAL_REQUEST_MAX_GRAPH_NODES = 128;
|
|
|
1223
1232
|
|
|
1224
1233
|
// packages/ceal-client-protocol/src/request-run.ts
|
|
1225
1234
|
var CEAL_REQUEST_NODE_STANDING_OCCURRENCE_SCHEMA_VERSION = "ceal.request_node_standing_occurrence.v1";
|
|
1226
|
-
var CEAL_REQUEST_RUN_BATCH_SCHEMA_VERSION = "ceal.request_run_batch.
|
|
1235
|
+
var CEAL_REQUEST_RUN_BATCH_SCHEMA_VERSION = "ceal.request_run_batch.v1";
|
|
1227
1236
|
var REQUEST_ACTION_SAFE_REF_SCHEMA = { type: "string", minLength: 1, maxLength: 128, pattern: SAFE_REF.source };
|
|
1228
1237
|
var REQUEST_ACTION_DIGEST_SCHEMA = { type: "string", minLength: 64, maxLength: 64, pattern: "^[a-f0-9]{64}$" };
|
|
1229
1238
|
var REQUEST_NODE_STANDING_OCCURRENCE_SCHEMA = {
|
|
@@ -1305,6 +1314,10 @@ var CEAL_REQUEST_RUN_BATCH_JSON_SCHEMA = {
|
|
|
1305
1314
|
};
|
|
1306
1315
|
|
|
1307
1316
|
// packages/ceal-client-protocol/src/host-observation.ts
|
|
1317
|
+
var CEAL_HOST_INPUT_KINDS = vocabulary(["human", "host_automatic"]);
|
|
1318
|
+
function isCealHostInputKind(value) {
|
|
1319
|
+
return typeof value === "string" && CEAL_HOST_INPUT_KINDS.some((kind) => kind === value);
|
|
1320
|
+
}
|
|
1308
1321
|
var CEAL_HOST_OBSERVATION_REF_PREFIX = "host-observation:";
|
|
1309
1322
|
var HOST_OBSERVATION_PRODUCER = /^[a-z][a-z0-9]{0,31}$/u;
|
|
1310
1323
|
var HOST_OBSERVATION_DIGEST = /^[a-f0-9]{8,64}$/u;
|
|
@@ -1367,12 +1380,6 @@ var OWNER_WRITE_STATES = Object.freeze(["attempt_started", "provider_acknowledge
|
|
|
1367
1380
|
var OWNER_EFFECT_STATES = Object.freeze(["none", "applied", "failed", "unknown", "reconciled"]);
|
|
1368
1381
|
var OWNER_RECEIPT_STATES = Object.freeze(["pending", "available", "failed", "unknown", "reconciled"]);
|
|
1369
1382
|
|
|
1370
|
-
// packages/ceal-client-protocol/src/thread-excerpt.ts
|
|
1371
|
-
var CEAL_THREAD_RECENT_WINDOW = 6;
|
|
1372
|
-
var CEAL_THREAD_LAST_APP_MESSAGES_WINDOW = 3;
|
|
1373
|
-
var CEAL_THREAD_OLDER_SUMMARY_WINDOW = 4;
|
|
1374
|
-
var CEAL_FED_THREAD_MESSAGE_LIMIT = CEAL_THREAD_RECENT_WINDOW + CEAL_THREAD_OLDER_SUMMARY_WINDOW + CEAL_THREAD_LAST_APP_MESSAGES_WINDOW;
|
|
1375
|
-
|
|
1376
1383
|
// packages/ceal-client-protocol/src/request-graph-readiness.ts
|
|
1377
1384
|
var REQUEST_GRAPH_PRODUCER_TO_APPEND_SCHEMA = {
|
|
1378
1385
|
type: "object",
|
|
@@ -1461,25 +1468,10 @@ var CEAL_HOST_INVOCATION_AUTHENTICATION_RESULT_MAX_BYTES = new TextEncoder().enc
|
|
|
1461
1468
|
`).byteLength;
|
|
1462
1469
|
|
|
1463
1470
|
// packages/ceal-client-protocol/src/client-result-materialization.ts
|
|
1471
|
+
var CEAL_UNREAD_REASONS = vocabulary(["blocked", "unavailable", "too_large", "unsupported", "download_failed", "permission_denied"]);
|
|
1464
1472
|
var CEAL_MODEL_VISIBLE_COMMAND_OUTPUT_MAX_BYTES = 32 * 1024;
|
|
1465
|
-
var REQUIRED_FIELDS2 = Object.freeze(["schema_version", "operation_id"
|
|
1466
|
-
var FIELDS = /* @__PURE__ */ new Set([...REQUIRED_FIELDS2, "local_result_root", "continue_argv"]);
|
|
1467
|
-
|
|
1468
|
-
// packages/ceal-client-protocol/src/session-start-affordance.ts
|
|
1469
|
-
var CEAL_SESSION_ENTRY_INVOCATION = "ceal";
|
|
1470
|
-
var CEAL_LINK_RESOURCE_PRECEDENCE = `When the user asks to use Ceal or provides a link to information that may be available through installed organizational capabilities, run bare \`${CEAL_SESSION_ENTRY_INVOCATION}\`. The Host supplies the current user prompt without exposing it to the client command, and the Gateway returns the applicable entry in that one response. Treat a supplied link as a candidate Ceal resource rather than a public web-search target. Reach for a generic web fetch or web search only when the Gateway offered nothing.`;
|
|
1471
|
-
|
|
1472
|
-
// packages/ceal-client-protocol/src/conversation-contracts.ts
|
|
1473
|
-
var CEAL_APPROVAL_POLICY_KINDS = vocabulary(["requester_only", "named_users", "role_based"]);
|
|
1474
|
-
var CEAL_APPROVAL_TARGET_KINDS = vocabulary([
|
|
1475
|
-
"repo_change",
|
|
1476
|
-
"investigation",
|
|
1477
|
-
"skill_creation",
|
|
1478
|
-
"command_creation",
|
|
1479
|
-
"connector_creation",
|
|
1480
|
-
"generic"
|
|
1481
|
-
]);
|
|
1482
|
-
var CEAL_PROGRESS_PHASES = vocabulary(["request_review", "information_gathering", "work_execution", "result_check"]);
|
|
1473
|
+
var REQUIRED_FIELDS2 = Object.freeze(["schema_version", "operation_id"]);
|
|
1474
|
+
var FIELDS = /* @__PURE__ */ new Set([...REQUIRED_FIELDS2, "read_argv", "local_result_root", "continue_argv", "model_disclosure", "item_read_argv"]);
|
|
1483
1475
|
|
|
1484
1476
|
// packages/ceal-client-protocol/src/gateway-cache-origin-validation.ts
|
|
1485
1477
|
var CEAL_MAX_CACHE_ORIGIN_AGE_MS = 30 * 24 * 60 * 60 * 1e3;
|
|
@@ -1563,27 +1555,6 @@ var ADMIN_LINEAGE_NODE_KINDS = vocabulary(["source_read", "synthesis_preview", "
|
|
|
1563
1555
|
// packages/ceal-client-protocol/src/actor-kind.ts
|
|
1564
1556
|
var CEAL_ACTOR_KINDS = vocabulary(["human", "bot", "app", "unknown"]);
|
|
1565
1557
|
|
|
1566
|
-
// packages/ceal-client-protocol/src/personal-client-vocabulary.ts
|
|
1567
|
-
var CEAL_PERSONAL_CLIENT_BINDING_KEYS = vocabulary([
|
|
1568
|
-
"access_group_ref",
|
|
1569
|
-
"membership_ref",
|
|
1570
|
-
"registration_ref",
|
|
1571
|
-
"client_ref",
|
|
1572
|
-
"subject_ref",
|
|
1573
|
-
"instance_ref"
|
|
1574
|
-
]);
|
|
1575
|
-
var CEAL_ENROLLMENT_FAILURE_CODES = vocabulary(["enrollment_invalid", "enrollment_expired", "enrollment_used"]);
|
|
1576
|
-
var CEAL_REFRESH_FAILURE_CODES = vocabulary([
|
|
1577
|
-
"refresh_invalid",
|
|
1578
|
-
"refresh_expired",
|
|
1579
|
-
"refresh_inactive",
|
|
1580
|
-
"refresh_replayed",
|
|
1581
|
-
"refresh_revoked",
|
|
1582
|
-
"authority_replaced",
|
|
1583
|
-
"refresh_recovery_unavailable",
|
|
1584
|
-
"refresh_recovery_expired"
|
|
1585
|
-
]);
|
|
1586
|
-
|
|
1587
1558
|
// packages/ceal-client-protocol/src/device-enrollment.ts
|
|
1588
1559
|
var CEAL_DEVICE_ENROLLMENT_POLL_FAILURE_CODES = Object.freeze(["unsupported_feature", "recovery_required", "expired", "denied"]);
|
|
1589
1560
|
var POLL_RESULT_KEYS = Object.freeze(["retry_after_ms", "schema_version", "status"]);
|
|
@@ -1861,13 +1832,13 @@ function validTurn(value) {
|
|
|
1861
1832
|
return exactOptional(value, ["local_session_ref", "local_turn_ref"], ["model", "observations"]) && safeRef(value.local_session_ref) && safeRef(value.local_turn_ref) && optionalText(value.model, 256) && validObservations(value.observations);
|
|
1862
1833
|
}
|
|
1863
1834
|
function validInput(value) {
|
|
1864
|
-
return exactOptional(value, ["local_session_ref", "local_turn_ref", "local_input_ref", "origin_input", "observations"], ["
|
|
1835
|
+
return exactOptional(value, ["local_session_ref", "local_turn_ref", "local_input_ref", "input_kind", "origin_input", "observations"], ["local_turn_aliases", "context_expires_at"]) && safeRef(value.local_session_ref) && safeRef(value.local_turn_ref) && safeRef(value.local_input_ref) && validInputObservations(value.observations) && isCealHostInputKind(value.input_kind) && typeof value.origin_input === "boolean" && validInputOptionals(value);
|
|
1865
1836
|
}
|
|
1866
1837
|
function validInputObservations(value) {
|
|
1867
1838
|
return validObservations(value) && Array.isArray(value) && value.filter((item) => record(item) && item.observation_kind === "prompt").length === 1;
|
|
1868
1839
|
}
|
|
1869
1840
|
function validInputOptionals(value) {
|
|
1870
|
-
return
|
|
1841
|
+
return optionalRefs(value.local_turn_aliases) && (value.context_expires_at === void 0 || timestamp(value.context_expires_at));
|
|
1871
1842
|
}
|
|
1872
1843
|
function validTerminal(value) {
|
|
1873
1844
|
return exactOptional(value, ["local_session_ref", "local_turn_ref", "terminal_state"], ["abort_reason", "duration_ms", "time_to_first_token_ms", "usage", "observations"]) && safeRef(value.local_session_ref) && safeRef(value.local_turn_ref) && validTerminalDisposition(value.terminal_state, value.abort_reason) && optionalNonNegative(value.duration_ms) && optionalNonNegative(value.time_to_first_token_ms) && (value.usage === void 0 || jsonValue(value.usage)) && validObservations(value.observations);
|
|
@@ -1878,9 +1849,6 @@ function validTerminalDisposition(state, reason) {
|
|
|
1878
1849
|
function validStatus(value) {
|
|
1879
1850
|
return exactOptional(value, ["status", "reason_code"], ["detail"]) && ["ready", "degraded", "stopping"].includes(String(value.status)) && safeRef(value.reason_code) && optionalText(value.detail, 4096);
|
|
1880
1851
|
}
|
|
1881
|
-
function validDecision(value) {
|
|
1882
|
-
return value === void 0 || record(value) && exactKeys(value, ["decision", "approval_ref"]) && (value.decision === "approved" || value.decision === "denied") && safeRef(value.approval_ref);
|
|
1883
|
-
}
|
|
1884
1852
|
function optionalText(value, maxLength) {
|
|
1885
1853
|
return value === void 0 || typeof value === "string" && value.length > 0 && value.length <= maxLength;
|
|
1886
1854
|
}
|
|
@@ -2445,10 +2413,6 @@ var CodexOutboxStore = class {
|
|
|
2445
2413
|
await removeOwnerState(this.registrationPath(registration.host_source_ref, registration.host_session_ref), "registration");
|
|
2446
2414
|
await removeOwnerState(this.cursorPath(registration.host_source_ref, registration.host_session_ref), "cursor");
|
|
2447
2415
|
}
|
|
2448
|
-
async relayWakeDirectories() {
|
|
2449
|
-
await this.prepare();
|
|
2450
|
-
return { entries: this.entriesDirectory, registrations: this.registrationsDirectory };
|
|
2451
|
-
}
|
|
2452
2416
|
async listTranscriptRegistrations() {
|
|
2453
2417
|
await this.prepare();
|
|
2454
2418
|
const registrations = [];
|
|
@@ -2638,7 +2602,7 @@ async function readPrivateFile(path) {
|
|
|
2638
2602
|
}
|
|
2639
2603
|
function validateEnvelope(value) {
|
|
2640
2604
|
if (!isRecord3(value)) throw storageError("Codex outbox entry is malformed.");
|
|
2641
|
-
if (!sameKeys(value, ["schema_version", "identity", "host_input_ref", "prompt_ref", "observations", "origin_input", "submission_ref", "created_at", "expires_at"], ["request_ref", "codex_turn_id"])) throw storageError(`Codex outbox entry key set is malformed (${refusalFact("keys", Object.keys(value), "exactly the outbox entry key set")}).`);
|
|
2605
|
+
if (!sameKeys(value, ["schema_version", "identity", "host_input_ref", "input_kind", "prompt_ref", "observations", "origin_input", "submission_ref", "created_at", "expires_at"], ["request_ref", "codex_turn_id"])) throw storageError(`Codex outbox entry key set is malformed (${refusalFact("keys", Object.keys(value), "exactly the outbox entry key set")}).`);
|
|
2642
2606
|
if (value.schema_version !== CODEX_OUTBOX_SCHEMA_VERSION) throw storageError(`Codex outbox entry is malformed (${refusalFact("schema_version", value.schema_version, `expected ${CODEX_OUTBOX_SCHEMA_VERSION}`)}).`);
|
|
2643
2607
|
validateIdentity3(value.identity);
|
|
2644
2608
|
validateEnvelopeReferences(value);
|
|
@@ -2647,6 +2611,7 @@ function validateEnvelope(value) {
|
|
|
2647
2611
|
}
|
|
2648
2612
|
function validateEnvelopeReferences(value) {
|
|
2649
2613
|
if (!SAFE_REF4.test(String(value.host_input_ref))) throw storageError("Codex outbox input reference is malformed.");
|
|
2614
|
+
if (!isCealHostInputKind(value.input_kind)) throw storageError("Codex outbox input provenance is malformed.");
|
|
2650
2615
|
if (!SAFE_REF4.test(String(value.prompt_ref))) throw storageError("Codex outbox references are malformed.");
|
|
2651
2616
|
if (!SAFE_REF4.test(String(value.submission_ref))) throw storageError("Codex outbox references are malformed.");
|
|
2652
2617
|
if (value.request_ref !== void 0 && !SAFE_REF4.test(String(value.request_ref))) throw storageError("Codex outbox Request reference is malformed.");
|
|
@@ -2886,6 +2851,7 @@ var CodexProducer = class {
|
|
|
2886
2851
|
local_session_ref: envelope.identity.host_session_ref,
|
|
2887
2852
|
local_turn_ref: localTurnRef(envelope),
|
|
2888
2853
|
local_input_ref: envelope.host_input_ref,
|
|
2854
|
+
input_kind: envelope.input_kind,
|
|
2889
2855
|
origin_input: envelope.origin_input,
|
|
2890
2856
|
observations: [prompt],
|
|
2891
2857
|
local_turn_aliases: envelope.codex_turn_id === void 0 ? void 0 : [envelope.codex_turn_id],
|
|
@@ -3133,18 +3099,24 @@ function decodeTokenUsage(value) {
|
|
|
3133
3099
|
function decodeResponseItem(payload, ordinal, timestamp5) {
|
|
3134
3100
|
if (payload.type !== "message" || payload.role !== "user") return { kind: "ignored", ordinal, timestamp: timestamp5 };
|
|
3135
3101
|
const metadata = userMessageMetadata(payload.internal_chat_message_metadata_passthrough);
|
|
3136
|
-
const
|
|
3137
|
-
if (
|
|
3102
|
+
const inputKind = inputKindFromContentItems(metadata.content_item_kinds);
|
|
3103
|
+
if (inputKind === void 0) return { kind: "ignored", ordinal, timestamp: timestamp5 };
|
|
3138
3104
|
const prompt = userTextContent(payload.content);
|
|
3139
3105
|
return {
|
|
3140
3106
|
kind: "user_text",
|
|
3141
3107
|
ordinal,
|
|
3142
3108
|
timestamp: timestamp5,
|
|
3143
3109
|
prompt,
|
|
3110
|
+
input_kind: inputKind,
|
|
3144
3111
|
message_id: safeRef3(payload.id, "Codex user message identity is invalid."),
|
|
3145
3112
|
turn_id: safeRef3(metadata.turn_id, "Codex user message task identity is invalid.")
|
|
3146
3113
|
};
|
|
3147
3114
|
}
|
|
3115
|
+
function inputKindFromContentItems(kinds) {
|
|
3116
|
+
if (kinds.length !== 1) return void 0;
|
|
3117
|
+
if (kinds[0] === "user.text") return "human";
|
|
3118
|
+
return kinds[0] === "goal.internal_context" ? "host_automatic" : void 0;
|
|
3119
|
+
}
|
|
3148
3120
|
function userMessageMetadata(value) {
|
|
3149
3121
|
if (!isRecord5(value) || !Array.isArray(value.content_item_kinds)) reject("Codex user message provenance is malformed.");
|
|
3150
3122
|
return { ...value, content_item_kinds: value.content_item_kinds };
|
|
@@ -3729,6 +3701,7 @@ var CodexTranscriptWatcher = class {
|
|
|
3729
3701
|
schema_version: "ceal.codex_observation_outbox.v1",
|
|
3730
3702
|
identity,
|
|
3731
3703
|
host_input_ref: hostInputRef,
|
|
3704
|
+
input_kind: record3.input_kind,
|
|
3732
3705
|
prompt_ref: promptRef,
|
|
3733
3706
|
observations,
|
|
3734
3707
|
codex_turn_id: record3.turn_id,
|
|
@@ -3755,6 +3728,7 @@ var CodexTranscriptWatcher = class {
|
|
|
3755
3728
|
schema_version: "ceal.codex_observation_outbox.v1",
|
|
3756
3729
|
identity,
|
|
3757
3730
|
host_input_ref: activeTask.origin_host_input_ref,
|
|
3731
|
+
input_kind: "host_automatic",
|
|
3758
3732
|
prompt_ref: activeTask.prompt_ref,
|
|
3759
3733
|
observations,
|
|
3760
3734
|
codex_turn_id: record3.turn_id,
|