@fdcn/sourcefed 0.2.6 → 0.2.7

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
@@ -33,12 +33,12 @@ OpenCode loads this package as both a server and a TUI plugin:
33
33
 
34
34
  ```json
35
35
  // opencode.json
36
- { "plugin": ["@fdcn/sourcefed@0.2.6"] }
36
+ { "plugin": ["@fdcn/sourcefed@0.2.7"] }
37
37
  ```
38
38
 
39
39
  ```json
40
40
  // tui.json
41
- { "plugin": ["@fdcn/sourcefed@0.2.6"] }
41
+ { "plugin": ["@fdcn/sourcefed@0.2.7"] }
42
42
  ```
43
43
 
44
44
  The package exposes `./server`, `./tui`, `./opencode`, `./opencode/tui`, and `./pi` entrypoints for hosts that load them directly.
@@ -9993,7 +9993,7 @@ var JiraSourceSchema = /* @__PURE__ */ object3({
9993
9993
  var JiraCursorSchema = /* @__PURE__ */ object3({
9994
9994
  commentIds: /* @__PURE__ */ array23(/* @__PURE__ */ number3()),
9995
9995
  descriptionVersion: /* @__PURE__ */ optional3(/* @__PURE__ */ string23()),
9996
- changelogCount: /* @__PURE__ */ number3()
9996
+ changelogIds: /* @__PURE__ */ array23(/* @__PURE__ */ string23())
9997
9997
  });
9998
9998
  function jiraChangeValue(item, side) {
9999
9999
  let value = item.toString ?? item.to;
@@ -10035,14 +10035,19 @@ function jiraChangelogEvent(issueKey, history) {
10035
10035
  };
10036
10036
  }
10037
10037
  function appendJiraChangelog(issueKey, cursor, events, histories) {
10038
- const total = histories.length;
10039
- if (cursor.changelogCount !== 0 && total > cursor.changelogCount) {
10040
- for (const history of histories.slice(cursor.changelogCount)) {
10041
- const event = jiraChangelogEvent(issueKey, history);
10042
- if (event) events.push(event);
10043
- }
10038
+ const fresh = histories.filter((history) => !cursor.changelogIds.includes(historyId(history)));
10039
+ if (cursor.changelogIds.length === 0) {
10040
+ cursor.changelogIds = histories.map(historyId);
10041
+ return;
10044
10042
  }
10045
- cursor.changelogCount = total;
10043
+ for (const history of [...fresh].reverse()) {
10044
+ const event = jiraChangelogEvent(issueKey, history);
10045
+ if (event) events.push(event);
10046
+ cursor.changelogIds.push(historyId(history));
10047
+ }
10048
+ }
10049
+ function historyId(history) {
10050
+ return String(history.id ?? history.created ?? "");
10046
10051
  }
10047
10052
  function adfText(node) {
10048
10053
  if (!node || typeof node !== "object") return "";
@@ -10093,7 +10098,7 @@ function appendJiraDescription(issueKey, cursor, events, description) {
10093
10098
  cursor.descriptionVersion = descriptionVersion;
10094
10099
  }
10095
10100
  function emptyJiraCursor() {
10096
- return { commentIds: [], descriptionVersion: void 0, changelogCount: 0 };
10101
+ return { commentIds: [], descriptionVersion: void 0, changelogIds: [] };
10097
10102
  }
10098
10103
  function jiraAuth() {
10099
10104
  const email = process.env.ATLASSIAN_EMAIL;
package/dist/cli.js CHANGED
@@ -9999,7 +9999,7 @@ var JiraSourceSchema = /* @__PURE__ */ object3({
9999
9999
  var JiraCursorSchema = /* @__PURE__ */ object3({
10000
10000
  commentIds: /* @__PURE__ */ array23(/* @__PURE__ */ number3()),
10001
10001
  descriptionVersion: /* @__PURE__ */ optional3(/* @__PURE__ */ string23()),
10002
- changelogCount: /* @__PURE__ */ number3()
10002
+ changelogIds: /* @__PURE__ */ array23(/* @__PURE__ */ string23())
10003
10003
  });
10004
10004
  function jiraChangeValue(item, side) {
10005
10005
  let value = item.toString ?? item.to;
@@ -10041,14 +10041,19 @@ function jiraChangelogEvent(issueKey, history) {
10041
10041
  };
10042
10042
  }
10043
10043
  function appendJiraChangelog(issueKey, cursor, events2, histories) {
10044
- const total = histories.length;
10045
- if (cursor.changelogCount !== 0 && total > cursor.changelogCount) {
10046
- for (const history of histories.slice(cursor.changelogCount)) {
10047
- const event = jiraChangelogEvent(issueKey, history);
10048
- if (event) events2.push(event);
10049
- }
10044
+ const fresh = histories.filter((history) => !cursor.changelogIds.includes(historyId(history)));
10045
+ if (cursor.changelogIds.length === 0) {
10046
+ cursor.changelogIds = histories.map(historyId);
10047
+ return;
10050
10048
  }
10051
- cursor.changelogCount = total;
10049
+ for (const history of [...fresh].reverse()) {
10050
+ const event = jiraChangelogEvent(issueKey, history);
10051
+ if (event) events2.push(event);
10052
+ cursor.changelogIds.push(historyId(history));
10053
+ }
10054
+ }
10055
+ function historyId(history) {
10056
+ return String(history.id ?? history.created ?? "");
10052
10057
  }
10053
10058
  function adfText(node) {
10054
10059
  if (!node || typeof node !== "object") return "";
@@ -10099,7 +10104,7 @@ function appendJiraDescription(issueKey, cursor, events2, description) {
10099
10104
  cursor.descriptionVersion = descriptionVersion;
10100
10105
  }
10101
10106
  function emptyJiraCursor() {
10102
- return { commentIds: [], descriptionVersion: void 0, changelogCount: 0 };
10107
+ return { commentIds: [], descriptionVersion: void 0, changelogIds: [] };
10103
10108
  }
10104
10109
  function jiraAuth() {
10105
10110
  const email3 = process.env.ATLASSIAN_EMAIL;
@@ -42481,7 +42486,7 @@ var JiraSourceSchema2 = /* @__PURE__ */ object32({
42481
42486
  var JiraCursorSchema2 = /* @__PURE__ */ object32({
42482
42487
  commentIds: /* @__PURE__ */ array232(/* @__PURE__ */ number322()),
42483
42488
  descriptionVersion: /* @__PURE__ */ optional32(/* @__PURE__ */ string232()),
42484
- changelogCount: /* @__PURE__ */ number322()
42489
+ changelogIds: /* @__PURE__ */ array232(/* @__PURE__ */ string232())
42485
42490
  });
42486
42491
  function jiraChangeValue2(item, side) {
42487
42492
  let value = item.toString ?? item.to;
@@ -42523,14 +42528,19 @@ function jiraChangelogEvent2(issueKey, history) {
42523
42528
  };
42524
42529
  }
42525
42530
  function appendJiraChangelog2(issueKey, cursor, events2, histories) {
42526
- const total = histories.length;
42527
- if (cursor.changelogCount !== 0 && total > cursor.changelogCount) {
42528
- for (const history of histories.slice(cursor.changelogCount)) {
42529
- const event = jiraChangelogEvent2(issueKey, history);
42530
- if (event) events2.push(event);
42531
- }
42531
+ const fresh = histories.filter((history) => !cursor.changelogIds.includes(historyId2(history)));
42532
+ if (cursor.changelogIds.length === 0) {
42533
+ cursor.changelogIds = histories.map(historyId2);
42534
+ return;
42532
42535
  }
42533
- cursor.changelogCount = total;
42536
+ for (const history of [...fresh].reverse()) {
42537
+ const event = jiraChangelogEvent2(issueKey, history);
42538
+ if (event) events2.push(event);
42539
+ cursor.changelogIds.push(historyId2(history));
42540
+ }
42541
+ }
42542
+ function historyId2(history) {
42543
+ return String(history.id ?? history.created ?? "");
42534
42544
  }
42535
42545
  function adfText2(node) {
42536
42546
  if (!node || typeof node !== "object") return "";
@@ -42581,7 +42591,7 @@ function appendJiraDescription2(issueKey, cursor, events2, description) {
42581
42591
  cursor.descriptionVersion = descriptionVersion;
42582
42592
  }
42583
42593
  function emptyJiraCursor2() {
42584
- return { commentIds: [], descriptionVersion: void 0, changelogCount: 0 };
42594
+ return { commentIds: [], descriptionVersion: void 0, changelogIds: [] };
42585
42595
  }
42586
42596
  function jiraAuth2() {
42587
42597
  const email3 = process.env.ATLASSIAN_EMAIL;
package/dist/daemon.js CHANGED
@@ -9988,7 +9988,7 @@ var JiraSourceSchema = /* @__PURE__ */ object3({
9988
9988
  var JiraCursorSchema = /* @__PURE__ */ object3({
9989
9989
  commentIds: /* @__PURE__ */ array23(/* @__PURE__ */ number3()),
9990
9990
  descriptionVersion: /* @__PURE__ */ optional3(/* @__PURE__ */ string23()),
9991
- changelogCount: /* @__PURE__ */ number3()
9991
+ changelogIds: /* @__PURE__ */ array23(/* @__PURE__ */ string23())
9992
9992
  });
9993
9993
  function jiraChangeValue(item, side) {
9994
9994
  let value = item.toString ?? item.to;
@@ -10030,14 +10030,19 @@ function jiraChangelogEvent(issueKey, history) {
10030
10030
  };
10031
10031
  }
10032
10032
  function appendJiraChangelog(issueKey, cursor, events, histories) {
10033
- const total = histories.length;
10034
- if (cursor.changelogCount !== 0 && total > cursor.changelogCount) {
10035
- for (const history of histories.slice(cursor.changelogCount)) {
10036
- const event = jiraChangelogEvent(issueKey, history);
10037
- if (event) events.push(event);
10038
- }
10033
+ const fresh = histories.filter((history) => !cursor.changelogIds.includes(historyId(history)));
10034
+ if (cursor.changelogIds.length === 0) {
10035
+ cursor.changelogIds = histories.map(historyId);
10036
+ return;
10039
10037
  }
10040
- cursor.changelogCount = total;
10038
+ for (const history of [...fresh].reverse()) {
10039
+ const event = jiraChangelogEvent(issueKey, history);
10040
+ if (event) events.push(event);
10041
+ cursor.changelogIds.push(historyId(history));
10042
+ }
10043
+ }
10044
+ function historyId(history) {
10045
+ return String(history.id ?? history.created ?? "");
10041
10046
  }
10042
10047
  function adfText(node) {
10043
10048
  if (!node || typeof node !== "object") return "";
@@ -10088,7 +10093,7 @@ function appendJiraDescription(issueKey, cursor, events, description) {
10088
10093
  cursor.descriptionVersion = descriptionVersion;
10089
10094
  }
10090
10095
  function emptyJiraCursor() {
10091
- return { commentIds: [], descriptionVersion: void 0, changelogCount: 0 };
10096
+ return { commentIds: [], descriptionVersion: void 0, changelogIds: [] };
10092
10097
  }
10093
10098
  function jiraAuth() {
10094
10099
  const email = process.env.ATLASSIAN_EMAIL;
package/dist/mcp.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  decodeTarget,
3
3
  encodeTarget
4
- } from "./chunk-5NFCKXDQ.js";
4
+ } from "./chunk-DK3LZ5RU.js";
5
5
  import {
6
6
  __export
7
7
  } from "./chunk-MLKGABMK.js";
package/dist/opencode.js CHANGED
@@ -4,7 +4,7 @@ import {
4
4
  daemonCommand,
5
5
  daemonEnvironment,
6
6
  spawnLocalDaemon
7
- } from "./chunk-5NFCKXDQ.js";
7
+ } from "./chunk-DK3LZ5RU.js";
8
8
  import {
9
9
  __export
10
10
  } from "./chunk-MLKGABMK.js";
package/dist/pi.js CHANGED
@@ -3,7 +3,7 @@ import {
3
3
  daemonCommand,
4
4
  daemonEnvironment,
5
5
  spawnLocalDaemon
6
- } from "./chunk-5NFCKXDQ.js";
6
+ } from "./chunk-DK3LZ5RU.js";
7
7
  import "./chunk-MLKGABMK.js";
8
8
 
9
9
  // adapters/pi/src/index.ts
@@ -6,5 +6,5 @@ export declare const JiraSourceSchema: v.ObjectSchema<{
6
6
  export declare const JiraCursorSchema: v.ObjectSchema<{
7
7
  readonly commentIds: v.ArraySchema<v.NumberSchema<undefined>, undefined>;
8
8
  readonly descriptionVersion: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
9
- readonly changelogCount: v.NumberSchema<undefined>;
9
+ readonly changelogIds: v.ArraySchema<v.StringSchema<undefined>, undefined>;
10
10
  }, undefined>;
@@ -1,5 +1,5 @@
1
1
  export interface JiraCursor {
2
2
  commentIds: number[];
3
3
  descriptionVersion?: string;
4
- changelogCount: number;
4
+ changelogIds: string[];
5
5
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fdcn/sourcefed",
3
- "version": "0.2.6",
3
+ "version": "0.2.7",
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",