@arcforge/types 2.0.104 → 2.0.105
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/package.json +1 -1
- package/src/index.ts +1 -0
- package/src/instance.ts +54 -0
package/package.json
CHANGED
package/src/index.ts
CHANGED
package/src/instance.ts
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* One locally-running Axon process, as seen from outside it.
|
|
3
|
+
*
|
|
4
|
+
* Written to `<store>/running/<sessionId>.json` by the runtime at boot and
|
|
5
|
+
* deleted on clean shutdown. The registry answers exactly one question —
|
|
6
|
+
* *what is running right now* — and every field here is either true for the
|
|
7
|
+
* whole life of the process or absent.
|
|
8
|
+
*
|
|
9
|
+
* Two things deliberately do NOT live here:
|
|
10
|
+
*
|
|
11
|
+
* - **History.** A finished run leaves no record; its session log is the
|
|
12
|
+
* durable trace. The registry is derivable from the OS (a pid is either
|
|
13
|
+
* alive or it is not), which is what makes it self-healing after `kill -9`
|
|
14
|
+
* and impossible to disagree with reality.
|
|
15
|
+
* - **Anything that changes mid-run.** `runId` — the per-request id the
|
|
16
|
+
* kernel mints on every wake — belongs on the event envelope, not here: a
|
|
17
|
+
* record written once at boot could only ever hold a stale one. "Which
|
|
18
|
+
* request is this instance serving" is a read of the session tail.
|
|
19
|
+
*/
|
|
20
|
+
export type AxonInstance = {
|
|
21
|
+
/** OS process id. The liveness proof: `kill(pid, 0)` is the whole check. */
|
|
22
|
+
pid: number
|
|
23
|
+
sessionId: string
|
|
24
|
+
/** Registry identity of the agent — "@cody/barry.mk3". */
|
|
25
|
+
agentName: string
|
|
26
|
+
/** Absolute project root the process booted from. */
|
|
27
|
+
projectRoot: string
|
|
28
|
+
/** Resolved absolute data directory — the session log is at `<dataRoot>/sessions/<sessionId>.jsonl`. */
|
|
29
|
+
dataRoot: string
|
|
30
|
+
/** ISO timestamp of boot. */
|
|
31
|
+
startedAt: string
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Live ownership graph. A record with no `parentSessionId` is a
|
|
35
|
+
* user-owned root; anything else was spawned by another instance
|
|
36
|
+
* (`subagent.request`), and readers nest on this rather than rendering
|
|
37
|
+
* every process as a flat sibling.
|
|
38
|
+
*
|
|
39
|
+
* `rootSessionId` and `depth` are denormalised from that chain because
|
|
40
|
+
* the runtime enforces limits against them on every spawn
|
|
41
|
+
* (MAX_LIVE_DESCENDANTS, MAX_DEPTH) and must not walk the graph to do it.
|
|
42
|
+
*/
|
|
43
|
+
parentSessionId?: string | null
|
|
44
|
+
rootSessionId?: string
|
|
45
|
+
depth?: number
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* The work item this run was dispatched against, when it was
|
|
49
|
+
* (`axon run --job`). Correlation only: it changes nothing about the
|
|
50
|
+
* run, and exists so a reader can match a live instance to the work it
|
|
51
|
+
* is answering rather than inferring it from timing.
|
|
52
|
+
*/
|
|
53
|
+
job?: string
|
|
54
|
+
}
|