repowisestage 0.0.67 → 0.0.68
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/repowise.js +20 -4
- package/package.json +1 -1
package/dist/bin/repowise.js
CHANGED
|
@@ -10350,7 +10350,7 @@ async function updateToolConfigsForRepo(localPath, config2, state, repoId) {
|
|
|
10350
10350
|
await updateToolConfig(localPath, "codex", repoName, contextFolder, contextFiles, variant);
|
|
10351
10351
|
}
|
|
10352
10352
|
if (!state.repos[repoId]) {
|
|
10353
|
-
state.repos[repoId] = { lastSyncTimestamp:
|
|
10353
|
+
state.repos[repoId] = { lastSyncTimestamp: (/* @__PURE__ */ new Date()).toISOString(), lastSyncCommitSha: null };
|
|
10354
10354
|
}
|
|
10355
10355
|
state.repos[repoId].lastToolConfigHash = hash;
|
|
10356
10356
|
console.log(`[ai-tools] Updated tool configs for ${repoId}`);
|
|
@@ -11137,7 +11137,8 @@ async function startListener() {
|
|
|
11137
11137
|
}
|
|
11138
11138
|
try {
|
|
11139
11139
|
const sinceTimestamp = group.repoIds.reduce((earliest, id) => {
|
|
11140
|
-
const
|
|
11140
|
+
const raw = state.repos[id]?.lastSyncTimestamp;
|
|
11141
|
+
const ts2 = raw && !Number.isNaN(Date.parse(raw)) ? raw : now;
|
|
11141
11142
|
return ts2 < earliest ? ts2 : earliest;
|
|
11142
11143
|
}, now);
|
|
11143
11144
|
const response = await group.pollClient.poll(group.repoIds, sinceTimestamp, {
|
|
@@ -12997,14 +12998,29 @@ async function create() {
|
|
|
12997
12998
|
const spinner = ora("Checking authentication...").start();
|
|
12998
12999
|
try {
|
|
12999
13000
|
let credentials = await getValidCredentials2();
|
|
13000
|
-
|
|
13001
|
-
|
|
13001
|
+
let needsLogin = !credentials;
|
|
13002
|
+
if (credentials) {
|
|
13003
|
+
try {
|
|
13004
|
+
await apiRequest("/v1/account/usage");
|
|
13005
|
+
} catch (err) {
|
|
13006
|
+
if (err instanceof Error && /Session expired|Not logged in/i.test(err.message)) {
|
|
13007
|
+
needsLogin = true;
|
|
13008
|
+
}
|
|
13009
|
+
}
|
|
13010
|
+
}
|
|
13011
|
+
if (needsLogin) {
|
|
13012
|
+
spinner.info(
|
|
13013
|
+
chalk8.yellow("Not logged in or session expired. Opening browser to authenticate...")
|
|
13014
|
+
);
|
|
13002
13015
|
credentials = await performLogin();
|
|
13003
13016
|
const { email } = decodeIdToken(credentials.idToken);
|
|
13004
13017
|
spinner.succeed(chalk8.green(`Authenticated as ${chalk8.bold(email)}`));
|
|
13005
13018
|
} else {
|
|
13006
13019
|
spinner.succeed("Authenticated");
|
|
13007
13020
|
}
|
|
13021
|
+
if (!credentials) {
|
|
13022
|
+
throw new Error("Authentication failed \u2014 run `repowise login` and retry.");
|
|
13023
|
+
}
|
|
13008
13024
|
let repoId;
|
|
13009
13025
|
let repoName;
|
|
13010
13026
|
let repoRoot;
|