@recursiv/sdk 0.6.0 → 0.6.2
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 +2 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +8 -0
- package/dist/index.js.map +1 -1
- package/dist/resources/agents.d.ts +1 -1
- package/dist/resources/agents.d.ts.map +1 -1
- package/dist/resources/agents.js +16 -10
- package/dist/resources/agents.js.map +1 -1
- package/dist/resources/auth.d.ts +31 -1
- package/dist/resources/auth.d.ts.map +1 -1
- package/dist/resources/auth.js +88 -10
- package/dist/resources/auth.js.map +1 -1
- package/dist/resources/dispatcher.d.ts +38 -8
- package/dist/resources/dispatcher.d.ts.map +1 -1
- package/dist/resources/dispatcher.js +33 -21
- package/dist/resources/dispatcher.js.map +1 -1
- package/dist/resources/evidence.d.ts +173 -0
- package/dist/resources/evidence.d.ts.map +1 -0
- package/dist/resources/evidence.js +50 -0
- package/dist/resources/evidence.js.map +1 -0
- package/dist/resources/goals.d.ts +66 -0
- package/dist/resources/goals.d.ts.map +1 -0
- package/dist/resources/goals.js +31 -0
- package/dist/resources/goals.js.map +1 -0
- package/llm.md +34 -0
- package/package.json +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"goals.d.ts","sourceRoot":"","sources":["../../src/resources/goals.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAIlD,MAAM,WAAW,IAAI;IACnB,EAAE,EAAE,MAAM,CAAC;IACX,eAAe,EAAE,MAAM,CAAC;IACxB,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,MAAM,EAAE,QAAQ,GAAG,MAAM,GAAG,U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,GAAG,MAAM,GAAG,UAAU,CAAC;CACzC;AAID,qBAAa,aAAa;IACZ,OAAO,CAAC,MAAM;gBAAN,MAAM,EAAE,UAAU;IAEtC,4CAA4C;IAC5C,IAAI,CAAC,MAAM,CAAC,EAAE,eAAe,GAAG,OAAO,CAAC,cAAc,CAAC,IAAI,EAAE,CAAC,CAAC;IAI/D,4CAA4C;IAC5C,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE;QAAE,eAAe,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC;IAIzF,oBAAoB;IACpB,MAAM,CAAC,KAAK,EAAE,eAAe,GAAG,OAAO,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC;IAI7D,gFAAgF;IAChF,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,eAAe,GAAG,OAAO,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC;IAI7E,oEAAoE;IACpE,OAAO,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE;QAAE,eAAe,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC;CAM9F"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
// ── Resource ──
|
|
2
|
+
export class GoalsResource {
|
|
3
|
+
client;
|
|
4
|
+
constructor(client) {
|
|
5
|
+
this.client = client;
|
|
6
|
+
}
|
|
7
|
+
/** List goals with per-goal task rollups */
|
|
8
|
+
list(params) {
|
|
9
|
+
return this.client.get('/goals', params);
|
|
10
|
+
}
|
|
11
|
+
/** Get a single goal (with rollup) by ID */
|
|
12
|
+
get(goalId, params) {
|
|
13
|
+
return this.client.get(`/goals/${encodeURIComponent(goalId)}`, params);
|
|
14
|
+
}
|
|
15
|
+
/** Create a goal */
|
|
16
|
+
create(input) {
|
|
17
|
+
return this.client.post('/goals', input);
|
|
18
|
+
}
|
|
19
|
+
/** Update a goal (name, description, status, target date, owner, sort order) */
|
|
20
|
+
update(goalId, input) {
|
|
21
|
+
return this.client.patch(`/goals/${encodeURIComponent(goalId)}`, input);
|
|
22
|
+
}
|
|
23
|
+
/** Archive (soft-delete) a goal — its tasks become miscellaneous */
|
|
24
|
+
archive(goalId, params) {
|
|
25
|
+
const query = params?.organization_id
|
|
26
|
+
? `?organization_id=${encodeURIComponent(params.organization_id)}`
|
|
27
|
+
: '';
|
|
28
|
+
return this.client.delete(`/goals/${encodeURIComponent(goalId)}${query}`);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=goals.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"goals.js","sourceRoot":"","sources":["../../src/resources/goals.ts"],"names":[],"mappings":"AAuDA,iBAAiB;AAEjB,MAAM,OAAO,aAAa;IACJ;IAApB,YAAoB,MAAkB;QAAlB,WAAM,GAAN,MAAM,CAAY;IAAG,CAAC;IAE1C,4CAA4C;IAC5C,IAAI,CAAC,MAAwB;QAC3B,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,QAAQ,EAAE,MAAiC,CAAC,CAAC;IACtE,CAAC;IAED,4CAA4C;IAC5C,GAAG,CAAC,MAAc,EAAE,MAAqC;QACvD,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,UAAU,kBAAkB,CAAC,MAAM,CAAC,EAAE,EAAE,MAAiC,CAAC,CAAC;IACpG,CAAC;IAED,oBAAoB;IACpB,MAAM,CAAC,KAAsB;QAC3B,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC;IAC3C,CAAC;IAED,gFAAgF;IAChF,MAAM,CAAC,MAAc,EAAE,KAAsB;QAC3C,OAAO,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,UAAU,kBAAkB,CAAC,MAAM,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC;IAC1E,CAAC;IAED,oEAAoE;IACpE,OAAO,CAAC,MAAc,EAAE,MAAqC;QAC3D,MAAM,KAAK,GAAG,MAAM,EAAE,eAAe;YACnC,CAAC,CAAC,oBAAoB,kBAAkB,CAAC,MAAM,CAAC,eAAe,CAAC,EAAE;YAClE,CAAC,CAAC,EAAE,CAAC;QACP,OAAO,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,UAAU,kBAAkB,CAAC,MAAM,CAAC,GAAG,KAAK,EAAE,CAAC,CAAC;IAC5E,CAAC;CACF"}
|
package/llm.md
CHANGED
|
@@ -183,6 +183,32 @@ Methods: `tasks`, `stats`, `decisions`, `milestones`, `agents`, `teamActivity`,
|
|
|
183
183
|
|
|
184
184
|
---
|
|
185
185
|
|
|
186
|
+
## Evidence — Measure agents (evals, accuracy, cost)
|
|
187
|
+
|
|
188
|
+
### r.evidence — Author evals, run simulations, read graded results
|
|
189
|
+
|
|
190
|
+
```typescript
|
|
191
|
+
// Run a batch of cases through an agent or swarm and grade them (the whole loop)
|
|
192
|
+
const { data } = await r.evidence.simulate({
|
|
193
|
+
target: { type: 'swarm', id: swarmId },
|
|
194
|
+
cases: [{ input: 'New account, $9.6k order', expected: { answer: 'ESCALATE' } }],
|
|
195
|
+
evals: [{ name: 'On-policy', type: 'judge', definition: { rubric: 'Follows the risk policy?' }, judge_model: 'anthropic/claude-sonnet-4.6' }],
|
|
196
|
+
})
|
|
197
|
+
console.log(data.run_id, data.run?.accuracy) // per-step results in data.results
|
|
198
|
+
|
|
199
|
+
// Read the audit trail — what an agent/swarm actually did and what it cost
|
|
200
|
+
const { data: sum } = await r.evidence.summary({ type: 'swarm', id: swarmId })
|
|
201
|
+
const { data: events } = await r.evidence.records({ type: 'swarm', id: swarmId }, { limit: 50 })
|
|
202
|
+
const first = events[0]
|
|
203
|
+
const { data: step } = await r.evidence.recordDetail({ type: 'swarm', id: swarmId }, first.id, first.kind)
|
|
204
|
+
// step: model_call → { systemPrompt, promptMessages, responseText, reasoningText, toolCalls }
|
|
205
|
+
// tool_call → { toolName, args, result, success }
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
Methods: `createEval` (code | judge | match | consensus), `simulate`, `listRuns`, `getRun`, `summary`, `records`, `recordDetail`. Eval types: `code` (rule), `judge` (rubric, reference-free — use a different model family), `match` (vs known answer), `consensus` (cross-model agreement; premium). `records` is the continuous activity ledger (every model + tool call); `recordDetail` is the drill-down behind one event (exact prompt/reasoning, or exact tool inputs/outputs).
|
|
209
|
+
|
|
210
|
+
---
|
|
211
|
+
|
|
186
212
|
## Memory — Persistent agent memory across sessions
|
|
187
213
|
|
|
188
214
|
### r.memory — Facts, decisions, and search
|
|
@@ -510,6 +536,14 @@ Methods: `list`, `get`, `create`, `delete`
|
|
|
510
536
|
- `r.simulator` — Simulation/testing
|
|
511
537
|
- `r.dispatcher` — Task queue: `tasks()`, `create()`, `claimNext()`, `complete()`, `release()`, `stats()`, `signals()`, `outcomes()`, `staleItems()`, `stuckItems()`, `discoveries()`
|
|
512
538
|
- `r.dispatcher` (webhooks): `createWebhook()`, `listWebhooks()`, `updateWebhook()`, `deleteWebhook()`, `testWebhook()`, `webhookDeliveries()`, `cleanupWebhookLogs()`
|
|
539
|
+
- `r.goals` — Org goals that dispatcher tasks roll up into: `list()`, `get()`, `create()`, `update()`, `archive()`. Tasks link via `goal_id` on `r.dispatcher.create()/update()`; `tasks({ goal_id })` filters (use `'none'` for goal-less tasks).
|
|
540
|
+
|
|
541
|
+
```typescript
|
|
542
|
+
// Create a goal and group tasks under it (personal keys: pass organization_id)
|
|
543
|
+
const { data: goal } = await r.goals.create({ name: 'Ship the relaunch', organization_id: orgId })
|
|
544
|
+
await r.dispatcher.update(taskId, { goal_id: goal.id, organization_id: orgId })
|
|
545
|
+
const { data: goals } = await r.goals.list({ organization_id: orgId }) // includes task rollups
|
|
546
|
+
```
|
|
513
547
|
|
|
514
548
|
```typescript
|
|
515
549
|
// Create a webhook to receive dispatcher events
|