MCPcopy Create free account
hub / github.com/anomalyco/opencode / syncDraft

Function syncDraft

packages/opencode/src/cli/cmd/run/footer.prompt.tsx:719–737  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

717 }
718
719 const syncDraft = () => {
720 if (!area || area.isDestroyed) {
721 return
722 }
723
724 syncParts()
725 const command = shell() ? undefined : selectedCommand(area.plainText, draft.command)
726 draft = shell()
727 ? {
728 text: area.plainText,
729 parts: structuredClone(parts),
730 mode: "shell",
731 }
732 : {
733 text: area.plainText,
734 parts: structuredClone(parts),
735 ...(command ? { command } : {}),
736 }
737 }
738
739 const push = (value: RunPrompt) => {
740 history = pushPromptHistory(history, value)

Callers 6

cancelAutocompleteFunction · 0.85
openEditorFunction · 0.85
selectFunction · 0.85
expandFunction · 0.85
onSubmitFunction · 0.85
createPromptStateFunction · 0.85

Calls 3

syncPartsFunction · 0.85
shellFunction · 0.85
selectedCommandFunction · 0.85

Tested by

no test coverage detected