@open-agent-toolkit/cli 0.0.16 → 0.0.18

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.
@@ -69,8 +69,10 @@ not the steady-state path.
69
69
  - Publish the four public packages manually the first time under the new npm
70
70
  org scope.
71
71
  - After those packages exist in npm, configure npm trusted publishing for this
72
- repository so `.github/workflows/release.yml` can become the steady-state
73
- release path without an npm token.
72
+ repository so `.github/workflows/release.yml` can stay the steady-state
73
+ top-level release path without an npm token.
74
+ - In steady state, `release.yml` owns automatic releases from `main` and manual
75
+ reruns for an existing release tag; `ci.yml` remains validation-only.
74
76
  - Use `.github/workflows/release-dry-run.yml` to validate the GitHub path after
75
77
  the npm trust relationship is configured.
76
78
 
@@ -1,6 +1,6 @@
1
1
  {
2
- "cli": "0.0.16",
3
- "docs-config": "0.0.16",
4
- "docs-theme": "0.0.16",
5
- "docs-transforms": "0.0.16"
2
+ "cli": "0.0.18",
3
+ "docs-config": "0.0.18",
4
+ "docs-theme": "0.0.18",
5
+ "docs-transforms": "0.0.18"
6
6
  }
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: oat-project-complete
3
- version: 1.3.4
3
+ version: 1.3.5
4
4
  description: Use when all implementation work is finished and the project is ready to close. Marks the OAT project lifecycle as complete.
5
5
  disable-model-invocation: true
6
6
  user-invocable: true
@@ -342,7 +342,7 @@ echo "Project archived to $ARCHIVE_PATH"
342
342
  **Canonical helper behaviors (required):**
343
343
 
344
344
  - Always archive locally first. The local archive is the authoritative completion artifact even when remote sync is also configured.
345
- - If `archive.summaryExportPath` is configured and `summary.md` exists after archive, copy it to `{repoRoot}/{archive.summaryExportPath}/{PROJECT_NAME}.md`.
345
+ - If `archive.summaryExportPath` is configured and `summary.md` exists after archive, copy it to `{repoRoot}/{archive.summaryExportPath}/YYYYMMDD-{PROJECT_NAME}.md`.
346
346
  - If `archive.s3SyncOnComplete=true` and `archive.s3Uri` is configured, sync the archived project to `{archive.s3Uri}/{repo-slug}/{PROJECT_NAME}/`.
347
347
  - If AWS CLI is missing or unusable for that S3 sync, warn and continue. Completion must not fail after the local archive succeeds.
348
348
  - If `archive.s3SyncOnComplete` is false or `archive.s3Uri` is unset, skip remote sync without prompting.
@@ -378,9 +378,10 @@ PRIMARY_REPO_ARCHIVE="${PRIMARY_REPO_ROOT}/.oat/projects/archived"
378
378
 
379
379
  Guidance:
380
380
 
381
- - In a worktree, prefer moving directly to `PRIMARY_REPO_ARCHIVE` instead of archiving locally and copying later.
381
+ - In a worktree, only prefer `PRIMARY_REPO_ARCHIVE` when the archive destination is local-only/gitignored in the current checkout. If `.oat/projects/archived/` is version controlled on the current branch, archive in the current checkout instead.
382
382
  - Do not treat the worktree-local archive as durable.
383
383
  - If forced to use a local-only archive, warn and require explicit user confirmation.
384
+ - Always write the dated `archive.summaryExportPath` copy into the current checkout (`repoRoot`), even when the project archive itself is written to the primary checkout.
384
385
  - Do not hardcode user-specific absolute paths.
385
386
 
386
387
  ### Step 9: Regenerate Dashboard
@@ -1,7 +1,7 @@
1
1
  import { Command, Option } from 'commander';
2
2
  const PROGRAM_NAME = 'oat';
3
3
  const PROGRAM_DESCRIPTION = 'Open Agent Toolkit CLI for provider interoperability';
4
- const PROGRAM_VERSION = '0.0.16';
4
+ const PROGRAM_VERSION = '0.0.18';
5
5
  const SCOPE_CHOICES = ['project', 'user', 'all'];
6
6
  export function createProgram() {
7
7
  return new Command()
@@ -6,6 +6,7 @@ interface IndexGenerateFileDependencies {
6
6
  writeFile: (path: string, content: string, encoding: BufferEncoding) => Promise<void>;
7
7
  readOatConfig: (repoRoot: string) => Promise<import('../../../config/oat-config.js').OatConfig>;
8
8
  writeOatConfig: (repoRoot: string, config: import('../../../config/oat-config.js').OatConfig) => Promise<void>;
9
+ resolveRepoRoot: (cwd: string) => Promise<string>;
9
10
  }
10
11
  interface IndexGenerateDependencies {
11
12
  buildCommandContext: (options: GlobalOptions) => CommandContext;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/commands/docs/index-generate/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAEL,KAAK,cAAc,EACnB,KAAK,aAAa,EACnB,MAAM,sBAAsB,CAAC;AAG9B,OAAO,EAAE,OAAO,EAAU,MAAM,WAAW,CAAC;AAS5C,UAAU,6BAA6B;IACrC,aAAa,EAAE,CACb,OAAO,EAAE,MAAM,KACZ,OAAO,CAAC,OAAO,aAAa,EAAE,UAAU,EAAE,CAAC,CAAC;IACjD,WAAW,EAAE,CAAC,OAAO,EAAE,OAAO,aAAa,EAAE,UAAU,EAAE,KAAK,MAAM,CAAC;IACrE,SAAS,EAAE,CACT,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,cAAc,KACrB,OAAO,CAAC,IAAI,CAAC,CAAC;IACnB,aAAa,EAAE,CACb,QAAQ,EAAE,MAAM,KACb,OAAO,CAAC,OAAO,oBAAoB,EAAE,SAAS,CAAC,CAAC;IACrD,cAAc,EAAE,CACd,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,OAAO,oBAAoB,EAAE,SAAS,KAC3C,OAAO,CAAC,IAAI,CAAC,CAAC;CACpB;AAED,UAAU,yBAAyB;IACjC,mBAAmB,EAAE,CAAC,OAAO,EAAE,aAAa,KAAK,cAAc,CAAC;IAChE,QAAQ,EAAE,6BAA6B,CAAC;CACzC;AAsED,wBAAgB,8BAA8B,CAC5C,SAAS,GAAE,OAAO,CAAC,yBAAyB,CAAM,GACjD,OAAO,CAsBT"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/commands/docs/index-generate/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAEL,KAAK,cAAc,EACnB,KAAK,aAAa,EACnB,MAAM,sBAAsB,CAAC;AAI9B,OAAO,EAAE,OAAO,EAAU,MAAM,WAAW,CAAC;AAS5C,UAAU,6BAA6B;IACrC,aAAa,EAAE,CACb,OAAO,EAAE,MAAM,KACZ,OAAO,CAAC,OAAO,aAAa,EAAE,UAAU,EAAE,CAAC,CAAC;IACjD,WAAW,EAAE,CAAC,OAAO,EAAE,OAAO,aAAa,EAAE,UAAU,EAAE,KAAK,MAAM,CAAC;IACrE,SAAS,EAAE,CACT,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,cAAc,KACrB,OAAO,CAAC,IAAI,CAAC,CAAC;IACnB,aAAa,EAAE,CACb,QAAQ,EAAE,MAAM,KACb,OAAO,CAAC,OAAO,oBAAoB,EAAE,SAAS,CAAC,CAAC;IACrD,cAAc,EAAE,CACd,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,OAAO,oBAAoB,EAAE,SAAS,KAC3C,OAAO,CAAC,IAAI,CAAC,CAAC;IACnB,eAAe,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;CACnD;AAED,UAAU,yBAAyB;IACjC,mBAAmB,EAAE,CAAC,OAAO,EAAE,aAAa,KAAK,cAAc,CAAC;IAChE,QAAQ,EAAE,6BAA6B,CAAC;CACzC;AAwED,wBAAgB,8BAA8B,CAC5C,SAAS,GAAE,OAAO,CAAC,yBAAyB,CAAM,GACjD,OAAO,CAsBT"}
@@ -3,6 +3,7 @@ import { join, relative } from 'node:path';
3
3
  import { buildCommandContext, } from '../../../app/command-context.js';
4
4
  import { readGlobalOptions } from '../../shared/shared.utils.js';
5
5
  import { readOatConfig, writeOatConfig } from '../../../config/oat-config.js';
6
+ import { resolveProjectRoot } from '../../../fs/paths.js';
6
7
  import { Command, Option } from 'commander';
7
8
  import { generateIndex, renderIndex } from './generator.js';
8
9
  const DEFAULT_FILE_DEPS = {
@@ -11,6 +12,7 @@ const DEFAULT_FILE_DEPS = {
11
12
  writeFile,
12
13
  readOatConfig,
13
14
  writeOatConfig,
15
+ resolveRepoRoot: resolveProjectRoot,
14
16
  };
15
17
  const DEFAULT_DEPENDENCIES = {
16
18
  buildCommandContext,
@@ -24,12 +26,13 @@ async function runIndexGenerate(context, options, deps) {
24
26
  const entries = await deps.generateIndex(docsDir);
25
27
  const content = deps.renderIndex(entries);
26
28
  await deps.writeFile(outputPath, content, 'utf8');
27
- const config = await deps.readOatConfig(context.cwd);
29
+ const repoRoot = await deps.resolveRepoRoot(context.cwd);
30
+ const config = await deps.readOatConfig(repoRoot);
28
31
  config.documentation = {
29
32
  ...config.documentation,
30
- index: relative(context.cwd, outputPath) || 'index.md',
33
+ index: relative(repoRoot, outputPath) || 'index.md',
31
34
  };
32
- await deps.writeOatConfig(context.cwd, config);
35
+ await deps.writeOatConfig(repoRoot, config);
33
36
  if (context.json) {
34
37
  context.logger.json({
35
38
  status: 'ok',
@@ -1,6 +1,7 @@
1
1
  import { type CommandContext, type GlobalOptions } from '../../../app/command-context.js';
2
2
  import { type UpsertSectionResult } from '../../shared/agents-md.js';
3
3
  import { type PromptContext, type SelectChoice } from '../../shared/shared.prompts.js';
4
+ import { type OatConfig } from '../../../config/oat-config.js';
4
5
  import { Command } from 'commander';
5
6
  import { type DocsInitResolvedOptions } from './resolve-options.js';
6
7
  interface DocsInitDependencies {
@@ -11,6 +12,8 @@ interface DocsInitDependencies {
11
12
  selectWithAbort: <T extends string>(message: string, choices: SelectChoice<T>[], ctx: PromptContext) => Promise<T | null>;
12
13
  runDocsInit: (context: CommandContext, options: DocsInitResolvedOptions, assetsRoot: string) => Promise<void>;
13
14
  upsertAgentsMdSection: (repoRoot: string, key: string, body: string) => Promise<UpsertSectionResult>;
15
+ readOatConfig: (repoRoot: string) => Promise<OatConfig>;
16
+ confirmAction: (message: string, ctx: PromptContext) => Promise<boolean>;
14
17
  }
15
18
  export declare function buildDocsSectionBody(options: DocsInitResolvedOptions): string;
16
19
  export declare function createDocsInitCommand(overrides?: Partial<DocsInitDependencies>): Command;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/commands/docs/init/index.ts"],"names":[],"mappings":"AAAA,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ACrB,QAAQ,EAAE,MAAM,EAChB,GAAG,EAAE,MAAM,EACX,IAAI,EAAE,MAAM,KACT,OAAO,CAAC,mBAAmB,CAAC,CAAC;IAClC,aAAa,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,OAAO,CAAC,SAAS,CAAC,CAAC;IACxD,aAAa,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,aAAa,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;CAC1E;AAiDD,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,uBAAuB,GAAG,MAAM,CAc7E;AA8GD,wBAAgB,qBAAqB,CACnC,SAAS,GAAE,OAAO,CAAC,oBAAoB,CAAM,GAC5C,OAAO,CAsCT"}
@@ -1,11 +1,11 @@
1
1
  import { buildCommandContext, } from '../../../app/command-context.js';
2
2
  import { upsertAgentsMdSection, } from '../../shared/agents-md.js';
3
- import { inputWithDefault, selectWithAbort, } from '../../shared/shared.prompts.js';
3
+ import { confirmAction, inputWithDefault, selectWithAbort, } from '../../shared/shared.prompts.js';
4
4
  import { readGlobalOptions } from '../../shared/shared.utils.js';
5
- import { readOatConfig, writeOatConfig } from '../../../config/oat-config.js';
5
+ import { readOatConfig, writeOatConfig, } from '../../../config/oat-config.js';
6
6
  import { resolveAssetsRoot } from '../../../fs/assets.js';
7
7
  import { Command, Option } from 'commander';
8
- import { DEFAULT_DOCS_REPO_SHAPE_DEPENDENCIES, detectDocsRepoShape, resolveDocsInitOptions, } from './resolve-options.js';
8
+ import { DEFAULT_DOCS_REPO_SHAPE_DEPENDENCIES, detectDocsRepoShape, getDefaultDocsAppName, resolveDocsInitOptions, } from './resolve-options.js';
9
9
  import { scaffoldDocsApp } from './scaffold.js';
10
10
  const DEFAULT_DEPENDENCIES = {
11
11
  buildCommandContext,
@@ -41,6 +41,8 @@ const DEFAULT_DEPENDENCIES = {
41
41
  context.logger.info(` Format: ${options.format}`);
42
42
  },
43
43
  upsertAgentsMdSection,
44
+ readOatConfig,
45
+ confirmAction,
44
46
  };
45
47
  const FRAMEWORK_LABELS = {
46
48
  fumadocs: 'Fumadocs (Next.js + MDX)',
@@ -83,6 +85,32 @@ async function runDocsInitCommand(context, options, dependencies) {
83
85
  process.exitCode = 0;
84
86
  return;
85
87
  }
88
+ const existingConfig = await dependencies.readOatConfig(context.cwd);
89
+ if (existingConfig.documentation?.root) {
90
+ const configDesc = `root: ${existingConfig.documentation.root}, tooling: ${existingConfig.documentation.tooling ?? 'unknown'}`;
91
+ if (context.json) {
92
+ // JSON mode: include warning in output, proceed only with --yes
93
+ if (!options.yes) {
94
+ context.logger.json({
95
+ status: 'error',
96
+ message: `Existing docs config found (${configDesc}). Use --yes to replace.`,
97
+ });
98
+ process.exitCode = 1;
99
+ return;
100
+ }
101
+ }
102
+ else {
103
+ context.logger.warn(`Existing docs config detected (${configDesc}). This will replace the current setup.`);
104
+ if (!options.yes) {
105
+ const proceed = await dependencies.confirmAction('Replace existing docs setup?', { interactive: context.interactive });
106
+ if (!proceed) {
107
+ context.logger.info('Docs init cancelled.');
108
+ process.exitCode = 1;
109
+ return;
110
+ }
111
+ }
112
+ }
113
+ }
86
114
  const assetsRoot = await dependencies.resolveAssetsRoot();
87
115
  await dependencies.runDocsInit(context, resolved, assetsRoot);
88
116
  const sectionBody = buildDocsSectionBody(resolved);
@@ -90,6 +118,23 @@ async function runDocsInitCommand(context, options, dependencies) {
90
118
  if (!context.json && sectionResult.action !== 'no-change') {
91
119
  context.logger.info(`AGENTS.md docs section ${sectionResult.action}.`);
92
120
  }
121
+ if (!context.json) {
122
+ context.logger.info('');
123
+ context.logger.info('Next steps:');
124
+ if (resolved.repoShape === 'single-package') {
125
+ context.logger.info(` cd ${resolved.targetDir} && pnpm install`);
126
+ context.logger.info(' pnpm build');
127
+ }
128
+ else {
129
+ context.logger.info(' pnpm install');
130
+ context.logger.info(` pnpm --filter ${resolved.appName} build`);
131
+ const defaultName = getDefaultDocsAppName(context.cwd, resolved.repoShape);
132
+ if (resolved.appName !== defaultName) {
133
+ context.logger.info('');
134
+ context.logger.info(`Note: Your docs app is named "${resolved.appName}" — if you have root scripts or CI filters referencing "${defaultName}", update them to match.`);
135
+ }
136
+ }
137
+ }
93
138
  process.exitCode = 0;
94
139
  }
95
140
  catch (error) {
@@ -10,6 +10,7 @@ export interface ScaffoldDocsAppResult {
10
10
  }
11
11
  export interface OatDepContext {
12
12
  isOatRepo: boolean;
13
+ localPackages: Set<string>;
13
14
  oatPackageVersions: Record<string, string>;
14
15
  }
15
16
  export declare function detectIsOatRepo(repoRoot: string): Promise<boolean>;
@@ -1 +1 @@
1
- {"version":3,"file":"scaffold.d.ts","sourceRoot":"","sources":["../../../../src/commands/docs/init/scaffold.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAGjE,OAAO,KAAK,EAGV,uBAAuB,EAExB,MAAM,mBAAmB,CAAC;AA+E3B,MAAM,WAAW,sBAAuB,SAAQ,uBAAuB;IACrE,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,qBAAqB;IACpC,OAAO,EAAE,MAAM,CAAC;IAChB,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,mBAAmB,EAAE,sBAAsB,CAAC;CAC7C;AAED,MAAM,WAAW,aAAa;IAC5B,SAAS,EAAE,OAAO,CAAC;IACnB,kBAAkB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAC5C;AAWD,wBAAsB,eAAe,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAOxE;AAsCD,wBAAsB,oBAAoB,CACxC,QAAQ,EAAE,MAAM,EAChB,UAAU,EAAE,MAAM,GACjB,OAAO,CAAC,aAAa,CAAC,CAYxB;AA4ID,wBAAsB,eAAe,CACnC,OAAO,EAAE,sBAAsB,GAC9B,OAAO,CAAC,qBAAqB,CAAC,CAoChC"}
1
+ {"version":3,"file":"scaffold.d.ts","sourceRoot":"","sources":["../../../../src/commands/docs/init/scaffold.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAGjE,OAAO,KAAK,EAGV,uBAAuB,EAExB,MAAM,mBAAmB,CAAC;AA+E3B,MAAM,WAAW,sBAAuB,SAAQ,uBAAuB;IACrE,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,qBAAqB;IACpC,OAAO,EAAE,MAAM,CAAC;IAChB,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,mBAAmB,EAAE,sBAAsB,CAAC;CAC7C;AAED,MAAM,WAAW,aAAa;IAC5B,SAAS,EAAE,OAAO,CAAC;IACnB,aAAa,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IAC3B,kBAAkB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAC5C;AAWD,wBAAsB,eAAe,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAOxE;AAgDD,wBAAsB,oBAAoB,CACxC,QAAQ,EAAE,MAAM,EAChB,UAAU,EAAE,MAAM,GACjB,OAAO,CAAC,aAAa,CAAC,CAaxB;AA4ID,wBAAsB,eAAe,CACnC,OAAO,EAAE,sBAAsB,GAC9B,OAAO,CAAC,qBAAqB,CAAC,CAoChC"}
@@ -71,7 +71,7 @@ const OAT_DEP_PACKAGES = [
71
71
  'docs-theme',
72
72
  'docs-transforms',
73
73
  ];
74
- const DEFAULT_OAT_PUBLISHED_VERSION = '0.0.16';
74
+ const DEFAULT_OAT_PUBLISHED_VERSION = '0.0.18';
75
75
  const PUBLIC_PACKAGE_VERSIONS_FILE = 'public-package-versions.json';
76
76
  export async function detectIsOatRepo(repoRoot) {
77
77
  for (const pkg of OAT_DEP_PACKAGES) {
@@ -105,17 +105,27 @@ async function readBundledOatPackageVersions(assetsRoot) {
105
105
  function buildFallbackOatPackageVersions(version) {
106
106
  return Object.fromEntries(OAT_DEP_PACKAGES.map((name) => [name, version]));
107
107
  }
108
+ async function detectLocalOatPackages(repoRoot) {
109
+ const found = new Set();
110
+ for (const pkg of OAT_DEP_PACKAGES) {
111
+ if (await fileExists(join(repoRoot, 'packages', pkg, 'package.json'))) {
112
+ found.add(pkg);
113
+ }
114
+ }
115
+ return found;
116
+ }
108
117
  export async function resolveOatDepContext(repoRoot, assetsRoot) {
109
- const isOatRepo = await detectIsOatRepo(repoRoot);
118
+ const localPackages = await detectLocalOatPackages(repoRoot);
119
+ const isOatRepo = localPackages.size === OAT_DEP_PACKAGES.length;
110
120
  if (isOatRepo) {
111
- return { isOatRepo, oatPackageVersions: {} };
121
+ return { isOatRepo, localPackages, oatPackageVersions: {} };
112
122
  }
113
123
  const cliVersion = await readCliVersion(assetsRoot);
114
124
  const oatPackageVersions = {
115
125
  ...buildFallbackOatPackageVersions(cliVersion),
116
126
  ...(await readBundledOatPackageVersions(assetsRoot)),
117
127
  };
118
- return { isOatRepo, oatPackageVersions };
128
+ return { isOatRepo, localPackages, oatPackageVersions };
119
129
  }
120
130
  function humanizeAppName(appName) {
121
131
  return appName
@@ -151,10 +161,10 @@ function buildGenerateIndexCmd(isOatRepo, targetDir) {
151
161
  if (isOatRepo) {
152
162
  return `pnpm -w run cli -- docs generate-index --docs-dir ${targetDir}/docs --output ${targetDir}/index.md`;
153
163
  }
154
- return '(oat docs generate-index --docs-dir docs --output index.md || true)';
164
+ return 'oat docs generate-index --docs-dir docs --output index.md';
155
165
  }
156
166
  function oatDepVersion(depContext, packageName) {
157
- if (depContext.isOatRepo) {
167
+ if (depContext.localPackages.has(packageName)) {
158
168
  return 'workspace:*';
159
169
  }
160
170
  return `^${depContext.oatPackageVersions[packageName] ?? DEFAULT_OAT_PUBLISHED_VERSION}`;
@@ -193,7 +203,7 @@ function buildDocumentationConfig(framework, targetDir) {
193
203
  return {
194
204
  root: targetDir,
195
205
  tooling: 'fumadocs',
196
- index: join(targetDir, 'index.md'),
206
+ index: join(targetDir, 'docs', 'index.md'),
197
207
  };
198
208
  }
199
209
  return {
@@ -1 +1 @@
1
- {"version":3,"file":"archive-utils.d.ts","sourceRoot":"","sources":["../../../../src/commands/project/archive/archive-utils.ts"],"names":[],"mappings":"AAMA,OAAO,EACL,aAAa,EACb,cAAc,EACd,SAAS,EACT,SAAS,EACT,UAAU,EACX,MAAM,QAAQ,CAAC;AAIhB,MAAM,MAAM,cAAc,GAAG;IAC3B,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG,CACzB,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,EAAE,EACd,OAAO,CAAC,EAAE;IAAE,GAAG,CAAC,EAAE,MAAM,CAAC;IAAC,GAAG,CAAC,EAAE,MAAM,CAAC,UAAU,CAAA;CAAE,KAChD,OAAO,CAAC,cAAc,CAAC,CAAC;AAE7B,MAAM,WAAW,4BAA4B;IAC3C,IAAI,EAAE,YAAY,GAAG,MAAM,CAAC;IAC5B,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,cAAc,EAAE,OAAO,CAAC;CACzB;AAED,UAAU,iCAAiC;IACzC,QAAQ,CAAC,EAAE,YAAY,CAAC;IACxB,GAAG,CAAC,EAAE,MAAM,CAAC,UAAU,CAAC;CACzB;AAED,MAAM,WAAW,2BAA2B;IAC1C,EAAE,EAAE,OAAO,CAAC;IACZ,QAAQ,EAAE,MAAM,EAAE,CAAC;CACpB;AAED,MAAM,WAAW,iCAAiC;IAChD,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,gBAAgB,EAAE,OAAO,CAAC;IAC1B,iBAAiB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACnC;AAED,UA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AAM,GAAG;IAC9D,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;IACrB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;CAC1B,CA4BA;AAED,wBAAgB,8BAA8B,CAC5C,YAAY,EAAE,MAAM,EACpB,WAAW,EAAE,MAAM,GAClB,MAAM,CAIR;AAqGD,wBAAsB,0BAA0B,CAC9C,OAAO,EAAE,iCAAiC,EAC1C,YAAY,GAAE,sCAA2C,GACxD,OAAO,CAAC,gCAAgC,CAAC,CA+F3C;AAED,wBAAsB,qBAAqB,CACzC,OAAO,EAAE,4BAA4B,EACrC,YAAY,GAAE,iCAAsC,GACnD,OAAO,CAAC,2BAA2B,CAAC,CA0CtC"}
1
+ {"version":3,"file":"archive-utils.d.ts","sourceRoot":"","sources":["../../../../src/commands/project/archive/archive-utils.ts"],"names":[],"mappings":"AAMA,OAAO,EACL,aAAa,EACb,cAAc,EACd,SAAS,EACT,SAAS,EACT,UAAU,EACX,MAAM,QAAQ,CAAC;AAIhB,MAAM,MAAM,cAAc,GAAG;IAC3B,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG,CACzB,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,EAAE,EACd,OAAO,CAAC,EAAE;IAAE,GAAG,CAAC,EAAE,MAAM,CAAC;IAAC,GAAG,CAAC,EAAE,MAAM,CAAC,UAAU,CAAA;CAAE,KAChD,OAAO,CAAC,cAAc,CAAC,CAAC;AAE7B,MAAM,WAAW,4BAA4B;IAC3C,IAAI,EAAE,YAAY,GAAG,MAAM,CAAC;IAC5B,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,cAAc,EAAE,OAAO,CAAC;CACzB;AAED,UAAU,iCAAiC;IACzC,QAAQ,CAAC,EAAE,YAAY,CAAC;IACxB,GAAG,CAAC,EAAE,MAAM,CAAC,UAAU,CAAC;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ACtC,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;CACtB;AA8BD,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAE7E;AAED,wBAAgB,wBAAwB,CACtC,KAAK,EAAE,MAAM,EACb,QAAQ,EAAE,MAAM,EAChB,UAAU,EAAE,MAAM,GACjB,MAAM,CAER;AAmBD,wBAAgB,wBAAwB,CACtC,WAAW,EAAE,MAAM,EACnB,SAAS,EAAE,MAAM,GAChB,MAAM,CAER;AAED,wBAAgB,wBAAwB,CAAC,YAAY,EAAE,MAAM,GAAG;IAC9D,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;IACrB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;CAC1B,CA4BA;AAED,wBAAgB,8BAA8B,CAC5C,YAAY,EAAE,MAAM,EACpB,WAAW,EAAE,MAAM,GAClB,MAAM,CAIR;AAqJD,wBAAsB,0BAA0B,CAC9C,OAAO,EAAE,iCAAiC,EAC1C,YAAY,GAAE,sCAA2C,GACxD,OAAO,CAAC,gCAAgC,CAAC,CAoG3C;AAED,wBAAsB,qBAAqB,CACzC,OAAO,EAAE,4BAA4B,EACrC,YAAY,GAAE,iCAAsC,GACnD,OAAO,CAAC,2BAA2B,CAAC,CA0CtC"}
@@ -87,7 +87,38 @@ function resolveGitPath(repoRoot, gitPath) {
87
87
  ? normalizedPath
88
88
  : join(repoRoot, normalizedPath);
89
89
  }
90
- async function resolveArchiveRepoRoot(repoRoot, dependencies) {
90
+ function isExitCode(error, code) {
91
+ return (typeof error === 'object' &&
92
+ error !== null &&
93
+ 'code' in error &&
94
+ Number(error.code) === code);
95
+ }
96
+ async function isGitignoredArchivePath(repoRoot, archiveProjectPath, dependencies) {
97
+ const execFile = dependencies.gitExecFile ?? execFileAsync;
98
+ try {
99
+ await execFile('git', ['check-ignore', '--quiet', '--no-index', archiveProjectPath], {
100
+ cwd: repoRoot,
101
+ env: dependencies.env ?? process.env,
102
+ });
103
+ return true;
104
+ }
105
+ catch (error) {
106
+ if (isExitCode(error, 1)) {
107
+ return false;
108
+ }
109
+ throw error;
110
+ }
111
+ }
112
+ async function resolveArchiveRepoRoot(repoRoot, archiveProjectPath, dependencies) {
113
+ try {
114
+ const archivePathIsGitignored = await isGitignoredArchivePath(repoRoot, archiveProjectPath, dependencies);
115
+ if (!archivePathIsGitignored) {
116
+ return repoRoot;
117
+ }
118
+ }
119
+ catch {
120
+ return repoRoot;
121
+ }
91
122
  const execFile = dependencies.gitExecFile ?? execFileAsync;
92
123
  try {
93
124
  const [{ stdout: commonDir }, { stdout: gitDir }] = await Promise.all([
@@ -148,7 +179,8 @@ export async function archiveProjectOnCompletion(options, dependencies = {}) {
148
179
  const execFile = dependencies.execFile ?? execFileAsync;
149
180
  const timestamp = dependencies.timestamp?.() ?? new Date().toISOString();
150
181
  const snapshotName = buildArchiveSnapshotName(options.projectName, timestamp);
151
- const archiveRepoRoot = await resolveArchiveRepoRoot(options.repoRoot, dependencies);
182
+ const archiveProjectPath = resolveLocalArchiveProjectPath(options.projectsRoot, options.projectName);
183
+ const archiveRepoRoot = await resolveArchiveRepoRoot(options.repoRoot, archiveProjectPath, dependencies);
152
184
  const archiveBasePath = resolveCompletionArchivePath(archiveRepoRoot, options.projectsRoot, options.projectName);
153
185
  const archivePath = await resolveUniqueArchivePath(archiveBasePath, dependencies);
154
186
  await makeDir(dirname(archivePath));
@@ -3,7 +3,7 @@ import { mkdir, readFile, rename, writeFile } from 'node:fs/promises';
3
3
  import { dirname } from 'node:path';
4
4
  import { CliError } from '../errors/index.js';
5
5
  import { ManifestSchema, } from './manifest.types.js';
6
- const OAT_VERSION = '0.0.16';
6
+ const OAT_VERSION = '0.0.18';
7
7
  function formatIssuePath(path) {
8
8
  if (path.length === 0) {
9
9
  return '(root)';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@open-agent-toolkit/cli",
3
- "version": "0.0.16",
3
+ "version": "0.0.18",
4
4
  "private": false,
5
5
  "description": "Open Agent Toolkit CLI",
6
6
  "homepage": "https://github.com/voxmedia/open-agent-toolkit/tree/main/packages/cli",