stonecut 1.1.1 → 1.2.1

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.
@@ -0,0 +1,47 @@
1
+ /**
2
+ * Source provider interface — abstraction for importing PRDs and issues
3
+ * from external systems (GitHub, and future: Jira, Linear).
4
+ *
5
+ * Providers are stateless on reads. Write operations (onIssueComplete,
6
+ * onPrdComplete) are the only side effects.
7
+ */
8
+
9
+ /** Data returned by fetchPrd(). */
10
+ export interface PrdData {
11
+ title: string;
12
+ body: string;
13
+ issueNumber: number;
14
+ }
15
+
16
+ /** A single issue from an external source. */
17
+ export interface IssueData {
18
+ title: string;
19
+ body: string;
20
+ number: number;
21
+ /** Upstream state (e.g. "OPEN", "CLOSED"). Absent for local-only sources. */
22
+ state?: string;
23
+ }
24
+
25
+ /** Summary of a PRD from an external source, used for listing/selection. */
26
+ export interface PrdSummary {
27
+ number: number;
28
+ title: string;
29
+ }
30
+
31
+ /** Protocol that all source providers must satisfy. */
32
+ export interface SourceProvider {
33
+ /** Fetch a PRD by identifier (e.g. issue number). Validates it is a PRD. */
34
+ fetchPrd(identifier: string): Promise<PrdData>;
35
+
36
+ /** Fetch sub-issues for a PRD, ordered by number. */
37
+ fetchIssues(identifier: string): Promise<IssueData[]>;
38
+
39
+ /** List available PRDs from the source (e.g. issues with `prd` label). */
40
+ listPrds(): Promise<PrdSummary[]>;
41
+
42
+ /** Sync completion of a single issue back to the source (e.g. close GitHub issue). */
43
+ onIssueComplete(issueId: string): Promise<void>;
44
+
45
+ /** Sync completion of the parent PRD back to the source (e.g. close parent issue). */
46
+ onPrdComplete(prdId: string): Promise<void>;
47
+ }
package/src/types.ts CHANGED
@@ -47,21 +47,7 @@ export interface Issue {
47
47
  content: string;
48
48
  }
49
49
 
50
- /** Structured metadata for a GitHub-backed PRD issue. */
51
- export interface GitHubPrd {
52
- number: number;
53
- title: string;
54
- body: string;
55
- }
56
-
57
- /** A single sub-issue from a GitHub PRD. */
58
- export interface GitHubIssue {
59
- number: number;
60
- title: string;
61
- body: string;
62
- }
63
-
64
- /** Source interface for reading issues from any backend (local or GitHub). */
50
+ /** Source interface for reading issues from the local backend. */
65
51
  export interface Source<T> {
66
52
  getNextIssue(): Promise<T | null>;
67
53
  completeIssue(issue: T): Promise<void>;