@slopus/happy-agent-supervisor 0.0.9 → 0.0.10-darwin-x64

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/README.md CHANGED
@@ -24,22 +24,28 @@ matching executable lives.
24
24
 
25
25
  ## Where it runs
26
26
 
27
- | Platform | Architecture | Rust target | Enforcement |
28
- | -------- | ------------ | ---------------------------- | ----------------------------------------------------- |
29
- | macOS | arm64 | `aarch64-apple-darwin` | Seatbelt profile installed in-process |
30
- | macOS | x64 | `x86_64-apple-darwin` | Seatbelt profile installed in-process |
31
- | Linux | arm64 | `aarch64-unknown-linux-musl` | namespaces, mount policy, seccomp, capability removal |
32
- | Linux | x64 | `x86_64-unknown-linux-musl` | namespaces, mount policy, seccomp, capability removal |
27
+ | Platform | Architecture | Rust target | Enforcement |
28
+ | ---------- | ------------ | ---------------------------- | ------------------------------------------------------- |
29
+ | macOS | arm64 | `aarch64-apple-darwin` | Seatbelt profile installed in-process |
30
+ | macOS | x64 | `x86_64-apple-darwin` | Seatbelt profile installed in-process |
31
+ | Linux | arm64 | `aarch64-unknown-linux-musl` | namespaces, mount policy, seccomp, capability removal |
32
+ | Linux | x64 | `x86_64-unknown-linux-musl` | namespaces, mount policy, seccomp, capability removal |
33
+ | Windows 11 | x64 | `x86_64-pc-windows-gnu` | Codex restricted tokens, Happy accounts, ACLs, firewall |
33
34
 
34
35
  The Linux binaries are static musl builds, so they run on any distribution and
35
36
  can be mounted read-only into a container that has no toolchain of its own.
36
- A local Windows 11 x64 adapter is under validation. It builds a pinned Codex native sandbox
37
+ The Windows 11 x64 adapter builds a pinned Codex native sandbox
37
38
  with separate Happy OS identities; see `native/windows/source.json` and the license notices there.
38
39
  Run `pnpm build:native:windows` with the specified Rust toolchain installed. Set
39
40
  `HAPPY_CODEX_SOURCE_DIR` to reuse a checkout of the exact pinned commit. Building does not
40
41
  provision the sandbox. First execution requires one-time native setup; host allowlist proxy
41
42
  and independent listener policies currently fail closed until their Windows implementation
42
- is complete. This local validation build is not a published Windows release.
43
+ is complete. The matching Windows supervisor and helpers are published starting with `0.0.9`.
44
+
45
+ Windows retains Codex's native restricted-token model. A folder granting write access to
46
+ `Everyone` can satisfy that token's write check even outside the selected writable roots.
47
+ This release does not include Codex TUI's additional world-writable-folder audit; use normal
48
+ per-user project directories. Broader filesystem hardening is deferred.
43
49
 
44
50
  ## Install
45
51
 
@@ -205,6 +211,49 @@ would be enforcing the list. A host list with egress disabled is already enforce
205
211
  by the isolated network namespace. No TLS is terminated anywhere, so the boundary
206
212
  is which host may be reached rather than what is sent to it.
207
213
 
214
+ ## Strict workspace services
215
+
216
+ The optional `service` policy selects a separate mandatory boundary. It currently requires
217
+ Linux with working user/mount/PID/network namespaces and a delegated cgroup v2 parent with
218
+ `memory` and `pids` enabled. The daemon must already run inside that delegation (normally in
219
+ a sibling leaf cgroup). Startup never changes service privileges, host cgroup delegation,
220
+ AppArmor, or global sysctls. macOS and Windows service launches fail closed; their ordinary
221
+ shell behavior is unchanged.
222
+
223
+ The trusted controller supplies an empty private root, explicit read-only input mounts,
224
+ private scratch paths, an execution identity, resource limits, and a private bridge socket.
225
+ `controllerPid` must identify the direct launching process. Before creating runtime resources,
226
+ the supervisor records its PID and kernel start time in `process.json` beside the bridge.
227
+ Recovery must check that identity as well as cgroup emptiness; an absent cgroup alone does not
228
+ prove that a supervisor still setting up its sandbox has exited.
229
+ Pass service policies through a controller-owned, mode-0600 `--policy-file` beneath the
230
+ daemon's protected private storage, not through command-line JSON: process listings must
231
+ not reveal the bridge credential. The controller owns that file's lifecycle too.
232
+ The service sees a fixed system runtime, selected files below `/workspace`, a private home,
233
+ and private temporary storage. It receives a clean environment. Pathname Unix sockets are
234
+ blocked even if a socket is subsequently inserted into an input directory. Overlapping
235
+ scratch paths need an existing mount point inside the read-only input; no host directory is
236
+ created for that purpose.
237
+
238
+ Service IPC is namespaced too. The service syscall boundary prevents creating replacement
239
+ namespaces, remounting resource controls, or using io_uring to bypass socket restrictions.
240
+ Unix socketpairs are unavailable as well, since reconnectable datagram pairs would bypass
241
+ pathname-socket denial. Commands that require Unix-socket IPC need a different runtime design;
242
+ service startup never relaxes this boundary automatically. Pipes and inherited stdin/stdout work.
243
+
244
+ The controller authenticates to the bridge using the execution's 64-byte hex token. The
245
+ bridge returns one byte (`1` for a connected endpoint, `0` for an unreachable endpoint),
246
+ then relays with bounded buffers to the single declared loopback port. This is private native
247
+ transport, not the HTTP API: the daemon additionally enforces API authorization and HTTP-only
248
+ forwarding. Never expose the socket, token, or native policy to page JavaScript or tool results.
249
+ Outbound service grants match exact hostname/port pairs and never permit private IPs.
250
+
251
+ The workload enters its cgroup before executing. Its descendants remain subject to the same
252
+ memory/process limits, including detached children. The supervisor follows its owner's death;
253
+ namespace-init death kills the workload tree. Normal completion checks that the cgroup is empty
254
+ before removing it. After abrupt supervisor death, the controller must independently confirm
255
+ the retained cgroup is empty and all runtime handles are closed before deleting workspace files.
256
+
208
257
  ## Process hardening
209
258
 
210
259
  The supervisor runs as the same user as the workload and holds the workload's
package/SHA256SUMS ADDED
@@ -0,0 +1 @@
1
+ cdc9e327552ec8b3b8f9bda5a1a66126a365cea3828b6a1112fd2ceacf8af2e1 vendor/x86_64-apple-darwin/bin/happy-agent-supervisor
package/package.json CHANGED
@@ -1,46 +1,33 @@
1
1
  {
2
2
  "name": "@slopus/happy-agent-supervisor",
3
- "version": "0.0.9",
4
- "description": "Trusted native sandbox boundary for Happy agent workloads.",
5
- "keywords": [
6
- "sandbox",
7
- "seatbelt",
8
- "seccomp",
9
- "supervisor"
10
- ],
3
+ "version": "0.0.10-darwin-x64",
4
+ "description": "Trusted native sandbox boundary for Happy agent workloads. Native binary for darwin-x64.",
11
5
  "license": "MIT",
12
6
  "repository": {
13
7
  "type": "git",
14
8
  "url": "git+https://github.com/slopus/happy-agent.git",
15
9
  "directory": "packages/happy-agent-supervisor"
16
10
  },
11
+ "engines": {
12
+ "node": ">=22.19.0"
13
+ },
14
+ "os": [
15
+ "darwin"
16
+ ],
17
+ "cpu": [
18
+ "x64"
19
+ ],
20
+ "bin": {
21
+ "happy-agent-supervisor": "vendor/x86_64-apple-darwin/bin/happy-agent-supervisor"
22
+ },
17
23
  "files": [
18
- "dist",
24
+ "vendor",
25
+ "SHA256SUMS",
19
26
  "LICENSE",
20
27
  "README.md"
21
28
  ],
22
- "type": "module",
23
- "exports": {
24
- ".": {
25
- "types": "./dist/index.d.ts",
26
- "import": "./dist/index.js",
27
- "default": "./dist/index.js"
28
- }
29
- },
30
29
  "publishConfig": {
31
- "access": "public"
32
- },
33
- "dependencies": {
34
- "@sinclair/typebox": "^0.34.49"
35
- },
36
- "engines": {
37
- "node": ">=22.19.0"
38
- },
39
- "optionalDependencies": {
40
- "@slopus/happy-agent-supervisor-win32-x64": "npm:@slopus/happy-agent-supervisor@0.0.9-win32-x64",
41
- "@slopus/happy-agent-supervisor-darwin-arm64": "npm:@slopus/happy-agent-supervisor@0.0.9-darwin-arm64",
42
- "@slopus/happy-agent-supervisor-darwin-x64": "npm:@slopus/happy-agent-supervisor@0.0.9-darwin-x64",
43
- "@slopus/happy-agent-supervisor-linux-arm64": "npm:@slopus/happy-agent-supervisor@0.0.9-linux-arm64",
44
- "@slopus/happy-agent-supervisor-linux-x64": "npm:@slopus/happy-agent-supervisor@0.0.9-linux-x64"
30
+ "access": "public",
31
+ "tag": "platform"
45
32
  }
46
33
  }
@@ -1,55 +0,0 @@
1
- import { type Static } from "@sinclair/typebox";
2
- export declare const supervisorPermissionModeSchema: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"read_only">, import("@sinclair/typebox").TLiteral<"workspace_write">, import("@sinclair/typebox").TLiteral<"auto">, import("@sinclair/typebox").TLiteral<"full_access">]>;
3
- export type SupervisorPermissionMode = Static<typeof supervisorPermissionModeSchema>;
4
- export declare const supervisorProxyFrontEndSchema: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"http">, import("@sinclair/typebox").TLiteral<"socks5">]>;
5
- export type SupervisorProxyFrontEnd = Static<typeof supervisorProxyFrontEndSchema>;
6
- /**
7
- * The front-ends to expose inside the sandbox.
8
- *
9
- * The supervisor provides the proxy itself. It forks an egress process before the sandbox exists
10
- * and joins the two with a socketpair, so nothing inside the sandbox reaches the proxy — or
11
- * anything else — by address, and the caller supplies neither a descriptor nor a token. Which hosts
12
- * that egress process may reach comes from `network.allowedHosts`.
13
- */
14
- export declare const supervisorOutgoingProxySchema: import("@sinclair/typebox").TObject<{
15
- frontEnds: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"http">, import("@sinclair/typebox").TLiteral<"socks5">]>>;
16
- }>;
17
- export type SupervisorOutgoingProxy = Static<typeof supervisorOutgoingProxySchema>;
18
- export declare const supervisorNetworkPolicySchema: import("@sinclair/typebox").TObject<{
19
- egress: import("@sinclair/typebox").TBoolean;
20
- allowedHosts: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString>>;
21
- localBinding: import("@sinclair/typebox").TBoolean;
22
- outgoingProxy: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TObject<{
23
- frontEnds: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"http">, import("@sinclair/typebox").TLiteral<"socks5">]>>;
24
- }>>;
25
- }>;
26
- export type SupervisorNetworkPolicy = Static<typeof supervisorNetworkPolicySchema>;
27
- /**
28
- * The native supervisor's input. Its names intentionally match ComputePermissions one-for-one.
29
- *
30
- * The working directory is the workspace root for `workspace_write` and `auto`; keeping it out of
31
- * the document prevents two sources of truth for the process cwd. A non-empty `allowedHosts`
32
- * requires `network.outgoingProxy`, because the host list is enforced in the egress process the
33
- * proxy creates, and without a proxy there would be nothing enforcing it. Each entry names one host
34
- * or one `*.suffix`; a bare `*` is refused, and open egress is expressed by configuring no proxy.
35
- */
36
- export declare const supervisorPolicySchema: import("@sinclair/typebox").TObject<{
37
- mode: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"read_only">, import("@sinclair/typebox").TLiteral<"workspace_write">, import("@sinclair/typebox").TLiteral<"auto">, import("@sinclair/typebox").TLiteral<"full_access">]>;
38
- allowedReadPaths: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString>>;
39
- deniedReadPaths: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString>>;
40
- allowedWritePaths: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString>>;
41
- deniedWritePaths: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString>>;
42
- /** Windows placeholder type for protected project files that may be absent. */
43
- deniedWriteFilePaths: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString>>;
44
- network: import("@sinclair/typebox").TObject<{
45
- egress: import("@sinclair/typebox").TBoolean;
46
- allowedHosts: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString>>;
47
- localBinding: import("@sinclair/typebox").TBoolean;
48
- outgoingProxy: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TObject<{
49
- frontEnds: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"http">, import("@sinclair/typebox").TLiteral<"socks5">]>>;
50
- }>>;
51
- }>;
52
- }>;
53
- export type SupervisorPolicy = Static<typeof supervisorPolicySchema>;
54
- export declare function parseSupervisorPolicy(value: unknown): SupervisorPolicy;
55
- //# sourceMappingURL=SupervisorPolicy.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"SupervisorPolicy.d.ts","sourceRoot":"","sources":["../sources/SupervisorPolicy.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,MAAM,EAAQ,MAAM,mBAAmB,CAAC;AAGtD,eAAO,MAAM,8BAA8B,qPAKzC,CAAC;AAEH,MAAM,MAAM,wBAAwB,GAAG,MAAM,CAAC,OAAO,8BAA8B,CAAC,CAAC;AAErF,eAAO,MAAM,6BAA6B,oIAGxC,CAAC;AAEH,MAAM,MAAM,uBAAuB,GAAG,MAAM,CAAC,OAAO,6BAA6B,CAAC,CAAC;AAEnF;;;;;;;GAOG;AACH,eAAO,MAAM,6BAA6B;;EAKzC,CAAC;AAEF,MAAM,MAAM,uBAAuB,GAAG,MAAM,CAAC,OAAO,6BAA6B,CAAC,CAAC;AAEnF,eAAO,MAAM,6BAA6B;;;;;;;EAQzC,CAAC;AAEF,MAAM,MAAM,uBAAuB,GAAG,MAAM,CAAC,OAAO,6BAA6B,CAAC,CAAC;AAEnF;;;;;;;;GAQG;AACH,eAAO,MAAM,sBAAsB;;;;;;IAO3B,+EAA+E;;;;;;;;;;EAKtF,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG,MAAM,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAErE,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,OAAO,GAAG,gBAAgB,CAQtE"}
@@ -1,58 +0,0 @@
1
- import { Type } from "@sinclair/typebox";
2
- import { Value } from "@sinclair/typebox/value";
3
- export const supervisorPermissionModeSchema = Type.Union([
4
- Type.Literal("read_only"),
5
- Type.Literal("workspace_write"),
6
- Type.Literal("auto"),
7
- Type.Literal("full_access"),
8
- ]);
9
- export const supervisorProxyFrontEndSchema = Type.Union([
10
- Type.Literal("http"),
11
- Type.Literal("socks5"),
12
- ]);
13
- /**
14
- * The front-ends to expose inside the sandbox.
15
- *
16
- * The supervisor provides the proxy itself. It forks an egress process before the sandbox exists
17
- * and joins the two with a socketpair, so nothing inside the sandbox reaches the proxy — or
18
- * anything else — by address, and the caller supplies neither a descriptor nor a token. Which hosts
19
- * that egress process may reach comes from `network.allowedHosts`.
20
- */
21
- export const supervisorOutgoingProxySchema = Type.Object({
22
- frontEnds: Type.Array(supervisorProxyFrontEndSchema, { minItems: 1 }),
23
- }, { additionalProperties: false });
24
- export const supervisorNetworkPolicySchema = Type.Object({
25
- egress: Type.Boolean(),
26
- allowedHosts: Type.Optional(Type.Array(Type.String())),
27
- localBinding: Type.Boolean(),
28
- outgoingProxy: Type.Optional(supervisorOutgoingProxySchema),
29
- }, { additionalProperties: false });
30
- /**
31
- * The native supervisor's input. Its names intentionally match ComputePermissions one-for-one.
32
- *
33
- * The working directory is the workspace root for `workspace_write` and `auto`; keeping it out of
34
- * the document prevents two sources of truth for the process cwd. A non-empty `allowedHosts`
35
- * requires `network.outgoingProxy`, because the host list is enforced in the egress process the
36
- * proxy creates, and without a proxy there would be nothing enforcing it. Each entry names one host
37
- * or one `*.suffix`; a bare `*` is refused, and open egress is expressed by configuring no proxy.
38
- */
39
- export const supervisorPolicySchema = Type.Object({
40
- mode: supervisorPermissionModeSchema,
41
- allowedReadPaths: Type.Optional(Type.Array(Type.String())),
42
- deniedReadPaths: Type.Optional(Type.Array(Type.String())),
43
- allowedWritePaths: Type.Optional(Type.Array(Type.String())),
44
- deniedWritePaths: Type.Optional(Type.Array(Type.String())),
45
- /** Windows placeholder type for protected project files that may be absent. */
46
- deniedWriteFilePaths: Type.Optional(Type.Array(Type.String())),
47
- network: supervisorNetworkPolicySchema,
48
- }, { additionalProperties: false });
49
- export function parseSupervisorPolicy(value) {
50
- if (!Value.Check(supervisorPolicySchema, value)) {
51
- const details = [...Value.Errors(supervisorPolicySchema, value)]
52
- .map((error) => `${error.path || "/"} ${error.message}`)
53
- .join("; ");
54
- throw new Error(`Invalid supervisor policy: ${details}`);
55
- }
56
- return Value.Parse(supervisorPolicySchema, value);
57
- }
58
- //# sourceMappingURL=SupervisorPolicy.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"SupervisorPolicy.js","sourceRoot":"","sources":["../sources/SupervisorPolicy.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,IAAI,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,EAAE,KAAK,EAAE,MAAM,yBAA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CAAC;IAC1D,eAAe,EAAE,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC,CAAC;IACzD,iBAAiB,EAAE,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC,CAAC;IAC3D,gBAAgB,EAAE,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC,CAAC;IAC1D,+EAA+E;IAC/E,oBAAoB,EAAE,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC,CAAC;IAC9D,OAAO,EAAE,6BAA6B;CACzC,EACD,EAAE,oBAAoB,EAAE,KAAK,EAAE,CAClC,CAAC;AAIF,MAAM,UAAU,qBAAqB,CAAC,KAAc;IAChD,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,sBAAsB,EAAE,KAAK,CAAC,EAAE,CAAC;QAC9C,MAAM,OAAO,GAAG,CAAC,GAAG,KAAK,CAAC,MAAM,CAAC,sBAAsB,EAAE,KAAK,CAAC,CAAC;aAC3D,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,GAAG,KAAK,CAAC,IAAI,IAAI,GAAG,IAAI,KAAK,CAAC,OAAO,EAAE,CAAC;aACvD,IAAI,CAAC,IAAI,CAAC,CAAC;QAChB,MAAM,IAAI,KAAK,CAAC,8BAA8B,OAAO,EAAE,CAAC,CAAC;IAC7D,CAAC;IACD,OAAO,KAAK,CAAC,KAAK,CAAC,sBAAsB,EAAE,KAAK,CAAC,CAAC;AACtD,CAAC"}
@@ -1,3 +0,0 @@
1
- import { type PlatformKey } from "../platform.js";
2
- export declare function resolveBinaryForTarget(key: PlatformKey, binaryPath?: string): string;
3
- //# sourceMappingURL=resolveBinaryForTarget.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"resolveBinaryForTarget.d.ts","sourceRoot":"","sources":["../../sources/impl/resolveBinaryForTarget.ts"],"names":[],"mappings":"AAKA,OAAO,EAAoB,KAAK,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAIpE,wBAAgB,sBAAsB,CAAC,GAAG,EAAE,WAAW,EAAE,UAAU,CAAC,EAAE,MAAM,GAAG,MAAM,CAwCpF"}
@@ -1,39 +0,0 @@
1
- import { existsSync } from "node:fs";
2
- import { createRequire } from "node:module";
3
- import path from "node:path";
4
- import { fileURLToPath } from "node:url";
5
- import { PLATFORM_TARGETS } from "../platform.js";
6
- const require = createRequire(import.meta.url);
7
- export function resolveBinaryForTarget(key, binaryPath) {
8
- if (binaryPath !== undefined) {
9
- const explicit = path.resolve(binaryPath);
10
- if (!existsSync(explicit)) {
11
- throw new Error(`Happy agent supervisor binary does not exist: ${explicit}`);
12
- }
13
- return explicit;
14
- }
15
- const platform = PLATFORM_TARGETS[key];
16
- const executable = platform.os === "win32" ? "happy-agent-supervisor.exe" : "happy-agent-supervisor";
17
- try {
18
- const manifest = require.resolve(`${platform.alias}/package.json`);
19
- const installed = path.join(path.dirname(manifest), "vendor", platform.target, "bin", executable);
20
- if (existsSync(installed))
21
- return installed;
22
- }
23
- catch {
24
- // Fall through to repository-local native build locations.
25
- }
26
- const packageRoot = fileURLToPath(new URL("../../", import.meta.url));
27
- const localCandidates = [
28
- path.join(packageRoot, "native", "target", platform.target, "release", executable),
29
- path.join(packageRoot, "native", "target", platform.target, "debug", executable),
30
- path.join(packageRoot, "native", "target", "release", executable),
31
- path.join(packageRoot, "native", "target", "debug", executable),
32
- ];
33
- const local = localCandidates.find((candidate) => existsSync(candidate));
34
- if (local !== undefined)
35
- return local;
36
- throw new Error(`The optional binary package ${platform.alias} is missing. Reinstall ` +
37
- "@slopus/happy-agent-supervisor or build the matching native target.");
38
- }
39
- //# sourceMappingURL=resolveBinaryForTarget.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"resolveBinaryForTarget.js","sourceRoot":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IAC/D,CAAC;IAED,MAAM,WAAW,GAAG,aAAa,CAAC,IAAI,GAAG,CAAC,QAAQ,EAAE,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;IACtE,MAAM,eAAe,GAAG;QACpB,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,CAAC,MAAM,EAAE,SAAS,EAAE,UAAU,CAAC;QAClF,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,CAAC,MAAM,EAAE,OAAO,EAAE,UAAU,CAAC;QAChF,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,QAAQ,EAAE,QAAQ,EAAE,SAAS,EAAE,UAAU,CAAC;QACjE,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,QAAQ,EAAE,QAAQ,EAAE,OAAO,EAAE,UAAU,CAAC;KAClE,CAAC;IACF,MAAM,KAAK,GAAG,eAAe,CAAC,IAAI,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC,CAAC;IACzE,IAAI,KAAK,KAAK,SAAS;QAAE,OAAO,KAAK,CAAC;IAEtC,MAAM,IAAI,KAAK,CACX,+BAA+B,QAAQ,CAAC,KAAK,yBAAyB;QAClE,qEAAqE,CAC5E,CAAC;AACN,CAAC"}
package/dist/index.d.ts DELETED
@@ -1,5 +0,0 @@
1
- export { parseSupervisorPolicy, supervisorNetworkPolicySchema, supervisorPermissionModeSchema, supervisorPolicySchema, type SupervisorNetworkPolicy, type SupervisorPermissionMode, type SupervisorPolicy, } from "./SupervisorPolicy.js";
2
- export { linuxSupervisorArchitectureSchema, type LinuxSupervisorArchitecture } from "./platform.js";
3
- export { resolveLinuxSupervisorBinary } from "./resolveLinuxSupervisorBinary.js";
4
- export { resolveSupervisorBinary } from "./resolveSupervisorBinary.js";
5
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../sources/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,qBAAqB,EACrB,6BAA6B,EAC7B,8BAA8B,EAC9B,sBAAsB,EACtB,KAAK,uBAAuB,EAC5B,KAAK,wBAAwB,EAC7B,KAAK,gBAAgB,GACxB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,iCAAiC,EAAE,KAAK,2BAA2B,EAAE,MAAM,eAAe,CAAC;AACpG,OAAO,EAAE,4BAA4B,EAAE,MAAM,mCAAmC,CAAC;AACjF,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC"}
package/dist/index.js DELETED
@@ -1,5 +0,0 @@
1
- export { parseSupervisorPolicy, supervisorNetworkPolicySchema, supervisorPermissionModeSchema, supervisorPolicySchema, } from "./SupervisorPolicy.js";
2
- export { linuxSupervisorArchitectureSchema } from "./platform.js";
3
- export { resolveLinuxSupervisorBinary } from "./resolveLinuxSupervisorBinary.js";
4
- export { resolveSupervisorBinary } from "./resolveSupervisorBinary.js";
5
- //# sourceMappingURL=index.js.map
package/dist/index.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../sources/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,qBAAqB,EACrB,6BAA6B,EAC7B,8BAA8B,EAC9B,sBAAsB,GAIzB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,iCAAiC,EAAoC,MAAM,eAAe,CAAC;AACpG,OAAO,EAAE,4BAA4B,EAAE,MAAM,mCAAmC,CAAC;AACjF,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC"}
@@ -1,43 +0,0 @@
1
- import { type Static } from "@sinclair/typebox";
2
- export declare const PLATFORM_TARGETS: {
3
- readonly "win32-x64": {
4
- readonly alias: "@slopus/happy-agent-supervisor-win32-x64";
5
- readonly arch: "x64";
6
- readonly os: "win32";
7
- readonly tag: "win32-x64";
8
- readonly target: "x86_64-pc-windows-gnu";
9
- };
10
- readonly "darwin-arm64": {
11
- readonly alias: "@slopus/happy-agent-supervisor-darwin-arm64";
12
- readonly arch: "arm64";
13
- readonly os: "darwin";
14
- readonly tag: "darwin-arm64";
15
- readonly target: "aarch64-apple-darwin";
16
- };
17
- readonly "darwin-x64": {
18
- readonly alias: "@slopus/happy-agent-supervisor-darwin-x64";
19
- readonly arch: "x64";
20
- readonly os: "darwin";
21
- readonly tag: "darwin-x64";
22
- readonly target: "x86_64-apple-darwin";
23
- };
24
- readonly "linux-arm64": {
25
- readonly alias: "@slopus/happy-agent-supervisor-linux-arm64";
26
- readonly arch: "arm64";
27
- readonly os: "linux";
28
- readonly tag: "linux-arm64";
29
- readonly target: "aarch64-unknown-linux-musl";
30
- };
31
- readonly "linux-x64": {
32
- readonly alias: "@slopus/happy-agent-supervisor-linux-x64";
33
- readonly arch: "x64";
34
- readonly os: "linux";
35
- readonly tag: "linux-x64";
36
- readonly target: "x86_64-unknown-linux-musl";
37
- };
38
- };
39
- export type PlatformKey = keyof typeof PLATFORM_TARGETS;
40
- export declare const linuxSupervisorArchitectureSchema: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"amd64">, import("@sinclair/typebox").TLiteral<"x64">, import("@sinclair/typebox").TLiteral<"x86_64">, import("@sinclair/typebox").TLiteral<"arm64">, import("@sinclair/typebox").TLiteral<"aarch64">]>;
41
- /** Architecture spellings used by OCI, Node.js, and Rust target triples. */
42
- export type LinuxSupervisorArchitecture = Static<typeof linuxSupervisorArchitectureSchema>;
43
- //# sourceMappingURL=platform.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"platform.d.ts","sourceRoot":"","sources":["../sources/platform.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,MAAM,EAAQ,MAAM,mBAAmB,CAAC;AAEtD,eAAO,MAAM,gBAAgB;aACzB,WAAW;iBACP,KAAK,EAAE,0CAA0C;iBACjD,IAAI,EAAE,KAAK;iBACX,EAAE,EAAE,OAAO;iBACX,GAAG,EAAE,WAAW;iBAChB,MAAM,EAAE,uBAAuB;;aAEnC,cAAc;iBACV,KAAK,EAAE,6CAA6C;iBACpD,IAAI,EAAE,OAAO;iBACb,EAAE,EAAE,QAAQ;iBACZ,GAAG,EAAE,cAAc;iBACnB,MAAM,EAAE,sBAAsB;;aAElC,YAAY;iBACR,KAAK,EAAE,2CAA2C;iBAClD,IAAI,EAAE,KAAK;iBACX,EAAE,EAAE,QAAQ;iBACZ,GAAG,EAAE,YAAY;iBACjB,MAAM,EAAE,qBAAqB;;aAEjC,aAAa;iBACT,KAAK,EAAE,4CAA4C;iBACnD,IAAI,EAAE,OAAO;iBACb,EAAE,EAAE,OAAO;iBACX,GAAG,EAAE,aAAa;iBAClB,MAAM,EAAE,4BAA4B;;aAExC,WAAW;iBACP,KAAK,EAAE,0CAA0C;iBACjD,IAAI,EAAE,KAAK;iBACX,EAAE,EAAE,OAAO;iBACX,GAAG,EAAE,WAAW;iBAChB,MAAM,EAAE,2BAA2B;;CAEjC,CAAC;AAEX,MAAM,MAAM,WAAW,GAAG,MAAM,OAAO,gBAAgB,CAAC;AAExD,eAAO,MAAM,iCAAiC,kRAM5C,CAAC;AAEH,4EAA4E;AAC5E,MAAM,MAAM,2BAA2B,GAAG,MAAM,CAAC,OAAO,iCAAiC,CAAC,CAAC"}
package/dist/platform.js DELETED
@@ -1,46 +0,0 @@
1
- import { Type } from "@sinclair/typebox";
2
- export const PLATFORM_TARGETS = {
3
- "win32-x64": {
4
- alias: "@slopus/happy-agent-supervisor-win32-x64",
5
- arch: "x64",
6
- os: "win32",
7
- tag: "win32-x64",
8
- target: "x86_64-pc-windows-gnu",
9
- },
10
- "darwin-arm64": {
11
- alias: "@slopus/happy-agent-supervisor-darwin-arm64",
12
- arch: "arm64",
13
- os: "darwin",
14
- tag: "darwin-arm64",
15
- target: "aarch64-apple-darwin",
16
- },
17
- "darwin-x64": {
18
- alias: "@slopus/happy-agent-supervisor-darwin-x64",
19
- arch: "x64",
20
- os: "darwin",
21
- tag: "darwin-x64",
22
- target: "x86_64-apple-darwin",
23
- },
24
- "linux-arm64": {
25
- alias: "@slopus/happy-agent-supervisor-linux-arm64",
26
- arch: "arm64",
27
- os: "linux",
28
- tag: "linux-arm64",
29
- target: "aarch64-unknown-linux-musl",
30
- },
31
- "linux-x64": {
32
- alias: "@slopus/happy-agent-supervisor-linux-x64",
33
- arch: "x64",
34
- os: "linux",
35
- tag: "linux-x64",
36
- target: "x86_64-unknown-linux-musl",
37
- },
38
- };
39
- export const linuxSupervisorArchitectureSchema = Type.Union([
40
- Type.Literal("amd64"),
41
- Type.Literal("x64"),
42
- Type.Literal("x86_64"),
43
- Type.Literal("arm64"),
44
- Type.Literal("aarch64"),
45
- ]);
46
- //# sourceMappingURL=platform.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"platform.js","sourceRoot":"","sources":["../sources/platform.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,IAAI,EAAE,MAAM,mBAAmB,CAAC;AAEtD,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC5B,WAAW,EAAE;QACT,KAAK,EAAE,0CAA0C;QACjD,IAAI,EAAE,KAAK;QACX,EAAE,EAAE,OAAO;QACX,GAAG,EAAE,WAAW;QAChB,MAAM,EAAE,uBAAuB;KAClC;IACD,cAAc,EAAE;QACZ,KAAK,EAAE,6CAA6C;QACpD,IAAI,EAAE,OAAO;QACb,EAAE,EAAE,QAAQ;QACZ,GAAG,EAAE,cAAc;QACnB,MAAM,EAAE,sBAAsB;KACjC;IACD,YAAY,EAAE;QACV,KAAK,EAAE,2CAA2C;QAClD,IAAI,EAAE,KAAK;QACX,EAAE,EAAE,QAAQ;QACZ,GAAG,EAAE,YAAY;QACjB,MAAM,EAAE,qBAAqB;KAChC;IACD,aAAa,EAAE;QACX,KAAK,EAAE,4CAA4C;QACnD,IAAI,EAAE,OAAO;QACb,EAAE,EAAE,OAAO;QACX,GAAG,EAAE,aAAa;QAClB,MAAM,EAAE,4BAA4B;KACvC;IACD,WAAW,EAAE;QACT,KAAK,EAAE,0CAA0C;QACjD,IAAI,EAAE,KAAK;QACX,EAAE,EAAE,OAAO;QACX,GAAG,EAAE,WAAW;QAChB,MAAM,EAAE,2BAA2B;KACtC;CACK,CAAC;AAIX,MAAM,CAAC,MAAM,iCAAiC,GAAG,IAAI,CAAC,KAAK,CAAC;IACxD,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC;IACrB,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC;IACnB,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC;IACtB,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC;IACrB,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC;CAC1B,CAAC,CAAC"}
@@ -1,3 +0,0 @@
1
- import { type LinuxSupervisorArchitecture } from "./platform.js";
2
- export declare function resolveLinuxSupervisorBinary(architecture: LinuxSupervisorArchitecture, binaryPath?: string): string;
3
- //# sourceMappingURL=resolveLinuxSupervisorBinary.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"resolveLinuxSupervisorBinary.d.ts","sourceRoot":"","sources":["../sources/resolveLinuxSupervisorBinary.ts"],"names":[],"mappings":"AAEA,OAAO,EAEH,KAAK,2BAA2B,EAEnC,MAAM,eAAe,CAAC;AAGvB,wBAAgB,4BAA4B,CACxC,YAAY,EAAE,2BAA2B,EACzC,UAAU,CAAC,EAAE,MAAM,GACpB,MAAM,CAOR"}
@@ -1,11 +0,0 @@
1
- import { Value } from "@sinclair/typebox/value";
2
- import { linuxSupervisorArchitectureSchema, } from "./platform.js";
3
- import { resolveBinaryForTarget } from "./impl/resolveBinaryForTarget.js";
4
- export function resolveLinuxSupervisorBinary(architecture, binaryPath) {
5
- if (!Value.Check(linuxSupervisorArchitectureSchema, architecture)) {
6
- throw new Error(`Unsupported Linux supervisor architecture: ${String(architecture)}.`);
7
- }
8
- const key = architecture === "arm64" || architecture === "aarch64" ? "linux-arm64" : "linux-x64";
9
- return resolveBinaryForTarget(key, binaryPath);
10
- }
11
- //# sourceMappingURL=resolveLinuxSupervisorBinary.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"resolveLinuxSupervisorBinary.js","sourceRoot":"","sources":["../sources/resolveLinuxSupervisorBinary.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAC;AAEhD,OAAO,EACH,iCAAiC,GAGpC,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,sBAAsB,EAAE,MAAM,kCAAkC,CAAC;AAE1E,MAAM,UAAU,4BAA4B,CACxC,YAAyC,EACzC,UAAmB;IAEnB,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,iCAAiC,EAAE,YAAY,CAAC,EAAE,CAAC;QAChE,MAAM,IAAI,KAAK,CAAC,8CAA8C,MAAM,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC;IAC3F,CAAC;IACD,MAAM,GAAG,GACL,YAAY,KAAK,OAAO,IAAI,YAAY,KAAK,SAAS,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,WAAW,CAAC;IACzF,OAAO,sBAAsB,CAAC,GAAG,EAAE,UAAU,CAAC,CAAC;AACnD,CAAC"}
@@ -1,2 +0,0 @@
1
- export declare function resolveSupervisorBinary(binaryPath?: string): string;
2
- //# sourceMappingURL=resolveSupervisorBinary.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"resolveSupervisorBinary.d.ts","sourceRoot":"","sources":["../sources/resolveSupervisorBinary.ts"],"names":[],"mappings":"AAGA,wBAAgB,uBAAuB,CAAC,UAAU,CAAC,EAAE,MAAM,GAAG,MAAM,CAcnE"}
@@ -1,14 +0,0 @@
1
- import {} from "./platform.js";
2
- import { resolveBinaryForTarget } from "./impl/resolveBinaryForTarget.js";
3
- export function resolveSupervisorBinary(binaryPath) {
4
- const key = `${process.platform}-${process.arch}`;
5
- if (key !== "darwin-arm64" &&
6
- key !== "darwin-x64" &&
7
- key !== "linux-arm64" &&
8
- key !== "linux-x64" &&
9
- key !== "win32-x64") {
10
- throw new Error(`The Happy agent supervisor does not support ${process.platform} ${process.arch}.`);
11
- }
12
- return resolveBinaryForTarget(key, binaryPath);
13
- }
14
- //# sourceMappingURL=resolveSupervisorBinary.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"resolveSupervisorBinary.js","sourceRoot":"","sources":["../sources/resolveSupervisorBinary.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoB,MAAM,eAAe,CAAC;AACjD,OAAO,EAAE,sBAAsB,EAAE,MAAM,kCAAkC,CAAC;AAE1E,MAAM,UAAU,uBAAuB,CAAC,UAAmB;IACvD,MAAM,GAAG,GAAG,GAAG,OAAO,CAAC,QAAQ,IAAI,OAAO,CAAC,IAAI,EAAiB,CAAC;IACjE,IACI,GAAG,KAAK,cAAc;QACtB,GAAG,KAAK,YAAY;QACpB,GAAG,KAAK,aAAa;QACrB,GAAG,KAAK,WAAW;QACnB,GAAG,KAAK,WAAW,EACrB,CAAC;QACC,MAAM,IAAI,KAAK,CACX,+CAA+C,OAAO,CAAC,QAAQ,IAAI,OAAO,CAAC,IAAI,GAAG,CACrF,CAAC;IACN,CAAC;IACD,OAAO,sBAAsB,CAAC,GAAG,EAAE,UAAU,CAAC,CAAC;AACnD,CAAC"}