@fdcn/sourcefed 0.3.7 → 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 (37) hide show
  1. package/README.md +1 -1
  2. package/dist/{chunk-E6J3BAXP.js → chunk-5JL3UV72.js} +990 -99
  3. package/dist/cli.js +8716 -6926
  4. package/dist/daemon.js +994 -101
  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 +6 -2
  11. package/dist/pi.js +161 -39
  12. package/dist/tui-compiled.mjs +306 -166
  13. package/dist.dts/adapters/opencode/tools/monitor_create.d.ts +16 -0
  14. package/dist.dts/adapters/pi/src/dialog.d.ts +1 -2
  15. package/dist.dts/adapters/pi/src/monitors-dialog.d.ts +32 -0
  16. package/dist.dts/adapters/pi/src/monitors-dialog.test.d.ts +1 -0
  17. package/dist.dts/packages/core/src/types/monitor-create-input.d.ts +4 -0
  18. package/dist.dts/packages/daemon/src/registry.d.ts +2 -0
  19. package/dist.dts/packages/daemon/src/types/daemon.d.ts +4 -0
  20. package/dist.dts/providers/yab/src/index.d.ts +2 -0
  21. package/dist.dts/providers/yab/src/monitor.d.ts +14 -0
  22. package/dist.dts/providers/yab/src/poll/index.d.ts +2 -0
  23. package/dist.dts/providers/yab/src/poll/monitor.d.ts +3 -0
  24. package/dist.dts/providers/yab/src/poll/utils/feed-events.d.ts +5 -0
  25. package/dist.dts/providers/yab/src/poll/utils/index.d.ts +4 -0
  26. package/dist.dts/providers/yab/src/poll/utils/parse-feed.d.ts +3 -0
  27. package/dist.dts/providers/yab/src/poll/utils/poll-yab.d.ts +7 -0
  28. package/dist.dts/providers/yab/src/poll/utils/yab-mcp.d.ts +10 -0
  29. package/dist.dts/providers/yab/src/schema.d.ts +12 -0
  30. package/dist.dts/providers/yab/src/types/cursor.d.ts +4 -0
  31. package/dist.dts/providers/yab/src/types/event.d.ts +8 -0
  32. package/dist.dts/providers/yab/src/types/feed-entry.d.ts +8 -0
  33. package/dist.dts/providers/yab/src/types/index.d.ts +5 -0
  34. package/dist.dts/providers/yab/src/types/page.d.ts +6 -0
  35. package/dist.dts/providers/yab/src/types/source-record.d.ts +7 -0
  36. package/dist.dts/providers/yab/src/yab.test.d.ts +1 -0
  37. package/package.json +1 -1
@@ -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
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -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
  };
@@ -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>;
@@ -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 = {
@@ -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.7",
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",