@amsterdamdatalabs/adl-agent-id 0.0.4789
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/adl-agent-id.js +34 -0
- package/package.json +8 -0
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// adl-agent-id npm wrapper bin: resolves the platform package for this
|
|
3
|
+
// machine (one of the optionalDependencies of @amsterdamdatalabs/adl-agent-id)
|
|
4
|
+
// and execs its binary. Platform packages carry os/cpu fields so npm only
|
|
5
|
+
// installs the matching one.
|
|
6
|
+
const { spawnSync } = require('node:child_process');
|
|
7
|
+
|
|
8
|
+
function platformPackage() {
|
|
9
|
+
const os = process.platform; // darwin | linux
|
|
10
|
+
const arch = process.arch; // arm64 | x64
|
|
11
|
+
if ((os !== 'darwin' && os !== 'linux') || (arch !== 'arm64' && arch !== 'x64')) {
|
|
12
|
+
throw new Error(`adl-agent-id: no prebuilt binary for ${os}/${arch}`);
|
|
13
|
+
}
|
|
14
|
+
return `@amsterdamdatalabs/adl-agent-id-${os}-${arch}`;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
let pkgDir;
|
|
18
|
+
try {
|
|
19
|
+
pkgDir = require.resolve(`${platformPackage()}/package.json`);
|
|
20
|
+
} catch {
|
|
21
|
+
console.error(
|
|
22
|
+
`adl-agent-id: platform package ${platformPackage()} is not installed.\n` +
|
|
23
|
+
'Reinstall: npm install -g @amsterdamdatalabs/adl-agent-id'
|
|
24
|
+
);
|
|
25
|
+
process.exit(1);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
const bin = require('node:path').join(require('node:path').dirname(pkgDir), 'bin', 'adl-agent-id');
|
|
29
|
+
const r = spawnSync(bin, process.argv.slice(2), { stdio: 'inherit' });
|
|
30
|
+
if (r.error) {
|
|
31
|
+
console.error(`adl-agent-id: failed to run ${bin}: ${r.error.message}`);
|
|
32
|
+
process.exit(1);
|
|
33
|
+
}
|
|
34
|
+
process.exit(r.status === null ? 1 : r.status);
|
package/package.json
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@amsterdamdatalabs/adl-agent-id",
|
|
3
|
+
"version": "0.0.4789",
|
|
4
|
+
"description": "adl-agent-id — one CLI drives the whole agent identity lifecycle (passports, delegations, vault sessions)",
|
|
5
|
+
"license": "UNLICENSED",
|
|
6
|
+
"bin": { "adl-agent-id": "bin/adl-agent-id.js" },
|
|
7
|
+
"optionalDependencies": { "@amsterdamdatalabs/adl-agent-id-darwin-arm64": "0.0.4789", "@amsterdamdatalabs/adl-agent-id-darwin-amd64": "0.0.4789", "@amsterdamdatalabs/adl-agent-id-linux-amd64": "0.0.4789", "@amsterdamdatalabs/adl-agent-id-linux-arm64": "0.0.4789" }
|
|
8
|
+
}
|