agentopology 0.1.0 → 0.2.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 (61) hide show
  1. package/README.md +70 -33
  2. package/dist/analyzer/index.d.ts +1 -0
  3. package/dist/analyzer/index.d.ts.map +1 -1
  4. package/dist/analyzer/index.js +35 -0
  5. package/dist/analyzer/index.js.map +1 -1
  6. package/dist/bindings/claude-code.d.ts.map +1 -1
  7. package/dist/bindings/claude-code.js +283 -2
  8. package/dist/bindings/claude-code.js.map +1 -1
  9. package/dist/bindings/openclaw.d.ts.map +1 -1
  10. package/dist/bindings/openclaw.js +390 -12
  11. package/dist/bindings/openclaw.js.map +1 -1
  12. package/dist/cli/index.js +2 -2
  13. package/dist/cli/index.js.map +1 -1
  14. package/dist/docs/__tests__/docs.test.js +2 -1
  15. package/dist/docs/__tests__/docs.test.js.map +1 -1
  16. package/dist/docs/content.d.ts.map +1 -1
  17. package/dist/docs/content.js +730 -4
  18. package/dist/docs/content.js.map +1 -1
  19. package/dist/exporters/markdown.d.ts.map +1 -1
  20. package/dist/exporters/markdown.js +165 -0
  21. package/dist/exporters/markdown.js.map +1 -1
  22. package/dist/exporters/mermaid.d.ts.map +1 -1
  23. package/dist/exporters/mermaid.js +30 -0
  24. package/dist/exporters/mermaid.js.map +1 -1
  25. package/dist/import/__tests__/import.test.js +554 -0
  26. package/dist/import/__tests__/import.test.js.map +1 -1
  27. package/dist/import/claude-code.d.ts.map +1 -1
  28. package/dist/import/claude-code.js +2 -0
  29. package/dist/import/claude-code.js.map +1 -1
  30. package/dist/import/index.d.ts +1 -0
  31. package/dist/import/index.d.ts.map +1 -1
  32. package/dist/import/index.js +7 -1
  33. package/dist/import/index.js.map +1 -1
  34. package/dist/import/openclaw.d.ts +70 -0
  35. package/dist/import/openclaw.d.ts.map +1 -0
  36. package/dist/import/openclaw.js +1060 -0
  37. package/dist/import/openclaw.js.map +1 -0
  38. package/dist/import/serializer.d.ts.map +1 -1
  39. package/dist/import/serializer.js +171 -4
  40. package/dist/import/serializer.js.map +1 -1
  41. package/dist/parser/__tests__/parser.test.js +463 -0
  42. package/dist/parser/__tests__/parser.test.js.map +1 -1
  43. package/dist/parser/ast.d.ts +122 -0
  44. package/dist/parser/ast.d.ts.map +1 -1
  45. package/dist/parser/index.d.ts +14 -2
  46. package/dist/parser/index.d.ts.map +1 -1
  47. package/dist/parser/index.js +226 -5
  48. package/dist/parser/index.js.map +1 -1
  49. package/dist/parser/validator.d.ts +1 -1
  50. package/dist/parser/validator.d.ts.map +1 -1
  51. package/dist/parser/validator.js +214 -1
  52. package/dist/parser/validator.js.map +1 -1
  53. package/dist/visualizer/index.d.ts.map +1 -1
  54. package/dist/visualizer/index.js +263 -27
  55. package/dist/visualizer/index.js.map +1 -1
  56. package/examples/memory-system.at +162 -0
  57. package/examples/script-agent-pipeline.at +65 -0
  58. package/package.json +1 -1
  59. package/spec/grammar.md +345 -10
  60. package/spec/reserved-keywords.md +25 -1
  61. package/spec/validation.md +171 -2
@@ -2,7 +2,7 @@
2
2
 
3
3
  Created by Nadav Naveh
4
4
 
5
- These 29 rules are enforced by the `.at` compiler at parse time. A topology that violates any rule is rejected before scaffold generation.
5
+ These 35 rules are enforced by the `.at` compiler at parse time. A topology that violates any rule is rejected before scaffold generation.
6
6
 
7
7
  ---
8
8
 
@@ -408,7 +408,7 @@ memory {
408
408
 
409
409
  ## Rule 24: Unknown Memory Sub-Blocks (Warning)
410
410
 
411
- Only known sub-blocks are expected inside the `memory` section: `domains`, `references`, `external-docs`, `metrics`, and `workspace`. Any other named sub-block is parsed but flagged as a **warning**.
411
+ Only known sub-blocks are expected inside the `memory` section: `domains`, `references`, `external-docs`, `metrics`, `workspace`, `store`, and `retrieval`. Any other named sub-block is parsed but flagged as a **warning**.
412
412
 
413
413
  ```agenttopology
414
414
  # WARNING -- "custom-store" is not a recognized memory sub-block
@@ -500,6 +500,169 @@ metering {
500
500
 
501
501
  ---
502
502
 
503
+ ## Rule 30: Store Backend Enum
504
+
505
+ Every `store.backend` must be one of the allowed values: `lancedb`, `sqlite-vec`, `chroma`, `kuzu`, `falkordb`, `mongodb`, `pinecone`, `qdrant`, `pgvector`, `neo4j`, or `sqlite`. Any other value is an error.
506
+
507
+ ```agenttopology
508
+ # INVALID -- "redis" is not a recognized store backend
509
+ memory {
510
+ store cache {
511
+ type: session
512
+ backend: redis
513
+ path: ".memory/cache/"
514
+ }
515
+ }
516
+ ```
517
+
518
+ ---
519
+
520
+ ## Rule 31: Embedding Recommended (Warning)
521
+
522
+ When a store's `type` is `semantic`, `episodic`, or `procedural`, the `embedding {}` sub-block should be present. Omitting it produces a **warning** -- the topology is valid but the store may not function correctly without embedding configuration.
523
+
524
+ ```agenttopology
525
+ # WARNING -- semantic store without embedding configuration
526
+ memory {
527
+ store docs {
528
+ type: semantic
529
+ backend: lancedb
530
+ path: ".memory/docs/"
531
+ }
532
+ }
533
+
534
+ # VALID -- embedding provided
535
+ memory {
536
+ store docs {
537
+ type: semantic
538
+ backend: lancedb
539
+ path: ".memory/docs/"
540
+
541
+ embedding {
542
+ provider: ollama
543
+ model: "nomic-embed-text"
544
+ dimensions: 768
545
+ }
546
+ }
547
+ }
548
+ ```
549
+
550
+ ---
551
+
552
+ ## Rule 32: Store Scope Recommended (Warning)
553
+
554
+ Every `store` should have a `scope` field. Omitting it produces a **warning** -- the topology is valid but the store's access boundaries are undefined, which may cause issues in multi-agent or multi-user deployments.
555
+
556
+ ```agenttopology
557
+ # WARNING -- store without scope
558
+ memory {
559
+ store knowledge {
560
+ type: semantic
561
+ backend: lancedb
562
+ path: ".memory/knowledge/"
563
+ }
564
+ }
565
+
566
+ # VALID -- scope specified
567
+ memory {
568
+ store knowledge {
569
+ type: semantic
570
+ scope: agent
571
+ backend: lancedb
572
+ path: ".memory/knowledge/"
573
+ }
574
+ }
575
+ ```
576
+
577
+ ---
578
+
579
+ ## Rule 33: Retrieval Sources Resolve
580
+
581
+ Every store ID in a `retrieval.sources` list must reference a declared `store` block within the `memory` section. Referencing an undefined store is an error.
582
+
583
+ ```agenttopology
584
+ # INVALID -- "nonexistent-store" is not a declared store
585
+ memory {
586
+ store docs {
587
+ type: semantic
588
+ backend: lancedb
589
+ path: ".memory/docs/"
590
+ }
591
+
592
+ retrieval main {
593
+ sources: [docs, nonexistent-store]
594
+ budget: 4096
595
+ }
596
+ }
597
+ ```
598
+
599
+ ---
600
+
601
+ ## Rule 34: Connection Required for Remote Backends
602
+
603
+ When a store uses a remote backend (`pinecone`, `qdrant`, `pgvector`, `neo4j`, `mongodb`, or `falkordb`), the `connection` field is required. Omitting it is an error.
604
+
605
+ ```agenttopology
606
+ # INVALID -- pinecone requires a connection string
607
+ memory {
608
+ store vectors {
609
+ type: semantic
610
+ backend: pinecone
611
+
612
+ embedding {
613
+ provider: openai
614
+ model: "text-embedding-3-large"
615
+ dimensions: 3072
616
+ }
617
+ }
618
+ }
619
+
620
+ # VALID -- connection provided
621
+ memory {
622
+ store vectors {
623
+ type: semantic
624
+ backend: pinecone
625
+ connection: secret "PINECONE_URL"
626
+
627
+ embedding {
628
+ provider: openai
629
+ model: "text-embedding-3-large"
630
+ dimensions: 3072
631
+ }
632
+ }
633
+ }
634
+ ```
635
+
636
+ ---
637
+
638
+ ## Rule 35: Agent Memory/Retrieval References
639
+
640
+ Agent `memory` list entries must reference declared store IDs. Agent `retrieval` must reference a declared retrieval strategy ID. Referencing undefined stores or retrievals is an error.
641
+
642
+ ```agenttopology
643
+ # INVALID -- "ghost-store" is not a declared store, "ghost-retrieval" is not declared
644
+ memory {
645
+ store docs {
646
+ type: semantic
647
+ backend: lancedb
648
+ path: ".memory/docs/"
649
+ }
650
+
651
+ retrieval main {
652
+ sources: [docs]
653
+ budget: 4096
654
+ }
655
+ }
656
+
657
+ agent researcher {
658
+ model: sonnet
659
+ memory: [docs, ghost-store]
660
+ retrieval: ghost-retrieval
661
+ }
662
+ ```
663
+
664
+ ---
665
+
503
666
  ## Summary Table
504
667
 
505
668
  | Rule | Severity | Description |
@@ -533,3 +696,9 @@ metering {
533
696
  | V27 | warning | Agent permissions enum — should be a recognized permission mode |
534
697
  | V28 | error | Metering format enum — must be json, jsonl, or csv |
535
698
  | V29 | warning | Metering pricing enum — should be a recognized pricing model |
699
+ | V30 | error | Store backend enum — must be lancedb, sqlite-vec, chroma, kuzu, falkordb, mongodb, pinecone, qdrant, pgvector, neo4j, or sqlite |
700
+ | V31 | warning | Embedding recommended — embedding should be present for semantic, episodic, and procedural stores |
701
+ | V32 | warning | Store scope recommended — every store should have a scope field |
702
+ | V33 | error | Retrieval sources resolve — retrieval sources must reference declared store IDs |
703
+ | V34 | error | Connection required for remote backends — pinecone, qdrant, pgvector, neo4j, mongodb, falkordb require connection |
704
+ | V35 | error | Agent memory/retrieval references — agent memory and retrieval fields must reference valid IDs |