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

Function createMeta

packages/opencode/src/plugin/tui/runtime.ts:312–339  ·  view source on GitHub ↗
(
  source: PluginLoad["source"],
  spec: string,
  target: string,
  meta: { state: PluginMeta.State; entry: PluginMeta.Entry } | undefined,
  id?: string,
)

Source from the content-addressed store, hash-verified

310}
311
312function createMeta(
313 source: PluginLoad["source"],
314 spec: string,
315 target: string,
316 meta: { state: PluginMeta.State; entry: PluginMeta.Entry } | undefined,
317 id?: string,
318): TuiPluginMeta {
319 if (meta) {
320 return {
321 state: meta.state,
322 ...meta.entry,
323 }
324 }
325
326 const now = Date.now()
327 return {
328 state: source === "internal" ? "same" : "first",
329 id: id ?? spec,
330 source,
331 spec,
332 target,
333 first_time: now,
334 last_time: now,
335 time_changed: now,
336 load_count: 1,
337 fingerprint: target,
338 }
339}
340
341function loadInternalPlugin(item: InternalTuiPlugin): PluginLoad {
342 const spec = item.id

Callers 2

addExternalPluginEntriesFunction · 0.85
loadFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected