@c4a/context-cli 0.7.88 → 0.7.90

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/cli.js CHANGED
@@ -92510,6 +92510,7 @@ async function beginKnowledgeUpdate(projectRoot, value, options = {}) {
92510
92510
  source_refs: [...new Set(article.sections.flatMap((section) => section.references.map((reference2) => reference2.source_ref)))]
92511
92511
  };
92512
92512
  }));
92513
+ const scopePages = options.pending ? cited.map((article) => article.path).filter((path2) => !changedPaths.has(path2)) : [];
92513
92514
  const registry2 = await readProductionRequirements(projectRoot);
92514
92515
  const repoReferences = articles.flatMap((article) => article.sections.flatMap((section) => section.references.filter((ref2) => ref2.source_ref.startsWith("repo-content:") && scopes.some((scope2) => repoContentScopeMatches(scope2.source_ref, ref2.source_ref))).map((reference2) => ({ article: article.path, section: section.id, reference: reference2 }))));
92515
92516
  const impact = repoReferences.length ? await repoContentImpactReader(projectRoot) : undefined;
@@ -92525,6 +92526,7 @@ async function beginKnowledgeUpdate(projectRoot, value, options = {}) {
92525
92526
  requirements,
92526
92527
  candidates,
92527
92528
  ...repoContent === undefined ? {} : { repo_content: repoContent },
92529
+ ...scopePages.length === 0 ? {} : { scope_pages: scopePages },
92528
92530
  ...inspected.unresolved.length === 0 ? {} : { changed_references: inspected.unresolved.map((item) => ({
92529
92531
  path: item.path,
92530
92532
  section_id: item.section_id,
@@ -92606,12 +92608,13 @@ async function completeKnowledgeUpdate(input) {
92606
92608
  throw new SubmissionInputError(`Update page paths must be unique; repeated: ${repeated.join(", ")}`, ["decisions"]);
92607
92609
  const candidates = new Set(request.candidates.map((candidate) => candidate.path));
92608
92610
  const missing2 = [...candidates].filter((path2) => !input.decisions.some((decision) => decision.path === path2));
92609
- const unknown2 = input.decisions.map((decision) => decision.path).filter((path2) => !candidates.has(path2));
92611
+ const scopePages = new Set(request.scope_pages ?? []);
92612
+ const unknown2 = input.decisions.map((decision) => decision.path).filter((path2) => !candidates.has(path2) && !scopePages.has(path2));
92610
92613
  if (missing2.length || unknown2.length) {
92611
92614
  throw new SubmissionInputError([
92612
92615
  "Decide each source-bound candidate once; an omitted page is not a no-change decision. List a candidate with only its path to keep it unchanged.",
92613
92616
  ...missing2.length ? [`Missing: ${missing2.join(", ")}.`] : [],
92614
- ...unknown2.length ? [`Not candidates (use new_topics for new pages): ${unknown2.join(", ")}.`] : []
92617
+ ...unknown2.length ? [`Not candidates or scope pages (use new_topics for new pages): ${unknown2.join(", ")}.`] : []
92615
92618
  ].join(" "), ["decisions"]);
92616
92619
  }
92617
92620
  await captureProcessedScopes(input.projectRoot, request.scopes);
@@ -92709,6 +92712,7 @@ var init_knowledgeUpdate = __esm(() => {
92709
92712
  previous_versions: exports_external.array(exports_external.string().nullable()),
92710
92713
  changes: exports_external.string().optional(),
92711
92714
  repo_content: exports_external.unknown().optional(),
92715
+ scope_pages: exports_external.array(exports_external.string()).optional(),
92712
92716
  changed_references: exports_external.array(exports_external.object({
92713
92717
  path: exports_external.string(),
92714
92718
  section_id: exports_external.string(),