@prmichaelsen/acp-visualizer 0.2.1 → 0.5.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.
- package/package.json +12 -2
- package/src/components/DependencyGraph.tsx +196 -0
- package/src/components/FilterBar.tsx +1 -0
- package/src/components/GitHubInput.tsx +65 -0
- package/src/components/MilestoneGantt.tsx +150 -0
- package/src/components/MilestoneKanban.tsx +15 -2
- package/src/components/ProjectSelector.tsx +66 -0
- package/src/components/Sidebar.tsx +24 -2
- package/src/components/StatusBadge.tsx +2 -0
- package/src/components/StatusDot.tsx +1 -0
- package/src/components/ViewToggle.tsx +3 -1
- package/src/contexts/ProgressContext.tsx +22 -0
- package/src/lib/types.ts +1 -1
- package/src/lib/yaml-loader-real.spec.ts +54 -1
- package/src/lib/yaml-loader.ts +134 -5
- package/src/routes/__root.tsx +136 -22
- package/src/routes/activity.tsx +2 -2
- package/src/routes/index.tsx +23 -6
- package/src/routes/milestones.tsx +15 -3
- package/src/routes/search.tsx +2 -1
- package/src/routes/tasks.tsx +2 -1
- package/src/server.ts +13 -0
- package/src/services/github.service.ts +51 -0
- package/src/services/progress-database.service.ts +17 -39
- package/src/services/projects.service.ts +69 -0
- package/vite.config.ts +7 -2
|
@@ -3,47 +3,25 @@ import type { ProgressData } from '../lib/types'
|
|
|
3
3
|
|
|
4
4
|
export type ProgressResult =
|
|
5
5
|
| { ok: true; data: ProgressData }
|
|
6
|
-
| { ok: false; error: 'FILE_NOT_FOUND' | 'PARSE_ERROR'; message: string; path: string }
|
|
7
|
-
|
|
8
|
-
export const getProgressData = createServerFn({ method: 'GET' }).handler(
|
|
9
|
-
async (): Promise<ProgressResult> => {
|
|
10
|
-
// Dynamic imports keep fs and yaml-loader out of the client bundle
|
|
11
|
-
const { readFileSync } = await import('fs')
|
|
12
|
-
const { parseProgressYaml } = await import('../lib/yaml-loader')
|
|
13
|
-
const { getProgressYamlPath } = await import('../lib/config')
|
|
14
|
-
|
|
15
|
-
const filePath = getProgressYamlPath()
|
|
6
|
+
| { ok: false; error: 'FILE_NOT_FOUND' | 'PARSE_ERROR' | 'NO_FILESYSTEM'; message: string; path: string }
|
|
16
7
|
|
|
8
|
+
export const getProgressData = createServerFn({ method: 'GET' })
|
|
9
|
+
.inputValidator((input: { path?: string }) => input)
|
|
10
|
+
.handler(async ({ data: input }): Promise<ProgressResult> => {
|
|
17
11
|
try {
|
|
18
|
-
const
|
|
12
|
+
const fs = await import('fs')
|
|
13
|
+
const { parseProgressYaml } = await import('../lib/yaml-loader')
|
|
14
|
+
const { getProgressYamlPath } = await import('../lib/config')
|
|
19
15
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
message: err instanceof Error ? err.message : 'Failed to parse YAML',
|
|
28
|
-
path: filePath,
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
} catch (err) {
|
|
32
|
-
const code = (err as NodeJS.ErrnoException).code
|
|
33
|
-
if (code === 'ENOENT') {
|
|
34
|
-
return {
|
|
35
|
-
ok: false,
|
|
36
|
-
error: 'FILE_NOT_FOUND',
|
|
37
|
-
message: `progress.yaml not found at: ${filePath}`,
|
|
38
|
-
path: filePath,
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
return {
|
|
42
|
-
ok: false,
|
|
43
|
-
error: 'PARSE_ERROR',
|
|
44
|
-
message: err instanceof Error ? err.message : 'Failed to read file',
|
|
45
|
-
path: filePath,
|
|
16
|
+
const filePath = input.path || getProgressYamlPath()
|
|
17
|
+
const raw = fs.readFileSync(filePath, 'utf-8')
|
|
18
|
+
const data = parseProgressYaml(raw)
|
|
19
|
+
return { ok: true, data }
|
|
20
|
+
} catch (err: any) {
|
|
21
|
+
if (err?.code === 'ENOENT') {
|
|
22
|
+
return { ok: false, error: 'FILE_NOT_FOUND', message: `progress.yaml not found`, path: input.path || '' }
|
|
46
23
|
}
|
|
24
|
+
// Cloudflare Workers: fs module exists but readFileSync throws
|
|
25
|
+
return { ok: false, error: 'NO_FILESYSTEM', message: 'No local filesystem — use GitHub input to load a project', path: '' }
|
|
47
26
|
}
|
|
48
|
-
}
|
|
49
|
-
)
|
|
27
|
+
})
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { createServerFn } from '@tanstack/react-start'
|
|
2
|
+
|
|
3
|
+
export interface AcpProject {
|
|
4
|
+
id: string
|
|
5
|
+
path: string
|
|
6
|
+
type: string
|
|
7
|
+
description: string
|
|
8
|
+
status: string
|
|
9
|
+
hasProgress: boolean
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export const listProjects = createServerFn({ method: 'GET' }).handler(
|
|
13
|
+
async (): Promise<AcpProject[]> => {
|
|
14
|
+
try {
|
|
15
|
+
const { readFileSync, existsSync } = await import('fs')
|
|
16
|
+
const { resolve } = await import('path')
|
|
17
|
+
const { homedir } = await import('os')
|
|
18
|
+
const yaml = await import('js-yaml')
|
|
19
|
+
|
|
20
|
+
const projectsFile = resolve(homedir(), '.acp', 'projects.yaml')
|
|
21
|
+
if (!existsSync(projectsFile)) return []
|
|
22
|
+
|
|
23
|
+
const raw = readFileSync(projectsFile, 'utf-8')
|
|
24
|
+
const doc = yaml.load(raw, { json: true }) as Record<string, unknown>
|
|
25
|
+
const projects = (doc?.projects || {}) as Record<string, Record<string, unknown>>
|
|
26
|
+
|
|
27
|
+
return Object.entries(projects).map(([id, p]) => {
|
|
28
|
+
const projectPath = String(p.path || '')
|
|
29
|
+
const progressPath = resolve(projectPath, 'agent', 'progress.yaml')
|
|
30
|
+
return {
|
|
31
|
+
id,
|
|
32
|
+
path: projectPath,
|
|
33
|
+
type: String(p.type || 'unknown'),
|
|
34
|
+
description: String(p.description || ''),
|
|
35
|
+
status: String(p.status || 'unknown'),
|
|
36
|
+
hasProgress: existsSync(progressPath),
|
|
37
|
+
}
|
|
38
|
+
})
|
|
39
|
+
} catch {
|
|
40
|
+
// Cloudflare Workers: no filesystem
|
|
41
|
+
return []
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
)
|
|
45
|
+
|
|
46
|
+
export const getProjectProgressPath = createServerFn({ method: 'GET' })
|
|
47
|
+
.inputValidator((input: { projectId: string }) => input)
|
|
48
|
+
.handler(async ({ data }): Promise<string | null> => {
|
|
49
|
+
try {
|
|
50
|
+
const { readFileSync, existsSync } = await import('fs')
|
|
51
|
+
const { resolve } = await import('path')
|
|
52
|
+
const { homedir } = await import('os')
|
|
53
|
+
const yaml = await import('js-yaml')
|
|
54
|
+
|
|
55
|
+
const projectsFile = resolve(homedir(), '.acp', 'projects.yaml')
|
|
56
|
+
if (!existsSync(projectsFile)) return null
|
|
57
|
+
|
|
58
|
+
const raw = readFileSync(projectsFile, 'utf-8')
|
|
59
|
+
const doc = yaml.load(raw, { json: true }) as Record<string, unknown>
|
|
60
|
+
const projects = (doc?.projects || {}) as Record<string, Record<string, unknown>>
|
|
61
|
+
const project = projects[data.projectId]
|
|
62
|
+
if (!project) return null
|
|
63
|
+
|
|
64
|
+
const progressPath = resolve(String(project.path), 'agent', 'progress.yaml')
|
|
65
|
+
return existsSync(progressPath) ? progressPath : null
|
|
66
|
+
} catch {
|
|
67
|
+
return null
|
|
68
|
+
}
|
|
69
|
+
})
|
package/vite.config.ts
CHANGED
|
@@ -3,9 +3,14 @@ import { tanstackStart } from '@tanstack/react-start/plugin/vite'
|
|
|
3
3
|
import viteReact from '@vitejs/plugin-react'
|
|
4
4
|
import viteTsConfigPaths from 'vite-tsconfig-paths'
|
|
5
5
|
import tailwindcss from '@tailwindcss/vite'
|
|
6
|
+
import { cloudflare } from '@cloudflare/vite-plugin'
|
|
6
7
|
|
|
7
|
-
export default defineConfig({
|
|
8
|
+
export default defineConfig(({ command }) => ({
|
|
8
9
|
plugins: [
|
|
10
|
+
cloudflare({
|
|
11
|
+
viteEnvironment: { name: 'ssr' },
|
|
12
|
+
...(command === 'serve' ? { config: { observability: { enabled: false } } } : {}),
|
|
13
|
+
}),
|
|
9
14
|
viteTsConfigPaths({
|
|
10
15
|
projects: ['./tsconfig.json'],
|
|
11
16
|
}),
|
|
@@ -13,4 +18,4 @@ export default defineConfig({
|
|
|
13
18
|
tanstackStart(),
|
|
14
19
|
viteReact(),
|
|
15
20
|
],
|
|
16
|
-
})
|
|
21
|
+
}))
|