@gaoding/cli 0.0.0 → 1.0.0-alpha.25

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (136) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +40 -3
  3. package/contracts/operations/agent.send/input.schema.json +353 -0
  4. package/contracts/operations/agent.send/output.schema.json +271 -0
  5. package/contracts/operations/auth.status/input.schema.json +7 -0
  6. package/contracts/operations/auth.status/output.schema.json +132 -0
  7. package/contracts/operations/dam.copy/input.schema.json +19 -0
  8. package/contracts/operations/dam.copy/output.schema.json +19 -0
  9. package/contracts/operations/dam.delete/input.schema.json +23 -0
  10. package/contracts/operations/dam.delete/output.schema.json +6 -0
  11. package/contracts/operations/dam.download/input.schema.json +14 -0
  12. package/contracts/operations/dam.download/output.schema.json +25 -0
  13. package/contracts/operations/dam.folder.list/input.schema.json +15 -0
  14. package/contracts/operations/dam.folder.list/output.schema.json +37 -0
  15. package/contracts/operations/dam.get/input.schema.json +16 -0
  16. package/contracts/operations/dam.get/output.schema.json +46 -0
  17. package/contracts/operations/dam.list/input.schema.json +44 -0
  18. package/contracts/operations/dam.list/output.schema.json +71 -0
  19. package/contracts/operations/dam.move/input.schema.json +19 -0
  20. package/contracts/operations/dam.move/output.schema.json +18 -0
  21. package/contracts/operations/dam.recycle.list/input.schema.json +13 -0
  22. package/contracts/operations/dam.recycle.list/output.schema.json +34 -0
  23. package/contracts/operations/dam.recycle.restore/input.schema.json +14 -0
  24. package/contracts/operations/dam.recycle.restore/output.schema.json +6 -0
  25. package/contracts/operations/dam.rename/input.schema.json +18 -0
  26. package/contracts/operations/dam.rename/output.schema.json +18 -0
  27. package/contracts/operations/dam.repository.list/input.schema.json +8 -0
  28. package/contracts/operations/dam.repository.list/output.schema.json +52 -0
  29. package/contracts/operations/dam.search/input.schema.json +46 -0
  30. package/contracts/operations/dam.search/output.schema.json +71 -0
  31. package/contracts/operations/dam.tag.list/input.schema.json +12 -0
  32. package/contracts/operations/dam.tag.list/output.schema.json +26 -0
  33. package/contracts/operations/dam.upload/input.schema.json +31 -0
  34. package/contracts/operations/dam.upload/output.schema.json +46 -0
  35. package/contracts/operations/editor.apply/input.schema.json +134 -0
  36. package/contracts/operations/editor.apply/output.schema.json +15 -0
  37. package/contracts/operations/editor.connect/input.schema.json +15 -0
  38. package/contracts/operations/editor.connect/output.schema.json +17 -0
  39. package/contracts/operations/editor.disconnect/input.schema.json +8 -0
  40. package/contracts/operations/editor.disconnect/output.schema.json +14 -0
  41. package/contracts/operations/editor.save/input.schema.json +8 -0
  42. package/contracts/operations/editor.save/output.schema.json +23 -0
  43. package/contracts/operations/editor.screenshot/input.schema.json +8 -0
  44. package/contracts/operations/editor.screenshot/output.schema.json +16 -0
  45. package/contracts/operations/editor.snapshot/input.schema.json +8 -0
  46. package/contracts/operations/editor.snapshot/output.schema.json +113 -0
  47. package/contracts/operations/model.get/input.schema.json +18 -0
  48. package/contracts/operations/model.get/output.schema.json +191 -0
  49. package/contracts/operations/model.list/input.schema.json +15 -0
  50. package/contracts/operations/model.list/output.schema.json +111 -0
  51. package/contracts/operations/org.current/input.schema.json +7 -0
  52. package/contracts/operations/org.current/output.schema.json +49 -0
  53. package/contracts/operations/org.list/input.schema.json +7 -0
  54. package/contracts/operations/org.list/output.schema.json +71 -0
  55. package/contracts/operations/tool.call/input.schema.json +35 -0
  56. package/contracts/operations/tool.call/output.schema.json +129 -0
  57. package/contracts/operations/tool.list/input.schema.json +7 -0
  58. package/contracts/operations/tool.list/output.schema.json +45 -0
  59. package/dist/bin/gd-cli.js +60 -0
  60. package/dist/bin/postinstall.js +42 -0
  61. package/dist/src/bootstrap/create-cli.js +112 -0
  62. package/dist/src/bootstrap/create-runtime.js +290 -0
  63. package/dist/src/bootstrap/validators.js +157 -0
  64. package/dist/src/cli/action-binding.js +109 -0
  65. package/dist/src/cli/agent-commands.js +49 -0
  66. package/dist/src/cli/auth-commands.js +55 -0
  67. package/dist/src/cli/dam-commands.js +469 -0
  68. package/dist/src/cli/editor-commands.js +73 -0
  69. package/dist/src/cli/errors.js +157 -0
  70. package/dist/src/cli/model-commands.js +61 -0
  71. package/dist/src/cli/org-commands.js +58 -0
  72. package/dist/src/cli/presenter.js +105 -0
  73. package/dist/src/cli/prompt.js +30 -0
  74. package/dist/src/cli/tool-commands.js +77 -0
  75. package/dist/src/cli/update-command.js +14 -0
  76. package/dist/src/contracts/schema.js +4 -0
  77. package/dist/src/features/agent/creative-agent-adapter.js +36 -0
  78. package/dist/src/features/agent/creative-protocol.js +432 -0
  79. package/dist/src/features/agent/creative-stream.js +127 -0
  80. package/dist/src/features/agent/use-cases.js +150 -0
  81. package/dist/src/features/auth/access-policy.js +101 -0
  82. package/dist/src/features/auth/credential-store.js +62 -0
  83. package/dist/src/features/auth/sso-service.js +194 -0
  84. package/dist/src/features/auth/state.js +129 -0
  85. package/dist/src/features/auth/use-cases.js +136 -0
  86. package/dist/src/features/dam/asset-projection.js +278 -0
  87. package/dist/src/features/dam/dam-api-adapter.js +562 -0
  88. package/dist/src/features/dam/file-downloader.js +242 -0
  89. package/dist/src/features/dam/object-storage.js +193 -0
  90. package/dist/src/features/dam/operation-executor.js +72 -0
  91. package/dist/src/features/dam/registered-uploader.js +247 -0
  92. package/dist/src/features/dam/repository-catalog.js +127 -0
  93. package/dist/src/features/dam/storage-upload.js +141 -0
  94. package/dist/src/features/dam/transient-uploader.js +17 -0
  95. package/dist/src/features/dam/use-cases.js +470 -0
  96. package/dist/src/features/editor/bridge-client.js +109 -0
  97. package/dist/src/features/editor/bridge-process.js +222 -0
  98. package/dist/src/features/editor/bridge-server.js +337 -0
  99. package/dist/src/features/editor/protocol.js +1 -0
  100. package/dist/src/features/editor/public-url.js +36 -0
  101. package/dist/src/features/editor/session-state.js +78 -0
  102. package/dist/src/features/editor/session.js +207 -0
  103. package/dist/src/features/editor/use-cases.js +88 -0
  104. package/dist/src/features/org/org-service.js +76 -0
  105. package/dist/src/features/org/use-cases.js +156 -0
  106. package/dist/src/features/skill/bundled-skills.js +55 -0
  107. package/dist/src/features/skill/installer.js +271 -0
  108. package/dist/src/features/tool/catalog.js +83 -0
  109. package/dist/src/features/tool/dynamic-schema.js +128 -0
  110. package/dist/src/features/tool/mns-catalog-adapter.js +265 -0
  111. package/dist/src/features/tool/tool-api-adapter.js +352 -0
  112. package/dist/src/features/tool/use-cases.js +177 -0
  113. package/dist/src/features/update/latest-version.js +37 -0
  114. package/dist/src/features/update/update-notification.js +262 -0
  115. package/dist/src/features/update/update-service.js +183 -0
  116. package/dist/src/platform/json-input.js +67 -0
  117. package/dist/src/platform/local-json-file.js +59 -0
  118. package/dist/src/platform/open-browser.js +8 -0
  119. package/dist/src/platform/redact.js +80 -0
  120. package/dist/src/platform/remote-error-evidence.js +80 -0
  121. package/dist/src/platform/remote-protocol.js +10 -0
  122. package/dist/src/platform/safe-upload-file.js +146 -0
  123. package/dist/src/platform/signature.js +20 -0
  124. package/dist/src/platform/signed-http-transport.js +143 -0
  125. package/dist/src/platform/url-safety.js +100 -0
  126. package/dist/src/telemetry/invocation.js +156 -0
  127. package/dist/src/telemetry/sls-sink.js +31 -0
  128. package/package.json +54 -8
  129. package/skills/gd-cli/SKILL.md +15 -0
  130. package/skills/gd-cli/references/auth-org.md +9 -0
  131. package/skills/gd-cli/references/creation.md +115 -0
  132. package/skills/gd-cli/references/dam.md +52 -0
  133. package/skills/gd-cli/references/editor.md +254 -0
  134. package/skills/gd-cli/references/errors.md +13 -0
  135. package/skills/gd-cli/references/update.md +13 -0
  136. package/index.js +0 -3
@@ -0,0 +1,8 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "title": "DamRepositoryListInput",
4
+ "description": "DAM 资源库目录参数。",
5
+ "type": "object",
6
+ "additionalProperties": false,
7
+ "properties": {}
8
+ }
@@ -0,0 +1,52 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "title": "DamRepositoryListResult",
4
+ "description": "当前组织可用的规范化 DAM 资源库目录。",
5
+ "type": "object",
6
+ "additionalProperties": false,
7
+ "required": ["repositories"],
8
+ "properties": {
9
+ "repositories": {
10
+ "type": "array",
11
+ "minItems": 1,
12
+ "items": { "$ref": "#/$defs/repository" },
13
+ "description": "可被 DAM 命令直接使用的资源库。"
14
+ }
15
+ },
16
+ "$defs": {
17
+ "nonblank": {
18
+ "type": "string",
19
+ "minLength": 1,
20
+ "pattern": ".*\\S.*"
21
+ },
22
+ "repository": {
23
+ "type": "object",
24
+ "additionalProperties": false,
25
+ "required": ["repository_id", "name", "type", "is_default"],
26
+ "properties": {
27
+ "repository_id": {
28
+ "$ref": "#/$defs/nonblank",
29
+ "description": "可直接传给 DAM 命令的资源库 ID。"
30
+ },
31
+ "name": {
32
+ "$ref": "#/$defs/nonblank",
33
+ "description": "资源库名称。"
34
+ },
35
+ "type": {
36
+ "type": "string",
37
+ "enum": ["personal", "team", "enterprise", "draft"],
38
+ "description": "规范化资源库类型。"
39
+ },
40
+ "permission_code": {
41
+ "type": "string",
42
+ "enum": ["OWNER", "MANAGE", "EDIT", "USE", "READ"],
43
+ "description": "服务端明确返回的资源库权限。"
44
+ },
45
+ "is_default": {
46
+ "type": "boolean",
47
+ "description": "未显式指定资源库时是否使用该项。"
48
+ }
49
+ }
50
+ }
51
+ }
52
+ }
@@ -0,0 +1,46 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "title": "DamSearchInput",
4
+ "description": "DAM 素材搜索参数。",
5
+ "type": "object",
6
+ "additionalProperties": false,
7
+ "required": ["query"],
8
+ "not": {
9
+ "properties": { "repositoryId": true, "allRepositories": true },
10
+ "required": ["repositoryId", "allRepositories"]
11
+ },
12
+ "properties": {
13
+ "query": { "$ref": "#/$defs/nonblank", "description": "搜索关键词。" },
14
+ "repositoryId": { "$ref": "#/$defs/nonblank", "description": "指定资源库 ID。" },
15
+ "allRepositories": { "type": "boolean", "description": "是否查询全部可访问资源库。" },
16
+ "folderId": { "$ref": "#/$defs/nonblank", "description": "指定文件夹 ID。" },
17
+ "includeChildFolder": { "type": "boolean", "description": "是否包含子文件夹。" },
18
+ "type": { "$ref": "#/$defs/assetType", "description": "素材类型。" },
19
+ "assetFormats": {
20
+ "type": "array",
21
+ "minItems": 1,
22
+ "items": { "$ref": "#/$defs/nonblank" },
23
+ "description": "文件格式筛选。"
24
+ },
25
+ "tagIds": {
26
+ "type": "array",
27
+ "minItems": 1,
28
+ "items": { "$ref": "#/$defs/nonblank" },
29
+ "description": "标签 ID 筛选。"
30
+ },
31
+ "pageSize": {
32
+ "type": "integer",
33
+ "minimum": 1,
34
+ "maximum": 100,
35
+ "description": "DAM 请求的分页大小。"
36
+ },
37
+ "cursor": { "$ref": "#/$defs/nonblank", "description": "分页游标。" }
38
+ },
39
+ "$defs": {
40
+ "nonblank": { "type": "string", "minLength": 1, "pattern": ".*\\S.*" },
41
+ "assetType": {
42
+ "type": "string",
43
+ "enum": ["image", "video", "audio", "font", "template", "file"]
44
+ }
45
+ }
46
+ }
@@ -0,0 +1,71 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "title": "DamSearchResult",
4
+ "description": "一批 DAM 素材搜索结果;服务端实际返回数量可能大于请求的 page_size。",
5
+ "type": "object",
6
+ "additionalProperties": false,
7
+ "required": ["repository_ids", "page_size", "total", "finish", "assets"],
8
+ "properties": {
9
+ "repository_ids": {
10
+ "type": "array",
11
+ "minItems": 1,
12
+ "items": { "$ref": "#/$defs/nonblank" },
13
+ "description": "本次查询的资源库 ID。"
14
+ },
15
+ "page_size": { "type": "integer", "minimum": 1, "maximum": 100, "description": "本次 DAM 请求的分页大小;实际 assets 数量可能大于该值。" },
16
+ "total": { "type": "integer", "minimum": 0, "description": "匹配素材总数。" },
17
+ "finish": { "type": "boolean", "description": "是否已到最后一页。" },
18
+ "next_cursor": { "$ref": "#/$defs/nonblank", "description": "下一页游标。" },
19
+ "assets": {
20
+ "type": "array",
21
+ "items": { "$ref": "#/$defs/assetSummary" },
22
+ "description": "服务端本批返回的全部素材概要,不按 page_size 在本地截断。"
23
+ }
24
+ },
25
+ "$defs": {
26
+ "nonblank": { "type": "string", "minLength": 1, "pattern": ".*\\S.*" },
27
+ "assetType": {
28
+ "type": "string",
29
+ "enum": ["image", "video", "audio", "font", "template", "file"]
30
+ },
31
+ "stringOrNumber": {
32
+ "oneOf": [
33
+ { "$ref": "#/$defs/nonblank" },
34
+ { "type": "number" }
35
+ ]
36
+ },
37
+ "assetSummary": {
38
+ "title": "DamAssetSummary",
39
+ "type": "object",
40
+ "additionalProperties": false,
41
+ "required": ["asset_id"],
42
+ "properties": {
43
+ "asset_id": { "$ref": "#/$defs/nonblank", "description": "素材 ID。" },
44
+ "title": { "$ref": "#/$defs/nonblank", "description": "素材标题。" },
45
+ "format": { "$ref": "#/$defs/nonblank", "description": "文件格式。" },
46
+ "type": { "$ref": "#/$defs/assetType", "description": "素材类型。" },
47
+ "size": { "type": "integer", "minimum": 0, "description": "文件字节数。" },
48
+ "url": { "type": "string", "format": "uri", "description": "素材访问 URL。" },
49
+ "cover_url": { "type": "string", "format": "uri", "description": "封面 URL。" },
50
+ "width": { "type": "integer", "minimum": 0, "description": "像素宽度。" },
51
+ "height": { "type": "integer", "minimum": 0, "description": "像素高度。" },
52
+ "repository_id": { "$ref": "#/$defs/nonblank", "description": "资源库 ID。" },
53
+ "folder_id": { "$ref": "#/$defs/nonblank", "description": "文件夹 ID。" },
54
+ "folder_name": { "$ref": "#/$defs/nonblank", "description": "文件夹名称。" },
55
+ "tags": {
56
+ "type": "array",
57
+ "items": { "$ref": "#/$defs/nonblank" },
58
+ "description": "标签名称。"
59
+ },
60
+ "tag_ids": {
61
+ "type": "array",
62
+ "items": { "$ref": "#/$defs/stringOrNumber" },
63
+ "description": "标签 ID。"
64
+ },
65
+ "analysis_status": { "$ref": "#/$defs/stringOrNumber", "description": "分析状态。" },
66
+ "created_at": { "type": "string", "format": "date-time", "description": "创建时间。" },
67
+ "updated_at": { "type": "string", "format": "date-time", "description": "更新时间。" }
68
+ }
69
+ }
70
+ }
71
+ }
@@ -0,0 +1,12 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "title": "DamTagListInput",
4
+ "description": "列出一个 DAM 资源库中的标签。",
5
+ "type": "object",
6
+ "additionalProperties": false,
7
+ "properties": {
8
+ "repositoryId": { "$ref": "#/$defs/nonblank", "description": "资源库 ID。" },
9
+ "query": { "$ref": "#/$defs/nonblank", "description": "标签名称关键词。" }
10
+ },
11
+ "$defs": { "nonblank": { "type": "string", "minLength": 1, "pattern": ".*\\S.*" } }
12
+ }
@@ -0,0 +1,26 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "title": "DamTagListResult",
4
+ "description": "DAM 标签列表结果。",
5
+ "type": "object",
6
+ "additionalProperties": false,
7
+ "required": ["repository_id", "tags"],
8
+ "properties": {
9
+ "repository_id": { "$ref": "#/$defs/nonblank" },
10
+ "tags": { "type": "array", "items": { "$ref": "#/$defs/tag" } }
11
+ },
12
+ "$defs": {
13
+ "nonblank": { "type": "string", "minLength": 1, "pattern": ".*\\S.*" },
14
+ "tag": {
15
+ "type": "object",
16
+ "additionalProperties": false,
17
+ "required": ["tag_id", "name", "asset_count"],
18
+ "properties": {
19
+ "tag_id": { "$ref": "#/$defs/nonblank" },
20
+ "name": { "$ref": "#/$defs/nonblank" },
21
+ "group_id": { "$ref": "#/$defs/nonblank" },
22
+ "asset_count": { "type": "integer", "minimum": 0 }
23
+ }
24
+ }
25
+ }
26
+ }
@@ -0,0 +1,31 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "title": "DamUploadInput",
4
+ "description": "DAM 素材上传参数。",
5
+ "type": "object",
6
+ "additionalProperties": false,
7
+ "required": ["file"],
8
+ "properties": {
9
+ "file": { "$ref": "#/$defs/nonblank", "description": "本地文件路径。" },
10
+ "repositoryId": { "$ref": "#/$defs/nonblank", "description": "目标资源库 ID。" },
11
+ "title": { "$ref": "#/$defs/nonblank", "description": "素材标题。" },
12
+ "folderId": { "$ref": "#/$defs/nonblank", "description": "目标文件夹 ID。" },
13
+ "tagIds": {
14
+ "type": "array",
15
+ "minItems": 1,
16
+ "items": { "$ref": "#/$defs/nonblank" },
17
+ "description": "素材标签 ID。"
18
+ },
19
+ "allowSensitivePath": {
20
+ "type": "boolean",
21
+ "description": "是否明确允许受保护路径。"
22
+ },
23
+ "waitAnalysis": {
24
+ "type": "boolean",
25
+ "description": "是否等待素材分析结束。"
26
+ }
27
+ },
28
+ "$defs": {
29
+ "nonblank": { "type": "string", "minLength": 1, "pattern": ".*\\S.*" }
30
+ }
31
+ }
@@ -0,0 +1,46 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "title": "DamUploadOutput",
4
+ "description": "已上传并入库的 DAM 素材。",
5
+ "type": "object",
6
+ "additionalProperties": false,
7
+ "required": ["asset_id"],
8
+ "properties": {
9
+ "asset_id": { "$ref": "#/$defs/nonblank", "description": "素材 ID。" },
10
+ "title": { "$ref": "#/$defs/nonblank", "description": "素材标题。" },
11
+ "description": { "$ref": "#/$defs/nonblank", "description": "素材描述。" },
12
+ "format": { "$ref": "#/$defs/nonblank", "description": "文件格式。" },
13
+ "type": { "$ref": "#/$defs/assetType", "description": "素材类型。" },
14
+ "size": { "type": "integer", "minimum": 0, "description": "文件字节数。" },
15
+ "url": { "type": "string", "format": "uri", "description": "素材访问 URL。" },
16
+ "cover_url": { "type": "string", "format": "uri", "description": "封面 URL。" },
17
+ "width": { "type": "integer", "minimum": 0, "description": "像素宽度。" },
18
+ "height": { "type": "integer", "minimum": 0, "description": "像素高度。" },
19
+ "duration": { "type": "number", "minimum": 0, "description": "媒体时长,单位为秒。" },
20
+ "repository_id": { "$ref": "#/$defs/nonblank", "description": "资源库 ID。" },
21
+ "repository_name": { "$ref": "#/$defs/nonblank", "description": "资源库名称。" },
22
+ "folder_id": { "$ref": "#/$defs/nonblank", "description": "文件夹 ID。" },
23
+ "folder_name": { "$ref": "#/$defs/nonblank", "description": "文件夹名称。" },
24
+ "tag_ids": {
25
+ "type": "array",
26
+ "items": { "$ref": "#/$defs/stringOrNumber" },
27
+ "description": "标签 ID。"
28
+ },
29
+ "analysis_status": { "$ref": "#/$defs/stringOrNumber", "description": "分析状态。" },
30
+ "created_at": { "type": "string", "format": "date-time", "description": "创建时间。" },
31
+ "updated_at": { "type": "string", "format": "date-time", "description": "更新时间。" }
32
+ },
33
+ "$defs": {
34
+ "nonblank": { "type": "string", "minLength": 1, "pattern": ".*\\S.*" },
35
+ "assetType": {
36
+ "type": "string",
37
+ "enum": ["image", "video", "audio", "font", "template", "file"]
38
+ },
39
+ "stringOrNumber": {
40
+ "oneOf": [
41
+ { "$ref": "#/$defs/nonblank" },
42
+ { "type": "number" }
43
+ ]
44
+ }
45
+ }
46
+ }
@@ -0,0 +1,134 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "title": "EditorApplyInput",
4
+ "description": "要依次应用到当前编辑器的操作。",
5
+ "type": "array",
6
+ "items": {
7
+ "oneOf": [
8
+ { "$ref": "#/$defs/EditorUpsertAction" },
9
+ { "$ref": "#/$defs/EditorDeleteAction" }
10
+ ]
11
+ },
12
+ "$defs": {
13
+ "EditorUpsertAction": {
14
+ "title": "EditorUpsertAction",
15
+ "type": "object",
16
+ "additionalProperties": false,
17
+ "required": ["_type", "element"],
18
+ "properties": {
19
+ "_type": {
20
+ "type": "string",
21
+ "enum": ["create", "update"],
22
+ "description": "创建或完整更新元素。"
23
+ },
24
+ "element": {
25
+ "description": "要创建或完整更新的元素。",
26
+ "oneOf": [
27
+ { "$ref": "#/$defs/EditorShape" },
28
+ { "$ref": "#/$defs/EditorConnector" }
29
+ ]
30
+ }
31
+ }
32
+ },
33
+ "EditorDeleteAction": {
34
+ "title": "EditorDeleteAction",
35
+ "type": "object",
36
+ "additionalProperties": false,
37
+ "required": ["_type", "id"],
38
+ "properties": {
39
+ "_type": {
40
+ "const": "delete",
41
+ "description": "删除元素。"
42
+ },
43
+ "id": {
44
+ "type": "string",
45
+ "minLength": 1,
46
+ "pattern": ".*\\S.*",
47
+ "description": "要删除的元素 ID。"
48
+ }
49
+ }
50
+ },
51
+ "EditorShape": {
52
+ "title": "EditorShape",
53
+ "type": "object",
54
+ "additionalProperties": false,
55
+ "required": ["_type", "id", "shapeType", "x", "y", "w", "h", "fill", "stroke"],
56
+ "properties": {
57
+ "_type": {
58
+ "const": "shape",
59
+ "description": "元素类型。"
60
+ },
61
+ "id": {
62
+ "type": "string",
63
+ "minLength": 1,
64
+ "pattern": ".*\\S.*",
65
+ "description": "元素 ID。"
66
+ },
67
+ "shapeType": {
68
+ "type": "string",
69
+ "enum": ["rectangle", "rounded-rectangle", "triangle-up", "ellipse", "diamond"],
70
+ "description": "图形类型。"
71
+ },
72
+ "x": { "type": "number", "description": "左上角横坐标。" },
73
+ "y": { "type": "number", "description": "左上角纵坐标。" },
74
+ "w": { "type": "number", "description": "宽度。" },
75
+ "h": { "type": "number", "description": "高度。" },
76
+ "text": { "type": "string", "description": "图形中的文本。" },
77
+ "fill": {
78
+ "type": "string",
79
+ "minLength": 1,
80
+ "pattern": ".*\\S.*",
81
+ "description": "填充颜色。"
82
+ },
83
+ "stroke": {
84
+ "description": "描边颜色;null 表示无描边。",
85
+ "anyOf": [
86
+ { "type": "string", "minLength": 1, "pattern": ".*\\S.*" },
87
+ { "type": "null" }
88
+ ]
89
+ }
90
+ }
91
+ },
92
+ "EditorConnector": {
93
+ "title": "EditorConnector",
94
+ "type": "object",
95
+ "additionalProperties": false,
96
+ "required": ["_type", "id", "fromId", "toId", "lineType", "color"],
97
+ "properties": {
98
+ "_type": {
99
+ "const": "connector",
100
+ "description": "元素类型。"
101
+ },
102
+ "id": {
103
+ "type": "string",
104
+ "minLength": 1,
105
+ "pattern": ".*\\S.*",
106
+ "description": "连线 ID。"
107
+ },
108
+ "fromId": {
109
+ "type": "string",
110
+ "minLength": 1,
111
+ "pattern": ".*\\S.*",
112
+ "description": "起点元素 ID。"
113
+ },
114
+ "toId": {
115
+ "type": "string",
116
+ "minLength": 1,
117
+ "pattern": ".*\\S.*",
118
+ "description": "终点元素 ID。"
119
+ },
120
+ "lineType": {
121
+ "type": "string",
122
+ "enum": ["straight", "elbowed"],
123
+ "description": "连线类型。"
124
+ },
125
+ "color": {
126
+ "type": "string",
127
+ "minLength": 1,
128
+ "pattern": ".*\\S.*",
129
+ "description": "连线颜色。"
130
+ }
131
+ }
132
+ }
133
+ }
134
+ }
@@ -0,0 +1,15 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "title": "EditorApplyResult",
4
+ "description": "编辑器操作应用结果。",
5
+ "type": "object",
6
+ "additionalProperties": false,
7
+ "required": ["appliedCount"],
8
+ "properties": {
9
+ "appliedCount": {
10
+ "type": "integer",
11
+ "minimum": 0,
12
+ "description": "已成功应用的操作数量。"
13
+ }
14
+ }
15
+ }
@@ -0,0 +1,15 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "title": "EditorConnectInput",
4
+ "description": "编辑器连接参数。",
5
+ "type": "object",
6
+ "additionalProperties": false,
7
+ "properties": {
8
+ "target": {
9
+ "type": "string",
10
+ "minLength": 1,
11
+ "pattern": ".*\\S.*",
12
+ "description": "作品 ID 或 AI+ Editor URL;省略时创建新作品。"
13
+ }
14
+ }
15
+ }
@@ -0,0 +1,17 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "title": "EditorConnectResult",
4
+ "description": "已连接的编辑器页面。",
5
+ "type": "object",
6
+ "additionalProperties": false,
7
+ "required": ["target"],
8
+ "properties": {
9
+ "target": {
10
+ "type": "string",
11
+ "format": "uri",
12
+ "minLength": 1,
13
+ "pattern": ".*\\S.*",
14
+ "description": "已连接的 AI+ Editor URL。"
15
+ }
16
+ }
17
+ }
@@ -0,0 +1,8 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "title": "EditorDisconnectInput",
4
+ "description": "断开当前编辑器连接。",
5
+ "type": "object",
6
+ "additionalProperties": false,
7
+ "properties": {}
8
+ }
@@ -0,0 +1,14 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "title": "EditorDisconnectResult",
4
+ "description": "编辑器断开结果。",
5
+ "type": "object",
6
+ "additionalProperties": false,
7
+ "required": ["disconnected"],
8
+ "properties": {
9
+ "disconnected": {
10
+ "type": "boolean",
11
+ "description": "是否断开了一个当前连接。"
12
+ }
13
+ }
14
+ }
@@ -0,0 +1,8 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "title": "EditorSaveInput",
4
+ "description": "保存当前编辑器作品。",
5
+ "type": "object",
6
+ "additionalProperties": false,
7
+ "properties": {}
8
+ }
@@ -0,0 +1,23 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "title": "EditorSaveResult",
4
+ "description": "已保存的编辑器作品。",
5
+ "type": "object",
6
+ "additionalProperties": false,
7
+ "required": ["workId", "url"],
8
+ "properties": {
9
+ "workId": {
10
+ "type": "string",
11
+ "minLength": 1,
12
+ "pattern": ".*\\S.*",
13
+ "description": "作品 ID。"
14
+ },
15
+ "url": {
16
+ "type": "string",
17
+ "format": "uri",
18
+ "minLength": 1,
19
+ "pattern": ".*\\S.*",
20
+ "description": "作品的 AI+ Editor URL。"
21
+ }
22
+ }
23
+ }
@@ -0,0 +1,8 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "title": "EditorScreenshotInput",
4
+ "description": "导出当前编辑器截图。",
5
+ "type": "object",
6
+ "additionalProperties": false,
7
+ "properties": {}
8
+ }
@@ -0,0 +1,16 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "title": "EditorScreenshotResult",
4
+ "description": "已导出的编辑器截图。",
5
+ "type": "object",
6
+ "additionalProperties": false,
7
+ "required": ["path"],
8
+ "properties": {
9
+ "path": {
10
+ "type": "string",
11
+ "minLength": 1,
12
+ "pattern": ".*\\S.*",
13
+ "description": "截图在本机的绝对路径。"
14
+ }
15
+ }
16
+ }
@@ -0,0 +1,8 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "title": "EditorSnapshotInput",
4
+ "description": "读取当前编辑器快照。",
5
+ "type": "object",
6
+ "additionalProperties": false,
7
+ "properties": {}
8
+ }