ai-garcon 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/bin/garcon.js +16 -0
- package/bin/postinstall.js +12 -0
- package/bin/resolve.js +11 -0
- package/package.json +37 -0
package/bin/garcon.js
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
'use strict';
|
|
3
|
+
const { spawnSync } = require('node:child_process');
|
|
4
|
+
const { pkg, binaryPath } = require('./resolve.js');
|
|
5
|
+
const bin = binaryPath();
|
|
6
|
+
if (!bin) {
|
|
7
|
+
console.error(`ai-garcon: no prebuilt binary for ${process.platform}-${process.arch} (package ${pkg}).`);
|
|
8
|
+
console.error('Build from source instead: https://github.com/asieke/garcon');
|
|
9
|
+
process.exit(1);
|
|
10
|
+
}
|
|
11
|
+
const r = spawnSync(bin, process.argv.slice(2), { stdio: 'inherit' });
|
|
12
|
+
if (r.error) {
|
|
13
|
+
console.error(`ai-garcon: ${r.error.message}`);
|
|
14
|
+
process.exit(1);
|
|
15
|
+
}
|
|
16
|
+
process.exit(r.status ?? 1);
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
// After an install or upgrade, restart a running garcon service so it picks up the new
|
|
2
|
+
// binary. `garcon service restart` is a no-op when no service is installed, and any
|
|
3
|
+
// failure here must never fail the npm install itself.
|
|
4
|
+
'use strict';
|
|
5
|
+
const { spawnSync } = require('node:child_process');
|
|
6
|
+
const { binaryPath } = require('./resolve.js');
|
|
7
|
+
const bin = binaryPath();
|
|
8
|
+
if (bin) {
|
|
9
|
+
try {
|
|
10
|
+
spawnSync(bin, ['service', 'restart'], { stdio: 'inherit' });
|
|
11
|
+
} catch {}
|
|
12
|
+
}
|
package/bin/resolve.js
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
// Locate the prebuilt binary for this platform, installed as an optional dependency.
|
|
2
|
+
'use strict';
|
|
3
|
+
const pkg = `ai-garcon-${process.platform}-${process.arch}`;
|
|
4
|
+
function binaryPath() {
|
|
5
|
+
try {
|
|
6
|
+
return require.resolve(`${pkg}/bin/garcon`);
|
|
7
|
+
} catch {
|
|
8
|
+
return null;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
module.exports = { pkg, binaryPath };
|
package/package.json
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "ai-garcon",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Observability for coding agents: a local pass-through proxy that records what Claude Code, Codex and other agents spend in tokens, with a dashboard and optional cross-device sync.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"claude-code",
|
|
7
|
+
"codex",
|
|
8
|
+
"llm",
|
|
9
|
+
"proxy",
|
|
10
|
+
"usage",
|
|
11
|
+
"tokens",
|
|
12
|
+
"observability"
|
|
13
|
+
],
|
|
14
|
+
"repository": {
|
|
15
|
+
"type": "git",
|
|
16
|
+
"url": "git+https://github.com/asieke/garcon.git"
|
|
17
|
+
},
|
|
18
|
+
"homepage": "https://asieke.github.io/garcon/",
|
|
19
|
+
"bin": {
|
|
20
|
+
"garcon": "bin/garcon.js"
|
|
21
|
+
},
|
|
22
|
+
"files": [
|
|
23
|
+
"bin"
|
|
24
|
+
],
|
|
25
|
+
"scripts": {
|
|
26
|
+
"postinstall": "node bin/postinstall.js"
|
|
27
|
+
},
|
|
28
|
+
"engines": {
|
|
29
|
+
"node": ">=18"
|
|
30
|
+
},
|
|
31
|
+
"optionalDependencies": {
|
|
32
|
+
"ai-garcon-linux-x64": "0.1.0",
|
|
33
|
+
"ai-garcon-linux-arm64": "0.1.0",
|
|
34
|
+
"ai-garcon-darwin-x64": "0.1.0",
|
|
35
|
+
"ai-garcon-darwin-arm64": "0.1.0"
|
|
36
|
+
}
|
|
37
|
+
}
|