github-router 0.3.367 → 0.3.370

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 (88) hide show
  1. package/dist/ado-tools-B5MNQMFs.js +1 -0
  2. package/dist/{aic-ledger-_mvGW2Ev.js → aic-ledger-Cp7Yk9-Q.js} +2 -2
  3. package/dist/{aic-ledger-_mvGW2Ev.js.map → aic-ledger-Cp7Yk9-Q.js.map} +1 -1
  4. package/dist/{attribution-settings-wVzQvIdL.js → attribution-settings-Cppl9atx.js} +224 -192
  5. package/dist/attribution-settings-Cppl9atx.js.map +1 -0
  6. package/dist/{auth-B3UvYB2r.js → auth-B1egtvt4.js} +3 -3
  7. package/dist/{auth-B3UvYB2r.js.map → auth-B1egtvt4.js.map} +1 -1
  8. package/dist/{balanced-profile-contract-DtnTIBjL.js → balanced-profile-contract-Dm_usmw7.js} +7 -1
  9. package/dist/{balanced-profile-contract-DtnTIBjL.js.map → balanced-profile-contract-Dm_usmw7.js.map} +1 -1
  10. package/dist/{bluebird-client-C29-JOkG.js → bluebird-client-ByCRusGQ.js} +3 -3
  11. package/dist/bluebird-client-ByCRusGQ.js.map +1 -0
  12. package/dist/bluebird-client-CY6NBHQu.js +1 -0
  13. package/dist/browser-ext/manifest.json +1 -1
  14. package/dist/{check-usage-45vyaLfl.js → check-usage-T_z84Pgc.js} +3 -3
  15. package/dist/{check-usage-45vyaLfl.js.map → check-usage-T_z84Pgc.js.map} +1 -1
  16. package/dist/{claude-B3pIageM.js → claude-B3qNFwtc.js} +25 -20
  17. package/dist/claude-B3qNFwtc.js.map +1 -0
  18. package/dist/{claude-md-injection-BV4tPUWo.js → claude-md-injection-K3DKhsfI.js} +37 -12
  19. package/dist/claude-md-injection-K3DKhsfI.js.map +1 -0
  20. package/dist/{codex-B_AMB6JM.js → codex-3DEffjlm.js} +8 -8
  21. package/dist/{codex-B_AMB6JM.js.map → codex-3DEffjlm.js.map} +1 -1
  22. package/dist/{copilot-discount-BuDbQOHq.js → copilot-discount-T-cfWmc4.js} +2 -2
  23. package/dist/{copilot-discount-BuDbQOHq.js.map → copilot-discount-T-cfWmc4.js.map} +1 -1
  24. package/dist/engine-C2YCclx0.js +1 -0
  25. package/dist/{gate-discovery-CXE-7VcM.js → gate-discovery-BV6UGGVd.js} +2 -2
  26. package/dist/{gate-discovery-CXE-7VcM.js.map → gate-discovery-BV6UGGVd.js.map} +1 -1
  27. package/dist/{get-copilot-usage-BbGmK03C.js → get-copilot-usage-BSXeQEx8.js} +3 -3
  28. package/dist/{get-copilot-usage-BbGmK03C.js.map → get-copilot-usage-BSXeQEx8.js.map} +1 -1
  29. package/dist/hooks.mjs +74 -10
  30. package/dist/hooks.sha256 +1 -1
  31. package/dist/{internal-aic-status-BAVomi5A.js → internal-aic-status-CY0QxSa7.js} +3 -3
  32. package/dist/{internal-aic-status-BAVomi5A.js.map → internal-aic-status-CY0QxSa7.js.map} +1 -1
  33. package/dist/{internal-fast-dispatch-guard-DP25L_Bx.js → internal-fast-dispatch-guard-De_DJOyZ.js} +1 -1
  34. package/dist/{internal-fast-dispatch-guard-DbrgO9Ab.js → internal-fast-dispatch-guard-_n-A8hgo.js} +2 -2
  35. package/dist/{internal-fast-dispatch-guard-DbrgO9Ab.js.map → internal-fast-dispatch-guard-_n-A8hgo.js.map} +1 -1
  36. package/dist/{internal-max-dispatch-guard-BodVFHRC.js → internal-max-dispatch-guard-4rh6KSd8.js} +2 -2
  37. package/dist/{internal-max-dispatch-guard-BodVFHRC.js.map → internal-max-dispatch-guard-4rh6KSd8.js.map} +1 -1
  38. package/dist/{internal-max-dispatch-guard-BB0vwiPx.js → internal-max-dispatch-guard-CKnzgJje.js} +1 -1
  39. package/dist/{internal-prompt-submit-DPUBQZtG.js → internal-prompt-submit-B-kKTl-8.js} +2 -2
  40. package/dist/{internal-prompt-submit-BaccW_CC.js → internal-prompt-submit-bi7F7pKk.js} +2 -2
  41. package/dist/{internal-prompt-submit-BaccW_CC.js.map → internal-prompt-submit-bi7F7pKk.js.map} +1 -1
  42. package/dist/{internal-rebrief-NjSlx5QY.js → internal-rebrief-B6ZJS6Mp.js} +3 -3
  43. package/dist/{internal-rebrief-NjSlx5QY.js.map → internal-rebrief-B6ZJS6Mp.js.map} +1 -1
  44. package/dist/{internal-stop-hook-B2TTl6Zp.js → internal-stop-hook-covotLvl.js} +2 -2
  45. package/dist/{internal-stop-hook-B2TTl6Zp.js.map → internal-stop-hook-covotLvl.js.map} +1 -1
  46. package/dist/main.js +15 -14
  47. package/dist/main.js.map +1 -1
  48. package/dist/{max-profile-contract-Cx5_Z1Y7.js → max-profile-contract-CRj7N211.js} +2 -2
  49. package/dist/{max-profile-contract-Cx5_Z1Y7.js.map → max-profile-contract-CRj7N211.js.map} +1 -1
  50. package/dist/{models-BR6i348u.js → models-Ca-HQTYi.js} +2 -2
  51. package/dist/{models-BR6i348u.js.map → models-Ca-HQTYi.js.map} +1 -1
  52. package/dist/{peer-mcp-personas-BOgR46nM.js → peer-mcp-personas-6zWkXHQW.js} +1181 -354
  53. package/dist/peer-mcp-personas-6zWkXHQW.js.map +1 -0
  54. package/dist/{pi-DcWp83mx.js → pi-DJJlBHP9.js} +41 -19
  55. package/dist/{pi-DcWp83mx.js.map → pi-DJJlBHP9.js.map} +1 -1
  56. package/dist/{provision-DkWR9B6I.js → provision-C_aTowyW.js} +3 -2
  57. package/dist/provision-C_aTowyW.js.map +1 -0
  58. package/dist/{serve-BGwEVDdc.js → serve-CfizTkRS.js} +19 -11
  59. package/dist/serve-CfizTkRS.js.map +1 -0
  60. package/dist/{server-setup-DVPL9iph.js → server-setup-rm8ELtYa.js} +107 -138
  61. package/dist/server-setup-rm8ELtYa.js.map +1 -0
  62. package/dist/{start-BUWx3nSr.js → start-D7RcHG8T.js} +3 -3
  63. package/dist/{start-BUWx3nSr.js.map → start-D7RcHG8T.js.map} +1 -1
  64. package/dist/{state-CiwCLVDZ.js → state-DzsaGHr9.js} +3 -1
  65. package/dist/state-DzsaGHr9.js.map +1 -0
  66. package/dist/{static-context-pack-ChHuxBpk.js → static-context-pack-DvwLWlbe.js} +153 -17
  67. package/dist/static-context-pack-DvwLWlbe.js.map +1 -0
  68. package/dist/token-CVG0yI_j.js +480 -0
  69. package/dist/token-CVG0yI_j.js.map +1 -0
  70. package/dist/{token-OTb61rOC.js → token-Dqjs5ixP.js} +3 -3
  71. package/dist/{token-OTb61rOC.js.map → token-Dqjs5ixP.js.map} +1 -1
  72. package/dist/workiq-qnJR5_n2.js +144 -0
  73. package/dist/workiq-qnJR5_n2.js.map +1 -0
  74. package/dist/workiq-tools-BeTneKco.js +1 -0
  75. package/package.json +1 -1
  76. package/dist/ado-tools-rysFZDws.js +0 -1
  77. package/dist/attribution-settings-wVzQvIdL.js.map +0 -1
  78. package/dist/bluebird-client-C29-JOkG.js.map +0 -1
  79. package/dist/bluebird-client-DGE3WZqh.js +0 -1
  80. package/dist/claude-B3pIageM.js.map +0 -1
  81. package/dist/claude-md-injection-BV4tPUWo.js.map +0 -1
  82. package/dist/engine-D3oNrF6Z.js +0 -1
  83. package/dist/peer-mcp-personas-BOgR46nM.js.map +0 -1
  84. package/dist/provision-DkWR9B6I.js.map +0 -1
  85. package/dist/serve-BGwEVDdc.js.map +0 -1
  86. package/dist/server-setup-DVPL9iph.js.map +0 -1
  87. package/dist/state-CiwCLVDZ.js.map +0 -1
  88. package/dist/static-context-pack-ChHuxBpk.js.map +0 -1
@@ -1,16 +1,16 @@
1
1
  import { P as warmTreeSitterPool } from "./service-backend-B6D_DY1Z.js";
2
2
  import { t as getPackageVersion } from "./version-C8x2hQrZ.js";
3
3
  import { t as PATHS } from "./paths-C5477RGC.js";
4
- import { t as state } from "./state-CiwCLVDZ.js";
5
- import { $ as runSelfUpdate, G as resolveLaunchProfile, K as validateBalancedProfilePrerequisites, R as formatBalancedPrerequisiteFailure, U as formatLocalPrerequisiteFailure, V as formatCheapestPrerequisiteFailure, W as profileDescriptor, Y as validateCheapestProfilePrerequisites, Z as validateLocalProfilePrerequisites, _ as ensurePiAgentMirror, a as setupAndServe, b as startKeepAwake, c as localBaseUrl, d as ensurePiInstalled, f as getInstalledPiVersion, g as updatePi, h as resolvePiRegistry, i as parseSharedArgs, l as LAUNCH_SECRET_HEADER, m as refreshPiInBackground, o as sharedServerArgs, p as meetsPiMinVersion, r as getPiLaunchEnvVars, s as configureLocalEgress, u as PI_MIN_VERSION, v as removeOwnPiAgentMirror, w as enableFileLogging, x as stopKeepAwake, y as sweepStalePiAgentMirrors } from "./server-setup-DVPL9iph.js";
6
- import { At as cloudAgentToolsEnabled, Ct as browserToolsEnabled, D as toolbeltEnabled, En as provisionAndIndexColbert, Ht as kustoToolsEnabled, Tn as colbertDegradedWarning, _t as artifactToolsEnabled, ht as adoToolsEnabled, on as registerLaunch, sn as unregisterLaunch, xt as browseAgentEnabled, yn as provisionBrowserAssets } from "./peer-mcp-personas-BOgR46nM.js";
7
- import { E as LOCAL_PROFILE_TIER_MODELS, _ as isCheapestFamily, b as local2AdvisorContract, f as balancedContractFor, g as isBalancedFamily, p as cheapestContractFor, v as isLocalFamily, x as localContractFor } from "./static-context-pack-ChHuxBpk.js";
4
+ import { t as state } from "./state-DzsaGHr9.js";
5
+ import { H as profileDescriptor, I as formatBalancedPrerequisiteFailure, S as enableFileLogging, U as resolveLaunchProfile, V as formatLocalPrerequisiteFailure, W as validateBalancedProfilePrerequisites, Y as validateLocalProfilePrerequisites, Z as runSelfUpdate, _ as sweepStalePiAgentMirrors, a as setupAndServe, c as PI_MIN_VERSION, d as meetsPiMinVersion, f as refreshPiInBackground, g as removeOwnPiAgentMirror, h as ensurePiAgentMirror, i as parseSharedArgs, l as ensurePiInstalled, m as updatePi, o as sharedServerArgs, p as resolvePiRegistry, q as validateCheapestProfilePrerequisites, r as getPiLaunchEnvVars, s as LAUNCH_SECRET_HEADER, u as getInstalledPiVersion, v as startKeepAwake, y as stopKeepAwake, z as formatCheapestPrerequisiteFailure } from "./server-setup-rm8ELtYa.js";
6
+ import { At as browserToolsEnabled, D as toolbeltEnabled, Ln as colbertDegradedWarning, Lt as cloudAgentToolsEnabled, Ot as browseAgentEnabled, Rn as provisionAndIndexColbert, St as adoToolsEnabled, Yt as kustoToolsEnabled, _n as registerLaunch, in as workiqToolsEnabled, jn as provisionBrowserAssets, ln as configureLocalEgress, un as localBaseUrl, wt as artifactToolsEnabled, yn as unregisterLaunch } from "./peer-mcp-personas-6zWkXHQW.js";
7
+ import { D as LOCAL_PROFILE_TIER_MODELS, S as localContractFor, _ as isCheapestFamily, f as balancedContractFor, g as isBalancedFamily, p as cheapestContractFor, v as isCheaplocalProfile, x as local2AdvisorContract, y as isLocalFamily } from "./static-context-pack-DvwLWlbe.js";
8
8
  import { r as resolveSelfInvocation } from "./self-invocation-BtcGj-lY.js";
9
- import { i as launchChild, t as provisionToolbelt } from "./provision-DkWR9B6I.js";
10
- import { d as removeAicLedgerFile, f as sweepStaleAicLedgerFiles, n as aicSnapshot, o as formatAicExitSummary, t as aicLedgerPath } from "./aic-ledger-_mvGW2Ev.js";
11
- import { t as FRESH_CONSULT_CONTRACT } from "./claude-md-injection-BV4tPUWo.js";
9
+ import { i as launchChild, t as provisionToolbelt } from "./provision-C_aTowyW.js";
10
+ import { d as removeAicLedgerFile, f as sweepStaleAicLedgerFiles, n as aicSnapshot, o as formatAicExitSummary, t as aicLedgerPath } from "./aic-ledger-Cp7Yk9-Q.js";
11
+ import { t as FRESH_CONSULT_CONTRACT } from "./claude-md-injection-K3DKhsfI.js";
12
12
  import { i as buildAicStatusHookCommand, n as AIC_STATUSLINE_DISABLE_ENV, t as AIC_LEDGER_ENV } from "./aic-statusline-settings-B5EMMSFC.js";
13
- import { n as formatDiscountedCostTable, t as discountedUsdForSnapshot } from "./copilot-discount-BuDbQOHq.js";
13
+ import { n as formatDiscountedCostTable, t as discountedUsdForSnapshot } from "./copilot-discount-T-cfWmc4.js";
14
14
  import { defineCommand } from "citty";
15
15
  import consola from "consola";
16
16
  import { existsSync } from "node:fs";
@@ -1836,6 +1836,17 @@ const PI_MCP_NONCE_PLACEHOLDER = "Bearer ${GH_ROUTER_HOOK_NONCE}";
1836
1836
  */
1837
1837
  const PI_MCP_WORKSPACE_PLACEHOLDER = "${GH_ROUTER_WORKSPACE}";
1838
1838
  /**
1839
+ * Header carrying the launch's conversation id on the MCP connection.
1840
+ *
1841
+ * Pi's MCP client, like Claude Code's, sends no conversation header, and a
1842
+ * `cheaplocal` Oracle call has nothing else to key the local endpoint's
1843
+ * prompt-cache routing on. `cheaplocal` is the only profile that reads it, so
1844
+ * on every other Pi launch the value is inert; writing it unconditionally
1845
+ * keeps the entry shape uniform rather than making one profile's config look
1846
+ * different for a header nobody else consumes.
1847
+ */
1848
+ const PI_MCP_SESSION_ID_HEADER = "x-claude-code-session-id";
1849
+ /**
1839
1850
  * Deferred, not direct.
1840
1851
  *
1841
1852
  * `deferred` keeps the tools out of the declared tool set until `tool_search`
@@ -1876,7 +1887,7 @@ function readMcpServerKeys(raw) {
1876
1887
  * what a server is, so each one says what the group does and when to reach for
1877
1888
  * it rather than naming the server back at the model.
1878
1889
  *
1879
- * Only the seven groups a Pi profile can reach are listed. `orchestrate`,
1890
+ * Only the eight groups a Pi profile can reach are listed. `orchestrate`,
1880
1891
  * `decide`, `fleet` and `first-mate` sit outside every Pi profile's
1881
1892
  * `allowedGroups` (`src/lib/launch-profile.ts`), so `resolvePiSurfaces` can
1882
1893
  * never emit them and a description for them would be dead text.
@@ -1888,7 +1899,8 @@ const GROUP_DESCRIPTIONS = {
1888
1899
  browser: "Drive a real Chrome or Edge tab: open, navigate, read the page, screenshot, click, type, evaluate JavaScript. Reach for it when the answer lives in a web UI rather than in the repository.",
1889
1900
  ado: "Azure DevOps for the open repository: repositories, work items, pipelines and wikis.",
1890
1901
  kusto: "Azure Data Explorer: query and management commands against the cluster named on each call, or the launch default.",
1891
- cloudagent: "Microsoft Cloud Agent jobs: hand a prompt plus an Azure DevOps repository to a cloud coding agent, then poll it for hours and collect the answer. create_job, create_pr_job and cancel_job spend compute; confirm with the user before creating a job the user did not ask for."
1902
+ cloudagent: "Microsoft Cloud Agent jobs: hand a prompt plus an Azure DevOps repository to a cloud coding agent, then poll it for hours and collect the answer. create_job, create_pr_job and cancel_job spend compute; confirm with the user before creating a job the user did not ask for.",
1903
+ workiq: "Microsoft 365 research through Work IQ: ask a question across mail, files, chats, meetings and sites, retrieve with citations, or fetch specific entity URLs. Reach for it when the answer lives in the user's M365 data rather than in the repository."
1892
1904
  };
1893
1905
  /** The `peers` half of `GROUP_DESCRIPTIONS.peers`, split out so the oracle's
1894
1906
  * availability can be stated rather than assumed. */
@@ -1934,7 +1946,7 @@ function peersGroupDescription(personas, artifactAvailable) {
1934
1946
  * is available, `browser` under `--browse`, and the three Azure groups under
1935
1947
  * their own predicates. Everything is then filtered through
1936
1948
  * `profileDescriptor(profileId).allowedGroups`, which is
1937
- * `{peers, search, browser, ado, kusto, cloudagent}` for `local`/`local2` and
1949
+ * `{peers, search, browser, ado, kusto, cloudagent, workiq}` for `local`/`local2` and
1938
1950
  * adds `workers` for the other four Pi profiles — so `orchestrate`, `decide`,
1939
1951
  * `fleet` and `first-mate` stay off everywhere.
1940
1952
  */
@@ -1958,6 +1970,7 @@ function resolvePiSurfaces(opts) {
1958
1970
  if (opts.adoEnabled) push("ado");
1959
1971
  if (opts.kustoEnabled) push("kusto");
1960
1972
  if (opts.cloudAgentEnabled) push("cloudagent");
1973
+ if (opts.workiqEnabled) push("workiq");
1961
1974
  return {
1962
1975
  search: opts.searchEnabled,
1963
1976
  codeSearch: opts.searchEnabled || opts.bluebirdEnabled,
@@ -2014,16 +2027,19 @@ async function writePiMcpJson(opts) {
2014
2027
  }
2015
2028
  const added = [];
2016
2029
  const nextServers = { ...existingServers };
2030
+ const sessionId = opts.sessionId?.trim();
2017
2031
  for (const group of opts.groups) {
2018
2032
  const key = piMcpServerKey(group.group);
2019
2033
  added.push(key);
2034
+ const headers = {
2035
+ Authorization: PI_MCP_NONCE_PLACEHOLDER,
2036
+ "X-GH-Workspace": PI_MCP_WORKSPACE_PLACEHOLDER
2037
+ };
2038
+ if (sessionId !== void 0 && sessionId.length > 0) headers[PI_MCP_SESSION_ID_HEADER] = sessionId;
2020
2039
  nextServers[key] = {
2021
2040
  type: "http",
2022
2041
  url: `${opts.serverUrl}/mcp/${group.group}`,
2023
- headers: {
2024
- Authorization: PI_MCP_NONCE_PLACEHOLDER,
2025
- "X-GH-Workspace": PI_MCP_WORKSPACE_PLACEHOLDER
2026
- },
2042
+ headers,
2027
2043
  exposure: PI_MCP_EXPOSURE,
2028
2044
  description: group.description
2029
2045
  };
@@ -2181,6 +2197,10 @@ const pi = defineCommand({
2181
2197
  }
2182
2198
  const parsed = parseSharedArgs(args);
2183
2199
  const launchProfileId = resolveLaunchProfile(args.model);
2200
+ if (isCheaplocalProfile(launchProfileId)) {
2201
+ process$1.stderr.write("github-router pi does not support -m cheaplocal: Pi's model settings bind one provider per profile, and cheaplocal's Advisor and Oracle are served by the local endpoint. Use -m cheapest or -m cheapest2 on Pi, or run `github-router claude -m cheaplocal`.\n");
2202
+ process$1.exit(1);
2203
+ }
2184
2204
  if (!isCheapestFamily(launchProfileId) && !isBalancedFamily(launchProfileId) && !isLocalFamily(launchProfileId)) {
2185
2205
  process$1.stderr.write(`github-router pi supports only -m cheapest, -m cheapest2, -m balanced, -m balanced2, -m local, and -m local2 (got ${JSON.stringify(args.model ?? "")}).\n`);
2186
2206
  process$1.exit(1);
@@ -2278,6 +2298,7 @@ const pi = defineCommand({
2278
2298
  adoEnabled: adoToolsEnabled(),
2279
2299
  kustoEnabled: kustoToolsEnabled(),
2280
2300
  cloudAgentEnabled: cloudAgentToolsEnabled(),
2301
+ workiqEnabled: workiqToolsEnabled(),
2281
2302
  browseAgentAvailable: browseAgentEnabled(),
2282
2303
  directBrowserAvailable: browseEnabled,
2283
2304
  artifactToolsAvailable: artifactToolsEnabled(),
@@ -2385,7 +2406,8 @@ const pi = defineCommand({
2385
2406
  mirrorDir: mirror,
2386
2407
  workspace: process$1.cwd(),
2387
2408
  serverUrl,
2388
- groups: surfaces.groups
2409
+ groups: surfaces.groups,
2410
+ sessionId: state.sessionId
2389
2411
  });
2390
2412
  if (written.skippedReason) consola.warn(`Pi MCP: left ${written.path} alone (${written.skippedReason}); the scoped groups are not exposed to Pi this launch.`);
2391
2413
  else for (const { key, file } of written.shadowed) consola.warn(`Pi MCP: ${file} declares "${key}" and outranks the mirror copy, so the router's version is not the one Pi will run. Rename that entry to keep both.`);
@@ -2490,8 +2512,8 @@ const pi = defineCommand({
2490
2512
  serverUrl
2491
2513
  })}\n`);
2492
2514
  if (sweEnabled && !peersEnabled) process$1.stderr.write("Note: --swe without --peers emits no delegate/review skills or prompts (no agents behind them in a peerless launch).\n");
2493
- const { disposeBluebirdClients } = await import("./bluebird-client-DGE3WZqh.js");
2494
- const { disposeAdoClients } = await import("./ado-tools-rysFZDws.js");
2515
+ const { disposeBluebirdClients } = await import("./bluebird-client-CY6NBHQu.js");
2516
+ const { disposeAdoClients } = await import("./ado-tools-B5MNQMFs.js");
2495
2517
  launchChild({
2496
2518
  kind: "pi",
2497
2519
  envVars: {
@@ -2529,4 +2551,4 @@ const pi = defineCommand({
2529
2551
  //#endregion
2530
2552
  export { pi };
2531
2553
 
2532
- //# sourceMappingURL=pi-DcWp83mx.js.map
2554
+ //# sourceMappingURL=pi-DJJlBHP9.js.map