fix(settings): clarify skill inventory state
This commit is contained in:
6 files changed
+24
-25
No files matched your search
@@ -49,7 +49,6 @@ const readSkillInstallations = Effect.fn("SkillInventory.readSkillInstallations"
|
||||
directoryPath: path.dirname(skill.path),
|
||||
skillFilePath: skill.path,
|
||||
content,
|
||||
enabled: skill.enabled,
|
||||
})),
|
||||
),
|
||||
);
|
||||
|
||||
@@ -22,7 +22,6 @@ const inventory: SkillInventory = {
|
||||
directoryPath: "/home/test/.codex/skills/review",
|
||||
skillFilePath: "/home/test/.codex/skills/review/SKILL.md",
|
||||
content: "---\nname: review\n---\n\n# Review",
|
||||
enabled: true,
|
||||
},
|
||||
{
|
||||
providerInstanceId: ProviderInstanceId.make("claude"),
|
||||
@@ -32,7 +31,6 @@ const inventory: SkillInventory = {
|
||||
directoryPath: "/home/test/.claude/skills/deploy",
|
||||
skillFilePath: "/home/test/.claude/skills/deploy/SKILL.md",
|
||||
content: "---\nname: deploy\n---\n\n# Deploy",
|
||||
enabled: true,
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
@@ -156,15 +156,16 @@ function EnvironmentSkillInventory({
|
||||
[query, state],
|
||||
);
|
||||
const isConnected = Option.isSome(prepared);
|
||||
const skillCount = displayedSkillCount(visibleInventory, isConnected);
|
||||
const skillCount = displayedSkillCount(
|
||||
state.status === "loaded" ? state.inventory : null,
|
||||
isConnected,
|
||||
);
|
||||
const phase = environment.connection.phase;
|
||||
const isSearching = query.trim().length > 0;
|
||||
const open = !collapsed;
|
||||
|
||||
// Searching would otherwise hide its own matches inside collapsed sections.
|
||||
useEffect(() => {
|
||||
if (isSearching) setCollapsed(false);
|
||||
}, [isSearching]);
|
||||
const open = isSearching || !collapsed;
|
||||
const setOpen = (nextOpen: boolean) => {
|
||||
if (!isSearching) setCollapsed(!nextOpen);
|
||||
};
|
||||
|
||||
return (
|
||||
<section>
|
||||
@@ -177,7 +178,7 @@ function EnvironmentSkillInventory({
|
||||
aria-expanded={open}
|
||||
// The panel unmounts while closed, so only reference it when open.
|
||||
aria-controls={open ? panelId : undefined}
|
||||
onClick={() => setCollapsed((value) => !value)}
|
||||
onClick={() => setOpen(!open)}
|
||||
className="flex min-w-0 flex-1 cursor-pointer items-center gap-2 rounded-lg py-2 pl-3 text-left transition-colors hover:bg-muted/25 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-inset sm:pl-4"
|
||||
>
|
||||
<DisclosureChevron open={open} />
|
||||
@@ -202,7 +203,7 @@ function EnvironmentSkillInventory({
|
||||
) : null}
|
||||
</div>
|
||||
|
||||
<Collapsible open={open} onOpenChange={(next) => setCollapsed(!next)}>
|
||||
<Collapsible open={open} onOpenChange={setOpen}>
|
||||
<CollapsibleContent id={panelId}>
|
||||
<div className="pb-2">
|
||||
{Option.isNone(prepared) ? (
|
||||
@@ -237,11 +238,6 @@ function SkillHarnessGroups({
|
||||
);
|
||||
const groups = useMemo(() => groupSkillsByHarness(inventory.installations), [inventory]);
|
||||
|
||||
// Searching would otherwise hide its own matches inside collapsed harnesses.
|
||||
useEffect(() => {
|
||||
if (isSearching) setCollapsedHarnesses(new Set());
|
||||
}, [isSearching]);
|
||||
|
||||
return groups.map((group) => (
|
||||
<SkillHarnessGroup
|
||||
key={group.key}
|
||||
@@ -249,10 +245,12 @@ function SkillHarnessGroups({
|
||||
harness={group.harness}
|
||||
rootPath={group.rootPath}
|
||||
skills={group.skills}
|
||||
open={!collapsedHarnesses.has(group.key)}
|
||||
onOpenChange={(nextOpen) =>
|
||||
setCollapsedHarnesses((keys) => setKeyCollapsed(keys, group.key, !nextOpen))
|
||||
}
|
||||
open={isSearching || !collapsedHarnesses.has(group.key)}
|
||||
onOpenChange={(nextOpen) => {
|
||||
if (!isSearching) {
|
||||
setCollapsedHarnesses((keys) => setKeyCollapsed(keys, group.key, !nextOpen));
|
||||
}
|
||||
}}
|
||||
/>
|
||||
));
|
||||
}
|
||||
|
||||
@@ -445,7 +445,7 @@
|
||||
<td>Codex skills</td>
|
||||
<td class="yes">
|
||||
The server calls Codex app-server <code>skills/list</code> and maps name, path,
|
||||
scope, enabled, and presentation metadata.
|
||||
scope, and authoritative enablement when the harness exposes it.
|
||||
</td>
|
||||
<td>
|
||||
Reuse parsing knowledge, but inventory independently of a session cwd and configured
|
||||
|
||||
@@ -24,13 +24,13 @@ export function formatSkillPath(path: string): string {
|
||||
}
|
||||
|
||||
export function filterSkillInventory(inventory: SkillInventory, query: string): SkillInventory {
|
||||
const normalizedQuery = query.trim().toLocaleLowerCase();
|
||||
const normalizedQuery = query.trim().toLowerCase();
|
||||
if (!normalizedQuery) return inventory;
|
||||
return {
|
||||
...inventory,
|
||||
installations: inventory.installations.filter((skill) =>
|
||||
[skill.name, skill.description ?? "", skill.directoryPath, skill.harnessDisplayName].some(
|
||||
(value) => value.toLocaleLowerCase().includes(normalizedQuery),
|
||||
(value) => value.toLowerCase().includes(normalizedQuery),
|
||||
),
|
||||
),
|
||||
};
|
||||
|
||||
@@ -3,6 +3,11 @@ import * as Schema from "effect/Schema";
|
||||
import { TrimmedNonEmptyString } from "./baseSchemas.ts";
|
||||
import { ProviderDriverKind, ProviderInstanceId } from "./providerInstance.ts";
|
||||
|
||||
/**
|
||||
* Filesystem inventory intentionally omits per-skill enablement. Codex only
|
||||
* exposes that state through its live RPC, while Claude has no equivalent,
|
||||
* so persisting it here would make the cross-harness response misleading.
|
||||
*/
|
||||
export const SkillInventoryInstallation = Schema.Struct({
|
||||
providerInstanceId: ProviderInstanceId,
|
||||
harness: ProviderDriverKind,
|
||||
@@ -12,7 +17,6 @@ export const SkillInventoryInstallation = Schema.Struct({
|
||||
directoryPath: TrimmedNonEmptyString,
|
||||
skillFilePath: TrimmedNonEmptyString,
|
||||
content: Schema.String,
|
||||
enabled: Schema.Boolean,
|
||||
});
|
||||
export type SkillInventoryInstallation = typeof SkillInventoryInstallation.Type;
|
||||
|
||||
|
||||
Reference in new issue
Block a user