The best way to control Claude Code, Codex and more from any computer or phone
| 1 | import type { ProviderDriverKind, ServerProvider } from "@t3tools/contracts"; |
| 2 | |
| 3 | import type { ProviderInstance } from "@t3tools/provider-core/server/driver"; |
| 4 | import type { ServerProviderDraft } from "@t3tools/provider-core/server/snapshotProbe"; |
| 5 | |
| 6 | export const withInstanceIdentity = |
| 7 | (input: { |
| 8 | readonly instanceId: ProviderInstance["instanceId"]; |
| 9 | readonly driverKind: ProviderDriverKind; |
| 10 | readonly displayName: string | undefined; |
| 11 | readonly accentColor: string | undefined; |
| 12 | readonly continuationGroupKey: string; |
| 13 | }) => |
| 14 | (snapshot: ServerProviderDraft): ServerProvider => ({ |
| 15 | ...snapshot, |
| 16 | instanceId: input.instanceId, |
| 17 | driver: input.driverKind, |
| 18 | ...(input.displayName ? { displayName: input.displayName } : {}), |
| 19 | ...(input.accentColor ? { accentColor: input.accentColor } : {}), |
| 20 | continuation: { groupKey: input.continuationGroupKey }, |
| 21 | }); |