@fdcn/sourcefed 0.2.9 → 0.3.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.
- package/README.md +2 -2
- package/dist/{chunk-QHT4DCW7.js → chunk-QPDTUNFA.js} +19 -1
- package/dist/cli.js +19 -1
- package/dist/daemon.js +19 -1
- package/dist/mcp.js +1 -1
- package/dist/opencode.js +139 -12545
- package/dist/pi.js +1 -1
- package/dist/tui-compiled.mjs +141 -124
- package/dist.dts/adapters/opencode/bridge.d.ts +4 -5
- package/dist.dts/adapters/opencode/index.d.ts +4 -3
- package/dist.dts/adapters/opencode/tools/monitor_create.d.ts +52 -2
- package/dist.dts/adapters/opencode/tools/monitor_list.d.ts +13 -2
- package/dist.dts/adapters/opencode/tools/monitor_start.d.ts +19 -2
- package/dist.dts/adapters/opencode/tools/monitor_status.d.ts +19 -2
- package/dist.dts/adapters/opencode/tools/monitor_stop.d.ts +19 -2
- package/dist.dts/adapters/opencode/tui/plugin.d.ts +2 -2
- package/dist.dts/adapters/opencode/tui/sidebar.d.ts +8 -3
- package/dist.dts/adapters/opencode/tui.d.ts +3 -2
- package/dist.dts/index.d.ts +1 -1
- package/dist.dts/packages/daemon/src/daemon.d.ts +2 -0
- package/dist.dts/packages/sourcefed/src/server.d.ts +2 -6
- package/package.json +2 -2
package/dist/pi.js
CHANGED
package/dist/tui-compiled.mjs
CHANGED
|
@@ -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
|
|
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
|
|
69
|
-
return
|
|
78
|
+
get tone() {
|
|
79
|
+
return palette();
|
|
70
80
|
},
|
|
71
81
|
compact: true
|
|
72
82
|
}), null);
|
|
73
83
|
_$effect((_p$) => {
|
|
74
|
-
var _v$ =
|
|
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.
|
|
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.
|
|
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,134 @@ 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.
|
|
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,
|
|
141
|
-
if (!monitor.enabled) return
|
|
142
|
-
return
|
|
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 =
|
|
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)
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
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
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
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
|
+
ctx.keymap.layer(() => ({
|
|
181
|
+
mode: "global",
|
|
182
|
+
commands: [{
|
|
183
|
+
id: "sourcefed",
|
|
184
|
+
title: "Sourcefed monitors",
|
|
185
|
+
description: "Show monitors for the current OpenCode session",
|
|
186
|
+
slash: {
|
|
187
|
+
name: "sourcefed"
|
|
188
|
+
},
|
|
189
|
+
run: async () => {
|
|
190
|
+
const id2 = currentSessionID();
|
|
191
|
+
if (!id2) {
|
|
192
|
+
ctx.ui.toast.show({
|
|
193
|
+
variant: "warning",
|
|
194
|
+
message: "No active OpenCode session"
|
|
195
|
+
});
|
|
196
|
+
return;
|
|
197
|
+
}
|
|
198
|
+
try {
|
|
199
|
+
const daemon = await getClient();
|
|
200
|
+
const result = await daemon.request("monitor.list", {
|
|
201
|
+
target: {
|
|
202
|
+
kind: "opencode-session",
|
|
203
|
+
id: id2
|
|
204
|
+
}
|
|
205
|
+
});
|
|
206
|
+
const monitors = result?.monitors ?? [];
|
|
207
|
+
ctx.ui.dialog.set({
|
|
208
|
+
size: "large"
|
|
209
|
+
});
|
|
210
|
+
ctx.ui.dialog.show(() => _$createComponent2(MonitorDialog, {
|
|
211
|
+
ctx,
|
|
212
|
+
monitors
|
|
213
|
+
}));
|
|
214
|
+
} catch (error) {
|
|
215
|
+
ctx.ui.toast.show({
|
|
216
|
+
variant: "error",
|
|
217
|
+
message: `Sourcefed daemon unavailable: ${error instanceof Error ? error.message : String(error)}`
|
|
218
|
+
});
|
|
219
|
+
}
|
|
224
220
|
}
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
221
|
+
}, {
|
|
222
|
+
id: "sourcefed-logs",
|
|
223
|
+
title: "Sourcefed logs",
|
|
224
|
+
description: "Show recent Sourcefed notifications for the current OpenCode session",
|
|
225
|
+
slash: {
|
|
226
|
+
name: "sourcefed-logs"
|
|
227
|
+
},
|
|
228
|
+
run: async () => {
|
|
229
|
+
const id2 = currentSessionID();
|
|
230
|
+
if (!id2) {
|
|
231
|
+
ctx.ui.toast.show({
|
|
232
|
+
variant: "warning",
|
|
233
|
+
message: "No active OpenCode session"
|
|
234
|
+
});
|
|
235
|
+
return;
|
|
236
|
+
}
|
|
237
|
+
try {
|
|
238
|
+
const daemon = await getClient();
|
|
239
|
+
const result = await daemon.request("monitor.logs", {
|
|
240
|
+
target: {
|
|
241
|
+
kind: "opencode-session",
|
|
242
|
+
id: id2
|
|
243
|
+
}
|
|
244
|
+
});
|
|
245
|
+
const logs = result?.logs ?? [];
|
|
246
|
+
ctx.ui.dialog.set({
|
|
247
|
+
size: "large"
|
|
248
|
+
});
|
|
249
|
+
ctx.ui.dialog.show(() => _$createComponent2(LogsDialog, {
|
|
250
|
+
ctx,
|
|
251
|
+
logs
|
|
252
|
+
}));
|
|
253
|
+
} catch (error) {
|
|
254
|
+
ctx.ui.toast.show({
|
|
255
|
+
variant: "error",
|
|
256
|
+
message: `Sourcefed daemon unavailable: ${error instanceof Error ? error.message : String(error)}`
|
|
257
|
+
});
|
|
258
|
+
}
|
|
245
259
|
}
|
|
246
|
-
}
|
|
247
|
-
}
|
|
248
|
-
|
|
260
|
+
}]
|
|
261
|
+
}));
|
|
262
|
+
return () => {
|
|
263
|
+
disposeSlot();
|
|
264
|
+
void client?.close();
|
|
265
|
+
};
|
|
249
266
|
};
|
|
250
267
|
function MonitorDialog(props) {
|
|
251
|
-
const
|
|
268
|
+
const palette = createMemo2(() => tone(props.ctx.theme));
|
|
252
269
|
const active = props.monitors.filter((monitor) => monitor.enabled);
|
|
253
|
-
const maxListRows = Math.max(6, Math.floor(props.
|
|
270
|
+
const maxListRows = Math.max(6, Math.floor(props.ctx.renderer.height * 0.45));
|
|
254
271
|
return (() => {
|
|
255
272
|
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
273
|
_$insertNode2(_el$, _el$2);
|
|
@@ -284,8 +301,8 @@ function MonitorDialog(props) {
|
|
|
284
301
|
_$setProp2(_el$10, "width", "100%");
|
|
285
302
|
_$insert2(_el$10, () => active.map((monitor) => _$createComponent2(MonitorCard, {
|
|
286
303
|
monitor,
|
|
287
|
-
get
|
|
288
|
-
return
|
|
304
|
+
get tone() {
|
|
305
|
+
return palette();
|
|
289
306
|
}
|
|
290
307
|
})));
|
|
291
308
|
return _el$1;
|
|
@@ -294,12 +311,12 @@ function MonitorDialog(props) {
|
|
|
294
311
|
get children() {
|
|
295
312
|
var _el$9 = _$createElement2("text");
|
|
296
313
|
_$insertNode2(_el$9, _$createTextNode2(`No active monitors`));
|
|
297
|
-
_$effect2((_$p) => _$setProp2(_el$9, "fg",
|
|
314
|
+
_$effect2((_$p) => _$setProp2(_el$9, "fg", palette().textMuted, _$p));
|
|
298
315
|
return _el$9;
|
|
299
316
|
}
|
|
300
317
|
}), null);
|
|
301
318
|
_$effect2((_p$) => {
|
|
302
|
-
var _v$ =
|
|
319
|
+
var _v$ = palette().text, _v$2 = palette().textMuted;
|
|
303
320
|
_v$ !== _p$.e && (_p$.e = _$setProp2(_el$3, "fg", _v$, _p$.e));
|
|
304
321
|
_v$2 !== _p$.t && (_p$.t = _$setProp2(_el$7, "fg", _v$2, _p$.t));
|
|
305
322
|
return _p$;
|
|
@@ -312,8 +329,8 @@ function MonitorDialog(props) {
|
|
|
312
329
|
}
|
|
313
330
|
function MonitorCard(props) {
|
|
314
331
|
const monitor = props.monitor;
|
|
315
|
-
const
|
|
316
|
-
const status = monitor.unresponsive ?
|
|
332
|
+
const palette = props.tone;
|
|
333
|
+
const status = monitor.unresponsive ? palette.error : monitor.enabled ? palette.success : palette.textMuted;
|
|
317
334
|
const statusLabel = !monitor.enabled ? "stopped" : monitor.unresponsive ? "recovering connection" : "healthy";
|
|
318
335
|
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
336
|
return (() => {
|
|
@@ -359,7 +376,7 @@ function MonitorCard(props) {
|
|
|
359
376
|
_$setProp2(_el$24, "truncate", true);
|
|
360
377
|
_$insert2(_el$24, value);
|
|
361
378
|
_$effect2((_p$) => {
|
|
362
|
-
var _v$3 =
|
|
379
|
+
var _v$3 = palette.textMuted, _v$4 = palette.text;
|
|
363
380
|
_v$3 !== _p$.e && (_p$.e = _$setProp2(_el$22, "fg", _v$3, _p$.e));
|
|
364
381
|
_v$4 !== _p$.t && (_p$.t = _$setProp2(_el$24, "fg", _v$4, _p$.t));
|
|
365
382
|
return _p$;
|
|
@@ -369,7 +386,7 @@ function MonitorCard(props) {
|
|
|
369
386
|
});
|
|
370
387
|
return _el$21;
|
|
371
388
|
})()), null);
|
|
372
|
-
_$effect2((_$p) => _$setProp2(_el$15, "fg",
|
|
389
|
+
_$effect2((_$p) => _$setProp2(_el$15, "fg", palette.text, _$p));
|
|
373
390
|
return _el$11;
|
|
374
391
|
})();
|
|
375
392
|
}
|
|
@@ -380,8 +397,8 @@ function formatTime(value) {
|
|
|
380
397
|
return date.toLocaleString();
|
|
381
398
|
}
|
|
382
399
|
function LogsDialog(props) {
|
|
383
|
-
const
|
|
384
|
-
const maxListRows = Math.max(6, Math.floor(props.
|
|
400
|
+
const palette = createMemo2(() => tone(props.ctx.theme));
|
|
401
|
+
const maxListRows = Math.max(6, Math.floor(props.ctx.renderer.height * 0.45));
|
|
385
402
|
return (() => {
|
|
386
403
|
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
404
|
_$insertNode2(_el$25, _el$26);
|
|
@@ -409,7 +426,7 @@ function LogsDialog(props) {
|
|
|
409
426
|
return (() => {
|
|
410
427
|
var _el$35 = _$createElement2("text");
|
|
411
428
|
_$insertNode2(_el$35, _$createTextNode2(`No notifications sent yet`));
|
|
412
|
-
_$effect2((_$p) => _$setProp2(_el$35, "fg",
|
|
429
|
+
_$effect2((_$p) => _$setProp2(_el$35, "fg", palette().textMuted, _$p));
|
|
413
430
|
return _el$35;
|
|
414
431
|
})();
|
|
415
432
|
},
|
|
@@ -454,12 +471,12 @@ function LogsDialog(props) {
|
|
|
454
471
|
var _el$45 = _$createElement2("text"), _el$46 = _$createTextNode2(` `);
|
|
455
472
|
_$insertNode2(_el$45, _el$46);
|
|
456
473
|
_$insert2(_el$45, () => entry.body, null);
|
|
457
|
-
_$effect2((_$p) => _$setProp2(_el$45, "fg",
|
|
474
|
+
_$effect2((_$p) => _$setProp2(_el$45, "fg", palette().textMuted, _$p));
|
|
458
475
|
return _el$45;
|
|
459
476
|
}
|
|
460
477
|
}), null);
|
|
461
478
|
_$effect2((_p$) => {
|
|
462
|
-
var _v$7 = entry.actionable ?
|
|
479
|
+
var _v$7 = entry.actionable ? palette().warning : palette().textMuted, _v$8 = palette().text, _v$9 = palette().text;
|
|
463
480
|
_v$7 !== _p$.e && (_p$.e = _$setProp2(_el$39, "fg", _v$7, _p$.e));
|
|
464
481
|
_v$8 !== _p$.t && (_p$.t = _$setProp2(_el$40, "fg", _v$8, _p$.t));
|
|
465
482
|
_v$9 !== _p$.a && (_p$.a = _$setProp2(_el$42, "fg", _v$9, _p$.a));
|
|
@@ -475,7 +492,7 @@ function LogsDialog(props) {
|
|
|
475
492
|
}
|
|
476
493
|
}), null);
|
|
477
494
|
_$effect2((_p$) => {
|
|
478
|
-
var _v$5 =
|
|
495
|
+
var _v$5 = palette().text, _v$6 = palette().textMuted;
|
|
479
496
|
_v$5 !== _p$.e && (_p$.e = _$setProp2(_el$27, "fg", _v$5, _p$.e));
|
|
480
497
|
_v$6 !== _p$.t && (_p$.t = _$setProp2(_el$31, "fg", _v$6, _p$.t));
|
|
481
498
|
return _p$;
|
|
@@ -489,7 +506,7 @@ function LogsDialog(props) {
|
|
|
489
506
|
|
|
490
507
|
// .tui-build/tui/index.mjs
|
|
491
508
|
var id = "sourcefed-tui";
|
|
492
|
-
var index_default = { id,
|
|
509
|
+
var index_default = { id, setup: sourcefedTui };
|
|
493
510
|
export {
|
|
494
511
|
index_default as default,
|
|
495
512
|
id
|
|
@@ -1,19 +1,18 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
type
|
|
1
|
+
import type { Plugin } from "@opencode/plugin";
|
|
2
|
+
type SessionDomain = Plugin.Context["session"];
|
|
3
3
|
export declare class OpenCodeBridge {
|
|
4
|
-
private readonly
|
|
4
|
+
private readonly session;
|
|
5
5
|
private daemon?;
|
|
6
6
|
private readonly listeners;
|
|
7
7
|
private lastAttemptAt;
|
|
8
8
|
private lastError;
|
|
9
|
-
constructor(
|
|
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
|
|
2
|
-
export declare
|
|
3
|
-
|
|
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 {
|
|
2
|
-
declare const definition:
|
|
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 {
|
|
2
|
-
declare const definition:
|
|
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 {
|
|
2
|
-
declare const definition:
|
|
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 {
|
|
2
|
-
declare const definition:
|
|
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 {
|
|
2
|
-
declare const definition:
|
|
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 {
|
|
3
|
-
export declare const sourcefedTui:
|
|
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 {
|
|
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
|
-
|
|
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
|
-
|
|
15
|
+
tone: Tone;
|
|
12
16
|
compact?: boolean;
|
|
13
17
|
}): import("solid-js").JSX.Element;
|
|
18
|
+
export {};
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import type {
|
|
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
|
-
|
|
6
|
+
setup: (ctx: Parameters<Setup>[0]) => Promise<void | Plugin.Cleanup>;
|
|
6
7
|
};
|
|
7
8
|
export default _default;
|
package/dist.dts/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { default,
|
|
1
|
+
export { default, setupSourcefed } from "./adapters/opencode/index.js";
|
|
@@ -31,6 +31,8 @@ export declare class SourcefedDaemon {
|
|
|
31
31
|
private appendLog;
|
|
32
32
|
private emit;
|
|
33
33
|
private deliver;
|
|
34
|
+
private dropQueued;
|
|
35
|
+
private purgeMonitorEvents;
|
|
34
36
|
}
|
|
35
37
|
export declare function monitorView(monitor: MonitorRecord): MonitorView;
|
|
36
38
|
export declare function logEntryView(queued: QueuedMonitorEvent): LogEntryView;
|
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
declare const _default: {
|
|
4
|
-
id: string;
|
|
5
|
-
server: (input: Parameters<typeof Sourcefed>[0]) => Promise<Hooks>;
|
|
6
|
-
};
|
|
1
|
+
import { Plugin } from "@opencode/plugin";
|
|
2
|
+
declare const _default: Plugin.Plugin;
|
|
7
3
|
export default _default;
|