@frondruntime/devtools 0.3.0 → 0.5.0

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/CHANGELOG.md CHANGED
@@ -1,11 +1,51 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.5.0](https://github.com/frondruntime/frond/compare/devtools-v0.4.0...devtools-v0.5.0) (2026-10-22)
4
+
5
+
6
+ ### ⚠ BREAKING CHANGES
7
+
8
+ * report message, name, fingerprint, tags, and contexts change shape; createRuntimeEventReports returns [] for non-reportable records; dependency-caused failures no longer produce their own reports.
9
+
10
+ ### Features
11
+
12
+ * report errors by failing node, once at the source ([#24](https://github.com/frondruntime/frond/issues/24)) ([b98e22e](https://github.com/frondruntime/frond/commit/b98e22eec5717dff958920935bf741f02cf5416c))
13
+
14
+
15
+ ### Dependencies
16
+
17
+ * The following workspace dependencies were updated
18
+ * devDependencies
19
+ * @frondruntime/core bumped to 0.5.0
20
+ * peerDependencies
21
+ * @frondruntime/core bumped from 0.4.0 to 0.5.0
22
+
23
+ ## [0.4.0](https://github.com/frondruntime/frond/compare/devtools-v0.3.0...devtools-v0.4.0) (2026-08-02)
24
+
25
+
26
+ ### ⚠ BREAKING CHANGES
27
+
28
+ * apps on this release require @frondruntime/hub at the matching version. A 0.3.x hub refuses the attachment with a message naming both versions, rather than accepting it and silently dropping the stream.
29
+
30
+ ### Features
31
+
32
+ * typed signal lane, hub protocol 2, and the lint gate ([#18](https://github.com/frondruntime/frond/issues/18)) ([7363e4e](https://github.com/frondruntime/frond/commit/7363e4e2c1ecc81ac140fff563289d97891cd34b))
33
+
34
+
35
+ ### Dependencies
36
+
37
+ * The following workspace dependencies were updated
38
+ * devDependencies
39
+ * @frondruntime/core bumped to 0.4.0
40
+ * peerDependencies
41
+ * @frondruntime/core bumped from 0.3.0 to 0.4.0
42
+
3
43
  ## [0.3.0](https://github.com/frondruntime/frond/compare/devtools-v0.2.0...devtools-v0.3.0) (2026-07-28)
4
44
 
5
45
 
6
46
  ### ⚠ BREAKING CHANGES
7
47
 
8
- * **devtools:** `EncodedNodeSnapshot` drops `label` and `key`, so `HUB_PROTOCOL_VERSION` moves to 3. `label` was a presentation formatting of `tag` and `key` is already embedded in `nodeId`; both were duplicated on every row of a graph read. `kind` stays — "node" versus "resource" is not recoverable from either and decides whether release semantics apply.
48
+ * **devtools:** `EncodedNodeSnapshot` drops `label` and `key`. `label` was a presentation formatting of `tag` and `key` is already embedded in `nodeId`; both were duplicated on every row of a graph read. `kind` stays — "node" versus "resource" is not recoverable from either and decides whether release semantics apply. **`HUB_PROTOCOL_VERSION` ships at 1**, not 3: the development history moved it to 2 and then 3 before this package existed on npm, and it was reset before release so the number counts published generations. Nothing outside this repo ever spoke 2 or 3.
9
49
 
10
50
  ### Features
11
51
 
package/README.md CHANGED
@@ -48,6 +48,8 @@ Opt into `"full"` per app, deliberately. The runtimes worth debugging are the on
48
48
 
49
49
  `"none"` is its own encoder rather than a stricter `"shape"`, because a key list is itself a description of app data — an app that said it would send none should not be sending the key names of every node in a graph snapshot.
50
50
 
51
+ What every policy still sends is how a record is addressed: its tag, its `nodeIds`, and — on a signal — its channel and event name. Those are the filters `frond_read_events` takes, so withholding them would leave a feed that cannot be narrowed to the thing you are looking for, and they are authored as constants beside the publishing code rather than derived from data. The payload is the value, and at `"none"` the payload is what goes.
52
+
51
53
  At `"shape"` the descriptors are strings rather than JSON objects, because this feed is read by an agent through MCP and a node result rendered as forty lines of pretty-printed JSON that contain no data is worse than one rendered as `{id,name}`. Numbers, booleans, and strings up to 256 characters still cross verbatim: in a runtime event those are ids, tags, timestamps, and flags, which is the entire signal. Anything structured is a descriptor, because a node result or an action input is always an object or an array. A class instance gives up only its type — `AccountModel{?}` — and `_tag` is the one nested field that survives, since a failure feed that says `{_tag,nodeId}` instead of `GraphNodeAcquireFailed` is not worth reading.
52
54
 
53
55
  Every bound at `"full"` announces itself in the output: `{"_": "elided", "by": "depth"}` — or `"budget"`, or `"entries"` — where the walk stopped, and a `{"_": "string"}` descriptor carrying `length` and `head` where a string was cut. A cap a reader cannot see is worse than a low one, because it turns "there was more" into "that was all". Markers stay objects under a `_` key at this policy, where the values around them are real data and a marker has to remain distinguishable from one.
@@ -96,6 +98,34 @@ The attach socket is unauthenticated by design — it only carries data *into* t
96
98
 
97
99
  The main entry imports nothing from `node:`. The transport is a global `WebSocket` carrying ndjson, so the same build attaches from a browser, from Bun, from Node, and from React Native.
98
100
 
101
+ ### React Native
102
+
103
+ Nothing to install: this package uses no global beyond `WebSocket`, so there is no `crypto` polyfill to add and no Node shim to configure.
104
+
105
+ What does differ is the address. **The default is loopback, and loopback means something different on each target.**
106
+
107
+ | Target | What to do |
108
+ | -------------------------- | ------------------------------------------------------------------------------------------ |
109
+ | iOS Simulator | Nothing. It shares the host's network stack, so `ws://127.0.0.1:17391/attach` is the hub. |
110
+ | Android emulator | `adb reverse tcp:17391 tcp:17391` on the host, then the default URL works unchanged. |
111
+ | Android emulator, no `adb` | Start the hub with `--host 0.0.0.0` and pass `url: "ws://10.0.2.2:17391/attach"`. |
112
+ | Physical device | Start the hub with `--host 0.0.0.0` and pass `url: "ws://<host-lan-ip>:17391/attach"`. |
113
+
114
+ `adb reverse` is the better of the two Android options: it tunnels the port to the emulator over the existing debug bridge, so the hub stays on loopback and the app keeps the default URL. `10.0.2.2` is the emulator's alias for the host, and reaching it means the hub has to be listening on every interface.
115
+
116
+ **`--host 0.0.0.0` puts an unauthenticated socket on your local network.** The hub has no notion of who is on the other end, in either direction: anything that can reach the port can push records into the dashboard an agent then reads, and can ask attached apps for graph snapshots up to whatever ceiling they declared. On a trusted network, for a development build, that is the trade; do not leave it bound that way, and do not do it at all with an app whose ceiling is `"full"`.
117
+
118
+ ### Testing
119
+
120
+ Attaching from a Jest suite reaches Effect's RPC layer, which pulls in `msgpackr` — an ESM-only package that Jest's default CJS transform cannot load, and one this package does not choose: it is a dependency of `effect` itself, so no serialization setting here avoids it. Either run the suite as ESM, or let Jest transform it:
121
+
122
+ ```js
123
+ // jest.config.js
124
+ transformIgnorePatterns: ["node_modules/(?!(msgpackr|msgpackr-extract)/)"];
125
+ ```
126
+
127
+ The narrower fix is not to attach in tests at all. `attachDevtools` exists to watch a process you are working on by hand; a test run has no hub to dial and nothing to watch.
128
+
99
129
  Filesystem discovery lives behind its own export, so a browser bundler never has to resolve it:
100
130
 
101
131
  ```ts
@@ -0,0 +1,169 @@
1
+ // src/protocol.ts
2
+ import { Schema } from "effect";
3
+ import { Rpc, RpcGroup } from "effect/rpc";
4
+ var HUB_PROTOCOL_VERSION2 = 2;
5
+ var HUB_DEFAULT_PORT2 = 17391;
6
+ var HUB_DEFAULT_HOST2 = "127.0.0.1";
7
+ var HUB_ATTACH_PATH2 = "/attach";
8
+ var HUB_DEFAULT_ATTACH_URL2 = `ws://${HUB_DEFAULT_HOST2}:${HUB_DEFAULT_PORT2}${HUB_ATTACH_PATH2}`;
9
+ var ValuePolicy2 = Schema.Literals(["none", "shape", "full"]);
10
+ var RuntimeEventCategory2 = Schema.Literals([
11
+ "command",
12
+ "diagnostic",
13
+ "input",
14
+ "lifecycle",
15
+ "operation",
16
+ "signal",
17
+ "state"
18
+ ]);
19
+ var RuntimeEventSeverity2 = Schema.Literals(["debug", "error", "info", "warning"]);
20
+ var RuntimeEventTimeline2 = Schema.Literals(["live", "state", "system", "work"]);
21
+ var RuntimeWorkSource2 = Schema.Literals([
22
+ "react",
23
+ "mobx",
24
+ "node",
25
+ "manual",
26
+ "devtools",
27
+ "runtime",
28
+ "signal",
29
+ "test"
30
+ ]);
31
+ var RuntimeWorkReason2 = Schema.Literals([
32
+ "start",
33
+ "stop",
34
+ "readiness",
35
+ "retry",
36
+ "preload",
37
+ "refresh",
38
+ "action",
39
+ "args-update",
40
+ "live",
41
+ "release",
42
+ "eviction",
43
+ "unsafe-update",
44
+ "input",
45
+ "signal"
46
+ ]);
47
+ var RuntimeWorkPriority2 = Schema.Literals(["blocking", "visible", "background", "idle"]);
48
+ var AttachmentInfo2 = Schema.Struct({
49
+ protocolVersion: Schema.Number,
50
+ instanceId: Schema.String,
51
+ runtimeId: Schema.String,
52
+ generation: Schema.Number,
53
+ name: Schema.String,
54
+ platform: Schema.String,
55
+ startedAt: Schema.Number,
56
+ values: ValuePolicy2
57
+ });
58
+ var EncodedEventRecord2 = Schema.Struct({
59
+ sequence: Schema.Number,
60
+ recordedAt: Schema.Number,
61
+ tag: Schema.String,
62
+ category: RuntimeEventCategory2,
63
+ severity: RuntimeEventSeverity2,
64
+ timeline: RuntimeEventTimeline2,
65
+ reportable: Schema.Boolean,
66
+ workId: Schema.Number,
67
+ parentWorkId: Schema.optional(Schema.Number),
68
+ source: RuntimeWorkSource2,
69
+ reason: RuntimeWorkReason2,
70
+ priority: RuntimeWorkPriority2,
71
+ nodeIds: Schema.Array(Schema.String),
72
+ channel: Schema.optionalKey(Schema.String),
73
+ name: Schema.optionalKey(Schema.String),
74
+ fields: Schema.Record(Schema.String, Schema.Unknown),
75
+ failures: Schema.Array(Schema.Unknown)
76
+ });
77
+ var EncodedNodeSnapshot2 = Schema.Struct({
78
+ nodeId: Schema.String,
79
+ tag: Schema.String,
80
+ kind: Schema.String,
81
+ state: Schema.String,
82
+ revision: Schema.Number,
83
+ status: Schema.Unknown,
84
+ liveDemand: Schema.Unknown,
85
+ operation: Schema.Unknown,
86
+ resultValidity: Schema.optional(Schema.Unknown),
87
+ failure: Schema.optional(Schema.Unknown),
88
+ operationFailure: Schema.optional(Schema.Unknown),
89
+ liveFailure: Schema.optional(Schema.Unknown),
90
+ result: Schema.optional(Schema.Unknown)
91
+ });
92
+ var EncodedGraphEdge2 = Schema.Struct({
93
+ from: Schema.String,
94
+ to: Schema.String,
95
+ dependency: Schema.String
96
+ });
97
+ var GraphSnapshot2 = Schema.Struct({
98
+ capturedAt: Schema.Number,
99
+ sequence: Schema.optional(Schema.Number),
100
+ runtimeId: Schema.String,
101
+ runtimeStatus: Schema.String,
102
+ graphStatus: Schema.String,
103
+ observedInputs: Schema.Number,
104
+ values: ValuePolicy2,
105
+ nodes: Schema.Array(EncodedNodeSnapshot2),
106
+ edges: Schema.Array(EncodedGraphEdge2)
107
+ });
108
+ var GraphQuery2 = Schema.Struct({ _tag: Schema.tag("Graph") });
109
+ var NodeQuery2 = Schema.Struct({
110
+ _tag: Schema.tag("Node"),
111
+ nodeId: Schema.String
112
+ });
113
+ var StateQuery2 = Schema.Union([GraphQuery2, NodeQuery2]);
114
+ var QueryOutcome2 = Schema.Union([
115
+ Schema.Struct({ _tag: Schema.tag("Snapshot"), snapshot: GraphSnapshot2 }),
116
+ Schema.Struct({ _tag: Schema.tag("Failed"), reason: Schema.String })
117
+ ]);
118
+ var HubAttached2 = Schema.Struct({
119
+ _tag: Schema.tag("Attached"),
120
+ attachmentId: Schema.String,
121
+ values: ValuePolicy2
122
+ });
123
+ var HubPing2 = Schema.Struct({
124
+ _tag: Schema.tag("Ping"),
125
+ at: Schema.Number
126
+ });
127
+ var HubQuery2 = Schema.Struct({
128
+ _tag: Schema.tag("Query"),
129
+ requestId: Schema.String,
130
+ query: StateQuery2,
131
+ values: ValuePolicy2
132
+ });
133
+ var HubCommand2 = Schema.Union([HubAttached2, HubPing2, HubQuery2]);
134
+
135
+ class HubRejection2 extends Schema.TaggedError()("HubRejection", {
136
+ reason: Schema.String
137
+ }) {
138
+ }
139
+
140
+ class Attach2 extends Rpc.make("Frond.Attach", {
141
+ payload: { info: AttachmentInfo2 },
142
+ success: HubCommand2,
143
+ error: HubRejection2,
144
+ stream: true
145
+ }) {
146
+ }
147
+
148
+ class Ingest2 extends Rpc.make("Frond.Ingest", {
149
+ payload: {
150
+ attachmentId: Schema.String,
151
+ records: Schema.Array(EncodedEventRecord2),
152
+ droppedSince: Schema.Number
153
+ }
154
+ }) {
155
+ }
156
+
157
+ class Reply2 extends Rpc.make("Frond.Reply", {
158
+ payload: {
159
+ attachmentId: Schema.String,
160
+ requestId: Schema.String,
161
+ outcome: QueryOutcome2
162
+ }
163
+ }) {
164
+ }
165
+ var FrondHubRpcs2 = RpcGroup.make(Attach2, Ingest2, Reply2);
166
+
167
+ export { HUB_PROTOCOL_VERSION2, HUB_DEFAULT_PORT2, HUB_DEFAULT_HOST2, HUB_ATTACH_PATH2, HUB_DEFAULT_ATTACH_URL2, ValuePolicy2, RuntimeEventCategory2, RuntimeEventSeverity2, RuntimeEventTimeline2, RuntimeWorkSource2, RuntimeWorkReason2, RuntimeWorkPriority2, AttachmentInfo2, EncodedEventRecord2, EncodedNodeSnapshot2, EncodedGraphEdge2, GraphSnapshot2, GraphQuery2, NodeQuery2, StateQuery2, QueryOutcome2, HubAttached2, HubPing2, HubQuery2, HubCommand2, HubRejection2, Attach2, Ingest2, Reply2, FrondHubRpcs2 };
168
+
169
+ //# debugId=D15BC16ECFF7952164756E2164756E21
@@ -0,0 +1,10 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/protocol.ts"],
4
+ "sourcesContent": [
5
+ "import { Schema } from \"effect\";\nimport { Rpc, RpcGroup } from \"effect/rpc\";\n\n/**\n * Wire contract between an attached Frond runtime and the hub.\n *\n * Direction of the RPC roles is deliberate and inverted from who dials: the\n * hub listens and is the RPC *server*, the app dials out and is the RPC\n * *client*. That keeps the app free of any listening socket, and it is the only\n * arrangement both `RpcServer.layerHttp` and `RpcClient.layerProtocolSocket`\n * support without a hand-written socket adapter on either side.\n *\n * Hub-to-app work (state reads, and later refresh and action invocation)\n * therefore does not travel as a plain RPC call. It rides the `Attach` response\n * stream as a `Query` command, and the app answers with a separate unary\n * `Reply` correlated by `requestId`. `Attach` is the only long-lived call.\n *\n * Version equality is exact, on both sides, and there is no capability\n * negotiation. That is a deliberate choice rather than an omission: `HubCommand`\n * is a schema union, so an app one version behind would fail to decode a command\n * it has never heard of and drop its socket — presenting as \"the runtime stopped\n * emitting\", which is the most expensive way this can fail. Refusing the\n * attachment outright says the same thing immediately and in words.\n *\n * The number counts published generations of *this contract*, and moves on its\n * own schedule — it is not derived from, and does not track, the npm version of\n * any package. Tying the two was the earlier arrangement and it was wrong in\n * both directions: a release that touched nothing on the wire still moved the\n * number and refused every app that had not upgraded, while a genuine schema\n * change inside one release moved nothing and let two builds that disagreed\n * attach to each other. Starting at 1 with the first published hub, so what the\n * number counts is generations anyone could have installed.\n *\n * Moved to 2 because {@link RuntimeEventCategory} gained `\"signal\"`. A literal\n * union is not an excess property: a 0.3.x hub decoding `category: \"signal\"`\n * fails with `SchemaError(Expected \"command\" | ... | \"state\", got \"signal\")`,\n * and that failure takes the whole `Frond.Ingest` batch, non-signal records\n * included. Both builds announce 1, so the attachment would succeed and the app\n * would simply stop streaming — the exact failure the paragraph above refuses to\n * ship. The optional `channel`/`name` fields really are two-way safe and would\n * not have needed this; the category is what forced it.\n */\nexport const HUB_PROTOCOL_VERSION = 2;\n\n/**\n * Unregistered, and chosen for the band rather than the number.\n *\n * Above 9999 to clear the entire dev-server zone — Vite, Metro, Expo, CRA,\n * Django, Storybook, the node inspector — and below 32768 so it can never\n * collide with an ephemeral source port on Linux, whose range starts there.\n *\n * Stable on purpose. Apps hardcode it, so a hub that drifted to the next free\n * port on a collision would leave them dialing nothing, which presents as \"the\n * runtime is not emitting\" — the most expensive way to fail.\n */\nexport const HUB_DEFAULT_PORT = 17391;\n\nexport const HUB_DEFAULT_HOST = \"127.0.0.1\";\n\nexport const HUB_ATTACH_PATH = \"/attach\";\n\n/** Where an app dials when it was given no explicit URL. */\nexport const HUB_DEFAULT_ATTACH_URL = `ws://${HUB_DEFAULT_HOST}:${HUB_DEFAULT_PORT}${HUB_ATTACH_PATH}`;\n\n/**\n * How much of a value crosses the wire.\n *\n * Negotiated in one direction only: the hub asks, and the app answers with the\n * lesser of the request and its own ceiling. The ceiling defaults to `\"shape\"`,\n * so an app sends structure until someone deliberately decides otherwise — the\n * decision to put real values on a socket should be one somebody made, not one\n * that came with the default.\n */\nexport const ValuePolicy = Schema.Literals([\"none\", \"shape\", \"full\"]);\nexport type ValuePolicy = typeof ValuePolicy.Type;\n\nexport const RuntimeEventCategory = Schema.Literals([\n \"command\",\n \"diagnostic\",\n \"input\",\n \"lifecycle\",\n \"operation\",\n \"signal\",\n \"state\",\n]);\n\nexport const RuntimeEventSeverity = Schema.Literals([\"debug\", \"error\", \"info\", \"warning\"]);\n\nexport const RuntimeEventTimeline = Schema.Literals([\"live\", \"state\", \"system\", \"work\"]);\n\nexport const RuntimeWorkSource = Schema.Literals([\n \"react\",\n \"mobx\",\n \"node\",\n \"manual\",\n \"devtools\",\n \"runtime\",\n \"signal\",\n \"test\",\n]);\n\nexport const RuntimeWorkReason = Schema.Literals([\n \"start\",\n \"stop\",\n \"readiness\",\n \"retry\",\n \"preload\",\n \"refresh\",\n \"action\",\n \"args-update\",\n \"live\",\n \"release\",\n \"eviction\",\n \"unsafe-update\",\n \"input\",\n \"signal\",\n]);\n\nexport const RuntimeWorkPriority = Schema.Literals([\"blocking\", \"visible\", \"background\", \"idle\"]);\n\n/**\n * Who is attaching.\n *\n * `runtimeId` is the runtime's own `runtime-N` counter and collides freely\n * across tabs, reloads, and processes; `instanceId` is minted once per\n * `attachDevtools` call and is the only field safe to use as an identity key.\n */\nexport const AttachmentInfo = Schema.Struct({\n protocolVersion: Schema.Number,\n /** Stable for the life of the attaching runtime, including across reconnects. */\n instanceId: Schema.String,\n runtimeId: Schema.String,\n /**\n * How many times this runtime had already attached before this connection.\n *\n * Zero on a first attach; anything higher means the socket dropped and came\n * back, which is the same thing as saying the events in between are gone.\n * Devtools are not durable by design — nothing bridges that gap — so this\n * field exists to make the gap visible rather than to let anyone close it.\n */\n generation: Schema.Number,\n /** Human label for the CLI list, e.g. the host app's package name. */\n name: Schema.String,\n /** Free-form origin hint: \"bun\", \"browser\", \"expo-ios\", … */\n platform: Schema.String,\n startedAt: Schema.Number,\n /** The strongest value policy this app is willing to honor. */\n values: ValuePolicy,\n});\nexport type AttachmentInfo = typeof AttachmentInfo.Type;\n\n/**\n * A runtime event, flattened and already redacted by the sender.\n *\n * `fields` holds JSON-safe shape descriptors, not live values — encoding\n * happens at observe time, because a `RuntimeEventRecord` carries live\n * references that keep mutating after the record is handed out. The descriptor\n * vocabulary is written down once, in `descriptors.ts`, and what each policy\n * produces lives with the walk that produces it — `describeShape` in `shape.ts`,\n * `describeFull` in `full.ts`, `describeError` in `cause.ts`. Nothing on this\n * side should restate any of it and drift.\n */\nexport const EncodedEventRecord = Schema.Struct({\n sequence: Schema.Number,\n recordedAt: Schema.Number,\n /** The `RuntimeEvent` `_tag`, e.g. \"GraphNodeLiveDemandChanged\". */\n tag: Schema.String,\n category: RuntimeEventCategory,\n severity: RuntimeEventSeverity,\n timeline: RuntimeEventTimeline,\n reportable: Schema.Boolean,\n workId: Schema.Number,\n parentWorkId: Schema.optional(Schema.Number),\n source: RuntimeWorkSource,\n reason: RuntimeWorkReason,\n priority: RuntimeWorkPriority,\n nodeIds: Schema.Array(Schema.String),\n /**\n * Which signal this is, on the two events that carry one.\n *\n * Lifted out of `fields` because that is where they used to die: the field\n * walk treats every event body the same way, so a publication whose one field\n * is a signal record arrived at the default `\"shape\"` policy as a key list of\n * that record — a reader could tell that *a* signal fired and nothing about\n * which one. A channel and an event name are routing structure rather than app\n * data, which is the same argument `describeShape` makes for letting `_tag`\n * cross verbatim, so these two cross at every policy. The `payload` stays in\n * `fields` and stays clamped, because it is the half that really is data.\n *\n * Optional rather than required, which keeps these two fields compatible in\n * both directions on their own: an old hub ignores the extra properties a new\n * app sends, because effect Schema drops excess properties on decode and\n * nothing here overrides `onExcessProperty`, and a new hub reads an old app's\n * records as what they are — signals whose channel it was never told.\n *\n * That is a property of these fields and not of the release. The same release\n * added `\"signal\"` to {@link RuntimeEventCategory}, which an old hub does\n * reject, so {@link HUB_PROTOCOL_VERSION} moved to 2 regardless. Keeping these\n * optional is still what makes a new hub able to read an old app at all.\n */\n channel: Schema.optionalKey(Schema.String),\n name: Schema.optionalKey(Schema.String),\n /**\n * Keyed by the event's own field names, minus `_tag`.\n *\n * A record rather than `Unknown`: every consumer — the UI, and shortly the\n * MCP reader — looks fields up by name, and typing the container as unknown\n * only moves that cast to each of them. The *values* stay unknown, which is\n * the honest part: what a field holds depends on the negotiated policy.\n */\n fields: Schema.Record(Schema.String, Schema.Unknown),\n /**\n * What went wrong, as chains of causes rather than as single errors.\n *\n * Each entry is `{_: \"error\", message, causes}`, outermost cause first. The\n * runtime lifts these off the event's own fields, so the same failure also\n * appears in `fields` — encoded identically, so one failure never reads as\n * two. Present at every policy: `\"none\"` is a statement about values, and a\n * feed that cannot say what is failing is not worth reading.\n */\n failures: Schema.Array(Schema.Unknown),\n});\nexport type EncodedEventRecord = typeof EncodedEventRecord.Type;\n\n/**\n * One node, as it is right now.\n *\n * Split the same way `EncodedEventRecord` is: the fields a reader filters and\n * branches on are typed, and anything that came out of the app's own data is\n * `Unknown`, because what it holds depends on the negotiated policy. Giving\n * `NodeStatus`, `NodeOperation` and the rest real schemas here would copy core's\n * type surface into the wire contract and guarantee the two drift apart.\n *\n * Every field here has to earn its place in *every row* of a graph read, which\n * is why core's `label` and `key` are not among them: `label` is a formatting of\n * `tag` and `key` is already inside `nodeId`, so both are the same fact charged\n * twice, a few hundred times per snapshot.\n */\nexport const EncodedNodeSnapshot = Schema.Struct({\n nodeId: Schema.String,\n /** The spec's tag, e.g. `\"orders\"`. Shared by every key; `nodeId` is the identity. */\n tag: Schema.String,\n /**\n * `\"node\"`, `\"service\"`, `\"resource\"` or `\"facade\"` — the one identity field\n * nothing else here implies.\n *\n * It says whether this row owns a release: a resource holds something the app\n * has to give back, and a reader deciding what a leak looks like cannot get\n * that from `tag` or `nodeId`.\n *\n * Carried as a string rather than a literal union so a hub can read an app\n * built against a core that has since grown a kind. Version equality already\n * gates the wire; making this field the second thing that can reject a\n * snapshot would buy nothing.\n */\n kind: Schema.String,\n /**\n * Which arm of core's `NodeSnapshot` this is: `Unwired`, `Idle`, `Pending`,\n * `Ready`, `ReadinessError`, `Releasing`, `Invalid`.\n *\n * Typed and hoisted because it is the one field every reader branches on.\n * Left inside the encoded `status` it would oblige an agent to understand this\n * encoder's descriptors before it could ask which nodes are broken.\n */\n state: Schema.String,\n /**\n * Core's per-node write counter, carried verbatim.\n *\n * The cheap way to tell \"still the value I saw last time\" from \"recomputed,\n * and happens to look the same\" — which no amount of comparing encoded\n * results can answer once a policy has redacted them.\n */\n revision: Schema.Number,\n status: Schema.Unknown,\n liveDemand: Schema.Unknown,\n operation: Schema.Unknown,\n resultValidity: Schema.optional(Schema.Unknown),\n /**\n * Why this node is not usable, as a chain of causes.\n *\n * Same encoding as `EncodedEventRecord.failures`, deliberately: a node failed\n * in the snapshot and the event that failed it should read identically.\n */\n failure: Schema.optional(Schema.Unknown),\n /**\n * The last operation that failed, as `{operationId, kind, at, error}`.\n *\n * Distinct from `failure`, and the difference is the whole point of keeping\n * it: a node can be `Ready` on a stale-but-valid result while its most recent\n * refresh failed. `failure` would be absent and everything would look fine.\n */\n operationFailure: Schema.optional(Schema.Unknown),\n /** Why live demand could not be served, as `{at, failures}`. */\n liveFailure: Schema.optional(Schema.Unknown),\n /**\n * The node's current value.\n *\n * Only ever present on a single-node query. A graph read of a few hundred\n * nodes is a topology question, and answering it with every result attached\n * would put the whole application state on the wire to draw a diagram.\n */\n result: Schema.optional(Schema.Unknown),\n});\nexport type EncodedNodeSnapshot = typeof EncodedNodeSnapshot.Type;\n\nexport const EncodedGraphEdge = Schema.Struct({\n from: Schema.String,\n to: Schema.String,\n /** The dependency name the dependent declared, not the target's tag. */\n dependency: Schema.String,\n});\nexport type EncodedGraphEdge = typeof EncodedGraphEdge.Type;\n\n/**\n * The graph at one instant.\n *\n * The counterpart to the event stream rather than a replacement for it: events\n * say what happened, this says what is true. `capturedAt` and `sequence` are\n * what let a reader hold both at once — a snapshot taken \"as of sequence 4412\"\n * can be lined up against the log the reader already has, instead of being a\n * second account of the same system with no way to relate them.\n */\nexport const GraphSnapshot = Schema.Struct({\n capturedAt: Schema.Number,\n /**\n * The last event sequence the runtime had recorded when this was taken.\n *\n * Absent on a runtime that has not emitted yet, which is the only honest\n * answer — zero would claim a position in a log that has none.\n */\n sequence: Schema.optional(Schema.Number),\n runtimeId: Schema.String,\n runtimeStatus: Schema.String,\n graphStatus: Schema.String,\n observedInputs: Schema.Number,\n /**\n * The policy the app actually applied, which may be less than was asked for.\n *\n * Stated per snapshot rather than inferred from the attachment: a reader that\n * finds no `result` on a node needs to tell \"redacted\" from \"not ready\", and\n * those are the same absence.\n */\n values: ValuePolicy,\n nodes: Schema.Array(EncodedNodeSnapshot),\n edges: Schema.Array(EncodedGraphEdge),\n});\nexport type GraphSnapshot = typeof GraphSnapshot.Type;\n\n/** Every node and edge, with statuses but without results. */\nexport const GraphQuery = Schema.Struct({ _tag: Schema.tag(\"Graph\") });\n\n/** One node, with its result and the edges incident on it. */\nexport const NodeQuery = Schema.Struct({\n _tag: Schema.tag(\"Node\"),\n nodeId: Schema.String,\n});\n\nexport const StateQuery = Schema.Union([GraphQuery, NodeQuery]);\nexport type StateQuery = typeof StateQuery.Type;\n\n/**\n * The app's answer to one query.\n *\n * `Failed` rather than an RPC error because the reply is a separate call from\n * the request: an error on this channel would fail the *reply*, which is not\n * the thing that went wrong, and would leave the hub waiting out its timeout\n * for an answer that already came back.\n */\nexport const QueryOutcome = Schema.Union([\n Schema.Struct({ _tag: Schema.tag(\"Snapshot\"), snapshot: GraphSnapshot }),\n Schema.Struct({ _tag: Schema.tag(\"Failed\"), reason: Schema.String }),\n]);\nexport type QueryOutcome = typeof QueryOutcome.Type;\n\n/** Hub accepted the attachment and assigned it an id. */\nexport const HubAttached = Schema.Struct({\n _tag: Schema.tag(\"Attached\"),\n attachmentId: Schema.String,\n /** What the hub is asking for. The app may downgrade, never upgrade. */\n values: ValuePolicy,\n});\n\n/** Liveness probe; the app answers by continuing to hold the stream open. */\nexport const HubPing = Schema.Struct({\n _tag: Schema.tag(\"Ping\"),\n at: Schema.Number,\n});\n\n/**\n * Asks the app what is true right now.\n *\n * Rides this stream because the hub has no way to call the app — it listens and\n * the app dials, so the only open channel in this direction is the `Attach`\n * response. The answer comes back as a separate `Reply` call rather than in\n * band, which is why `requestId` exists.\n *\n * `values` is requested per query, not per attachment. A stream of events and a\n * deliberate read of one node are different acts: the first is a firehose worth\n * keeping cheap, the second is someone asking a specific question. Both are\n * still clamped by the app's own ceiling, so this widens nothing the app has not\n * already agreed to.\n */\nexport const HubQuery = Schema.Struct({\n _tag: Schema.tag(\"Query\"),\n requestId: Schema.String,\n query: StateQuery,\n values: ValuePolicy,\n});\n\n/** Server-to-client commands. */\nexport const HubCommand = Schema.Union([HubAttached, HubPing, HubQuery]);\nexport type HubCommand = typeof HubCommand.Type;\n\n/**\n * The hub refused the attachment.\n *\n * `reason` is prose for a terminal, not a code to branch on. It is the last\n * thing said on a connection that is about to close, and the symptom on the\n * other end — devtools that quietly never appear — carries no information at\n * all, so the string has to carry the diagnosis and the next step instead. The\n * hub's version mismatch names both versions and which side to upgrade.\n *\n * Specific on purpose, where a rejection elsewhere would be deliberately vague:\n * there is no authentication on this call (see `Attach`), so an uninvited\n * caller learns nothing here it could not learn by dialing and observing, and\n * vagueness would cost only the developer who is actually trying to attach.\n */\nexport class HubRejection extends Schema.TaggedError<HubRejection>()(\"HubRejection\", {\n reason: Schema.String,\n}) {}\n\n/**\n * Opens the attachment and holds it open.\n *\n * The stream's lifetime *is* the attachment's lifetime: when the socket drops,\n * the handler is interrupted, which is how the hub learns about detachment.\n * There is no explicit detach call and there should not be one — a crashed app\n * cannot send it.\n *\n * Unauthenticated on purpose. Browsers do not apply CORS to WebSockets, so any\n * page a developer visits can dial a loopback port — but this direction only\n * carries data *into* the hub, so the worst an uninvited caller achieves is\n * putting junk in a dashboard. The direction where app data leaves is the MCP\n * endpoint, and a secret on this half while that one is open would buy nothing\n * and cost every host app a value to configure.\n *\n * The consequence, stated plainly because something downstream has to honour\n * it: records arriving here are not proof of their own origin, and a consumer\n * that feeds them to an agent is feeding it untrusted text.\n */\nexport class Attach extends Rpc.make(\"Frond.Attach\", {\n payload: { info: AttachmentInfo },\n success: HubCommand,\n error: HubRejection,\n stream: true,\n}) {}\n\n/**\n * Pushes a batch of events.\n *\n * `droppedSince` is the sender's count of records it could not buffer since the\n * previous batch. It is not optional and not a nicety: a devtools feed that\n * silently loses events is worse than one that admits to a gap, because an\n * agent reasoning over the stream cannot tell \"did not happen\" from \"was\n * dropped\".\n */\nexport class Ingest extends Rpc.make(\"Frond.Ingest\", {\n payload: {\n attachmentId: Schema.String,\n records: Schema.Array(EncodedEventRecord),\n droppedSince: Schema.Number,\n },\n}) {}\n\n/**\n * Answers one `Query`.\n *\n * A unary call in the app-to-hub direction, correlated by `requestId`, because\n * the RPC roles only run that way — see the note at the top of this file. The\n * consequence worth naming: a reply is not causally tied to the stream that\n * asked for it, so the hub has to time its requests out. An app that dies\n * mid-query simply never calls this.\n */\nexport class Reply extends Rpc.make(\"Frond.Reply\", {\n payload: {\n attachmentId: Schema.String,\n requestId: Schema.String,\n outcome: QueryOutcome,\n },\n}) {}\n\nexport const FrondHubRpcs = RpcGroup.make(Attach, Ingest, Reply);\n"
6
+ ],
7
+ "mappings": "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",
8
+ "debugId": "D15BC16ECFF7952164756E2164756E21",
9
+ "names": []
10
+ }
package/dist/index.d.ts CHANGED
@@ -1,13 +1,13 @@
1
1
  import { Effect } from 'effect';
2
2
  import { Layer } from 'effect';
3
- import { Rpc } from 'effect/unstable/rpc';
4
- import { RpcClient } from 'effect/unstable/rpc';
5
- import { RpcClientError } from 'effect/unstable/rpc/RpcClientError';
6
- import { RpcGroup } from 'effect/unstable/rpc';
3
+ import { Rpc } from 'effect/rpc';
4
+ import { RpcClient } from 'effect/rpc';
5
+ import { RpcClientError } from 'effect/rpc/RpcClientError';
6
+ import { RpcGroup } from 'effect/rpc';
7
7
  import type { Runtime } from '@frondruntime/core';
8
8
  import { Schema } from 'effect';
9
9
  import { Scope } from 'effect/Scope';
10
- import { Stream } from 'effect/unstable/rpc/RpcSchema';
10
+ import { Stream } from 'effect/rpc/RpcSchema';
11
11
  import { YieldableError } from 'effect/Cause';
12
12
 
13
13
  /**
@@ -227,6 +227,14 @@ export declare type DevtoolsOptions = {
227
227
  readonly platform?: string | undefined;
228
228
  /** See {@link import("./attach.ts").AttachOptions.values}. Defaults to `"shape"`. */
229
229
  readonly values?: ValuePolicy | undefined;
230
+ /**
231
+ * Stable identity for this app across reconnects. Generated when omitted.
232
+ *
233
+ * Worth setting to something recognisable when several apps attach at once,
234
+ * since this is what tells one from another after a hub restart. Any string
235
+ * does, so long as it is stable for the life of the process and distinct per
236
+ * running app.
237
+ */
230
238
  readonly instanceId?: string | undefined;
231
239
  /** Return false to leave a record out of the stream entirely. */
232
240
  readonly include?: ((record: Runtime.RuntimeEventRecord) => boolean) | undefined;
@@ -261,7 +269,7 @@ export declare const EncodedEventRecord: Schema.Struct<{
261
269
  readonly recordedAt: Schema.Number;
262
270
  /** The `RuntimeEvent` `_tag`, e.g. "GraphNodeLiveDemandChanged". */
263
271
  readonly tag: Schema.String;
264
- readonly category: Schema.Literals<readonly ["command", "diagnostic", "input", "lifecycle", "operation", "state"]>;
272
+ readonly category: Schema.Literals<readonly ["command", "diagnostic", "input", "lifecycle", "operation", "signal", "state"]>;
265
273
  readonly severity: Schema.Literals<readonly ["debug", "error", "info", "warning"]>;
266
274
  readonly timeline: Schema.Literals<readonly ["live", "state", "system", "work"]>;
267
275
  readonly reportable: Schema.Boolean;
@@ -271,6 +279,31 @@ export declare const EncodedEventRecord: Schema.Struct<{
271
279
  readonly reason: Schema.Literals<readonly ["start", "stop", "readiness", "retry", "preload", "refresh", "action", "args-update", "live", "release", "eviction", "unsafe-update", "input", "signal"]>;
272
280
  readonly priority: Schema.Literals<readonly ["blocking", "visible", "background", "idle"]>;
273
281
  readonly nodeIds: Schema.$Array<Schema.String>;
282
+ /**
283
+ * Which signal this is, on the two events that carry one.
284
+ *
285
+ * Lifted out of `fields` because that is where they used to die: the field
286
+ * walk treats every event body the same way, so a publication whose one field
287
+ * is a signal record arrived at the default `"shape"` policy as a key list of
288
+ * that record — a reader could tell that *a* signal fired and nothing about
289
+ * which one. A channel and an event name are routing structure rather than app
290
+ * data, which is the same argument `describeShape` makes for letting `_tag`
291
+ * cross verbatim, so these two cross at every policy. The `payload` stays in
292
+ * `fields` and stays clamped, because it is the half that really is data.
293
+ *
294
+ * Optional rather than required, which keeps these two fields compatible in
295
+ * both directions on their own: an old hub ignores the extra properties a new
296
+ * app sends, because effect Schema drops excess properties on decode and
297
+ * nothing here overrides `onExcessProperty`, and a new hub reads an old app's
298
+ * records as what they are — signals whose channel it was never told.
299
+ *
300
+ * That is a property of these fields and not of the release. The same release
301
+ * added `"signal"` to {@link RuntimeEventCategory}, which an old hub does
302
+ * reject, so {@link HUB_PROTOCOL_VERSION} moved to 2 regardless. Keeping these
303
+ * optional is still what makes a new hub able to read an old app at all.
304
+ */
305
+ readonly channel: Schema.optionalKey<Schema.String>;
306
+ readonly name: Schema.optionalKey<Schema.String>;
274
307
  /**
275
308
  * Keyed by the event's own field names, minus `_tag`.
276
309
  *
@@ -428,7 +461,9 @@ export declare type EncodePolicy = ValuePolicy;
428
461
  *
429
462
  * Classification, work context, and node ids are metadata the runtime already
430
463
  * owns and are copied verbatim — they are ids and enum members, never user
431
- * data. Only the event body goes through the value encoder.
464
+ * data. A signal's channel and name join them, on the reasoning
465
+ * `EncodedEventRecord` gives for the two fields. Only the event body goes
466
+ * through the value encoder.
432
467
  */
433
468
  export declare function encodeRecord(record: Runtime.RuntimeEventRecord, policy: EncodePolicy): EncodedEventRecord;
434
469
 
@@ -593,8 +628,17 @@ export declare const HUB_DEFAULT_PORT = 17391;
593
628
  * change inside one release moved nothing and let two builds that disagreed
594
629
  * attach to each other. Starting at 1 with the first published hub, so what the
595
630
  * number counts is generations anyone could have installed.
631
+ *
632
+ * Moved to 2 because {@link RuntimeEventCategory} gained `"signal"`. A literal
633
+ * union is not an excess property: a 0.3.x hub decoding `category: "signal"`
634
+ * fails with `SchemaError(Expected "command" | ... | "state", got "signal")`,
635
+ * and that failure takes the whole `Frond.Ingest` batch, non-signal records
636
+ * included. Both builds announce 1, so the attachment would succeed and the app
637
+ * would simply stop streaming — the exact failure the paragraph above refuses to
638
+ * ship. The optional `channel`/`name` fields really are two-way safe and would
639
+ * not have needed this; the category is what forced it.
596
640
  */
597
- export declare const HUB_PROTOCOL_VERSION = 1;
641
+ export declare const HUB_PROTOCOL_VERSION = 2;
598
642
 
599
643
  /** Hub accepted the attachment and assigned it an id. */
600
644
  export declare const HubAttached: Schema.Struct<{
@@ -699,7 +743,7 @@ declare const Ingest_base: Rpc.Rpc<"Frond.Ingest", Schema.Struct<{
699
743
  readonly recordedAt: Schema.Number;
700
744
  /** The `RuntimeEvent` `_tag`, e.g. "GraphNodeLiveDemandChanged". */
701
745
  readonly tag: Schema.String;
702
- readonly category: Schema.Literals<readonly ["command", "diagnostic", "input", "lifecycle", "operation", "state"]>;
746
+ readonly category: Schema.Literals<readonly ["command", "diagnostic", "input", "lifecycle", "operation", "signal", "state"]>;
703
747
  readonly severity: Schema.Literals<readonly ["debug", "error", "info", "warning"]>;
704
748
  readonly timeline: Schema.Literals<readonly ["live", "state", "system", "work"]>;
705
749
  readonly reportable: Schema.Boolean;
@@ -709,6 +753,31 @@ declare const Ingest_base: Rpc.Rpc<"Frond.Ingest", Schema.Struct<{
709
753
  readonly reason: Schema.Literals<readonly ["start", "stop", "readiness", "retry", "preload", "refresh", "action", "args-update", "live", "release", "eviction", "unsafe-update", "input", "signal"]>;
710
754
  readonly priority: Schema.Literals<readonly ["blocking", "visible", "background", "idle"]>;
711
755
  readonly nodeIds: Schema.$Array<Schema.String>;
756
+ /**
757
+ * Which signal this is, on the two events that carry one.
758
+ *
759
+ * Lifted out of `fields` because that is where they used to die: the field
760
+ * walk treats every event body the same way, so a publication whose one field
761
+ * is a signal record arrived at the default `"shape"` policy as a key list of
762
+ * that record — a reader could tell that *a* signal fired and nothing about
763
+ * which one. A channel and an event name are routing structure rather than app
764
+ * data, which is the same argument `describeShape` makes for letting `_tag`
765
+ * cross verbatim, so these two cross at every policy. The `payload` stays in
766
+ * `fields` and stays clamped, because it is the half that really is data.
767
+ *
768
+ * Optional rather than required, which keeps these two fields compatible in
769
+ * both directions on their own: an old hub ignores the extra properties a new
770
+ * app sends, because effect Schema drops excess properties on decode and
771
+ * nothing here overrides `onExcessProperty`, and a new hub reads an old app's
772
+ * records as what they are — signals whose channel it was never told.
773
+ *
774
+ * That is a property of these fields and not of the release. The same release
775
+ * added `"signal"` to {@link RuntimeEventCategory}, which an old hub does
776
+ * reject, so {@link HUB_PROTOCOL_VERSION} moved to 2 regardless. Keeping these
777
+ * optional is still what makes a new hub able to read an old app at all.
778
+ */
779
+ readonly channel: Schema.optionalKey<Schema.String>;
780
+ readonly name: Schema.optionalKey<Schema.String>;
712
781
  /**
713
782
  * Keyed by the event's own field names, minus `_tag`.
714
783
  *
@@ -979,7 +1048,7 @@ declare const Reply_base: Rpc.Rpc<"Frond.Reply", Schema.Struct<{
979
1048
  */
980
1049
  export declare function resolvePolicy(requested: ValuePolicy, ceiling: ValuePolicy): EncodePolicy;
981
1050
 
982
- export declare const RuntimeEventCategory: Schema.Literals<readonly ["command", "diagnostic", "input", "lifecycle", "operation", "state"]>;
1051
+ export declare const RuntimeEventCategory: Schema.Literals<readonly ["command", "diagnostic", "input", "lifecycle", "operation", "signal", "state"]>;
983
1052
 
984
1053
  export declare const RuntimeEventSeverity: Schema.Literals<readonly ["debug", "error", "info", "warning"]>;
985
1054