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.
Files changed (80) hide show
  1. package/README.md +472 -2
  2. package/bin/openany.js +3 -0
  3. package/package.json +27 -4
  4. package/skills/openany/SKILL.md +353 -0
  5. package/skills/openany/SKILL.zh-CN.md +496 -0
  6. package/skills/openany-provider/SKILL.md +26 -0
  7. package/skills/openany-provider/SKILL.zh-CN.md +26 -0
  8. package/skills/openany-provider/references/apis.md +60 -0
  9. package/skills/openany-provider/references/apis.zh-CN.md +55 -0
  10. package/skills/openany-provider/references/application.md +49 -0
  11. package/skills/openany-provider/references/application.zh-CN.md +51 -0
  12. package/skills/openany-provider/references/auth.md +3 -0
  13. package/skills/openany-provider/references/auth.zh-CN.md +3 -0
  14. package/skills/openany-provider/references/connections.md +36 -0
  15. package/skills/openany-provider/references/connections.zh-CN.md +36 -0
  16. package/skills/openany-provider/references/imports.md +57 -0
  17. package/skills/openany-provider/references/imports.zh-CN.md +57 -0
  18. package/skills/openany-provider/references/listing.md +29 -0
  19. package/skills/openany-provider/references/listing.zh-CN.md +11 -0
  20. package/skills/openany-provider/references/login.md +57 -0
  21. package/skills/openany-provider/references/login.zh-CN.md +57 -0
  22. package/skills/openany-provider/references/model-import.md +11 -0
  23. package/skills/openany-provider/references/model-import.zh-CN.md +11 -0
  24. package/skills/openany-provider/references/models.md +107 -0
  25. package/skills/openany-provider/references/models.zh-CN.md +68 -0
  26. package/skills/openany-provider/references/publishing.md +40 -0
  27. package/skills/openany-provider/references/publishing.zh-CN.md +40 -0
  28. package/skills/openany-provider/references/reviews.md +22 -0
  29. package/skills/openany-provider/references/reviews.zh-CN.md +20 -0
  30. package/skills/openany-provider/templates/api-metadata.json +27 -0
  31. package/skills/openany-provider/templates/bindings.json +1 -0
  32. package/skills/openany-provider/templates/models-v2.json +545 -0
  33. package/skills/openany-provider/templates/models.json +10 -0
  34. package/skills/openany-provider/templates/provider-agent-api-template.json +697 -0
  35. package/skills/openany-provider/templates/seller-agent-api-import-template.json +822 -0
  36. package/skills/openany-provider/templates/seller-registration.json +26 -0
  37. package/src/auth-recovery.js +179 -0
  38. package/src/auth.js +1001 -0
  39. package/src/catalog.js +306 -0
  40. package/src/cli.js +605 -0
  41. package/src/config.js +260 -0
  42. package/src/errors.js +53 -0
  43. package/src/http.js +238 -0
  44. package/src/model-curl.js +359 -0
  45. package/src/model-materials.js +58 -0
  46. package/src/model-request.js +402 -0
  47. package/src/model-validation.js +56 -0
  48. package/src/models.js +188 -0
  49. package/src/native/config-acl.ps1 +34 -0
  50. package/src/native/connection-macos.js +109 -0
  51. package/src/native/connection-windows.ps1 +98 -0
  52. package/src/native/setup-macos.js +72 -0
  53. package/src/native/setup-windows.ps1 +83 -0
  54. package/src/native-prompt.js +85 -0
  55. package/src/payment-signing.js +362 -0
  56. package/src/prompt.js +69 -0
  57. package/src/provider-api-import-v2.js +72 -0
  58. package/src/provider-apis.js +3 -0
  59. package/src/provider-client.js +153 -0
  60. package/src/provider-connections.js +152 -0
  61. package/src/provider-import-format.js +289 -0
  62. package/src/provider-imports.js +402 -0
  63. package/src/provider-json.js +49 -0
  64. package/src/provider-model-import-v2.js +61 -0
  65. package/src/provider-models.js +253 -0
  66. package/src/provider-profile.js +65 -0
  67. package/src/provider-reviews.js +61 -0
  68. package/src/provider-state.js +176 -0
  69. package/src/provider.js +75 -0
  70. package/src/setup.js +201 -0
  71. package/src/tasks.js +53 -0
  72. package/src/topups.js +845 -0
  73. package/src/vendor/provider-apply/market-taxonomy.mjs +22 -0
  74. package/src/vendor/provider-apply/provenance.json +8 -0
  75. package/src/vendor/provider-apply/registration.mjs +151 -0
  76. package/src/vendor/provider-import/api-categories.json +29 -0
  77. package/src/vendor/provider-import/api-fields.json +33 -0
  78. package/src/vendor/provider-import/model-fields.json +44 -0
  79. package/src/wallet.js +213 -0
  80. package/src/windows-permissions.js +22 -0
@@ -0,0 +1,60 @@
1
+ # Standard API creation and API-backed resource publication
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 api --application APPLICATION_ID -j
9
+ openany-dev seller apis create --application APPLICATION_ID --file api.json --operation TASK-api-create-1 -j
10
+ ```
11
+
12
+ Prepare `api.json` against the current schema with an owned `upstreamKeyId`, `name`, `description`, `method`, `pathTemplate`, `requestContentType`, and `config`. Use the actual billing terms, inputs, request mappings, and charge conditions; ask for missing information. Amounts such as `price_micro_usd` are strings in micro-USD, not USD floating point. Do not put authentication headers or secrets in the configuration. Record the returned `id` as `API_ID`.
13
+
14
+ ### Resource categories
15
+
16
+ Before creating or listing a new API, collect `categories` through the native form if the user has not supplied them. Use the website's current API category IDs and labels (the API import template's category `allowedValues`), with at most 16 unique IDs. Put the selection in top-level `categories`, not in `config` and not in supplier application `resource.primary_category`. Do not silently use `other`, an empty array, or a supplier category as a resource category. Preserve existing categories on edits; do not force a new selection for an unchanged resource. If current options are unavailable, report the missing options and ask for a console selection rather than inventing IDs. The API schema's generic string array alone is not a category catalog.
17
+
18
+ ## 2. Use the saved configuration
19
+
20
+ Use the creation or import receipt to confirm the draft ID. If the user requested only a draft, report its ID and stop. For verification, reuse the saved `id`, `revision`, `upstreamKeyId`, and `upstreamRevision` from the receipt. Fetch the API once if the receipt is missing fields needed for the current step.
21
+
22
+ ```bash
23
+ openany-dev seller apis get --application APPLICATION_ID --id API_ID -j
24
+ ```
25
+
26
+ ## 3. Verify
27
+
28
+ Reuse a verification receipt only if `state` is `"passed"`, `stale` is `false`, and its `apiId`, `apiRevision`, `upstreamKeyId`, and `upstreamRevision` match the saved API's `id`, `revision`, `upstreamKeyId`, and `upstreamRevision`. This check determines whether a receipt verifies the current configuration. For publication eligibility, also check the historical verification rules below. Reconcile any running or uncertain verification first. Start one verification only if it is needed and the test request and cost limits are authorized.
29
+
30
+ Prepare `verification.json` with `expectedRevision` from the saved API `revision`, `expectedUpstreamRevision` from its `upstreamRevision`, and `request` containing the authorized path/query/headers/body as applicable. The stored connection supplies credentials; never embed them in the request.
31
+
32
+ ```bash
33
+ openany-dev seller apis verify --application APPLICATION_ID --id API_ID --file verification.json --operation TASK-api-test-1 -j
34
+ ```
35
+
36
+ Use a complete synchronous passing receipt directly once it meets the checks above. If asynchronous verification returns `running`, record its `id` and query that verification after about 10–15 seconds. Use bounded backoff until the task deadline. If it is still running at the deadline, report it as pending with its ID and preserve the original verification. Follow [recovery](reviews.md) for failed, unknown, or expired results.
37
+
38
+ ```bash
39
+ openany-dev seller apis get --application APPLICATION_ID --id API_ID --verification-id VERIFICATION_ID -j
40
+ ```
41
+
42
+ ## 4. Publish
43
+
44
+ Publish only if the supplier is `live` and publication is authorized. Set `expectedRevision` and `expectedUpstreamRevision` to the current saved API and connection revisions. For first publication or asynchronous publication, the server requires a successful verification for this API. Reuse a matching passing receipt or the API's saved `passedVerificationId` if the server reports one. When reusing a historical pass, use current revisions in the publication request. A previously published synchronous API can be republished without a new verification when its current configuration satisfies server checks. Include `verificationId` when using a receipt. Individual resources do not need a separate review submission.
45
+
46
+ ```bash
47
+ openany-dev seller apis publish --application APPLICATION_ID --id API_ID --file publication.json --operation TASK-api-publish-1 -j
48
+ ```
49
+
50
+ Report publication and runtime synchronization separately. If publication succeeds, report the result and stop. If runtime synchronization is pending, continue waiting only if the user asked to wait until the API is available. Fetch the API by ID only if the publication result is uncertain. Follow [recovery](reviews.md) for missing verification or revision conflicts before retrying. For unpublication, use `unpublish` with `expectedRevision`.
51
+
52
+ ## Correct a resource
53
+
54
+ 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:
55
+
56
+ ```bash
57
+ openany-dev seller apis update --application APPLICATION_ID --id API_ID --file api-update.json --operation TASK-api-update-2 -j
58
+ ```
59
+
60
+ Read back and reverify changed configuration as required. Reconcile uncertain writes before any further mutation.
@@ -0,0 +1,55 @@
1
+ # 创建普通 API 与发布通过 API 交付的资源
2
+
3
+ 先完成入口检查和[连接流程](connections.zh-CN.md),再收集资料。已有导入草稿时,从第 2 步使用返回的 `resourceId` 继续。
4
+
5
+ ## 1. 准备并创建
6
+
7
+ ```bash
8
+ openany-dev seller schema --type api --application APPLICATION_ID -j
9
+ openany-dev seller apis create --application APPLICATION_ID --file api.json --operation TASK-api-create-1 -j
10
+ ```
11
+
12
+ 按当前 schema 准备 `api.json`,包括当前供应商拥有的 `upstreamKeyId`、`name`、`description`、`method`、`pathTemplate`、`requestContentType` 和 `config`。保留实际计费、请求参数、映射和扣费条件,只补缺项。`price_micro_usd` 等金额使用微美元字符串。连接负责注入凭据。记录返回的 `id` 为 `API_ID`。
13
+
14
+ ### 资源分类
15
+
16
+ 新 API 缺分类时,用表单展示 API 模板中的现行分类 ID 和名称,最多选 16 个不重复 ID。填到顶层 `categories`,与 `config` 及供应商申请分类分开。已有分类沿用。分类选项无法获取时,说明情况并请用户在控制台选择。API schema 的字符串数组不提供分类目录。
17
+
18
+ ## 2. 使用已保存的配置
19
+
20
+ 使用创建或导入回执确认草稿 ID。只建草稿时,报告 ID 后结束。验证需要 `id`、`revision`、`upstreamKeyId` 和 `upstreamRevision`,回执缺少当前步骤所需字段时才回读一次。
21
+
22
+ ```bash
23
+ openany-dev seller apis get --application APPLICATION_ID --id API_ID -j
24
+ ```
25
+
26
+ ## 3. 验证
27
+
28
+ 判断回执是否验证了当前配置时,核对 `state: "passed"`、`stale: false`,以及 API ID、修订、连接 ID 和连接修订是否一致。发布资格另按下文的历史验证规则判断。先核实运行中或结果不明的验证。确实需要新验证且测试请求和费用范围已获授权时,只运行一次。
29
+
30
+ 用当前 `revision`、`upstreamRevision` 填写 `verification.json` 的 `expectedRevision`、`expectedUpstreamRevision`,并提供获授权的 `request`。连接负责注入凭据。
31
+
32
+ ```bash
33
+ openany-dev seller apis verify --application APPLICATION_ID --id API_ID --file verification.json --operation TASK-api-test-1 -j
34
+ openany-dev seller apis get --application APPLICATION_ID --id API_ID --verification-id VERIFICATION_ID -j
35
+ ```
36
+
37
+ 同步返回完整通过回执时直接使用。异步返回 `running` 时记录 ID,约 10–15 秒后按该 ID 查询,有限退避至任务期限。到期仍在运行则报告待验证及 ID。失败、未知或过期按[恢复流程](reviews.zh-CN.md)处理。
38
+
39
+ ## 4. 发布
40
+
41
+ 供应商为 `live` 且已获发布授权后才发布。用当前保存的 API 和连接修订填写 `expectedRevision` 与 `expectedUpstreamRevision`。首次发布或发布异步 API 时,服务端要求该 API 有成功验证。可复用匹配的成功回执,或服务端返回的 `passedVerificationId`。引用历史回执时仍使用当前修订。已发布的同步 API 满足服务端检查时可以直接重新发布。引用回执时填入 `verificationId`。发布无需单独提交资源审核。
42
+
43
+ ```bash
44
+ openany-dev seller apis publish --application APPLICATION_ID --id API_ID --file publication.json --operation TASK-api-publish-1 -j
45
+ ```
46
+
47
+ 分别报告发布与运行时同步状态。用户要求等到可用时才继续等待同步。发布结果不明确时按 ID 回读。有修订冲突或缺验证时先按恢复流程处理。下架用 `unpublish`,并传入 `expectedRevision`。
48
+
49
+ ## 修改资源
50
+
51
+ 读取当前配置,使用当前版本和连接修订准备符合 schema 的数据。获授权后执行更新,按需回读和验证。写入结果不明确时先核实。
52
+
53
+ ```bash
54
+ openany-dev seller apis update --application APPLICATION_ID --id API_ID --file api-update.json --operation TASK-api-update-2 -j
55
+ ```
@@ -0,0 +1,49 @@
1
+ # Seller application
2
+
3
+ Complete login as described in the [main entry](../SKILL.md) before collecting application information.
4
+
5
+ ## Collect and validate application information
6
+
7
+ When the user asks to become a supplier or submit a supplier application, collect missing application information using the agent's **native interactive question/form tools**, such as the available `request_user_input_async`, `request_user_input` when available in the current mode, or `AskUserQuestion`. Do not substitute a plain-text questionnaire or ask users to write application JSON. Use the user's language, reuse supplied answers, and read the contact email from the intended signed-in account. Ask only for missing or invalid values and outstanding confirmations. Respect tool question limits by splitting the same field set into small groups; do not add fields. If the current mode has no native form tool, explain the limitation and fall back to local stdin under the rules above, collecting and validating the same fields. Do not claim a form was shown.
8
+
9
+ After sending an asynchronous form, wait for the user's answers. An accepted response from the tool, a preselected option, silence, or a timeout is not an answer. Group independent missing fields within tool limits to reduce back-and-forth; do not ask again for supplied fields or explicit consent.
10
+
11
+ The website supplier application form defines the allowed field set:
12
+
13
+ | Website field | Application field | Input rules |
14
+ | --- | --- | --- |
15
+ | Supplier name | `seller.name` | Required text, at most 100 characters. |
16
+ | Contact email | `seller.email` | Required. Reuse the signed-in account's email and display it as read-only information without asking again. If no session exists, resolve email login first. |
17
+ | Supplier route | `seller.slug` | Required, 1–63 lowercase letters or digits, with single hyphens between words (`[a-z0-9]+(-[a-z0-9]+)*`). Explain that it cannot be changed after submission. Let the user choose; do not invent it. |
18
+ | Public seller bio | `seller.bio` | Optional plain text, at most 280 characters after trimming. It is saved when approval creates the seller profile. |
19
+ | What types of resources do you sell? | `seller_types` | Required: Models (`model`), APIs (`api`), or both. |
20
+ | Describe the resources you want to sell | `resource.description` | Required text, at most 2,000 characters. Describe the resources, their purpose, and target customers in this single field. |
21
+ | Primary category | `resource.primary_category` | Required. Use the website's current category choices and IDs; do not invent categories. |
22
+ | Website or documentation URL | `connection.documentation_url` | Required public HTTPS URL, at most 2,048 characters. Must not contain credentials, IP addresses, or URL fragments. |
23
+ | These resources contain personal data | `resource.contains_personal_data` | Boolean declaration matching the website's optional checkbox (unchecked means false). Do not require true or request personal data records. |
24
+ | I am authorized to provide and sell these resources | `consents.authorized` | Requires the user's explicit confirmation. |
25
+ | I allow free, non-destructive checks; paid tests require separate authorization | `consents.automated_checks` | Requires the user's explicit confirmation, separately from sales authorization. Do not infer either consent from the application request. |
26
+
27
+ Do not add questions about company registration, phone, address, prices, currency, billing units, API keys, authentication configuration, endpoint definitions, test inputs, test budgets, or publication authorization. These are not application fields. Do not split the resource description into additional required fields. Neither required consent may be preselected as agreed; do not submit if the user declines or has not answered. Explicit consent already given in this task may be reused.
28
+
29
+ Always write `seller_types` explicitly: models only → `["model"]`; APIs only → `["api"]`; both → `["model", "api"]`. Do not omit the field (the backend defaults to APIs only for legacy applications), copy template defaults, or infer the sales types from `resource.type`, documentation format, or the fact that models are also called through HTTP APIs. Before submission, check that the array matches the user's original choice and show the types in the summary. Do not reconfirm an already explicit choice. If the receipt includes `providerTypes`, check that they match; report and investigate a mismatch rather than resubmitting.
30
+
31
+ After collecting form answers, validate required fields, formats, category choices, and required consents against the website application form. If validation fails, use the agent's native form to supplement or correct only the affected fields. Once all validation passes, construct `registration.json` internally using the website form mapping. For new applications, derive `resource.name` from the supplier name; set `resource.type` to `model` for Models only, otherwise `service`; set `resource.secondary_categories: []`, `connection.authentication: {"type":"none"}`, and `endpoints: []`. These are application request defaults, not extra user fields, and do not imply that future upstream access requires no authentication. Do not request or invent API credentials. If the current application contract rejects these fields/defaults, or category choices cannot be determined, report and resolve the inconsistency instead of expanding the form or guessing.
32
+
33
+ When the user has requested submission and both required consents have been provided, execute the creation command below. Report the returned application ID and review status, then stop. Submission does not mean approval or authorization to create, test, or publish resources.
34
+
35
+ ## Submit and verify results
36
+
37
+ Reuse the supplier list from this run to check for duplicate applications. If you do not have the list, run `openany-dev seller applications list -j`. Once information is complete, validation passes, and the user has requested submission, execute:
38
+
39
+ ```bash
40
+ openany-dev seller applications create --file registration.json --operation TASK-registration-1 -j
41
+ ```
42
+
43
+ The [seller registration example](../templates/seller-registration.json) shows the file structure; set consent flags only from the user’s answers.
44
+
45
+ The CLI file must contain `seller` with the user-entered `slug`, plus `seller_types`; do not use `provider` or `provider_types` in the file. The CLI converts these two fields to the backend's `provider` and `provider_types`, preserving the slug, then calls `POST /api/v1/provider/account/registrations`. Do not include secrets, activation/publication policies, or ownership fields.
46
+
47
+ Record the returned `id` (`reg_...`) and `reviewStatus`, report them, and stop. Application submission is not admission; check review results on the website. After administrator approval, use applications list to select the approved supplier UUID. Do not use a registration ID as `--application`, and do not approve it yourself.
48
+
49
+ Submission is not idempotent. If it times out or the result is uncertain, check the application list under the website account. The CLI blocks replay even with `--resume`; do not change the operation name to bypass this. Repeating the same command to read a completed operation receipt does not query the latest review status.
@@ -0,0 +1,51 @@
1
+
2
+ # 卖家申请
3
+
4
+ 按[主入口](../SKILL.zh-CN.md)完成登录,再收集申请信息。
5
+
6
+ ## 收集并校验申请信息
7
+
8
+
9
+ 当用户要求申请成为供应商或提交供应商申请时,使用 Agent 的**原生交互式提问/表单工具**(例如当前可用的 `request_user_input_async`、当前模式可用的 `request_user_input` 或 `AskUserQuestion`)收集缺失的申请信息。不要用纯文本问卷替代,也不要要求用户编写申请 JSON。使用用户的语言,复用已提供的答案,并从目标已登录账号读取联系邮箱。只询问缺失或无效的值,以及尚未完成的确认。遵守工具的提问数量限制,将同一组字段分成若干小组询问;不要增加字段。如果当前模式没有可用的原生表单工具,说明限制并按上述规则回退到本地 stdin,仍按相同字段收集和校验;不要声称已经展示表单。
10
+
11
+ 异步表单发出后必须等待用户答案;工具返回 accepted、预选项、沉默或超时都不代表回答。按工具限制合并独立的缺失字段,减少来回;已给出的字段和明确同意不重复询问。
12
+
13
+ 网站供应商申请表就是允许收集的字段清单:
14
+
15
+ | 网站字段 | 申请字段 | 输入规则 |
16
+ | --- | --- | --- |
17
+ | 供应商名称 | `seller.name` | 必填文本,最多 100 个字符。 |
18
+ | 联系邮箱 | `seller.email` | 必填;复用已登录账号的邮箱,以只读信息展示,不额外提问。如果缺少会话,先通过邮箱登录解决。 |
19
+ | 供应商路由 | `seller.slug` | 必填,1–63 位小写字母或数字,单词之间使用单个连接符(`[a-z0-9]+(-[a-z0-9]+)*`)。说明提交后不可修改;由用户选择,不要擅自编造。 |
20
+ | 商家一句话简介 | `seller.bio` | 选填纯文本,去除首尾空白后最多 280 字;审批创建卖家资料时保存。 |
21
+ | 销售哪些类型的资源? | `seller_types` | 必填:Models(`model`)、APIs(`api`),或两者。 |
22
+ | 介绍你要销售的资源 | `resource.description` | 必填文本,最多 2,000 个字符:在同一个字段中说明资源、用途和目标客户。 |
23
+ | 主营分类 | `resource.primary_category` | 必填;使用网站当前的分类选项及 ID,不要编造分类。 |
24
+ | 网站或文档链接 | `connection.documentation_url` | 必填的公共 HTTPS 地址,最多 2,048 个字符;不得包含凭据、IP 地址或 URL 片段。 |
25
+ | 这些资源包含个人数据 | `resource.contains_personal_data` | 布尔声明,对应网站的可选复选框(未勾选表示 false);不得要求必须为 true,也不要索取个人数据记录。 |
26
+ | 我有权提供并销售这些资源 | `consents.authorized` | 必须由用户明确确认。 |
27
+ | 我允许不收费、无破坏性的检查;付费测试需另行授权 | `consents.automated_checks` | 必须由用户明确确认,并与销售权利的确认分开;不得因用户提出申请就推断其已同意任一事项。 |
28
+
29
+ 不要增加公司注册信息、电话、地址、价格、币种、计费单位、API 密钥、认证配置、端点定义、测试输入、测试预算或发布授权等问题。这些不是申请字段。不要将资源介绍拆分为额外的必填字段。两个必选同意项都不得预选同意;如果用户拒绝或未回答,不得提交。本任务中用户先前已明确给出的同意可以复用。
30
+
31
+ 必须显式写入 `seller_types`:仅模型 → `["model"]`;仅 API → `["api"]`;两者 → `["model", "api"]`。不得遗漏该字段(后端兼容旧申请时会默认仅 API),不得照抄模板默认值,也不得从 `resource.type`、文档格式或“模型也通过 HTTP API 调用”反推销售类型。提交前核对数组与用户原始选择一致,在摘要中展示类型;已有明确选择不重复确认。回执包含 `providerTypes` 时核对是否一致,若不一致先报告并核实,不重复提交。
32
+
33
+ 收集表单答案后,先按网站申请表校验必填项、格式、分类选项及必要同意项;校验不通过时,仅通过 Agent 原生表单补充或修正对应字段。校验全部通过后,按照网站申请表的映射在内部构造 `registration.json`。对于新申请,由供应商名称生成 `resource.name`;仅选择 Models 时将 `resource.type` 设为 `model`,否则设为 `service`;设置 `resource.secondary_categories: []`、`connection.authentication: {"type":"none"}` 和 `endpoints: []`。这些是申请请求数据的默认值,不是额外的用户字段,也不表示未来访问上游服务无须认证。不要索取或编造 API 凭据。如果当前申请接口约定拒绝这些字段/默认值,或无法确定分类选项,应报告并解决不一致问题,不要扩展表单或猜测。
34
+
35
+ 在用户已要求提交,且两个必选同意项均已给出的情况下,执行下文的创建命令。报告返回的申请 ID 和审核状态,然后停止;提交不代表审核通过,也不代表已获授权创建、测试或发布资源。
36
+
37
+ ## 提交与核实结果
38
+
39
+ 复用本轮供应商列表检查重复申请,缺少时运行 `openany-dev seller applications list -j`。信息齐全、校验通过且用户已要求提交后执行:
40
+
41
+ ```bash
42
+ openany-dev seller applications create --file registration.json --operation TASK-registration-1 -j
43
+ ```
44
+
45
+ [卖家申请示例](../templates/seller-registration.json)展示了文件结构;同意项必须以用户实际确认结果填写。
46
+
47
+ CLI 文件必须包含 `seller`(其中的 `slug` 由用户填写)和 `seller_types`;文件中不要使用 `provider` 或 `provider_types`。CLI 会保留 slug,将这两个字段转换为后端的 `provider`、`provider_types`,然后请求 `POST /api/v1/provider/account/registrations`。不包含秘密、激活/发布策略或所有权字段。
48
+
49
+ 记录返回的 `id`(`reg_...`)和 `reviewStatus`,报告后停止。申请不等于准入;在网站检查审核结果。管理员批准后,再通过 applications list 选择获批供应商 UUID;不得把 registration ID 当作 `--application`,不得自行审批。
50
+
51
+ 提交不具备幂等性。超时或结果不确定时,检查网站账号下的申请列表;CLI 即使使用 `--resume` 也阻止重放,不得更换 operation 名称绕过。重复相同命令读取已完成操作回执,不代表查询了最新审核状态。
@@ -0,0 +1,3 @@
1
+ # Authentication and supplier selection
2
+
3
+ Follow [Login and sessions](login.md) for authentication and recovery, then return to the [main workflow](../SKILL.md) to confirm account access and supplier permissions. For a new supplier application, follow [Seller application](application.md).
@@ -0,0 +1,3 @@
1
+ # 身份验证与供应商选择
2
+
3
+ 按[登录与会话](login.zh-CN.md)完成认证或恢复,再按[主入口](../SKILL.zh-CN.md)确认账号权限和供应商。需要新建供应商申请时,按[申请流程](application.zh-CN.md)操作。
@@ -0,0 +1,36 @@
1
+ # Select an upstream key
2
+
3
+ Use the confirmed CLI, email session, and supplier. In Dev, replace `openany-dev` in the commands below with `openany-dev`. When a resource needs an upstream key and the user has not specified one, ask only “Would you like to select an existing upstream key or add a new one?” Wait for the choice before continuing. If the user already selected a connection or requested a new one, go directly to that branch.
4
+
5
+ ## Select an existing key
6
+
7
+ List the supplier's enabled connections as needed. Show the name, base URL, and authentication method and ask the user to choose one. Reuse any connection list you already have that contains no secrets. To see more results, pass the returned `nextCursor` to `--cursor`. If you confirm that there are no usable connections, ask whether to add one.
8
+
9
+ ```bash
10
+ openany-dev seller connections list --application APPLICATION_ID -j
11
+ ```
12
+
13
+ Confirm that the selection belongs to the current supplier and is enabled. Record its `id` and `revision`. Fetch the details by ID only if the existing receipt lacks required fields. If the connection's base URL or authentication method conflicts with known upstream information, ask the user to confirm. The resource configuration supplies the endpoint path. Do not use that path to match connections.
14
+
15
+ ## Add a new upstream key
16
+
17
+ If the user chooses to add a key and has not supplied connection fields, run the command below immediately and wait for the dialog result. The dialog collects the connection name, base URL, authentication method, required parameter name, and API key in one step. Use the confirmed supplier ID and the operation identifier to open the dialog. Skip the connection schema lookup and do not ask for connection fields beforehand.
18
+
19
+ ```bash
20
+ openany-dev seller connections create --application APPLICATION_ID --operation OPERATION --gui -j
21
+ ```
22
+
23
+ On success, use the `id` and `revision` from the receipt. Read the connection back only if the receipt lacks required fields. For imports, use the connection ID as `upstreamKeyId`. If the user cancels the dialog or it times out, preserve the current progress and wait for instructions.
24
+
25
+ If the native dialog is unavailable and no connection fields have been supplied, ask the user to run the command below in their local interactive terminal in the same environment. The terminal collects the connection fields in one step and hides key input. When finished, the user only needs to provide the connection ID.
26
+
27
+ ```bash
28
+ openany-dev seller connections create --application APPLICATION_ID --operation OPERATION
29
+ ```
30
+
31
+ If the user has already supplied any connection fields, keep the valid values, ask only for missing fields, and prepare `connection.json`. Set `label`, `baseUrl`, and `authType`. For `query` or `path` authentication, set `authParamName` as well. Keep credentials, query strings, and fragments out of the base URL. Use authorized `OPENANY_DEV_UPSTREAM_API_KEY` injection or have the user pass the key through local stdin with hidden input. Use `authType: "none"` only when the upstream is confirmed to require no authentication.
32
+
33
+ ```bash
34
+ openany-dev seller connections create --application APPLICATION_ID --operation OPERATION --file connection.json -j
35
+ openany-dev seller connections create --application APPLICATION_ID --operation OPERATION --file connection.json --stdin -j
36
+ ```
@@ -0,0 +1,36 @@
1
+ # 选择上游 Key
2
+
3
+ 沿用已确认的 CLI、邮箱会话和供应商。Dev 环境将下方命令中的 `openany-dev` 替换为 `openany-dev`。需要绑定上游 Key 且用户尚未指定时,先单独问「这次要从已有的上游 Key 中选择,还是新建上游 Key?」等用户选择后进入对应分支。用户已明确选定连接或要求新建时,直接进入对应分支。
4
+
5
+ ## 从已有 Key 中选择
6
+
7
+ 按需列出该供应商已启用的连接,展示名称、Base URL 和认证方式,让用户选一条。已有无秘密的连接列表时直接复用;需要查看更多时,将回执的 `nextCursor` 传给 `--cursor`。确认没有可用连接后,询问是否新建。
8
+
9
+ ```bash
10
+ openany-dev seller connections list --application APPLICATION_ID -j
11
+ ```
12
+
13
+ 核对所选连接归属当前供应商且已启用,记录 `id` 和 `revision`。已知 ID 且现有回执缺少必需字段时,按 ID 查详情。若连接的 Base URL 或认证方式与已知上游信息冲突,先请用户确认。接口路径由资源配置提供,不能用它判断连接是否匹配。
14
+
15
+ ## 新建上游 Key
16
+
17
+ 用户选择新建且尚未提供连接字段时,Agent 直接执行下方命令并等待弹框结果。弹框一次完成连接名称、Base URL、认证方式、必要的参数名和 API Key 的填写。弹框前只使用已确认的供应商 ID 和本次操作标识,跳过连接 schema 查询和连接字段提问。
18
+
19
+ ```bash
20
+ openany-dev seller connections create --application APPLICATION_ID --operation OPERATION --gui -j
21
+ ```
22
+
23
+ 创建成功后使用回执中的 `id` 和 `revision`。回执缺必要字段时才回读;导入绑定使用连接 ID 作为 `upstreamKeyId`。弹框取消或超时时,保留当前任务进度,等待用户指示。
24
+
25
+ 原生弹框不可用且尚未提供连接字段时,请用户在同一环境的本地交互终端运行下方命令。终端一次收集连接资料并隐藏 Key 输入;用户完成后只需提供连接 ID。
26
+
27
+ ```bash
28
+ openany-dev seller connections create --application APPLICATION_ID --operation OPERATION
29
+ ```
30
+
31
+ 用户已提供部分或全部连接字段时,复用有效值,只补缺项,由 Agent 准备 `connection.json`。配置包含 `label`、`baseUrl` 和 `authType`,`query` 或 `path` 认证还需 `authParamName`。Base URL 不含凭据、查询串或片段。通过已授权的 `OPENANY_DEV_UPSTREAM_API_KEY` 注入,或请用户在本地使用隐藏输入将 Key 通过 stdin 传给 CLI。只有已确认无需认证时才使用 `authType: "none"`。
32
+
33
+ ```bash
34
+ openany-dev seller connections create --application APPLICATION_ID --operation OPERATION --file connection.json -j
35
+ openany-dev seller connections create --application APPLICATION_ID --operation OPERATION --file connection.json --stdin -j
36
+ ```
@@ -0,0 +1,57 @@
1
+ # Batch imports
2
+
3
+ ## Shortest workflow
4
+
5
+ 1. Follow the [connection workflow](connections.md) first. Confirm an enabled upstream connection owned by the supplier. Reuse a confirmed connection or ask the user to select or add one. Confirm the connection before requesting or reading source materials. Use the [bindings template](../templates/bindings.json) when creating or changing bindings.
6
+ 2. Follow the [publishing workflow](publishing.md) to collect and read the resource URL, documentation, or file. Reuse a compliant file, and ask only about gaps or conflicts. Check the selected connection against the source base URL and authentication method. If they conflict, ask the user to confirm which connection to use.
7
+ 3. Run the appropriate `preview` once. Include `--bindings-file bindings.json` if bindings are already available. Record the batch `id` and check `summary`, `stage`, `missingFields`, and `errorCode` for anything to supply. Preview only validates. It creates no resources and makes no upstream calls.
8
+ 4. Run `run` to create drafts. For bindings completed after preview, use the returned item IDs and submit them with `run --bindings-file bindings.json`. Read each item's status, `operation`, and `resourceId` from the receipt. If the user requested only drafts, report the result and stop. For verification or publication, apply the [publishing workflow](publishing.md) to each item.
9
+
10
+ ```bash
11
+ openany-dev seller imports run --batch BATCH_ID --application ID -j
12
+ ```
13
+
14
+ Each batch can contain up to 100 items. JSON files can be up to 8 MiB. Use strings for monetary amounts. The importer rejects numbers that would round during parsing. Replace example prices and fill empty fields with actual business values. Enter credentials securely in the connection only. Keep them out of source, metadata, and binding files. Import creates drafts only. It gives no authorization to test, incur costs, or publish.
15
+
16
+ ## Choose a preview command by source
17
+
18
+ ### V2 standard API or Agent API file
19
+
20
+ If you already have a `provider-agent-api-v2` file, use its `apis` directly. To create a file from business materials, use the [standard API template](../templates/provider-agent-api-template.json) for a standard API or the [Agent API template](../templates/seller-agent-api-import-template.json) for Skill, Bot, Service, Data, or Goods. Preserve the selected [resource type](publishing.md) in `catalogType`. These resources require valid HTML body content in `includedContentHtml`, `usageInstructionsHtml`, and `effectContentHtml`, up to 32 KiB each. Standard APIs can omit them. For these imports, `apiDescription` must be at least 150 characters after trimming. The template's explanatory section is ignored during import. The API item ID is `METHOD /path` and the binding points to `upstreamKeyId`.
21
+
22
+ ```bash
23
+ openany-dev seller imports preview --type api --file api-v2.json --application ID -j
24
+ ```
25
+
26
+ ### OpenAPI 3.x JSON
27
+
28
+ Prepare [API metadata](../templates/api-metadata.json) only for this source. Fill in the actual execution settings, `requestContentType`, prices, mappings, and `charge_condition`. Set the condition to null to explicitly accept the default HTTP success condition. If `configuration.categories` is missing, ask for categories according to the [API reference](apis.md#resource-categories). Names and descriptions may come from OpenAPI. Take methods and paths from the source file and specify mappings explicitly. Batch conversion processes operations individually and does not truncate them at the 20-item limit for a single conversion.
29
+
30
+ ```bash
31
+ openany-dev seller imports preview --type api --file openapi.json --metadata-file metadata.json --application ID -j
32
+ ```
33
+
34
+ ### V2 model file
35
+
36
+ Use `models` from `seller-model-config-v2` or use the [model template](../templates/models-v2.json). Model payloads can be up to 2 MiB. Item IDs follow file order, such as `model-1` and `model-2`. Bind connections by the returned item ID and route index. `modelId` maps to `price.model`, and `publicModelId` defaults to that identifier. Each model requires `configuration.price.curlExample`.
37
+
38
+ For token pricing, set `priceUnitQuantity: "1000000"`. For pricing per request, image, second, or minute, put the unit price in `inputPrice` and set `outputPrice` to `"0"` and `priceUnitQuantity` to `"1"`. See [Non-token pricing](models.md#non-token-pricing).
39
+
40
+ If preview returns `items[].families`, preserve assignments marked `readOnly: true`. For other items, ask the user to choose an existing family, then pass `routes[].familyId` in the bindings to `run`. Use null to clear a pending selection. When adding only the family binding, preserve the existing connection. Once assigned, the public model family is locked across suppliers.
41
+
42
+ ```bash
43
+ openany-dev seller imports preview --type model --file models.json --application ID -j
44
+ ```
45
+
46
+ The [legacy model manifest](../templates/models.json) also remains supported with `schemaVersion: 1` and `items`. Keep an existing valid manifest in that format. Its explicit item IDs are used in bindings. CSV, Excel, and local or remote OpenAPI `$ref` resolution are not supported.
47
+
48
+ ## Recovery
49
+
50
+ - Query `status` only if the `run` result is uncertain or lacks key fields. For items with unknown outcomes, preserve their original inputs and operations. Recover the original items before changing metadata or bindings.
51
+ - Use `resume` only to continue a batch after `run`. For example, after supplying a connection for an item in `waiting_connection`, pass the corrected bindings to the resume command. Successful items are skipped. Use a new operation key for corrected items known to have failed. In a conflict, verify ownership before claiming an existing resource. Its name alone is insufficient.
52
+ - The batch is bound to the original account and supplier application. Report blocked items and their missing fields, and retain results for runnable items.
53
+
54
+ ```bash
55
+ openany-dev seller imports status --batch BATCH_ID --application ID -j
56
+ openany-dev seller imports resume --batch BATCH_ID --application ID -j
57
+ ```
@@ -0,0 +1,57 @@
1
+ # 批量导入
2
+
3
+ ## 最短流程
4
+
5
+ 1. 先按[中文连接流程](connections.zh-CN.md)确认归属当前供应商且已启用的上游连接。复用已确认的连接,或请用户选择已有连接或新建。连接确认后再读取或索取资料。创建或修改绑定时使用[绑定模板](../templates/bindings.json)。
6
+ 2. 按[上架流程](publishing.zh-CN.md)收集并读取资源网址、文档或文件。直接复用合规文件,仅补缺项或冲突。根据资料核对已选连接的 Base URL 和认证方式,如不匹配,先请用户确认适用的连接。
7
+ 3. 执行对应分支的 `preview` 一次。已有绑定就带上 `--bindings-file bindings.json`。记录批次 `id`,从 `summary`、`stage`、`missingFields` 和 `errorCode` 判断要补什么。预览只校验,不创建资源或调用上游。
8
+ 4. 执行 `run` 创建草稿。预览后才补齐的绑定按返回项目 ID 填写,直接随 `run --bindings-file bindings.json` 提交。读取回执中的逐项状态、`operation` 和 `resourceId`。只要求草稿时报告结果即结束;需要验证或发布时按[上架流程](publishing.zh-CN.md)逐项处理。
9
+
10
+ ```bash
11
+ openany-dev seller imports run --batch BATCH_ID --application ID -j
12
+ ```
13
+
14
+ 每批最多 100 项,JSON 最大 8 MiB。金额用字符串;解析时会发生舍入的数字将被拒绝。示例报价和空字段须按实际业务填写。凭据只在连接中安全录入,源文件、元数据和绑定中均不得放入凭据。导入只创建草稿,不构成测试、付费或发布授权。
15
+
16
+ ## 按来源选择预览命令
17
+
18
+ ### V2 API 或服务文件
19
+
20
+ 已有 `provider-agent-api-v2` 文件就直接用其中的 `apis`。从业务资料新建文件时,普通 API 用[普通 API 模板](../templates/provider-agent-api-template.json),Skill、Bot、Service、Data 和 Goods 用 [Agent API 模板](../templates/seller-agent-api-import-template.json),按[资源上架流程](publishing.zh-CN.md)保留所选的 `catalogType`。这些资源的 `includedContentHtml`、`usageInstructionsHtml`、`effectContentHtml` 均需有效 HTML 正文,每字段最多 32 KiB;普通 API 可省略。这些导入条目的 `apiDescription` 去掉首尾空白后至少 150 个字符。说明区不参与导入。API 项目 ID 为 `METHOD /path`,绑定指向 `upstreamKeyId`。
21
+
22
+ ```bash
23
+ openany-dev seller imports preview --type api --file api-v2.json --application ID -j
24
+ ```
25
+
26
+ ### OpenAPI 3.x JSON
27
+
28
+ 只为此来源准备 [API 元数据](../templates/api-metadata.json),填写实际执行配置、`requestContentType`、价格、映射和 `charge_condition`。设为 null 表示明确接受默认 HTTP 成功条件。缺 `configuration.categories` 时按 [API 参考](apis.zh-CN.md)补问分类。名称和描述可来自 OpenAPI;方法和路径以源文件为准,映射需明确填写。批量转换逐个处理操作,不受单次转换 20 项上限截断。
29
+
30
+ ```bash
31
+ openany-dev seller imports preview --type api --file openapi.json --metadata-file metadata.json --application ID -j
32
+ ```
33
+
34
+ ### V2 模型文件
35
+
36
+ 使用 `seller-model-config-v2` 的 `models` 或[模型模板](../templates/models-v2.json),模型载荷最大 2 MiB。项目 ID 按顺序为 `model-1`、`model-2` 等,按返回 ID 和路由索引绑定连接。`modelId` 映射到 `price.model`,`publicModelId` 缺省时沿用该标识。每个模型须有 `configuration.price.curlExample`。
37
+
38
+ Token 计价用 `priceUnitQuantity: "1000000"`。按请求、图片、秒或分钟计价时,单位价格写入 `inputPrice`,`outputPrice` 为 `"0"`,`priceUnitQuantity` 为 `"1"`。参见[非 token 计价](models.zh-CN.md)。
39
+
40
+ 预览若返回 `items[].families`,保留 `readOnly: true` 的归属。其他项先请用户从现有家族选择,将 `routes[].familyId` 随绑定传给 `run`;用 null 可清除待处理选择。只补家族的绑定保留原连接,指定后的公共模型家族跨供应商锁定。
41
+
42
+ ```bash
43
+ openany-dev seller imports preview --type model --file models.json --application ID -j
44
+ ```
45
+
46
+ 另支持使用 `schemaVersion: 1` 和 `items` 的[旧版模型清单](../templates/models.json)。已有合规清单可直接使用,绑定沿用清单中明确填写的项目 ID。不支持 CSV、Excel 和 OpenAPI 的本地或远程 `$ref` 解析。
47
+
48
+ ## 异常恢复
49
+
50
+ - `run` 结果不明确或缺关键字段时才查 `status`。结果未知的项目保留原输入和操作,先恢复原项目,再改元数据或绑定。
51
+ - 已执行过 `run` 的批次需要继续时才用 `resume`。例如补齐 `waiting_connection` 项目的连接后,可随恢复命令提交修正的绑定。成功项不会重跑;修正的已知失败项使用新的操作键。冲突时不要仅凭名称认领现有资源。
52
+ - 批次绑定原账号和供应商申请。报告受阻项目的状态与缺项,保留可执行项目的结果。
53
+
54
+ ```bash
55
+ openany-dev seller imports status --batch BATCH_ID --application ID -j
56
+ openany-dev seller imports resume --batch BATCH_ID --application ID -j
57
+ ```
@@ -0,0 +1,29 @@
1
+ # Listing on OpenAny
2
+
3
+ ## What can I list?
4
+
5
+ List a standard API, a model endpoint, or an API-backed resource in one of these types: Skill, Bot, Service, Data, and Goods. Specify the supported operations, request contract, prices, billing units and any usage conditions. Do not advertise capabilities that the endpoint does not support.
6
+
7
+ ## Can my agent handle onboarding?
8
+
9
+ Your agent can read the current schema, prepare drafts for standard APIs, models, and resources, run the checks you authorize and publish verified resources within your authorization. It needs your email account session, an admitted provider profile and a server that supports `seller-resource-reviews-v1` with the current supplier-admission policy.
10
+
11
+ Follow [the provider skill](../SKILL.md) for the supported workflow. Keep credentials out of conversations and use the approved secure connection flow. Authorize verification scope and cost limits before testing. Query uncertain operations instead of repeating them.
12
+
13
+ Supplier admission requires human review once. Individual models and APIs do not require separate resource review. The same applies to API-backed resources. Draft creation, verification, supplier admission, publication and runtime availability are separate states. An agent cannot approve supplier admission or promise runtime availability.
14
+
15
+ ## Do I need to use an agent?
16
+
17
+ No. Sign in to the [Provider Console](/provider-console) to configure resources, models, or standard APIs yourself. New providers can create a profile in the console before setting up resources. The legacy [profile entry](/providers/register) redirects to the protected console.
18
+
19
+ ## Who sets the price?
20
+
21
+ You choose the resource rates and billing units. Confirm the applicable commercial terms before submission; an agent must not invent pricing or conditions.
22
+
23
+ ## What does free to list mean?
24
+
25
+ There is no listing fee for resources, models, or standard APIs. This does not mean resource calls or verification tests are free.
26
+
27
+ ## Does 0% markup mean there are no other fees?
28
+
29
+ 0% markup means no added markup on your published resource rate. Any applicable payment, network or payout fees are separate; review the agreed terms before proceeding.
@@ -0,0 +1,11 @@
1
+ # 在 OpenAny 上架
2
+
3
+ 可以上架普通 API、模型端点,或通过 API 交付的 Skill(技能)、Bot(机器人)、Service(服务)、Data(数据)和 Goods(商品)。说明实际支持的操作、请求格式、价格、计费单位和使用条件。
4
+
5
+ Agent 可读取当前 schema、准备草稿、运行已获授权的验证并在授权范围内发布。需要邮箱会话、已准入的供应商,以及支持 `seller-resource-reviews-v1` 和现行供应商准入规则的服务端。
6
+
7
+ 按[卖家技能](../SKILL.zh-CN.md)操作,通过安全连接流程配置密钥。测试前确认范围和费用上限。写入结果不确定时先核实。供应商准入需要一次人工审核,各项资源无需单独审核。分别报告草稿、验证、准入、发布和运行时可用性。
8
+
9
+ 也可以登录[供应商控制台](/provider-console)手动配置。新卖家可以先创建供应商账号,旧[供应商申请入口](/providers/register)会跳转到需要登录的控制台。
10
+
11
+ 价格、计费单位和商务条件由卖家确认。上架免费,调用资源和验证测试可能产生费用。0% 加价指平台不在已发布价格上另外加价,适用的支付、网络或结算费用另行计算。
@@ -0,0 +1,57 @@
1
+ # Login and sessions
2
+
3
+ Follow the input rules in the [main entry](../SKILL.md). Use the same confirmed CLI and execution environment for authentication and subsequent Seller commands.
4
+
5
+ ## Install and configure the CLI
6
+
7
+ If the CLI is missing or does not support a command you need, check for Node.js >=22 and install the CLI for the target environment.
8
+
9
+ ```bash
10
+ node --version
11
+ npm install -g openany-cli-dev@latest --registry=https://registry.npmjs.org/
12
+ ```
13
+
14
+ To install and check the Dev CLI:
15
+
16
+ ```bash
17
+ npm install -g openany-cli-dev@latest
18
+ openany-dev --help
19
+ ```
20
+
21
+ Confirm that the Backend shown in help matches the target environment. In Dev, replace `openany-dev` with `openany-dev` in this guide and the other references. If a command or flag is unrecognized, check its help and report the limitation if it remains unsupported. Do not substitute preloading, request rewriting, or CSRF probing for a supported CLI entry point.
22
+
23
+ ## Check for an existing session
24
+
25
+ If the user is known to be signed out, skip `seller status` and go straight to email login. Reuse a valid session. Run `openany-dev seller status -j` once only if session status is unknown and you need to check it. Reuse existing Seller query results. If it returns `local.configured: false` or lists `email_session` as missing, start email login. A missing `application` does not require a new login. If only local configuration is available and `remote` is null, follow the main entry to confirm the remote access needed for this task.
26
+
27
+ ## Complete email login
28
+
29
+ If the email address is missing, ask only for that address and wait for the user's reply. Once the target CLI, email address, and login authorization are confirmed, the agent runs:
30
+
31
+ ```bash
32
+ openany-dev auth email send --email EMAIL_ADDRESS -j
33
+ ```
34
+
35
+ Use an authorized mailbox tool to read the code for this attempt. Otherwise, ask only “The verification code has been sent. Please enter the 6-digit code you received for this attempt.” Preserve leading zeros. Do not echo the code or resend it. Reuse the successful verification receipt before continuing with the Seller task.
36
+
37
+ ```bash
38
+ openany-dev auth email verify --code SIX_DIGITS -j
39
+ ```
40
+
41
+ ## Session expiration and recovery
42
+
43
+ If the email session returns 401, run:
44
+
45
+ ```bash
46
+ openany-dev auth email refresh -j
47
+ ```
48
+
49
+ If the refresh is denied, complete a new authorized email login. If the CLI returns a recovery file, use only the confirmed path it returned:
50
+
51
+ ```bash
52
+ openany-dev auth recover --file RETURNED_PATH -j
53
+ ```
54
+
55
+ If the refresh result is uncertain, recover the session or sign in again before continuing writes. Do not print the recovery file, overwrite credentials manually, or switch to an API key. Recheck the account and supplier after recovery. If the identity differs, ask the user before switching.
56
+
57
+ Production stores login state in `~/.config/openany-dev/credentials.json` or in the directory set by `OPENANY_DEV_CONFIG_DIR`. Dev uses `~/.config/openany-dev-dev/credentials.json` or the directory set by `OPENANY_DEV_CONFIG_DIR`. Directory permissions are 0700 and file permissions are 0600. Do not ask users to print or edit the file. After login, return to the main entry to confirm account and supplier permissions.
@@ -0,0 +1,57 @@
1
+ # 登录与会话
2
+
3
+ 遵守[主入口](../SKILL.zh-CN.md)的提问规则。认证和后续 Seller 命令使用同一已确认入口与执行环境。
4
+
5
+ ## 安装与配置
6
+
7
+ CLI 缺失或不支持本次命令时,检查 Node.js >=22 并安装目标环境的 CLI。
8
+
9
+ ```bash
10
+ node --version
11
+ npm install -g openany-cli-dev@latest --registry=https://registry.npmjs.org/
12
+ ```
13
+
14
+ Dev 环境安装并检查入口:
15
+
16
+ ```bash
17
+ npm install -g openany-cli-dev@latest
18
+ openany-dev --help
19
+ ```
20
+
21
+ 确认帮助中的 Backend 对应目标环境。Dev 环境执行本指南及其他参考中的命令时,将 `openany-dev` 替换成 `openany-dev`。命令或参数不识别时只查对应帮助,仍不支持则报告限制。禁止用 preload、请求改写或 CSRF 探测替代受支持的 CLI 入口。
22
+
23
+ ## 检查现有会话
24
+
25
+ 已知未登录时跳过 `seller status`,直接进入邮箱登录。已有有效会话则复用;只有会话未知且本次需要核对时才查一次 `openany-dev seller status -j`,复用已有 Seller 查询结果。返回 `local.configured: false` 或缺少 `email_session` 时进入邮箱登录。缺少 `application` 无须重新登录;只有本地配置且 `remote` 为 null 时,按主入口确认本次所需的远程访问权限。
26
+
27
+ ## 完成邮箱登录
28
+
29
+ 缺邮箱时只询问登录邮箱并等待用户回复。目标入口、邮箱和登录授权齐备后,由 Agent 执行发送命令:
30
+
31
+ ```bash
32
+ openany-dev auth email send --email EMAIL_ADDRESS -j
33
+ ```
34
+
35
+ 用获授权的邮箱工具读取本次验证码,否则单独提示「验证码已发送,请输入本次收到的 6 位验证码。」保留前导零,不回显或重复发送。验证成功后复用回执,再继续 Seller 任务。
36
+
37
+ ```bash
38
+ openany-dev auth email verify --code SIX_DIGITS -j
39
+ ```
40
+
41
+ ## 会话过期与恢复
42
+
43
+ 邮箱会话返回 401 时运行:
44
+
45
+ ```bash
46
+ openany-dev auth email refresh -j
47
+ ```
48
+
49
+ 若被拒绝,完成新的已授权邮箱登录。若 CLI 返回恢复文件,仅使用经确认的返回路径:
50
+
51
+ ```bash
52
+ openany-dev auth recover --file RETURNED_PATH -j
53
+ ```
54
+
55
+ 刷新结果不确定时,恢复或重新登录后才能继续写入。不要打印恢复文件、手动覆盖凭据或切换 API 密钥。恢复后重新检查账号及供应商;身份不一致时询问用户,不能静默切换。
56
+
57
+ 生产登录状态保存在 `~/.config/openany-dev/credentials.json`(或 `OPENANY_DEV_CONFIG_DIR` 指定的目录),Dev 保存在 `~/.config/openany-dev-dev/credentials.json`(或 `OPENANY_DEV_CONFIG_DIR` 指定的目录)。目录权限 0700、文件权限 0600;不得要求打印或编辑。登录完成后回到主入口确认账号及供应商权限。
@@ -0,0 +1,11 @@
1
+ # Batch model imports
2
+
3
+ Use the bundled [model template](../templates/models-v2.json) with `schemaVersion: "seller-model-config-v2"` and `models`. Fill in actual prices and the required configuration. Specify connections and model families in the [bindings file](../templates/bindings.json) using confirmed values. Model files can contain up to 100 items and be up to 2 MiB. Keep keys out of these files.
4
+
5
+ Follow [Batch imports](imports.md) to confirm connections and preview once. Use `summary`, each item's `stage`, `missingFields`, `errorCode`, and `items[].families` to fill in only missing fields. Submit existing bindings with preview. For bindings completed later, use the returned item IDs and pass them to `run`. Record each draft's `resourceId` from the run or resume result. Query `status` only if the result is uncertain or incomplete. Follow the [publishing workflow](publishing.md) to continue with verification and publication.
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
+ ```