@seeed-studio/sensecraft-cli 0.3.2 → 0.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/INSTALL.md +151 -190
- package/README-zh.md +463 -0
- package/README.md +9 -13
- package/package.json +2 -1
- package/scripts/test-install.js +1 -1
- package/skills/README.md +14 -35
- package/skills/sensecraft-cli/SKILL.md +134 -0
- package/skills/{sensecraft-apps → sensecraft-cli}/create-app/SKILL.md +16 -16
- package/skills/{sensecraft-apps → sensecraft-cli}/create-app/assets/manifest-template.json +1 -1
- package/skills/{sensecraft-apps/create-app/reference-manifest.md → sensecraft-cli/create-app/references/manifest.md} +17 -14
- package/skills/{sensecraft-apps/commands.md → sensecraft-cli/references/app-commands.md} +8 -10
- package/skills/{sensecraft-apps/reference-app-fields.md → sensecraft-cli/references/app-fields.md} +2 -2
- package/skills/{sensecraft-apps/SKILL.md → sensecraft-cli/references/apps.md} +26 -38
- package/skills/{sensecraft-devices-cloud/commands.md → sensecraft-cli/references/cloud-commands.md} +1 -1
- package/skills/{sensecraft-devices-cloud/SKILL.md → sensecraft-cli/references/cloud.md} +4 -14
- package/skills/{confirmation.md → sensecraft-cli/references/confirmation.md} +2 -2
- package/skills/{sensecraft-data/commands.md → sensecraft-cli/references/data-commands.md} +33 -12
- package/skills/{sensecraft-data/SKILL.md → sensecraft-cli/references/data.md} +10 -20
- package/skills/{sensecraft-files/commands.md → sensecraft-cli/references/file-commands.md} +1 -1
- package/skills/{sensecraft-files/SKILL.md → sensecraft-cli/references/files.md} +3 -11
- package/skills/{sensecraft-models/commands.md → sensecraft-cli/references/model-commands.md} +5 -6
- package/skills/{sensecraft-models/SKILL.md → sensecraft-cli/references/models.md} +17 -27
- package/skills/{sensecraft-recamera/commands.md → sensecraft-cli/references/recamera-commands.md} +3 -3
- package/skills/{sensecraft-recamera/SKILL.md → sensecraft-cli/references/recamera.md} +6 -16
- package/skills/{sensecraft-apps/reference-tool-blocks.md → sensecraft-cli/references/tool-blocks.md} +19 -3
- package/skills/sensecraft-ai/SKILL.md +0 -134
- /package/skills/{sensecraft-apps → sensecraft-cli}/create-app/assets/validate_manifest.py +0 -0
- /package/skills/{sensecraft-models/reference-model-fields.md → sensecraft-cli/references/model-fields.md} +0 -0
|
@@ -1,134 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: sensecraft-ai
|
|
3
|
-
description: >-
|
|
4
|
-
Routes SenseCraft AI platform work for Agents: Application Plaza, model library,
|
|
5
|
-
model upload, classic reCamera deploy page, and cloud deploy vs SenseCAP IoT CLI.
|
|
6
|
-
Use when the user mentions SenseCraft AI, 应用广场, App Square, 模型库, 上传模型,
|
|
7
|
-
reCamera, aiserverapi, or asks which SenseCraft skill/CLI profile to use.
|
|
8
|
-
Does not replace domain skills (apps/models/files/recamera) or sensecraft-data.
|
|
9
|
-
---
|
|
10
|
-
|
|
11
|
-
# SenseCraft AI (Meta)
|
|
12
|
-
|
|
13
|
-
Router skill for **SenseCraft AI** capabilities exposed via CLI in this repo (`sensecraft-cli`). 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
|
-
|
|
15
|
-
Sibling (already shipped): [`../sensecraft-data/SKILL.md`](../sensecraft-data/SKILL.md) — SenseCAP PaaS OpenAPI (`device` / `group` / `data`).
|
|
16
|
-
|
|
17
|
-
## Agent rules
|
|
18
|
-
|
|
19
|
-
1. **Pick the auth kind before any cloud call**
|
|
20
|
-
- `app` / `model` / `file` / `cloud` / `recamera` use SenseCAP **Access Key** → `{ai-host}/openapi` + HTTP Basic (no access_token, no `/aiserverapi`)
|
|
21
|
-
- Never send Access Key as a fake Bearer/JWT
|
|
22
|
-
2. **Always run auth check first** (ask user to fix if missing):
|
|
23
|
-
```bash
|
|
24
|
-
sensecraft-cli auth info
|
|
25
|
-
```
|
|
26
|
-
Published commands require an active **SenseCAP Access Key** → `{ai-host}/openapi` + HTTP Basic.
|
|
27
|
-
3. **Never run `auth init` on behalf of the user** — browser OAuth Device Flow, interactive TTY only. Tell the user to run locally:
|
|
28
|
-
```bash
|
|
29
|
-
sensecraft-cli auth init --kind sensecap # Access Key (app/model/file/cloud/recamera)
|
|
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, upload attach, cloud deploy, device bind/unbind, group create/rename/delete/move.
|
|
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
|
-
6. **Success = indented JSON on stdout**; failure = stderr + non-zero exit. Parse stdout only on success.
|
|
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.
|
|
36
|
-
|
|
37
|
-
## Auth model (same OAuth client, different persistence)
|
|
38
|
-
|
|
39
|
-
| Kind | After Device Flow (`client_id=sensecraft-cli`) | Daily API auth |
|
|
40
|
-
|------|-----------------------------------------------|----------------|
|
|
41
|
-
| `sensecap` | Exchange for Access Key; store `key_id` + `access_key` | HTTP Basic → SenseCAP `/openapi` **and** AI `{ai-host}/openapi` (app/model/file/cloud/recamera) |
|
|
42
|
-
|
|
43
|
-
### Site / `remote_type` (AI)
|
|
44
|
-
|
|
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` |
|
|
49
|
-
|
|
50
|
-
China 与 Global 使用同一个 AI host,账号中心不同。网页控制台仍是 `https://sensecraft.seeed.cc`。`SENSECRAFT_AUTH_HOST` 盖住账号中心(设备码、换 token、换 Access Key);设了之后 Global / China 都打到这个站点根,浏览器打开的是该服务返回的验证地址。
|
|
51
|
-
|
|
52
|
-
成功命令结束后,stderr 可能各有一条英文提示,同一条 24 小时内只出现一次。看到 `Warning: A new version of sensecraft-cli (<version>)` 时,完成当前请求后可以建议用户运行 `sensecraft-cli update`。看到 `Notice: SenseCraft AI is hosting the <name> activity` 时,把活动名称、日期和链接告诉用户。交互终端会问 `Ignore this activity? [y/N]`;用户回答 `y` 之后,这条活动不再提醒。不要替用户打开链接。
|
|
53
|
-
|
|
54
|
-
`auth info` shows the active Access Key (site, org, key id). Secrets are not printed.
|
|
55
|
-
|
|
56
|
-
## Intent → skill / command routing
|
|
57
|
-
|
|
58
|
-
| User intent | Use | Auth kind | Notes |
|
|
59
|
-
|-------------|-----|-----------|--------|
|
|
60
|
-
| SenseCAP list/bind device, groups, telemetry | [`sensecraft-data`](../sensecraft-data/SKILL.md) | `sensecap` | Shipped today |
|
|
61
|
-
| Browse / search App Plaza, view app | [`sensecraft-apps`](../sensecraft-apps/SKILL.md) + `app list` / `app view` | `sensecap` | **CLI shipped** (list/view) |
|
|
62
|
-
| App fields / tool-blocks / BOM guidance | same apps skill references | `sensecap` | Config OK; real flash = L3 |
|
|
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
|
-
| 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/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
|
-
| Model library search/view/download/constants | [`sensecraft-models`](../sensecraft-models/SKILL.md) | `sensecap` | **CLI shipped** |
|
|
67
|
-
| Upload / publish / unpublish / delete model | same + `model upload --id --yes` / `create\|update\|publish\|unpublish\|delete` | `sensecap` | Attach bumps patch version like Console |
|
|
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`. |
|
|
69
|
-
| reCamera Pro model library | [`sensecraft-models`](../sensecraft-models/SKILL.md) + `model create --target recamera-pro` / `recamera-pro resolve` | `sensecap` | Deploy is local IP/USB L3 — not `cloud deploy` |
|
|
70
|
-
| Jetson / cloud kit list & deploy | [`sensecraft-devices-cloud`](../sensecraft-devices-cloud/SKILL.md) + `cloud …` | `sensecap` | **CLI shipped** (list/view/deploy/order); not SenseCAP `device` |
|
|
71
|
-
| Local USB/IP model deploy or firmware flash | [`sensecraft-recamera`](../sensecraft-recamera/SKILL.md) then Console Deploy, or `/ai/device/local/32\|36\|37\|41\|52` | — | **L3 only**; CLI does not talk to the device |
|
|
72
|
-
|
|
73
|
-
## Cross-domain example
|
|
74
|
-
|
|
75
|
-
SenseCAP telemetry → pick public model → deploy to Jetson:
|
|
76
|
-
|
|
77
|
-
1. `sensecraft-cli auth info`
|
|
78
|
-
2. SenseCAP: `data latest --eui <sensecap-eui>` (Access Key)
|
|
79
|
-
3. AI: `model list --public --name "…"` → `model view --id …` (metadata only; **no** `model download`)
|
|
80
|
-
4. Confirm with user → `cloud deploy --eui <jetson-eui> --model-id … --yes` (device pulls firmware at apply time)
|
|
81
|
-
5. `cloud order --request-id …`
|
|
82
|
-
|
|
83
|
-
## Product-term disambiguation
|
|
84
|
-
|
|
85
|
-
| User says | Possible meanings | Default choice |
|
|
86
|
-
|-----------|-------------------|----------------|
|
|
87
|
-
| 应用 / App Store / Application | App Plaza (docs+BOM community app) vs in-doc deploy tool-block | **App Plaza** |
|
|
88
|
-
| 设备 / device | SenseCAP node/gateway vs Console kit/Jetson vs local USB board | Telemetry/bind → **sensecraft-data**; AI cloud device → devices-cloud; USB/serial → Console local (L3) |
|
|
89
|
-
| 部署模型 / deploy model | Cloud `deploy_model` vs local flash vs app tool-block | Ask which target; local flash = L3 |
|
|
90
|
-
| 模型下载地址 / 下载链接 / 怎么下载 | Public library artifact URL vs private owner file | **Public → no URL**, explain deploy; private My Models → `model download --out` (do not paste URL) |
|
|
91
|
-
| Data | SenseCAP telemetry vs training dataset | Telemetry → **sensecraft-data**; dataset → Console |
|
|
92
|
-
| Agent | Watcher Agent vs in-console AI Bot vs these Skills | These Skills ≠ Bot; Watcher has separate auth |
|
|
93
|
-
|
|
94
|
-
## Capability levels
|
|
95
|
-
|
|
96
|
-
| Level | Meaning | Examples |
|
|
97
|
-
|-------|---------|----------|
|
|
98
|
-
| L1 Scriptable | Agent may run directly | list / view / auth info |
|
|
99
|
-
| L2 Confirm | Ask user first | publish (+ declaration), unpublish, delete, deploy |
|
|
100
|
-
| L3 Interactive | Human-in-the-loop | `auth init`, Web Serial flash, payment |
|
|
101
|
-
| L4 Ops-only | Do not expose to end-user Agent | Admin `judge_app` |
|
|
102
|
-
|
|
103
|
-
## SenseCraft AI surface (shipped MVP)
|
|
104
|
-
|
|
105
|
-
Published commands use **SenseCAP Access Key** (`kind=sensecap`) → `{ai-host}/openapi`:
|
|
106
|
-
|
|
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/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
|
-
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
|
-
4. **Cloud devices** — `cloud device` / `cloud deploy` / `cloud order`.
|
|
111
|
-
5. **Classic reCamera 40** — `recamera check` / `recamera open` (Console AI deploy page; flash is L3).
|
|
112
|
-
6. **Local USB** — Other benches: Console `/ai/device/local/32|36|37|41|52`.
|
|
113
|
-
|
|
114
|
-
## When something is missing
|
|
115
|
-
|
|
116
|
-
Published AI CLI is `app` / `model` / `file` / `cloud` / `recamera`. If a command fails:
|
|
117
|
-
|
|
118
|
-
1. Run `sensecraft-cli auth info` — need an active SenseCAP Access Key.
|
|
119
|
-
2. Do **not** call SenseCAP `device`/`data` as a substitute.
|
|
120
|
-
3. Do **not** scrape Console cookies or invent HTTP with guessed tokens.
|
|
121
|
-
4. Prefer domain skills (`apps` / `files` / `models` / `recamera` / `devices-cloud`).
|
|
122
|
-
|
|
123
|
-
## Related files in this repo
|
|
124
|
-
|
|
125
|
-
| Path | Role |
|
|
126
|
-
|------|------|
|
|
127
|
-
| [`../sensecraft-data/SKILL.md`](../sensecraft-data/SKILL.md) | SenseCAP PaaS skill (shipped) |
|
|
128
|
-
| [`../sensecraft-data/commands.md`](../sensecraft-data/commands.md) | Full SenseCAP command reference |
|
|
129
|
-
| `skills/sensecraft-apps/` | App Plaza skill + field/block refs (**shipped**) |
|
|
130
|
-
| `skills/sensecraft-apps/create-app/` | App authoring sub-skill: one batch confirmation (**shipped**) |
|
|
131
|
-
| `skills/sensecraft-models/` | Model library skill + field refs (**shipped**) |
|
|
132
|
-
| `skills/sensecraft-recamera/` | Classic reCamera 40 pick → check → open deploy page (**shipped**) |
|
|
133
|
-
| `skills/sensecraft-devices-cloud/` | Jetson / cloud kit (**shipped**) |
|
|
134
|
-
| `skills/README.md` | Skill discovery for Agents |
|
|
File without changes
|
|
File without changes
|