演示目录只保留可重建的源码。运行密钥、数据卷、依赖和带口令的本地配置不进入仓库。 Co-authored-by: Cursor <cursoragent@cursor.com>
17 lines
506 B
TypeScript
17 lines
506 B
TypeScript
import type { DraftFieldUpdate } from './utils'
|
|
import { atom } from 'jotai'
|
|
import { agentComposerDraftAtom } from '../store'
|
|
import { resolveDraftFieldUpdate } from './utils'
|
|
|
|
export const agentComposerPromptAtom = atom(
|
|
(get) => get(agentComposerDraftAtom).prompt,
|
|
(get, set, promptUpdate: DraftFieldUpdate<string>) => {
|
|
const draft = get(agentComposerDraftAtom)
|
|
|
|
set(agentComposerDraftAtom, {
|
|
...draft,
|
|
prompt: resolveDraftFieldUpdate(draft.prompt, promptUpdate),
|
|
})
|
|
},
|
|
)
|