@renseiai/agentfactory-cli 0.8.18 → 0.8.19
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"code-intelligence-runner.d.ts","sourceRoot":"","sources":["../../../src/lib/code-intelligence-runner.ts"],"names":[],"mappings":"AAkBA,MAAM,WAAW,4BAA4B;IAC3C,OAAO,EAAE,MAAM,CAAA;IACf,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,OAAO,CAAC,CAAA;IACjD,cAAc,EAAE,MAAM,EAAE,CAAA;IACxB,GAAG,EAAE,MAAM,CAAA;CACZ;AAED,MAAM,WAAW,4BAA4B;IAC3C,MAAM,EAAE,OAAO,CAAA;CAChB;AAID,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG;IAC7C,OAAO,EAAE,MAAM,GAAG,SAAS,CAAA;IAC3B,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,OAAO,CAAC,CAAA;IACjD,cAAc,EAAE,MAAM,EAAE,CAAA;CACzB,CAwBA;
|
|
1
|
+
{"version":3,"file":"code-intelligence-runner.d.ts","sourceRoot":"","sources":["../../../src/lib/code-intelligence-runner.ts"],"names":[],"mappings":"AAkBA,MAAM,WAAW,4BAA4B;IAC3C,OAAO,EAAE,MAAM,CAAA;IACf,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,OAAO,CAAC,CAAA;IACjD,cAAc,EAAE,MAAM,EAAE,CAAA;IACxB,GAAG,EAAE,MAAM,CAAA;CACZ;AAED,MAAM,WAAW,4BAA4B;IAC3C,MAAM,EAAE,OAAO,CAAA;CAChB;AAID,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG;IAC7C,OAAO,EAAE,MAAM,GAAG,SAAS,CAAA;IAC3B,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,OAAO,CAAC,CAAA;IACjD,cAAc,EAAE,MAAM,EAAE,CAAA;CACzB,CAwBA;AA+gBD,wBAAsB,mBAAmB,CACvC,MAAM,EAAE,4BAA4B,GACnC,OAAO,CAAC,4BAA4B,CAAC,CAuBvC"}
|
|
@@ -256,6 +256,80 @@ function hasRelatedCases(lines, switchLine, _typeName) {
|
|
|
256
256
|
function escapeRegex(str) {
|
|
257
257
|
return str.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
|
|
258
258
|
}
|
|
259
|
+
/**
|
|
260
|
+
* Determine whether a line contains a real import statement (not one inside
|
|
261
|
+
* a comment, string literal, template literal, or test assertion).
|
|
262
|
+
*
|
|
263
|
+
* The caller must maintain the parse state across lines.
|
|
264
|
+
*/
|
|
265
|
+
function isRealImportLine(line, state) {
|
|
266
|
+
const trimmed = line.trim();
|
|
267
|
+
// Track block comment boundaries
|
|
268
|
+
if (state.inBlockComment) {
|
|
269
|
+
if (trimmed.includes('*/')) {
|
|
270
|
+
return { real: false, state: { ...state, inBlockComment: false } };
|
|
271
|
+
}
|
|
272
|
+
return { real: false, state };
|
|
273
|
+
}
|
|
274
|
+
if (trimmed.startsWith('/*')) {
|
|
275
|
+
const closesOnSameLine = trimmed.includes('*/');
|
|
276
|
+
return { real: false, state: { ...state, inBlockComment: !closesOnSameLine } };
|
|
277
|
+
}
|
|
278
|
+
// Track template literal boundaries (backtick strings spanning multiple lines)
|
|
279
|
+
// Count unescaped backticks to toggle state
|
|
280
|
+
if (state.inTemplateLiteral) {
|
|
281
|
+
const backtickCount = countUnescapedBackticks(line);
|
|
282
|
+
if (backtickCount % 2 === 1) {
|
|
283
|
+
// Odd number of backticks — template literal ends on this line
|
|
284
|
+
return { real: false, state: { ...state, inTemplateLiteral: false } };
|
|
285
|
+
}
|
|
286
|
+
return { real: false, state };
|
|
287
|
+
}
|
|
288
|
+
// Single-line comments and JSDoc continuation lines
|
|
289
|
+
if (trimmed.startsWith('//') || trimmed.startsWith('*'))
|
|
290
|
+
return { real: false, state };
|
|
291
|
+
// Check if this line opens a template literal that doesn't close on the same line
|
|
292
|
+
const backticks = countUnescapedBackticks(line);
|
|
293
|
+
if (backticks % 2 === 1) {
|
|
294
|
+
// Odd backticks — a template literal opens and doesn't close on this line.
|
|
295
|
+
// The import on this line (if any) could be before or after the backtick.
|
|
296
|
+
// If the import keyword appears after a backtick, it's template content.
|
|
297
|
+
const importIdx = line.search(/\b(import|export)\s/);
|
|
298
|
+
const firstBacktick = line.indexOf('`');
|
|
299
|
+
if (importIdx >= 0 && firstBacktick >= 0 && importIdx > firstBacktick) {
|
|
300
|
+
// Import appears inside the template literal
|
|
301
|
+
return { real: false, state: { ...state, inTemplateLiteral: true } };
|
|
302
|
+
}
|
|
303
|
+
// Import appears before the backtick — real import, but template opens
|
|
304
|
+
if (importIdx >= 0 && (firstBacktick < 0 || importIdx < firstBacktick)) {
|
|
305
|
+
return { real: true, state: { ...state, inTemplateLiteral: true } };
|
|
306
|
+
}
|
|
307
|
+
return { real: false, state: { ...state, inTemplateLiteral: true } };
|
|
308
|
+
}
|
|
309
|
+
// Real import/export/require statements start at the beginning of the line
|
|
310
|
+
if (/^\s*(import|export)\s/.test(line))
|
|
311
|
+
return { real: true, state };
|
|
312
|
+
// Dynamic require: `const x = require('pkg')`
|
|
313
|
+
if (/\brequire\s*\(/.test(line)) {
|
|
314
|
+
const reqIdx = line.indexOf('require');
|
|
315
|
+
const beforeReq = line.slice(0, reqIdx);
|
|
316
|
+
if (beforeReq.includes('`') || beforeReq.includes("'require") || beforeReq.includes('"require')) {
|
|
317
|
+
return { real: false, state };
|
|
318
|
+
}
|
|
319
|
+
return { real: true, state };
|
|
320
|
+
}
|
|
321
|
+
return { real: false, state };
|
|
322
|
+
}
|
|
323
|
+
/** Count unescaped backticks in a line */
|
|
324
|
+
function countUnescapedBackticks(line) {
|
|
325
|
+
let count = 0;
|
|
326
|
+
for (let i = 0; i < line.length; i++) {
|
|
327
|
+
if (line[i] === '`' && (i === 0 || line[i - 1] !== '\\')) {
|
|
328
|
+
count++;
|
|
329
|
+
}
|
|
330
|
+
}
|
|
331
|
+
return count;
|
|
332
|
+
}
|
|
259
333
|
async function validateCrossDeps(config) {
|
|
260
334
|
const targetPath = config.positionalArgs[0]; // Optional: specific file or directory
|
|
261
335
|
const files = await discoverSourceFiles(config.cwd);
|
|
@@ -283,8 +357,14 @@ async function validateCrossDeps(config) {
|
|
|
283
357
|
if (!owningPkg)
|
|
284
358
|
continue;
|
|
285
359
|
const lines = content.split('\n');
|
|
360
|
+
let parseState = { inBlockComment: false, inTemplateLiteral: false };
|
|
286
361
|
for (let i = 0; i < lines.length; i++) {
|
|
287
362
|
const line = lines[i];
|
|
363
|
+
// Skip comments, string literals, and template content
|
|
364
|
+
const classification = isRealImportLine(line, parseState);
|
|
365
|
+
parseState = classification.state;
|
|
366
|
+
if (!classification.real)
|
|
367
|
+
continue;
|
|
288
368
|
// Match import/require of workspace packages
|
|
289
369
|
const importMatch = line.match(/(?:from\s+['"]|require\s*\(\s*['"]|import\s+['"])(@[^'"\/]+\/[^'"\/]+|[^.'"\/@][^'"\/]*)/);
|
|
290
370
|
if (!importMatch)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@renseiai/agentfactory-cli",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.19",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "CLI tools for AgentFactory — local orchestrator, remote worker, queue admin",
|
|
6
6
|
"author": "Rensei AI (https://rensei.ai)",
|
|
@@ -126,12 +126,12 @@
|
|
|
126
126
|
],
|
|
127
127
|
"dependencies": {
|
|
128
128
|
"dotenv": "^17.2.3",
|
|
129
|
-
"@renseiai/plugin-linear": "0.8.
|
|
130
|
-
"@renseiai/agentfactory-server": "0.8.
|
|
131
|
-
"@renseiai/agentfactory": "0.8.
|
|
129
|
+
"@renseiai/plugin-linear": "0.8.19",
|
|
130
|
+
"@renseiai/agentfactory-server": "0.8.19",
|
|
131
|
+
"@renseiai/agentfactory": "0.8.19"
|
|
132
132
|
},
|
|
133
133
|
"optionalDependencies": {
|
|
134
|
-
"@renseiai/agentfactory-code-intelligence": "0.8.
|
|
134
|
+
"@renseiai/agentfactory-code-intelligence": "0.8.19"
|
|
135
135
|
},
|
|
136
136
|
"devDependencies": {
|
|
137
137
|
"@types/node": "^22.5.4",
|