@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.
- package/README.md +106 -0
- package/dist/__tests__/fixtures/index.d.ts +9 -0
- package/dist/__tests__/fixtures/index.d.ts.map +1 -0
- package/dist/__tests__/fixtures/index.js +12 -0
- package/dist/__tests__/fixtures/index.js.map +1 -0
- package/dist/__tests__/fixtures/kladoi/index.d.ts +165 -0
- package/dist/__tests__/fixtures/kladoi/index.d.ts.map +1 -0
- package/dist/__tests__/fixtures/kladoi/index.js +270 -0
- package/dist/__tests__/fixtures/kladoi/index.js.map +1 -0
- package/dist/__tests__/fixtures/logs/index.d.ts +19 -0
- package/dist/__tests__/fixtures/logs/index.d.ts.map +1 -0
- package/dist/__tests__/fixtures/logs/index.js +545 -0
- package/dist/__tests__/fixtures/logs/index.js.map +1 -0
- package/dist/__tests__/fixtures/mock-client.d.ts +127 -0
- package/dist/__tests__/fixtures/mock-client.d.ts.map +1 -0
- package/dist/__tests__/fixtures/mock-client.js +415 -0
- package/dist/__tests__/fixtures/mock-client.js.map +1 -0
- package/dist/__tests__/fixtures/rhizai/index.d.ts +54 -0
- package/dist/__tests__/fixtures/rhizai/index.d.ts.map +1 -0
- package/dist/__tests__/fixtures/rhizai/index.js +283 -0
- package/dist/__tests__/fixtures/rhizai/index.js.map +1 -0
- package/dist/__tests__/unit/fixtures.test.d.ts +10 -0
- package/dist/__tests__/unit/fixtures.test.d.ts.map +1 -0
- package/dist/__tests__/unit/fixtures.test.js +275 -0
- package/dist/__tests__/unit/fixtures.test.js.map +1 -0
- package/dist/__tests__/unit/handoff/gather.test.d.ts +8 -0
- package/dist/__tests__/unit/handoff/gather.test.d.ts.map +1 -0
- package/dist/__tests__/unit/handoff/gather.test.js +176 -0
- package/dist/__tests__/unit/handoff/gather.test.js.map +1 -0
- package/dist/__tests__/unit/handoff/interpret.test.d.ts +9 -0
- package/dist/__tests__/unit/handoff/interpret.test.d.ts.map +1 -0
- package/dist/__tests__/unit/handoff/interpret.test.js +370 -0
- package/dist/__tests__/unit/handoff/interpret.test.js.map +1 -0
- package/dist/__tests__/unit/handoff/route.test.d.ts +8 -0
- package/dist/__tests__/unit/handoff/route.test.d.ts.map +1 -0
- package/dist/__tests__/unit/handoff/route.test.js +271 -0
- package/dist/__tests__/unit/handoff/route.test.js.map +1 -0
- package/dist/__tests__/unit/handoff/scatter.test.d.ts +7 -0
- package/dist/__tests__/unit/handoff/scatter.test.d.ts.map +1 -0
- package/dist/__tests__/unit/handoff/scatter.test.js +54 -0
- package/dist/__tests__/unit/handoff/scatter.test.js.map +1 -0
- package/dist/__tests__/unit/resume.test.d.ts +8 -0
- package/dist/__tests__/unit/resume.test.d.ts.map +1 -0
- package/dist/__tests__/unit/resume.test.js +134 -0
- package/dist/__tests__/unit/resume.test.js.map +1 -0
- package/dist/__tests__/unit/status.test.d.ts +8 -0
- package/dist/__tests__/unit/status.test.d.ts.map +1 -0
- package/dist/__tests__/unit/status.test.js +164 -0
- package/dist/__tests__/unit/status.test.js.map +1 -0
- package/dist/__tests__/unit/target.test.d.ts +8 -0
- package/dist/__tests__/unit/target.test.d.ts.map +1 -0
- package/dist/__tests__/unit/target.test.js +116 -0
- package/dist/__tests__/unit/target.test.js.map +1 -0
- package/dist/__tests__/unit/traverse.test.d.ts +8 -0
- package/dist/__tests__/unit/traverse.test.d.ts.map +1 -0
- package/dist/__tests__/unit/traverse.test.js +143 -0
- package/dist/__tests__/unit/traverse.test.js.map +1 -0
- package/dist/__tests__/unit/validation/klados.test.d.ts +16 -0
- package/dist/__tests__/unit/validation/klados.test.d.ts.map +1 -0
- package/dist/__tests__/unit/validation/klados.test.js +275 -0
- package/dist/__tests__/unit/validation/klados.test.js.map +1 -0
- package/dist/__tests__/unit/validation/rhiza.test.d.ts +16 -0
- package/dist/__tests__/unit/validation/rhiza.test.d.ts.map +1 -0
- package/dist/__tests__/unit/validation/rhiza.test.js +612 -0
- package/dist/__tests__/unit/validation/rhiza.test.js.map +1 -0
- package/dist/__tests__/unit/validation/runtime.test.d.ts +11 -0
- package/dist/__tests__/unit/validation/runtime.test.d.ts.map +1 -0
- package/dist/__tests__/unit/validation/runtime.test.js +553 -0
- package/dist/__tests__/unit/validation/runtime.test.js.map +1 -0
- package/dist/__tests__/unit/worker/errors.test.d.ts +2 -0
- package/dist/__tests__/unit/worker/errors.test.d.ts.map +1 -0
- package/dist/__tests__/unit/worker/errors.test.js +226 -0
- package/dist/__tests__/unit/worker/errors.test.js.map +1 -0
- package/dist/__tests__/unit/worker/job.test.d.ts +2 -0
- package/dist/__tests__/unit/worker/job.test.d.ts.map +1 -0
- package/dist/__tests__/unit/worker/job.test.js +233 -0
- package/dist/__tests__/unit/worker/job.test.js.map +1 -0
- package/dist/client/index.d.ts +10 -0
- package/dist/client/index.d.ts.map +1 -0
- package/dist/client/index.js +8 -0
- package/dist/client/index.js.map +1 -0
- package/dist/client/interface.d.ts +142 -0
- package/dist/client/interface.d.ts.map +1 -0
- package/dist/client/interface.js +8 -0
- package/dist/client/interface.js.map +1 -0
- package/dist/client/mock.d.ts +95 -0
- package/dist/client/mock.d.ts.map +1 -0
- package/dist/client/mock.js +795 -0
- package/dist/client/mock.js.map +1 -0
- package/dist/client/types.d.ts +344 -0
- package/dist/client/types.d.ts.map +1 -0
- package/dist/client/types.js +8 -0
- package/dist/client/types.js.map +1 -0
- package/dist/handoff/gather-api.d.ts +60 -0
- package/dist/handoff/gather-api.d.ts.map +1 -0
- package/dist/handoff/gather-api.js +130 -0
- package/dist/handoff/gather-api.js.map +1 -0
- package/dist/handoff/gather.d.ts +59 -0
- package/dist/handoff/gather.d.ts.map +1 -0
- package/dist/handoff/gather.js +134 -0
- package/dist/handoff/gather.js.map +1 -0
- package/dist/handoff/index.d.ts +19 -0
- package/dist/handoff/index.d.ts.map +1 -0
- package/dist/handoff/index.js +25 -0
- package/dist/handoff/index.js.map +1 -0
- package/dist/handoff/interpret.d.ts +79 -0
- package/dist/handoff/interpret.d.ts.map +1 -0
- package/dist/handoff/interpret.js +197 -0
- package/dist/handoff/interpret.js.map +1 -0
- package/dist/handoff/invoke.d.ts +82 -0
- package/dist/handoff/invoke.d.ts.map +1 -0
- package/dist/handoff/invoke.js +196 -0
- package/dist/handoff/invoke.js.map +1 -0
- package/dist/handoff/route.d.ts +25 -0
- package/dist/handoff/route.d.ts.map +1 -0
- package/dist/handoff/route.js +65 -0
- package/dist/handoff/route.js.map +1 -0
- package/dist/handoff/scatter-api.d.ts +62 -0
- package/dist/handoff/scatter-api.d.ts.map +1 -0
- package/dist/handoff/scatter-api.js +81 -0
- package/dist/handoff/scatter-api.js.map +1 -0
- package/dist/handoff/scatter.d.ts +19 -0
- package/dist/handoff/scatter.d.ts.map +1 -0
- package/dist/handoff/scatter.js +27 -0
- package/dist/handoff/scatter.js.map +1 -0
- package/dist/handoff/target.d.ts +16 -0
- package/dist/handoff/target.d.ts.map +1 -0
- package/dist/handoff/target.js +51 -0
- package/dist/handoff/target.js.map +1 -0
- package/dist/index.d.ts +42 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +52 -0
- package/dist/index.js.map +1 -0
- package/dist/logging/index.d.ts +4 -0
- package/dist/logging/index.d.ts.map +1 -0
- package/dist/logging/index.js +3 -0
- package/dist/logging/index.js.map +1 -0
- package/dist/logging/logger.d.ts +52 -0
- package/dist/logging/logger.d.ts.map +1 -0
- package/dist/logging/logger.js +70 -0
- package/dist/logging/logger.js.map +1 -0
- package/dist/logging/writer.d.ts +63 -0
- package/dist/logging/writer.d.ts.map +1 -0
- package/dist/logging/writer.js +160 -0
- package/dist/logging/writer.js.map +1 -0
- package/dist/resume/index.d.ts +77 -0
- package/dist/resume/index.d.ts.map +1 -0
- package/dist/resume/index.js +110 -0
- package/dist/resume/index.js.map +1 -0
- package/dist/status/index.d.ts +54 -0
- package/dist/status/index.d.ts.map +1 -0
- package/dist/status/index.js +107 -0
- package/dist/status/index.js.map +1 -0
- package/dist/traverse/index.d.ts +53 -0
- package/dist/traverse/index.d.ts.map +1 -0
- package/dist/traverse/index.js +142 -0
- package/dist/traverse/index.js.map +1 -0
- package/dist/types/batch.d.ts +53 -0
- package/dist/types/batch.d.ts.map +1 -0
- package/dist/types/batch.js +2 -0
- package/dist/types/batch.js.map +1 -0
- package/dist/types/index.d.ts +10 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +2 -0
- package/dist/types/index.js.map +1 -0
- package/dist/types/klados.d.ts +63 -0
- package/dist/types/klados.d.ts.map +1 -0
- package/dist/types/klados.js +2 -0
- package/dist/types/klados.js.map +1 -0
- package/dist/types/log.d.ts +107 -0
- package/dist/types/log.d.ts.map +1 -0
- package/dist/types/log.js +2 -0
- package/dist/types/log.js.map +1 -0
- package/dist/types/refs.d.ts +58 -0
- package/dist/types/refs.d.ts.map +1 -0
- package/dist/types/refs.js +43 -0
- package/dist/types/refs.js.map +1 -0
- package/dist/types/request.d.ts +69 -0
- package/dist/types/request.d.ts.map +1 -0
- package/dist/types/request.js +2 -0
- package/dist/types/request.js.map +1 -0
- package/dist/types/response.d.ts +31 -0
- package/dist/types/response.d.ts.map +1 -0
- package/dist/types/response.js +2 -0
- package/dist/types/response.js.map +1 -0
- package/dist/types/rhiza.d.ts +100 -0
- package/dist/types/rhiza.d.ts.map +1 -0
- package/dist/types/rhiza.js +2 -0
- package/dist/types/rhiza.js.map +1 -0
- package/dist/types/status.d.ts +84 -0
- package/dist/types/status.d.ts.map +1 -0
- package/dist/types/status.js +2 -0
- package/dist/types/status.js.map +1 -0
- package/dist/utils/id.d.ts +15 -0
- package/dist/utils/id.d.ts.map +1 -0
- package/dist/utils/id.js +25 -0
- package/dist/utils/id.js.map +1 -0
- package/dist/utils/index.d.ts +2 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/index.js +2 -0
- package/dist/utils/index.js.map +1 -0
- package/dist/validation/index.d.ts +9 -0
- package/dist/validation/index.d.ts.map +1 -0
- package/dist/validation/index.js +9 -0
- package/dist/validation/index.js.map +1 -0
- package/dist/validation/validate-klados.d.ts +38 -0
- package/dist/validation/validate-klados.d.ts.map +1 -0
- package/dist/validation/validate-klados.js +139 -0
- package/dist/validation/validate-klados.js.map +1 -0
- package/dist/validation/validate-rhiza.d.ts +29 -0
- package/dist/validation/validate-rhiza.d.ts.map +1 -0
- package/dist/validation/validate-rhiza.js +382 -0
- package/dist/validation/validate-rhiza.js.map +1 -0
- package/dist/validation/validate-runtime.d.ts +28 -0
- package/dist/validation/validate-runtime.d.ts.map +1 -0
- package/dist/validation/validate-runtime.js +212 -0
- package/dist/validation/validate-runtime.js.map +1 -0
- package/dist/worker/errors.d.ts +77 -0
- package/dist/worker/errors.d.ts.map +1 -0
- package/dist/worker/errors.js +143 -0
- package/dist/worker/errors.js.map +1 -0
- package/dist/worker/index.d.ts +8 -0
- package/dist/worker/index.d.ts.map +1 -0
- package/dist/worker/index.js +8 -0
- package/dist/worker/index.js.map +1 -0
- package/dist/worker/job.d.ts +150 -0
- package/dist/worker/job.d.ts.map +1 -0
- package/dist/worker/job.js +280 -0
- package/dist/worker/job.js.map +1 -0
- package/package.json +48 -0
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Invocation Utilities
|
|
3
|
+
*
|
|
4
|
+
* SDK utilities for invoking kladoi and rhizai.
|
|
5
|
+
* Fire-and-forget model: we invoke and record what we sent.
|
|
6
|
+
*/
|
|
7
|
+
import { generateId } from '../utils';
|
|
8
|
+
/**
|
|
9
|
+
* Discover target type by fetching the entity
|
|
10
|
+
*
|
|
11
|
+
* @param client - Arke client
|
|
12
|
+
* @param targetId - Target entity ID
|
|
13
|
+
* @returns 'klados' or 'rhiza'
|
|
14
|
+
*/
|
|
15
|
+
export async function discoverTargetType(client, targetId) {
|
|
16
|
+
const { data: entity, error } = await client.api.GET('/entities/{id}', {
|
|
17
|
+
params: { path: { id: targetId } },
|
|
18
|
+
});
|
|
19
|
+
if (error || !entity) {
|
|
20
|
+
throw new Error(`Failed to fetch target entity: ${targetId}`);
|
|
21
|
+
}
|
|
22
|
+
const entityType = entity.type;
|
|
23
|
+
if (entityType === 'rhiza') {
|
|
24
|
+
return 'rhiza';
|
|
25
|
+
}
|
|
26
|
+
if (entityType === 'klados') {
|
|
27
|
+
return 'klados';
|
|
28
|
+
}
|
|
29
|
+
throw new Error(`Target ${targetId} has unknown type: ${entityType}`);
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Invoke a target (klados or rhiza) based on its type
|
|
33
|
+
*
|
|
34
|
+
* @param client - Arke client
|
|
35
|
+
* @param targetId - Target klados or rhiza ID
|
|
36
|
+
* @param targetType - Whether target is klados or rhiza
|
|
37
|
+
* @param entityTarget - Entity ID(s) to process
|
|
38
|
+
* @param options - Invocation options
|
|
39
|
+
* @returns Invocation result
|
|
40
|
+
*/
|
|
41
|
+
export async function invokeTarget(client, targetId, targetType, entityTarget, options) {
|
|
42
|
+
if (targetType === 'rhiza') {
|
|
43
|
+
return invokeRhiza(client, targetId, entityTarget, options);
|
|
44
|
+
}
|
|
45
|
+
return invokeKlados(client, targetId, entityTarget, options);
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Invoke a klados via POST /kladoi/:id/invoke
|
|
49
|
+
*
|
|
50
|
+
* Fire-and-forget: we invoke and record what we sent.
|
|
51
|
+
* The invoked klados creates its own log entry pointing back to us.
|
|
52
|
+
*/
|
|
53
|
+
export async function invokeKlados(client, kladosId, entityTarget, options) {
|
|
54
|
+
const jobId = `job_${generateId()}`;
|
|
55
|
+
const target = Array.isArray(entityTarget) ? entityTarget[0] : entityTarget;
|
|
56
|
+
const expiresIn = options.expiresIn ?? 3600;
|
|
57
|
+
// Build the klados request (for logging/replay)
|
|
58
|
+
const request = {
|
|
59
|
+
job_id: jobId,
|
|
60
|
+
target,
|
|
61
|
+
job_collection: options.jobCollectionId,
|
|
62
|
+
api_base: options.apiBase,
|
|
63
|
+
expires_at: new Date(Date.now() + expiresIn * 1000).toISOString(),
|
|
64
|
+
network: options.network,
|
|
65
|
+
input: options.input,
|
|
66
|
+
};
|
|
67
|
+
// Add rhiza context if present
|
|
68
|
+
if (options.rhiza) {
|
|
69
|
+
request.rhiza = {
|
|
70
|
+
id: options.rhiza.id,
|
|
71
|
+
path: [...options.rhiza.path, kladosId],
|
|
72
|
+
parent_logs: options.parentLogs,
|
|
73
|
+
batch: options.batch,
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
// Build the invocation record first (for logging regardless of success)
|
|
77
|
+
const invocation = {
|
|
78
|
+
request,
|
|
79
|
+
batch_index: options.batch?.index,
|
|
80
|
+
};
|
|
81
|
+
try {
|
|
82
|
+
// Invoke via POST /kladoi/:id/invoke
|
|
83
|
+
const { data, error } = await client.api.POST('/kladoi/{id}/invoke', {
|
|
84
|
+
params: { path: { id: kladosId } },
|
|
85
|
+
body: {
|
|
86
|
+
target: request.target,
|
|
87
|
+
job_collection: request.job_collection,
|
|
88
|
+
input: request.input,
|
|
89
|
+
expires_in: expiresIn,
|
|
90
|
+
confirm: true,
|
|
91
|
+
rhiza_context: request.rhiza,
|
|
92
|
+
},
|
|
93
|
+
});
|
|
94
|
+
if (error) {
|
|
95
|
+
return {
|
|
96
|
+
jobId,
|
|
97
|
+
accepted: false,
|
|
98
|
+
error: error.error || 'Unknown error',
|
|
99
|
+
invocation,
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
// Check if it's a started response (has status: 'started' and job_id)
|
|
103
|
+
if (data && 'status' in data && data.status === 'started' && 'job_id' in data) {
|
|
104
|
+
return {
|
|
105
|
+
jobId: data.job_id,
|
|
106
|
+
accepted: true,
|
|
107
|
+
invocation,
|
|
108
|
+
};
|
|
109
|
+
}
|
|
110
|
+
// Preview response or rejected - not what we expected with confirm: true
|
|
111
|
+
return {
|
|
112
|
+
jobId,
|
|
113
|
+
accepted: false,
|
|
114
|
+
error: 'Unexpected response from invoke',
|
|
115
|
+
invocation,
|
|
116
|
+
};
|
|
117
|
+
}
|
|
118
|
+
catch (e) {
|
|
119
|
+
return {
|
|
120
|
+
jobId,
|
|
121
|
+
accepted: false,
|
|
122
|
+
error: e instanceof Error ? e.message : 'Unknown error',
|
|
123
|
+
invocation,
|
|
124
|
+
};
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
/**
|
|
128
|
+
* Invoke a sub-rhiza via POST /rhizai/:id/invoke
|
|
129
|
+
*
|
|
130
|
+
* Fire-and-forget: the sub-rhiza creates log entries pointing back to parent.
|
|
131
|
+
* Parent does not track children.
|
|
132
|
+
*
|
|
133
|
+
* Note: The current API doesn't support passing parent_logs directly.
|
|
134
|
+
* Sub-rhiza invocations with parent tracking would need API extension.
|
|
135
|
+
*/
|
|
136
|
+
export async function invokeRhiza(client, rhizaId, entityTarget, options) {
|
|
137
|
+
const jobId = `job_${generateId()}`;
|
|
138
|
+
const target = Array.isArray(entityTarget) ? entityTarget[0] : entityTarget;
|
|
139
|
+
const expiresIn = options.expiresIn ?? 3600;
|
|
140
|
+
// Build a minimal request for logging
|
|
141
|
+
const request = {
|
|
142
|
+
job_id: jobId,
|
|
143
|
+
target,
|
|
144
|
+
job_collection: options.jobCollectionId,
|
|
145
|
+
api_base: options.apiBase,
|
|
146
|
+
expires_at: new Date(Date.now() + expiresIn * 1000).toISOString(),
|
|
147
|
+
network: options.network,
|
|
148
|
+
};
|
|
149
|
+
const invocation = {
|
|
150
|
+
request,
|
|
151
|
+
batch_index: options.batch?.index,
|
|
152
|
+
};
|
|
153
|
+
try {
|
|
154
|
+
// Invoke via POST /rhizai/:id/invoke
|
|
155
|
+
const { data, error } = await client.api.POST('/rhizai/{id}/invoke', {
|
|
156
|
+
params: { path: { id: rhizaId } },
|
|
157
|
+
body: {
|
|
158
|
+
target,
|
|
159
|
+
input: options.input,
|
|
160
|
+
expires_in: expiresIn,
|
|
161
|
+
confirm: true,
|
|
162
|
+
},
|
|
163
|
+
});
|
|
164
|
+
if (error) {
|
|
165
|
+
return {
|
|
166
|
+
jobId,
|
|
167
|
+
accepted: false,
|
|
168
|
+
error: error.error || 'Unknown error',
|
|
169
|
+
invocation,
|
|
170
|
+
};
|
|
171
|
+
}
|
|
172
|
+
// Check if it's a started response
|
|
173
|
+
if (data && 'status' in data && data.status === 'started' && 'job_id' in data) {
|
|
174
|
+
return {
|
|
175
|
+
jobId: data.job_id,
|
|
176
|
+
accepted: true,
|
|
177
|
+
invocation,
|
|
178
|
+
};
|
|
179
|
+
}
|
|
180
|
+
return {
|
|
181
|
+
jobId,
|
|
182
|
+
accepted: false,
|
|
183
|
+
error: 'Unexpected response from invoke',
|
|
184
|
+
invocation,
|
|
185
|
+
};
|
|
186
|
+
}
|
|
187
|
+
catch (e) {
|
|
188
|
+
return {
|
|
189
|
+
jobId,
|
|
190
|
+
accepted: false,
|
|
191
|
+
error: e instanceof Error ? e.message : 'Unknown error',
|
|
192
|
+
invocation,
|
|
193
|
+
};
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
//# sourceMappingURL=invoke.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"invoke.js","sourceRoot":"","sources":["../../src/handoff/invoke.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAQH,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAmDtC;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,kBAAkB,CACtC,MAAkB,EAClB,QAAgB;IAEhB,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,MAAM,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,gBAAgB,EAAE;QACrE,MAAM,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,EAAE,QAAQ,EAAE,EAAE;KACnC,CAAC,CAAC;IAEH,IAAI,KAAK,IAAI,CAAC,MAAM,EAAE,CAAC;QACrB,MAAM,IAAI,KAAK,CAAC,kCAAkC,QAAQ,EAAE,CAAC,CAAC;IAChE,CAAC;IAED,MAAM,UAAU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AEF,IAAI,CAAC;QACH,qCAAqC;QACrC,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,MAAM,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,qBAAqB,EAAE;YACnE,MAAM,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,EAAE,OAAO,EAAE,EAAE;YACjC,IAAI,EAAE;gBACJ,MAAM;gBACN,KAAK,EAAE,OAAO,CAAC,KAAK;gBACpB,UAAU,EAAE,SAAS;gBACrB,OAAO,EAAE,IAAI;aACd;SACF,CAAC,CAAC;QAEH,IAAI,KAAK,EAAE,CAAC;YACV,OAAO;gBACL,KAAK;gBACL,QAAQ,EAAE,KAAK;gBACf,KAAK,EAAE,KAAK,CAAC,KAAK,IAAI,eAAe;gBACrC,UAAU;aACX,CAAC;QACJ,CAAC;QAED,mCAAmC;QACnC,IAAI,IAAI,IAAI,QAAQ,IAAI,IAAI,IAAI,IAAI,CAAC,MAAM,KAAK,SAAS,IAAI,QAAQ,IAAI,IAAI,EAAE,CAAC;YAC9E,OAAO;gBACL,KAAK,EAAE,IAAI,CAAC,MAAM;gBAClB,QAAQ,EAAE,IAAI;gBACd,UAAU;aACX,CAAC;QACJ,CAAC;QAED,OAAO;YACL,KAAK;YACL,QAAQ,EAAE,KAAK;YACf,KAAK,EAAE,iCAAiC;YACxC,UAAU;SACX,CAAC;IACJ,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACX,OAAO;YACL,KAAK;YACL,QAAQ,EAAE,KAAK;YACf,KAAK,EAAE,CAAC,YAAY,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,eAAe;YACvD,UAAU;SACX,CAAC;IACJ,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Route Matching
|
|
3
|
+
*
|
|
4
|
+
* Evaluates where conditions and matches route rules for conditional routing.
|
|
5
|
+
*/
|
|
6
|
+
import type { WhereCondition, RouteRule } from '../types';
|
|
7
|
+
/**
|
|
8
|
+
* Evaluate a where condition against entity properties
|
|
9
|
+
*
|
|
10
|
+
* @param properties - The entity properties to evaluate against
|
|
11
|
+
* @param where - The where condition to evaluate
|
|
12
|
+
* @returns true if the condition matches
|
|
13
|
+
*/
|
|
14
|
+
export declare function evaluateWhere(properties: Record<string, unknown>, where: WhereCondition): boolean;
|
|
15
|
+
/**
|
|
16
|
+
* Match route rules against entity properties
|
|
17
|
+
*
|
|
18
|
+
* Evaluates rules in order and returns the first matching rule.
|
|
19
|
+
*
|
|
20
|
+
* @param properties - The entity properties to match against
|
|
21
|
+
* @param rules - The route rules to evaluate
|
|
22
|
+
* @returns The first matching rule, or null if none match
|
|
23
|
+
*/
|
|
24
|
+
export declare function matchRoute(properties: Record<string, unknown>, rules: RouteRule[]): RouteRule | null;
|
|
25
|
+
//# sourceMappingURL=route.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"route.d.ts","sourceRoot":"","sources":["../../src/handoff/route.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAuB1D;;;;;;GAMG;AACH,wBAAgB,aAAa,CAC3B,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACnC,KAAK,EAAE,cAAc,GACpB,OAAO,CAmBT;AAED;;;;;;;;GAQG;AACH,wBAAgB,UAAU,CACxB,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACnC,KAAK,EAAE,SAAS,EAAE,GACjB,SAAS,GAAG,IAAI,CAOlB"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Route Matching
|
|
3
|
+
*
|
|
4
|
+
* Evaluates where conditions and matches route rules for conditional routing.
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Get a nested property value using dot notation
|
|
8
|
+
* e.g., "metadata.format" on { metadata: { format: "pdf" } } returns "pdf"
|
|
9
|
+
*/
|
|
10
|
+
function getNestedValue(obj, path) {
|
|
11
|
+
const parts = path.split('.');
|
|
12
|
+
let current = obj;
|
|
13
|
+
for (const part of parts) {
|
|
14
|
+
if (current === null || current === undefined) {
|
|
15
|
+
return undefined;
|
|
16
|
+
}
|
|
17
|
+
if (typeof current !== 'object') {
|
|
18
|
+
return undefined;
|
|
19
|
+
}
|
|
20
|
+
current = current[part];
|
|
21
|
+
}
|
|
22
|
+
return current;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Evaluate a where condition against entity properties
|
|
26
|
+
*
|
|
27
|
+
* @param properties - The entity properties to evaluate against
|
|
28
|
+
* @param where - The where condition to evaluate
|
|
29
|
+
* @returns true if the condition matches
|
|
30
|
+
*/
|
|
31
|
+
export function evaluateWhere(properties, where) {
|
|
32
|
+
// Simple equality check
|
|
33
|
+
if ('property' in where && 'equals' in where) {
|
|
34
|
+
const value = getNestedValue(properties, where.property);
|
|
35
|
+
return value === where.equals;
|
|
36
|
+
}
|
|
37
|
+
// AND condition - all must match
|
|
38
|
+
if ('and' in where) {
|
|
39
|
+
return where.and.every((condition) => evaluateWhere(properties, condition));
|
|
40
|
+
}
|
|
41
|
+
// OR condition - any must match
|
|
42
|
+
if ('or' in where) {
|
|
43
|
+
return where.or.some((condition) => evaluateWhere(properties, condition));
|
|
44
|
+
}
|
|
45
|
+
// Unknown condition type - should not match
|
|
46
|
+
return false;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Match route rules against entity properties
|
|
50
|
+
*
|
|
51
|
+
* Evaluates rules in order and returns the first matching rule.
|
|
52
|
+
*
|
|
53
|
+
* @param properties - The entity properties to match against
|
|
54
|
+
* @param rules - The route rules to evaluate
|
|
55
|
+
* @returns The first matching rule, or null if none match
|
|
56
|
+
*/
|
|
57
|
+
export function matchRoute(properties, rules) {
|
|
58
|
+
for (const rule of rules) {
|
|
59
|
+
if (rule.where && evaluateWhere(properties, rule.where)) {
|
|
60
|
+
return rule;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
return null;
|
|
64
|
+
}
|
|
65
|
+
//# sourceMappingURL=route.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"route.js","sourceRoot":"","sources":["../../src/handoff/route.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH;;;GAGG;AACH,SAAS,cAAc,CAAC,GAA4B,EAAE,IAAY;IAChE,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAC9B,IAAI,OAAO,GAAY,GAAG,CAAC;IAE3B,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACzB,IAAI,OAAO,KAAK,IAAI,IAAI,OAAO,KAAK,SAAS,EAAE,CAAC;YAC9C,OAAO,SAAS,CAAC;QACnB,CAAC;QACD,IAAI,OAAO,OAAO,KAAK,QAAQ,EAAE,CAAC;YAChC,OAAO,SAAS,CAAC;QACnB,CAAC;QACD,OAAO,GAAI,OAAmC,CAAC,IAAI,CAAC,CAAC;IACvD,CAAC;IAED,OAAO,OAAO,CAAC;AACjB,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,aAAa,CAC3B,UAAmC,EACnC,KAAqB;IAErB,wBAAwB;IACxB,IAAI,UAAU,IAAI,KAAK,IAAI,QAAQ,IAAI,KAAK,EAAE,CAAC;QAC7C,MAAM,KAAK,GAAG,cAAc,CAAC,UAAU,EAAE,KAAK,CAAC,QAAQ,CAAC,CAAC;QACzD,OAAO,KAAK,KAAK,KAAK,CAAC,MAAM,CAAC;IAChC,CAAC;IAED,iCAAiC;IACjC,IAAI,KAAK,IAAI,KAAK,EAAE,CAAC;QACnB,OAAO,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,aAAa,CAAC,UAAU,EAAE,SAAS,CAAC,CAAC,CAAC;IAC9E,CAAC;IAED,gCAAgC;IAChC,IAAI,IAAI,IAAI,KAAK,EAAE,CAAC;QAClB,OAAO,KAAK,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,aAAa,CAAC,UAAU,EAAE,SAAS,CAAC,CAAC,CAAC;IAC5E,CAAC;IAED,4CAA4C;IAC5C,OAAO,KAAK,CAAC;AACf,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,UAAU,UAAU,CACxB,UAAmC,EACnC,KAAkB;IAElB,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACzB,IAAI,IAAI,CAAC,KAAK,IAAI,aAAa,CAAC,UAAU,EAAE,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;YACxD,OAAO,IAAI,CAAC;QACd,CAAC;IACH,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Scatter API Utilities
|
|
3
|
+
*
|
|
4
|
+
* SDK utilities for creating scatter batches and invoking targets.
|
|
5
|
+
*/
|
|
6
|
+
import type { ArkeClient } from '@arke-institute/sdk';
|
|
7
|
+
import type { BatchEntity, InvocationRecord } from '../types';
|
|
8
|
+
/**
|
|
9
|
+
* Options for creating a scatter batch
|
|
10
|
+
*/
|
|
11
|
+
export interface CreateScatterOptions {
|
|
12
|
+
/** Arke client */
|
|
13
|
+
client: ArkeClient;
|
|
14
|
+
/** Rhiza entity ID */
|
|
15
|
+
rhizaId: string;
|
|
16
|
+
/** Job ID */
|
|
17
|
+
jobId: string;
|
|
18
|
+
/** Job collection ID */
|
|
19
|
+
jobCollectionId: string;
|
|
20
|
+
/** Klados ID that created this batch */
|
|
21
|
+
sourceKladosId: string;
|
|
22
|
+
/** Target klados or rhiza ID */
|
|
23
|
+
targetId: string;
|
|
24
|
+
/** Whether target is klados or rhiza */
|
|
25
|
+
targetType: 'klados' | 'rhiza';
|
|
26
|
+
/** Klados ID that will receive gathered results */
|
|
27
|
+
gatherTargetId: string;
|
|
28
|
+
/** Output entity IDs to scatter */
|
|
29
|
+
outputs: string[];
|
|
30
|
+
/** Parent log ID for chain building */
|
|
31
|
+
fromLogId: string;
|
|
32
|
+
/** API base URL */
|
|
33
|
+
apiBase: string;
|
|
34
|
+
/** Permission duration in seconds (default: 3600) */
|
|
35
|
+
expiresIn?: number;
|
|
36
|
+
/** Network (test/main) */
|
|
37
|
+
network: 'test' | 'main';
|
|
38
|
+
/** Current path in workflow */
|
|
39
|
+
path: string[];
|
|
40
|
+
/** Concurrency limit for invocations (default: 10) */
|
|
41
|
+
concurrency?: number;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Result of creating a scatter batch
|
|
45
|
+
*/
|
|
46
|
+
export interface ScatterResult {
|
|
47
|
+
/** Batch entity ID */
|
|
48
|
+
batchId: string;
|
|
49
|
+
/** The created batch entity */
|
|
50
|
+
batch: BatchEntity;
|
|
51
|
+
/** Invocation records for logging */
|
|
52
|
+
invocations: InvocationRecord[];
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Create a scatter batch and invoke targets
|
|
56
|
+
*
|
|
57
|
+
* 1. Creates a batch entity in the job collection
|
|
58
|
+
* 2. Invokes the target for each output
|
|
59
|
+
* 3. Returns batch ID and invocation records for logging
|
|
60
|
+
*/
|
|
61
|
+
export declare function createScatterBatch(options: CreateScatterOptions): Promise<ScatterResult>;
|
|
62
|
+
//# sourceMappingURL=scatter-api.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scatter-api.d.ts","sourceRoot":"","sources":["../../src/handoff/scatter-api.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,KAAK,EACV,WAAW,EAEX,gBAAgB,EACjB,MAAM,UAAU,CAAC;AAGlB;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,kBAAkB;IAClB,MAAM,EAAE,UAAU,CAAC;IAEnB,sBAAsB;IACtB,OAAO,EAAE,MAAM,CAAC;IAEhB,aAAa;IACb,KAAK,EAAE,MAAM,CAAC;IAEd,wBAAwB;IACxB,eAAe,EAAE,MAAM,CAAC;IAExB,wCAAwC;IACxC,cAAc,EAAE,MAAM,CAAC;IAEvB,gCAAgC;IAChC,QAAQ,EAAE,MAAM,CAAC;IAEjB,wCAAwC;IACxC,UAAU,EAAE,QAAQ,GAAG,OAAO,CAAC;IAE/B,mDAAmD;IACnD,cAAc,EAAE,MAAM,CAAC;IAEvB,mCAAmC;IACnC,OAAO,EAAE,MAAM,EAAE,CAAC;IAElB,uCAAuC;IACvC,SAAS,EAAE,MAAM,CAAC;IAElB,mBAAmB;IACnB,OAAO,EAAE,MAAM,CAAC;IAEhB,qDAAqD;IACrD,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB,0BAA0B;IAC1B,OAAO,EAAE,MAAM,GAAG,MAAM,CAAC;IAEzB,+BAA+B;IAC/B,IAAI,EAAE,MAAM,EAAE,CAAC;IAEf,sDAAsD;IACtD,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,sBAAsB;IACtB,OAAO,EAAE,MAAM,CAAC;IAEhB,+BAA+B;IAC/B,KAAK,EAAE,WAAW,CAAC;IAEnB,qCAAqC;IACrC,WAAW,EAAE,gBAAgB,EAAE,CAAC;CACjC;AAED;;;;;;GAMG;AACH,wBAAsB,kBAAkB,CACtC,OAAO,EAAE,oBAAoB,GAC5B,OAAO,CAAC,aAAa,CAAC,CAmGxB"}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Scatter API Utilities
|
|
3
|
+
*
|
|
4
|
+
* SDK utilities for creating scatter batches and invoking targets.
|
|
5
|
+
*/
|
|
6
|
+
import { invokeTarget } from './invoke';
|
|
7
|
+
/**
|
|
8
|
+
* Create a scatter batch and invoke targets
|
|
9
|
+
*
|
|
10
|
+
* 1. Creates a batch entity in the job collection
|
|
11
|
+
* 2. Invokes the target for each output
|
|
12
|
+
* 3. Returns batch ID and invocation records for logging
|
|
13
|
+
*/
|
|
14
|
+
export async function createScatterBatch(options) {
|
|
15
|
+
const { client, rhizaId, jobId, jobCollectionId, sourceKladosId, targetId, targetType, gatherTargetId, outputs, fromLogId, apiBase, expiresIn, network, path, concurrency = 10, } = options;
|
|
16
|
+
// 1. Create batch entity
|
|
17
|
+
const batchProperties = {
|
|
18
|
+
rhiza_id: rhizaId,
|
|
19
|
+
job_id: jobId,
|
|
20
|
+
source_klados: sourceKladosId,
|
|
21
|
+
gather_klados: gatherTargetId,
|
|
22
|
+
total: outputs.length,
|
|
23
|
+
completed: 0,
|
|
24
|
+
status: 'pending',
|
|
25
|
+
slots: outputs.map((_, i) => ({
|
|
26
|
+
index: i,
|
|
27
|
+
status: 'pending',
|
|
28
|
+
})),
|
|
29
|
+
created_at: new Date().toISOString(),
|
|
30
|
+
};
|
|
31
|
+
const { data: batchEntity, error: createError } = await client.api.POST('/entities', {
|
|
32
|
+
body: {
|
|
33
|
+
type: 'batch',
|
|
34
|
+
collection: jobCollectionId,
|
|
35
|
+
properties: batchProperties,
|
|
36
|
+
},
|
|
37
|
+
});
|
|
38
|
+
if (createError || !batchEntity) {
|
|
39
|
+
throw new Error(`Failed to create batch entity: ${createError?.error || 'Unknown error'}`);
|
|
40
|
+
}
|
|
41
|
+
const batch = {
|
|
42
|
+
id: batchEntity.id,
|
|
43
|
+
type: 'batch',
|
|
44
|
+
properties: batchProperties,
|
|
45
|
+
};
|
|
46
|
+
// 2. Invoke target for each output with concurrency limit
|
|
47
|
+
const invocations = [];
|
|
48
|
+
// Process outputs in chunks for concurrency control
|
|
49
|
+
for (let i = 0; i < outputs.length; i += concurrency) {
|
|
50
|
+
const chunk = outputs.slice(i, i + concurrency);
|
|
51
|
+
const chunkPromises = chunk.map(async (output, chunkIndex) => {
|
|
52
|
+
const globalIndex = i + chunkIndex;
|
|
53
|
+
const invokeOptions = {
|
|
54
|
+
jobCollectionId,
|
|
55
|
+
apiBase,
|
|
56
|
+
expiresIn,
|
|
57
|
+
network,
|
|
58
|
+
parentLogs: [fromLogId],
|
|
59
|
+
batch: {
|
|
60
|
+
id: batchEntity.id,
|
|
61
|
+
index: globalIndex,
|
|
62
|
+
total: outputs.length,
|
|
63
|
+
},
|
|
64
|
+
rhiza: {
|
|
65
|
+
id: rhizaId,
|
|
66
|
+
path,
|
|
67
|
+
},
|
|
68
|
+
};
|
|
69
|
+
const result = await invokeTarget(client, targetId, targetType, output, invokeOptions);
|
|
70
|
+
return result.invocation;
|
|
71
|
+
});
|
|
72
|
+
const chunkResults = await Promise.all(chunkPromises);
|
|
73
|
+
invocations.push(...chunkResults);
|
|
74
|
+
}
|
|
75
|
+
return {
|
|
76
|
+
batchId: batchEntity.id,
|
|
77
|
+
batch,
|
|
78
|
+
invocations,
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
//# sourceMappingURL=scatter-api.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scatter-api.js","sourceRoot":"","sources":["../../src/handoff/scatter-api.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAQH,OAAO,EAAE,YAAY,EAAsB,MAAM,UAAU,CAAC;AAkE5D;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,kBAAkB,CACtC,OAA6B;IAE7B,MAAM,EACJ,MAAM,EACN,OAAO,EACP,KAAK,EACL,eAAe,EACf,cAAc,EACd,QAAQ,EACR,UAAU,EACV,cAAc,EACd,OAAO,EACP,SAAS,EACT,OAAO,EACP,SAAS,EACT,OAAO,EACP,IAAI,EACJ,WAAW,GAAG,EAAE,GACjB,GAAG,OAAO,CAAC;IAEZ,yBAAyB;IACzB,MAAM,eAAe,GAAoB;QACvC,QAAQ,EAAE,OAAO;QACjB,MAAM,EAAE,KAAK;QACb,aAAa,EAAE,cAAc;QAC7B,aAAa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CAAC;YAEnC,MAAM,aAAa,GAAkB;gBACnC,eAAe;gBACf,OAAO;gBACP,SAAS;gBACT,OAAO;gBACP,UAAU,EAAE,CAAC,SAAS,CAAC;gBACvB,KAAK,EAAE;oBACL,EAAE,EAAE,WAAW,CAAC,EAAE;oBAClB,KAAK,EAAE,WAAW;oBAClB,KAAK,EAAE,OAAO,CAAC,MAAM;iBACtB;gBACD,KAAK,EAAE;oBACL,EAAE,EAAE,OAAO;oBACX,IAAI;iBACL;aACF,CAAC;YAEF,MAAM,MAAM,GAAG,MAAM,YAAY,CAC/B,MAAM,EACN,QAAQ,EACR,UAAU,EACV,MAAM,EACN,aAAa,CACd,CAAC;YAEF,OAAO,MAAM,CAAC,UAAU,CAAC;QAC3B,CAAC,CAAC,CAAC;QAEH,MAAM,YAAY,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;QACtD,WAAW,CAAC,IAAI,CAAC,GAAG,YAAY,CAAC,CAAC;IACpC,CAAC;IAED,OAAO;QACL,OAAO,EAAE,WAAW,CAAC,EAAE;QACvB,KAAK;QACL,WAAW;KACZ,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Scatter Helpers
|
|
3
|
+
*
|
|
4
|
+
* Pure functions for scatter/gather operations.
|
|
5
|
+
* No API calls - workers should use SDK directly for invocations.
|
|
6
|
+
*/
|
|
7
|
+
import type { FlowStep, EntityRef } from '../types';
|
|
8
|
+
/**
|
|
9
|
+
* Find the gather target for a scatter operation
|
|
10
|
+
*
|
|
11
|
+
* Looks up the target klados in the flow and returns the gather target
|
|
12
|
+
* if the target has a gather handoff.
|
|
13
|
+
*
|
|
14
|
+
* @param flow - The rhiza flow definition
|
|
15
|
+
* @param targetKladosId - The scatter target klados ID
|
|
16
|
+
* @returns The gather target EntityRef, or null if not a gather handoff
|
|
17
|
+
*/
|
|
18
|
+
export declare function findGatherTarget(flow: Record<string, FlowStep>, targetKladosId: string): EntityRef | null;
|
|
19
|
+
//# sourceMappingURL=scatter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scatter.d.ts","sourceRoot":"","sources":["../../src/handoff/scatter.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAEpD;;;;;;;;;GASG;AACH,wBAAgB,gBAAgB,CAC9B,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAC,EAC9B,cAAc,EAAE,MAAM,GACrB,SAAS,GAAG,IAAI,CAWlB"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Scatter Helpers
|
|
3
|
+
*
|
|
4
|
+
* Pure functions for scatter/gather operations.
|
|
5
|
+
* No API calls - workers should use SDK directly for invocations.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Find the gather target for a scatter operation
|
|
9
|
+
*
|
|
10
|
+
* Looks up the target klados in the flow and returns the gather target
|
|
11
|
+
* if the target has a gather handoff.
|
|
12
|
+
*
|
|
13
|
+
* @param flow - The rhiza flow definition
|
|
14
|
+
* @param targetKladosId - The scatter target klados ID
|
|
15
|
+
* @returns The gather target EntityRef, or null if not a gather handoff
|
|
16
|
+
*/
|
|
17
|
+
export function findGatherTarget(flow, targetKladosId) {
|
|
18
|
+
const step = flow[targetKladosId];
|
|
19
|
+
if (!step || !step.then) {
|
|
20
|
+
return null;
|
|
21
|
+
}
|
|
22
|
+
if ('gather' in step.then) {
|
|
23
|
+
return step.then.gather;
|
|
24
|
+
}
|
|
25
|
+
return null;
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=scatter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scatter.js","sourceRoot":"","sources":["../../src/handoff/scatter.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH;;;;;;;;;GASG;AACH,MAAM,UAAU,gBAAgB,CAC9B,IAA8B,EAC9B,cAAsB;IAEtB,MAAM,IAAI,GAAG,IAAI,CAAC,cAAc,CAAC,CAAC;IAClC,IAAI,CAAC,IAAI,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC;QACxB,OAAO,IAAI,CAAC;IACd,CAAC;IAED,IAAI,QAAQ,IAAI,IAAI,CAAC,IAAI,EAAE,CAAC;QAC1B,OAAO,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC;IAC1B,CAAC;IAED,OAAO,IAAI,CAAC;AACd,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Target Resolution
|
|
3
|
+
*
|
|
4
|
+
* Resolves targets from flow steps by evaluating route rules.
|
|
5
|
+
* Pure function - no API calls.
|
|
6
|
+
*/
|
|
7
|
+
import type { ThenSpec, EntityRef } from '../types';
|
|
8
|
+
/**
|
|
9
|
+
* Resolve the target from a ThenSpec by evaluating route rules
|
|
10
|
+
*
|
|
11
|
+
* @param then - The ThenSpec to resolve
|
|
12
|
+
* @param properties - The entity properties to match against route rules
|
|
13
|
+
* @returns The resolved EntityRef, or null for done
|
|
14
|
+
*/
|
|
15
|
+
export declare function resolveTarget(then: ThenSpec, properties: Record<string, unknown>): EntityRef | null;
|
|
16
|
+
//# sourceMappingURL=target.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"target.d.ts","sourceRoot":"","sources":["../../src/handoff/target.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAGpD;;;;;;GAMG;AACH,wBAAgB,aAAa,CAC3B,IAAI,EAAE,QAAQ,EACd,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAClC,SAAS,GAAG,IAAI,CAqClB"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Target Resolution
|
|
3
|
+
*
|
|
4
|
+
* Resolves targets from flow steps by evaluating route rules.
|
|
5
|
+
* Pure function - no API calls.
|
|
6
|
+
*/
|
|
7
|
+
import { matchRoute } from './route';
|
|
8
|
+
/**
|
|
9
|
+
* Resolve the target from a ThenSpec by evaluating route rules
|
|
10
|
+
*
|
|
11
|
+
* @param then - The ThenSpec to resolve
|
|
12
|
+
* @param properties - The entity properties to match against route rules
|
|
13
|
+
* @returns The resolved EntityRef, or null for done
|
|
14
|
+
*/
|
|
15
|
+
export function resolveTarget(then, properties) {
|
|
16
|
+
// Terminal - no target
|
|
17
|
+
if ('done' in then) {
|
|
18
|
+
return null;
|
|
19
|
+
}
|
|
20
|
+
// Get the default target and optional route rules
|
|
21
|
+
let defaultTarget;
|
|
22
|
+
let route;
|
|
23
|
+
if ('pass' in then) {
|
|
24
|
+
defaultTarget = then.pass;
|
|
25
|
+
route = then.route;
|
|
26
|
+
}
|
|
27
|
+
else if ('scatter' in then) {
|
|
28
|
+
defaultTarget = then.scatter;
|
|
29
|
+
route = then.route;
|
|
30
|
+
}
|
|
31
|
+
else if ('gather' in then) {
|
|
32
|
+
defaultTarget = then.gather;
|
|
33
|
+
route = then.route;
|
|
34
|
+
}
|
|
35
|
+
else {
|
|
36
|
+
// Should not happen with well-typed ThenSpec
|
|
37
|
+
return null;
|
|
38
|
+
}
|
|
39
|
+
// If no route rules, return default
|
|
40
|
+
if (!route || route.length === 0) {
|
|
41
|
+
return defaultTarget;
|
|
42
|
+
}
|
|
43
|
+
// Evaluate route rules - first match wins
|
|
44
|
+
const matched = matchRoute(properties, route);
|
|
45
|
+
if (matched) {
|
|
46
|
+
return matched.target;
|
|
47
|
+
}
|
|
48
|
+
// No route matched - return default
|
|
49
|
+
return defaultTarget;
|
|
50
|
+
}
|
|
51
|
+
//# sourceMappingURL=target.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"target.js","sourceRoot":"","sources":["../../src/handoff/target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
|
4
|
+
* Types, pure logic, and SDK utilities for Arke workflow protocol.
|
|
5
|
+
* Workers use rhiza for types, validation, and workflow execution.
|
|
6
|
+
*
|
|
7
|
+
* Naming:
|
|
8
|
+
* - Rhiza (ῥίζα) = root, the workflow definition
|
|
9
|
+
* - Klados (κλάδος) = branch, an individual action
|
|
10
|
+
*
|
|
11
|
+
* The library provides:
|
|
12
|
+
* - Types: Entity types, request/response types, log types
|
|
13
|
+
* - Validation: Pure validation functions for klados/rhiza properties
|
|
14
|
+
* - Handoff (pure): Route matching, target resolution, gather state transforms
|
|
15
|
+
* - Handoff (SDK): Invocation, scatter/gather with CAS, orchestration
|
|
16
|
+
* - Logging: In-memory logger and API writers
|
|
17
|
+
* - Utilities: ID generation
|
|
18
|
+
*/
|
|
19
|
+
export type { KladosEntity, KladosProperties, ContractSpec, } from './types/klados';
|
|
20
|
+
export type { RhizaEntity, RhizaProperties, FlowStep, ThenSpec, RouteRule, WhereCondition, WhereEquals, WhereAnd, WhereOr, } from './types/rhiza';
|
|
21
|
+
export type { EntityRef } from './types/refs';
|
|
22
|
+
export { isEntityRef, ref } from './types/refs';
|
|
23
|
+
export type { KladosRequest, RhizaContext, BatchContext, } from './types/request';
|
|
24
|
+
export type { KladosResponse, KladosResult, } from './types/response';
|
|
25
|
+
export type { KladosLogEntry, HandoffRecord, InvocationRecord, LogMessage, JobLog, } from './types/log';
|
|
26
|
+
export type { BatchEntity, BatchProperties, BatchSlot, } from './types/batch';
|
|
27
|
+
export type { WorkflowStatus as WorkflowStatusResponse, ProgressCounters as ProgressCountersResponse, LogChainEntry, ErrorSummary as ErrorSummaryResponse, ResumeResult as ResumeResultResponse, ResumedJob as ResumedJobResponse, } from './types/status';
|
|
28
|
+
export { validateKladosProperties, type ValidationResult, type ValidationError, type ValidationWarning, } from './validation/validate-klados';
|
|
29
|
+
export { validateRhizaProperties } from './validation/validate-rhiza';
|
|
30
|
+
export { evaluateWhere, matchRoute } from './handoff/route';
|
|
31
|
+
export { resolveTarget } from './handoff/target';
|
|
32
|
+
export { findGatherTarget } from './handoff/scatter';
|
|
33
|
+
export { completeBatchSlot, errorBatchSlot, type BatchSlotResult, type BatchSlotErrorResult, type SlotError, } from './handoff/gather';
|
|
34
|
+
export { discoverTargetType, invokeTarget, invokeKlados, invokeRhiza, type InvokeOptions, type InvokeResult, } from './handoff/invoke';
|
|
35
|
+
export { createScatterBatch, type CreateScatterOptions, type ScatterResult, } from './handoff/scatter-api';
|
|
36
|
+
export { completeBatchSlotWithCAS, errorBatchSlotWithCAS, type GatherSlotResult, type GatherSlotErrorResult, } from './handoff/gather-api';
|
|
37
|
+
export { interpretThen, type HandoffAction, type InterpretContext, type InterpretResult, } from './handoff/interpret';
|
|
38
|
+
export { KladosLogger } from './logging/logger';
|
|
39
|
+
export { writeKladosLog, updateLogWithHandoffs, updateLogStatus, type WriteLogOptions, type WriteLogResult, type LogError, } from './logging/writer';
|
|
40
|
+
export { KladosJob, type KladosJobConfig, type KladosJobResult, KladosErrorCode, type KladosErrorCodeType, type KladosError, createKladosError, toKladosError, isKladosError, failKlados, type FailKladosOptions, } from './worker';
|
|
41
|
+
export { generateId } from './utils/id';
|
|
42
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAOH,YAAY,EACV,YAAY,EACZ,gBAAgB,EAChB,YAAY,GACb,MAAM,gBAAgB,CAAC;AAGxB,YAAY,EACV,WAAW,EACX,eAAe,EACf,QAAQ,EACR,QAAQ,EACR,SAAS,EACT,cAAc,EACd,WAAW,EACX,QAAQ,EACR,OAAO,GACR,MAAM,eAAe,CAAC;AAGvB,YAAY,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,EAAE,WAAW,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AAGhD,YAAY,EACV,aAAa,E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