@gaoding/cli 3.0.2 → 3.0.3
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 +3 -1
- package/contracts/operations/feedback.submit/input.schema.json +231 -0
- package/contracts/operations/feedback.submit/output.schema.json +29 -0
- package/dist/src/bootstrap/create-cli.js +2 -0
- package/dist/src/bootstrap/create-runtime.js +7 -0
- package/dist/src/bootstrap/validators.js +1 -0
- package/dist/src/cli/agent-commands.js +4 -3
- package/dist/src/cli/errors.js +6 -0
- package/dist/src/cli/feedback-command.js +31 -0
- package/dist/src/cli/model-commands.js +4 -4
- package/dist/src/cli/skill-output.js +13 -4
- package/dist/src/cli/task-commands.js +2 -1
- package/dist/src/cli/tool-commands.js +12 -5
- package/dist/src/features/feedback/submit.js +86 -0
- package/dist/src/features/skill/catalog.js +17 -1
- package/dist/src/telemetry/command-routes.json +1 -1
- package/package.json +4 -4
- package/skills/gd-cli/SKILL.md +1 -1
package/README.md
CHANGED
|
@@ -54,7 +54,9 @@ node (Join-Path (Split-Path $target) "sync-skill.js")
|
|
|
54
54
|
|
|
55
55
|
## 开始使用
|
|
56
56
|
|
|
57
|
-
|
|
57
|
+
用 `gd-cli --skill` 查看远程目录。按工具查模型或查模型详情时,结果中的 `relatedSkills` 给出匹配章节。工具列表也在对应条目中给出用法入口。需要用法时,运行 `gd-cli --skill <章节>`。已受理的任务按原任务号查询,拿到作品就交付。若明确需要完整结果附上指引,可以加 `--with-skills`。用 `--json` 取得原业务 JSON。模型参数和价格以实时目录为准。
|
|
58
|
+
|
|
59
|
+
用户要报问题或提需求时,运行 `gd-cli feedback --schema` 查看问题和需求示例,再用 `gd-cli feedback --input report.json` 提交。写入成功后把反馈编号交给用户。
|
|
58
60
|
|
|
59
61
|
```bash
|
|
60
62
|
gd-cli auth login
|
|
@@ -0,0 +1,231 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://gdcli.gaoding.com/contracts/operations/feedback.submit/input.schema.json",
|
|
4
|
+
"title": "FeedbackSubmitInput",
|
|
5
|
+
"description": "用户要向产品团队反馈时,宿主根据用户描述、已发生的操作和可见的错误整理一份反馈。填写能确认的事实,保留有用的错误码和关联号。提交前移除令牌、带签名的链接和无关个人信息。",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"additionalProperties": false,
|
|
8
|
+
"properties": {
|
|
9
|
+
"type": {
|
|
10
|
+
"type": "string",
|
|
11
|
+
"enum": [
|
|
12
|
+
"bug",
|
|
13
|
+
"feature"
|
|
14
|
+
],
|
|
15
|
+
"description": "操作出错或结果不符合预期时选 bug。希望增加或改进能力时选 feature。"
|
|
16
|
+
},
|
|
17
|
+
"host_application": {
|
|
18
|
+
"type": "string",
|
|
19
|
+
"minLength": 1,
|
|
20
|
+
"pattern": "\\S",
|
|
21
|
+
"description": "发起本次反馈的宿主应用。例如 workbuddy、codex。用户直接在终端操作时填 terminal。确实无法识别时填 unknown。",
|
|
22
|
+
"examples": [
|
|
23
|
+
"workbuddy",
|
|
24
|
+
"codex",
|
|
25
|
+
"terminal",
|
|
26
|
+
"unknown"
|
|
27
|
+
],
|
|
28
|
+
"maxLength": 160
|
|
29
|
+
},
|
|
30
|
+
"host_application_version": {
|
|
31
|
+
"type": [
|
|
32
|
+
"string",
|
|
33
|
+
"null"
|
|
34
|
+
],
|
|
35
|
+
"minLength": 1,
|
|
36
|
+
"pattern": "\\S",
|
|
37
|
+
"description": "宿主应用自身的版本。先查看宿主提供的版本信息,确实不可见时填 null。CLI、MCP 和连接器各有自己的版本。",
|
|
38
|
+
"maxLength": 160
|
|
39
|
+
},
|
|
40
|
+
"user_os": {
|
|
41
|
+
"type": "object",
|
|
42
|
+
"additionalProperties": false,
|
|
43
|
+
"description": "用户设备的操作系统。宿主根据已知的客户端环境填写。仅能看到云端、容器或远程 shell 时,将用户设备系统记为未知。",
|
|
44
|
+
"properties": {
|
|
45
|
+
"name": {
|
|
46
|
+
"type": "string",
|
|
47
|
+
"minLength": 1,
|
|
48
|
+
"pattern": "\\S",
|
|
49
|
+
"description": "操作系统名称,例如 Windows、macOS 或 Linux。宿主和用户都未提供时填 unknown。",
|
|
50
|
+
"maxLength": 128
|
|
51
|
+
},
|
|
52
|
+
"version": {
|
|
53
|
+
"type": [
|
|
54
|
+
"string",
|
|
55
|
+
"null"
|
|
56
|
+
],
|
|
57
|
+
"minLength": 1,
|
|
58
|
+
"pattern": "\\S",
|
|
59
|
+
"description": "用户设备的系统版本。无法确认时填 null。",
|
|
60
|
+
"maxLength": 128
|
|
61
|
+
},
|
|
62
|
+
"arch": {
|
|
63
|
+
"type": "string",
|
|
64
|
+
"minLength": 1,
|
|
65
|
+
"pattern": "\\S",
|
|
66
|
+
"description": "可确认时填写用户设备的架构,例如 arm64 或 x64。",
|
|
67
|
+
"maxLength": 128
|
|
68
|
+
}
|
|
69
|
+
},
|
|
70
|
+
"required": [
|
|
71
|
+
"name",
|
|
72
|
+
"version"
|
|
73
|
+
]
|
|
74
|
+
},
|
|
75
|
+
"connector_version": {
|
|
76
|
+
"type": "string",
|
|
77
|
+
"minLength": 1,
|
|
78
|
+
"pattern": "\\S",
|
|
79
|
+
"description": "能确定这次使用的连接器安装包版本时填写。",
|
|
80
|
+
"maxLength": 160
|
|
81
|
+
},
|
|
82
|
+
"actual": {
|
|
83
|
+
"type": "string",
|
|
84
|
+
"minLength": 1,
|
|
85
|
+
"pattern": "\\S",
|
|
86
|
+
"description": "问题反馈必填。说明做了什么、在哪一步看到了什么现象。错误提示保留与排查有关的文字。",
|
|
87
|
+
"maxLength": 3000
|
|
88
|
+
},
|
|
89
|
+
"expected": {
|
|
90
|
+
"type": "string",
|
|
91
|
+
"minLength": 1,
|
|
92
|
+
"pattern": "\\S",
|
|
93
|
+
"description": "问题反馈写用户原本期望的结果。需求反馈写希望产品能做什么,以及做到什么程度。",
|
|
94
|
+
"maxLength": 3000
|
|
95
|
+
},
|
|
96
|
+
"scenario": {
|
|
97
|
+
"type": "string",
|
|
98
|
+
"minLength": 1,
|
|
99
|
+
"pattern": "\\S",
|
|
100
|
+
"description": "需求反馈必填。说明用户在什么场景下需要这项能力。",
|
|
101
|
+
"maxLength": 3000
|
|
102
|
+
},
|
|
103
|
+
"steps": {
|
|
104
|
+
"type": "array",
|
|
105
|
+
"minItems": 1,
|
|
106
|
+
"items": {
|
|
107
|
+
"type": "string",
|
|
108
|
+
"minLength": 1,
|
|
109
|
+
"pattern": "\\S",
|
|
110
|
+
"description": "一次已经发生的操作。",
|
|
111
|
+
"maxLength": 512
|
|
112
|
+
},
|
|
113
|
+
"description": "能还原过程时按顺序列出已经做过的操作。无需为填写此字段再次生成作品或触发写入。",
|
|
114
|
+
"maxItems": 24
|
|
115
|
+
},
|
|
116
|
+
"operation": {
|
|
117
|
+
"type": "string",
|
|
118
|
+
"minLength": 1,
|
|
119
|
+
"pattern": "\\S",
|
|
120
|
+
"description": "与反馈有关的原命令或工具名,例如 task.get。命令只写命令名,参数里的用户内容可省略。",
|
|
121
|
+
"maxLength": 160
|
|
122
|
+
},
|
|
123
|
+
"failedStep": {
|
|
124
|
+
"type": "string",
|
|
125
|
+
"minLength": 1,
|
|
126
|
+
"pattern": "\\S",
|
|
127
|
+
"description": "原错误能定位到具体环节时填写,例如上传素材或交付结果。",
|
|
128
|
+
"maxLength": 160
|
|
129
|
+
},
|
|
130
|
+
"errorCode": {
|
|
131
|
+
"type": "string",
|
|
132
|
+
"minLength": 1,
|
|
133
|
+
"pattern": "\\S",
|
|
134
|
+
"description": "原始错误里实际出现的错误码。",
|
|
135
|
+
"maxLength": 160
|
|
136
|
+
},
|
|
137
|
+
"taskId": {
|
|
138
|
+
"type": "string",
|
|
139
|
+
"minLength": 1,
|
|
140
|
+
"pattern": "\\S",
|
|
141
|
+
"description": "原任务号,取自原回执。尚未受理或没有任务号时省略。",
|
|
142
|
+
"maxLength": 160
|
|
143
|
+
},
|
|
144
|
+
"traceId": {
|
|
145
|
+
"type": "string",
|
|
146
|
+
"minLength": 1,
|
|
147
|
+
"pattern": "\\S",
|
|
148
|
+
"description": "原调用的诊断编号,取自原错误或回执。没有时省略。",
|
|
149
|
+
"maxLength": 160
|
|
150
|
+
},
|
|
151
|
+
"occurredAt": {
|
|
152
|
+
"type": "string",
|
|
153
|
+
"format": "date-time",
|
|
154
|
+
"description": "已知问题发生时间时填写,带时区。系统会另记收到反馈的时间。"
|
|
155
|
+
}
|
|
156
|
+
},
|
|
157
|
+
"required": [
|
|
158
|
+
"type",
|
|
159
|
+
"host_application",
|
|
160
|
+
"host_application_version",
|
|
161
|
+
"user_os",
|
|
162
|
+
"expected"
|
|
163
|
+
],
|
|
164
|
+
"allOf": [
|
|
165
|
+
{
|
|
166
|
+
"if": {
|
|
167
|
+
"properties": {
|
|
168
|
+
"type": {
|
|
169
|
+
"const": "bug"
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
},
|
|
173
|
+
"then": {
|
|
174
|
+
"properties": {
|
|
175
|
+
"actual": {}
|
|
176
|
+
},
|
|
177
|
+
"required": [
|
|
178
|
+
"actual"
|
|
179
|
+
]
|
|
180
|
+
}
|
|
181
|
+
},
|
|
182
|
+
{
|
|
183
|
+
"if": {
|
|
184
|
+
"properties": {
|
|
185
|
+
"type": {
|
|
186
|
+
"const": "feature"
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
},
|
|
190
|
+
"then": {
|
|
191
|
+
"properties": {
|
|
192
|
+
"scenario": {}
|
|
193
|
+
},
|
|
194
|
+
"required": [
|
|
195
|
+
"scenario"
|
|
196
|
+
]
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
],
|
|
200
|
+
"examples": [
|
|
201
|
+
{
|
|
202
|
+
"type": "bug",
|
|
203
|
+
"host_application": "workbuddy",
|
|
204
|
+
"host_application_version": null,
|
|
205
|
+
"user_os": {
|
|
206
|
+
"name": "Windows",
|
|
207
|
+
"version": "11",
|
|
208
|
+
"arch": "x64"
|
|
209
|
+
},
|
|
210
|
+
"actual": "查询原任务可以取到视频,但打开返回的视频链接时提示 403。",
|
|
211
|
+
"expected": "点击成品链接后可以播放视频。",
|
|
212
|
+
"steps": [
|
|
213
|
+
"用原任务号取回生成的视频。",
|
|
214
|
+
"在浏览器打开成品链接。"
|
|
215
|
+
],
|
|
216
|
+
"operation": "task.get",
|
|
217
|
+
"taskId": "49de8098-7935-4e9e-9ad1-6fa2fa39b000"
|
|
218
|
+
},
|
|
219
|
+
{
|
|
220
|
+
"type": "feature",
|
|
221
|
+
"host_application": "codex",
|
|
222
|
+
"host_application_version": null,
|
|
223
|
+
"user_os": {
|
|
224
|
+
"name": "unknown",
|
|
225
|
+
"version": null
|
|
226
|
+
},
|
|
227
|
+
"scenario": "给同一款商品生成六张主图后,需要把全部原图交给运营。",
|
|
228
|
+
"expected": "一次下载全部原图,并保留生成顺序。"
|
|
229
|
+
}
|
|
230
|
+
]
|
|
231
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://gdcli.gaoding.com/contracts/operations/feedback.submit/output.schema.json",
|
|
4
|
+
"title": "FeedbackSubmitOutput",
|
|
5
|
+
"description": "SLS 确认接收反馈后返回。宿主可以把反馈编号交给用户,供后续排查时引用。",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"additionalProperties": false,
|
|
8
|
+
"properties": {
|
|
9
|
+
"feedbackId": {
|
|
10
|
+
"type": "string",
|
|
11
|
+
"format": "uuid",
|
|
12
|
+
"description": "接收调用的 CLI 或 MCP 服务在发送反馈前生成的 UUID。宿主将回执中的编号交给用户,支持人员可凭它在 SLS 查找反馈。"
|
|
13
|
+
},
|
|
14
|
+
"status": {
|
|
15
|
+
"const": "received",
|
|
16
|
+
"description": "SLS 已确认接收。"
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
"required": [
|
|
20
|
+
"feedbackId",
|
|
21
|
+
"status"
|
|
22
|
+
],
|
|
23
|
+
"examples": [
|
|
24
|
+
{
|
|
25
|
+
"feedbackId": "7607e64d-8c72-4b40-8e80-46f45451c223",
|
|
26
|
+
"status": "received"
|
|
27
|
+
}
|
|
28
|
+
]
|
|
29
|
+
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { writeSkillManual, skillManualArguments } from "../features/skill/manual.js";
|
|
2
2
|
import { isInterruption } from "../platform/interruption.js";
|
|
3
|
+
import { registerFeedbackCommand } from "../cli/feedback-command.js";
|
|
3
4
|
import { registerTaskCommands } from "../cli/task-commands.js";
|
|
4
5
|
import { Command, CommanderError } from "commander";
|
|
5
6
|
import { assertAllLeafCommandsBound, errorUsesJson, invocationDefinition, configureActionEnvironment } from "../cli/action-binding.js";
|
|
@@ -60,6 +61,7 @@ export function createCli(runtime, options) {
|
|
|
60
61
|
registerUpdateCommand(program, runtime);
|
|
61
62
|
registerTaskCommands(program, runtime);
|
|
62
63
|
registerCreditsCommand(program, runtime);
|
|
64
|
+
registerFeedbackCommand(program, runtime);
|
|
63
65
|
assertAllLeafCommandsBound(program);
|
|
64
66
|
outputs.set(program, runtime);
|
|
65
67
|
if (runtime.analytics)
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { sendFeedback } from "../features/feedback/submit.js";
|
|
1
2
|
import { createSkillCatalog } from "../features/skill/catalog.js";
|
|
2
3
|
import { httpUserAgent } from "../platform/http-user-agent.js";
|
|
3
4
|
import { canvasModelBindings } from "../features/tool/canvas-models.js";
|
|
@@ -589,6 +590,12 @@ export function createProductionRuntime(options = {}) {
|
|
|
589
590
|
}),
|
|
590
591
|
product,
|
|
591
592
|
version: primarySkill.version,
|
|
593
|
+
submitFeedback: (input, signal) => sendFeedback(input, {
|
|
594
|
+
entry_point: "cli", cli_name: product.commandName, cli_version: primarySkill.version, environment: telemetryEnvironment,
|
|
595
|
+
trace_id: telemetry.traceId, host_application: host.host_application ?? "unknown",
|
|
596
|
+
host_application_source: host.host_application_source ?? "unknown",
|
|
597
|
+
...(host.host_connector_version && { host_connector_version: host.host_connector_version }),
|
|
598
|
+
}, { url: options.telemetryTrackingUrl ?? product.telemetryUrl, fetch, signal }),
|
|
592
599
|
telemetry,
|
|
593
600
|
telemetrySink,
|
|
594
601
|
...(analytics ? { analytics } : {}),
|
|
@@ -57,6 +57,7 @@ export function createContractValidators(options = {}) {
|
|
|
57
57
|
}
|
|
58
58
|
const unavailable = assertion(() => unavailableValidator, OutputContractError);
|
|
59
59
|
return {
|
|
60
|
+
feedbackInput: input("feedback.submit"),
|
|
60
61
|
creditsOutput: output("credits.get"),
|
|
61
62
|
creditsUsageListOutput: output("credits.usage.list"),
|
|
62
63
|
creditsUsageGetOutput: output("credits.usage.get"),
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { skillOutput, writeSkillResult } from "./skill-output.js";
|
|
1
|
+
import { skillOutput, writeSkillResult, writeTaskResult } from "./skill-output.js";
|
|
2
2
|
import { creationTaskHelp } from "./creation-help.js";
|
|
3
3
|
import { hostSchema, readHostInput } from "./host-input.js";
|
|
4
4
|
import { readAgentInputSchema } from "../contracts/creation-input.js";
|
|
@@ -58,7 +58,7 @@ export function registerAgentCommands(program, runtime) {
|
|
|
58
58
|
const result = await runtime.startBackgroundTask({ operation: "agent.send", state: context.state, label: task.label, input }, signal);
|
|
59
59
|
await runtime.telemetry.stage("output", async () => {
|
|
60
60
|
runtime.validators.taskResult(result);
|
|
61
|
-
|
|
61
|
+
writeTaskResult(runtime, result);
|
|
62
62
|
});
|
|
63
63
|
return;
|
|
64
64
|
}
|
|
@@ -67,7 +67,8 @@ export function registerAgentCommands(program, runtime) {
|
|
|
67
67
|
access: { credential: context.state.credential, organizationId: context.state.organization.id }, signal });
|
|
68
68
|
const result = await runtime.tasks.track({ ...task, run });
|
|
69
69
|
await runtime.telemetry.stage("output", async () => {
|
|
70
|
-
|
|
70
|
+
const question = result.message.parts.some(part => "data" in part && part.data && "questions" in part.data);
|
|
71
|
+
await writeSkillResult(runtime, send, result, question ? undefined : "agent.send");
|
|
71
72
|
});
|
|
72
73
|
}, {
|
|
73
74
|
operation: "agent.send",
|
package/dist/src/cli/errors.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { FeedbackDeliveryError } from "../features/feedback/submit.js";
|
|
1
2
|
import { SkillManualError } from "../features/skill/manual.js";
|
|
2
3
|
import { CreditsPageCursorError } from "../features/credits/use-cases.js";
|
|
3
4
|
import { observedErrorCategory, observedErrorMessage } from "./observed-errors.js";
|
|
@@ -47,6 +48,9 @@ export function isHelpOutcome(error) {
|
|
|
47
48
|
&& (error.code === "commander.helpDisplayed" || error.code === "commander.version");
|
|
48
49
|
}
|
|
49
50
|
export function mapCliError(error, options) {
|
|
51
|
+
if (error instanceof FeedbackDeliveryError) {
|
|
52
|
+
return failure("FEEDBACK_" + error.outcome.toUpperCase(), error.messageFor(options.product?.id === "insmind"), 1, undefined, error.feedbackId ? { feedbackId: error.feedbackId } : undefined);
|
|
53
|
+
}
|
|
50
54
|
if (!options.aborted && error instanceof SkillManualError) {
|
|
51
55
|
return failure(error.code, error.message, error.code === "USAGE_ERROR" ? 2 : 1);
|
|
52
56
|
}
|
|
@@ -174,6 +178,8 @@ function mapBaseCliError(error, options) {
|
|
|
174
178
|
? text("无法读取 JSON 输入。", "Cannot read the JSON input.")
|
|
175
179
|
: text("JSON 输入语法无效。", "The input is not valid JSON."), 2, [error.reason === "read" ? text("检查输入文件是否存在、是否可读,或 stdin 是否可用。", "Check that the input file exists and is readable, or that stdin is available.")
|
|
176
180
|
: text("修正 JSON 语法后重新执行;输入尚未提交。", "Correct the JSON syntax and run again; the input has not been submitted.")], { reason: `json_${error.reason}`, system_code: systemErrorCode(error) });
|
|
181
|
+
if (error instanceof InputContractError && options.operation === "feedback.submit")
|
|
182
|
+
return failure("USAGE_ERROR", text("反馈还没提交。请按提示补齐或修正字段。", "The report has not been sent. Correct the indicated fields."), 2, [command + " feedback --schema"], { reason: "schema_validation", issues: error.issues });
|
|
177
183
|
if (error instanceof InputContractError)
|
|
178
184
|
return failure("USAGE_ERROR", text("输入不符合命令要求,请修正所列字段。", "The input does not match the command requirements; correct the listed fields."), 2, [text("使用该命令 --help 中的 Schema 发现入口核对输入。file URL 请用 pathToFileURL(path).href 生成,中文文件名无需改名。", "Use the Schema discovery described in this command's --help. Generate file URLs with pathToFileURL(path).href; Unicode filenames are supported.")], { reason: "schema_validation", issues: error.issues });
|
|
179
185
|
if (error instanceof ToolInputError || error instanceof AgentInputError) {
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { contractSchema } from "../contracts/schema.js";
|
|
2
|
+
import { productText } from "../product/text.js";
|
|
3
|
+
import { bindPreparedAction, jsonOutput } from "./action-binding.js";
|
|
4
|
+
import { CliUsageError } from "./errors.js";
|
|
5
|
+
export function registerFeedbackCommand(program, runtime) {
|
|
6
|
+
const text = (zh, en) => productText(runtime.product, zh, en);
|
|
7
|
+
const name = runtime.product.commandName;
|
|
8
|
+
const feedback = program.command("feedback")
|
|
9
|
+
.description(text("向产品团队反馈问题或需求,取得反馈编号", "Report a problem or request a feature and get a feedback ID"))
|
|
10
|
+
.option("--schema", text("查看必填字段及问题、需求示例", "show the required fields and examples for bugs and feature requests"))
|
|
11
|
+
.option("--input <file|->", text("从文件或标准输入读取反馈 JSON", "read the report as JSON from a file or stdin"))
|
|
12
|
+
.allowExcessArguments(false)
|
|
13
|
+
.addHelpText("after", text("\n用户要反馈时,整理已发生的操作、实际现象和预期结果。提需求时写清使用场景和期望。带上能确认的宿主、用户设备和原错误信息。提交反馈无需登录。\n", "\nWhen the user asks to send feedback, describe what happened and what they expected. For a feature, describe when they need it. Include the host, user device and available error details. No sign-in is required.\n")
|
|
14
|
+
+ name + " feedback --schema\n" + name + " feedback --input bug.json\n" + name + " feedback --input - < feature.json\n");
|
|
15
|
+
jsonOutput(feedback);
|
|
16
|
+
bindPreparedAction(feedback, "none", async (signal) => {
|
|
17
|
+
const { schema, input } = feedback.opts();
|
|
18
|
+
if (Boolean(schema) === (input !== undefined))
|
|
19
|
+
throw new CliUsageError();
|
|
20
|
+
if (schema) {
|
|
21
|
+
runtime.io.writeOut(JSON.stringify(contractSchema("feedback.submit", "input")) + "\n");
|
|
22
|
+
return { handled: true };
|
|
23
|
+
}
|
|
24
|
+
const report = await runtime.jsonInput.read(input, signal);
|
|
25
|
+
runtime.validators.feedbackInput(report);
|
|
26
|
+
return { handled: false, input: report };
|
|
27
|
+
}, async (_context, report, signal) => {
|
|
28
|
+
const result = await runtime.telemetry.stage("feedback", () => runtime.submitFeedback(report, signal));
|
|
29
|
+
runtime.io.writeOut(JSON.stringify(result) + "\n");
|
|
30
|
+
}, { operation: "feedback.submit", mode: () => feedback.opts().schema ? "schema" : "execute" });
|
|
31
|
+
}
|
|
@@ -12,7 +12,7 @@ export function registerModelCommands(program, runtime) {
|
|
|
12
12
|
.option("--tool <tool>", text(runtime.product, "按工具筛选", "filter by tool"))
|
|
13
13
|
.allowExcessArguments(false);
|
|
14
14
|
list.addHelpText("after", text(runtime.product, "\n列表只提供模型摘要。选择后用 model get <model> --tool <tool> 读取完整输入、用途与保留范围,再判断是否符合需求;不能仅凭摘要推断整个工具不支持。\n", "\nThis list is a summary. Read model get <model> --tool <tool> for full inputs, purpose and preservation scope before deciding whether it meets the request; the summary alone cannot establish that the whole Tool is unsupported.\n"));
|
|
15
|
-
skillOutput(list, runtime);
|
|
15
|
+
skillOutput(list, runtime, true);
|
|
16
16
|
bindAction(list, "organization", async (context, signal) => {
|
|
17
17
|
const selectedTool = list.opts().tool;
|
|
18
18
|
if (selectedTool !== undefined)
|
|
@@ -31,7 +31,7 @@ export function registerModelCommands(program, runtime) {
|
|
|
31
31
|
});
|
|
32
32
|
await runtime.telemetry.stage("output", async () => {
|
|
33
33
|
runtime.validators.modelListOutput(result);
|
|
34
|
-
await writeSkillResult(runtime, list, result, selectedTool);
|
|
34
|
+
await writeSkillResult(runtime, list, result, selectedTool, true);
|
|
35
35
|
});
|
|
36
36
|
}, { operation: "model.list" });
|
|
37
37
|
const get = model.command("get")
|
|
@@ -51,7 +51,7 @@ export function registerModelCommands(program, runtime) {
|
|
|
51
51
|
text(runtime.product, "公开 Schema 指导构参;CLI 仅检查自身读取、转换、授权和交付所必需的条件。服务端决定业务参数是否可接受,返回明确错误时按实际原因处理,不能静默替换用户值。", "The public Schema guides input construction. The CLI checks only what it needs for reading, conversion, authorization and delivery. The service decides business validity; handle its stated error without silently replacing user values."),
|
|
52
52
|
""
|
|
53
53
|
].join("\n"));
|
|
54
|
-
skillOutput(get, runtime);
|
|
54
|
+
skillOutput(get, runtime, true);
|
|
55
55
|
bindAction(get, "organization", async (context, signal) => {
|
|
56
56
|
const modelName = get.processedArgs[0];
|
|
57
57
|
if (typeof modelName !== "string" || modelName.trim() === "")
|
|
@@ -75,7 +75,7 @@ export function registerModelCommands(program, runtime) {
|
|
|
75
75
|
const projected = result.inputSchema ? hostSchema(runtime, result.inputSchema, result.tool) : undefined;
|
|
76
76
|
const output = { ...result, ...(projected ? { inputSchema: projected } : {}) };
|
|
77
77
|
runtime.validators.modelGetOutput(output);
|
|
78
|
-
await writeSkillResult(runtime, get, output, result.tool);
|
|
78
|
+
await writeSkillResult(runtime, get, output, result.tool, true);
|
|
79
79
|
});
|
|
80
80
|
}, {
|
|
81
81
|
operation: "model.get"
|
|
@@ -1,13 +1,22 @@
|
|
|
1
1
|
import { jsonOutput } from "./action-binding.js";
|
|
2
2
|
import { productText } from "../product/text.js";
|
|
3
|
-
export function skillOutput(command, runtime) {
|
|
3
|
+
export function skillOutput(command, runtime, discovery = false) {
|
|
4
4
|
jsonOutput(command, productText(runtime.product, "仅输出原业务 JSON,供按原 Schema 校验的脚本使用", "output only the business JSON for scripts that validate its original schema"));
|
|
5
|
-
command.option("--with-skills", productText(runtime.product, "
|
|
5
|
+
command.option("--with-skills", productText(runtime.product, discovery ? "附上与本次查询匹配的选读指引,可与 --json 合用" : "在完整结果中附上选读指引,可与 --json 合用", discovery ? "include optional guides for this query, including with --json" : "include optional guides with the completed result, including with --json"));
|
|
6
6
|
}
|
|
7
|
-
export async function writeSkillResult(runtime, command, result, operation) {
|
|
7
|
+
export async function writeSkillResult(runtime, command, result, operation, discovery = false) {
|
|
8
8
|
const { withSkills, json } = command.opts();
|
|
9
|
-
const relatedSkills = operation && (
|
|
9
|
+
const relatedSkills = operation && (withSkills || (discovery && !json))
|
|
10
10
|
? await runtime.skillCatalog?.recommendations(operation)
|
|
11
11
|
: undefined;
|
|
12
12
|
runtime.io.writeOut(JSON.stringify(relatedSkills?.length ? { ...result, relatedSkills } : result) + "\n");
|
|
13
13
|
}
|
|
14
|
+
export function writeTaskResult(runtime, result) {
|
|
15
|
+
if (result.state !== "running") {
|
|
16
|
+
runtime.io.writeOut(JSON.stringify(result) + "\n");
|
|
17
|
+
return;
|
|
18
|
+
}
|
|
19
|
+
const lookup = runtime.product.commandName + " task get " + result.taskId;
|
|
20
|
+
const next = productText(runtime.product, "任务已受理,生成可能需要几分钟。请用 " + lookup + " 取回结果。仍在处理时,隔几秒继续查同一任务,请勿重复提交。", "Task accepted. Generation can take a few minutes. Run " + lookup + " to get the result. If it is still running, check the same task after a few seconds without resubmitting.");
|
|
21
|
+
runtime.io.writeOut(JSON.stringify({ ...result, note: result.note ? result.note + " " + next : next }) + "\n");
|
|
22
|
+
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { writeTaskResult } from "./skill-output.js";
|
|
1
2
|
import { productText } from "../product/text.js";
|
|
2
3
|
import { validTaskId } from "../features/task/store.js";
|
|
3
4
|
import { jsonOutput, bindPreparedAction } from "./action-binding.js";
|
|
@@ -55,7 +56,7 @@ export function registerTaskCommands(program, runtime) {
|
|
|
55
56
|
const result = await tasks.get({ id, state: context.state, signal });
|
|
56
57
|
await runtime.telemetry.stage("output", async () => {
|
|
57
58
|
runtime.validators.taskResult(result);
|
|
58
|
-
runtime
|
|
59
|
+
writeTaskResult(runtime, result);
|
|
59
60
|
});
|
|
60
61
|
}, { operation: "task.get" });
|
|
61
62
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { ToolInputError } from "../features/tool/catalog.js";
|
|
2
|
-
import { skillOutput, writeSkillResult } from "./skill-output.js";
|
|
2
|
+
import { skillOutput, writeSkillResult, writeTaskResult } from "./skill-output.js";
|
|
3
3
|
import { creationTaskHelp } from "./creation-help.js";
|
|
4
4
|
import { hostSchema, readHostInput } from "./host-input.js";
|
|
5
|
-
import {
|
|
5
|
+
import { bindAction, bindPreparedAction } from "./action-binding.js";
|
|
6
6
|
import { CliUsageError } from "./errors.js";
|
|
7
7
|
import { productText as text } from "../product/text.js";
|
|
8
8
|
export function registerToolCommands(program, runtime) {
|
|
@@ -13,7 +13,7 @@ export function registerToolCommands(program, runtime) {
|
|
|
13
13
|
const list = tool.command("list")
|
|
14
14
|
.description(text(runtime.product, "列出可用工具", "List available tools"))
|
|
15
15
|
.allowExcessArguments(false);
|
|
16
|
-
|
|
16
|
+
skillOutput(list, runtime, true);
|
|
17
17
|
bindAction(list, "organization", async (context, signal) => {
|
|
18
18
|
const result = await runtime.tool.listTools({
|
|
19
19
|
access: {
|
|
@@ -24,7 +24,14 @@ export function registerToolCommands(program, runtime) {
|
|
|
24
24
|
});
|
|
25
25
|
await runtime.telemetry.stage("output", async () => {
|
|
26
26
|
runtime.validators.toolListOutput(result);
|
|
27
|
-
|
|
27
|
+
const { json, withSkills } = list.opts();
|
|
28
|
+
const guides = (!json || withSkills) && runtime.skillCatalog?.guidesForTools
|
|
29
|
+
? await runtime.skillCatalog.guidesForTools(result.tools.map(tool => tool.name)) : undefined;
|
|
30
|
+
const tools = result.tools.map(tool => {
|
|
31
|
+
const guide = guides?.get(tool.name);
|
|
32
|
+
return guide ? { ...tool, description: tool.description + text(runtime.product, " 需要用法时运行 ", " For help, run ") + guide } : tool;
|
|
33
|
+
});
|
|
34
|
+
runtime.io.writeOut(JSON.stringify({ ...result, tools }) + "\n");
|
|
28
35
|
});
|
|
29
36
|
}, { operation: "tool.list" });
|
|
30
37
|
const call = tool.command("call")
|
|
@@ -93,7 +100,7 @@ export function registerToolCommands(program, runtime) {
|
|
|
93
100
|
const result = await runtime.startBackgroundTask({ ...task, input: prepared.input }, signal);
|
|
94
101
|
await runtime.telemetry.stage("output", async () => {
|
|
95
102
|
runtime.validators.taskResult(result);
|
|
96
|
-
|
|
103
|
+
writeTaskResult(runtime, result);
|
|
97
104
|
});
|
|
98
105
|
return;
|
|
99
106
|
}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { randomUUID } from "node:crypto";
|
|
2
|
+
import { cleanText } from "../../telemetry/sanitize.js";
|
|
3
|
+
export class FeedbackDeliveryError extends Error {
|
|
4
|
+
outcome;
|
|
5
|
+
feedbackId;
|
|
6
|
+
status;
|
|
7
|
+
constructor(outcome, feedbackId, status) {
|
|
8
|
+
super("Feedback delivery " + outcome);
|
|
9
|
+
this.outcome = outcome;
|
|
10
|
+
this.feedbackId = feedbackId;
|
|
11
|
+
this.status = status;
|
|
12
|
+
}
|
|
13
|
+
messageFor(english) {
|
|
14
|
+
if (this.outcome === "unknown")
|
|
15
|
+
return english
|
|
16
|
+
? "Receipt could not be confirmed. Keep feedback ID " + this.feedbackId + " and avoid sending the same report again."
|
|
17
|
+
: "暂时无法确认反馈是否收到。请保留反馈编号 " + this.feedbackId + ",避免重复提交。";
|
|
18
|
+
if (this.outcome === "unavailable")
|
|
19
|
+
return english
|
|
20
|
+
? "Feedback could not be sent. The feedback service is unavailable."
|
|
21
|
+
: "反馈还没发出。反馈服务暂时不可用。";
|
|
22
|
+
return english ? "The feedback service declined this report (HTTP " + this.status + ")."
|
|
23
|
+
: "反馈服务拒绝了这次提交(HTTP " + this.status + ")。";
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
function clean(value) {
|
|
27
|
+
return cleanText(value.replace(/(?:https?|file):\/\/[^\s<>"',。;]+/giu, "[link]")
|
|
28
|
+
.replace(/(["'])(?:(?:[A-Z]:[\\/]|\/|\\\\)[^"'\r\n]+)\1/giu, "[path]")
|
|
29
|
+
.replace(/(?:^|(?<=[\s((=::]))(?:\/[^\s,。;、))"'<>]+|[a-z]:[\\/][^\s,。;、))"'<>]+|\\\\[^\s,。;、))"'<>]+)/giu, "[path]")
|
|
30
|
+
.replace(/(?:\/(?:Users|home|private|tmp|var|mnt|Volumes)\/|[a-z]:\\)[^\s,。;、))"'<>]+/giu, "[path]")
|
|
31
|
+
.replace(/\b(authorization|proxy-authorization)\s*[:=]\s*(?:basic|bearer)\s+[^\s,;]+/giu, "$1=[REDACTED]")
|
|
32
|
+
.replace(/\b(password|passwd|secret)\s*[:=]\s*(?:"[^"]*"|'[^']*'|[^\s,;]+)/giu, "$1=[REDACTED]")
|
|
33
|
+
.replace(/[\w.+%-]+@[\w.-]+\.[a-z]{2,}/giu, "[email]")
|
|
34
|
+
.replace(/(?<!\d)(?:\+86[- ]?)?1[3-9]\d{9}(?!\d)/gu, "[phone]"));
|
|
35
|
+
}
|
|
36
|
+
export async function sendFeedback(input, context, options) {
|
|
37
|
+
if (!options.url)
|
|
38
|
+
throw new FeedbackDeliveryError("unavailable");
|
|
39
|
+
options.signal?.throwIfAborted();
|
|
40
|
+
const feedbackId = randomUUID();
|
|
41
|
+
const { environment, ...source } = context;
|
|
42
|
+
const fields = {
|
|
43
|
+
...source, ...(source.entry_point === "cli" ? { env: environment } : { environment }), event_name: "user_feedback", operation: "feedback.submit", command_kind: "technical",
|
|
44
|
+
feedback_id: feedbackId, feedback_type: input.type, received_at: new Date().toISOString(),
|
|
45
|
+
os: process.platform, arch: process.arch, node_version: process.versions.node,
|
|
46
|
+
reported_host_application: input.host_application,
|
|
47
|
+
reported_host_application_version: input.host_application_version ?? "unknown",
|
|
48
|
+
reported_user_os: input.user_os.name, reported_user_os_version: input.user_os.version ?? "unknown",
|
|
49
|
+
reported_user_os_arch: input.user_os.arch, reported_connector_version: input.connector_version,
|
|
50
|
+
actual: input.actual, expected: input.expected, scenario: input.scenario,
|
|
51
|
+
reported_operation: input.operation, reported_failed_step: input.failedStep, reported_error_code: input.errorCode,
|
|
52
|
+
reported_task_id: input.taskId, reported_trace_id: input.traceId, reported_occurred_at: input.occurredAt,
|
|
53
|
+
};
|
|
54
|
+
const record = {};
|
|
55
|
+
for (const [key, value] of Object.entries(fields))
|
|
56
|
+
if (value !== undefined)
|
|
57
|
+
record[key] = clean(value);
|
|
58
|
+
if (input.steps)
|
|
59
|
+
record.steps = JSON.stringify(input.steps.map(clean));
|
|
60
|
+
const body = JSON.stringify({ __logs__: [record] });
|
|
61
|
+
const request = options.fetch ?? globalThis.fetch;
|
|
62
|
+
let uncertain = false;
|
|
63
|
+
for (let attempt = 1;; attempt++) {
|
|
64
|
+
try {
|
|
65
|
+
const timeout = AbortSignal.timeout(12_000);
|
|
66
|
+
const signal = options.signal ? AbortSignal.any([options.signal, timeout]) : timeout;
|
|
67
|
+
const response = await request(options.url, { method: "POST", headers: { "Content-Type": "application/json" },
|
|
68
|
+
redirect: "error", credentials: "omit", body, signal });
|
|
69
|
+
void response.body?.cancel().catch(() => { });
|
|
70
|
+
if (response.ok)
|
|
71
|
+
return { feedbackId, status: "received" };
|
|
72
|
+
if (response.status >= 500 || response.status === 408)
|
|
73
|
+
uncertain = true;
|
|
74
|
+
if (attempt === 1 && (uncertain || response.status === 429) && !options.signal?.aborted)
|
|
75
|
+
continue;
|
|
76
|
+
throw new FeedbackDeliveryError(uncertain ? "unknown" : "rejected", feedbackId, response.status);
|
|
77
|
+
}
|
|
78
|
+
catch (error) {
|
|
79
|
+
if (error instanceof FeedbackDeliveryError)
|
|
80
|
+
throw error;
|
|
81
|
+
uncertain = true;
|
|
82
|
+
if (attempt === 2 || options.signal?.aborted)
|
|
83
|
+
throw new FeedbackDeliveryError("unknown", feedbackId);
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
}
|
|
@@ -20,6 +20,9 @@ function parseCatalog(body) {
|
|
|
20
20
|
}
|
|
21
21
|
return value.skills;
|
|
22
22
|
}
|
|
23
|
+
function matchesOperation(item, operation) {
|
|
24
|
+
return item.operations.some(op => op.endsWith(".*") ? operation.startsWith(op.slice(0, -1)) : op === operation);
|
|
25
|
+
}
|
|
23
26
|
async function readCache(path) {
|
|
24
27
|
try {
|
|
25
28
|
const cached = JSON.parse(await readFile(path, "utf8"));
|
|
@@ -136,10 +139,23 @@ export function createSkillCatalog(client, options = {}) {
|
|
|
136
139
|
return body;
|
|
137
140
|
}, 3500);
|
|
138
141
|
},
|
|
142
|
+
async guidesForTools(names) {
|
|
143
|
+
const result = new Map();
|
|
144
|
+
try {
|
|
145
|
+
const catalog = (await load(undefined, parseCatalog, 650)).sort((a, b) => a.operations.length - b.operations.length);
|
|
146
|
+
for (const name of names) {
|
|
147
|
+
const guide = catalog.find(item => matchesOperation(item, name));
|
|
148
|
+
if (guide)
|
|
149
|
+
result.set(name, client + " --skill " + guide.id);
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
catch { /* Tools remain usable without the guide catalog. */ }
|
|
153
|
+
return result;
|
|
154
|
+
},
|
|
139
155
|
async recommendations(operation) {
|
|
140
156
|
try {
|
|
141
157
|
const items = await load(undefined, parseCatalog, 650);
|
|
142
|
-
return items.filter(item => item
|
|
158
|
+
return items.filter(item => matchesOperation(item, operation))
|
|
143
159
|
.map(({ id, title, description }) => ({ id, title, description, command: client + " --skill " + id }));
|
|
144
160
|
}
|
|
145
161
|
catch {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"operation":"unknown","action":false,"options":["-V, --version","--json-errors"],"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":{}}}},"org":{"operation":"org","action":false,"options":[],"children":{"list":{"operation":"org.list","action":true,"options":["--json"],"children":{}},"current":{"operation":"org.current","action":true,"options":["--json"],"children":{}},"switch":{"operation":"org.switch","action":true,"options":["--org <org-id>"],"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":{}}}}}}}}
|
|
1
|
+
{"operation":"unknown","action":false,"options":["-V, --version","--json-errors"],"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":{}}}},"org":{"operation":"org","action":false,"options":[],"children":{"list":{"operation":"org.list","action":true,"options":["--json"],"children":{}},"current":{"operation":"org.current","action":true,"options":["--json"],"children":{}},"switch":{"operation":"org.switch","action":true,"options":["--org <org-id>"],"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","--with-skills"],"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":{}}}}}},"feedback":{"operation":"feedback.submit","action":true,"options":["--schema","--input <file|->","--json"],"children":{}}}}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gaoding/cli",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.3",
|
|
4
4
|
"description": "Gaoding command-line interface for agents and people.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -65,8 +65,8 @@
|
|
|
65
65
|
}
|
|
66
66
|
},
|
|
67
67
|
"gaodingRelease": {
|
|
68
|
-
"sourceCommit": "
|
|
69
|
-
"pipelineId": "
|
|
70
|
-
"pipelineUrl": "https://git.intra.gaoding.com/gtt/gaoding-cli/-/pipelines/
|
|
68
|
+
"sourceCommit": "1606633d4ce7d82216ad9c1bf1d1e1bc1e11ebd4",
|
|
69
|
+
"pipelineId": "290481",
|
|
70
|
+
"pipelineUrl": "https://git.intra.gaoding.com/gtt/gaoding-cli/-/pipelines/290481"
|
|
71
71
|
}
|
|
72
72
|
}
|
package/skills/gd-cli/SKILL.md
CHANGED
|
@@ -15,7 +15,7 @@ description: 用户希望通过稿定 CLI 创作或处理图片、视频、文
|
|
|
15
15
|
|
|
16
16
|
## 查找具体指引
|
|
17
17
|
|
|
18
|
-
|
|
18
|
+
查模型或工具时,可以从结果找到对应的用法。用户要开始创作或继续加工,而你还缺用法时,用 `gd-cli --skill <章节>` 读对应章节。要浏览目录,用 `gd-cli --skill`。
|
|
19
19
|
|
|
20
20
|
## 续作和交付
|
|
21
21
|
|