@c4a/context-cli 0.7.65 → 0.7.67
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 +17 -29
- package/indexers/contracts/profile-contract.json +245 -245
- package/indexers/release-manifest.json +1 -1
- package/package.json +12 -12
- package/plugins/VERSION +1 -1
- package/plugins/claude/.claude-plugin/plugin.json +1 -1
- package/plugins/codex/.codex-plugin/plugin.json +2 -2
- package/plugins/cursor/.cursor-plugin/plugin.json +1 -1
- package/providers/context/manifest.json +7 -7
- package/providers/context/provider.yaml +1 -1
- package/providers/context/resources/diagnostics/verification.md +2 -0
- package/providers/context/resources/manuals/guides/package-outputs.md +6 -2
package/cli.js
CHANGED
|
@@ -87709,7 +87709,7 @@ import DefaultTheme from 'vitepress/theme-without-fonts';
|
|
|
87709
87709
|
import { useData, useRoute, dataSymbol, onContentUpdated, getScrollOffset } from 'vitepress';
|
|
87710
87710
|
import { onMounted, onUnmounted, nextTick, watch, computed, ref, provide, h } from 'vue';
|
|
87711
87711
|
import './style.css';
|
|
87712
|
-
import extensions from './extensions.js';
|
|
87712
|
+
import extensions, { preloadExtensions } from './extensions.js';
|
|
87713
87713
|
export default {
|
|
87714
87714
|
extends: DefaultTheme,
|
|
87715
87715
|
Layout: {
|
|
@@ -87896,7 +87896,10 @@ export default {
|
|
|
87896
87896
|
// components that read isDark are mounted again for readers starting dark.
|
|
87897
87897
|
const startedDark = ref(false);
|
|
87898
87898
|
const custom = name => extensions[name]({ key: startedDark.value ? 'client' : 'prerender' });
|
|
87899
|
-
onMounted(() => {
|
|
87899
|
+
onMounted(() => {
|
|
87900
|
+
mounted.value = true;
|
|
87901
|
+
if (data.isDark.value) preloadExtensions().catch(() => {}).then(() => { startedDark.value = true; });
|
|
87902
|
+
});
|
|
87900
87903
|
const updatedLabel = computed(() => {
|
|
87901
87904
|
const value = data.frontmatter.value.contextUpdated || data.theme.value.contextUpdated;
|
|
87902
87905
|
if (!value) return '';
|
|
@@ -88430,6 +88433,7 @@ async function writeSiteExtensions(projectRoot, temporary, extensions) {
|
|
|
88430
88433
|
}
|
|
88431
88434
|
const imports = ["import { h, defineAsyncComponent, resolveComponent } from 'vue';"];
|
|
88432
88435
|
const slots = [];
|
|
88436
|
+
const remounted = [];
|
|
88433
88437
|
for (const [name3, path2] of Object.entries(extensions?.slots ?? {})) {
|
|
88434
88438
|
if (path2 === undefined)
|
|
88435
88439
|
continue;
|
|
@@ -88438,11 +88442,15 @@ async function writeSiteExtensions(projectRoot, temporary, extensions) {
|
|
|
88438
88442
|
continue;
|
|
88439
88443
|
}
|
|
88440
88444
|
imports.push(`const ${name3} = defineAsyncComponent(() => import(${JSON.stringify(`../../_site/${path2}`)}));`);
|
|
88445
|
+
if (name3 !== "floating")
|
|
88446
|
+
remounted.push(name3);
|
|
88441
88447
|
slots.push(`${JSON.stringify(name3)}: ${name3 === "floating" ? `() => h(resolveComponent('ClientOnly'), null, { default: () => h(${name3}) })` : `props => h(${name3}, props)`}`);
|
|
88442
88448
|
}
|
|
88449
|
+
const preload = `export const preloadExtensions = () => Promise.all([${remounted.map((name3) => `${name3}.__asyncLoader()`).join(",")}]);`;
|
|
88443
88450
|
await writeFile20(join70(temporary, ".vitepress/theme/extensions.js"), imports.join(`
|
|
88444
88451
|
`) + `
|
|
88445
88452
|
export default {${slots.join(",")}};
|
|
88453
|
+
${preload}
|
|
88446
88454
|
`);
|
|
88447
88455
|
for (const [key, path2] of Object.entries(extensions?.pages ?? {})) {
|
|
88448
88456
|
await mkdir25(join70(temporary, "custom"), { recursive: true });
|
|
@@ -89725,7 +89733,7 @@ function siteReaderLocales(site, packageName) {
|
|
|
89725
89733
|
translated: extra.length > 0,
|
|
89726
89734
|
labels: Object.fromEntries(tags.map((tag) => [tag, site.locales?.[tag]?.label ?? localeLabel(tag)])),
|
|
89727
89735
|
titles: Object.fromEntries(tags.map((tag) => [tag, (tag === primary ? undefined : site.locales?.[tag]?.title) ?? site.title ?? packageName])),
|
|
89728
|
-
preferenceKey: site.localePreferenceKey ??
|
|
89736
|
+
preferenceKey: site.localePreferenceKey ?? "context-locale"
|
|
89729
89737
|
};
|
|
89730
89738
|
}
|
|
89731
89739
|
function siteLocaleScript(locales) {
|
|
@@ -90183,18 +90191,18 @@ ${localized.body}`);
|
|
|
90183
90191
|
const navigation = siteNavigationConfig(options, mapping.pages);
|
|
90184
90192
|
const navText = ({ locales, ...item }) => ({ ...item, text: localizedHtml(readers.tags, (tag) => locales?.[tag] ?? item.text) });
|
|
90185
90193
|
const localeResources = Object.values(options.locales ?? {}).some((locale) => locale.home?.resources) ? Object.fromEntries(readers.tags.map((tag) => [tag, (tag === readers.primary ? undefined : options.locales?.[tag]?.home?.resources) ?? options.home?.resources ?? []])) : undefined;
|
|
90186
|
-
const appearanceKey =
|
|
90194
|
+
const appearanceKey = "context-theme";
|
|
90187
90195
|
const config = {
|
|
90188
90196
|
title: options.title ?? pkg.name,
|
|
90189
90197
|
description: options.description ?? "",
|
|
90190
90198
|
lang: readers.primary,
|
|
90191
90199
|
base,
|
|
90192
|
-
appearance: { initialValue: "
|
|
90200
|
+
appearance: { initialValue: "light", valueDark: "dark", valueLight: "light", storageKey: appearanceKey },
|
|
90193
90201
|
head: [
|
|
90194
90202
|
[
|
|
90195
90203
|
"script",
|
|
90196
90204
|
{ id: "context-appearance" },
|
|
90197
|
-
`(()=>{let v=null;try{v=localStorage.getItem(${JSON.stringify(appearanceKey)})}catch{}document.documentElement.classList.toggle("dark",v==="dark"
|
|
90205
|
+
`(()=>{let v=null;try{v=localStorage.getItem(${JSON.stringify(appearanceKey)})}catch{}document.documentElement.classList.toggle("dark",v==="dark")})();`
|
|
90198
90206
|
],
|
|
90199
90207
|
["script", { id: "context-locale" }, siteLocaleScript(readers)]
|
|
90200
90208
|
],
|
|
@@ -90384,7 +90392,7 @@ var init_packageSite2 = __esm(() => {
|
|
|
90384
90392
|
init_packageSiteExtensions();
|
|
90385
90393
|
init_packageDistributionMetadata();
|
|
90386
90394
|
init_packageSiteLocales();
|
|
90387
|
-
PACKAGE_SITE_VERSION = `vitepress-site-
|
|
90395
|
+
PACKAGE_SITE_VERSION = `vitepress-site-v50-light-shared-preferences:${createHash22("sha256").update(JSON.stringify([siteThemeVariables.toString(), siteMarkdownConfig, siteThemeCss, siteThemeScript, siteThemeLabels("zh"), siteThemeLabels("en")])).digest("hex")}`;
|
|
90388
90396
|
require2 = createRequire6(import.meta.url);
|
|
90389
90397
|
});
|
|
90390
90398
|
|
|
@@ -90409,25 +90417,6 @@ var init_workspaceBuildVersion = __esm(() => {
|
|
|
90409
90417
|
init_workspaceChangelog();
|
|
90410
90418
|
});
|
|
90411
90419
|
|
|
90412
|
-
// src/project/packageKnowledgeAdvisories.ts
|
|
90413
|
-
async function withPackageKnowledgeAdvisories(projectRoot, files) {
|
|
90414
|
-
const stale = new Set((await approvedKnowledgeDependencyWarnings(projectRoot)).filter((issue) => issue.code === "approved-source-region-changed").map((issue) => issue.path));
|
|
90415
|
-
return files.map((file) => {
|
|
90416
|
-
if (!stale.has(file.relPath))
|
|
90417
|
-
return file;
|
|
90418
|
-
const notice2 = `> **Source regions need review.** A cited source region changed or is unavailable. Recheck the linked sources before relying on this article.
|
|
90419
|
-
|
|
90420
|
-
`;
|
|
90421
|
-
const frontmatter = /^(---\r?\n[\s\S]*?\r?\n---(?:\r?\n|$))/u.exec(file.content)?.[0] ?? "";
|
|
90422
|
-
const body = file.content.slice(frontmatter.length);
|
|
90423
|
-
const title = /^(\s*# [^\r\n]+(?:\r?\n|$)\s*)/u.exec(body)?.[0] ?? "";
|
|
90424
|
-
return { ...file, content: `${frontmatter}${title}${notice2}${body.slice(title.length)}` };
|
|
90425
|
-
});
|
|
90426
|
-
}
|
|
90427
|
-
var init_packageKnowledgeAdvisories = __esm(() => {
|
|
90428
|
-
init_approvedKnowledgeDependencyWarnings();
|
|
90429
|
-
});
|
|
90430
|
-
|
|
90431
90420
|
// src/project/packageMarkdownAnchors.ts
|
|
90432
90421
|
import { posix as posix11 } from "node:path";
|
|
90433
90422
|
import { readFile as readFile64 } from "node:fs/promises";
|
|
@@ -90954,7 +90943,7 @@ async function removeOrphanPackageDirs(projectRoot, packages) {
|
|
|
90954
90943
|
}
|
|
90955
90944
|
async function collectPackageFreshness(projectRoot, packages) {
|
|
90956
90945
|
assertDistinctPackageOutputs(packages);
|
|
90957
|
-
const approved = await
|
|
90946
|
+
const approved = await listApprovedKnowledge(projectRoot);
|
|
90958
90947
|
return Promise.all(packages.map(async (pkg) => {
|
|
90959
90948
|
assertPackageOutputDir(pkg);
|
|
90960
90949
|
const selected = selectPackageKnowledge(approved, pkg);
|
|
@@ -91044,7 +91033,7 @@ async function buildProjectPackagesInternal(projectRoot, options) {
|
|
|
91044
91033
|
next: "Declare kbPackage() or llmsPackage() in src/index.ts, then rerun context build."
|
|
91045
91034
|
});
|
|
91046
91035
|
}
|
|
91047
|
-
const approved = await
|
|
91036
|
+
const approved = await listApprovedKnowledge(projectRoot);
|
|
91048
91037
|
const templateReviews = await inspectPackageTemplateReviews(projectRoot, packages);
|
|
91049
91038
|
const unresolvedTemplateReviews = templateReviews.filter((review) => review.state === "review-required" || review.state === "invalid");
|
|
91050
91039
|
if (unresolvedTemplateReviews.length > 0) {
|
|
@@ -91318,7 +91307,6 @@ var init_packageBuilder = __esm(() => {
|
|
|
91318
91307
|
init_packageSiteExtensions();
|
|
91319
91308
|
init_workspaceBuildVersion();
|
|
91320
91309
|
init_packageRenderCache();
|
|
91321
|
-
init_packageKnowledgeAdvisories();
|
|
91322
91310
|
init_packageKnowledgeMap();
|
|
91323
91311
|
init_packageMarkdownAnchors();
|
|
91324
91312
|
init_packageBuildStage();
|