feat(ui): add instructions file path field to adapter config forms
Add agent instructions file field to Claude and Codex adapter config panels, allowing users to specify an absolute path to an AGENTS.md-style file injected into the system prompt at runtime. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -10,8 +10,40 @@ import {
|
|||||||
const inputClass =
|
const inputClass =
|
||||||
"w-full rounded-md border border-border px-2.5 py-1.5 bg-transparent outline-none text-sm font-mono placeholder:text-muted-foreground/40";
|
"w-full rounded-md border border-border px-2.5 py-1.5 bg-transparent outline-none text-sm font-mono placeholder:text-muted-foreground/40";
|
||||||
|
|
||||||
export function ClaudeLocalConfigFields(_props: AdapterConfigFieldsProps) {
|
const instructionsFileHint =
|
||||||
return null;
|
"Absolute path to a markdown file (e.g. AGENTS.md) that defines this agent's behavior. Injected into the system prompt at runtime.";
|
||||||
|
|
||||||
|
export function ClaudeLocalConfigFields({
|
||||||
|
isCreate,
|
||||||
|
values,
|
||||||
|
set,
|
||||||
|
config,
|
||||||
|
eff,
|
||||||
|
mark,
|
||||||
|
}: AdapterConfigFieldsProps) {
|
||||||
|
return (
|
||||||
|
<Field label="Agent instructions file" hint={instructionsFileHint}>
|
||||||
|
<DraftInput
|
||||||
|
value={
|
||||||
|
isCreate
|
||||||
|
? values!.instructionsFilePath ?? ""
|
||||||
|
: eff(
|
||||||
|
"adapterConfig",
|
||||||
|
"instructionsFilePath",
|
||||||
|
String(config.instructionsFilePath ?? ""),
|
||||||
|
)
|
||||||
|
}
|
||||||
|
onCommit={(v) =>
|
||||||
|
isCreate
|
||||||
|
? set!({ instructionsFilePath: v })
|
||||||
|
: mark("adapterConfig", "instructionsFilePath", v || undefined)
|
||||||
|
}
|
||||||
|
immediate
|
||||||
|
className={inputClass}
|
||||||
|
placeholder="/absolute/path/to/AGENTS.md"
|
||||||
|
/>
|
||||||
|
</Field>
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
export function ClaudeLocalAdvancedFields({
|
export function ClaudeLocalAdvancedFields({
|
||||||
|
|||||||
@@ -1,9 +1,16 @@
|
|||||||
import type { AdapterConfigFieldsProps } from "../types";
|
import type { AdapterConfigFieldsProps } from "../types";
|
||||||
import {
|
import {
|
||||||
|
Field,
|
||||||
ToggleField,
|
ToggleField,
|
||||||
|
DraftInput,
|
||||||
help,
|
help,
|
||||||
} from "../../components/agent-config-primitives";
|
} from "../../components/agent-config-primitives";
|
||||||
|
|
||||||
|
const inputClass =
|
||||||
|
"w-full rounded-md border border-border px-2.5 py-1.5 bg-transparent outline-none text-sm font-mono placeholder:text-muted-foreground/40";
|
||||||
|
const instructionsFileHint =
|
||||||
|
"Absolute path to a markdown file (e.g. AGENTS.md) that defines this agent's behavior. Injected into the system prompt at runtime.";
|
||||||
|
|
||||||
export function CodexLocalConfigFields({
|
export function CodexLocalConfigFields({
|
||||||
isCreate,
|
isCreate,
|
||||||
values,
|
values,
|
||||||
@@ -17,6 +24,27 @@ export function CodexLocalConfigFields({
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
|
<Field label="Agent instructions file" hint={instructionsFileHint}>
|
||||||
|
<DraftInput
|
||||||
|
value={
|
||||||
|
isCreate
|
||||||
|
? values!.instructionsFilePath ?? ""
|
||||||
|
: eff(
|
||||||
|
"adapterConfig",
|
||||||
|
"instructionsFilePath",
|
||||||
|
String(config.instructionsFilePath ?? ""),
|
||||||
|
)
|
||||||
|
}
|
||||||
|
onCommit={(v) =>
|
||||||
|
isCreate
|
||||||
|
? set!({ instructionsFilePath: v })
|
||||||
|
: mark("adapterConfig", "instructionsFilePath", v || undefined)
|
||||||
|
}
|
||||||
|
immediate
|
||||||
|
className={inputClass}
|
||||||
|
placeholder="/absolute/path/to/AGENTS.md"
|
||||||
|
/>
|
||||||
|
</Field>
|
||||||
<ToggleField
|
<ToggleField
|
||||||
label="Bypass sandbox"
|
label="Bypass sandbox"
|
||||||
hint={help.dangerouslyBypassSandbox}
|
hint={help.dangerouslyBypassSandbox}
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ import type { CreateConfigValues } from "@paperclip/adapter-utils";
|
|||||||
export const defaultCreateValues: CreateConfigValues = {
|
export const defaultCreateValues: CreateConfigValues = {
|
||||||
adapterType: "claude_local",
|
adapterType: "claude_local",
|
||||||
cwd: "",
|
cwd: "",
|
||||||
|
instructionsFilePath: "",
|
||||||
promptTemplate: "",
|
promptTemplate: "",
|
||||||
model: "",
|
model: "",
|
||||||
thinkingEffort: "",
|
thinkingEffort: "",
|
||||||
|
|||||||
Reference in New Issue
Block a user