MCPcopy Create free account
hub / github.com/Noumena-Network/code / getRestoreOptions

Function getRestoreOptions

src/components/MessageSelector.tsx:94–135  ·  view source on GitHub ↗
(canRestoreCode: boolean)

Source from the content-addressed store, hash-verified

92
93 // Generate options with summarize as input type for inline context
94 function getRestoreOptions(canRestoreCode: boolean): OptionWithDescription<RestoreOption>[] {
95 const baseOptions: OptionWithDescription<RestoreOption>[] = canRestoreCode ? [{
96 value: 'both',
97 label: 'Restore code and conversation'
98 }, {
99 value: 'conversation',
100 label: 'Restore conversation'
101 }, {
102 value: 'code',
103 label: 'Restore code'
104 }] : [{
105 value: 'conversation',
106 label: 'Restore conversation'
107 }];
108 const summarizeInputProps = {
109 type: 'input' as const,
110 placeholder: 'add context (optional)',
111 initialValue: '',
112 allowEmptySubmitToCancel: true,
113 showLabelWithValue: true,
114 labelValueSeparator: ': '
115 };
116 baseOptions.push({
117 value: 'summarize',
118 label: 'Summarize from here',
119 ...summarizeInputProps,
120 onChange: setSummarizeFromFeedback
121 });
122 if (isInternalBuild()) {
123 baseOptions.push({
124 value: 'summarize_up_to',
125 label: 'Summarize up to here',
126 ...summarizeInputProps,
127 onChange: setSummarizeUpToFeedback
128 });
129 }
130 baseOptions.push({
131 value: 'nevermind',
132 label: 'Never mind'
133 });
134 return baseOptions;
135 }
136
137 // Log when selector is opened
138 useEffect(() => {

Callers 1

MessageSelectorFunction · 0.85

Calls 1

isInternalBuildFunction · 0.85

Tested by

no test coverage detected