@capybara-hq/kernel 0.1.0-rc.12 → 0.1.0-rc.13
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/dist/admin/admin.schemas.d.ts +13 -0
- package/dist/agents/agent-lookup.d.ts +5 -0
- package/dist/agents/agent-lookup.js +15 -0
- package/dist/background/background.module.js +2 -2
- package/dist/background/launch-lock.d.ts +1 -1
- package/dist/background/launch-lock.js +1 -1
- package/dist/background/poll.job.d.ts +2 -2
- package/dist/background/poll.job.js +10 -10
- package/dist/background/stop.d.ts +1 -1
- package/dist/background/stop.js +3 -3
- package/dist/background/store.d.ts +5 -5
- package/dist/background/store.js +5 -5
- package/dist/background/tasks.service.d.ts +6 -6
- package/dist/background/tasks.service.js +13 -13
- package/dist/catalog/marketplaces.service.d.ts +1 -1
- package/dist/channels/channels.module.js +2 -2
- package/dist/channels/inbound.d.ts +8 -8
- package/dist/channels/inbound.js +31 -31
- package/dist/channels/phrases.d.ts +27 -27
- package/dist/channels/phrases.js +27 -27
- package/dist/config/docs.js +1 -1
- package/dist/config/schema.d.ts +2 -2
- package/dist/config/schema.js +21 -21
- package/dist/conversations/conversations.controller.d.ts +11 -11
- package/dist/conversations/conversations.controller.js +15 -15
- package/dist/conversations/conversations.module.d.ts +1 -1
- package/dist/conversations/conversations.module.js +7 -7
- package/dist/conversations/conversations.schemas.js +1 -1
- package/dist/conversations/conversations.service.d.ts +14 -14
- package/dist/conversations/conversations.service.js +19 -19
- package/dist/conversations/{environment-status.d.ts → device-status.d.ts} +9 -9
- package/dist/conversations/{environment-status.js → device-status.js} +18 -18
- package/dist/conversations/event-log.d.ts +1 -1
- package/dist/conversations/event-log.js +1 -1
- package/dist/conversations/events.d.ts +1 -1
- package/dist/conversations/events.js +2 -2
- package/dist/ctx/create-ctx.d.ts +10 -1
- package/dist/ctx/create-ctx.js +86 -25
- package/dist/db/kernel-schema.d.ts +26 -23
- package/dist/{environments → devices}/access.d.ts +19 -19
- package/dist/{environments → devices}/access.js +28 -28
- package/dist/devices/conversation-devices.d.ts +75 -0
- package/dist/{environments/conversation-environments.js → devices/conversation-devices.js} +71 -72
- package/dist/devices/devices.controller.d.ts +36 -0
- package/dist/{environments/environments.controller.js → devices/devices.controller.js} +37 -37
- package/dist/devices/devices.module.d.ts +5 -13
- package/dist/devices/devices.module.js +16 -29
- package/dist/devices/devices.schemas.d.ts +3 -0
- package/dist/devices/devices.schemas.js +14 -0
- package/dist/{environments/environments.service.d.ts → devices/devices.service.d.ts} +70 -70
- package/dist/{environments/environments.service.js → devices/devices.service.js} +122 -122
- package/dist/devices/dto.d.ts +13 -54
- package/dist/devices/dto.js +7 -39
- package/dist/devices/label.d.ts +11 -0
- package/dist/{environments → devices}/label.js +7 -7
- package/dist/{environments → devices}/legacy-cleanup.job.d.ts +3 -3
- package/dist/{environments → devices}/legacy-cleanup.job.js +3 -3
- package/dist/errors.d.ts +25 -25
- package/dist/errors.js +25 -25
- package/dist/evals/recorded-tools.d.ts +2 -2
- package/dist/evals/recorded-tools.js +6 -6
- package/dist/extensions/admin-ops.js +1 -0
- package/dist/extensions/admin-view.js +2 -0
- package/dist/extensions/effective-config.d.ts +6 -0
- package/dist/extensions/effective-config.js +18 -7
- package/dist/extensions/host.d.ts +13 -2
- package/dist/extensions/host.js +24 -3
- package/dist/extensions/instance.d.ts +12 -1
- package/dist/extensions/instance.js +13 -0
- package/dist/extensions/permission-view.d.ts +10 -1
- package/dist/files/previewers.d.ts +1 -1
- package/dist/files/previewers.js +1 -1
- package/dist/http/api.module.js +10 -6
- package/dist/http/gateway-routes.d.ts +1 -1
- package/dist/http/gateway-routes.js +1 -1
- package/dist/identity/settings.d.ts +32 -0
- package/dist/identity/settings.js +26 -2
- package/dist/infra/config/kernel-config.service.js +4 -4
- package/dist/kernel.module.js +3 -3
- package/dist/{devices → local-devices}/device-auth.controller.d.ts +6 -6
- package/dist/{devices → local-devices}/device-auth.controller.js +5 -5
- package/dist/{devices → local-devices}/device-auth.d.ts +20 -20
- package/dist/{devices → local-devices}/device-auth.js +51 -53
- package/dist/local-devices/device-auth.module.d.ts +7 -0
- package/dist/{devices → local-devices}/device-auth.module.js +5 -5
- package/dist/{devices → local-devices}/device-routes.d.ts +3 -3
- package/dist/{devices → local-devices}/device-routes.js +2 -2
- package/dist/local-devices/dto.d.ts +66 -0
- package/dist/local-devices/dto.js +44 -0
- package/dist/{devices → local-devices}/keys.d.ts +11 -11
- package/dist/{devices → local-devices}/keys.js +11 -11
- package/dist/{devices/device-gateway.d.ts → local-devices/local-device-gateway.d.ts} +14 -14
- package/dist/{devices/device-gateway.js → local-devices/local-device-gateway.js} +44 -44
- package/dist/{devices/device-provider.d.ts → local-devices/local-device-provider.d.ts} +15 -15
- package/dist/{devices/device-provider.js → local-devices/local-device-provider.js} +23 -23
- package/dist/local-devices/local-devices.module.d.ts +16 -0
- package/dist/local-devices/local-devices.module.js +44 -0
- package/dist/{devices → local-devices}/machines.d.ts +26 -26
- package/dist/{devices → local-devices}/machines.js +71 -71
- package/dist/{devices → local-devices}/relay.d.ts +15 -15
- package/dist/{devices → local-devices}/relay.js +55 -55
- package/dist/{devices → local-devices}/targets.d.ts +8 -8
- package/dist/{devices → local-devices}/targets.js +14 -14
- package/dist/orgs/offboarding.d.ts +6 -6
- package/dist/orgs/offboarding.js +12 -12
- package/dist/orgs/settings.service.d.ts +28 -0
- package/dist/orgs/settings.service.js +20 -1
- package/dist/platform/exclusions.js +38 -3
- package/dist/platform/operation.js +6 -2
- package/dist/platform/ops/admin.ops.js +8 -2
- package/dist/platform/ops/conversations.ops.d.ts +3 -3
- package/dist/platform/ops/conversations.ops.js +9 -9
- package/dist/platform/ops/devices.ops.d.ts +26 -0
- package/dist/platform/ops/devices.ops.js +311 -0
- package/dist/platform/ops/org-settings.ops.js +2 -2
- package/dist/platform/ops/orgs.ops.js +1 -0
- package/dist/platform/ops/ui.ops.d.ts +8 -0
- package/dist/platform/ops/ui.ops.js +41 -0
- package/dist/platform/platform-ops.module.d.ts +3 -2
- package/dist/platform/platform-ops.module.js +8 -5
- package/dist/platform/route-schemas.js +6 -3
- package/dist/roles/gateway-role.d.ts +3 -3
- package/dist/roles/gateway-role.js +4 -4
- package/dist/roles/gateway.module.d.ts +1 -1
- package/dist/roles/gateway.module.js +5 -5
- package/dist/roles/worker.module.js +1 -1
- package/dist/runtime/context/build.d.ts +1 -1
- package/dist/runtime/context/build.js +6 -6
- package/dist/runtime/context/compaction.js +1 -1
- package/dist/runtime/context/{environment-paths.d.ts → device-paths.d.ts} +11 -11
- package/dist/runtime/context/{environment-paths.js → device-paths.js} +13 -13
- package/dist/runtime/maintenance.d.ts +1 -1
- package/dist/sandbox/jobs.d.ts +13 -13
- package/dist/sandbox/jobs.js +20 -20
- package/dist/sandbox/leases.d.ts +9 -9
- package/dist/sandbox/leases.js +14 -14
- package/dist/sandbox/providers.d.ts +8 -8
- package/dist/sandbox/providers.js +8 -8
- package/dist/sandbox/sandbox.module.d.ts +1 -1
- package/dist/sandbox/sandbox.module.js +1 -1
- package/dist/sandbox/sandbox.service.d.ts +76 -76
- package/dist/sandbox/sandbox.service.js +230 -230
- package/dist/tools/builtins/builtin-tools.d.ts +2 -2
- package/dist/tools/builtins/builtin-tools.js +5 -5
- package/dist/tools/builtins/platform.js +1 -1
- package/dist/tools/builtins/sandbox/bash.js +6 -6
- package/dist/tools/builtins/sandbox/common.d.ts +25 -25
- package/dist/tools/builtins/sandbox/common.js +51 -51
- package/dist/tools/builtins/sandbox/edit.js +2 -2
- package/dist/tools/builtins/sandbox/index.d.ts +1 -1
- package/dist/tools/builtins/sandbox/index.js +1 -1
- package/dist/tools/builtins/sandbox/task-output.d.ts +6 -6
- package/dist/tools/builtins/sandbox/task-output.js +10 -10
- package/dist/tools/builtins/sandbox/task-stop.js +2 -2
- package/dist/tools/builtins/sandbox/write.js +2 -2
- package/dist/tools/builtins/skill-load.d.ts +1 -1
- package/dist/tools/builtins/skill-load.js +2 -2
- package/dist/tools/pipeline.js +4 -3
- package/dist/tools/registry.d.ts +2 -2
- package/dist/tools/tools.module.js +3 -3
- package/dist/ui/admin-ui.controller.d.ts +56 -0
- package/dist/ui/admin-ui.controller.js +192 -0
- package/dist/ui/arrangement.d.ts +74 -0
- package/dist/ui/arrangement.js +98 -0
- package/dist/ui/embed-token.d.ts +2 -2
- package/dist/ui/embed-token.js +30 -5
- package/dist/ui/registry.d.ts +29 -14
- package/dist/ui/registry.js +31 -10
- package/dist/ui/slots.controller.d.ts +11 -0
- package/dist/ui/slots.controller.js +25 -0
- package/dist/ui/ui-stream.d.ts +20 -3
- package/dist/ui/ui-stream.js +25 -7
- package/dist/ui/ui.schemas.d.ts +66 -0
- package/dist/ui/ui.schemas.js +65 -0
- package/dist/ui/views.controller.d.ts +35 -49
- package/dist/ui/views.controller.js +48 -70
- package/dist/ui/views.d.ts +84 -18
- package/dist/ui/views.js +201 -38
- package/package.json +3 -3
- package/src/migrations/0105_devices_rename.sql +136 -0
- package/dist/devices/device-auth.module.d.ts +0 -7
- package/dist/environments/conversation-environments.d.ts +0 -75
- package/dist/environments/dto.d.ts +0 -25
- package/dist/environments/dto.js +0 -12
- package/dist/environments/environments.controller.d.ts +0 -36
- package/dist/environments/environments.module.d.ts +0 -8
- package/dist/environments/environments.module.js +0 -31
- package/dist/environments/environments.schemas.d.ts +0 -3
- package/dist/environments/environments.schemas.js +0 -14
- package/dist/environments/label.d.ts +0 -11
- package/dist/platform/ops/environments.ops.d.ts +0 -26
- package/dist/platform/ops/environments.ops.js +0 -311
|
@@ -11,33 +11,33 @@ export declare const CHANNEL_PHRASES: {
|
|
|
11
11
|
readonly zh: "已开始新对话";
|
|
12
12
|
readonly en: "Started a new conversation.";
|
|
13
13
|
};
|
|
14
|
-
/**
|
|
15
|
-
readonly
|
|
16
|
-
readonly zh: "
|
|
17
|
-
readonly en: "Your
|
|
18
|
-
};
|
|
19
|
-
/**
|
|
20
|
-
readonly
|
|
21
|
-
readonly zh: "
|
|
22
|
-
readonly en: "Your next new conversation will use the
|
|
23
|
-
};
|
|
24
|
-
/**
|
|
25
|
-
readonly
|
|
26
|
-
readonly zh: "没有找到名为「{name}
|
|
27
|
-
readonly en: "No
|
|
28
|
-
};
|
|
29
|
-
/** `/
|
|
30
|
-
readonly
|
|
31
|
-
readonly zh: "
|
|
32
|
-
readonly en: "The
|
|
33
|
-
};
|
|
34
|
-
/**
|
|
35
|
-
readonly
|
|
36
|
-
readonly zh: "
|
|
37
|
-
readonly en: "You have no usable
|
|
38
|
-
};
|
|
39
|
-
/**
|
|
40
|
-
readonly
|
|
14
|
+
/** Direct message `/device`: lists the usable devices (`{list}` one per line, the current one marked). */
|
|
15
|
+
readonly deviceList: {
|
|
16
|
+
readonly zh: "你的设备:\n{list}\n发送 /device <名称> 选择下一个新对话使用的设备。";
|
|
17
|
+
readonly en: "Your devices:\n{list}\nSend /device <name> to choose the one your next new conversation uses.";
|
|
18
|
+
};
|
|
19
|
+
/** After a direct message `/device <name>` (`{name}` is the device's name). */
|
|
20
|
+
readonly deviceSwitched: {
|
|
21
|
+
readonly zh: "下一个新对话将使用设备「{name}」,发送 /new 开始。";
|
|
22
|
+
readonly en: "Your next new conversation will use the device “{name}”; send /new to start one.";
|
|
23
|
+
};
|
|
24
|
+
/** `/device <name>` matches no usable device (`{list}` as in deviceList). */
|
|
25
|
+
readonly deviceUnknown: {
|
|
26
|
+
readonly zh: "没有找到名为「{name}」的设备。你的设备:\n{list}";
|
|
27
|
+
readonly en: "No device named “{name}”. Your devices:\n{list}";
|
|
28
|
+
};
|
|
29
|
+
/** `/device <name>` names an existing device that is unavailable now (`{list}` as in deviceList). */
|
|
30
|
+
readonly deviceUnavailable: {
|
|
31
|
+
readonly zh: "设备「{name}」当前不可用(它的文件由未启用的沙箱提供方保存)。你的设备:\n{list}";
|
|
32
|
+
readonly en: "The device “{name}” is unavailable: its files are kept by a sandbox provider that is not active. Your devices:\n{list}";
|
|
33
|
+
};
|
|
34
|
+
/** Direct message `/device` when the person has no usable device (no cloud sandbox in the deployment). */
|
|
35
|
+
readonly deviceNone: {
|
|
36
|
+
readonly zh: "你目前没有可用的设备。";
|
|
37
|
+
readonly en: "You have no usable devices.";
|
|
38
|
+
};
|
|
39
|
+
/** The mark of the current IM default device in the device list. */
|
|
40
|
+
readonly deviceCurrent: {
|
|
41
41
|
readonly zh: "(当前)";
|
|
42
42
|
readonly en: " (current)";
|
|
43
43
|
};
|
package/dist/channels/phrases.js
CHANGED
|
@@ -6,33 +6,33 @@
|
|
|
6
6
|
export const CHANNEL_PHRASES = {
|
|
7
7
|
/** 私聊 `/new` 之后。 */
|
|
8
8
|
newConversation: { zh: "已开始新对话", en: "Started a new conversation." },
|
|
9
|
-
/**
|
|
10
|
-
|
|
11
|
-
zh: "
|
|
12
|
-
en: "Your
|
|
13
|
-
},
|
|
14
|
-
/**
|
|
15
|
-
|
|
16
|
-
zh: "
|
|
17
|
-
en: "Your next new conversation will use the
|
|
18
|
-
},
|
|
19
|
-
/**
|
|
20
|
-
|
|
21
|
-
zh: "没有找到名为「{name}
|
|
22
|
-
en: "No
|
|
23
|
-
},
|
|
24
|
-
/** `/
|
|
25
|
-
|
|
26
|
-
zh: "
|
|
27
|
-
en: "The
|
|
28
|
-
},
|
|
29
|
-
/**
|
|
30
|
-
|
|
31
|
-
zh: "
|
|
32
|
-
en: "You have no usable
|
|
33
|
-
},
|
|
34
|
-
/**
|
|
35
|
-
|
|
9
|
+
/** Direct message `/device`: lists the usable devices (`{list}` one per line, the current one marked). */
|
|
10
|
+
deviceList: {
|
|
11
|
+
zh: "你的设备:\n{list}\n发送 /device <名称> 选择下一个新对话使用的设备。",
|
|
12
|
+
en: "Your devices:\n{list}\nSend /device <name> to choose the one your next new conversation uses.",
|
|
13
|
+
},
|
|
14
|
+
/** After a direct message `/device <name>` (`{name}` is the device's name). */
|
|
15
|
+
deviceSwitched: {
|
|
16
|
+
zh: "下一个新对话将使用设备「{name}」,发送 /new 开始。",
|
|
17
|
+
en: "Your next new conversation will use the device \u201c{name}\u201d; send /new to start one.",
|
|
18
|
+
},
|
|
19
|
+
/** `/device <name>` matches no usable device (`{list}` as in deviceList). */
|
|
20
|
+
deviceUnknown: {
|
|
21
|
+
zh: "没有找到名为「{name}」的设备。你的设备:\n{list}",
|
|
22
|
+
en: "No device named \u201c{name}\u201d. Your devices:\n{list}",
|
|
23
|
+
},
|
|
24
|
+
/** `/device <name>` names an existing device that is unavailable now (`{list}` as in deviceList). */
|
|
25
|
+
deviceUnavailable: {
|
|
26
|
+
zh: "设备「{name}」当前不可用(它的文件由未启用的沙箱提供方保存)。你的设备:\n{list}",
|
|
27
|
+
en: "The device \u201c{name}\u201d is unavailable: its files are kept by a sandbox provider that is not active. Your devices:\n{list}",
|
|
28
|
+
},
|
|
29
|
+
/** Direct message `/device` when the person has no usable device (no cloud sandbox in the deployment). */
|
|
30
|
+
deviceNone: {
|
|
31
|
+
zh: "你目前没有可用的设备。",
|
|
32
|
+
en: "You have no usable devices.",
|
|
33
|
+
},
|
|
34
|
+
/** The mark of the current IM default device in the device list. */
|
|
35
|
+
deviceCurrent: { zh: "(当前)", en: " (current)" },
|
|
36
36
|
/** 未绑定的人在私聊里发消息:附绑定卡片。 */
|
|
37
37
|
bindPrompt: {
|
|
38
38
|
zh: "请先绑定你的 Capybara 账号,再与我对话。",
|
package/dist/config/docs.js
CHANGED
|
@@ -82,7 +82,7 @@ export function renderConfigDocs(schema) {
|
|
|
82
82
|
"| `CAPYBARA_WEB_OBJECT_STORE_URL` | Object storage on the web origin: the object store's address as web reaches it (e.g. `http://seaweedfs-s3:8333`). When set, web proxies `/<bucket>/**` (and `/<bucket>` itself for POST only) there, so browsers upload attachments (presigned POST) and download attachments and artifacts (presigned GET) through web; set the object-store extension's `publicEndpoint` to the web origin with `forcePathStyle: true`. Only GET, HEAD and POST; the path is forwarded unchanged; cookies and authorization are not forwarded; responses carry `X-Content-Type-Options: nosniff` and `Content-Security-Policy: sandbox`; uploads are capped at `CAPYBARA_WEB_MAX_PACKAGE_BYTES`. Unset (default): off |",
|
|
83
83
|
"| `CAPYBARA_WEB_OBJECT_STORE_BUCKET` | With `CAPYBARA_WEB_OBJECT_STORE_URL`: the bucket, equal to the object-store extension's `bucket` (it is the first path segment web proxies) |",
|
|
84
84
|
"| `CAPYBARA_WEB_OBJECT_STORE_PUBLIC_HOST` | With `CAPYBARA_WEB_OBJECT_STORE_URL`: the host of the extension's `publicEndpoint` (a host such as `capybara.example.com`, or that URL). Sent upstream as `Host` instead of the incoming one, because presigned URLs sign the host they were issued for and front proxies rewrite it |",
|
|
85
|
-
"| `CAPYBARA_WEB_GATEWAY_URL` |
|
|
85
|
+
"| `CAPYBARA_WEB_GATEWAY_URL` | Local devices on the web origin: a `gateway` replica's address as web reaches it (an http(s) URL, e.g. `http://gateway:8080`). WebSocket upgrades on exactly `/device/connect` are forwarded to it (`capybara-device` connects at `<http.publicUrl>/device/connect`). Unset, they go to `CAPYBARA_KERNEL_URL` (the kernel runs every role unless the deployment splits them), so only deployments with separate gateway replicas set it (compose does). A malformed value stops the web tier at startup |",
|
|
86
86
|
"| `CAPYBARA_DEV_UI` | When set to `1`, production builds also serve the `/dev/ui` component catalog page (off by default) |",
|
|
87
87
|
"",
|
|
88
88
|
].join("\n");
|
package/dist/config/schema.d.ts
CHANGED
|
@@ -219,9 +219,9 @@ export declare const KernelConfigSchema: z.ZodObject<{
|
|
|
219
219
|
allowHosts: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
220
220
|
}, z.core.$strip>>;
|
|
221
221
|
}, z.core.$strip>>;
|
|
222
|
-
|
|
222
|
+
devices: z.ZodPrefault<z.ZodObject<{
|
|
223
223
|
maxPersonal: z.ZodDefault<z.ZodNumber>;
|
|
224
|
-
|
|
224
|
+
local: z.ZodPrefault<z.ZodObject<{
|
|
225
225
|
reconnectGraceSeconds: z.ZodDefault<z.ZodNumber>;
|
|
226
226
|
leaseTtlMs: z.ZodDefault<z.ZodNumber>;
|
|
227
227
|
authCodeTtlSeconds: z.ZodDefault<z.ZodNumber>;
|
package/dist/config/schema.js
CHANGED
|
@@ -1037,14 +1037,14 @@ export const KernelConfigSchema = z.object({
|
|
|
1037
1037
|
.min(1)
|
|
1038
1038
|
.optional()
|
|
1039
1039
|
.meta(meta({
|
|
1040
|
-
description: "Image for
|
|
1040
|
+
description: "Image for cloud device instances, passed to the sandbox extension; unset (the default), each extension uses the image published with its own version (ghcr.io/capybara-hq/capybara-sandbox). Set it to a locally built or mirrored image for offline deployments; an extension that builds instances from its own template may ignore it",
|
|
1041
1041
|
})),
|
|
1042
1042
|
lockWaitSeconds: z
|
|
1043
1043
|
.number()
|
|
1044
1044
|
.positive()
|
|
1045
1045
|
.default(75)
|
|
1046
1046
|
.meta(meta({
|
|
1047
|
-
description: "Seconds a sandbox call waits for the
|
|
1047
|
+
description: "Seconds a sandbox call waits for the device's instance (while it is being created, resumed or suspended, or all its concurrent command slots are taken) before failing with sandbox.busy; keep it above the 60-second sandbox lock TTL so a call after a replica crash waits for the dead replica's lock to expire",
|
|
1048
1048
|
})),
|
|
1049
1049
|
maxConcurrentCommands: z
|
|
1050
1050
|
.number()
|
|
@@ -1054,7 +1054,7 @@ export const KernelConfigSchema = z.object({
|
|
|
1054
1054
|
.default(6)
|
|
1055
1055
|
.meta(meta({
|
|
1056
1056
|
hot: true,
|
|
1057
|
-
description: "Sandbox commands and file operations that may run at the same time in one
|
|
1057
|
+
description: "Sandbox commands and file operations that may run at the same time in one device, shared by all its conversations and their sub-agents; 1 runs them one at a time",
|
|
1058
1058
|
})),
|
|
1059
1059
|
deliverMaxBytes: z
|
|
1060
1060
|
.number()
|
|
@@ -1073,7 +1073,7 @@ export const KernelConfigSchema = z.object({
|
|
|
1073
1073
|
.max(100)
|
|
1074
1074
|
.default(4)
|
|
1075
1075
|
.meta(meta({
|
|
1076
|
-
description: "Most background Bash tasks (run_in_background) that may run at once in one conversation, its sub-agents included (counted per root conversation, not per
|
|
1076
|
+
description: "Most background Bash tasks (run_in_background) that may run at once in one conversation, its sub-agents included (counted per root conversation, not per device); a launch beyond it is refused",
|
|
1077
1077
|
})),
|
|
1078
1078
|
maxSeconds: z
|
|
1079
1079
|
.number()
|
|
@@ -1089,7 +1089,7 @@ export const KernelConfigSchema = z.object({
|
|
|
1089
1089
|
.min(1)
|
|
1090
1090
|
.default(10)
|
|
1091
1091
|
.meta(meta({
|
|
1092
|
-
description: "How often the worker checks the running background Bash tasks of every
|
|
1092
|
+
description: "How often the worker checks the running background Bash tasks of every device for a finish, in seconds; read when the worker starts",
|
|
1093
1093
|
})),
|
|
1094
1094
|
})
|
|
1095
1095
|
.prefault({}),
|
|
@@ -1100,7 +1100,7 @@ export const KernelConfigSchema = z.object({
|
|
|
1100
1100
|
.positive()
|
|
1101
1101
|
.default(1)
|
|
1102
1102
|
.meta(meta({
|
|
1103
|
-
description: "CPU cores for each
|
|
1103
|
+
description: "CPU cores for each cloud device instance; applies to instances created after the change (an extension that sizes instances by its own template, such as E2B, may not apply it)",
|
|
1104
1104
|
})),
|
|
1105
1105
|
memoryMb: z
|
|
1106
1106
|
.number()
|
|
@@ -1108,7 +1108,7 @@ export const KernelConfigSchema = z.object({
|
|
|
1108
1108
|
.positive()
|
|
1109
1109
|
.default(2048)
|
|
1110
1110
|
.meta(meta({
|
|
1111
|
-
description: "Memory limit of each
|
|
1111
|
+
description: "Memory limit of each cloud device instance in MiB; applies to instances created after the change (an extension that sizes instances by its own template, such as E2B, may not apply it)",
|
|
1112
1112
|
})),
|
|
1113
1113
|
diskMb: z
|
|
1114
1114
|
.number()
|
|
@@ -1116,7 +1116,7 @@ export const KernelConfigSchema = z.object({
|
|
|
1116
1116
|
.positive()
|
|
1117
1117
|
.default(5120)
|
|
1118
1118
|
.meta(meta({
|
|
1119
|
-
description: "Disk limit of each
|
|
1119
|
+
description: "Disk limit of each cloud device's file system in MiB; applies to file systems created after the change (Docker: only with a volume driver that supports size; an extension whose storage cannot be sized may not apply it)",
|
|
1120
1120
|
})),
|
|
1121
1121
|
maxCommandSeconds: z
|
|
1122
1122
|
.number()
|
|
@@ -1132,7 +1132,7 @@ export const KernelConfigSchema = z.object({
|
|
|
1132
1132
|
.positive()
|
|
1133
1133
|
.default(10)
|
|
1134
1134
|
.meta(meta({
|
|
1135
|
-
description: "Minutes without a command from any conversation of the
|
|
1135
|
+
description: "Minutes without a command from any conversation of the device before its running instance is suspended (files are kept, processes end)",
|
|
1136
1136
|
})),
|
|
1137
1137
|
destroyAfterInactiveDays: z
|
|
1138
1138
|
.number()
|
|
@@ -1140,7 +1140,7 @@ export const KernelConfigSchema = z.object({
|
|
|
1140
1140
|
.positive()
|
|
1141
1141
|
.default(7)
|
|
1142
1142
|
.meta(meta({
|
|
1143
|
-
description: "Days without use before
|
|
1143
|
+
description: "Days without use before a device's instance is destroyed; its files are kept until the device is deleted, and the next use starts a new instance on them",
|
|
1144
1144
|
})),
|
|
1145
1145
|
maxRunningMinutes: z
|
|
1146
1146
|
.number()
|
|
@@ -1148,13 +1148,13 @@ export const KernelConfigSchema = z.object({
|
|
|
1148
1148
|
.positive()
|
|
1149
1149
|
.default(120)
|
|
1150
1150
|
.meta(meta({
|
|
1151
|
-
description: "Minutes
|
|
1151
|
+
description: "Minutes a device's instance may run continuously before it is suspended even while in use (skipped while a command is running)",
|
|
1152
1152
|
})),
|
|
1153
1153
|
egress: z
|
|
1154
1154
|
.enum(["none", "allowlist", "open"])
|
|
1155
1155
|
.default("allowlist")
|
|
1156
1156
|
.meta(meta({
|
|
1157
|
-
description: "Outbound network from
|
|
1157
|
+
description: "Outbound network from cloud device instances: none, allowlist (only allowHosts) or open; applies to instances created after the change, existing ones keep theirs until destroyed",
|
|
1158
1158
|
})),
|
|
1159
1159
|
allowHosts: z
|
|
1160
1160
|
.array(z.string())
|
|
@@ -1167,13 +1167,13 @@ export const KernelConfigSchema = z.object({
|
|
|
1167
1167
|
});
|
|
1168
1168
|
})
|
|
1169
1169
|
.meta(meta({
|
|
1170
|
-
description: "Hosts
|
|
1170
|
+
description: "Hosts cloud device instances may reach when egress is allowlist: lowercase hostnames, optional leading '*.', no IPs, ports or internal-only names; applies to instances created after the change",
|
|
1171
1171
|
})),
|
|
1172
1172
|
})
|
|
1173
1173
|
.prefault({}),
|
|
1174
1174
|
})
|
|
1175
1175
|
.prefault({}),
|
|
1176
|
-
|
|
1176
|
+
devices: z
|
|
1177
1177
|
.object({
|
|
1178
1178
|
maxPersonal: z
|
|
1179
1179
|
.number()
|
|
@@ -1182,9 +1182,9 @@ export const KernelConfigSchema = z.object({
|
|
|
1182
1182
|
.default(10)
|
|
1183
1183
|
.meta(meta({
|
|
1184
1184
|
hot: true,
|
|
1185
|
-
description: "Most personal
|
|
1185
|
+
description: "Most personal devices a member may have in one org, the default one and local devices included; creating one more fails with device.limit_reached",
|
|
1186
1186
|
})),
|
|
1187
|
-
|
|
1187
|
+
local: z
|
|
1188
1188
|
.object({
|
|
1189
1189
|
reconnectGraceSeconds: z
|
|
1190
1190
|
.number()
|
|
@@ -1193,7 +1193,7 @@ export const KernelConfigSchema = z.object({
|
|
|
1193
1193
|
.default(120)
|
|
1194
1194
|
.meta(meta({
|
|
1195
1195
|
hot: true,
|
|
1196
|
-
description: "Seconds a
|
|
1196
|
+
description: "Seconds a local device's machine may stay disconnected before the device is reported offline; also sent to capybara-device at sign-in",
|
|
1197
1197
|
})),
|
|
1198
1198
|
leaseTtlMs: z
|
|
1199
1199
|
.number()
|
|
@@ -1201,7 +1201,7 @@ export const KernelConfigSchema = z.object({
|
|
|
1201
1201
|
.min(6000)
|
|
1202
1202
|
.default(30000)
|
|
1203
1203
|
.meta(meta({
|
|
1204
|
-
description: "Milliseconds the replica holding a
|
|
1204
|
+
description: "Milliseconds the replica holding a local device's connection keeps its lease without renewing it; at least 6000",
|
|
1205
1205
|
})),
|
|
1206
1206
|
authCodeTtlSeconds: z
|
|
1207
1207
|
.number()
|
|
@@ -1209,7 +1209,7 @@ export const KernelConfigSchema = z.object({
|
|
|
1209
1209
|
.positive()
|
|
1210
1210
|
.default(600)
|
|
1211
1211
|
.meta(meta({
|
|
1212
|
-
description: "Seconds a device sign-in code stays valid before
|
|
1212
|
+
description: "Seconds a device sign-in code stays valid before capybara-device must start over (device_sign_in.expired)",
|
|
1213
1213
|
})),
|
|
1214
1214
|
pollIntervalSeconds: z
|
|
1215
1215
|
.number()
|
|
@@ -1217,7 +1217,7 @@ export const KernelConfigSchema = z.object({
|
|
|
1217
1217
|
.positive()
|
|
1218
1218
|
.default(5)
|
|
1219
1219
|
.meta(meta({
|
|
1220
|
-
description: "Seconds
|
|
1220
|
+
description: "Seconds capybara-device waits between token polls during sign-in; polling faster gets device_sign_in.slow_down",
|
|
1221
1221
|
})),
|
|
1222
1222
|
maxFrameBytes: z
|
|
1223
1223
|
.number()
|
|
@@ -1225,7 +1225,7 @@ export const KernelConfigSchema = z.object({
|
|
|
1225
1225
|
.positive()
|
|
1226
1226
|
.default(16 * 1024 * 1024)
|
|
1227
1227
|
.meta(meta({
|
|
1228
|
-
description: "Largest WebSocket frame in bytes accepted from or sent to a
|
|
1228
|
+
description: "Largest WebSocket frame in bytes accepted from or sent to a local device's machine",
|
|
1229
1229
|
})),
|
|
1230
1230
|
})
|
|
1231
1231
|
.prefault({}),
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { FastifyReply } from "fastify";
|
|
2
2
|
import { z } from "zod";
|
|
3
|
-
import type {
|
|
3
|
+
import type { DeviceView } from "../devices/devices.service.js";
|
|
4
4
|
import { type Principal } from "../identity/principal.js";
|
|
5
5
|
import { type OrgContext } from "../orgs/org.guard.js";
|
|
6
6
|
import { ConversationToolInfo, type ToolInfo } from "../tools/info.js";
|
|
@@ -8,7 +8,7 @@ import type { AgentTreeNode } from "./agent-tree.js";
|
|
|
8
8
|
import { type ArtifactPreview, ConversationArtifacts } from "./artifacts.js";
|
|
9
9
|
import { EventsQuery, FilesQuery, IdParams, ListQuery, PatchBody, SubagentsQuery } from "./conversations.schemas.js";
|
|
10
10
|
import { type ConversationGroup, ConversationsService, type ConversationView, type SubagentView, type UsageTotals } from "./conversations.service.js";
|
|
11
|
-
import {
|
|
11
|
+
import { ConversationDeviceStatus } from "./device-status.js";
|
|
12
12
|
import type { ConversationEvent } from "./events.js";
|
|
13
13
|
import { ConversationFiles, type FileOutput } from "./files.js";
|
|
14
14
|
import { ConversationOutputs, type OutputPage } from "./outputs-read.js";
|
|
@@ -78,12 +78,12 @@ declare const MessageBody: z.ZodObject<{
|
|
|
78
78
|
* `POST /conversations`: `message` creates the conversation with its first message (create on
|
|
79
79
|
* first send; `clientMessageId` is required and makes a retry return the same conversation).
|
|
80
80
|
* Without it the conversation is created empty (API clients; the web never does).
|
|
81
|
-
* `
|
|
82
|
-
*
|
|
81
|
+
* `deviceId` binds it to one of the caller's devices; without it the caller's default
|
|
82
|
+
* device (environments spec §4.1 item 1).
|
|
83
83
|
*/
|
|
84
84
|
declare const CreateBody: z.ZodObject<{
|
|
85
85
|
agentId: z.ZodString;
|
|
86
|
-
|
|
86
|
+
deviceId: z.ZodOptional<z.ZodString>;
|
|
87
87
|
message: z.ZodOptional<z.ZodObject<{
|
|
88
88
|
text: z.ZodString;
|
|
89
89
|
attachments: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
@@ -156,11 +156,11 @@ export declare class ConversationsController {
|
|
|
156
156
|
private readonly conversations;
|
|
157
157
|
private readonly outputs;
|
|
158
158
|
private readonly artifacts;
|
|
159
|
-
private readonly
|
|
159
|
+
private readonly deviceStatus;
|
|
160
160
|
private readonly toolInfo;
|
|
161
161
|
private readonly queue;
|
|
162
162
|
private readonly files;
|
|
163
|
-
constructor(conversations: ConversationsService, outputs: ConversationOutputs, artifacts: ConversationArtifacts,
|
|
163
|
+
constructor(conversations: ConversationsService, outputs: ConversationOutputs, artifacts: ConversationArtifacts, deviceStatus: ConversationDeviceStatus, toolInfo: ConversationToolInfo, queue: ConversationQueue, files: ConversationFiles);
|
|
164
164
|
/**
|
|
165
165
|
* 201 when created; 200 when `message.clientMessageId` repeats an earlier first send. With a
|
|
166
166
|
* message the answer has `event` (the `user_message`) and `events`: every event the first send
|
|
@@ -266,12 +266,12 @@ export declare class ConversationsController {
|
|
|
266
266
|
*/
|
|
267
267
|
fileContent(principal: Principal, org: OrgContext, id: string, fileId: string, q: z.infer<typeof FileContentQuery>, reply: FastifyReply): Promise<void>;
|
|
268
268
|
/**
|
|
269
|
-
* The
|
|
270
|
-
* with its instance state; `null` while unbound, or when the
|
|
269
|
+
* The device the conversation works in (a sub-agent: its root's), as its owner sees it,
|
|
270
|
+
* with its instance state; `null` while unbound, or when the device was deleted. Same
|
|
271
271
|
* visibility as the event stream.
|
|
272
272
|
*/
|
|
273
|
-
|
|
274
|
-
|
|
273
|
+
device(principal: Principal, org: OrgContext, id: string): Promise<{
|
|
274
|
+
device: DeviceView | null;
|
|
275
275
|
}>;
|
|
276
276
|
/**
|
|
277
277
|
* Display metadata (title, kind, key arguments, source) of the tools a conversation's calls name,
|
|
@@ -19,7 +19,7 @@ import { ConversationToolInfo, TOOL_INFO_KEY_MAX, TOOL_INFO_MAX_KEYS, } from "..
|
|
|
19
19
|
import { ARTIFACT_DOWNLOAD_CACHE_SECONDS, ConversationArtifacts, } from "./artifacts.js";
|
|
20
20
|
import { EventsQuery, FilesQuery, IdParams, ListQuery, PatchBody, SubagentsQuery, searchFields, } from "./conversations.schemas.js";
|
|
21
21
|
import { ConversationsService, } from "./conversations.service.js";
|
|
22
|
-
import {
|
|
22
|
+
import { ConversationDeviceStatus } from "./device-status.js";
|
|
23
23
|
import { ConversationFiles, FILE_CONTENT_MAX_BYTES } from "./files.js";
|
|
24
24
|
import { ConversationOutputs, OUTPUT_PAGE_MAX_CHARS } from "./outputs-read.js";
|
|
25
25
|
import { ConversationQueue } from "./queue.service.js";
|
|
@@ -106,13 +106,13 @@ const MessageBody = MessageFields.strict().refine(...textRule);
|
|
|
106
106
|
* `POST /conversations`: `message` creates the conversation with its first message (create on
|
|
107
107
|
* first send; `clientMessageId` is required and makes a retry return the same conversation).
|
|
108
108
|
* Without it the conversation is created empty (API clients; the web never does).
|
|
109
|
-
* `
|
|
110
|
-
*
|
|
109
|
+
* `deviceId` binds it to one of the caller's devices; without it the caller's default
|
|
110
|
+
* device (environments spec §4.1 item 1).
|
|
111
111
|
*/
|
|
112
112
|
const CreateBody = z
|
|
113
113
|
.object({
|
|
114
114
|
agentId: z.string().min(1).max(100),
|
|
115
|
-
|
|
115
|
+
deviceId: z.string().min(1).max(100).optional(),
|
|
116
116
|
message: MessageFields.omit({ retryOf: true })
|
|
117
117
|
.extend({ clientMessageId: z.string().min(1).max(200) })
|
|
118
118
|
.strict()
|
|
@@ -167,15 +167,15 @@ let ConversationsController = class ConversationsController {
|
|
|
167
167
|
conversations;
|
|
168
168
|
outputs;
|
|
169
169
|
artifacts;
|
|
170
|
-
|
|
170
|
+
deviceStatus;
|
|
171
171
|
toolInfo;
|
|
172
172
|
queue;
|
|
173
173
|
files;
|
|
174
|
-
constructor(conversations, outputs, artifacts,
|
|
174
|
+
constructor(conversations, outputs, artifacts, deviceStatus, toolInfo, queue, files) {
|
|
175
175
|
this.conversations = conversations;
|
|
176
176
|
this.outputs = outputs;
|
|
177
177
|
this.artifacts = artifacts;
|
|
178
|
-
this.
|
|
178
|
+
this.deviceStatus = deviceStatus;
|
|
179
179
|
this.toolInfo = toolInfo;
|
|
180
180
|
this.queue = queue;
|
|
181
181
|
this.files = files;
|
|
@@ -187,7 +187,7 @@ let ConversationsController = class ConversationsController {
|
|
|
187
187
|
*/
|
|
188
188
|
async create(principal, org, body, reply) {
|
|
189
189
|
const p = requireUser(principal);
|
|
190
|
-
const pick = body.
|
|
190
|
+
const pick = body.deviceId === undefined ? {} : { deviceId: body.deviceId };
|
|
191
191
|
if (body.message === undefined) {
|
|
192
192
|
return {
|
|
193
193
|
conversation: await this.conversations.create(org.orgId, p.account.id, body.agentId, pick),
|
|
@@ -371,13 +371,13 @@ let ConversationsController = class ConversationsController {
|
|
|
371
371
|
await reply.send(c.body);
|
|
372
372
|
}
|
|
373
373
|
/**
|
|
374
|
-
* The
|
|
375
|
-
* with its instance state; `null` while unbound, or when the
|
|
374
|
+
* The device the conversation works in (a sub-agent: its root's), as its owner sees it,
|
|
375
|
+
* with its instance state; `null` while unbound, or when the device was deleted. Same
|
|
376
376
|
* visibility as the event stream.
|
|
377
377
|
*/
|
|
378
|
-
async
|
|
378
|
+
async device(principal, org, id) {
|
|
379
379
|
const p = requireUser(principal);
|
|
380
|
-
return {
|
|
380
|
+
return { device: await this.deviceStatus.get(org.orgId, id, p.account.id) };
|
|
381
381
|
}
|
|
382
382
|
/**
|
|
383
383
|
* Display metadata (title, kind, key arguments, source) of the tools a conversation's calls name,
|
|
@@ -590,13 +590,13 @@ __decorate([
|
|
|
590
590
|
__param(5, Res())
|
|
591
591
|
], ConversationsController.prototype, "fileContent", null);
|
|
592
592
|
__decorate([
|
|
593
|
-
Get(":id/
|
|
593
|
+
Get(":id/device"),
|
|
594
594
|
Header("cache-control", "private, no-store"),
|
|
595
595
|
OrgAction("agents.use"),
|
|
596
596
|
__param(0, CurrentPrincipal()),
|
|
597
597
|
__param(1, CurrentOrg()),
|
|
598
598
|
__param(2, Param("id"))
|
|
599
|
-
], ConversationsController.prototype, "
|
|
599
|
+
], ConversationsController.prototype, "device", null);
|
|
600
600
|
__decorate([
|
|
601
601
|
Get(":id/tools"),
|
|
602
602
|
Header("cache-control", "private, no-store"),
|
|
@@ -680,7 +680,7 @@ ConversationsController = __decorate([
|
|
|
680
680
|
__param(0, Inject(ConversationsService)),
|
|
681
681
|
__param(1, Inject(ConversationOutputs)),
|
|
682
682
|
__param(2, Inject(ConversationArtifacts)),
|
|
683
|
-
__param(3, Inject(
|
|
683
|
+
__param(3, Inject(ConversationDeviceStatus)),
|
|
684
684
|
__param(4, Inject(ConversationToolInfo)),
|
|
685
685
|
__param(5, Inject(ConversationQueue)),
|
|
686
686
|
__param(6, Inject(ConversationFiles))
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Conversations: the one {@link ConversationsService} (messages, model switches, skill
|
|
3
3
|
* invocations, sub-agent views, abort), the queue, the file / artifact / output reads and the
|
|
4
|
-
* conversation's
|
|
4
|
+
* conversation's device. The event log, the access check and the attachments are their own modules (the
|
|
5
5
|
* skills and tools use them too) and are re-exported here.
|
|
6
6
|
*/
|
|
7
7
|
export declare class ConversationsModule {
|
|
@@ -7,7 +7,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
7
7
|
import { Module } from "@nestjs/common";
|
|
8
8
|
import { AgentLookupModule } from "../agents/agent-lookup.js";
|
|
9
9
|
import { BackgroundModule } from "../background/background.module.js";
|
|
10
|
-
import {
|
|
10
|
+
import { DevicesModule } from "../devices/devices.module.js";
|
|
11
11
|
import { ProvidersModule } from "../runtime/providers.js";
|
|
12
12
|
import { RuntimeModule } from "../runtime/runtime.module.js";
|
|
13
13
|
import { SkillsModule } from "../skills/skills.module.js";
|
|
@@ -17,7 +17,7 @@ import { ConversationAccessModule } from "./access.js";
|
|
|
17
17
|
import { ConversationArtifacts } from "./artifacts.js";
|
|
18
18
|
import { AttachmentsModule } from "./attachments.module.js";
|
|
19
19
|
import { ConversationsService } from "./conversations.service.js";
|
|
20
|
-
import {
|
|
20
|
+
import { ConversationDeviceStatus } from "./device-status.js";
|
|
21
21
|
import { EventLogModule } from "./event-log.js";
|
|
22
22
|
import { ConversationFiles } from "./files.js";
|
|
23
23
|
import { ConversationOutputs } from "./outputs-read.js";
|
|
@@ -25,7 +25,7 @@ import { ConversationQueue } from "./queue.service.js";
|
|
|
25
25
|
/**
|
|
26
26
|
* Conversations: the one {@link ConversationsService} (messages, model switches, skill
|
|
27
27
|
* invocations, sub-agent views, abort), the queue, the file / artifact / output reads and the
|
|
28
|
-
* conversation's
|
|
28
|
+
* conversation's device. The event log, the access check and the attachments are their own modules (the
|
|
29
29
|
* skills and tools use them too) and are re-exported here.
|
|
30
30
|
*/
|
|
31
31
|
let ConversationsModule = class ConversationsModule {
|
|
@@ -43,8 +43,8 @@ ConversationsModule = __decorate([
|
|
|
43
43
|
// the run control (start a run after a message, stop runs) and the model provider registry
|
|
44
44
|
RuntimeModule,
|
|
45
45
|
ProvidersModule,
|
|
46
|
-
// the
|
|
47
|
-
|
|
46
|
+
// the device a conversation is bound to, and its view
|
|
47
|
+
DevicesModule,
|
|
48
48
|
// the stop of a deleted conversation's background tasks
|
|
49
49
|
BackgroundModule,
|
|
50
50
|
],
|
|
@@ -54,7 +54,7 @@ ConversationsModule = __decorate([
|
|
|
54
54
|
ConversationOutputs,
|
|
55
55
|
ConversationArtifacts,
|
|
56
56
|
ConversationFiles,
|
|
57
|
-
|
|
57
|
+
ConversationDeviceStatus,
|
|
58
58
|
],
|
|
59
59
|
exports: [
|
|
60
60
|
EventLogModule,
|
|
@@ -65,7 +65,7 @@ ConversationsModule = __decorate([
|
|
|
65
65
|
ConversationOutputs,
|
|
66
66
|
ConversationArtifacts,
|
|
67
67
|
ConversationFiles,
|
|
68
|
-
|
|
68
|
+
ConversationDeviceStatus,
|
|
69
69
|
],
|
|
70
70
|
})
|
|
71
71
|
], ConversationsModule);
|
|
@@ -74,6 +74,6 @@ export const CONVERSATION_ROUTES = [
|
|
|
74
74
|
{ route: "GET /api/v1/orgs/:orgId/conversations/:id/agent-tree", params: IdParams },
|
|
75
75
|
{ route: "GET /api/v1/orgs/:orgId/conversations/:id/usage", params: IdParams },
|
|
76
76
|
{ route: "GET /api/v1/orgs/:orgId/conversations/:id/files", params: IdParams, query: FilesQuery },
|
|
77
|
-
{ route: "GET /api/v1/orgs/:orgId/conversations/:id/
|
|
77
|
+
{ route: "GET /api/v1/orgs/:orgId/conversations/:id/device", params: IdParams },
|
|
78
78
|
{ route: "POST /api/v1/orgs/:orgId/conversations/:id/abort", params: IdParams },
|
|
79
79
|
];
|