@dxos/plugin-sheet 0.9.1-main.c7dcc2e112 → 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 (122) hide show
  1. package/dist/lib/neutral/{RangeList-7NS3MU5O.mjs → RangeList-EIJTFS7P.mjs} +2 -2
  2. package/dist/lib/neutral/{RangeList-7NS3MU5O.mjs.map → RangeList-EIJTFS7P.mjs.map} +2 -2
  3. package/dist/lib/neutral/SheetPlugin.mjs +3 -5
  4. package/dist/lib/neutral/SheetPlugin.mjs.map +3 -3
  5. package/dist/lib/neutral/capabilities/index.mjs +4 -6
  6. package/dist/lib/neutral/capabilities/index.mjs.map +3 -3
  7. package/dist/lib/neutral/{chunk-2EZJRMC4.mjs → chunk-HY4DM35G.mjs} +98 -6
  8. package/dist/lib/neutral/chunk-HY4DM35G.mjs.map +7 -0
  9. package/dist/lib/neutral/chunk-TDGEOMRG.mjs +8 -0
  10. package/dist/lib/neutral/{chunk-ZJEI77EI.mjs.map → chunk-TDGEOMRG.mjs.map} +2 -2
  11. package/dist/lib/neutral/{comment-config-WGXXX5FG.mjs → comment-config-4CIQFYM2.mjs} +1 -1
  12. package/dist/lib/neutral/comment-config-4CIQFYM2.mjs.map +7 -0
  13. package/dist/lib/neutral/components/index.mjs +7 -7
  14. package/dist/lib/neutral/components/index.mjs.map +3 -3
  15. package/dist/lib/neutral/containers/index.mjs +1 -1
  16. package/dist/lib/neutral/create-I3TKMPQO.mjs +30 -0
  17. package/dist/lib/neutral/create-I3TKMPQO.mjs.map +7 -0
  18. package/dist/lib/neutral/{create-object-RR5OBY5H.mjs → create-object-5WEY5XZJ.mjs} +2 -6
  19. package/dist/lib/neutral/create-object-5WEY5XZJ.mjs.map +7 -0
  20. package/dist/lib/neutral/{drop-axis-PRINKF5X.mjs → drop-axis-JPFU5CJO.mjs} +2 -2
  21. package/dist/lib/neutral/get-values-7YWQTH65.mjs +92 -0
  22. package/dist/lib/neutral/get-values-7YWQTH65.mjs.map +7 -0
  23. package/dist/lib/neutral/index.mjs +2 -8
  24. package/dist/lib/neutral/{insert-axis-FCSVF6OW.mjs → insert-axis-WD6ZC3UA.mjs} +2 -2
  25. package/dist/lib/neutral/meta.json +1 -1
  26. package/dist/lib/neutral/operations/index.mjs +1 -1
  27. package/dist/lib/neutral/plugin.mjs +1 -1
  28. package/dist/lib/neutral/{restore-axis-2RUGHTNA.mjs → restore-axis-RLPX7P3G.mjs} +2 -2
  29. package/dist/lib/neutral/{scroll-to-anchor-7BAFVTIM.mjs → scroll-to-anchor-6FJJQWZC.mjs} +2 -2
  30. package/dist/lib/neutral/set-values-5DVOVLJH.mjs +30 -0
  31. package/dist/lib/neutral/set-values-5DVOVLJH.mjs.map +7 -0
  32. package/dist/lib/neutral/skill-definition-U3KQCFOI.mjs +12 -0
  33. package/dist/lib/neutral/skill-definition-U3KQCFOI.mjs.map +7 -0
  34. package/dist/lib/neutral/types/index.mjs +1 -1
  35. package/dist/types/src/SheetPlugin.d.ts.map +1 -1
  36. package/dist/types/src/capabilities/anchor-sort.d.ts +1 -2
  37. package/dist/types/src/capabilities/anchor-sort.d.ts.map +1 -1
  38. package/dist/types/src/capabilities/comment-config.d.ts +1 -2
  39. package/dist/types/src/capabilities/comment-config.d.ts.map +1 -1
  40. package/dist/types/src/capabilities/compute-graph-registry.d.ts +1 -1
  41. package/dist/types/src/capabilities/create-object.d.ts +1 -7
  42. package/dist/types/src/capabilities/create-object.d.ts.map +1 -1
  43. package/dist/types/src/capabilities/index.d.ts +1 -2
  44. package/dist/types/src/capabilities/index.d.ts.map +1 -1
  45. package/dist/types/src/capabilities/markdown-extension.d.ts +1 -1
  46. package/dist/types/src/capabilities/react-surface.d.ts +1 -1
  47. package/dist/types/src/capabilities/skill-definition.d.ts +5 -0
  48. package/dist/types/src/capabilities/skill-definition.d.ts.map +1 -0
  49. package/dist/types/src/capabilities/state.d.ts +1 -2
  50. package/dist/types/src/capabilities/state.d.ts.map +1 -1
  51. package/dist/types/src/capabilities/undo-mappings.d.ts +2 -2
  52. package/dist/types/src/capabilities/undo-mappings.d.ts.map +1 -1
  53. package/dist/types/src/components/Sheet/Sheet.d.ts +1 -1
  54. package/dist/types/src/components/Sheet/Sheet.d.ts.map +1 -1
  55. package/dist/types/src/index.d.ts +0 -1
  56. package/dist/types/src/index.d.ts.map +1 -1
  57. package/dist/types/src/meta.d.ts +4 -0
  58. package/dist/types/src/meta.d.ts.map +1 -1
  59. package/dist/types/src/model/sheet-model.d.ts +1 -25
  60. package/dist/types/src/model/sheet-model.d.ts.map +1 -1
  61. package/dist/types/src/operations/create.d.ts +5 -0
  62. package/dist/types/src/operations/create.d.ts.map +1 -0
  63. package/dist/types/src/operations/get-values.d.ts +5 -0
  64. package/dist/types/src/operations/get-values.d.ts.map +1 -0
  65. package/dist/types/src/operations/index.d.ts.map +1 -1
  66. package/dist/types/src/operations/set-values.d.ts +5 -0
  67. package/dist/types/src/operations/set-values.d.ts.map +1 -0
  68. package/dist/types/src/skills/index.d.ts +2 -0
  69. package/dist/types/src/skills/index.d.ts.map +1 -0
  70. package/dist/types/src/skills/sheet-skill.d.ts +4 -0
  71. package/dist/types/src/skills/sheet-skill.d.ts.map +1 -0
  72. package/dist/types/src/testing/testing.d.ts +1 -25
  73. package/dist/types/src/testing/testing.d.ts.map +1 -1
  74. package/dist/types/src/types/Sheet.d.ts +7 -28
  75. package/dist/types/src/types/Sheet.d.ts.map +1 -1
  76. package/dist/types/src/types/SheetOperation.d.ts +22 -0
  77. package/dist/types/src/types/SheetOperation.d.ts.map +1 -1
  78. package/dist/types/src/types/util.d.ts.map +1 -1
  79. package/dist/types/tsconfig.tsbuildinfo +1 -1
  80. package/package.json +60 -54
  81. package/src/SheetPlugin.tsx +3 -5
  82. package/src/capabilities/comment-config.ts +1 -6
  83. package/src/capabilities/create-object.ts +1 -4
  84. package/src/capabilities/index.ts +1 -2
  85. package/src/capabilities/skill-definition.ts +14 -0
  86. package/src/components/Sheet/Sheet.tsx +1 -1
  87. package/src/components/SheetContent/SheetCellEditor.stories.tsx +2 -2
  88. package/src/components/SheetContent/util.ts +4 -4
  89. package/src/containers/RangeList/RangeList.tsx +1 -1
  90. package/src/index.ts +0 -1
  91. package/src/operations/create.ts +24 -0
  92. package/src/operations/get-values.ts +83 -0
  93. package/src/operations/index.ts +3 -0
  94. package/src/operations/set-values.ts +29 -0
  95. package/src/skills/index.ts +5 -0
  96. package/src/skills/sheet-skill.ts +46 -0
  97. package/src/types/Sheet.ts +26 -21
  98. package/src/types/SheetOperation.ts +61 -0
  99. package/src/types/util.ts +8 -1
  100. package/dist/lib/neutral/app-graph-builder-PXTENKOB.mjs +0 -66
  101. package/dist/lib/neutral/app-graph-builder-PXTENKOB.mjs.map +0 -7
  102. package/dist/lib/neutral/chunk-2EZJRMC4.mjs.map +0 -7
  103. package/dist/lib/neutral/chunk-QT3L3OR2.mjs +0 -10
  104. package/dist/lib/neutral/chunk-QT3L3OR2.mjs.map +0 -7
  105. package/dist/lib/neutral/chunk-ZJEI77EI.mjs +0 -8
  106. package/dist/lib/neutral/comment-config-WGXXX5FG.mjs.map +0 -7
  107. package/dist/lib/neutral/create-object-RR5OBY5H.mjs.map +0 -7
  108. package/dist/lib/neutral/navigation-resolver-F5LR3IIW.mjs +0 -14
  109. package/dist/lib/neutral/navigation-resolver-F5LR3IIW.mjs.map +0 -7
  110. package/dist/types/src/capabilities/app-graph-builder.d.ts +0 -6
  111. package/dist/types/src/capabilities/app-graph-builder.d.ts.map +0 -1
  112. package/dist/types/src/capabilities/navigation-resolver.d.ts +0 -6
  113. package/dist/types/src/capabilities/navigation-resolver.d.ts.map +0 -1
  114. package/dist/types/src/paths.d.ts +0 -3
  115. package/dist/types/src/paths.d.ts.map +0 -1
  116. package/src/capabilities/app-graph-builder.ts +0 -61
  117. package/src/capabilities/navigation-resolver.ts +0 -19
  118. package/src/paths.ts +0 -11
  119. /package/dist/lib/neutral/{drop-axis-PRINKF5X.mjs.map → drop-axis-JPFU5CJO.mjs.map} +0 -0
  120. /package/dist/lib/neutral/{insert-axis-FCSVF6OW.mjs.map → insert-axis-WD6ZC3UA.mjs.map} +0 -0
  121. /package/dist/lib/neutral/{restore-axis-2RUGHTNA.mjs.map → restore-axis-RLPX7P3G.mjs.map} +0 -0
  122. /package/dist/lib/neutral/{scroll-to-anchor-7BAFVTIM.mjs.map → scroll-to-anchor-6FJJQWZC.mjs.map} +0 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dxos/plugin-sheet",
3
- "version": "0.9.1-main.c7dcc2e112",
3
+ "version": "0.9.1-staging.ee54ba693a",
4
4
  "description": "Braneframe sketch plugin",
5
5
  "homepage": "https://dxos.org",
6
6
  "bugs": "https://github.com/dxos/dxos/issues",
@@ -49,6 +49,11 @@
49
49
  "node": "./dist/lib/neutral/SheetPlugin.node.mjs",
50
50
  "default": "./dist/lib/neutral/SheetPlugin.mjs"
51
51
  },
52
+ "#skills": {
53
+ "source": "./src/skills/index.ts",
54
+ "types": "./dist/types/src/skills/index.d.ts",
55
+ "default": "./dist/lib/neutral/skills/index.mjs"
56
+ },
52
57
  "#testing": "./src/testing/index.ts",
53
58
  "#translations": {
54
59
  "source": "./src/translations.ts",
@@ -94,70 +99,71 @@
94
99
  "@lezer/common": "^1.5.2",
95
100
  "@lezer/highlight": "^1.2.3",
96
101
  "codemirror-lang-spreadsheet": "^1.3.0",
97
- "@dxos/app-framework": "0.9.1-main.c7dcc2e112",
98
- "@dxos/app-toolkit": "0.9.1-main.c7dcc2e112",
99
- "@dxos/client": "0.9.1-main.c7dcc2e112",
100
- "@dxos/compute": "0.9.1-main.c7dcc2e112",
101
- "@dxos/async": "0.9.1-main.c7dcc2e112",
102
- "@dxos/context": "0.9.1-main.c7dcc2e112",
103
- "@dxos/compute-hyperformula": "0.9.1-main.c7dcc2e112",
104
- "@dxos/debug": "0.9.1-main.c7dcc2e112",
105
- "@dxos/echo-client": "0.9.1-main.c7dcc2e112",
106
- "@dxos/echo-react": "0.9.1-main.c7dcc2e112",
107
- "@dxos/echo": "0.9.1-main.c7dcc2e112",
108
- "@dxos/invariant": "0.9.1-main.c7dcc2e112",
109
- "@dxos/keys": "0.9.1-main.c7dcc2e112",
110
- "@dxos/log": "0.9.1-main.c7dcc2e112",
111
- "@dxos/plugin-client": "0.9.1-main.c7dcc2e112",
112
- "@dxos/plugin-graph": "0.9.1-main.c7dcc2e112",
113
- "@dxos/lit-grid": "0.9.1-main.c7dcc2e112",
114
- "@dxos/plugin-markdown": "0.9.1-main.c7dcc2e112",
115
- "@dxos/plugin-comments": "0.9.1-main.c7dcc2e112",
116
- "@dxos/plugin-space": "0.9.1-main.c7dcc2e112",
117
- "@dxos/react-client": "0.9.1-main.c7dcc2e112",
118
- "@dxos/crypto": "0.9.1-main.c7dcc2e112",
119
- "@dxos/react-ui-attention": "0.9.1-main.c7dcc2e112",
120
- "@dxos/react-hooks": "0.9.1-main.c7dcc2e112",
121
- "@dxos/react-ui-editor": "0.9.1-main.c7dcc2e112",
122
- "@dxos/react-ui-grid": "0.9.1-main.c7dcc2e112",
123
- "@dxos/react-ui-form": "0.9.1-main.c7dcc2e112",
124
- "@dxos/react-ui-menu": "0.9.1-main.c7dcc2e112",
125
- "@dxos/react-ui-list": "0.9.1-main.c7dcc2e112",
126
- "@dxos/ui-editor": "0.9.1-main.c7dcc2e112",
127
- "@dxos/types": "0.9.1-main.c7dcc2e112",
128
- "@dxos/util": "0.9.1-main.c7dcc2e112"
102
+ "@dxos/app-framework": "0.9.1-staging.ee54ba693a",
103
+ "@dxos/app-toolkit": "0.9.1-staging.ee54ba693a",
104
+ "@dxos/client": "0.9.1-staging.ee54ba693a",
105
+ "@dxos/compute": "0.9.1-staging.ee54ba693a",
106
+ "@dxos/compute-hyperformula": "0.9.1-staging.ee54ba693a",
107
+ "@dxos/context": "0.9.1-staging.ee54ba693a",
108
+ "@dxos/async": "0.9.1-staging.ee54ba693a",
109
+ "@dxos/crypto": "0.9.1-staging.ee54ba693a",
110
+ "@dxos/echo": "0.9.1-staging.ee54ba693a",
111
+ "@dxos/debug": "0.9.1-staging.ee54ba693a",
112
+ "@dxos/invariant": "0.9.1-staging.ee54ba693a",
113
+ "@dxos/echo-react": "0.9.1-staging.ee54ba693a",
114
+ "@dxos/lit-grid": "0.9.1-staging.ee54ba693a",
115
+ "@dxos/log": "0.9.1-staging.ee54ba693a",
116
+ "@dxos/keys": "0.9.1-staging.ee54ba693a",
117
+ "@dxos/plugin-client": "0.9.1-staging.ee54ba693a",
118
+ "@dxos/plugin-comments": "0.9.1-staging.ee54ba693a",
119
+ "@dxos/plugin-graph": "0.9.1-staging.ee54ba693a",
120
+ "@dxos/plugin-markdown": "0.9.1-staging.ee54ba693a",
121
+ "@dxos/echo-doc": "0.9.1-staging.ee54ba693a",
122
+ "@dxos/react-hooks": "0.9.1-staging.ee54ba693a",
123
+ "@dxos/react-client": "0.9.1-staging.ee54ba693a",
124
+ "@dxos/react-ui-attention": "0.9.1-staging.ee54ba693a",
125
+ "@dxos/react-ui-form": "0.9.1-staging.ee54ba693a",
126
+ "@dxos/plugin-space": "0.9.1-staging.ee54ba693a",
127
+ "@dxos/react-ui-grid": "0.9.1-staging.ee54ba693a",
128
+ "@dxos/react-ui-list": "0.9.1-staging.ee54ba693a",
129
+ "@dxos/react-ui-menu": "0.9.1-staging.ee54ba693a",
130
+ "@dxos/schema": "0.9.1-staging.ee54ba693a",
131
+ "@dxos/types": "0.9.1-staging.ee54ba693a",
132
+ "@dxos/ui-editor": "0.9.1-staging.ee54ba693a",
133
+ "@dxos/util": "0.9.1-staging.ee54ba693a",
134
+ "@dxos/react-ui-editor": "0.9.1-staging.ee54ba693a"
129
135
  },
130
136
  "devDependencies": {
131
137
  "@effect-atom/atom-react": "^0.5.0",
132
- "@effect/platform": "0.96.1",
138
+ "@effect/platform": "0.96.2",
133
139
  "@lezer/generator": "^1.8.0",
134
140
  "@tldraw/indices": "^2.0.0-alpha.14",
135
141
  "@types/lodash.defaultsdeep": "^4.6.6",
136
- "@types/react": "~19.2.7",
142
+ "@types/react": "~19.2.17",
137
143
  "@types/react-dom": "~19.2.3",
138
- "effect": "3.21.3",
139
- "react": "~19.2.3",
140
- "react-dom": "~19.2.3",
144
+ "effect": "3.21.4",
145
+ "react": "~19.2.7",
146
+ "react-dom": "~19.2.7",
141
147
  "vite": "^8.0.16",
142
- "@dxos/lit-grid": "0.9.1-main.c7dcc2e112",
143
- "@dxos/echo-generator": "0.9.1-main.c7dcc2e112",
144
- "@dxos/random": "0.9.1-main.c7dcc2e112",
145
- "@dxos/react-ui-syntax-highlighter": "0.9.1-main.c7dcc2e112",
146
- "@dxos/plugin-testing": "0.9.1-main.c7dcc2e112",
147
- "@dxos/react-ui": "0.9.1-main.c7dcc2e112",
148
- "@dxos/storybook-utils": "0.9.1-main.c7dcc2e112",
149
- "@dxos/test-utils": "0.9.1-main.c7dcc2e112",
150
- "@dxos/ui-theme": "0.9.1-main.c7dcc2e112",
151
- "@dxos/ui-types": "0.9.1-main.c7dcc2e112"
148
+ "@dxos/echo-generator": "0.9.1-staging.ee54ba693a",
149
+ "@dxos/lit-grid": "0.9.1-staging.ee54ba693a",
150
+ "@dxos/plugin-testing": "0.9.1-staging.ee54ba693a",
151
+ "@dxos/random": "0.9.1-staging.ee54ba693a",
152
+ "@dxos/react-ui": "0.9.1-staging.ee54ba693a",
153
+ "@dxos/react-ui-syntax-highlighter": "0.9.1-staging.ee54ba693a",
154
+ "@dxos/storybook-utils": "0.9.1-staging.ee54ba693a",
155
+ "@dxos/test-utils": "0.9.1-staging.ee54ba693a",
156
+ "@dxos/ui-types": "0.9.1-staging.ee54ba693a",
157
+ "@dxos/ui-theme": "0.9.1-staging.ee54ba693a"
152
158
  },
153
159
  "peerDependencies": {
154
160
  "@effect-atom/atom-react": "^0.5.0",
155
- "@effect/platform": "0.96.1",
156
- "effect": "3.21.3",
157
- "react": "~19.2.3",
158
- "react-dom": "~19.2.3",
159
- "@dxos/react-ui": "0.9.1-main.c7dcc2e112",
160
- "@dxos/ui-theme": "0.9.1-main.c7dcc2e112"
161
+ "@effect/platform": "0.96.2",
162
+ "effect": "3.21.4",
163
+ "react": "~19.2.7",
164
+ "react-dom": "~19.2.7",
165
+ "@dxos/ui-theme": "0.9.1-staging.ee54ba693a",
166
+ "@dxos/react-ui": "0.9.1-staging.ee54ba693a"
161
167
  },
162
168
  "publishConfig": {
163
169
  "access": "public"
@@ -9,16 +9,15 @@ import { MarkdownEvents } from '@dxos/plugin-markdown';
9
9
 
10
10
  import {
11
11
  AnchorSort,
12
- AppGraphBuilder,
13
- NavigationResolver,
14
12
  CommentConfig,
15
13
  ComputeGraphRegistry,
16
14
  CreateObject,
17
15
  Markdown,
18
16
  OperationHandler,
19
- UndoMappings,
20
17
  ReactSurface,
21
18
  SheetState,
19
+ SkillDefinition,
20
+ UndoMappings,
22
21
  } from '#capabilities';
23
22
  import { meta } from '#meta';
24
23
  import { translations } from '#translations';
@@ -28,8 +27,7 @@ import { Sheet } from '#types';
28
27
  import pluginSpec from '../PLUGIN.mdl?raw';
29
28
 
30
29
  export const SheetPlugin = Plugin.define(meta).pipe(
31
- AppPlugin.addAppGraphModule({ activate: AppGraphBuilder }),
32
- AppPlugin.addNavigationResolverModule({ activate: NavigationResolver }),
30
+ AppPlugin.addSkillDefinitionModule({ activate: SkillDefinition }),
33
31
  AppPlugin.addCommentConfigModule({ activate: CommentConfig }),
34
32
  AppPlugin.addCreateObjectModule({ activate: CreateObject }),
35
33
  AppPlugin.addOperationHandlerModule({ activate: OperationHandler }),
@@ -11,12 +11,7 @@ import { Type } from '@dxos/echo';
11
11
  import { SheetOperation } from '#types';
12
12
  import { Sheet } from '#types';
13
13
 
14
- // NOTE: Explicit annotation required: d.ts emit cannot portably name the inferred @dxos/compute types (TS2883).
15
- const activate: () => Effect.Effect<
16
- Capability.Capability<typeof AppCapabilities.CommentConfig>,
17
- never,
18
- Capability.Service
19
- > = Effect.fnUntraced(function* () {
14
+ const activate = Effect.fnUntraced(function* () {
20
15
  const config: AppCapabilities.CommentConfig = {
21
16
  id: Type.getTypename(Sheet.Sheet),
22
17
  comments: 'anchored',
@@ -12,8 +12,6 @@ import { SpaceCapabilities } from '@dxos/plugin-space';
12
12
 
13
13
  import { Sheet } from '#types';
14
14
 
15
- import { getSheetsPath } from '../paths';
16
-
17
15
  export default Capability.makeModule(
18
16
  Effect.fnUntraced(function* () {
19
17
  return Capability.contributes(SpaceCapabilities.CreateObjectEntry, {
@@ -24,8 +22,7 @@ export default Capability.makeModule(
24
22
  return yield* Operation.invoke(SpaceOperation.AddObject, {
25
23
  object,
26
24
  target: options.target,
27
- hidden: true,
28
- targetNodeId: options.targetNodeId ?? getSheetsPath(options.db.spaceId),
25
+ targetNodeId: options.targetNodeId,
29
26
  });
30
27
  }),
31
28
  });
@@ -5,8 +5,6 @@
5
5
  import { Capability } from '@dxos/app-framework';
6
6
  import { OperationHandlerSet } from '@dxos/compute';
7
7
 
8
- export const AppGraphBuilder = Capability.lazy('AppGraphBuilder', () => import('./app-graph-builder'));
9
- export const NavigationResolver = Capability.lazy('NavigationResolver', () => import('./navigation-resolver'));
10
8
  export const AnchorSort = Capability.lazy('AnchorSort', () => import('./anchor-sort'));
11
9
  export const CommentConfig = Capability.lazy('CommentConfig', () => import('./comment-config'));
12
10
  export const ComputeGraphRegistry = Capability.lazy('ComputeGraphRegistry', () => import('./compute-graph-registry'));
@@ -18,4 +16,5 @@ export const OperationHandler = Capability.lazy<OperationHandlerSet.OperationHan
18
16
  );
19
17
  export const ReactSurface = Capability.lazy('ReactSurface', () => import('./react-surface'));
20
18
  export const SheetState = Capability.lazy('SheetState', () => import('./state'));
19
+ export const SkillDefinition = Capability.lazy('SkillDefinition', () => import('./skill-definition'));
21
20
  export const UndoMappings = Capability.lazy('UndoMappings', () => import('./undo-mappings'));
@@ -0,0 +1,14 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ import * as Effect from 'effect/Effect';
6
+
7
+ import { Capability } from '@dxos/app-framework';
8
+ import { AppCapabilities } from '@dxos/app-toolkit';
9
+
10
+ import { SheetSkill } from '#skills';
11
+
12
+ export default Capability.makeModule(() =>
13
+ Effect.succeed(Capability.contributes(AppCapabilities.SkillDefinition, SheetSkill)),
14
+ );
@@ -7,7 +7,7 @@ import { SheetRoot } from '../SheetRoot';
7
7
  import { SheetStatusbar } from '../SheetStatusbar';
8
8
  import { SheetToolbar } from '../SheetToolbar';
9
9
 
10
- export { useSheetContext, type SheetContextValue, type SheetRootProps } from '../SheetRoot';
10
+ export { type SheetContextValue, type SheetRootProps, useSheetContext } from '../SheetRoot';
11
11
  export { type SheetContentProps } from '../SheetContent';
12
12
  export { type SheetToolbarProps } from '../SheetToolbar';
13
13
  export { type SheetStatusbarProps } from '../SheetStatusbar';
@@ -9,7 +9,7 @@ import { Client } from '@dxos/client';
9
9
  import { defaultFunctions } from '@dxos/compute-hyperformula';
10
10
  import { getRegisteredFunctionNames } from '@dxos/compute-hyperformula/testing';
11
11
  import { Obj } from '@dxos/echo';
12
- import { createDocAccessor } from '@dxos/echo-client';
12
+ import { Doc } from '@dxos/echo-doc';
13
13
  import { useAsyncEffect } from '@dxos/react-hooks';
14
14
  import { CellEditor, type CellEditorProps } from '@dxos/react-ui-grid';
15
15
  import { withTheme } from '@dxos/react-ui/testing';
@@ -54,7 +54,7 @@ const AutomergeStory = ({ value, ...props }: CellEditorProps) => {
54
54
 
55
55
  const functionNames = getRegisteredFunctionNames();
56
56
  const functions = defaultFunctions.filter(({ name }) => functionNames.includes(name));
57
- const accessor = createDocAccessor(object, ['cells', cell, 'value']);
57
+ const accessor = Doc.createAccessor(object, ['cells', cell, 'value']);
58
58
  return [automerge(accessor), sheetExtension({ functions })];
59
59
  }, [object]);
60
60
 
@@ -5,7 +5,7 @@
5
5
  import { useEffect, useState } from 'react';
6
6
 
7
7
  import { inRange } from '@dxos/compute-hyperformula';
8
- import { createDocAccessor } from '@dxos/echo-client';
8
+ import { Doc } from '@dxos/echo-doc';
9
9
  import { cellClassesForFieldType, parseValue } from '@dxos/react-ui-form';
10
10
  import {
11
11
  type DxGridAxisMeta,
@@ -144,7 +144,7 @@ export const useSheetModelDxGridProps = (
144
144
  const [rows, setRows] = useState<DxGridAxisMeta>(createDxGridRows(model));
145
145
 
146
146
  useEffect(() => {
147
- const cellsAccessor = createDocAccessor(model.sheet, ['cells']);
147
+ const cellsAccessor = Doc.createAccessor(model.sheet, ['cells']);
148
148
  if (dxGrid) {
149
149
  dxGrid.getCells = cellGetter(model);
150
150
  }
@@ -160,8 +160,8 @@ export const useSheetModelDxGridProps = (
160
160
  }, [model, dxGrid]);
161
161
 
162
162
  useEffect(() => {
163
- const columnMetaAccessor = createDocAccessor(model.sheet, ['columnMeta']);
164
- const rowMetaAccessor = createDocAccessor(model.sheet, ['rowMeta']);
163
+ const columnMetaAccessor = Doc.createAccessor(model.sheet, ['columnMeta']);
164
+ const rowMetaAccessor = Doc.createAccessor(model.sheet, ['rowMeta']);
165
165
  const handleColumnMetaUpdate = () => {
166
166
  setColumns(createDxGridColumns(model));
167
167
  };
@@ -37,7 +37,7 @@ export const RangeList = ({ sheet: sheetProp }: RangeListProps) => {
37
37
  <Input.Root>
38
38
  <Input.Label>{t('range-list.heading')}</Input.Label>
39
39
  </Input.Root>
40
- {sheet.ranges.length < 1 ? (
40
+ {sheet.ranges.length === 0 ? (
41
41
  <Message.Root>
42
42
  <Message.Title>{t('no-ranges.message')}</Message.Title>
43
43
  </Message.Root>
package/src/index.ts CHANGED
@@ -4,5 +4,4 @@
4
4
 
5
5
  export * from './meta';
6
6
  export * from './operations';
7
- export * from './paths';
8
7
  export * from './types';
@@ -0,0 +1,24 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ import * as Effect from 'effect/Effect';
6
+
7
+ import { CollectionModel } from '@dxos/app-toolkit';
8
+ import { Operation } from '@dxos/compute';
9
+ import { Database, Obj } from '@dxos/echo';
10
+
11
+ import { Sheet, SheetOperation } from '../types';
12
+
13
+ const handler: Operation.WithHandler<typeof SheetOperation.Create> = SheetOperation.Create.pipe(
14
+ Operation.withHandler(
15
+ Effect.fn(function* ({ name, rows, columns }) {
16
+ const object = yield* Database.add(Sheet.make({ name, rows, columns }));
17
+ yield* CollectionModel.add({ object }).pipe(Effect.catchTag('EntityNotFoundError', () => Effect.void));
18
+ yield* Database.flush();
19
+ return { id: Obj.getURI(object) };
20
+ }),
21
+ ),
22
+ );
23
+
24
+ export default handler;
@@ -0,0 +1,83 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ import * as Effect from 'effect/Effect';
6
+
7
+ import { Operation } from '@dxos/compute';
8
+ import { addressFromA1Notation, addressToA1Notation, isFormula } from '@dxos/compute-hyperformula';
9
+ import { Database } from '@dxos/echo';
10
+
11
+ import { SheetOperation, addressFromIndex, addressToIndex, mapFormulaIndicesToRefs } from '../types';
12
+
13
+ const handler: Operation.WithHandler<typeof SheetOperation.GetValues> = SheetOperation.GetValues.pipe(
14
+ Operation.withHandler(
15
+ Effect.fn(function* ({ sheet: sheetRef, range }) {
16
+ const sheet = yield* Database.load(sheetRef);
17
+
18
+ let fromRow: number;
19
+ let fromCol: number;
20
+ let toRow: number;
21
+ let toCol: number;
22
+
23
+ if (range) {
24
+ const [fromPart, toPart = fromPart] = range.split(':');
25
+ const from = addressFromA1Notation(fromPart);
26
+ const to = addressFromA1Notation(toPart);
27
+ fromRow = from.row;
28
+ fromCol = from.col;
29
+ toRow = to.row;
30
+ toCol = to.col;
31
+ } else {
32
+ let minRow = Infinity;
33
+ let minCol = Infinity;
34
+ let maxRow = -1;
35
+ let maxCol = -1;
36
+ for (const key of Object.keys(sheet.cells)) {
37
+ const cellValue = sheet.cells[key]?.value;
38
+ if (cellValue !== undefined && cellValue !== null) {
39
+ const { row, col } = addressFromIndex(sheet, key);
40
+ if (row < minRow) {
41
+ minRow = row;
42
+ }
43
+ if (row > maxRow) {
44
+ maxRow = row;
45
+ }
46
+ if (col < minCol) {
47
+ minCol = col;
48
+ }
49
+ if (col > maxCol) {
50
+ maxCol = col;
51
+ }
52
+ }
53
+ }
54
+ fromRow = minRow === Infinity ? 0 : minRow;
55
+ fromCol = minCol === Infinity ? 0 : minCol;
56
+ toRow = maxRow;
57
+ toCol = maxCol;
58
+ }
59
+
60
+ if (toRow < 0) {
61
+ return { values: [], range: 'A1:A1' };
62
+ }
63
+
64
+ const values: (unknown | null)[][] = [];
65
+ for (let row = fromRow; row <= toRow; row++) {
66
+ const rowValues: (unknown | null)[] = [];
67
+ for (let col = fromCol; col <= toCol; col++) {
68
+ const idx = addressToIndex(sheet, { row, col });
69
+ const rawValue = sheet.cells[idx]?.value ?? null;
70
+ const value =
71
+ rawValue !== null && isFormula(String(rawValue)) ? mapFormulaIndicesToRefs(sheet, rawValue) : rawValue;
72
+ rowValues.push(value);
73
+ }
74
+ values.push(rowValues);
75
+ }
76
+
77
+ const actualRange = `${addressToA1Notation({ row: fromRow, col: fromCol })}:${addressToA1Notation({ row: toRow, col: toCol })}`;
78
+ return { values, range: actualRange };
79
+ }),
80
+ ),
81
+ );
82
+
83
+ export default handler;
@@ -5,8 +5,11 @@
5
5
  import { OperationHandlerSet } from '@dxos/compute';
6
6
 
7
7
  export const SheetOperationHandlerSet = OperationHandlerSet.lazy(
8
+ () => import('./create'),
8
9
  () => import('./drop-axis'),
10
+ () => import('./get-values'),
9
11
  () => import('./insert-axis'),
10
12
  () => import('./restore-axis'),
11
13
  () => import('./scroll-to-anchor'),
14
+ () => import('./set-values'),
12
15
  );
@@ -0,0 +1,29 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ import * as Effect from 'effect/Effect';
6
+
7
+ import { Operation } from '@dxos/compute';
8
+ import { addressFromA1Notation, isFormula } from '@dxos/compute-hyperformula';
9
+ import { Database, Obj } from '@dxos/echo';
10
+
11
+ import { SheetOperation, addressToIndex, mapFormulaRefsToIndices } from '../types';
12
+
13
+ const handler: Operation.WithHandler<typeof SheetOperation.SetValues> = SheetOperation.SetValues.pipe(
14
+ Operation.withHandler(
15
+ Effect.fn(function* ({ sheet: sheetRef, cells }) {
16
+ const sheet = yield* Database.load(sheetRef);
17
+ Obj.update(sheet, (sheet) => {
18
+ for (const [address, value] of Object.entries(cells)) {
19
+ const cell = addressFromA1Notation(address);
20
+ const idx = addressToIndex(sheet, cell);
21
+ const stored = isFormula(String(value)) ? mapFormulaRefsToIndices(sheet, String(value)) : value;
22
+ sheet.cells[idx] = { value: stored };
23
+ }
24
+ });
25
+ }),
26
+ ),
27
+ );
28
+
29
+ export default handler;
@@ -0,0 +1,5 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ export { default as SheetSkill } from './sheet-skill';
@@ -0,0 +1,46 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ import { Skill, Template } from '@dxos/compute';
6
+ import { trim } from '@dxos/util';
7
+
8
+ import { Sheet, SheetOperation } from '#types';
9
+
10
+ const operations = [SheetOperation.Create, SheetOperation.GetValues, SheetOperation.SetValues];
11
+
12
+ const make = () =>
13
+ Skill.make({
14
+ key: Sheet.SKILL_KEY,
15
+ name: 'Sheet',
16
+ tools: Skill.toolDefinitions({ operations }),
17
+ agentCanEnable: true,
18
+ instructions: Template.make({
19
+ source: trim`
20
+ You are an expert at working with spreadsheets.
21
+ The context object represents a Sheet — a collaborative spreadsheet backed by ECHO.
22
+
23
+ ## Reading data
24
+
25
+ Use the \`getValues\` tool to read cell values from the sheet.
26
+ It returns a 2D array indexed [row][col] and the A1 range it covers.
27
+ Omit the \`range\` parameter to read the entire occupied area, or pass a range like "A1:C5" to read a subset.
28
+
29
+ ## Writing data
30
+
31
+ Use \`setValues\` to write one or more cells at once.
32
+ Pass a map of A1 addresses to values, e.g. \`{ "A1": "Name", "B1": 42, "C1": "=SUM(A1:A5)" }\`.
33
+ Cell values can be plain scalars (string, number, boolean) or formula strings starting with "=".
34
+ Formula examples: "=SUM(A1:A5)", "=A1*B1", "=IF(C2>0,\"yes\",\"no\")".
35
+ Over 400 HyperFormula functions are available: arithmetic, statistical, text, date/time, financial, logical.
36
+
37
+ `,
38
+ }),
39
+ });
40
+
41
+ const skill: Skill.Definition = {
42
+ key: Sheet.SKILL_KEY,
43
+ make,
44
+ };
45
+
46
+ export default skill;
@@ -6,12 +6,16 @@
6
6
 
7
7
  import * as Schema from 'effect/Schema';
8
8
 
9
+ import { AppAnnotation } from '@dxos/app-toolkit';
9
10
  import { addressFromA1Notation, isFormula } from '@dxos/compute-hyperformula';
10
- import { DXN, Annotation, Obj, Type } from '@dxos/echo';
11
+ import { Annotation, DXN, Obj, Type } from '@dxos/echo';
11
12
  import { FormInputAnnotation } from '@dxos/echo/Annotation';
13
+ import { CollectionItemAnnotation } from '@dxos/schema';
12
14
 
13
15
  import { addressToIndex, initialize, mapFormulaRefsToIndices } from './util';
14
16
 
17
+ export const SKILL_KEY = 'org.dxos.skill.sheet';
18
+
15
19
  export type SheetSize = {
16
20
  rows: number;
17
21
  columns: number;
@@ -42,32 +46,33 @@ export const RowColumnMeta = Schema.Struct({
42
46
 
43
47
  // TODO(burdon): Reconcile col/column (across packages).
44
48
  // TODO(burdon): Index to all updates when rows/columns are inserted/deleted.
45
- export const Sheet = Schema.Struct({
46
- name: Schema.optional(Schema.String),
47
-
48
- // Sparse map of cells referenced by index.
49
- cells: Schema.Record({ key: Schema.String, value: CellValue }).pipe(FormInputAnnotation.set(false)),
49
+ export class Sheet extends Type.makeObject<Sheet>(DXN.make('org.dxos.type.sheet', '0.1.0'))(
50
+ Schema.Struct({
51
+ name: Schema.optional(Schema.String),
50
52
 
51
- // Ordered row indices.
52
- rows: Schema.Array(Schema.String).pipe(FormInputAnnotation.set(false)),
53
+ // Sparse map of cells referenced by index.
54
+ cells: Schema.Record({ key: Schema.String, value: CellValue }).pipe(FormInputAnnotation.set(false)),
53
55
 
54
- // Ordered column indices.
55
- columns: Schema.Array(Schema.String).pipe(FormInputAnnotation.set(false)),
56
+ // Ordered row indices.
57
+ rows: Schema.Array(Schema.String).pipe(FormInputAnnotation.set(false)),
56
58
 
57
- // Row metadata referenced by index.
58
- rowMeta: Schema.Record({ key: Schema.String, value: RowColumnMeta }).pipe(FormInputAnnotation.set(false)),
59
+ // Ordered column indices.
60
+ columns: Schema.Array(Schema.String).pipe(FormInputAnnotation.set(false)),
59
61
 
60
- // Column metadata referenced by index.
61
- columnMeta: Schema.Record({ key: Schema.String, value: RowColumnMeta }).pipe(FormInputAnnotation.set(false)),
62
+ // Row metadata referenced by index.
63
+ rowMeta: Schema.Record({ key: Schema.String, value: RowColumnMeta }).pipe(FormInputAnnotation.set(false)),
62
64
 
63
- // Cell formatting referenced by indexed range.
64
- ranges: Schema.Array(Range).pipe(FormInputAnnotation.set(false)),
65
- }).pipe(
66
- Annotation.IconAnnotation.set({ icon: 'ph--grid-nine--regular', hue: 'indigo' }),
67
- Type.makeObject(DXN.make('org.dxos.type.sheet', '0.1.0')),
68
- );
65
+ // Column metadata referenced by index.
66
+ columnMeta: Schema.Record({ key: Schema.String, value: RowColumnMeta }).pipe(FormInputAnnotation.set(false)),
69
67
 
70
- export type Sheet = Type.InstanceType<typeof Sheet>;
68
+ // Cell formatting referenced by indexed range.
69
+ ranges: Schema.Array(Range).pipe(FormInputAnnotation.set(false)),
70
+ }).pipe(
71
+ Annotation.IconAnnotation.set({ icon: 'ph--grid-nine--regular', hue: 'indigo' }),
72
+ AppAnnotation.SkillsAnnotation.set([SKILL_KEY]),
73
+ CollectionItemAnnotation.set(true),
74
+ ),
75
+ ) {}
71
76
 
72
77
  export type SheetProps = {
73
78
  name?: string;