@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
@@ -1,32 +1,17 @@
1
- import { c as Container, l as TypeToken, s as WorkflowDefinition, u as AnyCredentialType } from "./runtimeTypes-WCvsnJMY.cjs";
1
+ import { c as Container, l as TypeToken, s as WorkflowDefinition, u as AnyCredentialType } from "./runtimeTypes-D_9j5Pat.cjs";
2
2
  import { BetterAuthOptions } from "better-auth";
3
3
 
4
4
  //#region ../core/src/contracts/mcpTypes.d.ts
5
5
  type McpServerTransport = "http";
6
6
  interface McpServerDeclaration {
7
- /** Globally unique slug, e.g. "gmail". Workflow authors reference this. */
8
7
  id: string;
9
8
  displayName: string;
10
9
  description: string;
11
10
  transport: McpServerTransport;
12
11
  url: string;
13
- /**
14
- * Credential types accepted by this MCP server, matching CredentialRequirement.acceptedTypes.
15
- * Absent or empty means no credential is required.
16
- */
17
12
  acceptedCredentialTypes?: ReadonlyArray<string>;
18
- /**
19
- * Documentation only in MVP. The bind-time validator checks
20
- * requiredScopes ⊆ CredentialInstance.scopesGranted.
21
- */
22
13
  requiredScopes?: string[];
23
- /** Non-secret static headers merged onto every MCP request. */
24
14
  staticHeaders?: Record<string, string>;
25
- /**
26
- * Overrides for tool descriptions advertised by the MCP server.
27
- * Applied by the connection pool after tools/list.
28
- * Key: exact tool name as returned by the server.
29
- */
30
15
  toolDescriptionOverrides?: Record<string, string>;
31
16
  }
32
17
  //#endregion
@@ -92,17 +77,12 @@ interface LoggerFactory {
92
77
  }
93
78
  //#endregion
94
79
  //#region ../host/src/presentation/config/CodemationAuthConfig.d.ts
95
- /**
96
- * Consumer-declared authentication profile for the hosted UI + HTTP API.
97
- * Social provider ids intentionally match Better Auth's provider ids so config stays 1:1 with the auth runtime.
98
- */
99
80
  type CodemationAuthKind = "local" | "oauth" | "oidc" | "managed";
100
81
  type CodemationAuthOAuthProviderId = Extract<keyof NonNullable<BetterAuthOptions["socialProviders"]>, "github" | "google" | "microsoft">;
101
82
  interface CodemationAuthOAuthProviderConfig {
102
83
  readonly provider: CodemationAuthOAuthProviderId;
103
84
  readonly clientIdEnv: string;
104
85
  readonly clientSecretEnv: string;
105
- /** Microsoft tenant; environment variable name whose value is the tenant ID. */
106
86
  readonly tenantIdEnv?: string;
107
87
  }
108
88
  interface CodemationAuthOidcProviderConfig {
@@ -113,47 +93,24 @@ interface CodemationAuthOidcProviderConfig {
113
93
  }
114
94
  interface CodemationAuthConfig {
115
95
  readonly kind: CodemationAuthKind;
116
- /**
117
- * When true and NODE_ENV is not production, the API accepts requests without a real session
118
- * (synthetic principal only — never honored in production).
119
- */
120
96
  readonly allowUnauthenticatedInDevelopment?: boolean;
121
97
  readonly oauth?: ReadonlyArray<CodemationAuthOAuthProviderConfig>;
122
98
  readonly oidc?: ReadonlyArray<CodemationAuthOidcProviderConfig>;
123
99
  }
124
100
  //#endregion
125
101
  //#region ../host/src/presentation/config/CodemationLogConfig.d.ts
126
- /**
127
- * Minimum level for namespaces matched by {@link CodemationLogRule.filter}.
128
- * `silent` suppresses all log lines for matching namespaces.
129
- */
130
102
  type CodemationLogLevelName = "debug" | "info" | "warn" | "error" | "silent";
131
- /**
132
- * One rule: {@link filter} is one glob or several (`*` = any substring; a lone `*` matches all namespaces).
133
- * If multiple patterns are given, **any** match applies this rule’s level.
134
- * Rules are evaluated in order; the **first** rule whose filter set matches wins.
135
- */
136
103
  type CodemationLogRule = Readonly<{
137
104
  filter: string | ReadonlyArray<string>;
138
105
  level: CodemationLogLevelName;
139
106
  }>;
140
- /**
141
- * Either a single rule (`{ filter, level }`) or multiple `{ rules: [...] }`.
142
- * Put broader patterns last, e.g. `{ filter: "codemation.webhooks.*", level: "info" }` then `{ filter: "*", level: "warn" }`.
143
- * Use an array for `filter` to match several namespaces with the same level, e.g. `filter: ["codemation.webhooks.*", "codemation.engine.triggers"]`.
144
- */
145
107
  type CodemationLogConfig = Readonly<{
146
108
  rules: ReadonlyArray<CodemationLogRule>;
147
109
  }> | CodemationLogRule;
148
110
  //#endregion
149
111
  //#region ../host/src/presentation/config/CodemationWhitelabelConfig.d.ts
150
- /**
151
- * Optional host shell whitelabeling (sidebar, login, document title).
152
- * `logoPath` is resolved relative to the consumer project root.
153
- */
154
112
  interface CodemationWhitelabelConfig {
155
113
  readonly productName?: string;
156
- /** Relative to consumer project root, e.g. `branding/logo.svg`. */
157
114
  readonly logoPath?: string;
158
115
  }
159
116
  //#endregion
@@ -168,9 +125,7 @@ type CodemationSchedulerKind = "local" | "bullmq";
168
125
  type CodemationDatabaseKind = "postgresql" | "sqlite";
169
126
  interface CodemationDatabaseConfig {
170
127
  readonly kind?: CodemationDatabaseKind;
171
- /** TCP PostgreSQL URL when `kind` is `postgresql` (or omitted with a postgres URL). */
172
128
  readonly url?: string;
173
- /** SQLite database file path when `kind` is `sqlite`. Relative paths resolve from the consumer app root. */
174
129
  readonly sqliteFilePath?: string;
175
130
  }
176
131
  interface CodemationEventBusConfig {
@@ -190,10 +145,6 @@ interface CodemationAppSchedulerConfig {
190
145
  readonly workerQueues?: ReadonlyArray<string>;
191
146
  readonly redisUrl?: string;
192
147
  }
193
- /**
194
- * Optional overrides for engine execution limits (activation budget and subworkflow depth caps).
195
- * Omitted fields keep framework defaults. Advanced users can bind `CoreTokens.EngineExecutionLimitsPolicy` for full control.
196
- */
197
148
  type CodemationEngineExecutionLimitsConfig = Readonly<Partial<EngineExecutionLimitsPolicyConfig>>;
198
149
  interface CodemationAppDefinition {
199
150
  readonly frontendPort?: number;
@@ -210,36 +161,21 @@ interface CodemationApplicationRuntimeConfig {
210
161
  readonly database?: CodemationDatabaseConfig;
211
162
  readonly eventBus?: CodemationEventBusConfig;
212
163
  readonly scheduler?: CodemationSchedulerConfig;
213
- /** Merged with engine defaults when building the execution limits policy (API + workers). */
214
164
  readonly engineExecutionLimits?: CodemationEngineExecutionLimitsConfig;
215
165
  }
216
166
  interface CodemationConfig {
217
167
  readonly app?: CodemationAppDefinition;
218
- /**
219
- * Reserved compatibility-date field. Declares the Codemation framework version this workspace
220
- * targets. Logged at INFO level on boot. No enforcement in 1.0.0.
221
- * See backlog/codemation-version-compatibility-gate.md.
222
- */
223
168
  readonly codemationVersion?: string;
224
169
  readonly register?: (context: CodemationAppContext) => void;
225
170
  readonly runtime?: CodemationApplicationRuntimeConfig;
226
171
  readonly workflows?: ReadonlyArray<WorkflowDefinition>;
227
172
  readonly workflowDiscovery?: CodemationWorkflowDiscovery;
228
173
  readonly plugins?: ReadonlyArray<CodemationPlugin>;
229
- /** Consumer-defined `CredentialType` entries (see `@codemation/core`), applied when the host loads config. */
230
174
  readonly credentialTypes?: ReadonlyArray<AnyCredentialType>;
231
- /** MCP server declarations from this config file (merged with plugin and control-plane sources at startup). */
232
175
  readonly mcpServers?: ReadonlyArray<McpServerDeclaration>;
233
- /** Declared collections available at runtime via `ctx.collections`. Accepts either raw `CollectionDefinition` or `DefinedCollection` (the result of `defineCollection(...)`). */
234
176
  readonly collections?: ReadonlyArray<CollectionDefinition | DefinedCollection>;
235
- /** Optional shell whitelabel (product name, logo path). */
236
177
  readonly whitelabel?: CodemationWhitelabelConfig;
237
- /** Required for production hosts; optional only when using development bypass (never in production). */
238
178
  readonly auth?: CodemationAuthConfig;
239
- /**
240
- * Namespace-level log filters (first matching rule wins). Unmatched namespaces use `CODEMATION_LOG_LEVEL` / defaults.
241
- * Omit to keep env-only behavior.
242
- */
243
179
  readonly log?: CodemationLogConfig;
244
180
  }
245
181
  //#endregion
@@ -277,14 +213,6 @@ interface AppConfig {
277
213
  readonly repoRoot: string;
278
214
  readonly env: Readonly<NodeJS.ProcessEnv>;
279
215
  readonly workflowSources: ReadonlyArray<string>;
280
- /**
281
- * The discovery directories from `workflowDiscovery.directories` (or the `workflowsDir`
282
- * shorthand). Stored here so the runtime can re-scan on demand in `serve` mode without
283
- * needing the raw `CodemationConfig`.
284
- *
285
- * Absent or empty when no directory-based discovery is configured (i.e. workflows are
286
- * provided only via the explicit `workflows` array).
287
- */
288
216
  readonly workflowDiscoveryDirectories?: ReadonlyArray<string>;
289
217
  readonly workflows: ReadonlyArray<WorkflowDefinition>;
290
218
  readonly containerRegistrations: ReadonlyArray<CodemationContainerRegistration<unknown>>;
@@ -1,4 +1,4 @@
1
- import { a as TypeToken, c as McpServerDeclaration, i as Container, l as AnyCredentialType, n as DefinedCollection, o as EngineExecutionLimitsPolicyConfig, r as WorkflowDefinition, t as CollectionDefinition } from "./index-DF2ht42F.js";
1
+ import { a as TypeToken, c as McpServerDeclaration, i as Container, l as AnyCredentialType, n as DefinedCollection, o as EngineExecutionLimitsPolicyConfig, r as WorkflowDefinition, t as CollectionDefinition } from "./index-DdjAAXvy.js";
2
2
  import { ZodType, z } from "zod";
3
3
  import { BetterAuthOptions } from "better-auth";
4
4
 
@@ -32,17 +32,12 @@ interface LoggerFactory {
32
32
  }
33
33
  //#endregion
34
34
  //#region ../host/src/presentation/config/CodemationAuthConfig.d.ts
35
- /**
36
- * Consumer-declared authentication profile for the hosted UI + HTTP API.
37
- * Social provider ids intentionally match Better Auth's provider ids so config stays 1:1 with the auth runtime.
38
- */
39
35
  type CodemationAuthKind = "local" | "oauth" | "oidc" | "managed";
40
36
  type CodemationAuthOAuthProviderId = Extract<keyof NonNullable<BetterAuthOptions["socialProviders"]>, "github" | "google" | "microsoft">;
41
37
  interface CodemationAuthOAuthProviderConfig {
42
38
  readonly provider: CodemationAuthOAuthProviderId;
43
39
  readonly clientIdEnv: string;
44
40
  readonly clientSecretEnv: string;
45
- /** Microsoft tenant; environment variable name whose value is the tenant ID. */
46
41
  readonly tenantIdEnv?: string;
47
42
  }
48
43
  interface CodemationAuthOidcProviderConfig {
@@ -53,47 +48,24 @@ interface CodemationAuthOidcProviderConfig {
53
48
  }
54
49
  interface CodemationAuthConfig {
55
50
  readonly kind: CodemationAuthKind;
56
- /**
57
- * When true and NODE_ENV is not production, the API accepts requests without a real session
58
- * (synthetic principal only — never honored in production).
59
- */
60
51
  readonly allowUnauthenticatedInDevelopment?: boolean;
61
52
  readonly oauth?: ReadonlyArray<CodemationAuthOAuthProviderConfig>;
62
53
  readonly oidc?: ReadonlyArray<CodemationAuthOidcProviderConfig>;
63
54
  }
64
55
  //#endregion
65
56
  //#region ../host/src/presentation/config/CodemationLogConfig.d.ts
66
- /**
67
- * Minimum level for namespaces matched by {@link CodemationLogRule.filter}.
68
- * `silent` suppresses all log lines for matching namespaces.
69
- */
70
57
  type CodemationLogLevelName = "debug" | "info" | "warn" | "error" | "silent";
71
- /**
72
- * One rule: {@link filter} is one glob or several (`*` = any substring; a lone `*` matches all namespaces).
73
- * If multiple patterns are given, **any** match applies this rule’s level.
74
- * Rules are evaluated in order; the **first** rule whose filter set matches wins.
75
- */
76
58
  type CodemationLogRule = Readonly<{
77
59
  filter: string | ReadonlyArray<string>;
78
60
  level: CodemationLogLevelName;
79
61
  }>;
80
- /**
81
- * Either a single rule (`{ filter, level }`) or multiple `{ rules: [...] }`.
82
- * Put broader patterns last, e.g. `{ filter: "codemation.webhooks.*", level: "info" }` then `{ filter: "*", level: "warn" }`.
83
- * Use an array for `filter` to match several namespaces with the same level, e.g. `filter: ["codemation.webhooks.*", "codemation.engine.triggers"]`.
84
- */
85
62
  type CodemationLogConfig = Readonly<{
86
63
  rules: ReadonlyArray<CodemationLogRule>;
87
64
  }> | CodemationLogRule;
88
65
  //#endregion
89
66
  //#region ../host/src/presentation/config/CodemationWhitelabelConfig.d.ts
90
- /**
91
- * Optional host shell whitelabeling (sidebar, login, document title).
92
- * `logoPath` is resolved relative to the consumer project root.
93
- */
94
67
  interface CodemationWhitelabelConfig {
95
68
  readonly productName?: string;
96
- /** Relative to consumer project root, e.g. `branding/logo.svg`. */
97
69
  readonly logoPath?: string;
98
70
  }
99
71
  //#endregion
@@ -108,9 +80,7 @@ type CodemationSchedulerKind = "local" | "bullmq";
108
80
  type CodemationDatabaseKind = "postgresql" | "sqlite";
109
81
  interface CodemationDatabaseConfig {
110
82
  readonly kind?: CodemationDatabaseKind;
111
- /** TCP PostgreSQL URL when `kind` is `postgresql` (or omitted with a postgres URL). */
112
83
  readonly url?: string;
113
- /** SQLite database file path when `kind` is `sqlite`. Relative paths resolve from the consumer app root. */
114
84
  readonly sqliteFilePath?: string;
115
85
  }
116
86
  interface CodemationEventBusConfig {
@@ -130,10 +100,6 @@ interface CodemationAppSchedulerConfig {
130
100
  readonly workerQueues?: ReadonlyArray<string>;
131
101
  readonly redisUrl?: string;
132
102
  }
133
- /**
134
- * Optional overrides for engine execution limits (activation budget and subworkflow depth caps).
135
- * Omitted fields keep framework defaults. Advanced users can bind `CoreTokens.EngineExecutionLimitsPolicy` for full control.
136
- */
137
103
  type CodemationEngineExecutionLimitsConfig = Readonly<Partial<EngineExecutionLimitsPolicyConfig>>;
138
104
  interface CodemationAppDefinition {
139
105
  readonly frontendPort?: number;
@@ -150,36 +116,21 @@ interface CodemationApplicationRuntimeConfig {
150
116
  readonly database?: CodemationDatabaseConfig;
151
117
  readonly eventBus?: CodemationEventBusConfig;
152
118
  readonly scheduler?: CodemationSchedulerConfig;
153
- /** Merged with engine defaults when building the execution limits policy (API + workers). */
154
119
  readonly engineExecutionLimits?: CodemationEngineExecutionLimitsConfig;
155
120
  }
156
121
  interface CodemationConfig {
157
122
  readonly app?: CodemationAppDefinition;
158
- /**
159
- * Reserved compatibility-date field. Declares the Codemation framework version this workspace
160
- * targets. Logged at INFO level on boot. No enforcement in 1.0.0.
161
- * See backlog/codemation-version-compatibility-gate.md.
162
- */
163
123
  readonly codemationVersion?: string;
164
124
  readonly register?: (context: CodemationAppContext) => void;
165
125
  readonly runtime?: CodemationApplicationRuntimeConfig;
166
126
  readonly workflows?: ReadonlyArray<WorkflowDefinition>;
167
127
  readonly workflowDiscovery?: CodemationWorkflowDiscovery;
168
128
  readonly plugins?: ReadonlyArray<CodemationPlugin>;
169
- /** Consumer-defined `CredentialType` entries (see `@codemation/core`), applied when the host loads config. */
170
129
  readonly credentialTypes?: ReadonlyArray<AnyCredentialType>;
171
- /** MCP server declarations from this config file (merged with plugin and control-plane sources at startup). */
172
130
  readonly mcpServers?: ReadonlyArray<McpServerDeclaration>;
173
- /** Declared collections available at runtime via `ctx.collections`. Accepts either raw `CollectionDefinition` or `DefinedCollection` (the result of `defineCollection(...)`). */
174
131
  readonly collections?: ReadonlyArray<CollectionDefinition | DefinedCollection>;
175
- /** Optional shell whitelabel (product name, logo path). */
176
132
  readonly whitelabel?: CodemationWhitelabelConfig;
177
- /** Required for production hosts; optional only when using development bypass (never in production). */
178
133
  readonly auth?: CodemationAuthConfig;
179
- /**
180
- * Namespace-level log filters (first matching rule wins). Unmatched namespaces use `CODEMATION_LOG_LEVEL` / defaults.
181
- * Omit to keep env-only behavior.
182
- */
183
134
  readonly log?: CodemationLogConfig;
184
135
  }
185
136
  //#endregion
@@ -217,14 +168,6 @@ interface AppConfig {
217
168
  readonly repoRoot: string;
218
169
  readonly env: Readonly<NodeJS.ProcessEnv>;
219
170
  readonly workflowSources: ReadonlyArray<string>;
220
- /**
221
- * The discovery directories from `workflowDiscovery.directories` (or the `workflowsDir`
222
- * shorthand). Stored here so the runtime can re-scan on demand in `serve` mode without
223
- * needing the raw `CodemationConfig`.
224
- *
225
- * Absent or empty when no directory-based discovery is configured (i.e. workflows are
226
- * provided only via the explicit `workflows` array).
227
- */
228
171
  readonly workflowDiscoveryDirectories?: ReadonlyArray<string>;
229
172
  readonly workflows: ReadonlyArray<WorkflowDefinition>;
230
173
  readonly containerRegistrations: ReadonlyArray<CodemationContainerRegistration<unknown>>;