terminalhire 0.36.0 → 0.36.1
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 +1 -1
- package/dist/bin/claim-push-bg.js +0 -54
- package/dist/bin/jpi-bounties.js +4 -46
- package/dist/bin/jpi-chat-read.js +0 -55
- package/dist/bin/jpi-chat.js +7 -63
- package/dist/bin/jpi-claim.js +7 -63
- package/dist/bin/jpi-contribute.js +4 -46
- package/dist/bin/jpi-devs.js +4 -46
- package/dist/bin/jpi-dispatch.js +7 -40
- package/dist/bin/jpi-hub.js +4 -60
- package/dist/bin/jpi-inbox.js +7 -63
- package/dist/bin/jpi-intro.js +4 -46
- package/dist/bin/jpi-jobs.js +4 -46
- package/dist/bin/jpi-learn.js +4 -46
- package/dist/bin/jpi-login.js +7 -63
- package/dist/bin/jpi-mcp-chat.js +0 -31
- package/dist/bin/jpi-profile.js +4 -46
- package/dist/bin/jpi-refresh.js +4 -60
- package/dist/bin/jpi-repo.js +3 -45
- package/dist/bin/jpi-save.js +4 -46
- package/dist/bin/jpi-sync.js +4 -46
- package/dist/bin/jpi-trajectory.js +4 -46
- package/dist/src/chat-client.js +0 -57
- package/dist/src/chat-keystore.js +0 -57
- package/dist/src/crypto-store.js +4 -49
- package/dist/src/github-auth.js +0 -57
- package/dist/src/intro.js +4 -46
- package/dist/src/profile.js +4 -49
- package/dist/src/repo-experience.js +3 -48
- package/dist/src/trajectory.js +4 -46
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -212,7 +212,7 @@ GitHub (optional enrichment):
|
|
|
212
212
|
## Local profile encryption
|
|
213
213
|
|
|
214
214
|
- Algorithm: **AES-256-GCM** via Node built-in `crypto` (no external deps).
|
|
215
|
-
- Key: stored at `~/.terminalhire/key` with `0600` permissions.
|
|
215
|
+
- Key: stored at `~/.terminalhire/key` with `0600` permissions (a plaintext key file). In a compiled build the OS keychain is **not** used for these stores — the cross-platform plugin ships without `node_modules` and can't reach one. See `docs/adr-002` (keychain promotion is tracked as TERM-9).
|
|
216
216
|
- Profile file: `~/.terminalhire/profile.enc` — JSON blob `{ iv, tag, ciphertext }` (all hex-encoded).
|
|
217
217
|
- GitHub token file: `~/.terminalhire/github-token.enc` — same format, same key.
|
|
218
218
|
|
|
@@ -1,52 +1,12 @@
|
|
|
1
|
-
var __create = Object.create;
|
|
2
1
|
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
2
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
3
|
var __esm = (fn, res) => function __init() {
|
|
8
4
|
return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
|
|
9
5
|
};
|
|
10
|
-
var __commonJS = (cb, mod) => function __require() {
|
|
11
|
-
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
12
|
-
};
|
|
13
6
|
var __export = (target, all) => {
|
|
14
7
|
for (var name in all)
|
|
15
8
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
16
9
|
};
|
|
17
|
-
var __copyProps = (to, from, except, desc) => {
|
|
18
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
19
|
-
for (let key of __getOwnPropNames(from))
|
|
20
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
21
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
22
|
-
}
|
|
23
|
-
return to;
|
|
24
|
-
};
|
|
25
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
26
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
27
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
28
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
29
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
30
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
31
|
-
mod
|
|
32
|
-
));
|
|
33
|
-
|
|
34
|
-
// ../../node_modules/keytar/lib/keytar.js
|
|
35
|
-
var require_keytar = __commonJS({
|
|
36
|
-
"../../node_modules/keytar/lib/keytar.js"(exports, module) {
|
|
37
|
-
"use strict";
|
|
38
|
-
function disabled() {
|
|
39
|
-
throw new Error("keytar disabled in this dev checkout (keychain popup guard) \u2014 key-file fallback expected");
|
|
40
|
-
}
|
|
41
|
-
module.exports = {
|
|
42
|
-
getPassword: disabled,
|
|
43
|
-
setPassword: disabled,
|
|
44
|
-
deletePassword: disabled,
|
|
45
|
-
findPassword: disabled,
|
|
46
|
-
findCredentials: disabled
|
|
47
|
-
};
|
|
48
|
-
}
|
|
49
|
-
});
|
|
50
10
|
|
|
51
11
|
// src/claims.ts
|
|
52
12
|
var claims_exports = {};
|
|
@@ -259,21 +219,7 @@ var KEY_FILE = join(TERMINALHIRE_DIR, "key");
|
|
|
259
219
|
var ALGO = "aes-256-gcm";
|
|
260
220
|
var KEY_BYTES = 32;
|
|
261
221
|
var IV_BYTES = 12;
|
|
262
|
-
function skipKeychain() {
|
|
263
|
-
return process.env.TERMINALHIRE_NO_KEYCHAIN !== void 0 || process.env.CI !== void 0 || process.env.VITEST !== void 0 || process.env.NODE_ENV === "test";
|
|
264
|
-
}
|
|
265
222
|
async function loadKey() {
|
|
266
|
-
if (!skipKeychain()) {
|
|
267
|
-
try {
|
|
268
|
-
const kt = await Promise.resolve().then(() => __toESM(require_keytar(), 1));
|
|
269
|
-
const stored = await kt.getPassword("terminalhire", "profile-key");
|
|
270
|
-
if (stored) return Buffer.from(stored, "hex");
|
|
271
|
-
const key2 = randomBytes(KEY_BYTES);
|
|
272
|
-
await kt.setPassword("terminalhire", "profile-key", key2.toString("hex"));
|
|
273
|
-
return key2;
|
|
274
|
-
} catch {
|
|
275
|
-
}
|
|
276
|
-
}
|
|
277
223
|
mkdirSync(TERMINALHIRE_DIR, { recursive: true, mode: 448 });
|
|
278
224
|
if (existsSync(KEY_FILE)) {
|
|
279
225
|
return Buffer.from(readFileSync(KEY_FILE, "utf8").trim(), "hex");
|
package/dist/bin/jpi-bounties.js
CHANGED
|
@@ -1,36 +1,13 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
var __create = Object.create;
|
|
3
2
|
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
3
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
4
|
var __esm = (fn, res) => function __init() {
|
|
9
5
|
return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
|
|
10
6
|
};
|
|
11
|
-
var __commonJS = (cb, mod2) => function __require() {
|
|
12
|
-
return mod2 || (0, cb[__getOwnPropNames(cb)[0]])((mod2 = { exports: {} }).exports, mod2), mod2.exports;
|
|
13
|
-
};
|
|
14
7
|
var __export = (target, all) => {
|
|
15
8
|
for (var name in all)
|
|
16
9
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
17
10
|
};
|
|
18
|
-
var __copyProps = (to, from, except, desc) => {
|
|
19
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
20
|
-
for (let key of __getOwnPropNames(from))
|
|
21
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
22
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
23
|
-
}
|
|
24
|
-
return to;
|
|
25
|
-
};
|
|
26
|
-
var __toESM = (mod2, isNodeMode, target) => (target = mod2 != null ? __create(__getProtoOf(mod2)) : {}, __copyProps(
|
|
27
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
28
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
29
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
30
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
31
|
-
isNodeMode || !mod2 || !mod2.__esModule ? __defProp(target, "default", { value: mod2, enumerable: true }) : target,
|
|
32
|
-
mod2
|
|
33
|
-
));
|
|
34
11
|
|
|
35
12
|
// ../../packages/core/src/types.ts
|
|
36
13
|
function isBounty(job) {
|
|
@@ -8543,23 +8520,6 @@ var init_src = __esm({
|
|
|
8543
8520
|
}
|
|
8544
8521
|
});
|
|
8545
8522
|
|
|
8546
|
-
// ../../node_modules/keytar/lib/keytar.js
|
|
8547
|
-
var require_keytar = __commonJS({
|
|
8548
|
-
"../../node_modules/keytar/lib/keytar.js"(exports, module) {
|
|
8549
|
-
"use strict";
|
|
8550
|
-
function disabled() {
|
|
8551
|
-
throw new Error("keytar disabled in this dev checkout (keychain popup guard) \u2014 key-file fallback expected");
|
|
8552
|
-
}
|
|
8553
|
-
module.exports = {
|
|
8554
|
-
getPassword: disabled,
|
|
8555
|
-
setPassword: disabled,
|
|
8556
|
-
deletePassword: disabled,
|
|
8557
|
-
findPassword: disabled,
|
|
8558
|
-
findCredentials: disabled
|
|
8559
|
-
};
|
|
8560
|
-
}
|
|
8561
|
-
});
|
|
8562
|
-
|
|
8563
8523
|
// src/crypto-store.ts
|
|
8564
8524
|
import {
|
|
8565
8525
|
createCipheriv,
|
|
@@ -8604,10 +8564,10 @@ function decrypt(blob, key) {
|
|
|
8604
8564
|
function skipKeychain() {
|
|
8605
8565
|
return process.env.TERMINALHIRE_NO_KEYCHAIN !== void 0 || process.env.CI !== void 0 || process.env.VITEST !== void 0 || process.env.NODE_ENV === "test";
|
|
8606
8566
|
}
|
|
8607
|
-
async function tryLoadFromKeytar(
|
|
8567
|
+
async function tryLoadFromKeytar() {
|
|
8608
8568
|
if (forceKeytarUnavailableForTests || skipKeychain()) return null;
|
|
8609
8569
|
try {
|
|
8610
|
-
const kt =
|
|
8570
|
+
const kt = createRequire(import.meta.url)("keytar");
|
|
8611
8571
|
const stored = await kt.getPassword(KEYTAR_SERVICE, KEYTAR_ACCOUNT);
|
|
8612
8572
|
if (stored) {
|
|
8613
8573
|
return Buffer.from(stored, "hex");
|
|
@@ -8648,7 +8608,7 @@ async function deleteKey() {
|
|
|
8648
8608
|
}
|
|
8649
8609
|
if (!forceKeytarUnavailableForTests && !skipKeychain()) {
|
|
8650
8610
|
try {
|
|
8651
|
-
const kt =
|
|
8611
|
+
const kt = createRequire(import.meta.url)("keytar");
|
|
8652
8612
|
await kt.deletePassword(KEYTAR_SERVICE, KEYTAR_ACCOUNT);
|
|
8653
8613
|
} catch {
|
|
8654
8614
|
}
|
|
@@ -8660,15 +8620,13 @@ async function deleteKey() {
|
|
|
8660
8620
|
}
|
|
8661
8621
|
async function resolveKey(filePath, opts) {
|
|
8662
8622
|
if (opts.keyPolicy === "keychain-required") {
|
|
8663
|
-
const key = await tryLoadFromKeytar(
|
|
8623
|
+
const key = await tryLoadFromKeytar();
|
|
8664
8624
|
if (!key) {
|
|
8665
8625
|
warnStderr(`crypto-store: OS keychain unavailable \u2014 store at ${filePath} is disabled (no plaintext key file will be written)`);
|
|
8666
8626
|
return null;
|
|
8667
8627
|
}
|
|
8668
8628
|
return key;
|
|
8669
8629
|
}
|
|
8670
|
-
const fromKeytar = await tryLoadFromKeytar("keytar-first-file-fallback");
|
|
8671
|
-
if (fromKeytar) return fromKeytar;
|
|
8672
8630
|
return loadOrCreateFileKey();
|
|
8673
8631
|
}
|
|
8674
8632
|
function createEncryptedStore(filePath, opts) {
|
|
@@ -1,32 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
var __create = Object.create;
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
2
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
3
|
var __esm = (fn, res) => function __init() {
|
|
9
4
|
return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
|
|
10
5
|
};
|
|
11
|
-
var __commonJS = (cb, mod2) => function __require() {
|
|
12
|
-
return mod2 || (0, cb[__getOwnPropNames(cb)[0]])((mod2 = { exports: {} }).exports, mod2), mod2.exports;
|
|
13
|
-
};
|
|
14
|
-
var __copyProps = (to, from, except, desc) => {
|
|
15
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
16
|
-
for (let key of __getOwnPropNames(from))
|
|
17
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
18
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
19
|
-
}
|
|
20
|
-
return to;
|
|
21
|
-
};
|
|
22
|
-
var __toESM = (mod2, isNodeMode, target) => (target = mod2 != null ? __create(__getProtoOf(mod2)) : {}, __copyProps(
|
|
23
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
24
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
25
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
26
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
27
|
-
isNodeMode || !mod2 || !mod2.__esModule ? __defProp(target, "default", { value: mod2, enumerable: true }) : target,
|
|
28
|
-
mod2
|
|
29
|
-
));
|
|
30
6
|
|
|
31
7
|
// ../../packages/core/src/types.ts
|
|
32
8
|
var init_types = __esm({
|
|
@@ -4122,23 +4098,6 @@ var init_src = __esm({
|
|
|
4122
4098
|
}
|
|
4123
4099
|
});
|
|
4124
4100
|
|
|
4125
|
-
// ../../node_modules/keytar/lib/keytar.js
|
|
4126
|
-
var require_keytar = __commonJS({
|
|
4127
|
-
"../../node_modules/keytar/lib/keytar.js"(exports, module) {
|
|
4128
|
-
"use strict";
|
|
4129
|
-
function disabled() {
|
|
4130
|
-
throw new Error("keytar disabled in this dev checkout (keychain popup guard) \u2014 key-file fallback expected");
|
|
4131
|
-
}
|
|
4132
|
-
module.exports = {
|
|
4133
|
-
getPassword: disabled,
|
|
4134
|
-
setPassword: disabled,
|
|
4135
|
-
deletePassword: disabled,
|
|
4136
|
-
findPassword: disabled,
|
|
4137
|
-
findCredentials: disabled
|
|
4138
|
-
};
|
|
4139
|
-
}
|
|
4140
|
-
});
|
|
4141
|
-
|
|
4142
4101
|
// src/github-auth.ts
|
|
4143
4102
|
import {
|
|
4144
4103
|
createCipheriv,
|
|
@@ -4155,21 +4114,7 @@ import {
|
|
|
4155
4114
|
} from "fs";
|
|
4156
4115
|
import { join as join2 } from "path";
|
|
4157
4116
|
import { homedir } from "os";
|
|
4158
|
-
function skipKeychain() {
|
|
4159
|
-
return process.env.TERMINALHIRE_NO_KEYCHAIN !== void 0 || process.env.CI !== void 0 || process.env.VITEST !== void 0 || process.env.NODE_ENV === "test";
|
|
4160
|
-
}
|
|
4161
4117
|
async function loadKey() {
|
|
4162
|
-
if (!skipKeychain()) {
|
|
4163
|
-
try {
|
|
4164
|
-
const kt = await Promise.resolve().then(() => __toESM(require_keytar(), 1));
|
|
4165
|
-
const stored = await kt.getPassword("terminalhire", "profile-key");
|
|
4166
|
-
if (stored) return Buffer.from(stored, "hex");
|
|
4167
|
-
const key2 = randomBytes3(KEY_BYTES);
|
|
4168
|
-
await kt.setPassword("terminalhire", "profile-key", key2.toString("hex"));
|
|
4169
|
-
return key2;
|
|
4170
|
-
} catch {
|
|
4171
|
-
}
|
|
4172
|
-
}
|
|
4173
4118
|
mkdirSync(TERMINALHIRE_DIR, { recursive: true, mode: 448 });
|
|
4174
4119
|
if (existsSync(KEY_FILE)) {
|
|
4175
4120
|
return Buffer.from(readFileSync2(KEY_FILE, "utf8").trim(), "hex");
|
package/dist/bin/jpi-chat.js
CHANGED
|
@@ -1,36 +1,13 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
var __create = Object.create;
|
|
3
2
|
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
3
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
4
|
var __esm = (fn, res) => function __init() {
|
|
9
5
|
return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
|
|
10
6
|
};
|
|
11
|
-
var __commonJS = (cb, mod2) => function __require() {
|
|
12
|
-
return mod2 || (0, cb[__getOwnPropNames(cb)[0]])((mod2 = { exports: {} }).exports, mod2), mod2.exports;
|
|
13
|
-
};
|
|
14
7
|
var __export = (target, all) => {
|
|
15
8
|
for (var name in all)
|
|
16
9
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
17
10
|
};
|
|
18
|
-
var __copyProps = (to, from, except, desc) => {
|
|
19
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
20
|
-
for (let key of __getOwnPropNames(from))
|
|
21
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
22
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
23
|
-
}
|
|
24
|
-
return to;
|
|
25
|
-
};
|
|
26
|
-
var __toESM = (mod2, isNodeMode, target) => (target = mod2 != null ? __create(__getProtoOf(mod2)) : {}, __copyProps(
|
|
27
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
28
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
29
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
30
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
31
|
-
isNodeMode || !mod2 || !mod2.__esModule ? __defProp(target, "default", { value: mod2, enumerable: true }) : target,
|
|
32
|
-
mod2
|
|
33
|
-
));
|
|
34
11
|
|
|
35
12
|
// ../../packages/core/src/types.ts
|
|
36
13
|
var init_types = __esm({
|
|
@@ -4150,23 +4127,6 @@ var init_src = __esm({
|
|
|
4150
4127
|
}
|
|
4151
4128
|
});
|
|
4152
4129
|
|
|
4153
|
-
// ../../node_modules/keytar/lib/keytar.js
|
|
4154
|
-
var require_keytar = __commonJS({
|
|
4155
|
-
"../../node_modules/keytar/lib/keytar.js"(exports, module) {
|
|
4156
|
-
"use strict";
|
|
4157
|
-
function disabled() {
|
|
4158
|
-
throw new Error("keytar disabled in this dev checkout (keychain popup guard) \u2014 key-file fallback expected");
|
|
4159
|
-
}
|
|
4160
|
-
module.exports = {
|
|
4161
|
-
getPassword: disabled,
|
|
4162
|
-
setPassword: disabled,
|
|
4163
|
-
deletePassword: disabled,
|
|
4164
|
-
findPassword: disabled,
|
|
4165
|
-
findCredentials: disabled
|
|
4166
|
-
};
|
|
4167
|
-
}
|
|
4168
|
-
});
|
|
4169
|
-
|
|
4170
4130
|
// src/github-auth.ts
|
|
4171
4131
|
import {
|
|
4172
4132
|
createCipheriv,
|
|
@@ -4183,21 +4143,7 @@ import {
|
|
|
4183
4143
|
} from "fs";
|
|
4184
4144
|
import { join as join2 } from "path";
|
|
4185
4145
|
import { homedir } from "os";
|
|
4186
|
-
function skipKeychain() {
|
|
4187
|
-
return process.env.TERMINALHIRE_NO_KEYCHAIN !== void 0 || process.env.CI !== void 0 || process.env.VITEST !== void 0 || process.env.NODE_ENV === "test";
|
|
4188
|
-
}
|
|
4189
4146
|
async function loadKey() {
|
|
4190
|
-
if (!skipKeychain()) {
|
|
4191
|
-
try {
|
|
4192
|
-
const kt = await Promise.resolve().then(() => __toESM(require_keytar(), 1));
|
|
4193
|
-
const stored = await kt.getPassword("terminalhire", "profile-key");
|
|
4194
|
-
if (stored) return Buffer.from(stored, "hex");
|
|
4195
|
-
const key2 = randomBytes3(KEY_BYTES);
|
|
4196
|
-
await kt.setPassword("terminalhire", "profile-key", key2.toString("hex"));
|
|
4197
|
-
return key2;
|
|
4198
|
-
} catch {
|
|
4199
|
-
}
|
|
4200
|
-
}
|
|
4201
4147
|
mkdirSync(TERMINALHIRE_DIR, { recursive: true, mode: 448 });
|
|
4202
4148
|
if (existsSync(KEY_FILE)) {
|
|
4203
4149
|
return Buffer.from(readFileSync2(KEY_FILE, "utf8").trim(), "hex");
|
|
@@ -5087,13 +5033,13 @@ function decrypt2(blob, key) {
|
|
|
5087
5033
|
]);
|
|
5088
5034
|
return plain.toString("utf8");
|
|
5089
5035
|
}
|
|
5090
|
-
function
|
|
5036
|
+
function skipKeychain() {
|
|
5091
5037
|
return process.env.TERMINALHIRE_NO_KEYCHAIN !== void 0 || process.env.CI !== void 0 || process.env.VITEST !== void 0 || process.env.NODE_ENV === "test";
|
|
5092
5038
|
}
|
|
5093
|
-
async function tryLoadFromKeytar(
|
|
5094
|
-
if (forceKeytarUnavailableForTests ||
|
|
5039
|
+
async function tryLoadFromKeytar() {
|
|
5040
|
+
if (forceKeytarUnavailableForTests || skipKeychain()) return null;
|
|
5095
5041
|
try {
|
|
5096
|
-
const kt =
|
|
5042
|
+
const kt = createRequire(import.meta.url)("keytar");
|
|
5097
5043
|
const stored = await kt.getPassword(KEYTAR_SERVICE, KEYTAR_ACCOUNT);
|
|
5098
5044
|
if (stored) {
|
|
5099
5045
|
return Buffer.from(stored, "hex");
|
|
@@ -5132,9 +5078,9 @@ async function deleteKey() {
|
|
|
5132
5078
|
} catch {
|
|
5133
5079
|
}
|
|
5134
5080
|
}
|
|
5135
|
-
if (!forceKeytarUnavailableForTests && !
|
|
5081
|
+
if (!forceKeytarUnavailableForTests && !skipKeychain()) {
|
|
5136
5082
|
try {
|
|
5137
|
-
const kt =
|
|
5083
|
+
const kt = createRequire(import.meta.url)("keytar");
|
|
5138
5084
|
await kt.deletePassword(KEYTAR_SERVICE, KEYTAR_ACCOUNT);
|
|
5139
5085
|
} catch {
|
|
5140
5086
|
}
|
|
@@ -5146,15 +5092,13 @@ async function deleteKey() {
|
|
|
5146
5092
|
}
|
|
5147
5093
|
async function resolveKey(filePath, opts) {
|
|
5148
5094
|
if (opts.keyPolicy === "keychain-required") {
|
|
5149
|
-
const key = await tryLoadFromKeytar(
|
|
5095
|
+
const key = await tryLoadFromKeytar();
|
|
5150
5096
|
if (!key) {
|
|
5151
5097
|
warnStderr(`crypto-store: OS keychain unavailable \u2014 store at ${filePath} is disabled (no plaintext key file will be written)`);
|
|
5152
5098
|
return null;
|
|
5153
5099
|
}
|
|
5154
5100
|
return key;
|
|
5155
5101
|
}
|
|
5156
|
-
const fromKeytar = await tryLoadFromKeytar("keytar-first-file-fallback");
|
|
5157
|
-
if (fromKeytar) return fromKeytar;
|
|
5158
5102
|
return loadOrCreateFileKey();
|
|
5159
5103
|
}
|
|
5160
5104
|
function createEncryptedStore(filePath, opts) {
|
package/dist/bin/jpi-claim.js
CHANGED
|
@@ -1,36 +1,13 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
var __create = Object.create;
|
|
3
2
|
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
3
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
4
|
var __esm = (fn, res) => function __init() {
|
|
9
5
|
return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
|
|
10
6
|
};
|
|
11
|
-
var __commonJS = (cb, mod2) => function __require() {
|
|
12
|
-
return mod2 || (0, cb[__getOwnPropNames(cb)[0]])((mod2 = { exports: {} }).exports, mod2), mod2.exports;
|
|
13
|
-
};
|
|
14
7
|
var __export = (target, all) => {
|
|
15
8
|
for (var name in all)
|
|
16
9
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
17
10
|
};
|
|
18
|
-
var __copyProps = (to, from, except, desc) => {
|
|
19
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
20
|
-
for (let key of __getOwnPropNames(from))
|
|
21
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
22
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
23
|
-
}
|
|
24
|
-
return to;
|
|
25
|
-
};
|
|
26
|
-
var __toESM = (mod2, isNodeMode, target) => (target = mod2 != null ? __create(__getProtoOf(mod2)) : {}, __copyProps(
|
|
27
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
28
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
29
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
30
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
31
|
-
isNodeMode || !mod2 || !mod2.__esModule ? __defProp(target, "default", { value: mod2, enumerable: true }) : target,
|
|
32
|
-
mod2
|
|
33
|
-
));
|
|
34
11
|
|
|
35
12
|
// ../../packages/core/src/types.ts
|
|
36
13
|
function isBounty(job) {
|
|
@@ -8726,23 +8703,6 @@ var init_claims = __esm({
|
|
|
8726
8703
|
}
|
|
8727
8704
|
});
|
|
8728
8705
|
|
|
8729
|
-
// ../../node_modules/keytar/lib/keytar.js
|
|
8730
|
-
var require_keytar = __commonJS({
|
|
8731
|
-
"../../node_modules/keytar/lib/keytar.js"(exports, module) {
|
|
8732
|
-
"use strict";
|
|
8733
|
-
function disabled() {
|
|
8734
|
-
throw new Error("keytar disabled in this dev checkout (keychain popup guard) \u2014 key-file fallback expected");
|
|
8735
|
-
}
|
|
8736
|
-
module.exports = {
|
|
8737
|
-
getPassword: disabled,
|
|
8738
|
-
setPassword: disabled,
|
|
8739
|
-
deletePassword: disabled,
|
|
8740
|
-
findPassword: disabled,
|
|
8741
|
-
findCredentials: disabled
|
|
8742
|
-
};
|
|
8743
|
-
}
|
|
8744
|
-
});
|
|
8745
|
-
|
|
8746
8706
|
// src/repo-policy.ts
|
|
8747
8707
|
var repo_policy_exports = {};
|
|
8748
8708
|
__export(repo_policy_exports, {
|
|
@@ -8940,13 +8900,13 @@ function decrypt2(blob, key) {
|
|
|
8940
8900
|
]);
|
|
8941
8901
|
return plain.toString("utf8");
|
|
8942
8902
|
}
|
|
8943
|
-
function
|
|
8903
|
+
function skipKeychain() {
|
|
8944
8904
|
return process.env.TERMINALHIRE_NO_KEYCHAIN !== void 0 || process.env.CI !== void 0 || process.env.VITEST !== void 0 || process.env.NODE_ENV === "test";
|
|
8945
8905
|
}
|
|
8946
|
-
async function tryLoadFromKeytar(
|
|
8947
|
-
if (forceKeytarUnavailableForTests ||
|
|
8906
|
+
async function tryLoadFromKeytar() {
|
|
8907
|
+
if (forceKeytarUnavailableForTests || skipKeychain()) return null;
|
|
8948
8908
|
try {
|
|
8949
|
-
const kt =
|
|
8909
|
+
const kt = createRequire(import.meta.url)("keytar");
|
|
8950
8910
|
const stored = await kt.getPassword(KEYTAR_SERVICE, KEYTAR_ACCOUNT);
|
|
8951
8911
|
if (stored) {
|
|
8952
8912
|
return Buffer.from(stored, "hex");
|
|
@@ -8985,9 +8945,9 @@ async function deleteKey() {
|
|
|
8985
8945
|
} catch {
|
|
8986
8946
|
}
|
|
8987
8947
|
}
|
|
8988
|
-
if (!forceKeytarUnavailableForTests && !
|
|
8948
|
+
if (!forceKeytarUnavailableForTests && !skipKeychain()) {
|
|
8989
8949
|
try {
|
|
8990
|
-
const kt =
|
|
8950
|
+
const kt = createRequire(import.meta.url)("keytar");
|
|
8991
8951
|
await kt.deletePassword(KEYTAR_SERVICE, KEYTAR_ACCOUNT);
|
|
8992
8952
|
} catch {
|
|
8993
8953
|
}
|
|
@@ -8999,15 +8959,13 @@ async function deleteKey() {
|
|
|
8999
8959
|
}
|
|
9000
8960
|
async function resolveKey(filePath, opts) {
|
|
9001
8961
|
if (opts.keyPolicy === "keychain-required") {
|
|
9002
|
-
const key = await tryLoadFromKeytar(
|
|
8962
|
+
const key = await tryLoadFromKeytar();
|
|
9003
8963
|
if (!key) {
|
|
9004
8964
|
warnStderr(`crypto-store: OS keychain unavailable \u2014 store at ${filePath} is disabled (no plaintext key file will be written)`);
|
|
9005
8965
|
return null;
|
|
9006
8966
|
}
|
|
9007
8967
|
return key;
|
|
9008
8968
|
}
|
|
9009
|
-
const fromKeytar = await tryLoadFromKeytar("keytar-first-file-fallback");
|
|
9010
|
-
if (fromKeytar) return fromKeytar;
|
|
9011
8969
|
return loadOrCreateFileKey();
|
|
9012
8970
|
}
|
|
9013
8971
|
function createEncryptedStore(filePath, opts) {
|
|
@@ -9833,21 +9791,7 @@ var KEY_FILE = join3(TERMINALHIRE_DIR2, "key");
|
|
|
9833
9791
|
var ALGO = "aes-256-gcm";
|
|
9834
9792
|
var KEY_BYTES = 32;
|
|
9835
9793
|
var IV_BYTES = 12;
|
|
9836
|
-
function skipKeychain() {
|
|
9837
|
-
return process.env.TERMINALHIRE_NO_KEYCHAIN !== void 0 || process.env.CI !== void 0 || process.env.VITEST !== void 0 || process.env.NODE_ENV === "test";
|
|
9838
|
-
}
|
|
9839
9794
|
async function loadKey() {
|
|
9840
|
-
if (!skipKeychain()) {
|
|
9841
|
-
try {
|
|
9842
|
-
const kt = await Promise.resolve().then(() => __toESM(require_keytar(), 1));
|
|
9843
|
-
const stored = await kt.getPassword("terminalhire", "profile-key");
|
|
9844
|
-
if (stored) return Buffer.from(stored, "hex");
|
|
9845
|
-
const key2 = randomBytes4(KEY_BYTES);
|
|
9846
|
-
await kt.setPassword("terminalhire", "profile-key", key2.toString("hex"));
|
|
9847
|
-
return key2;
|
|
9848
|
-
} catch {
|
|
9849
|
-
}
|
|
9850
|
-
}
|
|
9851
9795
|
mkdirSync2(TERMINALHIRE_DIR2, { recursive: true, mode: 448 });
|
|
9852
9796
|
if (existsSync2(KEY_FILE)) {
|
|
9853
9797
|
return Buffer.from(readFileSync3(KEY_FILE, "utf8").trim(), "hex");
|
|
@@ -1,36 +1,13 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
var __create = Object.create;
|
|
3
2
|
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
3
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
4
|
var __esm = (fn, res) => function __init() {
|
|
9
5
|
return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
|
|
10
6
|
};
|
|
11
|
-
var __commonJS = (cb, mod) => function __require() {
|
|
12
|
-
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
13
|
-
};
|
|
14
7
|
var __export = (target, all) => {
|
|
15
8
|
for (var name in all)
|
|
16
9
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
17
10
|
};
|
|
18
|
-
var __copyProps = (to, from, except, desc) => {
|
|
19
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
20
|
-
for (let key of __getOwnPropNames(from))
|
|
21
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
22
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
23
|
-
}
|
|
24
|
-
return to;
|
|
25
|
-
};
|
|
26
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
27
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
28
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
29
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
30
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
31
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
32
|
-
mod
|
|
33
|
-
));
|
|
34
11
|
|
|
35
12
|
// ../../packages/core/src/types.ts
|
|
36
13
|
var init_types = __esm({
|
|
@@ -1492,23 +1469,6 @@ var init_src = __esm({
|
|
|
1492
1469
|
}
|
|
1493
1470
|
});
|
|
1494
1471
|
|
|
1495
|
-
// ../../node_modules/keytar/lib/keytar.js
|
|
1496
|
-
var require_keytar = __commonJS({
|
|
1497
|
-
"../../node_modules/keytar/lib/keytar.js"(exports, module) {
|
|
1498
|
-
"use strict";
|
|
1499
|
-
function disabled() {
|
|
1500
|
-
throw new Error("keytar disabled in this dev checkout (keychain popup guard) \u2014 key-file fallback expected");
|
|
1501
|
-
}
|
|
1502
|
-
module.exports = {
|
|
1503
|
-
getPassword: disabled,
|
|
1504
|
-
setPassword: disabled,
|
|
1505
|
-
deletePassword: disabled,
|
|
1506
|
-
findPassword: disabled,
|
|
1507
|
-
findCredentials: disabled
|
|
1508
|
-
};
|
|
1509
|
-
}
|
|
1510
|
-
});
|
|
1511
|
-
|
|
1512
1472
|
// src/crypto-store.ts
|
|
1513
1473
|
import {
|
|
1514
1474
|
createCipheriv,
|
|
@@ -1553,10 +1513,10 @@ function decrypt(blob, key) {
|
|
|
1553
1513
|
function skipKeychain() {
|
|
1554
1514
|
return process.env.TERMINALHIRE_NO_KEYCHAIN !== void 0 || process.env.CI !== void 0 || process.env.VITEST !== void 0 || process.env.NODE_ENV === "test";
|
|
1555
1515
|
}
|
|
1556
|
-
async function tryLoadFromKeytar(
|
|
1516
|
+
async function tryLoadFromKeytar() {
|
|
1557
1517
|
if (forceKeytarUnavailableForTests || skipKeychain()) return null;
|
|
1558
1518
|
try {
|
|
1559
|
-
const kt =
|
|
1519
|
+
const kt = createRequire(import.meta.url)("keytar");
|
|
1560
1520
|
const stored = await kt.getPassword(KEYTAR_SERVICE, KEYTAR_ACCOUNT);
|
|
1561
1521
|
if (stored) {
|
|
1562
1522
|
return Buffer.from(stored, "hex");
|
|
@@ -1597,7 +1557,7 @@ async function deleteKey() {
|
|
|
1597
1557
|
}
|
|
1598
1558
|
if (!forceKeytarUnavailableForTests && !skipKeychain()) {
|
|
1599
1559
|
try {
|
|
1600
|
-
const kt =
|
|
1560
|
+
const kt = createRequire(import.meta.url)("keytar");
|
|
1601
1561
|
await kt.deletePassword(KEYTAR_SERVICE, KEYTAR_ACCOUNT);
|
|
1602
1562
|
} catch {
|
|
1603
1563
|
}
|
|
@@ -1609,15 +1569,13 @@ async function deleteKey() {
|
|
|
1609
1569
|
}
|
|
1610
1570
|
async function resolveKey(filePath, opts) {
|
|
1611
1571
|
if (opts.keyPolicy === "keychain-required") {
|
|
1612
|
-
const key = await tryLoadFromKeytar(
|
|
1572
|
+
const key = await tryLoadFromKeytar();
|
|
1613
1573
|
if (!key) {
|
|
1614
1574
|
warnStderr(`crypto-store: OS keychain unavailable \u2014 store at ${filePath} is disabled (no plaintext key file will be written)`);
|
|
1615
1575
|
return null;
|
|
1616
1576
|
}
|
|
1617
1577
|
return key;
|
|
1618
1578
|
}
|
|
1619
|
-
const fromKeytar = await tryLoadFromKeytar("keytar-first-file-fallback");
|
|
1620
|
-
if (fromKeytar) return fromKeytar;
|
|
1621
1579
|
return loadOrCreateFileKey();
|
|
1622
1580
|
}
|
|
1623
1581
|
function createEncryptedStore(filePath, opts) {
|