@seeed-studio/sensecraft-cli 0.2.1 → 0.2.3

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  # SenseCraft CLI 安装指南
2
2
 
3
- 本文说明如何安装、升级、卸载 `sensecraft-cli`,以及如何把 Agent Skills 接到 Cursor 等工具。命令参考与业务用法见 [`README.md`](README.md)。
3
+ 本文说明如何安装、升级、卸载 `sensecraft-cli`,以及如何把 Agent Skills 接到 Cursor 等工具。命令与登录见 [`README.zh.md`](README.zh.md)(英文 [`README.md`](README.md))。
4
4
 
5
5
  ## 1. 环境要求
6
6
 
@@ -29,7 +29,7 @@
29
29
 
30
30
  1. 按当前平台下载**与本 npm 包版本一致**的二进制
31
31
  2. 全局注册 `sensecraft-cli` 命令
32
- 3. 若本地尚无配置,在交互终端下引导 `auth init`
32
+ 3. 若本地尚无配置,在交互终端下引导填写 OpenAPI Access Key
33
33
 
34
34
  ### macOS / Linux
35
35
 
@@ -96,29 +96,16 @@ npm install -g @seeed-studio/sensecraft-cli@0.1.3
96
96
 
97
97
  ---
98
98
 
99
- ## 3. 首次认证
99
+ ## 3. 首次登录
100
100
 
101
- 安装完成后初始化:
102
-
103
- ```bash
104
- # SenseCAP Access Key(设备 / 分组 / 数据,以及 AI 应用 / 模型 / 云部署)
105
- sensecraft-cli auth init --kind sensecap
106
- ```
107
-
108
- AI 初始化时选择站点:
109
-
110
- | 选项 | 用途 |
111
- |------|------|
112
- | Global | 国际生产 |
113
- | China | 国内账号(AI API host 与 Global 相同) |
114
-
115
- 查看配置:
101
+ 用 SenseCAP 门户里的 OpenAPI Access Key 登录。Key ID 和 Access Key 写入本机后,设备、分组、传感数据,以及应用、模型、文件、云设备都用这一把钥匙。
116
102
 
117
103
  ```bash
104
+ sensecraft-cli auth add --key-id <Key ID> --access-key <Access Key> --site Global
118
105
  sensecraft-cli auth info
119
106
  ```
120
107
 
121
- 无交互环境(CI)不会自动跑 `auth init`,需事先准备好配置文件或自行执行初始化。
108
+ `--site` 为 `Global` 或 `China`,省略时是 `Global`。无交互环境需要带上 `--key-id` 和 `--access-key`。`auth info` 不打印 Access Key。
122
109
 
123
110
  ---
124
111
 
@@ -370,12 +357,12 @@ ln -s "$PWD/skills/sensecraft-ai" ~/.claude/skills/sensecraft-ai
370
357
  1. 若支持 `SKILL.md` 自动发现,把 `skills/*/` 原样放入其项目级或用户级 skills 目录;具体目录以宿主文档为准。
371
358
  2. 若不支持 Skills,把 `skills/sensecraft-ai/SKILL.md` 和命中的领域 skill 作为系统/项目上下文加载。
372
359
  3. Agent 必须具有本机命令执行能力,才能调用 `sensecraft-cli`;纯聊天宿主只能读取说明,不能声称命令已执行。
373
- 4. `auth init`、本地 USB/IP 部署与烧录仍需用户交互,不能因为换了 Agent 就降级安全级别。
360
+ 4. 写入 Access Key、本地 USB/IP 部署与烧录仍由用户自己完成。
374
361
 
375
362
  使用约定:
376
363
 
377
364
  - SenseCraft AI 相关问题先走 **`sensecraft-ai`** 路由 skill。
378
- - 确保机器上 `sensecraft-cli` 在 PATH 中,且已 `auth init`。
365
+ - 确保机器上 `sensecraft-cli` 在 PATH 中,且已用 `auth add` 写入 Access Key。
379
366
 
380
367
  ---
381
368
 
@@ -413,11 +400,11 @@ sensecraft-cli data latest --eui SANDBOXEUI000001 --sandbox
413
400
 
414
401
  公司网络拦截 OSS 时,优先用本地 `dist/` 或内网镜像。
415
402
 
416
- ### `auth info` 显示未初始化 / 装完又提示 init
403
+ ### `auth info` 显示还没有 Access Key
417
404
 
418
- - npm 安装认 **SenseCAP Access Key**(`app_config_list`)。
405
+ - 用 `sensecraft-cli auth add --key-id <Key ID> --access-key <Access Key> --site Global` 写入。`--site China` 用于国内站。
419
406
  - 确认读写的是同一配置文件:`echo $SENSECRAFT_CLI_PATH` / `%SENSECRAFT_CLI_PATH%`。
420
- - 应用 / 模型 / 云设备:`sensecraft-cli auth init --kind sensecap`。
407
+ - 设备、应用、模型和云设备使用同一把 Access Key。
421
408
 
422
409
  ### npm 装的和 `go build` 的配置不一致
423
410
 
@@ -442,8 +429,8 @@ sensecraft-cli --version
442
429
 
443
430
  | 文档 | 内容 |
444
431
  |------|------|
445
- | [`README.md`](README.md) | 功能概览、命令参考、发版说明 |
446
- | [`ARCHITECTURE.md`](ARCHITECTURE.md) | 架构分层、鉴权、业务规则、安全模型、CI |
432
+ | [`README.md`](README.md) | English overview |
433
+ | [`README.zh.md`](README.zh.md) | 中文说明 |
447
434
  | [`docs/sensecraft-cli-smoke.md`](docs/sensecraft-cli-smoke.md) | 发版冒烟清单 |
448
435
  | [`docs/sensecraft-cli-test-cases.md`](docs/sensecraft-cli-test-cases.md) | 全量功能测试用例 |
449
436
  | [`skills/README.md`](skills/README.md) | Skills 目录与 Agent 约定 |
@@ -43,7 +43,7 @@ async function main() {
43
43
  await runInstall();
44
44
  } catch (err) {
45
45
  console.error('');
46
- console.error('安装失败:', err.message);
46
+ console.error('Install failed:', err.message);
47
47
  console.error('');
48
48
  process.exit(1);
49
49
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@seeed-studio/sensecraft-cli",
3
- "version": "0.2.1",
3
+ "version": "0.2.3",
4
4
  "description": "SenseCAP / SenseCraft AI cloud CLI (devices, apps, models, files, cloud deploy)",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -27,7 +27,7 @@ function getGlobalCliPath() {
27
27
 
28
28
  function installGlobally() {
29
29
  const packageRoot = getPackageRoot();
30
- console.log('正在全局安装 sensecraft-cli...');
30
+ console.log('Installing sensecraft-cli globally...');
31
31
  execSync(`npm install -g ${JSON.stringify(packageRoot)}`, {
32
32
  stdio: 'inherit',
33
33
  env: process.env,
@@ -35,7 +35,7 @@ function installGlobally() {
35
35
 
36
36
  const cliPath = getGlobalCliPath();
37
37
  if (!fs.existsSync(cliPath)) {
38
- throw new Error(`全局命令未找到: ${cliPath},请确认 npm 全局 bin 目录在 PATH 中`);
38
+ throw new Error(`Global command not found: ${cliPath}. Add the npm global bin directory to PATH.`);
39
39
  }
40
40
  return cliPath;
41
41
  }
@@ -43,20 +43,20 @@ function installGlobally() {
43
43
  function runInitIfNeeded(cliPath) {
44
44
  if (isInitialized()) {
45
45
  console.log('');
46
- console.log('✓ 配置文件已存在,跳过初始化');
46
+ console.log('Config file already exists; skipped initialization');
47
47
  console.log(' sensecraft-cli auth info');
48
48
  return;
49
49
  }
50
50
 
51
51
  if (!process.stdin.isTTY || !process.stdout.isTTY) {
52
52
  console.log('');
53
- console.log('未检测到交互式终端,已跳过自动初始化。');
54
- console.log('请稍后运行: sensecraft-cli auth init');
53
+ console.log('No interactive terminal; skipped automatic initialization.');
54
+ console.log('Run later: sensecraft-cli auth init');
55
55
  return;
56
56
  }
57
57
 
58
58
  console.log('');
59
- console.log('未检测到配置文件,开始自动初始化...');
59
+ console.log('No config file found; starting initialization...');
60
60
  console.log('');
61
61
 
62
62
  const result = spawnSync(cliPath, ['auth', 'init'], {
@@ -76,12 +76,12 @@ function runInitIfNeeded(cliPath) {
76
76
  function printDone(globalCliPath) {
77
77
  const globalBin = getGlobalBinDir();
78
78
  console.log('');
79
- console.log('✓ 安装完成');
80
- console.log(` 命令: sensecraft-cli`);
81
- console.log(` 路径: ${globalCliPath}`);
79
+ console.log('Install complete');
80
+ console.log(' Command: sensecraft-cli');
81
+ console.log(` Path: ${globalCliPath}`);
82
82
  if (!process.env.PATH || !process.env.PATH.split(path.delimiter).includes(globalBin)) {
83
83
  console.log('');
84
- console.log('提示: 若无法直接运行 sensecraft-cli,请将以下目录加入 PATH:');
84
+ console.log('If sensecraft-cli is not on PATH, add this directory:');
85
85
  console.log(` ${globalBin}`);
86
86
  }
87
87
  console.log('');
@@ -62,7 +62,7 @@ China 与 Global 使用同一个 AI host,账号中心不同。网页控制台
62
62
  | App fields / tool-blocks / BOM guidance | same apps skill references | `sensecap` | Config OK; real flash = L3 |
63
63
  | Author a new app (create + info + images + BOM + blocks) | [`sensecraft-apps/create-app`](../sensecraft-apps/create-app/SKILL.md) | `sensecap` | One batch confirmation; stops before publish |
64
64
  | 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) |
65
- | 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 |
65
+ | Upload image/file/firmware/static/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`; type `5` requires `--flow-id`; types `3`–`6` direct |
66
66
  | Model library search/view/download/constants | [`sensecraft-models`](../sensecraft-models/SKILL.md) | `sensecap` | **CLI shipped** |
67
67
  | Upload / publish / unpublish / delete model | same + `model upload --id --yes` / `create\|update\|publish\|unpublish\|delete` | `sensecap` | Attach bumps patch version like Console |
68
68
  | Classic reCamera (`40`) pick / check / open deploy page | [`sensecraft-recamera`](../sensecraft-recamera/SKILL.md) + `app/model list --uniform-type 40` + `recamera check` / `open` | `sensecap` | **CLI shipped**. Flash is Console L3 (IP/USB). Not `cloud deploy`. Not Pro `53`. |
@@ -105,7 +105,7 @@ SenseCAP telemetry → pick public model → deploy to Jetson:
105
105
  Published commands use **SenseCAP Access Key** (`kind=sensecap`) → `{ai-host}/openapi`:
106
106
 
107
107
  1. **Apps** — list/view/fields/blocks; create/update; publish/unpublish/delete (L2); BOM search/list/set; tool-block config via JSON (real flash = L3).
108
- 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
+ 2. **Files** — `file upload` for image/model/app/firmware/static/archive; types 1–2 require `--model-id` / `--app-id --yes` / `--for-app` / `--unlinked` before the OSS POST (bare upload fails). Type 5 also requires `--flow-id`.
109
109
  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).
110
110
  4. **Cloud devices** — `cloud device` / `cloud deploy` / `cloud order`.
111
111
  5. **Classic reCamera 40** — `recamera check` / `recamera open` (Console AI deploy page; flash is L3).
@@ -6,6 +6,9 @@ description: >-
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
+ When the user hands over a Markdown file to turn into an app, follow
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.
9
12
  ---
10
13
 
11
14
  # SenseCraft Apps (Application Plaza)
@@ -23,7 +26,7 @@ Child skill: [`create-app/SKILL.md`](create-app/SKILL.md) — manifest-driven ap
23
26
  sensecraft-cli auth info
24
27
  ```
25
28
  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.
26
- 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. **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.
29
+ 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.
27
30
  **`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.
28
31
  3. **Privacy values**: submit review → `privacy` / flow uses **`2`** (pending); unpublish/private → **`0`**. **Never send `1`** (ops-approved public; Admin only).
29
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`](../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.
@@ -37,8 +40,9 @@ Child skill: [`create-app/SKILL.md`](create-app/SKILL.md) — manifest-driven ap
37
40
  | Area | Status |
38
41
  | ---------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
39
42
  | Auth `--kind sensecap` | **Implemented** (`auth init --kind sensecap`; `app` uses `{ai-host}/openapi` Basic) |
40
- | `app list` / `app view` / `app fields` / `app blocks` | **Implemented** |
41
- | `app create` / `update` / `publish` / `unpublish` / `delete` | **Implemented** (L2 = `--yes`; publish also `--agree-declaration`; **`create` never needs `--yes`**, even with full `--from-json`) |
43
+ | `app list` / `app view` / `app fields` / `app blocks` / `app activity list` | **Implemented**. Plaza hot list is `--public --sort popular` |
44
+ | `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
+ | `app like` / `unlike` / `collect` / `uncollect` / `mark-deploy` / `clone` | **Implemented** (L2 = `--yes`) |
42
46
  | 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
47
  | `app bom search\|list\|set` | **Implemented** (catalog = local filter on `get_production_options`; set via `update_app`) |
44
48
  | `scene` / option ids | Use `sensecraft-cli model constants` (`app_scenarios_array`) |
@@ -75,7 +79,7 @@ sensecraft-cli app view --id <app_id> --sketch # must show new app_name
75
79
  sensecraft-cli app update --id <app_id> --activity-id 1 --yes
76
80
  ```
77
81
 
78
- `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`).
82
+ `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`.
79
83
 
80
84
  ### Publish / unpublish / delete (L2)
81
85
 
@@ -117,7 +121,9 @@ Seeed rows need `id`(=SKU). Custom rows omit `id`. No manual custom image upload
117
121
  ```bash
118
122
  sensecraft-cli app create --from-json ./app.json
119
123
  # CLI returns app_id + console_url + detail_url (even if update_app body was {}).
120
- # detail_url includes from=my-apps so cover/images load from the sketch.
124
+ # detail_url is https://app.seeed.cc/view-application/<id>-<slug>?tab=custom&from=my-apps
125
+ # (test AI host → https://test-app.seeed.cc). from=my-apps loads the sketch cover.
126
+ # A non-empty web_link on a list item is the link to give the user.
121
127
  # Restore JSON may have pic_url (list) or images[] (view); CLI writes both.
122
128
  # Show links to the user. NEVER re-run create because stdout looked empty —
123
129
  # check first: app list --mine --name "<name>"
@@ -178,12 +184,16 @@ Base: `{host}/openapi` with HTTP Basic (`key_id`:`access_key`).
178
184
 
179
185
  | Action | Method | Path |
180
186
  | ------- | ------ | ---------------------------------------------------------------- |
181
- | List | GET | `/flow/app/v2/list_app` (`be_public=1` for plaza; optional `uniform_type`) |
187
+ | List | GET | `/flow/app/v2/list_app` (`be_public`, `order_type` `1`/`2`/`3`, `priority_activity_id`, `tag_id`, `mark_type` `1`/`0`) |
188
+ | Activities | GET | `/activity/list` (no `time`) |
182
189
  | View | GET | `/flow/app/v3/view_app` |
183
190
  | Create | POST | `/flow/app/v3/create_app` |
184
191
  | Update | POST | `/flow/app/v3/update_app` |
185
- | Privacy | POST | `/flow/app/v3/edit_privacy_app` (`2` submit / `0` private) |
186
- | Delete | POST | `/flow/app/v2/delete_app` (confirm path in code when wiring CLI) |
192
+ | Clone | POST | `/flow/app/v3/clone_app` |
193
+ | Privacy | POST | `/flow/app/v3/edit_privacy_app` (`2` submit / `0` private). Not for withdrawing review |
194
+ | Withdraw | POST | `/flow/app/v3/callback_sketch` (`be_public=2` only) |
195
+ | Mark | POST | `/flow/app/v2/mark_app` (`op_type` 1/0/3/2/4) |
196
+ | Delete | POST | `/flow/app/v2/delete_app` |
187
197
 
188
198
  Authoritative field dump (Console repo): `website-sensecraft-console/docs/app-edit-v3-custom-app-field-reference.md`.
189
199
 
@@ -21,24 +21,34 @@ List apps.
21
21
 
22
22
  | Flag | Default | Notes |
23
23
  | --------------------- | ----------------------- | ------------------------------------------------------------ |
24
- | `--public` | plaza mode | `be_public=1` |
25
- | `--mine` | default if neither flag | My apps |
24
+ | `--public` | | Plaza (`be_public=1`). Required for the store; not the default |
25
+ | `--mine` | default if neither flag | My apps. Omit both visibility flags for the same result |
26
26
  | `--name` | | Search keyword → API `app_name` (Console app list) |
27
27
  | `--scene` | | Scene id |
28
28
  | `--uniform-type` | | Device type → API `uniform_type` (`40` reCamera, `32` XIAO ESP32S3, `53` reCamera Pro) |
29
- | `--mark-type` | | Optional mark filter, such as `like` / `star` when supported |
29
+ | `--sort` | | `popular` → `order_type=1`, `newest` → `2`, `likes` → `3`. Omit to leave `order_type` unset |
30
+ | `--priority-activity-id` | | Positive integer. Only with `--sort popular`. If omitted on popular, CLI fills the first ongoing activity |
31
+ | `--tag-id` | | Competition filter → `tag_id` |
32
+ | `--mark-type` | | `1` = my likes, `0` = my collections |
33
+ | `--likes` | | `mark_type=1` and `be_public=1`. Not with `--mine` |
34
+ | `--collections` | | `mark_type=0` and `be_public=1`. Not with `--mine` |
30
35
  | `--page` / `--length` | 1 / 20 | Pagination |
31
- | `--sandbox` | | Sample JSON, no network |
36
+ | `--sandbox` | | Sample JSON, no network. Includes `sandbox_query` |
32
37
 
33
38
  ```bash
34
- # Application Plaza
39
+ # Application Plaza. Omit visibility flags for my apps. Hot sort is explicit.
35
40
  sensecraft-cli app list --public --name "vision" --scene <scene_id> --page 1 --length 20
41
+ sensecraft-cli app list --public --sort popular --length 12
42
+ sensecraft-cli app list --public --sort popular --tag-id 1
43
+ sensecraft-cli app list --public --sort newest
44
+ sensecraft-cli app list --public --likes
45
+ sensecraft-cli app list --public --collections
36
46
  sensecraft-cli app list --public --uniform-type 40
37
47
  sensecraft-cli app list --mine --uniform-type 40
38
48
 
39
- # My Apps / marked apps
49
+ # My apps
40
50
  sensecraft-cli app list --mine
41
- sensecraft-cli app list --mine --mark-type star
51
+ sensecraft-cli app list --public --mark-type 1
42
52
  ```
43
53
 
44
54
  ### `app view`
@@ -88,7 +98,12 @@ sensecraft-cli app blocks
88
98
 
89
99
  Rejects `be_public=1` / `privacy=1`. Do **not** confuse with `app update` (existing app → L2).
90
100
 
91
- **Success output:** CLI always prints `app_id`, `console_url` (edit `/ai/application/edit?id=…`), and `detail_url` (`/ai/application/detail/<id>?tab=custom&from=my-apps`). The `from=my-apps` query loads the sketch (cover/`images`) the same as Console 我的应用. Do **not** send users to `/application/detail/<id>` without that query — that page fetches `view_sketch=0` and will look like it has no cover after create/restore.
101
+ **Success output:** CLI always prints `app_id`, `console_url`, and `detail_url` on the app site (`https://app.seeed.cc`, or `https://test-app.seeed.cc` when the AI host contains `test-`):
102
+
103
+ - edit: `/application/edit?id=<app_id>`
104
+ - my app detail: `/view-application/<app_id>-<slug>?tab=custom&from=my-apps`
105
+
106
+ `from=my-apps` loads the sketch (cover/`images`). A public link uses `tab=public&from=application-store` and must not include `from=my-apps`. If a list item has a non-empty `web_link`, give the user that URL instead of `view-application`. Model and legal pages stay on `sensecraft.seeed.cc`.
92
107
 
93
108
  **Do not retry create blindly:**
94
109
 
@@ -134,7 +149,9 @@ sensecraft-cli app update --id <app_id> --from-json ./app.json --yes
134
149
  sensecraft-cli app update --id <app_id> --activity-id 1 --yes
135
150
  ```
136
151
 
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.
152
+ `activity_id` must be a positive integer. List ongoing ids with `app activity list` first. If that list succeeds and does not contain the id, CLI does not POST. The server still rejects a bad id with `11202` and a missing or expired activity with `25000` `Activity does not exist or has expired` (the whole edit is discarded). Omitting `activity_id` does not change existing activity tags. `tags` is not read by the server.
153
+
154
+ When `--activity-id` is set and this JSON does not include `allow_clone`, CLI sets `allow_clone` to `1` unless the sketch is already `1`. That matches the web contest save. An explicit `allow_clone` in the JSON is kept.
138
155
 
139
156
  ### `app publish` / `app unpublish` / `app delete` (L2)
140
157
 
@@ -145,7 +162,8 @@ sensecraft-cli app update --id <app_id> --activity-id 1 --yes
145
162
  - Review will lock editing until approval (or `unpublish`)
146
163
  - Declaration URL: https://sensecraft.seeed.cc/legal/en/declaration
147
164
  - Do **not** pass `--agree-declaration` unless the user explicitly agreed
148
- - `unpublish` → `privacy=0` (private / withdraw review). Owner only. No declaration flag.
165
+ - `unpublish` → `privacy=0` for an **already public** app (make it private). Owner only. No declaration flag. Do **not** use it to withdraw a review.
166
+ - `withdraw` → `POST /flow/app/v3/callback_sketch` with `{app_id}` only, and only when `be_public=2`. Public apps: `unpublish`. Private apps: nothing to withdraw.
149
167
  - `delete` → `POST /flow/app/v2/delete_app` — **private + owner** (`be_public=0`)
150
168
  - **Never** send privacy `1`
151
169
  - All require a **separate chat confirm** ([`../confirmation.md`](../confirmation.md)) then `--yes`; `publish` also requires `--agree-declaration`. 「删除应用 demo」is intent — ask first.
@@ -154,9 +172,46 @@ sensecraft-cli app update --id <app_id> --activity-id 1 --yes
154
172
  # after the user replies 确认:
155
173
  sensecraft-cli app publish --id <app_id> --agree-declaration --yes
156
174
  sensecraft-cli app unpublish --id <app_id> --yes
175
+ sensecraft-cli app withdraw --id <app_id> --yes
157
176
  sensecraft-cli app delete --id <app_id> --yes
158
177
  ```
159
178
 
179
+ ### `app activity list`
180
+
181
+ **Status: implemented.** Read-only. `GET /activity/list` with no `time` query. stdout is `{ "list": [...] }` with numeric `activity_id`, `name`, `tag_ids`, and unix `start_time` / `end_time` when present. Rows without a positive id or a name are dropped.
182
+
183
+ ```bash
184
+ sensecraft-cli app activity list
185
+ ```
186
+
187
+ ### `app like` / `app unlike` / `app collect` / `app uncollect` / `app mark-deploy` (L2)
188
+
189
+ **Status: implemented.** `POST /flow/app/v2/mark_app`.
190
+
191
+ | Command | `op_type` |
192
+ | --- | --- |
193
+ | `like` | `1` |
194
+ | `unlike` | `0` |
195
+ | `collect` | `3` |
196
+ | `uncollect` | `2` |
197
+ | `mark-deploy` | `4` (records a download; does not flash) |
198
+
199
+ stdout always includes `app_id` and `op_type`. Whether the user already liked or collected is `like_time` / `follow_time` on `app view` (non-zero means set). Counts are `like_num` / `follow_num`.
200
+
201
+ ```bash
202
+ sensecraft-cli app like --id <app_id> --yes
203
+ sensecraft-cli app mark-deploy --id <app_id> --yes
204
+ ```
205
+
206
+ ### `app clone` (L2)
207
+
208
+ **Status: implemented.** `POST /flow/app/v3/clone_app`. Refuses when source `allow_clone` is `0` and does not POST. Without `--name`, the name is `Clone_` plus the first 54 characters of the source name. stdout includes the new `app_id`, `console_url`, and `detail_url`. Does not copy `be_public` and does not publish.
209
+
210
+ ```bash
211
+ sensecraft-cli app clone --id <source_app_id> --yes
212
+ sensecraft-cli app clone --id <source_app_id> --name "New name" --yes
213
+ ```
214
+
160
215
  ### `app bom`
161
216
 
162
217
  **Status: implemented.**
@@ -48,12 +48,20 @@ Mine first, ask approval once at the end.
48
48
  It only validates **format, never content truth**. Cross-check structure with the static schema commands `sensecraft-cli app fields` and `sensecraft-cli app blocks` — they are zero-network, run them bare (they take **no** `--sandbox` flag).
49
49
  5. Snapshot the manifest (archive copy when there is no git).
50
50
 
51
+ ## When the source is a Markdown document
52
+
53
+ The app editor stores a flat `deployment.blocks` array. It does not keep the Markdown file and it does not re-parse Markdown at preview time. There is no `app import-md` command.
54
+
55
+ Follow [../../../docs/md-to-app.md](../../../docs/md-to-app.md): lift `app_name` / `excerpt` / scene / BOM out of the prose, map headings that are real user actions to `step` blocks (a `h2` is not a step), and write inline formatting as HTML. Then run the same create → update → publish commands as below. `**bold**` inside `content` will display as asterisks.
56
+
57
+ Contest entry is a later `app update --activity-id <id>`. CLI also writes `"allow_clone": 1` on that update when the sketch is not already `1` and the JSON did not set `allow_clone`. Confirm the id is in `app activity list` first.
58
+
51
59
  ## Writing the prose
52
60
 
53
61
  Published text is what plaza users actually read — mine it from the project, but author it deliberately.
54
62
 
55
63
  - `excerpt`: what the app is, who it is for, why it is interesting. Nothing else — no hardware/framework spec dump, no deploy steps, no version history or changelog.
56
- - `deployment.blocks` prose: short onboarding steps — necessary prep, main actions, how to start and stop. Include a step only if the feature exists. Target structure: an intro of at most two short paragraphs, then one step per distinct user action (typically 3–5 steps). No full menu enumeration, no exhaustive troubleshooting, no spec tables, no restating the excerpt inside steps. Text blocks render Markdown — images and external video links are available; see [reference-tool-blocks.md](../reference-tool-blocks.md#content-format).
64
+ - `deployment.blocks` prose: short onboarding steps — necessary prep, main actions, how to start and stop. Include a step only if the feature exists. Target structure: an intro of at most two short paragraphs, then one step per distinct user action (typically 3–5 steps). No full menu enumeration, no exhaustive troubleshooting, no spec tables, no restating the excerpt inside steps. Inline formatting in `content` is HTML, not Markdown. Images and video are uploaded first, then linked; see [reference-tool-blocks.md](../reference-tool-blocks.md#content-format).
57
65
  - Review once before every push: would a first-time user find every sentence clear, with nothing repeated?
58
66
 
59
67
  ## Workflow B — create (one-go)
@@ -29,7 +29,7 @@ Agent fill-in guide for SenseCraft custom apps (v3). Aligns with Console `infoFo
29
29
  - **Update (`app update`)**: always include `app_id` (CLI `--id`).
30
30
  - **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 `{}`.
31
31
  - **Other sections** (`deployment`, `materials`, …): may be sent alone without forcing an info merge. Full leave-save usually sends info + deployment + materials together.
32
- - **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.
32
+ - **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. If `activity_id` is set and this JSON omits `allow_clone`, CLI sets `allow_clone` to `1` when the current sketch is not already `1`.
33
33
  - **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 …`.
34
34
 
35
35
  ## Visibility / review
@@ -4,14 +4,13 @@ Help the Agent choose the right block and fill `config` safely. Execution on har
4
4
 
5
5
  ## Content format
6
6
 
7
- Text-block `content` (introduction and step text alike) renders **Markdown** — inline HTML like `<p>` also renders and appears in existing docs. Images and externally hosted media are available through ordinary Markdown:
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
- ```markdown
10
- ![wiring diagram](https://files.example.com/wiring.png)
11
- [Watch the demo video](https://example.com/demo.mp4)
12
- ```
9
+ Write inline formatting as HTML: `<strong>`, `<em>`, `<code>`, `<s>`, `<a href="…">`, `<img src="…" alt="…" />`, `<video src="…" controls>`. Do not wrap a `paragraph` in an extra `<p>` — the preview adds it. `code` block `content` is plain source, not HTML.
10
+
11
+ How to split a user Markdown file into these blocks, then create and publish: [../../docs/md-to-app.md](../../docs/md-to-app.md).
13
12
 
14
- Host binaries (images, videos) via `file upload` first; Markdown only links out, it does not embed uploads by itself.
13
+ Host binaries (images, videos, firmware) via `file upload` first. A relative path from the Markdown file is not a valid `src`.
15
14
 
16
15
  ## Document layout
17
16
 
@@ -64,8 +63,9 @@ Write these as **flat fields** on the block. The editor wraps them into `config`
64
63
  | `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 |
65
64
  | `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 / `[]` |
66
65
  | `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 |
66
+ | `full_flash` | Boolean, default `false`. Same true/false reading as `muse_gadget`. Kept only on the Muse SKUs below; any other device is reset to `false`. `true` erases the whole flash before the write. When `muse_gadget` is `true`, set `full_flash` to `false`. The editor hides the checkbox while Muse is on |
67
67
 
68
- `muse_gadget: true` is kept only for these SKUs. Any other device written `true` is reset to `false` by the editor:
68
+ `muse_gadget: true` is kept only for these SKUs. Any other device written `true` is reset to `false` by the editor. `full_flash` uses the same SKU list:
69
69
 
70
70
  | Device | `device_id` (SKU) |
71
71
  |--------|-------------------|
@@ -76,7 +76,9 @@ Write these as **flat fields** on the block. The editor wraps them into `config`
76
76
  | XIAO 1.47" Touch Display | `100069905` |
77
77
  | reTerminal Sticky | `100056818` |
78
78
 
79
- 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.
79
+ When `muse_gadget` is `true`, set `full_flash` to `false`. The editor hides that checkbox until Muse is turned off. `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.
80
+
81
+ `full_flash: true` with `muse_gadget: false` is the switch back from a Muse image to another firmware. E1001 / E1002 then also rewrite the stock bootloader at `0x0` and the partition table at `0x8000`; the app stays at `0x90000`. Indicator, 1.47" Touch, Sticky, and Watcher non-Muse images are already merged at `0x0`, so the flag only turns on erase-all. Do not put the reTerminal stock bootloader into those images, and do not put it into a Muse image.
80
82
 
81
83
  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"`.
82
84
 
@@ -84,12 +86,12 @@ Checked Muse flash differences are documentation only. Do not implement them in
84
86
 
85
87
  | Device | Layout | Serial / reset |
86
88
  |--------|--------|----------------|
87
- | 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 |
88
- | 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` |
89
- | Sticky | Same four segments as Watcher, its own bootloader, no `nvsfactory` backup | Checked: `1a86:55d3`. Unchecked: no USB restriction, one merged image from `0x0` |
90
- | 1.47" Touch | Same four segments as Watcher, its own bootloader, no `nvsfactory` backup | `303a:1001`. Does not auto-reset after the write |
89
+ | E1001 / E1002 / Indicator | Five segments, no erase-all: `0x0` bootloader, `0x10000` partition table, `0x17000` OTA, `0x19000` PHY, app at `0x20000` | Close the port after the write. The user presses reset. Do not reopen the port immediately |
90
+ | Watcher | Four segments, no erase-all and no PHY: `0x0`, `0x10000`, OTA `0x1D000`, app `0x20000`. Do not download `nvsfactory` in the browser. Close the port after the write. Do not reset: an RTS pulse or an on-chip watchdog reset, followed by closing the port, exits macOS Chrome. The page asks the user to replug USB, then send the token | `1a86:55d2` |
91
+ | Sticky | Same four segments as Watcher, no erase-all, its own bootloader, no `nvsfactory` backup. Checked baud is 115200 | Checked: `1a86:55d3`. After the write, hard-reset, wait until the port is idle, then send the token at 115200 and close. Do not toggle the port in the same moment as the reset. Unchecked: no USB restriction, one merged image from `0x0`, watchdog reset after the write |
92
+ | 1.47" Touch | Same four segments as Watcher, no erase-all, its own bootloader, no `nvsfactory` backup | `303a:1001`. Close the port after the write. The user presses reset |
91
93
 
92
- Unchecked `muse_gadget` keeps the single-file device table below and does not require a token.
94
+ Unchecked `muse_gadget` keeps the single-file device table below and does not require a token. `full_flash` may still be `true` on a Muse SKU.
93
95
 
94
96
  | Device | `device_id` (SKU) | `flash_mode` | `flash_address` | File |
95
97
  |--------|-------------------|--------------|-----------------|------|
@@ -189,7 +191,8 @@ Used for **container / edge app** deployment UI inside the application doc.
189
191
  "firmware_name": "e1002-app.bin",
190
192
  "firmware_size": "1234567",
191
193
  "flash_address": "0x90000",
192
- "muse_gadget": false
194
+ "muse_gadget": false,
195
+ "full_flash": false
193
196
  }
194
197
  ]
195
198
  ```
@@ -1,8 +1,8 @@
1
1
  ---
2
2
  name: sensecraft-files
3
3
  description: >-
4
- Uploads images, model binaries, app files, firmware, documents, and archives
5
- to SenseCraft AI with acquire_file_url + PUT. Use when another workflow needs
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
6
  a file_url. Requires Access Key (`auth init --kind sensecap`).
7
7
  ---
8
8
 
@@ -14,23 +14,23 @@ Auth: **Access Key** → `{ai-host}/openapi`. Parent: [`../sensecraft-ai/SKILL.m
14
14
 
15
15
  1. Run `sensecraft-cli auth info` first.
16
16
  2. Use the correct `--type`; do not invent a file type:
17
- - `1` image — default **≤2 MB** (model `pic_url` / Console default); with `--for-app` or `--app-id` **≤5 MB** (app `images[]`); JPG/JPEG/PNG/GIF/WebP; no SVG
17
+ - `1` image — **≤5 MB** (model `pic_url` and app `images[]`); JPG/JPEG/PNG/GIF/WebP; no SVG
18
18
  - `2` generic file / model (default; **≤100 MB**)
19
19
  - `3` app (**≤100 MB**)
20
20
  - `4` firmware (**≤100 MB**)
21
- - `5` document (**≤100 MB**)
21
+ - `5` static resource (**≤100 MB**; **`--flow-id` required**)
22
22
  - `6` archive / ZIP (**≤100 MB**)
23
23
  3. Use `--checksum` when the downstream payload needs an MD5 (model uploads usually do).
24
- 4. **Attach before upload.** Types `1`/`2` refuse OSS PUT without association. If the user provides a file without a model/app id, **ask first** (do not call upload):
24
+ 4. **Attach before upload.** Types `1`/`2` refuse the OSS POST without association. If the user provides a file without a model/app id, **ask first** (do not call upload):
25
25
  - Existing model file: `model update --id <model_id> --path <file> --yes` or `model upload --path <file> --id <model_id> --yes` (auto-increments patch version, same as Console).
26
26
  - App cover: `file upload --path <img> --type 1 --app-id <app_id> --yes` (or unlinked `--type 1 --for-app`; max **16** images).
27
- - Model example image (`pic_url`): `file upload --path <img> --type 1 --unlinked` (**2 MB**), then put `file_url` into model JSON as `pic_url`.
27
+ - 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
28
  - 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
29
  5. Treat returned signed/upload URLs and private file URLs as secrets.
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 ≤ **100 MB**; images 2 MB (model) / 5 MB (app). Upload frequency is enforced by the server, not this CLI.
33
+ 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`.
34
34
 
35
35
  ## Examples
36
36
 
@@ -44,15 +44,15 @@ sensecraft-cli file upload --path ./cover.png --type 1 --app-id <app_id> --yes
44
44
  # Unlinked app image for later images[] JSON:
45
45
  sensecraft-cli file upload --path ./cover.png --type 1 --for-app
46
46
 
47
- # Model inference example image → pic_url (2 MB)
47
+ # Model inference example image → pic_url (5 MB)
48
48
  sensecraft-cli file upload --path ./demo.png --type 1 --unlinked
49
49
 
50
50
  # Unlinked only when creating a brand-new model (then put file_url into model create)
51
51
  sensecraft-cli model upload --path ./model.rknn --unlinked
52
52
 
53
- # Firmware, document, and archive (no model/app attach)
53
+ # Firmware, static resource, and archive (no model/app attach)
54
54
  sensecraft-cli file upload --path ./firmware.bin --type 4 --checksum
55
- sensecraft-cli file upload --path ./guide.pdf --type 5
55
+ sensecraft-cli file upload --path ./guide.pdf --type 5 --flow-id <flow_id>
56
56
  sensecraft-cli file upload --path ./dataset.zip --type 6 --checksum
57
57
 
58
58
  # Offline exercise: no network
@@ -4,31 +4,32 @@ Binary: `sensecraft-cli`. Auth: Access Key (`auth init --kind sensecap`).
4
4
 
5
5
  ## `file upload`
6
6
 
7
- Acquires an upload URL, PUTs the local bytes, and prints the permanent `file_url`.
7
+ Acquires an OSS POST policy, uploads the local file with multipart/form-data, and prints the permanent `file_url`.
8
8
 
9
9
  | Flag | Required | Default | Notes |
10
10
  |------|----------|---------|-------|
11
11
  | `--path` | yes | — | Local file |
12
- | `--type` | no | `2` | `1=image`, `2=file/model`, `3=app`, `4=firmware`, `5=doc`, `6=archive/zip` |
12
+ | `--type` | no | `2` | `1=image`, `2=file/model`, `3=app`, `4=firmware`, `5=static resource`, `6=archive/zip` |
13
+ | `--flow-id` | type 5 | — | Required for static resources; omitted for other types |
13
14
  | `--checksum` | no | false | Compute local MD5 and include it in output |
14
15
  | `--model-id` | no | — | Attach to this model (implies type=2 + checksum; **L2 `--yes`**; bumps version) |
15
16
  | `--app-id` | no | — | Attach as app cover (implies type=1, **5 MB**; **L2 `--yes`**; app `images[]` max **16**) |
16
- | `--for-app` | no | false | Unlinked type-1 for app `images[]` (**5 MB**); without it type-1 is **2 MB** (model `pic_url`) |
17
+ | `--for-app` | no | false | Unlinked type-1 for later app `images[]` JSON (same **5 MB** cap as every image) |
17
18
  | `--unlinked` | types 1–2 | — | Explicit orphan opt-in for later create/update JSON; required when no `--model-id`/`--app-id`/`--for-app` |
18
19
  | `--yes` | with attach | — | Required when `--model-id` or `--app-id` is set |
19
20
  | `--sandbox` | no | false | No network; return sample JSON |
20
21
 
21
- **Size / format (Console `upload.vue` / `infoForm` / `model/add.vue`):**
22
+ **Size / format:**
22
23
 
23
24
  | type | Max size | Formats / notes |
24
25
  |------|----------|-----------------|
25
- | `1` image (default / model `pic_url`) | **2 MB** | JPG/JPEG/PNG/GIF/WebP (SVG rejected); Console model example image |
26
- | `1` + `--for-app` or `--app-id` | **5 MB** | same formats; app `images[]` max **16** |
27
- | `2`–`6` | **100 MB** | per Console accept rules |
26
+ | `1` image (model `pic_url` and app `images[]`) | **5 MB** | JPG/JPEG/PNG/GIF/WebP (SVG rejected); app `images[]` max **16** |
27
+ | `2`–`4`, `6` | **100 MB** | suffix not checked locally |
28
+ | `5` static resource | **100 MB** | requires `--flow-id` |
28
29
 
29
30
  `app create/update --from-json` with `images[]` also enforces **max 16** URLs (Console `maxImageCount`).
30
31
 
31
- `--model-id` and `--app-id` are mutually exclusive. Types `1`/`2` without attach/`--for-app`/`--unlinked` exit non-zero **before** PUT (`ErrAttachRequired`). Types `3`–`6` upload directly.
32
+ `--model-id` and `--app-id` are mutually exclusive. Types `1`/`2` without attach/`--for-app`/`--unlinked` exit non-zero **before** the OSS POST (`ErrAttachRequired`). Types `3`–`6` upload directly. Type `5` without `--flow-id` exits before acquire.
32
33
 
33
34
  ```bash
34
35
  sensecraft-cli file upload --path ./cover.png --type 1 --for-app
@@ -38,7 +39,7 @@ sensecraft-cli file upload --path ./model.rknn --type 2 --checksum --unlinked
38
39
  sensecraft-cli file upload --path ./model.rknn --model-id <model_id> --yes
39
40
  sensecraft-cli file upload --path ./application.zip --type 3 --checksum
40
41
  sensecraft-cli file upload --path ./firmware.bin --type 4 --checksum
41
- sensecraft-cli file upload --path ./manual.pdf --type 5
42
+ sensecraft-cli file upload --path ./manual.pdf --type 5 --flow-id <flow_id>
42
43
  sensecraft-cli file upload --path ./dataset.zip --type 6 --checksum
43
44
  ```
44
45
 
@@ -167,7 +167,7 @@ Detection framework→algorithm and full upload constraints are in [reference-mo
167
167
  | Supported devices | `adapteds` / `uniform_types` | multi-select device types |
168
168
  | Tech | `version`, `precision`, `checksum`, `model_size`, `attr.conf`/`iou` | device-dependent |
169
169
  | File | `file_url` | uploaded model artifact; **omitted from public list/view stdout** |
170
- | Cover / demo | `pic_url` | inference example image (required on create UI; **≤2 MB** when uploading with `file upload --type 1`) |
170
+ | Cover / demo | `pic_url` | inference example image (required on create UI; **≤5 MB** when uploading with `file upload --type 1`) |
171
171
  | Visibility | `be_public` | `0` private · `1` public · `2` under review (display) |
172
172
  | 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
173
 
@@ -109,7 +109,7 @@ Unsupported combinations print structured JSON and exit non-zero.
109
109
  | `--yes` | with `--id` | L2; without it, attach does **not** upload |
110
110
  | `--sandbox` | no | Sample JSON, no network |
111
111
 
112
- When replacing an existing private model's artifact, pass `--id` so the file is attached and the **patch version auto-increments** (Console `incrementVersion`: `1.0.0` → `1.0.1` when `file_url` changes). This is L2 (`--yes`). Bare `model upload --path` (no `--id`/`--unlinked`) exits non-zero **before** PUT. Interactive TTY guides association; agents must ask the user first. JSON includes `attached`, `model_id`, `previous_version`, `version`.
112
+ When replacing an existing private model's artifact, pass `--id` so the file is attached and the **patch version auto-increments** (Console `incrementVersion`: `1.0.0` → `1.0.1` when `file_url` changes). This is L2 (`--yes`). Bare `model upload --path` (no `--id`/`--unlinked`) exits non-zero **before** the OSS upload. Interactive TTY guides association; agents must ask the user first. JSON includes `attached`, `model_id`, `previous_version`, `version`.
113
113
 
114
114
  ```bash
115
115
  # Existing model: attach + bump version
@@ -9,7 +9,7 @@ Aligned with Console `views/model/add.vue`, `detail.vue`, and `constants/sensecr
9
9
  | `name` | text | yes | max **64** (`SENSECRAFT_MODEL_NAME_MAX_LENGTH`); trim before API |
10
10
  | `description` | text | yes | max **300** |
11
11
  | `content` | rich text | yes | model detail / documentation body |
12
- | `pic_url` | image URL | yes | inference example image; upload via `file upload --type 1` (**≤2 MB**, Console `model/add.vue` max-size=2); JPG/PNG/GIF/WebP; must be http(s) URL |
12
+ | `pic_url` | image URL | yes | inference example image; upload via `file upload --type 1` (**≤5 MB**); JPG/PNG/GIF/WebP; must be http(s) URL |
13
13
  | `scenario` | option | yes | id from `get_constant` **`scenarios_array`** (not app `app_scenarios_array`); CLI rejects unknown ids |
14
14
  | `precision` | option | yes | id from **`model_precision_array`** (1=INT8, 2=FLOAT16, 3=FLOAT32 typical); CLI rejects unknown ids |
15
15
  | `file_url` | URL | yes | model binary URL; http(s); extension must match `model_format` |
@@ -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=…` or `/ai/application/detail/…`.
67
+ `console_url` is `/ai/model/detail?id=…` for a model, or `https://app.seeed.cc/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