@insmind/cli 1.5.0 → 1.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.
@@ -6,7 +6,7 @@ export function registerModelCommands(program, runtime) {
6
6
  .description(text(runtime.product, "创作模型", "Creation models"))
7
7
  .helpCommand(false);
8
8
  const list = model.command("list")
9
- .description(text(runtime.product, "列出可用模型", "List available models"))
9
+ .description(text(runtime.product, "列出图片/视频生成模型(不含独立风格)", "List image/video generation models (excluding standalone styles)"))
10
10
  .option("--tool <tool>", text(runtime.product, "按工具筛选", "filter by tool"))
11
11
  .allowExcessArguments(false);
12
12
  bindAction(list, "organization", async (context, signal) => {
@@ -1,12 +1,10 @@
1
1
  import { RemoteRequestError } from "../../platform/signed-http-transport.js";
2
2
  export const ROOT_SCENE_CODES = [
3
3
  "image-model-art",
4
- "AI-image-generation-art",
5
4
  "AI-video-generation"
6
5
  ];
7
6
  const rootTools = {
8
7
  "image-model-art": "image.generate",
9
- "AI-image-generation-art": "image.generate",
10
8
  "AI-video-generation": "video.generate"
11
9
  };
12
10
  const toolOrder = {
@@ -55,28 +53,13 @@ function collectScenes(raw) {
55
53
  roots.set(requiredText(item.code), item);
56
54
  }
57
55
  const scenes = [];
58
- const seen = new Set();
59
- function visit(value, tool) {
60
- const code = requiredText(value.code);
61
- if (!seen.has(code)) {
62
- seen.add(code);
63
- scenes.push({ code, tool, sort: number(value.sort) });
64
- }
65
- if (value.children === undefined || value.children === null)
66
- return;
67
- if (!Array.isArray(value.children))
68
- throw new Error("invalid children");
69
- for (const child of value.children) {
70
- const childRecord = record(child);
71
- if (childRecord === undefined)
72
- throw new Error("invalid child");
73
- visit(childRecord, tool);
74
- }
75
- }
56
+ // Match the editor's image/video picker: membership in a root scene,
57
+ // not membership in its children or the separate style scene tree.
76
58
  for (const rootCode of ROOT_SCENE_CODES) {
77
59
  const root = roots.get(rootCode);
78
- if (root !== undefined)
79
- visit(root, rootTools[rootCode]);
60
+ if (root !== undefined) {
61
+ scenes.push({ code: rootCode, tool: rootTools[rootCode], sort: number(root.sort) });
62
+ }
80
63
  }
81
64
  if (scenes.length === 0)
82
65
  throw new Error("empty scenes");
@@ -181,7 +164,7 @@ function normalizeModel(value, scenes) {
181
164
  || left.sort - right.sort);
182
165
  const scene = matches[0];
183
166
  if (scene === undefined)
184
- throw new Error("unknown scene");
167
+ return undefined;
185
168
  if (typeof model.input_field_settings !== "string")
186
169
  throw new Error("missing settings");
187
170
  const settings = JSON.parse(model.input_field_settings);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@insmind/cli",
3
- "version": "1.5.0",
3
+ "version": "1.5.1",
4
4
  "description": "insMind command-line interface for agents and people.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -46,8 +46,8 @@
46
46
  "@gaoding/cli": "workspace:*"
47
47
  },
48
48
  "gaodingRelease": {
49
- "sourceCommit": "20512692303b4ceff9b97871902c5ba126bdb894",
50
- "pipelineId": "188672",
51
- "pipelineUrl": "https://git.intra.gaoding.com/gtt/gaoding-cli/-/pipelines/188672"
49
+ "sourceCommit": "ef294965ab9eb82745bf58a63bcd15c28316fccc",
50
+ "pipelineId": "189476",
51
+ "pipelineUrl": "https://git.intra.gaoding.com/gtt/gaoding-cli/-/pipelines/189476"
52
52
  }
53
53
  }