@klars/agentobs 0.1.1 → 0.1.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 +20 -0
- package/dist/commands/hook-config.js +25 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -168,6 +168,26 @@ across calls to manufacture a number.
|
|
|
168
168
|
Model prices live in `~/.agentobs/pricing.json` and are yours to edit. A model
|
|
169
169
|
missing from that file shows cost as `—`, never `$0.00`.
|
|
170
170
|
|
|
171
|
+
|
|
172
|
+
### Hook latency
|
|
173
|
+
|
|
174
|
+
The hook does its own work in **well under 1ms** (measured: ~0.3ms per
|
|
175
|
+
invocation, including the SQLite write). What you actually pay per tool call is
|
|
176
|
+
**Node.js process startup**, since Claude Code spawns the hook as a fresh
|
|
177
|
+
process each time.
|
|
178
|
+
|
|
179
|
+
On a typical Linux/macOS machine that is ~40-80ms. On Windows with real-time
|
|
180
|
+
antivirus scanning it can reach **1-1.5 seconds** - and that cost is not
|
|
181
|
+
specific to AgentObs: a bare `node -e "0"` measures the same. Check yours with:
|
|
182
|
+
|
|
183
|
+
```bash
|
|
184
|
+
node -e "0" # time this; it is the floor for any Node-based hook
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
If it is slow, adding an exclusion for your Node install directory and
|
|
188
|
+
`~/.agentobs` in your antivirus settings is the fix. There is no code change
|
|
189
|
+
that avoids it - the cost is paid before AgentObs runs at all.
|
|
190
|
+
|
|
171
191
|
---
|
|
172
192
|
|
|
173
193
|
## Dashboard access
|
|
@@ -22,7 +22,31 @@ import { existsSync } from 'node:fs';
|
|
|
22
22
|
*/
|
|
23
23
|
export function hookCommandPath() {
|
|
24
24
|
const here = dirname(fileURLToPath(import.meta.url));
|
|
25
|
-
//
|
|
25
|
+
// On Windows, prefer npm's generated .cmd shim in the global bin directory.
|
|
26
|
+
//
|
|
27
|
+
// The raw bin/agentobs-hook file has no extension, and Windows cannot
|
|
28
|
+
// execute an extensionless file - cmd.exe reports "not recognized as an
|
|
29
|
+
// internal or external command". Claude Code swallows that, so the hook
|
|
30
|
+
// silently never runs and no data is ever recorded: the worst possible
|
|
31
|
+
// failure for an observability tool, because it looks like "no activity"
|
|
32
|
+
// rather than "broken". npm generates the .cmd shim for exactly this.
|
|
33
|
+
if (process.platform === 'win32') {
|
|
34
|
+
// dist/commands -> .../node_modules/@klars/agentobs -> up to the dir
|
|
35
|
+
// holding npm's shims (node_modules/.bin, or the global npm root).
|
|
36
|
+
const packageRoot = resolve(here, '..', '..');
|
|
37
|
+
const shims = [
|
|
38
|
+
resolve(packageRoot, '..', '..', '..', 'agentobs-hook.cmd'), // global npm root
|
|
39
|
+
resolve(packageRoot, '..', '..', '.bin', 'agentobs-hook.cmd'), // local node_modules/.bin
|
|
40
|
+
];
|
|
41
|
+
for (const shim of shims) {
|
|
42
|
+
if (existsSync(shim))
|
|
43
|
+
return shim;
|
|
44
|
+
}
|
|
45
|
+
// No shim found (e.g. running from a source checkout): fall back to the
|
|
46
|
+
// bare name so PATH resolution can still find it, rather than emitting a
|
|
47
|
+
// path that is guaranteed not to execute.
|
|
48
|
+
return 'agentobs-hook.cmd';
|
|
49
|
+
}
|
|
26
50
|
const candidate = resolve(here, '..', '..', 'bin', 'agentobs-hook');
|
|
27
51
|
if (existsSync(candidate))
|
|
28
52
|
return candidate;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@klars/agentobs",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"description": "Observability and control layer for AI coding agents - see every tool call, token, and dollar your agents spend, and stop them before they do something risky.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Klars AI",
|