repoburg 1.3.198 → 1.3.201

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 (82) hide show
  1. package/agent-pane/backend/data.db +0 -0
  2. package/agent-pane/backend/data.db-shm +0 -0
  3. package/agent-pane/backend/data.db-wal +0 -0
  4. package/agent-pane/backend/dist/index.js +1425 -272
  5. package/agent-pane/backend/src/claude/claude-provider.test.ts +393 -3
  6. package/agent-pane/backend/src/claude/claude-provider.ts +53 -50
  7. package/agent-pane/backend/src/db/index.ts +6 -0
  8. package/agent-pane/backend/src/index.ts +5 -2
  9. package/agent-pane/backend/src/integration/threads-claude-fork.test.ts +241 -0
  10. package/agent-pane/backend/src/providers/index.ts +3 -1
  11. package/agent-pane/backend/src/repoburg/action-mapping.ts +216 -0
  12. package/agent-pane/backend/src/repoburg/agent-runtime-client.test.ts +271 -0
  13. package/agent-pane/backend/src/repoburg/agent-runtime-client.ts +262 -0
  14. package/agent-pane/backend/src/repoburg/backend-resolver.test.ts +271 -0
  15. package/agent-pane/backend/src/repoburg/backend-resolver.ts +246 -0
  16. package/agent-pane/backend/src/repoburg/repoburg-client.test.ts +159 -0
  17. package/agent-pane/backend/src/repoburg/repoburg-client.ts +181 -0
  18. package/agent-pane/backend/src/repoburg/repoburg-provider.test.ts +723 -0
  19. package/agent-pane/backend/src/repoburg/repoburg-provider.ts +422 -0
  20. package/agent-pane/backend/src/repoburg/turn-projector.test.ts +475 -0
  21. package/agent-pane/backend/src/repoburg/turn-projector.ts +537 -0
  22. package/agent-pane/backend/src/routes/providers.test.ts +18 -1
  23. package/agent-pane/backend/src/routes/providers.ts +19 -1
  24. package/agent-pane/backend/src/routes/sessions.ts +12 -0
  25. package/agent-pane/backend/src/routes/threads.ts +21 -6
  26. package/agent-pane/backend/src/routes/turns.test.ts +45 -1
  27. package/agent-pane/frontend/dist/assets/{index-Dwwhx7YN.css → index-34WaZYsW.css} +1 -1
  28. package/agent-pane/frontend/dist/assets/index-y7xlT86e.js +362 -0
  29. package/agent-pane/frontend/dist/index.html +2 -2
  30. package/agent-pane/frontend/src/components/CommentableText.test.tsx +196 -0
  31. package/agent-pane/frontend/src/components/CommentableText.tsx +109 -21
  32. package/agent-pane/frontend/src/components/IdeWorkspace.test.tsx +39 -0
  33. package/agent-pane/frontend/src/components/IdeWorkspace.tsx +28 -2
  34. package/agent-pane/frontend/src/components/ResizeHandle.tsx +29 -0
  35. package/agent-pane/frontend/src/components/panels/ThreadsPanel.tsx +35 -3
  36. package/agent-pane/frontend/src/constants/models.ts +37 -0
  37. package/agent-pane/frontend/src/hooks/useResizable.test.ts +97 -0
  38. package/agent-pane/frontend/src/hooks/useResizable.ts +75 -0
  39. package/agent-pane/frontend/src/store/store.test.ts +35 -0
  40. package/agent-pane/frontend/src/store/uiSlice.ts +50 -0
  41. package/agent-pane/frontend/src/styles/app.css +10 -1
  42. package/agent-pane/frontend/src/test/component-helpers.ts +2 -0
  43. package/agent-pane-bug-repro-no-agent-reply.png +0 -0
  44. package/backend/dist/src/agent-runtime/agent-runtime-event-emitter.d.ts +20 -0
  45. package/backend/dist/src/agent-runtime/agent-runtime-event-emitter.js +112 -0
  46. package/backend/dist/src/agent-runtime/agent-runtime-event-emitter.js.map +1 -0
  47. package/backend/dist/src/agent-runtime/agent-runtime.controller.d.ts +11 -0
  48. package/backend/dist/src/agent-runtime/agent-runtime.controller.js +91 -0
  49. package/backend/dist/src/agent-runtime/agent-runtime.controller.js.map +1 -0
  50. package/backend/dist/src/agent-runtime/agent-runtime.module.d.ts +2 -0
  51. package/backend/dist/src/agent-runtime/agent-runtime.module.js +26 -0
  52. package/backend/dist/src/agent-runtime/agent-runtime.module.js.map +1 -0
  53. package/backend/dist/src/agent-runtime/agent-runtime.types.d.ts +77 -0
  54. package/backend/dist/src/agent-runtime/agent-runtime.types.js +3 -0
  55. package/backend/dist/src/agent-runtime/agent-runtime.types.js.map +1 -0
  56. package/backend/dist/src/app.module.js +4 -0
  57. package/backend/dist/src/app.module.js.map +1 -1
  58. package/backend/dist/src/interactive-chat/chat.module.js +4 -0
  59. package/backend/dist/src/interactive-chat/chat.module.js.map +1 -1
  60. package/backend/dist/src/interactive-chat/chat.service.d.ts +3 -1
  61. package/backend/dist/src/interactive-chat/chat.service.js +33 -6
  62. package/backend/dist/src/interactive-chat/chat.service.js.map +1 -1
  63. package/backend/dist/src/llm-orchestration/hooks/frontend-notification.hook.d.ts +3 -1
  64. package/backend/dist/src/llm-orchestration/hooks/frontend-notification.hook.js +20 -2
  65. package/backend/dist/src/llm-orchestration/hooks/frontend-notification.hook.js.map +1 -1
  66. package/backend/dist/src/llm-orchestration/llm-orchestration.module.js +2 -0
  67. package/backend/dist/src/llm-orchestration/llm-orchestration.module.js.map +1 -1
  68. package/backend/dist/src/llm-orchestration/llm-turn-processor.service.d.ts +4 -1
  69. package/backend/dist/src/llm-orchestration/llm-turn-processor.service.js +35 -2
  70. package/backend/dist/src/llm-orchestration/llm-turn-processor.service.js.map +1 -1
  71. package/backend/dist/src/llm-provider/ollama-llm.provider.d.ts +1 -0
  72. package/backend/dist/src/llm-provider/ollama-llm.provider.js +20 -1
  73. package/backend/dist/src/llm-provider/ollama-llm.provider.js.map +1 -1
  74. package/backend/dist/src/llm-responses/llm-responses.module.js +4 -0
  75. package/backend/dist/src/llm-responses/llm-responses.module.js.map +1 -1
  76. package/backend/dist/src/llm-responses/llm-responses.service.d.ts +4 -1
  77. package/backend/dist/src/llm-responses/llm-responses.service.js +52 -2
  78. package/backend/dist/src/llm-responses/llm-responses.service.js.map +1 -1
  79. package/backend/dist/tsconfig.build.tsbuildinfo +1 -1
  80. package/daemon/dist/index.js +0 -0
  81. package/package.json +1 -1
  82. package/agent-pane/frontend/dist/assets/index-BYo-lnxm.js +0 -362
@@ -0,0 +1,181 @@
1
+ /**
2
+ * Repoburg backend runtime client — HTTP-only control surface.
3
+ *
4
+ * POST /sessions create a runtime session
5
+ * PATCH /sessions/:id update model / reasoning
6
+ * GET /sessions/:id fetch session (title + is_running)
7
+ * POST /sessions/:id/inputs start an agent turn
8
+ * GET /sessions/:id/inputs full snapshot (inputs + actions)
9
+ * GET /sessions/:id/inputs/:inputId/actions-with-logs
10
+ * POST /streaming/:sessionId/cancel abort the in-flight LLM call
11
+ * GET /llm-provider/models model catalog
12
+ *
13
+ * The MESSAGE STREAM lives on the separate agent-runtime SSE channel
14
+ * (agent-runtime-client.ts) — this client is control + snapshot only.
15
+ *
16
+ * Base URL: supplied by the caller — resolved per workspace via the
17
+ * platform daemon (backend-resolver.ts); REPOBURG_BACKEND_URL overrides.
18
+ */
19
+
20
+ // ---------------------------------------------------------------------------
21
+ // Runtime API types (mirror the backend's DTOs/entities — read-only subset)
22
+ // ---------------------------------------------------------------------------
23
+
24
+ export interface RepoburgModel {
25
+ id: string;
26
+ name: string;
27
+ }
28
+
29
+ export interface RepoburgSessionDto {
30
+ session_title?: string;
31
+ model_id?: string;
32
+ reasoning_effort?: string;
33
+ }
34
+
35
+ export interface RepoburgSession {
36
+ id: string;
37
+ session_title?: string | null;
38
+ model_id?: string | null;
39
+ is_running?: boolean | null;
40
+ }
41
+
42
+ export interface RepoburgCreateInputDto {
43
+ user_prompt: string;
44
+ /** Per-input execution strategy. `auto_apply` keeps actions autonomous. */
45
+ execution_strategy: string;
46
+ }
47
+
48
+ export interface RepoburgExecutionLog {
49
+ output?: string | null;
50
+ error_message?: string | null;
51
+ }
52
+
53
+ export interface RepoburgAction {
54
+ id: string;
55
+ action_type: string;
56
+ file_path?: string | null;
57
+ command_string?: string | null;
58
+ status: string;
59
+ server_name?: string | null;
60
+ tool_name?: string | null;
61
+ arguments?: string | null;
62
+ plain?: string | null;
63
+ reason?: string | null;
64
+ order_of_execution?: number;
65
+ executionLogs?: RepoburgExecutionLog[];
66
+ }
67
+
68
+ export interface RepoburgSessionInput {
69
+ id: string;
70
+ session_id: string;
71
+ role?: string;
72
+ user_prompt?: string | null;
73
+ raw_llm_response?: string | null;
74
+ thoughts?: string | null;
75
+ input_token_count?: number | null;
76
+ output_token_count?: number | null;
77
+ cached_token_count?: number | null;
78
+ error_message?: string | null;
79
+ aiActions?: RepoburgAction[];
80
+ }
81
+
82
+ /** Interface — the provider depends on this, not on the HTTP implementation. */
83
+ export interface RepoburgRuntimeClient {
84
+ createSession(dto: RepoburgSessionDto): Promise<RepoburgSession>;
85
+ patchSession(id: string, dto: Partial<RepoburgSessionDto>): Promise<RepoburgSession>;
86
+ getSession(id: string): Promise<RepoburgSession>;
87
+ createInput(sessionId: string, dto: RepoburgCreateInputDto): Promise<RepoburgSessionInput>;
88
+ getInputWithActions(sessionId: string, inputId: string): Promise<RepoburgSessionInput>;
89
+ /** Full snapshot: all inputs of the session with actions + logs (ASC). */
90
+ getSessionInputs(sessionId: string): Promise<RepoburgSessionInput[]>;
91
+ cancel(sessionId: string): Promise<{ success: boolean; cancelled: boolean }>;
92
+ getModels(): Promise<RepoburgModel[]>;
93
+ }
94
+
95
+ // ---------------------------------------------------------------------------
96
+ // HTTP implementation
97
+ // ---------------------------------------------------------------------------
98
+
99
+ /** Default base URL of the repoburg backend. */
100
+ export function defaultRepoburgBaseUrl(): string {
101
+ return process.env.REPOBURG_BACKEND_URL || 'http://localhost:3000';
102
+ }
103
+
104
+ /** Detect an HTML response body (error page served by the wrong server). */
105
+ function isHtml(text: string): boolean {
106
+ return /^\s*<(?:!doctype|html)/i.test(text);
107
+ }
108
+
109
+ /** HTTP client for the repoburg runtime control API (stateless fetch). */
110
+ export class RepoburgHttpClient implements RepoburgRuntimeClient {
111
+ private readonly baseUrl: string;
112
+
113
+ constructor(baseUrl: string = defaultRepoburgBaseUrl()) {
114
+ this.baseUrl = baseUrl.replace(/\/+$/, '');
115
+ }
116
+
117
+ /** Perform a JSON request. Throws a concise error on non-OK/non-JSON responses. */
118
+ private async request<T>(method: string, path: string, body?: unknown): Promise<T> {
119
+ const response = await fetch(`${this.baseUrl}${path}`, {
120
+ method,
121
+ headers: { 'Content-Type': 'application/json' },
122
+ body: body === undefined ? undefined : JSON.stringify(body),
123
+ });
124
+ const text = await response.text();
125
+ if (!response.ok) {
126
+ if (isHtml(text)) {
127
+ // An HTML error page means the URL does not serve the repoburg API.
128
+ throw new Error(
129
+ `${method} ${path} failed: ${response.status} HTML response from ${this.baseUrl} — the URL points to the wrong server`,
130
+ );
131
+ }
132
+ throw new Error(`${method} ${path} failed: ${response.status} ${text}`);
133
+ }
134
+ try {
135
+ return JSON.parse(text) as T;
136
+ } catch {
137
+ throw new Error(
138
+ `${method} ${path} failed: non-JSON response from ${this.baseUrl} — the URL points to the wrong server`,
139
+ );
140
+ }
141
+ }
142
+
143
+ async createSession(dto: RepoburgSessionDto): Promise<RepoburgSession> {
144
+ return this.request<RepoburgSession>('POST', '/sessions', dto);
145
+ }
146
+
147
+ async patchSession(id: string, dto: Partial<RepoburgSessionDto>): Promise<RepoburgSession> {
148
+ return this.request<RepoburgSession>('PATCH', `/sessions/${id}`, dto);
149
+ }
150
+
151
+ async getSession(id: string): Promise<RepoburgSession> {
152
+ return this.request<RepoburgSession>('GET', `/sessions/${id}`);
153
+ }
154
+
155
+ async createInput(sessionId: string, dto: RepoburgCreateInputDto): Promise<RepoburgSessionInput> {
156
+ return this.request<RepoburgSessionInput>('POST', `/sessions/${sessionId}/inputs`, dto);
157
+ }
158
+
159
+ async getInputWithActions(sessionId: string, inputId: string): Promise<RepoburgSessionInput> {
160
+ return this.request<RepoburgSessionInput>(
161
+ 'GET',
162
+ `/sessions/${sessionId}/inputs/${inputId}/actions-with-logs`,
163
+ );
164
+ }
165
+
166
+ async getSessionInputs(sessionId: string): Promise<RepoburgSessionInput[]> {
167
+ return this.request<RepoburgSessionInput[]>('GET', `/sessions/${sessionId}/inputs`);
168
+ }
169
+
170
+ async cancel(sessionId: string): Promise<{ success: boolean; cancelled: boolean }> {
171
+ return this.request<{ success: boolean; cancelled: boolean }>(
172
+ 'POST',
173
+ `/streaming/${sessionId}/cancel`,
174
+ );
175
+ }
176
+
177
+ async getModels(): Promise<RepoburgModel[]> {
178
+ const result = await this.request<{ models: RepoburgModel[] }>('GET', '/llm-provider/models');
179
+ return result.models ?? [];
180
+ }
181
+ }