@seeed-studio/sensecraft-cli 0.3.1 → 0.4.0
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/INSTALL.md +151 -190
- package/README-zh.md +463 -0
- package/README.md +9 -13
- package/package.json +2 -1
- package/scripts/test-install.js +1 -1
- package/skills/README.md +14 -35
- package/skills/sensecraft-cli/SKILL.md +131 -0
- package/skills/{sensecraft-apps → sensecraft-cli}/create-app/SKILL.md +26 -17
- package/skills/{sensecraft-apps → sensecraft-cli}/create-app/assets/manifest-template.json +1 -1
- package/skills/{sensecraft-apps/create-app/reference-manifest.md → sensecraft-cli/create-app/references/manifest.md} +17 -14
- package/skills/{sensecraft-apps/commands.md → sensecraft-cli/references/app-commands.md} +38 -16
- package/skills/{sensecraft-apps/reference-app-fields.md → sensecraft-cli/references/app-fields.md} +4 -3
- package/skills/{sensecraft-apps/SKILL.md → sensecraft-cli/references/apps.md} +35 -37
- package/skills/{sensecraft-devices-cloud/commands.md → sensecraft-cli/references/cloud-commands.md} +1 -1
- package/skills/{sensecraft-devices-cloud/SKILL.md → sensecraft-cli/references/cloud.md} +4 -14
- package/skills/{confirmation.md → sensecraft-cli/references/confirmation.md} +2 -2
- package/skills/{sensecraft-data/commands.md → sensecraft-cli/references/data-commands.md} +2 -2
- package/skills/{sensecraft-data/SKILL.md → sensecraft-cli/references/data.md} +10 -18
- package/skills/{sensecraft-files/commands.md → sensecraft-cli/references/file-commands.md} +1 -1
- package/skills/{sensecraft-files/SKILL.md → sensecraft-cli/references/files.md} +3 -11
- package/skills/{sensecraft-models/commands.md → sensecraft-cli/references/model-commands.md} +5 -5
- package/skills/{sensecraft-models/SKILL.md → sensecraft-cli/references/models.md} +17 -27
- package/skills/{sensecraft-recamera/commands.md → sensecraft-cli/references/recamera-commands.md} +4 -4
- package/skills/{sensecraft-recamera/SKILL.md → sensecraft-cli/references/recamera.md} +6 -16
- package/skills/{sensecraft-apps/reference-tool-blocks.md → sensecraft-cli/references/tool-blocks.md} +20 -4
- package/skills/sensecraft-ai/SKILL.md +0 -134
- /package/skills/{sensecraft-apps → sensecraft-cli}/create-app/assets/validate_manifest.py +0 -0
- /package/skills/{sensecraft-models/reference-model-fields.md → sensecraft-cli/references/model-fields.md} +0 -0
|
@@ -1,23 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
docs/md-to-app.md: split it into deployment.blocks (content is HTML, not raw
|
|
11
|
-
Markdown) and publish with app create / app publish. There is no import-md command.
|
|
12
|
-
---
|
|
13
|
-
|
|
14
|
-
# SenseCraft Apps (Application Plaza)
|
|
15
|
-
|
|
16
|
-
Domain skill for **SenseCraft AI applications**. Auth: **Access Key** → `{ai-host}/openapi` (HTTP Basic).
|
|
17
|
-
|
|
18
|
-
Parent router: [`../sensecraft-ai/SKILL.md`](../sensecraft-ai/SKILL.md).
|
|
19
|
-
SenseCAP IoT: [`../sensecraft-data/SKILL.md`](../sensecraft-data/SKILL.md).
|
|
20
|
-
Child skill: [`create-app/SKILL.md`](create-app/SKILL.md) — manifest-driven app lifecycle: mine a finished local project into a versioned `sensecraft-app.json` manifest (source of truth), create the app in one go, then local-first updates with drift detection (one batch confirmation per push). Publish / unpublish / delete stay in this file.
|
|
1
|
+
# CodeCraft Hub
|
|
2
|
+
|
|
3
|
+
Site: https://codecraft.seeed.cc/hub
|
|
4
|
+
|
|
5
|
+
Domain skill for **CodeCraft Hub applications**. Auth: **Access Key** (HTTP Basic). The China site supports SenseCraft Data only; use Global for CodeCraft Hub.
|
|
6
|
+
|
|
7
|
+
Parent router: [`../SKILL.md`](../SKILL.md).
|
|
8
|
+
SenseCAP IoT: [`data.md`](data.md).
|
|
9
|
+
Child skill: [`../create-app/SKILL.md`](../create-app/SKILL.md) — manifest-driven app lifecycle: mine a finished local project into a versioned `sensecraft-app.json` manifest (source of truth), create the app in one go, then local-first updates with drift detection (one batch confirmation per push). Publish / unpublish / delete stay in this file.
|
|
21
10
|
|
|
22
11
|
## Agent rules
|
|
23
12
|
|
|
@@ -25,11 +14,11 @@ Child skill: [`create-app/SKILL.md`](create-app/SKILL.md) — manifest-driven ap
|
|
|
25
14
|
```bash
|
|
26
15
|
sensecraft-cli auth info
|
|
27
16
|
```
|
|
28
|
-
Need an active **SenseCAP Access Key**. If missing, ask the user to run `sensecraft-cli auth init
|
|
29
|
-
2. **L2 confirm is a separate chat turn** ([
|
|
17
|
+
Need an active **SenseCAP Access Key**. If missing, ask the user to run `sensecraft-cli auth init` locally. **Never** run `auth init` for them.
|
|
18
|
+
2. **L2 confirm is a separate chat turn** ([confirmation.md](confirmation.md)) before: `publish` (`--agree-declaration`), `unpublish`, `withdraw`, `delete`, `like`, `unlike`, `collect`, `uncollect`, `mark-deploy`, `clone`, **`app update` / `bom set`**. 「删除应用 demo」is **not** confirmation — ask `将从{环境}环境删除应用 demo(ID: …)。删除后可能无法恢复。是否确认执行?`, wait for `确认`, then `--yes`. Never pass `--yes` on the same turn as the first request. **Exception — batch authoring:** [`create-app`](../create-app/SKILL.md) confirms a whole push batch (fields + images + BOM + blocks) in one turn instead of per write; its one-go `app create` needs no confirmation at all.
|
|
30
19
|
**`app create` is not L2** — including `--from-json` with full fields (create + internal follow-up `update_app` on the **new** `app_id` only). Prefer one-shot create when the payload is ready. Still tell the user what will be created before running create.
|
|
31
20
|
3. **Privacy values**: submit review → `privacy` / flow uses **`2`** (pending); unpublish/private → **`0`**. **Never send `1`** (ops-approved public; Admin only).
|
|
32
|
-
4. Tool-block **configuration** may be written into `deployment.blocks`. **Executing** flash / USB deploy / container install on hardware is **L3**. Classic reCamera (`40`): [`sensecraft-recamera`](
|
|
21
|
+
4. Tool-block **configuration** may be written into `deployment.blocks`. **Executing** flash / USB deploy / container install on hardware is **L3**. Classic reCamera (`40`): [`sensecraft-recamera`](recamera.md) (`check` / `open`). Other benches: Console `/ai/device/local/32|36|37|41|52`. `flash-firmware` run is out of scope this pass.
|
|
33
22
|
5. Parse indented JSON on stdout; on failure read stderr + exit code. After `app update`, **re-read** the app — success body may be `{}`.
|
|
34
23
|
6. **Rename / edit info**: sparse `{"app_name":"…"}` is OK (CLI merges other info fields from sketch). Do not invent HTTP; do **not** put `be_public=1` in user JSON. For **already published** apps the CLI injects `be_public=1` (Console info save) and returns `sketch_saved` — plaza copy is unchanged until `app publish`.
|
|
35
24
|
7. **Lifecycle vs Console**: edit / publish / unpublish / delete / BOM / cover only for **your** apps (`user_id` == profile). Another user's plaza app cannot be edited. `be_public=2` locks owner edit. `be_public=1` owner may save sketch then `app publish` (草稿). Delete only `be_public=0`.
|
|
@@ -39,8 +28,9 @@ Child skill: [`create-app/SKILL.md`](create-app/SKILL.md) — manifest-driven ap
|
|
|
39
28
|
|
|
40
29
|
| Area | Status |
|
|
41
30
|
| ---------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
42
|
-
|
|
|
43
|
-
| `app list` / `app view` / `app fields` / `app blocks` / `app activity list` | **Implemented**.
|
|
31
|
+
| Access Key | **Implemented** (`auth init` or `auth add`; `app` uses `{ai-host}/openapi` Basic) |
|
|
32
|
+
| `app list` / `app view` / `app fields` / `app blocks` / `app activity list` | **Implemented**. CodeCraft Hub hot list is `--public --sort popular` |
|
|
33
|
+
| `app doc compile` | **Implemented**. Markdown → editor `deployment.blocks`. No auth, no network. `app create --from-md` / `app update --from-md` compile then write. `--from-json` fills video, file-link, and image HTML, and rejects raw Markdown in text-block `content` |
|
|
44
34
|
| `app create` / `update` / `publish` / `unpublish` / `withdraw` / `delete` | **Implemented** (L2 = `--yes`; publish also `--agree-declaration`; **`create` never needs `--yes`**, even with full `--from-json`). `withdraw` is review-only (`be_public=2`); `unpublish` is for an already public app |
|
|
45
35
|
| `app like` / `unlike` / `collect` / `uncollect` / `mark-deploy` / `clone` | **Implemented** (L2 = `--yes`) |
|
|
46
36
|
| Cover / attachment upload | `file upload --path <img> --type 1 --app-id <id> --yes` (prepends cover, **5 MB**). Unlinked: `file upload --type 1 --for-app` when building a new app payload. |
|
|
@@ -81,6 +71,14 @@ sensecraft-cli app update --id <app_id> --activity-id 1 --yes
|
|
|
81
71
|
|
|
82
72
|
`activity_id` is an optional positive integer. List ids with `app activity list`. Omit it to leave existing activity tags unchanged. `tags` is ignored. A bad id fails the whole edit (`11202`); an unknown or inactive activity also fails the whole edit (`25000` `Activity does not exist or has expired`). If this update sets `--activity-id` and the JSON does not set `allow_clone`, CLI writes `allow_clone=1` unless the sketch is already `1`.
|
|
83
73
|
|
|
74
|
+
### Leave an activity (L2)
|
|
75
|
+
|
|
76
|
+
```bash
|
|
77
|
+
sensecraft-cli app update --id <app_id> --cancel-activity-id 1 --yes
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
`cancel_activity_id` is an optional positive integer sent as a JSON number. It does not change `allow_clone` and is not checked against `app activity list`. Omit it to leave participation unchanged. Do not send the same id as `activity_id` in one update.
|
|
81
|
+
|
|
84
82
|
### Publish / unpublish / delete (L2)
|
|
85
83
|
|
|
86
84
|
```bash
|
|
@@ -90,7 +88,7 @@ sensecraft-cli app unpublish --id <app_id> --yes # privacy=0 private / withdr
|
|
|
90
88
|
sensecraft-cli app delete --id <app_id> --yes # private only (be_public=0)
|
|
91
89
|
```
|
|
92
90
|
|
|
93
|
-
`app publish` matches Console 「发布确认」: show https://sensecraft.seeed.cc/legal/en/declaration and warn that review locks editing; only then pass `--agree-declaration --yes`. Missing either flag → non-zero. API body is still only `{app_id, privacy:2}` (agreement is client-side, like Console `warrantyAccepted`).
|
|
91
|
+
`app publish` matches Console 「发布确认」: show https://sensecraft.seeed.cc/legal/en/declaration and warn that review locks editing; only then pass `--agree-declaration --yes`. Missing either flag → non-zero. API body is still only `{app_id, privacy:2}` (agreement is client-side, like Console `warrantyAccepted`). stdout includes `detail_url`: the creator-center page (`https://codecraft.seeed.cc/hub/view-application/<id>-<slug>?from=user-center&tab=custom`). Give the user that URL. Do **not** invent `/application/detail/<id>` — that is the plaza page and does not open the private draft.
|
|
94
92
|
|
|
95
93
|
**Never** send `privacy=1` (ops-approved public). After editing a **published** app, tell the user plaza is unchanged until they confirm `app publish --agree-declaration --yes`.
|
|
96
94
|
|
|
@@ -114,15 +112,15 @@ Seeed rows need `id`(=SKU). Custom rows omit `id`. No manual custom image upload
|
|
|
114
112
|
sensecraft-cli app blocks
|
|
115
113
|
```
|
|
116
114
|
Use `app_scenarios_array` from constants and the two static catalogs; never invent option ids or block shapes.
|
|
117
|
-
1. Fill required app info (see [
|
|
118
|
-
2. Build intro + stepped deploy + tool-blocks ([
|
|
119
|
-
3. BOM: Seeed SKU rows and/or custom rows ([
|
|
115
|
+
1. Fill required app info (see [app-fields.md](app-fields.md)).
|
|
116
|
+
2. Build intro + stepped deploy + tool-blocks ([tool-blocks.md](tool-blocks.md)). When the source is Markdown, run `sensecraft-cli app create --from-md <file>` (add `--from-json` for scene, cover, BOM, and tool-blocks). JSON `deployment.blocks` are appended after the compiled document. `app doc compile --from-md` only previews. Do not leave `**bold**` or list markers in JSON `content`.
|
|
117
|
+
3. BOM: Seeed SKU rows and/or custom rows ([app-fields.md](app-fields.md#bom-materials))
|
|
120
118
|
4. **Prefer one-shot create** when JSON is complete (**no `--yes`**):
|
|
121
119
|
```bash
|
|
122
120
|
sensecraft-cli app create --from-json ./app.json
|
|
123
121
|
# CLI returns app_id + console_url + detail_url (even if update_app body was {}).
|
|
124
|
-
# detail_url is https://
|
|
125
|
-
# (test AI host → https://test-
|
|
122
|
+
# detail_url is https://codecraft.seeed.cc/hub/view-application/<id>-<slug>?from=user-center&tab=custom
|
|
123
|
+
# (test AI host or remote_type Develop → https://test-codecraft.seeed.cc/hub). from=user-center loads the sketch cover.
|
|
126
124
|
# A non-empty web_link on a list item is the link to give the user.
|
|
127
125
|
# Restore JSON may have pic_url (list) or images[] (view); CLI writes both.
|
|
128
126
|
# Show links to the user. NEVER re-run create because stdout looked empty —
|
|
@@ -150,7 +148,7 @@ Never put `be_public=1` / `privacy=1` in JSON; use `app publish`.
|
|
|
150
148
|
| `license` | text | often with save | string |
|
|
151
149
|
| `be_public` | 0/1/2 | lifecycle | 0 private, 1 public (ops), 2 pending review |
|
|
152
150
|
|
|
153
|
-
Full table + `update_app` keys: [
|
|
151
|
+
Full table + `update_app` keys: [app-fields.md](app-fields.md).
|
|
154
152
|
|
|
155
153
|
## Deploy docs + tool-blocks (summary)
|
|
156
154
|
|
|
@@ -169,7 +167,7 @@ Structure: `deployment.blocks` flat array.
|
|
|
169
167
|
| `deploy-container-app` | Edge container app in the app doc | Config OK; installing the container is L3 |
|
|
170
168
|
| `node-red` / `aily-blockly` | Flow / Blockly projects | Lower priority unless user asks |
|
|
171
169
|
|
|
172
|
-
Details: [
|
|
170
|
+
Details: [tool-blocks.md](tool-blocks.md).
|
|
173
171
|
|
|
174
172
|
## BOM (summary)
|
|
175
173
|
|
|
@@ -184,7 +182,7 @@ Base: `{host}/openapi` with HTTP Basic (`key_id`:`access_key`).
|
|
|
184
182
|
|
|
185
183
|
| Action | Method | Path |
|
|
186
184
|
| ------- | ------ | ---------------------------------------------------------------- |
|
|
187
|
-
| List | GET | `/flow/app/v2/list_app` (`be_public`, `order_type` `1`/`2`/`3`, `priority_activity_id`, `
|
|
185
|
+
| List | GET | `/flow/app/v2/list_app` (`be_public`, `order_type` `1`/`2`/`3`, `priority_activity_id`, `mark_type` `1`/`0`) |
|
|
188
186
|
| Activities | GET | `/activity/list` (no `time`) |
|
|
189
187
|
| View | GET | `/flow/app/v3/view_app` |
|
|
190
188
|
| Create | POST | `/flow/app/v3/create_app` |
|
|
@@ -199,6 +197,6 @@ Authoritative field dump (Console repo): `website-sensecraft-console/docs/app-ed
|
|
|
199
197
|
|
|
200
198
|
## Additional resources
|
|
201
199
|
|
|
202
|
-
- [commands.md](commands.md) — CLI flags for every shipped `app` subcommand
|
|
203
|
-
- [
|
|
204
|
-
- [
|
|
200
|
+
- [app-commands.md](app-commands.md) — CLI flags for every shipped `app` subcommand
|
|
201
|
+
- [app-fields.md](app-fields.md) — app info + BOM compliance
|
|
202
|
+
- [tool-blocks.md](tool-blocks.md) — tool-block configs and selection
|
|
@@ -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
|
-
|
|
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** ([
|
|
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
|
-
将从
|
|
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`.
|
|
@@ -18,7 +18,7 @@ Interactive setup wizard (OAuth Device Flow). Obtains an Access Key and writes `
|
|
|
18
18
|
|
|
19
19
|
### Wizard steps
|
|
20
20
|
|
|
21
|
-
1. Select site: Global (International) or China
|
|
21
|
+
1. Select site: Global (International) or China. China supports SenseCraft Data only. SenseCraft AI and CodeCraft Hub require Global.
|
|
22
22
|
2. Browser OAuth Device Flow authorization
|
|
23
23
|
3. Organization selection
|
|
24
24
|
4. Access Key creation
|
|
@@ -47,7 +47,7 @@ Site defaults to Global when omitted. In an interactive terminal, missing `--key
|
|
|
47
47
|
|------|----------|---------|-------------|
|
|
48
48
|
| `--key-id` | Yes* | — | Access Key ID (API ID) |
|
|
49
49
|
| `--access-key` | Yes* | — | Access Key secret |
|
|
50
|
-
| `--site` | No | `Global` | Site: `Global` or `China
|
|
50
|
+
| `--site` | No | `Global` | Site: `Global` or `China`. China is SenseCraft Data only |
|
|
51
51
|
|
|
52
52
|
\* Required unless running interactively (then prompted).
|
|
53
53
|
|
|
@@ -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
|
-
|
|
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
|
-
|
|
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
|
|
|
@@ -37,9 +27,9 @@ Requires Node.js >= 16.
|
|
|
37
27
|
sensecraft-cli auth info
|
|
38
28
|
```
|
|
39
29
|
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
|
|
30
|
+
- SenseCAP Access Key: `sensecraft-cli auth init`
|
|
41
31
|
- 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** ([
|
|
32
|
+
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
33
|
4. **Treat dev kit credentials as secrets** — `device_key` and `token` must not be logged or echoed unnecessarily.
|
|
44
34
|
5. **Parse stdout JSON** on success; on failure read stderr and check exit code != 0.
|
|
45
35
|
6. **LoRaWAN devices** must use the Global (international) site per SenseCAP platform rules.
|
|
@@ -53,7 +43,7 @@ sensecraft-cli auth info
|
|
|
53
43
|
| State | Indicator | Action |
|
|
54
44
|
|-------|-----------|--------|
|
|
55
45
|
| Initialized (SenseCAP) | Output shows SenseCAP `[active]`, Key ID, Site, Organization ID | Proceed with `device` / `group` / `data` |
|
|
56
|
-
| Not initialized | Prompts to run `auth init
|
|
46
|
+
| Not initialized | Prompts to run `auth init` | Ask the user to run `auth init` locally; for existing Access Key use `auth add` |
|
|
57
47
|
|
|
58
48
|
## Configuration
|
|
59
49
|
|
|
@@ -71,6 +61,8 @@ Resolved path priority: `SENSECRAFT_CONFIG_FILE` (absolute or relative to `SENSE
|
|
|
71
61
|
| Global (International) | `https://sensecap.seeed.cc/openapi` |
|
|
72
62
|
| China | `https://sensecap.seeed.cn/openapi` |
|
|
73
63
|
|
|
64
|
+
The China site supports SenseCraft Data only. To use SenseCraft AI or CodeCraft Hub, select Global.
|
|
65
|
+
|
|
74
66
|
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
67
|
|
|
76
68
|
## Output and errors
|
|
@@ -83,7 +75,7 @@ Authentication: HTTP Basic Auth with Key ID (username) and Access Key (password)
|
|
|
83
75
|
|
|
84
76
|
| Group | Command | OpenAPI method & path | Write? |
|
|
85
77
|
|-------|---------|----------------------|--------|
|
|
86
|
-
| auth | `init` | OAuth
|
|
78
|
+
| auth | `init` | OAuth Device Flow; saves an Access Key | Yes |
|
|
87
79
|
| auth | `add` | GET `/view_organization` (verify) + local config | Yes |
|
|
88
80
|
| auth | `info` | Local config only (SenseCAP + AI sections) | No |
|
|
89
81
|
| auth | `refresh` | authapi refreshToken (AI profile only) | Yes |
|
|
@@ -168,7 +160,7 @@ Dev kit OpenAPI endpoints (`/device/create_development_kit`, `/device/view_node_
|
|
|
168
160
|
|
|
169
161
|
## Full command reference
|
|
170
162
|
|
|
171
|
-
Every command, flag, limit, example, and documented response field: **[commands.md](commands.md)**
|
|
163
|
+
Every command, flag, limit, example, and documented response field: **[data-commands.md](data-commands.md)**
|
|
172
164
|
|
|
173
165
|
## External references
|
|
174
166
|
|
|
@@ -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
|
|
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 [
|
|
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.
|
package/skills/{sensecraft-models/commands.md → sensecraft-cli/references/model-commands.md}
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# sensecraft-models — CLI commands
|
|
2
2
|
|
|
3
|
-
Binary: `sensecraft-cli`. Auth: **Access Key** (`auth init
|
|
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
|
|
|
@@ -9,7 +9,7 @@ Binary: `sensecraft-cli`. Auth: **Access Key** (`auth init --kind sensecap`) →
|
|
|
9
9
|
```bash
|
|
10
10
|
sensecraft-cli auth info
|
|
11
11
|
# user-only:
|
|
12
|
-
sensecraft-cli auth init
|
|
12
|
+
sensecraft-cli auth init
|
|
13
13
|
```
|
|
14
14
|
|
|
15
15
|
## Commands
|
|
@@ -39,7 +39,7 @@ sensecraft-cli model list --mine --uniform-type 40
|
|
|
39
39
|
sensecraft-cli model list --mine --name "custom"
|
|
40
40
|
```
|
|
41
41
|
|
|
42
|
-
Classic reCamera (`40`) pick-and-open: [
|
|
42
|
+
Classic reCamera (`40`) pick-and-open: [recamera-commands.md](recamera-commands.md). Do not `cloud deploy` those models.
|
|
43
43
|
|
|
44
44
|
### `model view --id <id>`
|
|
45
45
|
|
|
@@ -130,7 +130,7 @@ sensecraft-cli model upload --path ./model.rknn --unlinked
|
|
|
130
130
|
|
|
131
131
|
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
132
|
|
|
133
|
-
reCamera Pro is detected automatically when an `adapteds` entry resolves to `uniform_type=53`; `--target recamera-pro` is only an extra assertion. See [
|
|
133
|
+
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
134
|
|
|
135
135
|
`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
136
|
|
|
@@ -153,7 +153,7 @@ sensecraft-cli model update --id <model_id> --path ./model.tflite --from-json ./
|
|
|
153
153
|
| `publish` | `1` |
|
|
154
154
|
| `unpublish` | `0` |
|
|
155
155
|
|
|
156
|
-
Require a **separate chat confirmation** (see [
|
|
156
|
+
Require a **separate chat confirmation** (see [confirmation.md](confirmation.md)), then `--yes`. 「发布这个 / 下架 / 删这个」is intent — ask first.
|
|
157
157
|
|
|
158
158
|
```bash
|
|
159
159
|
# After the user replies 确认:
|
|
@@ -1,19 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
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
|
|
26
|
-
2. **L2 confirm is a separate chat turn** ([
|
|
15
|
+
Prefer **SenseCAP Access Key** (`auth init`) → `{ai-host}/openapi` Basic. Missing key → user runs `auth init`. **Never** run init for them.
|
|
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`](
|
|
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`](
|
|
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
|
-
|
|
|
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 [
|
|
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 [
|
|
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 [
|
|
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: [
|
|
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
|
-
- [
|
|
185
|
+
- [model-commands.md](model-commands.md)
|
|
186
|
+
- [model-fields.md](model-fields.md)
|
package/skills/{sensecraft-recamera/commands.md → sensecraft-cli/references/recamera-commands.md}
RENAMED
|
@@ -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
|
|
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
|
|
11
|
+
sensecraft-cli auth init # user only, interactive
|
|
12
12
|
```
|
|
13
13
|
|
|
14
14
|
## List (existing commands)
|
|
@@ -55,7 +55,7 @@ Runs the same check, then opens `console_url` (or prints it). Sandbox never open
|
|
|
55
55
|
| Flag | Required | Notes |
|
|
56
56
|
| ------------- | -------- | --------------------------------------------- |
|
|
57
57
|
| `--model-id` | one of | Model detail = AI deploy page (click 部署) |
|
|
58
|
-
| `--app-id` | one of | App detail; plaza omits `from=
|
|
58
|
+
| `--app-id` | one of | App detail; plaza omits `from=user-center` |
|
|
59
59
|
| `--print-only`| no | Print URL only |
|
|
60
60
|
| `--sandbox` | no | Sample JSON; never open a browser |
|
|
61
61
|
|
|
@@ -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://
|
|
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
|
-
|
|
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
|
-
|
|
14
|
-
|
|
15
|
-
|
|
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
|
|
17
|
+
Need **SenseCAP Access Key** (`auth init`) for `app` / `model` / `recamera`. Never run init for them.
|
|
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
|
package/skills/{sensecraft-apps/reference-tool-blocks.md → sensecraft-cli/references/tool-blocks.md}
RENAMED
|
@@ -6,9 +6,9 @@ Help the Agent choose the right block and fill `config` safely. Execution on har
|
|
|
6
6
|
|
|
7
7
|
The editor does **not** render Markdown on read. Preview wraps each block by `type` and treats `content` as HTML or plain text. Raw `**bold**`, `# heading`, or `- item` inside `content` shows up as those characters.
|
|
8
8
|
|
|
9
|
-
Write inline formatting as HTML: `<strong>`, `<em>`, `<code>`, `<s>`,
|
|
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
|
-
|
|
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": "
|
|
197
|
+
"content": "Connect the board over USB, then flash.",
|
|
182
198
|
"indent": 0
|
|
183
199
|
},
|
|
184
200
|
{
|