@insmind/cli 2.1.0 → 2.1.2
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 +30 -0
- package/contracts/operations/agent.send/input.schema.json +1 -77
- package/contracts/operations/dam.folder.list/input.schema.json +0 -1
- package/contracts/operations/dam.folder.list/output.schema.json +1 -2
- package/contracts/operations/dam.list/input.schema.json +3 -6
- package/contracts/operations/dam.list/output.schema.json +1 -2
- package/contracts/operations/dam.search/input.schema.json +3 -6
- package/contracts/operations/dam.search/output.schema.json +1 -2
- package/contracts/operations/tool.call/models/image-edit-smart.schema.json +1 -2
- package/contracts/operations/tool.call/models/image-expand-smart.schema.json +1 -2
- package/contracts/operations/tool.call/models/image-layers-smart.schema.json +1 -3
- package/contracts/operations/tool.call/models/video-edit-smart.schema.json +0 -3
- package/contracts/operations/tool.call/ocr-payload.schema.json +4 -5
- package/dist/bin/postinstall.js +22 -6
- package/dist/bin/sync-skill.js +33 -0
- package/dist/bin/task-worker.js +2 -2
- package/dist/src/bootstrap/create-cli.js +13 -6
- package/dist/src/bootstrap/create-runtime.js +103 -29
- package/dist/src/bootstrap/run-task-worker.js +6 -2
- package/dist/src/bootstrap/validators.js +87 -151
- package/dist/src/cli/action-binding.js +14 -37
- package/dist/src/cli/agent-commands.js +13 -13
- package/dist/src/cli/auth-commands.js +2 -1
- package/dist/src/cli/creation-help.js +9 -0
- package/dist/src/cli/dam-commands.js +10 -14
- package/dist/src/cli/editor-commands.js +16 -12
- package/dist/src/cli/errors.js +84 -26
- package/dist/src/cli/host-input.js +62 -5
- package/dist/src/cli/model-commands.js +9 -3
- package/dist/src/cli/observed-errors.js +7 -3
- package/dist/src/cli/org-commands.js +3 -1
- package/dist/src/cli/presenter.js +4 -5
- package/dist/src/cli/task-commands.js +6 -2
- package/dist/src/cli/tool-commands.js +12 -11
- package/dist/src/contracts/creation-input.js +20 -17
- package/dist/src/features/agent/creative-agent-adapter.js +6 -2
- package/dist/src/features/agent/creative-protocol.js +8 -29
- package/dist/src/features/agent/resource-authorizer.js +25 -17
- package/dist/src/features/agent/result-reader.js +31 -14
- package/dist/src/features/agent/use-cases.js +6 -31
- package/dist/src/features/auth/credential-store.js +1 -0
- package/dist/src/features/credits/use-cases.js +55 -28
- package/dist/src/features/dam/asset-projection.js +3 -6
- package/dist/src/features/dam/dam-api-adapter.js +30 -15
- package/dist/src/features/dam/object-storage.js +2 -1
- package/dist/src/features/dam/repository-catalog.js +30 -21
- package/dist/src/features/dam/use-cases.js +14 -9
- package/dist/src/features/editor/bridge-client.js +0 -2
- package/dist/src/features/editor/bridge-process.js +3 -2
- package/dist/src/features/editor/public-url.js +1 -36
- package/dist/src/features/editor/session-state.js +1 -0
- package/dist/src/features/editor/session.js +3 -2
- package/dist/src/features/editor/use-cases.js +27 -2
- package/dist/src/features/org/org-service.js +10 -1
- package/dist/src/features/org/use-cases.js +18 -4
- package/dist/src/features/task/process-owner.js +54 -0
- package/dist/src/features/task/store.js +102 -32
- package/dist/src/features/task/task-background.js +8 -4
- package/dist/src/features/task/use-cases.js +184 -84
- package/dist/src/features/tool/argument-paths.js +14 -0
- package/dist/src/features/tool/canvas-copy.js +28 -15
- package/dist/src/features/tool/canvas-matting.js +123 -0
- package/dist/src/features/tool/canvas-media.js +102 -55
- package/dist/src/features/tool/canvas-models.js +66 -33
- package/dist/src/features/tool/canvas-pricing.js +12 -0
- package/dist/src/features/tool/canvas-recovery.js +13 -30
- package/dist/src/features/tool/canvas-results.js +92 -93
- package/dist/src/features/tool/canvas-tool-adapter.js +134 -157
- package/dist/src/features/tool/canvas-video.js +44 -37
- package/dist/src/features/tool/catalog.js +2 -23
- package/dist/src/features/tool/dynamic-schema.js +42 -46
- package/dist/src/features/tool/ffprobe-executable.js +21 -0
- package/dist/src/features/tool/mns-catalog-adapter.js +61 -24
- package/dist/src/features/tool/resource-authorizer.js +11 -3
- package/dist/src/features/tool/tool-api-adapter.js +73 -82
- package/dist/src/features/tool/tool-definitions.js +23 -0
- package/dist/src/features/tool/tool-errors.js +25 -0
- package/dist/src/features/tool/tool-output.js +15 -0
- package/dist/src/features/tool/use-cases.js +74 -98
- package/dist/src/features/update/package-manager.js +124 -0
- package/dist/src/features/update/update-service.js +195 -55
- package/dist/src/platform/detached-spawn.js +9 -0
- package/dist/src/platform/file-lock.js +12 -4
- package/dist/src/platform/input-uri.js +23 -1
- package/dist/src/platform/local-json-file.js +97 -15
- package/dist/src/platform/media-type.js +46 -0
- package/dist/src/platform/open-browser.js +5 -2
- package/dist/src/platform/public-url.js +35 -0
- package/dist/src/platform/remote-error-evidence.js +33 -6
- package/dist/src/platform/resource-auth-key.js +35 -1
- package/dist/src/platform/safe-upload-file.js +38 -44
- package/dist/src/platform/schema-compiler.js +16 -0
- package/dist/src/platform/signature.js +2 -2
- package/dist/src/platform/signed-http-transport.js +4 -1
- package/dist/src/platform/url-safety.js +6 -1
- package/dist/src/platform/webm-header.js +41 -0
- package/dist/src/platform/windows-acl/LICENSE-mingw-w64 +43 -0
- package/dist/src/platform/windows-acl/arm64.node +0 -0
- package/dist/src/platform/windows-acl/ia32.node +0 -0
- package/dist/src/platform/windows-acl/x64.node +0 -0
- package/dist/src/platform/windows-host-job/arm64.exe +0 -0
- package/dist/src/platform/windows-host-job/ia32.exe +0 -0
- package/dist/src/platform/windows-host-job/sha256.json +7 -0
- package/dist/src/platform/windows-host-job/x64.exe +0 -0
- package/dist/src/platform/windows-private-state.js +72 -0
- package/dist/src/product/config.js +1 -1
- package/dist/src/telemetry/command-route.js +38 -0
- package/dist/src/telemetry/command-routes.json +1 -0
- package/dist/src/telemetry/failure-summary.js +3 -3
- package/dist/src/telemetry/invocation.js +1 -2
- package/dist/src/telemetry/process-errors.js +17 -33
- package/dist/src/telemetry/sanitize.js +19 -4
- package/dist/src/telemetry/sls-sink.js +45 -20
- package/package.json +4 -4
- package/skills/insmind-cli/SKILL.md +18 -5
- package/skills/insmind-cli/references/agent.md +9 -4
- package/skills/insmind-cli/references/creation.md +3 -1
- package/skills/insmind-cli/references/editor.md +7 -5
- package/skills/insmind-cli/references/errors.md +20 -9
- package/skills/insmind-cli/references/matting.md +3 -5
- package/skills/insmind-cli/references/media-tools.md +10 -4
- package/skills/insmind-cli/references/tool.md +9 -15
|
@@ -1,42 +1,23 @@
|
|
|
1
|
-
import { classifyTelemetryError, mapCliError } from "../cli/errors.js";
|
|
2
1
|
import { isInterruption } from "../platform/interruption.js";
|
|
3
2
|
import { randomBytes } from "node:crypto";
|
|
4
|
-
import { readFile
|
|
3
|
+
import { readFile } from "node:fs/promises";
|
|
5
4
|
import { dirname, join } from "node:path";
|
|
6
5
|
import { homedir } from "node:os";
|
|
7
6
|
import { fileURLToPath } from "node:url";
|
|
8
7
|
import { gaodingProduct, insmindProduct } from "../product/config.js";
|
|
9
8
|
import { createTelemetryInvocation, hostTelemetryContext } from "./invocation.js";
|
|
10
9
|
import { createSlsTelemetrySink } from "./sls-sink.js";
|
|
11
|
-
// The
|
|
12
|
-
// so a user-supplied positional argument can never become an SLS operation name.
|
|
10
|
+
// The normal runtime or even Commander may be unavailable. Only package-owned names may enter SLS.
|
|
13
11
|
async function bootstrapDefinition(argv) {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
if (token === "--")
|
|
23
|
-
break;
|
|
24
|
-
if (token === "--input" || token === "--locale") {
|
|
25
|
-
i++;
|
|
26
|
-
continue;
|
|
27
|
-
}
|
|
28
|
-
if (token === "--help" || token === "-h")
|
|
29
|
-
mode = "help";
|
|
30
|
-
else if (token === "--version" || token === "-V")
|
|
31
|
-
mode = "version";
|
|
32
|
-
else if (token === "--schema" && mode === "execute")
|
|
33
|
-
mode = "schema";
|
|
34
|
-
else if (!token.startsWith("-") && !names.has(path.join(".")) && path.length < 3)
|
|
35
|
-
path.push(token);
|
|
12
|
+
try {
|
|
13
|
+
const [{ identifyInvocation }, catalog] = await Promise.all([
|
|
14
|
+
import("./command-route.js"), readFile(new URL("./command-routes.json", import.meta.url), "utf8")
|
|
15
|
+
]);
|
|
16
|
+
return identifyInvocation(JSON.parse(catalog), argv);
|
|
17
|
+
}
|
|
18
|
+
catch {
|
|
19
|
+
return { operation: "bootstrap", mode: () => "execute" };
|
|
36
20
|
}
|
|
37
|
-
const name = path.join(".");
|
|
38
|
-
const operation = mode === "version" ? "version" : names.has(name) ? name : !name && mode === "help" ? "help" : "bootstrap";
|
|
39
|
-
return { operation, mode: () => mode };
|
|
40
21
|
}
|
|
41
22
|
/** Independent fallback for entrypoints which cannot construct the full runtime. */
|
|
42
23
|
export async function reportProcessError(error, options) {
|
|
@@ -55,8 +36,11 @@ export async function reportProcessError(error, options) {
|
|
|
55
36
|
catch { /* The package file may be unavailable during startup failure. */ }
|
|
56
37
|
}
|
|
57
38
|
const aborted = isInterruption(error, options.signal);
|
|
58
|
-
|
|
59
|
-
const
|
|
39
|
+
// The application error mapper imports Commander and feature dependencies which can themselves fail to load.
|
|
40
|
+
const mapper = await import("../cli/errors.js").catch(() => undefined);
|
|
41
|
+
const classification = mapper?.classifyTelemetryError(error, { aborted, product })
|
|
42
|
+
?? { outcome: aborted ? "interrupted" : "failure", errorCode: "INTERNAL_ERROR" };
|
|
43
|
+
const failure = mapper?.mapCliError(error, { aborted, product }).failure;
|
|
60
44
|
const telemetry = createTelemetryInvocation({ cliName: product.commandName, cliVersion: version,
|
|
61
45
|
env: options.environment ?? (process.env.CLI_TELEMETRY_ENV === "test" ? "test" : "production"),
|
|
62
46
|
processRole: options.processRole ?? "cli", now: Date.now,
|
|
@@ -69,8 +53,8 @@ export async function reportProcessError(error, options) {
|
|
|
69
53
|
telemetry.annotate(hostTelemetryContext(process.env));
|
|
70
54
|
if ((options.processRole ?? "cli") === "cli")
|
|
71
55
|
await telemetry.issue(definition);
|
|
72
|
-
const events = telemetry.finish(
|
|
73
|
-
outcome: "failure", error, errorCode:
|
|
56
|
+
const events = telemetry.finish(classification.outcome === "interrupted" ? { outcome: "interrupted", error } : {
|
|
57
|
+
outcome: "failure", error, errorCode: failure?.code ?? "INTERNAL_ERROR", errorMessage: failure?.message ?? "CLI startup failed.",
|
|
74
58
|
...(classification.httpStatus === undefined ? {} : { httpStatus: classification.httpStatus }),
|
|
75
59
|
...(classification.remoteErrorCode === undefined ? {} : { remoteErrorCode: classification.remoteErrorCode }),
|
|
76
60
|
...(classification.remoteErrorBody === undefined ? {} : { remoteErrorBody: classification.remoteErrorBody })
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { posix, win32 } from "node:path";
|
|
1
2
|
import { isSensitiveKey, redactSensitiveText } from "../platform/redact.js";
|
|
2
3
|
const ids = new Set(["account_id", "organization_id", "cli_task_id", "task_id", "dify_task_id", "content_id"]);
|
|
3
4
|
function sensitive(key) {
|
|
@@ -28,7 +29,15 @@ export function cleanText(value) {
|
|
|
28
29
|
}
|
|
29
30
|
export function cleanDiagnostic(value) {
|
|
30
31
|
const seen = new WeakSet();
|
|
31
|
-
|
|
32
|
+
const envelope = value && typeof value === "object" ? value : {};
|
|
33
|
+
const tool = envelope.operation === "tool.call";
|
|
34
|
+
const toolDiagnostic = (tool || (envelope.operation === "task.get" && ["dify", "toolkit", "sync"].includes(String(envelope.execution_protocol)))) && envelope.event_name === "stage_finished";
|
|
35
|
+
function clean(item, depth, inParameters = false) {
|
|
36
|
+
if (typeof item === "string" && inParameters) {
|
|
37
|
+
if (posix.isAbsolute(item) || win32.isAbsolute(item) || /^file:\/\//iu.test(item))
|
|
38
|
+
return "[Local file]";
|
|
39
|
+
item = item.replace(/file:\/\/[^\s<>"`]+/giu, "[Local file]");
|
|
40
|
+
}
|
|
32
41
|
if (typeof item === "string")
|
|
33
42
|
return /^data:[^,]*;base64,/iu.test(item) ? "[Binary omitted]" : cleanText(item);
|
|
34
43
|
if (typeof item === "bigint")
|
|
@@ -45,9 +54,15 @@ export function cleanDiagnostic(value) {
|
|
|
45
54
|
if (item instanceof Error)
|
|
46
55
|
return errorEvidence(item);
|
|
47
56
|
if (Array.isArray(item))
|
|
48
|
-
return item.map(v => clean(v, depth + 1));
|
|
49
|
-
|
|
50
|
-
|
|
57
|
+
return item.map(v => clean(v, depth + 1, inParameters));
|
|
58
|
+
const entries = Object.entries(item);
|
|
59
|
+
const fields = depth === 0 && envelope.event_name === "stage_finished"
|
|
60
|
+
? entries.filter(([key]) => key !== "parameters") : entries;
|
|
61
|
+
return Object.fromEntries(fields.map(([key, v]) => [key,
|
|
62
|
+
depth === 0 && toolDiagnostic && ["error_message", "error_stack", "remote_error_body"].includes(key)
|
|
63
|
+
? (key === "error_message" ? envelope.error_code ?? "TOOL_ERROR" : "[User content omitted]") :
|
|
64
|
+
inParameters && tool && key === "prompt" ? "[User content omitted]" :
|
|
65
|
+
depth === 0 && ids.has(key) ? v : sensitive(key) || (inParameters && key === "answers") ? "[REDACTED]" : clean(v, depth + 1, inParameters || key === "parameters")]));
|
|
51
66
|
}
|
|
52
67
|
return clean(value, 0);
|
|
53
68
|
}
|
|
@@ -8,6 +8,7 @@ import { withFileLock } from "../platform/file-lock.js";
|
|
|
8
8
|
const TTL = 7 * 86_400_000;
|
|
9
9
|
const CAPACITY = 10 * 1024 * 1024;
|
|
10
10
|
const BUDGET = 2_000;
|
|
11
|
+
const QUEUE_READ_BATCH = 8;
|
|
11
12
|
export function eventKey(event) {
|
|
12
13
|
const key = event.event_name === "command_step"
|
|
13
14
|
? [event.cli_name, event.env, event.trace_id, event.step]
|
|
@@ -104,30 +105,52 @@ export function createSlsTelemetrySink(options) {
|
|
|
104
105
|
...(count("first_at_ms") ? { first_at_ms: count("first_at_ms") } : {}),
|
|
105
106
|
...(count("last_at_ms") ? { last_at_ms: count("last_at_ms") } : {}) };
|
|
106
107
|
}
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
108
|
+
const directory = options.directory;
|
|
109
|
+
const names = await readdir(directory);
|
|
110
|
+
for (let offset = 0; offset < names.length; offset += QUEUE_READ_BATCH) {
|
|
111
|
+
const batch = names.slice(offset, offset + QUEUE_READ_BATCH);
|
|
112
|
+
// Read independent files together under the same lock. Settle every
|
|
113
|
+
// started read before releasing it, including on timeout or I/O error.
|
|
114
|
+
const records = await Promise.allSettled(batch.map(async (name) => {
|
|
115
|
+
checkBudget(deadline);
|
|
116
|
+
return /^[a-f0-9]{64}\.json$/u.test(name) ? readFile(join(directory, name), "utf8") : undefined;
|
|
117
|
+
}));
|
|
118
|
+
for (const [index, result] of records.entries()) {
|
|
119
|
+
checkBudget(deadline);
|
|
120
|
+
if (result.status === "rejected")
|
|
121
|
+
throw result.reason; // Unreadable files survive for replay.
|
|
122
|
+
await restoreEntry(directory, batch[index], result.value);
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
healthReady = true;
|
|
126
|
+
}
|
|
127
|
+
async function restoreEntry(directory, name, raw) {
|
|
128
|
+
if (raw === undefined) {
|
|
129
|
+
// All writers hold the same lock, so remaining write temporaries are orphaned.
|
|
110
130
|
if (/^(?:[a-f0-9]{64}|delivery-status)\.json\.tmp-[a-f0-9-]+$/u.test(name)) {
|
|
111
|
-
await unlink(join(
|
|
131
|
+
await unlink(join(directory, name)).catch(() => undefined);
|
|
112
132
|
await dropped("interrupted_write", 1);
|
|
113
|
-
continue;
|
|
114
|
-
}
|
|
115
|
-
if (!/^[a-f0-9]{64}\.json$/u.test(name))
|
|
116
|
-
continue;
|
|
117
|
-
// An unreadable valid record is not corrupt and must survive for replay.
|
|
118
|
-
const raw = await readFile(join(options.directory, name), "utf8");
|
|
119
|
-
try {
|
|
120
|
-
const entry = JSON.parse(raw);
|
|
121
|
-
if (entry.event?.schema_version !== "6" || !Number.isFinite(entry.queuedAt) || !entry.event || eventKey(entry.event) !== name.slice(0, -5))
|
|
122
|
-
throw new Error();
|
|
123
|
-
entries.set(name.slice(0, -5), entry);
|
|
124
133
|
}
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
134
|
+
return;
|
|
135
|
+
}
|
|
136
|
+
try {
|
|
137
|
+
const entry = JSON.parse(raw);
|
|
138
|
+
if (entry.event?.schema_version !== "6" || !Number.isFinite(entry.queuedAt) || eventKey(entry.event) !== name.slice(0, -5))
|
|
139
|
+
throw new Error();
|
|
140
|
+
// Earlier v6 clients could queue input parameters and echoed Agent HTTP errors.
|
|
141
|
+
const event = entry.event;
|
|
142
|
+
if (event.event_name === "stage_finished") {
|
|
143
|
+
delete event.parameters;
|
|
144
|
+
const agent = event.operation === "agent.send" || (event.operation === "task.get" && !event.execution_protocol);
|
|
145
|
+
if (agent && Number(event.http_status) >= 400)
|
|
146
|
+
delete event.remote_error_body;
|
|
128
147
|
}
|
|
148
|
+
entries.set(name.slice(0, -5), entry);
|
|
149
|
+
}
|
|
150
|
+
catch {
|
|
151
|
+
await unlink(join(directory, name)).catch(() => undefined);
|
|
152
|
+
await dropped("corrupt", 1);
|
|
129
153
|
}
|
|
130
|
-
healthReady = true;
|
|
131
154
|
}
|
|
132
155
|
async function saveStatus() {
|
|
133
156
|
// Health recording must never stop the original event acknowledgement/backoff path.
|
|
@@ -189,7 +212,7 @@ export function createSlsTelemetrySink(options) {
|
|
|
189
212
|
lastEnqueueError = error instanceof Error && error.message === "Local state lock timed out." ? "lock_timeout"
|
|
190
213
|
: error instanceof Error && error.message === "Telemetry delivery budget exhausted." ? "budget_exhausted" : "storage_error";
|
|
191
214
|
});
|
|
192
|
-
if (options.background && deadline === undefined)
|
|
215
|
+
if (options.background && !options.reporterFlushes && deadline === undefined)
|
|
193
216
|
void writes.then(() => { if (!sending)
|
|
194
217
|
void start(Math.min(Date.now() + BUDGET, exitDeadline)); });
|
|
195
218
|
return writes.then(() => accepted);
|
|
@@ -282,6 +305,8 @@ export function createSlsTelemetrySink(options) {
|
|
|
282
305
|
async send(events) {
|
|
283
306
|
const deadline = exitDeadline = Date.now() + BUDGET;
|
|
284
307
|
await enqueue(events, deadline);
|
|
308
|
+
if (options.reporterFlushes)
|
|
309
|
+
return;
|
|
285
310
|
if (sending)
|
|
286
311
|
await sending;
|
|
287
312
|
if (Date.now() < deadline)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@insmind/cli",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.2",
|
|
4
4
|
"description": "insMind command-line interface for agents and people.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -47,8 +47,8 @@
|
|
|
47
47
|
"@gaoding/cli": "workspace:*"
|
|
48
48
|
},
|
|
49
49
|
"gaodingRelease": {
|
|
50
|
-
"sourceCommit": "
|
|
51
|
-
"pipelineId": "
|
|
52
|
-
"pipelineUrl": "https://git.intra.gaoding.com/gtt/gaoding-cli/-/pipelines/
|
|
50
|
+
"sourceCommit": "db01676824330fe8f15c190fe71b3516b8b1924e",
|
|
51
|
+
"pipelineId": "246753",
|
|
52
|
+
"pipelineUrl": "https://git.intra.gaoding.com/gtt/gaoding-cli/-/pipelines/246753"
|
|
53
53
|
}
|
|
54
54
|
}
|
|
@@ -1,28 +1,41 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: insmind-cli
|
|
3
|
-
description: Use
|
|
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.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# insMind CLI
|
|
7
7
|
|
|
8
8
|
## Discover current capabilities on demand
|
|
9
9
|
|
|
10
|
-
- For `agent send`, `tool call` and `editor apply`, set the top-level `host_application`
|
|
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
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
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
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 `#`.
|
|
14
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.
|
|
15
18
|
- Discovery describes the installed CLI; it neither upgrades it nor authorizes generation, writes or installation. Recover unknown outcomes through the error-handling reference.
|
|
16
19
|
|
|
20
|
+
## Creation execution boundaries
|
|
21
|
+
|
|
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.
|
|
23
|
+
|
|
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).
|
|
29
|
+
|
|
17
30
|
## Read task guidance
|
|
18
31
|
|
|
19
32
|
Read only the reference for the user's goal:
|
|
20
33
|
|
|
21
34
|
- Choose Agent or Tool creation, discover models, and generate images, videos or text: [Creation](references/creation.md)
|
|
22
|
-
-
|
|
35
|
+
- Process attached/linked images or videos, including text replacement, layers and vectorization; prepare references and masks: [Media tool selection](references/media-tools.md)
|
|
23
36
|
- Remove backgrounds, extract a subject, deliver transparent PNGs, or reconstruct an occluded object: [Matting](references/matting.md)
|
|
24
|
-
- Operate
|
|
37
|
+
- Operate Shape/Connector elements in a connected work; preview, save or disconnect: [Editor](references/editor.md)
|
|
25
38
|
- Discover repositories, folders and tags; find, upload, download or manage DAM assets: [Asset management](references/dam.md)
|
|
26
39
|
- Sign in or inspect account credits: [Authentication](references/auth.md)
|
|
27
|
-
-
|
|
40
|
+
- Track accepted/running creation, retrieve async results and interpret costs, warnings, failures or interruptions: [Errors](references/errors.md)
|
|
28
41
|
- Update the CLI and bundled Agent Skill: [Update](references/update.md)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Agent creation
|
|
2
2
|
|
|
3
|
-
For
|
|
3
|
+
For delivery now, use the default synchronous command and keep waiting on the original host process handle. For later pickup, submit with `--async`, hand off the taskId and state on acceptance, and end the turn. For pickup or lost synchronous output, follow [task recovery](errors.md) using the original ID.
|
|
4
4
|
|
|
5
5
|
Read the input schema first. When specifying a model, also read its live detail:
|
|
6
6
|
|
|
@@ -8,8 +8,7 @@ Read the input schema first. When specifying a model, also read its live detail:
|
|
|
8
8
|
insmind-cli agent send --schema
|
|
9
9
|
insmind-cli model list --tool <tool>
|
|
10
10
|
insmind-cli model get <model>
|
|
11
|
-
insmind-cli agent send --input request.json
|
|
12
|
-
insmind-cli task get <taskId>
|
|
11
|
+
insmind-cli agent send --input request.json
|
|
13
12
|
```
|
|
14
13
|
|
|
15
14
|
For continued planning, generation or edits, copy `message.contextId` from the preceding result into the next request. Omit it for a new creation:
|
|
@@ -23,11 +22,17 @@ For continued planning, generation or edits, copy `message.contextId` from the p
|
|
|
23
22
|
}
|
|
24
23
|
```
|
|
25
24
|
|
|
25
|
+
completed means the turn has fully replied. Read `result.message.parts`: deliver actual assets, relay planning/confirmation text, or ask the user the returned `data.questions`. These are neither non-submission nor a guarantee that an image/video has been generated.
|
|
26
|
+
|
|
27
|
+
With the reply or assets, report this turn's actual credit charge from `usage.cost.amount`. Read the synchronous output or the completed task's `result`. Report 0 if present and unknown if absent. When totaling charges, count only actual usage from distinct taskIds. Repeated reads count once.
|
|
28
|
+
|
|
29
|
+
To answer structured questions, reuse `message.contextId`, put `message.messageId` in `data.questionMessageId`, and preserve each original question with the user’s values in answers. This data Part is the sole Part; see `agent send --schema` for the shape. Use a text Part for ordinary follow-up or confirmation. Ask for required user decisions instead of inventing them.
|
|
30
|
+
|
|
26
31
|
Put the user's request and confirmed information in Text Parts. Distinguish visible features from inferred materials or functions. Mark unverified details as pending confirmation and clarify when necessary. A previous model description is not automatically a user-confirmed fact. Keep the same factual boundaries in delivery copy; present style, audience and scene ideas as suggestions.
|
|
27
32
|
|
|
28
33
|
Before specifying a model, generation parameters or first/last frames, read [Generation constraints and media roles](generation-constraints.md).
|
|
29
34
|
|
|
30
|
-
Use `--input -`
|
|
35
|
+
Use complete JSON with `--input -` on stdin. Generate local media URIs as described in the Skill root.
|
|
31
36
|
|
|
32
37
|
Keep each URL Part's `url`, `filename`, local path and display name together as one record. Preserve that association through downloads, renames and reordering; do not pair results by request order. Before delivery, check that each final link's content matches its name. View the resource when its name is insufficient to identify it.
|
|
33
38
|
|
|
@@ -12,6 +12,8 @@ For example, the user says “Make a promotional image for this product” witho
|
|
|
12
12
|
- Incorrect: add “There is no original image, so generate an illustrative product first.” Labeling it a “concept” still changes the subject the user selected; obtain their choice first.
|
|
13
13
|
- Free creation differs: “Design a fictional product and make a promotional image” permits inventing the subject, so proceed. Unspecified colors or layouts can be designed as style details.
|
|
14
14
|
|
|
15
|
+
Deliver the existing result first. For a user-requested change, include their selected result as the new source. Use Agent for ongoing planning or a creative conversation.
|
|
16
|
+
|
|
15
17
|
## Choose a route
|
|
16
18
|
|
|
17
19
|
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.
|
|
@@ -51,4 +53,4 @@ Never guess tool names, model names or parameters. For recommendations, capabili
|
|
|
51
53
|
|
|
52
54
|
Use the attachment, named file or prior result explicitly selected in this turn. Otherwise choose the most recent relevant result in the current creation. When building or reusing request JSON, check every resource URL/path, name and role against the current target; updating only the text is insufficient. Preserve the matching `message.contextId` when continuing an Agent creation.
|
|
53
55
|
|
|
54
|
-
For Agent, put each
|
|
56
|
+
For Agent, put each media file in a separate URL Part. For Tool, use the media parameter defined in model detail. Generate standard file URIs as described in the Skill root, retaining source/reference/frame roles, order and repeated references. The CLI uploads local media through DAM internally and sends the resulting URL to the creation service. Do not invent URLs or read paths the user has not authorized.
|
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
## Discover capabilities and scope
|
|
4
4
|
|
|
5
|
+
This branch operates editable elements in a work identified by its ID or editor URL. For text, layers or vectors in an attachment, read [media tool selection](media-tools.md); an absent Editor Action does not prove CLI processing is unavailable.
|
|
6
|
+
|
|
5
7
|
On first entering this task branch, read help from the installed CLI. Before constructing Actions, query the input Schema:
|
|
6
8
|
|
|
7
9
|
```bash
|
|
@@ -16,14 +18,14 @@ Keep operations serial with one operator. If the Page contains unsupported conte
|
|
|
16
18
|
|
|
17
19
|
## Workflow
|
|
18
20
|
|
|
19
|
-
Completion
|
|
21
|
+
Completion follows the user’s request: preview-only work ends with its screenshot and an explicit unsaved status; persistence requires successful save and the public URL. Verification does not override a no-save instruction.
|
|
20
22
|
|
|
21
|
-
1. Read `insmind-cli editor connect --help
|
|
23
|
+
1. Read `insmind-cli editor connect --help`. To continue an existing work, use its ID or link. Ask the user for it if the target is missing. Omit the target when the user wants a new Board. Browser login, loading, edit/save permissions and content checks must pass; stop editing on connection failure.
|
|
22
24
|
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
25
|
3. Build an object with `host_application` and an ordered `actions` 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
26
|
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.
|
|
26
|
-
6.
|
|
27
|
+
5. When persistence is intended and authorized, 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. Skip saving for preview-only requests. Discover wait limits with `editor save --help`.
|
|
28
|
+
6. After saving when no more work is needed, or whenever the user says the connection is no longer needed, run `insmind-cli editor disconnect` and check its disconnected receipt. Disconnecting neither replaces nor authorizes saving.
|
|
27
29
|
|
|
28
30
|
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.
|
|
29
31
|
|
|
@@ -40,7 +42,7 @@ Use the latest post-Apply Snapshot for fields and relationships, and the actual
|
|
|
40
42
|
- Shapes, text and Connectors have the intended spacing and do not overlap unexpectedly.
|
|
41
43
|
- The reading direction and composition make relationships easy to follow.
|
|
42
44
|
|
|
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.
|
|
45
|
+
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. Deliver the authorized preview or save after the requested corrections.
|
|
44
46
|
|
|
45
47
|
## Failures
|
|
46
48
|
|
|
@@ -2,13 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
- `stdout` contains results only. Parse structured command JSON directly.
|
|
4
4
|
- `stderr` contains warnings, authorization notices and errors. Keep them separate from results.
|
|
5
|
-
- Exit `0`: success.
|
|
6
|
-
- Exit `1`: runtime, service or state failure.
|
|
7
|
-
- Exit `2`: command
|
|
5
|
+
- Exit `0`: command success. Async submission means acceptance; a successful task query still requires reading state.
|
|
6
|
+
- Exit `1`: runtime, service or state failure. Recover from facts in `error.code/message/details` and `error.details.next_steps`. Query the original task after query failures and inspect state before repeating an unconfirmed write.
|
|
7
|
+
- Exit `2`: command/input error. Use `details.reason/field/issues` with help/Schema to correct the stated issue. A mask-format error calls for fixing the mask; a file-access error calls for checking its path. Do not conflate them.
|
|
8
8
|
- Exit `130`: user interruption. Stop immediately; do not retry automatically.
|
|
9
9
|
- `INSUFFICIENT_CREDITS` only means available credits were insufficient for this operation. It does not distinguish account balance, member limits or other charging restrictions. Do not automatically recommend a purchase or treat a balance check or price quote as a guarantee that charging will succeed.
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
|
|
12
|
+
## Continuing tasks and missing output
|
|
12
13
|
|
|
13
14
|
If an Agent or Tool request may already have been submitted, empty output, long execution or a host's completed-script message does not justify another creation. The original command prints a Task ID to stderr; a known ID is also retained in the final error recovery details. Continue waiting if its execution session remains available; otherwise query the original task:
|
|
14
15
|
|
|
@@ -19,13 +20,23 @@ insmind-cli task get <id>
|
|
|
19
20
|
|
|
20
21
|
Use a known ID directly. Otherwise locate the task by time, operation and input summary. Ask the user when multiple candidates cannot be distinguished; do not automatically pick the newest.
|
|
21
22
|
|
|
22
|
-
- `completed`:
|
|
23
|
-
- `running
|
|
23
|
+
- `completed`: Tool returns content; Agent returns message.parts, which may contain text or questions. Deliver the actual reply/assets or ask the user, then follow [Agent creation](agent.md).
|
|
24
|
+
- `running` means the original execution is still active. For delivery now, keep checking the same ID every few seconds. For later pickup, hand off the state and ID now and check when the user returns.
|
|
24
25
|
- `unknown`: completion is unconfirmed. Recheck the same ID; explain if it remains unknown. `partialResult` is a message snapshot, not a complete deliverable.
|
|
25
|
-
- `failed
|
|
26
|
+
- On `failed`, explain the cause in `note` and the original error. Correct an input and call again when it was explicitly never dispatched. After a service refusal, tell the user there is no deliverable. Switching models or changing settings starts a new creation and requires a revised request or authorization for another attempt.
|
|
26
27
|
|
|
27
28
|
A query error, including a task-not-found response, does not mean the original creation failed. Keep the original task ID; do not generate again.
|
|
28
29
|
|
|
29
|
-
Exit `0` from `task get` means the query succeeded; `state` determines whether the creation completed.
|
|
30
|
+
Exit `0` from `task get` means the query succeeded; `state` determines whether the creation completed. Stop tracking on delivery, definite failure or an explainable unknown blocker. Preserve the ID when the user requests later retrieval; stop after user interruption without resubmitting.
|
|
31
|
+
|
|
32
|
+
## Cost sources
|
|
33
|
+
|
|
34
|
+
| Source | Meaning |
|
|
35
|
+
| --- | --- |
|
|
36
|
+
| Model catalog / Tool `usage.cost.minimum/maximum` | Catalog estimate/range, even when equal; missing cost does not mean free |
|
|
37
|
+
| Agent `usage.cost.amount` | Service-confirmed actual cost of this invocation; sum distinct taskIds only |
|
|
38
|
+
| `credits usage list/get` | Matching ledger consumption/restoration; read help for pagination/types rather than guessing a task’s cost from a page total or balance change |
|
|
39
|
+
|
|
40
|
+
Repeated reads of one ID return the same usage, not extra charges. Do not volunteer an unverified deduction when the user did not ask. Deliver Tool results directly; if quoting, call it an estimate. State that actual cost is unverified when a ledger record cannot be matched.
|
|
30
41
|
|
|
31
|
-
Do not infer internal causes from unknown errors or disclose local credentials, request signatures or sensitive
|
|
42
|
+
Do not infer internal causes from unknown errors or disclose local credentials, request signatures or sensitive URLs from diagnostics. Resource links explicitly returned for delivery are task results: preserve their complete values instead of applying diagnostic redaction and breaking the download link. If safe recovery steps are absent, preserve the public error code from stderr and explain the failure.
|
|
@@ -7,7 +7,7 @@ Distinguish preserving visible source pixels from reconstructing a complete subj
|
|
|
7
7
|
| Goal | Workflow | Boundary |
|
|
8
8
|
| --- | --- | --- |
|
|
9
9
|
| Remove a background while preserving an intact product, face, text or texture | Standard matting: separate the visible foreground from the original | Does not reconstruct hidden parts; inspect fine edges, hair, translucent materials and occlusion |
|
|
10
|
-
| Extract an obstructed object and complete its hidden parts, or redraw a selected subject from a complex scene | When reconstruction is authorized, redraw
|
|
10
|
+
| Extract an obstructed object and complete its hidden parts, or redraw a selected subject from a complex scene | When reconstruction is authorized, discover smart matting with redraw and transparent postprocessing included; one call returns the final PNG | Reconstructed details are generated guesses and may change geometry or texture; do not describe them as exact recovery |
|
|
11
11
|
|
|
12
12
|
A complex background alone does not require redrawing. For strict fidelity or a no-redraw constraint, prefer standard matting; explain limitations or request a more complete source if necessary. An explicit request to complete hidden parts authorizes reconstruction within that scope.
|
|
13
13
|
|
|
@@ -22,8 +22,6 @@ A reconstruction prompt can specify: “Use the selected subject in this referen
|
|
|
22
22
|
|
|
23
23
|
## Verify and deliver
|
|
24
24
|
|
|
25
|
-
-
|
|
26
|
-
- Inspect against both light and dark backgrounds for edge damage, holes, hair, translucent regions, leftover background and baked checkerboards. Keep the original dimensions or crop to the subject as requested.
|
|
27
|
-
- For reconstruction, compare product geometry, marks, identity and visible details. Identify generated completions without promising pixel fidelity.
|
|
25
|
+
- When the user requests a review or a revision, refer to the delivered file and the area they identified. Explain which details were generated during reconstruction.
|
|
28
26
|
- Deliver the file or an authorized download link. A redraw or mask alone does not complete transparent matting; preserve intermediate results and state what remains.
|
|
29
|
-
-
|
|
27
|
+
- Internal smart-matting stages belong to one Tool call and are not separately added as charges. Tool returns catalog estimates; use the [cost sources](errors.md#cost-sources) for actual charges. After acceptance, an interruption, timeout or postprocessing failure calls for querying the original task through [Errors](errors.md), not blindly repeating successful paid generation.
|
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
First choose Agent or Tool through [creation](creation.md). These guidelines select a Tool for a single operation; business orchestration still uses Agent. Honor explicitly requested routes and models.
|
|
4
4
|
|
|
5
|
+
Attached images and media links are processing targets, including text inside images, layer decomposition and vectorization. Discover `tool list` before concluding that these operations are unavailable. Editor operates connected work elements; it does not require converting attachments to a Board first.
|
|
6
|
+
|
|
5
7
|
## Select by purpose
|
|
6
8
|
|
|
7
9
|
| Goal | Discovery direction |
|
|
@@ -20,20 +22,24 @@ Use the public model identifier and description rather than matching backend dis
|
|
|
20
22
|
|
|
21
23
|
Identify the current source, target changes and content to preserve. Include only necessary references and assign each a subject, style, color or layout role. Organize the prompt as target → change → preserved content → reference roles → output requirements, using the user's request and confirmed media. For style-only references, name the borrowed qualities; prefer relevant references to reduce conflicting instructions about ignoring a prominent subject. Put structured model controls in their actual fields.
|
|
22
24
|
|
|
23
|
-
|
|
25
|
+
For expansion, distinguish an exact output pixel size from a requested aspect ratio. Use the selected model’s canvas and placement descriptions to set the source position, layout and resolution. Keep source, selection and references in their Schema-defined fields; a reference image is not a mask.
|
|
26
|
+
|
|
27
|
+
Requirements such as preserving text/details or avoiding redrawing guide model selection and input construction. Do not turn them into an unrequested pixel-for-pixel identity threshold. Read the relevant model details, invoke the requested processing, deliver readable service results and describe observed differences. The possibility of detail changes alone does not establish that every Tool is unsuitable.
|
|
28
|
+
|
|
29
|
+
A model prerequisite is not a Tool-wide restriction. Before submission, if missing local dependencies or unavailable inputs block one model, inspect other models of the same Tool. Choose another only when the user has not fixed the model and it meets the explicit requirements. Do not silently relax fidelity constraints or replace a requested model; explain the specific gap if no suitable route exists. Prepare intermediate files in the current writable work directory; an unwritable temporary path does not mean the CLI lacks the capability.
|
|
24
30
|
|
|
25
31
|
## Review masks before submission
|
|
26
32
|
|
|
27
|
-
1. Read the selected model
|
|
33
|
+
1. Read the selected model’s mask requirements and whether it is required. For binary PNGs, use only pure black/white RGB and alpha 255 if present, matching the auto-oriented source dimensions. Gray antialiasing, transparency and a user’s colored selection preview are not a mask. Prepare a separate mask from the selection and use the unmarked source image. File validity does not prove correct selection.
|
|
28
34
|
2. View the auto-oriented source and mask, then overlay the selection on the source for review. Verify that white covers the intended subject/part without omissions and black covers protected content. Check contours, holes, edges and alignment for shifts, stretching or background selection. The overlay is only a review preview; submit the original mask required by the Schema.
|
|
29
35
|
3. White must be nonempty. Use an all-white mask only for an explicitly requested whole-image operation. Follow the target's contour rather than inventing an arbitrary rectangle, unless the user selected a rectangular region. Correct misplaced selections before submitting; ask for a selection or target clarification when reliable localization is unavailable.
|
|
30
|
-
4. A smart model may use an optional mask only as a visual boundary cue. Consult its description; this does not guarantee unchanged pixels outside the selection.
|
|
36
|
+
4. A smart model may use an optional mask only as a visual boundary cue. Consult its description; this does not guarantee unchanged pixels outside the selection. Prepare a mask only when actually supplying one; an optional mask is not mandatory when text can identify the target. Follow the delivery boundaries below for result review.
|
|
31
37
|
|
|
32
38
|
## Execute and deliver
|
|
33
39
|
|
|
34
40
|
Submit once following [Tool](tool.md) and wait for that task. Read current metered prices and formulas; quotes are not deductions. Query the original task after interruption rather than repeating processing, uploads or settlement.
|
|
35
41
|
|
|
36
|
-
|
|
42
|
+
Deliver a readable service result first. When the user requests an effect review, examine relevant text, placement, layers or sound and describe deviations. Audio presence does not establish soundtrack preservation; a layer limit does not guarantee separate objects. Effects do not change the fact of CLI delivery. Further creation follows user authorization, rather than automatically changing models, increasing layers or regenerating.
|
|
37
43
|
|
|
38
44
|
Distinguish layer goals: layout decomposition targets editable text, images and layout; smart decomposition separates objects into individual layers. A layer limit does not guarantee the actual layer count, and object decomposition is not per-character OCR. Select from the current catalog and deliver the native JSON and resources, not PSD. If editor import is requested, discover the supported operations via [Editor](editor.md) and verify editable text, layers and substituted fonts.
|
|
39
45
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Tool creation
|
|
2
2
|
|
|
3
|
-
For
|
|
3
|
+
For delivery now, use the default synchronous command and keep waiting on the original host process handle. For later pickup, submit with `--async`, hand off the taskId and state on acceptance, and end the turn. For pickup or lost synchronous output, follow [task recovery](errors.md) using the original ID.
|
|
4
4
|
|
|
5
5
|
Discover live metadata in this order:
|
|
6
6
|
|
|
@@ -8,23 +8,17 @@ Discover live metadata in this order:
|
|
|
8
8
|
insmind-cli tool list
|
|
9
9
|
insmind-cli model list --tool <tool>
|
|
10
10
|
insmind-cli model get <model> --tool <tool>
|
|
11
|
-
insmind-cli tool call <tool> --input request.json
|
|
12
|
-
insmind-cli task get <taskId>
|
|
11
|
+
insmind-cli tool call <tool> --input request.json
|
|
13
12
|
```
|
|
14
13
|
|
|
15
|
-
Read `insmind-cli tool call <tool> --schema` for the input shape and `model get` for the selected model's price and estimated duration. `required` describes required inputs and `default` identifies service defaults. A
|
|
14
|
+
Read `insmind-cli tool call <tool> --schema` for the input shape and `model get` for the selected model's price and estimated duration. `required` describes required inputs and `default` identifies service defaults. A default is a suggested value. Supply every field in the selected schema’s required list, including one with a default. Use `options[].value` for a listed option. Put dimensions and resolution in `width`, `height` and `resolution` where available, and preserve explicit user values. Read `usageDescription` for cross-field rules such as video mode and frame roles.
|
|
16
15
|
|
|
17
|
-
|
|
16
|
+
Set `"model": "<model>"` at the top level of the request (runtime `arguments.model`) alongside `host_application` and the fields for that model. Keep ordered references in their declared field. For example, a model declaring `image_urls` takes `["file:///inputs/product.png", "https://example.com/style.png"]`. Preserve order and repeats.
|
|
18
17
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
"model": "<model>",
|
|
23
|
-
"prompt": "<required prompt>",
|
|
24
|
-
"<parameter>": "<value>"
|
|
25
|
-
}
|
|
26
|
-
```
|
|
18
|
+
Generate attachment URIs using the Skill root instructions and write those exact values into the request object, rather than typing file URIs with raw Unicode, spaces or `#`. Write complete JSON to a file or stdin; the JSON file path and the media URIs are different inputs.
|
|
19
|
+
|
|
20
|
+
Success returns `content` and `usage`. Content can include text, resource links and embedded JSON. Tool `usage.cost.minimum/maximum` is a catalog estimate even when both values are equal. Missing cost means no estimate, not free. For actual charges, use the [cost sources](errors.md#cost-sources).
|
|
27
21
|
|
|
28
|
-
|
|
22
|
+
Deliver the existing service result first and describe observed deviations. Further creation follows the user’s request, rather than another paid call to meet a private quality score. Label locally written SVGs, interpolated upscaling or other local edits as such; they are not evidence of calling the corresponding Tool.
|
|
29
23
|
|
|
30
|
-
Keep each resource link, returned name, local path and display name together. Preserve the association through downloads, renames and reordering; do not pair results by request order.
|
|
24
|
+
Keep each resource link, returned name, local path and display name together. Preserve the association through downloads, renames and reordering; do not pair results by request order. Deliver each part as returned. If only a cover was returned, share it and say that no identifiable video was received. Do not guess an unknown attachment type or submit another creation.
|