taskmeld 0.1.2 → 0.1.41

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.
Files changed (154) hide show
  1. package/README.md +176 -176
  2. package/README.zh-CN.md +176 -176
  3. package/dist/src/app/app-context-env.js +1 -1
  4. package/dist/src/app/create-app-context.js +3 -3
  5. package/dist/src/app/data-dir.js +13 -3
  6. package/dist/src/app/pipeline-config.js +4 -4
  7. package/dist/src/app/pipeline-registry.js +11 -11
  8. package/dist/src/app/pipeline-runtime.js +6 -9
  9. package/dist/src/app/runtime-store.js +3 -3
  10. package/dist/src/artifacts/artifact-cleanup.js +17 -17
  11. package/dist/src/artifacts/artifact-index.js +14 -14
  12. package/dist/src/artifacts/artifact-rebuilder.js +3 -3
  13. package/dist/src/artifacts/storage-service.js +18 -18
  14. package/dist/src/cli/bootstrap.js +7 -7
  15. package/dist/src/cli/commands/agent.js +12 -11
  16. package/dist/src/cli/commands/artifact.js +31 -30
  17. package/dist/src/cli/commands/init.js +49 -47
  18. package/dist/src/cli/commands/pipeline/result.js +9 -8
  19. package/dist/src/cli/commands/pipeline/selector.js +1 -1
  20. package/dist/src/cli/commands/pipeline/watch.js +2 -2
  21. package/dist/src/cli/commands/pipeline.js +54 -53
  22. package/dist/src/cli/commands/scheduler.js +9 -8
  23. package/dist/src/cli/commands/server.js +12 -11
  24. package/dist/src/cli/commands/system.js +4 -3
  25. package/dist/src/cli/errors.js +2 -2
  26. package/dist/src/cli/help.js +18 -17
  27. package/dist/src/cli/i18n.js +46 -0
  28. package/dist/src/cli/locales/en.json +244 -0
  29. package/dist/src/cli/locales/zh.json +244 -0
  30. package/dist/src/cli/output.js +3 -3
  31. package/dist/src/cli/renderers/engine/markdown.js +1 -1
  32. package/dist/src/cli/renderers/specs/index.js +1 -1
  33. package/dist/src/cli/router.js +1 -1
  34. package/dist/src/cli/server-runtime-client.js +54 -95
  35. package/dist/src/cli/ui-prompts.js +96 -0
  36. package/dist/src/cli/ws-runtime-client.js +51 -0
  37. package/dist/src/gateway/gateway-client.js +4 -4
  38. package/dist/src/index.js +28 -2
  39. package/dist/src/logs/run-log-reader.js +1 -1
  40. package/dist/src/pipeline/agent-activity.js +2 -2
  41. package/dist/src/pipeline/artifact-storage.js +11 -11
  42. package/dist/src/pipeline/diagnostics/dependency-diagnostic.js +11 -11
  43. package/dist/src/pipeline/dispatch/pipeline-inbound-queue.js +2 -2
  44. package/dist/src/pipeline/execution/group-item-executor.js +1 -1
  45. package/dist/src/pipeline/execution/node-item-executor.js +3 -3
  46. package/dist/src/pipeline/execution/node-runner.js +7 -7
  47. package/dist/src/pipeline/execution/readiness-state.js +1 -1
  48. package/dist/src/pipeline/execution/reject-handler.js +5 -5
  49. package/dist/src/pipeline/execution/rejected-artifact-archiver.js +1 -1
  50. package/dist/src/pipeline/execution/route-item-manager.js +4 -4
  51. package/dist/src/pipeline/execution/run-abort-controller.js +5 -5
  52. package/dist/src/pipeline/execution/run-state-helpers.js +2 -2
  53. package/dist/src/pipeline/execution/service.js +4 -4
  54. package/dist/src/pipeline/execution/structured-node-runner.js +24 -24
  55. package/dist/src/pipeline/execution-timeout.js +3 -3
  56. package/dist/src/pipeline/identity/index.js +3 -3
  57. package/dist/src/pipeline/item-batch-controller.js +6 -6
  58. package/dist/src/pipeline/scheduler/dependency-state.js +5 -5
  59. package/dist/src/pipeline/scheduler-service.js +24 -24
  60. package/dist/src/pipeline/state-machine.js +2 -2
  61. package/dist/src/pipeline/structured-output/contract.js +4 -4
  62. package/dist/src/pipeline/structured-output/index.js +2 -2
  63. package/dist/src/pipeline/structured-output/parser.js +5 -5
  64. package/dist/src/pipeline/structured-output/prompt.js +38 -38
  65. package/dist/src/pipeline/structured-output/waiter.js +6 -6
  66. package/dist/src/pipeline/template.js +5 -5
  67. package/dist/src/pipeline/timeline-log-store.js +5 -5
  68. package/dist/src/pipeline/tool-activity.js +3 -3
  69. package/dist/src/pipeline/types/pipeline-output.js +1 -1
  70. package/dist/src/pipeline/workflow/branch-rules.js +19 -19
  71. package/dist/src/pipeline/workflow/io.js +1 -1
  72. package/dist/src/pipeline/workflow/normalize.js +18 -18
  73. package/dist/src/pipeline/workflow/template-mapper.js +3 -3
  74. package/dist/src/pipeline/workflow/validate.js +39 -39
  75. package/dist/src/pipeline/workflow-graph.js +10 -10
  76. package/dist/src/server/http-handler.js +74 -0
  77. package/dist/src/services/agent-service.js +2 -2
  78. package/dist/src/services/gateway-read-helpers.js +1 -1
  79. package/dist/src/services/pipeline-service.js +19 -19
  80. package/dist/src/services/pipeline-status.js +4 -4
  81. package/dist/src/services/read-services.js +1 -1
  82. package/dist/src/services/session-service.js +6 -6
  83. package/dist/src/services/system-service.js +1 -1
  84. package/dist/src/transport/ws-broker.js +12 -1
  85. package/dist/src/transport/ws-handler.js +60 -0
  86. package/dist/src/transport/ws-methods/agents.js +144 -0
  87. package/dist/src/transport/ws-methods/artifacts.js +171 -0
  88. package/dist/src/transport/ws-methods/gateway.js +16 -0
  89. package/dist/src/transport/ws-methods/logs.js +43 -0
  90. package/dist/src/transport/ws-methods/pipeline-batch.js +68 -0
  91. package/dist/src/transport/ws-methods/pipeline-links.js +100 -0
  92. package/dist/src/transport/ws-methods/pipeline-queue.js +51 -0
  93. package/dist/src/transport/ws-methods/pipeline-runtime.js +151 -0
  94. package/dist/src/transport/ws-methods/pipeline-scheduler.js +48 -0
  95. package/dist/src/transport/ws-methods/pipeline-workflow.js +127 -0
  96. package/dist/src/transport/ws-methods/pipelines.js +56 -0
  97. package/dist/src/transport/ws-methods/register-all.js +32 -0
  98. package/dist/src/transport/ws-methods/sessions.js +154 -0
  99. package/dist/src/transport/ws-methods/timeline.js +10 -0
  100. package/dist/src/{server/routes/pipeline-identity.js → transport/ws-methods/utils.js} +14 -9
  101. package/dist/src/version.js +1 -1
  102. package/package.json +15 -7
  103. package/web/dist/assets/agent-DP6TMcLj.js +1 -0
  104. package/web/dist/assets/agent-DmJHzLyj.js +1 -0
  105. package/web/dist/assets/artifact-BqnoZy2M.js +1 -0
  106. package/web/dist/assets/artifact-DfDkgkno.js +1 -0
  107. package/web/dist/assets/common-DRMTVwE9.js +1 -0
  108. package/web/dist/assets/common-DeXccbr2.js +1 -0
  109. package/web/dist/assets/dispatch-CBskGCQI.js +1 -0
  110. package/web/dist/assets/dispatch-sk4Wp30e.js +1 -0
  111. package/web/dist/assets/index-C8wTjZvH.css +1 -0
  112. package/web/dist/assets/index-DYDQZRLk.js +58 -0
  113. package/web/dist/assets/log-DN8cjb0w.js +1 -0
  114. package/web/dist/assets/log-HSeA_dYy.js +1 -0
  115. package/web/dist/assets/modal-BdNai9jf.js +1 -0
  116. package/web/dist/assets/modal-D9_KDpFD.js +1 -0
  117. package/web/dist/assets/nav-BmF7oAKg.js +1 -0
  118. package/web/dist/assets/nav-IjC2xqXQ.js +1 -0
  119. package/web/dist/assets/node-detail-CENRXcrh.js +1 -0
  120. package/web/dist/assets/node-detail-bndPr0IM.js +1 -0
  121. package/web/dist/assets/overview-B87zWAxq.js +1 -0
  122. package/web/dist/assets/overview-gQvk-NOK.js +1 -0
  123. package/web/dist/assets/pipeline-D4dSJRDz.js +1 -0
  124. package/web/dist/assets/pipeline-DZzyOqQa.js +1 -0
  125. package/web/dist/assets/session-CUWvU14v.js +5 -0
  126. package/web/dist/assets/session-DQ6UuCaJ.js +5 -0
  127. package/web/dist/assets/timeline-8y_2_0Em.js +1 -0
  128. package/web/dist/assets/timeline-CAPsXUTC.js +1 -0
  129. package/web/dist/index.html +3 -3
  130. package/dist/src/app/pipeline-plugin-config.js +0 -2
  131. package/dist/src/server/api-handler.js +0 -163
  132. package/dist/src/server/http-utils.js +0 -34
  133. package/dist/src/server/middleware.js +0 -61
  134. package/dist/src/server/router.js +0 -105
  135. package/dist/src/server/routes/agents.js +0 -189
  136. package/dist/src/server/routes/artifacts.js +0 -163
  137. package/dist/src/server/routes/gateway.js +0 -18
  138. package/dist/src/server/routes/health.js +0 -16
  139. package/dist/src/server/routes/logs.js +0 -73
  140. package/dist/src/server/routes/pipeline-batch.js +0 -163
  141. package/dist/src/server/routes/pipeline-diagnostics.js +0 -33
  142. package/dist/src/server/routes/pipeline-links.js +0 -117
  143. package/dist/src/server/routes/pipeline-outputs.js +0 -27
  144. package/dist/src/server/routes/pipeline-queue.js +0 -62
  145. package/dist/src/server/routes/pipeline-runtime.js +0 -162
  146. package/dist/src/server/routes/pipeline-scheduler.js +0 -69
  147. package/dist/src/server/routes/pipeline-workflow.js +0 -180
  148. package/dist/src/server/routes/pipelines.js +0 -96
  149. package/dist/src/server/routes/sessions.js +0 -244
  150. package/dist/src/server/routes/timeline.js +0 -14
  151. package/dist/src/server/serve-static.js +0 -42
  152. package/web/dist/assets/index-CWnfhkn-.js +0 -65
  153. package/web/dist/assets/index-gZ0xOfSO.css +0 -1
  154. /package/dist/src/{server → transport/ws-methods}/types.js +0 -0
@@ -2,6 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.artifactRoutes = exports.artifactIndexCommand = exports.artifactCleanupCommand = exports.artifactExportCommand = exports.artifactShowCommand = exports.artifactListCommand = void 0;
4
4
  const errors_1 = require("../errors");
5
+ const i18n_1 = require("../i18n");
5
6
  const pickOptionalString = (value) => {
6
7
  if (typeof value !== "string")
7
8
  return undefined;
@@ -71,7 +72,7 @@ const artifactCleanupCommand = async (input, ctx) => {
71
72
  });
72
73
  const planObj = plan;
73
74
  if (input.flags.confirm !== true) {
74
- return { ...planObj, dryRun: true, message: "dry-run 模式,候选文件不会删除。传入 --confirm 执行真实删除。" };
75
+ return { ...planObj, dryRun: true, message: (0, i18n_1.t)("artifact.cleanup.dryRunMessage") };
75
76
  }
76
77
  const result = await ctx.app.artifactService.executeCleanup(pipelineId, plan);
77
78
  return { ...planObj, dryRun: false, ...result };
@@ -93,83 +94,83 @@ exports.artifactRoutes = [
93
94
  {
94
95
  key: "artifact.index",
95
96
  path: ["artifact", "index"],
96
- description: "重建产物索引",
97
+ description: (0, i18n_1.t)("artifact.index.description"),
97
98
  handler: exports.artifactIndexCommand,
98
99
  help: {
99
100
  usage: "taskmeld artifact index rebuild [--pipeline <id>] [--format <json|md>]",
100
- args: [{ name: "rebuild", required: true, description: "重建 index.jsonl" }],
101
- options: [{ flags: ["--pipeline"], valueName: "id", description: "只重建指定流水线" }],
102
- summary: "扫描产物目录并重建 index.jsonl,用于升级后纳入历史文件或修复索引不一致",
101
+ args: [{ name: "rebuild", required: true, description: (0, i18n_1.t)("artifact.index.argRebuild") }],
102
+ options: [{ flags: ["--pipeline"], valueName: "id", description: (0, i18n_1.t)("artifact.index.optPipeline") }],
103
+ summary: (0, i18n_1.t)("artifact.index.summary"),
103
104
  },
104
105
  },
105
106
  {
106
107
  key: "artifact.list",
107
108
  path: ["artifact", "list"],
108
- description: "输出产物列表",
109
+ description: (0, i18n_1.t)("artifact.list.description"),
109
110
  handler: exports.artifactListCommand,
110
111
  help: {
111
112
  usage: "taskmeld artifact list [--pipeline <id>] [--node <id>] [--status <status>] [--kind <kind>] [--batch <id>] [--run <id>] [--cursor <cursor>] [--format <json|md>]",
112
113
  options: [
113
- { flags: ["--pipeline"], valueName: "id", description: "按流水线过滤" },
114
- { flags: ["--node"], valueName: "id", description: "按节点过滤" },
114
+ { flags: ["--pipeline"], valueName: "id", description: (0, i18n_1.t)("artifact.list.optPipeline") },
115
+ { flags: ["--node"], valueName: "id", description: (0, i18n_1.t)("artifact.list.optNode") },
115
116
  { flags: ["--status"], valueName: "status", description: "success,failed,rejected" },
116
117
  { flags: ["--kind"], valueName: "kind", description: "artifact,envelope,adapter,group" },
117
- { flags: ["--batch"], valueName: "id", description: "按批跑ID过滤" },
118
- { flags: ["--run"], valueName: "id", description: "按运行RunId过滤" },
119
- { flags: ["--cursor"], valueName: "cursor", description: "分页游标" },
118
+ { flags: ["--batch"], valueName: "id", description: (0, i18n_1.t)("artifact.list.optBatch") },
119
+ { flags: ["--run"], valueName: "id", description: (0, i18n_1.t)("artifact.list.optRun") },
120
+ { flags: ["--cursor"], valueName: "cursor", description: (0, i18n_1.t)("artifact.list.optCursor") },
120
121
  ],
121
- summary: "输出产物列表,支持状态/类型/批跑/游标分页",
122
+ summary: (0, i18n_1.t)("artifact.list.summary"),
122
123
  },
123
124
  },
124
125
  {
125
126
  key: "artifact.show",
126
127
  path: ["artifact", "show"],
127
- description: "输出产物内容",
128
+ description: (0, i18n_1.t)("artifact.show.description"),
128
129
  handler: exports.artifactShowCommand,
129
130
  help: {
130
131
  usage: "taskmeld artifact show <pipelineId> <relativePath> [--format <json|md>]",
131
132
  args: [
132
- { name: "pipelineId", required: true, description: "流水线 ID" },
133
- { name: "relativePath", required: true, description: "产物相对路径" },
133
+ { name: "pipelineId", required: true, description: (0, i18n_1.t)("artifact.show.argPipelineId") },
134
+ { name: "relativePath", required: true, description: (0, i18n_1.t)("artifact.show.argRelativePath") },
134
135
  ],
135
- summary: "输出指定产物的文件内容",
136
+ summary: (0, i18n_1.t)("artifact.show.summary"),
136
137
  },
137
138
  },
138
139
  {
139
140
  key: "artifact.export",
140
141
  path: ["artifact", "export"],
141
- description: "导出产物内容",
142
+ description: (0, i18n_1.t)("artifact.export.description"),
142
143
  handler: exports.artifactExportCommand,
143
144
  help: {
144
145
  usage: "taskmeld artifact export [--pipeline <id>] [--from <date>] [--to <date>] [--format <json>]",
145
146
  options: [
146
- { flags: ["--pipeline"], valueName: "id", description: "按流水线过滤" },
147
- { flags: ["--node"], valueName: "id", description: "按节点过滤" },
147
+ { flags: ["--pipeline"], valueName: "id", description: (0, i18n_1.t)("artifact.export.optPipeline") },
148
+ { flags: ["--node"], valueName: "id", description: (0, i18n_1.t)("artifact.export.optNode") },
148
149
  { flags: ["--status"], valueName: "status", description: "success,failed,rejected" },
149
150
  { flags: ["--kind"], valueName: "kind", description: "artifact,envelope,adapter,group" },
150
- { flags: ["--batch"], valueName: "id", description: "按批跑ID过滤" },
151
- { flags: ["--from"], valueName: "date", description: "开始日期 YYYY-MM-DD" },
152
- { flags: ["--to"], valueName: "date", description: "结束日期 YYYY-MM-DD" },
153
- { flags: ["--limit"], valueName: "n", description: "最大导出条数,默认20000" },
151
+ { flags: ["--batch"], valueName: "id", description: (0, i18n_1.t)("artifact.export.optBatch") },
152
+ { flags: ["--from"], valueName: "date", description: (0, i18n_1.t)("artifact.export.optFrom") },
153
+ { flags: ["--to"], valueName: "date", description: (0, i18n_1.t)("artifact.export.optTo") },
154
+ { flags: ["--limit"], valueName: "n", description: (0, i18n_1.t)("artifact.export.optLimit") },
154
155
  ],
155
- summary: "导出产物内容为 日期->流水线->节点 三层JSON",
156
+ summary: (0, i18n_1.t)("artifact.export.summary"),
156
157
  },
157
158
  },
158
159
  {
159
160
  key: "artifact.cleanup",
160
161
  path: ["artifact", "cleanup"],
161
- description: "清理旧产物",
162
+ description: (0, i18n_1.t)("artifact.cleanup.description"),
162
163
  handler: exports.artifactCleanupCommand,
163
164
  help: {
164
165
  usage: "taskmeld artifact cleanup <pipelineId> [--older-than <days>] [--status <status>] [--confirm]",
165
- args: [{ name: "pipelineId", required: true, description: "流水线 ID" }],
166
+ args: [{ name: "pipelineId", required: true, description: (0, i18n_1.t)("artifact.cleanup.argPipelineId") }],
166
167
  options: [
167
- { flags: ["--pipeline"], valueName: "id", description: "按流水线过滤" },
168
- { flags: ["--older-than"], valueName: "days", description: "保留天数,默认 success=30/failed=90/rejected=90" },
168
+ { flags: ["--pipeline"], valueName: "id", description: (0, i18n_1.t)("artifact.list.optPipeline") },
169
+ { flags: ["--older-than"], valueName: "days", description: (0, i18n_1.t)("artifact.cleanup.optOlderThan") },
169
170
  { flags: ["--status"], valueName: "status", description: "success,failed,rejected" },
170
- { flags: ["--confirm"], description: "必须显式传入才执行真实删除,否则 dry-run" },
171
+ { flags: ["--confirm"], description: (0, i18n_1.t)("artifact.cleanup.optConfirm") },
171
172
  ],
172
- summary: "清理旧产物文件,默认 dry-run 只展示候选不删除,传 --confirm 执行真实删除并重建索引",
173
+ summary: (0, i18n_1.t)("artifact.cleanup.summary"),
173
174
  },
174
175
  },
175
176
  ];
@@ -5,8 +5,8 @@ const node_readline_1 = require("node:readline");
5
5
  const node_os_1 = require("node:os");
6
6
  const node_path_1 = require("node:path");
7
7
  const promises_1 = require("node:fs/promises");
8
- const userConfigDir = (0, node_path_1.join)((0, node_os_1.homedir)(), ".taskmeld");
9
- const userConfigPath = (0, node_path_1.join)(userConfigDir, "config.json");
8
+ const i18n_1 = require("../i18n");
9
+ const ui_prompts_1 = require("../ui-prompts");
10
10
  const c = {
11
11
  reset: "\x1b[0m",
12
12
  bold: "\x1b[1m",
@@ -18,21 +18,8 @@ const c = {
18
18
  bgCyan: "\x1b[46m",
19
19
  bgGreen: "\x1b[42m",
20
20
  };
21
- const hr = () => {
22
- process.stdout.write(`\n ${c.dim}${"─".repeat(50)}${c.reset}\n\n`);
23
- };
24
- const fieldPrompt = (rl, label, hint, prefill) => {
25
- return new Promise((resolve) => {
26
- process.stdout.write(` ${c.bold}${c.white}${label}${c.reset}\n`);
27
- process.stdout.write(` ${c.dim}${hint}${c.reset}\n\n`);
28
- rl.question(` ${c.green}${c.bold}>${c.reset} `, (answer) => {
29
- resolve(answer.trim());
30
- });
31
- if (prefill) {
32
- rl.write(prefill);
33
- }
34
- });
35
- };
21
+ const userConfigDir = (0, node_path_1.join)((0, node_os_1.homedir)(), ".taskmeld");
22
+ const userConfigPath = (0, node_path_1.join)(userConfigDir, "config.json");
36
23
  const readConfig = async () => {
37
24
  try {
38
25
  const raw = await (0, promises_1.readFile)(userConfigPath, "utf8");
@@ -45,7 +32,14 @@ const readConfig = async () => {
45
32
  const writeConfig = async (config) => {
46
33
  await (0, promises_1.mkdir)(userConfigDir, { recursive: true });
47
34
  const existing = await readConfig();
48
- const merged = { ...existing, ...config };
35
+ const sanitized = {};
36
+ if (typeof existing.gatewayUrl === 'string')
37
+ sanitized.gatewayUrl = existing.gatewayUrl;
38
+ if (typeof existing.gatewayToken === 'string')
39
+ sanitized.gatewayToken = existing.gatewayToken;
40
+ if (typeof existing.locale === 'string' && ['zh', 'en'].includes(existing.locale))
41
+ sanitized.locale = existing.locale;
42
+ const merged = { ...sanitized, ...config };
49
43
  await (0, promises_1.writeFile)(userConfigPath, JSON.stringify(merged, null, 2) + "\n", "utf8");
50
44
  };
51
45
  const initCommand = async (input) => {
@@ -54,21 +48,28 @@ const initCommand = async (input) => {
54
48
  const interactive = !url || !token;
55
49
  if (interactive) {
56
50
  console.log("");
57
- console.log(` ${c.bold}${c.cyan}TaskMeld${c.reset} ${c.dim}· First-time Setup${c.reset}`);
51
+ console.log(` ${c.bold}${c.cyan}TaskMeld${c.reset} ${c.dim}· ${(0, i18n_1.t)("init:firstTimeSetup")}${c.reset}`);
58
52
  console.log("");
59
- console.log(` ${c.dim}Configure your OpenClaw Gateway connection to get started.${c.reset}`);
60
- console.log(` ${c.dim}Config ${userConfigPath}${c.reset}`);
53
+ console.log(` ${c.dim}${(0, i18n_1.t)("init:greeting")}${c.reset}`);
54
+ console.log(` ${c.dim}${(0, i18n_1.t)("init:configSavedTo", { path: userConfigPath })}${c.reset}`);
55
+ (0, ui_prompts_1.hr)();
56
+ const locale = await (0, ui_prompts_1.selectPrompt)((0, i18n_1.t)("init:languageLabel"), [
57
+ { value: "en", label: "English" },
58
+ { value: "zh", label: "Chinese" },
59
+ ]);
60
+ await writeConfig({ locale });
61
+ await (0, i18n_1.changeLocale)(locale);
61
62
  const rl = (0, node_readline_1.createInterface)({
62
63
  input: process.stdin,
63
64
  output: process.stdout,
64
65
  });
65
66
  if (!url) {
66
- hr();
67
- url = await fieldPrompt(rl, "Gateway URL", "ws:// or wss:// address of your OpenClaw Gateway", "ws://127.0.0.1:18789") || "ws://127.0.0.1:18789";
67
+ (0, ui_prompts_1.hr)();
68
+ url = await (0, ui_prompts_1.fieldPrompt)(rl, (0, i18n_1.t)("init:gatewayUrlLabel"), (0, i18n_1.t)("init:gatewayUrlHint"), "ws://127.0.0.1:18789") || "ws://127.0.0.1:18789";
68
69
  }
69
70
  if (url && !token) {
70
- hr();
71
- token = await fieldPrompt(rl, "Gateway Token", "Authentication token for the Gateway");
71
+ (0, ui_prompts_1.hr)();
72
+ token = await (0, ui_prompts_1.fieldPrompt)(rl, (0, i18n_1.t)("init:gatewayTokenLabel"), (0, i18n_1.t)("init:gatewayTokenHint"));
72
73
  }
73
74
  rl.close();
74
75
  if (!url || !token) {
@@ -84,12 +85,12 @@ const initCommand = async (input) => {
84
85
  });
85
86
  if (interactive) {
86
87
  console.log("");
87
- console.log(` ${c.bgGreen}${c.black}${c.bold} > Gateway configured successfully ${c.reset}`);
88
+ console.log(` ${c.bgGreen}${c.black}${c.bold} > ${(0, i18n_1.t)("init:success")} ${c.reset}`);
88
89
  console.log("");
89
- console.log(` ${c.dim}URL${c.reset} ${url}`);
90
+ console.log(` ${c.dim}${(0, i18n_1.t)("init:urlLabel")}${c.reset} ${url}`);
90
91
  console.log(` ${c.dim}Config${c.reset} ${userConfigPath}`);
91
92
  console.log("");
92
- console.log(` ${c.dim}Run ${c.white}\"taskmeld server start\"${c.reset}${c.dim} to begin.${c.reset}`);
93
+ console.log(` ${c.dim}${(0, i18n_1.t)("init:nextStep")}${c.reset}`);
93
94
  console.log("");
94
95
  }
95
96
  return {
@@ -104,46 +105,47 @@ exports.initRoutes = [
104
105
  {
105
106
  key: "init",
106
107
  path: ["init"],
107
- description: "Guided setup for OpenClaw Gateway connection",
108
+ description: (0, i18n_1.t)("init:description"),
108
109
  handler: exports.initCommand,
109
110
  renderHelp: () => {
110
111
  const lines = [
111
112
  "Usage:",
112
- " taskmeld init [--url <url>] [--token <token>]",
113
+ ` ${(0, i18n_1.t)("init:usage")}`,
113
114
  "",
114
115
  "Description:",
115
- " Guided first-time setup — configure the OpenClaw Gateway connection.",
116
- ` Config is saved to ${userConfigPath}`,
116
+ ` ${(0, i18n_1.t)("init:summary")}`,
117
+ ` ${(0, i18n_1.t)("init:configSavedTo", { path: userConfigPath })}`,
117
118
  "",
118
119
  "Options:",
119
- " --url <url> Gateway WebSocket URL (ws:// or wss://)",
120
- " --token <token> Gateway authentication token",
120
+ ` --url <url> ${(0, i18n_1.t)("init:optUrlDesc")}`,
121
+ ` --token <token> ${(0, i18n_1.t)("init:optTokenDesc")}`,
121
122
  "",
122
123
  "Examples:",
123
- " taskmeld init",
124
- " taskmeld init --url ws://127.0.0.1:18789 --token your-token",
124
+ ` ${(0, i18n_1.t)("init:example1")}`,
125
+ ` ${(0, i18n_1.t)("init:example2")}`,
125
126
  "",
126
127
  "Notes:",
127
- " Running without flags starts an interactive guided setup.",
128
- " Environment variables (OPENCLAW_GATEWAY_URL/TOKEN) take precedence over this config.",
128
+ ` ${(0, i18n_1.t)("init:note1")}`,
129
+ ` ${(0, i18n_1.t)("init:note2")}`,
130
+ ` ${(0, i18n_1.t)("init:note3")}`,
129
131
  ];
130
132
  return lines.join("\n");
131
133
  },
132
134
  help: {
133
- usage: "taskmeld init [--url <url>] [--token <token>]",
134
- summary: "Guided first-time setup — configure the OpenClaw Gateway connection.",
135
+ usage: (0, i18n_1.t)("init:usage"),
136
+ summary: (0, i18n_1.t)("init:summary"),
135
137
  options: [
136
- { flags: ["--url"], valueName: "url", description: "Gateway WebSocket URL (ws:// or wss://)" },
137
- { flags: ["--token"], valueName: "token", description: "Gateway authentication token" },
138
+ { flags: ["--url"], valueName: "url", description: (0, i18n_1.t)("init:optUrlDesc") },
139
+ { flags: ["--token"], valueName: "token", description: (0, i18n_1.t)("init:optTokenDesc") },
138
140
  ],
139
141
  examples: [
140
- "taskmeld init",
141
- "taskmeld init --url ws://127.0.0.1:18789 --token your-token",
142
+ (0, i18n_1.t)("init:example1"),
143
+ (0, i18n_1.t)("init:example2"),
142
144
  ],
143
145
  notes: [
144
- "Running without flags starts an interactive guided setup.",
145
- "Config is saved to ~/.taskmeld/config.json.",
146
- "Environment variables (OPENCLAW_GATEWAY_URL/TOKEN) take precedence over this config.",
146
+ (0, i18n_1.t)("init:note1"),
147
+ (0, i18n_1.t)("init:note2"),
148
+ (0, i18n_1.t)("init:note3"),
147
149
  ],
148
150
  },
149
151
  },
@@ -2,6 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.pipelineResultRoutes = exports.pipelineResultCommand = void 0;
4
4
  const errors_1 = require("../../errors");
5
+ const i18n_1 = require("../../i18n");
5
6
  const groupItemRunsByBaseKey = (itemRuns) => {
6
7
  const batchMap = new Map();
7
8
  for (const item of itemRuns) {
@@ -81,14 +82,14 @@ const pipelineResultCommand = async (input, ctx) => {
81
82
  batches: [],
82
83
  nodes: [],
83
84
  };
84
- // 通过 artifact service 查询 envelope 文件(复用统一读取语义)
85
+ // Query envelope files via artifact service (reuses unified read semantics)
85
86
  const envelopeList = await ctx.app.artifactService.listArtifacts({
86
87
  pipelineId,
87
88
  runId,
88
89
  kind: "envelope",
89
90
  });
90
91
  const envelopeItems = Array.isArray(envelopeList?.items) ? envelopeList.items : [];
91
- // nodeId 索引 envelope 的 relativePath
92
+ // Index envelope relativePath by nodeId
92
93
  const envelopePathByNode = new Map();
93
94
  for (const item of envelopeItems) {
94
95
  const nid = item.nodeId?.trim();
@@ -163,17 +164,17 @@ exports.pipelineResultRoutes = [
163
164
  {
164
165
  key: "pipeline.result",
165
166
  path: ["pipeline", "result"],
166
- description: "输出流水线运行结果",
167
+ description: (0, i18n_1.t)("pipeline.result.description"),
167
168
  handler: exports.pipelineResultCommand,
168
169
  help: {
169
170
  usage: "taskmeld pipeline result <pipelineId> [--node <nodeId>] [--logs] [--format <json|md>]",
170
- args: [{ name: "pipelineId", required: true, description: "流水线 ID" }],
171
+ args: [{ name: "pipelineId", required: true, description: (0, i18n_1.t)("pipeline.result.argPipelineId") }],
171
172
  options: [
172
- { flags: ["--node"], valueName: "nodeId", description: "过滤到指定节点" },
173
- { flags: ["--logs"], description: "同时展示处理日志" },
174
- { flags: ["--format"], valueName: "json|md", description: "输出格式,默认 md" },
173
+ { flags: ["--node"], valueName: "nodeId", description: (0, i18n_1.t)("pipeline.result.optNode") },
174
+ { flags: ["--logs"], description: (0, i18n_1.t)("pipeline.result.optLogs") },
175
+ { flags: ["--format"], valueName: "json|md", description: (0, i18n_1.t)("pipeline.result.optFormat") },
175
176
  ],
176
- summary: "输出流水线运行后各节点的产物内容",
177
+ summary: (0, i18n_1.t)("pipeline.result.summary"),
177
178
  },
178
179
  },
179
180
  ];
@@ -37,7 +37,7 @@ const getPipelineStatusBySelector = async (ctx, selector) => {
37
37
  if (!selector.runId && !selector.batchRunId && selector.pipelineId) {
38
38
  return await getPipelineStatus(selector.pipelineId);
39
39
  }
40
- // daemon-first 迁移期允许 CLI selector 整体下发,避免 status/watch/stop 再依赖“当前 pipeline 活跃运行”的隐式猜测。
40
+ // During daemon-first migration, allow the CLI to pass the full selector so status/watch/stop don't rely on implicitly guessing the "currently active pipeline run".
41
41
  return await getPipelineStatus(selector);
42
42
  };
43
43
  exports.getPipelineStatusBySelector = getPipelineStatusBySelector;
@@ -52,8 +52,8 @@ const watchPipelineUntilTerminal = async (ctx, selector, timeoutFlag, intervalFl
52
52
  }
53
53
  if (wsSignalAvailable) {
54
54
  try {
55
- // daemon-first 路径优先基于 WS 事件触发下一次状态确认,减少无效轮询;
56
- // 事件链路抖动时自动降级为 interval 轮询,避免 watch 因订阅失败直接中断。
55
+ // The daemon-first path prioritizes triggering the next status check via WS events to reduce unnecessary polling;
56
+ // when the event link flaps, auto-degrade to interval polling so the watch isn't directly interrupted by a failed subscription.
57
57
  await ctx.app.pipelineService.waitForPipelineWatchSignal?.(selector, Math.max(1, Math.min(intervalMs, timeoutMs - (Date.now() - startAt))));
58
58
  continue;
59
59
  }