@sashabogi/foundation 2.0.1 → 2.1.0

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 (45) hide show
  1. package/README.md +3 -158
  2. package/dist/cli.js +127 -253
  3. package/dist/cli.js.map +1 -1
  4. package/dist/providers/anthropic.d.ts +2 -2
  5. package/dist/providers/anthropic.d.ts.map +1 -1
  6. package/dist/providers/anthropic.js +2 -2
  7. package/dist/providers/anthropic.js.map +1 -1
  8. package/dist/providers/types.d.ts +1 -1
  9. package/dist/providers/types.d.ts.map +1 -1
  10. package/dist/providers/zai.d.ts +17 -8
  11. package/dist/providers/zai.d.ts.map +1 -1
  12. package/dist/providers/zai.js +34 -13
  13. package/dist/providers/zai.js.map +1 -1
  14. package/dist/services/config.service.d.ts +1 -5
  15. package/dist/services/config.service.d.ts.map +1 -1
  16. package/dist/services/config.service.js +0 -20
  17. package/dist/services/config.service.js.map +1 -1
  18. package/dist/services/git.service.d.ts +0 -4
  19. package/dist/services/git.service.d.ts.map +1 -1
  20. package/dist/services/git.service.js +0 -30
  21. package/dist/services/git.service.js.map +1 -1
  22. package/dist/services/storage.service.d.ts +1 -24
  23. package/dist/services/storage.service.d.ts.map +1 -1
  24. package/dist/services/storage.service.js +0 -108
  25. package/dist/services/storage.service.js.map +1 -1
  26. package/dist/tools/gaia/index.d.ts +5 -8
  27. package/dist/tools/gaia/index.d.ts.map +1 -1
  28. package/dist/tools/gaia/index.js +16 -115
  29. package/dist/tools/gaia/index.js.map +1 -1
  30. package/dist/tools/gaia/storage.d.ts +13 -0
  31. package/dist/tools/gaia/storage.d.ts.map +1 -1
  32. package/dist/tools/gaia/storage.js +285 -1
  33. package/dist/tools/gaia/storage.js.map +1 -1
  34. package/dist/tools/seldon/index.d.ts +1 -12
  35. package/dist/tools/seldon/index.d.ts.map +1 -1
  36. package/dist/tools/seldon/index.js +1 -183
  37. package/dist/tools/seldon/index.js.map +1 -1
  38. package/dist/types/index.d.ts +0 -78
  39. package/dist/types/index.d.ts.map +1 -1
  40. package/package.json +1 -1
  41. package/packages/ui/dist/assets/index-DVS_pYGH.css +1 -0
  42. package/packages/ui/dist/assets/index-WNO_oIqP.js +312 -0
  43. package/packages/ui/dist/index.html +2 -2
  44. package/packages/ui/dist/assets/index-oiJTDMJ1.css +0 -1
  45. package/packages/ui/dist/assets/index-oivszLTx.js +0 -352
package/README.md CHANGED
@@ -1,16 +1,6 @@
1
- <p align="center">
2
- <img src="docs/foundation-banner.jpg" alt="Foundation - Unified MCP Server" width="100%">
3
- </p>
4
-
5
- <p align="center">
6
- <a href="https://www.npmjs.com/package/@sashabogi/foundation"><img src="https://img.shields.io/npm/v/@sashabogi/foundation.svg" alt="npm version"></a>
7
- <a href="https://www.npmjs.com/package/@sashabogi/foundation"><img src="https://img.shields.io/npm/dm/@sashabogi/foundation.svg" alt="npm downloads"></a>
8
- <a href="https://github.com/sashabogi/foundation/blob/main/LICENSE"><img src="https://img.shields.io/npm/l/@sashabogi/foundation.svg" alt="license"></a>
9
- </p>
10
-
11
1
  # Foundation v2.0
12
2
 
13
- > **Production-grade MCP server for AI-assisted development with advanced memory**
3
+ > **Production-grade MCP server for AI-assisted development**
14
4
  >
15
5
  > *"The future is not fixed, but it can be guided."* — Hari Seldon
16
6
 
@@ -153,7 +143,6 @@ gaia_save({
153
143
  tags: ["auth", "jwt", "security"],
154
144
  related_files: ["src/auth/jwt.ts"]
155
145
  })
156
- // Returns: { success: true, memory: { id: "mem_abc123", ... } }
157
146
  ```
158
147
 
159
148
  ### 3. Search Memories
@@ -164,7 +153,6 @@ gaia_search({
164
153
  tiers: ["project", "global"],
165
154
  limit: 10
166
155
  })
167
- // Returns ranked results with BM25 + composite scoring
168
156
  ```
169
157
 
170
158
  ### 4. Link Memories
@@ -177,7 +165,6 @@ gaia_link({
177
165
  })
178
166
 
179
167
  gaia_graph({ memory_id: "mem_impl_456" })
180
- // Returns: { depends_on: [{ id: "mem_decision_123", content: "...", ... }] }
181
168
  ```
182
169
 
183
170
  ---
@@ -254,9 +241,9 @@ Gaia provides **workflow patterns and persistent memory**. Version 2.0 transform
254
241
  - Searching past conversations
255
242
  - Capturing patterns and learnings
256
243
 
257
- **Tools (19 total):**
244
+ **Tools (20 total):**
258
245
 
259
- #### Workflow Tools (12)
246
+ #### Workflow Tools (9)
260
247
  ```
261
248
  gaia_checkpoint // Save structured session state
262
249
  gaia_status // Lightweight index card (~150 tokens)
@@ -264,9 +251,6 @@ gaia_query // Keyword search checkpoint
264
251
  gaia_get_decisions // List architectural decisions
265
252
  gaia_get_progress // Task progress summary
266
253
  gaia_get_changes // Files changed
267
- gaia_handoff // Create session handoff document (NEW v2.0)
268
- gaia_observe // Auto-detect patterns and observations (NEW v2.0)
269
- gaia_migrate // Migrate v1 checkpoint data to v2 (NEW v2.0)
270
254
  gaia_learn // Record correction for CLAUDE.md
271
255
  gaia_apply // Apply learnings to CLAUDE.md
272
256
  gaia_review // Review learnings
@@ -377,30 +361,25 @@ Returns:
377
361
  Build **dependency graphs** across memories with 5 typed links:
378
362
 
379
363
  ```typescript
380
- // Save a decision
381
364
  const decision = gaia_save({
382
365
  tier: "project",
383
366
  content: "Decision: Use React 18 with TypeScript",
384
367
  tags: ["decision", "architecture"]
385
368
  })
386
369
 
387
- // Save an implementation
388
370
  const impl = gaia_save({
389
371
  tier: "project",
390
372
  content: "Implementation: Set up Vite with React 18 + TS",
391
373
  tags: ["implementation"]
392
374
  })
393
375
 
394
- // Link them
395
376
  gaia_link({
396
377
  from_memory_id: impl.memory.id,
397
378
  to_memory_id: decision.memory.id,
398
379
  link_type: "depends_on"
399
380
  })
400
381
 
401
- // Later - retrieve the graph
402
382
  gaia_graph({ memory_id: impl.memory.id })
403
- // Shows: implementation depends_on decision
404
383
  ```
405
384
 
406
385
  **Link Types:**
@@ -459,7 +438,6 @@ CREATE TABLE memory_links (
459
438
  ### Example 1: Building a Knowledge Base
460
439
 
461
440
  ```typescript
462
- // Save architectural decisions
463
441
  gaia_save({
464
442
  tier: "project",
465
443
  content: "Decision: Use PostgreSQL with Drizzle ORM for type safety",
@@ -468,7 +446,6 @@ gaia_save({
468
446
  metadata: { decision_type: "technical", impact: "high" }
469
447
  })
470
448
 
471
- // Save implementation details
472
449
  gaia_save({
473
450
  tier: "project",
474
451
  content: "PostgreSQL connection pool configured with max 20 connections",
@@ -476,7 +453,6 @@ gaia_save({
476
453
  related_files: ["src/db/index.ts"]
477
454
  })
478
455
 
479
- // Later - search your decisions
480
456
  gaia_search({
481
457
  query: "database PostgreSQL decision",
482
458
  tiers: ["project"],
@@ -487,14 +463,12 @@ gaia_search({
487
463
  ### Example 2: Cross-Prompt Dependencies
488
464
 
489
465
  ```typescript
490
- // Day 1: Make a decision
491
466
  const decision = gaia_save({
492
467
  tier: "project",
493
468
  content: "Decision: Use tRPC for type-safe API",
494
469
  tags: ["decision", "api"]
495
470
  })
496
471
 
497
- // Day 2: Implement it
498
472
  const impl = gaia_save({
499
473
  tier: "project",
500
474
  content: "Created tRPC router with user and auth procedures",
@@ -502,35 +476,29 @@ const impl = gaia_save({
502
476
  related_files: ["src/server/trpc.ts"]
503
477
  })
504
478
 
505
- // Link them
506
479
  gaia_link({
507
480
  from_memory_id: impl.memory.id,
508
481
  to_memory_id: decision.memory.id,
509
482
  link_type: "depends_on"
510
483
  })
511
484
 
512
- // Day 30: Review decision chain
513
485
  gaia_graph({ memory_id: impl.memory.id })
514
- // Shows the full dependency graph
515
486
  ```
516
487
 
517
488
  ### Example 3: Session Workflow
518
489
 
519
490
  ```typescript
520
- // Session start - load context
521
491
  gaia_search({
522
492
  query: "authentication JWT implementation",
523
493
  current_file: "src/auth/verify.ts"
524
494
  })
525
495
 
526
- // During session - save observations
527
496
  gaia_save({
528
497
  tier: "session",
529
498
  content: "Bug: JWT verification doesn't handle expired tokens gracefully",
530
499
  tags: ["bug", "jwt"]
531
500
  })
532
501
 
533
- // Session end - create checkpoint
534
502
  gaia_checkpoint({
535
503
  summary: "Fixed JWT token expiration handling",
536
504
  decisions: [{
@@ -546,127 +514,6 @@ gaia_checkpoint({
546
514
  })
547
515
  ```
548
516
 
549
- ### Example 4: Session Handoff
550
-
551
- ```typescript
552
- // At session end - create checkpoint
553
- gaia_checkpoint({
554
- summary: "Implemented user authentication with JWT",
555
- purpose: "Build secure auth system",
556
- project: "acme-app",
557
- decisions: [{
558
- topic: "Authentication",
559
- decision: "Use JWT with RS256",
560
- rationale: "Industry standard, secure, stateless"
561
- }],
562
- progress: [{
563
- task: "Implement login endpoint",
564
- status: "completed"
565
- }, {
566
- task: "Add refresh token logic",
567
- status: "in_progress"
568
- }],
569
- changes: [{
570
- file: "src/auth/jwt.ts",
571
- action: "created",
572
- summary: "JWT token generation and verification"
573
- }],
574
- context: {
575
- branch: "feat/auth",
576
- openQuestions: [
577
- "Should we implement refresh token rotation?",
578
- "What expiration time for access tokens?"
579
- ],
580
- relevantFiles: ["src/auth/jwt.ts", "src/auth/middleware.ts"]
581
- }
582
- })
583
-
584
- // Create handoff document for next session
585
- gaia_handoff({
586
- next_steps: [
587
- "Implement refresh token rotation strategy",
588
- "Add rate limiting to login endpoint",
589
- "Write integration tests for auth flow",
590
- "Update API documentation with auth examples"
591
- ],
592
- context_notes: "Auth system nearly complete. Main work remaining is refresh token security and testing. Consider implementing exponential backoff on failed login attempts.",
593
- include_memories: true,
594
- memory_query: "authentication JWT security"
595
- })
596
-
597
- // Returns markdown document at ~/.foundation/handoffs/handoff-2026-02-16T10-30-00.md
598
- // Includes:
599
- // - Full checkpoint state (decisions, progress, changes)
600
- // - Relevant memories with BM25 ranking
601
- // - Next steps
602
- // - Context notes
603
- // - Links to related files
604
- ```
605
-
606
- ### Example 5: Autonomous Observation
607
-
608
- ```typescript
609
- // System automatically detects patterns from session activity
610
- gaia_observe({
611
- lookback_days: 30,
612
- auto_save: true,
613
- min_confidence: "medium"
614
- })
615
-
616
- // Returns analysis like:
617
- //
618
- // ## Observations Detected (6)
619
- //
620
- // 1. 🔴 **Repeated decision-making on: Authentication**
621
- // - Evidence: 3 decisions made about Authentication in current session
622
- // - Confidence: high
623
- // - Saved: mem_obs_abc123
624
- //
625
- // 2. 🔴 **Task blockers detected**
626
- // - Evidence: 2 blocked task(s): "Add rate limiting", "Write auth tests"
627
- // - Confidence: high
628
- // - Saved: mem_obs_def456
629
- //
630
- // 3. 🟡 **Frequent modifications to: src/auth/jwt.ts**
631
- // - Evidence: 3 changes to src/auth/jwt.ts in current session
632
- // - Confidence: medium
633
- // - Saved: mem_obs_ghi789
634
- //
635
- // 4. 🟡 **Multiple open questions - potential knowledge gaps**
636
- // - Evidence: 4 unresolved questions
637
- // - Confidence: medium
638
- // - Saved: mem_obs_jkl012
639
- //
640
- // 5. 🔴 **High activity in areas: authentication, security, jwt**
641
- // - Evidence: Frequent tags in recent memories
642
- // - Confidence: high
643
- // - Saved: mem_obs_mno345
644
- //
645
- // 6. 🟡 **File created and deleted: src/temp/test.ts**
646
- // - Evidence: May indicate trial-and-error or false start
647
- // - Confidence: medium
648
- // - Saved: mem_obs_pqr678
649
-
650
- // Observations are saved to 'observation' tier
651
- // Automatically enriched with metadata for pattern analysis
652
- // Can be searched like any other memory
653
-
654
- // Later - search observations
655
- gaia_search({
656
- query: "blocked tasks authentication",
657
- tiers: ["observation"],
658
- limit: 5
659
- })
660
- ```
661
-
662
- **Pattern types detected:**
663
- - Repeated topics (same decisions multiple times)
664
- - Task blockers (blocked status in progress)
665
- - Frequent file changes (same file modified 3+ times)
666
- - Knowledge gaps (multiple open questions)
667
- - Activity hotspots (frequent tags in recent memories)
668
- - Anti-patterns (created then deleted files)
669
-
670
517
  ---
671
518
 
672
519
  ## Performance
@@ -704,13 +551,11 @@ Database:
704
551
  **Optional:** Start using the new memory tools for persistent knowledge:
705
552
 
706
553
  ```typescript
707
- // v1.x approach (still works)
708
554
  gaia_checkpoint({
709
555
  summary: "Implemented auth",
710
556
  decisions: [...]
711
557
  })
712
558
 
713
- // v2.0 approach (recommended - searchable + persistent)
714
559
  gaia_save({
715
560
  tier: "project",
716
561
  content: "Auth implementation uses JWT with RS256",