dashclaw 1.9.4 → 2.0.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.
Files changed (3) hide show
  1. package/README.md +264 -2
  2. package/dashclaw.js +483 -2
  3. package/package.json +7 -4
package/README.md CHANGED
@@ -2,9 +2,9 @@
2
2
 
3
3
  Full reference for the DashClaw SDK (Node.js). For Python, see the [Python SDK docs](../sdk-python/README.md).
4
4
 
5
- DashClaw treats every agent action as a governed decision. The SDK provides decision recording, policy enforcement, assumption tracking, and compliance mapping. It proves what your agents decided and why.
5
+ DashClaw treats every agent action as a governed decision. The SDK provides decision recording, policy enforcement, evaluation, and compliance mapping. It proves what your agents decided and why.
6
6
 
7
- Install, configure, and govern your AI agents with 95+ methods across 21+ categories including action recording, behavior guard, context management, session handoffs, security scanning, agent messaging, agent pairing, identity binding, organization management, webhooks, policy testing, compliance, task routing, and more.
7
+ Install, configure, and govern your AI agents with 178+ methods across 30+ categories including action recording, behavior guard, evaluation framework, scoring profiles, learning analytics, prompt management, feedback loops, behavioral drift, compliance exports, and more. Native adapters for **OpenClaw**, **CrewAI**, **AutoGen**, and **LangChain**.
8
8
 
9
9
  ---
10
10
 
@@ -314,6 +314,268 @@ Get root-cause trace for an action, including its assumptions, open loops, paren
314
314
 
315
315
  ---
316
316
 
317
+ ## Evaluation Framework
318
+
319
+ Track output quality automatically with 5 built-in scorer types. No LLM required for most scorers.
320
+
321
+ ### claw.createScorer({ name, scorerType, config, description })
322
+ Create a new evaluation scorer.
323
+
324
+ **Parameters:**
325
+ | Parameter | Type | Required | Description |
326
+ |-----------|------|----------|-------------|
327
+ | name | string | Yes | Scorer name |
328
+ | scorerType | string | Yes | regex, keywords, numeric_range, custom_function, or llm_judge |
329
+ | config | Object | Yes | Configuration for the scorer |
330
+ | description | string | No | Purpose of this scorer |
331
+
332
+ **Returns:** `Promise<Object>`
333
+
334
+ **Example:**
335
+ ```javascript
336
+ await claw.createScorer({
337
+ name: 'JSON Validator',
338
+ scorerType: 'regex',
339
+ config: { pattern: '^\\{.*\\}$' },
340
+ });
341
+ ```
342
+
343
+ ### claw.getScorers()
344
+ List all available scorers.
345
+
346
+ **Returns:** `Promise<{ scorers: Object[], llm_available: boolean }>`
347
+
348
+ ### claw.getEvalRuns(filters?)
349
+ List evaluation runs with status and result summaries.
350
+
351
+ **Parameters:**
352
+ | Parameter | Type | Required | Description |
353
+ |-----------|------|----------|-------------|
354
+ | status | string | No | running, completed, failed |
355
+ | limit | number | No | Max results |
356
+
357
+ **Returns:** `Promise<{ runs: Object[] }>`
358
+
359
+ ### claw.getEvalStats(filters?)
360
+ Get aggregate evaluation statistics across scorers and agents.
361
+
362
+ **Parameters:**
363
+ | Parameter | Type | Required | Description |
364
+ |-----------|------|----------|-------------|
365
+ | agent_id | string | No | Filter by agent |
366
+ | scorer_name | string | No | Filter by scorer |
367
+ | days | number | No | Lookback period |
368
+
369
+ **Returns:** `Promise<Object>`
370
+
371
+ ---
372
+
373
+ ## Prompt Management
374
+
375
+ Version-controlled prompt templates with mustache variable rendering.
376
+
377
+ ### claw.createPromptTemplate({ name, content, category })
378
+ Create a new prompt template.
379
+
380
+ **Parameters:**
381
+ | Parameter | Type | Required | Description |
382
+ |-----------|------|----------|-------------|
383
+ | name | string | Yes | Template name |
384
+ | content | string | Yes | Template content with {{variables}} |
385
+ | category | string | No | Optional grouping category |
386
+
387
+ **Returns:** `Promise<Object>`
388
+
389
+ ### claw.getPromptTemplate(templateId)
390
+ Get a template by ID, including its current active version.
391
+
392
+ **Returns:** `Promise<Object>`
393
+
394
+ ### claw.renderPrompt({ template_id, variables, action_id })
395
+ Render a template with variables on the server. Optionally link to an action for usage tracking.
396
+
397
+ **Parameters:**
398
+ | Parameter | Type | Required | Description |
399
+ |-----------|------|----------|-------------|
400
+ | template_id | string | Yes | Template ID |
401
+ | variables | Object | Yes | Mustache variables |
402
+ | action_id | string | No | Link to an action |
403
+
404
+ **Returns:** `Promise<{ rendered: string }>`
405
+
406
+ ### claw.listPromptVersions(templateId)
407
+ List all versions of a prompt template.
408
+
409
+ **Returns:** `Promise<Object[]>`
410
+
411
+ ### claw.activatePromptVersion(templateId, versionId)
412
+ Set a specific version as the active one for a template.
413
+
414
+ **Returns:** `Promise<Object>`
415
+
416
+ ---
417
+
418
+ ## User Feedback
419
+
420
+ Collect and analyze human feedback on agent actions.
421
+
422
+ ### claw.submitFeedback({ action_id, agent_id, rating, comment, category, tags })
423
+ Submit feedback for a specific action.
424
+
425
+ **Parameters:**
426
+ | Parameter | Type | Required | Description |
427
+ |-----------|------|----------|-------------|
428
+ | action_id | string | Yes | Action ID |
429
+ | agent_id | string | No | Agent ID |
430
+ | rating | number | Yes | Rating 1-5 |
431
+ | comment | string | No | Optional text feedback |
432
+ | category | string | No | Optional category |
433
+ | tags | string[] | No | Optional tags |
434
+
435
+ **Returns:** `Promise<Object>`
436
+
437
+ ### claw.getFeedback(feedbackId)
438
+ Retrieve a single feedback entry.
439
+
440
+ **Returns:** `Promise<Object>`
441
+
442
+ ### claw.getFeedbackStats({ agent_id })
443
+ Get feedback statistics, including average rating and sentiment trends.
444
+
445
+ **Returns:** `Promise<Object>`
446
+
447
+ ---
448
+
449
+ ## Behavioral Drift
450
+
451
+ Monitor agent behavior deviations from statistical baselines using z-scores.
452
+
453
+ ### claw.computeDriftBaselines({ agent_id, lookback_days })
454
+ Establish statistical baselines for an agent's behavior metrics.
455
+
456
+ **Returns:** `Promise<Object>`
457
+
458
+ ### claw.detectDrift({ agent_id, window_days })
459
+ Run drift detection against the established baselines.
460
+
461
+ **Returns:** `Promise<Object>`
462
+
463
+ ### claw.listDriftAlerts(filters?)
464
+ List behavioral drift alerts with severity and status.
465
+
466
+ **Returns:** `Promise<Object[]>`
467
+
468
+ ---
469
+
470
+ ## Compliance Exports
471
+
472
+ Generate evidence packages for SOC 2, NIST AI RMF, EU AI Act, and ISO 42001.
473
+
474
+ ### claw.createComplianceExport({ name, frameworks, format, window_days })
475
+ Generate a compliance export bundle.
476
+
477
+ **Returns:** `Promise<Object>`
478
+
479
+ ### claw.getComplianceExport(exportId)
480
+ Get the status and details of a compliance export.
481
+
482
+ **Returns:** `Promise<Object>`
483
+
484
+ ### claw.listComplianceExports({ limit })
485
+ List recent compliance exports.
486
+
487
+ **Returns:** `Promise<Object[]>`
488
+
489
+ ---
490
+
491
+ ## Learning Analytics
492
+
493
+ Track agent improvement velocity, maturity levels, and learning curves per skill.
494
+
495
+ ### claw.getLearningVelocity({ agent_id })
496
+ Get agent improvement rate over time.
497
+
498
+ **Returns:** `Promise<Object>`
499
+
500
+ ### claw.getMaturityLevels()
501
+ Get the 6-level maturity model distribution for the agent.
502
+
503
+ **Returns:** `Promise<Object>`
504
+
505
+ ### claw.getLearningCurves({ agent_id, action_type })
506
+ Get performance improvement curves for a specific skill/action type.
507
+
508
+ **Returns:** `Promise<Object>`
509
+
510
+ ---
511
+
512
+ ## Scoring Profiles
513
+
514
+ User-defined weighted quality scoring with 3 composite methods, 8 data sources, risk templates, and auto-calibration. Zero LLM required.
515
+
516
+ ### claw.createScoringProfile({ name, action_type, composite_method, dimensions })
517
+ Create a scoring profile with optional inline dimensions.
518
+
519
+ **Parameters:**
520
+ | Parameter | Type | Required | Description |
521
+ |-----------|------|----------|-------------|
522
+ | name | string | Yes | Profile name |
523
+ | action_type | string | No | Filter to specific action type (null = all) |
524
+ | composite_method | string | No | weighted_average (default), minimum, or geometric_mean |
525
+ | dimensions | Array | No | Inline dimension definitions (name, data_source, weight, scale) |
526
+
527
+ **Returns:** `Promise<Object>`
528
+
529
+ **Example:**
530
+ ```javascript
531
+ const profile = await dc.createScoringProfile({
532
+ name: 'deploy-quality',
533
+ action_type: 'deploy',
534
+ composite_method: 'weighted_average',
535
+ dimensions: [
536
+ { name: 'Speed', data_source: 'duration_ms', weight: 0.3,
537
+ scale: [
538
+ { label: 'excellent', operator: 'lt', value: 30000, score: 100 },
539
+ { label: 'good', operator: 'lt', value: 60000, score: 75 },
540
+ { label: 'poor', operator: 'gte', value: 60000, score: 20 },
541
+ ]},
542
+ { name: 'Reliability', data_source: 'confidence', weight: 0.7,
543
+ scale: [
544
+ { label: 'excellent', operator: 'gte', value: 0.9, score: 100 },
545
+ { label: 'poor', operator: 'lt', value: 0.7, score: 25 },
546
+ ]},
547
+ ],
548
+ });
549
+ ```
550
+
551
+ ### claw.scoreWithProfile(profile_id, action)
552
+ Score a single action against a profile. Returns composite score + per-dimension breakdown.
553
+
554
+ **Parameters:**
555
+ | Parameter | Type | Required | Description |
556
+ |-----------|------|----------|-------------|
557
+ | profile_id | string | Yes | Profile to score against |
558
+ | action | Object | Yes | Action data object |
559
+
560
+ **Returns:** `Promise<Object>`
561
+
562
+ ### claw.batchScoreWithProfile(profile_id, actions)
563
+ Score multiple actions at once. Returns per-action results + summary.
564
+
565
+ **Returns:** `Promise<Object>`
566
+
567
+ ### claw.createRiskTemplate({ name, base_risk, rules })
568
+ Create a rule-based risk template. Replaces hardcoded agent risk numbers.
569
+
570
+ **Returns:** `Promise<Object>`
571
+
572
+ ### claw.autoCalibrate({ action_type, lookback_days })
573
+ Analyze historical action data to suggest scoring thresholds from percentile distribution.
574
+
575
+ **Returns:** `Promise<Object>`
576
+
577
+ ---
578
+
317
579
  ## Agent Presence & Health
318
580
 
319
581
  Monitor agent uptime and status in real-time. Use heartbeats to detect when an agent crashes or loses network connectivity.
package/dashclaw.js CHANGED
@@ -3,7 +3,7 @@
3
3
  * Full-featured agent toolkit for the DashClaw platform.
4
4
  * Zero-dependency ESM SDK. Requires Node 18+ (native fetch).
5
5
  *
6
- * 96+ methods across 22+ categories:
6
+ * 178+ methods across 30+ categories:
7
7
  * - Action Recording (7)
8
8
  * - Loops & Assumptions (7)
9
9
  * - Signals (1)
@@ -26,6 +26,14 @@
26
26
  * - Compliance Engine (5)
27
27
  * - Task Routing (10)
28
28
  * - Real-Time Events (1)
29
+ * - Evaluations (12)
30
+ * - Scorer Management (8)
31
+ * - Eval Runs (6)
32
+ * - Scoring Profiles (17)
33
+ * - Learning Analytics (6)
34
+ * - Behavioral Drift (9)
35
+ * - Prompt Management (12)
36
+ * - Feedback Loops (10)
29
37
  */
30
38
 
31
39
  class DashClaw {
@@ -112,7 +120,27 @@ class DashClaw {
112
120
  }
113
121
  }
114
122
 
115
- async _request(path, method, body) {
123
+ async _request(pathOrMethod, methodOrPath, body, params) {
124
+ let path, method;
125
+ if (typeof pathOrMethod === 'string' && pathOrMethod.startsWith('/')) {
126
+ path = pathOrMethod;
127
+ method = methodOrPath || 'GET';
128
+ } else {
129
+ method = pathOrMethod;
130
+ path = methodOrPath;
131
+ }
132
+
133
+ if (params) {
134
+ const qs = new URLSearchParams();
135
+ for (const [k, v] of Object.entries(params)) {
136
+ if (v !== undefined && v !== null) qs.append(k, String(v));
137
+ }
138
+ const qsStr = qs.toString();
139
+ if (qsStr) {
140
+ path += (path.includes('?') ? '&' : '?') + qsStr;
141
+ }
142
+ }
143
+
116
144
  const url = `${this.baseUrl}${path}`;
117
145
  const headers = {
118
146
  'Content-Type': 'application/json',
@@ -2277,6 +2305,459 @@ class DashClaw {
2277
2305
  ...state,
2278
2306
  });
2279
2307
  }
2308
+
2309
+ // ----------------------------------------------
2310
+ // Category: Evaluations
2311
+ // ----------------------------------------------
2312
+
2313
+ /**
2314
+ * Create an evaluation score for an action.
2315
+ * @param {Object} params
2316
+ * @param {string} params.actionId - Action record ID
2317
+ * @param {string} params.scorerName - Name of the scorer
2318
+ * @param {number} params.score - Score between 0.0 and 1.0
2319
+ * @param {string} [params.label] - Category label (e.g., 'correct', 'incorrect')
2320
+ * @param {string} [params.reasoning] - Explanation of the score
2321
+ * @param {string} [params.evaluatedBy] - 'auto', 'human', or 'llm_judge'
2322
+ * @param {Object} [params.metadata] - Additional metadata
2323
+ * @returns {Promise<Object>}
2324
+ */
2325
+ async createScore({ actionId, scorerName, score, label, reasoning, evaluatedBy, metadata }) {
2326
+ return this._request('/api/evaluations', 'POST', {
2327
+ action_id: actionId,
2328
+ scorer_name: scorerName,
2329
+ score,
2330
+ label,
2331
+ reasoning,
2332
+ evaluated_by: evaluatedBy,
2333
+ metadata,
2334
+ });
2335
+ }
2336
+
2337
+ /**
2338
+ * List evaluation scores with optional filters.
2339
+ * @param {Object} [filters] - { action_id, scorer_name, evaluated_by, min_score, max_score, limit, offset, agent_id }
2340
+ * @returns {Promise<{ scores: Object[], total: number }>}
2341
+ */
2342
+ async getScores(filters = {}) {
2343
+ const params = new URLSearchParams();
2344
+ for (const [key, value] of Object.entries(filters)) {
2345
+ if (value !== undefined && value !== null && value !== '') {
2346
+ params.set(key, String(value));
2347
+ }
2348
+ }
2349
+ return this._request(`/api/evaluations?${params}`, 'GET');
2350
+ }
2351
+
2352
+ /**
2353
+ * Create a reusable scorer definition.
2354
+ * @param {Object} params
2355
+ * @param {string} params.name - Scorer name (unique per org)
2356
+ * @param {string} params.scorerType - 'regex', 'contains', 'numeric_range', 'custom_function', or 'llm_judge'
2357
+ * @param {Object} params.config - Scorer configuration
2358
+ * @param {string} [params.description] - Description
2359
+ * @returns {Promise<Object>}
2360
+ */
2361
+ async createScorer({ name, scorerType, config, description }) {
2362
+ return this._request('/api/evaluations/scorers', 'POST', {
2363
+ name,
2364
+ scorer_type: scorerType,
2365
+ config,
2366
+ description,
2367
+ });
2368
+ }
2369
+
2370
+ /**
2371
+ * List all scorers for this org.
2372
+ * @returns {Promise<{ scorers: Object[], llm_available: boolean }>}
2373
+ */
2374
+ async getScorers() {
2375
+ return this._request('/api/evaluations/scorers', 'GET');
2376
+ }
2377
+
2378
+ /**
2379
+ * Update a scorer.
2380
+ * @param {string} scorerId
2381
+ * @param {Object} updates - { name?, description?, config? }
2382
+ * @returns {Promise<Object>}
2383
+ */
2384
+ async updateScorer(scorerId, updates) {
2385
+ return this._request(`/api/evaluations/scorers/${scorerId}`, 'PATCH', updates);
2386
+ }
2387
+
2388
+ /**
2389
+ * Delete a scorer.
2390
+ * @param {string} scorerId
2391
+ * @returns {Promise<Object>}
2392
+ */
2393
+ async deleteScorer(scorerId) {
2394
+ return this._request(`/api/evaluations/scorers/${scorerId}`, 'DELETE');
2395
+ }
2396
+
2397
+ /**
2398
+ * Create and start an evaluation run.
2399
+ * @param {Object} params
2400
+ * @param {string} params.name - Run name
2401
+ * @param {string} params.scorerId - Scorer to use
2402
+ * @param {Object} [params.actionFilters] - Filters for which actions to evaluate
2403
+ * @returns {Promise<Object>}
2404
+ */
2405
+ async createEvalRun({ name, scorerId, actionFilters }) {
2406
+ return this._request('/api/evaluations/runs', 'POST', {
2407
+ name,
2408
+ scorer_id: scorerId,
2409
+ action_filters: actionFilters,
2410
+ });
2411
+ }
2412
+
2413
+ /**
2414
+ * List evaluation runs.
2415
+ * @param {Object} [filters] - { status, limit, offset }
2416
+ * @returns {Promise<{ runs: Object[] }>}
2417
+ */
2418
+ async getEvalRuns(filters = {}) {
2419
+ const params = new URLSearchParams();
2420
+ for (const [key, value] of Object.entries(filters)) {
2421
+ if (value !== undefined && value !== null && value !== '') {
2422
+ params.set(key, String(value));
2423
+ }
2424
+ }
2425
+ return this._request(`/api/evaluations/runs?${params}`, 'GET');
2426
+ }
2427
+
2428
+ /**
2429
+ * Get details of an evaluation run.
2430
+ * @param {string} runId
2431
+ * @returns {Promise<{ run: Object, distribution: Object[] }>}
2432
+ */
2433
+ async getEvalRun(runId) {
2434
+ return this._request(`/api/evaluations/runs/${runId}`, 'GET');
2435
+ }
2436
+
2437
+ /**
2438
+ * Get aggregate evaluation statistics.
2439
+ * @param {Object} [filters] - { agent_id, scorer_name, days }
2440
+ * @returns {Promise<Object>}
2441
+ */
2442
+ async getEvalStats(filters = {}) {
2443
+ const params = new URLSearchParams();
2444
+ for (const [key, value] of Object.entries(filters)) {
2445
+ if (value !== undefined && value !== null && value !== '') {
2446
+ params.set(key, String(value));
2447
+ }
2448
+ }
2449
+ return this._request(`/api/evaluations/stats?${params}`, 'GET');
2450
+ }
2451
+
2452
+ // -----------------------------------------------
2453
+ // Prompt Management
2454
+ // -----------------------------------------------
2455
+
2456
+ async listPromptTemplates({ category } = {}) {
2457
+ const params = category ? `?category=${encodeURIComponent(category)}` : '';
2458
+ return this._request(`/api/prompts/templates${params}`, 'GET');
2459
+ }
2460
+
2461
+ async createPromptTemplate({ name, description, category }) {
2462
+ return this._request('/api/prompts/templates', 'POST', { name, description, category });
2463
+ }
2464
+
2465
+ async getPromptTemplate(templateId) {
2466
+ return this._request(`/api/prompts/templates/${templateId}`, 'GET');
2467
+ }
2468
+
2469
+ async updatePromptTemplate(templateId, fields) {
2470
+ return this._request(`/api/prompts/templates/${templateId}`, 'PATCH', fields);
2471
+ }
2472
+
2473
+ async deletePromptTemplate(templateId) {
2474
+ return this._request(`/api/prompts/templates/${templateId}`, 'DELETE');
2475
+ }
2476
+
2477
+ async listPromptVersions(templateId) {
2478
+ return this._request(`/api/prompts/templates/${templateId}/versions`, 'GET');
2479
+ }
2480
+
2481
+ async createPromptVersion(templateId, { content, model_hint, parameters, changelog }) {
2482
+ return this._request(`/api/prompts/templates/${templateId}/versions`, 'POST', { content, model_hint, parameters, changelog });
2483
+ }
2484
+
2485
+ async getPromptVersion(templateId, versionId) {
2486
+ return this._request(`/api/prompts/templates/${templateId}/versions/${versionId}`, 'GET');
2487
+ }
2488
+
2489
+ async activatePromptVersion(templateId, versionId) {
2490
+ return this._request(`/api/prompts/templates/${templateId}/versions/${versionId}`, 'POST');
2491
+ }
2492
+
2493
+ async renderPrompt({ template_id, version_id, variables, action_id, agent_id, record }) {
2494
+ return this._request('/api/prompts/render', 'POST', { template_id, version_id, variables, action_id, agent_id, record });
2495
+ }
2496
+
2497
+ async listPromptRuns({ template_id, version_id, limit } = {}) {
2498
+ const params = new URLSearchParams();
2499
+ if (template_id) params.set('template_id', template_id);
2500
+ if (version_id) params.set('version_id', version_id);
2501
+ if (limit) params.set('limit', String(limit));
2502
+ const qs = params.toString() ? `?${params.toString()}` : '';
2503
+ return this._request(`/api/prompts/runs${qs}`, 'GET');
2504
+ }
2505
+
2506
+ async getPromptStats({ template_id } = {}) {
2507
+ const params = template_id ? `?template_id=${encodeURIComponent(template_id)}` : '';
2508
+ return this._request(`/api/prompts/stats${params}`, 'GET');
2509
+ }
2510
+
2511
+ // -----------------------------------------------
2512
+ // User Feedback
2513
+ // -----------------------------------------------
2514
+
2515
+ async submitFeedback({ action_id, agent_id, rating, comment, category, tags, metadata }) {
2516
+ return this._request('/api/feedback', 'POST', { action_id, agent_id, rating, comment, category, tags, metadata, source: 'sdk' });
2517
+ }
2518
+
2519
+ async listFeedback({ action_id, agent_id, category, sentiment, resolved, limit, offset } = {}) {
2520
+ const params = new URLSearchParams();
2521
+ if (action_id) params.set('action_id', action_id);
2522
+ if (agent_id) params.set('agent_id', agent_id);
2523
+ if (category) params.set('category', category);
2524
+ if (sentiment) params.set('sentiment', sentiment);
2525
+ if (resolved !== undefined) params.set('resolved', String(resolved));
2526
+ if (limit) params.set('limit', String(limit));
2527
+ if (offset) params.set('offset', String(offset));
2528
+ const qs = params.toString() ? `?${params.toString()}` : '';
2529
+ return this._request(`/api/feedback${qs}`, 'GET');
2530
+ }
2531
+
2532
+ async getFeedback(feedbackId) {
2533
+ return this._request(`/api/feedback/${feedbackId}`, 'GET');
2534
+ }
2535
+
2536
+ async resolveFeedback(feedbackId) {
2537
+ return this._request(`/api/feedback/${feedbackId}`, 'PATCH', { resolved_by: 'sdk' });
2538
+ }
2539
+
2540
+ async deleteFeedback(feedbackId) {
2541
+ return this._request(`/api/feedback/${feedbackId}`, 'DELETE');
2542
+ }
2543
+
2544
+ async getFeedbackStats({ agent_id } = {}) {
2545
+ const params = agent_id ? `?agent_id=${encodeURIComponent(agent_id)}` : '';
2546
+ return this._request(`/api/feedback/stats${params}`, 'GET');
2547
+ }
2548
+
2549
+ // -----------------------------------------------
2550
+ // Compliance Export
2551
+ // -----------------------------------------------
2552
+
2553
+ async createComplianceExport({ name, frameworks, format, window_days, include_evidence, include_remediation, include_trends }) {
2554
+ return this._request('/api/compliance/exports', 'POST', { name, frameworks, format, window_days, include_evidence, include_remediation, include_trends });
2555
+ }
2556
+
2557
+ async listComplianceExports({ limit } = {}) {
2558
+ const params = limit ? `?limit=${limit}` : '';
2559
+ return this._request(`/api/compliance/exports${params}`, 'GET');
2560
+ }
2561
+
2562
+ async getComplianceExport(exportId) {
2563
+ return this._request(`/api/compliance/exports/${exportId}`, 'GET');
2564
+ }
2565
+
2566
+ async downloadComplianceExport(exportId) {
2567
+ return this._request(`/api/compliance/exports/${exportId}/download`, 'GET');
2568
+ }
2569
+
2570
+ async deleteComplianceExport(exportId) {
2571
+ return this._request(`/api/compliance/exports/${exportId}`, 'DELETE');
2572
+ }
2573
+
2574
+ async createComplianceSchedule({ name, frameworks, format, window_days, cron_expression, include_evidence, include_remediation, include_trends }) {
2575
+ return this._request('/api/compliance/schedules', 'POST', { name, frameworks, format, window_days, cron_expression, include_evidence, include_remediation, include_trends });
2576
+ }
2577
+
2578
+ async listComplianceSchedules() {
2579
+ return this._request('/api/compliance/schedules', 'GET');
2580
+ }
2581
+
2582
+ async updateComplianceSchedule(scheduleId, fields) {
2583
+ return this._request(`/api/compliance/schedules/${scheduleId}`, 'PATCH', fields);
2584
+ }
2585
+
2586
+ async deleteComplianceSchedule(scheduleId) {
2587
+ return this._request(`/api/compliance/schedules/${scheduleId}`, 'DELETE');
2588
+ }
2589
+
2590
+ async getComplianceTrends({ framework, limit } = {}) {
2591
+ const params = new URLSearchParams();
2592
+ if (framework) params.set('framework', framework);
2593
+ if (limit) params.set('limit', String(limit));
2594
+ const qs = params.toString() ? `?${params.toString()}` : '';
2595
+ return this._request(`/api/compliance/trends${qs}`, 'GET');
2596
+ }
2597
+
2598
+ // -----------------------------------------------
2599
+ // Drift Detection
2600
+ // -----------------------------------------------
2601
+
2602
+ async computeDriftBaselines({ agent_id, lookback_days } = {}) {
2603
+ return this._request('/api/drift/alerts', 'POST', { action: 'compute_baselines', agent_id, lookback_days });
2604
+ }
2605
+
2606
+ async detectDrift({ agent_id, window_days } = {}) {
2607
+ return this._request('/api/drift/alerts', 'POST', { action: 'detect', agent_id, window_days });
2608
+ }
2609
+
2610
+ async recordDriftSnapshots() {
2611
+ return this._request('/api/drift/alerts', 'POST', { action: 'record_snapshots' });
2612
+ }
2613
+
2614
+ async listDriftAlerts({ agent_id, severity, acknowledged, limit } = {}) {
2615
+ const params = new URLSearchParams();
2616
+ if (agent_id) params.set('agent_id', agent_id);
2617
+ if (severity) params.set('severity', severity);
2618
+ if (acknowledged !== undefined) params.set('acknowledged', String(acknowledged));
2619
+ if (limit) params.set('limit', String(limit));
2620
+ const qs = params.toString() ? `?${params.toString()}` : '';
2621
+ return this._request(`/api/drift/alerts${qs}`, 'GET');
2622
+ }
2623
+
2624
+ async acknowledgeDriftAlert(alertId) {
2625
+ return this._request(`/api/drift/alerts/${alertId}`, 'PATCH');
2626
+ }
2627
+
2628
+ async deleteDriftAlert(alertId) {
2629
+ return this._request(`/api/drift/alerts/${alertId}`, 'DELETE');
2630
+ }
2631
+
2632
+ async getDriftStats({ agent_id } = {}) {
2633
+ const params = agent_id ? `?agent_id=${encodeURIComponent(agent_id)}` : '';
2634
+ return this._request(`/api/drift/stats${params}`, 'GET');
2635
+ }
2636
+
2637
+ async getDriftSnapshots({ agent_id, metric, limit } = {}) {
2638
+ const params = new URLSearchParams();
2639
+ if (agent_id) params.set('agent_id', agent_id);
2640
+ if (metric) params.set('metric', metric);
2641
+ if (limit) params.set('limit', String(limit));
2642
+ const qs = params.toString() ? `?${params.toString()}` : '';
2643
+ return this._request(`/api/drift/snapshots${qs}`, 'GET');
2644
+ }
2645
+
2646
+ async getDriftMetrics() {
2647
+ return this._request('/api/drift/metrics', 'GET');
2648
+ }
2649
+
2650
+ // -----------------------------------------------
2651
+ // Learning Analytics
2652
+ // -----------------------------------------------
2653
+
2654
+ async computeLearningVelocity({ agent_id, lookback_days, period } = {}) {
2655
+ return this._request('/api/learning/analytics/velocity', 'POST', { agent_id, lookback_days, period });
2656
+ }
2657
+
2658
+ async getLearningVelocity({ agent_id, limit } = {}) {
2659
+ const params = new URLSearchParams();
2660
+ if (agent_id) params.set('agent_id', agent_id);
2661
+ if (limit) params.set('limit', String(limit));
2662
+ const qs = params.toString() ? `?${params.toString()}` : '';
2663
+ return this._request(`/api/learning/analytics/velocity${qs}`, 'GET');
2664
+ }
2665
+
2666
+ async computeLearningCurves({ agent_id, lookback_days } = {}) {
2667
+ return this._request('/api/learning/analytics/curves', 'POST', { agent_id, lookback_days });
2668
+ }
2669
+
2670
+ async getLearningCurves({ agent_id, action_type, limit } = {}) {
2671
+ const params = new URLSearchParams();
2672
+ if (agent_id) params.set('agent_id', agent_id);
2673
+ if (action_type) params.set('action_type', action_type);
2674
+ if (limit) params.set('limit', String(limit));
2675
+ const qs = params.toString() ? `?${params.toString()}` : '';
2676
+ return this._request(`/api/learning/analytics/curves${qs}`, 'GET');
2677
+ }
2678
+
2679
+ async getLearningAnalyticsSummary({ agent_id } = {}) {
2680
+ const params = agent_id ? `?agent_id=${encodeURIComponent(agent_id)}` : '';
2681
+ return this._request(`/api/learning/analytics/summary${params}`, 'GET');
2682
+ }
2683
+
2684
+ async getMaturityLevels() {
2685
+ return this._request('/api/learning/analytics/maturity', 'GET');
2686
+ }
2687
+
2688
+ // --- Scoring Profiles -----------------------------------
2689
+
2690
+ async createScoringProfile(data) {
2691
+ return this._request('POST', '/api/scoring/profiles', data);
2692
+ }
2693
+
2694
+ async listScoringProfiles(params = {}) {
2695
+ return this._request('GET', '/api/scoring/profiles', null, params);
2696
+ }
2697
+
2698
+ async getScoringProfile(profileId) {
2699
+ return this._request('GET', `/api/scoring/profiles/${profileId}`);
2700
+ }
2701
+
2702
+ async updateScoringProfile(profileId, data) {
2703
+ return this._request('PATCH', `/api/scoring/profiles/${profileId}`, data);
2704
+ }
2705
+
2706
+ async deleteScoringProfile(profileId) {
2707
+ return this._request('DELETE', `/api/scoring/profiles/${profileId}`);
2708
+ }
2709
+
2710
+ async addScoringDimension(profileId, data) {
2711
+ return this._request('POST', `/api/scoring/profiles/${profileId}/dimensions`, data);
2712
+ }
2713
+
2714
+ async updateScoringDimension(profileId, dimensionId, data) {
2715
+ return this._request('PATCH', `/api/scoring/profiles/${profileId}/dimensions/${dimensionId}`, data);
2716
+ }
2717
+
2718
+ async deleteScoringDimension(profileId, dimensionId) {
2719
+ return this._request('DELETE', `/api/scoring/profiles/${profileId}/dimensions/${dimensionId}`);
2720
+ }
2721
+
2722
+ async scoreWithProfile(profileId, action) {
2723
+ return this._request('POST', '/api/scoring/score', { profile_id: profileId, action });
2724
+ }
2725
+
2726
+ async batchScoreWithProfile(profileId, actions) {
2727
+ return this._request('POST', '/api/scoring/score', { profile_id: profileId, actions });
2728
+ }
2729
+
2730
+ async getProfileScores(params = {}) {
2731
+ return this._request('GET', '/api/scoring/score', null, params);
2732
+ }
2733
+
2734
+ async getProfileScoreStats(profileId) {
2735
+ return this._request('GET', '/api/scoring/score', null, { profile_id: profileId, view: 'stats' });
2736
+ }
2737
+
2738
+ // --- Risk Templates ------------------------------------
2739
+
2740
+ async createRiskTemplate(data) {
2741
+ return this._request('POST', '/api/scoring/risk-templates', data);
2742
+ }
2743
+
2744
+ async listRiskTemplates(params = {}) {
2745
+ return this._request('GET', '/api/scoring/risk-templates', null, params);
2746
+ }
2747
+
2748
+ async updateRiskTemplate(templateId, data) {
2749
+ return this._request('PATCH', `/api/scoring/risk-templates/${templateId}`, data);
2750
+ }
2751
+
2752
+ async deleteRiskTemplate(templateId) {
2753
+ return this._request('DELETE', `/api/scoring/risk-templates/${templateId}`);
2754
+ }
2755
+
2756
+ // --- Auto-Calibration ----------------------------------
2757
+
2758
+ async autoCalibrate(options = {}) {
2759
+ return this._request('POST', '/api/scoring/calibrate', options);
2760
+ }
2280
2761
  }
2281
2762
 
2282
2763
  /**
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "dashclaw",
3
- "version": "1.9.4",
4
- "description": "Full-featured agent toolkit for the DashClaw platform. 96+ methods across 22+ categories for action recording, context management, session handoffs, security scanning, behavior guard, compliance, task routing, identity binding, organization management, webhooks, bulk sync, and more.",
3
+ "version": "2.0.1",
4
+ "description": "Full-featured agent toolkit for the DashClaw platform. 178+ methods across 30+ categories for governance and orchestration.",
5
5
  "type": "module",
6
6
  "publishConfig": {
7
7
  "access": "public"
@@ -25,7 +25,6 @@
25
25
  "decision-infrastructure",
26
26
  "agent-toolkit",
27
27
  "dashclaw",
28
- "dashclaw",
29
28
  "action-recording",
30
29
  "context-management",
31
30
  "security-scanning"
@@ -39,5 +38,9 @@
39
38
  },
40
39
  "engines": {
41
40
  "node": ">=18.0.0"
42
- }
41
+ },
42
+ "dependencies": {},
43
+ "devDependencies": {},
44
+ "scripts": {},
45
+ "sideEffects": false
43
46
  }