mirror of
https://github.com/badlogic/pi-mono.git
synced 2026-11-05 23:37:25 +00:00
A sandbox is a new env type (`type: "gondolin"`): a long-lived Gondolin micro-VM on an SSH environment, with listed host folders and an HTTP(S) host allowlist. The worker reaches it over SSH to the host, where p2's launcher (plugins/envs/sandbox: native, or Docker when the host's Node/QEMU are too old) runs pi-env's daemon inside the VM, so tools, workspace, terminals, uploads and MCP work unchanged. Names outside the allowlist are refused before the host resolves them. Conversations working in a sandbox cannot leave it: location tools, subagent spawn/configure, AgentLocations.move, the terminal tool, and one-shot agents (which now inherit their caller's own location) all keep them there; only the owner's Relocate moves a session out, after a confirmation. conversationConfinement() exposes it to plugins. Owner-only management in the Envs sheet: sandboxes listed under their host, host test reports sandbox support, create/edit/start/stop/restart/test, lock icons in the top bar and sidebar. Tests in test/p2/sandboxes.test.ts (real VM cases with P2_TEST_GONDOLIN=1) and ui-sandboxes.test.ts; docs in docs/remote-envs.md.
27 lines
748 B
TypeScript
27 lines
748 B
TypeScript
import { contribute, defineFacet } from "@p2/app/v1";
|
|
import { closeLayers, openLayer, Slots, useOwner, useSheet } from "@p2/app/v1/web";
|
|
import { EnvsPanel } from "./EnvsPanel.tsx";
|
|
import "./style.css";
|
|
|
|
function EnvsButton() {
|
|
const sheet = useSheet("envs");
|
|
if (!useOwner()) return null;
|
|
return (
|
|
<>
|
|
<button
|
|
className="foot-button"
|
|
type="button"
|
|
onClick={() => openLayer({ kind: "sheet", name: "envs" }, { fromDrawer: true })}
|
|
title="Remote environments"
|
|
>
|
|
Envs
|
|
</button>
|
|
{sheet && <EnvsPanel env={sheet.locator} onClose={closeLayers} />}
|
|
</>
|
|
);
|
|
}
|
|
export default defineFacet((host) => {
|
|
contribute(host, "p2.web-envs", (self) => {
|
|
self.contribute(Slots, { "sidebar-foot:envs": EnvsButton });
|
|
});
|
|
});
|