@dxos/plugin-automation 0.7.5-main.9d26e3a → 0.7.5-main.9d2a38b
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/{AssistantPanel-32FH2RA6.mjs → AssistantPanel-N276BTPV.mjs} +2 -2
- package/dist/lib/browser/AutomationPanel-IHZ4JKVS.mjs +232 -0
- package/dist/lib/browser/AutomationPanel-IHZ4JKVS.mjs.map +7 -0
- package/dist/lib/browser/app-graph-builder-IJTTULDP.mjs +131 -0
- package/dist/lib/browser/app-graph-builder-IJTTULDP.mjs.map +7 -0
- package/dist/lib/browser/chunk-4AIMDHKY.mjs +10 -0
- package/dist/lib/browser/chunk-4AIMDHKY.mjs.map +7 -0
- package/dist/lib/browser/{chunk-DN5M2QL5.mjs → chunk-DL6LB2NI.mjs} +2 -8
- package/dist/lib/browser/{chunk-DN5M2QL5.mjs.map → chunk-DL6LB2NI.mjs.map} +4 -4
- package/dist/lib/browser/{chunk-X5KMOH3I.mjs → chunk-HKX3D3ZP.mjs} +3 -3
- package/dist/lib/browser/chunk-HKX3D3ZP.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +89 -236
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/react-surface-LL72F3F4.mjs +34 -0
- package/dist/lib/browser/react-surface-LL72F3F4.mjs.map +7 -0
- package/dist/lib/browser/types/index.mjs +1 -3
- package/dist/lib/node/{AssistantPanel-XANI7YNV.cjs → AssistantPanel-Z4GVHUF3.cjs} +6 -6
- package/dist/lib/node/{AutomationPanel-VADY3HMP.cjs → AutomationPanel-PPODB5XA.cjs} +113 -32
- package/dist/lib/node/AutomationPanel-PPODB5XA.cjs.map +7 -0
- package/dist/lib/node/app-graph-builder-MF5M4QRS.cjs +147 -0
- package/dist/lib/node/app-graph-builder-MF5M4QRS.cjs.map +7 -0
- package/dist/lib/node/chunk-25AQIF3L.cjs +43 -0
- package/dist/lib/node/chunk-25AQIF3L.cjs.map +7 -0
- package/dist/lib/node/{chunk-DTJ7XVO2.cjs → chunk-5VF5JKUN.cjs} +7 -7
- package/dist/lib/node/chunk-5VF5JKUN.cjs.map +7 -0
- package/dist/lib/node/{chunk-NIL4TP6U.cjs → chunk-JNDMZQH7.cjs} +4 -9
- package/dist/lib/node/chunk-JNDMZQH7.cjs.map +7 -0
- package/dist/lib/node/index.cjs +112 -258
- package/dist/lib/node/index.cjs.map +4 -4
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node/react-surface-DVAU4MGD.cjs +57 -0
- package/dist/lib/node/react-surface-DVAU4MGD.cjs.map +7 -0
- package/dist/lib/node/types/index.cjs +5 -7
- package/dist/lib/node/types/index.cjs.map +2 -2
- package/dist/lib/node-esm/{AssistantPanel-5M6O6JV7.mjs → AssistantPanel-DDCQHBJX.mjs} +2 -2
- package/dist/lib/node-esm/AutomationPanel-R3D6CRF5.mjs +233 -0
- package/dist/lib/node-esm/AutomationPanel-R3D6CRF5.mjs.map +7 -0
- package/dist/lib/node-esm/app-graph-builder-5N7OK23B.mjs +132 -0
- package/dist/lib/node-esm/app-graph-builder-5N7OK23B.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-GCHXTXVT.mjs → chunk-GIAYUM5I.mjs} +2 -8
- package/dist/lib/node-esm/{chunk-GCHXTXVT.mjs.map → chunk-GIAYUM5I.mjs.map} +4 -4
- package/dist/lib/node-esm/{chunk-HNOBZHWK.mjs → chunk-X3LPRWIL.mjs} +3 -3
- package/dist/lib/node-esm/chunk-X3LPRWIL.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-XW7TEQA3.mjs +12 -0
- package/dist/lib/node-esm/chunk-XW7TEQA3.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +89 -236
- package/dist/lib/node-esm/index.mjs.map +4 -4
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/react-surface-4BED2PZ4.mjs +35 -0
- package/dist/lib/node-esm/react-surface-4BED2PZ4.mjs.map +7 -0
- package/dist/lib/node-esm/types/index.mjs +1 -3
- package/dist/types/src/AutomationPlugin.d.ts +1 -3
- package/dist/types/src/AutomationPlugin.d.ts.map +1 -1
- package/dist/types/src/capabilities/app-graph-builder.d.ts +180 -0
- package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -0
- package/dist/types/src/capabilities/index.d.ts +179 -0
- package/dist/types/src/capabilities/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/react-surface.d.ts +4 -0
- package/dist/types/src/capabilities/react-surface.d.ts.map +1 -0
- package/dist/types/src/components/AutomationPanel/AutomationPanel.d.ts +1 -1
- package/dist/types/src/components/AutomationPanel/AutomationPanel.d.ts.map +1 -1
- package/dist/types/src/components/TriggerEditor/TriggerEditor.d.ts +1 -2
- package/dist/types/src/components/TriggerEditor/TriggerEditor.d.ts.map +1 -1
- package/dist/types/src/components/index.d.ts +1 -1
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +1 -2
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/meta.d.ts +1 -2
- package/dist/types/src/meta.d.ts.map +1 -1
- package/dist/types/src/translations.d.ts +7 -0
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/index.d.ts +0 -1
- package/dist/types/src/types/index.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +38 -46
- package/src/AutomationPlugin.tsx +55 -193
- package/src/capabilities/app-graph-builder.ts +127 -0
- package/src/capabilities/index.ts +8 -0
- package/src/capabilities/react-surface.tsx +27 -0
- package/src/components/AutomationPanel/AutomationPanel.tsx +54 -37
- package/src/components/TriggerEditor/TriggerEditor.tsx +63 -6
- package/src/index.ts +1 -4
- package/src/meta.ts +1 -1
- package/src/translations.ts +9 -0
- package/src/types/index.ts +0 -1
- package/dist/lib/browser/AutomationPanel-ABGPG5LE.mjs +0 -151
- package/dist/lib/browser/AutomationPanel-ABGPG5LE.mjs.map +0 -7
- package/dist/lib/browser/chunk-X5KMOH3I.mjs.map +0 -7
- package/dist/lib/browser/meta.mjs +0 -9
- package/dist/lib/browser/meta.mjs.map +0 -7
- package/dist/lib/node/AutomationPanel-VADY3HMP.cjs.map +0 -7
- package/dist/lib/node/chunk-DTJ7XVO2.cjs.map +0 -7
- package/dist/lib/node/chunk-NIL4TP6U.cjs.map +0 -7
- package/dist/lib/node/meta.cjs +0 -30
- package/dist/lib/node/meta.cjs.map +0 -7
- package/dist/lib/node-esm/AutomationPanel-EETYIDPA.mjs +0 -152
- package/dist/lib/node-esm/AutomationPanel-EETYIDPA.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-HNOBZHWK.mjs.map +0 -7
- package/dist/lib/node-esm/meta.mjs +0 -10
- package/dist/lib/node-esm/meta.mjs.map +0 -7
- package/dist/types/src/types/types.d.ts +0 -7
- package/dist/types/src/types/types.d.ts.map +0 -1
- package/src/types/types.ts +0 -27
- /package/dist/lib/browser/{AssistantPanel-32FH2RA6.mjs.map → AssistantPanel-N276BTPV.mjs.map} +0 -0
- /package/dist/lib/node/{AssistantPanel-XANI7YNV.cjs.map → AssistantPanel-Z4GVHUF3.cjs.map} +0 -0
- /package/dist/lib/node-esm/{AssistantPanel-5M6O6JV7.mjs.map → AssistantPanel-DDCQHBJX.mjs.map} +0 -0
|
@@ -1,31 +1,30 @@
|
|
|
1
1
|
import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
|
|
2
2
|
import {
|
|
3
|
-
AutomationAction,
|
|
4
3
|
ChainInputSchema,
|
|
5
4
|
ChainInputType,
|
|
6
5
|
ChainPromptType,
|
|
7
6
|
ChainType
|
|
8
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-GIAYUM5I.mjs";
|
|
8
|
+
import {
|
|
9
|
+
AssistantPanel,
|
|
10
|
+
AutomationPanel
|
|
11
|
+
} from "./chunk-XW7TEQA3.mjs";
|
|
9
12
|
import {
|
|
10
13
|
AUTOMATION_PLUGIN,
|
|
11
|
-
|
|
12
|
-
} from "./chunk-
|
|
14
|
+
meta
|
|
15
|
+
} from "./chunk-X3LPRWIL.mjs";
|
|
13
16
|
|
|
14
17
|
// packages/plugins/experimental/plugin-automation/src/AutomationPlugin.tsx
|
|
15
|
-
import
|
|
16
|
-
import { createSurface, parseMetadataResolverPlugin, resolvePlugin } from "@dxos/app-framework";
|
|
18
|
+
import { Capabilities, contributes, defineModule, definePlugin, Events, oneOf } from "@dxos/app-framework";
|
|
17
19
|
import { FunctionTrigger } from "@dxos/functions";
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import { memoizeQuery } from "@dxos/plugin-space";
|
|
22
|
-
import { getSpace, getTypename, isEchoObject, parseId, RefArray, SpaceState } from "@dxos/react-client/echo";
|
|
23
|
-
import { translations as formTranslations } from "@dxos/react-ui-form";
|
|
20
|
+
import { ClientCapabilities, ClientEvents } from "@dxos/plugin-client";
|
|
21
|
+
import { DeckCapabilities } from "@dxos/plugin-deck";
|
|
22
|
+
import { RefArray } from "@dxos/react-client/echo";
|
|
24
23
|
|
|
25
|
-
// packages/plugins/experimental/plugin-automation/src/
|
|
26
|
-
import { lazy } from "
|
|
27
|
-
var
|
|
28
|
-
var
|
|
24
|
+
// packages/plugins/experimental/plugin-automation/src/capabilities/index.ts
|
|
25
|
+
import { lazy } from "@dxos/app-framework";
|
|
26
|
+
var AppGraphBuilder = lazy(() => import("./app-graph-builder-5N7OK23B.mjs"));
|
|
27
|
+
var ReactSurface = lazy(() => import("./react-surface-4BED2PZ4.mjs"));
|
|
29
28
|
|
|
30
29
|
// packages/plugins/experimental/plugin-automation/src/translations.ts
|
|
31
30
|
var translations_default = [
|
|
@@ -42,6 +41,7 @@ var translations_default = [
|
|
|
42
41
|
"value placeholder": "Enter value...",
|
|
43
42
|
"select preset template placeholder": "Select preset",
|
|
44
43
|
"open automation panel label": "Show Automations",
|
|
44
|
+
"automation panel label": "Automations",
|
|
45
45
|
"function select label": "Function",
|
|
46
46
|
"function select placeholder": "Select function",
|
|
47
47
|
"function enabled": "Enabled",
|
|
@@ -51,10 +51,16 @@ var translations_default = [
|
|
|
51
51
|
"trigger type webhook": "Webhook",
|
|
52
52
|
"trigger type websocket": "Websocket",
|
|
53
53
|
"trigger type subscription": "Subscription",
|
|
54
|
+
"trigger type email": "Email",
|
|
54
55
|
"trigger filter": "Filter",
|
|
55
56
|
"trigger cron": "Cron",
|
|
56
57
|
"trigger method": "Method",
|
|
57
58
|
"trigger endpoint": "Endpoint",
|
|
59
|
+
"trigger copy url": "Copy URL",
|
|
60
|
+
"trigger copy email": "Copy Email",
|
|
61
|
+
"trigger meta add": "Add",
|
|
62
|
+
"trigger meta remove": "Remove",
|
|
63
|
+
"trigger meta prop name placeholder": "New meta property name",
|
|
58
64
|
"open assistant panel label": "Show Assistant",
|
|
59
65
|
"assistant panel label": "Assistant"
|
|
60
66
|
}
|
|
@@ -63,226 +69,76 @@ var translations_default = [
|
|
|
63
69
|
];
|
|
64
70
|
|
|
65
71
|
// packages/plugins/experimental/plugin-automation/src/AutomationPlugin.tsx
|
|
66
|
-
var
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
72
|
+
var AutomationPlugin = () => definePlugin(meta, [
|
|
73
|
+
defineModule({
|
|
74
|
+
id: `${meta.id}/module/translations`,
|
|
75
|
+
activatesOn: Events.SetupTranslations,
|
|
76
|
+
activate: () => contributes(Capabilities.Translations, translations_default)
|
|
77
|
+
}),
|
|
78
|
+
defineModule({
|
|
79
|
+
id: `${meta.id}/module/metadata`,
|
|
80
|
+
activatesOn: oneOf(Events.Startup, Events.SetupAppGraph),
|
|
81
|
+
activate: () => contributes(Capabilities.Metadata, {
|
|
82
|
+
id: ChainType.typename,
|
|
71
83
|
metadata: {
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
{
|
|
77
|
-
ns: AUTOMATION_PLUGIN
|
|
78
|
-
}
|
|
79
|
-
],
|
|
80
|
-
icon: "ph--magic-wand--regular",
|
|
81
|
-
// TODO(wittjosiah): Move out of metadata.
|
|
82
|
-
loadReferences: async (chain) => await RefArray.loadAll(chain.prompts ?? [])
|
|
84
|
+
placeholder: [
|
|
85
|
+
"object placeholder",
|
|
86
|
+
{
|
|
87
|
+
ns: AUTOMATION_PLUGIN
|
|
83
88
|
}
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
89
|
+
],
|
|
90
|
+
icon: "ph--magic-wand--regular",
|
|
91
|
+
// TODO(wittjosiah): Move out of metadata.
|
|
92
|
+
loadReferences: async (chain) => await RefArray.loadAll(chain.prompts ?? [])
|
|
93
|
+
}
|
|
94
|
+
})
|
|
95
|
+
}),
|
|
96
|
+
defineModule({
|
|
97
|
+
id: `${meta.id}/module/schema`,
|
|
98
|
+
activatesOn: ClientEvents.SetupClient,
|
|
99
|
+
activate: () => contributes(ClientCapabilities.SystemSchema, [
|
|
100
|
+
ChainType,
|
|
101
|
+
ChainPromptType,
|
|
102
|
+
FunctionTrigger
|
|
103
|
+
])
|
|
104
|
+
}),
|
|
105
|
+
defineModule({
|
|
106
|
+
id: `${meta.id}/module/complementary-panels`,
|
|
107
|
+
activatesOn: Events.Startup,
|
|
108
|
+
activate: () => [
|
|
109
|
+
contributes(DeckCapabilities.ComplementaryPanel, {
|
|
110
|
+
id: "automation",
|
|
111
|
+
label: [
|
|
112
|
+
"automation panel label",
|
|
99
113
|
{
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
114
|
+
ns: AUTOMATION_PLUGIN
|
|
115
|
+
}
|
|
116
|
+
],
|
|
117
|
+
icon: "ph--magic-wand--regular"
|
|
118
|
+
}),
|
|
119
|
+
contributes(DeckCapabilities.ComplementaryPanel, {
|
|
120
|
+
id: "assistant",
|
|
121
|
+
label: [
|
|
122
|
+
"assistant panel label",
|
|
109
123
|
{
|
|
110
|
-
|
|
111
|
-
label: [
|
|
112
|
-
"open assistant panel label",
|
|
113
|
-
{
|
|
114
|
-
ns: AUTOMATION_PLUGIN
|
|
115
|
-
}
|
|
116
|
-
],
|
|
117
|
-
icon: "ph--atom--regular"
|
|
124
|
+
ns: AUTOMATION_PLUGIN
|
|
118
125
|
}
|
|
119
|
-
]
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
});
|
|
136
|
-
invariant(client, void 0, {
|
|
137
|
-
F: __dxlog_file,
|
|
138
|
-
L: 68,
|
|
139
|
-
S: void 0,
|
|
140
|
-
A: [
|
|
141
|
-
"client",
|
|
142
|
-
""
|
|
143
|
-
]
|
|
144
|
-
});
|
|
145
|
-
return [
|
|
146
|
-
// Create nodes for object settings.
|
|
147
|
-
createExtension({
|
|
148
|
-
id: `${AUTOMATION_PLUGIN}/automation-for-subject`,
|
|
149
|
-
resolver: ({ id }) => {
|
|
150
|
-
if (!id.endsWith("~automation")) {
|
|
151
|
-
return;
|
|
152
|
-
}
|
|
153
|
-
const type = "orphan-settings-for-subject";
|
|
154
|
-
const icon = "ph--magic-wand--regular";
|
|
155
|
-
const [subjectId] = id.split("~");
|
|
156
|
-
const { spaceId, objectId } = parseId(subjectId);
|
|
157
|
-
const spaces = toSignal((onChange) => client.spaces.subscribe(() => onChange()).unsubscribe, () => client.spaces.get());
|
|
158
|
-
const space = spaces?.find((space2) => space2.id === spaceId && space2.state.get() === SpaceState.SPACE_READY);
|
|
159
|
-
if (!objectId) {
|
|
160
|
-
const label2 = space ? space.properties.name || [
|
|
161
|
-
"unnamed space label",
|
|
162
|
-
{
|
|
163
|
-
ns: AUTOMATION_PLUGIN
|
|
164
|
-
}
|
|
165
|
-
] : [
|
|
166
|
-
"unnamed object settings label",
|
|
167
|
-
{
|
|
168
|
-
ns: AUTOMATION_PLUGIN
|
|
169
|
-
}
|
|
170
|
-
];
|
|
171
|
-
return {
|
|
172
|
-
id,
|
|
173
|
-
type,
|
|
174
|
-
data: null,
|
|
175
|
-
properties: {
|
|
176
|
-
icon,
|
|
177
|
-
label: label2,
|
|
178
|
-
showResolvedThreads: false,
|
|
179
|
-
object: null,
|
|
180
|
-
space
|
|
181
|
-
}
|
|
182
|
-
};
|
|
183
|
-
}
|
|
184
|
-
const [object] = memoizeQuery(space, {
|
|
185
|
-
id: objectId
|
|
186
|
-
});
|
|
187
|
-
if (!object || !subjectId) {
|
|
188
|
-
return;
|
|
189
|
-
}
|
|
190
|
-
const meta = resolve(getTypename(object) ?? "");
|
|
191
|
-
const label = meta.label?.(object) || object.name || meta.placeholder || [
|
|
192
|
-
"unnamed object settings label",
|
|
193
|
-
{
|
|
194
|
-
ns: AUTOMATION_PLUGIN
|
|
195
|
-
}
|
|
196
|
-
];
|
|
197
|
-
return {
|
|
198
|
-
id,
|
|
199
|
-
type,
|
|
200
|
-
data: null,
|
|
201
|
-
properties: {
|
|
202
|
-
icon,
|
|
203
|
-
label,
|
|
204
|
-
object
|
|
205
|
-
}
|
|
206
|
-
};
|
|
207
|
-
}
|
|
208
|
-
}),
|
|
209
|
-
createExtension({
|
|
210
|
-
id: `${AUTOMATION_PLUGIN}/assistant-for-subject`,
|
|
211
|
-
resolver: ({ id }) => {
|
|
212
|
-
if (!id.endsWith("~assistant")) {
|
|
213
|
-
return;
|
|
214
|
-
}
|
|
215
|
-
const [subjectId] = id.split("~");
|
|
216
|
-
const { spaceId, objectId } = parseId(subjectId);
|
|
217
|
-
const spaces = toSignal((onChange) => client.spaces.subscribe(() => onChange()).unsubscribe, () => client.spaces.get());
|
|
218
|
-
const space = spaces?.find((space2) => space2.id === spaceId && space2.state.get() === SpaceState.SPACE_READY);
|
|
219
|
-
if (!objectId) {
|
|
220
|
-
return {
|
|
221
|
-
id,
|
|
222
|
-
type: "orphan-automation-for-subject",
|
|
223
|
-
data: null,
|
|
224
|
-
properties: {
|
|
225
|
-
icon: "ph--atom--regular",
|
|
226
|
-
label: [
|
|
227
|
-
"assistant panel label",
|
|
228
|
-
{
|
|
229
|
-
ns: AUTOMATION_PLUGIN
|
|
230
|
-
}
|
|
231
|
-
],
|
|
232
|
-
object: null,
|
|
233
|
-
space
|
|
234
|
-
}
|
|
235
|
-
};
|
|
236
|
-
}
|
|
237
|
-
const [object] = memoizeQuery(space, {
|
|
238
|
-
id: objectId
|
|
239
|
-
});
|
|
240
|
-
return {
|
|
241
|
-
id,
|
|
242
|
-
type: "orphan-automation-for-subject",
|
|
243
|
-
data: null,
|
|
244
|
-
properties: {
|
|
245
|
-
icon: "ph--atom--regular",
|
|
246
|
-
label: [
|
|
247
|
-
"assistant panel label",
|
|
248
|
-
{
|
|
249
|
-
ns: AUTOMATION_PLUGIN
|
|
250
|
-
}
|
|
251
|
-
],
|
|
252
|
-
object
|
|
253
|
-
}
|
|
254
|
-
};
|
|
255
|
-
}
|
|
256
|
-
})
|
|
257
|
-
];
|
|
258
|
-
}
|
|
259
|
-
},
|
|
260
|
-
surface: {
|
|
261
|
-
definitions: () => [
|
|
262
|
-
createSurface({
|
|
263
|
-
id: `${AUTOMATION_PLUGIN}/assistant`,
|
|
264
|
-
role: "complementary--assistant",
|
|
265
|
-
component: ({ data }) => /* @__PURE__ */ React.createElement(AssistantPanel, {
|
|
266
|
-
subject: data.subject
|
|
267
|
-
})
|
|
268
|
-
}),
|
|
269
|
-
createSurface({
|
|
270
|
-
id: `${AUTOMATION_PLUGIN}/automation`,
|
|
271
|
-
role: "complementary--automation",
|
|
272
|
-
filter: (data) => isEchoObject(data.subject) && !!getSpace(data.subject),
|
|
273
|
-
component: ({ data }) => /* @__PURE__ */ React.createElement(AutomationPanel, {
|
|
274
|
-
space: getSpace(data.subject),
|
|
275
|
-
object: data.subject
|
|
276
|
-
})
|
|
277
|
-
})
|
|
278
|
-
]
|
|
279
|
-
},
|
|
280
|
-
intent: {
|
|
281
|
-
resolvers: () => []
|
|
282
|
-
}
|
|
283
|
-
}
|
|
284
|
-
};
|
|
285
|
-
};
|
|
126
|
+
],
|
|
127
|
+
icon: "ph--atom--regular"
|
|
128
|
+
})
|
|
129
|
+
]
|
|
130
|
+
}),
|
|
131
|
+
defineModule({
|
|
132
|
+
id: `${meta.id}/module/react-surface`,
|
|
133
|
+
activatesOn: Events.Startup,
|
|
134
|
+
activate: ReactSurface
|
|
135
|
+
}),
|
|
136
|
+
defineModule({
|
|
137
|
+
id: `${meta.id}/module/app-graph-builder`,
|
|
138
|
+
activatesOn: Events.SetupAppGraph,
|
|
139
|
+
activate: AppGraphBuilder
|
|
140
|
+
})
|
|
141
|
+
]);
|
|
286
142
|
|
|
287
143
|
// packages/plugins/experimental/plugin-automation/src/presets.ts
|
|
288
144
|
import { create } from "@dxos/live-object";
|
|
@@ -501,12 +357,9 @@ var chainPresets = [
|
|
|
501
357
|
})
|
|
502
358
|
}
|
|
503
359
|
];
|
|
504
|
-
|
|
505
|
-
// packages/plugins/experimental/plugin-automation/src/index.ts
|
|
506
|
-
var src_default = AutomationPlugin;
|
|
507
360
|
export {
|
|
361
|
+
AUTOMATION_PLUGIN,
|
|
508
362
|
AssistantPanel,
|
|
509
|
-
AutomationAction,
|
|
510
363
|
AutomationPanel,
|
|
511
364
|
AutomationPlugin,
|
|
512
365
|
ChainInputSchema,
|
|
@@ -514,7 +367,7 @@ export {
|
|
|
514
367
|
ChainPromptType,
|
|
515
368
|
ChainType,
|
|
516
369
|
chainPresets,
|
|
517
|
-
|
|
370
|
+
meta,
|
|
518
371
|
str
|
|
519
372
|
};
|
|
520
373
|
//# sourceMappingURL=index.mjs.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../../../src/AutomationPlugin.tsx", "../../../src/
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport React from 'react';\n\nimport { createSurface, parseMetadataResolverPlugin, type PluginDefinition, resolvePlugin } from '@dxos/app-framework';\nimport { FunctionTrigger } from '@dxos/functions';\nimport { invariant } from '@dxos/invariant';\nimport { parseClientPlugin } from '@dxos/plugin-client/types';\nimport { createExtension, toSignal } from '@dxos/plugin-graph';\nimport { memoizeQuery } from '@dxos/plugin-space';\nimport {\n getSpace,\n getTypename,\n isEchoObject,\n parseId,\n type ReactiveEchoObject,\n RefArray,\n SpaceState,\n} from '@dxos/react-client/echo';\nimport { translations as formTranslations } from '@dxos/react-ui-form';\n\nimport { AssistantPanel, AutomationPanel } from './components';\nimport meta, { AUTOMATION_PLUGIN } from './meta';\nimport translations from './translations';\nimport { type AutomationPluginProvides, ChainPromptType, ChainType } from './types';\n\nexport const AutomationPlugin = (): PluginDefinition<AutomationPluginProvides> => {\n return {\n meta,\n provides: {\n metadata: {\n records: {\n [ChainType.typename]: {\n placeholder: ['object placeholder', { ns: AUTOMATION_PLUGIN }],\n icon: 'ph--magic-wand--regular',\n // TODO(wittjosiah): Move out of metadata.\n loadReferences: async (chain: ChainType) => await RefArray.loadAll(chain.prompts ?? []),\n },\n },\n },\n translations: [...translations, ...formTranslations],\n echo: {\n system: [ChainType, ChainPromptType, FunctionTrigger],\n },\n complementary: {\n panels: [\n {\n id: 'automation',\n label: ['open automation panel label', { ns: AUTOMATION_PLUGIN }],\n icon: 'ph--magic-wand--regular',\n },\n {\n id: 'assistant',\n label: ['open assistant panel label', { ns: AUTOMATION_PLUGIN }],\n icon: 'ph--atom--regular',\n },\n ],\n },\n graph: {\n builder: (plugins) => {\n const clientPlugin = resolvePlugin(plugins, parseClientPlugin);\n const metadataPlugin = resolvePlugin(plugins, parseMetadataResolverPlugin);\n const resolve = metadataPlugin?.provides.metadata.resolver;\n const client = clientPlugin?.provides.client;\n invariant(resolve);\n invariant(client);\n\n return [\n // Create nodes for object settings.\n createExtension({\n id: `${AUTOMATION_PLUGIN}/automation-for-subject`,\n resolver: ({ id }) => {\n if (!id.endsWith('~automation')) {\n return;\n }\n\n const type = 'orphan-settings-for-subject';\n const icon = 'ph--magic-wand--regular';\n\n const [subjectId] = id.split('~');\n const { spaceId, objectId } = parseId(subjectId);\n const spaces = toSignal(\n (onChange) => client.spaces.subscribe(() => onChange()).unsubscribe,\n () => client.spaces.get(),\n );\n const space = spaces?.find(\n (space) => space.id === spaceId && space.state.get() === SpaceState.SPACE_READY,\n );\n if (!objectId) {\n // TODO(burdon): Ref SPACE_PLUGIN ns.\n const label = space\n ? space.properties.name || ['unnamed space label', { ns: AUTOMATION_PLUGIN }]\n : ['unnamed object settings label', { ns: AUTOMATION_PLUGIN }];\n\n // TODO(wittjosiah): Support comments for arbitrary subjects.\n // This is to ensure that the comments panel is not stuck on an old object.\n return {\n id,\n type,\n data: null,\n properties: {\n icon,\n label,\n showResolvedThreads: false,\n object: null,\n space,\n },\n };\n }\n\n const [object] = memoizeQuery(space, { id: objectId });\n if (!object || !subjectId) {\n return;\n }\n\n const meta = resolve(getTypename(object) ?? '');\n const label = meta.label?.(object) ||\n object.name ||\n meta.placeholder || ['unnamed object settings label', { ns: AUTOMATION_PLUGIN }];\n\n return {\n id,\n type,\n data: null,\n properties: {\n icon,\n label,\n object,\n },\n };\n },\n }),\n createExtension({\n id: `${AUTOMATION_PLUGIN}/assistant-for-subject`,\n resolver: ({ id }) => {\n // TODO(Zan): Find util (or make one). Effect schema!!\n if (!id.endsWith('~assistant')) {\n return;\n }\n\n const [subjectId] = id.split('~');\n const { spaceId, objectId } = parseId(subjectId);\n const spaces = toSignal(\n (onChange) => client.spaces.subscribe(() => onChange()).unsubscribe,\n () => client.spaces.get(),\n );\n const space = spaces?.find(\n (space) => space.id === spaceId && space.state.get() === SpaceState.SPACE_READY,\n );\n if (!objectId) {\n // TODO(wittjosiah): Support assistant for arbitrary subjects.\n // This is to ensure that the assistant panel is not stuck on an old object.\n return {\n id,\n type: 'orphan-automation-for-subject',\n data: null,\n properties: {\n icon: 'ph--atom--regular',\n label: ['assistant panel label', { ns: AUTOMATION_PLUGIN }],\n object: null,\n space,\n },\n };\n }\n\n const [object] = memoizeQuery(space, { id: objectId });\n\n return {\n id,\n type: 'orphan-automation-for-subject',\n data: null,\n properties: {\n icon: 'ph--atom--regular',\n label: ['assistant panel label', { ns: AUTOMATION_PLUGIN }],\n object,\n },\n };\n },\n }),\n ];\n },\n },\n surface: {\n definitions: () => [\n createSurface({\n id: `${AUTOMATION_PLUGIN}/assistant`,\n role: 'complementary--assistant',\n component: ({ data }) => <AssistantPanel subject={data.subject} />,\n }),\n createSurface({\n id: `${AUTOMATION_PLUGIN}/automation`,\n role: 'complementary--automation',\n filter: (data): data is { subject: ReactiveEchoObject<any> } =>\n isEchoObject(data.subject) && !!getSpace(data.subject),\n component: ({ data }) => <AutomationPanel space={getSpace(data.subject)!} object={data.subject} />,\n }),\n ],\n },\n intent: {\n resolvers: () => [],\n },\n },\n };\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { lazy } from 'react';\n\nexport const AssistantPanel = lazy(() => import('./AssistantPanel'));\nexport const AutomationPanel = lazy(() => import('./AutomationPanel'));\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { AUTOMATION_PLUGIN } from './meta';\n\nexport default [\n {\n 'en-US': {\n [AUTOMATION_PLUGIN]: {\n 'plugin name': 'Automation',\n 'object placeholder': 'New prompt',\n 'create object label': 'Create prompt',\n 'create trigger label': 'Create trigger',\n 'create stack section label': 'Create prompt',\n 'command placeholder': 'Enter slash command...',\n 'template placeholder': 'Enter template...',\n 'value placeholder': 'Enter value...',\n 'select preset template placeholder': 'Select preset',\n 'open automation panel label': 'Show Automations',\n\n 'function select label': 'Function',\n 'function select placeholder': 'Select function',\n 'function enabled': 'Enabled',\n 'trigger select label': 'Trigger',\n 'trigger select placeholder': 'Trigger type',\n\n 'trigger type timer': 'Timer',\n 'trigger type webhook': 'Webhook',\n 'trigger type websocket': 'Websocket',\n 'trigger type subscription': 'Subscription',\n\n 'trigger filter': 'Filter',\n 'trigger cron': 'Cron',\n 'trigger method': 'Method',\n 'trigger endpoint': 'Endpoint',\n\n 'open assistant panel label': 'Show Assistant',\n 'assistant panel label': 'Assistant',\n },\n },\n },\n];\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport { create } from '@dxos/live-object';\n\nimport { ChainInputType, ChainPromptType } from './types';\n\nexport const str = (...text: (string | undefined | boolean)[]): string =>\n text\n .filter((value) => value !== undefined && value !== false)\n .flat()\n .join('\\n');\n\nexport type Preset = {\n id: string;\n title: string;\n createPrompt: () => ChainPromptType;\n};\n\nexport const chainPresets: Preset[] = [\n {\n id: 'dxos.org/prompt/translate',\n title: 'Translate',\n createPrompt: () =>\n create(ChainPromptType, {\n command: 'say',\n template: str(\n // prettier-ignore\n 'Translate the following into {language}:',\n '',\n '---',\n '',\n '{input}',\n ),\n inputs: [\n {\n type: ChainInputType.VALUE,\n name: 'language',\n value: 'japanese',\n },\n {\n type: ChainInputType.PASS_THROUGH,\n name: 'input',\n },\n // TODO(burdon): Message.\n // {\n // type: ChainInputType.CONTEXT,\n // name: 'input',\n // value: 'object.text',\n // },\n ],\n }),\n },\n {\n id: 'dxos.org/prompt/chess',\n title: 'Chess',\n createPrompt: () =>\n create(ChainPromptType, {\n command: 'hint',\n template: str(\n // prettier-ignore\n 'You are a machine that is an expert chess player.',\n '',\n 'The move history of the current game is: {history}',\n '',\n 'Suggest the next move and very briefly explain your strategy in a couple of sentences.',\n ),\n inputs: [\n {\n type: ChainInputType.CONTEXT,\n name: 'history',\n value: 'object.pgn',\n },\n ],\n }),\n },\n {\n id: 'dxos.org/prompt/mermaid',\n title: 'Mermaid',\n createPrompt: () =>\n create(ChainPromptType, {\n command: 'draw',\n template: str(\n // prettier-ignore\n 'Create a simplified mermaid graph representing the text below.',\n 'Do not explain anything.',\n '',\n '---',\n '',\n '{input}',\n ),\n inputs: [\n {\n type: ChainInputType.PASS_THROUGH,\n name: 'input',\n },\n ],\n }),\n },\n {\n id: 'dxos.org/prompt/list',\n title: 'List',\n createPrompt: () =>\n create(ChainPromptType, {\n command: 'list',\n template: str(\n // prettier-ignore\n 'You are a machine that only replies with valid, iterable RFC8259 compliant JSON in your responses.',\n 'Your entire response should be a single array of JSON objects.',\n '',\n 'Your entire response should be a map where the key is the type and the value is a single array of JSON objects conforming to the following types:',\n '',\n '{schema}',\n '',\n '---',\n '',\n '{question}',\n ),\n inputs: [\n {\n type: ChainInputType.SCHEMA,\n name: 'schema',\n value: 'example.com/type/project',\n },\n {\n type: ChainInputType.PASS_THROUGH,\n name: 'question',\n },\n ],\n }),\n },\n {\n id: 'dxos.org/prompt/base',\n title: 'RAG',\n createPrompt: () =>\n create(ChainPromptType, {\n command: 'rag',\n template: str(\n // prettier-ignore\n \"Very briefly answer the question based only on the following context and say if you don't know the answer.\",\n // 'answer the question using the following context as well as your training data:',\n '',\n '{context}',\n '',\n '---',\n '',\n 'question: {question}',\n ),\n inputs: [\n {\n type: ChainInputType.RETRIEVER,\n name: 'context',\n },\n {\n type: ChainInputType.CONTEXT,\n name: 'question',\n value: 'object.text',\n },\n ],\n }),\n },\n {\n id: 'dxos.org/prompt/lookup',\n title: 'Lookup',\n createPrompt: () =>\n create(ChainPromptType, {\n command: 'lookup',\n template: str(\n // prettier-ignore\n 'Lookup and very briefly summarize the following topic in one or two sentences:',\n '',\n '---',\n '',\n '{input}',\n ),\n inputs: [\n {\n type: ChainInputType.CONTEXT,\n name: 'input',\n value: 'text',\n },\n ],\n }),\n },\n {\n id: 'dxos.org/prompt/extract',\n title: 'Extract',\n createPrompt: () =>\n create(ChainPromptType, {\n command: 'extract',\n template: str(\n // prettier-ignore\n 'List all people and companies mentioned in the text below.',\n '',\n 'You are a machine that only replies with valid, iterable RFC8259 compliant JSON in your responses.',\n 'Your entire response should be a map where the key is the type and the value is a single array of JSON objects conforming to the following types:',\n '',\n '{contact}',\n '{company}',\n '',\n '---',\n '',\n '{input}',\n ),\n inputs: [\n {\n type: ChainInputType.SCHEMA,\n name: 'contact',\n value: 'example.com/type/contact',\n },\n {\n type: ChainInputType.SCHEMA,\n name: 'company',\n value: 'example.com/type/organization',\n },\n {\n type: ChainInputType.CONTEXT,\n name: 'input',\n value: 'text',\n },\n ],\n }),\n },\n {\n id: 'dxos.org/prompt/discord',\n title: 'Summarize',\n createPrompt: () =>\n create(ChainPromptType, {\n command: 'summarize',\n template: str(\n // prettier-ignore\n 'Summarize what the team is working on and format it as a markdown table without any explanation.',\n '',\n '---',\n '',\n '{context}',\n ),\n inputs: [\n {\n type: ChainInputType.RESOLVER,\n name: 'context',\n value: 'discord.messages.recent',\n },\n ],\n }),\n },\n];\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { AutomationPlugin } from './AutomationPlugin';\n\nexport default AutomationPlugin;\n\nexport * from './AutomationPlugin';\nexport * from './components';\nexport * from './presets';\nexport * from './types';\n"],
|
|
5
|
-
"mappings": "
|
|
6
|
-
"names": ["
|
|
3
|
+
"sources": ["../../../src/AutomationPlugin.tsx", "../../../src/capabilities/index.ts", "../../../src/translations.ts", "../../../src/presets.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { Capabilities, contributes, defineModule, definePlugin, Events, oneOf } from '@dxos/app-framework';\nimport { FunctionTrigger } from '@dxos/functions';\nimport { ClientCapabilities, ClientEvents } from '@dxos/plugin-client';\nimport { DeckCapabilities } from '@dxos/plugin-deck';\nimport { RefArray } from '@dxos/react-client/echo';\n\nimport { AppGraphBuilder, ReactSurface } from './capabilities';\nimport { AUTOMATION_PLUGIN, meta } from './meta';\nimport translations from './translations';\nimport { ChainPromptType, ChainType } from './types';\n\nexport const AutomationPlugin = () =>\n definePlugin(meta, [\n defineModule({\n id: `${meta.id}/module/translations`,\n activatesOn: Events.SetupTranslations,\n activate: () => contributes(Capabilities.Translations, translations),\n }),\n defineModule({\n id: `${meta.id}/module/metadata`,\n activatesOn: oneOf(Events.Startup, Events.SetupAppGraph),\n activate: () =>\n contributes(Capabilities.Metadata, {\n id: ChainType.typename,\n metadata: {\n placeholder: ['object placeholder', { ns: AUTOMATION_PLUGIN }],\n icon: 'ph--magic-wand--regular',\n // TODO(wittjosiah): Move out of metadata.\n loadReferences: async (chain: ChainType) => await RefArray.loadAll(chain.prompts ?? []),\n },\n }),\n }),\n defineModule({\n id: `${meta.id}/module/schema`,\n activatesOn: ClientEvents.SetupClient,\n activate: () => contributes(ClientCapabilities.SystemSchema, [ChainType, ChainPromptType, FunctionTrigger]),\n }),\n defineModule({\n id: `${meta.id}/module/complementary-panels`,\n activatesOn: Events.Startup,\n activate: () => [\n contributes(DeckCapabilities.ComplementaryPanel, {\n id: 'automation',\n label: ['automation panel label', { ns: AUTOMATION_PLUGIN }],\n icon: 'ph--magic-wand--regular',\n }),\n contributes(DeckCapabilities.ComplementaryPanel, {\n id: 'assistant',\n label: ['assistant panel label', { ns: AUTOMATION_PLUGIN }],\n icon: 'ph--atom--regular',\n }),\n ],\n }),\n defineModule({\n id: `${meta.id}/module/react-surface`,\n activatesOn: Events.Startup,\n activate: ReactSurface,\n }),\n defineModule({\n id: `${meta.id}/module/app-graph-builder`,\n activatesOn: Events.SetupAppGraph,\n activate: AppGraphBuilder,\n }),\n ]);\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { lazy } from '@dxos/app-framework';\n\nexport const AppGraphBuilder = lazy(() => import('./app-graph-builder'));\nexport const ReactSurface = lazy(() => import('./react-surface'));\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { AUTOMATION_PLUGIN } from './meta';\n\nexport default [\n {\n 'en-US': {\n [AUTOMATION_PLUGIN]: {\n 'plugin name': 'Automation',\n 'object placeholder': 'New prompt',\n 'create object label': 'Create prompt',\n 'create trigger label': 'Create trigger',\n 'create stack section label': 'Create prompt',\n 'command placeholder': 'Enter slash command...',\n 'template placeholder': 'Enter template...',\n 'value placeholder': 'Enter value...',\n 'select preset template placeholder': 'Select preset',\n 'open automation panel label': 'Show Automations',\n 'automation panel label': 'Automations',\n\n 'function select label': 'Function',\n 'function select placeholder': 'Select function',\n 'function enabled': 'Enabled',\n 'trigger select label': 'Trigger',\n 'trigger select placeholder': 'Trigger type',\n\n 'trigger type timer': 'Timer',\n 'trigger type webhook': 'Webhook',\n 'trigger type websocket': 'Websocket',\n 'trigger type subscription': 'Subscription',\n 'trigger type email': 'Email',\n\n 'trigger filter': 'Filter',\n 'trigger cron': 'Cron',\n 'trigger method': 'Method',\n 'trigger endpoint': 'Endpoint',\n\n 'trigger copy url': 'Copy URL',\n 'trigger copy email': 'Copy Email',\n\n 'trigger meta add': 'Add',\n 'trigger meta remove': 'Remove',\n 'trigger meta prop name placeholder': 'New meta property name',\n\n 'open assistant panel label': 'Show Assistant',\n 'assistant panel label': 'Assistant',\n },\n },\n },\n];\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport { create } from '@dxos/live-object';\n\nimport { ChainInputType, ChainPromptType } from './types';\n\nexport const str = (...text: (string | undefined | boolean)[]): string =>\n text\n .filter((value) => value !== undefined && value !== false)\n .flat()\n .join('\\n');\n\nexport type Preset = {\n id: string;\n title: string;\n createPrompt: () => ChainPromptType;\n};\n\nexport const chainPresets: Preset[] = [\n {\n id: 'dxos.org/prompt/translate',\n title: 'Translate',\n createPrompt: () =>\n create(ChainPromptType, {\n command: 'say',\n template: str(\n // prettier-ignore\n 'Translate the following into {language}:',\n '',\n '---',\n '',\n '{input}',\n ),\n inputs: [\n {\n type: ChainInputType.VALUE,\n name: 'language',\n value: 'japanese',\n },\n {\n type: ChainInputType.PASS_THROUGH,\n name: 'input',\n },\n // TODO(burdon): Message.\n // {\n // type: ChainInputType.CONTEXT,\n // name: 'input',\n // value: 'object.text',\n // },\n ],\n }),\n },\n {\n id: 'dxos.org/prompt/chess',\n title: 'Chess',\n createPrompt: () =>\n create(ChainPromptType, {\n command: 'hint',\n template: str(\n // prettier-ignore\n 'You are a machine that is an expert chess player.',\n '',\n 'The move history of the current game is: {history}',\n '',\n 'Suggest the next move and very briefly explain your strategy in a couple of sentences.',\n ),\n inputs: [\n {\n type: ChainInputType.CONTEXT,\n name: 'history',\n value: 'object.pgn',\n },\n ],\n }),\n },\n {\n id: 'dxos.org/prompt/mermaid',\n title: 'Mermaid',\n createPrompt: () =>\n create(ChainPromptType, {\n command: 'draw',\n template: str(\n // prettier-ignore\n 'Create a simplified mermaid graph representing the text below.',\n 'Do not explain anything.',\n '',\n '---',\n '',\n '{input}',\n ),\n inputs: [\n {\n type: ChainInputType.PASS_THROUGH,\n name: 'input',\n },\n ],\n }),\n },\n {\n id: 'dxos.org/prompt/list',\n title: 'List',\n createPrompt: () =>\n create(ChainPromptType, {\n command: 'list',\n template: str(\n // prettier-ignore\n 'You are a machine that only replies with valid, iterable RFC8259 compliant JSON in your responses.',\n 'Your entire response should be a single array of JSON objects.',\n '',\n 'Your entire response should be a map where the key is the type and the value is a single array of JSON objects conforming to the following types:',\n '',\n '{schema}',\n '',\n '---',\n '',\n '{question}',\n ),\n inputs: [\n {\n type: ChainInputType.SCHEMA,\n name: 'schema',\n value: 'example.com/type/project',\n },\n {\n type: ChainInputType.PASS_THROUGH,\n name: 'question',\n },\n ],\n }),\n },\n {\n id: 'dxos.org/prompt/base',\n title: 'RAG',\n createPrompt: () =>\n create(ChainPromptType, {\n command: 'rag',\n template: str(\n // prettier-ignore\n \"Very briefly answer the question based only on the following context and say if you don't know the answer.\",\n // 'answer the question using the following context as well as your training data:',\n '',\n '{context}',\n '',\n '---',\n '',\n 'question: {question}',\n ),\n inputs: [\n {\n type: ChainInputType.RETRIEVER,\n name: 'context',\n },\n {\n type: ChainInputType.CONTEXT,\n name: 'question',\n value: 'object.text',\n },\n ],\n }),\n },\n {\n id: 'dxos.org/prompt/lookup',\n title: 'Lookup',\n createPrompt: () =>\n create(ChainPromptType, {\n command: 'lookup',\n template: str(\n // prettier-ignore\n 'Lookup and very briefly summarize the following topic in one or two sentences:',\n '',\n '---',\n '',\n '{input}',\n ),\n inputs: [\n {\n type: ChainInputType.CONTEXT,\n name: 'input',\n value: 'text',\n },\n ],\n }),\n },\n {\n id: 'dxos.org/prompt/extract',\n title: 'Extract',\n createPrompt: () =>\n create(ChainPromptType, {\n command: 'extract',\n template: str(\n // prettier-ignore\n 'List all people and companies mentioned in the text below.',\n '',\n 'You are a machine that only replies with valid, iterable RFC8259 compliant JSON in your responses.',\n 'Your entire response should be a map where the key is the type and the value is a single array of JSON objects conforming to the following types:',\n '',\n '{contact}',\n '{company}',\n '',\n '---',\n '',\n '{input}',\n ),\n inputs: [\n {\n type: ChainInputType.SCHEMA,\n name: 'contact',\n value: 'example.com/type/contact',\n },\n {\n type: ChainInputType.SCHEMA,\n name: 'company',\n value: 'example.com/type/organization',\n },\n {\n type: ChainInputType.CONTEXT,\n name: 'input',\n value: 'text',\n },\n ],\n }),\n },\n {\n id: 'dxos.org/prompt/discord',\n title: 'Summarize',\n createPrompt: () =>\n create(ChainPromptType, {\n command: 'summarize',\n template: str(\n // prettier-ignore\n 'Summarize what the team is working on and format it as a markdown table without any explanation.',\n '',\n '---',\n '',\n '{context}',\n ),\n inputs: [\n {\n type: ChainInputType.RESOLVER,\n name: 'context',\n value: 'discord.messages.recent',\n },\n ],\n }),\n },\n];\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;AAIA,SAASA,cAAcC,aAAaC,cAAcC,cAAcC,QAAQC,aAAa;AACrF,SAASC,uBAAuB;AAChC,SAASC,oBAAoBC,oBAAoB;AACjD,SAASC,wBAAwB;AACjC,SAASC,gBAAgB;;;ACJzB,SAASC,YAAY;AAEd,IAAMC,kBAAkBC,KAAK,MAAM,OAAO,kCAAA,CAAA;AAC1C,IAAMC,eAAeD,KAAK,MAAM,OAAO,8BAAA,CAAA;;;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A;EACJ;EACA;IACEK,IAAI;IACJC,OAAO;IACPC,cAAc,MACZC,OAAOC,iBAAiB;MACtBC,SAAS;MACTC,UAAUd;;QAER;QACA;QACA;QACA;QACA;MAAA;MAEFe,QAAQ;QACN;UACEC,MAAMC,eAAeO;UACrBL,MAAM;UACNhB,OAAO;QACT;;IAEJ,CAAA;EACJ;;",
|
|
6
|
+
"names": ["Capabilities", "contributes", "defineModule", "definePlugin", "Events", "oneOf", "FunctionTrigger", "ClientCapabilities", "ClientEvents", "DeckCapabilities", "RefArray", "lazy", "AppGraphBuilder", "lazy", "ReactSurface", "AUTOMATION_PLUGIN", "AutomationPlugin", "definePlugin", "meta", "defineModule", "id", "activatesOn", "Events", "SetupTranslations", "activate", "contributes", "Capabilities", "Translations", "translations", "oneOf", "Startup", "SetupAppGraph", "Metadata", "ChainType", "typename", "metadata", "placeholder", "ns", "AUTOMATION_PLUGIN", "icon", "loadReferences", "chain", "RefArray", "loadAll", "prompts", "ClientEvents", "SetupClient", "ClientCapabilities", "SystemSchema", "ChainPromptType", "FunctionTrigger", "DeckCapabilities", "ComplementaryPanel", "label", "ReactSurface", "AppGraphBuilder", "create", "str", "text", "filter", "value", "undefined", "flat", "join", "chainPresets", "id", "title", "createPrompt", "create", "ChainPromptType", "command", "template", "inputs", "type", "ChainInputType", "VALUE", "name", "PASS_THROUGH", "CONTEXT", "SCHEMA", "RETRIEVER", "RESOLVER"]
|
|
7
7
|
}
|