@scotthamilton77/sidekick 0.1.17 → 0.1.18
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/dist/bin.js +51 -17
- package/dist/daemon.js +27 -6
- package/package.json +1 -1
package/dist/bin.js
CHANGED
|
@@ -57726,8 +57726,8 @@ var require_doctor_engine = __commonJS({
|
|
|
57726
57726
|
});
|
|
57727
57727
|
}
|
|
57728
57728
|
} else {
|
|
57729
|
-
const
|
|
57730
|
-
if (
|
|
57729
|
+
const userStatus = await io.getUserStatus();
|
|
57730
|
+
if (userStatus) {
|
|
57731
57731
|
await io.updateUserStatus({ statusline: actualStatusline });
|
|
57732
57732
|
} else {
|
|
57733
57733
|
await io.writeUserStatus({
|
|
@@ -57783,8 +57783,8 @@ var require_doctor_engine = __commonJS({
|
|
|
57783
57783
|
},
|
|
57784
57784
|
gitignore: "unknown"
|
|
57785
57785
|
});
|
|
57786
|
-
const
|
|
57787
|
-
if (!
|
|
57786
|
+
const userStatus = await io.getUserStatus();
|
|
57787
|
+
if (!userStatus) {
|
|
57788
57788
|
await io.writeUserStatus({
|
|
57789
57789
|
version: 1,
|
|
57790
57790
|
lastUpdatedAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
@@ -57810,8 +57810,29 @@ var require_doctor_engine = __commonJS({
|
|
|
57810
57810
|
scopes: projectApiKeyStatus.scopes
|
|
57811
57811
|
};
|
|
57812
57812
|
}
|
|
57813
|
-
const
|
|
57814
|
-
|
|
57813
|
+
const currentUserStatus = await io.getUserStatus();
|
|
57814
|
+
if (currentUserStatus) {
|
|
57815
|
+
let userNeedsUpdate = false;
|
|
57816
|
+
const updatedUserApiKeys = { ...currentUserStatus.apiKeys };
|
|
57817
|
+
for (let i = 0; i < keysToCheck.length; i++) {
|
|
57818
|
+
const keyName = keysToCheck[i];
|
|
57819
|
+
const detection = detections[i];
|
|
57820
|
+
const expectedUserStatus = (0, api_key_detector_js_1.buildUserApiKeyStatus)(detection);
|
|
57821
|
+
const currentUserEntry = currentUserStatus.apiKeys[keyName];
|
|
57822
|
+
const currentStatus = typeof currentUserEntry === "object" ? currentUserEntry.status : currentUserEntry ?? "missing";
|
|
57823
|
+
if (currentStatus !== "not-required" && (0, api_key_detector_js_1.toScopeStatus)(currentStatus) !== (0, api_key_detector_js_1.toScopeStatus)(expectedUserStatus.status)) {
|
|
57824
|
+
updatedUserApiKeys[keyName] = expectedUserStatus;
|
|
57825
|
+
userNeedsUpdate = true;
|
|
57826
|
+
}
|
|
57827
|
+
}
|
|
57828
|
+
if (userNeedsUpdate) {
|
|
57829
|
+
await io.updateUserStatus({
|
|
57830
|
+
apiKeys: updatedUserApiKeys
|
|
57831
|
+
});
|
|
57832
|
+
fixes.push("Updated stale user setup-status with current API key status");
|
|
57833
|
+
}
|
|
57834
|
+
}
|
|
57835
|
+
const userSetupExists = currentUserStatus !== null;
|
|
57815
57836
|
const isStatuslineHealthy = actualStatusline !== "none";
|
|
57816
57837
|
const openRouterActual = apiKeyResults.OPENROUTER_API_KEY.actual;
|
|
57817
57838
|
const openRouterCached = apiKeyResults.OPENROUTER_API_KEY.cached;
|
|
@@ -81142,8 +81163,18 @@ var require_prompt = __commonJS({
|
|
|
81142
81163
|
};
|
|
81143
81164
|
})();
|
|
81144
81165
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
81166
|
+
exports2.createSafeResolver = createSafeResolver;
|
|
81145
81167
|
exports2.promptConfirm = promptConfirm;
|
|
81146
81168
|
var readline = __importStar(require("node:readline"));
|
|
81169
|
+
function createSafeResolver(resolve3) {
|
|
81170
|
+
let resolved = false;
|
|
81171
|
+
return (value) => {
|
|
81172
|
+
if (!resolved) {
|
|
81173
|
+
resolved = true;
|
|
81174
|
+
resolve3(value);
|
|
81175
|
+
}
|
|
81176
|
+
};
|
|
81177
|
+
}
|
|
81147
81178
|
var colors = {
|
|
81148
81179
|
yellow: "\x1B[1;33m",
|
|
81149
81180
|
reset: "\x1B[0m"
|
|
@@ -81157,13 +81188,7 @@ var require_prompt = __commonJS({
|
|
|
81157
81188
|
});
|
|
81158
81189
|
const prompt = `${question} ${hint} `;
|
|
81159
81190
|
return new Promise((resolve3) => {
|
|
81160
|
-
|
|
81161
|
-
const safeResolve = (value) => {
|
|
81162
|
-
if (!resolved) {
|
|
81163
|
-
resolved = true;
|
|
81164
|
-
resolve3(value);
|
|
81165
|
-
}
|
|
81166
|
-
};
|
|
81191
|
+
const safeResolve = createSafeResolver(resolve3);
|
|
81167
81192
|
rl.once("close", () => {
|
|
81168
81193
|
safeResolve(defaultYes);
|
|
81169
81194
|
});
|
|
@@ -81804,6 +81829,7 @@ var require_prompts = __commonJS({
|
|
|
81804
81829
|
Object.defineProperty(exports2, "promptConfirm", { enumerable: true, get: function() {
|
|
81805
81830
|
return prompt_js_1.promptConfirm;
|
|
81806
81831
|
} });
|
|
81832
|
+
var prompt_js_2 = require_prompt();
|
|
81807
81833
|
var colors = {
|
|
81808
81834
|
reset: "\x1B[0m",
|
|
81809
81835
|
bold: "\x1B[1m",
|
|
@@ -81851,18 +81877,22 @@ var require_prompts = __commonJS({
|
|
|
81851
81877
|
const defaultNum = defaultIndex + 1;
|
|
81852
81878
|
const prompt = `Enter choice (1-${options.length}) [${defaultNum}]: `;
|
|
81853
81879
|
return new Promise((resolve3) => {
|
|
81880
|
+
const safeResolve = (0, prompt_js_2.createSafeResolver)(resolve3);
|
|
81881
|
+
rl.once("close", () => {
|
|
81882
|
+
safeResolve(options[defaultIndex].value);
|
|
81883
|
+
});
|
|
81854
81884
|
const ask = () => {
|
|
81855
81885
|
ctx.stdout.write(prompt);
|
|
81856
81886
|
rl.once("line", (answer) => {
|
|
81857
81887
|
const trimmed = answer.trim();
|
|
81858
81888
|
if (trimmed === "") {
|
|
81889
|
+
safeResolve(options[defaultIndex].value);
|
|
81859
81890
|
rl.close();
|
|
81860
|
-
resolve3(options[defaultIndex].value);
|
|
81861
81891
|
} else {
|
|
81862
81892
|
const num = parseInt(trimmed, 10);
|
|
81863
81893
|
if (num >= 1 && num <= options.length) {
|
|
81894
|
+
safeResolve(options[num - 1].value);
|
|
81864
81895
|
rl.close();
|
|
81865
|
-
resolve3(options[num - 1].value);
|
|
81866
81896
|
} else {
|
|
81867
81897
|
ctx.stdout.write(`${colors.yellow}Invalid choice. Enter a number between 1 and ${options.length}.${colors.reset}
|
|
81868
81898
|
`);
|
|
@@ -81881,10 +81911,14 @@ var require_prompts = __commonJS({
|
|
|
81881
81911
|
terminal: false
|
|
81882
81912
|
});
|
|
81883
81913
|
return new Promise((resolve3) => {
|
|
81914
|
+
const safeResolve = (0, prompt_js_2.createSafeResolver)(resolve3);
|
|
81915
|
+
rl.once("close", () => {
|
|
81916
|
+
safeResolve("");
|
|
81917
|
+
});
|
|
81884
81918
|
ctx.stdout.write(`${question}: `);
|
|
81885
81919
|
rl.once("line", (answer) => {
|
|
81920
|
+
safeResolve(answer.trim());
|
|
81886
81921
|
rl.close();
|
|
81887
|
-
resolve3(answer.trim());
|
|
81888
81922
|
});
|
|
81889
81923
|
});
|
|
81890
81924
|
}
|
|
@@ -84472,7 +84506,7 @@ var require_cli = __commonJS({
|
|
|
84472
84506
|
var promises_12 = require("node:fs/promises");
|
|
84473
84507
|
var node_stream_1 = require("node:stream");
|
|
84474
84508
|
var yargs_parser_1 = __importDefault2(require_build());
|
|
84475
|
-
var VERSION = true ? "0.1.
|
|
84509
|
+
var VERSION = true ? "0.1.18" : "dev";
|
|
84476
84510
|
var SANDBOX_ERROR_MESSAGE = `Error: Daemon commands cannot run in sandbox mode.
|
|
84477
84511
|
|
|
84478
84512
|
Claude Code's sandbox blocks Unix socket operations required for daemon IPC.
|
package/dist/daemon.js
CHANGED
|
@@ -56750,8 +56750,8 @@ var require_doctor_engine = __commonJS({
|
|
|
56750
56750
|
});
|
|
56751
56751
|
}
|
|
56752
56752
|
} else {
|
|
56753
|
-
const
|
|
56754
|
-
if (
|
|
56753
|
+
const userStatus = await io.getUserStatus();
|
|
56754
|
+
if (userStatus) {
|
|
56755
56755
|
await io.updateUserStatus({ statusline: actualStatusline });
|
|
56756
56756
|
} else {
|
|
56757
56757
|
await io.writeUserStatus({
|
|
@@ -56807,8 +56807,8 @@ var require_doctor_engine = __commonJS({
|
|
|
56807
56807
|
},
|
|
56808
56808
|
gitignore: "unknown"
|
|
56809
56809
|
});
|
|
56810
|
-
const
|
|
56811
|
-
if (!
|
|
56810
|
+
const userStatus = await io.getUserStatus();
|
|
56811
|
+
if (!userStatus) {
|
|
56812
56812
|
await io.writeUserStatus({
|
|
56813
56813
|
version: 1,
|
|
56814
56814
|
lastUpdatedAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
@@ -56834,8 +56834,29 @@ var require_doctor_engine = __commonJS({
|
|
|
56834
56834
|
scopes: projectApiKeyStatus.scopes
|
|
56835
56835
|
};
|
|
56836
56836
|
}
|
|
56837
|
-
const
|
|
56838
|
-
|
|
56837
|
+
const currentUserStatus = await io.getUserStatus();
|
|
56838
|
+
if (currentUserStatus) {
|
|
56839
|
+
let userNeedsUpdate = false;
|
|
56840
|
+
const updatedUserApiKeys = { ...currentUserStatus.apiKeys };
|
|
56841
|
+
for (let i = 0; i < keysToCheck.length; i++) {
|
|
56842
|
+
const keyName = keysToCheck[i];
|
|
56843
|
+
const detection = detections[i];
|
|
56844
|
+
const expectedUserStatus = (0, api_key_detector_js_1.buildUserApiKeyStatus)(detection);
|
|
56845
|
+
const currentUserEntry = currentUserStatus.apiKeys[keyName];
|
|
56846
|
+
const currentStatus = typeof currentUserEntry === "object" ? currentUserEntry.status : currentUserEntry ?? "missing";
|
|
56847
|
+
if (currentStatus !== "not-required" && (0, api_key_detector_js_1.toScopeStatus)(currentStatus) !== (0, api_key_detector_js_1.toScopeStatus)(expectedUserStatus.status)) {
|
|
56848
|
+
updatedUserApiKeys[keyName] = expectedUserStatus;
|
|
56849
|
+
userNeedsUpdate = true;
|
|
56850
|
+
}
|
|
56851
|
+
}
|
|
56852
|
+
if (userNeedsUpdate) {
|
|
56853
|
+
await io.updateUserStatus({
|
|
56854
|
+
apiKeys: updatedUserApiKeys
|
|
56855
|
+
});
|
|
56856
|
+
fixes.push("Updated stale user setup-status with current API key status");
|
|
56857
|
+
}
|
|
56858
|
+
}
|
|
56859
|
+
const userSetupExists = currentUserStatus !== null;
|
|
56839
56860
|
const isStatuslineHealthy = actualStatusline !== "none";
|
|
56840
56861
|
const openRouterActual = apiKeyResults.OPENROUTER_API_KEY.actual;
|
|
56841
56862
|
const openRouterCached = apiKeyResults.OPENROUTER_API_KEY.cached;
|