@happyvertical/smrt-projects 0.30.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.
Files changed (92) hide show
  1. package/AGENTS.md +31 -0
  2. package/CLAUDE.md +1 -0
  3. package/LICENSE +7 -0
  4. package/README.md +97 -0
  5. package/dist/__smrt-register__.d.ts +2 -0
  6. package/dist/__smrt-register__.d.ts.map +1 -0
  7. package/dist/collections/Issues.d.ts +107 -0
  8. package/dist/collections/Issues.d.ts.map +1 -0
  9. package/dist/collections/Projects.d.ts +90 -0
  10. package/dist/collections/Projects.d.ts.map +1 -0
  11. package/dist/collections/PullRequests.d.ts +107 -0
  12. package/dist/collections/PullRequests.d.ts.map +1 -0
  13. package/dist/collections/Repositories.d.ts +77 -0
  14. package/dist/collections/Repositories.d.ts.map +1 -0
  15. package/dist/constants.d.ts +9 -0
  16. package/dist/constants.d.ts.map +1 -0
  17. package/dist/index.d.ts +14 -0
  18. package/dist/index.d.ts.map +1 -0
  19. package/dist/index.js +2477 -0
  20. package/dist/index.js.map +1 -0
  21. package/dist/manifest.json +4193 -0
  22. package/dist/models/Comment.d.ts +77 -0
  23. package/dist/models/Comment.d.ts.map +1 -0
  24. package/dist/models/Issue.d.ts +200 -0
  25. package/dist/models/Issue.d.ts.map +1 -0
  26. package/dist/models/Label.d.ts +63 -0
  27. package/dist/models/Label.d.ts.map +1 -0
  28. package/dist/models/Project.d.ts +183 -0
  29. package/dist/models/Project.d.ts.map +1 -0
  30. package/dist/models/PullRequest.d.ts +114 -0
  31. package/dist/models/PullRequest.d.ts.map +1 -0
  32. package/dist/models/Repository.d.ts +141 -0
  33. package/dist/models/Repository.d.ts.map +1 -0
  34. package/dist/playground.d.ts +2 -0
  35. package/dist/playground.d.ts.map +1 -0
  36. package/dist/playground.js +129 -0
  37. package/dist/playground.js.map +1 -0
  38. package/dist/prompts.d.ts +2 -0
  39. package/dist/prompts.d.ts.map +1 -0
  40. package/dist/smrt-knowledge.json +1956 -0
  41. package/dist/svelte/components/ApprovalActions.svelte +213 -0
  42. package/dist/svelte/components/ApprovalActions.svelte.d.ts +17 -0
  43. package/dist/svelte/components/ApprovalActions.svelte.d.ts.map +1 -0
  44. package/dist/svelte/components/BulkActions.svelte +224 -0
  45. package/dist/svelte/components/BulkActions.svelte.d.ts +14 -0
  46. package/dist/svelte/components/BulkActions.svelte.d.ts.map +1 -0
  47. package/dist/svelte/components/DurationDisplay.svelte +68 -0
  48. package/dist/svelte/components/DurationDisplay.svelte.d.ts +11 -0
  49. package/dist/svelte/components/DurationDisplay.svelte.d.ts.map +1 -0
  50. package/dist/svelte/components/RejectDialog.svelte +250 -0
  51. package/dist/svelte/components/RejectDialog.svelte.d.ts +17 -0
  52. package/dist/svelte/components/RejectDialog.svelte.d.ts.map +1 -0
  53. package/dist/svelte/components/TimeEntryCard.svelte +294 -0
  54. package/dist/svelte/components/TimeEntryCard.svelte.d.ts +17 -0
  55. package/dist/svelte/components/TimeEntryCard.svelte.d.ts.map +1 -0
  56. package/dist/svelte/components/TimeEntryList.svelte +351 -0
  57. package/dist/svelte/components/TimeEntryList.svelte.d.ts +17 -0
  58. package/dist/svelte/components/TimeEntryList.svelte.d.ts.map +1 -0
  59. package/dist/svelte/components/TimeSummary.svelte +165 -0
  60. package/dist/svelte/components/TimeSummary.svelte.d.ts +19 -0
  61. package/dist/svelte/components/TimeSummary.svelte.d.ts.map +1 -0
  62. package/dist/svelte/components/__tests__/ApprovalActions.test.js +41 -0
  63. package/dist/svelte/components/__tests__/BulkActions.test.js +46 -0
  64. package/dist/svelte/components/__tests__/DurationDisplay.test.js +23 -0
  65. package/dist/svelte/components/__tests__/RejectDialog.test.js +45 -0
  66. package/dist/svelte/components/__tests__/TimeEntryCard.test.js +45 -0
  67. package/dist/svelte/components/__tests__/TimeEntryList.test.js +50 -0
  68. package/dist/svelte/components/__tests__/TimeSummary.test.js +39 -0
  69. package/dist/svelte/components/utils.d.ts +42 -0
  70. package/dist/svelte/components/utils.d.ts.map +1 -0
  71. package/dist/svelte/components/utils.js +43 -0
  72. package/dist/svelte/i18n.d.ts +18 -0
  73. package/dist/svelte/i18n.d.ts.map +1 -0
  74. package/dist/svelte/i18n.js +18 -0
  75. package/dist/svelte/index.d.ts +26 -0
  76. package/dist/svelte/index.d.ts.map +1 -0
  77. package/dist/svelte/index.js +31 -0
  78. package/dist/svelte/playground.d.ts +122 -0
  79. package/dist/svelte/playground.d.ts.map +1 -0
  80. package/dist/svelte/playground.js +114 -0
  81. package/dist/svelte/utils.d.ts +42 -0
  82. package/dist/svelte/utils.d.ts.map +1 -0
  83. package/dist/svelte/utils.js +43 -0
  84. package/dist/types.d.ts +54 -0
  85. package/dist/types.d.ts.map +1 -0
  86. package/dist/types.js +2 -0
  87. package/dist/types.js.map +1 -0
  88. package/dist/ui.d.ts +10 -0
  89. package/dist/ui.d.ts.map +1 -0
  90. package/dist/ui.js +85 -0
  91. package/dist/ui.js.map +1 -0
  92. package/package.json +100 -0
@@ -0,0 +1,77 @@
1
+ import { SmrtObject, SmrtObjectOptions } from '@happyvertical/smrt-core';
2
+ export interface CommentOptions extends SmrtObjectOptions {
3
+ issueId?: string;
4
+ commentId?: string;
5
+ body?: string;
6
+ author?: string;
7
+ createdAt?: Date;
8
+ updatedAt?: Date;
9
+ url?: string;
10
+ tenantId?: string | null;
11
+ }
12
+ export declare class Comment extends SmrtObject {
13
+ /**
14
+ * Tenant ID for multi-tenant isolation
15
+ */
16
+ tenantId: string | null;
17
+ /**
18
+ * Issue this comment belongs to
19
+ */
20
+ issueId?: string;
21
+ /**
22
+ * Provider-specific comment ID
23
+ */
24
+ commentId: string;
25
+ /**
26
+ * Comment body text
27
+ */
28
+ body: string;
29
+ /**
30
+ * Comment author's login
31
+ */
32
+ author: string;
33
+ /**
34
+ * When the comment was created
35
+ */
36
+ createdAt: Date | null;
37
+ /**
38
+ * When the comment was last updated
39
+ */
40
+ updatedAt: Date | null;
41
+ /**
42
+ * Comment URL
43
+ */
44
+ url: string;
45
+ constructor(options?: CommentOptions);
46
+ /**
47
+ * AI-powered: Check if this comment contains a question
48
+ */
49
+ isQuestion(): Promise<boolean>;
50
+ /**
51
+ * AI-powered: Check if this comment contains approval
52
+ */
53
+ isApproval(): Promise<boolean>;
54
+ /**
55
+ * AI-powered: Check if this comment requests changes
56
+ */
57
+ requestsChanges(): Promise<boolean>;
58
+ /**
59
+ * AI-powered: Extract action items from this comment
60
+ *
61
+ * @returns Array of action items
62
+ */
63
+ extractActionItems(): Promise<string[]>;
64
+ /**
65
+ * AI-powered: Summarize this comment
66
+ *
67
+ * @returns Brief summary
68
+ */
69
+ summarize(): Promise<string>;
70
+ /**
71
+ * Get the sentiment of this comment
72
+ *
73
+ * @returns Sentiment classification
74
+ */
75
+ getSentiment(): Promise<'positive' | 'negative' | 'neutral'>;
76
+ }
77
+ //# sourceMappingURL=Comment.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Comment.d.ts","sourceRoot":"","sources":["../../src/models/Comment.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EAEL,UAAU,EACV,KAAK,iBAAiB,EAEvB,MAAM,0BAA0B,CAAC;AAKlC,MAAM,WAAW,cAAe,SAAQ,iBAAiB;IACvD,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,IAAI,CAAC;IACjB,SAAS,CAAC,EAAE,IAAI,CAAC;IACjB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC1B;AAED,qBAMa,OAAQ,SAAQ,UAAU;IACrC;;OAEG;IAEH,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAQ;IAE/B;;OAEG;IAEH,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB;;OAEG;IACH,SAAS,EAAE,MAAM,CAAM;IAEvB;;OAEG;IACH,IAAI,EAAE,MAAM,CAAM;IAElB;;OAEG;IACH,MAAM,EAAE,MAAM,CAAM;IAEpB;;OAEG;IACH,SAAS,EAAE,IAAI,GAAG,IAAI,CAAQ;IAE9B;;OAEG;IACH,SAAS,EAAE,IAAI,GAAG,IAAI,CAAQ;IAE9B;;OAEG;IACH,GAAG,EAAE,MAAM,CAAM;gBAEL,OAAO,GAAE,cAAmB;IAaxC;;OAEG;IACG,UAAU,IAAI,OAAO,CAAC,OAAO,CAAC;IAMpC;;OAEG;IACG,UAAU,IAAI,OAAO,CAAC,OAAO,CAAC;IAMpC;;OAEG;IACG,eAAe,IAAI,OAAO,CAAC,OAAO,CAAC;IAMzC;;;;OAIG;IACG,kBAAkB,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC;IAuB7C;;;;OAIG;IACG,SAAS,IAAI,OAAO,CAAC,MAAM,CAAC;IASlC;;;;OAIG;IACG,YAAY,IAAI,OAAO,CAAC,UAAU,GAAG,UAAU,GAAG,SAAS,CAAC;CAcnE"}
@@ -0,0 +1,200 @@
1
+ import { SmrtObject, SmrtObjectOptions } from '@happyvertical/smrt-core';
2
+ import { IncorporateFeedbackOptions, IncorporateFeedbackResult, IRepository, SyncOptions } from '../types';
3
+ import { Comment } from './Comment';
4
+ import { Repository } from './Repository';
5
+ export interface IssueOptions extends SmrtObjectOptions {
6
+ repositoryId?: string;
7
+ number?: number;
8
+ nodeId?: string;
9
+ title?: string;
10
+ body?: string;
11
+ state?: 'open' | 'closed';
12
+ author?: string;
13
+ labels?: string[];
14
+ assignees?: string[];
15
+ commentsCount?: number;
16
+ lastSyncedAt?: Date | null;
17
+ originalBody?: string;
18
+ synthesisCount?: number;
19
+ tenantId?: string | null;
20
+ }
21
+ export declare class Issue extends SmrtObject {
22
+ /**
23
+ * Tenant ID for multi-tenant isolation
24
+ */
25
+ tenantId: string | null;
26
+ /**
27
+ * Repository this issue belongs to
28
+ */
29
+ repositoryId?: string;
30
+ /**
31
+ * Issue number (provider-specific)
32
+ */
33
+ number: number;
34
+ /**
35
+ * Node ID for GraphQL operations (GitHub Projects API)
36
+ */
37
+ nodeId: string;
38
+ /**
39
+ * Issue title
40
+ */
41
+ title: string;
42
+ /**
43
+ * Issue body/description
44
+ */
45
+ body: string;
46
+ /**
47
+ * Issue state
48
+ */
49
+ state: 'open' | 'closed';
50
+ /**
51
+ * Author's login/username
52
+ */
53
+ author: string;
54
+ /**
55
+ * Labels attached to the issue
56
+ */
57
+ labels: string[];
58
+ /**
59
+ * Assignee logins
60
+ */
61
+ assignees: string[];
62
+ /**
63
+ * Number of comments on the issue
64
+ */
65
+ commentsCount: number;
66
+ /**
67
+ * Last sync timestamp
68
+ */
69
+ lastSyncedAt: Date | null;
70
+ /**
71
+ * Original body before any AI synthesis (for rollback)
72
+ */
73
+ originalBody: string;
74
+ /**
75
+ * Number of times feedback has been incorporated
76
+ */
77
+ synthesisCount: number;
78
+ /**
79
+ * Transient: Cached repository (not persisted)
80
+ * Protected so PullRequest can access it
81
+ */
82
+ protected _repository?: Repository;
83
+ /**
84
+ * Transient: Cached client (not persisted)
85
+ */
86
+ protected _client?: IRepository;
87
+ constructor(options?: IssueOptions);
88
+ /**
89
+ * Get the repository this issue belongs to
90
+ */
91
+ getRepository(): Promise<Repository>;
92
+ /**
93
+ * Get the repository client for API operations
94
+ */
95
+ getClient(): Promise<IRepository>;
96
+ /**
97
+ * Clear cached repository and client
98
+ */
99
+ clearCache(): void;
100
+ /**
101
+ * Sync issue data from the provider
102
+ *
103
+ * @param options - Sync options
104
+ * @returns This issue with updated fields
105
+ */
106
+ sync(options?: SyncOptions): Promise<this>;
107
+ /**
108
+ * Get comments on this issue
109
+ *
110
+ * @returns Array of Comment objects (SMRT models)
111
+ */
112
+ getComments(): Promise<Comment[]>;
113
+ /**
114
+ * Add a comment to this issue
115
+ *
116
+ * @param body - Comment body text
117
+ * @returns Created Comment (SMRT model)
118
+ */
119
+ addComment(body: string): Promise<Comment>;
120
+ /**
121
+ * Incorporate feedback from comments into the issue body
122
+ *
123
+ * This is the core "Living Spec" functionality:
124
+ * 1. Reads all comments on the issue
125
+ * 2. Uses AI to synthesize comments with the current body
126
+ * 3. Optionally updates the issue with the synthesized content
127
+ *
128
+ * @param options - Feedback incorporation options
129
+ * @returns Result with synthesized content and status
130
+ */
131
+ incorporateFeedback(options?: IncorporateFeedbackOptions): Promise<IncorporateFeedbackResult>;
132
+ private runPromptWithResolvedAI;
133
+ /**
134
+ * Sends a fully-resolved instruction string to the given AI client.
135
+ *
136
+ * `incorporateFeedback()` curates the entire prompt (issue body + comments)
137
+ * via the resolved prompt template, so this path deliberately does NOT inject
138
+ * the object's own field data — that would duplicate the body. The `this.do()`
139
+ * fallback path passes `includeData: false` for the same reason, keeping both
140
+ * `incorporateFeedback()` paths consistent (#1567).
141
+ */
142
+ private sendPromptMessage;
143
+ private isExplicitAiClientOption;
144
+ /**
145
+ * Rollback to the original body before AI synthesis
146
+ *
147
+ * @returns Result with success status
148
+ */
149
+ rollback(): Promise<{
150
+ success: boolean;
151
+ message: string;
152
+ }>;
153
+ /**
154
+ * AI-powered: Check if this issue needs review
155
+ *
156
+ * @returns True if the issue likely needs attention
157
+ */
158
+ needsReview(): Promise<boolean>;
159
+ /**
160
+ * AI-powered: Check if the issue is a bug report
161
+ */
162
+ isBugReport(): Promise<boolean>;
163
+ /**
164
+ * AI-powered: Check if the issue is a feature request
165
+ */
166
+ isFeatureRequest(): Promise<boolean>;
167
+ /**
168
+ * AI-powered: Generate suggested labels based on content
169
+ *
170
+ * @returns Array of suggested label names
171
+ */
172
+ suggestLabels(): Promise<string[]>;
173
+ /**
174
+ * Close this issue
175
+ */
176
+ close(): Promise<void>;
177
+ /**
178
+ * Add labels to this issue
179
+ *
180
+ * @param labels - Label names to add
181
+ */
182
+ addLabels(labels: string[]): Promise<void>;
183
+ /**
184
+ * Remove a label from this issue
185
+ *
186
+ * @param label - Label name to remove
187
+ */
188
+ removeLabel(label: string): Promise<void>;
189
+ /**
190
+ * Assign users to this issue
191
+ *
192
+ * @param assignees - User logins to assign
193
+ */
194
+ assign(assignees: string[]): Promise<void>;
195
+ /**
196
+ * Get issue URL
197
+ */
198
+ getUrl(): string;
199
+ }
200
+ //# sourceMappingURL=Issue.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Issue.d.ts","sourceRoot":"","sources":["../../src/models/Issue.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EAEL,UAAU,EACV,KAAK,iBAAiB,EAGvB,MAAM,0BAA0B,CAAC;AAMlC,OAAO,KAAK,EACV,0BAA0B,EAC1B,yBAAyB,EACzB,WAAW,EAEX,WAAW,EACZ,MAAM,UAAU,CAAC;AAClB,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE/C,MAAM,WAAW,YAAa,SAAQ,iBAAiB;IACrD,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,GAAG,QAAQ,CAAC;IAC1B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;IACrB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,YAAY,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC;IAC3B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC1B;AAED,qBAYa,KAAM,SAAQ,UAAU;IACnC;;OAEG;IAEH,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AAE,0BAA+B,GACvC,OAAO,CAAC,yBAAyB,CAAC;YAuFvB,uBAAuB;IAsDrC;;;;;;;;OAQG;YACW,iBAAiB;IAc/B,OAAO,CAAC,wBAAwB;IAYhC;;;;OAIG;IACG,QAAQ,IAAI,OAAO,CAAC;QAAE,OAAO,EAAE,OAAO,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC;IAgChE;;;;OAIG;IACG,WAAW,IAAI,OAAO,CAAC,OAAO,CAAC;IAUrC;;OAEG;IACG,WAAW,IAAI,OAAO,CAAC,OAAO,CAAC;IAMrC;;OAEG;IACG,gBAAgB,IAAI,OAAO,CAAC,OAAO,CAAC;IAM1C;;;;OAIG;IACG,aAAa,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC;IAiBxC;;OAEG;IACG,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAQ5B;;;;OAIG;IACG,SAAS,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IAOhD;;;;OAIG;IACG,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAO/C;;;;OAIG;IACG,MAAM,CAAC,SAAS,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IAOhD;;OAEG;IACH,MAAM,IAAI,MAAM;CAOjB"}
@@ -0,0 +1,63 @@
1
+ import { SmrtObject, SmrtObjectOptions } from '@happyvertical/smrt-core';
2
+ export interface LabelOptions extends SmrtObjectOptions {
3
+ repositoryId?: string;
4
+ name?: string;
5
+ color?: string;
6
+ description?: string;
7
+ }
8
+ export declare class Label extends SmrtObject {
9
+ /**
10
+ * Repository this label belongs to
11
+ */
12
+ repositoryId?: string;
13
+ /**
14
+ * Label name
15
+ */
16
+ name: string;
17
+ /**
18
+ * Label color (hex without #)
19
+ */
20
+ color: string;
21
+ /**
22
+ * Label description
23
+ */
24
+ description: string;
25
+ constructor(options?: LabelOptions);
26
+ /**
27
+ * Check if this is a type label (bug, feature, etc.)
28
+ */
29
+ isTypeLabel(): boolean;
30
+ /**
31
+ * Check if this is a priority label
32
+ */
33
+ isPriorityLabel(): boolean;
34
+ /**
35
+ * Check if this is a status label
36
+ */
37
+ isStatusLabel(): boolean;
38
+ /**
39
+ * Get the label category
40
+ *
41
+ * @returns Category name
42
+ */
43
+ getCategory(): 'type' | 'priority' | 'status' | 'area' | 'other';
44
+ /**
45
+ * Parse priority level from label name
46
+ *
47
+ * @returns Priority level 0-4 or null
48
+ */
49
+ getPriorityLevel(): number | null;
50
+ /**
51
+ * Get label with # prefix for hex color
52
+ */
53
+ getHexColor(): string;
54
+ /**
55
+ * Create a label in the repository
56
+ */
57
+ createInRepository(): Promise<void>;
58
+ /**
59
+ * Update this label in the repository
60
+ */
61
+ updateInRepository(): Promise<void>;
62
+ }
63
+ //# sourceMappingURL=Label.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Label.d.ts","sourceRoot":"","sources":["../../src/models/Label.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAEL,UAAU,EACV,KAAK,iBAAiB,EAEvB,MAAM,0BAA0B,CAAC;AAElC,MAAM,WAAW,YAAa,SAAQ,iBAAiB;IACrD,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,qBAKa,KAAM,SAAQ,UAAU;IACnC;;OAEG;IAEH,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB;;OAEG;IACH,IAAI,EAAE,MAAM,CAAM;IAElB;;OAEG;IACH,KAAK,EAAE,MAAM,CAAM;IAEnB;;OAEG;IACH,WAAW,EAAE,MAAM,CAAM;gBAEb,OAAO,GAAE,YAAiB;IAUtC;;OAEG;IACH,WAAW,IAAI,OAAO;IAatB;;OAEG;IACH,eAAe,IAAI,OAAO;IAY1B;;OAEG;IACH,aAAa,IAAI,OAAO;IAYxB;;;;OAIG;IACH,WAAW,IAAI,MAAM,GAAG,UAAU,GAAG,QAAQ,GAAG,MAAM,GAAG,OAAO;IAQhE;;;;OAIG;IACH,gBAAgB,IAAI,MAAM,GAAG,IAAI;IAYjC;;OAEG;IACH,WAAW,IAAI,MAAM;IAIrB;;OAEG;IACG,kBAAkB,IAAI,OAAO,CAAC,IAAI,CAAC;IAyBzC;;OAEG;IACG,kBAAkB,IAAI,OAAO,CAAC,IAAI,CAAC;CAwB1C"}
@@ -0,0 +1,183 @@
1
+ import { SmrtObject, SmrtObjectOptions } from '@happyvertical/smrt-core';
2
+ import { IProject, ItemFilters, ProjectField, ProjectItem, ProjectProviderType, ProjectStatus, SyncOptions } from '../types';
3
+ import { Issue } from './Issue';
4
+ import { PullRequest } from './PullRequest';
5
+ export interface ProjectOptions extends SmrtObjectOptions {
6
+ projectId?: string;
7
+ projectNumber?: number;
8
+ title?: string;
9
+ description?: string;
10
+ owner?: string;
11
+ url?: string;
12
+ providerType?: ProjectProviderType;
13
+ tokenConfigKey?: string;
14
+ statuses?: ProjectStatus[];
15
+ fields?: ProjectField[];
16
+ statusFieldId?: string;
17
+ statusOptions?: Record<string, string>;
18
+ tenantId?: string | null;
19
+ }
20
+ export declare class Project extends SmrtObject {
21
+ /**
22
+ * Tenant ID for multi-tenant isolation
23
+ */
24
+ tenantId: string | null;
25
+ /**
26
+ * Provider-specific project ID (e.g., GitHub GraphQL node ID)
27
+ */
28
+ projectId: string;
29
+ /**
30
+ * Human-readable project number
31
+ */
32
+ projectNumber: number;
33
+ /**
34
+ * Project title
35
+ */
36
+ title: string;
37
+ /**
38
+ * Project description
39
+ */
40
+ description: string;
41
+ /**
42
+ * Project owner (organization or user)
43
+ */
44
+ owner: string;
45
+ /**
46
+ * Project URL
47
+ */
48
+ url: string;
49
+ /**
50
+ * Project provider type
51
+ */
52
+ providerType: ProjectProviderType;
53
+ /**
54
+ * Environment variable name or config key for token resolution
55
+ */
56
+ tokenConfigKey: string;
57
+ /**
58
+ * Available statuses (columns) in the project
59
+ */
60
+ statuses: ProjectStatus[];
61
+ /**
62
+ * Custom fields defined in the project
63
+ */
64
+ fields: ProjectField[];
65
+ /**
66
+ * Status field ID for GitHub Projects V2
67
+ */
68
+ statusFieldId: string;
69
+ /**
70
+ * Maps status name to option ID (for GitHub Projects V2)
71
+ */
72
+ statusOptions: Record<string, string>;
73
+ /**
74
+ * Last sync timestamp
75
+ */
76
+ lastSyncedAt: Date | null;
77
+ /**
78
+ * Transient: Cached project client (not persisted)
79
+ */
80
+ private _client?;
81
+ constructor(options?: ProjectOptions);
82
+ /**
83
+ * Get the project client, resolving token from config
84
+ *
85
+ * @returns Project client for API operations
86
+ * @throws Error if token cannot be resolved
87
+ */
88
+ getClient(): Promise<IProject>;
89
+ /**
90
+ * Clear the cached client
91
+ */
92
+ clearClient(): void;
93
+ /**
94
+ * Sync project metadata from the provider
95
+ *
96
+ * @param options - Sync options
97
+ * @returns This project with updated fields
98
+ */
99
+ sync(options?: SyncOptions): Promise<this>;
100
+ /**
101
+ * Add an issue or PR to this project
102
+ *
103
+ * @param item - Issue or PullRequest to add
104
+ * @returns Created ProjectItem
105
+ */
106
+ addItem(item: Issue | PullRequest): Promise<ProjectItem>;
107
+ /**
108
+ * Remove an item from this project
109
+ *
110
+ * @param itemId - Project item ID to remove
111
+ */
112
+ removeItem(itemId: string): Promise<void>;
113
+ /**
114
+ * Get a specific item from the project
115
+ *
116
+ * @param itemId - Project item ID
117
+ * @returns ProjectItem or null
118
+ */
119
+ getItem(itemId: string): Promise<ProjectItem | null>;
120
+ /**
121
+ * List items in this project
122
+ *
123
+ * @param filters - Optional filters
124
+ * @returns Array of ProjectItems
125
+ */
126
+ listItems(filters?: ItemFilters): Promise<ProjectItem[]>;
127
+ /**
128
+ * Update an item's status (column)
129
+ *
130
+ * @param itemId - Project item ID
131
+ * @param status - New status name
132
+ */
133
+ updateItemStatus(itemId: string, status: string): Promise<void>;
134
+ /**
135
+ * Update an item's custom field
136
+ *
137
+ * @param itemId - Project item ID
138
+ * @param fieldId - Field ID
139
+ * @param value - New value
140
+ */
141
+ updateItemField(itemId: string, fieldId: string, value: unknown): Promise<void>;
142
+ /**
143
+ * Get available statuses
144
+ *
145
+ * @returns Array of status definitions
146
+ */
147
+ getStatuses(): Promise<ProjectStatus[]>;
148
+ /**
149
+ * Get available fields
150
+ *
151
+ * @returns Array of field definitions
152
+ */
153
+ getFields(): Promise<ProjectField[]>;
154
+ /**
155
+ * Get items in a specific status/column
156
+ *
157
+ * @param status - Status name
158
+ * @returns Array of ProjectItems in that status
159
+ */
160
+ getItemsByStatus(status: string): Promise<ProjectItem[]>;
161
+ /**
162
+ * Move an item to a new status
163
+ *
164
+ * @param item - Issue or PullRequest
165
+ * @param status - Target status name
166
+ */
167
+ moveItem(item: Issue | PullRequest, status: string): Promise<void>;
168
+ /**
169
+ * AI-powered: Analyze project health and suggest improvements
170
+ *
171
+ * @returns Analysis of project status
172
+ */
173
+ analyzeHealth(): Promise<string>;
174
+ /**
175
+ * Get project by title
176
+ *
177
+ * @param title - Project title
178
+ * @param options - Additional options
179
+ * @returns Project or null
180
+ */
181
+ static getByTitle(title: string, options?: SmrtObjectOptions): Promise<Project | null>;
182
+ }
183
+ //# sourceMappingURL=Project.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Project.d.ts","sourceRoot":"","sources":["../../src/models/Project.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,OAAO,EACL,UAAU,EACV,KAAK,iBAAiB,EAEvB,MAAM,0BAA0B,CAAC;AAGlC,OAAO,KAAK,EACV,QAAQ,EACR,WAAW,EACX,YAAY,EACZ,WAAW,EACX,mBAAmB,EACnB,aAAa,EAEb,WAAW,EACZ,MAAM,UAAU,CAAC;AAClB,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAEj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AAO,CAAC,IAAI,CAAC;IAYxE;;;;OAIG;IACG,aAAa,IAAI,OAAO,CAAC,MAAM,CAAC;IAmCtC;;;;;;OAMG;WACU,UAAU,CACrB,KAAK,EAAE,MAAM,EACb,OAAO,GAAE,iBAAsB,GAC9B,OAAO,CAAC,OAAO,GAAG,IAAI,CAAC;CAK3B"}
@@ -0,0 +1,114 @@
1
+ import { MergeMethod, SyncOptions } from '../types';
2
+ import { Issue, IssueOptions } from './Issue';
3
+ export interface PullRequestOptions extends IssueOptions {
4
+ headRef?: string;
5
+ baseRef?: string;
6
+ merged?: boolean;
7
+ mergedAt?: Date | null;
8
+ mergeable?: boolean;
9
+ draft?: boolean;
10
+ additions?: number;
11
+ deletions?: number;
12
+ changedFiles?: number;
13
+ }
14
+ export declare class PullRequest extends Issue {
15
+ /**
16
+ * Source branch ref
17
+ */
18
+ headRef: string;
19
+ /**
20
+ * Target branch ref
21
+ */
22
+ baseRef: string;
23
+ /**
24
+ * Whether the PR has been merged
25
+ */
26
+ merged: boolean;
27
+ /**
28
+ * When the PR was merged
29
+ */
30
+ mergedAt: Date | null;
31
+ /**
32
+ * Whether the PR can be merged
33
+ */
34
+ mergeable: boolean;
35
+ /**
36
+ * Whether this is a draft PR
37
+ */
38
+ draft: boolean;
39
+ /**
40
+ * Lines added
41
+ */
42
+ additions: number;
43
+ /**
44
+ * Lines deleted
45
+ */
46
+ deletions: number;
47
+ /**
48
+ * Number of files changed
49
+ */
50
+ changedFiles: number;
51
+ constructor(options?: PullRequestOptions);
52
+ /**
53
+ * Sync PR data from the provider
54
+ *
55
+ * @param options - Sync options
56
+ * @returns This PR with updated fields
57
+ */
58
+ sync(options?: SyncOptions): Promise<this>;
59
+ /**
60
+ * AI-powered: Generate a summary of PR changes
61
+ *
62
+ * @returns Summary of what this PR does
63
+ */
64
+ summarize(): Promise<string>;
65
+ /**
66
+ * Merge this pull request
67
+ *
68
+ * @param method - Merge method (merge, squash, rebase)
69
+ */
70
+ merge(method?: MergeMethod): Promise<void>;
71
+ /**
72
+ * Mark this draft PR as ready for review
73
+ */
74
+ markReady(): Promise<void>;
75
+ /**
76
+ * Convert this PR back to draft
77
+ */
78
+ convertToDraft(): Promise<void>;
79
+ /**
80
+ * Request review from specified users
81
+ *
82
+ * @param reviewers - User logins to request review from
83
+ */
84
+ requestReviewers(reviewers: string[]): Promise<void>;
85
+ /**
86
+ * Find related issue for this PR
87
+ *
88
+ * @returns Related Issue or null
89
+ */
90
+ findLinkedIssue(): Promise<Issue | null>;
91
+ /**
92
+ * AI-powered: Check if this PR is ready to merge
93
+ *
94
+ * @returns True if the PR appears ready
95
+ */
96
+ isReadyToMerge(): Promise<boolean>;
97
+ /**
98
+ * AI-powered: Suggest reviewers based on changed files
99
+ *
100
+ * @returns Array of suggested reviewer logins
101
+ */
102
+ suggestReviewers(): Promise<string[]>;
103
+ /**
104
+ * Get PR URL
105
+ */
106
+ getUrl(): string;
107
+ /**
108
+ * Get the change size classification
109
+ *
110
+ * @returns Size classification (xs, s, m, l, xl)
111
+ */
112
+ getChangeSize(): 'xs' | 's' | 'm' | 'l' | 'xl';
113
+ }
114
+ //# sourceMappingURL=PullRequest.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PullRequest.d.ts","sourceRoot":"","sources":["../../src/models/PullRequest.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAKH,OAAO,KAAK,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AACzD,OAAO,EAAE,KAAK,EAAE,KAAK,YAAY,EAAE,MAAM,SAAS,CAAC;AAEnD,MAAM,WAAW,kBAAmB,SAAQ,YAAY;IACtD,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,QAAQ,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC;IACvB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,KAAK,CAAC,EAAE,OA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