@knolo/cli 3.2.1 → 4.0.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 (28) hide show
  1. package/README.md +49 -3
  2. package/bin/knolo.mjs +555 -7
  3. package/package.json +4 -3
  4. package/templates/icp-knowledge-canister/README.md +71 -0
  5. package/templates/icp-knowledge-canister/canisters/knolo-core-rust/Cargo.toml +13 -0
  6. package/templates/icp-knowledge-canister/canisters/knolo-core-rust/src/lib.rs +499 -0
  7. package/templates/icp-knowledge-canister/canisters/knolo-icp-canister/Cargo.lock +541 -0
  8. package/templates/icp-knowledge-canister/canisters/knolo-icp-canister/Cargo.toml +20 -0
  9. package/templates/icp-knowledge-canister/canisters/knolo-icp-canister/knolo_icp.did +29 -0
  10. package/templates/icp-knowledge-canister/canisters/knolo-icp-canister/src/lib.rs +605 -0
  11. package/templates/icp-knowledge-canister/dfx.json +25 -0
  12. package/templates/icp-knowledge-canister/frontend/index.html +12 -0
  13. package/templates/icp-knowledge-canister/frontend/package.json +27 -0
  14. package/templates/icp-knowledge-canister/frontend/src/App.tsx +225 -0
  15. package/templates/icp-knowledge-canister/frontend/src/app.css +271 -0
  16. package/templates/icp-knowledge-canister/frontend/src/canister.ts +119 -0
  17. package/templates/icp-knowledge-canister/frontend/src/canisterConfig.test.ts +34 -0
  18. package/templates/icp-knowledge-canister/frontend/src/canisterConfig.ts +26 -0
  19. package/templates/icp-knowledge-canister/frontend/src/main.tsx +5 -0
  20. package/templates/icp-knowledge-canister/frontend/src/vite-env.d.ts +14 -0
  21. package/templates/icp-knowledge-canister/frontend/tsconfig.json +18 -0
  22. package/templates/icp-knowledge-canister/frontend/vite.config.ts +66 -0
  23. package/templates/icp-knowledge-canister/knolo.config.json +15 -0
  24. package/templates/icp-knowledge-canister/knowledge/alpha.md +5 -0
  25. package/templates/icp-knowledge-canister/knowledge/guides/beta.md +5 -0
  26. package/templates/icp-knowledge-canister/scripts/build-sample-pack.mjs +24 -0
  27. package/templates/icp-knowledge-canister/scripts/query.sh +11 -0
  28. package/templates/icp-knowledge-canister/scripts/upload-pack.sh +16 -0
package/README.md CHANGED
@@ -1,5 +1,8 @@
1
1
  # @knolo/cli
2
2
 
3
+ The CLI targets the Knolo v4 pack contract. Normal builds emit v4; the ICP
4
+ legacy build path explicitly emits v3 until the canister gains a v4 profile.
5
+
3
6
  The official CLI for building `.knolo` knowledge packs.
4
7
 
5
8
  It indexes structured content and produces a deterministic, local-first knowledge bundle for use with `@knolo/core`.
@@ -36,6 +39,49 @@ Indexes your configured content and outputs:
36
39
  dist/knowledge.knolo
37
40
  ```
38
41
 
42
+ Artifact workflows:
43
+
44
+ ```bash
45
+ knolo inspect dist/knowledge.knolo
46
+ knolo verify dist/knowledge.knolo
47
+ knolo migrate old.knolo --to 4 --out new.knolo
48
+ knolo query "billing policy" --receipt receipt.json --json
49
+ knolo explain receipt.json --pack dist/knowledge.knolo
50
+ knolo diff old.knolo new.knolo
51
+ ```
52
+
53
+ ### ICP Canister Workflow (LIVE)
54
+
55
+ Deploy a Knolo knowledge canister on a local ICP replica, upload a `.knolo` pack, and query it with no middleware.
56
+
57
+ ```bash
58
+ knolo icp init ./icp-knowledge-canister
59
+ cd ./icp-knowledge-canister
60
+ dfx start --background
61
+ dfx deploy
62
+ knolo icp build-pack ./knowledge --out ./dist/knowledge.knolo
63
+ knolo icp upload ./dist/knowledge.knolo --canister knolo_knowledge --label my-docs
64
+ knolo icp health --canister knolo_knowledge
65
+ knolo icp info --canister knolo_knowledge
66
+ knolo icp query "alpha beta" --canister knolo_knowledge --k 5
67
+ # knolo icp clear --canister knolo_knowledge # controller only
68
+ ```
69
+
70
+ From the monorepo, you can also seed dummy data and open a Postman-friendly REST gateway:
71
+
72
+ ```bash
73
+ npm run icp:local
74
+ curl -sS "http://127.0.0.1:8787/search?q=billing&k=5"
75
+ ```
76
+
77
+ These commands stay local-first:
78
+
79
+ * No hosted service
80
+ * No vector database
81
+ * Lexical retrieval by default
82
+ * Controller-only pack mutation; 2 MiB pack limit
83
+ * Pack state survives canister upgrades
84
+
39
85
  ---
40
86
 
41
87
  ## 📁 Expected Project Structure
@@ -77,12 +123,13 @@ All builds are deterministic.
77
123
 
78
124
  ## 🧠 Agent Features
79
125
 
80
- Phase 2 includes:
126
+ Current v4 features include:
81
127
 
82
128
  * Routing profile extraction
83
129
  * Tool policy validation
84
130
  * Mount-time registry validation
85
131
  * Deterministic selection logic
132
+ * Pack manifests, analyzer identities, retrieval plans, receipts, and evidence spans
86
133
 
87
134
  ---
88
135
 
@@ -121,5 +168,4 @@ This section is deterministic, offline-safe, and additive; runtimes that ignore
121
168
 
122
169
  ## 📄 License
123
170
 
124
- MIT
125
-
171
+ Apache-2.0