The agent that grows with you
Python aiai-agentai-agentsanthropicchatgptclaudeclaude-codecodexhermeshermes-agentllmnous-researchopenai
fix(desktop): external-dir skills stay editable in place
Austin Pickett12429b2f30c4
diff --git a/apps/desktop/src/app/capabilities/skills/skill-detail.tsx b/apps/desktop/src/app/capabilities/skills/skill-detail.tsxindex 5235593e804..260b4c02c91 100644--- a/apps/desktop/src/app/capabilities/skills/skill-detail.tsx+++ b/apps/desktop/src/app/capabilities/skills/skill-detail.tsx@@ -8,6 +8,7 @@ import { useI18n } from '@/i18n'import type { SkillInfo } from '@/types/hermes'import { parseFrontmatter } from './frontmatter'+import { isEditableProvenance } from './skill-provenance'export function SkillDetail({onArchive,@@ -21,9 +22,9 @@ export function SkillDetail({skill: SkillInfo}) {const { t } = useI18n()- // Only learned/local skills are the user's to rewrite or archive — bundled- // and hub skills are managed by their sources.- const editable = skill.provenance === 'agent'+ // Origin only, never mutability: external mounts stay editable in place —+ // see ./skill-provenance (commit 8c8fc6c1ec).+ const editable = isEditableProvenance(skill.provenance)// The FULL skill — frontmatter metadata + complete SKILL.md body — for any// provenance, scoped to the Capabilities profile selector. The row list onlydiff --git a/apps/desktop/src/app/capabilities/skills/skill-provenance.test.ts b/apps/desktop/src/app/capabilities/skills/skill-provenance.test.tsnew file mode 100644index 00000000000..ad727f616a0--- /dev/null+++ b/apps/desktop/src/app/capabilities/skills/skill-provenance.test.ts@@ -0,0 +1,42 @@+import { describe, expect, it } from 'vitest'++import type { SkillInfo } from '@/types/hermes'++import { catalogSourceFor, isEditableProvenance } from './skill-provenance'++// #108032: externally mounted skills get an 'external' provenance tier — origin+// labeling without losing in-place edit rights (commit 8c8fc6c1ec / PR #17512).+describe('skill provenance tiers', () => {+ describe('catalogSourceFor', () => {+ it('maps every provenance tier to a distinct catalog source', () => {+ expect(catalogSourceFor('bundled')).toBe('built-in')+ expect(catalogSourceFor('hub')).toBe('hub')+ expect(catalogSourceFor('external')).toBe('external')+ expect(catalogSourceFor('agent')).toBe('local')+ })++ it('treats an absent provenance as local (older backends)', () => {+ expect(catalogSourceFor(undefined)).toBe('local')+ })+ })++ describe('isEditableProvenance', () => {+ it('keeps learned/local skills editable', () => {+ expect(isEditableProvenance('agent')).toBe(true)+ })++ it('keeps external mounts editable in place', () => {+ expect(isEditableProvenance('external')).toBe(true)+ })++ it('keeps bundled and hub skills managed by their sources', () => {+ expect(isEditableProvenance('bundled')).toBe(false)+ expect(isEditableProvenance('hub')).toBe(false)+ })++ it('treats an absent provenance as not editable (older backends predate edit rights)', () => {+ const skill: SkillInfo = { category: 'general', description: 'd', enabled: true, name: 'legacy' }+ expect(isEditableProvenance(skill.provenance)).toBe(false)+ })+ })+})diff --git a/apps/desktop/src/app/capabilities/skills/skill-provenance.ts b/apps/desktop/src/app/capabilities/skills/skill-provenance.tsnew file mode 100644index 00000000000..d82409cab02--- /dev/null+++ b/apps/desktop/src/app/capabilities/skills/skill-provenance.ts@@ -0,0 +1,31 @@+import type { SkillInfo } from '@/types/hermes'++/**+ * #108032: an external mount is not a managed hub/bundled source — it is the user's+ * own directory pointed at via skills.external_dirs. Origin only, never mutability:+ * external skills stay editable in place (a refusal would just breed silent local+ * duplicates — commit 8c8fc6c1ec / PR #17512).+ */++export function catalogSourceFor(provenance: SkillInfo['provenance']): 'built-in' | 'hub' | 'external' | 'local' {+ if (provenance === 'bundled') {+ return 'built-in'+ }++ if (provenance === 'hub') {+ return 'hub'+ }++ if (provenance === 'external') {+ return 'external'+ }++ return 'local'+}++export function isEditableProvenance(provenance: SkillInfo['provenance']): boolean {+ // Only learned/local skills are the user's to rewrite or archive — bundled and+ // hub skills are managed by their sources. External mounts stay editable in+ // place (the user pointed skills.external_dirs at them).+ return provenance === 'agent' || provenance === 'external'+}