@voltro/protocol 0.86.0 → 0.87.0

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/dist/index.js CHANGED
@@ -1,43 +1,55 @@
1
1
  import { applyRowPatch as e, createRowPatchApplier as t, diffRows as n, idToPath as r, isIdKeyed as i, patchCellSchema as a, pathToId as o, rowPatchOpSchema as s, rowPatchSchema as c } from "./rowPatch.js";
2
2
  import { firstEventValue as l, subscriptionEvent as u } from "./subscriptionEvent.js";
3
3
  import { RequestedTenantRefused as d, TenantSelectionRefused as f, isTenantSelectable as p, selectSubjectTenant as m } from "./tenantSelection.js";
4
- import { AuthMiddleware as h, ConnectionInfo as g, ConnectionInfoMiddleware as _, DEFAULT_SCOPE_CACHE_MAX_ENTRIES as v, DEFAULT_SCOPE_CACHE_TTL_MS as y, IMPERSONATION_METADATA_KEY as b, Subject as x, SubjectIdentity as S, SubjectService as C, Unauthenticated as w, anonymousSubject as T, applyScopeDecision as E, assertAuthenticated as D, bindSubjectAuthority as O, composeAuthStrategies as k, currentSubjectAuthority as A, hasCallbackRoutes as j, isMachineSubject as M, isServiceSubject as N, isSystemSubject as P, makeScopeCache as F, orderByBearerPrefix as I, rawImpersonationMark as L, reauthorizeSubject as R, scopeCacheKey as z, serviceSubject as B, subjectAuditActorId as V, subjectIdentity as H, systemSubject as U, tenantScopedSubject as W } from "./auth.js";
5
- import { ADMIN_SCOPE as G, APIKEY_ISSUE_ORG_SCOPE as K, APIKEY_ISSUE_OTHER_SCOPE as q, APIKEY_ISSUE_SELF_SCOPE as J, DEVICES_MANAGE_SCOPE as Y, NoSuchResource as X, ScopeError as Z, advisoryResourceGuardWarning as Q, checkGuards as $, checkGuardsEffect as ee, declaresResourceGuard as te, effectiveScopes as ne, findAdvisoryResourceGuards as re, getPolicyGuardResolver as ie, getResourceScopeResolver as ae, hasEffectiveScope as oe, hasScope as se, isAuthenticatedCheck as ce, isOpenAccess as le, isPolicyCheck as ue, isServiceAccess as de, missingAccessDecision as fe, openAccessSpec as pe, recheckGuardsEffect as me, refreshEffectiveScopes as he, requireScope as ge, resolvePolicyAction as _e, serviceAccessSpec as ve, serviceCallersOf as ye, setEffectiveScopes as be, setEffectiveScopesRefresher as xe, setPolicyGuardResolver as Se, setResourceScopeResolver as Ce, subjectScopes as we } from "./scopes.js";
6
- import { inputLabel as Te, strictInput as Ee } from "./strictInput.js";
7
- import { BusinessRuleViolation as De } from "./businessRule.js";
8
- import { DEFAULT_IN_FLIGHT_LEASE_MS as Oe, MUTATION_IN_FLIGHT_RETRY_AFTER_MS as ke, MutationConnectionRequired as Ae, MutationInFlight as je, beginIdempotent as Me, failIdempotent as Ne, finishIdempotent as Pe, freshFor as Fe, holdIdempotentClaim as Ie, idempotencyScope as Le, memoryIdempotencyStore as Re, wsMutationIdempotencyScope as ze } from "./idempotency.js";
9
- import { ValidationError as Be, ValidationErrors as Ve, ValidationIssue as He, fieldIssuesOf as Ue } from "./validation.js";
10
- import { ApprovalDecisionErrors as We, ApprovalErrors as Ge, ApprovalExpired as Ke, ApprovalForbidden as qe, ApprovalNotFound as Je, ApprovalNotPending as Ye, ApprovalRejected as Xe, ApprovalRequired as Ze, ApprovalSelfApproval as Qe, ApprovalUnavailable as $e, PendingApproval as et } from "./approval.js";
11
- import { REACTIVITY_CHANNEL_PREFIX as tt, declaredReactivityChannelKeys as nt, isReactivityChannel as rt, isReactivityChannelKey as it, normalizeSource as at, publishReactivity as ot, reactivityChannel as st, sourceKeys as ct, undeclaredChannelKeys as lt } from "./reactivityChannel.js";
12
- import { FRAMEWORK_WIRE_ERRORS as ut, SERVICE_NAME_PATTERN as dt, actionToRpc as ft, defineAction as pt, defineMutation as mt, defineQuery as ht, defineStream as gt, hasAccessDecision as _t, hasEnforcedGuard as vt, isAuthenticatedGuard as yt, isClientReachable as bt, isPolicyGuard as xt, isServiceReachable as St, isWireReachable as Ct, mutationToRpc as wt, normalizeDescriptor as Tt, queryToRpc as Et, streamToRpc as Dt, toRpc as Ot, wireAudienceOf as kt, wireErrorUnion as At, withRpcTag as jt, workflowWireErrorUnion as Mt } from "./procedure.js";
13
- import { errorMessage as Nt, errorTag as Pt, reportableError as Ft } from "./errorValue.js";
14
- import { EVENT_ROUTE_SEP as It, EventKeyInvalid as Lt, EventPayloadInvalid as Rt, EventPayloadTooLarge as zt, MAX_EVENT_ENVELOPE_BYTES as Bt, defineEvent as Vt, encodeEventKey as Ht, eventAttached as Ut, eventEnvelope as Wt, eventGap as Gt, eventResumePoint as Kt, eventRoute as qt, eventStreamEvent as Jt, eventSubscribeInput as Yt, eventToRpc as Xt, formatEventRoute as Zt, isEventDescriptor as Qt, parseEventRoute as $t } from "./event.js";
15
- import { DEV_ACTIVITY_EVENT as en } from "./devActivity.js";
16
- import { WorkflowAccessProperty as tn, attachWorkflowAccess as nn, getWorkflowAccess as rn, resolveWorkflowAccess as an, workflowAccessDescriptor as on } from "./workflowAccess.js";
17
- import { compareSurfaces as sn, groupShapeDigests as cn, procedureShapeDigest as ln, schemaShape as un, shapeDigest as dn } from "./schemaShape.js";
18
- import { ApiUnavailable as fn, isApiUnavailable as pn } from "./serviceCall.js";
19
- import { checkFrameworkCompat as mn, composeRpcInterceptors as hn, definePlugin as gn, definePluginRoute as _n, definePluginService as vn, pluginInstanceName as yn } from "./plugin.js";
20
- import { validateOutboxHandlerDefinition as bn } from "./outbox.js";
21
- import { pluginAlias as xn, pluginSlug as Sn, pluginTag as Cn, registerPluginAliases as wn, resetPluginAliases as Tn } from "./pluginNaming.js";
22
- import { publishServerError as En, subscribeServerErrors as Dn, withheldServerError as On } from "./serverErrorBus.js";
23
- import { WorkflowStartTerminalOutcomeSchema as kn } from "./workflowStartOutcome.js";
24
- import { WorkflowControlInputSchema as An, WorkflowControlIntentSchema as jn, WorkflowControlReadInputSchema as Mn, WorkflowControlResultSchema as Nn, WorkflowDomainEventRowSchema as Pn, WorkflowDomainEventsInputSchema as Fn, WorkflowEventDeliveriesInputSchema as In, WorkflowEventDeliveryRowSchema as Ln, WorkflowParentClosePolicySchema as Rn, WorkflowQueuedCancelInputSchema as zn, WorkflowQueuedCancellationResultSchema as Bn, WorkflowQueuedControlTargetSchema as Vn, WorkflowRunEventRowSchema as Hn, WorkflowRunHandleSchema as Un, WorkflowRunRefSchema as Wn, WorkflowRunRowSchema as Gn, WorkflowRunSnapshotSchema as Kn, WorkflowRunStatusSchema as qn, WorkflowRunStepRowSchema as Jn, WorkflowRunTableRefSchema as Yn, WorkflowRunsInputSchema as Xn, WorkflowSignalInputSchema as Zn, WorkflowStartDeferralSchema as Qn, WorkflowUpdateInputSchema as $n, WorkflowUpdateResultSchema as er, workflowCancelDescriptor as tr, workflowControlQueryDescriptor as nr, workflowDomainEventsQueryDescriptor as rr, workflowEventDeliveriesQueryDescriptor as ir, workflowQueuedCancelDescriptor as ar, workflowQueuedControlQueryDescriptor as or, workflowResumeDescriptor as sr, workflowRunEventsQueryDescriptor as cr, workflowRunQueryDescriptor as lr, workflowRunStepsQueryDescriptor as ur, workflowRunsQueryDescriptor as dr, workflowSignalDescriptor as fr, workflowToRpc as pr, workflowUpdateDescriptor as mr } from "./workflow.js";
25
- import { WorkflowRetryCommandSchema as hr, WorkflowRetryObservationSchema as gr, WorkflowRetryTargetSchema as _r } from "./workflowRetry.js";
26
- import { WorkflowRestartCommandSchema as vr, WorkflowRestartObservationSchema as yr, WorkflowRestartResultSchema as br, WorkflowRestartSelectionSchema as xr, WorkflowRestartTargetSchema as Sr } from "./workflowRestart.js";
27
- import { UNDO_APPLY_TAG as Cr, UNDO_LOG_TAG as wr, UNDO_REDO_TAG as Tr, UndoConflict as Er, UndoForbidden as Dr, UndoLogEntry as Or, UndoNotFound as kr, undoApplyDescriptor as Ar, undoLogQueryDescriptor as jr, undoRedoDescriptor as Mr } from "./undo.js";
28
- import { ConstraintViolation as Nr, NoRowFound as Pr, ServerOnlyColumnWrite as Fr, StoreOperationFailed as Ir, TableValidationFailed as Lr, TenantRowNotFound as Rr, TenantScopeViolation as zr } from "./storeErrors.js";
29
- import { APPROVALS_DECIDE_TAG as Br, APPROVALS_PENDING_TAG as Vr, approvalsDecideDescriptor as Hr, approvalsPendingQueryDescriptor as Ur } from "./approvalDescriptors.js";
30
- import { CONNECTIONS_LIST_TAG as Wr, CONNECTION_DISCONNECT_TAG as Gr, CONNECTION_START_TAG as Kr, CONNECTION_SUBMIT_TOKEN_TAG as qr, ConnectionHandshakeFailed as Jr, ConnectionKind as Yr, ConnectionKindMismatch as Xr, ConnectionNotDeclared as Zr, ConnectionState as Qr, ConnectionStatus as $r, ConnectionSubjectRequired as ei, connectionDisconnectDescriptor as ti, connectionStartDescriptor as ni, connectionSubmitTokenDescriptor as ri, connectionsListQueryDescriptor as ii } from "./connection.js";
31
- import { tsMs as ai } from "./time.js";
32
- import { STORE_SCREENSHOT_PRESETS as oi, STORE_SCREENSHOT_PRESET_NAMES as si, STORE_SCREENSHOT_STORES as ci, storeScreenshotPixels as li, storeScreenshotPreset as ui, storeScreenshotPresetsFor as di } from "./storeScreenshots.js";
33
- import { GATEWAY_CREDENTIAL_EXPIRED_CLOSE_CODE as fi, defineWebSocket as pi } from "./webSocketGateway.js";
34
- import { SESSION_HEADER_NAME as mi, sessionValueFromHeaders as hi } from "./sessionHeader.js";
35
- import { JSONAPI_MEDIA_TYPE as gi, PROBLEM_JSON as _i, REST_PROFILE_NAMES as vi, encodeRestError as yi, encodeRestSuccess as bi, nextLink as xi, problemDetails as Si, problemTypeOf as Ci, resolveRestFormat as wi, restViewSchema as Ti, toSnakeCase as Ei } from "./restFormat.js";
36
- import { finiteNumberView as Di, jsonSchemaDocumentOf as Oi, jsonSchemaOf as ki, plainJsonSchema as Ai } from "./jsonSchema.js";
37
- import { PAIRING_HOST as ji, PAIRING_SCHEME as Mi, PAIRING_STORAGE_KEY as Ni, applyPairing as Pi, clearPairing as Fi, pairingLink as Ii, parsePairingLink as Li, readPairing as Ri } from "./pairing.js";
38
- import { StorageAccessPolicySchema as zi, StorageAccessRuleSchema as Bi } from "./storageAccess.js";
39
- import { BoundedRing as Vi } from "./boundedRing.js";
4
+ import { AuthMiddleware as h, ConnectionInfo as g, ConnectionInfoMiddleware as _, DEFAULT_SCOPE_CACHE_MAX_ENTRIES as v, DEFAULT_SCOPE_CACHE_TTL_MS as y, IMPERSONATION_METADATA_KEY as b, Subject as x, SubjectIdentity as S, SubjectService as C, Unauthenticated as w, anonymousSubject as T, applyScopeDecision as E, assertAuthenticated as D, bindSubjectAuthority as O, composeAuthStrategies as k, currentSubjectAuthority as A, hasCallbackRoutes as j, isMachineSubject as M, isServiceSubject as N, isSystemSubject as P, makeScopeCache as F, orderByBearerPrefix as I, rawImpersonationMark as L, reauthorizeSubject as R, resolveIdentityAuthority as z, scopeCacheKey as B, serviceSubject as V, subjectAuditActorId as H, subjectIdentity as U, systemSubject as W, tenantScopedSubject as G } from "./auth.js";
5
+ import { ADMIN_SCOPE as K, APIKEY_ISSUE_ORG_SCOPE as q, APIKEY_ISSUE_OTHER_SCOPE as J, APIKEY_ISSUE_SELF_SCOPE as Y, DEVICES_MANAGE_SCOPE as X, NoSuchResource as Z, ScopeError as Q, advisoryResourceGuardWarning as $, checkGuards as ee, checkGuardsEffect as te, declaresResourceGuard as ne, effectiveScopes as re, findAdvisoryResourceGuards as ie, getPolicyGuardResolver as ae, getResourceScopeResolver as oe, hasEffectiveScope as se, hasScope as ce, isAuthenticatedCheck as le, isOpenAccess as ue, isPolicyCheck as de, isServiceAccess as fe, isUpgradedCheck as pe, missingAccessDecision as me, openAccessSpec as he, recheckGuardsEffect as ge, refreshEffectiveScopes as _e, requireScope as ve, resolvePolicyAction as ye, serviceAccessSpec as be, serviceCallersOf as xe, setEffectiveScopes as Se, setEffectiveScopesRefresher as Ce, setPolicyGuardResolver as we, setResourceScopeResolver as Te, subjectScopes as Ee, upgradedGuardShapeError as De } from "./scopes.js";
6
+ import { inputLabel as Oe, strictInput as ke } from "./strictInput.js";
7
+ import { BusinessRuleViolation as Ae } from "./businessRule.js";
8
+ import { DEFAULT_IN_FLIGHT_LEASE_MS as je, MUTATION_IN_FLIGHT_RETRY_AFTER_MS as Me, MutationConnectionRequired as Ne, MutationIdempotencyRefused as Pe, MutationInFlight as Fe, beginIdempotent as Ie, failIdempotent as Le, finishIdempotent as Re, freshFor as ze, holdIdempotentClaim as Be, idempotencyScope as Ve, memoryIdempotencyStore as He, wsMutationIdempotencyScope as Ue } from "./idempotency.js";
9
+ import { ValidationError as We, ValidationErrors as Ge, ValidationIssue as Ke, fieldIssuesOf as qe } from "./validation.js";
10
+ import { ApprovalDecisionErrors as Je, ApprovalErrors as Ye, ApprovalExpired as Xe, ApprovalForbidden as Ze, ApprovalNotFound as Qe, ApprovalNotPending as $e, ApprovalRejected as et, ApprovalRequired as tt, ApprovalSelfApproval as nt, ApprovalUnavailable as rt, PendingApproval as it } from "./approval.js";
11
+ import { REACTIVITY_CHANNEL_PREFIX as at, declaredReactivityChannelKeys as ot, isReactivityChannel as st, isReactivityChannelKey as ct, normalizeSource as lt, publishReactivity as ut, reactivityChannel as dt, sourceKeys as ft, undeclaredChannelKeys as pt } from "./reactivityChannel.js";
12
+ import { captureOptionalQuerySources as mt } from "./queryOptionalSources.js";
13
+ import { FRAMEWORK_WIRE_ERRORS as ht, SERVICE_NAME_PATTERN as gt, actionToRpc as _t, defineAction as vt, defineMutation as yt, defineQuery as bt, defineStream as xt, hasAccessDecision as St, hasEnforcedGuard as Ct, isAuthenticatedGuard as wt, isClientReachable as Tt, isPolicyGuard as Et, isServiceReachable as Dt, isUpgradedGuard as Ot, isWireReachable as kt, mutationToRpc as At, normalizeDescriptor as jt, queryToRpc as Mt, requireUpgraded as Nt, streamToRpc as Pt, toRpc as Ft, wireAudienceOf as It, wireErrorUnion as Lt, withRpcTag as Rt, workflowWireErrorUnion as zt } from "./procedure.js";
14
+ import { errorMessage as Bt, errorTag as Vt, reportableError as Ht } from "./errorValue.js";
15
+ import { declaredErrorTags as Ut, errorMemberSchema as Wt } from "./errorSchema.js";
16
+ import { canonicalJson as Gt } from "./canonicalJson.js";
17
+ import { prepareIdempotentInput as Kt } from "./idempotencyInput.js";
18
+ import { EVENT_ROUTE_SEP as qt, EventKeyInvalid as Jt, EventPayloadInvalid as Yt, EventPayloadTooLarge as Xt, EventRpcWorkload as Zt, MAX_EVENT_ENVELOPE_BYTES as Qt, defineEvent as $t, encodeEventKey as en, eventAttached as tn, eventEnvelope as nn, eventGap as rn, eventResumePoint as an, eventRoute as on, eventStreamEvent as sn, eventSubscribeInput as cn, eventToRpc as ln, formatEventRoute as un, isEventDescriptor as dn, parseEventRoute as fn } from "./event.js";
19
+ import { DEV_ACTIVITY_EVENT as pn } from "./devActivity.js";
20
+ import { WorkflowAccessProperty as mn, attachWorkflowAccess as hn, getWorkflowAccess as gn, resolveWorkflowAccess as _n, workflowAccessDescriptor as vn } from "./workflowAccess.js";
21
+ import { compareSurfaces as yn, groupShapeDigests as bn, procedureShapeDigest as xn, schemaShape as Sn, shapeDigest as Cn } from "./schemaShape.js";
22
+ import { parseRevalidateMs as wn } from "./revalidate.js";
23
+ import { ApiUnavailable as Tn, isApiUnavailable as En } from "./serviceCall.js";
24
+ import { API_WORKLOADS as Dn, checkFrameworkCompat as On, composeReplayAuthorityBindings as kn, composeRpcInterceptors as An, definePlugin as jn, definePluginRoute as Mn, definePluginService as Nn, pluginInstanceName as Pn } from "./plugin.js";
25
+ import { PluginPrivacyErasePhaseSchema as Fn, PluginPrivacyFailure as In, createPluginPrivacyRegistry as Ln } from "./pluginPrivacy.js";
26
+ import { PluginAccountMergeFailure as Rn, createPluginAccountMergeRegistry as zn } from "./pluginAccountMerge.js";
27
+ import { validateHttpStreamMaxDuration as Bn } from "./httpStreamMaxDuration.js";
28
+ import { validateOutboxHandlerDefinition as Vn } from "./outbox.js";
29
+ import { pluginAlias as Hn, pluginSlug as Un, pluginTag as Wn, registerPluginAliases as Gn, resetPluginAliases as Kn } from "./pluginNaming.js";
30
+ import { publishServerError as qn, subscribeServerErrors as Jn, withheldServerError as Yn } from "./serverErrorBus.js";
31
+ import { WorkflowStartTerminalOutcomeSchema as Xn } from "./workflowStartOutcome.js";
32
+ import { WorkflowControlInputSchema as Zn, WorkflowControlIntentSchema as Qn, WorkflowControlReadInputSchema as $n, WorkflowControlResultSchema as er, WorkflowDomainEventRowSchema as tr, WorkflowDomainEventsInputSchema as nr, WorkflowEventDeliveriesInputSchema as rr, WorkflowEventDeliveryRowSchema as ir, WorkflowParentClosePolicySchema as ar, WorkflowQueuedCancelInputSchema as or, WorkflowQueuedCancellationResultSchema as sr, WorkflowQueuedControlTargetSchema as cr, WorkflowRunEventRowSchema as lr, WorkflowRunHandleSchema as ur, WorkflowRunRefSchema as dr, WorkflowRunRowSchema as fr, WorkflowRunSnapshotSchema as pr, WorkflowRunStatusSchema as mr, WorkflowRunStepRowSchema as hr, WorkflowRunTableRefSchema as gr, WorkflowRunsInputSchema as _r, WorkflowSignalInputSchema as vr, WorkflowStartDeferralSchema as yr, WorkflowUpdateInputSchema as br, WorkflowUpdateResultSchema as xr, workflowCancelDescriptor as Sr, workflowControlQueryDescriptor as Cr, workflowDomainEventsQueryDescriptor as wr, workflowEventDeliveriesQueryDescriptor as Tr, workflowQueuedCancelDescriptor as Er, workflowQueuedControlQueryDescriptor as Dr, workflowResumeDescriptor as Or, workflowRunEventsQueryDescriptor as kr, workflowRunQueryDescriptor as Ar, workflowRunStepsQueryDescriptor as jr, workflowRunsQueryDescriptor as Mr, workflowSignalDescriptor as Nr, workflowToRpc as Pr, workflowUpdateDescriptor as Fr } from "./workflow.js";
33
+ import { WorkflowRetryCommandSchema as Ir, WorkflowRetryObservationSchema as Lr, WorkflowRetryTargetSchema as Rr } from "./workflowRetry.js";
34
+ import { WorkflowRestartCommandSchema as zr, WorkflowRestartObservationSchema as Br, WorkflowRestartResultSchema as Vr, WorkflowRestartSelectionSchema as Hr, WorkflowRestartTargetSchema as Ur } from "./workflowRestart.js";
35
+ import { UNDO_APPLY_TAG as Wr, UNDO_LOG_TAG as Gr, UNDO_REDO_TAG as Kr, UndoConflict as qr, UndoForbidden as Jr, UndoLogEntry as Yr, UndoNotFound as Xr, undoApplyDescriptor as Zr, undoLogQueryDescriptor as Qr, undoRedoDescriptor as $r } from "./undo.js";
36
+ import { ssrfReason as ei } from "./ssrfPolicy.js";
37
+ import { ConstraintViolation as ti, NoRowFound as ni, ServerOnlyColumnWrite as ri, StoreOperationFailed as ii, TableValidationFailed as ai, TenantRowNotFound as oi, TenantScopeViolation as si } from "./storeErrors.js";
38
+ import { APPROVALS_DECIDE_TAG as ci, APPROVALS_PENDING_TAG as li, approvalsDecideDescriptor as ui, approvalsPendingQueryDescriptor as di } from "./approvalDescriptors.js";
39
+ import { CONNECTIONS_LIST_TAG as fi, CONNECTION_DISCONNECT_TAG as pi, CONNECTION_START_TAG as mi, CONNECTION_SUBMIT_TOKEN_TAG as hi, ConnectionHandshakeFailed as gi, ConnectionKind as _i, ConnectionKindMismatch as vi, ConnectionNotDeclared as yi, ConnectionState as bi, ConnectionStatus as xi, ConnectionSubjectRequired as Si, connectionDisconnectDescriptor as Ci, connectionStartDescriptor as wi, connectionSubmitTokenDescriptor as Ti, connectionsListQueryDescriptor as Ei } from "./connection.js";
40
+ import { tsMs as Di } from "./time.js";
41
+ import { STORE_SCREENSHOT_PRESETS as Oi, STORE_SCREENSHOT_PRESET_NAMES as ki, STORE_SCREENSHOT_STORES as Ai, storeScreenshotPixels as ji, storeScreenshotPreset as Mi, storeScreenshotPresetsFor as Ni } from "./storeScreenshots.js";
42
+ import { GATEWAY_CREDENTIAL_EXPIRED_CLOSE_CODE as Pi, defineWebSocket as Fi } from "./webSocketGateway.js";
43
+ import { SESSION_HEADER_NAME as Ii, sessionValueFromHeaders as Li } from "./sessionHeader.js";
44
+ import { JSONAPI_MEDIA_TYPE as Ri, PROBLEM_JSON as zi, REST_PROFILE_NAMES as Bi, encodeRestError as Vi, encodeRestSuccess as Hi, nextLink as Ui, problemDetails as Wi, problemTypeOf as Gi, resolveRestFormat as Ki, restViewSchema as qi, toSnakeCase as Ji } from "./restFormat.js";
45
+ import { finiteNumberView as Yi, jsonSchemaDocumentOf as Xi, jsonSchemaOf as Zi, plainJsonSchema as Qi } from "./jsonSchema.js";
46
+ import { PAIRING_HOST as $i, PAIRING_SCHEME as ea, PAIRING_STORAGE_KEY as ta, applyPairing as na, clearPairing as ra, pairingLink as ia, parsePairingLink as aa, readPairing as oa } from "./pairing.js";
47
+ import { apiRoleEndpointUrl as sa, apiRoleProxyBasePath as ca, captureApiRoleEndpoints as la, selectApiRoleEndpoint as ua } from "./apiRoleEndpoints.js";
48
+ import { ApiRoleObservationSchema as da } from "./apiRoleObservation.js";
49
+ import { StorageAccessPolicySchema as fa, StorageAccessRuleSchema as pa } from "./storageAccess.js";
50
+ import { BoundedRing as ma } from "./boundedRing.js";
51
+ import { FORM_CAPTURE_FIELD as ha, FORM_CAPTURE_META_NAME as ga, encodeNativeFormCapture as _a, formCaptureSource as va, readFormCaptureSource as ya } from "./formCapture.js";
40
52
  //#region src/index.ts
41
- var Hi = 2;
53
+ var ba = 2;
42
54
  //#endregion
43
- export { G as ADMIN_SCOPE, K as APIKEY_ISSUE_ORG_SCOPE, q as APIKEY_ISSUE_OTHER_SCOPE, J as APIKEY_ISSUE_SELF_SCOPE, Br as APPROVALS_DECIDE_TAG, Vr as APPROVALS_PENDING_TAG, fn as ApiUnavailable, We as ApprovalDecisionErrors, Ge as ApprovalErrors, Ke as ApprovalExpired, qe as ApprovalForbidden, Je as ApprovalNotFound, Ye as ApprovalNotPending, Xe as ApprovalRejected, Ze as ApprovalRequired, Qe as ApprovalSelfApproval, $e as ApprovalUnavailable, h as AuthMiddleware, Vi as BoundedRing, De as BusinessRuleViolation, Wr as CONNECTIONS_LIST_TAG, Gr as CONNECTION_DISCONNECT_TAG, Kr as CONNECTION_START_TAG, qr as CONNECTION_SUBMIT_TOKEN_TAG, Jr as ConnectionHandshakeFailed, g as ConnectionInfo, _ as ConnectionInfoMiddleware, Yr as ConnectionKind, Xr as ConnectionKindMismatch, Zr as ConnectionNotDeclared, Qr as ConnectionState, $r as ConnectionStatus, ei as ConnectionSubjectRequired, Nr as ConstraintViolation, Oe as DEFAULT_IN_FLIGHT_LEASE_MS, v as DEFAULT_SCOPE_CACHE_MAX_ENTRIES, y as DEFAULT_SCOPE_CACHE_TTL_MS, Y as DEVICES_MANAGE_SCOPE, en as DEV_ACTIVITY_EVENT, It as EVENT_ROUTE_SEP, Lt as EventKeyInvalid, Rt as EventPayloadInvalid, zt as EventPayloadTooLarge, ut as FRAMEWORK_WIRE_ERRORS, fi as GATEWAY_CREDENTIAL_EXPIRED_CLOSE_CODE, b as IMPERSONATION_METADATA_KEY, gi as JSONAPI_MEDIA_TYPE, Bt as MAX_EVENT_ENVELOPE_BYTES, ke as MUTATION_IN_FLIGHT_RETRY_AFTER_MS, Ae as MutationConnectionRequired, je as MutationInFlight, Pr as NoRowFound, X as NoSuchResource, ji as PAIRING_HOST, Mi as PAIRING_SCHEME, Ni as PAIRING_STORAGE_KEY, _i as PROBLEM_JSON, Hi as PROTOCOL_VERSION, et as PendingApproval, tt as REACTIVITY_CHANNEL_PREFIX, vi as REST_PROFILE_NAMES, d as RequestedTenantRefused, dt as SERVICE_NAME_PATTERN, mi as SESSION_HEADER_NAME, oi as STORE_SCREENSHOT_PRESETS, si as STORE_SCREENSHOT_PRESET_NAMES, ci as STORE_SCREENSHOT_STORES, Z as ScopeError, Fr as ServerOnlyColumnWrite, zi as StorageAccessPolicySchema, Bi as StorageAccessRuleSchema, Ir as StoreOperationFailed, x as Subject, S as SubjectIdentity, C as SubjectService, Lr as TableValidationFailed, Rr as TenantRowNotFound, zr as TenantScopeViolation, f as TenantSelectionRefused, Cr as UNDO_APPLY_TAG, wr as UNDO_LOG_TAG, Tr as UNDO_REDO_TAG, w as Unauthenticated, Er as UndoConflict, Dr as UndoForbidden, Or as UndoLogEntry, kr as UndoNotFound, Be as ValidationError, Ve as ValidationErrors, He as ValidationIssue, tn as WorkflowAccessProperty, An as WorkflowControlInputSchema, jn as WorkflowControlIntentSchema, Mn as WorkflowControlReadInputSchema, Nn as WorkflowControlResultSchema, Pn as WorkflowDomainEventRowSchema, Fn as WorkflowDomainEventsInputSchema, In as WorkflowEventDeliveriesInputSchema, Ln as WorkflowEventDeliveryRowSchema, Rn as WorkflowParentClosePolicySchema, zn as WorkflowQueuedCancelInputSchema, Bn as WorkflowQueuedCancellationResultSchema, Vn as WorkflowQueuedControlTargetSchema, vr as WorkflowRestartCommandSchema, yr as WorkflowRestartObservationSchema, br as WorkflowRestartResultSchema, xr as WorkflowRestartSelectionSchema, Sr as WorkflowRestartTargetSchema, hr as WorkflowRetryCommandSchema, gr as WorkflowRetryObservationSchema, _r as WorkflowRetryTargetSchema, Hn as WorkflowRunEventRowSchema, Un as WorkflowRunHandleSchema, Wn as WorkflowRunRefSchema, Gn as WorkflowRunRowSchema, Kn as WorkflowRunSnapshotSchema, qn as WorkflowRunStatusSchema, Jn as WorkflowRunStepRowSchema, Yn as WorkflowRunTableRefSchema, Xn as WorkflowRunsInputSchema, Zn as WorkflowSignalInputSchema, Qn as WorkflowStartDeferralSchema, kn as WorkflowStartTerminalOutcomeSchema, $n as WorkflowUpdateInputSchema, er as WorkflowUpdateResultSchema, ft as actionToRpc, Q as advisoryResourceGuardWarning, T as anonymousSubject, Pi as applyPairing, e as applyRowPatch, E as applyScopeDecision, Hr as approvalsDecideDescriptor, Ur as approvalsPendingQueryDescriptor, D as assertAuthenticated, nn as attachWorkflowAccess, Me as beginIdempotent, O as bindSubjectAuthority, mn as checkFrameworkCompat, $ as checkGuards, ee as checkGuardsEffect, Fi as clearPairing, sn as compareSurfaces, k as composeAuthStrategies, hn as composeRpcInterceptors, ti as connectionDisconnectDescriptor, ni as connectionStartDescriptor, ri as connectionSubmitTokenDescriptor, ii as connectionsListQueryDescriptor, t as createRowPatchApplier, A as currentSubjectAuthority, nt as declaredReactivityChannelKeys, te as declaresResourceGuard, pt as defineAction, Vt as defineEvent, mt as defineMutation, gn as definePlugin, _n as definePluginRoute, vn as definePluginService, ht as defineQuery, gt as defineStream, pi as defineWebSocket, n as diffRows, ne as effectiveScopes, Ht as encodeEventKey, yi as encodeRestError, bi as encodeRestSuccess, Nt as errorMessage, Pt as errorTag, Ut as eventAttached, Wt as eventEnvelope, Gt as eventGap, Kt as eventResumePoint, qt as eventRoute, Jt as eventStreamEvent, Yt as eventSubscribeInput, Xt as eventToRpc, Ne as failIdempotent, Ue as fieldIssuesOf, re as findAdvisoryResourceGuards, Pe as finishIdempotent, Di as finiteNumberView, l as firstEventValue, Zt as formatEventRoute, Fe as freshFor, ie as getPolicyGuardResolver, ae as getResourceScopeResolver, rn as getWorkflowAccess, cn as groupShapeDigests, _t as hasAccessDecision, j as hasCallbackRoutes, oe as hasEffectiveScope, vt as hasEnforcedGuard, se as hasScope, Ie as holdIdempotentClaim, r as idToPath, Le as idempotencyScope, Te as inputLabel, pn as isApiUnavailable, ce as isAuthenticatedCheck, yt as isAuthenticatedGuard, bt as isClientReachable, Qt as isEventDescriptor, i as isIdKeyed, M as isMachineSubject, le as isOpenAccess, ue as isPolicyCheck, xt as isPolicyGuard, rt as isReactivityChannel, it as isReactivityChannelKey, de as isServiceAccess, St as isServiceReachable, N as isServiceSubject, P as isSystemSubject, p as isTenantSelectable, Ct as isWireReachable, Oi as jsonSchemaDocumentOf, ki as jsonSchemaOf, F as makeScopeCache, Re as memoryIdempotencyStore, fe as missingAccessDecision, wt as mutationToRpc, xi as nextLink, Tt as normalizeDescriptor, at as normalizeSource, pe as openAccessSpec, I as orderByBearerPrefix, Ii as pairingLink, $t as parseEventRoute, Li as parsePairingLink, a as patchCellSchema, o as pathToId, Ai as plainJsonSchema, xn as pluginAlias, yn as pluginInstanceName, Sn as pluginSlug, Cn as pluginTag, Si as problemDetails, Ci as problemTypeOf, ln as procedureShapeDigest, ot as publishReactivity, En as publishServerError, Et as queryToRpc, L as rawImpersonationMark, st as reactivityChannel, Ri as readPairing, R as reauthorizeSubject, me as recheckGuardsEffect, he as refreshEffectiveScopes, wn as registerPluginAliases, Ft as reportableError, ge as requireScope, Tn as resetPluginAliases, _e as resolvePolicyAction, wi as resolveRestFormat, an as resolveWorkflowAccess, Ti as restViewSchema, s as rowPatchOpSchema, c as rowPatchSchema, un as schemaShape, z as scopeCacheKey, m as selectSubjectTenant, ve as serviceAccessSpec, ye as serviceCallersOf, B as serviceSubject, hi as sessionValueFromHeaders, be as setEffectiveScopes, xe as setEffectiveScopesRefresher, Se as setPolicyGuardResolver, Ce as setResourceScopeResolver, dn as shapeDigest, ct as sourceKeys, li as storeScreenshotPixels, ui as storeScreenshotPreset, di as storeScreenshotPresetsFor, Dt as streamToRpc, Ee as strictInput, V as subjectAuditActorId, H as subjectIdentity, we as subjectScopes, Dn as subscribeServerErrors, u as subscriptionEvent, U as systemSubject, W as tenantScopedSubject, Ot as toRpc, Ei as toSnakeCase, ai as tsMs, lt as undeclaredChannelKeys, Ar as undoApplyDescriptor, jr as undoLogQueryDescriptor, Mr as undoRedoDescriptor, bn as validateOutboxHandlerDefinition, kt as wireAudienceOf, At as wireErrorUnion, jt as withRpcTag, On as withheldServerError, on as workflowAccessDescriptor, tr as workflowCancelDescriptor, nr as workflowControlQueryDescriptor, rr as workflowDomainEventsQueryDescriptor, ir as workflowEventDeliveriesQueryDescriptor, ar as workflowQueuedCancelDescriptor, or as workflowQueuedControlQueryDescriptor, sr as workflowResumeDescriptor, cr as workflowRunEventsQueryDescriptor, lr as workflowRunQueryDescriptor, ur as workflowRunStepsQueryDescriptor, dr as workflowRunsQueryDescriptor, fr as workflowSignalDescriptor, pr as workflowToRpc, mr as workflowUpdateDescriptor, Mt as workflowWireErrorUnion, ze as wsMutationIdempotencyScope };
55
+ export { K as ADMIN_SCOPE, q as APIKEY_ISSUE_ORG_SCOPE, J as APIKEY_ISSUE_OTHER_SCOPE, Y as APIKEY_ISSUE_SELF_SCOPE, Dn as API_WORKLOADS, ci as APPROVALS_DECIDE_TAG, li as APPROVALS_PENDING_TAG, da as ApiRoleObservationSchema, Tn as ApiUnavailable, Je as ApprovalDecisionErrors, Ye as ApprovalErrors, Xe as ApprovalExpired, Ze as ApprovalForbidden, Qe as ApprovalNotFound, $e as ApprovalNotPending, et as ApprovalRejected, tt as ApprovalRequired, nt as ApprovalSelfApproval, rt as ApprovalUnavailable, h as AuthMiddleware, ma as BoundedRing, Ae as BusinessRuleViolation, fi as CONNECTIONS_LIST_TAG, pi as CONNECTION_DISCONNECT_TAG, mi as CONNECTION_START_TAG, hi as CONNECTION_SUBMIT_TOKEN_TAG, gi as ConnectionHandshakeFailed, g as ConnectionInfo, _ as ConnectionInfoMiddleware, _i as ConnectionKind, vi as ConnectionKindMismatch, yi as ConnectionNotDeclared, bi as ConnectionState, xi as ConnectionStatus, Si as ConnectionSubjectRequired, ti as ConstraintViolation, je as DEFAULT_IN_FLIGHT_LEASE_MS, v as DEFAULT_SCOPE_CACHE_MAX_ENTRIES, y as DEFAULT_SCOPE_CACHE_TTL_MS, X as DEVICES_MANAGE_SCOPE, pn as DEV_ACTIVITY_EVENT, qt as EVENT_ROUTE_SEP, Jt as EventKeyInvalid, Yt as EventPayloadInvalid, Xt as EventPayloadTooLarge, Zt as EventRpcWorkload, ha as FORM_CAPTURE_FIELD, ga as FORM_CAPTURE_META_NAME, ht as FRAMEWORK_WIRE_ERRORS, Pi as GATEWAY_CREDENTIAL_EXPIRED_CLOSE_CODE, b as IMPERSONATION_METADATA_KEY, Ri as JSONAPI_MEDIA_TYPE, Qt as MAX_EVENT_ENVELOPE_BYTES, Me as MUTATION_IN_FLIGHT_RETRY_AFTER_MS, Ne as MutationConnectionRequired, Pe as MutationIdempotencyRefused, Fe as MutationInFlight, ni as NoRowFound, Z as NoSuchResource, $i as PAIRING_HOST, ea as PAIRING_SCHEME, ta as PAIRING_STORAGE_KEY, zi as PROBLEM_JSON, ba as PROTOCOL_VERSION, it as PendingApproval, Rn as PluginAccountMergeFailure, Fn as PluginPrivacyErasePhaseSchema, In as PluginPrivacyFailure, at as REACTIVITY_CHANNEL_PREFIX, Bi as REST_PROFILE_NAMES, d as RequestedTenantRefused, gt as SERVICE_NAME_PATTERN, Ii as SESSION_HEADER_NAME, Oi as STORE_SCREENSHOT_PRESETS, ki as STORE_SCREENSHOT_PRESET_NAMES, Ai as STORE_SCREENSHOT_STORES, Q as ScopeError, ri as ServerOnlyColumnWrite, fa as StorageAccessPolicySchema, pa as StorageAccessRuleSchema, ii as StoreOperationFailed, x as Subject, S as SubjectIdentity, C as SubjectService, ai as TableValidationFailed, oi as TenantRowNotFound, si as TenantScopeViolation, f as TenantSelectionRefused, Wr as UNDO_APPLY_TAG, Gr as UNDO_LOG_TAG, Kr as UNDO_REDO_TAG, w as Unauthenticated, qr as UndoConflict, Jr as UndoForbidden, Yr as UndoLogEntry, Xr as UndoNotFound, We as ValidationError, Ge as ValidationErrors, Ke as ValidationIssue, mn as WorkflowAccessProperty, Zn as WorkflowControlInputSchema, Qn as WorkflowControlIntentSchema, $n as WorkflowControlReadInputSchema, er as WorkflowControlResultSchema, tr as WorkflowDomainEventRowSchema, nr as WorkflowDomainEventsInputSchema, rr as WorkflowEventDeliveriesInputSchema, ir as WorkflowEventDeliveryRowSchema, ar as WorkflowParentClosePolicySchema, or as WorkflowQueuedCancelInputSchema, sr as WorkflowQueuedCancellationResultSchema, cr as WorkflowQueuedControlTargetSchema, zr as WorkflowRestartCommandSchema, Br as WorkflowRestartObservationSchema, Vr as WorkflowRestartResultSchema, Hr as WorkflowRestartSelectionSchema, Ur as WorkflowRestartTargetSchema, Ir as WorkflowRetryCommandSchema, Lr as WorkflowRetryObservationSchema, Rr as WorkflowRetryTargetSchema, lr as WorkflowRunEventRowSchema, ur as WorkflowRunHandleSchema, dr as WorkflowRunRefSchema, fr as WorkflowRunRowSchema, pr as WorkflowRunSnapshotSchema, mr as WorkflowRunStatusSchema, hr as WorkflowRunStepRowSchema, gr as WorkflowRunTableRefSchema, _r as WorkflowRunsInputSchema, vr as WorkflowSignalInputSchema, yr as WorkflowStartDeferralSchema, Xn as WorkflowStartTerminalOutcomeSchema, br as WorkflowUpdateInputSchema, xr as WorkflowUpdateResultSchema, _t as actionToRpc, $ as advisoryResourceGuardWarning, T as anonymousSubject, sa as apiRoleEndpointUrl, ca as apiRoleProxyBasePath, na as applyPairing, e as applyRowPatch, E as applyScopeDecision, ui as approvalsDecideDescriptor, di as approvalsPendingQueryDescriptor, D as assertAuthenticated, hn as attachWorkflowAccess, Ie as beginIdempotent, O as bindSubjectAuthority, Gt as canonicalJson, la as captureApiRoleEndpoints, mt as captureOptionalQuerySources, On as checkFrameworkCompat, ee as checkGuards, te as checkGuardsEffect, ra as clearPairing, yn as compareSurfaces, k as composeAuthStrategies, kn as composeReplayAuthorityBindings, An as composeRpcInterceptors, Ci as connectionDisconnectDescriptor, wi as connectionStartDescriptor, Ti as connectionSubmitTokenDescriptor, Ei as connectionsListQueryDescriptor, zn as createPluginAccountMergeRegistry, Ln as createPluginPrivacyRegistry, t as createRowPatchApplier, A as currentSubjectAuthority, Ut as declaredErrorTags, ot as declaredReactivityChannelKeys, ne as declaresResourceGuard, vt as defineAction, $t as defineEvent, yt as defineMutation, jn as definePlugin, Mn as definePluginRoute, Nn as definePluginService, bt as defineQuery, xt as defineStream, Fi as defineWebSocket, n as diffRows, re as effectiveScopes, en as encodeEventKey, _a as encodeNativeFormCapture, Vi as encodeRestError, Hi as encodeRestSuccess, Wt as errorMemberSchema, Bt as errorMessage, Vt as errorTag, tn as eventAttached, nn as eventEnvelope, rn as eventGap, an as eventResumePoint, on as eventRoute, sn as eventStreamEvent, cn as eventSubscribeInput, ln as eventToRpc, Le as failIdempotent, qe as fieldIssuesOf, ie as findAdvisoryResourceGuards, Re as finishIdempotent, Yi as finiteNumberView, l as firstEventValue, va as formCaptureSource, un as formatEventRoute, ze as freshFor, ae as getPolicyGuardResolver, oe as getResourceScopeResolver, gn as getWorkflowAccess, bn as groupShapeDigests, St as hasAccessDecision, j as hasCallbackRoutes, se as hasEffectiveScope, Ct as hasEnforcedGuard, ce as hasScope, Be as holdIdempotentClaim, r as idToPath, Ve as idempotencyScope, Oe as inputLabel, En as isApiUnavailable, le as isAuthenticatedCheck, wt as isAuthenticatedGuard, Tt as isClientReachable, dn as isEventDescriptor, i as isIdKeyed, M as isMachineSubject, ue as isOpenAccess, de as isPolicyCheck, Et as isPolicyGuard, st as isReactivityChannel, ct as isReactivityChannelKey, fe as isServiceAccess, Dt as isServiceReachable, N as isServiceSubject, P as isSystemSubject, p as isTenantSelectable, pe as isUpgradedCheck, Ot as isUpgradedGuard, kt as isWireReachable, Xi as jsonSchemaDocumentOf, Zi as jsonSchemaOf, F as makeScopeCache, He as memoryIdempotencyStore, me as missingAccessDecision, At as mutationToRpc, Ui as nextLink, jt as normalizeDescriptor, lt as normalizeSource, he as openAccessSpec, I as orderByBearerPrefix, ia as pairingLink, fn as parseEventRoute, aa as parsePairingLink, wn as parseRevalidateMs, a as patchCellSchema, o as pathToId, Qi as plainJsonSchema, Hn as pluginAlias, Pn as pluginInstanceName, Un as pluginSlug, Wn as pluginTag, Kt as prepareIdempotentInput, Wi as problemDetails, Gi as problemTypeOf, xn as procedureShapeDigest, ut as publishReactivity, qn as publishServerError, Mt as queryToRpc, L as rawImpersonationMark, dt as reactivityChannel, ya as readFormCaptureSource, oa as readPairing, R as reauthorizeSubject, ge as recheckGuardsEffect, _e as refreshEffectiveScopes, Gn as registerPluginAliases, Ht as reportableError, ve as requireScope, Nt as requireUpgraded, Kn as resetPluginAliases, z as resolveIdentityAuthority, ye as resolvePolicyAction, Ki as resolveRestFormat, _n as resolveWorkflowAccess, qi as restViewSchema, s as rowPatchOpSchema, c as rowPatchSchema, Sn as schemaShape, B as scopeCacheKey, ua as selectApiRoleEndpoint, m as selectSubjectTenant, be as serviceAccessSpec, xe as serviceCallersOf, V as serviceSubject, Li as sessionValueFromHeaders, Se as setEffectiveScopes, Ce as setEffectiveScopesRefresher, we as setPolicyGuardResolver, Te as setResourceScopeResolver, Cn as shapeDigest, ft as sourceKeys, ei as ssrfReason, ji as storeScreenshotPixels, Mi as storeScreenshotPreset, Ni as storeScreenshotPresetsFor, Pt as streamToRpc, ke as strictInput, H as subjectAuditActorId, U as subjectIdentity, Ee as subjectScopes, Jn as subscribeServerErrors, u as subscriptionEvent, W as systemSubject, G as tenantScopedSubject, Ft as toRpc, Ji as toSnakeCase, Di as tsMs, pt as undeclaredChannelKeys, Zr as undoApplyDescriptor, Qr as undoLogQueryDescriptor, $r as undoRedoDescriptor, De as upgradedGuardShapeError, Bn as validateHttpStreamMaxDuration, Vn as validateOutboxHandlerDefinition, It as wireAudienceOf, Lt as wireErrorUnion, Rt as withRpcTag, Yn as withheldServerError, vn as workflowAccessDescriptor, Sr as workflowCancelDescriptor, Cr as workflowControlQueryDescriptor, wr as workflowDomainEventsQueryDescriptor, Tr as workflowEventDeliveriesQueryDescriptor, Er as workflowQueuedCancelDescriptor, Dr as workflowQueuedControlQueryDescriptor, Or as workflowResumeDescriptor, kr as workflowRunEventsQueryDescriptor, Ar as workflowRunQueryDescriptor, jr as workflowRunStepsQueryDescriptor, Mr as workflowRunsQueryDescriptor, Nr as workflowSignalDescriptor, Pr as workflowToRpc, Fr as workflowUpdateDescriptor, zt as workflowWireErrorUnion, Ue as wsMutationIdempotencyScope };
package/dist/inspect.d.ts CHANGED
@@ -162,7 +162,7 @@ export declare class InvalidReplicaSelection extends Error {
162
162
 
163
163
  export declare const isInspectCommandRejection: <I>(input: I) => input is I & {
164
164
  readonly kind: "rejected";
165
- readonly status: 400 | 401 | 403 | 404;
165
+ readonly status: 400 | 404 | 401 | 403;
166
166
  readonly message: string;
167
167
  };
168
168
 
package/dist/jwt.d.ts CHANGED
@@ -48,6 +48,13 @@ declare interface AuthStrategy {
48
48
  declare interface AuthStrategyInput {
49
49
  readonly headers: Readonly<Record<string, string | undefined>>;
50
50
  readonly clientId: number;
51
+ /** HTTP request target, supplied by REST transports. Request selectors may
52
+ * read an explicit tenant hint here; it is never authentication or authority.
53
+ * Absent for connection transports and non-HTTP callers. */
54
+ readonly http?: {
55
+ readonly path: string;
56
+ readonly query: string;
57
+ };
51
58
  /**
52
59
  * The app's DataStore, for a strategy that must READ to identify the caller.
53
60
  *
@@ -291,6 +298,9 @@ declare type StrategyResolution = {
291
298
 
292
299
  declare const Subject: Schema.Union<readonly [Schema.Struct<{
293
300
  readonly type: Schema.Literal<"user">;
301
+ /** A guest has a stable identity but has not linked a registered account.
302
+ * This identity mark survives session signing; it never grants authority. */
303
+ readonly kind: Schema.optional<Schema.Literal<"guest">>;
294
304
  readonly id: Schema.String;
295
305
  readonly tenantId: Schema.String;
296
306
  readonly scopes: Schema.optional<Schema.$Array<Schema.String>>;
package/dist/jwt.js CHANGED
@@ -77,7 +77,7 @@ var i = 36e5, a = /* @__PURE__ */ new Map(), o = (e, n) => {
77
77
  if (e instanceof n.JWSInvalid || e instanceof n.JWTInvalid) return new c("malformed jwt", "malformed");
78
78
  if (e instanceof n.JOSEAlgNotAllowed) return new c("jwt algorithm not allowed", "unsupported_algorithm");
79
79
  let t = e?.message ?? String(e);
80
- return /fetch|network|enotfound|econnrefused/i.test(t) ? new c(`jwks unreachable: ${t}`, "jwks_unreachable") : new c(`jwt verify failed: ${t}`, "other");
80
+ return e instanceof n.JWKSTimeout || /fetch|network|enotfound|econnrefused|JSON Web Key Set/i.test(t) ? new c(`jwks unreachable: ${t}`, "jwks_unreachable") : new c(`jwt verify failed: ${t}`, "other");
81
81
  }, v = (t, n, r) => {
82
82
  let i = t.authorization ?? t.Authorization;
83
83
  if (i?.startsWith("Bearer ")) {
package/dist/plugin.js CHANGED
@@ -1,19 +1,34 @@
1
1
  import { Context as e, Layer as t } from "effect";
2
2
  //#region src/plugin.ts
3
- var n = (e) => e, r = (e) => e, i = (e) => {
3
+ var n = Object.freeze([
4
+ "rpc",
5
+ "subscriptions",
6
+ "events",
7
+ "presence",
8
+ "workflows",
9
+ "schedules",
10
+ "directors",
11
+ "drainers",
12
+ "reapers",
13
+ "retention",
14
+ "rest",
15
+ "webhooks",
16
+ "inspect",
17
+ "cdc"
18
+ ]), r = (e) => e, i = (e) => e, a = (e) => {
4
19
  let t = e.alias?.trim(), n = e.instance?.trim(), r = t !== void 0 && t !== "" ? t : e.base;
5
20
  return n !== void 0 && n !== "" ? `${r}#${n}` : r;
6
- }, a = (e) => {
21
+ }, o = (e) => {
7
22
  if (e.length !== 0) return (t, n) => e.reduceRight((e, t) => t(e, n), t);
8
- }, o = (n, r) => {
23
+ }, s = (n, r) => {
9
24
  let i = e.Service(n);
10
25
  return {
11
26
  Tag: i,
12
27
  Live: t.succeed(i, r)
13
28
  };
14
- }, s = (e, t, n) => {
29
+ }, c = (e, t, n) => {
15
30
  if (!t) return { ok: !0 };
16
- let r = n === void 0 ? null : c(n);
31
+ let r = n === void 0 ? null : l(n);
17
32
  if (!r) return {
18
33
  ok: !0,
19
34
  unverified: `plugin "${e}" requires framework ${t}, but the running framework version is ${n === void 0 ? "unknown" : `unreadable ("${n}")`} — not checked.`
@@ -21,12 +36,12 @@ var n = (e) => e, r = (e) => e, i = (e) => {
21
36
  let i = t.trim();
22
37
  if (i === "*" || i === "") return { ok: !0 };
23
38
  let a = i.split(/\s+/);
24
- for (let i of a) if (!u(i, r)) return {
39
+ for (let i of a) if (!d(i, r)) return {
25
40
  ok: !1,
26
41
  reason: `plugin "${e}" requires framework ${t}, running ${n}`
27
42
  };
28
43
  return { ok: !0 };
29
- }, c = (e) => {
44
+ }, l = (e) => {
30
45
  let t = /^(\d+)\.(\d+)\.(\d+)(?:-([0-9a-zA-Z.-]+))?$/.exec(e.trim());
31
46
  return t ? {
32
47
  major: Number(t[1]),
@@ -34,28 +49,39 @@ var n = (e) => e, r = (e) => e, i = (e) => {
34
49
  patch: Number(t[3]),
35
50
  pre: t[4] ?? ""
36
51
  } : null;
37
- }, l = (e, t) => e.major === t.major ? e.minor === t.minor ? e.patch === t.patch ? e.pre && !t.pre ? -1 : !e.pre && t.pre ? 1 : e.pre && t.pre ? e.pre < t.pre ? -1 : +(e.pre > t.pre) : 0 : e.patch - t.patch : e.minor - t.minor : e.major - t.major, u = (e, t) => {
52
+ }, u = (e, t) => e.major === t.major ? e.minor === t.minor ? e.patch === t.patch ? e.pre && !t.pre ? -1 : !e.pre && t.pre ? 1 : e.pre && t.pre ? e.pre < t.pre ? -1 : +(e.pre > t.pre) : 0 : e.patch - t.patch : e.minor - t.minor : e.major - t.major, d = (e, t) => {
38
53
  if (e === "*") return !0;
39
54
  if (e.startsWith("^")) {
40
- let n = c(e.slice(1));
41
- return !n || t.major !== n.major ? !1 : l(t, n) >= 0;
55
+ let n = l(e.slice(1));
56
+ return !n || t.major !== n.major ? !1 : u(t, n) >= 0;
42
57
  }
43
58
  if (e.startsWith("~")) {
44
- let n = c(e.slice(1));
45
- return !n || t.major !== n.major || t.minor !== n.minor ? !1 : l(t, n) >= 0;
59
+ let n = l(e.slice(1));
60
+ return !n || t.major !== n.major || t.minor !== n.minor ? !1 : u(t, n) >= 0;
46
61
  }
47
62
  let n = /^(>=|<=|>|<)(.+)$/.exec(e);
48
63
  if (n) {
49
- let e = n[1], r = c(n[2]);
64
+ let e = n[1], r = l(n[2]);
50
65
  if (!r) return !1;
51
- let i = l(t, r);
66
+ let i = u(t, r);
52
67
  if (e === ">=") return i >= 0;
53
68
  if (e === "<=") return i <= 0;
54
69
  if (e === ">") return i > 0;
55
70
  if (e === "<") return i < 0;
56
71
  }
57
- let r = c(e);
58
- return r ? l(t, r) === 0 : !1;
72
+ let r = l(e);
73
+ return r ? u(t, r) === 0 : !1;
74
+ }, f = (e) => {
75
+ let t = e.flatMap((e) => e.bindReplayAuthority === void 0 ? [] : [e.bindReplayAuthority]);
76
+ if (t.length !== 0) {
77
+ if (t.some((e) => typeof e != "function")) throw Error("Invalid replay authority binding");
78
+ return (e) => {
79
+ for (let n of t) {
80
+ let t = n(e);
81
+ if (t !== void 0) throw t instanceof Promise && t.catch(() => void 0), Error("Replay authority bindings must complete synchronously");
82
+ }
83
+ };
84
+ }
59
85
  };
60
86
  //#endregion
61
- export { s as checkFrameworkCompat, a as composeRpcInterceptors, n as definePlugin, r as definePluginRoute, o as definePluginService, i as pluginInstanceName };
87
+ export { n as API_WORKLOADS, c as checkFrameworkCompat, f as composeReplayAuthorityBindings, o as composeRpcInterceptors, r as definePlugin, i as definePluginRoute, s as definePluginService, a as pluginInstanceName };
@@ -0,0 +1,88 @@
1
+ import { Effect as e, Schema as t } from "effect";
2
+ //#region src/pluginAccountMerge.ts
3
+ var n = class extends t.TaggedError()("PluginAccountMergeFailure", {
4
+ code: t.Literals([
5
+ "invalid_request",
6
+ "coverage_missing",
7
+ "hook_failed"
8
+ ]),
9
+ requestId: t.String,
10
+ plugin: t.NullOr(t.String),
11
+ returned: t.Array(t.String),
12
+ missing: t.Array(t.String)
13
+ }) {}, r = (e) => typeof e == "object" && e && "tableName" in e && typeof e.tableName == "string" ? e.tableName : void 0, i = (t) => {
14
+ let i = /* @__PURE__ */ new Set(), a = t.map((e) => {
15
+ if (i.has(e.name)) throw Error("Duplicate account merge plugin instance: " + e.name);
16
+ i.add(e.name);
17
+ let t = e.subjectMerge;
18
+ if ((t !== void 0 || e.onMergeAccounts !== void 0) && (t === void 0 || e.onMergeAccounts === void 0 || t.kinds.length === 0 || t.kinds.some((e) => e !== "user" && e !== "guest") || new Set(t.kinds).size !== t.kinds.length || t.tables.some((e) => typeof e != "string" || !e.trim()) || new Set(t.tables).size !== t.tables.length)) throw Error("Account merge requires a valid declaration and hook: " + e.name);
19
+ return {
20
+ name: e.name,
21
+ tables: (e.extendSchema?.tables ?? []).map(r),
22
+ declaration: t === void 0 ? void 0 : {
23
+ tables: [...t.tables],
24
+ kinds: [...t.kinds]
25
+ },
26
+ hook: e.onMergeAccounts
27
+ };
28
+ }), o = (e) => {
29
+ let t = [], n = [];
30
+ for (let r of a) if (r.declaration?.kinds.includes(e) && r.hook) {
31
+ t.push({
32
+ name: r.name,
33
+ tables: Object.freeze([...r.declaration.tables])
34
+ });
35
+ for (let e of r.tables) (e === void 0 || !r.declaration.tables.includes(e)) && n.push(r.name);
36
+ } else (r.tables.length > 0 || r.declaration !== void 0) && n.push(r.name);
37
+ return {
38
+ participants: Object.freeze(t),
39
+ missing: Object.freeze([...new Set(n)])
40
+ };
41
+ };
42
+ return {
43
+ coverage: o,
44
+ mergeInTransaction: (t) => e.gen(function* () {
45
+ if (![
46
+ t.requestId,
47
+ t.tenantId,
48
+ t.sourceId,
49
+ t.targetId
50
+ ].every((e) => typeof e == "string" && e.trim().length > 0 && e.length <= 256) || t.sourceKind !== "user" && t.sourceKind !== "guest" || t.sourceId === t.targetId || t.store === void 0) return yield* e.fail(new n({
51
+ code: "invalid_request",
52
+ requestId: typeof t.requestId == "string" ? t.requestId.slice(0, 256) : "",
53
+ plugin: null,
54
+ returned: [],
55
+ missing: []
56
+ }));
57
+ let r = o(t.sourceKind);
58
+ if (r.missing.length > 0) return yield* e.fail(new n({
59
+ code: "coverage_missing",
60
+ requestId: t.requestId,
61
+ plugin: null,
62
+ returned: [],
63
+ missing: [...r.missing]
64
+ }));
65
+ let i = [], s = Object.freeze({
66
+ requestId: t.requestId,
67
+ tenantId: t.tenantId,
68
+ sourceId: t.sourceId,
69
+ sourceKind: t.sourceKind,
70
+ targetId: t.targetId,
71
+ store: t.store
72
+ });
73
+ for (let t of r.participants) {
74
+ let r = a.find((e) => e.name === t.name);
75
+ yield* e.suspend(() => r.hook(s)).pipe(e.catchCause(() => e.fail(new n({
76
+ code: "hook_failed",
77
+ requestId: s.requestId,
78
+ plugin: t.name,
79
+ returned: [...i],
80
+ missing: []
81
+ })))), i.push(t.name);
82
+ }
83
+ return Object.freeze(i);
84
+ })
85
+ };
86
+ };
87
+ //#endregion
88
+ export { n as PluginAccountMergeFailure, i as createPluginAccountMergeRegistry };
@@ -0,0 +1,166 @@
1
+ import { Effect as e, Schema as t } from "effect";
2
+ //#region src/pluginPrivacy.ts
3
+ var n = t.Literals([
4
+ "prepare",
5
+ "data",
6
+ "identity",
7
+ "finalize"
8
+ ]), r = class extends t.TaggedError()("PluginPrivacyFailure", {
9
+ code: t.Literals([
10
+ "invalid_request",
11
+ "coverage_missing",
12
+ "hook_failed",
13
+ "unavailable"
14
+ ]),
15
+ operation: t.Literals(["export", "erase"]),
16
+ requestId: t.String,
17
+ plugin: t.NullOr(t.String),
18
+ completed: t.Array(t.String),
19
+ missing: t.Array(t.String)
20
+ }) {}, i = (e) => typeof e == "object" && e && "tableName" in e && typeof e.tableName == "string" ? e.tableName : void 0, a = (e) => {
21
+ let t = /* @__PURE__ */ new Set(), n = (e) => {
22
+ if (e === null || typeof e == "string" || typeof e == "boolean" || typeof e == "number" && Number.isFinite(e)) return;
23
+ if (typeof e != "object" || !e || t.has(e)) throw Error("Invalid privacy JSON");
24
+ let r = Array.isArray(e), i = Object.getPrototypeOf(e);
25
+ if (r && i !== Array.prototype || !r && i !== Object.prototype && i !== null || Object.getOwnPropertySymbols(e).length !== 0) throw Error("Invalid privacy JSON");
26
+ t.add(e);
27
+ let a = Object.getOwnPropertyDescriptors(e);
28
+ if (r) {
29
+ let e = a.length?.value;
30
+ if (typeof e != "number" || Object.keys(a).length !== e + 1) throw Error("Invalid privacy JSON");
31
+ for (let t = 0; t < e; t++) {
32
+ let e = a[t];
33
+ if (!e || !e.enumerable || !("value" in e)) throw Error("Invalid privacy JSON");
34
+ n(e.value);
35
+ }
36
+ } else for (let e of Object.values(a)) {
37
+ if (!e.enumerable || !("value" in e)) throw Error("Invalid privacy JSON");
38
+ n(e.value);
39
+ }
40
+ t.delete(e);
41
+ };
42
+ return n(e), JSON.parse(JSON.stringify(e));
43
+ }, o = (o) => {
44
+ let s = /* @__PURE__ */ new Set(), c = o.map((e) => {
45
+ if (s.has(e.name)) throw Error(`Duplicate privacy plugin instance: ${e.name}`);
46
+ s.add(e.name);
47
+ let r = e.subjectPrivacy, a = [...e.extendSchema?.tables ?? []].map(i);
48
+ if (r !== void 0 || e.onErase !== void 0 || e.onExport !== void 0) {
49
+ if (r === void 0 || e.onErase === void 0 || e.onExport === void 0) throw Error(`Subject privacy requires a declaration and both hooks: ${e.name}`);
50
+ if (r.kinds.length === 0 || r.kinds.some((e) => e !== "user" && e !== "guest") || new Set(r.kinds).size !== r.kinds.length || r.tables.some((e) => typeof e != "string" || !e.trim()) || new Set(r.tables).size !== r.tables.length || r.erasePhase !== void 0 && !t.is(n)(r.erasePhase)) throw Error(`Invalid subject privacy declaration: ${e.name}`);
51
+ }
52
+ return {
53
+ name: e.name,
54
+ tables: a,
55
+ declaration: r === void 0 ? void 0 : {
56
+ tables: [...r.tables],
57
+ kinds: [...r.kinds],
58
+ erasePhase: r.erasePhase ?? "data"
59
+ },
60
+ onErase: e.onErase,
61
+ onExport: e.onExport
62
+ };
63
+ });
64
+ for (let e of ["user", "guest"]) if (c.filter((t) => t.declaration?.erasePhase === "finalize" && t.declaration.kinds.includes(e)).length > 1) throw Error(`Subject privacy allows one completion owner per kind: ${e}`);
65
+ let l = (e) => {
66
+ let t = [], n = [];
67
+ for (let r of c) {
68
+ let i = r.declaration;
69
+ (i === void 0 || i.kinds.includes(e)) && (i !== void 0 && t.push({
70
+ name: r.name,
71
+ tables: [...i.tables],
72
+ erasePhase: i.erasePhase
73
+ }), r.tables.some((e) => e === void 0 || !i?.tables.includes(e)) && n.push(r.name));
74
+ }
75
+ return {
76
+ participants: t,
77
+ missing: n
78
+ };
79
+ }, u = (t, n) => e.gen(function* () {
80
+ let i = typeof t?.requestId == "string" ? t.requestId : "", a = t?.target;
81
+ if (!i.trim() || typeof a?.subjectId != "string" || !a.subjectId.trim() || !(a.tenantId === null || typeof a.tenantId == "string" && a.tenantId.trim()) || a.kind !== "user" && a.kind !== "guest") return yield* e.fail(new r({
82
+ code: "invalid_request",
83
+ operation: n,
84
+ requestId: i,
85
+ plugin: null,
86
+ completed: [],
87
+ missing: []
88
+ }));
89
+ let o = l(a.kind);
90
+ return o.missing.length > 0 || o.participants.length === 0 ? yield* e.fail(new r({
91
+ code: "coverage_missing",
92
+ operation: n,
93
+ requestId: i,
94
+ plugin: null,
95
+ completed: [],
96
+ missing: o.missing
97
+ })) : {
98
+ requestId: i,
99
+ target: Object.freeze({
100
+ subjectId: a.subjectId,
101
+ tenantId: a.tenantId,
102
+ kind: a.kind
103
+ }),
104
+ context: Object.freeze({
105
+ requestId: i,
106
+ tenantId: a.tenantId,
107
+ kind: a.kind
108
+ }),
109
+ participants: o.participants
110
+ };
111
+ });
112
+ return {
113
+ coverage: l,
114
+ exportSubject: (t) => e.gen(function* () {
115
+ let n = yield* u(t, "export"), i = [];
116
+ for (let t of n.participants) {
117
+ let o = c.find((e) => e.name === t.name).onExport, s = yield* e.suspend(() => o(n.target.subjectId, n.context)).pipe(e.map(a), e.catchCause(() => e.fail(new r({
118
+ code: "hook_failed",
119
+ operation: "export",
120
+ requestId: n.requestId,
121
+ plugin: t.name,
122
+ completed: i.map((e) => e.name),
123
+ missing: []
124
+ }))));
125
+ i.push({
126
+ name: t.name,
127
+ data: s
128
+ });
129
+ }
130
+ return {
131
+ requestId: n.requestId,
132
+ target: n.target,
133
+ plugins: i
134
+ };
135
+ }),
136
+ eraseSubject: (t) => e.gen(function* () {
137
+ let n = yield* u(t, "erase"), i = [], a = [
138
+ ...n.participants.filter((e) => e.erasePhase === "prepare"),
139
+ ...n.participants.filter((e) => e.erasePhase === "data"),
140
+ ...n.participants.filter((e) => e.erasePhase === "identity"),
141
+ ...n.participants.filter((e) => e.erasePhase === "finalize")
142
+ ];
143
+ for (let t of a) {
144
+ let a = c.find((e) => e.name === t.name).onErase, o = t.erasePhase === "finalize" ? Object.freeze({
145
+ ...n.context,
146
+ completed: Object.freeze([...i])
147
+ }) : n.context;
148
+ yield* e.suspend(() => a(n.target.subjectId, o)).pipe(e.catchCause(() => e.fail(new r({
149
+ code: "hook_failed",
150
+ operation: "erase",
151
+ requestId: n.requestId,
152
+ plugin: t.name,
153
+ completed: [...i],
154
+ missing: []
155
+ })))), i.push(t.name);
156
+ }
157
+ return {
158
+ requestId: n.requestId,
159
+ target: n.target,
160
+ completed: i
161
+ };
162
+ })
163
+ };
164
+ };
165
+ //#endregion
166
+ export { n as PluginPrivacyErasePhaseSchema, r as PluginPrivacyFailure, o as createPluginPrivacyRegistry };