@flowweave-ai/cli 0.2.0 → 0.3.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 +3 -1
- package/bin/flowweave.mjs +44 -4
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -21,7 +21,9 @@ flowweave health --ready
|
|
|
21
21
|
|
|
22
22
|
读取 FlowRun 中的记录使用 `flowweave run node <run-id> --node <node-run-id>`;只有用户明确要求时才能执行 `node-copy` 或 `node-delete`。暂停或恢复 Runtime 前,必须先读取 `run runtime`,将返回的 `generation` 与 session `row_version` 写入 `expected_generation`、`expected_session_row_version` 后传给 `run pause` 或 `run resume`。供应商上游余额/用量使用 `flowweave model usage <provider-id>`,它可能依赖该供应商的有效 API 凭据。
|
|
23
23
|
|
|
24
|
-
周期任务使用 `schedule list/create/pause/resume/trigger/delete
|
|
24
|
+
周期任务使用 `schedule list/templates/occurrences/create/pause/resume/trigger/delete`。先用 `schedule templates` 读取可作为冻结母版的已就绪连续运行记录;创建请求必须使用在线 `FlowRunScheduleWrite` schema:只提交任务名称、母版 `source_flow_run_id` 和五段 `cron_expression`,节点、环境、输入和启动提示词均来自该记录的冻结母版。`schedule occurrences <schedule-id> --page 1 --page-size 10` 按需读取该调度的执行历史及其 FlowRun/NodeRun,而不预加载所有记录。暂停或恢复前从 `schedule list` 读取当前 `row_version`,再传入 `--expected-row-version`。手动触发会新增一次 occurrence,不会改写既有运行;删除生成的 FlowRun 不会删除调度,而有生成记录的调度删除会被平台拒绝。
|
|
25
|
+
|
|
26
|
+
能力命令还支持受治理的 OpenHands Plugin Marketplace:`capability marketplace` 读取服务端固定到完整 commit 的公开目录;使用返回的 `source`、`commit`、`repo_path` 与插件名称调用 `capability marketplace-resolve --data-file ./marketplace-plugin.json`,随后读取 `capability plugin-resolution <resolution-id>`,并以当前 `state_version` 调用 `capability plugin-publish <resolution-id> --data '{"expected_state_version": 1}'`。自定义受信任 Marketplace 可先用 `capability marketplace-preview --data-file ./marketplace.json` 审阅目录。Agent Definition 只能以 UTF-8 `.md`/`.markdown` 的 OpenHands YAML frontmatter + Markdown 正文通过 `capability validate|import --type AGENT_DEFINITION --file <file>` 导入;Hook 已下线,新的 `--type HOOK` 导入会被明确拒绝。
|
|
25
27
|
|
|
26
28
|
`api`、`upload`、`ws` 是完整契约入口:任意当前或未来的 REST、multipart、WebSocket 原子接口均可直接调用,不需要等待 CLI 发布。三者都会使用当前 `auth login` 会话;不得用 `--header` 手工传 Cookie。写操作支持 `--dry-run`,并可使用 `-H 'Idempotency-Key: …'` 传入一次性幂等键。对于没有快捷命令的新接口,先运行 `flowweave openapi --paths`,再通过通用命令调用。
|
|
27
29
|
|
package/bin/flowweave.mjs
CHANGED
|
@@ -32,12 +32,12 @@ function usage() {
|
|
|
32
32
|
页面域原子操作:
|
|
33
33
|
node <list|get|create|update|delete> [ID] [--data JSON|--data-file FILE]
|
|
34
34
|
node-directory <list|create|delete|delete-many> [ID] [--id ID ...]
|
|
35
|
-
capability <list|validate|commit|import> ...
|
|
35
|
+
capability <list|validate|commit|import|marketplace|marketplace-preview|marketplace-resolve|plugin-resolution|plugin-publish> ...
|
|
36
36
|
environment <list|get|create|update|delete|setup|publish|stop|version-delete> ...
|
|
37
37
|
credential <list|create|update|delete|delete-many> ...
|
|
38
38
|
flow <list|get|create|update|validate|delete> ...
|
|
39
39
|
run <list|get|start|delete|runtime|replace|pause|resume|cancel|complete|events|node|node-copy|node-delete|workspace-delete|work-directory-delete> ...
|
|
40
|
-
schedule <list|create|pause|resume|trigger|delete> ...
|
|
40
|
+
schedule <list|templates|occurrences|create|pause|resume|trigger|delete> ...
|
|
41
41
|
model <list|create|update|delete|discover|usage|test|oauth-start|oauth-poll|oauth-status|oauth-revoke> ...
|
|
42
42
|
agent <default|workspace|runtime|conversations|conversation|create|send|interrupt|resume|work-directories|work-directory-create|work-directory-delete|file-delete> ...
|
|
43
43
|
|
|
@@ -334,6 +334,26 @@ async function nodeDirectory(args) {
|
|
|
334
334
|
async function capability(args) {
|
|
335
335
|
const [action, id] = positional(args);
|
|
336
336
|
if (action === 'list') return request('GET', '/capabilities', args);
|
|
337
|
+
if (action === 'marketplace') {
|
|
338
|
+
if (id) throw new CliError('capability marketplace 不接受 ID');
|
|
339
|
+
return request('GET', '/plugin-marketplace-catalogs/openhands', args);
|
|
340
|
+
}
|
|
341
|
+
if (action === 'marketplace-preview') {
|
|
342
|
+
if (id) throw new CliError('capability marketplace-preview 不接受 ID');
|
|
343
|
+
return request('POST', '/plugin-marketplace-catalogs/preview', args);
|
|
344
|
+
}
|
|
345
|
+
if (action === 'marketplace-resolve') {
|
|
346
|
+
if (id) throw new CliError('capability marketplace-resolve 不接受 ID');
|
|
347
|
+
return request('POST', '/plugin-source-resolutions/marketplace', args);
|
|
348
|
+
}
|
|
349
|
+
if (action === 'plugin-resolution') {
|
|
350
|
+
if (!id) throw new CliError('capability plugin-resolution 需要 resolution ID');
|
|
351
|
+
return request('GET', `/plugin-source-resolutions/${id}`, args);
|
|
352
|
+
}
|
|
353
|
+
if (action === 'plugin-publish') {
|
|
354
|
+
if (!id) throw new CliError('capability plugin-publish 需要 resolution ID');
|
|
355
|
+
return request('POST', `/plugin-source-resolutions/${id}/publish`, args);
|
|
356
|
+
}
|
|
337
357
|
if (action === 'validate' || action === 'import') {
|
|
338
358
|
const type = option(args, '--type');
|
|
339
359
|
const source = option(args, '--file');
|
|
@@ -350,7 +370,7 @@ async function capability(args) {
|
|
|
350
370
|
if (!token) throw new CliError('capability commit 需要 --import-token');
|
|
351
371
|
return request('POST', '/capability-imports', args, { body: { import_token: token } });
|
|
352
372
|
}
|
|
353
|
-
throw new CliError('capability 支持 list|validate|commit|import');
|
|
373
|
+
throw new CliError('capability 支持 list|validate|commit|import|marketplace|marketplace-preview|marketplace-resolve|plugin-resolution|plugin-publish');
|
|
354
374
|
}
|
|
355
375
|
|
|
356
376
|
async function environment(args) {
|
|
@@ -463,11 +483,31 @@ async function schedule(args) {
|
|
|
463
483
|
if (id) throw new CliError('schedule list 不接受 ID');
|
|
464
484
|
return request('GET', '/flow-run-schedules', args);
|
|
465
485
|
}
|
|
486
|
+
if (action === 'templates') {
|
|
487
|
+
if (id) throw new CliError('schedule templates 不接受 ID');
|
|
488
|
+
return request('GET', '/flow-run-schedule-templates', args);
|
|
489
|
+
}
|
|
466
490
|
if (action === 'create') {
|
|
467
491
|
if (id) throw new CliError('schedule create 不接受 ID');
|
|
468
492
|
return request('POST', '/flow-run-schedules', args);
|
|
469
493
|
}
|
|
470
494
|
if (!id) throw new CliError(`schedule ${action || ''} 需要调度 ID`);
|
|
495
|
+
if (action === 'occurrences') {
|
|
496
|
+
const page = option(args, '--page');
|
|
497
|
+
const pageSize = option(args, '--page-size');
|
|
498
|
+
const query = [];
|
|
499
|
+
if (page !== undefined) {
|
|
500
|
+
const value = Number(page);
|
|
501
|
+
if (!Number.isSafeInteger(value) || value < 1) throw new CliError('schedule occurrences 的 --page 必须为正整数');
|
|
502
|
+
query.push(['page', String(value)]);
|
|
503
|
+
}
|
|
504
|
+
if (pageSize !== undefined) {
|
|
505
|
+
const value = Number(pageSize);
|
|
506
|
+
if (!Number.isSafeInteger(value) || value < 1 || value > 100) throw new CliError('schedule occurrences 的 --page-size 必须为 1 到 100 的整数');
|
|
507
|
+
query.push(['page_size', String(value)]);
|
|
508
|
+
}
|
|
509
|
+
return request('GET', `/flow-run-schedules/${id}/occurrences`, args, { query });
|
|
510
|
+
}
|
|
471
511
|
if (action === 'pause' || action === 'resume') {
|
|
472
512
|
const expected = Number(option(args, '--expected-row-version'));
|
|
473
513
|
if (!Number.isSafeInteger(expected) || expected < 1) {
|
|
@@ -479,7 +519,7 @@ async function schedule(args) {
|
|
|
479
519
|
}
|
|
480
520
|
if (action === 'trigger') return request('POST', `/flow-run-schedules/${id}/trigger`, args, { body: {} });
|
|
481
521
|
if (action === 'delete') return request('DELETE', `/flow-run-schedules/${id}`, args);
|
|
482
|
-
throw new CliError('schedule 支持 list|create|pause|resume|trigger|delete');
|
|
522
|
+
throw new CliError('schedule 支持 list|templates|occurrences|create|pause|resume|trigger|delete');
|
|
483
523
|
}
|
|
484
524
|
|
|
485
525
|
async function model(args) {
|