@openparachute/vault 0.6.4 → 0.6.5-rc.10

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 (53) hide show
  1. package/core/src/__fixtures__/golden-vault.ts +125 -0
  2. package/core/src/__fixtures__/portable-export-golden.json +10 -0
  3. package/core/src/do-param-cap.test.ts +161 -0
  4. package/core/src/links.ts +8 -13
  5. package/core/src/mcp.ts +306 -314
  6. package/core/src/notes.ts +54 -62
  7. package/core/src/onboarding.ts +14 -296
  8. package/core/src/portable-md-batching.test.ts +67 -0
  9. package/core/src/portable-md-golden.test.ts +55 -0
  10. package/core/src/portable-md.ts +579 -435
  11. package/core/src/schema.ts +21 -43
  12. package/core/src/seed-packs.test.ts +191 -0
  13. package/core/src/seed-packs.ts +559 -0
  14. package/core/src/sql-in.test.ts +58 -0
  15. package/core/src/sql-in.ts +76 -0
  16. package/core/src/store.ts +14 -9
  17. package/core/src/transcription/provider.ts +141 -0
  18. package/core/src/txn.test.ts +229 -0
  19. package/core/src/txn.ts +105 -0
  20. package/core/src/types.ts +9 -0
  21. package/core/src/vault-projection.ts +1 -1
  22. package/core/src/wikilinks.ts +10 -4
  23. package/package.json +1 -1
  24. package/src/add-pack.test.ts +142 -0
  25. package/src/cli.ts +778 -7
  26. package/src/onboarding-seed.test.ts +126 -40
  27. package/src/onboarding-seed.ts +41 -46
  28. package/src/routes.ts +25 -7
  29. package/src/server.ts +108 -31
  30. package/src/transcription/build.test.ts +224 -0
  31. package/src/transcription/build.ts +252 -0
  32. package/src/transcription/capability.test.ts +118 -0
  33. package/src/transcription/capability.ts +96 -0
  34. package/src/transcription/install-python.test.ts +366 -0
  35. package/src/transcription/install-python.ts +471 -0
  36. package/src/transcription/install.test.ts +167 -0
  37. package/src/transcription/install.ts +296 -0
  38. package/src/transcription/providers/onnx-asr.test.ts +229 -0
  39. package/src/transcription/providers/onnx-asr.ts +239 -0
  40. package/src/transcription/providers/parakeet-mlx.test.ts +290 -0
  41. package/src/transcription/providers/parakeet-mlx.ts +242 -0
  42. package/src/transcription/providers/scribe-http.test.ts +195 -0
  43. package/src/transcription/providers/scribe-http.ts +144 -0
  44. package/src/transcription/providers/transcribe-cpp.test.ts +314 -0
  45. package/src/transcription/providers/transcribe-cpp.ts +293 -0
  46. package/src/transcription/select.test.ts +259 -0
  47. package/src/transcription/select.ts +334 -0
  48. package/src/transcription/tiers.test.ts +197 -0
  49. package/src/transcription/tiers.ts +184 -0
  50. package/src/transcription-worker.test.ts +44 -0
  51. package/src/transcription-worker.ts +57 -122
  52. package/src/vault-create.test.ts +38 -10
  53. package/src/vault.test.ts +48 -0
@@ -355,13 +355,16 @@ describe("vault create — services.json registration (#208)", () => {
355
355
  });
356
356
 
357
357
  /**
358
- * Onboarding-guide seeding on create (demo-prep Workstream A — A1/A3).
358
+ * Default-pack seeding on create (originally demo-prep Workstream A — A1/A3;
359
+ * reshaped for named seed packs).
359
360
  *
360
- * A freshly-created vault must contain the `Getting Started` + `Surface Starter`
361
- * notes so a connected AI can read them and help set the vault up. Idempotent +
362
- * best-effort: the seed never fails a create and never clobbers an edited note.
361
+ * A freshly-created vault must contain the `welcome` pack (three-note welcome
362
+ * web + the one capture tag Notes requires) and the `getting-started` guide and
363
+ * NOT the `surface-starter` pack, which is opt-in via `add-pack` (ratified
364
+ * 2026-07-02). Idempotent + best-effort: the seed never fails a create and
365
+ * never clobbers an edited note.
363
366
  */
364
- describe("vault create — onboarding guide seeding (A1/A3)", () => {
367
+ describe("vault create — default pack seeding (welcome + getting-started)", () => {
365
368
  /** Read all (path, content) rows from a created vault's SQLite DB. */
366
369
  function readNotes(name: string): { path: string | null; content: string }[] {
367
370
  const dbPath = join(home, "vault", "data", name, "vault.db");
@@ -375,7 +378,20 @@ describe("vault create — onboarding guide seeding (A1/A3)", () => {
375
378
  }
376
379
  }
377
380
 
378
- test("create seeds Getting Started + Surface Starter notes", () => {
381
+ /** Read all tag names from a created vault's SQLite DB. */
382
+ function readTagNames(name: string): string[] {
383
+ const dbPath = join(home, "vault", "data", name, "vault.db");
384
+ const db = new Database(dbPath, { readonly: true });
385
+ try {
386
+ return (db.query("SELECT name FROM tags").all() as { name: string }[]).map(
387
+ (r) => r.name,
388
+ );
389
+ } finally {
390
+ db.close();
391
+ }
392
+ }
393
+
394
+ test("create seeds the welcome web + Getting Started — and NOT Surface Starter", () => {
379
395
  const { exitCode } = runCli(["create", "guided", "--json"], {
380
396
  PARACHUTE_HOME: home,
381
397
  });
@@ -383,12 +399,24 @@ describe("vault create — onboarding guide seeding (A1/A3)", () => {
383
399
 
384
400
  const notes = readNotes("guided");
385
401
  const gs = notes.find((n) => n.path === "Getting Started");
386
- const ss = notes.find((n) => n.path === "Surface Starter");
402
+ const welcome = notes.find((n) => n.path === "Welcome to your vault 🪂");
403
+ const tryLinking = notes.find((n) => n.path === "Try linking notes");
404
+ const connectAi = notes.find((n) => n.path === "Connect your AI");
387
405
  expect(gs).toBeDefined();
388
- expect(ss).toBeDefined();
406
+ expect(welcome).toBeDefined();
407
+ expect(tryLinking).toBeDefined();
408
+ expect(connectAi).toBeDefined();
389
409
  expect(gs!.content).toContain("# Getting Started");
390
- expect(gs!.content).toContain("[[Surface Starter]]");
391
- expect(ss!.content).toContain("@openparachute/surface-client");
410
+ // Surface Starter is out of the default seed — no note, no dangling link.
411
+ expect(notes.find((n) => n.path === "Surface Starter")).toBeUndefined();
412
+ expect(gs!.content).not.toContain("[[Surface Starter]]");
413
+ expect(gs!.content).toContain("add-pack surface-starter");
414
+
415
+ // The ONE capture tag Notes requires arrives with the welcome pack —
416
+ // and nothing else (fresh-vault seed = 4 notes + 1 tag; the retired
417
+ // capture/text + capture/voice subtypes are no longer seeded).
418
+ expect(readTagNames("guided")).toEqual(["capture"]);
419
+ expect(notes).toHaveLength(4);
392
420
  });
393
421
 
394
422
  test("seeding doesn't break --json stdout (notes seeded silently)", () => {
package/src/vault.test.ts CHANGED
@@ -6505,3 +6505,51 @@ describe("handleVault: auto_transcribe (per-vault)", async () => {
6505
6505
 
6506
6506
  });
6507
6507
 
6508
+ describe("handleVault: transcription capability (scribe-fold Phase 1)", async () => {
6509
+ test("GET surfaces transcription: { enabled, provider } when a provider is available", async () => {
6510
+ const cfg = { name: "default" } as { name: string };
6511
+ const res = await handleVault(
6512
+ mkReq("GET", "/vault"),
6513
+ store,
6514
+ cfg as any,
6515
+ undefined,
6516
+ async () => ({ enabled: true, provider: "scribe-http" }),
6517
+ );
6518
+ expect(res.status).toBe(200);
6519
+ const body = await res.json() as any;
6520
+ expect(body.transcription).toEqual({ enabled: true, provider: "scribe-http" });
6521
+ });
6522
+
6523
+ test("GET surfaces transcription.enabled=false when no provider is available (no crash)", async () => {
6524
+ const cfg = { name: "default" } as { name: string };
6525
+ const res = await handleVault(
6526
+ mkReq("GET", "/vault"),
6527
+ store,
6528
+ cfg as any,
6529
+ undefined,
6530
+ async () => ({ enabled: false }),
6531
+ );
6532
+ expect(res.status).toBe(200);
6533
+ const body = await res.json() as any;
6534
+ expect(body.transcription).toEqual({ enabled: false });
6535
+ expect(body.transcription.provider).toBeUndefined();
6536
+ });
6537
+
6538
+ test("capability is a distinct axis from the auto_transcribe policy toggle", async () => {
6539
+ // A vault with auto_transcribe.enabled=true but NO provider available still
6540
+ // reports transcription.enabled=false — the mic should be gated on
6541
+ // capability, not policy.
6542
+ const cfg = { name: "default", auto_transcribe: { enabled: true } };
6543
+ const res = await handleVault(
6544
+ mkReq("GET", "/vault"),
6545
+ store,
6546
+ cfg as any,
6547
+ undefined,
6548
+ async () => ({ enabled: false }),
6549
+ );
6550
+ const body = await res.json() as any;
6551
+ expect(body.config.auto_transcribe.enabled).toBe(true);
6552
+ expect(body.transcription.enabled).toBe(false);
6553
+ });
6554
+ });
6555
+