fluq-watch 0.1.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 +61 -0
- package/dist/bin/fluq.d.ts +3 -0
- package/dist/bin/fluq.d.ts.map +1 -0
- package/dist/bin/fluq.js +81 -0
- package/dist/bin/fluq.js.map +1 -0
- package/dist/src/agent-registry.d.ts +22 -0
- package/dist/src/agent-registry.d.ts.map +1 -0
- package/dist/src/agent-registry.js +129 -0
- package/dist/src/agent-registry.js.map +1 -0
- package/dist/src/config.d.ts +13 -0
- package/dist/src/config.d.ts.map +1 -0
- package/dist/src/config.js +63 -0
- package/dist/src/config.js.map +1 -0
- package/dist/src/detector.d.ts +21 -0
- package/dist/src/detector.d.ts.map +1 -0
- package/dist/src/detector.js +104 -0
- package/dist/src/detector.js.map +1 -0
- package/dist/src/index.d.ts +7 -0
- package/dist/src/index.d.ts.map +1 -0
- package/dist/src/index.js +18 -0
- package/dist/src/index.js.map +1 -0
- package/dist/src/patterns.json +127 -0
- package/dist/src/reporter.d.ts +33 -0
- package/dist/src/reporter.d.ts.map +1 -0
- package/dist/src/reporter.js +110 -0
- package/dist/src/reporter.js.map +1 -0
- package/dist/src/trace-manager.d.ts +20 -0
- package/dist/src/trace-manager.d.ts.map +1 -0
- package/dist/src/trace-manager.js +112 -0
- package/dist/src/trace-manager.js.map +1 -0
- package/dist/src/watcher.d.ts +23 -0
- package/dist/src/watcher.d.ts.map +1 -0
- package/dist/src/watcher.js +292 -0
- package/dist/src/watcher.js.map +1 -0
- package/package.json +32 -0
package/README.md
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
# fluq — AI Agent Observer CLI
|
|
2
|
+
|
|
3
|
+
Watch your AI agents running in tmux sessions. Zero code changes required.
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install -g fluq
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Quick Start
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
# Set your API key
|
|
15
|
+
export FLUQ_API_KEY=fo_your_key_here
|
|
16
|
+
|
|
17
|
+
# Start watching all tmux sessions
|
|
18
|
+
fluq watch
|
|
19
|
+
|
|
20
|
+
# Or pass the key directly
|
|
21
|
+
fluq watch --api-key fo_your_key_here
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## Commands
|
|
25
|
+
|
|
26
|
+
### `fluq watch`
|
|
27
|
+
|
|
28
|
+
Auto-discovers tmux sessions, detects AI agent activity (Claude Code, Codex, OpenClaw, etc.), and reports events to Fluq.
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
fluq watch # Watch all tmux sessions
|
|
32
|
+
fluq watch --session crank-alpha # Watch specific session
|
|
33
|
+
fluq watch --exclude test # Exclude sessions matching pattern
|
|
34
|
+
fluq watch --interval 5000 # Poll every 5 seconds
|
|
35
|
+
fluq watch --dry-run # Print events without sending
|
|
36
|
+
fluq watch --verbose # Debug output
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
### `fluq status`
|
|
40
|
+
|
|
41
|
+
Check connection to the Fluq API.
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
fluq status --api-key fo_your_key_here
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
## What it detects
|
|
48
|
+
|
|
49
|
+
- **Agent types:** Claude Code, Codex, OpenAI CLI, OpenClaw, generic AI agents
|
|
50
|
+
- **Events:** file reads/writes, API calls, tool usage, errors, completions, spawns, token counts
|
|
51
|
+
- **Traces:** Automatically creates traces per session, links parent→child on spawn
|
|
52
|
+
|
|
53
|
+
## Configuration
|
|
54
|
+
|
|
55
|
+
| Option | Env var | Default |
|
|
56
|
+
|--------|---------|---------|
|
|
57
|
+
| `--api-key` | `FLUQ_API_KEY` | — |
|
|
58
|
+
| `--endpoint` | `FLUQ_ENDPOINT` | `https://fluq.ai` |
|
|
59
|
+
| `--interval` | — | `3000` |
|
|
60
|
+
|
|
61
|
+
Agent IDs are cached in `~/.fluq/agents.json` to avoid re-registration.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fluq.d.ts","sourceRoot":"","sources":["../../bin/fluq.ts"],"names":[],"mappings":""}
|
package/dist/bin/fluq.js
ADDED
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
const commander_1 = require("commander");
|
|
5
|
+
const watcher_1 = require("../src/watcher");
|
|
6
|
+
const config_1 = require("../src/config");
|
|
7
|
+
const program = new commander_1.Command();
|
|
8
|
+
program
|
|
9
|
+
.name("fluq")
|
|
10
|
+
.description("Fluq Fleet Ops CLI — observe AI agents in tmux sessions")
|
|
11
|
+
.version("0.1.0");
|
|
12
|
+
program
|
|
13
|
+
.command("watch")
|
|
14
|
+
.description("Watch tmux sessions for AI agent activity")
|
|
15
|
+
.option("--api-key <key>", "API key (or set FLUQ_API_KEY)")
|
|
16
|
+
.option("--endpoint <url>", "API endpoint (default: https://fluq.ai)")
|
|
17
|
+
.option("--session <names...>", "Watch specific session(s)")
|
|
18
|
+
.option("--exclude <patterns...>", "Exclude sessions matching pattern")
|
|
19
|
+
.option("--interval <ms>", "Poll interval in ms (default: 3000)", parseInt)
|
|
20
|
+
.option("--verbose", "Enable debug output")
|
|
21
|
+
.option("--dry-run", "Print events without sending")
|
|
22
|
+
.action(async (opts) => {
|
|
23
|
+
const config = (0, config_1.resolveConfig)({
|
|
24
|
+
apiKey: opts.apiKey,
|
|
25
|
+
endpoint: opts.endpoint,
|
|
26
|
+
interval: opts.interval,
|
|
27
|
+
verbose: opts.verbose,
|
|
28
|
+
dryRun: opts.dryRun,
|
|
29
|
+
sessions: opts.session || [],
|
|
30
|
+
exclude: opts.exclude || [],
|
|
31
|
+
});
|
|
32
|
+
const watcher = new watcher_1.Watcher(config);
|
|
33
|
+
// Graceful shutdown
|
|
34
|
+
const shutdown = async () => {
|
|
35
|
+
console.log("\n🛑 Shutting down...");
|
|
36
|
+
await watcher.stop();
|
|
37
|
+
process.exit(0);
|
|
38
|
+
};
|
|
39
|
+
process.on("SIGINT", shutdown);
|
|
40
|
+
process.on("SIGTERM", shutdown);
|
|
41
|
+
watcher.start();
|
|
42
|
+
});
|
|
43
|
+
program
|
|
44
|
+
.command("status")
|
|
45
|
+
.description("Check connection status")
|
|
46
|
+
.option("--api-key <key>", "API key (or set FLUQ_API_KEY)")
|
|
47
|
+
.option("--endpoint <url>", "API endpoint")
|
|
48
|
+
.action(async (opts) => {
|
|
49
|
+
const apiKey = opts.apiKey || process.env.FLUQ_API_KEY;
|
|
50
|
+
const endpoint = opts.endpoint || process.env.FLUQ_ENDPOINT || "https://fluq.ai";
|
|
51
|
+
if (!apiKey) {
|
|
52
|
+
console.error("Error: API key required");
|
|
53
|
+
process.exit(1);
|
|
54
|
+
}
|
|
55
|
+
try {
|
|
56
|
+
const response = await fetch(`${endpoint}/api/v1/agents?limit=1`, {
|
|
57
|
+
headers: { Authorization: `Bearer ${apiKey}` },
|
|
58
|
+
signal: AbortSignal.timeout(10000),
|
|
59
|
+
});
|
|
60
|
+
if (response.ok) {
|
|
61
|
+
const data = await response.json();
|
|
62
|
+
console.log("✓ Connected to Fluq");
|
|
63
|
+
console.log(` Endpoint: ${endpoint}`);
|
|
64
|
+
console.log(` Agents: ${data.data?.length || 0} found`);
|
|
65
|
+
}
|
|
66
|
+
else if (response.status === 401) {
|
|
67
|
+
console.error("✗ Invalid API key");
|
|
68
|
+
process.exit(1);
|
|
69
|
+
}
|
|
70
|
+
else {
|
|
71
|
+
console.error(`✗ Connection failed: HTTP ${response.status}`);
|
|
72
|
+
process.exit(1);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
catch (err) {
|
|
76
|
+
console.error(`✗ Cannot reach ${endpoint}:`, err);
|
|
77
|
+
process.exit(1);
|
|
78
|
+
}
|
|
79
|
+
});
|
|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,IAAI,GAAG,MAAM,QAAQ,CAAC,IAAI,EAA0B,CAAC;YAC3D,OAAO,CAAC,GAAG,CAAC,qBAAqB,CAAC,CAAC;YACnC,OAAO,CAAC,GAAG,CAAC,eAAe,QAAQ,EAAE,CAAC,CAAC;YACvC,OAAO,CAAC,GAAG,CAAC,aAAa,IAAI,CAAC,IAAI,EAAE,MAAM,IAAI,CAAC,QAAQ,CAAC,CAAC;QAC3D,CAAC;aAAM,IAAI,QAAQ,CAAC,MAAM,KAAK,GAAG,EAAE,CAAC;YACnC,OAAO,CAAC,KAAK,CAAC,mBAAmB,CAAC,CAAC;YACnC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAClB,CAAC;aAAM,CAAC;YACN,OAAO,CAAC,KAAK,CAAC,6BAA6B,QAAQ,CAAC,MAAM,EAAE,CAAC,CAAC;YAC9D,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAClB,CAAC;IACH,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,OAAO,CAAC,KAAK,CAAC,kBAAkB,QAAQ,GAAG,EAAE,GAAG,CAAC,CAAC;QAClD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;AACH,CAAC,CAAC,CAAC;AAEL,OAAO,CAAC,KAAK,EAAE,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { type FluqConfig } from "./config";
|
|
2
|
+
interface CachedAgent {
|
|
3
|
+
id: string;
|
|
4
|
+
name: string;
|
|
5
|
+
type: string;
|
|
6
|
+
registeredAt: string;
|
|
7
|
+
}
|
|
8
|
+
interface AgentCache {
|
|
9
|
+
[sessionName: string]: CachedAgent;
|
|
10
|
+
}
|
|
11
|
+
export declare class AgentRegistry {
|
|
12
|
+
private cache;
|
|
13
|
+
private config;
|
|
14
|
+
constructor(config: FluqConfig);
|
|
15
|
+
private loadCache;
|
|
16
|
+
private saveCache;
|
|
17
|
+
getCachedAgentId(sessionName: string): string | null;
|
|
18
|
+
getOrRegisterAgent(sessionName: string, agentType: string, description?: string): Promise<string>;
|
|
19
|
+
getAllCachedAgents(): AgentCache;
|
|
20
|
+
}
|
|
21
|
+
export {};
|
|
22
|
+
//# sourceMappingURL=agent-registry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent-registry.d.ts","sourceRoot":"","sources":["../../src/agent-registry.ts"],"names":[],"mappings":"AAEA,OAAO,EAAmC,KAAK,UAAU,EAAE,MAAM,UAAU,CAAC;AAE5E,UAAU,WAAW;IACnB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,EAAE,MAAM,CAAC;CACtB;AAED,UAAU,UAAU;IAClB,CAAC,WAAW,EAAE,MAAM,GAAG,WAAW,CAAC;CACpC;AAED,qBAAa,aAAa;IACxB,OAAO,CAAC,KAAK,CAAkB;IAC/B,OAAO,CAAC,MAAM,CAAa;gBAEf,MAAM,EAAE,UAAU;IAK9B,OAAO,CAAC,SAAS;IAYjB,OAAO,CAAC,SAAS;IAQjB,gBAAgB,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI;IAI9C,kBAAkB,CACtB,WAAW,EAAE,MAAM,EACnB,SAAS,EAAE,MAAM,EACjB,WAAW,CAAC,EAAE,MAAM,GACnB,OAAO,CAAC,MAAM,CAAC;IAoElB,kBAAkB,IAAI,UAAU;CAGjC"}
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.AgentRegistry = void 0;
|
|
37
|
+
const fs = __importStar(require("fs"));
|
|
38
|
+
const config_1 = require("./config");
|
|
39
|
+
class AgentRegistry {
|
|
40
|
+
cache = {};
|
|
41
|
+
config;
|
|
42
|
+
constructor(config) {
|
|
43
|
+
this.config = config;
|
|
44
|
+
this.loadCache();
|
|
45
|
+
}
|
|
46
|
+
loadCache() {
|
|
47
|
+
const cachePath = (0, config_1.getAgentCachePath)();
|
|
48
|
+
try {
|
|
49
|
+
if (fs.existsSync(cachePath)) {
|
|
50
|
+
const raw = fs.readFileSync(cachePath, "utf-8");
|
|
51
|
+
this.cache = JSON.parse(raw);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
catch {
|
|
55
|
+
this.cache = {};
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
saveCache() {
|
|
59
|
+
const dir = (0, config_1.getConfigDir)();
|
|
60
|
+
if (!fs.existsSync(dir)) {
|
|
61
|
+
fs.mkdirSync(dir, { recursive: true });
|
|
62
|
+
}
|
|
63
|
+
fs.writeFileSync((0, config_1.getAgentCachePath)(), JSON.stringify(this.cache, null, 2));
|
|
64
|
+
}
|
|
65
|
+
getCachedAgentId(sessionName) {
|
|
66
|
+
return this.cache[sessionName]?.id || null;
|
|
67
|
+
}
|
|
68
|
+
async getOrRegisterAgent(sessionName, agentType, description) {
|
|
69
|
+
// Check cache first
|
|
70
|
+
const cached = this.cache[sessionName];
|
|
71
|
+
if (cached) {
|
|
72
|
+
return cached.id;
|
|
73
|
+
}
|
|
74
|
+
if (this.config.dryRun) {
|
|
75
|
+
const fakeId = `dry-run-${sessionName}`;
|
|
76
|
+
this.cache[sessionName] = {
|
|
77
|
+
id: fakeId,
|
|
78
|
+
name: sessionName,
|
|
79
|
+
type: agentType,
|
|
80
|
+
registeredAt: new Date().toISOString(),
|
|
81
|
+
};
|
|
82
|
+
return fakeId;
|
|
83
|
+
}
|
|
84
|
+
// Try to register via API (upsert)
|
|
85
|
+
try {
|
|
86
|
+
const url = `${this.config.endpoint}/api/v1/agents`;
|
|
87
|
+
const response = await fetch(url, {
|
|
88
|
+
method: "POST",
|
|
89
|
+
headers: {
|
|
90
|
+
"Content-Type": "application/json",
|
|
91
|
+
Authorization: `Bearer ${this.config.apiKey}`,
|
|
92
|
+
},
|
|
93
|
+
body: JSON.stringify({
|
|
94
|
+
name: sessionName,
|
|
95
|
+
type: agentType,
|
|
96
|
+
description: description || `Auto-discovered tmux session: ${sessionName}`,
|
|
97
|
+
capabilities: [],
|
|
98
|
+
}),
|
|
99
|
+
signal: AbortSignal.timeout(10000),
|
|
100
|
+
});
|
|
101
|
+
if (!response.ok) {
|
|
102
|
+
throw new Error(`HTTP ${response.status}: ${response.statusText}`);
|
|
103
|
+
}
|
|
104
|
+
const data = await response.json();
|
|
105
|
+
const agentId = data.data.id;
|
|
106
|
+
// Cache it
|
|
107
|
+
this.cache[sessionName] = {
|
|
108
|
+
id: agentId,
|
|
109
|
+
name: sessionName,
|
|
110
|
+
type: agentType,
|
|
111
|
+
registeredAt: new Date().toISOString(),
|
|
112
|
+
};
|
|
113
|
+
this.saveCache();
|
|
114
|
+
if (this.config.verbose) {
|
|
115
|
+
console.log(`[registry] Registered agent "${sessionName}" (${agentType}) → ${agentId}`);
|
|
116
|
+
}
|
|
117
|
+
return agentId;
|
|
118
|
+
}
|
|
119
|
+
catch (err) {
|
|
120
|
+
console.error(`[registry] Failed to register agent "${sessionName}":`, err);
|
|
121
|
+
throw err;
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
getAllCachedAgents() {
|
|
125
|
+
return { ...this.cache };
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
exports.AgentRegistry = AgentRegistry;
|
|
129
|
+
//# sourceMappingURL=agent-registry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent-registry.js","sourceRoot":"","sources":["../../src/agent-registry.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,uCAAyB;AAEzB,qCAA4E;AAa5E,MAAa,aAAa;IAChB,KAAK,GAAe,EAAE,CAAC;IACvB,MAAM,CAAa;IAE3B,YAAY,MAAkB;QAC5B,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,SAAS,EAAE,CAAC;IACnB,CAAC;IAEO,SAAS;QACf,MAAM,SAAS,GAAG,IAAA,0BAAiB,GAAE,CAAC;QACtC,IAAI,CAAC;YACH,IAAI,EAAE,CAAC,UAAU,CAAC,SAAS,CAAC,EAAE,CAAC;gBAC7B,MAAM,GAA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AM,SAAS,OAAO,OAAO,EAAE,CAC3E,CAAC;YACJ,CAAC;YAED,OAAO,OAAO,CAAC;QACjB,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,OAAO,CAAC,KAAK,CACX,wCAAwC,WAAW,IAAI,EACvD,GAAG,CACJ,CAAC;YACF,MAAM,GAAG,CAAC;QACZ,CAAC;IACH,CAAC;IAED,kBAAkB;QAChB,OAAO,EAAE,GAAG,IAAI,CAAC,KAAK,EAAE,CAAC;IAC3B,CAAC;CACF;AA5GD,sCA4GC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export interface FluqConfig {
|
|
2
|
+
apiKey: string;
|
|
3
|
+
endpoint: string;
|
|
4
|
+
interval: number;
|
|
5
|
+
verbose: boolean;
|
|
6
|
+
dryRun: boolean;
|
|
7
|
+
sessions: string[];
|
|
8
|
+
exclude: string[];
|
|
9
|
+
}
|
|
10
|
+
export declare function getConfigDir(): string;
|
|
11
|
+
export declare function getAgentCachePath(): string;
|
|
12
|
+
export declare function resolveConfig(opts: Partial<FluqConfig>): FluqConfig;
|
|
13
|
+
//# sourceMappingURL=config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/config.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,UAAU;IACzB,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,EAAE,OAAO,CAAC;IAChB,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,OAAO,EAAE,MAAM,EAAE,CAAC;CACnB;AAED,wBAAgB,YAAY,IAAI,MAAM,CAErC;AAED,wBAAgB,iBAAiB,IAAI,MAAM,CAE1C;AAED,wBAAgB,aAAa,CAAC,IAAI,EAAE,OAAO,CAAC,UAAU,CAAC,GAAG,UAAU,CAkBnE"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.getConfigDir = getConfigDir;
|
|
37
|
+
exports.getAgentCachePath = getAgentCachePath;
|
|
38
|
+
exports.resolveConfig = resolveConfig;
|
|
39
|
+
const path = __importStar(require("path"));
|
|
40
|
+
const os = __importStar(require("os"));
|
|
41
|
+
function getConfigDir() {
|
|
42
|
+
return path.join(os.homedir(), ".fluq");
|
|
43
|
+
}
|
|
44
|
+
function getAgentCachePath() {
|
|
45
|
+
return path.join(getConfigDir(), "agents.json");
|
|
46
|
+
}
|
|
47
|
+
function resolveConfig(opts) {
|
|
48
|
+
const apiKey = opts.apiKey || process.env.FLUQ_API_KEY || "";
|
|
49
|
+
if (!apiKey && !opts.dryRun) {
|
|
50
|
+
console.error("Error: API key required. Use --api-key or set FLUQ_API_KEY environment variable.");
|
|
51
|
+
process.exit(1);
|
|
52
|
+
}
|
|
53
|
+
return {
|
|
54
|
+
apiKey,
|
|
55
|
+
endpoint: opts.endpoint || process.env.FLUQ_ENDPOINT || "https://fluq.ai",
|
|
56
|
+
interval: opts.interval || 3000,
|
|
57
|
+
verbose: opts.verbose || false,
|
|
58
|
+
dryRun: opts.dryRun || false,
|
|
59
|
+
sessions: opts.sessions || [],
|
|
60
|
+
exclude: opts.exclude || [],
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
//# sourceMappingURL=config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../src/config.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAaA,oCAEC;AAED,8CAEC;AAED,sCAkBC;AAvCD,2CAA6B;AAC7B,uCAAyB;AAYzB,SAAgB,YAAY;IAC1B,OAAO,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,OAAO,CAAC,CAAC;AAC1C,CAAC;AAED,SAAgB,iBAAiB;IAC/B,OAAO,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE,EAAE,aAAa,CAAC,CAAC;AAClD,CAAC;AAED,SAAgB,aAAa,CAAC,IAAyB;IACrD,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,IAAI,OAAO,CAAC,GAAG,CAAC,YAAY,IAAI,EAAE,CAAC;IAC7D,IAAI,CAAC,MAAM,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC;QAC5B,OAAO,CAAC,KAAK,CACX,kFAAkF,CACnF,CAAC;QACF,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;IAED,OAAO;QACL,MAAM;QACN,QAAQ,EAAE,IAAI,CAAC,QAAQ,IAAI,OAAO,CAAC,GAAG,CAAC,aAAa,IAAI,iBAAiB;QACzE,QAAQ,EAAE,IAAI,CAAC,QAAQ,IAAI,IAAI;QAC/B,OAAO,EAAE,IAAI,CAAC,OAAO,IAAI,KAAK;QAC9B,MAAM,EAAE,IAAI,CAAC,MAAM,IAAI,KAAK;QAC5B,QAAQ,EAAE,IAAI,CAAC,QAAQ,IAAI,EAAE;QAC7B,OAAO,EAAE,IAAI,CAAC,OAAO,IAAI,EAAE;KAC5B,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export interface DetectedAgent {
|
|
2
|
+
name: string;
|
|
3
|
+
type: string;
|
|
4
|
+
}
|
|
5
|
+
export interface DetectedEvent {
|
|
6
|
+
eventType: string;
|
|
7
|
+
resource?: string;
|
|
8
|
+
tokensIn?: number;
|
|
9
|
+
tokensOut?: number;
|
|
10
|
+
errorMessage?: string;
|
|
11
|
+
matchedPattern: string;
|
|
12
|
+
}
|
|
13
|
+
export interface TokenInfo {
|
|
14
|
+
tokensIn: number;
|
|
15
|
+
tokensOut: number;
|
|
16
|
+
totalTokens: number;
|
|
17
|
+
}
|
|
18
|
+
export declare function detectAgent(output: string): DetectedAgent | null;
|
|
19
|
+
export declare function detectEvents(newOutput: string): DetectedEvent[];
|
|
20
|
+
export declare function extractTokens(text: string): TokenInfo | null;
|
|
21
|
+
//# sourceMappingURL=detector.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"detector.d.ts","sourceRoot":"","sources":["../../src/detector.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,aAAa;IAC5B,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,cAAc,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,SAAS;IACxB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,wBAAgB,WAAW,CAAC,MAAM,EAAE,MAAM,GAAG,aAAa,GAAG,IAAI,CAShE;AAED,wBAAgB,YAAY,CAAC,SAAS,EAAE,MAAM,GAAG,aAAa,EAAE,CAqD/D;AAED,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,CAwC5D"}
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.detectAgent = detectAgent;
|
|
7
|
+
exports.detectEvents = detectEvents;
|
|
8
|
+
exports.extractTokens = extractTokens;
|
|
9
|
+
const patterns_json_1 = __importDefault(require("./patterns.json"));
|
|
10
|
+
function detectAgent(output) {
|
|
11
|
+
for (const [name, config] of Object.entries(patterns_json_1.default.agents)) {
|
|
12
|
+
for (const pattern of config.patterns) {
|
|
13
|
+
if (output.includes(pattern)) {
|
|
14
|
+
return { name, type: config.type };
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
return null;
|
|
19
|
+
}
|
|
20
|
+
function detectEvents(newOutput) {
|
|
21
|
+
const detected = [];
|
|
22
|
+
const lines = newOutput.split("\n");
|
|
23
|
+
for (const line of lines) {
|
|
24
|
+
if (!line.trim())
|
|
25
|
+
continue;
|
|
26
|
+
for (const [eventType, config] of Object.entries(patterns_json_1.default.events)) {
|
|
27
|
+
for (const pattern of config.patterns) {
|
|
28
|
+
try {
|
|
29
|
+
const regex = new RegExp(pattern, "i");
|
|
30
|
+
const match = regex.exec(line);
|
|
31
|
+
if (match) {
|
|
32
|
+
const event = {
|
|
33
|
+
eventType,
|
|
34
|
+
matchedPattern: pattern,
|
|
35
|
+
};
|
|
36
|
+
// Extract resource for file operations
|
|
37
|
+
if (eventType === "file_read" || eventType === "file_write") {
|
|
38
|
+
const pathMatch = line.match(/(?:Reading file:|Writing to:|Created:|Edit\(|Write\(|Read\()\s*["`']?([^\s"`',)]+)/i);
|
|
39
|
+
if (pathMatch) {
|
|
40
|
+
event.resource = pathMatch[1];
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
// Extract error message
|
|
44
|
+
if (eventType === "error") {
|
|
45
|
+
event.errorMessage = line.trim().slice(0, 500);
|
|
46
|
+
}
|
|
47
|
+
// Extract token info
|
|
48
|
+
if (eventType === "cost") {
|
|
49
|
+
const tokens = extractTokens(line);
|
|
50
|
+
if (tokens) {
|
|
51
|
+
event.tokensIn = tokens.tokensIn;
|
|
52
|
+
event.tokensOut = tokens.tokensOut;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
detected.push(event);
|
|
56
|
+
break; // Only match one event type per line
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
catch {
|
|
60
|
+
// Invalid regex, skip
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
return detected;
|
|
66
|
+
}
|
|
67
|
+
function extractTokens(text) {
|
|
68
|
+
let tokensIn = 0;
|
|
69
|
+
let tokensOut = 0;
|
|
70
|
+
let totalTokens = 0;
|
|
71
|
+
let found = false;
|
|
72
|
+
for (const pattern of patterns_json_1.default.tokens.input_tokens) {
|
|
73
|
+
const match = new RegExp(pattern, "i").exec(text);
|
|
74
|
+
if (match) {
|
|
75
|
+
tokensIn = parseInt(match[1], 10);
|
|
76
|
+
found = true;
|
|
77
|
+
break;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
for (const pattern of patterns_json_1.default.tokens.output_tokens) {
|
|
81
|
+
const match = new RegExp(pattern, "i").exec(text);
|
|
82
|
+
if (match) {
|
|
83
|
+
tokensOut = parseInt(match[1], 10);
|
|
84
|
+
found = true;
|
|
85
|
+
break;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
for (const pattern of patterns_json_1.default.tokens.total_tokens) {
|
|
89
|
+
const match = new RegExp(pattern, "i").exec(text);
|
|
90
|
+
if (match) {
|
|
91
|
+
totalTokens = parseInt(match[1], 10);
|
|
92
|
+
found = true;
|
|
93
|
+
break;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
if (!found)
|
|
97
|
+
return null;
|
|
98
|
+
return {
|
|
99
|
+
tokensIn,
|
|
100
|
+
tokensOut,
|
|
101
|
+
totalTokens: totalTokens || tokensIn + tokensOut,
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
//# sourceMappingURL=detector.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"detector.js","sourceRoot":"","sources":["../../src/detector.ts"],"names":[],"mappings":";;;;;AAsBA,kCASC;AAED,oCAqDC;AAED,sCAwCC;AAhID,oEAAuC;AAsBvC,SAAgB,WAAW,CAAC,MAAc;IACxC,KAAK,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,uBAAQ,CAAC,MAAM,CAAC,EAAE,CAAC;QAC7D,KAAK,MAAM,OAAO,IAAI,MAAM,CAAC,QAAQ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KAAK,GAAG,IAAI,MAAM,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAClD,IAAI,KAAK,EAAE,CAAC;YACV,SAAS,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;YACnC,KAAK,GAAG,IAAI,CAAC;YACb,MAAM;QACR,CAAC;IACH,CAAC;IAED,KAAK,MAAM,OAAO,IAAI,uBAAQ,CAAC,MAAM,CAAC,YAAY,EAAE,CAAC;QACnD,MAAM,KAAK,GAAG,IAAI,MAAM,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAClD,IAAI,KAAK,EAAE,CAAC;YACV,WAAW,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;YACrC,KAAK,GAAG,IAAI,CAAC;YACb,MAAM;QACR,CAAC;IACH,CAAC;IAED,IAAI,CAAC,KAAK;QAAE,OAAO,IAAI,CAAC;IAExB,OAAO;QACL,QAAQ;QACR,SAAS;QACT,WAAW,EAAE,WAAW,IAAI,QAAQ,GAAG,SAAS;KACjD,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { Watcher } from "./watcher";
|
|
2
|
+
export { Reporter } from "./reporter";
|
|
3
|
+
export { AgentRegistry } from "./agent-registry";
|
|
4
|
+
export { TraceManager } from "./trace-manager";
|
|
5
|
+
export { detectAgent, detectEvents, extractTokens } from "./detector";
|
|
6
|
+
export { resolveConfig, type FluqConfig } from "./config";
|
|
7
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AACtE,OAAO,EAAE,aAAa,EAAE,KAAK,UAAU,EAAE,MAAM,UAAU,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.resolveConfig = exports.extractTokens = exports.detectEvents = exports.detectAgent = exports.TraceManager = exports.AgentRegistry = exports.Reporter = exports.Watcher = void 0;
|
|
4
|
+
var watcher_1 = require("./watcher");
|
|
5
|
+
Object.defineProperty(exports, "Watcher", { enumerable: true, get: function () { return watcher_1.Watcher; } });
|
|
6
|
+
var reporter_1 = require("./reporter");
|
|
7
|
+
Object.defineProperty(exports, "Reporter", { enumerable: true, get: function () { return reporter_1.Reporter; } });
|
|
8
|
+
var agent_registry_1 = require("./agent-registry");
|
|
9
|
+
Object.defineProperty(exports, "AgentRegistry", { enumerable: true, get: function () { return agent_registry_1.AgentRegistry; } });
|
|
10
|
+
var trace_manager_1 = require("./trace-manager");
|
|
11
|
+
Object.defineProperty(exports, "TraceManager", { enumerable: true, get: function () { return trace_manager_1.TraceManager; } });
|
|
12
|
+
var detector_1 = require("./detector");
|
|
13
|
+
Object.defineProperty(exports, "detectAgent", { enumerable: true, get: function () { return detector_1.detectAgent; } });
|
|
14
|
+
Object.defineProperty(exports, "detectEvents", { enumerable: true, get: function () { return detector_1.detectEvents; } });
|
|
15
|
+
Object.defineProperty(exports, "extractTokens", { enumerable: true, get: function () { return detector_1.extractTokens; } });
|
|
16
|
+
var config_1 = require("./config");
|
|
17
|
+
Object.defineProperty(exports, "resolveConfig", { enumerable: true, get: function () { return config_1.resolveConfig; } });
|
|
18
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;AAAA,qCAAoC;AAA3B,kGAAA,OAAO,OAAA;AAChB,uCAAsC;AAA7B,oGAAA,QAAQ,OAAA;AACjB,mDAAiD;AAAxC,+GAAA,aAAa,OAAA;AACtB,iDAA+C;AAAtC,6GAAA,YAAY,OAAA;AACrB,uCAAsE;AAA7D,uGAAA,WAAW,OAAA;AAAE,wGAAA,YAAY,OAAA;AAAE,yGAAA,aAAa,OAAA;AACjD,mCAA0D;AAAjD,uGAAA,aAAa,OAAA"}
|