@antelopejs/dms-ai 0.4.0 → 0.4.1

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/README.md CHANGED
@@ -74,9 +74,11 @@ The guide's sources live in [`docs/`](./docs). The package ships the `dms-ai`, `
74
74
 
75
75
  Read [CONTRIBUTING.md](./CONTRIBUTING.md) before opening a pull request.
76
76
 
77
+ One install from the repository root includes the backend, shipped Vue frontend and sidecar. Each keeps its own lockfile. The playground remains independent and needs its own install for local development. Builds use the installed dependencies and do not install them again.
78
+
77
79
  ```bash
78
- pnpm install
79
- pnpm --dir frontend-vue install
80
+ pnpm install --frozen-lockfile
81
+ pnpm --dir playground install --frozen-lockfile --ignore-workspace
80
82
  pnpm build
81
83
  pnpm build:sidecar
82
84
  pnpm dev # playground backend
@@ -13,10 +13,16 @@ export function runWhenLoggedIn(
13
13
  start();
14
14
  return () => undefined;
15
15
  }
16
- const stop = watch(isLoggedIn, (loggedIn) => {
17
- if (!loggedIn) return;
18
- stop();
19
- start();
20
- });
16
+ const stop = watch(
17
+ isLoggedIn,
18
+ (loggedIn) => {
19
+ if (!loggedIn) return;
20
+ stop();
21
+ start();
22
+ },
23
+ // Login also changes DMS's async-data scope. Let its watchers clear
24
+ // the old scope before starting the probe, or they abort that read.
25
+ { flush: "post" },
26
+ );
21
27
  return stop;
22
28
  }
@@ -1,4 +1,4 @@
1
- import { nextTick, ref } from "vue";
1
+ import { nextTick, ref, watch } from "vue";
2
2
  import { describe, expect, it, vi } from "vitest";
3
3
  import { runWhenLoggedIn } from "../app/runtime/session-gate";
4
4
 
@@ -26,6 +26,33 @@ describe("session gate", () => {
26
26
  expect(start).toHaveBeenCalledTimes(1);
27
27
  });
28
28
 
29
+ it("starts in the new session scope after login watchers settle", async () => {
30
+ const loggedIn = ref(false);
31
+ const session = ref("guest");
32
+ let scope = session.value;
33
+ let probe: AbortController | undefined;
34
+ let probeScope: string | undefined;
35
+ runWhenLoggedIn(
36
+ () => loggedIn.value,
37
+ () => {
38
+ probeScope = scope;
39
+ probe = new AbortController();
40
+ },
41
+ );
42
+ // DMS hydrates the user before the session. Its scope watcher clears
43
+ // outstanding reads, including an AI probe started in the old scope.
44
+ const stopScope = watch(session, (next) => {
45
+ probe?.abort();
46
+ scope = next;
47
+ });
48
+ loggedIn.value = true;
49
+ session.value = "owner";
50
+ await nextTick();
51
+ stopScope();
52
+ expect(probeScope).toBe("owner");
53
+ expect(probe?.signal.aborted).toBe(false);
54
+ });
55
+
29
56
  it("never starts once the gate is stopped", async () => {
30
57
  const loggedIn = ref(false);
31
58
  const start = vi.fn();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@antelopejs/dms-ai",
3
- "version": "0.4.0",
3
+ "version": "0.4.1",
4
4
  "description": "AI development assistant for the AntelopeJS DMS: a chat panel next to every page and a coding agent that edits the project in reviewable, undoable change sets.",
5
5
  "keywords": [
6
6
  "ai",
@@ -43,7 +43,7 @@
43
43
  },
44
44
  "scripts": {
45
45
  "build": "rimraf dist && tsc",
46
- "build:sidecar": "cd sidecar && pnpm install && pnpm run build",
46
+ "build:sidecar": "pnpm --dir sidecar run build",
47
47
  "prepack": "pnpm run build && pnpm run build:sidecar",
48
48
  "frontend:dev": "cd playground && pnpm frontend:dev",
49
49
  "dev": "cd playground && pnpm dev",
@@ -60,7 +60,7 @@
60
60
  "test:sidecar-lifecycle": "node --test tests/sidecar-lifecycle.test.cjs",
61
61
  "test:build-id": "node --test tests/build-id.test.cjs",
62
62
  "test:e2e": "cd sidecar && pnpm test:e2e",
63
- "release": "pnpm --dir frontend-vue install --frozen-lockfile && pnpm --dir sidecar install --frozen-lockfile && release-it",
63
+ "release": "pnpm install --frozen-lockfile && release-it",
64
64
  "format": "oxfmt --disable-nested-config . && cd frontend-vue && pnpm format",
65
65
  "knip": "knip --dependencies",
66
66
  "knip:all": "knip"