@tryaura/aura-cli 0.2.0 → 0.2.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/dist/bin/aura.js CHANGED
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
- import { n as OFFICIAL_REGISTRY_OPTIONS, t as OFFICIAL_PLUGINS } from "../plugins-SZegBVXF.js";
3
- import { t as runCli } from "../run.boundary-BtMqQAEQ.js";
2
+ import { n as OFFICIAL_REGISTRY_OPTIONS, t as OFFICIAL_PLUGINS } from "../plugins-Dbasvr1u.js";
3
+ import { t as runCli } from "../run.boundary-CF5kZTH3.js";
4
4
  //#endregion
5
5
  //#region src/bin.ts
6
6
  await runCli({
@@ -9,7 +9,7 @@ await runCli({
9
9
  description: "Agent Unification & Repair Assistant",
10
10
  displayName: "Aura",
11
11
  docsUrl: "https://tryaura.sh/docs/introduction",
12
- version: "0.2.0"
12
+ version: "0.2.1"
13
13
  },
14
14
  plugins: OFFICIAL_PLUGINS,
15
15
  registry: OFFICIAL_REGISTRY_OPTIONS
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { i as vetHttpUrl, n as clampHttpTimeout, r as failureReason, t as runCli } from "./run.boundary-BtMqQAEQ.js";
1
+ import { i as vetHttpUrl, n as clampHttpTimeout, r as failureReason, t as runCli } from "./run.boundary-CF5kZTH3.js";
2
2
  //#region ../core/src/http-post.boundary.ts
3
3
  /**
4
4
  * Creates a bounded, TLS-only JSON POST that never rejects.
@@ -1,2 +1,2 @@
1
- import { a as codexPlugin, i as claudeCodePlugin, n as OFFICIAL_REGISTRY_OPTIONS, o as cursorPlugin, r as checksCorePlugin, s as officialContentPlugin, t as OFFICIAL_PLUGINS } from "../plugins-SZegBVXF.js";
1
+ import { a as codexPlugin, i as claudeCodePlugin, n as OFFICIAL_REGISTRY_OPTIONS, o as cursorPlugin, r as checksCorePlugin, s as officialContentPlugin, t as OFFICIAL_PLUGINS } from "../plugins-Dbasvr1u.js";
2
2
  export { OFFICIAL_PLUGINS, OFFICIAL_REGISTRY_OPTIONS, checksCorePlugin, claudeCodePlugin, codexPlugin, cursorPlugin, officialContentPlugin };
@@ -1,4 +1,4 @@
1
- import { G as src_default$4, I as createAuraManifestWriteOperation, K as pluralize, S as readManagedBlock, W as SHARED_INSTRUCTIONS_TEMPLATE, _ as planSharedSkillTreeUpdate, b as reconcileManagedSnippet, c as planManifestMcpConvergence, f as isAuraOwnedSkillTarget, g as managedContentRevisionStatus, h as skillDeploymentStatus, i as planMcpSecretRemediation, l as planMcpServerRemoval, m as sharedSkillsRoot, n as canPlanMcpSecretRemediation, o as mcpConvergenceBlockers, p as planSkillDeployment, q as displayPath, t as planSharedInstructionLink, v as reconcileParsedManagedBlock, y as diffManagedSnippet } from "./shared-link-plan-DVgOyqP9.js";
1
+ import { G as src_default$4, I as createAuraManifestWriteOperation, K as pluralize, S as readManagedBlock, W as SHARED_INSTRUCTIONS_TEMPLATE, _ as planSharedSkillTreeUpdate, b as reconcileManagedSnippet, c as planManifestMcpConvergence, f as isAuraOwnedSkillTarget, g as managedContentRevisionStatus, h as skillDeploymentStatus, i as planMcpSecretRemediation, l as planMcpServerRemoval, m as sharedSkillsRoot, n as canPlanMcpSecretRemediation, o as mcpConvergenceBlockers, p as planSkillDeployment, q as displayPath, t as planSharedInstructionLink, v as reconcileParsedManagedBlock, y as diffManagedSnippet } from "./shared-link-plan-D8fxdFYv.js";
2
2
  import { EMPTY_COLLECTION, McpWriteError, SHARED_INSTRUCTIONS_TEMPLATE_TOKEN, TIMEOUT_EXIT_CODE, collectJsonMcpServers, collectMcpServers, configStringArray, configStringRecord, defineAdapter, defineCheck, definePlugin, detectExecutable, detectLineEnding, inspectJsonMcpSecrets, isConfigRecord, isFileReference, jsonMcpEntry, jsonMcpSecretTransform, maskMarkdownCode, mcpCommandEntry, mcpEnvironmentVariableNames, mcpWriteResult, normalizeMcpServerDefinition, parseAtImports, parseConfigObject, parseInstalledSkills, parseJsonMcpConfig, redactMcpArguments, referenceTargetPath, sanitizeMcpUrl, skillDirectorySpecs, splitSourceLines, stdioTransport, writeJsonMcpServers } from "@tryaura/aura-sdk";
3
3
  import { dirname, extname, isAbsolute, join, resolve, sep } from "node:path";
4
4
  import { parse, stringify } from "smol-toml";
@@ -1194,12 +1194,10 @@ function validateToml(content, message) {
1194
1194
  //#endregion
1195
1195
  //#region ../../plugins/adapter-codex/src/project-directories.ts
1196
1196
  /**
1197
- * Every directory of the current project Codex consults, from `cwd` outward to the repository root.
1197
+ * Every directory Codex searches for project instructions, from `cwd` to the repository root.
1198
1198
  *
1199
- * Two features need exactly this list. Codex keys `[projects."..."]` by the directory it was
1200
- * launched in, which is frequently a subdirectory of the repository rather than its root, and it
1201
- * reads one `AGENTS.md` per directory from the root down to `cwd`. Both are the same walk read in
1202
- * opposite directions, so they share it rather than each keeping a copy.
1199
+ * Codex reads one `AGENTS.md` per directory from the root down to `cwd`. Project trust deliberately
1200
+ * does not share this walk: Codex checks only the exact cwd and the primary Git checkout for trust.
1203
1201
  *
1204
1202
  * Without a repository root there is nothing to walk to: every ancestor of the working directory is
1205
1203
  * a different project as far as Codex is concerned, so only `cwd` is considered. The same answer
@@ -1351,11 +1349,10 @@ function remainingBytes(selected, files, remaining) {
1351
1349
  /**
1352
1350
  * Reads the current project's trust marker from Codex's shared configuration.
1353
1351
  *
1354
- * Codex keys `[projects."..."]` by the directory it was launched in, which is frequently a
1355
- * subdirectory of the repository rather than its root. Looking only at the root would report a
1356
- * project as untrusted whenever the developer started Codex from somewhere inside it, so every
1357
- * directory from `cwd` up to and including the repository root is considered and the narrowest
1358
- * recorded answer wins.
1352
+ * Codex first checks the exact directory it was launched in, then the primary Git checkout. The
1353
+ * second identity matters for linked worktrees: Codex resolves their `.git` pointer back to the
1354
+ * main checkout, so trusting that checkout covers every associated worktree unless an exact cwd
1355
+ * entry overrides it.
1359
1356
  */
1360
1357
  function parseProjectTrust(file, lookup) {
1361
1358
  const root = parseConfigObject(file.content, parse);
@@ -1363,7 +1360,7 @@ function parseProjectTrust(file, lookup) {
1363
1360
  const projects = root["projects"];
1364
1361
  if (!isConfigRecord(projects)) return "unknown";
1365
1362
  const entries = new Map(Object.entries(projects).map(([key, value]) => [normalize(key), value]));
1366
- for (const directory of projectDirectories(lookup)) {
1363
+ for (const directory of trustDirectories(lookup)) {
1367
1364
  const project = entries.get(directory);
1368
1365
  if (!isConfigRecord(project)) continue;
1369
1366
  const trust = project["trust_level"];
@@ -1371,6 +1368,12 @@ function parseProjectTrust(file, lookup) {
1371
1368
  }
1372
1369
  return "unknown";
1373
1370
  }
1371
+ function trustDirectories(lookup) {
1372
+ const cwd = normalize(lookup.cwd);
1373
+ if (lookup.gitMainWorktreeRoot === void 0) return [cwd];
1374
+ const mainWorktreeRoot = normalize(lookup.gitMainWorktreeRoot);
1375
+ return cwd === mainWorktreeRoot ? [cwd] : [cwd, mainWorktreeRoot];
1376
+ }
1374
1377
  /** Collapses separators and trailing slashes so a config key and a scanned path compare equal. */
1375
1378
  function normalize(directory) {
1376
1379
  return resolve(directory);
@@ -1401,7 +1404,7 @@ const codexAdapter = defineAdapter({
1401
1404
  mcpWrite: writeMcpServers$1,
1402
1405
  mcpSecrets: transformMcpSecrets$1,
1403
1406
  parse: (input) => {
1404
- const { cwd, files, homeDir, projectRoot } = input;
1407
+ const { cwd, files, gitMainWorktreeRoot, homeDir } = input;
1405
1408
  const mcp = files.get(CODEX_SOURCE_IDS.mcp);
1406
1409
  const mcpConfig = mcp === void 0 ? EMPTY_MCP : parseMcpServers$1(mcp);
1407
1410
  const instructions = selectInstructionFiles(files, {
@@ -1414,7 +1417,7 @@ const codexAdapter = defineAdapter({
1414
1417
  mcpSecretSightings: mcpConfig.secretSightings ?? [],
1415
1418
  metadata: { [CODEX_PROJECT_TRUST_KEY]: mcp === void 0 ? "unknown" : parseProjectTrust(mcp, {
1416
1419
  cwd,
1417
- projectRoot
1420
+ gitMainWorktreeRoot
1418
1421
  }) },
1419
1422
  problems: [...shadowedEntryProblems(instructions.shadowed), ...unusableConfig(mcp, mcpConfig.malformed)],
1420
1423
  skills: parseInstalledSkills(CODEX_ADAPTER_ID, input, SKILL_DIRECTORIES),
@@ -2162,7 +2165,7 @@ const env004 = defineCheck({
2162
2165
  detect: (model) => detectConflicts(model),
2163
2166
  explain: `Claude Code can appear unable to work when its effective default permission mode is plan or dontAsk. Codex skips project-scoped configuration when a project is untrusted, so Aura also reports projects that are not explicitly trusted.
2164
2167
 
2165
- Claude Code: edit the settings file named by the finding and choose default or acceptEdits as appropriate. Codex: edit ~/.codex/config.toml and add a \`[projects."<project-root>"]\` section with \`trust_level = "trusted"\` after reviewing the repository.`,
2168
+ Claude Code: edit the settings file named by the finding and choose default or acceptEdits as appropriate. Codex: after reviewing the repository, edit ~/.codex/config.toml and trust the exact working directory or the primary Git checkout. Codex resolves linked worktrees back to that primary checkout.`,
2166
2169
  fix: (finding, model) => guidedFix$2(finding, model),
2167
2170
  fixability: "guided",
2168
2171
  id: "ENV-004",
@@ -2198,7 +2201,7 @@ function codexFindings(app) {
2198
2201
  if (trust === "trusted" || trust === "unreadable") return [];
2199
2202
  const path = sourcePath$2(app, CODEX_SOURCE_IDS.mcp);
2200
2203
  return [{
2201
- details: trust === "untrusted" ? "Codex explicitly marks this project untrusted and skips its project-scoped configuration." : "Codex has no trusted entry for this project or any directory inside it, so project-scoped configuration may be unavailable until trust is confirmed.",
2204
+ details: trust === "untrusted" ? "Codex explicitly marks this project untrusted and skips its project-scoped configuration." : "Codex has no trusted entry for this working directory or its primary Git checkout, so project-scoped configuration may be unavailable until trust is confirmed.",
2202
2205
  id: `codex-project-trust:${trust}`,
2203
2206
  ...path === void 0 ? {} : { locations: [{ path }] },
2204
2207
  message: trust === "untrusted" ? "Codex marks this project as untrusted." : "Codex does not mark this project as trusted.",
@@ -2223,11 +2226,14 @@ function guidedFix$2(finding, model) {
2223
2226
  summary: "Change Claude Code's restrictive default permission mode."
2224
2227
  };
2225
2228
  }
2226
- if (appId === "codex" && model.projectRoot !== void 0) return {
2227
- manualSteps: [`After reviewing the repository, add [projects.${JSON.stringify(model.projectRoot)}] with trust_level = "trusted" in ~/.codex/config.toml.`, "Restart Codex in the project and run `aura check` again."],
2228
- operations: [],
2229
- summary: "Trust the current project in Codex."
2230
- };
2229
+ if (appId === "codex" && model.projectRoot !== void 0) {
2230
+ const trustRoot = model.gitMainWorktreeRoot ?? model.cwd;
2231
+ return {
2232
+ manualSteps: [`After reviewing the repository, add [projects.${JSON.stringify(trustRoot)}] with trust_level = "trusted" in ~/.codex/config.toml.`, "Restart Codex in the project and run `aura check` again."],
2233
+ operations: [],
2234
+ summary: "Trust the current project in Codex."
2235
+ };
2236
+ }
2231
2237
  }
2232
2238
  //#endregion
2233
2239
  //#region ../../plugins/checks-core/src/hashing.ts
@@ -2756,7 +2762,7 @@ const legacyInstructionsCheck = defineCheck({
2756
2762
  detect: (model) => legacyDocuments(model.instructionFiles).map((legacy) => toFinding(legacy, model)),
2757
2763
  explain: `Legacy instruction files are easy to forget after changing agent applications or configuration formats. They may still be loaded unexpectedly, or hold useful guidance that newer application files never received.
2758
2764
 
2759
- Re-run the check with \`--fix --interactive\` to review the suggested migration steps, then use the \`setup\` command to consolidate selected content. Aura archives originals through its reversible backup history instead of deleting them silently.`,
2765
+ Re-run the check with \`--fix\` to review the suggested migration steps, then use the \`setup\` command to consolidate selected content. Aura archives originals through its reversible backup history instead of deleting them silently.`,
2760
2766
  fix: guidedFix$1,
2761
2767
  fixability: "guided",
2762
2768
  id: "INS-004",
@@ -3466,7 +3472,7 @@ const instructionLinkIntegrityCheck = defineCheck({
3466
3472
  detect: detectLinkProblems,
3467
3473
  explain: `Instruction imports must point to files the application can load without cycles or excessive nesting. Broken or unsupported chains silently discard guidance and can leave an agent running with only part of the intended instructions.
3468
3474
 
3469
- Re-run the check with \`--fix --interactive\` to review the affected source and target paths. Create or correct missing targets, remove one edge from cycles, and flatten chains that exceed the named application's supported depth.`,
3475
+ Re-run the check with \`--fix\` to review the affected source and target paths. Create or correct missing targets, remove one edge from cycles, and flatten chains that exceed the named application's supported depth.`,
3470
3476
  fix: guidedFix,
3471
3477
  fixability: "guided",
3472
3478
  id: "INS-006",
@@ -4457,7 +4463,7 @@ const managedBlockHashCheck = defineCheck({
4457
4463
  detect: detectManagedBlockDrift,
4458
4464
  explain: `Aura hashes each managed snippet so hand edits cannot be overwritten silently. A mismatch means the installed text no longer matches the registered version, so a later setup run must not guess which side should win.
4459
4465
 
4460
- Re-run the check with \`--fix --interactive\` and choose Keep yours to adopt the edit, Restore to return to registered content, or Merge to review both versions and reconcile them manually. Every executable choice is previewed and backed up before Aura writes.`,
4466
+ Re-run the check with \`--fix\` and choose Keep yours to adopt the edit, Restore to return to registered content, or Merge to review both versions and reconcile them manually. Every executable choice is previewed and backed up before Aura writes.`,
4461
4467
  fix: () => void 0,
4462
4468
  fixability: "guided",
4463
4469
  guidedFixes: guidedFixes$2,
@@ -4479,7 +4485,7 @@ function findingsForDocument(document, model) {
4479
4485
  const manifestHash = manifestHashes.get(snippet.id);
4480
4486
  return !snippet.hashMatches || manifestHash !== void 0 && manifestHash !== snippet.computedHash;
4481
4487
  }).map((snippet) => ({
4482
- details: "Run `aura check --fix --interactive` and choose Keep yours, Restore, or Merge before running setup again.",
4488
+ details: "Run `aura check --fix` and choose Keep yours, Restore, or Merge before running setup again.",
4483
4489
  id: `${document.sourceId}:${snippet.id}`,
4484
4490
  locations: [{
4485
4491
  line: snippet.startLine,
@@ -4495,7 +4501,7 @@ function findingsForDocument(document, model) {
4495
4501
  }
4496
4502
  function unterminatedFenceFinding(document, line, model) {
4497
4503
  return {
4498
- details: "Close the Markdown fence, then run `aura check --fix --interactive` again. Aura will not reconcile this document while its markers are hidden.",
4504
+ details: "Close the Markdown fence, then run `aura check --fix` again. Aura will not reconcile this document while its markers are hidden.",
4499
4505
  id: `${document.sourceId}:unterminated-fence`,
4500
4506
  locations: [{
4501
4507
  ...line === void 0 ? {} : { line },
@@ -4697,7 +4703,7 @@ function resolveDriftFirst(contentId) {
4697
4703
  id: "resolve-drift",
4698
4704
  label: "Resolve local edits first",
4699
4705
  plan: {
4700
- manualSteps: [`Run \`aura check --only MGD-001 --fix --interactive\` and resolve edits to ${contentId}, then review this update again.`],
4706
+ manualSteps: [`Run \`aura check --only MGD-001 --fix\` and resolve edits to ${contentId}, then review this update again.`],
4701
4707
  operations: [],
4702
4708
  summary: `Resolve local edits to ${contentId} before updating it.`
4703
4709
  }
@@ -4717,7 +4723,7 @@ function resolveSkillDriftFirst(contentId) {
4717
4723
  const managedContentUpdateCheck = defineCheck({
4718
4724
  defaultSeverity: "info",
4719
4725
  detect: detectManagedContentUpdates,
4720
- explain: "Aura records the exact version and content hash of each managed snippet and skill. When an installed plugin offers a different revision, Aura reports it and waits for a reviewed change instead of silently replacing managed content. A revision that is not newer — a rollback, or one this build cannot order — is reported too, because Aura keeps the recorded revision either way and an unreported hold would look like nothing to do. Pinned selections remain quiet until they are unpinned.\n\nRun `aura check --fix --interactive` to review bundled revisions and vanished snippets. Locally edited content must be resolved first; directory-sourced skill updates stay in `aura setup`, where network and credential approval are explicit.",
4726
+ explain: "Aura records the exact version and content hash of each managed snippet and skill. When an installed plugin offers a different revision, Aura reports it and waits for a reviewed change instead of silently replacing managed content. A revision that is not newer — a rollback, or one this build cannot order — is reported too, because Aura keeps the recorded revision either way and an unreported hold would look like nothing to do. Pinned selections remain quiet until they are unpinned.\n\nRun `aura check --fix` to review bundled revisions and vanished snippets. Locally edited content must be resolved first; directory-sourced skill updates stay in `aura setup`, where network and credential approval are explicit.",
4721
4727
  fix: () => void 0,
4722
4728
  fixability: "guided",
4723
4729
  guidedFixes: managedContentUpdateChoices,
@@ -5179,7 +5185,7 @@ const mcp003 = defineCheck({
5179
5185
  detect: detectDeadServers,
5180
5186
  explain: `Aura checks stdio commands with filesystem-only PATH resolution, and starts no MCP server of its own. Package launchers such as npx, uvx, and bunx are checked, but Aura does not guess whether the requested package is installed or cached.
5181
5187
 
5182
- Remote URLs are silent and generate no network traffic unless \`check --online\` is supplied. Online probes use short, bounded requests without configured authentication headers, and they skip an endpoint whose credentials Aura stripped, because the remaining URL no longer addresses the configured server. A redirect to a private address is reported rather than followed. A timeout or a server-side fault is a warning, not an error: it may not repeat. Re-run with \`--fix --interactive\` to choose whether to repair or remove a server that definitely failed its probe. Cursor separately requires its MCP servers to be approved and enabled in its own settings, which no file records; Aura reads those states by running \`cursor-agent mcp list\` when that CLI is installed and identifies itself. The command is Cursor's, and it connects to servers to answer, so Aura runs it from your home directory: only your own global configuration takes part, never a \`.cursor/mcp.json\` committed to the repository you are in. Aura never approves, enables, or retries a server itself, and every state it reports this way is a warning. Aura also reports an informational reminder when a desired MCP transport references an unset environment variable. It retains only the variable name and whether it is set; credential values never enter the workspace model or report.`,
5188
+ Remote URLs are silent and generate no network traffic unless \`check --online\` is supplied. Online probes use short, bounded requests without configured authentication headers, and they skip an endpoint whose credentials Aura stripped, because the remaining URL no longer addresses the configured server. A redirect to a private address is reported rather than followed. A timeout or a server-side fault is a warning, not an error: it may not repeat. Re-run with \`--fix\` to choose whether to repair or remove a server that definitely failed its probe. Cursor separately requires its MCP servers to be approved and enabled in its own settings, which no file records; Aura reads those states by running \`cursor-agent mcp list\` when that CLI is installed and identifies itself. The command is Cursor's, and it connects to servers to answer, so Aura runs it from your home directory: only your own global configuration takes part, never a \`.cursor/mcp.json\` committed to the repository you are in. Aura never approves, enables, or retries a server itself, and every state it reports this way is a warning. Aura also reports an informational reminder when a desired MCP transport references an unset environment variable. It retains only the variable name and whether it is set; credential values never enter the workspace model or report.`,
5183
5189
  fix: () => void 0,
5184
5190
  fixability: "guided",
5185
5191
  guidedFixes: guidedFixes$1,
@@ -5317,7 +5323,7 @@ const mcp004 = defineCheck({
5317
5323
  detect: detectInlineSecrets,
5318
5324
  explain: `Inline credentials in MCP configuration can leak through source control, logs, diagnostics, and copied configuration. Aura identifies credential-bearing fields without retaining their values, prefixes, or lengths.
5319
5325
 
5320
- Re-run with \`--fix --interactive\` to replace every behavior-preserving sighting in the same source file with an environment reference. Copy the current values directly from the named file before applying the rewrite; Aura never displays or stores those values outside the protected undo payload, which stays owner-only under \`~/agents/.backups\` until twenty later fixes have pushed it out of the journal. Then rotate each credential at its issuer: moving a value behind an environment reference stops it leaking again, not from wherever it has already reached.`,
5326
+ Re-run with \`--fix\` to replace every behavior-preserving sighting in the same source file with an environment reference. Copy the current values directly from the named file before applying the rewrite; Aura never displays or stores those values outside the protected undo payload, which stays owner-only under \`~/agents/.backups\` until twenty later fixes have pushed it out of the journal. Then rotate each credential at its issuer: moving a value behind an environment reference stops it leaking again, not from wherever it has already reached.`,
5321
5327
  findingGroup: {
5322
5328
  description: "Replace inline credentials with environment-variable references.",
5323
5329
  id: "checks-core/mcp-credentials",
@@ -5557,7 +5563,7 @@ const mcp005 = defineCheck({
5557
5563
  detect: detectScopePlacement,
5558
5564
  explain: `The Aura manifest distinguishes personal MCP servers from team servers. Personal servers belong in global configuration; putting one in repository configuration can publish it to teammates through source control. Team servers belong in project configuration; keeping one only in personal configuration means teammates do not receive it and their setup drifts. Placement is judged by the file an entry is written in, not by the scope label alone, because an application can keep both kinds in one document.
5559
5565
 
5560
- Re-run with \`--fix --interactive\` to move an Aura-owned entry through the same manifest convergence and undo machinery as other MCP fixes. Aura never removes a name outside its ownership ledger automatically.`,
5566
+ Re-run with \`--fix\` to move an Aura-owned entry through the same manifest convergence and undo machinery as other MCP fixes. Aura never removes a name outside its ownership ledger automatically.`,
5561
5567
  fix: placementFix,
5562
5568
  fixability: "guided",
5563
5569
  id: MCP_005_ID,