MCPcopy Create free account
hub / github.com/apache/maka / decodePrefixIdentity

Function decodePrefixIdentity

packages/core/src/runtime-boundary.ts:364–381  ·  view source on GitHub ↗
(value: unknown)

Source from the content-addressed store, hash-verified

362}
363
364function decodePrefixIdentity(value: unknown): RuntimePrefixIdentityV1 {
365 if (
366 !isRecord(value) ||
367 !hasExactKeys(value, ['sessionId', 'invocationId', 'runId', 'turnId']) ||
368 !isNonEmptyString(value.sessionId) ||
369 !isNonEmptyString(value.invocationId) ||
370 !isNonEmptyString(value.runId) ||
371 !isNonEmptyString(value.turnId)
372 ) {
373 throw new Error('Invalid RuntimeEvent prefix identity');
374 }
375 return {
376 sessionId: value.sessionId,
377 invocationId: value.invocationId,
378 runId: value.runId,
379 turnId: value.turnId,
380 };
381}
382
383function decodePrefixPosition(value: unknown): RuntimePrefixPositionV1 {
384 if (

Callers 2

canonicalizePrefixRowsFunction · 0.85

Calls 3

isRecordFunction · 0.90
hasExactKeysFunction · 0.70
isNonEmptyStringFunction · 0.70

Tested by

no test coverage detected