openany-cli-dev 0.0.0-stage → 0.1.1
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 +472 -2
- package/bin/openany.js +3 -0
- package/package.json +27 -4
- package/skills/openany/SKILL.md +353 -0
- package/skills/openany/SKILL.zh-CN.md +496 -0
- package/skills/openany-provider/SKILL.md +26 -0
- package/skills/openany-provider/SKILL.zh-CN.md +26 -0
- package/skills/openany-provider/references/apis.md +60 -0
- package/skills/openany-provider/references/apis.zh-CN.md +55 -0
- package/skills/openany-provider/references/application.md +49 -0
- package/skills/openany-provider/references/application.zh-CN.md +51 -0
- package/skills/openany-provider/references/auth.md +3 -0
- package/skills/openany-provider/references/auth.zh-CN.md +3 -0
- package/skills/openany-provider/references/connections.md +36 -0
- package/skills/openany-provider/references/connections.zh-CN.md +36 -0
- package/skills/openany-provider/references/imports.md +57 -0
- package/skills/openany-provider/references/imports.zh-CN.md +57 -0
- package/skills/openany-provider/references/listing.md +29 -0
- package/skills/openany-provider/references/listing.zh-CN.md +11 -0
- package/skills/openany-provider/references/login.md +57 -0
- package/skills/openany-provider/references/login.zh-CN.md +57 -0
- package/skills/openany-provider/references/model-import.md +11 -0
- package/skills/openany-provider/references/model-import.zh-CN.md +11 -0
- package/skills/openany-provider/references/models.md +107 -0
- package/skills/openany-provider/references/models.zh-CN.md +68 -0
- package/skills/openany-provider/references/publishing.md +40 -0
- package/skills/openany-provider/references/publishing.zh-CN.md +40 -0
- package/skills/openany-provider/references/reviews.md +22 -0
- package/skills/openany-provider/references/reviews.zh-CN.md +20 -0
- package/skills/openany-provider/templates/api-metadata.json +27 -0
- package/skills/openany-provider/templates/bindings.json +1 -0
- package/skills/openany-provider/templates/models-v2.json +545 -0
- package/skills/openany-provider/templates/models.json +10 -0
- package/skills/openany-provider/templates/provider-agent-api-template.json +697 -0
- package/skills/openany-provider/templates/seller-agent-api-import-template.json +822 -0
- package/skills/openany-provider/templates/seller-registration.json +26 -0
- package/src/auth-recovery.js +179 -0
- package/src/auth.js +1001 -0
- package/src/catalog.js +306 -0
- package/src/cli.js +605 -0
- package/src/config.js +260 -0
- package/src/errors.js +53 -0
- package/src/http.js +238 -0
- package/src/model-curl.js +359 -0
- package/src/model-materials.js +58 -0
- package/src/model-request.js +402 -0
- package/src/model-validation.js +56 -0
- package/src/models.js +188 -0
- package/src/native/config-acl.ps1 +34 -0
- package/src/native/connection-macos.js +109 -0
- package/src/native/connection-windows.ps1 +98 -0
- package/src/native/setup-macos.js +72 -0
- package/src/native/setup-windows.ps1 +83 -0
- package/src/native-prompt.js +85 -0
- package/src/payment-signing.js +362 -0
- package/src/prompt.js +69 -0
- package/src/provider-api-import-v2.js +72 -0
- package/src/provider-apis.js +3 -0
- package/src/provider-client.js +153 -0
- package/src/provider-connections.js +152 -0
- package/src/provider-import-format.js +289 -0
- package/src/provider-imports.js +402 -0
- package/src/provider-json.js +49 -0
- package/src/provider-model-import-v2.js +61 -0
- package/src/provider-models.js +253 -0
- package/src/provider-profile.js +65 -0
- package/src/provider-reviews.js +61 -0
- package/src/provider-state.js +176 -0
- package/src/provider.js +75 -0
- package/src/setup.js +201 -0
- package/src/tasks.js +53 -0
- package/src/topups.js +845 -0
- package/src/vendor/provider-apply/market-taxonomy.mjs +22 -0
- package/src/vendor/provider-apply/provenance.json +8 -0
- package/src/vendor/provider-apply/registration.mjs +151 -0
- package/src/vendor/provider-import/api-categories.json +29 -0
- package/src/vendor/provider-import/api-fields.json +33 -0
- package/src/vendor/provider-import/model-fields.json +44 -0
- package/src/wallet.js +213 -0
- package/src/windows-permissions.js +22 -0
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# 模型批量导入
|
|
2
|
+
|
|
3
|
+
使用技能内的[模型模板](../templates/models-v2.json)(`schemaVersion: "seller-model-config-v2"`、`models`)。模板须填入实际报价和必需配置;连接和模型家族通过[绑定文件](../templates/bindings.json)指定,不得猜测。模型文件最多 100 项、最大 2 MiB,不得包含密钥。
|
|
4
|
+
|
|
5
|
+
按[批量导入](imports.zh-CN.md)核对连接、预览一次。结合 `summary`、各项 `stage`、`missingFields`、`errorCode` 和 `items[].families`,只补缺失字段。已有绑定随预览提交;后补的绑定按返回项目 ID 直接传给 `run`。从运行或恢复结果记录草稿 `resourceId`;仅结果不确定或缺字段时查 `status`。继续验证和发布时遵循[上架流程](publishing.zh-CN.md)。
|
|
6
|
+
|
|
7
|
+
```text
|
|
8
|
+
openany-dev seller imports preview --type model --file MODEL_FILE --application ID -j
|
|
9
|
+
openany-dev seller imports run --batch BATCH_ID --bindings-file bindings.json --application ID -j
|
|
10
|
+
openany-dev seller imports resume --batch BATCH_ID --bindings-file bindings.json --application ID -j
|
|
11
|
+
```
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
# New model workflow
|
|
2
|
+
|
|
3
|
+
Complete main-skill preflight and [connections](connections.md) first. For an imported draft, start at step 2 with its `resourceId`; do not create it again.
|
|
4
|
+
|
|
5
|
+
## 1. Prepare and create
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
openany-dev seller schema --type model --application APPLICATION_ID -j
|
|
9
|
+
openany-dev seller models create --application APPLICATION_ID --file model.json --operation TASK-model-create-1 -j
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
Prepare `model.json` against the current schema: `price` and `routes`, using the supplier's actual model identity, capabilities, quote, currency, upstream endpoints, mappings, and route choices. Prices are decimal strings with at most six fractional digits; token prices use the existing per-million-token unit. Bind routes to owned connection IDs and required connection revisions. Never copy response-only ownership, activation, or publication fields into a write payload. Record the returned `price.id` as `MODEL_ID`.
|
|
13
|
+
|
|
14
|
+
`price.model` is the supplier's upstream model ID (`key_market_model_prices.public_model`). `routes[0].publicModel` is the OpenAny route model ID (`key_market_model_routes.public_model`) used in client requests. These may differ: for example, `price.model: "vendor-chat-v2"` and `routes[0].publicModel: "my-chat"`. Saving derives the route's upstream model from `price.model`; do not add a third writable identity. Editing either ID does not rename the other. Manage one route per model.
|
|
15
|
+
|
|
16
|
+
### Non-token pricing
|
|
17
|
+
|
|
18
|
+
When `price.billingUnit` is `request`, `image`, `second`, or `minute`, put the quoted price per one billing unit in `price.actualPrompt` and set `price.actualCompletion` to the decimal string `"0"`. Do not put the unit price in the completion field or copy it into both fields. For example, USD 0.05 per image uses `currency: "USD"`, `billingType: "per_image"`, `billingUnit: "image"`, `actualPrompt: "0.050000"`, and `actualCompletion: "0"` inside `price`.
|
|
19
|
+
|
|
20
|
+
For website v2 imports, `inputPrice` maps to `price.actualPrompt` and `outputPrice` maps to `price.actualCompletion`. Non-token pricing requires `outputPrice: "0"` and `priceUnitQuantity: "1"`; token pricing uses `priceUnitQuantity: "1000000"`. Keep prices in the declared currency and unit without rescaling.
|
|
21
|
+
|
|
22
|
+
### Model fields and family selection
|
|
23
|
+
|
|
24
|
+
Collect the current website fields, including the display name (`price.modelName`) and model family. A new public model needs an existing family selected by the user; use `routes[].familyId`, not API `categories` or the supplier application's `primary_category`. An already assigned family is read-only: preserve it and do not send a new assignment. Do not guess a family UUID or infer one from the model name. The current CLI exposes family options through model import preview (`items[].families`); for a single new model, a one-item import preview can supply those options. Then fill the selected family in the same draft or bindings. If options cannot be obtained, report the missing capability and ask the user to select through the console.
|
|
25
|
+
|
|
26
|
+
Do not turn optional schema properties or template placeholders into extra required questions. In an update, retain existing routes and use `expectedVersion`; when `pricingEditable` is false, omit pricing fields instead of asking the user to re-enter them. A cURL example is required by the model import contract, not automatically by every model write. Keep the import and single-model schemas separate.
|
|
27
|
+
|
|
28
|
+
If the live CLI schema disagrees with the current website fields (for example, missing `modelName` or `familyId`, or disallowing an authorized published-model edit), report the exact field and contract mismatch. Do not silently drop user input, invent replacement fields, remove unrelated safety checks, or claim a skill change fixes the backend schema. Preserve the prepared data and resolve the interface mismatch before the affected write.
|
|
29
|
+
|
|
30
|
+
### Credential-free examples
|
|
31
|
+
|
|
32
|
+
`SECRET_IN_DOCUMENT` can come from the CLI's local scan before any backend request. It also rejects `Authorization: Bearer YOUR_API_KEY` in `price.curlExample`: a placeholder is still credential-like text. Use the returned `field` to locate the problem, omit authentication headers from the example, and configure authentication through the connection. Never replace the placeholder with a real key. There is no need to remove every standalone occurrence of the word Bearer.
|
|
33
|
+
|
|
34
|
+
## 2. Read the saved configuration
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
openany-dev seller models get --application APPLICATION_ID --id MODEL_ID -j
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
Save `version`, `price.id`, and each route's `id`, `upstreamKeyId`, and `upstreamRevision`. Use saved route IDs, not array indices or local import item IDs. Read `price.upstreamPath` to choose the authorized endpoint. If this is a draft-only task, report the draft ID and stop here.
|
|
41
|
+
|
|
42
|
+
## 3. Verify every route
|
|
43
|
+
|
|
44
|
+
First reuse a known passed, non-stale receipt only after checking all identity and version fields below against the current saved resource and connection. For a known running or unknown verification, query/reconcile it first. Run one authorized verification only when no current passed or unresolved verification remains. The get command below is conditional: use it only for an unfinished result or missing matching fields, not after a complete matching terminal result. Do not repeat tests or add fixed waits to obtain the same receipt.
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
For each route, create a separate non-secret verification file with these fields:
|
|
48
|
+
|
|
49
|
+
| Verification input | Source |
|
|
50
|
+
| --- | --- |
|
|
51
|
+
| `expectedVersion` | Saved model `version` |
|
|
52
|
+
| `routeId` | Saved `routes[].id` for this route |
|
|
53
|
+
| `expectedUpstreamRevision` | That route's current `upstreamRevision`; recheck the connection if needed |
|
|
54
|
+
| `endpointIndex` | Zero-based index of the selected endpoint in `price.upstreamPath` |
|
|
55
|
+
| `request` | Authorized test request (`path`, `query`, `headers`, `body` as applicable), without credentials |
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
openany-dev seller models verify --application APPLICATION_ID --id MODEL_ID --file route-verification.json --operation TASK-model-route1-test-1 -j
|
|
59
|
+
openany-dev seller models get --application APPLICATION_ID --id MODEL_ID --verification-id VERIFICATION_ID -j
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
`--file PATH` and `--input 'JSON'` are alternative input modes; choose exactly one. Verification does not require a file specifically. Both modes accept the same JSON object, for example:
|
|
63
|
+
|
|
64
|
+
```json
|
|
65
|
+
{
|
|
66
|
+
"expectedVersion": "SAVED_MODEL_VERSION",
|
|
67
|
+
"routeId": "SAVED_ROUTE_ID",
|
|
68
|
+
"expectedUpstreamRevision": 1,
|
|
69
|
+
"endpointIndex": 0,
|
|
70
|
+
"request": {
|
|
71
|
+
"path": {},
|
|
72
|
+
"query": {},
|
|
73
|
+
"headers": { "Content-Type": "application/json" },
|
|
74
|
+
"body": {
|
|
75
|
+
"messages": [{ "role": "user", "content": "Ping test" }],
|
|
76
|
+
"max_tokens": 5
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
Replace the version, route ID, revision, endpoint index and test body with the saved configuration and authorized test inputs. For models, `request.path` must be an empty object `{}` when supplied, never `"/v1/chat/completions"` or a nonempty parameter map. The actual URL path comes from `price.upstreamPath[endpointIndex]`. A string fails backend JSON decoding before URL construction or an upstream call; the CLI now rejects it locally. API path parameter objects are a separate contract. A generic 400 alone is not evidence that CLI permissions are insufficient or that verification requires the web UI.
|
|
83
|
+
|
|
84
|
+
Record the verification response `id` before querying it. Use a distinct operation/file for each route. A usable receipt has `state: "passed"`, is not stale, and matches this `modelId`, `modelVersion`, `routeId`, `upstreamKeyId`, and `upstreamRevision`. Testing may incur costs; obey the authorized scope and budget. Query an unfinished known receipt within the task deadline instead of repeating verify. For unknown outcomes, follow [recovery](reviews.md).
|
|
85
|
+
|
|
86
|
+
## 4. Publish
|
|
87
|
+
|
|
88
|
+
Supplier admission must be complete (`live`). Individual resources do not need human review. Prepare `publication.json` from the saved resource:
|
|
89
|
+
|
|
90
|
+
`expectedVersion` and `verificationIds` containing the current successful receipt for every saved route.
|
|
91
|
+
|
|
92
|
+
```bash
|
|
93
|
+
openany-dev seller models publish --application APPLICATION_ID --id MODEL_ID --file publication.json --operation TASK-model-publish-1 -j
|
|
94
|
+
openany-dev seller models get --application APPLICATION_ID --id MODEL_ID -j
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
Report activation separately from runtime synchronization. Missing or stale verification and revision conflicts require inspection, never guessed version replacement. For unpublication, use `unpublish` with `expectedVersion`.
|
|
98
|
+
|
|
99
|
+
## Correct a resource
|
|
100
|
+
|
|
101
|
+
Read the resource and prepare a schema-valid configuration using the current version and connection revisions. No review withdrawal is required. For an authorized edit:
|
|
102
|
+
|
|
103
|
+
```bash
|
|
104
|
+
openany-dev seller models update --application APPLICATION_ID --id MODEL_ID --file model-update.json --operation TASK-model-update-2 -j
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
Read back and reverify changed configuration as required. Reconcile uncertain writes before any further mutation.
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
# 模型工作流
|
|
2
|
+
|
|
3
|
+
先完成入口检查和[连接流程](connections.zh-CN.md),再收集资料。已有导入草稿时,从第 2 步使用返回的 `resourceId` 继续。
|
|
4
|
+
|
|
5
|
+
## 1. 准备并创建
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
openany-dev seller schema --type model --application APPLICATION_ID -j
|
|
9
|
+
openany-dev seller models create --application APPLICATION_ID --file model.json --operation TASK-model-create-1 -j
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
按当前 schema 准备 `model.json` 的 `price` 和 `routes`。使用实际模型标识、能力、报价、币种、上游端点和映射。价格用最多六位小数的字符串。按 token 计价时沿用每百万 token 单位。绑定归属当前供应商的连接及其修订,省略仅在响应中提供的归属、启用和发布字段。记录返回的 `price.id` 为 `MODEL_ID`。
|
|
13
|
+
|
|
14
|
+
`price.model` 是供应商的上游模型 ID,`routes[0].publicModel` 是客户端使用的 OpenAny 路由模型 ID。两者可以不同,例如 `vendor-chat-v2` 和 `my-chat`。保存时从 `price.model` 得到路由的上游模型,每个模型管理一条路由。
|
|
15
|
+
|
|
16
|
+
### 非 token 计价
|
|
17
|
+
|
|
18
|
+
当 `price.billingUnit` 为 `request`、`image`、`second` 或 `minute` 时,将单位价格填到 `price.actualPrompt`,`price.actualCompletion` 填字符串 `"0"`。例如 USD 0.05 每张图对应 `currency: "USD"`、`billingType: "per_image"`、`billingUnit: "image"`、`actualPrompt: "0.050000"` 和 `actualCompletion: "0"`。
|
|
19
|
+
|
|
20
|
+
V2 导入的 `inputPrice` 和 `outputPrice` 分别映射到这两个价格字段。非 token 计价的 `outputPrice` 为 `"0"`,`priceUnitQuantity` 为 `"1"`。按 token 计价时用 `"1000000"`。币种和单位按原声明填写。
|
|
21
|
+
|
|
22
|
+
### 模型字段和家族
|
|
23
|
+
|
|
24
|
+
收集显示名 `price.modelName` 等现行字段。新公共模型通过 `routes[].familyId` 选择已有模型家族。已分配的家族为只读。CLI 导入预览的 `items[].families` 可提供候选项,单模型也可用单条预览取得候选。找不到候选时说明限制,请用户在控制台选择。
|
|
25
|
+
|
|
26
|
+
更新时保留已有路由并传 `expectedVersion`。`pricingEditable: false` 时省略价格字段。导入要求 cURL 示例,直接创建按其 schema 判断。遇到 CLI 与网站字段不一致时,报告具体差异,保留原输入,先解决该差异再写入。
|
|
27
|
+
|
|
28
|
+
`SECRET_IN_DOCUMENT` 可能来自 CLI 本地检查。即使是 `Authorization: Bearer YOUR_API_KEY` 占位符也会触发检查。按返回的 `field` 定位,从示例中移除认证头,由连接提供认证。
|
|
29
|
+
|
|
30
|
+
## 2. 读取已保存的配置
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
openany-dev seller models get --application APPLICATION_ID --id MODEL_ID -j
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
记录 `version`、`price.id` 和各路由的 `id`、`upstreamKeyId`、`upstreamRevision`。验证使用保存的路由 ID。按 `price.upstreamPath` 选择获授权的端点。只建草稿时报告 ID 后结束。
|
|
37
|
+
|
|
38
|
+
## 3. 验证每条路由
|
|
39
|
+
|
|
40
|
+
先核对已有回执。仅复用 `state: "passed"`、未过期且 `modelId`、`modelVersion`、`routeId`、`upstreamKeyId` 和 `upstreamRevision` 均匹配的结果。遇到运行中或结果未知的测试,先查询或核实。只有需要新验证且已获测试和费用授权时才运行一次。
|
|
41
|
+
|
|
42
|
+
每条路由分别准备验证数据和操作名。字段为当前 `expectedVersion`、保存的 `routeId`、当前 `expectedUpstreamRevision`、从 0 开始的 `endpointIndex` 和获授权的 `request`。`request` 可包含 `path`、`query`、`headers`、`body`,凭据由连接提供。模型的 `request.path` 如有填写,只能是空对象 `{}`,实际路径来自 `price.upstreamPath[endpointIndex]`。可用 `--file PATH` 或 `--input 'JSON'` 传入同一结构,二选一。通用 400 错误需核对具体报错,再判断原因。
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
openany-dev seller models verify --application APPLICATION_ID --id MODEL_ID --file route-verification.json --operation TASK-model-route1-test-1 -j
|
|
46
|
+
openany-dev seller models get --application APPLICATION_ID --id MODEL_ID --verification-id VERIFICATION_ID -j
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
记录验证 ID。仅在结果未终结或缺匹配字段时回读。到期仍不明时按[恢复流程](reviews.zh-CN.md)处理。
|
|
50
|
+
|
|
51
|
+
## 4. 发布
|
|
52
|
+
|
|
53
|
+
供应商须已准入(`live`),发布须获授权。资源无需单独审核。`publication.json` 包含当前 `expectedVersion` 及各保存路由的成功验证 ID(`verificationIds`)。
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
openany-dev seller models publish --application APPLICATION_ID --id MODEL_ID --file publication.json --operation TASK-model-publish-1 -j
|
|
57
|
+
openany-dev seller models get --application APPLICATION_ID --id MODEL_ID -j
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
分别报告启用与运行时同步状态。缺验证、验证过期或修订冲突时先核实。下架用 `unpublish`,并传 `expectedVersion`。
|
|
61
|
+
|
|
62
|
+
## 修改资源
|
|
63
|
+
|
|
64
|
+
读取现有配置,用当前版本和连接修订准备合法数据。获授权后更新,按需回读和验证。写入结果不明确时先核实。
|
|
65
|
+
|
|
66
|
+
```bash
|
|
67
|
+
openany-dev seller models update --application APPLICATION_ID --id MODEL_ID --file model-update.json --operation TASK-model-update-2 -j
|
|
68
|
+
```
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
# Publish APIs, models, and other resources
|
|
2
|
+
|
|
3
|
+
Use the environment, account, and supplier confirmed in the [main entry](../SKILL.md) before collecting resource materials. If no supplier is available, follow [Seller application](application.md) once authorized. For historical reviews only, read [Review results](reviews.md).
|
|
4
|
+
|
|
5
|
+
## 1. Identify the type, connection, and source
|
|
6
|
+
|
|
7
|
+
Route an explicit “list an API” request to the [standard API workflow](apis.md) only, and an explicit “list a model” request to the [model workflow](models.md) only. Skip the resource type question for both.
|
|
8
|
+
|
|
9
|
+
For a request to list a resource, if the request and already confirmed information leave the type unclear, first ask “What type of resource do you want to list?” Offer **Skill, Bot, Service, Data, and Goods**. If the native form has an option limit, show the full list in the question and use follow-up choices or a text answer to capture the exact type. Reuse a type the user has already specified; API-based delivery alone does not make the listing an API. Ask about the stopping point (draft only or verify and publish) only if it is unclear.
|
|
10
|
+
|
|
11
|
+
For Skill, Bot, Service, Data, or Goods, use the [Agent API template](../templates/seller-agent-api-import-template.json) and [Imports](imports.md). Set `catalogType` to the selected type: `skill`, `bot`, `service`, `data`, or `digital`, respectively. The template's `service` value is an example.
|
|
12
|
+
|
|
13
|
+
When an upstream connection is needed and still undecided, use the native form to choose an existing connection or add one. Follow [Connections](connections.md), reusing confirmed connections and using the secure dialog when no connection fields have been collected. For a connection-only task, stop once you confirm the ID and revision.
|
|
14
|
+
|
|
15
|
+
Confirm the required upstream connection before requesting or reading source materials. When the source is missing, open a separate **Source materials** form with the options applicable to the chosen type: resource or API documentation link, sanitized cURL, file upload, or absolute local path. If the form allows only three options, group the two file options and ask how to provide the file next. In the form prompt, show the matching [Agent API](../templates/seller-agent-api-import-template.json), [standard API](../templates/provider-agent-api-template.json), or [model](../templates/models-v2.json) template location and say: “The template location is provided here. If you do not have a copy, download the template, fill it in, then upload the completed file or enter its absolute path.” Use an accessible absolute URL or verified local absolute path. If the location is inaccessible, attach the template and name it in the form. For Agent API listings, point to `fieldGuide` and the examples in `apis[0]`. Ask for the chosen input separately if the form cannot collect it.
|
|
16
|
+
|
|
17
|
+
Read the chosen source and ask only about omissions or conflicts. Collect the included content, usage instructions, effect examples, and how the resource is delivered. If its delivery is unsupported by the CLI, explain the limitation before preparing a draft. Preserve the supplied methods, paths, mappings, and billing terms. Validate imports against the template. Fetch the schema once for direct creation.
|
|
18
|
+
|
|
19
|
+
Use top-level `categories` for APIs and `configuration.categories` in the metadata for OpenAPI imports. Use at most 16 distinct IDs. Use `routes[].familyId` for new public models, with choices from `items[].families` in the import preview. Preserve existing assignments. If the family is missing, ask the user to pick from the current options. Allow independently complete items to proceed.
|
|
20
|
+
|
|
21
|
+
## 2. Create drafts
|
|
22
|
+
|
|
23
|
+
Follow [Models](models.md) or [APIs](apis.md) for direct creation. Follow [Imports](imports.md) for Agent API listings or an existing import file. Look up examples only when required by this guide. Look up existing resources only to check for duplicates or confirm an update target. Use a stable `--operation` for writes. If the result is uncertain, keep the original operation name and inputs and reconcile the result first.
|
|
24
|
+
|
|
25
|
+
For a draft-only task, stop once the creation or import receipt confirms the draft and its ID. When continuing to verification, reuse the version, connection revision, and model route ID from the receipt. If an import returns only a resource ID or its receipt lacks required fields, run the corresponding resource `get` once.
|
|
26
|
+
|
|
27
|
+
## 3. Verify and publish
|
|
28
|
+
|
|
29
|
+
Follow the [API and resource verification and publication workflow](apis.md) or the [model workflow](models.md). Publish only when the supplier is `live` and publication is authorized. Run a new verification only when required and when the test request and cost limits are authorized. Query or reconcile existing running or uncertain tests first. While waiting, proceed with other independent and authorized items.
|
|
30
|
+
|
|
31
|
+
## Errors and recovery
|
|
32
|
+
|
|
33
|
+
- If the session is missing or expired, or the identity changed, follow [Login](login.md), confirm the intended account and supplier, and explicitly resume. Do not switch identities or authentication methods silently.
|
|
34
|
+
- If the connection or commercial terms are missing, keep the draft or prepared inputs and report the specific missing fields. Do not switch authentication to `none` or fabricate credentials.
|
|
35
|
+
- Check the upstream path only when publication reports an explicit upstream path error. For other conflicts, unknown results, admission errors, or publication errors, follow [Review results](reviews.md). Record error codes and resource or operation IDs while keeping secrets out of the report.
|
|
36
|
+
- Respect supplier admission and administrator permissions. Keep payment arrangements outside the onboarding workflow. Use the current version for authorized resource edits.
|
|
37
|
+
|
|
38
|
+
## Final report
|
|
39
|
+
|
|
40
|
+
For each resource, report its type and ID (the local item ID if it has not been created), draft or verification status, supplier admission status, and publication or availability status. For blocked items, list the missing fields, shareable error codes, and exact next action. For partially completed batches, identify which items succeeded and which are unresolved. Say whether the requested stopping point was reached. Report draft, verified, published, and runtime synchronization statuses separately.
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
# API / 模型 / 资源上架与上游连接
|
|
2
|
+
|
|
3
|
+
沿用[主入口](../SKILL.zh-CN.md)确认的环境、账号和供应商,再收集资源资料。无可用供应商时,获授权后转入[供应商申请](application.zh-CN.md)。仅查历史审核时读[审核结果](reviews.zh-CN.md)。
|
|
4
|
+
|
|
5
|
+
## 1. 确定类型、连接和资料来源
|
|
6
|
+
|
|
7
|
+
用户明确要求「上架 API」时,只走[普通 API 流程](apis.zh-CN.md)。「上架模型」只走[模型流程](models.zh-CN.md)。这两种请求均跳过资源类型提问。
|
|
8
|
+
|
|
9
|
+
用户要求上架资源时,如果请求和已明确的信息仍未指定类型,先问「你想上架哪种资源?」列出 **Skill(技能)、Bot(机器人)、Service(服务)、Data(数据)、Goods(商品)**。原生表单有选项上限时,在题面列出完整类型,再用分步选择或文本答案收集具体类型。用户已明确类型就直接沿用;通过 API 交付不等于上架 API。仅在停止点不明确时补问是只建草稿,还是验证并发布。
|
|
10
|
+
|
|
11
|
+
Skill、Bot、Service、Data、Goods 使用 [Agent API 模板](../templates/seller-agent-api-import-template.json),走[导入流程](imports.zh-CN.md),并按用户选定类型将 `catalogType` 分别填写为 `skill`、`bot`、`service`、`data`、`digital`。模板中的 `service` 只是示例。
|
|
12
|
+
|
|
13
|
+
需要上游连接且用户未指定时,用原生表单选择复用已有连接或新建。按[连接流程](connections.zh-CN.md)复用已确认的连接,按录入进度选择安全弹框或补齐字段。仅建连接时,确认 ID 和修订即结束。
|
|
14
|
+
|
|
15
|
+
先确认本次需要的上游连接,再索取或读取资源资料。缺来源时,单独打开**资料来源**表单:按已选类型提供适用的资源或接口文档链接、脱敏 cURL、上传文件或本地绝对路径选项。表单最多支持三项时合并文件选项,下一步再问上传或路径。在表单题面显示对应的 [Agent API](../templates/seller-agent-api-import-template.json)、[普通 API](../templates/provider-agent-api-template.json)或[模型](../templates/models-v2.json)模板位置,并注明「这里已提供模板位置。如果你还没有模板,请先下载并填写,再上传填好的文件或输入本地绝对路径。」使用可访问的完整 URL 或已核实的本地绝对路径,位置不可访问时提供附件并在表单标出文件名。Agent API 资源请参考 `fieldGuide` 和 `apis[0]` 中的示例。表单无法接收所选资料时,再单独索取。
|
|
16
|
+
|
|
17
|
+
读取指定资料后只补问缺项或冲突,保留原方法、路径、映射和计费。收集交付内容、使用说明、效果示例和交付方式。如果 CLI 不支持该交付方式,建草稿前先说明限制。导入按模板校验,直接创建时取对应 schema 一次。
|
|
18
|
+
|
|
19
|
+
API 分类用顶层 `categories`,OpenAPI 导入写入元数据的 `configuration.categories`,最多 16 个不重复 ID。新公共模型用 `routes[].familyId`,选项来自导入预览的 `items[].families`;已有归属保持原样。缺失时请用户从当前选项选择,缺配置的项目不阻塞独立完整项。
|
|
20
|
+
|
|
21
|
+
## 2. 创建草稿
|
|
22
|
+
|
|
23
|
+
直接创建按[模型](models.zh-CN.md)或 [API](apis.zh-CN.md)流程;Agent API 资源或已有导入文件走[导入](imports.zh-CN.md)。示例仅按本页条件查询,已有资源只在查重或确认更新目标时查。写操作用稳定的 `--operation`;结果不确定时保留原操作名和输入,先核实。
|
|
24
|
+
|
|
25
|
+
创建或导入回执能确认草稿及 ID 时,草稿任务到此结束。继续验证时,复用回执里的版本、连接修订和模型路由 ID;导入仅返回资源 ID 或回执缺字段时,执行一次对应资源的 `get`。
|
|
26
|
+
|
|
27
|
+
## 3. 验证并发布
|
|
28
|
+
|
|
29
|
+
按[普通 API 与资源验证发布流程](apis.zh-CN.md)或[模型流程](models.zh-CN.md)操作。只有供应商为 `live` 且具备发布授权时才发布。仅在需要新验证且测试请求和费用范围已获授权时运行。已有运行中或结果不明确的测试,先按 ID 查询或核实,等待期间可处理其他独立且已获授权的项目。
|
|
30
|
+
|
|
31
|
+
## 错误与恢复
|
|
32
|
+
|
|
33
|
+
- 登录缺失/过期或身份发生变化:遵循[身份认证](login.zh-CN.md),确认目标账号和供应商,然后明确恢复执行。不得静默切换身份或认证方式。
|
|
34
|
+
- 缺少连接或商业条款:保留草稿/已准备的输入,并报告具体缺失字段。不得将认证替换为 `none` 或编造凭据。
|
|
35
|
+
- 发布明确报上游路径错误时才核对路径。其他冲突、未知结果、准入或发布错误按[审核结果](reviews.zh-CN.md)处理。记录错误码和资源/操作 ID,勿泄露秘密。
|
|
36
|
+
- 不得绕过供应商准入、冒充管理员,或将安排付款作为接入流程的一部分。已获授权的资源编辑应使用当前版本。
|
|
37
|
+
|
|
38
|
+
## 最终报告
|
|
39
|
+
|
|
40
|
+
对每个资源,分别报告其类型和 ID(尚未创建时报告本地项目 ID)、草稿/验证状态、供应商准入状态,以及发布状态/可用性。对于受阻项目,列出缺失字段、可公开的错误码和准确的下一步操作。对于部分完成的批次,分别报告成功项和未解决项。说明是否已达到用户要求的停止点;分别报告草稿、已验证、已发布和运行时同步状态。
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# Publication results and recovery
|
|
2
|
+
|
|
3
|
+
Resource reviews are retired. Historical `reviews list|get` records remain readable, but do not determine current publication. Do not submit, approve, or withdraw resource reviews. Read the model/API itself for current activation and runtime synchronization. Supplier admission remains required.
|
|
4
|
+
|
|
5
|
+
## Recover without duplicate side effects
|
|
6
|
+
|
|
7
|
+
Keep operation names unique across independent writes and stable across recovery. Preserve the original payload, account, application, resource ID, and any returned receipt IDs. Never treat matching names as proof of resource ownership.
|
|
8
|
+
|
|
9
|
+
An operation is bound to its request method, target path and JSON payload within the original account and supplier. Reusing its name with changed input or a different endpoint produces `IDEMPOTENCY_CONFLICT`. An identical request for an already completed operation returns the locally saved result without another write; it does not run a fresh verification. Do not change the operation name on every retry. New names are for independent writes or corrected input after the original outcome is known.
|
|
10
|
+
|
|
11
|
+
| Failure | Required recovery |
|
|
12
|
+
| --- | --- |
|
|
13
|
+
| Create timed out or `OPERATION_UNCERTAIN` for a create | Retry the original create command with the identical file, original `--operation`, and `--resume`; the CLI reuses its original idempotency key. Do not create with a new name/key |
|
|
14
|
+
| Verification has a known ID | Query that exact ID with the model/API `get --verification-id` command; do not repeat the upstream test |
|
|
15
|
+
| Verification timed out with no ID | Read the resource and any exposed verification information; do not assume the newest receipt is yours. If the CLI output cannot positively identify the original test, retain the unknown operation and request reconciliation. Model configuration reads do not guarantee exposure of verification receipts |
|
|
16
|
+
| Update or publication outcome unknown | Read current resource and reconcile against the original intent before another mutation. Do not replay an uncertain update, publication, or verification, even with `--resume` |
|
|
17
|
+
| Version conflict or stale verification | Read current resource and connections, understand the changed inputs, correct if authorized, and reverify within budget. Never merely replace version numbers |
|
|
18
|
+
| Known failed write with corrected input | Use a new descriptive operation after resolving the error; preserve the failed operation for traceability |
|
|
19
|
+
| `IDEMPOTENCY_CONFLICT` | Stop reusing that operation with changed input; reconcile the original outcome first |
|
|
20
|
+
| Login/session or supplier changed | Follow [authentication](auth.md) and confirm the intended identity before explicitly resuming |
|
|
21
|
+
|
|
22
|
+
A running/unknown/failed verification is never a pass. If a test cannot be reconciled, report the unresolved operation and stop that resource before publication; independent resources can continue. Preserve public error codes and IDs in the final report without copying secrets or upstream sensitive responses.
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# 发布结果与异常恢复
|
|
2
|
+
|
|
3
|
+
可以查询历史 `reviews list|get` 记录。当前启用和运行时同步状态以 API 或模型本身为准。供应商须先准入,资源审核的提交、审批和撤回流程已停用。
|
|
4
|
+
|
|
5
|
+
## 恢复结果不确定的操作
|
|
6
|
+
|
|
7
|
+
独立写入使用各自的操作名,恢复时保留原操作名、载荷、账号、供应商、资源 ID 和回执 ID。核对实际归属。操作与原账号、供应商、HTTP 方法、路径和 JSON 载荷绑定。变更后复用操作名会报 `IDEMPOTENCY_CONFLICT`。以原参数重跑已完成的操作只会返回已保存的结果。
|
|
8
|
+
|
|
9
|
+
| 情况 | 处理 |
|
|
10
|
+
| --- | --- |
|
|
11
|
+
| 创建超时或返回 `OPERATION_UNCERTAIN` | 用原文件、原 `--operation` 和 `--resume` 重跑原创建命令,沿用原幂等键 |
|
|
12
|
+
| 验证已有 ID | 用 API 或模型的 `get --verification-id` 查询该 ID |
|
|
13
|
+
| 验证超时且没有 ID | 查询资源与可读取的验证信息。无法确认原测试时,保留未知操作并报告待核实 |
|
|
14
|
+
| 更新或发布结果未知 | 读取当前资源,与原操作意图核对后再决定下一次写入 |
|
|
15
|
+
| 修订冲突或验证过期 | 读取资源与连接,核对变更,在已授权的范围和预算内修正及验证 |
|
|
16
|
+
| 已知写入失败并修正了输入 | 使用新的描述性操作名,并保留失败操作记录 |
|
|
17
|
+
| `IDEMPOTENCY_CONFLICT` | 先厘清原操作结果 |
|
|
18
|
+
| 会话或供应商发生变化 | 按[身份验证](auth.zh-CN.md)恢复,确认目标身份后再继续 |
|
|
19
|
+
|
|
20
|
+
验证仍运行、未知或失败时,报告具体状态。受阻资源在发布前暂停,独立项目可继续。只报告可公开的错误码与 ID。
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schemaVersion": 1,
|
|
3
|
+
"items": [
|
|
4
|
+
{
|
|
5
|
+
"itemId": "GET /v1/example",
|
|
6
|
+
"configuration": {
|
|
7
|
+
"requestContentType": "none",
|
|
8
|
+
"includedContentHtml": "",
|
|
9
|
+
"usageInstructionsHtml": "",
|
|
10
|
+
"config": {
|
|
11
|
+
"inputs": [],
|
|
12
|
+
"mappings": [],
|
|
13
|
+
"billing": {
|
|
14
|
+
"mode": "fixed",
|
|
15
|
+
"currency": "USD",
|
|
16
|
+
"unit": "call",
|
|
17
|
+
"price_micro_usd": "REPLACE_QUOTE_IN_MICRO_USD"
|
|
18
|
+
},
|
|
19
|
+
"charge_condition": null
|
|
20
|
+
},
|
|
21
|
+
"categories": [
|
|
22
|
+
"REPLACE_SELECTED_CATEGORY_ID"
|
|
23
|
+
]
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
]
|
|
27
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"schemaVersion":1,"items":[{"itemId":"GET /v1/example","upstreamKeyId":"REPLACE_CONNECTION_ID"},{"itemId":"supplier-model-1","routes":[{"index":0,"upstreamKeyId":"REPLACE_CONNECTION_ID"}]}]}
|