MCPcopy Index your code
hub / github.com/anomalyco/opencode / constructor

Method constructor

packages/opencode/src/cli/cmd/run/footer.ts:235–354  ·  view source on GitHub ↗
(
    private renderer: CliRenderer,
    private options: RunFooterOptions,
  )

Source from the content-addressed store, hash-verified

233 }
234
235 constructor(
236 private renderer: CliRenderer,
237 private options: RunFooterOptions,
238 ) {
239 const [state, setState] = createSignal<FooterState>({
240 phase: "idle",
241 status: "",
242 queue: 0,
243 model: options.modelLabel,
244 duration: "",
245 usage: "",
246 first: options.first,
247 interrupt: 0,
248 exit: 0,
249 })
250 this.state = state
251 this.setState = setState
252 const [view, setView] = createSignal<FooterView>({ type: "prompt" })
253 this.view = view
254 this.setView = setView
255 const [agents, setAgents] = createSignal(options.agents)
256 this.agents = agents
257 this.setAgents = setAgents
258 const [resources, setResources] = createSignal(options.resources)
259 this.resources = resources
260 this.setResources = setResources
261 const [commands, setCommands] = createSignal<RunCommand[] | undefined>(options.commands)
262 this.commands = commands
263 this.setCommands = setCommands
264 const [providers, setProviders] = createSignal<RunProvider[] | undefined>()
265 this.providers = providers
266 this.setProviders = setProviders
267 const [currentModel, setCurrentModel] = createSignal<RunInput["model"]>(options.model)
268 this.currentModel = currentModel
269 this.setCurrentModel = setCurrentModel
270 const [variants, setVariants] = createSignal<string[]>([])
271 this.variants = variants
272 this.setVariants = setVariants
273 const [currentVariant, setCurrentVariant] = createSignal(options.variant)
274 this.currentVariant = currentVariant
275 this.setCurrentVariant = setCurrentVariant
276 const [theme, setTheme] = createSignal(options.theme)
277 this.theme = theme
278 this.setTheme = setTheme
279 this.themes = [options.theme]
280 const [subagent, setSubagent] = createStore<FooterSubagentState>(createEmptySubagentState())
281 this.subagent = () => subagent
282 this.setSubagent = (next) => {
283 setSubagent("tabs", reconcile(next.tabs, { key: "sessionID" }))
284 setSubagent("details", reconcile(next.details))
285 setSubagent("permissions", reconcile(next.permissions, { key: "id" }))
286 setSubagent("questions", reconcile(next.questions, { key: "id" }))
287 }
288 const [queuedPrompts, setQueuedPrompts] = createSignal<FooterQueuedPrompt[]>([])
289 this.queuedPrompts = queuedPrompts
290 this.setQueuedPrompts = setQueuedPrompts
291 this.base = Math.max(1, renderer.footerHeight - TEXTAREA_MIN_ROWS)
292 this.scrollback = this.createScrollback(options.wrote ?? false)

Callers

nothing calls this directly

Calls 6

createScrollbackMethod · 0.95
closeMethod · 0.95
createEmptySubagentStateFunction · 0.85
onMethod · 0.80
reconcileFunction · 0.50
renderFunction · 0.50

Tested by

no test coverage detected