@dxos/plugin-script 0.8.2-main.2f9c567 → 0.8.2-main.5885341
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/{DeploymentDialog-EMYG5BCD.mjs → DeploymentDialog-QEKJ54ZB.mjs} +4 -4
- package/dist/lib/browser/{ScriptContainer-YI4U25EM.mjs → ScriptContainer-ATBYTIFH.mjs} +5 -5
- package/dist/lib/browser/ScriptContainer-ATBYTIFH.mjs.map +7 -0
- package/dist/lib/browser/{artifact-definition-PD4UAAQZ.mjs → artifact-definition-OEDM2SCN.mjs} +35 -41
- package/dist/lib/browser/artifact-definition-OEDM2SCN.mjs.map +7 -0
- package/dist/lib/browser/{chunk-FIWZUPMO.mjs → chunk-EGDYE5MW.mjs} +4 -4
- package/dist/lib/browser/{chunk-FIWZUPMO.mjs.map → chunk-EGDYE5MW.mjs.map} +1 -1
- package/dist/lib/browser/{chunk-RIKHDIEO.mjs → chunk-OZEMT3NO.mjs} +2 -2
- package/dist/lib/browser/chunk-OZEMT3NO.mjs.map +7 -0
- package/dist/lib/browser/{chunk-4EA5VWVM.mjs → chunk-QNXJNXQZ.mjs} +6 -6
- package/dist/lib/browser/chunk-QNXJNXQZ.mjs.map +7 -0
- package/dist/lib/browser/{chunk-AA3MEHWR.mjs → chunk-SXS6PUU5.mjs} +4 -5
- package/dist/lib/browser/chunk-SXS6PUU5.mjs.map +7 -0
- package/dist/lib/browser/chunk-XEPVXV72.mjs +87 -0
- package/dist/lib/browser/chunk-XEPVXV72.mjs.map +7 -0
- package/dist/lib/browser/chunk-ZFTDU4WS.mjs +41 -0
- package/dist/lib/browser/chunk-ZFTDU4WS.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +12 -12
- package/dist/lib/browser/index.mjs.map +3 -3
- package/dist/lib/browser/{intent-resolver-UCPY7F6I.mjs → intent-resolver-C5D6TNPC.mjs} +11 -11
- package/dist/lib/browser/intent-resolver-C5D6TNPC.mjs.map +7 -0
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/{react-surface-M76DWUVT.mjs → react-surface-XJCN7XXF.mjs} +8 -8
- package/dist/lib/browser/react-surface-XJCN7XXF.mjs.map +7 -0
- package/dist/lib/browser/{settings-EOKSUGB6.mjs → settings-NK4XVS2E.mjs} +2 -2
- package/dist/lib/browser/types.mjs +1 -1
- package/dist/lib/node/{DeploymentDialog-VWKE3X2Y.cjs → DeploymentDialog-NUKZNILK.cjs} +9 -9
- package/dist/lib/node/{DeploymentDialog-VWKE3X2Y.cjs.map → DeploymentDialog-NUKZNILK.cjs.map} +2 -2
- package/dist/lib/node/{ScriptContainer-2MIDQAOV.cjs → ScriptContainer-OHHMLPUE.cjs} +14 -14
- package/dist/lib/node/ScriptContainer-OHHMLPUE.cjs.map +7 -0
- package/dist/lib/node/{artifact-definition-C644EAYM.cjs → artifact-definition-SEGATFNH.cjs} +41 -47
- package/dist/lib/node/artifact-definition-SEGATFNH.cjs.map +7 -0
- package/dist/lib/node/chunk-4K23KEYT.cjs +91 -0
- package/dist/lib/node/chunk-4K23KEYT.cjs.map +7 -0
- package/dist/lib/node/{chunk-XT76CMHH.cjs → chunk-DSFCLQ5F.cjs} +9 -10
- package/dist/lib/node/chunk-DSFCLQ5F.cjs.map +7 -0
- package/dist/lib/node/{chunk-SXJGHLK6.cjs → chunk-PGEGRJP3.cjs} +17 -16
- package/dist/lib/node/chunk-PGEGRJP3.cjs.map +7 -0
- package/dist/lib/node/{chunk-NBOJUJSM.cjs → chunk-PMGWL64F.cjs} +6 -6
- package/dist/lib/node/chunk-PMGWL64F.cjs.map +7 -0
- package/dist/lib/node/{chunk-FVCSTJDX.cjs → chunk-UUGLBCMY.cjs} +14 -14
- package/dist/lib/node/chunk-UUGLBCMY.cjs.map +7 -0
- package/dist/lib/node/{chunk-I4U27VO6.cjs → chunk-ZZ4HK5KM.cjs} +11 -11
- package/dist/lib/node/chunk-ZZ4HK5KM.cjs.map +7 -0
- package/dist/lib/node/index.cjs +24 -24
- package/dist/lib/node/index.cjs.map +3 -3
- package/dist/lib/node/{intent-resolver-IO3FBKP2.cjs → intent-resolver-BQPBRVHM.cjs} +20 -20
- package/dist/lib/node/intent-resolver-BQPBRVHM.cjs.map +7 -0
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node/{react-surface-AIHO75E7.cjs → react-surface-5XHS5WYW.cjs} +26 -26
- package/dist/lib/node/react-surface-5XHS5WYW.cjs.map +7 -0
- package/dist/lib/node/{settings-425QHVGC.cjs → settings-7PVJBWC4.cjs} +7 -7
- package/dist/lib/node/types.cjs +3 -3
- package/dist/lib/node/types.cjs.map +1 -1
- package/dist/lib/node-esm/{DeploymentDialog-FGFA6MG2.mjs → DeploymentDialog-BIXZ5Q57.mjs} +4 -4
- package/dist/lib/node-esm/{ScriptContainer-GYTXNQMB.mjs → ScriptContainer-4YWGWPY7.mjs} +5 -5
- package/dist/lib/node-esm/ScriptContainer-4YWGWPY7.mjs.map +7 -0
- package/dist/lib/node-esm/{artifact-definition-J6UM6BQF.mjs → artifact-definition-5UHIXXHW.mjs} +35 -41
- package/dist/lib/node-esm/artifact-definition-5UHIXXHW.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-OSDNCSBE.mjs → chunk-4ISQLIIH.mjs} +6 -6
- package/dist/lib/node-esm/chunk-4ISQLIIH.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-NERLX6GG.mjs → chunk-GR4VTXVM.mjs} +2 -2
- package/dist/lib/node-esm/chunk-GR4VTXVM.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-VMQPOPKV.mjs → chunk-KGYTIL33.mjs} +13 -12
- package/dist/lib/node-esm/chunk-KGYTIL33.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-3FAUXSL4.mjs → chunk-NNQXJQBG.mjs} +4 -4
- package/dist/lib/node-esm/{chunk-3FAUXSL4.mjs.map → chunk-NNQXJQBG.mjs.map} +1 -1
- package/dist/lib/node-esm/{chunk-X27CHZ64.mjs → chunk-TN35DSTF.mjs} +4 -5
- package/dist/lib/node-esm/chunk-TN35DSTF.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-X64SI6XO.mjs +89 -0
- package/dist/lib/node-esm/chunk-X64SI6XO.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +12 -12
- package/dist/lib/node-esm/index.mjs.map +3 -3
- package/dist/lib/node-esm/{intent-resolver-W3MJ427G.mjs → intent-resolver-PPJKPHUQ.mjs} +11 -11
- package/dist/lib/node-esm/intent-resolver-PPJKPHUQ.mjs.map +7 -0
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/{react-surface-IAUELUG6.mjs → react-surface-7ELFL7IO.mjs} +8 -8
- package/dist/lib/node-esm/react-surface-7ELFL7IO.mjs.map +7 -0
- package/dist/lib/node-esm/{settings-BWSKKIVQ.mjs → settings-SJYC4JLT.mjs} +2 -2
- package/dist/lib/node-esm/types.mjs +1 -1
- package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -1
- package/dist/types/src/capabilities/artifact-definition.d.ts.map +1 -1
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/components/DeploymentDialog/DeploymentDialog.d.ts +2 -2
- package/dist/types/src/components/DeploymentDialog/DeploymentDialog.d.ts.map +1 -1
- package/dist/types/src/components/ScriptContainer.d.ts +1 -1
- package/dist/types/src/components/ScriptContainer.d.ts.map +1 -1
- package/dist/types/src/components/ScriptToolbar/ScriptToolbar.d.ts +1 -1
- package/dist/types/src/components/ScriptToolbar/ScriptToolbar.d.ts.map +1 -1
- package/dist/types/src/components/Settings/ScriptObjectSettings.d.ts +1 -1
- package/dist/types/src/components/Settings/ScriptObjectSettings.d.ts.map +1 -1
- package/dist/types/src/components/index.d.ts +1 -1
- package/dist/types/src/hooks/deploy.d.ts +3 -4
- package/dist/types/src/hooks/deploy.d.ts.map +1 -1
- package/dist/types/src/hooks/format.d.ts +1 -1
- package/dist/types/src/hooks/format.d.ts.map +1 -1
- package/dist/types/src/hooks/template.d.ts +1 -1
- package/dist/types/src/hooks/template.d.ts.map +1 -1
- package/dist/types/src/hooks/useToolbarAction.d.ts +1 -1
- package/dist/types/src/hooks/useToolbarAction.d.ts.map +1 -1
- package/dist/types/src/templates/chess.d.ts.map +1 -1
- package/dist/types/src/templates/data-generator.d.ts.map +1 -1
- package/dist/types/src/templates/discord.d.ts.map +1 -1
- package/dist/types/src/templates/forex-effect.d.ts.map +1 -1
- package/dist/types/src/templates/forex.d.ts.map +1 -1
- package/dist/types/src/templates/gmail.d.ts.map +1 -1
- package/dist/types/src/types.d.ts +25 -26
- package/dist/types/src/types.d.ts.map +1 -1
- package/dist/types/src/util/deploy.d.ts.map +1 -1
- package/package.json +49 -51
- package/src/ScriptPlugin.tsx +3 -3
- package/src/capabilities/artifact-definition.ts +30 -33
- package/src/capabilities/intent-resolver.ts +5 -5
- package/src/capabilities/react-surface.tsx +3 -3
- package/src/components/DeploymentDialog/DeploymentDialog.tsx +2 -2
- package/src/components/ScriptContainer.tsx +1 -1
- package/src/components/ScriptToolbar/ScriptToolbar.tsx +1 -1
- package/src/components/Settings/ScriptObjectSettings.tsx +3 -3
- package/src/hooks/format.ts +1 -1
- package/src/hooks/template.ts +1 -1
- package/src/hooks/useToolbarAction.ts +1 -1
- package/src/templates/chess.ts +6 -7
- package/src/templates/data-generator.ts +5 -6
- package/src/templates/discord.ts +16 -24
- package/src/templates/forex-effect.ts +5 -6
- package/src/templates/forex.ts +4 -5
- package/src/templates/gmail.ts +82 -96
- package/src/translations.ts +1 -1
- package/src/types.ts +14 -13
- package/src/util/deploy.ts +2 -1
- package/dist/lib/browser/ScriptContainer-YI4U25EM.mjs.map +0 -7
- package/dist/lib/browser/artifact-definition-PD4UAAQZ.mjs.map +0 -7
- package/dist/lib/browser/chunk-4EA5VWVM.mjs.map +0 -7
- package/dist/lib/browser/chunk-6MLJJI73.mjs +0 -40
- package/dist/lib/browser/chunk-6MLJJI73.mjs.map +0 -7
- package/dist/lib/browser/chunk-AA3MEHWR.mjs.map +0 -7
- package/dist/lib/browser/chunk-AIO76GTZ.mjs +0 -87
- package/dist/lib/browser/chunk-AIO76GTZ.mjs.map +0 -7
- package/dist/lib/browser/chunk-RIKHDIEO.mjs.map +0 -7
- package/dist/lib/browser/intent-resolver-UCPY7F6I.mjs.map +0 -7
- package/dist/lib/browser/react-surface-M76DWUVT.mjs.map +0 -7
- package/dist/lib/node/ScriptContainer-2MIDQAOV.cjs.map +0 -7
- package/dist/lib/node/artifact-definition-C644EAYM.cjs.map +0 -7
- package/dist/lib/node/chunk-BWBZ22HH.cjs +0 -91
- package/dist/lib/node/chunk-BWBZ22HH.cjs.map +0 -7
- package/dist/lib/node/chunk-FVCSTJDX.cjs.map +0 -7
- package/dist/lib/node/chunk-I4U27VO6.cjs.map +0 -7
- package/dist/lib/node/chunk-NBOJUJSM.cjs.map +0 -7
- package/dist/lib/node/chunk-SXJGHLK6.cjs.map +0 -7
- package/dist/lib/node/chunk-XT76CMHH.cjs.map +0 -7
- package/dist/lib/node/intent-resolver-IO3FBKP2.cjs.map +0 -7
- package/dist/lib/node/react-surface-AIHO75E7.cjs.map +0 -7
- package/dist/lib/node-esm/ScriptContainer-GYTXNQMB.mjs.map +0 -7
- package/dist/lib/node-esm/artifact-definition-J6UM6BQF.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-NERLX6GG.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-NMMN5ZIG.mjs +0 -89
- package/dist/lib/node-esm/chunk-NMMN5ZIG.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-OSDNCSBE.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-VMQPOPKV.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-X27CHZ64.mjs.map +0 -7
- package/dist/lib/node-esm/intent-resolver-W3MJ427G.mjs.map +0 -7
- package/dist/lib/node-esm/react-surface-IAUELUG6.mjs.map +0 -7
- /package/dist/lib/browser/{DeploymentDialog-EMYG5BCD.mjs.map → DeploymentDialog-QEKJ54ZB.mjs.map} +0 -0
- /package/dist/lib/browser/{settings-EOKSUGB6.mjs.map → settings-NK4XVS2E.mjs.map} +0 -0
- /package/dist/lib/node/{settings-425QHVGC.cjs.map → settings-7PVJBWC4.cjs.map} +0 -0
- /package/dist/lib/node-esm/{DeploymentDialog-FGFA6MG2.mjs.map → DeploymentDialog-BIXZ5Q57.mjs.map} +0 -0
- /package/dist/lib/node-esm/{settings-BWSKKIVQ.mjs.map → settings-SJYC4JLT.mjs.map} +0 -0
package/src/templates/chess.ts
CHANGED
|
@@ -2,26 +2,25 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import { Schema } from 'effect';
|
|
6
5
|
// @ts-ignore
|
|
7
|
-
import { defineFunction } from 'dxos:functions';
|
|
6
|
+
import { defineFunction, S } from 'dxos:functions';
|
|
8
7
|
// @ts-ignore
|
|
9
8
|
import { Chess } from 'https://esm.sh/chess.js@0.13.1';
|
|
10
9
|
|
|
11
10
|
export default defineFunction({
|
|
12
11
|
description: 'Plays a random move in a chess game.',
|
|
13
12
|
|
|
14
|
-
inputSchema:
|
|
15
|
-
changedObjectId:
|
|
13
|
+
inputSchema: S.Struct({
|
|
14
|
+
changedObjectId: S.String.annotations({
|
|
16
15
|
description: 'The objects to play the game on.',
|
|
17
16
|
}),
|
|
18
|
-
player:
|
|
17
|
+
player: S.optional(S.Literal('w', 'b')).annotations({
|
|
19
18
|
description: 'The player to play the game as.',
|
|
20
19
|
}),
|
|
21
20
|
}),
|
|
22
21
|
|
|
23
|
-
outputSchema:
|
|
24
|
-
state:
|
|
22
|
+
outputSchema: S.Struct({
|
|
23
|
+
state: S.String.annotations({
|
|
25
24
|
description: 'The state of the game as an ASCII art board.',
|
|
26
25
|
}),
|
|
27
26
|
}),
|
|
@@ -2,20 +2,19 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import { Schema } from 'effect';
|
|
6
5
|
// @ts-ignore
|
|
7
6
|
import { defineFunction, S, create, Expando } from 'dxos:functions';
|
|
8
7
|
// @ts-ignore
|
|
9
8
|
import { randText } from 'https://esm.sh/@ngneat/falso@7.1.1';
|
|
10
9
|
|
|
11
10
|
export default defineFunction({
|
|
12
|
-
inputSchema:
|
|
13
|
-
documentAmount:
|
|
14
|
-
textSize:
|
|
15
|
-
mutationAmount:
|
|
11
|
+
inputSchema: S.Struct({
|
|
12
|
+
documentAmount: S.optional(S.Number),
|
|
13
|
+
textSize: S.optional(S.Number),
|
|
14
|
+
mutationAmount: S.optional(S.Number),
|
|
16
15
|
}),
|
|
17
16
|
|
|
18
|
-
outputSchema:
|
|
17
|
+
outputSchema: S.Struct({}),
|
|
19
18
|
|
|
20
19
|
handler: async ({
|
|
21
20
|
event: {
|
package/src/templates/discord.ts
CHANGED
|
@@ -2,9 +2,8 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import { Schema } from 'effect';
|
|
6
5
|
// @ts-ignore
|
|
7
|
-
import { create, defineFunction, DXN, Filter, ObjectId, S } from 'dxos:functions';
|
|
6
|
+
import { create, EchoObject, defineFunction, DXN, Filter, ObjectId, S } from 'dxos:functions';
|
|
8
7
|
import {
|
|
9
8
|
FetchHttpClient,
|
|
10
9
|
// @ts-ignore
|
|
@@ -14,20 +13,13 @@ import { DiscordConfig, DiscordREST, DiscordRESTMemoryLive } from 'https://esm.s
|
|
|
14
13
|
// @ts-ignore
|
|
15
14
|
import { Effect, Config, Redacted, Ref } from 'https://esm.sh/effect@3.13.3';
|
|
16
15
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
content: Schema.String,
|
|
25
|
-
}).pipe(
|
|
26
|
-
Type.def({
|
|
27
|
-
typename: 'example.com/type/Message',
|
|
28
|
-
version: '0.1.0',
|
|
29
|
-
}),
|
|
30
|
-
);
|
|
16
|
+
const MessageSchema = S.Struct({
|
|
17
|
+
id: S.String,
|
|
18
|
+
foreignId: S.Any, // bigint?
|
|
19
|
+
from: S.String,
|
|
20
|
+
created: S.String,
|
|
21
|
+
content: S.String,
|
|
22
|
+
}).pipe(EchoObject({ typename: 'example.com/type/Message', version: '0.1.0' }));
|
|
31
23
|
|
|
32
24
|
const DEFAULT_AFTER = 1704067200; // 2024-01-01
|
|
33
25
|
|
|
@@ -37,17 +29,17 @@ const generateSnowflake = (unixTimestamp: number): bigint => {
|
|
|
37
29
|
};
|
|
38
30
|
|
|
39
31
|
export default defineFunction({
|
|
40
|
-
inputSchema:
|
|
32
|
+
inputSchema: S.Struct({
|
|
41
33
|
// TODO(wittjosiah): Remove. This is used to provide a terminal for a cron trigger.
|
|
42
|
-
tick:
|
|
43
|
-
channelId:
|
|
44
|
-
after:
|
|
45
|
-
pageSize:
|
|
46
|
-
queueId:
|
|
34
|
+
tick: S.optional(S.String),
|
|
35
|
+
channelId: S.String,
|
|
36
|
+
after: S.optional(S.Number),
|
|
37
|
+
pageSize: S.optional(S.Number),
|
|
38
|
+
queueId: S.String,
|
|
47
39
|
}),
|
|
48
40
|
|
|
49
|
-
outputSchema:
|
|
50
|
-
newMessages:
|
|
41
|
+
outputSchema: S.Struct({
|
|
42
|
+
newMessages: S.Number,
|
|
51
43
|
}),
|
|
52
44
|
|
|
53
45
|
handler: ({
|
|
@@ -2,9 +2,8 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import { Schema } from 'effect';
|
|
6
5
|
// @ts-ignore
|
|
7
|
-
import { defineFunction } from 'dxos:functions';
|
|
6
|
+
import { defineFunction, S } from 'dxos:functions';
|
|
8
7
|
import {
|
|
9
8
|
HttpClient,
|
|
10
9
|
HttpClientRequest,
|
|
@@ -17,12 +16,12 @@ import { Effect, Schedule } from 'https://esm.sh/effect@3.13.3';
|
|
|
17
16
|
export default defineFunction({
|
|
18
17
|
description: 'Returns the exchange rate between two currencies.',
|
|
19
18
|
|
|
20
|
-
inputSchema:
|
|
21
|
-
from:
|
|
22
|
-
to:
|
|
19
|
+
inputSchema: S.Struct({
|
|
20
|
+
from: S.String.annotations({ description: 'The source currency' }),
|
|
21
|
+
to: S.String.annotations({ description: 'The target currency' }),
|
|
23
22
|
}),
|
|
24
23
|
|
|
25
|
-
outputSchema:
|
|
24
|
+
outputSchema: S.String.annotations({ description: 'The exchange rate between the two currencies' }),
|
|
26
25
|
|
|
27
26
|
handler: async ({
|
|
28
27
|
event: {
|
package/src/templates/forex.ts
CHANGED
|
@@ -2,16 +2,15 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import { Schema } from 'effect';
|
|
6
5
|
// @ts-ignore
|
|
7
|
-
import { defineFunction } from 'dxos:functions';
|
|
6
|
+
import { defineFunction, S } from 'dxos:functions';
|
|
8
7
|
|
|
9
8
|
export default defineFunction({
|
|
10
9
|
description: 'Returns the exchange rate between two currencies.',
|
|
11
10
|
|
|
12
|
-
inputSchema:
|
|
13
|
-
from:
|
|
14
|
-
to:
|
|
11
|
+
inputSchema: S.Struct({
|
|
12
|
+
from: S.String.annotations({ description: 'The source currency' }),
|
|
13
|
+
to: S.String.annotations({ description: 'The target currency' }),
|
|
15
14
|
}),
|
|
16
15
|
|
|
17
16
|
handler: async ({
|
package/src/templates/gmail.ts
CHANGED
|
@@ -3,8 +3,7 @@
|
|
|
3
3
|
//
|
|
4
4
|
|
|
5
5
|
// @ts-ignore
|
|
6
|
-
import { create, defineFunction, Filter, ObjectId } from 'dxos:functions';
|
|
7
|
-
// @ts-ignore
|
|
6
|
+
import { create, defineFunction, EchoObject, Filter, ObjectId, S } from 'dxos:functions';
|
|
8
7
|
import {
|
|
9
8
|
HttpClient,
|
|
10
9
|
HttpClientRequest,
|
|
@@ -12,33 +11,30 @@ import {
|
|
|
12
11
|
// @ts-ignore
|
|
13
12
|
} from 'https://esm.sh/@effect/platform@0.77.2?deps=effect@3.13.3';
|
|
14
13
|
// @ts-ignore
|
|
15
|
-
import {
|
|
16
|
-
// @ts-ignore
|
|
17
|
-
import { pipe, Chunk, Effect, Ref, Schedule, Schema, Stream } from 'https://esm.sh/effect@3.13.3';
|
|
14
|
+
import { pipe, Chunk, Effect, Ref, Schedule, Stream } from 'https://esm.sh/effect@3.13.3';
|
|
18
15
|
|
|
19
|
-
|
|
16
|
+
// TODO(ZaymonFC): Calculate this dynamically and expose a parameter.
|
|
17
|
+
const DEFAULT_AFTER = '2025-01-01';
|
|
20
18
|
|
|
21
19
|
export default defineFunction({
|
|
22
|
-
inputSchema:
|
|
23
|
-
mailboxId: Schema.String,
|
|
24
|
-
userId: Schema.optional(Schema.String).pipe(Schema.withDecodingDefault(() => 'me')),
|
|
25
|
-
after: Schema.optional(Schema.Union(Schema.Number, Schema.String)).pipe(
|
|
26
|
-
Schema.withDecodingDefault(() => format(subDays(new Date(), 30), 'yyyy-MM-dd')),
|
|
27
|
-
),
|
|
28
|
-
pageSize: Schema.optional(Schema.Number).pipe(Schema.withDecodingDefault(() => 100)),
|
|
20
|
+
inputSchema: S.Struct({
|
|
29
21
|
// TODO(wittjosiah): Remove. This is used to provide a terminal for a cron trigger.
|
|
30
|
-
tick:
|
|
22
|
+
tick: S.optional(S.String),
|
|
23
|
+
userId: S.optional(S.String),
|
|
24
|
+
after: S.optional(S.Union(S.Number, S.String)),
|
|
25
|
+
pageSize: S.optional(S.Number),
|
|
26
|
+
mailboxId: S.String,
|
|
31
27
|
}),
|
|
32
28
|
|
|
33
|
-
outputSchema:
|
|
34
|
-
newMessages:
|
|
29
|
+
outputSchema: S.Struct({
|
|
30
|
+
newMessages: S.Number,
|
|
35
31
|
}),
|
|
36
32
|
|
|
37
33
|
handler: ({
|
|
38
|
-
context: { space },
|
|
39
34
|
event: {
|
|
40
|
-
data: { mailboxId, userId, after, pageSize },
|
|
35
|
+
data: { mailboxId, userId = 'me', after = DEFAULT_AFTER, pageSize = 100 },
|
|
41
36
|
},
|
|
37
|
+
context: { space },
|
|
42
38
|
}: any) =>
|
|
43
39
|
Effect.gen(function* () {
|
|
44
40
|
const { token } = yield* Effect.tryPromise({
|
|
@@ -46,10 +42,9 @@ export default defineFunction({
|
|
|
46
42
|
catch: (e: any) => e,
|
|
47
43
|
});
|
|
48
44
|
|
|
49
|
-
|
|
50
|
-
const makeRequest = (url: string) =>
|
|
45
|
+
const makeRequest = (path: string) =>
|
|
51
46
|
pipe(
|
|
52
|
-
|
|
47
|
+
path,
|
|
53
48
|
HttpClientRequest.get,
|
|
54
49
|
HttpClientRequest.setHeaders({ Authorization: `Bearer ${token}`, Accept: 'application/json' }),
|
|
55
50
|
HttpClient.execute,
|
|
@@ -59,10 +54,13 @@ export default defineFunction({
|
|
|
59
54
|
Effect.scoped,
|
|
60
55
|
);
|
|
61
56
|
|
|
62
|
-
const listMessages = (userId: string, q: string, pageSize: number, pageToken: string | null) =>
|
|
63
|
-
|
|
57
|
+
const listMessages = (userId: string, q: string, pageSize: number, pageToken: string | null) => {
|
|
58
|
+
const url = `https://gmail.googleapis.com/gmail/v1/users/${userId}/messages?maxResults=${pageSize}&q=${q}`;
|
|
59
|
+
return makeRequest(pageToken ? `${url}&pageToken=${pageToken}` : url);
|
|
60
|
+
};
|
|
64
61
|
|
|
65
|
-
const getMessage = (userId: string,
|
|
62
|
+
const getMessage = (userId: string, id: string) =>
|
|
63
|
+
makeRequest(`https://gmail.googleapis.com/gmail/v1/users/${userId}/messages/${id}`);
|
|
66
64
|
|
|
67
65
|
const mailbox = yield* Effect.tryPromise({
|
|
68
66
|
try: () => space.db.query({ id: mailboxId }).first(),
|
|
@@ -139,14 +137,6 @@ export default defineFunction({
|
|
|
139
137
|
}).pipe(Effect.provide(FetchHttpClient.layer)),
|
|
140
138
|
});
|
|
141
139
|
|
|
142
|
-
const getUrl = (userId: string, messageId?: string, params?: Record<string, any>) => {
|
|
143
|
-
const api = new URL(
|
|
144
|
-
[`https://gmail.googleapis.com/gmail/v1/users/${userId}/messages`, messageId].filter(Boolean).join('/'),
|
|
145
|
-
);
|
|
146
|
-
Object.entries(params ?? {}).forEach(([key, value]) => api.searchParams.set(key, value));
|
|
147
|
-
return api.toString();
|
|
148
|
-
};
|
|
149
|
-
|
|
150
140
|
/**
|
|
151
141
|
* Parses an email string in the format "Name <email@example.com>" into separate name and email components.
|
|
152
142
|
*/
|
|
@@ -163,96 +153,92 @@ const parseEmailString = (emailString: string): { name?: string; email: string }
|
|
|
163
153
|
return undefined;
|
|
164
154
|
};
|
|
165
155
|
|
|
156
|
+
// TODO(wittjosiah): These schemas should be imported from @dxos/schema.
|
|
157
|
+
|
|
166
158
|
//
|
|
167
159
|
// Schemas
|
|
168
|
-
// TODO(wittjosiah): These schemas should be imported from @dxos/schema.
|
|
169
160
|
//
|
|
170
161
|
|
|
171
162
|
const ActorRoles = ['user', 'assistant'] as const;
|
|
172
|
-
const ActorRole =
|
|
173
|
-
type ActorRole =
|
|
174
|
-
|
|
175
|
-
const ActorSchema =
|
|
176
|
-
identityKey:
|
|
177
|
-
email:
|
|
178
|
-
name:
|
|
179
|
-
role:
|
|
163
|
+
const ActorRole = S.Literal(...ActorRoles);
|
|
164
|
+
type ActorRole = S.Schema.Type<typeof ActorRole>;
|
|
165
|
+
|
|
166
|
+
const ActorSchema = S.Struct({
|
|
167
|
+
identityKey: S.optional(S.String),
|
|
168
|
+
email: S.optional(S.String),
|
|
169
|
+
name: S.optional(S.String),
|
|
170
|
+
role: S.optional(ActorRole),
|
|
180
171
|
});
|
|
181
172
|
|
|
182
|
-
const AbstractContentBlock =
|
|
183
|
-
pending:
|
|
173
|
+
const AbstractContentBlock = S.Struct({
|
|
174
|
+
pending: S.optional(S.Boolean),
|
|
184
175
|
});
|
|
185
|
-
type AbstractContentBlock =
|
|
186
|
-
const TextContentBlock =
|
|
176
|
+
type AbstractContentBlock = S.Schema.Type<typeof AbstractContentBlock>;
|
|
177
|
+
const TextContentBlock = S.extend(
|
|
187
178
|
AbstractContentBlock,
|
|
188
|
-
|
|
189
|
-
type:
|
|
190
|
-
disposition:
|
|
191
|
-
text:
|
|
179
|
+
S.Struct({
|
|
180
|
+
type: S.Literal('text'),
|
|
181
|
+
disposition: S.optional(S.String),
|
|
182
|
+
text: S.String,
|
|
192
183
|
}),
|
|
193
|
-
).pipe(
|
|
194
|
-
type TextContentBlock =
|
|
195
|
-
const JsonContentBlock =
|
|
184
|
+
).pipe(S.mutable);
|
|
185
|
+
type TextContentBlock = S.Schema.Type<typeof TextContentBlock>;
|
|
186
|
+
const JsonContentBlock = S.extend(
|
|
196
187
|
AbstractContentBlock,
|
|
197
|
-
|
|
198
|
-
type:
|
|
199
|
-
disposition:
|
|
200
|
-
data:
|
|
188
|
+
S.Struct({
|
|
189
|
+
type: S.Literal('json'),
|
|
190
|
+
disposition: S.optional(S.String),
|
|
191
|
+
data: S.String,
|
|
201
192
|
}),
|
|
202
|
-
).pipe(
|
|
203
|
-
type JsonContentBlock =
|
|
204
|
-
const Base64ImageSource =
|
|
205
|
-
type:
|
|
206
|
-
mediaType:
|
|
207
|
-
data:
|
|
208
|
-
}).pipe(
|
|
209
|
-
const HttpImageSource =
|
|
210
|
-
type:
|
|
211
|
-
url:
|
|
212
|
-
}).pipe(
|
|
213
|
-
const ImageSource =
|
|
214
|
-
type ImageSource =
|
|
215
|
-
const ImageContentBlock =
|
|
193
|
+
).pipe(S.mutable);
|
|
194
|
+
type JsonContentBlock = S.Schema.Type<typeof JsonContentBlock>;
|
|
195
|
+
const Base64ImageSource = S.Struct({
|
|
196
|
+
type: S.Literal('base64'),
|
|
197
|
+
mediaType: S.String,
|
|
198
|
+
data: S.String,
|
|
199
|
+
}).pipe(S.mutable);
|
|
200
|
+
const HttpImageSource = S.Struct({
|
|
201
|
+
type: S.Literal('http'),
|
|
202
|
+
url: S.String,
|
|
203
|
+
}).pipe(S.mutable);
|
|
204
|
+
const ImageSource = S.Union(Base64ImageSource, HttpImageSource);
|
|
205
|
+
type ImageSource = S.Schema.Type<typeof ImageSource>;
|
|
206
|
+
const ImageContentBlock = S.extend(
|
|
216
207
|
AbstractContentBlock,
|
|
217
|
-
|
|
218
|
-
type:
|
|
219
|
-
id:
|
|
220
|
-
source:
|
|
208
|
+
S.Struct({
|
|
209
|
+
type: S.Literal('image'),
|
|
210
|
+
id: S.optional(S.String),
|
|
211
|
+
source: S.optional(ImageSource),
|
|
221
212
|
}),
|
|
222
|
-
).pipe(
|
|
223
|
-
type ImageContentBlock =
|
|
224
|
-
const ReferenceContentBlock =
|
|
213
|
+
).pipe(S.mutable);
|
|
214
|
+
type ImageContentBlock = S.Schema.Type<typeof ImageContentBlock>;
|
|
215
|
+
const ReferenceContentBlock = S.extend(
|
|
225
216
|
AbstractContentBlock,
|
|
226
|
-
|
|
227
|
-
type:
|
|
228
|
-
reference:
|
|
217
|
+
S.Struct({
|
|
218
|
+
type: S.Literal('reference'),
|
|
219
|
+
reference: S.Any,
|
|
229
220
|
}),
|
|
230
|
-
).pipe(
|
|
231
|
-
type ReferenceContentBlock =
|
|
232
|
-
const MessageContentBlock =
|
|
221
|
+
).pipe(S.mutable);
|
|
222
|
+
type ReferenceContentBlock = S.Schema.Type<typeof ReferenceContentBlock>;
|
|
223
|
+
const MessageContentBlock = S.Union(TextContentBlock, JsonContentBlock, ImageContentBlock, ReferenceContentBlock);
|
|
233
224
|
|
|
234
|
-
const MessageType =
|
|
225
|
+
const MessageType = S.Struct({
|
|
235
226
|
id: ObjectId,
|
|
236
|
-
created:
|
|
227
|
+
created: S.String.annotations({
|
|
237
228
|
description: 'ISO date string when the message was sent.',
|
|
238
229
|
}),
|
|
239
230
|
sender: ActorSchema.annotations({
|
|
240
231
|
description: 'Identity of the message sender.',
|
|
241
232
|
}),
|
|
242
|
-
blocks:
|
|
233
|
+
blocks: S.Array(MessageContentBlock).annotations({
|
|
243
234
|
description: 'Contents of the message.',
|
|
244
235
|
}),
|
|
245
|
-
properties:
|
|
246
|
-
|
|
247
|
-
|
|
236
|
+
properties: S.optional(
|
|
237
|
+
S.mutable(
|
|
238
|
+
S.Record({ key: S.String, value: S.Any }).annotations({
|
|
248
239
|
description: 'Custom properties for specific message types (e.g. attention context, email subject, etc.).',
|
|
249
240
|
}),
|
|
250
241
|
),
|
|
251
242
|
),
|
|
252
|
-
}).pipe(
|
|
253
|
-
|
|
254
|
-
typename: 'dxos.org/type/Message',
|
|
255
|
-
version: '0.1.0',
|
|
256
|
-
}),
|
|
257
|
-
);
|
|
258
|
-
type MessageType = Schema.Schema.Type<typeof MessageType>;
|
|
243
|
+
}).pipe(EchoObject({ typename: 'dxos.org/type/Message', version: '0.1.0' }));
|
|
244
|
+
type MessageType = S.Schema.Type<typeof MessageType>;
|
package/src/translations.ts
CHANGED
package/src/types.ts
CHANGED
|
@@ -2,10 +2,11 @@
|
|
|
2
2
|
// Copyright 2023 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import {
|
|
5
|
+
import { TitleAnnotationId } from 'effect/SchemaAST';
|
|
6
6
|
|
|
7
7
|
import { SpaceSchema } from '@dxos/client/echo';
|
|
8
|
-
import {
|
|
8
|
+
import { S } from '@dxos/echo-schema';
|
|
9
|
+
import { ScriptType } from '@dxos/functions/types';
|
|
9
10
|
import { EditorInputMode } from '@dxos/react-ui-editor';
|
|
10
11
|
|
|
11
12
|
import { SCRIPT_PLUGIN } from './meta';
|
|
@@ -16,27 +17,27 @@ export { SCRIPT_PLUGIN };
|
|
|
16
17
|
export namespace ScriptAction {
|
|
17
18
|
const SCRIPT_ACTION = `${SCRIPT_PLUGIN}/action`;
|
|
18
19
|
|
|
19
|
-
export const CreateScriptSchema =
|
|
20
|
-
name:
|
|
20
|
+
export const CreateScriptSchema = S.Struct({
|
|
21
|
+
name: S.optional(S.String),
|
|
21
22
|
// TODO(wittjosiah): Placeholder annotation?
|
|
22
|
-
gistUrl:
|
|
23
|
-
initialTemplateId:
|
|
23
|
+
gistUrl: S.optional(S.String.annotations({ [TitleAnnotationId]: 'Import from Gist (url)' })),
|
|
24
|
+
initialTemplateId: S.optional(S.String),
|
|
24
25
|
});
|
|
25
26
|
|
|
26
|
-
export type CreateScriptProps =
|
|
27
|
+
export type CreateScriptProps = S.Schema.Type<typeof CreateScriptSchema>;
|
|
27
28
|
|
|
28
|
-
export class Create extends
|
|
29
|
-
input:
|
|
30
|
-
output:
|
|
29
|
+
export class Create extends S.TaggedClass<Create>()(`${SCRIPT_ACTION}/create`, {
|
|
30
|
+
input: S.extend(CreateScriptSchema, S.Struct({ space: SpaceSchema })),
|
|
31
|
+
output: S.Struct({
|
|
31
32
|
object: ScriptType,
|
|
32
33
|
}),
|
|
33
34
|
}) {}
|
|
34
35
|
}
|
|
35
36
|
|
|
36
|
-
export const ScriptSettingsSchema =
|
|
37
|
-
|
|
37
|
+
export const ScriptSettingsSchema = S.mutable(
|
|
38
|
+
S.Struct({
|
|
38
39
|
editorInputMode: EditorInputMode,
|
|
39
40
|
}),
|
|
40
41
|
);
|
|
41
42
|
|
|
42
|
-
export type ScriptSettingsProps =
|
|
43
|
+
export type ScriptSettingsProps = S.Schema.Type<typeof ScriptSettingsSchema>;
|
package/src/util/deploy.ts
CHANGED
|
@@ -7,11 +7,12 @@ import {
|
|
|
7
7
|
FunctionType,
|
|
8
8
|
type ScriptType,
|
|
9
9
|
getUserFunctionUrlInMetadata,
|
|
10
|
+
incrementSemverPatch,
|
|
10
11
|
makeFunctionUrl,
|
|
11
12
|
setUserFunctionUrlInMetadata,
|
|
13
|
+
uploadWorkerFunction,
|
|
12
14
|
} from '@dxos/functions';
|
|
13
15
|
import { Bundler } from '@dxos/functions/bundler';
|
|
14
|
-
import { incrementSemverPatch, uploadWorkerFunction } from '@dxos/functions/edge';
|
|
15
16
|
import { log } from '@dxos/log';
|
|
16
17
|
import { live, getMeta, makeRef, type Space } from '@dxos/react-client/echo';
|
|
17
18
|
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/components/ScriptContainer.tsx", "../../../src/components/ScriptToolbar/ScriptToolbar.tsx", "../../../src/components/TypescriptEditor/TypescriptEditor.tsx"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport React, { useMemo } from 'react';\n\nimport { type ScriptType } from '@dxos/functions';\nimport { createDocAccessor, getSpace } from '@dxos/react-client/echo';\nimport { useIdentity } from '@dxos/react-client/halo';\nimport { type ThemedClassName } from '@dxos/react-ui';\nimport { createDataExtensions, listener, stackItemContentEditorClassNames } from '@dxos/react-ui-editor';\nimport { StackItem } from '@dxos/react-ui-stack';\nimport { mx } from '@dxos/react-ui-theme';\n\nimport { ScriptToolbar } from './ScriptToolbar';\nimport { TypescriptEditor, type TypescriptEditorProps } from './TypescriptEditor';\nimport { useDeployState, useToolbarState } from '../hooks';\nimport { type ScriptSettingsProps } from '../types';\n\nexport type ScriptEditorProps = ThemedClassName<\n {\n role?: string;\n script: ScriptType;\n settings?: ScriptSettingsProps;\n } & Pick<TypescriptEditorProps, 'env'>\n>;\n\nexport const ScriptContainer = ({\n classNames,\n role,\n script,\n settings = { editorInputMode: 'vscode' },\n env,\n}: ScriptEditorProps) => {\n const identity = useIdentity();\n const space = getSpace(script);\n const state = useToolbarState();\n useDeployState({ state, script });\n\n const extensions = useMemo(\n () => [\n listener({\n onChange: (text) => {\n if (script.source.target && script.source.target.content !== text) {\n script.changed = true;\n }\n },\n }),\n createDataExtensions({\n id: script.id,\n text: script.source.target && createDocAccessor(script.source.target, ['content']),\n space,\n identity,\n }),\n ],\n [identity, space, script, script.source.target],\n );\n\n return (\n <StackItem.Content toolbar classNames='divide-y divide-separator'>\n <ScriptToolbar state={state} role={role} script={script} />\n <TypescriptEditor\n id={script.id}\n env={env}\n initialValue={script.source?.target?.content}\n extensions={extensions}\n className={mx(stackItemContentEditorClassNames(role))}\n inputMode={settings.editorInputMode}\n toolbar\n />\n </StackItem.Content>\n );\n};\n\nexport default ScriptContainer;\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport React, { useCallback } from 'react';\n\nimport { type ScriptType } from '@dxos/functions';\nimport { fullyQualifiedId } from '@dxos/react-client/echo';\nimport { ElevationProvider, type ThemedClassName } from '@dxos/react-ui';\nimport { stackItemContentToolbarClassNames } from '@dxos/react-ui-editor';\nimport { createGapSeparator, MenuProvider, ToolbarMenu, useMenuActions } from '@dxos/react-ui-menu';\n\nimport {\n type ScriptToolbarState,\n createDeploy,\n createFormat,\n createTemplateSelect,\n useToolbarAction,\n} from '../../hooks';\n\nexport type ScriptToolbarProps = ThemedClassName<{\n role?: string;\n script: ScriptType;\n state: ScriptToolbarState;\n}>;\n\nconst createToolbar = (state: ScriptToolbarState) => {\n const templateSelect = createTemplateSelect();\n const format = createFormat();\n const gap = createGapSeparator();\n const deploy = createDeploy(state);\n return {\n nodes: [...templateSelect.nodes, ...format.nodes, ...gap.nodes, ...deploy.nodes],\n edges: [...templateSelect.edges, ...format.edges, ...gap.edges, ...deploy.edges],\n };\n};\n\nexport const ScriptToolbar = ({ script, role, state, classNames }: ScriptToolbarProps) => {\n const handleAction = useToolbarAction({ state, script });\n const toolbarCreator = useCallback(() => createToolbar(state), [state]);\n const menu = useMenuActions(toolbarCreator);\n\n return (\n <div role='none' className={stackItemContentToolbarClassNames(role)}>\n <ElevationProvider elevation={role === 'section' ? 'positioned' : 'base'}>\n <MenuProvider {...menu} onAction={handleAction} attendableId={fullyQualifiedId(script)}>\n <ToolbarMenu classNames={classNames} />\n </MenuProvider>\n </ElevationProvider>\n </div>\n );\n};\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport { javascript } from '@codemirror/lang-javascript';\nimport { defaultHighlightStyle } from '@codemirror/language';\nimport { Prec } from '@codemirror/state';\nimport { oneDarkHighlightStyle } from '@codemirror/theme-one-dark';\nimport { keymap } from '@codemirror/view';\nimport { tags } from '@lezer/highlight';\nimport { type VirtualTypeScriptEnvironment } from '@typescript/vfs';\nimport { continueKeymap } from '@valtown/codemirror-continue';\nimport { tsSync, tsFacet, tsLinter, tsAutocomplete, tsHover, type HoverInfo } from '@valtown/codemirror-ts';\nimport React from 'react';\n\nimport { type ThemeMode, useThemeContext } from '@dxos/react-ui';\nimport {\n autocomplete,\n createBasicExtensions,\n createThemeExtensions,\n editorFullWidth,\n type EditorInputMode,\n editorMonospace,\n EditorView,\n folding,\n InputModeExtensions,\n useTextEditor,\n type UseTextEditorProps,\n} from '@dxos/react-ui-editor';\nimport { isNonNullable } from '@dxos/util';\n\nexport type TypescriptEditorProps = {\n id: string;\n inputMode?: EditorInputMode;\n env?: VirtualTypeScriptEnvironment;\n toolbar?: boolean;\n} & Pick<UseTextEditorProps, 'className' | 'initialValue' | 'extensions' | 'scrollTo' | 'selection'>;\n\nexport const TypescriptEditor = ({\n id,\n env,\n className,\n initialValue,\n extensions,\n scrollTo,\n selection,\n toolbar,\n inputMode = 'vscode',\n}: TypescriptEditorProps) => {\n const { themeMode } = useThemeContext();\n const { parentRef, focusAttributes } = useTextEditor(\n () => ({\n id,\n initialValue,\n extensions: [\n extensions,\n createBasicExtensions({\n highlightActiveLine: true,\n indentWithTab: true,\n lineNumbers: true,\n lineWrapping: false,\n scrollPastEnd: true,\n }),\n createThemeExtensions({\n themeMode,\n syntaxHighlighting: true,\n slots: {\n content: { className: editorFullWidth },\n },\n }),\n // NOTE: Not using default editor gutter because folding for code works best right beside text.\n EditorView.theme({\n '.cm-gutters': {\n // Match margin from content.\n marginTop: '16px',\n background: 'var(--dx-baseSurface)',\n },\n }),\n InputModeExtensions[inputMode],\n folding(),\n // Continues block comments when you hit Enter.\n Prec.high(keymap.of(continueKeymap)),\n // TODO(burdon): Factor out.\n [\n editorMonospace,\n javascript({ typescript: true }),\n // https://github.com/val-town/codemirror-ts\n autocomplete({ override: env ? [tsAutocomplete()] : [] }),\n env\n ? [\n tsFacet.of({ env, path: `/src/${id}.ts` }),\n tsSync(),\n tsLinter(),\n tsHover({ renderTooltip: createTooltipRenderer(themeMode) }),\n ]\n : [],\n ],\n ].filter(isNonNullable),\n selection,\n scrollTo,\n }),\n [id, extensions, themeMode, inputMode, selection, scrollTo],\n );\n\n return (\n <div ref={parentRef} data-toolbar={toolbar ? 'enabled' : 'disabled'} className={className} {...focusAttributes} />\n );\n};\n\nconst createTooltipRenderer = (themeMode: ThemeMode) => {\n const theme = themeMode === 'dark' ? oneDarkHighlightStyle : defaultHighlightStyle;\n\n const classFromKind = (_kind: string) => {\n // E.g., localName, methodName, parameterName, etc.\n const kind = _kind.endsWith('Name') ? 'name' : _kind;\n const validTag = kind in tags;\n if (!validTag) {\n return '';\n }\n\n const tag = tags[kind as keyof typeof tags];\n if (typeof tag === 'function') {\n return '';\n }\n\n return theme.style([tag]) ?? '';\n };\n\n return (info: HoverInfo) => {\n const div = document.createElement('div');\n div.className = 'p-1 rounded border border-separator bg-baseSurface xs:max-w-80 max-w-lg';\n\n if (info.quickInfo?.displayParts) {\n for (const part of info.quickInfo.displayParts) {\n const span = div.appendChild(document.createElement('span'));\n span.className = classFromKind(part.kind);\n span.innerText = part.text;\n }\n }\n\n return { dom: div };\n };\n};\n\nexport default TypescriptEditor;\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;AAIA,OAAOA,UAASC,eAAe;AAG/B,SAASC,mBAAmBC,gBAAgB;AAC5C,SAASC,mBAAmB;AAE5B,SAASC,sBAAsBC,UAAUC,wCAAwC;AACjF,SAASC,iBAAiB;AAC1B,SAASC,UAAU;;;ACRnB,OAAOC,SAASC,mBAAmB;AAGnC,SAASC,wBAAwB;AACjC,SAASC,yBAA+C;AACxD,SAASC,yCAAyC;AAClD,SAASC,oBAAoBC,cAAcC,aAAaC,sBAAsB;AAgB9E,IAAMC,gBAAgB,CAACC,UAAAA;AACrB,QAAMC,iBAAiBC,qBAAAA;AACvB,QAAMC,SAASC,aAAAA;AACf,QAAMC,MAAMC,mBAAAA;AACZ,QAAMC,SAASC,a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OAAOgB,QAAQC,QAAQC;IACrCP;IACAmB,WAAWC,GAAGC,iCAAiCjC,IAAAA,CAAAA;IAC/CkC,WAAWhC,SAASC;IACpBwB,SAAAA;;AAIR;AAEA,IAAA,0BAAe7B;",
|
|
6
|
-
"names": ["React", "useMemo", "createDocAccessor", "getSpace", "useIdentity", "createDataExtensions", "listener", "stackItemContentEditorClassNames", "StackItem", "mx", "React", "useCallback", "fullyQualifiedId", "ElevationProvider", "stackItemContentToolbarClassNames", "createGapSeparator", "MenuProvider", "ToolbarMenu", "useMenuActions", "createToolbar", "state", "templateSelect", "createTemplateSelect", "format", "createFormat", "gap", "createGapSeparator", "deploy", "createDeploy", "nodes", "edges", "ScriptToolbar", "script", "role", "classNames", "handleAction", "useToolbarAction", "toolbarCreator", "useCallback", "menu", "useMenuActions", "div", "className", "stackItemContentToolbarClassNames", "ElevationProvider", "elevation", "MenuProvider", "onAction", "attendableId", "fullyQualifiedId", "ToolbarMenu", "javascript", "defaultHighlightStyle", "Prec", "oneDarkHighlightStyle", "keymap", "tags", "continueKeymap", "tsSync", "tsFacet", "tsLinter", "tsAutocomplete", "tsHover", "React", "useThemeContext", "autocomplete", "createBasicExtensions", "createThemeExtensions", "editorFullWidth", "editorMonospace", "EditorView", "folding", "InputModeExtensions", "useTextEditor", "isNonNullable", "TypescriptEditor", "id", "env", "className", "initialValue", "extensions", "scrollTo", "selection", "toolbar", "inputMode", "themeMode", "useThemeContext", "parentRef", "focusAttributes", "useTextEditor", "createBasicExtensions", "highlightActiveLine", "indentWithTab", "lineNumbers", "lineWrapping", "scrollPastEnd", "createThemeExtensions", "syntaxHighlighting", "slots", "content", "editorFullWidth", "EditorView", "theme", "marginTop", "background", "InputModeExtensions", "folding", "Prec", "high", "keymap", "of", "continueKeymap", "editorMonospace", "javascript", "typescript", "autocomplete", "override", "tsAutocomplete", "tsFacet", "path", "tsSync", "tsLinter", "tsHover", "renderTooltip", "createTooltipRenderer", "filter", "isNonNullable", "React", "div", "ref", "data-toolbar", "oneDarkHighlightStyle", "defaultHighlightStyle", "classFromKind", "_kind", "kind", "endsWith", "validTag", "tags", "tag", "style", "info", "document", "createElement", "quickInfo", "displayParts", "part", "span", "appendChild", "innerText", "text", "dom", "ScriptContainer", "classNames", "role", "script", "settings", "editorInputMode", "env", "identity", "useIdentity", "space", "getSpace", "state", "useToolbarState", "useDeployState", "extensions", "useMemo", "listener", "onChange", "text", "source", "target", "content", "changed", "createDataExtensions", "id", "createDocAccessor", "React", "StackItem", "Content", "toolbar", "ScriptToolbar", "TypescriptEditor", "initialValue", "className", "mx", "stackItemContentEditorClassNames", "inputMode"]
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/capabilities/artifact-definition.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { Schema } from 'effect';\n\nimport { Capabilities, contributes, createIntent, type PromiseIntentDispatcher } from '@dxos/app-framework';\nimport { defineArtifact, defineTool, ToolResult } from '@dxos/artifact';\nimport { createArtifactElement } from '@dxos/assistant';\nimport { ScriptType } from '@dxos/functions';\nimport { invariant } from '@dxos/invariant';\nimport { SpaceAction } from '@dxos/plugin-space/types';\nimport { live, makeRef, type Space } from '@dxos/react-client/echo';\nimport { DataType } from '@dxos/schema';\n\nimport { meta } from '../meta';\n// TODO(burdon): Factor out.\ndeclare global {\n interface ToolContextExtensions {\n space?: Space;\n dispatch?: PromiseIntentDispatcher;\n }\n}\n\nexport default () => {\n const definition = defineArtifact({\n id: `artifact:${meta.id}`,\n name: meta.name,\n // TODO(dmaretskyi): Since writing scripts requires a lot of domain knowledge,\n // we should offload the work of synthesizing the code to a separate model.\n // The main reasoning model will give it a concrete task and the script model will synthesize the code, knowing all the docs.\n instructions: `\n If the user explicitly requests you to write a script, you can create one.\n If the user requests you to change one of the existing script, you can update it.\n You must not create a script unless the user explicitly requests it.\n Scripts are short code pieces of executable code that can be used to perform computations, integrate with external systems, and perform automated tasks.\n Each script must follow as strict shape for the definition but the body can contain any valid executable code.\n Scripts are written in JavaScript or TypeScript.\n Each script must define an input schema and output schema.\n Each script must have its own detailed description.\n\n Important: You cannot execute scripts. Scripts are only available as tools after the user deploys them. You must only call the available tools.\n\n Description:\n The description is a detailed description of the script.\n It is used to describe the script's purpose, input, and output.\n The description is used to generate the script's documentation.\n The description is also goes into the script metadata.\n The description is used by AI to understand the script and its purpose.\n The description must provide cases on when the script should be used.\n\n Schema: \n The schema is defined using a schema-DSL library called Effect Schema.\n The input schema describes the arguments that the script accepts.\n The output schema describes the result that the script produces.\n The schema is used to validate the script's input and output.\n The schema is also goes into the script metadata.\n The properties in the schema must have valid descriptions.\n The input and output schemas must both be a struct of fields.\n\n Restricts:\n The scripts can only import code from \"dxos:functions\" module. No other modules are allowed.\n Some web APIs are available - like fetch.\n\n Reasoning:\n Before writing a script, synthesize the following information:\n - Description\n - What APIs will be used.\n - Detailed input schema\n - Detailed output schema\n\n <apis>\n export function defineFunction(params: { \n description: string, \n inputSchema: Schema.Schema, \n outputSchema: Schema.Schema, \n handler: (params: { event: { data: TInput } }) => Promise<TOutput> \n }): FunctionDefinition\n /**\n * Effect Schema\n */\n export const Schema; \n\n // Examples: \n\n Schema.String\n Schema.Number\n Schema.Boolean\n Schema.Struct({\n from: Schema.String.annotations({ description: 'The source currency' }),\n to: Schema.String.annotations({ description: 'The target currency' }),\n })\n Schema.Array(Schema.String)\n Schema.Union(Schema.String, Schema.Number)\n Schema.optional(Schema.String)\n Schema.String.annotations({ description: 'The source currency' })\n </apis>\n\n <handler_function>\n Async function that takes the argument in the form of:\n\n type HandlerFunctionParam = {\n event: {\n data: T // The input schema\n },\n }\n\n The function must return the result that matches the output schema.\n </handler_function>\n \n <example>\n import { defineFunction, S } from 'dxos:functions';\n\n export default defineFunction({\n description: 'Returns the exchange rate between two currencies.',\n\n inputSchema: Schema.Struct({\n from: Schema.String.annotations({ description: 'The source currency' }),\n to: Schema.String.annotations({ description: 'The target currency' }),\n }),\n\n outputSchema: Schema.Struct({\n rate: Schema.String.annotations({ description: 'The exchange rate' }),\n }),\n\n handler: async ({\n event: {\n data: { from, to },\n },\n }: any) => {\n const res = await fetch(\\`https://free.ratesdb.com/v1/rates?from=\\${from}&to=\\${to}\\`);\n const {\n data: { rates },\n } = await res.json();\n\n return { rate: rates[to].toString() };\n },\n });\n </example>\n `,\n schema: ScriptType,\n tools: [\n defineTool(meta.id, {\n name: 'create',\n description: 'Create a new script. Returns the artifact definition for the script',\n caption: 'Creating script...',\n schema: Schema.Struct({\n name: Schema.String.annotations({ description: 'The name of the script' }),\n code: Schema.String.annotations({\n description: 'The full code of the script in JavaScript or TypeScript. Must be valid executable code.',\n }),\n }),\n execute: async ({ name, code }, { extensions }) => {\n invariant(extensions?.space, 'No space');\n invariant(extensions?.dispatch, 'No intent dispatcher');\n const script = live(ScriptType, {\n name,\n source: makeRef(\n live(DataType.Text, {\n content: code,\n }),\n ),\n });\n extensions.space.db.add(script);\n await extensions.space.db.flush();\n\n const intent = createIntent(SpaceAction.AddObject, { target: extensions.space, object: script });\n const { data, error } = await extensions.dispatch(intent);\n if (!data || error) {\n return ToolResult.Error(error?.message ?? 'Failed to create chess game');\n }\n\n return ToolResult.Success(createArtifactElement(script.id));\n },\n }),\n defineTool(meta.id, {\n name: 'inspect',\n description: 'Inspect a script. Returns the artifact definition for the script',\n caption: 'Inspecting script...',\n schema: Schema.Struct({\n // TODO(wittjosiah): ObjectId schema should be used here but it's not working.\n id: Schema.String.annotations({ description: 'The ID of the script' }),\n }),\n execute: async ({ id }, { extensions }) => {\n invariant(extensions?.space, 'No space');\n\n const script = (await extensions.space.db.query({ id }).first()) as ScriptType;\n const { content } = await script.source.load();\n\n return ToolResult.Success({\n name: script.name,\n code: content,\n });\n },\n }),\n defineTool(meta.id, {\n name: 'update',\n description: 'Update a script. Returns the artifact definition for the script',\n caption: 'Updating script...',\n schema: Schema.Struct({\n // TODO(wittjosiah): ObjectId schema should be used here but it's not working.\n id: Schema.String.annotations({ description: 'The ID of the script to update' }),\n code: Schema.String.annotations({\n description: 'The full code of the script in JavaScript or TypeScript. Must be valid executable code.',\n }),\n }),\n execute: async ({ id, code }, { extensions }) => {\n invariant(extensions?.space, 'No space');\n\n const script = (await extensions.space.db.query({ id }).first()) as ScriptType;\n const source = await script.source.load();\n if (!source) {\n return ToolResult.Error('Script not found');\n }\n\n source.content = code;\n await extensions.space?.db.flush();\n\n return ToolResult.Success({\n name: script.name,\n });\n },\n }),\n ],\n });\n\n return contributes(Capabilities.ArtifactDefinition, definition);\n};\n"],
|
|
5
|
-
"mappings": ";;;;;AAIA,SAASA,cAAc;AAEvB,SAASC,cAAcC,aAAaC,oBAAkD;AACtF,SAASC,gBAAgBC,YAAYC,kBAAkB;AACvD,SAASC,6BAA6B;AACtC,SAASC,kBAAkB;AAC3B,SAASC,iBAAiB;AAC1B,SAASC,mBAAmB;AAC5B,SAASC,MAAMC,eAA2B;AAC1C,SAASC,gBAAgB;;AAWzB,IAAA,8BAAe,MAAA;AACb,QAAMC,aAAaC,eAAe;IAChCC,IAAI,YAAYC,KAAKD,EAAE;IACvBE,MAAMD,KAAKC;;;;IAIXC,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IA6GdC,QAAQC;IACRC,OAAO;MACLC,WAAWN,KAAKD,IAAI;QAClBE,MAAM;QACNM,aAAa;QACbC,SAAS;QACTL,QAAQM,OAAOC,OAAO;UACpBT,MAAMQ,OAAOE,OAAOC,YAAY;YAAEL,aAAa;UAAyB,CAAA;UACxEM,MAAMJ,OAAOE,OAAOC,YAAY;YAC9BL,aAAa;UACf,CAAA;QACF,CAAA;QACAO,SAAS,OAAO,EAAEb,MAAMY,KAAI,GAAI,EAAEE,WAAU,MAAE;AAC5CC,oBAAUD,YAAYE,O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AAIU,OAAOE,OAAOC,YAAY;YAAEL,aAAa;UAAiC,CAAA;UAC9EM,MAAMJ,OAAOE,OAAOC,YAAY;YAC9BL,aAAa;UACf,CAAA;QACF,CAAA;QACAO,SAAS,OAAO,EAAEf,IAAIc,KAAI,GAAI,EAAEE,WAAU,MAAE;AAC1CC,oBAAUD,YAAYE,OAAO,YAAA;;;;;;;;;AAE7B,gBAAME,SAAU,MAAMJ,WAAWE,MAAMS,GAAGgB,MAAM;YAAE3C;UAAG,CAAA,EAAG4C,MAAK;AAC7D,gBAAMtB,SAAS,MAAMF,OAAOE,OAAOuB,KAAI;AACvC,cAAI,CAACvB,QAAQ;AACX,mBAAOgB,WAAWC,MAAM,kBAAA;UAC1B;AAEAjB,iBAAOI,UAAUZ;AACjB,gBAAME,WAAWE,OAAOS,GAAGE,MAAAA;AAE3B,iBAAOS,WAAWG,QAAQ;YACxBvC,MAAMkB,OAAOlB;UACf,CAAA;QACF;MACF,CAAA;;EAEJ,CAAA;AAEA,SAAO4C,YAAYC,aAAaC,oBAAoBlD,UAAAA;AACtD;",
|
|
6
|
-
"names": ["Schema", "Capabilities", "contributes", "createIntent", "defineArtifact", "defineTool", "ToolResult", "createArtifactElement", "ScriptType", "invariant", "SpaceAction", "live", "makeRef", "DataType", "definition", "defineArtifact", "id", "meta", "name", "instructions", "schema", "ScriptType", "tools", "defineTool", "description", "caption", "Schema", "Struct", "String", "annotations", "code", "execute", "extensions", "invariant", "space", "dispatch", "script", "live", "source", "makeRef", "DataType", "Text", "content", "db", "add", "flush", "intent", "createIntent", "SpaceAction", "AddObject", "target", "object", "data", "error", "ToolResult", "Error", "message", "Success", "createArtifactElement", "query", "first", "load", "contributes", "Capabilities", "ArtifactDefinition"]
|
|
7
|
-
}
|