@lovelybunch/api 1.0.76-alpha.7 → 1.0.76-alpha.8

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 (145) hide show
  1. package/dist/lib/mcp-client.d.ts +39 -0
  2. package/dist/lib/mcp-client.js +131 -0
  3. package/dist/lib/terminal/terminal-manager.js +31 -0
  4. package/dist/routes/api/v1/ai/tools.d.ts +17 -0
  5. package/dist/routes/api/v1/ai/tools.js +931 -0
  6. package/dist/routes/api/v1/context/knowledge/[filename]/index.d.ts +1 -0
  7. package/dist/routes/api/v1/context/knowledge/[filename]/index.js +1 -0
  8. package/dist/routes/api/v1/context/knowledge/[filename]/route.d.ts +3 -0
  9. package/dist/routes/api/v1/context/knowledge/[filename]/route.js +254 -0
  10. package/dist/routes/api/v1/context/knowledge/index.d.ts +1 -0
  11. package/dist/routes/api/v1/context/knowledge/index.js +1 -0
  12. package/dist/routes/api/v1/context/knowledge/route.d.ts +3 -0
  13. package/dist/routes/api/v1/context/knowledge/route.js +176 -0
  14. package/dist/routes/api/v1/proposals/[id]/route.d.ts +337 -0
  15. package/dist/routes/api/v1/proposals/[id]/route.js +165 -0
  16. package/dist/routes/api/v1/proposals/index.d.ts +3 -0
  17. package/dist/routes/api/v1/proposals/index.js +10 -0
  18. package/dist/routes/api/v1/proposals/route.d.ts +315 -0
  19. package/dist/routes/api/v1/proposals/route.js +129 -0
  20. package/dist/routes/api/v1/terminal/[proposalId]/create/index.d.ts +3 -0
  21. package/dist/routes/api/v1/terminal/[proposalId]/create/index.js +5 -0
  22. package/dist/routes/api/v1/terminal/[proposalId]/create/route.d.ts +10 -0
  23. package/dist/routes/api/v1/terminal/[proposalId]/create/route.js +27 -0
  24. package/dist/routes/api/v1/terminal/[proposalId]/destroy/index.d.ts +3 -0
  25. package/dist/routes/api/v1/terminal/[proposalId]/destroy/index.js +5 -0
  26. package/dist/routes/api/v1/terminal/[proposalId]/destroy/route.d.ts +10 -0
  27. package/dist/routes/api/v1/terminal/[proposalId]/destroy/route.js +21 -0
  28. package/dist/routes/api/v1/terminal/[proposalId]/resize/index.d.ts +3 -0
  29. package/dist/routes/api/v1/terminal/[proposalId]/resize/index.js +5 -0
  30. package/dist/routes/api/v1/terminal/[proposalId]/resize/route.d.ts +10 -0
  31. package/dist/routes/api/v1/terminal/[proposalId]/resize/route.js +21 -0
  32. package/dist/routes/api/v1/terminal/code/route.js +9 -16
  33. package/package.json +4 -4
  34. package/static/assets/{ActivityPage-Dmuu0c1r.js → ActivityPage-uL-Qknui.js} +1 -1
  35. package/static/assets/{ApiKeysSettingsPage-BtpcHzBO.js → ApiKeysSettingsPage-BhaH6ZYP.js} +1 -1
  36. package/static/assets/{ArchitectureEditPage-CRK7l_pP.js → ArchitectureEditPage-BWKyKi3T.js} +1 -1
  37. package/static/assets/{ArchitecturePage-Bb3Mr04V.js → ArchitecturePage-Dtm0OAac.js} +1 -1
  38. package/static/assets/{AuthSettingsPage-BmcnjO0-.js → AuthSettingsPage-D0MQlHyh.js} +1 -1
  39. package/static/assets/{CallbackPage-hQdlfqNL.js → CallbackPage-Bz4m3_W8.js} +1 -1
  40. package/static/assets/{CodePage-BlGRZW1v.js → CodePage-BuO2K_xx.js} +1 -1
  41. package/static/assets/{CollapsibleSection-dXTDG5xK.js → CollapsibleSection-CxX11hr-.js} +1 -1
  42. package/static/assets/{DashboardPage-SNgPwXuZ.js → DashboardPage-B3HR1UM7.js} +1 -1
  43. package/static/assets/{GitPage-CmRS64Yi.js → GitPage-Dm36PRw_.js} +1 -1
  44. package/static/assets/{GitSettingsPage-2sLN6YTn.js → GitSettingsPage-CRWcjgVI.js} +1 -1
  45. package/static/assets/{IdentityPage-Ce9aNd67.js → IdentityPage-YCkmdyzR.js} +1 -1
  46. package/static/assets/{ImplementationStepsEditor-BCw5WEo-.js → ImplementationStepsEditor-u3dPxmKW.js} +1 -1
  47. package/static/assets/{IntegrationsSettingsPage-CNhL2RAP.js → IntegrationsSettingsPage-Z8xCUmX9.js} +1 -1
  48. package/static/assets/{JobDetailPage-B1QoqEIg.js → JobDetailPage-B8Za82RA.js} +1 -1
  49. package/static/assets/{KnowledgeDetailPage-D6E4oPnB.js → KnowledgeDetailPage-CR9c4_WD.js} +1 -1
  50. package/static/assets/{KnowledgeEditPage-Cx0I6UOP.js → KnowledgeEditPage-DhrF6UPg.js} +1 -1
  51. package/static/assets/{KnowledgePage-CtwNzWrO.js → KnowledgePage-_gZhpTe3.js} +1 -1
  52. package/static/assets/{LoginPage-wCy6_Zm7.js → LoginPage-Cc1Ac2j4.js} +1 -1
  53. package/static/assets/{MailInboxPage-PlwJvbyZ.js → MailInboxPage-B_h1Kz4D.js} +1 -1
  54. package/static/assets/{MailProcessingModal-D7Ql9vO7.js → MailProcessingModal-D_qEwqmL.js} +1 -1
  55. package/static/assets/{MailReadPage-BIs7cMX8.js → MailReadPage-_q-xk_cX.js} +1 -1
  56. package/static/assets/{MailSentPage-Bb0xtmoP.js → MailSentPage-Dj63oQ5D.js} +1 -1
  57. package/static/assets/{McpSettingsPage-CgxAuTpL.js → McpSettingsPage-DYZ0QNbp.js} +1 -1
  58. package/static/assets/{NewKnowledgePage-ByxAeT6H.js → NewKnowledgePage-BEVMYnKG.js} +1 -1
  59. package/static/assets/{NewSkillPage-OYWMDDx4.js → NewSkillPage-BEn18f2A.js} +1 -1
  60. package/static/assets/{NewTaskPage-BtQDlqV4.js → NewTaskPage-CSlncpI5.js} +1 -1
  61. package/static/assets/{NotFoundPage-C6Y7qVDZ.js → NotFoundPage-C4x0lGai.js} +1 -1
  62. package/static/assets/{NotificationsSettingsPage-D7Ov-sWC.js → NotificationsSettingsPage-C9YnfRlj.js} +1 -1
  63. package/static/assets/{ProjectEditPage-DathnxH1.js → ProjectEditPage-X0-4mEAS.js} +1 -1
  64. package/static/assets/{ProjectPage-Cqhn6x5U.js → ProjectPage-D8OX1GKt.js} +1 -1
  65. package/static/assets/{PromptsSettingsPage-YUM57KBW.js → PromptsSettingsPage-Chc4da1S.js} +1 -1
  66. package/static/assets/{ResourceDetailPage-DHjIUpZA.js → ResourceDetailPage-DDYKQxpM.js} +1 -1
  67. package/static/assets/{ResourcesPage-D6JnktN5.js → ResourcesPage-BmOpgt3L.js} +1 -1
  68. package/static/assets/{RoleEditPage-BkcUVWeb.js → RoleEditPage-Ccfu1tn1.js} +1 -1
  69. package/static/assets/{RolePage-BvbK5LV5.js → RolePage-CcdEUjSm.js} +1 -1
  70. package/static/assets/{RulesSettingsPage-0FLxp6EA.js → RulesSettingsPage-Cz1g_eAj.js} +1 -1
  71. package/static/assets/{SchedulePage-DedzsT29.js → SchedulePage-CGxZHEL-.js} +1 -1
  72. package/static/assets/{SkillDetailPage-tQFvdVX0.js → SkillDetailPage-sJg-L8A8.js} +1 -1
  73. package/static/assets/{SkillEditPage-DqNB953S.js → SkillEditPage-BksV7GmD.js} +1 -1
  74. package/static/assets/{SkillsPage-BjQJQ5dJ.js → SkillsPage-CwarkJmZ.js} +1 -1
  75. package/static/assets/{SkillsSettingsPage-CVXd-umU.js → SkillsSettingsPage-DTnBlBdE.js} +1 -1
  76. package/static/assets/{SourceInput-8t5lHb_p.js → SourceInput-CWazIr6v.js} +1 -1
  77. package/static/assets/{TagInput-BSvCOVlX.js → TagInput-Bgyxb_JU.js} +1 -1
  78. package/static/assets/{TaskDetailPage-mr6xlhU3.js → TaskDetailPage-DlmG1kZR.js} +1 -1
  79. package/static/assets/{TaskEditPage-BPFpzGZd.js → TaskEditPage-BnpNeed_.js} +1 -1
  80. package/static/assets/{TasksPage-DHhsW-6_.js → TasksPage-CXeTMpgy.js} +1 -1
  81. package/static/assets/{TerminalPage-BoULMlvX.js → TerminalPage-BLcPt381.js} +1 -1
  82. package/static/assets/{TerminalSessionPage-BUFKA_ff.js → TerminalSessionPage-CeAd8IAy.js} +1 -1
  83. package/static/assets/{UserPreferencesPage-CG8d6Etn.js → UserPreferencesPage-BNwEqlRW.js} +1 -1
  84. package/static/assets/{UserSettingsPage-xPNj059t.js → UserSettingsPage-BRafqkiD.js} +1 -1
  85. package/static/assets/{UtilitiesPage-1-65_2Xp.js → UtilitiesPage-BPX_Unxu.js} +1 -1
  86. package/static/assets/{alert-EL2xlTrX.js → alert-Ci2-OWZ_.js} +1 -1
  87. package/static/assets/{arrow-down-C4aI3BzN.js → arrow-down-C6Flf0DF.js} +1 -1
  88. package/static/assets/{arrow-left-D1gRXqBK.js → arrow-left-7TCkaJlN.js} +1 -1
  89. package/static/assets/{arrow-up-DAYHG9Lx.js → arrow-up-DeQAxOPq.js} +1 -1
  90. package/static/assets/{arrow-up-down-CHPybwd-.js → arrow-up-down-tqbfiBy6.js} +1 -1
  91. package/static/assets/{badge-WU4FRCeV.js → badge-D4vHU_w_.js} +1 -1
  92. package/static/assets/{browser-modal-B41s3tKa.js → browser-modal-BiaqhKHm.js} +1 -1
  93. package/static/assets/{card-BHJKBprp.js → card-xkODbJy-.js} +1 -1
  94. package/static/assets/{chevron-left-BJKLaytG.js → chevron-left-CvpfJBPQ.js} +1 -1
  95. package/static/assets/{chevron-up-BkAwyb-e.js → chevron-up-BB-6OS4z.js} +1 -1
  96. package/static/assets/{chevrons-up-DLVKnDAn.js → chevrons-up-CLKrQHMU.js} +1 -1
  97. package/static/assets/{circle-alert-Z70KQUGE.js → circle-alert-lnP0-w3N.js} +1 -1
  98. package/static/assets/{circle-check-BADr-KOf.js → circle-check-BPkEav83.js} +1 -1
  99. package/static/assets/{circle-check-big-D34PB5x-.js → circle-check-big-Dbo-OmWQ.js} +1 -1
  100. package/static/assets/{circle-play-BfLMQvSH.js → circle-play-BbtBIeo3.js} +1 -1
  101. package/static/assets/{circle-x-Bn4fyYbB.js → circle-x-BBwi8e5G.js} +1 -1
  102. package/static/assets/{clipboard-DFI4a7LI.js → clipboard-Ce816tAO.js} +1 -1
  103. package/static/assets/{clock-BwcvObAc.js → clock-BIeoO5Mt.js} +1 -1
  104. package/static/assets/{code-DXA16K3p.js → code-DTW3giBe.js} +1 -1
  105. package/static/assets/{download-Cb08Pn1l.js → download-BgKxfry9.js} +1 -1
  106. package/static/assets/{external-link-BbPHlMU6.js → external-link--RjKXREe.js} +1 -1
  107. package/static/assets/{eye-DKuTxsEz.js → eye--K-OgK7L.js} +1 -1
  108. package/static/assets/{folder-git-2-CLjnVj8p.js → folder-git-2-Bgv7r0zC.js} +1 -1
  109. package/static/assets/{index-MT7xy-5k.js → index-4RuWYO4M.js} +1 -1
  110. package/static/assets/{index-97wNbZjB.js → index-BD9UBXsr.js} +1 -1
  111. package/static/assets/{index-DauoTeMC.js → index-BQYB8kWb.js} +1 -1
  112. package/static/assets/{index-DDaqus6Y.js → index-BbrX1XcC.js} +1 -1
  113. package/static/assets/{index-KMYFtqs_.js → index-BkEdELOI.js} +1 -1
  114. package/static/assets/{index-Cp2t41gG.js → index-BteQHbZ1.js} +1 -1
  115. package/static/assets/{index-CHImvyA8.js → index-CW9pK_cZ.js} +1 -1
  116. package/static/assets/{index-DNQq4O0F.js → index-Cd5hBt4x.js} +1 -1
  117. package/static/assets/{index-9hNdrzuJ.js → index-Ch4GVR8L.js} +1 -1
  118. package/static/assets/{index-BBUGa7c5.js → index-D9xZafJb.js} +1 -1
  119. package/static/assets/{index-DO6rNgzu.js → index-DF_KNbKf.js} +1 -1
  120. package/static/assets/{index-DysiQsZ5.js → index-Db5-BoCU.js} +1 -1
  121. package/static/assets/{index-B-VC5GM7.js → index-Di7xMYoG.js} +1 -1
  122. package/static/assets/{index-DE9Jes-V.js → index-Do92mBFr.js} +1 -1
  123. package/static/assets/{index-DxQLy6Gv.js → index-Dt_WtbUU.js} +1 -1
  124. package/static/assets/{index-BShpFXJb.js → index-LMsLdXw_.js} +1 -1
  125. package/static/assets/{index-C5Azpb6Z.js → index-PyVlsLW8.js} +3 -3
  126. package/static/assets/{index-Bd8VZDeR.js → index-R44k73Ca.js} +1 -1
  127. package/static/assets/{index-BjpC9OGL.js → index-iIFwHD3L.js} +1 -1
  128. package/static/assets/{info-CwUnqjYK.js → info-DgZN3xWF.js} +1 -1
  129. package/static/assets/{label-Dk87UyXm.js → label-DvPENm3h.js} +1 -1
  130. package/static/assets/{markdown-editor-D0KOANlZ.js → markdown-editor-DpZxV-fa.js} +3 -3
  131. package/static/assets/{message-square-qlP-j05_.js → message-square-CoaQYehb.js} +1 -1
  132. package/static/assets/{paperclip-C7-B8_IK.js → paperclip-ChugoOAp.js} +1 -1
  133. package/static/assets/{pause-DE1VFlNp.js → pause-m9YcgxdE.js} +1 -1
  134. package/static/assets/{play-D8sJDiBu.js → play-DtFz_MLh.js} +1 -1
  135. package/static/assets/{radio-group-C8YR94gC.js → radio-group-C5Te9bVb.js} +1 -1
  136. package/static/assets/{refresh-cw-CIEDgKUC.js → refresh-cw-B1bWW9Rg.js} +1 -1
  137. package/static/assets/{search-BGxb6jwl.js → search-CPOHeeUa.js} +1 -1
  138. package/static/assets/{select-CpKkFDbr.js → select-B1v2u6hQ.js} +1 -1
  139. package/static/assets/{switch-BZ6eSoPj.js → switch-Bf1Cq3P6.js} +1 -1
  140. package/static/assets/{tabs-HysYyLO3.js → tabs-DAbCZiFC.js} +1 -1
  141. package/static/assets/{tag-D2TG8w6l.js → tag-Cz4z82t0.js} +1 -1
  142. package/static/assets/{terminal-preview-Cgpwpsv9.js → terminal-preview-DTUohQ5b.js} +1 -1
  143. package/static/assets/{use-terminal-Bf1hClFd.js → use-terminal-CFbQv1ie.js} +1 -1
  144. package/static/assets/{video-D0tTpDVb.js → video-B6ZJ-Epb.js} +1 -1
  145. package/static/index.html +1 -1
@@ -0,0 +1,315 @@
1
+ import { Context } from 'hono';
2
+ export declare function GET(c: Context): Promise<(Response & import("hono").TypedResponse<{
3
+ success: true;
4
+ data: {
5
+ id: string;
6
+ intent: string;
7
+ content?: string;
8
+ author: {
9
+ type: import("@lovelybunch/types").AuthorType;
10
+ id: string;
11
+ name: string;
12
+ email?: string;
13
+ };
14
+ productSpecRef?: string;
15
+ planSteps: {
16
+ id: string;
17
+ description: string;
18
+ command?: string;
19
+ expectedOutcome?: string;
20
+ status: "pending" | "in-progress" | "completed" | "failed";
21
+ output?: string;
22
+ error?: string;
23
+ executedAt?: string;
24
+ }[];
25
+ evidence: {
26
+ type: "test" | "benchmark" | "screenshot" | "log" | "other";
27
+ description: string;
28
+ data: any;
29
+ timestamp: string;
30
+ }[];
31
+ policies: {
32
+ id: string;
33
+ name: string;
34
+ description: string;
35
+ status: "pending" | "passed" | "failed" | "skipped";
36
+ message?: string;
37
+ checkedAt?: string;
38
+ }[];
39
+ featureFlags: {
40
+ id: string;
41
+ version: string;
42
+ name: string;
43
+ description: string;
44
+ type: import("@lovelybunch/types").FeatureFlagType;
45
+ defaultValue: any;
46
+ scopes: string[];
47
+ targets: {
48
+ audience: string;
49
+ value: any;
50
+ percentage?: number;
51
+ }[];
52
+ killSwitch: boolean;
53
+ dependencies: string[];
54
+ createdAt: string;
55
+ updatedAt: string;
56
+ }[];
57
+ experiments: {
58
+ id: string;
59
+ name: string;
60
+ hypothesis: string;
61
+ variants: {
62
+ id: string;
63
+ name: string;
64
+ description: string;
65
+ allocation: number;
66
+ config: {
67
+ [x: string]: any;
68
+ };
69
+ }[];
70
+ allocation: {
71
+ method: "random" | "deterministic" | "weighted";
72
+ seed?: string;
73
+ totalAllocation: number;
74
+ };
75
+ successMetrics: string[];
76
+ guardrailMetrics: {
77
+ name: string;
78
+ threshold: number;
79
+ comparison: "greater" | "less" | "equal";
80
+ action: "alert" | "pause" | "stop";
81
+ }[];
82
+ stopRules: {
83
+ metric: string;
84
+ condition: string;
85
+ action: "stop" | "pause";
86
+ }[];
87
+ analysisConfig: {
88
+ confidenceLevel: number;
89
+ minimumSampleSize: number;
90
+ testType: "two-tailed" | "one-tailed";
91
+ };
92
+ status: import("@lovelybunch/types").ExperimentStatus;
93
+ startedAt?: string;
94
+ endedAt?: string;
95
+ }[];
96
+ telemetryContracts: {
97
+ eventName: string;
98
+ version: string;
99
+ schema: {
100
+ [x: string]: any;
101
+ };
102
+ piiFields: {
103
+ field: string;
104
+ classification: "none" | "quasi" | "sensitive" | "highly-sensitive";
105
+ handling: "clear" | "hash" | "encrypt" | "remove";
106
+ }[];
107
+ samplingRate: number;
108
+ retentionPolicy: {
109
+ duration: number;
110
+ archiveAfter?: number;
111
+ deleteAfter: number;
112
+ };
113
+ approvals: {
114
+ approver: string;
115
+ approvedAt: string;
116
+ comment?: string;
117
+ }[];
118
+ }[];
119
+ releasePlan: {
120
+ strategy: "immediate" | "gradual" | "scheduled" | "gated";
121
+ stages?: {
122
+ name: string;
123
+ percentage: number;
124
+ duration?: number;
125
+ criteria?: string[];
126
+ }[];
127
+ schedule?: string;
128
+ rollbackPlan?: string;
129
+ };
130
+ status: import("@lovelybunch/types").CPStatus;
131
+ metadata: {
132
+ createdAt: string;
133
+ updatedAt: string;
134
+ reviewers: string[];
135
+ aiInteractions: {
136
+ id: string;
137
+ timestamp: string;
138
+ model: string;
139
+ prompt: string;
140
+ response: string;
141
+ tokens: {
142
+ prompt: number;
143
+ completion: number;
144
+ total: number;
145
+ };
146
+ cost?: number;
147
+ }[];
148
+ tags?: string[];
149
+ priority?: "low" | "medium" | "high" | "critical";
150
+ };
151
+ }[];
152
+ }, import("hono/utils/http-status").ContentfulStatusCode, "json">) | (Response & import("hono").TypedResponse<{
153
+ success: false;
154
+ error: {
155
+ code: string;
156
+ message: any;
157
+ };
158
+ }, 500, "json">)>;
159
+ export declare function POST(c: Context): Promise<(Response & import("hono").TypedResponse<{
160
+ success: true;
161
+ data: {
162
+ id: string;
163
+ intent: string;
164
+ content?: string;
165
+ author: {
166
+ type: import("@lovelybunch/types").AuthorType;
167
+ id: string;
168
+ name: string;
169
+ email?: string;
170
+ };
171
+ productSpecRef?: string;
172
+ planSteps: {
173
+ id: string;
174
+ description: string;
175
+ command?: string;
176
+ expectedOutcome?: string;
177
+ status: "pending" | "in-progress" | "completed" | "failed";
178
+ output?: string;
179
+ error?: string;
180
+ executedAt?: string;
181
+ }[];
182
+ evidence: {
183
+ type: "test" | "benchmark" | "screenshot" | "log" | "other";
184
+ description: string;
185
+ data: any;
186
+ timestamp: string;
187
+ }[];
188
+ policies: {
189
+ id: string;
190
+ name: string;
191
+ description: string;
192
+ status: "pending" | "passed" | "failed" | "skipped";
193
+ message?: string;
194
+ checkedAt?: string;
195
+ }[];
196
+ featureFlags: {
197
+ id: string;
198
+ version: string;
199
+ name: string;
200
+ description: string;
201
+ type: import("@lovelybunch/types").FeatureFlagType;
202
+ defaultValue: any;
203
+ scopes: string[];
204
+ targets: {
205
+ audience: string;
206
+ value: any;
207
+ percentage?: number;
208
+ }[];
209
+ killSwitch: boolean;
210
+ dependencies: string[];
211
+ createdAt: string;
212
+ updatedAt: string;
213
+ }[];
214
+ experiments: {
215
+ id: string;
216
+ name: string;
217
+ hypothesis: string;
218
+ variants: {
219
+ id: string;
220
+ name: string;
221
+ description: string;
222
+ allocation: number;
223
+ config: {
224
+ [x: string]: any;
225
+ };
226
+ }[];
227
+ allocation: {
228
+ method: "random" | "deterministic" | "weighted";
229
+ seed?: string;
230
+ totalAllocation: number;
231
+ };
232
+ successMetrics: string[];
233
+ guardrailMetrics: {
234
+ name: string;
235
+ threshold: number;
236
+ comparison: "greater" | "less" | "equal";
237
+ action: "alert" | "pause" | "stop";
238
+ }[];
239
+ stopRules: {
240
+ metric: string;
241
+ condition: string;
242
+ action: "stop" | "pause";
243
+ }[];
244
+ analysisConfig: {
245
+ confidenceLevel: number;
246
+ minimumSampleSize: number;
247
+ testType: "two-tailed" | "one-tailed";
248
+ };
249
+ status: import("@lovelybunch/types").ExperimentStatus;
250
+ startedAt?: string;
251
+ endedAt?: string;
252
+ }[];
253
+ telemetryContracts: {
254
+ eventName: string;
255
+ version: string;
256
+ schema: {
257
+ [x: string]: any;
258
+ };
259
+ piiFields: {
260
+ field: string;
261
+ classification: "none" | "quasi" | "sensitive" | "highly-sensitive";
262
+ handling: "clear" | "hash" | "encrypt" | "remove";
263
+ }[];
264
+ samplingRate: number;
265
+ retentionPolicy: {
266
+ duration: number;
267
+ archiveAfter?: number;
268
+ deleteAfter: number;
269
+ };
270
+ approvals: {
271
+ approver: string;
272
+ approvedAt: string;
273
+ comment?: string;
274
+ }[];
275
+ }[];
276
+ releasePlan: {
277
+ strategy: "immediate" | "gradual" | "scheduled" | "gated";
278
+ stages?: {
279
+ name: string;
280
+ percentage: number;
281
+ duration?: number;
282
+ criteria?: string[];
283
+ }[];
284
+ schedule?: string;
285
+ rollbackPlan?: string;
286
+ };
287
+ status: import("@lovelybunch/types").CPStatus;
288
+ metadata: {
289
+ createdAt: string;
290
+ updatedAt: string;
291
+ reviewers: string[];
292
+ aiInteractions: {
293
+ id: string;
294
+ timestamp: string;
295
+ model: string;
296
+ prompt: string;
297
+ response: string;
298
+ tokens: {
299
+ prompt: number;
300
+ completion: number;
301
+ total: number;
302
+ };
303
+ cost?: number;
304
+ }[];
305
+ tags?: string[];
306
+ priority?: "low" | "medium" | "high" | "critical";
307
+ };
308
+ };
309
+ }, 201, "json">) | (Response & import("hono").TypedResponse<{
310
+ success: false;
311
+ error: {
312
+ code: string;
313
+ message: any;
314
+ };
315
+ }, 500, "json">)>;
@@ -0,0 +1,129 @@
1
+ import { FileStorageAdapter } from '../../../../lib/storage/file-storage.js';
2
+ import { getAuthorInfo } from '../../../../lib/user-preferences.js';
3
+ import Fuse from 'fuse.js';
4
+ import { getLogger } from '@lovelybunch/core/logging';
5
+ import { getSlackService } from '../../../../lib/slack/slack-service.js';
6
+ const storage = new FileStorageAdapter();
7
+ // Logger is lazily initialized inside handlers to use server config
8
+ export async function GET(c) {
9
+ try {
10
+ const url = new URL(c.req.url);
11
+ const searchParams = url.searchParams;
12
+ const status = searchParams.get('status');
13
+ const author = searchParams.get('author');
14
+ const priority = searchParams.get('priority');
15
+ const tags = searchParams.get('tags')?.split(',');
16
+ const searchQuery = searchParams.get('q'); // Add search query parameter
17
+ let proposals = await storage.listCPs({
18
+ status,
19
+ author: author || undefined,
20
+ priority: priority || undefined,
21
+ tags
22
+ });
23
+ // Apply search filter if provided
24
+ if (searchQuery?.trim()) {
25
+ const fuse = new Fuse(proposals, {
26
+ keys: [
27
+ { name: 'intent', weight: 0.4 },
28
+ { name: 'id', weight: 0.3 },
29
+ { name: 'author.name', weight: 0.2 },
30
+ { name: 'metadata.tags', weight: 0.1 }
31
+ ],
32
+ threshold: 0.3,
33
+ includeScore: true
34
+ });
35
+ const searchResults = fuse.search(searchQuery);
36
+ proposals = searchResults.map(result => result.item);
37
+ }
38
+ return c.json({
39
+ success: true,
40
+ data: proposals
41
+ });
42
+ }
43
+ catch (error) {
44
+ console.error('Error listing proposals:', error);
45
+ return c.json({
46
+ success: false,
47
+ error: {
48
+ code: 'LIST_PROPOSALS_ERROR',
49
+ message: error.message
50
+ }
51
+ }, 500);
52
+ }
53
+ }
54
+ export async function POST(c) {
55
+ try {
56
+ const body = await c.req.json();
57
+ // Get author info from saved preferences if not provided
58
+ const authorInfo = await getAuthorInfo();
59
+ // Create a new proposal with required fields
60
+ const now = new Date();
61
+ const proposal = {
62
+ id: body.id || `cp-${Date.now()}`,
63
+ intent: body.intent,
64
+ content: body.content,
65
+ author: body.author || {
66
+ id: 'current-user',
67
+ name: authorInfo.name,
68
+ email: authorInfo.email,
69
+ role: 'engineer',
70
+ type: 'human'
71
+ },
72
+ planSteps: body.planSteps || [],
73
+ evidence: body.evidence || [],
74
+ policies: body.policies || [],
75
+ featureFlags: body.featureFlags || [],
76
+ experiments: body.experiments || [],
77
+ telemetryContracts: body.telemetryContracts || [],
78
+ releasePlan: body.releasePlan || { strategy: 'immediate' },
79
+ status: body.status || 'draft',
80
+ metadata: {
81
+ createdAt: now,
82
+ updatedAt: now,
83
+ reviewers: body.metadata?.reviewers || [],
84
+ aiInteractions: body.metadata?.aiInteractions || [],
85
+ tags: body.metadata?.tags || [],
86
+ priority: body.metadata?.priority || 'medium'
87
+ },
88
+ productSpecRef: body.productSpecRef
89
+ };
90
+ await storage.createCP(proposal);
91
+ // Log the proposal creation event
92
+ const logger = getLogger();
93
+ logger.log({
94
+ kind: 'proposal.create',
95
+ actor: proposal.author.type === 'agent'
96
+ ? `agent:${proposal.author.name}`
97
+ : `human:${proposal.author.email}`,
98
+ subject: `proposal:${proposal.id}`,
99
+ tags: ['proposal'],
100
+ payload: {
101
+ id: proposal.id,
102
+ intent: proposal.intent,
103
+ priority: proposal.metadata.priority,
104
+ author: proposal.author
105
+ }
106
+ });
107
+ // Send Slack notification (non-blocking)
108
+ getSlackService().sendNotification({
109
+ type: 'proposal.created',
110
+ proposalId: proposal.id,
111
+ intent: proposal.intent,
112
+ author: proposal.author.name,
113
+ }).catch(err => console.warn('[proposals] Slack notification failed:', err));
114
+ return c.json({
115
+ success: true,
116
+ data: proposal
117
+ }, 201);
118
+ }
119
+ catch (error) {
120
+ console.error('Error creating proposal:', error);
121
+ return c.json({
122
+ success: false,
123
+ error: {
124
+ code: 'CREATE_PROPOSAL_ERROR',
125
+ message: error.message
126
+ }
127
+ }, 500);
128
+ }
129
+ }
@@ -0,0 +1,3 @@
1
+ import { Hono } from 'hono';
2
+ declare const create: Hono<import("hono/types").BlankEnv, import("hono/types").BlankSchema, "/">;
3
+ export default create;
@@ -0,0 +1,5 @@
1
+ import { Hono } from 'hono';
2
+ import { POST } from './route.js';
3
+ const create = new Hono();
4
+ create.post('/', POST);
5
+ export default create;
@@ -0,0 +1,10 @@
1
+ import { Context } from 'hono';
2
+ export declare function POST(c: Context): Promise<(Response & import("hono").TypedResponse<{
3
+ error: string;
4
+ }, 400, "json">) | (Response & import("hono").TypedResponse<{
5
+ sessionId: string;
6
+ proposalId: string;
7
+ createdAt: string;
8
+ }, import("hono/utils/http-status").ContentfulStatusCode, "json">) | (Response & import("hono").TypedResponse<{
9
+ error: string;
10
+ }, 500, "json">)>;
@@ -0,0 +1,27 @@
1
+ import { getGlobalTerminalManager } from '../../../../../../lib/terminal/global-manager.js';
2
+ import { loadUserSettings } from '../../../../../../lib/user-preferences.js';
3
+ export async function POST(c) {
4
+ try {
5
+ const proposalId = c.req.param('proposalId');
6
+ const body = await c.req.json().catch(() => ({}));
7
+ const { enableLogging = false, startupCommand } = body;
8
+ if (!proposalId) {
9
+ return c.json({ error: 'Proposal ID is required' }, 400);
10
+ }
11
+ // Load user settings to get shell preference
12
+ const userSettings = await loadUserSettings();
13
+ const shellPreference = (userSettings.preferences.terminalShell || 'bash');
14
+ // Create a new terminal session for this proposal
15
+ const terminalManager = getGlobalTerminalManager();
16
+ const session = await terminalManager.createSession(proposalId, enableLogging, shellPreference, startupCommand);
17
+ return c.json({
18
+ sessionId: session.id,
19
+ proposalId: session.proposalId,
20
+ createdAt: session.createdAt,
21
+ });
22
+ }
23
+ catch (error) {
24
+ console.error('Error creating terminal session:', error);
25
+ return c.json({ error: 'Failed to create terminal session' }, 500);
26
+ }
27
+ }
@@ -0,0 +1,3 @@
1
+ import { Hono } from 'hono';
2
+ declare const app: Hono<import("hono/types").BlankEnv, import("hono/types").BlankSchema, "/">;
3
+ export default app;
@@ -0,0 +1,5 @@
1
+ import { Hono } from 'hono';
2
+ import { POST } from './route.js';
3
+ const app = new Hono();
4
+ app.post('/', POST);
5
+ export default app;
@@ -0,0 +1,10 @@
1
+ import { Context } from 'hono';
2
+ export declare function POST(c: Context): Promise<(Response & import("hono").TypedResponse<{
3
+ error: string;
4
+ }, 400, "json">) | (Response & import("hono").TypedResponse<{
5
+ error: string;
6
+ }, 404, "json">) | (Response & import("hono").TypedResponse<{
7
+ success: true;
8
+ }, import("hono/utils/http-status").ContentfulStatusCode, "json">) | (Response & import("hono").TypedResponse<{
9
+ error: string;
10
+ }, 500, "json">)>;
@@ -0,0 +1,21 @@
1
+ import { getGlobalTerminalManager } from '../../../../../../lib/terminal/global-manager.js';
2
+ export async function POST(c) {
3
+ try {
4
+ const proposalId = c.req.param('proposalId');
5
+ const body = await c.req.json();
6
+ const { sessionId } = body;
7
+ if (!sessionId) {
8
+ return c.json({ error: 'Session ID is required' }, 400);
9
+ }
10
+ const terminalManager = getGlobalTerminalManager();
11
+ const success = terminalManager.destroySession(sessionId);
12
+ if (!success) {
13
+ return c.json({ error: 'Session not found' }, 404);
14
+ }
15
+ return c.json({ success: true });
16
+ }
17
+ catch (error) {
18
+ console.error('Error destroying terminal session:', error);
19
+ return c.json({ error: 'Failed to destroy terminal session' }, 500);
20
+ }
21
+ }
@@ -0,0 +1,3 @@
1
+ import { Hono } from 'hono';
2
+ declare const app: Hono<import("hono/types").BlankEnv, import("hono/types").BlankSchema, "/">;
3
+ export default app;
@@ -0,0 +1,5 @@
1
+ import { Hono } from 'hono';
2
+ import { POST } from './route.js';
3
+ const app = new Hono();
4
+ app.post('/', POST);
5
+ export default app;
@@ -0,0 +1,10 @@
1
+ import { Context } from 'hono';
2
+ export declare function POST(c: Context): Promise<(Response & import("hono").TypedResponse<{
3
+ error: string;
4
+ }, 400, "json">) | (Response & import("hono").TypedResponse<{
5
+ error: string;
6
+ }, 404, "json">) | (Response & import("hono").TypedResponse<{
7
+ success: true;
8
+ }, import("hono/utils/http-status").ContentfulStatusCode, "json">) | (Response & import("hono").TypedResponse<{
9
+ error: string;
10
+ }, 500, "json">)>;
@@ -0,0 +1,21 @@
1
+ import { getGlobalTerminalManager } from '../../../../../../lib/terminal/global-manager.js';
2
+ export async function POST(c) {
3
+ try {
4
+ const proposalId = c.req.param('proposalId');
5
+ const body = await c.req.json();
6
+ const { sessionId, cols, rows } = body;
7
+ if (!sessionId || !cols || !rows) {
8
+ return c.json({ error: 'Session ID, cols, and rows are required' }, 400);
9
+ }
10
+ const terminalManager = getGlobalTerminalManager();
11
+ const success = terminalManager.resizeSession(sessionId, cols, rows);
12
+ if (!success) {
13
+ return c.json({ error: 'Session not found or resize failed' }, 404);
14
+ }
15
+ return c.json({ success: true });
16
+ }
17
+ catch (error) {
18
+ console.error('Error resizing terminal session:', error);
19
+ return c.json({ error: 'Failed to resize terminal session' }, 500);
20
+ }
21
+ }
@@ -111,14 +111,6 @@ export async function POST(c) {
111
111
  // Continue without worktree
112
112
  }
113
113
  }
114
- // Create terminal session
115
- const userSettings = await loadUserSettings();
116
- const shellPreference = (userSettings.preferences.terminalShell || 'bash');
117
- const startupCommand = worktreePath
118
- ? `cd '${worktreePath.replace(/'/g, "'\\''")}'`
119
- : undefined;
120
- const terminalManager = getGlobalTerminalManager();
121
- const session = await terminalManager.createSession(taskId, shellPreference, startupCommand);
122
114
  // Load MCP servers and skills
123
115
  const { servers: selectedMcpServers, mcpServersMap } = await loadMcpServers();
124
116
  const { skills, ids: selectedSkillIds } = await loadSkills();
@@ -143,14 +135,15 @@ export async function POST(c) {
143
135
  const banner = buildPipelineBanner({ taskId, cliAgent: agent, contextType, interactive });
144
136
  const exitSuffix = interactive ? '' : '; exit';
145
137
  const command = `printf '${banner}' && node ${scriptPath}${exitSuffix}`;
146
- // Send the command to the terminal session after a brief delay for shell init
147
- setTimeout(() => {
148
- const s = terminalManager.getSession(session.id);
149
- if (s?.pty) {
150
- s.pty.write(command + '\r');
151
- s.lastActivity = new Date();
152
- }
153
- }, 1500);
138
+ // Create terminal session with the pipeline command as a startup command
139
+ // so it runs via GAIT_STARTUP_CMD during shell init (same as the web UI path).
140
+ const userSettings = await loadUserSettings();
141
+ const shellPreference = (userSettings.preferences.terminalShell || 'bash');
142
+ const startupCommand = worktreePath
143
+ ? `cd '${worktreePath.replace(/'/g, "'\\''")}' && ${command}`
144
+ : command;
145
+ const terminalManager = getGlobalTerminalManager();
146
+ const session = await terminalManager.createSession(taskId, shellPreference, startupCommand);
154
147
  return c.json({
155
148
  sessionId: session.id,
156
149
  taskId: session.taskId,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lovelybunch/api",
3
- "version": "1.0.76-alpha.7",
3
+ "version": "1.0.76-alpha.8",
4
4
  "type": "module",
5
5
  "main": "dist/server-with-static.js",
6
6
  "exports": {
@@ -37,9 +37,9 @@
37
37
  "@ai-sdk/anthropic": "^3.0.41",
38
38
  "@hono/node-server": "^1.13.7",
39
39
  "@hono/node-ws": "^1.0.6",
40
- "@lovelybunch/core": "^1.0.76-alpha.7",
41
- "@lovelybunch/mcp": "^1.0.76-alpha.7",
42
- "@lovelybunch/types": "^1.0.76-alpha.7",
40
+ "@lovelybunch/core": "^1.0.76-alpha.8",
41
+ "@lovelybunch/mcp": "^1.0.76-alpha.8",
42
+ "@lovelybunch/types": "^1.0.76-alpha.8",
43
43
  "adm-zip": "^0.5.16",
44
44
  "ai": "^6.0.79",
45
45
  "bcryptjs": "^2.4.3",