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.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:
|
|
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: "
|
|
101
|
-
options: [{ flags: ["--pipeline"], valueName: "id", description: "
|
|
102
|
-
summary: "
|
|
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: "
|
|
118
|
-
{ flags: ["--run"], valueName: "id", description: "
|
|
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:
|
|
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: "
|
|
151
|
-
{ flags: ["--from"], valueName: "date", description:
|
|
152
|
-
{ flags: ["--to"], valueName: "date", description:
|
|
153
|
-
{ flags: ["--limit"], valueName: "n", description: "
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
171
|
+
{ flags: ["--confirm"], description: (0, i18n_1.t)("artifact.cleanup.optConfirm") },
|
|
171
172
|
],
|
|
172
|
-
summary:
|
|
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
|
|
9
|
-
const
|
|
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
|
|
22
|
-
|
|
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
|
|
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}·
|
|
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}
|
|
60
|
-
console.log(` ${c.dim}
|
|
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,
|
|
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,
|
|
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} >
|
|
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}
|
|
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}
|
|
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:
|
|
108
|
+
description: (0, i18n_1.t)("init:description"),
|
|
108
109
|
handler: exports.initCommand,
|
|
109
110
|
renderHelp: () => {
|
|
110
111
|
const lines = [
|
|
111
112
|
"Usage:",
|
|
112
|
-
|
|
113
|
+
` ${(0, i18n_1.t)("init:usage")}`,
|
|
113
114
|
"",
|
|
114
115
|
"Description:",
|
|
115
|
-
|
|
116
|
-
`
|
|
116
|
+
` ${(0, i18n_1.t)("init:summary")}`,
|
|
117
|
+
` ${(0, i18n_1.t)("init:configSavedTo", { path: userConfigPath })}`,
|
|
117
118
|
"",
|
|
118
119
|
"Options:",
|
|
119
|
-
|
|
120
|
-
|
|
120
|
+
` --url <url> ${(0, i18n_1.t)("init:optUrlDesc")}`,
|
|
121
|
+
` --token <token> ${(0, i18n_1.t)("init:optTokenDesc")}`,
|
|
121
122
|
"",
|
|
122
123
|
"Examples:",
|
|
123
|
-
|
|
124
|
-
|
|
124
|
+
` ${(0, i18n_1.t)("init:example1")}`,
|
|
125
|
+
` ${(0, i18n_1.t)("init:example2")}`,
|
|
125
126
|
"",
|
|
126
127
|
"Notes:",
|
|
127
|
-
|
|
128
|
-
|
|
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: "
|
|
134
|
-
summary:
|
|
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:
|
|
137
|
-
{ flags: ["--token"], valueName: "token", description:
|
|
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
|
-
"
|
|
141
|
-
"
|
|
142
|
+
(0, i18n_1.t)("init:example1"),
|
|
143
|
+
(0, i18n_1.t)("init:example2"),
|
|
142
144
|
],
|
|
143
145
|
notes: [
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
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
|
-
//
|
|
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
|
-
//
|
|
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:
|
|
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:
|
|
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
|
|
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
|
|
56
|
-
//
|
|
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
|
}
|