github-router 0.3.369 → 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 (72) 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-zoBxw08y.js → attribution-settings-Cppl9atx.js} +6 -6
  5. package/dist/{attribution-settings-zoBxw08y.js.map → attribution-settings-Cppl9atx.js.map} +1 -1
  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/{bluebird-client-C29-JOkG.js → bluebird-client-ByCRusGQ.js} +3 -3
  9. package/dist/bluebird-client-ByCRusGQ.js.map +1 -0
  10. package/dist/bluebird-client-CY6NBHQu.js +1 -0
  11. package/dist/browser-ext/manifest.json +1 -1
  12. package/dist/{check-usage-45vyaLfl.js → check-usage-T_z84Pgc.js} +3 -3
  13. package/dist/{check-usage-45vyaLfl.js.map → check-usage-T_z84Pgc.js.map} +1 -1
  14. package/dist/{claude-BbIfnWbm.js → claude-B3qNFwtc.js} +18 -15
  15. package/dist/claude-B3qNFwtc.js.map +1 -0
  16. package/dist/{claude-md-injection-BtBG1RBZ.js → claude-md-injection-K3DKhsfI.js} +3 -3
  17. package/dist/{claude-md-injection-BtBG1RBZ.js.map → claude-md-injection-K3DKhsfI.js.map} +1 -1
  18. package/dist/{codex-CZVlP2tB.js → codex-3DEffjlm.js} +8 -8
  19. package/dist/{codex-CZVlP2tB.js.map → codex-3DEffjlm.js.map} +1 -1
  20. package/dist/{copilot-discount-BuDbQOHq.js → copilot-discount-T-cfWmc4.js} +2 -2
  21. package/dist/{copilot-discount-BuDbQOHq.js.map → copilot-discount-T-cfWmc4.js.map} +1 -1
  22. package/dist/engine-C2YCclx0.js +1 -0
  23. package/dist/{gate-discovery-BYyYeUnn.js → gate-discovery-BV6UGGVd.js} +2 -2
  24. package/dist/{gate-discovery-BYyYeUnn.js.map → gate-discovery-BV6UGGVd.js.map} +1 -1
  25. package/dist/{get-copilot-usage-BbGmK03C.js → get-copilot-usage-BSXeQEx8.js} +3 -3
  26. package/dist/{get-copilot-usage-BbGmK03C.js.map → get-copilot-usage-BSXeQEx8.js.map} +1 -1
  27. package/dist/hooks.mjs +2 -0
  28. package/dist/hooks.sha256 +1 -1
  29. package/dist/{internal-aic-status-BAVomi5A.js → internal-aic-status-CY0QxSa7.js} +3 -3
  30. package/dist/{internal-aic-status-BAVomi5A.js.map → internal-aic-status-CY0QxSa7.js.map} +1 -1
  31. package/dist/{internal-max-dispatch-guard-BodVFHRC.js → internal-max-dispatch-guard-4rh6KSd8.js} +2 -2
  32. package/dist/{internal-max-dispatch-guard-BodVFHRC.js.map → internal-max-dispatch-guard-4rh6KSd8.js.map} +1 -1
  33. package/dist/{internal-max-dispatch-guard-BB0vwiPx.js → internal-max-dispatch-guard-CKnzgJje.js} +1 -1
  34. package/dist/{internal-stop-hook-BbyobGUU.js → internal-stop-hook-covotLvl.js} +2 -2
  35. package/dist/{internal-stop-hook-BbyobGUU.js.map → internal-stop-hook-covotLvl.js.map} +1 -1
  36. package/dist/main.js +12 -11
  37. package/dist/main.js.map +1 -1
  38. package/dist/{max-profile-contract-Cx5_Z1Y7.js → max-profile-contract-CRj7N211.js} +2 -2
  39. package/dist/{max-profile-contract-Cx5_Z1Y7.js.map → max-profile-contract-CRj7N211.js.map} +1 -1
  40. package/dist/{models-BR6i348u.js → models-Ca-HQTYi.js} +2 -2
  41. package/dist/{models-BR6i348u.js.map → models-Ca-HQTYi.js.map} +1 -1
  42. package/dist/{peer-mcp-personas-DNtWI2C1.js → peer-mcp-personas-6zWkXHQW.js} +463 -27
  43. package/dist/peer-mcp-personas-6zWkXHQW.js.map +1 -0
  44. package/dist/{pi-Bc-MVgAo.js → pi-DJJlBHP9.js} +16 -13
  45. package/dist/{pi-Bc-MVgAo.js.map → pi-DJJlBHP9.js.map} +1 -1
  46. package/dist/{provision-DUWdcY_a.js → provision-C_aTowyW.js} +3 -2
  47. package/dist/provision-C_aTowyW.js.map +1 -0
  48. package/dist/{serve-CmWOTR7m.js → serve-CfizTkRS.js} +18 -10
  49. package/dist/serve-CfizTkRS.js.map +1 -0
  50. package/dist/{server-setup-CIzmDJzT.js → server-setup-rm8ELtYa.js} +56 -21
  51. package/dist/server-setup-rm8ELtYa.js.map +1 -0
  52. package/dist/{start-rlpaeAtx.js → start-D7RcHG8T.js} +3 -3
  53. package/dist/{start-rlpaeAtx.js.map → start-D7RcHG8T.js.map} +1 -1
  54. package/dist/{state-CiwCLVDZ.js → state-DzsaGHr9.js} +3 -1
  55. package/dist/{state-CiwCLVDZ.js.map → state-DzsaGHr9.js.map} +1 -1
  56. package/dist/token-CVG0yI_j.js +480 -0
  57. package/dist/token-CVG0yI_j.js.map +1 -0
  58. package/dist/{token-OTb61rOC.js → token-Dqjs5ixP.js} +3 -3
  59. package/dist/{token-OTb61rOC.js.map → token-Dqjs5ixP.js.map} +1 -1
  60. package/dist/workiq-qnJR5_n2.js +144 -0
  61. package/dist/workiq-qnJR5_n2.js.map +1 -0
  62. package/dist/workiq-tools-BeTneKco.js +1 -0
  63. package/package.json +1 -1
  64. package/dist/ado-tools-C0sY_rX1.js +0 -1
  65. package/dist/bluebird-client-C29-JOkG.js.map +0 -1
  66. package/dist/bluebird-client-DGE3WZqh.js +0 -1
  67. package/dist/claude-BbIfnWbm.js.map +0 -1
  68. package/dist/engine-DeIo-VIR.js +0 -1
  69. package/dist/peer-mcp-personas-DNtWI2C1.js.map +0 -1
  70. package/dist/provision-DUWdcY_a.js.map +0 -1
  71. package/dist/serve-CmWOTR7m.js.map +0 -1
  72. package/dist/server-setup-CIzmDJzT.js.map +0 -1
@@ -2,21 +2,22 @@ import { A as validateWorkspace, C as provisionColbert, D as colbertPlatformSupp
2
2
  import { n as explicitPackageRoot } from "./package-root-B-osctCk.js";
3
3
  import { t as getPackageVersion } from "./version-C8x2hQrZ.js";
4
4
  import { t as PATHS } from "./paths-C5477RGC.js";
5
- import { t as state } from "./state-CiwCLVDZ.js";
6
- import { C as githubAgentGraphQLHeaders, S as copilotVersion, b as copilotBaseUrl, d as resolveModel, f as sleep$3, g as HTTPError, h as isAllowedCopilotHost, i as tryRefreshAndRetry, v as GITHUB_API_BASE_URL, w as githubAgentHeaders, x as copilotHeaders, y as GITHUB_GRAPHQL_URL } from "./token-OTb61rOC.js";
5
+ import { t as state } from "./state-DzsaGHr9.js";
6
+ import { C as copilotHeaders, E as githubAgentHeaders, S as copilotBaseUrl, T as githubAgentGraphQLHeaders, _ as isAllowedCopilotHost, b as GITHUB_API_BASE_URL, f as resolveModel, i as tryRefreshAndRetry, p as sleep$3, v as HTTPError, w as copilotVersion, x as GITHUB_GRAPHQL_URL } from "./token-Dqjs5ixP.js";
7
7
  import { a as withTransientRetry, i as sanitizeTransportText, n as classifyTransportError, r as fetchWithTransientRetry } from "./upstream-retry-i1k1Xai2.js";
8
8
  import { a as parseBoolEnv, d as runManagedExeCapture, o as parseIntEnv, s as resolveExecutable } from "./exec-Bf8g_bIR.js";
9
9
  import { a as FAST_PROFILE_ASTRA_MODEL, c as FAST_PROFILE_MODELS, d as FAST_PROFILE_NATIVE_MODELS, f as FAST_PROFILE_ORACLE_EFFORT, n as FAST_PROFILE_ADVISOR_EFFORT, p as FAST_PROFILE_ORACLE_MODEL, r as FAST_PROFILE_ADVISOR_MODEL, u as FAST_PROFILE_NATIVE_EFFORTS } from "./fast-profile-contract-JOnZBgFB.js";
10
10
  import { A as CHEAPEST_PROFILE_ADVISOR_MODEL, C as BALANCED2_PROFILE_MODELS, M as CHEAPEST_PROFILE_ADVISOR_TRANSCRIPT_TOKENS_MAX, N as CHEAPEST_PROFILE_ADVISOR_TRANSCRIPT_TOKENS_MIN, O as CHEAPEST2_PROFILE_MODELS, P as CHEAPEST_PROFILE_MODELS, S as localContractFor, _ as isCheapestFamily, a as decidePromptSubmitV2, b as isPinnedLaunchProfile, c as CHEAPEST_REWRITE_EFFORT, f as balancedContractFor, g as isBalancedFamily, h as displayModelName, j as CHEAPEST_PROFILE_ADVISOR_TRANSCRIPT_TOKENS_DEFAULT, m as cheapestRewriteModelFor, p as cheapestContractFor, t as buildStaticPack, u as isCheapestRewriteDisabledEnv, v as isCheaplocalProfile, w as LOCAL_PROFILE_LEAD_MODEL, y as isLocalFamily } from "./static-context-pack-DvwLWlbe.js";
11
11
  import { r as BALANCED_PROFILE_MODELS } from "./balanced-profile-contract-Dm_usmw7.js";
12
- import { A as normalizeTrailingOneMSuffix, D as maxPeerInstructions, E as maxPeerDescription, O as fastEndpointForCatalogId, b as MAX_ADVISOR_SYSTEM_PROMPT, f as maxCodexReviewerModel, g as maxProReplacementModel, h as maxOpusModel, i as MAX_PROFILE_MODELS, k as fastEndpointForModel, m as maxGrokModel, p as maxGeminiModel, r as MAX_PROFILE_LEAD_MODEL, v as maxSonnetModel } from "./max-profile-contract-Cx5_Z1Y7.js";
12
+ import { A as normalizeTrailingOneMSuffix, D as maxPeerInstructions, E as maxPeerDescription, O as fastEndpointForCatalogId, b as MAX_ADVISOR_SYSTEM_PROMPT, f as maxCodexReviewerModel, g as maxProReplacementModel, h as maxOpusModel, i as MAX_PROFILE_MODELS, k as fastEndpointForModel, m as maxGrokModel, p as maxGeminiModel, r as MAX_PROFILE_LEAD_MODEL, v as maxSonnetModel } from "./max-profile-contract-CRj7N211.js";
13
13
  import { i as registerExitHandlers$1, n as getInstanceUuid, r as recordWorkerRepo, t as WorktreeRegistry } from "./lifecycle-Gge2Dadd.js";
14
14
  import { t as MCP_WORKSPACE_HEADER } from "./mcp-workspace-header-Xw9B1W6T.js";
15
15
  import { n as ArtifactError, r as applyInsecureTls, t as ArtifactClient } from "./client-CQMfroGV.js";
16
16
  import { f as stopReviewStateDir, n as fileFindingsStore, o as fileRewriteFlagStore, r as fileLastPromptStore } from "./stop-gate-policy-Dx9c98_d.js";
17
- import { _ as RemoteMcpError, b as sanitizeRemoteDetail, f as getAzureRepoFromGit, g as RemoteMcpClient, h as describeAzFailure, l as ensureBluebirdClient, m as AzCliAccessTokenCache, o as BluebirdError, p as resolveAzureRepoIds, v as isRecord$4, x as sleep$4, y as parseRetryAfter } from "./bluebird-client-C29-JOkG.js";
17
+ import { _ as RemoteMcpError, b as sanitizeRemoteDetail, f as getAzureRepoFromGit, g as RemoteMcpClient, h as describeAzFailure, l as ensureBluebirdClient, m as AzCliAccessTokenCache, o as BluebirdError, p as resolveAzureRepoIds, v as isRecord$4, x as sleep$4, y as parseRetryAfter } from "./bluebird-client-ByCRusGQ.js";
18
18
  import { r as registerColbertExitHandlers } from "./lifecycle-9nX09dBl.js";
19
- import { a as extractAndRecordPricedAic, i as extractAndRecordAic, l as recordAic, m as extractCopilotUsage, u as recordZeroCostRequest } from "./aic-ledger-_mvGW2Ev.js";
19
+ import { a as extractAndRecordPricedAic, i as extractAndRecordAic, l as recordAic, m as extractCopilotUsage, u as recordZeroCostRequest } from "./aic-ledger-Cp7Yk9-Q.js";
20
+ import { d as WORKIQ_READ_TOOLS, f as WORKIQ_RETRIEVAL_CONTENT_TYPE, i as ensureWorkiqToken, m as WORKIQ_WRITE_TOOLS, n as WorkiqAuthError, t as AUTH_REMEDY, u as WORKIQ_PROTOCOL_VERSION } from "./token-CVG0yI_j.js";
20
21
  import { h as runGateChecks, m as sealedGateIds, p as resolveSealedGate } from "./stop-gate-hook-DnLC09Lg.js";
21
22
  import { t as liveExec } from "./orchestration-D3-2ulhX.js";
22
23
  import { createRequire } from "node:module";
@@ -27831,6 +27832,18 @@ function kustoToolsEnabled() {
27831
27832
  function cloudAgentToolsEnabled() {
27832
27833
  return state.cloudAgentEnabled;
27833
27834
  }
27835
+ /**
27836
+ * Gate for the Work IQ MCP group (`mcp__workiq__*`).
27837
+ *
27838
+ * Returns true iff `setupAndServe` resolved the group ON, exactly like
27839
+ * `adoToolsEnabled()`. The launch path is the only availability check there
27840
+ * is: `provisionWorkiqTools()` performs the `initialize` + `tools/list` round
27841
+ * trip and turns the group OFF when either fails, so a true here means a real
27842
+ * snapshot is waiting behind the tools this gate is hiding or showing.
27843
+ */
27844
+ function workiqToolsEnabled() {
27845
+ return state.workiqEnabled;
27846
+ }
27834
27847
  const ADO_TOKEN_RESOURCE = "2a72489c-aab2-4b65-b93a-a91edccf33b8";
27835
27848
  const ADO_PROTOCOL_VERSION = "2025-06-18";
27836
27849
  const ADO_TOKEN_ENV = "ADO_MCP_TOKEN";
@@ -28035,16 +28048,16 @@ var AdoMcpClient = class extends RemoteMcpClient {
28035
28048
  * a broken one, and neither is worth the bytes.
28036
28049
  */
28037
28050
  /** Bound on the launch-time `initialize` + `tools/list` round trip. */
28038
- const PROVISION_TIMEOUT_MS = 2e4;
28051
+ const PROVISION_TIMEOUT_MS$1 = 2e4;
28039
28052
  const ADO_GROUP = "ado";
28040
- let client = null;
28041
- let inflight = null;
28042
- let snapshot = [];
28053
+ let client$1 = null;
28054
+ let inflight$1 = null;
28055
+ let snapshot$1 = [];
28043
28056
  /** Close the upstream session. Best-effort; safe when nothing was created. */
28044
28057
  async function disposeAdoClients() {
28045
- const current = client;
28046
- client = null;
28047
- snapshot = [];
28058
+ const current = client$1;
28059
+ client$1 = null;
28060
+ snapshot$1 = [];
28048
28061
  if (current) await current.dispose().catch(() => {});
28049
28062
  }
28050
28063
  /**
@@ -28059,8 +28072,8 @@ async function disposeAdoClients() {
28059
28072
  * request-end abort cannot tear down a client other calls are using.
28060
28073
  */
28061
28074
  async function ensureAdoClient(signal) {
28062
- if (client) return client;
28063
- const existing = inflight;
28075
+ if (client$1) return client$1;
28076
+ const existing = inflight$1;
28064
28077
  if (existing) return existing;
28065
28078
  const promise = (async () => {
28066
28079
  const organization = state.adoOrganization;
@@ -28073,14 +28086,14 @@ async function ensureAdoClient(signal) {
28073
28086
  token
28074
28087
  });
28075
28088
  await created.initialize(signal);
28076
- client = created;
28089
+ client$1 = created;
28077
28090
  return created;
28078
28091
  })();
28079
- inflight = promise;
28092
+ inflight$1 = promise;
28080
28093
  try {
28081
28094
  return await promise;
28082
28095
  } finally {
28083
- if (inflight === promise) inflight = null;
28096
+ if (inflight$1 === promise) inflight$1 = null;
28084
28097
  }
28085
28098
  }
28086
28099
  /**
@@ -28099,16 +28112,16 @@ async function provisionAdoTools() {
28099
28112
  reason: "ado group is not enabled"
28100
28113
  };
28101
28114
  const timer = new AbortController();
28102
- const handle = setTimeout(() => timer.abort(/* @__PURE__ */ new Error("Azure DevOps MCP provisioning timed out")), PROVISION_TIMEOUT_MS);
28115
+ const handle = setTimeout(() => timer.abort(/* @__PURE__ */ new Error("Azure DevOps MCP provisioning timed out")), PROVISION_TIMEOUT_MS$1);
28103
28116
  handle.unref?.();
28104
28117
  try {
28105
28118
  const created = await ensureAdoClient(timer.signal);
28106
28119
  if (timer.signal.aborted) throw new Error("Azure DevOps MCP provisioning timed out");
28107
- snapshot = buildAdoToolEntries(created.listAdoTools());
28108
- if (snapshot.length === 0) throw new Error("Azure DevOps advertised no tools for the selected toolsets");
28120
+ snapshot$1 = buildAdoToolEntries(created.listAdoTools());
28121
+ if (snapshot$1.length === 0) throw new Error("Azure DevOps advertised no tools for the selected toolsets");
28109
28122
  return {
28110
28123
  ok: true,
28111
- toolCount: snapshot.length
28124
+ toolCount: snapshot$1.length
28112
28125
  };
28113
28126
  } catch (err) {
28114
28127
  const reason = sanitizeRemoteDetail(err);
@@ -28171,6 +28184,414 @@ function buildAdoToolEntries(tools) {
28171
28184
  */
28172
28185
  function adoMcpToolEntries() {
28173
28186
  if (!state.adoEnabled) return [];
28187
+ return snapshot$1;
28188
+ }
28189
+ //#endregion
28190
+ //#region src/lib/workiq/client.ts
28191
+ /**
28192
+ * Work IQ MCP client: a thin subclass of the shared streamable-HTTP transport
28193
+ * pointed at `https://workiq.svc.cloud.microsoft/mcp`.
28194
+ *
28195
+ * The live server is STATELESS — `initialize` returns protocol `2025-06-18`
28196
+ * and no `mcp-session-id` — which `RemoteMcpClient` already handles: it sends
28197
+ * the header only when one was assigned. No transport change is required.
28198
+ *
28199
+ * The one thing this client adds beyond the transport is result shaping.
28200
+ * `retrieve` puts its payload in
28201
+ * `structuredContent["application/vnd.ms-workiq.retrieval"]`. The documented
28202
+ * shape there is a `markdown` answer beside `retrievalHits`; the live server
28203
+ * (measured 2026-11) instead returns `results`, each hit carrying its own
28204
+ * `markdown` snippet and an `id` that a `[^id]` marker would refer to. Both
28205
+ * shapes are rendered as text, because the unstructured fallback is raw JSON
28206
+ * that overruns the relay cap. Failure arrives two ways — `isError: true`, or a
28207
+ * successful envelope whose `stoppedReason` is `error`/`cancelled` — and both
28208
+ * must throw rather than reach the model as if they were an answer.
28209
+ */
28210
+ var WorkiqError = class extends RemoteMcpError {
28211
+ constructor(message, opts = {}) {
28212
+ super(message, opts);
28213
+ this.name = "WorkiqError";
28214
+ }
28215
+ };
28216
+ /** Upper bound on the sources block, so a hundred-hit answer cannot flood the model. */
28217
+ const MAX_SOURCES = 25;
28218
+ /**
28219
+ * Per-request deadline for a Work IQ call.
28220
+ *
28221
+ * The shared transport default is 30 s, which is right for a control-plane
28222
+ * server: `initialize`, `tools/list`, and ADO's lookups all finish well inside
28223
+ * it. `ask` and `retrieve` are not lookups. They run a model over the tenant's
28224
+ * indexed content and routinely take longer than 30 s, so the first live
28225
+ * retrieval was killed at 30.004 s before it could answer. Three minutes leaves
28226
+ * room for a slow tenant while still bounding a hung call; the model can retry.
28227
+ */
28228
+ const WORKIQ_REQUEST_TIMEOUT_MS = 18e4;
28229
+ function asNumber(value) {
28230
+ return typeof value === "number" && Number.isFinite(value) ? value : void 0;
28231
+ }
28232
+ function asString(value) {
28233
+ return typeof value === "string" && value.trim() ? value.trim() : void 0;
28234
+ }
28235
+ /**
28236
+ * The single nested object under `resourceMetadata`.
28237
+ *
28238
+ * The live payload keys that object by entity kind (`email`, `file`, ...) and
28239
+ * keeps the display fields one level down, so `resourceMetadata.email.subject`
28240
+ * is where an email hit's title actually lives.
28241
+ */
28242
+ function resourceMetadata(hit) {
28243
+ const metadata = isRecord$4(hit.resourceMetadata) ? hit.resourceMetadata : void 0;
28244
+ if (!metadata) return void 0;
28245
+ for (const value of Object.values(metadata)) if (isRecord$4(value)) return value;
28246
+ }
28247
+ /**
28248
+ * A hit's display title, falling back through the fields the live payload
28249
+ * carries (`title`, `name`, `subject`) and finally its entity type.
28250
+ */
28251
+ function hitTitle(hit, index) {
28252
+ const nested = resourceMetadata(hit);
28253
+ const title = asString(hit.title) ?? asString(hit.name) ?? asString(hit.subject) ?? asString(hit.displayName) ?? (nested ? asString(nested.title) ?? asString(nested.name) ?? asString(nested.subject) : void 0);
28254
+ const type = asString(hit.entityType) ?? asString(hit.type);
28255
+ if (title && type) return `${title} (${type})`;
28256
+ if (title) return title;
28257
+ if (type) return `(${type})`;
28258
+ return `Hit ${index + 1}`;
28259
+ }
28260
+ function hitUrl(hit) {
28261
+ return asString(hit.webUrl) ?? asString(hit.url) ?? asString(hit.link) ?? asString(hit.entityUrl) ?? asString(hit.path);
28262
+ }
28263
+ /** The compact citation list appended after retrieval markdown. */
28264
+ function formatWorkiqSources(hits) {
28265
+ const lines = [];
28266
+ for (const [index, raw] of hits.entries()) {
28267
+ if (lines.length >= MAX_SOURCES) break;
28268
+ if (!isRecord$4(raw)) continue;
28269
+ const url = hitUrl(raw);
28270
+ lines.push(`${index + 1}. ${hitTitle(raw, index)}${url ? ` — ${url}` : ""}`);
28271
+ }
28272
+ if (lines.length === 0) return "";
28273
+ return `\n\nSources${hits.length > lines.length ? ` (${hits.length - lines.length} more)` : ""}:\n${lines.join("\n")}`;
28274
+ }
28275
+ /** The per-hit body fields the live `retrieve` payload can carry. */
28276
+ function hitBody(hit) {
28277
+ return asString(hit.markdown) ?? asString(hit.text) ?? asString(hit.snippet) ?? asString(hit.summary) ?? asString(hit.content);
28278
+ }
28279
+ /**
28280
+ * Render `retrieval.results` as the grounding document.
28281
+ *
28282
+ * The documented retrieval shape puts the answer in a top-level `markdown`
28283
+ * beside a `retrievalHits` list. The live server (measured 2026-11) returns
28284
+ * neither: no `content` blocks, no top-level `markdown`, and the hits under
28285
+ * `results`, each carrying its own `markdown` snippet. Falling through to
28286
+ * `JSON.stringify` handed the model ~44 KB of raw JSON and dropped it at the
28287
+ * relay cap, so the snippets are laid out as numbered sections instead. The
28288
+ * hit's `id` (`h1`, `h2`, ...) is the label a `[^id]` marker refers to.
28289
+ */
28290
+ function formatWorkiqResults(hits) {
28291
+ const sections = [];
28292
+ for (const [index, raw] of hits.entries()) {
28293
+ if (!isRecord$4(raw)) continue;
28294
+ const body = hitBody(raw);
28295
+ if (!body) continue;
28296
+ const id = asString(raw.id) ?? String(index + 1);
28297
+ const url = hitUrl(raw);
28298
+ const heading = `[${id}] ${hitTitle(raw, index)}${url ? `\n${url}` : ""}`;
28299
+ sections.push(`${heading}\n${body}`);
28300
+ }
28301
+ return sections.join("\n\n");
28302
+ }
28303
+ /**
28304
+ * Turn an MCP `tools/call` result into the single text block the `/mcp`
28305
+ * handler forwards.
28306
+ *
28307
+ * - A tool-level failure throws. The message keeps Entra/the service's own
28308
+ * text and its `recoveryAction` (when present) so the model sees what the
28309
+ * server said it should do.
28310
+ * - A `retrieve` answer renders the structured payload. A top-level `markdown`
28311
+ * wins when the server sends one, because the generic `content[].text` copy
28312
+ * of a large answer is what the service truncates first; otherwise the
28313
+ * per-hit snippets in `results` are laid out as numbered sections.
28314
+ * - Everything else falls back to joining the text blocks.
28315
+ */
28316
+ function workiqResultText(result) {
28317
+ if (!isRecord$4(result)) throw new WorkiqError("Work IQ returned an empty result.", { retriable: true });
28318
+ const structured = isRecord$4(result.structuredContent) ? result.structuredContent : void 0;
28319
+ const retrievalRaw = structured?.[WORKIQ_RETRIEVAL_CONTENT_TYPE];
28320
+ const retrieval = isRecord$4(retrievalRaw) ? retrievalRaw : void 0;
28321
+ const stoppedReason = asString(retrieval?.stoppedReason);
28322
+ const upstreamError = asString(result.error) ?? asString(retrieval?.error);
28323
+ const recoveryAction = asString(retrieval?.recoveryAction);
28324
+ if (result.isError === true || stoppedReason === "error" || stoppedReason === "cancelled") {
28325
+ const texts = [];
28326
+ if (Array.isArray(result.content)) {
28327
+ for (const block of result.content) if (isRecord$4(block) && typeof block.text === "string" && block.text.trim()) texts.push(block.text.trim());
28328
+ }
28329
+ const detail = upstreamError ?? (texts.length > 0 ? texts.join("\n\n") : void 0);
28330
+ const parts = [`Work IQ reported an error${stoppedReason ? ` (${stoppedReason})` : ""}`];
28331
+ if (detail) parts.push(detail);
28332
+ if (recoveryAction) parts.push(`Suggested action: ${recoveryAction}`);
28333
+ if (parts.length === 1) parts.push("The service returned no further detail.");
28334
+ throw new WorkiqError(parts.join(": "), { retriable: false });
28335
+ }
28336
+ const resultHits = Array.isArray(retrieval?.results) ? retrieval.results : Array.isArray(retrieval?.retrievalHits) ? retrieval.retrievalHits : [];
28337
+ const citationHits = Array.isArray(retrieval?.retrievalHits) ? retrieval.retrievalHits : resultHits;
28338
+ const markdown = asString(retrieval?.markdown);
28339
+ if (markdown) return `${markdown.trim()}${formatWorkiqSources(citationHits)}`;
28340
+ const rendered = formatWorkiqResults(resultHits);
28341
+ if (rendered) return rendered;
28342
+ const sourcesOnly = formatWorkiqSources(citationHits);
28343
+ if (sourcesOnly) return sourcesOnly.trim();
28344
+ if (asNumber(retrieval?.resultCount) === 0) return "Work IQ found no results.";
28345
+ const texts = [];
28346
+ if (Array.isArray(result.content)) {
28347
+ for (const block of result.content) if (isRecord$4(block) && typeof block.text === "string" && block.text.trim()) texts.push(block.text);
28348
+ }
28349
+ const joined = texts.join("\n\n").trim();
28350
+ if (joined) return joined;
28351
+ if (structured) try {
28352
+ return JSON.stringify(structured);
28353
+ } catch {}
28354
+ return "Work IQ returned an empty result.";
28355
+ }
28356
+ var WorkiqMcpClient = class extends RemoteMcpClient {
28357
+ constructor(opts) {
28358
+ super({
28359
+ label: "Work IQ",
28360
+ baseUrl: opts.baseUrl ?? "https://workiq.svc.cloud.microsoft/mcp",
28361
+ protocolVersion: WORKIQ_PROTOCOL_VERSION,
28362
+ clientName: "github-router",
28363
+ clientVersion: "workiq",
28364
+ errorClass: WorkiqError,
28365
+ token: opts.token,
28366
+ requestTimeoutMs: WORKIQ_REQUEST_TIMEOUT_MS,
28367
+ tokenProvider: opts.tokenProvider ?? ((signal) => {
28368
+ consola.warn("Work IQ rejected the access token (401). Refreshing it; if this persists, run `github-router workiq auth`.");
28369
+ return ensureWorkiqToken({
28370
+ signal,
28371
+ forceRefresh: true
28372
+ });
28373
+ })
28374
+ });
28375
+ }
28376
+ /** The tools the server advertised, in the order it listed them. */
28377
+ listWorkiqTools() {
28378
+ return [...this.toolSchemas.values()].map((tool) => ({
28379
+ name: tool.name,
28380
+ description: tool.description ?? "",
28381
+ inputSchema: isRecord$4(tool.inputSchema) ? tool.inputSchema : {
28382
+ type: "object",
28383
+ properties: {}
28384
+ }
28385
+ }));
28386
+ }
28387
+ /** True iff the server advertised `name`. Guards a call the model invented. */
28388
+ hasTool(name) {
28389
+ return this.toolSchemas.has(name);
28390
+ }
28391
+ /** One `tools/call`, shaped through `workiqResultText`. */
28392
+ async callWorkiqTool(name, args, signal) {
28393
+ await this.initialize(signal);
28394
+ if (!this.hasTool(name)) throw new WorkiqError(`Work IQ does not advertise a tool named "${name}". Advertised tools: ${[...this.toolSchemas.keys()].sort().join(", ")}.`, { retriable: false });
28395
+ return { content: [{
28396
+ type: "text",
28397
+ text: workiqResultText(await this.callTool(name, args, signal))
28398
+ }] };
28399
+ }
28400
+ };
28401
+ //#endregion
28402
+ //#region src/lib/workiq-tools.ts
28403
+ /**
28404
+ * The `workiq` MCP group: Microsoft 365 research through the hosted Work IQ
28405
+ * service.
28406
+ *
28407
+ * Same dynamic-surface pattern as `./ado-tools`: the remote server owns the
28408
+ * tool set, so `tools/list` is forwarded from the upstream `tools/list`
28409
+ * instead of a frozen transcription that would drift silently. Two differences
28410
+ * are deliberate:
28411
+ *
28412
+ * - **Read-only is enforced HERE, not by a header.** The Work IQ server
28413
+ * advertises all twelve tools to every caller; its four mutating tools
28414
+ * (`create_entity`, `update_entity`, `delete_entity`, `do_action`) are
28415
+ * removed from the snapshot unless `--workiq-write` was passed. `call`-time
28416
+ * enforcement comes for free because a tool absent from the snapshot is
28417
+ * absent from `tools/call` too.
28418
+ * - **An unknown name is a signal.** The read allow-list is keyed to the
28419
+ * documented names, so a name outside both sets means the service shipped
28420
+ * something new. It is dropped with a warning that names `--workiq-write`,
28421
+ * which exposes whatever the live server actually advertises.
28422
+ * - **One name is renamed on the way out.** See {@link WORKIQ_TOOL_ALIASES}.
28423
+ *
28424
+ * The snapshot is taken ONCE at launch, awaited before the child process
28425
+ * starts, because the handler's tool accessor is synchronous. A failed
28426
+ * provision turns the group OFF with an actionable warning rather than leaving
28427
+ * an empty group advertised.
28428
+ */
28429
+ /** Bound on the launch-time `initialize` + `tools/list` round trip. */
28430
+ const PROVISION_TIMEOUT_MS = 2e4;
28431
+ const WORKIQ_GROUP = "workiq";
28432
+ /**
28433
+ * Upstream name → MCP-facing name. Only the exposed name changes; the handler
28434
+ * keeps calling the wire name.
28435
+ *
28436
+ * `list_agents` is the one collision: the `cloudagent` group already serves a
28437
+ * tool by that name, and `proxyOwnedMcpToolNames()` reserves it whether or not
28438
+ * that group is enabled in this process. On the canonical Azure DevOps setup,
28439
+ * where cloudagent auto-enables, an unrenamed `list_agents` would silently drop
28440
+ * one of the eight read tools on every launch. Renaming on the way out is the
28441
+ * same decoupling the browser tools use, and it is safe because dispatch keys
28442
+ * on `group`, not on the upstream name.
28443
+ */
28444
+ const WORKIQ_TOOL_ALIASES = /* @__PURE__ */ new Map([["list_agents", "agents"]]);
28445
+ let client = null;
28446
+ let inflight = null;
28447
+ let snapshot = [];
28448
+ /** Close the upstream session. Best-effort; safe when nothing was created. */
28449
+ async function disposeWorkiqClients() {
28450
+ const current = client;
28451
+ client = null;
28452
+ snapshot = [];
28453
+ if (current) await current.dispose().catch(() => {});
28454
+ }
28455
+ /**
28456
+ * The one process-lifetime Work IQ client. Single-flight, like `ensureAdoClient`,
28457
+ * for the same reason: concurrent first calls must not each start an
28458
+ * `initialize` handshake (and, worse, each trigger a token refresh, which
28459
+ * ROTATES the refresh token).
28460
+ *
28461
+ * `signal` bounds construction only. Once the client is memoized every later
28462
+ * caller returns immediately, so a request-end abort cannot tear down a client
28463
+ * other calls are using.
28464
+ */
28465
+ async function ensureWorkiqClient(signal) {
28466
+ if (client) return client;
28467
+ const existing = inflight;
28468
+ if (existing) return existing;
28469
+ const promise = (async () => {
28470
+ const created = new WorkiqMcpClient({ token: await ensureWorkiqToken({ ...signal ? { signal } : {} }) });
28471
+ await created.initialize(signal);
28472
+ client = created;
28473
+ return created;
28474
+ })();
28475
+ inflight = promise;
28476
+ try {
28477
+ return await promise;
28478
+ } finally {
28479
+ if (inflight === promise) inflight = null;
28480
+ }
28481
+ }
28482
+ /** The remedy a failed provision should print, or undefined for a network error. */
28483
+ function remedyFor(err) {
28484
+ if (err instanceof WorkiqAuthError) return err.remedy;
28485
+ const detail = sanitizeRemoteDetail(err);
28486
+ return /401|403|unauthori[sz]ed|forbidden|token/i.test(detail) ? AUTH_REMEDY : void 0;
28487
+ }
28488
+ /**
28489
+ * Fold the remedy into the message a TOOL CALL surfaces.
28490
+ *
28491
+ * The MCP boundary forwards only `err.message` to the model, so a
28492
+ * `WorkiqAuthError` whose `remedy` stays a separate property reaches the caller
28493
+ * as "No Work IQ login found at <path>." with nothing to act on. Provisioning
28494
+ * prints the remedy itself; the call path has to put it in the message.
28495
+ */
28496
+ function withCallTimeRemedy(err) {
28497
+ if (!(err instanceof Error)) return err;
28498
+ const remedy = remedyFor(err);
28499
+ if (!remedy || err.message.includes(remedy)) return err;
28500
+ const surfaced = new Error(`${err.message} ${remedy}`, { cause: err });
28501
+ surfaced.name = err.name;
28502
+ return surfaced;
28503
+ }
28504
+ /**
28505
+ * Resolve the Work IQ tool surface and snapshot it for this process.
28506
+ *
28507
+ * Called from `setupAndServe` before the child spawns. Never throws: the launch
28508
+ * is not the right place to fail over a network or consent dependency. On
28509
+ * failure the group is turned OFF, because a `workiq` server that advertises no
28510
+ * tools is worse than an absent one.
28511
+ */
28512
+ async function provisionWorkiqTools() {
28513
+ if (!state.workiqEnabled) return {
28514
+ ok: false,
28515
+ reason: "workiq group is not enabled"
28516
+ };
28517
+ const timer = new AbortController();
28518
+ const handle = setTimeout(() => timer.abort(/* @__PURE__ */ new Error("Work IQ MCP provisioning timed out")), PROVISION_TIMEOUT_MS);
28519
+ handle.unref?.();
28520
+ try {
28521
+ const created = await ensureWorkiqClient(timer.signal);
28522
+ if (timer.signal.aborted) throw new Error("Work IQ MCP provisioning timed out");
28523
+ snapshot = buildWorkiqToolEntries(created.listWorkiqTools(), { write: state.workiqWriteEnabled });
28524
+ if (snapshot.length === 0) throw new Error("Work IQ advertised no usable tools");
28525
+ return {
28526
+ ok: true,
28527
+ toolCount: snapshot.length
28528
+ };
28529
+ } catch (err) {
28530
+ const reason = sanitizeRemoteDetail(err);
28531
+ state.workiqEnabled = false;
28532
+ await disposeWorkiqClients();
28533
+ const remedy = remedyFor(err);
28534
+ consola.warn(`Work IQ MCP group disabled: ${reason}` + (remedy ? ` ${remedy}` : " Check the network path to workiq.svc.cloud.microsoft, then relaunch."));
28535
+ return {
28536
+ ok: false,
28537
+ reason
28538
+ };
28539
+ } finally {
28540
+ clearTimeout(handle);
28541
+ }
28542
+ }
28543
+ /**
28544
+ * Map the upstream descriptors onto the proxy's non-persona tool shape.
28545
+ *
28546
+ * Exported for tests, which feed recorded fixtures through it to pin the
28547
+ * read-only filter, the unknown-name warning, and the collision behaviour
28548
+ * without a live endpoint.
28549
+ */
28550
+ function buildWorkiqToolEntries(tools, opts) {
28551
+ const proxyOwned = proxyOwnedMcpToolNames();
28552
+ const seen = /* @__PURE__ */ new Set();
28553
+ const entries = [];
28554
+ for (const tool of tools) {
28555
+ const wireName = tool.name?.trim();
28556
+ if (!wireName) continue;
28557
+ if (!opts.write && !WORKIQ_READ_TOOLS.has(wireName)) {
28558
+ if (!WORKIQ_WRITE_TOOLS.has(wireName)) consola.warn(`Work IQ tool "${wireName}" was dropped because it is not on the read-only allow-list. Relaunch with --workiq-write to expose the full live surface.`);
28559
+ continue;
28560
+ }
28561
+ const exposedName = WORKIQ_TOOL_ALIASES.get(wireName) ?? wireName;
28562
+ if (proxyOwned.has(exposedName)) {
28563
+ consola.warn(`Work IQ tool "${wireName}"${exposedName === wireName ? "" : ` (exposed as "${exposedName}")`} was dropped: the proxy already serves a tool by that name.`);
28564
+ continue;
28565
+ }
28566
+ if (seen.has(exposedName)) continue;
28567
+ seen.add(exposedName);
28568
+ entries.push({
28569
+ toolNameHttp: exposedName,
28570
+ group: WORKIQ_GROUP,
28571
+ capability: "workiq",
28572
+ description: tool.description || `Work IQ tool ${wireName}.`,
28573
+ inputSchema: tool.inputSchema,
28574
+ async handler(args, signal) {
28575
+ try {
28576
+ return { content: [{
28577
+ type: "text",
28578
+ text: await relaySafeText((await (await ensureWorkiqClient(signal)).callWorkiqTool(wireName, args, signal)).content.map((block) => block.text).join(""))
28579
+ }] };
28580
+ } catch (err) {
28581
+ if (signal?.aborted) throw err;
28582
+ throw withCallTimeRemedy(err);
28583
+ }
28584
+ }
28585
+ });
28586
+ }
28587
+ return entries;
28588
+ }
28589
+ /**
28590
+ * The Work IQ tools for THIS process, or an empty array when the group is off
28591
+ * or its snapshot never landed.
28592
+ */
28593
+ function workiqMcpToolEntries() {
28594
+ if (!state.workiqEnabled) return [];
28174
28595
  return snapshot;
28175
28596
  }
28176
28597
  //#endregion
@@ -28322,9 +28743,14 @@ function checkAuth(c) {
28322
28743
  * which is every launch unless `--ado` resolved on.
28323
28744
  */
28324
28745
  function allNonPersonaTools() {
28325
- const dynamic = adoMcpToolEntries();
28326
- if (dynamic.length === 0) return NON_PERSONA_MCP_TOOLS;
28327
- return [...NON_PERSONA_MCP_TOOLS, ...dynamic];
28746
+ const ado = adoMcpToolEntries();
28747
+ const workiq = workiqMcpToolEntries();
28748
+ if (ado.length === 0 && workiq.length === 0) return NON_PERSONA_MCP_TOOLS;
28749
+ return [
28750
+ ...NON_PERSONA_MCP_TOOLS,
28751
+ ...ado,
28752
+ ...workiq
28753
+ ];
28328
28754
  }
28329
28755
  /**
28330
28756
  * The LIST surface only: `allNonPersonaTools()` minus hook-channel tools.
@@ -28507,6 +28933,7 @@ function maxToolIsEnabled(tool) {
28507
28933
  if (tool.capability === "artifact") return artifactToolsEnabled();
28508
28934
  if (tool.group === "ado") return adoToolsEnabled();
28509
28935
  if (tool.group === "kusto") return kustoToolsEnabled();
28936
+ if (tool.group === "workiq") return workiqToolsEnabled();
28510
28937
  if (tool.capability === "cloudagent" || tool.capability === "cloudagent_write") return cloudAgentToolsEnabled();
28511
28938
  return true;
28512
28939
  }
@@ -28533,6 +28960,7 @@ function fastToolIsEnabled(tool) {
28533
28960
  if (tool.group === "workers") return tool.toolNameHttp === "browse" && tool.capability === "browse_agent" && browseAgentEnabled();
28534
28961
  if (tool.group === "ado") return adoToolsEnabled();
28535
28962
  if (tool.group === "kusto") return kustoToolsEnabled();
28963
+ if (tool.group === "workiq") return workiqToolsEnabled();
28536
28964
  if (tool.capability === "cloudagent" || tool.capability === "cloudagent_write") return cloudAgentToolsEnabled();
28537
28965
  if (tool.group !== "browser") return false;
28538
28966
  if (!browserToolsEnabled()) return false;
@@ -28661,6 +29089,7 @@ function toolEntries(scope, launch, audience = "shared") {
28661
29089
  if (t.capability === "artifact") return artifactToolsEnabled();
28662
29090
  if (t.capability === "ado") return adoToolsEnabled();
28663
29091
  if (t.capability === "kusto") return kustoToolsEnabled();
29092
+ if (t.capability === "workiq") return workiqToolsEnabled();
28664
29093
  if (t.capability === "cloudagent" || t.capability === "cloudagent_write") return cloudAgentToolsEnabled();
28665
29094
  if (t.capability === "browser_compound") return browserToolsEnabled() && browserCompoundToolsEnabled();
28666
29095
  if (t.capability === "browser_power") return browserToolsEnabled() && browserPowerToolsEnabled();
@@ -29251,6 +29680,7 @@ async function handleToolsCall(body, scope, launch, audience = "shared", session
29251
29680
  if (nonPersonaTool && nonPersonaTool.capability === "browser_power" && !(browserToolsEnabled() && browserPowerToolsEnabled())) return rpcError(body.id, RPC_METHOD_NOT_FOUND, `tools/call: unknown tool "${name}"`);
29252
29681
  if (nonPersonaTool && nonPersonaTool.capability === "ado" && !adoToolsEnabled()) return rpcError(body.id, RPC_METHOD_NOT_FOUND, `tools/call: unknown tool "${name}"`);
29253
29682
  if (nonPersonaTool && nonPersonaTool.capability === "kusto" && !kustoToolsEnabled()) return rpcError(body.id, RPC_METHOD_NOT_FOUND, `tools/call: unknown tool "${name}"`);
29683
+ if (nonPersonaTool && nonPersonaTool.capability === "workiq" && !workiqToolsEnabled()) return rpcError(body.id, RPC_METHOD_NOT_FOUND, `tools/call: unknown tool "${name}"`);
29254
29684
  if (nonPersonaTool && (nonPersonaTool.capability === "cloudagent" || nonPersonaTool.capability === "cloudagent_write") && !cloudAgentToolsEnabled()) return rpcError(body.id, RPC_METHOD_NOT_FOUND, `tools/call: unknown tool "${name}"`);
29255
29685
  let personaPrompt;
29256
29686
  let personaContext;
@@ -36128,7 +36558,8 @@ const MCP_GROUPS = Object.freeze([
36128
36558
  "first-mate",
36129
36559
  "ado",
36130
36560
  "kusto",
36131
- "cloudagent"
36561
+ "cloudagent",
36562
+ "workiq"
36132
36563
  ]);
36133
36564
  const GROUP_META = Object.freeze({
36134
36565
  peers: {
@@ -36185,6 +36616,11 @@ const GROUP_META = Object.freeze({
36185
36616
  preferredKey: "cloudagent",
36186
36617
  urlSuffix: "cloudagent",
36187
36618
  serverInfoName: "github-router-cloudagent"
36619
+ },
36620
+ workiq: {
36621
+ preferredKey: "workiq",
36622
+ urlSuffix: "workiq",
36623
+ serverInfoName: "github-router-workiq"
36188
36624
  }
36189
36625
  });
36190
36626
  /** True iff `s` is a registered group name (route `:group` param validation). */
@@ -38279,6 +38715,6 @@ function enumerateInjectedMcpToolNames(groupKeys, opts = {}) {
38279
38715
  return [...new Set(names)];
38280
38716
  }
38281
38717
  //#endregion
38282
- export { buildAnthropicErrorEvent as $, catalogAdvertises1M as $n, shimDefaultsToXhigh as $t, TOOLBELT_TOOLS$1 as A, DEFINITION_OF_GREATNESS as An, cheapestOracleModel as At, FAST_ADVISOR_TOOL_INSTRUCTIONS as B, DEFAULT_CLAUDE_MODEL_FALLBACKS as Bn, fleetToolsEnabled as Bt, runWorkerAgent as C, effectiveLocalProfile as Cn, browseAgentEnabled as Ct, toolbeltEnabled as D, normalizeCloudAgentEnvironment as Dn, cheapOracleModel as Dt, buildToolbeltAwareness as E, hasSupportedBrowserInstalled as En, cheapAdvisorModel as Et, ADVISOR_TOOL_INSTRUCTIONS as F, LOCAL_CONSULT_REDACTION_LINE as Fn, fastGeneralPurposeModel as Ft, isAdvisorRequested as G, UPSTREAM_INACTIVITY_TIMEOUT_MS as Gn, nativeSubagentModel as Gt, LOCAL_REVIEWER_ADVISOR_TOOL_INSTRUCTIONS as H, DEFAULT_CODEX_MODEL_FALLBACKS as Hn, generalPurposeFastModel as Ht, CHEAPEST_ADVISOR_TOOL_INSTRUCTIONS as I, collapsePathKeys as In, fastOracleModel as It, resolveCuratedAdvisorModel as J, pickClaudeDefault as Jn, reviewerModel as Jt, resolveAdvisorEffort as K, generateRandomPort as Kn, resolveGeminiReviewModel as Kt, CHEAPEST_REVIEWER_ADVISOR_TOOL_INSTRUCTIONS as L, toolbeltPathOverride as Ln, fastPlanModel as Lt, satisfiesMinVersion as M, provisionAndIndexColbert as Mn, cloudAgentToolsEnabled as Mt, searchWeb as N, semanticSearchOptedIn as Nn, fastAdvisorModel as Nt, toolbeltSkipSet as O, normalizeKustoClusterUri as On, cheapReviewerModel as Ot, ADVISOR_INTERNAL_TOOL_NAME as P, shouldUseInsecureTls as Pn, fastAstraModel as Pt, repairRejectedThinkingHistory as Q, classifyMessagesRoute as Qn, workerToolsEnabled as Qt, CHEAPLOCAL_ADVISOR_TOOL_INSTRUCTIONS as R, BUDGET_SMALL_FAST_CATALOG_ID as Rn, fastReviewerModel as Rt, resolveWorkerRunOpts as S, assertCopilotModelAllowed as Sn, brainstormModel as St, availableToolCommands as T, provisionBrowserAssets as Tn, browserToolsEnabled as Tt, buildAdvisorStream as U, DEFAULT_PORT as Un, implementerFastModel as Ut, LOCAL_ADVISOR_TOOL_INSTRUCTIONS as V, DEFAULT_CODEX_MODEL as Vn, geminiAvailable as Vt, injectAdvisorTool as W, UPSTREAM_FETCH_TIMEOUT_MS as Wn, kustoToolsEnabled as Wt, rememberThinkingHistoryRepair as X, upstreamAllowH2 as Xn, scribeModel as Xt, formatThinkingRepairDecline as Y, resolveLeadSlugArg as Yn, scoutModel as Yt, repairKnownThinkingHistory as Z, upstreamMaxConnections as Zn, standInToolEnabled as Zt, REVIEW_DEFAULT_MODEL as _, createResponses as _n, adoToolsEnabled as _t, buildAgentPrompt as a, localSessionId as an, CHEAP_PROFILE_NATIVE_AGENT_NAMES as ar, EFFORT_ORDER as at, resolveDefaultModel as b, readResponseBodyCapped as bn, balancedOracleModel as bt, enumerateInjectedMcpToolNames as c, LAUNCH_BOUND_TOKEN_PREFIX as cn, CHEAP_PROFILE_SUBAGENT_CONTEXT_TOKENS as cr, clampEffort as ct, BROWSE_DEFAULT_MODEL as d, registerLaunch as dn, adoMcpToolEntries as dt, getTextTokenCount as en, oneMContextDisabled as er, buildOpenAIErrorEvent as et, DEFAULT_MODEL_CHAIN as f, rememberLaunchSessionId as fn, buildAdoToolEntries as ft, PLAN_DEFAULT_MODEL as g, resolveMcpToolTimeoutMs as gn, normalizeAdoToolsets as gt, IMPLEMENT_DEFAULT_MODEL as h, warnOnTokenPriceDrift as hn, ADO_DEFAULT_TOOLSETS as ht, assertMcpToolSurfaceConsistent as i, localBaseUrl as in, CHEAP_PROFILE_MODELS as ir, relayAnthropicStream as it, assetFor as j, colbertDegradedWarning as jn, cheapestReviewerModel as jt, vscodeRipgrepPath as k, CONDENSED_OPERATING_SEQUENCE as kn, cheapestAdvisorModel as kt, maxPersonasFor as l, findLaunchBySecret as ln, handleMcpDelete as lt, EXPLORE_DEFAULT_THINKING as m, assembleResponsesPayload as mn, provisionAdoTools as mt, MCP_GROUPS as n, getTokenizerFromModel as nn, withOneMSuffixForLead as nr, logStreamError as nt, buildPeerAwarenessSnippet as o, countTokens as on, CHEAP_PROFILE_NATIVE_EFFORTS as or, UNKNOWN_EFFORT_ANCHOR as ot, EXPLORE_DEFAULT_MODEL as p, unregisterLaunch as pn, disposeAdoClients as pt, resolveAdvisorModel as q, isBudgetClaudeLead as qn, reviewerFastModel as qt, agentNamesForToolAllowlist as r, configureLocalEgress as rn, CHEAP_PROFILE_ADVISOR_CLIENT_MODEL as rr, readIteratorWithTimeout as rt, buildPeerAwarenessSummary as s, createMessages as sn, CHEAP_PROFILE_NATIVE_MODELS as sr, bucketEffort as st, GROUP_META as t, getTokenCount as tn, withOneMSuffix as tr, isControllerClosedError as tt, personasFor as u, launchBoundAccessToken as un, handleMcpPost as ut, TEST_DEFAULT_MODEL as v, createChatCompletions as vn, agentToolsEnabled as vt, buildEnv as w, normalizeOpenAIUsage as wn, browserCompoundToolsEnabled as wt, resolveModeDefaults as x, parseJsonOrDiagnose as xn, balancedReviewerModel as xt, appendPlanReminder as y, MAX_RESPONSE_BODY_BYTES as yn, artifactToolsEnabled as yt, CHEAPLOCAL_REVIEWER_ADVISOR_TOOL_INSTRUCTIONS as z, BUDGET_SMALL_FAST_SLUG as zn, fastScoutModel as zt };
38718
+ export { buildAnthropicErrorEvent as $, isBudgetClaudeLead as $n, reviewerModel as $t, TOOLBELT_TOOLS$1 as A, normalizeOpenAIUsage as An, browserToolsEnabled as At, FAST_ADVISOR_TOOL_INSTRUCTIONS as B, shouldUseInsecureTls as Bn, fastGeneralPurposeModel as Bt, runWorkerAgent as C, createResponses as Cn, agentToolsEnabled as Ct, toolbeltEnabled as D, parseJsonOrDiagnose as Dn, brainstormModel as Dt, buildToolbeltAwareness as E, readResponseBodyCapped as En, balancedReviewerModel as Et, ADVISOR_TOOL_INSTRUCTIONS as F, CONDENSED_OPERATING_SEQUENCE as Fn, cheapestOracleModel as Ft, isAdvisorRequested as G, BUDGET_SMALL_FAST_SLUG as Gn, fleetToolsEnabled as Gt, LOCAL_REVIEWER_ADVISOR_TOOL_INSTRUCTIONS as H, collapsePathKeys as Hn, fastPlanModel as Ht, CHEAPEST_ADVISOR_TOOL_INSTRUCTIONS as I, DEFINITION_OF_GREATNESS as In, cheapestReviewerModel as It, resolveCuratedAdvisorModel as J, DEFAULT_CODEX_MODEL_FALLBACKS as Jn, implementerFastModel as Jt, resolveAdvisorEffort as K, DEFAULT_CLAUDE_MODEL_FALLBACKS as Kn, geminiAvailable as Kt, CHEAPEST_REVIEWER_ADVISOR_TOOL_INSTRUCTIONS as L, colbertDegradedWarning as Ln, cloudAgentToolsEnabled as Lt, satisfiesMinVersion as M, hasSupportedBrowserInstalled as Mn, cheapOracleModel as Mt, searchWeb as N, normalizeCloudAgentEnvironment as Nn, cheapReviewerModel as Nt, toolbeltSkipSet as O, assertCopilotModelAllowed as On, browseAgentEnabled as Ot, ADVISOR_INTERNAL_TOOL_NAME as P, normalizeKustoClusterUri as Pn, cheapestAdvisorModel as Pt, repairRejectedThinkingHistory as Q, generateRandomPort as Qn, reviewerFastModel as Qt, CHEAPLOCAL_ADVISOR_TOOL_INSTRUCTIONS as R, provisionAndIndexColbert as Rn, fastAdvisorModel as Rt, resolveWorkerRunOpts as S, resolveMcpToolTimeoutMs as Sn, adoToolsEnabled as St, availableToolCommands as T, MAX_RESPONSE_BODY_BYTES as Tn, balancedOracleModel as Tt, buildAdvisorStream as U, toolbeltPathOverride as Un, fastReviewerModel as Ut, LOCAL_ADVISOR_TOOL_INSTRUCTIONS as V, LOCAL_CONSULT_REDACTION_LINE as Vn, fastOracleModel as Vt, injectAdvisorTool as W, BUDGET_SMALL_FAST_CATALOG_ID as Wn, fastScoutModel as Wt, rememberThinkingHistoryRepair as X, UPSTREAM_FETCH_TIMEOUT_MS as Xn, nativeSubagentModel as Xt, formatThinkingRepairDecline as Y, DEFAULT_PORT as Yn, kustoToolsEnabled as Yt, repairKnownThinkingHistory as Z, UPSTREAM_INACTIVITY_TIMEOUT_MS as Zn, resolveGeminiReviewModel as Zt, REVIEW_DEFAULT_MODEL as _, registerLaunch as _n, buildAdoToolEntries as _t, buildAgentPrompt as a, shimDefaultsToXhigh as an, catalogAdvertises1M as ar, EFFORT_ORDER as at, resolveDefaultModel as b, assembleResponsesPayload as bn, ADO_DEFAULT_TOOLSETS as bt, enumerateInjectedMcpToolNames as c, getTokenizerFromModel as cn, withOneMSuffixForLead as cr, clampEffort as ct, BROWSE_DEFAULT_MODEL as d, localSessionId as dn, CHEAP_PROFILE_NATIVE_AGENT_NAMES as dr, WORKIQ_TOOL_ALIASES as dt, scoutModel as en, pickClaudeDefault as er, buildOpenAIErrorEvent as et, DEFAULT_MODEL_CHAIN as f, countTokens as fn, CHEAP_PROFILE_NATIVE_EFFORTS as fr, buildWorkiqToolEntries as ft, PLAN_DEFAULT_MODEL as g, launchBoundAccessToken as gn, adoMcpToolEntries as gt, IMPLEMENT_DEFAULT_MODEL as h, findLaunchBySecret as hn, workiqMcpToolEntries as ht, assertMcpToolSurfaceConsistent as i, workiqToolsEnabled as in, classifyMessagesRoute as ir, relayAnthropicStream as it, assetFor as j, provisionBrowserAssets as jn, cheapAdvisorModel as jt, vscodeRipgrepPath as k, effectiveLocalProfile as kn, browserCompoundToolsEnabled as kt, maxPersonasFor as l, configureLocalEgress as ln, CHEAP_PROFILE_ADVISOR_CLIENT_MODEL as lr, handleMcpDelete as lt, EXPLORE_DEFAULT_THINKING as m, LAUNCH_BOUND_TOKEN_PREFIX as mn, CHEAP_PROFILE_SUBAGENT_CONTEXT_TOKENS as mr, provisionWorkiqTools as mt, MCP_GROUPS as n, standInToolEnabled as nn, upstreamAllowH2 as nr, logStreamError as nt, buildPeerAwarenessSnippet as o, getTextTokenCount as on, oneMContextDisabled as or, UNKNOWN_EFFORT_ANCHOR as ot, EXPLORE_DEFAULT_MODEL as p, createMessages as pn, CHEAP_PROFILE_NATIVE_MODELS as pr, disposeWorkiqClients as pt, resolveAdvisorModel as q, DEFAULT_CODEX_MODEL as qn, generalPurposeFastModel as qt, agentNamesForToolAllowlist as r, workerToolsEnabled as rn, upstreamMaxConnections as rr, readIteratorWithTimeout as rt, buildPeerAwarenessSummary as s, getTokenCount as sn, withOneMSuffix as sr, bucketEffort as st, GROUP_META as t, scribeModel as tn, resolveLeadSlugArg as tr, isControllerClosedError as tt, personasFor as u, localBaseUrl as un, CHEAP_PROFILE_MODELS as ur, handleMcpPost as ut, TEST_DEFAULT_MODEL as v, rememberLaunchSessionId as vn, disposeAdoClients as vt, buildEnv as w, createChatCompletions as wn, artifactToolsEnabled as wt, resolveModeDefaults as x, warnOnTokenPriceDrift as xn, normalizeAdoToolsets as xt, appendPlanReminder as y, unregisterLaunch as yn, provisionAdoTools as yt, CHEAPLOCAL_REVIEWER_ADVISOR_TOOL_INSTRUCTIONS as z, semanticSearchOptedIn as zn, fastAstraModel as zt };
38283
38719
 
38284
- //# sourceMappingURL=peer-mcp-personas-DNtWI2C1.js.map
38720
+ //# sourceMappingURL=peer-mcp-personas-6zWkXHQW.js.map