MCPcopy
hub / github.com/anomalyco/opencode / matchesProjection

Function matchesProjection

packages/core/src/session/input.ts:204–214  ·  view source on GitHub ↗
(
  input: Admitted,
  expected: {
    readonly sessionID: SessionSchema.ID
    readonly prompt: Prompt
    readonly delivery: Delivery
    readonly timeCreated: DateTime.Utc
  },
)

Source from the content-addressed store, hash-verified

202 JSON.stringify(encodePrompt(input.prompt)) === JSON.stringify(encodePrompt(expected.prompt))
203
204const matchesProjection = (
205 input: Admitted,
206 expected: {
207 readonly sessionID: SessionSchema.ID
208 readonly prompt: Prompt
209 readonly delivery: Delivery
210 readonly timeCreated: DateTime.Utc
211 },
212) =>
213 equivalent(input, expected) &&
214 DateTime.toEpochMillis(input.timeCreated) === DateTime.toEpochMillis(expected.timeCreated)
215
216const publish = Effect.fn("SessionInput.publish")(function* (
217 db: DatabaseService,

Callers 1

input.tsFile · 0.85

Calls 1

equivalentFunction · 0.85

Tested by

no test coverage detected