@ashdev/codex-plugin-sdk 1.19.3 → 1.21.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.
@@ -16,6 +16,25 @@
16
16
  export declare const RELEASES_METHODS: {
17
17
  /** List tracked series, scoped to what the plugin's manifest declared. */
18
18
  readonly LIST_TRACKED: "releases/list_tracked";
19
+ /**
20
+ * Count tracked series scoped to the plugin's `requiresExternalIds`.
21
+ *
22
+ * Plugins call this once at the start of a poll to learn the total
23
+ * denominator before iterating, so subsequent `REPORT_PROGRESS` calls
24
+ * carry a stable `current/total` ratio. Cheap (one batched DB lookup);
25
+ * safe to call from `poll`.
26
+ */
27
+ readonly COUNT_TRACKED: "releases/count_tracked";
28
+ /**
29
+ * Report intra-poll progress to the host. The host translates this into
30
+ * a `TaskProgressEvent` on the active task's broadcaster; the inbox
31
+ * progress bar updates live. Best-effort — calls outside an active
32
+ * task scope are silently dropped, and rapid back-to-back calls are
33
+ * rate-limited (~10/sec) by the host. Plugins SHOULD call this after
34
+ * each unit of work (e.g. after each polled series) with `current` set
35
+ * to the count of completed units and `total` from `COUNT_TRACKED`.
36
+ */
37
+ readonly REPORT_PROGRESS: "releases/report_progress";
19
38
  /** Submit a candidate to the host's release ledger. */
20
39
  readonly RECORD: "releases/record";
21
40
  /** Get persisted per-source state (etag, last_polled_at, last_error). */
@@ -50,16 +69,28 @@ export interface SeriesMatch {
50
69
  confidence: number;
51
70
  reason: string;
52
71
  }
72
+ /**
73
+ * Inclusive numeric span. Single values are encoded as `start === end`
74
+ * (`{ start: 5, end: 5 }`). Used on the volume and chapter axes of a
75
+ * release candidate to express compilation/bundle coverage honestly,
76
+ * including disjoint coverage (`v01-04 + v06-09` → two spans).
77
+ */
78
+ export interface NumericSpan {
79
+ start: number;
80
+ end: number;
81
+ }
53
82
  /**
54
83
  * Release candidate emitted by a plugin.
55
84
  *
56
85
  * **Field semantics:**
57
86
  * - `externalReleaseId`: Stable per-source ID. The first dedup key.
58
87
  * `(sourceId, externalReleaseId)` is `UNIQUE` in `release_ledger`.
59
- * - `chapter` / `volume`: At least one should be set; both is fine for a
60
- * "vol 15 covers ch 126-142" case (the volume axis advances; the chapter
61
- * axis advances to the volume's last chapter only if the candidate
62
- * carries it). Decimals supported on `chapter` (e.g. 47.5).
88
+ * - `volumes` / `chapters`: At least one should be non-null. Each is a
89
+ * normalized [`NumericSpan`] list (sorted ascending, overlapping spans
90
+ * merged) describing every volume / chapter the release covers. Single
91
+ * values are one-element lists with `start === end`; ranges are
92
+ * one-element lists with `end > start`; disjoint coverage produces
93
+ * multiple spans. Decimals supported on chapter spans.
63
94
  * - `language`: ISO 639-1 code, lowercase. Must be non-empty. The host's
64
95
  * `latest_known_*` advance gate uses this against the per-series
65
96
  * effective language list.
@@ -82,8 +113,10 @@ export interface SeriesMatch {
82
113
  export interface ReleaseCandidate {
83
114
  seriesMatch: SeriesMatch;
84
115
  externalReleaseId: string;
85
- chapter?: number | null;
86
- volume?: number | null;
116
+ /** Volume coverage. Integer span list. `null` when no volume info. */
117
+ volumes?: NumericSpan[] | null;
118
+ /** Chapter coverage. Decimal-capable span list. `null` when no chapter info. */
119
+ chapters?: NumericSpan[] | null;
87
120
  language: string;
88
121
  formatHints?: Record<string, unknown> | null;
89
122
  groupOrUploader?: string | null;
@@ -1 +1 @@
1
- {"version":3,"file":"releases.d.ts","sourceRoot":"","sources":["../../src/types/releases.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAMH;;;GAGG;AACH,eAAO,MAAM,gBAAgB;IAC3B,0EAA0E;;IAE1E,uDAAuD;;IAEvD,yEAAyE;;IAEzE,gFAAgF;;IAEhF;;;;;;;;;;OAUG;;CAEK,CAAC;AAMX;;;;;;;;;GASG;AACH,MAAM,WAAW,WAAW;IAC1B,aAAa,EAAE,MAAM,CAAC;IACtB,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;CAChB;AAED;;;;;;;;;;;;;;;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S,CAAC,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC;IACxC,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED;;;;;;;;;;;;GAYG;AACH,MAAM,WAAW,mBAAmB;IAClC,wEAAwE;IACxE,UAAU,CAAC,EAAE,gBAAgB,EAAE,CAAC;IAChC,wEAAwE;IACxE,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,wEAAwE;IACxE,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,mEAAmE;IACnE,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB;;;;;OAKG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB"}
@@ -19,6 +19,25 @@
19
19
  export const RELEASES_METHODS = {
20
20
  /** List tracked series, scoped to what the plugin's manifest declared. */
21
21
  LIST_TRACKED: "releases/list_tracked",
22
+ /**
23
+ * Count tracked series scoped to the plugin's `requiresExternalIds`.
24
+ *
25
+ * Plugins call this once at the start of a poll to learn the total
26
+ * denominator before iterating, so subsequent `REPORT_PROGRESS` calls
27
+ * carry a stable `current/total` ratio. Cheap (one batched DB lookup);
28
+ * safe to call from `poll`.
29
+ */
30
+ COUNT_TRACKED: "releases/count_tracked",
31
+ /**
32
+ * Report intra-poll progress to the host. The host translates this into
33
+ * a `TaskProgressEvent` on the active task's broadcaster; the inbox
34
+ * progress bar updates live. Best-effort — calls outside an active
35
+ * task scope are silently dropped, and rapid back-to-back calls are
36
+ * rate-limited (~10/sec) by the host. Plugins SHOULD call this after
37
+ * each unit of work (e.g. after each polled series) with `current` set
38
+ * to the count of completed units and `total` from `COUNT_TRACKED`.
39
+ */
40
+ REPORT_PROGRESS: "releases/report_progress",
22
41
  /** Submit a candidate to the host's release ledger. */
23
42
  RECORD: "releases/record",
24
43
  /** Get persisted per-source state (etag, last_polled_at, last_error). */
@@ -1 +1 @@
1
- {"version":3,"file":"releases.js","sourceRoot":"","sources":["../../src/types/releases.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,gFAAgF;AAChF,4CAA4C;AAC5C,gFAAgF;AAEhF;;;GAGG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC9B,0EAA0E;IAC1E,YAAY,EAAE,uBAAuB;IACrC,uDAAuD;IACvD,MAAM,EAAE,iBAAiB;IACzB,yEAAyE;IACzE,gBAAgB,EAAE,2BAA2B;IAC7C,gFAAgF;IAChF,gBAAgB,EAAE,2BAA2B;IAC7C;;;;;;;;;;OAUG;IACH,gBAAgB,EAAE,2BAA2B;CACrC,CAAC"}
1
+ {"version":3,"file":"releases.js","sourceRoot":"","sources":["../../src/types/releases.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,gFAAgF;AAChF,4CAA4C;AAC5C,gFAAgF;AAEhF;;;GAGG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC9B,0EAA0E;IAC1E,YAAY,EAAE,uBAAuB;IACrC;;;;;;;OAOG;IACH,aAAa,EAAE,wBAAwB;IACvC;;;;;;;;OAQG;IACH,eAAe,EAAE,0BAA0B;IAC3C,uDAAuD;IACvD,MAAM,EAAE,iBAAiB;IACzB,yEAAyE;IACzE,gBAAgB,EAAE,2BAA2B;IAC7C,gFAAgF;IAChF,gBAAgB,EAAE,2BAA2B;IAC7C;;;;;;;;;;OAUG;IACH,gBAAgB,EAAE,2BAA2B;CACrC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ashdev/codex-plugin-sdk",
3
- "version": "1.19.3",
3
+ "version": "1.21.0",
4
4
  "description": "SDK for building Codex plugins",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",