@aiwg/cockpit 2026.6.3

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 (49) hide show
  1. package/README.md +337 -0
  2. package/bridge/package.json +13 -0
  3. package/bridge/src/public/index.html +395 -0
  4. package/bridge/src/server.mjs +1132 -0
  5. package/bridge/src/smoke.mjs +158 -0
  6. package/contrib/aiwg-core.json +15 -0
  7. package/contrib/contribution.schema.json +69 -0
  8. package/desktop/README.md +42 -0
  9. package/desktop/src-tauri/Cargo.toml +17 -0
  10. package/desktop/src-tauri/build.rs +3 -0
  11. package/desktop/src-tauri/frontend/index.html +11 -0
  12. package/desktop/src-tauri/src/main.rs +55 -0
  13. package/desktop/src-tauri/tauri.conf.json +20 -0
  14. package/package.json +49 -0
  15. package/runtime-docs/README.md +38 -0
  16. package/shell-core/runtime.mjs +45 -0
  17. package/shell-core/smoke.mjs +36 -0
  18. package/vscode/README.md +25 -0
  19. package/vscode/extension.js +59 -0
  20. package/vscode/package.json +29 -0
  21. package/web/dist/assets/index-B5anpdS1.js +67 -0
  22. package/web/dist/assets/index-CP3BF6uZ.css +32 -0
  23. package/web/dist/index.html +14 -0
  24. package/web/index.html +13 -0
  25. package/web/package.json +31 -0
  26. package/web/src/App.test.tsx +237 -0
  27. package/web/src/App.tsx +255 -0
  28. package/web/src/api.ts +20 -0
  29. package/web/src/components/Actions.tsx +60 -0
  30. package/web/src/components/Approvals.tsx +62 -0
  31. package/web/src/components/CapabilitySearch.tsx +73 -0
  32. package/web/src/components/Explore.tsx +41 -0
  33. package/web/src/components/Inventory.tsx +124 -0
  34. package/web/src/components/LaunchInstanceModal.test.tsx +97 -0
  35. package/web/src/components/LaunchInstanceModal.tsx +236 -0
  36. package/web/src/components/Library.tsx +76 -0
  37. package/web/src/components/Running.tsx +60 -0
  38. package/web/src/components/Sessions.test.tsx +125 -0
  39. package/web/src/components/Sessions.tsx +189 -0
  40. package/web/src/components/StartSessionModal.test.tsx +86 -0
  41. package/web/src/components/StartSessionModal.tsx +168 -0
  42. package/web/src/components/Welcome.tsx +474 -0
  43. package/web/src/main.tsx +11 -0
  44. package/web/src/styles.css +254 -0
  45. package/web/src/types.ts +47 -0
  46. package/web/src/useDebounce.ts +10 -0
  47. package/web/src/useSession.ts +220 -0
  48. package/web/src/util.test.ts +30 -0
  49. package/web/src/util.ts +17 -0
@@ -0,0 +1,59 @@
1
+ // AIWG Cockpit — VS Code shell (#1594).
2
+ // Hosts the registry-bound Bridge UI inside a webview, and exposes contributed
3
+ // actions as command-palette entries. The shell never replaces the CLI or the
4
+ // Bridge — it reads the per-launch token the Bridge wrote and loads its UI.
5
+ // CommonJS so it runs with no build step.
6
+ const vscode = require('vscode');
7
+ const fs = require('fs');
8
+ const os = require('os');
9
+ const path = require('path');
10
+
11
+ function runtimeFile() {
12
+ const override = vscode.workspace.getConfiguration('aiwg-cockpit').get('bridgeRuntimeFile');
13
+ return override && override.length ? override : path.join(os.homedir(), '.aiwg', 'cockpit', 'runtime', 'bridge.json');
14
+ }
15
+
16
+ /** Read the Bridge connection + confirm liveness; throws with a friendly hint if down. */
17
+ async function ensureRuntime() {
18
+ let rt;
19
+ try {
20
+ const r = JSON.parse(fs.readFileSync(runtimeFile(), 'utf8'));
21
+ rt = { ...r, url: `http://127.0.0.1:${r.port}` };
22
+ } catch {
23
+ throw new Error('AIWG Cockpit Bridge not found. Start it with `aiwg cockpit` (or `node apps/cockpit/bridge/src/server.mjs`) and retry.');
24
+ }
25
+ try { if (!(await fetch(`${rt.url}/healthz`)).ok) throw new Error(); }
26
+ catch { throw new Error(`AIWG Cockpit Bridge not reachable at ${rt.url}. Is it still running?`); }
27
+ return rt;
28
+ }
29
+
30
+ function activate(context) {
31
+ context.subscriptions.push(
32
+ vscode.commands.registerCommand('aiwg-cockpit.open', async () => {
33
+ let rt;
34
+ try { rt = await ensureRuntime(); } catch (e) { return vscode.window.showWarningMessage(e.message); }
35
+ const panel = vscode.window.createWebviewPanel('aiwgCockpit', 'AIWG Cockpit', vscode.ViewColumn.One, { enableScripts: true, retainContextWhenHidden: true });
36
+ const u = `${rt.url}/?token=${encodeURIComponent(rt.token)}`;
37
+ panel.webview.html = `<!doctype html><html><head><meta charset="utf-8" />
38
+ <meta http-equiv="Content-Security-Policy" content="default-src 'none'; frame-src http://127.0.0.1:* http://localhost:*; style-src 'unsafe-inline';" />
39
+ <style>html,body,iframe{margin:0;height:100vh;width:100%;border:0}</style></head>
40
+ <body><iframe src="${u}" title="AIWG Cockpit"></iframe></body></html>`;
41
+ }),
42
+ vscode.commands.registerCommand('aiwg-cockpit.auditIssues', async () => {
43
+ let rt;
44
+ try { rt = await ensureRuntime(); } catch (e) { return vscode.window.showWarningMessage(e.message); }
45
+ const out = vscode.window.createOutputChannel('AIWG Cockpit');
46
+ out.show(true);
47
+ out.appendLine('Running contributed action: audit-issues…');
48
+ try {
49
+ const r = await fetch(`${rt.url}/api/actions/audit-issues/run`, { method: 'POST', headers: { authorization: `Bearer ${rt.token}` } });
50
+ const j = await r.json();
51
+ out.appendLine(j.output || JSON.stringify(j, null, 2));
52
+ } catch (e) { out.appendLine('Error: ' + e.message); }
53
+ }),
54
+ );
55
+ }
56
+
57
+ function deactivate() {}
58
+
59
+ module.exports = { activate, deactivate };
@@ -0,0 +1,29 @@
1
+ {
2
+ "name": "aiwg-cockpit",
3
+ "displayName": "AIWG Cockpit",
4
+ "description": "AIWG Cockpit shell for VS Code — observe, drive, and coordinate multi-stack agentic sessions over the registry-bound Bridge. Hosts the same UI as the desktop app; the CLI is never replaced.",
5
+ "version": "0.0.0",
6
+ "private": true,
7
+ "publisher": "aiwg",
8
+ "license": "MIT",
9
+ "engines": { "vscode": "^1.85.0" },
10
+ "categories": ["Other"],
11
+ "main": "./extension.js",
12
+ "activationEvents": [],
13
+ "contributes": {
14
+ "commands": [
15
+ { "command": "aiwg-cockpit.open", "title": "AIWG Cockpit: Open" },
16
+ { "command": "aiwg-cockpit.auditIssues", "title": "AIWG Cockpit: Audit Issues" }
17
+ ],
18
+ "configuration": {
19
+ "title": "AIWG Cockpit",
20
+ "properties": {
21
+ "aiwg-cockpit.bridgeRuntimeFile": {
22
+ "type": "string",
23
+ "default": "",
24
+ "description": "Override the Bridge runtime file path (default ~/.aiwg/cockpit/runtime/bridge.json)."
25
+ }
26
+ }
27
+ }
28
+ }
29
+ }