@arcforge/types 2.0.153 → 2.0.154

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.153",
3
+ "version": "2.0.154",
4
4
  "type": "module",
5
5
  "private": false,
6
6
  "main": "./src/index.ts",
package/src/config.ts CHANGED
@@ -110,6 +110,34 @@ export type AxonConfig<EventMap extends Record<string, unknown> = Record<string,
110
110
  */
111
111
  providers?: ProviderEntry[]
112
112
 
113
+ /**
114
+ * @deprecated Removed — use `model:` for a pin, `providers:` for sources.
115
+ *
116
+ * ```ts
117
+ * engine: Codex({ model: "gpt-5.6-terra" }) // before
118
+ * model: "codex:gpt-5.6-terra" // after
119
+ * ```
120
+ *
121
+ * This field named ONE model for the whole agent. It could not survive a
122
+ * cognet declaring several roles, and it put the choice in the wrong
123
+ * place besides — which model to use is the user's, expressed once on
124
+ * their profile, while an agent only says what sources it needs beyond
125
+ * what they already have.
126
+ *
127
+ * Typed as `never` rather than deleted outright. Deleting it made an
128
+ * `engine:` key an ordinary excess property that TypeScript accepted on
129
+ * any non-literal path and the runtime then silently ignored — so an
130
+ * agent kept booting, on whatever the profile pool ranked first, while
131
+ * its config still said otherwise. A dead field that reads as honoured is
132
+ * worse than a missing one. Declaring it `never` makes every assignment a
133
+ * compile error that names the replacement, and `Config()` refuses the
134
+ * key at load for anything that reaches the runtime untypechecked.
135
+ *
136
+ * Remove after the deprecation window, once no published agent carries
137
+ * it.
138
+ */
139
+ engine?: never
140
+
113
141
  /**
114
142
  * Cognet selection — which brain this agent runs.
115
143
  *
package/src/define.ts CHANGED
@@ -25,7 +25,7 @@ export type AgentDefinition<EventMap extends Record<string, unknown> = Record<st
25
25
  *
26
26
  * export default defineAgent({
27
27
  * description: "Reviews incoming pull requests",
28
- * engine: Axon({ model: "claude-sonnet-4-6" }),
28
+ * providers: [Axon()],
29
29
  * policy: {
30
30
  * fs: { read: ["./src/**"], write: ["./reports/**"] },
31
31
  * network: { allow: ["api.github.com"] },
package/src/engine.ts CHANGED
@@ -7,15 +7,13 @@ import { AxonEngineEvent } from "./session/events/engine"
7
7
  * resolved to a live driver by the runtime's Engine() manager — the one
8
8
  * seam every boot path shares — via @arcforge/engines' resolveEngine().
9
9
  *
10
- * ```ts
11
- * export default defineAgent({
12
- * engine: { provider: "axon", model: "claude-sonnet-4-6" },
13
- * // or, for advanced wiring:
14
- * // engine: Axon({ model: "claude-sonnet-4-6", url: "ws://localhost:8787" }),
15
- * })
16
- * ```
10
+ * NOT an `axon.config.ts` field. `engine:` is deprecated there — an agent
11
+ * declares `providers:` (sources) and `model:` (a cortex preference), and
12
+ * resolution picks a driver per role from that pool. This type is the
13
+ * INTERNAL shape a resolved driver is built from, which is why it still
14
+ * exists and why nothing user-facing should reference it.
17
15
  *
18
- * @see https://axon.arclabs.it/docs/v2/api/config/engine
16
+ * @see https://axon.arclabs.it/docs/v2/agent/config
19
17
  */
20
18
  export type EngineConfig = AxonEngineDef | EngineRef
21
19
 
package/src/index.ts CHANGED
@@ -6,6 +6,7 @@ export * from "./deploy"
6
6
  export * from "./engine"
7
7
  export * from "./inference"
8
8
  export * from "./error"
9
+ export * from "./report"
9
10
  export * from "./http"
10
11
  export * from "./instance"
11
12
  export * from "./handle"
package/src/report.ts ADDED
@@ -0,0 +1,85 @@
1
+ /**
2
+ * The crash-report wire contract.
3
+ *
4
+ * One payload shape, posted by every side of the platform to
5
+ * POST /api/reports. Lives here because three independent packages
6
+ * construct it — @arclabs/cloud (HTTP failures), @axon/err (runtime
7
+ * failures), and the backend's own 5xx handler — and a contract owned by
8
+ * any one of them would make the other two depend on a transport.
9
+ *
10
+ * This is NOT a trace or a span. There is no parent, no tree, no duration.
11
+ * A report says "this failed, here is enough to debug it" and nothing more —
12
+ * the deliberate opposite of the event pipeline this replaced.
13
+ */
14
+
15
+ /** Which side of the platform produced a report. */
16
+ export type ReportSource = "cloud" | "runtime" | "backend"
17
+
18
+ /**
19
+ * One occurrence, as sent over the wire.
20
+ *
21
+ * The server derives the grouping fingerprint from this — clients never send
22
+ * one. Fingerprinting is a server concern because it decides what counts as
23
+ * "the same failure", and a client that computed its own could split a group
24
+ * simply by shipping a different version of the hashing code.
25
+ */
26
+ export type ErrorReport = {
27
+ source: ReportSource
28
+
29
+ /**
30
+ * errorMap code (e.g. "AX-BOOT-001") when the failure went through err().
31
+ * Absent for raw HTTP and network failures, which never had one — that
32
+ * absence is meaningful and must not be filled with a placeholder.
33
+ */
34
+ code?: string
35
+
36
+ /** Short headline. The map's title, or a summary of the HTTP failure. */
37
+ message: string
38
+
39
+ severity?: "error" | "fatal"
40
+
41
+ /**
42
+ * The release this occurred on. Without it a group cannot distinguish
43
+ * "fixed two versions ago" from "still happening on HEAD", which is the
44
+ * first question an operator asks.
45
+ */
46
+ release?: string
47
+
48
+ /** Coarse runtime descriptor, e.g. "bun-1.1/linux". Never a hostname or a username. */
49
+ platform?: string
50
+
51
+ stack?: string
52
+
53
+ /**
54
+ * Structured frames when the source has them (err() captures these).
55
+ * Preferred over `stack` for fingerprinting: a parsed frame survives
56
+ * minification and path differences that break naive stack-string hashing.
57
+ */
58
+ frames?: ReportFrame[]
59
+
60
+ /**
61
+ * Caller-supplied detail. SCRUBBED BEFORE SENDING — see scrubContext()
62
+ * in @arclabs/cloud. This is the one field that can carry user data
63
+ * (paths, prompt text, agent names), so it is the one field that must
64
+ * never be forwarded raw.
65
+ */
66
+ context?: Record<string, unknown>
67
+
68
+ /** Flattened cause chain, outermost first. */
69
+ cause?: string
70
+ }
71
+
72
+ /** A stack frame, reduced to what fingerprinting and display need. */
73
+ export type ReportFrame = {
74
+ functionName: string | null
75
+ fileName: string | null
76
+ lineNumber: number | null
77
+ }
78
+
79
+ /** What POST /api/reports answers. */
80
+ export type ErrorReportAck = {
81
+ /** The group this occurrence landed in. */
82
+ fingerprint: string
83
+ /** How many times this group has now been seen. */
84
+ occurrences: number
85
+ }