@dxos/plugin-script 0.6.8-staging.77f93a3 → 0.6.8-staging.c55b37f
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.
- package/dist/lib/browser/{ScriptEditor-6Q7HFLJ6.mjs → ScriptEditor-7XICKICQ.mjs} +42 -21
- package/dist/lib/browser/ScriptEditor-7XICKICQ.mjs.map +7 -0
- package/dist/lib/browser/{TypescriptEditor-HP35MTEQ.mjs → TypescriptEditor-PIRIDDUS.mjs} +2 -2
- package/dist/lib/browser/{chunk-2EM5Y66A.mjs → chunk-D4O723CR.mjs} +4 -2
- package/dist/lib/browser/chunk-D4O723CR.mjs.map +7 -0
- package/dist/lib/browser/{chunk-EZ7PWOLU.mjs → chunk-SK3L274X.mjs} +6 -6
- package/dist/lib/browser/{chunk-EZ7PWOLU.mjs.map → chunk-SK3L274X.mjs.map} +2 -2
- package/dist/lib/browser/{chunk-Z72YKDJ2.mjs → chunk-ZGCETT2W.mjs} +13 -3
- package/dist/lib/browser/chunk-ZGCETT2W.mjs.map +7 -0
- package/dist/lib/browser/edge/index.mjs +1 -1
- package/dist/lib/browser/index.mjs +7 -4
- package/dist/lib/browser/index.mjs.map +3 -3
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/types/index.mjs +3 -1
- package/dist/lib/node/{ScriptEditor-AIVKL2NX.cjs → ScriptEditor-M7KZ2CRS.cjs} +45 -26
- package/dist/lib/node/ScriptEditor-M7KZ2CRS.cjs.map +7 -0
- package/dist/lib/node/{TypescriptEditor-PWOAN5RQ.cjs → TypescriptEditor-OTWJUIWB.cjs} +7 -7
- package/dist/lib/node/{TypescriptEditor-PWOAN5RQ.cjs.map → TypescriptEditor-OTWJUIWB.cjs.map} +2 -2
- package/dist/lib/node/{chunk-SLV3SDZE.cjs → chunk-ITLHJMWP.cjs} +6 -4
- package/dist/lib/node/chunk-ITLHJMWP.cjs.map +7 -0
- package/dist/lib/node/{chunk-6Y2S6SGK.cjs → chunk-VW2POILW.cjs} +17 -6
- package/dist/lib/node/chunk-VW2POILW.cjs.map +7 -0
- package/dist/lib/node/{chunk-LWUBFTPA.cjs → chunk-X6A3D4PD.cjs} +9 -9
- package/dist/lib/node/{chunk-LWUBFTPA.cjs.map → chunk-X6A3D4PD.cjs.map} +2 -2
- package/dist/lib/node/edge/index.cjs +8 -8
- package/dist/lib/node/edge/index.cjs.map +1 -1
- package/dist/lib/node/index.cjs +16 -13
- package/dist/lib/node/index.cjs.map +3 -3
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node/types/index.cjs +5 -3
- package/dist/lib/node/types/index.cjs.map +2 -2
- package/dist/types/src/components/ScriptEditor.d.ts.map +1 -1
- package/dist/types/src/components/Toolbar.d.ts +1 -1
- package/dist/types/src/components/Toolbar.d.ts.map +1 -1
- package/dist/types/src/components/Toolbar.stories.d.ts +1 -1
- package/dist/types/src/components/TypescriptEditor.d.ts.map +1 -1
- package/dist/types/src/edge/functions.d.ts.map +1 -1
- package/dist/types/src/types/script.d.ts +33 -2
- package/dist/types/src/types/script.d.ts.map +1 -1
- package/dist/types/src/types/types.d.ts +1 -1
- package/dist/types/src/types/types.d.ts.map +1 -1
- package/package.json +33 -33
- package/src/ScriptPlugin.tsx +2 -2
- package/src/components/ScriptEditor.tsx +29 -13
- package/src/components/Toolbar.tsx +24 -4
- package/src/components/TypescriptEditor.tsx +4 -1
- package/src/edge/functions.ts +1 -2
- package/src/types/script.ts +7 -2
- package/src/types/types.tsx +1 -1
- package/dist/lib/browser/ScriptEditor-6Q7HFLJ6.mjs.map +0 -7
- package/dist/lib/browser/chunk-2EM5Y66A.mjs.map +0 -7
- package/dist/lib/browser/chunk-Z72YKDJ2.mjs.map +0 -7
- package/dist/lib/node/ScriptEditor-AIVKL2NX.cjs.map +0 -7
- package/dist/lib/node/chunk-6Y2S6SGK.cjs.map +0 -7
- package/dist/lib/node/chunk-SLV3SDZE.cjs.map +0 -7
- /package/dist/lib/browser/{TypescriptEditor-HP35MTEQ.mjs.map → TypescriptEditor-PIRIDDUS.mjs.map} +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/edge/codec.ts", "../../../src/edge/header-codec.ts", "../../../src/edge/functions.ts", "../../../src/edge/hub-protocol.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2024 DXOS.org\n//\n\nimport { PublicKey } from '@dxos/keys';\n\nimport { HeaderCodec, type EncodedKey } from './header-codec';\n\nexport const codec = new HeaderCodec<PublicKey>({\n isKey: (value: any): value is PublicKey => value instanceof PublicKey,\n encode: (key: PublicKey): EncodedKey => ({ __k: key.toHex() }),\n decode: (value: EncodedKey): PublicKey => PublicKey.fromHex(value.__k),\n});\n", "//\n// Copyright 2024 DXOS.org\n//\n\n// TODO(burdon): Factor out from @dxos/hub-protocol\n\nconst ENCODING = 'base64';\n\nexport type EncodedKey = { __k: string };\n\nexport type EncodedBytes = { __b: string };\n\nexport type EncodedTimestamp = { __t: number };\n\nexport interface KeyCodec<KeyType> {\n isKey(value: any): value is KeyType;\n encode(key: KeyType): EncodedKey;\n decode(value: EncodedKey): KeyType;\n}\n\n// TODO(wittjosiah): Use deepMapValues from @dxos/util -- it handles recursion for you.\nexport class HeaderCodec<Key> {\n constructor(private readonly _keyCodec: KeyCodec<Key>) {}\n\n encode(obj: any): string {\n const objectToEncode = this._prepareForEncoding(obj);\n const encoded = Buffer.from(JSON.stringify(objectToEncode));\n return encoded.toString(ENCODING);\n }\n\n decode<Type>(buffer: string): Type {\n const json = JSON.parse(Buffer.from(buffer, ENCODING).toString());\n return this._decodeRecursive(json);\n }\n\n private _decodeRecursive(obj: any): any {\n return this._recurse(obj, (value) => {\n if (isEncodedBytes(value)) {\n return decodeBytes(value.__b);\n }\n if (isEncodedKey(value)) {\n return this._keyCodec.decode(value);\n }\n if (isEncodedDate(value)) {\n return decodeDate(value);\n }\n return null;\n });\n }\n\n private _prepareForEncoding(obj: any): any {\n return this._recurse(obj, (value) => {\n if (value instanceof Uint8Array) {\n return { __b: encodeBytes(value) };\n }\n if (this._keyCodec.isKey(value)) {\n return this._keyCodec.encode(value);\n }\n if (value instanceof Date) {\n return encodeDate(value);\n }\n return null;\n });\n }\n\n private _recurse(obj: any, handler: (obj: object) => any | null): any {\n if (typeof obj !== 'object') {\n return obj;\n }\n const handled = handler(obj);\n if (handled != null) {\n return handled;\n }\n if (Array.isArray(obj)) {\n const result = [];\n for (const elem of obj) {\n result.push(this._recurse(elem, handler));\n }\n return result;\n }\n const result: any = {};\n for (const [key, value] of Object.entries(obj)) {\n result[key] = this._recurse(value, handler);\n }\n return result;\n }\n}\n\nconst isEncodedKey = (obj: object): obj is EncodedKey => '__k' in obj && typeof obj.__k === 'string';\nconst isEncodedBytes = (obj: object): obj is EncodedBytes => '__b' in obj && typeof obj.__b === 'string';\nconst isEncodedDate = (obj: object): obj is EncodedTimestamp => '__t' in obj && typeof obj.__t === 'number';\n\nconst encodeDate = (date: Date) => ({ __t: date.getTime() });\nconst decodeDate = (timestamp: EncodedTimestamp) => new Date(timestamp.__t);\n\nconst encodeBytes = (bytes: Uint8Array) => Buffer.from(bytes).toString(ENCODING);\nconst decodeBytes = (bytes: string) => Buffer.from(bytes, ENCODING);\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport { type DID } from 'iso-did/types';\n\nimport { Trigger } from '@dxos/async';\nimport { type Config } from '@dxos/client';\nimport { type Halo } from '@dxos/client-protocol';\nimport { type ObjectMeta } from '@dxos/echo-schema';\nimport { invariant } from '@dxos/invariant';\nimport { log } from '@dxos/log';\nimport { type Credential } from '@dxos/protocols/proto/dxos/halo/credentials';\n\nimport { codec } from './codec';\nimport { matchServiceCredential } from './hub-protocol';\n\n// TODO: use URL scheme for source?\nconst USERFUNCTIONS_META_KEY = 'dxos.org/service/function';\nconst USERFUNCTIONS_CREDENTIAL_CAPABILITY = 'composer:beta';\n\n// TODO: Synchronize API types with server\nexport type UserFunctionUploadResult = {\n result: 'success' | 'error';\n errorMessage?: string;\n functionId?: string;\n functionVersionNumber?: number;\n};\n\nexport type UploadWorkerProps = {\n clientConfig: Config;\n halo: Halo;\n name?: string;\n source: string;\n functionId?: string;\n ownerDid: DID;\n credentialLoadTimeout?: number; // ms to wait for credentials to load\n};\n\nconst defaultUserFunctionsBaseUrl = '
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA,kBAA0B;AEE1B,mBAAwB;AAIxB,uBAA0B;AAC1B,iBAAoB;ADLpB,IAAMA,WAAW;AAeV,IAAMC,cAAN,MAAMA;EACXC,YAA6BC,WAA0B;SAA1BA,YAAAA;EAA2B;EAExDC,OAAOC,KAAkB;AACvB,UAAMC,iBAAiB,KAAKC,oBAAoBF,GAAAA;AAChD,UAAMG,UAAUC,OAAOC,KAAKC,KAAKC,UAAUN,cAAAA,CAAAA;AAC3C,WAAOE,QAAQK,SAASb,QAAAA;EAC1B;EAEAc,OAAaC,QAAsB;AACjC,UAAMC,OAAOL,KAAKM,MAAMR,OAAOC,KAAKK,QAAQf,QAAAA,EAAUa,SAAQ,CAAA;AAC9D,WAAO,KAAKK,iBAAiBF,IAAAA;EAC/B;EAEQE,iBAAiBb,KAAe;AACtC,WAAO,KAAKc,SAASd,KAAK,CAACe,UAAAA;AACzB,UAAIC,eAAeD,KAAAA,GAAQ;AACzB,eAAOE,YAAYF,MAAMG,GAAG;MAC9B;AACA,UAAIC,aAAaJ,KAAAA,GAAQ;AACvB,eAAO,KAAKjB,UAAUW,OAAOM,KAAAA;MAC/B;AACA,UAAIK,cAAcL,KAAAA,GAAQ;AACxB,eAAOM,WAAWN,KAAAA;MACpB;AACA,aAAO;IACT,CAAA;EACF;EAEQb,oBAAoBF,KAAe;AACzC,WAAO,KAAKc,SAASd,KAAK,CAACe,UAAAA;AACzB,UAAIA,iBAAiBO,YAAY;AAC/B,eAAO;UAAEJ,KAAKK,YAAYR,KAAAA;QAAO;MACnC;AACA,U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/C,YAAuB;EAC9C4B,OAAO,CAACT,UAAmCA,iBAAiB6B;EAC5D7C,QAAQ,CAACmC,SAAgC;IAAEG,KAAKH,IAAIW,MAAK;EAAG;EAC5DpC,QAAQ,CAACM,UAAiC6B,sBAAUE,QAAQ/B,MAAMsB,GAAG;AACvE,CAAA;AGDO,IAAMU,yBACX,CAACC,eAAyB,CAAA,MAC1B,CAACC,eAAAA;AACC,MAAIA,WAAWC,QAAQC,UAAU,OAAA,MAAa,uCAAuC;AACnF,WAAO;EACT;AAEA,QAAM,EAAEH,cAAcI,uBAAsB,IAAKH,WAAWC,QAAQC;AACpE,SAAOH,aAAaK,MAAM,CAACC,eAAeF,uBAAuBG,SAASD,UAAAA,CAAAA;AAC5E;AAIK,IAAME,iBAAiB,CAACtB,QAAAA;AAC7B,SAAO,WAAWA,IAAIW,MAAK,CAAA;AAC7B;;ADRA,IAAMY,yBAAyB;AAC/B,IAAMC,sCAAsC;AAoB5C,IAAMC,8BAA8B;
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2024 DXOS.org\n//\n\nimport { PublicKey } from '@dxos/keys';\n\nimport { HeaderCodec, type EncodedKey } from './header-codec';\n\nexport const codec = new HeaderCodec<PublicKey>({\n isKey: (value: any): value is PublicKey => value instanceof PublicKey,\n encode: (key: PublicKey): EncodedKey => ({ __k: key.toHex() }),\n decode: (value: EncodedKey): PublicKey => PublicKey.fromHex(value.__k),\n});\n", "//\n// Copyright 2024 DXOS.org\n//\n\n// TODO(burdon): Factor out from @dxos/hub-protocol\n\nconst ENCODING = 'base64';\n\nexport type EncodedKey = { __k: string };\n\nexport type EncodedBytes = { __b: string };\n\nexport type EncodedTimestamp = { __t: number };\n\nexport interface KeyCodec<KeyType> {\n isKey(value: any): value is KeyType;\n encode(key: KeyType): EncodedKey;\n decode(value: EncodedKey): KeyType;\n}\n\n// TODO(wittjosiah): Use deepMapValues from @dxos/util -- it handles recursion for you.\nexport class HeaderCodec<Key> {\n constructor(private readonly _keyCodec: KeyCodec<Key>) {}\n\n encode(obj: any): string {\n const objectToEncode = this._prepareForEncoding(obj);\n const encoded = Buffer.from(JSON.stringify(objectToEncode));\n return encoded.toString(ENCODING);\n }\n\n decode<Type>(buffer: string): Type {\n const json = JSON.parse(Buffer.from(buffer, ENCODING).toString());\n return this._decodeRecursive(json);\n }\n\n private _decodeRecursive(obj: any): any {\n return this._recurse(obj, (value) => {\n if (isEncodedBytes(value)) {\n return decodeBytes(value.__b);\n }\n if (isEncodedKey(value)) {\n return this._keyCodec.decode(value);\n }\n if (isEncodedDate(value)) {\n return decodeDate(value);\n }\n return null;\n });\n }\n\n private _prepareForEncoding(obj: any): any {\n return this._recurse(obj, (value) => {\n if (value instanceof Uint8Array) {\n return { __b: encodeBytes(value) };\n }\n if (this._keyCodec.isKey(value)) {\n return this._keyCodec.encode(value);\n }\n if (value instanceof Date) {\n return encodeDate(value);\n }\n return null;\n });\n }\n\n private _recurse(obj: any, handler: (obj: object) => any | null): any {\n if (typeof obj !== 'object') {\n return obj;\n }\n const handled = handler(obj);\n if (handled != null) {\n return handled;\n }\n if (Array.isArray(obj)) {\n const result = [];\n for (const elem of obj) {\n result.push(this._recurse(elem, handler));\n }\n return result;\n }\n const result: any = {};\n for (const [key, value] of Object.entries(obj)) {\n result[key] = this._recurse(value, handler);\n }\n return result;\n }\n}\n\nconst isEncodedKey = (obj: object): obj is EncodedKey => '__k' in obj && typeof obj.__k === 'string';\nconst isEncodedBytes = (obj: object): obj is EncodedBytes => '__b' in obj && typeof obj.__b === 'string';\nconst isEncodedDate = (obj: object): obj is EncodedTimestamp => '__t' in obj && typeof obj.__t === 'number';\n\nconst encodeDate = (date: Date) => ({ __t: date.getTime() });\nconst decodeDate = (timestamp: EncodedTimestamp) => new Date(timestamp.__t);\n\nconst encodeBytes = (bytes: Uint8Array) => Buffer.from(bytes).toString(ENCODING);\nconst decodeBytes = (bytes: string) => Buffer.from(bytes, ENCODING);\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport { type DID } from 'iso-did/types';\n\nimport { Trigger } from '@dxos/async';\nimport { type Config } from '@dxos/client';\nimport { type Halo } from '@dxos/client-protocol';\nimport { type ObjectMeta } from '@dxos/echo-schema';\nimport { invariant } from '@dxos/invariant';\nimport { log } from '@dxos/log';\nimport { type Credential } from '@dxos/protocols/proto/dxos/halo/credentials';\n\nimport { codec } from './codec';\nimport { matchServiceCredential } from './hub-protocol';\n\n// TODO: use URL scheme for source?\nconst USERFUNCTIONS_META_KEY = 'dxos.org/service/function';\nconst USERFUNCTIONS_CREDENTIAL_CAPABILITY = 'composer:beta';\n\n// TODO: Synchronize API types with server\nexport type UserFunctionUploadResult = {\n result: 'success' | 'error';\n errorMessage?: string;\n functionId?: string;\n functionVersionNumber?: number;\n};\n\nexport type UploadWorkerProps = {\n clientConfig: Config;\n halo: Halo;\n name?: string;\n source: string;\n functionId?: string;\n ownerDid: DID;\n credentialLoadTimeout?: number; // ms to wait for credentials to load\n};\n\nconst defaultUserFunctionsBaseUrl = 'https://functions-staging.dxos.workers.dev'; // 'http://localhost:8600';\n\nconst getBaseUrl = (config: Config) => {\n return config.get('runtime.app.env.DX_USERFUNCTIONS_BASE_URL') || defaultUserFunctionsBaseUrl;\n};\n\nexport const uploadWorkerFunction = async ({\n clientConfig,\n halo,\n name,\n source,\n ownerDid,\n functionId,\n credentialLoadTimeout,\n}: UploadWorkerProps) => {\n const identity = halo.identity.get();\n if (!identity) {\n throw new Error('Identity not available');\n }\n const userFunctionsBaseUrl = getBaseUrl(clientConfig);\n\n // TODO: codify naming convention\n const uploadUrl = `${userFunctionsBaseUrl}/${ownerDid}` + (functionId ? `/${functionId}` : '');\n\n log('Upload', { functionId, source, name, identityKey: identity.identityKey, uploadUrl: uploadUrl.toString() });\n const response = await fetch(uploadUrl, {\n method: 'PUT',\n body: JSON.stringify({ script: source, name }),\n headers: await presentationForIdentity({ halo, timeout: credentialLoadTimeout }),\n });\n if (!response.ok) {\n return (await response.json()) as UserFunctionUploadResult;\n }\n\n const res = await response.json();\n log('Upload response', { status: response.status, res });\n\n return res as UserFunctionUploadResult;\n};\n\nexport const getUserFunctionUrlInMetadata = (meta: ObjectMeta) => {\n return meta.keys.find((key) => key.source === USERFUNCTIONS_META_KEY)?.id;\n};\n\nexport const setUserFunctionUrlInMetadata = (meta: ObjectMeta, functionUrl: string) => {\n const key = meta.keys.find((key) => key.source === USERFUNCTIONS_META_KEY);\n if (key) {\n if (key.id !== functionUrl) {\n throw new Error('Metadata mismatch');\n }\n } else {\n meta.keys.push({ source: USERFUNCTIONS_META_KEY, id: functionUrl });\n }\n};\n\n// TODO: handle team owner\n\nconst presentationForIdentity = async ({ halo, timeout }: { halo: Halo; timeout?: number }) => {\n let credential: Credential | undefined;\n\n if (timeout) {\n const credentialsLoaded = new Trigger();\n halo.credentials.subscribe((c) => {\n credential = c.find(matchServiceCredential([USERFUNCTIONS_CREDENTIAL_CAPABILITY]));\n if (credential) {\n credentialsLoaded.wake();\n }\n });\n await credentialsLoaded.wait({\n timeout,\n });\n } else {\n credential = halo\n .queryCredentials()\n .toSorted((a, b) => b.issuanceDate.getTime() - a.issuanceDate.getTime())\n .find(matchServiceCredential([USERFUNCTIONS_CREDENTIAL_CAPABILITY]));\n }\n\n if (!credential) {\n throw new Error('No credential found');\n }\n log('credential found', { credential });\n // TODO(wittjosiah): If id is required to present credentials, then it should always be present for queried credentials.\n invariant(credential.id, 'beta credential missing id');\n const presentation = await halo.presentCredentials({ ids: [credential.id] });\n\n return { Authorization: `Bearer ${codec.encode(presentation)}` };\n};\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport { type DID } from 'iso-did/types';\n\nimport { type Credential } from '@dxos/client/halo';\nimport { type PublicKey } from '@dxos/keys';\n\n// TODO(burdon): Factor out to @dxos/hub-protocol.\n\nexport const matchServiceCredential =\n (capabilities: string[] = []) =>\n (credential: Credential) => {\n if (credential.subject.assertion['@type'] !== 'dxos.halo.credentials.ServiceAccess') {\n return false;\n }\n\n const { capabilities: credentialCapabilities } = credential.subject.assertion;\n return capabilities.every((capability) => credentialCapabilities.includes(capability));\n };\n\n// TODO: reconcile with @dxos/hub-protocol\n\nexport const publicKeyToDid = (key: PublicKey): DID => {\n return `did:key:${key.toHex()}`;\n};\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA,kBAA0B;AEE1B,mBAAwB;AAIxB,uBAA0B;AAC1B,iBAAoB;ADLpB,IAAMA,WAAW;AAeV,IAAMC,cAAN,MAAMA;EACXC,YAA6BC,WAA0B;SAA1BA,YAAAA;EAA2B;EAExDC,OAAOC,KAAkB;AACvB,UAAMC,iBAAiB,KAAKC,oBAAoBF,GAAAA;AAChD,UAAMG,UAAUC,OAAOC,KAAKC,KAAKC,UAAUN,cAAAA,CAAAA;AAC3C,WAAOE,QAAQK,SAASb,QAAAA;EAC1B;EAEAc,OAAaC,QAAsB;AACjC,UAAMC,OAAOL,KAAKM,MAAMR,OAAOC,KAAKK,QAAQf,QAAAA,EAAUa,SAAQ,CAAA;AAC9D,WAAO,KAAKK,iBAAiBF,IAAAA;EAC/B;EAEQE,iBAAiBb,KAAe;AACtC,WAAO,KAAKc,SAASd,KAAK,CAACe,UAAAA;AACzB,UAAIC,eAAeD,KAAAA,GAAQ;AACzB,eAAOE,YAAYF,MAAMG,GAAG;MAC9B;AACA,UAAIC,aAAaJ,KAAAA,GAAQ;AACvB,eAAO,KAAKjB,UAAUW,OAAOM,KAAAA;MAC/B;AACA,UAAIK,cAAcL,KAAAA,GAAQ;AACxB,eAAOM,WAAWN,KAAAA;MACpB;AACA,aAAO;IACT,CAAA;EACF;EAEQb,oBAAoBF,KAAe;AACzC,WAAO,KAAKc,SAASd,KAAK,CAACe,UAAAA;AACzB,UAAIA,iBAAiBO,YAAY;AAC/B,eAAO;UAAEJ,KAAKK,YAAYR,KAAAA;QAAO;MACnC;AACA,UAAI,KAAKjB,UAAU0B,MAAMT,KAAAA,GAAQ;AAC/B,eAAO,KAAKjB,UAAUC,OAAO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I,oBAAoB;IAAE1B;EAAW,GAAA;;;;;;AAErC0D,kCAAU1D,WAAW2C,IAAI,8BAAA;;;;;;;;;AACzB,QAAMgB,eAAe,MAAM3C,KAAK4C,mBAAmB;IAAEC,KAAK;MAAC7D,WAAW2C;;EAAI,CAAA;AAE1E,SAAO;IAAEmB,eAAe,UAAUpE,MAAM5C,OAAO6G,YAAAA,CAAAA;EAAgB;AACjE;",
|
|
6
6
|
"names": ["ENCODING", "HeaderCodec", "constructor", "_keyCodec", "encode", "obj", "objectToEncode", "_prepareForEncoding", "encoded", "Buffer", "from", "JSON", "stringify", "toString", "decode", "buffer", "json", "parse", "_decodeRecursive", "_recurse", "value", "isEncodedBytes", "decodeBytes", "__b", "isEncodedKey", "isEncodedDate", "decodeDate", "Uint8Array", "encodeBytes", "isKey", "Date", "encodeDate", "handler", "handled", "Array", "isArray", "result", "elem", "push", "key", "Object", "entries", "__k", "__t", "date", "getTime", "timestamp", "bytes", "codec", "PublicKey", "toHex", "fromHex", "matchServiceCredential", "capabilities", "credential", "subject", "assertion", "credentialCapabilities", "every", "capability", "includes", "publicKeyToDid", "USERFUNCTIONS_META_KEY", "USERFUNCTIONS_CREDENTIAL_CAPABILITY", "defaultUserFunctionsBaseUrl", "getBaseUrl", "config", "get", "uploadWorkerFunction", "clientConfig", "halo", "name", "source", "ownerDid", "functionId", "credentialLoadTimeout", "identity", "Error", "userFunctionsBaseUrl", "uploadUrl", "log", "identityKey", "response", "fetch", "method", "body", "script", "headers", "presentationForIdentity", "timeout", "ok", "res", "status", "getUserFunctionUrlInMetadata", "meta", "keys", "find", "id", "setUserFunctionUrlInMetadata", "functionUrl", "credentialsLoaded", "Trigger", "credentials", "subscribe", "c", "wake", "wait", "queryCredentials", "toSorted", "a", "b", "issuanceDate", "invariant", "presentation", "presentCredentials", "ids", "Authorization"]
|
|
7
7
|
}
|
|
@@ -18,16 +18,16 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
18
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
19
|
var edge_exports = {};
|
|
20
20
|
__export(edge_exports, {
|
|
21
|
-
HeaderCodec: () =>
|
|
22
|
-
codec: () =>
|
|
23
|
-
getUserFunctionUrlInMetadata: () =>
|
|
24
|
-
matchServiceCredential: () =>
|
|
25
|
-
publicKeyToDid: () =>
|
|
26
|
-
setUserFunctionUrlInMetadata: () =>
|
|
27
|
-
uploadWorkerFunction: () =>
|
|
21
|
+
HeaderCodec: () => import_chunk_X6A3D4PD.HeaderCodec,
|
|
22
|
+
codec: () => import_chunk_X6A3D4PD.codec,
|
|
23
|
+
getUserFunctionUrlInMetadata: () => import_chunk_X6A3D4PD.getUserFunctionUrlInMetadata,
|
|
24
|
+
matchServiceCredential: () => import_chunk_X6A3D4PD.matchServiceCredential,
|
|
25
|
+
publicKeyToDid: () => import_chunk_X6A3D4PD.publicKeyToDid,
|
|
26
|
+
setUserFunctionUrlInMetadata: () => import_chunk_X6A3D4PD.setUserFunctionUrlInMetadata,
|
|
27
|
+
uploadWorkerFunction: () => import_chunk_X6A3D4PD.uploadWorkerFunction
|
|
28
28
|
});
|
|
29
29
|
module.exports = __toCommonJS(edge_exports);
|
|
30
|
-
var
|
|
30
|
+
var import_chunk_X6A3D4PD = require("../chunk-X6A3D4PD.cjs");
|
|
31
31
|
// Annotate the CommonJS export names for ESM import in node:
|
|
32
32
|
0 && (module.exports = {
|
|
33
33
|
HeaderCodec,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["index.cjs"],
|
|
4
|
-
"sourcesContent": ["import {\n HeaderCodec,\n codec,\n getUserFunctionUrlInMetadata,\n matchServiceCredential,\n publicKeyToDid,\n setUserFunctionUrlInMetadata,\n uploadWorkerFunction\n} from \"../chunk-
|
|
4
|
+
"sourcesContent": ["import {\n HeaderCodec,\n codec,\n getUserFunctionUrlInMetadata,\n matchServiceCredential,\n publicKeyToDid,\n setUserFunctionUrlInMetadata,\n uploadWorkerFunction\n} from \"../chunk-X6A3D4PD.cjs\";\nexport {\n HeaderCodec,\n codec,\n getUserFunctionUrlInMetadata,\n matchServiceCredential,\n publicKeyToDid,\n setUserFunctionUrlInMetadata,\n uploadWorkerFunction\n};\n//# sourceMappingURL=index.cjs.map\n"],
|
|
5
5
|
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,4BAQO;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/lib/node/index.cjs
CHANGED
|
@@ -29,16 +29,17 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
29
29
|
var node_exports = {};
|
|
30
30
|
__export(node_exports, {
|
|
31
31
|
Compiler: () => Compiler,
|
|
32
|
-
|
|
32
|
+
FunctionType: () => import_chunk_VW2POILW.FunctionType,
|
|
33
|
+
ScriptAction: () => import_chunk_VW2POILW.ScriptAction,
|
|
33
34
|
ScriptEditor: () => ScriptEditor,
|
|
34
35
|
ScriptPlugin: () => ScriptPlugin,
|
|
35
|
-
ScriptType: () =>
|
|
36
|
+
ScriptType: () => import_chunk_VW2POILW.ScriptType,
|
|
36
37
|
TypescriptEditor: () => TypescriptEditor,
|
|
37
38
|
default: () => src_default,
|
|
38
39
|
initializeCompiler: () => initializeCompiler
|
|
39
40
|
});
|
|
40
41
|
module.exports = __toCommonJS(node_exports);
|
|
41
|
-
var
|
|
42
|
+
var import_chunk_VW2POILW = require("./chunk-VW2POILW.cjs");
|
|
42
43
|
var import_chunk_4VMNBXWU = require("./chunk-4VMNBXWU.cjs");
|
|
43
44
|
var import_react = require("@phosphor-icons/react");
|
|
44
45
|
var import_react2 = __toESM(require("react"));
|
|
@@ -53,8 +54,8 @@ var import_react3 = __toESM(require("react"));
|
|
|
53
54
|
var import_esbuild_wasm = require("esbuild-wasm");
|
|
54
55
|
var import_crypto = require("@dxos/crypto");
|
|
55
56
|
var import_invariant = require("@dxos/invariant");
|
|
56
|
-
var ScriptEditor = import_react3.default.lazy(() => import("./ScriptEditor-
|
|
57
|
-
var TypescriptEditor = import_react3.default.lazy(() => import("./TypescriptEditor-
|
|
57
|
+
var ScriptEditor = import_react3.default.lazy(() => import("./ScriptEditor-M7KZ2CRS.cjs"));
|
|
58
|
+
var TypescriptEditor = import_react3.default.lazy(() => import("./TypescriptEditor-OTWJUIWB.cjs"));
|
|
58
59
|
var translations_default = [
|
|
59
60
|
{
|
|
60
61
|
"en-US": {
|
|
@@ -80,7 +81,7 @@ var ScriptPlugin = ({ containerUrl }) => {
|
|
|
80
81
|
provides: {
|
|
81
82
|
metadata: {
|
|
82
83
|
records: {
|
|
83
|
-
[
|
|
84
|
+
[import_chunk_VW2POILW.ScriptType.typename]: {
|
|
84
85
|
placeholder: [
|
|
85
86
|
"object title placeholder",
|
|
86
87
|
{
|
|
@@ -99,7 +100,8 @@ var ScriptPlugin = ({ containerUrl }) => {
|
|
|
99
100
|
translations: translations_default,
|
|
100
101
|
echo: {
|
|
101
102
|
schema: [
|
|
102
|
-
|
|
103
|
+
import_chunk_VW2POILW.ScriptType,
|
|
104
|
+
import_chunk_VW2POILW.FunctionType
|
|
103
105
|
]
|
|
104
106
|
},
|
|
105
107
|
graph: {
|
|
@@ -110,7 +112,7 @@ var ScriptPlugin = ({ containerUrl }) => {
|
|
|
110
112
|
return [];
|
|
111
113
|
}
|
|
112
114
|
return (0, import_plugin_graph.createExtension)({
|
|
113
|
-
id:
|
|
115
|
+
id: import_chunk_VW2POILW.ScriptAction.CREATE,
|
|
114
116
|
filter: (node) => (0, import_plugin_graph.isActionGroup)(node) && node.id.startsWith(import_plugin_space.SpaceAction.ADD_OBJECT),
|
|
115
117
|
actions: ({ node }) => {
|
|
116
118
|
const id = node.id.split("/").at(-1);
|
|
@@ -128,7 +130,7 @@ var ScriptPlugin = ({ containerUrl }) => {
|
|
|
128
130
|
await dispatch([
|
|
129
131
|
{
|
|
130
132
|
plugin: import_chunk_4VMNBXWU.SCRIPT_PLUGIN,
|
|
131
|
-
action:
|
|
133
|
+
action: import_chunk_VW2POILW.ScriptAction.CREATE
|
|
132
134
|
},
|
|
133
135
|
{
|
|
134
136
|
action: import_plugin_space.SpaceAction.ADD_OBJECT,
|
|
@@ -178,7 +180,7 @@ var ScriptPlugin = ({ containerUrl }) => {
|
|
|
178
180
|
icon: (props) => /* @__PURE__ */ import_react2.default.createElement(import_react.Code, props),
|
|
179
181
|
intent: {
|
|
180
182
|
plugin: import_chunk_4VMNBXWU.SCRIPT_PLUGIN,
|
|
181
|
-
action:
|
|
183
|
+
action: import_chunk_VW2POILW.ScriptAction.CREATE
|
|
182
184
|
}
|
|
183
185
|
}
|
|
184
186
|
]
|
|
@@ -191,7 +193,7 @@ var ScriptPlugin = ({ containerUrl }) => {
|
|
|
191
193
|
].includes(role)) {
|
|
192
194
|
return null;
|
|
193
195
|
}
|
|
194
|
-
if (data.object instanceof
|
|
196
|
+
if (data.object instanceof import_chunk_VW2POILW.ScriptType) {
|
|
195
197
|
return /* @__PURE__ */ import_react2.default.createElement(ScriptEditor, {
|
|
196
198
|
script: data.object,
|
|
197
199
|
role
|
|
@@ -203,9 +205,9 @@ var ScriptPlugin = ({ containerUrl }) => {
|
|
|
203
205
|
intent: {
|
|
204
206
|
resolver: (intent) => {
|
|
205
207
|
switch (intent.action) {
|
|
206
|
-
case
|
|
208
|
+
case import_chunk_VW2POILW.ScriptAction.CREATE: {
|
|
207
209
|
return {
|
|
208
|
-
data: (0, import_echo_schema.create)(
|
|
210
|
+
data: (0, import_echo_schema.create)(import_chunk_VW2POILW.ScriptType, {
|
|
209
211
|
source: (0, import_echo_schema.create)(import_types.TextType, {
|
|
210
212
|
content: example
|
|
211
213
|
})
|
|
@@ -407,6 +409,7 @@ var src_default = ScriptPlugin;
|
|
|
407
409
|
// Annotate the CommonJS export names for ESM import in node:
|
|
408
410
|
0 && (module.exports = {
|
|
409
411
|
Compiler,
|
|
412
|
+
FunctionType,
|
|
410
413
|
ScriptAction,
|
|
411
414
|
ScriptEditor,
|
|
412
415
|
ScriptPlugin,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
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": "
|
|
6
|
-
"names": ["import_react", "ScriptEditor", "React", "lazy", "TypescriptEditor", "SCRIPT_PLUGIN", "ScriptPlugin", "containerUrl", "meta", "provides", "metadata", "records", "ScriptType", "typename", "placeholder", "ns", "icon", "props", "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", "resolver", "create", "TextType", "content", "example", "join", "initialized", "initializeCompiler", "options", "initialize", "wasmURL", "Compiler", "constructor", "_options", "compile", "providedModules", "createResult", "result", "timestamp", "Date", "now", "sourceHash", "Buffer", "from", "subtleCrypto", "digest", "platform", "invariant", "imports", "analyzeSourceFileImports", "build", "metafile", "write", "entryPoints", "bundle", "format", "name", "setup", "onResolve", "path", "namespace", "onLoad", "contents", "loader", "module", "RegExp", "namedImports", "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"]
|
|
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 { FunctionType, 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, FunctionType],\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,mBAAqC;AACrC,IAAAA,gBAAkB;AAElB,2BAA0F;AAC1F,yBAAuB;AACvB,2BAAkC;AAClC,0BAAiE;AACjE,mBAAyB;AACzB,0BAA4B;AAC5B,kBAAqC;ACTrC,IAAAA,gBAAkB;AEClB,0BAAoD;AAEpD,oBAA6B;AAC7B,uBAA0B;AFFnB,IAAMC,eAAeC,cAAAA,QAAMC,KAAK,MAAM,OAAO,6BAAA,CAAA;AAC7C,IAAMC,mBAAmBF,cAAAA,QAAMC,KAAK,MAAM,OAAO,iCAAA,CAAA;ACDxD,IAAA,uBAAe;EACb;IACE,SAAS;MACP,CAACE,mCAAAA,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,MAAAA;IACAC,UAAU;MACRC,UAAU;QACRC,SAAS;UACP,CAACC,iCAAWC,QAAQ,GAAG;YACrBC,aAAa;cAAC;cAA4B;gBAAEC,IAAIV;cAAc;;YAC9DW,MAAM,CAACC,UAAqBf,8BAAAA,QAAA,cAACgB,mBAASD,KAAAA;YACtCE,YAAY;;YAEZC,gBAAgB,CAACC,eAAuBC,kCAAqBD,QAAQ,CAACA,YAAW;cAACA,QAAOE;aAAO;UAClG;QACF;MACF;MACAC,cAAAA;MACAC,MAAM;QACJC,QAAQ;UAACd;UAAYe;;MACvB;MACAC,OAAO;QACLC,SAAS,CAACC,YAAAA;AACR,gBAAMC,aAASC,oCAAcF,SAASG,sCAAAA,GA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B,IAAAA;AAC/C,WAAOnB,cAAcM,IAAI,CAACE,YAAAA;AACxB,aAAO;QACLY,mBAAmBZ,QAAQ,CAAA;QAC3BlB,cAAckB,QAAQ,CAAA,GAAI3F,MAAM,GAAA,EAAKyF,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,IAAMrD,2BAA2B,CAAC8C,SAAAA;AAEhC,QAAMnB,gBAAgBC,WAAWC,cAAciB,IAAAA;AAC/C,SAAOnB,cAAcM,IAAI,CAACE,YAAAA;AACxB,WAAO;MACLY,mBAAmBZ,QAAQ,CAAA;MAC3BlB,cAAckB,QAAQ,CAAA,GAClBQ,KAAAA,EACDW,MAAM,GAAG,EAAC,EACV9G,MAAM,GAAA,EACNyF,IAAI,CAACQ,eAAeA,WAAWE,KAAI,CAAA;MACtCK,oBAAoBb,QAAQ,CAAA;MAC5BhB,kBAAkBgB,QAAQ,CAAA;MAC1Bc,QAAQd,QAAQ,CAAA;IAClB;EACF,CAAA;AACF;AC3MA,IAAA,cAAerI;",
|
|
6
|
+
"names": ["import_react", "ScriptEditor", "React", "lazy", "TypescriptEditor", "SCRIPT_PLUGIN", "ScriptPlugin", "containerUrl", "meta", "provides", "metadata", "records", "ScriptType", "typename", "placeholder", "ns", "icon", "props", "Code", "iconSymbol", "loadReferences", "script", "loadObjectReferences", "source", "translations", "echo", "schema", "FunctionType", "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", "resolver", "create", "TextType", "content", "example", "join", "initialized", "initializeCompiler", "options", "initialize", "wasmURL", "Compiler", "constructor", "_options", "compile", "providedModules", "createResult", "result", "timestamp", "Date", "now", "sourceHash", "Buffer", "from", "subtleCrypto", "digest", "platform", "invariant", "imports", "analyzeSourceFileImports", "build", "metafile", "write", "entryPoints", "bundle", "format", "name", "setup", "onResolve", "path", "namespace", "onLoad", "contents", "loader", "module", "RegExp", "namedImports", "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"]
|
|
7
7
|
}
|
package/dist/lib/node/meta.json
CHANGED
|
@@ -1 +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/node/edge/index.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"packages/plugins/experimental/plugin-script/dist/lib/node/edge/index.cjs":{"imports":[{"path":"packages/plugins/experimental/plugin-script/dist/lib/node/chunk-LWUBFTPA.cjs","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/node/index.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":21254},"packages/plugins/experimental/plugin-script/dist/lib/node/index.cjs":{"imports":[{"path":"packages/plugins/experimental/plugin-script/dist/lib/node/chunk-6Y2S6SGK.cjs","kind":"import-statement"},{"path":"packages/plugins/experimental/plugin-script/dist/lib/node/chunk-4VMNBXWU.cjs","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/node/ScriptEditor-AIVKL2NX.cjs","kind":"dynamic-import"},{"path":"packages/plugins/experimental/plugin-script/dist/lib/node/TypescriptEditor-PWOAN5RQ.cjs","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/node/meta.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"packages/plugins/experimental/plugin-script/dist/lib/node/meta.cjs":{"imports":[{"path":"packages/plugins/experimental/plugin-script/dist/lib/node/chunk-4VMNBXWU.cjs","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/node/types/index.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"packages/plugins/experimental/plugin-script/dist/lib/node/types/index.cjs":{"imports":[{"path":"packages/plugins/experimental/plugin-script/dist/lib/node/chunk-6Y2S6SGK.cjs","kind":"import-statement"},{"path":"packages/plugins/experimental/plugin-script/dist/lib/node/chunk-4VMNBXWU.cjs","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/node/chunk-6Y2S6SGK.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":1863},"packages/plugins/experimental/plugin-script/dist/lib/node/chunk-6Y2S6SGK.cjs":{"imports":[{"path":"packages/plugins/experimental/plugin-script/dist/lib/node/chunk-4VMNBXWU.cjs","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/node/TypescriptEditor-PWOAN5RQ.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"packages/plugins/experimental/plugin-script/dist/lib/node/TypescriptEditor-PWOAN5RQ.cjs":{"imports":[{"path":"packages/plugins/experimental/plugin-script/dist/lib/node/chunk-SLV3SDZE.cjs","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/node/ScriptEditor-AIVKL2NX.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":16203},"packages/plugins/experimental/plugin-script/dist/lib/node/ScriptEditor-AIVKL2NX.cjs":{"imports":[{"path":"packages/plugins/experimental/plugin-script/dist/lib/node/chunk-LWUBFTPA.cjs","kind":"import-statement"},{"path":"packages/plugins/experimental/plugin-script/dist/lib/node/chunk-4VMNBXWU.cjs","kind":"import-statement"},{"path":"packages/plugins/experimental/plugin-script/dist/lib/node/chunk-SLV3SDZE.cjs","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/node/chunk-LWUBFTPA.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":14649},"packages/plugins/experimental/plugin-script/dist/lib/node/chunk-LWUBFTPA.cjs":{"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/node/chunk-4VMNBXWU.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":961},"packages/plugins/experimental/plugin-script/dist/lib/node/chunk-4VMNBXWU.cjs":{"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/node/chunk-SLV3SDZE.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":3598},"packages/plugins/experimental/plugin-script/dist/lib/node/chunk-SLV3SDZE.cjs":{"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}}}
|
|
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":14123,"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":18081,"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":7342,"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/types/script.ts":{"bytes":2909,"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/components/ScriptEditor.tsx":{"bytes":15542,"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"},{"path":"packages/plugins/experimental/plugin-script/src/types/index.ts","kind":"import-statement","original":"../types"}],"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/ScriptPlugin.tsx":{"bytes":19150,"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/node/edge/index.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"packages/plugins/experimental/plugin-script/dist/lib/node/edge/index.cjs":{"imports":[{"path":"packages/plugins/experimental/plugin-script/dist/lib/node/chunk-X6A3D4PD.cjs","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/node/index.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":21306},"packages/plugins/experimental/plugin-script/dist/lib/node/index.cjs":{"imports":[{"path":"packages/plugins/experimental/plugin-script/dist/lib/node/chunk-VW2POILW.cjs","kind":"import-statement"},{"path":"packages/plugins/experimental/plugin-script/dist/lib/node/chunk-4VMNBXWU.cjs","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/node/ScriptEditor-M7KZ2CRS.cjs","kind":"dynamic-import"},{"path":"packages/plugins/experimental/plugin-script/dist/lib/node/TypescriptEditor-OTWJUIWB.cjs","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","FunctionType","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":5058},"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":12494},"packages/plugins/experimental/plugin-script/dist/lib/node/meta.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"packages/plugins/experimental/plugin-script/dist/lib/node/meta.cjs":{"imports":[{"path":"packages/plugins/experimental/plugin-script/dist/lib/node/chunk-4VMNBXWU.cjs","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/node/types/index.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"packages/plugins/experimental/plugin-script/dist/lib/node/types/index.cjs":{"imports":[{"path":"packages/plugins/experimental/plugin-script/dist/lib/node/chunk-VW2POILW.cjs","kind":"import-statement"},{"path":"packages/plugins/experimental/plugin-script/dist/lib/node/chunk-4VMNBXWU.cjs","kind":"import-statement"}],"exports":["FunctionType","ScriptAction","ScriptType"],"entryPoint":"packages/plugins/experimental/plugin-script/src/types/index.ts","inputs":{},"bytes":210},"packages/plugins/experimental/plugin-script/dist/lib/node/TypescriptEditor-OTWJUIWB.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"packages/plugins/experimental/plugin-script/dist/lib/node/TypescriptEditor-OTWJUIWB.cjs":{"imports":[{"path":"packages/plugins/experimental/plugin-script/dist/lib/node/chunk-ITLHJMWP.cjs","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/node/ScriptEditor-M7KZ2CRS.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":17783},"packages/plugins/experimental/plugin-script/dist/lib/node/ScriptEditor-M7KZ2CRS.cjs":{"imports":[{"path":"packages/plugins/experimental/plugin-script/dist/lib/node/chunk-X6A3D4PD.cjs","kind":"import-statement"},{"path":"packages/plugins/experimental/plugin-script/dist/lib/node/chunk-VW2POILW.cjs","kind":"import-statement"},{"path":"packages/plugins/experimental/plugin-script/dist/lib/node/chunk-4VMNBXWU.cjs","kind":"import-statement"},{"path":"packages/plugins/experimental/plugin-script/dist/lib/node/chunk-ITLHJMWP.cjs","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":3929},"packages/plugins/experimental/plugin-script/src/components/Toolbar.tsx":{"bytesInOutput":5100}},"bytes":9692},"packages/plugins/experimental/plugin-script/dist/lib/node/chunk-X6A3D4PD.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":14620},"packages/plugins/experimental/plugin-script/dist/lib/node/chunk-X6A3D4PD.cjs":{"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":3324},"packages/plugins/experimental/plugin-script/src/edge/hub-protocol.ts":{"bytesInOutput":425}},"bytes":6731},"packages/plugins/experimental/plugin-script/dist/lib/node/chunk-VW2POILW.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":2276},"packages/plugins/experimental/plugin-script/dist/lib/node/chunk-VW2POILW.cjs":{"imports":[{"path":"packages/plugins/experimental/plugin-script/dist/lib/node/chunk-4VMNBXWU.cjs","kind":"import-statement"},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/plugin-markdown/types","kind":"import-statement","external":true}],"exports":["FunctionType","ScriptAction","ScriptType"],"inputs":{"packages/plugins/experimental/plugin-script/src/types/script.ts":{"bytesInOutput":673},"packages/plugins/experimental/plugin-script/src/types/index.ts":{"bytesInOutput":0},"packages/plugins/experimental/plugin-script/src/types/types.tsx":{"bytesInOutput":167}},"bytes":1134},"packages/plugins/experimental/plugin-script/dist/lib/node/chunk-4VMNBXWU.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":961},"packages/plugins/experimental/plugin-script/dist/lib/node/chunk-4VMNBXWU.cjs":{"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/node/chunk-ITLHJMWP.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":3777},"packages/plugins/experimental/plugin-script/dist/lib/node/chunk-ITLHJMWP.cjs":{"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":1776}},"bytes":1963}}}
|
|
@@ -18,14 +18,16 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
18
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
19
|
var types_exports = {};
|
|
20
20
|
__export(types_exports, {
|
|
21
|
-
|
|
22
|
-
|
|
21
|
+
FunctionType: () => import_chunk_VW2POILW.FunctionType,
|
|
22
|
+
ScriptAction: () => import_chunk_VW2POILW.ScriptAction,
|
|
23
|
+
ScriptType: () => import_chunk_VW2POILW.ScriptType
|
|
23
24
|
});
|
|
24
25
|
module.exports = __toCommonJS(types_exports);
|
|
25
|
-
var
|
|
26
|
+
var import_chunk_VW2POILW = require("../chunk-VW2POILW.cjs");
|
|
26
27
|
var import_chunk_4VMNBXWU = require("../chunk-4VMNBXWU.cjs");
|
|
27
28
|
// Annotate the CommonJS export names for ESM import in node:
|
|
28
29
|
0 && (module.exports = {
|
|
30
|
+
FunctionType,
|
|
29
31
|
ScriptAction,
|
|
30
32
|
ScriptType
|
|
31
33
|
});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["index.cjs"],
|
|
4
|
-
"sourcesContent": ["import {\n ScriptAction,\n ScriptType\n} from \"../chunk-
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,
|
|
4
|
+
"sourcesContent": ["import {\n FunctionType,\n ScriptAction,\n ScriptType\n} from \"../chunk-VW2POILW.cjs\";\nimport \"../chunk-4VMNBXWU.cjs\";\nexport {\n FunctionType,\n ScriptAction,\n ScriptType\n};\n//# sourceMappingURL=index.cjs.map\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,4BAIO;AACP,4BAAO;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ScriptEditor.d.ts","sourceRoot":"","sources":["../../../../src/components/ScriptEditor.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAyC,MAAM,OAAO,CAAC;AAmB9D,OAAO,
|
|
1
|
+
{"version":3,"file":"ScriptEditor.d.ts","sourceRoot":"","sources":["../../../../src/components/ScriptEditor.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAyC,MAAM,OAAO,CAAC;AAmB9D,OAAO,EAAgB,KAAK,UAAU,EAAE,MAAM,UAAU,CAAC;AAEzD,MAAM,MAAM,iBAAiB,GAAG;IAC9B,MAAM,EAAE,UAAU,CAAC;IACnB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,eAAO,MAAM,YAAY,qBAAsB,iBAAiB,sBA+F/D,CAAC;AAEF,eAAe,YAAY,CAAC"}
|
|
@@ -7,5 +7,5 @@ export type ToolbarProps = {
|
|
|
7
7
|
functionUrl?: string;
|
|
8
8
|
error?: string;
|
|
9
9
|
};
|
|
10
|
-
export declare const Toolbar: ({ binding, onBindingChange, deployed, onDeploy, functionUrl, error }: ToolbarProps) => React.JSX.Element;
|
|
10
|
+
export declare const Toolbar: ({ binding: _binding, onBindingChange, deployed, onDeploy, functionUrl, error, }: ToolbarProps) => React.JSX.Element;
|
|
11
11
|
//# sourceMappingURL=Toolbar.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Toolbar.d.ts","sourceRoot":"","sources":["../../../../src/components/Toolbar.tsx"],"names":[],"mappings":"AAKA,OAAO,
|
|
1
|
+
{"version":3,"file":"Toolbar.d.ts","sourceRoot":"","sources":["../../../../src/components/Toolbar.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAsC,MAAM,OAAO,CAAC;AAe3D,MAAM,MAAM,YAAY,GAAG;IACzB,OAAO,EAAE,MAAM,CAAC;IAChB,eAAe,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IAC3C,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IAC/B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,eAAO,MAAM,OAAO,oFAOjB,YAAY,sBAkJd,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import '@dxosTheme';
|
|
2
2
|
declare const _default: {
|
|
3
3
|
title: string;
|
|
4
|
-
component: ({ binding, onBindingChange, deployed, onDeploy, functionUrl, error }: import("./Toolbar").ToolbarProps) => import("react").JSX.Element;
|
|
4
|
+
component: ({ binding: _binding, onBindingChange, deployed, onDeploy, functionUrl, error, }: import("./Toolbar").ToolbarProps) => import("react").JSX.Element;
|
|
5
5
|
parameters: {
|
|
6
6
|
layout: string;
|
|
7
7
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TypescriptEditor.d.ts","sourceRoot":"","sources":["../../../../src/components/TypescriptEditor.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,
|
|
1
|
+
{"version":3,"file":"TypescriptEditor.d.ts","sourceRoot":"","sources":["../../../../src/components/TypescriptEditor.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,EAQL,KAAK,kBAAkB,EACxB,MAAM,uBAAuB,CAAC;AAG/B,MAAM,MAAM,qBAAqB,GAAG;IAClC,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB,GAAG,IAAI,CAAC,kBAAkB,EAAE,cAAc,GAAG,YAAY,GAAG,UAAU,GAAG,WAAW,CAAC,CAAC;AAEvF,eAAO,MAAM,gBAAgB,qFAQ1B,qBAAqB,sBA8BvB,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"functions.d.ts","sourceRoot":"","sources":["../../../../src/edge/functions.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,GAAG,EAAE,MAAM,eAAe,CAAC;AAGzC,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,cAAc,CAAC;AAC3C,OAAO,EAAE,KAAK,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAapD,MAAM,MAAM,wBAAwB,GAAG;IACrC,MAAM,EAAE,SAAS,GAAG,OAAO,CAAC;IAC5B,YAAY,CAAC,EAAE,MAAM,CAA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