@captainsafia/stitch 0.0.1 → 1.0.0-preview.c77f34b

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/dist/api.d.ts ADDED
@@ -0,0 +1,170 @@
1
+ // Generated by dts-bundle-generator v9.5.1
2
+
3
+ /**
4
+ * Core type definitions for stitch documents
5
+ */
6
+ export type StitchId = string;
7
+ export type StitchStatus = "open" | "closed" | "superseded" | "abandoned";
8
+ export type Provenance = "human" | "agent" | "mixed" | "retroactive";
9
+ export type Confidence = "low" | "medium" | "high";
10
+ export type GitLinkCommit = {
11
+ kind: "commit";
12
+ sha: string;
13
+ };
14
+ export type GitLinkRange = {
15
+ kind: "range";
16
+ range: string;
17
+ };
18
+ export type GitLink = GitLinkCommit | GitLinkRange;
19
+ export type DiffFingerprint = {
20
+ algo: "sha256";
21
+ kind: "staged-diff" | "unified-diff";
22
+ value: string;
23
+ };
24
+ export type StitchScope = {
25
+ paths?: string[];
26
+ };
27
+ export type StitchRelations = {
28
+ parent?: StitchId;
29
+ depends_on?: StitchId[];
30
+ };
31
+ export type StitchGit = {
32
+ links?: GitLink[];
33
+ fingerprints?: DiffFingerprint[];
34
+ };
35
+ export type StitchFrontmatter = {
36
+ id: StitchId;
37
+ title: string;
38
+ status: StitchStatus;
39
+ created_at: string;
40
+ updated_at: string;
41
+ provenance?: Provenance;
42
+ confidence?: Confidence;
43
+ tags?: string[];
44
+ scope?: StitchScope;
45
+ relations?: StitchRelations;
46
+ git?: StitchGit;
47
+ };
48
+ export type StitchDoc = {
49
+ frontmatter: StitchFrontmatter;
50
+ body: string;
51
+ filePath: string;
52
+ };
53
+ export type BlameLine = {
54
+ line: number;
55
+ sha: string;
56
+ stitchIds: StitchId[];
57
+ text: string;
58
+ };
59
+ export type ClientOptions = {
60
+ repoRoot?: string;
61
+ };
62
+ export type StatusResult = {
63
+ current?: StitchId;
64
+ lineage: StitchId[];
65
+ };
66
+ export type ListFilter = {
67
+ status?: StitchStatus;
68
+ };
69
+ export declare class StitchError extends Error {
70
+ constructor(message: string);
71
+ }
72
+ export declare class RepoNotFoundError extends StitchError {
73
+ constructor(path?: string);
74
+ }
75
+ export declare class NotInitializedError extends StitchError {
76
+ constructor();
77
+ }
78
+ export declare class NoCurrentStitchError extends StitchError {
79
+ constructor();
80
+ }
81
+ export declare class StitchNotFoundError extends StitchError {
82
+ constructor(id: string);
83
+ }
84
+ export declare class GitError extends StitchError {
85
+ readonly command: string;
86
+ readonly exitCode: number;
87
+ constructor(message: string, command: string, exitCode: number);
88
+ }
89
+ export declare class ValidationError extends StitchError {
90
+ constructor(message: string);
91
+ }
92
+ /**
93
+ * StitchClient is the main public API for interacting with stitch.
94
+ * CLI commands should use this class to perform all operations.
95
+ */
96
+ export declare class StitchClient {
97
+ private repoRoot;
98
+ private repoRootOverride;
99
+ constructor(options?: ClientOptions);
100
+ /**
101
+ * Get the repository root, resolving it if needed
102
+ */
103
+ private getRepoRoot;
104
+ /**
105
+ * Initialize stitch in the current repository
106
+ */
107
+ init(): Promise<void>;
108
+ /**
109
+ * Check if stitch is initialized
110
+ */
111
+ isInitialized(): Promise<boolean>;
112
+ /**
113
+ * Start a new stitch session
114
+ */
115
+ start(title: string): Promise<StitchDoc>;
116
+ /**
117
+ * Create a child stitch under the current stitch
118
+ */
119
+ child(title: string): Promise<StitchDoc>;
120
+ /**
121
+ * Switch to a different stitch
122
+ */
123
+ switch(id: StitchId): Promise<void>;
124
+ /**
125
+ * Get the current stitch status and lineage
126
+ */
127
+ status(): Promise<StatusResult>;
128
+ /**
129
+ * List all stitches
130
+ */
131
+ list(filter?: ListFilter): Promise<StitchDoc[]>;
132
+ /**
133
+ * Get a stitch by ID
134
+ */
135
+ get(id: StitchId): Promise<StitchDoc>;
136
+ /**
137
+ * Get the current stitch ID, throwing if none is set
138
+ */
139
+ requireCurrentId(): Promise<StitchId>;
140
+ /**
141
+ * Open a stitch in the user's editor
142
+ */
143
+ openInEditor(id?: StitchId): Promise<void>;
144
+ /**
145
+ * Link a commit to a stitch
146
+ */
147
+ linkCommit(sha: string, id?: StitchId): Promise<void>;
148
+ /**
149
+ * Link a commit range to a stitch
150
+ */
151
+ linkRange(range: string, id?: StitchId): Promise<void>;
152
+ /**
153
+ * Link staged diff fingerprint to a stitch
154
+ */
155
+ linkStagedDiff(id?: StitchId): Promise<DiffFingerprint>;
156
+ /**
157
+ * Get stitch blame for a file
158
+ */
159
+ blame(path: string): Promise<BlameLine[]>;
160
+ /**
161
+ * Dispose of the client (for using with `using` keyword)
162
+ */
163
+ [Symbol.dispose](): void;
164
+ /**
165
+ * Close the client and release resources
166
+ */
167
+ close(): void;
168
+ }
169
+
170
+ export {};