@ai-matrx/records 0.30.0 → 0.36.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.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { U as Uuid, T as TableType, a as TableDisplay, S as StorageMode, g as Timestamp, an as TableOrigin, h as RecordDocument, l as StoredRecord, k as Field, a0 as ParityFieldType, ad as RuleUse, ac as RuleNodeKind, R as RelationFlavor, O as OnDelete, aa as RelationBinding, f as RelationCardinality, W as MergeFieldSource, V as MergeFieldSemanticType, Q as MergeFieldModifier, Z as OverridePolicy, w as Delivery, H as Freshness, a2 as PerValueAccessWord, t as Actor } from './field-D08d_e7R.js';
2
- export { A as ABSENCE_REASONS, r as ACTOR_VOCABULARY, s as AbsenceReason, u as COMPUTE_ON, v as CONTEXT_POLICIES, C as ComputeOn, e as ContextPolicy, D as DELIVERIES, E as ENTITY_TOKENS, x as EntityToken, y as FIELD_SENSITIVITIES, z as FIELD_SOURCES, B as FRESHNESS, G as FieldBehavior, m as FieldPatch, p as FieldProposal, c as FieldRule, d as FieldSensitivity, b as FieldSource, F as FieldTypeWord, I as HiddenFieldNotice, K as KERNEL_TABLES, J as KernelTableName, M as MERGE_FIELD_MODIFIERS, L as MERGE_FIELD_SEMANTIC_TYPES, P as MERGE_FIELD_SOURCES, N as NewFieldDeclaration, X as ON_DELETE, Y as OVERRIDE_POLICIES, _ as PARITY_FIELD_TYPES, $ as PER_VALUE_ACCESS_WORDS, a1 as ParityFieldTypeDescriptor, a3 as ProvenancePointer, a4 as RELATION_BINDINGS, a5 as RELATION_CARDINALITIES, a6 as RELATION_FLAVORS, a7 as RETIRED_ACTOR_WORDS, a8 as RULE_NODE_KINDS, a9 as RULE_USES, j as ReadRow, o as ReadValue, i as RecordRead, n as RecordRevision, ab as RetiredActorWord, ae as STORAGE_MODES, af as STORE_DOORS, ag as STORE_KNOBS, ah as STORE_REFUSAL_CODES, ai as StoreDoorName, aj as StoreRefusalCode, ak as TABLE_DISPLAYS, al as TABLE_ORIGINS, am as TABLE_TYPES, q as TableProposal, ao as VALUE_ALTERNATE_KEYS, ap as VALUE_ENVELOPE_KEYS, aq as ValueAlternate, ar as ValueAlternateKey, as as ValueEnvelope, at as ValueEnvelopeKey, au as ValueSource } from './field-D08d_e7R.js';
1
+ import { U as Uuid, T as TableType, a as TableDisplay, S as StorageMode, g as Timestamp, av as TableOrigin, h as RecordDocument, m as StoredRecord, l as Field, a7 as ParityFieldType, al as RuleUse, ak as RuleNodeKind, R as RelationFlavor, O as OnDelete, ai as RelationBinding, f as RelationCardinality, a1 as MergeFieldSource, a0 as MergeFieldSemanticType, $ as MergeFieldModifier, a4 as OverridePolicy, B as Delivery, M as Freshness, x as Actor, P as PgError } from './field-CWBdZfFv.js';
2
+ export { A as ABSENCE_REASONS, v as ACTOR_VOCABULARY, w as AbsenceReason, y as COMPUTE_ON, z as CONTEXT_POLICIES, C as ComputeOn, e as ContextPolicy, D as DELIVERIES, E as ENTITY_TOKENS, G as EntityToken, H as FIELD_SENSITIVITIES, I as FIELD_SOURCES, J as FRESHNESS, K as FieldBehavior, n as FieldPatch, q as FieldProposal, c as FieldRule, d as FieldSensitivity, b as FieldSource, F as FieldTypeWord, L as ForbiddenEnvelopeWord, Q as HiddenFieldNotice, V as KERNEL_TABLES, X as KernelTableName, Y as MERGE_FIELD_MODIFIERS, Z as MERGE_FIELD_SEMANTIC_TYPES, _ as MERGE_FIELD_SOURCES, N as NewFieldDeclaration, a2 as ON_DELETE, a3 as OVERRIDE_POLICIES, a5 as PARITY_FIELD_TYPES, a6 as PER_VALUE_ACCESS_WORDS, a8 as ParityFieldTypeDescriptor, a9 as PerValueAccessWord, u as PredictedRefusal, aa as ProvenancePointer, ab as RELATION_BINDINGS, ac as RELATION_CARDINALITIES, ad as RELATION_FLAVORS, ae as RETIRED_ACTOR_WORDS, af as RULE_NODE_KINDS, ag as RULE_USES, k as ReadRow, p as ReadValue, j as RecordRead, o as RecordRevision, s as RecordsError, ah as RecordsErrorCode, i as RecordsResult, aj as RetiredActorWord, am as STORAGE_MODES, an as STORE_DOORS, ao as STORE_KNOBS, ap as STORE_REFUSAL_CODES, t as StaleWriteDetail, aq as StoreDoorName, ar as StoreRefusalCode, as as TABLE_DISPLAYS, at as TABLE_ORIGINS, au as TABLE_TYPES, r as TableProposal, aw as VALUE_ALTERNATE_KEYS, ax as VALUE_ENVELOPE_KEYS, ay as ValueAlternate, az as ValueAlternateKey, aA as ValueEnvelope, aB as ValueEnvelopeKey, aC as ValueSource, W as WriteConflict, aD as err, aE as isRecordsErr, aF as ok } from './field-CWBdZfFv.js';
3
3
 
4
4
  /** `public.permission_level`, in the store's own order. */
5
5
  type PermissionLevel = "viewer" | "commenter" | "editor" | "admin";
@@ -274,7 +274,25 @@ interface PipelineStage {
274
274
  }
275
275
  /** What each Rule of a pipeline is about. Closed, and the store is the authority. */
276
276
  declare const PIPELINE_RULE_KINDS: readonly ["moves", "requires", "who", "limit", "entry"];
277
- type PipelineRuleKind = (typeof PIPELINE_RULE_KINDS)[number];
277
+ /**
278
+ * A GATE is the general form under `requires`, `who` and `limit`, and the store spells it
279
+ * `gate:1`, `gate:2` … so several gates can sit on one stage without one overwriting the
280
+ * next. It is matched as a prefix rather than listed, because the number is open.
281
+ */
282
+ type PipelineRuleKind = (typeof PIPELINE_RULE_KINDS)[number] | `gate:${number}`;
283
+ /**
284
+ * WHAT A GATE DOES WHEN IT SAYS NO. The closed list `custom.stage_rule_on_fail_kinds()`
285
+ * answers — a screen offering a third answer would be offering something no Rule can carry.
286
+ */
287
+ declare const STAGE_RULE_ON_FAIL: readonly ["refuse", "require_approval"];
288
+ type StageRuleOnFail = (typeof STAGE_RULE_ON_FAIL)[number];
289
+ /**
290
+ * THE ORGANIZATION'S ONE KNOB (`custom/stage_rule_enforcement`). `refuse` is the default and
291
+ * what a gate is for; `warn` lets the move through and hands the same sentence back. It never
292
+ * softens `require_approval` — "ask somebody" and "carry on with a note" are different answers.
293
+ */
294
+ declare const STAGE_RULE_ENFORCEMENT: readonly ["refuse", "warn"];
295
+ type StageRuleEnforcement = (typeof STAGE_RULE_ENFORCEMENT)[number];
278
296
  /**
279
297
  * One transition Rule, as `custom.pipeline_read` hands it back — WITH the sentence it says
280
298
  * when it refuses, because a screen that knows a rule exists but not what it refuses in
@@ -291,8 +309,64 @@ interface PipelineRule {
291
309
  uses: string[];
292
310
  /** What happens when a card ARRIVES in this stage — assign, notify, start a checklist. */
293
311
  on_entry: Record<string, unknown> | null;
312
+ /**
313
+ * What this Rule does when it STOPS a move. `refuse` is the default and what every
314
+ * pipeline Rule did before gates existed; `require_approval` files the change in the
315
+ * approvals queue with this Rule's sentence as the reason and leaves the record alone.
316
+ */
317
+ on_fail?: StageRuleOnFail;
318
+ /**
319
+ * THE GATE AS IT WAS WRITTEN, which is the only thing that makes it EDITABLE.
320
+ *
321
+ * A gate is saved as one Rule whose expression is an `or` of four arms — not this
322
+ * stage, OR not a move, OR the gate is not about this card, OR the demand holds. That
323
+ * compiled form used to be the only copy, so a settings screen could read a gate's name
324
+ * and its sentence and nothing else: it would open every existing rule with a blank
325
+ * condition and overwrite it the first time somebody pressed Save.
326
+ *
327
+ * Absent on the four sugar rules (`moves`, `requires`, `who`, `limit`), which nobody
328
+ * writes in a condition builder, and on any gate declared before the store started
329
+ * keeping them. Absent means "this one was not written here" — never "it has no
330
+ * condition", which is a different and dangerous thing to draw.
331
+ */
332
+ when?: Record<string, unknown> | null;
333
+ /** @see {@link PipelineRule.when} — the condition that has to hold, as it was written. */
334
+ demands?: Record<string, unknown> | null;
294
335
  version: number;
295
336
  }
337
+ /**
338
+ * WHAT A GATE WOULD DO TO THIS BOARD TODAY, from `custom.pipeline_gate_preview`.
339
+ *
340
+ * The one question somebody writing a rule that will refuse their colleagues' work
341
+ * actually has, answered while they are still typing it — the gate is judged as an
342
+ * argument, nothing is saved, and nothing is written. The store compiles it with the
343
+ * SAME compiler `pipeline_declare` uses, so this count and the refusal at the door are
344
+ * the same rule.
345
+ */
346
+ interface PipelineGatePreview {
347
+ is_pipeline: boolean;
348
+ /** Present, and it says what would make a board exist, when `is_pipeline` is false. */
349
+ why?: string;
350
+ /** The stage key the gate was tried against. */
351
+ stage?: string;
352
+ /** Live cards of this board this person may see that are not already in that stage. */
353
+ considered: number;
354
+ /** How many of them this gate would turn away. */
355
+ refused: number;
356
+ /**
357
+ * Up to three of them, BY NAME. A count with no names is a number nobody can check, and
358
+ * checking it is the whole reason to show it before saving.
359
+ */
360
+ examples: {
361
+ record_id: Uuid;
362
+ title: string;
363
+ }[];
364
+ /** True when the board is larger than the preview will walk, so the count is a floor. */
365
+ truncated?: boolean;
366
+ on_fail?: StageRuleOnFail;
367
+ /** The word this board uses for one of its cards — "quote", "deal" — for the sentence. */
368
+ noun?: string;
369
+ }
296
370
  /** The whole board's definition, from `custom.pipeline_read`. */
297
371
  interface Pipeline {
298
372
  is_pipeline: boolean;
@@ -338,6 +412,20 @@ interface PipelineMissingField {
338
412
  interface PipelineVerdict {
339
413
  allowed: boolean;
340
414
  is_pipeline: boolean;
415
+ /**
416
+ * The THREE answers a board has to draw differently, and the reason `allowed` alone is
417
+ * not enough: a card that is going for approval has not been refused, and a card that
418
+ * moved under `warn` has not been waved through silently.
419
+ */
420
+ outcome?: "allowed" | "refused" | "needs_approval" | "warned";
421
+ /** What this organization's one knob says right now. */
422
+ enforcement?: StageRuleEnforcement;
423
+ /** Set on `needs_approval`: what pressing on will actually do, in plain words. */
424
+ what_happens?: string;
425
+ /** Set on `warned`: the gates this organization asked to be told about, not stopped by. */
426
+ warnings?: StageRuleWarning[];
427
+ /** Approvals already filed against this card's own stage column that nobody has decided. */
428
+ pending?: StagePending[];
341
429
  /** The stage key the move was asked about. */
342
430
  to?: string;
343
431
  /** The store's own sentence — shown verbatim, never paraphrased by a screen. */
@@ -346,6 +434,8 @@ interface PipelineVerdict {
346
434
  rule_id?: Uuid;
347
435
  rule_version?: number;
348
436
  kind?: PipelineRuleKind;
437
+ /** What this Rule does when it stops a move. */
438
+ on_fail?: StageRuleOnFail;
349
439
  /**
350
440
  * When a stage demands columns that are empty, exactly which ones — so the screen can
351
441
  * prompt for them on entry instead of sending the person away to find them.
@@ -382,9 +472,80 @@ interface PipelineSpec {
382
472
  limits?: Record<string, number>;
383
473
  /** Stage name → what happens when a card arrives: assign, notify, start a checklist. */
384
474
  on_entry?: Record<string, Record<string, unknown>>;
475
+ /**
476
+ * Stage name → the gates a card has to get past to land there. The general form under
477
+ * `requires`, `who` and `limits`, and the only one that can say `require_approval`.
478
+ */
479
+ gates?: Record<string, PipelineGate[]>;
385
480
  moves_message?: string;
386
481
  requires_messages?: Record<string, string>;
387
482
  }
483
+ /**
484
+ * A gate the organization's own knob overruled. NOTHING FAILS SILENTLY: the move happened
485
+ * and the sentence comes back WITH it, together with what to do about it.
486
+ */
487
+ interface StageRuleWarning {
488
+ rule_id: Uuid;
489
+ rule: string;
490
+ /** The gate's own sentence, shown verbatim. */
491
+ why: string;
492
+ what_to_do: string;
493
+ }
494
+ /** An approval filed against this card's stage column that nobody has decided yet. */
495
+ interface StagePending {
496
+ approval_id: Uuid;
497
+ /** The stage key the card is waiting to go to. */
498
+ to: string;
499
+ why: string | null;
500
+ requested_at: string;
501
+ state: string;
502
+ }
503
+ /**
504
+ * The same wait, asked for a WHOLE BOARD in one question (`custom.pipeline_pending`), so a
505
+ * board can badge every card that is waiting without a round trip per card — and therefore
506
+ * actually does it, instead of drawing a filed card as if nobody had ever dragged it.
507
+ */
508
+ interface StagePendingOnBoard extends StagePending {
509
+ record_id: Uuid;
510
+ }
511
+ /** What `custom.pipeline_move` answers — an OBJECT on every path, never a bare number. */
512
+ interface PipelineMoveResult {
513
+ applied: boolean;
514
+ moved: boolean;
515
+ outcome: "moved" | "moved_with_warnings" | "needs_approval";
516
+ to: string;
517
+ version: number;
518
+ /** Set on `moved_with_warnings`. */
519
+ warnings?: StageRuleWarning[];
520
+ /** Set on `needs_approval`: the gate's sentence, the wait that was filed, and who has it. */
521
+ why?: string;
522
+ rule?: string;
523
+ rule_id?: Uuid;
524
+ approval_id?: Uuid;
525
+ approvers?: {
526
+ user_id: Uuid;
527
+ name: string | null;
528
+ why: string;
529
+ }[];
530
+ what_happens?: string;
531
+ }
532
+ /**
533
+ * ONE GATE ON A STAGE, as the condition builder on the stage settings screen writes it.
534
+ * `requires`, `who` and `limits` are sugar over this shape; this is the general form, and
535
+ * it speaks the SAME condition language as filters and formulas — never a second one.
536
+ */
537
+ interface PipelineGate {
538
+ /** What the gate is called in the settings list. */
539
+ name?: string;
540
+ /** The sentence a person reads when it stops them. Required: a refusal with no words is a dead end. */
541
+ message: string;
542
+ /** WHEN this gate is about this record at all. Absent means always. */
543
+ when?: Record<string, unknown>;
544
+ /** What has to hold. One condition node of the one Rule language. */
545
+ demands: Record<string, unknown>;
546
+ /** Default `refuse`. */
547
+ on_fail?: StageRuleOnFail;
548
+ }
388
549
  /**
389
550
  * THE ONE PLACE A SCREEN DECIDES WHETHER A CARD LOOKS DRAGGABLE — and it decides on the
390
551
  * PERSON, not on the rules. Whether a particular move is allowed is
@@ -2347,143 +2508,6 @@ interface ResolvedPublishBinding {
2347
2508
  notice: string;
2348
2509
  }
2349
2510
 
2350
- /**
2351
- * What KIND of refusal it was. The mapping from SQLSTATE to code lives in
2352
- * `/core`, and it is checked against `STORE_REFUSAL_CODES` — the list of every
2353
- * SQLSTATE the store's own bodies raise, generated from the live catalogue. A
2354
- * code the store can raise and this union cannot name is a hole, and the
2355
- * real-door suite fails on it.
2356
- */
2357
- type RecordsErrorCode =
2358
- /** `PT409` — somebody else's write won. The record clock moved under you. */
2359
- "stale_write"
2360
- /** `42501` — a door. Either the schema is revoked, or the store is switched off, or this principal may not pass. */
2361
- | "door"
2362
- /** `23514` — a Rule, a shape guard, or a validation the store enforces refused it. */
2363
- | "refused_by_rule"
2364
- /**
2365
- * `22004` / `22023` / `22P02` — the call itself was malformed: a missing id, a
2366
- * patch that is not an object, or a value that does not fit the type the
2367
- * store holds for that Field. The store's own message names the value and the
2368
- * type it could not be read as.
2369
- */
2370
- | "invalid_argument"
2371
- /** `02000` — the record is not here (deleted, never existed, or another organization's). */
2372
- | "not_found"
2373
- /** `23503` — something it points at is not there. */
2374
- | "missing_reference"
2375
- /** `23505` — that thing is already here. */
2376
- | "already_exists"
2377
- /** `0A000` — the store does not do this yet, and says which part. */
2378
- | "not_supported"
2379
- /** `53400` / `22012` — the store ran out of something, or the arithmetic could not be done. */
2380
- | "store_limit"
2381
- /**
2382
- * `40001` — the visibility snapshot this connection carries is older than a
2383
- * write the reader has already observed, so the store refused to answer at
2384
- * all rather than hand back something they just lost. Retry on a fresh
2385
- * connection; it is the one refusal in this list that is worth repeating.
2386
- */
2387
- | "stale_read"
2388
- /**
2389
- * `57014` — the store cancelled the statement at its own timeout. Nothing was
2390
- * refused on its merits and nothing was written; the same call can succeed on
2391
- * a smaller page or a quieter moment. With `stale_read`, one of the only two
2392
- * refusals in this list worth repeating.
2393
- */
2394
- | "timed_out"
2395
- /**
2396
- * THE DOOR THAT DOES NOT EXIST YET. Not an error condition in the database —
2397
- * this package asked for a door that is not in the live catalogue, so it
2398
- * refused to guess. `door_absent` always names the door and the lane that
2399
- * owns it; it is never a silent no-op and never an empty list.
2400
- */
2401
- | "door_absent"
2402
- /**
2403
- * `PGRST202` / `PGRST205` — PostgREST could not find the function or the
2404
- * schema. The database this client is pointed at is not serving the record
2405
- * store: the schema is not exposed, or the grants are not there.
2406
- */
2407
- | "store_not_served"
2408
- /** Anything the mapper could not place. It still carries the store's own words. */
2409
- | "internal";
2410
- /** A refusal, in the store's own words. */
2411
- interface RecordsError {
2412
- code: RecordsErrorCode;
2413
- /** THE STORE'S message, verbatim. Never paraphrased. */
2414
- message: string;
2415
- /** THE STORE'S hint, verbatim — this is where the remedy is written. */
2416
- hint?: string;
2417
- /** The SQLSTATE, so a caller can be exact when a code is not exact enough. */
2418
- sqlstate?: string;
2419
- /** Whatever the store put in DETAIL, parsed when it was json. */
2420
- detail?: unknown;
2421
- }
2422
- type RecordsResult<T> = {
2423
- ok: true;
2424
- data: T;
2425
- } | {
2426
- ok: false;
2427
- error: RecordsError;
2428
- };
2429
- /** Narrowing helper for hosts compiled without `strictNullChecks`. */
2430
- declare function isRecordsErr<T>(result: RecordsResult<T>): result is {
2431
- ok: false;
2432
- error: RecordsError;
2433
- };
2434
- declare const ok: <T>(data: T) => RecordsResult<T>;
2435
- declare const err: <T>(error: RecordsError) => RecordsResult<T>;
2436
- /**
2437
- * A `stale_write` carries everything the screen needs to show the conflict
2438
- * rather than a toast: which version you wrote against, which one won, and the
2439
- * value of every field you touched as it stands now. The store builds this and
2440
- * this type is its shape — nothing is reconstructed on the client.
2441
- */
2442
- interface StaleWriteDetail {
2443
- expected_version: number;
2444
- current_version: number;
2445
- contested_fields: Record<string, unknown>;
2446
- }
2447
- /** The parsed form of a `stale_write`, for `useRecordMutation`'s conflict state. */
2448
- interface WriteConflict extends StaleWriteDetail {
2449
- record_id: Uuid;
2450
- /** The store's own sentence — what the screen shows. */
2451
- message: string;
2452
- /** The store's own remedy. */
2453
- hint: string;
2454
- }
2455
- /**
2456
- * The structural shape of a PostgREST failure as supabase-js resolves it: a
2457
- * PLAIN OBJECT parsed from the response body, NOT an `Error`. Reading
2458
- * `.message` off `instanceof Error` discards the real database message on every
2459
- * genuine failure.
2460
- */
2461
- interface PgError {
2462
- code?: string | null;
2463
- message: string;
2464
- details?: string | null;
2465
- hint?: string | null;
2466
- }
2467
- /** What the validation mirror answers: the same sentence the trigger would raise. */
2468
- interface PredictedRefusal {
2469
- /** The field key the store would name, when it names one. */
2470
- field_key?: string;
2471
- /** The message the store's own body would raise, word for word. */
2472
- message: string;
2473
- hint?: string;
2474
- sqlstate: string;
2475
- /**
2476
- * Which of the store's bodies would raise it, so a reader can go and check
2477
- * that this mirror still tells the truth.
2478
- */
2479
- predicted_by: string;
2480
- }
2481
- /** VAL-5 / VAL-6, named so a caller can say which word was the problem. */
2482
- interface ForbiddenEnvelopeWord {
2483
- field_key: string;
2484
- word: PerValueAccessWord;
2485
- }
2486
-
2487
2511
  /**
2488
2512
  * The data seam: a structural subset of `SupabaseClient`. The package never
2489
2513
  * opens a database connection of its own and never holds a key — the HOST
@@ -2720,4 +2744,4 @@ interface ConversationScopeContext {
2720
2744
  /** `About: Acme Industrial` — the chip a bound chat wears. */
2721
2745
  declare function scopeChip(scope: ConversationScope): string;
2722
2746
 
2723
- export { Actor, type AggregateBucket, type AggregateFilter, type AggregateMeasure, type AggregateOperation, type AggregateRow, type AggregateWindow, type AnonTokenBinding, type BookingSummary, type CaptureField, type CaptureFileRef, type CaptureOutcome, type CaptureQuestion, type CaptureQueue, type CaptureQueueCounts, type CaptureQueueOptions, type CaptureQueuePorts, type CaptureQueueStore, type CaptureSheetFace, type CaptureSheetSummary, type CaptureSyncReport, type ChecklistDeclared, type ChecklistRequirement, type ChecklistRequirementKind, type ChecklistRoleSpec, type ChecklistRunStarted, type ChecklistRunStep, type ChecklistRunSummary, type ChecklistSpec, type ChecklistStepCompleted, type ChecklistStepSpec, type ChecklistTemplateShape, type ChecklistTemplateSummary, type ChecklistTrigger, type ChecklistTriggerKind, type ChoiceOption, type CommentThreadRead, type CommentWritten, type ConversationScope, type ConversationScopeContext, type CustomFieldTableType, type DashboardBlock, type DashboardBlockKind, type DashboardBlockResult, type DashboardRunResult, type DashboardSummary, Delivery, type DigestPreview, type DocRenderRow, type DocSignatureCheck, type DocSignatureRow, type DocTemplateRow, type DocToken, type DocUnresolvedToken, type EnrichAlternate, type EnrichCell, type EnrichDeclared, type EnrichDueRow, type EnrichRun, type EnrichSource, type Enrichment, type EnrichmentSummary, type EntityFieldRights, type EntityFieldValue, type EntityRecordMatch, type EntityRecordRead, type EntityRecordsFound, type EntityTableFacts, type ExternalPrincipalCard, Field, type FieldHistoryEntry, type ForbiddenEnvelopeWord, type FormSummary, Freshness, type HistoryActor, type HistoryActorKind, type HistoryChange, type Home, type ImportBatchResult, type ImportColumnPlan, type ImportFinished, type ImportOpened, type ImportOutcome, type ImportPlan, type ImportPolicy, type ImportProposal, type ImportReport, type ImportRun, type InboundAddress, type InboundDeclared, type MergeField, MergeFieldModifier, type MergeFieldProvenance, type MergeFieldResolution, MergeFieldSemanticType, MergeFieldSource, type MergeFieldTransform, type MissingBehavior, type MyLevel, type MySubscription, type NewEntityFieldDeclaration, OnDelete, OverridePolicy, PERMISSION_LEVELS, PIPELINE_RULE_KINDS, ParityFieldType, PerValueAccessWord, type PermissionLevel, type PgError, type Pipeline, type PipelineColumn, type PipelineDeclared, type PipelineMissingField, type PipelineRule, type PipelineRuleKind, type PipelineSpec, type PipelineStage, type PipelineVerdict, type PortalCard, type PortalInvitation, type PortalPreviewRow, type PortalPrincipal, type PortalRevocation, type PortalSummary, type PortalTableExposure, type PredictedRefusal, type PublishBinding, type QueuedCapture, type QueuedCaptureFile, type QueuedCaptureState, type QuietHours, REFUSALS_WORTH_REPEATING, type RecordComment, RecordDocument, type RecordHistoryEntry, type RecordScopeComment, type RecordScopeContext, type RecordScopeField, type RecordScopeHistoryEntry, type RecordScopeRelation, type RecordScopeWithheld, type RecordsActor, type RecordsConfig, type RecordsDataSource, type RecordsError, type RecordsErrorCode, type RecordsErrorSink, type RecordsFilter, type RecordsRealtimePort, type RecordsResolverPort, type RecordsResponse, type RecordsResult, type RecordsTableQuery, type RegisteredTable, type Relation, RelationBinding, RelationCardinality, type RelationCarries, type RelationCoordinate, RelationFlavor, type RelationProperties, type RelationTarget, type ResolutionTriple, type ResolvedPublishBinding, type RestorePreview, type RestoreResult, type Rule, type RuleAnswer, type RuleExpression, RuleNodeKind, RuleUse, type StaleWriteDetail, StorageMode, StoredRecord, type StuckRow, type Subscription, type SubscriptionBlock, type SubscriptionCadence, type SubscriptionSpec, type Table, type TableCapacity, TableDisplay, TableOrigin, TableType, Timestamp, Uuid, type WorkApprovalDecision, type WorkApprovalFiled, type WorkApprover, type WorkAssignment, type WorkAssignmentField, type WorkChange, type WorkDueState, type WorkGraph, type WorkInboxItem, type WorkInboxKind, type WorkInstantiation, type WorkListFlavour, type WorkListItem, type WorkOrigin, type WorkRecordState, type WorkSlotHold, type WorkState, type WorkTemplateNode, type WorkTemplateRelation, type WorkTurn, type WriteConflict, asPermissionLevel, atLeast, bookingPath, choiceSlug, choiceValuesOf, choicesOf, err, highestLevel, holdsARetiredChoice, indexedDbStore, isDecided, isRecordsErr, isTheChosen, looksLikeAnId, mayDrag, measureKey, memoryStore, mintClientKey, ok, openCaptureQueue, optionKey, optionLabel, portalPath, publicFormPath, scopeChip };
2747
+ export { Actor, type AggregateBucket, type AggregateFilter, type AggregateMeasure, type AggregateOperation, type AggregateRow, type AggregateWindow, type AnonTokenBinding, type BookingSummary, type CaptureField, type CaptureFileRef, type CaptureOutcome, type CaptureQuestion, type CaptureQueue, type CaptureQueueCounts, type CaptureQueueOptions, type CaptureQueuePorts, type CaptureQueueStore, type CaptureSheetFace, type CaptureSheetSummary, type CaptureSyncReport, type ChecklistDeclared, type ChecklistRequirement, type ChecklistRequirementKind, type ChecklistRoleSpec, type ChecklistRunStarted, type ChecklistRunStep, type ChecklistRunSummary, type ChecklistSpec, type ChecklistStepCompleted, type ChecklistStepSpec, type ChecklistTemplateShape, type ChecklistTemplateSummary, type ChecklistTrigger, type ChecklistTriggerKind, type ChoiceOption, type CommentThreadRead, type CommentWritten, type ConversationScope, type ConversationScopeContext, type CustomFieldTableType, type DashboardBlock, type DashboardBlockKind, type DashboardBlockResult, type DashboardRunResult, type DashboardSummary, Delivery, type DigestPreview, type DocRenderRow, type DocSignatureCheck, type DocSignatureRow, type DocTemplateRow, type DocToken, type DocUnresolvedToken, type EnrichAlternate, type EnrichCell, type EnrichDeclared, type EnrichDueRow, type EnrichRun, type EnrichSource, type Enrichment, type EnrichmentSummary, type EntityFieldRights, type EntityFieldValue, type EntityRecordMatch, type EntityRecordRead, type EntityRecordsFound, type EntityTableFacts, type ExternalPrincipalCard, Field, type FieldHistoryEntry, type FormSummary, Freshness, type HistoryActor, type HistoryActorKind, type HistoryChange, type Home, type ImportBatchResult, type ImportColumnPlan, type ImportFinished, type ImportOpened, type ImportOutcome, type ImportPlan, type ImportPolicy, type ImportProposal, type ImportReport, type ImportRun, type InboundAddress, type InboundDeclared, type MergeField, MergeFieldModifier, type MergeFieldProvenance, type MergeFieldResolution, MergeFieldSemanticType, MergeFieldSource, type MergeFieldTransform, type MissingBehavior, type MyLevel, type MySubscription, type NewEntityFieldDeclaration, OnDelete, OverridePolicy, PERMISSION_LEVELS, PIPELINE_RULE_KINDS, ParityFieldType, type PermissionLevel, PgError, type Pipeline, type PipelineColumn, type PipelineDeclared, type PipelineGate, type PipelineGatePreview, type PipelineMissingField, type PipelineMoveResult, type PipelineRule, type PipelineRuleKind, type PipelineSpec, type PipelineStage, type PipelineVerdict, type PortalCard, type PortalInvitation, type PortalPreviewRow, type PortalPrincipal, type PortalRevocation, type PortalSummary, type PortalTableExposure, type PublishBinding, type QueuedCapture, type QueuedCaptureFile, type QueuedCaptureState, type QuietHours, REFUSALS_WORTH_REPEATING, type RecordComment, RecordDocument, type RecordHistoryEntry, type RecordScopeComment, type RecordScopeContext, type RecordScopeField, type RecordScopeHistoryEntry, type RecordScopeRelation, type RecordScopeWithheld, type RecordsActor, type RecordsConfig, type RecordsDataSource, type RecordsErrorSink, type RecordsFilter, type RecordsRealtimePort, type RecordsResolverPort, type RecordsResponse, type RecordsTableQuery, type RegisteredTable, type Relation, RelationBinding, RelationCardinality, type RelationCarries, type RelationCoordinate, RelationFlavor, type RelationProperties, type RelationTarget, type ResolutionTriple, type ResolvedPublishBinding, type RestorePreview, type RestoreResult, type Rule, type RuleAnswer, type RuleExpression, RuleNodeKind, RuleUse, STAGE_RULE_ENFORCEMENT, STAGE_RULE_ON_FAIL, type StagePending, type StagePendingOnBoard, type StageRuleEnforcement, type StageRuleOnFail, type StageRuleWarning, StorageMode, StoredRecord, type StuckRow, type Subscription, type SubscriptionBlock, type SubscriptionCadence, type SubscriptionSpec, type Table, type TableCapacity, TableDisplay, TableOrigin, TableType, Timestamp, Uuid, type WorkApprovalDecision, type WorkApprovalFiled, type WorkApprover, type WorkAssignment, type WorkAssignmentField, type WorkChange, type WorkDueState, type WorkGraph, type WorkInboxItem, type WorkInboxKind, type WorkInstantiation, type WorkListFlavour, type WorkListItem, type WorkOrigin, type WorkRecordState, type WorkSlotHold, type WorkState, type WorkTemplateNode, type WorkTemplateRelation, type WorkTurn, asPermissionLevel, atLeast, bookingPath, choiceSlug, choiceValuesOf, choicesOf, highestLevel, holdsARetiredChoice, indexedDbStore, isDecided, isTheChosen, looksLikeAnId, mayDrag, measureKey, memoryStore, mintClientKey, openCaptureQueue, optionKey, optionLabel, portalPath, publicFormPath, scopeChip };
package/dist/index.js CHANGED
@@ -126,6 +126,8 @@ function looksLikeAnId(value) {
126
126
 
127
127
  // src/pipeline.ts
128
128
  var PIPELINE_RULE_KINDS = ["moves", "requires", "who", "limit", "entry"];
129
+ var STAGE_RULE_ON_FAIL = ["refuse", "require_approval"];
130
+ var STAGE_RULE_ENFORCEMENT = ["refuse", "warn"];
129
131
  function mayDrag(level) {
130
132
  return level === "editor" || level === "admin" || level === "owner";
131
133
  }
@@ -482,6 +484,7 @@ var RULE_NODE_KINDS = [
482
484
  { node: "parent_field", evaluated_by: "W1-RULE-APPLY" },
483
485
  { node: "present", evaluated_by: "W1-RULE" },
484
486
  { node: "previous", evaluated_by: "PIPELINES" },
487
+ { node: "sibling_count", evaluated_by: "STAGE-RULES" },
485
488
  { node: "stage_count", evaluated_by: "PIPELINES" },
486
489
  { node: "sub", evaluated_by: "W1-RULE" }
487
490
  ];
@@ -809,7 +812,9 @@ var STORE_DOORS = [
809
812
  { name: "pin_agent_cells", args: "p_new jsonb, p_old jsonb, p_agent_keys text[]", returns: "jsonb", security: "invoker" },
810
813
  { name: "pipeline_board", args: "p_organization_id uuid, p_table_id uuid, p_measure text DEFAULT NULL::text", returns: "TABLE(stage_key text, stage_label text, stage_position integer, cards bigint, total numeric, wip_limit integer, over_limit boolean)", security: "definer" },
811
814
  { name: "pipeline_declare", args: "p_organization_id uuid, p_table_id uuid, p_spec jsonb", returns: "jsonb", security: "definer" },
815
+ { name: "pipeline_gate_preview", args: "p_organization_id uuid, p_table_id uuid, p_stage text, p_gate jsonb", returns: "jsonb", security: "definer" },
812
816
  { name: "pipeline_move", args: "p_organization_id uuid, p_record_id uuid, p_to text, p_also jsonb DEFAULT '{}'::jsonb, p_expected_version integer DEFAULT NULL::integer", returns: "jsonb", security: "definer" },
817
+ { name: "pipeline_pending", args: "p_organization_id uuid, p_table_id uuid", returns: "jsonb", security: "definer" },
813
818
  { name: "pipeline_read", args: "p_organization_id uuid, p_table_id uuid", returns: "jsonb", security: "definer" },
814
819
  { name: "pipeline_transition_refusal", args: "p_organization_id uuid, p_record_id uuid, p_to text", returns: "jsonb", security: "definer" },
815
820
  { name: "portal_admits", args: "p_organization_id uuid, p_user_id uuid DEFAULT NULL::uuid", returns: "boolean", security: "definer" },
@@ -876,6 +881,7 @@ var STORE_DOORS = [
876
881
  { name: "record_carrying_edges", args: "p_id uuid, p_data_class text, p_data jsonb, p_deleted_at timestamp with time zone", returns: "TABLE(container_id uuid, item_id uuid, edge_role text)", security: "invoker" },
877
882
  { name: "record_delete", args: "p_organization_id uuid, p_record_id uuid", returns: "timestamp with time zone", security: "definer" },
878
883
  { name: "record_history", args: "p_organization_id uuid, p_record_id uuid, p_limit integer DEFAULT 200, p_offset integer DEFAULT 0", returns: "TABLE(version integer, occurred_at timestamp with time zone, operation text, operation_label text, actor jsonb, changes jsonb, migration_id uuid, undoable boolean)", security: "definer" },
884
+ { name: "record_platform_keys", args: "", returns: "text[]", security: "invoker" },
879
885
  { name: "record_relation_edges", args: "p_organization_id uuid, p_id uuid, p_table_id uuid, p_data_class text, p_data jsonb, p_deleted_at timestamp with time zone", returns: "TABLE(target_id uuid, edge_role text, field_id uuid, ord integer)", security: "invoker" },
880
886
  { name: "record_reparent", args: "p_organization_id uuid, p_record_id uuid, p_parent_id uuid", returns: "void", security: "definer" },
881
887
  { name: "record_resolve", args: "p_organization_id uuid, p_id uuid", returns: "jsonb", security: "definer" },
@@ -884,6 +890,7 @@ var STORE_DOORS = [
884
890
  { name: "record_restore_version", args: "p_organization_id uuid, p_record_id uuid, p_version integer", returns: "jsonb", security: "definer" },
885
891
  { name: "record_restore_version", args: "p_organization_id uuid, p_record_id uuid, p_version integer, p_author jsonb", returns: "jsonb", security: "definer" },
886
892
  { name: "record_scope_context", args: "p_organization_id uuid, p_record_id uuid, p_relations integer DEFAULT 12, p_history integer DEFAULT 15, p_siblings integer DEFAULT 8", returns: "jsonb", security: "definer" },
893
+ { name: "record_stage_pending", args: "p_organization_id uuid, p_record_id uuid", returns: "jsonb", security: "definer" },
887
894
  { name: "record_state_as_of", args: "p_record_id uuid, p_at timestamp with time zone", returns: "TABLE(state jsonb, replayed boolean)", security: "definer" },
888
895
  { name: "record_table", args: "p_organization_id uuid, p_record_id uuid", returns: "uuid", security: "definer" },
889
896
  { name: "record_update", args: "p_organization_id uuid, p_record_id uuid, p_patch jsonb, p_expected_version integer DEFAULT NULL::integer", returns: "integer", security: "definer" },
@@ -947,6 +954,8 @@ var STORE_DOORS = [
947
954
  { name: "size_refusal", args: "p_organization_id uuid, p_data jsonb", returns: "text", security: "invoker" },
948
955
  { name: "source_next_pointer", args: "p_sources jsonb", returns: "text", security: "invoker" },
949
956
  { name: "source_pointer", args: "p_sources jsonb, p_source jsonb", returns: "text", security: "invoker" },
957
+ { name: "stage_rule_enforcement", args: "p_organization_id uuid", returns: "text", security: "invoker" },
958
+ { name: "stage_rule_on_fail_kinds", args: "", returns: "TABLE(behaviour text, note text)", security: "invoker" },
950
959
  { name: "stamp_value_envelopes", args: "p_data jsonb, p_actor text, p_on_behalf_of text, p_at timestamp with time zone", returns: "jsonb", security: "invoker" },
951
960
  { name: "storage_modes", args: "", returns: "text[]", security: "invoker" },
952
961
  { name: "store_is_open", args: "p_organization_id uuid DEFAULT NULL::uuid", returns: "boolean", security: "invoker" },
@@ -957,6 +966,7 @@ var STORE_DOORS = [
957
966
  { name: "subscriptions", args: "p_organization_id uuid, p_table_id uuid DEFAULT NULL::uuid", returns: "TABLE(rule_id uuid, name text, table_id uuid, saved_view_id uuid, cadence text, schedule text, quiet_hours jsonb, channel text, recipient_user_id uuid, event_key text, muted boolean, mine boolean, i_may_mute boolean, last_sent_at timestamp with time zone, next_digest_at timestamp with time zone)", security: "definer" },
958
967
  { name: "table_capacity", args: "p_organization_id uuid, p_table_id uuid", returns: "jsonb", security: "definer" },
959
968
  { name: "table_carries_its_rows", args: "p_user_id uuid, p_table_id uuid, p_required permission_level DEFAULT 'viewer'::permission_level", returns: "boolean", security: "definer" },
969
+ { name: "table_column_source", args: "p_organization_id uuid, p_table_id uuid", returns: "text", security: "invoker" },
960
970
  { name: "table_contents", args: "p_organization_id uuid, p_table_id uuid", returns: "TABLE(record_id uuid, kind text, goes_at integer)", security: "invoker" },
961
971
  { name: "table_declare", args: "p_organization_id uuid, p_spec jsonb", returns: "uuid", security: "definer" },
962
972
  { name: "table_has_a_visible_record", args: "p_user uuid, p_organization_id uuid, p_table_id uuid", returns: "boolean", security: "definer" },
@@ -971,6 +981,7 @@ var STORE_DOORS = [
971
981
  { name: "tables_at_home", args: "p_organization_id uuid, p_home_ids uuid[]", returns: "TABLE(table_id uuid, home_record_id uuid, kind text)", security: "definer" },
972
982
  { name: "tables_described_without_asking", args: "", returns: "TABLE(function_name text, identity_args text, why text)", security: "invoker" },
973
983
  { name: "trg_associations_bump_visibility", args: "", returns: "trigger", security: "definer" },
984
+ { name: "undeclared_keys", args: "p_organization_id uuid, p_table_id uuid, p_data jsonb", returns: "text[]", security: "invoker" },
974
985
  { name: "validate_custom_fields", args: "p_token text, p_organization_id uuid, p_values jsonb", returns: "void", security: "invoker" },
975
986
  { name: "validate_value_envelope", args: "p_organization_id uuid, p_fields custom.record[], p_data jsonb", returns: "void", security: "invoker" },
976
987
  { name: "validate_values", args: "p_organization_id uuid, p_fields custom.record[], p_values jsonb, p_record_type text DEFAULT NULL::text", returns: "void", security: "invoker" },
@@ -1071,6 +1082,7 @@ var STORE_KNOBS = [
1071
1082
  { key: "sandbox_message_bytes", value: "65536", type: "integer" },
1072
1083
  { key: "sandbox_org_components", value: "true", type: "boolean" },
1073
1084
  { key: "signup_provisioning_guard", value: "false", type: "boolean" },
1085
+ { key: "stage_rule_enforcement", value: '"refuse"', type: "enum" },
1074
1086
  { key: "system_enabled", value: "false", type: "boolean" },
1075
1087
  { key: "table_record_ceiling", value: "150000", type: "integer" },
1076
1088
  { key: "value_max_bytes", value: "100000", type: "integer" },
@@ -1080,19 +1092,20 @@ var STORE_REFUSAL_CODES = [
1080
1092
  { code: "02000", raised_by: "_checklist_instantiate,checklist_declare,checklist_run,checklist_step_complete,checklist_step_refusal,checklist_template_shape,conversation_scope_bind,dashboard_delete,dashboard_run,doc_letterhead,doc_render_body,doc_render_document,doc_render_read,doc_sign,doc_signature_intact,doc_signature_read,doc_template_delete,doc_template_read,doc_template_save,enrich_pin,entity_field_retire,entity_field_update,entity_record_read,entity_value_write,external_history_event,external_rows,external_stub_upsert,external_writes_set,io_restore,migrate_delete,migrate_extract_parent,migrate_merge,migrate_reclass,migrate_rename,migrate_reparent,migrate_retype,migrate_split,migrate_undo,organization_clear,portal_card,portal_declare,portal_invite,portal_preview,portal_principal_bind,portal_revoke,read_record,record_delete,record_restore,record_restore_preview,record_table,record_update,relation_uncarry,share_access,share_grant,share_lane_set,share_people,share_revoke,sign_request_cancel,sign_request_create,sign_request_remind,sign_request_unchanged,visibility_as_of,work_approval_decide,work_approval_read,work_approval_request,work_assign,work_record_states,work_set_state" },
1081
1093
  { code: "0A000", raised_by: "checklist_step_complete,external_rows,external_source_declare,external_write_through,promote_field,promoted_index_expr,promoted_query_sql,promoted_read,rule_eval,work_assign" },
1082
1094
  { code: "22003", raised_by: "context_resolve" },
1083
- { code: "22004", raised_by: "_entity_custom_fields_guard,_value_envelope,actor_word,agg_assert_key,agg_sql,anon_capture,anon_token_issue,anon_write,assert_client_may_reach,booking_declare,capture_submit,checklist_declare,context_resolve,dashboard_block_normalize,dashboard_declare,dashboard_window_sql,doc_render_write,doc_sign,doc_signature_write,doc_template_save,enrich_land,enrich_normalize,external_history_event,external_rows,external_source_declare,external_stub_upsert,external_write_through,external_writes_set,field_history,form_declare,form_submit,home_add,io_comment_write,io_import_begin,io_infer_column,io_outbox_drain,io_restore,migrate_choice_keys,migrate_purge,migrate_reclass,migrate_split,migrate_undo,organization_clear,organization_contents,pipeline_declare,portal_declare,portal_invite,portal_principal_bind,provenance_retention_days,provenance_write,query_across_homes,query_by_coordinates,query_rollup,record_delete,record_reparent,record_resolve,record_restore,record_update,record_write,record_write_many,relation_carry,relation_own,rule_declare,share_grant,sign_request_create,sign_request_sign,subscription_declare,table_declare,value_restore,view_declare,work_approval_decide,work_approval_request,work_template_declare" },
1095
+ { code: "22004", raised_by: "_entity_custom_fields_guard,_value_envelope,actor_word,agg_assert_key,agg_sql,anon_capture,anon_token_issue,anon_write,assert_client_may_reach,booking_declare,capture_submit,checklist_declare,context_resolve,dashboard_block_normalize,dashboard_declare,dashboard_window_sql,doc_render_write,doc_sign,doc_signature_write,doc_template_save,enrich_land,enrich_normalize,external_history_event,external_rows,external_source_declare,external_stub_upsert,external_write_through,external_writes_set,field_history,form_declare,form_submit,home_add,io_comment_write,io_import_begin,io_infer_column,io_outbox_drain,io_restore,migrate_choice_keys,migrate_purge,migrate_reclass,migrate_split,migrate_undo,organization_clear,organization_contents,pipeline_declare,pipeline_gate_preview,portal_declare,portal_invite,portal_principal_bind,provenance_retention_days,provenance_write,query_across_homes,query_by_coordinates,query_rollup,record_delete,record_reparent,record_resolve,record_restore,record_update,record_write,record_write_many,relation_carry,relation_own,rule_declare,share_grant,sign_request_create,sign_request_sign,subscription_declare,table_declare,value_restore,view_declare,work_approval_decide,work_approval_request,work_template_declare" },
1084
1096
  { code: "22007", raised_by: "dashboard_window_sql" },
1085
1097
  { code: "22012", raised_by: "rule_eval" },
1086
1098
  { code: "22023", raised_by: "_booking_availability,_entity_custom_fields_guard,_value_envelope,_work_shape_guard,actor_word,agg_assert_key,agg_sql,anon_token_issue,booking_declare,containment_parent,dashboard_block_normalize,dashboard_window_sql,doc_render_body,doc_render_write,doc_signature_write,enrich_declare,enrich_land,enrich_normalize,enrich_pin,entity_value_write,external_history_event,external_source_declare,external_stub_upsert,external_write_through,field_history,io_export,io_import_begin,io_import_finish,io_import_plan,io_import_report,io_proposal_accept,migrate_merge,migrate_reclass,my_levels,organization_clear,page_size,pin_agent_cells,pipeline_move,portal_declare,provenance_write,query_by_coordinates,query_rollup,record_update,record_write_many,relation_carry,rule_eval,rule_members,share_grant,share_lane_set,sign_request_create,sign_request_sign,subscription_declare,table_rules,visibility_as_of,work_approval_request,work_list,work_slot_hold" },
1087
1099
  { code: "23503", raised_by: "_booking_availability,_checklist_instantiate,_containment_guard,_field_document_for,_pipeline_stage_key,_record_rule_uses,agg_digest_assemble,anon_publish,anon_rate_take,anon_token_issue,anon_write,assert_organization_wall,booking_cancel,booking_confirm,booking_declare,booking_hold,booking_reschedule,capture_publish,checklist_declare,checklist_steps_table,comment_write,dashboard_declare,delete_rule,doc_sign,doc_template_save,enrich_declare,enrich_due,enrich_land,form_declare,form_submit,home_add,inbound_declare,inbound_mail_land,inbound_set,io_comment_write,io_import_begin,io_import_finish,io_import_report,io_import_rows,io_proposal_accept,migrate_demote,migrate_promote,pipeline_board,pipeline_declare,pipeline_move,pipeline_read,pipeline_transition_refusal,promote_field,promote_table,record_applicability,record_reparent,relation_carry,relation_own,resolve_first_match,rule_applies,rule_declare,rule_eval,rule_members,rule_run,sign_request_create,subscription_mute,subscription_preview,view_declare,work_set_state,work_take_assignment,work_template_instantiate" },
1088
1100
  { code: "23505", raised_by: "_unique_rule_holds,doc_sign,doc_signature_write,entity_field_declare,field_declare,home_add,inbound_declare,io_proposal_accept,relation_carry,relation_own,share_grant,sign_request_cancel,sign_request_create,work_approval_decide,work_slot_hold" },
1089
- { code: "23514", raised_by: "_checklist_instantiate,_checklist_step_guard,_containment_guard,_dated_values_guard,_derived_fields,_entity_custom_fields_guard,_field_class_guard,_field_document_for,_field_shape_guard,_field_type_parity_guard,_merge_field_shape_guard,_merge_field_temporal_guard,_promoted_field_cap_guard,_record_rule_uses,_resolve_choice_words,_rule_shape_guard,_rule_topology_guard,_store_relation_edge_names_its_field,_table_shape_guard,_value_envelope,_work_shape_guard,_workdoors_approval_guard,assert_entity_is_organization_scoped,capture_publish,capture_sheet_declare,checklist_declare,checklist_step_complete,doc_sign,doc_signature_write,doc_template_save,entity_field_declare,entity_field_retire,entity_field_update,entity_records_find,entity_table,field_declare,field_retire,field_update,home_add,io_import_rows,migrate_merge,relation_carry,relation_own,sign_request_create,sign_request_sign,table_declare,validate_value_envelope,validate_values,work_set_state,work_slots_declare,work_take_assignment,work_template_instantiate" },
1101
+ { code: "23514", raised_by: "_checklist_instantiate,_checklist_step_guard,_claimed_column_guard,_containment_guard,_dated_values_guard,_derived_fields,_entity_custom_fields_guard,_field_class_guard,_field_document_for,_field_shape_guard,_field_type_parity_guard,_merge_field_shape_guard,_merge_field_temporal_guard,_promoted_field_cap_guard,_record_rule_uses,_resolve_choice_words,_rule_shape_guard,_rule_topology_guard,_store_relation_edge_names_its_field,_table_columns_word_guard,_table_shape_guard,_undeclared_key_guard,_value_envelope,_work_shape_guard,_workdoors_approval_guard,assert_entity_is_organization_scoped,capture_publish,capture_sheet_declare,checklist_declare,checklist_step_complete,doc_sign,doc_signature_write,doc_template_save,entity_field_declare,entity_field_retire,entity_field_update,entity_records_find,entity_table,field_declare,field_retire,field_update,home_add,io_import_rows,migrate_merge,relation_carry,relation_own,sign_request_create,sign_request_sign,table_declare,validate_value_envelope,validate_values,work_set_state,work_slots_declare,work_take_assignment,work_template_instantiate" },
1090
1102
  { code: "40001", raised_by: "has_visibility_at" },
1091
1103
  { code: "42501", raised_by: "_doc_render_immutable,_doc_signature_immutable,_field_definition_write,_field_write_door,_rule_definition_write,_store_door,anon_capture,anon_inbound_land,anon_publish,anon_token_issue,anon_token_verify,anon_write,assert_client_may_change,assert_client_may_open,assert_client_may_reach,assert_may_know_table,assert_organization_admin,assert_store_door,booking_confirm,booking_declare,booking_hold,capture_submit,checklist_run,comment_write,conversation_scope_bind,conversation_scope_unbind,enrich_declare,enrich_due,enrich_land,enrich_normalize,entity_field_declare,entity_field_retire,entity_field_update,entity_value_write,external_write_through,form_declare,form_submit,inbound_mail_land,io_comment_resolve,io_comment_write,io_import_begin,io_import_finish,io_restore,migrate_purge,migrate_reclass,my_levels,organization_clear,portal_declare,portal_invitation,portal_invite,portal_principal_bind,promote_table,query_visibility_parity,read_record,read_records,record_table,share_grant,subscription_mute,subscription_preview,visibility_as_of,work_approval_decide,work_approval_read,work_approval_request,work_person" },
1092
1104
  { code: "42703", raised_by: "entity_table,portal_declare" },
1093
1105
  { code: "53400", raised_by: "anon_rate_take,delete_cascade_closure,enrich_due,enrich_land,promote_field" },
1094
1106
  { code: "54001", raised_by: "record_delete" },
1095
- { code: "PT409", raised_by: "record_update" }
1107
+ { code: "PT409", raised_by: "record_update" },
1108
+ { code: "PT428", raised_by: "_record_rule_uses" }
1096
1109
  ];
1097
1110
  var ENTITY_TOKENS = [
1098
1111
  "access_delta_probe",
@@ -1756,6 +1769,7 @@ var ENTITY_TOKENS = [
1756
1769
  "plan_node_artifact",
1757
1770
  "plan_node_step",
1758
1771
  "plan_profile",
1772
+ "platform_action_request",
1759
1773
  "platform_actor_session",
1760
1774
  "platform_actor_token",
1761
1775
  "platform_actor_token_event",
@@ -2149,6 +2163,8 @@ export {
2149
2163
  RETIRED_ACTOR_WORDS,
2150
2164
  RULE_NODE_KINDS,
2151
2165
  RULE_USES,
2166
+ STAGE_RULE_ENFORCEMENT,
2167
+ STAGE_RULE_ON_FAIL,
2152
2168
  STORAGE_MODES,
2153
2169
  STORE_DOORS,
2154
2170
  STORE_KNOBS,