@capybara-hq/plugin-device-local 0.1.0-rc.4 → 0.1.0-rc.5
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/.capybara-plugin/plugin.json +2 -2
- package/README.md +3 -4
- package/dist/index.mjs +1 -1
- package/guides/connect.md +17 -10
- package/guides/connect.zh.md +6 -7
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schemaVersion": 1,
|
|
3
3
|
"name": "device-local",
|
|
4
|
-
"version": "0.1.0-rc.
|
|
4
|
+
"version": "0.1.0-rc.5",
|
|
5
5
|
"publisher": "Capybara",
|
|
6
6
|
"description": {
|
|
7
7
|
"en": "Devices on people's own computers: a machine connected with capybara-device serves the device over the dial-in channel, and its owner limits it there",
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"entry": "./dist/index.mjs",
|
|
24
24
|
"manifest": {
|
|
25
25
|
"name": "device-local",
|
|
26
|
-
"version": "0.1.0-rc.
|
|
26
|
+
"version": "0.1.0-rc.5",
|
|
27
27
|
"sdk": "^0.1.0-rc.56",
|
|
28
28
|
"provides": [
|
|
29
29
|
"device-provider@1"
|
package/README.md
CHANGED
|
@@ -98,10 +98,9 @@ on it.
|
|
|
98
98
|
|
|
99
99
|
## Connecting a computer
|
|
100
100
|
|
|
101
|
-
The member guide `guides/connect.md` (place `device-connection
|
|
102
|
-
`
|
|
103
|
-
`capybara-device
|
|
104
|
-
`service start` (or `capybara-device start` in the foreground). Dial-in limits are the kernel's
|
|
101
|
+
The member guide `guides/connect.md` (place `device-connection`): `npm install -g @capybara-hq/device@next`,
|
|
102
|
+
`capybara-device login --url <deployment>`, then `capybara-device service install -c <device id>`
|
|
103
|
+
(it also starts the service; or `capybara-device start -c <device id>` in the foreground). Dial-in limits are the kernel's
|
|
105
104
|
`CAPYBARA_DEVICES__DIAL_IN__*` settings.
|
|
106
105
|
|
|
107
106
|
## Existing local devices
|
package/dist/index.mjs
CHANGED
|
@@ -4921,7 +4921,7 @@ function createDeviceLocalProvider(ctx, store, opts = {}) {
|
|
|
4921
4921
|
// src/index.ts
|
|
4922
4922
|
var plugin = defineExtension({
|
|
4923
4923
|
name: "device-local",
|
|
4924
|
-
version: "0.1.0-rc.
|
|
4924
|
+
version: "0.1.0-rc.5",
|
|
4925
4925
|
// ctx.dialIn.capacity and the handlers' connection argument are the rc.56 SDK's
|
|
4926
4926
|
sdk: "^0.1.0-rc.56",
|
|
4927
4927
|
provides: [DEVICE_PROVIDER_EXTENSION_POINT],
|
package/guides/connect.md
CHANGED
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
# Connect this machine
|
|
2
2
|
|
|
3
|
-
::shell-action connect-this-machine Connect this machine
|
|
4
|
-
|
|
5
3
|
A device on your own computer: the computer connects to the platform with the `capybara-device`
|
|
6
|
-
program and serves the device, and you limit what it may do there.
|
|
7
|
-
above connects the computer it runs on. Anywhere else, run these steps in a terminal on the
|
|
4
|
+
program and serves the device, and you limit what it may do there. Run these steps in a terminal on the
|
|
8
5
|
computer you want to connect (macOS or Linux, Node 22.12 or newer; on Windows use WSL).
|
|
9
6
|
|
|
10
7
|
## 1. Install the program
|
|
@@ -27,19 +24,29 @@ another computer into the same device replaces the first one.
|
|
|
27
24
|
## 3. Keep it online
|
|
28
25
|
|
|
29
26
|
```bash title="Connect at login (recommended)"
|
|
30
|
-
capybara-device service install
|
|
31
|
-
capybara-device service start
|
|
27
|
+
capybara-device service install -c <device id>
|
|
32
28
|
```
|
|
33
29
|
|
|
34
|
-
|
|
35
|
-
|
|
30
|
+
This is the command `login` printed at its end, with your device id: it installs the service,
|
|
31
|
+
starts it right away and connects again at every login. Or run
|
|
32
|
+
`capybara-device start -c <device id>` to connect in the foreground until you stop it. The device
|
|
33
|
+
shows as online once the program is connected; while it is offline, agents cannot use it.
|
|
34
|
+
|
|
35
|
+
**If this computer is already connected elsewhere.** Each device this computer serves is one
|
|
36
|
+
connection, kept under its device id, with its own service. Choosing a new device in the browser, or
|
|
37
|
+
moving a device here from another computer, adds a connection; signing in again to a device this
|
|
38
|
+
computer already serves keeps its connection (only the sign-in is renewed; then run
|
|
39
|
+
`capybara-device service restart -c <device id>` if its service is installed). With more than one
|
|
40
|
+
connection every command needs `-c <device id>` (or the device name or host, when it is unique);
|
|
41
|
+
with only one, `-c` may be left out. `capybara-device status` lists the connections with their ids,
|
|
42
|
+
and `login` prints the exact next command, id included, at its end.
|
|
36
43
|
|
|
37
44
|
## What it may do
|
|
38
45
|
|
|
39
46
|
Commands run in a sandbox on your computer, inside the device's directory
|
|
40
47
|
(`~/capybara-device/<device id>`). You set the owner ceiling on the computer:
|
|
41
|
-
`capybara-device ceiling show
|
|
42
|
-
the sandbox, the network, project reach). The organization's and the platform's settings apply as
|
|
48
|
+
`capybara-device ceiling show -c <device id>` shows it, `capybara-device ceiling set -c <device id>`
|
|
49
|
+
changes it (running outside the sandbox, the network, project reach); each connection has its own. The organization's and the platform's settings apply as
|
|
43
50
|
well; the narrowest wins. In OS mode commands run as your user with no CPU or memory limits.
|
|
44
51
|
|
|
45
52
|
Deleting the device revokes the computer's sign-in and stops the program; the files stay on your
|
package/guides/connect.zh.md
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
# 连接本机
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
在你自己的电脑上使用的设备:电脑用 `capybara-device` 程序连接到平台并为这台设备服务,由你在本机限制它能做什么。在桌面应用里,点上面的按钮即可连接正在运行它的这台电脑;在其他地方,请在要连接的电脑的终端里依次执行下面的步骤(macOS 或 Linux,Node 22.12 或更高版本;Windows 请使用 WSL)。
|
|
3
|
+
在你自己的电脑上使用的设备:电脑用 `capybara-device` 程序连接到平台并为这台设备服务,由你在本机限制它能做什么。请在要连接的电脑的终端里依次执行下面的步骤(macOS 或 Linux,Node 22.12 或更高版本;Windows 请使用 WSL)。
|
|
6
4
|
|
|
7
5
|
## 1. 安装连接程序
|
|
8
6
|
|
|
@@ -21,15 +19,16 @@ capybara-device login --url {{publicUrl}}
|
|
|
21
19
|
## 3. 保持在线
|
|
22
20
|
|
|
23
21
|
```bash title="开机自动连接(推荐)"
|
|
24
|
-
capybara-device service install
|
|
25
|
-
capybara-device service start
|
|
22
|
+
capybara-device service install -c <device id>
|
|
26
23
|
```
|
|
27
24
|
|
|
28
|
-
|
|
25
|
+
这就是 `login` 在结尾打印的命令(带着你的设备 id):它会安装服务并立即启动,之后每次登录都会自动连接。也可以运行 `capybara-device start -c <设备 id>` 在前台连接,直到你停止它。程序连接后设备显示为在线;离线时智能体无法使用它。
|
|
26
|
+
|
|
27
|
+
**如果这台电脑已经连接了其他平台或组织。** 这台电脑服务的每台设备对应一个连接,以设备 id 保存,各有自己的服务。在浏览器里选择新建设备,或把另一台电脑上的设备移到这里,都会新增一个连接;重新登录这台电脑已在服务的设备,则沿用原来的连接(只更新登录凭据;若已安装它的服务,接着运行 `capybara-device service restart -c <设备 id>`)。有多个连接时,每条命令都需要加 `-c <设备 id>`(设备名称或主机名唯一时也可以用它们);只有一个连接时可以省略 `-c`。`capybara-device status` 会列出所有连接及其 id,`login` 的结尾会打印带有 id 的下一步命令。
|
|
29
28
|
|
|
30
29
|
## 它能做什么
|
|
31
30
|
|
|
32
|
-
命令在你电脑上的沙箱里运行,位于设备目录(`~/capybara-device/<设备 id>`)内。你在本机设置所有者上限:`capybara-device ceiling show
|
|
31
|
+
命令在你电脑上的沙箱里运行,位于设备目录(`~/capybara-device/<设备 id>`)内。你在本机设置所有者上限:`capybara-device ceiling show -c <设备 id>` 查看,`capybara-device ceiling set -c <设备 id>` 修改(是否允许在沙箱外运行、网络、项目范围),每个连接各有一份。组织和平台的设置同样生效,以最严格的为准。OS 模式下命令以你的用户身份运行,没有 CPU 和内存限制。
|
|
33
32
|
|
|
34
33
|
删除设备会撤销这台电脑的登录并停止程序,文件仍保留在你的电脑上。
|
|
35
34
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@capybara-hq/plugin-device-local",
|
|
3
|
-
"version": "0.1.0-rc.
|
|
3
|
+
"version": "0.1.0-rc.5",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"description": "Devices on people's own computers: a machine connected with capybara-device serves the device over the dial-in channel, and its owner limits it there",
|