@mapples/types 1.6.0-rc.20261005122106 → 2.0.0-beta.20261029112059

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,6 +1,10 @@
1
1
  # @mapples/types
2
2
 
3
- ## 1.6.0-rc.20261005122106
3
+ ## 2.0.0-beta.20261029112059
4
+
5
+ ### Major Changes
6
+
7
+ - cffb0d6: Mapples 2.0: every `@mapples/*` and `@mapplesorg/*` package is released as 2.0.0, together with the `mapples` CLI 2.0.0. Apps generated by the CLI depend on `@mapples/*` `^2.0.0`.
4
8
 
5
9
  ### Minor Changes
6
10
 
@@ -14,6 +18,8 @@
14
18
  - `@mapples/sid-ast`: a newly added attribute (a binding's `$data`) goes right after the last attribute — no double space, and the space before `/>` stays.
15
19
  - `@mapplesorg/canvas`: frame chrome follows the shared header rule (no `Auth`/`Auth` double header); switching an action's type drops the previous type's `staticData` keys (no stale `pageUuid` on a set-variable action).
16
20
 
21
+ - 04e6583: `LiveHelloFrame.agent`: the live agent-session lease as a v2 `agent` frame, or null when none is live. Editor and CLI sockets only; absent from viewers and from hubs that predate it.
22
+ - 7afa74c: Live hub: the canvas-api WebSocket's wire types (`@mapples/types` live.ts), a `CanvasHost` service so the Creator commits to the droplet with Lambda as the bypass, and chat protocol `mapples-ai/3` — session-scoped, resumable turns with seq-numbered frames, rooms, and the design streams over the socket.
17
23
  - b1b8560: Header options now apply to every navigator type, and their default is explicit. A tabs or drawer navigator draws a header of its own, but only a stack's options were mapped — so a navigator nested in a stack always stacked a second header under its parent's with nothing that could turn it off. `resolveNavigatorHeader` and `navigatorHeaderVisible` expose the navigator default (`visible` unset means shown), so an editor can present a plain on/off instead of a tri-state that reads "off" while the header is up; route-level `visible` stays tri-state, because unset there means "inherit the navigator". `NavigationDocument.canvas` carries editor-only canvas preferences, ignored by the runtime the same way `NavigatorNode.canvas` is.
18
24
  - 7339399: Designed navigator chrome. A tabs navigator's `TabBarOptions.componentUuid` and a drawer's `DrawerOptions.componentUuid` name a saved component that renders the bar or the drawer content, and `TabBarOptions.native` asks the exported app for expo-router's `NativeTabs`. `@mapples/render` carries the contract (`NavigatorChromeContext`, `useNavigatorChrome`): the navigator's routes as items with a label, an active flag and an icon renderer, plus `select`, `close` and the safe-area insets. Two new `@mapples/components` elements read it — `TabBarItems` (one tab per route, pill, labels, badges' tones) and `DrawerItems` (one row per route) — and show a notice when the component is not a navigator's design yet; `@mapples/components` now peers on `@mapples/render`. `@mapples/navigation` mounts a design through `TabBarHost` / `DrawerContentHost` (React Navigation's `tabBar` / `drawerContent`, reading only their props so an exported app uses them as-is) when `MapplesNavigation` is given the `chrome` map, and keeps `visible: false` working for a custom bar. The Creator canvas draws a designed tab bar on every screen frame with its measured height as the bottom inset, a platform-styled placeholder for a native bar, frames a chrome master on the components surface at the chrome's shape with the navigator's routes flowing in, and labels storyboard sections with their design. `create_navigator_chrome` creates and assigns a starter design; `set_navigator_options` accepts the new fields.
19
25
  - 35e9ba6: Guards on navigator routes, built-in glyph tab icons, and storyboard placement fixes (RC #16, #20, #21, #22, #33, #34).
package/dist/index.d.ts CHANGED
@@ -10,4 +10,5 @@ export * from './variables';
10
10
  export * from './variablesValidator';
11
11
  export * from './packages';
12
12
  export * from './packagesValidator';
13
+ export * from './live';
13
14
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC;AAC7B,cAAc,uBAAuB,CAAC;AACtC,cAAc,OAAO,CAAC;AACtB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,aAAa,CAAC;AAC5B,cAAc,sBAAsB,CAAC;AACrC,cAAc,YAAY,CAAC;AAC3B,cAAc,qBAAqB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC;AAC7B,cAAc,uBAAuB,CAAC;AACtC,cAAc,OAAO,CAAC;AACtB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,aAAa,CAAC;AAC5B,cAAc,sBAAsB,CAAC;AACrC,cAAc,YAAY,CAAC;AAC3B,cAAc,qBAAqB,CAAC;AACpC,cAAc,QAAQ,CAAC"}
package/dist/index.js CHANGED
@@ -10,4 +10,5 @@ export * from './variables';
10
10
  export * from './variablesValidator';
11
11
  export * from './packages';
12
12
  export * from './packagesValidator';
13
+ export * from './live';
13
14
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC;AAC7B,cAAc,uBAAuB,CAAC;AACtC,cAAc,OAAO,CAAC;AACtB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,aAAa,CAAC;AAC5B,cAAc,sBAAsB,CAAC;AACrC,cAAc,YAAY,CAAC;AAC3B,cAAc,qBAAqB,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC;AAC7B,cAAc,uBAAuB,CAAC;AACtC,cAAc,OAAO,CAAC;AACtB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,aAAa,CAAC;AAC5B,cAAc,sBAAsB,CAAC;AACrC,cAAc,YAAY,CAAC;AAC3B,cAAc,qBAAqB,CAAC;AACpC,cAAc,QAAQ,CAAC"}
package/dist/live.d.ts ADDED
@@ -0,0 +1,143 @@
1
+ /**
2
+ * The live hub — `wss://<canvas host>/canvas/stream?project=…` on canvas-api
3
+ * (service--mapplesorg `api/canvas/hub.py` + `ws.py`, protocol v2). Server →
4
+ * client only; a client sends `pong`, `name` and `focus` and nothing else.
5
+ * Writes never travel here: commits, selection, captures and comments keep
6
+ * their HTTP routes, and the hub tells peers that they happened.
7
+ *
8
+ * Shared by the Creator and the `mapples` CLI, which is why the shapes live
9
+ * in this public package rather than in `@mapplesorg/api`.
10
+ */
11
+ /** Who holds a socket on a project, as the hub reports it. */
12
+ export type LiveClientKind = 'editor' | 'cli' | 'viewer' | 'mcp';
13
+ export interface LiveMember {
14
+ /** Per-connection id, stable for the socket's lifetime. */
15
+ client: string;
16
+ kind: LiveClientKind;
17
+ /** Signed-in members (editor sockets). */
18
+ user?: {
19
+ uuid: string;
20
+ name: string | null;
21
+ };
22
+ /** A viewer's self-given name, or a CLI/MCP agent label. */
23
+ name?: string | null;
24
+ /** The agent behind a `cli` / `mcp` member (`claude-code`, `cursor`, …). */
25
+ agent?: string | null;
26
+ /** The page/component the member has open, from its `focus` frames. */
27
+ focus?: string | null;
28
+ since: string;
29
+ lastSeen: string;
30
+ }
31
+ export interface LiveHelloFrame {
32
+ type: 'hello';
33
+ project: string;
34
+ head: string | null;
35
+ seq: number | null;
36
+ you: {
37
+ client: string;
38
+ kind: LiveClientKind;
39
+ user?: {
40
+ uuid: string;
41
+ name: string | null;
42
+ };
43
+ name?: string | null;
44
+ };
45
+ presence: LiveMember[];
46
+ /**
47
+ * The live agent-session lease as a v2 `agent` frame, or null when none is
48
+ * live. Editor and CLI sockets only; absent from viewers and from hubs
49
+ * that predate it, which clients read as "ask the agent-session route".
50
+ */
51
+ agent?: LiveAgentFrame | null;
52
+ /** Unix seconds; the socket closes 4408 then (JWT sockets only). */
53
+ exp?: number;
54
+ }
55
+ export interface LiveHeadFrame {
56
+ type: 'head' | 'revert';
57
+ project: string;
58
+ head: string;
59
+ seq: number;
60
+ }
61
+ export interface LiveAgentStep {
62
+ index: number;
63
+ title: string;
64
+ status: 'pending' | 'running' | 'done' | 'failed' | 'skipped';
65
+ detail: string | null;
66
+ startedAt: string | null;
67
+ finishedAt: string | null;
68
+ }
69
+ /**
70
+ * An agent-session lease moved. v1 carried only `session`, `status`, `step`
71
+ * and `rev`; v2 adds the full summary so a client can apply it without a
72
+ * GET. Clients treat the optional fields as "v1 hub" when absent.
73
+ */
74
+ export interface LiveAgentFrame {
75
+ type: 'agent';
76
+ project: string;
77
+ session: string;
78
+ status: 'active' | 'done' | 'failed' | 'expired' | 'disconnected';
79
+ step: string | null;
80
+ rev: number;
81
+ currentStep?: string | null;
82
+ steps?: LiveAgentStep[];
83
+ expiresAt?: string;
84
+ agent?: string;
85
+ label?: string | null;
86
+ }
87
+ export interface LivePresenceFrame {
88
+ type: 'presence';
89
+ project: string;
90
+ members: LiveMember[];
91
+ }
92
+ /** `PUT /projects/{p}/editor-context` landed; `context` null = cleared. */
93
+ export interface LiveSelectionFrame {
94
+ type: 'selection';
95
+ project: string;
96
+ context: unknown | null;
97
+ }
98
+ export interface LiveCaptureFrame {
99
+ type: 'capture';
100
+ project: string;
101
+ id: string;
102
+ status: 'requested' | 'ready' | 'failed';
103
+ requestedAt?: string;
104
+ }
105
+ export interface LiveCommentFrame {
106
+ type: 'comment';
107
+ project: string;
108
+ op: 'created' | 'updated' | 'deleted';
109
+ /** The comment as the comment routes serialise it; `{uuid}` on delete. */
110
+ comment: {
111
+ uuid: string;
112
+ } & Record<string, unknown>;
113
+ /** The same clock the list route returns — the next `?since=` cursor. */
114
+ serverTime: string;
115
+ }
116
+ /** A Paddle webhook moved the workspace's subscription row. */
117
+ export interface LiveSubscriptionFrame {
118
+ type: 'subscription';
119
+ workspace: string;
120
+ status: string;
121
+ /** The plan slug, null once the workspace is back on free. */
122
+ plan: string | null;
123
+ updatedAt: string | null;
124
+ }
125
+ export interface LivePingFrame {
126
+ type: 'ping';
127
+ }
128
+ export type LiveFrame = LiveHelloFrame | LiveHeadFrame | LiveAgentFrame | LivePresenceFrame | LiveSelectionFrame | LiveCaptureFrame | LiveCommentFrame | LiveSubscriptionFrame | LivePingFrame;
129
+ export type LiveFrameType = LiveFrame['type'];
130
+ export type LiveClientFrame = {
131
+ type: 'pong';
132
+ } | {
133
+ type: 'name';
134
+ name: string;
135
+ } | {
136
+ type: 'focus';
137
+ container?: string | null;
138
+ };
139
+ /** Close codes the hub uses beyond the standard ones. */
140
+ export declare const LIVE_CLOSE_UNAUTHORIZED = 4401;
141
+ export declare const LIVE_CLOSE_FORBIDDEN = 4403;
142
+ export declare const LIVE_CLOSE_EXPIRED = 4408;
143
+ //# sourceMappingURL=live.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"live.d.ts","sourceRoot":"","sources":["../src/live.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,8DAA8D;AAC9D,MAAM,MAAM,cAAc,GAAG,QAAQ,GAAG,KAAK,GAAG,QAAQ,GAAG,KAAK,CAAC;AAEjE,MAAM,WAAW,UAAU;IACzB,2DAA2D;IAC3D,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,cAAc,CAAC;IACrB,0CAA0C;IAC1C,IAAI,CAAC,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAA;KAAE,CAAC;IAC7C,4DAA4D;IAC5D,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,4EAA4E;IAC5E,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,uEAAuE;IACvE,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,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IACf,8DAA8D;IAC9D,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;CAC1B;AAED,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,MAAM,SAAS,GACjB,cAAc,GACd,aAAa,GACb,cAAc,GACd,iBAAiB,GACjB,kBAAkB,GAClB,gBAAgB,GAChB,gBAAgB,GAChB,qBAAqB,GACrB,aAAa,CAAC;AAElB,MAAM,MAAM,aAAa,GAAG,SAAS,CAAC,MAAM,CAAC,CAAC;AAE9C,MAAM,MAAM,eAAe,GACvB;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,GAChB;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GAC9B;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE,CAAC;AAEjD,yDAAyD;AACzD,eAAO,MAAM,uBAAuB,OAAO,CAAC;AAC5C,eAAO,MAAM,oBAAoB,OAAO,CAAC;AACzC,eAAO,MAAM,kBAAkB,OAAO,CAAC"}
package/dist/live.js ADDED
@@ -0,0 +1,15 @@
1
+ /**
2
+ * The live hub — `wss://<canvas host>/canvas/stream?project=…` on canvas-api
3
+ * (service--mapplesorg `api/canvas/hub.py` + `ws.py`, protocol v2). Server →
4
+ * client only; a client sends `pong`, `name` and `focus` and nothing else.
5
+ * Writes never travel here: commits, selection, captures and comments keep
6
+ * their HTTP routes, and the hub tells peers that they happened.
7
+ *
8
+ * Shared by the Creator and the `mapples` CLI, which is why the shapes live
9
+ * in this public package rather than in `@mapplesorg/api`.
10
+ */
11
+ /** Close codes the hub uses beyond the standard ones. */
12
+ export const LIVE_CLOSE_UNAUTHORIZED = 4401;
13
+ export const LIVE_CLOSE_FORBIDDEN = 4403;
14
+ export const LIVE_CLOSE_EXPIRED = 4408;
15
+ //# sourceMappingURL=live.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"live.js","sourceRoot":"","sources":["../src/live.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AA6IH,yDAAyD;AACzD,MAAM,CAAC,MAAM,uBAAuB,GAAG,IAAI,CAAC;AAC5C,MAAM,CAAC,MAAM,oBAAoB,GAAG,IAAI,CAAC;AACzC,MAAM,CAAC,MAAM,kBAAkB,GAAG,IAAI,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mapples/types",
3
- "version": "1.6.0-rc.20261005122106",
3
+ "version": "2.0.0-beta.20261029112059",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "scripts": {