spawnfile 0.1.12 → 0.1.13

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 (63) hide show
  1. package/README.md +9 -2
  2. package/dist/auth/runtimeCredentials.js +18 -2
  3. package/dist/cli/devCommands.d.ts +3 -0
  4. package/dist/cli/devCommands.js +115 -0
  5. package/dist/cli/lifecycleCommands.js +2 -0
  6. package/dist/cli/runCli.d.ts +6 -0
  7. package/dist/cli/runCli.js +4 -0
  8. package/dist/cli/statusCommand.d.ts +2 -1
  9. package/dist/cli/statusCommand.js +50 -16
  10. package/dist/compiler/buildProject.d.ts +9 -1
  11. package/dist/compiler/buildProject.js +44 -5
  12. package/dist/compiler/compileProject.d.ts +2 -0
  13. package/dist/compiler/compileProject.js +3 -1
  14. package/dist/compiler/containerArtifactsRender.js +25 -69
  15. package/dist/compiler/containerEntrypointRender.js +4 -1
  16. package/dist/compiler/containerPackageRender.d.ts +15 -0
  17. package/dist/compiler/containerPackageRender.js +63 -0
  18. package/dist/compiler/containerTargetResources.js +3 -1
  19. package/dist/compiler/moltnetArtifacts.js +16 -1
  20. package/dist/compiler/moltnetBinaries.d.ts +4 -1
  21. package/dist/compiler/moltnetBinaries.js +24 -3
  22. package/dist/compiler/moltnetClientConfig.js +11 -0
  23. package/dist/compiler/moltnetRuntimeConfig.js +11 -0
  24. package/dist/compiler/runProject.js +7 -1
  25. package/dist/compiler/runProjectDocker.js +157 -12
  26. package/dist/compiler/upProject.js +1 -0
  27. package/dist/deployment/dockerRecover.d.ts +17 -0
  28. package/dist/deployment/dockerRecover.js +129 -0
  29. package/dist/deployment/index.d.ts +1 -0
  30. package/dist/deployment/index.js +1 -0
  31. package/dist/dev/activity.d.ts +14 -0
  32. package/dist/dev/activity.js +48 -0
  33. package/dist/dev/docker.d.ts +16 -0
  34. package/dist/dev/docker.js +71 -0
  35. package/dist/dev/index.d.ts +2 -0
  36. package/dist/dev/index.js +2 -0
  37. package/dist/dev/project.d.ts +35 -0
  38. package/dist/dev/project.js +164 -0
  39. package/dist/runtime/common.d.ts +2 -0
  40. package/dist/runtime/common.js +1 -1
  41. package/dist/runtime/container.d.ts +1 -0
  42. package/dist/runtime/container.js +93 -10
  43. package/dist/runtime/install.d.ts +1 -1
  44. package/dist/runtime/install.js +43 -1
  45. package/dist/runtime/pi/adapter.d.ts +4 -0
  46. package/dist/runtime/pi/adapter.js +198 -0
  47. package/dist/runtime/pi/appActivitySource.d.ts +1 -0
  48. package/dist/runtime/pi/appActivitySource.js +87 -0
  49. package/dist/runtime/pi/appCoreSource.d.ts +1 -0
  50. package/dist/runtime/pi/appCoreSource.js +354 -0
  51. package/dist/runtime/pi/appPreludeSource.d.ts +1 -0
  52. package/dist/runtime/pi/appPreludeSource.js +103 -0
  53. package/dist/runtime/pi/appSource.d.ts +1 -0
  54. package/dist/runtime/pi/appSource.js +8 -0
  55. package/dist/runtime/pi/appTemplate.d.ts +28 -0
  56. package/dist/runtime/pi/appTemplate.js +144 -0
  57. package/dist/runtime/pi/runAuth.d.ts +2 -0
  58. package/dist/runtime/pi/runAuth.js +68 -0
  59. package/dist/runtime/registry.js +3 -0
  60. package/dist/runtime/types.d.ts +1 -0
  61. package/dist/status/deployments.js +5 -12
  62. package/package.json +7 -2
  63. package/runtimes.yaml +27 -11
@@ -0,0 +1,68 @@
1
+ import path from "node:path";
2
+ import { chmod } from "node:fs/promises";
3
+ import { loadImportedClaudeCodeCredential, loadImportedCodexCredential } from "../../auth/index.js";
4
+ import { ensureDirectory, writeUtf8File } from "../../filesystem/index.js";
5
+ const createMountArgs = (hostPath, containerPath) => [
6
+ "-v",
7
+ `${hostPath}:${containerPath}`
8
+ ];
9
+ const writeJsonFile = async (tempRoot, relativePath, value) => {
10
+ const hostPath = path.join(tempRoot, relativePath);
11
+ const hostDirectory = path.dirname(hostPath);
12
+ await ensureDirectory(hostDirectory);
13
+ await writeUtf8File(hostPath, `${JSON.stringify(value, null, 2)}\n`);
14
+ await chmod(hostDirectory, 0o700);
15
+ // Docker bind mounts preserve host file mode; the generated image runs as
16
+ // the non-root `spawnfile` user, so the mounted auth file must be readable
17
+ // by a UID that usually differs from the host owner.
18
+ await chmod(hostPath, 0o644);
19
+ return hostPath;
20
+ };
21
+ const collectCoveredSecrets = (instanceSecrets, enabled, secretName) => enabled && instanceSecrets.includes(secretName) ? [secretName] : [];
22
+ export const preparePiRuntimeAuth = async (input) => {
23
+ if (!input.instance.home_path) {
24
+ return { coveredModelSecrets: [], mountArgs: [] };
25
+ }
26
+ const codex = input.authProfile.imports.codex
27
+ ? await loadImportedCodexCredential(input.authProfile.imports.codex.path)
28
+ : null;
29
+ const claudeCode = input.authProfile.imports["claude-code"]
30
+ ? await loadImportedClaudeCodeCredential(input.authProfile.imports["claude-code"].path)
31
+ : null;
32
+ const useCodex = input.instance.model_auth_methods.openai === "codex" && codex;
33
+ const useClaudeCode = input.instance.model_auth_methods.anthropic === "claude-code" && claudeCode;
34
+ if (!useCodex && !useClaudeCode) {
35
+ return { coveredModelSecrets: [], mountArgs: [] };
36
+ }
37
+ const authProfiles = {};
38
+ if (useCodex) {
39
+ authProfiles["openai-codex"] = {
40
+ access: codex.access,
41
+ ...(codex.accountId ? { accountId: codex.accountId } : {}),
42
+ expires: codex.expires,
43
+ refresh: codex.refresh,
44
+ type: "oauth"
45
+ };
46
+ }
47
+ if (useClaudeCode) {
48
+ authProfiles.anthropic = claudeCode.type === "oauth" && claudeCode.refresh
49
+ ? {
50
+ access: claudeCode.access,
51
+ expires: claudeCode.expires,
52
+ refresh: claudeCode.refresh,
53
+ type: "oauth"
54
+ }
55
+ : {
56
+ key: claudeCode.access,
57
+ type: "api_key"
58
+ };
59
+ }
60
+ const authPath = await writeJsonFile(input.tempRoot, path.join("runtime-auth", "pi", input.instance.id, "auth.json"), authProfiles);
61
+ return {
62
+ coveredModelSecrets: [
63
+ ...collectCoveredSecrets(input.instance.model_secrets_required, Boolean(useCodex), "OPENAI_API_KEY"),
64
+ ...collectCoveredSecrets(input.instance.model_secrets_required, Boolean(useClaudeCode), "ANTHROPIC_API_KEY")
65
+ ],
66
+ mountArgs: createMountArgs(authPath, path.posix.join(input.instance.home_path, ".pi", "agent", "auth.json"))
67
+ };
68
+ };
@@ -3,9 +3,12 @@ import { parse as parseYaml } from "yaml";
3
3
  import { z } from "zod";
4
4
  import { SpawnfileError } from "../shared/index.js";
5
5
  import { openClawAdapter } from "./openclaw/adapter.js";
6
+ import { daimonAdapter, piAdapter } from "./pi/adapter.js";
6
7
  import { picoClawAdapter } from "./picoclaw/adapter.js";
7
8
  const runtimeAdapters = new Map([
9
+ [daimonAdapter.name, daimonAdapter],
8
10
  [openClawAdapter.name, openClawAdapter],
11
+ [piAdapter.name, piAdapter],
9
12
  [picoClawAdapter.name, picoClawAdapter]
10
13
  ]);
11
14
  const runtimeInstallSchema = z.discriminatedUnion("kind", [
@@ -59,6 +59,7 @@ export interface RuntimeContainerMeta {
59
59
  port?: number;
60
60
  portStride?: number;
61
61
  portEnv?: string;
62
+ postRootfsCommands?: string[];
62
63
  standaloneBaseImage: string;
63
64
  startCommand: string[];
64
65
  staticEnv?: Record<string, string>;
@@ -68,24 +68,17 @@ export const createDeploymentSummaries = (records, inspections = new Map()) => r
68
68
  }));
69
69
  export const createDeploymentObservations = (deployments, options) => {
70
70
  const observations = [];
71
- if (deployments.length === 0 && options.liveRequested && !options.recover) {
71
+ if (deployments.length === 0 && options.liveRequested) {
72
72
  observations.push(createObservation({
73
- key: "deployment.record",
74
- message: `No deployment records found under ${options.outputDirectory}`,
73
+ key: options.recover ? "deployment.recover" : "deployment.record",
74
+ message: options.recover
75
+ ? `No recoverable deployment labels found for ${options.outputDirectory}`
76
+ : `No deployment records found under ${options.outputDirectory}`,
75
77
  severity: "warn",
76
78
  source: "deployment",
77
79
  subject: "deployment"
78
80
  }));
79
81
  }
80
- if (options.recover) {
81
- observations.push(createObservation({
82
- key: "deployment.recover",
83
- message: "Label recovery is not implemented yet; use record-backed status for live checks",
84
- severity: "unknown",
85
- source: "deployment",
86
- subject: "deployment"
87
- }));
88
- }
89
82
  for (const deployment of deployments) {
90
83
  observations.push(createObservation({
91
84
  key: "deployment.record",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "spawnfile",
3
- "version": "0.1.12",
3
+ "version": "0.1.13",
4
4
  "description": "Canonical source compiler for autonomous agents and teams.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -25,6 +25,10 @@
25
25
  "release:patch": "npm version patch && npm publish",
26
26
  "release:minor": "npm version minor && npm publish",
27
27
  "release:major": "npm version major && npm publish",
28
+ "runtime:images": "npm run runtime:openclaw-image && npm run runtime:picoclaw-image",
29
+ "runtime:openclaw-image": "docker build -f runtime-images/openclaw/Dockerfile -t noopolis/spawnfile-runtime-openclaw:2026.6.8-local runtime-images/openclaw",
30
+ "runtime:pi-base": "./scripts/build-pi-runtime-base.sh",
31
+ "runtime:picoclaw-image": "docker build -f runtime-images/picoclaw/Dockerfile -t noopolis/spawnfile-runtime-picoclaw:0.2.9-local runtime-images/picoclaw",
28
32
  "runtimes": "./scripts/runtimes.sh",
29
33
  "runtimes:sync": "./scripts/runtimes.sh && ./scripts/blueprints.sh",
30
34
  "test:e2e:docker-auth": "tsx src/e2e/cli.ts",
@@ -33,7 +37,8 @@
33
37
  "test": "vitest run",
34
38
  "typecheck": "tsc --project tsconfig.json --noEmit",
35
39
  "test:e2e:distribution-image": "tsx src/e2e/cli.ts distribution-image",
36
- "test:e2e:distribution-roundtrip": "tsx src/e2e/cli.ts distribution-roundtrip"
40
+ "test:e2e:distribution-roundtrip": "tsx src/e2e/cli.ts distribution-roundtrip",
41
+ "test:e2e:pi-harness-org": "tsx src/e2e/cli.ts pi-harness-org"
37
42
  },
38
43
  "dependencies": {
39
44
  "commander": "^14.0.1",
package/runtimes.yaml CHANGED
@@ -14,14 +14,24 @@
14
14
  # pinned refs.
15
15
 
16
16
  runtimes:
17
+ daimon:
18
+ remote: git@github.com:noopolis/daimon.git
19
+ ref: v0.1.0
20
+ default_branch: main
21
+ install:
22
+ kind: container_image
23
+ image: noopolis/spawnfile-runtime-daimon
24
+ tag: 0.1.0
25
+ status: active
26
+
17
27
  openclaw:
18
28
  remote: git@github.com:openclaw/openclaw.git
19
- ref: v2026.6.5
29
+ ref: v2026.6.8
20
30
  default_branch: main
21
31
  install:
22
- kind: npm
23
- package: openclaw
24
- version: 2026.6.5
32
+ kind: container_image
33
+ image: noopolis/spawnfile-runtime-openclaw
34
+ tag: 2026.6.8
25
35
  status: active
26
36
 
27
37
  picoclaw:
@@ -29,13 +39,19 @@ runtimes:
29
39
  ref: v0.2.9
30
40
  default_branch: main
31
41
  install:
32
- kind: github_release_archive
33
- repository: sipeed/picoclaw
34
- tag: v0.2.9
35
- binary: picoclaw
36
- assets:
37
- linux_amd64: picoclaw_Linux_x86_64.tar.gz
38
- linux_arm64: picoclaw_Linux_arm64.tar.gz
42
+ kind: container_image
43
+ image: noopolis/spawnfile-runtime-picoclaw
44
+ tag: 0.2.9
45
+ status: active
46
+
47
+ pi:
48
+ remote: git@github.com:earendil-works/pi.git
49
+ ref: v0.79.9
50
+ default_branch: main
51
+ install:
52
+ kind: npm
53
+ package: "@earendil-works/pi-coding-agent"
54
+ version: 0.79.9
39
55
  status: active
40
56
 
41
57
  hermes-agent: