@makerbi/remodex 1.3.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.
- package/README.md +483 -0
- package/bin/phodex.js +10 -0
- package/bin/remodex.js +314 -0
- package/package.json +33 -0
- package/src/account-status.js +175 -0
- package/src/bootstrap-codex-cli.js +53 -0
- package/src/bridge.js +2032 -0
- package/src/codex-cli-bootstrap.js +187 -0
- package/src/codex-desktop-refresher.js +780 -0
- package/src/codex-home.js +21 -0
- package/src/codex-transport.js +353 -0
- package/src/daemon-state.js +153 -0
- package/src/desktop-handler.js +465 -0
- package/src/git-handler.js +2371 -0
- package/src/index.js +36 -0
- package/src/ios-app-compatibility.js +244 -0
- package/src/macos-launch-agent.js +506 -0
- package/src/notifications-handler.js +95 -0
- package/src/package-version-status.js +185 -0
- package/src/private-defaults.json +4 -0
- package/src/project-handler.js +359 -0
- package/src/push-notification-completion-dedupe.js +147 -0
- package/src/push-notification-service-client.js +151 -0
- package/src/push-notification-tracker.js +688 -0
- package/src/qr.js +63 -0
- package/src/rollout-live-mirror.js +825 -0
- package/src/rollout-watch.js +834 -0
- package/src/scripts/codex-handoff.applescript +100 -0
- package/src/scripts/codex-refresh.applescript +51 -0
- package/src/secure-device-state.js +430 -0
- package/src/secure-transport.js +738 -0
- package/src/session-state.js +57 -0
- package/src/thread-context-handler.js +80 -0
- package/src/voice-handler.js +321 -0
- package/src/workspace-handler.js +630 -0
package/src/qr.js
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
// FILE: qr.js
|
|
2
|
+
// Purpose: Prints the bridge pairing payload as both QR and a short terminal-friendly pairing code.
|
|
3
|
+
// Layer: CLI helper
|
|
4
|
+
// Exports: SHORT_PAIRING_CODE_ALPHABET, SHORT_PAIRING_CODE_LENGTH, createShortPairingCode, printQR
|
|
5
|
+
// Depends on: crypto, qrcode-terminal
|
|
6
|
+
|
|
7
|
+
const { randomBytes } = require("crypto");
|
|
8
|
+
const qrcode = require("qrcode-terminal");
|
|
9
|
+
|
|
10
|
+
const SHORT_PAIRING_CODE_ALPHABET = "ABCDEFGHJKLMNPQRSTUVWXYZ23456789";
|
|
11
|
+
const SHORT_PAIRING_CODE_LENGTH = 10;
|
|
12
|
+
|
|
13
|
+
// Generates a short-lived human-friendly pairing token for reconnect flows.
|
|
14
|
+
function createShortPairingCode({
|
|
15
|
+
length = SHORT_PAIRING_CODE_LENGTH,
|
|
16
|
+
randomBytesImpl = randomBytes,
|
|
17
|
+
} = {}) {
|
|
18
|
+
const resolvedLength = Number.isInteger(length) && length > 0 ? length : SHORT_PAIRING_CODE_LENGTH;
|
|
19
|
+
const bytes = randomBytesImpl(resolvedLength);
|
|
20
|
+
let code = "";
|
|
21
|
+
for (let index = 0; index < resolvedLength; index += 1) {
|
|
22
|
+
code += SHORT_PAIRING_CODE_ALPHABET[bytes[index] % SHORT_PAIRING_CODE_ALPHABET.length];
|
|
23
|
+
}
|
|
24
|
+
return code;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
function normalizePairingSession(pairingSessionOrPayload) {
|
|
28
|
+
if (pairingSessionOrPayload?.pairingPayload) {
|
|
29
|
+
return {
|
|
30
|
+
pairingPayload: pairingSessionOrPayload.pairingPayload,
|
|
31
|
+
pairingCode: typeof pairingSessionOrPayload.pairingCode === "string"
|
|
32
|
+
? pairingSessionOrPayload.pairingCode.trim()
|
|
33
|
+
: "",
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
return {
|
|
38
|
+
pairingPayload: pairingSessionOrPayload,
|
|
39
|
+
pairingCode: "",
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
function printQR(pairingSessionOrPayload) {
|
|
44
|
+
const { pairingPayload, pairingCode } = normalizePairingSession(pairingSessionOrPayload);
|
|
45
|
+
const payload = JSON.stringify(pairingPayload);
|
|
46
|
+
|
|
47
|
+
console.log("\nScan this QR with the iPhone:\n");
|
|
48
|
+
qrcode.generate(payload, { small: true });
|
|
49
|
+
if (pairingCode) {
|
|
50
|
+
console.log("Or paste this pairing code in the iPhone app:\n");
|
|
51
|
+
console.log(pairingCode);
|
|
52
|
+
}
|
|
53
|
+
console.log(`\nSession ID: ${pairingPayload.sessionId}`);
|
|
54
|
+
console.log(`Device ID: ${pairingPayload.macDeviceId}`);
|
|
55
|
+
console.log(`Expires: ${new Date(pairingPayload.expiresAt).toISOString()}\n`);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
module.exports = {
|
|
59
|
+
SHORT_PAIRING_CODE_ALPHABET,
|
|
60
|
+
SHORT_PAIRING_CODE_LENGTH,
|
|
61
|
+
createShortPairingCode,
|
|
62
|
+
printQR,
|
|
63
|
+
};
|