@powerformer/refly-cli 0.1.13 → 0.1.15
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/dist/bin/refly.js +2842 -2043
- package/dist/bin/refly.js.map +1 -1
- package/dist/index.d.ts +1 -370
- package/dist/index.js +64 -329
- package/dist/index.js.map +1 -1
- package/package.json +4 -1
- package/skill/SKILL.md +21 -18
- package/skill/references/file.md +21 -9
- package/skill/references/node.md +64 -40
- package/skill/references/skill.md +376 -31
- package/skill/references/workflow.md +136 -43
package/dist/index.d.ts
CHANGED
|
@@ -1,315 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
|
|
3
|
-
/**
|
|
4
|
-
* Builder session schema and types
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
declare const NodeSchema: z.ZodObject<{
|
|
8
|
-
id: z.ZodString;
|
|
9
|
-
type: z.ZodString;
|
|
10
|
-
input: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
11
|
-
dependsOn: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
12
|
-
}, "strip", z.ZodTypeAny, {
|
|
13
|
-
id: string;
|
|
14
|
-
type: string;
|
|
15
|
-
dependsOn: string[];
|
|
16
|
-
input: Record<string, unknown>;
|
|
17
|
-
}, {
|
|
18
|
-
id: string;
|
|
19
|
-
type: string;
|
|
20
|
-
dependsOn?: string[] | undefined;
|
|
21
|
-
input?: Record<string, unknown> | undefined;
|
|
22
|
-
}>;
|
|
23
|
-
type WorkflowNode = z.infer<typeof NodeSchema>;
|
|
24
|
-
declare const WorkflowDraftSchema: z.ZodObject<{
|
|
25
|
-
name: z.ZodString;
|
|
26
|
-
description: z.ZodOptional<z.ZodString>;
|
|
27
|
-
nodes: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
28
|
-
id: z.ZodString;
|
|
29
|
-
type: z.ZodString;
|
|
30
|
-
input: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
31
|
-
dependsOn: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
32
|
-
}, "strip", z.ZodTypeAny, {
|
|
33
|
-
id: string;
|
|
34
|
-
type: string;
|
|
35
|
-
dependsOn: string[];
|
|
36
|
-
input: Record<string, unknown>;
|
|
37
|
-
}, {
|
|
38
|
-
id: string;
|
|
39
|
-
type: string;
|
|
40
|
-
dependsOn?: string[] | undefined;
|
|
41
|
-
input?: Record<string, unknown> | undefined;
|
|
42
|
-
}>, "many">>;
|
|
43
|
-
metadata: z.ZodOptional<z.ZodObject<{
|
|
44
|
-
tags: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
45
|
-
owner: z.ZodOptional<z.ZodString>;
|
|
46
|
-
}, "strip", z.ZodTypeAny, {
|
|
47
|
-
tags?: string[] | undefined;
|
|
48
|
-
owner?: string | undefined;
|
|
49
|
-
}, {
|
|
50
|
-
tags?: string[] | undefined;
|
|
51
|
-
owner?: string | undefined;
|
|
52
|
-
}>>;
|
|
53
|
-
}, "strip", z.ZodTypeAny, {
|
|
54
|
-
nodes: {
|
|
55
|
-
id: string;
|
|
56
|
-
type: string;
|
|
57
|
-
dependsOn: string[];
|
|
58
|
-
input: Record<string, unknown>;
|
|
59
|
-
}[];
|
|
60
|
-
name: string;
|
|
61
|
-
description?: string | undefined;
|
|
62
|
-
metadata?: {
|
|
63
|
-
tags?: string[] | undefined;
|
|
64
|
-
owner?: string | undefined;
|
|
65
|
-
} | undefined;
|
|
66
|
-
}, {
|
|
67
|
-
name: string;
|
|
68
|
-
nodes?: {
|
|
69
|
-
id: string;
|
|
70
|
-
type: string;
|
|
71
|
-
dependsOn?: string[] | undefined;
|
|
72
|
-
input?: Record<string, unknown> | undefined;
|
|
73
|
-
}[] | undefined;
|
|
74
|
-
description?: string | undefined;
|
|
75
|
-
metadata?: {
|
|
76
|
-
tags?: string[] | undefined;
|
|
77
|
-
owner?: string | undefined;
|
|
78
|
-
} | undefined;
|
|
79
|
-
}>;
|
|
80
|
-
type WorkflowDraft = z.infer<typeof WorkflowDraftSchema>;
|
|
81
|
-
declare const ValidationResultSchema: z.ZodObject<{
|
|
82
|
-
ok: z.ZodBoolean;
|
|
83
|
-
errors: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
84
|
-
code: z.ZodString;
|
|
85
|
-
message: z.ZodString;
|
|
86
|
-
nodeId: z.ZodOptional<z.ZodString>;
|
|
87
|
-
details: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
88
|
-
}, "strip", z.ZodTypeAny, {
|
|
89
|
-
code: string;
|
|
90
|
-
message: string;
|
|
91
|
-
nodeId?: string | undefined;
|
|
92
|
-
details?: Record<string, unknown> | undefined;
|
|
93
|
-
}, {
|
|
94
|
-
code: string;
|
|
95
|
-
message: string;
|
|
96
|
-
nodeId?: string | undefined;
|
|
97
|
-
details?: Record<string, unknown> | undefined;
|
|
98
|
-
}>, "many">>;
|
|
99
|
-
}, "strip", z.ZodTypeAny, {
|
|
100
|
-
ok: boolean;
|
|
101
|
-
errors: {
|
|
102
|
-
code: string;
|
|
103
|
-
message: string;
|
|
104
|
-
nodeId?: string | undefined;
|
|
105
|
-
details?: Record<string, unknown> | undefined;
|
|
106
|
-
}[];
|
|
107
|
-
}, {
|
|
108
|
-
ok: boolean;
|
|
109
|
-
errors?: {
|
|
110
|
-
code: string;
|
|
111
|
-
message: string;
|
|
112
|
-
nodeId?: string | undefined;
|
|
113
|
-
details?: Record<string, unknown> | undefined;
|
|
114
|
-
}[] | undefined;
|
|
115
|
-
}>;
|
|
116
|
-
type ValidationResult = z.infer<typeof ValidationResultSchema>;
|
|
117
|
-
declare const BuilderState: {
|
|
118
|
-
readonly IDLE: "IDLE";
|
|
119
|
-
readonly DRAFT: "DRAFT";
|
|
120
|
-
readonly VALIDATED: "VALIDATED";
|
|
121
|
-
readonly COMMITTED: "COMMITTED";
|
|
122
|
-
readonly ABORTED: "ABORTED";
|
|
123
|
-
};
|
|
124
|
-
type BuilderStateType = (typeof BuilderState)[keyof typeof BuilderState];
|
|
125
|
-
declare const BuilderSessionSchema: z.ZodObject<{
|
|
126
|
-
id: z.ZodString;
|
|
127
|
-
version: z.ZodDefault<z.ZodNumber>;
|
|
128
|
-
state: z.ZodEnum<["IDLE", "DRAFT", "VALIDATED", "COMMITTED", "ABORTED"]>;
|
|
129
|
-
createdAt: z.ZodString;
|
|
130
|
-
updatedAt: z.ZodString;
|
|
131
|
-
workflowDraft: z.ZodObject<{
|
|
132
|
-
name: z.ZodString;
|
|
133
|
-
description: z.ZodOptional<z.ZodString>;
|
|
134
|
-
nodes: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
135
|
-
id: z.ZodString;
|
|
136
|
-
type: z.ZodString;
|
|
137
|
-
input: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
138
|
-
dependsOn: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
139
|
-
}, "strip", z.ZodTypeAny, {
|
|
140
|
-
id: string;
|
|
141
|
-
type: string;
|
|
142
|
-
dependsOn: string[];
|
|
143
|
-
input: Record<string, unknown>;
|
|
144
|
-
}, {
|
|
145
|
-
id: string;
|
|
146
|
-
type: string;
|
|
147
|
-
dependsOn?: string[] | undefined;
|
|
148
|
-
input?: Record<string, unknown> | undefined;
|
|
149
|
-
}>, "many">>;
|
|
150
|
-
metadata: z.ZodOptional<z.ZodObject<{
|
|
151
|
-
tags: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
152
|
-
owner: z.ZodOptional<z.ZodString>;
|
|
153
|
-
}, "strip", z.ZodTypeAny, {
|
|
154
|
-
tags?: string[] | undefined;
|
|
155
|
-
owner?: string | undefined;
|
|
156
|
-
}, {
|
|
157
|
-
tags?: string[] | undefined;
|
|
158
|
-
owner?: string | undefined;
|
|
159
|
-
}>>;
|
|
160
|
-
}, "strip", z.ZodTypeAny, {
|
|
161
|
-
nodes: {
|
|
162
|
-
id: string;
|
|
163
|
-
type: string;
|
|
164
|
-
dependsOn: string[];
|
|
165
|
-
input: Record<string, unknown>;
|
|
166
|
-
}[];
|
|
167
|
-
name: string;
|
|
168
|
-
description?: string | undefined;
|
|
169
|
-
metadata?: {
|
|
170
|
-
tags?: string[] | undefined;
|
|
171
|
-
owner?: string | undefined;
|
|
172
|
-
} | undefined;
|
|
173
|
-
}, {
|
|
174
|
-
name: string;
|
|
175
|
-
nodes?: {
|
|
176
|
-
id: string;
|
|
177
|
-
type: string;
|
|
178
|
-
dependsOn?: string[] | undefined;
|
|
179
|
-
input?: Record<string, unknown> | undefined;
|
|
180
|
-
}[] | undefined;
|
|
181
|
-
description?: string | undefined;
|
|
182
|
-
metadata?: {
|
|
183
|
-
tags?: string[] | undefined;
|
|
184
|
-
owner?: string | undefined;
|
|
185
|
-
} | undefined;
|
|
186
|
-
}>;
|
|
187
|
-
validation: z.ZodDefault<z.ZodObject<{
|
|
188
|
-
ok: z.ZodBoolean;
|
|
189
|
-
errors: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
190
|
-
code: z.ZodString;
|
|
191
|
-
message: z.ZodString;
|
|
192
|
-
nodeId: z.ZodOptional<z.ZodString>;
|
|
193
|
-
details: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
194
|
-
}, "strip", z.ZodTypeAny, {
|
|
195
|
-
code: string;
|
|
196
|
-
message: string;
|
|
197
|
-
nodeId?: string | undefined;
|
|
198
|
-
details?: Record<string, unknown> | undefined;
|
|
199
|
-
}, {
|
|
200
|
-
code: string;
|
|
201
|
-
message: string;
|
|
202
|
-
nodeId?: string | undefined;
|
|
203
|
-
details?: Record<string, unknown> | undefined;
|
|
204
|
-
}>, "many">>;
|
|
205
|
-
}, "strip", z.ZodTypeAny, {
|
|
206
|
-
ok: boolean;
|
|
207
|
-
errors: {
|
|
208
|
-
code: string;
|
|
209
|
-
message: string;
|
|
210
|
-
nodeId?: string | undefined;
|
|
211
|
-
details?: Record<string, unknown> | undefined;
|
|
212
|
-
}[];
|
|
213
|
-
}, {
|
|
214
|
-
ok: boolean;
|
|
215
|
-
errors?: {
|
|
216
|
-
code: string;
|
|
217
|
-
message: string;
|
|
218
|
-
nodeId?: string | undefined;
|
|
219
|
-
details?: Record<string, unknown> | undefined;
|
|
220
|
-
}[] | undefined;
|
|
221
|
-
}>>;
|
|
222
|
-
commit: z.ZodOptional<z.ZodObject<{
|
|
223
|
-
workflowId: z.ZodOptional<z.ZodString>;
|
|
224
|
-
committedAt: z.ZodOptional<z.ZodString>;
|
|
225
|
-
}, "strip", z.ZodTypeAny, {
|
|
226
|
-
workflowId?: string | undefined;
|
|
227
|
-
committedAt?: string | undefined;
|
|
228
|
-
}, {
|
|
229
|
-
workflowId?: string | undefined;
|
|
230
|
-
committedAt?: string | undefined;
|
|
231
|
-
}>>;
|
|
232
|
-
}, "strip", z.ZodTypeAny, {
|
|
233
|
-
id: string;
|
|
234
|
-
updatedAt: string;
|
|
235
|
-
version: number;
|
|
236
|
-
createdAt: string;
|
|
237
|
-
validation: {
|
|
238
|
-
ok: boolean;
|
|
239
|
-
errors: {
|
|
240
|
-
code: string;
|
|
241
|
-
message: string;
|
|
242
|
-
nodeId?: string | undefined;
|
|
243
|
-
details?: Record<string, unknown> | undefined;
|
|
244
|
-
}[];
|
|
245
|
-
};
|
|
246
|
-
state: "IDLE" | "DRAFT" | "VALIDATED" | "COMMITTED" | "ABORTED";
|
|
247
|
-
workflowDraft: {
|
|
248
|
-
nodes: {
|
|
249
|
-
id: string;
|
|
250
|
-
type: string;
|
|
251
|
-
dependsOn: string[];
|
|
252
|
-
input: Record<string, unknown>;
|
|
253
|
-
}[];
|
|
254
|
-
name: string;
|
|
255
|
-
description?: string | undefined;
|
|
256
|
-
metadata?: {
|
|
257
|
-
tags?: string[] | undefined;
|
|
258
|
-
owner?: string | undefined;
|
|
259
|
-
} | undefined;
|
|
260
|
-
};
|
|
261
|
-
commit?: {
|
|
262
|
-
workflowId?: string | undefined;
|
|
263
|
-
committedAt?: string | undefined;
|
|
264
|
-
} | undefined;
|
|
265
|
-
}, {
|
|
266
|
-
id: string;
|
|
267
|
-
updatedAt: string;
|
|
268
|
-
createdAt: string;
|
|
269
|
-
state: "IDLE" | "DRAFT" | "VALIDATED" | "COMMITTED" | "ABORTED";
|
|
270
|
-
workflowDraft: {
|
|
271
|
-
name: string;
|
|
272
|
-
nodes?: {
|
|
273
|
-
id: string;
|
|
274
|
-
type: string;
|
|
275
|
-
dependsOn?: string[] | undefined;
|
|
276
|
-
input?: Record<string, unknown> | undefined;
|
|
277
|
-
}[] | undefined;
|
|
278
|
-
description?: string | undefined;
|
|
279
|
-
metadata?: {
|
|
280
|
-
tags?: string[] | undefined;
|
|
281
|
-
owner?: string | undefined;
|
|
282
|
-
} | undefined;
|
|
283
|
-
};
|
|
284
|
-
commit?: {
|
|
285
|
-
workflowId?: string | undefined;
|
|
286
|
-
committedAt?: string | undefined;
|
|
287
|
-
} | undefined;
|
|
288
|
-
version?: number | undefined;
|
|
289
|
-
validation?: {
|
|
290
|
-
ok: boolean;
|
|
291
|
-
errors?: {
|
|
292
|
-
code: string;
|
|
293
|
-
message: string;
|
|
294
|
-
nodeId?: string | undefined;
|
|
295
|
-
details?: Record<string, unknown> | undefined;
|
|
296
|
-
}[] | undefined;
|
|
297
|
-
} | undefined;
|
|
298
|
-
}>;
|
|
299
|
-
type BuilderSession = z.infer<typeof BuilderSessionSchema>;
|
|
300
|
-
interface NodeDiff {
|
|
301
|
-
action: 'add' | 'update' | 'remove';
|
|
302
|
-
nodeId: string;
|
|
303
|
-
before?: WorkflowNode;
|
|
304
|
-
after?: WorkflowNode;
|
|
305
|
-
}
|
|
306
|
-
interface ConnectionDiff {
|
|
307
|
-
action: 'connect' | 'disconnect';
|
|
308
|
-
from: string;
|
|
309
|
-
to: string;
|
|
310
|
-
}
|
|
311
|
-
type Diff = NodeDiff | ConnectionDiff;
|
|
312
|
-
|
|
313
3
|
/**
|
|
314
4
|
* Unified output helpers for CLI commands.
|
|
315
5
|
* Supports multiple output formats: json, pretty, compact, plain.
|
|
@@ -382,69 +72,10 @@ declare class CLIError extends Error {
|
|
|
382
72
|
declare class AuthError extends CLIError {
|
|
383
73
|
constructor(message: string, hint?: string);
|
|
384
74
|
}
|
|
385
|
-
declare class BuilderError extends CLIError {
|
|
386
|
-
}
|
|
387
75
|
declare class ValidationError extends CLIError {
|
|
388
76
|
constructor(message: string, details?: Record<string, unknown>);
|
|
389
77
|
}
|
|
390
78
|
|
|
391
|
-
/**
|
|
392
|
-
* Builder session persistence with atomic writes
|
|
393
|
-
*/
|
|
394
|
-
|
|
395
|
-
/**
|
|
396
|
-
* Create a new builder session
|
|
397
|
-
*/
|
|
398
|
-
declare function createSession(name: string, description?: string): BuilderSession;
|
|
399
|
-
/**
|
|
400
|
-
* Save session to disk atomically
|
|
401
|
-
*/
|
|
402
|
-
declare function saveSession(session: BuilderSession): void;
|
|
403
|
-
/**
|
|
404
|
-
* Load session from disk
|
|
405
|
-
*/
|
|
406
|
-
declare function loadSession(sessionId: string): BuilderSession | null;
|
|
407
|
-
/**
|
|
408
|
-
* Get current session (convenience function)
|
|
409
|
-
*/
|
|
410
|
-
declare function getCurrentSession(): BuilderSession | null;
|
|
411
|
-
|
|
412
|
-
/**
|
|
413
|
-
* DAG validation for workflow drafts
|
|
414
|
-
*/
|
|
415
|
-
|
|
416
|
-
/**
|
|
417
|
-
* Validate a workflow draft
|
|
418
|
-
*/
|
|
419
|
-
declare function validateDraft(session: BuilderSession): ValidationResult;
|
|
420
|
-
|
|
421
|
-
/**
|
|
422
|
-
* Graph utilities for visualizing workflow DAG
|
|
423
|
-
*/
|
|
424
|
-
|
|
425
|
-
interface Edge {
|
|
426
|
-
from: string;
|
|
427
|
-
to: string;
|
|
428
|
-
}
|
|
429
|
-
interface GraphOutput {
|
|
430
|
-
nodes: Array<{
|
|
431
|
-
id: string;
|
|
432
|
-
type: string;
|
|
433
|
-
dependsOn: string[];
|
|
434
|
-
}>;
|
|
435
|
-
edges: Edge[];
|
|
436
|
-
stats: {
|
|
437
|
-
nodeCount: number;
|
|
438
|
-
edgeCount: number;
|
|
439
|
-
rootNodes: string[];
|
|
440
|
-
leafNodes: string[];
|
|
441
|
-
};
|
|
442
|
-
}
|
|
443
|
-
/**
|
|
444
|
-
* Generate graph representation of the workflow
|
|
445
|
-
*/
|
|
446
|
-
declare function generateGraph(session: BuilderSession): GraphOutput;
|
|
447
|
-
|
|
448
79
|
/**
|
|
449
80
|
* Configuration management with atomic writes and secure permissions.
|
|
450
81
|
*/
|
|
@@ -635,4 +266,4 @@ declare function isSkillInstalled(): {
|
|
|
635
266
|
currentVersion?: string;
|
|
636
267
|
};
|
|
637
268
|
|
|
638
|
-
export { AuthError,
|
|
269
|
+
export { AuthError, CLIError, type CLIResponse, ErrorCodes, type ErrorDetail, type ErrorResponse, type SuccessResponse, ValidationError, apiRequest, getApiEndpoint, installSkill, isAuthenticated, isSkillInstalled, loadConfig, saveConfig, verifyConnection };
|