autosolutions-os 0.2.5 → 0.3.1

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/nav.d.ts CHANGED
@@ -1,12 +1,23 @@
1
1
  /**
2
- * The OS menu: the rail every app shows, the 53 tools of the menu map by
3
- * function, and the one set of routing rules that turns a location into a
4
- * place in the workspace frame and a click into a destination.
2
+ * The OS menu: the rail every app shows, Cliff's menu map by function (the
3
+ * design of 16 October 2026), the Hub's own panel, and the one set of routing
4
+ * rules that turns a location into a place in the workspace frame and a click
5
+ * into a destination.
5
6
  *
6
7
  * Three levels, the same in every AutoSolutions webapp:
7
- * 1 the rail Hub, Finance, Marketing, Commercial, Operations
8
- * 2 the menu that function's tools, grouped Reporting / Planning
9
- * 3 the tab menu the open tool's views, with Back to hub
8
+ * 1 the rail Hub, Finance, Marketing, Commercial, Operations
9
+ * 2 the menu that function's tools, grouped Reporting / Planning
10
+ * (Performance / Planning / Creative in Marketing),
11
+ * an Overview first in Finance, Commercial and
12
+ * Operations; the Hub's is Smart Comms Hub and
13
+ * Assistants
14
+ * 3 the tool's panel an app's own tool, open: its icon and name, then its
15
+ * views as tabs (design system 6.5.0; no Back to hub)
16
+ *
17
+ * Every row goes somewhere: to the tool's app, when the person holds it, or
18
+ * else to the tool's page in the Hub (`osHubPath`), built from the design's
19
+ * sample dashboards. A row is locked only when its tool has an app the person
20
+ * does not hold, or while the catalogue is still being asked.
10
21
  *
11
22
  * Pure data and pure functions: no React, no Supabase. An app that is not on
12
23
  * the core imports this beside the design system's WorkspaceFrame; an app on
@@ -26,12 +37,25 @@ export type OsNavItem = {
26
37
  badge?: string | number;
27
38
  };
28
39
  export type OsToolStatus = "Live" | "In progress" | "To build" | "No status";
40
+ /**
41
+ * One of a tool's views, as the menu map names it (0.3.0). The tool's page in
42
+ * the Hub shows them as tabs under its header, and `?tab=<id>` opens one.
43
+ */
44
+ export type OsToolTab = {
45
+ id: string;
46
+ label: string;
47
+ };
29
48
  export type OsTool = {
30
49
  id: string;
31
50
  label: string;
32
51
  icon: string;
33
52
  status: OsToolStatus;
53
+ /** The tool's views, as the menu map gives them (0.3.0). */
54
+ tabs?: OsToolTab[];
55
+ /** The function's own Overview row (0.3.0): its page in the Hub is the function's. */
56
+ overview?: boolean;
34
57
  };
58
+ /** A group of the menu. The Overview row's group has no title (""). */
35
59
  export type OsToolGroup = {
36
60
  title: string;
37
61
  items: OsTool[];
@@ -40,17 +64,39 @@ export type OsMenuFunction = "finance" | "marketing" | "commercial" | "operation
40
64
  /** The rail: the Hub, then the four business functions. */
41
65
  export declare const OS_FUNCTIONS: OsNavItem[];
42
66
  /**
43
- * "Menu map - all 49 items by function", as the design handoff carries it,
44
- * plus four Live apps the sheet did not have: Shelf simulator (Marketing >
67
+ * Cliff's menu map (the design's ui_kits/functions dashboards/nav.js and
68
+ * data.js, 16 October 2026): its ids, labels, groups, order, status and
69
+ * views, an Overview at the top of Finance, Commercial and Operations, and
70
+ * the two rows the design keeps from before its merge (Customer scorecard,
71
+ * Clearance list). Then our four Live apps the map does not have, at the end
72
+ * of their groups, so they stay reachable: Shelf simulator (Marketing >
45
73
  * Planning), Key accounts (Commercial > Planning), PM Copilot and Candidate
46
- * hub (Operations > Planning). Owner, source and cadence stay in the sheet.
47
- * Icons are glyph ids from the design system's NAV_ICONS, which draws them
48
- * inline; the four new rows borrow ops-inventory-value (a stocked shelf),
49
- * com-customer-scorecard, hub-tasks and hub-accounts.
74
+ * hub (Operations > Planning); they borrow ops-inventory-value (a stocked
75
+ * shelf), com-customer-scorecard, hub-tasks and hub-accounts. Owner, source
76
+ * and cadence stay in the sheet. Icons are glyph ids from the design
77
+ * system's NAV_ICONS, which draws them inline. Ids renamed in 0.3.0 are in
78
+ * OS_TOOL_ALIASES.
50
79
  */
51
80
  export declare const OS_MENU: Record<OsMenuFunction, OsToolGroup[]>;
52
81
  /**
53
- * Where a Live tool lives. `app` is its catalogue key: in a frame backed by
82
+ * Ids the menu map had before 0.3.0, and the row each is now: an app that
83
+ * still passes one (a tool of its own, a link, a reason it is locked) lands
84
+ * on the new row. Inventory value kept its id and moved to Finance, as
85
+ * Inventory valuation.
86
+ */
87
+ export declare const OS_TOOL_ALIASES: Readonly<Record<string, string>>;
88
+ /** The menu map's id for `id`: itself, or the row an id from before 0.3.0 is now. */
89
+ export declare function osToolId(id: string): string;
90
+ /**
91
+ * The page in the Hub where a row with no app of its own goes (0.3.0): the
92
+ * function's overview (`/os/finance`), a tool's page (`/os/finance/cash-forecast`)
93
+ * or one of its views (`/os/finance/cash-forecast?tab=cf-accuracy`). The Hub
94
+ * builds these pages from the design's sample dashboards. A path in the Hub:
95
+ * other apps reach it through HUB_URL.
96
+ */
97
+ export declare function osHubPath(fn: string, toolId?: string | null, tab?: string | null): string;
98
+ /**
99
+ * Where a tool's app lives. `app` is its catalogue key: in a frame backed by
54
100
  * the catalogue (OsWorkspaceFrame), the tool links to that app's address from
55
101
  * os_context(), with the company as ?tenant=, only when the person holds the
56
102
  * app, and is locked when they do not. `url` is a fixed address, used only by
@@ -63,13 +109,17 @@ export type OsToolLink = {
63
109
  url?: string;
64
110
  };
65
111
  /**
66
- * Where the tools go: every Live tool, and the tools whose app is already in
67
- * the catalogue whatever the map says of them (Influencer Manager, Marketing
68
- * calendar, Paid media), so every app the app switcher offers is reachable
69
- * from the menu too. Every link opens in the same tab. Pricing researcher and
70
- * Brand voice copywriter have no app to open yet, so they stay unlinked
71
- * ("Live, not linked from the Hub yet"). The Hub itself (smart_comms_hub) is
72
- * the rail's Hub, not a row.
112
+ * The tools that have an app of their own: every Live tool's, unchanged in
113
+ * 0.3.0 but for the new ids (Sales was live-sales-by-channel; Inventory
114
+ * valuation, in Finance now, keeps inventory-value), and the tools whose app
115
+ * the catalogue already has whatever the map says of them (Influencer
116
+ * Manager, Marketing calendar, Paid media), so every app the app switcher
117
+ * offers is reachable from the menu too. Every link opens in the same tab.
118
+ * Label Maker's fixed address is label-maker.autosolutions.app since 0.3.1:
119
+ * the old label-maker-app.lovable.app address cannot read the shared session.
120
+ * Pricing researcher and Brand voice copywriter have no app to open yet:
121
+ * like every tool with none, they open their page in the Hub. The Hub itself
122
+ * (smart_comms_hub) is the rail's Hub, not a row.
73
123
  */
74
124
  export declare const OS_TOOL_LINKS: Record<string, OsToolLink>;
75
125
  /** The Hub's own pages, for the rail's Hub, Admin and Settings rows in other apps. */
@@ -79,9 +129,11 @@ export declare const HUB_PATHS: {
79
129
  readonly settings: "/comms/settings";
80
130
  };
81
131
  /**
82
- * Why a row is locked. A tool whose status is In progress or To build says so
83
- * instead. `checking` is a Live tool whose app the catalogue decides, while
84
- * os_context() has not answered yet (or failed, and is being asked again).
132
+ * Why a row is locked. Since 0.3.0 a row is locked only when its tool has an
133
+ * app the person does not hold (`locked`), or while os_context() has not
134
+ * answered yet, or failed and is being asked again (`checking`): every other
135
+ * row opens its app or its page in the Hub. `notBuilt` and `notLinked` are no
136
+ * longer drawn by the frame, and stay for code that reads them.
85
137
  */
86
138
  export declare const HINTS: {
87
139
  readonly locked: "Ask your company admin to switch this on for you";
@@ -95,30 +147,28 @@ export declare function osFooter({ admin }?: {
95
147
  }): OsNavItem[];
96
148
  /**
97
149
  * Tool id to address, for the tools with a fixed `url`: what a frame off the
98
- * core, which has no catalogue to ask, can link to. No tenant hint.
150
+ * core, which has no catalogue to ask, can link to. No tenant hint. Every
151
+ * other row of such a frame opens its page in the Hub, through HUB_URL.
99
152
  */
100
153
  export declare function staticLinks(): Record<string, string>;
101
154
  /**
102
155
  * Tool id to address, and tool id to the reason a row is off, for
103
156
  * OsWorkspaceFrame to pass to osFrame. `apps` is os_context().apps: the apps
104
157
  * this person holds in the acting company, as the app switcher lists them.
105
- * For a tool whose OS_TOOL_LINKS entry names an app:
158
+ * For a tool whose OS_TOOL_LINKS entry names an app, whatever status the map
159
+ * gives the tool:
106
160
  * - held, with an address: linked to it (plus `path`), with the company as
107
- * ?tenant=, whatever status the map gives the tool, because the switcher
108
- * already offers that app;
109
- * - held, not deployed yet (no address): a Live tool reads "Live, not linked
110
- * from the Hub yet"; any other keeps the map's own status;
111
- * - not held: a Live tool is locked ("Ask your company admin to switch this
112
- * on for you"); any other keeps the map's own status (Not built yet, In
113
- * progress, To build).
161
+ * ?tenant=, because the switcher already offers that app;
162
+ * - held, not deployed yet (no address): neither, so the frame opens the
163
+ * tool's page in the Hub, as it does for a tool with no app;
164
+ * - not held: locked ("Ask your company admin to switch this on for you").
114
165
  * A fixed `url` is never consulted here: it is no way round the catalogue.
115
- * Tools with no app keep osFrame's own rules. Links are final: osFrame adds
116
- * nothing to them.
166
+ * Tools with no app open their page in the Hub (osFrame). Links are final:
167
+ * osFrame adds nothing to them.
117
168
  *
118
169
  * With `apps` null (the catalogue has not answered yet, or the read failed
119
- * and is being asked again), nothing is linked, and a Live tool with an app
120
- * reads "Checking your access…" rather than claiming it is not linked or not
121
- * held; any other keeps the map's own status.
170
+ * and is being asked again), nothing is linked, and every tool with an app
171
+ * reads "Checking your access…" rather than claiming it is held or not.
122
172
  */
123
173
  export declare function catalogueLinks(apps: ReadonlyArray<{
124
174
  key: string;
@@ -141,15 +191,17 @@ export type OsTabGroup = {
141
191
  items: OsTab[];
142
192
  };
143
193
  /**
144
- * One of this app's own tools. `id` is an OS_MENU tool id, which places it in
145
- * the menu and enables it however the map marks it; an id the map does not
146
- * have needs `fn`, `section`, `label` and `icon` to be placed.
194
+ * One of this app's own tools. `id` is an OS_MENU tool id (or one it had
195
+ * before 0.3.0, OS_TOOL_ALIASES), which places it in the menu and enables it
196
+ * however the map marks it; an id the map does not have needs `fn`,
197
+ * `section`, `label` and `icon` to be placed.
147
198
  */
148
199
  export type OsAppTool = OsRoute & {
149
200
  id: string;
150
201
  /**
151
- * The third menu, flat or in titled groups. Tabs with a `path` navigate;
152
- * tabs without are page state, read from the frame's state.
202
+ * The tool's own views, flat or in titled groups: opened, the panel shows
203
+ * the tool's icon and name, then these (design system 6.5.0). Tabs with a
204
+ * `path` navigate; tabs without are page state, read from the frame's state.
153
205
  */
154
206
  tabs?: OsTab[] | OsTabGroup[];
155
207
  /** false for a tool that carries its own tab row in the page: opening it closes the menu. */
@@ -161,7 +213,7 @@ export type OsAppTool = OsRoute & {
161
213
  label?: string;
162
214
  icon?: string;
163
215
  };
164
- /** A row in the Hub function's menu. The Hub passes its own; other apps pass none. */
216
+ /** A row in the Hub function's menu. */
165
217
  export type OsHubItem = OsNavItem & Partial<OsRoute> & {
166
218
  href?: string;
167
219
  tabs?: OsTab[] | OsTabGroup[];
@@ -171,6 +223,14 @@ export type OsHubSection = {
171
223
  title?: string;
172
224
  items: OsHubItem[];
173
225
  };
226
+ /**
227
+ * The Hub's panel (0.3.0), the design's: Smart Comms Hub, its eight views,
228
+ * then the Assistants. Every app shows it when the rail's Hub is selected,
229
+ * each row a link to its page in the Hub (in the Hub, its own route). The Hub
230
+ * may pass rows of its own instead (`hubItems`), to lock the Assistants it
231
+ * gates.
232
+ */
233
+ export declare const OS_HUB_MENU: OsHubSection[];
174
234
  /** A menu row as osFrame hands it to WorkspaceFrame. */
175
235
  export type OsMenuRow = OsNavItem & {
176
236
  path?: string;
@@ -197,8 +257,9 @@ export type OsTarget = {
197
257
  };
198
258
  /**
199
259
  * The part of WorkspaceFrame's state a destination depends on. `reselect` is
200
- * WorkspaceFrame's flag for a click on what it already shows, `back` its flag
201
- * for Back to hub (design system 6.3.4).
260
+ * WorkspaceFrame's flag for a click on what it already shows. `back` was its
261
+ * flag for Back to hub (design system 6.3.4), which 6.5.0 no longer draws:
262
+ * still honoured, for a caller that passes it.
202
263
  */
203
264
  export type OsFrameState = {
204
265
  fn: {
@@ -217,10 +278,16 @@ export type OsFrameOptions = {
217
278
  /** This app's catalogue key; "hub" for the Hub itself. */
218
279
  appKey: string;
219
280
  tools?: OsAppTool[];
281
+ /**
282
+ * The Hub function's menu. Default OS_HUB_MENU, the design's Hub panel:
283
+ * links into the Hub (in the Hub, its own routes). The Hub passes its own
284
+ * rows to lock what it gates; `[]` for no Hub menu, and then the rail's Hub
285
+ * goes to the Hub, as before 0.3.0.
286
+ */
220
287
  hubItems?: OsHubSection[];
221
288
  /** Tool id to address, for tools served by other apps (catalogueLinks or staticLinks). Used as given. */
222
289
  links?: Record<string, string>;
223
- /** Tool id to the reason its row is off (catalogueLinks): wins over the map's status. */
290
+ /** Tool id to the reason its row is off (catalogueLinks): wins over the tool's page in the Hub. */
224
291
  locked?: Record<string, string>;
225
292
  /** Show Admin in the footer. */
226
293
  admin?: boolean;
@@ -242,13 +309,13 @@ export type OsFrame = {
242
309
  locate: (location: string) => OsLocation;
243
310
  /**
244
311
  * Where a click from `location` goes; null when it goes nowhere (opening a
245
- * menu, the rail's Hub inside the Hub, a locked row, or already there).
246
- * In the Hub the hub function with no row is the rail's Hub; Back to hub
247
- * is that state with `back: true`, so a caller that means it passes the
248
- * flag. A reselect (`state.reselect`, a
249
- * click on the tab or row the frame already shows) goes to that tab's or
250
- * row's own path unless `location` is exactly it, so a page filed under a
251
- * tab (a draft under Requests) goes back to the tab's page.
312
+ * menu, the rail's Hub where it has a menu, a locked row, or already
313
+ * there). In the Hub the hub function with no row is the rail's Hub; Back
314
+ * to hub (design system 6.4 and before) is that state with `back: true`. A
315
+ * reselect (`state.reselect`, a click on the tab or row the frame already
316
+ * shows) goes to that tab's or row's own path unless `location` is exactly
317
+ * it, so a page filed under a tab (a draft under Requests) goes back to the
318
+ * tab's page.
252
319
  */
253
320
  targetFor: (state: OsFrameState, location: string) => OsTarget | null;
254
321
  };