agent-trace-capture 0.0.0-stage → 0.4.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/cli.cjs ADDED
@@ -0,0 +1,18 @@
1
+ #!/usr/bin/env node
2
+ 'use strict';
3
+ const path = require('node:path');
4
+ const fs = require('node:fs');
5
+ const { spawn } = require('node:child_process');
6
+ const suffix = process.platform === 'win32' ? '.exe' : '';
7
+ const executable = path.join(__dirname, '..', 'binaries',
8
+ `${process.platform}-${process.arch}`, `agent-trace-capture${suffix}`);
9
+ if (!fs.existsSync(executable)) {
10
+ console.error(`Unsupported platform: ${process.platform}/${process.arch}. Supported: Windows, macOS, Linux on x64/arm64.`);
11
+ process.exit(2);
12
+ }
13
+ // No downloads, shell interpolation, install hooks, or collection during npm install.
14
+ const child = spawn(executable, process.argv.slice(2), { stdio: 'inherit', windowsHide: false });
15
+ child.on('error', error => { console.error(`Could not start collector: ${error.message}`); process.exitCode = 2; });
16
+ child.on('exit', (code, signal) => { process.exitCode = code === null ? (signal === 'SIGINT' ? 130 : 2) : code; });
17
+ process.on('SIGINT', () => child.kill('SIGINT'));
18
+ process.on('SIGTERM', () => child.kill('SIGTERM'));
package/package.json CHANGED
@@ -1,6 +1,14 @@
1
1
  {
2
2
  "name": "agent-trace-capture",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.4.0",
4
+ "description": "Capture local history from 11 coding tools and upload it to Agent Trace Capture",
5
+ "license": "UNLICENSED",
6
+ "engines": {"node": ">=18"},
7
+ "bin": {"agent-trace-capture": "bin/cli.cjs"},
8
+ "files": ["bin/cli.cjs", "binaries/", "README.md", "COVERAGE.md", "THIRD_PARTY_NOTICES.txt"],
9
+ "scripts": {
10
+ "test": "node --test tests/npm.test.cjs",
11
+ "prepack": "node scripts/check-package.cjs"
12
+ },
13
+ "publishConfig": {"access": "public", "registry": "https://registry.npmjs.org/"}
14
+ }