podwatch 1.0.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.
Files changed (51) hide show
  1. package/LICENSE +28 -0
  2. package/README.md +92 -0
  3. package/bin/podwatch.js +10 -0
  4. package/dist/classifier.d.ts +22 -0
  5. package/dist/classifier.d.ts.map +1 -0
  6. package/dist/classifier.js +157 -0
  7. package/dist/classifier.js.map +1 -0
  8. package/dist/hooks/cost.d.ts +26 -0
  9. package/dist/hooks/cost.d.ts.map +1 -0
  10. package/dist/hooks/cost.js +107 -0
  11. package/dist/hooks/cost.js.map +1 -0
  12. package/dist/hooks/lifecycle.d.ts +16 -0
  13. package/dist/hooks/lifecycle.d.ts.map +1 -0
  14. package/dist/hooks/lifecycle.js +273 -0
  15. package/dist/hooks/lifecycle.js.map +1 -0
  16. package/dist/hooks/security.d.ts +19 -0
  17. package/dist/hooks/security.d.ts.map +1 -0
  18. package/dist/hooks/security.js +128 -0
  19. package/dist/hooks/security.js.map +1 -0
  20. package/dist/hooks/sessions.d.ts +10 -0
  21. package/dist/hooks/sessions.d.ts.map +1 -0
  22. package/dist/hooks/sessions.js +53 -0
  23. package/dist/hooks/sessions.js.map +1 -0
  24. package/dist/index.d.ts +32 -0
  25. package/dist/index.d.ts.map +1 -0
  26. package/dist/index.js +120 -0
  27. package/dist/index.js.map +1 -0
  28. package/dist/redact.d.ts +35 -0
  29. package/dist/redact.d.ts.map +1 -0
  30. package/dist/redact.js +372 -0
  31. package/dist/redact.js.map +1 -0
  32. package/dist/scanner.d.ts +27 -0
  33. package/dist/scanner.d.ts.map +1 -0
  34. package/dist/scanner.js +117 -0
  35. package/dist/scanner.js.map +1 -0
  36. package/dist/transmitter.d.ts +58 -0
  37. package/dist/transmitter.d.ts.map +1 -0
  38. package/dist/transmitter.js +654 -0
  39. package/dist/transmitter.js.map +1 -0
  40. package/dist/types.d.ts +116 -0
  41. package/dist/types.d.ts.map +1 -0
  42. package/dist/types.js +9 -0
  43. package/dist/types.js.map +1 -0
  44. package/dist/updater.d.ts +168 -0
  45. package/dist/updater.d.ts.map +1 -0
  46. package/dist/updater.js +579 -0
  47. package/dist/updater.js.map +1 -0
  48. package/lib/installer.js +599 -0
  49. package/openclaw.plugin.json +59 -0
  50. package/package.json +56 -0
  51. package/skills/podwatch/SKILL.md +112 -0
package/package.json ADDED
@@ -0,0 +1,56 @@
1
+ {
2
+ "name": "podwatch",
3
+ "version": "1.0.2",
4
+ "description": "Security monitoring, cost tracking, and observability for AI agents",
5
+ "main": "dist/index.js",
6
+ "types": "dist/index.d.ts",
7
+ "bin": {
8
+ "podwatch": "./bin/podwatch.js"
9
+ },
10
+ "files": [
11
+ "dist/",
12
+ "skills/",
13
+ "openclaw.plugin.json",
14
+ "bin/",
15
+ "lib/"
16
+ ],
17
+ "scripts": {
18
+ "build": "tsc",
19
+ "dev": "tsc --watch",
20
+ "clean": "rm -rf dist",
21
+ "test": "vitest run",
22
+ "test:watch": "vitest",
23
+ "prepublishOnly": "npm run build"
24
+ },
25
+ "engines": {
26
+ "node": ">=16.0.0"
27
+ },
28
+ "openclaw": {
29
+ "plugin": true,
30
+ "extensions": [
31
+ "./dist/index.js"
32
+ ]
33
+ },
34
+ "keywords": [
35
+ "openclaw",
36
+ "openclaw-plugin",
37
+ "agent",
38
+ "monitoring",
39
+ "cost-tracking",
40
+ "security",
41
+ "observability",
42
+ "budget-enforcement"
43
+ ],
44
+ "author": "Rafael Urena",
45
+ "license": "BSD-3-Clause",
46
+ "homepage": "https://podwatch.app",
47
+ "repository": {
48
+ "type": "git",
49
+ "url": "https://github.com/podwatch/podwatch-plugin"
50
+ },
51
+ "devDependencies": {
52
+ "@types/node": "^25.2.1",
53
+ "typescript": "^5.7.0",
54
+ "vitest": "^4.0.18"
55
+ }
56
+ }
@@ -0,0 +1,112 @@
1
+ ---
2
+ name: podwatch
3
+ description: "Check Podwatch monitoring status, costs, budget, alerts, and scan installed skills/plugins."
4
+ version: 0.1.0
5
+ user-invocable: true
6
+ metadata: { "openclaw": { "emoji": "👁️" } }
7
+ ---
8
+
9
+ # Podwatch Agent Commands
10
+
11
+ You have Podwatch cost monitoring and security installed. When the user asks about costs, budget, monitoring, or security — use these commands.
12
+
13
+ ## Config
14
+
15
+ Your Podwatch API key is in your plugin config at `plugins.entries.podwatch.config.apiKey`. The endpoint is `plugins.entries.podwatch.config.endpoint` (default: `https://podwatch.app/api`).
16
+
17
+ To make API calls, use `web_fetch` with an `Authorization: Bearer <apiKey>` header. Read the API key from your gateway config first if you don't have it cached.
18
+
19
+ ## Commands
20
+
21
+ ### /podwatch status
22
+
23
+ Fetch agent monitoring status.
24
+
25
+ ```
26
+ web_fetch URL: {endpoint}/status
27
+ Headers: Authorization: Bearer {apiKey}
28
+ ```
29
+
30
+ Response fields: `agentOnline`, `eventsToday`, `lastHeartbeat`, `diagnosticsEnabled`, `pluginVersion`.
31
+
32
+ Show the user:
33
+ - Online/offline status
34
+ - Events collected today
35
+ - Last heartbeat time (relative, e.g. "2 minutes ago")
36
+ - Whether diagnostics are enabled
37
+
38
+ ### /podwatch costs [today|week|month]
39
+
40
+ Fetch cost summary for a time period. Default: `today`.
41
+
42
+ ```
43
+ web_fetch URL: {endpoint}/costs?period={period}
44
+ Headers: Authorization: Bearer {apiKey}
45
+ ```
46
+
47
+ Response fields: `totalCostUsd`, `totalTokens`, `byModel[]` (model, cost, tokens, calls), `byTool[]` (tool, calls, avgDurationMs), `comparisonPct` (vs previous period).
48
+
49
+ Show the user:
50
+ - Total cost in USD (4 decimal places for small amounts, 2 for >$1)
51
+ - Total tokens (formatted with commas)
52
+ - Top 3 models by cost
53
+ - Top 3 tools by call count
54
+ - Comparison: "↑12% vs yesterday" or "↓5% vs last week"
55
+
56
+ ### /podwatch budget
57
+
58
+ Fetch current budget state.
59
+
60
+ ```
61
+ web_fetch URL: {endpoint}/budget
62
+ Headers: Authorization: Bearer {apiKey}
63
+ ```
64
+
65
+ Response fields: `dailyLimit`, `currentSpend`, `remainingUsd`, `percentUsed`, `hardStopEnabled`.
66
+
67
+ Show the user:
68
+ - Current spend vs daily limit (e.g. "$3.42 / $10.00")
69
+ - Percentage bar (e.g. "████░░░░░░ 34%")
70
+ - Whether hard stop (budget enforcement) is enabled
71
+ - If >80%: warn them they're approaching the limit
72
+
73
+ ### /podwatch alerts [count]
74
+
75
+ Fetch recent security alerts. Default count: 5.
76
+
77
+ ```
78
+ web_fetch URL: {endpoint}/alerts?limit={count}
79
+ Headers: Authorization: Bearer {apiKey}
80
+ ```
81
+
82
+ Response fields: `alerts[]` (severity, pattern, toolName, message, timestamp).
83
+
84
+ Show each alert with:
85
+ - Severity emoji: 🔴 critical, 🟠 high, 🟡 medium, 🟢 low
86
+ - Pattern name (exfiltration_sequence, first_time_tool, dangerous_operation, persistence_attempt)
87
+ - Tool that triggered it
88
+ - Relative timestamp
89
+
90
+ ### /podwatch scan
91
+
92
+ Trigger a skill/plugin security scan.
93
+
94
+ ```
95
+ web_fetch URL: {endpoint}/scan
96
+ Method: POST
97
+ Headers: Authorization: Bearer {apiKey}
98
+ ```
99
+
100
+ Response fields: `skills[]`, `plugins[]` — each with name, source, version, riskIndicators[].
101
+
102
+ Show the user:
103
+ - Total skills and plugins found
104
+ - Any with risk indicators (highlight in red)
105
+ - Podwatch itself should show as verified ✅
106
+
107
+ ## Response Style
108
+
109
+ - Keep responses concise — tables work well for costs and alerts
110
+ - Use emoji for severity levels
111
+ - Round costs: 4 decimals if <$1, 2 decimals if >=$1
112
+ - Always show the dashboard link at the bottom: "Full details → https://podwatch.app"