@arcforge/types 2.0.117 → 2.0.119

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arcforge/types",
3
- "version": "2.0.117",
3
+ "version": "2.0.119",
4
4
  "type": "module",
5
5
  "private": false,
6
6
  "main": "./src/index.ts",
@@ -17,10 +17,10 @@
17
17
  "deploy": "echo \"This package is published ONLY by apps/tui/scripts/release.ts, which pins workspace:* deps to concrete versions first. Publishing it directly ships an unresolvable dependency.\" && exit 1"
18
18
  },
19
19
  "dependencies": {
20
- "h3": "^1.13.0"
20
+ "h3": "^1.13.0",
21
+ "@types/bun": "^1.2.0"
21
22
  },
22
23
  "devDependencies": {
23
- "@types/bun": "latest",
24
24
  "typescript": "^5"
25
25
  }
26
26
  }
package/src/handle.ts CHANGED
@@ -172,6 +172,64 @@ export type AxonHandle = {
172
172
  /** Render a prompt by name. Static .md returns as-is; dynamic .vue renders with props. */
173
173
  prompt(name: string, props?: Record<string, unknown>): Promise<string>
174
174
 
175
+ /**
176
+ * This agent's installed modules, as configured.
177
+ *
178
+ * The door a MODULE PLUGIN reads its own options through. A module's
179
+ * `server/plugins/` is merged into the agent's, so its plugin receives
180
+ * this same handle — but a plugin file has no idea which module shipped
181
+ * it and no way to reach the options the agent wrote for it. Without
182
+ * this, a hardware module could open a device but never be told WHICH
183
+ * device, which is the entire configuration surface of a sensor.
184
+ *
185
+ * ```ts
186
+ * // modules/mouse/server/plugins/mouse.ts
187
+ * const { hz = 20 } = axon.modules.options<{ hz?: number }>("mouse")
188
+ * ```
189
+ *
190
+ * Read-only and already validated against the module's declared
191
+ * `optionsSchema` — a plugin gets what the agent configured or the
192
+ * declared default, never a raw config bag.
193
+ */
194
+ modules: {
195
+ /** Every installed module's name, in declaration order. */
196
+ list(): string[]
197
+ /**
198
+ * Validated options for one module. Empty object when the module is
199
+ * installed and configured nothing; THROWS when no such module is
200
+ * installed, because a plugin asking for options by a name that is
201
+ * not there is a wiring mistake and silence would hide it.
202
+ *
203
+ * Returns the FIRST instance when a module is listed several times.
204
+ * A plugin that can serve multiple devices reads `all()` instead.
205
+ */
206
+ options<T extends Record<string, unknown> = Record<string, unknown>>(name: string): T
207
+ /**
208
+ * Every instance's options, in declaration order.
209
+ *
210
+ * An agent may list one module several times to attach it to several
211
+ * devices — two screens, two cameras, two microphones:
212
+ *
213
+ * ```ts
214
+ * modules: [
215
+ * [Screen, { output: "DP-2" }],
216
+ * [Screen, { output: "DP-0" }],
217
+ * ]
218
+ * ```
219
+ *
220
+ * The module's code is scanned and its plugin runs ONCE; this is how
221
+ * that one run learns it has two devices to open. The platform
222
+ * deliberately invents no identity for the copies — what
223
+ * distinguishes two screens is the output name, and only the module
224
+ * knows that, so it derives its own channels from these options.
225
+ *
226
+ * Always at least one entry for an installed module (an unconfigured
227
+ * instance is `{}`); throws for a module that is not installed, for
228
+ * the same reason `options()` does.
229
+ */
230
+ all<T extends Record<string, unknown> = Record<string, unknown>>(name: string): T[]
231
+ }
232
+
175
233
  /** Prompt enumeration — every prompt the blueprint declares. Rendering stays on `prompt(name)`. */
176
234
  prompts: {
177
235
  list(): AxonPrompt[]
@@ -188,9 +246,11 @@ export type AxonHandle = {
188
246
  * environment reaches cognition.
189
247
  *
190
248
  * ```ts
191
- * axon.stim("cognet:stimulus:field", {
192
- * source: { channel: "light:left" },
193
- * reading: { value: 0.42, unit: "lux" },
249
+ * axon.stim("cognet:stimulus:vector", {
250
+ * channel: "light",
251
+ * values: [0.42, 0.38],
252
+ * unit: "lux",
253
+ * labels: ["left", "right"],
194
254
  * })
195
255
  * ```
196
256
  *
@@ -247,7 +307,7 @@ export type AxonHandle = {
247
307
  // // server/plugins/body.ts — sense, unconditionally
248
308
  // setInterval(async () => {
249
309
  // world.step(dt)
250
- // await axon.stim("cognet:stimulus:field", { ... })
310
+ // await axon.stim("cognet:stimulus:vector", { ... })
251
311
  // }, 16)
252
312
  // ```
253
313
  //
@@ -1,4 +1,4 @@
1
- import type { AxonChunk, StimulusRef } from "./shared"
1
+ import type { AxonChannel, AxonChunk, AxonTextFormat, StimulusRef } from "./shared"
2
2
 
3
3
  /**
4
4
  * Output — the effector protocol. Every fact a cognet emits TO the world
@@ -11,7 +11,7 @@ import type { AxonChunk, StimulusRef } from "./shared"
11
11
  * DESIGN RULES (identical to stimuli.ts, mirrored):
12
12
  *
13
13
  * 1. Top-level types are INFORMATION KINDS, not pipeline stages. A kind
14
- * describes what the data IS (text, audio, visual, a measured value),
14
+ * describes what the data IS (text, audio, visual, a measurement),
15
15
  * never WHEN or HOW a cognet produced it. "Thinking" is deliberately
16
16
  * absent: it never described a data kind — it described a stage in one
17
17
  * specific engine's pipeline (LLM reasoning-before-answer), the same
@@ -40,6 +40,13 @@ import type { AxonChunk, StimulusRef } from "./shared"
40
40
  * stimulushood. These are ordinary log entries; a renderer or
41
41
  * devtools view derives "is this an output?" from the type prefix, the
42
42
  * same way it derives "is this a stimulus?" from stimulus:*.
43
+ *
44
+ * 5. Every emission carries a CHANNEL, mirroring stimuli exactly. Outbound
45
+ * addressing is the same problem as inbound: a cognet writing to
46
+ * /cmd_vel and /speaker is not doing one thing, and an observer that
47
+ * cannot separate them cannot debug either. Required, never defaulted —
48
+ * a fallback channel would silently merge two lines that a mind
49
+ * deliberately kept apart.
43
50
  */
44
51
 
45
52
  // ── The output set ───────────────────────────────────────────────────────────
@@ -51,19 +58,23 @@ import type { AxonChunk, StimulusRef } from "./shared"
51
58
  * text — symbolic language out (an LLM cognet's natural output)
52
59
  * audio — synthesized sound out (a cognet that speaks directly)
53
60
  * visual — an image or clip produced/selected by the cognet
54
- * field — a measured/declared value emitted outward (a fish declaring
55
- * a homeostatic reading, telemetry, a structured status)
61
+ * vector — a measured/declared quantity emitted outward: a motor
62
+ * command, a homeostatic reading, telemetry, a target pose
56
63
  */
57
64
  export type AxonOutputEvent = {
58
65
  /** Symbolic language output. Inline — text IS its own digest. */
59
66
  "cognet:output:text": {
67
+ channel: AxonChannel
60
68
  content: string
69
+ /** how to read it — "json", "markdown"; absent = plain prose */
70
+ format?: AxonTextFormat
61
71
  /** chunking standard (shared.ts) — absent = self-contained complete emission */
62
72
  chunk?: AxonChunk
63
73
  }
64
74
 
65
75
  /** Synthesized or selected audio segment. */
66
76
  "cognet:output:audio": {
77
+ channel: AxonChannel
67
78
  ref: StimulusRef
68
79
  /** symbolic digest — what the emission means without fetching audio */
69
80
  transcript?: string
@@ -74,6 +85,7 @@ export type AxonOutputEvent = {
74
85
 
75
86
  /** An image or clip the cognet produced or selected. */
76
87
  "cognet:output:visual": {
88
+ channel: AxonChannel
77
89
  ref: StimulusRef
78
90
  /** symbolic digest — caption / description */
79
91
  caption?: string
@@ -82,9 +94,28 @@ export type AxonOutputEvent = {
82
94
  chunk?: AxonChunk
83
95
  }
84
96
 
85
- /** A value the cognet declares outward — status, telemetry, a homeostatic reading. */
86
- "cognet:output:field": {
87
- reading: { value: number | string | boolean; unit?: string }
97
+ /**
98
+ * A measurement the cognet declares outward — a motor command, a
99
+ * homeostatic reading, telemetry, a target pose.
100
+ *
101
+ * The exact mirror of the stimulus kind, and for the same reasons: one
102
+ * instrument, one instant, always an array. A wheel-velocity command is
103
+ * `[left, right]` and is one act, not two — the same atomicity argument
104
+ * that applies to sensing applies to acting.
105
+ */
106
+ "cognet:output:vector": {
107
+ channel: AxonChannel
108
+ /** the emission — one sample, one or more components */
109
+ values: number[]
110
+ /** what the numbers are in when every component shares one */
111
+ unit?: string
112
+ /** per-component units, same length as `values` — see the stimulus kind */
113
+ units?: string[]
114
+ /** what each component is, same length as `values` */
115
+ labels?: string[]
116
+ /** the convention these values follow — advisory, never validated */
117
+ profile?: string
118
+ /** for emissions too large to inline */
88
119
  ref?: StimulusRef
89
120
  /** chunking standard (shared.ts) — absent = self-contained complete emission */
90
121
  chunk?: AxonChunk
@@ -5,6 +5,71 @@
5
5
  * depending on the other's internals.
6
6
  */
7
7
 
8
+ /**
9
+ * The address a fact crossed the interface on — inbound or outbound.
10
+ *
11
+ * Open vocabulary, world-defined: "user", "mic0", "/camera/front/image_raw",
12
+ * "email:inbox", "/cmd_vel", "speaker". The TYPE says what kind of
13
+ * information it is; the CHANNEL says which line it arrived on or left by.
14
+ * Together they are the entire addressing scheme, and deliberately the only
15
+ * thing a cognet learns about its interface — a mind knows it received audio
16
+ * on /mic/left, never what hardware sits behind it or who is upstream.
17
+ *
18
+ * This replaced `StimulusSource = { channel, id? }`, a struct named for
19
+ * producer identity that only ever carried an address. The `id` half was
20
+ * declared and never populated by any producer or read by any consumer: a
21
+ * mind has no use for who is speaking that the channel does not already
22
+ * answer, and a participant identity that matters belongs in the payload as
23
+ * content, not in the envelope as routing.
24
+ *
25
+ * Both directions carry one. A robot with two speakers, or a cognet writing
26
+ * to /cmd_vel and /speaker, has the same addressing problem outbound as a
27
+ * ROS network has inbound — a mind emitting to two lines is not doing one
28
+ * thing, and an observer that cannot tell them apart cannot debug either.
29
+ */
30
+ export type AxonChannel = string
31
+
32
+ /**
33
+ * How to read a text payload — the protocol layer for symbols.
34
+ *
35
+ * The mirror of `ref.mime` for audio and visual: those carry opaque bytes
36
+ * and need a decoder named, and text carries readable characters that may
37
+ * still be structured. A cognet handed `{"cmd":"stop"}` should know it is
38
+ * JSON rather than infer it from a leading brace.
39
+ *
40
+ * Open vocabulary, IANA-shaped where one exists. Absent means plain prose,
41
+ * which is what a person speaking or typing produces.
42
+ */
43
+ export type AxonTextFormat = string
44
+
45
+ /**
46
+ * Dense media — held in the session's bounded sensory ring, never in the
47
+ * durable log. Everything not in this set is durable.
48
+ *
49
+ * BOTH DIRECTIONS, because the argument was never about direction. A 30Hz
50
+ * microphone commits ~2.6M entries a day whose bytes nobody will replay,
51
+ * and a cognet that SPEAKS at 30Hz commits exactly as many — an echoing
52
+ * agent measured 1.5MB of log in forty seconds, all of it base64 PCM the
53
+ * record will carry forever. Durability is a property of the KIND, and a
54
+ * kind does not become cheap by being emitted rather than sensed.
55
+ *
56
+ * What stays durable is the symbolic layer: text, field readings, actions,
57
+ * results. That is the useful record — what was said and what was done —
58
+ * and it is unaffected by any of this. The digests travel with it, so an
59
+ * audio emission's transcript and a frame's caption remain in the log
60
+ * permanently even though the samples and pixels do not.
61
+ *
62
+ * The ring is bounded and configurable, and at size 0 this set behaves
63
+ * exactly as a pure transient tier: delivered, observed live, never
64
+ * stored. See SensoryRing in @arcforge/session.
65
+ */
66
+ export const SENSORY_EVENTS = new Set<string>([
67
+ "cognet:stimulus:audio",
68
+ "cognet:stimulus:visual",
69
+ "cognet:output:audio",
70
+ "cognet:output:visual",
71
+ ])
72
+
8
73
  /**
9
74
  * Content-addressed reference to a heavy payload (audio segment, frame,
10
75
  * clip) held OUTSIDE the log — device buffer, blob store, agent home.
@@ -15,6 +15,8 @@
15
15
  * 1. Top-level types are INFORMATION KINDS, not sensors. Symbolic language,
16
16
  * sound, light, measured fields — new hardware maps into an existing
17
17
  * kind (ROS sensor_msgs discipline: the core set outlives every vendor).
18
+ * "Measured quantity" is one kind however many components it has — a
19
+ * thermometer and a nine-axis IMU differ in array length, not in type.
18
20
  * A new top-level type here is a once-per-epoch event, like a syscall.
19
21
  *
20
22
  * 2. Heavy payloads NEVER cross this protocol. A stimulus is a small fact: a
@@ -40,21 +42,8 @@
40
42
  */
41
43
 
42
44
  import type { AxonEventUnion } from "../../envelope"
43
- import type { StimulusRef } from "./shared"
44
-
45
- // ── Shared shapes ─────────────────────────────────────────────────────────────
46
-
47
- /**
48
- * Where a stimulus came from. `channel` identifies the concrete source
49
- * ("user", "email:inbox", "mic0", "cam:front", "telemetry:battery") —
50
- * open vocabulary, agent-defined. The TYPE says what kind of information
51
- * it is; the source says where it entered.
52
- */
53
- export type StimulusSource = {
54
- channel: string
55
- /** stable id when the source is a session participant (user id, device id) */
56
- id?: string
57
- }
45
+ import { SENSORY_EVENTS } from "./shared"
46
+ import type { AxonChannel, AxonTextFormat, StimulusRef } from "./shared"
58
47
 
59
48
  // ── The sense set ─────────────────────────────────────────────────────────────
60
49
 
@@ -65,20 +54,24 @@ export type StimulusSource = {
65
54
  * text — symbolic language (native modality of an LLM)
66
55
  * audio — sound over time (speech, ambient) — digest is the transcript
67
56
  * visual — light: frames and clips — digest is the caption/percept
68
- * field — measured quantities over time: touch, heat, pose, battery,
69
- * GPS, market prices, autopilot telemetry. One type, open
70
- * channel vocabulary — this is what stops sense-set sprawl.
57
+ * vector — measured quantities: touch, heat, pose, battery, joint
58
+ * angles, an IMU, a lidar scan. One kind, always an array,
59
+ * open channel vocabulary — this is what stops sense-set
60
+ * sprawl, because a new sensor is new NUMBERS, never a new
61
+ * kind.
71
62
  */
72
63
  export type AxonStimulusEvent = {
73
64
  /** Symbolic language input. Inline — text IS its own digest. */
74
65
  "cognet:stimulus:text": {
75
- source: StimulusSource
66
+ channel: AxonChannel
76
67
  content: string
68
+ /** how to read it — "json", "markdown"; absent = plain prose */
69
+ format?: AxonTextFormat
77
70
  }
78
71
 
79
72
  /** An audio segment. Bytes stay behind `ref`; `transcript` is an optional inline digest. */
80
73
  "cognet:stimulus:audio": {
81
- source: StimulusSource
74
+ channel: AxonChannel
82
75
  ref: StimulusRef
83
76
  /** inline digest, when the producer already had one — never a summary it computed */
84
77
  transcript?: string
@@ -87,7 +80,7 @@ export type AxonStimulusEvent = {
87
80
 
88
81
  /** A frame or clip. Bytes stay behind `ref`; `caption` is an optional inline digest. */
89
82
  "cognet:stimulus:visual": {
90
- source: StimulusSource
83
+ channel: AxonChannel
91
84
  ref: StimulusRef
92
85
  /** inline digest, when the producer already had one — never a summary it computed */
93
86
  caption?: string
@@ -95,18 +88,83 @@ export type AxonStimulusEvent = {
95
88
  }
96
89
 
97
90
  /**
98
- * A reading from a measured field — touch, heat, pose, battery, light,
99
- * price. The reading is inline (small by nature); `ref` optionally points
100
- * at a surrounding raw window.
91
+ * A measurement — one instrument, one instant, one to many numbers.
92
+ *
93
+ * Touch, heat, pose, battery, joint angles, an IMU, a mouse position, a
94
+ * lidar scan. Everything the world reports as quantity rather than as
95
+ * sound, light, or language.
96
+ *
97
+ * ALWAYS AN ARRAY, even for a thermometer. A scalar is a vector of
98
+ * length one, and admitting both shapes would put
99
+ * `Array.isArray(v) ? v : [v]` at the top of every renderer, every fold,
100
+ * and every bridge forever. The boundary is also unstable in the
101
+ * direction real systems travel: one GPU's temperature is one number
102
+ * until a second GPU arrives, and under a union that is a silent shape
103
+ * change nobody validated. One shape, always.
104
+ *
105
+ * THE VALUES ARE ONE SAMPLE. Nine core temperatures read at one instant
106
+ * belong together, and nine separate stimuli could never say so — the
107
+ * mind would be left to guess which readings were simultaneous. This is
108
+ * the whole reason the kind is a vector rather than a scalar: atomicity
109
+ * is a property of the measurement, and only the instrument knows it.
101
110
  *
102
111
  * Deliberately carries no judgment about why the reading was sent. A
103
112
  * producer emits what it measured; deciding which readings matter is the
104
113
  * cognet's, and only the cognet's.
105
114
  */
106
- "cognet:stimulus:field": {
107
- source: StimulusSource
108
- /** the measurement, unit-tagged, e.g. { value: 87, unit: "%" } */
109
- reading: { value: number | string | boolean; unit?: string }
115
+ "cognet:stimulus:vector": {
116
+ channel: AxonChannel
117
+ /** the measurement — one sample, one or more components */
118
+ values: number[]
119
+ /** what the numbers are in when every component shares one, e.g. "°C", "m/s²", "px" */
120
+ unit?: string
121
+ /**
122
+ * Per-component units, same length as `values` — for readings whose
123
+ * components genuinely differ.
124
+ *
125
+ * Not an edge case: it is the norm the moment you leave a
126
+ * single-quantity instrument. A joint reports position in rad,
127
+ * velocity in rad/s, and effort in Nm. An IMU is m/s² and rad/s. A
128
+ * force/torque sensor is N and Nm. A GPS is degrees and metres.
129
+ *
130
+ * The alternative — one channel per unit — would split a
131
+ * measurement that the instrument took as one sample, which is the
132
+ * atomicity this kind exists to preserve. Folding the unit into the
133
+ * label ("position (rad)") makes labels unparseable and mixes
134
+ * presentation into data.
135
+ *
136
+ * `unit` stays for the common uniform case; a reading uses one or
137
+ * the other, never both.
138
+ */
139
+ units?: string[]
140
+ /**
141
+ * What each component is, same length as `values` —
142
+ * ["Package","Core 0",…] or ["x","y"] or ["roll","pitch","yaw"].
143
+ *
144
+ * Carried because the instrument already knows it. Without it a
145
+ * nine-vector is nine anonymous numbers and every consumer
146
+ * re-derives the meaning from the channel name, which is the
147
+ * second-source-of-truth pattern this protocol refuses everywhere
148
+ * else.
149
+ */
150
+ labels?: string[]
151
+ /**
152
+ * The convention these values follow — "imu", "pose2d",
153
+ * "mouse.position". Advisory: the runtime never validates or reads
154
+ * it. It is a JOIN KEY, so a cognet written against `imu` works with
155
+ * any body that declares one, and a ROS bridge can carry
156
+ * `sensor_msgs/Imu` across without the meaning being lost.
157
+ *
158
+ * Optional because `unit` and `labels` are usually enough. A new
159
+ * sensor convention is a new string, never a protocol change — which
160
+ * is what keeps this kind set closed.
161
+ */
162
+ profile?: string
163
+ /**
164
+ * For readings too large to inline — a point cloud is 50,000 × 3
165
+ * numbers. Same size rule audio and visual already use, so a reading
166
+ * outgrowing JSON is never a change of kind.
167
+ */
110
168
  ref?: StimulusRef
111
169
  }
112
170
  }
@@ -114,33 +172,21 @@ export type AxonStimulusEvent = {
114
172
  export type AxonStimulusType = keyof AxonStimulusEvent
115
173
 
116
174
  /**
117
- * Dense sense streams — delivered to the cognet, never written to the log.
118
- * Everything not in this set is durable.
119
- *
120
- * A stimulus is a SENSATION, and the protocol has always described it as one:
121
- * delivered once, then gone, with no second chance to attend to it. The
122
- * delivery queue was already built that way (drain-and-forget, no history) —
123
- * but ingest() committed every stimulus first, so the runtime kept a
124
- * permanent record of exactly the thing it told cognets was transient.
125
- *
126
- * That is affordable for text and sparse field readings, and impossible for
127
- * a live sensor. A 30Hz microphone commits ~2.6M entries a day whose bytes
128
- * nobody will ever replay; the useful record is what the mind DID with them
129
- * — its outputs and actions — which stays durable and is unaffected.
175
+ * The inbound half of SENSORY_EVENTS (shared.ts), which is the one
176
+ * definition — sensory-tier is a property of the KIND and does not differ
177
+ * by direction.
130
178
  *
131
- * Durability is a property of the KIND, not a runtime mode, for the same
132
- * reason CAPSULE_TRANSIENT_EVENTS is: whether a sensation is worth
133
- * remembering follows from what it is. Text is what someone said and belongs
134
- * in the record. Frames are what a retina saw.
179
+ * Kept as a named export because the delivery path is stimulus-only: the
180
+ * scheduler asks "is this sensation transient" about things it is handing
181
+ * to a cognet, and can never be handed an output.
135
182
  *
136
183
  * A cognet that needs a frame beyond the tick it arrived in keeps it in its
137
184
  * own resident state — which is what an organism does, and what the runtime
138
185
  * must not do on its behalf.
139
186
  */
140
- export const STIMULUS_TRANSIENT_EVENTS = new Set<AxonStimulusType>([
141
- "cognet:stimulus:audio",
142
- "cognet:stimulus:visual",
143
- ])
187
+ export const STIMULUS_TRANSIENT_EVENTS = new Set<AxonStimulusType>(
188
+ [...SENSORY_EVENTS].filter((type): type is AxonStimulusType => type.startsWith("cognet:stimulus:")),
189
+ )
144
190
 
145
191
  /**
146
192
  * One enveloped stimulus — the shape CognetWake.stimuli actually delivers.
@@ -16,10 +16,10 @@ export type { AxonEngineEvent } from "./events/engine"
16
16
  export type { AxonEntryEvent } from "./events/entries"
17
17
  export { ENTRY_EVENT_PREFIXES } from "./events/entries"
18
18
  export { isKernelEvent, isEntryEvent, classifyEvent, type AxonEventView } from "./classify"
19
- export type { AxonStimulusEntry, AxonStimulusEvent, AxonStimulusType, StimulusSource } from "./events/stdio/stimuli"
19
+ export type { AxonStimulusEntry, AxonStimulusEvent, AxonStimulusType } from "./events/stdio/stimuli"
20
20
  export { STIMULUS_TRANSIENT_EVENTS } from "./events/stdio/stimuli"
21
21
  export type { AxonOutputEvent, AxonOutputType } from "./events/stdio/output"
22
- export type { AxonChunk, StimulusRef } from "./events/stdio/shared"
22
+ export type { AxonChannel, AxonChunk, AxonTextFormat, StimulusRef } from "./events/stdio/shared"
23
23
  export type { AxonLogEvents } from "./events/log"
24
24
  export { LOG_EVENT_SUFFIXES, isLogEventType } from "./events/log"
25
25
  export type { AxonSpan, AxonInterrupted, AxonCancellableSpan } from "./events/span"
@@ -1,5 +1,20 @@
1
+ // The compiler options every Axon project kind inherits, resolved out of the
2
+ // project's own node_modules (see platform/build/project/typegen/tsconfig.ts).
1
3
  {
2
4
  "compilerOptions": {
5
+ // Axon projects are Bun runtime end to end — agents call Bun.file,
6
+ // Bun.spawn and bun:test — so the globals are part of the baseline,
7
+ // not something each author wires up. Naming "bun" here is only half
8
+ // of it: an explicit `types` field disables automatic @types
9
+ // inclusion, so @types/bun is a real DEPENDENCY of this package
10
+ // rather than a devDependency. The package that makes the claim is
11
+ // the one that guarantees it resolves, and every kind that installs
12
+ // already pins @arcforge/types — so this reaches projects
13
+ // transitively, including ones scaffolded before it existed.
14
+ //
15
+ // The one frame that must NOT copy this is the standalone frame for
16
+ // prompt packages: they install nothing, so "bun" would name a
17
+ // package provably absent from disk and degrade every symbol to any.
3
18
  "target": "ESNext",
4
19
  "module": "ESNext",
5
20
  "moduleResolution": "bundler",
@@ -7,6 +22,7 @@
7
22
  "strict": true,
8
23
  "noUncheckedIndexedAccess": true,
9
24
  "lib": ["ESNext"],
25
+ "types": ["bun"],
10
26
  "skipLibCheck": true,
11
27
  "allowImportingTsExtensions": true,
12
28
  "noEmit": true