( final: ContinueConfig, ide: IDE, )
| 623 | } |
| 624 | |
| 625 | async function finalToBrowserConfig( |
| 626 | final: ContinueConfig, |
| 627 | ide: IDE, |
| 628 | ): Promise<BrowserSerializedContinueConfig> { |
| 629 | return { |
| 630 | allowAnonymousTelemetry: final.allowAnonymousTelemetry, |
| 631 | completionOptions: final.completionOptions, |
| 632 | slashCommands: final.slashCommands?.map(({ run, ...rest }) => ({ |
| 633 | ...rest, |
| 634 | isLegacy: !!run, |
| 635 | })), |
| 636 | contextProviders: final.contextProviders?.map((c) => c.description), |
| 637 | disableIndexing: final.disableIndexing, |
| 638 | disableSessionTitles: final.disableSessionTitles, |
| 639 | userToken: final.userToken, |
| 640 | ui: final.ui, |
| 641 | experimental: final.experimental, |
| 642 | rules: final.rules, |
| 643 | docs: final.docs, |
| 644 | tools: final.tools.map(serializeTool), |
| 645 | mcpServerStatuses: final.mcpServerStatuses, |
| 646 | tabAutocompleteOptions: final.tabAutocompleteOptions, |
| 647 | modelsByRole: Object.fromEntries( |
| 648 | Object.entries(final.modelsByRole).map(([k, v]) => [ |
| 649 | k, |
| 650 | v.map(llmToSerializedModelDescription), |
| 651 | ]), |
| 652 | ) as Record<ModelRole, ModelDescription[]>, // TODO better types here |
| 653 | selectedModelByRole: Object.fromEntries( |
| 654 | Object.entries(final.selectedModelByRole).map(([k, v]) => [ |
| 655 | k, |
| 656 | v ? llmToSerializedModelDescription(v) : null, |
| 657 | ]), |
| 658 | ) as Record<ModelRole, ModelDescription | null>, // TODO better types here |
| 659 | // data not included here because client doesn't need |
| 660 | }; |
| 661 | } |
| 662 | |
| 663 | function escapeSpacesInPath(p: string): string { |
| 664 | return p.replace(/ /g, "\\ "); |
no test coverage detected