@seeed-studio/sensecraft-cli 0.1.5 → 0.2.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 +3 -1
- package/package.json +1 -1
- package/skills/confirmation.md +4 -4
- package/skills/sensecraft-ai/SKILL.md +9 -8
- package/skills/sensecraft-apps/SKILL.md +18 -23
- package/skills/sensecraft-apps/commands.md +13 -29
- package/skills/sensecraft-apps/reference-app-fields.md +2 -0
- package/skills/sensecraft-apps/reference-tool-blocks.md +66 -16
- package/skills/sensecraft-models/SKILL.md +2 -2
- package/skills/sensecraft-recamera/SKILL.md +2 -3
- package/skills/sensecraft-recamera/commands.md +0 -8
package/INSTALL.md
CHANGED
|
@@ -172,7 +172,9 @@ sensecraft-cli update --check # 只查询,不安装
|
|
|
172
172
|
npm install -g @seeed-studio/sensecraft-cli@latest
|
|
173
173
|
```
|
|
174
174
|
|
|
175
|
-
平时使用其它命令时,如果缓存里发现了更新,结束时会在 stderr 提示运行 `sensecraft-cli update
|
|
175
|
+
平时使用其它命令时,如果缓存里发现了更新,结束时会在 stderr 提示运行 `sensecraft-cli update`。同一版本 24 小时内只提示一次,出现更新的版本会再提示。24 小时内不会重复访问 npm。本地 `dev` 构建、CI、以及设置了 `SENSECRAFT_CLI_NO_UPDATE_NOTIFIER` 时不提示。
|
|
176
|
+
|
|
177
|
+
进行中的活动也在 stderr 以 `Notice:` 提醒,名称、日期和详情链接来自 `https://api-gateway.seeed.cc/openapi/activity/list`(不带参数,即尚未结束的活动)。24 小时内只提醒一次。交互终端会问 `Ignore this activity? [y/N]`,回答 `y` 之后按 `activity_id` 不再提醒;回答 `n` 时 24 小时后还会再出现。非交互只打印,不提问,也不记成忽略。CI 以及 `SENSECRAFT_CLI_NO_ACTIVITY_NOTIFIER` 时不提醒。
|
|
176
178
|
|
|
177
179
|
当前程序如果不是 npm 安装的(例如直接运行编译出的二进制),`update` 只打印上面的手动安装命令,不会覆盖正在运行的文件。
|
|
178
180
|
|
package/package.json
CHANGED
package/skills/confirmation.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# L2 confirmation protocol (mandatory)
|
|
2
2
|
|
|
3
|
-
`--yes` / `--agree-declaration`
|
|
3
|
+
`--yes` / `--agree-declaration` mean **the user already answered a confirmation question in this conversation**. They are not shortcuts.
|
|
4
4
|
|
|
5
5
|
## First user request is INTENT, not confirmation
|
|
6
6
|
|
|
@@ -8,13 +8,13 @@ These are **not** confirmation. Do **not** pass `--yes` on the same turn:
|
|
|
8
8
|
|
|
9
9
|
- 「删这个63760」「删除应用 demo」「把模型下架」「发布这个模型」
|
|
10
10
|
- 「delete this」「unpublish」「deploy to the device」
|
|
11
|
-
- Any first mention of create / modify /
|
|
11
|
+
- Any first mention of create / modify / publish / unpublish / delete / deploy / stop / bind / unbind
|
|
12
12
|
|
|
13
13
|
## Required chat question (before any L2 CLI)
|
|
14
14
|
|
|
15
15
|
Ask in chat. **Do not run** the write command yet. The question MUST include at least:
|
|
16
16
|
|
|
17
|
-
1. **操作类型** — 删除 / 发布 / 私有化 / 部署 / 停止 /
|
|
17
|
+
1. **操作类型** — 删除 / 发布 / 私有化 / 部署 / 停止 / 修改 / 绑定 / …
|
|
18
18
|
2. **环境** — `auth info` 的 Global / China(生产环境须点明)
|
|
19
19
|
3. **对象** — 名称 + ID(没有名称就先 `view` / `list` 再问)
|
|
20
20
|
|
|
@@ -53,4 +53,4 @@ sensecraft-cli model delete --id 63760 --yes
|
|
|
53
53
|
|
|
54
54
|
## After the user confirms
|
|
55
55
|
|
|
56
|
-
Then pass `--yes` (and `--agree-declaration`
|
|
56
|
+
Then pass `--yes` (and `--agree-declaration` only if they also agreed to that legal text).
|
|
@@ -28,7 +28,7 @@ Sibling (already shipped): [`../sensecraft-data/SKILL.md`](../sensecraft-data/SK
|
|
|
28
28
|
```bash
|
|
29
29
|
sensecraft-cli auth init --kind sensecap # Access Key (app/model/file/cloud/recamera)
|
|
30
30
|
```
|
|
31
|
-
4. **L2 confirmation is a separate chat turn** — follow [`../confirmation.md`](../confirmation.md). 「删这个63760」/「删除应用 demo」is **intent, not confirmation**. Ask first (操作类型 + 环境 + 对象 ID), wait for `确认`/`confirm`, **then** `--yes`. Never add `--yes` on the same turn as the first request. Applies to: app/model create·update·publish·unpublish·delete
|
|
31
|
+
4. **L2 confirmation is a separate chat turn** — follow [`../confirmation.md`](../confirmation.md). 「删这个63760」/「删除应用 demo」is **intent, not confirmation**. Ask first (操作类型 + 环境 + 对象 ID), wait for `确认`/`confirm`, **then** `--yes`. Never add `--yes` on the same turn as the first request. Applies to: app/model create·update·publish·unpublish·delete, upload attach, cloud deploy, device bind/unbind, group create/rename/delete/move.
|
|
32
32
|
5. **Treat tokens and keys as secrets** — do not echo full `access_token`, `refresh_token`, or `access_key`. **Public model artifacts are not downloadable** — if the user asks for 下载地址 / 下载链接 / download URL / 怎么下载, that is the same as asking for `file_url`: refuse the address, explain deploy-only (`cloud deploy` or Console). Never run `model download --url-only` on public models.
|
|
33
33
|
6. **Success = indented JSON on stdout**; failure = stderr + non-zero exit. Parse stdout only on success.
|
|
34
34
|
7. **Local USB / IP flashing is L3** — do not pretend remote auto-flash. Classic reCamera (`40`): [`sensecraft-recamera`](../sensecraft-recamera/SKILL.md) (`check` / `open` the AI deploy page). Other USB benches: Console `/ai/device/local/32|36|37|41|52`. Do **not** use `/ai/recamera` (it 301s to Grove `36`) or `/ai/device/local/40` (no such bench).
|
|
@@ -44,10 +44,12 @@ Sibling (already shipped): [`../sensecraft-data/SKILL.md`](../sensecraft-data/SK
|
|
|
44
44
|
|
|
45
45
|
| `remote_type` | AI openapi | Account center |
|
|
46
46
|
|---------------|------------|----------------|
|
|
47
|
-
| `Global` | `https://
|
|
48
|
-
| `China` | `https://
|
|
47
|
+
| `Global` | `https://api-gateway.seeed.cc/openapi` | `account.seeed.cc/authapi` |
|
|
48
|
+
| `China` | `https://api-gateway.seeed.cc/openapi` | `account.seeed.cn/authapi` |
|
|
49
49
|
|
|
50
|
-
China 与 Global 使用同一个 AI host
|
|
50
|
+
China 与 Global 使用同一个 AI host,账号中心不同。网页控制台仍是 `https://sensecraft.seeed.cc`。`SENSECRAFT_AUTH_HOST` 盖住账号中心(设备码、换 token、换 Access Key);设了之后 Global / China 都打到这个站点根,浏览器打开的是该服务返回的验证地址。
|
|
51
|
+
|
|
52
|
+
成功命令结束后,stderr 可能各有一条英文提示,同一条 24 小时内只出现一次。看到 `Warning: A new version of sensecraft-cli (<version>)` 时,完成当前请求后可以建议用户运行 `sensecraft-cli update`。看到 `Notice: SenseCraft AI is hosting the <name> activity` 时,把活动名称、日期和链接告诉用户。交互终端会问 `Ignore this activity? [y/N]`;用户回答 `y` 之后,这条活动不再提醒。不要替用户打开链接。
|
|
51
53
|
|
|
52
54
|
`auth info` shows the active Access Key (site, org, key id). Secrets are not printed.
|
|
53
55
|
|
|
@@ -58,7 +60,7 @@ China 与 Global 使用同一个 AI host,账号中心不同。
|
|
|
58
60
|
| SenseCAP list/bind device, groups, telemetry | [`sensecraft-data`](../sensecraft-data/SKILL.md) | `sensecap` | Shipped today |
|
|
59
61
|
| Browse / search App Plaza, view app | [`sensecraft-apps`](../sensecraft-apps/SKILL.md) + `app list` / `app view` | `sensecap` | **CLI shipped** (list/view) |
|
|
60
62
|
| App fields / tool-blocks / BOM guidance | same apps skill references | `sensecap` | Config OK; real flash = L3 |
|
|
61
|
-
|
|
|
63
|
+
| Create / update / publish / unpublish / delete / bom app | same + `app …` / `app bom …` | `sensecap` | **CLI shipped** (L2 `--yes`; publish also `--agree-declaration`; bare `create --name` not L2) |
|
|
62
64
|
| Upload image/file/firmware/doc/archive and obtain `file_url` | [`sensecraft-files`](../sensecraft-files/SKILL.md) + `file upload` | `sensecap` | Types `1`–`2` require `--model-id`/`--app-id --yes`/`--for-app`/`--unlinked`; types `3`–`6` direct |
|
|
63
65
|
| Model library search/view/download/constants | [`sensecraft-models`](../sensecraft-models/SKILL.md) | `sensecap` | **CLI shipped** |
|
|
64
66
|
| Upload / publish / unpublish / delete model | same + `model upload --id --yes` / `create\|update\|publish\|unpublish\|delete` | `sensecap` | Attach bumps patch version like Console |
|
|
@@ -87,14 +89,13 @@ SenseCAP telemetry → pick public model → deploy to Jetson:
|
|
|
87
89
|
| 模型下载地址 / 下载链接 / 怎么下载 | Public library artifact URL vs private owner file | **Public → no URL**, explain deploy; private My Models → `model download --out` (do not paste URL) |
|
|
88
90
|
| Data | SenseCAP telemetry vs training dataset | Telemetry → **sensecraft-data**; dataset → Console |
|
|
89
91
|
| Agent | Watcher Agent vs in-console AI Bot vs these Skills | These Skills ≠ Bot; Watcher has separate auth |
|
|
90
|
-
| Clone vs Install | Clone to My Apps vs install on a device | **Clone** = App Plaza |
|
|
91
92
|
|
|
92
93
|
## Capability levels
|
|
93
94
|
|
|
94
95
|
| Level | Meaning | Examples |
|
|
95
96
|
|-------|---------|----------|
|
|
96
97
|
| L1 Scriptable | Agent may run directly | list / view / auth info |
|
|
97
|
-
| L2 Confirm | Ask user first |
|
|
98
|
+
| L2 Confirm | Ask user first | publish (+ declaration), unpublish, delete, deploy |
|
|
98
99
|
| L3 Interactive | Human-in-the-loop | `auth init`, Web Serial flash, payment |
|
|
99
100
|
| L4 Ops-only | Do not expose to end-user Agent | Admin `judge_app` |
|
|
100
101
|
|
|
@@ -102,7 +103,7 @@ SenseCAP telemetry → pick public model → deploy to Jetson:
|
|
|
102
103
|
|
|
103
104
|
Published commands use **SenseCAP Access Key** (`kind=sensecap`) → `{ai-host}/openapi`:
|
|
104
105
|
|
|
105
|
-
1. **Apps** — list/view/fields/blocks; create/update
|
|
106
|
+
1. **Apps** — list/view/fields/blocks; create/update; publish/unpublish/delete (L2); BOM search/list/set; tool-block config via JSON (real flash = L3).
|
|
106
107
|
2. **Files** — `file upload` for image/model/app/firmware/doc/archive; types 1–2 require `--model-id` / `--app-id --yes` / `--for-app` / `--unlinked` before PUT (bare upload fails).
|
|
107
108
|
3. **Model library** — list/view/constants; **private** download only; public models deploy-only (no `file_url`); `model upload --id --yes` attaches and auto-bumps patch version; create/update; publish/unpublish/delete (L2).
|
|
108
109
|
4. **Cloud devices** — `cloud device` / `cloud deploy` / `cloud order`.
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
name: sensecraft-apps
|
|
3
3
|
description: >-
|
|
4
4
|
Manages SenseCraft Application Plaza (应用广场 / App Square): search public apps,
|
|
5
|
-
view detail (docs, tool-blocks, BOM),
|
|
5
|
+
view detail (docs, tool-blocks, BOM), create/edit/publish/
|
|
6
6
|
unpublish/delete apps. Use when the user mentions 应用广场, Application Store,
|
|
7
|
-
|
|
7
|
+
app BOM, deploy tool-blocks, or SenseCraft app upload.
|
|
8
8
|
Requires Access Key (`auth init --kind sensecap`). Not for SenseCAP devices.
|
|
9
9
|
---
|
|
10
10
|
|
|
@@ -22,15 +22,14 @@ SenseCAP IoT: [`../sensecraft-data/SKILL.md`](../sensecraft-data/SKILL.md).
|
|
|
22
22
|
sensecraft-cli auth info
|
|
23
23
|
```
|
|
24
24
|
Need an active **SenseCAP Access Key**. If missing, ask the user to run `sensecraft-cli auth init --kind sensecap` locally. **Never** run `auth init` for them.
|
|
25
|
-
2. **L2 confirm is a separate chat turn** ([`../confirmation.md`](../confirmation.md)) before: `
|
|
25
|
+
2. **L2 confirm is a separate chat turn** ([`../confirmation.md`](../confirmation.md)) before: `publish` (`--agree-declaration`), `unpublish`, `delete`, **`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.
|
|
26
26
|
**`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.
|
|
27
27
|
3. **Privacy values**: submit review → `privacy` / flow uses **`2`** (pending); unpublish/private → **`0`**. **Never send `1`** (ops-approved public; Admin only).
|
|
28
|
-
4. **
|
|
29
|
-
5.
|
|
30
|
-
6.
|
|
31
|
-
7. **
|
|
32
|
-
8. **
|
|
33
|
-
9. **Never blind-retry `app create`**: names are not unique. If create output lacks `app_id` or looks empty, run `app list --mine` before creating again.
|
|
28
|
+
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`](../sensecraft-recamera/SKILL.md) (`check` / `open`). Other benches: Console `/ai/device/local/32|36|37|41|52`. `flash-firmware` run is out of scope this pass.
|
|
29
|
+
5. Parse indented JSON on stdout; on failure read stderr + exit code. After `app update`, **re-read** the app — success body may be `{}`.
|
|
30
|
+
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`.
|
|
31
|
+
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`.
|
|
32
|
+
8. **Never blind-retry `app create`**: names are not unique. If create output lacks `app_id` or looks empty, run `app list --mine` before creating again.
|
|
34
33
|
|
|
35
34
|
## CLI status
|
|
36
35
|
|
|
@@ -38,7 +37,7 @@ SenseCAP IoT: [`../sensecraft-data/SKILL.md`](../sensecraft-data/SKILL.md).
|
|
|
38
37
|
| ---------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
39
38
|
| Auth `--kind sensecap` | **Implemented** (`auth init --kind sensecap`; `app` uses `{ai-host}/openapi` Basic) |
|
|
40
39
|
| `app list` / `app view` / `app fields` / `app blocks` | **Implemented** |
|
|
41
|
-
| `app
|
|
40
|
+
| `app create` / `update` / `publish` / `unpublish` / `delete` | **Implemented** (L2 = `--yes`; publish also `--agree-declaration`; **`create` never needs `--yes`**, even with full `--from-json`) |
|
|
42
41
|
| 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. |
|
|
43
42
|
| `app bom search\|list\|set` | **Implemented** (catalog = local filter on `get_production_options`; set via `update_app`) |
|
|
44
43
|
| `scene` / option ids | Use `sensecraft-cli model constants` (`app_scenarios_array`) |
|
|
@@ -60,17 +59,6 @@ sensecraft-cli app view --id <app_id>
|
|
|
60
59
|
|
|
61
60
|
Summarize: name, excerpt, scene, tool-block types used, BOM highlights, deploy steps.
|
|
62
61
|
|
|
63
|
-
### Clone to My Apps (L2)
|
|
64
|
-
|
|
65
|
-
```bash
|
|
66
|
-
# 1) Show Disclaimer for Use, get explicit agreement
|
|
67
|
-
# 2) Confirm clone, then:
|
|
68
|
-
sensecraft-cli app clone --id <app_id> --agree-disclaimer --yes
|
|
69
|
-
sensecraft-cli app clone --id <app_id> --name "Clone_MyName" --agree-disclaimer --yes
|
|
70
|
-
```
|
|
71
|
-
|
|
72
|
-
`app clone` matches Console 「克隆应用」: show https://sensecraft.seeed.cc/legal/en/disclaimer (使用免责声明) and only then pass `--agree-disclaimer --yes`. Missing either flag → non-zero. API body is still only `{app_id, app_name}` (agreement is client-side, like Console `disclaimerAccepted`). Clone copies the app into My Apps; it does not install it onto a device.
|
|
73
|
-
|
|
74
62
|
### Rename an existing app (L2)
|
|
75
63
|
|
|
76
64
|
```bash
|
|
@@ -80,6 +68,14 @@ echo '{"app_name":"Dimmer Tutorial · Grove Beginner Kit"}' \
|
|
|
80
68
|
sensecraft-cli app view --id <app_id> --sketch # must show new app_name
|
|
81
69
|
```
|
|
82
70
|
|
|
71
|
+
### Join an activity (L2)
|
|
72
|
+
|
|
73
|
+
```bash
|
|
74
|
+
sensecraft-cli app update --id <app_id> --activity-id 1 --yes
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
`activity_id` is an optional positive integer. 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`).
|
|
78
|
+
|
|
83
79
|
### Publish / unpublish / delete (L2)
|
|
84
80
|
|
|
85
81
|
```bash
|
|
@@ -163,7 +159,7 @@ Structure: `deployment.blocks` flat array.
|
|
|
163
159
|
| `flash-firmware` | Burn firmware to supported board | Config = L1/L2 write; **run flash = L3** |
|
|
164
160
|
| `deploy-ai-model` | Vision / audio AI model to device (task/device in config) | Config OK; **run deploy = L3** |
|
|
165
161
|
| `ai-vibration` | Vibration detection on XIAO-class device | Config OK; run = L3 |
|
|
166
|
-
| `deploy-container-app` | Edge container app in the app doc | Config OK;
|
|
162
|
+
| `deploy-container-app` | Edge container app in the app doc | Config OK; installing the container is L3 |
|
|
167
163
|
| `node-red` / `aily-blockly` | Flow / Blockly projects | Lower priority unless user asks |
|
|
168
164
|
|
|
169
165
|
Details: [reference-tool-blocks.md](reference-tool-blocks.md).
|
|
@@ -185,7 +181,6 @@ Base: `{host}/openapi` with HTTP Basic (`key_id`:`access_key`).
|
|
|
185
181
|
| View | GET | `/flow/app/v3/view_app` |
|
|
186
182
|
| Create | POST | `/flow/app/v3/create_app` |
|
|
187
183
|
| Update | POST | `/flow/app/v3/update_app` |
|
|
188
|
-
| Clone | POST | `/flow/app/v3/clone_app` |
|
|
189
184
|
| Privacy | POST | `/flow/app/v3/edit_privacy_app` (`2` submit / `0` private) |
|
|
190
185
|
| Delete | POST | `/flow/app/v2/delete_app` (confirm path in code when wiring CLI) |
|
|
191
186
|
|
|
@@ -72,28 +72,6 @@ sensecraft-cli app fields
|
|
|
72
72
|
sensecraft-cli app blocks
|
|
73
73
|
```
|
|
74
74
|
|
|
75
|
-
### `app clone` (L2)
|
|
76
|
-
|
|
77
|
-
**Status: implemented.**
|
|
78
|
-
|
|
79
|
-
| Flag | Required |
|
|
80
|
-
| -------------------- | ------------------------------------------- |
|
|
81
|
-
| `--id` | yes |
|
|
82
|
-
| `--name` | no (default `Clone_<source app_name>`) |
|
|
83
|
-
| `--agree-disclaimer` | **after** user agrees to Disclaimer for Use |
|
|
84
|
-
| `--yes` | **after** user confirmation |
|
|
85
|
-
| `--sandbox` | sample JSON |
|
|
86
|
-
|
|
87
|
-
Matches Console 「克隆应用」`disclaimerAccepted`. Before passing `--agree-disclaimer`, show the user:
|
|
88
|
-
|
|
89
|
-
- https://sensecraft.seeed.cc/legal/en/disclaimer
|
|
90
|
-
- Do **not** pass `--agree-disclaimer` unless the user explicitly agreed (checkbox equivalent)
|
|
91
|
-
|
|
92
|
-
```bash
|
|
93
|
-
# Ask the user to agree to the disclaimer, then confirm:
|
|
94
|
-
sensecraft-cli app clone --id <source_app_id> --name "My Clone" --agree-disclaimer --yes
|
|
95
|
-
```
|
|
96
|
-
|
|
97
75
|
### `app create` / `app update`
|
|
98
76
|
|
|
99
77
|
**Status: implemented.**
|
|
@@ -130,14 +108,15 @@ sensecraft-cli app create --name "My App"
|
|
|
130
108
|
|
|
131
109
|
#### `app update` (L2)
|
|
132
110
|
|
|
133
|
-
| Flag
|
|
134
|
-
|
|
|
135
|
-
| `--id`
|
|
136
|
-
| `--from-json`
|
|
137
|
-
| `--
|
|
138
|
-
| `--
|
|
111
|
+
| Flag | Notes |
|
|
112
|
+
| --------------- | ---------------------------------------------------------------------------------------------------------- |
|
|
113
|
+
| `--id` | required |
|
|
114
|
+
| `--from-json` | path or `-`; required unless `--activity-id` is set |
|
|
115
|
+
| `--activity-id` | optional positive integer. Joins that activity. Omit or pass empty to leave existing activity tags as-is |
|
|
116
|
+
| `--yes` | after user confirmation |
|
|
117
|
+
| `--sandbox` | sample JSON |
|
|
139
118
|
|
|
140
|
-
Rejects `be_public=1` / `privacy=1` in **user** payload. If the app is already public (`be_public=1`), CLI injects `be_public=1` on info saves (Console) and JSON includes `sketch_saved`. Under review (`be_public=2`): **refused**. Others' apps (`user_id` ≠ profile): **refused
|
|
119
|
+
Rejects `be_public=1` / `privacy=1` in **user** payload. If the app is already public (`be_public=1`), CLI injects `be_public=1` on info saves (Console) and JSON includes `sketch_saved`. Under review (`be_public=2`): **refused**. Others' apps (`user_id` ≠ profile): **refused**.
|
|
141
120
|
|
|
142
121
|
**Info patch merge:** if `--from-json` touches any of `app_name` / `excerpt` / `scene` / `allow_clone` / `allow_commerce` / `images` / `license` / `author`, CLI loads `view_app` (sketch) and fills missing info keys before `update_app`. Sparse `{"app_name":"…"}` rename is OK. Materials/deployment-only JSON is **not** force-merged with info. Private info saves still do **not** copy `be_public` from the existing view.
|
|
143
122
|
|
|
@@ -150,8 +129,13 @@ echo '{"app_name":"New Name"}' | sensecraft-cli app update --id <app_id> --from-
|
|
|
150
129
|
sensecraft-cli app view --id <app_id> --sketch # confirm app_name
|
|
151
130
|
|
|
152
131
|
sensecraft-cli app update --id <app_id> --from-json ./app.json --yes
|
|
132
|
+
|
|
133
|
+
# Join activity 1. activity_id is sent as a JSON number. tags in JSON is dropped.
|
|
134
|
+
sensecraft-cli app update --id <app_id> --activity-id 1 --yes
|
|
153
135
|
```
|
|
154
136
|
|
|
137
|
+
`activity_id` must be a positive integer. The server rejects anything else with `11202` `Request parameters are invalid`, and rejects a missing, unpublished, deleted, or out-of-window activity with `25000` `Activity does not exist or has expired`. Either failure discards the whole edit, including other fields in the same request. Omitting `activity_id` does not change existing activity tags. `tags` is not read by the server.
|
|
138
|
+
|
|
155
139
|
### `app publish` / `app unpublish` / `app delete` (L2)
|
|
156
140
|
|
|
157
141
|
**Status: implemented.**
|
|
@@ -17,6 +17,7 @@ Agent fill-in guide for SenseCraft custom apps (v3). Aligns with Console `infoFo
|
|
|
17
17
|
| `app_id` | id | required on update | from create/list/view |
|
|
18
18
|
| `introduction` | legacy long text | no | if non-empty, editor may merge into intro blocks — prefer `deployment.blocks` for new content |
|
|
19
19
|
| `author` | string | recommended on save | current user id/account |
|
|
20
|
+
| `activity_id` | positive integer | no | Join this activity. Omit or send blank to leave existing activity tags unchanged. CLI sends a JSON number. `0`, negatives, and non-integers are rejected before POST. Server: not a positive integer → `11202` `Request parameters are invalid`; missing / unpublished / deleted / outside start–end → `25000` `Activity does not exist or has expired` (the whole edit is discarded). |
|
|
20
21
|
| `flow_data` / `model_data` | Node-RED sync | only with `node-red` block | `flow_data` must be **JSON string** at top level |
|
|
21
22
|
|
|
22
23
|
### Create vs update
|
|
@@ -27,6 +28,7 @@ Agent fill-in guide for SenseCraft custom apps (v3). Aligns with Console `infoFo
|
|
|
27
28
|
- **Update (`app update`)**: always include `app_id` (CLI `--id`).
|
|
28
29
|
- **Info fields** (`app_name`, `excerpt`, `scene`, `allow_clone`, `allow_commerce`, `images`, `license`, `author`): aiserver often **ignores** a body that only contains `app_name`. CLI **auto-merges** missing info keys from `app view --sketch` before calling `update_app` (does **not** merge `be_public` from user/existing for private apps). If current `be_public=1`, CLI **injects** `be_public=1` like Console info save (plaza unchanged until `app publish`). `be_public=2` refuses update. Agents may pass a sparse rename patch; still **re-read** with `app view` / `app list` after update because success may be `{}`.
|
|
29
30
|
- **Other sections** (`deployment`, `materials`, …): may be sent alone without forcing an info merge. Full leave-save usually sends info + deployment + materials together.
|
|
31
|
+
- **Activity**: `--activity-id <positive integer>` or JSON `activity_id`. Do not send `tags`; the server ignores it and the CLI strips it. A blank `activity_id` is omitted.
|
|
30
32
|
- **Rename workflow**: confirm with user (L2) → `app update --id … --from-json '{"app_name":"…"}' --yes` (CLI fills the rest) → verify name via `app view --id … --sketch` or `app list --mine --name …`.
|
|
31
33
|
|
|
32
34
|
## Visibility / review
|
|
@@ -30,7 +30,7 @@ Prefer `paragraph` under a `step` for instructions; do not overload tool-block `
|
|
|
30
30
|
| High | `flash-firmware` | User must burn a firmware image to a board | They only need model deploy |
|
|
31
31
|
| High | `deploy-ai-model` | Vision classify/detect or audio model on SenseCraft devices | Pure vibration → `ai-vibration`; pure firmware → `flash-firmware` |
|
|
32
32
|
| High | `ai-vibration` | Abnormal vibration detection flow | General vision/audio models |
|
|
33
|
-
| High | `deploy-container-app` | Edge **container** app deploy UX in the doc | Confusing with
|
|
33
|
+
| High | `deploy-container-app` | Edge **container** app deploy UX in the doc | Confusing it with a SenseCAP device bind |
|
|
34
34
|
| Lower | `node-red` | Node-RED flow + optional model binding | No flow artifact |
|
|
35
35
|
| Lower | `aily-blockly` | Aily Blockly public project | No project id |
|
|
36
36
|
|
|
@@ -40,14 +40,62 @@ Multiple tool-blocks may appear in one step (e.g. paragraph → flash → paragr
|
|
|
40
40
|
|
|
41
41
|
### `flash-firmware`
|
|
42
42
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
|
46
|
-
|
|
47
|
-
| `
|
|
48
|
-
| `
|
|
49
|
-
|
|
50
|
-
|
|
43
|
+
Write these as **flat fields** on the block. The editor wraps them into `config` when it reloads the doc. Do not nest them under `config` in `app create` / `app update`.
|
|
44
|
+
|
|
45
|
+
| Field | How to write |
|
|
46
|
+
|-------|----------------|
|
|
47
|
+
| `device_id` | Material SKU string, e.g. `"100017057"`. Not a production type id (`"29"`) and not the material row `id` |
|
|
48
|
+
| `device_type` | `uniform_type` string. Use `""` when the board has none (Wio / Grove may) |
|
|
49
|
+
| `flash_mode` | `"bin"` when a firmware URL is set. `"zip"` for a project zip |
|
|
50
|
+
| `firmware_url` / `firmware_name` / `firmware_size` | Bin mode. `firmware_size` is a string, not a number. Empty `firmware_name` is filled from the URL by the editor |
|
|
51
|
+
| `flash_address` | Only `"0x0"`, `"0x4000"`, `"0x10000"`, `"0x90000"`. Use the device default below. The editor resets a non-default address the first time the doc is opened. Do not write `0x20000` here |
|
|
52
|
+
| `project_zip_url` / `project_zip_name` / `project_zip_size` / `precheck_fields` | Zip mode only. Sizes are strings. `precheck_fields` is `[{ key, name, info, type, default }]` from `sensecraft_config.h`, or omit / `[]` |
|
|
53
|
+
| `muse_gadget` | Boolean, default `false`. A missing field is `false`. `"true"` and `1` are read as `true`. `true` shows the Muse SDK token input under the flash button in preview |
|
|
54
|
+
|
|
55
|
+
`muse_gadget: true` is kept only for these SKUs. Any other device written `true` is reset to `false` by the editor:
|
|
56
|
+
|
|
57
|
+
| Device | `device_id` (SKU) |
|
|
58
|
+
|--------|-------------------|
|
|
59
|
+
| SenseCAP Indicator D1 / D1S / D1L / D1Pro | `114993068` (aliases on the same row are kept) |
|
|
60
|
+
| SenseCAP Watcher | `113991315` or `113991275` |
|
|
61
|
+
| reTerminal E1001 | `100073581` |
|
|
62
|
+
| reTerminal E1002 | `100017057` |
|
|
63
|
+
| XIAO 1.47" Touch Display | `100069905` |
|
|
64
|
+
| reTerminal Sticky | `100056818` |
|
|
65
|
+
|
|
66
|
+
When `muse_gadget` is `true`, `firmware_url` must be `muse-gadget.bin` linked at `0x20000`. A binary linked at `0x90000` or `0x10000` will not boot. Checking the box does not change `flash_address`: E100x stays `0x90000`, Sticky / Indicator / 1.47" Touch stay `0x0`, Watcher stays on the XIAO address rule.
|
|
67
|
+
|
|
68
|
+
Do **not** write an SDK token (`mgst_…`), `flash_target`, `flash_address_adapted`, or the bootloader, partition table, OTA, and PHY addresses and files. The app site supplies those. A token stays in the browser session. Watcher fills `flash_target` with `"xiao"` on open; do not write `"himax"`.
|
|
69
|
+
|
|
70
|
+
Checked Muse flash differences are documentation only. Do not implement them in the CLI:
|
|
71
|
+
|
|
72
|
+
| Device | Layout | Serial / reset |
|
|
73
|
+
|--------|--------|----------------|
|
|
74
|
+
| E1001 / E1002 / Indicator | Five segments, no full-chip erase: `0x0` bootloader, `0x10000` partition table, `0x17000` OTA, `0x19000` PHY, app at `0x20000` | E1001 / E1002 do not auto-reset after the write |
|
|
75
|
+
| Watcher | Four segments, no PHY, no full-chip erase: `0x0`, `0x10000`, OTA `0x1D000`, app `0x20000`. Back up `nvsfactory` from `0x9000` for length `0x32000` first | `1a86:55d2` |
|
|
76
|
+
| Sticky | Same four segments as Watcher, its own bootloader, no `nvsfactory` backup | Checked: `1a86:55d3`. Unchecked: no USB restriction, one merged image from `0x0` |
|
|
77
|
+
| 1.47" Touch | Same four segments as Watcher, its own bootloader, no `nvsfactory` backup | `303a:1001`. Does not auto-reset after the write |
|
|
78
|
+
|
|
79
|
+
Unchecked `muse_gadget` keeps the single-file device table below and does not require a token.
|
|
80
|
+
|
|
81
|
+
| Device | `device_id` (SKU) | `flash_mode` | `flash_address` | File |
|
|
82
|
+
|--------|-------------------|--------------|-----------------|------|
|
|
83
|
+
| XIAO ESP32C3 | `113991054` | `bin` or `zip` | URL contains `application` → `0x10000`, otherwise `0x0` | `.bin` or zip |
|
|
84
|
+
| XIAO ESP32C6 / S3 / S3 Plus | matching SKU (`material.device_id` empty; row comes from `app_block_options`) | same as C3 | same as C3 | same as C3 |
|
|
85
|
+
| XIAO ESP32S3 Sense | `113991115` | same as C3 | same as C3 | same as C3 |
|
|
86
|
+
| SenseCAP Watcher | `113991315` or `113991275` (one group) | `bin` | same as XIAO, optional | `.bin` on the Xiao / ESP32-S3 port |
|
|
87
|
+
| Wio Terminal | `102991299` | `bin` | `0x4000` | `.bin` |
|
|
88
|
+
| Grove Beginner Kit | `110061162` | `bin` | `0x0` (address bar hidden; `.hex` uses addresses inside the file) | `.bin` or `.hex`. `.hex` locks the board to this kit |
|
|
89
|
+
| XIAO 0.96" / 1.14" IPS, 1.47" Touch (ESP32-S3) | representative SKU of the group; 1.47" Touch Muse SKU is `100069905` | `bin` | `0x0` | merged `.bin`. nRF52840 variants cannot be flashed |
|
|
90
|
+
| reTerminal E1001 | `100073581` | `bin` | `0x90000` | application-region `.bin`, not a full image with a bootloader |
|
|
91
|
+
| reTerminal E1002 | `100017057` | `bin` | `0x90000` | same as E1001 |
|
|
92
|
+
| XIAO e-paper / EE02–EE05 DIY (name contains Display, and is not IPS / Round / Touch / Sense) | matching SKU | `bin` | `0x90000` | same as E1001 |
|
|
93
|
+
| reTerminal Sticky | `100056818` | `bin` | `0x0` | merged `.bin` |
|
|
94
|
+
| SenseCAP Indicator D1 / D1S / D1L / D1Pro | one group; example `114993068` (D1) | `bin` | `0x0` | merged ESP32-S3 `.bin`, not the RP2040 port |
|
|
95
|
+
|
|
96
|
+
`.hex` is only for Grove Beginner (`110061162`). E100x, e-paper, Sticky, IPS, Touch, and Indicator accept `.bin` only. Do not use zip for Grove, Wio, those screens, or Indicator. XIAO C3 / C6 / S3 / S3 Sense / S3 Plus / Watcher keep 115200 and `flashSize` / `flashMode` / `flashFreq` = `keep`; do not apply the screen `0x90000` or merged-`0x0` rules to them.
|
|
97
|
+
|
|
98
|
+
**Agent:** write the SKU, file, and address into the app doc. **Do not** claim the firmware was flashed. Serial flashing stays L3 (Console / Web Serial).
|
|
51
99
|
|
|
52
100
|
### `deploy-ai-model` (vision / audio / related)
|
|
53
101
|
|
|
@@ -79,7 +127,7 @@ Multiple tool-blocks may appear in one step (e.g. paragraph → flash → paragr
|
|
|
79
127
|
|
|
80
128
|
Used for **container / edge app** deployment UI inside the application doc.
|
|
81
129
|
|
|
82
|
-
**Agent:** configure the block for documentation. Installing the container is
|
|
130
|
+
**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.
|
|
83
131
|
|
|
84
132
|
## Other tool-blocks
|
|
85
133
|
|
|
@@ -121,12 +169,14 @@ Used for **container / edge app** deployment UI inside the application doc.
|
|
|
121
169
|
{
|
|
122
170
|
"id": "ff_1",
|
|
123
171
|
"type": "flash-firmware",
|
|
124
|
-
"
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
172
|
+
"device_id": "100017057",
|
|
173
|
+
"device_type": "",
|
|
174
|
+
"flash_mode": "bin",
|
|
175
|
+
"firmware_url": "https://example.com/e1002-app.bin",
|
|
176
|
+
"firmware_name": "e1002-app.bin",
|
|
177
|
+
"firmware_size": "1234567",
|
|
178
|
+
"flash_address": "0x90000",
|
|
179
|
+
"muse_gadget": false
|
|
130
180
|
}
|
|
131
181
|
]
|
|
132
182
|
```
|
|
@@ -5,7 +5,7 @@ description: >-
|
|
|
5
5
|
view tech metadata (task, format, classes, devices), download, upload, publish/
|
|
6
6
|
unpublish, delete. Use when the user mentions 模型库, Model Library, upload model,
|
|
7
7
|
download model, model classes/labels, or CodeCraft model invoke links.
|
|
8
|
-
Requires Access Key (`auth init --kind sensecap`). Not for SenseCAP telemetry or
|
|
8
|
+
Requires Access Key (`auth init --kind sensecap`). Not for SenseCAP telemetry or SenseCraft apps.
|
|
9
9
|
---
|
|
10
10
|
|
|
11
11
|
# SenseCraft Models (Model Library)
|
|
@@ -35,7 +35,7 @@ Library `model download` is the published model file, not a training-job export.
|
|
|
35
35
|
- **Delete** only when `be_public=0` (Console hides delete for published/under-review). Unpublish first.
|
|
36
36
|
4. Model **publish** API uses `status: 1` (to public library) / `status: 0` (privatize) — **different from apps** (`privacy` 2/0). Do not mix.
|
|
37
37
|
5. **Public models are deploy-only.** For public / under-review models (`be_public≠0`):
|
|
38
|
-
- **Do not
|
|
38
|
+
- **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
39
|
- **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
40
|
- 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
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)).
|
|
@@ -13,7 +13,7 @@ description: >-
|
|
|
13
13
|
Orchestration skill: **list → pick → check → open Console → user clicks Deploy**.
|
|
14
14
|
|
|
15
15
|
Parent: [`../sensecraft-ai/SKILL.md`](../sensecraft-ai/SKILL.md).
|
|
16
|
-
List/view
|
|
16
|
+
List/view: [`../sensecraft-apps/SKILL.md`](../sensecraft-apps/SKILL.md), [`../sensecraft-models/SKILL.md`](../sensecraft-models/SKILL.md).
|
|
17
17
|
Commands: [`commands.md`](commands.md).
|
|
18
18
|
|
|
19
19
|
**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.
|
|
@@ -39,7 +39,7 @@ Commands: [`commands.md`](commands.md).
|
|
|
39
39
|
7. Both allowed:
|
|
40
40
|
- Flash the model already on the app `deploy-ai-model` block
|
|
41
41
|
- Flash a **separately picked** model from the 40 list
|
|
42
|
-
8. **Public models are deploy-only.** Never `model download`, never print `file_url`, never
|
|
42
|
+
8. **Public models are deploy-only.** Never `model download`, never print `file_url`, never copy a public model into My Models. Private My Models may be used as-is. Flashing does not require copying the app.
|
|
43
43
|
9. **Do not `cloud deploy`.** That path is Jetson / cloud kit (`26`), not reCamera.
|
|
44
44
|
10. **`flash-firmware` blocks are out of scope** this pass. Do not invent a firmware-flash CLI.
|
|
45
45
|
11. After a successful check, if the user wants to flash, run `recamera open` (or `--print-only` if they will paste the URL). Success = they say the Console page worked and they clicked Deploy. Opening a page is **not** an L2 `--yes` write.
|
|
@@ -74,6 +74,5 @@ Then tell the user: on the opened **model/app detail** page, click **Deploy**, c
|
|
|
74
74
|
|------|--------|
|
|
75
75
|
| `app/model list --uniform-type 40` | **Implemented** |
|
|
76
76
|
| `recamera check` / `recamera open` | **Implemented** (P2) |
|
|
77
|
-
| `app clone` | Use apps skill (L2) |
|
|
78
77
|
| Device flash / `recamera deploy` | **Not implemented** (L3 Console) |
|
|
79
78
|
| `model recamera-pro resolve` | Pro `53` only — not this skill |
|
|
@@ -77,11 +77,3 @@ sensecraft-cli recamera open --app-id <app_id> --print-only
|
|
|
77
77
|
| `flash-firmware` block | Later |
|
|
78
78
|
| reCamera Pro `53` | `sensecraft-models` + `model recamera-pro resolve` |
|
|
79
79
|
| CodeCraft App Square | Unrelated |
|
|
80
|
-
|
|
81
|
-
## Optional: clone an app first (L2)
|
|
82
|
-
|
|
83
|
-
```bash
|
|
84
|
-
sensecraft-cli app clone --id <app_id> --agree-disclaimer --yes
|
|
85
|
-
```
|
|
86
|
-
|
|
87
|
-
Follow [`../confirmation.md`](../confirmation.md). Clone is not required to open the plaza app and click Deploy.
|