@agenticrun/sdk 0.1.0-alpha.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.
package/README.md ADDED
@@ -0,0 +1,60 @@
1
+ # @agenticrun/sdk
2
+
3
+ Agenticrun SDK for trusted Node.js applications (Node.js 24.12 or newer, ESM).
4
+ The SDK loads managed agent configuration and credentials from Agenticrun and
5
+ sends session traces to the backend. Never use it in a browser or expose the
6
+ Agent API key or returned provider credential to end users.
7
+
8
+ ## LangChain
9
+
10
+ ```sh
11
+ npm install @agenticrun/sdk@alpha langchain
12
+ ```
13
+
14
+ Set `AGENTICRUN_AGENT_API_KEY` to your Agent API key. Optionally set
15
+ `AGENTICRUN_API_URL` (default: `https://api.agenticrun.de/v1`).
16
+
17
+ ```ts
18
+ import { createAgenticRun } from '@agenticrun/sdk/langchain'
19
+ import { createAgent } from 'langchain'
20
+
21
+ const { model, middleware, createSession } = await createAgenticRun()
22
+ const agent = createAgent({ model, middleware })
23
+ const session = createSession()
24
+ const result = await agent.invoke({ messages: [{ role: 'user', content: 'Hello!' }] }, session.createInvocationConfig())
25
+ ```
26
+
27
+ ## Framework-independent core
28
+
29
+ ```ts
30
+ import { createAgenticRunClient } from '@agenticrun/sdk'
31
+
32
+ const client = await createAgenticRunClient()
33
+ const session = client.createSession()
34
+ const trace = session.createTrace({ rootSpan: { name: 'my-agent', spanType: 'agent' } })
35
+ await trace.started
36
+ trace.rootSpan.complete({ status: 'success', output: { type: 'text', text: 'Hello!' } })
37
+ await trace.complete('success')
38
+ ```
39
+
40
+ The root entrypoint does not load LangChain. Both entrypoints belong to the same
41
+ package. Provider and LangChain libraries remain runtime dependencies; shared
42
+ Agenticrun code and TypeScript declarations are included in the release.
43
+
44
+ Tracing delivery is timeout-bounded and does not reject the agent result when
45
+ delivery fails. Heartbeats and recovery of abandoned traces are not implemented.
46
+
47
+ ## Release development
48
+
49
+ From the repository root, `pnpm sdk:build` builds `packages/sdk/release` directly
50
+ from source. `pnpm sdk:pack` rebuilds and creates the npm tarball in that directory.
51
+ These commands leave workspace `dist` directories untouched and never publish.
52
+ `pnpm sdk:verify` rebuilds, packs and installs the tarball in a temporary directory,
53
+ then checks the public imports, TypeScript declarations and tracing with a mocked
54
+ backend. It requires npm registry access and removes the temporary consumer afterward.
55
+ The workspace package stays private; the generated release manifest contains
56
+ only runtime dependencies and compiled public entrypoints.
57
+
58
+ Version and license are maintained in `packages/sdk/package.json`. The initial
59
+ version is an alpha; the prepared publish configuration uses the `alpha` tag.
60
+ License: UNLICENSED, pending the owner's licensing decision.