(value: unknown)
| 447 | } |
| 448 | |
| 449 | function decodeQueryInput(value: unknown): SkillCatalogQueryInput { |
| 450 | const record = requireRecord(value, 'skill catalog query input'); |
| 451 | if (record.kind === 'start') { |
| 452 | const start = requireExactRecord(record, 'skill catalog start query', [ |
| 453 | 'kind', |
| 454 | 'context', |
| 455 | 'view', |
| 456 | ]); |
| 457 | return { |
| 458 | kind: 'start', |
| 459 | context: localContext(start.context), |
| 460 | view: catalogView(start.view), |
| 461 | }; |
| 462 | } |
| 463 | if (record.kind === 'continue') { |
| 464 | const continuation = requireExactRecord(record, 'skill catalog continuation query', [ |
| 465 | 'kind', |
| 466 | 'context', |
| 467 | 'view', |
| 468 | 'revision', |
| 469 | 'cursor', |
| 470 | ]); |
| 471 | return { |
| 472 | kind: 'continue', |
| 473 | context: localContext(continuation.context), |
| 474 | view: catalogView(continuation.view), |
| 475 | revision: sha256(continuation.revision, 'skill catalog revision'), |
| 476 | cursor: utf8String(continuation.cursor, 'skill catalog cursor', CURSOR_MAX_BYTES), |
| 477 | }; |
| 478 | } |
| 479 | throw invalidProtocolFrame('Invalid skill catalog query kind'); |
| 480 | } |
| 481 | |
| 482 | function decodeQueryResult(value: unknown): SkillCatalogQueryResult { |
| 483 | const record = requireRecord(value, 'skill catalog query result'); |
nothing calls this directly
no test coverage detected