@ixo/editor 6.22.0 → 6.24.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-2WSXLAX5.js → chunk-BTMC55BR.js} +4629 -1639
- package/dist/chunk-BTMC55BR.js.map +1 -0
- package/dist/{chunk-OVS6HMTH.js → chunk-DBH72SPW.js} +4124 -3970
- package/dist/chunk-DBH72SPW.js.map +1 -0
- package/dist/{chunk-EO2K4IDP.js → chunk-R3H7TDTG.js} +135 -22
- package/dist/chunk-R3H7TDTG.js.map +1 -0
- package/dist/core/index.d.ts +496 -46
- package/dist/core/index.js +251 -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-wmrw3T5K.d.ts +1039 -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-OVS6HMTH.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-wmrw3T5K.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-wmrw3T5K.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,45 @@ 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;
|
|
45
|
+
/** Normalize UCAN `can` abilities to the canonical slash vocabulary. */
|
|
46
|
+
declare function normalizeCan(can: string): string;
|
|
47
|
+
/**
|
|
48
|
+
* Normalize UCAN capability patterns while accepting dotted legacy aliases.
|
|
49
|
+
* Patterns follow the same vocabulary as abilities, so this delegates to
|
|
50
|
+
* {@link normalizeCan} (`claim.*` → `claim/*`, `xero.invoice.*` → `xero.invoice/*`).
|
|
51
|
+
*/
|
|
52
|
+
declare function normalizeCapabilityPattern(pattern: string): string;
|
|
53
|
+
/** Resolve a registry action type to its canonical UCAN `can` ability. */
|
|
54
|
+
declare function actionTypeToCan(type: string): string | undefined;
|
|
55
|
+
/** Resolve a UCAN `can` ability to its canonical namespaced registry action type. */
|
|
56
|
+
declare function canToActionType(can: string): string | undefined;
|
|
57
|
+
interface CapabilityPatternCoversCanOptions {
|
|
58
|
+
allowGlobalWildcard?: boolean;
|
|
59
|
+
}
|
|
60
|
+
/** Return true when a capability pattern grants the requested `can` ability. */
|
|
61
|
+
declare function capabilityPatternCoversCan(pattern: string, can: string, options?: CapabilityPatternCoversCanOptions): boolean;
|
|
23
62
|
declare function registerAction<TInputs extends Record<string, any> = Record<string, any>>(definition: ActionDefinition<TInputs>): void;
|
|
24
63
|
declare function getAction(type: string): ActionDefinition | undefined;
|
|
25
64
|
declare function getAllActions(): ActionDefinition[];
|
|
@@ -62,6 +101,19 @@ type ManifestProofDeclaration = {
|
|
|
62
101
|
} | {
|
|
63
102
|
kind: 'custom';
|
|
64
103
|
};
|
|
104
|
+
interface ManifestDoneDeclaration {
|
|
105
|
+
/**
|
|
106
|
+
* `default` = one of the two shared standard contracts — a one-shot action
|
|
107
|
+
* is Done when its run reached `completed`, a repeatable one never latches
|
|
108
|
+
* (read `cardinality` to tell which applies). `custom` = the action defines
|
|
109
|
+
* its own predicate, which (like a custom proof) can't cross the JSON
|
|
110
|
+
* boundary; ask for an external check or run in-process to evaluate it.
|
|
111
|
+
*/
|
|
112
|
+
kind: 'default' | 'custom';
|
|
113
|
+
/** Whether an external actor can request a side-effect-free truth check. */
|
|
114
|
+
hasExternalCheck: boolean;
|
|
115
|
+
cardinality: 'once' | 'many';
|
|
116
|
+
}
|
|
65
117
|
interface ActionManifestEntry {
|
|
66
118
|
type: string;
|
|
67
119
|
/** Legacy names that resolve to this canonical type. */
|
|
@@ -71,6 +123,7 @@ interface ActionManifestEntry {
|
|
|
71
123
|
defaultRequiresConfirmation: boolean;
|
|
72
124
|
requiredCapability?: string;
|
|
73
125
|
proof: ManifestProofDeclaration;
|
|
126
|
+
done: ManifestDoneDeclaration;
|
|
74
127
|
/** JSON Schema for the action's inputs, when declared. */
|
|
75
128
|
inputSchema?: object;
|
|
76
129
|
/** Static output schema. Actions with dynamic schemas also set hasDynamicOutputSchema. */
|
|
@@ -214,46 +267,281 @@ declare function parseServiceCan(value: string): {
|
|
|
214
267
|
|
|
215
268
|
declare function buildServicesFromHandlers(handlers: any): ActionServices;
|
|
216
269
|
|
|
270
|
+
type ConditionOperator = 'equals' | 'not_equals' | 'greater_than' | 'less_than' | 'contains' | 'not_contains' | 'is_empty' | 'is_not_empty';
|
|
271
|
+
interface BlockCondition {
|
|
272
|
+
id: string;
|
|
273
|
+
name: string;
|
|
274
|
+
description?: string;
|
|
275
|
+
sourceBlockId: string;
|
|
276
|
+
sourceBlockType: string;
|
|
277
|
+
rule: {
|
|
278
|
+
type: 'property_value';
|
|
279
|
+
property: string;
|
|
280
|
+
operator: ConditionOperator;
|
|
281
|
+
value: string | number | boolean;
|
|
282
|
+
};
|
|
283
|
+
effect: {
|
|
284
|
+
action: 'enable' | 'disable' | 'hide' | 'show';
|
|
285
|
+
message?: string;
|
|
286
|
+
};
|
|
287
|
+
}
|
|
288
|
+
interface ConditionConfig {
|
|
289
|
+
enabled: boolean;
|
|
290
|
+
mode: 'all_must_pass' | 'any_can_pass';
|
|
291
|
+
conditions: BlockCondition[];
|
|
292
|
+
}
|
|
293
|
+
interface ConditionEvaluationResult {
|
|
294
|
+
passes: boolean;
|
|
295
|
+
message?: string;
|
|
296
|
+
}
|
|
297
|
+
interface ConditionActionResult {
|
|
298
|
+
action: 'enable' | 'disable' | 'hide' | 'show';
|
|
299
|
+
message?: string;
|
|
300
|
+
conditionName: string;
|
|
301
|
+
}
|
|
302
|
+
interface BlockConditionsResult {
|
|
303
|
+
actions: ConditionActionResult[];
|
|
304
|
+
}
|
|
305
|
+
interface BlockExecutionEligibility {
|
|
306
|
+
eligible: boolean;
|
|
307
|
+
enabled: boolean;
|
|
308
|
+
visible: boolean;
|
|
309
|
+
message?: string;
|
|
310
|
+
result: BlockConditionsResult;
|
|
311
|
+
}
|
|
312
|
+
interface ConditionEvaluationOptions {
|
|
313
|
+
getRuntimeState?: (blockId: string) => FlowNodeRuntimeState | undefined;
|
|
314
|
+
/**
|
|
315
|
+
* Phase A only: fall back to authored props when no run output exists.
|
|
316
|
+
* Multi-run documents deliberately disable this so execution results never
|
|
317
|
+
* leak through shared definition props.
|
|
318
|
+
*/
|
|
319
|
+
allowPropsFallback?: boolean;
|
|
320
|
+
}
|
|
321
|
+
declare function normalizeCondition(condition: BlockCondition): BlockCondition;
|
|
322
|
+
declare function normalizeConditions(conditions: BlockCondition[]): BlockCondition[];
|
|
323
|
+
declare function parseConditionConfig(value: unknown): ConditionConfig;
|
|
324
|
+
declare class InvalidConditionConfigError extends Error {
|
|
325
|
+
constructor(message: string);
|
|
326
|
+
}
|
|
327
|
+
/** Fail-closed parser for execution/planning boundaries. */
|
|
328
|
+
declare function parseConditionConfigStrict(value: unknown): ConditionConfig;
|
|
329
|
+
declare function resolveConditionSourceValue(condition: BlockCondition, sourceBlock: unknown, options?: ConditionEvaluationOptions): unknown;
|
|
330
|
+
declare function evaluateCondition(condition: BlockCondition, sourceBlock: unknown, options?: ConditionEvaluationOptions): ConditionEvaluationResult;
|
|
331
|
+
declare function evaluateBlockConditions(conditionConfig: ConditionConfig, editorDocument: unknown[], options?: ConditionEvaluationOptions): BlockConditionsResult;
|
|
332
|
+
/** Canonical run-aware evaluator used by browser and headless consumers. */
|
|
333
|
+
declare function evaluateBlockConditionsForRun(conditionConfig: ConditionConfig, editorDocument: unknown[], yDoc: Y.Doc, sessionRunId: string): BlockConditionsResult;
|
|
334
|
+
/**
|
|
335
|
+
* Canonical decision used immediately before execution and by planners. The
|
|
336
|
+
* condition vocabulary is positive after normalization: if an authored
|
|
337
|
+
* enable/show gate exists, at least one corresponding action must fire.
|
|
338
|
+
*/
|
|
339
|
+
declare function evaluateBlockExecutionEligibilityForRun(conditionConfig: ConditionConfig, editorDocument: unknown[], yDoc: Y.Doc, sessionRunId: string): BlockExecutionEligibility;
|
|
340
|
+
|
|
217
341
|
/**
|
|
218
|
-
*
|
|
219
|
-
*
|
|
220
|
-
* the assignee invokes the listener.
|
|
342
|
+
* A run head must stay small enough to replicate cheaply. Full action history
|
|
343
|
+
* belongs in Matrix; the Y.Doc keeps only the latest referenceable output.
|
|
221
344
|
*
|
|
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.
|
|
345
|
+
* 16 KiB leaves ample room for the run-event envelope under Matrix's 64 KiB
|
|
346
|
+
* event limit and bounds ten runs independently of retry/history volume.
|
|
227
347
|
*/
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
348
|
+
declare const MAX_RUN_ACTION_OUTPUT_BYTES: number;
|
|
349
|
+
interface BoundedRunOutput {
|
|
350
|
+
output: Record<string, unknown>;
|
|
351
|
+
byteLength: number;
|
|
352
|
+
exceeded: boolean;
|
|
353
|
+
}
|
|
354
|
+
interface PendingRunTimelineEvent {
|
|
355
|
+
event: RunEventInput;
|
|
356
|
+
failedAt: number;
|
|
357
|
+
error: string;
|
|
358
|
+
}
|
|
359
|
+
interface RunTimelineAppendResult {
|
|
360
|
+
ok: boolean;
|
|
361
|
+
eventId?: string;
|
|
362
|
+
error?: string;
|
|
231
363
|
}
|
|
364
|
+
/** Stable, bounded, Matrix-safe key. Raw block/run ids never enter the key. */
|
|
365
|
+
declare function createRunEventIdempotencyKey(kind: RunEventInput['kind'], ...identity: Array<string | number>): string;
|
|
366
|
+
/**
|
|
367
|
+
* Prepare the value allowed into the Y.Doc. Oversized output is represented by
|
|
368
|
+
* a bounded marker; callers must route the action to needs-verification rather
|
|
369
|
+
* than pretending downstream references still have the complete value.
|
|
370
|
+
*/
|
|
371
|
+
declare function boundRunActionOutput(value: Record<string, unknown>): BoundedRunOutput;
|
|
372
|
+
/**
|
|
373
|
+
* Append one canonical run event. Post-effect failures can be retained for
|
|
374
|
+
* replay; preflight failures pass retainOnFailure=false and abort execution.
|
|
375
|
+
*/
|
|
376
|
+
declare function appendRunTimelineEvent(params: {
|
|
377
|
+
eventLog?: RunEventAppender;
|
|
378
|
+
event: RunEventInput;
|
|
379
|
+
runtime?: FlowRuntimeStateManager;
|
|
380
|
+
blockId?: string;
|
|
381
|
+
retainOnFailure?: boolean;
|
|
382
|
+
now?: () => number;
|
|
383
|
+
}): Promise<RunTimelineAppendResult>;
|
|
384
|
+
/**
|
|
385
|
+
* Append an ordered event sequence. If one append fails, it and every event
|
|
386
|
+
* after it are retained in order so recovery cannot publish `action.done`
|
|
387
|
+
* ahead of the missing `action.output`.
|
|
388
|
+
*/
|
|
389
|
+
declare function appendRunTimelineEvents(params: {
|
|
390
|
+
eventLog?: RunEventAppender;
|
|
391
|
+
events: RunEventInput[];
|
|
392
|
+
runtime: FlowRuntimeStateManager;
|
|
393
|
+
blockId: string;
|
|
394
|
+
retainOnFailure?: boolean;
|
|
395
|
+
now?: () => number;
|
|
396
|
+
}): Promise<{
|
|
397
|
+
ok: boolean;
|
|
398
|
+
appended: number;
|
|
399
|
+
remaining: number;
|
|
400
|
+
lastEventId?: string;
|
|
401
|
+
error?: string;
|
|
402
|
+
}>;
|
|
403
|
+
/** Pure read used by status/recovery surfaces. */
|
|
404
|
+
declare function readPendingRunTimelineEvents(yDoc: Y.Doc, sessionRunId: string, blockId: string): PendingRunTimelineEvent[];
|
|
405
|
+
/** Replay retained post-effect events in original order and clear successes. */
|
|
406
|
+
declare function retryPendingRunTimelineEvents(params: {
|
|
407
|
+
yDoc: Y.Doc;
|
|
408
|
+
sessionRunId: string;
|
|
409
|
+
blockId: string;
|
|
410
|
+
eventLog: RunEventAppender;
|
|
411
|
+
now?: () => number;
|
|
412
|
+
}): Promise<{
|
|
413
|
+
attempted: number;
|
|
414
|
+
remaining: number;
|
|
415
|
+
lastEventId?: string;
|
|
416
|
+
}>;
|
|
417
|
+
/**
|
|
418
|
+
* Bound arbitrary JSON before embedding it in an event. Inputs are diagnostic,
|
|
419
|
+
* not authoritative; oversized values become the same compact marker.
|
|
420
|
+
*/
|
|
421
|
+
declare function boundRunEventJson(value: unknown): RunJsonValue;
|
|
422
|
+
|
|
232
423
|
/**
|
|
233
|
-
*
|
|
424
|
+
* Fold a run entry to Done using the action's own completion contract.
|
|
234
425
|
*
|
|
235
|
-
*
|
|
236
|
-
*
|
|
237
|
-
*
|
|
426
|
+
* There is no fallback branch: every registered action declares `done` (the
|
|
427
|
+
* registry backfills the default for untyped consumers), so the contract is
|
|
428
|
+
* the single place Done-ness is decided. One-shot actions typically use
|
|
429
|
+
* `doneWhenCompleted`, repeatable ones `neverDone`.
|
|
430
|
+
*/
|
|
431
|
+
declare function isActionDone<TInputs extends Record<string, any> = Record<string, any>>(action: ActionDefinition<TInputs> | undefined, actionState: FlowNodeRuntimeState, runContext: ActionRunContext): boolean;
|
|
432
|
+
declare function isActionTypeDone(actionType: string | undefined, actionState: FlowNodeRuntimeState, runContext: ActionRunContext): boolean;
|
|
433
|
+
type CompletionReconciliationTransition = 'unchanged' | 'adopted' | 'needs_verification' | 'unknown';
|
|
434
|
+
interface ReconcileCompletionParams<TInputs extends Record<string, any> = Record<string, any>> {
|
|
435
|
+
yDoc: Y.Doc;
|
|
436
|
+
sessionRunId: string;
|
|
437
|
+
blockId: string;
|
|
438
|
+
actionType: string;
|
|
439
|
+
inputs: TInputs;
|
|
440
|
+
flowId?: string;
|
|
441
|
+
flowUri?: string;
|
|
442
|
+
actorDid?: string;
|
|
443
|
+
services?: ActionRunContext['services'];
|
|
444
|
+
now?: () => number;
|
|
445
|
+
}
|
|
446
|
+
interface ReconcileCompletionResult {
|
|
447
|
+
transition: CompletionReconciliationTransition;
|
|
448
|
+
check: CompletionCheck;
|
|
449
|
+
previous: FlowNodeRuntimeState;
|
|
450
|
+
next: FlowNodeRuntimeState;
|
|
451
|
+
}
|
|
452
|
+
/**
|
|
453
|
+
* Reconcile a run entry against an action's pure/external completion contract.
|
|
238
454
|
*
|
|
239
|
-
*
|
|
240
|
-
*
|
|
241
|
-
*
|
|
242
|
-
*
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
*
|
|
249
|
-
* blocks.
|
|
455
|
+
* `check` is an explicit read: it must not execute the action or mutate the
|
|
456
|
+
* external system. Unknown results are inert. A positive read can adopt work
|
|
457
|
+
* completed outside this client; a negative read never retries an action and
|
|
458
|
+
* instead moves a contradictory completed entry to human verification.
|
|
459
|
+
*/
|
|
460
|
+
declare function reconcileCompletion<TInputs extends Record<string, any> = Record<string, any>>(params: ReconcileCompletionParams<TInputs>): Promise<ReconcileCompletionResult>;
|
|
461
|
+
|
|
462
|
+
declare const INVOCATIONS_MAP_KEY = "invocations";
|
|
463
|
+
/**
|
|
464
|
+
* Read UCAN invocation history for exactly one session run.
|
|
250
465
|
*
|
|
251
|
-
*
|
|
252
|
-
*
|
|
253
|
-
*
|
|
254
|
-
*
|
|
466
|
+
* Records written before sessions existed carry no `sessionRunId` and belong to
|
|
467
|
+
* the unsessioned document until it is migrated — see {@link isRecordInRun}.
|
|
468
|
+
* The lookup uses `Doc.share` so inspecting a room with no invocation history
|
|
469
|
+
* does not create an empty shared map.
|
|
255
470
|
*/
|
|
256
|
-
declare function
|
|
471
|
+
declare function readInvocationsForRun(yDoc: Y.Doc, sessionRunId: string): StoredInvocation[];
|
|
472
|
+
|
|
473
|
+
type EditorOrYDoc = IxoEditorType | Y.Doc;
|
|
474
|
+
interface NormalizeReadBackMetadataParams {
|
|
475
|
+
readBack?: Record<string, unknown>;
|
|
476
|
+
blockId: string;
|
|
477
|
+
actionType: string;
|
|
478
|
+
actorDid: string;
|
|
479
|
+
invocationCid?: string;
|
|
480
|
+
capabilityId?: string;
|
|
481
|
+
requestedAt: number;
|
|
482
|
+
pendingInvocation?: PendingInvocation;
|
|
483
|
+
}
|
|
484
|
+
interface ActionReadBackResolution {
|
|
485
|
+
state: ReadBackTerminalState;
|
|
486
|
+
output?: Record<string, unknown>;
|
|
487
|
+
events?: NonNullable<ActionResult['events']>;
|
|
488
|
+
readBack?: Record<string, unknown>;
|
|
489
|
+
error?: string | {
|
|
490
|
+
message: string;
|
|
491
|
+
code?: string;
|
|
492
|
+
};
|
|
493
|
+
}
|
|
494
|
+
interface ActionReadBackResolverInput {
|
|
495
|
+
blockId: string;
|
|
496
|
+
runtime: FlowNodeRuntimeState;
|
|
497
|
+
output: Record<string, unknown>;
|
|
498
|
+
readBack: ActionReadBackMetadata;
|
|
499
|
+
}
|
|
500
|
+
type ActionReadBackResolver = (input: ActionReadBackResolverInput) => ActionReadBackResolution | Promise<ActionReadBackResolution>;
|
|
501
|
+
interface ReconcileActionReadBackParams {
|
|
502
|
+
editorOrYDoc?: EditorOrYDoc | null;
|
|
503
|
+
blockId: string;
|
|
504
|
+
actorDid?: string;
|
|
505
|
+
runtime?: FlowRuntimeStateManager;
|
|
506
|
+
document?: Array<{
|
|
507
|
+
id?: string;
|
|
508
|
+
props?: Record<string, unknown>;
|
|
509
|
+
}>;
|
|
510
|
+
resolver?: ActionReadBackResolver;
|
|
511
|
+
resolvers?: Record<string, ActionReadBackResolver>;
|
|
512
|
+
runEventLog?: RunEventAppender;
|
|
513
|
+
now?: () => number;
|
|
514
|
+
/**
|
|
515
|
+
* The **session run** (`runs.ts`) this reconciliation writes into — not the
|
|
516
|
+
* per-execution audit id. Multi-run documents require this explicitly; only
|
|
517
|
+
* legacy documents retain the advisory active-run fallback.
|
|
518
|
+
*
|
|
519
|
+
* D2: every new parameter named `runId` means the session run.
|
|
520
|
+
*/
|
|
521
|
+
runId?: string;
|
|
522
|
+
}
|
|
523
|
+
interface ReconcileActionReadBackResult {
|
|
524
|
+
success: boolean;
|
|
525
|
+
blockId: string;
|
|
526
|
+
state: ReadBackTerminalState;
|
|
527
|
+
output?: Record<string, unknown>;
|
|
528
|
+
events: NonNullable<ActionResult['events']>;
|
|
529
|
+
error?: string;
|
|
530
|
+
/**
|
|
531
|
+
* Id of the audit record this reconciliation wrote (`readback-<ts>-<rand>`).
|
|
532
|
+
*
|
|
533
|
+
* @deprecated Use {@link ReconcileActionReadBackResult.executionId}; both
|
|
534
|
+
* carry the same value. The persisted `RunRecordDetails.runId` is never
|
|
535
|
+
* renamed (D2).
|
|
536
|
+
*/
|
|
537
|
+
runId?: string;
|
|
538
|
+
/** Forward name for the per-execution audit id. Identical to {@link runId}. */
|
|
539
|
+
executionId?: string;
|
|
540
|
+
pendingInvocationRemoved: boolean;
|
|
541
|
+
readBack?: ActionReadBackMetadata;
|
|
542
|
+
}
|
|
543
|
+
declare function normalizeActionReadBackMetadata(params: NormalizeReadBackMetadataParams): ActionReadBackMetadata;
|
|
544
|
+
declare function reconcileActionReadBack(params: ReconcileActionReadBackParams): Promise<ReconcileActionReadBackResult>;
|
|
257
545
|
|
|
258
546
|
declare const PROOF_MISSING_CODE = "PROOF_MISSING";
|
|
259
547
|
interface ProofValidationResult {
|
|
@@ -318,7 +606,130 @@ interface VerifyCompletionParams {
|
|
|
318
606
|
declare function verifyCompletion(params: VerifyCompletionParams): CompletionVerification;
|
|
319
607
|
declare function isVerifiedCompletion(params: VerifyCompletionParams): boolean;
|
|
320
608
|
|
|
321
|
-
|
|
609
|
+
/**
|
|
610
|
+
* Reference Resolver — the single engine for `{{blockId.propPath}}` string
|
|
611
|
+
* references.
|
|
612
|
+
*
|
|
613
|
+
* Handles resolution of block property references in the format:
|
|
614
|
+
* {{blockId.propKey}} or {{blockId.nestedProp.key}}
|
|
615
|
+
*
|
|
616
|
+
* Example:
|
|
617
|
+
* Input: "User email: {{user-block-123.email}}"
|
|
618
|
+
* Output: "User email: john@example.com"
|
|
619
|
+
*
|
|
620
|
+
* This lives in core (framework-free) so both the React layer
|
|
621
|
+
* (`src/mantine/utils/referenceResolver.ts` re-exports it) and headless
|
|
622
|
+
* consumers share one implementation. The structured `{ $ref }` resolver
|
|
623
|
+
* (`flowCompiler/resolveRefs.ts`) is a separate data model that shares
|
|
624
|
+
* `getNestedValue` from here.
|
|
625
|
+
*
|
|
626
|
+
* Behavioral contract (things consumers depend on — do not change):
|
|
627
|
+
* - Unresolved references become `fallback` (default `''`); every
|
|
628
|
+
* FlowDetail `inputsReady` gate relies on empty-string-when-unresolved.
|
|
629
|
+
* - Objects stringify by default (`stringifyObjects: true`).
|
|
630
|
+
* - `:` is allowed in property paths (JSON-LD field names).
|
|
631
|
+
* - `output.*` paths fall back to `output.data.*` and legacy
|
|
632
|
+
* `output.http.data.*`.
|
|
633
|
+
*/
|
|
634
|
+
/**
|
|
635
|
+
* Represents a parsed reference from a string
|
|
636
|
+
*/
|
|
637
|
+
interface ParsedReference {
|
|
638
|
+
/** Full reference string including delimiters: {{blockId.propKey}} */
|
|
639
|
+
fullMatch: string;
|
|
640
|
+
/** Block ID portion */
|
|
641
|
+
blockId: string;
|
|
642
|
+
/** Property path (can be nested): propKey or nested.prop.key */
|
|
643
|
+
propPath: string;
|
|
644
|
+
/** Start index in the original string */
|
|
645
|
+
startIndex: number;
|
|
646
|
+
/** End index in the original string */
|
|
647
|
+
endIndex: number;
|
|
648
|
+
}
|
|
649
|
+
/**
|
|
650
|
+
* Parse all references from a string
|
|
651
|
+
*/
|
|
652
|
+
declare function parseReferences(input: string): ParsedReference[];
|
|
653
|
+
/**
|
|
654
|
+
* Get a nested property value from an object using dot notation.
|
|
655
|
+
* Shared by the `{{...}}` resolver, the structured `$ref` resolver, and
|
|
656
|
+
* ref snapshotting — keep the loose `current?.[key]` semantics.
|
|
657
|
+
*/
|
|
658
|
+
declare function getNestedValue(obj: any, path: string): any;
|
|
659
|
+
type UnresolvedReferenceReason = 'unknown-block' | 'missing-value' | 'response-parse-error';
|
|
660
|
+
interface UnresolvedReference {
|
|
661
|
+
/** The full `{{...}}` reference text. */
|
|
662
|
+
ref: string;
|
|
663
|
+
blockId: string;
|
|
664
|
+
propPath: string;
|
|
665
|
+
reason: UnresolvedReferenceReason;
|
|
666
|
+
}
|
|
667
|
+
/**
|
|
668
|
+
* Resolve a single reference by finding the block and extracting the property value
|
|
669
|
+
*/
|
|
670
|
+
declare function resolveSingleReference(blockId: string, propPath: string, editorDocument: any[], yRuntime?: any, scope?: Record<string, any>): any;
|
|
671
|
+
interface ResolveReferencesOptions {
|
|
672
|
+
/** String to use when a reference cannot be resolved */
|
|
673
|
+
fallback?: string;
|
|
674
|
+
/** Whether to return objects as JSON strings */
|
|
675
|
+
stringifyObjects?: boolean;
|
|
676
|
+
/** Yjs runtime map for resolving action block output paths */
|
|
677
|
+
yRuntime?: any;
|
|
678
|
+
/**
|
|
679
|
+
* Local scope bindings for iterative contexts. When provided, a reference
|
|
680
|
+
* like `{{item.foo}}` resolves against `scope.item.foo` before falling
|
|
681
|
+
* back to editor blocks. Use this in iterative mappers (e.g. Xero
|
|
682
|
+
* invoice LineItems iterative mode).
|
|
683
|
+
*/
|
|
684
|
+
scope?: Record<string, any>;
|
|
685
|
+
/**
|
|
686
|
+
* Diagnostic context: when set, unresolved references are logged once per
|
|
687
|
+
* (context, ref). Pass the consuming block's id so a typo'd reference is
|
|
688
|
+
* visible in the console instead of silently becoming ''.
|
|
689
|
+
*/
|
|
690
|
+
warnContext?: string;
|
|
691
|
+
}
|
|
692
|
+
interface DetailedResolution {
|
|
693
|
+
value: string;
|
|
694
|
+
/** References that resolved to the fallback, with the reason. */
|
|
695
|
+
unresolved: UnresolvedReference[];
|
|
696
|
+
}
|
|
697
|
+
/**
|
|
698
|
+
* Resolve all references in a string, returning the resolved string plus
|
|
699
|
+
* structured diagnostics for every reference that fell back.
|
|
700
|
+
*/
|
|
701
|
+
declare function resolveReferencesDetailed(input: string | null | undefined, editorDocument: any[], options?: ResolveReferencesOptions): DetailedResolution;
|
|
702
|
+
/**
|
|
703
|
+
* Resolve all references in a string and return the resolved string
|
|
704
|
+
*/
|
|
705
|
+
declare function resolveReferences(input: string | null | undefined, editorDocument: any[], options?: ResolveReferencesOptions): string;
|
|
706
|
+
/**
|
|
707
|
+
* Check if a string contains any references
|
|
708
|
+
*/
|
|
709
|
+
declare function hasReferences(input: string | null | undefined): boolean;
|
|
710
|
+
/**
|
|
711
|
+
* Create a reference string for a block property
|
|
712
|
+
*/
|
|
713
|
+
declare function createReference(blockId: string, propPath: string): string;
|
|
714
|
+
/**
|
|
715
|
+
* Resolve references in an object's values recursively
|
|
716
|
+
* Useful for resolving references in API request bodies, headers, etc.
|
|
717
|
+
*/
|
|
718
|
+
declare function resolveObjectReferences<T extends Record<string, any>>(obj: T, editorDocument: any[], options?: ResolveReferencesOptions): T;
|
|
719
|
+
|
|
720
|
+
declare function reconcilePendingInvocations(editor: IxoEditorType, runId?: string): void;
|
|
721
|
+
/**
|
|
722
|
+
* Materialize `trigger: flow.start` as durable pending invocations in the new
|
|
723
|
+
* run. The run.started Matrix event is the source fact; deterministic ids make
|
|
724
|
+
* reconnect/retry safe without keeping a second history log in the Y.Doc.
|
|
725
|
+
*/
|
|
726
|
+
declare function dispatchFlowStartTriggers(params: {
|
|
727
|
+
yDoc: Y.Doc;
|
|
728
|
+
runId: string;
|
|
729
|
+
blocks: any[];
|
|
730
|
+
startedAt: number;
|
|
731
|
+
sourceEventId?: string;
|
|
732
|
+
}): number;
|
|
322
733
|
declare function getActionForBlock(block: any): ReturnType<typeof getAction>;
|
|
323
734
|
|
|
324
735
|
/**
|
|
@@ -327,13 +738,20 @@ declare function getActionForBlock(block: any): ReturnType<typeof getAction>;
|
|
|
327
738
|
*
|
|
328
739
|
* Call this after `updateRuntime({ state: 'completed', output })` in any
|
|
329
740
|
* FlowDetail component whose action defines events.
|
|
741
|
+
*
|
|
742
|
+
* @param runId The **session run** (`runs.ts`) this emission belongs to.
|
|
743
|
+
* Defaults to the active run. Recorded additively as
|
|
744
|
+
* `RunRecordDetails.sessionRunId`; nothing in Phase A reads it, and it is
|
|
745
|
+
* deliberately kept out of `computePendingInvocationId` (D2 / spec §2 rule 8
|
|
746
|
+
* — the id space moves in Phase B, together with `pendingInvocations` and
|
|
747
|
+
* `barrierState`, or the same logical event queues once per generation).
|
|
330
748
|
*/
|
|
331
749
|
declare function writeRunRecordAndReconcile(editor: IxoEditorType, blockId: string, output: Record<string, unknown>, events: Array<{
|
|
332
750
|
name: string;
|
|
333
751
|
payload: Record<string, unknown>;
|
|
334
752
|
}>, actorDid: string, detailsPatch?: Partial<RunRecordDetails> & {
|
|
335
753
|
sourceRunId?: string;
|
|
336
|
-
}): void;
|
|
754
|
+
}, runId?: string): void;
|
|
337
755
|
|
|
338
756
|
/**
|
|
339
757
|
* Flow Version Manifest
|
|
@@ -460,14 +878,14 @@ interface FlowDocumentRead {
|
|
|
460
878
|
*
|
|
461
879
|
* - structure ← `readCompiledFlowFromYDoc` (nodes, order, edges, `can`/`with`)
|
|
462
880
|
* - per-block props ← `readBlocksFromFragment` (inputs/conditions/trigger/ttl/icon/…)
|
|
463
|
-
* - per-block runtime ← the `runtime`
|
|
881
|
+
* - per-block runtime ← the run's `actions` map, resolved against the flat `runtime` mirror
|
|
464
882
|
*
|
|
465
883
|
* Fragment props are authoritative for the denormalized fields (`title`/`description`); the
|
|
466
884
|
* node-map copy is used only as a fallback when the fragment didn't persist them.
|
|
467
885
|
*
|
|
468
886
|
* Returns `null` when the doc has no flow at all (mirrors `readCompiledFlowFromYDoc`).
|
|
469
887
|
*/
|
|
470
|
-
declare function readFlowDocument(yDoc: Doc): FlowDocumentRead | null;
|
|
888
|
+
declare function readFlowDocument(yDoc: Doc, runId?: string): FlowDocumentRead | null;
|
|
471
889
|
interface AddFlowNodeOptions {
|
|
472
890
|
/** Registry action type, e.g. `'qi/form.submit'`. Must exist in the registry. */
|
|
473
891
|
type: string;
|
|
@@ -511,7 +929,7 @@ declare function setBlockProps(yDoc: Doc, blockId: string, partial: Record<strin
|
|
|
511
929
|
* `{{nodeId.output.*}}` input ref points at this node, removal is refused and the referring
|
|
512
930
|
* node ids are returned so the caller can surface them.
|
|
513
931
|
*/
|
|
514
|
-
declare function removeFlowNode(yDoc: Doc, nodeId: string): {
|
|
932
|
+
declare function removeFlowNode(yDoc: Doc, nodeId: string, runId?: string): {
|
|
515
933
|
ok: true;
|
|
516
934
|
} | {
|
|
517
935
|
ok: false;
|
|
@@ -537,19 +955,30 @@ declare function reorderFlowNodes(yDoc: Doc, order: string[]): boolean;
|
|
|
537
955
|
* Returns `false` if either block id is missing.
|
|
538
956
|
*/
|
|
539
957
|
declare function swapFlowBlocks(yDoc: Doc, blockIdA: string, blockIdB: string): boolean;
|
|
540
|
-
/**
|
|
541
|
-
|
|
958
|
+
/**
|
|
959
|
+
* Merge a partial into a node's action state — the headless twin of the React `updateRuntime`.
|
|
960
|
+
*
|
|
961
|
+
* Goes through `writeActionState`, so the run entry and the flat mirror are
|
|
962
|
+
* written in one transaction from one resolved `prev`. A flat-only write here
|
|
963
|
+
* would be invisible to run-scoped readers the moment they land.
|
|
964
|
+
*/
|
|
965
|
+
declare function updateNodeRuntime(yDoc: Doc, blockId: string, partial: Partial<FlowNodeRuntimeState>, runId?: string): void;
|
|
542
966
|
/**
|
|
543
967
|
* Clear a failed step back to idle so the user can cleanly re-run it. The headless twin of
|
|
544
968
|
* the editor's "Reset" recovery affordance — benign and non-executing.
|
|
969
|
+
*
|
|
970
|
+
* Resetting only the flat map is the failure this exists to avoid: a surviving
|
|
971
|
+
* `completed`/`failed` run entry beats a fresh `idle` flat entry under
|
|
972
|
+
* `resolveActionState` rule (a), so "Reset" would appear to do nothing at all
|
|
973
|
+
* once readers go run-first.
|
|
545
974
|
*/
|
|
546
|
-
declare function resetStepRuntime(yDoc: Doc, blockId: string): void;
|
|
975
|
+
declare function resetStepRuntime(yDoc: Doc, blockId: string, runId?: string): void;
|
|
547
976
|
/**
|
|
548
977
|
* Pre-fill a (live) form step's answers at `runtime.output.form.answers` (a JSON string,
|
|
549
978
|
* matching `FormPanel`). Merges into existing `output`; **never** sets `state:'completed'` —
|
|
550
979
|
* submission stays the user's action.
|
|
551
980
|
*/
|
|
552
|
-
declare function setFormAnswers(yDoc: Doc, blockId: string, answers: Record<string, unknown
|
|
981
|
+
declare function setFormAnswers(yDoc: Doc, blockId: string, answers: Record<string, unknown>, runId?: string): void;
|
|
553
982
|
|
|
554
983
|
/**
|
|
555
984
|
* The operator vocabulary the FE condition evaluator actually understands
|
|
@@ -603,6 +1032,7 @@ interface ExecuteFlowAgentCoreCommandOptions {
|
|
|
603
1032
|
leaseTtlMs?: number;
|
|
604
1033
|
flowOwnerDid?: string;
|
|
605
1034
|
schemaVersion?: string;
|
|
1035
|
+
runEventLog?: RunEventAppender;
|
|
606
1036
|
now?: () => number;
|
|
607
1037
|
}
|
|
608
1038
|
interface ExecuteQueuedFlowAgentCoreCommandsOptions extends ExecuteFlowAgentCoreCommandOptions {
|
|
@@ -803,6 +1233,26 @@ declare function computeCID(content: Uint8Array): Promise<string>;
|
|
|
803
1233
|
*/
|
|
804
1234
|
declare function computeJsonCID(obj: Record<string, any>): Promise<string>;
|
|
805
1235
|
|
|
1236
|
+
declare const XERO_TOOLKIT = "xero";
|
|
1237
|
+
/**
|
|
1238
|
+
* The Xero account, organisation and bank account this flow acts through.
|
|
1239
|
+
*
|
|
1240
|
+
* Flow-level, not block-level: the binding is chosen once in the flow's
|
|
1241
|
+
* Connections and is a prerequisite of starting a session, so by the time any
|
|
1242
|
+
* action runs it is already there. Blocks therefore no longer carry their own
|
|
1243
|
+
* connection or bank-account pin — two payment blocks in one flow debiting two
|
|
1244
|
+
* different accounts was never a real case, and a per-block pin could disagree
|
|
1245
|
+
* with the account the actors were actually granted.
|
|
1246
|
+
*
|
|
1247
|
+
* Reads defensively and never throws: the doc is live and replicated, so this
|
|
1248
|
+
* can be called mid-sync.
|
|
1249
|
+
*/
|
|
1250
|
+
declare function readFlowXeroBinding(yDoc?: Doc | null): FlowConnectionBinding | undefined;
|
|
1251
|
+
/** Same, from an editor (or anything carrying `_yDoc`). */
|
|
1252
|
+
declare function readFlowXeroBindingFromEditor(editor: {
|
|
1253
|
+
_yDoc?: Doc;
|
|
1254
|
+
} | null | undefined): FlowConnectionBinding | undefined;
|
|
1255
|
+
|
|
806
1256
|
declare const oracleInitSurveySchema: {
|
|
807
1257
|
title: string;
|
|
808
1258
|
description: string;
|
|
@@ -917,4 +1367,4 @@ declare function createOracleInitFlowTemplate(): {
|
|
|
917
1367
|
nodes: FlowNode[];
|
|
918
1368
|
};
|
|
919
1369
|
|
|
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,
|
|
1370
|
+
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 CapabilityPatternCoversCanOptions, 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, actionTypeToCan, addFlowNode, appendRunTimelineEvent, appendRunTimelineEvents, boundRunActionOutput, boundRunEventJson, buildBlockConditionsProp, buildServicesFromHandlers, buildXeroInvoiceWorkKey, buildXeroPaymentWorkKey, canToActionType, canToType, capabilityPatternCoversCan, 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, normalizeCan, normalizeCapabilityPattern, 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 };
|