@flowweave-ai/cli 0.1.3 → 0.1.4

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 CHANGED
@@ -18,6 +18,8 @@ flowweave health --ready
18
18
 
19
19
  节点目录批量删除、Agent Workspace 文件树删除和 FlowRun 节点工作区删除都使用 JSON 数组请求体。重复传入 `--id` 或 `--path` 即可批量选择;先读取真实资源与路径,并用 `--dry-run` 核对 DELETE URL、范围 query 和请求体。FlowRun 工作目录删除使用 `flowweave run work-directory-delete <run-id> --attempt <attempt-id> --work-directory <directory-id>`。
20
20
 
21
+ 读取 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 凭据。
22
+
21
23
  `api`、`upload`、`ws` 是完整契约入口:任意当前或未来的 REST、multipart、WebSocket 原子接口均可直接调用,不需要等待 CLI 发布。`ws` 使用 Node 原生 WebSocket;当前公开 FlowWeave WebSocket 接口无需自定义请求头。写操作支持 `--dry-run`,并可使用 `-H 'Idempotency-Key: …'` 传入一次性幂等键。对于没有快捷命令的新接口,先运行 `flowweave openapi --paths`,再通过通用命令调用。
22
24
 
23
25
  安装页面域 skill:
package/bin/flowweave.mjs CHANGED
@@ -31,8 +31,8 @@ function usage() {
31
31
  environment <list|get|create|update|delete|setup|publish|stop|version-delete> ...
32
32
  credential <list|create|update|delete|delete-many> ...
33
33
  flow <list|get|create|update|validate|delete> ...
34
- run <list|get|start|delete|runtime|replace|cancel|complete|events|workspace-delete|work-directory-delete> ...
35
- model <list|create|update|delete|discover|test|oauth-start|oauth-poll|oauth-status|oauth-revoke> ...
34
+ run <list|get|start|delete|runtime|replace|pause|resume|cancel|complete|events|node|node-copy|node-delete|workspace-delete|work-directory-delete> ...
35
+ model <list|create|update|delete|discover|usage|test|oauth-start|oauth-poll|oauth-status|oauth-revoke> ...
36
36
  agent <default|workspace|runtime|conversations|conversation|create|send|interrupt|resume|work-directories|work-directory-create|work-directory-delete|file-delete> ...
37
37
 
38
38
  所有写入操作都可加 --dry-run 仅查看最终请求。运行 flowweave <命令> --help 查看该命令说明。`;
@@ -283,6 +283,14 @@ async function run(args) {
283
283
  return request('POST', `/flows/${flowId}/runs`, args, { body });
284
284
  }
285
285
  if (!id) throw new CliError(`run ${action || ''} 需要 FlowRun ID`);
286
+ if (action === 'node' || action === 'node-copy' || action === 'node-delete') {
287
+ const nodeRunId = option(args, '--node');
288
+ if (!nodeRunId) throw new CliError(`run ${action} 需要 --node <node-run-id>`);
289
+ const path = `/flow-runs/${id}/nodes/${nodeRunId}`;
290
+ if (action === 'node') return request('GET', path, args);
291
+ if (action === 'node-copy') return request('POST', `${path}/copy`, args, { body: await objectPayload(args) });
292
+ return request('DELETE', path, args);
293
+ }
286
294
  if (action === 'workspace-delete') {
287
295
  const attemptId = option(args, '--attempt');
288
296
  const paths = optionValues(args, '--path');
@@ -311,10 +319,17 @@ async function run(args) {
311
319
  if (action === 'delete') return request('DELETE', `/flow-runs/${id}`, args);
312
320
  if (action === 'runtime') return request('GET', `/flow-runs/${id}/runtime`, args);
313
321
  if (action === 'replace') return request('POST', `/flow-runs/${id}/runtime/replacements`, args);
322
+ if (action === 'pause' || action === 'resume') {
323
+ const body = await objectPayload(args);
324
+ if (!Number.isInteger(body.expected_generation) || !Number.isInteger(body.expected_session_row_version)) {
325
+ throw new CliError(`run ${action} 需要 --data 或 --data-file,且必须包含整数 expected_generation 和 expected_session_row_version`);
326
+ }
327
+ return request('POST', `/flow-runs/${id}/runtime/${action}`, args, { body });
328
+ }
314
329
  if (action === 'cancel') return request('POST', `/flow-runs/${id}/cancel`, args, { body: {} });
315
330
  if (action === 'complete') return request('POST', `/flow-runs/${id}/complete`, args, { body: {} });
316
331
  if (action === 'events') return request('GET', `/flow-runs/${id}/events`, args);
317
- throw new CliError('run 支持 list|get|start|delete|runtime|replace|cancel|complete|events|workspace-delete|work-directory-delete');
332
+ throw new CliError('run 支持 list|get|start|delete|runtime|replace|pause|resume|cancel|complete|events|node|node-copy|node-delete|workspace-delete|work-directory-delete');
318
333
  }
319
334
 
320
335
  async function model(args) {
@@ -327,6 +342,7 @@ async function model(args) {
327
342
  : request('POST', '/model-providers/discover-models', args);
328
343
  }
329
344
  if (!id) throw new CliError(`model ${action || ''} 需要模型供应商 ID`);
345
+ if (action === 'usage') return request('GET', `/model-providers/${id}/usage`, args);
330
346
  if (action === 'update') return request('PUT', `/model-providers/${id}`, args);
331
347
  if (action === 'delete') return request('DELETE', `/model-providers/${id}`, args);
332
348
  if (action === 'test') return request('POST', `/model-providers/${id}/test`, args);
@@ -334,7 +350,7 @@ async function model(args) {
334
350
  if (action === 'oauth-poll') return request('POST', `/model-providers/${id}/oauth/device/poll`, args, { body: await objectPayload(args) });
335
351
  if (action === 'oauth-status') return request('GET', `/model-providers/${id}/oauth/status`, args);
336
352
  if (action === 'oauth-revoke') return request('DELETE', `/model-providers/${id}/oauth`, args);
337
- throw new CliError('model 支持 list|create|update|delete|discover|test|oauth-start|oauth-poll|oauth-status|oauth-revoke');
353
+ throw new CliError('model 支持 list|create|update|delete|discover|usage|test|oauth-start|oauth-poll|oauth-status|oauth-revoke');
338
354
  }
339
355
 
340
356
  async function agent(args) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flowweave-ai/cli",
3
- "version": "0.1.3",
3
+ "version": "0.1.4",
4
4
  "description": "FlowWeave 平台命令行客户端",
5
5
  "type": "module",
6
6
  "bin": {