@fdcn/sourcefed 0.3.6 → 0.3.8

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 (52) hide show
  1. package/README.md +1 -1
  2. package/dist/{chunk-X3BZSHKZ.js → chunk-5JL3UV72.js} +1328 -399
  3. package/dist/cli.js +9888 -8063
  4. package/dist/daemon.js +1194 -263
  5. package/dist/data/core/SKILL.md +9 -4
  6. package/dist/data/core/references/commands.md +6 -1
  7. package/dist/data/sourcefed/SKILL.md +3 -2
  8. package/dist/guidance.md +6 -2
  9. package/dist/mcp.js +6 -2
  10. package/dist/opencode.js +263 -122
  11. package/dist/pi.js +161 -39
  12. package/dist/tui-compiled.mjs +306 -166
  13. package/dist.dts/adapters/opencode/bridge.d.ts +66 -22
  14. package/dist.dts/adapters/opencode/subscriptions.d.ts +46 -0
  15. package/dist.dts/adapters/opencode/tool-result.d.ts +2 -1
  16. package/dist.dts/adapters/opencode/tools/monitor_create.d.ts +19 -2
  17. package/dist.dts/adapters/opencode/tools/monitor_list.d.ts +3 -2
  18. package/dist.dts/adapters/opencode/tools/monitor_start.d.ts +3 -2
  19. package/dist.dts/adapters/opencode/tools/monitor_status.d.ts +3 -2
  20. package/dist.dts/adapters/opencode/tools/monitor_stop.d.ts +3 -2
  21. package/dist.dts/adapters/pi/src/dialog.d.ts +1 -2
  22. package/dist.dts/adapters/pi/src/monitors-dialog.d.ts +32 -0
  23. package/dist.dts/packages/core/src/types/monitor-create-input.d.ts +4 -0
  24. package/dist.dts/packages/daemon/src/event-stream.d.ts +26 -0
  25. package/dist.dts/packages/daemon/src/registry.d.ts +2 -0
  26. package/dist.dts/packages/daemon/src/stream-lifecycle.test.d.ts +1 -0
  27. package/dist.dts/packages/daemon/src/types/client.d.ts +3 -1
  28. package/dist.dts/packages/daemon/src/types/daemon.d.ts +4 -0
  29. package/dist.dts/packages/daemon/src/utils/index.d.ts +0 -1
  30. package/dist.dts/providers/yab/src/index.d.ts +2 -0
  31. package/dist.dts/providers/yab/src/monitor.d.ts +14 -0
  32. package/dist.dts/providers/yab/src/poll/index.d.ts +2 -0
  33. package/dist.dts/providers/yab/src/poll/monitor.d.ts +3 -0
  34. package/dist.dts/providers/yab/src/poll/utils/feed-events.d.ts +5 -0
  35. package/dist.dts/providers/yab/src/poll/utils/index.d.ts +4 -0
  36. package/dist.dts/providers/yab/src/poll/utils/parse-feed.d.ts +3 -0
  37. package/dist.dts/providers/yab/src/poll/utils/poll-yab.d.ts +7 -0
  38. package/dist.dts/providers/yab/src/poll/utils/yab-mcp.d.ts +10 -0
  39. package/dist.dts/providers/yab/src/schema.d.ts +12 -0
  40. package/dist.dts/providers/yab/src/types/cursor.d.ts +4 -0
  41. package/dist.dts/providers/yab/src/types/event.d.ts +8 -0
  42. package/dist.dts/providers/yab/src/types/feed-entry.d.ts +8 -0
  43. package/dist.dts/providers/yab/src/types/index.d.ts +5 -0
  44. package/dist.dts/providers/yab/src/types/page.d.ts +6 -0
  45. package/dist.dts/providers/yab/src/types/source-record.d.ts +7 -0
  46. package/dist.dts/providers/yab/src/yab.test.d.ts +1 -0
  47. package/package.json +1 -1
  48. package/dist.dts/packages/daemon/src/utils/forward.d.ts +0 -32
  49. package/dist.dts/packages/daemon/src/utils/gate.d.ts +0 -33
  50. package/dist.dts/packages/daemon/src/utils/request-router.d.ts +0 -11
  51. /package/dist.dts/{packages/daemon/src/forward.test.d.ts → adapters/opencode/lifecycle.test.d.ts} +0 -0
  52. /package/dist.dts/{packages/daemon/src/gate.test.d.ts → adapters/pi/src/monitors-dialog.test.d.ts} +0 -0
@@ -1,34 +1,80 @@
1
+ import { type QueuedMonitorEvent } from "@fdcn/sourcefed/core";
1
2
  import { type Plugin } from "@opencode/plugin";
3
+ import { OpenCodeSubscriptions, type SessionLocation } from "./subscriptions.js";
2
4
  type SessionDomain = Plugin.Context["session"];
3
- type RpcDomain = Plugin.Context["rpc"];
5
+ type RpcDomain = (definition: typeof ChauffeurGate) => {
6
+ gate(input: unknown, options: {
7
+ signal: AbortSignal;
8
+ }): Promise<unknown>;
9
+ };
10
+ /**
11
+ * Chauffeur's gate, declared here so sourcefed does not depend on Chauffeur.
12
+ * When the Chauffeur plugin runs in this OpenCode process, it decides which
13
+ * events reach the session; otherwise every event is delivered.
14
+ */
15
+ declare const ChauffeurGate: {
16
+ readonly id: "chauffeur";
17
+ readonly methods: {
18
+ readonly gate: {
19
+ readonly input: {
20
+ readonly type: "object";
21
+ readonly properties: {
22
+ readonly sessionID: {
23
+ readonly type: "string";
24
+ };
25
+ readonly monitorID: {
26
+ readonly type: "string";
27
+ };
28
+ readonly source: {
29
+ readonly type: "string";
30
+ };
31
+ readonly kind: {
32
+ readonly type: "string";
33
+ };
34
+ readonly summary: {
35
+ readonly type: "string";
36
+ };
37
+ readonly body: {
38
+ readonly type: "string";
39
+ };
40
+ readonly actionable: {
41
+ readonly type: "boolean";
42
+ };
43
+ };
44
+ readonly required: readonly ["sessionID", "source", "kind", "summary", "actionable"];
45
+ };
46
+ readonly output: {
47
+ readonly type: "object";
48
+ readonly properties: {
49
+ readonly deliver: {
50
+ readonly type: "boolean";
51
+ };
52
+ };
53
+ readonly required: readonly ["deliver"];
54
+ };
55
+ };
56
+ };
57
+ readonly events: {};
58
+ };
4
59
  export declare class OpenCodeBridge {
5
60
  private readonly session;
6
- private readonly rpc?;
7
- private daemon?;
8
- private readonly listeners;
9
- private lastAttemptAt;
10
- private lastError;
11
- private timer;
12
- constructor(session: SessionDomain, rpc?: RpcDomain | undefined);
61
+ private readonly rpc;
62
+ readonly location: SessionLocation;
63
+ private readonly hub;
64
+ private started;
65
+ private closed;
66
+ private closing;
67
+ constructor(session: Pick<SessionDomain, "get" | "synthetic">, rpc: RpcDomain | undefined, location: SessionLocation, hub?: OpenCodeSubscriptions);
13
68
  /**
14
69
  * Chauffeur or the CLI can create a monitor for a session here at any time,
15
70
  * without this bridge's tools, so check for new targets periodically too.
16
71
  */
17
72
  start(): Promise<void>;
18
- ensureTarget(sessionID: string): Promise<void>;
19
73
  callTool(name: string, arguments_: Record<string, unknown>, sessionID: string): Promise<unknown>;
20
74
  close(): Promise<void>;
21
- private refresh;
22
- private ensureDaemon;
23
- /**
24
- * Monitors outlive this process, so after a restart nothing listens for their
25
- * sessions until something subscribes. Subscribe every session that has an
26
- * enabled monitor and still exists here; a deleted session is skipped, since
27
- * delivering to it would fail and retry forever.
28
- */
29
- private resubscribe;
30
- private resubscribeTarget;
31
- private routeEvents;
75
+ refresh(): Promise<void>;
76
+ getSession(sessionID: string, signal: AbortSignal): Promise<import("@opencode/client").SessionInfo>;
77
+ routeEvents(events: QueuedMonitorEvent[]): Promise<void>;
32
78
  /**
33
79
  * Ask Chauffeur's gate, when it runs in this process. Only an explicit
34
80
  * `deliver: false` withholds the event; no gate, an error, or a slow answer
@@ -37,6 +83,4 @@ export declare class OpenCodeBridge {
37
83
  private admitted;
38
84
  private target;
39
85
  }
40
- export declare function setOpenCodeBridge(bridge: OpenCodeBridge): void;
41
- export declare function getOpenCodeBridge(): OpenCodeBridge;
42
86
  export {};
@@ -0,0 +1,46 @@
1
+ import type { QueuedMonitorEvent } from "@fdcn/sourcefed/core";
2
+ import type { DaemonClient } from "@fdcn/sourcefed/daemon";
3
+ export type SessionLocation = {
4
+ directory: string;
5
+ project: {
6
+ id: string;
7
+ };
8
+ };
9
+ type SessionInfo = {
10
+ projectID: string;
11
+ location: {
12
+ directory: string;
13
+ };
14
+ };
15
+ export interface SubscriptionOwner {
16
+ readonly location: SessionLocation;
17
+ getSession(sessionID: string, signal: AbortSignal): Promise<SessionInfo>;
18
+ routeEvents(events: QueuedMonitorEvent[]): Promise<void>;
19
+ }
20
+ /** One client, timer and stream per enabled session, shared by all plugin locations. */
21
+ export declare class OpenCodeSubscriptions {
22
+ private readonly connect;
23
+ private readonly owners;
24
+ private readonly subscriptions;
25
+ private readonly lifetime;
26
+ private daemon;
27
+ private connecting;
28
+ private refreshing;
29
+ private dirty;
30
+ private lastAttemptAt;
31
+ private timer;
32
+ constructor(connect: () => Promise<DaemonClient>);
33
+ get closed(): boolean;
34
+ add(owner: SubscriptionOwner): Promise<void>;
35
+ remove(owner: SubscriptionOwner): Promise<void>;
36
+ request(method: string, params: Record<string, unknown>): Promise<unknown>;
37
+ refresh(): Promise<void>;
38
+ private refreshLoop;
39
+ private ensureDaemon;
40
+ private reconcile;
41
+ private ownerFor;
42
+ private subscribe;
43
+ private route;
44
+ private closeSubscription;
45
+ }
46
+ export {};
@@ -1 +1,2 @@
1
- export declare function callMonitorTool(name: string, arguments_: Record<string, unknown>, sessionID: string): Promise<string>;
1
+ import type { OpenCodeBridge } from "./bridge.js";
2
+ export declare function callMonitorTool(bridge: OpenCodeBridge, name: string, arguments_: Record<string, unknown>, sessionID: string): Promise<string>;
@@ -1,5 +1,6 @@
1
1
  import type { ToolContext } from "@opencode/plugin/promise/tool";
2
- declare const definition: {
2
+ import type { OpenCodeBridge } from "../bridge.js";
3
+ declare const _default: (bridge: OpenCodeBridge) => {
3
4
  name: string;
4
5
  description: string;
5
6
  input: {
@@ -38,6 +39,22 @@ declare const definition: {
38
39
  type: string;
39
40
  description: string;
40
41
  };
42
+ url: {
43
+ type: string;
44
+ description: string;
45
+ };
46
+ space: {
47
+ type: string;
48
+ description: string;
49
+ };
50
+ match: {
51
+ type: string;
52
+ description: string;
53
+ };
54
+ exclude: {
55
+ type: string;
56
+ description: string;
57
+ };
41
58
  pollIntervalSec: {
42
59
  type: string;
43
60
  description: string;
@@ -50,4 +67,4 @@ declare const definition: {
50
67
  content: string;
51
68
  }>;
52
69
  };
53
- export default definition;
70
+ export default _default;
@@ -1,5 +1,6 @@
1
1
  import type { ToolContext } from "@opencode/plugin/promise/tool";
2
- declare const definition: {
2
+ import type { OpenCodeBridge } from "../bridge.js";
3
+ declare const _default: (bridge: OpenCodeBridge) => {
3
4
  name: string;
4
5
  description: string;
5
6
  input: {
@@ -11,4 +12,4 @@ declare const definition: {
11
12
  content: string;
12
13
  }>;
13
14
  };
14
- export default definition;
15
+ export default _default;
@@ -1,5 +1,6 @@
1
1
  import type { ToolContext } from "@opencode/plugin/promise/tool";
2
- declare const definition: {
2
+ import type { OpenCodeBridge } from "../bridge.js";
3
+ declare const _default: (bridge: OpenCodeBridge) => {
3
4
  name: string;
4
5
  description: string;
5
6
  input: {
@@ -17,4 +18,4 @@ declare const definition: {
17
18
  content: string;
18
19
  }>;
19
20
  };
20
- export default definition;
21
+ export default _default;
@@ -1,5 +1,6 @@
1
1
  import type { ToolContext } from "@opencode/plugin/promise/tool";
2
- declare const definition: {
2
+ import type { OpenCodeBridge } from "../bridge.js";
3
+ declare const _default: (bridge: OpenCodeBridge) => {
3
4
  name: string;
4
5
  description: string;
5
6
  input: {
@@ -17,4 +18,4 @@ declare const definition: {
17
18
  content: string;
18
19
  }>;
19
20
  };
20
- export default definition;
21
+ export default _default;
@@ -1,5 +1,6 @@
1
1
  import type { ToolContext } from "@opencode/plugin/promise/tool";
2
- declare const definition: {
2
+ import type { OpenCodeBridge } from "../bridge.js";
3
+ declare const _default: (bridge: OpenCodeBridge) => {
3
4
  name: string;
4
5
  description: string;
5
6
  input: {
@@ -17,4 +18,4 @@ declare const definition: {
17
18
  content: string;
18
19
  }>;
19
20
  };
20
- export default definition;
21
+ export default _default;
@@ -1,12 +1,11 @@
1
1
  import type { Theme } from "@earendil-works/pi-coding-agent";
2
2
  import type { Component, TUI } from "@earendil-works/pi-tui";
3
- import type { LogEntryView, MonitorView } from "@fdcn/sourcefed/daemon";
3
+ import type { LogEntryView } from "@fdcn/sourcefed/daemon";
4
4
  type Line = {
5
5
  text: string;
6
6
  };
7
7
  export declare function showSourcefedDialog(_tui: TUI, theme: Theme, done: (result: null) => void, title: string, lines: Line[]): Component & {
8
8
  handleInput(data: string): void;
9
9
  };
10
- export declare function monitorLines(monitors: MonitorView[], theme: Theme): Line[];
11
10
  export declare function logLines(logs: LogEntryView[], theme: Theme): Line[];
12
11
  export {};
@@ -0,0 +1,32 @@
1
+ import type { Theme } from "@earendil-works/pi-coding-agent";
2
+ import type { Component, KeybindingsManager } from "@earendil-works/pi-tui";
3
+ import type { MonitorView } from "@fdcn/sourcefed/daemon";
4
+ export type MonitorAction = "stop" | "start" | "remove";
5
+ /** Runs one action on a monitor and answers the target's monitors afterwards. */
6
+ export type RunMonitorAction = (action: MonitorAction, id: string) => Promise<MonitorView[]>;
7
+ export type MonitorManagerDeps = {
8
+ theme: Pick<Theme, "fg" | "bold">;
9
+ keys: Pick<KeybindingsManager, "matches">;
10
+ run: RunMonitorAction;
11
+ requestRender: () => void;
12
+ close: () => void;
13
+ };
14
+ export declare class MonitorManager implements Component {
15
+ private readonly deps;
16
+ private monitors;
17
+ private selected;
18
+ private mode;
19
+ private error;
20
+ constructor(monitors: MonitorView[], deps: MonitorManagerDeps);
21
+ handleInput(data: string): void;
22
+ render(width: number): string[];
23
+ invalidate(): void;
24
+ private handleBrowse;
25
+ private handleConfirm;
26
+ private perform;
27
+ private select;
28
+ private setMode;
29
+ private matches;
30
+ private listLines;
31
+ private statusLines;
32
+ }
@@ -5,4 +5,8 @@ export type MonitorCreateInput = {
5
5
  channelId?: string;
6
6
  threadTs?: string;
7
7
  threadUrl?: string;
8
+ url?: string;
9
+ space?: string;
10
+ match?: string;
11
+ exclude?: string;
8
12
  };
@@ -0,0 +1,26 @@
1
+ import type { QueuedMonitorEvent } from "@fdcn/sourcefed/core";
2
+ /** Owns one SSE connection, its setup, serialized delivery and reconnect loop. */
3
+ export declare class DaemonEventStream {
4
+ private readonly url;
5
+ private readonly headers;
6
+ private readonly onEvents;
7
+ private readonly acknowledge;
8
+ private readonly onClose;
9
+ private readonly controller;
10
+ private readonly subscribed;
11
+ private stream;
12
+ private delivering;
13
+ private closing;
14
+ private ready;
15
+ private failedDelivery;
16
+ constructor(url: string, headers: Record<string, string>, onEvents: (events: QueuedMonitorEvent[]) => Promise<void>, acknowledge: (events: QueuedMonitorEvent[], signal: AbortSignal) => Promise<void>, onClose: () => void);
17
+ start(signal?: AbortSignal): Promise<void>;
18
+ close(): Promise<void>;
19
+ private drain;
20
+ private run;
21
+ private read;
22
+ private frame;
23
+ private deliver;
24
+ private waitForDelivery;
25
+ }
26
+ export declare function pause(ms: number, signal: AbortSignal): Promise<void>;
@@ -2,10 +2,12 @@ import type { Monitor, MonitorCreateInput, MonitorSource, SourceInput } from "@f
2
2
  import { GithubMonitor } from "@fdcn/sourcefed/provider-github";
3
3
  import { JiraMonitor } from "@fdcn/sourcefed/provider-jira";
4
4
  import { SlackMonitor } from "@fdcn/sourcefed/provider-slack";
5
+ import { YabMonitor } from "@fdcn/sourcefed/provider-yab";
5
6
  export declare const SOURCE_MAP: {
6
7
  jira: JiraMonitor;
7
8
  github: GithubMonitor;
8
9
  slack: SlackMonitor;
10
+ yab: YabMonitor;
9
11
  };
10
12
  export declare const SOURCE_TYPES: [string, ...string[]];
11
13
  export declare function sourceDefinition(source: MonitorSource): Monitor<any>;
@@ -10,7 +10,9 @@ export type DaemonClientOptions = {
10
10
  };
11
11
  export interface DaemonClient {
12
12
  request(method: string, params?: Record<string, unknown>): Promise<unknown>;
13
- subscribe(target: MonitorTarget, onEvents: (events: QueuedMonitorEvent[]) => Promise<void>): Promise<{
13
+ subscribe(target: MonitorTarget, onEvents: (events: QueuedMonitorEvent[]) => Promise<void>, options?: {
14
+ signal?: AbortSignal;
15
+ }): Promise<{
14
16
  close(): Promise<void>;
15
17
  }>;
16
18
  close(): Promise<void>;
@@ -8,6 +8,10 @@ export type DaemonCreateInput = {
8
8
  channelId?: string;
9
9
  threadTs?: string;
10
10
  threadUrl?: string;
11
+ url?: string;
12
+ space?: string;
13
+ match?: string;
14
+ exclude?: string;
11
15
  pollIntervalSec?: number;
12
16
  };
13
17
  export type SourcefedDaemonOptions = {
@@ -1,6 +1,5 @@
1
1
  export { daemonEnvironment } from "./env.js";
2
2
  export { serveHttp, type HttpServer, type HttpServerOptions } from "./http-server.js";
3
- export { RequestRouter } from "./request-router.js";
4
3
  export { DEFAULT_DAEMON_URL, daemonCommand, defaultDaemonUrl, sleep, spawnLocalDaemon, withTimeout } from "./spawn.js";
5
4
  export { NotifyingEventSink } from "./sink.js";
6
5
  export { decodeTarget, encodeTarget, targetKey } from "./target.js";
@@ -0,0 +1,2 @@
1
+ export { YabMonitor } from "./monitor.js";
2
+ export type { YabSourceRecord, YabEvent, YabCursor, FeedEntry } from "./types";
@@ -0,0 +1,14 @@
1
+ import { Monitor } from "@fdcn/sourcefed/core";
2
+ import type { MonitorCreateInput } from "@fdcn/sourcefed/core";
3
+ import type { YabSourceRecord } from "./types";
4
+ import type { SourceInput } from "@fdcn/sourcefed/core";
5
+ export declare class YabMonitor extends Monitor<YabSourceRecord> {
6
+ readonly poll: import("@fdcn/sourcefed/core").PollMonitor<YabSourceRecord>;
7
+ constructor();
8
+ readonly key: (source: YabSourceRecord) => string;
9
+ readonly icon = "\uDB81\uDD9F";
10
+ readonly label: (source: YabSourceRecord) => string;
11
+ readonly detail: (source: YabSourceRecord) => string;
12
+ readonly describe: (source: YabSourceRecord) => string;
13
+ build(input: MonitorCreateInput): SourceInput;
14
+ }
@@ -0,0 +1,2 @@
1
+ export { yabPollMonitor } from "./monitor.js";
2
+ export * from "./utils";
@@ -0,0 +1,3 @@
1
+ import { PollMonitor } from "@fdcn/sourcefed/core";
2
+ import type { YabSourceRecord } from "../types";
3
+ export declare const yabPollMonitor: PollMonitor<YabSourceRecord>;
@@ -0,0 +1,5 @@
1
+ import type { FeedEntry, YabCursor, YabEvent, YabSourceRecord } from "../../types";
2
+ export declare function feedEvents(source: YabSourceRecord, entries: FeedEntry[], cursorRaw: unknown): {
3
+ events: YabEvent[];
4
+ cursor: YabCursor;
5
+ };
@@ -0,0 +1,4 @@
1
+ export { feedEvents } from "./feed-events.js";
2
+ export { parseFeed } from "./parse-feed.js";
3
+ export { pollYab, type YabFetcher } from "./poll-yab.js";
4
+ export { callYabTool, fetchThroughYab, parseYabFetch } from "./yab-mcp.js";
@@ -0,0 +1,3 @@
1
+ import type { FeedEntry } from "../../types";
2
+ /** Entries of an Atom, RSS or JSON feed, in the order the feed lists them. */
3
+ export declare function parseFeed(body: string, type?: string): FeedEntry[];
@@ -0,0 +1,7 @@
1
+ import type { YabCursor, YabEvent, YabPage, YabSourceRecord } from "../../types";
2
+ export type YabFetcher = (url: string, space?: string) => Promise<YabPage>;
3
+ export declare function pollYab(source: YabSourceRecord, cursorRaw: unknown, fetchPage?: YabFetcher): Promise<{
4
+ events: YabEvent[];
5
+ cursor: YabCursor;
6
+ terminal: false;
7
+ }>;
@@ -0,0 +1,10 @@
1
+ import type { YabPage } from "../../types";
2
+ /** Read a URL through Yab, with the cookies of the given space (or wherever the site is signed in). */
3
+ export declare function fetchThroughYab(url: string, space?: string): Promise<YabPage>;
4
+ /** Yab's fetch answers `STATUS · TYPE · URL`, a blank line, then the body. */
5
+ export declare function parseYabFetch(text: string): YabPage;
6
+ /**
7
+ * Call one tool on Yab's MCP server over stdio: `yab mcp` is started for the call and
8
+ * stopped after it, so nothing stays connected between polls.
9
+ */
10
+ export declare function callYabTool(name: string, args: Record<string, unknown>): Promise<string>;
@@ -0,0 +1,12 @@
1
+ import * as v from "valibot";
2
+ export declare const YabSourceSchema: v.ObjectSchema<{
3
+ readonly type: v.LiteralSchema<"yab", undefined>;
4
+ readonly url: v.StringSchema<undefined>;
5
+ readonly space: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
6
+ readonly match: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
7
+ readonly exclude: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
8
+ }, undefined>;
9
+ export declare const YabCursorSchema: v.ObjectSchema<{
10
+ readonly primed: v.BooleanSchema<undefined>;
11
+ readonly seenIds: v.ArraySchema<v.StringSchema<undefined>, undefined>;
12
+ }, undefined>;
@@ -0,0 +1,4 @@
1
+ export interface YabCursor {
2
+ primed: boolean;
3
+ seenIds: string[];
4
+ }
@@ -0,0 +1,8 @@
1
+ export interface YabEvent {
2
+ kind: "entry";
3
+ id: string;
4
+ at: string;
5
+ summary: string;
6
+ body?: string;
7
+ actionable: boolean;
8
+ }
@@ -0,0 +1,8 @@
1
+ export interface FeedEntry {
2
+ id: string;
3
+ title: string;
4
+ summary?: string;
5
+ author?: string;
6
+ link?: string;
7
+ at?: string;
8
+ }
@@ -0,0 +1,5 @@
1
+ export type { YabCursor } from "./cursor.js";
2
+ export type { YabEvent } from "./event.js";
3
+ export type { FeedEntry } from "./feed-entry.js";
4
+ export type { YabPage } from "./page.js";
5
+ export type { YabSourceRecord } from "./source-record.js";
@@ -0,0 +1,6 @@
1
+ export interface YabPage {
2
+ status: number;
3
+ type: string;
4
+ url: string;
5
+ body: string;
6
+ }
@@ -0,0 +1,7 @@
1
+ export type YabSourceRecord = {
2
+ type: "yab";
3
+ url: string;
4
+ space?: string;
5
+ match?: string;
6
+ exclude?: string;
7
+ };
@@ -0,0 +1 @@
1
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fdcn/sourcefed",
3
- "version": "0.3.6",
3
+ "version": "0.3.8",
4
4
  "description": "Live Jira, GitHub, and Slack monitoring for agent hosts: CLI, daemon, MCP server, and host plugins.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -1,32 +0,0 @@
1
- import type { MonitorEvent, MonitorEventSink, MonitorRecord } from "@fdcn/sourcefed/core";
2
- export type ForwardOptions = {
3
- url: string;
4
- token?: string;
5
- fetch?: typeof fetch;
6
- };
7
- /** The JSON body POSTed for each delivered event. */
8
- export type ForwardedEvent = {
9
- target: MonitorRecord["target"];
10
- monitorID: string;
11
- source: MonitorRecord["source"];
12
- event: MonitorEvent;
13
- };
14
- /** `SOURCEFED_FORWARD_URL` (and optional `SOURCEFED_FORWARD_TOKEN`), when set. */
15
- export declare function forwardFromEnv(): ForwardOptions | undefined;
16
- /**
17
- * Delivers to `inner`, then POSTs a copy of each delivered event to another
18
- * local consumer. Forwarding never blocks or fails delivery.
19
- */
20
- export declare class ForwardingEventSink implements MonitorEventSink {
21
- private readonly inner;
22
- private readonly options;
23
- constructor(inner: MonitorEventSink, options: ForwardOptions);
24
- deliver(input: {
25
- monitor: MonitorRecord;
26
- event: MonitorEvent;
27
- }): Promise<{
28
- ok: boolean;
29
- error?: string;
30
- }>;
31
- private forward;
32
- }
@@ -1,33 +0,0 @@
1
- import type { MonitorEvent, MonitorEventSink, MonitorRecord } from "@fdcn/sourcefed/core";
2
- export type GateOptions = {
3
- url: string;
4
- token?: string;
5
- fetch?: typeof fetch;
6
- };
7
- /** The JSON body POSTed for each event; the gate replies `{ "deliver": boolean }`. */
8
- export type GatedEvent = {
9
- target: MonitorRecord["target"];
10
- monitorID: string;
11
- source: MonitorRecord["source"];
12
- event: MonitorEvent;
13
- };
14
- /** `SOURCEFED_GATE_URL` (and optional `SOURCEFED_GATE_TOKEN`), when set. */
15
- export declare function gateFromEnv(): GateOptions | undefined;
16
- /**
17
- * Asks another local consumer whether each event should reach the session.
18
- * Only an explicit `{ "deliver": false }` withholds it; a failed, slow, or
19
- * unclear answer delivers, so the gate can never lose an event.
20
- */
21
- export declare class GatedEventSink implements MonitorEventSink {
22
- private readonly inner;
23
- private readonly options;
24
- constructor(inner: MonitorEventSink, options: GateOptions);
25
- deliver(input: {
26
- monitor: MonitorRecord;
27
- event: MonitorEvent;
28
- }): Promise<{
29
- ok: boolean;
30
- error?: string;
31
- }>;
32
- private withheld;
33
- }
@@ -1,11 +0,0 @@
1
- export declare class RequestRouter {
2
- private readonly pending;
3
- private cursor;
4
- nextID(): number;
5
- register(id: number): Promise<unknown>;
6
- settle(id: number, frame: {
7
- result?: unknown;
8
- error?: string;
9
- }): void;
10
- rejectAll(error: Error): void;
11
- }