lockpicks 0.7.0 → 0.8.0-go.8

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.
@@ -0,0 +1,105 @@
1
+ #!/usr/bin/env node
2
+ // The `lockpicks` npm shim for the Go build of the Lockpick CLI: it finds the
3
+ // platform package npm installed (`@lockpicks/cli-<os>-<cpu>`, an optional
4
+ // dependency) and runs its binary.
5
+ // It has no install scripts. LOCKPICK_LAUNCH tells the binary how it was
6
+ // launched, decided from this script's path exactly as the TypeScript CLI's
7
+ // launchKind decides it from its own.
8
+ 'use strict';
9
+
10
+ const { spawn } = require('node:child_process');
11
+ const { realpathSync } = require('node:fs');
12
+ const { delimiter, join, sep } = require('node:path');
13
+
14
+ const PACKAGE_DIR = `${sep}lockpicks${sep}`;
15
+
16
+ function real(path) {
17
+ try {
18
+ return realpathSync(path);
19
+ } catch {
20
+ return null;
21
+ }
22
+ }
23
+
24
+ function launchKind(script, pathEnv) {
25
+ const self = real(script) ?? script;
26
+ const parts = self.split(sep);
27
+ const installed = parts.includes('node_modules');
28
+ const onPath = pathEnv.split(delimiter).some((dir) => {
29
+ const found =
30
+ dir && !dir.split(sep).includes('node_modules')
31
+ ? real(join(dir, 'lockpick'))
32
+ : null;
33
+ return (
34
+ found !== null &&
35
+ (found === self || (installed && found.includes(PACKAGE_DIR)))
36
+ );
37
+ });
38
+ if (onPath) return 'path';
39
+ if (parts.includes('_npx')) return 'npx';
40
+ return installed ? 'package' : 'checkout';
41
+ }
42
+
43
+ const target = `@lockpicks/cli-${process.platform}-${process.arch}`;
44
+ let binary;
45
+ try {
46
+ binary = join(
47
+ require.resolve(`${target}/package.json`).slice(0, -'package.json'.length),
48
+ 'bin',
49
+ process.platform === 'win32' ? 'lockpick.exe' : 'lockpick'
50
+ );
51
+ } catch {
52
+ // npm installs the binary as an optional dependency. `--omit=optional`,
53
+ // `--no-optional`, an `omit=optional` npmrc or a mirror without the
54
+ // platform package skip it; anything else has no build at all.
55
+ const { version, optionalDependencies } = require('../package.json');
56
+ process.stderr.write(
57
+ target in (optionalDependencies ?? {})
58
+ ? `✖ Lockpick's binary for ${process.platform}-${process.arch} (the npm package ${target}) is not installed.\n` +
59
+ 'npm skips it when optional dependencies are turned off (--omit=optional, --no-optional or omit=optional in an npmrc),\n' +
60
+ 'or when a registry mirror does not carry it. Reinstall with optional dependencies:\n' +
61
+ ` npm install -g lockpicks@${version} --include=optional (a global install)\n` +
62
+ ` npm install lockpicks@${version} --include=optional (in a project)\n` +
63
+ `If it is still missing, check \`npm config get omit\` and that your registry serves ${target}.\n`
64
+ : `✖ Lockpick has no build for ${process.platform}-${process.arch}.\n` +
65
+ 'The Node.js build of the CLI runs anywhere Node.js does: npm install -g lockpicks@0.7\n'
66
+ );
67
+ process.exit(1);
68
+ }
69
+
70
+ // The binary runs as a child so this launcher can pass on what reaches it:
71
+ // SIGINT, SIGTERM and SIGHUP (and Ctrl+Break on Windows) go to the binary,
72
+ // this process exits with the binary's code or signal, and the binary is
73
+ // killed if this process exits first. LOCKPICK_LAUNCHER_PID lets the binary
74
+ // stop on its own when this process is killed outright (SIGKILL, taskkill /F).
75
+ const child = spawn(binary, process.argv.slice(2), {
76
+ stdio: 'inherit',
77
+ env: {
78
+ ...process.env,
79
+ LOCKPICK_LAUNCH: launchKind(process.argv[1] ?? '', process.env.PATH ?? ''),
80
+ LOCKPICK_LAUNCHER_PID: String(process.pid),
81
+ },
82
+ });
83
+ const forwarded = ['SIGINT', 'SIGTERM', 'SIGHUP'];
84
+ if (process.platform === 'win32') forwarded.push('SIGBREAK');
85
+ for (const signal of forwarded)
86
+ process.on(signal, () => {
87
+ if (child.exitCode === null && child.signalCode === null)
88
+ child.kill(signal);
89
+ });
90
+ process.on('exit', () => {
91
+ if (child.exitCode === null && child.signalCode === null) child.kill();
92
+ });
93
+ child.on('error', (error) => {
94
+ process.stderr.write(`✖ Could not start ${binary}: ${error.message}\n`);
95
+ process.exit(1);
96
+ });
97
+ child.on('exit', (code, signal) => {
98
+ if (signal) {
99
+ // Die of the same signal, so the shell sees what the binary saw.
100
+ for (const name of forwarded) process.removeAllListeners(name);
101
+ process.kill(process.pid, signal);
102
+ return;
103
+ }
104
+ process.exit(code ?? 1);
105
+ });
package/package.json CHANGED
@@ -1,7 +1,18 @@
1
1
  {
2
- "name": "lockpicks",
3
- "version": "0.7.0",
2
+ "bin": {
3
+ "lockpick": "bin/lockpick.cjs",
4
+ "lockpicks": "bin/lockpick.cjs"
5
+ },
4
6
  "description": "Lockpick from the terminal: device login, project status, findings, repair briefs, Pulse scans and an MCP server for coding agents",
7
+ "engines": {
8
+ "node": "\u003e=20.9.0"
9
+ },
10
+ "files": [
11
+ "bin",
12
+ "README.md",
13
+ "LICENSE",
14
+ "THIRD-PARTY-NOTICES.txt"
15
+ ],
5
16
  "keywords": [
6
17
  "lockpick",
7
18
  "security",
@@ -9,22 +20,19 @@
9
20
  "cli",
10
21
  "box"
11
22
  ],
12
- "type": "module",
13
- "bin": {
14
- "lockpick": "./dist/lockpick.mjs",
15
- "lockpicks": "./dist/lockpick.mjs"
16
- },
17
- "files": [
18
- "dist",
19
- "README.md",
20
- "LICENSE",
21
- "THIRD-PARTY-NOTICES.txt"
22
- ],
23
- "dependencies": {
24
- "@napi-rs/keyring": "^2.1.0"
23
+ "license": "SEE LICENSE IN LICENSE",
24
+ "name": "lockpicks",
25
+ "optionalDependencies": {
26
+ "@lockpicks/cli-darwin-arm64": "0.8.0-go.8",
27
+ "@lockpicks/cli-darwin-x64": "0.8.0-go.8",
28
+ "@lockpicks/cli-linux-arm": "0.8.0-go.8",
29
+ "@lockpicks/cli-linux-arm64": "0.8.0-go.8",
30
+ "@lockpicks/cli-linux-x64": "0.8.0-go.8",
31
+ "@lockpicks/cli-win32-arm64": "0.8.0-go.8",
32
+ "@lockpicks/cli-win32-x64": "0.8.0-go.8"
25
33
  },
26
- "engines": {
27
- "node": ">=20.9.0"
34
+ "publishConfig": {
35
+ "tag": "next"
28
36
  },
29
- "license": "SEE LICENSE IN LICENSE"
30
- }
37
+ "version": "0.8.0-go.8"
38
+ }
@@ -1,37 +0,0 @@
1
- {
2
- "schemaVersion": 1,
3
- "platform": "darwin",
4
- "arch": "arm64",
5
- "nodeApiVersion": 8,
6
- "nodeHeadersVersion": "20.9.0",
7
- "compiler": "Apple clang version 17.0.0 (clang-1700.0.13.5)",
8
- "compilerSha256": "7f30f076d0e9c38f772a76449fca9da8cf97f6a3d43b94c90a00e4f9ce7ad39e",
9
- "compilerArguments": [
10
- "-std=c11",
11
- "-O2",
12
- "-Wall",
13
- "-Wextra",
14
- "-Werror",
15
- "-fPIC",
16
- "-D_POSIX_C_SOURCE=200809L",
17
- "-D_DARWIN_C_SOURCE=1",
18
- "-D_DEFAULT_SOURCE=1",
19
- "-DNAPI_VERSION=8",
20
- "-I<node-headers>",
21
- "-bundle",
22
- "-undefined",
23
- "dynamic_lookup",
24
- "<safe-io.c>",
25
- "-o",
26
- "<native-artifact>"
27
- ],
28
- "sourceSha256": "90cccce979b991f5c0c33e6c286dc76bcb4e69b85c3c89156e9ec29a3dc606e4",
29
- "headers": {
30
- "node_api.h": "a5a3e1ff20963d44d92587376202d727d1daf2606dca96c082c876d3a322b5c5",
31
- "node_api_types.h": "8d5d854088d5725fec9775510e0aeeeb790a41ad083c49bb721d950b86e6bd61",
32
- "js_native_api.h": "94c40b848fca067b0f2bade48ee5cf162fbe379ea6edf6087f94faf41d827461",
33
- "js_native_api_types.h": "7d805521f313d58ab00395b55019dbee8fa71cee21ef89e09521998e879a97b4",
34
- "node_version.h": "5f8e3f33a99a8a220c3d56409e1e4b4a6143e43b3dff184b78828536b11b9ab8"
35
- },
36
- "binarySha256": "2d5efe59b1845a66a4516440d900f0fe6c0db7d9c471ddaed941d49071f16f26"
37
- }
Binary file
@@ -1,37 +0,0 @@
1
- {
2
- "schemaVersion": 1,
3
- "platform": "darwin",
4
- "arch": "x64",
5
- "nodeApiVersion": 8,
6
- "nodeHeadersVersion": "20.9.0",
7
- "compiler": "Apple clang version 17.0.0 (clang-1700.0.13.5)",
8
- "compilerSha256": "7f30f076d0e9c38f772a76449fca9da8cf97f6a3d43b94c90a00e4f9ce7ad39e",
9
- "compilerArguments": [
10
- "-std=c11",
11
- "-O2",
12
- "-Wall",
13
- "-Wextra",
14
- "-Werror",
15
- "-fPIC",
16
- "-D_POSIX_C_SOURCE=200809L",
17
- "-D_DARWIN_C_SOURCE=1",
18
- "-D_DEFAULT_SOURCE=1",
19
- "-DNAPI_VERSION=8",
20
- "-I<node-headers>",
21
- "-bundle",
22
- "-undefined",
23
- "dynamic_lookup",
24
- "<safe-io.c>",
25
- "-o",
26
- "<native-artifact>"
27
- ],
28
- "sourceSha256": "90cccce979b991f5c0c33e6c286dc76bcb4e69b85c3c89156e9ec29a3dc606e4",
29
- "headers": {
30
- "node_api.h": "a5a3e1ff20963d44d92587376202d727d1daf2606dca96c082c876d3a322b5c5",
31
- "node_api_types.h": "8d5d854088d5725fec9775510e0aeeeb790a41ad083c49bb721d950b86e6bd61",
32
- "js_native_api.h": "94c40b848fca067b0f2bade48ee5cf162fbe379ea6edf6087f94faf41d827461",
33
- "js_native_api_types.h": "7d805521f313d58ab00395b55019dbee8fa71cee21ef89e09521998e879a97b4",
34
- "node_version.h": "5f8e3f33a99a8a220c3d56409e1e4b4a6143e43b3dff184b78828536b11b9ab8"
35
- },
36
- "binarySha256": "5d8f57fc535c3beb540e622affc0acd2ce7a383c98355b8f7493534b03d0d984"
37
- }
Binary file
@@ -1,35 +0,0 @@
1
- {
2
- "schemaVersion": 1,
3
- "platform": "linux",
4
- "arch": "arm64",
5
- "nodeApiVersion": 8,
6
- "nodeHeadersVersion": "20.9.0",
7
- "compiler": "cc (Ubuntu 11.4.0-1ubuntu1~22.04.3) 11.4.0",
8
- "compilerSha256": "6c3baa3d21eea32b960de4ad2d366d484ce1dd837eb85f4904e656758bfa1a6b",
9
- "compilerArguments": [
10
- "-std=c11",
11
- "-O2",
12
- "-Wall",
13
- "-Wextra",
14
- "-Werror",
15
- "-fPIC",
16
- "-D_POSIX_C_SOURCE=200809L",
17
- "-D_DARWIN_C_SOURCE=1",
18
- "-D_DEFAULT_SOURCE=1",
19
- "-DNAPI_VERSION=8",
20
- "-I<node-headers>",
21
- "-shared",
22
- "<safe-io.c>",
23
- "-o",
24
- "<native-artifact>"
25
- ],
26
- "sourceSha256": "90cccce979b991f5c0c33e6c286dc76bcb4e69b85c3c89156e9ec29a3dc606e4",
27
- "headers": {
28
- "node_api.h": "a5a3e1ff20963d44d92587376202d727d1daf2606dca96c082c876d3a322b5c5",
29
- "node_api_types.h": "8d5d854088d5725fec9775510e0aeeeb790a41ad083c49bb721d950b86e6bd61",
30
- "js_native_api.h": "94c40b848fca067b0f2bade48ee5cf162fbe379ea6edf6087f94faf41d827461",
31
- "js_native_api_types.h": "7d805521f313d58ab00395b55019dbee8fa71cee21ef89e09521998e879a97b4",
32
- "node_version.h": "5f8e3f33a99a8a220c3d56409e1e4b4a6143e43b3dff184b78828536b11b9ab8"
33
- },
34
- "binarySha256": "5b4d74de3d5227b85ee1c3d19afc97c5f216c754dd74242d57e8c17869f13c5f"
35
- }
Binary file
@@ -1,35 +0,0 @@
1
- {
2
- "schemaVersion": 1,
3
- "platform": "linux",
4
- "arch": "x64",
5
- "nodeApiVersion": 8,
6
- "nodeHeadersVersion": "20.9.0",
7
- "compiler": "cc (Ubuntu 11.4.0-1ubuntu1~22.04.3) 11.4.0",
8
- "compilerSha256": "821af3c74506283c179ca413bb33e6b528805a4dd8a5c09df125e5ad560a9e89",
9
- "compilerArguments": [
10
- "-std=c11",
11
- "-O2",
12
- "-Wall",
13
- "-Wextra",
14
- "-Werror",
15
- "-fPIC",
16
- "-D_POSIX_C_SOURCE=200809L",
17
- "-D_DARWIN_C_SOURCE=1",
18
- "-D_DEFAULT_SOURCE=1",
19
- "-DNAPI_VERSION=8",
20
- "-I<node-headers>",
21
- "-shared",
22
- "<safe-io.c>",
23
- "-o",
24
- "<native-artifact>"
25
- ],
26
- "sourceSha256": "90cccce979b991f5c0c33e6c286dc76bcb4e69b85c3c89156e9ec29a3dc606e4",
27
- "headers": {
28
- "node_api.h": "a5a3e1ff20963d44d92587376202d727d1daf2606dca96c082c876d3a322b5c5",
29
- "node_api_types.h": "8d5d854088d5725fec9775510e0aeeeb790a41ad083c49bb721d950b86e6bd61",
30
- "js_native_api.h": "94c40b848fca067b0f2bade48ee5cf162fbe379ea6edf6087f94faf41d827461",
31
- "js_native_api_types.h": "7d805521f313d58ab00395b55019dbee8fa71cee21ef89e09521998e879a97b4",
32
- "node_version.h": "5f8e3f33a99a8a220c3d56409e1e4b4a6143e43b3dff184b78828536b11b9ab8"
33
- },
34
- "binarySha256": "4f497e60ffabb4f7c089a054fd086b815a827dbac7071aab6f662ce18dfda264"
35
- }