yaml-flow 8.6.1 → 8.6.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (96) hide show
  1. package/browser/asset-integrity.json +3 -3
  2. package/examples/board/demo-shell-with-server.html +2 -2
  3. package/examples/board/doc.html +2 -2
  4. package/examples/board/server/board-server.js +544 -45
  5. package/examples/board/server-config.json +2 -1
  6. package/examples/board/test/server-http-test.js +12 -4
  7. package/examples/board-local/demo-shell-localstorage.html +3 -3
  8. package/lib/{artifacts-store-lib-CLOtsiav.d.cts → artifacts-store-lib-BR-Samty.d.cts} +1 -1
  9. package/lib/{artifacts-store-lib-C1rtrkxm.d.ts → artifacts-store-lib-DT7XlWUL.d.ts} +1 -1
  10. package/lib/artifacts-store-public.d.cts +3 -3
  11. package/lib/artifacts-store-public.d.ts +3 -3
  12. package/lib/board-live-cards-mcp.cjs +1 -1
  13. package/lib/board-live-cards-mcp.d.cts +56 -23
  14. package/lib/board-live-cards-mcp.d.ts +56 -23
  15. package/lib/board-live-cards-mcp.js +1 -1
  16. package/lib/board-live-cards-node.cjs +8 -8
  17. package/lib/board-live-cards-node.d.cts +39 -21
  18. package/lib/board-live-cards-node.d.ts +39 -21
  19. package/lib/board-live-cards-node.js +8 -8
  20. package/lib/{board-live-cards-public-CBVjm327.d.ts → board-live-cards-public-BMUIPOrc.d.ts} +67 -42
  21. package/lib/board-live-cards-public-async-DKZqbJVU.d.ts +256 -0
  22. package/lib/board-live-cards-public-async-dMWNbWq6.d.cts +256 -0
  23. package/lib/{board-live-cards-public-CPJy-aGW.d.cts → board-live-cards-public-wkNmBIRC.d.cts} +67 -42
  24. package/lib/board-live-cards-public.cjs +1 -1
  25. package/lib/board-live-cards-public.d.cts +2 -2
  26. package/lib/board-live-cards-public.d.ts +2 -2
  27. package/lib/board-live-cards-public.js +1 -1
  28. package/lib/board-live-cards-server-runtime.cjs +1 -1
  29. package/lib/board-live-cards-server-runtime.d.cts +7 -6
  30. package/lib/board-live-cards-server-runtime.d.ts +7 -6
  31. package/lib/board-live-cards-server-runtime.js +1 -1
  32. package/lib/board-worker-adapter.cjs +4 -3
  33. package/lib/board-worker-adapter.d.cts +24 -14
  34. package/lib/board-worker-adapter.d.ts +24 -14
  35. package/lib/board-worker-adapter.js +4 -3
  36. package/lib/card-store-public.d.cts +2 -2
  37. package/lib/card-store-public.d.ts +2 -2
  38. package/lib/{chat-storage-lib-CKylihjm.d.cts → chat-storage-lib-BIUbE-fM.d.cts} +1 -1
  39. package/lib/{chat-storage-lib-Bce-xx6l.d.ts → chat-storage-lib-BlG-sobS.d.ts} +1 -1
  40. package/lib/chat-store-public.d.cts +3 -3
  41. package/lib/chat-store-public.d.ts +3 -3
  42. package/lib/{chunk-CWREBRXS.js → chunk-BQS3EIEK.js} +3 -3
  43. package/lib/{chunk-LDAP75GN.js → chunk-CIAJNUR4.js} +2 -2
  44. package/lib/chunk-GJJMEAVN.cjs +2 -0
  45. package/lib/chunk-GLIX37VG.cjs +8 -0
  46. package/lib/chunk-H5HBXPOI.cjs +3 -0
  47. package/lib/chunk-HEEDJEKM.js +2 -0
  48. package/lib/chunk-LRVAVWAG.js +8 -0
  49. package/lib/chunk-MLVTJASJ.js +2 -0
  50. package/lib/chunk-N6P2JW4W.js +3 -0
  51. package/lib/chunk-OEFTOO47.cjs +3 -0
  52. package/lib/chunk-PBCDDO4V.cjs +2 -0
  53. package/lib/{chunk-I4WH5U5D.cjs → chunk-PMUSJQSR.cjs} +2 -2
  54. package/lib/chunk-SCWHDI3I.js +2 -0
  55. package/lib/{chunk-UVE65IPR.cjs → chunk-SFVO2LB2.cjs} +3 -3
  56. package/lib/{chunk-5DB54ZX2.cjs → chunk-U2N6MCD5.cjs} +2 -2
  57. package/lib/chunk-VMW4Z6EF.js +3 -0
  58. package/lib/chunk-WOALA3V5.cjs +2 -0
  59. package/lib/{chunk-LBMEVV4U.js → chunk-XQRNDX4Q.js} +2 -2
  60. package/lib/cloud-storage.cjs +2 -0
  61. package/lib/cloud-storage.d.cts +177 -0
  62. package/lib/cloud-storage.d.ts +177 -0
  63. package/lib/cloud-storage.js +2 -0
  64. package/lib/execution-refs.cjs +1 -1
  65. package/lib/execution-refs.js +1 -1
  66. package/lib/index.cjs +2 -2
  67. package/lib/index.d.cts +1 -1
  68. package/lib/index.d.ts +1 -1
  69. package/lib/index.js +1 -1
  70. package/lib/{types-DRl0Hy_p.d.cts → queue-lane-registry-BPKWWgd4.d.cts} +66 -14
  71. package/lib/{types-BuK2UMxk.d.ts → queue-lane-registry-Be6c0ftj.d.ts} +66 -14
  72. package/lib/server-runtime/index.cjs +1 -1
  73. package/lib/server-runtime/index.d.cts +18 -7
  74. package/lib/server-runtime/index.d.ts +18 -7
  75. package/lib/server-runtime/index.js +1 -1
  76. package/lib/step-machine-public/index.cjs +1 -1
  77. package/lib/step-machine-public/index.d.cts +1 -1
  78. package/lib/step-machine-public/index.d.ts +1 -1
  79. package/lib/step-machine-public/index.js +1 -1
  80. package/lib/{storage-interface-Ct-C4tlz.d.cts → storage-interface-BFiD3kyB.d.cts} +11 -1
  81. package/lib/{storage-interface-Ct-C4tlz.d.ts → storage-interface-BFiD3kyB.d.ts} +11 -1
  82. package/lib/stores/index.cjs +1 -1
  83. package/lib/stores/index.d.cts +1 -1
  84. package/lib/stores/index.d.ts +1 -1
  85. package/lib/stores/index.js +1 -1
  86. package/lib/stores/kv.d.cts +1 -1
  87. package/lib/stores/kv.d.ts +1 -1
  88. package/package.json +6 -1
  89. package/lib/chunk-6APH25VI.js +0 -2
  90. package/lib/chunk-KNFFDVLD.cjs +0 -2
  91. package/lib/chunk-LVNQCE5X.cjs +0 -3
  92. package/lib/chunk-M7EQRS6W.js +0 -3
  93. package/lib/chunk-NJJ7WEDT.cjs +0 -2
  94. package/lib/chunk-P64UKI3L.cjs +0 -8
  95. package/lib/chunk-Q6VSL327.js +0 -8
  96. package/lib/chunk-VCCTAUIG.js +0 -2
@@ -1,9 +1,13 @@
1
- import { a as ArtifactsStore } from './artifacts-store-lib-CLOtsiav.cjs';
2
- import { e as BoardPlatformAdapter, d as BoardNonCorePlatformAdapter, C as CommandResult } from './board-live-cards-public-CPJy-aGW.cjs';
1
+ import { a as ArtifactsStore } from './artifacts-store-lib-BR-Samty.cjs';
2
+ import { f as BoardPlatformAdapter, e as BoardNonCorePlatformAdapter, d as BoardLiveCardsPublic, C as CommandResult, B as BoardWorkerRequest } from './board-live-cards-public-wkNmBIRC.cjs';
3
+ import { a as AsyncBoardPlatformAdapter, A as AsyncBoardLiveCardsPublic } from './board-live-cards-public-async-dMWNbWq6.cjs';
3
4
  import { ExecutionRef } from './execution-refs.cjs';
4
- import { a as KindValueRef } from './storage-interface-Ct-C4tlz.cjs';
5
- import { c as ChatStorage } from './chat-storage-lib-CKylihjm.cjs';
5
+ import { a as KindValueRef } from './storage-interface-BFiD3kyB.cjs';
6
+ import { c as ChatStorage } from './chat-storage-lib-BIUbE-fM.cjs';
6
7
 
8
+ type Awaitable<T> = T | Promise<T>;
9
+ type BoardRuntimePlatformAdapter = BoardPlatformAdapter | AsyncBoardPlatformAdapter;
10
+ type BoardRuntimePublic = BoardLiveCardsPublic | AsyncBoardLiveCardsPublic;
7
11
  interface InvocationAdapter {
8
12
  /**
9
13
  * Fire-and-forget invocation of an ExecutionRef with args.
@@ -61,12 +65,23 @@ interface RuntimeLogger {
61
65
  warn(msg: string, ...args: unknown[]): void;
62
66
  error(msg: string, ...args: unknown[]): void;
63
67
  }
68
+ interface QueueLaneRuntimeTuning {
69
+ pollIntervalMs?: number;
70
+ visibilityMs?: number;
71
+ concurrency?: number;
72
+ maxAttempts?: number;
73
+ }
74
+ interface HostedBoardQueueLaneTuning {
75
+ processAccumulated?: QueueLaneRuntimeTuning;
76
+ chatAgent?: QueueLaneRuntimeTuning;
77
+ taskExecutor?: QueueLaneRuntimeTuning;
78
+ }
64
79
  interface BoardContextConfig {
65
80
  label: string;
66
- boardAdapter: BoardPlatformAdapter;
81
+ boardAdapter: BoardRuntimePlatformAdapter;
67
82
  nonCoreAdapter?: BoardNonCorePlatformAdapter;
68
83
  /** Optional separate adapter for file/chat blob storage (defaults to boardAdapter) */
69
- artifactsAdapter?: BoardPlatformAdapter;
84
+ artifactsAdapter?: BoardRuntimePlatformAdapter;
70
85
  /** Optional explicit blob root ref for persisted card/file attachments. */
71
86
  artifactsStoreRef?: string;
72
87
  /**
@@ -104,6 +119,7 @@ interface SingleBoardRuntimeOptions {
104
119
  notificationTransport?: NotificationTransport;
105
120
  logger?: RuntimeLogger;
106
121
  serverUrl?: string;
122
+ queueLaneTuning?: HostedBoardQueueLaneTuning;
107
123
  /** Extra host-specific fields baked into execution ref extras */
108
124
  executionExtra?: Record<string, unknown>;
109
125
  /** Called when an SSE client connects. The writer injects a single SSE data frame. */
@@ -134,32 +150,39 @@ interface MultiBoardRuntimeOptions {
134
150
  interface SingleBoardRuntime {
135
151
  readonly apiBasePath: string;
136
152
  readonly corsHeaders: Record<string, string>;
153
+ readonly queueLaneTuning: HostedBoardQueueLaneTuning;
137
154
  handleRuntimeApi(req: RuntimeRequest, res: RuntimeResponse, parsedUrl: URL): Promise<boolean>;
138
- buildPublishedRuntimePayload(): unknown;
155
+ buildPublishedRuntimePayload(): Awaitable<unknown>;
156
+ processAccumulatedEvents(): Awaitable<CommandResult>;
157
+ processAccumulatedLane(): Awaitable<CommandResult>;
158
+ handleChatAgentRequest(request: BoardWorkerRequest): Awaitable<void>;
139
159
  clearChatRecords(cardId: string): void;
140
160
  /** Report that a source fetch completed. Token is the source callback token; ref is the blob ref (b64:<base64url(json)>). */
141
- reportSourceFetched(token: string, ref: string): CommandResult;
161
+ reportSourceFetched(token: string, ref: string): Awaitable<CommandResult>;
142
162
  /** Report that a source fetch failed. Token is the source callback token. */
143
- reportSourceFetchFailure(token: string, reason: string): CommandResult;
163
+ reportSourceFetchFailure(token: string, reason: string): Awaitable<CommandResult>;
144
164
  /** Exposed card store — host calls cardStore.set({body: cards}) to seed definitions. */
145
165
  readonly cardStore: {
146
166
  get(input: {
147
167
  params?: {
148
168
  id?: string;
149
169
  };
150
- }): {
170
+ }): Awaitable<{
151
171
  status: string;
152
172
  data?: {
153
173
  cards?: Array<Record<string, unknown>>;
154
174
  };
155
175
  error?: string;
156
- };
176
+ }>;
157
177
  set(input: {
158
178
  body: unknown;
159
- }): {
179
+ }): Awaitable<{
160
180
  status: string;
181
+ data?: {
182
+ count?: number;
183
+ };
161
184
  error?: string;
162
- };
185
+ }>;
163
186
  };
164
187
  }
165
188
  interface MultiBoardRuntime {
@@ -183,4 +206,33 @@ interface RuntimeResponse {
183
206
  end(data?: string | Buffer): void;
184
207
  }
185
208
 
186
- export type { BoardContextConfig as B, ChatHandlerFlowRunner as C, DescribeEnvelope as D, InvocationAdapter as I, MultiBoardRuntimeOptions as M, NotificationTransport as N, RuntimeLogger as R, SingleBoardRuntimeOptions as S, MultiBoardRuntime as a, SingleBoardRuntime as b, RuntimeRequest as c, RuntimeResponse as d };
209
+ type QueueLaneAwaitable<T> = T | Promise<T>;
210
+ interface QueueLaneLease<TMessage = unknown> {
211
+ id: string;
212
+ attempt: number;
213
+ message: TMessage;
214
+ ack(): QueueLaneAwaitable<boolean>;
215
+ nack(opts?: {
216
+ dead?: boolean;
217
+ reason?: string;
218
+ }): QueueLaneAwaitable<boolean>;
219
+ }
220
+ interface QueueLaneDescriptor<TMessage = unknown> {
221
+ id: string;
222
+ pollIntervalMs?: number;
223
+ visibilityMs?: number;
224
+ concurrency?: number;
225
+ maxAttempts?: number;
226
+ lease(opts?: {
227
+ max?: number;
228
+ visibilityMs?: number;
229
+ }): QueueLaneAwaitable<QueueLaneLease<TMessage>[]>;
230
+ handle(message: TMessage, lease: QueueLaneLease<TMessage>): Promise<void>;
231
+ onError?: (error: unknown, lease: QueueLaneLease<TMessage>) => void;
232
+ }
233
+ interface QueueLaneRegistry {
234
+ lanes: QueueLaneDescriptor[];
235
+ }
236
+ declare function createQueueLaneRegistry(lanes: QueueLaneDescriptor[]): QueueLaneRegistry;
237
+
238
+ export { type Awaitable as A, type BoardRuntimePlatformAdapter as B, type ChatHandlerFlowRunner as C, type DescribeEnvelope as D, type HostedBoardQueueLaneTuning as H, type InvocationAdapter as I, type MultiBoardRuntimeOptions as M, type NotificationTransport as N, type QueueLaneRegistry as Q, type RuntimeLogger as R, type SingleBoardRuntime as S, type MultiBoardRuntime as a, type SingleBoardRuntimeOptions as b, type BoardContextConfig as c, type BoardRuntimePublic as d, type QueueLaneRuntimeTuning as e, type RuntimeRequest as f, type RuntimeResponse as g, type QueueLaneLease as h, type QueueLaneDescriptor as i, createQueueLaneRegistry as j };
@@ -1,9 +1,13 @@
1
- import { a as ArtifactsStore } from './artifacts-store-lib-C1rtrkxm.js';
2
- import { e as BoardPlatformAdapter, d as BoardNonCorePlatformAdapter, C as CommandResult } from './board-live-cards-public-CBVjm327.js';
1
+ import { a as ArtifactsStore } from './artifacts-store-lib-DT7XlWUL.js';
2
+ import { f as BoardPlatformAdapter, e as BoardNonCorePlatformAdapter, d as BoardLiveCardsPublic, C as CommandResult, B as BoardWorkerRequest } from './board-live-cards-public-BMUIPOrc.js';
3
+ import { a as AsyncBoardPlatformAdapter, A as AsyncBoardLiveCardsPublic } from './board-live-cards-public-async-DKZqbJVU.js';
3
4
  import { ExecutionRef } from './execution-refs.js';
4
- import { a as KindValueRef } from './storage-interface-Ct-C4tlz.js';
5
- import { c as ChatStorage } from './chat-storage-lib-Bce-xx6l.js';
5
+ import { a as KindValueRef } from './storage-interface-BFiD3kyB.js';
6
+ import { c as ChatStorage } from './chat-storage-lib-BlG-sobS.js';
6
7
 
8
+ type Awaitable<T> = T | Promise<T>;
9
+ type BoardRuntimePlatformAdapter = BoardPlatformAdapter | AsyncBoardPlatformAdapter;
10
+ type BoardRuntimePublic = BoardLiveCardsPublic | AsyncBoardLiveCardsPublic;
7
11
  interface InvocationAdapter {
8
12
  /**
9
13
  * Fire-and-forget invocation of an ExecutionRef with args.
@@ -61,12 +65,23 @@ interface RuntimeLogger {
61
65
  warn(msg: string, ...args: unknown[]): void;
62
66
  error(msg: string, ...args: unknown[]): void;
63
67
  }
68
+ interface QueueLaneRuntimeTuning {
69
+ pollIntervalMs?: number;
70
+ visibilityMs?: number;
71
+ concurrency?: number;
72
+ maxAttempts?: number;
73
+ }
74
+ interface HostedBoardQueueLaneTuning {
75
+ processAccumulated?: QueueLaneRuntimeTuning;
76
+ chatAgent?: QueueLaneRuntimeTuning;
77
+ taskExecutor?: QueueLaneRuntimeTuning;
78
+ }
64
79
  interface BoardContextConfig {
65
80
  label: string;
66
- boardAdapter: BoardPlatformAdapter;
81
+ boardAdapter: BoardRuntimePlatformAdapter;
67
82
  nonCoreAdapter?: BoardNonCorePlatformAdapter;
68
83
  /** Optional separate adapter for file/chat blob storage (defaults to boardAdapter) */
69
- artifactsAdapter?: BoardPlatformAdapter;
84
+ artifactsAdapter?: BoardRuntimePlatformAdapter;
70
85
  /** Optional explicit blob root ref for persisted card/file attachments. */
71
86
  artifactsStoreRef?: string;
72
87
  /**
@@ -104,6 +119,7 @@ interface SingleBoardRuntimeOptions {
104
119
  notificationTransport?: NotificationTransport;
105
120
  logger?: RuntimeLogger;
106
121
  serverUrl?: string;
122
+ queueLaneTuning?: HostedBoardQueueLaneTuning;
107
123
  /** Extra host-specific fields baked into execution ref extras */
108
124
  executionExtra?: Record<string, unknown>;
109
125
  /** Called when an SSE client connects. The writer injects a single SSE data frame. */
@@ -134,32 +150,39 @@ interface MultiBoardRuntimeOptions {
134
150
  interface SingleBoardRuntime {
135
151
  readonly apiBasePath: string;
136
152
  readonly corsHeaders: Record<string, string>;
153
+ readonly queueLaneTuning: HostedBoardQueueLaneTuning;
137
154
  handleRuntimeApi(req: RuntimeRequest, res: RuntimeResponse, parsedUrl: URL): Promise<boolean>;
138
- buildPublishedRuntimePayload(): unknown;
155
+ buildPublishedRuntimePayload(): Awaitable<unknown>;
156
+ processAccumulatedEvents(): Awaitable<CommandResult>;
157
+ processAccumulatedLane(): Awaitable<CommandResult>;
158
+ handleChatAgentRequest(request: BoardWorkerRequest): Awaitable<void>;
139
159
  clearChatRecords(cardId: string): void;
140
160
  /** Report that a source fetch completed. Token is the source callback token; ref is the blob ref (b64:<base64url(json)>). */
141
- reportSourceFetched(token: string, ref: string): CommandResult;
161
+ reportSourceFetched(token: string, ref: string): Awaitable<CommandResult>;
142
162
  /** Report that a source fetch failed. Token is the source callback token. */
143
- reportSourceFetchFailure(token: string, reason: string): CommandResult;
163
+ reportSourceFetchFailure(token: string, reason: string): Awaitable<CommandResult>;
144
164
  /** Exposed card store — host calls cardStore.set({body: cards}) to seed definitions. */
145
165
  readonly cardStore: {
146
166
  get(input: {
147
167
  params?: {
148
168
  id?: string;
149
169
  };
150
- }): {
170
+ }): Awaitable<{
151
171
  status: string;
152
172
  data?: {
153
173
  cards?: Array<Record<string, unknown>>;
154
174
  };
155
175
  error?: string;
156
- };
176
+ }>;
157
177
  set(input: {
158
178
  body: unknown;
159
- }): {
179
+ }): Awaitable<{
160
180
  status: string;
181
+ data?: {
182
+ count?: number;
183
+ };
161
184
  error?: string;
162
- };
185
+ }>;
163
186
  };
164
187
  }
165
188
  interface MultiBoardRuntime {
@@ -183,4 +206,33 @@ interface RuntimeResponse {
183
206
  end(data?: string | Buffer): void;
184
207
  }
185
208
 
186
- export type { BoardContextConfig as B, ChatHandlerFlowRunner as C, DescribeEnvelope as D, InvocationAdapter as I, MultiBoardRuntimeOptions as M, NotificationTransport as N, RuntimeLogger as R, SingleBoardRuntimeOptions as S, MultiBoardRuntime as a, SingleBoardRuntime as b, RuntimeRequest as c, RuntimeResponse as d };
209
+ type QueueLaneAwaitable<T> = T | Promise<T>;
210
+ interface QueueLaneLease<TMessage = unknown> {
211
+ id: string;
212
+ attempt: number;
213
+ message: TMessage;
214
+ ack(): QueueLaneAwaitable<boolean>;
215
+ nack(opts?: {
216
+ dead?: boolean;
217
+ reason?: string;
218
+ }): QueueLaneAwaitable<boolean>;
219
+ }
220
+ interface QueueLaneDescriptor<TMessage = unknown> {
221
+ id: string;
222
+ pollIntervalMs?: number;
223
+ visibilityMs?: number;
224
+ concurrency?: number;
225
+ maxAttempts?: number;
226
+ lease(opts?: {
227
+ max?: number;
228
+ visibilityMs?: number;
229
+ }): QueueLaneAwaitable<QueueLaneLease<TMessage>[]>;
230
+ handle(message: TMessage, lease: QueueLaneLease<TMessage>): Promise<void>;
231
+ onError?: (error: unknown, lease: QueueLaneLease<TMessage>) => void;
232
+ }
233
+ interface QueueLaneRegistry {
234
+ lanes: QueueLaneDescriptor[];
235
+ }
236
+ declare function createQueueLaneRegistry(lanes: QueueLaneDescriptor[]): QueueLaneRegistry;
237
+
238
+ export { type Awaitable as A, type BoardRuntimePlatformAdapter as B, type ChatHandlerFlowRunner as C, type DescribeEnvelope as D, type HostedBoardQueueLaneTuning as H, type InvocationAdapter as I, type MultiBoardRuntimeOptions as M, type NotificationTransport as N, type QueueLaneRegistry as Q, type RuntimeLogger as R, type SingleBoardRuntime as S, type MultiBoardRuntime as a, type SingleBoardRuntimeOptions as b, type BoardContextConfig as c, type BoardRuntimePublic as d, type QueueLaneRuntimeTuning as e, type RuntimeRequest as f, type RuntimeResponse as g, type QueueLaneLease as h, type QueueLaneDescriptor as i, createQueueLaneRegistry as j };
@@ -1,2 +1,2 @@
1
- 'use strict';var chunkP64UKI3L_cjs=require('../chunk-P64UKI3L.cjs');require('../chunk-NJJ7WEDT.cjs'),require('../chunk-LVNQCE5X.cjs'),require('../chunk-5DB54ZX2.cjs'),require('../chunk-UVE65IPR.cjs'),require('../chunk-G4XXRHL2.cjs'),require('../chunk-LODXIALE.cjs'),require('../chunk-KNFFDVLD.cjs'),require('../chunk-IXZG74EW.cjs'),require('../chunk-NMZ6XNLB.cjs'),require('../chunk-YMEIPKLW.cjs'),require('../chunk-GYQXDNNI.cjs'),require('../chunk-UJ7ZTV4J.cjs'),require('../chunk-GNFE24S7.cjs');Object.defineProperty(exports,"createMultiBoardServerRuntime",{enumerable:true,get:function(){return chunkP64UKI3L_cjs.b}});Object.defineProperty(exports,"createSingleBoardServerRuntime",{enumerable:true,get:function(){return chunkP64UKI3L_cjs.a}});//# sourceMappingURL=index.cjs.map
1
+ 'use strict';var chunkGLIX37VG_cjs=require('../chunk-GLIX37VG.cjs');require('../chunk-WOALA3V5.cjs'),require('../chunk-H5HBXPOI.cjs'),require('../chunk-PBCDDO4V.cjs'),require('../chunk-OEFTOO47.cjs'),require('../chunk-U2N6MCD5.cjs'),require('../chunk-SFVO2LB2.cjs'),require('../chunk-G4XXRHL2.cjs'),require('../chunk-LODXIALE.cjs'),require('../chunk-GJJMEAVN.cjs'),require('../chunk-IXZG74EW.cjs'),require('../chunk-NMZ6XNLB.cjs'),require('../chunk-UJ7ZTV4J.cjs'),require('../chunk-YMEIPKLW.cjs'),require('../chunk-GYQXDNNI.cjs'),require('../chunk-GNFE24S7.cjs');Object.defineProperty(exports,"createHostedBoardQueueLaneRegistry",{enumerable:true,get:function(){return chunkGLIX37VG_cjs.a}});Object.defineProperty(exports,"createMultiBoardServerRuntime",{enumerable:true,get:function(){return chunkGLIX37VG_cjs.c}});Object.defineProperty(exports,"createSingleBoardServerRuntime",{enumerable:true,get:function(){return chunkGLIX37VG_cjs.b}});//# sourceMappingURL=index.cjs.map
2
2
  //# sourceMappingURL=index.cjs.map
@@ -1,12 +1,23 @@
1
- import { M as MultiBoardRuntimeOptions, a as MultiBoardRuntime, S as SingleBoardRuntimeOptions, b as SingleBoardRuntime } from '../types-DRl0Hy_p.cjs';
2
- export { B as BoardContextConfig, C as ChatHandlerFlowRunner, D as DescribeEnvelope, I as InvocationAdapter, N as NotificationTransport, R as RuntimeLogger, c as RuntimeRequest, d as RuntimeResponse } from '../types-DRl0Hy_p.cjs';
3
- export { B as BlobStorage, K as KVStorage, a as KindValueRef } from '../storage-interface-Ct-C4tlz.cjs';
4
- export { B as BoardChangeNotification, c as BoardLiveCardsPublic, d as BoardNonCorePlatformAdapter, e as BoardPlatformAdapter, a as CommandInput, C as CommandResult } from '../board-live-cards-public-CPJy-aGW.cjs';
5
- export { c as ChatStorage } from '../chat-storage-lib-CKylihjm.cjs';
1
+ import { S as SingleBoardRuntime, B as BoardRuntimePlatformAdapter, R as RuntimeLogger, Q as QueueLaneRegistry, M as MultiBoardRuntimeOptions, a as MultiBoardRuntime, b as SingleBoardRuntimeOptions } from '../queue-lane-registry-BPKWWgd4.cjs';
2
+ export { A as Awaitable, c as BoardContextConfig, d as BoardRuntimePublic, C as ChatHandlerFlowRunner, D as DescribeEnvelope, H as HostedBoardQueueLaneTuning, I as InvocationAdapter, N as NotificationTransport, e as QueueLaneRuntimeTuning, f as RuntimeRequest, g as RuntimeResponse } from '../queue-lane-registry-BPKWWgd4.cjs';
3
+ import { B as BoardWorkerRequest } from '../board-live-cards-public-wkNmBIRC.cjs';
4
+ export { c as BoardChangeNotification, d as BoardLiveCardsPublic, e as BoardNonCorePlatformAdapter, f as BoardPlatformAdapter, a as CommandInput, C as CommandResult } from '../board-live-cards-public-wkNmBIRC.cjs';
5
+ export { A as AsyncBoardLiveCardsPublic, a as AsyncBoardPlatformAdapter } from '../board-live-cards-public-async-dMWNbWq6.cjs';
6
+ export { B as BlobStorage, K as KVStorage, a as KindValueRef } from '../storage-interface-BFiD3kyB.cjs';
7
+ export { c as ChatStorage } from '../chat-storage-lib-BIUbE-fM.cjs';
6
8
  export { ExecutionRef } from '../execution-refs.cjs';
7
- import '../artifacts-store-lib-CLOtsiav.cjs';
9
+ import '../artifacts-store-lib-BR-Samty.cjs';
8
10
  import '../types-BBhqYGhE.cjs';
9
11
 
12
+ interface HostedBoardQueueLaneRegistryOptions {
13
+ boardId: string;
14
+ runtime: Pick<SingleBoardRuntime, 'processAccumulatedLane' | 'handleChatAgentRequest' | 'queueLaneTuning'>;
15
+ boardAdapter: BoardRuntimePlatformAdapter;
16
+ logger?: RuntimeLogger;
17
+ executeTaskExecutorRequest?: (args: Record<string, unknown>, request: BoardWorkerRequest) => Promise<void>;
18
+ }
19
+ declare function createHostedBoardQueueLaneRegistry(opts: HostedBoardQueueLaneRegistryOptions): QueueLaneRegistry;
20
+
10
21
  /**
11
22
  * server-runtime/index.ts
12
23
  *
@@ -30,4 +41,4 @@ import '../types-BBhqYGhE.cjs';
30
41
  declare function createSingleBoardServerRuntime(options: SingleBoardRuntimeOptions): SingleBoardRuntime;
31
42
  declare function createMultiBoardServerRuntime(options: MultiBoardRuntimeOptions): MultiBoardRuntime;
32
43
 
33
- export { MultiBoardRuntime, MultiBoardRuntimeOptions, SingleBoardRuntime, SingleBoardRuntimeOptions, createMultiBoardServerRuntime, createSingleBoardServerRuntime };
44
+ export { BoardRuntimePlatformAdapter, BoardWorkerRequest, type HostedBoardQueueLaneRegistryOptions, MultiBoardRuntime, MultiBoardRuntimeOptions, RuntimeLogger, SingleBoardRuntime, SingleBoardRuntimeOptions, createHostedBoardQueueLaneRegistry, createMultiBoardServerRuntime, createSingleBoardServerRuntime };
@@ -1,12 +1,23 @@
1
- import { M as MultiBoardRuntimeOptions, a as MultiBoardRuntime, S as SingleBoardRuntimeOptions, b as SingleBoardRuntime } from '../types-BuK2UMxk.js';
2
- export { B as BoardContextConfig, C as ChatHandlerFlowRunner, D as DescribeEnvelope, I as InvocationAdapter, N as NotificationTransport, R as RuntimeLogger, c as RuntimeRequest, d as RuntimeResponse } from '../types-BuK2UMxk.js';
3
- export { B as BlobStorage, K as KVStorage, a as KindValueRef } from '../storage-interface-Ct-C4tlz.js';
4
- export { B as BoardChangeNotification, c as BoardLiveCardsPublic, d as BoardNonCorePlatformAdapter, e as BoardPlatformAdapter, a as CommandInput, C as CommandResult } from '../board-live-cards-public-CBVjm327.js';
5
- export { c as ChatStorage } from '../chat-storage-lib-Bce-xx6l.js';
1
+ import { S as SingleBoardRuntime, B as BoardRuntimePlatformAdapter, R as RuntimeLogger, Q as QueueLaneRegistry, M as MultiBoardRuntimeOptions, a as MultiBoardRuntime, b as SingleBoardRuntimeOptions } from '../queue-lane-registry-Be6c0ftj.js';
2
+ export { A as Awaitable, c as BoardContextConfig, d as BoardRuntimePublic, C as ChatHandlerFlowRunner, D as DescribeEnvelope, H as HostedBoardQueueLaneTuning, I as InvocationAdapter, N as NotificationTransport, e as QueueLaneRuntimeTuning, f as RuntimeRequest, g as RuntimeResponse } from '../queue-lane-registry-Be6c0ftj.js';
3
+ import { B as BoardWorkerRequest } from '../board-live-cards-public-BMUIPOrc.js';
4
+ export { c as BoardChangeNotification, d as BoardLiveCardsPublic, e as BoardNonCorePlatformAdapter, f as BoardPlatformAdapter, a as CommandInput, C as CommandResult } from '../board-live-cards-public-BMUIPOrc.js';
5
+ export { A as AsyncBoardLiveCardsPublic, a as AsyncBoardPlatformAdapter } from '../board-live-cards-public-async-DKZqbJVU.js';
6
+ export { B as BlobStorage, K as KVStorage, a as KindValueRef } from '../storage-interface-BFiD3kyB.js';
7
+ export { c as ChatStorage } from '../chat-storage-lib-BlG-sobS.js';
6
8
  export { ExecutionRef } from '../execution-refs.js';
7
- import '../artifacts-store-lib-C1rtrkxm.js';
9
+ import '../artifacts-store-lib-DT7XlWUL.js';
8
10
  import '../types-BBhqYGhE.js';
9
11
 
12
+ interface HostedBoardQueueLaneRegistryOptions {
13
+ boardId: string;
14
+ runtime: Pick<SingleBoardRuntime, 'processAccumulatedLane' | 'handleChatAgentRequest' | 'queueLaneTuning'>;
15
+ boardAdapter: BoardRuntimePlatformAdapter;
16
+ logger?: RuntimeLogger;
17
+ executeTaskExecutorRequest?: (args: Record<string, unknown>, request: BoardWorkerRequest) => Promise<void>;
18
+ }
19
+ declare function createHostedBoardQueueLaneRegistry(opts: HostedBoardQueueLaneRegistryOptions): QueueLaneRegistry;
20
+
10
21
  /**
11
22
  * server-runtime/index.ts
12
23
  *
@@ -30,4 +41,4 @@ import '../types-BBhqYGhE.js';
30
41
  declare function createSingleBoardServerRuntime(options: SingleBoardRuntimeOptions): SingleBoardRuntime;
31
42
  declare function createMultiBoardServerRuntime(options: MultiBoardRuntimeOptions): MultiBoardRuntime;
32
43
 
33
- export { MultiBoardRuntime, MultiBoardRuntimeOptions, SingleBoardRuntime, SingleBoardRuntimeOptions, createMultiBoardServerRuntime, createSingleBoardServerRuntime };
44
+ export { BoardRuntimePlatformAdapter, BoardWorkerRequest, type HostedBoardQueueLaneRegistryOptions, MultiBoardRuntime, MultiBoardRuntimeOptions, RuntimeLogger, SingleBoardRuntime, SingleBoardRuntimeOptions, createHostedBoardQueueLaneRegistry, createMultiBoardServerRuntime, createSingleBoardServerRuntime };
@@ -1,2 +1,2 @@
1
- export{b as createMultiBoardServerRuntime,a as createSingleBoardServerRuntime}from'../chunk-Q6VSL327.js';import'../chunk-6APH25VI.js';import'../chunk-M7EQRS6W.js';import'../chunk-LBMEVV4U.js';import'../chunk-CWREBRXS.js';import'../chunk-VGT3TRQG.js';import'../chunk-WDPOGXTY.js';import'../chunk-VCCTAUIG.js';import'../chunk-JMDHDY6M.js';import'../chunk-VLBB3D6B.js';import'../chunk-KBELAKIY.js';import'../chunk-76ON3V7R.js';import'../chunk-MNEOJWPS.js';import'../chunk-FW4363Y4.js';//# sourceMappingURL=index.js.map
1
+ export{a as createHostedBoardQueueLaneRegistry,c as createMultiBoardServerRuntime,b as createSingleBoardServerRuntime}from'../chunk-LRVAVWAG.js';import'../chunk-MLVTJASJ.js';import'../chunk-VMW4Z6EF.js';import'../chunk-HEEDJEKM.js';import'../chunk-N6P2JW4W.js';import'../chunk-XQRNDX4Q.js';import'../chunk-BQS3EIEK.js';import'../chunk-VGT3TRQG.js';import'../chunk-WDPOGXTY.js';import'../chunk-SCWHDI3I.js';import'../chunk-JMDHDY6M.js';import'../chunk-VLBB3D6B.js';import'../chunk-MNEOJWPS.js';import'../chunk-KBELAKIY.js';import'../chunk-76ON3V7R.js';import'../chunk-FW4363Y4.js';//# sourceMappingURL=index.js.map
2
2
  //# sourceMappingURL=index.js.map
@@ -1,2 +1,2 @@
1
- 'use strict';var chunkI4WH5U5D_cjs=require('../chunk-I4WH5U5D.cjs'),chunkKHJABJ45_cjs=require('../chunk-KHJABJ45.cjs'),chunkUVE65IPR_cjs=require('../chunk-UVE65IPR.cjs'),chunkQ6H7NINN_cjs=require('../chunk-Q6H7NINN.cjs'),chunkH5KD3JPY_cjs=require('../chunk-H5KD3JPY.cjs');require('../chunk-UJ7ZTV4J.cjs'),require('../chunk-GNFE24S7.cjs');var module$1=require('module'),url=require('url'),path=require('path'),fs=require('fs');var _documentCurrentScript=typeof document!=='undefined'?document.currentScript:null;var C=path.dirname(url.fileURLToPath((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('index.cjs', document.baseURI).href)))),K=module$1.createRequire((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('index.cjs', document.baseURI).href)));function L(){let r=path.resolve(C,"./jsonata-sync.cjs");return fs.existsSync(r)?r:path.resolve(C,"../card-compute/jsonata-sync.cjs")}var h=K(L());function T(r,e){if(!r||typeof r!="object")throw new Error(`[step-machine-public] Step "${e}" returned a non-object result.`);let t=r,n=t.result??t.status;if(typeof n=="string"&&n.trim().length>0){let o=t.data&&typeof t.data=="object"&&!Array.isArray(t.data)?{...t.data}:{},a=typeof t.error=="string"?t.error:void 0;return a&&!("error"in o)&&(o.error=a),{result:n,data:o,...a?{error:a}:{}}}return {result:"success",data:{...t}}}function $(r,e){if(!e||e.length===0)return r;let t={};for(let n of e)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n]);return t}function x(r,e){return async(t,n)=>{let o=await r(t,n),a=T(o,n?.stepName??"unknown");return {result:a.result,data:$(a.data,e),...a.error?{error:a.error}:{}}}}function M(r,e,t){if(!e||e.length===0)return null;for(let n of e)try{if(!h(n).evaluate(r))return {result:"failure",data:{error:`[${t}] input validation failed: ${n}`}}}catch(o){let a=o instanceof Error?o.message:String(o);return {result:"failure",data:{error:`[${t}] input validation error on "${n}": ${a}`}}}return null}function F(r,e,t){return !e||e.length===0?r:async(n,o)=>{let a=M(n,e,t);return a||r(n,o)}}function A(r){return !!r&&typeof r=="object"&&r.type==="compute-jsonata"&&Array.isArray(r.expr)&&r.expr.length>0}function O(r){if(!r||typeof r!="object")return false;let e=r;if(e.type!=="ref"||typeof e.howToRun!="string")return false;if(typeof e.whatToRun=="string")return true;if(e.whatToRun&&typeof e.whatToRun=="object"){let t=e.whatToRun;return typeof t.kind=="string"&&typeof t.value=="string"}return false}function U(r){if(typeof r=="string"){let e=r.indexOf("=");if(e<1)throw new Error(`[step-machine-public] Invalid compute expression (missing "="): "${r}"`);return {bindTo:r.slice(0,e).trim(),expr:r.slice(e+1).trim()}}if(r&&typeof r=="object"&&typeof r.bindTo=="string"&&typeof r.expr=="string")return r;throw new Error(`[step-machine-public] Invalid compute step: ${JSON.stringify(r)}`)}function G(r,e,t){let n=e.split("."),o=r;for(let a=0;a<n.length-1;a++){let s=n[a];(o[s]==null||typeof o[s]!="object")&&(o[s]={}),o=o[s];}o[n[n.length-1]]=t;}function I(r,e,t){let n=r.expr.map(U);return async o=>{let a=o&&typeof o=="object"&&!Array.isArray(o)?{...o}:{},s={},l={expects_data:a,data:s,...t?{config:t}:{}},p,i;for(let u of n)try{let c=h(u.expr).evaluate(l);if(u.bindTo==="result")p=c!=null?String(c):"success";else if(u.bindTo==="error")i=c!=null?String(c):void 0;else if(u.bindTo.startsWith("data."))G(s,u.bindTo.slice(5),c);else return {result:"failure",data:{},error:`[${e}] invalid bindTo "${u.bindTo}": must be "result", "error", or start with "data."`}}catch(c){let d=c instanceof Error?c.message:String(c);return {result:"failure",data:{},error:`[${e}] compute "${u.bindTo}" failed: ${d}`}}return p===void 0?{result:"failure",data:{},error:`[${e}] compute-jsonata: no "result" binding declared \u2014 add '- result = "success"' to expr`}:i?{result:p,data:s,error:i}:{result:p,data:s}}}function E(r,e,t,n){let{type:o,...a}=r,s={...a,whatToRun:typeof a.whatToRun=="object"?chunkUVE65IPR_cjs.a(a.whatToRun):a.whatToRun};return async l=>{let p=l&&typeof l=="object"&&!Array.isArray(l)?{...l}:{};n&&(p.config=n);try{let i=await t(s,p);if(!r.outputTransforms)return i;if(i&&i.result!=="success"){let u=i.data&&typeof i.data.error=="string"?String(i.data.error):void 0;return u&&!i.error?{...i,error:u}:i}try{return chunkI4WH5U5D_cjs.b(r.outputTransforms,i,e)}catch(u){let c=u instanceof Error?u.message:String(u);return {result:"failure",data:{},error:c}}}catch(i){let u=i instanceof Error?i.message:String(i);return {result:"failure",data:{error:`[step-machine-public] step "${e}" invoke threw: ${u}`}}}}}function z(){return async r=>({result:"success",data:r&&typeof r=="object"&&!Array.isArray(r)?r:{}})}function Q(r,e,t){return async(n,o)=>{let a=n?.[e.items];if(!Array.isArray(a))return {result:"failure",data:{},error:`[${t}] forEach: "${e.items}" is not an array (got ${typeof a})`};let s=a,l=e.collectAs??`${e.items}_results`;if(s.length===0)return {result:"success",data:{[l]:[]}};let{[e.items]:p,...i}=n,u=Math.max(1,e.concurrency??1),c=new Array(s.length),d=0,w=0,S=0;return await new Promise(g=>{function f(){for(;d<u&&w<s.length;){let y=w++;d++;let _={...i,[e.as]:s[y]};r(_,o).then(m=>{c[y]=m;}).catch(m=>{let P=m instanceof Error?m.message:String(m);c[y]={result:"failure",data:{},error:P};}).finally(()=>{d--,c[y]?.result==="failure"&&S++,w>=s.length&&d===0?g():f();});}d===0&&w>=s.length&&g();}f();}),S>0?{result:"failure",data:{errors:c.filter(f=>f.result==="failure").map(f=>f.error)},error:`[${t}] forEach: ${S}/${s.length} items failed`}:{result:"success",data:{[l]:c.map(g=>g.data)}}}}function J(r,e,t){let n=Array.isArray(e?.produces_data)?e?.produces_data:void 0,o=Array.isArray(e?.input_validations)?e?.input_validations:void 0,a=e?.config??void 0,s=e?.handler,l;return A(s)?l=I(s,r,a):O(s)?l=E(s,r,t.invoke,a):l=z(),e?.forEach&&(l=Q(l,e.forEach,r)),F(x(l,n),o,r)}function H(r,e){let t={};for(let[n,o]of Object.entries(r.steps??{}))t[n]=J(n,o,e);return t}function X(r){let e=r.storeFactory||(()=>new chunkH5KD3JPY_cjs.a);return {async run(t,n){try{let o=H(t,{invoke:r.invokeRef}),s=await chunkQ6H7NINN_cjs.g(t,o,{store:e()}).run(n);return s.status!=="completed"?{dispatched:!1,error:s.error?.message||s.status}:{dispatched:!0}}catch(o){return {dispatched:false,error:o instanceof Error?o.message:String(o)}}}}}Object.defineProperty(exports,"KVStorageStore",{enumerable:true,get:function(){return chunkKHJABJ45_cjs.a}});Object.defineProperty(exports,"createStepMachine",{enumerable:true,get:function(){return chunkQ6H7NINN_cjs.g}});Object.defineProperty(exports,"loadStepFlow",{enumerable:true,get:function(){return chunkQ6H7NINN_cjs.j}});Object.defineProperty(exports,"MemoryStore",{enumerable:true,get:function(){return chunkH5KD3JPY_cjs.a}});exports.buildStepHandlersForFlow=H;exports.createComputeJsonataHandler=I;exports.createPassthroughHandler=z;exports.createRefStepHandler=E;exports.createStepMachineChatFlowRunner=X;exports.filterProducedData=$;exports.isComputeJsonataSpec=A;exports.isRefSpec=O;exports.jsonata=h;exports.normalizeHandlerResult=T;exports.resolveStepHandler=J;exports.runInputValidations=M;exports.wrapWithInputValidations=F;exports.wrapWithOutputFiltering=x;//# sourceMappingURL=index.cjs.map
1
+ 'use strict';var chunkPMUSJQSR_cjs=require('../chunk-PMUSJQSR.cjs'),chunkQ6H7NINN_cjs=require('../chunk-Q6H7NINN.cjs'),chunkH5KD3JPY_cjs=require('../chunk-H5KD3JPY.cjs'),chunkKHJABJ45_cjs=require('../chunk-KHJABJ45.cjs'),chunkSFVO2LB2_cjs=require('../chunk-SFVO2LB2.cjs');require('../chunk-UJ7ZTV4J.cjs'),require('../chunk-GNFE24S7.cjs');var module$1=require('module'),url=require('url'),path=require('path'),fs=require('fs');var _documentCurrentScript=typeof document!=='undefined'?document.currentScript:null;var C=path.dirname(url.fileURLToPath((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('index.cjs', document.baseURI).href)))),K=module$1.createRequire((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('index.cjs', document.baseURI).href)));function L(){let r=path.resolve(C,"./jsonata-sync.cjs");return fs.existsSync(r)?r:path.resolve(C,"../card-compute/jsonata-sync.cjs")}var h=K(L());function T(r,e){if(!r||typeof r!="object")throw new Error(`[step-machine-public] Step "${e}" returned a non-object result.`);let t=r,n=t.result??t.status;if(typeof n=="string"&&n.trim().length>0){let o=t.data&&typeof t.data=="object"&&!Array.isArray(t.data)?{...t.data}:{},a=typeof t.error=="string"?t.error:void 0;return a&&!("error"in o)&&(o.error=a),{result:n,data:o,...a?{error:a}:{}}}return {result:"success",data:{...t}}}function $(r,e){if(!e||e.length===0)return r;let t={};for(let n of e)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n]);return t}function x(r,e){return async(t,n)=>{let o=await r(t,n),a=T(o,n?.stepName??"unknown");return {result:a.result,data:$(a.data,e),...a.error?{error:a.error}:{}}}}function M(r,e,t){if(!e||e.length===0)return null;for(let n of e)try{if(!h(n).evaluate(r))return {result:"failure",data:{error:`[${t}] input validation failed: ${n}`}}}catch(o){let a=o instanceof Error?o.message:String(o);return {result:"failure",data:{error:`[${t}] input validation error on "${n}": ${a}`}}}return null}function F(r,e,t){return !e||e.length===0?r:async(n,o)=>{let a=M(n,e,t);return a||r(n,o)}}function A(r){return !!r&&typeof r=="object"&&r.type==="compute-jsonata"&&Array.isArray(r.expr)&&r.expr.length>0}function O(r){if(!r||typeof r!="object")return false;let e=r;if(e.type!=="ref"||typeof e.howToRun!="string")return false;if(typeof e.whatToRun=="string")return true;if(e.whatToRun&&typeof e.whatToRun=="object"){let t=e.whatToRun;return typeof t.kind=="string"&&typeof t.value=="string"}return false}function U(r){if(typeof r=="string"){let e=r.indexOf("=");if(e<1)throw new Error(`[step-machine-public] Invalid compute expression (missing "="): "${r}"`);return {bindTo:r.slice(0,e).trim(),expr:r.slice(e+1).trim()}}if(r&&typeof r=="object"&&typeof r.bindTo=="string"&&typeof r.expr=="string")return r;throw new Error(`[step-machine-public] Invalid compute step: ${JSON.stringify(r)}`)}function G(r,e,t){let n=e.split("."),o=r;for(let a=0;a<n.length-1;a++){let s=n[a];(o[s]==null||typeof o[s]!="object")&&(o[s]={}),o=o[s];}o[n[n.length-1]]=t;}function I(r,e,t){let n=r.expr.map(U);return async o=>{let a=o&&typeof o=="object"&&!Array.isArray(o)?{...o}:{},s={},l={expects_data:a,data:s,...t?{config:t}:{}},p,i;for(let u of n)try{let c=h(u.expr).evaluate(l);if(u.bindTo==="result")p=c!=null?String(c):"success";else if(u.bindTo==="error")i=c!=null?String(c):void 0;else if(u.bindTo.startsWith("data."))G(s,u.bindTo.slice(5),c);else return {result:"failure",data:{},error:`[${e}] invalid bindTo "${u.bindTo}": must be "result", "error", or start with "data."`}}catch(c){let d=c instanceof Error?c.message:String(c);return {result:"failure",data:{},error:`[${e}] compute "${u.bindTo}" failed: ${d}`}}return p===void 0?{result:"failure",data:{},error:`[${e}] compute-jsonata: no "result" binding declared \u2014 add '- result = "success"' to expr`}:i?{result:p,data:s,error:i}:{result:p,data:s}}}function E(r,e,t,n){let{type:o,...a}=r,s={...a,whatToRun:typeof a.whatToRun=="object"?chunkSFVO2LB2_cjs.a(a.whatToRun):a.whatToRun};return async l=>{let p=l&&typeof l=="object"&&!Array.isArray(l)?{...l}:{};n&&(p.config=n);try{let i=await t(s,p);if(!r.outputTransforms)return i;if(i&&i.result!=="success"){let u=i.data&&typeof i.data.error=="string"?String(i.data.error):void 0;return u&&!i.error?{...i,error:u}:i}try{return chunkPMUSJQSR_cjs.b(r.outputTransforms,i,e)}catch(u){let c=u instanceof Error?u.message:String(u);return {result:"failure",data:{},error:c}}}catch(i){let u=i instanceof Error?i.message:String(i);return {result:"failure",data:{error:`[step-machine-public] step "${e}" invoke threw: ${u}`}}}}}function z(){return async r=>({result:"success",data:r&&typeof r=="object"&&!Array.isArray(r)?r:{}})}function Q(r,e,t){return async(n,o)=>{let a=n?.[e.items];if(!Array.isArray(a))return {result:"failure",data:{},error:`[${t}] forEach: "${e.items}" is not an array (got ${typeof a})`};let s=a,l=e.collectAs??`${e.items}_results`;if(s.length===0)return {result:"success",data:{[l]:[]}};let{[e.items]:p,...i}=n,u=Math.max(1,e.concurrency??1),c=new Array(s.length),d=0,w=0,S=0;return await new Promise(g=>{function f(){for(;d<u&&w<s.length;){let y=w++;d++;let _={...i,[e.as]:s[y]};r(_,o).then(m=>{c[y]=m;}).catch(m=>{let P=m instanceof Error?m.message:String(m);c[y]={result:"failure",data:{},error:P};}).finally(()=>{d--,c[y]?.result==="failure"&&S++,w>=s.length&&d===0?g():f();});}d===0&&w>=s.length&&g();}f();}),S>0?{result:"failure",data:{errors:c.filter(f=>f.result==="failure").map(f=>f.error)},error:`[${t}] forEach: ${S}/${s.length} items failed`}:{result:"success",data:{[l]:c.map(g=>g.data)}}}}function J(r,e,t){let n=Array.isArray(e?.produces_data)?e?.produces_data:void 0,o=Array.isArray(e?.input_validations)?e?.input_validations:void 0,a=e?.config??void 0,s=e?.handler,l;return A(s)?l=I(s,r,a):O(s)?l=E(s,r,t.invoke,a):l=z(),e?.forEach&&(l=Q(l,e.forEach,r)),F(x(l,n),o,r)}function H(r,e){let t={};for(let[n,o]of Object.entries(r.steps??{}))t[n]=J(n,o,e);return t}function X(r){let e=r.storeFactory||(()=>new chunkH5KD3JPY_cjs.a);return {async run(t,n){try{let o=H(t,{invoke:r.invokeRef}),s=await chunkQ6H7NINN_cjs.g(t,o,{store:e()}).run(n);return s.status!=="completed"?{dispatched:!1,error:s.error?.message||s.status}:{dispatched:!0}}catch(o){return {dispatched:false,error:o instanceof Error?o.message:String(o)}}}}}Object.defineProperty(exports,"createStepMachine",{enumerable:true,get:function(){return chunkQ6H7NINN_cjs.g}});Object.defineProperty(exports,"loadStepFlow",{enumerable:true,get:function(){return chunkQ6H7NINN_cjs.j}});Object.defineProperty(exports,"MemoryStore",{enumerable:true,get:function(){return chunkH5KD3JPY_cjs.a}});Object.defineProperty(exports,"KVStorageStore",{enumerable:true,get:function(){return chunkKHJABJ45_cjs.a}});exports.buildStepHandlersForFlow=H;exports.createComputeJsonataHandler=I;exports.createPassthroughHandler=z;exports.createRefStepHandler=E;exports.createStepMachineChatFlowRunner=X;exports.filterProducedData=$;exports.isComputeJsonataSpec=A;exports.isRefSpec=O;exports.jsonata=h;exports.normalizeHandlerResult=T;exports.resolveStepHandler=J;exports.runInputValidations=M;exports.wrapWithInputValidations=F;exports.wrapWithOutputFiltering=x;//# sourceMappingURL=index.cjs.map
2
2
  //# sourceMappingURL=index.cjs.map
@@ -3,7 +3,7 @@ import { l as StepMachineStore } from '../types-DjlwALZC.cjs';
3
3
  export { MemoryStore } from '../stores/memory.cjs';
4
4
  export { KVStorageStore } from '../stores/kv.cjs';
5
5
  import { ExecutionRef } from '../execution-refs.cjs';
6
- import '../storage-interface-Ct-C4tlz.cjs';
6
+ import '../storage-interface-BFiD3kyB.cjs';
7
7
 
8
8
  /**
9
9
  * The single normalized shape the engine consumes.
@@ -3,7 +3,7 @@ import { l as StepMachineStore } from '../types-DjlwALZC.js';
3
3
  export { MemoryStore } from '../stores/memory.js';
4
4
  export { KVStorageStore } from '../stores/kv.js';
5
5
  import { ExecutionRef } from '../execution-refs.js';
6
- import '../storage-interface-Ct-C4tlz.js';
6
+ import '../storage-interface-BFiD3kyB.js';
7
7
 
8
8
  /**
9
9
  * The single normalized shape the engine consumes.
@@ -1,2 +1,2 @@
1
- import {b}from'../chunk-LDAP75GN.js';export{a as KVStorageStore}from'../chunk-FZ2SBU5M.js';import {a}from'../chunk-CWREBRXS.js';import {g}from'../chunk-QWBNDVUA.js';export{g as createStepMachine,j as loadStepFlow}from'../chunk-QWBNDVUA.js';import {a as a$1}from'../chunk-JM5EKT57.js';export{a as MemoryStore}from'../chunk-JM5EKT57.js';import'../chunk-MNEOJWPS.js';import'../chunk-FW4363Y4.js';import {createRequire}from'module';import {fileURLToPath}from'url';import {dirname,resolve}from'path';import {existsSync}from'fs';var C=dirname(fileURLToPath(import.meta.url)),K=createRequire(import.meta.url);function L(){let r=resolve(C,"./jsonata-sync.cjs");return existsSync(r)?r:resolve(C,"../card-compute/jsonata-sync.cjs")}var h=K(L());function T(r,e){if(!r||typeof r!="object")throw new Error(`[step-machine-public] Step "${e}" returned a non-object result.`);let t=r,n=t.result??t.status;if(typeof n=="string"&&n.trim().length>0){let o=t.data&&typeof t.data=="object"&&!Array.isArray(t.data)?{...t.data}:{},a=typeof t.error=="string"?t.error:void 0;return a&&!("error"in o)&&(o.error=a),{result:n,data:o,...a?{error:a}:{}}}return {result:"success",data:{...t}}}function $(r,e){if(!e||e.length===0)return r;let t={};for(let n of e)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n]);return t}function x(r,e){return async(t,n)=>{let o=await r(t,n),a=T(o,n?.stepName??"unknown");return {result:a.result,data:$(a.data,e),...a.error?{error:a.error}:{}}}}function M(r,e,t){if(!e||e.length===0)return null;for(let n of e)try{if(!h(n).evaluate(r))return {result:"failure",data:{error:`[${t}] input validation failed: ${n}`}}}catch(o){let a=o instanceof Error?o.message:String(o);return {result:"failure",data:{error:`[${t}] input validation error on "${n}": ${a}`}}}return null}function F(r,e,t){return !e||e.length===0?r:async(n,o)=>{let a=M(n,e,t);return a||r(n,o)}}function A(r){return !!r&&typeof r=="object"&&r.type==="compute-jsonata"&&Array.isArray(r.expr)&&r.expr.length>0}function O(r){if(!r||typeof r!="object")return false;let e=r;if(e.type!=="ref"||typeof e.howToRun!="string")return false;if(typeof e.whatToRun=="string")return true;if(e.whatToRun&&typeof e.whatToRun=="object"){let t=e.whatToRun;return typeof t.kind=="string"&&typeof t.value=="string"}return false}function U(r){if(typeof r=="string"){let e=r.indexOf("=");if(e<1)throw new Error(`[step-machine-public] Invalid compute expression (missing "="): "${r}"`);return {bindTo:r.slice(0,e).trim(),expr:r.slice(e+1).trim()}}if(r&&typeof r=="object"&&typeof r.bindTo=="string"&&typeof r.expr=="string")return r;throw new Error(`[step-machine-public] Invalid compute step: ${JSON.stringify(r)}`)}function G(r,e,t){let n=e.split("."),o=r;for(let a=0;a<n.length-1;a++){let s=n[a];(o[s]==null||typeof o[s]!="object")&&(o[s]={}),o=o[s];}o[n[n.length-1]]=t;}function I(r,e,t){let n=r.expr.map(U);return async o=>{let a=o&&typeof o=="object"&&!Array.isArray(o)?{...o}:{},s={},l={expects_data:a,data:s,...t?{config:t}:{}},p,i;for(let u of n)try{let c=h(u.expr).evaluate(l);if(u.bindTo==="result")p=c!=null?String(c):"success";else if(u.bindTo==="error")i=c!=null?String(c):void 0;else if(u.bindTo.startsWith("data."))G(s,u.bindTo.slice(5),c);else return {result:"failure",data:{},error:`[${e}] invalid bindTo "${u.bindTo}": must be "result", "error", or start with "data."`}}catch(c){let d=c instanceof Error?c.message:String(c);return {result:"failure",data:{},error:`[${e}] compute "${u.bindTo}" failed: ${d}`}}return p===void 0?{result:"failure",data:{},error:`[${e}] compute-jsonata: no "result" binding declared \u2014 add '- result = "success"' to expr`}:i?{result:p,data:s,error:i}:{result:p,data:s}}}function E(r,e,t,n){let{type:o,...a$1}=r,s={...a$1,whatToRun:typeof a$1.whatToRun=="object"?a(a$1.whatToRun):a$1.whatToRun};return async l=>{let p=l&&typeof l=="object"&&!Array.isArray(l)?{...l}:{};n&&(p.config=n);try{let i=await t(s,p);if(!r.outputTransforms)return i;if(i&&i.result!=="success"){let u=i.data&&typeof i.data.error=="string"?String(i.data.error):void 0;return u&&!i.error?{...i,error:u}:i}try{return b(r.outputTransforms,i,e)}catch(u){let c=u instanceof Error?u.message:String(u);return {result:"failure",data:{},error:c}}}catch(i){let u=i instanceof Error?i.message:String(i);return {result:"failure",data:{error:`[step-machine-public] step "${e}" invoke threw: ${u}`}}}}}function z(){return async r=>({result:"success",data:r&&typeof r=="object"&&!Array.isArray(r)?r:{}})}function Q(r,e,t){return async(n,o)=>{let a=n?.[e.items];if(!Array.isArray(a))return {result:"failure",data:{},error:`[${t}] forEach: "${e.items}" is not an array (got ${typeof a})`};let s=a,l=e.collectAs??`${e.items}_results`;if(s.length===0)return {result:"success",data:{[l]:[]}};let{[e.items]:p,...i}=n,u=Math.max(1,e.concurrency??1),c=new Array(s.length),d=0,w=0,S=0;return await new Promise(g=>{function f(){for(;d<u&&w<s.length;){let y=w++;d++;let _={...i,[e.as]:s[y]};r(_,o).then(m=>{c[y]=m;}).catch(m=>{let P=m instanceof Error?m.message:String(m);c[y]={result:"failure",data:{},error:P};}).finally(()=>{d--,c[y]?.result==="failure"&&S++,w>=s.length&&d===0?g():f();});}d===0&&w>=s.length&&g();}f();}),S>0?{result:"failure",data:{errors:c.filter(f=>f.result==="failure").map(f=>f.error)},error:`[${t}] forEach: ${S}/${s.length} items failed`}:{result:"success",data:{[l]:c.map(g=>g.data)}}}}function J(r,e,t){let n=Array.isArray(e?.produces_data)?e?.produces_data:void 0,o=Array.isArray(e?.input_validations)?e?.input_validations:void 0,a=e?.config??void 0,s=e?.handler,l;return A(s)?l=I(s,r,a):O(s)?l=E(s,r,t.invoke,a):l=z(),e?.forEach&&(l=Q(l,e.forEach,r)),F(x(l,n),o,r)}function H(r,e){let t={};for(let[n,o]of Object.entries(r.steps??{}))t[n]=J(n,o,e);return t}function X(r){let e=r.storeFactory||(()=>new a$1);return {async run(t,n){try{let o=H(t,{invoke:r.invokeRef}),s=await g(t,o,{store:e()}).run(n);return s.status!=="completed"?{dispatched:!1,error:s.error?.message||s.status}:{dispatched:!0}}catch(o){return {dispatched:false,error:o instanceof Error?o.message:String(o)}}}}}export{H as buildStepHandlersForFlow,I as createComputeJsonataHandler,z as createPassthroughHandler,E as createRefStepHandler,X as createStepMachineChatFlowRunner,$ as filterProducedData,A as isComputeJsonataSpec,O as isRefSpec,h as jsonata,T as normalizeHandlerResult,J as resolveStepHandler,M as runInputValidations,F as wrapWithInputValidations,x as wrapWithOutputFiltering};//# sourceMappingURL=index.js.map
1
+ import {b}from'../chunk-CIAJNUR4.js';import {g}from'../chunk-QWBNDVUA.js';export{g as createStepMachine,j as loadStepFlow}from'../chunk-QWBNDVUA.js';import {a as a$1}from'../chunk-JM5EKT57.js';export{a as MemoryStore}from'../chunk-JM5EKT57.js';export{a as KVStorageStore}from'../chunk-FZ2SBU5M.js';import {a}from'../chunk-BQS3EIEK.js';import'../chunk-MNEOJWPS.js';import'../chunk-FW4363Y4.js';import {createRequire}from'module';import {fileURLToPath}from'url';import {dirname,resolve}from'path';import {existsSync}from'fs';var C=dirname(fileURLToPath(import.meta.url)),K=createRequire(import.meta.url);function L(){let r=resolve(C,"./jsonata-sync.cjs");return existsSync(r)?r:resolve(C,"../card-compute/jsonata-sync.cjs")}var h=K(L());function T(r,e){if(!r||typeof r!="object")throw new Error(`[step-machine-public] Step "${e}" returned a non-object result.`);let t=r,n=t.result??t.status;if(typeof n=="string"&&n.trim().length>0){let o=t.data&&typeof t.data=="object"&&!Array.isArray(t.data)?{...t.data}:{},a=typeof t.error=="string"?t.error:void 0;return a&&!("error"in o)&&(o.error=a),{result:n,data:o,...a?{error:a}:{}}}return {result:"success",data:{...t}}}function $(r,e){if(!e||e.length===0)return r;let t={};for(let n of e)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n]);return t}function x(r,e){return async(t,n)=>{let o=await r(t,n),a=T(o,n?.stepName??"unknown");return {result:a.result,data:$(a.data,e),...a.error?{error:a.error}:{}}}}function M(r,e,t){if(!e||e.length===0)return null;for(let n of e)try{if(!h(n).evaluate(r))return {result:"failure",data:{error:`[${t}] input validation failed: ${n}`}}}catch(o){let a=o instanceof Error?o.message:String(o);return {result:"failure",data:{error:`[${t}] input validation error on "${n}": ${a}`}}}return null}function F(r,e,t){return !e||e.length===0?r:async(n,o)=>{let a=M(n,e,t);return a||r(n,o)}}function A(r){return !!r&&typeof r=="object"&&r.type==="compute-jsonata"&&Array.isArray(r.expr)&&r.expr.length>0}function O(r){if(!r||typeof r!="object")return false;let e=r;if(e.type!=="ref"||typeof e.howToRun!="string")return false;if(typeof e.whatToRun=="string")return true;if(e.whatToRun&&typeof e.whatToRun=="object"){let t=e.whatToRun;return typeof t.kind=="string"&&typeof t.value=="string"}return false}function U(r){if(typeof r=="string"){let e=r.indexOf("=");if(e<1)throw new Error(`[step-machine-public] Invalid compute expression (missing "="): "${r}"`);return {bindTo:r.slice(0,e).trim(),expr:r.slice(e+1).trim()}}if(r&&typeof r=="object"&&typeof r.bindTo=="string"&&typeof r.expr=="string")return r;throw new Error(`[step-machine-public] Invalid compute step: ${JSON.stringify(r)}`)}function G(r,e,t){let n=e.split("."),o=r;for(let a=0;a<n.length-1;a++){let s=n[a];(o[s]==null||typeof o[s]!="object")&&(o[s]={}),o=o[s];}o[n[n.length-1]]=t;}function I(r,e,t){let n=r.expr.map(U);return async o=>{let a=o&&typeof o=="object"&&!Array.isArray(o)?{...o}:{},s={},l={expects_data:a,data:s,...t?{config:t}:{}},p,i;for(let u of n)try{let c=h(u.expr).evaluate(l);if(u.bindTo==="result")p=c!=null?String(c):"success";else if(u.bindTo==="error")i=c!=null?String(c):void 0;else if(u.bindTo.startsWith("data."))G(s,u.bindTo.slice(5),c);else return {result:"failure",data:{},error:`[${e}] invalid bindTo "${u.bindTo}": must be "result", "error", or start with "data."`}}catch(c){let d=c instanceof Error?c.message:String(c);return {result:"failure",data:{},error:`[${e}] compute "${u.bindTo}" failed: ${d}`}}return p===void 0?{result:"failure",data:{},error:`[${e}] compute-jsonata: no "result" binding declared \u2014 add '- result = "success"' to expr`}:i?{result:p,data:s,error:i}:{result:p,data:s}}}function E(r,e,t,n){let{type:o,...a$1}=r,s={...a$1,whatToRun:typeof a$1.whatToRun=="object"?a(a$1.whatToRun):a$1.whatToRun};return async l=>{let p=l&&typeof l=="object"&&!Array.isArray(l)?{...l}:{};n&&(p.config=n);try{let i=await t(s,p);if(!r.outputTransforms)return i;if(i&&i.result!=="success"){let u=i.data&&typeof i.data.error=="string"?String(i.data.error):void 0;return u&&!i.error?{...i,error:u}:i}try{return b(r.outputTransforms,i,e)}catch(u){let c=u instanceof Error?u.message:String(u);return {result:"failure",data:{},error:c}}}catch(i){let u=i instanceof Error?i.message:String(i);return {result:"failure",data:{error:`[step-machine-public] step "${e}" invoke threw: ${u}`}}}}}function z(){return async r=>({result:"success",data:r&&typeof r=="object"&&!Array.isArray(r)?r:{}})}function Q(r,e,t){return async(n,o)=>{let a=n?.[e.items];if(!Array.isArray(a))return {result:"failure",data:{},error:`[${t}] forEach: "${e.items}" is not an array (got ${typeof a})`};let s=a,l=e.collectAs??`${e.items}_results`;if(s.length===0)return {result:"success",data:{[l]:[]}};let{[e.items]:p,...i}=n,u=Math.max(1,e.concurrency??1),c=new Array(s.length),d=0,w=0,S=0;return await new Promise(g=>{function f(){for(;d<u&&w<s.length;){let y=w++;d++;let _={...i,[e.as]:s[y]};r(_,o).then(m=>{c[y]=m;}).catch(m=>{let P=m instanceof Error?m.message:String(m);c[y]={result:"failure",data:{},error:P};}).finally(()=>{d--,c[y]?.result==="failure"&&S++,w>=s.length&&d===0?g():f();});}d===0&&w>=s.length&&g();}f();}),S>0?{result:"failure",data:{errors:c.filter(f=>f.result==="failure").map(f=>f.error)},error:`[${t}] forEach: ${S}/${s.length} items failed`}:{result:"success",data:{[l]:c.map(g=>g.data)}}}}function J(r,e,t){let n=Array.isArray(e?.produces_data)?e?.produces_data:void 0,o=Array.isArray(e?.input_validations)?e?.input_validations:void 0,a=e?.config??void 0,s=e?.handler,l;return A(s)?l=I(s,r,a):O(s)?l=E(s,r,t.invoke,a):l=z(),e?.forEach&&(l=Q(l,e.forEach,r)),F(x(l,n),o,r)}function H(r,e){let t={};for(let[n,o]of Object.entries(r.steps??{}))t[n]=J(n,o,e);return t}function X(r){let e=r.storeFactory||(()=>new a$1);return {async run(t,n){try{let o=H(t,{invoke:r.invokeRef}),s=await g(t,o,{store:e()}).run(n);return s.status!=="completed"?{dispatched:!1,error:s.error?.message||s.status}:{dispatched:!0}}catch(o){return {dispatched:false,error:o instanceof Error?o.message:String(o)}}}}}export{H as buildStepHandlersForFlow,I as createComputeJsonataHandler,z as createPassthroughHandler,E as createRefStepHandler,X as createStepMachineChatFlowRunner,$ as filterProducedData,A as isComputeJsonataSpec,O as isRefSpec,h as jsonata,T as normalizeHandlerResult,J as resolveStepHandler,M as runInputValidations,F as wrapWithInputValidations,x as wrapWithOutputFiltering};//# sourceMappingURL=index.js.map
2
2
  //# sourceMappingURL=index.js.map
@@ -103,6 +103,16 @@ interface QueueDeadLetterMessage<T = unknown> extends QueueMessage<T> {
103
103
  }
104
104
  interface QueueStorage {
105
105
  enqueue<T>(body: T): QueueMessage<T>;
106
+ /**
107
+ * Enqueue only if no active or leased message with the same dedupKey exists.
108
+ * Returns the new message, or null if a pending message with that key is
109
+ * already present. Dedup is released on ack or on dead-letter; nack-retry
110
+ * preserves the dedup key (the original message is still pending).
111
+ *
112
+ * Optional: adapters that cannot cheaply dedup (e.g. Azure Storage Queue)
113
+ * may leave this unimplemented; callers should fall back to `enqueue`.
114
+ */
115
+ enqueueIfAbsent?<T>(body: T, dedupKey: string): QueueMessage<T> | null;
106
116
  lease<T>(opts?: {
107
117
  max?: number;
108
118
  visibilityMs?: number;
@@ -172,4 +182,4 @@ interface AtomicRelayLock {
172
182
  tryAcquire(): (() => void) | null;
173
183
  }
174
184
 
175
- export { type ArchiveFactory as A, type BlobStorage as B, type JournalStorage as J, type KVStorage as K, type QueueStorage as Q, type ScratchStorage as S, type KindValueRef as a, type AtomicRelayLock as b, parseRef as p, serializeRef as s };
185
+ export { type ArchiveFactory as A, type BlobStorage as B, type JournalStorage as J, type KVStorage as K, type QueueMessage as Q, type ScratchStorage as S, type KindValueRef as a, type BlobStat as b, type JournalEntry as c, type JournalReadResult as d, type QueueLeasedMessage as e, type QueueDeadLetterMessage as f, type QueueStorage as g, type AtomicRelayLock as h, parseRef as p, serializeRef as s };
@@ -103,6 +103,16 @@ interface QueueDeadLetterMessage<T = unknown> extends QueueMessage<T> {
103
103
  }
104
104
  interface QueueStorage {
105
105
  enqueue<T>(body: T): QueueMessage<T>;
106
+ /**
107
+ * Enqueue only if no active or leased message with the same dedupKey exists.
108
+ * Returns the new message, or null if a pending message with that key is
109
+ * already present. Dedup is released on ack or on dead-letter; nack-retry
110
+ * preserves the dedup key (the original message is still pending).
111
+ *
112
+ * Optional: adapters that cannot cheaply dedup (e.g. Azure Storage Queue)
113
+ * may leave this unimplemented; callers should fall back to `enqueue`.
114
+ */
115
+ enqueueIfAbsent?<T>(body: T, dedupKey: string): QueueMessage<T> | null;
106
116
  lease<T>(opts?: {
107
117
  max?: number;
108
118
  visibilityMs?: number;
@@ -172,4 +182,4 @@ interface AtomicRelayLock {
172
182
  tryAcquire(): (() => void) | null;
173
183
  }
174
184
 
175
- export { type ArchiveFactory as A, type BlobStorage as B, type JournalStorage as J, type KVStorage as K, type QueueStorage as Q, type ScratchStorage as S, type KindValueRef as a, type AtomicRelayLock as b, parseRef as p, serializeRef as s };
185
+ export { type ArchiveFactory as A, type BlobStorage as B, type JournalStorage as J, type KVStorage as K, type QueueMessage as Q, type ScratchStorage as S, type KindValueRef as a, type BlobStat as b, type JournalEntry as c, type JournalReadResult as d, type QueueLeasedMessage as e, type QueueDeadLetterMessage as f, type QueueStorage as g, type AtomicRelayLock as h, parseRef as p, serializeRef as s };
@@ -1,2 +1,2 @@
1
- 'use strict';var chunkKHJABJ45_cjs=require('../chunk-KHJABJ45.cjs'),chunkH5KD3JPY_cjs=require('../chunk-H5KD3JPY.cjs');require('../chunk-GNFE24S7.cjs');Object.defineProperty(exports,"KVStorageStore",{enumerable:true,get:function(){return chunkKHJABJ45_cjs.a}});Object.defineProperty(exports,"MemoryStore",{enumerable:true,get:function(){return chunkH5KD3JPY_cjs.a}});//# sourceMappingURL=index.cjs.map
1
+ 'use strict';var chunkH5KD3JPY_cjs=require('../chunk-H5KD3JPY.cjs'),chunkKHJABJ45_cjs=require('../chunk-KHJABJ45.cjs');require('../chunk-GNFE24S7.cjs');Object.defineProperty(exports,"MemoryStore",{enumerable:true,get:function(){return chunkH5KD3JPY_cjs.a}});Object.defineProperty(exports,"KVStorageStore",{enumerable:true,get:function(){return chunkKHJABJ45_cjs.a}});//# sourceMappingURL=index.cjs.map
2
2
  //# sourceMappingURL=index.cjs.map
@@ -1,4 +1,4 @@
1
1
  export { MemoryStore } from './memory.cjs';
2
2
  export { KVStorageStore } from './kv.cjs';
3
3
  import '../types-DjlwALZC.cjs';
4
- import '../storage-interface-Ct-C4tlz.cjs';
4
+ import '../storage-interface-BFiD3kyB.cjs';
@@ -1,4 +1,4 @@
1
1
  export { MemoryStore } from './memory.js';
2
2
  export { KVStorageStore } from './kv.js';
3
3
  import '../types-DjlwALZC.js';
4
- import '../storage-interface-Ct-C4tlz.js';
4
+ import '../storage-interface-BFiD3kyB.js';
@@ -1,2 +1,2 @@
1
- export{a as KVStorageStore}from'../chunk-FZ2SBU5M.js';export{a as MemoryStore}from'../chunk-JM5EKT57.js';import'../chunk-FW4363Y4.js';//# sourceMappingURL=index.js.map
1
+ export{a as MemoryStore}from'../chunk-JM5EKT57.js';export{a as KVStorageStore}from'../chunk-FZ2SBU5M.js';import'../chunk-FW4363Y4.js';//# sourceMappingURL=index.js.map
2
2
  //# sourceMappingURL=index.js.map
@@ -1,5 +1,5 @@
1
1
  import { l as StepMachineStore, k as StepMachineState } from '../types-DjlwALZC.cjs';
2
- import { K as KVStorage } from '../storage-interface-Ct-C4tlz.cjs';
2
+ import { K as KVStorage } from '../storage-interface-BFiD3kyB.cjs';
3
3
 
4
4
  /**
5
5
  * yaml-flow - KVStorageStore
@@ -1,5 +1,5 @@
1
1
  import { l as StepMachineStore, k as StepMachineState } from '../types-DjlwALZC.js';
2
- import { K as KVStorage } from '../storage-interface-Ct-C4tlz.js';
2
+ import { K as KVStorage } from '../storage-interface-BFiD3kyB.js';
3
3
 
4
4
  /**
5
5
  * yaml-flow - KVStorageStore
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "yaml-flow",
3
- "version": "8.6.1",
3
+ "version": "8.6.3",
4
4
  "description": "Unified workflow engine: step-machine (sequential) + event-graph (stateless DAG) with pluggable storage",
5
5
  "author": "",
6
6
  "license": "MIT",
@@ -14,6 +14,11 @@
14
14
  "import": "./lib/board-live-cards-public.js",
15
15
  "require": "./lib/board-live-cards-public.cjs"
16
16
  },
17
+ "./cloud-storage": {
18
+ "types": "./lib/cloud-storage.d.ts",
19
+ "import": "./lib/cloud-storage.js",
20
+ "require": "./lib/cloud-storage.cjs"
21
+ },
17
22
  "./board-live-cards-public": {
18
23
  "types": "./lib/board-live-cards-public.d.ts",
19
24
  "import": "./lib/board-live-cards-public.js",
@@ -1,2 +0,0 @@
1
- function p(e){return String(e).replace(/[^a-zA-Z0-9_-]/g,"_")}function m(e){let n=e.payload??{};return {id:e.id,role:typeof n.role=="string"?n.role:"system",text:typeof n.text=="string"?n.text:"",files:Array.isArray(n.files)?n.files:[],turn:typeof n.turn=="string"?n.turn:"",updated_at:typeof n.updated_at=="string"?n.updated_at:""}}function R(e,n){let a=t=>`chats/${p(t)}/processing`,r=t=>`chats/${p(t)}/config`;return {append(t,i,o,u=[],s=""){return e(t).append({role:i,text:o,files:u,turn:s,updated_at:new Date().toISOString()}).id},readAll(t){return e(t).readAll().map(m)},readAfter(t,i){let o=e(t).readAfter(i);return {records:o.entries.map(m),cursor:o.newCursor}},clear(t){e(t).clear?.();},setProcessing(t,i){i?n.write(a(t),true):n.delete(a(t));},isProcessing(t){return n.read(a(t))===true},getConfig(t){return n.read(r(t))??{}},setConfig(t,i){let o=n.read(r(t))??{};n.write(r(t),{...o,...i});}}}function S(){let e=globalThis.crypto;return typeof e?.randomUUID=="function"?String(e.randomUUID()):`id-${Date.now()}-${Math.random().toString(36).slice(2)}`}function $(){let e=new Map,n=new Map;function a(r){return e.has(r)||e.set(r,[]),e.get(r)}return {append(r,t,i,o=[],u=""){let s={id:S(),role:t,text:i,files:o,turn:u,updated_at:new Date().toISOString()};return a(r).push(s),s.id},readAll(r){return a(r).slice()},readAfter(r,t){let i=a(r);if(!t)return {records:i.slice(),cursor:i.length>0?i[i.length-1].id:null};let o=i.findIndex(s=>s.id===t),u=o===-1?i.slice():i.slice(o+1);return {records:u,cursor:u.length>0?u[u.length-1].id:t}},clear(r){e.set(r,[]);},setProcessing(r,t){t?n.set(`p:${r}`,true):n.delete(`p:${r}`);},isProcessing(r){return n.get(`p:${r}`)===true},getConfig(r){return n.get(`c:${r}`)??{}},setConfig(r,t){let i=n.get(`c:${r}`)??{};n.set(`c:${r}`,{...i,...t});}}}function y(){return new Date().toISOString()}function x(e){return new TextEncoder().encode(e).byteLength}function A(e){return e?{key:e.key,size:e.size,updatedAt:e.updatedAt,contentType:e.contentType}:null}function w(e){let n=String(e||"").match(/^(\d+)[-_]/);return n?parseInt(n[1],10):0}function I(e){let n=String(e||"").trim();if(!n)return "upload.bin";let a=Math.max(n.lastIndexOf("/"),n.lastIndexOf("\\"));return (a>=0?n.slice(a+1):n)||"upload.bin"}function k(e){return String(e||"").toLowerCase().replace(/\s+/g,"_").replace(/[^a-z0-9_-]/g,"_").replace(/_+/g,"_").replace(/^_+|_+$/g,"")||"file"}function z(e){if(!e||e===".")return "";let n=String(e).replace(/^\./,"").toLowerCase().replace(/[^a-z0-9]/g,"");return n?`.${n}`:""}function F(e){let n=I(e),a=n.lastIndexOf(".");return a<=0||a===n.length-1?{stem:n,ext:""}:{stem:n.slice(0,a),ext:n.slice(a)}}function M(e){let n=e.lastIndexOf("/");return n>=0?e.slice(n+1):e}function L(e){function n(a){let r=e.stat?A(e.stat(a)):null;if(r)return r;if(!e.exists(a))return null;let t=e.read(a);return t===null?{key:a}:{key:a,size:x(t)}}return {exists(a){return e.exists(a)},putText(a,r,t="text/plain; charset=utf-8"){e.write(a,r);let i=n(a)??{key:a};return i.contentType=t,i.updatedAt=i.updatedAt??y(),i.size=i.size??x(r),i},putBytes(a,r,t="application/octet-stream"){if(e.writeBytes)e.writeBytes(a,r);else {let o=JSON.stringify({__kind:"bytes-array",data:[...r]});e.write(a,o);}let i=n(a)??{key:a};return i.contentType=t,i.updatedAt=i.updatedAt??y(),i.size=i.size??r.byteLength,i},getText(a){let r=e.read(a);if(r===null){if(!e.readBytes)return null;let t=e.readBytes(a);return t===null?null:Buffer.from(t).toString("utf-8")}try{let t=JSON.parse(r);if(t&&t.__kind==="bytes-array"&&Array.isArray(t.data))return new TextDecoder("utf-8").decode(new Uint8Array(t.data))}catch{}return r},getBytes(a){if(e.readBytes){let t=e.readBytes(a);if(t!==null)return t}let r=e.read(a);if(r===null)return null;try{let t=JSON.parse(r);if(t&&t.__kind==="bytes-array"&&Array.isArray(t.data))return new Uint8Array(t.data)}catch{}return new TextEncoder().encode(r)},head:n,list(a=""){return e.listKeys(a).map(r=>n(r)??{key:r}).sort((r,t)=>r.key.localeCompare(t.key))},remove(a){e.remove(a);}}}function b(e){function n(t,i){let o=0,u=[];Array.isArray(i)&&u.push(...i);for(let s of e.list(`${t}/`))u.push(M(s.key));for(let s of u){let l=w(s);Number.isFinite(l)&&l>o&&(o=l);}return o+1}function a(t,i,o){let u=Number(o?.maxLen||32),{stem:s,ext:l}=F(t),h=z(l),C=k(s),d=`${String(i).padStart(3,"0")}-`,g=h,f=u-d.length-g.length;f<1&&(g="",f=u-d.length);let _=C.slice(0,Math.max(1,f)),c=`${d}${_}${g}`;return c.length>u&&(c=c.slice(0,u).replace(/\.$/,"")),c}function r(t,i,o){let u=n(t,o?.seedNames),s=a(i,u,{maxLen:o?.maxLen});for(;e.exists(`${t}/${s}`);)u+=1,s=a(i,u,{maxLen:o?.maxLen});return s}return {nextSerial:n,buildStoredName:a,allocateStoredName:r}}function N(){function e(t,i){if(!Array.isArray(t))return [];let o=[];for(let u of t){if(!u||typeof u!="object")continue;let s=u;typeof s.stored_name=="string"&&o.push({name:typeof s.name=="string"?s.name:s.stored_name,stored_name:s.stored_name,size:typeof s.size=="number"&&Number.isFinite(s.size)?s.size:null,mime_type:typeof s.mime_type=="string"?s.mime_type:null,uploaded_at:typeof s.uploaded_at=="string"?s.uploaded_at:i||null,chat:s.chat===true});}return o}function n(t){return !t||typeof t!="object"?[]:e(t.files,void 0)}function a(t,i){let o=n(t);if(i.length===0)return t.files=o,o;let u=new Set(o.map(s=>s.stored_name));for(let s of i)u.has(s.stored_name)||(o.push(s),u.add(s.stored_name));return t.files=o,o}function r(t,i,o){let u=n(t);if(!Number.isInteger(i)||i<0||i>=u.length)return {ok:false,reason:"index_out_of_range"};let s=u[i];return !s||!s.stored_name?{ok:false,reason:"missing_stored_name"}:o&&o!==s.stored_name?{ok:false,reason:"stale_reference"}:{ok:true,file:s}}return {read:n,normalizeIncoming:e,merge:a,resolve:r}}export{R as a,$ as b,L as c,b as d,N as e};//# sourceMappingURL=chunk-6APH25VI.js.map
2
- //# sourceMappingURL=chunk-6APH25VI.js.map