@arke-institute/rhiza 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (230) hide show
  1. package/README.md +106 -0
  2. package/dist/__tests__/fixtures/index.d.ts +9 -0
  3. package/dist/__tests__/fixtures/index.d.ts.map +1 -0
  4. package/dist/__tests__/fixtures/index.js +12 -0
  5. package/dist/__tests__/fixtures/index.js.map +1 -0
  6. package/dist/__tests__/fixtures/kladoi/index.d.ts +165 -0
  7. package/dist/__tests__/fixtures/kladoi/index.d.ts.map +1 -0
  8. package/dist/__tests__/fixtures/kladoi/index.js +270 -0
  9. package/dist/__tests__/fixtures/kladoi/index.js.map +1 -0
  10. package/dist/__tests__/fixtures/logs/index.d.ts +19 -0
  11. package/dist/__tests__/fixtures/logs/index.d.ts.map +1 -0
  12. package/dist/__tests__/fixtures/logs/index.js +545 -0
  13. package/dist/__tests__/fixtures/logs/index.js.map +1 -0
  14. package/dist/__tests__/fixtures/mock-client.d.ts +127 -0
  15. package/dist/__tests__/fixtures/mock-client.d.ts.map +1 -0
  16. package/dist/__tests__/fixtures/mock-client.js +415 -0
  17. package/dist/__tests__/fixtures/mock-client.js.map +1 -0
  18. package/dist/__tests__/fixtures/rhizai/index.d.ts +54 -0
  19. package/dist/__tests__/fixtures/rhizai/index.d.ts.map +1 -0
  20. package/dist/__tests__/fixtures/rhizai/index.js +283 -0
  21. package/dist/__tests__/fixtures/rhizai/index.js.map +1 -0
  22. package/dist/__tests__/unit/fixtures.test.d.ts +10 -0
  23. package/dist/__tests__/unit/fixtures.test.d.ts.map +1 -0
  24. package/dist/__tests__/unit/fixtures.test.js +275 -0
  25. package/dist/__tests__/unit/fixtures.test.js.map +1 -0
  26. package/dist/__tests__/unit/handoff/gather.test.d.ts +8 -0
  27. package/dist/__tests__/unit/handoff/gather.test.d.ts.map +1 -0
  28. package/dist/__tests__/unit/handoff/gather.test.js +176 -0
  29. package/dist/__tests__/unit/handoff/gather.test.js.map +1 -0
  30. package/dist/__tests__/unit/handoff/interpret.test.d.ts +9 -0
  31. package/dist/__tests__/unit/handoff/interpret.test.d.ts.map +1 -0
  32. package/dist/__tests__/unit/handoff/interpret.test.js +370 -0
  33. package/dist/__tests__/unit/handoff/interpret.test.js.map +1 -0
  34. package/dist/__tests__/unit/handoff/route.test.d.ts +8 -0
  35. package/dist/__tests__/unit/handoff/route.test.d.ts.map +1 -0
  36. package/dist/__tests__/unit/handoff/route.test.js +271 -0
  37. package/dist/__tests__/unit/handoff/route.test.js.map +1 -0
  38. package/dist/__tests__/unit/handoff/scatter.test.d.ts +7 -0
  39. package/dist/__tests__/unit/handoff/scatter.test.d.ts.map +1 -0
  40. package/dist/__tests__/unit/handoff/scatter.test.js +54 -0
  41. package/dist/__tests__/unit/handoff/scatter.test.js.map +1 -0
  42. package/dist/__tests__/unit/resume.test.d.ts +8 -0
  43. package/dist/__tests__/unit/resume.test.d.ts.map +1 -0
  44. package/dist/__tests__/unit/resume.test.js +134 -0
  45. package/dist/__tests__/unit/resume.test.js.map +1 -0
  46. package/dist/__tests__/unit/status.test.d.ts +8 -0
  47. package/dist/__tests__/unit/status.test.d.ts.map +1 -0
  48. package/dist/__tests__/unit/status.test.js +164 -0
  49. package/dist/__tests__/unit/status.test.js.map +1 -0
  50. package/dist/__tests__/unit/target.test.d.ts +8 -0
  51. package/dist/__tests__/unit/target.test.d.ts.map +1 -0
  52. package/dist/__tests__/unit/target.test.js +116 -0
  53. package/dist/__tests__/unit/target.test.js.map +1 -0
  54. package/dist/__tests__/unit/traverse.test.d.ts +8 -0
  55. package/dist/__tests__/unit/traverse.test.d.ts.map +1 -0
  56. package/dist/__tests__/unit/traverse.test.js +143 -0
  57. package/dist/__tests__/unit/traverse.test.js.map +1 -0
  58. package/dist/__tests__/unit/validation/klados.test.d.ts +16 -0
  59. package/dist/__tests__/unit/validation/klados.test.d.ts.map +1 -0
  60. package/dist/__tests__/unit/validation/klados.test.js +275 -0
  61. package/dist/__tests__/unit/validation/klados.test.js.map +1 -0
  62. package/dist/__tests__/unit/validation/rhiza.test.d.ts +16 -0
  63. package/dist/__tests__/unit/validation/rhiza.test.d.ts.map +1 -0
  64. package/dist/__tests__/unit/validation/rhiza.test.js +612 -0
  65. package/dist/__tests__/unit/validation/rhiza.test.js.map +1 -0
  66. package/dist/__tests__/unit/validation/runtime.test.d.ts +11 -0
  67. package/dist/__tests__/unit/validation/runtime.test.d.ts.map +1 -0
  68. package/dist/__tests__/unit/validation/runtime.test.js +553 -0
  69. package/dist/__tests__/unit/validation/runtime.test.js.map +1 -0
  70. package/dist/__tests__/unit/worker/errors.test.d.ts +2 -0
  71. package/dist/__tests__/unit/worker/errors.test.d.ts.map +1 -0
  72. package/dist/__tests__/unit/worker/errors.test.js +226 -0
  73. package/dist/__tests__/unit/worker/errors.test.js.map +1 -0
  74. package/dist/__tests__/unit/worker/job.test.d.ts +2 -0
  75. package/dist/__tests__/unit/worker/job.test.d.ts.map +1 -0
  76. package/dist/__tests__/unit/worker/job.test.js +233 -0
  77. package/dist/__tests__/unit/worker/job.test.js.map +1 -0
  78. package/dist/client/index.d.ts +10 -0
  79. package/dist/client/index.d.ts.map +1 -0
  80. package/dist/client/index.js +8 -0
  81. package/dist/client/index.js.map +1 -0
  82. package/dist/client/interface.d.ts +142 -0
  83. package/dist/client/interface.d.ts.map +1 -0
  84. package/dist/client/interface.js +8 -0
  85. package/dist/client/interface.js.map +1 -0
  86. package/dist/client/mock.d.ts +95 -0
  87. package/dist/client/mock.d.ts.map +1 -0
  88. package/dist/client/mock.js +795 -0
  89. package/dist/client/mock.js.map +1 -0
  90. package/dist/client/types.d.ts +344 -0
  91. package/dist/client/types.d.ts.map +1 -0
  92. package/dist/client/types.js +8 -0
  93. package/dist/client/types.js.map +1 -0
  94. package/dist/handoff/gather-api.d.ts +60 -0
  95. package/dist/handoff/gather-api.d.ts.map +1 -0
  96. package/dist/handoff/gather-api.js +130 -0
  97. package/dist/handoff/gather-api.js.map +1 -0
  98. package/dist/handoff/gather.d.ts +59 -0
  99. package/dist/handoff/gather.d.ts.map +1 -0
  100. package/dist/handoff/gather.js +134 -0
  101. package/dist/handoff/gather.js.map +1 -0
  102. package/dist/handoff/index.d.ts +19 -0
  103. package/dist/handoff/index.d.ts.map +1 -0
  104. package/dist/handoff/index.js +25 -0
  105. package/dist/handoff/index.js.map +1 -0
  106. package/dist/handoff/interpret.d.ts +79 -0
  107. package/dist/handoff/interpret.d.ts.map +1 -0
  108. package/dist/handoff/interpret.js +197 -0
  109. package/dist/handoff/interpret.js.map +1 -0
  110. package/dist/handoff/invoke.d.ts +82 -0
  111. package/dist/handoff/invoke.d.ts.map +1 -0
  112. package/dist/handoff/invoke.js +196 -0
  113. package/dist/handoff/invoke.js.map +1 -0
  114. package/dist/handoff/route.d.ts +25 -0
  115. package/dist/handoff/route.d.ts.map +1 -0
  116. package/dist/handoff/route.js +65 -0
  117. package/dist/handoff/route.js.map +1 -0
  118. package/dist/handoff/scatter-api.d.ts +62 -0
  119. package/dist/handoff/scatter-api.d.ts.map +1 -0
  120. package/dist/handoff/scatter-api.js +81 -0
  121. package/dist/handoff/scatter-api.js.map +1 -0
  122. package/dist/handoff/scatter.d.ts +19 -0
  123. package/dist/handoff/scatter.d.ts.map +1 -0
  124. package/dist/handoff/scatter.js +27 -0
  125. package/dist/handoff/scatter.js.map +1 -0
  126. package/dist/handoff/target.d.ts +16 -0
  127. package/dist/handoff/target.d.ts.map +1 -0
  128. package/dist/handoff/target.js +51 -0
  129. package/dist/handoff/target.js.map +1 -0
  130. package/dist/index.d.ts +42 -0
  131. package/dist/index.d.ts.map +1 -0
  132. package/dist/index.js +52 -0
  133. package/dist/index.js.map +1 -0
  134. package/dist/logging/index.d.ts +4 -0
  135. package/dist/logging/index.d.ts.map +1 -0
  136. package/dist/logging/index.js +3 -0
  137. package/dist/logging/index.js.map +1 -0
  138. package/dist/logging/logger.d.ts +52 -0
  139. package/dist/logging/logger.d.ts.map +1 -0
  140. package/dist/logging/logger.js +70 -0
  141. package/dist/logging/logger.js.map +1 -0
  142. package/dist/logging/writer.d.ts +63 -0
  143. package/dist/logging/writer.d.ts.map +1 -0
  144. package/dist/logging/writer.js +160 -0
  145. package/dist/logging/writer.js.map +1 -0
  146. package/dist/resume/index.d.ts +77 -0
  147. package/dist/resume/index.d.ts.map +1 -0
  148. package/dist/resume/index.js +110 -0
  149. package/dist/resume/index.js.map +1 -0
  150. package/dist/status/index.d.ts +54 -0
  151. package/dist/status/index.d.ts.map +1 -0
  152. package/dist/status/index.js +107 -0
  153. package/dist/status/index.js.map +1 -0
  154. package/dist/traverse/index.d.ts +53 -0
  155. package/dist/traverse/index.d.ts.map +1 -0
  156. package/dist/traverse/index.js +142 -0
  157. package/dist/traverse/index.js.map +1 -0
  158. package/dist/types/batch.d.ts +53 -0
  159. package/dist/types/batch.d.ts.map +1 -0
  160. package/dist/types/batch.js +2 -0
  161. package/dist/types/batch.js.map +1 -0
  162. package/dist/types/index.d.ts +10 -0
  163. package/dist/types/index.d.ts.map +1 -0
  164. package/dist/types/index.js +2 -0
  165. package/dist/types/index.js.map +1 -0
  166. package/dist/types/klados.d.ts +63 -0
  167. package/dist/types/klados.d.ts.map +1 -0
  168. package/dist/types/klados.js +2 -0
  169. package/dist/types/klados.js.map +1 -0
  170. package/dist/types/log.d.ts +107 -0
  171. package/dist/types/log.d.ts.map +1 -0
  172. package/dist/types/log.js +2 -0
  173. package/dist/types/log.js.map +1 -0
  174. package/dist/types/refs.d.ts +58 -0
  175. package/dist/types/refs.d.ts.map +1 -0
  176. package/dist/types/refs.js +43 -0
  177. package/dist/types/refs.js.map +1 -0
  178. package/dist/types/request.d.ts +69 -0
  179. package/dist/types/request.d.ts.map +1 -0
  180. package/dist/types/request.js +2 -0
  181. package/dist/types/request.js.map +1 -0
  182. package/dist/types/response.d.ts +31 -0
  183. package/dist/types/response.d.ts.map +1 -0
  184. package/dist/types/response.js +2 -0
  185. package/dist/types/response.js.map +1 -0
  186. package/dist/types/rhiza.d.ts +100 -0
  187. package/dist/types/rhiza.d.ts.map +1 -0
  188. package/dist/types/rhiza.js +2 -0
  189. package/dist/types/rhiza.js.map +1 -0
  190. package/dist/types/status.d.ts +84 -0
  191. package/dist/types/status.d.ts.map +1 -0
  192. package/dist/types/status.js +2 -0
  193. package/dist/types/status.js.map +1 -0
  194. package/dist/utils/id.d.ts +15 -0
  195. package/dist/utils/id.d.ts.map +1 -0
  196. package/dist/utils/id.js +25 -0
  197. package/dist/utils/id.js.map +1 -0
  198. package/dist/utils/index.d.ts +2 -0
  199. package/dist/utils/index.d.ts.map +1 -0
  200. package/dist/utils/index.js +2 -0
  201. package/dist/utils/index.js.map +1 -0
  202. package/dist/validation/index.d.ts +9 -0
  203. package/dist/validation/index.d.ts.map +1 -0
  204. package/dist/validation/index.js +9 -0
  205. package/dist/validation/index.js.map +1 -0
  206. package/dist/validation/validate-klados.d.ts +38 -0
  207. package/dist/validation/validate-klados.d.ts.map +1 -0
  208. package/dist/validation/validate-klados.js +139 -0
  209. package/dist/validation/validate-klados.js.map +1 -0
  210. package/dist/validation/validate-rhiza.d.ts +29 -0
  211. package/dist/validation/validate-rhiza.d.ts.map +1 -0
  212. package/dist/validation/validate-rhiza.js +382 -0
  213. package/dist/validation/validate-rhiza.js.map +1 -0
  214. package/dist/validation/validate-runtime.d.ts +28 -0
  215. package/dist/validation/validate-runtime.d.ts.map +1 -0
  216. package/dist/validation/validate-runtime.js +212 -0
  217. package/dist/validation/validate-runtime.js.map +1 -0
  218. package/dist/worker/errors.d.ts +77 -0
  219. package/dist/worker/errors.d.ts.map +1 -0
  220. package/dist/worker/errors.js +143 -0
  221. package/dist/worker/errors.js.map +1 -0
  222. package/dist/worker/index.d.ts +8 -0
  223. package/dist/worker/index.d.ts.map +1 -0
  224. package/dist/worker/index.js +8 -0
  225. package/dist/worker/index.js.map +1 -0
  226. package/dist/worker/job.d.ts +150 -0
  227. package/dist/worker/job.d.ts.map +1 -0
  228. package/dist/worker/job.js +280 -0
  229. package/dist/worker/job.js.map +1 -0
  230. package/package.json +48 -0
@@ -0,0 +1,58 @@
1
+ /**
2
+ * Entity References
3
+ *
4
+ * EntityRef is a typed reference to a klados or rhiza entity within flow definitions.
5
+ * Follows the established Arke EntityRef convention (see arke_v1/src/schema/refs.ts).
6
+ *
7
+ * Key benefits:
8
+ * - Type hints avoid runtime discoverTargetType() API calls
9
+ * - Labels provide display context without fetching
10
+ * - Duck typing: any object with `pi` field is treated as EntityRef
11
+ */
12
+ /**
13
+ * EntityRef - A typed reference to a klados or rhiza entity
14
+ *
15
+ * Example usage in flow definitions:
16
+ * ```typescript
17
+ * flow: {
18
+ * 'klados_a': {
19
+ * then: {
20
+ * pass: { pi: 'klados_b', type: 'klados', label: 'Processor' }
21
+ * }
22
+ * }
23
+ * }
24
+ * ```
25
+ */
26
+ export interface EntityRef {
27
+ /** The referenced entity's persistent identifier (required) */
28
+ pi: string;
29
+ /** Type hint: "klados" or "rhiza" - avoids runtime type discovery when present */
30
+ type?: 'klados' | 'rhiza';
31
+ /** Display label - avoids needing to fetch the entity for display */
32
+ label?: string;
33
+ /** Human-readable description of why this reference exists */
34
+ description?: string;
35
+ }
36
+ /**
37
+ * Check if a value is an EntityRef
38
+ *
39
+ * Uses duck typing: any object with a `pi` string field is considered a ref.
40
+ */
41
+ export declare function isEntityRef(value: unknown): value is EntityRef;
42
+ /**
43
+ * Create an EntityRef with optional metadata
44
+ *
45
+ * @param pi - The entity ID
46
+ * @param options - Optional type, label, description
47
+ * @returns An EntityRef object
48
+ *
49
+ * @example
50
+ * ref('klados_worker', { type: 'klados' })
51
+ * ref('rhiza_subprocess', { type: 'rhiza', label: 'OCR Pipeline' })
52
+ */
53
+ export declare function ref(pi: string, options?: {
54
+ type?: 'klados' | 'rhiza';
55
+ label?: string;
56
+ description?: string;
57
+ }): EntityRef;
58
+ //# sourceMappingURL=refs.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"refs.d.ts","sourceRoot":"","sources":["../../src/types/refs.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAMH;;;;;;;;;;;;;GAaG;AACH,MAAM,WAAW,SAAS;IACxB,+DAA+D;IAC/D,EAAE,EAAE,MAAM,CAAC;IAEX,kFAAkF;IAClF,IAAI,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAC;IAE1B,qEAAqE;IACrE,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf,8DAA8D;IAC9D,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAMD;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,SAAS,CAO9D;AAMD;;;;;;;;;;GAUG;AACH,wBAAgB,GAAG,CACjB,EAAE,EAAE,MAAM,EACV,OAAO,CAAC,EAAE;IAAE,IAAI,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IAAC,WAAW,CAAC,EAAE,MAAM,CAAA;CAAE,GAC5E,SAAS,CAEX"}
@@ -0,0 +1,43 @@
1
+ /**
2
+ * Entity References
3
+ *
4
+ * EntityRef is a typed reference to a klados or rhiza entity within flow definitions.
5
+ * Follows the established Arke EntityRef convention (see arke_v1/src/schema/refs.ts).
6
+ *
7
+ * Key benefits:
8
+ * - Type hints avoid runtime discoverTargetType() API calls
9
+ * - Labels provide display context without fetching
10
+ * - Duck typing: any object with `pi` field is treated as EntityRef
11
+ */
12
+ // =============================================================================
13
+ // Type Guard
14
+ // =============================================================================
15
+ /**
16
+ * Check if a value is an EntityRef
17
+ *
18
+ * Uses duck typing: any object with a `pi` string field is considered a ref.
19
+ */
20
+ export function isEntityRef(value) {
21
+ return (typeof value === 'object' &&
22
+ value !== null &&
23
+ 'pi' in value &&
24
+ typeof value.pi === 'string');
25
+ }
26
+ // =============================================================================
27
+ // Utilities
28
+ // =============================================================================
29
+ /**
30
+ * Create an EntityRef with optional metadata
31
+ *
32
+ * @param pi - The entity ID
33
+ * @param options - Optional type, label, description
34
+ * @returns An EntityRef object
35
+ *
36
+ * @example
37
+ * ref('klados_worker', { type: 'klados' })
38
+ * ref('rhiza_subprocess', { type: 'rhiza', label: 'OCR Pipeline' })
39
+ */
40
+ export function ref(pi, options) {
41
+ return { pi, ...options };
42
+ }
43
+ //# sourceMappingURL=refs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"refs.js","sourceRoot":"","sources":["../../src/types/refs.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAkCH,gFAAgF;AAChF,aAAa;AACb,gFAAgF;AAEhF;;;;GAIG;AACH,MAAM,UAAU,WAAW,CAAC,KAAc;IACxC,OAAO,CACL,OAAO,KAAK,KAAK,QAAQ;QACzB,KAAK,KAAK,IAAI;QACd,IAAI,IAAI,KAAK;QACb,OAAQ,KAAmB,CAAC,EAAE,KAAK,QAAQ,CAC5C,CAAC;AACJ,CAAC;AAED,gFAAgF;AAChF,YAAY;AACZ,gFAAgF;AAEhF;;;;;;;;;;GAUG;AACH,MAAM,UAAU,GAAG,CACjB,EAAU,EACV,OAA6E;IAE7E,OAAO,EAAE,EAAE,EAAE,GAAG,OAAO,EAAE,CAAC;AAC5B,CAAC"}
@@ -0,0 +1,69 @@
1
+ /**
2
+ * KladosRequest - What a klados receives when invoked (from the Arke API)
3
+ */
4
+ export interface KladosRequest {
5
+ /** Unique job identifier */
6
+ job_id: string;
7
+ /** Target entity/collection to process */
8
+ target: string;
9
+ /** Job collection for logs */
10
+ job_collection: string;
11
+ /** Optional input data */
12
+ input?: Record<string, unknown>;
13
+ /** Arke API base URL for callbacks */
14
+ api_base: string;
15
+ /** When permissions expire (ISO 8601) */
16
+ expires_at: string;
17
+ /** Which network (test/main) */
18
+ network: 'test' | 'main';
19
+ /** Workflow context - present when invoked via rhiza */
20
+ rhiza?: RhizaContext;
21
+ }
22
+ /**
23
+ * RhizaContext - Workflow execution context
24
+ *
25
+ * The context passed to a klados when invoked as part of a workflow.
26
+ * Uses path-based tracking to handle multiple mentions of the same klados.
27
+ */
28
+ export interface RhizaContext {
29
+ /** Rhiza entity ID */
30
+ id: string;
31
+ /**
32
+ * Path that got us here - sequence of klados IDs from entry to current
33
+ * This solves the problem of multiple mentions of the same klados:
34
+ * we know which instance we are by our position in the path.
35
+ *
36
+ * Example: ['II01klados_pdf...', 'II01klados_ocr...']
37
+ * The current klados looks up its position to find what to do next.
38
+ */
39
+ path: string[];
40
+ /**
41
+ * Immediate parent log entry ID(s)
42
+ * - For pass/scatter: single parent ID
43
+ * - For gather: array of all parent sibling IDs (fan-in)
44
+ *
45
+ * Children create log entries pointing back to these parents.
46
+ * No parent updates needed (fire-and-forget).
47
+ */
48
+ parent_logs: string[];
49
+ /**
50
+ * Batch context - present when part of scatter/gather
51
+ * Only exists within workflow context (no standalone batching)
52
+ */
53
+ batch?: BatchContext;
54
+ }
55
+ /**
56
+ * BatchContext - Context when part of scatter/gather
57
+ *
58
+ * Note: gather_target is NOT included here - it's in the workflow definition.
59
+ * The klados looks up what to do next from the rhiza flow.
60
+ */
61
+ export interface BatchContext {
62
+ /** Batch entity ID */
63
+ id: string;
64
+ /** Our slot index (0-based) */
65
+ index: number;
66
+ /** Total slots in batch */
67
+ total: number;
68
+ }
69
+ //# sourceMappingURL=request.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"request.d.ts","sourceRoot":"","sources":["../../src/types/request.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,4BAA4B;IAC5B,MAAM,EAAE,MAAM,CAAC;IAEf,0CAA0C;IAC1C,MAAM,EAAE,MAAM,CAAC;IAEf,8BAA8B;IAC9B,cAAc,EAAE,MAAM,CAAC;IAEvB,0BAA0B;IAC1B,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAEhC,sCAAsC;IACtC,QAAQ,EAAE,MAAM,CAAC;IAEjB,yCAAyC;IACzC,UAAU,EAAE,MAAM,CAAC;IAEnB,gCAAgC;IAChC,OAAO,EAAE,MAAM,GAAG,MAAM,CAAC;IAEzB,wDAAwD;IACxD,KAAK,CAAC,EAAE,YAAY,CAAC;CACtB;AAED;;;;;GAKG;AACH,MAAM,WAAW,YAAY;IAC3B,sBAAsB;IACtB,EAAE,EAAE,MAAM,CAAC;IAEX;;;;;;;OAOG;IACH,IAAI,EAAE,MAAM,EAAE,CAAC;IAEf;;;;;;;OAOG;IACH,WAAW,EAAE,MAAM,EAAE,CAAC;IAEtB;;;OAGG;IACH,KAAK,CAAC,EAAE,YAAY,CAAC;CACtB;AAED;;;;;GAKG;AACH,MAAM,WAAW,YAAY;IAC3B,sBAAsB;IACtB,EAAE,EAAE,MAAM,CAAC;IAEX,+BAA+B;IAC/B,KAAK,EAAE,MAAM,CAAC;IAEd,2BAA2B;IAC3B,KAAK,EAAE,MAAM,CAAC;CACf"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=request.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"request.js","sourceRoot":"","sources":["../../src/types/request.ts"],"names":[],"mappings":""}
@@ -0,0 +1,31 @@
1
+ /**
2
+ * KladosResponse - What a klados returns after accepting/rejecting
3
+ */
4
+ export interface KladosResponse {
5
+ /** Whether the klados accepted the job */
6
+ accepted: boolean;
7
+ /** Job ID (must match request) */
8
+ job_id: string;
9
+ /** Error message if rejected */
10
+ error?: string;
11
+ /** Retry delay in seconds (for transient errors) */
12
+ retry_after?: number;
13
+ }
14
+ /**
15
+ * KladosResult - Final result after klados completes
16
+ */
17
+ export interface KladosResult {
18
+ /** Completion status */
19
+ status: 'done' | 'error';
20
+ /** Produced entity IDs (if done) */
21
+ outputs?: string[];
22
+ /** Error details (if error) */
23
+ error?: {
24
+ code: string;
25
+ message: string;
26
+ retryable: boolean;
27
+ };
28
+ /** Optional result metadata */
29
+ metadata?: Record<string, unknown>;
30
+ }
31
+ //# sourceMappingURL=response.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"response.d.ts","sourceRoot":"","sources":["../../src/types/response.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,0CAA0C;IAC1C,QAAQ,EAAE,OAAO,CAAC;IAElB,kCAAkC;IAClC,MAAM,EAAE,MAAM,CAAC;IAEf,gCAAgC;IAChC,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf,oDAAoD;IACpD,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,wBAAwB;IACxB,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC;IAEzB,oCAAoC;IACpC,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IAEnB,+BAA+B;IAC/B,KAAK,CAAC,EAAE;QACN,IAAI,EAAE,MAAM,CAAC;QACb,OAAO,EAAE,MAAM,CAAC;QAChB,SAAS,EAAE,OAAO,CAAC;KACpB,CAAC;IAEF,+BAA+B;IAC/B,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACpC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=response.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"response.js","sourceRoot":"","sources":["../../src/types/response.ts"],"names":[],"mappings":""}
@@ -0,0 +1,100 @@
1
+ import type { EntityRef } from './refs';
2
+ /**
3
+ * RhizaEntity - A workflow entity
4
+ *
5
+ * Rhizai compose kladoi into executable workflows.
6
+ * They define the flow (what klados invokes what next).
7
+ */
8
+ export interface RhizaEntity {
9
+ /** Unique identifier (Arke entity ID) */
10
+ id: string;
11
+ /** Entity type */
12
+ type: 'rhiza';
13
+ properties: RhizaProperties;
14
+ relationships?: Array<{
15
+ predicate: string;
16
+ peer: string;
17
+ peer_type?: string;
18
+ peer_label?: string;
19
+ properties?: Record<string, unknown>;
20
+ }>;
21
+ }
22
+ export interface RhizaProperties {
23
+ /** Human-readable name */
24
+ label: string;
25
+ /** Description of what this workflow does */
26
+ description?: string;
27
+ /** Semantic version */
28
+ version: string;
29
+ /** Entry point - reference to the klados that starts the workflow */
30
+ entry: EntityRef;
31
+ /** Flow definition - what happens after each klados */
32
+ flow: Record<string, FlowStep>;
33
+ /** Status */
34
+ status: 'development' | 'active' | 'disabled';
35
+ /** Timestamps */
36
+ created_at?: string;
37
+ updated_at?: string;
38
+ }
39
+ /**
40
+ * FlowStep - What happens after a klados completes
41
+ */
42
+ export interface FlowStep {
43
+ /** Handoff specification */
44
+ then: ThenSpec;
45
+ }
46
+ /**
47
+ * ThenSpec - Handoff specification
48
+ *
49
+ * Three core operations: pass, scatter, gather (+ done for terminal)
50
+ * - Target is an EntityRef (type hint avoids runtime discovery)
51
+ * - Route conditions can be added to any operation via `route` array
52
+ */
53
+ export type ThenSpec = {
54
+ done: true;
55
+ } | {
56
+ pass: EntityRef;
57
+ route?: RouteRule[];
58
+ } | {
59
+ scatter: EntityRef;
60
+ route?: RouteRule[];
61
+ } | {
62
+ gather: EntityRef;
63
+ route?: RouteRule[];
64
+ };
65
+ /**
66
+ * RouteRule - Conditional routing rule
67
+ *
68
+ * Routes are evaluated in order. First matching rule wins.
69
+ * If no rule matches, the default target (pass/scatter/gather value) is used.
70
+ */
71
+ export interface RouteRule {
72
+ /** Condition to match (supports AND/OR logic) */
73
+ where: WhereCondition;
74
+ /** Target reference if condition matches (overrides default) */
75
+ target: EntityRef;
76
+ }
77
+ /**
78
+ * WhereCondition - Property-based matching with AND/OR logic
79
+ *
80
+ * Examples:
81
+ * - Simple: { property: "type", equals: "File" }
82
+ * - AND: { and: [{ property: "type", equals: "File" }, { property: "file_type", equals: "image/jpeg" }] }
83
+ * - OR: { or: [{ property: "file_type", equals: "image/jpeg" }, { property: "file_type", equals: "image/png" }] }
84
+ */
85
+ export type WhereCondition = WhereEquals | WhereAnd | WhereOr;
86
+ export interface WhereEquals {
87
+ /** Property name to check (e.g., "type", "content_type") */
88
+ property: string;
89
+ /** Value to match (null to check for absent/null properties) */
90
+ equals: string | number | boolean | null;
91
+ }
92
+ export interface WhereAnd {
93
+ /** All conditions must match */
94
+ and: WhereCondition[];
95
+ }
96
+ export interface WhereOr {
97
+ /** Any condition must match */
98
+ or: WhereCondition[];
99
+ }
100
+ //# sourceMappingURL=rhiza.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rhiza.d.ts","sourceRoot":"","sources":["../../src/types/rhiza.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AAExC;;;;;GAKG;AACH,MAAM,WAAW,WAAW;IAC1B,yCAAyC;IACzC,EAAE,EAAE,MAAM,CAAC;IAEX,kBAAkB;IAClB,IAAI,EAAE,OAAO,CAAC;IAEd,UAAU,EAAE,eAAe,CAAC;IAE5B,aAAa,CAAC,EAAE,KAAK,CAAC;QACpB,SAAS,EAAE,MAAM,CAAC;QAClB,IAAI,EAAE,MAAM,CAAC;QACb,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;KACtC,CAAC,CAAC;CACJ;AAED,MAAM,WAAW,eAAe;IAC9B,0BAA0B;IAC1B,KAAK,EAAE,MAAM,CAAC;IAEd,6CAA6C;IAC7C,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB,uBAAuB;IACvB,OAAO,EAAE,MAAM,CAAC;IAEhB,qEAAqE;IACrE,KAAK,EAAE,SAAS,CAAC;IAEjB,uDAAuD;IACvD,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;IAE/B,aAAa;IACb,MAAM,EAAE,aAAa,GAAG,QAAQ,GAAG,UAAU,CAAC;IAE9C,iBAAiB;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED;;GAEG;AACH,MAAM,WAAW,QAAQ;IACvB,4BAA4B;IAC5B,IAAI,EAAE,QAAQ,CAAC;CAChB;AAED;;;;;;GAMG;AACH,MAAM,MAAM,QAAQ,GAChB;IAAE,IAAI,EAAE,IAAI,CAAA;CAAE,GACd;IAAE,IAAI,EAAE,SAAS,CAAC;IAAC,KAAK,CAAC,EAAE,SAAS,EAAE,CAAA;CAAE,GACxC;IAAE,OAAO,EAAE,SAAS,CAAC;IAAC,KAAK,CAAC,EAAE,SAAS,EAAE,CAAA;CAAE,GAC3C;IAAE,MAAM,EAAE,SAAS,CAAC;IAAC,KAAK,CAAC,EAAE,SAAS,EAAE,CAAA;CAAE,CAAC;AAE/C;;;;;GAKG;AACH,MAAM,WAAW,SAAS;IACxB,iDAAiD;IACjD,KAAK,EAAE,cAAc,CAAC;IAEtB,gEAAgE;IAChE,MAAM,EAAE,SAAS,CAAC;CACnB;AAED;;;;;;;GAOG;AACH,MAAM,MAAM,cAAc,GACtB,WAAW,GACX,QAAQ,GACR,OAAO,CAAC;AAEZ,MAAM,WAAW,WAAW;IAC1B,4DAA4D;IAC5D,QAAQ,EAAE,MAAM,CAAC;IACjB,gEAAgE;IAChE,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,CAAC;CAC1C;AAED,MAAM,WAAW,QAAQ;IACvB,gCAAgC;IAChC,GAAG,EAAE,cAAc,EAAE,CAAC;CACvB;AAED,MAAM,WAAW,OAAO;IACtB,+BAA+B;IAC/B,EAAE,EAAE,cAAc,EAAE,CAAC;CACtB"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=rhiza.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rhiza.js","sourceRoot":"","sources":["../../src/types/rhiza.ts"],"names":[],"mappings":""}
@@ -0,0 +1,84 @@
1
+ /**
2
+ * WorkflowStatus - Overall workflow execution status
3
+ */
4
+ export interface WorkflowStatus {
5
+ /** Job ID */
6
+ job_id: string;
7
+ /** Rhiza entity ID */
8
+ rhiza_id: string;
9
+ /** Overall status */
10
+ status: 'pending' | 'running' | 'done' | 'error';
11
+ /** Progress counters */
12
+ progress: ProgressCounters;
13
+ /** Currently executing kladoi (if running) */
14
+ current_kladoi?: string[];
15
+ /** Simplified log chain for debugging */
16
+ log_chain: LogChainEntry[];
17
+ /** Error leaves (if any) */
18
+ errors?: ErrorSummary[];
19
+ /** Timing */
20
+ started_at: string;
21
+ completed_at?: string;
22
+ }
23
+ /**
24
+ * ProgressCounters - Aggregated progress
25
+ */
26
+ export interface ProgressCounters {
27
+ total: number;
28
+ pending: number;
29
+ running: number;
30
+ done: number;
31
+ error: number;
32
+ }
33
+ /**
34
+ * LogChainEntry - Simplified log entry for status
35
+ */
36
+ export interface LogChainEntry {
37
+ log_id: string;
38
+ klados_id: string;
39
+ status: 'running' | 'done' | 'error';
40
+ started_at: string;
41
+ completed_at?: string;
42
+ children?: LogChainEntry[];
43
+ }
44
+ /**
45
+ * ErrorSummary - Summary of an error leaf
46
+ */
47
+ export interface ErrorSummary {
48
+ log_id: string;
49
+ klados_id: string;
50
+ job_id: string;
51
+ error: {
52
+ code: string;
53
+ message: string;
54
+ retryable: boolean;
55
+ };
56
+ }
57
+ /**
58
+ * ResumeResult - Result of resume operation
59
+ */
60
+ export interface ResumeResult {
61
+ resumed: number;
62
+ skipped: number;
63
+ jobs: ResumedJob[];
64
+ }
65
+ /**
66
+ * ResumedJob - Record of a job that was resumed
67
+ *
68
+ * Resume creates a NEW job_id for the retry attempt. The original job_id
69
+ * remains in the log chain for audit trail. The new job's log entry will
70
+ * point back to the failed log entry, maintaining the chain.
71
+ */
72
+ export interface ResumedJob {
73
+ /** Original failed job ID */
74
+ original_job_id: string;
75
+ /** New job ID for the retry */
76
+ new_job_id: string;
77
+ /** Klados that is being retried */
78
+ klados_id: string;
79
+ /** Target entity/entities being processed */
80
+ target: string | string[];
81
+ /** Original error message */
82
+ error: string;
83
+ }
84
+ //# sourceMappingURL=status.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"status.d.ts","sourceRoot":"","sources":["../../src/types/status.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,aAAa;IACb,MAAM,EAAE,MAAM,CAAC;IAEf,sBAAsB;IACtB,QAAQ,EAAE,MAAM,CAAC;IAEjB,qBAAqB;IACrB,MAAM,EAAE,SAAS,GAAG,SAAS,GAAG,MAAM,GAAG,OAAO,CAAC;IAEjD,wBAAwB;IACxB,QAAQ,EAAE,gBAAgB,CAAC;IAE3B,8CAA8C;IAC9C,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;IAE1B,yCAAyC;IACzC,SAAS,EAAE,aAAa,EAAE,CAAC;IAE3B,4BAA4B;IAC5B,MAAM,CAAC,EAAE,YAAY,EAAE,CAAC;IAExB,aAAa;IACb,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;CACf;AAED;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,SAAS,GAAG,MAAM,GAAG,OAAO,CAAC;IACrC,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,aAAa,EAAE,CAAC;CAC5B;AAED;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE;QACL,IAAI,EAAE,MAAM,CAAC;QACb,OAAO,EAAE,MAAM,CAAC;QAChB,SAAS,EAAE,OAAO,CAAC;KACpB,CAAC;CACH;AAED;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,UAAU,EAAE,CAAC;CACpB;AAED;;;;;;GAMG;AACH,MAAM,WAAW,UAAU;IACzB,6BAA6B;IAC7B,eAAe,EAAE,MAAM,CAAC;IACxB,+BAA+B;IAC/B,UAAU,EAAE,MAAM,CAAC;IACnB,mCAAmC;IACnC,SAAS,EAAE,MAAM,CAAC;IAClB,6CAA6C;IAC7C,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAC1B,6BAA6B;IAC7B,KAAK,EAAE,MAAM,CAAC;CACf"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=status.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"status.js","sourceRoot":"","sources":["../../src/types/status.ts"],"names":[],"mappings":""}
@@ -0,0 +1,15 @@
1
+ /**
2
+ * ID Generation Utility
3
+ *
4
+ * Generates unique identifiers for logs, batches, and jobs.
5
+ */
6
+ /**
7
+ * Generate a unique identifier
8
+ *
9
+ * Uses crypto.randomUUID() for standard UUID v4 generation,
10
+ * with a fallback for environments where it's not available.
11
+ *
12
+ * @returns A unique identifier string (UUID v4 format)
13
+ */
14
+ export declare function generateId(): string;
15
+ //# sourceMappingURL=id.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"id.d.ts","sourceRoot":"","sources":["../../src/utils/id.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;;;;;GAOG;AACH,wBAAgB,UAAU,IAAI,MAAM,CAWnC"}
@@ -0,0 +1,25 @@
1
+ /**
2
+ * ID Generation Utility
3
+ *
4
+ * Generates unique identifiers for logs, batches, and jobs.
5
+ */
6
+ /**
7
+ * Generate a unique identifier
8
+ *
9
+ * Uses crypto.randomUUID() for standard UUID v4 generation,
10
+ * with a fallback for environments where it's not available.
11
+ *
12
+ * @returns A unique identifier string (UUID v4 format)
13
+ */
14
+ export function generateId() {
15
+ if (typeof crypto !== 'undefined' && crypto.randomUUID) {
16
+ return crypto.randomUUID();
17
+ }
18
+ // Fallback for older environments
19
+ return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, (c) => {
20
+ const r = (Math.random() * 16) | 0;
21
+ const v = c === 'x' ? r : (r & 0x3) | 0x8;
22
+ return v.toString(16);
23
+ });
24
+ }
25
+ //# sourceMappingURL=id.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"id.js","sourceRoot":"","sources":["../../src/utils/id.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;;;;;GAOG;AACH,MAAM,UAAU,UAAU;IACxB,IAAI,OAAO,MAAM,KAAK,WAAW,IAAI,MAAM,CAAC,UAAU,EAAE,CAAC;QACvD,OAAO,MAAM,CAAC,UAAU,EAAE,CAAC;IAC7B,CAAC;IAED,kCAAkC;IAClC,OAAO,sCAAsC,CAAC,OAAO,CAAC,OAAO,EAAE,CAAC,CAAC,EAAE,EAAE;QACnE,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC;QACnC,MAAM,CAAC,GAAG,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC,GAAG,GAAG,CAAC;QAC1C,OAAO,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;IACxB,CAAC,CAAC,CAAC;AACL,CAAC"}
@@ -0,0 +1,2 @@
1
+ export { generateId } from './id';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC"}
@@ -0,0 +1,2 @@
1
+ export { generateId } from './id';
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC"}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Validation Module
3
+ *
4
+ * Exports validation functions for rhiza and klados entities.
5
+ * These are pure validation functions - no API calls.
6
+ */
7
+ export { validateKladosProperties, type ValidationResult, type ValidationError, type ValidationWarning, } from './validate-klados';
8
+ export { validateRhizaProperties, } from './validate-rhiza';
9
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/validation/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EACL,wBAAwB,EACxB,KAAK,gBAAgB,EACrB,KAAK,eAAe,EACpB,KAAK,iBAAiB,GACvB,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EACL,uBAAuB,GACxB,MAAM,kBAAkB,CAAC"}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Validation Module
3
+ *
4
+ * Exports validation functions for rhiza and klados entities.
5
+ * These are pure validation functions - no API calls.
6
+ */
7
+ export { validateKladosProperties, } from './validate-klados';
8
+ export { validateRhizaProperties, } from './validate-rhiza';
9
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/validation/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EACL,wBAAwB,GAIzB,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EACL,uBAAuB,GACxB,MAAM,kBAAkB,CAAC"}
@@ -0,0 +1,38 @@
1
+ /**
2
+ * Klados Validation
3
+ *
4
+ * Validates klados entity properties at creation/update time (static validation).
5
+ * This ensures klados definitions are well-formed before they can be activated.
6
+ */
7
+ import type { KladosProperties } from '../types';
8
+ /**
9
+ * ValidationResult - Result of validation
10
+ */
11
+ export interface ValidationResult {
12
+ valid: boolean;
13
+ errors: ValidationError[];
14
+ warnings: ValidationWarning[];
15
+ }
16
+ export interface ValidationError {
17
+ code: string;
18
+ message: string;
19
+ field?: string;
20
+ }
21
+ export interface ValidationWarning {
22
+ code: string;
23
+ message: string;
24
+ field?: string;
25
+ }
26
+ /**
27
+ * Validate klados properties (static validation)
28
+ *
29
+ * Checks:
30
+ * - endpoint: Required, must be valid URL
31
+ * - accepts.types: Required, non-empty array
32
+ * - accepts.cardinality: Must be 'one' or 'many'
33
+ * - produces.types: Required, non-empty array
34
+ * - produces.cardinality: Must be 'one' or 'many'
35
+ * - actions_required: Required, non-empty array
36
+ */
37
+ export declare function validateKladosProperties(properties: Partial<KladosProperties> | null | undefined): ValidationResult;
38
+ //# sourceMappingURL=validate-klados.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validate-klados.d.ts","sourceRoot":"","sources":["../../src/validation/validate-klados.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAEjD;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,OAAO,CAAC;IACf,MAAM,EAAE,eAAe,EAAE,CAAC;IAC1B,QAAQ,EAAE,iBAAiB,EAAE,CAAC;CAC/B;AAED,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,wBAAwB,CACtC,UAAU,EAAE,OAAO,CAAC,gBAAgB,CAAC,GAAG,IAAI,GAAG,SAAS,GACvD,gBAAgB,CAgIlB"}