@dxos/plugin-script 0.8.1 → 0.8.2-main.2f9c567

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 (206) hide show
  1. package/dist/lib/browser/DeploymentDialog-EMYG5BCD.mjs +12 -0
  2. package/dist/lib/browser/{ScriptContainer-R25PRK2D.mjs → ScriptContainer-YI4U25EM.mjs} +6 -6
  3. package/dist/lib/browser/ScriptContainer-YI4U25EM.mjs.map +7 -0
  4. package/dist/lib/browser/{app-graph-builder-RRLY67QC.mjs → app-graph-builder-2GIBRQLV.mjs} +2 -2
  5. package/dist/lib/browser/{artifact-definition-WXFYD2V5.mjs → artifact-definition-PD4UAAQZ.mjs} +44 -38
  6. package/dist/lib/browser/artifact-definition-PD4UAAQZ.mjs.map +7 -0
  7. package/dist/lib/browser/{chunk-2CGZFDCR.mjs → chunk-4EA5VWVM.mjs} +7 -7
  8. package/dist/lib/browser/chunk-4EA5VWVM.mjs.map +7 -0
  9. package/dist/lib/browser/chunk-6MLJJI73.mjs +40 -0
  10. package/dist/lib/browser/chunk-6MLJJI73.mjs.map +7 -0
  11. package/dist/lib/browser/{chunk-4VD3K3PY.mjs → chunk-A4VOGQ2P.mjs} +2 -2
  12. package/dist/lib/browser/{chunk-MQZQB5VD.mjs → chunk-AA3MEHWR.mjs} +9 -9
  13. package/dist/lib/browser/chunk-AA3MEHWR.mjs.map +7 -0
  14. package/dist/lib/browser/chunk-AIO76GTZ.mjs +87 -0
  15. package/dist/lib/browser/chunk-AIO76GTZ.mjs.map +7 -0
  16. package/dist/lib/browser/{chunk-KLEOGVXY.mjs → chunk-FIWZUPMO.mjs} +7 -7
  17. package/dist/lib/browser/chunk-FIWZUPMO.mjs.map +7 -0
  18. package/dist/lib/browser/{chunk-WSK3YQXI.mjs → chunk-KJMVDGRB.mjs} +2 -1
  19. package/dist/lib/browser/{chunk-WSK3YQXI.mjs.map → chunk-KJMVDGRB.mjs.map} +2 -2
  20. package/dist/lib/browser/{chunk-CSZXPLYY.mjs → chunk-RIKHDIEO.mjs} +3 -3
  21. package/dist/lib/browser/chunk-RIKHDIEO.mjs.map +7 -0
  22. package/dist/lib/browser/{compiler-56LTBEQB.mjs → compiler-O4FJK7RR.mjs} +3 -3
  23. package/dist/lib/browser/index.mjs +16 -15
  24. package/dist/lib/browser/index.mjs.map +3 -3
  25. package/dist/lib/browser/{intent-resolver-WCVXKRBR.mjs → intent-resolver-UCPY7F6I.mjs} +14 -14
  26. package/dist/lib/browser/intent-resolver-UCPY7F6I.mjs.map +7 -0
  27. package/dist/lib/browser/meta.json +1 -1
  28. package/dist/lib/browser/{react-surface-WXZVPNGI.mjs → react-surface-M76DWUVT.mjs} +10 -10
  29. package/dist/lib/browser/react-surface-M76DWUVT.mjs.map +7 -0
  30. package/dist/lib/browser/{settings-Z7B37V2I.mjs → settings-EOKSUGB6.mjs} +5 -5
  31. package/dist/lib/browser/settings-EOKSUGB6.mjs.map +7 -0
  32. package/dist/lib/browser/types.mjs +2 -2
  33. package/dist/lib/node/{DeploymentDialog-O4MU4OMF.cjs → DeploymentDialog-VWKE3X2Y.cjs} +10 -10
  34. package/dist/lib/node/DeploymentDialog-VWKE3X2Y.cjs.map +7 -0
  35. package/dist/lib/node/{ScriptContainer-5KY6ZOQD.cjs → ScriptContainer-2MIDQAOV.cjs} +15 -15
  36. package/dist/lib/node/ScriptContainer-2MIDQAOV.cjs.map +7 -0
  37. package/dist/lib/node/{app-graph-builder-6I2BWD46.cjs → app-graph-builder-LNI22TZF.cjs} +9 -9
  38. package/dist/lib/node/{artifact-definition-6NVXEHJD.cjs → artifact-definition-C644EAYM.cjs} +53 -47
  39. package/dist/lib/node/artifact-definition-C644EAYM.cjs.map +7 -0
  40. package/dist/lib/node/chunk-BWBZ22HH.cjs +91 -0
  41. package/dist/lib/node/chunk-BWBZ22HH.cjs.map +7 -0
  42. package/dist/lib/node/{chunk-F4DP7WON.cjs → chunk-FVCSTJDX.cjs} +22 -22
  43. package/dist/lib/node/chunk-FVCSTJDX.cjs.map +7 -0
  44. package/dist/lib/node/{chunk-SLDJM45C.cjs → chunk-I4U27VO6.cjs} +17 -17
  45. package/dist/lib/node/chunk-I4U27VO6.cjs.map +7 -0
  46. package/dist/lib/node/{chunk-JICWAOWZ.cjs → chunk-KFJQVOGS.cjs} +6 -6
  47. package/dist/lib/node/{chunk-65MIJR3Q.cjs → chunk-NBOJUJSM.cjs} +17 -17
  48. package/dist/lib/node/chunk-NBOJUJSM.cjs.map +7 -0
  49. package/dist/lib/node/{chunk-YJQZHKKA.cjs → chunk-NO5Y74F3.cjs} +5 -4
  50. package/dist/lib/node/{chunk-YJQZHKKA.cjs.map → chunk-NO5Y74F3.cjs.map} +2 -2
  51. package/dist/lib/node/{chunk-XFZPWFEG.cjs → chunk-SXJGHLK6.cjs} +18 -19
  52. package/dist/lib/node/chunk-SXJGHLK6.cjs.map +7 -0
  53. package/dist/lib/node/{chunk-VYBEBLDO.cjs → chunk-XT76CMHH.cjs} +13 -13
  54. package/dist/lib/node/chunk-XT76CMHH.cjs.map +7 -0
  55. package/dist/lib/node/{compiler-W2RU3M7U.cjs → compiler-FBC6ELQN.cjs} +7 -7
  56. package/dist/lib/node/index.cjs +45 -44
  57. package/dist/lib/node/index.cjs.map +3 -3
  58. package/dist/lib/node/{intent-resolver-J4NBDNFH.cjs → intent-resolver-IO3FBKP2.cjs} +21 -21
  59. package/dist/lib/node/intent-resolver-IO3FBKP2.cjs.map +7 -0
  60. package/dist/lib/node/meta.json +1 -1
  61. package/dist/lib/node/{react-surface-27KTUBIZ.cjs → react-surface-AIHO75E7.cjs} +37 -37
  62. package/dist/lib/node/react-surface-AIHO75E7.cjs.map +7 -0
  63. package/dist/lib/node/{settings-EI6VPNKN.cjs → settings-425QHVGC.cjs} +9 -9
  64. package/dist/lib/node/settings-425QHVGC.cjs.map +7 -0
  65. package/dist/lib/node/types.cjs +5 -5
  66. package/dist/lib/node/types.cjs.map +1 -1
  67. package/dist/lib/node-esm/{DeploymentDialog-SSQSWLHX.mjs → DeploymentDialog-FGFA6MG2.mjs} +5 -5
  68. package/dist/lib/node-esm/{ScriptContainer-W2F4FGDV.mjs → ScriptContainer-GYTXNQMB.mjs} +6 -6
  69. package/dist/lib/node-esm/ScriptContainer-GYTXNQMB.mjs.map +7 -0
  70. package/dist/lib/node-esm/{app-graph-builder-H5XLRVX3.mjs → app-graph-builder-NNUXXXMZ.mjs} +2 -2
  71. package/dist/lib/node-esm/{artifact-definition-KQ64AYBP.mjs → artifact-definition-J6UM6BQF.mjs} +44 -38
  72. package/dist/lib/node-esm/artifact-definition-J6UM6BQF.mjs.map +7 -0
  73. package/dist/lib/node-esm/{chunk-PBGVTGL2.mjs → chunk-3FAUXSL4.mjs} +7 -7
  74. package/dist/lib/node-esm/chunk-3FAUXSL4.mjs.map +7 -0
  75. package/dist/lib/node-esm/{chunk-FDEAVT67.mjs → chunk-H7FRB3M7.mjs} +2 -1
  76. package/dist/lib/node-esm/{chunk-FDEAVT67.mjs.map → chunk-H7FRB3M7.mjs.map} +2 -2
  77. package/dist/lib/node-esm/{chunk-EB5DSAD4.mjs → chunk-HKJUN636.mjs} +2 -2
  78. package/dist/lib/node-esm/{chunk-MU3JKVL2.mjs → chunk-NERLX6GG.mjs} +3 -3
  79. package/dist/lib/node-esm/chunk-NERLX6GG.mjs.map +7 -0
  80. package/dist/lib/node-esm/chunk-NMMN5ZIG.mjs +89 -0
  81. package/dist/lib/node-esm/chunk-NMMN5ZIG.mjs.map +7 -0
  82. package/dist/lib/node-esm/{chunk-4MTPYMV2.mjs → chunk-OSDNCSBE.mjs} +7 -7
  83. package/dist/lib/node-esm/chunk-OSDNCSBE.mjs.map +7 -0
  84. package/dist/lib/node-esm/{chunk-RW2APVMV.mjs → chunk-VMQPOPKV.mjs} +13 -14
  85. package/dist/lib/node-esm/chunk-VMQPOPKV.mjs.map +7 -0
  86. package/dist/lib/node-esm/{chunk-F4HA5C34.mjs → chunk-X27CHZ64.mjs} +9 -9
  87. package/dist/lib/node-esm/chunk-X27CHZ64.mjs.map +7 -0
  88. package/dist/lib/node-esm/{compiler-VT5C2Z3T.mjs → compiler-3NG4T5LH.mjs} +3 -3
  89. package/dist/lib/node-esm/index.mjs +16 -15
  90. package/dist/lib/node-esm/index.mjs.map +3 -3
  91. package/dist/lib/node-esm/{intent-resolver-PDZ2A26X.mjs → intent-resolver-W3MJ427G.mjs} +14 -14
  92. package/dist/lib/node-esm/intent-resolver-W3MJ427G.mjs.map +7 -0
  93. package/dist/lib/node-esm/meta.json +1 -1
  94. package/dist/lib/node-esm/{react-surface-UCUVDVSH.mjs → react-surface-IAUELUG6.mjs} +10 -10
  95. package/dist/lib/node-esm/react-surface-IAUELUG6.mjs.map +7 -0
  96. package/dist/lib/node-esm/{settings-HU5UEFRF.mjs → settings-BWSKKIVQ.mjs} +5 -5
  97. package/dist/lib/node-esm/settings-BWSKKIVQ.mjs.map +7 -0
  98. package/dist/lib/node-esm/types.mjs +2 -2
  99. package/dist/types/src/ScriptPlugin.d.ts.map +1 -1
  100. package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -1
  101. package/dist/types/src/capabilities/artifact-definition.d.ts.map +1 -1
  102. package/dist/types/src/capabilities/index.d.ts.map +1 -1
  103. package/dist/types/src/components/DeploymentDialog/DeploymentDialog.d.ts +2 -2
  104. package/dist/types/src/components/DeploymentDialog/DeploymentDialog.d.ts.map +1 -1
  105. package/dist/types/src/components/ScriptContainer.d.ts +1 -1
  106. package/dist/types/src/components/ScriptContainer.d.ts.map +1 -1
  107. package/dist/types/src/components/ScriptToolbar/ScriptToolbar.d.ts +1 -1
  108. package/dist/types/src/components/ScriptToolbar/ScriptToolbar.d.ts.map +1 -1
  109. package/dist/types/src/components/Settings/ScriptObjectSettings.d.ts +1 -1
  110. package/dist/types/src/components/Settings/ScriptObjectSettings.d.ts.map +1 -1
  111. package/dist/types/src/components/index.d.ts +1 -1
  112. package/dist/types/src/hooks/deploy.d.ts +4 -3
  113. package/dist/types/src/hooks/deploy.d.ts.map +1 -1
  114. package/dist/types/src/hooks/format.d.ts +1 -1
  115. package/dist/types/src/hooks/format.d.ts.map +1 -1
  116. package/dist/types/src/hooks/template.d.ts +1 -1
  117. package/dist/types/src/hooks/template.d.ts.map +1 -1
  118. package/dist/types/src/hooks/useToolbarAction.d.ts +1 -1
  119. package/dist/types/src/hooks/useToolbarAction.d.ts.map +1 -1
  120. package/dist/types/src/hooks/useToolbarState.d.ts +1 -1
  121. package/dist/types/src/hooks/useToolbarState.d.ts.map +1 -1
  122. package/dist/types/src/meta.d.ts.map +1 -1
  123. package/dist/types/src/templates/chess.d.ts.map +1 -1
  124. package/dist/types/src/templates/data-generator.d.ts +0 -7
  125. package/dist/types/src/templates/data-generator.d.ts.map +1 -1
  126. package/dist/types/src/templates/discord.d.ts.map +1 -1
  127. package/dist/types/src/templates/forex-effect.d.ts.map +1 -1
  128. package/dist/types/src/templates/forex.d.ts.map +1 -1
  129. package/dist/types/src/templates/gmail.d.ts.map +1 -1
  130. package/dist/types/src/types.d.ts +27 -26
  131. package/dist/types/src/types.d.ts.map +1 -1
  132. package/dist/types/src/util/deploy.d.ts.map +1 -1
  133. package/package.json +51 -49
  134. package/src/ScriptPlugin.tsx +4 -2
  135. package/src/capabilities/artifact-definition.ts +35 -32
  136. package/src/capabilities/intent-resolver.ts +7 -7
  137. package/src/capabilities/react-surface.tsx +3 -3
  138. package/src/capabilities/settings.ts +2 -2
  139. package/src/components/DeploymentDialog/DeploymentDialog.tsx +2 -2
  140. package/src/components/ScriptContainer.tsx +1 -1
  141. package/src/components/ScriptToolbar/ScriptToolbar.tsx +1 -1
  142. package/src/components/Settings/ScriptObjectSettings.tsx +3 -3
  143. package/src/hooks/format.ts +1 -1
  144. package/src/hooks/template.ts +1 -1
  145. package/src/hooks/useToolbarAction.ts +1 -1
  146. package/src/hooks/useToolbarState.ts +2 -2
  147. package/src/meta.ts +1 -0
  148. package/src/templates/chess.ts +7 -6
  149. package/src/templates/data-generator.ts +31 -50
  150. package/src/templates/discord.ts +25 -17
  151. package/src/templates/forex-effect.ts +6 -5
  152. package/src/templates/forex.ts +5 -4
  153. package/src/templates/gmail.ts +97 -83
  154. package/src/translations.ts +1 -1
  155. package/src/types.ts +13 -14
  156. package/src/util/deploy.ts +5 -9
  157. package/dist/lib/browser/DeploymentDialog-AEPYJKPO.mjs +0 -12
  158. package/dist/lib/browser/ScriptContainer-R25PRK2D.mjs.map +0 -7
  159. package/dist/lib/browser/artifact-definition-WXFYD2V5.mjs.map +0 -7
  160. package/dist/lib/browser/chunk-2CGZFDCR.mjs.map +0 -7
  161. package/dist/lib/browser/chunk-CSZXPLYY.mjs.map +0 -7
  162. package/dist/lib/browser/chunk-KLEOGVXY.mjs.map +0 -7
  163. package/dist/lib/browser/chunk-MQZQB5VD.mjs.map +0 -7
  164. package/dist/lib/browser/chunk-R2CHVWJ2.mjs +0 -41
  165. package/dist/lib/browser/chunk-R2CHVWJ2.mjs.map +0 -7
  166. package/dist/lib/browser/chunk-SUCBNCEQ.mjs +0 -87
  167. package/dist/lib/browser/chunk-SUCBNCEQ.mjs.map +0 -7
  168. package/dist/lib/browser/intent-resolver-WCVXKRBR.mjs.map +0 -7
  169. package/dist/lib/browser/react-surface-WXZVPNGI.mjs.map +0 -7
  170. package/dist/lib/browser/settings-Z7B37V2I.mjs.map +0 -7
  171. package/dist/lib/node/DeploymentDialog-O4MU4OMF.cjs.map +0 -7
  172. package/dist/lib/node/ScriptContainer-5KY6ZOQD.cjs.map +0 -7
  173. package/dist/lib/node/artifact-definition-6NVXEHJD.cjs.map +0 -7
  174. package/dist/lib/node/chunk-65MIJR3Q.cjs.map +0 -7
  175. package/dist/lib/node/chunk-F4DP7WON.cjs.map +0 -7
  176. package/dist/lib/node/chunk-SLDJM45C.cjs.map +0 -7
  177. package/dist/lib/node/chunk-VYBEBLDO.cjs.map +0 -7
  178. package/dist/lib/node/chunk-X7MHLHHS.cjs +0 -91
  179. package/dist/lib/node/chunk-X7MHLHHS.cjs.map +0 -7
  180. package/dist/lib/node/chunk-XFZPWFEG.cjs.map +0 -7
  181. package/dist/lib/node/intent-resolver-J4NBDNFH.cjs.map +0 -7
  182. package/dist/lib/node/react-surface-27KTUBIZ.cjs.map +0 -7
  183. package/dist/lib/node/settings-EI6VPNKN.cjs.map +0 -7
  184. package/dist/lib/node-esm/ScriptContainer-W2F4FGDV.mjs.map +0 -7
  185. package/dist/lib/node-esm/artifact-definition-KQ64AYBP.mjs.map +0 -7
  186. package/dist/lib/node-esm/chunk-4MTPYMV2.mjs.map +0 -7
  187. package/dist/lib/node-esm/chunk-F4HA5C34.mjs.map +0 -7
  188. package/dist/lib/node-esm/chunk-MU3JKVL2.mjs.map +0 -7
  189. package/dist/lib/node-esm/chunk-PBGVTGL2.mjs.map +0 -7
  190. package/dist/lib/node-esm/chunk-QDYGTY4L.mjs +0 -89
  191. package/dist/lib/node-esm/chunk-QDYGTY4L.mjs.map +0 -7
  192. package/dist/lib/node-esm/chunk-RW2APVMV.mjs.map +0 -7
  193. package/dist/lib/node-esm/intent-resolver-PDZ2A26X.mjs.map +0 -7
  194. package/dist/lib/node-esm/react-surface-UCUVDVSH.mjs.map +0 -7
  195. package/dist/lib/node-esm/settings-HU5UEFRF.mjs.map +0 -7
  196. /package/dist/lib/browser/{DeploymentDialog-AEPYJKPO.mjs.map → DeploymentDialog-EMYG5BCD.mjs.map} +0 -0
  197. /package/dist/lib/browser/{app-graph-builder-RRLY67QC.mjs.map → app-graph-builder-2GIBRQLV.mjs.map} +0 -0
  198. /package/dist/lib/browser/{chunk-4VD3K3PY.mjs.map → chunk-A4VOGQ2P.mjs.map} +0 -0
  199. /package/dist/lib/browser/{compiler-56LTBEQB.mjs.map → compiler-O4FJK7RR.mjs.map} +0 -0
  200. /package/dist/lib/node/{app-graph-builder-6I2BWD46.cjs.map → app-graph-builder-LNI22TZF.cjs.map} +0 -0
  201. /package/dist/lib/node/{chunk-JICWAOWZ.cjs.map → chunk-KFJQVOGS.cjs.map} +0 -0
  202. /package/dist/lib/node/{compiler-W2RU3M7U.cjs.map → compiler-FBC6ELQN.cjs.map} +0 -0
  203. /package/dist/lib/node-esm/{DeploymentDialog-SSQSWLHX.mjs.map → DeploymentDialog-FGFA6MG2.mjs.map} +0 -0
  204. /package/dist/lib/node-esm/{app-graph-builder-H5XLRVX3.mjs.map → app-graph-builder-NNUXXXMZ.mjs.map} +0 -0
  205. /package/dist/lib/node-esm/{chunk-EB5DSAD4.mjs.map → chunk-HKJUN636.mjs.map} +0 -0
  206. /package/dist/lib/node-esm/{compiler-VT5C2Z3T.mjs.map → compiler-3NG4T5LH.mjs.map} +0 -0
@@ -7,7 +7,7 @@ import React, { useEffect, useMemo } from 'react';
7
7
  import { createIntent, LayoutAction, useIntentDispatcher } from '@dxos/app-framework';
8
8
  import { getSpace } from '@dxos/react-client/echo';
9
9
  import { Button, Dialog, Icon, useTranslation } from '@dxos/react-ui';
10
- import { type AccessTokenType } from '@dxos/schema';
10
+ import { type DataType } from '@dxos/schema';
11
11
 
12
12
  import { useCreateAndDeployScriptTemplates } from '../../hooks/useCreateAndDeployScriptTemplates';
13
13
  import { SCRIPT_PLUGIN } from '../../meta';
@@ -21,7 +21,7 @@ export const DEPLOYMENT_DIALOG = `${SCRIPT_PLUGIN}/deployment/dialog`;
21
21
  // - Pending / onError states.
22
22
 
23
23
  type DeploymentDialogProps = {
24
- accessToken: AccessTokenType;
24
+ accessToken: DataType.AccessToken;
25
25
  scriptTemplates: Template[];
26
26
  };
27
27
 
@@ -4,7 +4,7 @@
4
4
 
5
5
  import React, { useMemo } from 'react';
6
6
 
7
- import { type ScriptType } from '@dxos/functions/types';
7
+ import { type ScriptType } from '@dxos/functions';
8
8
  import { createDocAccessor, getSpace } from '@dxos/react-client/echo';
9
9
  import { useIdentity } from '@dxos/react-client/halo';
10
10
  import { type ThemedClassName } from '@dxos/react-ui';
@@ -4,7 +4,7 @@
4
4
 
5
5
  import React, { useCallback } from 'react';
6
6
 
7
- import { type ScriptType } from '@dxos/functions/types';
7
+ import { type ScriptType } from '@dxos/functions';
8
8
  import { fullyQualifiedId } from '@dxos/react-client/echo';
9
9
  import { ElevationProvider, type ThemedClassName } from '@dxos/react-ui';
10
10
  import { stackItemContentToolbarClassNames } from '@dxos/react-ui-editor';
@@ -6,12 +6,12 @@ import { Octokit } from '@octokit/core';
6
6
  import React, { type ChangeEvent, useCallback, useEffect, useState } from 'react';
7
7
 
8
8
  import { createIntent, SettingsAction, useIntentDispatcher } from '@dxos/app-framework';
9
- import { FunctionType, type ScriptType, getInvocationUrl, getUserFunctionUrlInMetadata } from '@dxos/functions/types';
9
+ import { FunctionType, type ScriptType, getInvocationUrl, getUserFunctionUrlInMetadata } from '@dxos/functions';
10
10
  import { log } from '@dxos/log';
11
11
  import { useClient } from '@dxos/react-client';
12
12
  import { Filter, getMeta, getSpace, useQuery } from '@dxos/react-client/echo';
13
13
  import { Button, Clipboard, Input, useControlledState, useTranslation } from '@dxos/react-ui';
14
- import { AccessTokenType } from '@dxos/schema';
14
+ import { DataType } from '@dxos/schema';
15
15
 
16
16
  import { SCRIPT_PLUGIN } from '../../meta';
17
17
 
@@ -112,7 +112,7 @@ const Publishing = ({ object }: ScriptObjectSettingsProps) => {
112
112
  const { t } = useTranslation(SCRIPT_PLUGIN);
113
113
  const { dispatchPromise: dispatch } = useIntentDispatcher();
114
114
  const space = getSpace(object);
115
- const [githubToken] = useQuery(space, Filter.schema(AccessTokenType, { source: 'github.com' }));
115
+ const [githubToken] = useQuery(space, Filter.schema(DataType.AccessToken, { source: 'github.com' }));
116
116
  const gistKey = getMeta(object).keys.find(({ source }) => source === 'github.com');
117
117
  const [gistUrl, setGistUrl] = useState<string | undefined>();
118
118
 
@@ -7,7 +7,7 @@ import prettierPluginEstree from 'prettier/plugins/estree';
7
7
  import prettierPluginTypescript from 'prettier/plugins/typescript';
8
8
  import { useCallback } from 'react';
9
9
 
10
- import { type ScriptType } from '@dxos/functions/types';
10
+ import { type ScriptType } from '@dxos/functions';
11
11
  import { log } from '@dxos/log';
12
12
  import { createMenuAction } from '@dxos/react-ui-menu';
13
13
 
@@ -4,7 +4,7 @@
4
4
 
5
5
  import { useCallback } from 'react';
6
6
 
7
- import { FUNCTIONS_PRESET_META_KEY, type ScriptType } from '@dxos/functions/types';
7
+ import { FUNCTIONS_PRESET_META_KEY, type ScriptType } from '@dxos/functions';
8
8
  import { getMeta } from '@dxos/live-object';
9
9
  import { createMenuItemGroup, createMenuAction } from '@dxos/react-ui-menu';
10
10
 
@@ -4,7 +4,7 @@
4
4
 
5
5
  import { useCallback } from 'react';
6
6
 
7
- import { type ScriptType } from '@dxos/functions/types';
7
+ import { type ScriptType } from '@dxos/functions';
8
8
  import { log } from '@dxos/log';
9
9
  import { type MenuAction, type MenuActionHandler } from '@dxos/react-ui-menu';
10
10
 
@@ -4,7 +4,7 @@
4
4
 
5
5
  import { useMemo } from 'react';
6
6
 
7
- import { create } from '@dxos/live-object';
7
+ import { live } from '@dxos/live-object';
8
8
 
9
9
  import { type DeployState } from './deploy';
10
10
 
@@ -12,5 +12,5 @@ export type ScriptToolbarState = Partial<DeployState>;
12
12
 
13
13
  // TODO(burdon): Replace with context provider?
14
14
  export const useToolbarState = (initialState: ScriptToolbarState = {}) => {
15
- return useMemo(() => create<ScriptToolbarState>(initialState), []);
15
+ return useMemo(() => live<ScriptToolbarState>(initialState), []);
16
16
  };
package/src/meta.ts CHANGED
@@ -19,5 +19,6 @@ export const meta: PluginMeta = {
19
19
 
20
20
  // TODO(ZaymonFC): Configure by scopes?
21
21
  export const defaultScriptsForIntegration: Record<string, string[]> = {
22
+ // TODO(wittjosiah): Also include content extraction scripts in the default set.
22
23
  'gmail.com': ['dxos.org/script/gmail'],
23
24
  };
@@ -2,25 +2,26 @@
2
2
  // Copyright 2025 DXOS.org
3
3
  //
4
4
 
5
+ import { Schema } from 'effect';
5
6
  // @ts-ignore
6
- import { defineFunction, S } from 'dxos:functions';
7
+ import { defineFunction } from 'dxos:functions';
7
8
  // @ts-ignore
8
9
  import { Chess } from 'https://esm.sh/chess.js@0.13.1';
9
10
 
10
11
  export default defineFunction({
11
12
  description: 'Plays a random move in a chess game.',
12
13
 
13
- inputSchema: S.Struct({
14
- changedObjectId: S.String.annotations({
14
+ inputSchema: Schema.Struct({
15
+ changedObjectId: Schema.String.annotations({
15
16
  description: 'The objects to play the game on.',
16
17
  }),
17
- player: S.optional(S.Literal('w', 'b')).annotations({
18
+ player: Schema.optional(Schema.Literal('w', 'b')).annotations({
18
19
  description: 'The player to play the game as.',
19
20
  }),
20
21
  }),
21
22
 
22
- outputSchema: S.Struct({
23
- state: S.String.annotations({
23
+ outputSchema: Schema.Struct({
24
+ state: Schema.String.annotations({
24
25
  description: 'The state of the game as an ASCII art board.',
25
26
  }),
26
27
  }),
@@ -2,72 +2,53 @@
2
2
  // Copyright 2025 DXOS.org
3
3
  //
4
4
 
5
- import {
6
- EchoObject,
7
- defineFunction,
8
- S,
9
- createStatic,
10
- Expando,
11
- TypedObject,
12
- Ref,
13
- LabelAnnotationId,
14
- // @ts-ignore
15
- } from 'dxos:functions';
5
+ import { Schema } from 'effect';
16
6
  // @ts-ignore
17
- import { randParagraph } from 'https://esm.sh/@ngneat/falso@7.1.1';
18
-
19
- export class TextType extends TypedObject({ typename: 'dxos.org/type/Text', version: '0.1.0' })({
20
- content: S.String,
21
- }) {}
22
-
23
- export const DocumentSchema = S.Struct({
24
- name: S.optional(S.String),
25
- fallbackName: S.optional(S.String),
26
- content: Ref(TextType),
27
- threads: S.mutable(S.Array(Ref(Expando))),
28
- }).annotations({
29
- [LabelAnnotationId]: ['name', 'fallbackName'],
30
- });
31
-
32
- export const DocumentType = DocumentSchema.pipe(EchoObject('dxos.org/type/Document', '0.1.0'));
33
- export type DocumentType = S.Schema.Type<typeof DocumentType>;
7
+ import { defineFunction, S, create, Expando } from 'dxos:functions';
8
+ // @ts-ignore
9
+ import { randText } from 'https://esm.sh/@ngneat/falso@7.1.1';
34
10
 
35
11
  export default defineFunction({
36
- inputSchema: S.Struct({
37
- documentAmount: S.optional(S.Number),
38
- textSize: S.optional(S.Number),
39
- mutationAmount: S.optional(S.Number),
12
+ inputSchema: Schema.Struct({
13
+ documentAmount: Schema.optional(Schema.Number),
14
+ textSize: Schema.optional(Schema.Number),
15
+ mutationAmount: Schema.optional(Schema.Number),
40
16
  }),
41
17
 
42
- outputSchema: S.Struct({}),
18
+ outputSchema: Schema.Struct({}),
43
19
 
44
- handler: async ({ event: { documentAmount = 10, textSize = 10, mutationAmount = 0 }, context: { space } }: any) => {
20
+ handler: async ({
21
+ event: {
22
+ data: { documentAmount = 1, textSize = 10, mutationAmount = 0 },
23
+ },
24
+ context: { space },
25
+ }: any) => {
45
26
  await space.db.graph.schemaRegistry.addSchema([Expando]);
27
+ const result: Record<string, any> = {};
28
+ const objects: Expando[] = [];
46
29
 
47
- const objects = [];
48
- // const rootCollection = await space.properties[COLLECTION_TYPENAME]?.load();
30
+ // Create objects.
49
31
  for (let i = 0; i < documentAmount; i++) {
50
32
  const obj = space.db.add(
51
- createStatic(Expando, {
33
+ create(Expando, {
52
34
  name: 'scriptGenerated',
53
- content: randParagraph({ length: textSize }),
35
+ content: randText({ charCount: textSize }),
54
36
  }),
55
37
  );
56
- // rootCollection.objects.push(obj);
57
38
  objects.push(obj);
39
+ const objectResult: any = {};
40
+ // Mutate the object.
41
+ for (let i = 0; i < mutationAmount; i++) {
42
+ obj.content = randText({ charCount: textSize });
43
+ }
44
+ objectResult.mutations = mutationAmount;
45
+ objectResult.contentLength = obj.content.length;
46
+ result[obj.id] = objectResult;
58
47
  }
59
48
 
60
- for (let i = 0; i < mutationAmount; i++) {
61
- const obj = objects[Math.floor(Math.random() * objects.length)];
62
- obj.content = randParagraph({ length: textSize });
63
- }
64
-
49
+ // Flush and wait for data to propagate.
65
50
  await space.db.flush();
66
- // TODO(mykola): This seems to halp with propagating data to space.
67
- for (const obj of objects) {
68
- await space.db.query({ id: obj.id }).first();
69
- console.log('obj', obj.id);
70
- }
71
- return 'OK';
51
+ await new Promise((resolve) => setTimeout(resolve, 10_000));
52
+ return result;
72
53
  },
73
54
  });
@@ -2,8 +2,9 @@
2
2
  // Copyright 2025 DXOS.org
3
3
  //
4
4
 
5
+ import { Schema } from 'effect';
5
6
  // @ts-ignore
6
- import { createStatic, EchoObject, defineFunction, DXN, Filter, ObjectId, S } from 'dxos:functions';
7
+ import { create, defineFunction, DXN, Filter, ObjectId, S } from 'dxos:functions';
7
8
  import {
8
9
  FetchHttpClient,
9
10
  // @ts-ignore
@@ -13,13 +14,20 @@ import { DiscordConfig, DiscordREST, DiscordRESTMemoryLive } from 'https://esm.s
13
14
  // @ts-ignore
14
15
  import { Effect, Config, Redacted, Ref } from 'https://esm.sh/effect@3.13.3';
15
16
 
16
- const MessageSchema = S.Struct({
17
- id: S.String,
18
- foreignId: S.Any, // bigint?
19
- from: S.String,
20
- created: S.String,
21
- content: S.String,
22
- }).pipe(EchoObject({ typename: 'example.com/type/Message', version: '0.1.0' }));
17
+ import { Type } from '@dxos/echo';
18
+
19
+ const MessageSchema = Schema.Struct({
20
+ id: ObjectId,
21
+ foreignId: Schema.Any, // bigint?
22
+ from: Schema.String,
23
+ created: Schema.String,
24
+ content: Schema.String,
25
+ }).pipe(
26
+ Type.def({
27
+ typename: 'example.com/type/Message',
28
+ version: '0.1.0',
29
+ }),
30
+ );
23
31
 
24
32
  const DEFAULT_AFTER = 1704067200; // 2024-01-01
25
33
 
@@ -29,17 +37,17 @@ const generateSnowflake = (unixTimestamp: number): bigint => {
29
37
  };
30
38
 
31
39
  export default defineFunction({
32
- inputSchema: S.Struct({
40
+ inputSchema: Schema.Struct({
33
41
  // TODO(wittjosiah): Remove. This is used to provide a terminal for a cron trigger.
34
- tick: S.optional(S.String),
35
- channelId: S.String,
36
- after: S.optional(S.Number),
37
- pageSize: S.optional(S.Number),
38
- queueId: S.String,
42
+ tick: Schema.optional(Schema.String),
43
+ channelId: Schema.String,
44
+ after: Schema.optional(Schema.Number),
45
+ pageSize: Schema.optional(Schema.Number),
46
+ queueId: Schema.String,
39
47
  }),
40
48
 
41
- outputSchema: S.Struct({
42
- newMessages: S.Number,
49
+ outputSchema: Schema.Struct({
50
+ newMessages: Schema.Number,
43
51
  }),
44
52
 
45
53
  handler: ({
@@ -73,7 +81,7 @@ export default defineFunction({
73
81
  const messages = yield* rest.getChannelMessages(channelId, options).pipe((res: any) => res.json);
74
82
  const queueMessages = messages
75
83
  .map((message: any) =>
76
- createStatic(MessageSchema, {
84
+ create(MessageSchema, {
77
85
  id: ObjectId.random(),
78
86
  foreignId: message.id,
79
87
  from: message.author.username,
@@ -2,8 +2,9 @@
2
2
  // Copyright 2025 DXOS.org
3
3
  //
4
4
 
5
+ import { Schema } from 'effect';
5
6
  // @ts-ignore
6
- import { defineFunction, S } from 'dxos:functions';
7
+ import { defineFunction } from 'dxos:functions';
7
8
  import {
8
9
  HttpClient,
9
10
  HttpClientRequest,
@@ -16,12 +17,12 @@ import { Effect, Schedule } from 'https://esm.sh/effect@3.13.3';
16
17
  export default defineFunction({
17
18
  description: 'Returns the exchange rate between two currencies.',
18
19
 
19
- inputSchema: S.Struct({
20
- from: S.String.annotations({ description: 'The source currency' }),
21
- to: S.String.annotations({ description: 'The target currency' }),
20
+ inputSchema: Schema.Struct({
21
+ from: Schema.String.annotations({ description: 'The source currency' }),
22
+ to: Schema.String.annotations({ description: 'The target currency' }),
22
23
  }),
23
24
 
24
- outputSchema: S.String.annotations({ description: 'The exchange rate between the two currencies' }),
25
+ outputSchema: Schema.String.annotations({ description: 'The exchange rate between the two currencies' }),
25
26
 
26
27
  handler: async ({
27
28
  event: {
@@ -2,15 +2,16 @@
2
2
  // Copyright 2025 DXOS.org
3
3
  //
4
4
 
5
+ import { Schema } from 'effect';
5
6
  // @ts-ignore
6
- import { defineFunction, S } from 'dxos:functions';
7
+ import { defineFunction } from 'dxos:functions';
7
8
 
8
9
  export default defineFunction({
9
10
  description: 'Returns the exchange rate between two currencies.',
10
11
 
11
- inputSchema: S.Struct({
12
- from: S.String.annotations({ description: 'The source currency' }),
13
- to: S.String.annotations({ description: 'The target currency' }),
12
+ inputSchema: Schema.Struct({
13
+ from: Schema.String.annotations({ description: 'The source currency' }),
14
+ to: Schema.String.annotations({ description: 'The target currency' }),
14
15
  }),
15
16
 
16
17
  handler: async ({
@@ -3,7 +3,8 @@
3
3
  //
4
4
 
5
5
  // @ts-ignore
6
- import { createStatic, defineFunction, EchoObject, Filter, ObjectId, S } from 'dxos:functions';
6
+ import { create, defineFunction, Filter, ObjectId } from 'dxos:functions';
7
+ // @ts-ignore
7
8
  import {
8
9
  HttpClient,
9
10
  HttpClientRequest,
@@ -11,30 +12,33 @@ import {
11
12
  // @ts-ignore
12
13
  } from 'https://esm.sh/@effect/platform@0.77.2?deps=effect@3.13.3';
13
14
  // @ts-ignore
14
- import { pipe, Chunk, Effect, Ref, Schedule, Stream } from 'https://esm.sh/effect@3.13.3';
15
+ import { format, subDays } from 'https://esm.sh/date-fns@3.3.1';
16
+ // @ts-ignore
17
+ import { pipe, Chunk, Effect, Ref, Schedule, Schema, Stream } from 'https://esm.sh/effect@3.13.3';
15
18
 
16
- // TODO(ZaymonFC): Calculate this dynamically and expose a parameter.
17
- const DEFAULT_AFTER = '2025-01-01';
19
+ import { Type } from '@dxos/echo';
18
20
 
19
21
  export default defineFunction({
20
- inputSchema: S.Struct({
22
+ inputSchema: Schema.Struct({
23
+ mailboxId: Schema.String,
24
+ userId: Schema.optional(Schema.String).pipe(Schema.withDecodingDefault(() => 'me')),
25
+ after: Schema.optional(Schema.Union(Schema.Number, Schema.String)).pipe(
26
+ Schema.withDecodingDefault(() => format(subDays(new Date(), 30), 'yyyy-MM-dd')),
27
+ ),
28
+ pageSize: Schema.optional(Schema.Number).pipe(Schema.withDecodingDefault(() => 100)),
21
29
  // TODO(wittjosiah): Remove. This is used to provide a terminal for a cron trigger.
22
- tick: S.optional(S.String),
23
- userId: S.optional(S.String),
24
- after: S.optional(S.Union(S.Number, S.String)),
25
- pageSize: S.optional(S.Number),
26
- mailboxId: S.String,
30
+ tick: Schema.optional(Schema.String),
27
31
  }),
28
32
 
29
- outputSchema: S.Struct({
30
- newMessages: S.Number,
33
+ outputSchema: Schema.Struct({
34
+ newMessages: Schema.Number,
31
35
  }),
32
36
 
33
37
  handler: ({
38
+ context: { space },
34
39
  event: {
35
- data: { mailboxId, userId = 'me', after = DEFAULT_AFTER, pageSize = 100 },
40
+ data: { mailboxId, userId, after, pageSize },
36
41
  },
37
- context: { space },
38
42
  }: any) =>
39
43
  Effect.gen(function* () {
40
44
  const { token } = yield* Effect.tryPromise({
@@ -42,9 +46,10 @@ export default defineFunction({
42
46
  catch: (e: any) => e,
43
47
  });
44
48
 
45
- const makeRequest = (path: string) =>
49
+ // NOTE: Google API bundles size is v. large and caused runtime issues.
50
+ const makeRequest = (url: string) =>
46
51
  pipe(
47
- path,
52
+ url,
48
53
  HttpClientRequest.get,
49
54
  HttpClientRequest.setHeaders({ Authorization: `Bearer ${token}`, Accept: 'application/json' }),
50
55
  HttpClient.execute,
@@ -54,13 +59,10 @@ export default defineFunction({
54
59
  Effect.scoped,
55
60
  );
56
61
 
57
- const listMessages = (userId: string, q: string, pageSize: number, pageToken: string | null) => {
58
- const url = `https://gmail.googleapis.com/gmail/v1/users/${userId}/messages?maxResults=${pageSize}&q=${q}`;
59
- return makeRequest(pageToken ? `${url}&pageToken=${pageToken}` : url);
60
- };
62
+ const listMessages = (userId: string, q: string, pageSize: number, pageToken: string | null) =>
63
+ makeRequest(getUrl(userId, undefined, { q, pageSize, pageToken }));
61
64
 
62
- const getMessage = (userId: string, id: string) =>
63
- makeRequest(`https://gmail.googleapis.com/gmail/v1/users/${userId}/messages/${id}`);
65
+ const getMessage = (userId: string, messageId: string) => makeRequest(getUrl(userId, messageId));
64
66
 
65
67
  const mailbox = yield* Effect.tryPromise({
66
68
  try: () => space.db.query({ id: mailboxId }).first(),
@@ -97,7 +99,7 @@ export default defineFunction({
97
99
  continue;
98
100
  }
99
101
  const subject = messageDetails.payload.headers.find((h: any) => h.name === 'Subject')?.value;
100
- const object = createStatic(MessageType, {
102
+ const object = create(MessageType, {
101
103
  id: ObjectId.random(),
102
104
  created,
103
105
  sender,
@@ -137,6 +139,14 @@ export default defineFunction({
137
139
  }).pipe(Effect.provide(FetchHttpClient.layer)),
138
140
  });
139
141
 
142
+ const getUrl = (userId: string, messageId?: string, params?: Record<string, any>) => {
143
+ const api = new URL(
144
+ [`https://gmail.googleapis.com/gmail/v1/users/${userId}/messages`, messageId].filter(Boolean).join('/'),
145
+ );
146
+ Object.entries(params ?? {}).forEach(([key, value]) => api.searchParams.set(key, value));
147
+ return api.toString();
148
+ };
149
+
140
150
  /**
141
151
  * Parses an email string in the format "Name <email@example.com>" into separate name and email components.
142
152
  */
@@ -153,92 +163,96 @@ const parseEmailString = (emailString: string): { name?: string; email: string }
153
163
  return undefined;
154
164
  };
155
165
 
156
- // TODO(wittjosiah): These schemas should be imported from @dxos/schema.
157
-
158
166
  //
159
167
  // Schemas
168
+ // TODO(wittjosiah): These schemas should be imported from @dxos/schema.
160
169
  //
161
170
 
162
171
  const ActorRoles = ['user', 'assistant'] as const;
163
- const ActorRole = S.Literal(...ActorRoles);
164
- type ActorRole = S.Schema.Type<typeof ActorRole>;
165
-
166
- const ActorSchema = S.Struct({
167
- identityKey: S.optional(S.String),
168
- email: S.optional(S.String),
169
- name: S.optional(S.String),
170
- role: S.optional(ActorRole),
172
+ const ActorRole = Schema.Literal(...ActorRoles);
173
+ type ActorRole = Schema.Schema.Type<typeof ActorRole>;
174
+
175
+ const ActorSchema = Schema.Struct({
176
+ identityKey: Schema.optional(Schema.String),
177
+ email: Schema.optional(Schema.String),
178
+ name: Schema.optional(Schema.String),
179
+ role: Schema.optional(ActorRole),
171
180
  });
172
181
 
173
- const AbstractContentBlock = S.Struct({
174
- pending: S.optional(S.Boolean),
182
+ const AbstractContentBlock = Schema.Struct({
183
+ pending: Schema.optional(Schema.Boolean),
175
184
  });
176
- type AbstractContentBlock = S.Schema.Type<typeof AbstractContentBlock>;
177
- const TextContentBlock = S.extend(
185
+ type AbstractContentBlock = Schema.Schema.Type<typeof AbstractContentBlock>;
186
+ const TextContentBlock = Schema.extend(
178
187
  AbstractContentBlock,
179
- S.Struct({
180
- type: S.Literal('text'),
181
- disposition: S.optional(S.String),
182
- text: S.String,
188
+ Schema.Struct({
189
+ type: Schema.Literal('text'),
190
+ disposition: Schema.optional(Schema.String),
191
+ text: Schema.String,
183
192
  }),
184
- ).pipe(S.mutable);
185
- type TextContentBlock = S.Schema.Type<typeof TextContentBlock>;
186
- const JsonContentBlock = S.extend(
193
+ ).pipe(Schema.mutable);
194
+ type TextContentBlock = Schema.Schema.Type<typeof TextContentBlock>;
195
+ const JsonContentBlock = Schema.extend(
187
196
  AbstractContentBlock,
188
- S.Struct({
189
- type: S.Literal('json'),
190
- disposition: S.optional(S.String),
191
- data: S.String,
197
+ Schema.Struct({
198
+ type: Schema.Literal('json'),
199
+ disposition: Schema.optional(Schema.String),
200
+ data: Schema.String,
192
201
  }),
193
- ).pipe(S.mutable);
194
- type JsonContentBlock = S.Schema.Type<typeof JsonContentBlock>;
195
- const Base64ImageSource = S.Struct({
196
- type: S.Literal('base64'),
197
- mediaType: S.String,
198
- data: S.String,
199
- }).pipe(S.mutable);
200
- const HttpImageSource = S.Struct({
201
- type: S.Literal('http'),
202
- url: S.String,
203
- }).pipe(S.mutable);
204
- const ImageSource = S.Union(Base64ImageSource, HttpImageSource);
205
- type ImageSource = S.Schema.Type<typeof ImageSource>;
206
- const ImageContentBlock = S.extend(
202
+ ).pipe(Schema.mutable);
203
+ type JsonContentBlock = Schema.Schema.Type<typeof JsonContentBlock>;
204
+ const Base64ImageSource = Schema.Struct({
205
+ type: Schema.Literal('base64'),
206
+ mediaType: Schema.String,
207
+ data: Schema.String,
208
+ }).pipe(Schema.mutable);
209
+ const HttpImageSource = Schema.Struct({
210
+ type: Schema.Literal('http'),
211
+ url: Schema.String,
212
+ }).pipe(Schema.mutable);
213
+ const ImageSource = Schema.Union(Base64ImageSource, HttpImageSource);
214
+ type ImageSource = Schema.Schema.Type<typeof ImageSource>;
215
+ const ImageContentBlock = Schema.extend(
207
216
  AbstractContentBlock,
208
- S.Struct({
209
- type: S.Literal('image'),
210
- id: S.optional(S.String),
211
- source: S.optional(ImageSource),
217
+ Schema.Struct({
218
+ type: Schema.Literal('image'),
219
+ id: Schema.optional(Schema.String),
220
+ source: Schema.optional(ImageSource),
212
221
  }),
213
- ).pipe(S.mutable);
214
- type ImageContentBlock = S.Schema.Type<typeof ImageContentBlock>;
215
- const ReferenceContentBlock = S.extend(
222
+ ).pipe(Schema.mutable);
223
+ type ImageContentBlock = Schema.Schema.Type<typeof ImageContentBlock>;
224
+ const ReferenceContentBlock = Schema.extend(
216
225
  AbstractContentBlock,
217
- S.Struct({
218
- type: S.Literal('reference'),
219
- reference: S.Any,
226
+ Schema.Struct({
227
+ type: Schema.Literal('reference'),
228
+ reference: Schema.Any,
220
229
  }),
221
- ).pipe(S.mutable);
222
- type ReferenceContentBlock = S.Schema.Type<typeof ReferenceContentBlock>;
223
- const MessageContentBlock = S.Union(TextContentBlock, JsonContentBlock, ImageContentBlock, ReferenceContentBlock);
230
+ ).pipe(Schema.mutable);
231
+ type ReferenceContentBlock = Schema.Schema.Type<typeof ReferenceContentBlock>;
232
+ const MessageContentBlock = Schema.Union(TextContentBlock, JsonContentBlock, ImageContentBlock, ReferenceContentBlock);
224
233
 
225
- const MessageType = S.Struct({
234
+ const MessageType = Schema.Struct({
226
235
  id: ObjectId,
227
- created: S.String.annotations({
236
+ created: Schema.String.annotations({
228
237
  description: 'ISO date string when the message was sent.',
229
238
  }),
230
239
  sender: ActorSchema.annotations({
231
240
  description: 'Identity of the message sender.',
232
241
  }),
233
- blocks: S.Array(MessageContentBlock).annotations({
242
+ blocks: Schema.Array(MessageContentBlock).annotations({
234
243
  description: 'Contents of the message.',
235
244
  }),
236
- properties: S.optional(
237
- S.mutable(
238
- S.Record({ key: S.String, value: S.Any }).annotations({
245
+ properties: Schema.optional(
246
+ Schema.mutable(
247
+ Schema.Record({ key: Schema.String, value: Schema.Any }).annotations({
239
248
  description: 'Custom properties for specific message types (e.g. attention context, email subject, etc.).',
240
249
  }),
241
250
  ),
242
251
  ),
243
- }).pipe(EchoObject({ typename: 'dxos.org/type/Message', version: '0.1.0' }));
244
- type MessageType = S.Schema.Type<typeof MessageType>;
252
+ }).pipe(
253
+ Type.def({
254
+ typename: 'dxos.org/type/Message',
255
+ version: '0.1.0',
256
+ }),
257
+ );
258
+ type MessageType = Schema.Schema.Type<typeof MessageType>;
@@ -2,7 +2,7 @@
2
2
  // Copyright 2023 DXOS.org
3
3
  //
4
4
 
5
- import { ScriptType } from '@dxos/functions/types';
5
+ import { ScriptType } from '@dxos/functions';
6
6
 
7
7
  import { SCRIPT_PLUGIN } from './meta';
8
8