dashclaw 2.4.0 → 2.6.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 +29 -4
- package/dashclaw.js +13 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# DashClaw SDK (v2.
|
|
1
|
+
# DashClaw SDK (v2.6.0)
|
|
2
2
|
|
|
3
3
|
**Minimal governance runtime for AI agents.**
|
|
4
4
|
|
|
@@ -70,9 +70,9 @@ claw.update_outcome(action_id, status="completed")
|
|
|
70
70
|
|
|
71
71
|
---
|
|
72
72
|
|
|
73
|
-
## SDK Surface Area (v2.
|
|
73
|
+
## SDK Surface Area (v2.5.0)
|
|
74
74
|
|
|
75
|
-
The v2 SDK exposes **
|
|
75
|
+
The v2 SDK exposes **45 methods** optimized for stability and zero-overhead governance:
|
|
76
76
|
|
|
77
77
|
### Core Runtime
|
|
78
78
|
- `guard(context)` -- Policy evaluation ("Can I do X?"). Returns `risk_score` (server-computed) and `agent_risk_score` (raw agent value)
|
|
@@ -95,8 +95,33 @@ The v2 SDK exposes **44 methods** optimized for stability and zero-overhead gove
|
|
|
95
95
|
### Learning & Optimization
|
|
96
96
|
- `getLearningVelocity()` -- Track agent improvement rate.
|
|
97
97
|
- `getLearningCurves()` -- Measure efficiency gains per action type.
|
|
98
|
+
- `getLessons({ actionType, limit })` -- Fetch consolidated lessons from scored outcomes.
|
|
98
99
|
- `renderPrompt(context)` -- Fetch rendered prompt templates from DashClaw.
|
|
99
100
|
|
|
101
|
+
### Learning Loop
|
|
102
|
+
|
|
103
|
+
The guard response now includes a `learning` field when DashClaw has historical data for the agent and action type. This creates a closed learning loop: outcomes feed back into guard decisions automatically.
|
|
104
|
+
|
|
105
|
+
```javascript
|
|
106
|
+
// Guard response includes learning context
|
|
107
|
+
const res = await claw.guard({ action_type: 'deploy' });
|
|
108
|
+
console.log(res.learning);
|
|
109
|
+
// {
|
|
110
|
+
// recent_score_avg: 82,
|
|
111
|
+
// baseline_score_avg: 75,
|
|
112
|
+
// drift_status: 'stable',
|
|
113
|
+
// patterns: ['Deploys after 5pm have 3x higher failure rate'],
|
|
114
|
+
// feedback_summary: { positive: 12, negative: 2 }
|
|
115
|
+
// }
|
|
116
|
+
|
|
117
|
+
// Fetch consolidated lessons for an action type
|
|
118
|
+
const { lessons, drift_warnings } = await claw.getLessons({ actionType: 'deploy' });
|
|
119
|
+
lessons.forEach(l => console.log(l.guidance));
|
|
120
|
+
// Each lesson includes: action_type, confidence, success_rate,
|
|
121
|
+
// hints (risk_cap, prefer_reversible, confidence_floor, expected_duration, expected_cost),
|
|
122
|
+
// guidance, sample_size
|
|
123
|
+
```
|
|
124
|
+
|
|
100
125
|
### Scoring Profiles
|
|
101
126
|
- `createScorer(name, type, config)` -- Define automated evaluations.
|
|
102
127
|
- `createScoringProfile(profile)` -- Create a weighted multi-dimensional scoring profile.
|
|
@@ -251,7 +276,7 @@ Then merge the hooks block from `hooks/settings.json` into your `.claude/setting
|
|
|
251
276
|
|
|
252
277
|
## Legacy SDK (v1)
|
|
253
278
|
|
|
254
|
-
The v2 SDK covers the
|
|
279
|
+
The v2 SDK covers the 45 methods most critical to agent governance. If you require the full platform surface (188+ methods including Calendar, Workflows, Routing, Pairing, etc.), the v1 SDK is available via the `dashclaw/legacy` sub-path in Node.js or via the full client in Python.
|
|
255
280
|
|
|
256
281
|
```javascript
|
|
257
282
|
// v1 legacy import
|
package/dashclaw.js
CHANGED
|
@@ -281,6 +281,17 @@ class DashClaw {
|
|
|
281
281
|
});
|
|
282
282
|
}
|
|
283
283
|
|
|
284
|
+
/**
|
|
285
|
+
* GET /api/learning/lessons — Fetch consolidated lessons from scored outcomes.
|
|
286
|
+
*/
|
|
287
|
+
async getLessons({ actionType, limit } = {}) {
|
|
288
|
+
return this._request('/api/learning/lessons', 'GET', null, {
|
|
289
|
+
agent_id: this.agentId,
|
|
290
|
+
...(actionType && { action_type: actionType }),
|
|
291
|
+
...(limit && { limit }),
|
|
292
|
+
});
|
|
293
|
+
}
|
|
294
|
+
|
|
284
295
|
/**
|
|
285
296
|
* POST /api/prompts/render
|
|
286
297
|
*/
|
|
@@ -432,7 +443,7 @@ class DashClaw {
|
|
|
432
443
|
/**
|
|
433
444
|
* POST /api/messages — Send a message to another agent or the dashboard.
|
|
434
445
|
*/
|
|
435
|
-
async sendMessage({ to, type, subject, body, threadId, urgent }) {
|
|
446
|
+
async sendMessage({ to, type, subject, body, threadId, urgent, actionId }) {
|
|
436
447
|
return this._request('/api/messages', 'POST', {
|
|
437
448
|
from_agent_id: this.agentId,
|
|
438
449
|
to_agent_id: to,
|
|
@@ -441,6 +452,7 @@ class DashClaw {
|
|
|
441
452
|
body,
|
|
442
453
|
thread_id: threadId,
|
|
443
454
|
urgent,
|
|
455
|
+
action_id: actionId,
|
|
444
456
|
});
|
|
445
457
|
}
|
|
446
458
|
|