@dxos/react-client 0.5.0 → 0.5.1-main.1670c35

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (31) hide show
  1. package/dist/lib/browser/{chunk-HJDLXXEZ.mjs → chunk-EUWLDYWG.mjs} +46 -13
  2. package/dist/lib/browser/{chunk-HJDLXXEZ.mjs.map → chunk-EUWLDYWG.mjs.map} +4 -4
  3. package/dist/lib/browser/devtools/index.mjs +1 -1
  4. package/dist/lib/browser/echo/index.mjs +1 -1
  5. package/dist/lib/browser/halo/index.mjs +1 -1
  6. package/dist/lib/browser/index.mjs +7 -3
  7. package/dist/lib/browser/index.mjs.map +1 -1
  8. package/dist/lib/browser/mesh/index.mjs +1 -1
  9. package/dist/lib/browser/meta.json +1 -1
  10. package/dist/lib/browser/testing/index.mjs +1 -1
  11. package/dist/lib/node/{chunk-3GRHATJ3.cjs → chunk-VINRHSAC.cjs} +50 -15
  12. package/dist/lib/node/{chunk-3GRHATJ3.cjs.map → chunk-VINRHSAC.cjs.map} +4 -4
  13. package/dist/lib/node/devtools/index.cjs +2 -2
  14. package/dist/lib/node/echo/index.cjs +3 -3
  15. package/dist/lib/node/halo/index.cjs +5 -5
  16. package/dist/lib/node/index.cjs +14 -10
  17. package/dist/lib/node/index.cjs.map +1 -1
  18. package/dist/lib/node/mesh/index.cjs +2 -2
  19. package/dist/lib/node/meta.json +1 -1
  20. package/dist/lib/node/testing/index.cjs +2 -2
  21. package/dist/types/src/client/AgentHostingProvider.d.ts +12 -0
  22. package/dist/types/src/client/AgentHostingProvider.d.ts.map +1 -0
  23. package/dist/types/src/client/index.d.ts +1 -1
  24. package/dist/types/src/client/index.d.ts.map +1 -1
  25. package/package.json +17 -17
  26. package/project.json +3 -0
  27. package/src/client/AgentHostingProvider.tsx +61 -0
  28. package/src/client/index.ts +1 -1
  29. package/dist/types/src/client/useAgentHostingProvider.d.ts +0 -4
  30. package/dist/types/src/client/useAgentHostingProvider.d.ts.map +0 -1
  31. package/src/client/useAgentHostingProvider.ts +0 -37
@@ -7,4 +7,4 @@ export * from './useClientServices';
7
7
  export * from './useConfig';
8
8
  export * from './useShell';
9
9
  export * from './useStatus';
10
- export * from './useAgentHostingProvider';
10
+ export * from './AgentHostingProvider';
@@ -1,4 +0,0 @@
1
- import { type AgentHostingProviderClient } from '@dxos/client/services';
2
- import { type Config } from '@dxos/config';
3
- export declare const useAgentHostingProviderClient: (config: Config) => AgentHostingProviderClient | null;
4
- //# sourceMappingURL=useAgentHostingProvider.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useAgentHostingProvider.d.ts","sourceRoot":"","sources":["../../../../src/client/useAgentHostingProvider.ts"],"names":[],"mappings":"AAIA,OAAO,EACL,KAAK,0BAA0B,EAGhC,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,cAAc,CAAC;AAO3C,eAAO,MAAM,6BAA6B,WAAY,MAAM,KAAG,0BAA0B,GAAG,IAoB3F,CAAC"}
@@ -1,37 +0,0 @@
1
- //
2
- // Copyright 2023 DXOS.org
3
- //
4
-
5
- import {
6
- type AgentHostingProviderClient,
7
- DXOSAgentHostingProviderClient,
8
- FakeAgentHostingProvider,
9
- } from '@dxos/client/services';
10
- import { type Config } from '@dxos/config';
11
- import { log } from '@dxos/log';
12
-
13
- /*
14
- * Interface for invoking the agent hosting provider client.
15
- * @experimental
16
- */
17
- export const useAgentHostingProviderClient = (config: Config): AgentHostingProviderClient | null => {
18
- // TODO: Dynamically discover based on runtime config
19
- if (
20
- config.get('runtime.app.env.DX_ENVIRONMENT') !== 'development' &&
21
- localStorage.getItem('dxos.org/shell/features/agentHosting') !== 'true'
22
- ) {
23
- return null;
24
- }
25
-
26
- const agentHostingConfig = config.get('runtime.services.agentHosting');
27
- if (!agentHostingConfig) {
28
- log.info('no agent hosting configured');
29
- return null;
30
- }
31
-
32
- if (agentHostingConfig.type === 'LOCAL_TESTING') {
33
- return new FakeAgentHostingProvider(config);
34
- }
35
-
36
- return new DXOSAgentHostingProviderClient(config);
37
- };