@h-rig/cli 0.0.6-alpha.88 → 0.0.6-alpha.89
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/rig.js +1159 -292
- package/dist/src/app/board.js +462 -48
- package/dist/src/app-opentui/adapters/doctor.js +458 -46
- package/dist/src/app-opentui/adapters/family.js +670 -147
- package/dist/src/app-opentui/adapters/fleet.js +477 -46
- package/dist/src/app-opentui/adapters/inbox.js +477 -46
- package/dist/src/app-opentui/adapters/init.js +497 -74
- package/dist/src/app-opentui/adapters/inspect.js +477 -46
- package/dist/src/app-opentui/adapters/pi-attach.js +484 -53
- package/dist/src/app-opentui/adapters/run-detail.js +477 -46
- package/dist/src/app-opentui/adapters/server.d.ts +26 -0
- package/dist/src/app-opentui/adapters/server.js +676 -59
- package/dist/src/app-opentui/adapters/tasks.js +539 -81
- package/dist/src/app-opentui/autocomplete.js +4 -2
- package/dist/src/app-opentui/bootstrap.js +1155 -288
- package/dist/src/app-opentui/command-palette.js +37 -10
- package/dist/src/app-opentui/index.js +566 -89
- package/dist/src/app-opentui/intent.js +33 -8
- package/dist/src/app-opentui/keymap.js +43 -29
- package/dist/src/app-opentui/pi-host-child.js +465 -53
- package/dist/src/app-opentui/react/App.js +104 -44
- package/dist/src/app-opentui/react/ChromeHost.js +16 -4
- package/dist/src/app-opentui/react/launch.js +555 -88
- package/dist/src/app-opentui/react/nav.js +1 -1
- package/dist/src/app-opentui/registry.js +1062 -237
- package/dist/src/app-opentui/remote-link.d.ts +10 -0
- package/dist/src/app-opentui/remote-link.js +47 -0
- package/dist/src/app-opentui/runtime.js +566 -89
- package/dist/src/app-opentui/scenes/doctor.js +1 -1
- package/dist/src/app-opentui/scenes/error.js +50 -4
- package/dist/src/app-opentui/scenes/family.js +60 -6
- package/dist/src/app-opentui/scenes/fleet.js +65 -13
- package/dist/src/app-opentui/scenes/help.js +4 -2
- package/dist/src/app-opentui/scenes/init.js +12 -12
- package/dist/src/app-opentui/scenes/main.js +7 -7
- package/dist/src/app-opentui/scenes/server.js +83 -11
- package/dist/src/app-opentui/scenes/tasks.js +79 -16
- package/dist/src/app-opentui/state.js +25 -5
- package/dist/src/app-opentui/surface-catalog.js +4 -2
- package/dist/src/app-opentui/types.d.ts +1 -1
- package/dist/src/commands/_cli-format.d.ts +10 -1
- package/dist/src/commands/_cli-format.js +5 -2
- package/dist/src/commands/_connection-state.d.ts +11 -1
- package/dist/src/commands/_connection-state.js +50 -5
- package/dist/src/commands/_doctor-checks.js +458 -46
- package/dist/src/commands/_help-catalog.js +4 -2
- package/dist/src/commands/_json-output.js +4 -0
- package/dist/src/commands/_operator-view.js +465 -53
- package/dist/src/commands/_pi-frontend.js +465 -53
- package/dist/src/commands/_preflight.js +509 -72
- package/dist/src/commands/_server-client.d.ts +33 -0
- package/dist/src/commands/_server-client.js +477 -46
- package/dist/src/commands/_server-events.js +446 -41
- package/dist/src/commands/_snapshot-upload.js +460 -48
- package/dist/src/commands/connect.js +620 -15
- package/dist/src/commands/doctor.js +458 -46
- package/dist/src/commands/github.js +462 -50
- package/dist/src/commands/inbox.js +458 -46
- package/dist/src/commands/init.js +497 -74
- package/dist/src/commands/inspect.js +458 -46
- package/dist/src/commands/run.js +465 -53
- package/dist/src/commands/server.js +647 -163
- package/dist/src/commands/setup.js +463 -51
- package/dist/src/commands/stats.js +462 -48
- package/dist/src/commands/task-run-driver.js +464 -52
- package/dist/src/commands/task.js +520 -81
- package/dist/src/commands.js +670 -147
- package/dist/src/index.js +674 -147
- package/dist/src/launcher.js +4 -0
- package/package.json +8 -8
|
@@ -183,12 +183,28 @@ function readRepoConnection(projectRoot) {
|
|
|
183
183
|
selected,
|
|
184
184
|
project: typeof record.project === "string" ? record.project : undefined,
|
|
185
185
|
linkedAt: typeof record.linkedAt === "string" ? record.linkedAt : undefined,
|
|
186
|
-
serverProjectRoot: typeof record.serverProjectRoot === "string" && record.serverProjectRoot.trim() ? record.serverProjectRoot.trim() : undefined
|
|
186
|
+
serverProjectRoot: typeof record.serverProjectRoot === "string" && record.serverProjectRoot.trim() ? record.serverProjectRoot.trim() : undefined,
|
|
187
|
+
serverProjectRootAlias: typeof record.serverProjectRootAlias === "string" && record.serverProjectRootAlias.trim() ? record.serverProjectRootAlias.trim() : undefined,
|
|
188
|
+
serverProjectRootBaseUrl: typeof record.serverProjectRootBaseUrl === "string" && record.serverProjectRootBaseUrl.trim() ? record.serverProjectRootBaseUrl.trim().replace(/\/+$/, "") : undefined
|
|
187
189
|
};
|
|
188
190
|
}
|
|
189
191
|
function writeRepoConnection(projectRoot, state) {
|
|
190
192
|
writeJsonFile(resolveRepoConnectionPath(projectRoot), state);
|
|
191
193
|
}
|
|
194
|
+
function rootAllowedForSelection(repo, connection) {
|
|
195
|
+
const root = repo.serverProjectRoot?.trim();
|
|
196
|
+
if (!root)
|
|
197
|
+
return;
|
|
198
|
+
if (connection.kind === "remote") {
|
|
199
|
+
if (repo.serverProjectRootAlias !== repo.selected)
|
|
200
|
+
return;
|
|
201
|
+
if (repo.serverProjectRootBaseUrl !== connection.baseUrl)
|
|
202
|
+
return;
|
|
203
|
+
} else if (repo.serverProjectRootAlias && repo.serverProjectRootAlias !== repo.selected) {
|
|
204
|
+
return;
|
|
205
|
+
}
|
|
206
|
+
return root;
|
|
207
|
+
}
|
|
192
208
|
function resolveSelectedConnection(projectRoot, options = {}) {
|
|
193
209
|
const repo = readRepoConnection(projectRoot);
|
|
194
210
|
if (!repo)
|
|
@@ -200,13 +216,41 @@ function resolveSelectedConnection(projectRoot, options = {}) {
|
|
|
200
216
|
if (!connection) {
|
|
201
217
|
throw new CliError(`Selected Rig server "${repo.selected}" was not found. Run \`rig server list\` or \`rig server use local\`.`, 1);
|
|
202
218
|
}
|
|
203
|
-
return { alias: repo.selected, connection, serverProjectRoot: repo
|
|
219
|
+
return { alias: repo.selected, connection, serverProjectRoot: rootAllowedForSelection(repo, connection) };
|
|
204
220
|
}
|
|
205
|
-
function writeRepoServerProjectRoot(projectRoot, serverProjectRoot) {
|
|
221
|
+
function writeRepoServerProjectRoot(projectRoot, serverProjectRoot, metadata = {}) {
|
|
206
222
|
const repo = readRepoConnection(projectRoot);
|
|
207
223
|
if (!repo)
|
|
208
224
|
return;
|
|
209
|
-
|
|
225
|
+
let inferred = metadata;
|
|
226
|
+
if (!inferred.alias || !inferred.baseUrl) {
|
|
227
|
+
try {
|
|
228
|
+
const selected = resolveSelectedConnection(projectRoot);
|
|
229
|
+
if (selected?.connection.kind === "remote") {
|
|
230
|
+
inferred = {
|
|
231
|
+
alias: inferred.alias ?? selected.alias,
|
|
232
|
+
baseUrl: inferred.baseUrl ?? selected.connection.baseUrl
|
|
233
|
+
};
|
|
234
|
+
}
|
|
235
|
+
} catch {}
|
|
236
|
+
}
|
|
237
|
+
writeRepoConnection(projectRoot, {
|
|
238
|
+
...repo,
|
|
239
|
+
...metadata.project ? { project: metadata.project } : {},
|
|
240
|
+
serverProjectRoot,
|
|
241
|
+
...inferred.alias ? { serverProjectRootAlias: inferred.alias } : {},
|
|
242
|
+
...inferred.baseUrl ? { serverProjectRootBaseUrl: inferred.baseUrl.replace(/\/+$/, "") } : {}
|
|
243
|
+
});
|
|
244
|
+
}
|
|
245
|
+
function clearRepoServerProjectRoot(projectRoot) {
|
|
246
|
+
const repo = readRepoConnection(projectRoot);
|
|
247
|
+
if (!repo)
|
|
248
|
+
return;
|
|
249
|
+
writeRepoConnection(projectRoot, {
|
|
250
|
+
selected: repo.selected,
|
|
251
|
+
...repo.project ? { project: repo.project } : {},
|
|
252
|
+
...repo.linkedAt ? { linkedAt: repo.linkedAt } : {}
|
|
253
|
+
});
|
|
210
254
|
}
|
|
211
255
|
var init__connection_state = __esm(() => {
|
|
212
256
|
init_runner();
|
|
@@ -230,12 +274,16 @@ __export(exports__server_client, {
|
|
|
230
274
|
respondRunPiExtensionUiViaServer: () => respondRunPiExtensionUiViaServer,
|
|
231
275
|
resolveServerConnectionLabel: () => resolveServerConnectionLabel,
|
|
232
276
|
requestServerJson: () => requestServerJson,
|
|
277
|
+
repairRemoteProjectRootLink: () => repairRemoteProjectRootLink,
|
|
233
278
|
registerProjectViaServer: () => registerProjectViaServer,
|
|
234
279
|
prepareRemoteCheckoutViaServer: () => prepareRemoteCheckoutViaServer,
|
|
235
280
|
postGitHubTokenViaServer: () => postGitHubTokenViaServer,
|
|
281
|
+
normalizeRepoSlug: () => normalizeRepoSlug,
|
|
236
282
|
listWorkspaceTasksViaServer: () => listWorkspaceTasksViaServer,
|
|
237
283
|
listRunsViaServer: () => listRunsViaServer,
|
|
238
284
|
listGitHubProjectsViaServer: () => listGitHubProjectsViaServer,
|
|
285
|
+
isRemoteProjectRootLinkError: () => isRemoteProjectRootLinkError,
|
|
286
|
+
inspectRemoteProjectLink: () => inspectRemoteProjectLink,
|
|
239
287
|
getWorkspaceTaskViaServer: () => getWorkspaceTaskViaServer,
|
|
240
288
|
getRunTimelineViaServer: () => getRunTimelineViaServer,
|
|
241
289
|
getRunPiStatusViaServer: () => getRunPiStatusViaServer,
|
|
@@ -247,13 +295,15 @@ __export(exports__server_client, {
|
|
|
247
295
|
getRunDetailsViaServer: () => getRunDetailsViaServer,
|
|
248
296
|
getGitHubProjectStatusFieldViaServer: () => getGitHubProjectStatusFieldViaServer,
|
|
249
297
|
getGitHubAuthStatusViaServer: () => getGitHubAuthStatusViaServer,
|
|
298
|
+
formatRemoteProjectLinkHint: () => formatRemoteProjectLinkHint,
|
|
250
299
|
ensureTaskLabelsViaServer: () => ensureTaskLabelsViaServer,
|
|
251
300
|
ensureServerForCli: () => ensureServerForCli,
|
|
301
|
+
ensureRemoteProjectRootLink: () => ensureRemoteProjectRootLink,
|
|
252
302
|
buildRunPiEventsWebSocketUrl: () => buildRunPiEventsWebSocketUrl,
|
|
253
303
|
abortRunPiViaServer: () => abortRunPiViaServer
|
|
254
304
|
});
|
|
255
|
-
import { existsSync as existsSync2, readFileSync as readFileSync2 } from "fs";
|
|
256
|
-
import { resolve as resolve2 } from "path";
|
|
305
|
+
import { existsSync as existsSync2, mkdirSync as mkdirSync2, readFileSync as readFileSync2, writeFileSync as writeFileSync2 } from "fs";
|
|
306
|
+
import { dirname as dirname2, isAbsolute, resolve as resolve2 } from "path";
|
|
257
307
|
import { ensureLocalRigServerConnection } from "@rig/runtime/local-server";
|
|
258
308
|
function setServerPhaseListener(listener) {
|
|
259
309
|
const previous = serverPhaseListener;
|
|
@@ -299,11 +349,10 @@ function readStoredGitHubAuthToken(projectRoot) {
|
|
|
299
349
|
const parsed = readRemoteAuthState(projectRoot);
|
|
300
350
|
return parsed ? cleanToken(typeof parsed.token === "string" ? parsed.token : undefined) : null;
|
|
301
351
|
}
|
|
302
|
-
function
|
|
303
|
-
|
|
304
|
-
const slug = repo?.project?.trim();
|
|
305
|
-
if (!slug || !/^[^/]+\/[^/]+$/.test(slug))
|
|
352
|
+
function inferRemoteServerProjectRootCandidateFromAuthState(projectRoot, repoSlug) {
|
|
353
|
+
if (!/^[^/]+\/[^/]+$/.test(repoSlug))
|
|
306
354
|
return null;
|
|
355
|
+
const repo = readRepoConnection(projectRoot);
|
|
307
356
|
const auth = readRemoteAuthState(projectRoot);
|
|
308
357
|
const authUpdatedAt = typeof auth?.updatedAt === "string" ? Date.parse(auth.updatedAt) : Number.NaN;
|
|
309
358
|
const repoLinkedAt = typeof repo?.linkedAt === "string" ? Date.parse(repo.linkedAt) : Number.NaN;
|
|
@@ -312,25 +361,426 @@ function inferRemoteServerProjectRootFromAuthState(projectRoot) {
|
|
|
312
361
|
const checkoutBaseDir = typeof auth?.checkoutBaseDir === "string" && auth.checkoutBaseDir.trim() ? auth.checkoutBaseDir.trim() : null;
|
|
313
362
|
if (!checkoutBaseDir)
|
|
314
363
|
return null;
|
|
315
|
-
|
|
316
|
-
writeRepoServerProjectRoot(projectRoot, inferred);
|
|
317
|
-
return inferred;
|
|
364
|
+
return `${checkoutBaseDir.replace(/\/+$/, "")}/${repoSlug}`;
|
|
318
365
|
}
|
|
319
366
|
function readLocalConnectionFallbackToken(projectRoot) {
|
|
320
367
|
return readGitHubBearerTokenForRemote(projectRoot) ?? cleanToken(process.env.RIG_GITHUB_TOKEN) ?? readStoredGitHubAuthToken(projectRoot);
|
|
321
368
|
}
|
|
369
|
+
function normalizeRepoSlug(value) {
|
|
370
|
+
const slug = value?.trim();
|
|
371
|
+
return slug && /^[^/\s]+\/[^/\s]+$/.test(slug) ? slug : null;
|
|
372
|
+
}
|
|
373
|
+
function readProjectLinkSlug(projectRoot) {
|
|
374
|
+
const path = resolve2(projectRoot, ".rig", "state", "project-link.json");
|
|
375
|
+
if (!existsSync2(path))
|
|
376
|
+
return null;
|
|
377
|
+
try {
|
|
378
|
+
const parsed = JSON.parse(readFileSync2(path, "utf8"));
|
|
379
|
+
if (!parsed || typeof parsed !== "object" || Array.isArray(parsed))
|
|
380
|
+
return null;
|
|
381
|
+
return normalizeRepoSlug(typeof parsed.repoSlug === "string" ? String(parsed.repoSlug) : null);
|
|
382
|
+
} catch {
|
|
383
|
+
return null;
|
|
384
|
+
}
|
|
385
|
+
}
|
|
386
|
+
function writeProjectLinkConnection(projectRoot, repoSlug, alias) {
|
|
387
|
+
const path = resolve2(projectRoot, ".rig", "state", "project-link.json");
|
|
388
|
+
mkdirSync2(dirname2(path), { recursive: true });
|
|
389
|
+
writeFileSync2(path, `${JSON.stringify({ repoSlug, connection: alias, linkedAt: new Date().toISOString() }, null, 2)}
|
|
390
|
+
`, "utf8");
|
|
391
|
+
}
|
|
392
|
+
function remoteLinkRepairCommand(repoSlug) {
|
|
393
|
+
return repoSlug ? `rig server repair-link --repo ${repoSlug}` : "rig server repair-link --repo owner/repo";
|
|
394
|
+
}
|
|
395
|
+
function isRemoteProjectRootLinkError(error) {
|
|
396
|
+
const text = error instanceof Error ? error.message : String(error ?? "");
|
|
397
|
+
return /no server-host project root link|remote project(?:-root)? link|x-rig-project-root|serverProjectRoot/i.test(text);
|
|
398
|
+
}
|
|
399
|
+
function formatRemoteProjectLinkHint(resolution) {
|
|
400
|
+
const repair = remoteLinkRepairCommand(resolution.repoSlug);
|
|
401
|
+
if (resolution.status === "auth_required") {
|
|
402
|
+
return `Authenticate the selected remote${resolution.alias ? ` (${resolution.alias})` : ""}, then run \`${repair}\`. Use \`rig github auth import-gh\` or \`rig init --repair --server remote --github-auth device${resolution.repoSlug ? ` --repo ${resolution.repoSlug}` : ""}\`.`;
|
|
403
|
+
}
|
|
404
|
+
if (resolution.status === "missing_project") {
|
|
405
|
+
return `Record the repo slug, then run \`${repair}\` (or \`rig init --repo owner/repo --server remote --github-auth device\`).`;
|
|
406
|
+
}
|
|
407
|
+
if (resolution.status === "not_remote")
|
|
408
|
+
return "Select a remote server with `rig server use <alias>` before repairing a remote project link.";
|
|
409
|
+
return `Run \`${repair}\` to backfill or prepare a server-host checkout for the selected remote${resolution.alias ? ` (${resolution.alias})` : ""}.`;
|
|
410
|
+
}
|
|
411
|
+
function remoteProjectLinkFailure(input) {
|
|
412
|
+
const partial = {
|
|
413
|
+
status: input.status,
|
|
414
|
+
alias: input.alias,
|
|
415
|
+
baseUrl: input.baseUrl,
|
|
416
|
+
repoSlug: input.repoSlug
|
|
417
|
+
};
|
|
418
|
+
return {
|
|
419
|
+
ok: false,
|
|
420
|
+
...input,
|
|
421
|
+
hint: formatRemoteProjectLinkHint(partial),
|
|
422
|
+
next: remoteLinkRepairCommand(input.repoSlug)
|
|
423
|
+
};
|
|
424
|
+
}
|
|
425
|
+
function remoteProjectLinkSuccess(input) {
|
|
426
|
+
return {
|
|
427
|
+
ok: true,
|
|
428
|
+
status: input.status,
|
|
429
|
+
alias: input.alias,
|
|
430
|
+
baseUrl: input.baseUrl,
|
|
431
|
+
repoSlug: input.repoSlug,
|
|
432
|
+
serverProjectRoot: input.serverProjectRoot,
|
|
433
|
+
source: input.source,
|
|
434
|
+
prepared: input.prepared ?? input.status === "prepared",
|
|
435
|
+
validated: input.validated ?? false,
|
|
436
|
+
message: input.message ?? `Remote project link ready for ${input.repoSlug}.`,
|
|
437
|
+
hint: "Remote-scoped task/run/status requests will send x-rig-project-root for this server-host checkout.",
|
|
438
|
+
next: "rig task list"
|
|
439
|
+
};
|
|
440
|
+
}
|
|
441
|
+
function localCheckoutPathCandidate(projectRoot, candidate) {
|
|
442
|
+
try {
|
|
443
|
+
const local = resolve2(projectRoot);
|
|
444
|
+
const resolved = resolve2(candidate);
|
|
445
|
+
return resolved === local || resolved.startsWith(`${local}/`);
|
|
446
|
+
} catch {
|
|
447
|
+
return false;
|
|
448
|
+
}
|
|
449
|
+
}
|
|
450
|
+
async function requestRemoteProjectLinkJson(baseUrl, pathname, authToken, init = {}) {
|
|
451
|
+
const requestUrl = new URL(`${baseUrl}${pathname}`);
|
|
452
|
+
if (authToken && queryAuthFallbackEnabled())
|
|
453
|
+
requestUrl.searchParams.set("rt", authToken);
|
|
454
|
+
const response = await fetch(requestUrl, {
|
|
455
|
+
...init,
|
|
456
|
+
headers: mergeHeaders(init.headers, authToken)
|
|
457
|
+
});
|
|
458
|
+
const text = await response.text();
|
|
459
|
+
const payload = text.trim().length > 0 ? (() => {
|
|
460
|
+
try {
|
|
461
|
+
return JSON.parse(text);
|
|
462
|
+
} catch {
|
|
463
|
+
return null;
|
|
464
|
+
}
|
|
465
|
+
})() : null;
|
|
466
|
+
return { ok: response.ok, status: response.status, payload, text };
|
|
467
|
+
}
|
|
468
|
+
function payloadError(payload, fallback) {
|
|
469
|
+
if (payload && typeof payload === "object" && !Array.isArray(payload)) {
|
|
470
|
+
const record = payload;
|
|
471
|
+
const value = record.error ?? record.message ?? record.reason;
|
|
472
|
+
if (typeof value === "string" && value.trim())
|
|
473
|
+
return value.trim();
|
|
474
|
+
}
|
|
475
|
+
return fallback;
|
|
476
|
+
}
|
|
477
|
+
function checkoutPathsFromProjectPayload(payload) {
|
|
478
|
+
if (!payload || typeof payload !== "object" || Array.isArray(payload))
|
|
479
|
+
return [];
|
|
480
|
+
const project = payload.project;
|
|
481
|
+
if (!project || typeof project !== "object" || Array.isArray(project))
|
|
482
|
+
return [];
|
|
483
|
+
const checkouts = project.checkouts;
|
|
484
|
+
if (!Array.isArray(checkouts))
|
|
485
|
+
return [];
|
|
486
|
+
return [...checkouts].reverse().flatMap((entry) => {
|
|
487
|
+
if (!entry || typeof entry !== "object" || Array.isArray(entry))
|
|
488
|
+
return [];
|
|
489
|
+
const path = entry.path;
|
|
490
|
+
return typeof path === "string" && path.trim() ? [path.trim()] : [];
|
|
491
|
+
});
|
|
492
|
+
}
|
|
493
|
+
function checkoutPathFromPreparePayload(payload) {
|
|
494
|
+
if (!payload || typeof payload !== "object" || Array.isArray(payload))
|
|
495
|
+
return null;
|
|
496
|
+
const checkout = payload.checkout;
|
|
497
|
+
if (!checkout || typeof checkout !== "object" || Array.isArray(checkout))
|
|
498
|
+
return null;
|
|
499
|
+
const path = checkout.path;
|
|
500
|
+
return typeof path === "string" && path.trim() ? path.trim() : null;
|
|
501
|
+
}
|
|
502
|
+
async function validateAndPersistRemoteRoot(input) {
|
|
503
|
+
const candidate = input.candidate.trim();
|
|
504
|
+
if (!candidate || !isAbsolute(candidate)) {
|
|
505
|
+
return remoteProjectLinkFailure({
|
|
506
|
+
status: "invalid_root",
|
|
507
|
+
alias: input.alias,
|
|
508
|
+
baseUrl: input.baseUrl,
|
|
509
|
+
repoSlug: input.repoSlug,
|
|
510
|
+
message: `Remote project root candidate is not an absolute server-host path: ${candidate || "(empty)"}.`
|
|
511
|
+
});
|
|
512
|
+
}
|
|
513
|
+
if (localCheckoutPathCandidate(input.projectRoot, candidate)) {
|
|
514
|
+
return remoteProjectLinkFailure({
|
|
515
|
+
status: "invalid_root",
|
|
516
|
+
alias: input.alias,
|
|
517
|
+
baseUrl: input.baseUrl,
|
|
518
|
+
repoSlug: input.repoSlug,
|
|
519
|
+
message: `Refusing to use local checkout path ${candidate} as a remote server project root.`
|
|
520
|
+
});
|
|
521
|
+
}
|
|
522
|
+
let response;
|
|
523
|
+
try {
|
|
524
|
+
response = await requestRemoteProjectLinkJson(input.baseUrl, "/api/server/project-root", input.authToken, {
|
|
525
|
+
method: "POST",
|
|
526
|
+
headers: { "content-type": "application/json" },
|
|
527
|
+
body: JSON.stringify({ projectRoot: candidate })
|
|
528
|
+
});
|
|
529
|
+
} catch (error) {
|
|
530
|
+
return remoteProjectLinkFailure({
|
|
531
|
+
status: "error",
|
|
532
|
+
alias: input.alias,
|
|
533
|
+
baseUrl: input.baseUrl,
|
|
534
|
+
repoSlug: input.repoSlug,
|
|
535
|
+
message: `Could not validate remote project root ${candidate}: ${error instanceof Error ? error.message : String(error)}`
|
|
536
|
+
});
|
|
537
|
+
}
|
|
538
|
+
if (response.status === 401 || response.status === 403) {
|
|
539
|
+
return remoteProjectLinkFailure({
|
|
540
|
+
status: "auth_required",
|
|
541
|
+
alias: input.alias,
|
|
542
|
+
baseUrl: input.baseUrl,
|
|
543
|
+
repoSlug: input.repoSlug,
|
|
544
|
+
statusCode: response.status,
|
|
545
|
+
message: `Remote server ${input.alias} requires authentication before validating project root ${candidate}.`
|
|
546
|
+
});
|
|
547
|
+
}
|
|
548
|
+
if (!response.ok) {
|
|
549
|
+
return remoteProjectLinkFailure({
|
|
550
|
+
status: "invalid_root",
|
|
551
|
+
alias: input.alias,
|
|
552
|
+
baseUrl: input.baseUrl,
|
|
553
|
+
repoSlug: input.repoSlug,
|
|
554
|
+
statusCode: response.status,
|
|
555
|
+
message: `Remote server rejected project root ${candidate} (${response.status}): ${payloadError(response.payload, response.text || "project-root validation failed")}`
|
|
556
|
+
});
|
|
557
|
+
}
|
|
558
|
+
const record = response.payload && typeof response.payload === "object" && !Array.isArray(response.payload) ? response.payload : {};
|
|
559
|
+
if (record.ok !== true) {
|
|
560
|
+
return remoteProjectLinkFailure({
|
|
561
|
+
status: "invalid_root",
|
|
562
|
+
alias: input.alias,
|
|
563
|
+
baseUrl: input.baseUrl,
|
|
564
|
+
repoSlug: input.repoSlug,
|
|
565
|
+
message: `Remote server did not accept project root ${candidate}: ${payloadError(response.payload, "project-root validation failed")}`
|
|
566
|
+
});
|
|
567
|
+
}
|
|
568
|
+
const accepted = typeof record.projectRoot === "string" && record.projectRoot.trim() ? record.projectRoot.trim() : typeof record.requestedProjectRoot === "string" && record.requestedProjectRoot.trim() ? record.requestedProjectRoot.trim() : candidate;
|
|
569
|
+
writeRepoServerProjectRoot(input.projectRoot, accepted, { alias: input.alias, baseUrl: input.baseUrl, project: input.repoSlug });
|
|
570
|
+
writeProjectLinkConnection(input.projectRoot, input.repoSlug, input.alias);
|
|
571
|
+
const status = input.status ?? (input.prepared ? "prepared" : "backfilled");
|
|
572
|
+
return remoteProjectLinkSuccess({
|
|
573
|
+
status,
|
|
574
|
+
alias: input.alias,
|
|
575
|
+
baseUrl: input.baseUrl,
|
|
576
|
+
repoSlug: input.repoSlug,
|
|
577
|
+
serverProjectRoot: accepted,
|
|
578
|
+
source: input.source,
|
|
579
|
+
prepared: input.prepared,
|
|
580
|
+
validated: true,
|
|
581
|
+
message: status === "ready" ? `Remote project link already points to ${accepted} and was validated on ${input.alias}.` : input.prepared ? `Prepared and linked remote checkout ${accepted} for ${input.repoSlug}.` : `Backfilled remote checkout ${accepted} for ${input.repoSlug}.`
|
|
582
|
+
});
|
|
583
|
+
}
|
|
584
|
+
async function ensureRemoteProjectRootLink(projectRoot, options = {}) {
|
|
585
|
+
let selected;
|
|
586
|
+
try {
|
|
587
|
+
selected = resolveSelectedConnection(projectRoot);
|
|
588
|
+
} catch (error) {
|
|
589
|
+
return remoteProjectLinkFailure({ status: "error", message: error instanceof Error ? error.message : String(error) });
|
|
590
|
+
}
|
|
591
|
+
if (!selected || selected.connection.kind !== "remote") {
|
|
592
|
+
return remoteProjectLinkFailure({ status: "not_remote", message: "No remote Rig server is selected for this repo." });
|
|
593
|
+
}
|
|
594
|
+
const repo = readRepoConnection(projectRoot);
|
|
595
|
+
const explicitRepoRequested = options.repoSlug !== undefined;
|
|
596
|
+
const explicitRepoSlug = explicitRepoRequested ? normalizeRepoSlug(options.repoSlug) : null;
|
|
597
|
+
const repoProjectSlug = normalizeRepoSlug(repo?.project);
|
|
598
|
+
const repoSlug = explicitRepoSlug ?? repoProjectSlug ?? readProjectLinkSlug(projectRoot);
|
|
599
|
+
const alias = selected.alias;
|
|
600
|
+
const baseUrl = selected.connection.baseUrl;
|
|
601
|
+
const authToken = options.authToken === undefined ? readGitHubBearerTokenForRemote(projectRoot) : options.authToken;
|
|
602
|
+
const mode = options.mode ?? "backfill-only";
|
|
603
|
+
if (explicitRepoRequested && !explicitRepoSlug) {
|
|
604
|
+
return remoteProjectLinkFailure({
|
|
605
|
+
status: "missing_project",
|
|
606
|
+
alias,
|
|
607
|
+
baseUrl,
|
|
608
|
+
message: `Invalid --repo value ${JSON.stringify(options.repoSlug)}. Expected owner/repo.`
|
|
609
|
+
});
|
|
610
|
+
}
|
|
611
|
+
if (!repoSlug) {
|
|
612
|
+
return remoteProjectLinkFailure({
|
|
613
|
+
status: "missing_project",
|
|
614
|
+
alias,
|
|
615
|
+
baseUrl,
|
|
616
|
+
message: `Remote server ${alias} is selected, but this checkout has no GitHub repo slug recorded.`
|
|
617
|
+
});
|
|
618
|
+
}
|
|
619
|
+
const skippedCandidates = [];
|
|
620
|
+
const storedRoot = selected.serverProjectRoot?.trim() || null;
|
|
621
|
+
const storedRootMatchesResolvedRepo = repoProjectSlug === repoSlug;
|
|
622
|
+
if (storedRoot && storedRootMatchesResolvedRepo) {
|
|
623
|
+
if (localCheckoutPathCandidate(projectRoot, storedRoot)) {
|
|
624
|
+
clearRepoServerProjectRoot(projectRoot);
|
|
625
|
+
skippedCandidates.push(storedRoot);
|
|
626
|
+
} else {
|
|
627
|
+
const storedResult = await validateAndPersistRemoteRoot({
|
|
628
|
+
projectRoot,
|
|
629
|
+
alias,
|
|
630
|
+
baseUrl,
|
|
631
|
+
authToken,
|
|
632
|
+
repoSlug,
|
|
633
|
+
candidate: storedRoot,
|
|
634
|
+
source: "stored",
|
|
635
|
+
status: "ready"
|
|
636
|
+
});
|
|
637
|
+
if (storedResult.ok || storedResult.status === "auth_required" || storedResult.status === "error")
|
|
638
|
+
return storedResult;
|
|
639
|
+
clearRepoServerProjectRoot(projectRoot);
|
|
640
|
+
skippedCandidates.push(storedRoot);
|
|
641
|
+
}
|
|
642
|
+
} else if (storedRoot) {
|
|
643
|
+
skippedCandidates.push(storedRoot);
|
|
644
|
+
}
|
|
645
|
+
const authCandidate = inferRemoteServerProjectRootCandidateFromAuthState(projectRoot, repoSlug);
|
|
646
|
+
if (authCandidate) {
|
|
647
|
+
const authResult = await validateAndPersistRemoteRoot({ projectRoot, alias, baseUrl, authToken, repoSlug, candidate: authCandidate, source: "auth-state" });
|
|
648
|
+
if (authResult.ok || authResult.status === "auth_required")
|
|
649
|
+
return authResult;
|
|
650
|
+
}
|
|
651
|
+
let registryResponse;
|
|
652
|
+
try {
|
|
653
|
+
registryResponse = await requestRemoteProjectLinkJson(baseUrl, `/api/projects/${encodeURIComponent(repoSlug)}`, authToken);
|
|
654
|
+
} catch (error) {
|
|
655
|
+
return remoteProjectLinkFailure({
|
|
656
|
+
status: "error",
|
|
657
|
+
alias,
|
|
658
|
+
baseUrl,
|
|
659
|
+
repoSlug,
|
|
660
|
+
message: `Could not read remote project registry for ${repoSlug} on ${alias}: ${error instanceof Error ? error.message : String(error)}`
|
|
661
|
+
});
|
|
662
|
+
}
|
|
663
|
+
if (registryResponse.status === 401 || registryResponse.status === 403) {
|
|
664
|
+
return remoteProjectLinkFailure({
|
|
665
|
+
status: "auth_required",
|
|
666
|
+
alias,
|
|
667
|
+
baseUrl,
|
|
668
|
+
repoSlug,
|
|
669
|
+
statusCode: registryResponse.status,
|
|
670
|
+
message: `Remote server ${alias} requires authentication before reading the ${repoSlug} project registry.`
|
|
671
|
+
});
|
|
672
|
+
}
|
|
673
|
+
if (registryResponse.ok) {
|
|
674
|
+
const candidates = checkoutPathsFromProjectPayload(registryResponse.payload);
|
|
675
|
+
for (const candidate of candidates) {
|
|
676
|
+
const result = await validateAndPersistRemoteRoot({ projectRoot, alias, baseUrl, authToken, repoSlug, candidate, source: "registry" });
|
|
677
|
+
if (result.ok || result.status === "auth_required")
|
|
678
|
+
return result;
|
|
679
|
+
skippedCandidates.push(candidate);
|
|
680
|
+
}
|
|
681
|
+
if (mode === "backfill-only") {
|
|
682
|
+
return remoteProjectLinkFailure({
|
|
683
|
+
status: candidates.length > 0 ? "invalid_root" : "no_server_checkout",
|
|
684
|
+
alias,
|
|
685
|
+
baseUrl,
|
|
686
|
+
repoSlug,
|
|
687
|
+
message: candidates.length > 0 ? `Remote registry has checkout candidates for ${repoSlug}, but none validated for ${alias}.` : `Remote registry has ${repoSlug}, but no server checkout path is linked yet.`,
|
|
688
|
+
skippedCandidates
|
|
689
|
+
});
|
|
690
|
+
}
|
|
691
|
+
} else if (registryResponse.status === 404) {
|
|
692
|
+
if (mode === "backfill-only") {
|
|
693
|
+
return remoteProjectLinkFailure({
|
|
694
|
+
status: "project_not_registered",
|
|
695
|
+
alias,
|
|
696
|
+
baseUrl,
|
|
697
|
+
repoSlug,
|
|
698
|
+
statusCode: registryResponse.status,
|
|
699
|
+
message: `Remote server ${alias} has no registered project record for ${repoSlug}.`
|
|
700
|
+
});
|
|
701
|
+
}
|
|
702
|
+
} else {
|
|
703
|
+
return remoteProjectLinkFailure({
|
|
704
|
+
status: "error",
|
|
705
|
+
alias,
|
|
706
|
+
baseUrl,
|
|
707
|
+
repoSlug,
|
|
708
|
+
statusCode: registryResponse.status,
|
|
709
|
+
message: `Could not backfill ${repoSlug} from remote registry (${registryResponse.status}): ${payloadError(registryResponse.payload, registryResponse.text || "registry lookup failed")}`,
|
|
710
|
+
skippedCandidates
|
|
711
|
+
});
|
|
712
|
+
}
|
|
713
|
+
let prepareResponse;
|
|
714
|
+
try {
|
|
715
|
+
prepareResponse = await requestRemoteProjectLinkJson(baseUrl, `/api/projects/${encodeURIComponent(repoSlug)}/prepare-checkout`, authToken, {
|
|
716
|
+
method: "POST",
|
|
717
|
+
headers: { "content-type": "application/json" },
|
|
718
|
+
body: JSON.stringify({ checkout: { kind: "managed-clone" }, repoUrl: `https://github.com/${repoSlug}.git` })
|
|
719
|
+
});
|
|
720
|
+
} catch (error) {
|
|
721
|
+
return remoteProjectLinkFailure({
|
|
722
|
+
status: "error",
|
|
723
|
+
alias,
|
|
724
|
+
baseUrl,
|
|
725
|
+
repoSlug,
|
|
726
|
+
message: `Could not prepare remote checkout for ${repoSlug} on ${alias}: ${error instanceof Error ? error.message : String(error)}`
|
|
727
|
+
});
|
|
728
|
+
}
|
|
729
|
+
if (prepareResponse.status === 401 || prepareResponse.status === 403) {
|
|
730
|
+
return remoteProjectLinkFailure({
|
|
731
|
+
status: "auth_required",
|
|
732
|
+
alias,
|
|
733
|
+
baseUrl,
|
|
734
|
+
repoSlug,
|
|
735
|
+
statusCode: prepareResponse.status,
|
|
736
|
+
message: `Remote server ${alias} requires authentication before preparing ${repoSlug}.`
|
|
737
|
+
});
|
|
738
|
+
}
|
|
739
|
+
if (!prepareResponse.ok) {
|
|
740
|
+
return remoteProjectLinkFailure({
|
|
741
|
+
status: "error",
|
|
742
|
+
alias,
|
|
743
|
+
baseUrl,
|
|
744
|
+
repoSlug,
|
|
745
|
+
statusCode: prepareResponse.status,
|
|
746
|
+
message: `Remote checkout prepare failed for ${repoSlug} (${prepareResponse.status}): ${payloadError(prepareResponse.payload, prepareResponse.text || "prepare-checkout failed")}`,
|
|
747
|
+
skippedCandidates
|
|
748
|
+
});
|
|
749
|
+
}
|
|
750
|
+
const preparedPath = checkoutPathFromPreparePayload(prepareResponse.payload);
|
|
751
|
+
if (!preparedPath) {
|
|
752
|
+
return remoteProjectLinkFailure({
|
|
753
|
+
status: "invalid_root",
|
|
754
|
+
alias,
|
|
755
|
+
baseUrl,
|
|
756
|
+
repoSlug,
|
|
757
|
+
message: `Remote checkout prepare for ${repoSlug} did not return a checkout.path.`,
|
|
758
|
+
skippedCandidates
|
|
759
|
+
});
|
|
760
|
+
}
|
|
761
|
+
return validateAndPersistRemoteRoot({ projectRoot, alias, baseUrl, authToken, repoSlug, candidate: preparedPath, source: "prepare", prepared: true });
|
|
762
|
+
}
|
|
763
|
+
async function inspectRemoteProjectLink(projectRoot) {
|
|
764
|
+
return ensureRemoteProjectRootLink(projectRoot, { mode: "backfill-only" });
|
|
765
|
+
}
|
|
766
|
+
async function repairRemoteProjectRootLink(context, options = {}) {
|
|
767
|
+
const resolution = await ensureRemoteProjectRootLink(context.projectRoot, { mode: options.mode ?? "prepare-if-missing", repoSlug: options.repoSlug });
|
|
768
|
+
if (!resolution.ok)
|
|
769
|
+
throw new CliError(resolution.message, 1, { hint: resolution.hint });
|
|
770
|
+
return resolution;
|
|
771
|
+
}
|
|
322
772
|
async function ensureServerForCli(projectRoot) {
|
|
323
773
|
try {
|
|
324
774
|
const selected = resolveSelectedConnection(projectRoot);
|
|
325
775
|
if (selected?.connection.kind === "remote") {
|
|
326
776
|
reportServerPhase(`Connecting to ${selected.alias}\u2026`);
|
|
327
777
|
const authToken = readGitHubBearerTokenForRemote(projectRoot);
|
|
328
|
-
const
|
|
778
|
+
const link = await ensureRemoteProjectRootLink(projectRoot, { mode: "backfill-only", authToken });
|
|
329
779
|
return {
|
|
330
780
|
baseUrl: selected.connection.baseUrl,
|
|
331
781
|
authToken,
|
|
332
782
|
connectionKind: "remote",
|
|
333
|
-
serverProjectRoot
|
|
783
|
+
serverProjectRoot: link.ok ? link.serverProjectRoot ?? null : null
|
|
334
784
|
};
|
|
335
785
|
}
|
|
336
786
|
reportServerPhase("Starting local Rig server\u2026");
|
|
@@ -348,32 +798,6 @@ async function ensureServerForCli(projectRoot) {
|
|
|
348
798
|
throw error;
|
|
349
799
|
}
|
|
350
800
|
}
|
|
351
|
-
async function backfillRemoteServerProjectRoot(projectRoot, baseUrl, authToken) {
|
|
352
|
-
const repo = readRepoConnection(projectRoot);
|
|
353
|
-
const slug = repo?.project?.trim();
|
|
354
|
-
if (!slug)
|
|
355
|
-
return null;
|
|
356
|
-
try {
|
|
357
|
-
const url = new URL(`${baseUrl}/api/projects/${encodeURIComponent(slug)}`);
|
|
358
|
-
if (authToken && queryAuthFallbackEnabled())
|
|
359
|
-
url.searchParams.set("rt", authToken);
|
|
360
|
-
const response = await fetch(url, {
|
|
361
|
-
headers: mergeHeaders(undefined, authToken)
|
|
362
|
-
});
|
|
363
|
-
if (!response.ok)
|
|
364
|
-
return null;
|
|
365
|
-
const payload = await response.json();
|
|
366
|
-
const project = payload.project && typeof payload.project === "object" && !Array.isArray(payload.project) ? payload.project : null;
|
|
367
|
-
const checkouts = Array.isArray(project?.checkouts) ? project.checkouts : [];
|
|
368
|
-
const latestCheckout = [...checkouts].reverse().find((entry) => Boolean(entry && typeof entry === "object" && !Array.isArray(entry) && typeof entry.path === "string"));
|
|
369
|
-
const path = typeof latestCheckout?.path === "string" && latestCheckout.path.trim() ? latestCheckout.path.trim() : null;
|
|
370
|
-
if (path)
|
|
371
|
-
writeRepoServerProjectRoot(projectRoot, path);
|
|
372
|
-
return path;
|
|
373
|
-
} catch {
|
|
374
|
-
return null;
|
|
375
|
-
}
|
|
376
|
-
}
|
|
377
801
|
function appendTaskFilterParams(url, filters) {
|
|
378
802
|
if (filters.assignee)
|
|
379
803
|
url.searchParams.set("assignee", filters.assignee);
|
|
@@ -474,13 +898,20 @@ function canUseRemoteWithoutProjectRoot(pathname) {
|
|
|
474
898
|
async function requestServerJson(context, pathname, init = {}) {
|
|
475
899
|
const server = await ensureServerForCli(context.projectRoot);
|
|
476
900
|
const requestUrl = new URL(`${server.baseUrl}${pathname}`);
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
901
|
+
let scopedServerProjectRoot = server.serverProjectRoot;
|
|
902
|
+
if (server.connectionKind === "remote" && !scopedServerProjectRoot && !canUseRemoteWithoutProjectRoot(requestUrl.pathname) && (server.authToken || !isLoopbackRemoteBaseUrl(server.baseUrl))) {
|
|
903
|
+
const link = await ensureRemoteProjectRootLink(context.projectRoot, { mode: "backfill-only", authToken: server.authToken });
|
|
904
|
+
if (link.ok && link.serverProjectRoot) {
|
|
905
|
+
scopedServerProjectRoot = link.serverProjectRoot;
|
|
906
|
+
} else {
|
|
907
|
+
const repo = readRepoConnection(context.projectRoot);
|
|
908
|
+
const target = link.alias && link.baseUrl ? `${link.alias} (${link.baseUrl})` : server.baseUrl;
|
|
909
|
+
throw new CliError(`Remote server ${target} is selected for ${link.repoSlug ?? repo?.project ?? "this repo"}, but this checkout has no server-host project root link. ${link.message}`, 1, { hint: link.hint });
|
|
910
|
+
}
|
|
480
911
|
}
|
|
481
912
|
const headers = mergeHeaders(init.headers, server.authToken);
|
|
482
|
-
if (
|
|
483
|
-
headers.set("x-rig-project-root",
|
|
913
|
+
if (scopedServerProjectRoot)
|
|
914
|
+
headers.set("x-rig-project-root", scopedServerProjectRoot);
|
|
484
915
|
if (server.connectionKind === "remote" && server.authToken && queryAuthFallbackEnabled()) {
|
|
485
916
|
requestUrl.searchParams.set("rt", server.authToken);
|
|
486
917
|
}
|
|
@@ -1055,7 +1486,7 @@ __export(exports__pi_frontend, {
|
|
|
1055
1486
|
buildOperatorPiEnv: () => buildOperatorPiEnv,
|
|
1056
1487
|
attachRunBundledPiFrontend: () => attachRunBundledPiFrontend
|
|
1057
1488
|
});
|
|
1058
|
-
import { existsSync as existsSync3, mkdirSync as
|
|
1489
|
+
import { existsSync as existsSync3, mkdirSync as mkdirSync3, mkdtempSync, readFileSync as readFileSync3, rmSync, writeFileSync as writeFileSync3 } from "fs";
|
|
1059
1490
|
import { homedir as homedir2, tmpdir } from "os";
|
|
1060
1491
|
import { join } from "path";
|
|
1061
1492
|
import { main as runPiMain } from "@earendil-works/pi-coding-agent";
|
|
@@ -1107,7 +1538,7 @@ function statusFromRunDetails(run) {
|
|
|
1107
1538
|
async function prepareOperatorConsole(context, runId, tempSessionDir) {
|
|
1108
1539
|
const server = await ensureServerForCli(context.projectRoot);
|
|
1109
1540
|
const localCwd = join(homedir2(), ".rig", "drones", runId.slice(0, 8));
|
|
1110
|
-
|
|
1541
|
+
mkdirSync3(localCwd, { recursive: true });
|
|
1111
1542
|
trustDroneCwd(localCwd);
|
|
1112
1543
|
installRigPiTheme();
|
|
1113
1544
|
let sessionFileArg = [];
|
|
@@ -1129,7 +1560,7 @@ async function prepareOperatorConsole(context, runId, tempSessionDir) {
|
|
|
1129
1560
|
return line;
|
|
1130
1561
|
}).join(`
|
|
1131
1562
|
`);
|
|
1132
|
-
|
|
1563
|
+
writeFileSync3(localSessionPath, content);
|
|
1133
1564
|
sessionFileArg = ["--session", localSessionPath];
|
|
1134
1565
|
}
|
|
1135
1566
|
} catch {}
|
|
@@ -1145,12 +1576,12 @@ async function prepareOperatorConsole(context, runId, tempSessionDir) {
|
|
|
1145
1576
|
function trustDroneCwd(localCwd) {
|
|
1146
1577
|
try {
|
|
1147
1578
|
const agentDir = join(homedir2(), ".pi", "agent");
|
|
1148
|
-
|
|
1579
|
+
mkdirSync3(agentDir, { recursive: true });
|
|
1149
1580
|
const trustPath = join(agentDir, "trust.json");
|
|
1150
1581
|
const store = existsSync3(trustPath) ? JSON.parse(readFileSync3(trustPath, "utf8")) : {};
|
|
1151
1582
|
if (store[localCwd] !== true) {
|
|
1152
1583
|
store[localCwd] = true;
|
|
1153
|
-
|
|
1584
|
+
writeFileSync3(trustPath, `${JSON.stringify(store, null, "\t")}
|
|
1154
1585
|
`);
|
|
1155
1586
|
}
|
|
1156
1587
|
} catch {}
|
|
@@ -1158,12 +1589,12 @@ function trustDroneCwd(localCwd) {
|
|
|
1158
1589
|
function installRigPiTheme() {
|
|
1159
1590
|
try {
|
|
1160
1591
|
const themesDir = join(homedir2(), ".pi", "agent", "themes");
|
|
1161
|
-
|
|
1592
|
+
mkdirSync3(themesDir, { recursive: true });
|
|
1162
1593
|
const themePath = join(themesDir, "rig.json");
|
|
1163
1594
|
const next = `${JSON.stringify(RIG_PI_THEME, null, "\t")}
|
|
1164
1595
|
`;
|
|
1165
1596
|
if (!existsSync3(themePath) || readFileSync3(themePath, "utf8") !== next) {
|
|
1166
|
-
|
|
1597
|
+
writeFileSync3(themePath, next);
|
|
1167
1598
|
}
|
|
1168
1599
|
} catch {}
|
|
1169
1600
|
}
|