risicare 0.5.2 → 0.7.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 (41) hide show
  1. package/LICENSE +26 -0
  2. package/README.md +43 -10
  3. package/dist/frameworks/instructor.cjs.map +1 -1
  4. package/dist/frameworks/instructor.js.map +1 -1
  5. package/dist/frameworks/langchain.cjs.map +1 -1
  6. package/dist/frameworks/langchain.js.map +1 -1
  7. package/dist/frameworks/langgraph.cjs.map +1 -1
  8. package/dist/frameworks/langgraph.js.map +1 -1
  9. package/dist/frameworks/llamaindex.cjs.map +1 -1
  10. package/dist/frameworks/llamaindex.js.map +1 -1
  11. package/dist/index.cjs +185 -24
  12. package/dist/index.cjs.map +1 -1
  13. package/dist/index.d.cts +16 -2
  14. package/dist/index.d.ts +16 -2
  15. package/dist/index.js +185 -24
  16. package/dist/index.js.map +1 -1
  17. package/dist/providers/anthropic/index.cjs.map +1 -1
  18. package/dist/providers/anthropic/index.js.map +1 -1
  19. package/dist/providers/bedrock/index.cjs.map +1 -1
  20. package/dist/providers/bedrock/index.js.map +1 -1
  21. package/dist/providers/cerebras/index.cjs.map +1 -1
  22. package/dist/providers/cerebras/index.js.map +1 -1
  23. package/dist/providers/cohere/index.cjs.map +1 -1
  24. package/dist/providers/cohere/index.js.map +1 -1
  25. package/dist/providers/google/index.cjs.map +1 -1
  26. package/dist/providers/google/index.js.map +1 -1
  27. package/dist/providers/groq/index.cjs.map +1 -1
  28. package/dist/providers/groq/index.js.map +1 -1
  29. package/dist/providers/huggingface/index.cjs.map +1 -1
  30. package/dist/providers/huggingface/index.js.map +1 -1
  31. package/dist/providers/mistral/index.cjs.map +1 -1
  32. package/dist/providers/mistral/index.js.map +1 -1
  33. package/dist/providers/ollama/index.cjs.map +1 -1
  34. package/dist/providers/ollama/index.js.map +1 -1
  35. package/dist/providers/openai/index.cjs.map +1 -1
  36. package/dist/providers/openai/index.js.map +1 -1
  37. package/dist/providers/together/index.cjs.map +1 -1
  38. package/dist/providers/together/index.js.map +1 -1
  39. package/dist/providers/vercel-ai/index.cjs.map +1 -1
  40. package/dist/providers/vercel-ai/index.js.map +1 -1
  41. package/package.json +5 -12
package/LICENSE ADDED
@@ -0,0 +1,26 @@
1
+ Copyright (c) 2026 Conscience Labs Pvt. Ltd. All rights reserved.
2
+ Contact: info@consciencelabs.ai
3
+
4
+ COMMERCIAL END USER LICENSE AGREEMENT (EULA)
5
+
6
+ This software ("SDK") is the proprietary property of Conscience Labs Pvt. Ltd.
7
+ Your use of this SDK is strictly governed by the commercial subscription agreement
8
+ and terms of service entered into between your organization and Conscience Labs Pvt. Ltd.
9
+
10
+ LICENSE GRANT & RESTRICTIONS:
11
+ 1. Subject to an active, paid subscription, you are granted a limited, non-exclusive,
12
+ non-transferable license to integrate this SDK into your applications solely to
13
+ utilize the AI Observability services hosted by Conscience Labs Pvt. Ltd.
14
+ 2. You shall not modify, adapt, alter, translate, or create derivative works from this SDK.
15
+ 3. You shall not reverse engineer, decompile, disassemble, or otherwise attempt to
16
+ derive the source code of this SDK.
17
+ 4. You shall not distribute, sublicense, lease, rent, or loan this SDK to any third
18
+ party as a standalone tool or product.
19
+
20
+ WARRANTY DISCLAIMER:
21
+ THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR
22
+ IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
23
+ FITNESS FOR A PARTICULAR PURPOSE.
24
+
25
+ For licensing inquiries, custom enterprise terms, or support, please contact:
26
+ info@consciencelabs.ai
package/README.md CHANGED
@@ -5,7 +5,7 @@ AI agent observability and error diagnosis for Node.js and TypeScript.
5
5
  [![npm version](https://img.shields.io/npm/v/risicare.svg)](https://www.npmjs.com/package/risicare)
6
6
  [![npm downloads](https://img.shields.io/npm/dm/risicare.svg)](https://www.npmjs.com/package/risicare)
7
7
  [![TypeScript](https://img.shields.io/badge/TypeScript-ready-blue.svg)](https://www.npmjs.com/package/risicare)
8
- [![License: MIT](https://img.shields.io/npm/l/risicare.svg)](https://opensource.org/licenses/MIT)
8
+ [![License: Proprietary](https://img.shields.io/badge/license-proprietary-red.svg)](LICENSE)
9
9
 
10
10
  Monitor your AI agents in production. Trace every LLM call, detect errors automatically, and get AI-generated fix suggestions — with 3 lines of setup.
11
11
 
@@ -23,7 +23,7 @@ import OpenAI from 'openai';
23
23
  // 1. Initialize
24
24
  init({
25
25
  apiKey: 'rsk-...',
26
- endpoint: 'https://app.risicare.ai',
26
+ endpoint: 'https://ingest.risicare.ai',
27
27
  });
28
28
 
29
29
  // 2. Patch your LLM client
@@ -69,6 +69,10 @@ When capture is off, content-bearing attributes are **replaced** with
69
69
  `<risicare:content-omitted>` rather than removed, so "no prompt was sent" stays
70
70
  distinguishable from "capture is off".
71
71
 
72
+ Since 0.7.0, the gate also covers the OpenTelemetry GenAI, OpenInference and
73
+ CrewAI content keys, for example `input.value`, `output.value`,
74
+ `gen_ai.input.messages` and `gen_ai.output.messages`.
75
+
72
76
  If you want content captured but redacted first, use the `mask` hook — it is
73
77
  independent of this switch and runs on every content-bearing field before
74
78
  export:
@@ -142,9 +146,10 @@ import {
142
146
  init({ apiKey, endpoint }) // Initialize SDK
143
147
  agent({ name }, fn) // Wrap function with agent identity
144
148
  session({ sessionId, userId }, fn) // Group traces into user sessions
145
- traceThink('analyze', async () => {...}) // Tag reasoning phase
146
- traceDecide('choose', async () => {...}) // Tag decision phase
147
- traceAct('execute', async () => {...}) // Tag action phase
149
+ // These are WRAPPER FACTORIES: they return a function you then call.
150
+ await traceThink('analyze', async () => {...})() // note the trailing ()
151
+ await traceDecide('choose', async () => {...})()
152
+ await traceAct('execute', async () => {...})()
148
153
  reportError(error) // Report caught errors for diagnosis
149
154
  score(traceId, 'quality', 0.92) // Record evaluation score [0.0-1.0]
150
155
  tracedStream(asyncIterable, 'stream') // Trace async iterators
@@ -174,23 +179,48 @@ try {
174
179
  }
175
180
  ```
176
181
 
182
+ ## Fix application is off by default
183
+
184
+ **Since 0.7.0, FixRuntime starts only when you opt in.** FixRuntime reads the
185
+ active fixes for your project from Risicare and applies them to your LLM calls.
186
+ A fix can change a prompt, a parameter, a tool, the retry or fallback behaviour,
187
+ a guard, or the model routing. Through 0.6.0, FixRuntime started automatically
188
+ when you set an API key.
189
+
190
+ When FixRuntime is off, the SDK does not request `/fixes/active`, and it does
191
+ not change your LLM calls. Tracing, error reporting and scores are not affected.
192
+
193
+ To opt in:
194
+
195
+ ```typescript
196
+ init({ apiKey: 'rsk-...', fixRuntime: true });
197
+ // or set RISICARE_FIX_RUNTIME=true
198
+ ```
199
+
200
+ When FixRuntime is on, the SDK requests the active fixes during `init()` and
201
+ then every 60 seconds. The `fixRuntime` option has priority over the environment variable.
202
+
177
203
  ## Decision Phases
178
204
 
179
205
  Structure your traces to see how your agent thinks, decides, and acts:
180
206
 
181
207
  ```typescript
208
+ // traceThink / traceDecide / traceAct RETURN A WRAPPED FUNCTION — they do not
209
+ // run your callback themselves. Call the result (the trailing `()` below).
210
+ // Omitting it is silent: you get a function back, your callback never runs,
211
+ // and no span is emitted.
182
212
  const myAgent = agent({ name: 'planner', role: 'coordinator' }, async (input) => {
183
213
  const analysis = await traceThink('analyze', async () => {
184
214
  return await openai.chat.completions.create({ /* ... */ });
185
- });
215
+ })();
186
216
 
187
217
  const decision = await traceDecide('choose-action', async () => {
188
218
  return pickBestAction(analysis);
189
- });
219
+ })();
190
220
 
191
221
  return await traceAct('execute', async () => {
192
222
  return executeAction(decision);
193
- });
223
+ })();
194
224
  });
195
225
  ```
196
226
 
@@ -252,7 +282,6 @@ explicitly.
252
282
 
253
283
  ## Support
254
284
 
255
- - **Bug reports**: [github.com/Conscience-AI-Labs/risicare-ops/issues](https://github.com/Conscience-AI-Labs/risicare-ops/issues)
256
285
  - **Email**: support@risicare.ai
257
286
  - **Docs**: [risicare.ai/docs](https://risicare.ai/docs)
258
287
 
@@ -261,4 +290,8 @@ SDK or platform issue — fast feedback shapes GA.
261
290
 
262
291
  ## License
263
292
 
264
- [MIT](LICENSE)
293
+ **Proprietary. You need a commercial licence.** See [LICENSE](LICENSE).
294
+
295
+ Conscience Labs Pvt. Ltd. owns this SDK. You need an active, paid
296
+ subscription to use it. You may not change it, make derivative works from
297
+ it, reverse engineer it, or redistribute it. Contact <info@consciencelabs.ai>.