@dxos/plugin-script 0.6.8-main.046e6cf

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 (136) hide show
  1. package/LICENSE +8 -0
  2. package/README.md +4 -0
  3. package/dist/lib/browser/ScriptEditor-6Q7HFLJ6.mjs +220 -0
  4. package/dist/lib/browser/ScriptEditor-6Q7HFLJ6.mjs.map +7 -0
  5. package/dist/lib/browser/TypescriptEditor-HP35MTEQ.mjs +9 -0
  6. package/dist/lib/browser/TypescriptEditor-HP35MTEQ.mjs.map +7 -0
  7. package/dist/lib/browser/chunk-2EM5Y66A.mjs +60 -0
  8. package/dist/lib/browser/chunk-2EM5Y66A.mjs.map +7 -0
  9. package/dist/lib/browser/chunk-EZ7PWOLU.mjs +235 -0
  10. package/dist/lib/browser/chunk-EZ7PWOLU.mjs.map +7 -0
  11. package/dist/lib/browser/chunk-JBACGDOJ.mjs +21 -0
  12. package/dist/lib/browser/chunk-JBACGDOJ.mjs.map +7 -0
  13. package/dist/lib/browser/chunk-Z72YKDJ2.mjs +31 -0
  14. package/dist/lib/browser/chunk-Z72YKDJ2.mjs.map +7 -0
  15. package/dist/lib/browser/edge/index.mjs +19 -0
  16. package/dist/lib/browser/edge/index.mjs.map +7 -0
  17. package/dist/lib/browser/index.mjs +395 -0
  18. package/dist/lib/browser/index.mjs.map +7 -0
  19. package/dist/lib/browser/meta.json +1 -0
  20. package/dist/lib/browser/meta.mjs +9 -0
  21. package/dist/lib/browser/meta.mjs.map +7 -0
  22. package/dist/lib/browser/types/index.mjs +10 -0
  23. package/dist/lib/browser/types/index.mjs.map +7 -0
  24. package/dist/lib/node/ScriptEditor-AIVKL2NX.cjs +239 -0
  25. package/dist/lib/node/ScriptEditor-AIVKL2NX.cjs.map +7 -0
  26. package/dist/lib/node/TypescriptEditor-PWOAN5RQ.cjs +30 -0
  27. package/dist/lib/node/TypescriptEditor-PWOAN5RQ.cjs.map +7 -0
  28. package/dist/lib/node/chunk-4VMNBXWU.cjs +54 -0
  29. package/dist/lib/node/chunk-4VMNBXWU.cjs.map +7 -0
  30. package/dist/lib/node/chunk-6Y2S6SGK.cjs +49 -0
  31. package/dist/lib/node/chunk-6Y2S6SGK.cjs.map +7 -0
  32. package/dist/lib/node/chunk-LWUBFTPA.cjs +253 -0
  33. package/dist/lib/node/chunk-LWUBFTPA.cjs.map +7 -0
  34. package/dist/lib/node/chunk-SLV3SDZE.cjs +93 -0
  35. package/dist/lib/node/chunk-SLV3SDZE.cjs.map +7 -0
  36. package/dist/lib/node/edge/index.cjs +41 -0
  37. package/dist/lib/node/edge/index.cjs.map +7 -0
  38. package/dist/lib/node/index.cjs +417 -0
  39. package/dist/lib/node/index.cjs.map +7 -0
  40. package/dist/lib/node/meta.cjs +30 -0
  41. package/dist/lib/node/meta.cjs.map +7 -0
  42. package/dist/lib/node/meta.json +1 -0
  43. package/dist/lib/node/types/index.cjs +32 -0
  44. package/dist/lib/node/types/index.cjs.map +7 -0
  45. package/dist/types/src/ScriptPlugin.d.ts +7 -0
  46. package/dist/types/src/ScriptPlugin.d.ts.map +1 -0
  47. package/dist/types/src/compiler/compiler.d.ts +38 -0
  48. package/dist/types/src/compiler/compiler.d.ts.map +1 -0
  49. package/dist/types/src/compiler/compiler.test.d.ts +2 -0
  50. package/dist/types/src/compiler/compiler.test.d.ts.map +1 -0
  51. package/dist/types/src/compiler/index.d.ts +2 -0
  52. package/dist/types/src/compiler/index.d.ts.map +1 -0
  53. package/dist/types/src/components/ScriptBlock/FrameContainer/FrameContainer.d.ts +12 -0
  54. package/dist/types/src/components/ScriptBlock/FrameContainer/FrameContainer.d.ts.map +1 -0
  55. package/dist/types/src/components/ScriptBlock/FrameContainer/frame.d.ts +2 -0
  56. package/dist/types/src/components/ScriptBlock/FrameContainer/frame.d.ts.map +1 -0
  57. package/dist/types/src/components/ScriptBlock/FrameContainer/index.d.ts +2 -0
  58. package/dist/types/src/components/ScriptBlock/FrameContainer/index.d.ts.map +1 -0
  59. package/dist/types/src/components/ScriptBlock/ScriptBlock.d.ts +18 -0
  60. package/dist/types/src/components/ScriptBlock/ScriptBlock.d.ts.map +1 -0
  61. package/dist/types/src/components/ScriptBlock/ScriptBlock.stories.d.ts +14 -0
  62. package/dist/types/src/components/ScriptBlock/ScriptBlock.stories.d.ts.map +1 -0
  63. package/dist/types/src/components/ScriptBlock/Splitter/Splitter.d.ts +15 -0
  64. package/dist/types/src/components/ScriptBlock/Splitter/Splitter.d.ts.map +1 -0
  65. package/dist/types/src/components/ScriptBlock/Splitter/Splitter.stories.d.ts +13 -0
  66. package/dist/types/src/components/ScriptBlock/Splitter/Splitter.stories.d.ts.map +1 -0
  67. package/dist/types/src/components/ScriptBlock/Splitter/index.d.ts +2 -0
  68. package/dist/types/src/components/ScriptBlock/Splitter/index.d.ts.map +1 -0
  69. package/dist/types/src/components/ScriptBlock/index.d.ts +2 -0
  70. package/dist/types/src/components/ScriptBlock/index.d.ts.map +1 -0
  71. package/dist/types/src/components/ScriptEditor.d.ts +9 -0
  72. package/dist/types/src/components/ScriptEditor.d.ts.map +1 -0
  73. package/dist/types/src/components/Toolbar.d.ts +11 -0
  74. package/dist/types/src/components/Toolbar.d.ts.map +1 -0
  75. package/dist/types/src/components/Toolbar.stories.d.ts +16 -0
  76. package/dist/types/src/components/Toolbar.stories.d.ts.map +1 -0
  77. package/dist/types/src/components/TypescriptEditor.d.ts +10 -0
  78. package/dist/types/src/components/TypescriptEditor.d.ts.map +1 -0
  79. package/dist/types/src/components/TypescriptEditor.stories.d.ts +13 -0
  80. package/dist/types/src/components/TypescriptEditor.stories.d.ts.map +1 -0
  81. package/dist/types/src/components/index.d.ts +4 -0
  82. package/dist/types/src/components/index.d.ts.map +1 -0
  83. package/dist/types/src/edge/codec.d.ts +4 -0
  84. package/dist/types/src/edge/codec.d.ts.map +1 -0
  85. package/dist/types/src/edge/functions.d.ts +23 -0
  86. package/dist/types/src/edge/functions.d.ts.map +1 -0
  87. package/dist/types/src/edge/header-codec.d.ts +24 -0
  88. package/dist/types/src/edge/header-codec.d.ts.map +1 -0
  89. package/dist/types/src/edge/hub-protocol.d.ts +6 -0
  90. package/dist/types/src/edge/hub-protocol.d.ts.map +1 -0
  91. package/dist/types/src/edge/index.d.ts +5 -0
  92. package/dist/types/src/edge/index.d.ts.map +1 -0
  93. package/dist/types/src/index.d.ts +7 -0
  94. package/dist/types/src/index.d.ts.map +1 -0
  95. package/dist/types/src/meta.d.ts +15 -0
  96. package/dist/types/src/meta.d.ts.map +1 -0
  97. package/dist/types/src/translations.d.ts +19 -0
  98. package/dist/types/src/translations.d.ts.map +1 -0
  99. package/dist/types/src/types/index.d.ts +3 -0
  100. package/dist/types/src/types/index.d.ts.map +1 -0
  101. package/dist/types/src/types/script.d.ts +26 -0
  102. package/dist/types/src/types/script.d.ts.map +1 -0
  103. package/dist/types/src/types/types.d.ts +8 -0
  104. package/dist/types/src/types/types.d.ts.map +1 -0
  105. package/package.json +120 -0
  106. package/src/ScriptPlugin.tsx +137 -0
  107. package/src/compiler/compiler.test.ts +17 -0
  108. package/src/compiler/compiler.ts +210 -0
  109. package/src/compiler/index.ts +5 -0
  110. package/src/components/ScriptBlock/FrameContainer/FrameContainer.tsx +82 -0
  111. package/src/components/ScriptBlock/FrameContainer/frame.html +25 -0
  112. package/src/components/ScriptBlock/FrameContainer/frame.tsx +51 -0
  113. package/src/components/ScriptBlock/FrameContainer/index.ts +5 -0
  114. package/src/components/ScriptBlock/ScriptBlock.stories.tsx +64 -0
  115. package/src/components/ScriptBlock/ScriptBlock.tsx +132 -0
  116. package/src/components/ScriptBlock/Splitter/Splitter.stories.tsx +37 -0
  117. package/src/components/ScriptBlock/Splitter/Splitter.tsx +52 -0
  118. package/src/components/ScriptBlock/Splitter/index.ts +5 -0
  119. package/src/components/ScriptBlock/index.ts +5 -0
  120. package/src/components/ScriptEditor.tsx +113 -0
  121. package/src/components/Toolbar.stories.tsx +19 -0
  122. package/src/components/Toolbar.tsx +163 -0
  123. package/src/components/TypescriptEditor.stories.tsx +63 -0
  124. package/src/components/TypescriptEditor.tsx +66 -0
  125. package/src/components/index.ts +8 -0
  126. package/src/edge/codec.ts +13 -0
  127. package/src/edge/functions.ts +128 -0
  128. package/src/edge/header-codec.ts +97 -0
  129. package/src/edge/hub-protocol.ts +27 -0
  130. package/src/edge/index.ts +10 -0
  131. package/src/index.ts +13 -0
  132. package/src/meta.tsx +19 -0
  133. package/src/translations.ts +25 -0
  134. package/src/types/index.ts +6 -0
  135. package/src/types/script.ts +16 -0
  136. package/src/types/types.tsx +27 -0
@@ -0,0 +1,21 @@
1
+ // packages/plugins/experimental/plugin-script/src/meta.tsx
2
+ import { Code } from "@phosphor-icons/react";
3
+ import React from "react";
4
+ import { pluginMeta } from "@dxos/app-framework";
5
+ var SCRIPT_PLUGIN = "dxos.org/plugin/script";
6
+ var meta_default = pluginMeta({
7
+ id: SCRIPT_PLUGIN,
8
+ name: "Scripts",
9
+ description: "Live code notebooks.",
10
+ tags: [
11
+ "experimental"
12
+ ],
13
+ iconComponent: (props) => /* @__PURE__ */ React.createElement(Code, props),
14
+ iconSymbol: "ph--code--regular"
15
+ });
16
+
17
+ export {
18
+ SCRIPT_PLUGIN,
19
+ meta_default
20
+ };
21
+ //# sourceMappingURL=chunk-JBACGDOJ.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/meta.tsx"],
4
+ "sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { Code, type IconProps } from '@phosphor-icons/react';\nimport React from 'react';\n\nimport { pluginMeta } from '@dxos/app-framework';\n\nexport const SCRIPT_PLUGIN = 'dxos.org/plugin/script';\n\nexport default pluginMeta({\n id: SCRIPT_PLUGIN,\n name: 'Scripts',\n description: 'Live code notebooks.',\n tags: ['experimental'],\n iconComponent: (props: IconProps) => <Code {...props} />,\n iconSymbol: 'ph--code--regular',\n});\n"],
5
+ "mappings": ";AAIA,SAASA,YAA4B;AACrC,OAAOC,WAAW;AAElB,SAASC,kBAAkB;AAEpB,IAAMC,gBAAgB;AAE7B,IAAA,eAAeC,WAAW;EACxBC,IAAIF;EACJG,MAAM;EACNC,aAAa;EACbC,MAAM;IAAC;;EACPC,eAAe,CAACC,UAAqB,sBAAA,cAACC,MAASD,KAAAA;EAC/CE,YAAY;AACd,CAAA;",
6
+ "names": ["Code", "React", "pluginMeta", "SCRIPT_PLUGIN", "pluginMeta", "id", "name", "description", "tags", "iconComponent", "props", "Code", "iconSymbol"]
7
+ }
@@ -0,0 +1,31 @@
1
+ import {
2
+ SCRIPT_PLUGIN
3
+ } from "./chunk-JBACGDOJ.mjs";
4
+
5
+ // packages/plugins/experimental/plugin-script/src/types/script.ts
6
+ import { ref, S, TypedObject } from "@dxos/echo-schema";
7
+ import { TextType } from "@dxos/plugin-markdown/types";
8
+ var ScriptType = class extends TypedObject({
9
+ typename: "dxos.org/type/Script",
10
+ version: "0.1.0"
11
+ })({
12
+ name: S.optional(S.String),
13
+ source: ref(TextType),
14
+ // Local binding to a function name.
15
+ binding: S.optional(S.String),
16
+ // Whether source has changed since last deploy.
17
+ changed: S.optional(S.Boolean)
18
+ }) {
19
+ };
20
+
21
+ // packages/plugins/experimental/plugin-script/src/types/types.tsx
22
+ var ScriptAction;
23
+ (function(ScriptAction2) {
24
+ ScriptAction2[ScriptAction2["CREATE"] = `${SCRIPT_PLUGIN}/create`] = "CREATE";
25
+ })(ScriptAction || (ScriptAction = {}));
26
+
27
+ export {
28
+ ScriptType,
29
+ ScriptAction
30
+ };
31
+ //# sourceMappingURL=chunk-Z72YKDJ2.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/types/script.ts", "../../../src/types/types.tsx"],
4
+ "sourcesContent": ["//\n// Copyright 2024 DXOS.org\n//\n\nimport { ref, S, TypedObject } from '@dxos/echo-schema';\nimport { TextType } from '@dxos/plugin-markdown/types';\n\nexport class ScriptType extends TypedObject({ typename: 'dxos.org/type/Script', version: '0.1.0' })({\n name: S.optional(S.String),\n source: ref(TextType),\n\n // Local binding to a function name.\n binding: S.optional(S.String),\n // Whether source has changed since last deploy.\n changed: S.optional(S.Boolean),\n}) {}\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport type {\n GraphBuilderProvides,\n IntentResolverProvides,\n MetadataRecordsProvides,\n SurfaceProvides,\n TranslationsProvides,\n} from '@dxos/app-framework';\nimport { type SchemaProvides } from '@dxos/plugin-client';\nimport type { StackProvides } from '@dxos/plugin-stack';\n\nimport { SCRIPT_PLUGIN } from '../meta';\n\nexport enum ScriptAction {\n CREATE = `${SCRIPT_PLUGIN}/create`,\n}\n\nexport type ScriptPluginProvides = SurfaceProvides &\n IntentResolverProvides &\n GraphBuilderProvides &\n MetadataRecordsProvides &\n TranslationsProvides &\n SchemaProvides &\n StackProvides;\n"],
5
+ "mappings": ";;;;;AAIA,SAASA,KAAKC,GAAGC,mBAAmB;AACpC,SAASC,gBAAgB;AAElB,IAAMC,aAAN,cAAyBC,YAAY;EAAEC,UAAU;EAAwBC,SAAS;AAAQ,CAAA,EAAG;EAClGC,MAAMC,EAAEC,SAASD,EAAEE,MAAM;EACzBC,QAAQC,IAAIC,QAAAA;;EAGZC,SAASN,EAAEC,SAASD,EAAEE,MAAM;;EAE5BK,SAASP,EAAEC,SAASD,EAAEQ,OAAO;AAC/B,CAAA,EAAA;AAAI;;;;UCCQC,eAAAA;0CACD,GAAGC,aAAAA,SAAsB,IAAA;GADxBD,iBAAAA,eAAAA,CAAAA,EAAAA;",
6
+ "names": ["ref", "S", "TypedObject", "TextType", "ScriptType", "TypedObject", "typename", "version", "name", "S", "optional", "String", "source", "ref", "TextType", "binding", "changed", "Boolean", "ScriptAction", "SCRIPT_PLUGIN"]
7
+ }
@@ -0,0 +1,19 @@
1
+ import {
2
+ HeaderCodec,
3
+ codec,
4
+ getUserFunctionUrlInMetadata,
5
+ matchServiceCredential,
6
+ publicKeyToDid,
7
+ setUserFunctionUrlInMetadata,
8
+ uploadWorkerFunction
9
+ } from "../chunk-EZ7PWOLU.mjs";
10
+ export {
11
+ HeaderCodec,
12
+ codec,
13
+ getUserFunctionUrlInMetadata,
14
+ matchServiceCredential,
15
+ publicKeyToDid,
16
+ setUserFunctionUrlInMetadata,
17
+ uploadWorkerFunction
18
+ };
19
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": [],
4
+ "sourcesContent": [],
5
+ "mappings": "",
6
+ "names": []
7
+ }
@@ -0,0 +1,395 @@
1
+ import {
2
+ ScriptAction,
3
+ ScriptType
4
+ } from "./chunk-Z72YKDJ2.mjs";
5
+ import {
6
+ SCRIPT_PLUGIN,
7
+ meta_default
8
+ } from "./chunk-JBACGDOJ.mjs";
9
+
10
+ // packages/plugins/experimental/plugin-script/src/ScriptPlugin.tsx
11
+ import { Code } from "@phosphor-icons/react";
12
+ import React2 from "react";
13
+ import { parseIntentPlugin, resolvePlugin, NavigationAction } from "@dxos/app-framework";
14
+ import { create } from "@dxos/echo-schema";
15
+ import { parseClientPlugin } from "@dxos/plugin-client";
16
+ import { createExtension, isActionGroup } from "@dxos/plugin-graph";
17
+ import { TextType } from "@dxos/plugin-markdown/types";
18
+ import { SpaceAction } from "@dxos/plugin-space";
19
+ import { loadObjectReferences } from "@dxos/react-client/echo";
20
+
21
+ // packages/plugins/experimental/plugin-script/src/components/index.ts
22
+ import React from "react";
23
+ var ScriptEditor = React.lazy(() => import("./ScriptEditor-6Q7HFLJ6.mjs"));
24
+ var TypescriptEditor = React.lazy(() => import("./TypescriptEditor-HP35MTEQ.mjs"));
25
+
26
+ // packages/plugins/experimental/plugin-script/src/translations.ts
27
+ var translations_default = [
28
+ {
29
+ "en-US": {
30
+ [SCRIPT_PLUGIN]: {
31
+ "plugin name": "Scripts",
32
+ "object title placeholder": "New script",
33
+ "create object label": "Create script",
34
+ "create stack section label": "Create script",
35
+ "binding label": "Binding",
36
+ "binding placeholder": "Enter binding",
37
+ "edit binding label": "Edit binding",
38
+ "deploy label": "Deploy",
39
+ "deployed label": "Current version of the script is deployed",
40
+ "upload failed label": "Upload failed",
41
+ "copy link label": "Copy function link"
42
+ }
43
+ }
44
+ }
45
+ ];
46
+
47
+ // packages/plugins/experimental/plugin-script/src/ScriptPlugin.tsx
48
+ var ScriptPlugin = ({ containerUrl }) => {
49
+ return {
50
+ meta: meta_default,
51
+ provides: {
52
+ metadata: {
53
+ records: {
54
+ [ScriptType.typename]: {
55
+ placeholder: [
56
+ "object title placeholder",
57
+ {
58
+ ns: SCRIPT_PLUGIN
59
+ }
60
+ ],
61
+ icon: (props) => /* @__PURE__ */ React2.createElement(Code, props),
62
+ iconSymbol: "ph--code--regular",
63
+ // TODO(wittjosiah): Move out of metadata.
64
+ loadReferences: (script) => loadObjectReferences(script, (script2) => [
65
+ script2.source
66
+ ])
67
+ }
68
+ }
69
+ },
70
+ translations: translations_default,
71
+ echo: {
72
+ schema: [
73
+ ScriptType
74
+ ]
75
+ },
76
+ graph: {
77
+ builder: (plugins) => {
78
+ const client = resolvePlugin(plugins, parseClientPlugin)?.provides.client;
79
+ const dispatch = resolvePlugin(plugins, parseIntentPlugin)?.provides.intent.dispatch;
80
+ if (!client || !dispatch) {
81
+ return [];
82
+ }
83
+ return createExtension({
84
+ id: ScriptAction.CREATE,
85
+ filter: (node) => isActionGroup(node) && node.id.startsWith(SpaceAction.ADD_OBJECT),
86
+ actions: ({ node }) => {
87
+ const id = node.id.split("/").at(-1);
88
+ const [spaceId, objectId] = id?.split(":") ?? [];
89
+ const space = client.spaces.get().find((space2) => space2.id === spaceId);
90
+ const object = objectId && space?.db.getObjectById(objectId);
91
+ const target = objectId ? object : space;
92
+ if (!target) {
93
+ return;
94
+ }
95
+ return [
96
+ {
97
+ id: `${SCRIPT_PLUGIN}/create/${node.id}`,
98
+ data: async () => {
99
+ await dispatch([
100
+ {
101
+ plugin: SCRIPT_PLUGIN,
102
+ action: ScriptAction.CREATE
103
+ },
104
+ {
105
+ action: SpaceAction.ADD_OBJECT,
106
+ data: {
107
+ target
108
+ }
109
+ },
110
+ {
111
+ action: NavigationAction.OPEN
112
+ }
113
+ ]);
114
+ },
115
+ properties: {
116
+ label: [
117
+ "create object label",
118
+ {
119
+ ns: SCRIPT_PLUGIN
120
+ }
121
+ ],
122
+ icon: (props) => /* @__PURE__ */ React2.createElement(Code, props),
123
+ iconSymbol: "ph--code--regular",
124
+ testId: "scriptPlugin.createObject"
125
+ }
126
+ }
127
+ ];
128
+ }
129
+ });
130
+ }
131
+ },
132
+ stack: {
133
+ creators: [
134
+ {
135
+ id: "create-stack-section-script",
136
+ testId: "scriptPlugin.createSectionSpaceScript",
137
+ type: [
138
+ "plugin name",
139
+ {
140
+ ns: SCRIPT_PLUGIN
141
+ }
142
+ ],
143
+ label: [
144
+ "create stack section label",
145
+ {
146
+ ns: SCRIPT_PLUGIN
147
+ }
148
+ ],
149
+ icon: (props) => /* @__PURE__ */ React2.createElement(Code, props),
150
+ intent: {
151
+ plugin: SCRIPT_PLUGIN,
152
+ action: ScriptAction.CREATE
153
+ }
154
+ }
155
+ ]
156
+ },
157
+ surface: {
158
+ component: ({ data, role }) => {
159
+ if (role && ![
160
+ "article",
161
+ "section"
162
+ ].includes(role)) {
163
+ return null;
164
+ }
165
+ if (data.object instanceof ScriptType) {
166
+ return /* @__PURE__ */ React2.createElement(ScriptEditor, {
167
+ script: data.object,
168
+ role
169
+ });
170
+ }
171
+ return null;
172
+ }
173
+ },
174
+ intent: {
175
+ resolver: (intent) => {
176
+ switch (intent.action) {
177
+ case ScriptAction.CREATE: {
178
+ return {
179
+ data: create(ScriptType, {
180
+ source: create(TextType, {
181
+ content: example
182
+ })
183
+ })
184
+ };
185
+ }
186
+ }
187
+ }
188
+ }
189
+ }
190
+ };
191
+ };
192
+ var example = [
193
+ "export default {",
194
+ " async fetch(request, env, ctx) {",
195
+ " return new Response('Hello World, from ScriptPlugin!');",
196
+ " }",
197
+ "}",
198
+ ""
199
+ ].join("\n");
200
+
201
+ // packages/plugins/experimental/plugin-script/src/compiler/compiler.ts
202
+ import { build, initialize } from "esbuild-wasm";
203
+ import { subtleCrypto } from "@dxos/crypto";
204
+ import { invariant } from "@dxos/invariant";
205
+ var __dxlog_file = "/home/runner/work/dxos/dxos/packages/plugins/experimental/plugin-script/src/compiler/compiler.ts";
206
+ var initialized;
207
+ var initializeCompiler = async (options) => {
208
+ await (initialized ??= initialize({
209
+ wasmURL: options.wasmURL
210
+ }));
211
+ };
212
+ var Compiler = class {
213
+ constructor(_options) {
214
+ this._options = _options;
215
+ }
216
+ async compile(source) {
217
+ const { providedModules, ...options } = this._options;
218
+ const createResult = async (result) => {
219
+ return {
220
+ timestamp: Date.now(),
221
+ sourceHash: Buffer.from(await subtleCrypto.digest("SHA-256", Buffer.from(source))),
222
+ ...result
223
+ };
224
+ };
225
+ if (this._options.platform === "browser") {
226
+ invariant(initialized, "Compiler not initialized.", {
227
+ F: __dxlog_file,
228
+ L: 55,
229
+ S: this,
230
+ A: [
231
+ "initialized",
232
+ "'Compiler not initialized.'"
233
+ ]
234
+ });
235
+ await initialized;
236
+ }
237
+ const imports = analyzeSourceFileImports(source);
238
+ try {
239
+ const result = await build({
240
+ ...options,
241
+ metafile: true,
242
+ write: false,
243
+ entryPoints: [
244
+ "memory:main.tsx"
245
+ ],
246
+ bundle: true,
247
+ format: "esm",
248
+ plugins: [
249
+ {
250
+ name: "memory",
251
+ setup: (build2) => {
252
+ build2.onResolve({
253
+ filter: /^memory:/
254
+ }, ({ path }) => {
255
+ return {
256
+ path: path.split(":")[1],
257
+ namespace: "memory"
258
+ };
259
+ });
260
+ build2.onLoad({
261
+ filter: /.*/,
262
+ namespace: "memory"
263
+ }, ({ path }) => {
264
+ const imports2 = [
265
+ "import React from 'react';"
266
+ ];
267
+ if (path === "main.tsx") {
268
+ return {
269
+ contents: [
270
+ ...imports2,
271
+ source
272
+ ].join("\n"),
273
+ loader: "tsx"
274
+ };
275
+ }
276
+ });
277
+ for (const module of providedModules) {
278
+ build2.onResolve({
279
+ filter: new RegExp(`^${module}$`)
280
+ }, ({ path }) => {
281
+ return {
282
+ path,
283
+ namespace: "injected-module"
284
+ };
285
+ });
286
+ }
287
+ build2.onLoad({
288
+ filter: /.*/,
289
+ namespace: "injected-module"
290
+ }, ({ path }) => {
291
+ const namedImports = imports.find((entry) => entry.moduleIdentifier === path)?.namedImports ?? [];
292
+ return {
293
+ contents: `
294
+ const { ${namedImports.join(",")} } = window.__DXOS_SANDBOX_MODULES__[${JSON.stringify(path)}];
295
+ export { ${namedImports.join(",")} };
296
+ export default window.__DXOS_SANDBOX_MODULES__[${JSON.stringify(path)}].default;
297
+ `,
298
+ loader: "tsx"
299
+ };
300
+ });
301
+ }
302
+ }
303
+ ]
304
+ });
305
+ return await createResult({
306
+ imports: this.analyzeImports(result),
307
+ bundle: result.outputFiles[0].text
308
+ });
309
+ } catch (err) {
310
+ return await createResult({
311
+ error: err
312
+ });
313
+ }
314
+ }
315
+ // TODO(dmaretskyi): In the future we can replace the compiler with SWC with plugins running in WASM.
316
+ analyzeImports(result) {
317
+ invariant(result.outputFiles, void 0, {
318
+ F: __dxlog_file,
319
+ L: 121,
320
+ S: this,
321
+ A: [
322
+ "result.outputFiles",
323
+ ""
324
+ ]
325
+ });
326
+ const parsedImports = allMatches(IMPORT_REGEX, result.outputFiles[0].text);
327
+ return Object.values(result.metafile.outputs)[0].imports.map((entry) => {
328
+ const namedImports = [];
329
+ const parsedImport = parsedImports.find((capture) => capture?.[4] === entry.path);
330
+ if (parsedImport?.[2]) {
331
+ NAMED_IMPORTS_REGEX.lastIndex = 0;
332
+ const namedImportsMatch = NAMED_IMPORTS_REGEX.exec(parsedImport[2]);
333
+ if (namedImportsMatch) {
334
+ namedImportsMatch[1].split(",").forEach((importName) => {
335
+ namedImports.push(importName.trim());
336
+ });
337
+ }
338
+ }
339
+ return {
340
+ moduleUrl: entry.path,
341
+ defaultImport: !!parsedImport?.[1],
342
+ namedImports
343
+ };
344
+ });
345
+ }
346
+ analyzeSourceFileImports(code) {
347
+ const parsedImports = allMatches(IMPORT_REGEX, code);
348
+ return parsedImports.map((capture) => {
349
+ return {
350
+ defaultImportName: capture[1],
351
+ namedImports: capture[2]?.split(",").map((importName) => importName.trim()),
352
+ wildcardImportName: capture[3],
353
+ moduleIdentifier: capture[4],
354
+ quotes: capture[5]
355
+ };
356
+ });
357
+ }
358
+ };
359
+ var IMPORT_REGEX = /import(?:(?:(?:[ \n\t]+([^ *\n\t{},]+)[ \n\t]*(?:,|[ \n\t]+))?([ \n\t]*{(?:[ \n\t]*[^ \n\t"'{}]+[ \n\t]*,?)+})?[ \n\t]*)|[ \n\t]*\*[ \n\t]*as[ \n\t]+([^ \n\t{}]+)[ \n\t]+)from[ \n\t]*(?:['"])([^'"\n]+)(['"])/gm;
360
+ var NAMED_IMPORTS_REGEX = /[ \n\t]*{((?:[ \n\t]*[^ \n\t"'{}]+[ \n\t]*,?)+)}[ \n\t]*/gm;
361
+ var allMatches = (regex, str) => {
362
+ regex.lastIndex = 0;
363
+ let match;
364
+ const matches = [];
365
+ while (match = regex.exec(str)) {
366
+ matches.push(match);
367
+ }
368
+ return matches;
369
+ };
370
+ var analyzeSourceFileImports = (code) => {
371
+ const parsedImports = allMatches(IMPORT_REGEX, code);
372
+ return parsedImports.map((capture) => {
373
+ return {
374
+ defaultImportName: capture[1],
375
+ namedImports: capture[2]?.trim().slice(1, -1).split(",").map((importName) => importName.trim()),
376
+ wildcardImportName: capture[3],
377
+ moduleIdentifier: capture[4],
378
+ quotes: capture[5]
379
+ };
380
+ });
381
+ };
382
+
383
+ // packages/plugins/experimental/plugin-script/src/index.ts
384
+ var src_default = ScriptPlugin;
385
+ export {
386
+ Compiler,
387
+ ScriptAction,
388
+ ScriptEditor,
389
+ ScriptPlugin,
390
+ ScriptType,
391
+ TypescriptEditor,
392
+ src_default as default,
393
+ initializeCompiler
394
+ };
395
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/ScriptPlugin.tsx", "../../../src/components/index.ts", "../../../src/translations.ts", "../../../src/compiler/compiler.ts", "../../../src/index.ts"],
4
+ "sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { Code, type IconProps } from '@phosphor-icons/react';\nimport React from 'react';\n\nimport { parseIntentPlugin, type PluginDefinition, resolvePlugin, NavigationAction } from '@dxos/app-framework';\nimport { create } from '@dxos/echo-schema';\nimport { parseClientPlugin } from '@dxos/plugin-client';\nimport { type ActionGroup, createExtension, isActionGroup } from '@dxos/plugin-graph';\nimport { TextType } from '@dxos/plugin-markdown/types';\nimport { SpaceAction } from '@dxos/plugin-space';\nimport { loadObjectReferences } from '@dxos/react-client/echo';\n\nimport { ScriptEditor } from './components';\nimport meta, { SCRIPT_PLUGIN } from './meta';\nimport translations from './translations';\nimport { ScriptType } from './types';\nimport { ScriptAction, type ScriptPluginProvides } from './types';\n\nexport type ScriptPluginProps = {\n containerUrl: string;\n};\n\nexport const ScriptPlugin = ({ containerUrl }: ScriptPluginProps): PluginDefinition<ScriptPluginProvides> => {\n return {\n meta,\n provides: {\n metadata: {\n records: {\n [ScriptType.typename]: {\n placeholder: ['object title placeholder', { ns: SCRIPT_PLUGIN }],\n icon: (props: IconProps) => <Code {...props} />,\n iconSymbol: 'ph--code--regular',\n // TODO(wittjosiah): Move out of metadata.\n loadReferences: (script: ScriptType) => loadObjectReferences(script, (script) => [script.source]),\n },\n },\n },\n translations,\n echo: {\n schema: [ScriptType],\n },\n graph: {\n builder: (plugins) => {\n const client = resolvePlugin(plugins, parseClientPlugin)?.provides.client;\n const dispatch = resolvePlugin(plugins, parseIntentPlugin)?.provides.intent.dispatch;\n if (!client || !dispatch) {\n return [];\n }\n\n return createExtension({\n id: ScriptAction.CREATE,\n filter: (node): node is ActionGroup => isActionGroup(node) && node.id.startsWith(SpaceAction.ADD_OBJECT),\n actions: ({ node }) => {\n const id = node.id.split('/').at(-1);\n const [spaceId, objectId] = id?.split(':') ?? [];\n const space = client.spaces.get().find((space) => space.id === spaceId);\n const object = objectId && space?.db.getObjectById(objectId);\n const target = objectId ? object : space;\n if (!target) {\n return;\n }\n\n return [\n {\n id: `${SCRIPT_PLUGIN}/create/${node.id}`,\n data: async () => {\n await dispatch([\n { plugin: SCRIPT_PLUGIN, action: ScriptAction.CREATE },\n { action: SpaceAction.ADD_OBJECT, data: { target } },\n { action: NavigationAction.OPEN },\n ]);\n },\n properties: {\n label: ['create object label', { ns: SCRIPT_PLUGIN }],\n icon: (props: IconProps) => <Code {...props} />,\n iconSymbol: 'ph--code--regular',\n testId: 'scriptPlugin.createObject',\n },\n },\n ];\n },\n });\n },\n },\n stack: {\n creators: [\n {\n id: 'create-stack-section-script',\n testId: 'scriptPlugin.createSectionSpaceScript',\n type: ['plugin name', { ns: SCRIPT_PLUGIN }],\n label: ['create stack section label', { ns: SCRIPT_PLUGIN }],\n icon: (props: any) => <Code {...props} />,\n intent: {\n plugin: SCRIPT_PLUGIN,\n action: ScriptAction.CREATE,\n },\n },\n ],\n },\n surface: {\n component: ({ data, role }) => {\n if (role && !['article', 'section'].includes(role)) {\n return null;\n }\n\n if (data.object instanceof ScriptType) {\n return <ScriptEditor script={data.object} role={role} />;\n }\n\n return null;\n },\n },\n intent: {\n resolver: (intent) => {\n switch (intent.action) {\n case ScriptAction.CREATE: {\n return { data: create(ScriptType, { source: create(TextType, { content: example }) }) };\n }\n }\n },\n },\n },\n };\n};\n\n// TODO(burdon): Import.\nconst example = [\n 'export default {',\n ' async fetch(request, env, ctx) {',\n \" return new Response('Hello World, from ScriptPlugin!');\",\n ' }',\n '}',\n '',\n].join('\\n');\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport React from 'react';\n\nexport const ScriptEditor = React.lazy(() => import('./ScriptEditor'));\nexport const TypescriptEditor = React.lazy(() => import('./TypescriptEditor'));\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { SCRIPT_PLUGIN } from './meta';\n\nexport default [\n {\n 'en-US': {\n [SCRIPT_PLUGIN]: {\n 'plugin name': 'Scripts',\n 'object title placeholder': 'New script',\n 'create object label': 'Create script',\n 'create stack section label': 'Create script',\n 'binding label': 'Binding',\n 'binding placeholder': 'Enter binding',\n 'edit binding label': 'Edit binding',\n 'deploy label': 'Deploy',\n 'deployed label': 'Current version of the script is deployed',\n 'upload failed label': 'Upload failed',\n 'copy link label': 'Copy function link',\n },\n },\n },\n];\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { type BuildOptions } from 'esbuild';\nimport { build, initialize, type BuildResult } from 'esbuild-wasm';\n\nimport { subtleCrypto } from '@dxos/crypto';\nimport { invariant } from '@dxos/invariant';\n\nexport type Import = {\n moduleUrl: string;\n defaultImport: boolean;\n namedImports: string[];\n};\n\nexport type CompilerResult = {\n timestamp: number;\n sourceHash: Buffer;\n imports?: Import[];\n bundle?: string;\n error?: any;\n};\n\nexport type CompilerOptions = {\n platform: BuildOptions['platform'];\n providedModules: string[];\n};\n\nlet initialized: Promise<void>;\nexport const initializeCompiler = async (options: { wasmURL: string }) => {\n await (initialized ??= initialize({\n wasmURL: options.wasmURL,\n }));\n};\n\n/**\n * ESBuild compiler.\n */\nexport class Compiler {\n constructor(private readonly _options: CompilerOptions) {}\n\n async compile(source: string): Promise<CompilerResult> {\n const { providedModules, ...options } = this._options;\n\n const createResult = async (result?: Partial<CompilerResult>) => {\n return {\n timestamp: Date.now(),\n sourceHash: Buffer.from(await subtleCrypto.digest('SHA-256', Buffer.from(source))),\n ...result,\n };\n };\n\n if (this._options.platform === 'browser') {\n invariant(initialized, 'Compiler not initialized.');\n await initialized;\n }\n\n const imports = analyzeSourceFileImports(source);\n\n // https://esbuild.github.io/api/#build\n try {\n const result = await build({\n ...options,\n metafile: true,\n write: false,\n entryPoints: ['memory:main.tsx'],\n bundle: true,\n format: 'esm',\n plugins: [\n {\n name: 'memory',\n setup: (build) => {\n build.onResolve({ filter: /^memory:/ }, ({ path }) => {\n return { path: path.split(':')[1], namespace: 'memory' };\n });\n\n build.onLoad({ filter: /.*/, namespace: 'memory' }, ({ path }) => {\n const imports = [\"import React from 'react';\"];\n if (path === 'main.tsx') {\n return {\n contents: [...imports, source].join('\\n'),\n loader: 'tsx',\n };\n }\n });\n\n for (const module of providedModules) {\n build.onResolve({ filter: new RegExp(`^${module}$`) }, ({ path }) => {\n return { path, namespace: 'injected-module' };\n });\n }\n\n build.onLoad({ filter: /.*/, namespace: 'injected-module' }, ({ path }) => {\n const namedImports = imports.find((entry) => entry.moduleIdentifier === path)?.namedImports ?? [];\n return {\n contents: `\n const { ${namedImports.join(',')} } = window.__DXOS_SANDBOX_MODULES__[${JSON.stringify(path)}];\n export { ${namedImports.join(',')} };\n export default window.__DXOS_SANDBOX_MODULES__[${JSON.stringify(path)}].default;\n `,\n loader: 'tsx',\n };\n });\n },\n },\n ],\n });\n\n return await createResult({\n imports: this.analyzeImports(result),\n bundle: result.outputFiles![0].text,\n });\n } catch (err) {\n return await createResult({ error: err });\n }\n }\n\n // TODO(dmaretskyi): In the future we can replace the compiler with SWC with plugins running in WASM.\n analyzeImports(result: BuildResult): Import[] {\n invariant(result.outputFiles);\n\n // TODO(dmaretskyi): Support import aliases and wildcard imports.\n const parsedImports = allMatches(IMPORT_REGEX, result.outputFiles[0].text);\n return Object.values(result.metafile!.outputs)[0].imports.map((entry): Import => {\n const namedImports: string[] = [];\n\n const parsedImport = parsedImports.find((capture) => capture?.[4] === entry.path);\n if (parsedImport?.[2]) {\n NAMED_IMPORTS_REGEX.lastIndex = 0;\n const namedImportsMatch = NAMED_IMPORTS_REGEX.exec(parsedImport[2]);\n if (namedImportsMatch) {\n namedImportsMatch[1].split(',').forEach((importName) => {\n namedImports.push(importName.trim());\n });\n }\n }\n\n return {\n moduleUrl: entry.path,\n defaultImport: !!parsedImport?.[1],\n namedImports,\n };\n });\n }\n\n analyzeSourceFileImports(code: string) {\n // TODO(dmaretskyi): Support import aliases and wildcard imports.\n const parsedImports = allMatches(IMPORT_REGEX, code);\n return parsedImports.map((capture) => {\n return {\n defaultImportName: capture[1],\n namedImports: capture[2]?.split(',').map((importName) => importName.trim()),\n wildcardImportName: capture[3],\n moduleIdentifier: capture[4],\n quotes: capture[5],\n };\n });\n }\n}\n\n// https://regex101.com/r/FEN5ks/1\n// https://stackoverflow.com/a/73265022\n// $1 = default import name (can be non-existent)\n// $2 = destructured exports (can be non-existent)\n// $3 = wildcard import name (can be non-existent)\n// $4 = module identifier\n// $5 = quotes used (either ' or \")\nconst IMPORT_REGEX =\n /import(?:(?:(?:[ \\n\\t]+([^ *\\n\\t{},]+)[ \\n\\t]*(?:,|[ \\n\\t]+))?([ \\n\\t]*{(?:[ \\n\\t]*[^ \\n\\t\"'{}]+[ \\n\\t]*,?)+})?[ \\n\\t]*)|[ \\n\\t]*\\*[ \\n\\t]*as[ \\n\\t]+([^ \\n\\t{}]+)[ \\n\\t]+)from[ \\n\\t]*(?:['\"])([^'\"\\n]+)(['\"])/gm;\n\nconst NAMED_IMPORTS_REGEX = /[ \\n\\t]*{((?:[ \\n\\t]*[^ \\n\\t\"'{}]+[ \\n\\t]*,?)+)}[ \\n\\t]*/gm;\n\nconst allMatches = (regex: RegExp, str: string) => {\n regex.lastIndex = 0;\n\n let match;\n const matches = [];\n while ((match = regex.exec(str))) {\n matches.push(match);\n }\n\n return matches;\n};\n\ntype ParsedImport = {\n defaultImportName?: string;\n namedImports: string[];\n wildcardImportName?: string;\n moduleIdentifier: string;\n quotes: string;\n};\n\nconst analyzeSourceFileImports = (code: string): ParsedImport[] => {\n // TODO(dmaretskyi): Support import aliases and wildcard imports.\n const parsedImports = allMatches(IMPORT_REGEX, code);\n return parsedImports.map((capture) => {\n return {\n defaultImportName: capture[1],\n namedImports: capture[2]\n ?.trim()\n .slice(1, -1)\n .split(',')\n .map((importName) => importName.trim()),\n wildcardImportName: capture[3],\n moduleIdentifier: capture[4],\n quotes: capture[5],\n };\n });\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { ScriptPlugin } from './ScriptPlugin';\n\nexport default ScriptPlugin;\n\nexport * from './compiler';\nexport * from './components';\nexport * from './types';\n\nexport * from './ScriptPlugin';\n"],
5
+ "mappings": ";;;;;;;;;;AAIA,SAASA,YAA4B;AACrC,OAAOC,YAAW;AAElB,SAASC,mBAA0CC,eAAeC,wBAAwB;AAC1F,SAASC,cAAc;AACvB,SAASC,yBAAyB;AAClC,SAA2BC,iBAAiBC,qBAAqB;AACjE,SAASC,gBAAgB;AACzB,SAASC,mBAAmB;AAC5B,SAASC,4BAA4B;;;ACTrC,OAAOC,WAAW;AAEX,IAAMC,eAAeC,MAAMC,KAAK,MAAM,OAAO,6BAAA,CAAA;AAC7C,IAAMC,mBAAmBF,MAAMC,KAAK,MAAM,OAAO,iCAAA,CAAA;;;ACDxD,IAAA,uBAAe;EACb;IACE,SAAS;MACP,CAACE,aAAAA,GAAgB;QACf,eAAe;QACf,4BAA4B;QAC5B,uBAAuB;QACvB,8BAA8B;QAC9B,iBAAiB;QACjB,uBAAuB;QACvB,sBAAsB;QACtB,gBAAgB;QAChB,kBAAkB;QAClB,uBAAuB;QACvB,mBAAmB;MACrB;IACF;EACF;;;;AFEK,IAAMC,eAAe,CAAC,EAAEC,aAAY,MAAqB;AAC9D,SAAO;IACLC;IACAC,UAAU;MACRC,UAAU;QACRC,SAAS;UACP,CAACC,WAAWC,QAAQ,GAAG;YACrBC,aAAa;cAAC;cAA4B;gBAAEC,IAAIC;cAAc;;YAC9DC,MAAM,CAACC,UAAqB,gBAAAC,OAAA,cAACC,MAASF,KAAAA;YACtCG,YAAY;;YAEZC,gBAAgB,CAACC,WAAuBC,qBAAqBD,QAAQ,CAACA,YAAW;cAACA,QAAOE;aAAO;UAClG;QACF;MACF;MACAC;MACAC,MAAM;QACJC,QAAQ;UAAChB;;MACX;MACAiB,OAAO;QACLC,SAAS,CAACC,YAAAA;AACR,gBAAMC,SAASC,cAAcF,SAASG,iBAAAA,GAAoBzB,SAASuB;AACnE,gBAAMG,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AAc;AAErC,UAAMnB,gBAAgBC,WAAWC,cAAciB,IAAAA;AAC/C,WAAOnB,cAAcM,IAAI,CAACE,YAAAA;AACxB,aAAO;QACLY,mBAAmBZ,QAAQ,CAAA;QAC3BnB,cAAcmB,QAAQ,CAAA,GAAI3B,MAAM,GAAA,EAAKyB,IAAI,CAACQ,eAAeA,WAAWE,KAAI,CAAA;QACxEK,oBAAoBb,QAAQ,CAAA;QAC5BhB,kBAAkBgB,QAAQ,CAAA;QAC1Bc,QAAQd,QAAQ,CAAA;MAClB;IACF,CAAA;EACF;AACF;AASA,IAAMN,eACJ;AAEF,IAAMO,sBAAsB;AAE5B,IAAMR,aAAa,CAACsB,OAAeC,QAAAA;AACjCD,QAAMb,YAAY;AAElB,MAAIe;AACJ,QAAMC,UAAU,CAAA;AAChB,SAAQD,QAAQF,MAAMX,KAAKY,GAAAA,GAAO;AAChCE,YAAQX,KAAKU,KAAAA;EACf;AAEA,SAAOC;AACT;AAUA,IAAMzD,2BAA2B,CAACkD,SAAAA;AAEhC,QAAMnB,gBAAgBC,WAAWC,cAAciB,IAAAA;AAC/C,SAAOnB,cAAcM,IAAI,CAACE,YAAAA;AACxB,WAAO;MACLY,mBAAmBZ,QAAQ,CAAA;MAC3BnB,cAAcmB,QAAQ,CAAA,GAClBQ,KAAAA,EACDW,MAAM,GAAG,EAAC,EACV9C,MAAM,GAAA,EACNyB,IAAI,CAACQ,eAAeA,WAAWE,KAAI,CAAA;MACtCK,oBAAoBb,QAAQ,CAAA;MAC5BhB,kBAAkBgB,QAAQ,CAAA;MAC1Bc,QAAQd,QAAQ,CAAA;IAClB;EACF,CAAA;AACF;;;AC3MA,IAAA,cAAeoB;",
6
+ "names": ["Code", "React", "parseIntentPlugin", "resolvePlugin", "NavigationAction", "create", "parseClientPlugin", "createExtension", "isActionGroup", "TextType", "SpaceAction", "loadObjectReferences", "React", "ScriptEditor", "React", "lazy", "TypescriptEditor", "SCRIPT_PLUGIN", "ScriptPlugin", "containerUrl", "meta", "provides", "metadata", "records", "ScriptType", "typename", "placeholder", "ns", "SCRIPT_PLUGIN", "icon", "props", "React", "Code", "iconSymbol", "loadReferences", "script", "loadObjectReferences", "source", "translations", "echo", "schema", "graph", "builder", "plugins", "client", "resolvePlugin", "parseClientPlugin", "dispatch", "parseIntentPlugin", "intent", "createExtension", "id", "ScriptAction", "CREATE", "filter", "node", "isActionGroup", "startsWith", "SpaceAction", "ADD_OBJECT", "actions", "split", "at", "spaceId", "objectId", "space", "spaces", "get", "find", "object", "db", "getObjectById", "target", "data", "plugin", "action", "NavigationAction", "OPEN", "properties", "label", "testId", "stack", "creators", "type", "surface", "component", "role", "includes", "ScriptEditor", "resolver", "create", "TextType", "content", "example", "join", "build", "initialize", "subtleCrypto", "invariant", "initialized", "initializeCompiler", "options", "wasmURL", "Compiler", "constructor", "_options", "compile", "source", "providedModules", "createResult", "result", "timestamp", "Date", "now", "sourceHash", "Buffer", "from", "digest", "platform", "imports", "analyzeSourceFileImports", "metafile", "write", "entryPoints", "bundle", "format", "plugins", "name", "setup", "onResolve", "filter", "path", "split", "namespace", "onLoad", "contents", "join", "loader", "module", "RegExp", "namedImports", "find", "entry", "moduleIdentifier", "JSON", "stringify", "analyzeImports", "outputFiles", "text", "err", "error", "parsedImports", "allMatches", "IMPORT_REGEX", "Object", "values", "outputs", "map", "parsedImport", "capture", "NAMED_IMPORTS_REGEX", "lastIndex", "namedImportsMatch", "exec", "forEach", "importName", "push", "trim", "moduleUrl", "defaultImport", "code", "defaultImportName", "wildcardImportName", "quotes", "regex", "str", "match", "matches", "slice", "ScriptPlugin"]
7
+ }
@@ -0,0 +1 @@
1
+ {"inputs":{"packages/plugins/experimental/plugin-script/src/edge/header-codec.ts":{"bytes":10228,"imports":[],"format":"esm"},"packages/plugins/experimental/plugin-script/src/edge/codec.ts":{"bytes":1702,"imports":[{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"packages/plugins/experimental/plugin-script/src/edge/header-codec.ts","kind":"import-statement","original":"./header-codec"}],"format":"esm"},"packages/plugins/experimental/plugin-script/src/edge/hub-protocol.ts":{"bytes":2750,"imports":[],"format":"esm"},"packages/plugins/experimental/plugin-script/src/edge/functions.ts":{"bytes":14187,"imports":[{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"packages/plugins/experimental/plugin-script/src/edge/codec.ts","kind":"import-statement","original":"./codec"},{"path":"packages/plugins/experimental/plugin-script/src/edge/hub-protocol.ts","kind":"import-statement","original":"./hub-protocol"}],"format":"esm"},"packages/plugins/experimental/plugin-script/src/edge/index.ts":{"bytes":907,"imports":[{"path":"packages/plugins/experimental/plugin-script/src/edge/codec.ts","kind":"import-statement","original":"./codec"},{"path":"packages/plugins/experimental/plugin-script/src/edge/functions.ts","kind":"import-statement","original":"./functions"},{"path":"packages/plugins/experimental/plugin-script/src/edge/header-codec.ts","kind":"import-statement","original":"./header-codec"},{"path":"packages/plugins/experimental/plugin-script/src/edge/hub-protocol.ts","kind":"import-statement","original":"./hub-protocol"}],"format":"esm"},"packages/plugins/experimental/plugin-script/src/meta.tsx":{"bytes":1964,"imports":[{"path":"@phosphor-icons/react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true}],"format":"esm"},"packages/plugins/experimental/plugin-script/src/components/Toolbar.tsx":{"bytes":17016,"imports":[{"path":"@phosphor-icons/react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"packages/plugins/experimental/plugin-script/src/meta.tsx","kind":"import-statement","original":"../meta"}],"format":"esm"},"packages/plugins/experimental/plugin-script/src/components/TypescriptEditor.tsx":{"bytes":7040,"imports":[{"path":"@codemirror/lang-javascript","kind":"import-statement","external":true},{"path":"@codemirror/language","kind":"import-statement","external":true},{"path":"@codemirror/theme-one-dark","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-editor","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true}],"format":"esm"},"packages/plugins/experimental/plugin-script/src/components/ScriptEditor.tsx":{"bytes":13730,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/react-client","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"@dxos/react-client/halo","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-editor","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"packages/plugins/experimental/plugin-script/src/components/Toolbar.tsx","kind":"import-statement","original":"./Toolbar"},{"path":"packages/plugins/experimental/plugin-script/src/components/TypescriptEditor.tsx","kind":"import-statement","original":"./TypescriptEditor"},{"path":"packages/plugins/experimental/plugin-script/src/edge/index.ts","kind":"import-statement","original":"../edge"},{"path":"packages/plugins/experimental/plugin-script/src/meta.tsx","kind":"import-statement","original":"../meta"}],"format":"esm"},"packages/plugins/experimental/plugin-script/src/components/index.ts":{"bytes":1121,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"packages/plugins/experimental/plugin-script/src/components/ScriptEditor.tsx","kind":"dynamic-import","original":"./ScriptEditor"},{"path":"packages/plugins/experimental/plugin-script/src/components/TypescriptEditor.tsx","kind":"dynamic-import","original":"./TypescriptEditor"}],"format":"esm"},"packages/plugins/experimental/plugin-script/src/translations.ts":{"bytes":2462,"imports":[{"path":"packages/plugins/experimental/plugin-script/src/meta.tsx","kind":"import-statement","original":"./meta"}],"format":"esm"},"packages/plugins/experimental/plugin-script/src/types/script.ts":{"bytes":2107,"imports":[{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/plugin-markdown/types","kind":"import-statement","external":true}],"format":"esm"},"packages/plugins/experimental/plugin-script/src/types/types.tsx":{"bytes":1612,"imports":[{"path":"packages/plugins/experimental/plugin-script/src/meta.tsx","kind":"import-statement","original":"../meta"}],"format":"esm"},"packages/plugins/experimental/plugin-script/src/types/index.ts":{"bytes":600,"imports":[{"path":"packages/plugins/experimental/plugin-script/src/types/script.ts","kind":"import-statement","original":"./script"},{"path":"packages/plugins/experimental/plugin-script/src/types/types.tsx","kind":"import-statement","original":"./types"}],"format":"esm"},"packages/plugins/experimental/plugin-script/src/ScriptPlugin.tsx":{"bytes":19018,"imports":[{"path":"@phosphor-icons/react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/plugin-client","kind":"import-statement","external":true},{"path":"@dxos/plugin-graph","kind":"import-statement","external":true},{"path":"@dxos/plugin-markdown/types","kind":"import-statement","external":true},{"path":"@dxos/plugin-space","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"packages/plugins/experimental/plugin-script/src/components/index.ts","kind":"import-statement","original":"./components"},{"path":"packages/plugins/experimental/plugin-script/src/meta.tsx","kind":"import-statement","original":"./meta"},{"path":"packages/plugins/experimental/plugin-script/src/translations.ts","kind":"import-statement","original":"./translations"},{"path":"packages/plugins/experimental/plugin-script/src/types/index.ts","kind":"import-statement","original":"./types"},{"path":"packages/plugins/experimental/plugin-script/src/types/index.ts","kind":"import-statement","original":"./types"}],"format":"esm"},"packages/plugins/experimental/plugin-script/src/compiler/compiler.ts":{"bytes":23524,"imports":[{"path":"esbuild-wasm","kind":"import-statement","external":true},{"path":"@dxos/crypto","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true}],"format":"esm"},"packages/plugins/experimental/plugin-script/src/compiler/index.ts":{"bytes":524,"imports":[{"path":"packages/plugins/experimental/plugin-script/src/compiler/compiler.ts","kind":"import-statement","original":"./compiler"}],"format":"esm"},"packages/plugins/experimental/plugin-script/src/index.ts":{"bytes":1062,"imports":[{"path":"packages/plugins/experimental/plugin-script/src/ScriptPlugin.tsx","kind":"import-statement","original":"./ScriptPlugin"},{"path":"packages/plugins/experimental/plugin-script/src/compiler/index.ts","kind":"import-statement","original":"./compiler"},{"path":"packages/plugins/experimental/plugin-script/src/components/index.ts","kind":"import-statement","original":"./components"},{"path":"packages/plugins/experimental/plugin-script/src/types/index.ts","kind":"import-statement","original":"./types"},{"path":"packages/plugins/experimental/plugin-script/src/ScriptPlugin.tsx","kind":"import-statement","original":"./ScriptPlugin"}],"format":"esm"}},"outputs":{"packages/plugins/experimental/plugin-script/dist/lib/browser/edge/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"packages/plugins/experimental/plugin-script/dist/lib/browser/edge/index.mjs":{"imports":[{"path":"packages/plugins/experimental/plugin-script/dist/lib/browser/chunk-EZ7PWOLU.mjs","kind":"import-statement"}],"exports":["HeaderCodec","codec","getUserFunctionUrlInMetadata","matchServiceCredential","publicKeyToDid","setUserFunctionUrlInMetadata","uploadWorkerFunction"],"entryPoint":"packages/plugins/experimental/plugin-script/src/edge/index.ts","inputs":{},"bytes":398},"packages/plugins/experimental/plugin-script/dist/lib/browser/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":21254},"packages/plugins/experimental/plugin-script/dist/lib/browser/index.mjs":{"imports":[{"path":"packages/plugins/experimental/plugin-script/dist/lib/browser/chunk-Z72YKDJ2.mjs","kind":"import-statement"},{"path":"packages/plugins/experimental/plugin-script/dist/lib/browser/chunk-JBACGDOJ.mjs","kind":"import-statement"},{"path":"@phosphor-icons/react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/plugin-client","kind":"import-statement","external":true},{"path":"@dxos/plugin-graph","kind":"import-statement","external":true},{"path":"@dxos/plugin-markdown/types","kind":"import-statement","external":true},{"path":"@dxos/plugin-space","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"packages/plugins/experimental/plugin-script/dist/lib/browser/ScriptEditor-6Q7HFLJ6.mjs","kind":"dynamic-import"},{"path":"packages/plugins/experimental/plugin-script/dist/lib/browser/TypescriptEditor-HP35MTEQ.mjs","kind":"dynamic-import"},{"path":"esbuild-wasm","kind":"import-statement","external":true},{"path":"@dxos/crypto","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true}],"exports":["Compiler","ScriptAction","ScriptEditor","ScriptPlugin","ScriptType","TypescriptEditor","default","initializeCompiler"],"entryPoint":"packages/plugins/experimental/plugin-script/src/index.ts","inputs":{"packages/plugins/experimental/plugin-script/src/ScriptPlugin.tsx":{"bytesInOutput":5034},"packages/plugins/experimental/plugin-script/src/components/index.ts":{"bytesInOutput":187},"packages/plugins/experimental/plugin-script/src/translations.ts":{"bytesInOutput":612},"packages/plugins/experimental/plugin-script/src/compiler/compiler.ts":{"bytesInOutput":5832},"packages/plugins/experimental/plugin-script/src/compiler/index.ts":{"bytesInOutput":0},"packages/plugins/experimental/plugin-script/src/index.ts":{"bytesInOutput":32}},"bytes":12438},"packages/plugins/experimental/plugin-script/dist/lib/browser/meta.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"packages/plugins/experimental/plugin-script/dist/lib/browser/meta.mjs":{"imports":[{"path":"packages/plugins/experimental/plugin-script/dist/lib/browser/chunk-JBACGDOJ.mjs","kind":"import-statement"}],"exports":["SCRIPT_PLUGIN","default"],"entryPoint":"packages/plugins/experimental/plugin-script/src/meta.tsx","inputs":{},"bytes":161},"packages/plugins/experimental/plugin-script/dist/lib/browser/types/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"packages/plugins/experimental/plugin-script/dist/lib/browser/types/index.mjs":{"imports":[{"path":"packages/plugins/experimental/plugin-script/dist/lib/browser/chunk-Z72YKDJ2.mjs","kind":"import-statement"},{"path":"packages/plugins/experimental/plugin-script/dist/lib/browser/chunk-JBACGDOJ.mjs","kind":"import-statement"}],"exports":["ScriptAction","ScriptType"],"entryPoint":"packages/plugins/experimental/plugin-script/src/types/index.ts","inputs":{},"bytes":178},"packages/plugins/experimental/plugin-script/dist/lib/browser/chunk-Z72YKDJ2.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":1863},"packages/plugins/experimental/plugin-script/dist/lib/browser/chunk-Z72YKDJ2.mjs":{"imports":[{"path":"packages/plugins/experimental/plugin-script/dist/lib/browser/chunk-JBACGDOJ.mjs","kind":"import-statement"},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/plugin-markdown/types","kind":"import-statement","external":true}],"exports":["ScriptAction","ScriptType"],"inputs":{"packages/plugins/experimental/plugin-script/src/types/script.ts":{"bytesInOutput":437},"packages/plugins/experimental/plugin-script/src/types/index.ts":{"bytesInOutput":0},"packages/plugins/experimental/plugin-script/src/types/types.tsx":{"bytesInOutput":167}},"bytes":882},"packages/plugins/experimental/plugin-script/dist/lib/browser/TypescriptEditor-HP35MTEQ.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"packages/plugins/experimental/plugin-script/dist/lib/browser/TypescriptEditor-HP35MTEQ.mjs":{"imports":[{"path":"packages/plugins/experimental/plugin-script/dist/lib/browser/chunk-2EM5Y66A.mjs","kind":"import-statement"}],"exports":["TypescriptEditor","default"],"entryPoint":"packages/plugins/experimental/plugin-script/src/components/TypescriptEditor.tsx","inputs":{},"bytes":212},"packages/plugins/experimental/plugin-script/dist/lib/browser/ScriptEditor-6Q7HFLJ6.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":16203},"packages/plugins/experimental/plugin-script/dist/lib/browser/ScriptEditor-6Q7HFLJ6.mjs":{"imports":[{"path":"packages/plugins/experimental/plugin-script/dist/lib/browser/chunk-EZ7PWOLU.mjs","kind":"import-statement"},{"path":"packages/plugins/experimental/plugin-script/dist/lib/browser/chunk-JBACGDOJ.mjs","kind":"import-statement"},{"path":"packages/plugins/experimental/plugin-script/dist/lib/browser/chunk-2EM5Y66A.mjs","kind":"import-statement"},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/react-client","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"@dxos/react-client/halo","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-editor","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"@phosphor-icons/react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true}],"exports":["ScriptEditor","default"],"entryPoint":"packages/plugins/experimental/plugin-script/src/components/ScriptEditor.tsx","inputs":{"packages/plugins/experimental/plugin-script/src/components/ScriptEditor.tsx":{"bytesInOutput":3479},"packages/plugins/experimental/plugin-script/src/components/Toolbar.tsx":{"bytesInOutput":4861}},"bytes":8948},"packages/plugins/experimental/plugin-script/dist/lib/browser/chunk-EZ7PWOLU.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":14649},"packages/plugins/experimental/plugin-script/dist/lib/browser/chunk-EZ7PWOLU.mjs":{"imports":[{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true}],"exports":["HeaderCodec","codec","getUserFunctionUrlInMetadata","matchServiceCredential","publicKeyToDid","setUserFunctionUrlInMetadata","uploadWorkerFunction"],"inputs":{"packages/plugins/experimental/plugin-script/src/edge/codec.ts":{"bytesInOutput":221},"packages/plugins/experimental/plugin-script/src/edge/header-codec.ts":{"bytesInOutput":2132},"packages/plugins/experimental/plugin-script/src/edge/index.ts":{"bytesInOutput":0},"packages/plugins/experimental/plugin-script/src/edge/functions.ts":{"bytesInOutput":3303},"packages/plugins/experimental/plugin-script/src/edge/hub-protocol.ts":{"bytesInOutput":425}},"bytes":6710},"packages/plugins/experimental/plugin-script/dist/lib/browser/chunk-JBACGDOJ.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":961},"packages/plugins/experimental/plugin-script/dist/lib/browser/chunk-JBACGDOJ.mjs":{"imports":[{"path":"@phosphor-icons/react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true}],"exports":["SCRIPT_PLUGIN","meta_default"],"inputs":{"packages/plugins/experimental/plugin-script/src/meta.tsx":{"bytesInOutput":430}},"bytes":579},"packages/plugins/experimental/plugin-script/dist/lib/browser/chunk-2EM5Y66A.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":3598},"packages/plugins/experimental/plugin-script/dist/lib/browser/chunk-2EM5Y66A.mjs":{"imports":[{"path":"@codemirror/lang-javascript","kind":"import-statement","external":true},{"path":"@codemirror/language","kind":"import-statement","external":true},{"path":"@codemirror/theme-one-dark","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-editor","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true}],"exports":["TypescriptEditor","TypescriptEditor_default"],"inputs":{"packages/plugins/experimental/plugin-script/src/components/TypescriptEditor.tsx":{"bytesInOutput":1702}},"bytes":1889}}}
@@ -0,0 +1,9 @@
1
+ import {
2
+ SCRIPT_PLUGIN,
3
+ meta_default
4
+ } from "./chunk-JBACGDOJ.mjs";
5
+ export {
6
+ SCRIPT_PLUGIN,
7
+ meta_default as default
8
+ };
9
+ //# sourceMappingURL=meta.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": [],
4
+ "sourcesContent": [],
5
+ "mappings": "",
6
+ "names": []
7
+ }
@@ -0,0 +1,10 @@
1
+ import {
2
+ ScriptAction,
3
+ ScriptType
4
+ } from "../chunk-Z72YKDJ2.mjs";
5
+ import "../chunk-JBACGDOJ.mjs";
6
+ export {
7
+ ScriptAction,
8
+ ScriptType
9
+ };
10
+ //# sourceMappingURL=index.mjs.map