@ixo/editor 6.21.0 → 6.23.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/action-manifest.json +613 -11
- package/dist/{chunk-EO2K4IDP.js → chunk-LBFFAKSN.js} +135 -22
- package/dist/chunk-LBFFAKSN.js.map +1 -0
- package/dist/{chunk-I4NSQ7X4.js → chunk-UIZV4YAW.js} +4264 -4043
- package/dist/chunk-UIZV4YAW.js.map +1 -0
- package/dist/{chunk-2WSXLAX5.js → chunk-VFYF2B5E.js} +5581 -2637
- package/dist/chunk-VFYF2B5E.js.map +1 -0
- package/dist/core/index.d.ts +479 -46
- package/dist/core/index.js +241 -3
- package/dist/core/index.js.map +1 -1
- package/dist/{graphql-client-j-P2Llxg.d.ts → graphql-client-DQD1v9Yw.d.ts} +10 -3
- package/dist/{index-BC4ycOwH.d.ts → index-x1R0c9P_.d.ts} +2616 -127
- package/dist/index.d.ts +3 -3
- package/dist/index.js +36 -3
- package/dist/index.js.map +1 -1
- package/dist/mantine/index.d.ts +116 -10
- package/dist/mantine/index.js +158 -37
- package/dist/mantine/index.js.map +1 -1
- package/dist/store-B60v3oba.d.ts +1026 -0
- package/package.json +2 -2
- package/dist/chunk-2WSXLAX5.js.map +0 -1
- package/dist/chunk-EO2K4IDP.js.map +0 -1
- package/dist/chunk-I4NSQ7X4.js.map +0 -1
- package/dist/store-Ba-HGtSG.d.ts +0 -2144
package/dist/core/index.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export {
|
|
3
|
-
import {
|
|
4
|
-
export {
|
|
5
|
-
export { b as NODE_CONTEXT_MAP_NAME, c as NODE_CONTEXT_OVERRIDES_MAP_NAME, a as NodeContextFieldProvenance, N as NodeContextRecord, i as isNodeContextRecord } from '../nodeContext-C-BsYuYi.js';
|
|
1
|
+
import { an as CompiledBlock, W as CompiledFlow, ao as CompiledEdge, af as FlowAgentCommand, ah as FlowAgentContext, ag as FlowAgentCommandResult, ai as FlowAgentExecutor, ak as FlowAgentNodeSnapshot, ap as FlowAgentBlockerCause, al as FlowAgentPublicNodeState, Q as FlowConnectionBinding } from '../store-B60v3oba.js';
|
|
2
|
+
export { aH as AcquireFlowAgentLeaseParams, as as ActionBlockLike, at as ActionExecutionCompletionState, aX as ActorConstraint, A as AuthorizationResult, U as BaseUcanFlow, au as BuildActionRunInputsParams, av as BuildActionRunInputsResult, ad as BuildFlowAgentContextParams, a_ as CompiledFlowNode, L as CompilerRegistry, aW as ConditionRef, aI as CreateAgentCommandParams, aJ as EvaluateFlowAgentPolicyParams, aw as ExecuteActionBlockParams, ax as ExecuteActionBlockResult, E as ExecuteNodeParams, d as ExecutionContext, c as ExecutionOutcome, G as FLOW_CONNECTIONS_MAP_KEY, H as FLOW_CONNECTION_BINDINGS_MAP_KEY, F as FLOW_PARTICIPANTS_MAP_KEY, ae as FlowAgentActor, aM as FlowAgentCommandBase, aN as FlowAgentCommandStatus, aO as FlowAgentCommandType, aj as FlowAgentLease, aP as FlowAgentLedgerEvent, aQ as FlowAgentLedgerEventType, aR as FlowAgentMaps, aK as FlowAgentOrchestratorOptions, aS as FlowAgentPolicyDecision, aT as FlowAgentRunPhase, Y as FlowAgentService, aL as FlowAgentServiceOptions, am as FlowAgentTickResult, V as FlowCapability, P as FlowConnection, T as FlowConnectionRequirementKey, O as FlowParticipant, X as FlowStrategy, M as MergeResult, N as NodeActionResult, R as ReadFlowOptions, J as ReadFlowResult, aZ as RuntimeRef, S as SetupFlowOptions, I as SetupFlowResult, aY as TTLConstraint, aV as TriggerResolutionContext, a$ as TriggerSpec, Z as acquireFlowAgentLease, _ as appendAgentLedgerEvent, aq as buildActionRunInputs, a as buildAuthzFromProps, $ as buildFlowAgentContext, b as buildFlowNodeFromBlock, ay as canMatches, a0 as cleanupExpiredFlowAgentLeases, k as compileBaseUcanFlow, az as computeAgentCommandId, a1 as createAgentCommand, n as decompileToBaseUcanFlow, a2 as evaluateFlowAgentPolicy, ar as executeActionBlock, e as executeNode, a3 as executeQueuedAgentCommands, j as getActiveEditor, a4 as getFlowAgentMaps, i as isAuthorized, aA as isCapabilityMatch, aB as isExternalMutation, b0 as isRuntimeRef, m as mergeCompiledFlows, a5 as planRalphLoopCommands, a6 as queueAgentCommand, aC as readAgentCommands, a7 as readAgentLedgerEvents, l as readCompiledFlowFromYDoc, g as readFlow, aD as readFlowAgentLeases, r as readFlowAsBaseUcan, B as readFlowConnectionBindings, v as readFlowConnections, f as readFlowFromEditor, o as readFlowParticipants, a8 as readQueuedAgentCommands, a9 as releaseFlowAgentLease, x as removeFlowConnection, D as removeFlowConnectionBinding, p as removeFlowParticipant, aE as requiredCapabilityForCommand, aU as resolveRuntimeRefs, aF as resourceMatches, h as setActiveEditor, y as setFlowConnectionOptional, z as setFlowConnectionRequires, q as setFlowParticipantPowerLevel, t as setFlowParticipantRequirements, s as setupFlowFromBaseUcan, aa as tickFlowAgent, aG as updateAgentCommand, w as upsertFlowConnection, C as upsertFlowConnectionBinding, u as upsertFlowParticipant, ab as validateAgentCommand, ac as validateFlowAgentLease } from '../store-B60v3oba.js';
|
|
3
|
+
import { af as ActionDefinition, ap as ActionDoneContract, aq as ActionEventDefinition, ar as OutputSchemaField, ab as ActionServices, ag as FlowNodeRuntimeState, ad as RunEventAppender, as as RunEventInput, F as FlowRuntimeStateManager, at as RunJsonValue, au as ActionRunContext, av as CompletionCheck, k as StoredInvocation, aa as PendingInvocation, aw as ActionReadBackMetadata, a9 as IxoEditorType, ax as ReadBackTerminalState, ae as ActionResult, ay as ActionProofDeclaration, az as RunRecordDetails, g as UcanService, ac as ActionHandlers, U as UcanDelegationStore, S as StoredDelegation, I as InvocationStore, aA as FlowMetadata, a6 as FlowNode } from '../index-x1R0c9P_.js';
|
|
4
|
+
export { bV as ActionContext, bD as ActionRunEventInput, bZ as BidService, bB as CancelRunParams, c4 as CarbonService, cm as ClaimCollectionURI, b_ as ClaimService, bC as CloseRunParams, b$ as CollectionService, c0 as CollectionUsersService, cw as CreateDelegationParams, cx as CreateInvocationParams, cv as CreateRootDelegationParams, cl as DID, D as DelegationChainValidationResult, l as DelegationGrant, bX as EmailService, c5 as EntityService, a8 as EvaluationStatus, ct as ExecutionWithInvocationResult, ba as ExplicitRunRequiredError, ck as FailedListenerRun, cu as FindProofsResult, bE as FinishRunResult, a7 as FlowNodeAuthzExtension, cq as FlowNodeBase, bx as FlowNotMigratedError, c6 as FlowRunLifecycleService, bW as HttpService, c2 as IntegrationsService, cr as InvocationRequest, cs as InvocationResult, aD as LEGACY_RUN_STORAGE_VERSION, bH as LifecycleRunEventInput, cn as LinkedClaim, aE as MULTI_RUN_STORAGE_VERSION, c1 as MatrixCredentialService, bF as MigrateFlowParams, bG as MigrateFlowResult, be as MultiRunMigrationResult, co as NodeServiceReport, cp as NodeState, bY as NotifyService, c3 as OracleService, aF as RUNS_TERMINAL_MAP_KEY, cj as RUN_RECORD_AUDIT_TYPE, aG as RUN_STORAGE_VERSION_KEY, bI as RunDefinitionBlock, bJ as RunDefinitionDrift, bK as RunDefinitionSnapshot, bL as RunJsonObject, bN as RunLifecycleAuthorizationDecision, by as RunLifecycleAuthorizationError, bO as RunLifecycleAuthorizationRequest, bP as RunLifecycleAuthorizer, bQ as RunLifecycleCapability, bM as RunLogEventInput, bR as RunManifest, bd as RunMeta, bz as RunNotMigratedError, bA as RunNotReadyError, bS as RunSnapshot, bf as RunStorageVersion, bg as RunTerminalRecord, bT as StartRunParams, bU as StartRunResult, bb as TerminalRunExecutionError, j as UcanCapability, h as UcanServiceConfig, i as UcanServiceHandlers, bc as UnknownRunError, aH as adoptLegacyRuntime, c7 as appendRunRecord, a$ as assertRunActionExecutionAllowed, bh as buildRunDefinitionSnapshot, bi as cancelRun, aI as clearAllActionState, aC as clearRuntimeForTemplateClone, bj as closeRun, aJ as collectPhantomLegacyRun, ci as computePendingInvocationId, bk as computeRunDefinitionHash, bl as computeRunSummary, ca as countPendingInvocations, d as createInvocationStore, e as createMemoryInvocationStore, b as createMemoryUcanDelegationStore, bm as createRunId, aK as createRunRuntimeReader, aL as createRunRuntimeReaderWithDoc, aM as createRunScopedRuntimeManager, bn as createRunUlid, c as createRuntimeStateManager, a as createUcanDelegationStore, f as createUcanService, aB as createYDocRuntimeManager, aN as deleteActionState, bo as detectRunDefinitionDrift, aO as enableMultiRunStorage, aP as ensureRun, cf as findFailedListenersForSourceRun, cb as getOrCreateBlockPendingMap, c9 as getPendingInvocationsMap, aQ as getRunActionsMap, aR as getRunMeta, aU as getRunStorageVersion, aS as getRunsMap, aT as getRunsTerminalMap, aV as hasLegacyRuntimeHistory, b0 as isBelowTheLineBlock, aW as isLegacyRuntimeAdoptionEnabled, aX as isRecordInRun, bp as listOpenRuns, bq as listRuns, br as migrateFlowToSessions, cd as queuePendingInvocation, aY as readActionState, aZ as readActionStates, cc as readPendingInvocations, bs as readRunActionStates, c8 as readRunRecords, bt as recordRunDefinitionDrift, ce as removePendingInvocation, cg as replayFailedListenerRun, a_ as resetActionState, b1 as resolveActiveRunId, b2 as resolveRecordRunId, b3 as resolveRunIdForExecution, b4 as resolveRunIdForRead, b5 as seedRunFromLegacyRuntime, bu as setAdvisoryActiveRunId, b6 as setMultiRunStorage, ch as snapshotInputRefs, bv as startRun, b7 as subscribeToActionState, bw as toRunJsonValue, b8 as usesLegacyRuntimeCompatibility, b9 as writeActionState } from '../index-x1R0c9P_.js';
|
|
6
5
|
import * as Y from 'yjs';
|
|
7
6
|
import { Doc, Map } from 'yjs';
|
|
7
|
+
export { b as NODE_CONTEXT_MAP_NAME, c as NODE_CONTEXT_OVERRIDES_MAP_NAME, a as NodeContextFieldProvenance, N as NodeContextRecord, i as isNodeContextRecord } from '../nodeContext-C-BsYuYi.js';
|
|
8
8
|
import 'matrix-js-sdk';
|
|
9
9
|
import '@blocknote/core';
|
|
10
10
|
import 'react';
|
|
@@ -20,6 +20,28 @@ declare const STEP_COMPLETED_EVENT_NAME = "step.completed";
|
|
|
20
20
|
* - every completion is auditable (a run record is always written).
|
|
21
21
|
*/
|
|
22
22
|
declare const STEP_COMPLETED_EVENT: ActionEventDefinition;
|
|
23
|
+
/**
|
|
24
|
+
* The default Done contract: a one-shot step is Done once its run reached
|
|
25
|
+
* `completed`.
|
|
26
|
+
*
|
|
27
|
+
* The fold reads only the run state because proof of execution is enforced
|
|
28
|
+
* where the completion is *written* — `executeActionBlock` records a success
|
|
29
|
+
* that lacks the action's declared proof as `failed` (`PROOF_MISSING`) — and
|
|
30
|
+
* re-checked at the trust boundary by `verifyCompletion`, which is what
|
|
31
|
+
* trigger reconciliation, flow-agent planning and the completion badge gate on.
|
|
32
|
+
*
|
|
33
|
+
* Actions whose Done-ness is not simply the run state — it depends on an
|
|
34
|
+
* output field, a quota, or an external system — declare their own contract
|
|
35
|
+
* instead (see `qi/kyc.verify`).
|
|
36
|
+
*/
|
|
37
|
+
declare const doneWhenCompleted: ActionDoneContract;
|
|
38
|
+
/**
|
|
39
|
+
* Done contract for repeatable capabilities (`cardinality: 'many'`): a
|
|
40
|
+
* standing block fires as often as the flow decides and never latches to a
|
|
41
|
+
* terminal Done, so its fold is always false. Real progress for these blocks
|
|
42
|
+
* is the count of successful runs in the audit trail, not the summary entry.
|
|
43
|
+
*/
|
|
44
|
+
declare const neverDone: ActionDoneContract;
|
|
23
45
|
declare function registerAction<TInputs extends Record<string, any> = Record<string, any>>(definition: ActionDefinition<TInputs>): void;
|
|
24
46
|
declare function getAction(type: string): ActionDefinition | undefined;
|
|
25
47
|
declare function getAllActions(): ActionDefinition[];
|
|
@@ -62,6 +84,19 @@ type ManifestProofDeclaration = {
|
|
|
62
84
|
} | {
|
|
63
85
|
kind: 'custom';
|
|
64
86
|
};
|
|
87
|
+
interface ManifestDoneDeclaration {
|
|
88
|
+
/**
|
|
89
|
+
* `default` = one of the two shared standard contracts — a one-shot action
|
|
90
|
+
* is Done when its run reached `completed`, a repeatable one never latches
|
|
91
|
+
* (read `cardinality` to tell which applies). `custom` = the action defines
|
|
92
|
+
* its own predicate, which (like a custom proof) can't cross the JSON
|
|
93
|
+
* boundary; ask for an external check or run in-process to evaluate it.
|
|
94
|
+
*/
|
|
95
|
+
kind: 'default' | 'custom';
|
|
96
|
+
/** Whether an external actor can request a side-effect-free truth check. */
|
|
97
|
+
hasExternalCheck: boolean;
|
|
98
|
+
cardinality: 'once' | 'many';
|
|
99
|
+
}
|
|
65
100
|
interface ActionManifestEntry {
|
|
66
101
|
type: string;
|
|
67
102
|
/** Legacy names that resolve to this canonical type. */
|
|
@@ -71,6 +106,7 @@ interface ActionManifestEntry {
|
|
|
71
106
|
defaultRequiresConfirmation: boolean;
|
|
72
107
|
requiredCapability?: string;
|
|
73
108
|
proof: ManifestProofDeclaration;
|
|
109
|
+
done: ManifestDoneDeclaration;
|
|
74
110
|
/** JSON Schema for the action's inputs, when declared. */
|
|
75
111
|
inputSchema?: object;
|
|
76
112
|
/** Static output schema. Actions with dynamic schemas also set hasDynamicOutputSchema. */
|
|
@@ -214,46 +250,281 @@ declare function parseServiceCan(value: string): {
|
|
|
214
250
|
|
|
215
251
|
declare function buildServicesFromHandlers(handlers: any): ActionServices;
|
|
216
252
|
|
|
253
|
+
type ConditionOperator = 'equals' | 'not_equals' | 'greater_than' | 'less_than' | 'contains' | 'not_contains' | 'is_empty' | 'is_not_empty';
|
|
254
|
+
interface BlockCondition {
|
|
255
|
+
id: string;
|
|
256
|
+
name: string;
|
|
257
|
+
description?: string;
|
|
258
|
+
sourceBlockId: string;
|
|
259
|
+
sourceBlockType: string;
|
|
260
|
+
rule: {
|
|
261
|
+
type: 'property_value';
|
|
262
|
+
property: string;
|
|
263
|
+
operator: ConditionOperator;
|
|
264
|
+
value: string | number | boolean;
|
|
265
|
+
};
|
|
266
|
+
effect: {
|
|
267
|
+
action: 'enable' | 'disable' | 'hide' | 'show';
|
|
268
|
+
message?: string;
|
|
269
|
+
};
|
|
270
|
+
}
|
|
271
|
+
interface ConditionConfig {
|
|
272
|
+
enabled: boolean;
|
|
273
|
+
mode: 'all_must_pass' | 'any_can_pass';
|
|
274
|
+
conditions: BlockCondition[];
|
|
275
|
+
}
|
|
276
|
+
interface ConditionEvaluationResult {
|
|
277
|
+
passes: boolean;
|
|
278
|
+
message?: string;
|
|
279
|
+
}
|
|
280
|
+
interface ConditionActionResult {
|
|
281
|
+
action: 'enable' | 'disable' | 'hide' | 'show';
|
|
282
|
+
message?: string;
|
|
283
|
+
conditionName: string;
|
|
284
|
+
}
|
|
285
|
+
interface BlockConditionsResult {
|
|
286
|
+
actions: ConditionActionResult[];
|
|
287
|
+
}
|
|
288
|
+
interface BlockExecutionEligibility {
|
|
289
|
+
eligible: boolean;
|
|
290
|
+
enabled: boolean;
|
|
291
|
+
visible: boolean;
|
|
292
|
+
message?: string;
|
|
293
|
+
result: BlockConditionsResult;
|
|
294
|
+
}
|
|
295
|
+
interface ConditionEvaluationOptions {
|
|
296
|
+
getRuntimeState?: (blockId: string) => FlowNodeRuntimeState | undefined;
|
|
297
|
+
/**
|
|
298
|
+
* Phase A only: fall back to authored props when no run output exists.
|
|
299
|
+
* Multi-run documents deliberately disable this so execution results never
|
|
300
|
+
* leak through shared definition props.
|
|
301
|
+
*/
|
|
302
|
+
allowPropsFallback?: boolean;
|
|
303
|
+
}
|
|
304
|
+
declare function normalizeCondition(condition: BlockCondition): BlockCondition;
|
|
305
|
+
declare function normalizeConditions(conditions: BlockCondition[]): BlockCondition[];
|
|
306
|
+
declare function parseConditionConfig(value: unknown): ConditionConfig;
|
|
307
|
+
declare class InvalidConditionConfigError extends Error {
|
|
308
|
+
constructor(message: string);
|
|
309
|
+
}
|
|
310
|
+
/** Fail-closed parser for execution/planning boundaries. */
|
|
311
|
+
declare function parseConditionConfigStrict(value: unknown): ConditionConfig;
|
|
312
|
+
declare function resolveConditionSourceValue(condition: BlockCondition, sourceBlock: unknown, options?: ConditionEvaluationOptions): unknown;
|
|
313
|
+
declare function evaluateCondition(condition: BlockCondition, sourceBlock: unknown, options?: ConditionEvaluationOptions): ConditionEvaluationResult;
|
|
314
|
+
declare function evaluateBlockConditions(conditionConfig: ConditionConfig, editorDocument: unknown[], options?: ConditionEvaluationOptions): BlockConditionsResult;
|
|
315
|
+
/** Canonical run-aware evaluator used by browser and headless consumers. */
|
|
316
|
+
declare function evaluateBlockConditionsForRun(conditionConfig: ConditionConfig, editorDocument: unknown[], yDoc: Y.Doc, sessionRunId: string): BlockConditionsResult;
|
|
317
|
+
/**
|
|
318
|
+
* Canonical decision used immediately before execution and by planners. The
|
|
319
|
+
* condition vocabulary is positive after normalization: if an authored
|
|
320
|
+
* enable/show gate exists, at least one corresponding action must fire.
|
|
321
|
+
*/
|
|
322
|
+
declare function evaluateBlockExecutionEligibilityForRun(conditionConfig: ConditionConfig, editorDocument: unknown[], yDoc: Y.Doc, sessionRunId: string): BlockExecutionEligibility;
|
|
323
|
+
|
|
217
324
|
/**
|
|
218
|
-
*
|
|
219
|
-
*
|
|
220
|
-
* the assignee invokes the listener.
|
|
325
|
+
* A run head must stay small enough to replicate cheaply. Full action history
|
|
326
|
+
* belongs in Matrix; the Y.Doc keeps only the latest referenceable output.
|
|
221
327
|
*
|
|
222
|
-
*
|
|
223
|
-
*
|
|
224
|
-
* used to resolve those refs against the moment of emission rather than
|
|
225
|
-
* current state. See docs/flow-engine/events-and-triggers-plan.md §3.5.1 for the
|
|
226
|
-
* Sally → Mike scenario this fixes.
|
|
328
|
+
* 16 KiB leaves ample room for the run-event envelope under Matrix's 64 KiB
|
|
329
|
+
* event limit and bounds ten runs independently of retry/history volume.
|
|
227
330
|
*/
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
331
|
+
declare const MAX_RUN_ACTION_OUTPUT_BYTES: number;
|
|
332
|
+
interface BoundedRunOutput {
|
|
333
|
+
output: Record<string, unknown>;
|
|
334
|
+
byteLength: number;
|
|
335
|
+
exceeded: boolean;
|
|
336
|
+
}
|
|
337
|
+
interface PendingRunTimelineEvent {
|
|
338
|
+
event: RunEventInput;
|
|
339
|
+
failedAt: number;
|
|
340
|
+
error: string;
|
|
341
|
+
}
|
|
342
|
+
interface RunTimelineAppendResult {
|
|
343
|
+
ok: boolean;
|
|
344
|
+
eventId?: string;
|
|
345
|
+
error?: string;
|
|
231
346
|
}
|
|
347
|
+
/** Stable, bounded, Matrix-safe key. Raw block/run ids never enter the key. */
|
|
348
|
+
declare function createRunEventIdempotencyKey(kind: RunEventInput['kind'], ...identity: Array<string | number>): string;
|
|
349
|
+
/**
|
|
350
|
+
* Prepare the value allowed into the Y.Doc. Oversized output is represented by
|
|
351
|
+
* a bounded marker; callers must route the action to needs-verification rather
|
|
352
|
+
* than pretending downstream references still have the complete value.
|
|
353
|
+
*/
|
|
354
|
+
declare function boundRunActionOutput(value: Record<string, unknown>): BoundedRunOutput;
|
|
355
|
+
/**
|
|
356
|
+
* Append one canonical run event. Post-effect failures can be retained for
|
|
357
|
+
* replay; preflight failures pass retainOnFailure=false and abort execution.
|
|
358
|
+
*/
|
|
359
|
+
declare function appendRunTimelineEvent(params: {
|
|
360
|
+
eventLog?: RunEventAppender;
|
|
361
|
+
event: RunEventInput;
|
|
362
|
+
runtime?: FlowRuntimeStateManager;
|
|
363
|
+
blockId?: string;
|
|
364
|
+
retainOnFailure?: boolean;
|
|
365
|
+
now?: () => number;
|
|
366
|
+
}): Promise<RunTimelineAppendResult>;
|
|
367
|
+
/**
|
|
368
|
+
* Append an ordered event sequence. If one append fails, it and every event
|
|
369
|
+
* after it are retained in order so recovery cannot publish `action.done`
|
|
370
|
+
* ahead of the missing `action.output`.
|
|
371
|
+
*/
|
|
372
|
+
declare function appendRunTimelineEvents(params: {
|
|
373
|
+
eventLog?: RunEventAppender;
|
|
374
|
+
events: RunEventInput[];
|
|
375
|
+
runtime: FlowRuntimeStateManager;
|
|
376
|
+
blockId: string;
|
|
377
|
+
retainOnFailure?: boolean;
|
|
378
|
+
now?: () => number;
|
|
379
|
+
}): Promise<{
|
|
380
|
+
ok: boolean;
|
|
381
|
+
appended: number;
|
|
382
|
+
remaining: number;
|
|
383
|
+
lastEventId?: string;
|
|
384
|
+
error?: string;
|
|
385
|
+
}>;
|
|
386
|
+
/** Pure read used by status/recovery surfaces. */
|
|
387
|
+
declare function readPendingRunTimelineEvents(yDoc: Y.Doc, sessionRunId: string, blockId: string): PendingRunTimelineEvent[];
|
|
388
|
+
/** Replay retained post-effect events in original order and clear successes. */
|
|
389
|
+
declare function retryPendingRunTimelineEvents(params: {
|
|
390
|
+
yDoc: Y.Doc;
|
|
391
|
+
sessionRunId: string;
|
|
392
|
+
blockId: string;
|
|
393
|
+
eventLog: RunEventAppender;
|
|
394
|
+
now?: () => number;
|
|
395
|
+
}): Promise<{
|
|
396
|
+
attempted: number;
|
|
397
|
+
remaining: number;
|
|
398
|
+
lastEventId?: string;
|
|
399
|
+
}>;
|
|
400
|
+
/**
|
|
401
|
+
* Bound arbitrary JSON before embedding it in an event. Inputs are diagnostic,
|
|
402
|
+
* not authoritative; oversized values become the same compact marker.
|
|
403
|
+
*/
|
|
404
|
+
declare function boundRunEventJson(value: unknown): RunJsonValue;
|
|
405
|
+
|
|
232
406
|
/**
|
|
233
|
-
*
|
|
407
|
+
* Fold a run entry to Done using the action's own completion contract.
|
|
234
408
|
*
|
|
235
|
-
*
|
|
236
|
-
*
|
|
237
|
-
*
|
|
409
|
+
* There is no fallback branch: every registered action declares `done` (the
|
|
410
|
+
* registry backfills the default for untyped consumers), so the contract is
|
|
411
|
+
* the single place Done-ness is decided. One-shot actions typically use
|
|
412
|
+
* `doneWhenCompleted`, repeatable ones `neverDone`.
|
|
413
|
+
*/
|
|
414
|
+
declare function isActionDone<TInputs extends Record<string, any> = Record<string, any>>(action: ActionDefinition<TInputs> | undefined, actionState: FlowNodeRuntimeState, runContext: ActionRunContext): boolean;
|
|
415
|
+
declare function isActionTypeDone(actionType: string | undefined, actionState: FlowNodeRuntimeState, runContext: ActionRunContext): boolean;
|
|
416
|
+
type CompletionReconciliationTransition = 'unchanged' | 'adopted' | 'needs_verification' | 'unknown';
|
|
417
|
+
interface ReconcileCompletionParams<TInputs extends Record<string, any> = Record<string, any>> {
|
|
418
|
+
yDoc: Y.Doc;
|
|
419
|
+
sessionRunId: string;
|
|
420
|
+
blockId: string;
|
|
421
|
+
actionType: string;
|
|
422
|
+
inputs: TInputs;
|
|
423
|
+
flowId?: string;
|
|
424
|
+
flowUri?: string;
|
|
425
|
+
actorDid?: string;
|
|
426
|
+
services?: ActionRunContext['services'];
|
|
427
|
+
now?: () => number;
|
|
428
|
+
}
|
|
429
|
+
interface ReconcileCompletionResult {
|
|
430
|
+
transition: CompletionReconciliationTransition;
|
|
431
|
+
check: CompletionCheck;
|
|
432
|
+
previous: FlowNodeRuntimeState;
|
|
433
|
+
next: FlowNodeRuntimeState;
|
|
434
|
+
}
|
|
435
|
+
/**
|
|
436
|
+
* Reconcile a run entry against an action's pure/external completion contract.
|
|
238
437
|
*
|
|
239
|
-
*
|
|
240
|
-
*
|
|
241
|
-
*
|
|
242
|
-
*
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
*
|
|
249
|
-
* blocks.
|
|
438
|
+
* `check` is an explicit read: it must not execute the action or mutate the
|
|
439
|
+
* external system. Unknown results are inert. A positive read can adopt work
|
|
440
|
+
* completed outside this client; a negative read never retries an action and
|
|
441
|
+
* instead moves a contradictory completed entry to human verification.
|
|
442
|
+
*/
|
|
443
|
+
declare function reconcileCompletion<TInputs extends Record<string, any> = Record<string, any>>(params: ReconcileCompletionParams<TInputs>): Promise<ReconcileCompletionResult>;
|
|
444
|
+
|
|
445
|
+
declare const INVOCATIONS_MAP_KEY = "invocations";
|
|
446
|
+
/**
|
|
447
|
+
* Read UCAN invocation history for exactly one session run.
|
|
250
448
|
*
|
|
251
|
-
*
|
|
252
|
-
*
|
|
253
|
-
*
|
|
254
|
-
*
|
|
449
|
+
* Records written before sessions existed carry no `sessionRunId` and belong to
|
|
450
|
+
* the unsessioned document until it is migrated — see {@link isRecordInRun}.
|
|
451
|
+
* The lookup uses `Doc.share` so inspecting a room with no invocation history
|
|
452
|
+
* does not create an empty shared map.
|
|
255
453
|
*/
|
|
256
|
-
declare function
|
|
454
|
+
declare function readInvocationsForRun(yDoc: Y.Doc, sessionRunId: string): StoredInvocation[];
|
|
455
|
+
|
|
456
|
+
type EditorOrYDoc = IxoEditorType | Y.Doc;
|
|
457
|
+
interface NormalizeReadBackMetadataParams {
|
|
458
|
+
readBack?: Record<string, unknown>;
|
|
459
|
+
blockId: string;
|
|
460
|
+
actionType: string;
|
|
461
|
+
actorDid: string;
|
|
462
|
+
invocationCid?: string;
|
|
463
|
+
capabilityId?: string;
|
|
464
|
+
requestedAt: number;
|
|
465
|
+
pendingInvocation?: PendingInvocation;
|
|
466
|
+
}
|
|
467
|
+
interface ActionReadBackResolution {
|
|
468
|
+
state: ReadBackTerminalState;
|
|
469
|
+
output?: Record<string, unknown>;
|
|
470
|
+
events?: NonNullable<ActionResult['events']>;
|
|
471
|
+
readBack?: Record<string, unknown>;
|
|
472
|
+
error?: string | {
|
|
473
|
+
message: string;
|
|
474
|
+
code?: string;
|
|
475
|
+
};
|
|
476
|
+
}
|
|
477
|
+
interface ActionReadBackResolverInput {
|
|
478
|
+
blockId: string;
|
|
479
|
+
runtime: FlowNodeRuntimeState;
|
|
480
|
+
output: Record<string, unknown>;
|
|
481
|
+
readBack: ActionReadBackMetadata;
|
|
482
|
+
}
|
|
483
|
+
type ActionReadBackResolver = (input: ActionReadBackResolverInput) => ActionReadBackResolution | Promise<ActionReadBackResolution>;
|
|
484
|
+
interface ReconcileActionReadBackParams {
|
|
485
|
+
editorOrYDoc?: EditorOrYDoc | null;
|
|
486
|
+
blockId: string;
|
|
487
|
+
actorDid?: string;
|
|
488
|
+
runtime?: FlowRuntimeStateManager;
|
|
489
|
+
document?: Array<{
|
|
490
|
+
id?: string;
|
|
491
|
+
props?: Record<string, unknown>;
|
|
492
|
+
}>;
|
|
493
|
+
resolver?: ActionReadBackResolver;
|
|
494
|
+
resolvers?: Record<string, ActionReadBackResolver>;
|
|
495
|
+
runEventLog?: RunEventAppender;
|
|
496
|
+
now?: () => number;
|
|
497
|
+
/**
|
|
498
|
+
* The **session run** (`runs.ts`) this reconciliation writes into — not the
|
|
499
|
+
* per-execution audit id. Multi-run documents require this explicitly; only
|
|
500
|
+
* legacy documents retain the advisory active-run fallback.
|
|
501
|
+
*
|
|
502
|
+
* D2: every new parameter named `runId` means the session run.
|
|
503
|
+
*/
|
|
504
|
+
runId?: string;
|
|
505
|
+
}
|
|
506
|
+
interface ReconcileActionReadBackResult {
|
|
507
|
+
success: boolean;
|
|
508
|
+
blockId: string;
|
|
509
|
+
state: ReadBackTerminalState;
|
|
510
|
+
output?: Record<string, unknown>;
|
|
511
|
+
events: NonNullable<ActionResult['events']>;
|
|
512
|
+
error?: string;
|
|
513
|
+
/**
|
|
514
|
+
* Id of the audit record this reconciliation wrote (`readback-<ts>-<rand>`).
|
|
515
|
+
*
|
|
516
|
+
* @deprecated Use {@link ReconcileActionReadBackResult.executionId}; both
|
|
517
|
+
* carry the same value. The persisted `RunRecordDetails.runId` is never
|
|
518
|
+
* renamed (D2).
|
|
519
|
+
*/
|
|
520
|
+
runId?: string;
|
|
521
|
+
/** Forward name for the per-execution audit id. Identical to {@link runId}. */
|
|
522
|
+
executionId?: string;
|
|
523
|
+
pendingInvocationRemoved: boolean;
|
|
524
|
+
readBack?: ActionReadBackMetadata;
|
|
525
|
+
}
|
|
526
|
+
declare function normalizeActionReadBackMetadata(params: NormalizeReadBackMetadataParams): ActionReadBackMetadata;
|
|
527
|
+
declare function reconcileActionReadBack(params: ReconcileActionReadBackParams): Promise<ReconcileActionReadBackResult>;
|
|
257
528
|
|
|
258
529
|
declare const PROOF_MISSING_CODE = "PROOF_MISSING";
|
|
259
530
|
interface ProofValidationResult {
|
|
@@ -318,7 +589,130 @@ interface VerifyCompletionParams {
|
|
|
318
589
|
declare function verifyCompletion(params: VerifyCompletionParams): CompletionVerification;
|
|
319
590
|
declare function isVerifiedCompletion(params: VerifyCompletionParams): boolean;
|
|
320
591
|
|
|
321
|
-
|
|
592
|
+
/**
|
|
593
|
+
* Reference Resolver — the single engine for `{{blockId.propPath}}` string
|
|
594
|
+
* references.
|
|
595
|
+
*
|
|
596
|
+
* Handles resolution of block property references in the format:
|
|
597
|
+
* {{blockId.propKey}} or {{blockId.nestedProp.key}}
|
|
598
|
+
*
|
|
599
|
+
* Example:
|
|
600
|
+
* Input: "User email: {{user-block-123.email}}"
|
|
601
|
+
* Output: "User email: john@example.com"
|
|
602
|
+
*
|
|
603
|
+
* This lives in core (framework-free) so both the React layer
|
|
604
|
+
* (`src/mantine/utils/referenceResolver.ts` re-exports it) and headless
|
|
605
|
+
* consumers share one implementation. The structured `{ $ref }` resolver
|
|
606
|
+
* (`flowCompiler/resolveRefs.ts`) is a separate data model that shares
|
|
607
|
+
* `getNestedValue` from here.
|
|
608
|
+
*
|
|
609
|
+
* Behavioral contract (things consumers depend on — do not change):
|
|
610
|
+
* - Unresolved references become `fallback` (default `''`); every
|
|
611
|
+
* FlowDetail `inputsReady` gate relies on empty-string-when-unresolved.
|
|
612
|
+
* - Objects stringify by default (`stringifyObjects: true`).
|
|
613
|
+
* - `:` is allowed in property paths (JSON-LD field names).
|
|
614
|
+
* - `output.*` paths fall back to `output.data.*` and legacy
|
|
615
|
+
* `output.http.data.*`.
|
|
616
|
+
*/
|
|
617
|
+
/**
|
|
618
|
+
* Represents a parsed reference from a string
|
|
619
|
+
*/
|
|
620
|
+
interface ParsedReference {
|
|
621
|
+
/** Full reference string including delimiters: {{blockId.propKey}} */
|
|
622
|
+
fullMatch: string;
|
|
623
|
+
/** Block ID portion */
|
|
624
|
+
blockId: string;
|
|
625
|
+
/** Property path (can be nested): propKey or nested.prop.key */
|
|
626
|
+
propPath: string;
|
|
627
|
+
/** Start index in the original string */
|
|
628
|
+
startIndex: number;
|
|
629
|
+
/** End index in the original string */
|
|
630
|
+
endIndex: number;
|
|
631
|
+
}
|
|
632
|
+
/**
|
|
633
|
+
* Parse all references from a string
|
|
634
|
+
*/
|
|
635
|
+
declare function parseReferences(input: string): ParsedReference[];
|
|
636
|
+
/**
|
|
637
|
+
* Get a nested property value from an object using dot notation.
|
|
638
|
+
* Shared by the `{{...}}` resolver, the structured `$ref` resolver, and
|
|
639
|
+
* ref snapshotting — keep the loose `current?.[key]` semantics.
|
|
640
|
+
*/
|
|
641
|
+
declare function getNestedValue(obj: any, path: string): any;
|
|
642
|
+
type UnresolvedReferenceReason = 'unknown-block' | 'missing-value' | 'response-parse-error';
|
|
643
|
+
interface UnresolvedReference {
|
|
644
|
+
/** The full `{{...}}` reference text. */
|
|
645
|
+
ref: string;
|
|
646
|
+
blockId: string;
|
|
647
|
+
propPath: string;
|
|
648
|
+
reason: UnresolvedReferenceReason;
|
|
649
|
+
}
|
|
650
|
+
/**
|
|
651
|
+
* Resolve a single reference by finding the block and extracting the property value
|
|
652
|
+
*/
|
|
653
|
+
declare function resolveSingleReference(blockId: string, propPath: string, editorDocument: any[], yRuntime?: any, scope?: Record<string, any>): any;
|
|
654
|
+
interface ResolveReferencesOptions {
|
|
655
|
+
/** String to use when a reference cannot be resolved */
|
|
656
|
+
fallback?: string;
|
|
657
|
+
/** Whether to return objects as JSON strings */
|
|
658
|
+
stringifyObjects?: boolean;
|
|
659
|
+
/** Yjs runtime map for resolving action block output paths */
|
|
660
|
+
yRuntime?: any;
|
|
661
|
+
/**
|
|
662
|
+
* Local scope bindings for iterative contexts. When provided, a reference
|
|
663
|
+
* like `{{item.foo}}` resolves against `scope.item.foo` before falling
|
|
664
|
+
* back to editor blocks. Use this in iterative mappers (e.g. Xero
|
|
665
|
+
* invoice LineItems iterative mode).
|
|
666
|
+
*/
|
|
667
|
+
scope?: Record<string, any>;
|
|
668
|
+
/**
|
|
669
|
+
* Diagnostic context: when set, unresolved references are logged once per
|
|
670
|
+
* (context, ref). Pass the consuming block's id so a typo'd reference is
|
|
671
|
+
* visible in the console instead of silently becoming ''.
|
|
672
|
+
*/
|
|
673
|
+
warnContext?: string;
|
|
674
|
+
}
|
|
675
|
+
interface DetailedResolution {
|
|
676
|
+
value: string;
|
|
677
|
+
/** References that resolved to the fallback, with the reason. */
|
|
678
|
+
unresolved: UnresolvedReference[];
|
|
679
|
+
}
|
|
680
|
+
/**
|
|
681
|
+
* Resolve all references in a string, returning the resolved string plus
|
|
682
|
+
* structured diagnostics for every reference that fell back.
|
|
683
|
+
*/
|
|
684
|
+
declare function resolveReferencesDetailed(input: string | null | undefined, editorDocument: any[], options?: ResolveReferencesOptions): DetailedResolution;
|
|
685
|
+
/**
|
|
686
|
+
* Resolve all references in a string and return the resolved string
|
|
687
|
+
*/
|
|
688
|
+
declare function resolveReferences(input: string | null | undefined, editorDocument: any[], options?: ResolveReferencesOptions): string;
|
|
689
|
+
/**
|
|
690
|
+
* Check if a string contains any references
|
|
691
|
+
*/
|
|
692
|
+
declare function hasReferences(input: string | null | undefined): boolean;
|
|
693
|
+
/**
|
|
694
|
+
* Create a reference string for a block property
|
|
695
|
+
*/
|
|
696
|
+
declare function createReference(blockId: string, propPath: string): string;
|
|
697
|
+
/**
|
|
698
|
+
* Resolve references in an object's values recursively
|
|
699
|
+
* Useful for resolving references in API request bodies, headers, etc.
|
|
700
|
+
*/
|
|
701
|
+
declare function resolveObjectReferences<T extends Record<string, any>>(obj: T, editorDocument: any[], options?: ResolveReferencesOptions): T;
|
|
702
|
+
|
|
703
|
+
declare function reconcilePendingInvocations(editor: IxoEditorType, runId?: string): void;
|
|
704
|
+
/**
|
|
705
|
+
* Materialize `trigger: flow.start` as durable pending invocations in the new
|
|
706
|
+
* run. The run.started Matrix event is the source fact; deterministic ids make
|
|
707
|
+
* reconnect/retry safe without keeping a second history log in the Y.Doc.
|
|
708
|
+
*/
|
|
709
|
+
declare function dispatchFlowStartTriggers(params: {
|
|
710
|
+
yDoc: Y.Doc;
|
|
711
|
+
runId: string;
|
|
712
|
+
blocks: any[];
|
|
713
|
+
startedAt: number;
|
|
714
|
+
sourceEventId?: string;
|
|
715
|
+
}): number;
|
|
322
716
|
declare function getActionForBlock(block: any): ReturnType<typeof getAction>;
|
|
323
717
|
|
|
324
718
|
/**
|
|
@@ -327,13 +721,20 @@ declare function getActionForBlock(block: any): ReturnType<typeof getAction>;
|
|
|
327
721
|
*
|
|
328
722
|
* Call this after `updateRuntime({ state: 'completed', output })` in any
|
|
329
723
|
* FlowDetail component whose action defines events.
|
|
724
|
+
*
|
|
725
|
+
* @param runId The **session run** (`runs.ts`) this emission belongs to.
|
|
726
|
+
* Defaults to the active run. Recorded additively as
|
|
727
|
+
* `RunRecordDetails.sessionRunId`; nothing in Phase A reads it, and it is
|
|
728
|
+
* deliberately kept out of `computePendingInvocationId` (D2 / spec §2 rule 8
|
|
729
|
+
* — the id space moves in Phase B, together with `pendingInvocations` and
|
|
730
|
+
* `barrierState`, or the same logical event queues once per generation).
|
|
330
731
|
*/
|
|
331
732
|
declare function writeRunRecordAndReconcile(editor: IxoEditorType, blockId: string, output: Record<string, unknown>, events: Array<{
|
|
332
733
|
name: string;
|
|
333
734
|
payload: Record<string, unknown>;
|
|
334
735
|
}>, actorDid: string, detailsPatch?: Partial<RunRecordDetails> & {
|
|
335
736
|
sourceRunId?: string;
|
|
336
|
-
}): void;
|
|
737
|
+
}, runId?: string): void;
|
|
337
738
|
|
|
338
739
|
/**
|
|
339
740
|
* Flow Version Manifest
|
|
@@ -460,14 +861,14 @@ interface FlowDocumentRead {
|
|
|
460
861
|
*
|
|
461
862
|
* - structure ← `readCompiledFlowFromYDoc` (nodes, order, edges, `can`/`with`)
|
|
462
863
|
* - per-block props ← `readBlocksFromFragment` (inputs/conditions/trigger/ttl/icon/…)
|
|
463
|
-
* - per-block runtime ← the `runtime`
|
|
864
|
+
* - per-block runtime ← the run's `actions` map, resolved against the flat `runtime` mirror
|
|
464
865
|
*
|
|
465
866
|
* Fragment props are authoritative for the denormalized fields (`title`/`description`); the
|
|
466
867
|
* node-map copy is used only as a fallback when the fragment didn't persist them.
|
|
467
868
|
*
|
|
468
869
|
* Returns `null` when the doc has no flow at all (mirrors `readCompiledFlowFromYDoc`).
|
|
469
870
|
*/
|
|
470
|
-
declare function readFlowDocument(yDoc: Doc): FlowDocumentRead | null;
|
|
871
|
+
declare function readFlowDocument(yDoc: Doc, runId?: string): FlowDocumentRead | null;
|
|
471
872
|
interface AddFlowNodeOptions {
|
|
472
873
|
/** Registry action type, e.g. `'qi/form.submit'`. Must exist in the registry. */
|
|
473
874
|
type: string;
|
|
@@ -511,7 +912,7 @@ declare function setBlockProps(yDoc: Doc, blockId: string, partial: Record<strin
|
|
|
511
912
|
* `{{nodeId.output.*}}` input ref points at this node, removal is refused and the referring
|
|
512
913
|
* node ids are returned so the caller can surface them.
|
|
513
914
|
*/
|
|
514
|
-
declare function removeFlowNode(yDoc: Doc, nodeId: string): {
|
|
915
|
+
declare function removeFlowNode(yDoc: Doc, nodeId: string, runId?: string): {
|
|
515
916
|
ok: true;
|
|
516
917
|
} | {
|
|
517
918
|
ok: false;
|
|
@@ -537,19 +938,30 @@ declare function reorderFlowNodes(yDoc: Doc, order: string[]): boolean;
|
|
|
537
938
|
* Returns `false` if either block id is missing.
|
|
538
939
|
*/
|
|
539
940
|
declare function swapFlowBlocks(yDoc: Doc, blockIdA: string, blockIdB: string): boolean;
|
|
540
|
-
/**
|
|
541
|
-
|
|
941
|
+
/**
|
|
942
|
+
* Merge a partial into a node's action state — the headless twin of the React `updateRuntime`.
|
|
943
|
+
*
|
|
944
|
+
* Goes through `writeActionState`, so the run entry and the flat mirror are
|
|
945
|
+
* written in one transaction from one resolved `prev`. A flat-only write here
|
|
946
|
+
* would be invisible to run-scoped readers the moment they land.
|
|
947
|
+
*/
|
|
948
|
+
declare function updateNodeRuntime(yDoc: Doc, blockId: string, partial: Partial<FlowNodeRuntimeState>, runId?: string): void;
|
|
542
949
|
/**
|
|
543
950
|
* Clear a failed step back to idle so the user can cleanly re-run it. The headless twin of
|
|
544
951
|
* the editor's "Reset" recovery affordance — benign and non-executing.
|
|
952
|
+
*
|
|
953
|
+
* Resetting only the flat map is the failure this exists to avoid: a surviving
|
|
954
|
+
* `completed`/`failed` run entry beats a fresh `idle` flat entry under
|
|
955
|
+
* `resolveActionState` rule (a), so "Reset" would appear to do nothing at all
|
|
956
|
+
* once readers go run-first.
|
|
545
957
|
*/
|
|
546
|
-
declare function resetStepRuntime(yDoc: Doc, blockId: string): void;
|
|
958
|
+
declare function resetStepRuntime(yDoc: Doc, blockId: string, runId?: string): void;
|
|
547
959
|
/**
|
|
548
960
|
* Pre-fill a (live) form step's answers at `runtime.output.form.answers` (a JSON string,
|
|
549
961
|
* matching `FormPanel`). Merges into existing `output`; **never** sets `state:'completed'` —
|
|
550
962
|
* submission stays the user's action.
|
|
551
963
|
*/
|
|
552
|
-
declare function setFormAnswers(yDoc: Doc, blockId: string, answers: Record<string, unknown
|
|
964
|
+
declare function setFormAnswers(yDoc: Doc, blockId: string, answers: Record<string, unknown>, runId?: string): void;
|
|
553
965
|
|
|
554
966
|
/**
|
|
555
967
|
* The operator vocabulary the FE condition evaluator actually understands
|
|
@@ -603,6 +1015,7 @@ interface ExecuteFlowAgentCoreCommandOptions {
|
|
|
603
1015
|
leaseTtlMs?: number;
|
|
604
1016
|
flowOwnerDid?: string;
|
|
605
1017
|
schemaVersion?: string;
|
|
1018
|
+
runEventLog?: RunEventAppender;
|
|
606
1019
|
now?: () => number;
|
|
607
1020
|
}
|
|
608
1021
|
interface ExecuteQueuedFlowAgentCoreCommandsOptions extends ExecuteFlowAgentCoreCommandOptions {
|
|
@@ -803,6 +1216,26 @@ declare function computeCID(content: Uint8Array): Promise<string>;
|
|
|
803
1216
|
*/
|
|
804
1217
|
declare function computeJsonCID(obj: Record<string, any>): Promise<string>;
|
|
805
1218
|
|
|
1219
|
+
declare const XERO_TOOLKIT = "xero";
|
|
1220
|
+
/**
|
|
1221
|
+
* The Xero account, organisation and bank account this flow acts through.
|
|
1222
|
+
*
|
|
1223
|
+
* Flow-level, not block-level: the binding is chosen once in the flow's
|
|
1224
|
+
* Connections and is a prerequisite of starting a session, so by the time any
|
|
1225
|
+
* action runs it is already there. Blocks therefore no longer carry their own
|
|
1226
|
+
* connection or bank-account pin — two payment blocks in one flow debiting two
|
|
1227
|
+
* different accounts was never a real case, and a per-block pin could disagree
|
|
1228
|
+
* with the account the actors were actually granted.
|
|
1229
|
+
*
|
|
1230
|
+
* Reads defensively and never throws: the doc is live and replicated, so this
|
|
1231
|
+
* can be called mid-sync.
|
|
1232
|
+
*/
|
|
1233
|
+
declare function readFlowXeroBinding(yDoc?: Doc | null): FlowConnectionBinding | undefined;
|
|
1234
|
+
/** Same, from an editor (or anything carrying `_yDoc`). */
|
|
1235
|
+
declare function readFlowXeroBindingFromEditor(editor: {
|
|
1236
|
+
_yDoc?: Doc;
|
|
1237
|
+
} | null | undefined): FlowConnectionBinding | undefined;
|
|
1238
|
+
|
|
806
1239
|
declare const oracleInitSurveySchema: {
|
|
807
1240
|
title: string;
|
|
808
1241
|
description: string;
|
|
@@ -917,4 +1350,4 @@ declare function createOracleInitFlowTemplate(): {
|
|
|
917
1350
|
nodes: FlowNode[];
|
|
918
1351
|
};
|
|
919
1352
|
|
|
920
|
-
export { ActionDefinition, ActionHandlers, type ActionManifest, type ActionManifestEntry, ActionServices, type AddFlowNodeOptions, type BlockConditionInput, type ClassifyNodeStateInput, CompiledBlock, CompiledEdge, CompiledFlow, type CompletionVerification, type CompletionVerificationStatus, type EvaluatorOperator, type ExecuteFlowAgentCoreCommandOptions, type ExecuteQueuedFlowAgentCoreCommandsOptions, FlowAgentBlockerCause, FlowAgentCommand, FlowAgentCommandResult, FlowAgentContext, FlowAgentExecutor, FlowAgentNodeSnapshot, FlowAgentPublicNodeState, type FlowDocumentNode, type FlowDocumentRead, FlowNode, FlowNodeRuntimeState, type FlowVersionString, InvocationStore, LATEST_VERSION, type ManifestProofDeclaration, OutputSchemaField, PROOF_MISSING_CODE, type ProofValidationResult, RunRecordDetails, SERVICE_VERBS, STEP_COMPLETED_EVENT, STEP_COMPLETED_EVENT_NAME, type ServiceVerb, StoredDelegation, StoredInvocation,
|
|
1353
|
+
export { ActionDefinition, ActionDoneContract, ActionHandlers, type ActionManifest, type ActionManifestEntry, ActionReadBackMetadata, type ActionReadBackResolution, type ActionReadBackResolver, type ActionReadBackResolverInput, ActionResult, ActionRunContext, ActionServices, type AddFlowNodeOptions, type BlockCondition, type BlockConditionInput, type BlockConditionsResult, type BlockExecutionEligibility, type BoundedRunOutput, type ClassifyNodeStateInput, CompiledBlock, CompiledEdge, CompiledFlow, CompletionCheck, type CompletionReconciliationTransition, type CompletionVerification, type CompletionVerificationStatus, type ConditionActionResult, type ConditionConfig, type ConditionEvaluationOptions, type ConditionEvaluationResult, type ConditionOperator, type DetailedResolution, type EvaluatorOperator, type ExecuteFlowAgentCoreCommandOptions, type ExecuteQueuedFlowAgentCoreCommandsOptions, FlowAgentBlockerCause, FlowAgentCommand, FlowAgentCommandResult, FlowAgentContext, FlowAgentExecutor, FlowAgentNodeSnapshot, FlowAgentPublicNodeState, FlowConnectionBinding, type FlowDocumentNode, type FlowDocumentRead, FlowNode, FlowNodeRuntimeState, FlowRuntimeStateManager, type FlowVersionString, INVOCATIONS_MAP_KEY, InvalidConditionConfigError, InvocationStore, LATEST_VERSION, MAX_RUN_ACTION_OUTPUT_BYTES, type ManifestDoneDeclaration, type ManifestProofDeclaration, OutputSchemaField, PROOF_MISSING_CODE, type ParsedReference, PendingInvocation, type PendingRunTimelineEvent, type ProofValidationResult, ReadBackTerminalState, type ReconcileActionReadBackParams, type ReconcileActionReadBackResult, type ReconcileCompletionParams, type ReconcileCompletionResult, type ResolveReferencesOptions, RunEventAppender, RunEventInput, RunJsonValue, RunRecordDetails, type RunTimelineAppendResult, SERVICE_VERBS, STEP_COMPLETED_EVENT, STEP_COMPLETED_EVENT_NAME, type ServiceVerb, StoredDelegation, StoredInvocation, UcanDelegationStore, UcanService, type UnresolvedReference, type UnresolvedReferenceReason, VERSION_MANIFEST, type VersionPolicy, XERO_TOOLKIT, XERO_WORK_ITEMS_MAP_NAME, XERO_WORK_TERMINAL_MAP_NAME, type XeroWorkAttempt, type XeroWorkItem, type XeroWorkItemFilter, type XeroWorkKind, type XeroWorkProvenance, type XeroWorkSource, type XeroWorkStatus, type XeroWorkTerminalRecord, addFlowNode, appendRunTimelineEvent, appendRunTimelineEvents, boundRunActionOutput, boundRunEventJson, buildBlockConditionsProp, buildServicesFromHandlers, buildXeroInvoiceWorkKey, buildXeroPaymentWorkKey, canToType, classifyBlockerCause, classifyNodeState, computeCID, computeJsonCID, createOracleInitFlowTemplate, createReference, createRunEventIdempotencyKey, dispatchFlowStartTriggers, doneWhenCompleted, evaluateBlockConditions, evaluateBlockConditionsForRun, evaluateBlockExecutionEligibilityForRun, evaluateCondition, executeFlowAgentCoreCommand, executeQueuedFlowAgentCoreCommands, findXeroWorkItems, findXeroWorkItemsForEditor, generateActionManifest, getAction, getActionByCan, getActionForBlock, getAliasEntries, getAllActions, getAllCanMappings, getEventsForBlock, getMissingActionInputs, getNestedValue, getOutputSchemaForBlock, getVersionPolicy, getXeroWorkItemsMap, getXeroWorkTerminalMap, hasAction, hasReferences, isActionDone, isActionTypeDone, isBlankInputValue, isTempUcanEnforcementDisabled, isVerifiedCompletion, isVersionAtLeast, markXeroWorkApproved, markXeroWorkApprovedForEditor, markXeroWorkCompleted, markXeroWorkCompletedForEditor, markXeroWorkFailed, markXeroWorkFailedForEditor, neverDone, normalizeActionReadBackMetadata, normalizeCondition, normalizeConditions, oracleInitSurveySchema, parseConditionConfig, parseConditionConfigStrict, parseReferences, parseServiceCan, readBlocksFromFragment, readFlowDocument, readFlowXeroBinding, readFlowXeroBindingFromEditor, readInvocationsForRun, readPendingRunTimelineEvents, reconcileActionReadBack, reconcileCompletion, reconcilePendingInvocations, registerAction, removeBlockFromFragment, removeFlowNode, reorderFlowNodes, replaceBlockInFragment, resetStepRuntime, resolveConditionSourceValue, resolveObjectReferences, resolveReferences, resolveReferencesDetailed, resolveSingleReference, retryPendingRunTimelineEvents, serviceCan, setBlockProps, setFormAnswers, setTempUcanEnforcementDisabled, snapshotNode, swapFlowBlocks, toEvaluatorOperator, typeToCan, updateNodeRuntime, updateXeroWorkReviewPayload, updateXeroWorkReviewPayloadForEditor, upsertXeroWorkItem, upsertXeroWorkItemForEditor, validateActionProof, verifyCompletion, writeCompiledBlocksToFragment, writeRunRecordAndReconcile };
|