@jigging/jig 0.1.0-alpha.1 → 0.1.0-alpha.11

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.
@@ -241,16 +241,14 @@ function bubblewrapArguments(configuration) {
241
241
  "--unshare-all",
242
242
  ...configuration.network === "inherited" ? ["--share-net"] : [],
243
243
  "--unshare-user",
244
- "--disable-userns",
245
- "--assert-userns-disabled",
244
+ ...configuration.nestedUserNamespaces ? [] : ["--disable-userns", "--assert-userns-disabled"],
246
245
  "--as-pid-1",
247
246
  "--die-with-parent",
248
247
  "--new-session",
249
248
  "--clearenv",
250
249
  "--proc",
251
250
  "/proc",
252
- "--remount-ro",
253
- "/proc",
251
+ ...configuration.nestedUserNamespaces ? [] : ["--remount-ro", "/proc"],
254
252
  "--dev",
255
253
  "/dev",
256
254
  "--tmpfs",
@@ -367,6 +365,7 @@ function requireStart(value) {
367
365
  "environment",
368
366
  "limits",
369
367
  "mechanismDigest",
368
+ "nestedUserNamespaces",
370
369
  "network",
371
370
  "ownerDigest",
372
371
  "ownerStateAllocationDigest",
@@ -379,7 +378,7 @@ function requireStart(value) {
379
378
  "sealedPlanDigest",
380
379
  "supervisorPath"
381
380
  ];
382
- if (configuration === null || typeof configuration !== "object" || Array.isArray(configuration) || Object.keys(configuration).sort().join("\x00") !== keys.sort().join("\x00") || !absolute(configuration.delegatedCgroup) || !absolute(configuration.bunHostLibraryPath) || !absolute(configuration.runCgroup) || posix.dirname(configuration.runCgroup) !== configuration.delegatedCgroup || !/^jig-run-[a-z0-9][a-z0-9-]{0,47}-[0-9a-f]{24}$/.test(posix.basename(configuration.runCgroup)) || !configuration.runCgroup.startsWith("/sys/fs/cgroup/") || !absolute(configuration.ownerStateDirectory) || !absolute(configuration.bunPath) || !absolute(configuration.bubblewrapPath) || !absolute(configuration.supervisorPath) || typeof configuration.mechanismDigest !== "string" || !DIGEST.test(configuration.mechanismDigest) || typeof configuration.ownerDigest !== "string" || !DIGEST.test(configuration.ownerDigest) || typeof configuration.sealedPlanDigest !== "string" || !DIGEST.test(configuration.sealedPlanDigest) || typeof configuration.ownerStateAllocationDigest !== "string" || !DIGEST.test(configuration.ownerStateAllocationDigest) || typeof configuration.ownerToken !== "string" || !OWNER_TOKEN.test(configuration.ownerToken) || configuration.network !== "isolated" && configuration.network !== "inherited" || !positiveInteger(configuration.payloadUid) || !positiveInteger(configuration.payloadGid) || !validLimits(configuration.limits) || !validMounts(configuration.readOnlyMounts) || !validEnvironment(configuration.environment) || !Array.isArray(configuration.command) || configuration.command.length === 0 || !absolute(configuration.command[0]) || configuration.command.some((part) => typeof part !== "string" || part.includes("\x00"))) {
381
+ if (configuration === null || typeof configuration !== "object" || Array.isArray(configuration) || Object.keys(configuration).sort().join("\x00") !== keys.sort().join("\x00") || !absolute(configuration.delegatedCgroup) || !absolute(configuration.bunHostLibraryPath) || !absolute(configuration.runCgroup) || posix.dirname(configuration.runCgroup) !== configuration.delegatedCgroup || !/^jig-run-[a-z0-9][a-z0-9-]{0,47}-[0-9a-f]{24}$/.test(posix.basename(configuration.runCgroup)) || !configuration.runCgroup.startsWith("/sys/fs/cgroup/") || !absolute(configuration.ownerStateDirectory) || !absolute(configuration.bunPath) || !absolute(configuration.bubblewrapPath) || !absolute(configuration.supervisorPath) || typeof configuration.mechanismDigest !== "string" || !DIGEST.test(configuration.mechanismDigest) || typeof configuration.ownerDigest !== "string" || !DIGEST.test(configuration.ownerDigest) || typeof configuration.sealedPlanDigest !== "string" || !DIGEST.test(configuration.sealedPlanDigest) || typeof configuration.ownerStateAllocationDigest !== "string" || !DIGEST.test(configuration.ownerStateAllocationDigest) || typeof configuration.ownerToken !== "string" || !OWNER_TOKEN.test(configuration.ownerToken) || configuration.network !== "isolated" && configuration.network !== "inherited" || typeof configuration.nestedUserNamespaces !== "boolean" || !positiveInteger(configuration.payloadUid) || !positiveInteger(configuration.payloadGid) || !validLimits(configuration.limits) || !validMounts(configuration.readOnlyMounts) || !validEnvironment(configuration.environment) || !Array.isArray(configuration.command) || configuration.command.length === 0 || !absolute(configuration.command[0]) || configuration.command.some((part) => typeof part !== "string" || part.includes("\x00"))) {
383
382
  throw new Error("invalid rootless supervisor configuration");
384
383
  }
385
384
  return configuration;
@@ -21,12 +21,47 @@ function requirePrivateBunLockPolicy(value) {
21
21
  if (lock?.lockfileVersion !== 1 || workspaces === undefined || rootWorkspace === undefined || packages === undefined || Object.keys(workspaces).length !== 1 || lock.patchedDependencies !== undefined) {
22
22
  throw new TypeError("unsupported Bun lock source");
23
23
  }
24
+ requireRegistryDependencyMaps(rootWorkspace);
24
25
  for (const resolution of Object.values(packages)) {
25
- if (!Array.isArray(resolution) || resolution.length !== 4 || !isExactRegistryResolution(resolution[0]) || typeof resolution[1] !== "string" || resolution[1] !== "" && resolution[1] !== "https://registry.npmjs.org" && resolution[1] !== "https://registry.npmjs.org/" || ordinaryRecord(resolution[2]) === undefined || !isExactIntegrity(resolution[3])) {
26
+ const metadata = Array.isArray(resolution) ? ordinaryRecord(resolution[2]) : undefined;
27
+ if (!Array.isArray(resolution) || resolution.length !== 4 || !isExactRegistryResolution(resolution[0]) || typeof resolution[1] !== "string" || resolution[1] !== "" && resolution[1] !== "https://registry.npmjs.org" && resolution[1] !== "https://registry.npmjs.org/" || metadata === undefined || !isExactIntegrity(resolution[3])) {
26
28
  throw new TypeError("unsupported Bun lock source");
27
29
  }
30
+ requireRegistryDependencyMaps(metadata);
28
31
  }
29
32
  }
33
+ var DEPENDENCY_MAPS = Object.freeze([
34
+ "dependencies",
35
+ "devDependencies",
36
+ "optionalDependencies",
37
+ "peerDependencies"
38
+ ]);
39
+ function requireRegistryDependencyMaps(container) {
40
+ for (const field of DEPENDENCY_MAPS) {
41
+ if (container[field] === undefined)
42
+ continue;
43
+ const dependencies = ordinaryRecord(container[field]);
44
+ if (dependencies === undefined)
45
+ throw new TypeError("unsupported Bun lock source");
46
+ for (const [name, request] of Object.entries(dependencies)) {
47
+ if (!isPackageName(name) || !isRegistryRequest(request)) {
48
+ throw new TypeError("unsupported Bun lock source");
49
+ }
50
+ }
51
+ }
52
+ }
53
+ function isRegistryRequest(value) {
54
+ if (typeof value !== "string" || Buffer.byteLength(value) > 512)
55
+ return false;
56
+ if (!value.startsWith("npm:"))
57
+ return isRegistrySelector(value);
58
+ const target = value.slice(4);
59
+ const separator = target.lastIndexOf("@");
60
+ return separator > 0 && isPackageName(target.slice(0, separator)) && isRegistrySelector(target.slice(separator + 1));
61
+ }
62
+ function isRegistrySelector(value) {
63
+ return value.length > 0 && /^[0-9A-Za-z._+*<>=~^| -]+$/.test(value);
64
+ }
30
65
  function isExactRegistryResolution(value) {
31
66
  if (typeof value !== "string")
32
67
  return false;
@@ -35,8 +70,11 @@ function isExactRegistryResolution(value) {
35
70
  return false;
36
71
  const name = value.slice(0, separator);
37
72
  const version = value.slice(separator + 1);
38
- const packageName = name.startsWith("@") ? /^@[a-z0-9][a-z0-9._~-]*\/[a-z0-9][a-z0-9._~-]*$/.test(name) : /^[a-z0-9][a-z0-9._~-]*$/.test(name);
39
- return packageName && Buffer.byteLength(name) <= 214 && /^(?:0|[1-9]\d*)\.(?:0|[1-9]\d*)\.(?:0|[1-9]\d*)(?:-[0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*)?(?:\+[0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*)?$/.test(version);
73
+ return isPackageName(name) && /^(?:0|[1-9]\d*)\.(?:0|[1-9]\d*)\.(?:0|[1-9]\d*)(?:-[0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*)?(?:\+[0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*)?$/.test(version);
74
+ }
75
+ function isPackageName(value) {
76
+ const valid = value.startsWith("@") ? /^@[a-z0-9][a-z0-9._~-]*\/[a-z0-9][a-z0-9._~-]*$/.test(value) : /^[a-z0-9][a-z0-9._~-]*$/.test(value);
77
+ return valid && Buffer.byteLength(value) <= 214;
40
78
  }
41
79
  function isExactIntegrity(value) {
42
80
  if (typeof value !== "string")
package/package.json CHANGED
@@ -1,16 +1,16 @@
1
1
  {
2
2
  "name": "@jigging/jig",
3
- "version": "0.1.0-alpha.1",
3
+ "version": "0.1.0-alpha.11",
4
4
  "description": "A local, secure host for admitted FLOW packages",
5
5
  "license": "MPL-2.0",
6
6
  "repository": {
7
7
  "type": "git",
8
- "url": "git+https://github.com/jigmd/jig.git",
8
+ "url": "git+https://github.com/jiggy/jig.git",
9
9
  "directory": "packages/jig"
10
10
  },
11
11
  "homepage": "https://jig.md/",
12
12
  "bugs": {
13
- "url": "https://github.com/jigmd/jig/issues"
13
+ "url": "https://github.com/jiggy/jig/issues"
14
14
  },
15
15
  "os": [
16
16
  "linux"
@@ -48,6 +48,19 @@
48
48
  "libexec/evaluator/project-evaluator-worker.js",
49
49
  "libexec/evaluator/project-evaluator-sdk.bundle.js",
50
50
  "libexec/evaluator/project-authoring-1.schema.json",
51
+ "libexec/agent/openai-agent-worker.js",
52
+ "libexec/agent/openai.LICENSE",
53
+ "libexec/agent/codex-agent-launcher.js",
54
+ "libexec/agent/codex-acp.js",
55
+ "libexec/agent/codex-acp.LICENSE",
56
+ "libexec/agent/codex-requirements.toml",
57
+ "libexec/agent/claude-agent-launcher.js",
58
+ "libexec/agent/claude-agent-acp.js",
59
+ "libexec/agent/claude-agent-acp.LICENSE",
60
+ "libexec/agent/claude-agent-sdk.LICENSE",
61
+ "libexec/agent/pi-agent-launcher.js",
62
+ "libexec/agent/pi-acp.js",
63
+ "libexec/agent/pi-acp.LICENSE",
51
64
  "libexec/preparation/bun-native-preparation-worker.js",
52
65
  "README.md",
53
66
  "LICENSE",
@@ -55,20 +68,26 @@
55
68
  ],
56
69
  "scripts": {
57
70
  "verify:build-bun": "bun -e \"if (Bun.version !== '1.3.3' || Bun.revision !== '274e01c737e85f8142070a9745b43a2ba09fce4c') throw new Error('Jig must be built with exact Bun 1.3.3 revision 274e01c737e85f8142070a9745b43a2ba09fce4c')\"",
58
- "build": "bun run verify:build-bun && bun run clean && mkdir -p bin libexec/evaluator libexec/preparation && cp scripts/installed-jig.sh bin/jig && chmod 755 bin/jig && bun node_modules/typescript/bin/tsc -p tsconfig.json && bun build src/index.ts --target=bun --format=esm --outfile=dist/index.js && bun build src/installed-cli.ts --target=bun --format=esm --outfile=libexec/installed-cli.js && bun build src/internal/linux-rootless-supervisor.ts --target=bun --format=esm --outfile=libexec/linux-rootless-supervisor.js && bun build src/internal/project-evaluator-worker.ts --target=bun --format=esm --outfile=libexec/evaluator/project-evaluator-worker.js && bun build src/internal/bun-native-preparation-worker.ts --target=bun --format=esm --outfile=libexec/preparation/bun-native-preparation-worker.js && bun build src/project/evaluator-sdk-entry.ts --target=bun --format=esm --outfile=libexec/evaluator/project-evaluator-sdk.bundle.js && cp ../../docs/jig/spec/machine/project-authoring-1.schema.json libexec/evaluator/project-authoring-1.schema.json",
71
+ "build": "bun run verify:build-bun && bun run clean && mkdir -p bin libexec/agent libexec/evaluator libexec/preparation && cp scripts/installed-jig.sh bin/jig && chmod 755 bin/jig && bun node_modules/typescript/bin/tsc -p tsconfig.json && bun build src/index.ts --target=bun --format=esm --outfile=dist/index.js && bun build src/installed-cli.ts --target=bun --format=esm --outfile=libexec/installed-cli.js && bun build src/internal/linux-rootless-supervisor.ts --target=bun --format=esm --outfile=libexec/linux-rootless-supervisor.js && bun build src/internal/project-evaluator-worker.ts --target=bun --format=esm --outfile=libexec/evaluator/project-evaluator-worker.js && bun build src/internal/openai-agent-worker.ts --target=bun --format=esm --outfile=libexec/agent/openai-agent-worker.js && bun build src/internal/codex-agent-launcher.ts --target=bun --format=esm --outfile=libexec/agent/codex-agent-launcher.js && cp node_modules/@agentclientprotocol/codex-acp/dist/index.js libexec/agent/codex-acp.js && cp node_modules/@agentclientprotocol/codex-acp/LICENSE libexec/agent/codex-acp.LICENSE && cp support/codex-requirements.toml libexec/agent/codex-requirements.toml && bun build src/internal/claude-agent-launcher.ts --target=bun --format=esm --outfile=libexec/agent/claude-agent-launcher.js && bun build node_modules/@agentclientprotocol/claude-agent-acp/dist/index.js --target=bun --format=esm --outfile=libexec/agent/claude-agent-acp.js && cp node_modules/@agentclientprotocol/claude-agent-acp/LICENSE libexec/agent/claude-agent-acp.LICENSE && cp node_modules/@anthropic-ai/claude-agent-sdk/LICENSE.md libexec/agent/claude-agent-sdk.LICENSE && bun build src/internal/pi-agent-launcher.ts --target=bun --format=esm --outfile=libexec/agent/pi-agent-launcher.js && bun build node_modules/pi-acp/dist/index.js --target=bun --format=esm --outfile=libexec/agent/pi-acp.js && cp node_modules/pi-acp/LICENSE libexec/agent/pi-acp.LICENSE && bun build src/internal/bun-native-preparation-worker.ts --target=bun --format=esm --outfile=libexec/preparation/bun-native-preparation-worker.js && bun build src/project/evaluator-sdk-entry.ts --target=bun --format=esm --outfile=libexec/evaluator/project-evaluator-sdk.bundle.js && cp ../../docs/jig/spec/machine/project-authoring-1.schema.json libexec/evaluator/project-authoring-1.schema.json && cp node_modules/openai/LICENSE libexec/agent/openai.LICENSE",
59
72
  "clean": "bun -e \"import { rm } from 'node:fs/promises'; for (const path of ['dist', 'bin', 'libexec']) await rm(path, { recursive: true, force: true })\"",
60
73
  "prepack": "bun run build",
61
74
  "test": "bun test",
62
75
  "test:package": "bun run build && bun test/package-smoke.ts",
63
- "test:linux-rootless:proof-host": "bun run build && JIG_LINUX_ROOTLESS_HOSTILE=1 bun test test/linux-rootless-delegation-hostile.test.ts --timeout 30000 && JIG_LINUX_ROOTLESS_HOSTILE=1 bun test test/linux-rootless-run.test.ts --timeout 30000 && JIG_LINUX_ROOTLESS_HOSTILE=1 bun test test/bun-native-preparation.test.ts --timeout 120000 && JIG_LINUX_ROOTLESS_HOSTILE=1 bun test test/private-foreground.test.ts --timeout 30000",
76
+ "test:linux-rootless:proof-host": "bun run build && JIG_LINUX_ROOTLESS_HOSTILE=1 bun test test/linux-rootless-delegation-hostile.test.ts --timeout 30000 && JIG_LINUX_ROOTLESS_HOSTILE=1 bun test test/linux-rootless-run.test.ts --timeout 30000 && JIG_LINUX_ROOTLESS_HOSTILE=1 bun test test/bun-native-preparation.test.ts --timeout 120000 && JIG_LINUX_ROOTLESS_HOSTILE=1 bun test test/private-foreground.test.ts --timeout 30000 && JIG_LINUX_ROOTLESS_HOSTILE=1 bun test test/root-agent-run-lifecycle.test.ts --timeout 180000",
64
77
  "check": "bun run build && bun test"
65
78
  },
66
79
  "dependencies": {
67
80
  "@oven/bun-linux-x64-baseline": "1.3.3"
68
81
  },
69
82
  "devDependencies": {
83
+ "@agentclientprotocol/claude-agent-acp": "0.73.0",
84
+ "@agentclientprotocol/codex-acp": "1.8.0",
85
+ "@agentclientprotocol/sdk": "1.4.0",
70
86
  "@types/node": "24.13.3",
87
+ "openai": "7.9.0",
88
+ "pi-acp": "0.0.33",
71
89
  "typescript": "7.0.2",
72
- "yaml": "2.9.0"
90
+ "yaml": "2.9.0",
91
+ "zod": "4.3.6"
73
92
  }
74
93
  }