@forgezero/agent 0.1.30 → 0.1.32
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 +28 -0
- package/dist/agent-heartbeat.d.ts +10 -2
- package/dist/agent-heartbeat.js +396 -54
- package/dist/agent-update-helper.d.ts +41 -2
- package/dist/agent-update-helper.js +360 -43
- package/dist/agent-update.d.ts +1 -0
- package/dist/agent-update.js +34 -2
- package/dist/definition.d.ts +5 -2
- package/dist/definition.js +32 -21
- package/dist/deploy-file.d.ts +40 -0
- package/dist/deploy-file.js +378 -0
- package/dist/deployment.d.ts +4 -0
- package/dist/fz-agent.js +476 -100
- package/dist/fz.js +419 -19
- package/dist/index.d.ts +2 -2
- package/dist/provision.js +366 -52
- package/dist/software-helper.js +3 -3
- package/dist/software.d.ts +1 -1
- package/dist/software.js +3 -3
- package/dist/version.d.ts +1 -1
- package/package.json +8 -2
- package/schema/deploy-v2.json +70 -0
package/README.md
CHANGED
|
@@ -145,6 +145,34 @@ file before executing any command, prepares only the selected profile, and gives
|
|
|
145
145
|
step only the vault values it explicitly names. `await` returns the complete
|
|
146
146
|
pipeline result; no polling service or persistent queue is required.
|
|
147
147
|
|
|
148
|
+
Create and validate that file with the same public package that executes it:
|
|
149
|
+
|
|
150
|
+
```bash
|
|
151
|
+
fz deploy catalog --channel production
|
|
152
|
+
fz deploy init --profile app --software bun@1.3.14
|
|
153
|
+
# Replace the explicit safe blockers with this project's release and health commands.
|
|
154
|
+
fz deploy check
|
|
155
|
+
fz deploy sync
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
`init` refuses to invent a generic release or health check: both generated steps
|
|
159
|
+
exit non-zero until the project replaces them. `check` validates the published
|
|
160
|
+
v2 schema and active software coordinates, then prints a formatting-independent
|
|
161
|
+
semantic SHA-256 digest. The schema ships at
|
|
162
|
+
`@forgezero/agent/schema/deploy-v2.json` and is served from
|
|
163
|
+
`https://www.forgezero.net/schemas/deploy-v2.json`.
|
|
164
|
+
|
|
165
|
+
Git is the only local-to-live synchronization mechanism. `sync` validates and
|
|
166
|
+
prints that rule; it does not create a second mutable command copy in the API.
|
|
167
|
+
The verified webhook identifies one exact commit, and a successful Agent result
|
|
168
|
+
persists the definition digest so the Applications screen can prove which local
|
|
169
|
+
contract became live.
|
|
170
|
+
|
|
171
|
+
Catalog status is an admission boundary, not a suggestion. `testing` coordinates
|
|
172
|
+
are visible in the development catalog for ForgeZero qualification but cannot be
|
|
173
|
+
selected by any deploy file. A repository cannot promote software by calling
|
|
174
|
+
itself development; only a reviewed catalog change to `active` unlocks it.
|
|
175
|
+
|
|
148
176
|
The daemon owns source checkout and command execution. Bootstrap explicitly
|
|
149
177
|
awaits release one because the API does not exist yet, then the Agent consumes a
|
|
150
178
|
one-use platform enrolment capability. There is no branch watcher. Every normal
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { NodeKeyPair } from '@forgezero/runtime/identity';
|
|
2
2
|
import { type AgentRelease } from './agent-update';
|
|
3
|
-
import { type AgentUpdateResponse } from './agent-update-helper';
|
|
3
|
+
import { type AgentUpdateReceipt, type AgentUpdateResponse } from './agent-update-helper';
|
|
4
4
|
export interface AgentObservation {
|
|
5
5
|
version: string;
|
|
6
6
|
os: {
|
|
@@ -9,12 +9,18 @@ export interface AgentObservation {
|
|
|
9
9
|
};
|
|
10
10
|
architecture: string;
|
|
11
11
|
mode: 'attested' | 'enrolled';
|
|
12
|
+
update?: AgentUpdateReceipt;
|
|
12
13
|
}
|
|
13
14
|
export interface AgentHeartbeatResponse {
|
|
14
15
|
ok: true;
|
|
15
16
|
nodeKey: string;
|
|
16
17
|
intervalSeconds: number;
|
|
17
18
|
desiredAgentRelease?: AgentRelease;
|
|
19
|
+
desiredAgentUpdate?: {
|
|
20
|
+
attemptId: string;
|
|
21
|
+
leaseExpiresAtTs: number;
|
|
22
|
+
release: AgentRelease;
|
|
23
|
+
};
|
|
18
24
|
}
|
|
19
25
|
export interface AgentHeartbeatOptions {
|
|
20
26
|
apiUrl: string;
|
|
@@ -26,11 +32,13 @@ export interface AgentHeartbeatOptions {
|
|
|
26
32
|
fetch?: (input: URL, init: RequestInit) => Promise<Response>;
|
|
27
33
|
requestTimeoutMs?: number;
|
|
28
34
|
observation?: () => AgentObservation;
|
|
35
|
+
receiptPath?: string;
|
|
36
|
+
now?: () => number;
|
|
29
37
|
/** Stop new lifecycle/deploy claims and await current jobs before replacement. */
|
|
30
38
|
prepareUpdate?: (release: AgentRelease) => Promise<void>;
|
|
31
39
|
/** Restart the drained current process if staging is refused before activation. */
|
|
32
40
|
recoverUpdate?: (cause: unknown) => Promise<void> | void;
|
|
33
|
-
applyUpdate?: (release: AgentRelease, currentVersion: string) => Promise<AgentUpdateResponse>;
|
|
41
|
+
applyUpdate?: (release: AgentRelease, currentVersion: string, attemptId: string) => Promise<AgentUpdateResponse>;
|
|
34
42
|
setTimer?: (callback: () => void, ms: number) => unknown;
|
|
35
43
|
clearTimer?: (handle: unknown) => void;
|
|
36
44
|
onEvent?: (event: string, detail?: unknown) => void;
|