@ai-matrx/records 0.99.24 → 0.99.25

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.
Files changed (46) hide show
  1. package/CHANGELOG.md +1 -1
  2. package/dist/{client-BgyGYbAY.d.ts → client-CFaUo85X.d.ts} +129 -1
  3. package/dist/{client-CL-dgaM6.d.cts → client-Dxs_M4if.d.cts} +129 -1
  4. package/dist/core/index.cjs +24 -0
  5. package/dist/core/index.cjs.map +1 -1
  6. package/dist/core/index.d.cts +4 -2
  7. package/dist/core/index.d.ts +4 -2
  8. package/dist/core/index.js +24 -0
  9. package/dist/core/index.js.map +1 -1
  10. package/dist/data/index.cjs +17 -0
  11. package/dist/data/index.cjs.map +1 -1
  12. package/dist/data/index.d.cts +1 -1
  13. package/dist/data/index.d.ts +1 -1
  14. package/dist/data/index.js +17 -0
  15. package/dist/data/index.js.map +1 -1
  16. package/dist/{declareTable-CWbYby6X.d.cts → declareTable-DGzmOJw0.d.cts} +1 -1
  17. package/dist/{declareTable-DO6Aeptz.d.ts → declareTable-j7whJWGf.d.ts} +1 -1
  18. package/dist/index.cjs +7 -0
  19. package/dist/index.cjs.map +1 -1
  20. package/dist/index.d.cts +2 -2
  21. package/dist/index.d.ts +2 -2
  22. package/dist/index.js +7 -0
  23. package/dist/index.js.map +1 -1
  24. package/dist/questions/index.d.cts +1 -1
  25. package/dist/questions/index.d.ts +1 -1
  26. package/dist/react/index.cjs +24 -0
  27. package/dist/react/index.cjs.map +1 -1
  28. package/dist/react/index.d.cts +129 -1
  29. package/dist/react/index.d.ts +129 -1
  30. package/dist/react/index.js +24 -0
  31. package/dist/react/index.js.map +1 -1
  32. package/dist/setup/index.cjs +17 -0
  33. package/dist/setup/index.cjs.map +1 -1
  34. package/dist/setup/index.d.cts +1 -1
  35. package/dist/setup/index.d.ts +1 -1
  36. package/dist/setup/index.js +17 -0
  37. package/dist/setup/index.js.map +1 -1
  38. package/dist/typed-table/index.cjs +17 -0
  39. package/dist/typed-table/index.cjs.map +1 -1
  40. package/dist/typed-table/index.d.cts +2 -2
  41. package/dist/typed-table/index.d.ts +2 -2
  42. package/dist/typed-table/index.js +17 -0
  43. package/dist/typed-table/index.js.map +1 -1
  44. package/dist/views/index.d.cts +1 -1
  45. package/dist/views/index.d.ts +1 -1
  46. package/package.json +4 -4
package/CHANGELOG.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Changelog — @ai-matrx/records
2
2
 
3
- ## 0.99.24
3
+ ## 0.99.25
4
4
 
5
5
  UNVERIFIED: this release has no Unreleased entry and the source comparison could not be made (the caller supplied no source comparison). Whether source changed is unknown; consumer action is unknown.
6
6
  Check the package's gitHead on npm against this version's gitHead: `git diff <previous gitHead> <this gitHead> -- apps/shared/records/src`.
@@ -2479,6 +2479,45 @@ type AutomationTrigger = {
2479
2479
  at?: string;
2480
2480
  weekday?: AutomationWeekday;
2481
2481
  day?: number;
2482
+ }
2483
+ /**
2484
+ * AT-AUTO2: every N minutes (5, 10, 15, 30) or every N hours (1, 2, 3, 4, 6, 8, 12) at `minute` past. Saved switched
2485
+ * OFF; the person switches it on (no blind paid automations).
2486
+ */
2487
+ | {
2488
+ on: "schedule";
2489
+ every: "minutes";
2490
+ minutes: 5 | 10 | 15 | 30;
2491
+ } | {
2492
+ on: "schedule";
2493
+ every: "hour";
2494
+ hours?: number;
2495
+ minute?: number;
2496
+ }
2497
+ /**
2498
+ * AT-AUTO2: an inbound webhook. The store makes the automation's `webhook_secret`; the URL is
2499
+ * `automationWebhookUrl(serverBase, automation)`. The JSON body is `{{trigger.body.…}}` to every step.
2500
+ */
2501
+ | {
2502
+ on: "webhook";
2503
+ };
2504
+ /**
2505
+ * AT-AUTO2: a token a step's text or value may carry, resolved when the run reaches that step:
2506
+ * `{{trigger.<field key or id>}}`, `{{trigger.record_id}}`, `{{trigger.body.<path>}}`, `{{stepN.<path>}}`
2507
+ * (a find's `records` / `first` / `count` / `ids`, a script's `output.<key>`, an added row's `record_id`),
2508
+ * `{{item.<path>}}` / `{{index}}` inside a repeating group. A value that IS one token keeps its type (a list stays a list).
2509
+ */
2510
+ type AutomationToken = `{{${string}}}`;
2511
+ /** AT-AUTO2: one comparison of a conditional group's path. `value` / `to` take tokens. */
2512
+ interface AutomationComparison {
2513
+ value: unknown;
2514
+ is: "equals" | "not_equals" | "contains" | "not_contains" | "gt" | "gte" | "lt" | "lte" | "empty" | "not_empty" | "is_true";
2515
+ to?: unknown;
2516
+ }
2517
+ type AutomationWhen = {
2518
+ all: AutomationComparison[];
2519
+ } | {
2520
+ any: AutomationComparison[];
2482
2521
  };
2483
2522
  type AutomationAction = {
2484
2523
  do: "set";
@@ -2536,6 +2575,54 @@ type AutomationAction = {
2536
2575
  } | {
2537
2576
  do: "agent";
2538
2577
  prompt: string;
2578
+ }
2579
+ /** AT-AUTO2: records of a table matching a filter (tokens allowed in `const`s); later steps read `{{stepN.records}}`. */
2580
+ | {
2581
+ do: "find";
2582
+ table_id: Uuid;
2583
+ where?: AutomationFilter;
2584
+ limit?: number;
2585
+ }
2586
+ /** AT-AUTO2: change the named records (one id, a list, `{{stepN.records}}`, `{{item.id}}`). */
2587
+ | {
2588
+ do: "update";
2589
+ table_id: Uuid;
2590
+ record: string | string[];
2591
+ values: AutomationValues;
2592
+ }
2593
+ /** AT-AUTO2: Airtable's "delete record" — we archive (restorable), never hard delete. */
2594
+ | {
2595
+ do: "archive";
2596
+ record: string | string[];
2597
+ table_id?: Uuid;
2598
+ }
2599
+ /**
2600
+ * AT-AUTO2: JavaScript run by the server in the owner's own sandbox (never in the API process): `input` is
2601
+ * `inputs` resolved, `output.set(key, value)` answers `{{stepN.output.key}}`, console lines land in the run.
2602
+ * Metered to points. On a time trigger it is saved switched off.
2603
+ */
2604
+ | {
2605
+ do: "script";
2606
+ code: string;
2607
+ inputs?: Record<string, unknown>;
2608
+ timeout_ms?: number;
2609
+ memory_mb?: number;
2610
+ }
2611
+ /** AT-AUTO2: if / else if / else — the first path whose `when` holds runs its steps; else `else`. */
2612
+ | {
2613
+ do: "if";
2614
+ branches: {
2615
+ label?: string;
2616
+ when: AutomationWhen;
2617
+ actions: AutomationAction[];
2618
+ }[];
2619
+ else?: AutomationAction[];
2620
+ }
2621
+ /** AT-AUTO2: repeat `actions` for each item of a list token (at most 200 items). */
2622
+ | {
2623
+ do: "for_each";
2624
+ list: string;
2625
+ actions: AutomationAction[];
2539
2626
  };
2540
2627
  interface AutomationSpec {
2541
2628
  name: string;
@@ -2571,6 +2658,13 @@ interface AutomationLastRun {
2571
2658
  }
2572
2659
  interface AutomationItem {
2573
2660
  id: Uuid;
2661
+ /** AT-AUTO2: a webhook automation's secret, part of its URL. */
2662
+ webhook_secret?: string | null;
2663
+ /** AT-AUTO2: the last payload its webhook received (its test run uses it). */
2664
+ webhook_sample?: {
2665
+ body: unknown;
2666
+ at: string;
2667
+ } | null;
2574
2668
  name: string;
2575
2669
  spec: AutomationSpec;
2576
2670
  enabled: boolean;
@@ -2597,6 +2691,13 @@ interface AutomationFlipped {
2597
2691
  interface AutomationStep {
2598
2692
  n: number;
2599
2693
  do: AutomationAction["do"];
2694
+ /** AT-AUTO2: the repeat round (0-based) a step inside a repeating group ran in. */
2695
+ index?: number;
2696
+ /** AT-AUTO2: a script's console lines. */
2697
+ logs?: string[];
2698
+ /** AT-AUTO2: a server step's answer, as text. */
2699
+ output_text?: string;
2700
+ found?: number;
2600
2701
  status: "done" | "failed" | "waiting";
2601
2702
  /** The store's own words. */
2602
2703
  says: string;
@@ -2613,6 +2714,8 @@ interface AutomationRun {
2613
2714
  trigger: {
2614
2715
  /** `test` for a test run (`of` is the automation's own trigger), `button_pressed` for a press. */
2615
2716
  on: AutomationTrigger["on"] | "test";
2717
+ /** AT-AUTO2: a webhook's payload. */
2718
+ body?: unknown;
2616
2719
  of?: AutomationTrigger["on"];
2617
2720
  /** A test run: whether the row met the condition (null = it could not be worked out). */
2618
2721
  condition_met?: boolean | null;
@@ -2647,6 +2750,22 @@ interface AutomationTested {
2647
2750
  steps: AutomationStep[];
2648
2751
  condition_met: boolean | null;
2649
2752
  }
2753
+ /** AT-AUTO2: `custom.automation_revisions` — every save of one automation, newest first. */
2754
+ interface AutomationRevision {
2755
+ revision_id: Uuid;
2756
+ at: string;
2757
+ by: Uuid | null;
2758
+ note: "created" | "edited";
2759
+ enabled: boolean;
2760
+ spec: AutomationSpec;
2761
+ }
2762
+ interface AutomationRevisions {
2763
+ automation_id: Uuid;
2764
+ table_id: Uuid;
2765
+ revisions: AutomationRevision[];
2766
+ }
2767
+ /** AT-AUTO2: the public URL of a webhook automation (null until the store made its secret). */
2768
+ declare function automationWebhookUrl(serverBase: string, item: Pick<AutomationItem, "id" | "webhook_secret">): string | null;
2650
2769
 
2651
2770
  /** The placement facts, as the Table document or `custom.table` carries them. */
2652
2771
  interface TablePlacement {
@@ -6583,6 +6702,15 @@ interface RecordsClient {
6583
6702
  automation_id: Uuid;
6584
6703
  record_id?: Uuid | null;
6585
6704
  }): Promise<RecordsResult<AutomationTested>>;
6705
+ /** AT-AUTO2. Every saved version of an automation, newest first. */
6706
+ automationRevisions(args: {
6707
+ automation_id: Uuid;
6708
+ }): Promise<RecordsResult<AutomationRevisions>>;
6709
+ /** AT-AUTO2. Restore one version: one more save through automation_declare (admin on the table). */
6710
+ automationRevisionRestore(args: {
6711
+ automation_id: Uuid;
6712
+ revision_id: Uuid;
6713
+ }): Promise<RecordsResult<AutomationDeclared>>;
6586
6714
  /** G4. Send every change to this Table's records to an https webhook. Admin. The secret is shown once. */
6587
6715
  tableWebhookDeclare(args: {
6588
6716
  table_id: Uuid;
@@ -6767,4 +6895,4 @@ declare function createRecordsClient(given: RecordsConfig): RecordsClient;
6767
6895
  */
6768
6896
  declare function asWriteConflict(error: RecordsError, recordId: Uuid): WriteConflict | null;
6769
6897
 
6770
- export { type ChecklistTemplateSummary as $, ARCHIVE_LANES as A, type AutomationTrigger as B, type AutomationValue as C, type AutomationValues as D, type AutomationWeekday as E, type FieldDrift as F, BUILT_KIND_WORD as G, CHOICE_NUDGES as H, type CaptureField as I, type CaptureFileRef as J, type CaptureOutcome as K, type CaptureQuestion as L, type CaptureSheetFace as M, type CaptureSheetSummary as N, type ChecklistDeclared as O, type ChecklistRequirement as P, type ChecklistRequirementKind as Q, type RecordsClient as R, type ChecklistRoleSpec as S, type TableArchiveProgress as T, type ChecklistRunStarted as U, type ChecklistRunStep as V, type ChecklistRunSummary as W, type ChecklistSpec as X, type ChecklistStepCompleted as Y, type ChecklistStepSpec as Z, type ChecklistTemplateShape as _, ARCHIVE_LANE_LABEL as a, type EntityFieldRights as a$, type ChecklistTrigger as a0, type ChecklistTriggerKind as a1, type ChoiceCellBack as a2, type ChoiceLike as a3, type ChoiceNudge as a4, type ChoiceOption as a5, type ChoiceRehome as a6, type ChoiceUsage as a7, type ChoicesRehomed as a8, type CommentThreadRead as a9, type DrillDeclaration as aA, type DrillDefinition as aB, type DrillDimension as aC, type DrillFinding as aD, type DrillGrain as aE, type DrillHaving as aF, type DrillLane as aG, type DrillLevel as aH, type DrillMeasure as aI, type DrillMeasureOp as aJ, type DrillMeasureWhereValue as aK, type DrillPath as aL, type DrillQuestion as aM, type DrillRecords as aN, type DrillRowsPage as aO, type DrillSource as aP, type DrillView as aQ, type EnrichAlternate as aR, type EnrichCell as aS, type EnrichDeclared as aT, type EnrichDueRow as aU, type EnrichRun as aV, type EnrichSource as aW, type Enrichment as aX, type EnrichmentSummary as aY, type EntityBackLinkItem as aZ, type EntityBackLinks as a_, type CommentWritten as aa, type ConversationScope as ab, type ConversationScopeContext as ac, type CustomFieldTableType as ad, DEFAULT_ARCHIVE_LANE as ae, DEFAULT_PAGE_SIZE as af, DRILL_CHART_TOKENS as ag, DRILL_DESCRIPTION_MAX as ah, DRILL_DOORS as ai, DRILL_SCHEMA as aj, type DataHomeTable as ak, type DecorationColor as al, type DecorationPath as am, type DecorationRule as an, type DecorationRuleOp as ao, type DecorationTarget as ap, type DocRenderRow as aq, type DocSignatureCheck as ar, type DocSignatureRow as as, type DocTemplateRow as at, type DocToken as au, type DocUnresolvedToken as av, type DrillAdHocOp as aw, type DrillAnswer as ax, type DrillAnswerRow as ay, type DrillChartToken as az, ARCHIVE_LANE_MEANS as b, type PublishBinding as b$, type EntityFieldValue as b0, type EntityFieldsAcross as b1, type EntityRecordMatch as b2, type EntityRecordRead as b3, type EntityRecordsFound as b4, type EntityRowWritten as b5, type EntityTableFacts as b6, type ExternalPrincipalCard as b7, type FieldDriftAspect as b8, type FieldHistoryEntry as b9, type IoExportPage as bA, type MigrationEntry as bB, type MigrationUndone as bC, type NewEntityFieldDeclaration as bD, type OutsideShareAnswer as bE, PIPELINE_RULE_KINDS as bF, type ParentExtracted as bG, type PickListDocument as bH, type PickListItem as bI, type PickListItemInput as bJ, type Pipeline as bK, type PipelineColumn as bL, type PipelineDeclared as bM, type PipelineGate as bN, type PipelineGatePreview as bO, type PipelineMissingField as bP, type PipelineMoveMany as bQ, type PipelineMoveManyItem as bR, type PipelineMoveManyResult as bS, type PipelineMoveResult as bT, type PipelineMoveVerdict as bU, type PipelineRule as bV, type PipelineRuleKind as bW, type PipelineSpec as bX, type PipelineStage as bY, type PipelineVerdict as bZ, type PromotedPredicate as b_, type FieldRetyped as ba, type FormArchiveAnswer as bb, type FormulaParse as bc, type FormulaPreview as bd, type GridLayout as be, type GridLayoutMode as bf, type GridRowHeight as bg, type HistoryActor as bh, type HistoryActorKind as bi, type HistoryChange as bj, type Home as bk, type ImportBatchResult as bl, type ImportColumnPlan as bm, type ImportColumnsDeclared as bn, type ImportFinished as bo, type ImportOpened as bp, type ImportOutcome as bq, type ImportPlan as br, type ImportPolicy as bs, type ImportProposal as bt, type ImportReport as bu, type ImportRun as bv, type InboundAddress as bw, type InboundDeclared as bx, type InboxCounts as by, type InboxStateChange as bz, A_PERSONS_REFUSAL as c, type TableRowDefaults as c$, type PublishBindingKind as c0, type QueryPlan as c1, ROW_LABEL_FORMULA_MAX_LENGTH as c2, ROW_WEB_NOT_READY as c3, type RecordChangeAction as c4, type RecordComment as c5, type RecordEvent as c6, type RecordHeader as c7, type RecordHistoryEntry as c8, type RecordQuery as c9, type StagePendingOnBoard as cA, type StageRuleEnforcement as cB, type StageRuleOnFail as cC, type StageRuleWarning as cD, type SyncAutoRefresh as cE, type Table as cF, type TableCapacity as cG, type TableCopyInProgress as cH, type TableCopySpec as cI, type TableDecorations as cJ, type TableDuplicateProgress as cK, type TableDuplicated as cL, type TableFact as cM, type TableHome as cN, type TableHomeDestination as cO, type TableLevel as cP, type TableLevelApproval as cQ, type TableLevelFacts as cR, type TableLevelSet as cS, type TableListEntry as cT, type TableLiveLocation as cU, type TableMoved as cV, type TablePlacement as cW, type TablePlacementFact as cX, type TableReaderRule as cY, type TableRestoreProgress as cZ, type TableRowCount as c_, type RecordRowControls as ca, type RecordScopeComment as cb, type RecordScopeContext as cc, type RecordScopeField as cd, type RecordScopeHistoryEntry as ce, type RecordScopeRelation as cf, type RecordScopeWithheld as cg, type RecordSplit as ch, type RecordsMerged as ci, type RegisteredTable as cj, type ResolvedPublishBinding as ck, type ResolvedPublishBindingKind as cl, type RestorePreview as cm, type RestoreResult as cn, type RetypeBehaviour as co, type RetypePreview as cp, type RowAction as cq, type RowActionStep as cr, type RowDefaultsApplied as cs, SHOWN_TO_LABEL as ct, SHOWN_TO_VALUES as cu, SHOWN_TO_WHO_MAY_CHANGE as cv, STAGE_RULE_ENFORCEMENT as cw, STAGE_RULE_ON_FAIL as cx, type ShownTo as cy, type StagePending as cz, type ActionRefusal as d, keptGroups as d$, type TableRowDefaultsPatch as d0, type TableRowLabel as d1, type TableSyncAnswer as d2, type TableSyncResult as d3, type TableSyncSettings as d4, type TableSyncSource as d5, type TableSyncSourceDocument as d6, type TableSyncSpec as d7, type TableWebhook as d8, type TableWebhookDeclared as d9, type WorkState as dA, type WorkTemplateNode as dB, type WorkTemplateRelation as dC, type WorkTurn as dD, actionRefusals as dE, archivedByLine as dF, archivedWhen as dG, asChoiceNudge as dH, asWriteConflict as dI, choiceSlug as dJ, choiceValuesOf as dK, choicesOf as dL, clearsRowLabel as dM, createRecordsClient as dN, decideTypedChoice as dO, declareDrillDefinition as dP, drillAnswerOf as dQ, drillFindingKnob as dR, emptyArchiveLine as dS, exportPageXlsx as dT, holdsARetiredChoice as dU, intersectIds as dV, isAPersonsRefusal as dW, isArchiveLane as dX, isFoundation as dY, isShownTo as dZ, isTheChosen as d_, type TypedChoiceDecision as da, type ViewLayout as db, type ViewOrderSet as dc, type WorkApprovalDecision as dd, type WorkApprovalFiled as de, type WorkApprovalState as df, type WorkApprover as dg, type WorkAssignment as dh, type WorkAssignmentField as di, type WorkChange as dj, type WorkDecideMany as dk, type WorkDecideManyItem as dl, type WorkDecideManyResult as dm, type WorkDecideVerdict as dn, type WorkDueState as dp, type WorkGraph as dq, type WorkInboxItem as dr, type WorkInboxKind as ds, type WorkInboxView as dt, type WorkInstantiation as du, type WorkListFlavour as dv, type WorkListItem as dw, type WorkOrigin as dx, type WorkRecordState as dy, type WorkSlotHold as dz, type ActionRunResult as e, keptOutOfSight as e0, keptTableHref as e1, levelHasShownTo as e2, looksLikeAnId as e3, mayDrag as e4, moveConsequence as e5, moveInOrder as e6, offeredAsContext as e7, optionKey as e8, optionLabel as e9, parseFieldDrift as ea, parseTableCopiesInProgress as eb, parseTableDuplicateProgress as ec, parseTableDuplicated as ed, parseTableHome as ee, parseTableMoved as ef, planQuery as eg, previewRetype as eh, previewRuleChange as ei, recordChangeTrigger as ej, recordSourceKey as ek, recordSourceTable as el, recordsUseSentence as em, rehomeSentence as en, removedChoicesInUse as eo, ruleThatRefuses as ep, rulesWithTopStar as eq, sameDocument as er, scopeChip as es, sheetSyncSpec as et, valueConverts as eu, withRowCounts as ev, withTableFacts as ew, withTablePlacement as ex, type AdminTable as f, type AnonTokenBinding as g, type ArchiveLane as h, type ArchivedChecklistTemplate as i, type ArchivedDoorRow as j, type ArchivedForm as k, type ArchivedRow as l, type AsOf as m, type AutomationAction as n, type AutomationDeclared as o, type AutomationFilter as p, type AutomationFlipped as q, type AutomationItem as r, type AutomationLastRun as s, type AutomationList as t, type AutomationRun as u, type AutomationRunStatus as v, type AutomationRuns as w, type AutomationSpec as x, type AutomationStep as y, type AutomationTested as z };
6898
+ export { type ChecklistRunSummary as $, ARCHIVE_LANES as A, type AutomationSpec as B, type AutomationStep as C, type AutomationTested as D, type AutomationToken as E, type FieldDrift as F, type AutomationTrigger as G, type AutomationValue as H, type AutomationValues as I, type AutomationWeekday as J, type AutomationWhen as K, BUILT_KIND_WORD as L, CHOICE_NUDGES as M, type CaptureField as N, type CaptureFileRef as O, type CaptureOutcome as P, type CaptureQuestion as Q, type RecordsClient as R, type CaptureSheetFace as S, type TableArchiveProgress as T, type CaptureSheetSummary as U, type ChecklistDeclared as V, type ChecklistRequirement as W, type ChecklistRequirementKind as X, type ChecklistRoleSpec as Y, type ChecklistRunStarted as Z, type ChecklistRunStep as _, ARCHIVE_LANE_LABEL as a, type EnrichSource as a$, type ChecklistSpec as a0, type ChecklistStepCompleted as a1, type ChecklistStepSpec as a2, type ChecklistTemplateShape as a3, type ChecklistTemplateSummary as a4, type ChecklistTrigger as a5, type ChecklistTriggerKind as a6, type ChoiceCellBack as a7, type ChoiceLike as a8, type ChoiceNudge as a9, type DocUnresolvedToken as aA, type DrillAdHocOp as aB, type DrillAnswer as aC, type DrillAnswerRow as aD, type DrillChartToken as aE, type DrillDeclaration as aF, type DrillDefinition as aG, type DrillDimension as aH, type DrillFinding as aI, type DrillGrain as aJ, type DrillHaving as aK, type DrillLane as aL, type DrillLevel as aM, type DrillMeasure as aN, type DrillMeasureOp as aO, type DrillMeasureWhereValue as aP, type DrillPath as aQ, type DrillQuestion as aR, type DrillRecords as aS, type DrillRowsPage as aT, type DrillSource as aU, type DrillView as aV, type EnrichAlternate as aW, type EnrichCell as aX, type EnrichDeclared as aY, type EnrichDueRow as aZ, type EnrichRun as a_, type ChoiceOption as aa, type ChoiceRehome as ab, type ChoiceUsage as ac, type ChoicesRehomed as ad, type CommentThreadRead as ae, type CommentWritten as af, type ConversationScope as ag, type ConversationScopeContext as ah, type CustomFieldTableType as ai, DEFAULT_ARCHIVE_LANE as aj, DEFAULT_PAGE_SIZE as ak, DRILL_CHART_TOKENS as al, DRILL_DESCRIPTION_MAX as am, DRILL_DOORS as an, DRILL_SCHEMA as ao, type DataHomeTable as ap, type DecorationColor as aq, type DecorationPath as ar, type DecorationRule as as, type DecorationRuleOp as at, type DecorationTarget as au, type DocRenderRow as av, type DocSignatureCheck as aw, type DocSignatureRow as ax, type DocTemplateRow as ay, type DocToken as az, ARCHIVE_LANE_MEANS as b, type PipelineRuleKind as b$, type Enrichment as b0, type EnrichmentSummary as b1, type EntityBackLinkItem as b2, type EntityBackLinks as b3, type EntityFieldRights as b4, type EntityFieldValue as b5, type EntityFieldsAcross as b6, type EntityRecordMatch as b7, type EntityRecordRead as b8, type EntityRecordsFound as b9, type ImportRun as bA, type InboundAddress as bB, type InboundDeclared as bC, type InboxCounts as bD, type InboxStateChange as bE, type IoExportPage as bF, type MigrationEntry as bG, type MigrationUndone as bH, type NewEntityFieldDeclaration as bI, type OutsideShareAnswer as bJ, PIPELINE_RULE_KINDS as bK, type ParentExtracted as bL, type PickListDocument as bM, type PickListItem as bN, type PickListItemInput as bO, type Pipeline as bP, type PipelineColumn as bQ, type PipelineDeclared as bR, type PipelineGate as bS, type PipelineGatePreview as bT, type PipelineMissingField as bU, type PipelineMoveMany as bV, type PipelineMoveManyItem as bW, type PipelineMoveManyResult as bX, type PipelineMoveResult as bY, type PipelineMoveVerdict as bZ, type PipelineRule as b_, type EntityRowWritten as ba, type EntityTableFacts as bb, type ExternalPrincipalCard as bc, type FieldDriftAspect as bd, type FieldHistoryEntry as be, type FieldRetyped as bf, type FormArchiveAnswer as bg, type FormulaParse as bh, type FormulaPreview as bi, type GridLayout as bj, type GridLayoutMode as bk, type GridRowHeight as bl, type HistoryActor as bm, type HistoryActorKind as bn, type HistoryChange as bo, type Home as bp, type ImportBatchResult as bq, type ImportColumnPlan as br, type ImportColumnsDeclared as bs, type ImportFinished as bt, type ImportOpened as bu, type ImportOutcome as bv, type ImportPlan as bw, type ImportPolicy as bx, type ImportProposal as by, type ImportReport as bz, A_PERSONS_REFUSAL as c, type TablePlacement as c$, type PipelineSpec as c0, type PipelineStage as c1, type PipelineVerdict as c2, type PromotedPredicate as c3, type PublishBinding as c4, type PublishBindingKind as c5, type QueryPlan as c6, ROW_LABEL_FORMULA_MAX_LENGTH as c7, ROW_WEB_NOT_READY as c8, type RecordChangeAction as c9, SHOWN_TO_WHO_MAY_CHANGE as cA, STAGE_RULE_ENFORCEMENT as cB, STAGE_RULE_ON_FAIL as cC, type ShownTo as cD, type StagePending as cE, type StagePendingOnBoard as cF, type StageRuleEnforcement as cG, type StageRuleOnFail as cH, type StageRuleWarning as cI, type SyncAutoRefresh as cJ, type Table as cK, type TableCapacity as cL, type TableCopyInProgress as cM, type TableCopySpec as cN, type TableDecorations as cO, type TableDuplicateProgress as cP, type TableDuplicated as cQ, type TableFact as cR, type TableHome as cS, type TableHomeDestination as cT, type TableLevel as cU, type TableLevelApproval as cV, type TableLevelFacts as cW, type TableLevelSet as cX, type TableListEntry as cY, type TableLiveLocation as cZ, type TableMoved as c_, type RecordComment as ca, type RecordEvent as cb, type RecordHeader as cc, type RecordHistoryEntry as cd, type RecordQuery as ce, type RecordRowControls as cf, type RecordScopeComment as cg, type RecordScopeContext as ch, type RecordScopeField as ci, type RecordScopeHistoryEntry as cj, type RecordScopeRelation as ck, type RecordScopeWithheld as cl, type RecordSplit as cm, type RecordsMerged as cn, type RegisteredTable as co, type ResolvedPublishBinding as cp, type ResolvedPublishBindingKind as cq, type RestorePreview as cr, type RestoreResult as cs, type RetypeBehaviour as ct, type RetypePreview as cu, type RowAction as cv, type RowActionStep as cw, type RowDefaultsApplied as cx, SHOWN_TO_LABEL as cy, SHOWN_TO_VALUES as cz, type ActionRefusal as d, intersectIds as d$, type TablePlacementFact as d0, type TableReaderRule as d1, type TableRestoreProgress as d2, type TableRowCount as d3, type TableRowDefaults as d4, type TableRowDefaultsPatch as d5, type TableRowLabel as d6, type TableSyncAnswer as d7, type TableSyncResult as d8, type TableSyncSettings as d9, type WorkListFlavour as dA, type WorkListItem as dB, type WorkOrigin as dC, type WorkRecordState as dD, type WorkSlotHold as dE, type WorkState as dF, type WorkTemplateNode as dG, type WorkTemplateRelation as dH, type WorkTurn as dI, actionRefusals as dJ, archivedByLine as dK, archivedWhen as dL, asChoiceNudge as dM, asWriteConflict as dN, automationWebhookUrl as dO, choiceSlug as dP, choiceValuesOf as dQ, choicesOf as dR, clearsRowLabel as dS, createRecordsClient as dT, decideTypedChoice as dU, declareDrillDefinition as dV, drillAnswerOf as dW, drillFindingKnob as dX, emptyArchiveLine as dY, exportPageXlsx as dZ, holdsARetiredChoice as d_, type TableSyncSource as da, type TableSyncSourceDocument as db, type TableSyncSpec as dc, type TableWebhook as dd, type TableWebhookDeclared as de, type TypedChoiceDecision as df, type ViewLayout as dg, type ViewOrderSet as dh, type WorkApprovalDecision as di, type WorkApprovalFiled as dj, type WorkApprovalState as dk, type WorkApprover as dl, type WorkAssignment as dm, type WorkAssignmentField as dn, type WorkChange as dp, type WorkDecideMany as dq, type WorkDecideManyItem as dr, type WorkDecideManyResult as ds, type WorkDecideVerdict as dt, type WorkDueState as du, type WorkGraph as dv, type WorkInboxItem as dw, type WorkInboxKind as dx, type WorkInboxView as dy, type WorkInstantiation as dz, type ActionRunResult as e, isAPersonsRefusal as e0, isArchiveLane as e1, isFoundation as e2, isShownTo as e3, isTheChosen as e4, keptGroups as e5, keptOutOfSight as e6, keptTableHref as e7, levelHasShownTo as e8, looksLikeAnId as e9, valueConverts as eA, withRowCounts as eB, withTableFacts as eC, withTablePlacement as eD, mayDrag as ea, moveConsequence as eb, moveInOrder as ec, offeredAsContext as ed, optionKey as ee, optionLabel as ef, parseFieldDrift as eg, parseTableCopiesInProgress as eh, parseTableDuplicateProgress as ei, parseTableDuplicated as ej, parseTableHome as ek, parseTableMoved as el, planQuery as em, previewRetype as en, previewRuleChange as eo, recordChangeTrigger as ep, recordSourceKey as eq, recordSourceTable as er, recordsUseSentence as es, rehomeSentence as et, removedChoicesInUse as eu, ruleThatRefuses as ev, rulesWithTopStar as ew, sameDocument as ex, scopeChip as ey, sheetSyncSpec as ez, type AdminTable as f, type AnonTokenBinding as g, type ArchiveLane as h, type ArchivedChecklistTemplate as i, type ArchivedDoorRow as j, type ArchivedForm as k, type ArchivedRow as l, type AsOf as m, type AutomationAction as n, type AutomationComparison as o, type AutomationDeclared as p, type AutomationFilter as q, type AutomationFlipped as r, type AutomationItem as s, type AutomationLastRun as t, type AutomationList as u, type AutomationRevision as v, type AutomationRevisions as w, type AutomationRun as x, type AutomationRunStatus as y, type AutomationRuns as z };
@@ -2479,6 +2479,45 @@ type AutomationTrigger = {
2479
2479
  at?: string;
2480
2480
  weekday?: AutomationWeekday;
2481
2481
  day?: number;
2482
+ }
2483
+ /**
2484
+ * AT-AUTO2: every N minutes (5, 10, 15, 30) or every N hours (1, 2, 3, 4, 6, 8, 12) at `minute` past. Saved switched
2485
+ * OFF; the person switches it on (no blind paid automations).
2486
+ */
2487
+ | {
2488
+ on: "schedule";
2489
+ every: "minutes";
2490
+ minutes: 5 | 10 | 15 | 30;
2491
+ } | {
2492
+ on: "schedule";
2493
+ every: "hour";
2494
+ hours?: number;
2495
+ minute?: number;
2496
+ }
2497
+ /**
2498
+ * AT-AUTO2: an inbound webhook. The store makes the automation's `webhook_secret`; the URL is
2499
+ * `automationWebhookUrl(serverBase, automation)`. The JSON body is `{{trigger.body.…}}` to every step.
2500
+ */
2501
+ | {
2502
+ on: "webhook";
2503
+ };
2504
+ /**
2505
+ * AT-AUTO2: a token a step's text or value may carry, resolved when the run reaches that step:
2506
+ * `{{trigger.<field key or id>}}`, `{{trigger.record_id}}`, `{{trigger.body.<path>}}`, `{{stepN.<path>}}`
2507
+ * (a find's `records` / `first` / `count` / `ids`, a script's `output.<key>`, an added row's `record_id`),
2508
+ * `{{item.<path>}}` / `{{index}}` inside a repeating group. A value that IS one token keeps its type (a list stays a list).
2509
+ */
2510
+ type AutomationToken = `{{${string}}}`;
2511
+ /** AT-AUTO2: one comparison of a conditional group's path. `value` / `to` take tokens. */
2512
+ interface AutomationComparison {
2513
+ value: unknown;
2514
+ is: "equals" | "not_equals" | "contains" | "not_contains" | "gt" | "gte" | "lt" | "lte" | "empty" | "not_empty" | "is_true";
2515
+ to?: unknown;
2516
+ }
2517
+ type AutomationWhen = {
2518
+ all: AutomationComparison[];
2519
+ } | {
2520
+ any: AutomationComparison[];
2482
2521
  };
2483
2522
  type AutomationAction = {
2484
2523
  do: "set";
@@ -2536,6 +2575,54 @@ type AutomationAction = {
2536
2575
  } | {
2537
2576
  do: "agent";
2538
2577
  prompt: string;
2578
+ }
2579
+ /** AT-AUTO2: records of a table matching a filter (tokens allowed in `const`s); later steps read `{{stepN.records}}`. */
2580
+ | {
2581
+ do: "find";
2582
+ table_id: Uuid;
2583
+ where?: AutomationFilter;
2584
+ limit?: number;
2585
+ }
2586
+ /** AT-AUTO2: change the named records (one id, a list, `{{stepN.records}}`, `{{item.id}}`). */
2587
+ | {
2588
+ do: "update";
2589
+ table_id: Uuid;
2590
+ record: string | string[];
2591
+ values: AutomationValues;
2592
+ }
2593
+ /** AT-AUTO2: Airtable's "delete record" — we archive (restorable), never hard delete. */
2594
+ | {
2595
+ do: "archive";
2596
+ record: string | string[];
2597
+ table_id?: Uuid;
2598
+ }
2599
+ /**
2600
+ * AT-AUTO2: JavaScript run by the server in the owner's own sandbox (never in the API process): `input` is
2601
+ * `inputs` resolved, `output.set(key, value)` answers `{{stepN.output.key}}`, console lines land in the run.
2602
+ * Metered to points. On a time trigger it is saved switched off.
2603
+ */
2604
+ | {
2605
+ do: "script";
2606
+ code: string;
2607
+ inputs?: Record<string, unknown>;
2608
+ timeout_ms?: number;
2609
+ memory_mb?: number;
2610
+ }
2611
+ /** AT-AUTO2: if / else if / else — the first path whose `when` holds runs its steps; else `else`. */
2612
+ | {
2613
+ do: "if";
2614
+ branches: {
2615
+ label?: string;
2616
+ when: AutomationWhen;
2617
+ actions: AutomationAction[];
2618
+ }[];
2619
+ else?: AutomationAction[];
2620
+ }
2621
+ /** AT-AUTO2: repeat `actions` for each item of a list token (at most 200 items). */
2622
+ | {
2623
+ do: "for_each";
2624
+ list: string;
2625
+ actions: AutomationAction[];
2539
2626
  };
2540
2627
  interface AutomationSpec {
2541
2628
  name: string;
@@ -2571,6 +2658,13 @@ interface AutomationLastRun {
2571
2658
  }
2572
2659
  interface AutomationItem {
2573
2660
  id: Uuid;
2661
+ /** AT-AUTO2: a webhook automation's secret, part of its URL. */
2662
+ webhook_secret?: string | null;
2663
+ /** AT-AUTO2: the last payload its webhook received (its test run uses it). */
2664
+ webhook_sample?: {
2665
+ body: unknown;
2666
+ at: string;
2667
+ } | null;
2574
2668
  name: string;
2575
2669
  spec: AutomationSpec;
2576
2670
  enabled: boolean;
@@ -2597,6 +2691,13 @@ interface AutomationFlipped {
2597
2691
  interface AutomationStep {
2598
2692
  n: number;
2599
2693
  do: AutomationAction["do"];
2694
+ /** AT-AUTO2: the repeat round (0-based) a step inside a repeating group ran in. */
2695
+ index?: number;
2696
+ /** AT-AUTO2: a script's console lines. */
2697
+ logs?: string[];
2698
+ /** AT-AUTO2: a server step's answer, as text. */
2699
+ output_text?: string;
2700
+ found?: number;
2600
2701
  status: "done" | "failed" | "waiting";
2601
2702
  /** The store's own words. */
2602
2703
  says: string;
@@ -2613,6 +2714,8 @@ interface AutomationRun {
2613
2714
  trigger: {
2614
2715
  /** `test` for a test run (`of` is the automation's own trigger), `button_pressed` for a press. */
2615
2716
  on: AutomationTrigger["on"] | "test";
2717
+ /** AT-AUTO2: a webhook's payload. */
2718
+ body?: unknown;
2616
2719
  of?: AutomationTrigger["on"];
2617
2720
  /** A test run: whether the row met the condition (null = it could not be worked out). */
2618
2721
  condition_met?: boolean | null;
@@ -2647,6 +2750,22 @@ interface AutomationTested {
2647
2750
  steps: AutomationStep[];
2648
2751
  condition_met: boolean | null;
2649
2752
  }
2753
+ /** AT-AUTO2: `custom.automation_revisions` — every save of one automation, newest first. */
2754
+ interface AutomationRevision {
2755
+ revision_id: Uuid;
2756
+ at: string;
2757
+ by: Uuid | null;
2758
+ note: "created" | "edited";
2759
+ enabled: boolean;
2760
+ spec: AutomationSpec;
2761
+ }
2762
+ interface AutomationRevisions {
2763
+ automation_id: Uuid;
2764
+ table_id: Uuid;
2765
+ revisions: AutomationRevision[];
2766
+ }
2767
+ /** AT-AUTO2: the public URL of a webhook automation (null until the store made its secret). */
2768
+ declare function automationWebhookUrl(serverBase: string, item: Pick<AutomationItem, "id" | "webhook_secret">): string | null;
2650
2769
 
2651
2770
  /** The placement facts, as the Table document or `custom.table` carries them. */
2652
2771
  interface TablePlacement {
@@ -6583,6 +6702,15 @@ interface RecordsClient {
6583
6702
  automation_id: Uuid;
6584
6703
  record_id?: Uuid | null;
6585
6704
  }): Promise<RecordsResult<AutomationTested>>;
6705
+ /** AT-AUTO2. Every saved version of an automation, newest first. */
6706
+ automationRevisions(args: {
6707
+ automation_id: Uuid;
6708
+ }): Promise<RecordsResult<AutomationRevisions>>;
6709
+ /** AT-AUTO2. Restore one version: one more save through automation_declare (admin on the table). */
6710
+ automationRevisionRestore(args: {
6711
+ automation_id: Uuid;
6712
+ revision_id: Uuid;
6713
+ }): Promise<RecordsResult<AutomationDeclared>>;
6586
6714
  /** G4. Send every change to this Table's records to an https webhook. Admin. The secret is shown once. */
6587
6715
  tableWebhookDeclare(args: {
6588
6716
  table_id: Uuid;
@@ -6767,4 +6895,4 @@ declare function createRecordsClient(given: RecordsConfig): RecordsClient;
6767
6895
  */
6768
6896
  declare function asWriteConflict(error: RecordsError, recordId: Uuid): WriteConflict | null;
6769
6897
 
6770
- export { type ChecklistTemplateSummary as $, ARCHIVE_LANES as A, type AutomationTrigger as B, type AutomationValue as C, type AutomationValues as D, type AutomationWeekday as E, type FieldDrift as F, BUILT_KIND_WORD as G, CHOICE_NUDGES as H, type CaptureField as I, type CaptureFileRef as J, type CaptureOutcome as K, type CaptureQuestion as L, type CaptureSheetFace as M, type CaptureSheetSummary as N, type ChecklistDeclared as O, type ChecklistRequirement as P, type ChecklistRequirementKind as Q, type RecordsClient as R, type ChecklistRoleSpec as S, type TableArchiveProgress as T, type ChecklistRunStarted as U, type ChecklistRunStep as V, type ChecklistRunSummary as W, type ChecklistSpec as X, type ChecklistStepCompleted as Y, type ChecklistStepSpec as Z, type ChecklistTemplateShape as _, ARCHIVE_LANE_LABEL as a, type EntityFieldRights as a$, type ChecklistTrigger as a0, type ChecklistTriggerKind as a1, type ChoiceCellBack as a2, type ChoiceLike as a3, type ChoiceNudge as a4, type ChoiceOption as a5, type ChoiceRehome as a6, type ChoiceUsage as a7, type ChoicesRehomed as a8, type CommentThreadRead as a9, type DrillDeclaration as aA, type DrillDefinition as aB, type DrillDimension as aC, type DrillFinding as aD, type DrillGrain as aE, type DrillHaving as aF, type DrillLane as aG, type DrillLevel as aH, type DrillMeasure as aI, type DrillMeasureOp as aJ, type DrillMeasureWhereValue as aK, type DrillPath as aL, type DrillQuestion as aM, type DrillRecords as aN, type DrillRowsPage as aO, type DrillSource as aP, type DrillView as aQ, type EnrichAlternate as aR, type EnrichCell as aS, type EnrichDeclared as aT, type EnrichDueRow as aU, type EnrichRun as aV, type EnrichSource as aW, type Enrichment as aX, type EnrichmentSummary as aY, type EntityBackLinkItem as aZ, type EntityBackLinks as a_, type CommentWritten as aa, type ConversationScope as ab, type ConversationScopeContext as ac, type CustomFieldTableType as ad, DEFAULT_ARCHIVE_LANE as ae, DEFAULT_PAGE_SIZE as af, DRILL_CHART_TOKENS as ag, DRILL_DESCRIPTION_MAX as ah, DRILL_DOORS as ai, DRILL_SCHEMA as aj, type DataHomeTable as ak, type DecorationColor as al, type DecorationPath as am, type DecorationRule as an, type DecorationRuleOp as ao, type DecorationTarget as ap, type DocRenderRow as aq, type DocSignatureCheck as ar, type DocSignatureRow as as, type DocTemplateRow as at, type DocToken as au, type DocUnresolvedToken as av, type DrillAdHocOp as aw, type DrillAnswer as ax, type DrillAnswerRow as ay, type DrillChartToken as az, ARCHIVE_LANE_MEANS as b, type PublishBinding as b$, type EntityFieldValue as b0, type EntityFieldsAcross as b1, type EntityRecordMatch as b2, type EntityRecordRead as b3, type EntityRecordsFound as b4, type EntityRowWritten as b5, type EntityTableFacts as b6, type ExternalPrincipalCard as b7, type FieldDriftAspect as b8, type FieldHistoryEntry as b9, type IoExportPage as bA, type MigrationEntry as bB, type MigrationUndone as bC, type NewEntityFieldDeclaration as bD, type OutsideShareAnswer as bE, PIPELINE_RULE_KINDS as bF, type ParentExtracted as bG, type PickListDocument as bH, type PickListItem as bI, type PickListItemInput as bJ, type Pipeline as bK, type PipelineColumn as bL, type PipelineDeclared as bM, type PipelineGate as bN, type PipelineGatePreview as bO, type PipelineMissingField as bP, type PipelineMoveMany as bQ, type PipelineMoveManyItem as bR, type PipelineMoveManyResult as bS, type PipelineMoveResult as bT, type PipelineMoveVerdict as bU, type PipelineRule as bV, type PipelineRuleKind as bW, type PipelineSpec as bX, type PipelineStage as bY, type PipelineVerdict as bZ, type PromotedPredicate as b_, type FieldRetyped as ba, type FormArchiveAnswer as bb, type FormulaParse as bc, type FormulaPreview as bd, type GridLayout as be, type GridLayoutMode as bf, type GridRowHeight as bg, type HistoryActor as bh, type HistoryActorKind as bi, type HistoryChange as bj, type Home as bk, type ImportBatchResult as bl, type ImportColumnPlan as bm, type ImportColumnsDeclared as bn, type ImportFinished as bo, type ImportOpened as bp, type ImportOutcome as bq, type ImportPlan as br, type ImportPolicy as bs, type ImportProposal as bt, type ImportReport as bu, type ImportRun as bv, type InboundAddress as bw, type InboundDeclared as bx, type InboxCounts as by, type InboxStateChange as bz, A_PERSONS_REFUSAL as c, type TableRowDefaults as c$, type PublishBindingKind as c0, type QueryPlan as c1, ROW_LABEL_FORMULA_MAX_LENGTH as c2, ROW_WEB_NOT_READY as c3, type RecordChangeAction as c4, type RecordComment as c5, type RecordEvent as c6, type RecordHeader as c7, type RecordHistoryEntry as c8, type RecordQuery as c9, type StagePendingOnBoard as cA, type StageRuleEnforcement as cB, type StageRuleOnFail as cC, type StageRuleWarning as cD, type SyncAutoRefresh as cE, type Table as cF, type TableCapacity as cG, type TableCopyInProgress as cH, type TableCopySpec as cI, type TableDecorations as cJ, type TableDuplicateProgress as cK, type TableDuplicated as cL, type TableFact as cM, type TableHome as cN, type TableHomeDestination as cO, type TableLevel as cP, type TableLevelApproval as cQ, type TableLevelFacts as cR, type TableLevelSet as cS, type TableListEntry as cT, type TableLiveLocation as cU, type TableMoved as cV, type TablePlacement as cW, type TablePlacementFact as cX, type TableReaderRule as cY, type TableRestoreProgress as cZ, type TableRowCount as c_, type RecordRowControls as ca, type RecordScopeComment as cb, type RecordScopeContext as cc, type RecordScopeField as cd, type RecordScopeHistoryEntry as ce, type RecordScopeRelation as cf, type RecordScopeWithheld as cg, type RecordSplit as ch, type RecordsMerged as ci, type RegisteredTable as cj, type ResolvedPublishBinding as ck, type ResolvedPublishBindingKind as cl, type RestorePreview as cm, type RestoreResult as cn, type RetypeBehaviour as co, type RetypePreview as cp, type RowAction as cq, type RowActionStep as cr, type RowDefaultsApplied as cs, SHOWN_TO_LABEL as ct, SHOWN_TO_VALUES as cu, SHOWN_TO_WHO_MAY_CHANGE as cv, STAGE_RULE_ENFORCEMENT as cw, STAGE_RULE_ON_FAIL as cx, type ShownTo as cy, type StagePending as cz, type ActionRefusal as d, keptGroups as d$, type TableRowDefaultsPatch as d0, type TableRowLabel as d1, type TableSyncAnswer as d2, type TableSyncResult as d3, type TableSyncSettings as d4, type TableSyncSource as d5, type TableSyncSourceDocument as d6, type TableSyncSpec as d7, type TableWebhook as d8, type TableWebhookDeclared as d9, type WorkState as dA, type WorkTemplateNode as dB, type WorkTemplateRelation as dC, type WorkTurn as dD, actionRefusals as dE, archivedByLine as dF, archivedWhen as dG, asChoiceNudge as dH, asWriteConflict as dI, choiceSlug as dJ, choiceValuesOf as dK, choicesOf as dL, clearsRowLabel as dM, createRecordsClient as dN, decideTypedChoice as dO, declareDrillDefinition as dP, drillAnswerOf as dQ, drillFindingKnob as dR, emptyArchiveLine as dS, exportPageXlsx as dT, holdsARetiredChoice as dU, intersectIds as dV, isAPersonsRefusal as dW, isArchiveLane as dX, isFoundation as dY, isShownTo as dZ, isTheChosen as d_, type TypedChoiceDecision as da, type ViewLayout as db, type ViewOrderSet as dc, type WorkApprovalDecision as dd, type WorkApprovalFiled as de, type WorkApprovalState as df, type WorkApprover as dg, type WorkAssignment as dh, type WorkAssignmentField as di, type WorkChange as dj, type WorkDecideMany as dk, type WorkDecideManyItem as dl, type WorkDecideManyResult as dm, type WorkDecideVerdict as dn, type WorkDueState as dp, type WorkGraph as dq, type WorkInboxItem as dr, type WorkInboxKind as ds, type WorkInboxView as dt, type WorkInstantiation as du, type WorkListFlavour as dv, type WorkListItem as dw, type WorkOrigin as dx, type WorkRecordState as dy, type WorkSlotHold as dz, type ActionRunResult as e, keptOutOfSight as e0, keptTableHref as e1, levelHasShownTo as e2, looksLikeAnId as e3, mayDrag as e4, moveConsequence as e5, moveInOrder as e6, offeredAsContext as e7, optionKey as e8, optionLabel as e9, parseFieldDrift as ea, parseTableCopiesInProgress as eb, parseTableDuplicateProgress as ec, parseTableDuplicated as ed, parseTableHome as ee, parseTableMoved as ef, planQuery as eg, previewRetype as eh, previewRuleChange as ei, recordChangeTrigger as ej, recordSourceKey as ek, recordSourceTable as el, recordsUseSentence as em, rehomeSentence as en, removedChoicesInUse as eo, ruleThatRefuses as ep, rulesWithTopStar as eq, sameDocument as er, scopeChip as es, sheetSyncSpec as et, valueConverts as eu, withRowCounts as ev, withTableFacts as ew, withTablePlacement as ex, type AdminTable as f, type AnonTokenBinding as g, type ArchiveLane as h, type ArchivedChecklistTemplate as i, type ArchivedDoorRow as j, type ArchivedForm as k, type ArchivedRow as l, type AsOf as m, type AutomationAction as n, type AutomationDeclared as o, type AutomationFilter as p, type AutomationFlipped as q, type AutomationItem as r, type AutomationLastRun as s, type AutomationList as t, type AutomationRun as u, type AutomationRunStatus as v, type AutomationRuns as w, type AutomationSpec as x, type AutomationStep as y, type AutomationTested as z };
6898
+ export { type ChecklistRunSummary as $, ARCHIVE_LANES as A, type AutomationSpec as B, type AutomationStep as C, type AutomationTested as D, type AutomationToken as E, type FieldDrift as F, type AutomationTrigger as G, type AutomationValue as H, type AutomationValues as I, type AutomationWeekday as J, type AutomationWhen as K, BUILT_KIND_WORD as L, CHOICE_NUDGES as M, type CaptureField as N, type CaptureFileRef as O, type CaptureOutcome as P, type CaptureQuestion as Q, type RecordsClient as R, type CaptureSheetFace as S, type TableArchiveProgress as T, type CaptureSheetSummary as U, type ChecklistDeclared as V, type ChecklistRequirement as W, type ChecklistRequirementKind as X, type ChecklistRoleSpec as Y, type ChecklistRunStarted as Z, type ChecklistRunStep as _, ARCHIVE_LANE_LABEL as a, type EnrichSource as a$, type ChecklistSpec as a0, type ChecklistStepCompleted as a1, type ChecklistStepSpec as a2, type ChecklistTemplateShape as a3, type ChecklistTemplateSummary as a4, type ChecklistTrigger as a5, type ChecklistTriggerKind as a6, type ChoiceCellBack as a7, type ChoiceLike as a8, type ChoiceNudge as a9, type DocUnresolvedToken as aA, type DrillAdHocOp as aB, type DrillAnswer as aC, type DrillAnswerRow as aD, type DrillChartToken as aE, type DrillDeclaration as aF, type DrillDefinition as aG, type DrillDimension as aH, type DrillFinding as aI, type DrillGrain as aJ, type DrillHaving as aK, type DrillLane as aL, type DrillLevel as aM, type DrillMeasure as aN, type DrillMeasureOp as aO, type DrillMeasureWhereValue as aP, type DrillPath as aQ, type DrillQuestion as aR, type DrillRecords as aS, type DrillRowsPage as aT, type DrillSource as aU, type DrillView as aV, type EnrichAlternate as aW, type EnrichCell as aX, type EnrichDeclared as aY, type EnrichDueRow as aZ, type EnrichRun as a_, type ChoiceOption as aa, type ChoiceRehome as ab, type ChoiceUsage as ac, type ChoicesRehomed as ad, type CommentThreadRead as ae, type CommentWritten as af, type ConversationScope as ag, type ConversationScopeContext as ah, type CustomFieldTableType as ai, DEFAULT_ARCHIVE_LANE as aj, DEFAULT_PAGE_SIZE as ak, DRILL_CHART_TOKENS as al, DRILL_DESCRIPTION_MAX as am, DRILL_DOORS as an, DRILL_SCHEMA as ao, type DataHomeTable as ap, type DecorationColor as aq, type DecorationPath as ar, type DecorationRule as as, type DecorationRuleOp as at, type DecorationTarget as au, type DocRenderRow as av, type DocSignatureCheck as aw, type DocSignatureRow as ax, type DocTemplateRow as ay, type DocToken as az, ARCHIVE_LANE_MEANS as b, type PipelineRuleKind as b$, type Enrichment as b0, type EnrichmentSummary as b1, type EntityBackLinkItem as b2, type EntityBackLinks as b3, type EntityFieldRights as b4, type EntityFieldValue as b5, type EntityFieldsAcross as b6, type EntityRecordMatch as b7, type EntityRecordRead as b8, type EntityRecordsFound as b9, type ImportRun as bA, type InboundAddress as bB, type InboundDeclared as bC, type InboxCounts as bD, type InboxStateChange as bE, type IoExportPage as bF, type MigrationEntry as bG, type MigrationUndone as bH, type NewEntityFieldDeclaration as bI, type OutsideShareAnswer as bJ, PIPELINE_RULE_KINDS as bK, type ParentExtracted as bL, type PickListDocument as bM, type PickListItem as bN, type PickListItemInput as bO, type Pipeline as bP, type PipelineColumn as bQ, type PipelineDeclared as bR, type PipelineGate as bS, type PipelineGatePreview as bT, type PipelineMissingField as bU, type PipelineMoveMany as bV, type PipelineMoveManyItem as bW, type PipelineMoveManyResult as bX, type PipelineMoveResult as bY, type PipelineMoveVerdict as bZ, type PipelineRule as b_, type EntityRowWritten as ba, type EntityTableFacts as bb, type ExternalPrincipalCard as bc, type FieldDriftAspect as bd, type FieldHistoryEntry as be, type FieldRetyped as bf, type FormArchiveAnswer as bg, type FormulaParse as bh, type FormulaPreview as bi, type GridLayout as bj, type GridLayoutMode as bk, type GridRowHeight as bl, type HistoryActor as bm, type HistoryActorKind as bn, type HistoryChange as bo, type Home as bp, type ImportBatchResult as bq, type ImportColumnPlan as br, type ImportColumnsDeclared as bs, type ImportFinished as bt, type ImportOpened as bu, type ImportOutcome as bv, type ImportPlan as bw, type ImportPolicy as bx, type ImportProposal as by, type ImportReport as bz, A_PERSONS_REFUSAL as c, type TablePlacement as c$, type PipelineSpec as c0, type PipelineStage as c1, type PipelineVerdict as c2, type PromotedPredicate as c3, type PublishBinding as c4, type PublishBindingKind as c5, type QueryPlan as c6, ROW_LABEL_FORMULA_MAX_LENGTH as c7, ROW_WEB_NOT_READY as c8, type RecordChangeAction as c9, SHOWN_TO_WHO_MAY_CHANGE as cA, STAGE_RULE_ENFORCEMENT as cB, STAGE_RULE_ON_FAIL as cC, type ShownTo as cD, type StagePending as cE, type StagePendingOnBoard as cF, type StageRuleEnforcement as cG, type StageRuleOnFail as cH, type StageRuleWarning as cI, type SyncAutoRefresh as cJ, type Table as cK, type TableCapacity as cL, type TableCopyInProgress as cM, type TableCopySpec as cN, type TableDecorations as cO, type TableDuplicateProgress as cP, type TableDuplicated as cQ, type TableFact as cR, type TableHome as cS, type TableHomeDestination as cT, type TableLevel as cU, type TableLevelApproval as cV, type TableLevelFacts as cW, type TableLevelSet as cX, type TableListEntry as cY, type TableLiveLocation as cZ, type TableMoved as c_, type RecordComment as ca, type RecordEvent as cb, type RecordHeader as cc, type RecordHistoryEntry as cd, type RecordQuery as ce, type RecordRowControls as cf, type RecordScopeComment as cg, type RecordScopeContext as ch, type RecordScopeField as ci, type RecordScopeHistoryEntry as cj, type RecordScopeRelation as ck, type RecordScopeWithheld as cl, type RecordSplit as cm, type RecordsMerged as cn, type RegisteredTable as co, type ResolvedPublishBinding as cp, type ResolvedPublishBindingKind as cq, type RestorePreview as cr, type RestoreResult as cs, type RetypeBehaviour as ct, type RetypePreview as cu, type RowAction as cv, type RowActionStep as cw, type RowDefaultsApplied as cx, SHOWN_TO_LABEL as cy, SHOWN_TO_VALUES as cz, type ActionRefusal as d, intersectIds as d$, type TablePlacementFact as d0, type TableReaderRule as d1, type TableRestoreProgress as d2, type TableRowCount as d3, type TableRowDefaults as d4, type TableRowDefaultsPatch as d5, type TableRowLabel as d6, type TableSyncAnswer as d7, type TableSyncResult as d8, type TableSyncSettings as d9, type WorkListFlavour as dA, type WorkListItem as dB, type WorkOrigin as dC, type WorkRecordState as dD, type WorkSlotHold as dE, type WorkState as dF, type WorkTemplateNode as dG, type WorkTemplateRelation as dH, type WorkTurn as dI, actionRefusals as dJ, archivedByLine as dK, archivedWhen as dL, asChoiceNudge as dM, asWriteConflict as dN, automationWebhookUrl as dO, choiceSlug as dP, choiceValuesOf as dQ, choicesOf as dR, clearsRowLabel as dS, createRecordsClient as dT, decideTypedChoice as dU, declareDrillDefinition as dV, drillAnswerOf as dW, drillFindingKnob as dX, emptyArchiveLine as dY, exportPageXlsx as dZ, holdsARetiredChoice as d_, type TableSyncSource as da, type TableSyncSourceDocument as db, type TableSyncSpec as dc, type TableWebhook as dd, type TableWebhookDeclared as de, type TypedChoiceDecision as df, type ViewLayout as dg, type ViewOrderSet as dh, type WorkApprovalDecision as di, type WorkApprovalFiled as dj, type WorkApprovalState as dk, type WorkApprover as dl, type WorkAssignment as dm, type WorkAssignmentField as dn, type WorkChange as dp, type WorkDecideMany as dq, type WorkDecideManyItem as dr, type WorkDecideManyResult as ds, type WorkDecideVerdict as dt, type WorkDueState as du, type WorkGraph as dv, type WorkInboxItem as dw, type WorkInboxKind as dx, type WorkInboxView as dy, type WorkInstantiation as dz, type ActionRunResult as e, isAPersonsRefusal as e0, isArchiveLane as e1, isFoundation as e2, isShownTo as e3, isTheChosen as e4, keptGroups as e5, keptOutOfSight as e6, keptTableHref as e7, levelHasShownTo as e8, looksLikeAnId as e9, valueConverts as eA, withRowCounts as eB, withTableFacts as eC, withTablePlacement as eD, mayDrag as ea, moveConsequence as eb, moveInOrder as ec, offeredAsContext as ed, optionKey as ee, optionLabel as ef, parseFieldDrift as eg, parseTableCopiesInProgress as eh, parseTableDuplicateProgress as ei, parseTableDuplicated as ej, parseTableHome as ek, parseTableMoved as el, planQuery as em, previewRetype as en, previewRuleChange as eo, recordChangeTrigger as ep, recordSourceKey as eq, recordSourceTable as er, recordsUseSentence as es, rehomeSentence as et, removedChoicesInUse as eu, ruleThatRefuses as ev, rulesWithTopStar as ew, sameDocument as ex, scopeChip as ey, sheetSyncSpec as ez, type AdminTable as f, type AnonTokenBinding as g, type ArchiveLane as h, type ArchivedChecklistTemplate as i, type ArchivedDoorRow as j, type ArchivedForm as k, type ArchivedRow as l, type AsOf as m, type AutomationAction as n, type AutomationComparison as o, type AutomationDeclared as p, type AutomationFilter as q, type AutomationFlipped as r, type AutomationItem as s, type AutomationLastRun as t, type AutomationList as u, type AutomationRevision as v, type AutomationRevisions as w, type AutomationRun as x, type AutomationRunStatus as y, type AutomationRuns as z };
@@ -132,6 +132,7 @@ __export(core_exports, {
132
132
  asRecordsDataSource: () => asRecordsDataSource,
133
133
  asWriteConflict: () => asWriteConflict,
134
134
  atLeast: () => atLeast,
135
+ automationWebhookUrl: () => automationWebhookUrl,
135
136
  autonumberJoin: () => autonumberJoin,
136
137
  autonumberPrefixOf: () => autonumberPrefixOf,
137
138
  autonumberSearchOf: () => autonumberSearchOf,
@@ -1822,6 +1823,12 @@ function moveInOrder(order, moved, toIndex) {
1822
1823
  return [...rest.slice(0, at), moved, ...rest.slice(at)];
1823
1824
  }
1824
1825
 
1826
+ // src/automation.ts
1827
+ function automationWebhookUrl(serverBase, item2) {
1828
+ if (!item2.webhook_secret) return null;
1829
+ return `${serverBase.replace(/\/+$/, "")}/api/automations/hooks/${item2.id}/${item2.webhook_secret}`;
1830
+ }
1831
+
1825
1832
  // src/placement.ts
1826
1833
  function keptOutOfSight(placement) {
1827
1834
  return placement?.platform_owned === true;
@@ -7461,6 +7468,9 @@ var DOORS = {
7461
7468
  automationRuns: "automation_runs",
7462
7469
  // AUTOMATIONS-AIRTABLE (2026-10-10) — run one automation once now on a picked row.
7463
7470
  automationTest: "automation_test",
7471
+ // AT-AUTO2 (2026-10-15) — every save of an automation, and restoring one.
7472
+ automationRevisions: "automation_revisions",
7473
+ automationRevisionRestore: "automation_revision_restore",
7464
7474
  tableWebhookDeclare: "table_webhook_declare",
7465
7475
  tableWebhooks: "table_webhooks",
7466
7476
  tableWebhookArchive: "table_webhook_archive",
@@ -11196,6 +11206,20 @@ function createRecordsClient(given) {
11196
11206
  if (result.ok && record_id) announceRecordChanged(record_id);
11197
11207
  return result;
11198
11208
  },
11209
+ async automationRevisions({ automation_id }) {
11210
+ return callDoor(
11211
+ DOORS.automationRevisions,
11212
+ { p_organization_id: org, p_automation_id: automation_id },
11213
+ "automationRevisions"
11214
+ );
11215
+ },
11216
+ async automationRevisionRestore({ automation_id, revision_id }) {
11217
+ return callDoor(
11218
+ DOORS.automationRevisionRestore,
11219
+ { p_organization_id: org, p_automation_id: automation_id, p_revision_id: revision_id },
11220
+ "automationRevisionRestore"
11221
+ );
11222
+ },
11199
11223
  async tableWebhookDeclare({ table_id, target_url, events, description }) {
11200
11224
  return callDoor(
11201
11225
  DOORS.tableWebhookDeclare,