@codori/server 0.0.6 → 0.0.8
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/client-dist/200.html +1 -1
- package/client-dist/404.html +1 -1
- package/client-dist/_nuxt/B7yopJE3.js +3 -0
- package/client-dist/_nuxt/B8_cBFA9.js +1 -0
- package/client-dist/_nuxt/Bk7H2xOD.js +1 -0
- package/client-dist/_nuxt/CQFyC11H.js +1 -0
- package/client-dist/_nuxt/CffXNgAK.js +30 -0
- package/client-dist/_nuxt/{Drc5UVEu.js → D6utdzqd.js} +1 -1
- package/client-dist/_nuxt/D9aI13e2.js +1 -0
- package/client-dist/_nuxt/DXa1zfQy.js +597 -0
- package/client-dist/_nuxt/{DPr9MomB.js → Dxmgurnr.js} +1 -1
- package/client-dist/_nuxt/KaTeX_AMS-Regular.BQhdFMY1.woff2 +0 -0
- package/client-dist/_nuxt/KaTeX_AMS-Regular.DMm9YOAa.woff +0 -0
- package/client-dist/_nuxt/KaTeX_AMS-Regular.DRggAlZN.ttf +0 -0
- package/client-dist/_nuxt/KaTeX_Caligraphic-Bold.ATXxdsX0.ttf +0 -0
- package/client-dist/_nuxt/KaTeX_Caligraphic-Bold.BEiXGLvX.woff +0 -0
- package/client-dist/_nuxt/KaTeX_Caligraphic-Bold.Dq_IR9rO.woff2 +0 -0
- package/client-dist/_nuxt/KaTeX_Caligraphic-Regular.CTRA-rTL.woff +0 -0
- package/client-dist/_nuxt/KaTeX_Caligraphic-Regular.Di6jR-x-.woff2 +0 -0
- package/client-dist/_nuxt/KaTeX_Caligraphic-Regular.wX97UBjC.ttf +0 -0
- package/client-dist/_nuxt/KaTeX_Fraktur-Bold.BdnERNNW.ttf +0 -0
- package/client-dist/_nuxt/KaTeX_Fraktur-Bold.BsDP51OF.woff +0 -0
- package/client-dist/_nuxt/KaTeX_Fraktur-Bold.CL6g_b3V.woff2 +0 -0
- package/client-dist/_nuxt/KaTeX_Fraktur-Regular.CB_wures.ttf +0 -0
- package/client-dist/_nuxt/KaTeX_Fraktur-Regular.CTYiF6lA.woff2 +0 -0
- package/client-dist/_nuxt/KaTeX_Fraktur-Regular.Dxdc4cR9.woff +0 -0
- package/client-dist/_nuxt/KaTeX_Main-Bold.Cx986IdX.woff2 +0 -0
- package/client-dist/_nuxt/KaTeX_Main-Bold.Jm3AIy58.woff +0 -0
- package/client-dist/_nuxt/KaTeX_Main-Bold.waoOVXN0.ttf +0 -0
- package/client-dist/_nuxt/KaTeX_Main-BoldItalic.DxDJ3AOS.woff2 +0 -0
- package/client-dist/_nuxt/KaTeX_Main-BoldItalic.DzxPMmG6.ttf +0 -0
- package/client-dist/_nuxt/KaTeX_Main-BoldItalic.SpSLRI95.woff +0 -0
- package/client-dist/_nuxt/KaTeX_Main-Italic.3WenGoN9.ttf +0 -0
- package/client-dist/_nuxt/KaTeX_Main-Italic.BMLOBm91.woff +0 -0
- package/client-dist/_nuxt/KaTeX_Main-Italic.NWA7e6Wa.woff2 +0 -0
- package/client-dist/_nuxt/KaTeX_Main-Regular.B22Nviop.woff2 +0 -0
- package/client-dist/_nuxt/KaTeX_Main-Regular.Dr94JaBh.woff +0 -0
- package/client-dist/_nuxt/KaTeX_Main-Regular.ypZvNtVU.ttf +0 -0
- package/client-dist/_nuxt/KaTeX_Math-BoldItalic.B3XSjfu4.ttf +0 -0
- package/client-dist/_nuxt/KaTeX_Math-BoldItalic.CZnvNsCZ.woff2 +0 -0
- package/client-dist/_nuxt/KaTeX_Math-BoldItalic.iY-2wyZ7.woff +0 -0
- package/client-dist/_nuxt/KaTeX_Math-Italic.DA0__PXp.woff +0 -0
- package/client-dist/_nuxt/KaTeX_Math-Italic.flOr_0UB.ttf +0 -0
- package/client-dist/_nuxt/KaTeX_Math-Italic.t53AETM-.woff2 +0 -0
- package/client-dist/_nuxt/KaTeX_SansSerif-Bold.CFMepnvq.ttf +0 -0
- package/client-dist/_nuxt/KaTeX_SansSerif-Bold.D1sUS0GD.woff2 +0 -0
- package/client-dist/_nuxt/KaTeX_SansSerif-Bold.DbIhKOiC.woff +0 -0
- package/client-dist/_nuxt/KaTeX_SansSerif-Italic.C3H0VqGB.woff2 +0 -0
- package/client-dist/_nuxt/KaTeX_SansSerif-Italic.DN2j7dab.woff +0 -0
- package/client-dist/_nuxt/KaTeX_SansSerif-Italic.YYjJ1zSn.ttf +0 -0
- package/client-dist/_nuxt/KaTeX_SansSerif-Regular.BNo7hRIc.ttf +0 -0
- package/client-dist/_nuxt/KaTeX_SansSerif-Regular.CS6fqUqJ.woff +0 -0
- package/client-dist/_nuxt/KaTeX_SansSerif-Regular.DDBCnlJ7.woff2 +0 -0
- package/client-dist/_nuxt/KaTeX_Script-Regular.C5JkGWo-.ttf +0 -0
- package/client-dist/_nuxt/KaTeX_Script-Regular.D3wIWfF6.woff2 +0 -0
- package/client-dist/_nuxt/KaTeX_Script-Regular.D5yQViql.woff +0 -0
- package/client-dist/_nuxt/KaTeX_Size1-Regular.C195tn64.woff +0 -0
- package/client-dist/_nuxt/KaTeX_Size1-Regular.Dbsnue_I.ttf +0 -0
- package/client-dist/_nuxt/KaTeX_Size1-Regular.mCD8mA8B.woff2 +0 -0
- package/client-dist/_nuxt/KaTeX_Size2-Regular.B7gKUWhC.ttf +0 -0
- package/client-dist/_nuxt/KaTeX_Size2-Regular.Dy4dx90m.woff2 +0 -0
- package/client-dist/_nuxt/KaTeX_Size2-Regular.oD1tc_U0.woff +0 -0
- package/client-dist/_nuxt/KaTeX_Size3-Regular.CTq5MqoE.woff +0 -0
- package/client-dist/_nuxt/KaTeX_Size3-Regular.DgpXs0kz.ttf +0 -0
- package/client-dist/_nuxt/KaTeX_Size4-Regular.BF-4gkZK.woff +0 -0
- package/client-dist/_nuxt/KaTeX_Size4-Regular.DWFBv043.ttf +0 -0
- package/client-dist/_nuxt/KaTeX_Size4-Regular.Dl5lxZxV.woff2 +0 -0
- package/client-dist/_nuxt/KaTeX_Typewriter-Regular.C0xS9mPB.woff +0 -0
- package/client-dist/_nuxt/KaTeX_Typewriter-Regular.CO6r4hn1.woff2 +0 -0
- package/client-dist/_nuxt/KaTeX_Typewriter-Regular.D3Ib7_Hf.ttf +0 -0
- package/client-dist/_nuxt/Slideover.J-Ge-Kkm.css +1 -0
- package/client-dist/_nuxt/ThreadPanel.BHk6HOog.css +1 -0
- package/client-dist/_nuxt/{BjFv3Asz.js → WoCgUiHo.js} +1 -1
- package/client-dist/_nuxt/builds/latest.json +1 -1
- package/client-dist/_nuxt/builds/meta/01eeb64a-c6d1-42a4-a4e3-81068fd206df.json +1 -0
- package/client-dist/_nuxt/entry.CVhSK9VF.css +1 -0
- package/client-dist/_nuxt/{fq4vhgdj.js → hh6-qavt.js} +1 -1
- package/client-dist/_nuxt/i8dRX8kB.js +1 -0
- package/client-dist/index.html +1 -1
- package/dist/git.d.ts +5 -0
- package/dist/git.js +45 -0
- package/dist/http-server.js +7 -0
- package/package.json +1 -1
- package/client-dist/_nuxt/Bu9-xwVq.js +0 -30
- package/client-dist/_nuxt/CFkMEx7S.js +0 -1
- package/client-dist/_nuxt/CbjhYhFI.js +0 -202
- package/client-dist/_nuxt/Cnwn2UOE.js +0 -1
- package/client-dist/_nuxt/CpVwH_SO.js +0 -1
- package/client-dist/_nuxt/Czi9Vc69.js +0 -1
- package/client-dist/_nuxt/DO8fkmnd.js +0 -1
- package/client-dist/_nuxt/DQDcc3G9.js +0 -3
- package/client-dist/_nuxt/NavigationMenu.DYbev1Hq.css +0 -1
- package/client-dist/_nuxt/builds/meta/dc5dd260-49e0-46d3-9e02-62e03e501794.json +0 -1
- package/client-dist/_nuxt/entry.BFUss7SH.css +0 -1
package/dist/git.d.ts
ADDED
package/dist/git.js
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { execFile } from 'node:child_process';
|
|
2
|
+
import { promisify } from 'node:util';
|
|
3
|
+
const execFileAsync = promisify(execFile);
|
|
4
|
+
const runGit = async (projectPath, args) => {
|
|
5
|
+
const { stdout } = await execFileAsync('git', args, {
|
|
6
|
+
cwd: projectPath,
|
|
7
|
+
encoding: 'utf8'
|
|
8
|
+
});
|
|
9
|
+
return stdout.trim();
|
|
10
|
+
};
|
|
11
|
+
export const listGitBranches = async (projectPath) => {
|
|
12
|
+
let branchesOutput = '';
|
|
13
|
+
try {
|
|
14
|
+
branchesOutput = await runGit(projectPath, [
|
|
15
|
+
'for-each-ref',
|
|
16
|
+
'--sort=refname',
|
|
17
|
+
'--format=%(refname:short)',
|
|
18
|
+
'refs/heads'
|
|
19
|
+
]);
|
|
20
|
+
}
|
|
21
|
+
catch {
|
|
22
|
+
return {
|
|
23
|
+
currentBranch: null,
|
|
24
|
+
branches: []
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
let currentBranch = null;
|
|
28
|
+
try {
|
|
29
|
+
currentBranch = (await runGit(projectPath, ['branch', '--show-current'])) || null;
|
|
30
|
+
}
|
|
31
|
+
catch {
|
|
32
|
+
currentBranch = null;
|
|
33
|
+
}
|
|
34
|
+
const branchSet = new Set(branchesOutput
|
|
35
|
+
.split('\n')
|
|
36
|
+
.map(branch => branch.trim())
|
|
37
|
+
.filter(Boolean));
|
|
38
|
+
if (currentBranch) {
|
|
39
|
+
branchSet.add(currentBranch);
|
|
40
|
+
}
|
|
41
|
+
return {
|
|
42
|
+
currentBranch,
|
|
43
|
+
branches: [...branchSet]
|
|
44
|
+
};
|
|
45
|
+
};
|
package/dist/http-server.js
CHANGED
|
@@ -11,6 +11,7 @@ import { lookup as lookupMimeType } from 'mime-types';
|
|
|
11
11
|
import WebSocket from 'ws';
|
|
12
12
|
import { isPathInsideDirectory, persistThreadAttachmentStream, readAttachmentMetadata, resolveProjectAttachmentsDir } from './attachment-store.js';
|
|
13
13
|
import { CodoriError } from './errors.js';
|
|
14
|
+
import { listGitBranches } from './git.js';
|
|
14
15
|
import { createRuntimeManager } from './process-manager.js';
|
|
15
16
|
import { createServiceUpdateController } from './service-update.js';
|
|
16
17
|
const isCodoriError = (error) => error instanceof CodoriError;
|
|
@@ -193,6 +194,12 @@ export const createHttpServer = async (manager, options = {}) => {
|
|
|
193
194
|
app.get('/api/projects/:projectId/status', async (request) => ({
|
|
194
195
|
project: await resolveValue(manager.getProjectStatus(getProjectIdFromRequest(request.params.projectId)))
|
|
195
196
|
}));
|
|
197
|
+
app.get('/api/projects/:projectId/git/branches', async (request) => {
|
|
198
|
+
const projectId = getProjectIdFromRequest(request.params.projectId);
|
|
199
|
+
const project = await resolveValue(manager.getProjectStatus(projectId));
|
|
200
|
+
await touchProjectActivity(manager, projectId);
|
|
201
|
+
return await listGitBranches(project.projectPath);
|
|
202
|
+
});
|
|
196
203
|
app.post('/api/projects/:projectId/start', async (request) => ({
|
|
197
204
|
project: await resolveValue(manager.startProject(getProjectIdFromRequest(request.params.projectId)))
|
|
198
205
|
}));
|