@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/index.js
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
// FILE: index.js
|
|
2
|
+
// Purpose: Small entrypoint wrapper for bridge lifecycle commands.
|
|
3
|
+
// Layer: CLI entry
|
|
4
|
+
// Exports: bridge lifecycle, pairing reset, thread resume/watch, and macOS service helpers.
|
|
5
|
+
// Depends on: ./bridge, ./secure-device-state, ./session-state, ./rollout-watch, ./macos-launch-agent
|
|
6
|
+
|
|
7
|
+
const { startBridge } = require("./bridge");
|
|
8
|
+
const { readBridgeDeviceState, resetBridgeDeviceState } = require("./secure-device-state");
|
|
9
|
+
const { openLastActiveThread } = require("./session-state");
|
|
10
|
+
const { watchThreadRollout } = require("./rollout-watch");
|
|
11
|
+
const { readBridgeConfig } = require("./codex-desktop-refresher");
|
|
12
|
+
const {
|
|
13
|
+
getMacOSBridgeServiceStatus,
|
|
14
|
+
printMacOSBridgePairingQr,
|
|
15
|
+
printMacOSBridgeServiceStatus,
|
|
16
|
+
resetMacOSBridgePairing,
|
|
17
|
+
runMacOSBridgeService,
|
|
18
|
+
startMacOSBridgeService,
|
|
19
|
+
stopMacOSBridgeService,
|
|
20
|
+
} = require("./macos-launch-agent");
|
|
21
|
+
|
|
22
|
+
module.exports = {
|
|
23
|
+
getMacOSBridgeServiceStatus,
|
|
24
|
+
printMacOSBridgePairingQr,
|
|
25
|
+
printMacOSBridgeServiceStatus,
|
|
26
|
+
readBridgeConfig,
|
|
27
|
+
readBridgeDeviceState,
|
|
28
|
+
resetMacOSBridgePairing,
|
|
29
|
+
startBridge,
|
|
30
|
+
runMacOSBridgeService,
|
|
31
|
+
startMacOSBridgeService,
|
|
32
|
+
stopMacOSBridgeService,
|
|
33
|
+
resetBridgePairing: resetBridgeDeviceState,
|
|
34
|
+
openLastActiveThread,
|
|
35
|
+
watchThreadRollout,
|
|
36
|
+
};
|
|
@@ -0,0 +1,244 @@
|
|
|
1
|
+
// FILE: ios-app-compatibility.js
|
|
2
|
+
// Purpose: Centralizes conservative bridge gating for App Store iPhone version compatibility.
|
|
3
|
+
// Layer: CLI helper
|
|
4
|
+
// Exports: version comparison + bridge/iPhone compatibility helpers
|
|
5
|
+
// Depends on: none
|
|
6
|
+
|
|
7
|
+
const MINIMUM_SUPPORTED_IOS_APP_VERSION = "1.1";
|
|
8
|
+
const IOS_APP_COMPATIBILITY_GATE_BRIDGE_VERSION = "1.3.8";
|
|
9
|
+
const LEGACY_BRIDGE_VERSION_FOR_IOS_1_0 = "1.3.7";
|
|
10
|
+
const LEGACY_BRIDGE_DOWNGRADE_COMMAND = `npm install -g remodex@${LEGACY_BRIDGE_VERSION_FOR_IOS_1_0}`;
|
|
11
|
+
const NOTICE_BOX_WIDTH = 74;
|
|
12
|
+
|
|
13
|
+
function buildIOSAppCompatibilitySnapshot({
|
|
14
|
+
bridgeVersion,
|
|
15
|
+
iosAppVersion,
|
|
16
|
+
} = {}) {
|
|
17
|
+
const normalizedBridgeVersion = normalizeVersionString(bridgeVersion);
|
|
18
|
+
const normalizedIOSAppVersion = normalizeVersionString(iosAppVersion);
|
|
19
|
+
const enforcesMinimumIOSAppVersion = shouldEnforceIOSAppCompatibility(normalizedBridgeVersion);
|
|
20
|
+
|
|
21
|
+
if (!enforcesMinimumIOSAppVersion) {
|
|
22
|
+
return buildSnapshot({
|
|
23
|
+
bridgeVersion: normalizedBridgeVersion,
|
|
24
|
+
iosAppVersion: normalizedIOSAppVersion,
|
|
25
|
+
enforcesMinimumIOSAppVersion: false,
|
|
26
|
+
isKnownIOSAppVersion: Boolean(normalizedIOSAppVersion),
|
|
27
|
+
isCompatible: true,
|
|
28
|
+
requiresAppUpdate: false,
|
|
29
|
+
message: "",
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
if (!normalizedIOSAppVersion) {
|
|
34
|
+
return buildSnapshot({
|
|
35
|
+
bridgeVersion: normalizedBridgeVersion,
|
|
36
|
+
iosAppVersion: "",
|
|
37
|
+
enforcesMinimumIOSAppVersion: true,
|
|
38
|
+
isKnownIOSAppVersion: false,
|
|
39
|
+
isCompatible: true,
|
|
40
|
+
requiresAppUpdate: false,
|
|
41
|
+
message: "",
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
const isCompatible = compareNumericVersions(
|
|
46
|
+
normalizedIOSAppVersion,
|
|
47
|
+
MINIMUM_SUPPORTED_IOS_APP_VERSION
|
|
48
|
+
) >= 0;
|
|
49
|
+
|
|
50
|
+
return buildSnapshot({
|
|
51
|
+
bridgeVersion: normalizedBridgeVersion,
|
|
52
|
+
iosAppVersion: normalizedIOSAppVersion,
|
|
53
|
+
enforcesMinimumIOSAppVersion: true,
|
|
54
|
+
isKnownIOSAppVersion: true,
|
|
55
|
+
isCompatible,
|
|
56
|
+
requiresAppUpdate: !isCompatible,
|
|
57
|
+
message: isCompatible
|
|
58
|
+
? ""
|
|
59
|
+
: buildLegacyIOSAppCompatibilityMessage({
|
|
60
|
+
bridgeVersion: normalizedBridgeVersion,
|
|
61
|
+
iosAppVersion: normalizedIOSAppVersion,
|
|
62
|
+
}),
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
function buildSnapshot({
|
|
67
|
+
bridgeVersion,
|
|
68
|
+
iosAppVersion,
|
|
69
|
+
enforcesMinimumIOSAppVersion,
|
|
70
|
+
isKnownIOSAppVersion,
|
|
71
|
+
isCompatible,
|
|
72
|
+
requiresAppUpdate,
|
|
73
|
+
message,
|
|
74
|
+
}) {
|
|
75
|
+
return {
|
|
76
|
+
bridgeVersion,
|
|
77
|
+
iosAppVersion,
|
|
78
|
+
enforcesMinimumIOSAppVersion,
|
|
79
|
+
isKnownIOSAppVersion,
|
|
80
|
+
isCompatible,
|
|
81
|
+
requiresAppUpdate,
|
|
82
|
+
minimumSupportedIOSAppVersion: MINIMUM_SUPPORTED_IOS_APP_VERSION,
|
|
83
|
+
legacyBridgeVersion: LEGACY_BRIDGE_VERSION_FOR_IOS_1_0,
|
|
84
|
+
downgradeCommand: LEGACY_BRIDGE_DOWNGRADE_COMMAND,
|
|
85
|
+
message,
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
function shouldEnforceIOSAppCompatibility(bridgeVersion) {
|
|
90
|
+
const normalizedBridgeVersion = normalizeVersionString(bridgeVersion);
|
|
91
|
+
if (!normalizedBridgeVersion) {
|
|
92
|
+
return false;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
return compareNumericVersions(
|
|
96
|
+
normalizedBridgeVersion,
|
|
97
|
+
IOS_APP_COMPATIBILITY_GATE_BRIDGE_VERSION
|
|
98
|
+
) >= 0;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
function buildLegacyIOSAppCompatibilityMessage({
|
|
102
|
+
bridgeVersion,
|
|
103
|
+
iosAppVersion,
|
|
104
|
+
} = {}) {
|
|
105
|
+
const normalizedBridgeVersion = normalizeVersionString(bridgeVersion) || "this bridge";
|
|
106
|
+
const normalizedIOSAppVersion = normalizeVersionString(iosAppVersion) || "an older version";
|
|
107
|
+
|
|
108
|
+
return `Remodex bridge ${normalizedBridgeVersion} requires Remodex iPhone `
|
|
109
|
+
+ `${MINIMUM_SUPPORTED_IOS_APP_VERSION} or later. `
|
|
110
|
+
+ `Update the iPhone app from the App Store first, or install Remodex bridge `
|
|
111
|
+
+ `${LEGACY_BRIDGE_VERSION_FOR_IOS_1_0} to keep using iPhone ${normalizedIOSAppVersion}.`;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
function buildCachedIOSAppCompatibilityWarning({
|
|
115
|
+
bridgeVersion,
|
|
116
|
+
iosAppVersion,
|
|
117
|
+
} = {}) {
|
|
118
|
+
const snapshot = buildIOSAppCompatibilitySnapshot({
|
|
119
|
+
bridgeVersion,
|
|
120
|
+
iosAppVersion,
|
|
121
|
+
});
|
|
122
|
+
|
|
123
|
+
if (!snapshot.requiresAppUpdate) {
|
|
124
|
+
return "";
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
return formatNoticeBox({
|
|
128
|
+
title: "!!! WARNING !!!",
|
|
129
|
+
lines: [
|
|
130
|
+
`Remodex bridge ${snapshot.bridgeVersion || "latest"} requires Remodex iPhone ${snapshot.minimumSupportedIOSAppVersion} or later.`,
|
|
131
|
+
"Update the iPhone app from the App Store first.",
|
|
132
|
+
"",
|
|
133
|
+
`Need to keep using iPhone ${snapshot.iosAppVersion}? Install bridge ${snapshot.legacyBridgeVersion}:`,
|
|
134
|
+
snapshot.downgradeCommand,
|
|
135
|
+
],
|
|
136
|
+
});
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
function formatNoticeBox({ title, lines }) {
|
|
140
|
+
const innerWidth = NOTICE_BOX_WIDTH - 4;
|
|
141
|
+
const border = `+${"-".repeat(NOTICE_BOX_WIDTH - 2)}+`;
|
|
142
|
+
const body = [];
|
|
143
|
+
const normalizedTitle = normalizeNonEmptyString(title);
|
|
144
|
+
|
|
145
|
+
if (normalizedTitle) {
|
|
146
|
+
body.push(...wrapBoxText(normalizedTitle, innerWidth));
|
|
147
|
+
body.push(padBoxLine("", innerWidth));
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
for (const line of lines) {
|
|
151
|
+
if (!normalizeNonEmptyString(line)) {
|
|
152
|
+
body.push(padBoxLine("", innerWidth));
|
|
153
|
+
continue;
|
|
154
|
+
}
|
|
155
|
+
body.push(...wrapBoxText(line, innerWidth));
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
return [border, ...body, border].join("\n");
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
function wrapBoxText(text, innerWidth) {
|
|
162
|
+
const words = String(text).trim().split(/\s+/);
|
|
163
|
+
const lines = [];
|
|
164
|
+
let currentLine = "";
|
|
165
|
+
|
|
166
|
+
for (const word of words) {
|
|
167
|
+
const candidate = currentLine ? `${currentLine} ${word}` : word;
|
|
168
|
+
if (candidate.length <= innerWidth) {
|
|
169
|
+
currentLine = candidate;
|
|
170
|
+
continue;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
if (currentLine) {
|
|
174
|
+
lines.push(padBoxLine(currentLine, innerWidth));
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
if (word.length <= innerWidth) {
|
|
178
|
+
currentLine = word;
|
|
179
|
+
continue;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
let remaining = word;
|
|
183
|
+
while (remaining.length > innerWidth) {
|
|
184
|
+
lines.push(padBoxLine(remaining.slice(0, innerWidth), innerWidth));
|
|
185
|
+
remaining = remaining.slice(innerWidth);
|
|
186
|
+
}
|
|
187
|
+
currentLine = remaining;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
if (currentLine || lines.length === 0) {
|
|
191
|
+
lines.push(padBoxLine(currentLine, innerWidth));
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
return lines;
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
function padBoxLine(text, innerWidth) {
|
|
198
|
+
return `| ${String(text).padEnd(innerWidth, " ")} |`;
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
function normalizeNonEmptyString(value) {
|
|
202
|
+
return typeof value === "string" && value.trim() ? value.trim() : "";
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
function normalizeVersionString(value) {
|
|
206
|
+
return typeof value === "string" ? value.trim() : "";
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
function compareNumericVersions(left, right) {
|
|
210
|
+
const leftParts = splitVersionParts(left);
|
|
211
|
+
const rightParts = splitVersionParts(right);
|
|
212
|
+
const maxLength = Math.max(leftParts.length, rightParts.length);
|
|
213
|
+
|
|
214
|
+
for (let index = 0; index < maxLength; index += 1) {
|
|
215
|
+
const leftPart = leftParts[index] || 0;
|
|
216
|
+
const rightPart = rightParts[index] || 0;
|
|
217
|
+
if (leftPart === rightPart) {
|
|
218
|
+
continue;
|
|
219
|
+
}
|
|
220
|
+
return leftPart > rightPart ? 1 : -1;
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
return 0;
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
function splitVersionParts(value) {
|
|
227
|
+
return normalizeVersionString(value)
|
|
228
|
+
.split(".")
|
|
229
|
+
.map((part) => Number.parseInt(part, 10))
|
|
230
|
+
.filter((part) => Number.isFinite(part) && part >= 0);
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
module.exports = {
|
|
234
|
+
LEGACY_BRIDGE_DOWNGRADE_COMMAND,
|
|
235
|
+
LEGACY_BRIDGE_VERSION_FOR_IOS_1_0,
|
|
236
|
+
IOS_APP_COMPATIBILITY_GATE_BRIDGE_VERSION,
|
|
237
|
+
MINIMUM_SUPPORTED_IOS_APP_VERSION,
|
|
238
|
+
buildCachedIOSAppCompatibilityWarning,
|
|
239
|
+
buildIOSAppCompatibilitySnapshot,
|
|
240
|
+
buildLegacyIOSAppCompatibilityMessage,
|
|
241
|
+
compareNumericVersions,
|
|
242
|
+
normalizeVersionString,
|
|
243
|
+
shouldEnforceIOSAppCompatibility,
|
|
244
|
+
};
|