@dxos/plugin-settings 0.8.4-main.6fa680abb7 → 0.8.4-main.74a063c4e0

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 (63) hide show
  1. package/dist/lib/browser/index.mjs +30 -20
  2. package/dist/lib/browser/index.mjs.map +4 -4
  3. package/dist/lib/browser/meta.json +1 -1
  4. package/dist/lib/browser/types/index.mjs +9 -0
  5. package/dist/lib/browser/types/index.mjs.map +7 -0
  6. package/dist/lib/node-esm/index.mjs +31 -20
  7. package/dist/lib/node-esm/index.mjs.map +4 -4
  8. package/dist/lib/node-esm/meta.json +1 -1
  9. package/dist/lib/node-esm/types/index.mjs +11 -0
  10. package/dist/lib/node-esm/types/index.mjs.map +7 -0
  11. package/dist/types/src/SettingsPlugin.d.ts.map +1 -1
  12. package/dist/types/src/actions.d.ts +2 -2
  13. package/dist/types/src/actions.d.ts.map +1 -1
  14. package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -0
  15. package/dist/types/src/capabilities/index.d.ts +4 -2
  16. package/dist/types/src/capabilities/index.d.ts.map +1 -1
  17. package/dist/types/src/capabilities/operation-handler.d.ts +6 -0
  18. package/dist/types/src/capabilities/operation-handler.d.ts.map +1 -0
  19. package/dist/types/src/operations/index.d.ts +3 -0
  20. package/dist/types/src/operations/index.d.ts.map +1 -0
  21. package/dist/types/src/operations/open-plugin-registry.d.ts +5 -0
  22. package/dist/types/src/operations/open-plugin-registry.d.ts.map +1 -0
  23. package/dist/types/src/operations/open.d.ts +5 -0
  24. package/dist/types/src/operations/open.d.ts.map +1 -0
  25. package/dist/types/src/translations.d.ts +3 -3
  26. package/dist/types/src/translations.d.ts.map +1 -1
  27. package/dist/types/src/types/index.d.ts +3 -0
  28. package/dist/types/src/types/index.d.ts.map +1 -0
  29. package/dist/types/tsconfig.tsbuildinfo +1 -1
  30. package/package.json +25 -9
  31. package/src/SettingsPlugin.ts +4 -3
  32. package/src/actions.ts +3 -3
  33. package/src/capabilities/{app-graph-builder/app-graph-builder.ts → app-graph-builder.ts} +23 -20
  34. package/src/capabilities/index.ts +8 -2
  35. package/src/capabilities/operation-handler.ts +16 -0
  36. package/src/operations/index.ts +10 -0
  37. package/src/operations/open-plugin-registry.ts +28 -0
  38. package/src/operations/open.ts +29 -0
  39. package/src/translations.ts +3 -3
  40. package/src/types/index.ts +8 -0
  41. package/dist/lib/browser/app-graph-builder-YWCB3EZC.mjs +0 -97
  42. package/dist/lib/browser/app-graph-builder-YWCB3EZC.mjs.map +0 -7
  43. package/dist/lib/browser/chunk-DIKK4DQC.mjs +0 -35
  44. package/dist/lib/browser/chunk-DIKK4DQC.mjs.map +0 -7
  45. package/dist/lib/browser/operation-resolver-7AAHDR6U.mjs +0 -54
  46. package/dist/lib/browser/operation-resolver-7AAHDR6U.mjs.map +0 -7
  47. package/dist/lib/node-esm/app-graph-builder-WSMWJBGZ.mjs +0 -98
  48. package/dist/lib/node-esm/app-graph-builder-WSMWJBGZ.mjs.map +0 -7
  49. package/dist/lib/node-esm/chunk-NAEV3LFJ.mjs +0 -37
  50. package/dist/lib/node-esm/chunk-NAEV3LFJ.mjs.map +0 -7
  51. package/dist/lib/node-esm/operation-resolver-QY6K6X7D.mjs +0 -55
  52. package/dist/lib/node-esm/operation-resolver-QY6K6X7D.mjs.map +0 -7
  53. package/dist/types/src/capabilities/app-graph-builder/app-graph-builder.d.ts.map +0 -1
  54. package/dist/types/src/capabilities/app-graph-builder/index.d.ts +0 -3
  55. package/dist/types/src/capabilities/app-graph-builder/index.d.ts.map +0 -1
  56. package/dist/types/src/capabilities/operation-resolver/index.d.ts +0 -3
  57. package/dist/types/src/capabilities/operation-resolver/index.d.ts.map +0 -1
  58. package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts +0 -5
  59. package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts.map +0 -1
  60. package/src/capabilities/app-graph-builder/index.ts +0 -7
  61. package/src/capabilities/operation-resolver/index.ts +0 -10
  62. package/src/capabilities/operation-resolver/operation-resolver.ts +0 -53
  63. /package/dist/types/src/capabilities/{app-graph-builder/app-graph-builder.d.ts → app-graph-builder.d.ts} +0 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dxos/plugin-settings",
3
- "version": "0.8.4-main.6fa680abb7",
3
+ "version": "0.8.4-main.74a063c4e0",
4
4
  "description": "DXOS Settings plugin for managing application settings.",
5
5
  "homepage": "https://dxos.org",
6
6
  "bugs": "https://github.com/dxos/dxos/issues",
@@ -12,36 +12,52 @@
12
12
  "author": "DXOS.org",
13
13
  "sideEffects": true,
14
14
  "type": "module",
15
+ "imports": {
16
+ "#capabilities": "./src/capabilities/index.ts",
17
+ "#meta": "./src/meta.ts",
18
+ "#operations": "./src/operations/index.ts",
19
+ "#types": "./src/types/index.ts"
20
+ },
15
21
  "exports": {
16
22
  ".": {
17
23
  "source": "./src/index.ts",
18
24
  "browser": "./dist/lib/browser/index.mjs",
19
25
  "node": "./dist/lib/node-esm/index.mjs",
20
26
  "types": "./dist/types/src/index.d.ts"
27
+ },
28
+ "./types": {
29
+ "source": "./src/types/index.ts",
30
+ "types": "./dist/types/src/types/index.d.ts",
31
+ "browser": "./dist/lib/browser/types/index.mjs",
32
+ "node": "./dist/lib/node-esm/types/index.mjs"
21
33
  }
22
34
  },
23
35
  "types": "dist/types/src/index.d.ts",
24
36
  "typesVersions": {
25
- "*": {}
37
+ "*": {
38
+ "types": [
39
+ "dist/types/src/types/index.d.ts"
40
+ ]
41
+ }
26
42
  },
27
43
  "files": [
28
44
  "dist",
29
45
  "src"
30
46
  ],
31
47
  "dependencies": {
32
- "@dxos/app-framework": "0.8.4-main.6fa680abb7",
33
- "@dxos/app-toolkit": "0.8.4-main.6fa680abb7",
34
- "@dxos/util": "0.8.4-main.6fa680abb7",
35
- "@dxos/operation": "0.8.4-main.6fa680abb7",
36
- "@dxos/app-graph": "0.8.4-main.6fa680abb7"
48
+ "@dxos/app-framework": "0.8.4-main.74a063c4e0",
49
+ "@dxos/app-graph": "0.8.4-main.74a063c4e0",
50
+ "@dxos/app-toolkit": "0.8.4-main.74a063c4e0",
51
+ "@dxos/operation": "0.8.4-main.74a063c4e0",
52
+ "@dxos/util": "0.8.4-main.74a063c4e0"
37
53
  },
38
54
  "devDependencies": {
39
55
  "@types/react": "~19.2.7",
40
- "effect": "3.19.16",
56
+ "effect": "3.20.0",
41
57
  "react": "~19.2.3"
42
58
  },
43
59
  "peerDependencies": {
44
- "effect": "3.19.16",
60
+ "effect": "3.20.0",
45
61
  "react": "~19.2.3"
46
62
  },
47
63
  "publishConfig": {
@@ -5,13 +5,14 @@
5
5
  import { Plugin } from '@dxos/app-framework';
6
6
  import { AppPlugin } from '@dxos/app-toolkit';
7
7
 
8
- import { SettingsAppGraphBuilder, SettingsOperationResolver } from './capabilities';
9
- import { meta } from './meta';
8
+ import { OperationHandler, SettingsAppGraphBuilder } from '#capabilities';
9
+ import { meta } from '#meta';
10
+
10
11
  import { translations } from './translations';
11
12
 
12
13
  export const SettingsPlugin = Plugin.define(meta).pipe(
13
14
  AppPlugin.addAppGraphModule({ activate: SettingsAppGraphBuilder }),
14
- AppPlugin.addOperationResolverModule({ activate: SettingsOperationResolver }),
15
+ AppPlugin.addOperationHandlerModule({ activate: OperationHandler }),
15
16
  AppPlugin.addTranslationsModule({ translations }),
16
17
  Plugin.make,
17
18
  );
package/src/actions.ts CHANGED
@@ -4,10 +4,10 @@
4
4
 
5
5
  import * as Schema from 'effect/Schema';
6
6
 
7
- import { meta } from './meta';
7
+ import { meta } from '#meta';
8
+ import { SETTINGS_ID, SETTINGS_KEY } from '#types';
8
9
 
9
- export const SETTINGS_ID = '!dxos:settings';
10
- export const SETTINGS_KEY = 'settings';
10
+ export { SETTINGS_ID, SETTINGS_KEY };
11
11
 
12
12
  export namespace SettingsAction {
13
13
  export class Open extends Schema.TaggedClass<Open>()(`${meta.id}.open`, {
@@ -5,13 +5,14 @@
5
5
  import * as Effect from 'effect/Effect';
6
6
 
7
7
  import { Capabilities, Capability, type Plugin as Plugin$ } from '@dxos/app-framework';
8
- import { GraphBuilder, NodeMatcher } from '@dxos/app-graph';
8
+ import { GraphBuilder, Node, NodeMatcher } from '@dxos/app-graph';
9
9
  import { AppCapabilities, SettingsOperation, getSpacePath } from '@dxos/app-toolkit';
10
10
  import { Operation } from '@dxos/operation';
11
11
  import { isNonNullable } from '@dxos/util';
12
12
 
13
- import { SETTINGS_ID, SETTINGS_KEY } from '../../actions';
14
- import { meta } from '../../meta';
13
+ import { meta } from '#meta';
14
+
15
+ import { SETTINGS_ID, SETTINGS_KEY } from '../actions';
15
16
 
16
17
  export default Capability.makeModule(
17
18
  Effect.fnUntraced(function* () {
@@ -22,15 +23,15 @@ export default Capability.makeModule(
22
23
 
23
24
  const extensions = yield* Effect.all([
24
25
  GraphBuilder.createExtension({
25
- id: `${meta.id}.action`,
26
+ id: 'action',
26
27
  match: NodeMatcher.whenRoot,
27
28
  actions: () =>
28
29
  Effect.succeed([
29
30
  {
30
- id: meta.id,
31
+ id: 'root',
31
32
  data: () => Operation.invoke(SettingsOperation.Open, {}),
32
33
  properties: {
33
- label: ['open settings label', { ns: meta.id }],
34
+ label: ['open-settings.label', { ns: meta.id }],
34
35
  icon: 'ph--gear--regular',
35
36
  disposition: 'menu',
36
37
  keyBinding: {
@@ -42,25 +43,25 @@ export default Capability.makeModule(
42
43
  ]),
43
44
  }),
44
45
  GraphBuilder.createExtension({
45
- id: `${meta.id}.core`,
46
+ id: 'core',
46
47
  match: NodeMatcher.whenRoot,
47
48
  connector: () =>
48
49
  Effect.succeed([
49
- {
50
+ Node.make({
50
51
  id: SETTINGS_ID,
51
52
  type: meta.id,
52
53
  properties: {
53
- label: ['app settings label', { ns: meta.id }],
54
+ label: ['app-settings.label', { ns: meta.id }],
54
55
  icon: 'ph--gear--regular',
55
56
  disposition: 'pin-end',
56
57
  position: 'hoist',
57
58
  testId: 'treeView.appSettings',
58
59
  },
59
- },
60
+ }),
60
61
  ]),
61
62
  }),
62
63
  GraphBuilder.createExtension({
63
- id: `${meta.id}.plugins`,
64
+ id: 'plugins',
64
65
  match: NodeMatcher.whenId(getSpacePath(SETTINGS_ID)),
65
66
  connector: (node, get) => {
66
67
  const [manager] = get(managerAtom);
@@ -77,15 +78,17 @@ export default Capability.makeModule(
77
78
  return [plugin.meta, settings];
78
79
  })
79
80
  .filter(isNonNullable)
80
- .map(([meta, settings]: [Plugin$.Meta, AppCapabilities.Settings]) => ({
81
- id: `${SETTINGS_KEY}:${meta.id.replaceAll('/', ':')}`,
82
- type: 'category',
83
- data: settings,
84
- properties: {
85
- label: meta.name ?? meta.id,
86
- icon: meta.icon ?? 'ph--circle--regular',
87
- },
88
- })),
81
+ .map(([meta, settings]: [Plugin$.Meta, AppCapabilities.Settings]) =>
82
+ Node.make({
83
+ id: `${SETTINGS_KEY}:${meta.id.replaceAll('/', ':')}`,
84
+ type: 'category',
85
+ data: settings,
86
+ properties: {
87
+ label: meta.name ?? meta.id,
88
+ icon: meta.icon ?? 'ph--circle--regular',
89
+ },
90
+ }),
91
+ ),
89
92
  );
90
93
  },
91
94
  }),
@@ -2,5 +2,11 @@
2
2
  // Copyright 2025 DXOS.org
3
3
  //
4
4
 
5
- export * from './app-graph-builder';
6
- export * from './operation-resolver';
5
+ import { Capability } from '@dxos/app-framework';
6
+ import { OperationHandlerSet } from '@dxos/operation';
7
+
8
+ export const SettingsAppGraphBuilder = Capability.lazy('SettingsAppGraphBuilder', () => import('./app-graph-builder'));
9
+ export const OperationHandler = Capability.lazy<OperationHandlerSet.OperationHandlerSet>(
10
+ 'OperationHandler',
11
+ () => import('./operation-handler'),
12
+ );
@@ -0,0 +1,16 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ import * as Effect from 'effect/Effect';
6
+
7
+ import { Capabilities, Capability } from '@dxos/app-framework';
8
+ import type { OperationHandlerSet } from '@dxos/operation';
9
+
10
+ import { SettingsOperationHandlerSet } from '#operations';
11
+
12
+ export default Capability.makeModule<OperationHandlerSet.OperationHandlerSet>(
13
+ Effect.fnUntraced(function* () {
14
+ return Capability.contributes(Capabilities.OperationHandler, SettingsOperationHandlerSet);
15
+ }),
16
+ );
@@ -0,0 +1,10 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ import { OperationHandlerSet } from '@dxos/operation';
6
+
7
+ export const SettingsOperationHandlerSet = OperationHandlerSet.lazy(
8
+ () => import('./open'),
9
+ () => import('./open-plugin-registry'),
10
+ );
@@ -0,0 +1,28 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ import * as Effect from 'effect/Effect';
6
+
7
+ import { Capabilities, Capability } from '@dxos/app-framework';
8
+ import { LayoutOperation, SettingsOperation, getSpacePath } from '@dxos/app-toolkit';
9
+ import { Operation } from '@dxos/operation';
10
+
11
+ import { SETTINGS_ID, SETTINGS_KEY } from '../actions';
12
+
13
+ const handler: Operation.WithHandler<typeof SettingsOperation.OpenPluginRegistry> =
14
+ SettingsOperation.OpenPluginRegistry.pipe(
15
+ Operation.withHandler(() =>
16
+ Effect.gen(function* () {
17
+ const { invoke } = yield* Capability.get(Capabilities.OperationInvoker);
18
+ yield* invoke(LayoutOperation.SwitchWorkspace, { subject: getSpacePath(SETTINGS_ID) });
19
+ yield* Effect.fork(
20
+ invoke(LayoutOperation.Open, {
21
+ subject: [`${getSpacePath(SETTINGS_ID)}/${SETTINGS_KEY}:plugins`],
22
+ }),
23
+ );
24
+ }),
25
+ ),
26
+ );
27
+
28
+ export default handler;
@@ -0,0 +1,29 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ import * as Effect from 'effect/Effect';
6
+
7
+ import { Capabilities, Capability } from '@dxos/app-framework';
8
+ import { LayoutOperation, SettingsOperation, getSpacePath } from '@dxos/app-toolkit';
9
+ import { Operation } from '@dxos/operation';
10
+
11
+ import { SETTINGS_ID, SETTINGS_KEY } from '../actions';
12
+
13
+ const handler: Operation.WithHandler<typeof SettingsOperation.Open> = SettingsOperation.Open.pipe(
14
+ Operation.withHandler((input) =>
15
+ Effect.gen(function* () {
16
+ const { invoke } = yield* Capability.get(Capabilities.OperationInvoker);
17
+ yield* invoke(LayoutOperation.SwitchWorkspace, { subject: getSpacePath(SETTINGS_ID) });
18
+ if (input.plugin) {
19
+ yield* Effect.fork(
20
+ invoke(LayoutOperation.Open, {
21
+ subject: [`${getSpacePath(SETTINGS_ID)}/${SETTINGS_KEY}:${input.plugin.replaceAll('/', ':')}`],
22
+ }),
23
+ );
24
+ }
25
+ }),
26
+ ),
27
+ );
28
+
29
+ export default handler;
@@ -4,14 +4,14 @@
4
4
 
5
5
  import { type Resource } from '@dxos/app-toolkit';
6
6
 
7
- import { meta } from './meta';
7
+ import { meta } from '#meta';
8
8
 
9
9
  export const translations = [
10
10
  {
11
11
  'en-US': {
12
12
  [meta.id]: {
13
- 'open settings label': 'Open settings',
14
- 'app settings label': 'Settings',
13
+ 'open-settings.label': 'Open settings',
14
+ 'app-settings.label': 'Settings',
15
15
  },
16
16
  },
17
17
  },
@@ -0,0 +1,8 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ import { pinnedWorkspaceId } from '@dxos/app-toolkit';
6
+
7
+ export const SETTINGS_ID = pinnedWorkspaceId('dxos:settings');
8
+ export const SETTINGS_KEY = 'settings';
@@ -1,97 +0,0 @@
1
- import {
2
- SETTINGS_ID,
3
- SETTINGS_KEY,
4
- meta
5
- } from "./chunk-DIKK4DQC.mjs";
6
-
7
- // src/capabilities/app-graph-builder/app-graph-builder.ts
8
- import * as Effect from "effect/Effect";
9
- import { Capabilities, Capability } from "@dxos/app-framework";
10
- import { GraphBuilder, NodeMatcher } from "@dxos/app-graph";
11
- import { AppCapabilities, SettingsOperation, getSpacePath } from "@dxos/app-toolkit";
12
- import { Operation } from "@dxos/operation";
13
- import { isNonNullable } from "@dxos/util";
14
- var app_graph_builder_default = Capability.makeModule(Effect.fnUntraced(function* () {
15
- const capabilities = yield* Capability.Service;
16
- const managerAtom = capabilities.atom(Capabilities.PluginManager);
17
- const settingsAtom = capabilities.atom(AppCapabilities.Settings);
18
- const extensions = yield* Effect.all([
19
- GraphBuilder.createExtension({
20
- id: `${meta.id}.action`,
21
- match: NodeMatcher.whenRoot,
22
- actions: () => Effect.succeed([
23
- {
24
- id: meta.id,
25
- data: () => Operation.invoke(SettingsOperation.Open, {}),
26
- properties: {
27
- label: [
28
- "open settings label",
29
- {
30
- ns: meta.id
31
- }
32
- ],
33
- icon: "ph--gear--regular",
34
- disposition: "menu",
35
- keyBinding: {
36
- macos: "meta+,",
37
- windows: "alt+,"
38
- }
39
- }
40
- }
41
- ])
42
- }),
43
- GraphBuilder.createExtension({
44
- id: `${meta.id}.core`,
45
- match: NodeMatcher.whenRoot,
46
- connector: () => Effect.succeed([
47
- {
48
- id: SETTINGS_ID,
49
- type: meta.id,
50
- properties: {
51
- label: [
52
- "app settings label",
53
- {
54
- ns: meta.id
55
- }
56
- ],
57
- icon: "ph--gear--regular",
58
- disposition: "pin-end",
59
- position: "hoist",
60
- testId: "treeView.appSettings"
61
- }
62
- }
63
- ])
64
- }),
65
- GraphBuilder.createExtension({
66
- id: `${meta.id}.plugins`,
67
- match: NodeMatcher.whenId(getSpacePath(SETTINGS_ID)),
68
- connector: (node, get) => {
69
- const [manager] = get(managerAtom);
70
- const allSettings = get(settingsAtom);
71
- return Effect.succeed(manager.getPlugins().map((plugin) => {
72
- const settings = allSettings.find((s) => s.prefix === plugin.meta.id);
73
- if (!settings) {
74
- return null;
75
- }
76
- return [
77
- plugin.meta,
78
- settings
79
- ];
80
- }).filter(isNonNullable).map(([meta2, settings]) => ({
81
- id: `${SETTINGS_KEY}:${meta2.id.replaceAll("/", ":")}`,
82
- type: "category",
83
- data: settings,
84
- properties: {
85
- label: meta2.name ?? meta2.id,
86
- icon: meta2.icon ?? "ph--circle--regular"
87
- }
88
- })));
89
- }
90
- })
91
- ]);
92
- return Capability.contributes(AppCapabilities.AppGraphBuilder, extensions);
93
- }));
94
- export {
95
- app_graph_builder_default as default
96
- };
97
- //# sourceMappingURL=app-graph-builder-YWCB3EZC.mjs.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/capabilities/app-graph-builder/app-graph-builder.ts"],
4
- "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\n\nimport { Capabilities, Capability, type Plugin as Plugin$ } from '@dxos/app-framework';\nimport { GraphBuilder, NodeMatcher } from '@dxos/app-graph';\nimport { AppCapabilities, SettingsOperation, getSpacePath } from '@dxos/app-toolkit';\nimport { Operation } from '@dxos/operation';\nimport { isNonNullable } from '@dxos/util';\n\nimport { SETTINGS_ID, SETTINGS_KEY } from '../../actions';\nimport { meta } from '../../meta';\n\nexport default Capability.makeModule(\n Effect.fnUntraced(function* () {\n // Get context for lazy capability access in callbacks.\n const capabilities = yield* Capability.Service;\n const managerAtom = capabilities.atom(Capabilities.PluginManager);\n const settingsAtom = capabilities.atom(AppCapabilities.Settings);\n\n const extensions = yield* Effect.all([\n GraphBuilder.createExtension({\n id: `${meta.id}.action`,\n match: NodeMatcher.whenRoot,\n actions: () =>\n Effect.succeed([\n {\n id: meta.id,\n data: () => Operation.invoke(SettingsOperation.Open, {}),\n properties: {\n label: ['open settings label', { ns: meta.id }],\n icon: 'ph--gear--regular',\n disposition: 'menu',\n keyBinding: {\n macos: 'meta+,',\n windows: 'alt+,',\n },\n },\n },\n ]),\n }),\n GraphBuilder.createExtension({\n id: `${meta.id}.core`,\n match: NodeMatcher.whenRoot,\n connector: () =>\n Effect.succeed([\n {\n id: SETTINGS_ID,\n type: meta.id,\n properties: {\n label: ['app settings label', { ns: meta.id }],\n icon: 'ph--gear--regular',\n disposition: 'pin-end',\n position: 'hoist',\n testId: 'treeView.appSettings',\n },\n },\n ]),\n }),\n GraphBuilder.createExtension({\n id: `${meta.id}.plugins`,\n match: NodeMatcher.whenId(getSpacePath(SETTINGS_ID)),\n connector: (node, get) => {\n const [manager] = get(managerAtom);\n const allSettings = get(settingsAtom);\n return Effect.succeed(\n manager\n .getPlugins()\n .map((plugin: Plugin$.Plugin): [Plugin$.Meta, AppCapabilities.Settings] | null => {\n const settings = allSettings.find((s) => s.prefix === plugin.meta.id);\n if (!settings) {\n return null;\n }\n\n return [plugin.meta, settings];\n })\n .filter(isNonNullable)\n .map(([meta, settings]: [Plugin$.Meta, AppCapabilities.Settings]) => ({\n id: `${SETTINGS_KEY}:${meta.id.replaceAll('/', ':')}`,\n type: 'category',\n data: settings,\n properties: {\n label: meta.name ?? meta.id,\n icon: meta.icon ?? 'ph--circle--regular',\n },\n })),\n );\n },\n }),\n ]);\n\n return Capability.contributes(AppCapabilities.AppGraphBuilder, extensions);\n }),\n);\n"],
5
- "mappings": ";;;;;;;AAIA,YAAYA,YAAY;AAExB,SAASC,cAAcC,kBAA0C;AACjE,SAASC,cAAcC,mBAAmB;AAC1C,SAASC,iBAAiBC,mBAAmBC,oBAAoB;AACjE,SAASC,iBAAiB;AAC1B,SAASC,qBAAqB;AAK9B,IAAA,4BAAeC,WAAWC,WACjBC,kBAAW,aAAA;AAEhB,QAAMC,eAAe,OAAOH,WAAWI;AACvC,QAAMC,cAAcF,aAAaG,KAAKC,aAAaC,aAAa;AAChE,QAAMC,eAAeN,aAAaG,KAAKI,gBAAgBC,QAAQ;AAE/D,QAAMC,aAAa,OAAcC,WAAI;IACnCC,aAAaC,gBAAgB;MAC3BC,IAAI,GAAGC,KAAKD,EAAE;MACdE,OAAOC,YAAYC;MACnBC,SAAS,MACAC,eAAQ;QACb;UACEN,IAAIC,KAAKD;UACTO,MAAM,MAAMC,UAAUC,OAAOC,kBAAkBC,MAAM,CAAC,CAAA;UACtDC,YAAY;YACVC,OAAO;cAAC;cAAuB;gBAAEC,IAAIb,KAAKD;cAAG;;YAC7Ce,MAAM;YACNC,aAAa;YACbC,YAAY;cACVC,OAAO;cACPC,SAAS;YACX;UACF;QACF;OACD;IACL,CAAA;IACArB,aAAaC,gBAAgB;MAC3BC,IAAI,GAAGC,KAAKD,EAAE;MACdE,OAAOC,YAAYC;MACnBgB,WAAW,MACFd,eAAQ;QACb;UACEN,IAAIqB;UACJC,MAAMrB,KAAKD;UACXY,YAAY;YACVC,OAAO;cAAC;cAAsB;gBAAEC,IAAIb,KAAKD;cAAG;;YAC5Ce,MAAM;YACNC,aAAa;YACbO,UAAU;YACVC,QAAQ;UACV;QACF;OACD;IACL,CAAA;IACA1B,aAAaC,gBAAgB;MAC3BC,IAAI,GAAGC,KAAKD,EAAE;MACdE,OAAOC,YAAYsB,OAAOC,aAAaL,WAAAA,CAAAA;MACvCD,WAAW,CAACO,MAAMC,QAAAA;AAChB,cAAM,CAACC,OAAAA,IAAWD,IAAIvC,WAAAA;AACtB,cAAMyC,cAAcF,IAAInC,YAAAA;AACxB,eAAca,eACZuB,QACGE,WAAU,EACVC,IAAI,CAACC,WAAAA;AACJ,gBAAMC,WAAWJ,YAAYK,KAAK,CAACC,MAAMA,EAAEC,WAAWJ,OAAOhC,KAAKD,EAAE;AACpE,cAAI,CAACkC,UAAU;AACb,mBAAO;UACT;AAEA,iBAAO;YAACD,OAAOhC;YAAMiC;;QACvB,CAAA,EACCI,OAAOC,aAAAA,EACPP,IAAI,CAAC,CAAC/B,OAAMiC,QAAAA,OAAyD;UACpElC,IAAI,GAAGwC,YAAAA,IAAgBvC,MAAKD,GAAGyC,WAAW,KAAK,GAAA,CAAA;UAC/CnB,MAAM;UACNf,MAAM2B;UACNtB,YAAY;YACVC,OAAOZ,MAAKyC,QAAQzC,MAAKD;YACzBe,MAAMd,MAAKc,QAAQ;UACrB;QACF,EAAA,CAAA;MAEN;IACF,CAAA;GACD;AAED,SAAO/B,WAAW2D,YAAYjD,gBAAgBkD,iBAAiBhD,UAAAA;AACjE,CAAA,CAAA;",
6
- "names": ["Effect", "Capabilities", "Capability", "GraphBuilder", "NodeMatcher", "AppCapabilities", "SettingsOperation", "getSpacePath", "Operation", "isNonNullable", "Capability", "makeModule", "fnUntraced", "capabilities", "Service", "managerAtom", "atom", "Capabilities", "PluginManager", "settingsAtom", "AppCapabilities", "Settings", "extensions", "all", "GraphBuilder", "createExtension", "id", "meta", "match", "NodeMatcher", "whenRoot", "actions", "succeed", "data", "Operation", "invoke", "SettingsOperation", "Open", "properties", "label", "ns", "icon", "disposition", "keyBinding", "macos", "windows", "connector", "SETTINGS_ID", "type", "position", "testId", "whenId", "getSpacePath", "node", "get", "manager", "allSettings", "getPlugins", "map", "plugin", "settings", "find", "s", "prefix", "filter", "isNonNullable", "SETTINGS_KEY", "replaceAll", "name", "contributes", "AppGraphBuilder"]
7
- }
@@ -1,35 +0,0 @@
1
- // src/meta.ts
2
- var meta = {
3
- id: "org.dxos.plugin.settings",
4
- name: "Settings"
5
- };
6
-
7
- // src/actions.ts
8
- import * as Schema from "effect/Schema";
9
- var SETTINGS_ID = "!dxos:settings";
10
- var SETTINGS_KEY = "settings";
11
- (function(SettingsAction2) {
12
- class Open extends Schema.TaggedClass()(`${meta.id}.open`, {
13
- input: Schema.Struct({
14
- plugin: Schema.optional(Schema.String)
15
- }),
16
- output: Schema.Void
17
- }) {
18
- }
19
- SettingsAction2.Open = Open;
20
- class OpenPluginRegistry extends Schema.TaggedClass()(`${meta.id}.open-plugin-registry`, {
21
- input: Schema.Void,
22
- output: Schema.Void
23
- }) {
24
- }
25
- SettingsAction2.OpenPluginRegistry = OpenPluginRegistry;
26
- })(SettingsAction || (SettingsAction = {}));
27
- var SettingsAction;
28
-
29
- export {
30
- meta,
31
- SETTINGS_ID,
32
- SETTINGS_KEY,
33
- SettingsAction
34
- };
35
- //# sourceMappingURL=chunk-DIKK4DQC.mjs.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/meta.ts", "../../../src/actions.ts"],
4
- "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { type Plugin } from '@dxos/app-framework';\n\nexport const meta: Plugin.Meta = {\n id: 'org.dxos.plugin.settings',\n name: 'Settings',\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport * as Schema from 'effect/Schema';\n\nimport { meta } from './meta';\n\nexport const SETTINGS_ID = '!dxos:settings';\nexport const SETTINGS_KEY = 'settings';\n\nexport namespace SettingsAction {\n export class Open extends Schema.TaggedClass<Open>()(`${meta.id}.open`, {\n input: Schema.Struct({\n plugin: Schema.optional(Schema.String),\n }),\n output: Schema.Void,\n }) {}\n\n export class OpenPluginRegistry extends Schema.TaggedClass<OpenPluginRegistry>()(`${meta.id}.open-plugin-registry`, {\n input: Schema.Void,\n output: Schema.Void,\n }) {}\n}\n"],
5
- "mappings": ";AAMO,IAAMA,OAAoB;EAC/BC,IAAI;EACJC,MAAM;AACR;;;ACLA,YAAYC,YAAY;AAIjB,IAAMC,cAAc;AACpB,IAAMC,eAAe;UAEXC,iBAAAA;EACR,MAAMC,aAAoBC,mBAAW,EAAS,GAAGC,KAAKC,EAAE,SAAS;IACtEC,OAAcC,cAAO;MACnBC,QAAeC,gBAAgBC,aAAM;IACvC,CAAA;IACAC,QAAeC;EACjB,CAAA,EAAA;EAAI;kBALSV,OAAAA;EAON,MAAMW,2BAAkCV,mBAAW,EAAuB,GAAGC,KAAKC,EAAE,yBAAyB;IAClHC,OAAcM;IACdD,QAAeC;EACjB,CAAA,EAAA;EAAI;kBAHSC,qBAAAA;AAIf,GAZiBZ,mBAAAA,iBAAAA,CAAAA,EAAAA;;",
6
- "names": ["meta", "id", "name", "Schema", "SETTINGS_ID", "SETTINGS_KEY", "SettingsAction", "Open", "TaggedClass", "meta", "id", "input", "Struct", "plugin", "optional", "String", "output", "Void", "OpenPluginRegistry"]
7
- }
@@ -1,54 +0,0 @@
1
- import {
2
- SETTINGS_ID,
3
- SETTINGS_KEY
4
- } from "./chunk-DIKK4DQC.mjs";
5
-
6
- // src/capabilities/operation-resolver/operation-resolver.ts
7
- import * as Effect from "effect/Effect";
8
- import { Capabilities, Capability } from "@dxos/app-framework";
9
- import { LayoutOperation, SettingsOperation, getSpacePath } from "@dxos/app-toolkit";
10
- import { OperationResolver } from "@dxos/operation";
11
- var operation_resolver_default = Capability.makeModule(Effect.fnUntraced(function* () {
12
- return Capability.contributes(Capabilities.OperationResolver, [
13
- //
14
- // Open Settings
15
- //
16
- OperationResolver.make({
17
- operation: SettingsOperation.Open,
18
- handler: (input) => Effect.gen(function* () {
19
- const { invoke } = yield* Capability.get(Capabilities.OperationInvoker);
20
- yield* invoke(LayoutOperation.SwitchWorkspace, {
21
- subject: getSpacePath(SETTINGS_ID)
22
- });
23
- if (input.plugin) {
24
- yield* Effect.fork(invoke(LayoutOperation.Open, {
25
- subject: [
26
- `${getSpacePath(SETTINGS_ID)}/${SETTINGS_KEY}:${input.plugin.replaceAll("/", ":")}`
27
- ]
28
- }));
29
- }
30
- })
31
- }),
32
- //
33
- // Open Plugin Registry
34
- //
35
- OperationResolver.make({
36
- operation: SettingsOperation.OpenPluginRegistry,
37
- handler: () => Effect.gen(function* () {
38
- const { invoke } = yield* Capability.get(Capabilities.OperationInvoker);
39
- yield* invoke(LayoutOperation.SwitchWorkspace, {
40
- subject: getSpacePath(SETTINGS_ID)
41
- });
42
- yield* Effect.fork(invoke(LayoutOperation.Open, {
43
- subject: [
44
- `${getSpacePath(SETTINGS_ID)}/${SETTINGS_KEY}:plugins`
45
- ]
46
- }));
47
- })
48
- })
49
- ]);
50
- }));
51
- export {
52
- operation_resolver_default as default
53
- };
54
- //# sourceMappingURL=operation-resolver-7AAHDR6U.mjs.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/capabilities/operation-resolver/operation-resolver.ts"],
4
- "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\n\nimport { Capabilities, Capability } from '@dxos/app-framework';\nimport { LayoutOperation, SettingsOperation, getSpacePath } from '@dxos/app-toolkit';\nimport { OperationResolver } from '@dxos/operation';\n\nimport { SETTINGS_ID, SETTINGS_KEY } from '../../actions';\n\nexport default Capability.makeModule(\n Effect.fnUntraced(function* () {\n return Capability.contributes(Capabilities.OperationResolver, [\n //\n // Open Settings\n //\n OperationResolver.make({\n operation: SettingsOperation.Open,\n handler: (input) =>\n Effect.gen(function* () {\n const { invoke } = yield* Capability.get(Capabilities.OperationInvoker);\n yield* invoke(LayoutOperation.SwitchWorkspace, { subject: getSpacePath(SETTINGS_ID) });\n if (input.plugin) {\n yield* Effect.fork(\n invoke(LayoutOperation.Open, {\n subject: [`${getSpacePath(SETTINGS_ID)}/${SETTINGS_KEY}:${input.plugin.replaceAll('/', ':')}`],\n }),\n );\n }\n }),\n }),\n\n //\n // Open Plugin Registry\n //\n OperationResolver.make({\n operation: SettingsOperation.OpenPluginRegistry,\n handler: () =>\n Effect.gen(function* () {\n const { invoke } = yield* Capability.get(Capabilities.OperationInvoker);\n yield* invoke(LayoutOperation.SwitchWorkspace, { subject: getSpacePath(SETTINGS_ID) });\n yield* Effect.fork(\n invoke(LayoutOperation.Open, {\n subject: [`${getSpacePath(SETTINGS_ID)}/${SETTINGS_KEY}:plugins`],\n }),\n );\n }),\n }),\n ]);\n }),\n);\n"],
5
- "mappings": ";;;;;;AAIA,YAAYA,YAAY;AAExB,SAASC,cAAcC,kBAAkB;AACzC,SAASC,iBAAiBC,mBAAmBC,oBAAoB;AACjE,SAASC,yBAAyB;AAIlC,IAAA,6BAAeC,WAAWC,WACjBC,kBAAW,aAAA;AAChB,SAAOF,WAAWG,YAAYC,aAAaC,mBAAmB;;;;IAI5DA,kBAAkBC,KAAK;MACrBC,WAAWC,kBAAkBC;MAC7BC,SAAS,CAACC,UACDC,WAAI,aAAA;AACT,cAAM,EAAEC,OAAM,IAAK,OAAOb,WAAWc,IAAIV,aAAaW,gBAAgB;AACtE,eAAOF,OAAOG,gBAAgBC,iBAAiB;UAAEC,SAASC,aAAaC,WAAAA;QAAa,CAAA;AACpF,YAAIT,MAAMU,QAAQ;AAChB,iBAAcC,YACZT,OAAOG,gBAAgBP,MAAM;YAC3BS,SAAS;cAAC,GAAGC,aAAaC,WAAAA,CAAAA,IAAgBG,YAAAA,IAAgBZ,MAAMU,OAAOG,WAAW,KAAK,GAAA,CAAA;;UACzF,CAAA,CAAA;QAEJ;MACF,CAAA;IACJ,CAAA;;;;IAKAnB,kBAAkBC,KAAK;MACrBC,WAAWC,kBAAkBiB;MAC7Bf,SAAS,MACAE,WAAI,aAAA;AACT,cAAM,EAAEC,OAAM,IAAK,OAAOb,WAAWc,IAAIV,aAAaW,gBAAgB;AACtE,eAAOF,OAAOG,gBAAgBC,iBAAiB;UAAEC,SAASC,aAAaC,WAAAA;QAAa,CAAA;AACpF,eAAcE,YACZT,OAAOG,gBAAgBP,MAAM;UAC3BS,SAAS;YAAC,GAAGC,aAAaC,WAAAA,CAAAA,IAAgBG,YAAAA;;QAC5C,CAAA,CAAA;MAEJ,CAAA;IACJ,CAAA;GACD;AACH,CAAA,CAAA;",
6
- "names": ["Effect", "Capabilities", "Capability", "LayoutOperation", "SettingsOperation", "getSpacePath", "OperationResolver", "Capability", "makeModule", "fnUntraced", "contributes", "Capabilities", "OperationResolver", "make", "operation", "SettingsOperation", "Open", "handler", "input", "gen", "invoke", "get", "OperationInvoker", "LayoutOperation", "SwitchWorkspace", "subject", "getSpacePath", "SETTINGS_ID", "plugin", "fork", "SETTINGS_KEY", "replaceAll", "OpenPluginRegistry"]
7
- }
@@ -1,98 +0,0 @@
1
- import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
2
- import {
3
- SETTINGS_ID,
4
- SETTINGS_KEY,
5
- meta
6
- } from "./chunk-NAEV3LFJ.mjs";
7
-
8
- // src/capabilities/app-graph-builder/app-graph-builder.ts
9
- import * as Effect from "effect/Effect";
10
- import { Capabilities, Capability } from "@dxos/app-framework";
11
- import { GraphBuilder, NodeMatcher } from "@dxos/app-graph";
12
- import { AppCapabilities, SettingsOperation, getSpacePath } from "@dxos/app-toolkit";
13
- import { Operation } from "@dxos/operation";
14
- import { isNonNullable } from "@dxos/util";
15
- var app_graph_builder_default = Capability.makeModule(Effect.fnUntraced(function* () {
16
- const capabilities = yield* Capability.Service;
17
- const managerAtom = capabilities.atom(Capabilities.PluginManager);
18
- const settingsAtom = capabilities.atom(AppCapabilities.Settings);
19
- const extensions = yield* Effect.all([
20
- GraphBuilder.createExtension({
21
- id: `${meta.id}.action`,
22
- match: NodeMatcher.whenRoot,
23
- actions: () => Effect.succeed([
24
- {
25
- id: meta.id,
26
- data: () => Operation.invoke(SettingsOperation.Open, {}),
27
- properties: {
28
- label: [
29
- "open settings label",
30
- {
31
- ns: meta.id
32
- }
33
- ],
34
- icon: "ph--gear--regular",
35
- disposition: "menu",
36
- keyBinding: {
37
- macos: "meta+,",
38
- windows: "alt+,"
39
- }
40
- }
41
- }
42
- ])
43
- }),
44
- GraphBuilder.createExtension({
45
- id: `${meta.id}.core`,
46
- match: NodeMatcher.whenRoot,
47
- connector: () => Effect.succeed([
48
- {
49
- id: SETTINGS_ID,
50
- type: meta.id,
51
- properties: {
52
- label: [
53
- "app settings label",
54
- {
55
- ns: meta.id
56
- }
57
- ],
58
- icon: "ph--gear--regular",
59
- disposition: "pin-end",
60
- position: "hoist",
61
- testId: "treeView.appSettings"
62
- }
63
- }
64
- ])
65
- }),
66
- GraphBuilder.createExtension({
67
- id: `${meta.id}.plugins`,
68
- match: NodeMatcher.whenId(getSpacePath(SETTINGS_ID)),
69
- connector: (node, get) => {
70
- const [manager] = get(managerAtom);
71
- const allSettings = get(settingsAtom);
72
- return Effect.succeed(manager.getPlugins().map((plugin) => {
73
- const settings = allSettings.find((s) => s.prefix === plugin.meta.id);
74
- if (!settings) {
75
- return null;
76
- }
77
- return [
78
- plugin.meta,
79
- settings
80
- ];
81
- }).filter(isNonNullable).map(([meta2, settings]) => ({
82
- id: `${SETTINGS_KEY}:${meta2.id.replaceAll("/", ":")}`,
83
- type: "category",
84
- data: settings,
85
- properties: {
86
- label: meta2.name ?? meta2.id,
87
- icon: meta2.icon ?? "ph--circle--regular"
88
- }
89
- })));
90
- }
91
- })
92
- ]);
93
- return Capability.contributes(AppCapabilities.AppGraphBuilder, extensions);
94
- }));
95
- export {
96
- app_graph_builder_default as default
97
- };
98
- //# sourceMappingURL=app-graph-builder-WSMWJBGZ.mjs.map