repoburg 1.2.0 → 1.2.2

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 (170) hide show
  1. package/.run/backend _ build.run.xml +12 -0
  2. package/.run/backend _ lint.run.xml +12 -0
  3. package/.run/backend _ test.run.xml +12 -0
  4. package/.run/frontend _ build.run.xml +12 -0
  5. package/.run/frontend _ lint_fix.run.xml +12 -0
  6. package/CODEMAP.md +207 -0
  7. package/backend/.env +2 -1
  8. package/backend/dist/src/app.module.js +2 -0
  9. package/backend/dist/src/app.module.js.map +1 -1
  10. package/backend/dist/src/seeding/data/context-templates/default-initial_full-project-context.d.ts +1 -1
  11. package/backend/dist/src/seeding/data/context-templates/default-initial_full-project-context.js +4 -0
  12. package/backend/dist/src/seeding/data/context-templates/default-initial_full-project-context.js.map +1 -1
  13. package/backend/dist/src/seeding/data/system-prompts/default_master-agent.d.ts +1 -1
  14. package/backend/dist/src/seeding/data/system-prompts/default_master-agent.js +18 -0
  15. package/backend/dist/src/seeding/data/system-prompts/default_master-agent.js.map +1 -1
  16. package/backend/dist/src/visual-editor/visual-editor.controller.d.ts +14 -0
  17. package/backend/dist/src/visual-editor/visual-editor.controller.js +86 -0
  18. package/backend/dist/src/visual-editor/visual-editor.controller.js.map +1 -0
  19. package/backend/dist/src/visual-editor/visual-editor.dto.d.ts +5 -0
  20. package/backend/dist/src/visual-editor/visual-editor.dto.js +32 -0
  21. package/backend/dist/src/visual-editor/visual-editor.dto.js.map +1 -0
  22. package/backend/dist/src/visual-editor/visual-editor.module.d.ts +2 -0
  23. package/backend/dist/src/visual-editor/visual-editor.module.js +24 -0
  24. package/backend/dist/src/visual-editor/visual-editor.module.js.map +1 -0
  25. package/backend/dist/tsconfig.build.tsbuildinfo +1 -1
  26. package/client/dist/main.js +2 -0
  27. package/package.json +5 -3
  28. package/platform-cli.js +51 -0
  29. package/visual-editor-proxy/client/dist/main.js +89 -0
  30. package/visual-editor-proxy/client/tsconfig.json +14 -0
  31. package/visual-editor-proxy/dist/client/src/inspector.d.ts +9 -0
  32. package/visual-editor-proxy/dist/client/src/inspector.js +96 -0
  33. package/visual-editor-proxy/dist/client/src/inspector.js.map +1 -0
  34. package/visual-editor-proxy/dist/client/src/main.d.ts +6 -0
  35. package/visual-editor-proxy/dist/client/src/main.js +108 -0
  36. package/visual-editor-proxy/dist/client/src/main.js.map +1 -0
  37. package/visual-editor-proxy/dist/client/src/ui.d.ts +6 -0
  38. package/visual-editor-proxy/dist/client/src/ui.js +153 -0
  39. package/visual-editor-proxy/dist/client/src/ui.js.map +1 -0
  40. package/visual-editor-proxy/dist/main.d.ts +1 -0
  41. package/visual-editor-proxy/dist/main.js +61 -0
  42. package/visual-editor-proxy/dist/main.js.map +1 -0
  43. package/visual-editor-proxy/dist/src/main.d.ts +1 -0
  44. package/visual-editor-proxy/dist/src/main.js +61 -0
  45. package/visual-editor-proxy/dist/src/main.js.map +1 -0
  46. package/visual-editor-proxy/dist/tsconfig.tsbuildinfo +1 -0
  47. package/visual-editor-proxy/node_modules/@types/node/LICENSE +21 -0
  48. package/visual-editor-proxy/node_modules/@types/node/README.md +15 -0
  49. package/visual-editor-proxy/node_modules/@types/node/assert/strict.d.ts +8 -0
  50. package/visual-editor-proxy/node_modules/@types/node/assert.d.ts +1062 -0
  51. package/visual-editor-proxy/node_modules/@types/node/async_hooks.d.ts +605 -0
  52. package/visual-editor-proxy/node_modules/@types/node/buffer.buffer.d.ts +462 -0
  53. package/visual-editor-proxy/node_modules/@types/node/buffer.d.ts +1932 -0
  54. package/visual-editor-proxy/node_modules/@types/node/child_process.d.ts +1458 -0
  55. package/visual-editor-proxy/node_modules/@types/node/cluster.d.ts +577 -0
  56. package/visual-editor-proxy/node_modules/@types/node/compatibility/disposable.d.ts +16 -0
  57. package/visual-editor-proxy/node_modules/@types/node/compatibility/index.d.ts +9 -0
  58. package/visual-editor-proxy/node_modules/@types/node/compatibility/indexable.d.ts +20 -0
  59. package/visual-editor-proxy/node_modules/@types/node/compatibility/iterators.d.ts +21 -0
  60. package/visual-editor-proxy/node_modules/@types/node/console.d.ts +452 -0
  61. package/visual-editor-proxy/node_modules/@types/node/constants.d.ts +21 -0
  62. package/visual-editor-proxy/node_modules/@types/node/crypto.d.ts +4570 -0
  63. package/visual-editor-proxy/node_modules/@types/node/dgram.d.ts +596 -0
  64. package/visual-editor-proxy/node_modules/@types/node/diagnostics_channel.d.ts +578 -0
  65. package/visual-editor-proxy/node_modules/@types/node/dns/promises.d.ts +479 -0
  66. package/visual-editor-proxy/node_modules/@types/node/dns.d.ts +871 -0
  67. package/visual-editor-proxy/node_modules/@types/node/domain.d.ts +170 -0
  68. package/visual-editor-proxy/node_modules/@types/node/events.d.ts +977 -0
  69. package/visual-editor-proxy/node_modules/@types/node/fs/promises.d.ts +1248 -0
  70. package/visual-editor-proxy/node_modules/@types/node/fs.d.ts +4362 -0
  71. package/visual-editor-proxy/node_modules/@types/node/globals.d.ts +172 -0
  72. package/visual-editor-proxy/node_modules/@types/node/globals.typedarray.d.ts +21 -0
  73. package/visual-editor-proxy/node_modules/@types/node/http.d.ts +2030 -0
  74. package/visual-editor-proxy/node_modules/@types/node/http2.d.ts +2624 -0
  75. package/visual-editor-proxy/node_modules/@types/node/https.d.ts +546 -0
  76. package/visual-editor-proxy/node_modules/@types/node/index.d.ts +93 -0
  77. package/visual-editor-proxy/node_modules/@types/node/inspector.generated.d.ts +3966 -0
  78. package/visual-editor-proxy/node_modules/@types/node/module.d.ts +539 -0
  79. package/visual-editor-proxy/node_modules/@types/node/net.d.ts +1011 -0
  80. package/visual-editor-proxy/node_modules/@types/node/os.d.ts +505 -0
  81. package/visual-editor-proxy/node_modules/@types/node/package.json +140 -0
  82. package/visual-editor-proxy/node_modules/@types/node/path.d.ts +200 -0
  83. package/visual-editor-proxy/node_modules/@types/node/perf_hooks.d.ts +961 -0
  84. package/visual-editor-proxy/node_modules/@types/node/process.d.ts +1944 -0
  85. package/visual-editor-proxy/node_modules/@types/node/punycode.d.ts +117 -0
  86. package/visual-editor-proxy/node_modules/@types/node/querystring.d.ts +152 -0
  87. package/visual-editor-proxy/node_modules/@types/node/readline/promises.d.ts +162 -0
  88. package/visual-editor-proxy/node_modules/@types/node/readline.d.ts +589 -0
  89. package/visual-editor-proxy/node_modules/@types/node/repl.d.ts +430 -0
  90. package/visual-editor-proxy/node_modules/@types/node/sea.d.ts +153 -0
  91. package/visual-editor-proxy/node_modules/@types/node/stream/consumers.d.ts +38 -0
  92. package/visual-editor-proxy/node_modules/@types/node/stream/promises.d.ts +90 -0
  93. package/visual-editor-proxy/node_modules/@types/node/stream/web.d.ts +533 -0
  94. package/visual-editor-proxy/node_modules/@types/node/stream.d.ts +1675 -0
  95. package/visual-editor-proxy/node_modules/@types/node/string_decoder.d.ts +67 -0
  96. package/visual-editor-proxy/node_modules/@types/node/test.d.ts +1787 -0
  97. package/visual-editor-proxy/node_modules/@types/node/timers/promises.d.ts +108 -0
  98. package/visual-editor-proxy/node_modules/@types/node/timers.d.ts +286 -0
  99. package/visual-editor-proxy/node_modules/@types/node/tls.d.ts +1231 -0
  100. package/visual-editor-proxy/node_modules/@types/node/trace_events.d.ts +197 -0
  101. package/visual-editor-proxy/node_modules/@types/node/ts5.6/buffer.buffer.d.ts +460 -0
  102. package/visual-editor-proxy/node_modules/@types/node/ts5.6/globals.typedarray.d.ts +19 -0
  103. package/visual-editor-proxy/node_modules/@types/node/ts5.6/index.d.ts +93 -0
  104. package/visual-editor-proxy/node_modules/@types/node/tty.d.ts +208 -0
  105. package/visual-editor-proxy/node_modules/@types/node/url.d.ts +964 -0
  106. package/visual-editor-proxy/node_modules/@types/node/util.d.ts +2331 -0
  107. package/visual-editor-proxy/node_modules/@types/node/v8.d.ts +808 -0
  108. package/visual-editor-proxy/node_modules/@types/node/vm.d.ts +1000 -0
  109. package/visual-editor-proxy/node_modules/@types/node/wasi.d.ts +181 -0
  110. package/visual-editor-proxy/node_modules/@types/node/web-globals/abortcontroller.d.ts +34 -0
  111. package/visual-editor-proxy/node_modules/@types/node/web-globals/domexception.d.ts +68 -0
  112. package/visual-editor-proxy/node_modules/@types/node/web-globals/events.d.ts +97 -0
  113. package/visual-editor-proxy/node_modules/@types/node/web-globals/fetch.d.ts +46 -0
  114. package/visual-editor-proxy/node_modules/@types/node/worker_threads.d.ts +715 -0
  115. package/visual-editor-proxy/node_modules/@types/node/zlib.d.ts +539 -0
  116. package/visual-editor-proxy/node_modules/undici-types/LICENSE +21 -0
  117. package/visual-editor-proxy/node_modules/undici-types/README.md +6 -0
  118. package/visual-editor-proxy/node_modules/undici-types/agent.d.ts +31 -0
  119. package/visual-editor-proxy/node_modules/undici-types/api.d.ts +43 -0
  120. package/visual-editor-proxy/node_modules/undici-types/balanced-pool.d.ts +29 -0
  121. package/visual-editor-proxy/node_modules/undici-types/cache.d.ts +36 -0
  122. package/visual-editor-proxy/node_modules/undici-types/client.d.ts +108 -0
  123. package/visual-editor-proxy/node_modules/undici-types/connector.d.ts +34 -0
  124. package/visual-editor-proxy/node_modules/undici-types/content-type.d.ts +21 -0
  125. package/visual-editor-proxy/node_modules/undici-types/cookies.d.ts +28 -0
  126. package/visual-editor-proxy/node_modules/undici-types/diagnostics-channel.d.ts +66 -0
  127. package/visual-editor-proxy/node_modules/undici-types/dispatcher.d.ts +256 -0
  128. package/visual-editor-proxy/node_modules/undici-types/env-http-proxy-agent.d.ts +21 -0
  129. package/visual-editor-proxy/node_modules/undici-types/errors.d.ts +149 -0
  130. package/visual-editor-proxy/node_modules/undici-types/eventsource.d.ts +61 -0
  131. package/visual-editor-proxy/node_modules/undici-types/fetch.d.ts +209 -0
  132. package/visual-editor-proxy/node_modules/undici-types/file.d.ts +39 -0
  133. package/visual-editor-proxy/node_modules/undici-types/filereader.d.ts +54 -0
  134. package/visual-editor-proxy/node_modules/undici-types/formdata.d.ts +108 -0
  135. package/visual-editor-proxy/node_modules/undici-types/global-dispatcher.d.ts +9 -0
  136. package/visual-editor-proxy/node_modules/undici-types/global-origin.d.ts +7 -0
  137. package/visual-editor-proxy/node_modules/undici-types/handlers.d.ts +15 -0
  138. package/visual-editor-proxy/node_modules/undici-types/header.d.ts +4 -0
  139. package/visual-editor-proxy/node_modules/undici-types/index.d.ts +71 -0
  140. package/visual-editor-proxy/node_modules/undici-types/interceptors.d.ts +17 -0
  141. package/visual-editor-proxy/node_modules/undici-types/mock-agent.d.ts +50 -0
  142. package/visual-editor-proxy/node_modules/undici-types/mock-client.d.ts +25 -0
  143. package/visual-editor-proxy/node_modules/undici-types/mock-errors.d.ts +12 -0
  144. package/visual-editor-proxy/node_modules/undici-types/mock-interceptor.d.ts +93 -0
  145. package/visual-editor-proxy/node_modules/undici-types/mock-pool.d.ts +25 -0
  146. package/visual-editor-proxy/node_modules/undici-types/package.json +55 -0
  147. package/visual-editor-proxy/node_modules/undici-types/patch.d.ts +33 -0
  148. package/visual-editor-proxy/node_modules/undici-types/pool-stats.d.ts +19 -0
  149. package/visual-editor-proxy/node_modules/undici-types/pool.d.ts +39 -0
  150. package/visual-editor-proxy/node_modules/undici-types/proxy-agent.d.ts +28 -0
  151. package/visual-editor-proxy/node_modules/undici-types/readable.d.ts +65 -0
  152. package/visual-editor-proxy/node_modules/undici-types/retry-agent.d.ts +8 -0
  153. package/visual-editor-proxy/node_modules/undici-types/retry-handler.d.ts +116 -0
  154. package/visual-editor-proxy/node_modules/undici-types/util.d.ts +18 -0
  155. package/visual-editor-proxy/node_modules/undici-types/webidl.d.ts +228 -0
  156. package/visual-editor-proxy/node_modules/undici-types/websocket.d.ts +150 -0
  157. package/visual-editor-proxy/package.json +21 -0
  158. package/visual-editor-proxy/tsconfig.json +21 -0
  159. package/CODEBASE_MAP.md +0 -212
  160. package/backend/dist/src/seeding/data/system-prompts/codebase-explorer.d.ts +0 -2
  161. package/backend/dist/src/seeding/data/system-prompts/codebase-explorer.js +0 -114
  162. package/backend/dist/src/seeding/data/system-prompts/codebase-explorer.js.map +0 -1
  163. package/backend/dist/src/seeding/data/system-prompts/multi-file-action-generator-with-requester.d.ts +0 -2
  164. package/backend/dist/src/seeding/data/system-prompts/multi-file-action-generator-with-requester.js +0 -201
  165. package/backend/dist/src/seeding/data/system-prompts/multi-file-action-generator-with-requester.js.map +0 -1
  166. package/backend/dist/src/seeding/data/system-prompts/packup.d.ts +0 -2
  167. package/backend/dist/src/seeding/data/system-prompts/packup.js +0 -37
  168. package/backend/dist/src/seeding/data/system-prompts/packup.js.map +0 -1
  169. package/backend/orchestration-test-2.txt +0 -1
  170. package/backend/orchestration-test.txt +0 -1
@@ -0,0 +1,18 @@
1
+ export namespace util {
2
+ /**
3
+ * Retrieves a header name and returns its lowercase value.
4
+ * @param value Header name
5
+ */
6
+ export function headerNameToString(value: string | Buffer): string;
7
+
8
+ /**
9
+ * Receives a header object and returns the parsed value.
10
+ * @param headers Header object
11
+ * @param obj Object to specify a proxy object. Used to assign parsed values.
12
+ * @returns If `obj` is specified, it is equivalent to `obj`.
13
+ */
14
+ export function parseHeaders(
15
+ headers: (Buffer | string | (Buffer | string)[])[],
16
+ obj?: Record<string, string | string[]>
17
+ ): Record<string, string | string[]>;
18
+ }
@@ -0,0 +1,228 @@
1
+ // These types are not exported, and are only used internally
2
+
3
+ /**
4
+ * Take in an unknown value and return one that is of type T
5
+ */
6
+ type Converter<T> = (object: unknown) => T
7
+
8
+ type SequenceConverter<T> = (object: unknown, iterable?: IterableIterator<T>) => T[]
9
+
10
+ type RecordConverter<K extends string, V> = (object: unknown) => Record<K, V>
11
+
12
+ interface ConvertToIntOpts {
13
+ clamp?: boolean
14
+ enforceRange?: boolean
15
+ }
16
+
17
+ interface WebidlErrors {
18
+ exception (opts: { header: string, message: string }): TypeError
19
+ /**
20
+ * @description Throw an error when conversion from one type to another has failed
21
+ */
22
+ conversionFailed (opts: {
23
+ prefix: string
24
+ argument: string
25
+ types: string[]
26
+ }): TypeError
27
+ /**
28
+ * @description Throw an error when an invalid argument is provided
29
+ */
30
+ invalidArgument (opts: {
31
+ prefix: string
32
+ value: string
33
+ type: string
34
+ }): TypeError
35
+ }
36
+
37
+ interface WebidlUtil {
38
+ /**
39
+ * @see https://tc39.es/ecma262/#sec-ecmascript-data-types-and-values
40
+ */
41
+ Type (object: unknown):
42
+ | 'Undefined'
43
+ | 'Boolean'
44
+ | 'String'
45
+ | 'Symbol'
46
+ | 'Number'
47
+ | 'BigInt'
48
+ | 'Null'
49
+ | 'Object'
50
+
51
+ /**
52
+ * @see https://webidl.spec.whatwg.org/#abstract-opdef-converttoint
53
+ */
54
+ ConvertToInt (
55
+ V: unknown,
56
+ bitLength: number,
57
+ signedness: 'signed' | 'unsigned',
58
+ opts?: ConvertToIntOpts
59
+ ): number
60
+
61
+ /**
62
+ * @see https://webidl.spec.whatwg.org/#abstract-opdef-converttoint
63
+ */
64
+ IntegerPart (N: number): number
65
+
66
+ /**
67
+ * Stringifies {@param V}
68
+ */
69
+ Stringify (V: any): string
70
+
71
+ /**
72
+ * Mark a value as uncloneable for Node.js.
73
+ * This is only effective in some newer Node.js versions.
74
+ */
75
+ markAsUncloneable (V: any): void
76
+ }
77
+
78
+ interface WebidlConverters {
79
+ /**
80
+ * @see https://webidl.spec.whatwg.org/#es-DOMString
81
+ */
82
+ DOMString (V: unknown, prefix: string, argument: string, opts?: {
83
+ legacyNullToEmptyString: boolean
84
+ }): string
85
+
86
+ /**
87
+ * @see https://webidl.spec.whatwg.org/#es-ByteString
88
+ */
89
+ ByteString (V: unknown, prefix: string, argument: string): string
90
+
91
+ /**
92
+ * @see https://webidl.spec.whatwg.org/#es-USVString
93
+ */
94
+ USVString (V: unknown): string
95
+
96
+ /**
97
+ * @see https://webidl.spec.whatwg.org/#es-boolean
98
+ */
99
+ boolean (V: unknown): boolean
100
+
101
+ /**
102
+ * @see https://webidl.spec.whatwg.org/#es-any
103
+ */
104
+ any <Value>(V: Value): Value
105
+
106
+ /**
107
+ * @see https://webidl.spec.whatwg.org/#es-long-long
108
+ */
109
+ ['long long'] (V: unknown): number
110
+
111
+ /**
112
+ * @see https://webidl.spec.whatwg.org/#es-unsigned-long-long
113
+ */
114
+ ['unsigned long long'] (V: unknown): number
115
+
116
+ /**
117
+ * @see https://webidl.spec.whatwg.org/#es-unsigned-long
118
+ */
119
+ ['unsigned long'] (V: unknown): number
120
+
121
+ /**
122
+ * @see https://webidl.spec.whatwg.org/#es-unsigned-short
123
+ */
124
+ ['unsigned short'] (V: unknown, opts?: ConvertToIntOpts): number
125
+
126
+ /**
127
+ * @see https://webidl.spec.whatwg.org/#idl-ArrayBuffer
128
+ */
129
+ ArrayBuffer (V: unknown): ArrayBufferLike
130
+ ArrayBuffer (V: unknown, opts: { allowShared: false }): ArrayBuffer
131
+
132
+ /**
133
+ * @see https://webidl.spec.whatwg.org/#es-buffer-source-types
134
+ */
135
+ TypedArray (
136
+ V: unknown,
137
+ TypedArray: NodeJS.TypedArray | ArrayBufferLike
138
+ ): NodeJS.TypedArray | ArrayBufferLike
139
+ TypedArray (
140
+ V: unknown,
141
+ TypedArray: NodeJS.TypedArray | ArrayBufferLike,
142
+ opts?: { allowShared: false }
143
+ ): NodeJS.TypedArray | ArrayBuffer
144
+
145
+ /**
146
+ * @see https://webidl.spec.whatwg.org/#es-buffer-source-types
147
+ */
148
+ DataView (V: unknown, opts?: { allowShared: boolean }): DataView
149
+
150
+ /**
151
+ * @see https://webidl.spec.whatwg.org/#BufferSource
152
+ */
153
+ BufferSource (
154
+ V: unknown,
155
+ opts?: { allowShared: boolean }
156
+ ): NodeJS.TypedArray | ArrayBufferLike | DataView
157
+
158
+ ['sequence<ByteString>']: SequenceConverter<string>
159
+
160
+ ['sequence<sequence<ByteString>>']: SequenceConverter<string[]>
161
+
162
+ ['record<ByteString, ByteString>']: RecordConverter<string, string>
163
+
164
+ [Key: string]: (...args: any[]) => unknown
165
+ }
166
+
167
+ export interface Webidl {
168
+ errors: WebidlErrors
169
+ util: WebidlUtil
170
+ converters: WebidlConverters
171
+
172
+ /**
173
+ * @description Performs a brand-check on {@param V} to ensure it is a
174
+ * {@param cls} object.
175
+ */
176
+ brandCheck <Interface>(V: unknown, cls: Interface, opts?: { strict?: boolean }): asserts V is Interface
177
+
178
+ /**
179
+ * @see https://webidl.spec.whatwg.org/#es-sequence
180
+ * @description Convert a value, V, to a WebIDL sequence type.
181
+ */
182
+ sequenceConverter <Type>(C: Converter<Type>): SequenceConverter<Type>
183
+
184
+ illegalConstructor (): never
185
+
186
+ /**
187
+ * @see https://webidl.spec.whatwg.org/#es-to-record
188
+ * @description Convert a value, V, to a WebIDL record type.
189
+ */
190
+ recordConverter <K extends string, V>(
191
+ keyConverter: Converter<K>,
192
+ valueConverter: Converter<V>
193
+ ): RecordConverter<K, V>
194
+
195
+ /**
196
+ * Similar to {@link Webidl.brandCheck} but allows skipping the check if third party
197
+ * interfaces are allowed.
198
+ */
199
+ interfaceConverter <Interface>(cls: Interface): (
200
+ V: unknown,
201
+ opts?: { strict: boolean }
202
+ ) => asserts V is typeof cls
203
+
204
+ // TODO(@KhafraDev): a type could likely be implemented that can infer the return type
205
+ // from the converters given?
206
+ /**
207
+ * Converts a value, V, to a WebIDL dictionary types. Allows limiting which keys are
208
+ * allowed, values allowed, optional and required keys. Auto converts the value to
209
+ * a type given a converter.
210
+ */
211
+ dictionaryConverter (converters: {
212
+ key: string,
213
+ defaultValue?: () => unknown,
214
+ required?: boolean,
215
+ converter: (...args: unknown[]) => unknown,
216
+ allowedValues?: unknown[]
217
+ }[]): (V: unknown) => Record<string, unknown>
218
+
219
+ /**
220
+ * @see https://webidl.spec.whatwg.org/#idl-nullable-type
221
+ * @description allows a type, V, to be null
222
+ */
223
+ nullableConverter <T>(
224
+ converter: Converter<T>
225
+ ): (V: unknown) => ReturnType<typeof converter> | null
226
+
227
+ argumentLengthCheck (args: { length: number }, min: number, context: string): void
228
+ }
@@ -0,0 +1,150 @@
1
+ /// <reference types="node" />
2
+
3
+ import type { Blob } from 'buffer'
4
+ import type { MessagePort } from 'worker_threads'
5
+ import {
6
+ EventInit,
7
+ EventListenerOptions,
8
+ AddEventListenerOptions,
9
+ EventListenerOrEventListenerObject
10
+ } from './patch'
11
+ import Dispatcher from './dispatcher'
12
+ import { HeadersInit } from './fetch'
13
+
14
+ export type BinaryType = 'blob' | 'arraybuffer'
15
+
16
+ interface WebSocketEventMap {
17
+ close: CloseEvent
18
+ error: ErrorEvent
19
+ message: MessageEvent
20
+ open: Event
21
+ }
22
+
23
+ interface WebSocket extends EventTarget {
24
+ binaryType: BinaryType
25
+
26
+ readonly bufferedAmount: number
27
+ readonly extensions: string
28
+
29
+ onclose: ((this: WebSocket, ev: WebSocketEventMap['close']) => any) | null
30
+ onerror: ((this: WebSocket, ev: WebSocketEventMap['error']) => any) | null
31
+ onmessage: ((this: WebSocket, ev: WebSocketEventMap['message']) => any) | null
32
+ onopen: ((this: WebSocket, ev: WebSocketEventMap['open']) => any) | null
33
+
34
+ readonly protocol: string
35
+ readonly readyState: number
36
+ readonly url: string
37
+
38
+ close(code?: number, reason?: string): void
39
+ send(data: string | ArrayBufferLike | Blob | ArrayBufferView): void
40
+
41
+ readonly CLOSED: number
42
+ readonly CLOSING: number
43
+ readonly CONNECTING: number
44
+ readonly OPEN: number
45
+
46
+ addEventListener<K extends keyof WebSocketEventMap>(
47
+ type: K,
48
+ listener: (this: WebSocket, ev: WebSocketEventMap[K]) => any,
49
+ options?: boolean | AddEventListenerOptions
50
+ ): void
51
+ addEventListener(
52
+ type: string,
53
+ listener: EventListenerOrEventListenerObject,
54
+ options?: boolean | AddEventListenerOptions
55
+ ): void
56
+ removeEventListener<K extends keyof WebSocketEventMap>(
57
+ type: K,
58
+ listener: (this: WebSocket, ev: WebSocketEventMap[K]) => any,
59
+ options?: boolean | EventListenerOptions
60
+ ): void
61
+ removeEventListener(
62
+ type: string,
63
+ listener: EventListenerOrEventListenerObject,
64
+ options?: boolean | EventListenerOptions
65
+ ): void
66
+ }
67
+
68
+ export declare const WebSocket: {
69
+ prototype: WebSocket
70
+ new (url: string | URL, protocols?: string | string[] | WebSocketInit): WebSocket
71
+ readonly CLOSED: number
72
+ readonly CLOSING: number
73
+ readonly CONNECTING: number
74
+ readonly OPEN: number
75
+ }
76
+
77
+ interface CloseEventInit extends EventInit {
78
+ code?: number
79
+ reason?: string
80
+ wasClean?: boolean
81
+ }
82
+
83
+ interface CloseEvent extends Event {
84
+ readonly code: number
85
+ readonly reason: string
86
+ readonly wasClean: boolean
87
+ }
88
+
89
+ export declare const CloseEvent: {
90
+ prototype: CloseEvent
91
+ new (type: string, eventInitDict?: CloseEventInit): CloseEvent
92
+ }
93
+
94
+ interface MessageEventInit<T = any> extends EventInit {
95
+ data?: T
96
+ lastEventId?: string
97
+ origin?: string
98
+ ports?: (typeof MessagePort)[]
99
+ source?: typeof MessagePort | null
100
+ }
101
+
102
+ interface MessageEvent<T = any> extends Event {
103
+ readonly data: T
104
+ readonly lastEventId: string
105
+ readonly origin: string
106
+ readonly ports: ReadonlyArray<typeof MessagePort>
107
+ readonly source: typeof MessagePort | null
108
+ initMessageEvent(
109
+ type: string,
110
+ bubbles?: boolean,
111
+ cancelable?: boolean,
112
+ data?: any,
113
+ origin?: string,
114
+ lastEventId?: string,
115
+ source?: typeof MessagePort | null,
116
+ ports?: (typeof MessagePort)[]
117
+ ): void;
118
+ }
119
+
120
+ export declare const MessageEvent: {
121
+ prototype: MessageEvent
122
+ new<T>(type: string, eventInitDict?: MessageEventInit<T>): MessageEvent<T>
123
+ }
124
+
125
+ interface ErrorEventInit extends EventInit {
126
+ message?: string
127
+ filename?: string
128
+ lineno?: number
129
+ colno?: number
130
+ error?: any
131
+ }
132
+
133
+ interface ErrorEvent extends Event {
134
+ readonly message: string
135
+ readonly filename: string
136
+ readonly lineno: number
137
+ readonly colno: number
138
+ readonly error: any
139
+ }
140
+
141
+ export declare const ErrorEvent: {
142
+ prototype: ErrorEvent
143
+ new (type: string, eventInitDict?: ErrorEventInit): ErrorEvent
144
+ }
145
+
146
+ interface WebSocketInit {
147
+ protocols?: string | string[],
148
+ dispatcher?: Dispatcher,
149
+ headers?: HeadersInit
150
+ }
@@ -0,0 +1,21 @@
1
+ {
2
+ "name": "visual-editor-proxy",
3
+ "version": "1.0.0",
4
+ "description": "Proxy server for Repoburg Visual Editor",
5
+ "main": "dist/main.js",
6
+ "scripts": {
7
+ "start": "node dist/main.js",
8
+ "dev": "npm run build && node dist/main.js",
9
+ "build": "tsc && npm run build:client",
10
+ "build:client": "esbuild client/src/main.ts --bundle --outfile=client/dist/main.js --minify"
11
+ },
12
+ "devDependencies": {
13
+ "@types/express": "^4.17.21",
14
+ "@types/node": "^20.12.12",
15
+ "esbuild": "^0.21.4",
16
+ "ts-node": "^10.9.2",
17
+ "typescript": "^5.4.5"
18
+ },
19
+ "author": "",
20
+ "license": "ISC"
21
+ }
@@ -0,0 +1,21 @@
1
+ {
2
+ "compilerOptions": {
3
+ "module": "commonjs",
4
+ "declaration": true,
5
+ "removeComments": true,
6
+ "emitDecoratorMetadata": true,
7
+ "experimentalDecorators": true,
8
+ "allowSyntheticDefaultImports": true,
9
+ "target": "es2021",
10
+ "sourceMap": true,
11
+ "outDir": "./dist",
12
+ "baseUrl": "./",
13
+ "incremental": true,
14
+ "skipLibCheck": true,
15
+ "strictNullChecks": false,
16
+ "noImplicitAny": false,
17
+ "strictBindCallApply": false,
18
+ "forceConsistentCasingInFileNames": false,
19
+ "noFallthroughCasesInSwitch": false
20
+ }
21
+ }
package/CODEBASE_MAP.md DELETED
@@ -1,212 +0,0 @@
1
- # Codebase Map: Your Guide to navigating This Project
2
-
3
- This document is a high-level map for AI agents and developers to understand the structure and purpose of this monorepo. It is generated by traversing the file tree and summarizing each component's role.
4
-
5
- ## 1. Project Overview
6
-
7
- This project is an AI-powered coding assistant designed to help developers understand, refactor, and generate code. It consists of several key components: a **backend** service that orchestrates AI interactions, a **frontend** web application for user interaction, and a **daemon** for local machine operations.
8
-
9
- ---
10
-
11
- ## 2. Root Level & Project Configuration
12
-
13
- This section describes the key files at the root of the monorepo that define its structure and behavior.
14
-
15
- - `package.json`: The main configuration file for the monorepo.
16
- - **`workspaces`**: Defines the packages that make up the monorepo (`frontend`, `backend`, `website`, `daemon`).
17
- - **`bin`**: This is critical. It registers the command-line executables (`repoburg`, `repoburg-daemon`, `repoburg-backend`) that are made available when the package is installed globally.
18
- - **`scripts`**: Contains top-level scripts for running, building, and developing the various workspaces.
19
- - `platform-cli.js`: The implementation of the main `repoburg` command-line tool. It's a Node.js script that uses `commander` to parse arguments and makes HTTP requests to the local `daemon` API to manage services (start, stop, list, etc.).
20
- - `postinstall.js`: A script that runs automatically after `npm install`. Its purpose is to set the correct executable permissions (`chmod 755`) for the bundled binaries (`rg`, `tree`) located within the `backend` package.
21
-
22
- ---
23
-
24
- ## 3. Backend (`/backend`)
25
-
26
- The backend is a NestJS application responsible for the core logic of the AI assistant. It manages state, orchestrates multi-step AI tasks, and handles all database interactions.
27
-
28
- ### Key Backend Modules (`backend/src/`)
29
-
30
- - #### `orchestration/`
31
- - **Purpose**: This module is the heart of the system's automation capabilities. It manages the execution of "Orchestration Scripts" - multi-step tasks where each step is a prompt sent to the LLM. It's a state machine that can run, pause, stop, and resume these long-running tasks.
32
- - **Key Files**:
33
- - `orchestration.service.ts`: The core engine. It manages the state of the active orchestration run (e.g., `RUNNING`, `PAUSED`, `WAITING_FOR_LLM_RESPONSE`). It's a singleton that controls the step-by-step execution loop.
34
- - `orchestration.controller.ts`: The public-facing REST API. Exposes endpoints for two primary functions: Script Management (CRUD for orchestration files) and Execution Control (start, stop, proceed, etc.).
35
- - `orchestration-fs.service.ts`: A dedicated service to handle all file system operations for orchestration scripts, which are stored in `.repoburg/orchestrations`. It manages the original scripts (`.rc.md`) and the temporary "run" copies (`.run.rc.md`) that are consumed during execution.
36
- - `orchestration-parser.service.ts`: A simple utility that parses a script file, splitting it into an array of distinct prompts based on the `$$$$` separator.
37
- - `orchestration.types.ts`: Defines the critical data structures and enums (`OrchestrationStatus`, `OrchestrationMode`, `OrchestrationRunState`) that govern the state machine.
38
-
39
- - #### `sessions/`
40
- - **Purpose**: Manages the lifecycle of a user's interaction. A `Session` is the primary container for a conversation or task, holding together user prompts, AI responses, and associated context (like the system prompt and context templates). This module handles creating, retrieving, updating, and deleting these sessions from the database.
41
- - **Key Files**:
42
- - `sessions.service.ts`: Contains the core business logic for session management. It performs all database operations (CRUD) for the `Session` entity and handles the logic for setting the "active" session for the application.
43
- - `sessions.controller.ts`: The REST API for sessions. It exposes endpoints for managing the entire lifecycle of a session, including creating new sessions, listing existing ones, setting the active session, and importing/exporting sessions.
44
- - `session.dto.ts`: Defines the data transfer objects and enums (`SessionStatus`) used for validating API requests and structuring responses.
45
-
46
- - #### `session-inputs/`
47
- - **Purpose**: Represents a single "turn" or interaction within a `Session`. This module's primary responsibility is to take a user's raw prompt and assemble the final, complete context string that will be sent to the LLM. It acts as the preparation and dispatch layer for LLM calls.
48
- - **Key Files**:
49
- - `session-inputs.service.ts`: The main service that orchestrates the creation of a `SessionInput`. It triggers the context generation process and then hands off the final prompt to the `ChatService` for the actual LLM interaction.
50
- - `session-input-context.service.ts`: A critical service responsible for **assembling the context**. It combines context from multiple sources: context templates, ad-hoc file/folder requests, and reusable `!snippet` commands. It also enforces token limits. **Look here to understand how prompts are built.**
51
- - `session-inputs.controller.ts`: The REST API for creating new turns within a session. It's nested under `/sessions/:sessionId/inputs`.
52
-
53
- - #### `interactive-chat/`
54
- - **Purpose**: Manages the stateful, turn-by-turn conversation with the LLM. It holds the history of a conversation for each session, provides it to the LLM provider for context, and handles the actual `generateContent` call. It distinguishes between an "integrated" flow (where it calls the LLM and processes the response automatically) and a "manual" flow (where it just emits the generated prompt for an external tool to use).
55
- - **Key Files**:
56
- - `chat.service.ts`: The core of the module. It maintains a map of `ChatState` (history and system prompt) for each session. Its `sendMessage` method is the primary entry point for communicating with the LLM.
57
-
58
- - #### `llm-provider/`
59
- - **Purpose**: An abstraction layer for communicating with any Large Language Model. It defines a generic `LlmProvider` interface that the rest of the application uses, decoupling the core logic from any specific LLM implementation (like Gemini).
60
- - **Key Files**:
61
- - `llm-provider.interface.ts`: Defines the contract for any LLM provider, including the `generateContent` method and the data structures for requests. It also defines the `LLM_PROVIDER` injection token.
62
- - `llm-provider.module.ts`: Wires up the concrete implementation. This is where you would swap `GeminiLlmProvider` for another provider if needed.
63
-
64
- - #### `gemini/`
65
- - **Purpose**: The concrete implementation of the `LlmProvider` interface for Google's Gemini models. It handles authentication, error parsing, and the specifics of making streaming API calls to the Gemini service.
66
- - **Key Files**:
67
- - `gemini-llm.provider.ts`: Implements the `generateContent` method. It uses the `gemini-core` package to manage configuration and authentication, constructs the request with history and system prompts, and processes the streaming response.
68
-
69
- - #### `llm-response-parser/`
70
- - **Purpose**: A crucial utility that acts as a translator. It takes the raw, semi-structured text response from the LLM and parses it into validated, machine-readable `AIActionDto` objects. This module is the bridge between the LLM's output and the structured actions the system can execute.
71
- - **Key Files**:
72
- - `llm-response-parser.service.ts`: Contains the primary `parse` method, which splits a response into an optional "explanation" and a series of action blocks. It handles various edge cases like missing end tags.
73
- - `parsing.constants.ts`: Defines the special tags (e.g., `ACTION_ITEM_START`) and field names (e.g., `¦FilePath¦`) that form the contract for the LLM's structured output.
74
- - `dto/ai-action.dto.ts`: Defines the `AIActionDto` class, the structured data format that is the output of this service.
75
-
76
- - #### `ai-actions/`
77
- - **Purpose**: This module translates the LLM's textual response into structured, executable actions (`AIAction`). It manages the entire lifecycle of these actions, from creation and parsing to execution, state changes (e.g., approving, reverting), and batch operations.
78
- - **Key Files**:
79
- - `ai-action-creation.service.ts`: The entry point for this module. It takes the raw string from the LLM, uses the `LlmResponseParserService` to turn it into `AIActionDto` objects, and then creates the initial `AIAction` database records. It contains different logic paths based on the execution strategy (`review_first`, `apply_revert`, `auto_apply`).
80
- - `ai-actions.service.ts`: Manages the state and lifecycle of a **single** `AIAction`. It contains the core logic for operations like `approveAction`, `discardAction`, `confirmKeepAction`, and, most importantly, `revertAction`, which knows how to undo file system changes.
81
- - `ai-action-batch.service.ts`: Handles operations on a **group** of actions for a given `SessionInput`. This is used by the controller for "Apply All", "Revert All", etc. It orchestrates calls to `AIActionsService` for individual actions.
82
- - `ai-actions.controller.ts`: The REST API that exposes both single-action controls (e.g., approve one action) and batch controls (e.g., revert all actions for an input).
83
-
84
- - #### `action-execution/`
85
- - **Purpose**: This is the lowest-level module responsible for the actual execution of file system and shell commands. It is a critical security boundary, ensuring that all operations are safe and restricted to the project's workspace.
86
- - **Key Files**:
87
- - `action-execution.service.ts`: A simple service with methods like `createFile`, `editFile`, `deleteFile`, and `runCommand`. Its most important feature is the `resolveAndValidatePath` method, which prevents path traversal attacks by ensuring all file paths are relative and within the project's root directory.
88
-
89
- ---
90
-
91
- ## 4. Frontend (`/frontend`)
92
-
93
- The frontend is a Next.js application built with React and TypeScript. It provides the entire user interface for interacting with the AI assistant. It uses `Zustand` for state management and `Shadcn/ui` for the component library.
94
-
95
- ### Key Frontend Pages (`frontend/src/app/components/pages/`)
96
- This directory contains the top-level components for each major screen of the application.
97
-
98
- - #### Core Workflow & Interaction
99
- - `MainHomePage.tsx`: The main application router. It displays a dashboard of navigation cards and renders the other page components based on the current application state. **This is the main hub of the UI.**
100
- - `PlanInteractionPage.tsx`: The primary screen for interacting with the AI's generated plan. It displays the list of `ActionItemBlock` components, allowing the user to approve, discard, revert, or confirm actions.
101
- - `SessionHistoryPage.tsx`: Displays a table of all past sessions, allowing users to load, delete, import/export, or create follow-up sessions.
102
-
103
- - #### Customization & Management
104
- - `ContextManagementPage.tsx`: A CRUD interface for managing `Context Templates`, which are used to build prompts.
105
- - `SystemPromptsManagementPage.tsx`: A CRUD interface for managing `System Prompts`, which define the AI's core behavior.
106
- - `OrchestrationsManagementPage.tsx`: A CRUD interface for managing and running multi-step automation scripts (`Orchestration Scripts`).
107
- - `ContextSnippetsManagementPage.tsx`: A CRUD interface for managing dynamic `Prompt Snippets` (e.g., `!my-snippet`) that can be used in prompts.
108
- - `CustomSnippetsManagementPage.tsx`: (Likely deprecated or for internal use) A CRUD interface for `Template Snippets` used within the template editor itself.
109
- - `SettingsPage.tsx`: A page for configuring global and session-level settings, such as execution strategy, manual LLM mode, and platform updates.
110
- - `IntegrationsPage.tsx`: Provides instructions and links for installing external integrations, like the AI Studio PowerTools userscript.
111
-
112
- ### Key Frontend Components (`frontend/src/app/components/`)
113
- This section describes the key sub-directories containing the building blocks for the pages above.
114
-
115
- - #### `session/`
116
- - **Purpose**: Contains all the components that make up the primary user interaction view: the chat history, the prompt input box, and the session control panel.
117
- - **Key Files**:
118
- - `CurrentSessionPage.tsx`: The main orchestrator for the session view. It assembles the `SessionControls`, `ConversationDisplay`, and `PromptInput` into a complete, interactive page. It also manages the state for the `@`, `#`, and `!` context pickers.
119
- - `ConversationDisplay.tsx`: Renders the list of turns in a conversation by mapping over session inputs and displaying `UserMessageBlock` and `AIMessageBlock` components.
120
- - `PromptInput.tsx`: The main textarea for user input. It handles prompt submission, keyboard shortcuts, and the logic for adding ad-hoc context.
121
- - `SessionControls.tsx`: The left-hand panel in the UI, which groups together session actions, information, and settings.
122
- - `AIMessageBlock.tsx` & `UserMessageBlock.tsx`: Components that render a single turn in the conversation for the AI and the user, respectively.
123
- - `ManualLLMInterface.tsx`: A special component that only appears when "Manual LLM" mode is active, providing the UI for copying the prepared prompt and pasting the LLM's response.
124
-
125
- - #### `plan/`
126
- - **Purpose**: Contains the components used to build the `PlanInteractionPage`. These are responsible for displaying each AI-proposed action, showing code diffs, and providing the controls to manage them.
127
- - **Key Files**:
128
- - `ActionItemBlock.tsx`: The main collapsible component for a single AI action. It assembles the header, content, and footer.
129
- - `ActionItemHeader.tsx`: Displays the title, type, and status of an action.
130
- - `ActionItemContent.tsx`: The body of the block. It intelligently renders a `DiffEditor` for code changes, a summary for `run_command` actions, or the list of requested items for `request_context`.
131
- - `ActionItemFooter.tsx`: Displays the contextual buttons for a single action (e.g., "Approve", "Revert") based on the current execution strategy and action status.
132
- - `PlanGlobalControls.tsx`: The header bar on the plan page that contains batch-action buttons like "Apply All Approved" or "Revert All".
133
- - `ExecutionLogSummary.tsx`: A summary view at the bottom of the page that displays the final outcome of any executed actions.
134
-
135
- ### Frontend Data Layer
136
-
137
- - #### `lib/api/`
138
- - **Purpose**: This directory contains the client-side functions for making requests to the `backend` API. It acts as a typed SDK for the frontend. Each file typically corresponds to a specific controller on the backend (e.g., `session.ts` for `SessionsController`).
139
- - **Key Files**:
140
- - `client.ts`: Contains the base `handleResponse` logic for all API calls, standardizing error handling and JSON parsing. It also determines the backend API URL.
141
- - `index.ts`: Exports all API functions for easy consumption by the state stores.
142
-
143
- - #### `store/`
144
- - **Purpose**: This is the global state management layer, built with Zustand. It centralizes all application state and the logic for mutating that state. UI components primarily read from these stores and call their action functions.
145
- - **Key Files**:
146
- - `sessionStore.ts`: **The main store for the application.** It combines several "slices" to manage all aspects of a user's session, including the session data itself, UI state, and action logic.
147
- - `session/*.slice.ts`: These files break down the `sessionStore` into logical units: `session.slice` for session lifecycle, `actions.slice` for handling AI actions, `manualLlm.slice` for the manual workflow, and `ui.slice` for UI state.
148
- - Other store files (`contextTemplateStore.ts`, `systemPromptStore.ts`, etc.): These are standalone stores that manage the state for specific management pages (e.g., the list of all context templates).
149
-
150
- ---
151
-
152
- ## 5. Daemon (`/daemon`)
153
-
154
- The daemon is a persistent background service that runs on the user's local machine. It is responsible for managing the lifecycle of backend services and handling system-level tasks like authentication and updates. It communicates via a local REST API on port `9998`.
155
-
156
- ### Key Daemon Components (`daemon/src/`)
157
-
158
- - `index.ts`: The entry point for the daemon. It sets up an Express server and WebSocket server to handle incoming requests.
159
- - `serviceManager.ts`: The core logic for managing backend processes. It uses `pm2` to start, stop, restart, and monitor backend instances for different projects.
160
- - `stateManager.ts`: A singleton that persists the daemon's state (list of services, active port) to a JSON file in `~/.repoburg/services.json`.
161
- - `authManager.ts`: Handles all authentication logic. It verifies JWTs received from the website, stores them securely, and checks their validity. The public key for JWT verification is hardcoded here.
162
- - `api/`: This directory defines the REST endpoints for the daemon:
163
- - `services.ts`: Endpoints for managing services (start, stop, list, etc.).
164
- - `auth.ts`: Endpoints for the device authentication flow (initiating login, checking status).
165
- - `registry.ts`: Endpoints for the frontend to register its port, so the daemon knows which UI to open.
166
- - `system.ts`: Endpoints for system-level operations like triggering a self-update.
167
- - `middleware/checkAuth.ts`: An Express middleware that protects sensitive daemon endpoints by verifying the user's authentication status via `authManager`.
168
-
169
- ---
170
-
171
- ## 6. Daemon Desktop (`/daemon-desktop`)
172
-
173
- This is an Electron application that provides a graphical user interface for the `daemon`. It allows users to manage services, check daemon status, and handle updates without using the command line.
174
-
175
- ### Key Desktop Components (`daemon-desktop/src/`)
176
-
177
- - `main.ts`: The Electron **main process**. Its primary responsibility is to create the application window and to spawn/manage the `repoburg-daemon` as a child process. It also handles all native OS interactions (like file dialogs) and exposes them securely to the UI via IPC.
178
- - `preload.ts`: The Electron **preload script**. This is a critical security layer that creates a bridge between the Node.js environment of the main process and the browser environment of the renderer process. It defines the `window.electronAPI` object, which is the only way the React app can communicate with the main process.
179
- - `renderer.tsx` & `App.tsx`: The **renderer process**, which is the React application itself. `App.tsx` is the root component that builds the UI. It uses the `window.electronAPI` to send commands to the main process (e.g., to start the daemon or list services) and listens for status updates.
180
-
181
- ---
182
-
183
- ## 7. Website (`/website`)
184
-
185
- This is a Next.js application that serves as the public-facing homepage, documentation site, and user authentication portal for the entire Repoburg service.
186
-
187
- ### Key Website Components (`website/src/app/`)
188
-
189
- - `/page.tsx`: The main public landing page for the project.
190
- - `/docs`: The documentation section. It uses Markdown files from the same directory and a dynamic slug route (`[[...slug]]/page.tsx`) to render the content.
191
- - `/login`, `/profile`, `/dashboard`: These pages handle user authentication and account management, using Supabase for the backend. The dashboard provides a web interface to see and manage services controlled by the local daemon.
192
- - `/api/`: Contains server-side API routes crucial for the authentication flow.
193
- - `device/initiate`: Called by the `daemon` to start the device authorization process. It creates a unique device code and returns a login URL.
194
- - `device/poll`: Polled by the `daemon` to check if a user has approved the device code. Returns the access token once approved.
195
- - `daemon/token`: Generates short-lived tokens for authenticated browser sessions to make authorized requests to the local daemon.
196
-
197
- ---
198
-
199
- ## 8. Userscripts (`/userscripts`)
200
-
201
- This package contains the source code for the "AI Studio PowerTools" Tampermonkey userscript. This script is designed to be installed in a user's browser to create a seamless integration between the Repoburg application and Google's AI Studio (or a similar web-based LLM).
202
-
203
- ### Key Userscript Components (`userscripts/src/`)
204
-
205
- - `index.ts`: The main entry point for the userscript. It initializes all features, including querying the local daemon to find the active backend port.
206
- - `webSocketHandler.ts`: Connects to the Repoburg backend's WebSocket server. It listens for `llm-input-generated` events and automatically triggers the `pasteAndRun` action in AI Studio.
207
- - `hotkeys.ts`: Sets up global keyboard shortcuts (e.g., `Cmd+\`) that work on the AI Studio page to trigger specific actions.
208
- - `copyAndSubmit.ts`: Implements the `Cmd+\` functionality. It programmatically copies the latest AI response from the page and submits it to the Repoburg backend via an HTTP request.
209
- - `pasteAndRun.ts`: Implements the `Cmd+'` functionality. It reads from the clipboard and pastes the content into the AI Studio prompt box, then programmatically clicks the "Run" button.
210
- - `clipboardInterceptor.ts`: A clever utility that patches the browser's native clipboard functions (`writeText` and `execCommand('copy')`) to reliably capture the content being copied by the AI Studio web app.
211
- - `autoSubmitOnFinish.ts`: A feature that uses a `MutationObserver` to detect when the AI has finished generating a response, then automatically triggers the `copyAndSubmit` flow.
212
- - `settingsUI.ts` & `settingsManager.ts`: Provides an on-page settings panel to configure the userscript's behavior, such as the Repoburg URL and execution strategy.