@lovelybunch/api 1.0.76-alpha.8 → 1.0.76

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 (185) hide show
  1. package/dist/lib/git.d.ts +3 -0
  2. package/dist/lib/git.js +35 -0
  3. package/dist/routes/api/v1/ai/route.js +214 -152
  4. package/dist/routes/api/v1/config/route.js +13 -9
  5. package/dist/routes/api/v1/context/agents/route.js +159 -0
  6. package/dist/routes/api/v1/context/index.js +6 -4
  7. package/dist/routes/api/v1/context/memory/route.js +163 -0
  8. package/dist/routes/api/v1/context/team/route.js +159 -0
  9. package/dist/routes/api/v1/git/index.js +27 -1
  10. package/dist/routes/api/v1/jobs/[id]/route.d.ts +26 -32
  11. package/dist/routes/api/v1/jobs/[id]/route.js +3 -3
  12. package/dist/routes/api/v1/jobs/route.d.ts +33 -33
  13. package/dist/routes/api/v1/jobs/route.js +17 -2
  14. package/dist/routes/api/v1/mcp/index.js +194 -21
  15. package/dist/routes/api/v1/resources/generate/route.js +10 -3
  16. package/package.json +4 -4
  17. package/static/assets/ActivityPage-sJEQn6DK.js +1 -0
  18. package/static/assets/AgentsContextEditPage-DU3qIXk9.js +9 -0
  19. package/static/assets/AgentsContextPage-tJ-LhFYb.js +1 -0
  20. package/static/assets/{ApiKeysSettingsPage-BhaH6ZYP.js → ApiKeysSettingsPage-Bg84BQHV.js} +2 -2
  21. package/static/assets/{AuthSettingsPage-D0MQlHyh.js → AuthSettingsPage-Bwr7uP3z.js} +1 -1
  22. package/static/assets/{CallbackPage-Bz4m3_W8.js → CallbackPage-BFn0Np2S.js} +1 -1
  23. package/static/assets/CodePage-kp4s3wCJ.js +2 -0
  24. package/static/assets/{CollapsibleSection-CxX11hr-.js → CollapsibleSection-CNs1mvsZ.js} +1 -1
  25. package/static/assets/{DashboardPage-B3HR1UM7.js → DashboardPage-DMJSzzgD.js} +9 -19
  26. package/static/assets/{GitPage-Dm36PRw_.js → GitPage-uqene8zj.js} +3 -3
  27. package/static/assets/{GitSettingsPage-CRWcjgVI.js → GitSettingsPage-CLswbZsT.js} +2 -2
  28. package/static/assets/{IdentityPage-YCkmdyzR.js → IdentityPage-BDTPXEo7.js} +2 -2
  29. package/static/assets/{ImplementationStepsEditor-u3dPxmKW.js → ImplementationStepsEditor-D4cvhPhz.js} +2 -2
  30. package/static/assets/IntegrationsSettingsPage-o7NXZGt9.js +1 -0
  31. package/static/assets/JobDetailPage-DuEiPz6X.js +1 -0
  32. package/static/assets/KnowledgeDetailPage-DFVud_VC.js +1 -0
  33. package/static/assets/{KnowledgeEditPage-DhrF6UPg.js → KnowledgeEditPage-XG6HKK7E.js} +1 -1
  34. package/static/assets/{KnowledgePage-_gZhpTe3.js → KnowledgePage-B2zI3xwW.js} +2 -2
  35. package/static/assets/{LoginPage-Cc1Ac2j4.js → LoginPage-CUJRxwXy.js} +1 -1
  36. package/static/assets/MailInboxPage-BlCG-tba.js +1 -0
  37. package/static/assets/MailProcessingModal-BJIdHOqK.js +1 -0
  38. package/static/assets/MailReadPage-MoNo_gmW.js +1 -0
  39. package/static/assets/{MailSentPage-Dj63oQ5D.js → MailSentPage-QzpuIJmT.js} +1 -1
  40. package/static/assets/{McpSettingsPage-DYZ0QNbp.js → McpSettingsPage-BZcCGkGM.js} +1 -1
  41. package/static/assets/MemoryEditPage-DXSQoCT4.js +13 -0
  42. package/static/assets/MemoryPage-oBnyuvSf.js +1 -0
  43. package/static/assets/NewKnowledgePage-deMsezK8.js +1 -0
  44. package/static/assets/{NewSkillPage-BEn18f2A.js → NewSkillPage-DRYWdrlV.js} +1 -1
  45. package/static/assets/{NewTaskPage-CSlncpI5.js → NewTaskPage-B6xdic5_.js} +2 -2
  46. package/static/assets/{NotFoundPage-C4x0lGai.js → NotFoundPage-Bxu9uKFO.js} +1 -1
  47. package/static/assets/{NotificationsSettingsPage-C9YnfRlj.js → NotificationsSettingsPage-CLgtsCVM.js} +1 -1
  48. package/static/assets/{PromptsSettingsPage-Chc4da1S.js → PromptsSettingsPage-BWaELCjG.js} +1 -1
  49. package/static/assets/{ResourceDetailPage-DDYKQxpM.js → ResourceDetailPage-CMPDRdVM.js} +1 -1
  50. package/static/assets/ResourcesPage-DspYILfG.js +41 -0
  51. package/static/assets/{RoleEditPage-Ccfu1tn1.js → RoleEditPage-DXtzicVZ.js} +1 -1
  52. package/static/assets/{RolePage-CcdEUjSm.js → RolePage-DafGURGp.js} +1 -1
  53. package/static/assets/{RulesSettingsPage-Cz1g_eAj.js → RulesSettingsPage-E8V9cexV.js} +1 -1
  54. package/static/assets/RunDetailPage-DsxkqFst.js +1 -0
  55. package/static/assets/SchedulePage-B2YvNDHr.js +4 -0
  56. package/static/assets/{SkillDetailPage-sJg-L8A8.js → SkillDetailPage-CWkqSfuT.js} +1 -1
  57. package/static/assets/{SkillEditPage-BksV7GmD.js → SkillEditPage-DwyebzFV.js} +1 -1
  58. package/static/assets/{SkillsPage-CwarkJmZ.js → SkillsPage-CauK65X_.js} +2 -2
  59. package/static/assets/{SkillsSettingsPage-DTnBlBdE.js → SkillsSettingsPage-DXMRv3jR.js} +1 -1
  60. package/static/assets/{SourceInput-CWazIr6v.js → SourceInput-C0iKqbQ1.js} +1 -1
  61. package/static/assets/{TagInput-Bgyxb_JU.js → TagInput-Ct-WRvTs.js} +1 -1
  62. package/static/assets/{TaskDetailPage-DlmG1kZR.js → TaskDetailPage-CApk2iBh.js} +1 -1
  63. package/static/assets/{TaskEditPage-BnpNeed_.js → TaskEditPage-NgOVShfK.js} +1 -1
  64. package/static/assets/{TasksPage-CXeTMpgy.js → TasksPage-BoPrP_Rl.js} +3 -3
  65. package/static/assets/TeamEditPage-ChY6mYm8.js +9 -0
  66. package/static/assets/TeamPage-DH-dJhFG.js +1 -0
  67. package/static/assets/{TerminalPage-BLcPt381.js → TerminalPage-CRhcscF2.js} +1 -1
  68. package/static/assets/TerminalSessionPage-CSCQg2sn.js +3 -0
  69. package/static/assets/{UserPreferencesPage-BNwEqlRW.js → UserPreferencesPage-DxCSWJnS.js} +1 -1
  70. package/static/assets/{UserSettingsPage-BRafqkiD.js → UserSettingsPage-DKkOLNPV.js} +1 -1
  71. package/static/assets/UtilitiesPage-CBNSvixW.js +1 -0
  72. package/static/assets/{alert-Ci2-OWZ_.js → alert-Dw_RSroN.js} +1 -1
  73. package/static/assets/{arrow-down-C6Flf0DF.js → arrow-down-UClxXzT-.js} +1 -1
  74. package/static/assets/{arrow-left-7TCkaJlN.js → arrow-left-DWmf9YJp.js} +1 -1
  75. package/static/assets/{arrow-up-down-tqbfiBy6.js → arrow-up-down-Btc3okb3.js} +1 -1
  76. package/static/assets/{arrow-up-DeQAxOPq.js → arrow-up-fLCh7Hvh.js} +1 -1
  77. package/static/assets/{badge-D4vHU_w_.js → badge-vIqE5SOP.js} +1 -1
  78. package/static/assets/{browser-modal-BiaqhKHm.js → browser-modal-DgMJTsMd.js} +2 -2
  79. package/static/assets/{card-xkODbJy-.js → card-DPLdBoa5.js} +1 -1
  80. package/static/assets/{chevron-left-CvpfJBPQ.js → chevron-left-CiNaLX-v.js} +1 -1
  81. package/static/assets/{chevron-up-BB-6OS4z.js → chevron-up-DFd-7wxW.js} +1 -1
  82. package/static/assets/{chevrons-up-CLKrQHMU.js → chevrons-up-BfU70OcQ.js} +1 -1
  83. package/static/assets/{circle-alert-lnP0-w3N.js → circle-alert-Mv00T-P2.js} +1 -1
  84. package/static/assets/{circle-check-big-Dbo-OmWQ.js → circle-check-big-BEY1IoIP.js} +1 -1
  85. package/static/assets/{circle-check-BPkEav83.js → circle-check-xMiP6SLO.js} +1 -1
  86. package/static/assets/{circle-play-BbtBIeo3.js → circle-play-iZZwaGbV.js} +1 -1
  87. package/static/assets/{circle-x-BBwi8e5G.js → circle-x-z3iynaE7.js} +1 -1
  88. package/static/assets/{clipboard-Ce816tAO.js → clipboard-C8wZRPDH.js} +1 -1
  89. package/static/assets/{clock-BIeoO5Mt.js → clock-C_9shc08.js} +1 -1
  90. package/static/assets/{code-DTW3giBe.js → code-DH-sRhus.js} +1 -1
  91. package/static/assets/{download-BgKxfry9.js → download-CE8b59ER.js} +1 -1
  92. package/static/assets/{external-link--RjKXREe.js → external-link-DPyKt8NE.js} +1 -1
  93. package/static/assets/{eye--K-OgK7L.js → eye-BpGD-yoS.js} +1 -1
  94. package/static/assets/{folder-git-2-Bgv7r0zC.js → folder-git-2-BIw4zbmy.js} +1 -1
  95. package/static/assets/globe-CUo7eHKN.js +6 -0
  96. package/static/assets/{index-Di7xMYoG.js → index-B07hel4U.js} +1 -1
  97. package/static/assets/{index-DF_KNbKf.js → index-BCwmQxLC.js} +1 -1
  98. package/static/assets/{index-D9xZafJb.js → index-BOKaM9K-.js} +1 -1
  99. package/static/assets/{index-Cd5hBt4x.js → index-BaR4iUzg.js} +1 -1
  100. package/static/assets/index-BcCuKdbf.css +1 -0
  101. package/static/assets/{index-Db5-BoCU.js → index-Bfb3OTwj.js} +1 -1
  102. package/static/assets/{index-Do92mBFr.js → index-Bkt1rQVV.js} +1 -1
  103. package/static/assets/{index-BD9UBXsr.js → index-C65b3D5_.js} +1 -1
  104. package/static/assets/{index-BbrX1XcC.js → index-CGbmjmEy.js} +1 -1
  105. package/static/assets/{index-4RuWYO4M.js → index-CTouvf2d.js} +1 -1
  106. package/static/assets/{index-Dt_WtbUU.js → index-Cdwx6Zps.js} +1 -1
  107. package/static/assets/{index-iIFwHD3L.js → index-ClO9-JVh.js} +1 -1
  108. package/static/assets/{index-BteQHbZ1.js → index-CpJ0uBf3.js} +1 -1
  109. package/static/assets/{index-LMsLdXw_.js → index-CsBxEWw5.js} +1 -1
  110. package/static/assets/{index-CW9pK_cZ.js → index-DZAYfTI2.js} +1 -1
  111. package/static/assets/{index-BkEdELOI.js → index-Dkr9CBL7.js} +1 -1
  112. package/static/assets/{index-BQYB8kWb.js → index-DnZKG-_7.js} +1 -1
  113. package/static/assets/index-UXL5-kaP.js +497 -0
  114. package/static/assets/{index-Ch4GVR8L.js → index-iB8oed57.js} +1 -1
  115. package/static/assets/{index-R44k73Ca.js → index-jaRIZ6SY.js} +1 -1
  116. package/static/assets/{info-DgZN3xWF.js → info-D-UNBNx2.js} +1 -1
  117. package/static/assets/{label-DvPENm3h.js → label-8VKluf9w.js} +1 -1
  118. package/static/assets/{markdown-editor-DpZxV-fa.js → markdown-editor-DBdRsbP2.js} +3 -3
  119. package/static/assets/{message-square-CoaQYehb.js → message-square-CO8kDUed.js} +1 -1
  120. package/static/assets/{paperclip-ChugoOAp.js → paperclip-DlLXZbru.js} +1 -1
  121. package/static/assets/{pause-m9YcgxdE.js → pause-zSiaxJBu.js} +1 -1
  122. package/static/assets/{play-DtFz_MLh.js → play-DVBhRokt.js} +1 -1
  123. package/static/assets/{radio-group-C5Te9bVb.js → radio-group-CThYUcA4.js} +1 -1
  124. package/static/assets/{refresh-cw-B1bWW9Rg.js → refresh-cw-tXYl1ePu.js} +1 -1
  125. package/static/assets/{search-CPOHeeUa.js → search-BxF7Wwex.js} +1 -1
  126. package/static/assets/{select-B1v2u6hQ.js → select-CyHFRA1Y.js} +1 -1
  127. package/static/assets/server-lRxThHjr.js +6 -0
  128. package/static/assets/{switch-Bf1Cq3P6.js → switch-BUpDbrux.js} +1 -1
  129. package/static/assets/tabs-DkvCmQEX.js +1 -0
  130. package/static/assets/{tag-Cz4z82t0.js → tag-CkcZNLnh.js} +1 -1
  131. package/static/assets/{terminal-preview-DTUohQ5b.js → terminal-preview-CLWDhoOZ.js} +1 -1
  132. package/static/assets/triangle-alert-CmjG_mbF.js +6 -0
  133. package/static/assets/{use-terminal-CFbQv1ie.js → use-terminal-D3iV7-iC.js} +1 -1
  134. package/static/assets/{video-B6ZJ-Epb.js → video-CY_dOujm.js} +1 -1
  135. package/static/index.html +2 -2
  136. package/dist/lib/mcp-client.d.ts +0 -39
  137. package/dist/lib/mcp-client.js +0 -131
  138. package/dist/routes/api/v1/ai/tools.d.ts +0 -17
  139. package/dist/routes/api/v1/ai/tools.js +0 -931
  140. package/dist/routes/api/v1/context/knowledge/[filename]/index.d.ts +0 -1
  141. package/dist/routes/api/v1/context/knowledge/[filename]/index.js +0 -1
  142. package/dist/routes/api/v1/context/knowledge/[filename]/route.js +0 -254
  143. package/dist/routes/api/v1/context/knowledge/index.d.ts +0 -1
  144. package/dist/routes/api/v1/context/knowledge/index.js +0 -1
  145. package/dist/routes/api/v1/context/knowledge/route.js +0 -176
  146. package/dist/routes/api/v1/proposals/[id]/route.d.ts +0 -337
  147. package/dist/routes/api/v1/proposals/[id]/route.js +0 -165
  148. package/dist/routes/api/v1/proposals/index.d.ts +0 -3
  149. package/dist/routes/api/v1/proposals/index.js +0 -10
  150. package/dist/routes/api/v1/proposals/route.d.ts +0 -315
  151. package/dist/routes/api/v1/proposals/route.js +0 -129
  152. package/dist/routes/api/v1/terminal/[proposalId]/create/index.d.ts +0 -3
  153. package/dist/routes/api/v1/terminal/[proposalId]/create/index.js +0 -5
  154. package/dist/routes/api/v1/terminal/[proposalId]/create/route.d.ts +0 -10
  155. package/dist/routes/api/v1/terminal/[proposalId]/create/route.js +0 -27
  156. package/dist/routes/api/v1/terminal/[proposalId]/destroy/index.js +0 -5
  157. package/dist/routes/api/v1/terminal/[proposalId]/destroy/route.d.ts +0 -10
  158. package/dist/routes/api/v1/terminal/[proposalId]/destroy/route.js +0 -21
  159. package/dist/routes/api/v1/terminal/[proposalId]/resize/index.d.ts +0 -3
  160. package/dist/routes/api/v1/terminal/[proposalId]/resize/index.js +0 -5
  161. package/dist/routes/api/v1/terminal/[proposalId]/resize/route.d.ts +0 -10
  162. package/dist/routes/api/v1/terminal/[proposalId]/resize/route.js +0 -21
  163. package/static/assets/ActivityPage-uL-Qknui.js +0 -1
  164. package/static/assets/ArchitectureEditPage-BWKyKi3T.js +0 -21
  165. package/static/assets/ArchitecturePage-Dtm0OAac.js +0 -1
  166. package/static/assets/CodePage-BuO2K_xx.js +0 -2
  167. package/static/assets/IntegrationsSettingsPage-Z8xCUmX9.js +0 -1
  168. package/static/assets/JobDetailPage-B8Za82RA.js +0 -1
  169. package/static/assets/KnowledgeDetailPage-CR9c4_WD.js +0 -1
  170. package/static/assets/MailInboxPage-B_h1Kz4D.js +0 -1
  171. package/static/assets/MailProcessingModal-D_qEwqmL.js +0 -6
  172. package/static/assets/MailReadPage-_q-xk_cX.js +0 -1
  173. package/static/assets/NewKnowledgePage-BEVMYnKG.js +0 -9
  174. package/static/assets/ProjectEditPage-X0-4mEAS.js +0 -11
  175. package/static/assets/ProjectPage-D8OX1GKt.js +0 -1
  176. package/static/assets/ResourcesPage-BmOpgt3L.js +0 -41
  177. package/static/assets/SchedulePage-CGxZHEL-.js +0 -4
  178. package/static/assets/TerminalSessionPage-CeAd8IAy.js +0 -8
  179. package/static/assets/UtilitiesPage-BPX_Unxu.js +0 -1
  180. package/static/assets/index-DH_vXhd4.css +0 -1
  181. package/static/assets/index-PyVlsLW8.js +0 -487
  182. package/static/assets/tabs-DAbCZiFC.js +0 -1
  183. /package/dist/routes/api/v1/context/{knowledge/[filename] → agents}/route.d.ts +0 -0
  184. /package/dist/routes/api/v1/context/{knowledge → memory}/route.d.ts +0 -0
  185. /package/dist/routes/api/v1/{terminal/[proposalId]/destroy/index.d.ts → context/team/route.d.ts} +0 -0
@@ -1,337 +0,0 @@
1
- import { Context } from 'hono';
2
- export declare function GET(c: Context): Promise<(Response & import("hono").TypedResponse<{
3
- success: false;
4
- error: {
5
- code: string;
6
- message: string;
7
- };
8
- }, 404, "json">) | (Response & import("hono").TypedResponse<{
9
- success: true;
10
- data: {
11
- id: string;
12
- intent: string;
13
- content?: string;
14
- author: {
15
- type: import("@lovelybunch/types").AuthorType;
16
- id: string;
17
- name: string;
18
- email?: string;
19
- };
20
- productSpecRef?: string;
21
- planSteps: {
22
- id: string;
23
- description: string;
24
- command?: string;
25
- expectedOutcome?: string;
26
- status: "pending" | "in-progress" | "completed" | "failed";
27
- output?: string;
28
- error?: string;
29
- executedAt?: string;
30
- }[];
31
- evidence: {
32
- type: "test" | "benchmark" | "screenshot" | "log" | "other";
33
- description: string;
34
- data: any;
35
- timestamp: string;
36
- }[];
37
- policies: {
38
- id: string;
39
- name: string;
40
- description: string;
41
- status: "pending" | "passed" | "failed" | "skipped";
42
- message?: string;
43
- checkedAt?: string;
44
- }[];
45
- featureFlags: {
46
- id: string;
47
- version: string;
48
- name: string;
49
- description: string;
50
- type: import("@lovelybunch/types").FeatureFlagType;
51
- defaultValue: any;
52
- scopes: string[];
53
- targets: {
54
- audience: string;
55
- value: any;
56
- percentage?: number;
57
- }[];
58
- killSwitch: boolean;
59
- dependencies: string[];
60
- createdAt: string;
61
- updatedAt: string;
62
- }[];
63
- experiments: {
64
- id: string;
65
- name: string;
66
- hypothesis: string;
67
- variants: {
68
- id: string;
69
- name: string;
70
- description: string;
71
- allocation: number;
72
- config: {
73
- [x: string]: any;
74
- };
75
- }[];
76
- allocation: {
77
- method: "random" | "deterministic" | "weighted";
78
- seed?: string;
79
- totalAllocation: number;
80
- };
81
- successMetrics: string[];
82
- guardrailMetrics: {
83
- name: string;
84
- threshold: number;
85
- comparison: "greater" | "less" | "equal";
86
- action: "alert" | "pause" | "stop";
87
- }[];
88
- stopRules: {
89
- metric: string;
90
- condition: string;
91
- action: "stop" | "pause";
92
- }[];
93
- analysisConfig: {
94
- confidenceLevel: number;
95
- minimumSampleSize: number;
96
- testType: "two-tailed" | "one-tailed";
97
- };
98
- status: import("@lovelybunch/types").ExperimentStatus;
99
- startedAt?: string;
100
- endedAt?: string;
101
- }[];
102
- telemetryContracts: {
103
- eventName: string;
104
- version: string;
105
- schema: {
106
- [x: string]: any;
107
- };
108
- piiFields: {
109
- field: string;
110
- classification: "none" | "quasi" | "sensitive" | "highly-sensitive";
111
- handling: "clear" | "hash" | "encrypt" | "remove";
112
- }[];
113
- samplingRate: number;
114
- retentionPolicy: {
115
- duration: number;
116
- archiveAfter?: number;
117
- deleteAfter: number;
118
- };
119
- approvals: {
120
- approver: string;
121
- approvedAt: string;
122
- comment?: string;
123
- }[];
124
- }[];
125
- releasePlan: {
126
- strategy: "immediate" | "gradual" | "scheduled" | "gated";
127
- stages?: {
128
- name: string;
129
- percentage: number;
130
- duration?: number;
131
- criteria?: string[];
132
- }[];
133
- schedule?: string;
134
- rollbackPlan?: string;
135
- };
136
- status: import("@lovelybunch/types").CPStatus;
137
- metadata: {
138
- createdAt: string;
139
- updatedAt: string;
140
- reviewers: string[];
141
- aiInteractions: {
142
- id: string;
143
- timestamp: string;
144
- model: string;
145
- prompt: string;
146
- response: string;
147
- tokens: {
148
- prompt: number;
149
- completion: number;
150
- total: number;
151
- };
152
- cost?: number;
153
- }[];
154
- tags?: string[];
155
- priority?: "low" | "medium" | "high" | "critical";
156
- };
157
- };
158
- }, import("hono/utils/http-status").ContentfulStatusCode, "json">) | (Response & import("hono").TypedResponse<{
159
- success: false;
160
- error: {
161
- code: string;
162
- message: any;
163
- };
164
- }, 500, "json">)>;
165
- export declare function PATCH(c: Context): Promise<(Response & import("hono").TypedResponse<{
166
- success: true;
167
- data: {
168
- id: string;
169
- intent: string;
170
- content?: string;
171
- author: {
172
- type: import("@lovelybunch/types").AuthorType;
173
- id: string;
174
- name: string;
175
- email?: string;
176
- };
177
- productSpecRef?: string;
178
- planSteps: {
179
- id: string;
180
- description: string;
181
- command?: string;
182
- expectedOutcome?: string;
183
- status: "pending" | "in-progress" | "completed" | "failed";
184
- output?: string;
185
- error?: string;
186
- executedAt?: string;
187
- }[];
188
- evidence: {
189
- type: "test" | "benchmark" | "screenshot" | "log" | "other";
190
- description: string;
191
- data: any;
192
- timestamp: string;
193
- }[];
194
- policies: {
195
- id: string;
196
- name: string;
197
- description: string;
198
- status: "pending" | "passed" | "failed" | "skipped";
199
- message?: string;
200
- checkedAt?: string;
201
- }[];
202
- featureFlags: {
203
- id: string;
204
- version: string;
205
- name: string;
206
- description: string;
207
- type: import("@lovelybunch/types").FeatureFlagType;
208
- defaultValue: any;
209
- scopes: string[];
210
- targets: {
211
- audience: string;
212
- value: any;
213
- percentage?: number;
214
- }[];
215
- killSwitch: boolean;
216
- dependencies: string[];
217
- createdAt: string;
218
- updatedAt: string;
219
- }[];
220
- experiments: {
221
- id: string;
222
- name: string;
223
- hypothesis: string;
224
- variants: {
225
- id: string;
226
- name: string;
227
- description: string;
228
- allocation: number;
229
- config: {
230
- [x: string]: any;
231
- };
232
- }[];
233
- allocation: {
234
- method: "random" | "deterministic" | "weighted";
235
- seed?: string;
236
- totalAllocation: number;
237
- };
238
- successMetrics: string[];
239
- guardrailMetrics: {
240
- name: string;
241
- threshold: number;
242
- comparison: "greater" | "less" | "equal";
243
- action: "alert" | "pause" | "stop";
244
- }[];
245
- stopRules: {
246
- metric: string;
247
- condition: string;
248
- action: "stop" | "pause";
249
- }[];
250
- analysisConfig: {
251
- confidenceLevel: number;
252
- minimumSampleSize: number;
253
- testType: "two-tailed" | "one-tailed";
254
- };
255
- status: import("@lovelybunch/types").ExperimentStatus;
256
- startedAt?: string;
257
- endedAt?: string;
258
- }[];
259
- telemetryContracts: {
260
- eventName: string;
261
- version: string;
262
- schema: {
263
- [x: string]: any;
264
- };
265
- piiFields: {
266
- field: string;
267
- classification: "none" | "quasi" | "sensitive" | "highly-sensitive";
268
- handling: "clear" | "hash" | "encrypt" | "remove";
269
- }[];
270
- samplingRate: number;
271
- retentionPolicy: {
272
- duration: number;
273
- archiveAfter?: number;
274
- deleteAfter: number;
275
- };
276
- approvals: {
277
- approver: string;
278
- approvedAt: string;
279
- comment?: string;
280
- }[];
281
- }[];
282
- releasePlan: {
283
- strategy: "immediate" | "gradual" | "scheduled" | "gated";
284
- stages?: {
285
- name: string;
286
- percentage: number;
287
- duration?: number;
288
- criteria?: string[];
289
- }[];
290
- schedule?: string;
291
- rollbackPlan?: string;
292
- };
293
- status: import("@lovelybunch/types").CPStatus;
294
- metadata: {
295
- createdAt: string;
296
- updatedAt: string;
297
- reviewers: string[];
298
- aiInteractions: {
299
- id: string;
300
- timestamp: string;
301
- model: string;
302
- prompt: string;
303
- response: string;
304
- tokens: {
305
- prompt: number;
306
- completion: number;
307
- total: number;
308
- };
309
- cost?: number;
310
- }[];
311
- tags?: string[];
312
- priority?: "low" | "medium" | "high" | "critical";
313
- };
314
- };
315
- }, import("hono/utils/http-status").ContentfulStatusCode, "json">) | (Response & import("hono").TypedResponse<{
316
- success: false;
317
- error: {
318
- code: string;
319
- message: any;
320
- };
321
- }, 404, "json">) | (Response & import("hono").TypedResponse<{
322
- success: false;
323
- error: {
324
- code: string;
325
- message: any;
326
- };
327
- }, 500, "json">)>;
328
- export declare function DELETE(c: Context): Promise<(Response & import("hono").TypedResponse<{
329
- success: true;
330
- message: string;
331
- }, import("hono/utils/http-status").ContentfulStatusCode, "json">) | (Response & import("hono").TypedResponse<{
332
- success: false;
333
- error: {
334
- code: string;
335
- message: any;
336
- };
337
- }, 500, "json">)>;
@@ -1,165 +0,0 @@
1
- import { FileStorageAdapter } from '../../../../../lib/storage/file-storage.js';
2
- import { getLogger } from '@lovelybunch/core/logging';
3
- import { getSlackService } from '../../../../../lib/slack/slack-service.js';
4
- const storage = new FileStorageAdapter();
5
- // Logger is lazily initialized inside handlers to use server config
6
- export async function GET(c) {
7
- try {
8
- const id = c.req.param('id');
9
- const proposal = await storage.getCP(id);
10
- if (!proposal) {
11
- return c.json({
12
- success: false,
13
- error: {
14
- code: 'PROPOSAL_NOT_FOUND',
15
- message: `Proposal with id ${id} not found`
16
- }
17
- }, 404);
18
- }
19
- return c.json({
20
- success: true,
21
- data: proposal
22
- });
23
- }
24
- catch (error) {
25
- console.error('Error getting proposal:', error);
26
- return c.json({
27
- success: false,
28
- error: {
29
- code: 'GET_PROPOSAL_ERROR',
30
- message: error.message
31
- }
32
- }, 500);
33
- }
34
- }
35
- export async function PATCH(c) {
36
- try {
37
- const id = c.req.param('id');
38
- const updates = await c.req.json();
39
- // Get existing proposal to merge updates properly
40
- const existing = await storage.getCP(id);
41
- if (!existing) {
42
- return c.json({
43
- success: false,
44
- error: {
45
- code: 'PROPOSAL_NOT_FOUND',
46
- message: `Proposal with id ${id} not found`
47
- }
48
- }, 404);
49
- }
50
- // Handle special fields like comments
51
- let finalUpdates = { ...updates };
52
- if (updates.comments) {
53
- finalUpdates = { ...finalUpdates, comments: updates.comments };
54
- }
55
- await storage.updateCP(id, finalUpdates);
56
- // Fetch the updated proposal
57
- const updatedProposal = await storage.getCP(id);
58
- // Determine what changed
59
- const changedFields = Object.keys(updates);
60
- const oldStatus = existing.status;
61
- const newStatus = updatedProposal?.status || existing.status;
62
- // Log proposal.update event
63
- const logger = getLogger();
64
- logger.log({
65
- kind: 'proposal.update',
66
- actor: updatedProposal?.author.type === 'agent'
67
- ? `agent:${updatedProposal.author.name}`
68
- : `human:${updatedProposal?.author.email || 'unknown'}`,
69
- subject: `proposal:${id}`,
70
- tags: ['proposal'],
71
- payload: {
72
- id,
73
- changes: changedFields,
74
- oldStatus,
75
- newStatus
76
- }
77
- });
78
- // If status changed, also log a status.change event
79
- if (oldStatus !== newStatus) {
80
- logger.log({
81
- kind: 'proposal.status.change',
82
- actor: updatedProposal?.author.type === 'agent'
83
- ? `agent:${updatedProposal.author.name}`
84
- : `human:${updatedProposal?.author.email || 'unknown'}`,
85
- subject: `proposal:${id}`,
86
- tags: ['proposal', 'status'],
87
- payload: {
88
- id,
89
- from: oldStatus,
90
- to: newStatus,
91
- reason: null
92
- }
93
- });
94
- // Send Slack notification for status change (non-blocking)
95
- getSlackService().sendNotification({
96
- type: 'proposal.statusChange',
97
- proposalId: id,
98
- intent: updatedProposal?.intent || existing.intent,
99
- status: newStatus,
100
- previousStatus: oldStatus,
101
- }).catch(err => console.warn('[proposals] Slack notification failed:', err));
102
- }
103
- return c.json({
104
- success: true,
105
- data: updatedProposal
106
- });
107
- }
108
- catch (error) {
109
- console.error('Error updating proposal:', error);
110
- if (error.message.includes('not found')) {
111
- return c.json({
112
- success: false,
113
- error: {
114
- code: 'PROPOSAL_NOT_FOUND',
115
- message: error.message
116
- }
117
- }, 404);
118
- }
119
- return c.json({
120
- success: false,
121
- error: {
122
- code: 'UPDATE_PROPOSAL_ERROR',
123
- message: error.message
124
- }
125
- }, 500);
126
- }
127
- }
128
- export async function DELETE(c) {
129
- try {
130
- const id = c.req.param('id');
131
- // Get proposal info before deleting
132
- const proposal = await storage.getCP(id);
133
- await storage.deleteCP(id);
134
- // Log the deletion event
135
- if (proposal) {
136
- const logger = getLogger();
137
- logger.log({
138
- kind: 'proposal.delete',
139
- actor: proposal.author.type === 'agent'
140
- ? `agent:${proposal.author.name}`
141
- : `human:${proposal.author.email || 'unknown'}`,
142
- subject: `proposal:${id}`,
143
- tags: ['proposal'],
144
- payload: {
145
- id,
146
- intent: proposal.intent
147
- }
148
- });
149
- }
150
- return c.json({
151
- success: true,
152
- message: `Proposal ${id} deleted successfully`
153
- });
154
- }
155
- catch (error) {
156
- console.error('Error deleting proposal:', error);
157
- return c.json({
158
- success: false,
159
- error: {
160
- code: 'DELETE_PROPOSAL_ERROR',
161
- message: error.message
162
- }
163
- }, 500);
164
- }
165
- }
@@ -1,3 +0,0 @@
1
- import { Hono } from 'hono';
2
- declare const proposals: Hono<import("hono/types").BlankEnv, import("hono/types").BlankSchema, "/">;
3
- export default proposals;
@@ -1,10 +0,0 @@
1
- import { Hono } from 'hono';
2
- import { GET, POST } from './route.js';
3
- import { GET as getProposal, PATCH as patchProposal, DELETE as deleteProposal } from './[id]/route.js';
4
- const proposals = new Hono();
5
- proposals.get('/', GET);
6
- proposals.post('/', POST);
7
- proposals.get('/:id', getProposal);
8
- proposals.patch('/:id', patchProposal);
9
- proposals.delete('/:id', deleteProposal);
10
- export default proposals;