@moda-ai/cli 1.55.86 → 1.55.87
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/{agent-515pvq3z.js → agent-qn9ymfs0.js} +3 -3
- package/dist/{cli-gqrt2rbm.js → cli-aedmnm1c.js} +3 -3
- package/dist/{cli-gevrs592.js → cli-hedrh5p9.js} +2 -2
- package/dist/{cli-py31vwrx.js → cli-vvn3x5tj.js} +259 -126
- package/dist/cli.js +7 -7
- package/dist/{doctor-k2xv4n03.js → doctor-dhgzp9p2.js} +2 -2
- package/dist/{harness-tnhe63n3.js → harness-b6z16pgd.js} +1 -1
- package/dist/{harness-github-actions-x2jgh0e8.js → harness-github-actions-q2j5hhqb.js} +1 -1
- package/dist/{index-69xwrmrh.js → index-fg91fjtb.js} +1 -1
- package/dist/{index-zfg5y1b9.js → index-h0ay0dp2.js} +3 -3
- package/dist/{index-h9r08433.js → index-z8cpym48.js} +1 -1
- package/dist/{prompt-attribution-v6c51r59.js → prompt-attribution-tpf7gr3x.js} +1 -1
- package/dist/prompt-source-mcp.js +1 -1
- package/dist/{prompts-gsyrzgmg.js → prompts-83y14sh2.js} +1 -1
- package/dist/{sync-60t12kz3.js → sync-wzx6ewqz.js} +2 -2
- package/package.json +1 -1
- package/skills/integration/index.json +2 -2
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
buildDoctorReport
|
|
3
|
-
} from "./cli-
|
|
3
|
+
} from "./cli-hedrh5p9.js";
|
|
4
4
|
import"./cli-rrggdmf8.js";
|
|
5
|
-
import"./cli-
|
|
5
|
+
import"./cli-aedmnm1c.js";
|
|
6
6
|
import"./cli-mm48br00.js";
|
|
7
7
|
import {
|
|
8
8
|
readHarnessSyncState
|
|
@@ -95,7 +95,7 @@ async function buildAgentContext(context) {
|
|
|
95
95
|
const graph = readHarnessGraphIfPresent(context.cwd);
|
|
96
96
|
const reportState = readHarnessReportState(context.cwd);
|
|
97
97
|
const syncState = readHarnessSyncState(context.cwd);
|
|
98
|
-
const harness = graph ? await import("./harness-
|
|
98
|
+
const harness = graph ? await import("./harness-b6z16pgd.js") : undefined;
|
|
99
99
|
const topFindings = doctor.checks.filter((check) => check.status === "fail" || check.status === "warning").slice(0, 12).map(checkToFinding);
|
|
100
100
|
const evidenceRefs = [
|
|
101
101
|
...doctor.checks.map(checkToEvidenceRef),
|
|
@@ -5768,7 +5768,7 @@ async function runPromptSyncExclusive(flags, profileOptions, options) {
|
|
|
5768
5768
|
const analyzedDefinitions = new Map;
|
|
5769
5769
|
if (flags["no-analyze"] !== "true") {
|
|
5770
5770
|
options.onProgress?.("Analyzing prompt sources before sync.");
|
|
5771
|
-
const { analyzeHarnessPrompts } = await import("./harness-
|
|
5771
|
+
const { analyzeHarnessPrompts } = await import("./harness-b6z16pgd.js");
|
|
5772
5772
|
const result = await analyzeHarnessPrompts({
|
|
5773
5773
|
rootDir: process.cwd(),
|
|
5774
5774
|
existing: established.flatMap((prompt) => prompt.sourceDefinition ? [prompt.sourceDefinition.source] : []),
|
|
@@ -5796,7 +5796,7 @@ async function runPromptSyncExclusive(flags, profileOptions, options) {
|
|
|
5796
5796
|
const mergedSources = mergePromptSources(manifest.sources, extraSources);
|
|
5797
5797
|
const manifestUpdate = stableJson(mergedSources) === stableJson(mergePromptSources(manifest.sources, [])) ? undefined : $stringify({ version: 2, prompt_paths: manifest.promptPaths, sources: mergedSources });
|
|
5798
5798
|
const prompts = await discoverPrompts(extraSources);
|
|
5799
|
-
const { checkPromptAttribution } = await import("./prompt-attribution-
|
|
5799
|
+
const { checkPromptAttribution } = await import("./prompt-attribution-tpf7gr3x.js");
|
|
5800
5800
|
const attribution = checkPromptAttribution(process.cwd(), prompts.map((prompt) => prompt.key));
|
|
5801
5801
|
const brokenAttribution = attribution.references.filter((reference) => reference.status === "missing");
|
|
5802
5802
|
if (brokenAttribution.length) {
|
|
@@ -6102,7 +6102,7 @@ async function migratePromptManifest(options = {}) {
|
|
|
6102
6102
|
let addedSources = [];
|
|
6103
6103
|
let pendingSources = [];
|
|
6104
6104
|
if (options.discover) {
|
|
6105
|
-
const { analyzeHarnessPrompts } = await import("./harness-
|
|
6105
|
+
const { analyzeHarnessPrompts } = await import("./harness-b6z16pgd.js");
|
|
6106
6106
|
const result = await analyzeHarnessPrompts({
|
|
6107
6107
|
rootDir: root,
|
|
6108
6108
|
existing: manifest.sources,
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
} from "./cli-rrggdmf8.js";
|
|
5
5
|
import {
|
|
6
6
|
inspectPromptManifest
|
|
7
|
-
} from "./cli-
|
|
7
|
+
} from "./cli-aedmnm1c.js";
|
|
8
8
|
import {
|
|
9
9
|
readHarnessSyncState,
|
|
10
10
|
renderDoctorHuman,
|
|
@@ -395,7 +395,7 @@ async function harnessCurrentCheck(cwd, manifestPath, manifestExists, tenantId)
|
|
|
395
395
|
};
|
|
396
396
|
}
|
|
397
397
|
try {
|
|
398
|
-
const { scanHarness } = await import("./harness-
|
|
398
|
+
const { scanHarness } = await import("./harness-b6z16pgd.js");
|
|
399
399
|
const current = scanHarness({
|
|
400
400
|
rootDir: cwd,
|
|
401
401
|
scannerVersion: "doctor",
|
|
@@ -109,10 +109,10 @@ import {
|
|
|
109
109
|
} from "./cli-0v6na3yp.js";
|
|
110
110
|
|
|
111
111
|
// src/harness-extract/enumerators/agents.ts
|
|
112
|
-
var
|
|
112
|
+
var import_typescript15 = __toESM(require_typescript(), 1);
|
|
113
113
|
|
|
114
114
|
// src/harness-extract/index.ts
|
|
115
|
-
var
|
|
115
|
+
var import_typescript14 = __toESM(require_typescript(), 1);
|
|
116
116
|
import { resolve as resolve13 } from "node:path";
|
|
117
117
|
|
|
118
118
|
// src/harness-extract/ast.ts
|
|
@@ -19916,7 +19916,7 @@ async function runHarnessCommand(context) {
|
|
|
19916
19916
|
throw new CliInputError("Focused remote prompt analysis is not supported yet.", "Use local --analyst=claude|codex|cursor|local-scan, or drop --concern for a full remote report.");
|
|
19917
19917
|
}
|
|
19918
19918
|
if (context.flags["github-actions"] === "true") {
|
|
19919
|
-
const { runGithubActionsAnalyze } = await import("./harness-github-actions-
|
|
19919
|
+
const { runGithubActionsAnalyze } = await import("./harness-github-actions-q2j5hhqb.js");
|
|
19920
19920
|
const result = await runGithubActionsAnalyze(rootDir, {
|
|
19921
19921
|
writeReport: (report2) => {
|
|
19922
19922
|
const normalized = normalizeHarnessReport(report2);
|
|
@@ -20067,8 +20067,8 @@ async function runHarnessCommand(context) {
|
|
|
20067
20067
|
}
|
|
20068
20068
|
const { artifacts, unknowns, canonicalAgentIdentities } = deterministicGraphItems(rootDir, promote === "all" ? undefined : promote);
|
|
20069
20069
|
tagComponentStatus({ runtimeAgents: [], artifacts }, rootDir);
|
|
20070
|
-
const { extractHarnessWithContext: extractHarnessWithContext2 } = await import("./index-
|
|
20071
|
-
const { enumerateHarnessComponents, mergeEnumeratedComponents } = await import("./index-
|
|
20070
|
+
const { extractHarnessWithContext: extractHarnessWithContext2 } = await import("./index-z8cpym48.js");
|
|
20071
|
+
const { enumerateHarnessComponents, mergeEnumeratedComponents } = await import("./index-fg91fjtb.js");
|
|
20072
20072
|
let components = { runtimeAgents: [], artifacts: [], warnings: [] };
|
|
20073
20073
|
if (promote === "all" || promote === "topology" || promote === "tools") {
|
|
20074
20074
|
const { result, ctx } = extractHarnessWithContext2(rootDir);
|
|
@@ -20102,8 +20102,8 @@ async function runHarnessCommand(context) {
|
|
|
20102
20102
|
}
|
|
20103
20103
|
case "extract": {
|
|
20104
20104
|
writeHumanProgress(context, "Harness extract: tracing model call sites (no LLM, no network)...");
|
|
20105
|
-
const { extractHarnessWithContext: extractHarnessWithContext2, serializeExtractResult } = await import("./index-
|
|
20106
|
-
const { enumerateHarnessComponents, mergeEnumeratedComponents } = await import("./index-
|
|
20105
|
+
const { extractHarnessWithContext: extractHarnessWithContext2, serializeExtractResult } = await import("./index-z8cpym48.js");
|
|
20106
|
+
const { enumerateHarnessComponents, mergeEnumeratedComponents } = await import("./index-fg91fjtb.js");
|
|
20107
20107
|
const { result, ctx } = extractHarnessWithContext2(rootDir, { fresh: true });
|
|
20108
20108
|
const items = deterministicGraphItems(rootDir);
|
|
20109
20109
|
const artifacts = items.artifacts;
|
|
@@ -21010,8 +21010,8 @@ var CONCERN_PROMOTED_ARTIFACT_TYPES = {
|
|
|
21010
21010
|
evals: new Set(["model_config", "eval"])
|
|
21011
21011
|
};
|
|
21012
21012
|
async function deterministicFloorGraph(rootDir, options = {}) {
|
|
21013
|
-
const { extractHarnessWithContext: extractHarnessWithContext2 } = await import("./index-
|
|
21014
|
-
const { enumerateHarnessComponents, mergeEnumeratedComponents } = await import("./index-
|
|
21013
|
+
const { extractHarnessWithContext: extractHarnessWithContext2 } = await import("./index-z8cpym48.js");
|
|
21014
|
+
const { enumerateHarnessComponents, mergeEnumeratedComponents } = await import("./index-fg91fjtb.js");
|
|
21015
21015
|
const { result, ctx } = extractHarnessWithContext2(rootDir);
|
|
21016
21016
|
const items = deterministicGraphItems(rootDir);
|
|
21017
21017
|
const components = mergeEnumeratedComponents(items.artifacts, enumerateHarnessComponents(result, ctx));
|
|
@@ -28997,6 +28997,126 @@ function toolArtifacts(tools, runtimeAgents = []) {
|
|
|
28997
28997
|
});
|
|
28998
28998
|
}
|
|
28999
28999
|
|
|
29000
|
+
// src/harness-extract/handoffs.ts
|
|
29001
|
+
var import_typescript13 = __toESM(require_typescript(), 1);
|
|
29002
|
+
var MAX_OWNER_HOPS = 6;
|
|
29003
|
+
var MAX_CALLERS_PER_HOP = 25;
|
|
29004
|
+
function collectHandoffs(inputs) {
|
|
29005
|
+
const { rootDir } = inputs;
|
|
29006
|
+
const handoffs = [];
|
|
29007
|
+
const classes = [];
|
|
29008
|
+
const ref = (cls) => {
|
|
29009
|
+
const name = className(cls);
|
|
29010
|
+
return name ? { name, path: relPath(rootDir, cls.getSourceFile().fileName), line: lineOf(cls) } : undefined;
|
|
29011
|
+
};
|
|
29012
|
+
const repoClass = (found) => {
|
|
29013
|
+
const init = found && import_typescript13.default.isVariableDeclaration(found) && found.initializer ? unwrap(found.initializer) : undefined;
|
|
29014
|
+
const decl = init && import_typescript13.default.isClassExpression(init) ? init : found;
|
|
29015
|
+
if (!decl || !(import_typescript13.default.isClassDeclaration(decl) || import_typescript13.default.isClassExpression(decl)))
|
|
29016
|
+
return;
|
|
29017
|
+
const file = decl.getSourceFile();
|
|
29018
|
+
return file.isDeclarationFile || /[\\/]node_modules[\\/]/.test(file.fileName) ? undefined : decl;
|
|
29019
|
+
};
|
|
29020
|
+
const targetsOf = (expression, checker, depth = 0) => {
|
|
29021
|
+
if (depth > 4)
|
|
29022
|
+
return [];
|
|
29023
|
+
const node = unwrap(expression);
|
|
29024
|
+
if (import_typescript13.default.isPropertyAccessExpression(node) || import_typescript13.default.isElementAccessExpression(node)) {
|
|
29025
|
+
const object = objectOf(node.expression, checker);
|
|
29026
|
+
if (object) {
|
|
29027
|
+
const key = import_typescript13.default.isPropertyAccessExpression(node) ? node.name.text : import_typescript13.default.isStringLiteralLike(unwrap(node.argumentExpression)) ? unwrap(node.argumentExpression).text : undefined;
|
|
29028
|
+
const members = object.properties.filter((p2) => import_typescript13.default.isPropertyAssignment(p2) || import_typescript13.default.isShorthandPropertyAssignment(p2));
|
|
29029
|
+
const picked = key !== undefined ? members.filter((p2) => propertyNameText(p2.name) === key) : [];
|
|
29030
|
+
return (picked.length > 0 ? picked : members).flatMap((p2) => import_typescript13.default.isPropertyAssignment(p2) ? targetsOf(p2.initializer, checker, depth + 1) : targetsOf(p2.name, checker, depth + 1));
|
|
29031
|
+
}
|
|
29032
|
+
}
|
|
29033
|
+
const cls = repoClass(valueDeclaration(resolvedSymbol(node, checker)));
|
|
29034
|
+
return cls ? [cls] : [];
|
|
29035
|
+
};
|
|
29036
|
+
const ownersOf = (call) => {
|
|
29037
|
+
const own = enclosingClass(call);
|
|
29038
|
+
const owned = own && ref(own);
|
|
29039
|
+
if (owned)
|
|
29040
|
+
return [{ ...owned, via: "own code" }];
|
|
29041
|
+
const out = [];
|
|
29042
|
+
const seen = new Set;
|
|
29043
|
+
const withOuter = (node) => {
|
|
29044
|
+
const out2 = [];
|
|
29045
|
+
for (let f = inputs.namedEnclosingFunction(node);f; f = inputs.namedEnclosingFunction(f.fn))
|
|
29046
|
+
out2.push(f);
|
|
29047
|
+
return out2;
|
|
29048
|
+
};
|
|
29049
|
+
let frontier = withOuter(call);
|
|
29050
|
+
for (let hop = 0;hop < MAX_OWNER_HOPS && frontier.length > 0; hop += 1) {
|
|
29051
|
+
const next = [];
|
|
29052
|
+
for (const fn of frontier) {
|
|
29053
|
+
if (seen.has(fn.fn))
|
|
29054
|
+
continue;
|
|
29055
|
+
seen.add(fn.fn);
|
|
29056
|
+
for (const caller of inputs.calls.callersOf(fn.fn, fn.name, MAX_CALLERS_PER_HOP)) {
|
|
29057
|
+
const cls = enclosingClass(caller);
|
|
29058
|
+
const owner = cls && ref(cls);
|
|
29059
|
+
if (owner) {
|
|
29060
|
+
const via = `${relPath(rootDir, caller.getSourceFile().fileName)}:${lineOf(caller)}`;
|
|
29061
|
+
if (!out.some((o) => o.name === owner.name && o.path === owner.path))
|
|
29062
|
+
out.push({ ...owner, via });
|
|
29063
|
+
} else {
|
|
29064
|
+
next.push(...withOuter(caller));
|
|
29065
|
+
}
|
|
29066
|
+
}
|
|
29067
|
+
}
|
|
29068
|
+
frontier = next;
|
|
29069
|
+
}
|
|
29070
|
+
return out;
|
|
29071
|
+
};
|
|
29072
|
+
for (const { source, checker } of inputs.files) {
|
|
29073
|
+
const visit2 = (node) => {
|
|
29074
|
+
if ((import_typescript13.default.isClassDeclaration(node) || import_typescript13.default.isClassExpression(node)) && node.heritageClauses) {
|
|
29075
|
+
const extended = node.heritageClauses.find((clause) => clause.token === import_typescript13.default.SyntaxKind.ExtendsKeyword)?.types[0];
|
|
29076
|
+
const named = ref(node);
|
|
29077
|
+
if (extended && named)
|
|
29078
|
+
classes.push({ ...named, base: extended.expression.getText(source) });
|
|
29079
|
+
}
|
|
29080
|
+
if (import_typescript13.default.isCallExpression(node) && node.arguments.length > 0) {
|
|
29081
|
+
const targets = targetsOf(node.arguments[0], checker).map(ref).filter((r) => Boolean(r));
|
|
29082
|
+
if (targets.length > 0) {
|
|
29083
|
+
const cls = enclosingClass(node);
|
|
29084
|
+
const fn = inputs.namedEnclosingFunction(node);
|
|
29085
|
+
handoffs.push({
|
|
29086
|
+
path: relPath(rootDir, source.fileName),
|
|
29087
|
+
line: lineOf(node),
|
|
29088
|
+
col: colOf(node),
|
|
29089
|
+
callee: node.expression.getText(source).replace(/\s+/g, ""),
|
|
29090
|
+
targets: dedupe(targets),
|
|
29091
|
+
...cls && className(cls) ? { enclosingClass: className(cls) } : {},
|
|
29092
|
+
...fn ? { enclosingFunction: fn.name } : {},
|
|
29093
|
+
scope: inputs.scopeOf(node),
|
|
29094
|
+
owners: ownersOf(node)
|
|
29095
|
+
});
|
|
29096
|
+
}
|
|
29097
|
+
}
|
|
29098
|
+
import_typescript13.default.forEachChild(node, visit2);
|
|
29099
|
+
};
|
|
29100
|
+
visit2(source);
|
|
29101
|
+
}
|
|
29102
|
+
return { handoffs, classes };
|
|
29103
|
+
}
|
|
29104
|
+
function objectOf(expression, checker) {
|
|
29105
|
+
const node = unwrap(expression);
|
|
29106
|
+
if (import_typescript13.default.isObjectLiteralExpression(node))
|
|
29107
|
+
return node;
|
|
29108
|
+
const decl = valueDeclaration(resolvedSymbol(node, checker));
|
|
29109
|
+
if (decl && import_typescript13.default.isVariableDeclaration(decl) && decl.initializer) {
|
|
29110
|
+
const init = unwrap(decl.initializer);
|
|
29111
|
+
return import_typescript13.default.isObjectLiteralExpression(init) ? init : undefined;
|
|
29112
|
+
}
|
|
29113
|
+
return;
|
|
29114
|
+
}
|
|
29115
|
+
function dedupe(refs) {
|
|
29116
|
+
const seen = new Set;
|
|
29117
|
+
return refs.filter((r) => !seen.has(`${r.path}:${r.name}`) && seen.add(`${r.path}:${r.name}`));
|
|
29118
|
+
}
|
|
29119
|
+
|
|
29000
29120
|
// src/harness-extract/types.ts
|
|
29001
29121
|
var EXTRACT_SCHEMA_VERSION = 1;
|
|
29002
29122
|
|
|
@@ -29049,7 +29169,7 @@ function functionScope(rootDir, fn, name) {
|
|
|
29049
29169
|
const parts = [qualifiedName(fn, name)];
|
|
29050
29170
|
const object = objectLiteralOf2(fn);
|
|
29051
29171
|
if (object) {
|
|
29052
|
-
const holder = object.parent &&
|
|
29172
|
+
const holder = object.parent && import_typescript14.default.isVariableDeclaration(object.parent) && import_typescript14.default.isIdentifier(object.parent.name) ? object.parent.name.text : `L${lineOf(object)}`;
|
|
29053
29173
|
parts.unshift(holder);
|
|
29054
29174
|
}
|
|
29055
29175
|
for (let outer = namedEnclosingFunction(object ?? fn);outer; outer = namedEnclosingFunction(outer.fn))
|
|
@@ -29057,8 +29177,8 @@ function functionScope(rootDir, fn, name) {
|
|
|
29057
29177
|
return `${relPath(rootDir, fn.getSourceFile().fileName)}#${parts.join(".")}`;
|
|
29058
29178
|
}
|
|
29059
29179
|
function objectLiteralOf2(fn) {
|
|
29060
|
-
const member2 =
|
|
29061
|
-
return member2 &&
|
|
29180
|
+
const member2 = import_typescript14.default.isMethodDeclaration(fn) || import_typescript14.default.isGetAccessorDeclaration(fn) || import_typescript14.default.isSetAccessorDeclaration(fn) ? fn : import_typescript14.default.isPropertyAssignment(fn.parent) ? fn.parent : undefined;
|
|
29181
|
+
return member2 && import_typescript14.default.isObjectLiteralExpression(member2.parent) ? member2.parent : undefined;
|
|
29062
29182
|
}
|
|
29063
29183
|
function scopeOf(rootDir, node) {
|
|
29064
29184
|
const named = namedEnclosingFunction(node);
|
|
@@ -29097,12 +29217,12 @@ function findAgentClasses(program, checker, memo) {
|
|
|
29097
29217
|
if (source.isDeclarationFile || /[\\/]node_modules[\\/]/.test(source.fileName))
|
|
29098
29218
|
continue;
|
|
29099
29219
|
const visit2 = (node) => {
|
|
29100
|
-
if ((
|
|
29220
|
+
if ((import_typescript14.default.isClassDeclaration(node) || import_typescript14.default.isClassExpression(node)) && node.heritageClauses) {
|
|
29101
29221
|
const base = frameworkBaseOf(node, checker, memo).base;
|
|
29102
29222
|
if (base && AGENT_CLASS_BASES.has(base))
|
|
29103
29223
|
out.push(node);
|
|
29104
29224
|
}
|
|
29105
|
-
|
|
29225
|
+
import_typescript14.default.forEachChild(node, visit2);
|
|
29106
29226
|
};
|
|
29107
29227
|
visit2(source);
|
|
29108
29228
|
}
|
|
@@ -29146,35 +29266,35 @@ function siteFields(sources, rootDir) {
|
|
|
29146
29266
|
return out;
|
|
29147
29267
|
}
|
|
29148
29268
|
function paramFlow(node, fn, checker, hops = 0) {
|
|
29149
|
-
if (!
|
|
29269
|
+
if (!import_typescript14.default.isExpression(node) || hops > 2)
|
|
29150
29270
|
return;
|
|
29151
29271
|
const expr = unwrap(node);
|
|
29152
|
-
if (
|
|
29272
|
+
if (import_typescript14.default.isBinaryExpression(expr) && (expr.operatorToken.kind === import_typescript14.default.SyntaxKind.QuestionQuestionToken || expr.operatorToken.kind === import_typescript14.default.SyntaxKind.BarBarToken)) {
|
|
29153
29273
|
return paramFlow(expr.left, fn, checker, hops);
|
|
29154
29274
|
}
|
|
29155
|
-
if (
|
|
29275
|
+
if (import_typescript14.default.isPropertyAccessExpression(expr) && import_typescript14.default.isIdentifier(unwrap(expr.expression))) {
|
|
29156
29276
|
const inner = paramFlow(expr.expression, fn, checker, hops);
|
|
29157
29277
|
return inner && inner.key === undefined ? { param: inner.param, key: expr.name.text } : undefined;
|
|
29158
29278
|
}
|
|
29159
|
-
if (!
|
|
29279
|
+
if (!import_typescript14.default.isIdentifier(expr))
|
|
29160
29280
|
return;
|
|
29161
29281
|
const declaration = valueDeclaration(resolvedSymbol(expr, checker));
|
|
29162
29282
|
if (!declaration)
|
|
29163
29283
|
return;
|
|
29164
|
-
if (
|
|
29284
|
+
if (import_typescript14.default.isParameter(declaration) && declaration.parent === fn && !declaration.dotDotDotToken)
|
|
29165
29285
|
return { param: declaration };
|
|
29166
|
-
if (
|
|
29286
|
+
if (import_typescript14.default.isBindingElement(declaration) && import_typescript14.default.isObjectBindingPattern(declaration.parent) && import_typescript14.default.isParameter(declaration.parent.parent) && declaration.parent.parent.parent === fn && !declaration.dotDotDotToken) {
|
|
29167
29287
|
const key = propertyNameText(declaration.propertyName ?? declaration.name);
|
|
29168
29288
|
return key ? { param: declaration.parent.parent, key } : undefined;
|
|
29169
29289
|
}
|
|
29170
|
-
if (
|
|
29290
|
+
if (import_typescript14.default.isVariableDeclaration(declaration) && declaration.initializer && enclosingFunction(declaration) === fn && declaration.parent.flags & import_typescript14.default.NodeFlags.Const) {
|
|
29171
29291
|
return paramFlow(declaration.initializer, fn, checker, hops + 1);
|
|
29172
29292
|
}
|
|
29173
29293
|
return;
|
|
29174
29294
|
}
|
|
29175
29295
|
function roleParamFlow(arg, fn, checker) {
|
|
29176
29296
|
const object = unwrap(arg.node);
|
|
29177
|
-
if (arg.key !== undefined && !arg.key.includes(".") &&
|
|
29297
|
+
if (arg.key !== undefined && !arg.key.includes(".") && import_typescript14.default.isObjectLiteralExpression(object)) {
|
|
29178
29298
|
const value = propertyValue(object, arg.key);
|
|
29179
29299
|
const flow = value ? paramFlow(value, fn, checker) : undefined;
|
|
29180
29300
|
return flow ? { ...flow, viaProperty: true } : undefined;
|
|
@@ -29186,9 +29306,9 @@ function descendArg(argument, path) {
|
|
|
29186
29306
|
let index = 0;
|
|
29187
29307
|
for (;index < path.length; index += 1) {
|
|
29188
29308
|
let value = unwrap(node);
|
|
29189
|
-
if (
|
|
29309
|
+
if (import_typescript14.default.isCallExpression(value) && value.expression.getText() === "JSON.stringify" && value.arguments[0])
|
|
29190
29310
|
value = unwrap(value.arguments[0]);
|
|
29191
|
-
const next =
|
|
29311
|
+
const next = import_typescript14.default.isObjectLiteralExpression(value) ? propertyValue(value, path[index]) : undefined;
|
|
29192
29312
|
if (!next)
|
|
29193
29313
|
break;
|
|
29194
29314
|
node = next;
|
|
@@ -29266,7 +29386,7 @@ function runExtract(rootDir, options) {
|
|
|
29266
29386
|
sites.push({ site, entry, anchor, sources, level: 0 });
|
|
29267
29387
|
};
|
|
29268
29388
|
const visit2 = (node) => {
|
|
29269
|
-
if (
|
|
29389
|
+
if (import_typescript14.default.isCallExpression(node) || import_typescript14.default.isNewExpression(node)) {
|
|
29270
29390
|
for (const recognizer of CALL_SINKS) {
|
|
29271
29391
|
let match;
|
|
29272
29392
|
const begin = performance.now();
|
|
@@ -29281,7 +29401,7 @@ function runExtract(rootDir, options) {
|
|
|
29281
29401
|
break;
|
|
29282
29402
|
}
|
|
29283
29403
|
}
|
|
29284
|
-
} else if (
|
|
29404
|
+
} else if (import_typescript14.default.isClassDeclaration(node) || import_typescript14.default.isClassExpression(node)) {
|
|
29285
29405
|
for (const recognizer of classRecognizers) {
|
|
29286
29406
|
try {
|
|
29287
29407
|
for (const match of recognizer.match(node, ctx2))
|
|
@@ -29291,7 +29411,7 @@ function runExtract(rootDir, options) {
|
|
|
29291
29411
|
}
|
|
29292
29412
|
}
|
|
29293
29413
|
}
|
|
29294
|
-
|
|
29414
|
+
import_typescript14.default.forEachChild(node, visit2);
|
|
29295
29415
|
};
|
|
29296
29416
|
visit2(source);
|
|
29297
29417
|
}
|
|
@@ -29343,7 +29463,7 @@ function runExtract(rootDir, options) {
|
|
|
29343
29463
|
const sources = [];
|
|
29344
29464
|
for (const { source: role, flow } of flowing) {
|
|
29345
29465
|
const argument = call.arguments[named.fn.parameters.indexOf(flow.param)];
|
|
29346
|
-
if (!argument ||
|
|
29466
|
+
if (!argument || import_typescript14.default.isSpreadElement(argument))
|
|
29347
29467
|
continue;
|
|
29348
29468
|
const arg = descendArg(argument, [flow.key, flow.viaProperty ? undefined : role.arg.key].filter((part) => Boolean(part)));
|
|
29349
29469
|
sources.push({ ...role, bindings: extendBindings(role.bindings, callerBindings), arg });
|
|
@@ -29482,6 +29602,19 @@ function runExtract(rootDir, options) {
|
|
|
29482
29602
|
timings.tools = Date.now() - begin;
|
|
29483
29603
|
result.durationMs = Date.now() - started;
|
|
29484
29604
|
}
|
|
29605
|
+
if (options.handoffs ?? true) {
|
|
29606
|
+
const begin = Date.now();
|
|
29607
|
+
try {
|
|
29608
|
+
const files2 = [...repo?.owner.entries() ?? []].filter(([file]) => !isTestPath(relPath(rootDir, file))).map(([file, entry]) => ({ source: entry.program.getSourceFile(file), checker: entry.checker() })).filter((f) => Boolean(f.source));
|
|
29609
|
+
const found = collectHandoffs({ rootDir, files: files2, calls, scopeOf: (node) => scopeOf(rootDir, node), namedEnclosingFunction });
|
|
29610
|
+
result.handoffs = found.handoffs;
|
|
29611
|
+
result.classes = found.classes;
|
|
29612
|
+
} catch (error) {
|
|
29613
|
+
warnings.push(`handoffs: ${error.message}`);
|
|
29614
|
+
}
|
|
29615
|
+
timings.handoffs = Date.now() - begin;
|
|
29616
|
+
result.durationMs = Date.now() - started;
|
|
29617
|
+
}
|
|
29485
29618
|
return { result, ctx };
|
|
29486
29619
|
}
|
|
29487
29620
|
function nodeSpanning(source, start, end) {
|
|
@@ -29495,7 +29628,7 @@ function nodeSpanning(source, start, end) {
|
|
|
29495
29628
|
return;
|
|
29496
29629
|
}
|
|
29497
29630
|
best = node;
|
|
29498
|
-
|
|
29631
|
+
import_typescript14.default.forEachChild(node, visit2);
|
|
29499
29632
|
};
|
|
29500
29633
|
visit2(source);
|
|
29501
29634
|
return best;
|
|
@@ -29556,8 +29689,8 @@ function routeOf(fn, file) {
|
|
|
29556
29689
|
if (name && HTTP_METHODS2.has(name) && /(?:^|\/)(?:route|\+server)\.[cm]?[jt]sx?$/.test(file.path))
|
|
29557
29690
|
return `${name} ${file.path}`;
|
|
29558
29691
|
const parent = fn.parent;
|
|
29559
|
-
if (parent &&
|
|
29560
|
-
const path = parent.arguments.find(
|
|
29692
|
+
if (parent && import_typescript15.default.isCallExpression(parent) && import_typescript15.default.isPropertyAccessExpression(parent.expression) && /^(get|post|put|patch|delete|all|on)$/.test(parent.expression.name.text)) {
|
|
29693
|
+
const path = parent.arguments.find(import_typescript15.default.isStringLiteralLike);
|
|
29561
29694
|
if (path)
|
|
29562
29695
|
return `${parent.expression.name.text.toUpperCase()} ${path.text} (${file.path})`;
|
|
29563
29696
|
}
|
|
@@ -29579,18 +29712,18 @@ function enumerateAgents(result, ctx) {
|
|
|
29579
29712
|
continue;
|
|
29580
29713
|
const checker = ctx.checkerFor(file.path);
|
|
29581
29714
|
visit(file.source, (node) => {
|
|
29582
|
-
if ((
|
|
29715
|
+
if ((import_typescript15.default.isClassDeclaration(node) || import_typescript15.default.isClassExpression(node)) && node.name) {
|
|
29583
29716
|
const name2 = node.name.text;
|
|
29584
29717
|
const info = checker ? frameworkBaseOf(node, checker, memo) : undefined;
|
|
29585
29718
|
const directBase = node.heritageClauses?.flatMap((h) => h.types).map((x) => x.expression.getText()) ?? [];
|
|
29586
29719
|
const protocolEvents = new Set;
|
|
29587
29720
|
visit(node, (member2) => {
|
|
29588
|
-
if (
|
|
29721
|
+
if (import_typescript15.default.isStringLiteralLike(member2))
|
|
29589
29722
|
protocolEvents.add(member2.text);
|
|
29590
29723
|
});
|
|
29591
29724
|
const realtime = protocolEvents.has("session.update") && protocolEvents.has("response.create") && [...protocolEvents].some((event) => event.includes("function_call"));
|
|
29592
|
-
const exported =
|
|
29593
|
-
const abstract =
|
|
29725
|
+
const exported = import_typescript15.default.getCombinedModifierFlags(node) & import_typescript15.default.ModifierFlags.Export;
|
|
29726
|
+
const abstract = import_typescript15.default.getCombinedModifierFlags(node) & import_typescript15.default.ModifierFlags.Abstract;
|
|
29594
29727
|
if (!abstract && (exported || bound.has(name2)) && (info?.base && AGENT_BASES4.has(info.base) || directBase.some((x) => AGENT_BASES4.has(x)) || exported && realtime)) {
|
|
29595
29728
|
classes.push({ file, node, name: name2, chain: info?.chain ?? [name2, ...directBase] });
|
|
29596
29729
|
}
|
|
@@ -29628,10 +29761,10 @@ function enumerateAgents(result, ctx) {
|
|
|
29628
29761
|
};
|
|
29629
29762
|
if (name) {
|
|
29630
29763
|
const parts = [qualified(node, name)];
|
|
29631
|
-
const member2 =
|
|
29632
|
-
const object = member2 &&
|
|
29764
|
+
const member2 = import_typescript15.default.isMethodDeclaration(node) || import_typescript15.default.isGetAccessorDeclaration(node) || import_typescript15.default.isSetAccessorDeclaration(node) ? node : import_typescript15.default.isPropertyAssignment(node.parent) ? node.parent : undefined;
|
|
29765
|
+
const object = member2 && import_typescript15.default.isObjectLiteralExpression(member2.parent) ? member2.parent : undefined;
|
|
29633
29766
|
if (object)
|
|
29634
|
-
parts.unshift(
|
|
29767
|
+
parts.unshift(import_typescript15.default.isVariableDeclaration(object.parent) && import_typescript15.default.isIdentifier(object.parent.name) ? object.parent.name.text : `L${lineOf5(object)}`);
|
|
29635
29768
|
for (let outer = (object ?? node).parent;outer; outer = outer.parent) {
|
|
29636
29769
|
if (isFunctionLike(outer)) {
|
|
29637
29770
|
const outerName = functionName(outer);
|
|
@@ -29653,7 +29786,7 @@ function enumerateAgents(result, ctx) {
|
|
|
29653
29786
|
const checker = ctx.checkerFor(node.getSourceFile().fileName.slice(ctx.rootDir.length + 1));
|
|
29654
29787
|
const bases = node.heritageClauses?.flatMap((clause) => clause.types).flatMap((base) => {
|
|
29655
29788
|
const declaration = checker && valueDeclaration(resolvedSymbol(base.expression, checker));
|
|
29656
|
-
return declaration &&
|
|
29789
|
+
return declaration && import_typescript15.default.isClassLike(declaration) ? classChain(declaration, seen) : [];
|
|
29657
29790
|
}) ?? [];
|
|
29658
29791
|
return [node, ...bases];
|
|
29659
29792
|
};
|
|
@@ -29669,32 +29802,32 @@ function enumerateAgents(result, ctx) {
|
|
|
29669
29802
|
return;
|
|
29670
29803
|
};
|
|
29671
29804
|
const bindingTruth = (condition, worker) => {
|
|
29672
|
-
if (condition.kind ===
|
|
29805
|
+
if (condition.kind === import_typescript15.default.SyntaxKind.TrueKeyword)
|
|
29673
29806
|
return true;
|
|
29674
|
-
if (condition.kind ===
|
|
29807
|
+
if (condition.kind === import_typescript15.default.SyntaxKind.FalseKeyword)
|
|
29675
29808
|
return false;
|
|
29676
|
-
if (
|
|
29809
|
+
if (import_typescript15.default.isPrefixUnaryExpression(condition) && condition.operator === import_typescript15.default.SyntaxKind.ExclamationToken) {
|
|
29677
29810
|
const value = bindingTruth(condition.operand, worker);
|
|
29678
29811
|
return value === undefined ? undefined : !value;
|
|
29679
29812
|
}
|
|
29680
|
-
if (
|
|
29813
|
+
if (import_typescript15.default.isPropertyAccessExpression(condition) && /^(?:this\.)?env$/.test(condition.expression.getText()) && (worker ? repo.workers.find((entry) => entry.id === worker)?.queueBindings : repo.queueBindingsFor(condition.getSourceFile().fileName.slice(ctx.rootDir.length + 1)))?.has(condition.name.text))
|
|
29681
29814
|
return true;
|
|
29682
29815
|
return;
|
|
29683
29816
|
};
|
|
29684
|
-
const returns = (node) => Boolean(node && (
|
|
29817
|
+
const returns = (node) => Boolean(node && (import_typescript15.default.isReturnStatement(node) || import_typescript15.default.isBlock(node) && node.statements.length && import_typescript15.default.isReturnStatement(node.statements[node.statements.length - 1])));
|
|
29685
29818
|
const deployed = (node, worker) => {
|
|
29686
29819
|
for (let current = node;current.parent; current = current.parent) {
|
|
29687
29820
|
const parent = current.parent;
|
|
29688
|
-
if (
|
|
29821
|
+
if (import_typescript15.default.isIfStatement(parent)) {
|
|
29689
29822
|
const truth = bindingTruth(parent.expression, worker);
|
|
29690
29823
|
if (truth !== undefined && (current === parent.thenStatement ? !truth : current === parent.elseStatement ? truth : false))
|
|
29691
29824
|
return false;
|
|
29692
29825
|
}
|
|
29693
|
-
if (
|
|
29826
|
+
if (import_typescript15.default.isBlock(parent))
|
|
29694
29827
|
for (const prior of parent.statements) {
|
|
29695
29828
|
if (prior.getStart() >= current.getStart())
|
|
29696
29829
|
break;
|
|
29697
|
-
if (
|
|
29830
|
+
if (import_typescript15.default.isIfStatement(prior)) {
|
|
29698
29831
|
const truth = bindingTruth(prior.expression, worker);
|
|
29699
29832
|
if (truth !== undefined && returns(truth ? prior.thenStatement : prior.elseStatement))
|
|
29700
29833
|
return false;
|
|
@@ -29720,7 +29853,7 @@ function enumerateAgents(result, ctx) {
|
|
|
29720
29853
|
const descend = (node) => {
|
|
29721
29854
|
if (node.getStart() <= offset && node.getEnd() >= offset) {
|
|
29722
29855
|
anchor = node;
|
|
29723
|
-
|
|
29856
|
+
import_typescript15.default.forEachChild(node, descend);
|
|
29724
29857
|
}
|
|
29725
29858
|
};
|
|
29726
29859
|
descend(file.source);
|
|
@@ -29729,21 +29862,21 @@ function enumerateAgents(result, ctx) {
|
|
|
29729
29862
|
continue;
|
|
29730
29863
|
markModel(scope, anchor);
|
|
29731
29864
|
const tools = site.toolsArg ? ctx.nodeAt(site.toolsArg) : undefined;
|
|
29732
|
-
scope.hasTools ||= Boolean(tools && !(
|
|
29865
|
+
scope.hasTools ||= Boolean(tools && !(import_typescript15.default.isObjectLiteralExpression(tools) && tools.properties.length === 0) && !(import_typescript15.default.isArrayLiteralExpression(tools) && tools.elements.length === 0));
|
|
29733
29866
|
scope.aliases.push(site.scope);
|
|
29734
29867
|
}
|
|
29735
29868
|
const targetsOf = (node, file) => {
|
|
29736
29869
|
const checker = ctx.checkerFor(file.path);
|
|
29737
29870
|
if (!checker)
|
|
29738
29871
|
return [];
|
|
29739
|
-
const at =
|
|
29872
|
+
const at = import_typescript15.default.isPropertyAccessExpression(node) ? node.name : node;
|
|
29740
29873
|
const declaration = valueDeclaration(resolvedSymbol(at, checker));
|
|
29741
29874
|
if (!declaration)
|
|
29742
29875
|
return [];
|
|
29743
29876
|
const direct = byNode.get(declaration) ?? scopes.get(keyOf(declaration));
|
|
29744
29877
|
if (direct)
|
|
29745
29878
|
return [direct];
|
|
29746
|
-
if ((
|
|
29879
|
+
if ((import_typescript15.default.isVariableDeclaration(declaration) || import_typescript15.default.isPropertyAssignment(declaration) || import_typescript15.default.isPropertyDeclaration(declaration)) && declaration.initializer) {
|
|
29747
29880
|
const fn = byNode.get(declaration.initializer) ?? scopes.get(keyOf(declaration.initializer));
|
|
29748
29881
|
if (fn)
|
|
29749
29882
|
return [fn];
|
|
@@ -29755,19 +29888,19 @@ function enumerateAgents(result, ctx) {
|
|
|
29755
29888
|
if (node !== scope.node && isFunctionLike(node)) {
|
|
29756
29889
|
return;
|
|
29757
29890
|
}
|
|
29758
|
-
if (
|
|
29891
|
+
if (import_typescript15.default.isWhileStatement(node) || import_typescript15.default.isDoStatement(node) || import_typescript15.default.isForStatement(node) || import_typescript15.default.isForOfStatement(node))
|
|
29759
29892
|
scope.hasLoop = true;
|
|
29760
|
-
if ((
|
|
29893
|
+
if ((import_typescript15.default.isIdentifier(node) || import_typescript15.default.isStringLiteralLike(node)) && /^(?:tool_calls|toolCalls|tool_use|tool_result|tool_results|toolResults)$/.test(node.text)) {
|
|
29761
29894
|
scope.hasTools = true;
|
|
29762
29895
|
scope.toolFeedback = true;
|
|
29763
29896
|
}
|
|
29764
|
-
if (
|
|
29765
|
-
const fields = new Map(node.properties.filter(
|
|
29897
|
+
if (import_typescript15.default.isObjectLiteralExpression(node)) {
|
|
29898
|
+
const fields = new Map(node.properties.filter(import_typescript15.default.isPropertyAssignment).map((p2) => [nameOf(p2.name), p2.initializer]));
|
|
29766
29899
|
const type = fields.get("type");
|
|
29767
|
-
if (type &&
|
|
29900
|
+
if (type && import_typescript15.default.isStringLiteralLike(type) && type.text === "tool" && fields.has("name"))
|
|
29768
29901
|
scope.forcedOutput = true;
|
|
29769
29902
|
}
|
|
29770
|
-
if (
|
|
29903
|
+
if (import_typescript15.default.isCallExpression(node) || import_typescript15.default.isNewExpression(node)) {
|
|
29771
29904
|
const callee = node.expression.getText();
|
|
29772
29905
|
if (/(?:chat\.)?completions\.create$|messages\.(?:create|stream)$|responses\.(?:create|stream)$/.test(callee))
|
|
29773
29906
|
markModel(scope, node);
|
|
@@ -29775,7 +29908,7 @@ function enumerateAgents(result, ctx) {
|
|
|
29775
29908
|
markModel(scope, node);
|
|
29776
29909
|
const connect = (at) => {
|
|
29777
29910
|
for (const target of byNode.has(at) ? [byNode.get(at)] : targetsOf(at, scope.file)) {
|
|
29778
|
-
if (
|
|
29911
|
+
if (import_typescript15.default.isPropertyAccessExpression(at) && at.expression.kind === import_typescript15.default.SyntaxKind.ThisKeyword) {
|
|
29779
29912
|
virtualEdges.set(`${scope.key}|${target.key}`, at.name.text);
|
|
29780
29913
|
scope.virtualCalls.set(target.key, at.name.text);
|
|
29781
29914
|
}
|
|
@@ -29794,30 +29927,30 @@ function enumerateAgents(result, ctx) {
|
|
|
29794
29927
|
connect(at);
|
|
29795
29928
|
return;
|
|
29796
29929
|
}
|
|
29797
|
-
if (
|
|
29930
|
+
if (import_typescript15.default.isIdentifier(at) || import_typescript15.default.isPropertyAccessExpression(at))
|
|
29798
29931
|
connect(at);
|
|
29799
|
-
|
|
29932
|
+
import_typescript15.default.forEachChild(at, connectArgument);
|
|
29800
29933
|
};
|
|
29801
29934
|
for (const argument of node.arguments ?? [])
|
|
29802
29935
|
connectArgument(argument);
|
|
29803
29936
|
for (const argument of node.arguments ?? [])
|
|
29804
|
-
if (
|
|
29937
|
+
if (import_typescript15.default.isObjectLiteralExpression(argument)) {
|
|
29805
29938
|
const fields = new Set(argument.properties.map((p2) => nameOf(p2.name)));
|
|
29806
29939
|
if (fields.has("model") && fields.has("messages") && fields.has("tools")) {
|
|
29807
29940
|
markModel(scope, node);
|
|
29808
29941
|
scope.hasTools = true;
|
|
29809
29942
|
}
|
|
29810
29943
|
}
|
|
29811
|
-
if (/(?:^|\.)(?:stepCountIs|isStepCount)$/.test(node.expression.getText()) && node.arguments?.[0] &&
|
|
29944
|
+
if (/(?:^|\.)(?:stepCountIs|isStepCount)$/.test(node.expression.getText()) && node.arguments?.[0] && import_typescript15.default.isNumericLiteral(node.arguments?.[0]) && Number(node.arguments?.[0].text) > 1) {
|
|
29812
29945
|
scope.hasLoop = true;
|
|
29813
29946
|
scope.configuredSteps = true;
|
|
29814
29947
|
}
|
|
29815
29948
|
}
|
|
29816
|
-
if (
|
|
29949
|
+
if (import_typescript15.default.isPropertyAssignment(node) && nameOf(node.name) === "maxSteps" && import_typescript15.default.isNumericLiteral(node.initializer) && Number(node.initializer.text) > 1) {
|
|
29817
29950
|
scope.hasLoop = true;
|
|
29818
29951
|
scope.configuredSteps = true;
|
|
29819
29952
|
}
|
|
29820
|
-
|
|
29953
|
+
import_typescript15.default.forEachChild(node, inspect);
|
|
29821
29954
|
};
|
|
29822
29955
|
inspect(scope.node);
|
|
29823
29956
|
}
|
|
@@ -29847,14 +29980,14 @@ function enumerateAgents(result, ctx) {
|
|
|
29847
29980
|
}
|
|
29848
29981
|
for (const scope of scopes.values()) {
|
|
29849
29982
|
let nestedInFunction = false;
|
|
29850
|
-
for (let parent = scope.node.parent;parent && !
|
|
29983
|
+
for (let parent = scope.node.parent;parent && !import_typescript15.default.isClassLike(parent); parent = parent.parent)
|
|
29851
29984
|
if (isFunctionLike(parent)) {
|
|
29852
29985
|
nestedInFunction = true;
|
|
29853
29986
|
break;
|
|
29854
29987
|
}
|
|
29855
29988
|
if (scope.className && !nestedInFunction) {
|
|
29856
29989
|
let member2 = scope.node;
|
|
29857
|
-
while (member2.parent && !
|
|
29990
|
+
while (member2.parent && !import_typescript15.default.isClassLike(member2.parent))
|
|
29858
29991
|
member2 = member2.parent;
|
|
29859
29992
|
const memberName = "name" in member2 ? nameOf(member2.name) : undefined;
|
|
29860
29993
|
for (const cls of classes) {
|
|
@@ -29894,8 +30027,8 @@ function enumerateAgents(result, ctx) {
|
|
|
29894
30027
|
const virtual = virtualEdges.get(`${scope.key}|${callee}`), concrete = classes.find((cls) => componentId("agent", cls.file.path, cls.name) === id);
|
|
29895
30028
|
const callerClass = enclosingClass(scope.node);
|
|
29896
30029
|
if (virtual && concrete && callerClass && concrete.nodes.some((node) => keyOf(node) === keyOf(callerClass))) {
|
|
29897
|
-
const implementation = concrete.nodes.flatMap((node) => node.members.filter((member2) => nameOf(member2.name) === virtual && !(
|
|
29898
|
-
const implementationKey = implementation && (scopes.has(keyOf(implementation)) ? keyOf(implementation) :
|
|
30030
|
+
const implementation = concrete.nodes.flatMap((node) => node.members.filter((member2) => nameOf(member2.name) === virtual && !(import_typescript15.default.getCombinedModifierFlags(member2) & import_typescript15.default.ModifierFlags.Static)))[0];
|
|
30031
|
+
const implementationKey = implementation && (scopes.has(keyOf(implementation)) ? keyOf(implementation) : import_typescript15.default.isPropertyDeclaration(implementation) && implementation.initializer && scopes.has(keyOf(implementation.initializer)) ? keyOf(implementation.initializer) : undefined);
|
|
29899
30032
|
if (implementationKey)
|
|
29900
30033
|
targetKey = implementationKey;
|
|
29901
30034
|
}
|
|
@@ -29950,7 +30083,7 @@ function enumerateAgents(result, ctx) {
|
|
|
29950
30083
|
}
|
|
29951
30084
|
|
|
29952
30085
|
// src/harness-extract/enumerators/workflows.ts
|
|
29953
|
-
var
|
|
30086
|
+
var import_typescript16 = __toESM(require_typescript(), 1);
|
|
29954
30087
|
function enumerateWorkflows(result, ctx) {
|
|
29955
30088
|
const output = emptyResult();
|
|
29956
30089
|
const repo = enumerationRepository(ctx);
|
|
@@ -29963,10 +30096,10 @@ function enumerateWorkflows(result, ctx) {
|
|
|
29963
30096
|
continue;
|
|
29964
30097
|
for (const name of worker.workflowClasses) {
|
|
29965
30098
|
let exported = checker.getExportsOfModule(module).find((symbol) => symbol.name === name);
|
|
29966
|
-
if (exported && exported.flags &
|
|
30099
|
+
if (exported && exported.flags & import_typescript16.default.SymbolFlags.Alias)
|
|
29967
30100
|
exported = checker.getAliasedSymbol(exported);
|
|
29968
30101
|
const declaration = exported && valueDeclaration(exported);
|
|
29969
|
-
if (declaration &&
|
|
30102
|
+
if (declaration && import_typescript16.default.isClassDeclaration(declaration))
|
|
29970
30103
|
bindings.add(nodeKey(declaration));
|
|
29971
30104
|
}
|
|
29972
30105
|
}
|
|
@@ -29975,7 +30108,7 @@ function enumerateWorkflows(result, ctx) {
|
|
|
29975
30108
|
if (!/\.[cm]?[jt]sx?$/.test(file.path) || TEST_PATH4.test(file.path) || EVAL_PATH2.test(file.path))
|
|
29976
30109
|
continue;
|
|
29977
30110
|
visit(file.source, (node) => {
|
|
29978
|
-
if (!
|
|
30111
|
+
if (!import_typescript16.default.isClassDeclaration(node) || !node.name || import_typescript16.default.getCombinedModifierFlags(node) & import_typescript16.default.ModifierFlags.Abstract)
|
|
29979
30112
|
return;
|
|
29980
30113
|
const checker = ctx.checkerFor(file.path);
|
|
29981
30114
|
const base = checker ? frameworkBaseOf(node, checker, memo)?.base : undefined;
|
|
@@ -30000,7 +30133,7 @@ function enumerateWorkflows(result, ctx) {
|
|
|
30000
30133
|
if (!cls || !workerClasses.has(nodeKey(cls)))
|
|
30001
30134
|
return calls;
|
|
30002
30135
|
const member2 = scope.node.parent === cls ? scope.node : scope.node.parent;
|
|
30003
|
-
if (
|
|
30136
|
+
if (import_typescript16.default.getCombinedModifierFlags(member2) & import_typescript16.default.ModifierFlags.Static)
|
|
30004
30137
|
return calls;
|
|
30005
30138
|
return new Set([...calls].map((key) => {
|
|
30006
30139
|
const method = scope.virtualCalls.get(key);
|
|
@@ -30014,24 +30147,24 @@ function enumerateWorkflows(result, ctx) {
|
|
|
30014
30147
|
if (!node || visited.has(node))
|
|
30015
30148
|
return;
|
|
30016
30149
|
visited.add(node);
|
|
30017
|
-
if (
|
|
30150
|
+
if (import_typescript16.default.isParenthesizedExpression(node) || import_typescript16.default.isAsExpression(node) || import_typescript16.default.isSatisfiesExpression(node) || import_typescript16.default.isNonNullExpression(node)) {
|
|
30018
30151
|
resolveWorker(node.expression);
|
|
30019
30152
|
return;
|
|
30020
30153
|
}
|
|
30021
|
-
if (
|
|
30154
|
+
if (import_typescript16.default.isCallExpression(node) && /(?:^|\.)withSentry$/.test(node.expression.getText())) {
|
|
30022
30155
|
for (const argument of node.arguments)
|
|
30023
30156
|
resolveWorker(argument);
|
|
30024
30157
|
return;
|
|
30025
30158
|
}
|
|
30026
|
-
if (
|
|
30159
|
+
if (import_typescript16.default.isExportAssignment(node)) {
|
|
30027
30160
|
resolveWorker(node.expression);
|
|
30028
30161
|
return;
|
|
30029
30162
|
}
|
|
30030
|
-
if (
|
|
30163
|
+
if (import_typescript16.default.isVariableDeclaration(node)) {
|
|
30031
30164
|
resolveWorker(node.initializer);
|
|
30032
30165
|
return;
|
|
30033
30166
|
}
|
|
30034
|
-
if (
|
|
30167
|
+
if (import_typescript16.default.isIdentifier(node) && checker) {
|
|
30035
30168
|
resolveWorker(valueDeclaration(resolvedSymbol(node, checker)));
|
|
30036
30169
|
return;
|
|
30037
30170
|
}
|
|
@@ -30039,17 +30172,17 @@ function enumerateWorkflows(result, ctx) {
|
|
|
30039
30172
|
};
|
|
30040
30173
|
const module = mainFile && checker?.getSymbolAtLocation(mainFile.source);
|
|
30041
30174
|
const exported = module && checker?.getExportsOfModule(module).find((symbol2) => symbol2.name === "default");
|
|
30042
|
-
const symbol = exported && checker && (exported.flags &
|
|
30175
|
+
const symbol = exported && checker && (exported.flags & import_typescript16.default.SymbolFlags.Alias ? checker.getAliasedSymbol(exported) : exported);
|
|
30043
30176
|
resolveWorker(symbol && valueDeclaration(symbol));
|
|
30044
30177
|
const collectImplementations = (node) => {
|
|
30045
|
-
if (!
|
|
30178
|
+
if (!import_typescript16.default.isClassLike(node) || workerClasses.has(nodeKey(node)))
|
|
30046
30179
|
return;
|
|
30047
30180
|
workerClasses.add(nodeKey(node));
|
|
30048
30181
|
for (const member2 of node.members) {
|
|
30049
|
-
if (
|
|
30182
|
+
if (import_typescript16.default.getCombinedModifierFlags(member2) & import_typescript16.default.ModifierFlags.Static)
|
|
30050
30183
|
continue;
|
|
30051
30184
|
const name = nameOf(member2.name);
|
|
30052
|
-
const implementation = byKey.get(nodeKey(member2)) ?? (
|
|
30185
|
+
const implementation = byKey.get(nodeKey(member2)) ?? (import_typescript16.default.isPropertyDeclaration(member2) && member2.initializer ? byKey.get(nodeKey(member2.initializer)) : undefined);
|
|
30053
30186
|
if (name && !implementations.has(name))
|
|
30054
30187
|
implementations.set(name, implementation?.key ?? "(non-callable override)");
|
|
30055
30188
|
}
|
|
@@ -30076,19 +30209,19 @@ function enumerateWorkflows(result, ctx) {
|
|
|
30076
30209
|
if (!node || seen2.has(node))
|
|
30077
30210
|
return;
|
|
30078
30211
|
seen2.add(node);
|
|
30079
|
-
if (
|
|
30212
|
+
if (import_typescript16.default.isIdentifier(node) && checker) {
|
|
30080
30213
|
resolveScheduled(valueDeclaration(resolvedSymbol(node, checker)), seen2);
|
|
30081
30214
|
return;
|
|
30082
30215
|
}
|
|
30083
|
-
if (
|
|
30216
|
+
if (import_typescript16.default.isVariableDeclaration(node) || import_typescript16.default.isPropertyAssignment(node) || import_typescript16.default.isPropertyDeclaration(node)) {
|
|
30084
30217
|
resolveScheduled(node.initializer, seen2);
|
|
30085
30218
|
return;
|
|
30086
30219
|
}
|
|
30087
|
-
if (
|
|
30220
|
+
if (import_typescript16.default.isShorthandPropertyAssignment(node)) {
|
|
30088
30221
|
resolveScheduled(checker && valueDeclaration(checker.getShorthandAssignmentValueSymbol(node)), seen2);
|
|
30089
30222
|
return;
|
|
30090
30223
|
}
|
|
30091
|
-
if (
|
|
30224
|
+
if (import_typescript16.default.isParenthesizedExpression(node) || import_typescript16.default.isAsExpression(node) || import_typescript16.default.isSatisfiesExpression(node) || import_typescript16.default.isNonNullExpression(node)) {
|
|
30092
30225
|
resolveScheduled(node.expression, seen2);
|
|
30093
30226
|
return;
|
|
30094
30227
|
}
|
|
@@ -30098,11 +30231,11 @@ function enumerateWorkflows(result, ctx) {
|
|
|
30098
30231
|
if (seen2.has(node))
|
|
30099
30232
|
return;
|
|
30100
30233
|
seen2.add(node);
|
|
30101
|
-
const members =
|
|
30102
|
-
const handlers = members.filter((member2) => nameOf(member2.name) === "scheduled" && !(
|
|
30234
|
+
const members = import_typescript16.default.isObjectLiteralExpression(node) ? node.properties : import_typescript16.default.isClassLike(node) ? node.members : [];
|
|
30235
|
+
const handlers = members.filter((member2) => nameOf(member2.name) === "scheduled" && !(import_typescript16.default.getCombinedModifierFlags(member2) & import_typescript16.default.ModifierFlags.Static));
|
|
30103
30236
|
for (const member2 of handlers)
|
|
30104
30237
|
resolveScheduled(member2);
|
|
30105
|
-
if (!handlers.length &&
|
|
30238
|
+
if (!handlers.length && import_typescript16.default.isClassLike(node) && checker)
|
|
30106
30239
|
for (const base of node.heritageClauses?.flatMap((clause) => clause.types) ?? []) {
|
|
30107
30240
|
const declaration = valueDeclaration(resolvedSymbol(base.expression, checker));
|
|
30108
30241
|
if (declaration)
|
|
@@ -30148,7 +30281,7 @@ function enumerateWorkflows(result, ctx) {
|
|
|
30148
30281
|
}
|
|
30149
30282
|
|
|
30150
30283
|
// src/harness-extract/enumerators/catalog.ts
|
|
30151
|
-
var
|
|
30284
|
+
var import_typescript17 = __toESM(require_typescript(), 1);
|
|
30152
30285
|
var THINK_WORKSPACE_TOOLS = ["read", "write", "edit", "list", "find", "grep", "delete"];
|
|
30153
30286
|
function strings(expression, checker, seen = new Set) {
|
|
30154
30287
|
if (!expression)
|
|
@@ -30157,35 +30290,35 @@ function strings(expression, checker, seen = new Set) {
|
|
|
30157
30290
|
if (seen.has(node))
|
|
30158
30291
|
return [];
|
|
30159
30292
|
seen.add(node);
|
|
30160
|
-
if (
|
|
30293
|
+
if (import_typescript17.default.isIdentifier(node)) {
|
|
30161
30294
|
const declaration = checker && valueDeclaration(resolvedSymbol(node, checker));
|
|
30162
|
-
if (!declaration || !
|
|
30295
|
+
if (!declaration || !import_typescript17.default.isVariableDeclaration(declaration))
|
|
30163
30296
|
return [];
|
|
30164
30297
|
return strings(declaration.initializer, checker, seen);
|
|
30165
30298
|
}
|
|
30166
|
-
if (
|
|
30167
|
-
return node.elements.flatMap((entry) =>
|
|
30168
|
-
if (
|
|
30299
|
+
if (import_typescript17.default.isArrayLiteralExpression(node))
|
|
30300
|
+
return node.elements.flatMap((entry) => import_typescript17.default.isSpreadElement(entry) ? strings(entry.expression, checker, seen) : strings(entry, checker, seen));
|
|
30301
|
+
if (import_typescript17.default.isStringLiteralLike(node))
|
|
30169
30302
|
return [{ name: node.text, node }];
|
|
30170
|
-
if (
|
|
30303
|
+
if (import_typescript17.default.isNewExpression(node) && node.expression.getText() === "Set")
|
|
30171
30304
|
return strings(node.arguments?.[0], checker, seen);
|
|
30172
30305
|
return [];
|
|
30173
30306
|
}
|
|
30174
30307
|
function property(object, name) {
|
|
30175
30308
|
const entry = object.properties.find((item) => item.name && nameOf(item.name) === name);
|
|
30176
|
-
return entry &&
|
|
30309
|
+
return entry && import_typescript17.default.isPropertyAssignment(entry) ? entry.initializer : entry && import_typescript17.default.isShorthandPropertyAssignment(entry) ? entry.name : undefined;
|
|
30177
30310
|
}
|
|
30178
30311
|
function inheritedTrue(node, propertyName2, checker, seen = new Set) {
|
|
30179
30312
|
if (seen.has(node))
|
|
30180
30313
|
return false;
|
|
30181
30314
|
seen.add(node);
|
|
30182
30315
|
const own = node.members.find((member2) => nameOf(member2.name) === propertyName2);
|
|
30183
|
-
if (own &&
|
|
30184
|
-
return unwrap(own.initializer).kind ===
|
|
30316
|
+
if (own && import_typescript17.default.isPropertyDeclaration(own) && own.initializer)
|
|
30317
|
+
return unwrap(own.initializer).kind === import_typescript17.default.SyntaxKind.TrueKeyword;
|
|
30185
30318
|
if (checker)
|
|
30186
30319
|
for (const base of node.heritageClauses?.flatMap((h) => h.types) ?? []) {
|
|
30187
30320
|
const declaration = valueDeclaration(resolvedSymbol(base.expression, checker));
|
|
30188
|
-
if (declaration && (
|
|
30321
|
+
if (declaration && (import_typescript17.default.isClassDeclaration(declaration) || import_typescript17.default.isClassExpression(declaration)))
|
|
30189
30322
|
return inheritedTrue(declaration, propertyName2, checker, seen);
|
|
30190
30323
|
}
|
|
30191
30324
|
return false;
|
|
@@ -30194,9 +30327,9 @@ function hasSkillSources(node, checker, seen = new Set) {
|
|
|
30194
30327
|
if (seen.has(node))
|
|
30195
30328
|
return false;
|
|
30196
30329
|
seen.add(node);
|
|
30197
|
-
const member2 = node.members.find((member3) => nameOf(member3.name) === "getSkills" && !(
|
|
30330
|
+
const member2 = node.members.find((member3) => nameOf(member3.name) === "getSkills" && !(import_typescript17.default.getCombinedModifierFlags(member3) & import_typescript17.default.ModifierFlags.Static));
|
|
30198
30331
|
if (member2) {
|
|
30199
|
-
const hook =
|
|
30332
|
+
const hook = import_typescript17.default.isMethodDeclaration(member2) ? member2 : import_typescript17.default.isPropertyDeclaration(member2) && member2.initializer && (import_typescript17.default.isArrowFunction(unwrap(member2.initializer)) || import_typescript17.default.isFunctionExpression(unwrap(member2.initializer))) ? unwrap(member2.initializer) : undefined;
|
|
30200
30333
|
if (!hook?.body)
|
|
30201
30334
|
return false;
|
|
30202
30335
|
const enabled = (expression, visited = new Set, depth = 0) => {
|
|
@@ -30204,32 +30337,32 @@ function hasSkillSources(node, checker, seen = new Set) {
|
|
|
30204
30337
|
if (visited.has(value) || depth > 8)
|
|
30205
30338
|
return false;
|
|
30206
30339
|
visited.add(value);
|
|
30207
|
-
if (
|
|
30340
|
+
if (import_typescript17.default.isConditionalExpression(value))
|
|
30208
30341
|
return enabled(value.whenTrue, new Set(visited), depth + 1) || enabled(value.whenFalse, new Set(visited), depth + 1);
|
|
30209
|
-
if (checker && (
|
|
30210
|
-
const declaration = valueDeclaration(resolvedSymbol(
|
|
30211
|
-
if (declaration &&
|
|
30342
|
+
if (checker && (import_typescript17.default.isIdentifier(value) || import_typescript17.default.isPropertyAccessExpression(value))) {
|
|
30343
|
+
const declaration = valueDeclaration(resolvedSymbol(import_typescript17.default.isPropertyAccessExpression(value) ? value.name : value, checker));
|
|
30344
|
+
if (declaration && import_typescript17.default.isVariableDeclaration(declaration) && declaration.initializer && declaration.parent.flags & import_typescript17.default.NodeFlags.Const) {
|
|
30212
30345
|
let populated = false;
|
|
30213
30346
|
const symbol = resolvedSymbol(declaration.name, checker);
|
|
30214
30347
|
const scan = (node2) => {
|
|
30215
|
-
if (
|
|
30348
|
+
if (import_typescript17.default.isCallExpression(node2) && import_typescript17.default.isPropertyAccessExpression(node2.expression) && ["push", "unshift", "splice"].includes(node2.expression.name.text) && resolvedSymbol(node2.expression.expression, checker) === symbol && node2.arguments.length > (node2.expression.name.text === "splice" ? 2 : 0))
|
|
30216
30349
|
populated = true;
|
|
30217
|
-
if (
|
|
30350
|
+
if (import_typescript17.default.isBinaryExpression(node2) && node2.operatorToken.kind === import_typescript17.default.SyntaxKind.EqualsToken && import_typescript17.default.isElementAccessExpression(node2.left) && resolvedSymbol(node2.left.expression, checker) === symbol)
|
|
30218
30351
|
populated = true;
|
|
30219
|
-
|
|
30352
|
+
import_typescript17.default.forEachChild(node2, scan);
|
|
30220
30353
|
};
|
|
30221
30354
|
scan(declaration.getSourceFile());
|
|
30222
30355
|
return populated || enabled(declaration.initializer, visited, depth + 1);
|
|
30223
30356
|
}
|
|
30224
30357
|
}
|
|
30225
|
-
return value.kind !==
|
|
30358
|
+
return value.kind !== import_typescript17.default.SyntaxKind.NullKeyword && value.getText() !== "undefined" && (!import_typescript17.default.isArrayLiteralExpression(value) || value.elements.length > 0);
|
|
30226
30359
|
};
|
|
30227
30360
|
return returnExpressions(hook).some((expression) => enabled(expression));
|
|
30228
30361
|
}
|
|
30229
30362
|
if (checker)
|
|
30230
30363
|
for (const base of node.heritageClauses?.flatMap((h) => h.types) ?? []) {
|
|
30231
30364
|
const declaration = valueDeclaration(resolvedSymbol(base.expression, checker));
|
|
30232
|
-
if (declaration && (
|
|
30365
|
+
if (declaration && (import_typescript17.default.isClassDeclaration(declaration) || import_typescript17.default.isClassExpression(declaration)) && hasSkillSources(declaration, checker, seen))
|
|
30233
30366
|
return true;
|
|
30234
30367
|
}
|
|
30235
30368
|
return false;
|
|
@@ -30244,10 +30377,10 @@ function enumerateToolCatalog(result, ctx) {
|
|
|
30244
30377
|
if (!owners.length || !checker)
|
|
30245
30378
|
continue;
|
|
30246
30379
|
visit(scope.node, (node) => {
|
|
30247
|
-
if (!
|
|
30380
|
+
if (!import_typescript17.default.isIdentifier(node) || !/ALLOW|MCP_NAME/.test(node.text))
|
|
30248
30381
|
return;
|
|
30249
30382
|
const declaration = valueDeclaration(resolvedSymbol(node, checker));
|
|
30250
|
-
if (!declaration || !
|
|
30383
|
+
if (!declaration || !import_typescript17.default.isVariableDeclaration(declaration) || !import_typescript17.default.isIdentifier(declaration.name))
|
|
30251
30384
|
return;
|
|
30252
30385
|
const key = `${declaration.getSourceFile().fileName}:${declaration.name.text}`;
|
|
30253
30386
|
let existing = symbolOwners.get(key);
|
|
@@ -30268,7 +30401,7 @@ function enumerateToolCatalog(result, ctx) {
|
|
|
30268
30401
|
if (!file || !checker)
|
|
30269
30402
|
continue;
|
|
30270
30403
|
visit(file.source, (node) => {
|
|
30271
|
-
if ((
|
|
30404
|
+
if ((import_typescript17.default.isClassDeclaration(node) || import_typescript17.default.isClassExpression(node)) && node.name?.text === runtime.name && frameworkBaseOf(node, checker, memo)?.base === "Think")
|
|
30272
30405
|
thinkIds.add(runtime.id);
|
|
30273
30406
|
});
|
|
30274
30407
|
}
|
|
@@ -30285,11 +30418,11 @@ function enumerateToolCatalog(result, ctx) {
|
|
|
30285
30418
|
continue;
|
|
30286
30419
|
const checker = ctx.checkerFor(file.path), declarations = new Map;
|
|
30287
30420
|
visit(file.source, (node) => {
|
|
30288
|
-
if (
|
|
30421
|
+
if (import_typescript17.default.isVariableDeclaration(node) && import_typescript17.default.isIdentifier(node.name) && node.initializer)
|
|
30289
30422
|
declarations.set(node.name.text, node.initializer);
|
|
30290
30423
|
});
|
|
30291
30424
|
visit(file.source, (node) => {
|
|
30292
|
-
if ((
|
|
30425
|
+
if ((import_typescript17.default.isClassDeclaration(node) || import_typescript17.default.isClassExpression(node)) && node.name && agentByName.has(node.name.text)) {
|
|
30293
30426
|
const info = checker ? frameworkBaseOf(node, checker, memo) : undefined;
|
|
30294
30427
|
const directThink = node.heritageClauses?.some((h) => h.types.some((t) => t.expression.getText() === "Think"));
|
|
30295
30428
|
if (info?.base === "Think" || directThink) {
|
|
@@ -30303,37 +30436,37 @@ function enumerateToolCatalog(result, ctx) {
|
|
|
30303
30436
|
add(name, file, node, "think", "Think workspace tool inherited by this concrete agent", owners2);
|
|
30304
30437
|
}
|
|
30305
30438
|
}
|
|
30306
|
-
if (
|
|
30439
|
+
if (import_typescript17.default.isPropertyAccessExpression(node) && node.name.text === "activate_skill" || import_typescript17.default.isPropertyAssignment(node) && nameOf(node.name) === "activate_skill") {
|
|
30307
30440
|
const owner = ownersAt(node, file.path);
|
|
30308
30441
|
add("activate_skill", file, node, "think", "Source explicitly exposes Think skill activation", owner);
|
|
30309
30442
|
}
|
|
30310
|
-
if (
|
|
30443
|
+
if (import_typescript17.default.isCallExpression(node) && import_typescript17.default.isPropertyAccessExpression(node.expression) && /^(?:registerTool|tool)$/.test(node.expression.name.text) && checker) {
|
|
30311
30444
|
const receiver = valueDeclaration(resolvedSymbol(node.expression.expression, checker));
|
|
30312
|
-
const init = receiver &&
|
|
30313
|
-
const origin = init &&
|
|
30445
|
+
const init = receiver && import_typescript17.default.isVariableDeclaration(receiver) && receiver.initializer ? unwrap(receiver.initializer) : undefined;
|
|
30446
|
+
const origin = init && import_typescript17.default.isNewExpression(init) && import_typescript17.default.isIdentifier(init.expression) ? importOrigin(init.expression, checker) : undefined;
|
|
30314
30447
|
const name = node.arguments[0];
|
|
30315
|
-
if (origin?.module.startsWith("@modelcontextprotocol/sdk/") && origin.imported === "McpServer" && name &&
|
|
30448
|
+
if (origin?.module.startsWith("@modelcontextprotocol/sdk/") && origin.imported === "McpServer" && name && import_typescript17.default.isStringLiteralLike(name)) {
|
|
30316
30449
|
add(name.text, file, name, "mcp_server", "MCP SDK server explicitly registers this model-facing tool name", ownersAt(node, file.path));
|
|
30317
30450
|
}
|
|
30318
30451
|
}
|
|
30319
|
-
if (
|
|
30452
|
+
if (import_typescript17.default.isCallExpression(node) && import_typescript17.default.isPropertyAccessExpression(node.expression) && node.expression.expression.getText() === "Output" && node.expression.name.text === "object") {
|
|
30320
30453
|
const owners2 = ownersAt(node, file.path).filter((id) => thinkIds.has(id));
|
|
30321
|
-
if (owners2.length && checker &&
|
|
30454
|
+
if (owners2.length && checker && import_typescript17.default.isIdentifier(node.expression.expression) && ["ai", "@cloudflare/think"].includes(importOrigin(node.expression.expression, checker)?.module ?? ""))
|
|
30322
30455
|
add("think_final_answer", file, node, "think", "Think structured output is offered as the framework final-answer tool", owners2);
|
|
30323
30456
|
}
|
|
30324
|
-
if (
|
|
30457
|
+
if (import_typescript17.default.isCallExpression(node) && import_typescript17.default.isIdentifier(node.expression) && node.expression.text === "createExecuteRuntime") {
|
|
30325
30458
|
const owners2 = ownersAt(node, file.path).filter((id) => thinkIds.has(id));
|
|
30326
30459
|
if (owners2.length && checker && importOrigin(node.expression, checker)?.module.startsWith("@cloudflare/think"))
|
|
30327
30460
|
add("execute", file, node, "think", "Think Code Mode runtime explicitly enabled for this agent", owners2);
|
|
30328
30461
|
}
|
|
30329
|
-
if (!
|
|
30462
|
+
if (!import_typescript17.default.isObjectLiteralExpression(node))
|
|
30330
30463
|
return;
|
|
30331
30464
|
const serverNames = strings(property(node, "name"), checker), allow = property(node, "allow");
|
|
30332
30465
|
if (serverNames.length !== 1 || !allow || !property(node, "url"))
|
|
30333
30466
|
return;
|
|
30334
30467
|
const server = serverNames[0].name;
|
|
30335
30468
|
const owners = ownersAt(node, file.path);
|
|
30336
|
-
if (
|
|
30469
|
+
if (import_typescript17.default.isStringLiteralLike(unwrap(allow)) && unwrap(allow).text === "all") {
|
|
30337
30470
|
const entry = add(`${server} dynamic MCP tools`, file, allow, "mcp_dynamic_group", "Server schemas are admitted dynamically as one bounded catalog group", owners);
|
|
30338
30471
|
entry.serverName = server;
|
|
30339
30472
|
entry.dynamicGroup = true;
|
package/dist/cli.js
CHANGED
|
@@ -2975,25 +2975,25 @@ function leafManifestFields(leaf, commands) {
|
|
|
2975
2975
|
import { fileURLToPath } from "url";
|
|
2976
2976
|
import { realpathSync } from "fs";
|
|
2977
2977
|
async function runPromptsCommand(...args) {
|
|
2978
|
-
return (await import("./prompts-
|
|
2978
|
+
return (await import("./prompts-83y14sh2.js")).runPromptsCommand(...args);
|
|
2979
2979
|
}
|
|
2980
2980
|
async function runSkillsCommand(...args) {
|
|
2981
2981
|
return (await import("./skills-knpeqryb.js")).runSkillsCommand(...args);
|
|
2982
2982
|
}
|
|
2983
2983
|
async function runHarnessCommand(...args) {
|
|
2984
|
-
return (await import("./harness-
|
|
2984
|
+
return (await import("./harness-b6z16pgd.js")).runHarnessCommand(...args);
|
|
2985
2985
|
}
|
|
2986
2986
|
async function runSyncCommand(...args) {
|
|
2987
|
-
return (await import("./sync-
|
|
2987
|
+
return (await import("./sync-wzx6ewqz.js")).runSyncCommand(...args);
|
|
2988
2988
|
}
|
|
2989
2989
|
async function runRegistryCommand(...args) {
|
|
2990
2990
|
return (await import("./registry-c64qr7ta.js")).runRegistryCommand(...args);
|
|
2991
2991
|
}
|
|
2992
2992
|
async function runDoctorCommand(...args) {
|
|
2993
|
-
return (await import("./doctor-
|
|
2993
|
+
return (await import("./doctor-dhgzp9p2.js")).runDoctorCommand(...args);
|
|
2994
2994
|
}
|
|
2995
2995
|
async function runStatusCommand(...args) {
|
|
2996
|
-
return (await import("./doctor-
|
|
2996
|
+
return (await import("./doctor-dhgzp9p2.js")).runStatusCommand(...args);
|
|
2997
2997
|
}
|
|
2998
2998
|
async function runAuthCommand(...args) {
|
|
2999
2999
|
return (await import("./profile-commands-1fdvrs5y.js")).runAuthCommand(...args);
|
|
@@ -3005,7 +3005,7 @@ async function runProfilesCommand(...args) {
|
|
|
3005
3005
|
return (await import("./profile-commands-1fdvrs5y.js")).runProfilesCommand(...args);
|
|
3006
3006
|
}
|
|
3007
3007
|
async function runAgentCommand(...args) {
|
|
3008
|
-
return (await import("./agent-
|
|
3008
|
+
return (await import("./agent-qn9ymfs0.js")).runAgentCommand(...args);
|
|
3009
3009
|
}
|
|
3010
3010
|
async function runProductionCommand(...args) {
|
|
3011
3011
|
return (await import("./production-intelligence-f9sd68te.js")).runProductionCommand(...args);
|
|
@@ -6769,7 +6769,7 @@ var commandRegistry = createCommandRegistry([
|
|
|
6769
6769
|
resetApiRequestCountBeforeRun: true,
|
|
6770
6770
|
telemetry: "result-and-error",
|
|
6771
6771
|
handler: async (context) => {
|
|
6772
|
-
const { runInit } = await import("./index-
|
|
6772
|
+
const { runInit } = await import("./index-h0ay0dp2.js");
|
|
6773
6773
|
if (context.outputMode === "agent-stream") {
|
|
6774
6774
|
context.output.writeEvent({
|
|
6775
6775
|
event: "started",
|
|
@@ -3,9 +3,9 @@ import {
|
|
|
3
3
|
promptsDiscoveredCheck,
|
|
4
4
|
runDoctorCommand,
|
|
5
5
|
runStatusCommand
|
|
6
|
-
} from "./cli-
|
|
6
|
+
} from "./cli-hedrh5p9.js";
|
|
7
7
|
import"./cli-rrggdmf8.js";
|
|
8
|
-
import"./cli-
|
|
8
|
+
import"./cli-aedmnm1c.js";
|
|
9
9
|
import"./cli-mm48br00.js";
|
|
10
10
|
import"./cli-k0vxtzxb.js";
|
|
11
11
|
import"./cli-22yvg5kh.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
buildDoctorReport
|
|
3
|
-
} from "./cli-
|
|
3
|
+
} from "./cli-hedrh5p9.js";
|
|
4
4
|
import {
|
|
5
5
|
selectTenantAndCreateKey
|
|
6
6
|
} from "./cli-n1406hqg.js";
|
|
@@ -20,7 +20,7 @@ import {
|
|
|
20
20
|
import {
|
|
21
21
|
initPrompts,
|
|
22
22
|
runPromptSync
|
|
23
|
-
} from "./cli-
|
|
23
|
+
} from "./cli-aedmnm1c.js";
|
|
24
24
|
import {
|
|
25
25
|
agentsMdProblem,
|
|
26
26
|
runSkillSync
|
|
@@ -46,7 +46,7 @@ import {
|
|
|
46
46
|
runCodingAgent,
|
|
47
47
|
runHarnessCommand,
|
|
48
48
|
startRemoteAnalyze
|
|
49
|
-
} from "./cli-
|
|
49
|
+
} from "./cli-vvn3x5tj.js";
|
|
50
50
|
import {
|
|
51
51
|
canonicalText,
|
|
52
52
|
renderInitBanner,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
runPromptsCommand
|
|
3
|
-
} from "./cli-
|
|
3
|
+
} from "./cli-aedmnm1c.js";
|
|
4
4
|
import {
|
|
5
5
|
runSkillsCommand
|
|
6
6
|
} from "./cli-1smcq5pf.js";
|
|
@@ -10,7 +10,7 @@ import"./cli-hcwdz9sd.js";
|
|
|
10
10
|
import"./cli-mm48br00.js";
|
|
11
11
|
import {
|
|
12
12
|
runHarnessCommand
|
|
13
|
-
} from "./cli-
|
|
13
|
+
} from "./cli-vvn3x5tj.js";
|
|
14
14
|
import"./cli-k0vxtzxb.js";
|
|
15
15
|
import"./cli-97fnztpy.js";
|
|
16
16
|
import"./cli-y333w08f.js";
|
package/package.json
CHANGED