dashclaw 1.2.0 → 1.2.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/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2026 OpenClaw
3
+ Copyright (c) 2026 DashClaw
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
package/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Full-featured agent toolkit for the [DashClaw](https://github.com/ucsandman/DashClaw) platform. Zero dependencies, requires Node 18+ (native fetch).
4
4
 
5
- **57 methods** across 13 categories: action recording, context management, session handoffs, security scanning, agent messaging, behavior guard, user preferences, and more.
5
+ **58 methods** across 13 categories: action recording, context management, session handoffs, security scanning, agent messaging, behavior guard, user preferences, and more.
6
6
 
7
7
  ## Install
8
8
 
@@ -52,7 +52,7 @@ import { DashClaw } from 'dashclaw';
52
52
  import { OpenClawAgent } from 'dashclaw';
53
53
  ```
54
54
 
55
- ## API Reference (54 methods)
55
+ ## API Reference (58 methods)
56
56
 
57
57
  ### Action Recording (6)
58
58
 
@@ -83,7 +83,7 @@ import { OpenClawAgent } from 'dashclaw';
83
83
  |--------|-------------|
84
84
  | `getSignals()` | Get computed risk signals |
85
85
 
86
- ### Dashboard Data (8)
86
+ ### Dashboard Data (9)
87
87
 
88
88
  | Method | Description |
89
89
  |--------|-------------|
@@ -95,6 +95,7 @@ import { OpenClawAgent } from 'dashclaw';
95
95
  | `createCalendarEvent(event)` | Create a calendar event |
96
96
  | `recordIdea(idea)` | Record an idea/inspiration |
97
97
  | `reportMemoryHealth(report)` | Report memory health snapshot |
98
+ | `reportTokenUsage(usage)` | Report token usage (legacy) |
98
99
 
99
100
  ### Session Handoffs (3)
100
101
 
@@ -163,6 +164,19 @@ import { OpenClawAgent } from 'dashclaw';
163
164
  | `resolveMessageThread(threadId, summary?)` | Close a thread |
164
165
  | `saveSharedDoc(params)` | Create/update shared document |
165
166
 
167
+ ### Behavior Guard (2)
168
+
169
+ | Method | Description |
170
+ |--------|-------------|
171
+ | `guard(context, options?)` | Check policies before action |
172
+ | `getGuardDecisions(filters?)` | List recent decisions |
173
+
174
+ ### Bulk Sync (1)
175
+
176
+ | Method | Description |
177
+ |--------|-------------|
178
+ | `syncState(state)` | Sync multiple categories in one request |
179
+
166
180
  ## Authentication
167
181
 
168
182
  The SDK sends your API key via the `x-api-key` header. The key determines which organization's data you access.
package/dashclaw.js CHANGED
@@ -3,11 +3,11 @@
3
3
  * Full-featured agent toolkit for the DashClaw platform.
4
4
  * Zero-dependency ESM SDK — requires Node 18+ (native fetch).
5
5
  *
6
- * 57 methods across 13 categories:
6
+ * 58 methods across 13 categories:
7
7
  * - Action Recording (6)
8
8
  * - Loops & Assumptions (7)
9
9
  * - Signals (1)
10
- * - Dashboard Data (8)
10
+ * - Dashboard Data (9)
11
11
  * - Session Handoffs (3)
12
12
  * - Context Manager (7)
13
13
  * - Automation Snippets (4)
package/index.cjs CHANGED
@@ -21,8 +21,7 @@ module.exports = new Proxy({}, {
21
21
 
22
22
  // Return a lazy-loading constructor wrapper
23
23
  if (prop === 'GuardBlockedError') {
24
- // Return a placeholder that resolves to the real class
25
- return class GuardBlockedErrorProxy extends Error {
24
+ const Placeholder = class GuardBlockedError extends Error {
26
25
  constructor(decision) {
27
26
  const reasons = (decision.reasons || []).join('; ') || 'no reason';
28
27
  super(`Guard blocked action: ${decision.decision}. Reasons: ${reasons}`);
@@ -34,16 +33,42 @@ module.exports = new Proxy({}, {
34
33
  this.riskScore = decision.risk_score ?? null;
35
34
  }
36
35
  };
36
+
37
+ // Support instanceof across ESM/CJS boundary
38
+ loadModule().then(m => {
39
+ if (m.GuardBlockedError) {
40
+ Object.defineProperty(Placeholder, Symbol.hasInstance, {
41
+ value: (instance) => instance && (instance.name === 'GuardBlockedError' || instance instanceof m.GuardBlockedError)
42
+ });
43
+ }
44
+ });
45
+
46
+ return Placeholder;
37
47
  }
38
48
  if (prop === 'DashClaw' || prop === 'OpenClawAgent' || prop === 'default') {
39
49
  return class DashClawProxy {
40
50
  constructor(opts) {
41
- // Store options, actual instance created async
42
51
  this._opts = opts;
43
52
  this._ready = loadModule().then(m => {
44
53
  const Cls = m.DashClaw || m.default;
45
54
  this._instance = new Cls(opts);
46
55
  });
56
+
57
+ // Return a proxy that forwards all method calls to the async instance
58
+ return new Proxy(this, {
59
+ get(target, prop) {
60
+ if (prop in target) return target[prop];
61
+ if (prop === 'then') return undefined;
62
+
63
+ return async (...args) => {
64
+ await target._ready;
65
+ if (!target._instance[prop]) {
66
+ throw new Error(`Method ${String(prop)} does not exist on DashClaw`);
67
+ }
68
+ return target._instance[prop](...args);
69
+ };
70
+ }
71
+ });
47
72
  }
48
73
 
49
74
  // For synchronous construction, use DashClaw.create()
package/package.json CHANGED
@@ -1,8 +1,11 @@
1
1
  {
2
2
  "name": "dashclaw",
3
- "version": "1.2.0",
4
- "description": "Full-featured agent toolkit for the DashClaw platform. 57 methods for action recording, context management, session handoffs, security scanning, behavior guard, bulk sync, and more.",
3
+ "version": "1.2.1",
4
+ "description": "Full-featured agent toolkit for the DashClaw platform. 58 methods for action recording, context management, session handoffs, security scanning, behavior guard, bulk sync, and more.",
5
5
  "type": "module",
6
+ "publishConfig": {
7
+ "access": "public"
8
+ },
6
9
  "main": "./index.cjs",
7
10
  "module": "./dashclaw.js",
8
11
  "exports": {