@tangle-network/agent-app 0.60.220 → 0.60.222
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assistant/index.js +3 -2
- package/dist/assistant/index.js.map +1 -1
- package/dist/chat-react/index.js +2 -1
- package/dist/chat-routes/hybrid-producer.d.ts +93 -0
- package/dist/chat-routes/index.d.ts +1 -0
- package/dist/chat-routes/index.js +118 -4
- package/dist/chat-routes/index.js.map +1 -1
- package/dist/chat-routes/router-producer.d.ts +3 -1
- package/dist/chat-routes/turn-routes.d.ts +10 -5
- package/dist/{chunk-NHCS55QI.js → chunk-4WEC4NOU.js} +4 -1
- package/dist/chunk-4WEC4NOU.js.map +1 -0
- package/dist/{chunk-KNTRS7OZ.js → chunk-BQILMP73.js} +70 -115
- package/dist/chunk-BQILMP73.js.map +1 -0
- package/dist/{chunk-2XUIWCRW.js → chunk-DA5XLDZR.js} +7 -2
- package/dist/chunk-DA5XLDZR.js.map +1 -0
- package/dist/chunk-LGMJMCSE.js +157 -0
- package/dist/chunk-LGMJMCSE.js.map +1 -0
- package/dist/{chunk-WLH4DEB2.js → chunk-OMB4HQ2W.js} +54 -19
- package/dist/chunk-OMB4HQ2W.js.map +1 -0
- package/dist/chunk-OXUBZ5SE.js +54 -0
- package/dist/chunk-OXUBZ5SE.js.map +1 -0
- package/dist/{chunk-MAOTZ77B.js → chunk-QGEYQ7SU.js} +2 -2
- package/dist/{chunk-WDY47GBR.js → chunk-XWJDF34U.js} +56 -14
- package/dist/chunk-XWJDF34U.js.map +1 -0
- package/dist/{chunk-C7WAGXQN.js → chunk-YS2RYZQG.js} +9 -8
- package/dist/{chunk-C7WAGXQN.js.map → chunk-YS2RYZQG.js.map} +1 -1
- package/dist/public-consultation/index.js +2 -1
- package/dist/public-consultation/index.js.map +1 -1
- package/dist/runtime/index.js +2 -2
- package/dist/runtime/router-turn.d.ts +6 -0
- package/dist/runtime/router-turn.js +1 -1
- package/dist/sandbox/escalation-speculator.d.ts +15 -27
- package/dist/sandbox/index.js +1 -3
- package/dist/sandbox/sandbox-run-tool.d.ts +4 -3
- package/dist/signoff/app-defaults.d.ts +2 -1
- package/dist/signoff/cli.js +1 -1
- package/dist/signoff/index.js +1 -1
- package/dist/turn-trace/index.js +6 -146
- package/dist/turn-trace/index.js.map +1 -1
- package/dist/web-react/chat-composer.d.ts +2 -1
- package/dist/web-react/index.js +10 -4
- package/dist/web-react/workspace-prewarm.d.ts +7 -0
- package/dist/workspace-react/index.d.ts +9 -1
- package/dist/workspace-react/index.js +8 -2
- package/dist/workspace-react/index.js.map +1 -1
- package/package.json +1 -1
- package/dist/chunk-2XUIWCRW.js.map +0 -1
- package/dist/chunk-KNTRS7OZ.js.map +0 -1
- package/dist/chunk-NHCS55QI.js.map +0 -1
- package/dist/chunk-WDY47GBR.js.map +0 -1
- package/dist/chunk-WLH4DEB2.js.map +0 -1
- /package/dist/{chunk-MAOTZ77B.js.map → chunk-QGEYQ7SU.js.map} +0 -0
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
// src/web-react/workspace-prewarm.ts
|
|
2
|
+
import { createContext, useCallback, useContext, useEffect } from "react";
|
|
3
|
+
var DEFAULT_MIN_INTERVAL_MS = 6e4;
|
|
4
|
+
var lastSent = /* @__PURE__ */ new Map();
|
|
5
|
+
var inFlight = /* @__PURE__ */ new Set();
|
|
6
|
+
function documentIsVisible() {
|
|
7
|
+
if (typeof document === "undefined") return false;
|
|
8
|
+
if (document.prerendering) return false;
|
|
9
|
+
return document.visibilityState === "visible";
|
|
10
|
+
}
|
|
11
|
+
function requestWorkspacePrewarm(url, options = {}) {
|
|
12
|
+
if (!url || !documentIsVisible() || inFlight.has(url)) return false;
|
|
13
|
+
const now = Date.now();
|
|
14
|
+
const last = lastSent.get(url);
|
|
15
|
+
if (last !== void 0 && now - last < (options.minIntervalMs ?? DEFAULT_MIN_INTERVAL_MS)) return false;
|
|
16
|
+
lastSent.set(url, now);
|
|
17
|
+
inFlight.add(url);
|
|
18
|
+
void fetch(url, {
|
|
19
|
+
method: "POST",
|
|
20
|
+
credentials: "same-origin",
|
|
21
|
+
headers: { "content-type": "application/json" },
|
|
22
|
+
body: JSON.stringify({ reason: options.reason ?? "page-open" })
|
|
23
|
+
}).then((response) => response.body?.cancel()).catch(() => void 0).finally(() => inFlight.delete(url));
|
|
24
|
+
return true;
|
|
25
|
+
}
|
|
26
|
+
function useWorkspacePrewarm(options) {
|
|
27
|
+
const { url, enabled = true, minIntervalMs } = options;
|
|
28
|
+
const active = enabled && Boolean(url);
|
|
29
|
+
useEffect(() => {
|
|
30
|
+
if (!active || !url || typeof document === "undefined") return;
|
|
31
|
+
const fire = () => {
|
|
32
|
+
requestWorkspacePrewarm(url, { minIntervalMs });
|
|
33
|
+
};
|
|
34
|
+
fire();
|
|
35
|
+
document.addEventListener("visibilitychange", fire);
|
|
36
|
+
return () => document.removeEventListener("visibilitychange", fire);
|
|
37
|
+
}, [active, url, minIntervalMs]);
|
|
38
|
+
const reassert = useCallback(() => {
|
|
39
|
+
if (active && url) requestWorkspacePrewarm(url, { minIntervalMs, reason: "composer-focus" });
|
|
40
|
+
}, [active, url, minIntervalMs]);
|
|
41
|
+
return { reassert };
|
|
42
|
+
}
|
|
43
|
+
var WorkspacePrewarmContext = createContext(null);
|
|
44
|
+
function useWorkspacePrewarmHandle() {
|
|
45
|
+
return useContext(WorkspacePrewarmContext);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export {
|
|
49
|
+
requestWorkspacePrewarm,
|
|
50
|
+
useWorkspacePrewarm,
|
|
51
|
+
WorkspacePrewarmContext,
|
|
52
|
+
useWorkspacePrewarmHandle
|
|
53
|
+
};
|
|
54
|
+
//# sourceMappingURL=chunk-OXUBZ5SE.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/web-react/workspace-prewarm.ts"],"sourcesContent":["/**\n * Prewarm on open: when a member opens a workspace page, ask the product to\n * warm that workspace (resume its box, prepare its profile) so the first turn\n * does not pay for it. The server half is `createWorkspacePrewarmRoute` in\n * `/sandbox`.\n *\n * Fires only from a visible, non-prerendered document. A tab opened in the\n * background fires when it first becomes visible. Requests for the same URL\n * are spaced by `minIntervalMs` across every mount in the tab, so navigating\n * between pages of one workspace sends one request, not one per page. Call\n * `reassert()` on composer focus: a box can suspend while a tab sits open.\n *\n * Failures are silent by design. A warm is an optimization; the turn itself\n * still places the box, so nothing here may surface to the member.\n */\n\nimport { createContext, useCallback, useContext, useEffect } from 'react'\n\nexport interface WorkspacePrewarmRequestOptions {\n /** Minimum gap between requests for the same URL in this tab. Default 60 000 ms. */\n minIntervalMs?: number\n /** Sent to the route so a product can budget page opens apart from composer focus. Default `page-open`. */\n reason?: 'page-open' | 'composer-focus'\n}\n\nexport interface UseWorkspacePrewarmOptions extends WorkspacePrewarmRequestOptions {\n /** The product's prewarm route for this workspace. Empty disables. */\n url: string | null | undefined\n /** False until the member is known to be signed in and allowed to chat. Default true. */\n enabled?: boolean\n}\n\nexport interface WorkspacePrewarmHandle {\n /** Ask again, subject to the same visibility and spacing rules. */\n reassert(): void\n}\n\nconst DEFAULT_MIN_INTERVAL_MS = 60_000\nconst lastSent = new Map<string, number>()\nconst inFlight = new Set<string>()\n\nfunction documentIsVisible(): boolean {\n if (typeof document === 'undefined') return false\n if ((document as Document & { prerendering?: boolean }).prerendering) return false\n return document.visibilityState === 'visible'\n}\n\n/**\n * Send one prewarm request for `url` unless the tab is hidden, a request for it\n * is in flight, or one was sent within `minIntervalMs`. Returns whether it sent.\n */\nexport function requestWorkspacePrewarm(url: string, options: WorkspacePrewarmRequestOptions = {}): boolean {\n if (!url || !documentIsVisible() || inFlight.has(url)) return false\n const now = Date.now()\n const last = lastSent.get(url)\n if (last !== undefined && now - last < (options.minIntervalMs ?? DEFAULT_MIN_INTERVAL_MS)) return false\n lastSent.set(url, now)\n inFlight.add(url)\n void fetch(url, {\n method: 'POST',\n credentials: 'same-origin',\n headers: { 'content-type': 'application/json' },\n body: JSON.stringify({ reason: options.reason ?? 'page-open' }),\n })\n .then((response) => response.body?.cancel())\n .catch(() => undefined)\n .finally(() => inFlight.delete(url))\n return true\n}\n\n/** Prewarm `url` when the page opens or becomes visible; `reassert` on composer focus. */\nexport function useWorkspacePrewarm(options: UseWorkspacePrewarmOptions): WorkspacePrewarmHandle {\n const { url, enabled = true, minIntervalMs } = options\n const active = enabled && Boolean(url)\n\n useEffect(() => {\n if (!active || !url || typeof document === 'undefined') return\n const fire = () => {\n requestWorkspacePrewarm(url, { minIntervalMs })\n }\n fire()\n document.addEventListener('visibilitychange', fire)\n return () => document.removeEventListener('visibilitychange', fire)\n }, [active, url, minIntervalMs])\n\n const reassert = useCallback(() => {\n if (active && url) requestWorkspacePrewarm(url, { minIntervalMs, reason: 'composer-focus' })\n }, [active, url, minIntervalMs])\n\n return { reassert }\n}\n\n/**\n * The prewarm handle of the workspace shell around this component. `AgentWorkspaceLayout` provides it when the\n * product passes `prewarm`; `ChatComposer` reasserts through it on focus unless the product passes its own\n * `onFocusWithin`. Outside a shell that warms, `reassert` does nothing.\n */\nexport const WorkspacePrewarmContext = createContext<WorkspacePrewarmHandle | null>(null)\n\nexport function useWorkspacePrewarmHandle(): WorkspacePrewarmHandle | null {\n return useContext(WorkspacePrewarmContext)\n}\n"],"mappings":";AAgBA,SAAS,eAAe,aAAa,YAAY,iBAAiB;AAqBlE,IAAM,0BAA0B;AAChC,IAAM,WAAW,oBAAI,IAAoB;AACzC,IAAM,WAAW,oBAAI,IAAY;AAEjC,SAAS,oBAA6B;AACpC,MAAI,OAAO,aAAa,YAAa,QAAO;AAC5C,MAAK,SAAmD,aAAc,QAAO;AAC7E,SAAO,SAAS,oBAAoB;AACtC;AAMO,SAAS,wBAAwB,KAAa,UAA0C,CAAC,GAAY;AAC1G,MAAI,CAAC,OAAO,CAAC,kBAAkB,KAAK,SAAS,IAAI,GAAG,EAAG,QAAO;AAC9D,QAAM,MAAM,KAAK,IAAI;AACrB,QAAM,OAAO,SAAS,IAAI,GAAG;AAC7B,MAAI,SAAS,UAAa,MAAM,QAAQ,QAAQ,iBAAiB,yBAA0B,QAAO;AAClG,WAAS,IAAI,KAAK,GAAG;AACrB,WAAS,IAAI,GAAG;AAChB,OAAK,MAAM,KAAK;AAAA,IACd,QAAQ;AAAA,IACR,aAAa;AAAA,IACb,SAAS,EAAE,gBAAgB,mBAAmB;AAAA,IAC9C,MAAM,KAAK,UAAU,EAAE,QAAQ,QAAQ,UAAU,YAAY,CAAC;AAAA,EAChE,CAAC,EACE,KAAK,CAAC,aAAa,SAAS,MAAM,OAAO,CAAC,EAC1C,MAAM,MAAM,MAAS,EACrB,QAAQ,MAAM,SAAS,OAAO,GAAG,CAAC;AACrC,SAAO;AACT;AAGO,SAAS,oBAAoB,SAA6D;AAC/F,QAAM,EAAE,KAAK,UAAU,MAAM,cAAc,IAAI;AAC/C,QAAM,SAAS,WAAW,QAAQ,GAAG;AAErC,YAAU,MAAM;AACd,QAAI,CAAC,UAAU,CAAC,OAAO,OAAO,aAAa,YAAa;AACxD,UAAM,OAAO,MAAM;AACjB,8BAAwB,KAAK,EAAE,cAAc,CAAC;AAAA,IAChD;AACA,SAAK;AACL,aAAS,iBAAiB,oBAAoB,IAAI;AAClD,WAAO,MAAM,SAAS,oBAAoB,oBAAoB,IAAI;AAAA,EACpE,GAAG,CAAC,QAAQ,KAAK,aAAa,CAAC;AAE/B,QAAM,WAAW,YAAY,MAAM;AACjC,QAAI,UAAU,IAAK,yBAAwB,KAAK,EAAE,eAAe,QAAQ,iBAAiB,CAAC;AAAA,EAC7F,GAAG,CAAC,QAAQ,KAAK,aAAa,CAAC;AAE/B,SAAO,EAAE,SAAS;AACpB;AAOO,IAAM,0BAA0B,cAA6C,IAAI;AAEjF,SAAS,4BAA2D;AACzE,SAAO,WAAW,uBAAuB;AAC3C;","names":[]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
runRouterTurn
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-4WEC4NOU.js";
|
|
4
4
|
|
|
5
5
|
// src/runtime/protected-model.ts
|
|
6
6
|
import {
|
|
@@ -219,4 +219,4 @@ export {
|
|
|
219
219
|
createRouterProtectedModelPort,
|
|
220
220
|
runProtectedRouterTurn
|
|
221
221
|
};
|
|
222
|
-
//# sourceMappingURL=chunk-
|
|
222
|
+
//# sourceMappingURL=chunk-QGEYQ7SU.js.map
|
|
@@ -119,7 +119,9 @@ var APP_DEFAULTS_STEP = "agent-app defaults";
|
|
|
119
119
|
var EXEMPTIBLE_DEFAULTS = ["turn-trace", "first-text", "prewarm", "placement", "limit-alarms"];
|
|
120
120
|
var AGENT_APP_OUTCOME_FLOORS = [
|
|
121
121
|
{ id: "turn-trace", label: "turn trace", since: "0.60.199" },
|
|
122
|
-
{ id: "first-text", label: "first text", since: "0.60.203" }
|
|
122
|
+
{ id: "first-text", label: "first text", since: "0.60.203" },
|
|
123
|
+
// createChatTurnRoutes exports every turn without a sink option, and a turn handed to `handoffCompletion` too.
|
|
124
|
+
{ id: "default-trace", label: "default turn trace", since: "0.60.221" }
|
|
123
125
|
];
|
|
124
126
|
var SOURCE_EXTENSIONS = /\.(?:[cm]?[jt]sx?)$/;
|
|
125
127
|
var NOT_SOURCE = /(?:^|\/)(?:node_modules|dist|build|\.wrangler|tests?|__tests__|e2e|scripts|proof|journeys?|evals?|docs|examples|stories|\.storybook)\/|\.(?:test|spec|stories|e2e|bench)\.[cm]?[jt]sx?$|\.d\.ts$/;
|
|
@@ -187,6 +189,24 @@ function callArguments(text, openIndex) {
|
|
|
187
189
|
}
|
|
188
190
|
return text.slice(openIndex, openIndex + 1200);
|
|
189
191
|
}
|
|
192
|
+
function namedString(text, args, property) {
|
|
193
|
+
const direct = new RegExp(`\\b${property}\\s*:\\s*['"\`]([^'"\`]+)['"\`]`).exec(args);
|
|
194
|
+
if (direct) return direct[1] ?? null;
|
|
195
|
+
const named = new RegExp(`\\b${property}\\s*:\\s*([A-Za-z_$][\\w$]*)\\s*[,}\\n]`).exec(args) ?? new RegExp(`\\b${property}\\b\\s*[,}]`).exec(args);
|
|
196
|
+
const identifier = named?.[1] ?? (named ? property : void 0);
|
|
197
|
+
if (!identifier) return null;
|
|
198
|
+
return new RegExp(`(?:const|let)\\s+${identifier}\\s*(?::\\s*string\\s*)?=\\s*['"\`]([^'"\`]+)['"\`]`).exec(text)?.[1] ?? null;
|
|
199
|
+
}
|
|
200
|
+
function routeProjects(sources) {
|
|
201
|
+
const calls = [];
|
|
202
|
+
for (const file of sources) {
|
|
203
|
+
for (const match of file.text.matchAll(/\bcreateChatTurnRoutes\s*(?:<[^>(]*>)?\s*\(/g)) {
|
|
204
|
+
const args = callArguments(file.text, match.index + match[0].length - 1);
|
|
205
|
+
calls.push({ file: file.path, args, project: namedString(file.text, args, "projectId") ?? namedString(file.text, file.text, "projectId") });
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
return calls;
|
|
209
|
+
}
|
|
190
210
|
function sinkCalls(sources) {
|
|
191
211
|
const calls = [];
|
|
192
212
|
for (const file of sources) {
|
|
@@ -220,17 +240,30 @@ function withExemption(row, id, exemptions, optedOut) {
|
|
|
220
240
|
}
|
|
221
241
|
return { row, finding: null };
|
|
222
242
|
}
|
|
223
|
-
function turnTraceRow(sources, calls, exports) {
|
|
243
|
+
function turnTraceRow(pin, sources, calls, exports) {
|
|
224
244
|
const optOut = filesMatching(sources, /\bturnTrace\s*:\s*false\b/)[0];
|
|
225
245
|
if (optOut) return { row: { id: "turn-trace", label: "turn trace", status: "gap", detail: "" }, optedOut: `turnTrace: false in ${optOut.path}`, wired: false };
|
|
226
|
-
const
|
|
227
|
-
|
|
228
|
-
|
|
246
|
+
const floor = AGENT_APP_OUTCOME_FLOORS.find((entry) => entry.id === "default-trace")?.since ?? "";
|
|
247
|
+
const tuple = pin === null ? null : versionTuple(pin);
|
|
248
|
+
const byDefault = tuple !== null && atLeast(tuple, floor);
|
|
249
|
+
const routes = routeProjects(sources);
|
|
250
|
+
const handoff = filesMatching(sources, /\bhandoffCompletion\b/)[0];
|
|
251
|
+
if (handoff && !byDefault) {
|
|
252
|
+
return {
|
|
253
|
+
row: { id: "turn-trace", label: "turn trace", status: "gap", detail: `${handoff.path} hands turns to a completion owner (handoffCompletion) and agent-app ${pin ?? "at this pin"} does not export a handed-off turn's trace; ${floor} does` },
|
|
254
|
+
optedOut: null,
|
|
255
|
+
wired: false
|
|
256
|
+
};
|
|
229
257
|
}
|
|
230
|
-
const
|
|
258
|
+
const customSink = filesMatching(sources, /\bturnTrace\s*:\s*\{[^}]*\bsink\b/);
|
|
259
|
+
const defaulted = byDefault && routes.length > 0;
|
|
260
|
+
if (calls.length === 0 && customSink.length === 0 && !defaulted) {
|
|
261
|
+
return { row: { id: "turn-trace", label: "turn trace", status: "gap", detail: routes.length > 0 ? `no turn trace sink, and agent-app ${pin ?? "at this pin"} exports by default only from ${floor}` : "no turn trace sink; createChatTurnRoutes gets no turnTrace" }, optedOut: null, wired: false };
|
|
262
|
+
}
|
|
263
|
+
const project = calls.find((call) => call.project)?.project ?? (customSink.length === 0 ? routes.find((call) => call.project)?.project : void 0) ?? null;
|
|
231
264
|
const last = project === null ? void 0 : exports?.get(project);
|
|
232
|
-
const where = calls[0]?.file ?? customSink[0]?.path
|
|
233
|
-
const wired = `sink wired in ${where}${project ? ` (${project})` : ""}`;
|
|
265
|
+
const where = calls[0]?.file ?? customSink[0]?.path;
|
|
266
|
+
const wired = where ? `sink wired in ${where}${project ? ` (${project})` : ""}` : `createChatTurnRoutes exports every turn by default${project ? ` (${project})` : ""}`;
|
|
234
267
|
if (last) {
|
|
235
268
|
return { row: { id: "turn-trace", label: "turn trace", status: "ok", detail: `${wired}; last export accepted ${new Date(last.at).toISOString().slice(0, 16)}Z` }, optedOut: null, wired: true };
|
|
236
269
|
}
|
|
@@ -251,7 +284,7 @@ function firstTextRow(pin, sources, traceWired, calls, exports) {
|
|
|
251
284
|
if (!traceWired) return { id: "first-text", label: "first text", status: "gap", detail: "needs the turn trace" };
|
|
252
285
|
if (tuple !== null && !atLeast(tuple, floor)) return { id: "first-text", label: "first text", status: "gap", detail: `agent-app ${pin} does not mark first text; ${floor} does` };
|
|
253
286
|
if (!routes && !marks) return { id: "first-text", label: "first text", status: "gap", detail: "the turn owner does not call trace.markFirstText() and the app does not use createChatTurnRoutes" };
|
|
254
|
-
const project = calls.find((call) => call.project)?.project ?? null;
|
|
287
|
+
const project = calls.find((call) => call.project)?.project ?? routeProjects(sources).find((call) => call.project)?.project ?? null;
|
|
255
288
|
const last = project === null ? void 0 : exports?.get(project);
|
|
256
289
|
const observed = last?.firstTextMs === void 0 ? "" : `; last turn first_text_ms ${Math.round(last.firstTextMs)}`;
|
|
257
290
|
if (last && last.firstTextMs === void 0) return { id: "first-text", label: "first text", status: "gap", detail: "the last exported turn has no tangle.turn.first_text_ms" };
|
|
@@ -340,7 +373,15 @@ ${run.stderr}`);
|
|
|
340
373
|
}
|
|
341
374
|
}
|
|
342
375
|
function toolCountRow() {
|
|
343
|
-
return { id: "tool-count", label: "
|
|
376
|
+
return { id: "tool-count", label: "tool calls p50", status: "unknown", detail: "tangle.turn.tool_calls on each root span; no ceiling until a measured link to first text exists" };
|
|
377
|
+
}
|
|
378
|
+
function installedAgentAppVersion(repoRoot, dir) {
|
|
379
|
+
try {
|
|
380
|
+
const version = JSON.parse(readFileSync(join2(repoRoot, dir, "node_modules", "@tangle-network", "agent-app", "package.json"), "utf8")).version;
|
|
381
|
+
return typeof version === "string" && versionTuple(version) ? version : null;
|
|
382
|
+
} catch {
|
|
383
|
+
return null;
|
|
384
|
+
}
|
|
344
385
|
}
|
|
345
386
|
function checkAppDefaults(repoRoot, options = {}) {
|
|
346
387
|
const tracked = trackedFiles(repoRoot);
|
|
@@ -357,9 +398,9 @@ function checkAppDefaults(repoRoot, options = {}) {
|
|
|
357
398
|
const sources = readSources(repoRoot, tracked, pkg.dir, packages.map((other) => other.dir));
|
|
358
399
|
const configs = (owned.get(pkg.dir) ?? []).map((path) => ({ path, text: readFileSync(join2(repoRoot, path), "utf8") }));
|
|
359
400
|
const exemptions = options.exemptions ?? {};
|
|
360
|
-
const pin = versionTuple(pkg.spec) ? /(\d+\.\d+\.\d+)/.exec(pkg.spec)?.[1] ?? null :
|
|
401
|
+
const pin = versionTuple(pkg.spec) ? /(\d+\.\d+\.\d+)/.exec(pkg.spec)?.[1] ?? null : installedAgentAppVersion(repoRoot, pkg.dir);
|
|
361
402
|
const calls = sinkCalls(sources);
|
|
362
|
-
const trace = turnTraceRow(sources, calls, options.exports);
|
|
403
|
+
const trace = turnTraceRow(pin, sources, calls, options.exports);
|
|
363
404
|
const traceWired = trace.wired;
|
|
364
405
|
const reports = [
|
|
365
406
|
{ row: pinRow(pin, pkg.spec), id: null, optedOut: null },
|
|
@@ -437,7 +478,8 @@ async function collectLastExports(repoRoot, apiKey) {
|
|
|
437
478
|
const tracked = trackedFiles(repoRoot);
|
|
438
479
|
const projects = /* @__PURE__ */ new Set();
|
|
439
480
|
for (const pkg of findAppPackages(repoRoot, tracked)) {
|
|
440
|
-
|
|
481
|
+
const sources = readSources(repoRoot, tracked, pkg.dir, []);
|
|
482
|
+
for (const call of [...sinkCalls(sources), ...routeProjects(sources)]) if (call.project) projects.add(call.project);
|
|
441
483
|
}
|
|
442
484
|
const exports = /* @__PURE__ */ new Map();
|
|
443
485
|
for (const project of projects) {
|
|
@@ -2785,4 +2827,4 @@ export {
|
|
|
2785
2827
|
formatWorkspaceSurfaceReport,
|
|
2786
2828
|
runWorkspaceSurfaceCli
|
|
2787
2829
|
};
|
|
2788
|
-
//# sourceMappingURL=chunk-
|
|
2830
|
+
//# sourceMappingURL=chunk-XWJDF34U.js.map
|