@seeed-studio/sensecraft-cli 0.3.2 → 0.4.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 (28) hide show
  1. package/INSTALL.md +151 -190
  2. package/README-zh.md +463 -0
  3. package/README.md +9 -13
  4. package/package.json +2 -1
  5. package/scripts/test-install.js +1 -1
  6. package/skills/README.md +14 -35
  7. package/skills/sensecraft-cli/SKILL.md +134 -0
  8. package/skills/{sensecraft-apps → sensecraft-cli}/create-app/SKILL.md +16 -16
  9. package/skills/{sensecraft-apps → sensecraft-cli}/create-app/assets/manifest-template.json +1 -1
  10. package/skills/{sensecraft-apps/create-app/reference-manifest.md → sensecraft-cli/create-app/references/manifest.md} +17 -14
  11. package/skills/{sensecraft-apps/commands.md → sensecraft-cli/references/app-commands.md} +8 -10
  12. package/skills/{sensecraft-apps/reference-app-fields.md → sensecraft-cli/references/app-fields.md} +2 -2
  13. package/skills/{sensecraft-apps/SKILL.md → sensecraft-cli/references/apps.md} +26 -38
  14. package/skills/{sensecraft-devices-cloud/commands.md → sensecraft-cli/references/cloud-commands.md} +1 -1
  15. package/skills/{sensecraft-devices-cloud/SKILL.md → sensecraft-cli/references/cloud.md} +4 -14
  16. package/skills/{confirmation.md → sensecraft-cli/references/confirmation.md} +2 -2
  17. package/skills/{sensecraft-data/commands.md → sensecraft-cli/references/data-commands.md} +33 -12
  18. package/skills/{sensecraft-data/SKILL.md → sensecraft-cli/references/data.md} +10 -20
  19. package/skills/{sensecraft-files/commands.md → sensecraft-cli/references/file-commands.md} +1 -1
  20. package/skills/{sensecraft-files/SKILL.md → sensecraft-cli/references/files.md} +3 -11
  21. package/skills/{sensecraft-models/commands.md → sensecraft-cli/references/model-commands.md} +5 -6
  22. package/skills/{sensecraft-models/SKILL.md → sensecraft-cli/references/models.md} +17 -27
  23. package/skills/{sensecraft-recamera/commands.md → sensecraft-cli/references/recamera-commands.md} +3 -3
  24. package/skills/{sensecraft-recamera/SKILL.md → sensecraft-cli/references/recamera.md} +6 -16
  25. package/skills/{sensecraft-apps/reference-tool-blocks.md → sensecraft-cli/references/tool-blocks.md} +19 -3
  26. package/skills/sensecraft-ai/SKILL.md +0 -134
  27. /package/skills/{sensecraft-apps → sensecraft-cli}/create-app/assets/validate_manifest.py +0 -0
  28. /package/skills/{sensecraft-models/reference-model-fields.md → sensecraft-cli/references/model-fields.md} +0 -0
@@ -1,22 +1,12 @@
1
- ---
2
- name: sensecraft-devices-cloud
3
- description: >-
4
- Manages SenseCraft AI cloud devices (Jetson / cloud kits via {ai-host}/openapi
5
- list_node): list/view devices, deploy models with update_stream, poll order
6
- records. Use when the user mentions Jetson 部署, 云端设备, cloud device,
7
- Requires Access Key (`auth init --kind sensecap`). Not SenseCAP device CLI,
8
- not local USB flash.
9
- ---
1
+ # SenseCraft AI · cloud devices
10
2
 
11
- # SenseCraft Devices Cloud
12
-
13
- Auth: **Access Key** (`auth init --kind sensecap`) → `{ai-host}/openapi`. Parent: [`../sensecraft-ai/SKILL.md`](../sensecraft-ai/SKILL.md).
3
+ Auth: **Access Key** (`auth init`). The China site supports SenseCraft Data only; use Global for SenseCraft AI. Parent: [`../SKILL.md`](../SKILL.md).
14
4
 
15
5
  ## Agent rules
16
6
 
17
7
  1. `sensecraft-cli auth info` first — need SenseCAP Access Key for `{ai-host}/openapi`.
18
8
  2. **Never** use SenseCAP `device` commands here (`device list` = SenseCAP OpenAPI).
19
- 3. **L2 confirm is a separate chat turn** ([`../confirmation.md`](../confirmation.md)) before `cloud deploy --yes` (and device output / order writes). 「部署到这台设备」is **not** confirmation — ask (部署 + 环境 + EUI + model_id), wait for `确认`, then `--yes`. Never pass `--yes` on the same turn as the first request.
9
+ 3. **L2 confirm is a separate chat turn** ([confirmation.md](confirmation.md)) before `cloud deploy --yes` (and device output / order writes). 「部署到这台设备」is **not** confirmation — ask (部署 + 环境 + EUI + model_id), wait for `确认`, then `--yes`. Never pass `--yes` on the same turn as the first request.
20
10
  4. Local USB / Web Serial = **L3** → guide Console `/ai/device/local/...`.
21
11
  5. **reCamera Pro** (`uniform_type=53`) local IP/USB RC2/ALPKG deploy is **not** `cloud deploy` / `update_stream` — guide users to Console device workspace (L3).
22
12
 
@@ -40,7 +30,7 @@ sensecraft-cli cloud order --request-id <request_id> --device-uuid <uuid>
40
30
 
41
31
  `uniform_type` 26 is common for the Jetson cloud device UI; model deploy pages may pass other types / `adapteds`.
42
32
 
43
- Full flag reference and copyable examples: [commands.md](commands.md).
33
+ Full flag reference and copyable examples: [cloud-commands.md](cloud-commands.md).
44
34
 
45
35
  ## Disambiguation
46
36
 
@@ -15,7 +15,7 @@ These are **not** confirmation. Do **not** pass `--yes` on the same turn:
15
15
  Ask in chat. **Do not run** the write command yet. The question MUST include at least:
16
16
 
17
17
  1. **操作类型** — 删除 / 发布 / 私有化 / 部署 / 停止 / 修改 / 绑定 / …
18
- 2. **环境** — `auth info` 的 Global / China(生产环境须点明)
18
+ 2. **环境** — `auth info` 的 Global / China(生产环境须点明)。中国站仅支持 SenseCraft Data;SenseCraft AI 和 CodeCraft Hub 的环境是 Global
19
19
  3. **对象** — 名称 + ID(没有名称就先 `view` / `list` 再问)
20
20
 
21
21
  Template:
@@ -33,7 +33,7 @@ Example (user said 「删除应用 demo」):
33
33
  Example (user said 「删这个63760」):
34
34
 
35
35
  ```
36
- 将从 China 环境删除模型 63760。删除后可能无法恢复。是否确认执行?
36
+ 将从 Global 环境删除模型 63760。删除后可能无法恢复。是否确认执行?
37
37
  ```
38
38
 
39
39
  Classic reCamera flash is **not** an L2 `--yes` write. After the user picked the app/model (and firmware if several), `recamera open` may run. The user then clicks Deploy in Console (L3). Do not invent `recamera deploy`.
@@ -6,31 +6,52 @@ Complete reference for AI agents. All paths are relative to the OpenAPI base URL
6
6
 
7
7
  ## auth init
8
8
 
9
- Interactive setup wizard (OAuth Device Flow). Obtains an Access Key and writes `sensecraft.json`.
9
+ OAuth Device Flow. Obtains an Access Key and writes `sensecraft.json`.
10
10
 
11
- **Not an OpenAPI call.** Requires interactive terminal (TTY) unless using sandbox mode.
11
+ **Not an OpenAPI call.** Bare `auth init` is a TTY wizard. The split flags below are for a one-shot shell: each command prints JSON and exits. `--sandbox` simulates the wizard, or the one split step it is combined with, without network access.
12
12
 
13
13
  ### Flags
14
14
 
15
15
  | Flag | Required | Default | Description |
16
16
  |------|----------|---------|-------------|
17
- | `--sandbox` | No | `false` | Simulate the full wizard without sending real network requests |
17
+ | `--sandbox` | No | `false` | Simulate this step without sending real requests |
18
+ | `--site` | With `--no-wait` | — | `Global` or `China`. China is SenseCraft Data only |
19
+ | `--no-wait` | No | `false` | Request a device code and return immediately |
20
+ | `--device-code` | No | — | Continue a previous `--no-wait` login |
21
+ | `--key-id` | No | — | Save this existing Access Key id after authorization |
22
+ | `--label` | No | — | Create an Access Key with this label after authorization |
23
+ | `--access-level` | No | `read-write` | With `--label`: `read-write` or `only-read` |
24
+ | `--json` | No | `false` | Accepted for agents. The split flow always prints JSON |
18
25
 
19
- ### Wizard steps
26
+ ### Wizard
27
+
28
+ With no split flags, in a terminal:
20
29
 
21
30
  1. Select site: Global (International) or China
22
31
  2. Browser OAuth Device Flow authorization
23
- 3. Organization selection
24
- 4. Access Key creation
25
- 5. Save to local config and set as active profile
32
+ 3. Select an existing Access Key, or create one
33
+ 4. Save to local config and set it active
26
34
 
27
- ### Output
35
+ ### Split flow
28
36
 
29
- Human-readable progress on stdout/stderr. No JSON payload.
37
+ ```bash
38
+ sensecraft-cli auth init --site Global --no-wait
39
+ sensecraft-cli auth init --device-code <device_code>
40
+ sensecraft-cli auth init --device-code <device_code> --key-id <access_id>
41
+ sensecraft-cli auth init --device-code <device_code> --label <name> --access-level read-write
42
+ ```
43
+
44
+ 1. `--no-wait` prints `verification_url`, `user_code`, `device_code`, `expires_in`, and `site`, then exits. It does not read stdin.
45
+ 2. Show `verification_url` to the user and end the turn. Do not poll in that same turn.
46
+ 3. After the user authorizes, `--device-code` polls, then prints the account and Access Key list (`label`, `access_id`, `access_level`).
47
+ 4. A later command with `--key-id` or `--label` saves the key and sets it active.
48
+
49
+ The login access token is written to `sensecraft-auth-pending.json` next to the config file (mode `0600`) and is removed after the key is saved. It is not printed. Key secrets are not printed.
30
50
 
31
51
  ### Agent notes
32
52
 
33
- - Do **not** run on behalf of the user in non-interactive environments.
53
+ - Do **not** run bare `auth init` in a non-interactive shell.
54
+ - Run the split commands above. Do not echo `access_token` or `access_key`.
34
55
  - In sandbox mode, simulated credentials are written locally for testing.
35
56
 
36
57
  ---
@@ -47,7 +68,7 @@ Site defaults to Global when omitted. In an interactive terminal, missing `--key
47
68
  |------|----------|---------|-------------|
48
69
  | `--key-id` | Yes* | — | Access Key ID (API ID) |
49
70
  | `--access-key` | Yes* | — | Access Key secret |
50
- | `--site` | No | `Global` | Site: `Global` or `China` |
71
+ | `--site` | No | `Global` | Site: `Global` or `China`. China is SenseCraft Data only |
51
72
 
52
73
  \* Required unless running interactively (then prompted).
53
74
 
@@ -95,7 +116,7 @@ When uninitialized:
95
116
  ```
96
117
  Config file: /path/to/sensecraft.json
97
118
 
98
- No Access Key configured yet. Run: sensecraft-cli auth init
119
+ No Access Key configured. Run: sensecraft-cli auth init --site Global --no-wait. Show verification_url to the user unchanged and end this turn. After they authorize, run the --device-code command from that command's hint.
99
120
  ```
100
121
 
101
122
  ---
@@ -1,18 +1,8 @@
1
- ---
2
- name: sensecraft-data
3
- description: >-
4
- Operates SenseCraft CLI against SenseCAP PaaS HTTP OpenAPI to manage devices,
5
- groups, development kits, and sensor telemetry data. Use when the user asks to
6
- list/bind/unbind SenseCAP devices, manage device groups, query telemetry
7
- (latest/list/chart), provision dev kits, or automate SenseCAP cloud operations
8
- via CLI or npx. Not for SenseCraft AI apps/models/cloud.
9
- ---
1
+ # SenseCraft Data
10
2
 
11
- # SenseCraft Data (SenseCAP PaaS)
3
+ SenseCraft Data commands (`device`, `group`, `data`) call the [data platform OpenAPI](https://sensecap-docs.seeed.cc/). Every command sends authenticated HTTP requests to the user's configured site (Global / China). The CLI unwraps the API envelope (`code`, `msg`, `data`) and prints only the `data` payload as indented JSON on stdout.
12
4
 
13
- SenseCraft CLI wrappers for the [SenseCAP HTTP OpenAPI](https://sensecap-docs.seeed.cc/). Every `device`, `group`, and `data` command sends authenticated HTTP requests to the user's configured site (Global / China). The CLI unwraps the API envelope (`code`, `msg`, `data`) and prints only the `data` payload as indented JSON on stdout.
14
-
15
- Parent router: [`../sensecraft-ai/SKILL.md`](../sensecraft-ai/SKILL.md).
5
+ Parent router: [`../SKILL.md`](../SKILL.md).
16
6
 
17
7
  ## Installation
18
8
 
@@ -36,10 +26,8 @@ Requires Node.js >= 16.
36
26
  ```bash
37
27
  sensecraft-cli auth info
38
28
  ```
39
- 2. **Never run `auth init` on behalf of the user** — it requires browser OAuth in an interactive terminal.
40
- - SenseCAP Access Key: `sensecraft-cli auth init --kind sensecap`
41
- - If the user already has Key ID / Access Key, guide them to run `auth add` locally instead (do not pass secrets into the agent context).
42
- 3. **L2 confirm is a separate chat turn** ([`../confirmation.md`](../confirmation.md)) before write ops: `device bind` / `unbind`, `group create` / rename / `delete` / `move-devices`, `device devkit create`. 「解绑这台设备」is **not** confirmation — ask (操作类型 + 环境 + EUI/组), wait for `确认`, then `--yes` where the command has it (`unbind` / `group delete` / `group move-devices`). Never pass `--yes` on the same turn as the first request.
29
+ 2. **Do not run bare `auth init`** — the wizard needs a TTY. Use the split flow in [`../SKILL.md`](../SKILL.md): `--site Global --no-wait`, show `verification_url` and end the turn, then `--device-code`. If the user already has Key ID / Access Key, they run `auth add` locally (do not pass secrets into the agent context).
30
+ 3. **L2 confirm is a separate chat turn** ([confirmation.md](confirmation.md)) before write ops: `device bind` / `unbind`, `group create` / rename / `delete` / `move-devices`, `device devkit create`. 「解绑这台设备」is **not** confirmation — ask (操作类型 + 环境 + EUI/组), wait for `确认`, then `--yes` where the command has it (`unbind` / `group delete` / `group move-devices`). Never pass `--yes` on the same turn as the first request.
43
31
  4. **Treat dev kit credentials as secrets** — `device_key` and `token` must not be logged or echoed unnecessarily.
44
32
  5. **Parse stdout JSON** on success; on failure read stderr and check exit code != 0.
45
33
  6. **LoRaWAN devices** must use the Global (international) site per SenseCAP platform rules.
@@ -53,7 +41,7 @@ sensecraft-cli auth info
53
41
  | State | Indicator | Action |
54
42
  |-------|-----------|--------|
55
43
  | Initialized (SenseCAP) | Output shows SenseCAP `[active]`, Key ID, Site, Organization ID | Proceed with `device` / `group` / `data` |
56
- | Not initialized | Prompts to run `auth init --kind sensecap` | Ask the user to run `auth init --kind sensecap` locally; for existing Access Key use `auth add` |
44
+ | Not initialized | Prints `auth init --site Global --no-wait` and says to end the turn | Run that command; show `verification_url` and stop. For an existing Access Key the user runs `auth add` |
57
45
 
58
46
  ## Configuration
59
47
 
@@ -71,6 +59,8 @@ Resolved path priority: `SENSECRAFT_CONFIG_FILE` (absolute or relative to `SENSE
71
59
  | Global (International) | `https://sensecap.seeed.cc/openapi` |
72
60
  | China | `https://sensecap.seeed.cn/openapi` |
73
61
 
62
+ The China site supports SenseCraft Data only. To use SenseCraft AI or CodeCraft Hub, select Global.
63
+
74
64
  Authentication: HTTP Basic Auth with Key ID (username) and Access Key (password), obtained via `auth init` (OAuth Device Flow) or `auth add` (manual import).
75
65
 
76
66
  ## Output and errors
@@ -83,7 +73,7 @@ Authentication: HTTP Basic Auth with Key ID (username) and Access Key (password)
83
73
 
84
74
  | Group | Command | OpenAPI method & path | Write? |
85
75
  |-------|---------|----------------------|--------|
86
- | auth | `init` | OAuth (not OpenAPI); `--kind sensecap\|ai` | Yes |
76
+ | auth | `init` | OAuth Device Flow; saves an Access Key | Yes |
87
77
  | auth | `add` | GET `/view_organization` (verify) + local config | Yes |
88
78
  | auth | `info` | Local config only (SenseCAP + AI sections) | No |
89
79
  | auth | `refresh` | authapi refreshToken (AI profile only) | Yes |
@@ -168,7 +158,7 @@ Dev kit OpenAPI endpoints (`/device/create_development_kit`, `/device/view_node_
168
158
 
169
159
  ## Full command reference
170
160
 
171
- Every command, flag, limit, example, and documented response field: **[commands.md](commands.md)**
161
+ Every command, flag, limit, example, and documented response field: **[data-commands.md](data-commands.md)**
172
162
 
173
163
  ## External references
174
164
 
@@ -1,6 +1,6 @@
1
1
  # sensecraft-files — CLI commands
2
2
 
3
- Binary: `sensecraft-cli`. Auth: Access Key (`auth init --kind sensecap`).
3
+ Binary: `sensecraft-cli`. Auth: Access Key (`auth init`).
4
4
 
5
5
  ## `file upload`
6
6
 
@@ -1,14 +1,6 @@
1
- ---
2
- name: sensecraft-files
3
- description: >-
4
- Uploads images, model binaries, app files, firmware, static resources, and archives
5
- to SenseCraft AI with acquire_file_url + OSS form POST. Use when another workflow needs
6
- a file_url. Requires Access Key (`auth init --kind sensecap`).
7
- ---
8
-
9
1
  # SenseCraft File Upload
10
2
 
11
- Auth: **Access Key** → `{ai-host}/openapi`. Parent: [`../sensecraft-ai/SKILL.md`](../sensecraft-ai/SKILL.md).
3
+ Auth: **Access Key**. The China site supports SenseCraft Data only; file upload follows SenseCraft AI and CodeCraft Hub, so use Global. Parent: [`../SKILL.md`](../SKILL.md).
12
4
 
13
5
  ## Agent rules
14
6
 
@@ -27,7 +19,7 @@ Auth: **Access Key** → `{ai-host}/openapi`. Parent: [`../sensecraft-ai/SKILL.m
27
19
  - Model example image (`pic_url`): `file upload --path <img> --type 1 --unlinked` (**5 MB**), then put `file_url` into model JSON as `pic_url`.
28
20
  - Brand-new model binary only: `model upload --path <file> --unlinked` (or `file upload --type 2 --unlinked`) then put `file_url` into `model create --from-json`. Never bare `model upload --path` / `file upload --path` — CLI exits non-zero (`ErrAttachRequired`).
29
21
  5. Treat returned signed/upload URLs and private file URLs as secrets.
30
- 6. Upload alone is not L2; attaching to a model/app (`--id` / `--model-id` / `--app-id`) **is L2**. Follow [`../confirmation.md`](../confirmation.md): ask first, wait for `确认`, then `--yes`. Never pass `--yes` on the same turn as the first request. `--unlinked` is an explicit orphan opt-in (not L2).
22
+ 6. Upload alone is not L2; attaching to a model/app (`--id` / `--model-id` / `--app-id`) **is L2**. Follow [confirmation.md](confirmation.md): ask first, wait for `确认`, then `--yes`. Never pass `--yes` on the same turn as the first request. `--unlinked` is an explicit orphan opt-in (not L2).
31
23
  7. Do not pass oversized files or more than 16 app image URLs; CLI rejects them before upload/update.
32
24
  8. Types `3`–`6` have no model/app attach path and upload directly (no `--unlinked` needed).
33
25
  9. **Security gates**: empty (0 B) files rejected; type 2–6 ≤ **100 MB**; every image ≤ **5 MB**. The CLI does not count uploads. A rate limit comes back as `11209` or `11210`.
@@ -70,4 +62,4 @@ For model artifacts, this wrapper fixes `type=2` and enables checksum. Pass `--i
70
62
  sensecraft-cli model upload --path ./model.rknn --id <model_id> --yes
71
63
  ```
72
64
 
73
- See [commands.md](commands.md) for the flag reference.
65
+ See [file-commands.md](file-commands.md) for the flag reference.
@@ -1,6 +1,6 @@
1
1
  # sensecraft-models — CLI commands
2
2
 
3
- Binary: `sensecraft-cli`. Auth: **Access Key** (`auth init --kind sensecap`) → `{ai-host}/openapi`.
3
+ Binary: `sensecraft-cli`. Auth: **Access Key** (`auth init`) → `{ai-host}/openapi`.
4
4
 
5
5
  > Status: **shipped**. Every command below is implemented — run it rather than describing it.
6
6
 
@@ -8,8 +8,7 @@ Binary: `sensecraft-cli`. Auth: **Access Key** (`auth init --kind sensecap`) →
8
8
 
9
9
  ```bash
10
10
  sensecraft-cli auth info
11
- # user-only:
12
- sensecraft-cli auth init --kind sensecap
11
+ sensecraft-cli auth init --site Global --no-wait # split flow; see SKILL.md
13
12
  ```
14
13
 
15
14
  ## Commands
@@ -39,7 +38,7 @@ sensecraft-cli model list --mine --uniform-type 40
39
38
  sensecraft-cli model list --mine --name "custom"
40
39
  ```
41
40
 
42
- Classic reCamera (`40`) pick-and-open: [`../sensecraft-recamera/commands.md`](../sensecraft-recamera/commands.md). Do not `cloud deploy` those models.
41
+ Classic reCamera (`40`) pick-and-open: [recamera-commands.md](recamera-commands.md). Do not `cloud deploy` those models.
43
42
 
44
43
  ### `model view --id <id>`
45
44
 
@@ -130,7 +129,7 @@ sensecraft-cli model upload --path ./model.rknn --unlinked
130
129
 
131
130
  Both commands load current `get_constant`. Create validates the complete payload; update first merges the patch with `view_model`, then applies the same checks and submits a normalized complete form. `--path` uploads first (type=2 + checksum) and overwrites `file_url`/`checksum`/`model_size` on the patch — same as Console edit. If `labels` or `file_url` change and the version string was left unchanged, patch version auto-increments (`1.0.0` → `1.0.1`). **Own published** models (`be_public=1`) can be updated; CLI sends `be_public=1` so they **re-enter review** (Console add.vue). Others' public-library ids are refused. Enforced checks include required fields, name/description lengths, labels, version, option ids, device-family exclusivity, device→format/file extension, checksum, and Pro task/framework rules. Non-Pro payloads strip `ai_framework`.
132
131
 
133
- reCamera Pro is detected automatically when an `adapteds` entry resolves to `uniform_type=53`; `--target recamera-pro` is only an extra assertion. See [reference-model-fields.md](reference-model-fields.md).
132
+ reCamera Pro is detected automatically when an `adapteds` entry resolves to `uniform_type=53`; `--target recamera-pro` is only an extra assertion. See [model-fields.md](model-fields.md).
134
133
 
135
134
  `create` refuses payloads that still carry a **public-library** `id` / `model_id` / `from_id` (others' public models cannot be cloned). Upload your own file via `model upload`, then create. Public models are deploy-only.
136
135
 
@@ -153,7 +152,7 @@ sensecraft-cli model update --id <model_id> --path ./model.tflite --from-json ./
153
152
  | `publish` | `1` |
154
153
  | `unpublish` | `0` |
155
154
 
156
- Require a **separate chat confirmation** (see [`../confirmation.md`](../confirmation.md)), then `--yes`. 「发布这个 / 下架 / 删这个」is intent — ask first.
155
+ Require a **separate chat confirmation** (see [confirmation.md](confirmation.md)), then `--yes`. 「发布这个 / 下架 / 删这个」is intent — ask first.
157
156
 
158
157
  ```bash
159
158
  # After the user replies 确认:
@@ -1,19 +1,9 @@
1
- ---
2
- name: sensecraft-models
3
- description: >-
4
- Browses and manages the SenseCraft model library: search public/my models,
5
- view tech metadata (task, format, classes, devices), download, upload, publish/
6
- unpublish, delete. Use when the user mentions 模型库, Model Library, upload model,
7
- download model, model classes/labels, or CodeCraft model invoke links.
8
- Requires Access Key (`auth init --kind sensecap`). Not for SenseCAP telemetry or SenseCraft apps.
9
- ---
10
-
11
- # SenseCraft Models (Model Library)
12
-
13
- Domain skill for **SenseCraft AI models**. Auth: **Access Key** → `{ai-host}/openapi`.
14
-
15
- Parent: [`../sensecraft-ai/SKILL.md`](../sensecraft-ai/SKILL.md).
16
- Apps: [`../sensecraft-apps/SKILL.md`](../sensecraft-apps/SKILL.md).
1
+ # SenseCraft AI model library
2
+
3
+ Domain skill for **SenseCraft AI models**. Auth: **Access Key**. The China site supports SenseCraft Data only; use Global for SenseCraft AI.
4
+
5
+ Parent: [`../SKILL.md`](../SKILL.md).
6
+ Apps: [`apps.md`](apps.md).
17
7
  Library `model download` is the published model file, not a training-job export.
18
8
 
19
9
  ## Agent rules
@@ -22,8 +12,8 @@ Library `model download` is the published model file, not a training-job export.
22
12
  ```bash
23
13
  sensecraft-cli auth info
24
14
  ```
25
- Prefer **SenseCAP Access Key** (`auth init --kind sensecap`) → `{ai-host}/openapi` Basic. Missing key → user runs `auth init --kind sensecap`. **Never** run init for them.
26
- 2. **L2 confirm is a separate chat turn** ([`../confirmation.md`](../confirmation.md)) before: `publish` / `unpublish` / `delete` / `create` / `model update` / attach-upload. 「删这个63760」is **not** confirmation — ask `将从{环境}环境删除模型 63760。删除后可能无法恢复。是否确认执行?`, wait for `确认`, then `--yes`. Never pass `--yes` on the same turn as the first request.
15
+ Prefer **SenseCAP Access Key** (`auth init`) → `{ai-host}/openapi` Basic. Missing key → split `auth init` flow in [`../SKILL.md`](../SKILL.md). Do not run bare `auth init`.
16
+ 2. **L2 confirm is a separate chat turn** ([confirmation.md](confirmation.md)) before: `publish` / `unpublish` / `delete` / `create` / `model update` / attach-upload. 「删这个63760」is **not** confirmation — ask `将从{环境}环境删除模型 63760。删除后可能无法恢复。是否确认执行?`, wait for `确认`, then `--yes`. Never pass `--yes` on the same turn as the first request.
27
17
  3. When the user **attaches a model file** ("上传这个模型文件" / "更新模型"):
28
18
  - **Own My Models** (including already published `be_public=1`): after chat confirm, `model update --id <model_id> --path <file> --yes`. Same as Console 编辑模型. If it is **already public**, the confirm question must say 模型信息更新后将重新进入审核流程. CLI sends `be_public=1` like Console `requestConfirmFn`. JSON includes `re_review: true`.
29
19
  - `model upload --path <file> --id <model_id> --yes` is the same attach path.
@@ -38,16 +28,16 @@ Library `model download` is the published model file, not a training-job export.
38
28
  - **Do not copy a public model into My Models.** Do not copy `model view` JSON into `model create` (including `id` / `model_id` / `from_id` / `file_url` / checksum). CLI `model create` refuses public-library sources. Tell the user to **deploy** instead.
39
29
  - **Do not download.** Phrases like 下载地址 / 下载链接 / `file_url` / download URL / 怎么下载 / 给我链接 are the **same leak** as `model download --url-only`. Do **not** run `model download` (`--apply` / `--url-only` included).
40
30
  - Do **not** print, quote, or reconstruct `file_url`, `apply_model` URLs, CDN/OSS paths, or signed query strings — even if they appear in a tool error, browser, or prior message.
41
- - Answer the **method**, not an address: browse metadata, then deploy so the device pulls firmware at apply time (`cloud deploy` for Jetson/`26`, or classic reCamera `40` via [`sensecraft-recamera`](../sensecraft-recamera/SKILL.md)).
31
+ - Answer the **method**, not an address: browse metadata, then deploy so the device pulls firmware at apply time (`cloud deploy` for Jetson/`26`, or classic reCamera `40` via [`sensecraft-recamera`](recamera.md)).
42
32
  - Owner file download is only for **private** My Models (`be_public=0`). Even then, do not paste signed URLs into chat unless the user explicitly needs `--url-only` for a local script; prefer `--out` file path. Treat remaining `file_url`, checksums, and tokens as secrets.
43
33
  6. Success = indented JSON stdout; failure = stderr + non-zero exit.
44
- 7. Classic reCamera (`uniform_type=40`): list with `--uniform-type 40`, then [`sensecraft-recamera`](../sensecraft-recamera/SKILL.md) `check` / `open`. **Do not** `cloud deploy`. **Do not** download public models. reCamera Pro (`53`) is a different device — use `model recamera-pro resolve`, then Console local L3 (not this 40 flow).
34
+ 7. Classic reCamera (`uniform_type=40`): list with `--uniform-type 40`, then [`sensecraft-recamera`](recamera.md) `check` / `open`. **Do not** `cloud deploy`. **Do not** download public models. reCamera Pro (`53`) is a different device — use `model recamera-pro resolve`, then Console local L3 (not this 40 flow).
45
35
 
46
36
  ## CLI status
47
37
 
48
38
  | Area | Status |
49
39
  |------|--------|
50
- | Auth `--kind sensecap` | **Implemented** (`{ai-host}/openapi` Basic) |
40
+ | Access Key | **Implemented** (`{ai-host}/openapi` Basic) |
51
41
  | `model list` / `model view` / `model download` | **Implemented** |
52
42
  | `model create` / `update` / `publish` / `unpublish` / `delete` | **Implemented** (L2: `--yes`; create needs `file_url` in JSON) |
53
43
  | `model upload` / `file upload` | **Implemented** (types 1–2 require `--id`/`--model-id`/`--app-id`/`--for-app`/`--unlinked`; attach auto-increments patch version like Console) |
@@ -112,7 +102,7 @@ This writes `file_url` / `checksum` / `model_size` and auto-increments the patch
112
102
 
113
103
  **Brand-new model** only:
114
104
 
115
- 1. Gather fields from [reference-model-fields.md](reference-model-fields.md)
105
+ 1. Gather fields from [model-fields.md](model-fields.md)
116
106
  2. Explicit unlinked upload, then put `file_url` (+ `checksum`, `size` as `model_size`) into create JSON:
117
107
  ```bash
118
108
  sensecraft-cli model upload --path ./model.rknn --unlinked
@@ -130,7 +120,7 @@ Publish / unpublish / delete still need a **chat confirm first**, then `--yes` (
130
120
 
131
121
  Successful `model create` JSON includes `model_id` and `console_url` (Console detail: `/ai/model/detail?id=…&tab=custom`). Show that link to the user.
132
122
 
133
- Create must contain the complete field set in [reference-model-fields.md](reference-model-fields.md). Update may be an incremental input patch: CLI loads `view_model`, merges and validates it, then submits the normalized complete Console form so removed conditional fields (such as Pro Classification `ai_framework`) do not remain stale.
123
+ Create must contain the complete field set in [model-fields.md](model-fields.md). Update may be an incremental input patch: CLI loads `view_model`, merges and validates it, then submits the normalized complete Console form so removed conditional fields (such as Pro Classification `ai_framework`) do not remain stale.
134
124
 
135
125
  Model publish uses **`status` 1/0** — not app `privacy` 2/0. Never set `be_public=1` in create/update JSON.
136
126
 
@@ -151,7 +141,7 @@ sensecraft-cli model create --from-json ./pro.json --target recamera-pro --yes
151
141
  - Segmentation (`3`) and Generation (`5`) are hidden/unsupported for reCamera Pro upload/deploy.
152
142
  - All supported non-audio tasks use `.rknn` (`model_format=6`).
153
143
 
154
- Detection framework→algorithm and full upload constraints are in [reference-model-fields.md](reference-model-fields.md).
144
+ Detection framework→algorithm and full upload constraints are in [model-fields.md](model-fields.md).
155
145
 
156
146
  ## Field summary (library card / detail)
157
147
 
@@ -171,7 +161,7 @@ Detection framework→algorithm and full upload constraints are in [reference-mo
171
161
  | Visibility | `be_public` | `0` private · `1` public · `2` under review (display) |
172
162
  | Invoke / CodeCraft | detail or env deep links | Surface any API-provided invoke URL; CodeCraft workspace base from product env — **do not implement CodeCraft compile inside this skill** |
173
163
 
174
- Full create/edit compliance: [reference-model-fields.md](reference-model-fields.md).
164
+ Full create/edit compliance: [model-fields.md](model-fields.md).
175
165
 
176
166
  ## APIs (wiring reference)
177
167
 
@@ -192,5 +182,5 @@ Base: `{host}/openapi`, HTTP Basic (`key_id`:`access_key`).
192
182
 
193
183
  ## Additional resources
194
184
 
195
- - [commands.md](commands.md)
196
- - [reference-model-fields.md](reference-model-fields.md)
185
+ - [model-commands.md](model-commands.md)
186
+ - [model-fields.md](model-fields.md)
@@ -1,6 +1,6 @@
1
1
  # sensecraft-recamera — CLI commands
2
2
 
3
- Target binary: `sensecraft-cli` (this repo). Auth: active **SenseCAP Access Key** (`auth init --kind sensecap`) → `{ai-host}/openapi`.
3
+ Target binary: `sensecraft-cli` (this repo). Auth: active **SenseCAP Access Key** (`auth init`) → `{ai-host}/openapi`.
4
4
 
5
5
  > Status: **shipped (P1 list + P2 check/open)**. Flash stays in Console. There is no `recamera deploy`.
6
6
 
@@ -8,7 +8,7 @@ Target binary: `sensecraft-cli` (this repo). Auth: active **SenseCAP Access Key*
8
8
 
9
9
  ```bash
10
10
  sensecraft-cli auth info
11
- sensecraft-cli auth init --kind sensecap # user only, interactive
11
+ sensecraft-cli auth init --site Global --no-wait # split flow; see SKILL.md
12
12
  ```
13
13
 
14
14
  ## List (existing commands)
@@ -64,7 +64,7 @@ sensecraft-cli recamera open --model-id <model_id>
64
64
  sensecraft-cli recamera open --app-id <app_id> --print-only
65
65
  ```
66
66
 
67
- `console_url` is `/ai/model/detail?id=…` for a model, or `https://app.seeed.cc/view-application/<id>-<slug>` for an app.
67
+ `console_url` is `/ai/model/detail?id=…` for a model, or `https://codecraft.seeed.cc/hub/view-application/<id>-<slug>` for an app.
68
68
  **Not** `/ai/device/local/40` (that family is 32/36/37/41/52). **Not** `/ai/recamera` (301 → Grove 36).
69
69
 
70
70
  ## Out of scope
@@ -1,20 +1,10 @@
1
- ---
2
- name: sensecraft-recamera
3
- description: >-
4
- Picks classic reCamera (uniform_type 40) public or My Apps / My Models, checks
5
- compatibility, then opens the Console AI deploy page so the user flashes over
6
- IP or USB. Use when the user mentions reCamera, 烧录, 刷机, 部署到 recamera,
7
- uniform_type 40, or picking a model/app for reCamera. Not reCamera Pro (53),
8
- not Jetson cloud deploy, not CodeCraft App Square.
9
- ---
1
+ # SenseCraft AI · classic reCamera (uniform_type 40)
10
2
 
11
- # SenseCraft reCamera (classic, uniform_type 40)
3
+ Orchestration skill: **list → pick → check → open Console → user clicks Deploy**. The China site supports SenseCraft Data only; use Global for SenseCraft AI.
12
4
 
13
- Orchestration skill: **list → pick → check → open Console → user clicks Deploy**.
14
-
15
- Parent: [`../sensecraft-ai/SKILL.md`](../sensecraft-ai/SKILL.md).
16
- List/view: [`../sensecraft-apps/SKILL.md`](../sensecraft-apps/SKILL.md), [`../sensecraft-models/SKILL.md`](../sensecraft-models/SKILL.md).
17
- Commands: [`commands.md`](commands.md).
5
+ Parent: [`../SKILL.md`](../SKILL.md).
6
+ List/view: [`apps.md`](apps.md), [`models.md`](models.md).
7
+ Commands: [recamera-commands.md](recamera-commands.md).
18
8
 
19
9
  **This skill does not flash.** Flash is L3 in the browser (IP or USB). There is no `recamera deploy` and no device HTTP in this CLI.
20
10
 
@@ -24,7 +14,7 @@ Commands: [`commands.md`](commands.md).
24
14
  ```bash
25
15
  sensecraft-cli auth info
26
16
  ```
27
- Need **SenseCAP Access Key** (`auth init --kind sensecap`) for `app` / `model` / `recamera`. Never run init for them.
17
+ Need **SenseCAP Access Key** (`auth init`) for `app` / `model` / `recamera`. Missing key → split flow in [`../SKILL.md`](../SKILL.md). Do not run bare `auth init`.
28
18
  2. **Classic reCamera only (`40`)**. Do **not** treat Pro `53`, XIAO `32`, or Grove `36` as the same device. `/ai/recamera` redirects to Grove `36` — do not send users there.
29
19
  3. Filter **only** with API `--uniform-type 40`. Do not guess from local materials, SKU strings, or adapteds-only. Public **and** mine:
30
20
  ```bash
@@ -8,7 +8,7 @@ The editor does **not** render Markdown on read. Preview wraps each block by `ty
8
8
 
9
9
  Write inline formatting as HTML the editor stores: `<strong>`, `<em>`, `<code>`, `<s>`, links with `target="_blank"`, file links (pdf/zip/bin/…) also with `download` and `doc-file-download-link`, images with `draggable="false"`. A paragraph that is only a video URL becomes `<video controls>` or a `video-embed-wrapper` iframe (YouTube, TikTok, Douyin, Bilibili, Vimeo, Youku, iQiyi). Prefer `app create --from-md` / `app update --from-md` instead of writing that HTML by hand. `--from-json` fills those video, link, and image attributes when they are missing. Do not wrap a `paragraph` in an extra `<p>`. `code` block `content` is plain source, not HTML.
10
10
 
11
- Compile a Markdown file with `sensecraft-cli app doc compile --from-md <file>` when you only want the JSON (no network). `app create --from-md` and `app update --from-md` run that compile and then write. JSON text blocks that still contain Markdown markers are rejected. How the toolbar maps onto blocks: [../../docs/md-to-app.md](../../docs/md-to-app.md).
11
+ Compile a Markdown file with `sensecraft-cli app doc compile --from-md <file>` when you only want the JSON (no network). `app create --from-md` and `app update --from-md` run that compile and then write. JSON text blocks that still contain Markdown markers are rejected. How the toolbar maps onto blocks: [../../../docs/md-to-app.md](../../../docs/md-to-app.md).
12
12
 
13
13
  Host binaries (images, videos, firmware) via `file upload` first. A relative path from the Markdown file is not a valid `src`.
14
14
 
@@ -119,6 +119,7 @@ Unchecked `muse_gadget` keeps the single-file device table below and does not re
119
119
  | `config.model` | `null` or `{ type, model }` |
120
120
  | `config.model.type` | `"model"` \| `"upload"` \| `"defer"` |
121
121
  | `config.model.model` | Metadata: `id`, `name`, `task`, `labels`/`classes`, `uniform_types`, `isCustom`, … |
122
+ | `config.deploy_tool_entry` | `"vision"` or `"sound"`. Both toolbar entries use this block type. `sound` excludes reCamera Pro (`uniform_type` `53`) |
122
123
  | `config.device_type` | Device `uniform_type` string (e.g. `"32"`) |
123
124
  | `config.powerMode` | 0–5, default `2` (XIAO power-on infer) |
124
125
  | `config.conf` / `config.iou` | Detection UI thresholds |
@@ -140,7 +141,22 @@ Unchecked `muse_gadget` keeps the single-file device table below and does not re
140
141
 
141
142
  ### `deploy-container-app`
142
143
 
143
- Used for **container / edge app** deployment UI inside the application doc.
144
+ Used for **container / edge app** deployment UI inside the application doc. Fields live in `config`, same names as the editor's defaults:
145
+
146
+ | Path | Notes |
147
+ |------|-------|
148
+ | `config.app_id` / `config.app_key` | Fleet app id and key |
149
+ | `config.app_display_name` / `config.app_icon` / `config.app_description` | Card text and icon |
150
+ | `config.architecture` | Selected architecture string |
151
+ | `config.architectures` | Architecture list |
152
+ | `config.version` | Selected version string. Not `app_version` |
153
+ | `config.version_options` | Version list |
154
+ | `config.install_form` | Install form object |
155
+ | `config.merged_service` | Merged service snapshot |
156
+ | `config.user_override_flags` | Which form fields the user overrode |
157
+ | `config.form_field_values` | Form values |
158
+ | `config.raw_by_version` | Raw detail by version |
159
+ | `config.detail_form_fields` | Form field schema |
144
160
 
145
161
  **Agent:** configure the block for documentation. Installing the container is not a CLI command. Prefer linking users to Console preview deploy when the CLI has no container control.
146
162
 
@@ -178,7 +194,7 @@ Used for **container / edge app** deployment UI inside the application doc.
178
194
  {
179
195
  "id": "para_1",
180
196
  "type": "paragraph",
181
- "content": "<p>Connect the board over USB, then flash.</p>",
197
+ "content": "Connect the board over USB, then flash.",
182
198
  "indent": 0
183
199
  },
184
200
  {