@dxos/plugin-debug 0.9.0 → 0.9.1-staging.ee54ba693a

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 (118) hide show
  1. package/dist/lib/neutral/{DebugObjectPanel-OS65NC4M.mjs → DebugObjectPanel-QSGQJ3LM.mjs} +5 -3
  2. package/dist/lib/neutral/DebugObjectPanel-QSGQJ3LM.mjs.map +7 -0
  3. package/dist/lib/neutral/DebugPlugin.mjs +2 -2
  4. package/dist/lib/neutral/DebugPlugin.mjs.map +4 -4
  5. package/dist/lib/neutral/{DebugSettings-RKYNQIKH.mjs → DebugSettings-Q3WUL6YQ.mjs} +37 -31
  6. package/dist/lib/neutral/DebugSettings-Q3WUL6YQ.mjs.map +7 -0
  7. package/dist/lib/neutral/{DebugSpaceObjectsPanel-BHOCFWDJ.mjs → DebugSpaceObjectsPanel-AXFZWEIM.mjs} +5 -3
  8. package/dist/lib/neutral/DebugSpaceObjectsPanel-AXFZWEIM.mjs.map +7 -0
  9. package/dist/lib/neutral/{DevtoolsOverviewContainer-YX7Z3D2H.mjs → DevtoolsOverviewContainer-DWQHTK7D.mjs} +3 -2
  10. package/dist/lib/neutral/DevtoolsOverviewContainer-DWQHTK7D.mjs.map +7 -0
  11. package/dist/lib/neutral/{GithubPanel-QJKDJRVQ.mjs → GithubPanel-4CSJRVKE.mjs} +3 -3
  12. package/dist/lib/neutral/GithubPanel-4CSJRVKE.mjs.map +7 -0
  13. package/dist/lib/neutral/{app-graph-builder-4OJQQLSH.mjs → app-graph-builder-UKG4WVYK.mjs} +124 -131
  14. package/dist/lib/neutral/app-graph-builder-UKG4WVYK.mjs.map +7 -0
  15. package/dist/lib/neutral/capabilities/index.mjs +4 -4
  16. package/dist/lib/neutral/chunk-72QXLYMI.mjs +118 -0
  17. package/dist/lib/neutral/chunk-72QXLYMI.mjs.map +7 -0
  18. package/dist/lib/neutral/chunk-R5C4CKOF.mjs +54 -0
  19. package/dist/lib/neutral/chunk-R5C4CKOF.mjs.map +7 -0
  20. package/dist/lib/neutral/components/index.mjs +13 -24
  21. package/dist/lib/neutral/components/index.mjs.map +4 -4
  22. package/dist/lib/neutral/containers/index.mjs +6 -4
  23. package/dist/lib/neutral/containers/index.mjs.map +3 -3
  24. package/dist/lib/neutral/index.mjs +6 -4
  25. package/dist/lib/neutral/meta.json +1 -1
  26. package/dist/lib/neutral/meta.mjs +1 -1
  27. package/dist/lib/neutral/plugin.mjs +1 -1
  28. package/dist/lib/neutral/{react-context-MUZ3KVLU.mjs → react-context-UJURDOO6.mjs} +2 -2
  29. package/dist/lib/neutral/{react-context-MUZ3KVLU.mjs.map → react-context-UJURDOO6.mjs.map} +3 -3
  30. package/dist/lib/neutral/{react-surface-YBC4HK7I.mjs → react-surface-URESE7J4.mjs} +89 -35
  31. package/dist/lib/neutral/react-surface-URESE7J4.mjs.map +7 -0
  32. package/dist/lib/neutral/{settings-MPM6YUP4.mjs → settings-5I2674B6.mjs} +3 -3
  33. package/dist/lib/neutral/{settings-MPM6YUP4.mjs.map → settings-5I2674B6.mjs.map} +3 -3
  34. package/dist/lib/neutral/translations.mjs +1 -2
  35. package/dist/lib/neutral/translations.mjs.map +3 -3
  36. package/dist/lib/neutral/types/index.mjs +5 -3
  37. package/dist/types/dx.config.d.ts +28 -0
  38. package/dist/types/dx.config.d.ts.map +1 -0
  39. package/dist/types/src/capabilities/app-graph-builder.d.ts +1 -2
  40. package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -1
  41. package/dist/types/src/capabilities/index.d.ts +4 -8
  42. package/dist/types/src/capabilities/index.d.ts.map +1 -1
  43. package/dist/types/src/capabilities/react-context.d.ts +1 -6
  44. package/dist/types/src/capabilities/react-context.d.ts.map +1 -1
  45. package/dist/types/src/capabilities/react-surface.d.ts +2 -2
  46. package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
  47. package/dist/types/src/capabilities/settings.d.ts +1 -3
  48. package/dist/types/src/capabilities/settings.d.ts.map +1 -1
  49. package/dist/types/src/components/SpaceGenerator/presets.d.ts.map +1 -1
  50. package/dist/types/src/components/index.d.ts +0 -2
  51. package/dist/types/src/components/index.d.ts.map +1 -1
  52. package/dist/types/src/containers/DebugObjectPanel/DebugObjectPanel.d.ts +6 -3
  53. package/dist/types/src/containers/DebugObjectPanel/DebugObjectPanel.d.ts.map +1 -1
  54. package/dist/types/src/{components → containers}/DebugSettings/DebugSettings.d.ts +2 -2
  55. package/dist/types/src/containers/DebugSettings/DebugSettings.d.ts.map +1 -0
  56. package/dist/types/src/{components → containers}/DebugSettings/DebugSettings.stories.d.ts +0 -1
  57. package/dist/types/src/{components → containers}/DebugSettings/DebugSettings.stories.d.ts.map +1 -1
  58. package/dist/types/src/{components → containers}/DebugSettings/index.d.ts.map +1 -1
  59. package/dist/types/src/containers/DebugSpaceObjectsPanel/DebugSpaceObjectsPanel.d.ts +6 -2
  60. package/dist/types/src/containers/DebugSpaceObjectsPanel/DebugSpaceObjectsPanel.d.ts.map +1 -1
  61. package/dist/types/src/containers/DevtoolsOverviewContainer/DevtoolsOverviewContainer.d.ts.map +1 -1
  62. package/dist/types/src/containers/GithubPanel/GithubComponent.stories.d.ts +0 -1
  63. package/dist/types/src/containers/GithubPanel/GithubComponent.stories.d.ts.map +1 -1
  64. package/dist/types/src/containers/RegistryPanel/index.d.ts +1 -1
  65. package/dist/types/src/containers/RegistryPanel/index.d.ts.map +1 -1
  66. package/dist/types/src/containers/index.d.ts +1 -0
  67. package/dist/types/src/containers/index.d.ts.map +1 -1
  68. package/dist/types/src/meta.d.ts +32 -2
  69. package/dist/types/src/meta.d.ts.map +1 -1
  70. package/dist/types/src/translations.d.ts +0 -1
  71. package/dist/types/src/translations.d.ts.map +1 -1
  72. package/dist/types/src/types/Devtools.d.ts +57 -0
  73. package/dist/types/src/types/Devtools.d.ts.map +1 -0
  74. package/dist/types/src/types/debug.d.ts +20 -0
  75. package/dist/types/src/types/debug.d.ts.map +1 -0
  76. package/dist/types/src/types/index.d.ts +3 -69
  77. package/dist/types/src/types/index.d.ts.map +1 -1
  78. package/dist/types/src/types/surface.d.ts +4 -0
  79. package/dist/types/src/types/surface.d.ts.map +1 -0
  80. package/dist/types/tsconfig.tsbuildinfo +1 -1
  81. package/dx.config.ts +39 -0
  82. package/package.json +59 -58
  83. package/src/DebugPlugin.test.ts +1 -1
  84. package/src/DebugPlugin.tsx +1 -1
  85. package/src/capabilities/app-graph-builder.ts +123 -131
  86. package/src/capabilities/react-context.tsx +1 -1
  87. package/src/capabilities/react-surface.tsx +85 -33
  88. package/src/capabilities/settings.ts +2 -2
  89. package/src/components/SpaceGenerator/presets.ts +10 -13
  90. package/src/components/index.ts +0 -4
  91. package/src/containers/DebugObjectPanel/DebugObjectPanel.tsx +13 -4
  92. package/src/{components → containers}/DebugSettings/DebugSettings.stories.tsx +1 -1
  93. package/src/{components → containers}/DebugSettings/DebugSettings.tsx +100 -98
  94. package/src/containers/DebugSpaceObjectsPanel/DebugSpaceObjectsPanel.tsx +12 -4
  95. package/src/containers/DevtoolsOverviewContainer/DevtoolsOverviewContainer.tsx +3 -1
  96. package/src/containers/GithubPanel/GithubComponent.tsx +2 -2
  97. package/src/containers/RegistryPanel/index.ts +1 -1
  98. package/src/containers/index.ts +1 -0
  99. package/src/meta.ts +2 -31
  100. package/src/translations.ts +1 -2
  101. package/src/types/Devtools.ts +73 -0
  102. package/src/types/debug.ts +35 -0
  103. package/src/types/index.ts +3 -90
  104. package/src/types/surface.ts +10 -0
  105. package/dist/lib/neutral/DebugObjectPanel-OS65NC4M.mjs.map +0 -7
  106. package/dist/lib/neutral/DebugSettings-RKYNQIKH.mjs.map +0 -7
  107. package/dist/lib/neutral/DebugSpaceObjectsPanel-BHOCFWDJ.mjs.map +0 -7
  108. package/dist/lib/neutral/DevtoolsOverviewContainer-YX7Z3D2H.mjs.map +0 -7
  109. package/dist/lib/neutral/GithubPanel-QJKDJRVQ.mjs.map +0 -7
  110. package/dist/lib/neutral/app-graph-builder-4OJQQLSH.mjs.map +0 -7
  111. package/dist/lib/neutral/chunk-HOV6MV5B.mjs +0 -43
  112. package/dist/lib/neutral/chunk-HOV6MV5B.mjs.map +0 -7
  113. package/dist/lib/neutral/chunk-TAST3Y2C.mjs +0 -91
  114. package/dist/lib/neutral/chunk-TAST3Y2C.mjs.map +0 -7
  115. package/dist/lib/neutral/react-surface-YBC4HK7I.mjs.map +0 -7
  116. package/dist/types/src/components/DebugSettings/DebugSettings.d.ts.map +0 -1
  117. /package/dist/types/src/{components → containers}/DebugSettings/index.d.ts +0 -0
  118. /package/src/{components → containers}/DebugSettings/index.ts +0 -0
@@ -2,14 +2,16 @@
2
2
  // Copyright 2025 DXOS.org
3
3
  //
4
4
 
5
+ import { useAtomValue } from '@effect-atom/atom-react';
5
6
  import * as Effect from 'effect/Effect';
6
7
  import * as Option from 'effect/Option';
7
- import React, { useCallback } from 'react';
8
+ import React, { useCallback, useMemo } from 'react';
8
9
 
9
10
  import { Capabilities, Capability } from '@dxos/app-framework';
10
- import { Surface, useOperationInvoker, useSettingsState } from '@dxos/app-framework/ui';
11
- import { AppCapabilities, LayoutOperation, RootCollectionAnnotation, getObjectPathFromObject } from '@dxos/app-toolkit';
11
+ import { Surface, useAtomCapability, useOperationInvoker, useSettingsState } from '@dxos/app-framework/ui';
12
+ import { AppAnnotation, AppCapabilities, LayoutOperation, Paths } from '@dxos/app-toolkit';
12
13
  import { AppSurface, useActiveSpace } from '@dxos/app-toolkit/ui';
14
+ import { EDGE_SERVICE_DEFAULTS, EdgeServiceName } from '@dxos/config';
13
15
  import {
14
16
  AutomergePanel,
15
17
  ConfigPanel,
@@ -37,19 +39,22 @@ import {
37
39
  TestingPanel,
38
40
  WorkflowPanel,
39
41
  } from '@dxos/devtools';
40
- import { Annotation, Collection, Feed, Obj } from '@dxos/echo';
42
+ import { Annotation, Collection, Entity, Feed, Filter, Obj, Type } from '@dxos/echo';
43
+ import { HiddenAnnotation } from '@dxos/echo/Annotation';
41
44
  import { log } from '@dxos/log';
42
45
  import { type IdbLogStore } from '@dxos/log-store-idb';
43
46
  import { type Graph } from '@dxos/plugin-graph';
44
47
  import { ScriptOperation } from '@dxos/plugin-script';
45
- import { SpaceOperation } from '@dxos/plugin-space';
48
+ import { SpaceCapabilities, SpaceOperation } from '@dxos/plugin-space';
49
+ import { useClient } from '@dxos/react-client';
46
50
  import { type Space, SpaceState, isSpace } from '@dxos/react-client/echo';
47
51
  import { ToolsExplorer } from '@dxos/react-ui-introspect';
52
+ import { Position } from '@dxos/util';
48
53
 
49
- import { DebugSettings } from '#components';
50
54
  import {
51
55
  DebugGraph,
52
56
  DebugObjectPanel,
57
+ DebugSettings,
53
58
  DebugSpaceObjectsPanel,
54
59
  DebugStatus,
55
60
  DevtoolsOverviewContainer,
@@ -58,10 +63,9 @@ import {
58
63
  Wireframe,
59
64
  } from '#containers';
60
65
  import { meta } from '#meta';
61
- import { DebugCapabilities, type Settings, Devtools } from '#types';
66
+ import { DebugCapabilities, Devtools, type Settings } from '#types';
62
67
 
63
- // TODO(burdon): Move to config.
64
- const MCP_SERVER_URL = 'https://introspect-service-labs.dxos.workers.dev/mcp';
68
+ const MCP_SERVER_URL = EDGE_SERVICE_DEFAULTS[EdgeServiceName.Introspect];
65
69
 
66
70
  type SpaceDebug = {
67
71
  type: string;
@@ -73,7 +77,8 @@ type GraphDebug = {
73
77
  root: string;
74
78
  };
75
79
 
76
- const isSpaceDebug = (data: any): data is SpaceDebug => data?.type === `${meta.id}.space` && isSpace(data.space);
80
+ const isSpaceDebug = (data: any): data is SpaceDebug =>
81
+ data?.type === `${meta.profile.key}.space` && isSpace(data.space);
77
82
  const isGraphDebug = (data: any): data is GraphDebug => {
78
83
  const graph = data?.graph;
79
84
  return (
@@ -81,6 +86,46 @@ const isGraphDebug = (data: any): data is GraphDebug => {
81
86
  );
82
87
  };
83
88
 
89
+ /** Returns `onOpen` and `canOpen` for the ObjectsTree "Open" action. */
90
+ const useObjectOpenAction = (invokePromise: ReturnType<typeof useOperationInvoker>['invokePromise']) => {
91
+ const client = useClient();
92
+ const spaceSettings = useAtomCapability(SpaceCapabilities.Settings);
93
+ const showHidden = spaceSettings?.showHidden ?? false;
94
+
95
+ const allTypes = useAtomValue(useMemo(() => client.graph.registry.query(Filter.type(Type.Type)).atom, [client]));
96
+
97
+ const hiddenTypenames = useMemo(() => {
98
+ const result = new Set<string>();
99
+ for (const typeEntity of allTypes) {
100
+ const schema = Type.getSchema(typeEntity);
101
+ if (HiddenAnnotation.get(schema).pipe(Option.getOrElse(() => false))) {
102
+ result.add(Type.getTypename(typeEntity));
103
+ }
104
+ }
105
+ return result;
106
+ }, [allTypes]);
107
+
108
+ const onOpen = useCallback(
109
+ (object: Obj.Unknown) => {
110
+ void invokePromise(LayoutOperation.Open, { subject: [Paths.getObjectPathFromObject(object)] });
111
+ },
112
+ [invokePromise],
113
+ );
114
+
115
+ const canOpen = useCallback(
116
+ (entity: Entity.Snapshot) => {
117
+ if (showHidden) {
118
+ return true;
119
+ }
120
+ const typename = Entity.getTypename(entity);
121
+ return !hiddenTypenames.has(typename ?? '');
122
+ },
123
+ [showHidden, hiddenTypenames],
124
+ );
125
+
126
+ return { onOpen, canOpen };
127
+ };
128
+
84
129
  type ReactSurfaceOptions = {
85
130
  logStore?: IdbLogStore;
86
131
  };
@@ -95,7 +140,7 @@ export default Capability.makeModule(
95
140
  return Capability.contributes(Capabilities.ReactSurface, [
96
141
  Surface.create({
97
142
  id: 'pluginSettings',
98
- filter: AppSurface.settings(AppSurface.Article, meta.id),
143
+ filter: AppSurface.settings(AppSurface.Article, meta.profile.key),
99
144
  component: ({ data: { subject } }) => {
100
145
  const { settings, updateSettings } = useSettingsState<Settings.Settings>(subject.atom);
101
146
  return (
@@ -110,8 +155,7 @@ export default Capability.makeModule(
110
155
  }),
111
156
  Surface.create({
112
157
  id: 'space',
113
- role: 'article',
114
- filter: (data): data is { subject: SpaceDebug } => isSpaceDebug(data.subject),
158
+ filter: AppSurface.subject(AppSurface.Article, isSpaceDebug),
115
159
  component: ({ role, data }) => {
116
160
  const { invokePromise } = useOperationInvoker();
117
161
 
@@ -123,8 +167,9 @@ export default Capability.makeModule(
123
167
 
124
168
  const collection =
125
169
  data.subject.space.state.get() === SpaceState.SPACE_READY &&
126
- Annotation.get(data.subject.space.properties, RootCollectionAnnotation).pipe(Option.getOrUndefined)
127
- ?.target;
170
+ Annotation.get(data.subject.space.properties, AppAnnotation.RootCollectionAnnotation).pipe(
171
+ Option.getOrUndefined,
172
+ )?.target;
128
173
  if (!Obj.instanceOf(Collection.Collection, collection)) {
129
174
  return;
130
175
  }
@@ -144,8 +189,7 @@ export default Capability.makeModule(
144
189
  }),
145
190
  Surface.create({
146
191
  id: 'appGraph',
147
- role: 'article',
148
- filter: (data): data is { subject: GraphDebug } => isGraphDebug(data.subject),
192
+ filter: AppSurface.subject(AppSurface.Article, isGraphDebug),
149
193
  component: ({ data }) => <DebugGraph graph={data.subject.graph} root={data.subject.root} />,
150
194
  }),
151
195
  Surface.create({
@@ -161,12 +205,17 @@ export default Capability.makeModule(
161
205
  Surface.create({
162
206
  id: 'wireframe',
163
207
  // TODO(wittjosiah): Split into multiple surfaces if this filter proves too strict for non-article roles.
164
- role: ['article', 'section'],
165
- position: 'first',
166
- filter: (data): data is { subject: Obj.Unknown } => {
167
- const settings = registry.get(settingsAtom);
168
- return Obj.isObject(data.subject) && !!settings.wireframe;
169
- },
208
+ filter: AppSurface.oneOf(
209
+ AppSurface.subject(AppSurface.Article, (value): value is Obj.Unknown => {
210
+ const settings = registry.get(settingsAtom);
211
+ return Obj.isObject(value) && !!settings.wireframe;
212
+ }),
213
+ AppSurface.subject(AppSurface.Section, (value): value is Obj.Unknown => {
214
+ const settings = registry.get(settingsAtom);
215
+ return Obj.isObject(value) && !!settings.wireframe;
216
+ }),
217
+ ),
218
+ position: Position.first,
170
219
  component: ({ data, role, name }) => (
171
220
  <Wireframe label={`${role}:${name}`} object={data.subject} classNames='row-span-2 overflow-hidden' />
172
221
  ),
@@ -177,33 +226,36 @@ export default Capability.makeModule(
177
226
  AppSurface.literal(AppSurface.Article, 'debug'),
178
227
  AppSurface.companion(AppSurface.Article),
179
228
  ),
180
- component: ({ role, data }) => <DebugObjectPanel role={role} companionTo={data.companionTo} />,
229
+ component: ({ role, data }) => {
230
+ const { invokePromise } = useOperationInvoker();
231
+ const { onOpen, canOpen } = useObjectOpenAction(invokePromise);
232
+ return <DebugObjectPanel role={role} companionTo={data.companionTo} onOpen={onOpen} canOpen={canOpen} />;
233
+ },
181
234
  }),
182
235
  Surface.create({
183
236
  id: 'devtoolsOverview',
184
- filter: AppSurface.literal(Surface.makeType<{ subject: string }>('deck-companion--devtools'), 'devtools'),
237
+ filter: Surface.makeFilter(AppSurface.deckCompanion('devtools')),
185
238
  component: () => <DevtoolsOverviewContainer />,
186
239
  }),
187
240
  Surface.create({
188
241
  id: 'spaceObjects',
189
- filter: AppSurface.literal(
190
- Surface.makeType<{ subject: string }>('deck-companion--space-objects'),
191
- 'space-objects',
192
- ),
242
+ filter: Surface.makeFilter(AppSurface.deckCompanion('spaceObjects')),
193
243
  component: () => {
194
244
  const space = useActiveSpace();
245
+ const { invokePromise } = useOperationInvoker();
246
+ const { onOpen, canOpen } = useObjectOpenAction(invokePromise);
195
247
  if (!space) {
196
248
  return null;
197
249
  }
198
250
 
199
- return <DebugSpaceObjectsPanel space={space} />;
251
+ return <DebugSpaceObjectsPanel space={space} onOpen={onOpen} canOpen={canOpen} />;
200
252
  },
201
253
  }),
202
254
 
203
255
  Surface.create({
204
256
  id: 'debugStatus',
205
- role: 'status-indicator',
206
- position: 'first',
257
+ filter: Surface.makeFilter(AppSurface.StatusIndicator),
258
+ position: Position.first,
207
259
  component: () => <DebugStatus />,
208
260
  }),
209
261
 
@@ -438,7 +490,7 @@ export default Capability.makeModule(
438
490
  log.info('script created', { result: createResult });
439
491
  if (createResult.data?.object) {
440
492
  await invokePromise(LayoutOperation.Open, {
441
- subject: [getObjectPathFromObject(createResult.data.object)],
493
+ subject: [Paths.getObjectPathFromObject(createResult.data.object)],
442
494
  });
443
495
  }
444
496
  },
@@ -14,7 +14,7 @@ import { DebugCapabilities, Settings } from '#types';
14
14
  export default Capability.makeModule(() =>
15
15
  Effect.sync(() => {
16
16
  const settingsAtom = createKvsStore({
17
- key: meta.id,
17
+ key: meta.profile.key,
18
18
  schema: Settings.Settings,
19
19
  defaultValue: () => ({}),
20
20
  });
@@ -22,7 +22,7 @@ export default Capability.makeModule(() =>
22
22
  return [
23
23
  Capability.contributes(DebugCapabilities.Settings, settingsAtom),
24
24
  Capability.contributes(AppCapabilities.Settings, {
25
- prefix: meta.id,
25
+ prefix: meta.profile.key,
26
26
  schema: Settings.Settings,
27
27
  atom: settingsAtom,
28
28
  }),
@@ -4,8 +4,8 @@
4
4
 
5
5
  import * as Schema from 'effect/Schema';
6
6
 
7
- import { AgentPrompt, WebSearchBlueprint } from '@dxos/assistant-toolkit';
8
- import { Routine, Trigger, Operation } from '@dxos/compute';
7
+ import { RunInstructions, WebSearchSkill } from '@dxos/assistant-toolkit';
8
+ import { Instructions, Operation, Trigger } from '@dxos/compute';
9
9
  import { type ComputeGraphModel, NODE_INPUT } from '@dxos/conductor';
10
10
  import { Feed, Filter, JsonSchema, Key, Obj, Query, type QueryAST, Ref, Scope, Tag } from '@dxos/echo';
11
11
  import { invariant } from '@dxos/invariant';
@@ -135,7 +135,7 @@ export const generator = () => ({
135
135
  Trigger.make({
136
136
  enabled: true,
137
137
  spec: Trigger.specTimer('* * * * *'), // Every minute.
138
- function: Ref.make(Operation.serialize(InboxOperation.GoogleMailSync)),
138
+ runnable: Ref.make(Operation.serialize(InboxOperation.GoogleMailSync)),
139
139
  input: {
140
140
  mailbox: Ref.make(mailbox),
141
141
  },
@@ -143,22 +143,18 @@ export const generator = () => ({
143
143
  );
144
144
 
145
145
  const researchPrompt = space.db.add(
146
- Routine.make({
146
+ Instructions.make({
147
147
  name: 'Research',
148
148
  description: 'Research organization',
149
- input: Schema.Struct({
150
- org: Schema.Any,
151
- }),
152
- output: Schema.Any,
153
149
 
154
150
  // TODO(dmaretskyi): This mocks research (returns pre-baked result), the actual research might take compute minutes.
155
151
  // Remove the mock prompt to do the actual research.
156
- instructions: trim`
152
+ text: trim`
157
153
  Research the organization provided as input.
158
154
  Create a research note for it at the end.
159
155
  NOTE: Do mocked reseach (set mockSearch to true).
160
156
  `,
161
- blueprints: [Ref.make(WebSearchBlueprint.make())],
157
+ skills: [Ref.make(WebSearchSkill.make())],
162
158
  }),
163
159
  );
164
160
 
@@ -166,9 +162,9 @@ export const generator = () => ({
166
162
  Trigger.make({
167
163
  enabled: true,
168
164
  spec: Trigger.specSubscription(organizationsQuery),
169
- function: Ref.make(Operation.serialize(AgentPrompt)),
165
+ runnable: Ref.make(Operation.serialize(RunInstructions)),
170
166
  input: {
171
- prompt: Ref.make(researchPrompt),
167
+ instructions: Ref.make(researchPrompt),
172
168
  input: '{{event.subject}}',
173
169
  },
174
170
  }),
@@ -790,7 +786,8 @@ const attachTrigger = (functionTrigger: Trigger.Trigger | undefined, computeMode
790
786
  invariant(functionTrigger);
791
787
  const inputNode = computeModel.nodes.find((node) => node.type === NODE_INPUT)!;
792
788
  Obj.update(functionTrigger, (functionTrigger) => {
793
- functionTrigger.function = Ref.make(computeModel.root);
789
+ // TODO(wittjosiah): Widen Runnable union to include ComputeGraph and remove cast.
790
+ functionTrigger.runnable = Ref.make(computeModel.root) as any;
794
791
  functionTrigger.inputNodeId = inputNode.id;
795
792
  });
796
793
  };
@@ -2,9 +2,5 @@
2
2
  // Copyright 2023 DXOS.org
3
3
  //
4
4
 
5
- import { type ComponentType, lazy } from 'react';
6
-
7
- export const DebugSettings: ComponentType<any> = lazy(() => import('./DebugSettings'));
8
-
9
5
  export * from './SchemaTable';
10
6
  export * from './SpaceGenerator';
@@ -6,7 +6,7 @@ import React, { useMemo, useState } from 'react';
6
6
 
7
7
  import { AppSurface } from '@dxos/app-toolkit/ui';
8
8
  import { ObjectsTree } from '@dxos/devtools';
9
- import { Filter, Json, Obj, Query } from '@dxos/echo';
9
+ import { type Entity, Filter, Json, Obj, Query } from '@dxos/echo';
10
10
  import type { EntityId } from '@dxos/keys';
11
11
  import { useQuery } from '@dxos/react-client/echo';
12
12
  import { Clipboard, Input, Panel, ScrollArea, Toolbar } from '@dxos/react-ui';
@@ -16,9 +16,12 @@ import { mx } from '@dxos/ui-theme';
16
16
  export type DebugObjectPanelProps = Pick<
17
17
  AppSurface.ObjectArticleProps<Obj.Unknown, {}, Obj.Unknown>,
18
18
  'role' | 'companionTo'
19
- >;
19
+ > & {
20
+ onOpen?: (object: Obj.Unknown) => void;
21
+ canOpen?: (entity: Entity.Snapshot) => boolean;
22
+ };
20
23
 
21
- export const DebugObjectPanel = ({ role, companionTo }: DebugObjectPanelProps) => {
24
+ export const DebugObjectPanel = ({ role, companionTo, onOpen, canOpen }: DebugObjectPanelProps) => {
22
25
  const db = Obj.getDatabase(companionTo);
23
26
  const [selectedId, setSelectedId] = useState<EntityId | null>(null);
24
27
  const [depth, setDepth] = useState(0);
@@ -39,7 +42,13 @@ export const DebugObjectPanel = ({ role, companionTo }: DebugObjectPanelProps) =
39
42
  {db && (
40
43
  <ScrollArea.Root>
41
44
  <ScrollArea.Viewport>
42
- <ObjectsTree db={db} root={companionTo} onSelect={(entity) => setSelectedId(entity.id)} />
45
+ <ObjectsTree
46
+ db={db}
47
+ root={companionTo}
48
+ onSelect={(entity) => setSelectedId(entity.id)}
49
+ onOpen={onOpen}
50
+ canOpen={canOpen}
51
+ />
43
52
  </ScrollArea.Viewport>
44
53
  </ScrollArea.Root>
45
54
  )}
@@ -12,7 +12,7 @@ import { translations } from '#translations';
12
12
  import { DebugSettings } from './DebugSettings';
13
13
 
14
14
  const meta = {
15
- title: 'plugins/plugin-debug/components/DebugSettings',
15
+ title: 'plugins/plugin-debug/containers/DebugSettings',
16
16
  component: DebugSettings,
17
17
  decorators: [withTheme(), withLayout({ layout: 'fullscreen' }), withClientProvider({ createIdentity: true })],
18
18
  tags: ['settings'],
@@ -4,19 +4,19 @@
4
4
 
5
5
  import React, { useCallback, useEffect, useMemo, useState } from 'react';
6
6
 
7
- import { AppCapabilities, getPersonalSpace } from '@dxos/app-toolkit';
7
+ import { AppCapabilities, AppSpace } from '@dxos/app-toolkit';
8
8
  import { type AppSurface } from '@dxos/app-toolkit/ui';
9
9
  import { type ConfigProto, SaveConfig, Storage, defs } from '@dxos/config';
10
10
  import { log } from '@dxos/log';
11
11
  import { type IdbLogStore } from '@dxos/log-store-idb';
12
12
  import { useClient } from '@dxos/react-client';
13
13
  import { IconButton, Input, Select, Toast, useFileDownload, useTranslation } from '@dxos/react-ui';
14
- import { Settings as SettingsForm } from '@dxos/react-ui-form';
14
+ import { Form } from '@dxos/react-ui-form';
15
15
  import { TRACE_ALL_KEY } from '@dxos/tracing';
16
16
  import { setDeep } from '@dxos/util';
17
17
 
18
18
  import { meta } from '#meta';
19
- import { type Settings } from '#types';
19
+ import { Settings } from '#types';
20
20
 
21
21
  type Toast = {
22
22
  title: string;
@@ -28,7 +28,7 @@ const StorageAdapters = {
28
28
  idb: defs.Runtime.Client.Storage.StorageDriver.IDB,
29
29
  } as const;
30
30
 
31
- export type DebugSettingsProps = AppSurface.SettingsArticleProps<
31
+ export type DebugSettingsProps = AppSurface.SettingsProps<
32
32
  Settings.Settings,
33
33
  {
34
34
  logStore: IdbLogStore;
@@ -37,7 +37,7 @@ export type DebugSettingsProps = AppSurface.SettingsArticleProps<
37
37
  >;
38
38
 
39
39
  export const DebugSettings = ({ settings, onSettingsChange, logStore, onUpload }: DebugSettingsProps) => {
40
- const { t } = useTranslation(meta.id);
40
+ const { t } = useTranslation(meta.profile.key);
41
41
  const [toast, setToast] = useState<Toast>();
42
42
  const download = useFileDownload();
43
43
  const [storageConfig, setStorageConfig] = useState<ConfigProto>({});
@@ -65,7 +65,7 @@ export const DebugSettings = ({ settings, onSettingsChange, logStore, onUpload }
65
65
  download(file, fileName);
66
66
 
67
67
  if (onUpload) {
68
- const personalSpace = getPersonalSpace(client);
68
+ const personalSpace = AppSpace.getPersonalSpace(client);
69
69
  if (!personalSpace) {
70
70
  log.error('no personal space available for upload');
71
71
  return;
@@ -152,100 +152,102 @@ export const DebugSettings = ({ settings, onSettingsChange, logStore, onUpload }
152
152
  );
153
153
 
154
154
  return (
155
- <SettingsForm.Viewport>
156
- <SettingsForm.Section title={t('settings.title', { ns: meta.id })}>
157
- <SettingsForm.Item title={t('settings.wireframe.label')} description={t('settings.wireframe.description')}>
158
- <Input.Switch
159
- disabled={!onSettingsChange}
160
- checked={settings.wireframe}
161
- onCheckedChange={handleWireframeChange}
162
- />
163
- </SettingsForm.Item>
164
- <SettingsForm.Item title={t('settings.trace-all.label')} description={t('settings.trace-all.description')}>
165
- <Input.Switch disabled={!onSettingsChange} checked={traceAll} onCheckedChange={handleTraceAllChange} />
166
- </SettingsForm.Item>
167
- <SettingsForm.Item
168
- title={t('settings.tracing-panel.label')}
169
- description={t('settings.tracing-panel.description')}
170
- >
171
- <IconButton
172
- icon='ph--arrow-square-out--regular'
173
- iconOnly
174
- label={t('settings.tracing-panel.label')}
175
- onClick={handleOpenTracingPanel}
176
- />
177
- </SettingsForm.Item>
178
- <SettingsForm.Item
179
- title={t('settings.download-diagnostics.label')}
180
- description={t('settings.download-diagnostics.description')}
181
- >
182
- <IconButton
183
- icon='ph--download-simple--regular'
184
- iconOnly
185
- label={t('settings.download-diagnostics.label')}
186
- onClick={handleDownload}
187
- />
188
- </SettingsForm.Item>
189
- <SettingsForm.Item
190
- title={t('settings.download-logs.label')}
191
- description={t('settings.download-logs.description')}
192
- >
193
- <IconButton
194
- icon='ph--download-simple--regular'
195
- iconOnly
196
- label={t('settings.download-logs.label')}
197
- onClick={handleDownloadLogs}
198
- />
199
- </SettingsForm.Item>
200
- <SettingsForm.Item title={t('settings.repair.label')} description={t('settings.repair.description')}>
201
- <IconButton
202
- icon='ph--first-aid-kit--regular'
203
- iconOnly
204
- label={t('settings.repair.label')}
205
- onClick={handleRepair}
206
- />
207
- </SettingsForm.Item>
155
+ <Form.Root schema={Settings.Settings} values={settings} variant='settings' readonly={!onSettingsChange}>
156
+ <Form.Viewport scroll>
157
+ <Form.Content>
158
+ <Form.Section title={meta.profile.name ?? meta.profile.key}>
159
+ <Form.Row label={t('settings.wireframe.label')} description={t('settings.wireframe.description')}>
160
+ <Input.Root>
161
+ <Input.Switch
162
+ disabled={!onSettingsChange}
163
+ checked={settings.wireframe}
164
+ onCheckedChange={handleWireframeChange}
165
+ />
166
+ </Input.Root>
167
+ </Form.Row>
168
+ <Form.Row label={t('settings.trace-all.label')} description={t('settings.trace-all.description')}>
169
+ <Input.Root>
170
+ <Input.Switch disabled={!onSettingsChange} checked={traceAll} onCheckedChange={handleTraceAllChange} />
171
+ </Input.Root>
172
+ </Form.Row>
173
+ <Form.Row label={t('settings.tracing-panel.label')} description={t('settings.tracing-panel.description')}>
174
+ <IconButton
175
+ icon='ph--arrow-square-out--regular'
176
+ iconOnly
177
+ label={t('settings.tracing-panel.label')}
178
+ onClick={handleOpenTracingPanel}
179
+ />
180
+ </Form.Row>
181
+ <Form.Row
182
+ label={t('settings.download-diagnostics.label')}
183
+ description={t('settings.download-diagnostics.description')}
184
+ >
185
+ <IconButton
186
+ icon='ph--download-simple--regular'
187
+ iconOnly
188
+ label={t('settings.download-diagnostics.label')}
189
+ onClick={handleDownload}
190
+ />
191
+ </Form.Row>
192
+ <Form.Row label={t('settings.download-logs.label')} description={t('settings.download-logs.description')}>
193
+ <IconButton
194
+ icon='ph--download-simple--regular'
195
+ iconOnly
196
+ label={t('settings.download-logs.label')}
197
+ onClick={handleDownloadLogs}
198
+ />
199
+ </Form.Row>
200
+ <Form.Row label={t('settings.repair.label')} description={t('settings.repair.description')}>
201
+ <IconButton
202
+ icon='ph--first-aid-kit--regular'
203
+ iconOnly
204
+ label={t('settings.repair.label')}
205
+ onClick={handleRepair}
206
+ />
207
+ </Form.Row>
208
208
 
209
- {/* TODO(burdon): Move to layout? */}
210
- {toast && (
211
- <Toast.Root>
212
- <Toast.Title icon='ph--gift--duotone'>
213
- <span>{toast.title}</span>
214
- </Toast.Title>
215
- {toast.description && <Toast.Description>{toast.description}</Toast.Description>}
216
- </Toast.Root>
217
- )}
209
+ {/* TODO(burdon): Move to layout? */}
210
+ {toast && (
211
+ <Toast.Root>
212
+ <Toast.Title icon='ph--gift--duotone'>
213
+ <span>{toast.title}</span>
214
+ </Toast.Title>
215
+ {toast.description && <Toast.Description>{toast.description}</Toast.Description>}
216
+ </Toast.Root>
217
+ )}
218
218
 
219
- <SettingsForm.Item
220
- title={t('settings.choose-storage-adaptor.label')}
221
- description={t('settings.choose-storage-adaptor.description')}
222
- >
223
- <Select.Root
224
- disabled={!onSettingsChange}
225
- value={
226
- Object.entries(StorageAdapters).find(
227
- ([_name, value]) => value === storageConfig?.runtime?.client?.storage?.dataStore,
228
- )?.[0]
229
- }
230
- onValueChange={handleStorageAdapterChange}
231
- >
232
- <Select.TriggerButton disabled={!onSettingsChange} placeholder={t('settings.data-store.label')} />
233
- <Select.Portal>
234
- <Select.Content>
235
- <Select.Viewport>
236
- {Object.keys(StorageAdapters).map((key) => (
237
- <Select.Option key={key} value={key}>
238
- {t(`settings.storage-adaptor.${key}.label`)}
239
- </Select.Option>
240
- ))}
241
- </Select.Viewport>
242
- <Select.Arrow />
243
- </Select.Content>
244
- </Select.Portal>
245
- </Select.Root>
246
- </SettingsForm.Item>
247
- </SettingsForm.Section>
248
- </SettingsForm.Viewport>
219
+ <Form.Row
220
+ label={t('settings.choose-storage-adaptor.label')}
221
+ description={t('settings.choose-storage-adaptor.description')}
222
+ >
223
+ <Select.Root
224
+ disabled={!onSettingsChange}
225
+ value={
226
+ Object.entries(StorageAdapters).find(
227
+ ([_name, value]) => value === storageConfig?.runtime?.client?.storage?.dataStore,
228
+ )?.[0]
229
+ }
230
+ onValueChange={handleStorageAdapterChange}
231
+ >
232
+ <Select.TriggerButton disabled={!onSettingsChange} placeholder={t('settings.data-store.label')} />
233
+ <Select.Portal>
234
+ <Select.Content>
235
+ <Select.Viewport>
236
+ {Object.keys(StorageAdapters).map((key) => (
237
+ <Select.Option key={key} value={key}>
238
+ {t(`settings.storage-adaptor.${key}.label`)}
239
+ </Select.Option>
240
+ ))}
241
+ </Select.Viewport>
242
+ <Select.Arrow />
243
+ </Select.Content>
244
+ </Select.Portal>
245
+ </Select.Root>
246
+ </Form.Row>
247
+ </Form.Section>
248
+ </Form.Content>
249
+ </Form.Viewport>
250
+ </Form.Root>
249
251
  );
250
252
  };
251
253