polyergon 0.1.3 → 0.1.5

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 (139) hide show
  1. package/.next/BUILD_ID +1 -1
  2. package/.next/app-build-manifest.json +16 -16
  3. package/.next/app-path-routes-manifest.json +1 -1
  4. package/.next/build-manifest.json +8 -8
  5. package/.next/next-minimal-server.js.nft.json +1 -1
  6. package/.next/next-server.js.nft.json +1 -1
  7. package/.next/prerender-manifest.json +1 -1
  8. package/.next/react-loadable-manifest.json +3 -3
  9. package/.next/required-server-files.json +1 -1
  10. package/.next/server/app/_not-found/page.js +1 -1
  11. package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  12. package/.next/server/app/_not-found.html +1 -1
  13. package/.next/server/app/_not-found.rsc +1 -1
  14. package/.next/server/app/api/automations/existing/route.js +1 -1
  15. package/.next/server/app/api/backends/route.js +1 -1
  16. package/.next/server/app/api/diff/route.js +1 -1
  17. package/.next/server/app/api/limits/route.js +1 -1
  18. package/.next/server/app/api/meetings/[id]/route.js +1 -1
  19. package/.next/server/app/api/meetings/[id]/slack/route.js +2 -2
  20. package/.next/server/app/api/meetings/library/route.js +1 -1
  21. package/.next/server/app/api/meetings/route.js +1 -1
  22. package/.next/server/app/api/models/route.js +1 -1
  23. package/.next/server/app/api/notes/route.js +1 -1
  24. package/.next/server/app/api/orgs/[id]/route.js +1 -1
  25. package/.next/server/app/api/orgs/route.js +1 -1
  26. package/.next/server/app/api/pick-folder/route.js +1 -0
  27. package/.next/server/app/api/pick-folder/route.js.nft.json +1 -0
  28. package/.next/server/app/api/prs/inbox/route.js +1 -1
  29. package/.next/server/app/api/prs/refresh/route.js +1 -1
  30. package/.next/server/app/api/prs/route.js +1 -1
  31. package/.next/server/app/api/session-names/route.js +1 -1
  32. package/.next/server/app/api/sessions/[id]/route.js +1 -1
  33. package/.next/server/app/api/sessions/route.js +1 -1
  34. package/.next/server/app/api/settings/auth/route.js +1 -1
  35. package/.next/server/app/api/settings/route.js +1 -1
  36. package/.next/server/app/api/settings/transcription/local/route.js +1 -0
  37. package/.next/server/app/api/settings/transcription/local/route.js.nft.json +1 -0
  38. package/.next/server/app/api/settings/transcription/route.js +1 -1
  39. package/.next/server/app/api/skills/[name]/route.js +2 -2
  40. package/.next/server/app/api/skills/marketplace/route.js +2 -2
  41. package/.next/server/app/api/skills/route.js +2 -2
  42. package/.next/server/app/api/skills/view/route.js +2 -2
  43. package/.next/server/app/api/slack/channels/route.js +1 -1
  44. package/.next/server/app/api/slack/configured/route.js +1 -1
  45. package/.next/server/app/api/slack/inbox/route.js +1 -1
  46. package/.next/server/app/api/tasks/route.js +1 -1
  47. package/.next/server/app/api/usage/route.js +1 -1
  48. package/.next/server/app/demo/page.js +1 -1
  49. package/.next/server/app/demo/page.js.nft.json +1 -1
  50. package/.next/server/app/demo/page_client-reference-manifest.js +1 -1
  51. package/.next/server/app/demo.html +1 -1
  52. package/.next/server/app/demo.rsc +2 -2
  53. package/.next/server/app/favicon.ico/route.js +2 -2
  54. package/.next/server/app/index.html +1 -1
  55. package/.next/server/app/index.rsc +2 -2
  56. package/.next/server/app/page.js +3 -3
  57. package/.next/server/app/page.js.nft.json +1 -1
  58. package/.next/server/app/page_client-reference-manifest.js +1 -1
  59. package/.next/server/app-paths-manifest.json +20 -18
  60. package/.next/server/chunks/471.js +1 -1
  61. package/.next/server/chunks/474.js +1 -0
  62. package/.next/server/functions-config-manifest.json +1 -1
  63. package/.next/server/middleware-build-manifest.js +1 -1
  64. package/.next/server/middleware-react-loadable-manifest.js +1 -1
  65. package/.next/server/pages/404.html +1 -1
  66. package/.next/server/pages/500.html +1 -1
  67. package/.next/server/server-reference-manifest.json +1 -1
  68. package/.next/static/chunks/{235.aef4cdc783360b73.js → 235.ea131d1a8ad571fe.js} +1 -1
  69. package/.next/static/chunks/682-f14325e9764fa3ef.js +1 -0
  70. package/.next/static/chunks/app/demo/{page-e24d2d851b122ce4.js → page-2f850214701ce480.js} +1 -1
  71. package/.next/static/chunks/app/layout-3f109cf2eddaaad9.js +1 -0
  72. package/.next/static/chunks/app/page-dcbcf242a4a56fc7.js +1 -0
  73. package/.next/static/chunks/e868780c.3a02ccb3e7ac46be.js +18 -0
  74. package/.next/static/chunks/{main-e88dbd51c3bdafca.js → main-91e15570e34d95e9.js} +1 -1
  75. package/.next/static/chunks/{main-app-a2bdc70cbf8c2f8f.js → main-app-bfc83ad35f0351b5.js} +1 -1
  76. package/.next/static/chunks/webpack-e26c509879d51b83.js +1 -0
  77. package/.next/static/css/aea575e52126f68c.css +1 -0
  78. package/.next/static/css/ef597e1c0fb510ac.css +3 -0
  79. package/.next/trace +23 -23
  80. package/.next/types/app/api/automations/existing/route.ts +1 -1
  81. package/.next/types/app/api/backends/route.ts +1 -1
  82. package/.next/types/app/api/diff/route.ts +1 -1
  83. package/.next/types/app/api/limits/route.ts +1 -1
  84. package/.next/types/app/api/meetings/[id]/route.ts +1 -1
  85. package/.next/types/app/api/meetings/[id]/slack/route.ts +1 -1
  86. package/.next/types/app/api/meetings/library/route.ts +1 -1
  87. package/.next/types/app/api/meetings/route.ts +1 -1
  88. package/.next/types/app/api/models/route.ts +1 -1
  89. package/.next/types/app/api/notes/route.ts +1 -1
  90. package/.next/types/app/api/orgs/[id]/route.ts +1 -1
  91. package/.next/types/app/api/orgs/route.ts +1 -1
  92. package/.next/types/app/api/pick-folder/route.ts +343 -0
  93. package/.next/types/app/api/prs/inbox/route.ts +1 -1
  94. package/.next/types/app/api/prs/refresh/route.ts +1 -1
  95. package/.next/types/app/api/prs/route.ts +1 -1
  96. package/.next/types/app/api/session-names/route.ts +1 -1
  97. package/.next/types/app/api/sessions/[id]/route.ts +1 -1
  98. package/.next/types/app/api/sessions/route.ts +1 -1
  99. package/.next/types/app/api/settings/auth/route.ts +1 -1
  100. package/.next/types/app/api/settings/route.ts +1 -1
  101. package/.next/types/app/api/settings/transcription/local/route.ts +343 -0
  102. package/.next/types/app/api/settings/transcription/route.ts +1 -1
  103. package/.next/types/app/api/skills/[name]/route.ts +1 -1
  104. package/.next/types/app/api/skills/marketplace/route.ts +1 -1
  105. package/.next/types/app/api/skills/route.ts +1 -1
  106. package/.next/types/app/api/skills/view/route.ts +1 -1
  107. package/.next/types/app/api/slack/channels/route.ts +1 -1
  108. package/.next/types/app/api/slack/configured/route.ts +1 -1
  109. package/.next/types/app/api/slack/inbox/route.ts +1 -1
  110. package/.next/types/app/api/tasks/route.ts +1 -1
  111. package/.next/types/app/api/usage/route.ts +1 -1
  112. package/.next/types/app/demo/page.ts +1 -1
  113. package/.next/types/app/layout.ts +1 -1
  114. package/.next/types/app/page.ts +1 -1
  115. package/.server-dist/server.js +48 -11
  116. package/.server-dist/src/lib/backends.js +3 -1
  117. package/.server-dist/src/lib/localWhisper.js +80 -0
  118. package/.server-dist/src/lib/meetingConfig.js +10 -1
  119. package/.server-dist/src/lib/meetingManager.js +13 -6
  120. package/.server-dist/src/lib/pipelines.js +51 -9
  121. package/.server-dist/src/lib/ptyManager.js +47 -11
  122. package/.server-dist/src/lib/slackBridge.js +1 -0
  123. package/.server-dist/src/lib/slackWatchers.js +62 -13
  124. package/.server-dist/src/lib/transcriber.js +3 -0
  125. package/.server-dist/tsconfig.server.tsbuildinfo +1 -1
  126. package/README.md +10 -6
  127. package/bin/polyergon.js +3 -2
  128. package/next.config.mjs +5 -1
  129. package/package.json +3 -3
  130. package/.next/server/chunks/184.js +0 -1
  131. package/.next/static/chunks/30d07d85.9045c666bb43d9e1.js +0 -3
  132. package/.next/static/chunks/682-08ba9b4d06999826.js +0 -1
  133. package/.next/static/chunks/app/layout-ce855a341baa1cf0.js +0 -1
  134. package/.next/static/chunks/app/page-171aa51e1f0806f2.js +0 -1
  135. package/.next/static/chunks/webpack-1f89b7cb1fca69c4.js +0 -1
  136. package/.next/static/css/4e20bb95d8c93645.css +0 -3
  137. package/.next/static/css/ab3e4b0f5035257a.css +0 -1
  138. /package/.next/static/{9AcU9z7Eb-egTAbXHiQbG → DNZuK4bG0htvuqEt2cGuw}/_buildManifest.js +0 -0
  139. /package/.next/static/{9AcU9z7Eb-egTAbXHiQbG → DNZuK4bG0htvuqEt2cGuw}/_ssgManifest.js +0 -0
@@ -0,0 +1,343 @@
1
+ // File: /private/tmp/claude-503/-Users-ofiryehoshua/0b425a50-f3c5-49e8-a60e-788bd3aae351/scratchpad/rel5/src/app/api/settings/transcription/local/route.ts
2
+ import * as entry from '../../../../../../../src/app/api/settings/transcription/local/route.js'
3
+ import type { NextRequest } from 'next/server.js'
4
+
5
+ type TEntry = typeof import('../../../../../../../src/app/api/settings/transcription/local/route.js')
6
+
7
+ // Check that the entry is a valid entry
8
+ checkFields<Diff<{
9
+ GET?: Function
10
+ HEAD?: Function
11
+ OPTIONS?: Function
12
+ POST?: Function
13
+ PUT?: Function
14
+ DELETE?: Function
15
+ PATCH?: Function
16
+ config?: {}
17
+ generateStaticParams?: Function
18
+ revalidate?: RevalidateRange<TEntry> | false
19
+ dynamic?: 'auto' | 'force-dynamic' | 'error' | 'force-static'
20
+ dynamicParams?: boolean
21
+ fetchCache?: 'auto' | 'force-no-store' | 'only-no-store' | 'default-no-store' | 'default-cache' | 'only-cache' | 'force-cache'
22
+ preferredRegion?: 'auto' | 'global' | 'home' | string | string[]
23
+ runtime?: 'nodejs' | 'experimental-edge' | 'edge'
24
+ maxDuration?: number
25
+
26
+ }, TEntry, ''>>()
27
+
28
+ // Check the prop type of the entry function
29
+ if ('GET' in entry) {
30
+ checkFields<
31
+ Diff<
32
+ ParamCheck<Request | NextRequest>,
33
+ {
34
+ __tag__: 'GET'
35
+ __param_position__: 'first'
36
+ __param_type__: FirstArg<MaybeField<TEntry, 'GET'>>
37
+ },
38
+ 'GET'
39
+ >
40
+ >()
41
+ checkFields<
42
+ Diff<
43
+ ParamCheck<PageParams>,
44
+ {
45
+ __tag__: 'GET'
46
+ __param_position__: 'second'
47
+ __param_type__: SecondArg<MaybeField<TEntry, 'GET'>>
48
+ },
49
+ 'GET'
50
+ >
51
+ >()
52
+
53
+ checkFields<
54
+ Diff<
55
+ {
56
+ __tag__: 'GET',
57
+ __return_type__: Response | void | never | Promise<Response | void | never>
58
+ },
59
+ {
60
+ __tag__: 'GET',
61
+ __return_type__: ReturnType<MaybeField<TEntry, 'GET'>>
62
+ },
63
+ 'GET'
64
+ >
65
+ >()
66
+ }
67
+ // Check the prop type of the entry function
68
+ if ('HEAD' in entry) {
69
+ checkFields<
70
+ Diff<
71
+ ParamCheck<Request | NextRequest>,
72
+ {
73
+ __tag__: 'HEAD'
74
+ __param_position__: 'first'
75
+ __param_type__: FirstArg<MaybeField<TEntry, 'HEAD'>>
76
+ },
77
+ 'HEAD'
78
+ >
79
+ >()
80
+ checkFields<
81
+ Diff<
82
+ ParamCheck<PageParams>,
83
+ {
84
+ __tag__: 'HEAD'
85
+ __param_position__: 'second'
86
+ __param_type__: SecondArg<MaybeField<TEntry, 'HEAD'>>
87
+ },
88
+ 'HEAD'
89
+ >
90
+ >()
91
+
92
+ checkFields<
93
+ Diff<
94
+ {
95
+ __tag__: 'HEAD',
96
+ __return_type__: Response | void | never | Promise<Response | void | never>
97
+ },
98
+ {
99
+ __tag__: 'HEAD',
100
+ __return_type__: ReturnType<MaybeField<TEntry, 'HEAD'>>
101
+ },
102
+ 'HEAD'
103
+ >
104
+ >()
105
+ }
106
+ // Check the prop type of the entry function
107
+ if ('OPTIONS' in entry) {
108
+ checkFields<
109
+ Diff<
110
+ ParamCheck<Request | NextRequest>,
111
+ {
112
+ __tag__: 'OPTIONS'
113
+ __param_position__: 'first'
114
+ __param_type__: FirstArg<MaybeField<TEntry, 'OPTIONS'>>
115
+ },
116
+ 'OPTIONS'
117
+ >
118
+ >()
119
+ checkFields<
120
+ Diff<
121
+ ParamCheck<PageParams>,
122
+ {
123
+ __tag__: 'OPTIONS'
124
+ __param_position__: 'second'
125
+ __param_type__: SecondArg<MaybeField<TEntry, 'OPTIONS'>>
126
+ },
127
+ 'OPTIONS'
128
+ >
129
+ >()
130
+
131
+ checkFields<
132
+ Diff<
133
+ {
134
+ __tag__: 'OPTIONS',
135
+ __return_type__: Response | void | never | Promise<Response | void | never>
136
+ },
137
+ {
138
+ __tag__: 'OPTIONS',
139
+ __return_type__: ReturnType<MaybeField<TEntry, 'OPTIONS'>>
140
+ },
141
+ 'OPTIONS'
142
+ >
143
+ >()
144
+ }
145
+ // Check the prop type of the entry function
146
+ if ('POST' in entry) {
147
+ checkFields<
148
+ Diff<
149
+ ParamCheck<Request | NextRequest>,
150
+ {
151
+ __tag__: 'POST'
152
+ __param_position__: 'first'
153
+ __param_type__: FirstArg<MaybeField<TEntry, 'POST'>>
154
+ },
155
+ 'POST'
156
+ >
157
+ >()
158
+ checkFields<
159
+ Diff<
160
+ ParamCheck<PageParams>,
161
+ {
162
+ __tag__: 'POST'
163
+ __param_position__: 'second'
164
+ __param_type__: SecondArg<MaybeField<TEntry, 'POST'>>
165
+ },
166
+ 'POST'
167
+ >
168
+ >()
169
+
170
+ checkFields<
171
+ Diff<
172
+ {
173
+ __tag__: 'POST',
174
+ __return_type__: Response | void | never | Promise<Response | void | never>
175
+ },
176
+ {
177
+ __tag__: 'POST',
178
+ __return_type__: ReturnType<MaybeField<TEntry, 'POST'>>
179
+ },
180
+ 'POST'
181
+ >
182
+ >()
183
+ }
184
+ // Check the prop type of the entry function
185
+ if ('PUT' in entry) {
186
+ checkFields<
187
+ Diff<
188
+ ParamCheck<Request | NextRequest>,
189
+ {
190
+ __tag__: 'PUT'
191
+ __param_position__: 'first'
192
+ __param_type__: FirstArg<MaybeField<TEntry, 'PUT'>>
193
+ },
194
+ 'PUT'
195
+ >
196
+ >()
197
+ checkFields<
198
+ Diff<
199
+ ParamCheck<PageParams>,
200
+ {
201
+ __tag__: 'PUT'
202
+ __param_position__: 'second'
203
+ __param_type__: SecondArg<MaybeField<TEntry, 'PUT'>>
204
+ },
205
+ 'PUT'
206
+ >
207
+ >()
208
+
209
+ checkFields<
210
+ Diff<
211
+ {
212
+ __tag__: 'PUT',
213
+ __return_type__: Response | void | never | Promise<Response | void | never>
214
+ },
215
+ {
216
+ __tag__: 'PUT',
217
+ __return_type__: ReturnType<MaybeField<TEntry, 'PUT'>>
218
+ },
219
+ 'PUT'
220
+ >
221
+ >()
222
+ }
223
+ // Check the prop type of the entry function
224
+ if ('DELETE' in entry) {
225
+ checkFields<
226
+ Diff<
227
+ ParamCheck<Request | NextRequest>,
228
+ {
229
+ __tag__: 'DELETE'
230
+ __param_position__: 'first'
231
+ __param_type__: FirstArg<MaybeField<TEntry, 'DELETE'>>
232
+ },
233
+ 'DELETE'
234
+ >
235
+ >()
236
+ checkFields<
237
+ Diff<
238
+ ParamCheck<PageParams>,
239
+ {
240
+ __tag__: 'DELETE'
241
+ __param_position__: 'second'
242
+ __param_type__: SecondArg<MaybeField<TEntry, 'DELETE'>>
243
+ },
244
+ 'DELETE'
245
+ >
246
+ >()
247
+
248
+ checkFields<
249
+ Diff<
250
+ {
251
+ __tag__: 'DELETE',
252
+ __return_type__: Response | void | never | Promise<Response | void | never>
253
+ },
254
+ {
255
+ __tag__: 'DELETE',
256
+ __return_type__: ReturnType<MaybeField<TEntry, 'DELETE'>>
257
+ },
258
+ 'DELETE'
259
+ >
260
+ >()
261
+ }
262
+ // Check the prop type of the entry function
263
+ if ('PATCH' in entry) {
264
+ checkFields<
265
+ Diff<
266
+ ParamCheck<Request | NextRequest>,
267
+ {
268
+ __tag__: 'PATCH'
269
+ __param_position__: 'first'
270
+ __param_type__: FirstArg<MaybeField<TEntry, 'PATCH'>>
271
+ },
272
+ 'PATCH'
273
+ >
274
+ >()
275
+ checkFields<
276
+ Diff<
277
+ ParamCheck<PageParams>,
278
+ {
279
+ __tag__: 'PATCH'
280
+ __param_position__: 'second'
281
+ __param_type__: SecondArg<MaybeField<TEntry, 'PATCH'>>
282
+ },
283
+ 'PATCH'
284
+ >
285
+ >()
286
+
287
+ checkFields<
288
+ Diff<
289
+ {
290
+ __tag__: 'PATCH',
291
+ __return_type__: Response | void | never | Promise<Response | void | never>
292
+ },
293
+ {
294
+ __tag__: 'PATCH',
295
+ __return_type__: ReturnType<MaybeField<TEntry, 'PATCH'>>
296
+ },
297
+ 'PATCH'
298
+ >
299
+ >()
300
+ }
301
+
302
+ // Check the arguments and return type of the generateStaticParams function
303
+ if ('generateStaticParams' in entry) {
304
+ checkFields<Diff<{ params: PageParams }, FirstArg<MaybeField<TEntry, 'generateStaticParams'>>, 'generateStaticParams'>>()
305
+ checkFields<Diff<{ __tag__: 'generateStaticParams', __return_type__: any[] | Promise<any[]> }, { __tag__: 'generateStaticParams', __return_type__: ReturnType<MaybeField<TEntry, 'generateStaticParams'>> }>>()
306
+ }
307
+
308
+ type PageParams = any
309
+ export interface PageProps {
310
+ params?: any
311
+ searchParams?: any
312
+ }
313
+ export interface LayoutProps {
314
+ children?: React.ReactNode
315
+
316
+ params?: any
317
+ }
318
+
319
+ // =============
320
+ // Utility types
321
+ type RevalidateRange<T> = T extends { revalidate: any } ? NonNegative<T['revalidate']> : never
322
+
323
+ // If T is unknown or any, it will be an empty {} type. Otherwise, it will be the same as Omit<T, keyof Base>.
324
+ type OmitWithTag<T, K extends keyof any, _M> = Omit<T, K>
325
+ type Diff<Base, T extends Base, Message extends string = ''> = 0 extends (1 & T) ? {} : OmitWithTag<T, keyof Base, Message>
326
+
327
+ type FirstArg<T extends Function> = T extends (...args: [infer T, any]) => any ? unknown extends T ? any : T : never
328
+ type SecondArg<T extends Function> = T extends (...args: [any, infer T]) => any ? unknown extends T ? any : T : never
329
+ type MaybeField<T, K extends string> = T extends { [k in K]: infer G } ? G extends Function ? G : never : never
330
+
331
+ type ParamCheck<T> = {
332
+ __tag__: string
333
+ __param_position__: string
334
+ __param_type__: T
335
+ }
336
+
337
+ function checkFields<_ extends { [k in keyof any]: never }>() {}
338
+
339
+ // https://github.com/sindresorhus/type-fest
340
+ type Numeric = number | bigint
341
+ type Zero = 0 | 0n
342
+ type Negative<T extends Numeric> = T extends Zero ? never : `${T}` extends `-${string}` ? T : never
343
+ type NonNegative<T extends Numeric> = T extends Zero ? T : Negative<T> extends never ? T : '__invalid_negative_number__'
@@ -1,4 +1,4 @@
1
- // File: /private/tmp/claude-503/-Users-ofiryehoshua/0b425a50-f3c5-49e8-a60e-788bd3aae351/scratchpad/rel/src/app/api/settings/transcription/route.ts
1
+ // File: /private/tmp/claude-503/-Users-ofiryehoshua/0b425a50-f3c5-49e8-a60e-788bd3aae351/scratchpad/rel5/src/app/api/settings/transcription/route.ts
2
2
  import * as entry from '../../../../../../src/app/api/settings/transcription/route.js'
3
3
  import type { NextRequest } from 'next/server.js'
4
4
 
@@ -1,4 +1,4 @@
1
- // File: /private/tmp/claude-503/-Users-ofiryehoshua/0b425a50-f3c5-49e8-a60e-788bd3aae351/scratchpad/rel/src/app/api/skills/[name]/route.ts
1
+ // File: /private/tmp/claude-503/-Users-ofiryehoshua/0b425a50-f3c5-49e8-a60e-788bd3aae351/scratchpad/rel5/src/app/api/skills/[name]/route.ts
2
2
  import * as entry from '../../../../../../src/app/api/skills/[name]/route.js'
3
3
  import type { NextRequest } from 'next/server.js'
4
4
 
@@ -1,4 +1,4 @@
1
- // File: /private/tmp/claude-503/-Users-ofiryehoshua/0b425a50-f3c5-49e8-a60e-788bd3aae351/scratchpad/rel/src/app/api/skills/marketplace/route.ts
1
+ // File: /private/tmp/claude-503/-Users-ofiryehoshua/0b425a50-f3c5-49e8-a60e-788bd3aae351/scratchpad/rel5/src/app/api/skills/marketplace/route.ts
2
2
  import * as entry from '../../../../../../src/app/api/skills/marketplace/route.js'
3
3
  import type { NextRequest } from 'next/server.js'
4
4
 
@@ -1,4 +1,4 @@
1
- // File: /private/tmp/claude-503/-Users-ofiryehoshua/0b425a50-f3c5-49e8-a60e-788bd3aae351/scratchpad/rel/src/app/api/skills/route.ts
1
+ // File: /private/tmp/claude-503/-Users-ofiryehoshua/0b425a50-f3c5-49e8-a60e-788bd3aae351/scratchpad/rel5/src/app/api/skills/route.ts
2
2
  import * as entry from '../../../../../src/app/api/skills/route.js'
3
3
  import type { NextRequest } from 'next/server.js'
4
4
 
@@ -1,4 +1,4 @@
1
- // File: /private/tmp/claude-503/-Users-ofiryehoshua/0b425a50-f3c5-49e8-a60e-788bd3aae351/scratchpad/rel/src/app/api/skills/view/route.ts
1
+ // File: /private/tmp/claude-503/-Users-ofiryehoshua/0b425a50-f3c5-49e8-a60e-788bd3aae351/scratchpad/rel5/src/app/api/skills/view/route.ts
2
2
  import * as entry from '../../../../../../src/app/api/skills/view/route.js'
3
3
  import type { NextRequest } from 'next/server.js'
4
4
 
@@ -1,4 +1,4 @@
1
- // File: /private/tmp/claude-503/-Users-ofiryehoshua/0b425a50-f3c5-49e8-a60e-788bd3aae351/scratchpad/rel/src/app/api/slack/channels/route.ts
1
+ // File: /private/tmp/claude-503/-Users-ofiryehoshua/0b425a50-f3c5-49e8-a60e-788bd3aae351/scratchpad/rel5/src/app/api/slack/channels/route.ts
2
2
  import * as entry from '../../../../../../src/app/api/slack/channels/route.js'
3
3
  import type { NextRequest } from 'next/server.js'
4
4
 
@@ -1,4 +1,4 @@
1
- // File: /private/tmp/claude-503/-Users-ofiryehoshua/0b425a50-f3c5-49e8-a60e-788bd3aae351/scratchpad/rel/src/app/api/slack/configured/route.ts
1
+ // File: /private/tmp/claude-503/-Users-ofiryehoshua/0b425a50-f3c5-49e8-a60e-788bd3aae351/scratchpad/rel5/src/app/api/slack/configured/route.ts
2
2
  import * as entry from '../../../../../../src/app/api/slack/configured/route.js'
3
3
  import type { NextRequest } from 'next/server.js'
4
4
 
@@ -1,4 +1,4 @@
1
- // File: /private/tmp/claude-503/-Users-ofiryehoshua/0b425a50-f3c5-49e8-a60e-788bd3aae351/scratchpad/rel/src/app/api/slack/inbox/route.ts
1
+ // File: /private/tmp/claude-503/-Users-ofiryehoshua/0b425a50-f3c5-49e8-a60e-788bd3aae351/scratchpad/rel5/src/app/api/slack/inbox/route.ts
2
2
  import * as entry from '../../../../../../src/app/api/slack/inbox/route.js'
3
3
  import type { NextRequest } from 'next/server.js'
4
4
 
@@ -1,4 +1,4 @@
1
- // File: /private/tmp/claude-503/-Users-ofiryehoshua/0b425a50-f3c5-49e8-a60e-788bd3aae351/scratchpad/rel/src/app/api/tasks/route.ts
1
+ // File: /private/tmp/claude-503/-Users-ofiryehoshua/0b425a50-f3c5-49e8-a60e-788bd3aae351/scratchpad/rel5/src/app/api/tasks/route.ts
2
2
  import * as entry from '../../../../../src/app/api/tasks/route.js'
3
3
  import type { NextRequest } from 'next/server.js'
4
4
 
@@ -1,4 +1,4 @@
1
- // File: /private/tmp/claude-503/-Users-ofiryehoshua/0b425a50-f3c5-49e8-a60e-788bd3aae351/scratchpad/rel/src/app/api/usage/route.ts
1
+ // File: /private/tmp/claude-503/-Users-ofiryehoshua/0b425a50-f3c5-49e8-a60e-788bd3aae351/scratchpad/rel5/src/app/api/usage/route.ts
2
2
  import * as entry from '../../../../../src/app/api/usage/route.js'
3
3
  import type { NextRequest } from 'next/server.js'
4
4
 
@@ -1,4 +1,4 @@
1
- // File: /private/tmp/claude-503/-Users-ofiryehoshua/0b425a50-f3c5-49e8-a60e-788bd3aae351/scratchpad/rel/src/app/demo/page.tsx
1
+ // File: /private/tmp/claude-503/-Users-ofiryehoshua/0b425a50-f3c5-49e8-a60e-788bd3aae351/scratchpad/rel5/src/app/demo/page.tsx
2
2
  import * as entry from '../../../../src/app/demo/page.js'
3
3
  import type { ResolvingMetadata, ResolvingViewport } from 'next/dist/lib/metadata/types/metadata-interface.js'
4
4
 
@@ -1,4 +1,4 @@
1
- // File: /private/tmp/claude-503/-Users-ofiryehoshua/0b425a50-f3c5-49e8-a60e-788bd3aae351/scratchpad/rel/src/app/layout.tsx
1
+ // File: /private/tmp/claude-503/-Users-ofiryehoshua/0b425a50-f3c5-49e8-a60e-788bd3aae351/scratchpad/rel5/src/app/layout.tsx
2
2
  import * as entry from '../../../src/app/layout.js'
3
3
  import type { ResolvingMetadata, ResolvingViewport } from 'next/dist/lib/metadata/types/metadata-interface.js'
4
4
 
@@ -1,4 +1,4 @@
1
- // File: /private/tmp/claude-503/-Users-ofiryehoshua/0b425a50-f3c5-49e8-a60e-788bd3aae351/scratchpad/rel/src/app/page.tsx
1
+ // File: /private/tmp/claude-503/-Users-ofiryehoshua/0b425a50-f3c5-49e8-a60e-788bd3aae351/scratchpad/rel5/src/app/page.tsx
2
2
  import * as entry from '../../../src/app/page.js'
3
3
  import type { ResolvingMetadata, ResolvingViewport } from 'next/dist/lib/metadata/types/metadata-interface.js'
4
4
 
@@ -35,6 +35,7 @@ var __importStar = (this && this.__importStar) || (function () {
35
35
  var __importDefault = (this && this.__importDefault) || function (mod) {
36
36
  return (mod && mod.__esModule) ? mod : { "default": mod };
37
37
  };
38
+ var _a;
38
39
  Object.defineProperty(exports, "__esModule", { value: true });
39
40
  const http_1 = require("http");
40
41
  const url_1 = require("url");
@@ -56,6 +57,15 @@ const keepAwake_1 = require("./src/lib/keepAwake");
56
57
  const sessionWatch_1 = require("./src/lib/sessionWatch");
57
58
  const worktrees_1 = require("./src/lib/worktrees");
58
59
  const taskStore_1 = require("./src/lib/taskStore");
60
+ // A missing CLI makes every session exit at once and sit "idle": say so instead.
61
+ function missingCli(backendId) {
62
+ const b = (0, backends_1.getBackend)(backendId || backends_1.DEFAULT_BACKEND);
63
+ if ((0, backends_1.availableBackends)().some(x => x.id === b.id))
64
+ return null;
65
+ return b.id === 'claude'
66
+ ? 'Claude Code is not installed. Install it (curl -fsSL https://claude.ai/install.sh | bash), run `claude` once to sign in, then try again.'
67
+ : `${b.label} is not installed on this Mac (\`${b.bin}\` not found).`;
68
+ }
59
69
  // What the browser sees of a live session
60
70
  const sessionView = (s) => {
61
71
  var _a, _b, _c, _d, _e;
@@ -67,6 +77,11 @@ const meetingStore_1 = require("./src/lib/meetingStore");
67
77
  const sessionNameStore_1 = require("./src/lib/sessionNameStore");
68
78
  const sessionStore_1 = require("./src/lib/sessionStore");
69
79
  const fs_2 = require("fs");
80
+ // Agent CLIs install to these folders, which a Terminal or Dock launch may not have
81
+ // on PATH yet (e.g. ~/.local/bin added to .zshrc after this shell started).
82
+ // Sessions and the "is it installed" check both read PATH.
83
+ process.env.PATH = [...new Set([...((_a = process.env.PATH) !== null && _a !== void 0 ? _a : '').split(':').filter(Boolean),
84
+ path_1.default.join(os_1.default.homedir(), '.local/bin'), path_1.default.join(os_1.default.homedir(), '.claude/local'), '/opt/homebrew/bin', '/usr/local/bin'])].join(':');
70
85
  const PORT = Number(process.env.PORT) || 3030;
71
86
  const dev = process.env.NODE_ENV !== 'production';
72
87
  // Compiled builds run from .server-dist/; the Next app lives one level up.
@@ -224,6 +239,7 @@ app.prepare().then(async () => {
224
239
  const cleanupAnyStatus = (0, ptyManager_1.onAnyStatusChange)((id, status) => send({ type: 'sessionStatus', id, status }));
225
240
  const cleanupAnyPrUrl = (0, ptyManager_1.onAnyPrUrlChange)((id, prUrl) => send({ type: 'sessionPrUrl', id, prUrl }));
226
241
  const cleanupAnyRcUrl = (0, ptyManager_1.onAnyRcUrlChange)((id, rcUrl) => send({ type: 'sessionRcUrl', id, rcUrl }));
242
+ const cleanupAnySessionId = (0, ptyManager_1.onAnySessionId)((id, claudeSessionId) => send({ type: 'sessionClaudeId', id, claudeSessionId }));
227
243
  function attachToSession(sessionId) {
228
244
  cleanupOutput === null || cleanupOutput === void 0 ? void 0 : cleanupOutput();
229
245
  cleanupStatus === null || cleanupStatus === void 0 ? void 0 : cleanupStatus();
@@ -243,18 +259,23 @@ app.prepare().then(async () => {
243
259
  cleanupStatus = (0, ptyManager_1.onStatusChange)(sessionId, (status) => send({ type: 'status', status }));
244
260
  }
245
261
  ws.on('message', (raw) => {
246
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1;
262
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4;
247
263
  let msg;
248
264
  try {
249
265
  msg = JSON.parse(raw.toString());
250
266
  }
251
- catch (_2) {
267
+ catch (_5) {
252
268
  return;
253
269
  }
254
270
  if (msg.type === 'list') {
255
271
  send({ type: 'sessions', sessions: liveSessionStore_1.liveSessionStore.list().map(sessionView) });
256
272
  }
257
273
  else if (msg.type === 'create') {
274
+ const noCli = missingCli(msg.backend);
275
+ if (noCli) {
276
+ send({ type: 'error', message: noCli });
277
+ return;
278
+ }
258
279
  let cwd = msg.cwd || process.env.HOME;
259
280
  if (cwd === 'general') {
260
281
  cwd = path_1.default.join(process.env.HOME, 'General', (0, uuid_1.v4)().slice(0, 8));
@@ -305,6 +326,11 @@ app.prepare().then(async () => {
305
326
  (0, ptyManager_1.sendWhenReady)(id, msg.prompt.slice(0, 20000));
306
327
  }
307
328
  else if (msg.type === 'resume') {
329
+ const noCli = missingCli(msg.backend);
330
+ if (noCli) {
331
+ send({ type: 'error', message: noCli });
332
+ return;
333
+ }
308
334
  let cwd = msg.cwd || process.env.HOME;
309
335
  if (cwd === 'general') {
310
336
  cwd = path_1.default.join(process.env.HOME, 'General', (0, uuid_1.v4)().slice(0, 8));
@@ -487,14 +513,19 @@ app.prepare().then(async () => {
487
513
  send({ type: 'pipeline-error', liveId: msg.liveId, message: result.error });
488
514
  }
489
515
  else if (msg.type === 'pipeline-add-pr') {
490
- const err = pipelines_1.pipelineEngine.addPr(msg.id, String((_t = msg.url) !== null && _t !== void 0 ? _t : '').trim());
516
+ const err = pipelines_1.pipelineEngine.addPr(msg.id, String((_t = msg.url) !== null && _t !== void 0 ? _t : '').trim(), msg.review);
517
+ if (err)
518
+ send({ type: 'pipeline-error', liveId: msg.liveId, message: err.error });
519
+ }
520
+ else if (msg.type === 'pipeline-pr-review') {
521
+ const err = pipelines_1.pipelineEngine.setPrReview(msg.id, String((_u = msg.url) !== null && _u !== void 0 ? _u : ''), ((_v = msg.review) !== null && _v !== void 0 ? _v : { channel: null, reviewers: [] }));
491
522
  if (err)
492
523
  send({ type: 'pipeline-error', liveId: msg.liveId, message: err.error });
493
524
  }
494
525
  else if (msg.type === 'watcher-create') {
495
- const c = ((_u = msg.channel) !== null && _u !== void 0 ? _u : {});
526
+ const c = ((_w = msg.channel) !== null && _w !== void 0 ? _w : {});
496
527
  const result = slackWatchers_1.slackWatchers.create({
497
- channel: { id: String((_v = c.id) !== null && _v !== void 0 ? _v : '').replace(/[^A-Z0-9]/gi, ''), name: String((_w = c.name) !== null && _w !== void 0 ? _w : '').replace(/^#/, '').slice(0, 80) },
528
+ channel: { id: String((_x = c.id) !== null && _x !== void 0 ? _x : '').replace(/[^A-Z0-9]/gi, ''), name: String((_y = c.name) !== null && _y !== void 0 ? _y : '').replace(/^#/, '').slice(0, 80) },
498
529
  liveId: msg.liveId || null, mode: msg.mode === 'auto' ? 'auto' : 'approve', intervalMin: Number(msg.intervalMin) || 5,
499
530
  orgId: typeof msg.orgId === 'string' && orgRegistry_1.orgRegistry.get(msg.orgId) ? msg.orgId : orgRegistry_1.DEFAULT_ORG_ID,
500
531
  knowledge: typeof msg.knowledge === 'string' ? msg.knowledge : '', instructions: typeof msg.instructions === 'string' ? msg.instructions : '',
@@ -508,7 +539,7 @@ app.prepare().then(async () => {
508
539
  slackWatchers_1.slackWatchers.stop(msg.id);
509
540
  }
510
541
  else if (msg.type === 'watcher-update') {
511
- const err = slackWatchers_1.slackWatchers.update(msg.id, ((_x = msg.patch) !== null && _x !== void 0 ? _x : {}));
542
+ const err = slackWatchers_1.slackWatchers.update(msg.id, ((_z = msg.patch) !== null && _z !== void 0 ? _z : {}));
512
543
  if (err)
513
544
  send({ type: 'watcher-error', message: err.error });
514
545
  }
@@ -519,7 +550,7 @@ app.prepare().then(async () => {
519
550
  slackWatchers_1.slackWatchers.run(msg.id);
520
551
  }
521
552
  else if (msg.type === 'watcher-send') {
522
- slackWatchers_1.slackWatchers.send(msg.id, msg.permalink, String((_y = msg.text) !== null && _y !== void 0 ? _y : '')).then(err => { if (err)
553
+ slackWatchers_1.slackWatchers.send(msg.id, msg.permalink, String((_0 = msg.text) !== null && _0 !== void 0 ? _0 : '')).then(err => { if (err)
523
554
  send({ type: 'watcher-error', message: err.error }); });
524
555
  }
525
556
  else if (msg.type === 'watcher-dismiss') {
@@ -530,8 +561,13 @@ app.prepare().then(async () => {
530
561
  if (err)
531
562
  send({ type: 'watcher-error', message: err.error });
532
563
  }
564
+ else if (msg.type === 'watcher-instruct') {
565
+ const err = slackWatchers_1.slackWatchers.instruct(msg.id, String((_1 = msg.text) !== null && _1 !== void 0 ? _1 : ''));
566
+ if (err)
567
+ send({ type: 'watcher-error', message: err.error });
568
+ }
533
569
  else if (msg.type === 'watcher-redraft') {
534
- slackWatchers_1.slackWatchers.redraft(msg.id, msg.permalink);
570
+ slackWatchers_1.slackWatchers.redraft(msg.id, msg.permalink, msg.hint);
535
571
  }
536
572
  else if (msg.type === 'pipeline-act') {
537
573
  // The one place an automation's message reaches a session: your click
@@ -540,7 +576,7 @@ app.prepare().then(async () => {
540
576
  send({ type: 'pipeline-error', liveId: msg.liveId, message: err.error });
541
577
  }
542
578
  else if (msg.type === 'pipeline-auto') {
543
- pipelines_1.pipelineEngine.setAuto(msg.id, ((_z = msg.auto) !== null && _z !== void 0 ? _z : {}));
579
+ pipelines_1.pipelineEngine.setAuto(msg.id, ((_2 = msg.auto) !== null && _2 !== void 0 ? _2 : {}));
544
580
  }
545
581
  else if (msg.type === 'pipeline-dismiss') {
546
582
  pipelines_1.pipelineEngine.dismiss(msg.id, msg.prUrl || null);
@@ -551,7 +587,7 @@ app.prepare().then(async () => {
551
587
  else if (msg.type === 'meeting-resume') {
552
588
  const result = meetingManager_1.meetingManager.resume(msg.meetingId);
553
589
  if ('error' in result)
554
- send({ type: 'meeting-error', meetingId: (_0 = msg.meetingId) !== null && _0 !== void 0 ? _0 : null, message: result.error });
590
+ send({ type: 'meeting-error', meetingId: (_3 = msg.meetingId) !== null && _3 !== void 0 ? _3 : null, message: result.error });
555
591
  else
556
592
  send({ type: 'meeting-started', meeting: result });
557
593
  }
@@ -577,7 +613,7 @@ app.prepare().then(async () => {
577
613
  }
578
614
  else if (msg.type === 'send-to-live') {
579
615
  // User clicked "Ask session" on a Slack card: queue the text for when the session is idle
580
- const text = String((_1 = msg.text) !== null && _1 !== void 0 ? _1 : '').replace(/[\x00-\x08\x0b-\x1f\x7f]/g, ' ').trim().slice(0, 20000);
616
+ const text = String((_4 = msg.text) !== null && _4 !== void 0 ? _4 : '').replace(/[\x00-\x08\x0b-\x1f\x7f]/g, ' ').trim().slice(0, 20000);
581
617
  if (text && liveSessionStore_1.liveSessionStore.get(msg.id))
582
618
  (0, ptyManager_1.sendWhenReady)(msg.id, text);
583
619
  }
@@ -596,6 +632,7 @@ app.prepare().then(async () => {
596
632
  cleanupAnyStatus();
597
633
  cleanupAnyPrUrl();
598
634
  cleanupAnyRcUrl();
635
+ cleanupAnySessionId();
599
636
  });
600
637
  });
601
638
  server.listen(PORT, '127.0.0.1', () => {
@@ -199,7 +199,9 @@ function isBinaryAvailable(bin) {
199
199
  catch (_a) {
200
200
  ok = false;
201
201
  }
202
- availabilityCache.set(bin, ok);
202
+ // Cache only hits, so installing a CLI works without restarting Polyergon.
203
+ if (ok)
204
+ availabilityCache.set(bin, ok);
203
205
  return ok;
204
206
  }
205
207
  function availableBackends() {