@codemation/core-nodes-ocr 0.2.6 → 0.2.8

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 (54) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/dist/{analyzeInvoiceNode-BqZsN8iL.js → analyzeInvoiceNode-BQzww-XC.js} +1 -9
  3. package/dist/analyzeInvoiceNode-BQzww-XC.js.map +1 -0
  4. package/dist/{analyzeInvoiceNode-CmMsifbw.cjs → analyzeInvoiceNode-CW_SXNQf.cjs} +1 -9
  5. package/dist/analyzeInvoiceNode-CW_SXNQf.cjs.map +1 -0
  6. package/dist/codemation.plugin.cjs +1204 -14695
  7. package/dist/codemation.plugin.cjs.map +1 -1
  8. package/dist/codemation.plugin.d.cts +1 -73
  9. package/dist/codemation.plugin.d.ts +1 -58
  10. package/dist/codemation.plugin.js +1248 -14738
  11. package/dist/codemation.plugin.js.map +1 -1
  12. package/dist/dist-BDgdLisG.js +5378 -0
  13. package/dist/dist-BDgdLisG.js.map +1 -0
  14. package/dist/dist-BYInIjS8.js +2246 -0
  15. package/dist/dist-BYInIjS8.js.map +1 -0
  16. package/dist/dist-BlD4pqf2.cjs +4358 -0
  17. package/dist/dist-BlD4pqf2.cjs.map +1 -0
  18. package/dist/dist-CUcwHflE.cjs +14870 -0
  19. package/dist/dist-CUcwHflE.cjs.map +1 -0
  20. package/dist/dist-DB2xMXXm.cjs +5380 -0
  21. package/dist/dist-DB2xMXXm.cjs.map +1 -0
  22. package/dist/dist-DBYFkhSG.js +14739 -0
  23. package/dist/dist-DBYFkhSG.js.map +1 -0
  24. package/dist/dist-DZfaPW8T.js +4356 -0
  25. package/dist/dist-DZfaPW8T.js.map +1 -0
  26. package/dist/dist-Zdvm5pqX.cjs +2464 -0
  27. package/dist/dist-Zdvm5pqX.cjs.map +1 -0
  28. package/dist/{index-DF2ht42F.d.ts → index-DdjAAXvy.d.ts} +18 -274
  29. package/dist/index.cjs +1 -1
  30. package/dist/index.d.cts +15 -35
  31. package/dist/index.d.ts +7 -29
  32. package/dist/index.js +1 -1
  33. package/dist/metadata.json +1 -1
  34. package/dist/{runtimeTypes-WCvsnJMY.d.cts → runtimeTypes-D_9j5Pat.d.cts} +10 -253
  35. package/dist/{token-CgF09kyP.cjs → token-Cbd8b88n.cjs} +2 -2
  36. package/dist/{token-CgF09kyP.cjs.map → token-Cbd8b88n.cjs.map} +1 -1
  37. package/dist/{token-CIu4PqRI.js → token-P-r3QR1d.js} +2 -2
  38. package/dist/{token-CIu4PqRI.js.map → token-P-r3QR1d.js.map} +1 -1
  39. package/dist/{token-util-B2kSJtEV.cjs → token-util-B2Ofk2zk.cjs} +77 -77
  40. package/dist/token-util-B2Ofk2zk.cjs.map +1 -0
  41. package/dist/{token-util-Lr5foG4r.cjs → token-util-CT85hbGe.cjs} +1 -1
  42. package/dist/{token-util-EUxa8JtH.js → token-util-CfNdwRXi.js} +77 -77
  43. package/dist/token-util-CfNdwRXi.js.map +1 -0
  44. package/dist/token-util-rTxWuZPt.js +5 -0
  45. package/package.json +2 -2
  46. package/src/lib/analyzeWithAzure.ts +0 -9
  47. package/src/nodes/analyzeDocumentNode.ts +0 -9
  48. package/src/nodes/analyzeImageNode.ts +0 -9
  49. package/src/nodes/analyzeInvoiceNode.ts +0 -4
  50. package/dist/analyzeInvoiceNode-BqZsN8iL.js.map +0 -1
  51. package/dist/analyzeInvoiceNode-CmMsifbw.cjs.map +0 -1
  52. package/dist/token-util-B2kSJtEV.cjs.map +0 -1
  53. package/dist/token-util-BsR6OYHz.js +0 -5
  54. package/dist/token-util-EUxa8JtH.js.map +0 -1
@@ -3,11 +3,6 @@ import { DependencyContainer as Container, InjectionToken as TypeToken } from "t
3
3
  import { ReadableStream } from "node:stream/web";
4
4
 
5
5
  //#region ../core/src/contracts/baseTypes.d.ts
6
- /**
7
- * Minimal base types that have no dependencies on other contracts.
8
- * Used by credentialTypes, workflowTypes, and other contract layers
9
- * to avoid circular dependencies.
10
- */
11
6
  type WorkflowId = string;
12
7
  type NodeId = string;
13
8
  type OutputPortKey = string;
@@ -93,13 +88,6 @@ interface TelemetrySpanScope extends TelemetryScope {
93
88
  readonly traceId: string;
94
89
  readonly spanId: string;
95
90
  end(args?: TelemetrySpanEnd): Promise<void> | void;
96
- /**
97
- * Lift this span into a {@link NodeExecutionTelemetry} scoped to a different (nodeId, activationId).
98
- * Children created via the returned telemetry's `startChildSpan` get this span as their parent.
99
- *
100
- * Used at the sub-agent boundary so that nested runtime telemetry parents under the agent.tool.call
101
- * span instead of the orchestrator's node-level span.
102
- */
103
91
  asNodeTelemetry(args: Readonly<{
104
92
  nodeId: NodeId;
105
93
  activationId: NodeActivationId;
@@ -118,30 +106,21 @@ interface ExecutionTelemetry extends TelemetryScope {
118
106
  }
119
107
  //#endregion
120
108
  //#region ../core/src/contracts/retryPolicySpec.types.d.ts
121
- /**
122
- * In-process retry policy for runnable nodes. Serialized configs use the same
123
- * `kind` discriminator (`JSON.stringify` / persisted workflows).
124
- *
125
- * `maxAttempts` is the total number of tries including the first (e.g. 3 means up to 2 delays after failures).
126
- */
127
109
  type RetryPolicySpec = NoneRetryPolicySpec | FixedRetryPolicySpec | ExponentialRetryPolicySpec;
128
110
  interface NoneRetryPolicySpec {
129
111
  readonly kind: "none";
130
112
  }
131
113
  interface FixedRetryPolicySpec {
132
114
  readonly kind: "fixed";
133
- /** Total attempts including the first execution. Must be >= 1. */
134
115
  readonly maxAttempts: number;
135
116
  readonly delayMs: number;
136
117
  }
137
118
  interface ExponentialRetryPolicySpec {
138
119
  readonly kind: "exponential";
139
- /** Total attempts including the first execution. Must be >= 1. */
140
120
  readonly maxAttempts: number;
141
121
  readonly initialDelayMs: number;
142
122
  readonly multiplier: number;
143
123
  readonly maxDelayMs?: number;
144
- /** When true, each delay is multiplied by a random factor in [1, 1.2). */
145
124
  readonly jitter?: boolean;
146
125
  }
147
126
  //#endregion
@@ -157,22 +136,11 @@ type CredentialFieldSchema = Readonly<{
157
136
  type: "string" | "password" | "textarea" | "json" | "boolean";
158
137
  required?: true;
159
138
  order?: number;
160
- /**
161
- * Where this field appears in the credential dialog. Use `"advanced"` for optional or
162
- * power-user fields; they render inside a collapsible section (see `CredentialTypeDefinition.advancedSection`).
163
- * Defaults to `"default"` when omitted.
164
- */
165
139
  visibility?: "default" | "advanced";
166
140
  placeholder?: string;
167
141
  helpText?: string;
168
- /** When set, host resolves this field from process.env at runtime; env wins over stored values. */
169
142
  envVarName?: string;
170
- /**
171
- * When set, the dialog shows a copy action for this exact string (e.g. a static OAuth redirect URI
172
- * pattern or documentation URL). Do not use for secret values.
173
- */
174
143
  copyValue?: string;
175
- /** Accessible label for the copy control (default: Copy). */
176
144
  copyButtonLabel?: string;
177
145
  }>;
178
146
  type CredentialRequirement = Readonly<{
@@ -217,20 +185,9 @@ type CredentialOAuth2AuthDefinition = Readonly<{
217
185
  clientSecretFieldKey?: string;
218
186
  } | {
219
187
  kind: "oauth2";
220
- /**
221
- * Free-form provider identifier for telemetry, DB rows, and Better Auth provider naming.
222
- * Not used for any registry lookup — URLs come from {@link authorizeUrl} / {@link tokenUrl}.
223
- */
224
188
  providerId: string;
225
- /**
226
- * Authorization endpoint. May contain `{publicFieldKey}` placeholders that the runtime
227
- * substitutes from the credential's resolved public config (URL-encoded).
228
- * Example: `https://login.microsoftonline.com/{tenantId}/oauth2/v2.0/authorize`
229
- */
230
189
  authorizeUrl: string;
231
- /** Token endpoint. Same templating rules as {@link authorizeUrl}. */
232
190
  tokenUrl: string;
233
- /** Optional userinfo endpoint. Same templating rules as {@link authorizeUrl}. */
234
191
  userInfoUrl?: string;
235
192
  scopes: ReadonlyArray<string>;
236
193
  scopesFromPublicConfig?: CredentialOAuth2ScopesFromPublicConfig;
@@ -239,11 +196,8 @@ type CredentialOAuth2AuthDefinition = Readonly<{
239
196
  }>;
240
197
  type CredentialAuthDefinition = CredentialOAuth2AuthDefinition;
241
198
  type CredentialAdvancedSectionPresentation = Readonly<{
242
- /** Collapsible section title (default: "Advanced"). */
243
199
  title?: string;
244
- /** Optional short helper text shown inside the section (above the fields). */
245
200
  description?: string;
246
- /** When true, the advanced section starts expanded. Default: false (collapsed). */
247
201
  defaultOpen?: boolean;
248
202
  }>;
249
203
  type CredentialTypeDefinition = Readonly<{
@@ -252,23 +206,11 @@ type CredentialTypeDefinition = Readonly<{
252
206
  description?: string;
253
207
  publicFields?: ReadonlyArray<CredentialFieldSchema>;
254
208
  secretFields?: ReadonlyArray<CredentialFieldSchema>;
255
- /**
256
- * Optional labels for the collapsible block that contains every field with `visibility: "advanced"`.
257
- * If omitted, the UI still shows that block with defaults (title "Advanced", collapsed).
258
- */
259
209
  advancedSection?: CredentialAdvancedSectionPresentation;
260
210
  supportedSourceKinds?: ReadonlyArray<CredentialMaterialSourceKind>;
261
211
  auth?: CredentialAuthDefinition;
262
212
  }>;
263
- /**
264
- * JSON-shaped credential field bag (public config, resolved secret material, etc.).
265
- */
266
213
  type CredentialJsonRecord = Readonly<Record<string, unknown>>;
267
- /**
268
- * Persisted credential instance with typed `publicConfig`.
269
- * Hosts may specialize `secretRef` with a stricter union while remaining
270
- * assignable here for session/test callbacks.
271
- */
272
214
  type CredentialInstanceRecord<TPublicConfig extends CredentialJsonRecord = CredentialJsonRecord> = Readonly<{
273
215
  instanceId: CredentialInstanceId;
274
216
  typeId: CredentialTypeId;
@@ -280,81 +222,49 @@ type CredentialInstanceRecord<TPublicConfig extends CredentialJsonRecord = Crede
280
222
  setupStatus: CredentialSetupStatus;
281
223
  createdAt: string;
282
224
  updatedAt: string;
283
- /**
284
- * Pointer to where the credential material bytes live. For OSS / standalone
285
- * rows this is `{source: "local", ref: instanceId}` and the bytes co-locate
286
- * with the row in the workspace DB. For managed-mode rows this is
287
- * `{source: "control-plane", ref: <cp_id>}` and the bytes live at CP.
288
- *
289
- * The seam is read through `CredentialMaterialProvider`. See
290
- * `docs/design/credentials-oauth-unification.md` ("Material provider seam").
291
- */
292
225
  material: Readonly<{
293
226
  source: "local" | "control-plane";
294
227
  ref: string;
295
228
  }>;
296
229
  }>;
297
- /**
298
- * Arguments passed to `CredentialType.createSession` and `CredentialType.test`.
299
- * Declare `TPublicConfig` / `TMaterial` on `CredentialType` so implementations are checked
300
- * against your credential shapes (similar to `NodeExecutionContext.config` for nodes).
301
- */
302
230
  type CredentialSessionFactoryArgs<TPublicConfig extends CredentialJsonRecord = CredentialJsonRecord, TMaterial extends CredentialJsonRecord = CredentialJsonRecord> = Readonly<{
303
231
  instance: CredentialInstanceRecord<TPublicConfig>;
304
232
  material: TMaterial;
305
233
  publicConfig: TPublicConfig;
306
234
  }>;
307
235
  type CredentialSessionFactory<TPublicConfig extends CredentialJsonRecord = CredentialJsonRecord, TMaterial extends CredentialJsonRecord = CredentialJsonRecord, TSession = unknown> = (args: CredentialSessionFactoryArgs<TPublicConfig, TMaterial>) => Promise<TSession>;
236
+ type CredentialAccessTokenSessionArgs<TPublicConfig extends CredentialJsonRecord = CredentialJsonRecord> = Readonly<{
237
+ accessToken: string;
238
+ grantedScopes: ReadonlyArray<string>;
239
+ publicConfig: TPublicConfig;
240
+ }>;
241
+ type CredentialAccessTokenSessionFactory<TPublicConfig extends CredentialJsonRecord = CredentialJsonRecord, TSession = unknown> = (args: CredentialAccessTokenSessionArgs<TPublicConfig>) => Promise<TSession>;
308
242
  type CredentialHealthTester<TPublicConfig extends CredentialJsonRecord = CredentialJsonRecord, TMaterial extends CredentialJsonRecord = CredentialJsonRecord> = (args: CredentialSessionFactoryArgs<TPublicConfig, TMaterial>) => Promise<CredentialHealth>;
309
- /**
310
- * Full credential type implementation: `definition` (UI/schema), `createSession`, and `test`.
311
- * Use this at registration and config boundaries; `CredentialTypeDefinition` is only the schema slice.
312
- */
313
243
  type CredentialType<TPublicConfig extends CredentialJsonRecord = CredentialJsonRecord, TMaterial extends CredentialJsonRecord = CredentialJsonRecord, TSession = unknown> = Readonly<{
314
244
  definition: CredentialTypeDefinition;
315
245
  createSession: CredentialSessionFactory<TPublicConfig, TMaterial, TSession>;
246
+ createSessionFromAccessToken?: CredentialAccessTokenSessionFactory<TPublicConfig, TSession>;
316
247
  test: CredentialHealthTester<TPublicConfig, TMaterial>;
317
248
  }>;
318
- /**
319
- * Credential type with unspecified generics — used for `CodemationConfig.credentialTypes`, the host registry,
320
- * and anywhere a concrete `CredentialType<YourPublic, YourMaterial, YourSession>` is placed in a heterogeneous list.
321
- * Using `any` here avoids unsafe `as` casts while keeping typed `satisfies CredentialType<…>` definitions.
322
- */
323
249
  type AnyCredentialType = CredentialType<any, any, unknown>;
324
250
  //#endregion
325
251
  //#region ../core/src/contracts/collectionTypes.d.ts
326
- /**
327
- * Represents a typed store for a single collection.
328
- * All rows include auto-managed id, created_at, and updated_at fields.
329
- */
330
252
  interface CollectionStore<TRow extends Record<string, unknown> = Record<string, unknown>> {
331
- /**
332
- * Insert a new row. id, created_at, and updated_at are auto-populated.
333
- */
334
253
  insert(row: TRow): Promise<TRow & {
335
254
  id: string;
336
255
  created_at: Date;
337
256
  updated_at: Date;
338
257
  }>;
339
- /**
340
- * Get a single row by id.
341
- */
342
258
  get(id: string): Promise<(TRow & {
343
259
  id: string;
344
260
  created_at: Date;
345
261
  updated_at: Date;
346
262
  }) | null>;
347
- /**
348
- * Find a single row matching the provided filter.
349
- */
350
263
  findOne(filter: Partial<TRow>): Promise<(TRow & {
351
264
  id: string;
352
265
  created_at: Date;
353
266
  updated_at: Date;
354
267
  }) | null>;
355
- /**
356
- * List rows with optional pagination and filtering.
357
- */
358
268
  list(opts?: {
359
269
  limit?: number;
360
270
  offset?: number;
@@ -367,41 +277,21 @@ interface CollectionStore<TRow extends Record<string, unknown> = Record<string,
367
277
  }>;
368
278
  total: number;
369
279
  }>;
370
- /**
371
- * Update a row by id with partial data.
372
- */
373
280
  update(id: string, patch: Partial<TRow>): Promise<TRow & {
374
281
  id: string;
375
282
  created_at: Date;
376
283
  updated_at: Date;
377
284
  }>;
378
- /**
379
- * Delete a row by id. Hard delete only (no soft delete).
380
- */
381
285
  delete(id: string): Promise<{
382
286
  deleted: boolean;
383
287
  }>;
384
288
  }
385
- /**
386
- * Runtime collections context: keyed by collection name.
387
- */
388
289
  type CollectionsContext = Readonly<Record<string, CollectionStore>>;
389
290
  //#endregion
390
291
  //#region ../core/src/contracts/runTypes.d.ts
391
- /**
392
- * Test-suite linkage for a run. When set, this run was started by a TestSuiteOrchestrator
393
- * as one test case inside a TestSuiteRun. The `IsTestRun` node and host-side persisters key
394
- * off the presence of this field. Subworkflow runs inherit it from their parent run.
395
- */
396
292
  interface RunTestContext {
397
293
  readonly testSuiteRunId: string;
398
294
  readonly testCaseIndex: number;
399
- /**
400
- * Optional human-friendly label for this test case (e.g. an email subject when fixtures
401
- * are loaded from a mailbox). Resolved per item by `TestTrigger.caseLabel(item)` if set,
402
- * persisted on `Run.test_case_label` so the Tests-tab tree-table can show "RFQ for batch 14"
403
- * instead of "run_1777755971399_bbb86beac1396".
404
- */
405
295
  readonly testCaseLabel?: string;
406
296
  }
407
297
  type NodeInputsByPort = Readonly<Record<InputPortKey, Items>>;
@@ -412,9 +302,7 @@ interface NodeExecutionError {
412
302
  stack?: string;
413
303
  details?: JsonValue;
414
304
  }
415
- /** Stable id for a single connection invocation row in {@link ConnectionInvocationRecord}. */
416
305
  type ConnectionInvocationId = string;
417
- /** Arguments for appending a {@link ConnectionInvocationRecord} (engine fills run/workflow ids and timestamps). */
418
306
  type ConnectionInvocationAppendArgs = Readonly<{
419
307
  invocationId: ConnectionInvocationId;
420
308
  connectionNodeId: NodeId;
@@ -455,11 +343,6 @@ interface Edge {
455
343
  input: InputPortKey;
456
344
  };
457
345
  }
458
- /**
459
- * Named connection from a parent node to child nodes that exist in {@link WorkflowDefinition.nodes}
460
- * but are not traversed by the main execution graph. Parents are commonly executable nodes, but may
461
- * also be connection-owned nodes for recursive agent attachments.
462
- */
463
346
  interface WorkflowNodeConnection {
464
347
  readonly parentNodeId: NodeId;
465
348
  readonly connectionName: NodeConnectionName;
@@ -470,18 +353,10 @@ interface WorkflowDefinition {
470
353
  name: string;
471
354
  nodes: NodeDefinition[];
472
355
  edges: Edge[];
473
- /**
474
- * Optional metadata: which nodes are connection-owned children (e.g. AI agent `llm` / `tools` slots).
475
- * When omitted, all nodes in {@link nodes} are treated as executable for topology.
476
- */
477
356
  readonly connections?: ReadonlyArray<WorkflowNodeConnection>;
478
- /** Directory + file-stem path under a workflow discovery root (for UI grouping only). */
479
357
  discoveryPathSegments?: readonly string[];
480
- /** Retention for run JSON and binaries (seconds). Host/env may supply defaults when omitted. */
481
358
  readonly prunePolicy?: WorkflowPrunePolicySpec;
482
- /** Whether to keep run data after completion. Host/env may supply defaults when omitted. */
483
359
  readonly storagePolicy?: WorkflowStoragePolicySpec;
484
- /** Invoked after a node fails permanently (retries exhausted) and node error handler did not recover. */
485
360
  readonly workflowErrorHandler?: WorkflowErrorHandlerSpec;
486
361
  }
487
362
  interface NodeConfigBase {
@@ -490,76 +365,31 @@ interface NodeConfigBase {
490
365
  readonly name?: string;
491
366
  readonly id?: NodeId;
492
367
  readonly icon?: string;
368
+ readonly description?: string;
493
369
  readonly execution?: Readonly<{
494
370
  hint?: "local" | "worker";
495
371
  queue?: string;
496
372
  }>;
497
- /** In-process execute retries (runnable nodes). Triggers typically omit this. */
498
373
  readonly retryPolicy?: RetryPolicySpec;
499
- /** Recover from execute failures; return outputs to continue, or rethrow to fail the node. */
500
374
  readonly nodeErrorHandler?: NodeErrorHandlerSpec;
501
- /**
502
- * When true, edges carrying zero items on an output port still schedule single-input downstream nodes.
503
- * Decided from the **source** node that produced the (empty) output. Default (false/undefined): empty
504
- * main batches skip downstream execution and propagate the empty path.
505
- */
506
375
  readonly continueWhenEmptyOutput?: boolean;
507
- /**
508
- * Declared I/O port names for canvas authoring (unioned with ports inferred from edges).
509
- * Use for dynamic routers (Switch) and future error ports.
510
- */
511
376
  readonly declaredOutputPorts?: ReadonlyArray<OutputPortKey>;
512
377
  readonly declaredInputPorts?: ReadonlyArray<InputPortKey>;
513
378
  getCredentialRequirements?(): ReadonlyArray<CredentialRequirement>;
514
- /**
515
- * Marker: this node emits {@link import("./assertionTypes").AssertionResult}-shaped items on its
516
- * `main` port. The TestSuiteOrchestrator (and host-side TestAssertionPersister) listen for
517
- * `nodeCompleted` events from nodes with this flag set, and persist their output items as
518
- * TestAssertion records (only when the run carries a `testContext`). Set on assertion node
519
- * configs (e.g. `AssertionNodeConfig`, `StringEqualsAssertionNodeConfig`).
520
- */
521
379
  readonly emitsAssertions?: true;
522
- /**
523
- * Static configuration summary surfaced in the workflow inspector — the design-time
524
- * "what does this node do" panel that renders before any run telemetry exists.
525
- *
526
- * Return 2–6 short label/value pairs derived from this config (method + url for an HTTP
527
- * call, model + tool list for an agent, schedule + timezone for a cron trigger, etc.).
528
- * Values are truncated by the UI; aim for one line each. Return `undefined` to opt out
529
- * — the inspector hides the section when no rows are produced.
530
- *
531
- * Implement on the config class instance so the function can read sibling config fields.
532
- * `defineNode({ inspectorSummary })` plumbs through to this.
533
- */
534
380
  inspectorSummary?(): ReadonlyArray<NodeInspectorSummaryRow> | undefined;
535
381
  }
536
- /**
537
- * One row of a node's static configuration summary. See {@link NodeConfigBase.inspectorSummary}.
538
- */
539
382
  interface NodeInspectorSummaryRow {
540
383
  readonly label: string;
541
384
  readonly value: string;
542
385
  }
543
386
  declare const runnableNodeInputType: unique symbol;
544
387
  declare const runnableNodeOutputType: unique symbol;
545
- /**
546
- * Runnable node: **`TInputJson`** is what **`inputSchema`** validates on **`item.json`** (the wire payload).
547
- * **`TOutputJson`** is emitted `item.json` on outputs.
548
- */
549
388
  interface RunnableNodeConfig<TInputJson$1 = unknown, TOutputJson$1 = unknown> extends NodeConfigBase {
550
389
  readonly kind: "node";
551
390
  readonly [runnableNodeInputType]?: TInputJson$1;
552
391
  readonly [runnableNodeOutputType]?: TOutputJson$1;
553
- /**
554
- * Optional Zod input contract for {@link RunnableNode} when not set on the node class.
555
- * Resolution order: node instance `inputSchema`, then config `inputSchema`, then `z.unknown()`.
556
- */
557
392
  readonly inputSchema?: ZodType<TInputJson$1>;
558
- /**
559
- * When an activation receives **zero** input items, the engine normally runs `execute` zero times.
560
- * Set to **`runOnce`** to run `execute` once with an empty `items` batch (and a synthetic wire item for schema parsing).
561
- * Used by batch-style callback nodes (built-in `Callback`) so `callback([], ctx)` still runs.
562
- */
563
393
  readonly emptyBatchExecution?: "skip" | "runOnce";
564
394
  }
565
395
  interface NodeDefinition {
@@ -601,27 +431,14 @@ type Items<TJson = unknown> = ReadonlyArray<Item<TJson>>;
601
431
  type NodeOutputs = Partial<Record<OutputPortKey, Items>>;
602
432
  type RunId = string;
603
433
  type NodeActivationId = string;
604
- /**
605
- * One per-item iteration of a runnable node's execute loop. Refines `NodeActivationId` for
606
- * per-item connection invocations and telemetry. Undefined when the executing node is a batch
607
- * node or trigger that does not iterate items.
608
- */
609
434
  type NodeIterationId = string;
610
435
  interface ParentExecutionRef {
611
436
  runId: RunId;
612
437
  workflowId: WorkflowId;
613
438
  nodeId: NodeId;
614
- /** Subworkflow depth of the **spawning** run (0 = root). Passed when starting a child run. */
615
439
  subworkflowDepth?: number;
616
- /** Effective max node activations from the parent run (propagated to child policy merge). */
617
440
  engineMaxNodeActivations?: number;
618
- /** Effective max subworkflow depth from the parent run (propagated to child policy merge). */
619
441
  engineMaxSubworkflowDepth?: number;
620
- /**
621
- * Test-suite linkage inherited by the child subworkflow run. Set by whichever node
622
- * spawns the subworkflow when its own `ctx.testContext` is present, so assertions
623
- * emitted inside a subworkflow land under the correct parent test case.
624
- */
625
442
  testContext?: RunTestContext;
626
443
  }
627
444
  interface RunDataSnapshot {
@@ -629,7 +446,6 @@ interface RunDataSnapshot {
629
446
  getOutputItems<TJson = unknown>(nodeId: NodeId | NodeIdRef<TJson>, output?: OutputPortKey): Items<TJson>;
630
447
  getOutputItem<TJson = unknown>(nodeId: NodeId | NodeIdRef<TJson>, itemIndex: number, output?: OutputPortKey): Item<TJson> | undefined;
631
448
  }
632
- /** Whether to persist run execution data after the workflow finishes. */
633
449
  type WorkflowStoragePolicyMode = "ALL" | "SUCCESS" | "ERROR" | "NEVER";
634
450
  type WorkflowStoragePolicySpec = WorkflowStoragePolicyMode | TypeToken<WorkflowStoragePolicyResolver>;
635
451
  interface WorkflowStoragePolicyResolver {
@@ -676,36 +492,19 @@ interface NodeErrorHandler {
676
492
  type NodeErrorHandlerSpec = TypeToken<NodeErrorHandler> | NodeErrorHandler;
677
493
  //#endregion
678
494
  //#region ../core/src/contracts/runtimeTypes.d.ts
679
- /** Opaque unique identifier for a single HumanTask instance. */
680
495
  type HumanTaskId = string;
681
- /**
682
- * Minimal handle handed to the `deliver` callback so it can route to the correct
683
- * inbox channel.
684
- */
685
496
  interface HumanTaskHandle {
686
497
  readonly taskId: HumanTaskId;
687
498
  readonly runId: string;
688
499
  readonly nodeId: string;
689
500
  readonly expiresAt: Date;
690
- /** TODO: real signed URL; placeholder empty string for now. */
691
501
  readonly resumeUrl: string;
692
- /**
693
- * Arbitrary JSON metadata copied from `SuspensionRequest.request.metadata` at suspension time.
694
- * Used by the agent runtime to round-trip the `agentCheckpoint` back to the
695
- * resumed node via `ctx.resumeContext.task.metadata`.
696
- */
697
502
  readonly metadata?: Readonly<Record<string, JsonValue>>;
698
503
  }
699
- /** Identity of the person who made a decision on the task. */
700
504
  interface HumanTaskActor {
701
505
  readonly actorId: string;
702
506
  readonly displayName?: string;
703
507
  }
704
- /**
705
- * Resume context injected into `NodeExecutionContext` when the engine re-activates
706
- * a previously suspended node. `defineHumanApprovalNode` wraps this with parsed
707
- * `TDecision`; at the engine layer `decision.value` is `unknown`.
708
- */
709
508
  interface ResumeContext {
710
509
  readonly decision: Readonly<{
711
510
  kind: "decided";
@@ -746,11 +545,6 @@ interface NodeExecutionStatePublisher {
746
545
  error: Error;
747
546
  }): Promise<void>;
748
547
  appendConnectionInvocation(args: ConnectionInvocationAppendArgs): Promise<void>;
749
- /**
750
- * Annotates the current snapshot for `nodeId` with the id of the child run spawned by a
751
- * SubWorkflow invocation. Called from `SubWorkflowNode.execute` after `runById` resolves.
752
- * The engine's subsequent `markCompleted` call preserves the value via `previous.childRunId`.
753
- */
754
548
  setChildRunId?(args: {
755
549
  nodeId: NodeId;
756
550
  childRunId: RunId;
@@ -778,32 +572,16 @@ interface ExecutionBinaryService {
778
572
  activationId: NodeActivationId;
779
573
  }): NodeBinaryAttachmentService;
780
574
  openReadStream(attachment: BinaryAttachment): Promise<BinaryStorageReadResult | undefined>;
781
- /**
782
- * Reads all bytes from the attachment into a contiguous `Uint8Array`.
783
- * Checks `attachment.size` against `maxBytes` *before* any allocation; throws a bounded-read
784
- * error when exceeded (no OOM). Throws if the stream is unavailable or the byte count mismatches.
785
- */
786
575
  getBytes(attachment: BinaryAttachment, maxBytes?: number): Promise<Uint8Array>;
787
- /**
788
- * Reads the attachment and decodes the bytes as UTF-8 text.
789
- * Subject to the same bounded-read safety as `getBytes`.
790
- */
791
576
  getText(attachment: BinaryAttachment, maxBytes?: number): Promise<string>;
792
- /**
793
- * Reads the attachment, decodes as UTF-8 text, and parses as JSON.
794
- * Throws a clear error on invalid JSON. Subject to the same bounded-read safety.
795
- */
796
577
  getJson<T = unknown>(attachment: BinaryAttachment, maxBytes?: number): Promise<T>;
797
578
  }
798
579
  interface ExecutionContext {
799
580
  runId: RunId;
800
581
  workflowId: WorkflowId;
801
582
  parent?: ParentExecutionRef;
802
- /** This run's subworkflow depth (0 = root). */
803
583
  subworkflowDepth: number;
804
- /** Effective activation budget cap for this run (after policy merge). */
805
584
  engineMaxNodeActivations: number;
806
- /** Effective subworkflow nesting cap for this run (after policy merge). */
807
585
  engineMaxSubworkflowDepth: number;
808
586
  now: () => Date;
809
587
  data: RunDataSnapshot;
@@ -811,28 +589,11 @@ interface ExecutionContext {
811
589
  telemetry: ExecutionTelemetry;
812
590
  binary: ExecutionBinaryService;
813
591
  getCredential<TSession = unknown>(slotKey: string): Promise<TSession>;
814
- /** Per-item iteration id, set by {@link NodeExecutor} on the ctx passed into runnable `execute`. */
815
592
  iterationId?: NodeIterationId;
816
- /** Item index (0-based) within the current activation's batch; set alongside {@link iterationId}. */
817
593
  itemIndex?: number;
818
- /** When set, this ctx is executing inside a sub-agent triggered by the named parent invocation. */
819
594
  parentInvocationId?: ConnectionInvocationId;
820
- /**
821
- * Present iff the run was started by a TestSuiteOrchestrator. The {@link IsTestRunNode}
822
- * branches on this; assertion-emitting nodes use it to decide whether to record results.
823
- */
824
595
  testContext?: RunTestContext;
825
- /**
826
- * Collections registered in the codemation config, keyed by collection name.
827
- */
828
596
  readonly collections?: CollectionsContext;
829
- /**
830
- * Resolve a DI token from the host container.
831
- * Allows nodes to reach host-side services (e.g. `InboxChannelResolverToken`)
832
- * without importing host code. Wired by `DefaultExecutionContextFactory`; throws
833
- * a clear error when no resolver is configured (e.g. in unit tests that don't
834
- * set up the full container).
835
- */
836
597
  resolve<T>(token: TypeToken<T>): T;
837
598
  }
838
599
  interface NodeExecutionContext<TConfig extends NodeConfigBase = NodeConfigBase> extends ExecutionContext {
@@ -841,12 +602,8 @@ interface NodeExecutionContext<TConfig extends NodeConfigBase = NodeConfigBase>
841
602
  config: TConfig;
842
603
  telemetry: NodeExecutionTelemetry;
843
604
  binary: NodeBinaryAttachmentService;
844
- /**
845
- * Present when this node activation is a HITL resume.
846
- * The node checks `ctx.resumeContext !== undefined` and takes the resume branch.
847
- */
848
605
  resumeContext?: ResumeContext;
849
606
  }
850
607
  //#endregion
851
- export { CredentialSessionFactory as _, RunId as a, WorkflowId as b, Container as c, CredentialAdvancedSectionPresentation as d, CredentialAuthDefinition as f, CredentialMaterialSourceKind as g, CredentialJsonRecord as h, RunDataSnapshot as i, TypeToken as l, CredentialHealthTester as m, Items as n, RunnableNodeConfig as o, CredentialFieldSchema as p, NodeActivationId as r, WorkflowDefinition as s, Item as t, AnyCredentialType as u, CredentialTypeId as v, NodeId as y };
852
- //# sourceMappingURL=runtimeTypes-WCvsnJMY.d.cts.map
608
+ export { CredentialMaterialSourceKind as _, RunId as a, NodeId as b, Container as c, CredentialAccessTokenSessionFactory as d, CredentialAdvancedSectionPresentation as f, CredentialJsonRecord as g, CredentialHealthTester as h, RunDataSnapshot as i, TypeToken as l, CredentialFieldSchema as m, Items as n, RunnableNodeConfig as o, CredentialAuthDefinition as p, NodeActivationId as r, WorkflowDefinition as s, Item as t, AnyCredentialType as u, CredentialSessionFactory as v, WorkflowId as x, CredentialTypeId as y };
609
+ //# sourceMappingURL=runtimeTypes-D_9j5Pat.d.cts.map
@@ -1,5 +1,5 @@
1
1
  const require_chunk = require('./chunk-BaqVhFee.cjs');
2
- const require_token_util$1 = require('./token-util-B2kSJtEV.cjs');
2
+ const require_token_util$1 = require('./token-util-B2Ofk2zk.cjs');
3
3
 
4
4
  //#region ../../node_modules/.pnpm/@vercel+oidc@3.2.0/node_modules/@vercel/oidc/dist/token.js
5
5
  var require_token = /* @__PURE__ */ require_chunk.__commonJS({ "../../node_modules/.pnpm/@vercel+oidc@3.2.0/node_modules/@vercel/oidc/dist/token.js": ((exports, module) => {
@@ -59,4 +59,4 @@ Object.defineProperty(exports, 'default', {
59
59
  return require_token();
60
60
  }
61
61
  });
62
- //# sourceMappingURL=token-CgF09kyP.cjs.map
62
+ //# sourceMappingURL=token-Cbd8b88n.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"token-CgF09kyP.cjs","names":[],"sources":["../../../node_modules/.pnpm/@vercel+oidc@3.2.0/node_modules/@vercel/oidc/dist/token.js"],"sourcesContent":["\"use strict\";\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar token_exports = {};\n__export(token_exports, {\n refreshToken: () => refreshToken\n});\nmodule.exports = __toCommonJS(token_exports);\nvar import_token_error = require(\"./token-error\");\nvar import_token_util = require(\"./token-util\");\nasync function refreshToken(options) {\n let projectId = options?.project;\n let teamId = options?.team;\n if (!projectId && !teamId) {\n const projectInfo = (0, import_token_util.findProjectInfo)();\n projectId = projectInfo.projectId;\n teamId = projectInfo.teamId;\n } else if (!projectId || !teamId) {\n const projectInfo = (0, import_token_util.findProjectInfo)();\n projectId = projectId ?? projectInfo.projectId;\n teamId = teamId ?? projectInfo.teamId;\n }\n if (!projectId) {\n throw new import_token_error.VercelOidcTokenError(\n \"Failed to refresh OIDC token: No project specified. Try re-linking your project with `vc link`\"\n );\n }\n let maybeToken = (0, import_token_util.loadToken)(projectId);\n if (!maybeToken || (0, import_token_util.isExpired)((0, import_token_util.getTokenPayload)(maybeToken.token), options?.expirationBufferMs)) {\n const authToken = await (0, import_token_util.getVercelToken)({\n expirationBufferMs: options?.expirationBufferMs\n });\n maybeToken = await (0, import_token_util.getVercelOidcToken)(authToken, projectId, teamId);\n if (!maybeToken) {\n throw new import_token_error.VercelOidcTokenError(\"Failed to refresh OIDC token\");\n }\n (0, import_token_util.saveToken)(maybeToken, projectId);\n }\n process.env.VERCEL_OIDC_TOKEN = maybeToken.token;\n return;\n}\n// Annotate the CommonJS export names for ESM import in node:\n0 && (module.exports = {\n refreshToken\n});\n"],"x_google_ignoreList":[0],"mappings":";;;;;CACA,IAAI,YAAY,OAAO;CACvB,IAAI,mBAAmB,OAAO;CAC9B,IAAI,oBAAoB,OAAO;CAC/B,IAAI,eAAe,OAAO,UAAU;CACpC,IAAI,YAAY,QAAQ,QAAQ;AAC9B,OAAK,IAAI,QAAQ,IACf,WAAU,QAAQ,MAAM;GAAE,KAAK,IAAI;GAAO,YAAY;GAAM,CAAC;;CAEjE,IAAI,eAAe,IAAI,MAAM,QAAQ,SAAS;AAC5C,MAAI,QAAQ,OAAO,SAAS,YAAY,OAAO,SAAS,YACtD;QAAK,IAAI,OAAO,kBAAkB,KAAK,CACrC,KAAI,CAAC,aAAa,KAAK,IAAI,IAAI,IAAI,QAAQ,OACzC,WAAU,IAAI,KAAK;IAAE,WAAW,KAAK;IAAM,YAAY,EAAE,OAAO,iBAAiB,MAAM,IAAI,KAAK,KAAK;IAAY,CAAC;;AAExH,SAAO;;CAET,IAAI,gBAAgB,QAAQ,YAAY,UAAU,EAAE,EAAE,cAAc,EAAE,OAAO,MAAM,CAAC,EAAE,IAAI;CAC1F,IAAI,gBAAgB,EAAE;AACtB,UAAS,eAAe,EACtB,oBAAoB,cACrB,CAAC;AACF,QAAO,UAAU,aAAa,cAAc;CAC5C,IAAI;CACJ,IAAI;CACJ,eAAe,aAAa,SAAS;EACnC,IAAI,YAAY,SAAS;EACzB,IAAI,SAAS,SAAS;AACtB,MAAI,CAAC,aAAa,CAAC,QAAQ;GACzB,MAAM,eAAe,GAAG,kBAAkB,kBAAkB;AAC5D,eAAY,YAAY;AACxB,YAAS,YAAY;aACZ,CAAC,aAAa,CAAC,QAAQ;GAChC,MAAM,eAAe,GAAG,kBAAkB,kBAAkB;AAC5D,eAAY,aAAa,YAAY;AACrC,YAAS,UAAU,YAAY;;AAEjC,MAAI,CAAC,UACH,OAAM,IAAI,mBAAmB,qBAC3B,iGACD;EAEH,IAAI,cAAc,GAAG,kBAAkB,WAAW,UAAU;AAC5D,MAAI,CAAC,eAAe,GAAG,kBAAkB,YAAY,GAAG,kBAAkB,iBAAiB,WAAW,MAAM,EAAE,SAAS,mBAAmB,EAAE;GAC1I,MAAM,YAAY,OAAO,GAAG,kBAAkB,gBAAgB,EAC5D,oBAAoB,SAAS,oBAC9B,CAAC;AACF,gBAAa,OAAO,GAAG,kBAAkB,oBAAoB,WAAW,WAAW,OAAO;AAC1F,OAAI,CAAC,WACH,OAAM,IAAI,mBAAmB,qBAAqB,+BAA+B;AAEnF,IAAC,GAAG,kBAAkB,WAAW,YAAY,UAAU;;AAEzD,UAAQ,IAAI,oBAAoB,WAAW"}
1
+ {"version":3,"file":"token-Cbd8b88n.cjs","names":[],"sources":["../../../node_modules/.pnpm/@vercel+oidc@3.2.0/node_modules/@vercel/oidc/dist/token.js"],"sourcesContent":["\"use strict\";\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar token_exports = {};\n__export(token_exports, {\n refreshToken: () => refreshToken\n});\nmodule.exports = __toCommonJS(token_exports);\nvar import_token_error = require(\"./token-error\");\nvar import_token_util = require(\"./token-util\");\nasync function refreshToken(options) {\n let projectId = options?.project;\n let teamId = options?.team;\n if (!projectId && !teamId) {\n const projectInfo = (0, import_token_util.findProjectInfo)();\n projectId = projectInfo.projectId;\n teamId = projectInfo.teamId;\n } else if (!projectId || !teamId) {\n const projectInfo = (0, import_token_util.findProjectInfo)();\n projectId = projectId ?? projectInfo.projectId;\n teamId = teamId ?? projectInfo.teamId;\n }\n if (!projectId) {\n throw new import_token_error.VercelOidcTokenError(\n \"Failed to refresh OIDC token: No project specified. Try re-linking your project with `vc link`\"\n );\n }\n let maybeToken = (0, import_token_util.loadToken)(projectId);\n if (!maybeToken || (0, import_token_util.isExpired)((0, import_token_util.getTokenPayload)(maybeToken.token), options?.expirationBufferMs)) {\n const authToken = await (0, import_token_util.getVercelToken)({\n expirationBufferMs: options?.expirationBufferMs\n });\n maybeToken = await (0, import_token_util.getVercelOidcToken)(authToken, projectId, teamId);\n if (!maybeToken) {\n throw new import_token_error.VercelOidcTokenError(\"Failed to refresh OIDC token\");\n }\n (0, import_token_util.saveToken)(maybeToken, projectId);\n }\n process.env.VERCEL_OIDC_TOKEN = maybeToken.token;\n return;\n}\n// Annotate the CommonJS export names for ESM import in node:\n0 && (module.exports = {\n refreshToken\n});\n"],"x_google_ignoreList":[0],"mappings":";;;;;CACA,IAAI,YAAY,OAAO;CACvB,IAAI,mBAAmB,OAAO;CAC9B,IAAI,oBAAoB,OAAO;CAC/B,IAAI,eAAe,OAAO,UAAU;CACpC,IAAI,YAAY,QAAQ,QAAQ;AAC9B,OAAK,IAAI,QAAQ,IACf,WAAU,QAAQ,MAAM;GAAE,KAAK,IAAI;GAAO,YAAY;GAAM,CAAC;;CAEjE,IAAI,eAAe,IAAI,MAAM,QAAQ,SAAS;AAC5C,MAAI,QAAQ,OAAO,SAAS,YAAY,OAAO,SAAS,YACtD;QAAK,IAAI,OAAO,kBAAkB,KAAK,CACrC,KAAI,CAAC,aAAa,KAAK,IAAI,IAAI,IAAI,QAAQ,OACzC,WAAU,IAAI,KAAK;IAAE,WAAW,KAAK;IAAM,YAAY,EAAE,OAAO,iBAAiB,MAAM,IAAI,KAAK,KAAK;IAAY,CAAC;;AAExH,SAAO;;CAET,IAAI,gBAAgB,QAAQ,YAAY,UAAU,EAAE,EAAE,cAAc,EAAE,OAAO,MAAM,CAAC,EAAE,IAAI;CAC1F,IAAI,gBAAgB,EAAE;AACtB,UAAS,eAAe,EACtB,oBAAoB,cACrB,CAAC;AACF,QAAO,UAAU,aAAa,cAAc;CAC5C,IAAI;CACJ,IAAI;CACJ,eAAe,aAAa,SAAS;EACnC,IAAI,YAAY,SAAS;EACzB,IAAI,SAAS,SAAS;AACtB,MAAI,CAAC,aAAa,CAAC,QAAQ;GACzB,MAAM,eAAe,GAAG,kBAAkB,kBAAkB;AAC5D,eAAY,YAAY;AACxB,YAAS,YAAY;aACZ,CAAC,aAAa,CAAC,QAAQ;GAChC,MAAM,eAAe,GAAG,kBAAkB,kBAAkB;AAC5D,eAAY,aAAa,YAAY;AACrC,YAAS,UAAU,YAAY;;AAEjC,MAAI,CAAC,UACH,OAAM,IAAI,mBAAmB,qBAC3B,iGACD;EAEH,IAAI,cAAc,GAAG,kBAAkB,WAAW,UAAU;AAC5D,MAAI,CAAC,eAAe,GAAG,kBAAkB,YAAY,GAAG,kBAAkB,iBAAiB,WAAW,MAAM,EAAE,SAAS,mBAAmB,EAAE;GAC1I,MAAM,YAAY,OAAO,GAAG,kBAAkB,gBAAgB,EAC5D,oBAAoB,SAAS,oBAC9B,CAAC;AACF,gBAAa,OAAO,GAAG,kBAAkB,oBAAoB,WAAW,WAAW,OAAO;AAC1F,OAAI,CAAC,WACH,OAAM,IAAI,mBAAmB,qBAAqB,+BAA+B;AAEnF,IAAC,GAAG,kBAAkB,WAAW,YAAY,UAAU;;AAEzD,UAAQ,IAAI,oBAAoB,WAAW"}
@@ -1,4 +1,4 @@
1
- import { i as __commonJS, r as require_token_error, t as require_token_util } from "./token-util-EUxa8JtH.js";
1
+ import { i as __commonJS, r as require_token_error, t as require_token_util } from "./token-util-CfNdwRXi.js";
2
2
 
3
3
  //#region ../../node_modules/.pnpm/@vercel+oidc@3.2.0/node_modules/@vercel/oidc/dist/token.js
4
4
  var require_token = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/@vercel+oidc@3.2.0/node_modules/@vercel/oidc/dist/token.js": ((exports, module) => {
@@ -55,4 +55,4 @@ var require_token = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/@verc
55
55
  export default require_token();
56
56
 
57
57
  export { };
58
- //# sourceMappingURL=token-CIu4PqRI.js.map
58
+ //# sourceMappingURL=token-P-r3QR1d.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"token-CIu4PqRI.js","names":[],"sources":["../../../node_modules/.pnpm/@vercel+oidc@3.2.0/node_modules/@vercel/oidc/dist/token.js"],"sourcesContent":["\"use strict\";\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar token_exports = {};\n__export(token_exports, {\n refreshToken: () => refreshToken\n});\nmodule.exports = __toCommonJS(token_exports);\nvar import_token_error = require(\"./token-error\");\nvar import_token_util = require(\"./token-util\");\nasync function refreshToken(options) {\n let projectId = options?.project;\n let teamId = options?.team;\n if (!projectId && !teamId) {\n const projectInfo = (0, import_token_util.findProjectInfo)();\n projectId = projectInfo.projectId;\n teamId = projectInfo.teamId;\n } else if (!projectId || !teamId) {\n const projectInfo = (0, import_token_util.findProjectInfo)();\n projectId = projectId ?? projectInfo.projectId;\n teamId = teamId ?? projectInfo.teamId;\n }\n if (!projectId) {\n throw new import_token_error.VercelOidcTokenError(\n \"Failed to refresh OIDC token: No project specified. Try re-linking your project with `vc link`\"\n );\n }\n let maybeToken = (0, import_token_util.loadToken)(projectId);\n if (!maybeToken || (0, import_token_util.isExpired)((0, import_token_util.getTokenPayload)(maybeToken.token), options?.expirationBufferMs)) {\n const authToken = await (0, import_token_util.getVercelToken)({\n expirationBufferMs: options?.expirationBufferMs\n });\n maybeToken = await (0, import_token_util.getVercelOidcToken)(authToken, projectId, teamId);\n if (!maybeToken) {\n throw new import_token_error.VercelOidcTokenError(\"Failed to refresh OIDC token\");\n }\n (0, import_token_util.saveToken)(maybeToken, projectId);\n }\n process.env.VERCEL_OIDC_TOKEN = maybeToken.token;\n return;\n}\n// Annotate the CommonJS export names for ESM import in node:\n0 && (module.exports = {\n refreshToken\n});\n"],"x_google_ignoreList":[0],"mappings":";;;;CACA,IAAI,YAAY,OAAO;CACvB,IAAI,mBAAmB,OAAO;CAC9B,IAAI,oBAAoB,OAAO;CAC/B,IAAI,eAAe,OAAO,UAAU;CACpC,IAAI,YAAY,QAAQ,QAAQ;AAC9B,OAAK,IAAI,QAAQ,IACf,WAAU,QAAQ,MAAM;GAAE,KAAK,IAAI;GAAO,YAAY;GAAM,CAAC;;CAEjE,IAAI,eAAe,IAAI,MAAM,QAAQ,SAAS;AAC5C,MAAI,QAAQ,OAAO,SAAS,YAAY,OAAO,SAAS,YACtD;QAAK,IAAI,OAAO,kBAAkB,KAAK,CACrC,KAAI,CAAC,aAAa,KAAK,IAAI,IAAI,IAAI,QAAQ,OACzC,WAAU,IAAI,KAAK;IAAE,WAAW,KAAK;IAAM,YAAY,EAAE,OAAO,iBAAiB,MAAM,IAAI,KAAK,KAAK;IAAY,CAAC;;AAExH,SAAO;;CAET,IAAI,gBAAgB,QAAQ,YAAY,UAAU,EAAE,EAAE,cAAc,EAAE,OAAO,MAAM,CAAC,EAAE,IAAI;CAC1F,IAAI,gBAAgB,EAAE;AACtB,UAAS,eAAe,EACtB,oBAAoB,cACrB,CAAC;AACF,QAAO,UAAU,aAAa,cAAc;CAC5C,IAAI;CACJ,IAAI;CACJ,eAAe,aAAa,SAAS;EACnC,IAAI,YAAY,SAAS;EACzB,IAAI,SAAS,SAAS;AACtB,MAAI,CAAC,aAAa,CAAC,QAAQ;GACzB,MAAM,eAAe,GAAG,kBAAkB,kBAAkB;AAC5D,eAAY,YAAY;AACxB,YAAS,YAAY;aACZ,CAAC,aAAa,CAAC,QAAQ;GAChC,MAAM,eAAe,GAAG,kBAAkB,kBAAkB;AAC5D,eAAY,aAAa,YAAY;AACrC,YAAS,UAAU,YAAY;;AAEjC,MAAI,CAAC,UACH,OAAM,IAAI,mBAAmB,qBAC3B,iGACD;EAEH,IAAI,cAAc,GAAG,kBAAkB,WAAW,UAAU;AAC5D,MAAI,CAAC,eAAe,GAAG,kBAAkB,YAAY,GAAG,kBAAkB,iBAAiB,WAAW,MAAM,EAAE,SAAS,mBAAmB,EAAE;GAC1I,MAAM,YAAY,OAAO,GAAG,kBAAkB,gBAAgB,EAC5D,oBAAoB,SAAS,oBAC9B,CAAC;AACF,gBAAa,OAAO,GAAG,kBAAkB,oBAAoB,WAAW,WAAW,OAAO;AAC1F,OAAI,CAAC,WACH,OAAM,IAAI,mBAAmB,qBAAqB,+BAA+B;AAEnF,IAAC,GAAG,kBAAkB,WAAW,YAAY,UAAU;;AAEzD,UAAQ,IAAI,oBAAoB,WAAW"}
1
+ {"version":3,"file":"token-P-r3QR1d.js","names":[],"sources":["../../../node_modules/.pnpm/@vercel+oidc@3.2.0/node_modules/@vercel/oidc/dist/token.js"],"sourcesContent":["\"use strict\";\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar token_exports = {};\n__export(token_exports, {\n refreshToken: () => refreshToken\n});\nmodule.exports = __toCommonJS(token_exports);\nvar import_token_error = require(\"./token-error\");\nvar import_token_util = require(\"./token-util\");\nasync function refreshToken(options) {\n let projectId = options?.project;\n let teamId = options?.team;\n if (!projectId && !teamId) {\n const projectInfo = (0, import_token_util.findProjectInfo)();\n projectId = projectInfo.projectId;\n teamId = projectInfo.teamId;\n } else if (!projectId || !teamId) {\n const projectInfo = (0, import_token_util.findProjectInfo)();\n projectId = projectId ?? projectInfo.projectId;\n teamId = teamId ?? projectInfo.teamId;\n }\n if (!projectId) {\n throw new import_token_error.VercelOidcTokenError(\n \"Failed to refresh OIDC token: No project specified. Try re-linking your project with `vc link`\"\n );\n }\n let maybeToken = (0, import_token_util.loadToken)(projectId);\n if (!maybeToken || (0, import_token_util.isExpired)((0, import_token_util.getTokenPayload)(maybeToken.token), options?.expirationBufferMs)) {\n const authToken = await (0, import_token_util.getVercelToken)({\n expirationBufferMs: options?.expirationBufferMs\n });\n maybeToken = await (0, import_token_util.getVercelOidcToken)(authToken, projectId, teamId);\n if (!maybeToken) {\n throw new import_token_error.VercelOidcTokenError(\"Failed to refresh OIDC token\");\n }\n (0, import_token_util.saveToken)(maybeToken, projectId);\n }\n process.env.VERCEL_OIDC_TOKEN = maybeToken.token;\n return;\n}\n// Annotate the CommonJS export names for ESM import in node:\n0 && (module.exports = {\n refreshToken\n});\n"],"x_google_ignoreList":[0],"mappings":";;;;CACA,IAAI,YAAY,OAAO;CACvB,IAAI,mBAAmB,OAAO;CAC9B,IAAI,oBAAoB,OAAO;CAC/B,IAAI,eAAe,OAAO,UAAU;CACpC,IAAI,YAAY,QAAQ,QAAQ;AAC9B,OAAK,IAAI,QAAQ,IACf,WAAU,QAAQ,MAAM;GAAE,KAAK,IAAI;GAAO,YAAY;GAAM,CAAC;;CAEjE,IAAI,eAAe,IAAI,MAAM,QAAQ,SAAS;AAC5C,MAAI,QAAQ,OAAO,SAAS,YAAY,OAAO,SAAS,YACtD;QAAK,IAAI,OAAO,kBAAkB,KAAK,CACrC,KAAI,CAAC,aAAa,KAAK,IAAI,IAAI,IAAI,QAAQ,OACzC,WAAU,IAAI,KAAK;IAAE,WAAW,KAAK;IAAM,YAAY,EAAE,OAAO,iBAAiB,MAAM,IAAI,KAAK,KAAK;IAAY,CAAC;;AAExH,SAAO;;CAET,IAAI,gBAAgB,QAAQ,YAAY,UAAU,EAAE,EAAE,cAAc,EAAE,OAAO,MAAM,CAAC,EAAE,IAAI;CAC1F,IAAI,gBAAgB,EAAE;AACtB,UAAS,eAAe,EACtB,oBAAoB,cACrB,CAAC;AACF,QAAO,UAAU,aAAa,cAAc;CAC5C,IAAI;CACJ,IAAI;CACJ,eAAe,aAAa,SAAS;EACnC,IAAI,YAAY,SAAS;EACzB,IAAI,SAAS,SAAS;AACtB,MAAI,CAAC,aAAa,CAAC,QAAQ;GACzB,MAAM,eAAe,GAAG,kBAAkB,kBAAkB;AAC5D,eAAY,YAAY;AACxB,YAAS,YAAY;aACZ,CAAC,aAAa,CAAC,QAAQ;GAChC,MAAM,eAAe,GAAG,kBAAkB,kBAAkB;AAC5D,eAAY,aAAa,YAAY;AACrC,YAAS,UAAU,YAAY;;AAEjC,MAAI,CAAC,UACH,OAAM,IAAI,mBAAmB,qBAC3B,iGACD;EAEH,IAAI,cAAc,GAAG,kBAAkB,WAAW,UAAU;AAC5D,MAAI,CAAC,eAAe,GAAG,kBAAkB,YAAY,GAAG,kBAAkB,iBAAiB,WAAW,MAAM,EAAE,SAAS,mBAAmB,EAAE;GAC1I,MAAM,YAAY,OAAO,GAAG,kBAAkB,gBAAgB,EAC5D,oBAAoB,SAAS,oBAC9B,CAAC;AACF,gBAAa,OAAO,GAAG,kBAAkB,oBAAoB,WAAW,WAAW,OAAO;AAC1F,OAAI,CAAC,WACH,OAAM,IAAI,mBAAmB,qBAAqB,+BAA+B;AAEnF,IAAC,GAAG,kBAAkB,WAAW,YAAY,UAAU;;AAEzD,UAAQ,IAAI,oBAAoB,WAAW"}