focalapi-cli 0.1.1 → 0.2.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/CHANGELOG.md +17 -0
- package/LICENSE +202 -202
- package/README.md +139 -209
- package/dist/cli.js +801 -223
- package/package.json +57 -50
- package/scripts/postinstall.cjs +41 -0
- package/skills/focalapi/SKILL.md +47 -43
- package/skills/focalapi-auth/SKILL.md +28 -50
- package/skills/focalapi-chat/SKILL.md +29 -29
- package/skills/focalapi-gen/SKILL.md +48 -79
- package/skills/focalapi-models/SKILL.md +49 -0
- package/skills/focalapi-task/SKILL.md +25 -0
- package/skills/focalapi-usage/SKILL.md +26 -36
|
@@ -1,36 +1,26 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: focalapi-usage
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
检查链:Key 解析 → 网络与鉴权(GET /v1/models)→ 端到端推理(focal-rehearsal-chat 免费演练模型,不耗额度)→ 额度。
|
|
28
|
-
|
|
29
|
-
- 全部 ✓:链路正常,问题在调用参数(对照命令 --help)。
|
|
30
|
-
- 任一 ✗:按该项 hint 修复;退出码非零适合脚本判断。
|
|
31
|
-
|
|
32
|
-
## 成本控制建议
|
|
33
|
-
|
|
34
|
-
- 演示/联调一律用 `focal-rehearsal-chat`(免费)。
|
|
35
|
-
- 生成类操作前先 `focalapi usage` 确认额度充足。
|
|
36
|
-
- 视频是任务制计费,优先用 `--seconds` 显式控制时长。
|
|
1
|
+
---
|
|
2
|
+
name: focalapi-usage
|
|
3
|
+
version: 2.0.0
|
|
4
|
+
description: "Inspect FocalAPI quota, usage, and billing, or diagnose network, authentication, and service errors. Use when the user asks about spend or balance, or when a failed business command needs an error-code-driven resolution. Do not add mandatory diagnostics before normal generation."
|
|
5
|
+
metadata:
|
|
6
|
+
requires:
|
|
7
|
+
bins: ["focalapi"]
|
|
8
|
+
cliHelp: "focalapi usage --help"
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
# FocalAPI usage and diagnostics
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
focalapi usage --json
|
|
15
|
+
focalapi auth status --json
|
|
16
|
+
focalapi doctor --json
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
- For quota, balance, usage, or billing questions, run `usage`.
|
|
20
|
+
- For `missing_api_key` or `invalid_api_key`, route to focalapi-auth.
|
|
21
|
+
- For `insufficient_quota`, run `usage`, explain the shortfall, and do not add funds automatically.
|
|
22
|
+
- For `network_error`, `timeout`, or 5xx errors, run `doctor` once and follow `checks[].hint`.
|
|
23
|
+
- For `invalid_request`, return to the live `models get` parameter contract and do not resend the same request.
|
|
24
|
+
- For `upstream_auth_failed`, preserve the request ID and escalate to the service operator; do not ask the user to replace the FocalAPI key.
|
|
25
|
+
|
|
26
|
+
Do not run `doctor` or a free rehearsal before a normal business command that has not failed. The Agent should complete the user's creative goal directly and avoid unrelated calls.
|