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

Function next

packages/opencode/src/plugin/meta.ts:124–140  ·  view source on GitHub ↗
(prev: Entry | undefined, core: Core, now: number)

Source from the content-addressed store, hash-verified

122}
123
124function next(prev: Entry | undefined, core: Core, now: number): { state: State; entry: Entry } {
125 const entry: Entry = {
126 ...core,
127 first_time: prev?.first_time ?? now,
128 last_time: now,
129 time_changed: prev?.time_changed ?? now,
130 load_count: (prev?.load_count ?? 0) + 1,
131 fingerprint: fingerprint(core),
132 themes: prev?.themes,
133 }
134 const state: State = !prev ? "first" : prev.fingerprint === entry.fingerprint ? "same" : "updated"
135 if (state === "updated") entry.time_changed = now
136 return {
137 state,
138 entry,
139 }
140}
141
142export async function touchMany(items: Touch[]): Promise<Array<{ state: State; entry: Entry }>> {
143 if (!items.length) return []

Callers 2

touchManyFunction · 0.70
middleware.tsFile · 0.50

Calls 1

fingerprintFunction · 0.85

Tested by

no test coverage detected