@knolo/cli 3.2.2 → 5.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 +68 -7
  2. package/bin/knolo.mjs +514 -7
  3. package/package.json +21 -3
  4. package/templates/icp-knowledge-canister/README.md +76 -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 +1603 -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
@@ -0,0 +1,76 @@
1
+ # icp-knowledge-canister
2
+
3
+ Minimal local `dfx` example for deploying a Knolo ICP canister without any middleware server.
4
+
5
+ This scaffold remains on the legacy ICP V3 profile. The V5 foundation is
6
+ available in the TypeScript/Rust runtimes and through the root CLI’s read-only
7
+ Knowledge Image commands; see the repository `docs/ROADMAP.md` for the staged
8
+ ICP upgrade path.
9
+
10
+ This scaffold:
11
+
12
+ - builds a real `.knolo` pack from local sample docs
13
+ - vendors the Rust canister sources locally under `canisters/`
14
+ - uploads the pack with `knolo icp upload`
15
+ - queries the canister directly
16
+ - includes a tiny Vite + React browser client that talks to the canister directly
17
+
18
+ ## Prerequisites
19
+
20
+ Local ICP development needs `dfx`, Rust, the WASM target, and the Knolo CLI:
21
+
22
+ ```bash
23
+ npm install -g @knolo/cli
24
+ rustup target add wasm32-unknown-unknown
25
+ ```
26
+
27
+ ## Run The Example
28
+
29
+ ```bash
30
+ cd icp-knowledge-canister
31
+ dfx start --background
32
+ dfx deploy
33
+ knolo icp build-pack ./knowledge --out ./dist/knowledge.knolo
34
+ knolo icp upload ./dist/knowledge.knolo --canister knolo_knowledge
35
+ knolo icp query "alpha beta" --canister knolo_knowledge
36
+ ```
37
+
38
+ If `dfx` is running under a minimal shell and complains about terminal colors, rerun the `dfx` commands with:
39
+
40
+ ```bash
41
+ TERM=xterm-256color dfx start --background
42
+ TERM=xterm-256color dfx deploy
43
+ ```
44
+
45
+ To run the browser client:
46
+
47
+ ```bash
48
+ cd frontend
49
+ npm install
50
+ npm run dev
51
+ ```
52
+
53
+ The frontend uses `VITE_KNOLO_CANISTER_ID` when provided. Otherwise it falls back to the local canister ID from `.dfx/local/canister_ids.json`, which is available after `dfx deploy`.
54
+
55
+ ## What Gets Built
56
+
57
+ - `dfx deploy` compiles the local canister from `./canisters/knolo-icp-canister`
58
+ - `knolo icp build-pack ./knowledge --out ./dist/knowledge.knolo` writes `dist/knowledge.knolo`
59
+ - `knolo icp upload ./dist/knowledge.knolo --canister knolo_knowledge` calls `set_pack(bytes, label)`
60
+ - `knolo icp query "alpha beta" --canister knolo_knowledge` calls `search("alpha beta", 5)`
61
+
62
+ Helper wrappers remain available under `scripts/` if you prefer shorter commands:
63
+
64
+ ```bash
65
+ node scripts/build-sample-pack.mjs
66
+ bash scripts/upload-pack.sh
67
+ bash scripts/query.sh "alpha beta"
68
+ ```
69
+
70
+ ## Sample Content
71
+
72
+ The pack is built from the checked-in files under `knowledge/`, so the example stays deterministic and easy to rerun locally.
73
+ # Knolo v4 compatibility
74
+
75
+ This template uses the ICP legacy v3 pack profile. The TypeScript CLI’s
76
+ `icp build-pack` command opts into v3 until the canister supports v4.
@@ -0,0 +1,13 @@
1
+ [package]
2
+ name = "knolo-core-rust"
3
+ version = "5.0.0"
4
+ edition = "2021"
5
+ license = "Apache-2.0"
6
+ description = "Rust runtime support for reading and querying .knolo packs"
7
+ repository = "https://github.com/HiveForensics-AI/knolo-core"
8
+ keywords = ["knolo", "knowledge-base", "retrieval", "rag"]
9
+ categories = ["data-structures", "text-processing"]
10
+
11
+ [lib]
12
+ name = "knolo_core_rust"
13
+ path = "src/lib.rs"