@gaoding/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.
- package/README.md +6 -3
- package/contracts/operations/tool.call/canvas-input.schema.json +0 -3
- package/contracts/presentations/agent.send.schema.json +303 -0
- package/contracts/presentations/model.get.schema.json +246 -0
- package/contracts/presentations/model.list.schema.json +144 -0
- package/contracts/presentations/task.get.schema.json +146 -0
- package/contracts/presentations/tool.call.schema.json +200 -0
- package/dist/bin/gd-cli.js +9 -3
- package/dist/bin/insmind-cli.js +6 -1
- package/dist/src/bootstrap/create-cli.js +7 -4
- package/dist/src/bootstrap/create-runtime.js +7 -32
- package/dist/src/cli/action-binding.js +2 -2
- package/dist/src/cli/agent-commands.js +5 -4
- package/dist/src/cli/auth-commands.js +1 -1
- package/dist/src/cli/dam-commands.js +18 -10
- package/dist/src/cli/errors.js +1 -35
- package/dist/src/cli/host-input.js +0 -11
- package/dist/src/cli/model-commands.js +6 -5
- package/dist/src/cli/skill-output.js +13 -0
- package/dist/src/cli/tool-commands.js +9 -5
- package/dist/src/features/skill/catalog.js +152 -0
- package/dist/src/features/skill/manual.js +71 -0
- package/dist/src/features/tool/archived-ocr-result.js +74 -0
- package/dist/src/features/tool/canvas-copy.js +2 -3
- package/dist/src/features/tool/canvas-models.js +2 -4
- package/dist/src/features/tool/canvas-recovery.js +3 -2
- package/dist/src/features/tool/canvas-results.js +1 -55
- package/dist/src/features/tool/canvas-tool-adapter.js +7 -10
- package/dist/src/features/tool/resource-authorizer.js +1 -1
- package/dist/src/features/tool/scene-catalog-adapter.js +20 -22
- package/dist/src/features/tool/tool-definitions.js +0 -1
- package/dist/src/product/config.js +0 -7
- package/dist/src/telemetry/command-routes.json +1 -1
- package/package.json +4 -4
- package/skills/gd-cli/SKILL.md +10 -29
- package/contracts/operations/editor.apply/input.schema.json +0 -134
- package/contracts/operations/editor.apply/output.schema.json +0 -15
- package/contracts/operations/editor.connect/input.schema.json +0 -15
- package/contracts/operations/editor.connect/output.schema.json +0 -17
- package/contracts/operations/editor.disconnect/input.schema.json +0 -8
- package/contracts/operations/editor.disconnect/output.schema.json +0 -14
- package/contracts/operations/editor.save/input.schema.json +0 -8
- package/contracts/operations/editor.save/output.schema.json +0 -23
- package/contracts/operations/editor.screenshot/input.schema.json +0 -8
- package/contracts/operations/editor.screenshot/output.schema.json +0 -16
- package/contracts/operations/editor.snapshot/input.schema.json +0 -8
- package/contracts/operations/editor.snapshot/output.schema.json +0 -113
- package/contracts/operations/tool.call/models/image-ocr.schema.json +0 -22
- package/contracts/operations/tool.call/ocr-payload.schema.json +0 -65
- package/dist/src/cli/editor-commands.js +0 -136
- package/skills/gd-cli/references/agent.md +0 -39
- package/skills/gd-cli/references/auth-org.md +0 -11
- package/skills/gd-cli/references/creation.md +0 -61
- package/skills/gd-cli/references/dam.md +0 -53
- package/skills/gd-cli/references/editor.md +0 -67
- package/skills/gd-cli/references/errors.md +0 -46
- package/skills/gd-cli/references/generation-constraints.md +0 -40
- package/skills/gd-cli/references/matting.md +0 -27
- package/skills/gd-cli/references/media-tools.md +0 -46
- package/skills/gd-cli/references/tool.md +0 -24
- package/skills/gd-cli/references/update.md +0 -22
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"title": "ModelListResult",
|
|
4
|
+
"description": "当前可用的创作模型摘要。",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"additionalProperties": false,
|
|
7
|
+
"required": [
|
|
8
|
+
"models"
|
|
9
|
+
],
|
|
10
|
+
"properties": {
|
|
11
|
+
"models": {
|
|
12
|
+
"type": "array",
|
|
13
|
+
"description": "当前已发布且至少有一个上架 SKU 的创作模型。",
|
|
14
|
+
"items": {
|
|
15
|
+
"$ref": "#/$defs/ModelSummary"
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
"relatedSkills": {
|
|
19
|
+
"type": "array",
|
|
20
|
+
"minItems": 1,
|
|
21
|
+
"items": {
|
|
22
|
+
"type": "object",
|
|
23
|
+
"additionalProperties": false,
|
|
24
|
+
"required": [
|
|
25
|
+
"id",
|
|
26
|
+
"title",
|
|
27
|
+
"description",
|
|
28
|
+
"command"
|
|
29
|
+
],
|
|
30
|
+
"properties": {
|
|
31
|
+
"id": {
|
|
32
|
+
"type": "string",
|
|
33
|
+
"pattern": "^[a-z][a-z0-9-]{0,63}$"
|
|
34
|
+
},
|
|
35
|
+
"title": {
|
|
36
|
+
"type": "string",
|
|
37
|
+
"minLength": 1
|
|
38
|
+
},
|
|
39
|
+
"description": {
|
|
40
|
+
"type": "string",
|
|
41
|
+
"minLength": 1
|
|
42
|
+
},
|
|
43
|
+
"command": {
|
|
44
|
+
"type": "string",
|
|
45
|
+
"pattern": "^gd-cli --skill [a-z][a-z0-9-]{0,63}$"
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
"$defs": {
|
|
52
|
+
"NonBlankString": {
|
|
53
|
+
"type": "string",
|
|
54
|
+
"minLength": 1,
|
|
55
|
+
"pattern": ".*\\S.*"
|
|
56
|
+
},
|
|
57
|
+
"CostRange": {
|
|
58
|
+
"type": "object",
|
|
59
|
+
"additionalProperties": false,
|
|
60
|
+
"required": [
|
|
61
|
+
"unit",
|
|
62
|
+
"minimum",
|
|
63
|
+
"maximum"
|
|
64
|
+
],
|
|
65
|
+
"properties": {
|
|
66
|
+
"unit": {
|
|
67
|
+
"const": "gaodou",
|
|
68
|
+
"description": "稿豆计价单位。"
|
|
69
|
+
},
|
|
70
|
+
"minimum": {
|
|
71
|
+
"type": "number",
|
|
72
|
+
"minimum": 0,
|
|
73
|
+
"description": "目录预估价格区间的下限。"
|
|
74
|
+
},
|
|
75
|
+
"maximum": {
|
|
76
|
+
"type": "number",
|
|
77
|
+
"minimum": 0,
|
|
78
|
+
"description": "目录预估价格区间的上限。"
|
|
79
|
+
}
|
|
80
|
+
},
|
|
81
|
+
"description": "Model Catalog 目录估价,不是实际扣费;minimum 与 maximum 相等也仍是估价。"
|
|
82
|
+
},
|
|
83
|
+
"EstimatedTimeRange": {
|
|
84
|
+
"type": "object",
|
|
85
|
+
"additionalProperties": false,
|
|
86
|
+
"required": [
|
|
87
|
+
"unit",
|
|
88
|
+
"minimum",
|
|
89
|
+
"maximum"
|
|
90
|
+
],
|
|
91
|
+
"properties": {
|
|
92
|
+
"unit": {
|
|
93
|
+
"const": "second",
|
|
94
|
+
"description": "秒级耗时单位。"
|
|
95
|
+
},
|
|
96
|
+
"minimum": {
|
|
97
|
+
"type": "number",
|
|
98
|
+
"minimum": 0,
|
|
99
|
+
"description": "当前可用配置中的最短预估耗时。"
|
|
100
|
+
},
|
|
101
|
+
"maximum": {
|
|
102
|
+
"type": "number",
|
|
103
|
+
"minimum": 0,
|
|
104
|
+
"description": "当前可用配置中的最长预估耗时。"
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
},
|
|
108
|
+
"ModelSummary": {
|
|
109
|
+
"type": "object",
|
|
110
|
+
"additionalProperties": false,
|
|
111
|
+
"required": [
|
|
112
|
+
"tool",
|
|
113
|
+
"model",
|
|
114
|
+
"title"
|
|
115
|
+
],
|
|
116
|
+
"properties": {
|
|
117
|
+
"tool": {
|
|
118
|
+
"$ref": "#/$defs/NonBlankString",
|
|
119
|
+
"description": "模型所属的产品创作工具。"
|
|
120
|
+
},
|
|
121
|
+
"model": {
|
|
122
|
+
"$ref": "#/$defs/NonBlankString",
|
|
123
|
+
"description": "调用模型时使用的机器标识。"
|
|
124
|
+
},
|
|
125
|
+
"title": {
|
|
126
|
+
"$ref": "#/$defs/NonBlankString",
|
|
127
|
+
"description": "模型的展示名称。"
|
|
128
|
+
},
|
|
129
|
+
"description": {
|
|
130
|
+
"$ref": "#/$defs/NonBlankString",
|
|
131
|
+
"description": "模型的用途说明。"
|
|
132
|
+
},
|
|
133
|
+
"cost": {
|
|
134
|
+
"$ref": "#/$defs/CostRange",
|
|
135
|
+
"description": "当前配置的目录预估价格区间,不表示实际扣费。"
|
|
136
|
+
},
|
|
137
|
+
"estimatedTime": {
|
|
138
|
+
"$ref": "#/$defs/EstimatedTimeRange",
|
|
139
|
+
"description": "模型当前可用配置的预估耗时区间。"
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
}
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://gdcli.gaoding.com/contracts/presentations/task.get.schema.json",
|
|
4
|
+
"title": "TaskResult",
|
|
5
|
+
"allOf": [
|
|
6
|
+
{
|
|
7
|
+
"if": {
|
|
8
|
+
"properties": {
|
|
9
|
+
"state": {
|
|
10
|
+
"const": "completed"
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
"then": {
|
|
15
|
+
"properties": {
|
|
16
|
+
"result": {}
|
|
17
|
+
},
|
|
18
|
+
"required": [
|
|
19
|
+
"result"
|
|
20
|
+
]
|
|
21
|
+
},
|
|
22
|
+
"else": {
|
|
23
|
+
"not": {
|
|
24
|
+
"properties": {
|
|
25
|
+
"result": {}
|
|
26
|
+
},
|
|
27
|
+
"required": [
|
|
28
|
+
"result"
|
|
29
|
+
]
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
],
|
|
34
|
+
"type": "object",
|
|
35
|
+
"additionalProperties": false,
|
|
36
|
+
"required": [
|
|
37
|
+
"taskId",
|
|
38
|
+
"operation",
|
|
39
|
+
"label",
|
|
40
|
+
"createdAt",
|
|
41
|
+
"updatedAt",
|
|
42
|
+
"state"
|
|
43
|
+
],
|
|
44
|
+
"properties": {
|
|
45
|
+
"taskId": {
|
|
46
|
+
"type": "string",
|
|
47
|
+
"format": "uuid",
|
|
48
|
+
"description": "本机原创作的任务 ID;用 task get 继续取回,不用于 Agent 续聊。"
|
|
49
|
+
},
|
|
50
|
+
"operation": {
|
|
51
|
+
"enum": [
|
|
52
|
+
"agent.send",
|
|
53
|
+
"tool.call"
|
|
54
|
+
],
|
|
55
|
+
"description": "决定 result 的结构及费用含义:agent.send 为本轮回复和实扣,tool.call 为工具产物和估价。"
|
|
56
|
+
},
|
|
57
|
+
"label": {
|
|
58
|
+
"type": "string",
|
|
59
|
+
"maxLength": 200,
|
|
60
|
+
"description": "用于在任务列表定位原需求的摘要,不是结果。"
|
|
61
|
+
},
|
|
62
|
+
"createdAt": {
|
|
63
|
+
"type": "string",
|
|
64
|
+
"format": "date-time",
|
|
65
|
+
"description": "本地任务创建时刻。"
|
|
66
|
+
},
|
|
67
|
+
"updatedAt": {
|
|
68
|
+
"type": "string",
|
|
69
|
+
"format": "date-time",
|
|
70
|
+
"description": "本地记录最近更新时刻,不等同服务端完成时间。"
|
|
71
|
+
},
|
|
72
|
+
"state": {
|
|
73
|
+
"enum": [
|
|
74
|
+
"running",
|
|
75
|
+
"completed",
|
|
76
|
+
"failed",
|
|
77
|
+
"unknown"
|
|
78
|
+
],
|
|
79
|
+
"description": "running 表示仍在执行。现在需要结果时继续查同一 ID,明确稍后取回时先交接 ID 和状态。completed 时交付 result 中的实际内容。failed 时根据 note 说明原因。unknown 时保留原 ID 核查。"
|
|
80
|
+
},
|
|
81
|
+
"contextId": {
|
|
82
|
+
"type": "string",
|
|
83
|
+
"minLength": 1,
|
|
84
|
+
"description": "Agent 对话上下文;续聊使用结果中的 message.contextId,查询仍用 taskId。"
|
|
85
|
+
},
|
|
86
|
+
"note": {
|
|
87
|
+
"type": "string",
|
|
88
|
+
"description": "已有事实、失败或无法确认原因;保留其含义,不据查询成功推断生成成功。"
|
|
89
|
+
},
|
|
90
|
+
"result": {
|
|
91
|
+
"oneOf": [
|
|
92
|
+
{
|
|
93
|
+
"$ref": "../operations/agent.send/output.schema.json"
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
"$ref": "../operations/tool.call/output.schema.json"
|
|
97
|
+
}
|
|
98
|
+
],
|
|
99
|
+
"description": "仅 completed 时提供原调用完整结果;同一 taskId 重读不累计 usage。Tool cost.minimum/maximum 是估价,Agent cost.amount 是本轮实扣。交付本次返回的完整链接;再次查询可更新稿定结构化资源的授权,第三方签名和正文保持原样。"
|
|
100
|
+
},
|
|
101
|
+
"partialResult": {
|
|
102
|
+
"oneOf": [
|
|
103
|
+
{
|
|
104
|
+
"$ref": "../operations/agent.send/output.schema.json"
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
"$ref": "../operations/tool.call/output.schema.json"
|
|
108
|
+
}
|
|
109
|
+
],
|
|
110
|
+
"description": "已取得的消息或中间结果快照,不证明本轮完成;不能当作完整交付或最终费用。"
|
|
111
|
+
},
|
|
112
|
+
"relatedSkills": {
|
|
113
|
+
"type": "array",
|
|
114
|
+
"minItems": 1,
|
|
115
|
+
"items": {
|
|
116
|
+
"type": "object",
|
|
117
|
+
"additionalProperties": false,
|
|
118
|
+
"required": [
|
|
119
|
+
"id",
|
|
120
|
+
"title",
|
|
121
|
+
"description",
|
|
122
|
+
"command"
|
|
123
|
+
],
|
|
124
|
+
"properties": {
|
|
125
|
+
"id": {
|
|
126
|
+
"type": "string",
|
|
127
|
+
"pattern": "^[a-z][a-z0-9-]{0,63}$"
|
|
128
|
+
},
|
|
129
|
+
"title": {
|
|
130
|
+
"type": "string",
|
|
131
|
+
"minLength": 1
|
|
132
|
+
},
|
|
133
|
+
"description": {
|
|
134
|
+
"type": "string",
|
|
135
|
+
"minLength": 1
|
|
136
|
+
},
|
|
137
|
+
"command": {
|
|
138
|
+
"type": "string",
|
|
139
|
+
"pattern": "^gd-cli --skill [a-z][a-z0-9-]{0,63}$"
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
},
|
|
145
|
+
"description": "原创作调用的当前状态;查询退出码 0 不代表该任务完成。依 state 和 operation 读取结果,不重复发起创作。"
|
|
146
|
+
}
|
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"title": "ToolCallOutput",
|
|
4
|
+
"description": "创作工具返回的最终内容、所选模型及目录估价;不提供实际扣费金额。",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"additionalProperties": false,
|
|
7
|
+
"required": [
|
|
8
|
+
"content",
|
|
9
|
+
"usage"
|
|
10
|
+
],
|
|
11
|
+
"properties": {
|
|
12
|
+
"content": {
|
|
13
|
+
"type": "array",
|
|
14
|
+
"description": "服务按顺序返回的正文、资源链接和附件。按实际类型交付;只有封面时不能称已收到视频。保留所有完整链接,包括签名与查询参数。",
|
|
15
|
+
"items": {
|
|
16
|
+
"oneOf": [
|
|
17
|
+
{
|
|
18
|
+
"$ref": "#/$defs/TextContent"
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
"$ref": "#/$defs/ResourceLink"
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
"$ref": "#/$defs/EmbeddedJsonResource"
|
|
25
|
+
}
|
|
26
|
+
]
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
"usage": {
|
|
30
|
+
"$ref": "#/$defs/ToolUsage",
|
|
31
|
+
"description": "所选模型与本次目录估价。缺少 cost 表示未取得估价,不表示免费。"
|
|
32
|
+
},
|
|
33
|
+
"relatedSkills": {
|
|
34
|
+
"type": "array",
|
|
35
|
+
"minItems": 1,
|
|
36
|
+
"items": {
|
|
37
|
+
"type": "object",
|
|
38
|
+
"additionalProperties": false,
|
|
39
|
+
"required": [
|
|
40
|
+
"id",
|
|
41
|
+
"title",
|
|
42
|
+
"description",
|
|
43
|
+
"command"
|
|
44
|
+
],
|
|
45
|
+
"properties": {
|
|
46
|
+
"id": {
|
|
47
|
+
"type": "string",
|
|
48
|
+
"pattern": "^[a-z][a-z0-9-]{0,63}$"
|
|
49
|
+
},
|
|
50
|
+
"title": {
|
|
51
|
+
"type": "string",
|
|
52
|
+
"minLength": 1
|
|
53
|
+
},
|
|
54
|
+
"description": {
|
|
55
|
+
"type": "string",
|
|
56
|
+
"minLength": 1
|
|
57
|
+
},
|
|
58
|
+
"command": {
|
|
59
|
+
"type": "string",
|
|
60
|
+
"pattern": "^gd-cli --skill [a-z][a-z0-9-]{0,63}$"
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
},
|
|
66
|
+
"$defs": {
|
|
67
|
+
"CostRange": {
|
|
68
|
+
"type": "object",
|
|
69
|
+
"additionalProperties": false,
|
|
70
|
+
"required": [
|
|
71
|
+
"unit",
|
|
72
|
+
"minimum",
|
|
73
|
+
"maximum"
|
|
74
|
+
],
|
|
75
|
+
"properties": {
|
|
76
|
+
"unit": {
|
|
77
|
+
"const": "gaodou",
|
|
78
|
+
"description": "稿豆计价单位。"
|
|
79
|
+
},
|
|
80
|
+
"minimum": {
|
|
81
|
+
"type": "number",
|
|
82
|
+
"minimum": 0,
|
|
83
|
+
"description": "目录预估价格区间的下限。"
|
|
84
|
+
},
|
|
85
|
+
"maximum": {
|
|
86
|
+
"type": "number",
|
|
87
|
+
"minimum": 0,
|
|
88
|
+
"description": "目录预估价格区间的上限。"
|
|
89
|
+
}
|
|
90
|
+
},
|
|
91
|
+
"description": "Model Catalog 目录估价,不是实际扣费;minimum 与 maximum 相等也仍是估价。"
|
|
92
|
+
},
|
|
93
|
+
"ToolUsage": {
|
|
94
|
+
"type": "object",
|
|
95
|
+
"additionalProperties": false,
|
|
96
|
+
"required": [
|
|
97
|
+
"model"
|
|
98
|
+
],
|
|
99
|
+
"properties": {
|
|
100
|
+
"model": {
|
|
101
|
+
"type": "string",
|
|
102
|
+
"minLength": 1,
|
|
103
|
+
"pattern": ".*\\S.*",
|
|
104
|
+
"description": "本次调用选择的模型机器标识。"
|
|
105
|
+
},
|
|
106
|
+
"cost": {
|
|
107
|
+
"$ref": "#/$defs/CostRange",
|
|
108
|
+
"description": "Model Catalog 目录估价,计量模型按实际输入估算;即使 minimum=maximum 也不表示实际扣费。实扣以可对应的账本记录为准。"
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
},
|
|
112
|
+
"TextContent": {
|
|
113
|
+
"type": "object",
|
|
114
|
+
"additionalProperties": false,
|
|
115
|
+
"required": [
|
|
116
|
+
"type",
|
|
117
|
+
"text"
|
|
118
|
+
],
|
|
119
|
+
"properties": {
|
|
120
|
+
"type": {
|
|
121
|
+
"const": "text",
|
|
122
|
+
"description": "文本内容的固定类型。"
|
|
123
|
+
},
|
|
124
|
+
"text": {
|
|
125
|
+
"type": "string",
|
|
126
|
+
"minLength": 1,
|
|
127
|
+
"pattern": ".*\\S.*",
|
|
128
|
+
"description": "创作工具返回的文本。"
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
},
|
|
132
|
+
"ResourceLink": {
|
|
133
|
+
"type": "object",
|
|
134
|
+
"additionalProperties": false,
|
|
135
|
+
"required": [
|
|
136
|
+
"type",
|
|
137
|
+
"uri",
|
|
138
|
+
"name"
|
|
139
|
+
],
|
|
140
|
+
"properties": {
|
|
141
|
+
"type": {
|
|
142
|
+
"const": "resource_link",
|
|
143
|
+
"description": "资源链接的固定类型。"
|
|
144
|
+
},
|
|
145
|
+
"uri": {
|
|
146
|
+
"type": "string",
|
|
147
|
+
"format": "uri",
|
|
148
|
+
"description": "创作工具生成资源的完整 URI。交付时原样保留查询参数,不截断、拼接或按诊断日志脱敏规则删除授权参数。"
|
|
149
|
+
},
|
|
150
|
+
"name": {
|
|
151
|
+
"type": "string",
|
|
152
|
+
"minLength": 1,
|
|
153
|
+
"pattern": ".*\\S.*",
|
|
154
|
+
"description": "资源的文件名。"
|
|
155
|
+
},
|
|
156
|
+
"mimeType": {
|
|
157
|
+
"type": "string",
|
|
158
|
+
"minLength": 1,
|
|
159
|
+
"pattern": ".*\\S.*",
|
|
160
|
+
"description": "资源的 MIME type。"
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
},
|
|
164
|
+
"EmbeddedJsonResource": {
|
|
165
|
+
"type": "object",
|
|
166
|
+
"additionalProperties": false,
|
|
167
|
+
"required": [
|
|
168
|
+
"type",
|
|
169
|
+
"resource"
|
|
170
|
+
],
|
|
171
|
+
"properties": {
|
|
172
|
+
"type": {
|
|
173
|
+
"const": "resource"
|
|
174
|
+
},
|
|
175
|
+
"resource": {
|
|
176
|
+
"type": "object",
|
|
177
|
+
"additionalProperties": false,
|
|
178
|
+
"required": [
|
|
179
|
+
"uri",
|
|
180
|
+
"mimeType",
|
|
181
|
+
"text"
|
|
182
|
+
],
|
|
183
|
+
"properties": {
|
|
184
|
+
"uri": {
|
|
185
|
+
"type": "string",
|
|
186
|
+
"format": "uri"
|
|
187
|
+
},
|
|
188
|
+
"mimeType": {
|
|
189
|
+
"const": "application/json"
|
|
190
|
+
},
|
|
191
|
+
"text": {
|
|
192
|
+
"type": "string",
|
|
193
|
+
"minLength": 1
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
}
|
package/dist/bin/gd-cli.js
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { randomBytes } from "node:crypto";
|
|
3
|
+
import { runSkillManual } from "../src/features/skill/manual.js";
|
|
3
4
|
import { jsonErrorsRequested } from "../src/platform/error-output-mode.js";
|
|
4
5
|
import { isInterruption } from "../src/platform/interruption.js";
|
|
5
|
-
const
|
|
6
|
+
const argv = process.argv.slice(2);
|
|
7
|
+
const jsonErrors = jsonErrorsRequested(argv);
|
|
6
8
|
const startedAt = Date.now();
|
|
7
9
|
const bootstrapTraceId = randomBytes(16).toString("hex");
|
|
8
10
|
const controller = new AbortController();
|
|
@@ -13,7 +15,11 @@ let runtime;
|
|
|
13
15
|
let mapCliError;
|
|
14
16
|
let redact;
|
|
15
17
|
try {
|
|
16
|
-
|
|
18
|
+
const manualExitCode = await runSkillManual(argv, "gd-cli", jsonErrors);
|
|
19
|
+
if (manualExitCode !== undefined) {
|
|
20
|
+
process.exitCode = manualExitCode;
|
|
21
|
+
}
|
|
22
|
+
else if (process.env.CLI_INTERNAL_HOST_DIAGNOSTIC === "1" && process.argv.length === 3 && process.argv[2] === "--version") {
|
|
17
23
|
await Promise.all([import("../src/telemetry/host-diagnostics.js"), import("../src/product/config.js")])
|
|
18
24
|
.then(([{ runHostDiagnosticReporter }, { gaodingProduct }]) => runHostDiagnosticReporter({ product: gaodingProduct }))
|
|
19
25
|
.catch(() => undefined);
|
|
@@ -35,7 +41,7 @@ try {
|
|
|
35
41
|
const program = createCli(runtime, { signal: controller.signal });
|
|
36
42
|
process.exitCode = await executeCli({
|
|
37
43
|
program,
|
|
38
|
-
argv
|
|
44
|
+
argv,
|
|
39
45
|
presenter: runtime.presenter,
|
|
40
46
|
signal: controller.signal,
|
|
41
47
|
telemetry: runtime.telemetry,
|
package/dist/bin/insmind-cli.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { randomBytes } from "node:crypto";
|
|
3
|
+
import { runSkillManual } from "../src/features/skill/manual.js";
|
|
3
4
|
import { jsonErrorsRequested } from "../src/platform/error-output-mode.js";
|
|
4
5
|
import { isInterruption } from "../src/platform/interruption.js";
|
|
5
6
|
import { insmindProduct } from "../src/product/config.js";
|
|
@@ -15,7 +16,11 @@ let runtime;
|
|
|
15
16
|
let mapCliError;
|
|
16
17
|
let redact;
|
|
17
18
|
try {
|
|
18
|
-
|
|
19
|
+
const manualExitCode = await runSkillManual(process.argv.slice(2), "insmind-cli", jsonErrors);
|
|
20
|
+
if (manualExitCode !== undefined) {
|
|
21
|
+
process.exitCode = manualExitCode;
|
|
22
|
+
}
|
|
23
|
+
else if (process.env.CLI_INTERNAL_HOST_DIAGNOSTIC === "1" && process.argv.length === 3 && process.argv[2] === "--version") {
|
|
19
24
|
await import("../src/telemetry/host-diagnostics.js")
|
|
20
25
|
.then(({ runHostDiagnosticReporter }) => runHostDiagnosticReporter({ product: insmindProduct }))
|
|
21
26
|
.catch(() => undefined);
|
|
@@ -8,7 +8,6 @@ import { classifyTelemetryError, isHelpOutcome, mapCliError } from "../cli/error
|
|
|
8
8
|
import { registerOrgCommands } from "../cli/org-commands.js";
|
|
9
9
|
import { registerToolCommands } from "../cli/tool-commands.js";
|
|
10
10
|
import { registerModelCommands } from "../cli/model-commands.js";
|
|
11
|
-
import { registerEditorCommands } from "../cli/editor-commands.js";
|
|
12
11
|
import { registerDamCommands } from "../cli/dam-commands.js";
|
|
13
12
|
import { registerUpdateCommand } from "../cli/update-command.js";
|
|
14
13
|
import { registerCreditsCommand } from "../cli/credits-command.js";
|
|
@@ -35,10 +34,15 @@ export function createCli(runtime, options) {
|
|
|
35
34
|
writeErr: () => undefined
|
|
36
35
|
});
|
|
37
36
|
program.addHelpText("after", runtime.product.id === "insmind"
|
|
38
|
-
? "\nChoose by the object and goal: tool list discovers generation and processing of attached images/videos (including text replacement, layers and vectors);
|
|
39
|
-
: "\n按对象和目标选入口:tool list 发现生成及附件图片/视频处理能力(含改字、分层、矢量化);
|
|
37
|
+
? "\nChoose by the object and goal: tool list discovers generation and processing of attached images/videos (including text replacement, layers and vectors); agent send handles planning and multi-turn creation.\nRead the selected command's --help. Use its advertised --schema for JSON structure and model get for live model inputs. --input takes a JSON file path or - with complete JSON on stdin; media URI fields inside JSON take URLs.\nstdout contains command results; human-readable views can include an update notice. stderr contains progress, warnings and errors. Fixed JSON commands, --json and --json-errors use {error:{code,message,details?,trace_id?}} for final errors. stderr may contain multiple messages.\nExit codes: 0 command success (async acceptance and successful queries still require checking task state), 1 execution failure, 2 invalid input, 130 local interruption; dispatched work may still be active.\n"
|
|
38
|
+
: "\n按对象和目标选入口:tool list 发现生成及附件图片/视频处理能力(含改字、分层、矢量化);agent send 负责策划和持续多轮创作。\n先读所选命令 --help;结构化输入从其公开的 --schema 发现,模型参数从 model get 查询。--input 接收 JSON 文件路径,或用 - 从 stdin 传完整 JSON;JSON 内的媒体 URI 字段接收 URL。\nstdout 输出命令结果,人类可读视图可以附带升级提醒;stderr 输出进度、警告和错误。固定 JSON 命令、--json 和 --json-errors 的最终错误使用 {error:{code,message,details?,trace_id?}},stderr 可能包含多条信息。\n退出码:0 命令成功(异步受理、查询成功仍须查看任务状态),1 执行失败,2 输入无效,130 本地中断;已派发的工作可能仍在继续。\n");
|
|
40
39
|
if (runtime.product.id === "insmind") {
|
|
41
40
|
program.option("--locale <locale>", "locale for service-owned business descriptions");
|
|
41
|
+
program.addHelpText("after", "Agents can run insmind-cli --skill for the guide catalog, then insmind-cli --skill <chapter> to read a guide.\n");
|
|
42
|
+
}
|
|
43
|
+
else if (process.env.CLI_HOST_APPLICATION !== "qwenwork" || process.env.CLI_INVOCATION_PURPOSE === undefined) {
|
|
44
|
+
// The retired Qwen 1.x CLI bridge owns its Skill and only accepts JSON business output.
|
|
45
|
+
program.addHelpText("after", "Agent 可用 gd-cli --skill 查看使用指南和场景目录,用 gd-cli --skill <章节> 读取所选正文。\n");
|
|
42
46
|
}
|
|
43
47
|
configureActionEnvironment(program, {
|
|
44
48
|
policies: runtime.accessPolicies,
|
|
@@ -51,7 +55,6 @@ export function createCli(runtime, options) {
|
|
|
51
55
|
registerAgentCommands(program, runtime);
|
|
52
56
|
registerToolCommands(program, runtime);
|
|
53
57
|
registerModelCommands(program, runtime);
|
|
54
|
-
registerEditorCommands(program, runtime);
|
|
55
58
|
registerDamCommands(program, runtime);
|
|
56
59
|
registerUpdateCommand(program, runtime);
|
|
57
60
|
registerTaskCommands(program, runtime);
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { createSkillCatalog } from "../features/skill/catalog.js";
|
|
1
2
|
import { httpUserAgent } from "../platform/http-user-agent.js";
|
|
2
3
|
import { canvasModelBindings } from "../features/tool/canvas-models.js";
|
|
3
4
|
import { createWindAnalytics } from "../analytics/wind.js";
|
|
@@ -32,9 +33,6 @@ import { createDamRegisteredUploader } from "../features/dam/registered-uploader
|
|
|
32
33
|
import { createDamTransientUploader } from "../features/dam/transient-uploader.js";
|
|
33
34
|
import { createDamStorageUploader } from "../features/dam/storage-upload.js";
|
|
34
35
|
import { createDamUseCases } from "../features/dam/use-cases.js";
|
|
35
|
-
import { createEditorSession } from "../features/editor/session.js";
|
|
36
|
-
import { createEditorSessionStateStore } from "../features/editor/session-state.js";
|
|
37
|
-
import { createEditorUseCases } from "../features/editor/use-cases.js";
|
|
38
36
|
import { createObjectStorageUploader } from "../features/dam/object-storage.js";
|
|
39
37
|
import { createAgentUseCases } from "../features/agent/use-cases.js";
|
|
40
38
|
import { createSceneCatalogAdapter } from "../features/tool/scene-catalog-adapter.js";
|
|
@@ -543,34 +541,6 @@ export function createProductionRuntime(options = {}) {
|
|
|
543
541
|
warn: (message) => { presenter.warning(message); },
|
|
544
542
|
telemetry
|
|
545
543
|
}), product.billingUnit);
|
|
546
|
-
const editor = createEditorUseCases({
|
|
547
|
-
onPartial: count => partialWarning("EDITOR_SNAPSHOT_PARTIAL", `有 ${count} 个元素无法表示,已返回其余元素。`, `${count} unsupported element(s); the other elements are included.`),
|
|
548
|
-
session: createEditorSession({
|
|
549
|
-
store: createEditorSessionStateStore({
|
|
550
|
-
...(options.homeDirectory === undefined
|
|
551
|
-
? {}
|
|
552
|
-
: { homeDirectory: options.homeDirectory }),
|
|
553
|
-
stateDirectory: product.stateDirectory
|
|
554
|
-
}),
|
|
555
|
-
browser,
|
|
556
|
-
defaultCreateUrl: product.defaultEditorCreateUrl,
|
|
557
|
-
workUrl: product.editorWorkUrl,
|
|
558
|
-
commandName: product.commandName,
|
|
559
|
-
restrictTargets: product.restrictEditorTargets,
|
|
560
|
-
stateDirectory: product.stateDirectory,
|
|
561
|
-
...(options.homeDirectory === undefined
|
|
562
|
-
? {}
|
|
563
|
-
: { homeDirectory: options.homeDirectory })
|
|
564
|
-
}),
|
|
565
|
-
validate: {
|
|
566
|
-
connect: validators.editorConnectOutput,
|
|
567
|
-
disconnect: validators.editorDisconnectOutput,
|
|
568
|
-
snapshot: validators.editorSnapshotOutput,
|
|
569
|
-
apply: validators.editorApplyOutput,
|
|
570
|
-
screenshot: validators.editorScreenshotOutput,
|
|
571
|
-
save: validators.editorSaveOutput
|
|
572
|
-
}
|
|
573
|
-
});
|
|
574
544
|
const update = {
|
|
575
545
|
run(signal) {
|
|
576
546
|
return createUpdateService({
|
|
@@ -606,7 +576,13 @@ export function createProductionRuntime(options = {}) {
|
|
|
606
576
|
commandName: product.commandName
|
|
607
577
|
} : {})
|
|
608
578
|
});
|
|
579
|
+
// The retired Qwen CLI bridge validates the original closed JSON schemas.
|
|
580
|
+
const legacyQwen = env.CLI_HOST_APPLICATION === "qwenwork" && env.CLI_INVOCATION_PURPOSE !== undefined;
|
|
609
581
|
return {
|
|
582
|
+
...(legacyQwen ? {} : {
|
|
583
|
+
skillCatalog: createSkillCatalog(product.commandName, { home: options.homeDirectory,
|
|
584
|
+
endpoint: env[product.id === "insmind" ? "INSMIND_CLI_SKILL_URL" : "GD_CLI_SKILL_URL"] }),
|
|
585
|
+
}),
|
|
610
586
|
product,
|
|
611
587
|
version: primarySkill.version,
|
|
612
588
|
telemetry,
|
|
@@ -639,7 +615,6 @@ export function createProductionRuntime(options = {}) {
|
|
|
639
615
|
throw error;
|
|
640
616
|
}
|
|
641
617
|
},
|
|
642
|
-
editor,
|
|
643
618
|
dam,
|
|
644
619
|
tool,
|
|
645
620
|
credits,
|
|
@@ -6,10 +6,10 @@ const jsonCommands = new WeakSet();
|
|
|
6
6
|
const selectedCommands = new WeakMap();
|
|
7
7
|
const commandDefinitions = new WeakMap();
|
|
8
8
|
/** Declare the existing fixed JSON contract alongside the command registration. */
|
|
9
|
-
export function jsonOutput(command) {
|
|
9
|
+
export function jsonOutput(command, description = "JSON output (default)") {
|
|
10
10
|
jsonCommands.add(command);
|
|
11
11
|
if (!command.options.some(option => option.long === "--json")) {
|
|
12
|
-
command.option("--json",
|
|
12
|
+
command.option("--json", description);
|
|
13
13
|
}
|
|
14
14
|
}
|
|
15
15
|
export function errorUsesJson(program, argv) {
|