@llm-refract/sdk 0.1.1 → 0.1.3
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.
- package/README.md +39 -7
- package/package.json +11 -2
package/README.md
CHANGED
|
@@ -1,8 +1,26 @@
|
|
|
1
|
+
<div align="center">
|
|
2
|
+
|
|
3
|
+
<img src="https://raw.githubusercontent.com/khaleddeissa/llm-refract/main/assets/llm-refract-logo.svg" width="96" height="96" alt="Refract green diamond" />
|
|
4
|
+
|
|
1
5
|
# @llm-refract/sdk
|
|
2
6
|
|
|
3
|
-
Node.js SDK for Refract — a portable execution recording, replay and diff engine for AI systems
|
|
4
|
-
|
|
5
|
-
|
|
7
|
+
**Node.js SDK for Refract — a portable execution recording, replay and diff engine for AI systems.**
|
|
8
|
+
|
|
9
|
+
[](https://www.npmjs.com/package/@llm-refract/sdk)
|
|
10
|
+
[](https://www.npmjs.com/package/@llm-refract/sdk)
|
|
11
|
+
[](https://nodejs.org/)
|
|
12
|
+
[](#)
|
|
13
|
+
[](https://github.com/khaleddeissa/llm-refract/blob/main/LICENSE)
|
|
14
|
+
|
|
15
|
+
[Docs](https://github.com/khaleddeissa/llm-refract/tree/main/docs) · [Examples](https://github.com/khaleddeissa/llm-refract/tree/main/examples/typescript) · [Source](https://github.com/khaleddeissa/llm-refract/tree/main/packages/typescript) · [Issues](https://github.com/khaleddeissa/llm-refract/issues)
|
|
16
|
+
|
|
17
|
+
</div>
|
|
18
|
+
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
Targets server-side Node.js apps and agents. Uses `AsyncLocalStorage`, filesystem and crypto APIs —
|
|
22
|
+
not a browser SDK. Record model calls, tools, retrieval, decisions, state changes, checkpoints and
|
|
23
|
+
failures as a portable `.rfr` artifact, or submit them live to a Refract endpoint.
|
|
6
24
|
|
|
7
25
|
## Install
|
|
8
26
|
|
|
@@ -33,13 +51,27 @@ const answer = await refract.run(
|
|
|
33
51
|
const recorded = unpack(await readFile("agent.rfr"));
|
|
34
52
|
```
|
|
35
53
|
|
|
36
|
-
Omit `endpoint` for offline recording, or `path` for API-only submission. `
|
|
37
|
-
|
|
54
|
+
Omit `endpoint` for offline recording, or `path` for API-only submission. `onComplete(execution)` gives
|
|
55
|
+
a cloned snapshot after capture/export. Recording/export errors reject an otherwise successful call;
|
|
56
|
+
application errors take priority.
|
|
57
|
+
|
|
58
|
+
`pack`/`unpack` read and write the text artifact profile and verify checksums on read. The Rust CLI
|
|
59
|
+
reads legacy ZIP recordings; TypeScript types describe canonical events, with authoritative ingestion
|
|
60
|
+
validation in the Rust engine.
|
|
61
|
+
|
|
62
|
+
Try `node examples/typescript/basic/record.mjs` or `node examples/typescript/concurrent/record.mjs`
|
|
63
|
+
after building the SDK. Outputs go to `.examples/`.
|
|
64
|
+
|
|
65
|
+
See the [TypeScript usage guide](https://github.com/khaleddeissa/llm-refract/blob/main/docs/usage/typescript.md)
|
|
66
|
+
for more.
|
|
38
67
|
|
|
39
68
|
## Links
|
|
40
69
|
|
|
41
70
|
- [Documentation](https://github.com/khaleddeissa/llm-refract/tree/main/docs)
|
|
42
|
-
- [
|
|
71
|
+
- [Python SDK](https://pypi.org/project/llm-refract/)
|
|
72
|
+
- [Rust CLI and engine](https://github.com/khaleddeissa/llm-refract/tree/main/crates)
|
|
43
73
|
- [Issues](https://github.com/khaleddeissa/llm-refract/issues)
|
|
44
74
|
|
|
45
|
-
License
|
|
75
|
+
## License
|
|
76
|
+
|
|
77
|
+
Apache-2.0 — see [LICENSE](https://github.com/khaleddeissa/llm-refract/blob/main/LICENSE).
|
package/package.json
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@llm-refract/sdk",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.3",
|
|
4
|
+
"description": "Node.js SDK for Refract — provider-neutral instrumentation and portable execution artifacts for AI systems.",
|
|
4
5
|
"type": "module",
|
|
5
6
|
"main": "dist/index.js",
|
|
6
7
|
"types": "dist/index.d.ts",
|
|
@@ -26,5 +27,13 @@
|
|
|
26
27
|
"build": "tsc -p tsconfig.build.json",
|
|
27
28
|
"typecheck": "tsc --noEmit",
|
|
28
29
|
"test": "vitest run"
|
|
29
|
-
}
|
|
30
|
+
},
|
|
31
|
+
"keywords": [
|
|
32
|
+
"llm",
|
|
33
|
+
"observability",
|
|
34
|
+
"replay",
|
|
35
|
+
"execution",
|
|
36
|
+
"agent",
|
|
37
|
+
"tracing"
|
|
38
|
+
]
|
|
30
39
|
}
|