@insmind/cli 2.1.8 → 3.0.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.
Files changed (60) hide show
  1. package/README.md +6 -2
  2. package/contracts/operations/tool.call/canvas-input.schema.json +0 -3
  3. package/contracts/presentations/agent.send.schema.json +280 -0
  4. package/contracts/presentations/model.get.schema.json +217 -0
  5. package/contracts/presentations/model.list.schema.json +129 -0
  6. package/contracts/presentations/task.get.schema.json +135 -0
  7. package/contracts/presentations/tool.call.schema.json +185 -0
  8. package/dist/bin/insmind-cli.js +6 -1
  9. package/dist/src/bootstrap/create-cli.js +7 -4
  10. package/dist/src/bootstrap/create-runtime.js +7 -32
  11. package/dist/src/cli/action-binding.js +2 -2
  12. package/dist/src/cli/agent-commands.js +5 -4
  13. package/dist/src/cli/auth-commands.js +1 -1
  14. package/dist/src/cli/dam-commands.js +18 -10
  15. package/dist/src/cli/errors.js +1 -35
  16. package/dist/src/cli/host-input.js +0 -11
  17. package/dist/src/cli/model-commands.js +6 -5
  18. package/dist/src/cli/skill-output.js +13 -0
  19. package/dist/src/cli/tool-commands.js +9 -5
  20. package/dist/src/features/skill/catalog.js +152 -0
  21. package/dist/src/features/skill/manual.js +71 -0
  22. package/dist/src/features/tool/archived-ocr-result.js +74 -0
  23. package/dist/src/features/tool/canvas-copy.js +2 -3
  24. package/dist/src/features/tool/canvas-models.js +2 -4
  25. package/dist/src/features/tool/canvas-recovery.js +3 -2
  26. package/dist/src/features/tool/canvas-results.js +1 -55
  27. package/dist/src/features/tool/canvas-tool-adapter.js +7 -10
  28. package/dist/src/features/tool/resource-authorizer.js +1 -1
  29. package/dist/src/features/tool/scene-catalog-adapter.js +20 -22
  30. package/dist/src/features/tool/tool-definitions.js +0 -1
  31. package/dist/src/product/config.js +0 -7
  32. package/dist/src/telemetry/command-routes.json +1 -1
  33. package/package.json +4 -4
  34. package/skills/insmind-cli/SKILL.md +9 -28
  35. package/contracts/operations/editor.apply/input.schema.json +0 -177
  36. package/contracts/operations/editor.apply/output.schema.json +0 -15
  37. package/contracts/operations/editor.connect/input.schema.json +0 -13
  38. package/contracts/operations/editor.connect/output.schema.json +0 -17
  39. package/contracts/operations/editor.disconnect/input.schema.json +0 -7
  40. package/contracts/operations/editor.disconnect/output.schema.json +0 -14
  41. package/contracts/operations/editor.save/input.schema.json +0 -7
  42. package/contracts/operations/editor.save/output.schema.json +0 -23
  43. package/contracts/operations/editor.screenshot/input.schema.json +0 -7
  44. package/contracts/operations/editor.screenshot/output.schema.json +0 -16
  45. package/contracts/operations/editor.snapshot/input.schema.json +0 -7
  46. package/contracts/operations/editor.snapshot/output.schema.json +0 -148
  47. package/contracts/operations/tool.call/models/image-ocr.schema.json +0 -20
  48. package/contracts/operations/tool.call/ocr-payload.schema.json +0 -64
  49. package/dist/src/cli/editor-commands.js +0 -136
  50. package/skills/insmind-cli/references/agent.md +0 -39
  51. package/skills/insmind-cli/references/auth.md +0 -8
  52. package/skills/insmind-cli/references/creation.md +0 -56
  53. package/skills/insmind-cli/references/dam.md +0 -52
  54. package/skills/insmind-cli/references/editor.md +0 -62
  55. package/skills/insmind-cli/references/errors.md +0 -42
  56. package/skills/insmind-cli/references/generation-constraints.md +0 -40
  57. package/skills/insmind-cli/references/matting.md +0 -27
  58. package/skills/insmind-cli/references/media-tools.md +0 -46
  59. package/skills/insmind-cli/references/tool.md +0 -24
  60. package/skills/insmind-cli/references/update.md +0 -18
@@ -1,6 +1,3 @@
1
- import { randomUUID } from "node:crypto";
2
- import { lazySchemaCompiler } from "../../platform/schema-compiler.js";
3
- import { contractDocument } from "../../contracts/schema.js";
4
1
  import { parseHttpAssetUrl, parseSafeRemoteAssetUrl } from "../../platform/url-safety.js";
5
2
  import { RemoteProtocolError } from "../../platform/remote-protocol.js";
6
3
  import { normalizeToolContent } from "./tool-api-adapter.js";
@@ -11,7 +8,7 @@ export function canvasContent(value) {
11
8
  if (record(value) && value.type === "resource" && record(value.resource)) {
12
9
  const resource = value.resource;
13
10
  // Real RPC resources include nullable text/image/task slots. URI wins for media;
14
- // OCR's inline JSON has text rather than a usable media URI.
11
+ // Inline JSON resources carry text.
15
12
  if (typeof resource.uri === "string" && resource.uri.trim())
16
13
  return normalizeToolContent(value);
17
14
  if (typeof resource.text === "string" && resource.text.trim())
@@ -37,57 +34,6 @@ export function oneResource(content) {
37
34
  export function link(uri, name, mimeType) {
38
35
  return [{ type: "resource_link", uri, name, mimeType }];
39
36
  }
40
- // A version or login-state query also imports this module through the command
41
- // graph. Compile each media contract only when that actual result needs it.
42
- const canvasCompiler = lazySchemaCompiler({ strict: true, allErrors: true });
43
- function canvasContract(file) {
44
- let validate;
45
- return (value) => {
46
- validate ??= canvasCompiler().compile(contractDocument(file));
47
- return validate(value);
48
- };
49
- }
50
- const validateOcr = canvasContract("tool.call/ocr-payload.schema.json");
51
- function assertOcrPayload(payload) {
52
- if (!validateOcr(payload))
53
- throw new RemoteProtocolError({}, undefined, "OCR_PAYLOAD_INVALID");
54
- }
55
- export function readOcrPayload(text) {
56
- let payload;
57
- try {
58
- payload = JSON.parse(text);
59
- }
60
- catch (cause) {
61
- throw new RemoteProtocolError({}, cause, "OCR_JSON_INVALID");
62
- }
63
- assertOcrPayload(payload);
64
- return payload;
65
- }
66
- export function ocrResult(content, image, id = randomUUID()) {
67
- const result = [];
68
- for (const part of content) {
69
- if (part.type === "resource_link") {
70
- result.push(part);
71
- continue;
72
- }
73
- let blocks;
74
- try {
75
- blocks = JSON.parse(part.type === "text" ? part.text : part.resource.text);
76
- }
77
- catch {
78
- result.push(part);
79
- continue;
80
- }
81
- const payload = { image, blocks };
82
- if (!Array.isArray(blocks) || !validateOcr(payload)) {
83
- result.push(part);
84
- continue;
85
- }
86
- result.push({ type: "resource", resource: { uri: part.type === "resource" ? part.resource.uri : `urn:uuid:${result.some(item => item.type === "resource") ? randomUUID() : id}`,
87
- mimeType: "application/json", text: JSON.stringify(payload) } });
88
- }
89
- return result;
90
- }
91
37
  export function templateResult(content) {
92
38
  if (content.some(part => part.type === "resource_link" &&
93
39
  (part.mimeType === "application/json" || part.name.toLowerCase().endsWith(".json"))))
@@ -12,7 +12,7 @@ import { presentToolContent } from "./tool-output.js";
12
12
  import { normalizeToolItems, queryToolResult, ToolTaskCanceledError, ToolTaskFailedError } from "./tool-api-adapter.js";
13
13
  import { expansionGeometry, expansionImage, invertSelectionMask, outlineImage } from "./canvas-media.js";
14
14
  import { createCanvasVideo, videoRatio, videoEditPrompt } from "./canvas-video.js";
15
- import { canvasContent, ocrResult, oneResource, record, templateResult } from "./canvas-results.js";
15
+ import { canvasContent, oneResource, record, templateResult } from "./canvas-results.js";
16
16
  import { estimateCanvasCost } from "./canvas-pricing.js";
17
17
  import { canvasProtocol, canvasRemoteControlArguments, unavailableCanvasMediaRoles } from "./canvas-models.js";
18
18
  import { assertNoLocalAssetPaths } from "./argument-paths.js";
@@ -52,9 +52,9 @@ export function createCanvasToolAdapter(dependencies) {
52
52
  const mediaFor = (access) => typeof dependencies.media === "function" ? dependencies.media(access) : dependencies.media;
53
53
  const sleep = dependencies.sleep ?? (async (ms, signal) => { await delay(ms, undefined, { signal }); });
54
54
  const segment = createCanvasSegmenter({ ...dependencies, wait });
55
- async function pipeline(context, model, stage, requiresFinalization, protocol, partialContent, verification) {
55
+ async function pipeline(context, model, stage, requiresFinalization, protocol, partialContent) {
56
56
  await context.observe?.({ toolPipeline: { protocol, model, stage, requiresFinalization,
57
- ...(partialContent ? { partialContent } : {}), ...(verification ? { verification } : {}) } });
57
+ ...(partialContent ? { partialContent } : {}) } });
58
58
  }
59
59
  async function wait(read, signal) {
60
60
  let failures = 0;
@@ -249,10 +249,10 @@ export function createCanvasToolAdapter(dependencies) {
249
249
  backend.ratio = "original";
250
250
  let image;
251
251
  let dimensions;
252
- if (selection || id.startsWith("image-expand-") || id === "image-ocr" || id === "image-text-edit" || protocol === "toolkit") {
252
+ if (selection || id.startsWith("image-expand-") || id === "image-text-edit" || protocol === "toolkit") {
253
253
  const { default: sharp } = await import("sharp");
254
254
  let source = await media.image(args.image, context.signal);
255
- if (id === "image-ocr" || id === "image-text-edit") {
255
+ if (id === "image-text-edit") {
256
256
  const bytes = await sharp(source.bytes).resize({ width: 3000, height: 3000, fit: "inside", withoutEnlargement: true }).flatten({ background: "white" }).jpeg().toBuffer();
257
257
  const info = await sharp(bytes).metadata();
258
258
  source = { bytes, width: info.width, height: info.height };
@@ -286,7 +286,7 @@ export function createCanvasToolAdapter(dependencies) {
286
286
  backend.inner_xy_points = JSON.stringify(geometry.corners);
287
287
  }
288
288
  }
289
- image = await media.upload(prepared, id === "image-ocr" || id === "image-text-edit" ? "jpg" : "png", context.access, context.signal);
289
+ image = await media.upload(prepared, id === "image-text-edit" ? "jpg" : "png", context.access, context.signal);
290
290
  dimensions = { width: source.width, height: source.height };
291
291
  }
292
292
  else {
@@ -335,8 +335,7 @@ export function createCanvasToolAdapter(dependencies) {
335
335
  if (id === "image-remove-standard")
336
336
  backend.contentid = backend.content_id;
337
337
  const toolPipeline = { protocol, model: id, stage: "submitted", requiresFinalization: isMatting,
338
- ...(isMatting ? { matting: { cropToSubject: args.cropToSubject === true } } : {}),
339
- ...(id === "image-ocr" ? { verification: { ocr: { uri: image, ...dimensions } } } : {}) };
338
+ ...(isMatting ? { matting: { cropToSubject: args.cropToSubject === true } } : {}) };
340
339
  await context.observe?.({ toolPipeline });
341
340
  const content = await call(code, serviceArguments(), context, protocol);
342
341
  if (id === "image-matting-smart") {
@@ -347,8 +346,6 @@ export function createCanvasToolAdapter(dependencies) {
347
346
  });
348
347
  return content.map(item => item.type === "resource_link" ? result[0] : item);
349
348
  }
350
- if (id === "image-ocr")
351
- return ocrResult(content, { uri: image, ...dimensions });
352
349
  if (protocol === "toolkit")
353
350
  return templateResult(content);
354
351
  return presentToolContent(content, "image", dependencies.onMissingMedia);
@@ -1,4 +1,4 @@
1
- import { readOcrPayload } from "./canvas-results.js";
1
+ import { readOcrPayload } from "./archived-ocr-result.js";
2
2
  import { RemoteProtocolError } from "../../platform/remote-protocol.js";
3
3
  /** Reauthorize both top-level media and the OCR image reference, without interpreting arbitrary text as URLs. */
4
4
  export async function authorizeToolResources(output, authorizer, access, signal) {
@@ -1,33 +1,31 @@
1
1
  import { canvasModel, canvasModelBindings } from "./canvas-models.js";
2
2
  import { RemoteRequestError } from "../../platform/signed-http-transport.js";
3
3
  import { record } from "./canvas-results.js";
4
- const bindingForCode = (code) => canvasModelBindings.find(binding => binding[2] === code)[1];
4
+ const textEdit = canvasModelBindings.find(binding => binding[2] === "TextEdit");
5
5
  /** Legacy scenes have fixed protocols, unlike the MNS model pickers. Availability is read separately. */
6
6
  export function createSceneCatalogAdapter(dependencies) {
7
7
  return { async load(input) {
8
8
  const catalog = await dependencies.catalog.load(input);
9
- for (const code of ["TextEdit", "new-image-ocr"]) {
10
- try {
11
- const scene = await dependencies.transport.getJson({ path: `/gdesign/tool/manage/scenes/code/${code}`, ...input.access, signal: input.signal });
12
- if (!record(scene) || scene.scene_code !== code || scene.status !== 1)
13
- continue;
14
- const binding = canvasModelBindings.find(binding => binding[2] === code);
15
- const cost = scene.is_free === true ? 0 : typeof scene.point_rights === "number" && Number.isFinite(scene.point_rights) && scene.point_rights >= 0 ? scene.point_rights : undefined;
16
- if (cost === undefined) {
17
- catalog.warnings.push(dependencies.english ? `Current pricing is unavailable for ${binding[1]}.` : `${binding[1]} 的当前报价不可用。`);
18
- }
19
- const raw = { tool: binding[0], model: code, title: binding[4], sceneSort: 0, modelSort: 0, parameters: [],
20
- ...(cost === undefined ? {} : { cost: { unit: "gaodou", minimum: cost, maximum: cost } }),
21
- outputMediaTypes: code === "new-image-ocr" ? ["application/json"] : ["image/jpeg", "image/png"] };
22
- catalog.models.push(canvasModel(raw, binding, {}, dependencies.english));
23
- }
24
- catch (error) {
25
- input.signal.throwIfAborted();
26
- if (error instanceof RemoteRequestError && error.status === 404)
27
- continue;
28
- // Do not misreport a network failure as a published offline state.
29
- catalog.warnings.push(dependencies.english ? `Unable to verify the current availability of ${bindingForCode(code)}.` : `暂时无法核实 ${bindingForCode(code)} 的当前可用性。`);
9
+ const code = textEdit[2];
10
+ try {
11
+ const scene = await dependencies.transport.getJson({ path: `/gdesign/tool/manage/scenes/code/${code}`, ...input.access, signal: input.signal });
12
+ if (!record(scene) || scene.scene_code !== code || scene.status !== 1)
13
+ return catalog;
14
+ const cost = scene.is_free === true ? 0 : typeof scene.point_rights === "number" && Number.isFinite(scene.point_rights) && scene.point_rights >= 0 ? scene.point_rights : undefined;
15
+ if (cost === undefined) {
16
+ catalog.warnings.push(dependencies.english ? `Current pricing is unavailable for ${textEdit[1]}.` : `${textEdit[1]} 的当前报价不可用。`);
30
17
  }
18
+ const raw = { tool: textEdit[0], model: code, title: textEdit[4], sceneSort: 0, modelSort: 0, parameters: [],
19
+ ...(cost === undefined ? {} : { cost: { unit: "gaodou", minimum: cost, maximum: cost } }),
20
+ outputMediaTypes: ["image/jpeg", "image/png"] };
21
+ catalog.models.push(canvasModel(raw, textEdit, {}, dependencies.english));
22
+ }
23
+ catch (error) {
24
+ input.signal.throwIfAborted();
25
+ if (error instanceof RemoteRequestError && error.status === 404)
26
+ return catalog;
27
+ // Do not misreport a network failure as a published offline state.
28
+ catalog.warnings.push(dependencies.english ? `Unable to verify the current availability of ${textEdit[1]}.` : `暂时无法核实 ${textEdit[1]} 的当前可用性。`);
31
29
  }
32
30
  return catalog;
33
31
  } };
@@ -15,7 +15,6 @@ export const defaultToolDefinitions = [
15
15
  { name: "image.enhance", title: "图片变清晰", description: "标准超分或生成式修复;智能修复可能改变细节。" },
16
16
  { name: "image.expand", title: "图片扩图", description: "按目标画布和原图位置补绘外围。" },
17
17
  { name: "image.text_edit", title: "图片改字", description: "按原文替换或删除图片文字,不承诺定位重复原文中的某一次。" },
18
- { name: "image.ocr", title: "图片文字识别", description: "返回实际识别图尺寸、文字、类别和像素坐标。" },
19
18
  { name: "image.layers", title: "图片图文分层", description: "交付原生稿定模板 JSON,保留图层结构。" },
20
19
  { name: "image.vectorize", title: "图片转矢量", description: "将位图转换为 SVG。" },
21
20
  { name: "video.edit", title: "视频修改", description: "按原视频修改内容,时长由真实素材推导。" },
@@ -19,9 +19,6 @@ export const gaodingProduct = freezeProduct({
19
19
  deviceClientId: "gdhub-cli",
20
20
  pricingUrl: new URL("https://www.gaoding.art/pricing"),
21
21
  telemetryUrl: new URL("https://gaoding-log-ai-gpu.cn-hangzhou.log.aliyuncs.com/logstores/gd-cli/track?APIVersion=0.6.0"),
22
- defaultEditorCreateUrl: new URL("https://www.gaoding.art/editor/canvas?mode=create&type=board"),
23
- editorWorkUrl: new URL("https://www.gaoding.art/editor/canvas"),
24
- restrictEditorTargets: false,
25
22
  endpoints: {
26
23
  orgApi: gaodingApi,
27
24
  creditsApi: gaodingApi,
@@ -49,9 +46,6 @@ export const insmindProduct = freezeProduct({
49
46
  deviceClientId: "gdhub-cli",
50
47
  pricingUrl: new URL("https://www.insmind.com/pricing"),
51
48
  telemetryUrl: new URL("https://gaoding-log-ai-gpu-use.us-east-1.log.aliyuncs.com/logstores/gd-cli/track?APIVersion=0.6.0"),
52
- defaultEditorCreateUrl: new URL("https://www.insmind.com/editor/canvas?mode=create&type=board"),
53
- editorWorkUrl: new URL("https://www.insmind.com/editor/canvas"),
54
- restrictEditorTargets: true,
55
49
  endpoints: {
56
50
  orgApi: insmindApi,
57
51
  creditsApi: insmindApi,
@@ -82,7 +76,6 @@ export const insmindProduct = freezeProduct({
82
76
  { "name": "image.enhance", "title": "Image enhancement", "description": "Upscale pixels or restore image details." },
83
77
  { "name": "image.expand", "title": "Image expansion", "description": "Extend a canvas with explicit source placement." },
84
78
  { "name": "image.text_edit", "title": "Image text editing", "description": "Replace specified text in an image." },
85
- { "name": "image.ocr", "title": "Text recognition", "description": "Recognize text and its pixel coordinates." },
86
79
  { "name": "image.layers", "title": "Image decomposition", "description": "Convert an image to an editable native template." },
87
80
  { "name": "image.vectorize", "title": "Image vectorization", "description": "Convert a bitmap to vector SVG." },
88
81
  { "name": "video.edit", "title": "Video editing", "description": "Edit a video using instructions and optional references." },
@@ -1 +1 @@
1
- {"operation":"unknown","action":false,"options":["-V, --version","--json-errors","--locale <locale>"],"children":{"auth":{"operation":"auth","action":false,"options":[],"children":{"login":{"operation":"auth.login","action":true,"options":["--no-browser","--require-browser"],"children":{}},"status":{"operation":"auth.status","action":true,"options":["--json"],"children":{}},"logout":{"operation":"auth.logout","action":true,"options":[],"children":{}}}},"agent":{"operation":"agent","action":false,"options":[],"children":{"send":{"operation":"agent.send","action":true,"options":["--schema","--input <file|->","--async","--json"],"children":{}}}},"tool":{"operation":"tool","action":false,"options":[],"children":{"list":{"operation":"tool.list","action":true,"options":["--json"],"children":{}},"call":{"operation":"tool.call","action":true,"options":["--schema","--input <file|->","--async","--json"],"children":{}}}},"model":{"operation":"model","action":false,"options":[],"children":{"list":{"operation":"model.list","action":true,"options":["--tool <tool>","--json"],"children":{}},"get":{"operation":"model.get","action":true,"options":["--tool <tool>","--json"],"children":{}}}},"editor":{"operation":"editor","action":false,"options":[],"children":{"connect":{"operation":"editor.connect","action":true,"options":["--json"],"children":{}},"disconnect":{"operation":"editor.disconnect","action":true,"options":["--json"],"children":{}},"snapshot":{"operation":"editor.snapshot","action":true,"options":["--json"],"children":{}},"apply":{"operation":"editor.apply","action":true,"options":["--schema","--input <file|->","--json"],"children":{}},"screenshot":{"operation":"editor.screenshot","action":true,"options":["--json"],"children":{}},"save":{"operation":"editor.save","action":true,"options":["--json"],"children":{}}}},"dam":{"operation":"dam","action":false,"options":[],"children":{"repository":{"operation":"dam.repository","action":false,"options":[],"children":{"list":{"operation":"dam.repository.list","action":true,"options":["--json"],"children":{}}}},"folder":{"operation":"dam.folder","action":false,"options":[],"children":{"list":{"operation":"dam.folder.list","action":true,"options":["--repository-id <id>","--parent-id <id>","--query <text>","--page <n>","--page-size <number>","--json"],"children":{}}}},"tag":{"operation":"dam.tag","action":false,"options":[],"children":{"list":{"operation":"dam.tag.list","action":true,"options":["--repository-id <id>","--query <text>","--json"],"children":{}}}},"download":{"operation":"dam.download","action":true,"options":["--repository-id <id>","--output-dir <directory>","--json"],"children":{}},"rename":{"operation":"dam.rename","action":true,"options":["--kind <asset|folder>","--title <title>","--repository-id <id>","--json"],"children":{}},"move":{"operation":"dam.move","action":true,"options":["--kind <asset|folder>","--target-folder-id <id>","--repository-id <source-id>","--target-repository-id <target-id>","--json"],"children":{}},"copy":{"operation":"dam.copy","action":true,"options":["--kind <asset|folder>","--target-folder-id <id>","--repository-id <source-id>","--target-repository-id <target-id>","--json"],"children":{}},"list":{"operation":"dam.list","action":true,"options":["--repository-id <id>","--all-repositories","--folder-id <id>","--no-include-child-folder","--type <type>","--asset-format <csv>","--tag-ids <csv>","--page-size <number>","--cursor <id>","--json"],"children":{}},"search":{"operation":"dam.search","action":true,"options":["--repository-id <id>","--all-repositories","--folder-id <id>","--no-include-child-folder","--type <type>","--asset-format <csv>","--tag-ids <csv>","--page-size <number>","--cursor <id>","--json"],"children":{}},"get":{"operation":"dam.get","action":true,"options":["--json"],"children":{}},"upload":{"operation":"dam.upload","action":true,"options":["--repository-id <id>","--title <title>","--folder-id <id>","--tag-ids <csv>","--allow-sensitive-path","--wait-analysis","--json"],"children":{}},"delete":{"operation":"dam.delete","action":true,"options":["--repository-id <id>","--permanent"],"children":{}}}},"update":{"operation":"update","action":true,"options":[],"children":{"check":{"operation":"update.check","action":true,"options":["--for-display","--schema","--json"],"children":{}}}},"task":{"operation":"task","action":false,"options":[],"children":{"list":{"operation":"task.list","action":true,"options":["--limit <number>","--operation <operation>","--json"],"children":{}},"get":{"operation":"task.get","action":true,"options":["--json"],"children":{}}}},"credits":{"operation":"credits.get","action":true,"options":["--json","--schema"],"children":{"usage":{"operation":"credits.usage","action":false,"options":[],"children":{"list":{"operation":"credits.usage.list","action":true,"options":["--from <timestamp>","--to <timestamp>","--limit <number>","--cursor <cursor>","--json","--schema"],"children":{}},"get":{"operation":"credits.usage.get","action":true,"options":["--json","--schema"],"children":{}}}}}}}}
1
+ {"operation":"unknown","action":false,"options":["-V, --version","--json-errors","--locale <locale>"],"children":{"auth":{"operation":"auth","action":false,"options":[],"children":{"login":{"operation":"auth.login","action":true,"options":["--no-browser","--require-browser"],"children":{}},"status":{"operation":"auth.status","action":true,"options":["--json"],"children":{}},"logout":{"operation":"auth.logout","action":true,"options":[],"children":{}}}},"agent":{"operation":"agent","action":false,"options":[],"children":{"send":{"operation":"agent.send","action":true,"options":["--schema","--input <file|->","--async","--json","--with-skills"],"children":{}}}},"tool":{"operation":"tool","action":false,"options":[],"children":{"list":{"operation":"tool.list","action":true,"options":["--json"],"children":{}},"call":{"operation":"tool.call","action":true,"options":["--schema","--input <file|->","--async","--json","--with-skills"],"children":{}}}},"model":{"operation":"model","action":false,"options":[],"children":{"list":{"operation":"model.list","action":true,"options":["--tool <tool>","--json","--with-skills"],"children":{}},"get":{"operation":"model.get","action":true,"options":["--tool <tool>","--json","--with-skills"],"children":{}}}},"dam":{"operation":"dam","action":false,"options":[],"children":{"repository":{"operation":"dam.repository","action":false,"options":[],"children":{"list":{"operation":"dam.repository.list","action":true,"options":["--json"],"children":{}}}},"folder":{"operation":"dam.folder","action":false,"options":[],"children":{"list":{"operation":"dam.folder.list","action":true,"options":["--repository-id <id>","--parent-id <id>","--query <text>","--page <n>","--page-size <number>","--json"],"children":{}}}},"tag":{"operation":"dam.tag","action":false,"options":[],"children":{"list":{"operation":"dam.tag.list","action":true,"options":["--repository-id <id>","--query <text>","--json"],"children":{}}}},"download":{"operation":"dam.download","action":true,"options":["--repository-id <id>","--output-dir <directory>","--json"],"children":{}},"rename":{"operation":"dam.rename","action":true,"options":["--kind <asset|folder>","--title <title>","--repository-id <id>","--json"],"children":{}},"move":{"operation":"dam.move","action":true,"options":["--kind <asset|folder>","--target-folder-id <id>","--repository-id <source-id>","--target-repository-id <target-id>","--json"],"children":{}},"copy":{"operation":"dam.copy","action":true,"options":["--kind <asset|folder>","--target-folder-id <id>","--repository-id <source-id>","--target-repository-id <target-id>","--json"],"children":{}},"list":{"operation":"dam.list","action":true,"options":["--repository-id <id>","--all-repositories","--folder-id <id>","--no-include-child-folder","--type <type>","--asset-format <csv>","--tag-ids <csv>","--page-size <number>","--cursor <id>","--json"],"children":{}},"search":{"operation":"dam.search","action":true,"options":["--repository-id <id>","--all-repositories","--folder-id <id>","--no-include-child-folder","--type <type>","--asset-format <csv>","--tag-ids <csv>","--page-size <number>","--cursor <id>","--json"],"children":{}},"get":{"operation":"dam.get","action":true,"options":["--json"],"children":{}},"upload":{"operation":"dam.upload","action":true,"options":["--repository-id <id>","--title <title>","--folder-id <id>","--tag-ids <csv>","--allow-sensitive-path","--wait-analysis","--json"],"children":{}},"delete":{"operation":"dam.delete","action":true,"options":["--repository-id <id>","--permanent"],"children":{}}}},"update":{"operation":"update","action":true,"options":[],"children":{"check":{"operation":"update.check","action":true,"options":["--for-display","--schema","--json"],"children":{}}}},"task":{"operation":"task","action":false,"options":[],"children":{"list":{"operation":"task.list","action":true,"options":["--limit <number>","--operation <operation>","--json"],"children":{}},"get":{"operation":"task.get","action":true,"options":["--json"],"children":{}}}},"credits":{"operation":"credits.get","action":true,"options":["--json","--schema"],"children":{"usage":{"operation":"credits.usage","action":false,"options":[],"children":{"list":{"operation":"credits.usage.list","action":true,"options":["--from <timestamp>","--to <timestamp>","--limit <number>","--cursor <cursor>","--json","--schema"],"children":{}},"get":{"operation":"credits.usage.get","action":true,"options":["--json","--schema"],"children":{}}}}}}}}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@insmind/cli",
3
- "version": "2.1.8",
3
+ "version": "3.0.0",
4
4
  "description": "insMind command-line interface for agents and people.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -50,8 +50,8 @@
50
50
  "#model-catalog": "./dist/shared/model-catalog/index.js"
51
51
  },
52
52
  "gaodingRelease": {
53
- "sourceCommit": "73af28fbe85c58880ecc38056269cd72d7e62364",
54
- "pipelineId": "272102",
55
- "pipelineUrl": "https://git.intra.gaoding.com/gtt/gaoding-cli/-/pipelines/272102"
53
+ "sourceCommit": "93fd122bc191724092f6cc9b7148438e032a0523",
54
+ "pipelineId": "272894",
55
+ "pipelineUrl": "https://git.intra.gaoding.com/gtt/gaoding-cli/-/pipelines/272894"
56
56
  }
57
57
  }
@@ -1,41 +1,22 @@
1
1
  ---
2
2
  name: insmind-cli
3
- description: Use insMind for business planning and multi-turn creation, compare tools and credit prices, create or edit images, videos or text, operate the insMind editor, or manage DAM assets.
3
+ description: Use the installed insMind CLI to plan or create content, edit images and videos, manage assets, or retrieve earlier tasks.
4
4
  ---
5
5
 
6
6
  # insMind CLI
7
7
 
8
- ## Discover current capabilities on demand
8
+ ## Get started
9
9
 
10
- - For `agent send`, `tool call` and `editor apply`, set the top-level `host_application` to the calling app. A Codex agent running a shell command uses `codex`. Other hosts use their own names, such as `workbuddy`, `qwenwork` or `trae`. Use `terminal` only when a person runs the command directly.
11
- - 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.
12
- - Relay an available update to the user alongside their foreground result, at most once per hour. For stdout-only hosts, see “Update” below.
13
- - 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.
14
- - Choose by the object first: discover attachment/media-link processing (including text replacement, layers and vectorization) with `tool list`; Editor operates elements in a connected work identified by a work ID or editor URL. Reading Editor help alone does not establish whether image processing is supported.
15
- - When the user explicitly requests insMind planning, creation or processing, completion requires an actual CLI call and service reply. Discover and call Agent for planning too; locally written advice is not an insMind reply. Read the selected model's `model get` detail before deciding whether it meets the request; a list summary alone does not establish a limitation. Local interpolation or tracing does not replace the requested insMind call. Local scripts may prepare inputs; report any substitute separately without claiming the insMind task is complete.
16
- - Construct and save complete JSON from the Schema before running `--input request.json`. Input is not an interactive form. With `--input -`, pipe or redirect the complete JSON in the same shell command; running it alone will not prompt for fields. For local media inside JSON, generate URIs with `Path(path).resolve().as_uri()` or `pathToFileURL(path).href`, preserving filenames and escaping Unicode, spaces and `#`.
17
- - 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.
18
- - Discovery describes the installed CLI; it neither upgrades it nor authorizes generation, writes or installation. Recover unknown outcomes through the error-handling reference.
10
+ Use the installed `insmind-cli --help`, then the selected command's help and input schema. Discover models, supported parameters and prices in the current account's live catalog.
19
11
 
20
- ## Creation execution boundaries
12
+ ## Choose a route
21
13
 
22
- After choosing the route, read [Tool](references/tool.md) or [Agent](references/agent.md) before submitting. The scenario references below help select capabilities and prepare inputs; they do not replace the execution workflow.
14
+ Use `insmind-cli agent send` when the user delegates a design decision, requests a complete deliverable such as a product listing image, or continues a creative project. Pass the original goal, assets and constraints. For a single specified operation, discover it with `insmind-cli tool list` and execute it with `insmind-cli tool call <tool>`.
23
15
 
24
- - For delivery now, use the default synchronous command. Keep the host's exit status and process handle, then wait on that process for the complete result. If the handle is lost, track the CLI taskId from stderr and keep waiting while running.
25
- - When the user asks for later pickup, use `--async`. On acceptance, give the user the taskId and current state and end this turn. Retrieve that task when the user returns.
26
- - Deliver the first usable service result. Do not switch models, adjust a selection or create again just to fix a perceived visual deviation. Explain the difference and let the user decide on revisions. Preparing inputs before submission, querying the original task and downloading its result are not additional creation.
27
- - Treat resource URLs explicitly returned for delivery as complete values. Copy them exactly or save and reference them; do not retype, splice, truncate or remove query parameters. Retrieve the actual returned link again instead of reconstructing it from memory.
28
- - Tool price ranges are estimates even when both bounds are equal. For Agent actual usage and ledger verification, see [cost sources](references/errors.md#cost-sources).
16
+ ## Find guidance
29
17
 
30
- ## Read task guidance
18
+ Browse the catalog with `insmind-cli --skill`. When you look up a model or submit a creation, `relatedSkills` in the JSON result lists matching guides and their read commands by default. Use `insmind-cli --skill <chapter>` for any guides you choose, or deliver the result directly. Older installations provide command help through `insmind-cli --help`.
31
19
 
32
- Read only the reference for the user's goal:
20
+ ## Continue and deliver
33
21
 
34
- - Choose Agent or Tool creation, discover models, and generate images, videos or text: [Creation](references/creation.md)
35
- - Process attached/linked images or videos, including text replacement, layers and vectorization; prepare references and masks: [Media tool selection](references/media-tools.md)
36
- - Remove backgrounds, extract a subject, deliver transparent PNGs, or reconstruct an occluded object: [Matting](references/matting.md)
37
- - Operate Shape/Connector elements in a connected work; preview, save or disconnect: [Editor](references/editor.md)
38
- - Discover repositories, folders and tags; find, upload, download or manage DAM assets: [Asset management](references/dam.md)
39
- - Sign in or inspect account credits: [Authentication](references/auth.md)
40
- - Track accepted/running creation, retrieve async results and interpret costs, warnings, failures or interruptions: [Errors](references/errors.md)
41
- - Update the CLI and bundled Agent Skill: [Update](references/update.md)
22
+ Continue a conversation with its original context. Retrieve submitted work with `insmind-cli task get`. Check the original task if submission was uncertain. Deliver the returned text or complete asset links and distinguish actual charges from estimates.
@@ -1,177 +0,0 @@
1
- {
2
- "$schema": "https://json-schema.org/draft/2020-12/schema",
3
- "title": "EditorApplyInput",
4
- "type": "array",
5
- "items": {
6
- "oneOf": [
7
- {
8
- "$ref": "#/$defs/EditorUpsertAction"
9
- },
10
- {
11
- "$ref": "#/$defs/EditorDeleteAction"
12
- }
13
- ]
14
- },
15
- "$defs": {
16
- "EditorUpsertAction": {
17
- "title": "EditorUpsertAction",
18
- "type": "object",
19
- "additionalProperties": false,
20
- "required": [
21
- "_type",
22
- "element"
23
- ],
24
- "properties": {
25
- "_type": {
26
- "type": "string",
27
- "enum": [
28
- "create",
29
- "update"
30
- ]
31
- },
32
- "element": {
33
- "oneOf": [
34
- {
35
- "$ref": "#/$defs/EditorShape"
36
- },
37
- {
38
- "$ref": "#/$defs/EditorConnector"
39
- }
40
- ]
41
- }
42
- }
43
- },
44
- "EditorDeleteAction": {
45
- "title": "EditorDeleteAction",
46
- "type": "object",
47
- "additionalProperties": false,
48
- "required": [
49
- "_type",
50
- "id"
51
- ],
52
- "properties": {
53
- "_type": {
54
- "const": "delete"
55
- },
56
- "id": {
57
- "type": "string",
58
- "minLength": 1,
59
- "pattern": ".*\\S.*"
60
- }
61
- }
62
- },
63
- "EditorShape": {
64
- "title": "EditorShape",
65
- "type": "object",
66
- "additionalProperties": false,
67
- "required": [
68
- "_type",
69
- "id",
70
- "shapeType",
71
- "x",
72
- "y",
73
- "w",
74
- "h",
75
- "fill",
76
- "stroke"
77
- ],
78
- "properties": {
79
- "_type": {
80
- "const": "shape"
81
- },
82
- "id": {
83
- "type": "string",
84
- "minLength": 1,
85
- "pattern": ".*\\S.*"
86
- },
87
- "shapeType": {
88
- "type": "string",
89
- "enum": [
90
- "rectangle",
91
- "rounded-rectangle",
92
- "triangle-up",
93
- "ellipse",
94
- "diamond"
95
- ]
96
- },
97
- "x": {
98
- "type": "number"
99
- },
100
- "y": {
101
- "type": "number"
102
- },
103
- "w": {
104
- "type": "number"
105
- },
106
- "h": {
107
- "type": "number"
108
- },
109
- "text": {
110
- "type": "string"
111
- },
112
- "fill": {
113
- "type": "string",
114
- "minLength": 1,
115
- "pattern": ".*\\S.*"
116
- },
117
- "stroke": {
118
- "anyOf": [
119
- {
120
- "type": "string",
121
- "minLength": 1,
122
- "pattern": ".*\\S.*"
123
- },
124
- {
125
- "type": "null"
126
- }
127
- ]
128
- }
129
- }
130
- },
131
- "EditorConnector": {
132
- "title": "EditorConnector",
133
- "type": "object",
134
- "additionalProperties": false,
135
- "required": [
136
- "_type",
137
- "id",
138
- "fromId",
139
- "toId",
140
- "lineType",
141
- "color"
142
- ],
143
- "properties": {
144
- "_type": {
145
- "const": "connector"
146
- },
147
- "id": {
148
- "type": "string",
149
- "minLength": 1,
150
- "pattern": ".*\\S.*"
151
- },
152
- "fromId": {
153
- "type": "string",
154
- "minLength": 1,
155
- "pattern": ".*\\S.*"
156
- },
157
- "toId": {
158
- "type": "string",
159
- "minLength": 1,
160
- "pattern": ".*\\S.*"
161
- },
162
- "lineType": {
163
- "type": "string",
164
- "enum": [
165
- "straight",
166
- "elbowed"
167
- ]
168
- },
169
- "color": {
170
- "type": "string",
171
- "minLength": 1,
172
- "pattern": ".*\\S.*"
173
- }
174
- }
175
- }
176
- }
177
- }
@@ -1,15 +0,0 @@
1
- {
2
- "$schema": "https://json-schema.org/draft/2020-12/schema",
3
- "title": "EditorApplyResult",
4
- "type": "object",
5
- "additionalProperties": false,
6
- "required": [
7
- "appliedCount"
8
- ],
9
- "properties": {
10
- "appliedCount": {
11
- "type": "integer",
12
- "minimum": 0
13
- }
14
- }
15
- }
@@ -1,13 +0,0 @@
1
- {
2
- "$schema": "https://json-schema.org/draft/2020-12/schema",
3
- "title": "EditorConnectInput",
4
- "type": "object",
5
- "additionalProperties": false,
6
- "properties": {
7
- "target": {
8
- "type": "string",
9
- "minLength": 1,
10
- "pattern": ".*\\S.*"
11
- }
12
- }
13
- }
@@ -1,17 +0,0 @@
1
- {
2
- "$schema": "https://json-schema.org/draft/2020-12/schema",
3
- "title": "EditorConnectResult",
4
- "type": "object",
5
- "additionalProperties": false,
6
- "required": [
7
- "target"
8
- ],
9
- "properties": {
10
- "target": {
11
- "type": "string",
12
- "format": "uri",
13
- "minLength": 1,
14
- "pattern": ".*\\S.*"
15
- }
16
- }
17
- }
@@ -1,7 +0,0 @@
1
- {
2
- "$schema": "https://json-schema.org/draft/2020-12/schema",
3
- "title": "EditorDisconnectInput",
4
- "type": "object",
5
- "additionalProperties": false,
6
- "properties": {}
7
- }
@@ -1,14 +0,0 @@
1
- {
2
- "$schema": "https://json-schema.org/draft/2020-12/schema",
3
- "title": "EditorDisconnectResult",
4
- "type": "object",
5
- "additionalProperties": false,
6
- "required": [
7
- "disconnected"
8
- ],
9
- "properties": {
10
- "disconnected": {
11
- "type": "boolean"
12
- }
13
- }
14
- }
@@ -1,7 +0,0 @@
1
- {
2
- "$schema": "https://json-schema.org/draft/2020-12/schema",
3
- "title": "EditorSaveInput",
4
- "type": "object",
5
- "additionalProperties": false,
6
- "properties": {}
7
- }
@@ -1,23 +0,0 @@
1
- {
2
- "$schema": "https://json-schema.org/draft/2020-12/schema",
3
- "title": "EditorSaveResult",
4
- "type": "object",
5
- "additionalProperties": false,
6
- "required": [
7
- "workId",
8
- "url"
9
- ],
10
- "properties": {
11
- "workId": {
12
- "type": "string",
13
- "minLength": 1,
14
- "pattern": ".*\\S.*"
15
- },
16
- "url": {
17
- "type": "string",
18
- "format": "uri",
19
- "minLength": 1,
20
- "pattern": ".*\\S.*"
21
- }
22
- }
23
- }