devglide 0.1.2 → 0.1.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "devglide",
3
- "version": "0.1.2",
3
+ "version": "0.1.3",
4
4
  "description": "AI workflow toolkit with MCP servers for kanban, shell, testing, workflows, and more — built for Claude Code",
5
5
  "license": "MIT",
6
6
  "author": "Daniel Kutyla",
@@ -33,6 +33,10 @@
33
33
  },
34
34
  "files": [
35
35
  "bin/",
36
+ "src/server.ts",
37
+ "src/project-context.ts",
38
+ "src/routers/",
39
+ "src/public/",
36
40
  "src/apps/",
37
41
  "src/packages/",
38
42
  "turbo.json",
@@ -0,0 +1,36 @@
1
+ /**
2
+ * Shared active-project state for the unified Devglide server.
3
+ *
4
+ * Replaces the per-app connectProjectContext() socket.io connections.
5
+ * All routers import from this module to read/write the active project.
6
+ */
7
+
8
+ export interface ActiveProject {
9
+ id: string;
10
+ name: string;
11
+ path: string;
12
+ }
13
+
14
+ let activeProject: ActiveProject | null = null;
15
+
16
+ const listeners: Set<(p: ActiveProject | null) => void> = new Set();
17
+
18
+ export function setActiveProject(p: ActiveProject | null): void {
19
+ activeProject = p;
20
+ for (const fn of listeners) {
21
+ try {
22
+ fn(p);
23
+ } catch (err) {
24
+ console.error('[project-context] listener error:', err);
25
+ }
26
+ }
27
+ }
28
+
29
+ export function onProjectChange(fn: (p: ActiveProject | null) => void): () => void {
30
+ listeners.add(fn);
31
+ return () => { listeners.delete(fn); };
32
+ }
33
+
34
+ export function getActiveProject(): ActiveProject | null {
35
+ return activeProject;
36
+ }