@open-agent-toolkit/cli 0.0.39 → 0.0.41

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.
@@ -1,6 +1,6 @@
1
1
  {
2
- "cli": "0.0.39",
3
- "docs-config": "0.0.39",
4
- "docs-theme": "0.0.39",
5
- "docs-transforms": "0.0.39"
2
+ "cli": "0.0.41",
3
+ "docs-config": "0.0.41",
4
+ "docs-theme": "0.0.41",
5
+ "docs-transforms": "0.0.41"
6
6
  }
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: oat-project-complete
3
- version: 1.4.2
3
+ version: 1.4.3
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
@@ -310,23 +310,40 @@ Archive happens after PR description generation (so artifacts are readable at tr
310
310
 
311
311
  The archive-side effects in this step are CLI-owned. Follow the canonical behavior from `packages/cli/src/commands/project/archive/archive-utils.ts` rather than inventing separate S3 or summary-export logic inside the skill.
312
312
 
313
+ **Anti-pattern (do NOT do this):** Running `git check-ignore` on the
314
+ `.oat/projects/archived` directory itself to decide durability. A common
315
+ gitignore shape for this repo is `.oat/projects/archived/**`, which leaves the
316
+ directory visible in the tree while ignoring every file placed inside. A
317
+ directory-level check reports "not ignored" and produces the inverse of the
318
+ intended decision — archiving in the worktree when the archive must actually
319
+ go to the primary repo. Always probe a representative path **inside** the
320
+ archive directory (the project subpath or a probe filename), matching the CLI
321
+ helper at `packages/cli/src/commands/project/archive/archive-utils.ts`.
322
+
313
323
  ```bash
314
324
  ARCHIVED_ROOT=".oat/projects/archived"
325
+ # ARCHIVE_RELATIVE_PATH is the contents-level probe: a hypothetical file that
326
+ # would live inside the archive directory. This is the same probe shape the
327
+ # CLI helper uses — do not simplify this to the directory itself.
315
328
  ARCHIVE_RELATIVE_PATH=".oat/projects/archived/${PROJECT_NAME}"
316
329
  PRIMARY_REPO_ARCHIVE=""
317
- ARCHIVE_PATH_IS_GITIGNORED="false"
330
+ ARCHIVE_CONTENTS_TRACKED="true"
318
331
  USE_PRIMARY_REPO_ARCHIVE="false"
319
332
 
320
- # First decide whether the archive destination is local-only in this checkout.
321
- # If the archive path is tracked here, keep the archive on the current worktree
322
- # and branch so the completion commit and PR carry the archived project.
333
+ # Will a newly-archived file at ${ARCHIVE_RELATIVE_PATH} actually be tracked in
334
+ # this checkout? Probe a representative path INSIDE the directory, not the
335
+ # directory itself. A `.oat/projects/archived/**` gitignore pattern leaves the
336
+ # directory visible in the tree but ignores everything placed inside, so a
337
+ # directory-level check reports "tracked" and gives the inverse of the
338
+ # intended answer.
323
339
  if git check-ignore --quiet --no-index "$ARCHIVE_RELATIVE_PATH" 2>/dev/null; then
324
- ARCHIVE_PATH_IS_GITIGNORED="true"
340
+ ARCHIVE_CONTENTS_TRACKED="false"
325
341
  fi
326
342
 
327
- # Only fall back to the primary checkout when the archive destination is
328
- # gitignored/local-only in the current worktree.
329
- if [[ "$ARCHIVE_PATH_IS_GITIGNORED" == "true" ]] && git rev-parse --is-inside-work-tree >/dev/null 2>&1; then
343
+ # Fall back to the primary checkout whenever archive contents are local-only
344
+ # in the current worktree, regardless of whether the archive directory itself
345
+ # happens to exist in the tree.
346
+ if [[ "$ARCHIVE_CONTENTS_TRACKED" == "false" ]] && git rev-parse --is-inside-work-tree >/dev/null 2>&1; then
330
347
  GIT_COMMON_DIR=$(git rev-parse --git-common-dir 2>/dev/null || true)
331
348
  GIT_DIR=$(git rev-parse --git-dir 2>/dev/null || true)
332
349
  if [[ -n "$GIT_COMMON_DIR" && -n "$GIT_DIR" && "$GIT_COMMON_DIR" != "$GIT_DIR" ]]; then
@@ -373,7 +390,7 @@ echo "Project archived to $ARCHIVE_PATH"
373
390
  - Ask the user explicitly: "Primary repo archive path is unavailable, so this archive may be lost when the worktree is deleted. Continue with local-only archive anyway?"
374
391
  - If the user declines, skip archiving and continue the completion flow without archive.
375
392
  - Resolve the durable repo root from `git rev-parse --git-common-dir` and `git rev-parse --git-dir`, matching the CLI helper in `packages/cli/src/commands/project/archive/archive-utils.ts`. Do not rely on a `main` checkout or default-branch naming.
376
- - Apply this guard only when `git check-ignore --quiet --no-index "$ARCHIVE_RELATIVE_PATH"` reports that the archive destination is local-only in the current checkout.
393
+ - Apply this guard only when `git check-ignore --quiet --no-index "$ARCHIVE_RELATIVE_PATH"` reports that the archive **contents** are local-only in the current checkout. `$ARCHIVE_RELATIVE_PATH` must be a path **inside** the archive directory (the project subpath), never the directory itself — see the anti-pattern note above the bash block.
377
394
 
378
395
  **Git handling after archive:**
379
396
 
@@ -387,7 +404,7 @@ This stages the deletions from the shared directory. The archived copy is preser
387
404
 
388
405
  **Worktree archive target (required when available):**
389
406
 
390
- If running from a git worktree, prefer the primary repo archive directory only when the archive destination is local-only/gitignored in the current checkout.
407
+ If running from a git worktree, prefer the primary repo archive directory whenever a newly-archived file inside `.oat/projects/archived/` would be local-only in the current checkout.
391
408
 
392
409
  Reference path:
393
410
 
@@ -399,7 +416,8 @@ PRIMARY_REPO_ARCHIVE="${PRIMARY_REPO_ROOT}/.oat/projects/archived"
399
416
 
400
417
  Guidance:
401
418
 
402
- - 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.
419
+ - In a worktree, prefer `PRIMARY_REPO_ARCHIVE` whenever `git check-ignore --quiet --no-index "$ARCHIVE_RELATIVE_PATH"` reports the archive **contents** as ignored regardless of whether the archive directory itself happens to exist in the tree. Only archive in the current checkout when a hypothetical file at `.oat/projects/archived/<project>/state.md` would actually be tracked here.
420
+ - Do not check `git check-ignore` on `.oat/projects/archived` (the directory itself). A `.oat/projects/archived/**` ignore pattern leaves the directory unignored while ignoring all contents, so a directory-level check reports "tracked" and an agent can mistakenly archive in the worktree.
403
421
  - Do not treat the worktree-local archive as durable.
404
422
  - If forced to use a local-only archive, warn and require explicit user confirmation.
405
423
  - Always write the dated `archive.summaryExportPath` copy into the current checkout (`repoRoot`), even when the project archive itself is written to the primary checkout.
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: oat-project-pr-final
3
- version: 1.3.2
3
+ version: 1.3.3
4
4
  description: Use when an active OAT project has completed all phases and is ready for final merge to main. Generates the final OAT lifecycle PR description from artifacts and review status, then creates the PR automatically.
5
5
  disable-model-invocation: true
6
6
  user-invocable: true
@@ -255,6 +255,7 @@ Local path exclusion:
255
255
 
256
256
  - Read `.oat/config.json` and extract `localPaths` (glob patterns for gitignored directories).
257
257
  - Do **not** include References links to any path that matches a `localPaths` pattern — those paths are gitignored and will not exist on the remote.
258
+ - Evaluate the match against the actual **file or subpath** you are about to link (e.g. `.oat/projects/<proj>/pr/project-pr-2026-04-01.md`), not against the parent directory. A pattern like `.oat/**/pr` is shorthand for "everything under this directory is local-only"; a directory-level `git check-ignore` on `.oat/projects/<proj>/pr` can report "not ignored" even when every file inside is local-only, so a directory-level check will produce a broken reference link.
258
259
  - Common matches: `.oat/projects/**/reviews/archived`, `.oat/projects/**/pr`. Active `reviews/` paths remain eligible for References when they are tracked; only archived review paths should be treated as local-only by default.
259
260
 
260
261
  Example link context:
@@ -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,KA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AM,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;AA4JD,wBAAsB,0BAA0B,CAC9C,OAAO,EAAE,iCAAiC,EAC1C,YAAY,GAAE,sCAA2C,GACxD,OAAO,CAAC,gCAAgC,CAAC,CAwG3C;AAED,wBAAsB,qBAAqB,CACzC,OAAO,EAAE,4BAA4B,EACrC,YAAY,GAAE,iCAAsC,GACnD,OAAO,CAAC,2BAA2B,CAAC,CA0CtC"}
@@ -98,6 +98,13 @@ function isExitCode(error, code) {
98
98
  'code' in error &&
99
99
  Number(error.code) === code);
100
100
  }
101
+ // archiveProjectPath must be the contents-level probe path
102
+ // (.oat/projects/archived/<projectName>), not the archive directory itself
103
+ // (.oat/projects/archived). A `.oat/projects/archived/**` gitignore pattern
104
+ // leaves the directory visible in the tree while ignoring every file placed
105
+ // inside — a directory-level check reports "not ignored" and produces the
106
+ // inverse of the intended durability decision. Keep the probe inside the
107
+ // directory; the `oat-project-complete` skill documents the same invariant.
101
108
  async function isGitignoredArchivePath(repoRoot, archiveProjectPath, dependencies) {
102
109
  const execFile = dependencies.gitExecFile ?? execFileAsync;
103
110
  try {
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/sync/index.ts"],"names":[],"mappings":"AAsCA,OAAO,EAAE,OAAO,EAAU,MAAM,WAAW,CAAC;AAI5C,OAAO,KAAK,EAEV,uBAAuB,EAExB,MAAM,cAAc,CAAC;AAmTtB,wBAAgB,iBAAiB,CAC/B,SAAS,GAAE,OAAO,CAAC,uBAAuB,CAAM,GAC/C,OAAO,CA6BT"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/sync/index.ts"],"names":[],"mappings":"AAsCA,OAAO,EAAE,OAAO,EAAU,MAAM,WAAW,CAAC;AAI5C,OAAO,KAAK,EAEV,uBAAuB,EAExB,MAAM,cAAc,CAAC;AAoTtB,wBAAgB,iBAAiB,CAC/B,SAAS,GAAE,OAAO,CAAC,uBAAuB,CAAM,GAC/C,OAAO,CA6BT"}
@@ -138,7 +138,7 @@ async function maybeResolveProviderMismatches(context, scope, scopeRoot, configP
138
138
  activeAdapters: resolution.activeAdapters,
139
139
  };
140
140
  }
141
- async function computePlans(context, dependencies, allowedRemovalCanonicalPaths) {
141
+ async function computePlans(context, dependencies, allowedCanonicalPaths) {
142
142
  const scopePlans = [];
143
143
  for (const scope of resolveConcreteScopes(context.scope)) {
144
144
  const scopeRoot = await dependencies.resolveScopeRoot(scope, context);
@@ -162,13 +162,13 @@ async function computePlans(context, dependencies, allowedRemovalCanonicalPaths)
162
162
  scope,
163
163
  config: resolved.config,
164
164
  scopeRoot,
165
- allowedRemovalCanonicalPaths,
165
+ allowedCanonicalPaths,
166
166
  });
167
167
  let codexExtensionPlan;
168
168
  let codexExtension;
169
169
  const activeAdapterNames = resolved.activeAdapters.map((adapter) => adapter.name);
170
170
  if (scope === 'project' && activeAdapterNames.includes('codex')) {
171
- codexExtensionPlan = await dependencies.computeCodexProjectExtensionPlan(scopeRoot, canonical);
171
+ codexExtensionPlan = await dependencies.computeCodexProjectExtensionPlan(scopeRoot, canonical, allowedCanonicalPaths);
172
172
  codexExtension = {
173
173
  operations: dependencies.toCodexExtensionOperations(codexExtensionPlan),
174
174
  managedRoles: codexExtensionPlan.managedRoles,
@@ -215,8 +215,8 @@ function logNonInteractiveMismatchGuidance(context, scopePlans) {
215
215
  }
216
216
  }
217
217
  }
218
- async function runSyncCommand(context, dependencies, allowedRemovalCanonicalPaths) {
219
- const scopePlans = await computePlans(context, dependencies, allowedRemovalCanonicalPaths);
218
+ async function runSyncCommand(context, dependencies, allowedCanonicalPaths) {
219
+ const scopePlans = await computePlans(context, dependencies, allowedCanonicalPaths);
220
220
  logNonInteractiveMismatchGuidance(context, scopePlans);
221
221
  if (context.dryRun) {
222
222
  runSyncDryRun(context, scopePlans, dependencies);
@@ -70,10 +70,10 @@ export interface SyncCommandDependencies {
70
70
  scope: ConcreteScope;
71
71
  config: SyncConfig;
72
72
  scopeRoot: string;
73
- allowedRemovalCanonicalPaths?: string[];
73
+ allowedCanonicalPaths?: string[];
74
74
  }) => Promise<SyncPlan>;
75
75
  executeSyncPlan: (plan: SyncPlan, manifest: Manifest, manifestPath: string) => Promise<SyncResult>;
76
- computeCodexProjectExtensionPlan: (scopeRoot: string, canonicalEntries: CanonicalEntry[]) => Promise<CodexExtensionPlan>;
76
+ computeCodexProjectExtensionPlan: (scopeRoot: string, canonicalEntries: CanonicalEntry[], allowedCanonicalPaths?: string[]) => Promise<CodexExtensionPlan>;
77
77
  toCodexExtensionOperations: (plan: CodexExtensionPlan) => CodexExtensionOperation[];
78
78
  applyCodexProjectExtensionPlan: (scopeRoot: string, plan: CodexExtensionPlan) => Promise<CodexExtensionApplyResult>;
79
79
  formatSyncPlan: (plan: SyncPlan, applied: boolean) => string;
@@ -1 +1 @@
1
- {"version":3,"file":"sync.types.d.ts","sourceRoot":"","sources":["../../../src/commands/sync/sync.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAC1E,OAAO,KAAK,EACV,iBAAiB,EACjB,aAAa,EACd,MAAM,iCAAiC,CAAC;AACzC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,KAAK,EAAE,cAAc,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC1E,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,KAAK,EACV,yBAAyB,EACzB,kBAAkB,EACnB,MAAM,uCAAuC,CAAC;AAC/C,OAAO,KAAK,EACV,yBAAyB,EACzB,eAAe,EAChB,MAAM,mBAAmB,CAA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anonicalPaths?: string[];
13
+ allowedCanonicalPaths?: string[];
14
14
  }
15
- export declare function computeSyncPlan({ canonical, adapters, manifest, scope, config, scopeRoot: explicitScopeRoot, allowedRemovalCanonicalPaths, }: ComputeSyncPlanArgs): Promise<SyncPlan>;
15
+ export declare function computeSyncPlan({ canonical, adapters, manifest, scope, config, scopeRoot: explicitScopeRoot, allowedCanonicalPaths, }: ComputeSyncPlanArgs): Promise<SyncPlan>;
16
16
  export {};
17
17
  //# sourceMappingURL=compute-plan.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"compute-plan.d.ts","sourceRoot":"","sources":["../../src/engine/compute-plan.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAGtD,OAAO,KAAK,EAAE,QAAQ,EAAiB,MAAM,0BAA0B,CAAC;AACxE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAIvE,OAAO,KAAK,EACV,WAAW,EAEX,QAAQ,EAET,MAAM,gBAAgB,CAAC;AACxB,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAEhD,UAAU,mBAAmB;IAC3B,SAAS,EAAE,cAAc,EAAE,CAAC;IAC5B,QAAQ,EAAE,eAAe,EAAE,CAAC;IAC5B,QAAQ,EAAE,QAAQ,CAAC;IACnB,KAAK,EAAE,WAAW,CAAC;IACnB,MAAM,EAAE,UAAU,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,4BAA4B,CAAC,EAAE,MAAM,EAAE,CAAC;CACzC;AAoPD,wBAAsB,eAAe,CAAC,EACpC,SAAS,EACT,QAAQ,EACR,QAAQ,EACR,KAAK,EACL,MAAM,EACN,SAAS,EAAE,iBAAiB,EAC5B,4BAA4B,GAC7B,EAAE,mBAAmB,GAAG,OAAO,CAAC,QAAQ,CAAC,CAsHzC"}
1
+ {"version":3,"file":"compute-plan.d.ts","sourceRoot":"","sources":["../../src/engine/compute-plan.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAGtD,OAAO,KAAK,EAAE,QAAQ,EAAiB,MAAM,0BAA0B,CAAC;AACxE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAIvE,OAAO,KAAK,EACV,WAAW,EAEX,QAAQ,EAET,MAAM,gBAAgB,CAAC;AACxB,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAEhD,UAAU,mBAAmB;IAC3B,SAAS,EAAE,cAAc,EAAE,CAAC;IAC5B,QAAQ,EAAE,eAAe,EAAE,CAAC;IAC5B,QAAQ,EAAE,QAAQ,CAAC;IACnB,KAAK,EAAE,WAAW,CAAC;IACnB,MAAM,EAAE,UAAU,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,qBAAqB,CAAC,EAAE,MAAM,EAAE,CAAC;CAClC;AA+PD,wBAAsB,eAAe,CAAC,EACpC,SAAS,EACT,QAAQ,EACR,QAAQ,EACR,KAAK,EACL,MAAM,EACN,SAAS,EAAE,iBAAiB,EAC5B,qBAAqB,GACtB,EAAE,mBAAmB,GAAG,OAAO,CAAC,QAAQ,CAAC,CAuHzC"}
@@ -168,14 +168,20 @@ function resolveScopeRoot(canonical, explicitScopeRoot) {
168
168
  function entryContentTypeMatches(entry, contentType) {
169
169
  return entry.type === contentType;
170
170
  }
171
- export async function computeSyncPlan({ canonical, adapters, manifest, scope, config, scopeRoot: explicitScopeRoot, allowedRemovalCanonicalPaths, }) {
171
+ function canonicalPathAllowed(relativeCanonicalPath, canonicalFilter) {
172
+ if (!canonicalFilter) {
173
+ return true;
174
+ }
175
+ return canonicalFilter.has(normalize(relativeCanonicalPath));
176
+ }
177
+ export async function computeSyncPlan({ canonical, adapters, manifest, scope, config, scopeRoot: explicitScopeRoot, allowedCanonicalPaths, }) {
172
178
  const entries = [];
173
179
  const removals = [];
174
180
  const scopeRoot = resolveScopeRoot(canonical, explicitScopeRoot);
175
181
  const seenCanonicalKeys = new Set();
176
182
  const activeProviderNames = new Set();
177
- const removalFilter = allowedRemovalCanonicalPaths
178
- ? new Set(allowedRemovalCanonicalPaths.map((canonicalPath) => normalize(canonicalPath)))
183
+ const canonicalFilter = allowedCanonicalPaths
184
+ ? new Set(allowedCanonicalPaths.map((canonicalPath) => normalize(canonicalPath)))
179
185
  : null;
180
186
  for (const adapter of adapters) {
181
187
  for (const mapping of getSyncMappings(adapter, scope)) {
@@ -189,6 +195,9 @@ export async function computeSyncPlan({ canonical, adapters, manifest, scope, co
189
195
  continue;
190
196
  }
191
197
  const relativeCanonicalPath = canonicalRelativePath(canonicalEntry);
198
+ if (!canonicalPathAllowed(relativeCanonicalPath, canonicalFilter)) {
199
+ continue;
200
+ }
192
201
  if (!entryInsideMapping(canonicalEntry, mapping.canonicalDir)) {
193
202
  continue;
194
203
  }
@@ -231,8 +240,8 @@ export async function computeSyncPlan({ canonical, adapters, manifest, scope, co
231
240
  if (seenCanonicalKeys.has(canonicalKey)) {
232
241
  continue;
233
242
  }
234
- if (removalFilter &&
235
- !removalFilter.has(normalize(manifestEntry.canonicalPath))) {
243
+ if (canonicalFilter &&
244
+ !canonicalFilter.has(normalize(manifestEntry.canonicalPath))) {
236
245
  continue;
237
246
  }
238
247
  removals.push(createRemovalEntry(manifestEntry, scopeRoot));
@@ -21,7 +21,7 @@ export interface CodexExtensionApplyResult {
21
21
  failed: number;
22
22
  skipped: number;
23
23
  }
24
- export declare function computeCodexProjectExtensionPlan(scopeRoot: string, canonicalEntries: CanonicalEntry[]): Promise<CodexExtensionPlan>;
24
+ export declare function computeCodexProjectExtensionPlan(scopeRoot: string, canonicalEntries: CanonicalEntry[], allowedCanonicalPaths?: string[]): Promise<CodexExtensionPlan>;
25
25
  export declare function applyCodexProjectExtensionPlan(scopeRoot: string, plan: CodexExtensionPlan): Promise<CodexExtensionApplyResult>;
26
26
  export declare function hasCodexExtensionChanges(plan: CodexExtensionPlan): boolean;
27
27
  export declare function summarizeCodexExtension(plan: CodexExtensionPlan): {
@@ -1 +1 @@
1
- {"version":3,"file":"sync-extension.d.ts","sourceRoot":"","sources":["../../../../src/providers/codex/codec/sync-extension.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAQpD,MAAM,MAAM,oBAAoB,GAAG,QAAQ,GAAG,QAAQ,GAAG,QAAQ,GAAG,MAAM,CAAC;AAC3E,MAAM,MAAM,oBAAoB,GAAG,MAAM,GAAG,QAAQ,CAAC;AAErD,MAAM,WAAW,uBAAuB;IACtC,MAAM,EAAE,oBAAoB,CAAC;IAC7B,MAAM,EAAE,oBAAoB,CAAC;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,4BAA6B,SAAQ,uBAAuB;IAC3E,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,kBAAkB;IACjC,UAAU,EAAE,4BAA4B,EAAE,CAAC;IAC3C,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,mBAAmB,EAAE,MAAM,CAAC;CAC7B;AAED,MAAM,WAAW,yBAAyB;IACxC,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;CACjB;AAuID,wBAAsB,gCAAgC,CACpD,SAAS,EAAE,MAAM,EACjB,gBAAgB,EAAE,cAAc,EAAE,GACjC,OAAO,CAAC,kBAAkB,CAAC,CAuG7B;AAED,wBAAsB,8BAA8B,CAClD,SAAS,EAAE,MAAM,EACjB,IAAI,EAAE,kBAAkB,GACvB,OAAO,CAAC,yBAAyB,CAAC,CA6BpC;AAED,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,kBAAkB,GAAG,OAAO,CAE1E;AAED,wBAAgB,uBAAuB,CAAC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AE,kBAAkB,GACvB,OAAO,CAAC,yBAAyB,CAAC,CA6BpC;AAED,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,kBAAkB,GAAG,OAAO,CAE1E;AAED,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,kBAAkB,GAAG;IACjE,iBAAiB,EAAE,MAAM,CAAC;IAC1B,OAAO,EAAE,MAAM,CAAC;CACjB,CAaA;AAED,wBAAgB,0BAA0B,CACxC,IAAI,EAAE,kBAAkB,GACvB,uBAAuB,EAAE,CAQ3B"}
@@ -16,6 +16,14 @@ function configPath(scopeRoot) {
16
16
  function toRelativePath(scopeRoot, absolutePath) {
17
17
  return relative(scopeRoot, absolutePath).replaceAll('\\', '/');
18
18
  }
19
+ function canonicalPathAllowed(scopeRoot, canonicalEntry, allowedCanonicalPaths) {
20
+ if (!allowedCanonicalPaths?.length) {
21
+ return true;
22
+ }
23
+ const allowedSet = new Set(allowedCanonicalPaths);
24
+ const relativeCanonicalPath = toRelativePath(scopeRoot, canonicalEntry.canonicalPath);
25
+ return allowedSet.has(relativeCanonicalPath);
26
+ }
19
27
  async function readOptionalFile(path) {
20
28
  if (!(await fileExists(path))) {
21
29
  return null;
@@ -94,12 +102,22 @@ async function collectStaleManagedRoles(scopeRoot, existingConfigContent, desire
94
102
  }
95
103
  return stale.sort((left, right) => left.localeCompare(right));
96
104
  }
97
- export async function computeCodexProjectExtensionPlan(scopeRoot, canonicalEntries) {
98
- const desiredRoles = await desiredRolesFromCanonical(canonicalEntries, scopeRoot);
105
+ export async function computeCodexProjectExtensionPlan(scopeRoot, canonicalEntries, allowedCanonicalPaths) {
106
+ const isPartialSync = allowedCanonicalPaths !== undefined && allowedCanonicalPaths.length > 0;
107
+ const desiredRoles = await desiredRolesFromCanonical(canonicalEntries.filter((entry) => canonicalPathAllowed(scopeRoot, entry, allowedCanonicalPaths)), scopeRoot);
99
108
  const desiredRoleNames = new Set(desiredRoles.map((role) => role.roleName));
100
109
  const existingConfigPath = configPath(scopeRoot);
101
110
  const existingConfigContent = await readOptionalFile(existingConfigPath);
102
- const staleRoles = await collectStaleManagedRoles(scopeRoot, existingConfigContent, desiredRoleNames);
111
+ const staleRoles = isPartialSync
112
+ ? []
113
+ : await collectStaleManagedRoles(scopeRoot, existingConfigContent, desiredRoleNames);
114
+ if (isPartialSync && desiredRoles.length === 0) {
115
+ return {
116
+ operations: [],
117
+ managedRoles: [],
118
+ aggregateConfigHash: hashContent(existingConfigContent ?? ''),
119
+ };
120
+ }
103
121
  const operations = [];
104
122
  for (const role of desiredRoles) {
105
123
  const existingRoleContent = await readOptionalFile(role.rolePath);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@open-agent-toolkit/cli",
3
- "version": "0.0.39",
3
+ "version": "0.0.41",
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",
@@ -33,7 +33,7 @@
33
33
  "ora": "^9.0.0",
34
34
  "yaml": "2.8.2",
35
35
  "zod": "^3.25.76",
36
- "@open-agent-toolkit/control-plane": "0.0.39"
36
+ "@open-agent-toolkit/control-plane": "0.0.41"
37
37
  },
38
38
  "devDependencies": {
39
39
  "@types/node": "^22.10.0",