taskmeld 0.1.1 → 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.
- package/LICENSE +1 -1
- package/README.md +176 -172
- package/README.zh-CN.md +176 -172
- package/dist/src/app/app-context-env.js +1 -1
- package/dist/src/app/create-app-context.js +3 -3
- package/dist/src/app/data-dir.js +13 -3
- package/dist/src/app/pipeline-config.js +4 -4
- package/dist/src/app/pipeline-registry.js +11 -11
- package/dist/src/app/pipeline-runtime.js +6 -9
- package/dist/src/app/runtime-store.js +3 -3
- package/dist/src/artifacts/artifact-cleanup.js +17 -17
- package/dist/src/artifacts/artifact-index.js +14 -14
- package/dist/src/artifacts/artifact-rebuilder.js +3 -3
- package/dist/src/artifacts/storage-service.js +18 -18
- package/dist/src/cli/bootstrap.js +7 -7
- package/dist/src/cli/commands/agent.js +12 -11
- package/dist/src/cli/commands/artifact.js +31 -30
- package/dist/src/cli/commands/init.js +49 -47
- package/dist/src/cli/commands/pipeline/result.js +9 -8
- package/dist/src/cli/commands/pipeline/selector.js +1 -1
- package/dist/src/cli/commands/pipeline/watch.js +2 -2
- package/dist/src/cli/commands/pipeline.js +54 -53
- package/dist/src/cli/commands/scheduler.js +9 -8
- package/dist/src/cli/commands/server.js +12 -11
- package/dist/src/cli/commands/system.js +4 -3
- package/dist/src/cli/errors.js +2 -2
- package/dist/src/cli/help.js +18 -17
- package/dist/src/cli/i18n.js +46 -0
- package/dist/src/cli/locales/en.json +244 -0
- package/dist/src/cli/locales/zh.json +244 -0
- package/dist/src/cli/output.js +3 -3
- package/dist/src/cli/renderers/engine/markdown.js +1 -1
- package/dist/src/cli/renderers/specs/index.js +1 -1
- package/dist/src/cli/router.js +1 -1
- package/dist/src/cli/server-runtime-client.js +54 -95
- package/dist/src/cli/ui-prompts.js +96 -0
- package/dist/src/cli/ws-runtime-client.js +51 -0
- package/dist/src/gateway/gateway-client.js +4 -4
- package/dist/src/index.js +28 -2
- package/dist/src/logs/run-log-reader.js +1 -1
- package/dist/src/pipeline/agent-activity.js +2 -2
- package/dist/src/pipeline/artifact-storage.js +11 -11
- package/dist/src/pipeline/diagnostics/dependency-diagnostic.js +11 -11
- package/dist/src/pipeline/dispatch/pipeline-inbound-queue.js +2 -2
- package/dist/src/pipeline/execution/group-item-executor.js +1 -1
- package/dist/src/pipeline/execution/node-item-executor.js +3 -3
- package/dist/src/pipeline/execution/node-runner.js +7 -7
- package/dist/src/pipeline/execution/readiness-state.js +1 -1
- package/dist/src/pipeline/execution/reject-handler.js +5 -5
- package/dist/src/pipeline/execution/rejected-artifact-archiver.js +1 -1
- package/dist/src/pipeline/execution/route-item-manager.js +4 -4
- package/dist/src/pipeline/execution/run-abort-controller.js +5 -5
- package/dist/src/pipeline/execution/run-state-helpers.js +2 -2
- package/dist/src/pipeline/execution/service.js +4 -4
- package/dist/src/pipeline/execution/structured-node-runner.js +24 -24
- package/dist/src/pipeline/execution-timeout.js +3 -3
- package/dist/src/pipeline/identity/index.js +3 -3
- package/dist/src/pipeline/item-batch-controller.js +6 -6
- package/dist/src/pipeline/scheduler/dependency-state.js +5 -5
- package/dist/src/pipeline/scheduler-service.js +24 -24
- package/dist/src/pipeline/state-machine.js +2 -2
- package/dist/src/pipeline/structured-output/contract.js +4 -4
- package/dist/src/pipeline/structured-output/index.js +2 -2
- package/dist/src/pipeline/structured-output/parser.js +5 -5
- package/dist/src/pipeline/structured-output/prompt.js +38 -38
- package/dist/src/pipeline/structured-output/waiter.js +6 -6
- package/dist/src/pipeline/template.js +5 -5
- package/dist/src/pipeline/timeline-log-store.js +5 -5
- package/dist/src/pipeline/tool-activity.js +3 -3
- package/dist/src/pipeline/types/pipeline-output.js +1 -1
- package/dist/src/pipeline/workflow/branch-rules.js +19 -19
- package/dist/src/pipeline/workflow/io.js +1 -1
- package/dist/src/pipeline/workflow/normalize.js +18 -18
- package/dist/src/pipeline/workflow/template-mapper.js +3 -3
- package/dist/src/pipeline/workflow/validate.js +39 -39
- package/dist/src/pipeline/workflow-graph.js +10 -10
- package/dist/src/server/http-handler.js +74 -0
- package/dist/src/services/agent-service.js +2 -2
- package/dist/src/services/gateway-read-helpers.js +1 -1
- package/dist/src/services/pipeline-service.js +19 -19
- package/dist/src/services/pipeline-status.js +4 -4
- package/dist/src/services/read-services.js +1 -1
- package/dist/src/services/session-service.js +6 -6
- package/dist/src/services/system-service.js +1 -1
- package/dist/src/transport/ws-broker.js +12 -1
- package/dist/src/transport/ws-handler.js +60 -0
- package/dist/src/transport/ws-methods/agents.js +144 -0
- package/dist/src/transport/ws-methods/artifacts.js +171 -0
- package/dist/src/transport/ws-methods/gateway.js +16 -0
- package/dist/src/transport/ws-methods/logs.js +43 -0
- package/dist/src/transport/ws-methods/pipeline-batch.js +68 -0
- package/dist/src/transport/ws-methods/pipeline-links.js +100 -0
- package/dist/src/transport/ws-methods/pipeline-queue.js +51 -0
- package/dist/src/transport/ws-methods/pipeline-runtime.js +151 -0
- package/dist/src/transport/ws-methods/pipeline-scheduler.js +48 -0
- package/dist/src/transport/ws-methods/pipeline-workflow.js +127 -0
- package/dist/src/transport/ws-methods/pipelines.js +56 -0
- package/dist/src/transport/ws-methods/register-all.js +32 -0
- package/dist/src/transport/ws-methods/sessions.js +154 -0
- package/dist/src/transport/ws-methods/timeline.js +10 -0
- package/dist/src/{server/routes/pipeline-identity.js → transport/ws-methods/utils.js} +14 -9
- package/dist/src/version.js +1 -1
- package/package.json +16 -7
- package/web/dist/assets/agent-DP6TMcLj.js +1 -0
- package/web/dist/assets/agent-DmJHzLyj.js +1 -0
- package/web/dist/assets/artifact-BqnoZy2M.js +1 -0
- package/web/dist/assets/artifact-DfDkgkno.js +1 -0
- package/web/dist/assets/common-DRMTVwE9.js +1 -0
- package/web/dist/assets/common-DeXccbr2.js +1 -0
- package/web/dist/assets/dispatch-CBskGCQI.js +1 -0
- package/web/dist/assets/dispatch-sk4Wp30e.js +1 -0
- package/web/dist/assets/index-C8wTjZvH.css +1 -0
- package/web/dist/assets/index-DYDQZRLk.js +58 -0
- package/web/dist/assets/log-DN8cjb0w.js +1 -0
- package/web/dist/assets/log-HSeA_dYy.js +1 -0
- package/web/dist/assets/modal-BdNai9jf.js +1 -0
- package/web/dist/assets/modal-D9_KDpFD.js +1 -0
- package/web/dist/assets/nav-BmF7oAKg.js +1 -0
- package/web/dist/assets/nav-IjC2xqXQ.js +1 -0
- package/web/dist/assets/node-detail-CENRXcrh.js +1 -0
- package/web/dist/assets/node-detail-bndPr0IM.js +1 -0
- package/web/dist/assets/overview-B87zWAxq.js +1 -0
- package/web/dist/assets/overview-gQvk-NOK.js +1 -0
- package/web/dist/assets/pipeline-D4dSJRDz.js +1 -0
- package/web/dist/assets/pipeline-DZzyOqQa.js +1 -0
- package/web/dist/assets/session-CUWvU14v.js +5 -0
- package/web/dist/assets/session-DQ6UuCaJ.js +5 -0
- package/web/dist/assets/timeline-8y_2_0Em.js +1 -0
- package/web/dist/assets/timeline-CAPsXUTC.js +1 -0
- package/web/dist/index.html +3 -3
- package/dist/src/app/pipeline-plugin-config.js +0 -2
- package/dist/src/server/api-handler.js +0 -163
- package/dist/src/server/http-utils.js +0 -34
- package/dist/src/server/middleware.js +0 -61
- package/dist/src/server/router.js +0 -105
- package/dist/src/server/routes/agents.js +0 -189
- package/dist/src/server/routes/artifacts.js +0 -163
- package/dist/src/server/routes/gateway.js +0 -18
- package/dist/src/server/routes/health.js +0 -16
- package/dist/src/server/routes/logs.js +0 -73
- package/dist/src/server/routes/pipeline-batch.js +0 -163
- package/dist/src/server/routes/pipeline-diagnostics.js +0 -33
- package/dist/src/server/routes/pipeline-links.js +0 -117
- package/dist/src/server/routes/pipeline-outputs.js +0 -27
- package/dist/src/server/routes/pipeline-queue.js +0 -62
- package/dist/src/server/routes/pipeline-runtime.js +0 -162
- package/dist/src/server/routes/pipeline-scheduler.js +0 -69
- package/dist/src/server/routes/pipeline-workflow.js +0 -180
- package/dist/src/server/routes/pipelines.js +0 -96
- package/dist/src/server/routes/sessions.js +0 -244
- package/dist/src/server/routes/timeline.js +0 -14
- package/dist/src/server/serve-static.js +0 -42
- package/web/dist/assets/index-CWnfhkn-.js +0 -65
- package/web/dist/assets/index-gZ0xOfSO.css +0 -1
- /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.pipelineRoutes = exports.pipelineDiagnoseCommand = exports.pipelineRetryNodeCommand = exports.pipelineStopCommand = exports.pipelineWatchCommand = exports.pipelineStatusCommand = exports.pipelineStartCommand = exports.pipelineGetCommand = exports.pipelineListCommand = void 0;
|
|
4
4
|
const errors_1 = require("../errors");
|
|
5
|
+
const i18n_1 = require("../i18n");
|
|
5
6
|
const errors_2 = require("./pipeline/errors");
|
|
6
7
|
const result_1 = require("./pipeline/result");
|
|
7
8
|
const selector_1 = require("./pipeline/selector");
|
|
@@ -146,56 +147,56 @@ exports.pipelineRoutes = [
|
|
|
146
147
|
{
|
|
147
148
|
key: "pipeline.list",
|
|
148
149
|
path: ["pipeline", "list"],
|
|
149
|
-
description: "
|
|
150
|
+
description: (0, i18n_1.t)("pipeline.list.description"),
|
|
150
151
|
handler: exports.pipelineListCommand,
|
|
151
152
|
help: {
|
|
152
153
|
usage: "taskmeld pipeline list [--format <json|md>]",
|
|
153
|
-
summary: "
|
|
154
|
+
summary: (0, i18n_1.t)("pipeline.list.summary"),
|
|
154
155
|
},
|
|
155
156
|
},
|
|
156
157
|
{
|
|
157
158
|
key: "pipeline.get",
|
|
158
159
|
path: ["pipeline", "get"],
|
|
159
|
-
description: "
|
|
160
|
+
description: (0, i18n_1.t)("pipeline.get.description"),
|
|
160
161
|
handler: exports.pipelineGetCommand,
|
|
161
162
|
help: {
|
|
162
163
|
usage: "taskmeld pipeline get <id> [--format <json|md>]",
|
|
163
|
-
args: [{ name: "id", required: true, description:
|
|
164
|
-
summary: "
|
|
164
|
+
args: [{ name: "id", required: true, description: (0, i18n_1.t)("pipeline.get.argId") }],
|
|
165
|
+
summary: (0, i18n_1.t)("pipeline.get.summary"),
|
|
165
166
|
},
|
|
166
167
|
},
|
|
167
168
|
{
|
|
168
169
|
key: "pipeline.start",
|
|
169
170
|
path: ["pipeline", "start"],
|
|
170
|
-
description: "
|
|
171
|
+
description: (0, i18n_1.t)("pipeline.start.description"),
|
|
171
172
|
handler: exports.pipelineStartCommand,
|
|
172
173
|
bootstrap: { runtimeApiOnly: true, ensureServerReady: true },
|
|
173
174
|
help: {
|
|
174
175
|
usage: "taskmeld pipeline start <pipelineId> [--watch] [--timeout <ms>] [--interval <ms>] [--format <json|md>]",
|
|
175
|
-
args: [{ name: "pipelineId", required: true, description:
|
|
176
|
+
args: [{ name: "pipelineId", required: true, description: (0, i18n_1.t)("pipeline.start.argPipelineId") }],
|
|
176
177
|
options: [
|
|
177
|
-
{ flags: ["--watch"], description: "
|
|
178
|
-
{ flags: ["--timeout"], valueName: "ms", description:
|
|
179
|
-
{ flags: ["--interval"], valueName: "ms", description:
|
|
178
|
+
{ flags: ["--watch"], description: (0, i18n_1.t)("pipeline.start.optWatch") },
|
|
179
|
+
{ flags: ["--timeout"], valueName: "ms", description: (0, i18n_1.t)("pipeline.start.optTimeout") },
|
|
180
|
+
{ flags: ["--interval"], valueName: "ms", description: (0, i18n_1.t)("pipeline.start.optInterval") },
|
|
180
181
|
],
|
|
181
182
|
notes: [
|
|
182
|
-
"start
|
|
183
|
-
|
|
183
|
+
(0, i18n_1.t)("pipeline.start.noteOnlyStart"),
|
|
184
|
+
(0, i18n_1.t)("pipeline.start.noteWatch"),
|
|
184
185
|
],
|
|
185
186
|
},
|
|
186
187
|
},
|
|
187
188
|
{
|
|
188
189
|
key: "pipeline.status",
|
|
189
190
|
path: ["pipeline", "status"],
|
|
190
|
-
description: "
|
|
191
|
+
description: (0, i18n_1.t)("pipeline.status.description"),
|
|
191
192
|
handler: exports.pipelineStatusCommand,
|
|
192
193
|
bootstrap: { runtimeApiOnly: true, ensureServerReady: true },
|
|
193
194
|
help: {
|
|
194
195
|
usage: "taskmeld pipeline status [<pipelineId>] [--run-id <id>] [--batch-run-id <id>] [--format <json|md>]",
|
|
195
|
-
args: [{ name: "pipelineId", description:
|
|
196
|
+
args: [{ name: "pipelineId", description: (0, i18n_1.t)("pipeline.status.argPipelineId") }],
|
|
196
197
|
options: [
|
|
197
|
-
{ flags: ["--run-id"], valueName: "id", description:
|
|
198
|
-
{ flags: ["--batch-run-id"], valueName: "id", description:
|
|
198
|
+
{ flags: ["--run-id"], valueName: "id", description: (0, i18n_1.t)("pipeline.status.optRunId") },
|
|
199
|
+
{ flags: ["--batch-run-id"], valueName: "id", description: (0, i18n_1.t)("pipeline.status.optBatchRunId") },
|
|
199
200
|
],
|
|
200
201
|
examples: [
|
|
201
202
|
"taskmeld pipeline status A",
|
|
@@ -203,25 +204,25 @@ exports.pipelineRoutes = [
|
|
|
203
204
|
"taskmeld pipeline status A --batch-run-id batch:A:2026-05-08T18:34:08.978Z",
|
|
204
205
|
],
|
|
205
206
|
notes: [
|
|
206
|
-
|
|
207
|
-
|
|
207
|
+
(0, i18n_1.t)("pipeline.status.noteNeedSelector"),
|
|
208
|
+
(0, i18n_1.t)("pipeline.status.noteDefaultQuery"),
|
|
208
209
|
],
|
|
209
210
|
},
|
|
210
211
|
},
|
|
211
212
|
{
|
|
212
213
|
key: "pipeline.watch",
|
|
213
214
|
path: ["pipeline", "watch"],
|
|
214
|
-
description: "
|
|
215
|
+
description: (0, i18n_1.t)("pipeline.watch.description"),
|
|
215
216
|
handler: exports.pipelineWatchCommand,
|
|
216
217
|
bootstrap: { runtimeApiOnly: true, ensureServerReady: true },
|
|
217
218
|
help: {
|
|
218
219
|
usage: "taskmeld pipeline watch [<pipelineId>] [--run-id <id>] [--batch-run-id <id>] [--timeout <ms>] [--interval <ms>] [--format <json|md>]",
|
|
219
|
-
args: [{ name: "pipelineId", description: "
|
|
220
|
+
args: [{ name: "pipelineId", description: (0, i18n_1.t)("pipeline.watch.argPipelineId") }],
|
|
220
221
|
options: [
|
|
221
|
-
{ flags: ["--run-id"], valueName: "id", description:
|
|
222
|
-
{ flags: ["--batch-run-id"], valueName: "id", description:
|
|
223
|
-
{ flags: ["--timeout"], valueName: "ms", description: "watch
|
|
224
|
-
{ flags: ["--interval"], valueName: "ms", description: "watch
|
|
222
|
+
{ flags: ["--run-id"], valueName: "id", description: (0, i18n_1.t)("pipeline.watch.optRunId") },
|
|
223
|
+
{ flags: ["--batch-run-id"], valueName: "id", description: (0, i18n_1.t)("pipeline.watch.optBatchRunId") },
|
|
224
|
+
{ flags: ["--timeout"], valueName: "ms", description: (0, i18n_1.t)("pipeline.watch.optTimeout") },
|
|
225
|
+
{ flags: ["--interval"], valueName: "ms", description: (0, i18n_1.t)("pipeline.watch.optInterval") },
|
|
225
226
|
],
|
|
226
227
|
examples: [
|
|
227
228
|
"taskmeld pipeline watch A",
|
|
@@ -229,68 +230,68 @@ exports.pipelineRoutes = [
|
|
|
229
230
|
"taskmeld pipeline watch --batch-run-id batch:A:2026-05-08T18:34:08.978Z --timeout 900000",
|
|
230
231
|
],
|
|
231
232
|
notes: [
|
|
232
|
-
"watch
|
|
233
|
-
|
|
234
|
-
"
|
|
233
|
+
(0, i18n_1.t)("pipeline.watch.noteIsWatch"),
|
|
234
|
+
(0, i18n_1.t)("pipeline.watch.noteNeedSelector"),
|
|
235
|
+
(0, i18n_1.t)("pipeline.watch.notePollingFallback"),
|
|
235
236
|
],
|
|
236
237
|
},
|
|
237
238
|
},
|
|
238
239
|
{
|
|
239
240
|
key: "pipeline.stop",
|
|
240
241
|
path: ["pipeline", "stop"],
|
|
241
|
-
description: "
|
|
242
|
+
description: (0, i18n_1.t)("pipeline.stop.description"),
|
|
242
243
|
handler: exports.pipelineStopCommand,
|
|
243
244
|
bootstrap: { runtimeApiOnly: true, ensureServerReady: true },
|
|
244
245
|
help: {
|
|
245
246
|
usage: "taskmeld pipeline stop [<pipelineId>] [--run-id <id>] [--batch-run-id <id>] [--format <json|md>]",
|
|
246
|
-
args: [{ name: "pipelineId", description: "
|
|
247
|
+
args: [{ name: "pipelineId", description: (0, i18n_1.t)("pipeline.stop.argPipelineId") }],
|
|
247
248
|
options: [
|
|
248
|
-
{ flags: ["--run-id"], valueName: "id", description:
|
|
249
|
-
{ flags: ["--batch-run-id"], valueName: "id", description:
|
|
249
|
+
{ flags: ["--run-id"], valueName: "id", description: (0, i18n_1.t)("pipeline.stop.optRunId") },
|
|
250
|
+
{ flags: ["--batch-run-id"], valueName: "id", description: (0, i18n_1.t)("pipeline.stop.optBatchRunId") },
|
|
250
251
|
],
|
|
251
252
|
notes: [
|
|
252
|
-
|
|
253
|
-
"
|
|
254
|
-
"
|
|
253
|
+
(0, i18n_1.t)("pipeline.stop.noteNeedSelector"),
|
|
254
|
+
(0, i18n_1.t)("pipeline.stop.noteBatchOnly"),
|
|
255
|
+
(0, i18n_1.t)("pipeline.stop.noteNonBatch"),
|
|
255
256
|
],
|
|
256
257
|
},
|
|
257
258
|
},
|
|
258
259
|
{
|
|
259
260
|
key: "pipeline.retry-node",
|
|
260
261
|
path: ["pipeline", "retry-node"],
|
|
261
|
-
description: "
|
|
262
|
+
description: (0, i18n_1.t)("pipeline.retryNode.description"),
|
|
262
263
|
handler: exports.pipelineRetryNodeCommand,
|
|
263
264
|
bootstrap: { gateway: "required" },
|
|
264
265
|
help: {
|
|
265
266
|
usage: "taskmeld pipeline retry-node <pipelineId> <nodeId> [--item <itemKey>] [--format <json|md>]",
|
|
266
267
|
args: [
|
|
267
|
-
{ name: "pipelineId", required: true, description:
|
|
268
|
-
{ name: "nodeId", required: true, description:
|
|
268
|
+
{ name: "pipelineId", required: true, description: (0, i18n_1.t)("pipeline.retryNode.argPipelineId") },
|
|
269
|
+
{ name: "nodeId", required: true, description: (0, i18n_1.t)("pipeline.retryNode.argNodeId") },
|
|
269
270
|
],
|
|
270
|
-
options: [{ flags: ["--item"], valueName: "itemKey", description: "
|
|
271
|
-
summary: "
|
|
271
|
+
options: [{ flags: ["--item"], valueName: "itemKey", description: (0, i18n_1.t)("pipeline.retryNode.optItem") }],
|
|
272
|
+
summary: (0, i18n_1.t)("pipeline.retryNode.summary"),
|
|
272
273
|
},
|
|
273
274
|
},
|
|
274
275
|
{
|
|
275
276
|
key: "pipeline.diagnose",
|
|
276
277
|
path: ["pipeline", "diagnose"],
|
|
277
|
-
description: "
|
|
278
|
+
description: (0, i18n_1.t)("pipeline.diagnose.description"),
|
|
278
279
|
handler: exports.pipelineDiagnoseCommand,
|
|
279
280
|
bootstrap: { runtimeApiOnly: true, ensureServerReady: true },
|
|
280
281
|
help: {
|
|
281
282
|
usage: "taskmeld pipeline diagnose <pipelineId> <nodeId> [--item <itemKey>] [--format <json|md>]",
|
|
282
283
|
args: [
|
|
283
|
-
{ name: "pipelineId", required: true, description:
|
|
284
|
-
{ name: "nodeId", required: true, description:
|
|
284
|
+
{ name: "pipelineId", required: true, description: (0, i18n_1.t)("pipeline.diagnose.argPipelineId") },
|
|
285
|
+
{ name: "nodeId", required: true, description: (0, i18n_1.t)("pipeline.diagnose.argNodeId") },
|
|
285
286
|
],
|
|
286
|
-
options: [{ flags: ["--item"], valueName: "itemKey", description: "
|
|
287
|
-
summary: "
|
|
287
|
+
options: [{ flags: ["--item"], valueName: "itemKey", description: (0, i18n_1.t)("pipeline.diagnose.optItem") }],
|
|
288
|
+
summary: (0, i18n_1.t)("pipeline.diagnose.summary"),
|
|
288
289
|
},
|
|
289
290
|
},
|
|
290
291
|
{
|
|
291
292
|
key: "pipeline.output",
|
|
292
293
|
path: ["pipeline", "output"],
|
|
293
|
-
description: "
|
|
294
|
+
description: (0, i18n_1.t)("pipeline.output.description"),
|
|
294
295
|
handler: async (input, ctx) => {
|
|
295
296
|
const pipelineId = (0, errors_1.assertRequiredArg)(input.args[0], "pipelineId");
|
|
296
297
|
const runId = (0, selector_1.pickOptionalStringFlag)(input.flags.run);
|
|
@@ -303,28 +304,28 @@ exports.pipelineRoutes = [
|
|
|
303
304
|
},
|
|
304
305
|
help: {
|
|
305
306
|
usage: "taskmeld pipeline output <pipelineId> [--run <runId>]",
|
|
306
|
-
args: [{ name: "pipelineId", required: true, description:
|
|
307
|
-
options: [{ flags: ["--run"], valueName: "runId", description:
|
|
308
|
-
summary: "
|
|
307
|
+
args: [{ name: "pipelineId", required: true, description: (0, i18n_1.t)("pipeline.output.argPipelineId") }],
|
|
308
|
+
options: [{ flags: ["--run"], valueName: "runId", description: (0, i18n_1.t)("pipeline.output.optRun") }],
|
|
309
|
+
summary: (0, i18n_1.t)("pipeline.output.summary"),
|
|
309
310
|
},
|
|
310
311
|
},
|
|
311
312
|
{
|
|
312
313
|
key: "pipeline.link-list",
|
|
313
314
|
path: ["pipeline", "link", "list"],
|
|
314
|
-
description: "
|
|
315
|
+
description: (0, i18n_1.t)("pipeline.linkList.description"),
|
|
315
316
|
handler: async (_input, ctx) => {
|
|
316
317
|
const links = await ctx.app.pipelineService.listLinks();
|
|
317
318
|
return { ok: true, items: links };
|
|
318
319
|
},
|
|
319
320
|
help: {
|
|
320
321
|
usage: "taskmeld pipeline link list",
|
|
321
|
-
summary: "
|
|
322
|
+
summary: (0, i18n_1.t)("pipeline.linkList.summary"),
|
|
322
323
|
},
|
|
323
324
|
},
|
|
324
325
|
{
|
|
325
326
|
key: "pipeline.queue",
|
|
326
327
|
path: ["pipeline", "queue"],
|
|
327
|
-
description: "
|
|
328
|
+
description: (0, i18n_1.t)("pipeline.queue.description"),
|
|
328
329
|
handler: async (input, ctx) => {
|
|
329
330
|
const pipelineId = (0, errors_1.assertRequiredArg)(input.args[0], "pipelineId");
|
|
330
331
|
const items = ctx.app.pipelineService.getQueue(pipelineId);
|
|
@@ -332,8 +333,8 @@ exports.pipelineRoutes = [
|
|
|
332
333
|
},
|
|
333
334
|
help: {
|
|
334
335
|
usage: "taskmeld pipeline queue <pipelineId>",
|
|
335
|
-
args: [{ name: "pipelineId", required: true, description:
|
|
336
|
-
summary: "
|
|
336
|
+
args: [{ name: "pipelineId", required: true, description: (0, i18n_1.t)("pipeline.queue.argPipelineId") }],
|
|
337
|
+
summary: (0, i18n_1.t)("pipeline.queue.summary"),
|
|
337
338
|
},
|
|
338
339
|
},
|
|
339
340
|
];
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.schedulerRoutes = exports.schedulerModeCommand = exports.schedulerToggleCommand = void 0;
|
|
4
4
|
const errors_1 = require("../errors");
|
|
5
|
+
const i18n_1 = require("../i18n");
|
|
5
6
|
const assertSchedulerMode = (value) => {
|
|
6
7
|
if (typeof value === "string") {
|
|
7
8
|
const normalized = value.trim().toLowerCase();
|
|
@@ -57,25 +58,25 @@ exports.schedulerRoutes = [
|
|
|
57
58
|
{
|
|
58
59
|
key: "scheduler.toggle",
|
|
59
60
|
path: ["scheduler", "toggle"],
|
|
60
|
-
description: "
|
|
61
|
+
description: (0, i18n_1.t)("scheduler.toggle.description"),
|
|
61
62
|
handler: exports.schedulerToggleCommand,
|
|
62
63
|
help: {
|
|
63
64
|
usage: "taskmeld scheduler toggle <pipelineId> --enabled <true|false> [--format <json|md>]",
|
|
64
|
-
args: [{ name: "pipelineId", required: true, description:
|
|
65
|
-
options: [{ flags: ["--enabled"], valueName: "true|false", required: true, description: "
|
|
66
|
-
notes: [
|
|
65
|
+
args: [{ name: "pipelineId", required: true, description: (0, i18n_1.t)("scheduler.toggle.argPipelineId") }],
|
|
66
|
+
options: [{ flags: ["--enabled"], valueName: "true|false", required: true, description: (0, i18n_1.t)("scheduler.toggle.optEnabled") }],
|
|
67
|
+
notes: [(0, i18n_1.t)("scheduler.toggle.note")],
|
|
67
68
|
},
|
|
68
69
|
},
|
|
69
70
|
{
|
|
70
71
|
key: "scheduler.mode",
|
|
71
72
|
path: ["scheduler", "mode"],
|
|
72
|
-
description: "
|
|
73
|
+
description: (0, i18n_1.t)("scheduler.mode.description"),
|
|
73
74
|
handler: exports.schedulerModeCommand,
|
|
74
75
|
help: {
|
|
75
76
|
usage: "taskmeld scheduler mode <pipelineId> --mode <auto|manual> [--format <json|md>]",
|
|
76
|
-
args: [{ name: "pipelineId", required: true, description:
|
|
77
|
-
options: [{ flags: ["--mode"], valueName: "auto|manual", required: true, description: "
|
|
78
|
-
notes: ["
|
|
77
|
+
args: [{ name: "pipelineId", required: true, description: (0, i18n_1.t)("scheduler.mode.argPipelineId") }],
|
|
78
|
+
options: [{ flags: ["--mode"], valueName: "auto|manual", required: true, description: (0, i18n_1.t)("scheduler.mode.optMode") }],
|
|
79
|
+
notes: [(0, i18n_1.t)("scheduler.mode.note")],
|
|
79
80
|
},
|
|
80
81
|
},
|
|
81
82
|
];
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.serverRoutes = exports.serverStopCommand = exports.serverStatusCommand = exports.serverStartCommand = exports.serverEnsureCommand = void 0;
|
|
4
|
+
const i18n_1 = require("../i18n");
|
|
4
5
|
const serverEnsureCommand = async (_input, ctx) => {
|
|
5
6
|
return ctx.app.serverService.ensureServerReady();
|
|
6
7
|
};
|
|
@@ -21,50 +22,50 @@ exports.serverRoutes = [
|
|
|
21
22
|
{
|
|
22
23
|
key: "server.ensure",
|
|
23
24
|
path: ["server", "ensure"],
|
|
24
|
-
description: "
|
|
25
|
+
description: (0, i18n_1.t)("server.ensure.description"),
|
|
25
26
|
handler: exports.serverEnsureCommand,
|
|
26
27
|
bootstrap: { runtimeApiOnly: true },
|
|
27
28
|
help: {
|
|
28
29
|
usage: "taskmeld server ensure [--format <json|md>]",
|
|
29
|
-
summary:
|
|
30
|
+
summary: (0, i18n_1.t)("server.ensure.summary"),
|
|
30
31
|
notes: [
|
|
31
|
-
|
|
32
|
-
|
|
32
|
+
(0, i18n_1.t)("server.ensure.noteDaemonFirst"),
|
|
33
|
+
(0, i18n_1.t)("server.ensure.noteNewDaemon"),
|
|
33
34
|
],
|
|
34
35
|
},
|
|
35
36
|
},
|
|
36
37
|
{
|
|
37
38
|
key: "server.start",
|
|
38
39
|
path: ["server", "start"],
|
|
39
|
-
description: "
|
|
40
|
+
description: (0, i18n_1.t)("server.start.description"),
|
|
40
41
|
handler: exports.serverStartCommand,
|
|
41
42
|
bootstrap: { runtimeApiOnly: true },
|
|
42
43
|
help: {
|
|
43
44
|
usage: "taskmeld server start [--format <json|md>]",
|
|
44
|
-
summary:
|
|
45
|
+
summary: (0, i18n_1.t)("server.start.summary"),
|
|
45
46
|
},
|
|
46
47
|
},
|
|
47
48
|
{
|
|
48
49
|
key: "server.status",
|
|
49
50
|
path: ["server", "status"],
|
|
50
|
-
description: "
|
|
51
|
+
description: (0, i18n_1.t)("server.status.description"),
|
|
51
52
|
handler: exports.serverStatusCommand,
|
|
52
53
|
bootstrap: { runtimeApiOnly: true },
|
|
53
54
|
help: {
|
|
54
55
|
usage: "taskmeld server status [--format <json|md>]",
|
|
55
|
-
summary:
|
|
56
|
-
notes: [
|
|
56
|
+
summary: (0, i18n_1.t)("server.status.summary"),
|
|
57
|
+
notes: [(0, i18n_1.t)("server.status.note")],
|
|
57
58
|
},
|
|
58
59
|
},
|
|
59
60
|
{
|
|
60
61
|
key: "server.stop",
|
|
61
62
|
path: ["server", "stop"],
|
|
62
|
-
description: "
|
|
63
|
+
description: (0, i18n_1.t)("server.stop.description"),
|
|
63
64
|
handler: exports.serverStopCommand,
|
|
64
65
|
bootstrap: { runtimeApiOnly: true },
|
|
65
66
|
help: {
|
|
66
67
|
usage: "taskmeld server stop [--format <json|md>]",
|
|
67
|
-
summary:
|
|
68
|
+
summary: (0, i18n_1.t)("server.stop.summary"),
|
|
68
69
|
},
|
|
69
70
|
},
|
|
70
71
|
];
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.systemRoutes = exports.systemSnapshotCommand = void 0;
|
|
4
|
+
const i18n_1 = require("../i18n");
|
|
4
5
|
const systemSnapshotCommand = async (_input, ctx) => {
|
|
5
|
-
//
|
|
6
|
+
// The system snapshot is provided by the mainline service layer; the CLI only handles orchestration and output.
|
|
6
7
|
return ctx.app.systemService.getSnapshot();
|
|
7
8
|
};
|
|
8
9
|
exports.systemSnapshotCommand = systemSnapshotCommand;
|
|
@@ -10,12 +11,12 @@ exports.systemRoutes = [
|
|
|
10
11
|
{
|
|
11
12
|
key: "system.snapshot",
|
|
12
13
|
path: ["system", "snapshot"],
|
|
13
|
-
description: "
|
|
14
|
+
description: (0, i18n_1.t)("system.snapshot.description"),
|
|
14
15
|
handler: exports.systemSnapshotCommand,
|
|
15
16
|
bootstrap: { gateway: "warmup" },
|
|
16
17
|
help: {
|
|
17
18
|
usage: "taskmeld system snapshot [--format <json|md>]",
|
|
18
|
-
summary: "
|
|
19
|
+
summary: (0, i18n_1.t)("system.snapshot.summary"),
|
|
19
20
|
},
|
|
20
21
|
},
|
|
21
22
|
];
|
package/dist/src/cli/errors.js
CHANGED
|
@@ -14,7 +14,7 @@ class CliError extends Error {
|
|
|
14
14
|
}
|
|
15
15
|
}
|
|
16
16
|
exports.CliError = CliError;
|
|
17
|
-
//
|
|
17
|
+
// Unify unknown exception normalization to prevent CLI output structure drift.
|
|
18
18
|
const toCliError = (error) => {
|
|
19
19
|
if (error instanceof CliError)
|
|
20
20
|
return error;
|
|
@@ -31,7 +31,7 @@ const toCliError = (error) => {
|
|
|
31
31
|
});
|
|
32
32
|
};
|
|
33
33
|
exports.toCliError = toCliError;
|
|
34
|
-
//
|
|
34
|
+
// Without altering the original error metadata, attach a help hint to argument-type errors.
|
|
35
35
|
const withHelpHint = (error, hint) => {
|
|
36
36
|
if (!hint.trim())
|
|
37
37
|
return error;
|
package/dist/src/cli/help.js
CHANGED
|
@@ -1,21 +1,22 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.resolveHelpHintByRouteKey = exports.resolveHelpHint = exports.resolveHelp = void 0;
|
|
4
|
-
const
|
|
4
|
+
const i18n_1 = require("./i18n");
|
|
5
|
+
const ROOT_USAGE = (0, i18n_1.t)("help.usage");
|
|
5
6
|
const GROUP_DESCRIPTIONS = {
|
|
6
|
-
agent: "
|
|
7
|
-
artifact: "
|
|
8
|
-
init:
|
|
9
|
-
pipeline: "
|
|
10
|
-
scheduler: "
|
|
11
|
-
server: "
|
|
12
|
-
system: "
|
|
7
|
+
agent: (0, i18n_1.t)("help.groups.agent"),
|
|
8
|
+
artifact: (0, i18n_1.t)("help.groups.artifact"),
|
|
9
|
+
init: (0, i18n_1.t)("help.groups.init"),
|
|
10
|
+
pipeline: (0, i18n_1.t)("help.groups.pipeline"),
|
|
11
|
+
scheduler: (0, i18n_1.t)("help.groups.scheduler"),
|
|
12
|
+
server: (0, i18n_1.t)("help.groups.server"),
|
|
13
|
+
system: (0, i18n_1.t)("help.groups.system"),
|
|
13
14
|
};
|
|
14
15
|
const COMMON_OPTIONS_LINES = [
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
16
|
+
(0, i18n_1.t)("help.commonOptions.title"),
|
|
17
|
+
` -f, --format <json|md> ${(0, i18n_1.t)("help.commonOptions.format")}`,
|
|
18
|
+
` --envelope ${(0, i18n_1.t)("help.commonOptions.envelope")}`,
|
|
19
|
+
` -h, --help ${(0, i18n_1.t)("help.commonOptions.help")}`,
|
|
19
20
|
];
|
|
20
21
|
const listPublicRoutes = (routes) => {
|
|
21
22
|
return routes.filter((route) => route.hidden !== true);
|
|
@@ -38,7 +39,7 @@ const formatArgsBlock = (args) => {
|
|
|
38
39
|
"Arguments:",
|
|
39
40
|
...args.map((item) => {
|
|
40
41
|
const printableName = item.name.startsWith("<") ? item.name : `<${item.name}>`;
|
|
41
|
-
const requiredLabel = item.required ? "
|
|
42
|
+
const requiredLabel = item.required ? (0, i18n_1.t)("help.label.required") : (0, i18n_1.t)("help.label.optional");
|
|
42
43
|
const detail = item.description ? `,${item.description}` : "";
|
|
43
44
|
return ` ${printableName} ${requiredLabel}${detail}`;
|
|
44
45
|
}),
|
|
@@ -52,7 +53,7 @@ const formatOptionsBlock = (options) => {
|
|
|
52
53
|
...options.map((item) => {
|
|
53
54
|
const flagName = item.flags.join(", ");
|
|
54
55
|
const valueHint = item.valueName ? ` <${item.valueName}>` : "";
|
|
55
|
-
const requiredLabel = item.required ? "
|
|
56
|
+
const requiredLabel = item.required ? (0, i18n_1.t)("help.label.required") : (0, i18n_1.t)("help.label.optional");
|
|
56
57
|
const detail = item.description ? `,${item.description}` : "";
|
|
57
58
|
return ` ${flagName}${valueHint} ${requiredLabel}${detail}`;
|
|
58
59
|
}),
|
|
@@ -84,8 +85,8 @@ const renderRoot = (routes) => {
|
|
|
84
85
|
}),
|
|
85
86
|
"",
|
|
86
87
|
"Tips:",
|
|
87
|
-
|
|
88
|
-
|
|
88
|
+
` taskmeld <resource> -h ${(0, i18n_1.t)("help.tips.groupHelp")}`,
|
|
89
|
+
` taskmeld <resource> <action> -h ${(0, i18n_1.t)("help.tips.commandHelp")}`,
|
|
89
90
|
];
|
|
90
91
|
return lines.join("\n");
|
|
91
92
|
};
|
|
@@ -127,7 +128,7 @@ const renderAutoCommandHelp = (route) => {
|
|
|
127
128
|
return lines.join("\n");
|
|
128
129
|
};
|
|
129
130
|
const renderCommand = (route) => {
|
|
130
|
-
//
|
|
131
|
+
// This special-case exit point exists for future compatibility with the very few commands that require fully custom layout; the default path must use route metadata generation.
|
|
131
132
|
const text = route.renderHelp ? route.renderHelp(route) : renderAutoCommandHelp(route);
|
|
132
133
|
const lines = text.split("\n");
|
|
133
134
|
appendCommonOptions(lines);
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.changeLocale = exports.t = void 0;
|
|
7
|
+
const node_os_1 = require("node:os");
|
|
8
|
+
const node_path_1 = require("node:path");
|
|
9
|
+
const node_fs_1 = require("node:fs");
|
|
10
|
+
const i18next_1 = __importDefault(require("i18next"));
|
|
11
|
+
const zh_json_1 = __importDefault(require("./locales/zh.json"));
|
|
12
|
+
const en_json_1 = __importDefault(require("./locales/en.json"));
|
|
13
|
+
const resolveLocale = () => {
|
|
14
|
+
// 1. env override
|
|
15
|
+
const envLocale = process.env.TASKMELD_LOCALE?.trim();
|
|
16
|
+
if (envLocale && ["zh", "en"].includes(envLocale))
|
|
17
|
+
return envLocale;
|
|
18
|
+
// 2. config.json
|
|
19
|
+
try {
|
|
20
|
+
const configPath = (0, node_path_1.join)((0, node_os_1.homedir)(), ".taskmeld", "config.json");
|
|
21
|
+
const raw = (0, node_fs_1.readFileSync)(configPath, "utf8");
|
|
22
|
+
const config = JSON.parse(raw);
|
|
23
|
+
if (config.locale && ["zh", "en"].includes(config.locale)) {
|
|
24
|
+
return config.locale;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
catch {
|
|
28
|
+
// config file not found or invalid, fall through
|
|
29
|
+
}
|
|
30
|
+
return "en";
|
|
31
|
+
};
|
|
32
|
+
i18next_1.default.init({
|
|
33
|
+
lng: resolveLocale(),
|
|
34
|
+
resources: {
|
|
35
|
+
zh: { cli: zh_json_1.default },
|
|
36
|
+
en: { cli: en_json_1.default },
|
|
37
|
+
},
|
|
38
|
+
defaultNS: "cli",
|
|
39
|
+
fallbackLng: "en",
|
|
40
|
+
interpolation: { escapeValue: false },
|
|
41
|
+
});
|
|
42
|
+
exports.t = i18next_1.default.t.bind(i18next_1.default);
|
|
43
|
+
const changeLocale = async (locale) => {
|
|
44
|
+
await i18next_1.default.changeLanguage(locale);
|
|
45
|
+
};
|
|
46
|
+
exports.changeLocale = changeLocale;
|