@econ-v1/rpc 7.0.76 → 7.1.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/dist/index.d.ts +15 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/model-picker-contract.d.ts +244 -0
- package/dist/model-picker-contract.d.ts.map +1 -0
- package/dist/stage-context.d.ts +2 -0
- package/dist/stage-context.d.ts.map +1 -1
- package/package.json +3 -3
- package/src/index.js +15 -0
- package/src/model-picker-contract.js +170 -0
- package/src/stage-context.js +2 -1
package/dist/index.d.ts
CHANGED
|
@@ -109,6 +109,20 @@ export type L402Enforcement = import("./l402-enforcement-contract.js").L402Enfor
|
|
|
109
109
|
export type L402EnforcementRow = import("./l402-enforcement-contract.js").L402EnforcementRow;
|
|
110
110
|
export type L402EnforcementSource = import("./l402-enforcement-contract.js").L402EnforcementSource;
|
|
111
111
|
export type L402EnforcementSetPayload = import("./l402-enforcement-contract.js").L402EnforcementSetPayload;
|
|
112
|
+
export type ModelPick = import("./model-picker-contract.js").ModelPick;
|
|
113
|
+
export type ModelPickRequest = import("./model-picker-contract.js").ModelPickRequest;
|
|
114
|
+
export type ModelPickerCatalog = import("./model-picker-contract.js").ModelPickerCatalog;
|
|
115
|
+
export type ModelPickerCatalogRow = import("./model-picker-contract.js").ModelPickerCatalogRow;
|
|
116
|
+
export type ModelPickerCenter = import("./model-picker-contract.js").ModelPickerCenter;
|
|
117
|
+
export type ModelRef = import("./model-picker-contract.js").ModelRef;
|
|
118
|
+
export type PickerModel = import("./model-picker-contract.js").PickerModel;
|
|
119
|
+
export type PickerNotice = import("./model-picker-contract.js").PickerNotice;
|
|
120
|
+
export type PickerProvider = import("./model-picker-contract.js").PickerProvider;
|
|
121
|
+
export type PickerRecent = import("./model-picker-contract.js").PickerRecent;
|
|
122
|
+
export type PickerSearchOption = import("./model-picker-contract.js").PickerSearchOption;
|
|
123
|
+
export type PickerStore = import("./model-picker-contract.js").PickerStore;
|
|
124
|
+
export type RouteMode = import("./model-picker-contract.js").RouteMode;
|
|
125
|
+
export type WebSearchChoice = import("./model-picker-contract.js").WebSearchChoice;
|
|
112
126
|
export type ClientServicesRetryResult = import("./client-services-contract.js").ClientServicesRetryResult;
|
|
113
127
|
export type FactoryResetPending = import("./factory-reset-contract.js").FactoryResetPending;
|
|
114
128
|
export type FactoryResetStatus = import("./factory-reset-contract.js").FactoryResetStatus;
|
|
@@ -175,6 +189,7 @@ export { DEFAULT_REQUEST_TIMEOUT_MS, KernelRpcTimeoutError, MessagePortKernelRpc
|
|
|
175
189
|
export { NODE_APP_LIFECYCLE_COMMAND, NODE_APP_MEMORY_CAPTURE_COMMAND, NODE_APP_MEMORY_DETAIL_QUERY, NODE_APP_MEMORY_DOWNLOAD_COMMAND, NODE_APP_MEMORY_LIST_QUERY, NODE_APP_MEMORY_OVERVIEW_QUERY, NODE_APP_MEMORY_STATUS_COMMAND } from "./node-app-memory-contract.js";
|
|
176
190
|
export { APPS_LIFECYCLE_PIN_COMMAND, APPS_LIFECYCLE_QUERY } from "./apps-lifecycle-contract.js";
|
|
177
191
|
export { L402_ENFORCEMENT_QUERY, L402_ENFORCEMENT_ROW_ID, L402_ENFORCEMENT_SET_COMMAND } from "./l402-enforcement-contract.js";
|
|
192
|
+
export { isRouteMode, MODEL_PICKER_CATALOG_QUERY, MODEL_PICKER_CATALOG_ROW_ID, MODEL_PICKER_RECENTS_LIMIT, MODEL_PICKER_RECENTS_SETTING, MODEL_PICKER_STAGE_ID, ROUTE_MODES, WEB_SEARCH_AUTO } from "./model-picker-contract.js";
|
|
178
193
|
export { FACTORY_RESET_ARM_COMMAND, FACTORY_RESET_CANCEL_COMMAND, FACTORY_RESET_CHALLENGE_COMMAND, FACTORY_RESET_ROW_ID, FACTORY_RESET_STATUS_QUERY } from "./factory-reset-contract.js";
|
|
179
194
|
export { CLIENT_DEVICE_PAIRING_STATUS_QUERY, CLIENT_DEVICE_WIRE_ERROR_DEVICE_LIMIT_EXCEEDED, CLIENT_DEVICE_WIRE_ERROR_DEVICE_NOT_REGISTERED, CLIENT_DEVICE_WIRE_ERROR_LAST_DEVICE, CLIENT_DEVICE_WIRE_ERROR_LAST_DEVICE_PROTECTED, CLIENT_DEVICE_WIRE_ERROR_NAME_TAKEN } from "./pairing-status-contract.js";
|
|
180
195
|
export { DEVICE_CLEANUP_CANCEL_COMMAND, DEVICE_CLEANUP_QUERY, DEVICE_CLEANUP_REQUEST_COMMAND, DEVICE_CLEANUP_STATUS_COMMAND } from "./device-cleanup-contract.js";
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.js"],"names":[],"mappings":";;;;;8BAEc,OAAO,aAAa,EAAE,eAAe;mCACrC,OAAO,4BAA4B,EAAE,oBAAoB;4BACzD,OAAO,wBAAwB,EAAE,aAAa;kCAC9C,OAAO,0BAA0B,EAAE,mBAAmB;oCACtD,OAAO,0BAA0B,EAAE,qBAAqB;4BACxD,OAAO,aAAa,EAAE,aAAa;8BACnC,OAAO,aAAa,EAAE,eAAe;0BACrC,OAAO,aAAa,EAAE,WAAW;0BACjC,OAAO,iBAAiB,EAAE,WAAW;0BACrC,OAAO,iBAAiB,EAAE,WAAW;8BACrC,OAAO,iBAAiB,EAAE,eAAe;8BACvB,CAAC,SAAlB,eAAgB,IAAa,OAAO,iBAAiB,EAAE,iBAAiB,CAAC,CAAC,CAAC;+BAC1D,CAAC,SAAlB,eAAgB,IAAa,OAAO,iBAAiB,EAAE,kBAAkB,CAAC,CAAC,CAAC;8BAC7E,OAAO,iBAAiB,EAAE,eAAe;2BACzC,OAAO,iBAAiB,EAAE,YAAY;sBACtC,CAAC,IAAW,OAAO,iBAAiB,EAAE,SAAS,CAAC,CAAC,CAAC;wBAClD,OAAO,iBAAiB,EAAE,SAAS;sCACnC,OAAO,iBAAiB,EAAE,uBAAuB;4BACjD,OAAO,iBAAiB,EAAE,aAAa;6BACvC,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those live in
|
|
2
|
+
* `client-settings`, per device) and without `state` (a row that exists IS ready;
|
|
3
|
+
* the shell composes `loading`/`error` itself). */
|
|
4
|
+
/** @typedef {Omit<ModelPickerCatalog, "state" | "error" | "recents"> & { readonly id: string }} ModelPickerCatalogRow */
|
|
5
|
+
/** @param {unknown} value @returns {value is RouteMode} */
|
|
6
|
+
export function isRouteMode(value: unknown): value is RouteMode;
|
|
7
|
+
/**
|
|
8
|
+
* The shared model picker — ONE overlay every stage opens through the host.
|
|
9
|
+
*
|
|
10
|
+
* Two stages used to draw their own model dropdown (the room chat's, and a
|
|
11
|
+
* 1:1 port of it inside Agent Builder). This contract replaces both with a
|
|
12
|
+
* door on the stage context, `ctx.host.modelPicker`, beside `host.dialogs`:
|
|
13
|
+
* the stage asks, the shell opens the design drop's "Switch model" overlay
|
|
14
|
+
* (`stages/model-selector/`, fed through `NodeOS.feedView`), and hands back
|
|
15
|
+
* the pick. A stage never sees the catalog and never draws a model list.
|
|
16
|
+
*
|
|
17
|
+
* Plan: `docs/superpowers/specs/2026-09-18-shared-model-selector-plan.md`.
|
|
18
|
+
* Design side: `docs/design/DESIGN_HANDOFF_CONTRACT.md` Ask 16.
|
|
19
|
+
*/
|
|
20
|
+
/** The kernel's one-row live query the shell draws the overlay from. */
|
|
21
|
+
export const MODEL_PICKER_CATALOG_QUERY: "model-picker.catalog.v1";
|
|
22
|
+
/** The single row's id — the catalog is one screen's worth of data, not a row set. */
|
|
23
|
+
export const MODEL_PICKER_CATALOG_ROW_ID: "catalog";
|
|
24
|
+
/** The `client-settings` key the shell keeps the owner's usage counts under. */
|
|
25
|
+
export const MODEL_PICKER_RECENTS_SETTING: "model-picker.recents";
|
|
26
|
+
/** The design drop's stage id: the `NodeOS.feedView` / launcher target. */
|
|
27
|
+
export const MODEL_PICKER_STAGE_ID: "model-selector";
|
|
28
|
+
/** How many distinct models the recents ledger remembers. */
|
|
29
|
+
export const MODEL_PICKER_RECENTS_LIMIT: 24;
|
|
30
|
+
/** Same three words the room chat's route pills already send (`route_mode`). */
|
|
31
|
+
export const ROUTE_MODES: readonly ["auto", "public", "private"];
|
|
32
|
+
/** @typedef {(typeof ROUTE_MODES)[number]} RouteMode */
|
|
33
|
+
/** `"auto"` (the node routes — Exa over Brave, or an explicit `provider`), or a
|
|
34
|
+
* web-search option id from the catalog (`"brave"`, `"exa"`, …) to force one. An
|
|
35
|
+
* open string because the option list is data, not a closed enum. An "off" choice
|
|
36
|
+
* is deliberately NOT part of this contract yet (decided 2026-09-19). */
|
|
37
|
+
/** @typedef {string} WebSearchChoice */
|
|
38
|
+
/** The model the stage puts on the wire — exactly the pick shape the room chat
|
|
39
|
+
* already sends (`{ model, peerNodeId }` on `room.send.v1`; `model`/`peer_node_id`
|
|
40
|
+
* on `agent.prompt`). `name` is the vendor id the execution path calls;
|
|
41
|
+
* `peerNodeId` present means the model is bought from that peer (its store),
|
|
42
|
+
* absent means this node runs it on its own key ("My Store"). */
|
|
43
|
+
/** @typedef {{ readonly name: string, readonly peerNodeId?: string }} ModelRef */
|
|
44
|
+
/** What the stage already knows, so the overlay opens on it instead of a default. */
|
|
45
|
+
/** @typedef {{ readonly current?: ModelRef, readonly routeMode?: RouteMode, readonly webSearch?: WebSearchChoice }} ModelPickRequest */
|
|
46
|
+
/** `model` is present only when the owner pressed Select on a row; absent means
|
|
47
|
+
* "keep whatever model the stage already had" — the owner changed only the
|
|
48
|
+
* web-search chip (or nothing but still closed with a chip change). `label` is
|
|
49
|
+
* the catalog's `picker_label ?? name`, so a pill or chip shows the same words
|
|
50
|
+
* the overlay did. */
|
|
51
|
+
/** @typedef {{ readonly model?: ModelRef, readonly label?: string, readonly routeMode: RouteMode, readonly webSearch: WebSearchChoice }} ModelPick */
|
|
52
|
+
/** Resolves `undefined` when the owner closes without choosing. Rejects with a
|
|
53
|
+
* `DomainError` `conflict` while another `open()` is still pending — the overlay
|
|
54
|
+
* is one surface — and `capability_unavailable` when this host has no design
|
|
55
|
+
* drop to draw it with. */
|
|
56
|
+
/** @typedef {{ open(request: ModelPickRequest): Promise<ModelPick | undefined> }} ModelPickerCenter */
|
|
57
|
+
/** @typedef {{ readonly city?: string, readonly lat: number, readonly lon: number }} PickerGeo */
|
|
58
|
+
/** A peer node that sells models. `fee` stays `null` until offerings carry a
|
|
59
|
+
* markup (today every node charges the same one and advertises the base price). */
|
|
60
|
+
/** @typedef {{ readonly id: string, readonly name: string, readonly tag: string | null, readonly fee: number | null, readonly reliability: number | null, readonly geo: PickerGeo | null }} PickerStore */
|
|
61
|
+
/** @typedef {{ readonly id: string, readonly name: string, readonly brand_hex: string | null, readonly popularity: number, readonly featured: boolean, readonly store_ids: readonly string[], readonly status: string, readonly local: boolean }} PickerProvider */
|
|
62
|
+
/** @typedef {{ readonly peer_node_id: string, readonly cost_in: number | null, readonly cost_out: number | null }} PickerOffer */
|
|
63
|
+
/** A vendor's notice the overlay repeats verbatim under "About" (a data-retention
|
|
64
|
+
* clause, a preview caveat). Nothing serves one yet. */
|
|
65
|
+
/** @typedef {{ readonly text: string, readonly url: string | null }} PickerNotice */
|
|
66
|
+
/**
|
|
67
|
+
* A model row. Every field the overlay draws is here, and the overlay draws a
|
|
68
|
+
* field ONLY when it is non-null — a missing value hides its cell, it never
|
|
69
|
+
* shows as a zero, a guess or a demo constant. The `details` block names what
|
|
70
|
+
* no source serves today; when one does, the overlay lights up without a change.
|
|
71
|
+
*
|
|
72
|
+
* Data gaps (2026-09-21) — who would fill each, and what the overlay does meanwhile:
|
|
73
|
+
* ttft_ms api-store: measured from llm_call_log (not backfilled yet) → speed cell hidden, sorts last
|
|
74
|
+
* ctx_k api-store: context_window from discovery when a provider reports it → Context stat hidden
|
|
75
|
+
* cost_in/out api-store list_available (unpriced peer offers) → "—", sorts last, no graph dot
|
|
76
|
+
* cache_read_cost no source (vendor price sheets) → "More pricing" hidden
|
|
77
|
+
* cache_write_cost no source → "More pricing" hidden
|
|
78
|
+
* modalities_in/out, max_output_k, reasoning, tool_calling, supported_params
|
|
79
|
+
* no source (vendor model cards) → those "Model details" rows hidden
|
|
80
|
+
* notice no source → no notice block
|
|
81
|
+
* provider.popularity api-store llm_platforms.popularity, DEFAULT 0 = unknown → "daily users" hidden, "popular" filter disabled
|
|
82
|
+
* store.fee by design null (every node charges the same markup) → fee row/toggle hidden
|
|
83
|
+
* store.geo, mine.geo no source → no globe marker
|
|
84
|
+
* store.reliability api-store peer_metrics.list (served) → drawn on the store card
|
|
85
|
+
*/
|
|
86
|
+
/** @typedef {{
|
|
87
|
+
* readonly id: string,
|
|
88
|
+
* readonly provider_id: string,
|
|
89
|
+
* readonly vendor_id: string,
|
|
90
|
+
* readonly name: string,
|
|
91
|
+
* readonly picker_label: string | null,
|
|
92
|
+
* readonly tier: string | null,
|
|
93
|
+
* readonly specialty: string | null,
|
|
94
|
+
* readonly latest: boolean,
|
|
95
|
+
* readonly intel: number,
|
|
96
|
+
* readonly cost_in: number | null,
|
|
97
|
+
* readonly cost_out: number | null,
|
|
98
|
+
* readonly ttft_ms: number | null,
|
|
99
|
+
* readonly ctx_k: number | null,
|
|
100
|
+
* readonly description: string | null,
|
|
101
|
+
* readonly released: string | null,
|
|
102
|
+
* readonly released_day: string | null,
|
|
103
|
+
* readonly local: boolean,
|
|
104
|
+
* readonly store_ids: readonly string[],
|
|
105
|
+
* readonly offers: readonly PickerOffer[],
|
|
106
|
+
* readonly cache_read_cost: number | null,
|
|
107
|
+
* readonly cache_write_cost: number | null,
|
|
108
|
+
* readonly modalities_in: readonly string[] | null,
|
|
109
|
+
* readonly modalities_out: readonly string[] | null,
|
|
110
|
+
* readonly max_output_k: number | null,
|
|
111
|
+
* readonly reasoning: boolean | null,
|
|
112
|
+
* readonly tool_calling: boolean | null,
|
|
113
|
+
* readonly supported_params: readonly string[] | null,
|
|
114
|
+
* readonly notice: PickerNotice | null
|
|
115
|
+
* }} PickerModel */
|
|
116
|
+
/** @typedef {{ readonly id: string, readonly name: string, readonly subtitle: string | null, readonly icon: string | null, readonly color: string | null, readonly auto: boolean }} PickerSearchOption */
|
|
117
|
+
/** @typedef {{ readonly id: string, readonly count: number }} PickerRecent */
|
|
118
|
+
/** `state` is the host's word for the whole payload — the same vocabulary the
|
|
119
|
+
* app-lifecycle view uses — so the overlay can say "still asking" or "the API
|
|
120
|
+
* Store did not answer" instead of drawing an empty table. */
|
|
121
|
+
/** @typedef {{
|
|
122
|
+
* readonly state: "ready" | "loading" | "error",
|
|
123
|
+
* readonly error: string | null,
|
|
124
|
+
* readonly mine: { readonly name: string, readonly geo: PickerGeo | null },
|
|
125
|
+
* readonly stores: readonly PickerStore[],
|
|
126
|
+
* readonly providers: readonly PickerProvider[],
|
|
127
|
+
* readonly models: readonly PickerModel[],
|
|
128
|
+
* readonly web_search_options: readonly PickerSearchOption[],
|
|
129
|
+
* readonly recents: readonly PickerRecent[]
|
|
130
|
+
* }} ModelPickerCatalog */
|
|
131
|
+
/** The web-search chip the node routes with. Not a vendor, so api-store has no row
|
|
132
|
+
* for it unless an owner curated one; the catalog adapter guarantees it is present. */
|
|
133
|
+
export const WEB_SEARCH_AUTO: "auto";
|
|
134
|
+
export type ModelPickerCatalogRow = Omit<ModelPickerCatalog, "state" | "error" | "recents"> & {
|
|
135
|
+
readonly id: string;
|
|
136
|
+
};
|
|
137
|
+
export type RouteMode = (typeof ROUTE_MODES)[number];
|
|
138
|
+
export type WebSearchChoice = string;
|
|
139
|
+
export type ModelRef = {
|
|
140
|
+
readonly name: string;
|
|
141
|
+
readonly peerNodeId?: string;
|
|
142
|
+
};
|
|
143
|
+
export type ModelPickRequest = {
|
|
144
|
+
readonly current?: ModelRef;
|
|
145
|
+
readonly routeMode?: RouteMode;
|
|
146
|
+
readonly webSearch?: WebSearchChoice;
|
|
147
|
+
};
|
|
148
|
+
export type ModelPick = {
|
|
149
|
+
readonly model?: ModelRef;
|
|
150
|
+
readonly label?: string;
|
|
151
|
+
readonly routeMode: RouteMode;
|
|
152
|
+
readonly webSearch: WebSearchChoice;
|
|
153
|
+
};
|
|
154
|
+
export type ModelPickerCenter = {
|
|
155
|
+
open(request: ModelPickRequest): Promise<ModelPick | undefined>;
|
|
156
|
+
};
|
|
157
|
+
export type PickerGeo = {
|
|
158
|
+
readonly city?: string;
|
|
159
|
+
readonly lat: number;
|
|
160
|
+
readonly lon: number;
|
|
161
|
+
};
|
|
162
|
+
export type PickerStore = {
|
|
163
|
+
readonly id: string;
|
|
164
|
+
readonly name: string;
|
|
165
|
+
readonly tag: string | null;
|
|
166
|
+
readonly fee: number | null;
|
|
167
|
+
readonly reliability: number | null;
|
|
168
|
+
readonly geo: PickerGeo | null;
|
|
169
|
+
};
|
|
170
|
+
export type PickerProvider = {
|
|
171
|
+
readonly id: string;
|
|
172
|
+
readonly name: string;
|
|
173
|
+
readonly brand_hex: string | null;
|
|
174
|
+
readonly popularity: number;
|
|
175
|
+
readonly featured: boolean;
|
|
176
|
+
readonly store_ids: readonly string[];
|
|
177
|
+
readonly status: string;
|
|
178
|
+
readonly local: boolean;
|
|
179
|
+
};
|
|
180
|
+
export type PickerOffer = {
|
|
181
|
+
readonly peer_node_id: string;
|
|
182
|
+
readonly cost_in: number | null;
|
|
183
|
+
readonly cost_out: number | null;
|
|
184
|
+
};
|
|
185
|
+
export type PickerNotice = {
|
|
186
|
+
readonly text: string;
|
|
187
|
+
readonly url: string | null;
|
|
188
|
+
};
|
|
189
|
+
export type PickerModel = {
|
|
190
|
+
readonly id: string;
|
|
191
|
+
readonly provider_id: string;
|
|
192
|
+
readonly vendor_id: string;
|
|
193
|
+
readonly name: string;
|
|
194
|
+
readonly picker_label: string | null;
|
|
195
|
+
readonly tier: string | null;
|
|
196
|
+
readonly specialty: string | null;
|
|
197
|
+
readonly latest: boolean;
|
|
198
|
+
readonly intel: number;
|
|
199
|
+
readonly cost_in: number | null;
|
|
200
|
+
readonly cost_out: number | null;
|
|
201
|
+
readonly ttft_ms: number | null;
|
|
202
|
+
readonly ctx_k: number | null;
|
|
203
|
+
readonly description: string | null;
|
|
204
|
+
readonly released: string | null;
|
|
205
|
+
readonly released_day: string | null;
|
|
206
|
+
readonly local: boolean;
|
|
207
|
+
readonly store_ids: readonly string[];
|
|
208
|
+
readonly offers: readonly PickerOffer[];
|
|
209
|
+
readonly cache_read_cost: number | null;
|
|
210
|
+
readonly cache_write_cost: number | null;
|
|
211
|
+
readonly modalities_in: readonly string[] | null;
|
|
212
|
+
readonly modalities_out: readonly string[] | null;
|
|
213
|
+
readonly max_output_k: number | null;
|
|
214
|
+
readonly reasoning: boolean | null;
|
|
215
|
+
readonly tool_calling: boolean | null;
|
|
216
|
+
readonly supported_params: readonly string[] | null;
|
|
217
|
+
readonly notice: PickerNotice | null;
|
|
218
|
+
};
|
|
219
|
+
export type PickerSearchOption = {
|
|
220
|
+
readonly id: string;
|
|
221
|
+
readonly name: string;
|
|
222
|
+
readonly subtitle: string | null;
|
|
223
|
+
readonly icon: string | null;
|
|
224
|
+
readonly color: string | null;
|
|
225
|
+
readonly auto: boolean;
|
|
226
|
+
};
|
|
227
|
+
export type PickerRecent = {
|
|
228
|
+
readonly id: string;
|
|
229
|
+
readonly count: number;
|
|
230
|
+
};
|
|
231
|
+
export type ModelPickerCatalog = {
|
|
232
|
+
readonly state: "ready" | "loading" | "error";
|
|
233
|
+
readonly error: string | null;
|
|
234
|
+
readonly mine: {
|
|
235
|
+
readonly name: string;
|
|
236
|
+
readonly geo: PickerGeo | null;
|
|
237
|
+
};
|
|
238
|
+
readonly stores: readonly PickerStore[];
|
|
239
|
+
readonly providers: readonly PickerProvider[];
|
|
240
|
+
readonly models: readonly PickerModel[];
|
|
241
|
+
readonly web_search_options: readonly PickerSearchOption[];
|
|
242
|
+
readonly recents: readonly PickerRecent[];
|
|
243
|
+
};
|
|
244
|
+
//# sourceMappingURL=model-picker-contract.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"model-picker-contract.d.ts","sourceRoot":"","sources":["../src/model-picker-contract.js"],"names":[],"mappings":"AAiKA;;mDAEmD;AACnD,yHAAy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E,SAAS,WAAW,EAAE,CAAC;IAC5C,QAAY,CAAC,SAAS,EAAE,SAAS,cAAc,EAAE,CAAC;IAClD,QAAY,CAAC,MAAM,EAAE,SAAS,WAAW,EAAE,CAAC;IAC5C,QAAY,CAAC,kBAAkB,EAAE,SAAS,kBAAkB,EAAE,CAAC;IAC/D,QAAY,CAAC,OAAO,EAAE,SAAS,YAAY,EAAE,CAAA;CAC1C"}
|
package/dist/stage-context.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ export type KernelEventType = import("@econ-v1/domain").KernelEventType;
|
|
|
2
2
|
export type QueryName = import("@econ-v1/domain").QueryName;
|
|
3
3
|
export type Unsubscribe = import("./client.js").Unsubscribe;
|
|
4
4
|
export type DialogCenter = import("./dialog-contract.js").DialogCenter;
|
|
5
|
+
export type ModelPickerCenter = import("./model-picker-contract.js").ModelPickerCenter;
|
|
5
6
|
export type SystemNoticeCenter = import("./system-notice-contract.js").SystemNoticeCenter;
|
|
6
7
|
export type MountedStage = {
|
|
7
8
|
unmount(): Promise<void>;
|
|
@@ -35,6 +36,7 @@ export type StageContextV1 = StageContextShared & {
|
|
|
35
36
|
export type StageContextV2 = StageContextShared & {
|
|
36
37
|
readonly host: StageHostShared & {
|
|
37
38
|
readonly dialogs: DialogCenter;
|
|
39
|
+
readonly modelPicker: ModelPickerCenter;
|
|
38
40
|
readonly systemNotices: SystemNoticeCenter;
|
|
39
41
|
readonly uiApi: 2;
|
|
40
42
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stage-context.d.ts","sourceRoot":"","sources":["../src/stage-context.js"],"names":[],"mappings":"8BAEc,OAAO,iBAAiB,EAAE,eAAe;wBACzC,OAAO,iBAAiB,EAAE,SAAS;0BACnC,OAAO,aAAa,EAAE,WAAW;2BACjC,OAAO,sBAAsB,EAAE,YAAY;
|
|
1
|
+
{"version":3,"file":"stage-context.d.ts","sourceRoot":"","sources":["../src/stage-context.js"],"names":[],"mappings":"8BAEc,OAAO,iBA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,CAAC,CAAC,CAAC;IAC3D,QAAY,CAAC,KAAK,EAAE;QAAE,IAAI,EAAE,gBAAgB,CAAA;KAAE,CAAA;CAC3C;8BACU;IAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IAAC,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAA;CAAE;6BACxD,kBAAkB,GAAG;IAAE,QAAQ,CAAC,IAAI,EAAE,eAAe,GAAG;QAAE,QAAQ,CAAC,KAAK,EAAE,CAAC,CAAA;KAAE,CAAA;CAAE;6BAC/E,kBAAkB,GAAG;IAAE,QAAQ,CAAC,IAAI,EAAE,eAAe,GAAG;QAAE,QAAQ,CAAC,OAAO,EAAE,YAAY,CAAC;QAAC,QAAQ,CAAC,WAAW,EAAE,iBAAiB,CAAC;QAAC,QAAQ,CAAC,aAAa,EAAE,kBAAkB,CAAC;QAAC,QAAQ,CAAC,KAAK,EAAE,CAAC,CAAA;KAAE,CAAA;CAAE;2BACpM,cAAc,GAAG,cAAc;0BAC/B;IAAE,KAAK,CAAC,GAAG,EAAE,YAAY,GAAG,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAAC,OAAO,IAAI,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;CAAE"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@econ-v1/rpc",
|
|
3
|
-
"version": "7.0
|
|
3
|
+
"version": "7.1.0",
|
|
4
4
|
"description": "Typed runtime and contracts for Node client stage-to-kernel RPC",
|
|
5
5
|
"license": "MIT OR Apache-2.0",
|
|
6
6
|
"author": "Node contributors",
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
"access": "public"
|
|
57
57
|
},
|
|
58
58
|
"dependencies": {
|
|
59
|
-
"@econ-v1/domain": "7.0
|
|
60
|
-
"@econ-v1/ports": "7.0
|
|
59
|
+
"@econ-v1/domain": "7.1.0",
|
|
60
|
+
"@econ-v1/ports": "7.1.0"
|
|
61
61
|
}
|
|
62
62
|
}
|
package/src/index.js
CHANGED
|
@@ -106,6 +106,20 @@
|
|
|
106
106
|
/** @typedef {import("./l402-enforcement-contract.js").L402EnforcementRow} L402EnforcementRow */
|
|
107
107
|
/** @typedef {import("./l402-enforcement-contract.js").L402EnforcementSource} L402EnforcementSource */
|
|
108
108
|
/** @typedef {import("./l402-enforcement-contract.js").L402EnforcementSetPayload} L402EnforcementSetPayload */
|
|
109
|
+
/** @typedef {import("./model-picker-contract.js").ModelPick} ModelPick */
|
|
110
|
+
/** @typedef {import("./model-picker-contract.js").ModelPickRequest} ModelPickRequest */
|
|
111
|
+
/** @typedef {import("./model-picker-contract.js").ModelPickerCatalog} ModelPickerCatalog */
|
|
112
|
+
/** @typedef {import("./model-picker-contract.js").ModelPickerCatalogRow} ModelPickerCatalogRow */
|
|
113
|
+
/** @typedef {import("./model-picker-contract.js").ModelPickerCenter} ModelPickerCenter */
|
|
114
|
+
/** @typedef {import("./model-picker-contract.js").ModelRef} ModelRef */
|
|
115
|
+
/** @typedef {import("./model-picker-contract.js").PickerModel} PickerModel */
|
|
116
|
+
/** @typedef {import("./model-picker-contract.js").PickerNotice} PickerNotice */
|
|
117
|
+
/** @typedef {import("./model-picker-contract.js").PickerProvider} PickerProvider */
|
|
118
|
+
/** @typedef {import("./model-picker-contract.js").PickerRecent} PickerRecent */
|
|
119
|
+
/** @typedef {import("./model-picker-contract.js").PickerSearchOption} PickerSearchOption */
|
|
120
|
+
/** @typedef {import("./model-picker-contract.js").PickerStore} PickerStore */
|
|
121
|
+
/** @typedef {import("./model-picker-contract.js").RouteMode} RouteMode */
|
|
122
|
+
/** @typedef {import("./model-picker-contract.js").WebSearchChoice} WebSearchChoice */
|
|
109
123
|
/** @typedef {import("./client-services-contract.js").ClientServicesRetryResult} ClientServicesRetryResult */
|
|
110
124
|
/** @typedef {import("./factory-reset-contract.js").FactoryResetPending} FactoryResetPending */
|
|
111
125
|
/** @typedef {import("./factory-reset-contract.js").FactoryResetStatus} FactoryResetStatus */
|
|
@@ -186,6 +200,7 @@ export { NODE_APP_LIFECYCLE_COMMAND, NODE_APP_MEMORY_CAPTURE_COMMAND, NODE_APP_M
|
|
|
186
200
|
export { APPS_LIFECYCLE_PIN_COMMAND, APPS_LIFECYCLE_QUERY } from "./apps-lifecycle-contract.js";
|
|
187
201
|
export { CLIENT_SERVICES_RETRY_COMMAND } from "./client-services-contract.js";
|
|
188
202
|
export { L402_ENFORCEMENT_QUERY, L402_ENFORCEMENT_ROW_ID, L402_ENFORCEMENT_SET_COMMAND } from "./l402-enforcement-contract.js";
|
|
203
|
+
export { isRouteMode, MODEL_PICKER_CATALOG_QUERY, MODEL_PICKER_CATALOG_ROW_ID, MODEL_PICKER_RECENTS_LIMIT, MODEL_PICKER_RECENTS_SETTING, MODEL_PICKER_STAGE_ID, ROUTE_MODES, WEB_SEARCH_AUTO } from "./model-picker-contract.js";
|
|
189
204
|
export {
|
|
190
205
|
FACTORY_RESET_ARM_COMMAND,
|
|
191
206
|
FACTORY_RESET_CANCEL_COMMAND,
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
// @ts-check
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* The shared model picker — ONE overlay every stage opens through the host.
|
|
5
|
+
*
|
|
6
|
+
* Two stages used to draw their own model dropdown (the room chat's, and a
|
|
7
|
+
* 1:1 port of it inside Agent Builder). This contract replaces both with a
|
|
8
|
+
* door on the stage context, `ctx.host.modelPicker`, beside `host.dialogs`:
|
|
9
|
+
* the stage asks, the shell opens the design drop's "Switch model" overlay
|
|
10
|
+
* (`stages/model-selector/`, fed through `NodeOS.feedView`), and hands back
|
|
11
|
+
* the pick. A stage never sees the catalog and never draws a model list.
|
|
12
|
+
*
|
|
13
|
+
* Plan: `docs/superpowers/specs/2026-09-18-shared-model-selector-plan.md`.
|
|
14
|
+
* Design side: `docs/design/DESIGN_HANDOFF_CONTRACT.md` Ask 16.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
/** The kernel's one-row live query the shell draws the overlay from. */
|
|
18
|
+
export const MODEL_PICKER_CATALOG_QUERY = "model-picker.catalog.v1";
|
|
19
|
+
|
|
20
|
+
/** The single row's id — the catalog is one screen's worth of data, not a row set. */
|
|
21
|
+
export const MODEL_PICKER_CATALOG_ROW_ID = "catalog";
|
|
22
|
+
|
|
23
|
+
/** The `client-settings` key the shell keeps the owner's usage counts under. */
|
|
24
|
+
export const MODEL_PICKER_RECENTS_SETTING = "model-picker.recents";
|
|
25
|
+
|
|
26
|
+
/** The design drop's stage id: the `NodeOS.feedView` / launcher target. */
|
|
27
|
+
export const MODEL_PICKER_STAGE_ID = "model-selector";
|
|
28
|
+
|
|
29
|
+
/** How many distinct models the recents ledger remembers. */
|
|
30
|
+
export const MODEL_PICKER_RECENTS_LIMIT = 24;
|
|
31
|
+
|
|
32
|
+
// ── The pick ─────────────────────────────────────────────────────────────────
|
|
33
|
+
|
|
34
|
+
/** Same three words the room chat's route pills already send (`route_mode`). */
|
|
35
|
+
export const ROUTE_MODES = /** @type {const} */ (["auto", "public", "private"]);
|
|
36
|
+
/** @typedef {(typeof ROUTE_MODES)[number]} RouteMode */
|
|
37
|
+
|
|
38
|
+
/** `"auto"` (the node routes — Exa over Brave, or an explicit `provider`), or a
|
|
39
|
+
* web-search option id from the catalog (`"brave"`, `"exa"`, …) to force one. An
|
|
40
|
+
* open string because the option list is data, not a closed enum. An "off" choice
|
|
41
|
+
* is deliberately NOT part of this contract yet (decided 2026-09-19). */
|
|
42
|
+
/** @typedef {string} WebSearchChoice */
|
|
43
|
+
|
|
44
|
+
/** The model the stage puts on the wire — exactly the pick shape the room chat
|
|
45
|
+
* already sends (`{ model, peerNodeId }` on `room.send.v1`; `model`/`peer_node_id`
|
|
46
|
+
* on `agent.prompt`). `name` is the vendor id the execution path calls;
|
|
47
|
+
* `peerNodeId` present means the model is bought from that peer (its store),
|
|
48
|
+
* absent means this node runs it on its own key ("My Store"). */
|
|
49
|
+
/** @typedef {{ readonly name: string, readonly peerNodeId?: string }} ModelRef */
|
|
50
|
+
|
|
51
|
+
/** What the stage already knows, so the overlay opens on it instead of a default. */
|
|
52
|
+
/** @typedef {{ readonly current?: ModelRef, readonly routeMode?: RouteMode, readonly webSearch?: WebSearchChoice }} ModelPickRequest */
|
|
53
|
+
|
|
54
|
+
/** `model` is present only when the owner pressed Select on a row; absent means
|
|
55
|
+
* "keep whatever model the stage already had" — the owner changed only the
|
|
56
|
+
* web-search chip (or nothing but still closed with a chip change). `label` is
|
|
57
|
+
* the catalog's `picker_label ?? name`, so a pill or chip shows the same words
|
|
58
|
+
* the overlay did. */
|
|
59
|
+
/** @typedef {{ readonly model?: ModelRef, readonly label?: string, readonly routeMode: RouteMode, readonly webSearch: WebSearchChoice }} ModelPick */
|
|
60
|
+
|
|
61
|
+
/** Resolves `undefined` when the owner closes without choosing. Rejects with a
|
|
62
|
+
* `DomainError` `conflict` while another `open()` is still pending — the overlay
|
|
63
|
+
* is one surface — and `capability_unavailable` when this host has no design
|
|
64
|
+
* drop to draw it with. */
|
|
65
|
+
/** @typedef {{ open(request: ModelPickRequest): Promise<ModelPick | undefined> }} ModelPickerCenter */
|
|
66
|
+
|
|
67
|
+
// ── The catalog (the shell's read model; stages never see it) ───────────────
|
|
68
|
+
//
|
|
69
|
+
// Field names are api-store's `core.api_store.selector.catalog` (ADR-001) kept
|
|
70
|
+
// verbatim, plus what the host adds: stores are PEER NODES selling models
|
|
71
|
+
// (`mine` is this node), and each model says whether this node runs it
|
|
72
|
+
// (`local`) and which peers offer it (`store_ids`, `offers`). Blended price and
|
|
73
|
+
// age in days are derived by the drawing side, never served.
|
|
74
|
+
|
|
75
|
+
/** @typedef {{ readonly city?: string, readonly lat: number, readonly lon: number }} PickerGeo */
|
|
76
|
+
|
|
77
|
+
/** A peer node that sells models. `fee` stays `null` until offerings carry a
|
|
78
|
+
* markup (today every node charges the same one and advertises the base price). */
|
|
79
|
+
/** @typedef {{ readonly id: string, readonly name: string, readonly tag: string | null, readonly fee: number | null, readonly reliability: number | null, readonly geo: PickerGeo | null }} PickerStore */
|
|
80
|
+
|
|
81
|
+
/** @typedef {{ readonly id: string, readonly name: string, readonly brand_hex: string | null, readonly popularity: number, readonly featured: boolean, readonly store_ids: readonly string[], readonly status: string, readonly local: boolean }} PickerProvider */
|
|
82
|
+
|
|
83
|
+
/** @typedef {{ readonly peer_node_id: string, readonly cost_in: number | null, readonly cost_out: number | null }} PickerOffer */
|
|
84
|
+
|
|
85
|
+
/** A vendor's notice the overlay repeats verbatim under "About" (a data-retention
|
|
86
|
+
* clause, a preview caveat). Nothing serves one yet. */
|
|
87
|
+
/** @typedef {{ readonly text: string, readonly url: string | null }} PickerNotice */
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* A model row. Every field the overlay draws is here, and the overlay draws a
|
|
91
|
+
* field ONLY when it is non-null — a missing value hides its cell, it never
|
|
92
|
+
* shows as a zero, a guess or a demo constant. The `details` block names what
|
|
93
|
+
* no source serves today; when one does, the overlay lights up without a change.
|
|
94
|
+
*
|
|
95
|
+
* Data gaps (2026-09-21) — who would fill each, and what the overlay does meanwhile:
|
|
96
|
+
* ttft_ms api-store: measured from llm_call_log (not backfilled yet) → speed cell hidden, sorts last
|
|
97
|
+
* ctx_k api-store: context_window from discovery when a provider reports it → Context stat hidden
|
|
98
|
+
* cost_in/out api-store list_available (unpriced peer offers) → "—", sorts last, no graph dot
|
|
99
|
+
* cache_read_cost no source (vendor price sheets) → "More pricing" hidden
|
|
100
|
+
* cache_write_cost no source → "More pricing" hidden
|
|
101
|
+
* modalities_in/out, max_output_k, reasoning, tool_calling, supported_params
|
|
102
|
+
* no source (vendor model cards) → those "Model details" rows hidden
|
|
103
|
+
* notice no source → no notice block
|
|
104
|
+
* provider.popularity api-store llm_platforms.popularity, DEFAULT 0 = unknown → "daily users" hidden, "popular" filter disabled
|
|
105
|
+
* store.fee by design null (every node charges the same markup) → fee row/toggle hidden
|
|
106
|
+
* store.geo, mine.geo no source → no globe marker
|
|
107
|
+
* store.reliability api-store peer_metrics.list (served) → drawn on the store card
|
|
108
|
+
*/
|
|
109
|
+
/** @typedef {{
|
|
110
|
+
* readonly id: string,
|
|
111
|
+
* readonly provider_id: string,
|
|
112
|
+
* readonly vendor_id: string,
|
|
113
|
+
* readonly name: string,
|
|
114
|
+
* readonly picker_label: string | null,
|
|
115
|
+
* readonly tier: string | null,
|
|
116
|
+
* readonly specialty: string | null,
|
|
117
|
+
* readonly latest: boolean,
|
|
118
|
+
* readonly intel: number,
|
|
119
|
+
* readonly cost_in: number | null,
|
|
120
|
+
* readonly cost_out: number | null,
|
|
121
|
+
* readonly ttft_ms: number | null,
|
|
122
|
+
* readonly ctx_k: number | null,
|
|
123
|
+
* readonly description: string | null,
|
|
124
|
+
* readonly released: string | null,
|
|
125
|
+
* readonly released_day: string | null,
|
|
126
|
+
* readonly local: boolean,
|
|
127
|
+
* readonly store_ids: readonly string[],
|
|
128
|
+
* readonly offers: readonly PickerOffer[],
|
|
129
|
+
* readonly cache_read_cost: number | null,
|
|
130
|
+
* readonly cache_write_cost: number | null,
|
|
131
|
+
* readonly modalities_in: readonly string[] | null,
|
|
132
|
+
* readonly modalities_out: readonly string[] | null,
|
|
133
|
+
* readonly max_output_k: number | null,
|
|
134
|
+
* readonly reasoning: boolean | null,
|
|
135
|
+
* readonly tool_calling: boolean | null,
|
|
136
|
+
* readonly supported_params: readonly string[] | null,
|
|
137
|
+
* readonly notice: PickerNotice | null
|
|
138
|
+
* }} PickerModel */
|
|
139
|
+
|
|
140
|
+
/** @typedef {{ readonly id: string, readonly name: string, readonly subtitle: string | null, readonly icon: string | null, readonly color: string | null, readonly auto: boolean }} PickerSearchOption */
|
|
141
|
+
|
|
142
|
+
/** @typedef {{ readonly id: string, readonly count: number }} PickerRecent */
|
|
143
|
+
|
|
144
|
+
/** `state` is the host's word for the whole payload — the same vocabulary the
|
|
145
|
+
* app-lifecycle view uses — so the overlay can say "still asking" or "the API
|
|
146
|
+
* Store did not answer" instead of drawing an empty table. */
|
|
147
|
+
/** @typedef {{
|
|
148
|
+
* readonly state: "ready" | "loading" | "error",
|
|
149
|
+
* readonly error: string | null,
|
|
150
|
+
* readonly mine: { readonly name: string, readonly geo: PickerGeo | null },
|
|
151
|
+
* readonly stores: readonly PickerStore[],
|
|
152
|
+
* readonly providers: readonly PickerProvider[],
|
|
153
|
+
* readonly models: readonly PickerModel[],
|
|
154
|
+
* readonly web_search_options: readonly PickerSearchOption[],
|
|
155
|
+
* readonly recents: readonly PickerRecent[]
|
|
156
|
+
* }} ModelPickerCatalog */
|
|
157
|
+
|
|
158
|
+
/** The web-search chip the node routes with. Not a vendor, so api-store has no row
|
|
159
|
+
* for it unless an owner curated one; the catalog adapter guarantees it is present. */
|
|
160
|
+
export const WEB_SEARCH_AUTO = "auto";
|
|
161
|
+
|
|
162
|
+
/** The kernel row: the catalog without the owner's recents (those live in
|
|
163
|
+
* `client-settings`, per device) and without `state` (a row that exists IS ready;
|
|
164
|
+
* the shell composes `loading`/`error` itself). */
|
|
165
|
+
/** @typedef {Omit<ModelPickerCatalog, "state" | "error" | "recents"> & { readonly id: string }} ModelPickerCatalogRow */
|
|
166
|
+
|
|
167
|
+
/** @param {unknown} value @returns {value is RouteMode} */
|
|
168
|
+
export function isRouteMode(value) {
|
|
169
|
+
return typeof value === "string" && (/** @type {readonly string[]} */ (ROUTE_MODES)).includes(value);
|
|
170
|
+
}
|
package/src/stage-context.js
CHANGED
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
/** @typedef {import("@econ-v1/domain").QueryName} QueryName */
|
|
5
5
|
/** @typedef {import("./client.js").Unsubscribe} Unsubscribe */
|
|
6
6
|
/** @typedef {import("./dialog-contract.js").DialogCenter} DialogCenter */
|
|
7
|
+
/** @typedef {import("./model-picker-contract.js").ModelPickerCenter} ModelPickerCenter */
|
|
7
8
|
/** @typedef {import("./system-notice-contract.js").SystemNoticeCenter} SystemNoticeCenter */
|
|
8
9
|
/** @typedef {{ unmount(): Promise<void> }} MountedStage */
|
|
9
10
|
/** @typedef {(appName: string, slot: Element) => Promise<MountedStage>} StageLoadHandler */
|
|
@@ -20,7 +21,7 @@
|
|
|
20
21
|
* }} StageContextShared */
|
|
21
22
|
/** @typedef {{ navigate(path: string): void, readonly root: Element }} StageHostShared */
|
|
22
23
|
/** @typedef {StageContextShared & { readonly host: StageHostShared & { readonly uiApi: 1 } }} StageContextV1 */
|
|
23
|
-
/** @typedef {StageContextShared & { readonly host: StageHostShared & { readonly dialogs: DialogCenter, readonly systemNotices: SystemNoticeCenter, readonly uiApi: 2 } }} StageContextV2 */
|
|
24
|
+
/** @typedef {StageContextShared & { readonly host: StageHostShared & { readonly dialogs: DialogCenter, readonly modelPicker: ModelPickerCenter, readonly systemNotices: SystemNoticeCenter, readonly uiApi: 2 } }} StageContextV2 */
|
|
24
25
|
/** @typedef {StageContextV1 | StageContextV2} StageContext */
|
|
25
26
|
/** @typedef {{ mount(ctx: StageContext): void | Promise<void>, unmount(): void | Promise<void> }} StageModule */
|
|
26
27
|
|