@beingmartinbmc/ojas 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 (174) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +308 -0
  3. package/dist/aahar/index.d.ts +179 -0
  4. package/dist/aahar/index.d.ts.map +1 -0
  5. package/dist/aahar/index.js +657 -0
  6. package/dist/aahar/index.js.map +1 -0
  7. package/dist/aahar/scoring.d.ts +85 -0
  8. package/dist/aahar/scoring.d.ts.map +1 -0
  9. package/dist/aahar/scoring.js +268 -0
  10. package/dist/aahar/scoring.js.map +1 -0
  11. package/dist/agni/index.d.ts +113 -0
  12. package/dist/agni/index.d.ts.map +1 -0
  13. package/dist/agni/index.js +328 -0
  14. package/dist/agni/index.js.map +1 -0
  15. package/dist/agni/model-router.d.ts +77 -0
  16. package/dist/agni/model-router.d.ts.map +1 -0
  17. package/dist/agni/model-router.js +163 -0
  18. package/dist/agni/model-router.js.map +1 -0
  19. package/dist/agni/response-distiller.d.ts +37 -0
  20. package/dist/agni/response-distiller.d.ts.map +1 -0
  21. package/dist/agni/response-distiller.js +193 -0
  22. package/dist/agni/response-distiller.js.map +1 -0
  23. package/dist/agni/tiktoken-adapter.d.ts +55 -0
  24. package/dist/agni/tiktoken-adapter.d.ts.map +1 -0
  25. package/dist/agni/tiktoken-adapter.js +113 -0
  26. package/dist/agni/tiktoken-adapter.js.map +1 -0
  27. package/dist/chikitsa/index.d.ts +130 -0
  28. package/dist/chikitsa/index.d.ts.map +1 -0
  29. package/dist/chikitsa/index.js +565 -0
  30. package/dist/chikitsa/index.js.map +1 -0
  31. package/dist/demo.d.ts +15 -0
  32. package/dist/demo.d.ts.map +1 -0
  33. package/dist/demo.js +278 -0
  34. package/dist/demo.js.map +1 -0
  35. package/dist/index.d.ts +201 -0
  36. package/dist/index.d.ts.map +1 -0
  37. package/dist/index.js +588 -0
  38. package/dist/index.js.map +1 -0
  39. package/dist/mcp/audit.d.ts +39 -0
  40. package/dist/mcp/audit.d.ts.map +1 -0
  41. package/dist/mcp/audit.js +73 -0
  42. package/dist/mcp/audit.js.map +1 -0
  43. package/dist/mcp/contracts.d.ts +76 -0
  44. package/dist/mcp/contracts.d.ts.map +1 -0
  45. package/dist/mcp/contracts.js +44 -0
  46. package/dist/mcp/contracts.js.map +1 -0
  47. package/dist/mcp/envelope.d.ts +107 -0
  48. package/dist/mcp/envelope.d.ts.map +1 -0
  49. package/dist/mcp/envelope.js +162 -0
  50. package/dist/mcp/envelope.js.map +1 -0
  51. package/dist/mcp/registry.d.ts +110 -0
  52. package/dist/mcp/registry.d.ts.map +1 -0
  53. package/dist/mcp/registry.js +258 -0
  54. package/dist/mcp/registry.js.map +1 -0
  55. package/dist/mcp/server.d.ts +26 -0
  56. package/dist/mcp/server.d.ts.map +1 -0
  57. package/dist/mcp/server.js +107 -0
  58. package/dist/mcp/server.js.map +1 -0
  59. package/dist/mcp/tools/agent.d.ts +4 -0
  60. package/dist/mcp/tools/agent.d.ts.map +1 -0
  61. package/dist/mcp/tools/agent.js +300 -0
  62. package/dist/mcp/tools/agent.js.map +1 -0
  63. package/dist/mcp/tools/context.d.ts +4 -0
  64. package/dist/mcp/tools/context.d.ts.map +1 -0
  65. package/dist/mcp/tools/context.js +261 -0
  66. package/dist/mcp/tools/context.js.map +1 -0
  67. package/dist/mcp/tools/index.d.ts +5 -0
  68. package/dist/mcp/tools/index.d.ts.map +1 -0
  69. package/dist/mcp/tools/index.js +20 -0
  70. package/dist/mcp/tools/index.js.map +1 -0
  71. package/dist/mcp/tools/memory.d.ts +4 -0
  72. package/dist/mcp/tools/memory.d.ts.map +1 -0
  73. package/dist/mcp/tools/memory.js +220 -0
  74. package/dist/mcp/tools/memory.js.map +1 -0
  75. package/dist/mcp/tools/output.d.ts +4 -0
  76. package/dist/mcp/tools/output.d.ts.map +1 -0
  77. package/dist/mcp/tools/output.js +206 -0
  78. package/dist/mcp/tools/output.js.map +1 -0
  79. package/dist/mcp/tools/recovery.d.ts +4 -0
  80. package/dist/mcp/tools/recovery.d.ts.map +1 -0
  81. package/dist/mcp/tools/recovery.js +165 -0
  82. package/dist/mcp/tools/recovery.js.map +1 -0
  83. package/dist/mcp/tools/registrar.d.ts +4 -0
  84. package/dist/mcp/tools/registrar.d.ts.map +1 -0
  85. package/dist/mcp/tools/registrar.js +17 -0
  86. package/dist/mcp/tools/registrar.js.map +1 -0
  87. package/dist/mcp/tools/report.d.ts +4 -0
  88. package/dist/mcp/tools/report.d.ts.map +1 -0
  89. package/dist/mcp/tools/report.js +68 -0
  90. package/dist/mcp/tools/report.js.map +1 -0
  91. package/dist/mcp/tools/shared.d.ts +37 -0
  92. package/dist/mcp/tools/shared.d.ts.map +1 -0
  93. package/dist/mcp/tools/shared.js +214 -0
  94. package/dist/mcp/tools/shared.js.map +1 -0
  95. package/dist/mcp/trace.d.ts +47 -0
  96. package/dist/mcp/trace.d.ts.map +1 -0
  97. package/dist/mcp/trace.js +216 -0
  98. package/dist/mcp/trace.js.map +1 -0
  99. package/dist/nidra/index.d.ts +275 -0
  100. package/dist/nidra/index.d.ts.map +1 -0
  101. package/dist/nidra/index.js +889 -0
  102. package/dist/nidra/index.js.map +1 -0
  103. package/dist/persistence/migrations.d.ts +10 -0
  104. package/dist/persistence/migrations.d.ts.map +1 -0
  105. package/dist/persistence/migrations.js +77 -0
  106. package/dist/persistence/migrations.js.map +1 -0
  107. package/dist/persistence/sqlite.d.ts +30 -0
  108. package/dist/persistence/sqlite.d.ts.map +1 -0
  109. package/dist/persistence/sqlite.js +209 -0
  110. package/dist/persistence/sqlite.js.map +1 -0
  111. package/dist/persistence/types.d.ts +104 -0
  112. package/dist/persistence/types.d.ts.map +1 -0
  113. package/dist/persistence/types.js +5 -0
  114. package/dist/persistence/types.js.map +1 -0
  115. package/dist/pulse/index.d.ts +144 -0
  116. package/dist/pulse/index.d.ts.map +1 -0
  117. package/dist/pulse/index.js +453 -0
  118. package/dist/pulse/index.js.map +1 -0
  119. package/dist/raksha/classifiers/http-classifier.d.ts +26 -0
  120. package/dist/raksha/classifiers/http-classifier.d.ts.map +1 -0
  121. package/dist/raksha/classifiers/http-classifier.js +62 -0
  122. package/dist/raksha/classifiers/http-classifier.js.map +1 -0
  123. package/dist/raksha/classifiers/index.d.ts +5 -0
  124. package/dist/raksha/classifiers/index.d.ts.map +1 -0
  125. package/dist/raksha/classifiers/index.js +8 -0
  126. package/dist/raksha/classifiers/index.js.map +1 -0
  127. package/dist/raksha/classifiers/onnx-classifier.d.ts +41 -0
  128. package/dist/raksha/classifiers/onnx-classifier.d.ts.map +1 -0
  129. package/dist/raksha/classifiers/onnx-classifier.js +99 -0
  130. package/dist/raksha/classifiers/onnx-classifier.js.map +1 -0
  131. package/dist/raksha/hallucination-detectors.d.ts +106 -0
  132. package/dist/raksha/hallucination-detectors.d.ts.map +1 -0
  133. package/dist/raksha/hallucination-detectors.js +327 -0
  134. package/dist/raksha/hallucination-detectors.js.map +1 -0
  135. package/dist/raksha/index.d.ts +168 -0
  136. package/dist/raksha/index.d.ts.map +1 -0
  137. package/dist/raksha/index.js +597 -0
  138. package/dist/raksha/index.js.map +1 -0
  139. package/dist/raksha/prompt-injection-detectors.d.ts +30 -0
  140. package/dist/raksha/prompt-injection-detectors.d.ts.map +1 -0
  141. package/dist/raksha/prompt-injection-detectors.js +153 -0
  142. package/dist/raksha/prompt-injection-detectors.js.map +1 -0
  143. package/dist/types.d.ts +1115 -0
  144. package/dist/types.d.ts.map +1 -0
  145. package/dist/types.js +71 -0
  146. package/dist/types.js.map +1 -0
  147. package/dist/util/calibration.d.ts +32 -0
  148. package/dist/util/calibration.d.ts.map +1 -0
  149. package/dist/util/calibration.js +108 -0
  150. package/dist/util/calibration.js.map +1 -0
  151. package/dist/util/id.d.ts +2 -0
  152. package/dist/util/id.d.ts.map +1 -0
  153. package/dist/util/id.js +9 -0
  154. package/dist/util/id.js.map +1 -0
  155. package/dist/vyayam/index.d.ts +76 -0
  156. package/dist/vyayam/index.d.ts.map +1 -0
  157. package/dist/vyayam/index.js +528 -0
  158. package/dist/vyayam/index.js.map +1 -0
  159. package/dist/vyayam/tool-fault-proxy.d.ts +95 -0
  160. package/dist/vyayam/tool-fault-proxy.d.ts.map +1 -0
  161. package/dist/vyayam/tool-fault-proxy.js +170 -0
  162. package/dist/vyayam/tool-fault-proxy.js.map +1 -0
  163. package/docs/ARCHITECTURE.md +162 -0
  164. package/docs/BACKLOG.md +342 -0
  165. package/docs/CONFIGURATION.md +305 -0
  166. package/docs/EVIDENCE.md +232 -0
  167. package/docs/EVIDENCE_MATRIX.md +293 -0
  168. package/docs/KNOWN_FAILURES.md +367 -0
  169. package/docs/MCP.md +614 -0
  170. package/docs/MODULES.md +368 -0
  171. package/docs/SECURITY.md +251 -0
  172. package/docs/TRUST.md +88 -0
  173. package/docs/assets/ojas-hero.png +0 -0
  174. package/package.json +101 -0
package/docs/TRUST.md ADDED
@@ -0,0 +1,88 @@
1
+ # Trust model
2
+
3
+ Ojas is built to make autonomous agents easier to monitor, harden, and
4
+ recover. This document defines the boundary of that trust so the README
5
+ can stay product-focused without hiding operational caveats.
6
+
7
+ ## Current deployment boundary
8
+
9
+ Ojas v0.3 is experimental local infrastructure. The MCP server currently
10
+ uses **stdio transport only** and assumes the MCP host that launches it is
11
+ trusted.
12
+
13
+ Agent IDs are routing identifiers, not credentials. This is the
14
+ intentional trust boundary for this version, not a missing feature:
15
+ stdio MCP has no portable per-call identity to authenticate against, so
16
+ the security boundary is the OS / process boundary that runs the server.
17
+
18
+ Do **not** expose the MCP server to untrusted callers, multiple tenants,
19
+ or the network without an external authenticated gateway.
20
+
21
+ ## MCP trust model
22
+
23
+ The Ojas MCP server is intended to be launched by a trusted local MCP host
24
+ such as Claude Code, Cursor, or Windsurf for a single user / workspace.
25
+ It does **not** authenticate individual MCP tool calls. Any process that
26
+ can launch or talk to the stdio server is trusted as the caller.
27
+
28
+ - Run one process per trusted user / workspace.
29
+ - Do not expose this server over a network or share one process across untrusted users.
30
+ - For multi-user or network deployments, front Ojas with an authenticated MCP gateway, or run one isolated Ojas process per user / workspace.
31
+
32
+ Recommended locked-down local configuration:
33
+
34
+ ```bash
35
+ OJAS_TRUSTED_SINGLE_TENANT=1 # acknowledge the trust model (silences warning)
36
+ OJAS_DISABLE_AUTO_REGISTER=1 # reject unknown agent_id, force explicit registration
37
+ OJAS_ALLOWED_AGENT_IDS=my-agent # hard allowlist
38
+ OJAS_MAX_AGENTS=1 # one agent per process
39
+ # do NOT set OJAS_ALLOW_REPLACE_EXISTING unless you're debugging
40
+ ```
41
+
42
+ Full security posture and non-goals live in [`SECURITY.md`](./SECURITY.md).
43
+
44
+ ## Evidence caveats
45
+
46
+ Ojas v0.3 ships with L2 / L2.5 evidence: reproducible synthetic and
47
+ realistic-synthetic benchmark suites. These prove the mechanisms work as
48
+ designed against canonical failure patterns.
49
+
50
+ They are not yet proof of:
51
+
52
+ - production security against real adversaries
53
+ - real-LLM token, latency, or cost numbers
54
+ - generalisation across organisations or threat models
55
+ - live incident reduction in production
56
+
57
+ The opt-in real-LLM and judge pipeline exists, but Ojas does not claim L3
58
+ evidence until those runs are regular, stored, externally covered, and
59
+ spot-reviewed. See [`EVIDENCE_MATRIX.md`](./EVIDENCE_MATRIX.md).
60
+
61
+ ## Demo limitations
62
+
63
+ The README demo is deterministic. It uses a tiny stand-in agent, not a
64
+ real LLM call, so it needs no API keys and should produce identical output
65
+ every run.
66
+
67
+ Raksha is a deterministic detector stack plus optional classifier
68
+ interfaces. It catches canonical injection patterns and several common
69
+ bypass classes, but it is not a learned security boundary. Remaining
70
+ bypass categories are listed in [`KNOWN_FAILURES.md`](./KNOWN_FAILURES.md).
71
+
72
+ Treat health scores as advisory signals, not authoritative ground truth.
73
+ They are useful for triage, trend deltas, and gates you tune for your own
74
+ agent runtime.
75
+
76
+ ## What v0.3 added
77
+
78
+ v0.3 improves the trust story with:
79
+
80
+ - `PromptInjectionClassifier` plugins
81
+ - `AbortSignal` cancellation
82
+ - SQLite encryption and backup support
83
+ - L3 evidence pipeline scaffolding
84
+ - MCP audit logging
85
+ - integration adapters for LangChain, OpenAI Agents SDK, Vercel AI SDK, and MCP clients
86
+
87
+ The next trust step is recurring L3 evidence: real LLM runs with stored
88
+ transcripts, judge output, and human spot review.
Binary file
package/package.json ADDED
@@ -0,0 +1,101 @@
1
+ {
2
+ "name": "@beingmartinbmc/ojas",
3
+ "version": "0.2.0",
4
+ "description": "Ojas — AI Health Infrastructure for Autonomous Agents",
5
+ "license": "MIT",
6
+ "author": "Ankit Sharma <ankit.sharma199803@gmail.com>",
7
+ "homepage": "https://github.com/beingmartinbmc/ojas#readme",
8
+ "repository": {
9
+ "type": "git",
10
+ "url": "git+https://github.com/beingmartinbmc/ojas.git"
11
+ },
12
+ "bugs": {
13
+ "url": "https://github.com/beingmartinbmc/ojas/issues"
14
+ },
15
+ "main": "dist/index.js",
16
+ "types": "dist/index.d.ts",
17
+ "exports": {
18
+ ".": {
19
+ "types": "./dist/index.d.ts",
20
+ "require": "./dist/index.js"
21
+ },
22
+ "./mcp/server": {
23
+ "types": "./dist/mcp/server.d.ts",
24
+ "require": "./dist/mcp/server.js"
25
+ },
26
+ "./persistence/sqlite": {
27
+ "types": "./dist/persistence/sqlite.d.ts",
28
+ "require": "./dist/persistence/sqlite.js"
29
+ },
30
+ "./raksha/classifiers": {
31
+ "types": "./dist/raksha/classifiers/index.d.ts",
32
+ "require": "./dist/raksha/classifiers/index.js"
33
+ },
34
+ "./util/calibration": {
35
+ "types": "./dist/util/calibration.d.ts",
36
+ "require": "./dist/util/calibration.js"
37
+ },
38
+ "./package.json": "./package.json"
39
+ },
40
+ "bin": {
41
+ "ojas-mcp": "dist/mcp/server.js"
42
+ },
43
+ "files": [
44
+ "dist",
45
+ "docs",
46
+ "LICENSE",
47
+ "README.md"
48
+ ],
49
+ "scripts": {
50
+ "build": "tsc -b",
51
+ "typecheck:aux": "tsc -p tsconfig.check.json",
52
+ "pretest": "tsc -b",
53
+ "test": "node --experimental-vm-modules node_modules/jest/bin/jest.js --coverage",
54
+ "lint": "eslint \"src/**/*.ts\" \"benchmarks/**/*.ts\" \"test/**/*.ts\" \"examples/**/*.ts\"",
55
+ "check": "npm run lint && npm run build && npm run typecheck:aux && npm test",
56
+ "demo": "ts-node src/demo.ts",
57
+ "demo:before-after": "ts-node examples/before-after.ts",
58
+ "mcp": "ts-node src/mcp/server.ts",
59
+ "mcp:built": "node dist/mcp/server.js",
60
+ "benchmark": "npm run typecheck:aux && ts-node benchmarks/runner.ts",
61
+ "benchmark:fast": "ts-node --transpile-only benchmarks/runner.ts",
62
+ "benchmark:write": "npm run typecheck:aux && ts-node benchmarks/runner.ts --write-evidence",
63
+ "verify:evidence": "ts-node benchmarks/verify-evidence.ts",
64
+ "prepublishOnly": "npm run check && npm run benchmark && npm run verify:evidence"
65
+ },
66
+ "keywords": [
67
+ "ai",
68
+ "agents",
69
+ "mcp",
70
+ "observability",
71
+ "agent-health",
72
+ "prompt-injection",
73
+ "context-engineering",
74
+ "autonomous-agents",
75
+ "llm",
76
+ "typescript"
77
+ ],
78
+ "engines": {
79
+ "node": ">=18"
80
+ },
81
+ "publishConfig": {
82
+ "access": "public"
83
+ },
84
+ "dependencies": {
85
+ "@modelcontextprotocol/sdk": "^1.0.0",
86
+ "better-sqlite3": "^12.10.0",
87
+ "zod": "^3.23.0"
88
+ },
89
+ "devDependencies": {
90
+ "@types/better-sqlite3": "^7.6.13",
91
+ "@types/jest": "^29.5.0",
92
+ "@types/node": "^20.11.0",
93
+ "@typescript-eslint/eslint-plugin": "^7.18.0",
94
+ "@typescript-eslint/parser": "^7.18.0",
95
+ "eslint": "^8.56.0",
96
+ "jest": "^29.7.0",
97
+ "ts-jest": "^29.1.0",
98
+ "ts-node": "^10.9.0",
99
+ "typescript": "^5.4.0"
100
+ }
101
+ }