@lovelybunch/api 1.0.69-alpha.5 → 1.0.69-alpha.7
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.
- package/dist/lib/git.d.ts +2 -1
- package/dist/lib/git.js +34 -3
- package/dist/lib/user-preferences.d.ts +2 -1
- package/dist/routes/api/v1/git/index.js +2 -1
- package/dist/routes/api/v1/jobs/[id]/runs/[runId]/log/route.d.ts +2 -2
- package/package.json +4 -4
- package/static/assets/{index-ZOkx8dA0.css → index-CZlGQgj6.css} +1 -1
- package/static/assets/index-DVsxjomS.js +906 -0
- package/static/index.html +2 -2
- package/static/assets/index-DpF5lCvw.js +0 -896
package/dist/lib/git.d.ts
CHANGED
|
@@ -43,7 +43,8 @@ export declare function getCredentialConfig(): Promise<{
|
|
|
43
43
|
helper?: string;
|
|
44
44
|
origin?: string;
|
|
45
45
|
}>;
|
|
46
|
-
export declare function
|
|
46
|
+
export declare function setRemoteUrl(remoteUrl: string): Promise<void>;
|
|
47
|
+
export declare function storeCredentials(username: string, password: string, remoteUrl?: string): Promise<void>;
|
|
47
48
|
export interface WorktreeInfo {
|
|
48
49
|
name: string;
|
|
49
50
|
path: string;
|
package/dist/lib/git.js
CHANGED
|
@@ -211,10 +211,41 @@ export async function getCredentialConfig() {
|
|
|
211
211
|
return {};
|
|
212
212
|
}
|
|
213
213
|
}
|
|
214
|
-
export async function
|
|
214
|
+
export async function setRemoteUrl(remoteUrl) {
|
|
215
|
+
// Validate the remote URL
|
|
216
|
+
if (!remoteUrl.trim()) {
|
|
217
|
+
throw new Error('Remote URL is required');
|
|
218
|
+
}
|
|
219
|
+
const trimmed = remoteUrl.trim();
|
|
220
|
+
// Check if it's a valid URL format
|
|
221
|
+
if (!trimmed.startsWith('https://') && !trimmed.startsWith('http://') && !trimmed.startsWith('git@')) {
|
|
222
|
+
throw new Error('Remote URL must start with https://, http://, or git@');
|
|
223
|
+
}
|
|
224
|
+
// Check if origin already exists
|
|
225
|
+
try {
|
|
226
|
+
await runGit(['config', '--get', 'remote.origin.url']);
|
|
227
|
+
// If we get here, origin exists, so update it
|
|
228
|
+
await runGit(['remote', 'set-url', 'origin', trimmed]);
|
|
229
|
+
}
|
|
230
|
+
catch {
|
|
231
|
+
// Origin doesn't exist, add it
|
|
232
|
+
await runGit(['remote', 'add', 'origin', trimmed]);
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
export async function storeCredentials(username, password, remoteUrl) {
|
|
236
|
+
// If a remote URL is provided, set it first
|
|
237
|
+
if (remoteUrl && remoteUrl.trim()) {
|
|
238
|
+
await setRemoteUrl(remoteUrl);
|
|
239
|
+
}
|
|
215
240
|
// Get remote URL to determine protocol and host
|
|
216
|
-
|
|
217
|
-
|
|
241
|
+
let remote;
|
|
242
|
+
try {
|
|
243
|
+
const { stdout: remoteUrlOutput } = await runGit(['config', '--get', 'remote.origin.url']);
|
|
244
|
+
remote = remoteUrlOutput.trim();
|
|
245
|
+
}
|
|
246
|
+
catch {
|
|
247
|
+
throw new Error('No git remote configured. Please provide a remote URL.');
|
|
248
|
+
}
|
|
218
249
|
// Parse the remote URL to extract protocol and host
|
|
219
250
|
let protocol = 'https';
|
|
220
251
|
let host = '';
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
import type { AgentRoleId } from '@lovelybunch/types';
|
|
1
2
|
export interface UserProfile {
|
|
2
3
|
firstName?: string;
|
|
3
4
|
lastName?: string;
|
|
4
5
|
email?: string;
|
|
5
|
-
role?:
|
|
6
|
+
role?: AgentRoleId;
|
|
6
7
|
}
|
|
7
8
|
export interface UserPreferences {
|
|
8
9
|
theme?: 'light' | 'dark' | 'coconut' | 'system';
|
|
@@ -84,10 +84,11 @@ app.post('/credentials', async (c) => {
|
|
|
84
84
|
const body = await c.req.json();
|
|
85
85
|
const username = String(body?.username || '');
|
|
86
86
|
const password = String(body?.password || '');
|
|
87
|
+
const remoteUrl = body?.remoteUrl ? String(body.remoteUrl) : undefined;
|
|
87
88
|
if (!username || !password) {
|
|
88
89
|
return c.json({ success: false, error: { message: 'Username and password are required' } }, 400);
|
|
89
90
|
}
|
|
90
|
-
await storeCredentials(username, password);
|
|
91
|
+
await storeCredentials(username, password, remoteUrl);
|
|
91
92
|
return c.json({ success: true, data: { message: 'Credentials stored successfully' } });
|
|
92
93
|
}
|
|
93
94
|
catch (e) {
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { Context } from 'hono';
|
|
2
|
-
export declare function GET(c: Context): Promise<(Response & import("hono").TypedResponse<{
|
|
2
|
+
export declare function GET(c: Context): Promise<(Response & import("hono").TypedResponse<string, import("hono/utils/http-status").ContentfulStatusCode, "text">) | (Response & import("hono").TypedResponse<{
|
|
3
3
|
success: false;
|
|
4
4
|
error: {
|
|
5
5
|
code: string;
|
|
6
6
|
message: string;
|
|
7
7
|
};
|
|
8
|
-
}, 404, "json">) | (Response & import("hono").TypedResponse<
|
|
8
|
+
}, 404, "json">) | (Response & import("hono").TypedResponse<{
|
|
9
9
|
success: false;
|
|
10
10
|
error: {
|
|
11
11
|
code: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lovelybunch/api",
|
|
3
|
-
"version": "1.0.69-alpha.
|
|
3
|
+
"version": "1.0.69-alpha.7",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "dist/server-with-static.js",
|
|
6
6
|
"exports": {
|
|
@@ -36,9 +36,9 @@
|
|
|
36
36
|
"dependencies": {
|
|
37
37
|
"@hono/node-server": "^1.13.7",
|
|
38
38
|
"@hono/node-ws": "^1.0.6",
|
|
39
|
-
"@lovelybunch/core": "^1.0.69-alpha.
|
|
40
|
-
"@lovelybunch/mcp": "^1.0.69-alpha.
|
|
41
|
-
"@lovelybunch/types": "^1.0.69-alpha.
|
|
39
|
+
"@lovelybunch/core": "^1.0.69-alpha.7",
|
|
40
|
+
"@lovelybunch/mcp": "^1.0.69-alpha.7",
|
|
41
|
+
"@lovelybunch/types": "^1.0.69-alpha.7",
|
|
42
42
|
"arctic": "^1.9.2",
|
|
43
43
|
"bcrypt": "^5.1.1",
|
|
44
44
|
"cookie": "^0.6.0",
|