@workflow-code/cli 0.2.4-20260911001 → 0.2.4-20260913001

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.
@@ -4,7 +4,7 @@ import {
4
4
  initI18n,
5
5
  isSupportedLocale,
6
6
  normalizeLocale
7
- } from "./chunk-3OIX42UB.js";
7
+ } from "./chunk-VVM2HB7H.js";
8
8
 
9
9
  // src/locale.ts
10
10
  import { WORKFLOW_RUNTIME_LOCALE_ENV } from "workflow-code";
@@ -2342,6 +2342,12 @@ var common = {
2342
2342
  retryRun: "Retry run",
2343
2343
  messageErrorEmpty: "The run failed and returned no displayable content. Open the logs for details.",
2344
2344
  copyRunOutput: "Copy run output",
2345
+ exportRun: "Export",
2346
+ exportRunOutput: "Export run data",
2347
+ exportRunConversation: "Export conversation",
2348
+ exportingRun: "Exporting",
2349
+ recentTaskActions: "Task actions",
2350
+ exportLatestScheduleRun: "Export latest run",
2345
2351
  runInterruptedFallback: "The run was interrupted before its final result could be saved.",
2346
2352
  runExecutionFailedFallback: "Workflow execution failed.",
2347
2353
  defaultConversation: "Default conversation",
@@ -4667,7 +4673,15 @@ var desktop = {
4667
4673
  projectGroupReferencesMissing: "The root project was saved; {{count}} referenced projects are still missing",
4668
4674
  projectGroupReferencesMissing_one: "The root project was saved; 1 referenced project is still missing",
4669
4675
  projectGroupReferencesMissing_other: "The root project was saved; {{count}} referenced projects are still missing",
4670
- scheduleFallbackName: "Schedule"
4676
+ scheduleFallbackName: "Schedule",
4677
+ exportRunSaveDialogTitle: "Export run data",
4678
+ exportConversationSaveDialogTitle: "Export conversation",
4679
+ exportRunSavedTitle: "Export complete",
4680
+ exportRunSavedDescription: "The run data was saved to the following file.",
4681
+ exportConversationSavedDescription: "The conversation was saved to the following file.",
4682
+ exportRunFailedTitle: "Export failed",
4683
+ exportRunMissingDescription: "The run or conversation is no longer available, so there is nothing to export.",
4684
+ exportRunTooLarge: "This run is too large to export as a single file. Open Logs to inspect it instead."
4671
4685
  };
4672
4686
 
4673
4687
  // .shared/i18n/resources/en/server-web.ts
@@ -7217,6 +7231,12 @@ var common2 = {
7217
7231
  retryRun: "\u91CD\u8BD5\u8FD0\u884C",
7218
7232
  messageErrorEmpty: "\u8FD0\u884C\u5931\u8D25\uFF0C\u672A\u8FD4\u56DE\u53EF\u5C55\u793A\u5185\u5BB9\u3002\u8BF7\u6253\u5F00\u65E5\u5FD7\u67E5\u770B\u8BE6\u7EC6\u9519\u8BEF\u3002",
7219
7233
  copyRunOutput: "\u590D\u5236\u8FD0\u884C\u8F93\u51FA",
7234
+ exportRun: "\u5BFC\u51FA",
7235
+ exportRunOutput: "\u5BFC\u51FA\u8FD0\u884C\u6570\u636E",
7236
+ exportRunConversation: "\u5BFC\u51FA\u5BF9\u8BDD",
7237
+ exportingRun: "\u6B63\u5728\u5BFC\u51FA",
7238
+ recentTaskActions: "\u4EFB\u52A1\u64CD\u4F5C",
7239
+ exportLatestScheduleRun: "\u5BFC\u51FA\u6700\u8FD1\u4E00\u6B21\u8FD0\u884C",
7220
7240
  runInterruptedFallback: "\u8FD0\u884C\u5728\u4FDD\u5B58\u6700\u7EC8\u7ED3\u679C\u524D\u4E2D\u65AD\u3002",
7221
7241
  runExecutionFailedFallback: "Workflow \u6267\u884C\u5931\u8D25\u3002",
7222
7242
  defaultConversation: "\u9ED8\u8BA4\u8BDD\u9898",
@@ -9542,7 +9562,15 @@ var desktop2 = {
9542
9562
  projectGroupReferencesMissing: "\u6839\u9879\u76EE\u5DF2\u4FDD\u5B58\uFF0C\u4ECD\u7F3A\u5C11 {{count}} \u4E2A\u5F15\u7528\u9879\u76EE",
9543
9563
  projectGroupReferencesMissing_one: "\u6839\u9879\u76EE\u5DF2\u4FDD\u5B58\uFF0C\u4ECD\u7F3A\u5C11 {{count}} \u4E2A\u5F15\u7528\u9879\u76EE",
9544
9564
  projectGroupReferencesMissing_other: "\u6839\u9879\u76EE\u5DF2\u4FDD\u5B58\uFF0C\u4ECD\u7F3A\u5C11 {{count}} \u4E2A\u5F15\u7528\u9879\u76EE",
9545
- scheduleFallbackName: "\u5B9A\u65F6\u4EFB\u52A1"
9565
+ scheduleFallbackName: "\u5B9A\u65F6\u4EFB\u52A1",
9566
+ exportRunSaveDialogTitle: "\u5BFC\u51FA\u8FD0\u884C\u8BB0\u5F55",
9567
+ exportConversationSaveDialogTitle: "\u5BFC\u51FA\u5BF9\u8BDD\u8BB0\u5F55",
9568
+ exportRunSavedTitle: "\u5BFC\u51FA\u5B8C\u6210",
9569
+ exportRunSavedDescription: "\u8FD0\u884C\u6570\u636E\u5DF2\u4FDD\u5B58\u5230\u4EE5\u4E0B\u6587\u4EF6\u3002",
9570
+ exportConversationSavedDescription: "\u5BF9\u8BDD\u8BB0\u5F55\u5DF2\u4FDD\u5B58\u5230\u4EE5\u4E0B\u6587\u4EF6\u3002",
9571
+ exportRunFailedTitle: "\u5BFC\u51FA\u5931\u8D25",
9572
+ exportRunMissingDescription: "\u8BE5\u6B21\u8FD0\u884C\u6216\u5BF9\u8BDD\u5DF2\u4E0D\u5B58\u5728\uFF0C\u6CA1\u6709\u53EF\u5BFC\u51FA\u7684\u5185\u5BB9\u3002",
9573
+ exportRunTooLarge: "\u8BE5\u6B21\u8FD0\u884C\u5185\u5BB9\u8FC7\u5927\uFF0C\u65E0\u6CD5\u5BFC\u51FA\u4E3A\u5355\u4E2A\u6587\u4EF6\u3002\u8BF7\u6539\u7528 Logs \u67E5\u770B\u3002"
9546
9574
  };
9547
9575
 
9548
9576
  // .shared/i18n/resources/zh/server-web.ts
package/dist/index.js CHANGED
@@ -1,11 +1,11 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  prepareCliInvocation
4
- } from "./chunk-Z5ONGKG4.js";
4
+ } from "./chunk-JFKLYN5N.js";
5
5
  import {
6
6
  i18n,
7
7
  translateWorkflowCodeError
8
- } from "./chunk-3OIX42UB.js";
8
+ } from "./chunk-VVM2HB7H.js";
9
9
  import "./chunk-NSPRIPOP.js";
10
10
 
11
11
  // src/index.ts
@@ -23,12 +23,12 @@ async function main(argv = process.argv.slice(2)) {
23
23
  const prepared = prepareCliInvocation(argv);
24
24
  argv = prepared.argv;
25
25
  if (argv[0] === "workspace") {
26
- const workspaceCli = await import("./workspace-N66ZCO3W.js");
26
+ const workspaceCli = await import("./workspace-TSJW4LXW.js");
27
27
  await workspaceCli.main(argv.slice(1), { localeInitialized: true });
28
28
  return typeof process.exitCode === "number" ? process.exitCode : 0;
29
29
  }
30
30
  if (argv[0] === "mcp") {
31
- const mcpCli = await import("./mcp-TIZ36XZO.js");
31
+ const mcpCli = await import("./mcp-2FQRHZMR.js");
32
32
  return mcpCli.main(argv.slice(1));
33
33
  }
34
34
  if (argv.length === 0 || argv[0] === "help" || argv[0] === "--help" || argv[0] === "-h") {
@@ -38,7 +38,7 @@ async function main(argv = process.argv.slice(2)) {
38
38
  }
39
39
  const { register } = await import("tsx/esm/api");
40
40
  register();
41
- const localCli = await import("./local-WYFLDGRV.js");
41
+ const localCli = await import("./local-LLZVKUQW.js");
42
42
  return localCli.main(argv, { localeInitialized: true });
43
43
  }
44
44
  function formatHelp() {
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  prepareCliInvocation
4
- } from "./chunk-Z5ONGKG4.js";
4
+ } from "./chunk-JFKLYN5N.js";
5
5
  import {
6
6
  createCliRelatedProjectRuntime,
7
7
  parseCliRelatedProjectSpec
@@ -12,7 +12,7 @@ import {
12
12
  import {
13
13
  i18n,
14
14
  translateWorkflowCodeError
15
- } from "./chunk-3OIX42UB.js";
15
+ } from "./chunk-VVM2HB7H.js";
16
16
  import {
17
17
  __commonJS,
18
18
  __toESM
@@ -13,7 +13,7 @@ import {
13
13
  } from "./chunk-27OW6OJ3.js";
14
14
  import {
15
15
  i18n
16
- } from "./chunk-3OIX42UB.js";
16
+ } from "./chunk-VVM2HB7H.js";
17
17
  import {
18
18
  __commonJS,
19
19
  __export,
@@ -8,7 +8,7 @@ import {
8
8
  } from "./chunk-PGM3IPWA.js";
9
9
  import {
10
10
  prepareCliInvocation
11
- } from "./chunk-Z5ONGKG4.js";
11
+ } from "./chunk-JFKLYN5N.js";
12
12
  import {
13
13
  isWorkflowUuid,
14
14
  readWorkflowProjectInfo,
@@ -18,7 +18,7 @@ import {
18
18
  getCurrentLocale,
19
19
  i18n,
20
20
  translateWorkflowCodeError
21
- } from "./chunk-3OIX42UB.js";
21
+ } from "./chunk-VVM2HB7H.js";
22
22
  import {
23
23
  __commonJS,
24
24
  __toESM
@@ -1309,13 +1309,23 @@ async function commandProjectGroupUpload(parsed, workflowArg, forcePublish = fal
1309
1309
  assertApiOk(planned);
1310
1310
  return;
1311
1311
  }
1312
- const prepared = await uploadProjectGroupPackage({
1312
+ const queued = await uploadProjectGroupPackage({
1313
1313
  deploymentId: planned.data.id,
1314
1314
  archivePath: packed.archivePath,
1315
1315
  server: parsed.options.server,
1316
1316
  token: parsed.options.token,
1317
1317
  executionTargets: resolveRequestedExecutionTargets(parsed.options, rootContext.projectType)
1318
1318
  });
1319
+ if (queued.errCode !== 0 || queued.data === void 0) {
1320
+ printApiResponse(queued);
1321
+ assertApiOk(queued);
1322
+ return;
1323
+ }
1324
+ const prepared = await waitForProjectGroupPreparation({
1325
+ deploymentId: planned.data.id,
1326
+ server: parsed.options.server,
1327
+ token: parsed.options.token
1328
+ });
1319
1329
  if (prepared.errCode !== 0 || prepared.data === void 0) {
1320
1330
  printApiResponse(prepared);
1321
1331
  assertApiOk(prepared);
@@ -1903,7 +1913,8 @@ async function packProjectGroup(options) {
1903
1913
  const projects = [{
1904
1914
  projectId: contexts.root.workflowId,
1905
1915
  role: "root",
1906
- archivePath: rootArchivePath
1916
+ archivePath: rootArchivePath,
1917
+ version: readWorkflowPackageVersion(contexts.root.packageJson)
1907
1918
  }];
1908
1919
  try {
1909
1920
  await packWorkflow(
@@ -1918,7 +1929,8 @@ async function packProjectGroup(options) {
1918
1929
  projectId: dependency.packageContext.workflowId,
1919
1930
  role: "dependency",
1920
1931
  archivePath: dependencyArchivePath,
1921
- alias: dependency.alias
1932
+ alias: dependency.alias,
1933
+ version: readWorkflowPackageVersion(dependency.packageContext.packageJson)
1922
1934
  });
1923
1935
  await packWorkflow(
1924
1936
  dependency.packageContext.workflowArg,
@@ -1976,6 +1988,39 @@ async function uploadProjectGroupPackage(options) {
1976
1988
  );
1977
1989
  return response.json();
1978
1990
  }
1991
+ async function waitForProjectGroupPreparation(options) {
1992
+ let previousProgress = "";
1993
+ while (true) {
1994
+ const response = await fetchApi({
1995
+ server: options.server,
1996
+ token: options.token,
1997
+ path: `/api/deployments/${encodeURIComponent(options.deploymentId)}`
1998
+ });
1999
+ if (response.errCode !== 0 || response.data === void 0) return response;
2000
+ const activeItem = response.data.items?.find((item) => item.status === "preparing");
2001
+ const progress = `${response.data.status}:${activeItem?.stage ?? response.data.status}`;
2002
+ if (response.data.status === "preparing" && progress !== previousProgress) {
2003
+ previousProgress = progress;
2004
+ process.stderr.write(`${i18n.t("preparationProgress", {
2005
+ ns: "cli",
2006
+ status: response.data.status,
2007
+ stage: activeItem?.stage ?? response.data.status
2008
+ })}
2009
+ `);
2010
+ }
2011
+ if (response.data.status === "prepared" || response.data.status === "published") {
2012
+ return response;
2013
+ }
2014
+ if (response.data.status === "failed") {
2015
+ return {
2016
+ errCode: 500,
2017
+ errMessage: response.data.error ?? response.data.items?.find((item) => item.error)?.error ?? "Project-group preparation failed.",
2018
+ data: response.data
2019
+ };
2020
+ }
2021
+ await delay(options.pollIntervalMs ?? 1e3);
2022
+ }
2023
+ }
1979
2024
  async function resolveRemoteWorkflowId(parsed) {
1980
2025
  const workflowArg = requirePositional(parsed, 0, "workflow");
1981
2026
  if (isWorkflowUuid(workflowArg)) {
@@ -2060,6 +2105,13 @@ function readRequiredPackageString(packageJson, key) {
2060
2105
  }
2061
2106
  return value.trim();
2062
2107
  }
2108
+ function readWorkflowPackageVersion(packageJson) {
2109
+ const version = readRequiredPackageString(packageJson, "version");
2110
+ if (!/^\d+\.\d+\.\d+$/.test(version)) {
2111
+ throw new Error(i18n.t("packageVersionInvalid", { ns: "cli", version }));
2112
+ }
2113
+ return version;
2114
+ }
2063
2115
  async function uploadPackage(options) {
2064
2116
  const archiveBuffer = await readFile2(options.archivePath);
2065
2117
  const archiveName = path3.basename(options.archivePath);
@@ -2585,5 +2637,6 @@ export {
2585
2637
  shouldUseProjectGroupUpload,
2586
2638
  stageWorkflowWithLocalDependencies,
2587
2639
  waitForDeviceToken,
2588
- waitForPreparation
2640
+ waitForPreparation,
2641
+ waitForProjectGroupPreparation
2589
2642
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@workflow-code/cli",
3
- "version": "0.2.4-20260911001",
3
+ "version": "0.2.4-20260913001",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "workflow-code": "./dist/index.js"
@@ -31,15 +31,15 @@
31
31
  "vitest": "^4.1.7",
32
32
  "workflow-code": "0.2.4-20260911001",
33
33
  "@workflow-code/auth-config": "0.1.0",
34
- "@workflow-code/i18n": "0.1.0",
35
34
  "@workflow-code/execution-targets": "0.1.0",
35
+ "@workflow-code/i18n": "0.1.0",
36
36
  "@workflow-code/openai-responses": "0.1.0",
37
37
  "@workflow-code/project-dependencies": "0.1.0",
38
+ "@workflow-code/project-info": "0.1.0",
38
39
  "@workflow-code/project-upload": "0.1.0",
39
40
  "@workflow-code/runtime-compatibility": "0.1.0",
40
- "@workflow-code/workflow-ids": "0.1.0",
41
41
  "@workflow-code/workflow-mcp": "0.1.0",
42
- "@workflow-code/project-info": "0.1.0"
42
+ "@workflow-code/workflow-ids": "0.1.0"
43
43
  },
44
44
  "scripts": {
45
45
  "bootstrap": "node scripts/bootstrap.mjs",