@captra-ai/core 0.5.0 → 0.5.1
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 +27 -0
- package/package.json +1 -1
package/README.md
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# @captra-ai/core
|
|
2
|
+
|
|
3
|
+
The typed contract and execution runtime behind Captra: capabilities, agents, tools, scoped memory, approvals, budgets, durable runs, cancellation, checkpoints, effect receipts, telemetry, replay, and evaluations.
|
|
4
|
+
|
|
5
|
+
```bash
|
|
6
|
+
npm install @captra-ai/core zod
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
```ts
|
|
10
|
+
import { capability, capabilityViews, createRuntime, defineApp } from '@captra-ai/core'
|
|
11
|
+
import { z } from 'zod'
|
|
12
|
+
|
|
13
|
+
const greet = capability({
|
|
14
|
+
name: 'greet', description: 'Greet a user',
|
|
15
|
+
input: z.object({ name: z.string() }),
|
|
16
|
+
output: z.object({ message: z.string() }),
|
|
17
|
+
run: async ({ name }) => ({ message: `Hello, ${name}!` }),
|
|
18
|
+
view: { name: 'Greeting' },
|
|
19
|
+
})
|
|
20
|
+
|
|
21
|
+
const app = defineApp({ name: 'Demo', scopes: [], capabilities: [greet], surface: capabilityViews() })
|
|
22
|
+
const runtime = createRuntime(app)
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
External writes should be declared as write tools with a stable `idempotencyKey`. Human approval records an independent approver identity and denies requester self-approval by default.
|
|
26
|
+
|
|
27
|
+
[Core documentation](https://vaibhavbansal26.github.io/captra/reference/capabilities) · [GitHub](https://github.com/VaibhavBansal26/captra/tree/main/packages/core) · MIT
|