@loupekit/sdk 0.10.13-next.58 → 0.10.14-next.59

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/README.md CHANGED
@@ -90,14 +90,15 @@ init({
90
90
  });
91
91
  ```
92
92
 
93
- A dockable control panel appears with a three-page sidebar — **Home** (stat tiles, a this-page ↔
94
- whole-project scope switch, and the most recent feedback), **Comments** (with the
93
+ A dockable control panel appears with a three-page sidebar — **Home** (stat tiles, scope chips with
94
+ counts, the project manager, and the most recent feedback), **Comments** (with the
95
95
  **Inspect**, **Note**, **Region**, and **Record** tools + the comment list) and
96
- **Connect Claude** (MCP setup steps). The header carries a position menu
97
- (left / bottom / right / float), a theme toggle, a settings dropdown — five accent colours, plus
98
- switches for hover hints, markers and page paths — and a minimize button that collapses the panel
99
- to a one-line context bar. A four-step guided tour runs once on first open (skippable, replayable
100
- from Settings), and each view shows a one-time hint card with a **Turn off hints** link.
96
+ **Activity** (a live monitor fed by `trackActivity()`). The header carries a position menu
97
+ (left / bottom / right / float), a theme toggle, a settings dropdown — five accent colours, switches
98
+ for hover hints, markers and page paths, plus the running package version — and a minimize button
99
+ that collapses the panel to a one-line context bar. A five-step guided tour runs once on first open
100
+ (skippable, replayable from Settings), and each view shows a one-time hint card with a **Turn off
101
+ hints** link.
101
102
  Pass `repo` and `branch` to `init()` to make
102
103
  threads branch-aware — the board can then be filtered by repository and branch.
103
104
  Use the header's dock controls to dock it left / right /
@@ -107,6 +108,51 @@ FAB cluster — the primary button carries the comment count and expands four qu
107
108
  tear it down. `init()` is idempotent — safe to call more
108
109
  than once. Pass `label` to change the brand name shown in the header.
109
110
 
111
+ ### Adding your own tab
112
+
113
+ The panel is extensible without forking it. Register as many sidebar pages as you like:
114
+
115
+ ```ts
116
+ import { init, connectTab } from "@loupekit/sdk";
117
+
118
+ init({
119
+ projectKey: "pk_live_…",
120
+ user: { id: "u_1", name: "Ada" },
121
+ repo: "acme/web",
122
+ repos: ["acme/web", "acme/api"], // powers the panel's repo picker
123
+ environments: ["https://staging.acme.test"],
124
+ tabs: [
125
+ connectTab(), // the Claude/MCP page, now opt-in
126
+ {
127
+ id: "build",
128
+ label: "Build",
129
+ hint: { title: "Build health", body: "Straight from our CI." },
130
+ render: (ctx) => `<p>Project <b>${ctx.projectKey}</b> — SDK v${ctx.version}</p>`,
131
+ },
132
+ ],
133
+ });
134
+ ```
135
+
136
+ `render` runs once, when the panel is built, and may return markup or an element. It receives a
137
+ context with `projectKey`, `apiBase`, `user`, `comments`, `url`, `version` and the helpers
138
+ `track` (push an event into the Activity feed), `open` (switch tab) and `close`. A tab that throws
139
+ is caught and rendered as an error card rather than taking the panel down.
140
+
141
+ ### Reporting agent activity
142
+
143
+ Anything an agent bridge or your app does can show up in the panel's Activity view:
144
+
145
+ ```ts
146
+ import { trackActivity, setActivityStatus } from "@loupekit/sdk";
147
+
148
+ setActivityStatus("working");
149
+ trackActivity({ kind: "Read", label: "Read src/app.ts", files: ["src/app.ts"] });
150
+ trackActivity({ kind: "Bash", label: "pnpm test", detail: "exit 1", level: "error" });
151
+ ```
152
+
153
+ Loupe's own operations feed the same stream, so the view is never empty. With nothing connected it
154
+ says *Monitor unavailable* and explains how to wire it up.
155
+
110
156
  ### Offline mode (no backend)
111
157
 
112
158
  Omit `apiBase` and comments persist to `localStorage` — great for demos and local dev: