@tryaura/aura-cli 0.1.1 → 0.2.0

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.
@@ -5,6 +5,26 @@ import { createHash } from "node:crypto";
5
5
  import { createTwoFilesPatch } from "diff";
6
6
  import { gt, valid } from "semver";
7
7
  import { isDeepStrictEqual } from "node:util";
8
+ //#region ../core/src/display-path.ts
9
+ /**
10
+ * Names a path the way a user can address it from where they ran the command.
11
+ *
12
+ * Project-relative first, then `~/`, then the path unchanged. Every renderer goes through this so
13
+ * one report cannot show the same file two ways — a check that bakes a path into its message and
14
+ * the CLI that prints that finding's locations must agree, or the two lines read as two files.
15
+ */
16
+ function displayPath(path, roots) {
17
+ const project = pathInside(roots.projectRoot ?? roots.cwd, path);
18
+ if (project !== void 0) return project;
19
+ const home = pathInside(roots.homeDir, path);
20
+ return home === void 0 ? path : `~/${home}`;
21
+ }
22
+ function pathInside(root, path) {
23
+ const difference = relative(root, path);
24
+ if (difference.length === 0 || difference === ".." || difference.startsWith(`..${sep}`) || isAbsolute(difference)) return;
25
+ return difference.split(sep).join("/");
26
+ }
27
+ //#endregion
8
28
  //#region ../core/src/pluralize.ts
9
29
  /** Selects the noun or verb form that agrees with a numeric count. */
10
30
  function pluralize(count, singular, plural = `${singular}s`) {
@@ -52,6 +72,7 @@ var src_default = definePlugin({
52
72
  id: "directory:agenticskills",
53
73
  kind: "directory",
54
74
  name: "agenticskills.io",
75
+ protocol: "agenticskills",
55
76
  url: "https://agenticskills.io"
56
77
  }],
57
78
  snippets: [
@@ -162,6 +183,7 @@ function isRecord(value) {
162
183
  }
163
184
  //#endregion
164
185
  //#region ../core/src/manifest/schema-values.ts
186
+ const SHA256_PATTERN = /^[0-9a-f]{64}$/u;
165
187
  var AuraManifestValidationError = class extends Error {
166
188
  jsonPath;
167
189
  constructor(jsonPath, message) {
@@ -331,9 +353,37 @@ function targetApps(value, path, name, scope, claimed) {
331
353
  }
332
354
  return entries;
333
355
  }
356
+ const MAX_TRUSTED_PATH_LENGTH = 1024;
357
+ /**
358
+ * Reads `trustedRepoPresets`, the repository presets the user accepted during setup.
359
+ *
360
+ * Each entry binds an absolute preset path to a hash of the exact contents that were reviewed, so
361
+ * a file edited after acceptance is untrusted again until someone looks at the new contents. Only
362
+ * acceptances appear here: declining records nothing, and the next interactive setup asks again.
363
+ */
364
+ function optionalTrustedRepoPresets(value) {
365
+ if (value === void 0) return {};
366
+ if (!Array.isArray(value)) throw invalid("$.trustedRepoPresets", "must be an array");
367
+ if (value.length > 64) throw invalid("$.trustedRepoPresets", `must contain at most ${String(64)} entries`);
368
+ const paths = /* @__PURE__ */ new Set();
369
+ return { trustedRepoPresets: Object.freeze(value.map((candidate, index) => {
370
+ const path = `$.trustedRepoPresets[${String(index)}]`;
371
+ const entry = requiredObject(candidate, path);
372
+ const presetPath = requiredString(entry, "path", path);
373
+ if (presetPath.length === 0 || presetPath.length > MAX_TRUSTED_PATH_LENGTH) throw invalid(`${path}.path`, `must be a non-empty path of at most ${String(MAX_TRUSTED_PATH_LENGTH)} characters`);
374
+ if (paths.has(presetPath)) throw invalid(`${path}.path`, "must not duplicate another trusted preset path");
375
+ paths.add(presetPath);
376
+ const hash = requiredString(entry, "hash", path);
377
+ if (!SHA256_PATTERN.test(hash)) throw invalid(`${path}.hash`, "must be a lowercase SHA-256 hash");
378
+ return Object.freeze({
379
+ ...entry,
380
+ hash,
381
+ path: presetPath
382
+ });
383
+ })) };
384
+ }
334
385
  //#endregion
335
386
  //#region ../core/src/manifest/schema.ts
336
- const SHA256_PATTERN = /^[0-9a-f]{64}$/u;
337
387
  const APP_ID_PATTERN = /^[a-z0-9][a-z0-9._-]*$/u;
338
388
  const MCP_CATALOG_ID_PATTERN = /^[a-z0-9][a-z0-9._-]*\/[a-zA-Z0-9][a-zA-Z0-9._-]*$/u;
339
389
  const SKILL_ID_PATTERN = /^[a-z0-9]+(?:-[a-z0-9]+)*$/u;
@@ -367,7 +417,8 @@ function validateAuraManifest(value) {
367
417
  ...optionalPreset(source["preset"]),
368
418
  schemaVersion: 1,
369
419
  skills: skills(source["skills"]),
370
- snippets: snippets(source["snippets"])
420
+ snippets: snippets(source["snippets"]),
421
+ ...optionalTrustedRepoPresets(source["trustedRepoPresets"])
371
422
  });
372
423
  }
373
424
  /**
@@ -2130,4 +2181,4 @@ function entryStatus(app, path) {
2130
2181
  return app.sourceFiles.find((file) => resolve(file.spec.path) === resolve(path));
2131
2182
  }
2132
2183
  //#endregion
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 };
2184
+ 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, displayPath as q, 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 };
@@ -57,8 +57,10 @@ interface CliRuntime {
57
57
  /**
58
58
  * Color depth reported to the command framework.
59
59
  *
60
- * Defaults to what the terminal supports, honouring `NO_COLOR` and `FORCE_COLOR`. Always no color
61
- * when `stdout` is injected, since the destination is then not a terminal Aura can ask.
60
+ * Defaults to what the process's own stdout supports, honouring the CLI and environment color
61
+ * policy. Always no color when `stdout` is injected, since neither that stream nor the
62
+ * surrounding process's `FORCE_COLOR` says anything about the destination — set this to ask for
63
+ * color there. An explicit value stays authoritative unless the command line says `--no-color`.
62
64
  */
63
65
  readonly colorDepth?: number | undefined;
64
66
  /** Directory the command was invoked from. */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tryaura/aura-cli",
3
- "version": "0.1.1",
3
+ "version": "0.2.0",
4
4
  "description": "The composable Aura CLI runtime and official plugin distribution.",
5
5
  "keywords": [
6
6
  "agent",
@@ -50,18 +50,18 @@
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.1"
53
+ "@tryaura/aura-sdk": "0.2.0"
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
- "@tryaura/adapter-claude-code": "0.0.0",
59
+ "@tryaura/adapter-cursor": "0.0.0",
60
60
  "@tryaura/adapter-codex": "0.0.0",
61
+ "@tryaura/adapter-claude-code": "0.0.0",
61
62
  "@tryaura/checks-core": "0.0.0",
62
- "@tryaura/content-official": "0.0.0",
63
- "@tryaura/adapter-cursor": "0.0.0",
64
- "@tryaura/core": "0.0.0"
63
+ "@tryaura/core": "0.0.0",
64
+ "@tryaura/content-official": "0.0.0"
65
65
  },
66
66
  "engines": {
67
67
  "node": ">=24"
@@ -21,7 +21,7 @@
21
21
  "required": ["label", "layer"],
22
22
  "properties": {
23
23
  "label": { "type": "string" },
24
- "layer": { "enum": ["cli", "default", "distro", "manifest", "preset"] }
24
+ "layer": { "enum": ["cli", "default", "distro", "manifest", "preset", "repo"] }
25
25
  }
26
26
  },
27
27
  "summary": {
@@ -61,6 +61,21 @@
61
61
  "phase": { "enum": ["check", "detect", "files", "fix", "parse", "read", "support"] }
62
62
  }
63
63
  },
64
+ "configuration": {
65
+ "type": "object",
66
+ "additionalProperties": false,
67
+ "properties": {
68
+ "repositoryPreset": {
69
+ "type": "object",
70
+ "additionalProperties": false,
71
+ "required": ["path", "status"],
72
+ "properties": {
73
+ "path": { "type": "string" },
74
+ "status": { "enum": ["applied", "held"] }
75
+ }
76
+ }
77
+ }
78
+ },
64
79
  "support": {
65
80
  "type": "object",
66
81
  "additionalProperties": false,
@@ -186,6 +201,7 @@
186
201
  ],
187
202
  "properties": {
188
203
  "apps": { "type": "array", "items": { "$ref": "#/$defs/app" } },
204
+ "configuration": { "$ref": "#/$defs/configuration" },
189
205
  "diagnostics": { "type": "array", "items": { "$ref": "#/$defs/diagnostic" } },
190
206
  "findings": { "type": "array", "items": { "$ref": "#/$defs/finding" } },
191
207
  "fixes": { "type": "array", "items": { "$ref": "#/$defs/fix" } },
@@ -225,6 +241,7 @@
225
241
  "title"
226
242
  ],
227
243
  "properties": {
244
+ "configuration": { "$ref": "#/$defs/configuration" },
228
245
  "enabled": { "type": "boolean" },
229
246
  "explain": { "type": "string" },
230
247
  "fixability": { "enum": ["auto", "guided", "manual"] },