@agimon-ai/po-sandbox 0.0.0-alpha.7 → 0.0.0-alpha.71
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/LICENSE +149 -21
- package/README.md +68 -99
- package/dist/apiContracts.cjs +1 -1
- package/dist/apiContracts.cjs.map +1 -1
- package/dist/apiContracts.d.mts +1 -1
- package/dist/apiContracts.mjs +1 -1
- package/dist/apiContracts.mjs.map +1 -1
- package/dist/extensionService-628BZd5z.cjs +25 -0
- package/dist/extensionService-628BZd5z.cjs.map +1 -0
- package/dist/extensionService-Cz9QRLJ5.mjs +20 -0
- package/dist/extensionService-Cz9QRLJ5.mjs.map +1 -0
- package/dist/extensions/mcp.cjs +7 -7
- package/dist/extensions/mcp.cjs.map +1 -1
- package/dist/extensions/mcp.mjs +7 -7
- package/dist/extensions/mcp.mjs.map +1 -1
- package/dist/extensions/server.cjs +1373 -346
- package/dist/extensions/server.cjs.map +1 -1
- package/dist/extensions/server.d.mts +2 -2
- package/dist/extensions/server.d.mts.map +1 -1
- package/dist/extensions/server.mjs +1347 -339
- package/dist/extensions/server.mjs.map +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.mts +4 -2
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +1 -1
- package/llms.txt +3 -3
- package/package.json +14 -15
- package/src/prompts/help-how-to-sandbox/SKILL.md +15 -0
- package/dist/cockpitHarness.cjs +0 -600
- package/dist/cockpitHarness.cjs.map +0 -1
- package/dist/cockpitHarness.d.mts +0 -41
- package/dist/cockpitHarness.d.mts.map +0 -1
- package/dist/cockpitHarness.mjs +0 -594
- package/dist/cockpitHarness.mjs.map +0 -1
- package/dist/extensionService-CoqM-IE1.cjs +0 -25
- package/dist/extensionService-CoqM-IE1.cjs.map +0 -1
- package/dist/extensionService-FmuCugPK.mjs +0 -20
- package/dist/extensionService-FmuCugPK.mjs.map +0 -1
- package/dist/sandboxBridge-77zC5pQR.mjs +0 -13
- package/dist/sandboxBridge-77zC5pQR.mjs.map +0 -1
- package/dist/sandboxBridge-Db6DubLC.cjs +0 -81
- package/dist/sandboxBridge-Db6DubLC.cjs.map +0 -1
- package/src/prompts/po-use-sandbox/SKILL.md +0 -14
package/LICENSE
CHANGED
|
@@ -1,21 +1,149 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
1
|
+
License text copyright © 2017 MariaDB Corporation Ab, All Rights Reserved.
|
|
2
|
+
"Business Source License" is a trademark of MariaDB Corporation Ab.
|
|
3
|
+
|
|
4
|
+
Parameters
|
|
5
|
+
|
|
6
|
+
Licensor: Agimon Pty Ltd
|
|
7
|
+
Licensed Work: Po, the software in the Po source repository and the
|
|
8
|
+
packages released from it, in each version released by
|
|
9
|
+
the Licensor.
|
|
10
|
+
The Licensed Work is (c) 2026 Agimon Pty Ltd.
|
|
11
|
+
Material identified as third-party in the "Third-party
|
|
12
|
+
components" section at the end of this file or in a
|
|
13
|
+
NOTICE file, and any package or directory whose own
|
|
14
|
+
license file grants a different license, is not part of
|
|
15
|
+
the Licensed Work and remains under its own license.
|
|
16
|
+
Additional Use Grant: You may make production use of the Licensed Work if
|
|
17
|
+
your use is Eligible Use. "Eligible Use" is production use that falls
|
|
18
|
+
within at least one of the following:
|
|
19
|
+
|
|
20
|
+
(a) Personal Use. Use by an individual for their own personal purposes,
|
|
21
|
+
and not on behalf of, or for the benefit of, an employer, client, or
|
|
22
|
+
other Organization. Use by an individual in the course of employment
|
|
23
|
+
or engagement by an Organization is use by that Organization.
|
|
24
|
+
|
|
25
|
+
(b) Small Organization Use. Use by or on behalf of an Organization whose
|
|
26
|
+
Annual Revenue is less than USD 1,000,000.
|
|
27
|
+
|
|
28
|
+
(c) Non-profit, Education and Research Use. Use, regardless of Annual
|
|
29
|
+
Revenue, by (i) an Organization registered or recognized as a
|
|
30
|
+
non-profit or charitable organization under the laws of its
|
|
31
|
+
jurisdiction, for its non-profit purposes; (ii) an accredited school,
|
|
32
|
+
college, or university, for teaching, learning, or academic research;
|
|
33
|
+
or (iii) a publicly funded research institution, for its research.
|
|
34
|
+
|
|
35
|
+
(d) Service Provider Use. Use by a consultant, contractor, agency, or other
|
|
36
|
+
service provider, regardless of its own Annual Revenue, solely to
|
|
37
|
+
build, deploy, host, operate, or support the Licensed Work for a client
|
|
38
|
+
whose own use would be Eligible Use under (a), (b), or (c). A service
|
|
39
|
+
provider's use for its own purposes is Eligible Use only if the service
|
|
40
|
+
provider itself qualifies under (b) or (c).
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
Hosted services. Offering the Licensed Work to third parties as a hosted
|
|
44
|
+
or managed service whose primary value is the Licensed Work is Eligible
|
|
45
|
+
Use only if each such third party's own use would be Eligible Use.
|
|
46
|
+
|
|
47
|
+
Definitions. "Organization" means any company, partnership, sole
|
|
48
|
+
proprietorship, trust, association, government body, or other entity, and
|
|
49
|
+
includes an individual acting in a business or professional capacity.
|
|
50
|
+
"Affiliate" means any entity that directly or indirectly controls, is
|
|
51
|
+
controlled by, or is under common control with an Organization, where
|
|
52
|
+
"control" means ownership of more than 50% of the voting interests of an
|
|
53
|
+
entity or the power to direct its management and policies by contract or
|
|
54
|
+
otherwise. "Annual Revenue" means the total gross revenue of an
|
|
55
|
+
Organization and all of its Affiliates combined, from all sources and
|
|
56
|
+
whether or not related to the Licensed Work, for its most recently
|
|
57
|
+
completed fiscal year, or, if it has not completed a fiscal year, for the
|
|
58
|
+
twelve months before the use (or since its formation, if shorter),
|
|
59
|
+
converted into US dollars at the average exchange rate for that period.
|
|
60
|
+
Proceeds of equity or debt financing are not revenue.
|
|
61
|
+
|
|
62
|
+
Threshold. If an Organization stops qualifying under (b), its existing
|
|
63
|
+
production use remains Eligible Use for 90 days after it stops
|
|
64
|
+
qualifying, after which it must obtain a commercial license or stop
|
|
65
|
+
production use. Use that was Eligible Use when it occurred never requires
|
|
66
|
+
a commercial license after the fact.
|
|
67
|
+
Change Date: Four years from the date a version of the Licensed Work
|
|
68
|
+
is first publicly released by the Licensor.
|
|
69
|
+
Change License: Apache License, Version 2.0
|
|
70
|
+
|
|
71
|
+
For information about alternative licensing arrangements for the Licensed
|
|
72
|
+
Work, please visit: https://agimon.ai/licensing
|
|
73
|
+
|
|
74
|
+
Notice
|
|
75
|
+
|
|
76
|
+
The Business Source License (this document, or the "License") is not an Open
|
|
77
|
+
Source license. However, the Licensed Work will eventually be made available
|
|
78
|
+
under an Open Source License, as stated in this License.
|
|
79
|
+
|
|
80
|
+
-----------------------------------------------------------------------------
|
|
81
|
+
|
|
82
|
+
Business Source License 1.1
|
|
83
|
+
|
|
84
|
+
Terms
|
|
85
|
+
|
|
86
|
+
The Licensor hereby grants you the right to copy, modify, create derivative
|
|
87
|
+
works, redistribute, and make non-production use of the Licensed Work. The
|
|
88
|
+
Licensor may make an Additional Use Grant, above, permitting limited
|
|
89
|
+
production use.
|
|
90
|
+
|
|
91
|
+
Effective on the Change Date, or the fourth anniversary of the first publicly
|
|
92
|
+
available distribution of a specific version of the Licensed Work under this
|
|
93
|
+
License, whichever comes first, the Licensor hereby grants you rights under
|
|
94
|
+
the terms of the Change License, and the rights granted in the paragraph
|
|
95
|
+
above terminate.
|
|
96
|
+
|
|
97
|
+
If your use of the Licensed Work does not comply with the requirements
|
|
98
|
+
currently in effect as described in this License, you must purchase a
|
|
99
|
+
commercial license from the Licensor, its affiliated entities, or authorized
|
|
100
|
+
resellers, or you must refrain from using the Licensed Work.
|
|
101
|
+
|
|
102
|
+
All copies of the original and modified Licensed Work, and derivative works
|
|
103
|
+
of the Licensed Work, are subject to this License. This License applies
|
|
104
|
+
separately for each version of the Licensed Work and the Change Date may vary
|
|
105
|
+
for each version of the Licensed Work released by Licensor.
|
|
106
|
+
|
|
107
|
+
You must conspicuously display this License on each original or modified copy
|
|
108
|
+
of the Licensed Work. If you receive the Licensed Work in original or
|
|
109
|
+
modified form from a third party, the terms and conditions set forth in this
|
|
110
|
+
License apply to your use of that work.
|
|
111
|
+
|
|
112
|
+
Any use of the Licensed Work in violation of this License will automatically
|
|
113
|
+
terminate your rights under this License for the current and all other
|
|
114
|
+
versions of the Licensed Work.
|
|
115
|
+
|
|
116
|
+
This License does not grant you any right in any trademark or logo of
|
|
117
|
+
Licensor or its affiliates (provided that you may use a trademark or logo of
|
|
118
|
+
Licensor as expressly required by this License).
|
|
119
|
+
|
|
120
|
+
TO THE EXTENT PERMITTED BY APPLICABLE LAW, THE LICENSED WORK IS PROVIDED ON
|
|
121
|
+
AN “AS IS” BASIS. LICENSOR HEREBY DISCLAIMS ALL WARRANTIES AND CONDITIONS,
|
|
122
|
+
EXPRESS OR IMPLIED, INCLUDING (WITHOUT LIMITATION) WARRANTIES OF
|
|
123
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT, AND
|
|
124
|
+
TITLE.
|
|
125
|
+
|
|
126
|
+
MariaDB hereby grants you permission to use this License’s text to license
|
|
127
|
+
your works, and to refer to it using the trademark “Business Source License”,
|
|
128
|
+
as long as you comply with the Covenants of Licensor below.
|
|
129
|
+
|
|
130
|
+
Covenants of Licensor
|
|
131
|
+
|
|
132
|
+
In consideration of the right to use this License’s text and the “Business
|
|
133
|
+
Source License” name and trademark, Licensor covenants to MariaDB, and to all
|
|
134
|
+
other recipients of the licensed work to be provided by Licensor:
|
|
135
|
+
|
|
136
|
+
1. To specify as the Change License the GPL Version 2.0 or any later version,
|
|
137
|
+
or a license that is compatible with GPL Version 2.0 or a later version,
|
|
138
|
+
where “compatible” means that software provided under the Change License can
|
|
139
|
+
be included in a program with software provided under GPL Version 2.0 or a
|
|
140
|
+
later version. Licensor may specify additional Change Licenses without
|
|
141
|
+
limitation.
|
|
142
|
+
|
|
143
|
+
2. To either: (a) specify an additional grant of rights to use that does not
|
|
144
|
+
impose any additional restriction on the right granted in this License, as
|
|
145
|
+
the Additional Use Grant; or (b) insert the text “None”.
|
|
146
|
+
|
|
147
|
+
3. To specify a Change Date.
|
|
148
|
+
|
|
149
|
+
4. Not to modify this License in any other way.
|
package/README.md
CHANGED
|
@@ -1,14 +1,57 @@
|
|
|
1
1
|
# @agimon-ai/po-sandbox
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Sandbox layer for Po: registers the `container` sandbox provider on the host, runs one container per
|
|
4
|
+
sandboxed workspace, reports whether a session runs inside a container, and routes brokered providers when a
|
|
5
|
+
launch grants a credential broker.
|
|
4
6
|
|
|
5
7
|
Part of the [Po distribution](https://www.npmjs.com/package/@agimon-ai/po).
|
|
6
8
|
|
|
9
|
+
## Status
|
|
10
|
+
|
|
11
|
+
The host side of per-workspace containers is in place: the `container` provider, the shared image, and the
|
|
12
|
+
container lifecycle. Sessions are not routed into a container yet, so a sandboxed workspace stays unavailable
|
|
13
|
+
for sessions. See [The container plan and current wiring](../../../docs/securities.md#the-container-plan-and-current-wiring)
|
|
14
|
+
for what the current server runtime connects.
|
|
15
|
+
|
|
16
|
+
### The container provider
|
|
17
|
+
|
|
18
|
+
When the layer loads on a host server's global scope, it registers the `container` provider in
|
|
19
|
+
`po/workspace-sandboxes` and publishes the `po/workspace-containers` service. A contained server registers
|
|
20
|
+
nothing, so containers never nest.
|
|
21
|
+
|
|
22
|
+
At hub start, in the background:
|
|
23
|
+
|
|
24
|
+
1. `docker info` checks the engine. A missing or stopped engine leaves the provider unavailable, with the reason.
|
|
25
|
+
2. The provider needs the Linux Po runtime bundle at `~/.po/container-runtime/<version>/`, with its
|
|
26
|
+
`container-runtime.json`. Without it the provider reports "The container runtime is not installed." and starts
|
|
27
|
+
nothing. The json is validated first: only its known keys, and every path inside `/opt/po`. Otherwise the
|
|
28
|
+
provider reports why and starts nothing. The server runs from its `entry` with all of its `environment`.
|
|
29
|
+
3. The image `po-sandbox:<digest>` is built once if missing: `node:24-bookworm-slim`, git, procps, ripgrep,
|
|
30
|
+
Chromium libraries and fonts, corepack, and the headless cloak browser at `/opt/cloak`.
|
|
31
|
+
4. For each workspace whose sandbox is `container`, a running container labelled with this hub's `po.owner` and
|
|
32
|
+
the workspace's `po.workspace` is adopted. Otherwise stale `*.po-v4.lock` files under the workspace's sandbox
|
|
33
|
+
folder are deleted and a new container starts.
|
|
34
|
+
|
|
35
|
+
Each container mounts the workspace at its own path, the runtime bundle read-only at `/opt/po`, and
|
|
36
|
+
`P = ~/.po/sandboxes/<workspace>` at its own path with `PO_HOME=P`, so conversations and artifacts stay on host
|
|
37
|
+
disk. Package caches, worktrees and the container home live in named volumes. The container publishes one port on
|
|
38
|
+
host loopback only, runs with `--cap-drop=ALL`, `no-new-privileges` and a pid limit, and gets no credentials, no
|
|
39
|
+
hub token, no engine socket, and no part of the host `~/.po` beyond `P`, the bundle, the three seed files
|
|
40
|
+
(`modes.yaml`, `domains.yaml`, `config.yaml`, read-only) and its own token file (read-only).
|
|
41
|
+
|
|
42
|
+
Every container runs with `--user`: the host user on Linux, `1000:1000` elsewhere (Docker Desktop maps it to the
|
|
43
|
+
host user on shared folders). A new runtime or git volume is first mounted on a world-writable image folder, so it
|
|
44
|
+
stays writable for that user, as the `/po-home` volume is.
|
|
45
|
+
|
|
46
|
+
Containers outlive the hub process: a reload, an idle restart (exit 75) or a crash leaves them running, and the
|
|
47
|
+
next start adopts them. A clean user stop stops them: the provider's `onCleanStop` hook in
|
|
48
|
+
`po/workspace-sandboxes` calls `stopAll`. `po/workspace-containers` also exposes `stop` for switching the sandbox
|
|
49
|
+
off.
|
|
50
|
+
|
|
7
51
|
## Requirements
|
|
8
52
|
|
|
9
53
|
- Node.js 24 or newer
|
|
10
|
-
- `@earendil-works/pi-coding-agent`
|
|
11
|
-
- One of `docker`, `podman`, `nerdctl`, or `finch` on the host for the cockpit container
|
|
54
|
+
- `@earendil-works/pi-coding-agent` 1.4.0
|
|
12
55
|
|
|
13
56
|
## Install
|
|
14
57
|
|
|
@@ -16,13 +59,10 @@ Part of the [Po distribution](https://www.npmjs.com/package/@agimon-ai/po).
|
|
|
16
59
|
npm install @agimon-ai/po-sandbox
|
|
17
60
|
```
|
|
18
61
|
|
|
19
|
-
The cockpit container is started by the web cockpit (`po`, which runs `po-web`) and requires this package in the
|
|
20
|
-
selected major mode's layers, as shown below.
|
|
21
|
-
|
|
22
62
|
## Enable the sandbox
|
|
23
63
|
|
|
24
|
-
|
|
25
|
-
|
|
64
|
+
`po init` writes a `sandbox` layer and adds it to the `copilot` mode. To use it in another mode,
|
|
65
|
+
list the layer on that mode in `.po/modes.yaml`:
|
|
26
66
|
|
|
27
67
|
```yaml
|
|
28
68
|
layers:
|
|
@@ -36,119 +76,48 @@ majorMode:
|
|
|
36
76
|
layers: [team, ask-user, task, sandbox]
|
|
37
77
|
```
|
|
38
78
|
|
|
39
|
-
|
|
40
|
-
than running uncontained.
|
|
41
|
-
|
|
42
|
-
## Web cockpit container
|
|
43
|
-
|
|
44
|
-
With this layer in the selected major mode, the web cockpit can hand over to one long-lived Linux
|
|
45
|
-
container that holds the hub and every session it spawns:
|
|
46
|
-
|
|
47
|
-
1. The cockpit resolves this package's `./cockpitHarness` export and delegates the container
|
|
48
|
-
lifecycle.
|
|
49
|
-
2. The layer detects the first available engine in the order `docker`, `podman`, `nerdctl`,
|
|
50
|
-
`finch` (override with `PO_SANDBOX_ENGINE`), and builds a
|
|
51
|
-
cockpit image when that tag is not cached. The digest covers the image definition and bridge
|
|
52
|
-
source. The image installs `@agimon-ai/po-web` from the registry rather than copying the
|
|
53
|
-
host's platform-specific packages.
|
|
54
|
-
3. It starts a detached container with each configured workspace bind-mounted at its host path,
|
|
55
|
-
a named home volume, and the cockpit port published on host loopback, then waits until the
|
|
56
|
-
cockpit inside answers `/api/health`.
|
|
57
|
-
|
|
58
|
-
The browser stays on the host while bash, file edits, extensions, MCP servers, and skills all
|
|
59
|
-
execute inside the container. `PO_SANDBOX=1` marks every sandboxed process; nesting is refused.
|
|
60
|
-
See [The container plan and current wiring](../../../docs/securities.md#the-container-plan-and-current-wiring)
|
|
61
|
-
for what the current server runtime connects.
|
|
62
|
-
|
|
63
|
-
Only an allowlisted environment enters the container: terminal and locale variables, proxy
|
|
64
|
-
settings, and `PO_PRESET`. Everything else a shell accumulates stays on the host.
|
|
65
|
-
|
|
66
|
-
## Engine and runtime selection
|
|
67
|
-
|
|
68
|
-
The harness invokes each supported engine with Docker-compatible arguments. The engine and its
|
|
69
|
-
VM, if any, must already be running on the host.
|
|
70
|
-
|
|
71
|
-
`PO_SANDBOX_RUN_FLAGS` passes extra options straight to the engine, which is how you select a
|
|
72
|
-
different isolation runtime without the layer having to know about it:
|
|
79
|
+
## In-session command
|
|
73
80
|
|
|
74
|
-
```
|
|
75
|
-
|
|
81
|
+
```text
|
|
82
|
+
/po-sandbox
|
|
76
83
|
```
|
|
77
84
|
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
would silently launch a different container.
|
|
81
|
-
|
|
82
|
-
Alternative isolation runtimes such as Kata or Firecracker are not verified here. Check their
|
|
83
|
-
mount and broker-transport support before relying on them.
|
|
84
|
-
|
|
85
|
-
## Workspace dev containers
|
|
86
|
-
|
|
87
|
-
The cockpit container ignores a workspace `.devcontainer` configuration. That file is
|
|
88
|
-
author-controlled and could mount anything, including the container socket, which would make the
|
|
89
|
-
containment claim false.
|
|
90
|
-
|
|
91
|
-
## Signing in from inside the sandbox
|
|
92
|
-
|
|
93
|
-
Subscription logins are not brokered. The cockpit container publishes only the cockpit port on
|
|
94
|
-
host loopback, so a `/login` callback that a provider sends to `localhost:<port>` does not reach
|
|
95
|
-
the container. Use a provider API key, which the credential broker below carries. Credentials stored inside the container land in the cockpit home
|
|
96
|
-
volume, so they survive later runs.
|
|
97
|
-
|
|
98
|
-
## Provider credential broker
|
|
85
|
+
Reports whether the current session runs inside a sandbox container (the server's
|
|
86
|
+
`po/sandbox-identity` says it is contained) or directly on the host.
|
|
99
87
|
|
|
100
|
-
|
|
88
|
+
## Brokered providers
|
|
101
89
|
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
90
|
+
When a session's admitted environment names brokered providers (`PO_BROKER_PROVIDERS`) and a
|
|
91
|
+
broker route (`PO_BROKER_SOCKET` or `PO_BROKER_ADDRESS`), the server plugin overrides those
|
|
92
|
+
providers' base URLs so requests go through the broker. The session's credential variables are
|
|
93
|
+
expected to hold the broker's session token, not the real key. With no broker route the layer
|
|
94
|
+
changes nothing.
|
|
106
95
|
|
|
107
|
-
How
|
|
96
|
+
How a container reaches the broker depends on the engine:
|
|
108
97
|
|
|
109
98
|
| Host | Transport | Why |
|
|
110
99
|
| ----------------------------- | ------------------------------------------- | ---------------------------------------------------------------------------------- |
|
|
111
100
|
| Linux | Unix socket, bind-mounted, owner-only | Container and host share a kernel, so no port is needed |
|
|
112
101
|
| macOS, Windows, any VM engine | Loopback TCP through `host.docker.internal` | A container in a virtual machine cannot connect to a mounted host socket (ENOTSUP) |
|
|
113
102
|
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
local process could reach that port, and the session token is what stops it being useful.
|
|
117
|
-
|
|
118
|
-
The broker validates the token, swaps in the real key, and streams the provider response back.
|
|
119
|
-
Credentials for providers it cannot carry are withheld from the container rather than passed
|
|
120
|
-
through. Turn the whole mechanism off with `PO_SANDBOX_BROKER=0`.
|
|
121
|
-
|
|
122
|
-
## In-session command
|
|
123
|
-
|
|
124
|
-
```text
|
|
125
|
-
/po-sandbox
|
|
126
|
-
```
|
|
127
|
-
|
|
128
|
-
Reports whether the current session runs inside the sandbox container or directly on the host.
|
|
103
|
+
A socket route goes through a loopback bridge inside the container, because no SDK can dial a
|
|
104
|
+
socket path. A TCP route is addressed directly.
|
|
129
105
|
|
|
130
106
|
## Current limits
|
|
131
107
|
|
|
132
|
-
-
|
|
133
|
-
|
|
108
|
+
- Sessions do not run in a container yet, and nothing starts a broker for a session.
|
|
109
|
+
- The broker carries a curated provider list. OAuth subscription logins are not brokered.
|
|
134
110
|
- A host `*_BASE_URL` override is dropped rather than used as the broker's upstream.
|
|
135
|
-
- Compositions that declare local workspace packages cannot load their platform-specific
|
|
136
|
-
dependencies inside the Linux container; use registry-installed layers for sandboxed work.
|
|
137
|
-
- One container holds every cockpit session, so sessions can read each other's mounted
|
|
138
|
-
workspaces.
|
|
139
|
-
- Container network access follows the engine's defaults and is not restricted yet.
|
|
140
|
-
- Mounted repositories are writable. Containers do not protect those files from agent edits,
|
|
141
|
-
and the container engine remains part of the trusted base.
|
|
142
111
|
|
|
143
112
|
## Public API
|
|
144
113
|
|
|
145
114
|
```ts
|
|
146
115
|
import { DefaultSandboxExtensionService } from '@agimon-ai/po-sandbox';
|
|
147
|
-
import { createCockpitHarness, startCockpitContainer } from '@agimon-ai/po-sandbox/cockpitHarness';
|
|
148
116
|
```
|
|
149
117
|
|
|
150
|
-
|
|
151
|
-
`/
|
|
118
|
+
`DefaultSandboxExtensionService` reports sandbox state from the environment it is given.
|
|
119
|
+
`/extensions/server` registers the in-session command, its Help resources, and the brokered
|
|
120
|
+
provider overrides.
|
|
152
121
|
|
|
153
122
|
## Development
|
|
154
123
|
|
|
@@ -167,4 +136,4 @@ Maintained by [Agimon](https://agimon.ai/about).
|
|
|
167
136
|
|
|
168
137
|
## License
|
|
169
138
|
|
|
170
|
-
|
|
139
|
+
Business Source License 1.1: free for personal use, organisations under USD 1M revenue, non-profits and education. See [LICENSE](LICENSE) and https://agimon.ai/licensing.
|
package/dist/apiContracts.cjs
CHANGED
|
@@ -3,7 +3,7 @@ Object.defineProperties(exports, {
|
|
|
3
3
|
[Symbol.toStringTag]: { value: "Module" }
|
|
4
4
|
});
|
|
5
5
|
//#region src/schemas/apiContracts.ts
|
|
6
|
-
/** This
|
|
6
|
+
/** This server plugin contributes agent tools, commands or lifecycle only, with no separate HTTP or socket surface. */
|
|
7
7
|
const apiContracts = (0, require("@agimon-ai/po-core/apiContracts").defineApiContract)({
|
|
8
8
|
version: 1,
|
|
9
9
|
http: [],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"apiContracts.cjs","names":["defineApiContract"],"sources":["../src/schemas/apiContracts.ts"],"sourcesContent":["import { defineApiContract } from '@agimon-ai/po-core/apiContracts';\n\n/** This
|
|
1
|
+
{"version":3,"file":"apiContracts.cjs","names":["defineApiContract"],"sources":["../src/schemas/apiContracts.ts"],"sourcesContent":["import { defineApiContract } from '@agimon-ai/po-core/apiContracts';\n\n/** This server plugin contributes agent tools, commands or lifecycle only, with no separate HTTP or socket surface. */\nexport const apiContracts = defineApiContract({ version: 1, http: [], sockets: [], dynamic: [] });\nexport default apiContracts;\n"],"mappings":";;;;;;AAGA,MAAa,gBAAA,4CAAeA,CAAAA,CAAAA,kBAAAA,CAAkB;CAAE,SAAS;CAAG,MAAM,CAAC;CAAG,SAAS,CAAC;CAAG,SAAS,CAAC;AAAE,CAAC"}
|
package/dist/apiContracts.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
//#region src/schemas/apiContracts.d.ts
|
|
2
|
-
/** This
|
|
2
|
+
/** This server plugin contributes agent tools, commands or lifecycle only, with no separate HTTP or socket surface. */
|
|
3
3
|
export declare const apiContracts: {
|
|
4
4
|
version: 1;
|
|
5
5
|
protocols?: Record<string, string> | undefined;
|
package/dist/apiContracts.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defineApiContract } from "@agimon-ai/po-core/apiContracts";
|
|
2
2
|
//#region src/schemas/apiContracts.ts
|
|
3
|
-
/** This
|
|
3
|
+
/** This server plugin contributes agent tools, commands or lifecycle only, with no separate HTTP or socket surface. */
|
|
4
4
|
const apiContracts = defineApiContract({
|
|
5
5
|
version: 1,
|
|
6
6
|
http: [],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"apiContracts.mjs","names":[],"sources":["../src/schemas/apiContracts.ts"],"sourcesContent":["import { defineApiContract } from '@agimon-ai/po-core/apiContracts';\n\n/** This
|
|
1
|
+
{"version":3,"file":"apiContracts.mjs","names":[],"sources":["../src/schemas/apiContracts.ts"],"sourcesContent":["import { defineApiContract } from '@agimon-ai/po-core/apiContracts';\n\n/** This server plugin contributes agent tools, commands or lifecycle only, with no separate HTTP or socket surface. */\nexport const apiContracts = defineApiContract({ version: 1, http: [], sockets: [], dynamic: [] });\nexport default apiContracts;\n"],"mappings":";;;AAGA,MAAa,eAAe,kBAAkB;CAAE,SAAS;CAAG,MAAM,CAAC;CAAG,SAAS,CAAC;CAAG,SAAS,CAAC;AAAE,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
//#region src/services/extensionService/index.ts
|
|
2
|
+
const SANDBOXED_MESSAGE = "Sandboxed session: the agent, extensions, and tools run inside the container.";
|
|
3
|
+
const HOST_MESSAGE = "Host session: the agent runs on the host. Per-workspace containers are not available yet.";
|
|
4
|
+
var DefaultSandboxExtensionService = class {
|
|
5
|
+
identity;
|
|
6
|
+
/** `identity` is the server's `po/sandbox-identity`; a host server binds none. */
|
|
7
|
+
constructor(identity) {
|
|
8
|
+
this.identity = identity;
|
|
9
|
+
}
|
|
10
|
+
async execute() {
|
|
11
|
+
return {
|
|
12
|
+
message: this.identity?.contained === true ? SANDBOXED_MESSAGE : HOST_MESSAGE,
|
|
13
|
+
level: "info"
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
//#endregion
|
|
18
|
+
Object.defineProperty(exports, "DefaultSandboxExtensionService", {
|
|
19
|
+
enumerable: true,
|
|
20
|
+
get: function() {
|
|
21
|
+
return DefaultSandboxExtensionService;
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
//# sourceMappingURL=extensionService-628BZd5z.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"extensionService-628BZd5z.cjs","names":[],"sources":["../src/services/extensionService/index.ts"],"sourcesContent":["import type { PoSandboxIdentity } from '@agimon-ai/po-core/sandboxIdentity';\n\nimport type { SandboxExtensionResult, SandboxExtensionService } from '../../types/extension';\n\nconst SANDBOXED_MESSAGE = 'Sandboxed session: the agent, extensions, and tools run inside the container.';\nconst HOST_MESSAGE = 'Host session: the agent runs on the host. Per-workspace containers are not available yet.';\n\nexport class DefaultSandboxExtensionService implements SandboxExtensionService {\n private readonly identity: PoSandboxIdentity | undefined;\n\n /** `identity` is the server's `po/sandbox-identity`; a host server binds none. */\n constructor(identity: PoSandboxIdentity | undefined) {\n this.identity = identity;\n }\n\n async execute(): Promise<SandboxExtensionResult> {\n return {\n message: this.identity?.contained === true ? SANDBOXED_MESSAGE : HOST_MESSAGE,\n level: 'info',\n };\n }\n}\n"],"mappings":";AAIA,MAAM,oBAAoB;AAC1B,MAAM,eAAe;AAErB,IAAa,iCAAb,MAA+E;CAC7E;;CAGA,YAAY,UAAyC;EACnD,KAAK,WAAW;CAClB;CAEA,MAAM,UAA2C;EAC/C,OAAO;GACL,SAAS,KAAK,UAAU,cAAc,OAAO,oBAAoB;GACjE,OAAO;EACT;CACF;AACF"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
//#region src/services/extensionService/index.ts
|
|
2
|
+
const SANDBOXED_MESSAGE = "Sandboxed session: the agent, extensions, and tools run inside the container.";
|
|
3
|
+
const HOST_MESSAGE = "Host session: the agent runs on the host. Per-workspace containers are not available yet.";
|
|
4
|
+
var DefaultSandboxExtensionService = class {
|
|
5
|
+
identity;
|
|
6
|
+
/** `identity` is the server's `po/sandbox-identity`; a host server binds none. */
|
|
7
|
+
constructor(identity) {
|
|
8
|
+
this.identity = identity;
|
|
9
|
+
}
|
|
10
|
+
async execute() {
|
|
11
|
+
return {
|
|
12
|
+
message: this.identity?.contained === true ? SANDBOXED_MESSAGE : HOST_MESSAGE,
|
|
13
|
+
level: "info"
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
//#endregion
|
|
18
|
+
export { DefaultSandboxExtensionService as t };
|
|
19
|
+
|
|
20
|
+
//# sourceMappingURL=extensionService-Cz9QRLJ5.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"extensionService-Cz9QRLJ5.mjs","names":[],"sources":["../src/services/extensionService/index.ts"],"sourcesContent":["import type { PoSandboxIdentity } from '@agimon-ai/po-core/sandboxIdentity';\n\nimport type { SandboxExtensionResult, SandboxExtensionService } from '../../types/extension';\n\nconst SANDBOXED_MESSAGE = 'Sandboxed session: the agent, extensions, and tools run inside the container.';\nconst HOST_MESSAGE = 'Host session: the agent runs on the host. Per-workspace containers are not available yet.';\n\nexport class DefaultSandboxExtensionService implements SandboxExtensionService {\n private readonly identity: PoSandboxIdentity | undefined;\n\n /** `identity` is the server's `po/sandbox-identity`; a host server binds none. */\n constructor(identity: PoSandboxIdentity | undefined) {\n this.identity = identity;\n }\n\n async execute(): Promise<SandboxExtensionResult> {\n return {\n message: this.identity?.contained === true ? SANDBOXED_MESSAGE : HOST_MESSAGE,\n level: 'info',\n };\n }\n}\n"],"mappings":";AAIA,MAAM,oBAAoB;AAC1B,MAAM,eAAe;AAErB,IAAa,iCAAb,MAA+E;CAC7E;;CAGA,YAAY,UAAyC;EACnD,KAAK,WAAW;CAClB;CAEA,MAAM,UAA2C;EAC/C,OAAO;GACL,SAAS,KAAK,UAAU,cAAc,OAAO,oBAAoB;GACjE,OAAO;EACT;CACF;AACF"}
|
package/dist/extensions/mcp.cjs
CHANGED
|
@@ -3,12 +3,12 @@ Object.defineProperties(exports, {
|
|
|
3
3
|
[Symbol.toStringTag]: { value: "Module" }
|
|
4
4
|
});
|
|
5
5
|
let _agimon_ai_po_core_mcpFacet = require("@agimon-ai/po-core/mcpFacet");
|
|
6
|
-
let
|
|
7
|
-
//#region src/extensions/workspaces/sessions/(backend)/skill/
|
|
8
|
-
var
|
|
9
|
-
name: "
|
|
10
|
-
description: "Use @agimon-ai/po-sandbox:
|
|
11
|
-
read: () => (0,
|
|
6
|
+
let _agimon_ai_po_core_serverPlugin = require("@agimon-ai/po-core/serverPlugin");
|
|
7
|
+
//#region src/extensions/workspaces/sessions/(backend)/skill/help-how-to-sandbox.mcp.ts
|
|
8
|
+
var help_how_to_sandbox_mcp_default = (0, _agimon_ai_po_core_mcpFacet.defineMcpSkill)({
|
|
9
|
+
name: "help-how-to-sandbox",
|
|
10
|
+
description: "Use @agimon-ai/po-sandbox: Sandbox building blocks for Po: container engine detection, the sandbox image, and a host credential broker for per-workspace containers, which are not wired yet",
|
|
11
|
+
read: () => (0, _agimon_ai_po_core_serverPlugin.readPackageResource)(require("url").pathToFileURL(__filename).href, "src/prompts/help-how-to-sandbox/SKILL.md")
|
|
12
12
|
});
|
|
13
13
|
//#endregion
|
|
14
14
|
//#region generated/mcp.ts
|
|
@@ -16,7 +16,7 @@ const at = (value, context) => typeof value === "function" ? value(context) : va
|
|
|
16
16
|
const mcp = (0, _agimon_ai_po_core_mcpFacet.defineMcpPlugin)({
|
|
17
17
|
name: "@agimon-ai/po-sandbox",
|
|
18
18
|
session: (context) => ({ get skills() {
|
|
19
|
-
return [at(
|
|
19
|
+
return [at(help_how_to_sandbox_mcp_default, context)];
|
|
20
20
|
} })
|
|
21
21
|
});
|
|
22
22
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mcp.cjs","names":["defineMcpSkill","readPackageResource","defineMcpPlugin","
|
|
1
|
+
{"version":3,"file":"mcp.cjs","names":["defineMcpSkill","readPackageResource","defineMcpPlugin","skillHelpHowToSandbox"],"sources":["../../src/extensions/workspaces/sessions/(backend)/skill/help-how-to-sandbox.mcp.ts","../../generated/mcp.ts"],"sourcesContent":["import { defineMcpSkill } from '@agimon-ai/po-core/mcpFacet';\nimport { readPackageResource } from '@agimon-ai/po-core/serverPlugin';\n\nexport default defineMcpSkill({\n name: 'help-how-to-sandbox',\n description:\n 'Use @agimon-ai/po-sandbox: Sandbox building blocks for Po: container engine detection, the sandbox image, and a host credential broker for per-workspace containers, which are not wired yet',\n read: () => readPackageResource(import.meta.url, 'src/prompts/help-how-to-sandbox/SKILL.md'),\n});\n","// Generated by @agimon-ai/po-build. Do not edit by hand.\nimport { defineMcpPlugin, type PoMcpSessionPlugin } from '@agimon-ai/po-core/mcpFacet';\n\nimport skillHelpHowToSandbox from '../src/extensions/workspaces/sessions/(backend)/skill/help-how-to-sandbox.mcp';\n\ntype Factory<T, C> = (context: C) => T;\nconst at = <T, C>(value: T | Factory<T, C>, context: C): T =>\n typeof value === 'function' ? (value as Factory<T, C>)(context) : value;\n\nexport const mcp = defineMcpPlugin({\n name: '@agimon-ai/po-sandbox',\n session: (context) => ({\n get skills(): PoMcpSessionPlugin['skills'] { return [at(skillHelpHowToSandbox, context)]; },\n }) satisfies PoMcpSessionPlugin,\n});\n\nexport default mcp;\n"],"mappings":";;;;;;;AAGA,IAAA,mCAAA,GAAeA,4BAAAA,eAAAA,CAAe;CAC5B,MAAM;CACN,aACE;CACF,aAAA,GAAYC,gCAAAA,oBAAAA,CAAAA,QAAAA,KAAAA,CAAAA,CAAAA,cAAAA,UAAAA,CAAAA,CAAAA,MAAqC,0CAA0C;AAC7F,CAAC;;;ACFD,MAAM,MAAY,OAA0B,YAC1C,OAAO,UAAU,aAAc,MAAwB,OAAO,IAAI;AAEpE,MAAa,OAAA,GAAMC,4BAAAA,gBAAAA,CAAgB;CACjC,MAAM;CACN,UAAU,aAAa,EACrB,IAAI,SAAuC;EAAE,OAAO,CAAC,GAAGC,iCAAuB,OAAO,CAAC;CAAG,EAC5F;AACF,CAAC"}
|
package/dist/extensions/mcp.mjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { defineMcpPlugin, defineMcpSkill } from "@agimon-ai/po-core/mcpFacet";
|
|
2
|
-
import { readPackageResource } from "@agimon-ai/po-core/
|
|
3
|
-
//#region src/extensions/workspaces/sessions/(backend)/skill/
|
|
4
|
-
var
|
|
5
|
-
name: "
|
|
6
|
-
description: "Use @agimon-ai/po-sandbox:
|
|
7
|
-
read: () => readPackageResource(import.meta.url, "src/prompts/
|
|
2
|
+
import { readPackageResource } from "@agimon-ai/po-core/serverPlugin";
|
|
3
|
+
//#region src/extensions/workspaces/sessions/(backend)/skill/help-how-to-sandbox.mcp.ts
|
|
4
|
+
var help_how_to_sandbox_mcp_default = defineMcpSkill({
|
|
5
|
+
name: "help-how-to-sandbox",
|
|
6
|
+
description: "Use @agimon-ai/po-sandbox: Sandbox building blocks for Po: container engine detection, the sandbox image, and a host credential broker for per-workspace containers, which are not wired yet",
|
|
7
|
+
read: () => readPackageResource(import.meta.url, "src/prompts/help-how-to-sandbox/SKILL.md")
|
|
8
8
|
});
|
|
9
9
|
//#endregion
|
|
10
10
|
//#region generated/mcp.ts
|
|
@@ -12,7 +12,7 @@ const at = (value, context) => typeof value === "function" ? value(context) : va
|
|
|
12
12
|
const mcp = defineMcpPlugin({
|
|
13
13
|
name: "@agimon-ai/po-sandbox",
|
|
14
14
|
session: (context) => ({ get skills() {
|
|
15
|
-
return [at(
|
|
15
|
+
return [at(help_how_to_sandbox_mcp_default, context)];
|
|
16
16
|
} })
|
|
17
17
|
});
|
|
18
18
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mcp.mjs","names":["
|
|
1
|
+
{"version":3,"file":"mcp.mjs","names":["skillHelpHowToSandbox"],"sources":["../../src/extensions/workspaces/sessions/(backend)/skill/help-how-to-sandbox.mcp.ts","../../generated/mcp.ts"],"sourcesContent":["import { defineMcpSkill } from '@agimon-ai/po-core/mcpFacet';\nimport { readPackageResource } from '@agimon-ai/po-core/serverPlugin';\n\nexport default defineMcpSkill({\n name: 'help-how-to-sandbox',\n description:\n 'Use @agimon-ai/po-sandbox: Sandbox building blocks for Po: container engine detection, the sandbox image, and a host credential broker for per-workspace containers, which are not wired yet',\n read: () => readPackageResource(import.meta.url, 'src/prompts/help-how-to-sandbox/SKILL.md'),\n});\n","// Generated by @agimon-ai/po-build. Do not edit by hand.\nimport { defineMcpPlugin, type PoMcpSessionPlugin } from '@agimon-ai/po-core/mcpFacet';\n\nimport skillHelpHowToSandbox from '../src/extensions/workspaces/sessions/(backend)/skill/help-how-to-sandbox.mcp';\n\ntype Factory<T, C> = (context: C) => T;\nconst at = <T, C>(value: T | Factory<T, C>, context: C): T =>\n typeof value === 'function' ? (value as Factory<T, C>)(context) : value;\n\nexport const mcp = defineMcpPlugin({\n name: '@agimon-ai/po-sandbox',\n session: (context) => ({\n get skills(): PoMcpSessionPlugin['skills'] { return [at(skillHelpHowToSandbox, context)]; },\n }) satisfies PoMcpSessionPlugin,\n});\n\nexport default mcp;\n"],"mappings":";;;AAGA,IAAA,kCAAe,eAAe;CAC5B,MAAM;CACN,aACE;CACF,YAAY,oBAAoB,YAAY,KAAK,0CAA0C;AAC7F,CAAC;;;ACFD,MAAM,MAAY,OAA0B,YAC1C,OAAO,UAAU,aAAc,MAAwB,OAAO,IAAI;AAEpE,MAAa,MAAM,gBAAgB;CACjC,MAAM;CACN,UAAU,aAAa,EACrB,IAAI,SAAuC;EAAE,OAAO,CAAC,GAAGA,iCAAuB,OAAO,CAAC;CAAG,EAC5F;AACF,CAAC"}
|