@nexrall/code-core 1.4.48 → 1.4.50
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/agentTypes.d.ts +39 -2
- package/dist/agent/agentTypes.d.ts.map +1 -1
- package/dist/agent/agentTypes.js +27 -5
- package/dist/agent/loop.d.ts +16 -1
- package/dist/agent/loop.d.ts.map +1 -1
- package/dist/agent/loop.js +57 -61
- package/dist/agent/skills.d.ts +21 -6
- package/dist/agent/skills.d.ts.map +1 -1
- package/dist/agent/skills.js +32 -6
- package/dist/commands/loader.d.ts.map +1 -1
- package/dist/commands/loader.js +2 -1
- package/dist/types.d.ts +13 -0
- package/dist/types.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -7,7 +7,14 @@ export interface AgentType {
|
|
|
7
7
|
model?: string;
|
|
8
8
|
/** System instructions (the markdown body below the frontmatter). */
|
|
9
9
|
prompt: string;
|
|
10
|
-
|
|
10
|
+
/**
|
|
11
|
+
* 'programmatic' = registered in code via an embedding application (see the
|
|
12
|
+
* `extra` parameter of loadAgentTypesWithWarnings below), as opposed to
|
|
13
|
+
* discovered from a `.nexrall/agents/*.md` file. Added for `@nexrall/agent`'s
|
|
14
|
+
* `registerAgentType()`, which lets a host application define a sub-agent as
|
|
15
|
+
* a plain object instead of requiring a Markdown file on disk.
|
|
16
|
+
*/
|
|
17
|
+
source: 'project' | 'global' | 'builtin' | 'plugin' | 'programmatic';
|
|
11
18
|
/**
|
|
12
19
|
* When true, this agent's write tools may only target TEST files.
|
|
13
20
|
*
|
|
@@ -52,6 +59,10 @@ export interface AgentType {
|
|
|
52
59
|
}
|
|
53
60
|
/** Where a sub-agent's own persistent notes live. */
|
|
54
61
|
export type AgentMemoryScope = 'project' | 'user' | 'local';
|
|
62
|
+
export declare const VALID_MODELS: readonly ["claude-sonnet-5", "claude-opus-5", "claude-fable-5", "gpt-5.4", "gpt-5.4-mini", "gpt-4.1", "turbo", "pro", "ultra", "fast"];
|
|
63
|
+
/** The four tier aliases specifically (a subset of VALID_MODELS) — the only values `AgentType.model`/`Skill.model` narrow to when recognised; a real model id passes through as a plain string instead. */
|
|
64
|
+
export declare const MODEL_TIER_ALIASES: readonly ["turbo", "pro", "ultra", "fast"];
|
|
65
|
+
export type ModelTier = (typeof MODEL_TIER_ALIASES)[number];
|
|
55
66
|
/**
|
|
56
67
|
* A problem found while loading an agent definition.
|
|
57
68
|
*
|
|
@@ -66,6 +77,23 @@ export interface AgentWarning {
|
|
|
66
77
|
agent: string;
|
|
67
78
|
message: string;
|
|
68
79
|
}
|
|
80
|
+
/**
|
|
81
|
+
* Parse the `model:` frontmatter of an agent definition.
|
|
82
|
+
*
|
|
83
|
+
* Accepts a tier alias (turbo/pro/ultra) OR a real model id now that the picker
|
|
84
|
+
* exposes those. Validation is deliberately NOT an allowlist of ids: this file
|
|
85
|
+
* ships in a client that users do not update in lockstep with the backend, so
|
|
86
|
+
* an allowlist here would reject a model that is perfectly valid server-side
|
|
87
|
+
* and make new models unusable until everyone upgrades. The backend already
|
|
88
|
+
* refuses anything it does not recognise (resolveExplicitModel), which is the
|
|
89
|
+
* correct place for that decision — it is the side that knows.
|
|
90
|
+
*
|
|
91
|
+
* Only aliases are lowercased. Real model ids are case- and punctuation-
|
|
92
|
+
* sensitive ('gpt-5.4', 'claude-haiku-4-5-20251001'), so lowercasing them
|
|
93
|
+
* blindly — as this function used to do to everything — would corrupt ids that
|
|
94
|
+
* happen to contain uppercase.
|
|
95
|
+
*/
|
|
96
|
+
export declare function parseModel(v: string | undefined): string | undefined;
|
|
69
97
|
/**
|
|
70
98
|
* Discover all agent types. Precedence: project > global > plugin > builtin.
|
|
71
99
|
*
|
|
@@ -84,8 +112,17 @@ export declare function loadAgentTypes(workDir: string): AgentType[];
|
|
|
84
112
|
* flawed definition still loads (fail-closed on PERMISSIONS, not on existence),
|
|
85
113
|
* because making a user's agent vanish over a typo is its own kind of silent
|
|
86
114
|
* failure.
|
|
115
|
+
*
|
|
116
|
+
* `extra` — agent types supplied directly by the embedding application (e.g.
|
|
117
|
+
* `@nexrall/agent`'s `registerAgentType()`), rather than discovered from a
|
|
118
|
+
* `.nexrall/agents/*.md` file. Precedence: an `extra` entry wins over a
|
|
119
|
+
* same-name file-based definition at ANY tier (project/global/plugin/builtin),
|
|
120
|
+
* matching the existing rule that a more specific source overrides a more
|
|
121
|
+
* general one — code the host application wrote is more specific than a file
|
|
122
|
+
* a project happens to contain. Defaults to `[]`, so every existing caller
|
|
123
|
+
* (the CLI, the VS Code extension, the desktop app) is unaffected.
|
|
87
124
|
*/
|
|
88
|
-
export declare function loadAgentTypesWithWarnings(workDir: string): {
|
|
125
|
+
export declare function loadAgentTypesWithWarnings(workDir: string, extra?: AgentType[]): {
|
|
89
126
|
types: AgentType[];
|
|
90
127
|
warnings: AgentWarning[];
|
|
91
128
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agentTypes.d.ts","sourceRoot":"","sources":["../../src/agent/agentTypes.ts"],"names":[],"mappings":"AAmCA,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,6EAA6E;IAC7E,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IACjB,iDAAiD;IACjD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,qEAAqE;IACrE,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,SAAS,GAAG,QAAQ,GAAG,SAAS,GAAG,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"agentTypes.d.ts","sourceRoot":"","sources":["../../src/agent/agentTypes.ts"],"names":[],"mappings":"AAmCA,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,6EAA6E;IAC7E,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IACjB,iDAAiD;IACjD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,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,wBAAgB,aAAa,IAAI,SAAS,EAAE,CAE3C;AACD;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,SAAS,EAAE,GAAG,MAAM,CAY1D;AASD,wBAAgB,aAAa,CAAC,KAAK,EAAE,SAAS,EAAE,EAAE,IAAI,EAAE,MAAM,GAAG,SAAS,GAAG,SAAS,GAAG,SAAS,CAIjG"}
|
package/dist/agent/agentTypes.js
CHANGED
|
@@ -33,6 +33,8 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
33
33
|
};
|
|
34
34
|
})();
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.MODEL_TIER_ALIASES = exports.VALID_MODELS = void 0;
|
|
37
|
+
exports.parseModel = parseModel;
|
|
36
38
|
exports.loadAgentTypes = loadAgentTypes;
|
|
37
39
|
exports.loadAgentTypesWithWarnings = loadAgentTypesWithWarnings;
|
|
38
40
|
exports.knownToolNames = knownToolNames;
|
|
@@ -390,12 +392,20 @@ const KNOWN_META_KEYS = new Set([
|
|
|
390
392
|
// `model: auto`, which parsed to undefined and was silently ignored, so the
|
|
391
393
|
// agent ran on the session model while its file claimed otherwise. What made
|
|
392
394
|
// that costly was the SILENCE, not the value.
|
|
393
|
-
|
|
395
|
+
//
|
|
396
|
+
// Exported so skills.ts's `model:` field parses the SAME set — it used to
|
|
397
|
+
// carry its own, shorter copy (`turbo | pro | ultra`, missing `fast`) that
|
|
398
|
+
// silently dropped `model: fast` in a SKILL.md to `undefined` with no warning
|
|
399
|
+
// at all. Two independently-maintained model lists are exactly the kind of
|
|
400
|
+
// drift the shared parseFrontmatter migration was meant to end.
|
|
401
|
+
exports.VALID_MODELS = [
|
|
394
402
|
'claude-sonnet-5', 'claude-opus-5', 'claude-fable-5',
|
|
395
403
|
'gpt-5.4', 'gpt-5.4-mini', 'gpt-4.1',
|
|
396
404
|
// Legacy tier aliases — still accepted, still resolved by the backend.
|
|
397
405
|
'turbo', 'pro', 'ultra', 'fast',
|
|
398
406
|
];
|
|
407
|
+
/** The four tier aliases specifically (a subset of VALID_MODELS) — the only values `AgentType.model`/`Skill.model` narrow to when recognised; a real model id passes through as a plain string instead. */
|
|
408
|
+
exports.MODEL_TIER_ALIASES = ['turbo', 'pro', 'ultra', 'fast'];
|
|
399
409
|
// parseFrontmatter now lives in ../util/frontmatter (shared with skills.ts and
|
|
400
410
|
// commands/loader.ts) so this file no longer carries its own copy — it used
|
|
401
411
|
// to, and the two silently drifted (the shared copy gained multi-line/nested
|
|
@@ -421,7 +431,7 @@ function parseModel(v) {
|
|
|
421
431
|
if (!raw)
|
|
422
432
|
return undefined;
|
|
423
433
|
const lower = raw.toLowerCase();
|
|
424
|
-
if (lower
|
|
434
|
+
if (exports.MODEL_TIER_ALIASES.includes(lower))
|
|
425
435
|
return lower;
|
|
426
436
|
return raw;
|
|
427
437
|
}
|
|
@@ -523,11 +533,11 @@ function loadDir(dir, source, into, warnings) {
|
|
|
523
533
|
const declaredModel = meta.model === undefined ? undefined : parseModel(meta.model);
|
|
524
534
|
if (meta.model !== undefined
|
|
525
535
|
&& (declaredModel === undefined
|
|
526
|
-
|| !VALID_MODELS.includes(declaredModel))) {
|
|
536
|
+
|| !exports.VALID_MODELS.includes(declaredModel))) {
|
|
527
537
|
warnings.push({
|
|
528
538
|
file: full,
|
|
529
539
|
agent: name,
|
|
530
|
-
message: `has model: "${meta.model}", which this version does not recognise — expected one of ${VALID_MODELS.join(', ')}, or omit the line to inherit the current session's model. It will still be sent; the server decides whether it is valid.`,
|
|
540
|
+
message: `has model: "${meta.model}", which this version does not recognise — expected one of ${exports.VALID_MODELS.join(', ')}, or omit the line to inherit the current session's model. It will still be sent; the server decides whether it is valid.`,
|
|
531
541
|
});
|
|
532
542
|
}
|
|
533
543
|
// The highest-value warning of the lot. An allowlist only ever GRANTS, so a
|
|
@@ -615,8 +625,17 @@ function loadAgentTypes(workDir) {
|
|
|
615
625
|
* flawed definition still loads (fail-closed on PERMISSIONS, not on existence),
|
|
616
626
|
* because making a user's agent vanish over a typo is its own kind of silent
|
|
617
627
|
* failure.
|
|
628
|
+
*
|
|
629
|
+
* `extra` — agent types supplied directly by the embedding application (e.g.
|
|
630
|
+
* `@nexrall/agent`'s `registerAgentType()`), rather than discovered from a
|
|
631
|
+
* `.nexrall/agents/*.md` file. Precedence: an `extra` entry wins over a
|
|
632
|
+
* same-name file-based definition at ANY tier (project/global/plugin/builtin),
|
|
633
|
+
* matching the existing rule that a more specific source overrides a more
|
|
634
|
+
* general one — code the host application wrote is more specific than a file
|
|
635
|
+
* a project happens to contain. Defaults to `[]`, so every existing caller
|
|
636
|
+
* (the CLI, the VS Code extension, the desktop app) is unaffected.
|
|
618
637
|
*/
|
|
619
|
-
function loadAgentTypesWithWarnings(workDir) {
|
|
638
|
+
function loadAgentTypesWithWarnings(workDir, extra = []) {
|
|
620
639
|
const out = new Map();
|
|
621
640
|
const warnings = [];
|
|
622
641
|
loadDir(path.join(workDir, '.nexrall', 'agents'), 'project', out, warnings);
|
|
@@ -627,6 +646,9 @@ function loadAgentTypesWithWarnings(workDir) {
|
|
|
627
646
|
if (!out.has(agent.name))
|
|
628
647
|
out.set(agent.name, agent);
|
|
629
648
|
}
|
|
649
|
+
// Programmatic entries win on name collision — see doc comment above.
|
|
650
|
+
for (const agent of extra)
|
|
651
|
+
out.set(agent.name, agent);
|
|
630
652
|
// Builtins first in their declared order (the common, cache-friendly case), then
|
|
631
653
|
// everything user-supplied alphabetically.
|
|
632
654
|
const builtinOrder = new Map(BUILTIN_AGENTS.map((a, i) => [a.name, i]));
|
package/dist/agent/loop.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Message, ToolResult, AgentLoopOptions, EnvContext } from '../types';
|
|
2
|
-
import { type AgentMemoryScope } from './agentTypes';
|
|
2
|
+
import { type AgentType, type AgentMemoryScope } from './agentTypes';
|
|
3
3
|
import { bashNeedsRepoLock } from '../permissions/bashClassify';
|
|
4
4
|
export { bashNeedsRepoLock };
|
|
5
5
|
/**
|
|
@@ -419,6 +419,21 @@ export declare function compactMessagesForResume(messages: Message[], opts: {
|
|
|
419
419
|
env?: EnvContext;
|
|
420
420
|
onNotice?: (text: string) => void;
|
|
421
421
|
}): Promise<boolean>;
|
|
422
|
+
/**
|
|
423
|
+
* Dispatch one `task` (sub-agent) call — the exact same path the `task` tool's
|
|
424
|
+
* `runAgentLoop` switch-case uses (session-budget claim, per-depth concurrency
|
|
425
|
+
* limiter, in-flight accounting, `runSubTask` itself), extracted into its own
|
|
426
|
+
* function so `@nexrall/agent`'s `delegate()`/`spawn()` can drive it directly
|
|
427
|
+
* instead of re-implementing depth/budget/concurrency enforcement a second
|
|
428
|
+
* time. `runAgentLoop`'s own `task` handling calls this too — there is only
|
|
429
|
+
* ONE dispatch path, not two that could drift apart.
|
|
430
|
+
*
|
|
431
|
+
* `agentTypes` is the caller's already-loaded, permission-filtered catalogue
|
|
432
|
+
* (see `loadAgentTypesWithWarnings` + the `deny` filter in `runAgentLoop`) —
|
|
433
|
+
* passed in rather than reloaded here so this function has no opinion of its
|
|
434
|
+
* own about where agent definitions come from.
|
|
435
|
+
*/
|
|
436
|
+
export declare function dispatchSubAgent(input: Record<string, unknown>, options: AgentLoopOptions, agentTypes: AgentType[]): Promise<ToolResult>;
|
|
422
437
|
export declare function runAgentLoop(initialMessages: Message[], options: AgentLoopOptions): Promise<Message[]>;
|
|
423
438
|
/**
|
|
424
439
|
* Cut a history back to the last point the API will accept as a resumable
|
package/dist/agent/loop.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"loop.d.ts","sourceRoot":"","sources":["../../src/agent/loop.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,OAAO,EAKP,UAAU,EACV,gBAAgB,EAChB,UAAU,EACX,MAAM,UAAU,CAAC;AAIlB,OAAO,
|
|
1
|
+
{"version":3,"file":"loop.d.ts","sourceRoot":"","sources":["../../src/agent/loop.ts"],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,GAAG,OAAO,EAAE,CAqCtE"}
|
package/dist/agent/loop.js
CHANGED
|
@@ -66,6 +66,7 @@ exports.ledgerSummary = ledgerSummary;
|
|
|
66
66
|
exports.pruneOldToolResults = pruneOldToolResults;
|
|
67
67
|
exports.estimateTokensRough = estimateTokensRough;
|
|
68
68
|
exports.compactMessagesForResume = compactMessagesForResume;
|
|
69
|
+
exports.dispatchSubAgent = dispatchSubAgent;
|
|
69
70
|
exports.runAgentLoop = runAgentLoop;
|
|
70
71
|
exports.trimToResumableBoundary = trimToResumableBoundary;
|
|
71
72
|
const types_1 = require("../types");
|
|
@@ -1244,7 +1245,11 @@ started) {
|
|
|
1244
1245
|
let agent = (0, agentTypes_1.findAgentType)(agentTypes, requestedType);
|
|
1245
1246
|
let knownTypes = agentTypes;
|
|
1246
1247
|
if (requestedType && !agent) {
|
|
1247
|
-
|
|
1248
|
+
// Same `extra` list the top-of-run snapshot used (see runAgentLoop) — otherwise a
|
|
1249
|
+
// programmatically-registered agent (registerAgentType()) would resolve on the FIRST
|
|
1250
|
+
// call in a turn (present in the snapshot) but "miss" on this reload path, since it was
|
|
1251
|
+
// never written to disk for loadAgentTypes to rediscover.
|
|
1252
|
+
knownTypes = (0, agentTypes_1.loadAgentTypesWithWarnings)(options.workDir, options._extraAgentTypes ?? []).types;
|
|
1248
1253
|
agent = (0, agentTypes_1.findAgentType)(knownTypes, requestedType);
|
|
1249
1254
|
}
|
|
1250
1255
|
if (requestedType && !agent) {
|
|
@@ -2349,6 +2354,48 @@ async function compactMessagesForResume(messages, opts) {
|
|
|
2349
2354
|
}
|
|
2350
2355
|
return compacted;
|
|
2351
2356
|
}
|
|
2357
|
+
/**
|
|
2358
|
+
* Dispatch one `task` (sub-agent) call — the exact same path the `task` tool's
|
|
2359
|
+
* `runAgentLoop` switch-case uses (session-budget claim, per-depth concurrency
|
|
2360
|
+
* limiter, in-flight accounting, `runSubTask` itself), extracted into its own
|
|
2361
|
+
* function so `@nexrall/agent`'s `delegate()`/`spawn()` can drive it directly
|
|
2362
|
+
* instead of re-implementing depth/budget/concurrency enforcement a second
|
|
2363
|
+
* time. `runAgentLoop`'s own `task` handling calls this too — there is only
|
|
2364
|
+
* ONE dispatch path, not two that could drift apart.
|
|
2365
|
+
*
|
|
2366
|
+
* `agentTypes` is the caller's already-loaded, permission-filtered catalogue
|
|
2367
|
+
* (see `loadAgentTypesWithWarnings` + the `deny` filter in `runAgentLoop`) —
|
|
2368
|
+
* passed in rather than reloaded here so this function has no opinion of its
|
|
2369
|
+
* own about where agent definitions come from.
|
|
2370
|
+
*/
|
|
2371
|
+
async function dispatchSubAgent(input, options, agentTypes) {
|
|
2372
|
+
const depth = options._depth ?? 0;
|
|
2373
|
+
const overBudget = claimSessionSubAgentSlot(options.workDir, options.onNotice ?? options.onText);
|
|
2374
|
+
if (overBudget)
|
|
2375
|
+
return { error: overBudget };
|
|
2376
|
+
const childDepth = depth + 1;
|
|
2377
|
+
const { run: limitRun, max: limitMax } = subTaskLimiter(childDepth, options.workDir);
|
|
2378
|
+
const inFlight = _inFlightByDepth.get(childDepth) ?? 0;
|
|
2379
|
+
if (inFlight >= limitMax) {
|
|
2380
|
+
(options.onNotice ?? options.onText)(`\u23f3 Queued: ${limitMax} sub-agent(s) already running at this level, so this one ` +
|
|
2381
|
+
`starts when a slot frees up (raise "maxConcurrentSubtasks" in .nexrall/settings.json ` +
|
|
2382
|
+
'to widen it).');
|
|
2383
|
+
}
|
|
2384
|
+
_inFlightByDepth.set(childDepth, inFlight + 1);
|
|
2385
|
+
const started = { value: false };
|
|
2386
|
+
try {
|
|
2387
|
+
return await limitRun(() => runSubTask(input, options, agentTypes, started));
|
|
2388
|
+
}
|
|
2389
|
+
finally {
|
|
2390
|
+
if (!started.value)
|
|
2391
|
+
refundSessionSubAgentSlot();
|
|
2392
|
+
const n = (_inFlightByDepth.get(childDepth) ?? 1) - 1;
|
|
2393
|
+
if (n > 0)
|
|
2394
|
+
_inFlightByDepth.set(childDepth, n);
|
|
2395
|
+
else
|
|
2396
|
+
_inFlightByDepth.delete(childDepth);
|
|
2397
|
+
}
|
|
2398
|
+
}
|
|
2352
2399
|
// ─── Agent Loop ───────────────────────────────────────────────────────────────
|
|
2353
2400
|
async function runAgentLoop(initialMessages, options) {
|
|
2354
2401
|
const messages = [...initialMessages];
|
|
@@ -2368,7 +2415,7 @@ async function runAgentLoop(initialMessages, options) {
|
|
|
2368
2415
|
// spend a tool call discovering the refusal, and "available types: …" on the
|
|
2369
2416
|
// error path would name it again. Enforcement still happens at dispatch
|
|
2370
2417
|
// (runSubTask) — this is the cosmetic half; that is the load-bearing half.
|
|
2371
|
-
const agentTypes = (0, agentTypes_1.
|
|
2418
|
+
const agentTypes = (0, agentTypes_1.loadAgentTypesWithWarnings)(options.workDir, options._extraAgentTypes ?? []).types.filter((t) => (0, rules_1.evaluatePermission)(settings.permissions, 'task', { subagent_type: t.name }, options.workDir) !== 'deny');
|
|
2372
2419
|
// Can THIS run delegate at all? Previously only the catalogue was gated (`depth === 0`)
|
|
2373
2420
|
// while the tool schema and its instructions went to every run — see canSpawnSubAgents.
|
|
2374
2421
|
//
|
|
@@ -2382,7 +2429,7 @@ async function runAgentLoop(initialMessages, options) {
|
|
|
2382
2429
|
// just a reusable prompt template (via use_skill), not another spawn point, so
|
|
2383
2430
|
// sub-agents benefit from the same playbooks without the recursion concerns that
|
|
2384
2431
|
// gate agentsCatalogue to the top level.
|
|
2385
|
-
const skillsCatalogue = (0, skills_1.summariseSkills)((0, skills_1.
|
|
2432
|
+
const skillsCatalogue = (0, skills_1.summariseSkills)((0, skills_1.loadSkillsWithWarnings)(options.workDir, options._extraSkills ?? []).skills);
|
|
2386
2433
|
// Plan mode instructions ride the project-instructions channel, which is
|
|
2387
2434
|
// authoritative in the system prompt. Prepended rather than appended: the
|
|
2388
2435
|
// lock has to be read before the project conventions it overrides.
|
|
@@ -3052,64 +3099,13 @@ async function runAgentLoop(initialMessages, options) {
|
|
|
3052
3099
|
// Gated so a burst of `task` blocks in one message becomes a QUEUE
|
|
3053
3100
|
// rather than N concurrent agent loops (see MAX_CONCURRENT_SUBTASKS).
|
|
3054
3101
|
//
|
|
3055
|
-
//
|
|
3056
|
-
//
|
|
3057
|
-
//
|
|
3058
|
-
//
|
|
3059
|
-
//
|
|
3060
|
-
//
|
|
3061
|
-
|
|
3062
|
-
// EVERY level is gated, each against its own depth's limiter.
|
|
3063
|
-
//
|
|
3064
|
-
// This used to be `depth === 0` only, because one shared limiter deadlocks if a
|
|
3065
|
-
// slot-holder re-enters it — and with sub-agents as leaves, skipping the nested
|
|
3066
|
-
// case was free. Now that nesting is real, skipping it would leave fan-out below
|
|
3067
|
-
// level 1 completely unbounded. Per-depth limiters give bounded concurrency at
|
|
3068
|
-
// every level while keeping the wait-for graph a DAG (a depth-D holder only ever
|
|
3069
|
-
// waits on depth-D+1), so there is no cycle to deadlock on. See _subTaskLimiters.
|
|
3070
|
-
// Session budget FIRST, outside the limiter. runSubTask runs inside limitRun, so
|
|
3071
|
-
// claiming in there meant a spawn that was already over budget queued behind up to
|
|
3072
|
-
// `max` running siblings before hearing no — in a runaway, i.e. the exact case this
|
|
3073
|
-
// guard exists for, refusals trickled out at sibling-completion rate.
|
|
3074
|
-
const overBudget = claimSessionSubAgentSlot(options.workDir, options.onNotice ?? options.onText);
|
|
3075
|
-
if (overBudget) {
|
|
3076
|
-
result = { error: overBudget };
|
|
3077
|
-
}
|
|
3078
|
-
else {
|
|
3079
|
-
const childDepth = depth + 1;
|
|
3080
|
-
const { run: limitRun, max: limitMax } = subTaskLimiter(childDepth, options.workDir);
|
|
3081
|
-
// Tell the user when a sub-task is WAITING rather than working.
|
|
3082
|
-
//
|
|
3083
|
-
// With a burst of 8 and a ceiling of 4, the last four sat silently in the
|
|
3084
|
-
// queue. From the outside they looked started, so a long wait read as a
|
|
3085
|
-
// hang — and the fix for a hang (Ctrl+C and retry) is exactly wrong here,
|
|
3086
|
-
// since the work was about to run. Counted per depth, so a level-2 queue is
|
|
3087
|
-
// not reported using a level-1 count.
|
|
3088
|
-
const inFlight = _inFlightByDepth.get(childDepth) ?? 0;
|
|
3089
|
-
if (inFlight >= limitMax) {
|
|
3090
|
-
(options.onNotice ?? options.onText)(`\u23f3 Queued: ${limitMax} sub-agent(s) already running at this level, so this one ` +
|
|
3091
|
-
`starts when a slot frees up (raise "maxConcurrentSubtasks" in .nexrall/settings.json ` +
|
|
3092
|
-
'to widen it).');
|
|
3093
|
-
}
|
|
3094
|
-
_inFlightByDepth.set(childDepth, inFlight + 1);
|
|
3095
|
-
// runSubTask flips this at its point of no return, so a spawn rejected by its own
|
|
3096
|
-
// validation (empty prompt, a deny rule, an unusable resume id) gives the slot
|
|
3097
|
-
// back. Without it, a model retrying against a deny rule would burn the entire
|
|
3098
|
-
// allowance on spawns that never ran and then lose delegation for the session.
|
|
3099
|
-
const started = { value: false };
|
|
3100
|
-
try {
|
|
3101
|
-
result = await limitRun(() => runSubTask(input, options, agentTypes, started));
|
|
3102
|
-
}
|
|
3103
|
-
finally {
|
|
3104
|
-
if (!started.value)
|
|
3105
|
-
refundSessionSubAgentSlot();
|
|
3106
|
-
const n = (_inFlightByDepth.get(childDepth) ?? 1) - 1;
|
|
3107
|
-
if (n > 0)
|
|
3108
|
-
_inFlightByDepth.set(childDepth, n);
|
|
3109
|
-
else
|
|
3110
|
-
_inFlightByDepth.delete(childDepth); // don't retain a key per depth forever
|
|
3111
|
-
}
|
|
3112
|
-
}
|
|
3102
|
+
// EVERY level is gated, each against its own depth's limiter — see
|
|
3103
|
+
// dispatchSubAgent's own doc comment for why the gate wraps the call
|
|
3104
|
+
// rather than the inside of runSubTask, and why every depth (not just
|
|
3105
|
+
// depth 0) needs its own limiter. Extracted into dispatchSubAgent so
|
|
3106
|
+
// `@nexrall/agent`'s delegate()/spawn() drive the SAME path instead of
|
|
3107
|
+
// reimplementing depth/budget/concurrency enforcement a second time.
|
|
3108
|
+
result = await dispatchSubAgent(input, options, agentTypes);
|
|
3113
3109
|
}
|
|
3114
3110
|
else {
|
|
3115
3111
|
const pre = runToolHooks(hooks.PreToolUse, 'PreToolUse', name, input, options.workDir);
|
package/dist/agent/skills.d.ts
CHANGED
|
@@ -11,7 +11,15 @@ export interface Skill {
|
|
|
11
11
|
model?: string;
|
|
12
12
|
mode?: string;
|
|
13
13
|
body: string;
|
|
14
|
-
|
|
14
|
+
/**
|
|
15
|
+
* 'programmatic' = registered in code via an embedding application (see the
|
|
16
|
+
* `extra` parameter of loadSkillsWithWarnings below), as opposed to
|
|
17
|
+
* discovered from a `.nexrall/skills/<name>/SKILL.md` (or legacy flat
|
|
18
|
+
* command) file. Added for `@nexrall/agent`'s `registerSkills()`, which lets
|
|
19
|
+
* a library author bundle a skill inside an npm package instead of asking
|
|
20
|
+
* consumers to copy a Markdown file into their project.
|
|
21
|
+
*/
|
|
22
|
+
source: 'project' | 'global' | 'builtin' | 'plugin' | 'programmatic';
|
|
15
23
|
/** Absolute path to the skill's own directory, for resolving supporting files. Undefined for flat command-style skills (no directory). */
|
|
16
24
|
dir?: string;
|
|
17
25
|
/** true → only `/name` invokes it; the model must not auto-trigger it (side-effecting workflows like /deploy). */
|
|
@@ -30,17 +38,24 @@ export interface Skill {
|
|
|
30
38
|
/**
|
|
31
39
|
* Discover all skills, with diagnostics.
|
|
32
40
|
*
|
|
33
|
-
* Precedence, most to least authoritative:
|
|
34
|
-
* project `.nexrall/commands` > project `.agents/skills`
|
|
35
|
-
* global `.nexrall/commands` > global `.nexrall/skills` >
|
|
36
|
-
* `.agents/skills` (cross-client) > plugin > builtin.
|
|
41
|
+
* Precedence, most to least authoritative: `extra` (programmatic) > project
|
|
42
|
+
* `.nexrall/skills` > project `.nexrall/commands` > project `.agents/skills`
|
|
43
|
+
* (cross-client) > global `.nexrall/commands` > global `.nexrall/skills` >
|
|
44
|
+
* global `.agents/skills` (cross-client) > plugin > builtin.
|
|
37
45
|
*
|
|
38
46
|
* The `.agents/skills` scans are always the weakest source within their tier
|
|
39
47
|
* — see the module comment above for why. Directory-style
|
|
40
48
|
* `.nexrall/skills/<name>/SKILL.md` beats a flat `.nexrall/commands/<name>.md`
|
|
41
49
|
* of the same name within the same precedence tier.
|
|
50
|
+
*
|
|
51
|
+
* `extra` — skills supplied directly by the embedding application (e.g.
|
|
52
|
+
* `@nexrall/agent`'s `registerSkills()`), rather than discovered from a
|
|
53
|
+
* `SKILL.md`/command file. Wins on name collision at any tier, for the same
|
|
54
|
+
* reason `loadAgentTypesWithWarnings`'s `extra` does: code the host
|
|
55
|
+
* application registered is more specific than a file a project happens to
|
|
56
|
+
* contain. Defaults to `[]`, so every existing caller is unaffected.
|
|
42
57
|
*/
|
|
43
|
-
export declare function loadSkillsWithWarnings(workDir: string): {
|
|
58
|
+
export declare function loadSkillsWithWarnings(workDir: string, extra?: Skill[]): {
|
|
44
59
|
skills: Skill[];
|
|
45
60
|
warnings: SkillWarning[];
|
|
46
61
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"skills.d.ts","sourceRoot":"","sources":["../../src/agent/skills.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"skills.d.ts","sourceRoot":"","sources":["../../src/agent/skills.ts"],"names":[],"mappings":"AA0EA,MAAM,WAAW,YAAY;IAC3B,6EAA6E;IAC7E,IAAI,EAAE,MAAM,CAAC;IACb,gDAAgD;IAChD,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,KAAK;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb;;;;;;;OAOG;IACH,MAAM,EAAE,SAAS,GAAG,QAAQ,GAAG,SAAS,GAAG,QAAQ,GAAG,cAAc,CAAC;IACrE,0IAA0I;IAC1I,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,kHAAkH;IAClH,sBAAsB,EAAE,OAAO,CAAC;IAChC,iGAAiG;IACjG,aAAa,EAAE,OAAO,CAAC;IACvB,2GAA2G;IAC3G,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,8GAA8G;IAC9G,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,kHAAkH;IAClH,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAClC,0JAA0J;IAC1J,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;CACzB;AA6MD;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,GAAE,KAAK,EAAO,GAAG;IAAE,MAAM,EAAE,KAAK,EAAE,CAAC;IAAC,QAAQ,EAAE,YAAY,EAAE,CAAA;CAAE,CAwB1H;AAED,kKAAkK;AAClK,wBAAgB,UAAU,CAAC,OAAO,EAAE,MAAM,GAAG,KAAK,EAAE,CAEnD;AAED,wBAAgB,SAAS,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,MAAM,GAAG,KAAK,GAAG,SAAS,CAG1E;AAED,6GAA6G;AAC7G,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,KAAK,EAAE,GAAG,KAAK,EAAE,CAE5D;AAED,iFAAiF;AACjF,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,KAAK,EAAE,GAAG,KAAK,EAAE,CAE5D;AAED,oHAAoH;AACpH,wBAAgB,eAAe,CAAC,MAAM,EAAE,KAAK,EAAE,GAAG,MAAM,CAIvD;AAED;;;;;;;GAOG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,CAcpF"}
|
package/dist/agent/skills.js
CHANGED
|
@@ -46,6 +46,7 @@ const os = __importStar(require("os"));
|
|
|
46
46
|
const index_1 = require("../plugins/index");
|
|
47
47
|
const loader_1 = require("../commands/loader");
|
|
48
48
|
const frontmatter_1 = require("../util/frontmatter");
|
|
49
|
+
const agentTypes_1 = require("./agentTypes");
|
|
49
50
|
/** Frontmatter keys this parser understands, for typo/unrecognised-key detection (see SkillWarning). */
|
|
50
51
|
const KNOWN_META_KEYS = new Set([
|
|
51
52
|
'name', 'description', 'model', 'mode',
|
|
@@ -76,7 +77,7 @@ function parseSpaceList(v) {
|
|
|
76
77
|
return items.length ? items : undefined;
|
|
77
78
|
}
|
|
78
79
|
function toSkill(meta, body, name, source, dir, nested) {
|
|
79
|
-
const model =
|
|
80
|
+
const model = (0, agentTypes_1.parseModel)(meta.model);
|
|
80
81
|
return {
|
|
81
82
|
name,
|
|
82
83
|
description: meta.description || `Custom /${name} skill`,
|
|
@@ -126,6 +127,21 @@ function validateSkillMeta(meta, rawName, effectiveName, dirName, file, warnings
|
|
|
126
127
|
if (strayKeys.length) {
|
|
127
128
|
warnings.push({ file, name: effectiveName, message: `has unrecognised frontmatter key(s): ${strayKeys.join(', ')} — these are ignored.` });
|
|
128
129
|
}
|
|
130
|
+
// Same class of mistake agentTypes.ts already guards against for sub-agents:
|
|
131
|
+
// pass the value through regardless (parseModel never rejects), but say
|
|
132
|
+
// something when this build doesn't recognise it, so a typo doesn't look
|
|
133
|
+
// identical to "inherit the session's model". Before this, `model: fast`
|
|
134
|
+
// (a valid tier alias) silently parsed to undefined in a skill because this
|
|
135
|
+
// file carried its own, shorter, independently-drifted copy of the model list.
|
|
136
|
+
const declaredModel = meta.model === undefined ? undefined : (0, agentTypes_1.parseModel)(meta.model);
|
|
137
|
+
if (meta.model !== undefined
|
|
138
|
+
&& (declaredModel === undefined
|
|
139
|
+
|| !agentTypes_1.VALID_MODELS.includes(declaredModel))) {
|
|
140
|
+
warnings.push({
|
|
141
|
+
file, name: effectiveName,
|
|
142
|
+
message: `has model: "${meta.model}", which this version does not recognise — expected one of ${agentTypes_1.VALID_MODELS.join(', ')}, or omit the line to inherit the current session's model. It will still be sent; the server decides whether it is valid.`,
|
|
143
|
+
});
|
|
144
|
+
}
|
|
129
145
|
}
|
|
130
146
|
// Legacy flat-file skills: .nexrall/commands/<name>.md (and plugin commands/).
|
|
131
147
|
// Kept as its own loader (rather than merged into loadSkillDir below) since the
|
|
@@ -243,17 +259,24 @@ const BUILTIN_SKILLS = [
|
|
|
243
259
|
/**
|
|
244
260
|
* Discover all skills, with diagnostics.
|
|
245
261
|
*
|
|
246
|
-
* Precedence, most to least authoritative:
|
|
247
|
-
* project `.nexrall/commands` > project `.agents/skills`
|
|
248
|
-
* global `.nexrall/commands` > global `.nexrall/skills` >
|
|
249
|
-
* `.agents/skills` (cross-client) > plugin > builtin.
|
|
262
|
+
* Precedence, most to least authoritative: `extra` (programmatic) > project
|
|
263
|
+
* `.nexrall/skills` > project `.nexrall/commands` > project `.agents/skills`
|
|
264
|
+
* (cross-client) > global `.nexrall/commands` > global `.nexrall/skills` >
|
|
265
|
+
* global `.agents/skills` (cross-client) > plugin > builtin.
|
|
250
266
|
*
|
|
251
267
|
* The `.agents/skills` scans are always the weakest source within their tier
|
|
252
268
|
* — see the module comment above for why. Directory-style
|
|
253
269
|
* `.nexrall/skills/<name>/SKILL.md` beats a flat `.nexrall/commands/<name>.md`
|
|
254
270
|
* of the same name within the same precedence tier.
|
|
271
|
+
*
|
|
272
|
+
* `extra` — skills supplied directly by the embedding application (e.g.
|
|
273
|
+
* `@nexrall/agent`'s `registerSkills()`), rather than discovered from a
|
|
274
|
+
* `SKILL.md`/command file. Wins on name collision at any tier, for the same
|
|
275
|
+
* reason `loadAgentTypesWithWarnings`'s `extra` does: code the host
|
|
276
|
+
* application registered is more specific than a file a project happens to
|
|
277
|
+
* contain. Defaults to `[]`, so every existing caller is unaffected.
|
|
255
278
|
*/
|
|
256
|
-
function loadSkillsWithWarnings(workDir) {
|
|
279
|
+
function loadSkillsWithWarnings(workDir, extra = []) {
|
|
257
280
|
const out = new Map();
|
|
258
281
|
const warnings = [];
|
|
259
282
|
// Project tier is last-write-wins (see loadSkillDir/loadFlatCommandDir's
|
|
@@ -274,6 +297,9 @@ function loadSkillsWithWarnings(workDir) {
|
|
|
274
297
|
if (!out.has(skill.name))
|
|
275
298
|
out.set(skill.name, skill);
|
|
276
299
|
}
|
|
300
|
+
// Programmatic entries win on name collision — see doc comment above.
|
|
301
|
+
for (const skill of extra)
|
|
302
|
+
out.set(skill.name, skill);
|
|
277
303
|
return { skills: [...out.values()], warnings };
|
|
278
304
|
}
|
|
279
305
|
/** Discover all skills (project overrides global overrides plugin overrides builtin). See loadSkillsWithWarnings for the full precedence rule and diagnostics. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"loader.d.ts","sourceRoot":"","sources":["../../src/commands/loader.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"loader.d.ts","sourceRoot":"","sources":["../../src/commands/loader.ts"],"names":[],"mappings":"AA+BA,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,SAAS,GAAG,QAAQ,GAAG,SAAS,GAAG,QAAQ,CAAC;CACrD;AAsED,uFAAuF;AACvF,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,MAAM,GAAG,YAAY,EAAE,CASjE;AAED,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,YAAY,EAAE,EAAE,IAAI,EAAE,MAAM,GAAG,YAAY,GAAG,SAAS,CAG7F;AAED;;;;;;GAMG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,CAuCnF;AAED,4FAA4F;AAC5F,wBAAgB,aAAa,CAAC,GAAG,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,CAE3F"}
|
package/dist/commands/loader.js
CHANGED
|
@@ -43,6 +43,7 @@ const os = __importStar(require("os"));
|
|
|
43
43
|
const child_process_1 = require("child_process");
|
|
44
44
|
const index_1 = require("../plugins/index");
|
|
45
45
|
const frontmatter_1 = require("../util/frontmatter");
|
|
46
|
+
const agentTypes_1 = require("../agent/agentTypes");
|
|
46
47
|
// ── Built-in commands ─────────────────────────────────────────────────────────
|
|
47
48
|
// Shipped with the product; lowest precedence (project > global > builtin), so
|
|
48
49
|
// a user can override any of them by creating a file with the same name.
|
|
@@ -97,7 +98,7 @@ function loadDir(dir, source, into) {
|
|
|
97
98
|
continue;
|
|
98
99
|
if (source !== 'project' && into.has(name))
|
|
99
100
|
continue; // earlier tiers win
|
|
100
|
-
const model =
|
|
101
|
+
const model = (0, agentTypes_1.parseModel)(meta.model);
|
|
101
102
|
into.set(name, {
|
|
102
103
|
name,
|
|
103
104
|
description: meta.description || `Custom /${name} command`,
|
package/dist/types.d.ts
CHANGED
|
@@ -422,6 +422,19 @@ export interface AgentLoopOptions {
|
|
|
422
422
|
* any agent without that flag would write production source on its behalf.
|
|
423
423
|
*/
|
|
424
424
|
_testFilesOnly?: boolean;
|
|
425
|
+
/**
|
|
426
|
+
* Agent types registered programmatically by the embedding application (e.g.
|
|
427
|
+
* `@nexrall/agent`'s `registerAgentType()`), merged into BOTH the catalogue
|
|
428
|
+
* snapshot the loop takes at the top of a run AND the reload-on-miss path
|
|
429
|
+
* `task` dispatch falls back to when a name isn't in that snapshot (a file
|
|
430
|
+
* just written mid-turn) — passing it to only one of the two would make a
|
|
431
|
+
* programmatic agent resolvable sometimes and "unknown" other times,
|
|
432
|
+
* depending on timing. See `agentTypes.ts`'s `loadAgentTypesWithWarnings`
|
|
433
|
+
* for the merge/precedence rule this list participates in.
|
|
434
|
+
*/
|
|
435
|
+
_extraAgentTypes?: import('./agent/agentTypes').AgentType[];
|
|
436
|
+
/** As `_extraAgentTypes`, for `@nexrall/agent`'s `registerSkills()`. */
|
|
437
|
+
_extraSkills?: import('./agent/skills').Skill[];
|
|
425
438
|
}
|
|
426
439
|
/**
|
|
427
440
|
* Thrown by `runAgentLoop` when a turn cannot continue (stream died, upstream
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,UAAU,CAAC;IACjB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAChC;AAED,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,aAAa,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAKD,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,OAAO,CAAC;IACd,MAAM,EAAE;QAAE,IAAI,EAAE,QAAQ,CAAC;QAAC,UAAU,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC;CAC9D;AAKD,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,UAAU,CAAC;IACjB,MAAM,EAAE;QAAE,IAAI,EAAE,QAAQ,CAAC;QAAC,UAAU,EAAE,iBAAiB,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC;CACzE;AAED,MAAM,MAAM,YAAY,GAAG,SAAS,GAAG,YAAY,GAAG,eAAe,GAAG,UAAU,GAAG,aAAa,CAAC;AAInG,MAAM,WAAW,OAAO;IACtB,IAAI,EAAE,MAAM,GAAG,WAAW,CAAC;IAC3B,OAAO,EAAE,YAAY,EAA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50",
|
|
4
4
|
"description": "Core agent loop, tools, and extension primitives for Nexrall Code — embed an AI coding agent in any Node.js application.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Nexrall <support@nexrall.com> (https://nexrall.com)",
|