@sideboard-ai/core 0.1.221 → 0.1.222
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/{agents-DYSZ2JFY.js → agents-DV5UROWB.js} +2 -2
- package/dist/{agents-6UOWJLXX.js → agents-QQ77D7VT.js} +2 -2
- package/dist/{chunk-ALDVGAIO.js → chunk-5L66IONI.js} +3 -3
- package/dist/{chunk-B73KKJQB.js → chunk-MPSXJ7WU.js} +4 -4
- package/dist/{chunk-3Y4FIARC.js → chunk-SQHRPJ7P.js} +1 -1
- package/dist/{chunk-UNMMKZ4Q.js → chunk-SXFRXNBM.js} +27 -7
- package/dist/{chunk-YG2X34EF.js → chunk-VUW3VKLW.js} +1 -1
- package/dist/{chunk-QILV2BRW.js → chunk-ZXJMAKEP.js} +31 -11
- package/dist/{connected-teams-PRHZS6B4.js → connected-teams-PIBQTOJU.js} +1 -1
- package/dist/{connected-teams-YOIB42RB.js → connected-teams-RVD3PFAG.js} +1 -1
- package/dist/index.cjs +42 -9
- package/dist/index.js +18 -5
- package/dist/mcp/run-stdio.cjs +27 -7
- package/dist/mcp/run-stdio.js +3 -3
- package/dist/{orchestrator-Y5IDLJ7D.js → orchestrator-O3FNYIRE.js} +3 -3
- package/dist/{orchestrator-P4KNHFHG.js → orchestrator-ZAJ2M4UW.js} +3 -3
- package/package.json +1 -1
|
@@ -50,9 +50,9 @@ import {
|
|
|
50
50
|
resolveQuotaFallbackAgent,
|
|
51
51
|
turnCostUsdFromCursorUsage,
|
|
52
52
|
whichOnPath
|
|
53
|
-
} from "./chunk-
|
|
53
|
+
} from "./chunk-SQHRPJ7P.js";
|
|
54
54
|
import "./chunk-P2EAAM3H.js";
|
|
55
|
-
import "./chunk-
|
|
55
|
+
import "./chunk-SXFRXNBM.js";
|
|
56
56
|
import "./chunk-P2BSMNHB.js";
|
|
57
57
|
import "./chunk-VKQGAWHY.js";
|
|
58
58
|
import "./chunk-NFWPDEN4.js";
|
|
@@ -44,12 +44,12 @@ import {
|
|
|
44
44
|
resolveLoginCommand,
|
|
45
45
|
resolveQuotaFallbackAgent,
|
|
46
46
|
whichOnPath
|
|
47
|
-
} from "./chunk-
|
|
47
|
+
} from "./chunk-VUW3VKLW.js";
|
|
48
48
|
import "./chunk-N2VST3NL.js";
|
|
49
49
|
import "./chunk-KTZESHYH.js";
|
|
50
50
|
import "./chunk-6K64FJDD.js";
|
|
51
51
|
import "./chunk-PO4M4JAJ.js";
|
|
52
|
-
import "./chunk-
|
|
52
|
+
import "./chunk-ZXJMAKEP.js";
|
|
53
53
|
import "./chunk-ROPGQRPU.js";
|
|
54
54
|
import "./chunk-N7WZ6NIN.js";
|
|
55
55
|
import {
|
|
@@ -42,7 +42,7 @@ import {
|
|
|
42
42
|
summarizeTurnStderr,
|
|
43
43
|
toolDescription,
|
|
44
44
|
turnFailChatText
|
|
45
|
-
} from "./chunk-
|
|
45
|
+
} from "./chunk-SQHRPJ7P.js";
|
|
46
46
|
import {
|
|
47
47
|
SLACK_REPLY_FORMATTING,
|
|
48
48
|
addWorkspace,
|
|
@@ -418,7 +418,7 @@ async function continueSourceThread(threadId, prompt) {
|
|
|
418
418
|
await continueOnReply(threadId, prompt);
|
|
419
419
|
return;
|
|
420
420
|
}
|
|
421
|
-
const { getOrchestrator: getOrchestrator2 } = await import("./orchestrator-
|
|
421
|
+
const { getOrchestrator: getOrchestrator2 } = await import("./orchestrator-ZAJ2M4UW.js");
|
|
422
422
|
await getOrchestrator2().send(threadId, prompt);
|
|
423
423
|
} catch {
|
|
424
424
|
}
|
|
@@ -6957,7 +6957,7 @@ function formatScheduledPrompt(name, prompt) {
|
|
|
6957
6957
|
${prompt}`;
|
|
6958
6958
|
}
|
|
6959
6959
|
async function defaultDeps() {
|
|
6960
|
-
const { getOrchestrator: getOrchestrator2, startOrchestration: startOrchestration2 } = await import("./orchestrator-
|
|
6960
|
+
const { getOrchestrator: getOrchestrator2, startOrchestration: startOrchestration2 } = await import("./orchestrator-ZAJ2M4UW.js");
|
|
6961
6961
|
const orch = getOrchestrator2();
|
|
6962
6962
|
return {
|
|
6963
6963
|
findThread: (id) => findThreadByRef(id),
|
|
@@ -24,7 +24,7 @@ import {
|
|
|
24
24
|
resolveQuotaFallbackAgent,
|
|
25
25
|
stripBrightsyNdjsonNoise,
|
|
26
26
|
toolDescription
|
|
27
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-VUW3VKLW.js";
|
|
28
28
|
import {
|
|
29
29
|
SLACK_REPLY_FORMATTING,
|
|
30
30
|
addWorkspace,
|
|
@@ -482,7 +482,7 @@ async function continueSourceThread(threadId, prompt) {
|
|
|
482
482
|
await continueOnReply(threadId, prompt);
|
|
483
483
|
return;
|
|
484
484
|
}
|
|
485
|
-
const { getOrchestrator: getOrchestrator2 } = await import("./orchestrator-
|
|
485
|
+
const { getOrchestrator: getOrchestrator2 } = await import("./orchestrator-O3FNYIRE.js");
|
|
486
486
|
await getOrchestrator2().send(threadId, prompt);
|
|
487
487
|
} catch {
|
|
488
488
|
}
|
|
@@ -4178,7 +4178,7 @@ async function createThread(input, _onSetupLine) {
|
|
|
4178
4178
|
return readThread(thread.id) ?? thread;
|
|
4179
4179
|
}
|
|
4180
4180
|
async function listLinearIssues(agent, repoPath) {
|
|
4181
|
-
const { getAdapter: getAdapter2 } = await import("./agents-
|
|
4181
|
+
const { getAdapter: getAdapter2 } = await import("./agents-QQ77D7VT.js");
|
|
4182
4182
|
await requireAgent(agent, { requireLinear: true });
|
|
4183
4183
|
const adapter = getAdapter2(agent);
|
|
4184
4184
|
if (!adapter.listLinearIssues) {
|
|
@@ -7332,7 +7332,7 @@ function formatScheduledPrompt(name, prompt) {
|
|
|
7332
7332
|
${prompt}`;
|
|
7333
7333
|
}
|
|
7334
7334
|
async function defaultDeps() {
|
|
7335
|
-
const { getOrchestrator: getOrchestrator2, startOrchestration: startOrchestration2 } = await import("./orchestrator-
|
|
7335
|
+
const { getOrchestrator: getOrchestrator2, startOrchestration: startOrchestration2 } = await import("./orchestrator-O3FNYIRE.js");
|
|
7336
7336
|
const orch = getOrchestrator2();
|
|
7337
7337
|
return {
|
|
7338
7338
|
findThread: (id) => findThreadByRef(id),
|
|
@@ -146,24 +146,44 @@ async function ensureConnectedBrightsyTeamTokens(opts) {
|
|
|
146
146
|
);
|
|
147
147
|
const teams = readStore();
|
|
148
148
|
if (teams.length === 0) return [];
|
|
149
|
+
const cfg = (() => {
|
|
150
|
+
try {
|
|
151
|
+
return loadBrightsyConfig();
|
|
152
|
+
} catch {
|
|
153
|
+
return null;
|
|
154
|
+
}
|
|
155
|
+
})();
|
|
149
156
|
const next = [];
|
|
150
157
|
let changed = false;
|
|
151
158
|
for (const team of teams) {
|
|
152
|
-
|
|
153
|
-
|
|
159
|
+
let current = team;
|
|
160
|
+
if (!current.oauth_client_id?.trim()) {
|
|
161
|
+
const endpoint = current.endpoint || "https://brightsy.ai";
|
|
162
|
+
const clientId = await ensureBrightsyOAuthClientId({
|
|
163
|
+
endpoint,
|
|
164
|
+
clientId: cfg?.oauth_client_id,
|
|
165
|
+
fetchImpl: opts?.fetchImpl
|
|
166
|
+
});
|
|
167
|
+
if (clientId && clientId !== current.oauth_client_id) {
|
|
168
|
+
current = { ...current, oauth_client_id: clientId };
|
|
169
|
+
changed = true;
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
if (!current.refresh_token || !brightsyAccessTokenNeedsRefresh(current.expires_at)) {
|
|
173
|
+
next.push(current);
|
|
154
174
|
continue;
|
|
155
175
|
}
|
|
156
|
-
const refreshed = await refreshTeamToken(
|
|
157
|
-
if (refreshed.access_token !==
|
|
176
|
+
const refreshed = await refreshTeamToken(current, opts);
|
|
177
|
+
if (refreshed.access_token !== current.access_token || refreshed.refresh_token !== current.refresh_token || refreshed.expires_at !== current.expires_at || refreshed.oauth_client_id !== current.oauth_client_id) {
|
|
158
178
|
changed = true;
|
|
159
179
|
}
|
|
160
180
|
next.push(refreshed);
|
|
161
181
|
}
|
|
162
182
|
if (changed) writeStore(next);
|
|
163
183
|
try {
|
|
164
|
-
const
|
|
165
|
-
const active = next.find((t) => t.id ===
|
|
166
|
-
if (active && active.access_token !==
|
|
184
|
+
const cfg2 = loadBrightsyConfig();
|
|
185
|
+
const active = next.find((t) => t.id === cfg2.account_id);
|
|
186
|
+
if (active && active.access_token !== cfg2.access_token) {
|
|
167
187
|
applyConnectedTeamToCli(active);
|
|
168
188
|
}
|
|
169
189
|
} catch {
|
|
@@ -19,7 +19,7 @@ import { join } from "path";
|
|
|
19
19
|
|
|
20
20
|
// src/brightsy/accounts.ts
|
|
21
21
|
async function loadConnectedTeams() {
|
|
22
|
-
const { listConnectedBrightsyTeams: listConnectedBrightsyTeams2 } = await import("./connected-teams-
|
|
22
|
+
const { listConnectedBrightsyTeams: listConnectedBrightsyTeams2 } = await import("./connected-teams-PIBQTOJU.js");
|
|
23
23
|
return listConnectedBrightsyTeams2();
|
|
24
24
|
}
|
|
25
25
|
async function runBrightsyTeamsJson(args) {
|
|
@@ -48,14 +48,14 @@ async function listBrightsyAccounts() {
|
|
|
48
48
|
async function getBrightsySession() {
|
|
49
49
|
try {
|
|
50
50
|
const { ensureBrightsyLocalConfigFresh: ensureBrightsyLocalConfigFresh2 } = await import("./oauth-S3M7B475.js");
|
|
51
|
-
const { ensureConnectedBrightsyTeamTokens: ensureConnectedBrightsyTeamTokens2 } = await import("./connected-teams-
|
|
51
|
+
const { ensureConnectedBrightsyTeamTokens: ensureConnectedBrightsyTeamTokens2 } = await import("./connected-teams-PIBQTOJU.js");
|
|
52
52
|
await ensureBrightsyLocalConfigFresh2();
|
|
53
53
|
await ensureConnectedBrightsyTeamTokens2();
|
|
54
54
|
loadBrightsyConfig();
|
|
55
55
|
const data = await runBrightsyTeamsJson([]);
|
|
56
56
|
const accounts = Array.isArray(data.teams) ? data.teams : [];
|
|
57
57
|
const active = data.active ?? accounts.find((a) => a.active) ?? null;
|
|
58
|
-
const { ensureCliTeamTracked: ensureCliTeamTracked2 } = await import("./connected-teams-
|
|
58
|
+
const { ensureCliTeamTracked: ensureCliTeamTracked2 } = await import("./connected-teams-PIBQTOJU.js");
|
|
59
59
|
const connectedTeams = ensureCliTeamTracked2(
|
|
60
60
|
active ? { id: active.id, slug: active.slug, name: active.name } : void 0
|
|
61
61
|
);
|
|
@@ -95,7 +95,7 @@ async function performBrightsyAccountSwitch(accountIdOrSlug) {
|
|
|
95
95
|
return { cfg, target: data.active };
|
|
96
96
|
}
|
|
97
97
|
async function switchBrightsyAccount(accountIdOrSlug) {
|
|
98
|
-
const { connectBrightsyTeam: connectBrightsyTeam2 } = await import("./connected-teams-
|
|
98
|
+
const { connectBrightsyTeam: connectBrightsyTeam2 } = await import("./connected-teams-PIBQTOJU.js");
|
|
99
99
|
await connectBrightsyTeam2(accountIdOrSlug);
|
|
100
100
|
return getBrightsySession();
|
|
101
101
|
}
|
|
@@ -187,24 +187,44 @@ async function ensureConnectedBrightsyTeamTokens(opts) {
|
|
|
187
187
|
);
|
|
188
188
|
const teams = readStore();
|
|
189
189
|
if (teams.length === 0) return [];
|
|
190
|
+
const cfg = (() => {
|
|
191
|
+
try {
|
|
192
|
+
return loadBrightsyConfig();
|
|
193
|
+
} catch {
|
|
194
|
+
return null;
|
|
195
|
+
}
|
|
196
|
+
})();
|
|
190
197
|
const next = [];
|
|
191
198
|
let changed = false;
|
|
192
199
|
for (const team of teams) {
|
|
193
|
-
|
|
194
|
-
|
|
200
|
+
let current = team;
|
|
201
|
+
if (!current.oauth_client_id?.trim()) {
|
|
202
|
+
const endpoint = current.endpoint || "https://brightsy.ai";
|
|
203
|
+
const clientId = await ensureBrightsyOAuthClientId({
|
|
204
|
+
endpoint,
|
|
205
|
+
clientId: cfg?.oauth_client_id,
|
|
206
|
+
fetchImpl: opts?.fetchImpl
|
|
207
|
+
});
|
|
208
|
+
if (clientId && clientId !== current.oauth_client_id) {
|
|
209
|
+
current = { ...current, oauth_client_id: clientId };
|
|
210
|
+
changed = true;
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
if (!current.refresh_token || !brightsyAccessTokenNeedsRefresh(current.expires_at)) {
|
|
214
|
+
next.push(current);
|
|
195
215
|
continue;
|
|
196
216
|
}
|
|
197
|
-
const refreshed = await refreshTeamToken(
|
|
198
|
-
if (refreshed.access_token !==
|
|
217
|
+
const refreshed = await refreshTeamToken(current, opts);
|
|
218
|
+
if (refreshed.access_token !== current.access_token || refreshed.refresh_token !== current.refresh_token || refreshed.expires_at !== current.expires_at || refreshed.oauth_client_id !== current.oauth_client_id) {
|
|
199
219
|
changed = true;
|
|
200
220
|
}
|
|
201
221
|
next.push(refreshed);
|
|
202
222
|
}
|
|
203
223
|
if (changed) writeStore(next);
|
|
204
224
|
try {
|
|
205
|
-
const
|
|
206
|
-
const active = next.find((t) => t.id ===
|
|
207
|
-
if (active && active.access_token !==
|
|
225
|
+
const cfg2 = loadBrightsyConfig();
|
|
226
|
+
const active = next.find((t) => t.id === cfg2.account_id);
|
|
227
|
+
if (active && active.access_token !== cfg2.access_token) {
|
|
208
228
|
applyConnectedTeamToCli(active);
|
|
209
229
|
}
|
|
210
230
|
} catch {
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
ensureConnectedBrightsyTeamTokens,
|
|
8
8
|
getConnectedBrightsyTeamsRaw,
|
|
9
9
|
listConnectedBrightsyTeams
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-ZXJMAKEP.js";
|
|
11
11
|
import "./chunk-ROPGQRPU.js";
|
|
12
12
|
import "./chunk-N7WZ6NIN.js";
|
|
13
13
|
import "./chunk-WFUDY6PC.js";
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
ensureConnectedBrightsyTeamTokens,
|
|
10
10
|
getConnectedBrightsyTeamsRaw,
|
|
11
11
|
listConnectedBrightsyTeams
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-SXFRXNBM.js";
|
|
13
13
|
import "./chunk-P2BSMNHB.js";
|
|
14
14
|
import "./chunk-VKQGAWHY.js";
|
|
15
15
|
import "./chunk-ABOBTSO6.js";
|
package/dist/index.cjs
CHANGED
|
@@ -11166,24 +11166,44 @@ async function ensureConnectedBrightsyTeamTokens(opts) {
|
|
|
11166
11166
|
);
|
|
11167
11167
|
const teams = readStore4();
|
|
11168
11168
|
if (teams.length === 0) return [];
|
|
11169
|
+
const cfg = (() => {
|
|
11170
|
+
try {
|
|
11171
|
+
return loadBrightsyConfig();
|
|
11172
|
+
} catch {
|
|
11173
|
+
return null;
|
|
11174
|
+
}
|
|
11175
|
+
})();
|
|
11169
11176
|
const next = [];
|
|
11170
11177
|
let changed = false;
|
|
11171
11178
|
for (const team of teams) {
|
|
11172
|
-
|
|
11173
|
-
|
|
11179
|
+
let current = team;
|
|
11180
|
+
if (!current.oauth_client_id?.trim()) {
|
|
11181
|
+
const endpoint = current.endpoint || "https://brightsy.ai";
|
|
11182
|
+
const clientId = await ensureBrightsyOAuthClientId({
|
|
11183
|
+
endpoint,
|
|
11184
|
+
clientId: cfg?.oauth_client_id,
|
|
11185
|
+
fetchImpl: opts?.fetchImpl
|
|
11186
|
+
});
|
|
11187
|
+
if (clientId && clientId !== current.oauth_client_id) {
|
|
11188
|
+
current = { ...current, oauth_client_id: clientId };
|
|
11189
|
+
changed = true;
|
|
11190
|
+
}
|
|
11191
|
+
}
|
|
11192
|
+
if (!current.refresh_token || !brightsyAccessTokenNeedsRefresh(current.expires_at)) {
|
|
11193
|
+
next.push(current);
|
|
11174
11194
|
continue;
|
|
11175
11195
|
}
|
|
11176
|
-
const refreshed = await refreshTeamToken(
|
|
11177
|
-
if (refreshed.access_token !==
|
|
11196
|
+
const refreshed = await refreshTeamToken(current, opts);
|
|
11197
|
+
if (refreshed.access_token !== current.access_token || refreshed.refresh_token !== current.refresh_token || refreshed.expires_at !== current.expires_at || refreshed.oauth_client_id !== current.oauth_client_id) {
|
|
11178
11198
|
changed = true;
|
|
11179
11199
|
}
|
|
11180
11200
|
next.push(refreshed);
|
|
11181
11201
|
}
|
|
11182
11202
|
if (changed) writeStore3(next);
|
|
11183
11203
|
try {
|
|
11184
|
-
const
|
|
11185
|
-
const active = next.find((t) => t.id ===
|
|
11186
|
-
if (active && active.access_token !==
|
|
11204
|
+
const cfg2 = loadBrightsyConfig();
|
|
11205
|
+
const active = next.find((t) => t.id === cfg2.account_id);
|
|
11206
|
+
if (active && active.access_token !== cfg2.access_token) {
|
|
11187
11207
|
applyConnectedTeamToCli(active);
|
|
11188
11208
|
}
|
|
11189
11209
|
} catch {
|
|
@@ -32329,16 +32349,29 @@ var BrightsySideboardApi = class {
|
|
|
32329
32349
|
if (!this.cfg.refresh_token || !brightsyAccessTokenNeedsRefresh(this.cfg.expires_at)) {
|
|
32330
32350
|
return;
|
|
32331
32351
|
}
|
|
32352
|
+
const prevClientId = this.cfg.oauth_client_id;
|
|
32353
|
+
const clientId = await ensureBrightsyOAuthClientId({
|
|
32354
|
+
endpoint: this.endpoint,
|
|
32355
|
+
clientId: this.cfg.oauth_client_id,
|
|
32356
|
+
fetchImpl: this.fetchImpl
|
|
32357
|
+
});
|
|
32358
|
+
if (clientId !== this.cfg.oauth_client_id) {
|
|
32359
|
+
this.cfg.oauth_client_id = clientId;
|
|
32360
|
+
}
|
|
32332
32361
|
const grant = await refreshBrightsyAccessToken({
|
|
32333
32362
|
endpoint: this.endpoint,
|
|
32334
32363
|
refreshToken: this.cfg.refresh_token,
|
|
32335
|
-
clientId
|
|
32364
|
+
clientId,
|
|
32336
32365
|
fetchImpl: this.fetchImpl
|
|
32337
32366
|
});
|
|
32338
|
-
if (!grant)
|
|
32367
|
+
if (!grant) {
|
|
32368
|
+
if (this.cfg.oauth_client_id !== prevClientId) saveBrightsyConfig(this.cfg);
|
|
32369
|
+
return;
|
|
32370
|
+
}
|
|
32339
32371
|
this.cfg.access_token = grant.access_token;
|
|
32340
32372
|
if (grant.refresh_token) this.cfg.refresh_token = grant.refresh_token;
|
|
32341
32373
|
if (grant.expires_at) this.cfg.expires_at = grant.expires_at;
|
|
32374
|
+
this.cfg.oauth_client_id = clientId;
|
|
32342
32375
|
saveBrightsyConfig(this.cfg);
|
|
32343
32376
|
}
|
|
32344
32377
|
async getAccess() {
|
package/dist/index.js
CHANGED
|
@@ -318,7 +318,7 @@ import {
|
|
|
318
318
|
worktreeCleanupSettings,
|
|
319
319
|
wrapReviewSkillMarkdown,
|
|
320
320
|
writeWorktreeFile
|
|
321
|
-
} from "./chunk-
|
|
321
|
+
} from "./chunk-MPSXJ7WU.js";
|
|
322
322
|
import {
|
|
323
323
|
LEGACY_PLAN_FILE_REL,
|
|
324
324
|
PLAN_FILE_NAME,
|
|
@@ -435,7 +435,7 @@ import {
|
|
|
435
435
|
withEventParentId,
|
|
436
436
|
withEventsParentId,
|
|
437
437
|
writeInjectedMcpConfig
|
|
438
|
-
} from "./chunk-
|
|
438
|
+
} from "./chunk-VUW3VKLW.js";
|
|
439
439
|
import {
|
|
440
440
|
CLOUD_COORDINATOR_BUSY_REPLY,
|
|
441
441
|
CLOUD_COORDINATOR_STOPPED_REPLY,
|
|
@@ -597,7 +597,7 @@ import {
|
|
|
597
597
|
listBrightsyAccounts,
|
|
598
598
|
listConnectedBrightsyTeams,
|
|
599
599
|
switchBrightsyAccount
|
|
600
|
-
} from "./chunk-
|
|
600
|
+
} from "./chunk-ZXJMAKEP.js";
|
|
601
601
|
import {
|
|
602
602
|
BRIGHTSY_OAUTH_CLIENT_ID,
|
|
603
603
|
BRIGHTSY_OAUTH_REDIRECT,
|
|
@@ -6379,16 +6379,29 @@ var BrightsySideboardApi = class {
|
|
|
6379
6379
|
if (!this.cfg.refresh_token || !brightsyAccessTokenNeedsRefresh(this.cfg.expires_at)) {
|
|
6380
6380
|
return;
|
|
6381
6381
|
}
|
|
6382
|
+
const prevClientId = this.cfg.oauth_client_id;
|
|
6383
|
+
const clientId = await ensureBrightsyOAuthClientId({
|
|
6384
|
+
endpoint: this.endpoint,
|
|
6385
|
+
clientId: this.cfg.oauth_client_id,
|
|
6386
|
+
fetchImpl: this.fetchImpl
|
|
6387
|
+
});
|
|
6388
|
+
if (clientId !== this.cfg.oauth_client_id) {
|
|
6389
|
+
this.cfg.oauth_client_id = clientId;
|
|
6390
|
+
}
|
|
6382
6391
|
const grant = await refreshBrightsyAccessToken({
|
|
6383
6392
|
endpoint: this.endpoint,
|
|
6384
6393
|
refreshToken: this.cfg.refresh_token,
|
|
6385
|
-
clientId
|
|
6394
|
+
clientId,
|
|
6386
6395
|
fetchImpl: this.fetchImpl
|
|
6387
6396
|
});
|
|
6388
|
-
if (!grant)
|
|
6397
|
+
if (!grant) {
|
|
6398
|
+
if (this.cfg.oauth_client_id !== prevClientId) saveBrightsyConfig(this.cfg);
|
|
6399
|
+
return;
|
|
6400
|
+
}
|
|
6389
6401
|
this.cfg.access_token = grant.access_token;
|
|
6390
6402
|
if (grant.refresh_token) this.cfg.refresh_token = grant.refresh_token;
|
|
6391
6403
|
if (grant.expires_at) this.cfg.expires_at = grant.expires_at;
|
|
6404
|
+
this.cfg.oauth_client_id = clientId;
|
|
6392
6405
|
saveBrightsyConfig(this.cfg);
|
|
6393
6406
|
}
|
|
6394
6407
|
async getAccess() {
|
package/dist/mcp/run-stdio.cjs
CHANGED
|
@@ -9133,24 +9133,44 @@ async function ensureConnectedBrightsyTeamTokens(opts) {
|
|
|
9133
9133
|
);
|
|
9134
9134
|
const teams = readStore4();
|
|
9135
9135
|
if (teams.length === 0) return [];
|
|
9136
|
+
const cfg = (() => {
|
|
9137
|
+
try {
|
|
9138
|
+
return loadBrightsyConfig();
|
|
9139
|
+
} catch {
|
|
9140
|
+
return null;
|
|
9141
|
+
}
|
|
9142
|
+
})();
|
|
9136
9143
|
const next = [];
|
|
9137
9144
|
let changed = false;
|
|
9138
9145
|
for (const team of teams) {
|
|
9139
|
-
|
|
9140
|
-
|
|
9146
|
+
let current = team;
|
|
9147
|
+
if (!current.oauth_client_id?.trim()) {
|
|
9148
|
+
const endpoint = current.endpoint || "https://brightsy.ai";
|
|
9149
|
+
const clientId = await ensureBrightsyOAuthClientId({
|
|
9150
|
+
endpoint,
|
|
9151
|
+
clientId: cfg?.oauth_client_id,
|
|
9152
|
+
fetchImpl: opts?.fetchImpl
|
|
9153
|
+
});
|
|
9154
|
+
if (clientId && clientId !== current.oauth_client_id) {
|
|
9155
|
+
current = { ...current, oauth_client_id: clientId };
|
|
9156
|
+
changed = true;
|
|
9157
|
+
}
|
|
9158
|
+
}
|
|
9159
|
+
if (!current.refresh_token || !brightsyAccessTokenNeedsRefresh(current.expires_at)) {
|
|
9160
|
+
next.push(current);
|
|
9141
9161
|
continue;
|
|
9142
9162
|
}
|
|
9143
|
-
const refreshed = await refreshTeamToken(
|
|
9144
|
-
if (refreshed.access_token !==
|
|
9163
|
+
const refreshed = await refreshTeamToken(current, opts);
|
|
9164
|
+
if (refreshed.access_token !== current.access_token || refreshed.refresh_token !== current.refresh_token || refreshed.expires_at !== current.expires_at || refreshed.oauth_client_id !== current.oauth_client_id) {
|
|
9145
9165
|
changed = true;
|
|
9146
9166
|
}
|
|
9147
9167
|
next.push(refreshed);
|
|
9148
9168
|
}
|
|
9149
9169
|
if (changed) writeStore2(next);
|
|
9150
9170
|
try {
|
|
9151
|
-
const
|
|
9152
|
-
const active = next.find((t) => t.id ===
|
|
9153
|
-
if (active && active.access_token !==
|
|
9171
|
+
const cfg2 = loadBrightsyConfig();
|
|
9172
|
+
const active = next.find((t) => t.id === cfg2.account_id);
|
|
9173
|
+
if (active && active.access_token !== cfg2.access_token) {
|
|
9154
9174
|
applyConnectedTeamToCli(active);
|
|
9155
9175
|
}
|
|
9156
9176
|
} catch {
|
package/dist/mcp/run-stdio.js
CHANGED
|
@@ -50,7 +50,7 @@ import {
|
|
|
50
50
|
syncBoardPins,
|
|
51
51
|
updateSchedule,
|
|
52
52
|
waitForDetachedJob
|
|
53
|
-
} from "../chunk-
|
|
53
|
+
} from "../chunk-5L66IONI.js";
|
|
54
54
|
import "../chunk-JFOPOMK7.js";
|
|
55
55
|
import "../chunk-YWI3IBP2.js";
|
|
56
56
|
import {
|
|
@@ -61,13 +61,13 @@ import {
|
|
|
61
61
|
materializeSystemCaBundle,
|
|
62
62
|
sideboardMcpProfile,
|
|
63
63
|
trustSystemCertificates
|
|
64
|
-
} from "../chunk-
|
|
64
|
+
} from "../chunk-SQHRPJ7P.js";
|
|
65
65
|
import {
|
|
66
66
|
GLOBAL_WORKSPACE_ID,
|
|
67
67
|
isCloudCoordinatorThread,
|
|
68
68
|
listWorkspaces
|
|
69
69
|
} from "../chunk-P2EAAM3H.js";
|
|
70
|
-
import "../chunk-
|
|
70
|
+
import "../chunk-SXFRXNBM.js";
|
|
71
71
|
import "../chunk-P2BSMNHB.js";
|
|
72
72
|
import "../chunk-CLI5DVU4.js";
|
|
73
73
|
import "../chunk-HSYE5ID6.js";
|
|
@@ -8,14 +8,14 @@ import {
|
|
|
8
8
|
resolveSendFollowUp,
|
|
9
9
|
startOrchestration,
|
|
10
10
|
waitForPidExit
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-MPSXJ7WU.js";
|
|
12
12
|
import "./chunk-DJU54RYW.js";
|
|
13
|
-
import "./chunk-
|
|
13
|
+
import "./chunk-VUW3VKLW.js";
|
|
14
14
|
import "./chunk-N2VST3NL.js";
|
|
15
15
|
import "./chunk-KTZESHYH.js";
|
|
16
16
|
import "./chunk-6K64FJDD.js";
|
|
17
17
|
import "./chunk-PO4M4JAJ.js";
|
|
18
|
-
import "./chunk-
|
|
18
|
+
import "./chunk-ZXJMAKEP.js";
|
|
19
19
|
import "./chunk-ROPGQRPU.js";
|
|
20
20
|
import "./chunk-N7WZ6NIN.js";
|
|
21
21
|
import "./chunk-AXQ4ZWHK.js";
|
|
@@ -10,12 +10,12 @@ import {
|
|
|
10
10
|
resolveSendFollowUp,
|
|
11
11
|
startOrchestration,
|
|
12
12
|
waitForPidExit
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-5L66IONI.js";
|
|
14
14
|
import "./chunk-JFOPOMK7.js";
|
|
15
15
|
import "./chunk-YWI3IBP2.js";
|
|
16
|
-
import "./chunk-
|
|
16
|
+
import "./chunk-SQHRPJ7P.js";
|
|
17
17
|
import "./chunk-P2EAAM3H.js";
|
|
18
|
-
import "./chunk-
|
|
18
|
+
import "./chunk-SXFRXNBM.js";
|
|
19
19
|
import "./chunk-P2BSMNHB.js";
|
|
20
20
|
import "./chunk-VKQGAWHY.js";
|
|
21
21
|
import "./chunk-NFWPDEN4.js";
|