@seeed-studio/sensecraft-cli 0.1.4 → 0.1.6
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 +20 -13
- package/package.json +2 -2
- package/scripts/paths.js +3 -7
- package/scripts/paths.test.js +3 -3
- package/skills/README.md +1 -1
- package/skills/confirmation.md +6 -6
- package/skills/sensecraft-ai/SKILL.md +15 -15
- package/skills/sensecraft-apps/SKILL.md +12 -25
- package/skills/sensecraft-apps/commands.md +1 -23
- package/skills/sensecraft-apps/reference-tool-blocks.md +67 -17
- package/skills/sensecraft-data/SKILL.md +1 -2
- package/skills/sensecraft-data/commands.md +2 -2
- package/skills/sensecraft-devices-cloud/SKILL.md +4 -6
- package/skills/sensecraft-devices-cloud/commands.md +2 -3
- package/skills/sensecraft-files/SKILL.md +1 -1
- package/skills/sensecraft-files/commands.md +1 -1
- package/skills/sensecraft-models/SKILL.md +3 -3
- package/skills/sensecraft-recamera/SKILL.md +2 -3
- package/skills/sensecraft-recamera/commands.md +0 -8
package/INSTALL.md
CHANGED
|
@@ -111,13 +111,11 @@ AI 初始化时选择站点:
|
|
|
111
111
|
|------|------|
|
|
112
112
|
| Global | 国际生产 |
|
|
113
113
|
| China | 国内账号(AI API host 与 Global 相同) |
|
|
114
|
-
| Develop | 测试环境(`test-sensecraft.seeed.cc`) |
|
|
115
114
|
|
|
116
|
-
|
|
115
|
+
查看配置:
|
|
117
116
|
|
|
118
117
|
```bash
|
|
119
118
|
sensecraft-cli auth info
|
|
120
|
-
sensecraft-cli auth refresh # 仅 AI profile
|
|
121
119
|
```
|
|
122
120
|
|
|
123
121
|
无交互环境(CI)不会自动跑 `auth init`,需事先准备好配置文件或自行执行初始化。
|
|
@@ -159,23 +157,32 @@ Copy-Item .\sensecraft.json "$env:APPDATA\sensecraft-cli\sensecraft.json"
|
|
|
159
157
|
|
|
160
158
|
## 5. 升级
|
|
161
159
|
|
|
160
|
+
已通过 npm 安装时,直接运行:
|
|
161
|
+
|
|
162
|
+
```bash
|
|
163
|
+
sensecraft-cli update
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
命令会查询 npm 上的最新版本,并执行 `npm install -g @seeed-studio/sensecraft-cli@<版本>`。安装器接着比较 `vendor/.version` 与新包版本,不一致就重新下载二进制。配置目录里的 Access Key 会保留。
|
|
167
|
+
|
|
168
|
+
其它用法:
|
|
169
|
+
|
|
162
170
|
```bash
|
|
163
|
-
#
|
|
171
|
+
sensecraft-cli update --check # 只查询,不安装
|
|
164
172
|
npm install -g @seeed-studio/sensecraft-cli@latest
|
|
165
|
-
# 或
|
|
166
|
-
npx @seeed-studio/sensecraft-cli@latest install
|
|
167
173
|
```
|
|
168
174
|
|
|
169
|
-
|
|
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 小时内只提醒一次。交互终端会问要不要参加,同意就打开详情页;拒绝后这条活动不再问。非交互只打印,不提问。CI 以及 `SENSECRAFT_CLI_NO_ACTIVITY_NOTIFIER` 时不提醒。
|
|
170
178
|
|
|
171
|
-
|
|
172
|
-
- **版本不同或缺少戳记** → 重新下载对应版本的二进制
|
|
179
|
+
当前程序如果不是 npm 安装的(例如直接运行编译出的二进制),`update` 只打印上面的手动安装命令,不会覆盖正在运行的文件。
|
|
173
180
|
|
|
174
181
|
验证:
|
|
175
182
|
|
|
176
183
|
```bash
|
|
177
184
|
sensecraft-cli --version
|
|
178
|
-
# 应与 npm
|
|
185
|
+
# 应与 npm 包版本一致
|
|
179
186
|
```
|
|
180
187
|
|
|
181
188
|
---
|
|
@@ -262,7 +269,7 @@ export HTTP_PROXY=http://proxy.example.com:8080
|
|
|
262
269
|
|
|
263
270
|
```bash
|
|
264
271
|
git clone <本仓库 URL>
|
|
265
|
-
cd sensecraft-
|
|
272
|
+
cd sensecraft-cloud-terminal
|
|
266
273
|
|
|
267
274
|
# 本机调试
|
|
268
275
|
go build -o sensecraft-cli .
|
|
@@ -287,7 +294,7 @@ export SENSECRAFT_CLI_PATH="$HOME/.config/sensecraft-cli"
|
|
|
287
294
|
cd packages/cli && SENSECRAFT_CLI_LOCAL_DIST=$PWD/../../dist npm run test:install
|
|
288
295
|
```
|
|
289
296
|
|
|
290
|
-
发版流程见 [`README.md`](README.md)
|
|
297
|
+
发版流程见 [`README.md`](README.md)。
|
|
291
298
|
|
|
292
299
|
---
|
|
293
300
|
|
|
@@ -328,7 +335,7 @@ npm root -g
|
|
|
328
335
|
任选其一:
|
|
329
336
|
|
|
330
337
|
1. **工作区即本仓库**
|
|
331
|
-
打开 `sensecraft-
|
|
338
|
+
打开 `sensecraft-cloud-terminal` 作为 Cursor 项目,Agent 可直接读 `skills/`。
|
|
332
339
|
|
|
333
340
|
2. **拷贝 / 软链到 Cursor skills 目录**(路径以你本机 Cursor 版本为准,常见为用户目录下的 skills 配置):
|
|
334
341
|
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@seeed-studio/sensecraft-cli",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.6",
|
|
4
4
|
"description": "SenseCAP / SenseCraft AI cloud CLI (devices, apps, models, files, cloud deploy)",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
8
|
-
"url": "https://
|
|
8
|
+
"url": "https://github.com/Seeed-Solution/sensecraft-cloud-terminal.git",
|
|
9
9
|
"directory": "packages/cli"
|
|
10
10
|
},
|
|
11
11
|
"publishConfig": {
|
package/scripts/paths.js
CHANGED
|
@@ -43,18 +43,14 @@ function resolveConfigPath() {
|
|
|
43
43
|
}
|
|
44
44
|
|
|
45
45
|
/**
|
|
46
|
-
* True when
|
|
47
|
-
*
|
|
48
|
-
* config (auth init --kind ai) was treated as uninitialized.
|
|
46
|
+
* True when a SenseCAP Access Key profile is present.
|
|
47
|
+
* That key is also used for SenseCraft AI /openapi.
|
|
49
48
|
*/
|
|
50
49
|
function isInitialized() {
|
|
51
50
|
const configPath = resolveConfigPath();
|
|
52
51
|
try {
|
|
53
52
|
const cfg = JSON.parse(fs.readFileSync(configPath, 'utf8'));
|
|
54
|
-
|
|
55
|
-
Array.isArray(cfg.app_config_list) && cfg.app_config_list.length > 0;
|
|
56
|
-
const hasAI = Array.isArray(cfg.ai_profiles) && cfg.ai_profiles.length > 0;
|
|
57
|
-
return hasSensecap || hasAI;
|
|
53
|
+
return Array.isArray(cfg.app_config_list) && cfg.app_config_list.length > 0;
|
|
58
54
|
} catch {
|
|
59
55
|
return false;
|
|
60
56
|
}
|
package/scripts/paths.test.js
CHANGED
|
@@ -54,7 +54,7 @@ function testResolveConfigPath() {
|
|
|
54
54
|
);
|
|
55
55
|
}
|
|
56
56
|
|
|
57
|
-
function
|
|
57
|
+
function testIsInitialized() {
|
|
58
58
|
const tmp = fs.mkdtempSync(path.join(os.tmpdir(), 'sc-init-'));
|
|
59
59
|
const cfg = path.join(tmp, 'sensecraft.json');
|
|
60
60
|
fs.writeFileSync(
|
|
@@ -65,7 +65,7 @@ function testIsInitializedAIOnly() {
|
|
|
65
65
|
})
|
|
66
66
|
);
|
|
67
67
|
withEnv({ SENSECRAFT_CONFIG_FILE: cfg, SENSECRAFT_CLI_PATH: undefined }, () => {
|
|
68
|
-
assert.equal(isInitialized(),
|
|
68
|
+
assert.equal(isInitialized(), false, 'token-only config is not initialized');
|
|
69
69
|
});
|
|
70
70
|
|
|
71
71
|
fs.writeFileSync(cfg, JSON.stringify({ app_config_list: [] }));
|
|
@@ -88,5 +88,5 @@ function testIsInitializedAIOnly() {
|
|
|
88
88
|
|
|
89
89
|
testReleaseURL();
|
|
90
90
|
testResolveConfigPath();
|
|
91
|
-
|
|
91
|
+
testIsInitialized();
|
|
92
92
|
console.log('OK: packages/cli/scripts/paths.test.js');
|
package/skills/README.md
CHANGED
|
@@ -30,4 +30,4 @@ ls "$(npm root -g)/@seeed-studio/sensecraft-cli/skills"
|
|
|
30
30
|
|
|
31
31
|
## Version sync
|
|
32
32
|
|
|
33
|
-
When adding a CLI command: update the domain skill `SKILL.md` + `commands.md` in the **same change
|
|
33
|
+
When adding a CLI command: update the domain skill `SKILL.md` + `commands.md` in the **same change**.
|
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,14 +8,14 @@ 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. **操作类型** — 删除 / 发布 / 私有化 / 部署 / 停止 /
|
|
18
|
-
2. **环境** — `auth info` 的 Global /
|
|
17
|
+
1. **操作类型** — 删除 / 发布 / 私有化 / 部署 / 停止 / 修改 / 绑定 / …
|
|
18
|
+
2. **环境** — `auth info` 的 Global / China(生产环境须点明)
|
|
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
|
+
将从 China 环境删除模型 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`.
|
|
@@ -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).
|
|
@@ -10,7 +10,7 @@ description: >-
|
|
|
10
10
|
|
|
11
11
|
# SenseCraft AI (Meta)
|
|
12
12
|
|
|
13
|
-
Router skill for **SenseCraft AI** capabilities exposed via CLI in this repo (`sensecraft-
|
|
13
|
+
Router skill for **SenseCraft AI** capabilities exposed via CLI in this repo (`sensecraft-cloud-terminal`). Domain skills and AI subcommands are rolled out in phases; this skill always applies for **intent routing, auth kind selection, and product-term disambiguation**.
|
|
14
14
|
|
|
15
15
|
Sibling (already shipped): [`../sensecraft-data/SKILL.md`](../sensecraft-data/SKILL.md) — SenseCAP PaaS OpenAPI (`device` / `group` / `data`).
|
|
16
16
|
|
|
@@ -28,10 +28,11 @@ 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).
|
|
35
|
+
8. **Upgrading the CLI itself** is `sensecraft-cli update` (npm registry, then `npm install -g`). This is not `app update` or `model update`. Uninstall with `npm uninstall -g @seeed-studio/sensecraft-cli`. Do not delete `~/.config/sensecraft-cli` unless the user asked to clear the saved Access Key.
|
|
35
36
|
|
|
36
37
|
## Auth model (same OAuth client, different persistence)
|
|
37
38
|
|
|
@@ -41,14 +42,16 @@ Sibling (already shipped): [`../sensecraft-data/SKILL.md`](../sensecraft-data/SK
|
|
|
41
42
|
|
|
42
43
|
### Site / `remote_type` (AI)
|
|
43
44
|
|
|
44
|
-
| `remote_type` | AI openapi |
|
|
45
|
-
|
|
46
|
-
| `Global` | `https://
|
|
47
|
-
| `
|
|
45
|
+
| `remote_type` | AI openapi | Account center |
|
|
46
|
+
|---------------|------------|----------------|
|
|
47
|
+
| `Global` | `https://api-gateway.seeed.cc/openapi` | `account.seeed.cc/authapi` |
|
|
48
|
+
| `China` | `https://api-gateway.seeed.cc/openapi` | `account.seeed.cn/authapi` |
|
|
48
49
|
|
|
49
|
-
|
|
50
|
+
China 与 Global 使用同一个 AI host,账号中心不同。网页控制台仍是 `https://sensecraft.seeed.cc`。
|
|
50
51
|
|
|
51
|
-
`
|
|
52
|
+
成功命令结束后,stderr 可能各有一条英文提示,同一条 24 小时内只出现一次。看到 `Warning: A new version of sensecraft-cli (<version>)` 时,完成当前请求后可以建议用户运行 `sensecraft-cli update`。看到 `Notice: SenseCraft AI is hosting the <name> activity` 时,把活动名称、日期和链接告诉用户,并询问要不要参加;用户同意后再打开链接。
|
|
53
|
+
|
|
54
|
+
`auth info` shows the active Access Key (site, org, key id). Secrets are not printed.
|
|
52
55
|
|
|
53
56
|
## Intent → skill / command routing
|
|
54
57
|
|
|
@@ -57,7 +60,7 @@ Console 测试站 `test-sensecraft.seeed.cc` → CLI 必须用 **`remote_type: D
|
|
|
57
60
|
| SenseCAP list/bind device, groups, telemetry | [`sensecraft-data`](../sensecraft-data/SKILL.md) | `sensecap` | Shipped today |
|
|
58
61
|
| Browse / search App Plaza, view app | [`sensecraft-apps`](../sensecraft-apps/SKILL.md) + `app list` / `app view` | `sensecap` | **CLI shipped** (list/view) |
|
|
59
62
|
| App fields / tool-blocks / BOM guidance | same apps skill references | `sensecap` | Config OK; real flash = L3 |
|
|
60
|
-
|
|
|
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) |
|
|
61
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 |
|
|
62
65
|
| Model library search/view/download/constants | [`sensecraft-models`](../sensecraft-models/SKILL.md) | `sensecap` | **CLI shipped** |
|
|
63
66
|
| Upload / publish / unpublish / delete model | same + `model upload --id --yes` / `create\|update\|publish\|unpublish\|delete` | `sensecap` | Attach bumps patch version like Console |
|
|
@@ -70,14 +73,12 @@ Console 测试站 `test-sensecraft.seeed.cc` → CLI 必须用 **`remote_type: D
|
|
|
70
73
|
|
|
71
74
|
SenseCAP telemetry → pick public model → deploy to Jetson:
|
|
72
75
|
|
|
73
|
-
1. `sensecraft-cli auth info`
|
|
76
|
+
1. `sensecraft-cli auth info`
|
|
74
77
|
2. SenseCAP: `data latest --eui <sensecap-eui>` (Access Key)
|
|
75
78
|
3. AI: `model list --public --name "…"` → `model view --id …` (metadata only; **no** `model download`)
|
|
76
79
|
4. Confirm with user → `cloud deploy --eui <jetson-eui> --model-id … --yes` (device pulls firmware at apply time)
|
|
77
80
|
5. `cloud order --request-id …`
|
|
78
81
|
|
|
79
|
-
Do **not** mix AI token into SenseCAP / AI `/openapi` Access Key calls.
|
|
80
|
-
|
|
81
82
|
## Product-term disambiguation
|
|
82
83
|
|
|
83
84
|
| User says | Possible meanings | Default choice |
|
|
@@ -88,14 +89,13 @@ Do **not** mix AI token into SenseCAP / AI `/openapi` Access Key calls.
|
|
|
88
89
|
| 模型下载地址 / 下载链接 / 怎么下载 | Public library artifact URL vs private owner file | **Public → no URL**, explain deploy; private My Models → `model download --out` (do not paste URL) |
|
|
89
90
|
| Data | SenseCAP telemetry vs training dataset | Telemetry → **sensecraft-data**; dataset → Console |
|
|
90
91
|
| Agent | Watcher Agent vs in-console AI Bot vs these Skills | These Skills ≠ Bot; Watcher has separate auth |
|
|
91
|
-
| Clone vs Install | Clone to My Apps vs install on a device | **Clone** = App Plaza |
|
|
92
92
|
|
|
93
93
|
## Capability levels
|
|
94
94
|
|
|
95
95
|
| Level | Meaning | Examples |
|
|
96
96
|
|-------|---------|----------|
|
|
97
97
|
| L1 Scriptable | Agent may run directly | list / view / auth info |
|
|
98
|
-
| L2 Confirm | Ask user first |
|
|
98
|
+
| L2 Confirm | Ask user first | publish (+ declaration), unpublish, delete, deploy |
|
|
99
99
|
| L3 Interactive | Human-in-the-loop | `auth init`, Web Serial flash, payment |
|
|
100
100
|
| L4 Ops-only | Do not expose to end-user Agent | Admin `judge_app` |
|
|
101
101
|
|
|
@@ -103,7 +103,7 @@ Do **not** mix AI token into SenseCAP / AI `/openapi` Access Key calls.
|
|
|
103
103
|
|
|
104
104
|
Published commands use **SenseCAP Access Key** (`kind=sensecap`) → `{ai-host}/openapi`:
|
|
105
105
|
|
|
106
|
-
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).
|
|
107
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).
|
|
108
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).
|
|
109
109
|
4. **Cloud devices** — `cloud device` / `cloud deploy` / `cloud order`.
|
|
@@ -2,15 +2,15 @@
|
|
|
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
|
-
|
|
8
|
-
Requires Access Key (`auth init --kind sensecap`). Not for
|
|
7
|
+
app BOM, deploy tool-blocks, or SenseCraft app upload.
|
|
8
|
+
Requires Access Key (`auth init --kind sensecap`). Not for SenseCAP devices.
|
|
9
9
|
---
|
|
10
10
|
|
|
11
11
|
# SenseCraft Apps (Application Plaza)
|
|
12
12
|
|
|
13
|
-
Domain skill for **SenseCraft AI applications**. Auth: **Access Key** → `{ai-host}/openapi` (HTTP Basic).
|
|
13
|
+
Domain skill for **SenseCraft AI applications**. Auth: **Access Key** → `{ai-host}/openapi` (HTTP Basic).
|
|
14
14
|
|
|
15
15
|
Parent router: [`../sensecraft-ai/SKILL.md`](../sensecraft-ai/SKILL.md).
|
|
16
16
|
SenseCAP IoT: [`../sensecraft-data/SKILL.md`](../sensecraft-data/SKILL.md).
|
|
@@ -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 ≠ Fleet install.
|
|
73
|
-
|
|
74
62
|
### Rename an existing app (L2)
|
|
75
63
|
|
|
76
64
|
```bash
|
|
@@ -163,7 +151,7 @@ Structure: `deployment.blocks` flat array.
|
|
|
163
151
|
| `flash-firmware` | Burn firmware to supported board | Config = L1/L2 write; **run flash = L3** |
|
|
164
152
|
| `deploy-ai-model` | Vision / audio AI model to device (task/device in config) | Config OK; **run deploy = L3** |
|
|
165
153
|
| `ai-vibration` | Vibration detection on XIAO-class device | Config OK; run = L3 |
|
|
166
|
-
| `deploy-container-app` | Edge container app
|
|
154
|
+
| `deploy-container-app` | Edge container app in the app doc | Config OK; installing the container is L3 |
|
|
167
155
|
| `node-red` / `aily-blockly` | Flow / Blockly projects | Lower priority unless user asks |
|
|
168
156
|
|
|
169
157
|
Details: [reference-tool-blocks.md](reference-tool-blocks.md).
|
|
@@ -185,7 +173,6 @@ Base: `{host}/openapi` with HTTP Basic (`key_id`:`access_key`).
|
|
|
185
173
|
| View | GET | `/flow/app/v3/view_app` |
|
|
186
174
|
| Create | POST | `/flow/app/v3/create_app` |
|
|
187
175
|
| Update | POST | `/flow/app/v3/update_app` |
|
|
188
|
-
| Clone | POST | `/flow/app/v3/clone_app` |
|
|
189
176
|
| Privacy | POST | `/flow/app/v3/edit_privacy_app` (`2` submit / `0` private) |
|
|
190
177
|
| Delete | POST | `/flow/app/v2/delete_app` (confirm path in code when wiring CLI) |
|
|
191
178
|
|
|
@@ -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.**
|
|
@@ -137,7 +115,7 @@ sensecraft-cli app create --name "My App"
|
|
|
137
115
|
| `--yes` | after user confirmation |
|
|
138
116
|
| `--sandbox` | sample JSON |
|
|
139
117
|
|
|
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
|
|
118
|
+
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
119
|
|
|
142
120
|
**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
121
|
|
|
@@ -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
|
|
|
@@ -77,9 +125,9 @@ Multiple tool-blocks may appear in one step (e.g. paragraph → flash → paragr
|
|
|
77
125
|
|
|
78
126
|
### `deploy-container-app`
|
|
79
127
|
|
|
80
|
-
Used for **container / edge app** deployment UI inside the application doc
|
|
128
|
+
Used for **container / edge app** deployment UI inside the application doc.
|
|
81
129
|
|
|
82
|
-
**Agent:** configure the block for documentation
|
|
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 (Flee
|
|
|
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
|
```
|
|
@@ -10,7 +10,7 @@ description: >-
|
|
|
10
10
|
|
|
11
11
|
# SenseCraft Data (SenseCAP PaaS)
|
|
12
12
|
|
|
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
|
|
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
14
|
|
|
15
15
|
Parent router: [`../sensecraft-ai/SKILL.md`](../sensecraft-ai/SKILL.md).
|
|
16
16
|
|
|
@@ -70,7 +70,6 @@ Resolved path priority: `SENSECRAFT_CONFIG_FILE` (absolute or relative to `SENSE
|
|
|
70
70
|
|------|------------------|
|
|
71
71
|
| Global (International) | `https://sensecap.seeed.cc/openapi` |
|
|
72
72
|
| China | `https://sensecap.seeed.cn/openapi` |
|
|
73
|
-
| Develop (test) | Selected during `auth init` / `auth add`; stored in config |
|
|
74
73
|
|
|
75
74
|
Authentication: HTTP Basic Auth with Key ID (username) and Access Key (password), obtained via `auth init` (OAuth Device Flow) or `auth add` (manual import).
|
|
76
75
|
|
|
@@ -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)
|
|
21
|
+
1. Select site: Global (International) or China
|
|
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
|
|
50
|
+
| `--site` | No | `Global` | Site: `Global` or `China` |
|
|
51
51
|
|
|
52
52
|
\* Required unless running interactively (then prompted).
|
|
53
53
|
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: sensecraft-devices-cloud
|
|
3
3
|
description: >-
|
|
4
|
-
Manages SenseCraft AI cloud devices (Jetson /
|
|
4
|
+
Manages SenseCraft AI cloud devices (Jetson / cloud kits via {ai-host}/openapi
|
|
5
5
|
list_node): list/view devices, deploy models with update_stream, poll order
|
|
6
6
|
records. Use when the user mentions Jetson 部署, 云端设备, cloud device,
|
|
7
7
|
Requires Access Key (`auth init --kind sensecap`). Not SenseCAP device CLI,
|
|
8
|
-
not
|
|
8
|
+
not local USB flash.
|
|
9
9
|
---
|
|
10
10
|
|
|
11
11
|
# SenseCraft Devices Cloud
|
|
@@ -18,8 +18,7 @@ Auth: **Access Key** (`auth init --kind sensecap`) → `{ai-host}/openapi`. Pare
|
|
|
18
18
|
2. **Never** use SenseCAP `device` commands here (`device list` = SenseCAP OpenAPI).
|
|
19
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.
|
|
20
20
|
4. Local USB / Web Serial = **L3** → guide Console `/ai/device/local/...`.
|
|
21
|
-
5.
|
|
22
|
-
6. **reCamera Pro** (`uniform_type=53`) local IP/USB RC2/ALPKG deploy is **not** `cloud deploy` / `update_stream` — guide users to Console device workspace (L3).
|
|
21
|
+
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).
|
|
23
22
|
|
|
24
23
|
## CLI status
|
|
25
24
|
|
|
@@ -39,7 +38,7 @@ sensecraft-cli cloud deploy --eui <EUI> --model-id <id> --from-json ./stream.jso
|
|
|
39
38
|
sensecraft-cli cloud order --request-id <request_id> --device-uuid <uuid>
|
|
40
39
|
```
|
|
41
40
|
|
|
42
|
-
`uniform_type` 26 is common for Jetson
|
|
41
|
+
`uniform_type` 26 is common for the Jetson cloud device UI; model deploy pages may pass other types / `adapteds`.
|
|
43
42
|
|
|
44
43
|
Full flag reference and copyable examples: [commands.md](commands.md).
|
|
45
44
|
|
|
@@ -49,5 +48,4 @@ Full flag reference and copyable examples: [commands.md](commands.md).
|
|
|
49
48
|
|------|-----|
|
|
50
49
|
| SenseCAP node/gateway telemetry | `sensecraft-cli device …` (Access Key) |
|
|
51
50
|
| Jetson / AI cloud kit | `cloud device …` (this skill) |
|
|
52
|
-
| Fleet multi-host Docker apps | `fleet …` + [`sensecraft-fleet`](../sensecraft-fleet/SKILL.md) |
|
|
53
51
|
| USB flash | Console local device (L3) |
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
# sensecraft-devices-cloud — CLI commands
|
|
2
2
|
|
|
3
|
-
Binary: `sensecraft-cli`. Auth:
|
|
3
|
+
Binary: `sensecraft-cli`. Auth: Access Key (`auth init --kind sensecap`).
|
|
4
4
|
|
|
5
5
|
## `cloud device list`
|
|
6
6
|
|
|
7
7
|
| Flag | Default | Notes |
|
|
8
8
|
|------|---------|-------|
|
|
9
|
-
| `--uniform-type` | `26` | Device type; Jetson
|
|
9
|
+
| `--uniform-type` | `26` | Device type; Jetson cloud UI commonly uses `26` |
|
|
10
10
|
| `--adapteds` | — | Optional adapted-device/model filter |
|
|
11
11
|
| `--name` | — | Filter by `device_name` |
|
|
12
12
|
| `--page` / `--length` | `1` / `20` | Pagination |
|
|
@@ -54,5 +54,4 @@ This command only polls deployment status and is not L2.
|
|
|
54
54
|
|
|
55
55
|
- `cloud device …`: SenseCraft AI Jetson / cloud kit.
|
|
56
56
|
- `device …`: SenseCAP node/gateway OpenAPI.
|
|
57
|
-
- `fleet …`: Seeed Fleet Docker apps.
|
|
58
57
|
- Local USB / Web Serial flashing: Console L3, not this CLI.
|
|
@@ -30,7 +30,7 @@ Auth: **Access Key** → `{ai-host}/openapi`. Parent: [`../sensecraft-ai/SKILL.m
|
|
|
30
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).
|
|
31
31
|
7. Do not pass oversized files or more than 16 app image URLs; CLI rejects them before upload/update.
|
|
32
32
|
8. Types `3`–`6` have no model/app attach path and upload directly (no `--unlinked` needed).
|
|
33
|
-
9. **Security gates**: empty (0 B) files rejected; type 2–6
|
|
33
|
+
9. **Security gates**: empty (0 B) files rejected; type 2–6 ≤ **100 MB**; images 2 MB (model) / 5 MB (app). Upload frequency is enforced by the server, not this CLI.
|
|
34
34
|
|
|
35
35
|
## Examples
|
|
36
36
|
|
|
@@ -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)
|
|
@@ -14,7 +14,7 @@ Domain skill for **SenseCraft AI models**. Auth: **Access Key** → `{ai-host}/o
|
|
|
14
14
|
|
|
15
15
|
Parent: [`../sensecraft-ai/SKILL.md`](../sensecraft-ai/SKILL.md).
|
|
16
16
|
Apps: [`../sensecraft-apps/SKILL.md`](../sensecraft-apps/SKILL.md).
|
|
17
|
-
|
|
17
|
+
Library `model download` is the published model file, not a training-job export.
|
|
18
18
|
|
|
19
19
|
## Agent rules
|
|
20
20
|
|
|
@@ -35,7 +35,7 @@ Training artifacts (train job model download): [`sensecraft-train`](../sensecraf
|
|
|
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.
|