shoplazza-ai-dev-cli 0.1.21 → 0.1.22-snapshot.1

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.
@@ -0,0 +1,116 @@
1
+ import "./rolldown-runtime.mjs";
2
+ import "./libs/@clack/core.mjs";
3
+ import "./libs/@clack/prompts.mjs";
4
+ import { a as HEARTBEAT_INTERVAL_MS, o as HEARTBEAT_PATH } from "./heartbeat.mjs";
5
+ import { i as RealExecutor } from "./executor.mjs";
6
+ const DEFAULT_HEARTBEAT_INTERVAL_MS = HEARTBEAT_INTERVAL_MS;
7
+ const DEFAULT_DRAIN_TIMEOUT_MS = 3e4;
8
+ function buildHeartbeatRequest(host, executor, deps, interruptedAttempts) {
9
+ const slots = executor.slots();
10
+ const req = {
11
+ cli_version: deps.cliVersion,
12
+ runtimes: host.runtimes(),
13
+ slots: {
14
+ total: slots.total,
15
+ busy: slots.busy
16
+ },
17
+ disk: {
18
+ used_gb: deps.diskUsedGb(),
19
+ limit_gb: host.machineSettings().disk_limit_gb
20
+ }
21
+ };
22
+ if (interruptedAttempts && interruptedAttempts.length > 0) req.interrupted_attempts = interruptedAttempts;
23
+ return req;
24
+ }
25
+ async function heartbeatOnce(host, executor, deps, interruptedAttempts) {
26
+ const req = buildHeartbeatRequest(host, executor, deps, interruptedAttempts);
27
+ const res = await host.http().request("POST", HEARTBEAT_PATH, { body: req });
28
+ if (res.status < 200 || res.status >= 300) throw new Error(`runner heartbeat failed: status=${res.status}`);
29
+ for (const action of res.body.actions) switch (action) {
30
+ case "probe":
31
+ host.log("info", "heartbeat action: probe", { action });
32
+ break;
33
+ case "doctor":
34
+ host.log("info", "heartbeat action: doctor", { action });
35
+ break;
36
+ case "update":
37
+ host.log("info", "heartbeat action: update", {
38
+ action,
39
+ min_version: res.body.min_version
40
+ });
41
+ break;
42
+ }
43
+ return res.body;
44
+ }
45
+ async function runDaemon(host, executor, opts) {
46
+ const intervalMs = opts.intervalMs ?? DEFAULT_HEARTBEAT_INTERVAL_MS;
47
+ const drainTimeoutMs = opts.drainTimeoutMs ?? DEFAULT_DRAIN_TIMEOUT_MS;
48
+ await host.start();
49
+ try {
50
+ await executor.start(host);
51
+ let interrupted = executor.running().map((a) => a.attempt_id);
52
+ const stopper = createStopper();
53
+ let restarting = false;
54
+ const unsubscribes = [
55
+ host.onEvent("wake", () => executor.wake()),
56
+ host.onEvent("cancel", (e) => executor.cancel(e.attempt_id)),
57
+ host.onEvent("shutdown", () => stopper.stop()),
58
+ host.onEvent("config", () => executor.applyConfig()),
59
+ host.onEvent("restart", () => {
60
+ restarting = true;
61
+ executor.stopClaiming();
62
+ })
63
+ ];
64
+ executor.wake();
65
+ try {
66
+ let beats = 0;
67
+ while (!stopper.stopped) {
68
+ try {
69
+ if (opts.heartbeat) await opts.heartbeat.send(buildHeartbeatRequest(host, executor, opts, interrupted));
70
+ else await heartbeatOnce(host, executor, opts, interrupted);
71
+ interrupted = void 0;
72
+ } catch (err) {
73
+ host.log("warn", "runner heartbeat error", { error: err instanceof Error ? err.message : String(err) });
74
+ }
75
+ beats++;
76
+ if (opts.maxBeats !== void 0 && beats >= opts.maxBeats) break;
77
+ if (restarting && executor.running().length === 0) break;
78
+ await stopper.sleep(opts.heartbeat?.nextDelayMs() ?? intervalMs);
79
+ }
80
+ } finally {
81
+ for (const unsubscribe of unsubscribes) unsubscribe();
82
+ await executor.drain(drainTimeoutMs);
83
+ }
84
+ } finally {
85
+ await host.stop();
86
+ }
87
+ }
88
+ function createStopper() {
89
+ let stopped = false;
90
+ let wakeUp;
91
+ return {
92
+ get stopped() {
93
+ return stopped;
94
+ },
95
+ stop() {
96
+ stopped = true;
97
+ wakeUp?.();
98
+ },
99
+ sleep(ms) {
100
+ if (stopped) return Promise.resolve();
101
+ return new Promise((resolve) => {
102
+ const timer = setTimeout(done, ms);
103
+ function done() {
104
+ clearTimeout(timer);
105
+ wakeUp = void 0;
106
+ resolve();
107
+ }
108
+ wakeUp = done;
109
+ });
110
+ }
111
+ };
112
+ }
113
+ function runRealDaemon(host, opts) {
114
+ return runDaemon(host, new RealExecutor(), opts);
115
+ }
116
+ export { runRealDaemon };
@@ -5,7 +5,7 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
5
  var __getOwnPropNames = Object.getOwnPropertyNames;
6
6
  var __getProtoOf = Object.getPrototypeOf;
7
7
  var __hasOwnProp = Object.prototype.hasOwnProperty;
8
- var __commonJSMin = (cb, mod) => () => (mod || (cb((mod = { exports: {} }).exports, mod), cb = null), mod.exports);
8
+ var __commonJSMin = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
9
9
  var __copyProps = (to, from, except, desc) => {
10
10
  if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
11
11
  key = keys[i];
@@ -21,4 +21,4 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
21
21
  enumerable: true
22
22
  }) : target, mod));
23
23
  var __require = /* @__PURE__ */ createRequire(import.meta.url);
24
- export { __commonJSMin, __require, __toESM };
24
+ export { __require as n, __toESM as r, __commonJSMin as t };
@@ -0,0 +1,289 @@
1
+ import { i as sessionTokenOf, n as isSessionPath, r as missingTokenReply, t as forwardSession } from "./session-forward.mjs";
2
+ import { i as RealExecutor } from "./executor.mjs";
3
+ import { join } from "node:path";
4
+ import os from "node:os";
5
+ import { createServer } from "node:http";
6
+ import { mkdir } from "node:fs/promises";
7
+ const TRIAL_RUNNER_ID = "0";
8
+ var HttpHost = class {
9
+ routes = /* @__PURE__ */ new Map();
10
+ server;
11
+ local = "";
12
+ logs = [];
13
+ constructor(base, token, settings, agent, sink) {
14
+ this.base = base;
15
+ this.token = token;
16
+ this.settings = settings;
17
+ this.agent = agent;
18
+ this.sink = sink;
19
+ }
20
+ async start() {
21
+ this.server = createServer((req, res) => {
22
+ let raw = "";
23
+ req.on("data", (c) => raw += c);
24
+ req.on("end", async () => {
25
+ const handler = this.routes.get(`${req.method} ${req.url}`);
26
+ const headers = {};
27
+ for (const [k, v] of Object.entries(req.headers)) headers[k] = String(v);
28
+ if (!handler) {
29
+ await this.serveUnregistered(req, res, headers, raw);
30
+ return;
31
+ }
32
+ let body = void 0;
33
+ try {
34
+ body = raw ? JSON.parse(raw) : void 0;
35
+ } catch {
36
+ res.writeHead(400, { "content-type": "application/json" }).end("{\"code\":\"bad_json\"}");
37
+ return;
38
+ }
39
+ const out = await handler({
40
+ method: req.method,
41
+ path: req.url ?? "",
42
+ body,
43
+ headers
44
+ });
45
+ res.writeHead(out.status, { "content-type": "application/json" }).end(JSON.stringify(out.body ?? {}));
46
+ });
47
+ });
48
+ await new Promise((resolve) => this.server.listen(0, "127.0.0.1", resolve));
49
+ const addr = this.server.address();
50
+ this.local = typeof addr === "object" && addr ? `http://127.0.0.1:${addr.port}` : "";
51
+ }
52
+ async serveUnregistered(req, res, headers, raw) {
53
+ const url = new URL(req.url ?? "/", "http://127.0.0.1");
54
+ const registered = [...this.routes.keys()].some((key) => key.endsWith(` ${url.pathname}`));
55
+ if (!isSessionPath(url.pathname) || registered) {
56
+ res.writeHead(404).end();
57
+ return;
58
+ }
59
+ if (sessionTokenOf(headers) === void 0) {
60
+ const out = missingTokenReply();
61
+ res.writeHead(out.status, { "content-type": "application/json" }).end(out.body);
62
+ return;
63
+ }
64
+ const out = await forwardSession(this.base, {
65
+ method: req.method ?? "GET",
66
+ pathname: url.pathname,
67
+ search: url.search,
68
+ headers,
69
+ body: Buffer.from(raw, "utf8")
70
+ });
71
+ res.writeHead(out.status, { "content-type": out.contentType ?? "application/json" }).end(out.body);
72
+ }
73
+ async stop() {
74
+ await new Promise((resolve) => this.server?.close(resolve));
75
+ }
76
+ credentials() {
77
+ return {
78
+ portalHost: "trial",
79
+ runnerId: TRIAL_RUNNER_ID,
80
+ runnerToken: this.token
81
+ };
82
+ }
83
+ http() {
84
+ return { request: async (method, path, opts) => {
85
+ const res = await fetch(this.base + path, {
86
+ method,
87
+ headers: {
88
+ "content-type": "application/json",
89
+ authorization: `Bearer ${opts?.leaseToken ?? this.token}`,
90
+ ...opts?.headers ?? {}
91
+ },
92
+ body: opts?.body === void 0 ? void 0 : JSON.stringify(opts.body)
93
+ });
94
+ const text = await res.text();
95
+ let body = void 0;
96
+ try {
97
+ body = text ? JSON.parse(text) : void 0;
98
+ } catch {
99
+ body = text;
100
+ }
101
+ return {
102
+ status: res.status,
103
+ body
104
+ };
105
+ } };
106
+ }
107
+ agentConfig(agentId) {
108
+ return agentId === this.agent.agent_id ? this.agent : void 0;
109
+ }
110
+ machineSettings() {
111
+ return this.settings;
112
+ }
113
+ runtimes() {
114
+ return [];
115
+ }
116
+ onEvent() {
117
+ return () => void 0;
118
+ }
119
+ localRoute(method, path, handler) {
120
+ this.routes.set(`${method} ${path}`, handler);
121
+ }
122
+ localBaseUrl() {
123
+ return this.local;
124
+ }
125
+ log(level, msg, fields) {
126
+ const line = `${(/* @__PURE__ */ new Date()).toISOString()} ${level} ${msg} ${JSON.stringify(fields ?? {})}`;
127
+ if (this.sink) this.sink(line);
128
+ else this.logs.push(line);
129
+ }
130
+ };
131
+ const CAP_RELEASE_PUBLISH = "release_publish";
132
+ const STG_RELEASE_SCHEMA = "stg_release.v1";
133
+ const STAND_IN_ENV_URL = "https://stg.trial-stand-in.invalid/";
134
+ const STAND_IN_TAG = "trial-stand-in";
135
+ const TAGS_SECTION = /# 输入:(?:\w+_)?tags\n\n```json\n([\s\S]*?)\n```/;
136
+ function trialStandIn(m) {
137
+ const schema = m.output_schema?.title;
138
+ if (!m.capabilities?.includes(CAP_RELEASE_PUBLISH) || schema !== STG_RELEASE_SCHEMA) return null;
139
+ const firstRepo = Number(m.task.repos[0]?.repo_id ?? 0);
140
+ const tags = tagFacts(m.prompt).filter((t) => t.tag).map((t) => ({
141
+ repo_id: Number(t.repo_id ?? firstRepo),
142
+ tag: String(t.tag)
143
+ }));
144
+ const fallback = m.task.repos.map((r) => ({
145
+ repo_id: Number(r.repo_id),
146
+ tag: STAND_IN_TAG
147
+ }));
148
+ return {
149
+ schema,
150
+ payload: {
151
+ tags: tags.length > 0 ? tags : fallback,
152
+ env_url: STAND_IN_ENV_URL,
153
+ manual_items: []
154
+ }
155
+ };
156
+ }
157
+ function tagFacts(prompt) {
158
+ const body = TAGS_SECTION.exec(prompt)?.[1];
159
+ if (!body) return [];
160
+ try {
161
+ const v = JSON.parse(body);
162
+ return Array.isArray(v) ? v : [];
163
+ } catch {
164
+ return [];
165
+ }
166
+ }
167
+ const TEST_REPORT_SCHEMA = "test_report.v1";
168
+ const NODE_AGENT = "agent";
169
+ const CASE_PASSED = "passed";
170
+ const MOCK_NOTICE = "【模拟执行,非真实验收】";
171
+ function parseTestSimulation(value, server) {
172
+ const match = /^([\w-]+):([\w-]+):([1-9]\d*)$/.exec(value);
173
+ if (!match || !Number.isSafeInteger(Number(match[3]))) throw new Error("simulate-test must be task:node:generation");
174
+ const url = new URL(server);
175
+ if (url.protocol !== "http:" || !["127.0.0.1", "[::1]"].includes(url.hostname) || url.username || url.password) throw new Error("simulate-test requires an http loopback server");
176
+ return {
177
+ taskNo: match[1],
178
+ nodeId: match[2],
179
+ generation: Number(match[3])
180
+ };
181
+ }
182
+ function trialExecutionStandIn(realStg, simulation) {
183
+ if (!simulation) return realStg ? void 0 : trialStandIn;
184
+ return (m) => {
185
+ if (m.task.task_no !== simulation.taskNo || m.node.id !== simulation.nodeId || m.node.generation !== simulation.generation) return realStg ? null : trialStandIn(m);
186
+ const schema = m.output_schema?.title;
187
+ if (m.node.type !== NODE_AGENT || schema !== TEST_REPORT_SCHEMA) throw new Error("simulate-test target must be an agent with test_report.v1 output");
188
+ return {
189
+ schema: TEST_REPORT_SCHEMA,
190
+ payload: {
191
+ cases: [{
192
+ name: "【模拟】执行替身返回固定成功响应,不是业务断言",
193
+ ac_no: "AC-1",
194
+ result: CASE_PASSED,
195
+ evidence: [`${MOCK_NOTICE}本地试跑执行替身,无真实店铺登录、无业务请求、无业务用例执行。`, "AC-1 是模拟报告契约占位,不表示真实验收标准已满足。"]
196
+ }],
197
+ bugs: [],
198
+ summary: `${MOCK_NOTICE}用户明确授权本次节点按模拟执行推进。作用域:${simulation.taskNo}/${simulation.nodeId}/${simulation.generation}。本报告仅提供执行器的模拟响应以体验流程流转,真实 stg 环境与关联测试计划的全部业务用例均未验证,不能作为上线或业务验收依据。没有发现缺陷的真实结论,bugs 为空仅为模拟占位。后续人工审批仍需用户自行处理。`
199
+ }
200
+ };
201
+ };
202
+ }
203
+ const DEFAULT_TRIAL_SERVER = "http://127.0.0.1:8092/api/v1/autoflow";
204
+ const DEFAULT_POLL_MS = 5e3;
205
+ const DRAIN_TIMEOUT_MS = 3e4;
206
+ const ENV = {
207
+ server: "FORGE_TRIAL_SERVER",
208
+ token: "FORGE_TRIAL_RUNNER_TOKEN",
209
+ agent: "FORGE_TRIAL_AGENT_ID",
210
+ workDir: "FORGE_TRIAL_WORK_DIR",
211
+ claude: "FORGE_TRIAL_CLAUDE_BIN",
212
+ model: "FORGE_TRIAL_MODEL",
213
+ realStg: "FORGE_TRIAL_REAL_STG",
214
+ browserState: "FORGE_TRIAL_BROWSER_STATE"
215
+ };
216
+ function parseTrialArgs(args, env = process.env) {
217
+ const flags = {};
218
+ for (let i = 0; i < args.length; i++) {
219
+ const a = args[i];
220
+ if (a.startsWith("--") && i + 1 < args.length) flags[a.slice(2)] = args[++i];
221
+ }
222
+ const pick = (flag, key) => flags[flag] ?? env[ENV[key]] ?? "";
223
+ const realStg = pick("real-stg", "realStg");
224
+ if (realStg && realStg !== "true" && realStg !== "false") throw new Error("real-stg must be true or false");
225
+ const opts = {
226
+ server: pick("server", "server") || DEFAULT_TRIAL_SERVER,
227
+ token: pick("token", "token"),
228
+ agentId: pick("agent", "agent"),
229
+ workDir: pick("work-dir", "workDir") || join(os.homedir(), ".forge-trial", "work"),
230
+ claudeBin: pick("claude", "claude") || "claude",
231
+ model: pick("model", "model"),
232
+ pollMs: Number(flags["poll-ms"] ?? DEFAULT_POLL_MS),
233
+ realStg: realStg === "true",
234
+ browserState: pick("browser-state", "browserState")
235
+ };
236
+ if (!opts.token || !opts.agentId) throw new Error(`runner trial needs --token and --agent (or ${ENV.token} / ${ENV.agent}); scripts/autoflow-trial/trial.sh runner fills them`);
237
+ if (args.includes("--simulate-test")) opts.testSimulation = parseTestSimulation(flags["simulate-test"] ?? "", opts.server);
238
+ return opts;
239
+ }
240
+ async function runTrial(args) {
241
+ const opts = parseTrialArgs(args);
242
+ await mkdir(opts.workDir, { recursive: true });
243
+ const settings = {
244
+ work_hours_minus_one: false,
245
+ prevent_sleep: "off",
246
+ work_dir: opts.workDir,
247
+ disk_limit_gb: 0,
248
+ cleanup_days: 7,
249
+ offline_remind_hours: 2,
250
+ auto_update: false
251
+ };
252
+ const agent = {
253
+ agent_id: opts.agentId,
254
+ name: "主力",
255
+ instructions: "",
256
+ skill_refs: [],
257
+ runtime_kind: "claude",
258
+ model: opts.model,
259
+ accept_mode: "auto",
260
+ accept_window: "any",
261
+ paused: false
262
+ };
263
+ const host = new HttpHost(opts.server, opts.token, settings, agent, (line) => console.log(line));
264
+ await host.start();
265
+ const executor = new RealExecutor({
266
+ claudeBin: opts.claudeBin,
267
+ standIn: trialExecutionStandIn(opts.realStg, opts.testSimulation),
268
+ browserState: opts.browserState || void 0
269
+ });
270
+ await executor.start(host);
271
+ console.log(`forge trial runner: server=${opts.server} agent=${opts.agentId} work_dir=${opts.workDir} poll=${opts.pollMs}ms real_stg=${opts.realStg} browser_state=${opts.browserState ? "set" : "none"}`);
272
+ let stopping = false;
273
+ const timer = setInterval(() => executor.wake(), opts.pollMs);
274
+ executor.wake();
275
+ await new Promise((resolve) => {
276
+ const stop = () => {
277
+ if (stopping) return;
278
+ stopping = true;
279
+ console.log("forge trial runner: draining…");
280
+ resolve();
281
+ };
282
+ process.once("SIGINT", stop);
283
+ process.once("SIGTERM", stop);
284
+ });
285
+ clearInterval(timer);
286
+ await executor.drain(DRAIN_TIMEOUT_MS);
287
+ await host.stop();
288
+ }
289
+ export { runTrial };
@@ -0,0 +1,82 @@
1
+ import { request } from "node:http";
2
+ import { request as request$1 } from "node:https";
3
+ const SESSION_PATH_PREFIX = "/session/";
4
+ const SESSION_TOKEN_REQUEST_HEADER = "x-forge-session-token";
5
+ const SESSION_TOKEN_UPSTREAM_HEADER = "X-Forge-Session-Token";
6
+ const SESSION_FORWARD_TIMEOUT_MS = 33e4;
7
+ const ERR_SESSION_TOKEN_INVALID = "session_token_invalid";
8
+ const ERR_UPSTREAM_UNREACHABLE = "upstream_unreachable";
9
+ const ERR_UPSTREAM_TIMEOUT = "upstream_timeout";
10
+ const HTTP_UNAUTHORIZED = 401;
11
+ const HTTP_BAD_GATEWAY = 502;
12
+ const HTTP_GATEWAY_TIMEOUT = 504;
13
+ const JSON_TYPE = "application/json";
14
+ const CONTENT_TYPE = "content-type";
15
+ function isSessionPath(pathname) {
16
+ return pathname.startsWith(SESSION_PATH_PREFIX) && pathname.length > 9;
17
+ }
18
+ function sessionTokenOf(headers) {
19
+ const token = headers[SESSION_TOKEN_REQUEST_HEADER];
20
+ return token === void 0 || token.trim() === "" ? void 0 : token;
21
+ }
22
+ function missingTokenReply() {
23
+ return {
24
+ status: HTTP_UNAUTHORIZED,
25
+ body: jsonBody({
26
+ code: ERR_SESSION_TOKEN_INVALID,
27
+ message: `${SESSION_TOKEN_REQUEST_HEADER} header is required`
28
+ }),
29
+ contentType: JSON_TYPE
30
+ };
31
+ }
32
+ function forwardSession(base, req, timeoutMs = SESSION_FORWARD_TIMEOUT_MS) {
33
+ const token = sessionTokenOf(req.headers);
34
+ if (token === void 0) return Promise.resolve(missingTokenReply());
35
+ const url = new URL(base + req.pathname + req.search);
36
+ const payload = req.body;
37
+ const headers = { [SESSION_TOKEN_UPSTREAM_HEADER]: token };
38
+ const contentType = req.headers[CONTENT_TYPE];
39
+ if (contentType !== void 0) headers[CONTENT_TYPE] = contentType;
40
+ if (payload.length > 0) headers["content-length"] = payload.length;
41
+ return new Promise((resolve) => {
42
+ const out = (url.protocol === "https:" ? request$1 : request)(url, {
43
+ method: req.method,
44
+ headers,
45
+ timeout: timeoutMs
46
+ }, (res) => {
47
+ collect(res).then((body) => resolve({
48
+ status: res.statusCode ?? HTTP_BAD_GATEWAY,
49
+ body,
50
+ contentType: res.headers[CONTENT_TYPE]
51
+ }), (e) => resolve(failure(HTTP_BAD_GATEWAY, ERR_UPSTREAM_UNREACHABLE, e)));
52
+ });
53
+ out.on("timeout", () => {
54
+ out.destroy(/* @__PURE__ */ new Error(`no response within ${timeoutMs}ms`));
55
+ resolve(failure(HTTP_GATEWAY_TIMEOUT, ERR_UPSTREAM_TIMEOUT, "upstream timed out"));
56
+ });
57
+ out.on("error", (e) => resolve(failure(HTTP_BAD_GATEWAY, ERR_UPSTREAM_UNREACHABLE, e)));
58
+ out.end(payload);
59
+ });
60
+ }
61
+ function collect(res) {
62
+ return new Promise((resolve, reject) => {
63
+ const chunks = [];
64
+ res.on("data", (c) => chunks.push(c));
65
+ res.on("end", () => resolve(Buffer.concat(chunks)));
66
+ res.on("error", reject);
67
+ });
68
+ }
69
+ function failure(status, code, cause) {
70
+ return {
71
+ status,
72
+ body: jsonBody({
73
+ code,
74
+ message: cause instanceof Error ? cause.message : String(cause)
75
+ }),
76
+ contentType: JSON_TYPE
77
+ };
78
+ }
79
+ function jsonBody(v) {
80
+ return Buffer.from(JSON.stringify(v), "utf8");
81
+ }
82
+ export { sessionTokenOf as i, isSessionPath as n, missingTokenReply as r, forwardSession as t };
@@ -1,4 +1,7 @@
1
- import { loadConfig, runLogin } from "../cli.mjs";
1
+ import "./rolldown-runtime.mjs";
2
+ import "./libs/@clack/core.mjs";
3
+ import "./libs/@clack/prompts.mjs";
4
+ import { i as loadConfig, n as runLogin } from "../cli.mjs";
2
5
  import { readFileSync, readSync } from "fs";
3
6
  function parseGlobalFlags(args) {
4
7
  const flags = { json: false };
@@ -137,9 +140,6 @@ function printPagination(total) {
137
140
  console.log(`${DIM}(${total} items)${RESET}`);
138
141
  }
139
142
  var ApiError = class extends Error {
140
- status;
141
- code;
142
- data;
143
143
  constructor(status, code, message, data) {
144
144
  super(message);
145
145
  this.status = status;
@@ -148,9 +148,6 @@ var ApiError = class extends Error {
148
148
  }
149
149
  };
150
150
  var TestPlatformClient = class TestPlatformClient {
151
- baseUrl;
152
- token;
153
- interactive;
154
151
  constructor(baseUrl, token, interactive) {
155
152
  this.baseUrl = baseUrl;
156
153
  this.token = token;
@@ -1111,7 +1108,7 @@ async function get(client, args, json) {
1111
1108
  const marks = [];
1112
1109
  if (c["status"] === "deprecated") marks.push("已废弃 · 不计入进度");
1113
1110
  if (c["in_source_set"] === false) marks.push("已离开来源集");
1114
- if (c["content_updated"] === true) marks.push(`正文已更新 v${c["case_version_at_add"]}→v${c["current_version"]}`);
1111
+ if (c["content_updated"] === true) marks.push(`加入后改过 v${c["case_version_at_add"]}→v${c["current_version"]}`);
1115
1112
  const suffix = marks.length ? ` [${marks.join(" · ")}]` : "";
1116
1113
  console.log(` [${c["case_id"]}] ${c["title"]} (${c["priority"] || "—"})${suffix}`);
1117
1114
  }
@@ -1333,7 +1330,7 @@ function printStatus(data, status) {
1333
1330
  printKV([
1334
1331
  ["工单", data["ticket"] ?? "—"],
1335
1332
  ["产品线", data["product_line"] ?? "—"],
1336
- ["改了什么", data["changes_path"] ?? "—"]
1333
+ ["接口文档", data["doc_url"] ?? "—"]
1337
1334
  ]);
1338
1335
  return;
1339
1336
  }