| 74 | } |
| 75 | |
| 76 | func New() *Host { |
| 77 | h := &Host{ |
| 78 | loader: defaultPluginLoader(), |
| 79 | loaded: make(map[string]*loadedPlugin), |
| 80 | retired: make(map[string][]*loadedPlugin), |
| 81 | loading: make(map[string]struct{}), |
| 82 | fused: make(map[string]string), |
| 83 | pluginFileVersions: make(map[string]string), |
| 84 | activePluginVersions: make(map[string]string), |
| 85 | activePluginPaths: make(map[string]string), |
| 86 | cleanupFilesPending: true, |
| 87 | modelClientIDs: make(map[string]struct{}), |
| 88 | executorModelClientIDs: make(map[string]struct{}), |
| 89 | modelProviders: make(map[string]string), |
| 90 | modelRegistrations: make(map[string]pluginModelRegistration), |
| 91 | providerModels: make(map[string][]*registryModelInfo), |
| 92 | executorProviders: make(map[string]struct{}), |
| 93 | accessProviderKeys: make(map[string]struct{}), |
| 94 | commandLineFlags: make(map[string]commandLineFlagRecord), |
| 95 | commandLineHits: make(map[string]struct{}), |
| 96 | managementRoutes: make(map[string]managementRouteRecord), |
| 97 | resourceRoutes: make(map[string]resourceRouteRecord), |
| 98 | streams: newStreamBridge(), |
| 99 | httpStreams: newHostHTTPStreamBridge(), |
| 100 | modelStreams: newModelStreamBridge(), |
| 101 | callbackContexts: newCallbackContextRegistry(), |
| 102 | } |
| 103 | h.snapshot.Store(emptySnapshot()) |
| 104 | return h |
| 105 | } |
| 106 | |
| 107 | func NewForTest(loader pluginLoader) *Host { |
| 108 | h := New() |