@kevlns/v-cli 0.4.9 → 0.5.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.
package/AGENTS.md CHANGED
@@ -18,7 +18,7 @@
18
18
 
19
19
  ### 核心约定(v-cli 本体)
20
20
 
21
- - 环境要求 Node.js >= 20;v-cli 版本 @kevlns/v-cli@0.4.9
21
+ - 环境要求 Node.js >= 20;v-cli 版本 @kevlns/v-cli@0.5.1
22
22
  - 命令分三类:builtin(内置)、local(~/.vant/tools/v-cli/commands/ 下的本地插件)、official(官方插件白名单);
23
23
  **命令集合以实际发现为准**:先运行 `v-cli agent index --json` 获取全部命令与 agent 元数据
24
24
  - 单个命令的完整元数据用 `v-cli agent describe <命令名> --json` 查看
@@ -48,7 +48,7 @@
48
48
 
49
49
  ### @kevlns/art-workshop — 命令 `v-cli art …`
50
50
 
51
- **版本**:0.3.11
51
+ **版本**:0.4.1
52
52
  **描述**:管理项目风格、参考图、图片生成、编辑和定版。支持本地 ComfyUI 与远程图片模型。
53
53
  **平台**:win32, linux, darwin
54
54
 
package/dist/cli.mjs CHANGED
@@ -658,7 +658,7 @@ import { createHash, randomBytes } from "crypto";
658
658
  import { fileURLToPath as fileURLToPath2 } from "url";
659
659
 
660
660
  // src/version.ts
661
- var VERSION = "0.4.9";
661
+ var VERSION = "0.5.1";
662
662
 
663
663
  // src/core/agent-docs.ts
664
664
  var BUNDLED_DOCS_FILE = "AGENTS.md";
@@ -1499,7 +1499,7 @@ function resolveProjectRoot(input, cwd = process.cwd()) {
1499
1499
  }
1500
1500
  let realRoot;
1501
1501
  try {
1502
- realRoot = fs5.realpathSync(root2);
1502
+ realRoot = fs5.realpathSync.native(root2);
1503
1503
  } catch (err) {
1504
1504
  throw new PathSafetyError(
1505
1505
  "project-root-unreadable",
@@ -1552,7 +1552,7 @@ function resolveInsideProject(project2, relative, label) {
1552
1552
  const existingAncestor = deepestExisting(target, project2.realRoot);
1553
1553
  let ancestorReal;
1554
1554
  try {
1555
- ancestorReal = fs5.realpathSync(existingAncestor);
1555
+ ancestorReal = fs5.realpathSync.native(existingAncestor);
1556
1556
  } catch (err) {
1557
1557
  throw new PathSafetyError(
1558
1558
  "path-unresolvable",
@@ -1571,7 +1571,7 @@ function resolveInsideProject(project2, relative, label) {
1571
1571
  if (lst.isSymbolicLink()) {
1572
1572
  throw new PathSafetyError("path-symlink", `${label} \u662F\u7B26\u53F7\u94FE\u63A5/\u8054\u63A5\uFF0C\u62D2\u7EDD\u5199\u5165\u6216\u8DDF\u968F: ${target}`);
1573
1573
  }
1574
- realPath = fs5.realpathSync(target);
1574
+ realPath = fs5.realpathSync.native(target);
1575
1575
  if (!isInside(project2.realRoot, realPath)) {
1576
1576
  throw new PathSafetyError("path-escape", `${label} \u7684\u771F\u5B9E\u8DEF\u5F84\u9003\u9038\u5DE5\u7A0B\u6839: ${realPath}`);
1577
1577
  }
@@ -1628,14 +1628,14 @@ async function remove(file2) {
1628
1628
  if (e.code !== "ENOENT") throw e;
1629
1629
  }
1630
1630
  }
1631
- async function acquireResources(project2, resources, bindingPaths = []) {
1631
+ async function acquireResources(project2, resources, bindingPaths = [], options = {}) {
1632
1632
  if (!resources.length)
1633
1633
  return Object.assign(async () => {
1634
1634
  }, { transfer: async () => false });
1635
1635
  const dir = root();
1636
1636
  fs6.mkdirSync(dir, { recursive: true });
1637
1637
  const paths = [project2, ...bindingPaths].map(
1638
- (p) => comparePathForm(fs6.existsSync(p) ? fs6.realpathSync(p) : path8.resolve(p))
1638
+ (p) => comparePathForm(fs6.existsSync(p) ? fs6.realpathSync.native(p) : path8.resolve(p))
1639
1639
  );
1640
1640
  const claim = {
1641
1641
  token: randomUUID(),
@@ -1654,31 +1654,42 @@ async function acquireResources(project2, resources, bindingPaths = []) {
1654
1654
  if (fs6.existsSync(temp)) await remove(temp);
1655
1655
  }
1656
1656
  }
1657
- await write();
1657
+ const deadline = Date.now() + (options.timeoutMs ?? 9e4);
1658
1658
  let transferred = false;
1659
- try {
1660
- for (const name of fs6.readdirSync(dir).filter((n) => n.endsWith(".json"))) {
1661
- const existing = path8.join(dir, name);
1662
- if (existing === file2) continue;
1663
- let other;
1664
- try {
1665
- other = JSON.parse(
1666
- await retryFile(() => fs6.readFileSync(existing, "utf8"))
1667
- );
1668
- } catch (error) {
1669
- if (error.code === "ENOENT") continue;
1670
- throw error;
1671
- }
1672
- if (!alive(other.pid)) {
1673
- await remove(existing);
1674
- continue;
1659
+ for (; ; ) {
1660
+ options.signal?.throwIfAborted();
1661
+ await write();
1662
+ try {
1663
+ let localBusy = false;
1664
+ for (const name of fs6.readdirSync(dir).filter((n) => n.endsWith(".json"))) {
1665
+ const existing = path8.join(dir, name);
1666
+ if (existing === file2) continue;
1667
+ let other;
1668
+ try {
1669
+ other = JSON.parse(
1670
+ await retryFile(() => fs6.readFileSync(existing, "utf8"))
1671
+ );
1672
+ } catch (error) {
1673
+ if (error.code === "ENOENT") continue;
1674
+ throw error;
1675
+ }
1676
+ if (!alive(other.pid)) {
1677
+ await remove(existing);
1678
+ continue;
1679
+ }
1680
+ if (conflicts(claim, other)) {
1681
+ if (other.pid === process.pid && options.waitForLocal) localBusy = true;
1682
+ else throw Error(`\u8D44\u6E90\u6B63\u88AB\u8FDB\u7A0B ${other.pid} \u4F7F\u7528`);
1683
+ }
1675
1684
  }
1676
- if (conflicts(claim, other))
1677
- throw Error(`\u8D44\u6E90\u6B63\u88AB\u8FDB\u7A0B ${other.pid} \u4F7F\u7528`);
1685
+ if (!localBusy) break;
1686
+ await remove(file2);
1687
+ if (Date.now() >= deadline) throw Error("\u7B49\u5F85\u5F53\u524D\u670D\u52A1\u7684\u8D44\u6E90\u64CD\u4F5C\u5B8C\u6210\u8D85\u65F6");
1688
+ await pause();
1689
+ } catch (error) {
1690
+ await remove(file2);
1691
+ throw error;
1678
1692
  }
1679
- } catch (error) {
1680
- await remove(file2);
1681
- throw error;
1682
1693
  }
1683
1694
  return Object.assign(
1684
1695
  async () => {
@@ -3359,9 +3370,14 @@ async function runCapability(registry, request, deps = {}) {
3359
3370
  }
3360
3371
  let releaseResources;
3361
3372
  try {
3362
- releaseResources = await acquireResources(project2.realRoot, entry.descriptor.resources, Object.values(providerBindingDirs));
3373
+ releaseResources = await acquireResources(project2.realRoot, entry.descriptor.resources, Object.values(providerBindingDirs), {
3374
+ waitForLocal: true,
3375
+ signal,
3376
+ timeoutMs: entry.descriptor.timeoutMs
3377
+ });
3363
3378
  store.event("resources-acquired", "\u5DF2\u53D6\u5F97\u8DE8\u8FDB\u7A0B\u8D44\u6E90\u79DF\u7EA6");
3364
3379
  } catch (error) {
3380
+ if (signal.aborted) return cancelledBeforeExecution();
3365
3381
  return finish({
3366
3382
  command: null,
3367
3383
  execution: {
@@ -7178,6 +7194,7 @@ var identifier = {
7178
7194
  type: "string",
7179
7195
  pattern: "^[a-z0-9][a-z0-9-]{0,63}$"
7180
7196
  };
7197
+ var guideId = { type: "string", minLength: 1, maxLength: 128, pattern: "^[A-Za-z0-9][A-Za-z0-9._-]*$" };
7181
7198
  var revision = { type: "integer", minimum: 1 };
7182
7199
  var file = {
7183
7200
  type: "string",
@@ -7228,8 +7245,8 @@ var definitions3 = [
7228
7245
  { id: "agent-docs", command: ["agent", "docs"], fields: {}, readonly: true, text: true, global: true },
7229
7246
  { id: "agent-init", command: ["agent", "init"], fields: { directory: file, dry: { type: "boolean" } }, required: ["directory"], global: true },
7230
7247
  { id: "list", command: ["list"], fields: {}, readonly: true, global: true },
7231
- { id: "style-validate", command: ["style", "validate"], fields: { report: file }, readonly: true },
7232
- { id: "style-show", command: ["style", "show"], fields: { core: identifier }, readonly: true },
7248
+ { id: "style-validate", command: ["style", "validate"], fields: { report: file }, required: ["report"], readonly: true },
7249
+ { id: "style-show", command: ["style", "show"], fields: { core: identifier }, required: ["core"], readonly: true },
7233
7250
  ...["generate", "edit"].map((kind) => ({ id: kind + "-show", command: [kind, "show"], fields: { job: identifier }, required: ["job"], readonly: true })),
7234
7251
  { id: "check", command: ["check"], fields: { run: file }, required: ["run"], positional: ["run"], readonly: true, global: true },
7235
7252
  { id: "compare", command: ["compare"], fields: { before: file, after: file }, required: ["before", "after"], positional: ["before", "after"], readonly: true, global: true },
@@ -7237,19 +7254,20 @@ var definitions3 = [
7237
7254
  { id: "shutdown", command: ["shutdown"], fields: {}, network: true, global: true },
7238
7255
  { id: "doctor", command: ["doctor"], fields: { backend: identifier, start: { type: "boolean" } }, network: true, global: true },
7239
7256
  { id: "workflow-list", command: ["workflow", "list"], fields: {}, readonly: true, global: true },
7240
- ...["guide", "list", "inspect", "verify", "register", "unregister"].map((action) => ({
7257
+ ...["guide", "list", "prepare", "inspect", "verify", "register", "unregister"].map((action) => ({
7241
7258
  id: "environment-" + action,
7242
7259
  command: ["environment", action],
7243
7260
  global: true,
7244
- fields: ["guide", "list"].includes(action) ? { guide: identifier } : action === "unregister" ? { directory: { type: "string", minLength: 1 } } : { directory: { type: "string", minLength: 1 }, endpoint: { type: "string", minLength: 1 }, guide: identifier },
7261
+ fields: ["guide", "list"].includes(action) ? { guide: guideId } : action === "unregister" ? { directory: { type: "string", minLength: 1 } } : { directory: { type: "string", minLength: 1 }, endpoint: { type: "string", minLength: 1 }, guide: guideId },
7245
7262
  required: ["guide", "list"].includes(action) ? [] : action === "unregister" ? ["directory"] : ["directory", "endpoint"],
7246
- readonly: !["register", "unregister"].includes(action),
7247
- network: ["inspect", "verify", "register"].includes(action)
7263
+ readonly: !["prepare", "register", "unregister"].includes(action),
7264
+ network: ["prepare", "inspect", "verify", "register"].includes(action)
7248
7265
  })),
7249
7266
  { id: "project-upgrade", command: ["project", "upgrade"], fields: { dry: { type: "boolean" }, mapping: file } },
7250
7267
  { id: "job-template", command: ["job", "template"], fields: { kind: { type: "string", enum: ["generate", "edit"] }, core: identifier }, required: ["kind"], readonly: true },
7251
7268
  { id: "job-from-candidate", command: ["job", "from-candidate"], fields: { id: identifier, run: identifier, candidate: { type: "string", pattern: "^[a-f0-9]{64}$" } }, required: ["id", "run", "candidate"] },
7252
7269
  { id: "run-recover", command: ["task", "recover"], fields: { operation: { type: "string", pattern: "^[a-z0-9-]{1,128}$" } }, required: ["operation"], start: true },
7270
+ { id: "job-restore", command: ["job", "restore"], fields: { id: identifier, revision }, required: ["id", "revision"] },
7253
7271
  ...["style", "job"].flatMap(
7254
7272
  (kind) => ["create", "list", "read", "update", "derive", "discard"].map(
7255
7273
  (action) => ({
@@ -7285,6 +7303,7 @@ var definitions3 = [
7285
7303
  { id: "style-export", command: ["style", "export"], fields: { id: identifier, out: file }, required: ["id", "out"] },
7286
7304
  { id: "style-import", command: ["style", "import"], fields: { file }, required: ["file"] },
7287
7305
  { id: "style-sources", command: ["style", "sources"], fields: { input: file }, required: ["input"], readonly: true, global: true },
7306
+ { id: "style-revise", command: ["style", "revise"], fields: objectFields, required: ["id", "revision", "input"] },
7288
7307
  { id: "style-resolve", command: ["style", "resolve"], fields: objectFields, required: ["id", "revision", "input"] },
7289
7308
  {
7290
7309
  id: "style-adopt",
@@ -7393,7 +7412,9 @@ var definitions3 = [
7393
7412
  ],
7394
7413
  readonly: ["list", "finalizations"].includes(action)
7395
7414
  })
7396
- )
7415
+ ),
7416
+ { id: "candidate-favorites", command: ["candidate", "favorites"], fields: {}, readonly: true },
7417
+ { id: "candidate-favorite", command: ["candidate", "favorite"], fields: { job: identifier, run: identifier, candidate: { type: "string", pattern: "^[a-f0-9]{64}$" }, value: { type: "string", enum: ["true", "false"] } }, required: ["job", "run", "candidate", "value"] }
7397
7418
  ];
7398
7419
  function createArtProvider(deps) {
7399
7420
  const discover = deps.discoverBackend ?? (() => discoverOfficialPlugin(
@@ -7462,7 +7483,7 @@ function createArtProvider(deps) {
7462
7483
  strategy: "none",
7463
7484
  description: "\u542F\u52A8\u4E0D\u81EA\u52A8\u91CD\u8BD5\uFF1B\u6062\u590D\u67E5\u8BE2\u539F\u53E5\u67C4"
7464
7485
  },
7465
- timeoutMs: 9e4,
7486
+ timeoutMs: d.id === "environment-prepare" ? 18e5 : ["environment-verify", "environment-register"].includes(d.id) ? 72e5 : 9e4,
7466
7487
  tags: ["art", "lifecycle"]
7467
7488
  },
7468
7489
  implementation: {
@@ -7535,7 +7556,7 @@ function createArtProvider(deps) {
7535
7556
  args: [backend.bin, ...argv],
7536
7557
  cwd: ctx.projectAnchor.root,
7537
7558
  env: deps.env,
7538
- timeoutMs: 9e4,
7559
+ timeoutMs: d.id === "environment-prepare" ? 18e5 : ["environment-verify", "environment-register"].includes(d.id) ? 72e5 : 9e4,
7539
7560
  signal: ctx.signal
7540
7561
  });
7541
7562
  let output;
package/dist/sdk.d.ts CHANGED
@@ -1150,7 +1150,7 @@ declare function redactArgv(argv: string[]): RedactionResult<string[]>;
1150
1150
  declare const REDACTION_PLACEHOLDER = "***redacted***";
1151
1151
 
1152
1152
  /** 版本常量:与 package.json 保持一致(有测试保证) */
1153
- declare const VERSION = "0.4.9";
1153
+ declare const VERSION = "0.5.1";
1154
1154
 
1155
1155
  /** 已发布命令清单与真实注册表逐项对照,不从命名猜测覆盖。 */
1156
1156
  declare function capabilityCoverage(registry: CapabilityRegistry): {
package/dist/sdk.mjs CHANGED
@@ -668,7 +668,7 @@ function resolveProjectRoot(input, cwd = process.cwd()) {
668
668
  }
669
669
  let realRoot;
670
670
  try {
671
- realRoot = fs.realpathSync(root2);
671
+ realRoot = fs.realpathSync.native(root2);
672
672
  } catch (err) {
673
673
  throw new PathSafetyError(
674
674
  "project-root-unreadable",
@@ -721,7 +721,7 @@ function resolveInsideProject(project, relative, label) {
721
721
  const existingAncestor = deepestExisting(target, project.realRoot);
722
722
  let ancestorReal;
723
723
  try {
724
- ancestorReal = fs.realpathSync(existingAncestor);
724
+ ancestorReal = fs.realpathSync.native(existingAncestor);
725
725
  } catch (err) {
726
726
  throw new PathSafetyError(
727
727
  "path-unresolvable",
@@ -740,7 +740,7 @@ function resolveInsideProject(project, relative, label) {
740
740
  if (lst.isSymbolicLink()) {
741
741
  throw new PathSafetyError("path-symlink", `${label} \u662F\u7B26\u53F7\u94FE\u63A5/\u8054\u63A5\uFF0C\u62D2\u7EDD\u5199\u5165\u6216\u8DDF\u968F: ${target}`);
742
742
  }
743
- realPath = fs.realpathSync(target);
743
+ realPath = fs.realpathSync.native(target);
744
744
  if (!isInside(project.realRoot, realPath)) {
745
745
  throw new PathSafetyError("path-escape", `${label} \u7684\u771F\u5B9E\u8DEF\u5F84\u9003\u9038\u5DE5\u7A0B\u6839: ${realPath}`);
746
746
  }
@@ -797,14 +797,14 @@ async function remove(file2) {
797
797
  if (e.code !== "ENOENT") throw e;
798
798
  }
799
799
  }
800
- async function acquireResources(project, resources, bindingPaths = []) {
800
+ async function acquireResources(project, resources, bindingPaths = [], options = {}) {
801
801
  if (!resources.length)
802
802
  return Object.assign(async () => {
803
803
  }, { transfer: async () => false });
804
804
  const dir = root();
805
805
  fs2.mkdirSync(dir, { recursive: true });
806
806
  const paths = [project, ...bindingPaths].map(
807
- (p) => comparePathForm(fs2.existsSync(p) ? fs2.realpathSync(p) : path2.resolve(p))
807
+ (p) => comparePathForm(fs2.existsSync(p) ? fs2.realpathSync.native(p) : path2.resolve(p))
808
808
  );
809
809
  const claim = {
810
810
  token: randomUUID(),
@@ -823,31 +823,42 @@ async function acquireResources(project, resources, bindingPaths = []) {
823
823
  if (fs2.existsSync(temp)) await remove(temp);
824
824
  }
825
825
  }
826
- await write();
826
+ const deadline = Date.now() + (options.timeoutMs ?? 9e4);
827
827
  let transferred = false;
828
- try {
829
- for (const name of fs2.readdirSync(dir).filter((n) => n.endsWith(".json"))) {
830
- const existing = path2.join(dir, name);
831
- if (existing === file2) continue;
832
- let other;
833
- try {
834
- other = JSON.parse(
835
- await retryFile(() => fs2.readFileSync(existing, "utf8"))
836
- );
837
- } catch (error) {
838
- if (error.code === "ENOENT") continue;
839
- throw error;
840
- }
841
- if (!alive(other.pid)) {
842
- await remove(existing);
843
- continue;
828
+ for (; ; ) {
829
+ options.signal?.throwIfAborted();
830
+ await write();
831
+ try {
832
+ let localBusy = false;
833
+ for (const name of fs2.readdirSync(dir).filter((n) => n.endsWith(".json"))) {
834
+ const existing = path2.join(dir, name);
835
+ if (existing === file2) continue;
836
+ let other;
837
+ try {
838
+ other = JSON.parse(
839
+ await retryFile(() => fs2.readFileSync(existing, "utf8"))
840
+ );
841
+ } catch (error) {
842
+ if (error.code === "ENOENT") continue;
843
+ throw error;
844
+ }
845
+ if (!alive(other.pid)) {
846
+ await remove(existing);
847
+ continue;
848
+ }
849
+ if (conflicts(claim, other)) {
850
+ if (other.pid === process.pid && options.waitForLocal) localBusy = true;
851
+ else throw Error(`\u8D44\u6E90\u6B63\u88AB\u8FDB\u7A0B ${other.pid} \u4F7F\u7528`);
852
+ }
844
853
  }
845
- if (conflicts(claim, other))
846
- throw Error(`\u8D44\u6E90\u6B63\u88AB\u8FDB\u7A0B ${other.pid} \u4F7F\u7528`);
854
+ if (!localBusy) break;
855
+ await remove(file2);
856
+ if (Date.now() >= deadline) throw Error("\u7B49\u5F85\u5F53\u524D\u670D\u52A1\u7684\u8D44\u6E90\u64CD\u4F5C\u5B8C\u6210\u8D85\u65F6");
857
+ await pause();
858
+ } catch (error) {
859
+ await remove(file2);
860
+ throw error;
847
861
  }
848
- } catch (error) {
849
- await remove(file2);
850
- throw error;
851
862
  }
852
863
  return Object.assign(
853
864
  async () => {
@@ -2301,9 +2312,14 @@ async function runCapability(registry, request, deps = {}) {
2301
2312
  }
2302
2313
  let releaseResources;
2303
2314
  try {
2304
- releaseResources = await acquireResources(project.realRoot, entry.descriptor.resources, Object.values(providerBindingDirs));
2315
+ releaseResources = await acquireResources(project.realRoot, entry.descriptor.resources, Object.values(providerBindingDirs), {
2316
+ waitForLocal: true,
2317
+ signal,
2318
+ timeoutMs: entry.descriptor.timeoutMs
2319
+ });
2305
2320
  store.event("resources-acquired", "\u5DF2\u53D6\u5F97\u8DE8\u8FDB\u7A0B\u8D44\u6E90\u79DF\u7EA6");
2306
2321
  } catch (error) {
2322
+ if (signal.aborted) return cancelledBeforeExecution();
2307
2323
  return finish({
2308
2324
  command: null,
2309
2325
  execution: {
@@ -6219,6 +6235,7 @@ var identifier = {
6219
6235
  type: "string",
6220
6236
  pattern: "^[a-z0-9][a-z0-9-]{0,63}$"
6221
6237
  };
6238
+ var guideId = { type: "string", minLength: 1, maxLength: 128, pattern: "^[A-Za-z0-9][A-Za-z0-9._-]*$" };
6222
6239
  var revision = { type: "integer", minimum: 1 };
6223
6240
  var file = {
6224
6241
  type: "string",
@@ -6269,8 +6286,8 @@ var definitions3 = [
6269
6286
  { id: "agent-docs", command: ["agent", "docs"], fields: {}, readonly: true, text: true, global: true },
6270
6287
  { id: "agent-init", command: ["agent", "init"], fields: { directory: file, dry: { type: "boolean" } }, required: ["directory"], global: true },
6271
6288
  { id: "list", command: ["list"], fields: {}, readonly: true, global: true },
6272
- { id: "style-validate", command: ["style", "validate"], fields: { report: file }, readonly: true },
6273
- { id: "style-show", command: ["style", "show"], fields: { core: identifier }, readonly: true },
6289
+ { id: "style-validate", command: ["style", "validate"], fields: { report: file }, required: ["report"], readonly: true },
6290
+ { id: "style-show", command: ["style", "show"], fields: { core: identifier }, required: ["core"], readonly: true },
6274
6291
  ...["generate", "edit"].map((kind) => ({ id: kind + "-show", command: [kind, "show"], fields: { job: identifier }, required: ["job"], readonly: true })),
6275
6292
  { id: "check", command: ["check"], fields: { run: file }, required: ["run"], positional: ["run"], readonly: true, global: true },
6276
6293
  { id: "compare", command: ["compare"], fields: { before: file, after: file }, required: ["before", "after"], positional: ["before", "after"], readonly: true, global: true },
@@ -6278,19 +6295,20 @@ var definitions3 = [
6278
6295
  { id: "shutdown", command: ["shutdown"], fields: {}, network: true, global: true },
6279
6296
  { id: "doctor", command: ["doctor"], fields: { backend: identifier, start: { type: "boolean" } }, network: true, global: true },
6280
6297
  { id: "workflow-list", command: ["workflow", "list"], fields: {}, readonly: true, global: true },
6281
- ...["guide", "list", "inspect", "verify", "register", "unregister"].map((action) => ({
6298
+ ...["guide", "list", "prepare", "inspect", "verify", "register", "unregister"].map((action) => ({
6282
6299
  id: "environment-" + action,
6283
6300
  command: ["environment", action],
6284
6301
  global: true,
6285
- fields: ["guide", "list"].includes(action) ? { guide: identifier } : action === "unregister" ? { directory: { type: "string", minLength: 1 } } : { directory: { type: "string", minLength: 1 }, endpoint: { type: "string", minLength: 1 }, guide: identifier },
6302
+ fields: ["guide", "list"].includes(action) ? { guide: guideId } : action === "unregister" ? { directory: { type: "string", minLength: 1 } } : { directory: { type: "string", minLength: 1 }, endpoint: { type: "string", minLength: 1 }, guide: guideId },
6286
6303
  required: ["guide", "list"].includes(action) ? [] : action === "unregister" ? ["directory"] : ["directory", "endpoint"],
6287
- readonly: !["register", "unregister"].includes(action),
6288
- network: ["inspect", "verify", "register"].includes(action)
6304
+ readonly: !["prepare", "register", "unregister"].includes(action),
6305
+ network: ["prepare", "inspect", "verify", "register"].includes(action)
6289
6306
  })),
6290
6307
  { id: "project-upgrade", command: ["project", "upgrade"], fields: { dry: { type: "boolean" }, mapping: file } },
6291
6308
  { id: "job-template", command: ["job", "template"], fields: { kind: { type: "string", enum: ["generate", "edit"] }, core: identifier }, required: ["kind"], readonly: true },
6292
6309
  { id: "job-from-candidate", command: ["job", "from-candidate"], fields: { id: identifier, run: identifier, candidate: { type: "string", pattern: "^[a-f0-9]{64}$" } }, required: ["id", "run", "candidate"] },
6293
6310
  { id: "run-recover", command: ["task", "recover"], fields: { operation: { type: "string", pattern: "^[a-z0-9-]{1,128}$" } }, required: ["operation"], start: true },
6311
+ { id: "job-restore", command: ["job", "restore"], fields: { id: identifier, revision }, required: ["id", "revision"] },
6294
6312
  ...["style", "job"].flatMap(
6295
6313
  (kind) => ["create", "list", "read", "update", "derive", "discard"].map(
6296
6314
  (action) => ({
@@ -6326,6 +6344,7 @@ var definitions3 = [
6326
6344
  { id: "style-export", command: ["style", "export"], fields: { id: identifier, out: file }, required: ["id", "out"] },
6327
6345
  { id: "style-import", command: ["style", "import"], fields: { file }, required: ["file"] },
6328
6346
  { id: "style-sources", command: ["style", "sources"], fields: { input: file }, required: ["input"], readonly: true, global: true },
6347
+ { id: "style-revise", command: ["style", "revise"], fields: objectFields, required: ["id", "revision", "input"] },
6329
6348
  { id: "style-resolve", command: ["style", "resolve"], fields: objectFields, required: ["id", "revision", "input"] },
6330
6349
  {
6331
6350
  id: "style-adopt",
@@ -6434,7 +6453,9 @@ var definitions3 = [
6434
6453
  ],
6435
6454
  readonly: ["list", "finalizations"].includes(action)
6436
6455
  })
6437
- )
6456
+ ),
6457
+ { id: "candidate-favorites", command: ["candidate", "favorites"], fields: {}, readonly: true },
6458
+ { id: "candidate-favorite", command: ["candidate", "favorite"], fields: { job: identifier, run: identifier, candidate: { type: "string", pattern: "^[a-f0-9]{64}$" }, value: { type: "string", enum: ["true", "false"] } }, required: ["job", "run", "candidate", "value"] }
6438
6459
  ];
6439
6460
  function createArtProvider(deps) {
6440
6461
  const discover = deps.discoverBackend ?? (() => discoverOfficialPlugin(
@@ -6503,7 +6524,7 @@ function createArtProvider(deps) {
6503
6524
  strategy: "none",
6504
6525
  description: "\u542F\u52A8\u4E0D\u81EA\u52A8\u91CD\u8BD5\uFF1B\u6062\u590D\u67E5\u8BE2\u539F\u53E5\u67C4"
6505
6526
  },
6506
- timeoutMs: 9e4,
6527
+ timeoutMs: d.id === "environment-prepare" ? 18e5 : ["environment-verify", "environment-register"].includes(d.id) ? 72e5 : 9e4,
6507
6528
  tags: ["art", "lifecycle"]
6508
6529
  },
6509
6530
  implementation: {
@@ -6576,7 +6597,7 @@ function createArtProvider(deps) {
6576
6597
  args: [backend.bin, ...argv],
6577
6598
  cwd: ctx.projectAnchor.root,
6578
6599
  env: deps.env,
6579
- timeoutMs: 9e4,
6600
+ timeoutMs: d.id === "environment-prepare" ? 18e5 : ["environment-verify", "environment-register"].includes(d.id) ? 72e5 : 9e4,
6580
6601
  signal: ctx.signal
6581
6602
  });
6582
6603
  let output;
@@ -7392,7 +7413,7 @@ function createDefaultRegistry(options = {}) {
7392
7413
  }
7393
7414
 
7394
7415
  // src/version.ts
7395
- var VERSION = "0.4.9";
7416
+ var VERSION = "0.5.1";
7396
7417
 
7397
7418
  // src/capability-coverage.ts
7398
7419
  function capabilityCoverage(registry) {
@@ -45,7 +45,7 @@ Unity runId 要求匹配实际路由及工程适配包。命令层单槽位仍
45
45
 
46
46
  art 的 queued/running/cancelling 占用对象;failed/cancelled 只有停止证据完整才释放。unknown、unsettled、promptId、remoteCancellation 或 dispatching/accepted 远程回执都阻止判为空闲。
47
47
 
48
- 远程回执先持久化 dispatching 再提交,先 accepted+taskId 再查询,先 completed+urls 再下载。task resume 只恢复 accepted/completed 的原身份,不发生成 POST、不补发未提交项;无上游 ID 的 dispatching 保持未知。
48
+ 远程回执先持久化 dispatching 再提交,先 accepted+taskId 再查询,先 completed+urls 再下载。task resume 按远程 accepted/completed 回执或本地 ComfyUI 已持久化的 prompt ID 恢复原身份,不发生成 POST、不补发未提交项;无上游 ID 的 dispatching 保持未知。
49
49
 
50
50
  恢复原运行、重试明确失败项、重新编辑配置产生的新批次是三种不同操作。成功项不重跑,上游完成待下载项走原结果取回;配置变化需重新预演。准确行为由 art 随包规范和当前实现负责。
51
51
 
@@ -38,6 +38,8 @@ src/providers/figma/protocol.ts 按 stdout/stderr 分流解释真实工具输出
38
38
 
39
39
  src/providers/art/index.ts 解释工具 JSON,保留原 taskId/deploymentId、状态、停止确认与诊断。启动仅生成可追踪句柄,不把 queued/running 当完成。status/cancel/resume 先校验原 handle,按原 backendTaskId 路由。
40
40
 
41
+ 运行结果透传 itemStates 和 resultVersion,按提交的资产及变体记录进度;批次仍 running 时已有对象可以完成,不能用批次状态覆盖逐项结果。归档与恢复使用 job-discard/job-restore,收藏使用 candidate-favorite/candidate-favorites,规则修订使用 style-revise,均通过同一结构化能力契约。
42
+
41
43
  图片协议与参数由 art 工具的 model-registry/generation-policy/adapters 负责。v-cli 不根据 Qwen/Wan 名称、provider 名或订阅渠道猜测请求格式。明确失败、停止未知、上游已完成待下载分别保留,不自动重发。
42
44
 
43
45
  工具 stdout 必须是可解释的契约结果;原始日志或错误体不能当成功 JSON。凭据经受控环境注入,不写 argv、项目输入或证据。远端提供方响应也不能作为新的任务指令。
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kevlns/v-cli",
3
- "version": "0.4.9",
3
+ "version": "0.5.1",
4
4
  "description": "提供工具发现、插件路由、工程绑定、结构化能力执行和操作证据管理。",
5
5
  "type": "module",
6
6
  "bin": {
@@ -56,7 +56,7 @@
56
56
  "toolbox"
57
57
  ],
58
58
  "dependencies": {
59
- "@kevlns/art-workshop": "0.3.11",
59
+ "@kevlns/art-workshop": "0.4.1",
60
60
  "@kevlns/figma-to-uprefab": "0.1.4",
61
61
  "@kevlns/ship-cli": "0.1.2",
62
62
  "@kevlns/u-cli-mod": "0.3.1",