Skip to content

armgit / cindy

Public Imported from GitHub
0

Consider it done. The open-source AI agent that works out of the box · 想到,就能做到。开源、开箱即用的 AI Agent。

fix(desktop): guard built-in skill projections

xd-bobo1286058ba4e3
diff --git a/apps/desktop/resources/system-skills/cindy-skill-creator/scripts/_frontmatter.py b/apps/desktop/resources/system-skills/cindy-skill-creator/scripts/_frontmatter.py
index 494e1f84ed..1e7204a006 100644
--- a/apps/desktop/resources/system-skills/cindy-skill-creator/scripts/_frontmatter.py
+++ b/apps/desktop/resources/system-skills/cindy-skill-creator/scripts/_frontmatter.py
@@ -16,6 +16,33 @@ TOP_LEVEL_FIELD_RE = re.compile(r"^([A-Za-z0-9_-]+)[ \t]*:[ \t]*(.*)$")
BLOCK_SCALAR_RE = re.compile(
r"^([|>])(?:(?:[+-]([1-9])?)|(?:([1-9])[+-]?))?(?:[ \t]+#.*|[ \t]*)$"
)
+YAML_INTEGER_RE = re.compile(
+ r"^[-+]?(?:"
+ r"0|"
+ r"0b[01_]*[01]|"
+ r"0x[0-9a-fA-F_]*[0-9a-fA-F]|"
+ r"0[0-7_]*[0-7]|"
+ r"[1-9](?:[0-9_]*[0-9])?|"
+ r"[1-9][0-9_]*(?::[0-5]?[0-9])+"
+ r")$"
+)
+YAML_FLOAT_RE = re.compile(
+ r"^(?:"
+ r"[-+]?(?:0|[1-9][0-9_]*)(?:\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|"
+ r"\.[0-9_]+(?:[eE][-+]?[0-9]+)?|"
+ r"[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*|"
+ r"[-+]?\.(?:inf|Inf|INF)|"
+ r"\.(?:nan|NaN|NAN)"
+ r")$"
+)
+YAML_TIMESTAMP_RE = re.compile(
+ r"^(?:"
+ r"[0-9]{4}-[0-9]{2}-[0-9]{2}|"
+ r"[0-9]{4}-[0-9]{1,2}-[0-9]{1,2}(?:[Tt]|[ \t]+)"
+ r"[0-9]{1,2}:[0-9]{2}:[0-9]{2}"
+ r"(?:\.[0-9]*)?(?:[ \t]*(?:Z|[-+][0-9]{1,2}(?::[0-9]{2})?))?"
+ r")$"
+)
def _block_indent_indicator(match):
@@ -204,10 +231,18 @@ def _parse_scalar(raw, in_flow=False):
return None
if lowered in {"true", "false"}:
return lowered == "true"
- if re.fullmatch(r"[-+]?(?:0|[1-9][0-9]*)", value):
- return int(value)
- if re.fullmatch(r"[-+]?(?:[0-9]+\.[0-9]*|[0-9]*\.[0-9]+)", value):
- return float(value)
+ # gray-matter currently uses js-yaml's default YAML 1.1 schema. Mirror its
+ # implicit numeric and timestamp resolvers so this dependency-free checker
+ # never certifies a plain name/description that the app later sees as a
+ # non-string. Quoting any of these spellings keeps it textual.
+ if YAML_INTEGER_RE.fullmatch(value):
+ return 0
+ if YAML_FLOAT_RE.fullmatch(value) and not value.endswith("_"):
+ return 0.0
+ if YAML_TIMESTAMP_RE.fullmatch(value):
+ raise FrontmatterError(
+ "Plain scalar resolves to a YAML timestamp and must be quoted"
+ )
if value.startswith(("[", "{")):
# The bundled tools only inspect scalar name/description values. Keep
# flow collection contents opaque while preserving the collection type,
diff --git a/apps/desktop/src/main/__tests__/authPassiveSharedInstance.test.ts b/apps/desktop/src/main/__tests__/authPassiveSharedInstance.test.ts
index dfeeb3a6f9..e240783ae4 100644
--- a/apps/desktop/src/main/__tests__/authPassiveSharedInstance.test.ts
+++ b/apps/desktop/src/main/__tests__/authPassiveSharedInstance.test.ts
@@ -30,6 +30,10 @@ describe('passive shared-userData instance auth isolation', () => {
resolve(process.cwd(), 'src/main/bootstrap-electron.ts'),
'utf8',
).replace(/\r\n/g, '\n');
+ const authAdapterSource = readFileSync(
+ resolve(process.cwd(), 'src/main/maker-host/auth-adapters.ts'),
+ 'utf8',
+ ).replace(/\r\n/g, '\n');
const sliceBody = (startAnchor: string, endAnchor: string): string => {
const start = authSource.indexOf(startAnchor);
@@ -231,6 +235,16 @@ describe('passive shared-userData instance auth isolation', () => {
'await desktopClaudeAuthAdapter.ensureSharedGlobalSkills();',
);
expect(bootstrapSource).not.toContain('await prepareSharedGlobalSkillLinks();');
+ expect(bootstrapSource).not.toContain('refreshBuiltInSharedSkillLinks');
+
+ const start = authAdapterSource.indexOf('private async runEnsureSharedGlobalSkills():');
+ const end = authAdapterSource.indexOf('\n async getState(', start);
+ const body = authAdapterSource.slice(start, end);
+ const ownerBoundary = body.indexOf('withSharedGlobalSkillProjectionMutation(ownerId');
+ expect(ownerBoundary).toBeGreaterThan(-1);
+ expect(body.indexOf('refreshBuiltInSharedSkillLinks({')).toBeGreaterThan(ownerBoundary);
+ expect(body.indexOf('prepareSharedGlobalSkillLinks({')).toBeGreaterThan(ownerBoundary);
+ expect(body.indexOf('refreshBuiltInClaudeSkillLinks({')).toBeGreaterThan(ownerBoundary);
});
it('relogin marker:passive 不消费整机一份的 marker,也不删 primary 的 token', () => {
diff --git a/apps/desktop/src/main/bootstrap-electron.ts b/apps/desktop/src/main/bootstrap-electron.ts
index 5968627276..95e9a87e12 100644
--- a/apps/desktop/src/main/bootstrap-electron.ts
+++ b/apps/desktop/src/main/bootstrap-electron.ts
@@ -8586,8 +8586,9 @@ app.on('ready', async () => {
await ensureMainAppPresence('app-ready');
// Cindy-owned Skills are packaged as immutable resources and copied into a
- // stable profile-independent path. The shared projection never replaces a user-owned
- // ~/.agents/skills/<name>, so a same-name user Skill keeps precedence.
+ // stable profile-independent path. Home-level projections happen only through
+ // ensureSharedGlobalSkills(), whose stable-owner boundary rejects passive instances;
+ // they never replace a same-name user Skill.
try {
const prepared = await prepareBuiltInSkills({
bundledRoot: resolveBundledSystemSkillsRoot({
diff --git a/apps/desktop/src/main/maker-host/__tests__/built-in-skills.test.ts b/apps/desktop/src/main/maker-host/__tests__/built-in-skills.test.ts
index 843d122018..36de879305 100644
--- a/apps/desktop/src/main/maker-host/__tests__/built-in-skills.test.ts
+++ b/apps/desktop/src/main/maker-host/__tests__/built-in-skills.test.ts
@@ -9,6 +9,7 @@ import {
markCindyBuiltInAgentSkills,
prepareBuiltInSkills,
refreshBuiltInClaudeSkillLinks,
+ refreshBuiltInSharedSkillLinks,
resolveBundledSystemSkillsRoot,
} from '../built-in-skills';
@@ -41,6 +42,31 @@ function fixture() {
return { bundledRoot, source, userDataDir, appDataDir, homeDir, withSharedMutation };
}
+async function prepareAndProjectBuiltInSkills(
+ input: ReturnType<typeof fixture> & { bundleVersion?: number },
+) {
+ const prepared = await prepareBuiltInSkills(input);
+ const shared = await refreshBuiltInSharedSkillLinks({
+ userDataDir: input.userDataDir,
+ appDataDir: input.appDataDir,
+ homeDir: input.homeDir,
+ descriptors: prepared.descriptors,
+ withSharedMutation: input.withSharedMutation,
+ });
+ const claude = await refreshBuiltInClaudeSkillLinks({
+ userDataDir: input.userDataDir,
+ appDataDir: input.appDataDir,
+ homeDir: input.homeDir,
+ descriptors: prepared.descriptors,
+ withSharedMutation: input.withSharedMutation,
+ });
+ return {
+ ...prepared,
+ changed: prepared.changed || shared.changed || claude.changed,
+ warnings: [...prepared.warnings, ...shared.warnings, ...claude.warnings],
+ };
+}
+
afterEach(() => {
for (const root of roots.splice(0)) fs.rmSync(root, { recursive: true, force: true });
});
@@ -48,7 +74,7 @@ afterEach(() => {
describe('built-in Skills', () => {
it('materializes versioned bytes at a stable path and exposes them through the shared root', async () => {
const input = fixture();
- const first = await prepareBuiltInSkills(input);
+ const first = await prepareAndProjectBuiltInSkills(input);
const descriptor = builtInSkillDescriptors(input.userDataDir, input.appDataDir)[0]!;
const link = path.join(input.homeDir, '.agents', 'skills', 'cindy-skill-creator');
expect(first.changed).toBe(true);
@@ -68,18 +94,18 @@ describe('built-in Skills', () => {
'# Learn',
);
- const second = await prepareBuiltInSkills(input);
+ const second = await prepareAndProjectBuiltInSkills(input);
expect(second.changed).toBe(false);
fs.writeFileSync(path.join(descriptor.absolutePath, 'SKILL.md'), '# Tampered\n');
- const repaired = await prepareBuiltInSkills(input);
+ const repaired = await prepareAndProjectBuiltInSkills(input);
expect(repaired.changed).toBe(true);
expect(fs.readFileSync(path.join(descriptor.absolutePath, 'SKILL.md'), 'utf8')).toContain(
'# Creator',
);
fs.appendFileSync(path.join(input.source, 'SKILL.md'), '\nUpdated\n');
- const updated = await prepareBuiltInSkills({ ...input, bundleVersion: 3 });
+ const updated = await prepareAndProjectBuiltInSkills({ ...input, bundleVersion: 4 });
expect(updated.changed).toBe(true);
expect(fs.readFileSync(path.join(descriptor.absolutePath, 'SKILL.md'), 'utf8')).toContain(
'Updated',
@@ -117,21 +143,21 @@ describe('built-in Skills', () => {
path.join(input.bundledRoot, 'learn', 'SKILL.md.missing'),
);
- const partial = await prepareBuiltInSkills({ ...input, bundleVersion: 3 });
+ const partial = await prepareBuiltInSkills({ ...input, bundleVersion: 4 });
const manifestPath = path.join(
path.dirname(partial.descriptors[0]!.absolutePath),
'.cindy-system-skills.json',
);
- expect(JSON.parse(fs.readFileSync(manifestPath, 'utf8')).bundleVersion).toBe(2);
+ expect(JSON.parse(fs.readFileSync(manifestPath, 'utf8')).bundleVersion).toBe(3);
expect(partial.warnings.join('\n')).toContain('missing SKILL.md');
fs.renameSync(
path.join(input.bundledRoot, 'learn', 'SKILL.md.missing'),
path.join(input.bundledRoot, 'learn', 'SKILL.md'),
);
- const retried = await prepareBuiltInSkills({ ...input, bundleVersion: 3 });
+ const retried = await prepareBuiltInSkills({ ...input, bundleVersion: 4 });
expect(retried.warnings).toEqual([]);
- expect(JSON.parse(fs.readFileSync(manifestPath, 'utf8')).bundleVersion).toBe(3);
+ expect(JSON.parse(fs.readFileSync(manifestPath, 'utf8')).bundleVersion).toBe(4);
expect(fs.readFileSync(path.join(
retried.descriptors.find((descriptor) => descriptor.name === 'learn')!.absolutePath,
'SKILL.md',
@@ -144,7 +170,7 @@ describe('built-in Skills', () => {
fs.mkdirSync(userSkill, { recursive: true });
fs.writeFileSync(path.join(userSkill, 'SKILL.md'), '# User copy\n');
- const result = await prepareBuiltInSkills(input);
+ const result = await prepareAndProjectBuiltInSkills(input);
expect(fs.readFileSync(path.join(userSkill, 'SKILL.md'), 'utf8')).toBe('# User copy\n');
expect(fs.existsSync(path.join(result.descriptors[0]!.absolutePath, 'SKILL.md'))).toBe(true);
expect(fs.realpathSync(result.descriptors[0]!.nativeClaudePath)).toBe(
@@ -155,12 +181,12 @@ describe('built-in Skills', () => {
it('keeps every profile on one stable shared copy', async () => {
const input = fixture();
- const first = await prepareBuiltInSkills(input);
+ const first = await prepareAndProjectBuiltInSkills(input);
const sharedDescriptor = first.descriptors[0]!;
const link = path.join(input.homeDir, '.agents', 'skills', 'cindy-skill-creator');
const nextUserDataDir = path.join(path.dirname(input.userDataDir), 'next-user-data');
- const next = await prepareBuiltInSkills({ ...input, userDataDir: nextUserDataDir });
+ const next = await prepareAndProjectBuiltInSkills({ ...input, userDataDir: nextUserDataDir });
const nextDescriptor = next.descriptors[0]!;
expect(next.warnings).toEqual([]);
@@ -178,7 +204,7 @@ describe('built-in Skills', () => {
fs.mkdirSync(path.dirname(link), { recursive: true });
fs.symlinkSync(oldTarget, link, process.platform === 'win32' ? 'junction' : 'dir');
- const result = await prepareBuiltInSkills(input);
+ const result = await prepareAndProjectBuiltInSkills(input);
expect(result.warnings).toEqual([]);
expect(fs.realpathSync(link)).toBe(fs.realpathSync(result.descriptors[0]!.absolutePath));
@@ -197,7 +223,21 @@ describe('built-in Skills', () => {
expect(fs.existsSync(path.join(input.homeDir, '.agents', 'skills', 'cindy-skill-creator'))).toBe(false);
});
- it('waits a bounded interval for another profile to finish its projection', async () => {
+ it('materializes app-owned bytes without mutating home-level discovery roots', async () => {
+ const input = fixture();
+ const result = await prepareBuiltInSkills(input);
+
+ expect(fs.existsSync(result.descriptors[0]!.absolutePath)).toBe(true);
+ expect(fs.existsSync(path.join(
+ input.homeDir,
+ '.agents',
+ 'skills',
+ 'cindy-skill-creator',
+ ))).toBe(false);
+ expect(fs.existsSync(result.descriptors[0]!.nativeClaudePath)).toBe(false);
+ });
+
+ it('waits a bounded interval for another profile to finish materialization', async () => {
const input = fixture();
let waitMs: number | undefined;
const result = await prepareBuiltInSkills({
@@ -222,7 +262,7 @@ describe('built-in Skills', () => {
fs.writeFileSync(path.join(userSource, 'SKILL.md'), '# User symlink copy\n');
fs.symlinkSync(userSource, userSkill, process.platform === 'win32' ? 'junction' : 'dir');
- const result = await prepareBuiltInSkills(input);
+ const result = await prepareAndProjectBuiltInSkills(input);
expect(fs.realpathSync(userSkill)).toBe(fs.realpathSync(userSource));
expect(result.warnings.join('\n')).toContain('already owned by the user');
@@ -234,7 +274,7 @@ describe('built-in Skills', () => {
fs.mkdirSync(descriptor.nativeClaudePath, { recursive: true });
fs.writeFileSync(path.join(descriptor.nativeClaudePath, 'SKILL.md'), '# Claude user copy\n');
- const result = await prepareBuiltInSkills(input);
+ const result = await prepareAndProjectBuiltInSkills(input);
expect(fs.readFileSync(path.join(descriptor.nativeClaudePath, 'SKILL.md'), 'utf8')).toBe(
'# Claude user copy\n',
);
@@ -243,7 +283,7 @@ describe('built-in Skills', () => {
it('refreshes the isolated Claude runtime when the palette winner changes', async () => {
const input = fixture();
- const first = await prepareBuiltInSkills(input);
+ const first = await prepareAndProjectBuiltInSkills(input);
const descriptor = first.descriptors.find((item) => item.name === 'learn')!;
const sharedSkill = path.join(input.homeDir, '.agents', 'skills', 'learn');
expect(fs.realpathSync(descriptor.nativeClaudePath)).toBe(fs.realpathSync(sharedSkill));
@@ -276,13 +316,7 @@ describe('built-in Skills', () => {
it('attests only commands backed by the materialized Cindy copy', async () => {
const input = fixture();
const { descriptors } = await prepareBuiltInSkills(input);
- const bundledLink = path.join(
- input.homeDir,
- '.agents',
- 'skills',
- 'cindy-skill-creator',
- 'SKILL.md',
- );
+ const bundledSkill = path.join(descriptors[0]!.absolutePath, 'SKILL.md');
const userCopy = path.join(input.homeDir, 'user-copy', 'SKILL.md');
fs.mkdirSync(path.dirname(userCopy), { recursive: true });
fs.writeFileSync(userCopy, '# User copy\n');
@@ -290,7 +324,7 @@ describe('built-in Skills', () => {
const [official, spoofed] = markCindyBuiltInAgentSkills([
{
kind: 'agent-skill', name: 'cindy-skill-creator', source: 'skill',
- path: bundledLink, scope: 'user', enabled: true,
+ path: bundledSkill, scope: 'user', enabled: true,
},
{
kind: 'agent-skill', name: 'cindy-skill-creator', source: 'skill',
diff --git a/apps/desktop/src/main/maker-host/__tests__/claudeAuthAdapterOAuthEnv.test.ts b/apps/desktop/src/main/maker-host/__tests__/claudeAuthAdapterOAuthEnv.test.ts
index 7d1caed5e7..43df2fcc50 100644
--- a/apps/desktop/src/main/maker-host/__tests__/claudeAuthAdapterOAuthEnv.test.ts
+++ b/apps/desktop/src/main/maker-host/__tests__/claudeAuthAdapterOAuthEnv.test.ts
@@ -110,6 +110,7 @@ vi.mock('../shared-global-skills.js', () => ({
}));
vi.mock('../built-in-skills.js', () => ({
+ refreshBuiltInSharedSkillLinks: async () => ({ warnings: [] }),
refreshBuiltInClaudeSkillLinks: async () => ({ warnings: [] }),
}));
diff --git a/apps/desktop/src/main/maker-host/auth-adapters.ts b/apps/desktop/src/main/maker-host/auth-adapters.ts
index 10e4569724..642ebf3a93 100644
--- a/apps/desktop/src/main/maker-host/auth-adapters.ts
+++ b/apps/desktop/src/main/maker-host/auth-adapters.ts
@@ -39,7 +39,10 @@ import { prepareCodexGlobalRulesCopy } from './codex-global-rules.js';
import { prepareCodexGlobalPluginsBridge } from './codex-global-plugins.js';
import { DESKTOP_CAPABILITY_ROUTING_POLICY } from './capability-routing.js';
import { prepareSharedGlobalSkillLinks } from './shared-global-skills.js';
-import { refreshBuiltInClaudeSkillLinks } from './built-in-skills.js';
+import {
+ refreshBuiltInClaudeSkillLinks,
+ refreshBuiltInSharedSkillLinks,
+} from './built-in-skills.js';
import {
copyCodexAuthSnapshot,
inspectCodexAuthLink,
@@ -601,6 +604,10 @@ export class DesktopClaudeAuthAdapter implements AuthAdapter {
try {
const ownerId = getActiveAppSession().dataOwnerId;
const result = await withSharedGlobalSkillProjectionMutation(ownerId, async () => {
+ const builtInSharedProjection = await refreshBuiltInSharedSkillLinks({
+ userDataDir: app.getPath('userData'),
+ appDataDir: app.getPath('appData'),
+ });
const sharedProjection = await prepareSharedGlobalSkillLinks({
assertOwnerStable: () => assertGhostSkillProjectionBoundaryStableForOwner(ownerId),
});
@@ -610,6 +617,7 @@ export class DesktopClaudeAuthAdapter implements AuthAdapter {
});
return {
warnings: [
+ ...builtInSharedProjection.warnings,
...sharedProjection.warnings,
...isolatedClaudeProjection.warnings,
],
diff --git a/apps/desktop/src/main/maker-host/built-in-skills.ts b/apps/desktop/src/main/maker-host/built-in-skills.ts
index e976de9645..04d81d23dd 100644
--- a/apps/desktop/src/main/maker-host/built-in-skills.ts
+++ b/apps/desktop/src/main/maker-host/built-in-skills.ts
@@ -18,7 +18,7 @@ const BUILT_IN_SKILL_NAMES = [BUILT_IN_SKILL_CREATOR_NAME, BUILT_IN_LEARN_SKILL_
const MANIFEST_FILE = '.cindy-system-skills.json';
const BUILT_IN_SKILL_MUTATION_WAIT_MS = 5_000;
/** Increment whenever shipped built-in Skill bytes change between releases. */
-export const BUILT_IN_SKILLS_BUNDLE_VERSION = 2;
+export const BUILT_IN_SKILLS_BUNDLE_VERSION = 3;
export interface BuiltInSkillDescriptor {
name: string;
@@ -30,7 +30,6 @@ export interface PrepareBuiltInSkillsOptions {
bundledRoot: string;
userDataDir: string;
appDataDir?: string;
- homeDir?: string;
bundleVersion?: number;
withSharedMutation?: typeof withSkillMutation;
}
@@ -49,11 +48,21 @@ export interface RefreshBuiltInClaudeSkillLinksOptions {
withSharedMutation?: typeof withSkillMutation;
}
+export interface RefreshBuiltInSharedSkillLinksOptions {
+ userDataDir: string;
+ appDataDir?: string;
+ homeDir?: string;
+ descriptors?: readonly BuiltInSkillDescriptor[];
+ withSharedMutation?: typeof withSkillMutation;
+}
+
export interface RefreshBuiltInClaudeSkillLinksResult {
changed: boolean;
warnings: string[];
}
+export type RefreshBuiltInSharedSkillLinksResult = RefreshBuiltInClaudeSkillLinksResult;
+
interface MaterializationManifest {
schemaVersion: 2;
bundleVersion: number;
@@ -310,6 +319,53 @@ async function ensureSharedEntry(
);
}
+async function refreshBuiltInSharedSkillLinksUnlocked(
+ options: Omit<RefreshBuiltInSharedSkillLinksOptions, 'withSharedMutation'>,
+): Promise<RefreshBuiltInSharedSkillLinksResult> {
+ const descriptors = options.descriptors
+ ?? builtInSkillDescriptors(options.userDataDir, options.appDataDir);
+ const homeDir = options.homeDir ?? os.homedir();
+ const warnings: string[] = [];
+ let changed = false;
+
+ for (const descriptor of descriptors) {
+ try {
+ const linked = await ensureSharedEntry(
+ descriptor,
+ homeDir,
+ options.userDataDir,
+ options.appDataDir,
+ );
+ changed = linked.changed || changed;
+ if (linked.warning) warnings.push(linked.warning);
+ } catch (error) {
+ warnings.push(
+ `could not expose built-in Skill ${descriptor.name}: ${error instanceof Error ? error.message : String(error)}`,
+ );
+ }
+ }
+
+ return { changed, warnings };
+}
+
+/** Refresh the home-level shared projection. Call only inside the stable owner boundary. */
+export async function refreshBuiltInSharedSkillLinks(
+ options: RefreshBuiltInSharedSkillLinksOptions,
+): Promise<RefreshBuiltInSharedSkillLinksResult> {
+ const descriptors = options.descriptors
+ ?? builtInSkillDescriptors(options.userDataDir, options.appDataDir);
+ const mutate = options.withSharedMutation ?? withSkillMutation;
+ const refreshed = await mutate(
+ descriptors.map((descriptor) => descriptor.name),
+ () => refreshBuiltInSharedSkillLinksUnlocked({ ...options, descriptors }),
+ { waitMs: BUILT_IN_SKILL_MUTATION_WAIT_MS },
+ );
+ return refreshed ?? {
+ changed: false,
+ warnings: ['could not expose built-in Skills because another Skill mutation is in progress'],
+ };
+}
+
function realPathOrNormalized(value: string): string {
try { return normalizeForCompare(fs.realpathSync.native(value)); }
catch { return normalizeForCompare(value); }
@@ -419,9 +475,8 @@ export async function refreshBuiltInClaudeSkillLinks(
}
/**
- * Materialize Cindy-owned Skill bytes under a profile-independent appData path, then expose
- * them through the shared ~/.agents discovery root and Cindy's isolated Claude
- * config directory without replacing user data.
+ * Materialize Cindy-owned Skill bytes under a profile-independent appData path.
+ * Home-level discovery links are refreshed separately inside the stable owner boundary.
*/
export async function prepareBuiltInSkills(
options: PrepareBuiltInSkillsOptions,
@@ -479,31 +534,8 @@ export async function prepareBuiltInSkills(
continue;
}
- try {
- const linked = await ensureSharedEntry(
- descriptor,
- options.homeDir ?? os.homedir(),
- options.userDataDir,
- options.appDataDir,
- );
- changed = linked.changed || changed;
- if (linked.warning) warnings.push(linked.warning);
- } catch (error) {
- warnings.push(
- `could not expose built-in Skill ${descriptor.name}: ${error instanceof Error ? error.message : String(error)}`,
- );
- }
}
- const claudeProjection = await refreshBuiltInClaudeSkillLinksUnlocked({
- userDataDir: options.userDataDir,
- appDataDir: options.appDataDir,
- homeDir: options.homeDir,
- descriptors,
- });
- changed = claudeProjection.changed || changed;
- warnings.push(...claudeProjection.warnings);
-
if (!newerBundleIsInstalled) {
if (bundleReady) manifest.bundleVersion = bundleVersion;
try {