| 1 | import { createHubEnvironmentCapabilitiesAtom } from "@t3tools/client-runtime/state/hub"; |
| 2 | import { hubConnection } from "../connection/hub"; |
| 3 | import { createServerEnvironmentAtoms } from "@t3tools/client-runtime/state/server"; |
| 4 | import { createEnvironmentServerConfigsAtom } from "@t3tools/client-runtime/state/shell"; |
| 5 | |
| 6 | import { environmentCatalog } from "../connection/catalog"; |
| 7 | import { connectionAtomRuntime } from "../connection/runtime"; |
| 8 | import { environmentSession } from "./session"; |
| 9 | import { createThreadListEnvironmentsAtom } from "./thread-list-environments"; |
| 10 | |
| 11 | export const serverEnvironment = createServerEnvironmentAtoms(connectionAtomRuntime, { |
| 12 | initialConfigValueAtom: environmentSession.initialConfigValueAtom, |
| 13 | usageLimitSources: true, |
| 14 | usageLimitsCommand: true, |
| 15 | }); |
| 16 | export const environmentServerConfigsAtom = createEnvironmentServerConfigsAtom({ |
| 17 | catalogValueAtom: environmentCatalog.catalogValueAtom, |
| 18 | serverConfigValueAtom: serverEnvironment.configValueAtom, |
| 19 | }); |
| 20 | export const environmentCapabilitiesAtom = createHubEnvironmentCapabilitiesAtom( |
| 21 | environmentServerConfigsAtom, |
| 22 | hubConnection, |
| 23 | ); |
| 24 | |
| 25 | export const threadListEnvironmentsAtom = createThreadListEnvironmentsAtom( |
| 26 | environmentServerConfigsAtom, |
| 27 | environmentCapabilitiesAtom, |
| 28 | ); |