github-router 0.3.345 → 0.3.347

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.
Files changed (55) hide show
  1. package/README.md +6 -6
  2. package/dist/{attribution-settings-B7i9EI_k.js → attribution-settings-50S3mk4N.js} +10 -10
  3. package/dist/attribution-settings-50S3mk4N.js.map +1 -0
  4. package/dist/{balanced-profile-contract-C6AgFJNp.js → balanced-profile-contract-XiIj4O1U.js} +7 -7
  5. package/dist/balanced-profile-contract-XiIj4O1U.js.map +1 -0
  6. package/dist/browser-ext/manifest.json +1 -1
  7. package/dist/{claude-CqAnTpZv.js → claude-D0rojAcX.js} +16 -16
  8. package/dist/claude-D0rojAcX.js.map +1 -0
  9. package/dist/{codex-DVTp1CuU.js → codex-kcdKpoOe.js} +5 -5
  10. package/dist/{codex-DVTp1CuU.js.map → codex-kcdKpoOe.js.map} +1 -1
  11. package/dist/copilot-discount-CilBhKQW.js.map +1 -1
  12. package/dist/engine-BWxxbsSu.js +2 -0
  13. package/dist/{gate-discovery-TC3k4dr1.js → gate-discovery-CzZ5Oc3H.js} +3 -3
  14. package/dist/{gate-discovery-TC3k4dr1.js.map → gate-discovery-CzZ5Oc3H.js.map} +1 -1
  15. package/dist/hooks.mjs +8 -7
  16. package/dist/hooks.sha256 +1 -1
  17. package/dist/{internal-fast-dispatch-guard-7UiD_vM5.js → internal-fast-dispatch-guard-DRsZJ-Rg.js} +2 -2
  18. package/dist/{internal-fast-dispatch-guard-7UiD_vM5.js.map → internal-fast-dispatch-guard-DRsZJ-Rg.js.map} +1 -1
  19. package/dist/{internal-fast-dispatch-guard-ByXUE5oO.js → internal-fast-dispatch-guard-DeZ6KilC.js} +1 -1
  20. package/dist/{internal-max-dispatch-guard-CioyE9wn.js → internal-max-dispatch-guard-DSjJwVH2.js} +3 -3
  21. package/dist/internal-max-dispatch-guard-DSjJwVH2.js.map +1 -0
  22. package/dist/{internal-max-dispatch-guard-BSRTtOit.js → internal-max-dispatch-guard-KmbYwh7h.js} +1 -1
  23. package/dist/{internal-prompt-submit-BMJ0A7vR.js → internal-prompt-submit-DGxv_Vgl.js} +2 -2
  24. package/dist/{internal-prompt-submit-BMJ0A7vR.js.map → internal-prompt-submit-DGxv_Vgl.js.map} +1 -1
  25. package/dist/{internal-stop-hook-BjdKy6On.js → internal-stop-hook-BdVV3NyD.js} +4 -4
  26. package/dist/{internal-stop-hook-BjdKy6On.js.map → internal-stop-hook-BdVV3NyD.js.map} +1 -1
  27. package/dist/main.js +9 -9
  28. package/dist/{max-profile-contract-LTJstj1e.js → max-profile-contract--dAYkEG1.js} +5 -4
  29. package/dist/max-profile-contract--dAYkEG1.js.map +1 -0
  30. package/dist/{orchestration-BMISq91N.js → orchestration-Ccmfslh4.js} +2 -2
  31. package/dist/{orchestration-BMISq91N.js.map → orchestration-Ccmfslh4.js.map} +1 -1
  32. package/dist/{peer-mcp-personas-CIV3aDP6.js → peer-mcp-personas-DlmmbpD6.js} +62 -60
  33. package/dist/peer-mcp-personas-DlmmbpD6.js.map +1 -0
  34. package/dist/{pi-DJM02Mm2.js → pi-07uTIAcP.js} +128 -10
  35. package/dist/pi-07uTIAcP.js.map +1 -0
  36. package/dist/{provision-J68elA3c.js → provision-D_rmmqTq.js} +3 -3
  37. package/dist/{provision-J68elA3c.js.map → provision-D_rmmqTq.js.map} +1 -1
  38. package/dist/{serve-CCjPimSJ.js → serve-DbrYa6zo.js} +6 -6
  39. package/dist/{serve-CCjPimSJ.js.map → serve-DbrYa6zo.js.map} +1 -1
  40. package/dist/{server-setup-BO-kzlt0.js → server-setup-CKhj8I0W.js} +16 -16
  41. package/dist/server-setup-CKhj8I0W.js.map +1 -0
  42. package/dist/{start-B_ikqtvL.js → start-BXVrchgI.js} +4 -4
  43. package/dist/{start-B_ikqtvL.js.map → start-BXVrchgI.js.map} +1 -1
  44. package/dist/{stop-gate-hook-DBcxPgkF.js → stop-gate-hook-DZVfKoSh.js} +2 -2
  45. package/dist/{stop-gate-hook-DBcxPgkF.js.map → stop-gate-hook-DZVfKoSh.js.map} +1 -1
  46. package/package.json +1 -1
  47. package/dist/attribution-settings-B7i9EI_k.js.map +0 -1
  48. package/dist/balanced-profile-contract-C6AgFJNp.js.map +0 -1
  49. package/dist/claude-CqAnTpZv.js.map +0 -1
  50. package/dist/engine-PexAztE4.js +0 -2
  51. package/dist/internal-max-dispatch-guard-CioyE9wn.js.map +0 -1
  52. package/dist/max-profile-contract-LTJstj1e.js.map +0 -1
  53. package/dist/peer-mcp-personas-CIV3aDP6.js.map +0 -1
  54. package/dist/pi-DJM02Mm2.js.map +0 -1
  55. package/dist/server-setup-BO-kzlt0.js.map +0 -1
@@ -3,11 +3,11 @@ import { t as getPackageVersion } from "./version-C8x2hQrZ.js";
3
3
  import { t as PATHS } from "./paths-CpbTHKeP.js";
4
4
  import { t as state } from "./state-CVp30CBF.js";
5
5
  import { c as runCommandVoid, o as resolveExecutable, s as runCommandCapture } from "./exec-MCU1H-KZ.js";
6
- import { B as runSelfUpdate, E as formatBalancedPrerequisiteFailure, I as validateCheapestProfilePrerequisites, M as resolveLaunchProfile, N as validateBalancedProfilePrerequisites, a as setupAndServe, c as startKeepAwake, f as enableFileLogging, i as parseSharedArgs, j as profileDescriptor, k as formatCheapestPrerequisiteFailure, l as stopKeepAwake, o as sharedServerArgs, r as getPiLaunchEnvVars, z as queueDetachedGlobalInstall } from "./server-setup-BO-kzlt0.js";
7
- import { a as BALANCED_PROFILE_NATIVE_EFFORTS, c as BALANCED_PROFILE_ORACLE_MODEL, r as BALANCED_PROFILE_MODELS, s as BALANCED_PROFILE_ORACLE_EFFORT } from "./balanced-profile-contract-C6AgFJNp.js";
8
- import { D as toolbeltEnabled, Gt as registerLaunch, In as CHEAPEST_PROFILE_NATIVE_EFFORTS, Kt as unregisterLaunch, Mn as CHEAPEST_PROFILE_ADVISOR_EFFORT, Nn as CHEAPEST_PROFILE_ADVISOR_MODEL, Pn as CHEAPEST_PROFILE_MODELS, Rn as CHEAPEST_PROFILE_ORACLE_EFFORT, an as provisionAndIndexColbert, ft as browserToolsEnabled, in as colbertDegradedWarning, nn as provisionBrowserAssets, zn as CHEAPEST_PROFILE_ORACLE_MODEL } from "./peer-mcp-personas-CIV3aDP6.js";
6
+ import { B as runSelfUpdate, E as formatBalancedPrerequisiteFailure, I as validateCheapestProfilePrerequisites, M as resolveLaunchProfile, N as validateBalancedProfilePrerequisites, a as setupAndServe, c as startKeepAwake, f as enableFileLogging, i as parseSharedArgs, j as profileDescriptor, k as formatCheapestPrerequisiteFailure, l as stopKeepAwake, o as sharedServerArgs, r as getPiLaunchEnvVars, z as queueDetachedGlobalInstall } from "./server-setup-CKhj8I0W.js";
7
+ import { a as BALANCED_PROFILE_NATIVE_EFFORTS, c as BALANCED_PROFILE_ORACLE_MODEL, r as BALANCED_PROFILE_MODELS, s as BALANCED_PROFILE_ORACLE_EFFORT } from "./balanced-profile-contract-XiIj4O1U.js";
8
+ import { D as toolbeltEnabled, Gt as registerLaunch, In as CHEAPEST_PROFILE_NATIVE_EFFORTS, Kt as unregisterLaunch, Mn as CHEAPEST_PROFILE_ADVISOR_EFFORT, Nn as CHEAPEST_PROFILE_ADVISOR_MODEL, Pn as CHEAPEST_PROFILE_MODELS, Rn as CHEAPEST_PROFILE_ORACLE_EFFORT, an as provisionAndIndexColbert, ft as browserToolsEnabled, in as colbertDegradedWarning, nn as provisionBrowserAssets, zn as CHEAPEST_PROFILE_ORACLE_MODEL } from "./peer-mcp-personas-DlmmbpD6.js";
9
9
  import { r as resolveSelfInvocation } from "./self-invocation-DIUyoRgL.js";
10
- import { i as launchChild, t as provisionToolbelt } from "./provision-J68elA3c.js";
10
+ import { i as launchChild, t as provisionToolbelt } from "./provision-D_rmmqTq.js";
11
11
  import { d as sweepStaleAicLedgerFiles, n as aicSnapshot, o as formatAicExitSummary, t as aicLedgerPath, u as removeAicLedgerFile } from "./aic-ledger-D4oMcg7c.js";
12
12
  import { i as buildAicStatusHookCommand, n as AIC_STATUSLINE_DISABLE_ENV, t as AIC_LEDGER_ENV } from "./aic-statusline-settings-YoDG20pq.js";
13
13
  import { n as formatDiscountedCostTable, t as discountedUsdForSnapshot } from "./copilot-discount-CilBhKQW.js";
@@ -15,7 +15,7 @@ import { defineCommand } from "citty";
15
15
  import consola from "consola";
16
16
  import { existsSync } from "node:fs";
17
17
  import path from "node:path";
18
- import { randomBytes } from "node:crypto";
18
+ import { createHash, randomBytes } from "node:crypto";
19
19
  import fs$1 from "node:fs/promises";
20
20
  import os from "node:os";
21
21
  import process$1 from "node:process";
@@ -256,6 +256,7 @@ function refreshPiInBackground(opts) {
256
256
  * Sourced from https://docs.github.com/en/copilot/reference/copilot-billing/models-and-pricing
257
257
  * (per 1M tokens; tiers key on per-request INPUT tokens):
258
258
  * - gpt-6-luna: Default ≤ 272K ($0.10 in) vs Long > 272K ($0.20 in)
259
+ * - gpt-5.6-sol: Default ≤ 272K ($4.00 in) vs Long > 272K ($8.00 in)
259
260
  * - gpt-6-sol: Default ≤ 272K ($2.00 in) vs Long > 272K ($4.00 in)
260
261
  * - grok-4.6: Default ≤ 200K ($2.00 in) vs Long > 200K ($4.00 in)
261
262
  *
@@ -267,6 +268,7 @@ function refreshPiInBackground(opts) {
267
268
  */
268
269
  const PI_TIER_THRESHOLDS = Object.freeze({
269
270
  "gpt-6-luna": 272e3,
271
+ "gpt-5.6-sol": 272e3,
270
272
  "gpt-6-sol": 272e3,
271
273
  "grok-4.6": 2e5
272
274
  });
@@ -294,6 +296,7 @@ function piContextWindowFor(modelId, advertisedMaxContextTokens) {
294
296
  */
295
297
  const EXPECTED_DEFAULT_INPUT_PER_1M = Object.freeze({
296
298
  "gpt-6-luna": 10,
299
+ "gpt-5.6-sol": 400,
297
300
  "gpt-6-sol": 200,
298
301
  "grok-4.6": 200
299
302
  });
@@ -614,6 +617,110 @@ async function sweepStalePiAgentMirrors() {
614
617
  }
615
618
  }));
616
619
  }
620
+ function cacheDisabled() {
621
+ return process.env.GH_ROUTER_PI_NO_PACKAGE_CACHE === "1";
622
+ }
623
+ /** Stable fingerprint of one `packages[]` entry (order-independent). */
624
+ function piPackageSpecFingerprint(entry) {
625
+ if (typeof entry === "string") return entry;
626
+ const join = (v) => [...v ?? []].sort().join(",");
627
+ return [
628
+ entry.source,
629
+ `ext:${join(entry.extensions)}`,
630
+ `skills:${join(entry.skills)}`,
631
+ `prompts:${join(entry.prompts)}`,
632
+ `themes:${join(entry.themes)}`
633
+ ].join("::");
634
+ }
635
+ /** Order-independent cache key for a launch's full `packages[]` slice. */
636
+ function piPackageCacheKey(packages) {
637
+ const specs = packages.map(piPackageSpecFingerprint).sort();
638
+ return createHash("sha256").update(specs.join("\n")).digest("hex").slice(0, 16);
639
+ }
640
+ function piPackageCacheDir(key) {
641
+ return path.join(PATHS.APP_DIR, "pi-packages", key);
642
+ }
643
+ function npmDirOf(root) {
644
+ return path.join(root, "npm");
645
+ }
646
+ async function mtimeMsOf(dir) {
647
+ try {
648
+ return (await fs$1.stat(dir)).mtimeMs;
649
+ } catch {
650
+ return null;
651
+ }
652
+ }
653
+ /**
654
+ * Copy the cached `<key>/npm` tree into a fresh mirror before Pi boots.
655
+ * Returns true on a hit (mirror pre-seeded; Pi should install nothing).
656
+ * Stale entries (older than the max age) are a miss so the launch
657
+ * refreshes to upstream latest. Never throws.
658
+ */
659
+ async function seedPiPackageCache(mirrorDir, packages) {
660
+ if (cacheDisabled()) return false;
661
+ const key = piPackageCacheKey(packages);
662
+ const cachedNpm = npmDirOf(piPackageCacheDir(key));
663
+ const mtime = await mtimeMsOf(cachedNpm);
664
+ if (mtime === null) return false;
665
+ if (Date.now() - mtime > 6048e5) {
666
+ consola.debug(`Pi package cache ${key} is stale; refreshing from registry.`);
667
+ return false;
668
+ }
669
+ try {
670
+ await fs$1.cp(cachedNpm, npmDirOf(mirrorDir), { recursive: true });
671
+ return true;
672
+ } catch (err) {
673
+ consola.debug("Pi package cache seed skipped:", err);
674
+ return false;
675
+ }
676
+ }
677
+ /**
678
+ * Persist a mirror's installed `<mirror>/npm` tree back to the cache
679
+ * (call on shutdown, BEFORE the mirror is removed). Overwrites the
680
+ * entry, refreshing its mtime. Never throws.
681
+ */
682
+ async function savePiPackageCache(mirrorDir, packages) {
683
+ if (cacheDisabled()) return;
684
+ const mirrorNpm = npmDirOf(mirrorDir);
685
+ if (await mtimeMsOf(path.join(mirrorNpm, "node_modules")) === null) return;
686
+ const dest = npmDirOf(piPackageCacheDir(piPackageCacheKey(packages)));
687
+ try {
688
+ await fs$1.mkdir(path.dirname(dest), { recursive: true });
689
+ await fs$1.rm(dest, {
690
+ recursive: true,
691
+ force: true
692
+ });
693
+ await fs$1.cp(mirrorNpm, dest, { recursive: true });
694
+ } catch (err) {
695
+ consola.debug("Pi package cache save skipped:", err);
696
+ }
697
+ }
698
+ /**
699
+ * Sweep cache entries whose `npm/` tree is older than the max age.
700
+ * Best-effort, never throws. Runs opportunistically at boot.
701
+ */
702
+ async function sweepStalePiPackageCaches() {
703
+ if (cacheDisabled()) return;
704
+ const root = path.join(PATHS.APP_DIR, "pi-packages");
705
+ let entries;
706
+ try {
707
+ entries = await fs$1.readdir(root);
708
+ } catch {
709
+ return;
710
+ }
711
+ await Promise.all(entries.map(async (entry) => {
712
+ const npmDir = npmDirOf(path.join(root, entry));
713
+ try {
714
+ const mtime = await mtimeMsOf(npmDir);
715
+ if (mtime === null || Date.now() - mtime > 6048e5) await fs$1.rm(path.join(root, entry), {
716
+ recursive: true,
717
+ force: true
718
+ });
719
+ } catch (err) {
720
+ consola.debug(`Pi package cache sweep: skipping ${entry}:`, err);
721
+ }
722
+ }));
723
+ }
617
724
  //#endregion
618
725
  //#region src/lib/pi-models-settings.ts
619
726
  /**
@@ -957,10 +1064,15 @@ function applyCosmeticUserOverrides(userSettings, builtSettings) {
957
1064
  * the launch has neither `--search` nor `--browse`, otherwise it
958
1065
  * double-pays our ColBERT/browser surfaces.
959
1066
  * - `pi-agent-extensions`: allowlisted stable extensions only
960
- * (sessions, structured questions, todos, handoff, context/files
1067
+ * (sessions, structured questions, todos, handoff, context
961
1068
  * dashboards, notifications, analytics). `review`/`loop`/`workflow`/
962
1069
  * `control` overlap our delegate/review pipeline and `powerline-footer`
963
1070
  * would fight the router-owned AIC footer, so all are excluded.
1071
+ * `files` is deliberately excluded too: it registers `ctrl+shift+o`
1072
+ * (file browser), colliding with `pi-claude-code-ui`'s `ctrl+shift+o`
1073
+ * (extra tool detail) — Pi warns and the files binding dies, so
1074
+ * shipping it only buys noise. `@file` mentions + the `context`
1075
+ * dashboard + `read`/`ls`/`find` cover the need.
964
1076
  */
965
1077
  const PI_HELPERS_MCP_ADAPTER = {
966
1078
  source: "npm:pi-mcp-adapter",
@@ -975,7 +1087,9 @@ const PI_HELPERS_WEB_ACCESS = {
975
1087
  /** Verified manifest paths (pi-agent-extensions 0.5.x). Bare relative
976
1088
  * form, NO `./` prefix: Pi matches package-filter patterns with
977
1089
  * minimatch against root-relative paths, and a `./` prefix matches
978
- * nothing (observed live: zero extensions loaded, silent). */
1090
+ * nothing (observed live: zero extensions loaded, silent).
1091
+ * `extensions/files/index.ts` is intentionally absent: it owns
1092
+ * `ctrl+shift+o`, which `pi-claude-code-ui` also registers. */
979
1093
  const PI_HELPERS_AGENT_EXTENSIONS = {
980
1094
  source: "npm:pi-agent-extensions",
981
1095
  extensions: [
@@ -984,7 +1098,6 @@ const PI_HELPERS_AGENT_EXTENSIONS = {
984
1098
  "extensions/handoff/index.ts",
985
1099
  "extensions/notify/index.ts",
986
1100
  "extensions/context/index.ts",
987
- "extensions/files/index.ts",
988
1101
  "extensions/todos/index.ts",
989
1102
  "extensions/answer/index.ts",
990
1103
  "extensions/cwd-history/index.ts",
@@ -1922,7 +2035,7 @@ const piArgs = {
1922
2035
  helpers: {
1923
2036
  type: "boolean",
1924
2037
  default: true,
1925
- description: "Wire the helpful bundle: pi-mcp-adapter, allowlisted pi-agent-extensions (sessions, ask_user, todos, handoff, context, files, analytics — no review/loop/footer), and pi-web-access when neither --search nor --browse is on. Set to false (--no-helpers) for pi-subagents + gh-router-pi only."
2038
+ description: "Wire the helpful bundle: pi-mcp-adapter, allowlisted pi-agent-extensions (sessions, ask_user, todos, handoff, context, analytics — no review/loop/footer, no files picker so Ctrl+Shift+O stays unambiguous for the UI), and pi-web-access when neither --search nor --browse is on. Set to false (--no-helpers) for pi-subagents + gh-router-pi only."
1926
2039
  },
1927
2040
  ui: {
1928
2041
  type: "boolean",
@@ -2088,11 +2201,13 @@ const pi = defineCommand({
2088
2201
  try {
2089
2202
  mirror = await ensurePiAgentMirror();
2090
2203
  await sweepStalePiAgentMirrors();
2204
+ sweepStalePiPackageCaches();
2091
2205
  } catch (err) {
2092
2206
  consola.error(`Failed to provision Pi config mirror: ${err instanceof Error ? err.message : String(err)}.`);
2093
2207
  process$1.exit(1);
2094
2208
  }
2095
2209
  enableFileLogging();
2210
+ let packagesForCache = [];
2096
2211
  try {
2097
2212
  const catalog = state.models?.data.map((m) => {
2098
2213
  const cost = piUsdCostFor(m.billing?.token_prices);
@@ -2140,6 +2255,8 @@ const pi = defineCommand({
2140
2255
  ...cosmeticOverrides,
2141
2256
  ...mergedSubagents ? { subagents: mergedSubagents } : {}
2142
2257
  });
2258
+ packagesForCache = [...builtSettings.packages];
2259
+ if (await seedPiPackageCache(mirror, packagesForCache)) consola.debug("Pi package cache hit: mirror pre-seeded, skipping registry install.");
2143
2260
  const bridgeDisabled = args["memory-bridge"] === false || process$1.env.GH_ROUTER_PI_BRIDGE === "0" || process$1.env.GH_ROUTER_DISABLE_PI_BRIDGE === "1";
2144
2261
  let bridgeStats;
2145
2262
  let bridgeScoped = [];
@@ -2290,6 +2407,7 @@ const pi = defineCommand({
2290
2407
  unregisterLaunch(entry.launchId);
2291
2408
  await stopKeepAwake();
2292
2409
  await disposeBluebirdClients();
2410
+ await savePiPackageCache(mirror, packagesForCache);
2293
2411
  await removeOwnPiAgentMirror();
2294
2412
  await removeAicLedgerFile();
2295
2413
  },
@@ -2306,4 +2424,4 @@ const pi = defineCommand({
2306
2424
  //#endregion
2307
2425
  export { pi };
2308
2426
 
2309
- //# sourceMappingURL=pi-DJM02Mm2.js.map
2427
+ //# sourceMappingURL=pi-07uTIAcP.js.map