@agimon-ai/po-sandbox 0.0.0-alpha.2 → 0.0.0-alpha.200

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.
Files changed (45) hide show
  1. package/LICENSE +97 -8
  2. package/README.md +75 -114
  3. package/dist/apiContracts.cjs +1 -1
  4. package/dist/apiContracts.cjs.map +1 -1
  5. package/dist/apiContracts.d.mts +3 -3
  6. package/dist/apiContracts.mjs +1 -1
  7. package/dist/apiContracts.mjs.map +1 -1
  8. package/dist/extensionService-6rO7rH9c.mjs +22 -0
  9. package/dist/extensionService-6rO7rH9c.mjs.map +1 -0
  10. package/dist/extensionService-DKROEZa0.cjs +27 -0
  11. package/dist/extensionService-DKROEZa0.cjs.map +1 -0
  12. package/dist/extensions/mcp.cjs +7 -7
  13. package/dist/extensions/mcp.cjs.map +1 -1
  14. package/dist/extensions/mcp.d.mts +1 -1
  15. package/dist/extensions/mcp.mjs +7 -7
  16. package/dist/extensions/mcp.mjs.map +1 -1
  17. package/dist/extensions/server.cjs +1336 -354
  18. package/dist/extensions/server.cjs.map +1 -1
  19. package/dist/extensions/server.d.mts +2 -2
  20. package/dist/extensions/server.d.mts.map +1 -1
  21. package/dist/extensions/server.mjs +1310 -347
  22. package/dist/extensions/server.mjs.map +1 -1
  23. package/dist/index.cjs +1 -1
  24. package/dist/index.d.mts +5 -2
  25. package/dist/index.d.mts.map +1 -1
  26. package/dist/index.mjs +1 -2
  27. package/dist/po-runtime-identity.json +1 -0
  28. package/llms.txt +3 -3
  29. package/package.json +23 -20
  30. package/src/prompts/help-how-to-sandbox/SKILL.md +60 -0
  31. package/dist/cockpitHarness.cjs +0 -600
  32. package/dist/cockpitHarness.cjs.map +0 -1
  33. package/dist/cockpitHarness.d.mts +0 -41
  34. package/dist/cockpitHarness.d.mts.map +0 -1
  35. package/dist/cockpitHarness.mjs +0 -594
  36. package/dist/cockpitHarness.mjs.map +0 -1
  37. package/dist/extensionService-CoqM-IE1.cjs +0 -25
  38. package/dist/extensionService-CoqM-IE1.cjs.map +0 -1
  39. package/dist/extensionService-FmuCugPK.mjs +0 -20
  40. package/dist/extensionService-FmuCugPK.mjs.map +0 -1
  41. package/dist/sandboxBridge-77zC5pQR.mjs +0 -13
  42. package/dist/sandboxBridge-77zC5pQR.mjs.map +0 -1
  43. package/dist/sandboxBridge-Db6DubLC.cjs +0 -81
  44. package/dist/sandboxBridge-Db6DubLC.cjs.map +0 -1
  45. package/src/prompts/po-use-sandbox/SKILL.md +0 -14
package/LICENSE CHANGED
@@ -1,13 +1,102 @@
1
- MIT License
1
+ # Functional Source License, Version 1.1, MIT Future License
2
2
 
3
- Copyright (c) 2026 Vuong Ngo
3
+ ## Abbreviation
4
4
 
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
5
+ FSL-1.1-MIT
6
+
7
+ ## Notice
8
+
9
+ Copyright 2026 Agimon Pty Ltd
10
+
11
+ ## Terms and Conditions
12
+
13
+ ### Licensor ("We")
14
+
15
+ The party offering the Software under these Terms and Conditions.
16
+
17
+ ### The Software
18
+
19
+ The "Software" is each version of the software that we make available under
20
+ these Terms and Conditions, as indicated by our inclusion of these Terms and
21
+ Conditions with the Software.
22
+
23
+ ### License Grant
24
+
25
+ Subject to your compliance with this License Grant and the Patents,
26
+ Redistribution and Trademark clauses below, we hereby grant you the right to
27
+ use, copy, modify, create derivative works, publicly perform, publicly display
28
+ and redistribute the Software for any Permitted Purpose identified below.
29
+
30
+ ### Permitted Purpose
31
+
32
+ A Permitted Purpose is any purpose other than a Competing Use. A Competing Use
33
+ means making the Software available to others in a commercial product or
34
+ service that:
35
+
36
+ 1. substitutes for the Software;
37
+
38
+ 2. substitutes for any other product or service we offer using the Software
39
+ that exists as of the date we make the Software available; or
40
+
41
+ 3. offers the same or substantially similar functionality as the Software.
42
+
43
+ Permitted Purposes specifically include using the Software:
44
+
45
+ 1. for your internal use and access;
46
+
47
+ 2. for non-commercial education;
48
+
49
+ 3. for non-commercial research; and
50
+
51
+ 4. in connection with professional services that you provide to a licensee
52
+ using the Software in accordance with these Terms and Conditions.
53
+
54
+ ### Patents
55
+
56
+ To the extent your use for a Permitted Purpose would necessarily infringe our
57
+ patents, the license grant above includes a license under our patents. If you
58
+ make a claim against any party that the Software infringes or contributes to
59
+ the infringement of any patent, then your patent license to the Software ends
60
+ immediately.
61
+
62
+ ### Redistribution
63
+
64
+ The Terms and Conditions apply to all copies, modifications and derivatives of
65
+ the Software.
66
+
67
+ If you redistribute any copies, modifications or derivatives of the Software,
68
+ you must include a copy of or a link to these Terms and Conditions and not
69
+ remove any copyright notices provided in or with the Software.
70
+
71
+ ### Disclaimer
72
+
73
+ THE SOFTWARE IS PROVIDED "AS IS" AND WITHOUT WARRANTIES OF ANY KIND, EXPRESS OR
74
+ IMPLIED, INCLUDING WITHOUT LIMITATION WARRANTIES OF FITNESS FOR A PARTICULAR
75
+ PURPOSE, MERCHANTABILITY, TITLE OR NON-INFRINGEMENT.
76
+
77
+ IN NO EVENT WILL WE HAVE ANY LIABILITY TO YOU ARISING OUT OF OR RELATED TO THE
78
+ SOFTWARE, INCLUDING INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES,
79
+ EVEN IF WE HAVE BEEN INFORMED OF THEIR POSSIBILITY IN ADVANCE.
80
+
81
+ ### Trademarks
82
+
83
+ Except for displaying the License Details and identifying us as the origin of
84
+ the Software, you have no right under these Terms and Conditions to use our
85
+ trademarks, trade names, service marks or product names.
86
+
87
+ ## Grant of Future License
88
+
89
+ We hereby irrevocably grant you an additional license to use the Software under
90
+ the MIT license that is effective on the second anniversary of the date we make
91
+ the Software available. On or after that date, you may use the Software under
92
+ the MIT license, in which case the following will apply:
93
+
94
+ Permission is hereby granted, free of charge, to any person obtaining a copy of
95
+ this software and associated documentation files (the "Software"), to deal in
96
+ the Software without restriction, including without limitation the rights to
97
+ use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
98
+ of the Software, and to permit persons to whom the Software is furnished to do
99
+ so, subject to the following conditions:
11
100
 
12
101
  The above copyright notice and this permission notice shall be included in all
13
102
  copies or substantial portions of the Software.
package/README.md CHANGED
@@ -1,14 +1,60 @@
1
1
  # @agimon-ai/po-sandbox
2
2
 
3
- Run the Po web cockpit, its sessions, and their tools in a container while the browser stays on the host.
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
+ A new session of a sandboxed workspace runs in that workspace's container. Switching a workspace on moves its
12
+ saved sessions into the container; sessions already running on the host stay there until they close. Model calls
13
+ from a container go through the host's model gateway. The [setup guide](src/prompts/help-how-to-sandbox/SKILL.md)
14
+ has the prerequisites and a troubleshooting table, and is offered as the `help-how-to-sandbox` skill in Help mode.
15
+
16
+ ### The container provider
17
+
18
+ When the layer loads on a server's host 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 host must supply an exact public `@agimon-ai/po` CLI version. Without one, the provider is unavailable.
26
+ 3. If a workspace uses the provider, Po builds `po-sandbox:<digest>` only if missing. The image includes that exact
27
+ CLI release and its catalogue, plus Node 24, git, procps, ripgrep, corepack, and the headless cloak browser
28
+ and its libraries and fonts. The digest includes both the Dockerfile and CLI version.
29
+ 4. Po adopts a running container only if its owner, workspace, image and Artifacts shelf match. Otherwise, after
30
+ the new image is ready, Po replaces the container without deleting named volumes or the sandbox Po home.
31
+ Stale `*.po-v4.lock` files are cleared only when no container for that workspace runs.
32
+
33
+ Each container runs the baked `po-server` and mounts the workspace at its own path and
34
+ `P = ~/.po/sandboxes/<workspace>` at its own path with `PO_HOME=P`, so conversations and artifacts stay on host
35
+ disk. Package caches, worktrees and the container home live in named volumes. The container publishes one port on
36
+ host loopback only, runs with `--cap-drop=ALL`, `no-new-privileges` and a pid limit, and gets no credentials, no
37
+ hub token, no engine socket, and no part of the host `~/.po` beyond `P`, the shared host Artifacts shelf, the three seed files
38
+ (`presets.yaml`, `domains.yaml`, `config.yaml`, read-only) and its own token file (read-only).
39
+
40
+ The real outer host Artifacts shelf (`<outer agent directory>/po-host-artifacts`) is mounted read-write at
41
+ `/po-home/po-host-artifacts`, admitted through `PO_HOST_ARTIFACTS_DIR`. Only that folder is shared, not the
42
+ outer agent directory. Containers missing this mount contract are replaced while keeping their named volumes.
43
+
44
+ Every container runs with `--user`: the host user on Linux, `1000:1000` elsewhere (Docker Desktop maps it to the
45
+ host user on shared folders). A new runtime or git volume is first mounted on a world-writable image folder, so it
46
+ stays writable for that user, as the `/po-home` volume is.
47
+
48
+ Containers outlive the hub process: a reload, an idle restart (exit 75) or a crash leaves them running, and the
49
+ next start adopts them. A clean user stop stops them: the provider's `onCleanStop` hook in
50
+ `po/workspace-sandboxes` calls `stopAll`. `po/workspace-containers` also exposes `stop` for switching the sandbox
51
+ off.
52
+
7
53
  ## Requirements
8
54
 
9
55
  - Node.js 24 or newer
10
- - `@earendil-works/pi-coding-agent` 0.85.0
11
- - One of `docker`, `podman`, `nerdctl`, or `finch` on the host for the cockpit container
56
+ - Docker or a compatible engine, with network access to the image and package sources for the first build
57
+ - A host CLI version published to the public npm registry
12
58
 
13
59
  ## Install
14
60
 
@@ -16,13 +62,10 @@ Part of the [Po distribution](https://www.npmjs.com/package/@agimon-ai/po).
16
62
  npm install @agimon-ai/po-sandbox
17
63
  ```
18
64
 
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
65
  ## Enable the sandbox
23
66
 
24
- This layer is still in development, so `po init` does not add it to any mode. Opt in by hand:
25
- name it as a layer in `.po/modes.yaml`, then list that layer on the mode you want it in.
67
+ `po init` writes a `sandbox` layer and adds it to the `copilot` preset. To use it in another preset,
68
+ list the layer on that preset in `.po/presets.yaml`:
26
69
 
27
70
  ```yaml
28
71
  layers:
@@ -30,141 +73,59 @@ layers:
30
73
  packages:
31
74
  - '@agimon-ai/po-sandbox'
32
75
 
33
- majorMode:
76
+ preset:
34
77
  copilot:
35
- description: General-purpose coding mode.
78
+ description: General-purpose coding preset.
36
79
  layers: [team, ask-user, task, sandbox]
37
80
  ```
38
81
 
39
- A mode without this layer offers no cockpit container, and the cockpit refuses containment rather
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:
82
+ ## In-session command
73
83
 
74
- ```bash
75
- PO_SANDBOX_RUN_FLAGS=--runtime=runsc po
84
+ ```text
85
+ /po-sandbox
76
86
  ```
77
87
 
78
- Options must be self-contained (`--flag` or `--flag=value`). A separated value such as
79
- `--runtime runsc` is refused, because a bare word cannot be told apart from an image name and
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
88
+ Reports whether the current session runs inside a sandbox container (the server's
89
+ `po/sandbox-identity` says it is contained) or directly on the host.
86
90
 
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.
91
+ ## Brokered providers
90
92
 
91
- ## Signing in from inside the sandbox
93
+ When a session's admitted environment names brokered providers (`PO_BROKER_PROVIDERS`) and a
94
+ broker route (`PO_BROKER_SOCKET` or `PO_BROKER_ADDRESS`), the server plugin overrides those
95
+ providers' base URLs so requests go through the broker. The session's credential variables are
96
+ expected to hold the broker's session token, not the real key. With no broker route the layer
97
+ changes nothing.
92
98
 
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
99
-
100
- For supported providers with a host API key, the credential broker:
101
-
102
- 1. Starts a broker on the host and grants the container exactly one route to it.
103
- 2. Replaces the credential variable with a random per-session token.
104
- 3. Redirects the provider's base URL at a loopback bridge inside the container, which forwards
105
- raw bytes to the broker.
106
-
107
- How the container reaches the broker depends on the engine:
99
+ How a container reaches the broker depends on the engine:
108
100
 
109
101
  | Host | Transport | Why |
110
102
  | ----------------------------- | ------------------------------------------- | ---------------------------------------------------------------------------------- |
111
103
  | Linux | Unix socket, bind-mounted, owner-only | Container and host share a kernel, so no port is needed |
112
104
  | 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
105
 
114
- On the TCP path the broker binds `127.0.0.1` on an ephemeral port, so it is never exposed beyond
115
- the host, and the launch passes `--add-host` so the gateway name resolves on every engine. Another
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
- /doom-sandbox
126
- ```
127
-
128
- Reports whether the current session runs inside the sandbox container or directly on the host.
106
+ A socket route goes through a loopback bridge inside the container, because no SDK can dial a
107
+ socket path. A TCP route is addressed directly.
129
108
 
130
109
  ## Current limits
131
110
 
132
- - The broker carries a curated provider list. OAuth subscription logins are not brokered, and
133
- their callbacks cannot reach the cockpit container.
111
+ - Nothing starts a credential broker for a workspace container; its model calls use the host's model gateway.
112
+ - The broker carries a curated provider list. OAuth subscription logins are not brokered.
134
113
  - 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
-
143
- ## Public API
144
-
145
- ```ts
146
- import { DefaultSandboxExtensionService } from '@agimon-ai/po-sandbox';
147
- import { createCockpitHarness, startCockpitContainer } from '@agimon-ai/po-sandbox/cockpitHarness';
148
- ```
149
-
150
- The service layer is host-neutral. `/extensions/server` registers the in-session command, and
151
- `/cockpitHarness` owns the web cockpit's container lifecycle and credential broker.
152
114
 
153
115
  ## Development
154
116
 
155
117
  Run from this package directory in the workspace:
156
118
 
157
119
  ```bash
158
- pnpm build
159
- pnpm typecheck
160
- pnpm test
161
- pnpm lint
162
- pnpm exec vibe-lint check .
163
- npm pack --dry-run
120
+ pnpm exec nx run-many -t lint typecheck build test -p @agimon-ai/po-sandbox
164
121
  ```
165
122
 
123
+ To exercise a real Docker boot with an exact published CLI release, set `PO_SANDBOX_CLI_VERSION` to that release
124
+ and run `PO_SANDBOX_REAL_BOOT=1 pnpm test-system` from this package. If Docker uses a non-default context,
125
+ pass `DOCKER_CONFIG` explicitly because the test sets a temporary `HOME`.
126
+
166
127
  Maintained by [Agimon](https://agimon.ai/about).
167
128
 
168
129
  ## License
169
130
 
170
- MIT
131
+ Functional Source License 1.1, MIT Future License (FSL-1.1-MIT): free for any purpose except a Competing Use; each version converts to MIT two years after release. See [LICENSE](LICENSE).
@@ -3,7 +3,7 @@ Object.defineProperties(exports, {
3
3
  [Symbol.toStringTag]: { value: "Module" }
4
4
  });
5
5
  //#region src/schemas/apiContracts.ts
6
- /** This facet contributes agent tools, commands or lifecycle only, with no separate HTTP or socket surface. */
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 facet 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"}
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,G,yCAAeA,CAAAA,CAAAA,kBAAAA,CAAkB;CAAE,SAAS;CAAG,MAAM,CAAC;CAAG,SAAS,CAAC;CAAG,SAAS,CAAC;AAAE,CAAC"}
@@ -1,12 +1,12 @@
1
1
  //#region src/schemas/apiContracts.d.ts
2
- /** This facet contributes agent tools, commands or lifecycle only, with no separate HTTP or socket surface. */
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;
6
6
  schemas?: Record<string, boolean | object> | undefined;
7
7
  http: {
8
8
  id: string;
9
- scope: "global" | "session" | "workspace";
9
+ scope: "host" | "session" | "workspace";
10
10
  basePath?: string | undefined;
11
11
  path: string;
12
12
  method: "DELETE" | "GET" | "HEAD" | "OPTIONS" | "PATCH" | "POST" | "PUT";
@@ -34,7 +34,7 @@ export declare const apiContracts: {
34
34
  }[];
35
35
  sockets: {
36
36
  id: string;
37
- scope: "global" | "session" | "workspace";
37
+ scope: "host" | "session" | "workspace";
38
38
  description: string;
39
39
  availability?: string | undefined;
40
40
  service: string;
@@ -1,6 +1,6 @@
1
1
  import { defineApiContract } from "@agimon-ai/po-core/apiContracts";
2
2
  //#region src/schemas/apiContracts.ts
3
- /** This facet contributes agent tools, commands or lifecycle only, with no separate HTTP or socket surface. */
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 facet 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"}
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,22 @@
1
+ import { formatMessage } from "@agimon-ai/po-core/locale";
2
+ //#region src/services/extensionService/index.ts
3
+ var DefaultSandboxExtensionService = class {
4
+ translate;
5
+ identity;
6
+ /** `identity` is the server's `po/sandbox-identity`; a host server binds none. */
7
+ constructor(identity, translate = (_key, fallback) => formatMessage(fallback)) {
8
+ this.translate = translate;
9
+ this.identity = identity;
10
+ }
11
+ async execute() {
12
+ const t = this.translate;
13
+ return {
14
+ message: this.identity?.contained === true ? t("sandbox.notice.contained", "Sandboxed session: the agent, extensions, and tools run inside the container.") : t("sandbox.notice.host", "Host session: the agent, extensions, and tools run on the host. A session that was already running when its workspace switched to a container stays on the host until it closes."),
15
+ level: "info"
16
+ };
17
+ }
18
+ };
19
+ //#endregion
20
+ export { DefaultSandboxExtensionService as t };
21
+
22
+ //# sourceMappingURL=extensionService-6rO7rH9c.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"extensionService-6rO7rH9c.mjs","names":[],"sources":["../src/services/extensionService/index.ts"],"sourcesContent":["import { formatMessage } from '@agimon-ai/po-core/locale';\nimport type { PoSandboxIdentity } from '@agimon-ai/po-core/sandboxIdentity';\n\nimport type { SandboxExtensionResult, SandboxExtensionService } from '../../types/extension';\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(\n identity: PoSandboxIdentity | undefined,\n private readonly translate: (key: string, fallback: string) => string = (_key, fallback) => formatMessage(fallback),\n ) {\n this.identity = identity;\n }\n\n async execute(): Promise<SandboxExtensionResult> {\n const t = this.translate;\n return {\n message:\n this.identity?.contained === true\n ? t(\n 'sandbox.notice.contained',\n 'Sandboxed session: the agent, extensions, and tools run inside the container.',\n )\n : t(\n 'sandbox.notice.host',\n 'Host session: the agent, extensions, and tools run on the host. A session that was already running when its workspace switched to a container stays on the host until it closes.',\n ),\n level: 'info',\n };\n }\n}\n"],"mappings":";;AAKA,IAAa,iCAAb,MAA+E;CAM1D;CALnB;;CAGA,YACE,UACA,aAAyE,MAAM,aAAa,cAAc,QAAQ,GAClH;EADiB,KAAA,YAAA;EAEjB,KAAK,WAAW;CAClB;CAEA,MAAM,UAA2C;EAC/C,MAAM,IAAI,KAAK;EACf,OAAO;GACL,SACE,KAAK,UAAU,cAAc,OACzB,EACE,4BACA,+EACF,IACA,EACE,uBACA,kLACF;GACN,OAAO;EACT;CACF;AACF"}
@@ -0,0 +1,27 @@
1
+ let _agimon_ai_po_core_locale = require("@agimon-ai/po-core/locale");
2
+ //#region src/services/extensionService/index.ts
3
+ var DefaultSandboxExtensionService = class {
4
+ translate;
5
+ identity;
6
+ /** `identity` is the server's `po/sandbox-identity`; a host server binds none. */
7
+ constructor(identity, translate = (_key, fallback) => (0, _agimon_ai_po_core_locale.formatMessage)(fallback)) {
8
+ this.translate = translate;
9
+ this.identity = identity;
10
+ }
11
+ async execute() {
12
+ const t = this.translate;
13
+ return {
14
+ message: this.identity?.contained === true ? t("sandbox.notice.contained", "Sandboxed session: the agent, extensions, and tools run inside the container.") : t("sandbox.notice.host", "Host session: the agent, extensions, and tools run on the host. A session that was already running when its workspace switched to a container stays on the host until it closes."),
15
+ level: "info"
16
+ };
17
+ }
18
+ };
19
+ //#endregion
20
+ Object.defineProperty(exports, "DefaultSandboxExtensionService", {
21
+ enumerable: true,
22
+ get: function() {
23
+ return DefaultSandboxExtensionService;
24
+ }
25
+ });
26
+
27
+ //# sourceMappingURL=extensionService-DKROEZa0.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"extensionService-DKROEZa0.cjs","names":["formatMessage"],"sources":["../src/services/extensionService/index.ts"],"sourcesContent":["import { formatMessage } from '@agimon-ai/po-core/locale';\nimport type { PoSandboxIdentity } from '@agimon-ai/po-core/sandboxIdentity';\n\nimport type { SandboxExtensionResult, SandboxExtensionService } from '../../types/extension';\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(\n identity: PoSandboxIdentity | undefined,\n private readonly translate: (key: string, fallback: string) => string = (_key, fallback) => formatMessage(fallback),\n ) {\n this.identity = identity;\n }\n\n async execute(): Promise<SandboxExtensionResult> {\n const t = this.translate;\n return {\n message:\n this.identity?.contained === true\n ? t(\n 'sandbox.notice.contained',\n 'Sandboxed session: the agent, extensions, and tools run inside the container.',\n )\n : t(\n 'sandbox.notice.host',\n 'Host session: the agent, extensions, and tools run on the host. A session that was already running when its workspace switched to a container stays on the host until it closes.',\n ),\n level: 'info',\n };\n }\n}\n"],"mappings":";;AAKA,IAAa,iCAAb,MAA+E;CAM1D;CALnB;;CAGA,YACE,UACA,aAAyE,MAAM,cAAA,GAAaA,0BAAAA,cAAAA,CAAc,QAAQ,GAClH;EADiB,KAAA,YAAA;EAEjB,KAAK,WAAW;CAClB;CAEA,MAAM,UAA2C;EAC/C,MAAM,IAAI,KAAK;EACf,OAAO;GACL,SACE,KAAK,UAAU,cAAc,OACzB,EACE,4BACA,+EACF,IACA,EACE,uBACA,kLACF;GACN,OAAO;EACT;CACF;AACF"}
@@ -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 _agimon_ai_po_core_serverFacet = require("@agimon-ai/po-core/serverFacet");
7
- //#region src/extensions/workspaces/sessions/(backend)/skill/po-use-sandbox.mcp.ts
8
- var po_use_sandbox_mcp_default = (0, _agimon_ai_po_core_mcpFacet.defineMcpSkill)({
9
- name: "po-use-sandbox",
10
- description: "Use @agimon-ai/po-sandbox: Container sandbox for Po launches: the agent, extensions, and tools run inside Docker or Podman while the terminal stays on the host",
11
- read: () => (0, _agimon_ai_po_core_serverFacet.readPackageResource)(require("url").pathToFileURL(__filename).href, "src/prompts/po-use-sandbox/SKILL.md")
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: "Set up workspace sandbox containers: check Docker and the runtime bundle, switch a workspace on, verify where a session runs, and troubleshoot failures.",
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(po_use_sandbox_mcp_default, context)];
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","skillPoUseSandbox"],"sources":["../../src/extensions/workspaces/sessions/(backend)/skill/po-use-sandbox.mcp.ts","../../generated/mcp.ts"],"sourcesContent":["import { defineMcpSkill } from '@agimon-ai/po-core/mcpFacet';\nimport { readPackageResource } from '@agimon-ai/po-core/serverFacet';\n\nexport default defineMcpSkill({\n name: 'po-use-sandbox',\n description:\n 'Use @agimon-ai/po-sandbox: Container sandbox for Po launches: the agent, extensions, and tools run inside Docker or Podman while the terminal stays on the host',\n read: () => readPackageResource(import.meta.url, 'src/prompts/po-use-sandbox/SKILL.md'),\n});\n","// Generated by @agimon-ai/po-build. Do not edit by hand.\nimport { defineMcpPlugin, type DoomMcpSessionPlugin } from '@agimon-ai/po-core/mcpFacet';\n\nimport skillPoUseSandbox from '../src/extensions/workspaces/sessions/(backend)/skill/po-use-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(): DoomMcpSessionPlugin['skills'] { return [at(skillPoUseSandbox, context)]; },\n }) satisfies DoomMcpSessionPlugin,\n});\n\nexport default mcp;\n"],"mappings":";;;;;;;AAGA,IAAA,8BAAA,GAAeA,4BAAAA,eAAAA,CAAe;CAC5B,MAAM;CACN,aACE;CACF,aAAA,GAAYC,+BAAAA,oBAAAA,CAAAA,QAAAA,KAAAA,CAAAA,CAAAA,cAAAA,UAAAA,CAAAA,CAAAA,MAAqC,qCAAqC;AACxF,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,SAAyC;EAAE,OAAO,CAAC,GAAGC,4BAAmB,OAAO,CAAC;CAAG,EAC1F;AACF,CAAC"}
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 'Set up workspace sandbox containers: check Docker and the runtime bundle, switch a workspace on, verify where a session runs, and troubleshoot failures.',\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"}
@@ -1,5 +1,5 @@
1
1
  //#region generated/mcp.d.ts
2
- export declare const mcp: import("@agimon-ai/po-core/mcpFacet").DoomMcpPluginDefinition;
2
+ export declare const mcp: import("@agimon-ai/po-core/mcpFacet").PoMcpPluginDefinition;
3
3
  //#endregion
4
4
  export { mcp as default };
5
5
  //# sourceMappingURL=mcp.d.mts.map
@@ -1,10 +1,10 @@
1
1
  import { defineMcpPlugin, defineMcpSkill } from "@agimon-ai/po-core/mcpFacet";
2
- import { readPackageResource } from "@agimon-ai/po-core/serverFacet";
3
- //#region src/extensions/workspaces/sessions/(backend)/skill/po-use-sandbox.mcp.ts
4
- var po_use_sandbox_mcp_default = defineMcpSkill({
5
- name: "po-use-sandbox",
6
- description: "Use @agimon-ai/po-sandbox: Container sandbox for Po launches: the agent, extensions, and tools run inside Docker or Podman while the terminal stays on the host",
7
- read: () => readPackageResource(import.meta.url, "src/prompts/po-use-sandbox/SKILL.md")
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: "Set up workspace sandbox containers: check Docker and the runtime bundle, switch a workspace on, verify where a session runs, and troubleshoot failures.",
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(po_use_sandbox_mcp_default, context)];
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":["skillPoUseSandbox"],"sources":["../../src/extensions/workspaces/sessions/(backend)/skill/po-use-sandbox.mcp.ts","../../generated/mcp.ts"],"sourcesContent":["import { defineMcpSkill } from '@agimon-ai/po-core/mcpFacet';\nimport { readPackageResource } from '@agimon-ai/po-core/serverFacet';\n\nexport default defineMcpSkill({\n name: 'po-use-sandbox',\n description:\n 'Use @agimon-ai/po-sandbox: Container sandbox for Po launches: the agent, extensions, and tools run inside Docker or Podman while the terminal stays on the host',\n read: () => readPackageResource(import.meta.url, 'src/prompts/po-use-sandbox/SKILL.md'),\n});\n","// Generated by @agimon-ai/po-build. Do not edit by hand.\nimport { defineMcpPlugin, type DoomMcpSessionPlugin } from '@agimon-ai/po-core/mcpFacet';\n\nimport skillPoUseSandbox from '../src/extensions/workspaces/sessions/(backend)/skill/po-use-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(): DoomMcpSessionPlugin['skills'] { return [at(skillPoUseSandbox, context)]; },\n }) satisfies DoomMcpSessionPlugin,\n});\n\nexport default mcp;\n"],"mappings":";;;AAGA,IAAA,6BAAe,eAAe;CAC5B,MAAM;CACN,aACE;CACF,YAAY,oBAAoB,YAAY,KAAK,qCAAqC;AACxF,CAAC;;;ACFD,MAAM,MAAY,OAA0B,YAC1C,OAAO,UAAU,aAAc,MAAwB,OAAO,IAAI;AAEpE,MAAa,MAAM,gBAAgB;CACjC,MAAM;CACN,UAAU,aAAa,EACrB,IAAI,SAAyC;EAAE,OAAO,CAAC,GAAGA,4BAAmB,OAAO,CAAC;CAAG,EAC1F;AACF,CAAC"}
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 'Set up workspace sandbox containers: check Docker and the runtime bundle, switch a workspace on, verify where a session runs, and troubleshoot failures.',\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"}