@codemation/core-nodes-ocr 0.2.1 → 0.2.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.
- package/CHANGELOG.md +14 -0
- package/dist/codemation.plugin.cjs +254 -8
- package/dist/codemation.plugin.cjs.map +1 -1
- package/dist/codemation.plugin.d.cts +7 -1
- package/dist/codemation.plugin.d.ts +7 -1
- package/dist/codemation.plugin.js +255 -9
- package/dist/codemation.plugin.js.map +1 -1
- package/dist/{index-C2KJPzqN.d.ts → index-rc7dB1Ws.d.ts} +353 -281
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/metadata.json +4 -4
- package/dist/{runtimeTypes-ffl603pJ.d.cts → runtimeTypes-MQgcsey7.d.cts} +265 -193
- package/package.json +2 -2
- package/dist/index-DoHR1J8T.d.ts +0 -880
- package/dist/index-OvXJkNm1.d.ts +0 -874
- package/dist/runtimeTypes-C6YqmQG-.d.cts +0 -762
package/dist/index.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { _ as CredentialSessionFactory, a as
|
|
1
|
+
import { _ as CredentialSessionFactory, a as RunId, b as WorkflowId, d as CredentialAdvancedSectionPresentation, f as CredentialAuthDefinition, g as CredentialMaterialSourceKind, h as CredentialJsonRecord, i as RunDataSnapshot, l as TypeToken, m as CredentialHealthTester, n as Items, o as RunnableNodeConfig, p as CredentialFieldSchema, r as NodeActivationId, t as Item, u as AnyCredentialType, v as CredentialTypeId, y as NodeId } from "./runtimeTypes-MQgcsey7.cjs";
|
|
2
2
|
import { ZodType } from "zod";
|
|
3
3
|
import { AnalysisResult } from "@azure/ai-content-understanding";
|
|
4
4
|
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { d as CredentialAuthDefinition, f as CredentialFieldSchema, g as CredentialTypeId, h as CredentialSessionFactory, l as AnyCredentialType, m as CredentialMaterialSourceKind, p as CredentialHealthTester,
|
|
1
|
+
import { d as CredentialAuthDefinition, f as CredentialFieldSchema, g as CredentialTypeId, h as CredentialSessionFactory, l as AnyCredentialType, m as CredentialMaterialSourceKind, p as CredentialHealthTester, s as DefinedNode, u as CredentialAdvancedSectionPresentation } from "./index-rc7dB1Ws.js";
|
|
2
2
|
import { AnalysisResult } from "@azure/ai-content-understanding";
|
|
3
3
|
|
|
4
4
|
//#region src/credentials/azureContentUnderstandingCredential.d.ts
|
package/dist/metadata.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schemaVersion": 1,
|
|
3
3
|
"packageName": "@codemation/core-nodes-ocr",
|
|
4
|
-
"packageVersion": "0.2.
|
|
4
|
+
"packageVersion": "0.2.3",
|
|
5
5
|
"description": "Azure AI Content Understanding (OCR) plugin for Codemation — prebuilt document, invoice, and image analyzers.",
|
|
6
6
|
"kind": "nodes",
|
|
7
7
|
"nodes": [
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"credentialRefs": [
|
|
19
19
|
"azureContentUnderstandingCredentialType"
|
|
20
20
|
],
|
|
21
|
-
"sourcePath": "src
|
|
21
|
+
"sourcePath": "src/nodes/analyzeDocumentNode.ts"
|
|
22
22
|
},
|
|
23
23
|
{
|
|
24
24
|
"name": "Analyze Image",
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"credentialRefs": [
|
|
34
34
|
"azureContentUnderstandingCredentialType"
|
|
35
35
|
],
|
|
36
|
-
"sourcePath": "src
|
|
36
|
+
"sourcePath": "src/nodes/analyzeImageNode.ts"
|
|
37
37
|
},
|
|
38
38
|
{
|
|
39
39
|
"name": "Analyze Invoice",
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
"credentialRefs": [
|
|
49
49
|
"azureContentUnderstandingCredentialType"
|
|
50
50
|
],
|
|
51
|
-
"sourcePath": "src
|
|
51
|
+
"sourcePath": "src/nodes/analyzeInvoiceNode.ts"
|
|
52
52
|
}
|
|
53
53
|
],
|
|
54
54
|
"credentials": [
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { ReadableStream } from "node:stream/web";
|
|
2
1
|
import { ZodType } from "zod";
|
|
3
2
|
import { DependencyContainer as Container, InjectionToken as TypeToken } from "tsyringe";
|
|
3
|
+
import { ReadableStream } from "node:stream/web";
|
|
4
4
|
|
|
5
5
|
//#region ../core/src/contracts/baseTypes.d.ts
|
|
6
6
|
/**
|
|
@@ -14,6 +14,137 @@ type OutputPortKey = string;
|
|
|
14
14
|
type InputPortKey = string;
|
|
15
15
|
type NodeConnectionName = string;
|
|
16
16
|
//#endregion
|
|
17
|
+
//#region ../core/src/contracts/CostTrackingTelemetryContract.d.ts
|
|
18
|
+
type CostTrackingComponent = "chat" | "ocr" | "rag";
|
|
19
|
+
interface CostTrackingUsageRecord {
|
|
20
|
+
readonly component: CostTrackingComponent;
|
|
21
|
+
readonly provider: string;
|
|
22
|
+
readonly operation: string;
|
|
23
|
+
readonly pricingKey: string;
|
|
24
|
+
readonly usageUnit: string;
|
|
25
|
+
readonly quantity: number;
|
|
26
|
+
readonly modelName?: string;
|
|
27
|
+
readonly attributes?: TelemetryAttributes;
|
|
28
|
+
}
|
|
29
|
+
interface CostTrackingPriceQuote {
|
|
30
|
+
readonly currency: string;
|
|
31
|
+
readonly currencyScale: number;
|
|
32
|
+
readonly estimatedAmountMinor: number;
|
|
33
|
+
readonly estimateKind: "catalog";
|
|
34
|
+
}
|
|
35
|
+
interface CostTrackingTelemetry {
|
|
36
|
+
captureUsage(args: CostTrackingUsageRecord): Promise<CostTrackingPriceQuote | undefined>;
|
|
37
|
+
forScope(scope: TelemetryScope): CostTrackingTelemetry;
|
|
38
|
+
}
|
|
39
|
+
//#endregion
|
|
40
|
+
//#region ../core/src/contracts/telemetryTypes.d.ts
|
|
41
|
+
type TelemetryAttributePrimitive = string | number | boolean | null;
|
|
42
|
+
interface TelemetryAttributes {
|
|
43
|
+
readonly [key: string]: TelemetryAttributePrimitive | undefined;
|
|
44
|
+
}
|
|
45
|
+
interface TelemetryMetricRecord {
|
|
46
|
+
readonly name: string;
|
|
47
|
+
readonly value: number;
|
|
48
|
+
readonly unit?: string;
|
|
49
|
+
readonly attributes?: TelemetryAttributes;
|
|
50
|
+
}
|
|
51
|
+
interface TelemetrySpanEventRecord {
|
|
52
|
+
readonly name: string;
|
|
53
|
+
readonly occurredAt?: Date;
|
|
54
|
+
readonly attributes?: TelemetryAttributes;
|
|
55
|
+
}
|
|
56
|
+
interface TelemetryArtifactAttachment {
|
|
57
|
+
readonly kind: string;
|
|
58
|
+
readonly contentType: string;
|
|
59
|
+
readonly previewText?: string;
|
|
60
|
+
readonly previewJson?: JsonValue;
|
|
61
|
+
readonly payloadText?: string;
|
|
62
|
+
readonly payloadJson?: JsonValue;
|
|
63
|
+
readonly bytes?: number;
|
|
64
|
+
readonly truncated?: boolean;
|
|
65
|
+
readonly expiresAt?: Date;
|
|
66
|
+
}
|
|
67
|
+
interface TelemetryArtifactReference {
|
|
68
|
+
readonly artifactId: string;
|
|
69
|
+
readonly traceId?: string;
|
|
70
|
+
readonly spanId?: string;
|
|
71
|
+
}
|
|
72
|
+
interface TelemetrySpanEnd {
|
|
73
|
+
readonly status?: "ok" | "error";
|
|
74
|
+
readonly statusMessage?: string;
|
|
75
|
+
readonly endedAt?: Date;
|
|
76
|
+
readonly attributes?: TelemetryAttributes;
|
|
77
|
+
}
|
|
78
|
+
interface TelemetryChildSpanStart {
|
|
79
|
+
readonly name: string;
|
|
80
|
+
readonly kind?: "internal" | "client";
|
|
81
|
+
readonly startedAt?: Date;
|
|
82
|
+
readonly attributes?: TelemetryAttributes;
|
|
83
|
+
}
|
|
84
|
+
interface TelemetryScope {
|
|
85
|
+
readonly traceId?: string;
|
|
86
|
+
readonly spanId?: string;
|
|
87
|
+
readonly costTracking?: CostTrackingTelemetry;
|
|
88
|
+
addSpanEvent(args: TelemetrySpanEventRecord): Promise<void> | void;
|
|
89
|
+
recordMetric(args: TelemetryMetricRecord): Promise<void> | void;
|
|
90
|
+
attachArtifact(args: TelemetryArtifactAttachment): Promise<TelemetryArtifactReference> | TelemetryArtifactReference;
|
|
91
|
+
}
|
|
92
|
+
interface TelemetrySpanScope extends TelemetryScope {
|
|
93
|
+
readonly traceId: string;
|
|
94
|
+
readonly spanId: string;
|
|
95
|
+
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
|
+
asNodeTelemetry(args: Readonly<{
|
|
104
|
+
nodeId: NodeId;
|
|
105
|
+
activationId: NodeActivationId;
|
|
106
|
+
}>): NodeExecutionTelemetry;
|
|
107
|
+
}
|
|
108
|
+
interface NodeExecutionTelemetry extends ExecutionTelemetry, TelemetrySpanScope {
|
|
109
|
+
startChildSpan(args: TelemetryChildSpanStart): TelemetrySpanScope;
|
|
110
|
+
}
|
|
111
|
+
interface ExecutionTelemetry extends TelemetryScope {
|
|
112
|
+
readonly traceId: string;
|
|
113
|
+
readonly spanId: string;
|
|
114
|
+
forNode(args: Readonly<{
|
|
115
|
+
nodeId: NodeId;
|
|
116
|
+
activationId: NodeActivationId;
|
|
117
|
+
}>): NodeExecutionTelemetry;
|
|
118
|
+
}
|
|
119
|
+
//#endregion
|
|
120
|
+
//#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
|
+
type RetryPolicySpec = NoneRetryPolicySpec | FixedRetryPolicySpec | ExponentialRetryPolicySpec;
|
|
128
|
+
interface NoneRetryPolicySpec {
|
|
129
|
+
readonly kind: "none";
|
|
130
|
+
}
|
|
131
|
+
interface FixedRetryPolicySpec {
|
|
132
|
+
readonly kind: "fixed";
|
|
133
|
+
/** Total attempts including the first execution. Must be >= 1. */
|
|
134
|
+
readonly maxAttempts: number;
|
|
135
|
+
readonly delayMs: number;
|
|
136
|
+
}
|
|
137
|
+
interface ExponentialRetryPolicySpec {
|
|
138
|
+
readonly kind: "exponential";
|
|
139
|
+
/** Total attempts including the first execution. Must be >= 1. */
|
|
140
|
+
readonly maxAttempts: number;
|
|
141
|
+
readonly initialDelayMs: number;
|
|
142
|
+
readonly multiplier: number;
|
|
143
|
+
readonly maxDelayMs?: number;
|
|
144
|
+
/** When true, each delay is multiplied by a random factor in [1, 1.2). */
|
|
145
|
+
readonly jitter?: boolean;
|
|
146
|
+
}
|
|
147
|
+
//#endregion
|
|
17
148
|
//#region ../core/src/contracts/credentialTypes.d.ts
|
|
18
149
|
type CredentialTypeId = string;
|
|
19
150
|
type CredentialInstanceId = string;
|
|
@@ -149,6 +280,19 @@ type CredentialInstanceRecord<TPublicConfig extends CredentialJsonRecord = Crede
|
|
|
149
280
|
setupStatus: CredentialSetupStatus;
|
|
150
281
|
createdAt: string;
|
|
151
282
|
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
|
+
material: Readonly<{
|
|
293
|
+
source: "local" | "control-plane";
|
|
294
|
+
ref: string;
|
|
295
|
+
}>;
|
|
152
296
|
}>;
|
|
153
297
|
/**
|
|
154
298
|
* Arguments passed to `CredentialType.createSession` and `CredentialType.test`.
|
|
@@ -178,6 +322,71 @@ type CredentialType<TPublicConfig extends CredentialJsonRecord = CredentialJsonR
|
|
|
178
322
|
*/
|
|
179
323
|
type AnyCredentialType = CredentialType<any, any, unknown>;
|
|
180
324
|
//#endregion
|
|
325
|
+
//#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
|
+
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
|
+
insert(row: TRow): Promise<TRow & {
|
|
335
|
+
id: string;
|
|
336
|
+
created_at: Date;
|
|
337
|
+
updated_at: Date;
|
|
338
|
+
}>;
|
|
339
|
+
/**
|
|
340
|
+
* Get a single row by id.
|
|
341
|
+
*/
|
|
342
|
+
get(id: string): Promise<(TRow & {
|
|
343
|
+
id: string;
|
|
344
|
+
created_at: Date;
|
|
345
|
+
updated_at: Date;
|
|
346
|
+
}) | null>;
|
|
347
|
+
/**
|
|
348
|
+
* Find a single row matching the provided filter.
|
|
349
|
+
*/
|
|
350
|
+
findOne(filter: Partial<TRow>): Promise<(TRow & {
|
|
351
|
+
id: string;
|
|
352
|
+
created_at: Date;
|
|
353
|
+
updated_at: Date;
|
|
354
|
+
}) | null>;
|
|
355
|
+
/**
|
|
356
|
+
* List rows with optional pagination and filtering.
|
|
357
|
+
*/
|
|
358
|
+
list(opts?: {
|
|
359
|
+
limit?: number;
|
|
360
|
+
offset?: number;
|
|
361
|
+
where?: Partial<TRow>;
|
|
362
|
+
}): Promise<{
|
|
363
|
+
rows: ReadonlyArray<TRow & {
|
|
364
|
+
id: string;
|
|
365
|
+
created_at: Date;
|
|
366
|
+
updated_at: Date;
|
|
367
|
+
}>;
|
|
368
|
+
total: number;
|
|
369
|
+
}>;
|
|
370
|
+
/**
|
|
371
|
+
* Update a row by id with partial data.
|
|
372
|
+
*/
|
|
373
|
+
update(id: string, patch: Partial<TRow>): Promise<TRow & {
|
|
374
|
+
id: string;
|
|
375
|
+
created_at: Date;
|
|
376
|
+
updated_at: Date;
|
|
377
|
+
}>;
|
|
378
|
+
/**
|
|
379
|
+
* Delete a row by id. Hard delete only (no soft delete).
|
|
380
|
+
*/
|
|
381
|
+
delete(id: string): Promise<{
|
|
382
|
+
deleted: boolean;
|
|
383
|
+
}>;
|
|
384
|
+
}
|
|
385
|
+
/**
|
|
386
|
+
* Runtime collections context: keyed by collection name.
|
|
387
|
+
*/
|
|
388
|
+
type CollectionsContext = Readonly<Record<string, CollectionStore>>;
|
|
389
|
+
//#endregion
|
|
181
390
|
//#region ../core/src/contracts/runTypes.d.ts
|
|
182
391
|
/**
|
|
183
392
|
* Test-suite linkage for a run. When set, this run was started by a TestSuiteOrchestrator
|
|
@@ -196,7 +405,7 @@ interface RunTestContext {
|
|
|
196
405
|
readonly testCaseLabel?: string;
|
|
197
406
|
}
|
|
198
407
|
type NodeInputsByPort = Readonly<Record<InputPortKey, Items>>;
|
|
199
|
-
type NodeExecutionStatus = "pending" | "queued" | "running" | "completed" | "failed" | "skipped";
|
|
408
|
+
type NodeExecutionStatus = "pending" | "queued" | "running" | "completed" | "failed" | "skipped" | "hitl-approved" | "hitl-rejected" | "hitl-timeout" | "hitl-auto-accepted" | "hitl-cancelled";
|
|
200
409
|
interface NodeExecutionError {
|
|
201
410
|
message: string;
|
|
202
411
|
name?: string;
|
|
@@ -225,34 +434,6 @@ type ConnectionInvocationAppendArgs = Readonly<{
|
|
|
225
434
|
parentInvocationId?: ConnectionInvocationId;
|
|
226
435
|
}>;
|
|
227
436
|
//#endregion
|
|
228
|
-
//#region ../core/src/contracts/retryPolicySpec.types.d.ts
|
|
229
|
-
/**
|
|
230
|
-
* In-process retry policy for runnable nodes. Serialized configs use the same
|
|
231
|
-
* `kind` discriminator (`JSON.stringify` / persisted workflows).
|
|
232
|
-
*
|
|
233
|
-
* `maxAttempts` is the total number of tries including the first (e.g. 3 means up to 2 delays after failures).
|
|
234
|
-
*/
|
|
235
|
-
type RetryPolicySpec = NoneRetryPolicySpec | FixedRetryPolicySpec | ExponentialRetryPolicySpec;
|
|
236
|
-
interface NoneRetryPolicySpec {
|
|
237
|
-
readonly kind: "none";
|
|
238
|
-
}
|
|
239
|
-
interface FixedRetryPolicySpec {
|
|
240
|
-
readonly kind: "fixed";
|
|
241
|
-
/** Total attempts including the first execution. Must be >= 1. */
|
|
242
|
-
readonly maxAttempts: number;
|
|
243
|
-
readonly delayMs: number;
|
|
244
|
-
}
|
|
245
|
-
interface ExponentialRetryPolicySpec {
|
|
246
|
-
readonly kind: "exponential";
|
|
247
|
-
/** Total attempts including the first execution. Must be >= 1. */
|
|
248
|
-
readonly maxAttempts: number;
|
|
249
|
-
readonly initialDelayMs: number;
|
|
250
|
-
readonly multiplier: number;
|
|
251
|
-
readonly maxDelayMs?: number;
|
|
252
|
-
/** When true, each delay is multiplied by a random factor in [1, 1.2). */
|
|
253
|
-
readonly jitter?: boolean;
|
|
254
|
-
}
|
|
255
|
-
//#endregion
|
|
256
437
|
//#region ../core/src/contracts/workflowTypes.d.ts
|
|
257
438
|
type NodeIdRef<TJson = unknown> = NodeId & Readonly<{
|
|
258
439
|
__codemationNodeJson?: TJson;
|
|
@@ -494,175 +675,53 @@ interface NodeErrorHandler {
|
|
|
494
675
|
}
|
|
495
676
|
type NodeErrorHandlerSpec = TypeToken<NodeErrorHandler> | NodeErrorHandler;
|
|
496
677
|
//#endregion
|
|
497
|
-
//#region ../core/src/contracts/
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
readonly
|
|
506
|
-
readonly
|
|
507
|
-
readonly
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
readonly
|
|
511
|
-
readonly currencyScale: number;
|
|
512
|
-
readonly estimatedAmountMinor: number;
|
|
513
|
-
readonly estimateKind: "catalog";
|
|
514
|
-
}
|
|
515
|
-
interface CostTrackingTelemetry {
|
|
516
|
-
captureUsage(args: CostTrackingUsageRecord): Promise<CostTrackingPriceQuote | undefined>;
|
|
517
|
-
forScope(scope: TelemetryScope): CostTrackingTelemetry;
|
|
518
|
-
}
|
|
519
|
-
//#endregion
|
|
520
|
-
//#region ../core/src/contracts/telemetryTypes.d.ts
|
|
521
|
-
type TelemetryAttributePrimitive = string | number | boolean | null;
|
|
522
|
-
interface TelemetryAttributes {
|
|
523
|
-
readonly [key: string]: TelemetryAttributePrimitive | undefined;
|
|
524
|
-
}
|
|
525
|
-
interface TelemetryMetricRecord {
|
|
526
|
-
readonly name: string;
|
|
527
|
-
readonly value: number;
|
|
528
|
-
readonly unit?: string;
|
|
529
|
-
readonly attributes?: TelemetryAttributes;
|
|
530
|
-
}
|
|
531
|
-
interface TelemetrySpanEventRecord {
|
|
532
|
-
readonly name: string;
|
|
533
|
-
readonly occurredAt?: Date;
|
|
534
|
-
readonly attributes?: TelemetryAttributes;
|
|
535
|
-
}
|
|
536
|
-
interface TelemetryArtifactAttachment {
|
|
537
|
-
readonly kind: string;
|
|
538
|
-
readonly contentType: string;
|
|
539
|
-
readonly previewText?: string;
|
|
540
|
-
readonly previewJson?: JsonValue;
|
|
541
|
-
readonly payloadText?: string;
|
|
542
|
-
readonly payloadJson?: JsonValue;
|
|
543
|
-
readonly bytes?: number;
|
|
544
|
-
readonly truncated?: boolean;
|
|
545
|
-
readonly expiresAt?: Date;
|
|
546
|
-
}
|
|
547
|
-
interface TelemetryArtifactReference {
|
|
548
|
-
readonly artifactId: string;
|
|
549
|
-
readonly traceId?: string;
|
|
550
|
-
readonly spanId?: string;
|
|
551
|
-
}
|
|
552
|
-
interface TelemetrySpanEnd {
|
|
553
|
-
readonly status?: "ok" | "error";
|
|
554
|
-
readonly statusMessage?: string;
|
|
555
|
-
readonly endedAt?: Date;
|
|
556
|
-
readonly attributes?: TelemetryAttributes;
|
|
557
|
-
}
|
|
558
|
-
interface TelemetryChildSpanStart {
|
|
559
|
-
readonly name: string;
|
|
560
|
-
readonly kind?: "internal" | "client";
|
|
561
|
-
readonly startedAt?: Date;
|
|
562
|
-
readonly attributes?: TelemetryAttributes;
|
|
563
|
-
}
|
|
564
|
-
interface TelemetryScope {
|
|
565
|
-
readonly traceId?: string;
|
|
566
|
-
readonly spanId?: string;
|
|
567
|
-
readonly costTracking?: CostTrackingTelemetry;
|
|
568
|
-
addSpanEvent(args: TelemetrySpanEventRecord): Promise<void> | void;
|
|
569
|
-
recordMetric(args: TelemetryMetricRecord): Promise<void> | void;
|
|
570
|
-
attachArtifact(args: TelemetryArtifactAttachment): Promise<TelemetryArtifactReference> | TelemetryArtifactReference;
|
|
571
|
-
}
|
|
572
|
-
interface TelemetrySpanScope extends TelemetryScope {
|
|
573
|
-
readonly traceId: string;
|
|
574
|
-
readonly spanId: string;
|
|
575
|
-
end(args?: TelemetrySpanEnd): Promise<void> | void;
|
|
678
|
+
//#region ../core/src/contracts/runtimeTypes.d.ts
|
|
679
|
+
/** Opaque unique identifier for a single HumanTask instance. */
|
|
680
|
+
type HumanTaskId = string;
|
|
681
|
+
/**
|
|
682
|
+
* Minimal handle handed to the `deliver` callback so it can route to the correct
|
|
683
|
+
* inbox channel.
|
|
684
|
+
*/
|
|
685
|
+
interface HumanTaskHandle {
|
|
686
|
+
readonly taskId: HumanTaskId;
|
|
687
|
+
readonly runId: string;
|
|
688
|
+
readonly nodeId: string;
|
|
689
|
+
readonly expiresAt: Date;
|
|
690
|
+
/** TODO: real signed URL; placeholder empty string for now. */
|
|
691
|
+
readonly resumeUrl: string;
|
|
576
692
|
/**
|
|
577
|
-
*
|
|
578
|
-
*
|
|
579
|
-
*
|
|
580
|
-
* Used at the sub-agent boundary so that nested runtime telemetry parents under the agent.tool.call
|
|
581
|
-
* span instead of the orchestrator's node-level span.
|
|
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`.
|
|
582
696
|
*/
|
|
583
|
-
|
|
584
|
-
nodeId: NodeId;
|
|
585
|
-
activationId: NodeActivationId;
|
|
586
|
-
}>): NodeExecutionTelemetry;
|
|
587
|
-
}
|
|
588
|
-
interface NodeExecutionTelemetry extends ExecutionTelemetry, TelemetrySpanScope {
|
|
589
|
-
startChildSpan(args: TelemetryChildSpanStart): TelemetrySpanScope;
|
|
697
|
+
readonly metadata?: Readonly<Record<string, JsonValue>>;
|
|
590
698
|
}
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
readonly
|
|
594
|
-
|
|
595
|
-
nodeId: NodeId;
|
|
596
|
-
activationId: NodeActivationId;
|
|
597
|
-
}>): NodeExecutionTelemetry;
|
|
699
|
+
/** Identity of the person who made a decision on the task. */
|
|
700
|
+
interface HumanTaskActor {
|
|
701
|
+
readonly actorId: string;
|
|
702
|
+
readonly displayName?: string;
|
|
598
703
|
}
|
|
599
|
-
//#endregion
|
|
600
|
-
//#region ../core/src/contracts/collectionTypes.d.ts
|
|
601
704
|
/**
|
|
602
|
-
*
|
|
603
|
-
*
|
|
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`.
|
|
604
708
|
*/
|
|
605
|
-
interface
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
get(id: string): Promise<(TRow & {
|
|
618
|
-
id: string;
|
|
619
|
-
created_at: Date;
|
|
620
|
-
updated_at: Date;
|
|
621
|
-
}) | null>;
|
|
622
|
-
/**
|
|
623
|
-
* Find a single row matching the provided filter.
|
|
624
|
-
*/
|
|
625
|
-
findOne(filter: Partial<TRow>): Promise<(TRow & {
|
|
626
|
-
id: string;
|
|
627
|
-
created_at: Date;
|
|
628
|
-
updated_at: Date;
|
|
629
|
-
}) | null>;
|
|
630
|
-
/**
|
|
631
|
-
* List rows with optional pagination and filtering.
|
|
632
|
-
*/
|
|
633
|
-
list(opts?: {
|
|
634
|
-
limit?: number;
|
|
635
|
-
offset?: number;
|
|
636
|
-
where?: Partial<TRow>;
|
|
637
|
-
}): Promise<{
|
|
638
|
-
rows: ReadonlyArray<TRow & {
|
|
639
|
-
id: string;
|
|
640
|
-
created_at: Date;
|
|
641
|
-
updated_at: Date;
|
|
642
|
-
}>;
|
|
643
|
-
total: number;
|
|
644
|
-
}>;
|
|
645
|
-
/**
|
|
646
|
-
* Update a row by id with partial data.
|
|
647
|
-
*/
|
|
648
|
-
update(id: string, patch: Partial<TRow>): Promise<TRow & {
|
|
649
|
-
id: string;
|
|
650
|
-
created_at: Date;
|
|
651
|
-
updated_at: Date;
|
|
652
|
-
}>;
|
|
653
|
-
/**
|
|
654
|
-
* Delete a row by id. Hard delete only (no soft delete).
|
|
655
|
-
*/
|
|
656
|
-
delete(id: string): Promise<{
|
|
657
|
-
deleted: boolean;
|
|
709
|
+
interface ResumeContext {
|
|
710
|
+
readonly decision: Readonly<{
|
|
711
|
+
kind: "decided";
|
|
712
|
+
value: unknown;
|
|
713
|
+
actor: HumanTaskActor;
|
|
714
|
+
decidedAt: Date;
|
|
715
|
+
}> | Readonly<{
|
|
716
|
+
kind: "timed_out";
|
|
717
|
+
at: Date;
|
|
718
|
+
}> | Readonly<{
|
|
719
|
+
kind: "auto_accepted";
|
|
720
|
+
at: Date;
|
|
658
721
|
}>;
|
|
722
|
+
readonly delivery: JsonValue;
|
|
723
|
+
readonly task: HumanTaskHandle;
|
|
659
724
|
}
|
|
660
|
-
/**
|
|
661
|
-
* Runtime collections context: keyed by collection name.
|
|
662
|
-
*/
|
|
663
|
-
type CollectionsContext = Readonly<Record<string, CollectionStore>>;
|
|
664
|
-
//#endregion
|
|
665
|
-
//#region ../core/src/contracts/runtimeTypes.d.ts
|
|
666
725
|
interface NodeExecutionStatePublisher {
|
|
667
726
|
markQueued(args: {
|
|
668
727
|
nodeId: NodeId;
|
|
@@ -751,6 +810,14 @@ interface ExecutionContext {
|
|
|
751
810
|
* Collections registered in the codemation config, keyed by collection name.
|
|
752
811
|
*/
|
|
753
812
|
readonly collections?: CollectionsContext;
|
|
813
|
+
/**
|
|
814
|
+
* Resolve a DI token from the host container.
|
|
815
|
+
* Allows nodes to reach host-side services (e.g. `InboxChannelResolverToken`)
|
|
816
|
+
* without importing host code. Wired by `DefaultExecutionContextFactory`; throws
|
|
817
|
+
* a clear error when no resolver is configured (e.g. in unit tests that don't
|
|
818
|
+
* set up the full container).
|
|
819
|
+
*/
|
|
820
|
+
resolve<T>(token: TypeToken<T>): T;
|
|
754
821
|
}
|
|
755
822
|
interface NodeExecutionContext<TConfig extends NodeConfigBase = NodeConfigBase> extends ExecutionContext {
|
|
756
823
|
nodeId: NodeId;
|
|
@@ -758,7 +825,12 @@ interface NodeExecutionContext<TConfig extends NodeConfigBase = NodeConfigBase>
|
|
|
758
825
|
config: TConfig;
|
|
759
826
|
telemetry: NodeExecutionTelemetry;
|
|
760
827
|
binary: NodeBinaryAttachmentService;
|
|
828
|
+
/**
|
|
829
|
+
* Present when this node activation is a HITL resume.
|
|
830
|
+
* The node checks `ctx.resumeContext !== undefined` and takes the resume branch.
|
|
831
|
+
*/
|
|
832
|
+
resumeContext?: ResumeContext;
|
|
761
833
|
}
|
|
762
834
|
//#endregion
|
|
763
|
-
export { CredentialSessionFactory as _,
|
|
764
|
-
//# sourceMappingURL=runtimeTypes-
|
|
835
|
+
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 };
|
|
836
|
+
//# sourceMappingURL=runtimeTypes-MQgcsey7.d.cts.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codemation/core-nodes-ocr",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.3",
|
|
4
4
|
"description": "Azure AI Content Understanding (OCR) plugin for Codemation — prebuilt document, invoice, and image analyzers.",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"@azure/ai-content-understanding": "^1.0.0",
|
|
45
45
|
"@azure/core-auth": "^1.10.1",
|
|
46
46
|
"zod": "^4.3.6",
|
|
47
|
-
"@codemation/core": "0.
|
|
47
|
+
"@codemation/core": "0.12.0"
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|
|
50
50
|
"@types/node": "^25.3.5",
|