@rollrook-ai/sdk 0.0.0-stage → 0.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.
Files changed (143) hide show
  1. package/dist/agents.d.ts +9 -0
  2. package/dist/agents.d.ts.map +1 -0
  3. package/dist/agents.js +13 -0
  4. package/dist/agents.js.map +1 -0
  5. package/dist/assets.d.ts +35 -0
  6. package/dist/assets.d.ts.map +1 -0
  7. package/dist/assets.js +66 -0
  8. package/dist/assets.js.map +1 -0
  9. package/dist/assistant.d.ts +76 -0
  10. package/dist/assistant.d.ts.map +1 -0
  11. package/dist/assistant.js +161 -0
  12. package/dist/assistant.js.map +1 -0
  13. package/dist/audio.d.ts +55 -0
  14. package/dist/audio.d.ts.map +1 -0
  15. package/dist/audio.js +82 -0
  16. package/dist/audio.js.map +1 -0
  17. package/dist/bridge.d.ts +51 -0
  18. package/dist/bridge.d.ts.map +1 -0
  19. package/dist/bridge.js +78 -0
  20. package/dist/bridge.js.map +1 -0
  21. package/dist/calendar.d.ts +33 -0
  22. package/dist/calendar.d.ts.map +1 -0
  23. package/dist/calendar.js +63 -0
  24. package/dist/calendar.js.map +1 -0
  25. package/dist/context.d.ts +19 -0
  26. package/dist/context.d.ts.map +1 -0
  27. package/dist/context.js +25 -0
  28. package/dist/context.js.map +1 -0
  29. package/dist/errors.d.ts +74 -0
  30. package/dist/errors.d.ts.map +1 -0
  31. package/dist/errors.js +111 -0
  32. package/dist/errors.js.map +1 -0
  33. package/dist/events.d.ts +36 -0
  34. package/dist/events.d.ts.map +1 -0
  35. package/dist/events.js +81 -0
  36. package/dist/events.js.map +1 -0
  37. package/dist/files.d.ts +29 -0
  38. package/dist/files.d.ts.map +1 -0
  39. package/dist/files.js +43 -0
  40. package/dist/files.js.map +1 -0
  41. package/dist/index.d.ts +84 -0
  42. package/dist/index.d.ts.map +1 -0
  43. package/dist/index.js +78 -0
  44. package/dist/index.js.map +1 -0
  45. package/dist/mock/index.d.ts +4 -0
  46. package/dist/mock/index.d.ts.map +1 -0
  47. package/dist/mock/index.js +3 -0
  48. package/dist/mock/index.js.map +1 -0
  49. package/dist/mock/mock-host.d.ts +255 -0
  50. package/dist/mock/mock-host.d.ts.map +1 -0
  51. package/dist/mock/mock-host.js +1274 -0
  52. package/dist/mock/mock-host.js.map +1 -0
  53. package/dist/mock/samples.d.ts +56 -0
  54. package/dist/mock/samples.d.ts.map +1 -0
  55. package/dist/mock/samples.js +283 -0
  56. package/dist/mock/samples.js.map +1 -0
  57. package/dist/mock/toolbar.d.ts +95 -0
  58. package/dist/mock/toolbar.d.ts.map +1 -0
  59. package/dist/mock/toolbar.js +279 -0
  60. package/dist/mock/toolbar.js.map +1 -0
  61. package/dist/net.d.ts +13 -0
  62. package/dist/net.d.ts.map +1 -0
  63. package/dist/net.js +26 -0
  64. package/dist/net.js.map +1 -0
  65. package/dist/plugin.d.ts +11 -0
  66. package/dist/plugin.d.ts.map +1 -0
  67. package/dist/plugin.js +13 -0
  68. package/dist/plugin.js.map +1 -0
  69. package/dist/raven.d.ts +51 -0
  70. package/dist/raven.d.ts.map +1 -0
  71. package/dist/raven.js +100 -0
  72. package/dist/raven.js.map +1 -0
  73. package/dist/segment-display.d.ts +93 -0
  74. package/dist/segment-display.d.ts.map +1 -0
  75. package/dist/segment-display.js +324 -0
  76. package/dist/segment-display.js.map +1 -0
  77. package/dist/settings.d.ts +19 -0
  78. package/dist/settings.d.ts.map +1 -0
  79. package/dist/settings.js +27 -0
  80. package/dist/settings.js.map +1 -0
  81. package/dist/storage.d.ts +28 -0
  82. package/dist/storage.d.ts.map +1 -0
  83. package/dist/storage.js +54 -0
  84. package/dist/storage.js.map +1 -0
  85. package/dist/system.d.ts +19 -0
  86. package/dist/system.d.ts.map +1 -0
  87. package/dist/system.js +24 -0
  88. package/dist/system.js.map +1 -0
  89. package/dist/theme.d.ts +51 -0
  90. package/dist/theme.d.ts.map +1 -0
  91. package/dist/theme.js +85 -0
  92. package/dist/theme.js.map +1 -0
  93. package/dist/types.d.ts +278 -0
  94. package/dist/types.d.ts.map +1 -0
  95. package/dist/types.js +2 -0
  96. package/dist/types.js.map +1 -0
  97. package/dist/ui.d.ts +57 -0
  98. package/dist/ui.d.ts.map +1 -0
  99. package/dist/ui.js +78 -0
  100. package/dist/ui.js.map +1 -0
  101. package/dist/usage.d.ts +14 -0
  102. package/dist/usage.d.ts.map +1 -0
  103. package/dist/usage.js +19 -0
  104. package/dist/usage.js.map +1 -0
  105. package/dist/video.d.ts +11 -0
  106. package/dist/video.d.ts.map +1 -0
  107. package/dist/video.js +17 -0
  108. package/dist/video.js.map +1 -0
  109. package/dist/wire.d.ts +214 -0
  110. package/dist/wire.d.ts.map +1 -0
  111. package/dist/wire.js +538 -0
  112. package/dist/wire.js.map +1 -0
  113. package/package.json +39 -4
  114. package/src/agents.ts +14 -0
  115. package/src/assets.ts +80 -0
  116. package/src/assistant.ts +185 -0
  117. package/src/audio.ts +90 -0
  118. package/src/bridge.ts +96 -0
  119. package/src/calendar.ts +68 -0
  120. package/src/context.ts +28 -0
  121. package/src/errors.ts +131 -0
  122. package/src/events.ts +90 -0
  123. package/src/files.ts +47 -0
  124. package/src/index.ts +152 -0
  125. package/src/mock/index.ts +3 -0
  126. package/src/mock/mock-host.ts +1408 -0
  127. package/src/mock/samples.ts +300 -0
  128. package/src/mock/toolbar.ts +321 -0
  129. package/src/net.ts +27 -0
  130. package/src/plugin.ts +14 -0
  131. package/src/raven.ts +116 -0
  132. package/src/segment-display.ts +377 -0
  133. package/src/settings.ts +29 -0
  134. package/src/storage.ts +59 -0
  135. package/src/system.ts +26 -0
  136. package/src/theme.ts +97 -0
  137. package/src/types.ts +327 -0
  138. package/src/ui.ts +88 -0
  139. package/src/usage.ts +21 -0
  140. package/src/video.ts +17 -0
  141. package/src/wire.ts +608 -0
  142. package/theme.css +407 -0
  143. package/README.md +0 -3
package/dist/theme.js ADDED
@@ -0,0 +1,85 @@
1
+ /**
2
+ * RollRook's theme as CSS. RollRook sets the `--rr-*` variables and
3
+ * `color-scheme` on `:root` and rewrites them as the theme changes; `follow`
4
+ * adds `data-rr-scheme` and `data-rr-high-contrast` on `<html>` for styles
5
+ * that differ by theme, and keeps them current.
6
+ */
7
+ export class ThemeApi {
8
+ /** The CSS variable each theme color is published as. */
9
+ static map_variables = {
10
+ background: "--rr-background",
11
+ surface: "--rr-surface",
12
+ sidebar: "--rr-sidebar",
13
+ text: "--rr-text",
14
+ secondary_text: "--rr-secondary-text",
15
+ tertiary_text: "--rr-tertiary-text",
16
+ separator: "--rr-separator",
17
+ accent: "--rr-accent",
18
+ on_accent: "--rr-on-accent",
19
+ caution: "--rr-caution",
20
+ segment: "--rr-segment",
21
+ };
22
+ /** The CSS variable holding the system font. */
23
+ static FONT_VARIABLE = "--rr-font";
24
+ /** The attribute on `<html>` that reads `light` or `dark`. */
25
+ static SCHEME_ATTRIBUTE = "data-rr-scheme";
26
+ /** The attribute on `<html>` present while the theme is high-contrast. */
27
+ static HIGH_CONTRAST_ATTRIBUTE = "data-rr-high-contrast";
28
+ context;
29
+ events;
30
+ /**
31
+ * @param context - where the theme at load is read from
32
+ * @param events - where theme changes arrive
33
+ */
34
+ constructor(context, events) {
35
+ this.context = context;
36
+ this.events = events;
37
+ }
38
+ /**
39
+ * @returns the theme RollRook set at load, or undefined outside RollRook
40
+ */
41
+ current() {
42
+ return this.context.current()?.theme;
43
+ }
44
+ /**
45
+ * Render the page in the given theme: sets the `--rr-*` variables,
46
+ * `color-scheme`, `data-rr-scheme` and `data-rr-high-contrast` on `<html>`.
47
+ *
48
+ * @param theme - the theme to apply
49
+ */
50
+ apply(theme) {
51
+ const root = document.documentElement;
52
+ for (const [key, variable] of Object.entries(ThemeApi.map_variables)) {
53
+ const color = Reflect.get(theme.colors, key);
54
+ if (typeof color === "string") {
55
+ root.style.setProperty(variable, color);
56
+ }
57
+ }
58
+ root.style.setProperty("color-scheme", theme.is_dark ? "dark" : "light");
59
+ this.mark(theme);
60
+ }
61
+ /**
62
+ * Set `data-rr-scheme` and `data-rr-high-contrast` on `<html>` for the theme.
63
+ *
64
+ * @param theme - the theme the page is in
65
+ */
66
+ mark(theme) {
67
+ const root = document.documentElement;
68
+ root.setAttribute(ThemeApi.SCHEME_ATTRIBUTE, theme.is_dark ? "dark" : "light");
69
+ root.toggleAttribute(ThemeApi.HIGH_CONTRAST_ATTRIBUTE, theme.is_high_contrast);
70
+ }
71
+ /**
72
+ * Mark `<html>` with the current theme and every change after it; the
73
+ * variables themselves RollRook keeps current.
74
+ *
75
+ * @returns a function that stops following
76
+ */
77
+ follow() {
78
+ const theme = this.current();
79
+ if (theme !== undefined) {
80
+ this.mark(theme);
81
+ }
82
+ return this.events.on("theme", (changed) => this.mark(changed));
83
+ }
84
+ }
85
+ //# sourceMappingURL=theme.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"theme.js","sourceRoot":"","sources":["../src/theme.ts"],"names":[],"mappings":"AAIA;;;;;GAKG;AACH,MAAM,OAAO,QAAQ;IACjB,yDAAyD;IACzD,MAAM,CAAU,aAAa,GAAsC;QAC/D,UAAU,EAAE,iBAAiB;QAC7B,OAAO,EAAE,cAAc;QACvB,OAAO,EAAE,cAAc;QACvB,IAAI,EAAE,WAAW;QACjB,cAAc,EAAE,qBAAqB;QACrC,aAAa,EAAE,oBAAoB;QACnC,SAAS,EAAE,gBAAgB;QAC3B,MAAM,EAAE,aAAa;QACrB,SAAS,EAAE,gBAAgB;QAC3B,OAAO,EAAE,cAAc;QACvB,OAAO,EAAE,cAAc;KAC1B,CAAC;IAEF,gDAAgD;IAChD,MAAM,CAAU,aAAa,GAAG,WAAW,CAAC;IAE5C,8DAA8D;IAC9D,MAAM,CAAU,gBAAgB,GAAG,gBAAgB,CAAC;IAEpD,0EAA0E;IAC1E,MAAM,CAAU,uBAAuB,GAAG,uBAAuB,CAAC;IAEjD,OAAO,CAAa;IACpB,MAAM,CAAS;IAEhC;;;OAGG;IACH,YAAY,OAAmB,EAAE,MAAc;QA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C;QAC7B,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;YACtB,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QACrB,CAAC;QACD,OAAO,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,OAAO,EAAE,CAAC,OAAc,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC;IAC3E,CAAC;CACJ"}
@@ -0,0 +1,278 @@
1
+ /** Any value JSON can carry: what `storage` keeps and what the bridge passes. */
2
+ export type JsonValue = null | boolean | number | string | JsonValue[] | {
3
+ [key: string]: JsonValue;
4
+ };
5
+ /** A JSON object, the shape of every bridge call's parameters. */
6
+ export type JsonObject = {
7
+ [key: string]: JsonValue;
8
+ };
9
+ /** The colors of RollRook's current theme, each a CSS color. */
10
+ export interface ThemeColors {
11
+ background: string;
12
+ surface: string;
13
+ sidebar: string;
14
+ text: string;
15
+ secondary_text: string;
16
+ tertiary_text: string;
17
+ separator: string;
18
+ accent: string;
19
+ /** Text and icons drawn on the accent. */
20
+ on_accent: string;
21
+ caution: string;
22
+ /** A seven-segment display's lit color. */
23
+ segment: string;
24
+ }
25
+ /** RollRook's current theme. */
26
+ export interface Theme {
27
+ is_dark: boolean;
28
+ is_high_contrast: boolean;
29
+ colors: ThemeColors;
30
+ }
31
+ /** Where a view shows in RollRook's stage; a `background` view is a hidden page kept loaded while the plugin is on. */
32
+ export type ViewSlot = "dock" | "sidebar" | "footbar" | "popover" | "settings" | "background";
33
+ /** What RollRook tells a view about itself and the app it runs in. */
34
+ export interface PluginContext {
35
+ /** The bridge's protocol number; it moves only when a change breaks plugins. */
36
+ protocol: number;
37
+ plugin_id: string;
38
+ plugin_version: string;
39
+ app_version: string;
40
+ /** The view this page is, as the manifest names it. */
41
+ view_id: string;
42
+ slot: ViewSlot;
43
+ /** This instance of the view; a footbar view on two displays runs twice. */
44
+ instance_id: string;
45
+ theme: Theme;
46
+ }
47
+ /** One entry of a folder in the plugin's data. */
48
+ export interface FileEntry {
49
+ name: string;
50
+ is_directory: boolean;
51
+ /** Size in bytes; folders report what the host reports, usually 0. */
52
+ size: number;
53
+ }
54
+ /** Raven's latest answer in a conversation the plugin started. */
55
+ export interface RavenAnswer {
56
+ /** Whether Raven is still working on the conversation's latest turn. */
57
+ is_running: boolean;
58
+ /** Raven's last answer, `""` before there is one. */
59
+ answer: string;
60
+ }
61
+ /** A change in a conversation the plugin started, delivered as the `raven.turn` event. */
62
+ export interface RavenTurn extends RavenAnswer {
63
+ conversation_id: string;
64
+ }
65
+ /** The code agents RollRook knows: Claude Code, Codex and Antigravity. */
66
+ export type AgentHarness = "claude" | "codex" | "agy";
67
+ /** The states a session reports today; new ones may come, so `AgentSession.state` is a string. */
68
+ export type KnownAgentState = "idle" | "thinking" | "working" | "needs_approval" | "needs_input" | "compacting" | "done" | "error" | "rate_limited" | "ended";
69
+ /** A code agent session RollRook watches. */
70
+ export interface AgentSession {
71
+ id: string;
72
+ title: string;
73
+ harness: AgentHarness;
74
+ /** One of `KnownAgentState`, or a state newer than this SDK. */
75
+ state: string;
76
+ /** The name of the machine the session runs on. */
77
+ host: string;
78
+ }
79
+ /** How close a plan limit is to running out. */
80
+ export type UsageSeverity = "normal" | "warning" | "critical";
81
+ /** One plan limit of a code agent account. */
82
+ export interface UsageLimit {
83
+ id: string;
84
+ title: string;
85
+ /** How much of the limit is used, from 0 to 100. */
86
+ used_percent: number;
87
+ /** When the limit resets, or undefined when it does not say. */
88
+ resets_at: Date | undefined;
89
+ severity: UsageSeverity;
90
+ }
91
+ /** A code agent account and its plan limits. */
92
+ export interface UsageAccount {
93
+ harness: AgentHarness;
94
+ signed_in_as: string | undefined;
95
+ plan: string | undefined;
96
+ /** Whether this is the account the code agent uses by default. */
97
+ is_default: boolean;
98
+ /** Why the last read failed, or undefined when it did not. */
99
+ error: string | undefined;
100
+ /** When the limits were last read, or undefined before any read. */
101
+ fetched_at: Date | undefined;
102
+ list_limits: UsageLimit[];
103
+ }
104
+ /** The code agent accounts and when they are read next: `usage.list` and the `usage.changed` event. */
105
+ export interface UsageSnapshot {
106
+ list_accounts: UsageAccount[];
107
+ is_refreshing: boolean;
108
+ /** When the next read runs, or undefined while one runs. */
109
+ next_refresh_at: Date | undefined;
110
+ }
111
+ /** A request `net.fetch` sends through RollRook. */
112
+ export interface FetchRequest {
113
+ /** An https URL whose host the manifest grants with `net:<host>`. */
114
+ url: string;
115
+ method?: string;
116
+ map_headers?: Record<string, string>;
117
+ body?: string;
118
+ }
119
+ /** The reply to a `net.fetch` request. */
120
+ export interface FetchResponse {
121
+ status: number;
122
+ /** The response's headers, names in lowercase. */
123
+ map_headers: Record<string, string>;
124
+ /** The body, as text. */
125
+ body: string;
126
+ }
127
+ /** The `visibility` event: the view was shown or hidden. */
128
+ export interface VisibilityChange {
129
+ is_shown: boolean;
130
+ }
131
+ /** The plugin's settings, each key its value or its default. */
132
+ export type SettingValues = Record<string, JsonValue>;
133
+ /** The `message` event: what another instance of the plugin broadcast. */
134
+ export interface PluginMessage {
135
+ from_view_id: string;
136
+ from_instance_id: string;
137
+ message: JsonValue;
138
+ }
139
+ /** The pane `ui.open_settings` opens: the plugin's own settings or the code agent accounts. */
140
+ export type SettingsPane = "plugin" | "code_agents";
141
+ /** A source of sound the mixer controls: an app or a Chrome tab. */
142
+ export type AudioTarget = {
143
+ kind: "app";
144
+ bundle_id: string;
145
+ } | {
146
+ kind: "tab";
147
+ session_id: number;
148
+ tab_id: number;
149
+ };
150
+ /** The rooms the mixer's reverb simulates. */
151
+ export type ReverbRoom = "smallRoom" | "mediumRoom" | "largeRoom" | "mediumHall" | "largeHall" | "plate" | "cathedral";
152
+ /** How the mixer treats one track's sound. RollRook clamps each value as it takes it. */
153
+ export interface AudioSettings {
154
+ /** Whether the mixer has taken the track's sound over; the rest applies only then. */
155
+ is_taken_over: boolean;
156
+ is_muted: boolean;
157
+ /** From 0 to 2; 1 leaves the sound as it is. */
158
+ volume: number;
159
+ /** From −1 (left) to 1 (right). */
160
+ pan: number;
161
+ is_left_inverted: boolean;
162
+ is_right_inverted: boolean;
163
+ is_swapped: boolean;
164
+ /** Stereo width, from 0 (mono) to 2; 1 leaves it as it is. */
165
+ width: number;
166
+ is_equalizer_enabled: boolean;
167
+ /** Ten gains from −12 to 12 dB, at 32, 64, 125, 250, 500, 1k, 2k, 4k, 8k and 16k Hz. */
168
+ list_equalizer_gains: number[];
169
+ reverb_room: ReverbRoom;
170
+ /** From 0 (dry) to 1. */
171
+ reverb_mix: number;
172
+ }
173
+ /** One source of sound the mixer shows. */
174
+ export interface AudioTrack {
175
+ target: AudioTarget;
176
+ name: string;
177
+ /** An asset URL of the app's icon or the page's icon, or undefined when it has none. */
178
+ icon_url: string | undefined;
179
+ is_playing: boolean;
180
+ is_capturing: boolean;
181
+ /** Whether a tab plays a video `video.toggle_picture` can show; false for an app. */
182
+ has_video: boolean;
183
+ settings: AudioSettings;
184
+ }
185
+ /** Whether the mixer is on and may capture sound. */
186
+ export interface AudioStatus {
187
+ is_enabled: boolean;
188
+ is_permitted: boolean;
189
+ }
190
+ /** One track's peak levels, from 0 to 1. */
191
+ export interface AudioLevel {
192
+ /** `app:<bundleId>` or `tab:<sessionId>:<tabId>`; see `AudioApi.level_key`. */
193
+ key: string;
194
+ left: number;
195
+ right: number;
196
+ }
197
+ /** The `audio.tracks` event. */
198
+ export interface AudioTracksChange {
199
+ list_tracks: AudioTrack[];
200
+ }
201
+ /** The `audio.levels` event, about 30 times a second while meters are on. */
202
+ export interface AudioLevels {
203
+ list_levels: AudioLevel[];
204
+ }
205
+ /** A city `system.search_cities` found, with the time zone it keeps. */
206
+ export interface City {
207
+ name: string;
208
+ /** The zone's identifier, such as `Asia/Shanghai`. */
209
+ time_zone_id: string;
210
+ }
211
+ /**
212
+ * One item the plugin shows in RollRook's calendar. Times are ISO 8601: a
213
+ * date (`2026-12-05`) or a date and time with its offset. A `start` and an
214
+ * `end` make a block; a `due` alone makes a deadline marker.
215
+ */
216
+ export interface CalendarItem {
217
+ /** The plugin's own id for the item; `calendar.open` and `calendar.move` name it. */
218
+ id: string;
219
+ title: string;
220
+ start?: string;
221
+ end?: string;
222
+ due?: string;
223
+ /** Whether the times are whole days. */
224
+ is_all_day?: boolean;
225
+ /** Whether the item is finished; RollRook draws it struck through. */
226
+ is_done?: boolean;
227
+ /** The item's color as `#rrggbb`; the stage's ink when left out. */
228
+ color?: string;
229
+ }
230
+ /** The `calendar.open` event: the user clicked the plugin's item in the calendar. */
231
+ export interface CalendarOpen {
232
+ id: string;
233
+ }
234
+ /** The `calendar.move` event: the user dragged the plugin's item to new times, ISO 8601. */
235
+ export interface CalendarMove {
236
+ id: string;
237
+ start: string | undefined;
238
+ end: string | undefined;
239
+ due: string | undefined;
240
+ }
241
+ /**
242
+ * How RollRook calls an assistant tool: `preview` asks what a tool declared
243
+ * with `confirm: true` would do, before the user approves; `run` does it.
244
+ */
245
+ export type ToolPhase = "preview" | "run";
246
+ /** What a tool's preview returns: one line the approval card shows. */
247
+ export interface ToolPreview {
248
+ summary: string;
249
+ }
250
+ /** A tool call that reverses another; RollRook shows it as Undo beside the result. */
251
+ export type ToolUndo = {
252
+ tool: string;
253
+ input: JsonObject;
254
+ };
255
+ /**
256
+ * What a tool's run returns to the assistant: any JSON, with an optional
257
+ * `summary` (the line the conversation shows for the change) and `undo`.
258
+ */
259
+ export type ToolResult = JsonObject & {
260
+ summary?: string;
261
+ undo?: ToolUndo;
262
+ };
263
+ /** The events RollRook delivers, by name, with their payloads. */
264
+ export interface EventMap {
265
+ "theme": Theme;
266
+ "visibility": VisibilityChange;
267
+ "settings.changed": SettingValues;
268
+ "message": PluginMessage;
269
+ "raven.turn": RavenTurn;
270
+ "usage.changed": UsageSnapshot;
271
+ "audio.tracks": AudioTracksChange;
272
+ "audio.levels": AudioLevels;
273
+ "calendar.open": CalendarOpen;
274
+ "calendar.move": CalendarMove;
275
+ }
276
+ /** The name of an event RollRook delivers. */
277
+ export type EventName = keyof EventMap;
278
+ //# sourceMapp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S,CAAC;CAC3B;AAED;;;GAGG;AACH,MAAM,MAAM,SAAS,GAAG,SAAS,GAAG,KAAK,CAAC;AAE1C,uEAAuE;AACvE,MAAM,WAAW,WAAW;IACxB,OAAO,EAAE,MAAM,CAAC;CACnB;AAED,sFAAsF;AACtF,MAAM,MAAM,QAAQ,GAAG;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,UAAU,CAAC;CACrB,CAAC;AAEF;;;GAGG;AACH,MAAM,MAAM,UAAU,GAAG,UAAU,GAAG;IAAE,OAAO,CAAC,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,QAAQ,CAAA;CAAE,CAAC;AAE5E,kEAAkE;AAClE,MAAM,WAAW,QAAQ;IACrB,OAAO,EAAE,KAAK,CAAC;IACf,YAAY,EAAE,gBAAgB,CAAC;IAC/B,kBAAkB,EAAE,aAAa,CAAC;IAClC,SAAS,EAAE,aAAa,CAAC;IACzB,YAAY,EAAE,SAAS,CAAC;IACxB,eAAe,EAAE,aAAa,CAAC;IAC/B,cAAc,EAAE,iBAAiB,CAAC;IAClC,cAAc,EAAE,WAAW,CAAC;IAC5B,eAAe,EAAE,YAAY,CAAC;IAC9B,eAAe,EAAE,YAAY,CAAC;CACjC;AAED,8CAA8C;AAC9C,MAAM,MAAM,SAAS,GAAG,MAAM,QAAQ,CAAC"}
package/dist/types.js ADDED
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":""}
package/dist/ui.d.ts ADDED
@@ -0,0 +1,57 @@
1
+ import type { SettingsPane } from "./types.js";
2
+ /** RollRook's own surfaces around the plugin's views. */
3
+ export declare class UiApi {
4
+ /** Each settings pane's wire name, by the SDK's name. */
5
+ static readonly map_pane_names: Record<SettingsPane, string>;
6
+ /**
7
+ * Show a short message in RollRook.
8
+ *
9
+ * @param text - the message
10
+ */
11
+ toast(text: string): Promise<void>;
12
+ /**
13
+ * Show a badge on the view's dock tab or strip button.
14
+ *
15
+ * @param text - the badge; `""` shows a dot, undefined clears it
16
+ */
17
+ badge(text: string | undefined): Promise<void>;
18
+ /**
19
+ * Show a line under a sidebar view's strip button.
20
+ *
21
+ * @param text - the line, or undefined to clear it
22
+ */
23
+ caption(text: string | undefined): Promise<void>;
24
+ /**
25
+ * Set a footbar view's width.
26
+ *
27
+ * @param width - the width in points
28
+ */
29
+ width(width: number): Promise<void>;
30
+ /**
31
+ * Set the height of a settings view, or of the popover this page is.
32
+ *
33
+ * @param height - the height in points, from 1 to 800
34
+ */
35
+ height(height: number): Promise<void>;
36
+ /**
37
+ * Show one of the plugin's dock or sidebar views.
38
+ *
39
+ * @param view_id - the view's id in the manifest
40
+ */
41
+ open_view(view_id: string): Promise<void>;
42
+ /**
43
+ * Open one of the plugin's popover views, anchored to this view.
44
+ *
45
+ * @param view_id - the popover's id in the manifest
46
+ */
47
+ popover(view_id: string): Promise<void>;
48
+ /** Close the popover this view opened, or this view if it is the popover. */
49
+ close_popover(): Promise<void>;
50
+ /**
51
+ * Open RollRook's Settings.
52
+ *
53
+ * @param pane - the plugin's own settings (its declared settings and its settings view), or the code agent accounts
54
+ */
55
+ open_settings(pane: SettingsPane): Promise<void>;
56
+ }
57
+ //# sourceMappingURL=ui.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ui.d.ts","sourceRoot":"","sources":["../src/ui.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAE/C,yDAAyD;AACzD,qBAAa,KAAK;IACd,yDAAyD;IACzD,MAAM,CAAC,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC,YAAY,EAAE,MAAM,CAAC,CAG1D;IAEF;;;;OAIG;IACG,KAAK,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAEvC;IAED;;;;OAIG;IACG,KAAK,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC,CAEnD;IAED;;;;OAIG;IACG,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC,CAErD;IAED;;;;OAIG;IACG,KAAK,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAExC;IAED;;;;OAIG;IACG,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAE1C;IAED;;;;OAIG;IACG,SAAS,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAE9C;IAED;;;;OAIG;IACG,OAAO,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAE5C;IAED,6EAA6E;IACvE,aAAa,IAAI,OAAO,CAAC,IAAI,CAAC,CAEnC;IAED;;;;OAIG;IACG,aAAa,CAAC,IAAI,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CAErD;CACJ"}
package/dist/ui.js ADDED
@@ -0,0 +1,78 @@
1
+ import { Bridge } from "./bridge.js";
2
+ /** RollRook's own surfaces around the plugin's views. */
3
+ export class UiApi {
4
+ /** Each settings pane's wire name, by the SDK's name. */
5
+ static map_pane_names = {
6
+ plugin: "plugin",
7
+ code_agents: "codeAgents",
8
+ };
9
+ /**
10
+ * Show a short message in RollRook.
11
+ *
12
+ * @param text - the message
13
+ */
14
+ async toast(text) {
15
+ await Bridge.call("ui.toast", { text });
16
+ }
17
+ /**
18
+ * Show a badge on the view's dock tab or strip button.
19
+ *
20
+ * @param text - the badge; `""` shows a dot, undefined clears it
21
+ */
22
+ async badge(text) {
23
+ await Bridge.call("ui.badge", { text: text ?? null });
24
+ }
25
+ /**
26
+ * Show a line under a sidebar view's strip button.
27
+ *
28
+ * @param text - the line, or undefined to clear it
29
+ */
30
+ async caption(text) {
31
+ await Bridge.call("ui.caption", { text: text ?? null });
32
+ }
33
+ /**
34
+ * Set a footbar view's width.
35
+ *
36
+ * @param width - the width in points
37
+ */
38
+ async width(width) {
39
+ await Bridge.call("ui.width", { width });
40
+ }
41
+ /**
42
+ * Set the height of a settings view, or of the popover this page is.
43
+ *
44
+ * @param height - the height in points, from 1 to 800
45
+ */
46
+ async height(height) {
47
+ await Bridge.call("ui.height", { height });
48
+ }
49
+ /**
50
+ * Show one of the plugin's dock or sidebar views.
51
+ *
52
+ * @param view_id - the view's id in the manifest
53
+ */
54
+ async open_view(view_id) {
55
+ await Bridge.call("ui.openView", { viewId: view_id });
56
+ }
57
+ /**
58
+ * Open one of the plugin's popover views, anchored to this view.
59
+ *
60
+ * @param view_id - the popover's id in the manifest
61
+ */
62
+ async popover(view_id) {
63
+ await Bridge.call("ui.popover", { viewId: view_id });
64
+ }
65
+ /** Close the popover this view opened, or this view if it is the popover. */
66
+ async close_popover() {
67
+ await Bridge.call("ui.closePopover");
68
+ }
69
+ /**
70
+ * Open RollRook's Settings.
71
+ *
72
+ * @param pane - the plugin's own settings (its declared settings and its settings view), or the code agent accounts
73
+ */
74
+ async open_settings(pane) {
75
+ await Bridge.call("ui.openSettings", { pane: UiApi.map_pane_names[pane] });
76
+ }
77
+ }
78
+ //# sourceMappingURL=ui.js.map
package/dist/ui.js.map ADDED
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ui.js","sourceRoot":"","sources":["../src/ui.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAGrC,yDAAyD;AACzD,MAAM,OAAO,KAAK;IACd,yDAAyD;IACzD,MAAM,CAAU,cAAc,GAAiC;QAC3D,MAAM,EAAE,QAAQ;QAChB,WAAW,EAAE,YAAY;KAC5B,CAAC;IAEF;;;;OAIG;IACH,KAAK,CAAC,KAAK,CAAC,IAAY;QACpB,MAAM,MAAM,CAAC,IAAI,CAAC,UAAU,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC;IAC5C,CA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 +1,14 @@
1
+ import type { UsageSnapshot } from "./types.js";
2
+ /**
3
+ * The plan limits of the user's code agent accounts. Needs the `agents.read`
4
+ * permission. Each read arrives as the `usage.changed` event.
5
+ */
6
+ export declare class UsageApi {
7
+ /**
8
+ * @returns each account with its limits, and when they are read next
9
+ */
10
+ list(): Promise<UsageSnapshot>;
11
+ /** Read the limits again now; the result arrives as `usage.changed`. */
12
+ refresh(): Promise<void>;
13
+ }
14
+ //# sourceMappingURL=usage.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"usage.d.ts","sourceRoot":"","sources":["../src/usage.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAGhD;;;GAGG;AACH,qBAAa,QAAQ;IACjB;;OAEG;IACG,IAAI,IAAI,OAAO,CAAC,aAAa,CAAC,CAEnC;IAED,wEAAwE;IAClE,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC,CAE7B;CACJ"}
package/dist/usage.js ADDED
@@ -0,0 +1,19 @@
1
+ import { Bridge } from "./bridge.js";
2
+ import { Wire } from "./wire.js";
3
+ /**
4
+ * The plan limits of the user's code agent accounts. Needs the `agents.read`
5
+ * permission. Each read arrives as the `usage.changed` event.
6
+ */
7
+ export class UsageApi {
8
+ /**
9
+ * @returns each account with its limits, and when they are read next
10
+ */
11
+ async list() {
12
+ return Wire.usage_snapshot(await Bridge.call("usage.list"));
13
+ }
14
+ /** Read the limits again now; the result arrives as `usage.changed`. */
15
+ async refresh() {
16
+ await Bridge.call("usage.refresh");
17
+ }
18
+ }
19
+ //# sourceMappingURL=usage.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"usage.js","sourceRoot":"","sources":["../src/usage.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAErC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC;;;GAGG;AACH,MAAM,OAAO,QAAQ;IACjB;;OAEG;IACH,KAAK,CAAC,IAAI;QACN,OAAO,IAAI,CAAC,cAAc,CAAC,MAAM,MAAM,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC;IAChE,CAAC;IAED,wEAAwE;IACxE,KAAK,CAAC,OAAO;QACT,MAAM,MAAM,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;IACvC,CAAC;CACJ"}
@@ -0,0 +1,11 @@
1
+ /** Chrome tabs' videos in RollRook's sidebar. Needs the `video` permission. */
2
+ export declare class VideoApi {
3
+ /**
4
+ * Show a tab's video in the sidebar, or hide it if it shows.
5
+ *
6
+ * @param session_id - the Chrome session, as an audio track's target names it
7
+ * @param tab_id - the tab
8
+ */
9
+ toggle_picture(session_id: number, tab_id: number): Promise<void>;
10
+ }
11
+ //# sourceMappingURL=video.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"video.d.ts","sourceRoot":"","sources":["../src/video.ts"],"names":[],"mappings":"AAEA,+EAA+E;AAC/E,qBAAa,QAAQ;IACjB;;;;;OAKG;IACG,cAAc,CAAC,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAKtE;CACJ"}
package/dist/video.js ADDED
@@ -0,0 +1,17 @@
1
+ import { Bridge } from "./bridge.js";
2
+ /** Chrome tabs' videos in RollRook's sidebar. Needs the `video` permission. */
3
+ export class VideoApi {
4
+ /**
5
+ * Show a tab's video in the sidebar, or hide it if it shows.
6
+ *
7
+ * @param session_id - the Chrome session, as an audio track's target names it
8
+ * @param tab_id - the tab
9
+ */
10
+ async toggle_picture(session_id, tab_id) {
11
+ await Bridge.call("video.togglePicture", {
12
+ sessionId: session_id,
13
+ tabId: tab_id,
14
+ });
15
+ }
16
+ }
17
+ //# sourceMappingURL=video.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"video.js","sourceRoot":"","sources":["../src/video.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAErC,+EAA+E;AAC/E,MAAM,OAAO,QAAQ;IACjB;;;;;OAKG;IACH,KAAK,CAAC,cAAc,CAAC,UAAkB,EAAE,MAAc;QACnD,MAAM,MAAM,CAAC,IAAI,CAAC,qBAAqB,EAAE;YACrC,SAAS,EAAE,UAAU;YACrB,KAAK,EAAE,MAAM;SAChB,CAAC,CAAC;IACP,CAAC;CACJ"}