@tryaura/aura-cli 0.1.0 → 0.1.1
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/README.md +3 -2
- package/dist/bin/aura.js +3 -3
- package/dist/index.js +1 -1
- package/dist/plugins/index.js +1 -1
- package/dist/{plugins-n3DS8XXi.js → plugins-DDfc7XT9.js} +307 -58
- package/dist/{run-pMPxJqFQ.js → run-ZDkvqvZb.js} +694 -283
- package/dist/{skill-deployment-plan-C4GTrVSy.js → shared-link-plan-BigeLxDX.js} +227 -90
- package/package.json +4 -4
|
@@ -3,6 +3,7 @@ import { dirname, isAbsolute, join, relative, resolve, sep } from "node:path";
|
|
|
3
3
|
import { Buffer, isUtf8 } from "node:buffer";
|
|
4
4
|
import { createHash } from "node:crypto";
|
|
5
5
|
import { createTwoFilesPatch } from "diff";
|
|
6
|
+
import { gt, valid } from "semver";
|
|
6
7
|
import { isDeepStrictEqual } from "node:util";
|
|
7
8
|
//#region ../core/src/pluralize.ts
|
|
8
9
|
/** Selects the noun or verb form that agrees with a numeric count. */
|
|
@@ -333,8 +334,13 @@ function targetApps(value, path, name, scope, claimed) {
|
|
|
333
334
|
//#endregion
|
|
334
335
|
//#region ../core/src/manifest/schema.ts
|
|
335
336
|
const SHA256_PATTERN = /^[0-9a-f]{64}$/u;
|
|
337
|
+
const APP_ID_PATTERN = /^[a-z0-9][a-z0-9._-]*$/u;
|
|
338
|
+
const MCP_CATALOG_ID_PATTERN = /^[a-z0-9][a-z0-9._-]*\/[a-zA-Z0-9][a-zA-Z0-9._-]*$/u;
|
|
336
339
|
const SKILL_ID_PATTERN = /^[a-z0-9]+(?:-[a-z0-9]+)*$/u;
|
|
337
340
|
const SKILL_SOURCE_PATTERN = /^(?:directory|driver|plugin):[^\s:]+$/u;
|
|
341
|
+
const OVERRIDE_KEY_PATTERN = /^[a-z][a-zA-Z0-9]{0,63}$/u;
|
|
342
|
+
/** Room for several future override kinds without leaving the forward-compat window unbounded. */
|
|
343
|
+
const MAX_OVERRIDE_KEYS = 32;
|
|
338
344
|
/**
|
|
339
345
|
* How deep the manifest may nest.
|
|
340
346
|
*
|
|
@@ -354,14 +360,49 @@ function validateAuraManifest(value) {
|
|
|
354
360
|
...source,
|
|
355
361
|
apps: apps(source["apps"]),
|
|
356
362
|
...optionalChecks(source["checks"]),
|
|
363
|
+
...optionalIdList(source["ignoredApps"], "$.ignoredApps", APP_ID_PATTERN, "ignoredApps"),
|
|
357
364
|
mcpServers: mcpServers(source["mcpServers"]),
|
|
358
365
|
ownership: ownership(source["ownership"]),
|
|
366
|
+
...optionalOverrides(source["overrides"]),
|
|
359
367
|
...optionalPreset(source["preset"]),
|
|
360
368
|
schemaVersion: 1,
|
|
361
369
|
skills: skills(source["skills"]),
|
|
362
370
|
snippets: snippets(source["snippets"])
|
|
363
371
|
});
|
|
364
372
|
}
|
|
373
|
+
/**
|
|
374
|
+
* Reads `overrides`, keeping the extension keys a newer Aura may have written.
|
|
375
|
+
*
|
|
376
|
+
* Passing unknown keys through matches how the top-level object is normalized, so a downgrade does
|
|
377
|
+
* not quietly delete a newer build's decisions. Unlike the top level, though, this object is
|
|
378
|
+
* rebuilt from scratch on every setup run, so an unbounded bag here would be rewritten verbatim
|
|
379
|
+
* forever: the key count and spelling are bounded to keep the forward-compatibility window from
|
|
380
|
+
* doubling as unbounded manifest storage.
|
|
381
|
+
*/
|
|
382
|
+
function optionalOverrides(value) {
|
|
383
|
+
if (value === void 0) return {};
|
|
384
|
+
const source = requiredObject(value, "$.overrides");
|
|
385
|
+
const keys = Object.keys(source);
|
|
386
|
+
if (keys.length > MAX_OVERRIDE_KEYS) throw invalid("$.overrides", `must contain at most ${String(MAX_OVERRIDE_KEYS)} keys`);
|
|
387
|
+
for (const key of keys) if (!OVERRIDE_KEY_PATTERN.test(key)) throw invalid(`$.overrides.${key}`, "must be a camelCase override name");
|
|
388
|
+
const required = optionalIdList(source["requiredMcpServers"], "$.overrides.requiredMcpServers", MCP_CATALOG_ID_PATTERN, "requiredMcpServers");
|
|
389
|
+
return { overrides: Object.freeze({
|
|
390
|
+
...source,
|
|
391
|
+
...required
|
|
392
|
+
}) };
|
|
393
|
+
}
|
|
394
|
+
function optionalIdList(value, path, pattern, key) {
|
|
395
|
+
if (value === void 0) return {};
|
|
396
|
+
const ids = stringArray(value, path);
|
|
397
|
+
if (ids.length > 256) throw invalid(path, "must contain at most 256 ids");
|
|
398
|
+
const seen = /* @__PURE__ */ new Set();
|
|
399
|
+
for (const [index, id] of ids.entries()) {
|
|
400
|
+
if (!pattern.test(id)) throw invalid(`${path}[${String(index)}]`, "must be a valid id");
|
|
401
|
+
if (seen.has(id)) throw invalid(`${path}[${String(index)}]`, "must not duplicate another id");
|
|
402
|
+
seen.add(id);
|
|
403
|
+
}
|
|
404
|
+
return { [key]: ids };
|
|
405
|
+
}
|
|
365
406
|
function skills(value) {
|
|
366
407
|
if (!Array.isArray(value)) throw invalid("$.skills", "must be an array");
|
|
367
408
|
const ids = /* @__PURE__ */ new Set();
|
|
@@ -1106,6 +1147,59 @@ function stripManagedMarkers(source) {
|
|
|
1106
1147
|
return kept.join("");
|
|
1107
1148
|
}
|
|
1108
1149
|
//#endregion
|
|
1150
|
+
//#region ../core/src/managed-block/reconcile-snippet.ts
|
|
1151
|
+
/** Reconciles exactly one snippet while preserving every other source byte. */
|
|
1152
|
+
function reconcileManagedSnippet(source, snippetId, resolution) {
|
|
1153
|
+
const current = readManagedBlock(source);
|
|
1154
|
+
if (current.status === "invalid") return invalidResult$1(source, current.notes, current.problems);
|
|
1155
|
+
if (current.status === "absent") return missingSnippet(source, current.notes, snippetId, "an Aura-managed block");
|
|
1156
|
+
const snippet = current.block.snippets.find((candidate) => candidate.id === snippetId);
|
|
1157
|
+
if (snippet === void 0) return missingSnippet(source, current.notes, snippetId, "the Aura-managed block");
|
|
1158
|
+
const lineEnding = markerLineEnding(source, snippet.startOffset, snippet.contentStartOffset);
|
|
1159
|
+
const canonical = resolution.kind === "restore" ? canonicalizeManagedSnippet(resolution.content) : void 0;
|
|
1160
|
+
if (canonical !== void 0) {
|
|
1161
|
+
const problems = managedSnippetContentProblems(snippet.id, canonical);
|
|
1162
|
+
if (problems.length > 0) return invalidResult$1(source, current.notes, problems);
|
|
1163
|
+
}
|
|
1164
|
+
const content = canonical === void 0 ? snippet.content : withLineEnding(canonical, lineEnding);
|
|
1165
|
+
const hash = canonical === void 0 ? snippet.computedHash : hashCanonicalManagedSnippet(canonical);
|
|
1166
|
+
const opening = `${AURA_MANAGED_SNIPPET_BEGIN_PREFIX}${snippet.id} sha256=${hash} -->${lineEnding}`;
|
|
1167
|
+
const updated = source.slice(0, snippet.startOffset) + opening + content + source.slice(snippet.contentEndOffset);
|
|
1168
|
+
return updated === source ? Object.freeze({
|
|
1169
|
+
content: source,
|
|
1170
|
+
notes: current.notes,
|
|
1171
|
+
status: "unchanged"
|
|
1172
|
+
}) : Object.freeze({
|
|
1173
|
+
content: updated,
|
|
1174
|
+
notes: current.notes,
|
|
1175
|
+
status: "updated"
|
|
1176
|
+
});
|
|
1177
|
+
}
|
|
1178
|
+
/** Creates the opt-in edited-versus-canonical detail used by the merge choice. */
|
|
1179
|
+
function diffManagedSnippet(path, editedContent, canonicalContent) {
|
|
1180
|
+
return createTwoFilesPatch(`${path} (edited)`, `${path} (canonical)`, canonicalizeManagedSnippet(editedContent), canonicalizeManagedSnippet(canonicalContent), "edited", "canonical", { context: 3 });
|
|
1181
|
+
}
|
|
1182
|
+
function missingSnippet(source, notes, snippetId, location) {
|
|
1183
|
+
return invalidResult$1(source, notes, [Object.freeze({
|
|
1184
|
+
code: "missing-snippet",
|
|
1185
|
+
message: `Snippet "${snippetId}" does not exist in ${location}.`
|
|
1186
|
+
})]);
|
|
1187
|
+
}
|
|
1188
|
+
function invalidResult$1(source, notes, problems) {
|
|
1189
|
+
return Object.freeze({
|
|
1190
|
+
content: source,
|
|
1191
|
+
notes,
|
|
1192
|
+
problems,
|
|
1193
|
+
status: "invalid"
|
|
1194
|
+
});
|
|
1195
|
+
}
|
|
1196
|
+
function markerLineEnding(source, startOffset, contentStartOffset) {
|
|
1197
|
+
return source.slice(startOffset, contentStartOffset).endsWith("\r\n") ? "\r\n" : "\n";
|
|
1198
|
+
}
|
|
1199
|
+
function withLineEnding(content, lineEnding) {
|
|
1200
|
+
return lineEnding === "\n" ? content : content.replaceAll("\n", lineEnding);
|
|
1201
|
+
}
|
|
1202
|
+
//#endregion
|
|
1109
1203
|
//#region ../core/src/managed-block/reconcile-desired.ts
|
|
1110
1204
|
function prepareDesiredSnippets(snippets, options) {
|
|
1111
1205
|
const ids = /* @__PURE__ */ new Set();
|
|
@@ -1307,6 +1401,134 @@ function settle(source, content, notes) {
|
|
|
1307
1401
|
});
|
|
1308
1402
|
}
|
|
1309
1403
|
//#endregion
|
|
1404
|
+
//#region ../core/src/managed-content/revision.ts
|
|
1405
|
+
/** Whether a source revision is a reviewable update, a divergence, or already installed. */
|
|
1406
|
+
function managedContentRevisionStatus(installedVersion, installedHash, availableVersion, availableHash) {
|
|
1407
|
+
if (installedVersion === availableVersion) return installedHash === availableHash ? "current" : "update";
|
|
1408
|
+
if (valid(installedVersion) === null || valid(availableVersion) === null) return "diverged";
|
|
1409
|
+
return gt(availableVersion, installedVersion) ? "update" : "diverged";
|
|
1410
|
+
}
|
|
1411
|
+
/** Replaces one shared skill tree using the same operation ordering in setup and guided checks. */
|
|
1412
|
+
function planSharedSkillTreeUpdate(root, existingEntries, desired) {
|
|
1413
|
+
const desiredPaths = new Set(desired.files.map((file) => resolve(root, ...file.path.split("/"))));
|
|
1414
|
+
const desiredParents = ancestorDirectories(desiredPaths);
|
|
1415
|
+
return [...[...existingEntries.filter((entry) => {
|
|
1416
|
+
const path = resolve(entry.path);
|
|
1417
|
+
return !desiredPaths.has(path) && (entry.kind !== "directory" || !desiredParents.has(path));
|
|
1418
|
+
})].sort((left, right) => right.path.length - left.path.length).map((entry) => ({
|
|
1419
|
+
path: entry.path,
|
|
1420
|
+
type: "remove"
|
|
1421
|
+
})), ...desired.files.map((file) => ({
|
|
1422
|
+
content: file.content,
|
|
1423
|
+
path: join(root, ...file.path.split("/")),
|
|
1424
|
+
type: "write"
|
|
1425
|
+
}))];
|
|
1426
|
+
}
|
|
1427
|
+
/**
|
|
1428
|
+
* Every directory that contains at least one desired path.
|
|
1429
|
+
*
|
|
1430
|
+
* Precomputed once so the stale filter stays linear: comparing each existing directory against
|
|
1431
|
+
* every desired path pairwise re-normalized both sides on every comparison.
|
|
1432
|
+
*/
|
|
1433
|
+
function ancestorDirectories(paths) {
|
|
1434
|
+
const parents = /* @__PURE__ */ new Set();
|
|
1435
|
+
for (const path of paths) {
|
|
1436
|
+
let parent = dirname(path);
|
|
1437
|
+
while (!parents.has(parent)) {
|
|
1438
|
+
parents.add(parent);
|
|
1439
|
+
const next = dirname(parent);
|
|
1440
|
+
if (next === parent) break;
|
|
1441
|
+
parent = next;
|
|
1442
|
+
}
|
|
1443
|
+
}
|
|
1444
|
+
return parents;
|
|
1445
|
+
}
|
|
1446
|
+
//#endregion
|
|
1447
|
+
//#region ../core/src/workspace/skill-deployment-plan.ts
|
|
1448
|
+
/** Plans one manifest skill's link into one adapter-declared directory. */
|
|
1449
|
+
function planSkillDeployment(app, model, skillId, directoryId, options = {}) {
|
|
1450
|
+
const directory = app.skillDirectories?.find((candidate) => candidate.id === directoryId);
|
|
1451
|
+
if (directory === void 0) return {
|
|
1452
|
+
kind: "blocked",
|
|
1453
|
+
path: skillId,
|
|
1454
|
+
reason: "The application no longer declares this skills directory."
|
|
1455
|
+
};
|
|
1456
|
+
const path = join(directory.path, skillId);
|
|
1457
|
+
const target = join(sharedSkillsRoot(model.homeDir), skillId);
|
|
1458
|
+
if (!(model.sharedSkills?.some((skill) => skill.id === skillId) === true) && options.assumeShared !== true) return {
|
|
1459
|
+
kind: "blocked",
|
|
1460
|
+
path,
|
|
1461
|
+
reason: `The shared copy at ${target} is missing. Reinstall skill "${skillId}" before deploying it.`
|
|
1462
|
+
};
|
|
1463
|
+
const status = skillDeploymentStatus(app, directory, skillId);
|
|
1464
|
+
if (status === void 0 || !status.exists) return {
|
|
1465
|
+
kind: "planned",
|
|
1466
|
+
path,
|
|
1467
|
+
plan: symlinkPlan(app, path, target)
|
|
1468
|
+
};
|
|
1469
|
+
if (status.problem !== void 0) return {
|
|
1470
|
+
kind: "blocked",
|
|
1471
|
+
path,
|
|
1472
|
+
reason: `Aura could not safely inspect ${path} (${status.problem}) and will not replace it.`
|
|
1473
|
+
};
|
|
1474
|
+
if (status.pathKind !== "symlink" || status.symlinkTarget === void 0) return {
|
|
1475
|
+
kind: "blocked",
|
|
1476
|
+
path,
|
|
1477
|
+
reason: `${path} is not an Aura-managed skill link. Move it aside before deploying skill "${skillId}" there.`
|
|
1478
|
+
};
|
|
1479
|
+
const actualTarget = absoluteTarget(path, status.symlinkTarget);
|
|
1480
|
+
if (actualTarget === resolve(target)) return {
|
|
1481
|
+
kind: "planned",
|
|
1482
|
+
path,
|
|
1483
|
+
plan: convergedPlan$1(app, skillId)
|
|
1484
|
+
};
|
|
1485
|
+
if (!isAuraOwnedSkillTarget(model.homeDir, actualTarget)) return {
|
|
1486
|
+
kind: "blocked",
|
|
1487
|
+
path,
|
|
1488
|
+
reason: `${path} is not an Aura-managed skill link because it points outside Aura's shared skills directory. It was preserved.`
|
|
1489
|
+
};
|
|
1490
|
+
return {
|
|
1491
|
+
kind: "planned",
|
|
1492
|
+
path,
|
|
1493
|
+
plan: symlinkPlan(app, path, target)
|
|
1494
|
+
};
|
|
1495
|
+
}
|
|
1496
|
+
/** Finds the captured status for one deployed skill path. */
|
|
1497
|
+
function skillDeploymentStatus(app, directory, skillId) {
|
|
1498
|
+
const path = resolve(join(directory.path, skillId));
|
|
1499
|
+
return app.sourceFiles.find((file) => resolve(file.spec.path) === path);
|
|
1500
|
+
}
|
|
1501
|
+
/** Whether a lexical target lies within Aura's canonical shared skills root. */
|
|
1502
|
+
function isAuraOwnedSkillTarget(homeDir, targetPath) {
|
|
1503
|
+
const root = resolve(sharedSkillsRoot(homeDir));
|
|
1504
|
+
const target = resolve(targetPath);
|
|
1505
|
+
const fromRoot = relative(root, target);
|
|
1506
|
+
return fromRoot !== "" && fromRoot !== ".." && !fromRoot.startsWith(`..${sep}`);
|
|
1507
|
+
}
|
|
1508
|
+
/** Canonical location Aura uses for shared skill trees. */
|
|
1509
|
+
function sharedSkillsRoot(homeDir) {
|
|
1510
|
+
return join(homeDir, "agents", "skills");
|
|
1511
|
+
}
|
|
1512
|
+
function absoluteTarget(path, target) {
|
|
1513
|
+
return isAbsolute(target) ? resolve(target) : resolve(dirname(path), target);
|
|
1514
|
+
}
|
|
1515
|
+
function symlinkPlan(app, path, target) {
|
|
1516
|
+
return {
|
|
1517
|
+
operations: [{
|
|
1518
|
+
path,
|
|
1519
|
+
target,
|
|
1520
|
+
type: "symlink"
|
|
1521
|
+
}],
|
|
1522
|
+
summary: `Deploy the shared skill to ${app.displayName}.`
|
|
1523
|
+
};
|
|
1524
|
+
}
|
|
1525
|
+
function convergedPlan$1(app, skillId) {
|
|
1526
|
+
return {
|
|
1527
|
+
operations: [],
|
|
1528
|
+
summary: `${app.displayName} already loads shared skill "${skillId}".`
|
|
1529
|
+
};
|
|
1530
|
+
}
|
|
1531
|
+
//#endregion
|
|
1310
1532
|
//#region ../core/src/workspace/mcp-classify.ts
|
|
1311
1533
|
/**
|
|
1312
1534
|
* Splits desired servers into the ones Aura may write and the collisions a person has to settle.
|
|
@@ -1823,7 +2045,7 @@ function planImportLine(app, model, link, status, sourceContent) {
|
|
|
1823
2045
|
id: SHARED_LINK_SNIPPET_ID
|
|
1824
2046
|
}]);
|
|
1825
2047
|
if (reconciled.status === "invalid") return { blocked: `The Aura-managed block in ${link.entryPath} is malformed, so Aura will not rewrite the file. Repair or delete the block and run check --fix again.` };
|
|
1826
|
-
if (reconciled.status === "unchanged" && observedStateHolds(sourceContent)) return { plan: convergedPlan
|
|
2048
|
+
if (reconciled.status === "unchanged" && observedStateHolds(sourceContent)) return { plan: convergedPlan(app) };
|
|
1827
2049
|
return { plan: writePlan(app, link, reconciled.content, model.homeDir) };
|
|
1828
2050
|
}
|
|
1829
2051
|
/**
|
|
@@ -1847,7 +2069,7 @@ function planNativeCopy(app, model, link, status, sourceContent) {
|
|
|
1847
2069
|
const content = sourceContent ?? instructionEntry(app, link.entryPath)?.content;
|
|
1848
2070
|
const refusal = nativeCopyRefusal(status, sourceContent, content, link.content);
|
|
1849
2071
|
if (refusal !== void 0) return { blocked: refusal };
|
|
1850
|
-
if (status?.exists === true && content === link.content && observedStateHolds(sourceContent)) return { plan: convergedPlan
|
|
2072
|
+
if (status?.exists === true && content === link.content && observedStateHolds(sourceContent)) return { plan: convergedPlan(app) };
|
|
1851
2073
|
return { plan: writePlan(app, link, link.content ?? "", model.homeDir) };
|
|
1852
2074
|
}
|
|
1853
2075
|
function nativeCopyRefusal(status, sourceContent, content, desired) {
|
|
@@ -1856,7 +2078,7 @@ function nativeCopyRefusal(status, sourceContent, content, desired) {
|
|
|
1856
2078
|
function planSymlink(app, model, link, status, options) {
|
|
1857
2079
|
if (status?.exists === true && status.pathKind !== "symlink" && options.sourceContent === void 0) return { blocked: "The existing file is user-owned. Consolidate its content before replacing it with a symlink." };
|
|
1858
2080
|
const target = options.symlinkTarget ?? model.sharedInstructions.path;
|
|
1859
|
-
if (observedStateHolds(options.sourceContent) && pointsAt(status, target)) return { plan: convergedPlan
|
|
2081
|
+
if (observedStateHolds(options.sourceContent) && pointsAt(status, target)) return { plan: convergedPlan(app) };
|
|
1860
2082
|
return { plan: {
|
|
1861
2083
|
operations: [{
|
|
1862
2084
|
path: link.entryPath,
|
|
@@ -1878,7 +2100,7 @@ function pointsAt(status, target) {
|
|
|
1878
2100
|
return resolve(status.symlinkTarget) === resolve(target);
|
|
1879
2101
|
}
|
|
1880
2102
|
/** No work: the entry already loads the shared source, so the summary says so rather than promising a link. */
|
|
1881
|
-
function convergedPlan
|
|
2103
|
+
function convergedPlan(app) {
|
|
1882
2104
|
return {
|
|
1883
2105
|
operations: [],
|
|
1884
2106
|
summary: `${app.displayName} already loads the shared instruction source.`
|
|
@@ -1908,89 +2130,4 @@ function entryStatus(app, path) {
|
|
|
1908
2130
|
return app.sourceFiles.find((file) => resolve(file.spec.path) === resolve(path));
|
|
1909
2131
|
}
|
|
1910
2132
|
//#endregion
|
|
1911
|
-
|
|
1912
|
-
/** Plans one manifest skill's link into one adapter-declared directory. */
|
|
1913
|
-
function planSkillDeployment(app, model, skillId, directoryId, options = {}) {
|
|
1914
|
-
const directory = app.skillDirectories?.find((candidate) => candidate.id === directoryId);
|
|
1915
|
-
if (directory === void 0) return {
|
|
1916
|
-
kind: "blocked",
|
|
1917
|
-
path: skillId,
|
|
1918
|
-
reason: "The application no longer declares this skills directory."
|
|
1919
|
-
};
|
|
1920
|
-
const path = join(directory.path, skillId);
|
|
1921
|
-
const target = join(sharedSkillsRoot(model.homeDir), skillId);
|
|
1922
|
-
if (!(model.sharedSkills?.some((skill) => skill.id === skillId) === true) && options.assumeShared !== true) return {
|
|
1923
|
-
kind: "blocked",
|
|
1924
|
-
path,
|
|
1925
|
-
reason: `The shared copy at ${target} is missing. Reinstall skill "${skillId}" before deploying it.`
|
|
1926
|
-
};
|
|
1927
|
-
const status = skillDeploymentStatus(app, directory, skillId);
|
|
1928
|
-
if (status === void 0 || !status.exists) return {
|
|
1929
|
-
kind: "planned",
|
|
1930
|
-
path,
|
|
1931
|
-
plan: symlinkPlan(app, path, target)
|
|
1932
|
-
};
|
|
1933
|
-
if (status.problem !== void 0) return {
|
|
1934
|
-
kind: "blocked",
|
|
1935
|
-
path,
|
|
1936
|
-
reason: `Aura could not safely inspect ${path} (${status.problem}) and will not replace it.`
|
|
1937
|
-
};
|
|
1938
|
-
if (status.pathKind !== "symlink" || status.symlinkTarget === void 0) return {
|
|
1939
|
-
kind: "blocked",
|
|
1940
|
-
path,
|
|
1941
|
-
reason: `${path} is not an Aura-managed skill link. Move it aside before deploying skill "${skillId}" there.`
|
|
1942
|
-
};
|
|
1943
|
-
const actualTarget = absoluteTarget(path, status.symlinkTarget);
|
|
1944
|
-
if (actualTarget === resolve(target)) return {
|
|
1945
|
-
kind: "planned",
|
|
1946
|
-
path,
|
|
1947
|
-
plan: convergedPlan(app, skillId)
|
|
1948
|
-
};
|
|
1949
|
-
if (!isAuraOwnedSkillTarget(model.homeDir, actualTarget)) return {
|
|
1950
|
-
kind: "blocked",
|
|
1951
|
-
path,
|
|
1952
|
-
reason: `${path} is not an Aura-managed skill link because it points outside Aura's shared skills directory. It was preserved.`
|
|
1953
|
-
};
|
|
1954
|
-
return {
|
|
1955
|
-
kind: "planned",
|
|
1956
|
-
path,
|
|
1957
|
-
plan: symlinkPlan(app, path, target)
|
|
1958
|
-
};
|
|
1959
|
-
}
|
|
1960
|
-
/** Finds the captured status for one deployed skill path. */
|
|
1961
|
-
function skillDeploymentStatus(app, directory, skillId) {
|
|
1962
|
-
const path = resolve(join(directory.path, skillId));
|
|
1963
|
-
return app.sourceFiles.find((file) => resolve(file.spec.path) === path);
|
|
1964
|
-
}
|
|
1965
|
-
/** Whether a lexical target lies within Aura's canonical shared skills root. */
|
|
1966
|
-
function isAuraOwnedSkillTarget(homeDir, targetPath) {
|
|
1967
|
-
const root = resolve(sharedSkillsRoot(homeDir));
|
|
1968
|
-
const target = resolve(targetPath);
|
|
1969
|
-
const fromRoot = relative(root, target);
|
|
1970
|
-
return fromRoot !== "" && fromRoot !== ".." && !fromRoot.startsWith(`..${sep}`);
|
|
1971
|
-
}
|
|
1972
|
-
/** Canonical location Aura uses for shared skill trees. */
|
|
1973
|
-
function sharedSkillsRoot(homeDir) {
|
|
1974
|
-
return join(homeDir, "agents", "skills");
|
|
1975
|
-
}
|
|
1976
|
-
function absoluteTarget(path, target) {
|
|
1977
|
-
return isAbsolute(target) ? resolve(target) : resolve(dirname(path), target);
|
|
1978
|
-
}
|
|
1979
|
-
function symlinkPlan(app, path, target) {
|
|
1980
|
-
return {
|
|
1981
|
-
operations: [{
|
|
1982
|
-
path,
|
|
1983
|
-
target,
|
|
1984
|
-
type: "symlink"
|
|
1985
|
-
}],
|
|
1986
|
-
summary: `Deploy the shared skill to ${app.displayName}.`
|
|
1987
|
-
};
|
|
1988
|
-
}
|
|
1989
|
-
function convergedPlan(app, skillId) {
|
|
1990
|
-
return {
|
|
1991
|
-
operations: [],
|
|
1992
|
-
summary: `${app.displayName} already loads shared skill "${skillId}".`
|
|
1993
|
-
};
|
|
1994
|
-
}
|
|
1995
|
-
//#endregion
|
|
1996
|
-
export { MAX_MUTABLE_FILE_BYTES as A, AuraManifestError as B, renderRedactedWriteDiff as C, renderRemoveDiff as D, renderMoveDiff as E, parseAuraManifest as F, src_default as H, errorCode as I, errorMessage as L, assertAuraManifestWritable as M, createAuraManifestWriteOperation as N, renderSymlinkDiff as O, createEmptyAuraManifest as P, isRecord as R, hashManagedSnippet as S, renderConflict as T, pluralize as U, SHARED_INSTRUCTIONS_TEMPLATE as V, managedSnippetContentProblems as _, planSharedInstructionLink as a, canonicalizeManagedSnippet as b, planMcpSecretRemediation as c, planDesiredMcpConvergence as d, planManifestMcpConvergence as f, reconcileParsedManagedBlock as g, createAppMcpConvergence as h, skillDeploymentStatus as i, MAX_RETAINED_PLAN_BYTES as j, FILE_MODES as k, rememberMcpSecretPlanner as l, rememberMcpConvergence as m, planSkillDeployment as n, canPlanMcpSecretRemediation as o, planMcpServerRemoval as p, sharedSkillsRoot as r, createAppMcpSecretPlanner as s, isAuraOwnedSkillTarget as t, mcpConvergenceBlockers as u, readManagedBlock as v, renderArchiveDiff as w, hashCanonicalManagedSnippet as x, AURA_MANAGED_SNIPPET_BEGIN_PREFIX as y, resolveAuraManifestPath as z };
|
|
2133
|
+
export { renderRemoveDiff as A, errorMessage as B, canonicalizeManagedSnippet as C, renderArchiveDiff as D, renderRedactedWriteDiff as E, assertAuraManifestWritable as F, src_default as G, resolveAuraManifestPath as H, createAuraManifestWriteOperation as I, pluralize as K, createEmptyAuraManifest as L, FILE_MODES as M, MAX_MUTABLE_FILE_BYTES as N, renderConflict as O, MAX_RETAINED_PLAN_BYTES as P, parseAuraManifest as R, readManagedBlock as S, hashManagedSnippet as T, AuraManifestError as U, isRecord as V, SHARED_INSTRUCTIONS_TEMPLATE as W, planSharedSkillTreeUpdate as _, rememberMcpSecretPlanner as a, reconcileManagedSnippet as b, planManifestMcpConvergence as c, createAppMcpConvergence as d, isAuraOwnedSkillTarget as f, managedContentRevisionStatus as g, skillDeploymentStatus as h, planMcpSecretRemediation as i, renderSymlinkDiff as j, renderMoveDiff as k, planMcpServerRemoval as l, sharedSkillsRoot as m, canPlanMcpSecretRemediation as n, mcpConvergenceBlockers as o, planSkillDeployment as p, createAppMcpSecretPlanner as r, planDesiredMcpConvergence as s, planSharedInstructionLink as t, rememberMcpConvergence as u, reconcileParsedManagedBlock as v, hashCanonicalManagedSnippet as w, managedSnippetContentProblems as x, diffManagedSnippet as y, errorCode as z };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tryaura/aura-cli",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"description": "The composable Aura CLI runtime and official plugin distribution.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"agent",
|
|
@@ -50,17 +50,17 @@
|
|
|
50
50
|
"toml-eslint-parser": "^1.0.3",
|
|
51
51
|
"typanion": "3.14.0",
|
|
52
52
|
"undici": "7.29.0",
|
|
53
|
-
"@tryaura/aura-sdk": "0.1.
|
|
53
|
+
"@tryaura/aura-sdk": "0.1.1"
|
|
54
54
|
},
|
|
55
55
|
"devDependencies": {
|
|
56
56
|
"@types/node": "24.13.3",
|
|
57
57
|
"ajv": "8.20.0",
|
|
58
58
|
"vitest": "4.1.10",
|
|
59
59
|
"@tryaura/adapter-claude-code": "0.0.0",
|
|
60
|
-
"@tryaura/adapter-cursor": "0.0.0",
|
|
61
|
-
"@tryaura/checks-core": "0.0.0",
|
|
62
60
|
"@tryaura/adapter-codex": "0.0.0",
|
|
61
|
+
"@tryaura/checks-core": "0.0.0",
|
|
63
62
|
"@tryaura/content-official": "0.0.0",
|
|
63
|
+
"@tryaura/adapter-cursor": "0.0.0",
|
|
64
64
|
"@tryaura/core": "0.0.0"
|
|
65
65
|
},
|
|
66
66
|
"engines": {
|