aidevops 3.21.11 → 3.22.0

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 (34) hide show
  1. package/README.md +1 -1
  2. package/VERSION +1 -1
  3. package/aidevops.sh +3 -2
  4. package/bun.lock +573 -0
  5. package/package.json +12 -1
  6. package/packages/gui-api/package.json +9 -0
  7. package/packages/gui-api/src/app.ts +49 -0
  8. package/packages/gui-api/src/file-adapter.ts +207 -0
  9. package/packages/gui-api/src/server.ts +12 -0
  10. package/packages/gui-api/src/status-adapter-utils.ts +108 -0
  11. package/packages/gui-api/src/status-adapter.ts +484 -0
  12. package/packages/gui-api/src/status-local-repos.ts +239 -0
  13. package/packages/gui-desktop/package.json +6 -0
  14. package/packages/gui-desktop/scripts/install-macos-app.sh +1020 -0
  15. package/packages/gui-shared/package.json +9 -0
  16. package/packages/gui-shared/src/contracts.ts +341 -0
  17. package/packages/gui-shared/src/fixtures.ts +250 -0
  18. package/packages/gui-shared/src/index.ts +2 -0
  19. package/packages/gui-web/index.html +24 -0
  20. package/packages/gui-web/package.json +25 -0
  21. package/packages/gui-web/src/App.tsx +269 -0
  22. package/packages/gui-web/src/AppNavigation.tsx +379 -0
  23. package/packages/gui-web/src/AppWorkspace.tsx +114 -0
  24. package/packages/gui-web/src/FileExplorerSurface.tsx +153 -0
  25. package/packages/gui-web/src/InventorySurfaces.tsx +117 -0
  26. package/packages/gui-web/src/PathActions.tsx +17 -0
  27. package/packages/gui-web/src/StatusSurfaces.tsx +396 -0
  28. package/packages/gui-web/src/app-model.ts +546 -0
  29. package/packages/gui-web/src/dashboard.ts +79 -0
  30. package/packages/gui-web/src/main.tsx +24 -0
  31. package/packages/gui-web/src/status-client.ts +93 -0
  32. package/packages/gui-web/src/styles.css +1540 -0
  33. package/packages/gui-web/vite.config.ts +14 -0
  34. package/setup.sh +78 -3
@@ -0,0 +1,93 @@
1
+ import {
2
+ createEnvelope,
3
+ fileExplorerFixture,
4
+ GUI_FILE_ROOTS,
5
+ type GuiFileExplorerData,
6
+ type GuiFileRootId,
7
+ type GuiResponseEnvelope,
8
+ type GuiStatusData,
9
+ statusFixture,
10
+ } from "../../gui-shared/src";
11
+
12
+ export async function fetchStatus(
13
+ fetcher: typeof fetch = fetch,
14
+ ): Promise<GuiResponseEnvelope<GuiStatusData>> {
15
+ const response = await fetcher("/api/status");
16
+ if (!response.ok) {
17
+ throw new Error(`Status request failed with ${response.status}`);
18
+ }
19
+
20
+ return normalizeStatusEnvelope((await response.json()) as GuiResponseEnvelope<Partial<GuiStatusData>>);
21
+ }
22
+
23
+ export function mockedStatus(): GuiResponseEnvelope<GuiStatusData> {
24
+ return createEnvelope({
25
+ operation_id: "setup.status.read",
26
+ source: {
27
+ surface: "setup",
28
+ authority: "aidevops helpers",
29
+ path_refs: ["~/.aidevops/agents", "~/.config/aidevops/settings.json"],
30
+ },
31
+ data: statusFixture,
32
+ });
33
+ }
34
+
35
+ export async function fetchFileExplorer(
36
+ rootId: GuiFileRootId,
37
+ relativePath = "",
38
+ fetcher: typeof fetch = fetch,
39
+ ): Promise<GuiResponseEnvelope<GuiFileExplorerData>> {
40
+ const query = relativePath.length > 0 ? `?path=${encodeURIComponent(relativePath)}` : "";
41
+ const response = await fetcher(`/api/files/${rootId}${query}`);
42
+ if (!response.ok) {
43
+ throw new Error(`File explorer request failed with ${response.status}`);
44
+ }
45
+
46
+ return (await response.json()) as GuiResponseEnvelope<GuiFileExplorerData>;
47
+ }
48
+
49
+ export function mockedFileExplorer(rootId: GuiFileRootId): GuiResponseEnvelope<GuiFileExplorerData> {
50
+ const root = GUI_FILE_ROOTS.find((entry) => entry.id === rootId) ?? GUI_FILE_ROOTS[0];
51
+
52
+ return createEnvelope({
53
+ operation_id: "filesystem.read",
54
+ source: {
55
+ surface: "filesystem",
56
+ authority: "local read-only allowlist",
57
+ path_refs: [root.path_ref],
58
+ },
59
+ data: {
60
+ ...fileExplorerFixture,
61
+ root,
62
+ current_path_ref: root.path_ref,
63
+ selected_preview: root.id === "agents" ? fileExplorerFixture.selected_preview : null,
64
+ },
65
+ });
66
+ }
67
+
68
+ function normalizeStatusEnvelope(envelope: GuiResponseEnvelope<Partial<GuiStatusData>>): GuiResponseEnvelope<GuiStatusData> {
69
+ const data = envelope.data ?? {};
70
+
71
+ return {
72
+ ...envelope,
73
+ data: {
74
+ ...statusFixture,
75
+ ...data,
76
+ update: { ...statusFixture.update, ...data.update },
77
+ runtime: { ...statusFixture.runtime, ...data.runtime },
78
+ machine: { ...statusFixture.machine, ...data.machine },
79
+ paths: data.paths ?? statusFixture.paths,
80
+ helper_availability: data.helper_availability ?? statusFixture.helper_availability,
81
+ navigation: data.navigation ?? statusFixture.navigation,
82
+ settings: { ...statusFixture.settings, ...data.settings },
83
+ repos: { ...statusFixture.repos, ...data.repos, repos: data.repos?.repos ?? statusFixture.repos.repos },
84
+ local_repos: { ...statusFixture.local_repos, ...data.local_repos, repos: data.local_repos?.repos ?? statusFixture.local_repos.repos },
85
+ oauth_pool: { ...statusFixture.oauth_pool, ...data.oauth_pool, providers: data.oauth_pool?.providers ?? statusFixture.oauth_pool.providers },
86
+ setup_targets: data.setup_targets ?? statusFixture.setup_targets,
87
+ ai_apps: data.ai_apps ?? statusFixture.ai_apps,
88
+ capabilities: data.capabilities ?? statusFixture.capabilities,
89
+ secrets: data.secrets ?? statusFixture.secrets,
90
+ placeholders: data.placeholders ?? statusFixture.placeholders,
91
+ },
92
+ };
93
+ }