@insmind/cli 1.4.1 → 1.5.0

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/README.md CHANGED
@@ -6,6 +6,9 @@ The official insMind command-line interface for people, agents, and CI.
6
6
  npm install --global --allow-scripts=@insmind/cli @insmind/cli
7
7
  insmind-cli auth login
8
8
  insmind-cli --help
9
+ insmind-cli editor apply --schema
9
10
  ```
10
11
 
11
12
  Requires Node.js 20 or newer. Credentials and local runtime state are stored separately from GaoDing CLI under `~/.insmind`.
13
+
14
+ Discover command behavior with `--help`, structured input through supported `--schema` modes, and live model parameters through `model list` and `model get`. `editor apply --schema` reads the installed Action contract without login or an Editor connection; it cannot be combined with execution via `--input`.
@@ -121,6 +121,16 @@
121
121
  "description": {
122
122
  "$ref": "#/$defs/NonBlankString"
123
123
  },
124
+ "minimum": {
125
+ "type": "number"
126
+ },
127
+ "maximum": {
128
+ "type": "number"
129
+ },
130
+ "step": {
131
+ "type": "number",
132
+ "exclusiveMinimum": 0
133
+ },
124
134
  "default": {
125
135
  "anyOf": [
126
136
  {
@@ -208,7 +208,12 @@ export function createProductionRuntime(options = {}) {
208
208
  const validators = createContractValidators({
209
209
  organizations: product.exposesOrganizations
210
210
  });
211
- const modelCatalog = createMnsCatalogAdapter({ transport: mnsTransport });
211
+ const modelCatalog = createMnsCatalogAdapter({
212
+ transport: mnsTransport,
213
+ ...(product.id === "insmind"
214
+ ? { invalidModelWarning: (count) => `Ignored ${count} invalid model configuration${count === 1 ? "" : "s"}.` }
215
+ : {})
216
+ });
212
217
  const damApi = createDamApiAdapter({ transport: damTransport });
213
218
  const damRepositories = createDamRepositoryCatalog({ transport: damTransport });
214
219
  const damOperations = createDamOperationExecutor({
@@ -6,6 +6,13 @@ export function registerDamCommands(program, runtime) {
6
6
  const dam = program.command("dam")
7
7
  .description(text(runtime.product, "DAM 素材管理", "Asset management"))
8
8
  .helpCommand(false);
9
+ dam.addHelpText("after", [
10
+ "",
11
+ text(runtime.product, "先通过 repository list、folder list、tag list 或资源查询取得真实 ID,再操作;名称、前端 URL 和旧缓存不能代替 ID。", "Discover real IDs with repository list, folder list, tag list or asset queries before acting; names, frontend URLs and old caches are not IDs."),
12
+ text(runtime.product, "支持的命令以本 help 为准;读取所选子命令的 --help 获取参数、作用范围和输出形式。", "Available commands are listed here; read the selected subcommand's --help for parameters, scope and output mode."),
13
+ text(runtime.product, "写入结果未确认时先查询实际状态,不重复提交。跨资源库查询、受保护路径上传和永久删除须有用户明确授权。", "Inspect actual state before retrying an unconfirmed write. Cross-repository queries, protected-path uploads and permanent deletion require explicit user authorization."),
14
+ ""
15
+ ].join("\n"));
9
16
  const repository = dam.command("repository")
10
17
  .description(text(runtime.product, "DAM 资源库", "Asset repositories"))
11
18
  .helpCommand(false);
@@ -98,6 +105,7 @@ export function registerDamCommands(program, runtime) {
98
105
  .option("--repository-id <id>", text(runtime.product, "所属资源库 ID", "repository ID"))
99
106
  .option("--output-dir <directory>", text(runtime.product, "输出目录", "output directory"))
100
107
  .option("--json", text(runtime.product, "输出 JSON", "output JSON"));
108
+ download.addHelpText("after", `\n${text(runtime.product, "只下载一个素材,不支持文件夹;写入本机目录,不覆盖已有同名文件。--json 返回 files 中的路径、字节数与摘要。", "Downloads one asset, not a folder, to a local directory without overwriting same-named files. --json returns paths, byte counts and digests in files.")}\n`);
101
109
  bindPreparedAction(download, "organization", async (signal) => {
102
110
  signal.throwIfAborted();
103
111
  const options = download.opts();
@@ -129,6 +137,7 @@ export function registerDamCommands(program, runtime) {
129
137
  .requiredOption("--title <title>", text(runtime.product, "新标题", "new title"))
130
138
  .option("--repository-id <id>", text(runtime.product, "所属资源库 ID", "repository ID"))
131
139
  .option("--json", text(runtime.product, "输出 JSON", "output JSON"));
140
+ rename.addHelpText("after", `\n${text(runtime.product, "一次重命名一个条目;若已提交但未确认,先查询条目真实名称,不重复提交。", "Renames one entry. If submitted but unconfirmed, inspect its actual name before considering another write.")}\n`);
132
141
  bindPreparedAction(rename, "organization", async (signal) => {
133
142
  signal.throwIfAborted();
134
143
  const options = rename.opts();
@@ -163,6 +172,12 @@ export function registerDamCommands(program, runtime) {
163
172
  .option("--repository-id <source-id>", text(runtime.product, "源资源库 ID", "source repository ID"))
164
173
  .option("--target-repository-id <target-id>", text(runtime.product, "目标资源库 ID", "target repository ID"))
165
174
  .option("--json", text(runtime.product, "输出 JSON", "output JSON"));
175
+ command.addHelpText("after", [
176
+ "",
177
+ text(runtime.product, "一次只操作一个素材或文件夹;先核对源与目标资源库、条目类型、目标文件夹。", "Operates on one asset or folder; verify source/destination repositories, entry kind and destination folder first."),
178
+ text(runtime.product, "已提交但未确认时查询目标位置并保留诊断 ID,不直接重提。copy 成功也可能不返回 copied_entry_id;查询目标位置取得新 ID,不猜 ID 或再次复制。", "If submitted but unconfirmed, inspect the destination and retain the diagnostic ID. A successful copy may omit copied_entry_id; discover the new ID at the destination without guessing or copying again."),
179
+ ""
180
+ ].join("\n"));
166
181
  bindPreparedAction(command, "organization", async (signal) => {
167
182
  signal.throwIfAborted();
168
183
  const options = command.opts();
@@ -311,6 +326,7 @@ export function registerDamCommands(program, runtime) {
311
326
  .argument("<asset>", text(runtime.product, "素材 ID", "asset ID"))
312
327
  .option("--repository-id <id>", text(runtime.product, "所属资源库 ID", "repository ID"))
313
328
  .option("--permanent", text(runtime.product, "移入回收站后永久删除", "permanently delete after moving to trash"));
329
+ deleteCommand.addHelpText("after", `\n${text(runtime.product, "默认移入回收站;--permanent 不可恢复,仅在用户明确要求永久删除时使用。支持的回收站操作请查 dam --help,不推断未列出的命令。", "Moves to the recycle bin by default; --permanent is irreversible and requires an explicit request. Consult dam --help for available recycle-bin operations rather than assuming unlisted commands exist.")}\n`);
314
330
  bindPreparedAction(deleteCommand, "organization", async (signal) => {
315
331
  signal.throwIfAborted();
316
332
  const options = deleteCommand.opts();
@@ -1,12 +1,32 @@
1
1
  import { bindAction, bindPreparedAction } from "./action-binding.js";
2
+ import { contractSchema } from "../contracts/schema.js";
3
+ import { CliUsageError } from "./errors.js";
2
4
  import { productText as text } from "../product/text.js";
5
+ const editorApplyInputSchema = contractSchema("editor.apply", "input");
3
6
  export function registerEditorCommands(program, runtime) {
4
7
  const editor = program.command("editor")
5
8
  .description(text(runtime.product, "连接并操作 AI+ Editor", "Connect to and operate insMind Editor"))
6
9
  .helpCommand(false);
10
+ editor.addHelpText("after", [
11
+ "",
12
+ text(runtime.product, "操作一个当前 Session、当前 Page 的直属 Shape 和绑定 Connector;单操作者串行执行。", "Operate one current Session and its Page's direct Shapes and bound Connectors, serially with one operator."),
13
+ text(runtime.product, "元素类型与字段以 editor apply --schema 为准;Schema 查询无需登录或连接 Editor。", "Discover element types and fields with editor apply --schema; no login or Editor connection is required."),
14
+ text(runtime.product, "当前不支持嵌套元素、自由/半绑定 Connector、页面或选择修改;UNSUPPORTED_PAGE_CONTENT 时保留原作品并换用空白或专用 Page。", "Nested elements, free/half-bound Connectors, page and selection changes are unsupported. On UNSUPPORTED_PAGE_CONTENT, preserve the work and use a blank or dedicated Page."),
15
+ text(runtime.product, "流程:connect → snapshot → apply → snapshot/screenshot 复查 → save → disconnect。apply 不代替 save。", "Workflow: connect → snapshot → apply → review snapshot/screenshot → save → disconnect. Apply does not replace Save."),
16
+ text(runtime.product, "EDITOR_BUSY 时等待原命令结束;写入超时、取消或断连时,先重新连接同一作品并检查真实状态,不直接重试写入。", "On EDITOR_BUSY, wait for the original command. After a write times out, is cancelled or disconnects, reconnect to the same work and inspect its state before deciding what to do."),
17
+ ""
18
+ ].join("\n"));
7
19
  const connect = leaf(editor.command("connect"))
8
20
  .description(text(runtime.product, "打开并连接一个 AI+ Editor 作品", "Open and connect to an Editor work"))
9
21
  .argument("[target]", text(runtime.product, "作品 ID 或完整 URL", "work ID or complete URL"));
22
+ connect.addHelpText("after", [
23
+ "",
24
+ text(runtime.product, "省略 target 新建线上 Board;数字按作品 ID 打开;完整 HTTP(S) URL 按该 URL 的环境打开。", "Omit target for a new production Board, use a numeric work ID, or provide a supported insMind production Editor URL."),
25
+ text(runtime.product, "会打开浏览器并替换旧 Session;浏览器登录、加载、Board 类型、编辑/保存权限与页面内容检查通过后才成功。CLI 登录不能替代浏览器登录。", "Opens the browser and replaces the old Session. Browser login, loading, Board type, edit/save permission and page-content checks must pass. CLI credentials do not replace browser login."),
26
+ text(runtime.product, "输出 JSON {target},不含连接凭证。连接失败时停止写入,让用户在页面处理登录或权限,再重新连接。", "Returns JSON {target} without connection credentials. On failure, stop writing and let the user resolve browser login or permissions before reconnecting."),
27
+ text(runtime.product, "页面切换作品会断开 Session;EDITOR_NOT_READY、EDITOR_SESSION_NOT_FOUND 或 EDITOR_NOT_CONNECTED 时确认目标后重连,不轮询旧 Session。", "Switching works disconnects the Session. On EDITOR_NOT_READY, EDITOR_SESSION_NOT_FOUND or EDITOR_NOT_CONNECTED, verify the target and reconnect instead of polling the old Session."),
28
+ ""
29
+ ].join("\n"));
10
30
  bindPreparedAction(connect, "none", async (signal) => {
11
31
  signal.throwIfAborted();
12
32
  const target = connect.processedArgs[0];
@@ -19,29 +39,57 @@ export function registerEditorCommands(program, runtime) {
19
39
  });
20
40
  const disconnect = leaf(editor.command("disconnect"))
21
41
  .description(text(runtime.product, "断开当前 Editor 连接", "Disconnect the current Editor"));
42
+ disconnect.addHelpText("after", `\n${text(runtime.product, "输出 JSON {disconnected};断开连接不保存作品,需先显式执行 editor save。", "Returns JSON {disconnected}. Disconnecting does not save the work; run editor save explicitly first.")}\n`);
22
43
  bindAction(disconnect, "none", async (_context, signal) => {
23
44
  writeJson(runtime, await runtime.editor.disconnect({ signal }));
24
45
  });
25
46
  const snapshot = leaf(editor.command("snapshot"))
26
47
  .description(text(runtime.product, "读取当前作品快照", "Read the current work snapshot"));
48
+ snapshot.addHelpText("after", [
49
+ "",
50
+ text(runtime.product, "输出 JSON {elements, selectedIds};selectedIds 只读。元素字段和类型见 editor apply --schema。", "Returns JSON {elements, selectedIds}; selectedIds is read-only. Discover element fields and types with editor apply --schema."),
51
+ text(runtime.product, "修改时以最新 Snapshot 中的完整元素为基础;每次 apply 后重新读取。UNSUPPORTED_PAGE_CONTENT 时停止并保留原作品。", "Base changes on complete elements from the latest Snapshot and read again after every Apply. On UNSUPPORTED_PAGE_CONTENT, stop and preserve the work."),
52
+ ""
53
+ ].join("\n"));
27
54
  bindAction(snapshot, "none", async (_context, signal) => {
28
55
  writeJson(runtime, await runtime.editor.snapshot({ signal }));
29
56
  });
30
57
  const apply = leaf(editor.command("apply"))
31
58
  .description(text(runtime.product, "按顺序应用元素操作", "Apply element operations in order"))
32
- .requiredOption("--input <file|->", text(runtime.product, "从文件或标准输入读取 JSON", "read JSON from a file or stdin"));
59
+ .option("--schema", text(runtime.product, "输出输入 Schema,不执行操作", "output the input Schema without executing an operation"))
60
+ .option("--input <file|->", text(runtime.product, "从文件或标准输入读取 JSON", "read JSON from a file or stdin"));
61
+ apply.addHelpText("after", [
62
+ "",
63
+ text(runtime.product, "--schema 与 --input 必须且只能选择一个。Schema 为本地契约,不连接 Editor;执行成功输出 JSON {appliedCount}。", "Choose exactly one of --schema and --input. Schema reads the local contract without connecting to Editor; successful execution returns JSON {appliedCount}."),
64
+ text(runtime.product, "输入是按序执行的 Action 数组;类型、必填字段与可选值见 --schema。使用简短语义 ID;create ID 必须唯一,Connector 可引用本批次更早创建的 Shape。", "Input is an ordered Action array; discover types, required fields and choices with --schema. Use short semantic IDs. Create IDs must be unique; a Connector may reference a Shape created earlier in the batch."),
65
+ text(runtime.product, "update 提交完整元素而非 patch,不改变 id 或 _type。delete 要求 ID 存在;删除 Shape 同时删除绑定的 Connector。", "Update requires the full element, not a patch, without changing id or _type. Delete requires an existing ID; deleting a Shape also deletes its bound Connectors."),
66
+ text(runtime.product, "Shape 的 x/y 为 Page 左上角坐标,w/h 大于 0;数值必须有限。颜色用 #RRGGBB 或 #RRGGBBAA,仅 stroke 可为 null。Connector 用 fromId/toId 表达有方向的 Shape 关系。", "Shape x/y locate its top-left corner in Page coordinates; w/h must exceed zero and numbers must be finite. Colors use #RRGGBB or #RRGGBBAA; only stroke accepts null. Connector fromId/toId express a directed Shape relationship."),
67
+ text(runtime.product, "整批先预检,再在可回滚事务中应用;INVALID_ACTIONS 时修正输入,APPLY_FAILED 时读 Snapshot 确认回滚。EDITOR_ROLLBACK_FAILED 时停止 apply/save,只读检查并报告。", "The batch is checked before one rollback-capable transaction. Correct INVALID_ACTIONS; on APPLY_FAILED read a Snapshot to confirm rollback. On EDITOR_ROLLBACK_FAILED, stop apply/save, inspect read-only and report."),
68
+ text(runtime.product, "成功不表示已保存或视觉正确;读取新 Snapshot,涉及布局/文字/连线时查看截图,再显式 save。超时、取消或断连后先检查真实状态,不重复提交。", "Success proves neither persistence nor correct rendering. Read a new Snapshot, view a screenshot for layout/text/connectors, then explicitly save. Inspect real state after timeout, cancellation or disconnection instead of resubmitting."),
69
+ ""
70
+ ].join("\n"));
33
71
  bindPreparedAction(apply, "none", async (signal) => {
34
72
  signal.throwIfAborted();
35
- const source = apply.opts().input;
36
- const input = await runtime.jsonInput.read(source, signal);
73
+ const options = apply.opts();
74
+ if (Number(options.schema === true) + Number(options.input !== undefined) !== 1)
75
+ throw new CliUsageError();
76
+ if (options.schema === true) {
77
+ await runtime.telemetry.stage("output", () => { writeJson(runtime, editorApplyInputSchema); });
78
+ return { handled: true };
79
+ }
80
+ const input = await runtime.jsonInput.read(options.input, signal);
37
81
  runtime.validators.editorApplyInput(input);
38
82
  return { handled: false, input };
39
83
  }, async (_context, input, signal) => {
40
84
  writeJson(runtime, await runtime.editor.apply({ input, signal }));
85
+ }, {
86
+ operation: "editor.apply",
87
+ mode: () => apply.opts().schema === true ? "schema" : "execute"
41
88
  });
42
89
  const screenshot = leaf(editor.command("screenshot"))
43
90
  .description(text(runtime.product, "导出当前作品 PNG 截图", "Export a PNG screenshot of the current work"))
44
91
  .option("--json", text(runtime.product, "输出 JSON", "output JSON"));
92
+ screenshot.addHelpText("after", `\n${text(runtime.product, "将当前作品截图写入本机 PNG;--json 输出 {path},path 为绝对路径。打开实际图片检查文字、布局与连线,不以文件存在代替视觉验收。", "Writes a PNG screenshot locally; --json returns {path} with an absolute path. View the actual image to check text, layout and connectors; file existence is not visual verification.")}\n`);
45
93
  bindAction(screenshot, "none", async (_context, signal) => {
46
94
  const result = await runtime.editor.screenshot({ signal });
47
95
  runtime.presenter.result(result, {
@@ -52,6 +100,13 @@ export function registerEditorCommands(program, runtime) {
52
100
  const save = leaf(editor.command("save"))
53
101
  .description(text(runtime.product, "保存当前 AI+ Editor 作品", "Save the current Editor work"))
54
102
  .option("--json", text(runtime.product, "输出 JSON", "output JSON"));
103
+ save.addHelpText("after", [
104
+ "",
105
+ text(runtime.product, "等待真实持久化完成;--json 输出 {workId, url}。新 Board 首次保存创建作品 ID;原样交付公开 url,保留环境参数。", "Waits for real persistence; --json returns {workId, url}. A new Board gets its work ID on first save. Deliver the public url unchanged, retaining environment parameters."),
106
+ text(runtime.product, "Save 最长等待 5 分 30 秒,其他 Editor RPC 默认 1 分钟;继续等待原命令,保持串行。成功前不得报告已保存。", "Save waits up to 5 minutes 30 seconds; other Editor RPCs default to one minute. Keep waiting on the original command and run serially. Do not report persistence before success."),
107
+ text(runtime.product, "SAVE_FAILED 时保留 Session 并处理明确原因;超时、取消或断连不表示未保存,先重连同一作品检查真实状态。EDITOR_ROLLBACK_FAILED 时不得继续保存。", "On SAVE_FAILED retain the Session and resolve the stated cause. Timeout, cancellation or disconnection does not prove failure to save; reconnect to the same work and inspect first. Do not save after EDITOR_ROLLBACK_FAILED."),
108
+ ""
109
+ ].join("\n"));
55
110
  bindAction(save, "none", async (_context, signal) => {
56
111
  const result = await runtime.editor.save({ signal });
57
112
  runtime.presenter.result(result, {
@@ -34,6 +34,14 @@ export function registerModelCommands(program, runtime) {
34
34
  .description(text(runtime.product, "查看模型完整信息", "Show complete model information"))
35
35
  .argument("<model>", text(runtime.product, "模型机器标识", "model machine identifier"))
36
36
  .allowExcessArguments(false);
37
+ get.addHelpText("after", [
38
+ "",
39
+ text(runtime.product, "只读查询当前身份可用的 Model,输出 JSON;不提交创作。参数、费用和预估耗时来自实时目录。", "Reads a Model available to the current identity as JSON without submitting creation. Parameters, cost and estimated time come from the live catalog."),
40
+ text(runtime.product, "parameters 是结构化元数据,不是 JSON Schema:遵守 required/type、minimum/maximum/step,SELECT 使用 options[].value 而非 label。", "parameters is structured metadata, not JSON Schema: follow required/type, minimum/maximum/step, and use SELECT options[].value rather than label."),
41
+ text(runtime.product, "Tool 调用须显式提供所有 required 字段;用户未指定时显式使用返回的 default。model 标识放入调用参数顶层,与模型参数并列。", "Tool calls explicitly supply every required field, using a returned default when the user omitted it. Include the returned model identifier at the top level alongside its parameters."),
42
+ text(runtime.product, "usageDescription 说明跨字段组合规则。tool call <tool> --schema 是 Tool 级参数并集,不能代替本 Model 的要求。Agent 只传显式生成约束,不照搬 Tool 的完整必填参数。", "usageDescription explains cross-field combinations. tool call <tool> --schema is a tool-wide union, not this Model's exact requirements. For Agent, pass explicit generation constraints rather than copying every Tool-required parameter."),
43
+ ""
44
+ ].join("\n"));
37
45
  bindAction(get, "organization", async (context, signal) => {
38
46
  const modelName = get.processedArgs[0];
39
47
  if (typeof modelName !== "string" || modelName.trim() === "")
@@ -4,6 +4,14 @@ export function registerUpdateCommand(program, runtime) {
4
4
  const update = program.command("update")
5
5
  .description(text(runtime.product, "更新 GD CLI 与内置 Agent Skill", "Update insMind CLI and its bundled Agent Skill"))
6
6
  .allowExcessArguments(false);
7
+ update.addHelpText("after", [
8
+ "",
9
+ text(runtime.product, `检查 ${runtime.product.npmPackage} 的 npm latest,更新受支持的全局 npm/pnpm 安装;CLI 已最新时仍同步随包 Skill。`, `Checks npm latest for ${runtime.product.npmPackage}, updates supported global npm/pnpm installations and synchronizes the bundled Skill even when the CLI is current.`),
10
+ text(runtime.product, `只授权本包安装脚本:npm --allow-scripts=${runtime.product.npmPackage},pnpm --allow-build=${runtime.product.npmPackage}。`, `Enables lifecycle scripts only for this package: npm --allow-scripts=${runtime.product.npmPackage}, pnpm --allow-build=${runtime.product.npmPackage}.`),
11
+ text(runtime.product, "普通使用只检查/提醒,不自动安装或同步 Skill。宿主管理的安装拒绝自行升级,并返回对应渠道的处理步骤;遵循该渠道,不覆盖其他宿主的 Skill。", "Normal use only checks/notifies; it does not install or synchronize Skills automatically. Host-managed installations reject self-update and return channel-specific instructions; follow that channel without overwriting other hosts' Skills."),
12
+ text(runtime.product, "若 CLI 更新成功但 Skill 验收失败,保留已更新版本,按错误中的下一步修复;不支持的安装来源也以命令返回的指引为准。", "If the CLI updates but Skill verification fails, keep the updated version and follow the error's next steps. Unsupported installation sources also receive channel-specific guidance."),
13
+ ""
14
+ ].join("\n"));
7
15
  bindAction(update, "none", async (_context, signal) => {
8
16
  const result = await runtime.update.run(signal);
9
17
  await runtime.telemetry.stage("output", async () => {
@@ -8,11 +8,6 @@ export const defaultToolDefinitions = [
8
8
  name: "video.generate",
9
9
  title: "视频生成",
10
10
  description: "使用已发布的视频模型,根据文本及可选图片、视频或音频生成视频。"
11
- },
12
- {
13
- name: "text.generate",
14
- title: "文本生成",
15
- description: "使用已发布的文本模型,根据文本和可选图片生成文本。"
16
11
  }
17
12
  ];
18
13
  export class ToolInputError extends Error {
@@ -1,7 +1,7 @@
1
1
  import { Ajv2020 } from "ajv/dist/2020.js";
2
2
  import addFormatsImport, {} from "ajv-formats";
3
3
  import { ToolInputError } from "./catalog.js";
4
- function parameterSchema(parameter) {
4
+ function parameterSchema(parameter, includeBounds = false) {
5
5
  const common = {
6
6
  ...(parameter.description === undefined ? {} : { description: parameter.description }),
7
7
  ...(parameter.default === undefined ? {} : { default: parameter.default })
@@ -11,8 +11,18 @@ function parameterSchema(parameter) {
11
11
  if (parameter.type === "uri[]") {
12
12
  return { type: "array", items: { type: "string", format: "uri" }, ...common };
13
13
  }
14
- if (parameter.type === "number")
15
- return { type: "number", ...common };
14
+ if (parameter.type === "number") {
15
+ return {
16
+ type: "number",
17
+ ...(includeBounds && parameter.minimum !== undefined
18
+ ? { minimum: parameter.minimum }
19
+ : {}),
20
+ ...(includeBounds && parameter.maximum !== undefined
21
+ ? { maximum: parameter.maximum }
22
+ : {}),
23
+ ...common
24
+ };
25
+ }
16
26
  return {
17
27
  type: "string",
18
28
  ...(parameter.options === undefined
@@ -78,7 +88,7 @@ export function buildModelArgumentsSchema(model) {
78
88
  }
79
89
  };
80
90
  for (const parameter of model.parameters) {
81
- properties[parameter.name] = parameterSchema(parameter);
91
+ properties[parameter.name] = parameterSchema(parameter, true);
82
92
  }
83
93
  return {
84
94
  type: "object",
@@ -105,7 +115,7 @@ function controlArgumentsValidator(model) {
105
115
  || parameter.type === "uri"
106
116
  || parameter.type === "uri[]")
107
117
  continue;
108
- properties[parameter.name] = parameterSchema(parameter);
118
+ properties[parameter.name] = parameterSchema(parameter, true);
109
119
  }
110
120
  return ajv.compile({
111
121
  type: "object",
@@ -116,13 +126,31 @@ function controlArgumentsValidator(model) {
116
126
  }
117
127
  export function assertModelArguments(model, value) {
118
128
  if (typeof value !== "object" || value === null
119
- || !validator(model)(value)) {
129
+ || !validator(model)(value)
130
+ || !sliderStepsAreValid(model, value)) {
120
131
  throw new ToolInputError();
121
132
  }
122
133
  }
134
+ function sliderStepsAreValid(model, value) {
135
+ return model.parameters.every((parameter) => {
136
+ if (parameter.step === undefined || !Object.hasOwn(value, parameter.name))
137
+ return true;
138
+ const candidate = value[parameter.name];
139
+ const minimum = parameter.minimum;
140
+ if (typeof candidate !== "number" || minimum === undefined || parameter.step <= 0) {
141
+ return false;
142
+ }
143
+ const steps = (candidate - minimum) / parameter.step;
144
+ const nearestStep = Math.round(steps);
145
+ const expected = minimum + nearestStep * parameter.step;
146
+ const tolerance = Number.EPSILON * Math.max(1, Math.abs(candidate), Math.abs(expected), Math.abs(minimum), Math.abs(nearestStep * parameter.step)) * 2;
147
+ return Math.abs(candidate - expected) <= tolerance;
148
+ });
149
+ }
123
150
  export function modelControlArgumentsAreValid(model, value) {
124
151
  return typeof value === "object"
125
152
  && value !== null
126
153
  && !Array.isArray(value)
127
- && controlArgumentsValidator(model)(value);
154
+ && controlArgumentsValidator(model)(value)
155
+ && sliderStepsAreValid(model, value);
128
156
  }
@@ -2,19 +2,16 @@ import { RemoteRequestError } from "../../platform/signed-http-transport.js";
2
2
  export const ROOT_SCENE_CODES = [
3
3
  "image-model-art",
4
4
  "AI-image-generation-art",
5
- "AI-video-generation",
6
- "AI-text-generation"
5
+ "AI-video-generation"
7
6
  ];
8
7
  const rootTools = {
9
8
  "image-model-art": "image.generate",
10
9
  "AI-image-generation-art": "image.generate",
11
- "AI-video-generation": "video.generate",
12
- "AI-text-generation": "text.generate"
10
+ "AI-video-generation": "video.generate"
13
11
  };
14
12
  const toolOrder = {
15
13
  "image.generate": 0,
16
- "video.generate": 1,
17
- "text.generate": 2
14
+ "video.generate": 1
18
15
  };
19
16
  const multiUriKeys = new Set([
20
17
  "image_urls",
@@ -95,17 +92,33 @@ function parameter(value) {
95
92
  if (!/^[A-Za-z_][A-Za-z0-9_]*$/u.test(name))
96
93
  return undefined;
97
94
  const sourceType = requiredText(field.type);
98
- const type = multiUriKeys.has(name)
99
- ? "uri[]"
100
- : name === "start_frame" || name === "end_frame" || sourceType === "IMAGE"
101
- ? "uri"
102
- : sourceType === "NUMBER"
103
- ? "number"
104
- : sourceType === "TEXT" || sourceType === "INPUT" || sourceType === "SELECT"
105
- ? "string"
106
- : undefined;
95
+ const type = sourceType === "SLIDER"
96
+ ? "number"
97
+ : multiUriKeys.has(name)
98
+ ? "uri[]"
99
+ : name === "start_frame" || name === "end_frame" || sourceType === "IMAGE"
100
+ ? "uri"
101
+ : sourceType === "NUMBER"
102
+ ? "number"
103
+ : sourceType === "TEXT" || sourceType === "INPUT" || sourceType === "SELECT"
104
+ ? "string"
105
+ : undefined;
107
106
  if (type === undefined)
108
107
  throw new Error("unsupported parameter");
108
+ let minimum;
109
+ let maximum;
110
+ let step;
111
+ if (sourceType === "SLIDER") {
112
+ if (typeof field.min !== "number" || !Number.isFinite(field.min)
113
+ || typeof field.max !== "number" || !Number.isFinite(field.max)
114
+ || typeof field.step !== "number" || !Number.isFinite(field.step)
115
+ || field.min > field.max || field.step <= 0) {
116
+ throw new Error("invalid slider constraints");
117
+ }
118
+ minimum = field.min;
119
+ maximum = field.max;
120
+ step = field.step;
121
+ }
109
122
  let options;
110
123
  if (sourceType === "SELECT") {
111
124
  if (!Array.isArray(field.options))
@@ -132,6 +145,9 @@ function parameter(value) {
132
145
  name,
133
146
  type,
134
147
  required: field.required === true,
148
+ ...(minimum === undefined ? {} : { minimum }),
149
+ ...(maximum === undefined ? {} : { maximum }),
150
+ ...(step === undefined ? {} : { step }),
135
151
  ...(description === undefined ? {} : { description }),
136
152
  ...(hasDefault
137
153
  ? { default: defaultValue }
@@ -251,7 +267,8 @@ export function createMnsCatalogAdapter(dependencies) {
251
267
  models,
252
268
  warnings: invalidCount === 0
253
269
  ? []
254
- : [`已忽略 ${invalidCount} 个无效模型配置。`]
270
+ : [dependencies.invalidModelWarning?.(invalidCount)
271
+ ?? `已忽略 ${invalidCount} 个无效模型配置。`]
255
272
  };
256
273
  }
257
274
  catch (error) {
@@ -75,11 +75,6 @@ export const insmindProduct = freezeProduct({
75
75
  name: "video.generate",
76
76
  title: "Video generation",
77
77
  description: "Generate videos with published video models using text and optional images, video, or audio."
78
- },
79
- {
80
- name: "text.generate",
81
- title: "Text generation",
82
- description: "Generate text with published text models using text and optional images."
83
78
  }
84
79
  ]
85
80
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@insmind/cli",
3
- "version": "1.4.1",
3
+ "version": "1.5.0",
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": "3240af623d045c12d5ab21fbf55e45a2cff195c2",
50
- "pipelineId": "183172",
51
- "pipelineUrl": "https://git.intra.gaoding.com/gtt/gaoding-cli/-/pipelines/183172"
49
+ "sourceCommit": "20512692303b4ceff9b97871902c5ba126bdb894",
50
+ "pipelineId": "188672",
51
+ "pipelineUrl": "https://git.intra.gaoding.com/gtt/gaoding-cli/-/pipelines/188672"
52
52
  }
53
53
  }
@@ -5,6 +5,15 @@ description: Use when creating images, videos or text with insMind CLI, operatin
5
5
 
6
6
  # insMind CLI
7
7
 
8
+ ## Discover current capabilities on demand
9
+
10
+ - Check `insmind-cli --version` on first use. If the entry point is unclear, read `insmind-cli --help`, follow the relevant command group, then read the chosen command's `--help` before execution. Examples here are not an exhaustive capability list.
11
+ - For structured input, query `--schema` only where the command exposes it. Discover models, parameter choices, prices and resource IDs through current lists/details rather than old examples. Report missing support or failed discovery without silently replacing explicit user constraints.
12
+ - Reuse help and static Schema within the same session and CLI path/version; refresh after changing the CLI. Query dynamic metadata when selecting capabilities or quoting prices for this task, and refresh relevant results after identity changes or an explicit mismatch. Avoid unrelated catalog scans.
13
+ - Discovery describes the installed CLI; it neither upgrades it nor authorizes generation, writes or installation. Recover unknown outcomes through the error-handling reference.
14
+
15
+ ## Read task guidance
16
+
8
17
  Read only the reference for the user's goal:
9
18
 
10
19
  - Choose Agent or Tool creation, discover models, and generate images, videos or text: [Creation](references/creation.md)
@@ -17,7 +17,7 @@ For example, the user says “Make a promotional image for this product” witho
17
17
  Choose the Creation Route before selecting or validating a Model. Both Agent and Tool accept models and parameters; `model list` and `model get` provide shared, live discovery.
18
18
 
19
19
  - Agent: a business deliverable, clarification, planning, multiple steps or outputs, or continuation of existing work. The service selects its Business Skill.
20
- - Tool: one atomic image, video or text operation without business orchestration, or an explicit request to call a Tool directly.
20
+ - Tool: one atomic operation without business orchestration, discovered through `tool list`, or an explicit request to call an available Tool directly.
21
21
 
22
22
  Match these business intents by meaning:
23
23
 
@@ -2,6 +2,8 @@
2
2
 
3
3
  ## Discover before acting
4
4
 
5
+ Read `insmind-cli dam --help` to choose an available operation, then its subcommand's `--help` before use. The paths below are common examples, not exhaustive command or parameter lists.
6
+
5
7
  Before repository-scoped reads or writes, run:
6
8
 
7
9
  ```bash
@@ -17,7 +19,7 @@ insmind-cli dam folder list --repository-id <id> --json
17
19
  insmind-cli dam tag list --repository-id <id> --json
18
20
  ```
19
21
 
20
- Folders accept `--parent-id`, `--query`, `--page` and `--page-size`; tags accept `--query`. The root folder ID is `0`; explicitly pass `--target-folder-id 0` for a root destination rather than relying on omission.
22
+ Discover folder/tag filters and pagination in their `--help`. The root folder ID is `0`; explicitly pass `--target-folder-id 0` for a root destination rather than relying on omission.
21
23
 
22
24
  ## Find and download
23
25
 
@@ -28,9 +30,9 @@ insmind-cli dam get <asset-id> --json
28
30
  insmind-cli dam download <asset-id> --repository-id <id> --output-dir ./downloads --json
29
31
  ```
30
32
 
31
- Use `--all-repositories` only when the user explicitly requests a cross-repository query. Apply folder, type, format, tag, limit or cursor filters as needed. Download supports one asset, not folders, and never overwrites an existing same-named file.
33
+ Use `--all-repositories` only when the user explicitly requests a cross-repository query. Discover filters, download scope and local-file handling from the selected command's `--help`; keep the user's resource scope intact.
32
34
 
33
- ## Single-entry changes
35
+ ## Writes and authorization
34
36
 
35
37
  ```bash
36
38
  insmind-cli dam upload ./asset.png --repository-id <id> --folder-id <folder-id> --tag-ids <tag-id> --json
@@ -40,12 +42,11 @@ insmind-cli dam move <entry-id> --kind asset --repository-id <source-id> --targe
40
42
  insmind-cli dam delete <asset-id> --repository-id <id>
41
43
  ```
42
44
 
43
- - For rename, move and copy, `--kind` is `asset` or `folder`.
44
- - Process one entry per operation; do not simulate batch operations.
45
+ - Discover entry kinds and per-operation scope in `--help`; examples are not an exhaustive capability list and do not authorize broader writes.
45
46
  - Use `--allow-sensitive-path` for protected uploads only with explicit user authorization. Use `--wait-analysis` when analysis must finish.
46
47
  - A successful copy can omit `copied_entry_id`. Discover the copy in the destination; do not guess its ID or copy again.
47
48
  - If move, copy or rename was submitted but remains unconfirmed, inspect the destination and report its diagnostic ID before considering further action.
48
49
  - Delete moves an asset to the recycle bin by default. Use `--permanent` only when explicitly requested.
49
- - Recycle-bin listing and restoration are unavailable; there is no `dam recycle` command.
50
+ - For recycle-bin or other operations not illustrated here, check `insmind-cli dam --help`. Report missing capabilities instead of guessing commands.
50
51
 
51
52
  Before writing, establish the repository, entry ID, kind and destination from current output and user intent. Do not substitute guessed IDs from local login state or old results.
@@ -1,23 +1,33 @@
1
1
  # AI+ Editor
2
2
 
3
- ## Scope
3
+ ## Discover capabilities and scope
4
4
 
5
- Use `insmind-cli editor` to inspect and operate one current AI+ Editor work in a browser. This version supports one Editor Session, direct Shapes and Connectors on the current Page, and serial operations by one operator.
5
+ On first entering this task branch, read help from the installed CLI. Before constructing Actions, query the input Schema:
6
6
 
7
- Supported Shapes: `rectangle`, `rounded-rectangle`, `triangle-up`, `ellipse`, `diamond`. A Connector binds one Shape to another and uses `straight` or `elbowed` lineType. Groups, images, videos, standalone text, nested elements, free or half-bound Connectors, connector labels, endpoint coordinates, selection changes and page management are unsupported.
7
+ ```bash
8
+ insmind-cli editor --help
9
+ insmind-cli editor apply --help
10
+ insmind-cli editor apply --schema
11
+ ```
12
+
13
+ Use the current Schema for supported elements, Actions, fields and choices, and the relevant command's help for scope, coordinate/color semantics, waits and errors. Schema discovery requires neither login nor an Editor connection. Do not infer capabilities from old examples or invent fields and commands.
8
14
 
9
- If the current Page has unsupported direct elements, snapshot, apply and screenshot return `UNSUPPORTED_PAGE_CONTENT`. Stop and ask the user to use a blank or dedicated Page; preserve the existing work.
15
+ Keep operations serial with one operator. If the Page contains unsupported content, stop and ask for a blank or dedicated Page; preserve the existing work.
10
16
 
11
17
  ## Workflow
12
18
 
13
- 1. Connect with `insmind-cli editor connect [target]`. Omit target to create a production Board, provide a numeric work ID to open a work, or provide a supported insMind production Editor URL. Use the form matching the user's target. Connection succeeds only after browser login, work loading, Board type, edit/save permissions and page-content checks pass. Stop on a connection failure.
14
- 2. Read `insmind-cli editor snapshot`.
15
- 3. Build a complete, ordered Action JSON array from that Snapshot and run `insmind-cli editor apply --input actions.json`, or use `--input -` for stdin.
16
- 4. Read a fresh Snapshot after each Apply. For layout, text or Connector changes, also run `insmind-cli editor screenshot --json` and view the actual PNG at the returned absolute `path`. A file's existence or an accepted Action does not prove correct rendering.
17
- 5. After structural and visual checks pass, run `insmind-cli editor save --json`. Only a successful save proves persistence; deliver its returned `workId` and public `url`. A new Board receives its work ID on the first explicit save. Preserve any environment parameters in the returned URL. Save waits for real persistence and may take up to 5 minutes 30 seconds. Keep waiting for the command and do not issue concurrent Editor operations.
18
- 6. Run `insmind-cli editor disconnect` after saving.
19
+ Completion requires structural and visual verification followed by a successful explicit save returning the public work URL.
20
+
21
+ 1. Read `insmind-cli editor connect --help` and choose `insmind-cli editor connect [target]` for the user's intended work. Do not omit the target and create a Board when recovering an existing work. Browser login, loading, edit/save permissions and content checks must pass; stop editing on connection failure.
22
+ 2. Read `insmind-cli editor snapshot`. Base changes on complete elements from the latest Snapshot and change only intended fields. Submit full Updates, never patches.
23
+ 3. Build a complete, ordered Action JSON array from the Schema and Snapshot. Run `insmind-cli editor apply --input actions.json`, or use `--input -` for stdin. Use short semantic IDs; Connector direction and targets must preserve business relationships.
24
+ 4. Read a fresh Snapshot after every Apply. For layout, text or Connector changes, run `insmind-cli editor screenshot --json` and view the actual PNG at its absolute `path`. A file's existence or an accepted Action does not prove correct rendering.
25
+ 5. After structural and visual checks pass, run `insmind-cli editor save --json` and wait for the original command. Do not interrupt during silent periods or issue concurrent Editor operations. Only success proves persistence; deliver the returned `workId` and public `url`, preserving environment parameters. Discover wait limits with `editor save --help`.
26
+ 6. Run `insmind-cli editor disconnect` after saving; disconnecting does not replace saving.
27
+
28
+ Connecting replaces the old Session and opens the work. A failed precheck clears the attempted Session but leaves the browser page open. The user handles browser login or access issues, then reconnects. CLI credentials do not replace browser AI+ login; the user enters account credentials in the browser.
19
29
 
20
- Connecting replaces the old Session and opens the work. A failed precheck clears the attempted Session but leaves the browser page open. The user handles browser login or access issues, then reconnects. CLI credentials do not replace browser AI+ login. If the SPA loads or switches works, the Session disconnects; reconnect to the intended work before editing.
30
+ If reloading or switching works disconnects the Session, reconnect to the intended work and read a fresh Snapshot before editing.
21
31
 
22
32
  ## Verify the work
23
33
 
@@ -32,153 +42,19 @@ Use the latest post-Apply Snapshot for fields and relationships, and the actual
32
42
 
33
43
  When a fix is actionable, read the latest Snapshot first and submit full element Updates, never patches. If correct Connector IDs still produce a path crossing an endpoint, resubmit that Connector's full Update to trigger native path recalculation; preserve correct business relationships. Read a new Snapshot and screenshot after visual changes. Save when no actionable issue remains.
34
44
 
35
- ## Snapshot contract
36
-
37
- ```ts
38
- type FocusedPageSnapshot = {
39
- elements: Array<FocusedShape | FocusedConnector>;
40
- selectedIds: string[];
41
- };
42
-
43
- type FocusedShape = {
44
- _type: "shape";
45
- id: string;
46
- shapeType:
47
- | "rectangle"
48
- | "rounded-rectangle"
49
- | "triangle-up"
50
- | "ellipse"
51
- | "diamond";
52
- x: number;
53
- y: number;
54
- w: number;
55
- h: number;
56
- text?: string;
57
- fill: string;
58
- stroke: string | null;
59
- };
60
-
61
- type FocusedConnector = {
62
- _type: "connector";
63
- id: string;
64
- fromId: string;
65
- toId: string;
66
- lineType: "straight" | "elbowed";
67
- color: string;
68
- };
69
- ```
70
-
71
- `x` and `y` locate the Shape's top-left corner in Page coordinates; `w` and `h` are its dimensions. `selectedIds` is read-only. Use short semantic IDs such as `start`, `review`, and `start-to-review`; the Bridge maps them to internal Editor IDs. Connector endpoints express a directed relationship.
72
-
73
- ## Action contract
74
-
75
- ```ts
76
- type FocusedEditorAction =
77
- | { _type: "create"; element: FocusedShape | FocusedConnector }
78
- | { _type: "update"; element: FocusedShape | FocusedConnector }
79
- | { _type: "delete"; id: string };
80
- ```
81
-
82
- - Input is a JSON array applied in order.
83
- - Create IDs must be unique. A Connector can reference a Shape created earlier in the same array.
84
- - Update supplies the entire element and cannot change `id` or `_type`.
85
- - Delete requires an existing ID; deleting a Shape also removes its bound Connectors.
86
- - Extra fields are rejected. Numbers must be finite; `w` and `h` must exceed zero.
87
- - Colors use `#RRGGBB` or `#RRGGBBAA`. Only Shape `stroke` accepts `null`.
88
- - The whole batch is validated before one rollback-capable transaction. An invalid Action prevents all writes; correct it before submitting.
89
-
90
- ## Example
91
-
92
- This array creates a left-to-right Start → Review? → Done flowchart:
93
-
94
- ```json
95
- [
96
- {
97
- "_type": "create",
98
- "element": {
99
- "_type": "shape",
100
- "id": "start",
101
- "shapeType": "rounded-rectangle",
102
- "x": 80,
103
- "y": 160,
104
- "w": 180,
105
- "h": 80,
106
- "text": "Start",
107
- "fill": "#ffffff",
108
- "stroke": "#222222"
109
- }
110
- },
111
- {
112
- "_type": "create",
113
- "element": {
114
- "_type": "shape",
115
- "id": "review",
116
- "shapeType": "diamond",
117
- "x": 360,
118
- "y": 140,
119
- "w": 140,
120
- "h": 120,
121
- "text": "Review?",
122
- "fill": "#f2f6ff",
123
- "stroke": "#222222"
124
- }
125
- },
126
- {
127
- "_type": "create",
128
- "element": {
129
- "_type": "shape",
130
- "id": "done",
131
- "shapeType": "rounded-rectangle",
132
- "x": 600,
133
- "y": 160,
134
- "w": 180,
135
- "h": 80,
136
- "text": "Done",
137
- "fill": "#e8f7ed",
138
- "stroke": "#222222"
139
- }
140
- },
141
- {
142
- "_type": "create",
143
- "element": {
144
- "_type": "connector",
145
- "id": "start-to-review",
146
- "fromId": "start",
147
- "toId": "review",
148
- "lineType": "straight",
149
- "color": "#222222"
150
- }
151
- },
152
- {
153
- "_type": "create",
154
- "element": {
155
- "_type": "connector",
156
- "id": "review-to-done",
157
- "fromId": "review",
158
- "toId": "done",
159
- "lineType": "straight",
160
- "color": "#222222"
161
- }
162
- }
163
- ]
164
- ```
165
-
166
- For existing elements, start from their complete latest Snapshot objects, change only the intended fields, and submit full Updates.
167
-
168
45
  ## Failures
169
46
 
170
47
  - `LOGIN_REQUIRED`: stop editing and let the user sign in on the opened AI+ page, then reconnect. CLI login cannot replace it.
171
48
  - `EDITOR_NOT_READY`: check loading and reconnect; do not write until connection succeeds.
172
49
  - `WORK_NOT_EDITABLE`: stop; the current user lacks editing or saving permission.
173
- - `EDITOR_SESSION_NOT_FOUND`: reconnect to the target and read a Snapshot.
174
- - `EDITOR_NOT_CONNECTED`: reconnect to the target rather than polling the old Session.
50
+ - `EDITOR_SESSION_NOT_FOUND` or `EDITOR_NOT_CONNECTED`: reconnect to the intended work and read a Snapshot rather than polling the old Session.
175
51
  - `UNSUPPORTED_PAGE_CONTENT`: stop and request a blank or dedicated Page.
176
- - `INVALID_ACTIONS`: correct the Actions from this contract and a fresh Snapshot; do not retry unchanged.
52
+ - `INVALID_ACTIONS`: correct Actions using the current Schema, help and a fresh Snapshot; do not retry unchanged.
177
53
  - `APPLY_FAILED`: the batch rolled back; read the Snapshot and confirm the prior state before proceeding.
178
54
  - `EDITOR_ROLLBACK_FAILED`: stop apply and save; inspect only through Snapshot/screenshots and report the uncertainty.
179
55
  - `SAVE_FAILED`: retain the Session, address the stated cause and retry save if appropriate; do not claim it is saved before success.
180
56
  - `EDITOR_BUSY`: wait for the current command and keep operations serial.
181
- - `EDITOR_RPC_TIMEOUT`: execution status is unknown and the Bridge closes. Ordinary RPCs wait one minute; Save allows 5 minutes 30 seconds. Reads may reconnect to the same work and retry. For apply or save, reconnect to the same work and inspect its real state first; stop if inspection is impossible.
182
- - `PROTOCOL_VERSION_MISMATCH`: stop and update insMind CLI or use an Editor with the matching protocol.
57
+ - `EDITOR_RPC_TIMEOUT`: execution status is unknown and the Bridge closes. Reads may reconnect to the same work and retry. For apply or save, reconnect to the same work and inspect its real state first; stop if inspection is impossible.
58
+ - `PROTOCOL_VERSION_MISMATCH`: stop and follow the installation channel in the [update guidance](update.md), or use an Editor with the matching protocol. Do not bypass host management.
183
59
 
184
60
  A timed-out, cancelled or disconnected write may already have been submitted. Observe the real state before recovery to avoid duplicate creation, Apply or Save.
@@ -11,7 +11,7 @@ Use one Generation Constraints Part for a model and dynamic parameters. `model`
11
11
  "data": {
12
12
  "model": "<model>",
13
13
  "arguments": {
14
- "resolution": "2K"
14
+ "<parameter>": "<value from model detail and user request>"
15
15
  }
16
16
  }
17
17
  }
@@ -1,11 +1,16 @@
1
1
  # Update
2
2
 
3
+ When the user requests an upgrade or approves resolving a compatibility issue, discover the current installation channel's update behavior before updating:
4
+
3
5
  ```bash
6
+ insmind-cli update --help
4
7
  insmind-cli update
5
8
  ```
6
9
 
7
- This command checks npm `latest` for `@insmind/cli`, updates supported global npm or pnpm installations, and synchronizes the bundled `insmind-cli` Agent Skill even when the CLI is already current. npm enables lifecycle scripts only for this package with `--allow-scripts=@insmind/cli`; pnpm uses `--allow-build=@insmind/cli`.
10
+ Discover arguments, installation sources, lifecycle flags and Skill synchronization from `update --help` and command output; do not copy an old version's installation commands.
11
+
12
+ A version notice does not mean an upgrade or Skill synchronization has happened. Discover capabilities from the installed version; do not upgrade merely to query capabilities.
8
13
 
9
- Normal CLI use checks for updates at most once an hour and shows at most one notice per local day. Run `insmind-cli update` after a notice. Automatic checks neither install updates nor repair the Skill; `CI=true` disables checks.
14
+ For a host-managed installation, follow the channel-specific instructions returned by the command. Do not bypass host-managed updates, overwrite its Skill or repair it through another host's global installation. CLI and Skill version numbers need not match; the channel's minimum version and verification establish compatibility.
10
15
 
11
- For an installation managed by a host connector, follow the update command's channel-specific instructions so the host keeps its CLI and Skill versions matched. The command takes no arguments and has no `--json`. Unsupported installations receive explicit global npm or pnpm installation instructions. If the CLI updated but Skill verification failed, keep the new CLI version, follow stderr recovery steps and rerun the update command.
16
+ If the CLI updated but Skill verification failed, keep the new CLI version, follow stderr recovery steps and rerun the update command. Do not report partial failure as complete success.