@myrialabs/clopen 0.4.28 → 0.4.30

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 (62) hide show
  1. package/backend/auth/auth-service.ts +45 -25
  2. package/backend/auth/onboarding.test.ts +106 -0
  3. package/backend/auth/permissions.ts +1 -1
  4. package/backend/database/migrations/067_add_memory_graph_layout.ts +91 -0
  5. package/backend/database/migrations/index.ts +7 -0
  6. package/backend/database/queries/graph-queries.ts +417 -32
  7. package/backend/database/utils/connection.ts +7 -31
  8. package/backend/db-client/drivers/mssql.ts +57 -22
  9. package/backend/db-client/drivers/mysql.ts +69 -48
  10. package/backend/db-client/drivers/postgres.ts +65 -53
  11. package/backend/engine/README.md +8 -3
  12. package/backend/engine/adapters/claude/message-converter.ts +51 -0
  13. package/backend/engine/adapters/claude/stream.ts +81 -15
  14. package/backend/engine/adapters/codex/message-converter.ts +8 -2
  15. package/backend/engine/adapters/codex/models.ts +85 -98
  16. package/backend/engine/adapters/codex/stream.ts +5 -7
  17. package/backend/engine/adapters/codex/usage-rollout.ts +7 -0
  18. package/backend/engine/adapters/copilot/stream.ts +24 -0
  19. package/backend/engine/docs/artifacts.md +1 -1
  20. package/backend/engine/docs/lessons-learned.md +78 -1
  21. package/backend/engine/docs/quick-reference.md +1 -1
  22. package/backend/engine/docs/stack.md +8 -0
  23. package/backend/engine/install-recipes.ts +19 -2
  24. package/backend/files/file-size-limit.ts +5 -14
  25. package/backend/files/file-watcher.test.ts +160 -0
  26. package/backend/files/file-watcher.ts +276 -58
  27. package/backend/git/git-executor.ts +8 -0
  28. package/backend/git/git-service.test.ts +136 -0
  29. package/backend/git/git-service.ts +113 -17
  30. package/backend/index.ts +16 -4
  31. package/backend/mcp/internal/remote-server.test.ts +8 -3
  32. package/backend/mcp/internal/remote-server.ts +1 -1
  33. package/backend/memory/bootstrap.ts +9 -0
  34. package/backend/memory/layout.ts +985 -0
  35. package/backend/memory/notify.ts +33 -7
  36. package/backend/memory/view.ts +375 -69
  37. package/backend/permissions/index.ts +4 -2
  38. package/backend/permissions/resolve.ts +7 -5
  39. package/backend/settings/system-settings.ts +97 -0
  40. package/backend/tunnel/public-origin.ts +5 -13
  41. package/backend/utils/env.ts +29 -0
  42. package/backend/utils/paths.ts +9 -3
  43. package/backend/utils/process-warnings.ts +41 -0
  44. package/backend/ws/auth/login.test.ts +8 -1
  45. package/backend/ws/auth/login.ts +22 -15
  46. package/backend/ws/auth/status.ts +24 -1
  47. package/backend/ws/chat/stream.ts +1 -0
  48. package/backend/ws/files/watch.ts +9 -0
  49. package/backend/ws/memory/crud.ts +50 -2
  50. package/backend/ws/settings/crud.ts +14 -22
  51. package/dist/assets/{index-BujQYGBm.js → index-DUc5T21e.js} +1 -1
  52. package/dist/assets/{index-DRMOgS9y.js → index-DYwQ5bP8.js} +1 -1
  53. package/dist/assets/main-VgdjTBLR.css +1 -0
  54. package/dist/assets/main-r0iv2PDz.js +1044 -0
  55. package/dist/index.html +2 -2
  56. package/package.json +14 -14
  57. package/shared/constants/engines.ts +1 -0
  58. package/shared/types/memory.ts +70 -0
  59. package/shared/types/stores/settings.ts +11 -1
  60. package/shared/types/unified/stream.ts +10 -4
  61. package/dist/assets/main-BrYtWn-4.js +0 -1036
  62. package/dist/assets/main-BrqMMMRX.css +0 -1
package/dist/index.html CHANGED
@@ -58,8 +58,8 @@
58
58
  }
59
59
  })();
60
60
  </script>
61
- <script type="module" crossorigin src="/assets/main-BrYtWn-4.js"></script>
62
- <link rel="stylesheet" crossorigin href="/assets/main-BrqMMMRX.css">
61
+ <script type="module" crossorigin src="/assets/main-r0iv2PDz.js"></script>
62
+ <link rel="stylesheet" crossorigin href="/assets/main-VgdjTBLR.css">
63
63
  </head>
64
64
  <body
65
65
  class="min-h-dvh bg-white text-slate-900 dark:bg-slate-950 dark:text-slate-100 transition-colors duration-200"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@myrialabs/clopen",
3
- "version": "0.4.28",
3
+ "version": "0.4.30",
4
4
  "description": "All-in-one web workspace for AI coding agents — Claude Code, OpenCode, Codex, Copilot, Qwen Code, Pi, Cline, and Cursor — with chat, terminal, git, browser preview, database client, checkpoints, and real-time collaboration",
5
5
  "author": "Myria Labs",
6
6
  "license": "MIT",
@@ -77,20 +77,20 @@
77
77
  "prepublishOnly": "bun run build"
78
78
  },
79
79
  "devDependencies": {
80
- "@anthropic-ai/claude-agent-sdk": "0.3.158",
81
- "@anthropic-ai/sdk": "0.100.1",
82
- "@cline/agents": "0.0.65",
83
- "@cline/sdk": "0.0.65",
84
- "@cursor/sdk": "1.0.24",
85
- "@earendil-works/pi-agent-core": "0.80.10",
86
- "@earendil-works/pi-ai": "0.80.10",
87
- "@earendil-works/pi-coding-agent": "0.80.10",
80
+ "@anthropic-ai/claude-agent-sdk": "0.3.229",
81
+ "@anthropic-ai/sdk": "0.116.0",
82
+ "@cline/agents": "0.0.74",
83
+ "@cline/sdk": "0.0.74",
84
+ "@cursor/sdk": "1.0.27",
85
+ "@earendil-works/pi-agent-core": "0.84.1",
86
+ "@earendil-works/pi-ai": "0.84.1",
87
+ "@earendil-works/pi-coding-agent": "0.84.1",
88
88
  "@eslint/js": "^9.31.0",
89
- "@github/copilot": "1.0.55",
90
- "@github/copilot-sdk": "1.0.0-beta.9",
91
- "@openai/codex-sdk": "0.135.0",
92
- "@opencode-ai/sdk": "1.15.12",
93
- "@qwen-code/sdk": "0.1.7",
89
+ "@github/copilot": "1.0.79",
90
+ "@github/copilot-sdk": "1.0.9",
91
+ "@openai/codex-sdk": "0.147.0",
92
+ "@opencode-ai/sdk": "1.18.18",
93
+ "@qwen-code/sdk": "0.1.8",
94
94
  "@sveltejs/vite-plugin-svelte": "^6.0.0",
95
95
  "@tailwindcss/vite": "^4.1.11",
96
96
  "@types/bun": "^1.2.18",
@@ -130,6 +130,7 @@ const REASONING_LEVEL_LABELS: Record<string, string> = {
130
130
  high: 'High',
131
131
  xhigh: 'X-High',
132
132
  max: 'Max',
133
+ ultra: 'Ultra',
133
134
  };
134
135
 
135
136
  /** Human label for a reasoning level token (falls back to capitalizing the token). */
@@ -381,6 +381,15 @@ export interface GraphViewNode {
381
381
  /** Louvain community index — the "lobe" a node belongs to. */
382
382
  community: number;
383
383
  createdAt: string;
384
+ /**
385
+ * Where the persisted layout put this node, when it has been laid out.
386
+ *
387
+ * Absent means "no position yet" — a memory written since the last layout
388
+ * pass — and the client seeds those from their neighbours rather than
389
+ * re-solving the whole graph. See `backend/memory/layout.ts`.
390
+ */
391
+ x?: number;
392
+ y?: number;
384
393
  }
385
394
 
386
395
  export interface GraphViewEdge {
@@ -391,9 +400,70 @@ export interface GraphViewEdge {
391
400
  weight: number;
392
401
  }
393
402
 
403
+ /** A rectangle in layout space — what a zoomed-in view is scoped to. */
404
+ export interface GraphRegion {
405
+ minX: number;
406
+ maxX: number;
407
+ minY: number;
408
+ maxY: number;
409
+ }
410
+
411
+ /**
412
+ * Several memories that fell in one cell of the layout grid, drawn as one mark.
413
+ *
414
+ * This is what keeps the view's cost bounded without taking anything out of the
415
+ * picture, and the distinction from the alternative matters. Grouping by
416
+ * COMMUNITY replaces the picture — you see lobes instead of memories, and
417
+ * reaching a memory means opening one. Grouping by POSITION keeps the picture:
418
+ * marks merge only where their dots would have overlapped anyway, so the
419
+ * silhouette, the lobes and the colours are the ones the full graph would have
420
+ * drawn. Below the render budget nothing merges at all and every memory is its
421
+ * own mark, exactly as before.
422
+ *
423
+ * A bin is not a memory — it has no body, no scope and nothing to inspect —
424
+ * which is why it travels in its own array rather than as a node wearing a fake
425
+ * subkind.
426
+ */
427
+ export interface GraphViewBin {
428
+ /** `bin:<cellX>:<cellY>` — namespaced so it cannot collide with a node id. */
429
+ id: string;
430
+ /** How many memories it stands for; drives its size. */
431
+ members: number;
432
+ /** The most reinforced member's summary, for the hover pill. */
433
+ label: string;
434
+ /** Community of that same member, so the mark keeps its lobe's colour. */
435
+ community: number;
436
+ /** Centroid of its members — not the cell's centre, which would grid the map. */
437
+ x: number;
438
+ y: number;
439
+ /** The cell itself, so opening the mark asks for exactly this rectangle. */
440
+ region: GraphRegion;
441
+ }
442
+
443
+ /** A connection between two bins, weighted by the edges that cross between them. */
444
+ export interface GraphViewBinEdge {
445
+ source: string;
446
+ target: string;
447
+ weight: number;
448
+ }
449
+
394
450
  export interface GraphView {
451
+ /**
452
+ * `flat` when every matching memory is drawn individually — the ordinary case,
453
+ * and the only one below the render budget. `binned` when some marks stand for
454
+ * more than one memory.
455
+ *
456
+ * Both populate `nodes`: a cell holding a single memory returns that memory,
457
+ * not a bin of one. So the two are not alternatives to each other — a binned
458
+ * view is a full-fidelity view everywhere it can afford to be.
459
+ */
460
+ level: 'flat' | 'binned';
395
461
  nodes: GraphViewNode[];
396
462
  edges: GraphViewEdge[];
463
+ bins: GraphViewBin[];
464
+ binEdges: GraphViewBinEdge[];
465
+ /** The rectangle this view was scoped to, when the caller zoomed into one. */
466
+ region: GraphRegion | null;
397
467
  /** Total nodes matching the filter before any display cap was applied. */
398
468
  totalNodes: number;
399
469
  /** True when `totalNodes` exceeded the cap and the view was trimmed. */
@@ -92,7 +92,17 @@ export type AuthMode = 'none' | 'required';
92
92
  export interface SystemSettings {
93
93
  /** Authentication mode: 'none' = single user no login, 'required' = multi-user with login. Default: 'required'. */
94
94
  authMode: AuthMode;
95
- /** Whether the initial setup wizard has been completed. Default: false. */
95
+ /**
96
+ * Setup wizard state — the authoritative marker.
97
+ * 'pending' is only written by a fresh install that entered the wizard; an
98
+ * install with users and no marker at all is treated (and recorded) as
99
+ * complete. Read server-side via `auth:status`, never decided by the client.
100
+ */
101
+ onboarding?: 'pending' | 'complete';
102
+ /**
103
+ * Legacy boolean mirror of `onboarding`, still written so an older build
104
+ * downgraded onto the same database keeps recognising a completed setup.
105
+ */
96
106
  onboardingComplete: boolean;
97
107
  /** Restrict folder browser to only these base paths. Empty = no restriction. */
98
108
  allowedBasePaths: string[];
@@ -90,7 +90,8 @@ export type RateLimitType =
90
90
  | 'seven_day'
91
91
  | 'seven_day_opus'
92
92
  | 'seven_day_sonnet'
93
- | 'overage';
93
+ | 'overage'
94
+ | 'seven_day_overage_included';
94
95
 
95
96
  export interface RateLimitEvent {
96
97
  type: 'rate_limit';
@@ -102,9 +103,14 @@ export interface RateLimitEvent {
102
103
  }
103
104
 
104
105
  /**
105
- * Transient, non-persisted notification surfaced as a toast. Currently emitted
106
- * for Claude background-task completion (SDKTaskNotificationMessage); the
107
- * stream-manager routes it to a `chat:notification`.
106
+ * Transient, non-persisted notification surfaced as a toast; the stream-manager
107
+ * routes it to a `chat:notification`.
108
+ *
109
+ * Reserved for things the transcript alone cannot explain: a turn that produced
110
+ * no output (Pi, Cline), an answer that came from a fallback model after a
111
+ * refusal (Claude), a request cancelled because the account's credit limit ran
112
+ * out (Copilot). Routine progress does NOT belong here — backgrounded task
113
+ * outcomes already land in the transcript, and toasting them was pure noise.
108
114
  */
109
115
  export interface NotificationEvent {
110
116
  type: 'notification';