@byteplus/ark-cli-darwin-x64 0.0.0-stage → 1.0.46-prerelease.46bd0d6dcc58

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 (148) hide show
  1. package/LICENSE +201 -0
  2. package/bin/arkcli-darwin-amd64 +4 -0
  3. package/manifest.json +43 -0
  4. package/package.json +20 -4
  5. package/skills/arkcli-agent/SKILL.md +152 -0
  6. package/skills/arkcli-agent/references/agent.md +398 -0
  7. package/skills/arkcli-agent/references/byok.md +65 -0
  8. package/skills/arkcli-agent/references/context-management.md +42 -0
  9. package/skills/arkcli-agent/references/debug-export.md +26 -0
  10. package/skills/arkcli-agent/references/evals.md +178 -0
  11. package/skills/arkcli-agent/references/events-chat.md +148 -0
  12. package/skills/arkcli-agent/references/interfaces-gaps.md +52 -0
  13. package/skills/arkcli-agent/references/mcp-vault.md +111 -0
  14. package/skills/arkcli-agent/references/model-config.md +46 -0
  15. package/skills/arkcli-agent/references/self-hosted.md +47 -0
  16. package/skills/arkcli-agent/references/session-files.md +149 -0
  17. package/skills/arkcli-agent/references/session-upgrade.md +61 -0
  18. package/skills/arkcli-agent/references/skills.md +87 -0
  19. package/skills/arkcli-agent/references/todo-write.md +31 -0
  20. package/skills/arkcli-api-explorer/SKILL.md +188 -0
  21. package/skills/arkcli-api-explorer/references/arkcli-api.md +180 -0
  22. package/skills/arkcli-api-explorer/references/evals.md +176 -0
  23. package/skills/arkcli-auth/SKILL.md +184 -0
  24. package/skills/arkcli-auth/references/arkcli-auth-login.md +92 -0
  25. package/skills/arkcli-auth/references/arkcli-auth-status.md +109 -0
  26. package/skills/arkcli-auth/references/arkcli-auth-whoami.md +56 -0
  27. package/skills/arkcli-auth/references/auth-modes.md +78 -0
  28. package/skills/arkcli-auth/references/evals.md +82 -0
  29. package/skills/arkcli-auth/references/identity-resolution.md +33 -0
  30. package/skills/arkcli-auth/references/realname-gate.md +69 -0
  31. package/skills/arkcli-billing/SKILL.md +122 -0
  32. package/skills/arkcli-billing/references/arkcli-billing-list.md +259 -0
  33. package/skills/arkcli-billing/references/evals.md +107 -0
  34. package/skills/arkcli-chat/SKILL.md +114 -0
  35. package/skills/arkcli-chat/references/arkcli-chat.md +283 -0
  36. package/skills/arkcli-chat/references/caching-thinking.md +124 -0
  37. package/skills/arkcli-chat/references/chat-meta.md +77 -0
  38. package/skills/arkcli-chat/references/evals.md +34 -0
  39. package/skills/arkcli-chat/references/stream-events.md +124 -0
  40. package/skills/arkcli-chat/references/text-format.md +167 -0
  41. package/skills/arkcli-chat/references/tools.md +119 -0
  42. package/skills/arkcli-config/SKILL.md +197 -0
  43. package/skills/arkcli-config/references/arkcli-config-init.md +89 -0
  44. package/skills/arkcli-config/references/arkcli-config-profile.md +106 -0
  45. package/skills/arkcli-config/references/evals.md +154 -0
  46. package/skills/arkcli-connect/SKILL.md +196 -0
  47. package/skills/arkcli-connect/references/arkcli-connect.md +165 -0
  48. package/skills/arkcli-connect/references/evals.md +231 -0
  49. package/skills/arkcli-custommodel/SKILL.md +167 -0
  50. package/skills/arkcli-custommodel/references/arkcli-custommodel-available-quantizations.md +29 -0
  51. package/skills/arkcli-custommodel/references/arkcli-custommodel-delete.md +37 -0
  52. package/skills/arkcli-custommodel/references/arkcli-custommodel-get.md +45 -0
  53. package/skills/arkcli-custommodel/references/arkcli-custommodel-list.md +65 -0
  54. package/skills/arkcli-custommodel/references/arkcli-custommodel-quantize.md +59 -0
  55. package/skills/arkcli-custommodel/references/arkcli-custommodel-update.md +47 -0
  56. package/skills/arkcli-custommodel/references/arkcli-custommodel-upload.md +64 -0
  57. package/skills/arkcli-custommodel/references/evals.md +59 -0
  58. package/skills/arkcli-datasets/SKILL.md +39 -0
  59. package/skills/arkcli-datasets/references/commands.md +83 -0
  60. package/skills/arkcli-datasets/references/evals.md +31 -0
  61. package/skills/arkcli-deploy/SKILL.md +89 -0
  62. package/skills/arkcli-deploy/references/arkcli-deploy.md +141 -0
  63. package/skills/arkcli-deploy/references/evals.md +80 -0
  64. package/skills/arkcli-docs/SKILL.md +453 -0
  65. package/skills/arkcli-docs/references/commands.md +283 -0
  66. package/skills/arkcli-docs/references/evals.md +201 -0
  67. package/skills/arkcli-docs/references/failure-modes.md +85 -0
  68. package/skills/arkcli-doctor/CONTRIBUTING.md +54 -0
  69. package/skills/arkcli-doctor/SKILL.md +367 -0
  70. package/skills/arkcli-doctor/references/error-codes.md +162 -0
  71. package/skills/arkcli-doctor/references/evals.md +385 -0
  72. package/skills/arkcli-doctor/references/scope-account.md +94 -0
  73. package/skills/arkcli-doctor/references/scope-cli.md +88 -0
  74. package/skills/arkcli-doctor/references/scope-infer-endpoint.md +132 -0
  75. package/skills/arkcli-doctor/references/scope-metrics.md +157 -0
  76. package/skills/arkcli-doctor/references/scope-model.md +130 -0
  77. package/skills/arkcli-doctor/references/verify-origin.md +102 -0
  78. package/skills/arkcli-gen/SKILL.md +188 -0
  79. package/skills/arkcli-gen/references/arkcli-gen.md +230 -0
  80. package/skills/arkcli-gen/references/gen-meta.md +154 -0
  81. package/skills/arkcli-gen/references/image-stream.md +105 -0
  82. package/skills/arkcli-helper/SKILL.md +200 -0
  83. package/skills/arkcli-helper/references/arkcli-helper.md +298 -0
  84. package/skills/arkcli-helper/references/evals.md +334 -0
  85. package/skills/arkcli-iam/SKILL.md +46 -0
  86. package/skills/arkcli-iam/references/arkcli-iam-userid.md +54 -0
  87. package/skills/arkcli-iam/references/evals.md +24 -0
  88. package/skills/arkcli-infer-endpoint/SKILL.md +82 -0
  89. package/skills/arkcli-infer-endpoint/references/arkcli-infer-endpoint-capability-get.md +50 -0
  90. package/skills/arkcli-infer-endpoint/references/arkcli-infer-endpoint-create.md +121 -0
  91. package/skills/arkcli-infer-endpoint/references/arkcli-infer-endpoint-delete.md +71 -0
  92. package/skills/arkcli-infer-endpoint/references/arkcli-infer-endpoint-get.md +43 -0
  93. package/skills/arkcli-infer-endpoint/references/arkcli-infer-endpoint-list.md +82 -0
  94. package/skills/arkcli-infer-endpoint/references/arkcli-infer-endpoint-start.md +36 -0
  95. package/skills/arkcli-infer-endpoint/references/arkcli-infer-endpoint-stop.md +36 -0
  96. package/skills/arkcli-infer-endpoint/references/arkcli-infer-endpoint-update.md +78 -0
  97. package/skills/arkcli-infer-endpoint/references/evals.md +24 -0
  98. package/skills/arkcli-models/SKILL.md +305 -0
  99. package/skills/arkcli-models/references/arkcli-models-activate.md +103 -0
  100. package/skills/arkcli-models/references/arkcli-models-get.md +94 -0
  101. package/skills/arkcli-models/references/arkcli-models-list.md +71 -0
  102. package/skills/arkcli-models/references/arkcli-models-scenario-table.md +75 -0
  103. package/skills/arkcli-models/references/arkcli-models-search.md +170 -0
  104. package/skills/arkcli-models/references/evals.md +57 -0
  105. package/skills/arkcli-onboard/SKILL.md +169 -0
  106. package/skills/arkcli-onboard/references/evals.md +156 -0
  107. package/skills/arkcli-plans/SKILL.md +135 -0
  108. package/skills/arkcli-plans/references/arkcli-plans-buy.md +125 -0
  109. package/skills/arkcli-plans/references/arkcli-plans-get.md +84 -0
  110. package/skills/arkcli-plans/references/arkcli-plans-model-apply.md +58 -0
  111. package/skills/arkcli-plans/references/arkcli-plans-model-list.md +114 -0
  112. package/skills/arkcli-plans/references/arkcli-plans-renew.md +125 -0
  113. package/skills/arkcli-plans/references/arkcli-plans-team-rotate-apikey.md +61 -0
  114. package/skills/arkcli-plans/references/arkcli-plans-team-seat-assign.md +147 -0
  115. package/skills/arkcli-plans/references/arkcli-plans-team-seat-list.md +100 -0
  116. package/skills/arkcli-plans/references/evals.md +178 -0
  117. package/skills/arkcli-pricing/SKILL.md +120 -0
  118. package/skills/arkcli-pricing/references/arkcli-pricing-models.md +258 -0
  119. package/skills/arkcli-pricing/references/arkcli-pricing-plans.md +139 -0
  120. package/skills/arkcli-profile/SKILL.md +168 -0
  121. package/skills/arkcli-profile/references/arkcli-profile-create.md +92 -0
  122. package/skills/arkcli-profile/references/arkcli-profile-keys.md +135 -0
  123. package/skills/arkcli-profile/references/arkcli-profile-set-default.md +81 -0
  124. package/skills/arkcli-profile/references/evals.md +93 -0
  125. package/skills/arkcli-resources/SKILL.md +112 -0
  126. package/skills/arkcli-resources/references/arkcli-resources-list.md +105 -0
  127. package/skills/arkcli-shared/SKILL.md +209 -0
  128. package/skills/arkcli-shared/references/global-flags.md +77 -0
  129. package/skills/arkcli-shared/references/profile-defaults.md +35 -0
  130. package/skills/arkcli-shared/references/troubleshooting.md +49 -0
  131. package/skills/arkcli-shared/references/update.md +117 -0
  132. package/skills/arkcli-train-finetune/SKILL.md +109 -0
  133. package/skills/arkcli-train-finetune/references/create.md +274 -0
  134. package/skills/arkcli-train-finetune/references/download.md +50 -0
  135. package/skills/arkcli-train-finetune/references/evals.md +59 -0
  136. package/skills/arkcli-train-finetune/references/export-deploy.md +179 -0
  137. package/skills/arkcli-train-finetune/references/list.md +79 -0
  138. package/skills/arkcli-train-finetune/references/manage.md +140 -0
  139. package/skills/arkcli-understand/SKILL.md +105 -0
  140. package/skills/arkcli-understand/references/arkcli-understand.md +249 -0
  141. package/skills/arkcli-understand/references/evals.md +109 -0
  142. package/skills/arkcli-understand/references/sub-skills.md +137 -0
  143. package/skills/arkcli-usage/SKILL.md +123 -0
  144. package/skills/arkcli-usage/references/arkcli-usage-balance.md +196 -0
  145. package/skills/arkcli-usage/references/arkcli-usage-plan.md +153 -0
  146. package/skills/arkcli-usage/references/arkcli-usage-seats.md +199 -0
  147. package/skills/arkcli-usage/references/arkcli-usage-stats.md +160 -0
  148. package/README.md +0 -3
@@ -0,0 +1,367 @@
1
+ ---
2
+ name: arkcli-doctor
3
+ version: 1.0.0
4
+ description: "BytePlus arkcli doctor gateway for CLI, account, error, model, Endpoint and ModelArk/VMP diagnosis, plus ModelArk generation-origin verification for 1-20 media URLs. Origin verification uses doctor +verify-origin: disclose one aggregate batch price, wait for one confirmation covering the whole batch, then relay the complete terminal JSON without interpreting IsOfficial. It does not determine truthfulness, copyright, ownership, legal certification, content safety or media quality. BytePlus has no doctor report."
5
+ metadata:
6
+ requires:
7
+ bins: ["arkcli"]
8
+ cliHelp: "arkcli doctor --help"
9
+ ---
10
+
11
+ # arkcli doctor for BytePlus
12
+
13
+ Before using this Skill, read
14
+ [`../arkcli-shared/SKILL.md`](../arkcli-shared/SKILL.md) for product isolation,
15
+ structured output, confirmation handling, and safety rules. Doctor has several
16
+ diagnostic-first paths that intentionally do not use the shared business-command
17
+ authentication gate: local health, account, error and catalog checks execute
18
+ directly; model and Endpoint diagnosis also execute directly so their own
19
+ authentication, not-found, and VMP findings remain authoritative. Only a real
20
+ remote metrics query uses the shared authentication gate.
21
+
22
+ ## Product contract
23
+
24
+ - Use only the BytePlus build and BytePlus state under `~/.arkcli-bp/`.
25
+ - The BytePlus control-plane Region is fixed to `ap-southeast-1`. Never retry a
26
+ failed diagnosis with another product's or another Region's profile.
27
+ - BytePlus supports the `en_us` UI locale only.
28
+ - `arkcli doctor report` is not registered on BytePlus. Never invoke, preview,
29
+ suggest, or emulate it, and never expect `report_suggestion` in model or
30
+ Endpoint output.
31
+ - Every BytePlus doctor JSON object is a subset of the corresponding Volc
32
+ doctor object. Never expect, document, or invent a BytePlus-only output field.
33
+ - The default, account, error, model, Endpoint, and metrics paths are read-only.
34
+ The only optional mutation in this Skill is `--auto-bind`, which can reuse or
35
+ create a VMP workspace and bind ModelArk telemetry after explicit approval.
36
+ - `--auto-bind` cannot enable VMP, accept service terms, create the
37
+ service-linked role, repair IAM, activate a model, or pay a bill.
38
+ - `doctor +verify-origin` is an explicit workflow exception: it creates remote
39
+ asynchronous verification tasks and can be billable. One confirmation covers
40
+ every URL in the current batch.
41
+
42
+ ## When To Trigger
43
+
44
+ - BytePlus arkcli installation, version, DNS, TLS, clock, profile, or credential
45
+ health needs diagnosis.
46
+ - BytePlus real-name verification, balance, IAM, VMP, or TOS
47
+ readiness is unclear.
48
+ - A ModelArk or BytePlus OpenAPI error code needs a structured explanation.
49
+ - One inference Endpoint or foundation model is unavailable, unhealthy, slow,
50
+ returning errors, or under quota pressure.
51
+ - A named ModelArk metric, one metric value, time series, or explicit `ark_*`
52
+ PromQL query is needed from BytePlus VMP.
53
+ - The user supplies 1-20 image or video URLs and asks whether they contain
54
+ ModelArk, Seedance, or Seedream generation-origin features.
55
+
56
+ ## When NOT To Trigger
57
+
58
+ - Installation, login, logout, or credential changes without a diagnosis
59
+ request: route to `arkcli-auth`.
60
+ - Profile creation or switching: route to `arkcli-profile` or `arkcli-config`.
61
+ - Creating an Endpoint: route to `arkcli-deploy`.
62
+ - Starting, stopping, updating, or deleting an existing Endpoint: route to
63
+ `arkcli-infer-endpoint`.
64
+ - Pure usage reporting without a root-cause question: route to `arkcli-usage`.
65
+ - Foundation-model metadata, parameters, or pricing without a health question:
66
+ route to `arkcli-models` or `arkcli-pricing`.
67
+ - Raw OpenAPI exploration: use `arkcli-api-explorer` only after confirming that
68
+ no doctor product command covers the task.
69
+ - Any request for `doctor report`: explain that BytePlus does not expose this
70
+ command. Do not substitute another product's workflow or URL.
71
+ - Requests to judge whether media content is true, misleading, copyrighted,
72
+ legally owned, safe, compliant, high quality, or playable.
73
+
74
+ ## Command family
75
+
76
+ ```bash
77
+ arkcli doctor
78
+ arkcli doctor account
79
+ arkcli doctor error <code>
80
+ arkcli doctor infer-endpoint <endpoint-id> [--window 24h] [--auto-bind]
81
+ arkcli doctor model <model-name> [--window 24h] [--auto-bind]
82
+ arkcli doctor +verify-origin <media-url> [media-url...]
83
+
84
+ arkcli doctor metrics list
85
+ arkcli doctor metrics describe <query-id>
86
+ arkcli doctor metrics <query-id> [--param key=value] [--filter label=value] \
87
+ [--window 1h] [--step 30s] [--workspace-id <uuid>] \
88
+ [--format json|scalar|table] [--auto-bind]
89
+ arkcli doctor metrics raw --promql '<ark_* expression>' \
90
+ [--window 1h] [--step 30s] [--workspace-id <uuid>] \
91
+ [--format json|scalar|table] [--auto-bind]
92
+ ```
93
+
94
+ Use `--format json` for agent consumption. `metrics list` and
95
+ `metrics describe` always return JSON. The local `metrics --format` flag selects
96
+ the result shape for a named or raw query; it does not change catalog output.
97
+
98
+ `--window` uses Go duration syntax. Use `168h`, not `7d`. All executable
99
+ Doctor diagnostics are read-only and do not register `--dry-run`; execute the
100
+ requested diagnostic directly. `--auto-bind` remains a separately confirmed
101
+ mutation when only telemetry workspace binding is missing.
102
+
103
+ `doctor +verify-origin` is different: it supports a local `--dry-run` workflow
104
+ preview, and a new batch requires one aggregate price confirmation before real
105
+ execution.
106
+
107
+ ## Origin-verification workflow
108
+
109
+ For media generation-origin verification, first read
110
+ [`references/verify-origin.md`](references/verify-origin.md).
111
+
112
+ 1. Collect all URLs and reject more than 20.
113
+ 2. Run one CLI command for the entire batch without `--yes`.
114
+ 3. Show the aggregate USD price disclosure completely.
115
+ 4. Wait for explicit confirmation after disclosure.
116
+ 5. Rerun the same batch once with one `--yes`; that confirmation covers every
117
+ URL in the batch.
118
+ 6. Do not spawn one command per URL, write a shell loop, call raw Actions, or
119
+ implement polling in the Agent.
120
+ 7. The CLI owns Create/Get pacing and five-second polling.
121
+ 8. Make the complete terminal stdout JSON the entire final response. Add no
122
+ summary, translation, interpretation, Markdown fence, prefix, or suffix.
123
+
124
+ Do not interpret `IsOfficial=True`, `False`, or `Null`. This API exposes
125
+ generation-origin technical features, not legal certification or a content
126
+ truthfulness decision.
127
+
128
+ ## Core workflow: from user message to command
129
+
130
+ 1. Extract the requested action and every identifier before choosing a command:
131
+ `endpoint_id`, foundation `model_name`, `error_code`, `request_id`, metric
132
+ `query_id`, time window, and whether the user asked for a write.
133
+ 2. Apply the resource-first decision table below. Any Endpoint ID or foundation
134
+ model name routes to its Doctor scope before standalone metrics or error
135
+ lookup because the resource diagnosis preserves status, usage, error
136
+ distribution, and quota evidence.
137
+ 3. Load only the selected scope reference. Run `doctor model` and
138
+ `doctor infer-endpoint` directly without an authentication or existence
139
+ preflight; those commands preserve the resource context and diagnose their
140
+ own authentication, not-found, and VMP failures.
141
+ 4. Execute one product command with structured output. Do not add existence
142
+ preflights that duplicate doctor checks.
143
+ 5. Read stable fields by name, then return the highest-severity finding, its
144
+ evidence and time window, and one safe next step.
145
+ 6. If a write is required, stop at the confirmation boundary. Only
146
+ `--auto-bind` is in scope here.
147
+
148
+ ## Intent precedence
149
+
150
+ 1. Any Endpoint ID routes to `doctor infer-endpoint`, including when an error
151
+ code or metric request is also present.
152
+ 2. Any foundation-model name routes to `doctor model`, including when an error
153
+ code or metric request is also present.
154
+ 3. Without a resource identifier, `metrics list` or `metrics describe` intent
155
+ is local and exact. Run it once without authentication, profile
156
+ initialization, or VMP access, then stop.
157
+ 4. Without a resource identifier, a named metric value or time series, a known
158
+ query ID, or an explicit `ark_*` PromQL expression routes to
159
+ `doctor metrics`.
160
+ 5. An error code or error JSON with no resource identifier routes to
161
+ `doctor error`, including authentication- or signature-looking codes.
162
+ 6. Real-name verification, balance, IAM, VMP, or TOS readiness routes to
163
+ `doctor account`.
164
+ 7. Installation, DNS, TCP/TLS, clock, configuration, or credential-health
165
+ intent routes to the default `doctor` scope.
166
+ 8. A `request_id` alone is not reversible through doctor. Preserve it for
167
+ support and ask for the error code, Endpoint ID, or model name.
168
+
169
+ ## Path decision table
170
+
171
+ Use this table after extracting every identifier. A resource row always wins
172
+ over standalone metrics or error intent.
173
+
174
+ | Available context | Error code present | No error code |
175
+ |---|---|---|
176
+ | Endpoint ID | Path 1: run `doctor infer-endpoint <id>`, then interpret the matching family in `error-codes.md` | Path 3: run `doctor infer-endpoint <id>` for state, usage, errors, and quota |
177
+ | Foundation-model name | Path 1: run `doctor model <name>`, then interpret the matching family in `error-codes.md` | Path 3: run `doctor model <name>` for existence, Endpoint distribution, usage, errors, and account quota |
178
+ | No resource ID | Path 2: run `doctor error <code>` and load `error-codes.md` | Route by explicit CLI, account, or metrics intent; otherwise ask for the resource or failure details |
179
+ | Request ID only | Preserve the RequestId, ask for the resource and exact code, and do not claim a reverse lookup | Preserve the RequestId and ask for the resource or error response |
180
+
181
+ Path 1 must not be downgraded to Path 2. For example:
182
+
183
+ - `ep-example returns RequestBurstTooFast` means run
184
+ `arkcli doctor infer-endpoint ep-example --format json`, not only
185
+ `arkcli doctor error RequestBurstTooFast`.
186
+ - `model seed-1-6 returns ModelNotOpen` means run
187
+ `arkcli doctor model seed-1-6 --format json`, not only
188
+ `arkcli doctor error ModelNotOpen`.
189
+ - If the user supplies only `MissingSignature`, run
190
+ `arkcli doctor error MissingSignature --format json`.
191
+
192
+ Do not use `ModelAccessDenied` as a BytePlus example; it is not a registered
193
+ BytePlus doctor code. Use the exact returned code, such as `ModelNotOpen`,
194
+ `AccessDenied`, or `OperationDenied.PermissionDenied`.
195
+
196
+ ## Scope router
197
+
198
+ Read only the reference selected by this table before execution.
199
+
200
+ | User goal | Command | Required reference |
201
+ |---|---|---|
202
+ | Installation, DNS, TLS, clock, profile, or credentials | `arkcli doctor` | [`references/scope-cli.md`](references/scope-cli.md) |
203
+ | Real-name verification, balance, IAM, VMP, or TOS | `arkcli doctor account` | [`references/scope-account.md`](references/scope-account.md) |
204
+ | Error meaning without a resource identifier | `arkcli doctor error <code>` | [`references/error-codes.md`](references/error-codes.md) |
205
+ | One inference Endpoint | `arkcli doctor infer-endpoint <endpoint-id>` | [`references/scope-infer-endpoint.md`](references/scope-infer-endpoint.md) |
206
+ | One foundation model across visible Endpoints | `arkcli doctor model <model-name>` | [`references/scope-model.md`](references/scope-model.md) |
207
+ | Catalog discovery, one metric, or PromQL | `arkcli doctor metrics ...` | [`references/scope-metrics.md`](references/scope-metrics.md) |
208
+
209
+ ## Authentication and preflight rules
210
+
211
+ - Run the default `doctor` scope, `doctor account`, `doctor error`,
212
+ `doctor metrics list`, and `doctor metrics describe` directly. These paths are
213
+ intentionally useful while signed out or are fully local.
214
+ - Treat `doctor error` as a complete local lookup. Return its structured result
215
+ or explicit unknown-code failure and stop; do not replace it with auth or
216
+ profile recovery unless the user separately asks to repair credentials.
217
+ - Run `doctor model` and `doctor infer-endpoint` directly. Do not run
218
+ `arkcli auth status`, start login, or inspect a profile first. If the Doctor
219
+ result reports an authentication problem, handle that returned result with
220
+ `arkcli-auth` without replacing the original resource diagnosis.
221
+ - `metrics list` and `metrics describe` are fully local and need no
222
+ authentication or VMP preflight. Named and raw metrics queries are remote, so
223
+ apply the shared authentication gate before executing them.
224
+ - Do not run `arkcli models list`, `arkcli infer endpoint list`, or another
225
+ existence probe before `doctor model` or `doctor infer-endpoint`. Their
226
+ `exists` checks are authoritative for this workflow.
227
+ - Doctor read-only scopes do not expose Client Preview. Do not invent or pass
228
+ `--dry-run`; run the requested diagnostic and interpret its structured output.
229
+
230
+ ## Output schema overview
231
+
232
+ | Command | Stable fields to inspect first |
233
+ |---|---|
234
+ | `doctor` | `installation`, `connectivity.dns`, `connectivity.tcp`, `connectivity.clock_skew`, `auth`, `configuration` |
235
+ | `doctor account` | `identity`, `compliance.realname`, `compliance.balance`, `permissions.iam_system_policies`, `ecosystem.vmp`, `ecosystem.tos` |
236
+ | `doctor error` | `code`, `category`, `subtype`, `root_cause`, `hint`, `rules`, `needs_backend`, `skill`, `reference` |
237
+ | `doctor infer-endpoint` | `endpoint_id`, `window`, `exists`, `status`, `model_info`, `usage`, `errors`, `error_rate`, `quota_pressure` |
238
+ | `doctor model` | `model_name`, `window`, `exists`, `endpoint_total`, `endpoint_state_distribution`, `usage`, `top_endpoint_by_usage`, `errors`, `error_rate`, `top_endpoint_by_error_rate`, `account_quota_pressure` |
239
+ | `doctor metrics list` | Array entries containing `id`, `summary`, `metric_family`, `calc_kind`, and `unit` |
240
+ | `doctor metrics describe` | Catalog metadata including `template`, declared `params`, and output aggregation |
241
+ | Named or raw metrics query | `query_id` when named, rendered `promql`, `window`, and exactly one of `series`, top-level scalar fields, or `table` |
242
+
243
+ Treat `ok`, `available`, `not_found`, `reason`, `type`, `level`, and nullable
244
+ fields as authoritative. Do not infer success from process exit alone and do
245
+ not turn an unavailable or omitted value into zero. After a successful VMP
246
+ query, an empty series or zero can mean no matching traffic in that workspace,
247
+ label set, and window; it is not a health verdict by itself.
248
+
249
+ `exists.ok` proves only that the model is visible in the foundation-model
250
+ catalog. Doctor does not expose a BytePlus-only activation object or infer
251
+ activation and overdue status from catalog visibility.
252
+
253
+ ## Error and pressure interpretation
254
+
255
+ Use the subtype returned by `doctor error` and the sections in
256
+ [`references/error-codes.md`](references/error-codes.md):
257
+
258
+ | Returned family or subtype | Reference section |
259
+ |---|---|
260
+ | BytePlus gateway signature, authorization, validation, or infrastructure | Official BytePlus common OpenAPI errors |
261
+ | `model_access_denied` | ModelArk access errors |
262
+ | `rate_limit_exceeded` | Rate limits and burst protection |
263
+ | `account_status` | Account and billing errors |
264
+ | `validation_error` or `not_found` | Validation and resource errors |
265
+ | Content-safety and policy subtypes | Content safety |
266
+
267
+ Error-rate output uses `threshold_percent=5`. Quota pressure uses the command's
268
+ structured `level`:
269
+
270
+ | Percent | Level | Meaning |
271
+ |---:|---|---|
272
+ | `>=95` | `critical95` | At or near the limit; reduce traffic or request more quota |
273
+ | `>=80` | `warn80` | High pressure |
274
+ | `>=50` | `warn50` | Moderate pressure |
275
+ | `<50` | `pass` | Below the configured warning thresholds |
276
+
277
+ Do not retry authentication, permission, validation, or payment errors blindly.
278
+ Retry transient gateway or overload errors only when the operation is
279
+ idempotent, with exponential backoff, while preserving `RequestId`.
280
+
281
+ ## VMP dependency and `--auto-bind`
282
+
283
+ Endpoint, model, named metric, and raw PromQL paths use BytePlus VMP. Without an
284
+ explicit `--workspace-id`, a successful remote path requires:
285
+
286
+ 1. VMP enabled for the account.
287
+ 2. ModelArk cross-service authorization through the service-linked role.
288
+ 3. A VMP workspace bound to ModelArk telemetry.
289
+
290
+ If only step 3 is missing, show the exact command with `--auto-bind`, explain
291
+ that it may reuse the first workspace or create `ark_default` and bind
292
+ telemetry, and obtain explicit approval before execution. If step 1 or 2 is
293
+ missing, stop at the official BytePlus setup path; adding `--auto-bind` cannot
294
+ repair it.
295
+
296
+ An explicit `--workspace-id` queries that workspace directly and skips the
297
+ ModelArk telemetry precheck. Do not invent or copy a workspace ID from another
298
+ account.
299
+
300
+ Official BytePlus references:
301
+
302
+ - VMP overview: https://docs.byteplus.com/en/docs/vmp/Monitoring-overview
303
+ - VMP quick start: https://docs.byteplus.com/en/docs/vmp/Quick-start
304
+ - ModelArk access control: https://docs.byteplus.com/en/docs/ModelArk/1263493
305
+
306
+ ## Guard Checklist
307
+
308
+ - Confirm the executable and installed Skill are from the BytePlus product.
309
+ - Keep the active BytePlus account, profile, fixed Region, and environment.
310
+ - Use JSON fields rather than parsing tables or localized prose.
311
+ - Do not expose credentials, signed headers, or full keys.
312
+ - Preserve exact error codes and `RequestId` values.
313
+ - Do not invent unregistered flags such as `--fix`.
314
+ - Do not run model or Endpoint existence preflights outside doctor.
315
+ - Do not run an authentication preflight before `doctor model` or
316
+ `doctor infer-endpoint`.
317
+ - Obtain explicit approval before adding `--auto-bind`.
318
+ - Never route to or emulate `doctor report` on BytePlus.
319
+ - For origin verification, obtain exactly one confirmation for the whole batch,
320
+ never one confirmation per media URL.
321
+
322
+ ## Output handoff
323
+
324
+ For a request_id / x-request-id / LogID alone, explain that doctor cannot retrieve the
325
+ individual log or trace. Ask for the error response/code, resource ID, or occurrence time
326
+ and symptoms. Never pass a RequestId to `doctor error` as an error code or present resource
327
+ aggregates as that request's trace. Preserve the ID for support when more evidence is unavailable;
328
+ do not promise that the console grants cross-service log access.
329
+
330
+ `doctor error` reads a local error catalog: its `root_cause` is a general explanation,
331
+ not request-log evidence for this account or RequestId. For aggregated diagnostics and metrics,
332
+ retain the actual resource, time window, and availability state. Missing fields, empty arrays,
333
+ or failed queries do not establish zero errors or health. A recommended fix is not an executed
334
+ or verified fix.
335
+
336
+ Return, in order:
337
+
338
+ 1. The highest-severity finding or the explicit unknown state.
339
+ 2. The exact structured evidence fields and time window.
340
+ 3. The BytePlus-specific cause, without substituting another product's
341
+ semantics.
342
+ 4. One safe next command or official BytePlus page.
343
+ 5. The preserved `RequestId` when upstream returned one.
344
+
345
+ Do not repeat the full JSON unless the user asks. Never replace an unknown or
346
+ unavailable result with a successful result.
347
+
348
+ Exception: for `doctor +verify-origin`, always relay the complete stdout JSON
349
+ as the entire final response because the upstream legal wording and every
350
+ response field must remain intact.
351
+
352
+ ## References
353
+
354
+ - [`references/scope-cli.md`](references/scope-cli.md)
355
+ - [`references/scope-account.md`](references/scope-account.md)
356
+ - [`references/error-codes.md`](references/error-codes.md)
357
+ - [`references/scope-infer-endpoint.md`](references/scope-infer-endpoint.md)
358
+ - [`references/scope-model.md`](references/scope-model.md)
359
+ - [`references/scope-metrics.md`](references/scope-metrics.md)
360
+ - [`references/verify-origin.md`](references/verify-origin.md)
361
+ - [`references/evals.md`](references/evals.md)
362
+ - [`CONTRIBUTING.md`](CONTRIBUTING.md)
363
+ - [`../arkcli-auth/SKILL.md`](../arkcli-auth/SKILL.md)
364
+ - [`../arkcli-config/SKILL.md`](../arkcli-config/SKILL.md)
365
+ - [`../arkcli-deploy/SKILL.md`](../arkcli-deploy/SKILL.md)
366
+ - [`../arkcli-infer-endpoint/SKILL.md`](../arkcli-infer-endpoint/SKILL.md)
367
+ - [`../arkcli-usage/SKILL.md`](../arkcli-usage/SKILL.md)
@@ -0,0 +1,162 @@
1
+ # BytePlus ModelArk and common error codes
2
+
3
+ Use:
4
+
5
+ ```bash
6
+ arkcli doctor error <code> --format json
7
+ ```
8
+
9
+ The command returns `category`, `subtype`, `root_cause`, `hint`, and the
10
+ original `code`. If a model name or Endpoint ID is available, diagnose that
11
+ resource first and use this reference to interpret its error distribution.
12
+
13
+ The lookup is local, read-only, and does not require authentication. Preserve
14
+ the exact case and suffix from the upstream response. Authentication-looking
15
+ codes and error JSON still take this route when no model or Endpoint identifier
16
+ is present. Execute the lookup first and return its structured result or its
17
+ explicit unknown-code failure; do not replace the lookup with auth status,
18
+ profile inspection, login, or API-key repair unless the user separately asks
19
+ for credential remediation.
20
+
21
+ ## Routing and output contract
22
+
23
+ | Available context | First command |
24
+ |---|---|
25
+ | Endpoint ID plus error code | `arkcli doctor infer-endpoint <endpoint-id> --format json` |
26
+ | Foundation-model name plus error code | `arkcli doctor model <model-name> --format json` |
27
+ | Error code only | `arkcli doctor error <code> --format json` |
28
+ | RequestId only | Preserve it and ask for the resource and error code; doctor has no RequestId reverse lookup |
29
+
30
+ `doctor error` returns:
31
+
32
+ - `code`: the exact input code;
33
+ - `category`: ModelArk/Ark or common BytePlus gateway family;
34
+ - `subtype`: stable routing family;
35
+ - `root_cause` and `hint`: BytePlus-specific interpretation and next step;
36
+ - `rules`: disambiguation signals when applicable;
37
+ - `needs_backend`: capabilities that are not locally executable;
38
+ - `skill=arkcli-doctor` and `reference=error-codes`.
39
+
40
+ Unknown codes fail explicitly. Do not replace an unknown code with another
41
+ product's similar code. In particular, `ModelAccessDenied` is not a registered BytePlus
42
+ doctor code. Use the exact BytePlus response, such as `ModelNotOpen`,
43
+ `AccessDenied`, or `OperationDenied.PermissionDenied`.
44
+
45
+ For a resource-first diagnosis, match the leading code in `errors.overall` or
46
+ `errors.task` to the closest section below. Do not discard the model/Endpoint
47
+ window, count, percentage, or quota evidence after looking up the code.
48
+
49
+ ## Official BytePlus common OpenAPI errors
50
+
51
+ Source:
52
+ https://docs.byteplus.com/en/docs/byteplus-platform/reference-common-error-codes
53
+
54
+ | Code | CodeN | HTTP | Meaning and action |
55
+ |---|---:|---:|---|
56
+ | `MissingParameter` | 100002 | 400 | Add the required parameter named by the message |
57
+ | `MissingAuthenticationToken` | 100003 | 401 | Add the required authentication token or signed headers |
58
+ | `MissingRequestInfo` | 100004 | 400 | Restore required request metadata such as `X-Date` |
59
+ | `MissingSignature` | 100005 | 401 | Sign the request with arkcli or a BytePlus SDK |
60
+ | `InvalidTimestamp` | 100006 | 400 | Synchronize the local clock and regenerate the signature |
61
+ | `ServiceNotFound` | 100007 | 404 | Check the signed service name |
62
+ | `InvalidActionOrVersion` | 100008 | 404 | Check the action and API version |
63
+ | `InvalidAccessKey` | 100009 | 401 | Refresh or replace the AccessKey |
64
+ | `SignatureDoesNotMatch` | 100010 | 401 | Check SecretKey, region, service, canonical query, and body hash |
65
+ | `LackPolicy` | 100012 | 403 | Attach the required BytePlus IAM policy |
66
+ | `AccessDenied` | 100013 | 403 | Check IAM and resource-level access |
67
+ | `InternalError` | 100014 | 500 | Retry with backoff and preserve `RequestId` |
68
+ | `FailToConnect` | 100015 | 502 | Retry; the common gateway could not reach the backend |
69
+ | `InternalServiceTimeout` | 100016 | 504 | Retry idempotently with backoff |
70
+ | `FlowLimitExceeded` | 100018 | 429 | Throttle and retry with backoff |
71
+ | `ServiceUnavailableTemp` | 100019 | 503 | Retry after a delay |
72
+ | `MethodNotAllowed` | 100020 | 405 | Use the documented HTTP method |
73
+ | `InternalServiceError` | 100023 | 502 | Retry and preserve `RequestId` |
74
+ | `InvalidAuthorization` | 100024 | 400 | Correct the Authorization header format |
75
+ | `InvalidCredential` | 100025 | 400 | Correct the Credential component |
76
+ | `InvalidSecretToken` | 100026 | 401 | Refresh the STS token |
77
+
78
+ BytePlus explicitly states that product-specific errors are documented by the
79
+ target product. The public table is therefore a gateway layer, not the complete
80
+ ModelArk catalog.
81
+
82
+ The standard response envelope places errors under
83
+ `ResponseMetadata.Error` and exposes `RequestId` in `ResponseMetadata`.
84
+ Preserve that identifier when escalating:
85
+ https://docs.byteplus.com/en/docs/byteplus-platform/reference-request-response
86
+
87
+ ## ModelArk access errors
88
+
89
+ | Code or family | Likely cause | Action |
90
+ |---|---|---|
91
+ | `ModelNotOpen` | Model access is not enabled | Enable the model in ModelArk |
92
+ | `AccessDenied` | IAM or resource permission is missing | Check Ark policies and active profile |
93
+ | `OperationDenied.PermissionDenied` | Foundation-model configuration is not visible | Grant the required ModelArk permissions |
94
+ | `OperationDenied.ServiceNotOpen` | Model or dependency is not enabled | Enable the named service in BytePlus |
95
+ | `InvalidEndpointOrModel.NotFound` | Wrong ID, region, or visibility | Check the active profile, region, and exact resource ID |
96
+ | `InvalidEndpointOrModel.ModelIDAccessDisabled` | Direct model-ID invocation is disabled | Invoke through an inference Endpoint |
97
+
98
+ Official ModelArk access-control reference:
99
+ https://docs.byteplus.com/en/docs/ModelArk/1263493
100
+
101
+ ## Rate limits and burst protection
102
+
103
+ Use `doctor infer-endpoint` or `doctor model` to distinguish Endpoint pressure
104
+ from model or account pressure.
105
+
106
+ Important families include:
107
+
108
+ - `RateLimitExceeded.EndpointRPMExceeded`
109
+ - `RateLimitExceeded.EndpointTPMExceeded`
110
+ - `ModelAccountRpmRateLimitExceeded`
111
+ - `ModelAccountTpmRateLimitExceeded`
112
+ - `ModelAccountIpmRateLimitExceeded`
113
+ - `APIAccountRpmRateLimitExceeded`
114
+ - `AccountRateLimitExceeded`
115
+ - `QuotaExceeded`
116
+ - `ServerOverloaded`
117
+ - `RequestBurstTooFast`
118
+
119
+ For `ServerOverloaded` and `RequestBurstTooFast`, ramp traffic gradually and
120
+ retry with exponential backoff. BytePlus documents the burst behavior here:
121
+ https://docs.byteplus.com/en/docs/modelark/handle_burst_traffic
122
+
123
+ Do not retry validation, authentication, or permission errors blindly.
124
+
125
+ ## Account and billing errors
126
+
127
+ - `AccountOverdueError` or `OperationDenied.ServiceOverdue`: inspect outstanding
128
+ bills and payment methods in BytePlus Billing Center.
129
+ - `InvalidSubscription`: inspect the named product-plan subscription.
130
+
131
+ Billing references:
132
+
133
+ - Overview: https://docs.byteplus.com/en/docs/byteplus-platform/docs-getting-started
134
+ - Paying bills: https://docs.byteplus.com/en/docs/byteplus-platform/docs-paying-bills
135
+
136
+ ## Validation and resource errors
137
+
138
+ `MissingParameter.<field>`, `InvalidParameter.<field>`, and
139
+ `NotFound.<resource>` use their base diagnosis while preserving the full code.
140
+ Read the message for the exact field or resource name.
141
+
142
+ Do not remove parameters until the target ModelArk API confirms they are
143
+ unsupported. Do not change region or tenant merely to make a resource appear.
144
+
145
+ ## Content safety
146
+
147
+ The command groups content-safety codes into stable subtypes:
148
+
149
+ - `input_real_face`
150
+ - `input_copyright`
151
+ - `input_content_safety`
152
+ - `output_video_copyright`
153
+ - `output_video_safety`
154
+ - `sensitive_content`
155
+ - `risk_detection`
156
+
157
+ Replace or revise the input with compliant, authorized material. Never claim
158
+ that a local transformation guarantees policy acceptance. `needs_backend`
159
+ lists unavailable automated remediation and is not an executable feature.
160
+
161
+ BytePlus does not support `doctor report`. Do not suggest it for generated
162
+ content, model, or Endpoint errors.