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.
- package/README.md +9 -2
- package/dist/auth/runtimeCredentials.js +18 -2
- package/dist/cli/devCommands.d.ts +3 -0
- package/dist/cli/devCommands.js +115 -0
- package/dist/cli/lifecycleCommands.js +2 -0
- package/dist/cli/runCli.d.ts +6 -0
- package/dist/cli/runCli.js +4 -0
- package/dist/cli/statusCommand.d.ts +2 -1
- package/dist/cli/statusCommand.js +50 -16
- package/dist/compiler/buildProject.d.ts +9 -1
- package/dist/compiler/buildProject.js +44 -5
- package/dist/compiler/compileProject.d.ts +2 -0
- package/dist/compiler/compileProject.js +3 -1
- package/dist/compiler/containerArtifactsRender.js +25 -69
- package/dist/compiler/containerEntrypointRender.js +4 -1
- package/dist/compiler/containerPackageRender.d.ts +15 -0
- package/dist/compiler/containerPackageRender.js +63 -0
- package/dist/compiler/containerTargetResources.js +3 -1
- package/dist/compiler/moltnetArtifacts.js +16 -1
- package/dist/compiler/moltnetBinaries.d.ts +4 -1
- package/dist/compiler/moltnetBinaries.js +24 -3
- package/dist/compiler/moltnetClientConfig.js +11 -0
- package/dist/compiler/moltnetRuntimeConfig.js +11 -0
- package/dist/compiler/runProject.js +7 -1
- package/dist/compiler/runProjectDocker.js +157 -12
- package/dist/compiler/upProject.js +1 -0
- package/dist/deployment/dockerRecover.d.ts +17 -0
- package/dist/deployment/dockerRecover.js +129 -0
- package/dist/deployment/index.d.ts +1 -0
- package/dist/deployment/index.js +1 -0
- package/dist/dev/activity.d.ts +14 -0
- package/dist/dev/activity.js +48 -0
- package/dist/dev/docker.d.ts +16 -0
- package/dist/dev/docker.js +71 -0
- package/dist/dev/index.d.ts +2 -0
- package/dist/dev/index.js +2 -0
- package/dist/dev/project.d.ts +35 -0
- package/dist/dev/project.js +164 -0
- package/dist/runtime/common.d.ts +2 -0
- package/dist/runtime/common.js +1 -1
- package/dist/runtime/container.d.ts +1 -0
- package/dist/runtime/container.js +93 -10
- package/dist/runtime/install.d.ts +1 -1
- package/dist/runtime/install.js +43 -1
- package/dist/runtime/pi/adapter.d.ts +4 -0
- package/dist/runtime/pi/adapter.js +198 -0
- package/dist/runtime/pi/appActivitySource.d.ts +1 -0
- package/dist/runtime/pi/appActivitySource.js +87 -0
- package/dist/runtime/pi/appCoreSource.d.ts +1 -0
- package/dist/runtime/pi/appCoreSource.js +354 -0
- package/dist/runtime/pi/appPreludeSource.d.ts +1 -0
- package/dist/runtime/pi/appPreludeSource.js +103 -0
- package/dist/runtime/pi/appSource.d.ts +1 -0
- package/dist/runtime/pi/appSource.js +8 -0
- package/dist/runtime/pi/appTemplate.d.ts +28 -0
- package/dist/runtime/pi/appTemplate.js +144 -0
- package/dist/runtime/pi/runAuth.d.ts +2 -0
- package/dist/runtime/pi/runAuth.js +68 -0
- package/dist/runtime/registry.js +3 -0
- package/dist/runtime/types.d.ts +1 -0
- package/dist/status/deployments.js +5 -12
- package/package.json +7 -2
- 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
|
+
};
|
package/dist/runtime/registry.js
CHANGED
|
@@ -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", [
|
package/dist/runtime/types.d.ts
CHANGED
|
@@ -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
|
|
71
|
+
if (deployments.length === 0 && options.liveRequested) {
|
|
72
72
|
observations.push(createObservation({
|
|
73
|
-
key: "deployment.record",
|
|
74
|
-
message:
|
|
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.
|
|
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.
|
|
29
|
+
ref: v2026.6.8
|
|
20
30
|
default_branch: main
|
|
21
31
|
install:
|
|
22
|
-
kind:
|
|
23
|
-
|
|
24
|
-
|
|
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:
|
|
33
|
-
|
|
34
|
-
tag:
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
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:
|