spawnfile 0.1.29 → 0.1.30
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/dist/auth/index.d.ts +1 -0
- package/dist/auth/index.js +1 -0
- package/dist/auth/trainingAuth.js +3 -0
- package/dist/auth/trainingCodexAuthority.d.ts +8 -0
- package/dist/auth/trainingCodexAuthority.js +40 -0
- package/dist/compiler/containerDaimonGrokWorkerRender.js +4 -0
- package/dist/compiler/training/container/launch.js +7 -0
- package/dist/compiler/training/execution.d.ts +3 -3
- package/dist/compiler/training/plan/contract.d.ts +7 -7
- package/dist/compiler/training/preparation/assets/package-lock.json +10 -10
- package/dist/compiler/training/repair/contract.d.ts +8 -8
- package/dist/compiler/training/rewind/contract.d.ts +16 -16
- package/dist/compiler/training/rewind/memorySchemas.d.ts +1 -1
- package/dist/compiler/training/rewind/snapshotManifest.d.ts +1 -1
- package/dist/compiler/training/subjectLease.d.ts +1 -1
- package/dist/compiler/training/subjectLease.js +11 -11
- package/dist/deployment/organizationReady.d.ts +1 -1
- package/dist/deployment/record.d.ts +5 -5
- package/dist/deployment/record.js +2 -2
- package/dist/deployment/resourceLog.d.ts +3 -3
- package/dist/deployment/resourceLog.js +4 -3
- package/dist/deployment/upReceiptTypes.d.ts +2 -2
- package/dist/distribution/consumeImage.js +4 -3
- package/dist/distribution/consumeImageDaimonContract.d.ts +432 -0
- package/dist/distribution/consumeImageDaimonContract.js +36 -0
- package/dist/distribution/consumeImageDaimonDocker.d.ts +5 -1
- package/dist/distribution/consumeImageDaimonDocker.js +10 -9
- package/dist/distribution/daimonImageContract.test-fixtures.d.ts +2 -0
- package/dist/distribution/daimonImageContract.test-fixtures.js +16 -0
- package/dist/distribution/imageRuntimeAuth.d.ts +3 -1
- package/dist/distribution/imageRuntimeAuth.js +20 -13
- package/dist/manifest/trainingDataSchemas.d.ts +2 -2
- package/dist/manifest/trainingDataSchemas.js +2 -1
- package/dist/recording/moment.d.ts +6 -6
- package/dist/recording/parse.js +2 -1
- package/dist/runtime/daimon/adapter.js +1 -1
- package/dist/runtime/daimon/config.js +5 -2
- package/dist/runtime/daimon/contract-manifest.json +1 -1
- package/dist/runtime/daimon/contract-manifest.sha256 +1 -1
- package/dist/runtime/daimon/contractManifest.d.ts +13 -3
- package/dist/runtime/daimon/contractManifest.js +29 -11
- package/dist/runtime/daimon/contractManifest.js.map +1 -1
- package/dist/runtime/daimon/contractManifestSchema.d.ts +1555 -1
- package/dist/runtime/daimon/contractManifestSchema.js +10 -1
- package/dist/runtime/daimon/contractManifestSchema.js.map +1 -1
- package/dist/runtime/daimon/engineDescriptorSchema.d.ts +44 -2
- package/dist/runtime/daimon/engineDescriptorSchema.js +4 -2
- package/dist/runtime/daimon/engineDescriptorSchema.js.map +1 -1
- package/dist/runtime/daimon/engineDescriptors.generated.d.ts +11 -3
- package/dist/runtime/daimon/engineDescriptors.generated.js +2 -2
- package/dist/runtime/daimon/engineDescriptors.generated.js.map +1 -1
- package/dist/runtime/daimon/engines.d.ts +25 -1
- package/dist/runtime/daimon/engines.js +2 -1
- package/dist/runtime/daimon/engines.js.map +1 -1
- package/dist/runtime/daimon/runAuth.d.ts +3 -2
- package/dist/runtime/daimon/runAuth.js +16 -12
- package/dist/runtime/daimon/subscriptionRealms.d.ts +9 -0
- package/dist/runtime/daimon/subscriptionRealms.js +18 -0
- package/dist/runtime/daimon/training/native/adapter.js +28 -7
- package/dist/runtime/daimon/training/native/adapter.js.map +1 -1
- package/dist/runtime/daimon/training/native/child/arguments.js +3 -2
- package/dist/runtime/daimon/training/native/child/arguments.js.map +1 -1
- package/dist/runtime/daimon/training/native/child/fixture.js +2 -0
- package/dist/runtime/daimon/training/native/child/fixture.js.map +1 -1
- package/dist/runtime/daimon/training/native/child/lifecycle.js +14 -5
- package/dist/runtime/daimon/training/native/child/lifecycle.js.map +1 -1
- package/dist/runtime/daimon/training/native/container/lifecycle.js +2 -1
- package/dist/runtime/daimon/training/native/container/lifecycle.js.map +1 -1
- package/dist/runtime/daimon/training/native/container/manifest.d.ts +2 -2
- package/dist/runtime/daimon/training/native/container/manifest.js +25 -5
- package/dist/runtime/daimon/training/native/container/manifest.js.map +1 -1
- package/dist/runtime/daimon/training/native/preparation/fixtures.js +4 -2
- package/dist/runtime/daimon/training/native/preparation/fixtures.js.map +1 -1
- package/dist/runtime/daimon/training/native/receipt/grok.d.ts +1 -1
- package/dist/runtime/daimon/training/native/receipt/index.d.ts +1 -0
- package/dist/runtime/daimon/training/native/receipt/index.js +1 -0
- package/dist/runtime/daimon/training/native/receipt/index.js.map +1 -1
- package/dist/runtime/daimon/training/native/receipt/sandbox.d.ts +1 -1
- package/dist/runtime/daimon/training/native/receipt/schema.d.ts +8 -4
- package/dist/runtime/daimon/training/native/receipt/schema.js +1 -1
- package/dist/runtime/daimon/training/native/receipt/schema.js.map +1 -1
- package/dist/runtime/daimon/training/native/receipt/subscription.d.ts +13 -0
- package/dist/runtime/daimon/training/native/receipt/subscription.js +13 -0
- package/dist/runtime/daimon/training/native/receipt/subscription.js.map +1 -0
- package/dist/runtime/daimon/training/native/test-fixtures.js +6 -2
- package/dist/runtime/daimon/training/native/test-fixtures.js.map +1 -1
- package/dist/runtime/daimon/training/native/worker/public.d.ts +12 -0
- package/dist/runtime/daimon/training/native/worker/public.js.map +1 -1
- package/dist/runtime/daimon/training/native/worker/sandbox.js +4 -2
- package/dist/runtime/daimon/training/native/worker/sandbox.js.map +1 -1
- package/dist/runtime/daimon/training/native/worker/worker.js +4 -2
- package/dist/runtime/daimon/training/native/worker/worker.js.map +1 -1
- package/dist/runtime/daimon/training/services/account-lease.d.ts +7 -0
- package/dist/runtime/daimon/training/services/account-lease.js +76 -0
- package/dist/runtime/daimon/training/services/account-lease.js.map +1 -0
- package/dist/runtime/daimon/training/services/index.d.ts +1 -0
- package/dist/runtime/daimon/training/services/index.js +1 -0
- package/dist/runtime/daimon/training/services/index.js.map +1 -1
- package/dist/shared/trainingLegacy/index.d.ts +1 -0
- package/dist/shared/trainingLegacy/index.js +1 -0
- package/dist/shared/trainingLegacy/index.js.map +1 -1
- package/dist/shared/trainingLegacy/trainingLegacyDateTime.d.ts +5 -0
- package/dist/shared/trainingLegacy/trainingLegacyDateTime.js +7 -0
- package/dist/shared/trainingLegacy/trainingLegacyDateTime.js.map +1 -0
- package/dist/shared/trainingLegacy/trainingLegacyWire.d.ts +1 -1
- package/dist/training/cli/grader/atomic/files.d.ts +3 -3
- package/dist/training/cli/spawnfile/moments.d.ts +2 -2
- package/dist/training/cli/spawnfile/moments.js +2 -1
- package/dist/training/cli/spawnfile/moments.js.map +1 -1
- package/dist/training/experiments/repair/receipt.d.ts +1 -1
- package/dist/training/experiments/replay/schema.d.ts +1 -1
- package/dist/training/graders/atomic/format.d.ts +1 -1
- package/dist/training/graders/decomposition/format.d.ts +10 -10
- package/dist/training/graders/decomposition/format.js +3 -3
- package/dist/training/graders/decomposition/format.js.map +1 -1
- package/dist/training/graders/decomposition/transport.d.ts +2 -2
- package/dist/training/graders/format/grader.d.ts +2 -2
- package/dist/training/graders/format/label-import.d.ts +1 -1
- package/dist/training/graders/format/labels.d.ts +1 -1
- package/dist/training/graders/identity.d.ts +1 -1
- package/dist/training/inference/evaluator/ledger.d.ts +2 -2
- package/dist/training/inference/evaluator/ledger.js +2 -1
- package/dist/training/inference/evaluator/ledger.js.map +1 -1
- package/dist/training/optimization/protocol.d.ts +11 -11
- package/package.json +4 -4
- package/runtimes.yaml +6 -6
|
@@ -126,8 +126,8 @@ export declare const upReceiptSchema: z.ZodPreprocess<z.ZodObject<{
|
|
|
126
126
|
version: z.ZodLiteral<"spawnfile.organization-ready.v1">;
|
|
127
127
|
world_binding_digest: z.ZodNullable<z.ZodString>;
|
|
128
128
|
reason: z.ZodOptional<z.ZodString>;
|
|
129
|
-
}, z.core.$strict
|
|
130
|
-
}, z.core.$strict
|
|
129
|
+
}, z.core.$strict>, unknown>>;
|
|
130
|
+
}, z.core.$strict>, unknown>;
|
|
131
131
|
export type UpReceipt = Omit<z.infer<typeof upReceiptSchema>, "organization_handoff" | "organization_handoff_handle" | "organization_ready"> & {
|
|
132
132
|
organization_handoff?: OrganizationHandoff;
|
|
133
133
|
organization_handoff_handle?: OpaqueTargetHandle;
|
|
@@ -6,7 +6,7 @@ import { SpawnfileError } from "../shared/index.js";
|
|
|
6
6
|
import { readPreviousSource, resolveExistingOrNewTarget, deriveDeploymentName, derivePersistentMountVolumeName, renderEnvFileContent, resolveImageEnvironment } from "./consumeImageSupport.js";
|
|
7
7
|
import { acquireExclusiveVolumeReservations, assertCandidateContainerReady, assertContainerStopped, inspectContainerSnapshot, restorePreviousContainer, rollbackCandidateContainer } from "./consumeImageLifecycle.js";
|
|
8
8
|
import { createConsumerDockerRunner } from "./dockerRunner.js";
|
|
9
|
-
import {
|
|
9
|
+
import { resolveDaimonRuntimeForImage } from "./consumeImageDaimonDocker.js";
|
|
10
10
|
import { extractImageReport, resolveDockerBaseArgs } from "./extractImage.js";
|
|
11
11
|
import { parseImageReference } from "./imageRef.js";
|
|
12
12
|
import { prepareImageRuntimeAuthMounts } from "./imageRuntimeAuth.js";
|
|
@@ -135,15 +135,16 @@ const consumeImageUpLocked = async (imageRef, parsedRef, deploymentName, isExpli
|
|
|
135
135
|
// config is already baked into the image; this only resolves the credential
|
|
136
136
|
// mounts. Doing it first guarantees an unusable import fails while the live
|
|
137
137
|
// container is still untouched, never mid-swap.
|
|
138
|
+
const daimonRuntime = await resolveDaimonRuntimeForImage(imageRef, report, runDocker, workDir);
|
|
138
139
|
const authMountArgs = (await prepareImageRuntimeAuthMounts({
|
|
139
140
|
authProfile: options.authProfile ?? null,
|
|
140
141
|
...(options.daimonContainerCredentialUid === undefined
|
|
141
142
|
? {}
|
|
142
143
|
: { daimonContainerCredentialUid: options.daimonContainerCredentialUid }),
|
|
143
144
|
report,
|
|
145
|
+
daimonEngineDescriptors: daimonRuntime.engineDescriptors,
|
|
144
146
|
tempRoot: workDir
|
|
145
147
|
})).mountArgs;
|
|
146
|
-
const daimonDockerSecurityArgs = await resolveDaimonDockerSecurityArgsForImage(imageRef, report, runDocker, workDir);
|
|
147
148
|
volumeReservation = await acquireExclusiveVolumeReservations(report, deploymentName, containerName, imageRef, runDocker);
|
|
148
149
|
const previousContainer = await inspectContainerSnapshot(runDocker, containerName);
|
|
149
150
|
const now = options.now ?? (() => new Date());
|
|
@@ -167,7 +168,7 @@ const consumeImageUpLocked = async (imageRef, parsedRef, deploymentName, isExpli
|
|
|
167
168
|
}
|
|
168
169
|
}
|
|
169
170
|
const runArgs = [
|
|
170
|
-
"run", "-d", "--name", containerName, ...
|
|
171
|
+
"run", "-d", "--name", containerName, ...daimonRuntime.securityArgs, "--env-file", envFilePath
|
|
171
172
|
];
|
|
172
173
|
for (const port of report.ports) {
|
|
173
174
|
runArgs.push("-p", `${port}:${port}`);
|
|
@@ -0,0 +1,432 @@
|
|
|
1
|
+
import type { DockerCommandRunner } from "./dockerRunner.js";
|
|
2
|
+
/** The selected image owns its historical contract, not the consumer's registry. */
|
|
3
|
+
export declare const readDaimonImageContract: (helperName: string, runDocker: DockerCommandRunner, temporaryDirectory: string) => Promise<Readonly<Record<string, {
|
|
4
|
+
id: string;
|
|
5
|
+
authKinds: string[];
|
|
6
|
+
auth: {
|
|
7
|
+
staging: "portable-file";
|
|
8
|
+
realm: null;
|
|
9
|
+
method: string;
|
|
10
|
+
provider: string;
|
|
11
|
+
fileName: string;
|
|
12
|
+
maxCredentialBytes: number;
|
|
13
|
+
directoryMode: 448;
|
|
14
|
+
fileMode: 384;
|
|
15
|
+
format: {
|
|
16
|
+
accessTokenKeys: string[];
|
|
17
|
+
refreshTokenKeys: string[];
|
|
18
|
+
containerKey?: string | undefined;
|
|
19
|
+
fallbackToRoot?: boolean | undefined;
|
|
20
|
+
entryKeyPattern?: string | undefined;
|
|
21
|
+
expiresAtKey?: string | undefined;
|
|
22
|
+
};
|
|
23
|
+
} | {
|
|
24
|
+
staging: "portable-realm";
|
|
25
|
+
realm: {
|
|
26
|
+
readonly agentCredentialRelativePath: ".codex/auth.json";
|
|
27
|
+
readonly bootstrapMountPath: "/var/lib/spawnfile/daimon/codex-bootstrap-auth";
|
|
28
|
+
readonly bootstrapSourceSlot: "codex-auth";
|
|
29
|
+
readonly directoryMode: 448;
|
|
30
|
+
readonly durableMountPath: "/var/lib/spawnfile/daimon/codex-subscription-realm";
|
|
31
|
+
readonly fileMode: 384;
|
|
32
|
+
readonly maxCredentialBytes: 65536;
|
|
33
|
+
};
|
|
34
|
+
method: string;
|
|
35
|
+
provider: string;
|
|
36
|
+
fileName: string;
|
|
37
|
+
maxCredentialBytes: number;
|
|
38
|
+
directoryMode: 448;
|
|
39
|
+
fileMode: 384;
|
|
40
|
+
format: {
|
|
41
|
+
accessTokenKeys: string[];
|
|
42
|
+
refreshTokenKeys: string[];
|
|
43
|
+
containerKey?: string | undefined;
|
|
44
|
+
fallbackToRoot?: boolean | undefined;
|
|
45
|
+
entryKeyPattern?: string | undefined;
|
|
46
|
+
expiresAtKey?: string | undefined;
|
|
47
|
+
};
|
|
48
|
+
} | {
|
|
49
|
+
staging: "broker-realm";
|
|
50
|
+
realm: {
|
|
51
|
+
readonly agentCredentialRelativePath: ".grok/auth.json";
|
|
52
|
+
readonly bootstrapMountPath: "/var/lib/spawnfile/daimon/grok-bootstrap-auth";
|
|
53
|
+
readonly bootstrapSourceSlot: "grok-auth";
|
|
54
|
+
readonly directoryMode: 448;
|
|
55
|
+
readonly durableMountPath: "/var/lib/spawnfile/daimon/grok-subscription-realm";
|
|
56
|
+
readonly fileMode: 384;
|
|
57
|
+
readonly maxCredentialBytes: 65536;
|
|
58
|
+
};
|
|
59
|
+
method: string;
|
|
60
|
+
provider: string;
|
|
61
|
+
fileName: string;
|
|
62
|
+
maxCredentialBytes: number;
|
|
63
|
+
directoryMode: 448;
|
|
64
|
+
fileMode: 384;
|
|
65
|
+
format: {
|
|
66
|
+
accessTokenKeys: string[];
|
|
67
|
+
refreshTokenKeys: string[];
|
|
68
|
+
containerKey?: string | undefined;
|
|
69
|
+
fallbackToRoot?: boolean | undefined;
|
|
70
|
+
entryKeyPattern?: string | undefined;
|
|
71
|
+
expiresAtKey?: string | undefined;
|
|
72
|
+
};
|
|
73
|
+
} | {
|
|
74
|
+
staging: "secret-service";
|
|
75
|
+
method: null;
|
|
76
|
+
provider: null;
|
|
77
|
+
realm: {
|
|
78
|
+
readonly directoryMode: 448;
|
|
79
|
+
readonly durableMountPath: "/var/lib/spawnfile/daimon/agy-subscription-realm";
|
|
80
|
+
readonly fileMode: 384;
|
|
81
|
+
readonly maxUnlockBytes: 4096;
|
|
82
|
+
readonly unlockMountPath: "/var/lib/spawnfile/daimon/agy-unlock-secret";
|
|
83
|
+
readonly unlockSourceSlot: "agy-unlock-secret";
|
|
84
|
+
};
|
|
85
|
+
busEnvironment: string;
|
|
86
|
+
format: null;
|
|
87
|
+
};
|
|
88
|
+
credentialMaterial: {
|
|
89
|
+
destinationRelativePath: string;
|
|
90
|
+
sourceSlot?: string | undefined;
|
|
91
|
+
sourceRelativePath?: string | undefined;
|
|
92
|
+
directoryMode?: 448 | undefined;
|
|
93
|
+
fileMode?: 384 | undefined;
|
|
94
|
+
} | null;
|
|
95
|
+
homeDirectory: string;
|
|
96
|
+
homeEnvironment: string;
|
|
97
|
+
requiredBinaries: string[];
|
|
98
|
+
modelSelection: {
|
|
99
|
+
configurable: boolean;
|
|
100
|
+
models: {
|
|
101
|
+
kind: "non-empty-string";
|
|
102
|
+
} | {
|
|
103
|
+
kind: "enum";
|
|
104
|
+
values: string[];
|
|
105
|
+
} | null;
|
|
106
|
+
reasoningEfforts: string[];
|
|
107
|
+
defaults: {
|
|
108
|
+
model: string | null;
|
|
109
|
+
reasoningEffort: string | null;
|
|
110
|
+
};
|
|
111
|
+
requiresPairedDeclaration: boolean;
|
|
112
|
+
declarationRequiresBroker: boolean;
|
|
113
|
+
};
|
|
114
|
+
sandbox: {
|
|
115
|
+
configurable: boolean;
|
|
116
|
+
policy?: {
|
|
117
|
+
mode: "workspace-write";
|
|
118
|
+
networkAccess: false;
|
|
119
|
+
webSearch: "disabled";
|
|
120
|
+
} | undefined;
|
|
121
|
+
profile?: string | undefined;
|
|
122
|
+
baseProfile?: string | undefined;
|
|
123
|
+
restrictNetwork?: boolean | undefined;
|
|
124
|
+
denyPaths?: {
|
|
125
|
+
canonicalAbsolute: boolean;
|
|
126
|
+
rootAllowed: boolean;
|
|
127
|
+
trailingSlashAllowed: boolean;
|
|
128
|
+
forbiddenCharacterPattern: string;
|
|
129
|
+
} | undefined;
|
|
130
|
+
};
|
|
131
|
+
training: {
|
|
132
|
+
subject: {
|
|
133
|
+
supported: true;
|
|
134
|
+
isolation: "native-sandbox" | "broker-worker";
|
|
135
|
+
} | {
|
|
136
|
+
supported: false;
|
|
137
|
+
isolation: null;
|
|
138
|
+
reason: string;
|
|
139
|
+
};
|
|
140
|
+
inferenceGrants: {
|
|
141
|
+
readonly bodyMembers: readonly ["messages", "model", "reasoning_effort", "response_format", "stream", "stream_options"];
|
|
142
|
+
readonly client: {
|
|
143
|
+
readonly configSha256: {
|
|
144
|
+
readonly "grok-4.5": {
|
|
145
|
+
readonly high: "ffbc33728b821e9854fbc7c93601e599225da421ecfd6ebf10d314afcc28d6f2";
|
|
146
|
+
readonly low: "a07f7436f1268bb399ec233c65d3b3d8fb99a11a1f175f8da1ca133c9367bc74";
|
|
147
|
+
readonly medium: "1f4c0d4dad1f3b09419b5739db6423a09e0049abc091594c64123a75dd53dfb9";
|
|
148
|
+
};
|
|
149
|
+
readonly "grok-4.6": {
|
|
150
|
+
readonly high: "5652656effa82f0c4f09cf8226b16e6140332a5a358b571194bb5563312367ac";
|
|
151
|
+
readonly low: "79314d039f787e4ebfec7dacf57adc969086b948f564dec008f0ed6367e6062f";
|
|
152
|
+
readonly medium: "6f538de0547c0c4e6a3f04ae08595ceadadabb06b75f6b6ee4c428744bb95cd8";
|
|
153
|
+
};
|
|
154
|
+
readonly "grok-build": {
|
|
155
|
+
readonly high: "98d16f2b7d12f4eb540d625c853e51d227933e204923e43e8b9b4176f10aca2c";
|
|
156
|
+
readonly low: "ca15c6a562a008227d39c51d3a3a83715663089b3784e8b46debb1fb67b3c4a1";
|
|
157
|
+
readonly medium: "01783fb6beadcf6f8486fff0836820ad43fab5662b812a907fe9cfdb83e9804d";
|
|
158
|
+
};
|
|
159
|
+
};
|
|
160
|
+
readonly envKey: "DAIMON_INFERENCE_GRANT";
|
|
161
|
+
readonly modelId: "daimon-inference-grok";
|
|
162
|
+
};
|
|
163
|
+
readonly failureCodes: readonly ["auth_stale", "grant_limit", "invalid_request", "unavailable"];
|
|
164
|
+
readonly ledgerDedupeKey: readonly ["grant", "request"];
|
|
165
|
+
readonly ledgerVersion: "noopolis.daimon.inference-usage.v1";
|
|
166
|
+
readonly limits: {
|
|
167
|
+
readonly maxRequests: 64;
|
|
168
|
+
readonly maxTokens: 2000000;
|
|
169
|
+
};
|
|
170
|
+
readonly maxInFlightRequestsPerGrant: 1;
|
|
171
|
+
readonly maxLiveGrants: 8;
|
|
172
|
+
readonly messageRoles: readonly ["system", "user", "assistant"];
|
|
173
|
+
readonly purposes: readonly ["judge", "optimizer"];
|
|
174
|
+
readonly requestKinds: readonly ["request_inference_grant", "release_inference_grant"];
|
|
175
|
+
readonly tokenPrefix: "inference_";
|
|
176
|
+
readonly ttlMs: 600000;
|
|
177
|
+
} | null;
|
|
178
|
+
};
|
|
179
|
+
broker: {
|
|
180
|
+
readonly artifacts: {
|
|
181
|
+
readonly arm64Sha256: "d0dc1c03197c3e90f09b66ad7c89b4f7b448d06dc84c03b247dce976d6018d6e";
|
|
182
|
+
readonly sourceSha256: "15836d7ad69f12ef581a6e5b8635c9db43b2177dac609160c0749d3d1fefbaa8";
|
|
183
|
+
readonly x64Sha256: "95aa9c272225e74ff9f45f54dde4bc30aee324e9ba24d8a876db9151c81b454d";
|
|
184
|
+
};
|
|
185
|
+
readonly backendSocketPath: "/run/daimon-engine-broker/backend.sock";
|
|
186
|
+
readonly bounds: {
|
|
187
|
+
readonly capabilityBundleBytes: 8196;
|
|
188
|
+
readonly capabilityBytes: 4096;
|
|
189
|
+
readonly outputBytes: 262144;
|
|
190
|
+
readonly promptBytes: 65536;
|
|
191
|
+
};
|
|
192
|
+
readonly controlProtocolVersion: "noopolis.daimon.engine-broker.v4";
|
|
193
|
+
readonly controlSocketPath: "/run/daimon-engine-broker/control.sock";
|
|
194
|
+
readonly credentialHomePath: "/var/lib/spawnfile/daimon/grok-subscription-realm";
|
|
195
|
+
readonly grokCliArtifacts: {
|
|
196
|
+
readonly arm64: {
|
|
197
|
+
readonly bytes: 136090504;
|
|
198
|
+
readonly sha256: "39ab87666877d64ef3a40aa60fbe0c3b6a6acd7001b78fe60e2c76bb6cfc4a94";
|
|
199
|
+
readonly url: "https://storage.googleapis.com/grok-build-public-artifacts/cli/grok-1.0.34-linux-aarch64";
|
|
200
|
+
};
|
|
201
|
+
readonly x64: {
|
|
202
|
+
readonly bytes: 163035648;
|
|
203
|
+
readonly sha256: "be5905e107d2b8b5f3c142d21ecfe4c8fd32a913d2fd551b788707930c4dc80d";
|
|
204
|
+
readonly url: "https://storage.googleapis.com/grok-build-public-artifacts/cli/grok-1.0.34-linux-x86_64";
|
|
205
|
+
};
|
|
206
|
+
};
|
|
207
|
+
readonly grokCliBuild: "3736acbc8658";
|
|
208
|
+
readonly grokCliVersion: "1.0.34";
|
|
209
|
+
readonly grokExecutablePath: "/usr/local/bin/grok";
|
|
210
|
+
readonly identities: {
|
|
211
|
+
readonly brokerUid: 2100;
|
|
212
|
+
readonly firstWorkerUid: 2200;
|
|
213
|
+
readonly organizationUid: 2000;
|
|
214
|
+
};
|
|
215
|
+
readonly inferenceGrants: {
|
|
216
|
+
readonly bodyMembers: readonly ["messages", "model", "reasoning_effort", "response_format", "stream", "stream_options"];
|
|
217
|
+
readonly client: {
|
|
218
|
+
readonly configSha256: {
|
|
219
|
+
readonly "grok-4.5": {
|
|
220
|
+
readonly high: "ffbc33728b821e9854fbc7c93601e599225da421ecfd6ebf10d314afcc28d6f2";
|
|
221
|
+
readonly low: "a07f7436f1268bb399ec233c65d3b3d8fb99a11a1f175f8da1ca133c9367bc74";
|
|
222
|
+
readonly medium: "1f4c0d4dad1f3b09419b5739db6423a09e0049abc091594c64123a75dd53dfb9";
|
|
223
|
+
};
|
|
224
|
+
readonly "grok-4.6": {
|
|
225
|
+
readonly high: "5652656effa82f0c4f09cf8226b16e6140332a5a358b571194bb5563312367ac";
|
|
226
|
+
readonly low: "79314d039f787e4ebfec7dacf57adc969086b948f564dec008f0ed6367e6062f";
|
|
227
|
+
readonly medium: "6f538de0547c0c4e6a3f04ae08595ceadadabb06b75f6b6ee4c428744bb95cd8";
|
|
228
|
+
};
|
|
229
|
+
readonly "grok-build": {
|
|
230
|
+
readonly high: "98d16f2b7d12f4eb540d625c853e51d227933e204923e43e8b9b4176f10aca2c";
|
|
231
|
+
readonly low: "ca15c6a562a008227d39c51d3a3a83715663089b3784e8b46debb1fb67b3c4a1";
|
|
232
|
+
readonly medium: "01783fb6beadcf6f8486fff0836820ad43fab5662b812a907fe9cfdb83e9804d";
|
|
233
|
+
};
|
|
234
|
+
};
|
|
235
|
+
readonly envKey: "DAIMON_INFERENCE_GRANT";
|
|
236
|
+
readonly modelId: "daimon-inference-grok";
|
|
237
|
+
};
|
|
238
|
+
readonly failureCodes: readonly ["auth_stale", "grant_limit", "invalid_request", "unavailable"];
|
|
239
|
+
readonly ledgerDedupeKey: readonly ["grant", "request"];
|
|
240
|
+
readonly ledgerVersion: "noopolis.daimon.inference-usage.v1";
|
|
241
|
+
readonly limits: {
|
|
242
|
+
readonly maxRequests: 64;
|
|
243
|
+
readonly maxTokens: 2000000;
|
|
244
|
+
};
|
|
245
|
+
readonly maxInFlightRequestsPerGrant: 1;
|
|
246
|
+
readonly maxLiveGrants: 8;
|
|
247
|
+
readonly messageRoles: readonly ["system", "user", "assistant"];
|
|
248
|
+
readonly purposes: readonly ["judge", "optimizer"];
|
|
249
|
+
readonly requestKinds: readonly ["request_inference_grant", "release_inference_grant"];
|
|
250
|
+
readonly tokenPrefix: "inference_";
|
|
251
|
+
readonly ttlMs: 600000;
|
|
252
|
+
};
|
|
253
|
+
readonly launcherSocketPath: "/run/daimon-engine-broker/launcher.sock";
|
|
254
|
+
readonly mcpFacade: {
|
|
255
|
+
readonly host: "127.0.0.1";
|
|
256
|
+
readonly path: "/mcp";
|
|
257
|
+
readonly port: 43124;
|
|
258
|
+
};
|
|
259
|
+
readonly nativeAbiVersion: 2;
|
|
260
|
+
readonly nativeExecutablePath: "/opt/daimon/bin/daimon-engine-broker";
|
|
261
|
+
readonly projectionVersion: "noopolis.daimon.grok-broker-projection.v3";
|
|
262
|
+
readonly providerProxy: {
|
|
263
|
+
readonly host: "127.0.0.1";
|
|
264
|
+
readonly port: 43123;
|
|
265
|
+
};
|
|
266
|
+
readonly registrationPath: "/etc/daimon-engine-broker/registrations.bin";
|
|
267
|
+
readonly runRequestBudget: {
|
|
268
|
+
readonly countsCredentialRetries: true;
|
|
269
|
+
readonly fileName: "run-requests.json";
|
|
270
|
+
readonly includesInferenceGrants: true;
|
|
271
|
+
readonly maximumField: "maxRunRequests";
|
|
272
|
+
readonly storeField: "runRequestStore";
|
|
273
|
+
};
|
|
274
|
+
readonly serviceConfigPath: "/etc/daimon-engine-broker/service.json";
|
|
275
|
+
readonly serviceConfigVersions: readonly ["noopolis.daimon.engine-broker-service.v1", "noopolis.daimon.engine-broker-service.v2", "noopolis.daimon.engine-broker-service.v3"];
|
|
276
|
+
readonly slotPreflightVersion: "noopolis.daimon.grok-slot-preflight.v2";
|
|
277
|
+
readonly slotRouting: {
|
|
278
|
+
readonly controlCaller: "organization";
|
|
279
|
+
readonly key: "slot";
|
|
280
|
+
readonly repeatedAgentIds: true;
|
|
281
|
+
readonly resetRequest: "reset_slot";
|
|
282
|
+
readonly resetResponse: "slot_reset";
|
|
283
|
+
readonly slotEnvironment: "DAIMON_ENGINE_BROKER_SLOT";
|
|
284
|
+
readonly turnStoreDirectory: "slot-{slot}";
|
|
285
|
+
readonly workersMayControl: false;
|
|
286
|
+
};
|
|
287
|
+
readonly turnLimits: {
|
|
288
|
+
readonly bounds: {
|
|
289
|
+
readonly maxRequests: readonly [1, 48];
|
|
290
|
+
readonly maxTokens: readonly [1, 10000000];
|
|
291
|
+
readonly timeoutMs: readonly [1000, 3600000];
|
|
292
|
+
};
|
|
293
|
+
readonly keys: readonly ["maxRequests", "maxTokens", "timeoutMs"];
|
|
294
|
+
readonly limitReasons: readonly ["tokens", "requests", "timeout", "none"];
|
|
295
|
+
readonly maxInFlightRequests: 1;
|
|
296
|
+
readonly missingUsageEstimate: {
|
|
297
|
+
readonly inputBytesPerToken: 2;
|
|
298
|
+
readonly outputTokens: 4096;
|
|
299
|
+
};
|
|
300
|
+
readonly requestUsageMaxTokens: 500000;
|
|
301
|
+
readonly tokenCeilingOvershoot: "at-most-one-request";
|
|
302
|
+
readonly v1Defaults: {
|
|
303
|
+
readonly maxRequests: 32;
|
|
304
|
+
readonly maxTokens: 300000;
|
|
305
|
+
readonly timeoutMs: 240000;
|
|
306
|
+
};
|
|
307
|
+
readonly wakeMayOnlyLower: true;
|
|
308
|
+
};
|
|
309
|
+
readonly turnRecordVersions: readonly ["noopolis.daimon.engine-broker-turn.v1", "noopolis.daimon.engine-broker-turn.v2"];
|
|
310
|
+
readonly turnStorePath: "/var/lib/spawnfile/daimon/grok-subscription-realm/turns";
|
|
311
|
+
readonly wakeLimitEnvironment: {
|
|
312
|
+
readonly maxTokens: "DAIMON_ENGINE_WAKE_TOKEN_CEILING";
|
|
313
|
+
readonly timeoutMs: "DAIMON_ENGINE_WAKE_TIMEOUT_MS";
|
|
314
|
+
};
|
|
315
|
+
readonly worker: {
|
|
316
|
+
readonly clockedConfigSha256: {
|
|
317
|
+
readonly "grok-4.5": {
|
|
318
|
+
readonly high: "907d8967960c342b442d6d256b2585f3c85bd846a78578f596f0b605403d6d34";
|
|
319
|
+
readonly low: "3c4f3515b21c1bffb3fb770e2ecb4b918b6c43d5e77c1fd47e1e6698d1fedee7";
|
|
320
|
+
readonly medium: "9117e12b2f3f6fa045799592969cbaae1c2f3b1ea79330badac8655b9b41dd7a";
|
|
321
|
+
};
|
|
322
|
+
readonly "grok-4.6": {
|
|
323
|
+
readonly high: "203744f6f0dfc0bc80cfb896880497edfd9b3de4dcf33060e8ef4d2ef5f220a7";
|
|
324
|
+
readonly low: "751f1dcd04983e5e5883df5a8fefa04f201e187e5ef1f344d3bf83f950830432";
|
|
325
|
+
readonly medium: "f1406f93a8091eb0c09e07321254a9c783a89b0bbf5548d9613d53a8d087a517";
|
|
326
|
+
};
|
|
327
|
+
readonly "grok-build": {
|
|
328
|
+
readonly high: "6efddadc82c38020d3351829e54bb09fa456cd6d76ea1247902794d82a4a3ffa";
|
|
329
|
+
readonly low: "a8c63ba910623a0686930c27db0733f4a2588c7fca9dd7da25c3f18027720ab5";
|
|
330
|
+
readonly medium: "6afcd2b90c0d19794f8c0d22147a0f011946a92e613f89dae98b0ca729313101";
|
|
331
|
+
};
|
|
332
|
+
};
|
|
333
|
+
readonly configSha256: {
|
|
334
|
+
readonly "grok-4.5": {
|
|
335
|
+
readonly high: "c63c3387ce92d94ec3f690abfe98942afcd7c9e17ff84816bbe751f340ab251f";
|
|
336
|
+
readonly low: "8247127c3625ff7c5d8d527a53596b89ec6557a821ac46cfd00bd122b90daff6";
|
|
337
|
+
readonly medium: "59288cee61297bb8c002097061a48f77b09d310754187a253ee089f7172a9155";
|
|
338
|
+
};
|
|
339
|
+
readonly "grok-4.6": {
|
|
340
|
+
readonly high: "65b0212564fb74042b1503d293fb8d3620276033264c0efade2a539ca09218e3";
|
|
341
|
+
readonly low: "ab58499ac32678097c146479896f2b8a8e2b0e39aea22dc0a60b6227e370538e";
|
|
342
|
+
readonly medium: "df1a5cc84346e7f6bf6090492fbd19faaefb42953e3bb2e8c6cbc0572242403f";
|
|
343
|
+
};
|
|
344
|
+
readonly "grok-build": {
|
|
345
|
+
readonly high: "a23724e00d670caee185ba7690d2daa868173e53905cf446f5329666f01ab4e3";
|
|
346
|
+
readonly low: "fb343f2809903f26d21681470943235031f946e99085542fd89555eb7782cbb5";
|
|
347
|
+
readonly medium: "8a587ef75c90eab70d19b24583e60051d6fba9d90c558839fdbb15588b4cc656";
|
|
348
|
+
};
|
|
349
|
+
};
|
|
350
|
+
readonly defaultModel: "grok-4.6";
|
|
351
|
+
readonly defaultReasoningEffort: "low";
|
|
352
|
+
readonly home: {
|
|
353
|
+
readonly directory: {
|
|
354
|
+
readonly group: "worker";
|
|
355
|
+
readonly mode: 1017;
|
|
356
|
+
readonly uid: 0;
|
|
357
|
+
};
|
|
358
|
+
readonly organizationRuntimeHome: {
|
|
359
|
+
readonly group: "worker";
|
|
360
|
+
readonly mode: 456;
|
|
361
|
+
readonly owner: "organization";
|
|
362
|
+
};
|
|
363
|
+
readonly privateTmp: {
|
|
364
|
+
readonly mode: 448;
|
|
365
|
+
readonly owner: "worker";
|
|
366
|
+
readonly relativeToWorkerHome: "tmp";
|
|
367
|
+
};
|
|
368
|
+
readonly readOnlyFiles: {
|
|
369
|
+
readonly gid: 0;
|
|
370
|
+
readonly mode: 292;
|
|
371
|
+
readonly names: readonly ["config.toml", "managed_config.toml", "requirements.toml", "sandbox.toml", "trusted_folders.toml"];
|
|
372
|
+
readonly uid: 0;
|
|
373
|
+
};
|
|
374
|
+
readonly sandboxEvents: {
|
|
375
|
+
readonly group: "broker";
|
|
376
|
+
readonly mode: 416;
|
|
377
|
+
readonly owner: "worker";
|
|
378
|
+
readonly relativePath: "sessions/sandbox-events.jsonl";
|
|
379
|
+
};
|
|
380
|
+
readonly sessionsDirectory: {
|
|
381
|
+
readonly group: "worker";
|
|
382
|
+
readonly mode: 1017;
|
|
383
|
+
readonly relativePath: "sessions";
|
|
384
|
+
readonly uid: 0;
|
|
385
|
+
};
|
|
386
|
+
readonly sharedTmp: {
|
|
387
|
+
readonly maxGroupExclusive: 2200;
|
|
388
|
+
readonly mode: 1020;
|
|
389
|
+
readonly otherMode: 4;
|
|
390
|
+
readonly paths: readonly ["/tmp", "/var/tmp"];
|
|
391
|
+
readonly uid: 0;
|
|
392
|
+
};
|
|
393
|
+
readonly spillDirectory: {
|
|
394
|
+
readonly fileMode: 416;
|
|
395
|
+
readonly group: "worker";
|
|
396
|
+
readonly mode: 1512;
|
|
397
|
+
readonly owner: "organization";
|
|
398
|
+
readonly relativeToRuntimeHome: "tool-output";
|
|
399
|
+
};
|
|
400
|
+
};
|
|
401
|
+
readonly maxTurns: 48;
|
|
402
|
+
readonly modelId: "daimon-broker-grok";
|
|
403
|
+
readonly models: readonly ["grok-4.6", "grok-4.5", "grok-build"];
|
|
404
|
+
readonly reasoningEfforts: readonly ["low", "medium", "high"];
|
|
405
|
+
readonly systemPromptSha256: "2c31c0085a54a4efbf9c0cf0b8124c56e47f38691b7f0c7fa233a74abaa8ddf8";
|
|
406
|
+
readonly taskClock: {
|
|
407
|
+
readonly directoryMode: 493;
|
|
408
|
+
readonly directoryPath: "/run/daimon-engine-broker/task-clock/slot-0";
|
|
409
|
+
readonly fileMode: 420;
|
|
410
|
+
readonly ownerUid: 2100;
|
|
411
|
+
readonly preloadPath: "/usr/local/lib/daimon/libfaketime.so.1";
|
|
412
|
+
readonly rootDirectoryPath: "/run/daimon-engine-broker/task-clock";
|
|
413
|
+
readonly slotDirectoryPattern: "/run/daimon-engine-broker/task-clock/slot-{slot}";
|
|
414
|
+
readonly slotFilePattern: "/run/daimon-engine-broker/task-clock/slot-{slot}/faketime";
|
|
415
|
+
readonly timestampFilePath: "/run/daimon-engine-broker/task-clock/slot-0/faketime";
|
|
416
|
+
readonly version: "noopolis.daimon.grok-broker-task-clock.v2";
|
|
417
|
+
readonly workerView: "own-directory-visible-sibling-directories-denied";
|
|
418
|
+
};
|
|
419
|
+
readonly toolIds: readonly ["run_terminal_cmd", "read_file", "grep", "list_dir", "search_tool", "use_tool"];
|
|
420
|
+
readonly visibleTools: readonly ["grep", "list_dir", "read_file", "run_terminal_command", "search_tool", "use_tool"];
|
|
421
|
+
};
|
|
422
|
+
} | null;
|
|
423
|
+
capabilities: {
|
|
424
|
+
portableCredential: boolean;
|
|
425
|
+
nativeSandbox: boolean;
|
|
426
|
+
broker: boolean;
|
|
427
|
+
secretService: boolean;
|
|
428
|
+
};
|
|
429
|
+
piAuthMethod?: string | undefined;
|
|
430
|
+
piProvider?: string | undefined;
|
|
431
|
+
piSourceProvider?: string | undefined;
|
|
432
|
+
}>>>;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import path from "node:path";
|
|
2
|
+
import { mkdtemp, rm, writeFile } from "node:fs/promises";
|
|
3
|
+
import { readVerifiedDaimonContractManifest } from "../runtime/daimon/contractManifest.js";
|
|
4
|
+
import { SpawnfileError } from "../shared/errors.js";
|
|
5
|
+
import { extractSingleFileFromTar } from "./tarReader.js";
|
|
6
|
+
const RUNTIME_ROOT = "/opt/spawnfile/runtime-installs/daimon";
|
|
7
|
+
/** The selected image owns its historical contract, not the consumer's registry. */
|
|
8
|
+
export const readDaimonImageContract = async (helperName, runDocker, temporaryDirectory) => {
|
|
9
|
+
const directory = await mkdtemp(path.join(temporaryDirectory, "daimon-contract-"));
|
|
10
|
+
try {
|
|
11
|
+
const copy = async (name, maxBytes) => {
|
|
12
|
+
const tar = await runDocker(["cp", `${helperName}:${RUNTIME_ROOT}/${name}`, "-"]);
|
|
13
|
+
return extractSingleFileFromTar(tar, { maxBytes });
|
|
14
|
+
};
|
|
15
|
+
const manifest = await copy("contract-manifest.json", 4 * 1024 * 1024);
|
|
16
|
+
const sidecar = await copy("contract-manifest.sha256", 128);
|
|
17
|
+
const receiptBytes = await copy("capability-receipt.json", 1024 * 1024);
|
|
18
|
+
await writeFile(path.join(directory, "contract-manifest.json"), manifest);
|
|
19
|
+
await writeFile(path.join(directory, "contract-manifest.sha256"), sidecar);
|
|
20
|
+
const verified = await readVerifiedDaimonContractManifest(directory);
|
|
21
|
+
const receipt = JSON.parse(receiptBytes.toString("utf8"));
|
|
22
|
+
if (!receipt || Array.isArray(receipt)
|
|
23
|
+
|| receipt.version !== "spawnfile.daimon-runtime-capability-receipt.v1"
|
|
24
|
+
|| receipt.manifest_sha256 !== verified.digest) {
|
|
25
|
+
throw new Error("capability receipt does not bind the image manifest");
|
|
26
|
+
}
|
|
27
|
+
return verified.manifest.engines;
|
|
28
|
+
}
|
|
29
|
+
catch (error) {
|
|
30
|
+
throw new SpawnfileError("validation_error", "Could not verify Daimon's embedded image contract: "
|
|
31
|
+
+ (error instanceof Error ? error.message : String(error)));
|
|
32
|
+
}
|
|
33
|
+
finally {
|
|
34
|
+
await rm(directory, { recursive: true, force: true });
|
|
35
|
+
}
|
|
36
|
+
};
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
import type { DaimonEngineDescriptors } from "../runtime/daimon/engineDescriptorSchema.js";
|
|
1
2
|
import type { DockerCommandRunner } from "./dockerRunner.js";
|
|
2
3
|
import type { DistributionReport } from "./types.js";
|
|
3
|
-
export declare const
|
|
4
|
+
export declare const resolveDaimonRuntimeForImage: (imageRef: string, report: DistributionReport, runDocker: DockerCommandRunner, securityDirectory: string) => Promise<{
|
|
5
|
+
securityArgs: string[];
|
|
6
|
+
engineDescriptors?: DaimonEngineDescriptors;
|
|
7
|
+
}>;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { randomUUID } from "node:crypto";
|
|
2
2
|
import { SpawnfileError } from "../shared/errors.js";
|
|
3
3
|
import { DAIMON_DOCKER_RUNTIME_SECURITY_ARGS, daimonEngineDockerSecurityArgsForConfigs, materializeDaimonGrokSeccompProfile } from "../shared/daimonCodexDocker.js";
|
|
4
|
+
import { readDaimonImageContract } from "./consumeImageDaimonContract.js";
|
|
4
5
|
import { extractSingleFileFromTar } from "./tarReader.js";
|
|
5
6
|
const DAIMON_CONFIG_SIZE_CAP_BYTES = 4 * 1024 * 1024;
|
|
6
7
|
const daimonInstancesFrom = (report) => report.runtime_instances.filter((instance) => instance.runtime === "daimon");
|
|
@@ -10,7 +11,7 @@ const assertAbsoluteConfigPath = (instance) => {
|
|
|
10
11
|
}
|
|
11
12
|
return instance.config_path;
|
|
12
13
|
};
|
|
13
|
-
const readDaimonConfigSourcesFromImage = async (imageRef, instances, runDocker) => {
|
|
14
|
+
const readDaimonConfigSourcesFromImage = async (imageRef, instances, runDocker, securityDirectory) => {
|
|
14
15
|
const helperName = `spawnfile-daimon-config-${randomUUID()}`;
|
|
15
16
|
await runDocker(["create", "--name", helperName, imageRef]);
|
|
16
17
|
try {
|
|
@@ -27,19 +28,19 @@ const readDaimonConfigSourcesFromImage = async (imageRef, instances, runDocker)
|
|
|
27
28
|
}
|
|
28
29
|
sources.push(extractSingleFileFromTar(tar, { maxBytes: DAIMON_CONFIG_SIZE_CAP_BYTES }).toString("utf8"));
|
|
29
30
|
}
|
|
30
|
-
return sources;
|
|
31
|
+
return { sources, engineDescriptors: await readDaimonImageContract(helperName, runDocker, securityDirectory) };
|
|
31
32
|
}
|
|
32
33
|
finally {
|
|
33
34
|
await runDocker(["rm", "-f", helperName]).catch(() => undefined);
|
|
34
35
|
}
|
|
35
36
|
};
|
|
36
|
-
export const
|
|
37
|
+
export const resolveDaimonRuntimeForImage = async (imageRef, report, runDocker, securityDirectory) => {
|
|
37
38
|
const daimonInstances = daimonInstancesFrom(report);
|
|
38
39
|
if (daimonInstances.length === 0)
|
|
39
|
-
return [];
|
|
40
|
-
const sources = await readDaimonConfigSourcesFromImage(imageRef, daimonInstances, runDocker);
|
|
41
|
-
return [
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
40
|
+
return { securityArgs: [] };
|
|
41
|
+
const { sources, engineDescriptors } = await readDaimonConfigSourcesFromImage(imageRef, daimonInstances, runDocker, securityDirectory);
|
|
42
|
+
return { engineDescriptors, securityArgs: [
|
|
43
|
+
...DAIMON_DOCKER_RUNTIME_SECURITY_ARGS,
|
|
44
|
+
...(await daimonEngineDockerSecurityArgsForConfigs(sources, () => materializeDaimonGrokSeccompProfile(securityDirectory)))
|
|
45
|
+
] };
|
|
45
46
|
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { createHash } from "node:crypto";
|
|
2
|
+
import { readFileSync } from "node:fs";
|
|
3
|
+
// Historical bytes, unchanged: v5 a483f6e4, v6 bf61e6bb.
|
|
4
|
+
export const daimonImageManifestBytes = (version = 7) => readFileSync(new URL(version === 7 ? "../runtime/daimon/contract-manifest.json"
|
|
5
|
+
: `./daimon-contract-v${version}.fixture.json`, import.meta.url));
|
|
6
|
+
export const daimonImageContractFiles = (bytes = daimonImageManifestBytes()) => {
|
|
7
|
+
const digest = `sha256:${createHash("sha256").update(bytes).digest("hex")}`;
|
|
8
|
+
const root = "/opt/spawnfile/runtime-installs/daimon";
|
|
9
|
+
return {
|
|
10
|
+
[`${root}/contract-manifest.json`]: bytes,
|
|
11
|
+
[`${root}/contract-manifest.sha256`]: Buffer.from(`${digest}\n`),
|
|
12
|
+
[`${root}/capability-receipt.json`]: Buffer.from(JSON.stringify({
|
|
13
|
+
version: "spawnfile.daimon-runtime-capability-receipt.v1", manifest_sha256: digest
|
|
14
|
+
}))
|
|
15
|
+
};
|
|
16
|
+
};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { DaimonEngineDescriptors } from "../runtime/daimon/engineDescriptorSchema.js";
|
|
1
2
|
import type { ResolvedAuthProfile } from "../auth/index.js";
|
|
2
3
|
import type { DistributionReport } from "./types.js";
|
|
3
4
|
export interface ImageRuntimeAuthInput {
|
|
@@ -8,6 +9,7 @@ export interface ImageRuntimeAuthInput {
|
|
|
8
9
|
* known to run under a different identity.
|
|
9
10
|
*/
|
|
10
11
|
daimonContainerCredentialUid?: number;
|
|
12
|
+
daimonEngineDescriptors?: DaimonEngineDescriptors;
|
|
11
13
|
report: DistributionReport;
|
|
12
14
|
sourceEnvironment?: Record<string, string | undefined>;
|
|
13
15
|
tempRoot: string;
|
|
@@ -16,7 +18,7 @@ export interface ImageRuntimeAuthResult {
|
|
|
16
18
|
coveredModelSecrets: Set<string>;
|
|
17
19
|
mountArgs: string[];
|
|
18
20
|
}
|
|
19
|
-
export declare const prepareDaimonImageAuthMounts: (instance: DistributionReport["runtime_instances"][number], environment: Record<string, string | undefined>, authProfile: ResolvedAuthProfile | null, containerCredentialUid?: number) => Promise<string[]>;
|
|
21
|
+
export declare const prepareDaimonImageAuthMounts: (instance: DistributionReport["runtime_instances"][number], environment: Record<string, string | undefined>, authProfile: ResolvedAuthProfile | null, containerCredentialUid?: number, inventory?: DaimonEngineDescriptors) => Promise<string[]>;
|
|
20
22
|
/**
|
|
21
23
|
* Builds the credential mounts for a sourceless image deployment that uses
|
|
22
24
|
* import-based model auth. The OAuth-mode config is already baked into the
|