@forgezero/agent 0.1.2 → 0.1.9

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 (46) hide show
  1. package/README.md +45 -2
  2. package/dist/attestation-client.d.ts +22 -0
  3. package/dist/attestation-client.test.d.ts +1 -0
  4. package/dist/compute.d.ts +122 -0
  5. package/dist/compute.js +150 -0
  6. package/dist/compute.test.d.ts +1 -0
  7. package/dist/control.d.ts +57 -0
  8. package/dist/control.test.d.ts +1 -0
  9. package/dist/definition.d.ts +34 -0
  10. package/dist/definition.js +159 -0
  11. package/dist/definition.test.d.ts +1 -0
  12. package/dist/deployment-pull.d.ts +60 -0
  13. package/dist/deployment-pull.test.d.ts +1 -0
  14. package/dist/deployment-runner.d.ts +23 -0
  15. package/dist/deployment-runner.js +199 -0
  16. package/dist/deployment-runner.test.d.ts +1 -0
  17. package/dist/deployment-watch.d.ts +36 -0
  18. package/dist/deployment-watch.test.d.ts +1 -0
  19. package/dist/deployment.d.ts +86 -0
  20. package/dist/deployment.test.d.ts +1 -0
  21. package/dist/fz-agent.js +2879 -158
  22. package/dist/guest-enrolment.d.ts +29 -0
  23. package/dist/guest-enrolment.js +88 -0
  24. package/dist/guest-enrolment.test.d.ts +1 -0
  25. package/dist/index.d.ts +50 -4
  26. package/dist/metal-helper-socket.d.ts +15 -0
  27. package/dist/metal-helper-socket.js +1123 -0
  28. package/dist/metal-helper-socket.test.d.ts +1 -0
  29. package/dist/metal-isolation.d.ts +14 -0
  30. package/dist/metal-isolation.test.d.ts +1 -0
  31. package/dist/metal-provision.d.ts +85 -0
  32. package/dist/metal-provision.js +1014 -0
  33. package/dist/metal-provision.test.d.ts +1 -0
  34. package/dist/node-vault.d.ts +24 -0
  35. package/dist/node-vault.js +211 -0
  36. package/dist/node-vault.test.d.ts +1 -0
  37. package/dist/provision.d.ts +50 -2
  38. package/dist/provision.js +286 -12
  39. package/dist/provisioning-pull.d.ts +75 -0
  40. package/dist/provisioning-pull.js +188 -0
  41. package/dist/provisioning-pull.test.d.ts +1 -0
  42. package/dist/signed-node-http.d.ts +14 -0
  43. package/dist/snp-attestation.d.ts +18 -0
  44. package/dist/snp-attestation.test.d.ts +1 -0
  45. package/dist/socket.d.ts +4 -23
  46. package/package.json +21 -5
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,14 @@
1
+ import { type MetalExec, type MetalProvisionProfile } from './metal-provision';
2
+ /** Aggregate boundary for every QEMU service on one physical host. */
3
+ export declare function metalGuestSliceUnit(profile: MetalProvisionProfile): string;
4
+ /** Keep host daemons and interactive sessions off every guest CPU. */
5
+ export declare function metalHousekeepingDropIn(profile: MetalProvisionProfile, kind: 'slice' | 'scope'): string;
6
+ /**
7
+ * Persist and activate the host/guest cgroup boundary.
8
+ *
9
+ * Existing ForgeZero guests are never silently moved: changing a service's
10
+ * Slice requires a restart, so an old QEMU still under system.slice makes this
11
+ * operation fail before host restrictions are applied. The operator can then
12
+ * drain and restart it deliberately.
13
+ */
14
+ export declare function applyMetalIsolation(profile: MetalProvisionProfile, exec?: MetalExec): Promise<void>;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,85 @@
1
+ import type { CreateRemoteProvisionClaim, RemoteProvisionClaim, ProvisionResult } from './provisioning-pull';
2
+ export interface MetalImage {
3
+ path: string;
4
+ sha256: string;
5
+ }
6
+ /** One non-overlapping physical isolation boundary available to one guest. */
7
+ export interface MetalCpuPool {
8
+ key: string;
9
+ /** Linux CPU-list syntax, including every SMT sibling in this pool. */
10
+ cpus: string;
11
+ /** Real cores represented by cpus; checked against the commercial promise. */
12
+ physicalCores: number;
13
+ /** Linux NUMA node-list syntax. Optional on a non-NUMA machine. */
14
+ memoryNodes?: string;
15
+ }
16
+ export interface MetalProvisionProfile {
17
+ volumeGroup: string;
18
+ bridge: string;
19
+ subnetPrefix: string;
20
+ addressStart: number;
21
+ addressEnd: number;
22
+ gateway: string;
23
+ nameservers?: readonly string[];
24
+ stateDir: string;
25
+ seedDir: string;
26
+ unitDir: string;
27
+ apiUrl: string;
28
+ images: Record<string, MetalImage>;
29
+ /** Explicit host-observed pools. No pool means no dynamic guest authority. */
30
+ cpuPools: readonly MetalCpuPool[];
31
+ /** CPUs kept outside every guest pool for the host and control services. */
32
+ housekeepingCpus: string;
33
+ /** NUMA nodes reserved for host allocations when the topology permits it. */
34
+ housekeepingMemoryNodes?: string;
35
+ bunVersion: string;
36
+ bunInstallerSha256: string;
37
+ agentVersion: string;
38
+ confidential?: {
39
+ cbitpos: number;
40
+ reducedPhysBits: number;
41
+ policy: string;
42
+ };
43
+ }
44
+ export interface MetalCommandResult {
45
+ exitCode: number;
46
+ stdout: string;
47
+ stderr: string;
48
+ }
49
+ export type MetalExec = (argv: readonly string[]) => Promise<MetalCommandResult>;
50
+ export interface GuestManifest {
51
+ computeKey: string;
52
+ reference: string;
53
+ name: string;
54
+ address: string;
55
+ mac: string;
56
+ cpuPoolKey: string;
57
+ allowedCpus: string;
58
+ allowedMemoryNodes?: string;
59
+ phase: 'allocating' | 'image-ready' | 'running';
60
+ }
61
+ export declare class MetalProvisionError extends Error {
62
+ }
63
+ export declare const guestNameFor: (computeKey: string) => string;
64
+ /** Linux interface names are capped at 15 bytes. */
65
+ export declare const tapNameFor: (computeKey: string) => string;
66
+ export declare const macForAddress: (address: string) => string;
67
+ export declare function validateMetalProfile(profile: MetalProvisionProfile): void;
68
+ export declare function allocateAddress(profile: MetalProvisionProfile, computeKey: string, rows: GuestManifest[]): string;
69
+ /** Stable tight-fit allocation of one exclusive CPU/NUMA pool. */
70
+ export declare function allocateCpuPool(profile: MetalProvisionProfile, claim: Pick<RemoteProvisionClaim, 'computeKey' | 'spec'>, rows: GuestManifest[]): MetalCpuPool;
71
+ export declare function guestBootstrapScript(profile: MetalProvisionProfile, attested?: boolean): string;
72
+ export declare function guestAgentUnit(profile: MetalProvisionProfile, name: string, attested?: boolean): string;
73
+ /** Removed by the root cleanup service once the non-secret binding is durable. */
74
+ export declare function guestEnrolmentDropIn(): string;
75
+ export declare function guestEnrolmentCleanupScript(): string;
76
+ export declare function guestEnrolmentCleanupUnit(): string;
77
+ export declare function cloudInit(profile: MetalProvisionProfile, claim: CreateRemoteProvisionClaim, manifest: GuestManifest): {
78
+ userData: string;
79
+ metaData: string;
80
+ networkConfig: string;
81
+ };
82
+ /** The only root operation the metal agent may request. */
83
+ export declare function provisionMetalGuest(profile: MetalProvisionProfile, claim: CreateRemoteProvisionClaim, exec: MetalExec): Promise<ProvisionResult>;
84
+ /** Idempotently remove every host-owned artifact before capacity is returned. */
85
+ export declare function removeMetalGuest(profile: MetalProvisionProfile, claim: RemoteProvisionClaim, exec: MetalExec): Promise<ProvisionResult>;