@fdcn/sourcefed 0.2.9 → 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/pi.js CHANGED
@@ -3,7 +3,7 @@ import {
3
3
  daemonCommand,
4
4
  daemonEnvironment,
5
5
  spawnLocalDaemon
6
- } from "./chunk-QHT4DCW7.js";
6
+ } from "./chunk-QPDTUNFA.js";
7
7
  import "./chunk-MLKGABMK.js";
8
8
 
9
9
  // adapters/pi/src/index.ts
@@ -21,10 +21,20 @@ import { setProp as _$setProp } from "opentui:runtime-module:%40opentui%2Fsolid"
21
21
  import { createElement as _$createElement } from "opentui:runtime-module:%40opentui%2Fsolid";
22
22
  import { Show, createMemo, createSignal, onCleanup } from "opentui:runtime-module:solid-js";
23
23
  import { connectDaemonClient, defaultDaemonUrl } from "@fdcn/sourcefed/daemon";
24
+ function tone(theme) {
25
+ return {
26
+ text: theme.text.default,
27
+ textMuted: theme.text.subdued,
28
+ accent: theme.text.action.primary.default,
29
+ success: theme.text.feedback.success.default,
30
+ error: theme.text.feedback.error.default,
31
+ warning: theme.text.feedback.warning.default
32
+ };
33
+ }
24
34
  var REFRESH_MS = 3e3;
25
35
  function Sidebar(props) {
26
36
  const [monitors, setMonitors] = createSignal([]);
27
- const theme = createMemo(() => props.api.theme.current);
37
+ const palette = createMemo(() => tone(props.ctx.theme));
28
38
  const active = createMemo(() => monitors().filter((monitor) => monitor.enabled));
29
39
  const refresh = async () => {
30
40
  let client;
@@ -65,13 +75,13 @@ function Sidebar(props) {
65
75
  _$insert(_el$5, () => active().length, _el$7);
66
76
  _$insert(_el$, _$createComponent(MonitorRows, {
67
77
  monitors: active,
68
- get theme() {
69
- return theme();
78
+ get tone() {
79
+ return palette();
70
80
  },
71
81
  compact: true
72
82
  }), null);
73
83
  _$effect((_p$) => {
74
- var _v$ = theme().accent, _v$2 = theme().textMuted;
84
+ var _v$ = palette().accent, _v$2 = palette().textMuted;
75
85
  _v$ !== _p$.e && (_p$.e = _$setProp(_el$3, "fg", _v$, _p$.e));
76
86
  _v$2 !== _p$.t && (_p$.t = _$setProp(_el$5, "fg", _v$2, _p$.t));
77
87
  return _p$;
@@ -96,7 +106,7 @@ function MonitorRows(props) {
96
106
  return (() => {
97
107
  var _el$1 = _$createElement("text");
98
108
  _$insertNode(_el$1, _$createTextNode(`No active monitors`));
99
- _$effect((_$p) => _$setProp(_el$1, "fg", props.theme.textMuted, _$p));
109
+ _$effect((_$p) => _$setProp(_el$1, "fg", props.tone.textMuted, _$p));
100
110
  return _el$1;
101
111
  })();
102
112
  },
@@ -111,7 +121,7 @@ function MonitorRows(props) {
111
121
  _$insertNode(_el$13, _el$14);
112
122
  _$insert(_el$13, () => monitor.name, null);
113
123
  _$effect((_p$) => {
114
- var _v$3 = monitorTone(monitor, props.theme), _v$4 = props.theme.textMuted;
124
+ var _v$3 = monitorTone(monitor, props.tone), _v$4 = props.tone.textMuted;
115
125
  _v$3 !== _p$.e && (_p$.e = _$setProp(_el$12, "fg", _v$3, _p$.e));
116
126
  _v$4 !== _p$.t && (_p$.t = _$setProp(_el$13, "fg", _v$4, _p$.t));
117
127
  return _p$;
@@ -130,127 +140,151 @@ function MonitorRows(props) {
130
140
  get children() {
131
141
  var _el$9 = _$createElement("text");
132
142
  _$insertNode(_el$9, _$createTextNode(`Open Sourcefed for more`));
133
- _$effect((_$p) => _$setProp(_el$9, "fg", props.theme.textMuted, _$p));
143
+ _$effect((_$p) => _$setProp(_el$9, "fg", props.tone.textMuted, _$p));
134
144
  return _el$9;
135
145
  }
136
146
  }), null);
137
147
  return _el$8;
138
148
  })();
139
149
  }
140
- function monitorTone(monitor, theme) {
141
- if (!monitor.enabled) return theme.textMuted;
142
- return theme.success;
150
+ function monitorTone(monitor, tone2) {
151
+ if (!monitor.enabled) return tone2.textMuted;
152
+ return tone2.success;
143
153
  }
144
154
 
145
155
  // .tui-build/tui/plugin.mjs
146
- var sourcefedTui = async (api) => {
147
- api.slots.register({
148
- order: 190,
149
- slots: {
150
- sidebar_content: (_context, value) => _$createComponent2(Sidebar, {
151
- api,
152
- get sessionID() {
153
- return value.session_id;
154
- }
155
- })
156
- }
157
- });
156
+ var sourcefedTui = (ctx) => {
158
157
  let client;
159
- const getSessionID = () => {
160
- const currentRoute = api.route.current;
161
- return "params" in currentRoute && typeof currentRoute.params?.sessionID === "string" ? currentRoute.params.sessionID : void 0;
162
- };
163
158
  const getClient = async () => {
164
- if (client) return client;
165
- client = await connectDaemonClient2({
166
- name: "sourcefed-opencode-tui",
167
- url: process.env.SOURCEFED_DAEMON_URL ?? defaultDaemonUrl2()
168
- });
159
+ if (!client) {
160
+ client = await connectDaemonClient2({
161
+ name: "sourcefed-opencode-tui",
162
+ url: process.env.SOURCEFED_DAEMON_URL ?? defaultDaemonUrl2()
163
+ });
164
+ }
169
165
  return client;
170
166
  };
171
- const unregister = api.command?.register(() => [{
172
- value: "sourcefed",
173
- title: "Sourcefed monitors",
174
- description: "Show monitors for the current OpenCode session",
175
- slash: {
176
- name: "sourcefed"
177
- },
178
- onSelect: async (dialog) => {
179
- const sessionID = getSessionID();
180
- if (!sessionID) {
181
- api.ui.toast({
182
- variant: "warning",
183
- message: "No active OpenCode session"
184
- });
185
- return;
186
- }
187
- try {
188
- const daemon = await getClient();
189
- if (!daemon) throw new Error("no daemon client");
190
- const result = await daemon.request("monitor.list", {
191
- target: {
192
- kind: "opencode-session",
193
- id: sessionID
194
- }
195
- });
196
- const monitors = result?.monitors ?? [];
197
- api.ui.dialog.replace(() => _$createComponent2(MonitorDialog, {
198
- api,
199
- monitors
200
- }));
201
- api.ui.dialog.setSize("large");
202
- } catch (error) {
203
- api.ui.toast({
204
- variant: "error",
205
- message: `Sourcefed daemon unavailable: ${error instanceof Error ? error.message : String(error)}`
206
- });
207
- }
208
- }
209
- }, {
210
- value: "sourcefed-logs",
211
- title: "Sourcefed logs",
212
- description: "Show recent Sourcefed notifications for the current OpenCode session",
213
- slash: {
214
- name: "sourcefed-logs"
215
- },
216
- onSelect: async (dialog) => {
217
- const sessionID = getSessionID();
218
- if (!sessionID) {
219
- api.ui.toast({
220
- variant: "warning",
221
- message: "No active OpenCode session"
222
- });
223
- return;
167
+ const currentSessionID = () => {
168
+ const route = ctx.ui.router.current();
169
+ return route.type === "session" ? route.sessionID : void 0;
170
+ };
171
+ const disposeSlot = ctx.ui.slot({
172
+ append: "sidebar.content",
173
+ render: ({
174
+ sessionID
175
+ }) => _$createComponent2(Sidebar, {
176
+ ctx,
177
+ sessionID
178
+ })
179
+ });
180
+ const disposeKeymapSlot = ctx.ui.slot({
181
+ append: "app",
182
+ render: () => _$createComponent2(KeymapRegistration, {
183
+ ctx,
184
+ currentSessionID,
185
+ getClient
186
+ })
187
+ });
188
+ return () => {
189
+ disposeSlot();
190
+ disposeKeymapSlot();
191
+ void client?.close();
192
+ };
193
+ };
194
+ function KeymapRegistration(props) {
195
+ const {
196
+ ctx,
197
+ currentSessionID,
198
+ getClient
199
+ } = props;
200
+ ctx.keymap.layer(() => ({
201
+ mode: "global",
202
+ commands: [{
203
+ id: "sourcefed",
204
+ title: "Sourcefed monitors",
205
+ description: "Show monitors for the current OpenCode session",
206
+ slash: {
207
+ name: "sourcefed"
208
+ },
209
+ run: async () => {
210
+ const id2 = currentSessionID();
211
+ if (!id2) {
212
+ ctx.ui.toast.show({
213
+ variant: "warning",
214
+ message: "No active OpenCode session"
215
+ });
216
+ return;
217
+ }
218
+ try {
219
+ const daemon = await getClient();
220
+ const result = await daemon.request("monitor.list", {
221
+ target: {
222
+ kind: "opencode-session",
223
+ id: id2
224
+ }
225
+ });
226
+ const monitors = result?.monitors ?? [];
227
+ ctx.ui.dialog.set({
228
+ size: "large"
229
+ });
230
+ ctx.ui.dialog.show(() => _$createComponent2(MonitorDialog, {
231
+ ctx,
232
+ monitors
233
+ }));
234
+ } catch (error) {
235
+ ctx.ui.toast.show({
236
+ variant: "error",
237
+ message: `Sourcefed daemon unavailable: ${error instanceof Error ? error.message : String(error)}`
238
+ });
239
+ }
224
240
  }
225
- try {
226
- const daemon = await getClient();
227
- if (!daemon) throw new Error("no daemon client");
228
- const result = await daemon.request("monitor.logs", {
229
- target: {
230
- kind: "opencode-session",
231
- id: sessionID
232
- }
233
- });
234
- const logs = result?.logs ?? [];
235
- api.ui.dialog.replace(() => _$createComponent2(LogsDialog, {
236
- api,
237
- logs
238
- }));
239
- api.ui.dialog.setSize("large");
240
- } catch (error) {
241
- api.ui.toast({
242
- variant: "error",
243
- message: `Sourcefed daemon unavailable: ${error instanceof Error ? error.message : String(error)}`
244
- });
241
+ }, {
242
+ id: "sourcefed-logs",
243
+ title: "Sourcefed logs",
244
+ description: "Show recent Sourcefed notifications for the current OpenCode session",
245
+ slash: {
246
+ name: "sourcefed-logs"
247
+ },
248
+ run: async () => {
249
+ const id2 = currentSessionID();
250
+ if (!id2) {
251
+ ctx.ui.toast.show({
252
+ variant: "warning",
253
+ message: "No active OpenCode session"
254
+ });
255
+ return;
256
+ }
257
+ try {
258
+ const daemon = await getClient();
259
+ const result = await daemon.request("monitor.logs", {
260
+ target: {
261
+ kind: "opencode-session",
262
+ id: id2
263
+ }
264
+ });
265
+ const logs = result?.logs ?? [];
266
+ ctx.ui.dialog.set({
267
+ size: "large"
268
+ });
269
+ ctx.ui.dialog.show(() => _$createComponent2(LogsDialog, {
270
+ ctx,
271
+ logs
272
+ }));
273
+ } catch (error) {
274
+ ctx.ui.toast.show({
275
+ variant: "error",
276
+ message: `Sourcefed daemon unavailable: ${error instanceof Error ? error.message : String(error)}`
277
+ });
278
+ }
245
279
  }
246
- }
247
- }]);
248
- void unregister;
249
- };
280
+ }]
281
+ }));
282
+ return null;
283
+ }
250
284
  function MonitorDialog(props) {
251
- const theme = createMemo2(() => props.api.theme.current);
285
+ const palette = createMemo2(() => tone(props.ctx.theme));
252
286
  const active = props.monitors.filter((monitor) => monitor.enabled);
253
- const maxListRows = Math.max(6, Math.floor(props.api.renderer.height * 0.45));
287
+ const maxListRows = Math.max(6, Math.floor(props.ctx.renderer.height * 0.45));
254
288
  return (() => {
255
289
  var _el$ = _$createElement2("box"), _el$2 = _$createElement2("box"), _el$3 = _$createElement2("text"), _el$4 = _$createTextNode2(`Sourcefed monitors (`), _el$5 = _$createTextNode2(`)`), _el$6 = _$createElement2("box"), _el$7 = _$createElement2("text");
256
290
  _$insertNode2(_el$, _el$2);
@@ -284,8 +318,8 @@ function MonitorDialog(props) {
284
318
  _$setProp2(_el$10, "width", "100%");
285
319
  _$insert2(_el$10, () => active.map((monitor) => _$createComponent2(MonitorCard, {
286
320
  monitor,
287
- get theme() {
288
- return theme();
321
+ get tone() {
322
+ return palette();
289
323
  }
290
324
  })));
291
325
  return _el$1;
@@ -294,12 +328,12 @@ function MonitorDialog(props) {
294
328
  get children() {
295
329
  var _el$9 = _$createElement2("text");
296
330
  _$insertNode2(_el$9, _$createTextNode2(`No active monitors`));
297
- _$effect2((_$p) => _$setProp2(_el$9, "fg", theme().textMuted, _$p));
331
+ _$effect2((_$p) => _$setProp2(_el$9, "fg", palette().textMuted, _$p));
298
332
  return _el$9;
299
333
  }
300
334
  }), null);
301
335
  _$effect2((_p$) => {
302
- var _v$ = theme().text, _v$2 = theme().textMuted;
336
+ var _v$ = palette().text, _v$2 = palette().textMuted;
303
337
  _v$ !== _p$.e && (_p$.e = _$setProp2(_el$3, "fg", _v$, _p$.e));
304
338
  _v$2 !== _p$.t && (_p$.t = _$setProp2(_el$7, "fg", _v$2, _p$.t));
305
339
  return _p$;
@@ -312,8 +346,8 @@ function MonitorDialog(props) {
312
346
  }
313
347
  function MonitorCard(props) {
314
348
  const monitor = props.monitor;
315
- const theme = props.theme;
316
- const status = monitor.unresponsive ? theme.error : monitor.enabled ? theme.success : theme.textMuted;
349
+ const palette = props.tone;
350
+ const status = monitor.unresponsive ? palette.error : monitor.enabled ? palette.success : palette.textMuted;
317
351
  const statusLabel = !monitor.enabled ? "stopped" : monitor.unresponsive ? "recovering connection" : "healthy";
318
352
  const rows = [["Delivery", monitor.delivery], ["Poll interval", `${monitor.pollIntervalSec}s`], ["Created", formatTime(monitor.createdAt)], ["Updated", formatTime(monitor.updatedAt)], ["Last poll", formatTime(monitor.lastPolledAt)], ["Webhook heartbeat", formatTime(monitor.webhookHeartbeatAt)]];
319
353
  return (() => {
@@ -359,7 +393,7 @@ function MonitorCard(props) {
359
393
  _$setProp2(_el$24, "truncate", true);
360
394
  _$insert2(_el$24, value);
361
395
  _$effect2((_p$) => {
362
- var _v$3 = theme.textMuted, _v$4 = theme.text;
396
+ var _v$3 = palette.textMuted, _v$4 = palette.text;
363
397
  _v$3 !== _p$.e && (_p$.e = _$setProp2(_el$22, "fg", _v$3, _p$.e));
364
398
  _v$4 !== _p$.t && (_p$.t = _$setProp2(_el$24, "fg", _v$4, _p$.t));
365
399
  return _p$;
@@ -369,7 +403,7 @@ function MonitorCard(props) {
369
403
  });
370
404
  return _el$21;
371
405
  })()), null);
372
- _$effect2((_$p) => _$setProp2(_el$15, "fg", theme.text, _$p));
406
+ _$effect2((_$p) => _$setProp2(_el$15, "fg", palette.text, _$p));
373
407
  return _el$11;
374
408
  })();
375
409
  }
@@ -380,8 +414,8 @@ function formatTime(value) {
380
414
  return date.toLocaleString();
381
415
  }
382
416
  function LogsDialog(props) {
383
- const theme = createMemo2(() => props.api.theme.current);
384
- const maxListRows = Math.max(6, Math.floor(props.api.renderer.height * 0.45));
417
+ const palette = createMemo2(() => tone(props.ctx.theme));
418
+ const maxListRows = Math.max(6, Math.floor(props.ctx.renderer.height * 0.45));
385
419
  return (() => {
386
420
  var _el$25 = _$createElement2("box"), _el$26 = _$createElement2("box"), _el$27 = _$createElement2("text"), _el$28 = _$createTextNode2(`Sourcefed notifications (`), _el$29 = _$createTextNode2(`)`), _el$30 = _$createElement2("box"), _el$31 = _$createElement2("text");
387
421
  _$insertNode2(_el$25, _el$26);
@@ -409,7 +443,7 @@ function LogsDialog(props) {
409
443
  return (() => {
410
444
  var _el$35 = _$createElement2("text");
411
445
  _$insertNode2(_el$35, _$createTextNode2(`No notifications sent yet`));
412
- _$effect2((_$p) => _$setProp2(_el$35, "fg", theme().textMuted, _$p));
446
+ _$effect2((_$p) => _$setProp2(_el$35, "fg", palette().textMuted, _$p));
413
447
  return _el$35;
414
448
  })();
415
449
  },
@@ -454,12 +488,12 @@ function LogsDialog(props) {
454
488
  var _el$45 = _$createElement2("text"), _el$46 = _$createTextNode2(` `);
455
489
  _$insertNode2(_el$45, _el$46);
456
490
  _$insert2(_el$45, () => entry.body, null);
457
- _$effect2((_$p) => _$setProp2(_el$45, "fg", theme().textMuted, _$p));
491
+ _$effect2((_$p) => _$setProp2(_el$45, "fg", palette().textMuted, _$p));
458
492
  return _el$45;
459
493
  }
460
494
  }), null);
461
495
  _$effect2((_p$) => {
462
- var _v$7 = entry.actionable ? theme().warning : theme().textMuted, _v$8 = theme().text, _v$9 = theme().text;
496
+ var _v$7 = entry.actionable ? palette().warning : palette().textMuted, _v$8 = palette().text, _v$9 = palette().text;
463
497
  _v$7 !== _p$.e && (_p$.e = _$setProp2(_el$39, "fg", _v$7, _p$.e));
464
498
  _v$8 !== _p$.t && (_p$.t = _$setProp2(_el$40, "fg", _v$8, _p$.t));
465
499
  _v$9 !== _p$.a && (_p$.a = _$setProp2(_el$42, "fg", _v$9, _p$.a));
@@ -475,7 +509,7 @@ function LogsDialog(props) {
475
509
  }
476
510
  }), null);
477
511
  _$effect2((_p$) => {
478
- var _v$5 = theme().text, _v$6 = theme().textMuted;
512
+ var _v$5 = palette().text, _v$6 = palette().textMuted;
479
513
  _v$5 !== _p$.e && (_p$.e = _$setProp2(_el$27, "fg", _v$5, _p$.e));
480
514
  _v$6 !== _p$.t && (_p$.t = _$setProp2(_el$31, "fg", _v$6, _p$.t));
481
515
  return _p$;
@@ -489,7 +523,7 @@ function LogsDialog(props) {
489
523
 
490
524
  // .tui-build/tui/index.mjs
491
525
  var id = "sourcefed-tui";
492
- var index_default = { id, tui: sourcefedTui };
526
+ var index_default = { id, setup: sourcefedTui };
493
527
  export {
494
528
  index_default as default,
495
529
  id
@@ -1,19 +1,18 @@
1
- import type { createOpencodeClient } from "@opencode-ai/sdk";
2
- type OpenCodeClient = ReturnType<typeof createOpencodeClient>;
1
+ import type { Plugin } from "@opencode/plugin";
2
+ type SessionDomain = Plugin.Context["session"];
3
3
  export declare class OpenCodeBridge {
4
- private readonly opencode;
4
+ private readonly session;
5
5
  private daemon?;
6
6
  private readonly listeners;
7
7
  private lastAttemptAt;
8
8
  private lastError;
9
- constructor(opencode: OpenCodeClient);
9
+ constructor(session: SessionDomain);
10
10
  start(): Promise<void>;
11
11
  ensureTarget(sessionID: string): Promise<void>;
12
12
  callTool(name: string, arguments_: Record<string, unknown>, sessionID: string): Promise<unknown>;
13
13
  close(): Promise<void>;
14
14
  private ensureDaemon;
15
15
  private routeEvents;
16
- private currentModel;
17
16
  private target;
18
17
  }
19
18
  export declare function setOpenCodeBridge(bridge: OpenCodeBridge): void;
@@ -1,3 +1,4 @@
1
- import type { Plugin } from "@opencode-ai/plugin";
2
- export declare const Sourcefed: Plugin;
3
- export default Sourcefed;
1
+ import { Plugin } from "@opencode/plugin";
2
+ export declare function setupSourcefed(ctx: Plugin.Context): Promise<Plugin.Cleanup>;
3
+ declare const _default: Plugin.Plugin;
4
+ export default _default;
@@ -1,3 +1,53 @@
1
- import { type ToolDefinition } from "@opencode-ai/plugin";
2
- declare const definition: ToolDefinition;
1
+ import type { ToolContext } from "@opencode/plugin/promise/tool";
2
+ declare const definition: {
3
+ name: string;
4
+ description: string;
5
+ input: {
6
+ type: string;
7
+ properties: {
8
+ name: {
9
+ type: string;
10
+ description: string;
11
+ };
12
+ sourceType: {
13
+ type: string;
14
+ enum: string[];
15
+ description: string;
16
+ };
17
+ issueKey: {
18
+ type: string;
19
+ description: string;
20
+ };
21
+ repo: {
22
+ type: string;
23
+ description: string;
24
+ };
25
+ prNumber: {
26
+ type: string;
27
+ description: string;
28
+ };
29
+ channelId: {
30
+ type: string;
31
+ description: string;
32
+ };
33
+ threadTs: {
34
+ type: string;
35
+ description: string;
36
+ };
37
+ threadUrl: {
38
+ type: string;
39
+ description: string;
40
+ };
41
+ pollIntervalSec: {
42
+ type: string;
43
+ description: string;
44
+ };
45
+ };
46
+ required: string[];
47
+ additionalProperties: boolean;
48
+ };
49
+ execute(input: unknown, context: ToolContext): Promise<{
50
+ content: string;
51
+ }>;
52
+ };
3
53
  export default definition;
@@ -1,3 +1,14 @@
1
- import { type ToolDefinition } from "@opencode-ai/plugin";
2
- declare const definition: ToolDefinition;
1
+ import type { ToolContext } from "@opencode/plugin/promise/tool";
2
+ declare const definition: {
3
+ name: string;
4
+ description: string;
5
+ input: {
6
+ type: string;
7
+ properties: {};
8
+ additionalProperties: boolean;
9
+ };
10
+ execute(_input: unknown, context: ToolContext): Promise<{
11
+ content: string;
12
+ }>;
13
+ };
3
14
  export default definition;
@@ -1,3 +1,20 @@
1
- import { type ToolDefinition } from "@opencode-ai/plugin";
2
- declare const definition: ToolDefinition;
1
+ import type { ToolContext } from "@opencode/plugin/promise/tool";
2
+ declare const definition: {
3
+ name: string;
4
+ description: string;
5
+ input: {
6
+ type: string;
7
+ properties: {
8
+ id: {
9
+ type: string;
10
+ description: string;
11
+ };
12
+ };
13
+ required: string[];
14
+ additionalProperties: boolean;
15
+ };
16
+ execute(input: unknown, context: ToolContext): Promise<{
17
+ content: string;
18
+ }>;
19
+ };
3
20
  export default definition;
@@ -1,3 +1,20 @@
1
- import { type ToolDefinition } from "@opencode-ai/plugin";
2
- declare const definition: ToolDefinition;
1
+ import type { ToolContext } from "@opencode/plugin/promise/tool";
2
+ declare const definition: {
3
+ name: string;
4
+ description: string;
5
+ input: {
6
+ type: string;
7
+ properties: {
8
+ id: {
9
+ type: string;
10
+ description: string;
11
+ };
12
+ };
13
+ required: string[];
14
+ additionalProperties: boolean;
15
+ };
16
+ execute(input: unknown, context: ToolContext): Promise<{
17
+ content: string;
18
+ }>;
19
+ };
3
20
  export default definition;
@@ -1,3 +1,20 @@
1
- import { type ToolDefinition } from "@opencode-ai/plugin";
2
- declare const definition: ToolDefinition;
1
+ import type { ToolContext } from "@opencode/plugin/promise/tool";
2
+ declare const definition: {
3
+ name: string;
4
+ description: string;
5
+ input: {
6
+ type: string;
7
+ properties: {
8
+ id: {
9
+ type: string;
10
+ description: string;
11
+ };
12
+ };
13
+ required: string[];
14
+ additionalProperties: boolean;
15
+ };
16
+ execute(input: unknown, context: ToolContext): Promise<{
17
+ content: string;
18
+ }>;
19
+ };
3
20
  export default definition;
@@ -1,3 +1,3 @@
1
1
  /** @jsxImportSource @opentui/solid */
2
- import type { TuiPlugin } from "@opencode-ai/plugin/tui";
3
- export declare const sourcefedTui: TuiPlugin;
2
+ import type { Plugin } from "@opencode/plugin/tui";
3
+ export declare const sourcefedTui: (ctx: Plugin.Context) => (() => void);
@@ -1,13 +1,18 @@
1
1
  /** @jsxImportSource @opentui/solid */
2
2
  import { type MonitorView } from "@fdcn/sourcefed/daemon";
3
- import type { TuiPluginApi, TuiThemeCurrent } from "@opencode-ai/plugin/tui";
3
+ import type { Plugin } from "@opencode/plugin/tui";
4
+ type ThemeTokens = Plugin.Context["theme"];
5
+ type Color = ThemeTokens["text"]["default"];
6
+ export type Tone = Record<"text" | "textMuted" | "accent" | "success" | "error" | "warning", Color>;
7
+ export declare function tone(theme: ThemeTokens): Tone;
4
8
  export type SidebarProps = {
5
- api: TuiPluginApi;
9
+ ctx: Plugin.Context;
6
10
  sessionID: string;
7
11
  };
8
12
  export declare function Sidebar(props: SidebarProps): import("solid-js").JSX.Element;
9
13
  export declare function MonitorRows(props: {
10
14
  monitors: () => MonitorView[];
11
- theme: TuiThemeCurrent;
15
+ tone: Tone;
12
16
  compact?: boolean;
13
17
  }): import("solid-js").JSX.Element;
18
+ export {};
@@ -1,7 +1,8 @@
1
- import type { TuiPlugin } from "@opencode-ai/plugin/tui";
1
+ import type { Plugin } from "@opencode/plugin/tui";
2
+ type Setup = Plugin.Definition["setup"];
2
3
  export declare const id = "sourcefed-tui";
3
4
  declare const _default: {
4
5
  id: string;
5
- tui: TuiPlugin;
6
+ setup: (ctx: Parameters<Setup>[0]) => Promise<void | Plugin.Cleanup>;
6
7
  };
7
8
  export default _default;
@@ -1 +1 @@
1
- export { default, Sourcefed } from "./adapters/opencode/index.js";
1
+ export { default, setupSourcefed } from "./adapters/opencode/index.js";
@@ -1,2 +1,3 @@
1
1
  export declare function setupSpec(): string;
2
- export declare function setupHost(name: string, args: string[], spec: string): Promise<void>;
2
+ export declare function setupHost(name: string, args: string[], spec: string): Promise<boolean>;
3
+ export declare function configureOpenCodeCliPlugin(spec: string): void;