@dxos/plugin-automation 0.6.14-staging.9e90729
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/LICENSE +8 -0
- package/README.md +15 -0
- package/dist/lib/browser/PromptContainer-RFMJXMUA.mjs +19 -0
- package/dist/lib/browser/PromptContainer-RFMJXMUA.mjs.map +7 -0
- package/dist/lib/browser/chunk-3TNRXJTD.mjs +14 -0
- package/dist/lib/browser/chunk-3TNRXJTD.mjs.map +7 -0
- package/dist/lib/browser/chunk-GGA62V7D.mjs +55 -0
- package/dist/lib/browser/chunk-GGA62V7D.mjs.map +7 -0
- package/dist/lib/browser/chunk-PSSWFA6A.mjs +217 -0
- package/dist/lib/browser/chunk-PSSWFA6A.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +1135 -0
- package/dist/lib/browser/index.mjs.map +7 -0
- package/dist/lib/browser/meta.json +1 -0
- package/dist/lib/browser/meta.mjs +9 -0
- package/dist/lib/browser/meta.mjs.map +7 -0
- package/dist/lib/browser/types/index.mjs +16 -0
- package/dist/lib/browser/types/index.mjs.map +7 -0
- package/dist/lib/node/PromptContainer-FRSY6FNL.cjs +45 -0
- package/dist/lib/node/PromptContainer-FRSY6FNL.cjs.map +7 -0
- package/dist/lib/node/chunk-E2H3AGKB.cjs +240 -0
- package/dist/lib/node/chunk-E2H3AGKB.cjs.map +7 -0
- package/dist/lib/node/chunk-N5IDAUFU.cjs +76 -0
- package/dist/lib/node/chunk-N5IDAUFU.cjs.map +7 -0
- package/dist/lib/node/chunk-UPPUTAPL.cjs +37 -0
- package/dist/lib/node/chunk-UPPUTAPL.cjs.map +7 -0
- package/dist/lib/node/index.cjs +1137 -0
- package/dist/lib/node/index.cjs.map +7 -0
- package/dist/lib/node/meta.cjs +30 -0
- package/dist/lib/node/meta.cjs.map +7 -0
- package/dist/lib/node/meta.json +1 -0
- package/dist/lib/node/types/index.cjs +38 -0
- package/dist/lib/node/types/index.cjs.map +7 -0
- package/dist/lib/node-esm/PromptContainer-4VHFPEQH.mjs +20 -0
- package/dist/lib/node-esm/PromptContainer-4VHFPEQH.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-HFTXKLRR.mjs +218 -0
- package/dist/lib/node-esm/chunk-HFTXKLRR.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-QAPWYK2P.mjs +16 -0
- package/dist/lib/node-esm/chunk-QAPWYK2P.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-UT6QKU6J.mjs +56 -0
- package/dist/lib/node-esm/chunk-UT6QKU6J.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +1136 -0
- package/dist/lib/node-esm/index.mjs.map +7 -0
- package/dist/lib/node-esm/meta.json +1 -0
- package/dist/lib/node-esm/meta.mjs +10 -0
- package/dist/lib/node-esm/meta.mjs.map +7 -0
- package/dist/lib/node-esm/types/index.mjs +17 -0
- package/dist/lib/node-esm/types/index.mjs.map +7 -0
- package/dist/types/src/AutomationPlugin.d.ts +4 -0
- package/dist/types/src/AutomationPlugin.d.ts.map +1 -0
- package/dist/types/src/components/AutomationPanel.d.ts +3 -0
- package/dist/types/src/components/AutomationPanel.d.ts.map +1 -0
- package/dist/types/src/components/Chain.d.ts +12 -0
- package/dist/types/src/components/Chain.d.ts.map +1 -0
- package/dist/types/src/components/PromptContainer.d.ts +6 -0
- package/dist/types/src/components/PromptContainer.d.ts.map +1 -0
- package/dist/types/src/components/PromptEditor/PromptEditor.d.ts +10 -0
- package/dist/types/src/components/PromptEditor/PromptEditor.d.ts.map +1 -0
- package/dist/types/src/components/PromptEditor/PromptEditor.stories.d.ts +6 -0
- package/dist/types/src/components/PromptEditor/PromptEditor.stories.d.ts.map +1 -0
- package/dist/types/src/components/PromptEditor/index.d.ts +2 -0
- package/dist/types/src/components/PromptEditor/index.d.ts.map +1 -0
- package/dist/types/src/components/PromptEditor/prompt-extension.d.ts +4 -0
- package/dist/types/src/components/PromptEditor/prompt-extension.d.ts.map +1 -0
- package/dist/types/src/components/PromptEditor/types.d.ts +18 -0
- package/dist/types/src/components/PromptEditor/types.d.ts.map +1 -0
- package/dist/types/src/components/TriggerEditor/Form.d.ts +5 -0
- package/dist/types/src/components/TriggerEditor/Form.d.ts.map +1 -0
- package/dist/types/src/components/TriggerEditor/TriggerEditor.d.ts +8 -0
- package/dist/types/src/components/TriggerEditor/TriggerEditor.d.ts.map +1 -0
- package/dist/types/src/components/TriggerEditor/TriggerEditor.stories.d.ts +5 -0
- package/dist/types/src/components/TriggerEditor/TriggerEditor.stories.d.ts.map +1 -0
- package/dist/types/src/components/TriggerEditor/email.d.ts +4 -0
- package/dist/types/src/components/TriggerEditor/email.d.ts.map +1 -0
- package/dist/types/src/components/TriggerEditor/index.d.ts +2 -0
- package/dist/types/src/components/TriggerEditor/index.d.ts.map +1 -0
- package/dist/types/src/components/TriggerEditor/invokation-handler.d.ts +5 -0
- package/dist/types/src/components/TriggerEditor/invokation-handler.d.ts.map +1 -0
- package/dist/types/src/components/TriggerEditor/meta.d.ts +25 -0
- package/dist/types/src/components/TriggerEditor/meta.d.ts.map +1 -0
- package/dist/types/src/components/index.d.ts +6 -0
- package/dist/types/src/components/index.d.ts.map +1 -0
- package/dist/types/src/index.d.ts +7 -0
- package/dist/types/src/index.d.ts.map +1 -0
- package/dist/types/src/meta.d.ts +9 -0
- package/dist/types/src/meta.d.ts.map +1 -0
- package/dist/types/src/presets.d.ts +9 -0
- package/dist/types/src/presets.d.ts.map +1 -0
- package/dist/types/src/translations.d.ts +17 -0
- package/dist/types/src/translations.d.ts.map +1 -0
- package/dist/types/src/types/chain.d.ts +71 -0
- package/dist/types/src/types/chain.d.ts.map +1 -0
- package/dist/types/src/types/index.d.ts +3 -0
- package/dist/types/src/types/index.d.ts.map +1 -0
- package/dist/types/src/types/types.d.ts +7 -0
- package/dist/types/src/types/types.d.ts.map +1 -0
- package/package.json +98 -0
- package/src/AutomationPlugin.tsx +149 -0
- package/src/components/AutomationPanel.tsx +21 -0
- package/src/components/Chain.tsx +66 -0
- package/src/components/PromptContainer.tsx +19 -0
- package/src/components/PromptEditor/PromptEditor.stories.tsx +64 -0
- package/src/components/PromptEditor/PromptEditor.tsx +222 -0
- package/src/components/PromptEditor/index.ts +5 -0
- package/src/components/PromptEditor/prompt-extension.ts +43 -0
- package/src/components/PromptEditor/types.tsx +28 -0
- package/src/components/TriggerEditor/Form.tsx +18 -0
- package/src/components/TriggerEditor/TriggerEditor.stories.tsx +82 -0
- package/src/components/TriggerEditor/TriggerEditor.tsx +346 -0
- package/src/components/TriggerEditor/email.ts +49 -0
- package/src/components/TriggerEditor/index.ts +5 -0
- package/src/components/TriggerEditor/invokation-handler.ts +110 -0
- package/src/components/TriggerEditor/meta.tsx +225 -0
- package/src/components/index.ts +12 -0
- package/src/index.ts +12 -0
- package/src/meta.ts +14 -0
- package/src/presets.ts +248 -0
- package/src/translations.ts +30 -0
- package/src/types/chain.ts +38 -0
- package/src/types/index.ts +6 -0
- package/src/types/types.ts +27 -0
|
@@ -0,0 +1,1137 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var node_exports = {};
|
|
30
|
+
__export(node_exports, {
|
|
31
|
+
AutomationAction: () => import_chunk_N5IDAUFU.AutomationAction,
|
|
32
|
+
AutomationPanel: () => AutomationPanel,
|
|
33
|
+
AutomationPlugin: () => AutomationPlugin,
|
|
34
|
+
Chain: () => Chain,
|
|
35
|
+
ChainInputSchema: () => import_chunk_N5IDAUFU.ChainInputSchema,
|
|
36
|
+
ChainInputType: () => import_chunk_N5IDAUFU.ChainInputType,
|
|
37
|
+
ChainPresets: () => ChainPresets,
|
|
38
|
+
ChainPromptType: () => import_chunk_N5IDAUFU.ChainPromptType,
|
|
39
|
+
ChainType: () => import_chunk_N5IDAUFU.ChainType,
|
|
40
|
+
PromptContainer: () => PromptContainer,
|
|
41
|
+
PromptEditor: () => import_chunk_E2H3AGKB.PromptEditor,
|
|
42
|
+
TriggerEditor: () => TriggerEditor,
|
|
43
|
+
chainPresets: () => chainPresets,
|
|
44
|
+
default: () => src_default,
|
|
45
|
+
str: () => str
|
|
46
|
+
});
|
|
47
|
+
module.exports = __toCommonJS(node_exports);
|
|
48
|
+
var import_chunk_E2H3AGKB = require("./chunk-E2H3AGKB.cjs");
|
|
49
|
+
var import_chunk_N5IDAUFU = require("./chunk-N5IDAUFU.cjs");
|
|
50
|
+
var import_chunk_UPPUTAPL = require("./chunk-UPPUTAPL.cjs");
|
|
51
|
+
var import_react = __toESM(require("react"));
|
|
52
|
+
var import_app_framework = require("@dxos/app-framework");
|
|
53
|
+
var import_types = require("@dxos/functions/types");
|
|
54
|
+
var import_invariant = require("@dxos/invariant");
|
|
55
|
+
var import_plugin_client = require("@dxos/plugin-client");
|
|
56
|
+
var import_plugin_graph = require("@dxos/plugin-graph");
|
|
57
|
+
var import_echo = require("@dxos/react-client/echo");
|
|
58
|
+
var import_react2 = require("react");
|
|
59
|
+
var import_react3 = __toESM(require("react"));
|
|
60
|
+
var import_react_ui = require("@dxos/react-ui");
|
|
61
|
+
var import_react4 = __toESM(require("react"));
|
|
62
|
+
var import_echo2 = require("@dxos/react-client/echo");
|
|
63
|
+
var import_react_ui2 = require("@dxos/react-ui");
|
|
64
|
+
var import_util = require("@dxos/util");
|
|
65
|
+
var import_echo_schema = require("@dxos/echo-schema");
|
|
66
|
+
var import_react5 = __toESM(require("react"));
|
|
67
|
+
var import_async = require("@dxos/async");
|
|
68
|
+
var import_context = require("@dxos/context");
|
|
69
|
+
var import_functions = require("@dxos/functions");
|
|
70
|
+
var import_types2 = require("@dxos/functions/types");
|
|
71
|
+
var import_log = require("@dxos/log");
|
|
72
|
+
var import_types3 = require("@dxos/plugin-script/types");
|
|
73
|
+
var import_react_client = require("@dxos/react-client");
|
|
74
|
+
var import_echo3 = require("@dxos/react-client/echo");
|
|
75
|
+
var import_react_ui3 = require("@dxos/react-ui");
|
|
76
|
+
var import_util2 = require("@dxos/util");
|
|
77
|
+
var import_react6 = __toESM(require("react"));
|
|
78
|
+
var import_react_ui4 = require("@dxos/react-ui");
|
|
79
|
+
var import_async2 = require("@dxos/async");
|
|
80
|
+
var import_echo_db = require("@dxos/echo-db");
|
|
81
|
+
var import_invariant2 = require("@dxos/invariant");
|
|
82
|
+
var import_keys = require("@dxos/keys");
|
|
83
|
+
var import_log2 = require("@dxos/log");
|
|
84
|
+
var import_plugin_script = require("@dxos/plugin-script");
|
|
85
|
+
var import_echo_db2 = require("@dxos/echo-db");
|
|
86
|
+
var import_echo_schema2 = require("@dxos/echo-schema");
|
|
87
|
+
var import_log3 = require("@dxos/log");
|
|
88
|
+
var import_types4 = require("@dxos/plugin-inbox/types");
|
|
89
|
+
var import_types5 = require("@dxos/plugin-space/types");
|
|
90
|
+
var import_echo4 = require("@dxos/react-client/echo");
|
|
91
|
+
var import_react7 = __toESM(require("react"));
|
|
92
|
+
var import_echo_schema3 = require("@dxos/echo-schema");
|
|
93
|
+
var import_types6 = require("@dxos/plugin-chess/types");
|
|
94
|
+
var import_types7 = require("@dxos/plugin-ipfs/types");
|
|
95
|
+
var import_plugin_markdown = require("@dxos/plugin-markdown");
|
|
96
|
+
var import_types8 = require("@dxos/plugin-sketch/types");
|
|
97
|
+
var import_plugin_space = require("@dxos/plugin-space");
|
|
98
|
+
var import_react_ui5 = require("@dxos/react-ui");
|
|
99
|
+
var import_util3 = require("@dxos/util");
|
|
100
|
+
var AutomationPanel = () => {
|
|
101
|
+
const handleCreate = () => {
|
|
102
|
+
};
|
|
103
|
+
return /* @__PURE__ */ import_react3.default.createElement("div", {
|
|
104
|
+
className: "flex flex-col"
|
|
105
|
+
}, /* @__PURE__ */ import_react3.default.createElement(import_react_ui.Toolbar.Root, {
|
|
106
|
+
classNames: "p-2"
|
|
107
|
+
}, /* @__PURE__ */ import_react3.default.createElement(import_react_ui.Button, {
|
|
108
|
+
onClick: handleCreate
|
|
109
|
+
}, /* @__PURE__ */ import_react3.default.createElement(import_react_ui.Icon, {
|
|
110
|
+
icon: "ph--plus--regular"
|
|
111
|
+
}))));
|
|
112
|
+
};
|
|
113
|
+
var str = (...text) => text.filter((value) => value !== void 0 && value !== false).flat().join("\n");
|
|
114
|
+
var chainPresets = [
|
|
115
|
+
{
|
|
116
|
+
id: "dxos.org/prompt/translate",
|
|
117
|
+
title: "Translate",
|
|
118
|
+
createPrompt: () => (0, import_echo_schema.create)(import_chunk_N5IDAUFU.ChainPromptType, {
|
|
119
|
+
command: "say",
|
|
120
|
+
template: str(
|
|
121
|
+
// prettier-ignore
|
|
122
|
+
"Translate the following into {language}:",
|
|
123
|
+
"",
|
|
124
|
+
"---",
|
|
125
|
+
"",
|
|
126
|
+
"{input}"
|
|
127
|
+
),
|
|
128
|
+
inputs: [
|
|
129
|
+
{
|
|
130
|
+
type: import_chunk_N5IDAUFU.ChainInputType.VALUE,
|
|
131
|
+
name: "language",
|
|
132
|
+
value: "japanese"
|
|
133
|
+
},
|
|
134
|
+
{
|
|
135
|
+
type: import_chunk_N5IDAUFU.ChainInputType.PASS_THROUGH,
|
|
136
|
+
name: "input"
|
|
137
|
+
}
|
|
138
|
+
]
|
|
139
|
+
})
|
|
140
|
+
},
|
|
141
|
+
{
|
|
142
|
+
id: "dxos.org/prompt/chess",
|
|
143
|
+
title: "Chess",
|
|
144
|
+
createPrompt: () => (0, import_echo_schema.create)(import_chunk_N5IDAUFU.ChainPromptType, {
|
|
145
|
+
command: "hint",
|
|
146
|
+
template: str(
|
|
147
|
+
// prettier-ignore
|
|
148
|
+
"You are a machine that is an expert chess player.",
|
|
149
|
+
"",
|
|
150
|
+
"The move history of the current game is: {history}",
|
|
151
|
+
"",
|
|
152
|
+
"Suggest the next move and very briefly explain your strategy in a couple of sentences."
|
|
153
|
+
),
|
|
154
|
+
inputs: [
|
|
155
|
+
{
|
|
156
|
+
type: import_chunk_N5IDAUFU.ChainInputType.CONTEXT,
|
|
157
|
+
name: "history",
|
|
158
|
+
value: "object.pgn"
|
|
159
|
+
}
|
|
160
|
+
]
|
|
161
|
+
})
|
|
162
|
+
},
|
|
163
|
+
{
|
|
164
|
+
id: "dxos.org/prompt/mermaid",
|
|
165
|
+
title: "Mermaid",
|
|
166
|
+
createPrompt: () => (0, import_echo_schema.create)(import_chunk_N5IDAUFU.ChainPromptType, {
|
|
167
|
+
command: "draw",
|
|
168
|
+
template: str(
|
|
169
|
+
// prettier-ignore
|
|
170
|
+
"Create a simplified mermaid graph representing the text below.",
|
|
171
|
+
"Do not explain anything.",
|
|
172
|
+
"",
|
|
173
|
+
"---",
|
|
174
|
+
"",
|
|
175
|
+
"{input}"
|
|
176
|
+
),
|
|
177
|
+
inputs: [
|
|
178
|
+
{
|
|
179
|
+
type: import_chunk_N5IDAUFU.ChainInputType.PASS_THROUGH,
|
|
180
|
+
name: "input"
|
|
181
|
+
}
|
|
182
|
+
]
|
|
183
|
+
})
|
|
184
|
+
},
|
|
185
|
+
{
|
|
186
|
+
id: "dxos.org/prompt/list",
|
|
187
|
+
title: "List",
|
|
188
|
+
createPrompt: () => (0, import_echo_schema.create)(import_chunk_N5IDAUFU.ChainPromptType, {
|
|
189
|
+
command: "list",
|
|
190
|
+
template: str(
|
|
191
|
+
// prettier-ignore
|
|
192
|
+
"You are a machine that only replies with valid, iterable RFC8259 compliant JSON in your responses.",
|
|
193
|
+
"Your entire response should be a single array of JSON objects.",
|
|
194
|
+
"",
|
|
195
|
+
"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:",
|
|
196
|
+
"",
|
|
197
|
+
"{schema}",
|
|
198
|
+
"",
|
|
199
|
+
"---",
|
|
200
|
+
"",
|
|
201
|
+
"{question}"
|
|
202
|
+
),
|
|
203
|
+
inputs: [
|
|
204
|
+
{
|
|
205
|
+
type: import_chunk_N5IDAUFU.ChainInputType.SCHEMA,
|
|
206
|
+
name: "schema",
|
|
207
|
+
value: "example.com/type/project"
|
|
208
|
+
},
|
|
209
|
+
{
|
|
210
|
+
type: import_chunk_N5IDAUFU.ChainInputType.PASS_THROUGH,
|
|
211
|
+
name: "question"
|
|
212
|
+
}
|
|
213
|
+
]
|
|
214
|
+
})
|
|
215
|
+
},
|
|
216
|
+
{
|
|
217
|
+
id: "dxos.org/prompt/base",
|
|
218
|
+
title: "RAG",
|
|
219
|
+
createPrompt: () => (0, import_echo_schema.create)(import_chunk_N5IDAUFU.ChainPromptType, {
|
|
220
|
+
command: "rag",
|
|
221
|
+
template: str(
|
|
222
|
+
// prettier-ignore
|
|
223
|
+
"Very briefly answer the question based only on the following context and say if you don't know the answer.",
|
|
224
|
+
// 'answer the question using the following context as well as your training data:',
|
|
225
|
+
"",
|
|
226
|
+
"{context}",
|
|
227
|
+
"",
|
|
228
|
+
"---",
|
|
229
|
+
"",
|
|
230
|
+
"question: {question}"
|
|
231
|
+
),
|
|
232
|
+
inputs: [
|
|
233
|
+
{
|
|
234
|
+
type: import_chunk_N5IDAUFU.ChainInputType.RETRIEVER,
|
|
235
|
+
name: "context"
|
|
236
|
+
},
|
|
237
|
+
{
|
|
238
|
+
type: import_chunk_N5IDAUFU.ChainInputType.CONTEXT,
|
|
239
|
+
name: "question",
|
|
240
|
+
value: "object.text"
|
|
241
|
+
}
|
|
242
|
+
]
|
|
243
|
+
})
|
|
244
|
+
},
|
|
245
|
+
{
|
|
246
|
+
id: "dxos.org/prompt/lookup",
|
|
247
|
+
title: "Lookup",
|
|
248
|
+
createPrompt: () => (0, import_echo_schema.create)(import_chunk_N5IDAUFU.ChainPromptType, {
|
|
249
|
+
command: "lookup",
|
|
250
|
+
template: str(
|
|
251
|
+
// prettier-ignore
|
|
252
|
+
"Lookup and very briefly summarize the following topic in one or two sentences:",
|
|
253
|
+
"",
|
|
254
|
+
"---",
|
|
255
|
+
"",
|
|
256
|
+
"{input}"
|
|
257
|
+
),
|
|
258
|
+
inputs: [
|
|
259
|
+
{
|
|
260
|
+
type: import_chunk_N5IDAUFU.ChainInputType.CONTEXT,
|
|
261
|
+
name: "input",
|
|
262
|
+
value: "text"
|
|
263
|
+
}
|
|
264
|
+
]
|
|
265
|
+
})
|
|
266
|
+
},
|
|
267
|
+
{
|
|
268
|
+
id: "dxos.org/prompt/extract",
|
|
269
|
+
title: "Extract",
|
|
270
|
+
createPrompt: () => (0, import_echo_schema.create)(import_chunk_N5IDAUFU.ChainPromptType, {
|
|
271
|
+
command: "extract",
|
|
272
|
+
template: str(
|
|
273
|
+
// prettier-ignore
|
|
274
|
+
"List all people and companies mentioned in the text below.",
|
|
275
|
+
"",
|
|
276
|
+
"You are a machine that only replies with valid, iterable RFC8259 compliant JSON in your responses.",
|
|
277
|
+
"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:",
|
|
278
|
+
"",
|
|
279
|
+
"{contact}",
|
|
280
|
+
"{company}",
|
|
281
|
+
"",
|
|
282
|
+
"---",
|
|
283
|
+
"",
|
|
284
|
+
"{input}"
|
|
285
|
+
),
|
|
286
|
+
inputs: [
|
|
287
|
+
{
|
|
288
|
+
type: import_chunk_N5IDAUFU.ChainInputType.SCHEMA,
|
|
289
|
+
name: "contact",
|
|
290
|
+
value: "example.com/type/contact"
|
|
291
|
+
},
|
|
292
|
+
{
|
|
293
|
+
type: import_chunk_N5IDAUFU.ChainInputType.SCHEMA,
|
|
294
|
+
name: "company",
|
|
295
|
+
value: "example.com/type/organization"
|
|
296
|
+
},
|
|
297
|
+
{
|
|
298
|
+
type: import_chunk_N5IDAUFU.ChainInputType.CONTEXT,
|
|
299
|
+
name: "input",
|
|
300
|
+
value: "text"
|
|
301
|
+
}
|
|
302
|
+
]
|
|
303
|
+
})
|
|
304
|
+
},
|
|
305
|
+
{
|
|
306
|
+
id: "dxos.org/prompt/discord",
|
|
307
|
+
title: "Summarize",
|
|
308
|
+
createPrompt: () => (0, import_echo_schema.create)(import_chunk_N5IDAUFU.ChainPromptType, {
|
|
309
|
+
command: "summarize",
|
|
310
|
+
template: str(
|
|
311
|
+
// prettier-ignore
|
|
312
|
+
"Summarize what the team is working on and format it as a markdown table without any explanation.",
|
|
313
|
+
"",
|
|
314
|
+
"---",
|
|
315
|
+
"",
|
|
316
|
+
"{context}"
|
|
317
|
+
),
|
|
318
|
+
inputs: [
|
|
319
|
+
{
|
|
320
|
+
type: import_chunk_N5IDAUFU.ChainInputType.RESOLVER,
|
|
321
|
+
name: "context",
|
|
322
|
+
value: "discord.messages.recent"
|
|
323
|
+
}
|
|
324
|
+
]
|
|
325
|
+
})
|
|
326
|
+
}
|
|
327
|
+
];
|
|
328
|
+
var Chain = ({ chain }) => {
|
|
329
|
+
const space = (0, import_echo2.getSpace)(chain);
|
|
330
|
+
if (!space) {
|
|
331
|
+
return null;
|
|
332
|
+
}
|
|
333
|
+
const handleSelectPreset = (preset) => {
|
|
334
|
+
chain.name = preset.title;
|
|
335
|
+
chain.prompts?.filter(import_util.nonNullable).forEach((prompt) => space.db.remove(prompt));
|
|
336
|
+
chain.prompts = [
|
|
337
|
+
preset.createPrompt()
|
|
338
|
+
];
|
|
339
|
+
};
|
|
340
|
+
return /* @__PURE__ */ import_react4.default.createElement("div", {
|
|
341
|
+
className: "flex flex-col my-2 gap-4"
|
|
342
|
+
}, chain.prompts?.filter(import_util.nonNullable).map((prompt, i) => /* @__PURE__ */ import_react4.default.createElement(import_chunk_E2H3AGKB.PromptEditor, {
|
|
343
|
+
key: i,
|
|
344
|
+
prompt
|
|
345
|
+
})), /* @__PURE__ */ import_react4.default.createElement("div", {
|
|
346
|
+
className: "p-2"
|
|
347
|
+
}, /* @__PURE__ */ import_react4.default.createElement(ChainPresets, {
|
|
348
|
+
presets: chainPresets,
|
|
349
|
+
onSelect: handleSelectPreset
|
|
350
|
+
})));
|
|
351
|
+
};
|
|
352
|
+
var ChainPresets = ({ presets, onSelect }) => {
|
|
353
|
+
const { t } = (0, import_react_ui2.useTranslation)(import_chunk_UPPUTAPL.AUTOMATION_PLUGIN);
|
|
354
|
+
return /* @__PURE__ */ import_react4.default.createElement(import_react_ui2.Select.Root, {
|
|
355
|
+
onValueChange: (value) => {
|
|
356
|
+
onSelect(presets.find(({ id }) => id === value));
|
|
357
|
+
}
|
|
358
|
+
}, /* @__PURE__ */ import_react4.default.createElement(import_react_ui2.Select.TriggerButton, {
|
|
359
|
+
classNames: "w-full",
|
|
360
|
+
placeholder: t("select preset template placeholder")
|
|
361
|
+
}), /* @__PURE__ */ import_react4.default.createElement(import_react_ui2.Select.Portal, null, /* @__PURE__ */ import_react4.default.createElement(import_react_ui2.Select.Content, null, /* @__PURE__ */ import_react4.default.createElement(import_react_ui2.Select.Viewport, null, presets.map(({ id, title }) => /* @__PURE__ */ import_react4.default.createElement(import_react_ui2.Select.Option, {
|
|
362
|
+
key: id,
|
|
363
|
+
value: id
|
|
364
|
+
}, title))))));
|
|
365
|
+
};
|
|
366
|
+
var InputRow = ({ label, children }) => /* @__PURE__ */ import_react6.default.createElement(import_react_ui4.Input.Root, null, /* @__PURE__ */ import_react6.default.createElement("tr", null, /* @__PURE__ */ import_react6.default.createElement("td", {
|
|
367
|
+
className: "w-[80px] px-2 text-right align-top pt-3 overflow-hidden"
|
|
368
|
+
}, /* @__PURE__ */ import_react6.default.createElement(import_react_ui4.Input.Label, {
|
|
369
|
+
classNames: "truncate text-xs"
|
|
370
|
+
}, label)), /* @__PURE__ */ import_react6.default.createElement("td", {
|
|
371
|
+
className: "p-1 pr-2"
|
|
372
|
+
}, children)));
|
|
373
|
+
var __dxlog_file = "/home/runner/work/dxos/dxos/packages/plugins/experimental/plugin-automation/src/components/TriggerEditor/email.ts";
|
|
374
|
+
var SOURCE_ID = "hub.dxos.network/api/mailbox";
|
|
375
|
+
var handleEmail = async (space, data) => {
|
|
376
|
+
const { messages } = data;
|
|
377
|
+
const { objects: mailboxes } = await space.db.query(import_echo4.Filter.schema(import_types4.MailboxType)).run();
|
|
378
|
+
const mailbox = mailboxes[0] ?? space.db.add((0, import_echo_schema2.create)(import_types4.MailboxType, {
|
|
379
|
+
messages: []
|
|
380
|
+
}));
|
|
381
|
+
import_log3.log.info("messages", {
|
|
382
|
+
count: messages.length,
|
|
383
|
+
existingMailbox: mailboxes.length > 0
|
|
384
|
+
}, {
|
|
385
|
+
F: __dxlog_file,
|
|
386
|
+
L: 21,
|
|
387
|
+
S: void 0,
|
|
388
|
+
C: (f, a) => f(...a)
|
|
389
|
+
});
|
|
390
|
+
const { objects } = await space.db.query(import_echo4.Filter.schema(import_types5.MessageType)).run();
|
|
391
|
+
for (const message of messages) {
|
|
392
|
+
let object = (0, import_echo_db2.findObjectWithForeignKey)(objects, {
|
|
393
|
+
source: SOURCE_ID,
|
|
394
|
+
id: String(message.id)
|
|
395
|
+
});
|
|
396
|
+
if (!object) {
|
|
397
|
+
object = space.db.add((0, import_echo_schema2.create)(import_types5.MessageType, {
|
|
398
|
+
sender: {
|
|
399
|
+
email: message.from
|
|
400
|
+
},
|
|
401
|
+
timestamp: new Date(message.created).toISOString(),
|
|
402
|
+
text: message.body,
|
|
403
|
+
properties: {
|
|
404
|
+
subject: message.subject,
|
|
405
|
+
to: [
|
|
406
|
+
{
|
|
407
|
+
email: message.to
|
|
408
|
+
}
|
|
409
|
+
]
|
|
410
|
+
}
|
|
411
|
+
}, {
|
|
412
|
+
keys: [
|
|
413
|
+
(0, import_echo_schema2.foreignKey)(SOURCE_ID, String(message.id))
|
|
414
|
+
]
|
|
415
|
+
}));
|
|
416
|
+
mailbox.messages?.push(object);
|
|
417
|
+
}
|
|
418
|
+
}
|
|
419
|
+
return 200;
|
|
420
|
+
};
|
|
421
|
+
var __dxlog_file2 = "/home/runner/work/dxos/dxos/packages/plugins/experimental/plugin-automation/src/components/TriggerEditor/invokation-handler.ts";
|
|
422
|
+
var MAX_RETRIES = 3;
|
|
423
|
+
var RETRY_DELAY = 1e3;
|
|
424
|
+
var callFunction = async (funcUrl, trigger, data) => {
|
|
425
|
+
const body = {
|
|
426
|
+
event: "trigger",
|
|
427
|
+
trigger,
|
|
428
|
+
data
|
|
429
|
+
};
|
|
430
|
+
let retryCount = 0;
|
|
431
|
+
while (retryCount < MAX_RETRIES) {
|
|
432
|
+
import_log2.log.info("exec", {
|
|
433
|
+
funcUrl,
|
|
434
|
+
body,
|
|
435
|
+
retryCount
|
|
436
|
+
}, {
|
|
437
|
+
F: __dxlog_file2,
|
|
438
|
+
L: 26,
|
|
439
|
+
S: void 0,
|
|
440
|
+
C: (f, a) => f(...a)
|
|
441
|
+
});
|
|
442
|
+
const response = await fetch(funcUrl, {
|
|
443
|
+
method: "POST",
|
|
444
|
+
headers: {
|
|
445
|
+
"Content-Type": "application/json"
|
|
446
|
+
},
|
|
447
|
+
body: JSON.stringify(body)
|
|
448
|
+
});
|
|
449
|
+
const data2 = await response.text();
|
|
450
|
+
import_log2.log.info("response", {
|
|
451
|
+
status: response.status,
|
|
452
|
+
body: data2
|
|
453
|
+
}, {
|
|
454
|
+
F: __dxlog_file2,
|
|
455
|
+
L: 36,
|
|
456
|
+
S: void 0,
|
|
457
|
+
C: (f, a) => f(...a)
|
|
458
|
+
});
|
|
459
|
+
if (response.status === 409) {
|
|
460
|
+
retryCount++;
|
|
461
|
+
await (0, import_async2.sleep)(RETRY_DELAY * Math.min(retryCount, 2));
|
|
462
|
+
continue;
|
|
463
|
+
}
|
|
464
|
+
return {
|
|
465
|
+
status: response.status,
|
|
466
|
+
data: data2
|
|
467
|
+
};
|
|
468
|
+
}
|
|
469
|
+
return {
|
|
470
|
+
status: 500
|
|
471
|
+
};
|
|
472
|
+
};
|
|
473
|
+
var invokeFunction = async (client, space, trigger, data) => {
|
|
474
|
+
try {
|
|
475
|
+
if (trigger.spec.type === "websocket") {
|
|
476
|
+
return handleEmail(space, data.data);
|
|
477
|
+
}
|
|
478
|
+
const script = await space.crud.query({
|
|
479
|
+
id: trigger.function
|
|
480
|
+
}).first();
|
|
481
|
+
const { objects: functions } = await space.crud.query({
|
|
482
|
+
__typename: import_plugin_script.FunctionType.typename
|
|
483
|
+
}).run();
|
|
484
|
+
const func = functions.find((fn) => referenceEquals(fn.source, trigger.function));
|
|
485
|
+
const funcSlug = func?.__meta.keys.find((key) => key.source === USERFUNCTIONS_META_KEY)?.id;
|
|
486
|
+
if (!funcSlug) {
|
|
487
|
+
import_log2.log.warn("function not deployed", {
|
|
488
|
+
scriptId: script.id,
|
|
489
|
+
name: script.name
|
|
490
|
+
}, {
|
|
491
|
+
F: __dxlog_file2,
|
|
492
|
+
L: 59,
|
|
493
|
+
S: void 0,
|
|
494
|
+
C: (f, a) => f(...a)
|
|
495
|
+
});
|
|
496
|
+
return 404;
|
|
497
|
+
}
|
|
498
|
+
const funcUrl = getFunctionUrl(client.config, funcSlug, space.id);
|
|
499
|
+
const triggerData = {
|
|
500
|
+
...(0, import_echo_db.getObjectCore)(trigger).toPlainObject(),
|
|
501
|
+
// TODO: Remove when functions can query by DXN.
|
|
502
|
+
promptId: trigger.meta?.prompt?.id
|
|
503
|
+
};
|
|
504
|
+
return (await callFunction(funcUrl, triggerData, data)).status;
|
|
505
|
+
} catch (err) {
|
|
506
|
+
return 400;
|
|
507
|
+
}
|
|
508
|
+
};
|
|
509
|
+
var USERFUNCTIONS_META_KEY = "dxos.org/service/function";
|
|
510
|
+
var getFunctionUrl = (config, slug, spaceId) => {
|
|
511
|
+
const baseUrl = new URL("functions/", config.values.runtime?.services?.edge?.url);
|
|
512
|
+
const relativeUrl = slug.replace(/^\//, "");
|
|
513
|
+
const url = new URL(`./${relativeUrl}`, baseUrl.toString());
|
|
514
|
+
spaceId && url.searchParams.set("spaceId", spaceId);
|
|
515
|
+
url.protocol = "https";
|
|
516
|
+
return url.toString();
|
|
517
|
+
};
|
|
518
|
+
var referenceEquals = (a, b) => {
|
|
519
|
+
const aDXN = toDXN(a);
|
|
520
|
+
const bDXN = toDXN(b);
|
|
521
|
+
return aDXN.toString() === bDXN.toString();
|
|
522
|
+
};
|
|
523
|
+
var toDXN = (ref) => {
|
|
524
|
+
if (typeof ref === "string") {
|
|
525
|
+
if (ref.startsWith("dxn:")) {
|
|
526
|
+
return import_keys.DXN.parse(ref);
|
|
527
|
+
} else {
|
|
528
|
+
return new import_keys.DXN(import_keys.DXN.kind.ECHO, [
|
|
529
|
+
import_keys.LOCAL_SPACE_TAG,
|
|
530
|
+
ref
|
|
531
|
+
]);
|
|
532
|
+
}
|
|
533
|
+
}
|
|
534
|
+
(0, import_invariant2.invariant)(typeof ref["/"] === "string", void 0, {
|
|
535
|
+
F: __dxlog_file2,
|
|
536
|
+
L: 108,
|
|
537
|
+
S: void 0,
|
|
538
|
+
A: [
|
|
539
|
+
"typeof ref['/'] === 'string'",
|
|
540
|
+
""
|
|
541
|
+
]
|
|
542
|
+
});
|
|
543
|
+
return import_keys.DXN.parse(ref["/"]);
|
|
544
|
+
};
|
|
545
|
+
var stateInitialValues = {
|
|
546
|
+
schemas: [
|
|
547
|
+
// TODO(burdon): Get all schema from API.
|
|
548
|
+
import_plugin_markdown.DocumentType,
|
|
549
|
+
import_types7.FileType,
|
|
550
|
+
import_types6.GameType,
|
|
551
|
+
import_plugin_space.MessageType,
|
|
552
|
+
import_types8.DiagramType,
|
|
553
|
+
import_plugin_space.CollectionType
|
|
554
|
+
],
|
|
555
|
+
selectedSchema: {}
|
|
556
|
+
};
|
|
557
|
+
var state = (0, import_echo_schema3.create)(stateInitialValues);
|
|
558
|
+
var USERFUNCTIONS_PRESET_META_KEY = "dxos.org/service/function-preset";
|
|
559
|
+
var getFunctionMetaExtension = (trigger, script) => {
|
|
560
|
+
if (script) {
|
|
561
|
+
const meta = (0, import_echo_schema3.getMeta)(script).keys.find((key) => key.source === USERFUNCTIONS_PRESET_META_KEY);
|
|
562
|
+
const extension = meta && metaExtensions[meta.id];
|
|
563
|
+
if (extension) {
|
|
564
|
+
return extension;
|
|
565
|
+
}
|
|
566
|
+
}
|
|
567
|
+
return trigger?.function ? metaExtensions[trigger.function] : metaExtensions["dxos.org/function/gpt"];
|
|
568
|
+
};
|
|
569
|
+
var DefaultMetaProps = ({ meta }) => {
|
|
570
|
+
return /* @__PURE__ */ import_react7.default.createElement(import_react7.default.Fragment, null);
|
|
571
|
+
};
|
|
572
|
+
var ChessMetaProps = ({ meta }) => {
|
|
573
|
+
if (!meta) {
|
|
574
|
+
return null;
|
|
575
|
+
}
|
|
576
|
+
return /* @__PURE__ */ import_react7.default.createElement(import_react7.default.Fragment, null, /* @__PURE__ */ import_react7.default.createElement(InputRow, {
|
|
577
|
+
label: "Level"
|
|
578
|
+
}, /* @__PURE__ */ import_react7.default.createElement(import_react_ui5.Input.TextInput, {
|
|
579
|
+
type: "number",
|
|
580
|
+
value: meta.level ?? 1,
|
|
581
|
+
onChange: (event) => meta.level = (0, import_util3.safeParseInt)(event.target.value),
|
|
582
|
+
placeholder: "Engine strength."
|
|
583
|
+
})));
|
|
584
|
+
};
|
|
585
|
+
var EmailWorkerMetaProps = ({ meta }) => {
|
|
586
|
+
if (!meta) {
|
|
587
|
+
return null;
|
|
588
|
+
}
|
|
589
|
+
return /* @__PURE__ */ import_react7.default.createElement(import_react7.default.Fragment, null, /* @__PURE__ */ import_react7.default.createElement(InputRow, {
|
|
590
|
+
label: "Account"
|
|
591
|
+
}, /* @__PURE__ */ import_react7.default.createElement(import_react_ui5.Input.TextInput, {
|
|
592
|
+
value: meta.account ?? "",
|
|
593
|
+
onChange: (event) => meta.account = event.target.value,
|
|
594
|
+
placeholder: "https://"
|
|
595
|
+
})));
|
|
596
|
+
};
|
|
597
|
+
var ChainPromptMetaProps = ({ meta, triggerId }) => {
|
|
598
|
+
const schema = triggerId ? state.selectedSchema[triggerId] : void 0;
|
|
599
|
+
if (!meta) {
|
|
600
|
+
return null;
|
|
601
|
+
}
|
|
602
|
+
return /* @__PURE__ */ import_react7.default.createElement(import_react7.default.Fragment, null, /* @__PURE__ */ import_react7.default.createElement(InputRow, {
|
|
603
|
+
label: "Model"
|
|
604
|
+
}, /* @__PURE__ */ import_react7.default.createElement(import_react_ui5.Input.TextInput, {
|
|
605
|
+
value: meta.model ?? "",
|
|
606
|
+
onChange: (event) => meta.model = event.target.value,
|
|
607
|
+
placeholder: "llama2"
|
|
608
|
+
})), /* @__PURE__ */ import_react7.default.createElement(InputRow, {
|
|
609
|
+
label: "Presets"
|
|
610
|
+
}, /* @__PURE__ */ import_react7.default.createElement(ChainPresets, {
|
|
611
|
+
presets: chainPresets,
|
|
612
|
+
onSelect: (preset) => {
|
|
613
|
+
meta.prompt = preset.createPrompt();
|
|
614
|
+
}
|
|
615
|
+
})), meta.prompt && /* @__PURE__ */ import_react7.default.createElement(InputRow, {
|
|
616
|
+
label: "Prompt"
|
|
617
|
+
}, /* @__PURE__ */ import_react7.default.createElement(import_chunk_E2H3AGKB.PromptEditor, {
|
|
618
|
+
prompt: meta.prompt,
|
|
619
|
+
schema
|
|
620
|
+
})));
|
|
621
|
+
};
|
|
622
|
+
var EmbeddingMetaProps = ({ meta }) => {
|
|
623
|
+
if (!meta) {
|
|
624
|
+
return null;
|
|
625
|
+
}
|
|
626
|
+
return /* @__PURE__ */ import_react7.default.createElement(import_react7.default.Fragment, null, /* @__PURE__ */ import_react7.default.createElement(InputRow, {
|
|
627
|
+
label: "Model"
|
|
628
|
+
}, /* @__PURE__ */ import_react7.default.createElement(import_react_ui5.Input.TextInput, {
|
|
629
|
+
value: meta.model ?? "",
|
|
630
|
+
onChange: (event) => meta.model = event.target.value,
|
|
631
|
+
placeholder: "llama2"
|
|
632
|
+
})));
|
|
633
|
+
};
|
|
634
|
+
var metaExtensions = {
|
|
635
|
+
__DEFAULT__: {
|
|
636
|
+
initialValue: () => ({}),
|
|
637
|
+
component: DefaultMetaProps
|
|
638
|
+
},
|
|
639
|
+
"dxos.org/function/chess": {
|
|
640
|
+
initialValue: () => ({
|
|
641
|
+
level: 2
|
|
642
|
+
}),
|
|
643
|
+
component: ChessMetaProps
|
|
644
|
+
},
|
|
645
|
+
"dxos.org/function/email-worker": {
|
|
646
|
+
initialValue: () => ({
|
|
647
|
+
account: "hello@dxos.network"
|
|
648
|
+
}),
|
|
649
|
+
component: EmailWorkerMetaProps
|
|
650
|
+
},
|
|
651
|
+
"dxos.org/function/gpt": {
|
|
652
|
+
initialValue: () => ({
|
|
653
|
+
model: "llama2"
|
|
654
|
+
}),
|
|
655
|
+
component: ChainPromptMetaProps
|
|
656
|
+
},
|
|
657
|
+
"dxos.org/function/embedding": {
|
|
658
|
+
initialValue: () => ({
|
|
659
|
+
model: "llama2"
|
|
660
|
+
}),
|
|
661
|
+
component: EmbeddingMetaProps
|
|
662
|
+
}
|
|
663
|
+
};
|
|
664
|
+
var __dxlog_file3 = "/home/runner/work/dxos/dxos/packages/plugins/experimental/plugin-automation/src/components/TriggerEditor/TriggerEditor.tsx";
|
|
665
|
+
var triggerTypes = [
|
|
666
|
+
"subscription",
|
|
667
|
+
"timer",
|
|
668
|
+
"webhook",
|
|
669
|
+
"websocket"
|
|
670
|
+
];
|
|
671
|
+
var registerTriggersMutex = new import_async.Mutex();
|
|
672
|
+
var TriggerEditor = ({ space, trigger }) => {
|
|
673
|
+
const client = (0, import_react_client.useClient)();
|
|
674
|
+
const scripts = (0, import_echo3.useQuery)(space, import_echo3.Filter.schema(import_types3.ScriptType));
|
|
675
|
+
const script = (0, import_react5.useMemo)(() => scripts.find((script2) => script2.id === trigger.function), [
|
|
676
|
+
trigger.function,
|
|
677
|
+
scripts
|
|
678
|
+
]);
|
|
679
|
+
const [registry] = (0, import_react5.useState)(/* @__PURE__ */ new Map());
|
|
680
|
+
const triggers = (0, import_echo3.useQuery)(space, import_echo3.Filter.schema(import_types2.FunctionTrigger));
|
|
681
|
+
(0, import_react5.useEffect)(() => {
|
|
682
|
+
setTimeout(async () => {
|
|
683
|
+
await registerTriggersMutex.executeSynchronized(async () => {
|
|
684
|
+
const deprecated = new Set(Array.from(registry.keys()));
|
|
685
|
+
import_log.log.info("triggers", {
|
|
686
|
+
deprecated,
|
|
687
|
+
all: triggers.map((t) => t.id),
|
|
688
|
+
enabled: triggers.filter((t) => t.enabled).map((t) => t.id)
|
|
689
|
+
}, {
|
|
690
|
+
F: __dxlog_file3,
|
|
691
|
+
L: 47,
|
|
692
|
+
S: void 0,
|
|
693
|
+
C: (f, a) => f(...a)
|
|
694
|
+
});
|
|
695
|
+
for (const trigger2 of triggers) {
|
|
696
|
+
if (trigger2.enabled) {
|
|
697
|
+
if (registry.has(trigger2.id)) {
|
|
698
|
+
deprecated.delete(trigger2.id);
|
|
699
|
+
continue;
|
|
700
|
+
}
|
|
701
|
+
import_log.log.info("activating trigger", trigger2.id, {
|
|
702
|
+
F: __dxlog_file3,
|
|
703
|
+
L: 59,
|
|
704
|
+
S: void 0,
|
|
705
|
+
C: (f, a) => f(...a)
|
|
706
|
+
});
|
|
707
|
+
const ctx = new import_context.Context(void 0, {
|
|
708
|
+
F: __dxlog_file3,
|
|
709
|
+
L: 61
|
|
710
|
+
});
|
|
711
|
+
registry.set(trigger2.id, ctx);
|
|
712
|
+
const triggerSpec = trigger2.spec;
|
|
713
|
+
let triggerFactory;
|
|
714
|
+
if (triggerSpec.type === "subscription") {
|
|
715
|
+
triggerFactory = import_functions.createSubscriptionTrigger;
|
|
716
|
+
} else if (triggerSpec.type === "websocket") {
|
|
717
|
+
triggerFactory = import_functions.createWebsocketTrigger;
|
|
718
|
+
} else {
|
|
719
|
+
import_log.log.info("unsupported trigger", {
|
|
720
|
+
type: triggerSpec.type
|
|
721
|
+
}, {
|
|
722
|
+
F: __dxlog_file3,
|
|
723
|
+
L: 71,
|
|
724
|
+
S: void 0,
|
|
725
|
+
C: (f, a) => f(...a)
|
|
726
|
+
});
|
|
727
|
+
continue;
|
|
728
|
+
}
|
|
729
|
+
await triggerFactory(ctx, space, trigger2.spec, (data) => {
|
|
730
|
+
return invokeFunction(client, space, trigger2, data);
|
|
731
|
+
});
|
|
732
|
+
}
|
|
733
|
+
}
|
|
734
|
+
for (const id of deprecated) {
|
|
735
|
+
const ctx = registry.get(id);
|
|
736
|
+
if (ctx) {
|
|
737
|
+
await ctx.dispose();
|
|
738
|
+
registry.delete(id);
|
|
739
|
+
}
|
|
740
|
+
}
|
|
741
|
+
});
|
|
742
|
+
});
|
|
743
|
+
}, [
|
|
744
|
+
JSON.stringify(triggers)
|
|
745
|
+
]);
|
|
746
|
+
(0, import_react5.useEffect)(() => {
|
|
747
|
+
return () => {
|
|
748
|
+
for (const ctx of registry.values()) {
|
|
749
|
+
void ctx.dispose();
|
|
750
|
+
}
|
|
751
|
+
};
|
|
752
|
+
}, []);
|
|
753
|
+
(0, import_react5.useEffect)(() => {
|
|
754
|
+
void space.db.schema.list().then((schemas) => {
|
|
755
|
+
state.schemas = (0, import_util2.distinctBy)([
|
|
756
|
+
...state.schemas,
|
|
757
|
+
...schemas
|
|
758
|
+
], (schema) => schema.typename).sort((a, b) => a.typename < b.typename ? -1 : 1);
|
|
759
|
+
}).catch(() => {
|
|
760
|
+
});
|
|
761
|
+
}, [
|
|
762
|
+
space
|
|
763
|
+
]);
|
|
764
|
+
(0, import_react5.useEffect)(() => {
|
|
765
|
+
const spec = trigger.spec;
|
|
766
|
+
if (spec.type === "subscription") {
|
|
767
|
+
if (spec.filter && spec.filter.length > 0) {
|
|
768
|
+
const type = spec.filter[0].type;
|
|
769
|
+
const foundSchema = state.schemas.find((schema) => schema.typename === type);
|
|
770
|
+
if (foundSchema) {
|
|
771
|
+
state.selectedSchema[trigger.id] = foundSchema;
|
|
772
|
+
}
|
|
773
|
+
}
|
|
774
|
+
}
|
|
775
|
+
}, [
|
|
776
|
+
JSON.stringify(trigger.spec),
|
|
777
|
+
state.schemas
|
|
778
|
+
]);
|
|
779
|
+
(0, import_react5.useEffect)(() => {
|
|
780
|
+
if (!trigger.meta) {
|
|
781
|
+
const extension = getFunctionMetaExtension(trigger, script);
|
|
782
|
+
trigger.meta = extension?.initialValue?.();
|
|
783
|
+
}
|
|
784
|
+
}, [
|
|
785
|
+
trigger.function,
|
|
786
|
+
trigger.meta
|
|
787
|
+
]);
|
|
788
|
+
const handleSelectFunction = (value) => {
|
|
789
|
+
const match = scripts.find((fn) => fn.id === value);
|
|
790
|
+
if (match) {
|
|
791
|
+
trigger.function = match.id;
|
|
792
|
+
}
|
|
793
|
+
};
|
|
794
|
+
const handleSelectTriggerType = (triggerType) => {
|
|
795
|
+
switch (triggerType) {
|
|
796
|
+
case "subscription": {
|
|
797
|
+
trigger.spec = {
|
|
798
|
+
type: "subscription",
|
|
799
|
+
filter: []
|
|
800
|
+
};
|
|
801
|
+
break;
|
|
802
|
+
}
|
|
803
|
+
case "timer": {
|
|
804
|
+
trigger.spec = {
|
|
805
|
+
type: "timer",
|
|
806
|
+
cron: "0 0 * * *"
|
|
807
|
+
};
|
|
808
|
+
break;
|
|
809
|
+
}
|
|
810
|
+
case "webhook": {
|
|
811
|
+
trigger.spec = {
|
|
812
|
+
type: "webhook",
|
|
813
|
+
method: "GET"
|
|
814
|
+
};
|
|
815
|
+
break;
|
|
816
|
+
}
|
|
817
|
+
case "websocket": {
|
|
818
|
+
trigger.spec = {
|
|
819
|
+
type: "websocket",
|
|
820
|
+
url: "",
|
|
821
|
+
init: {
|
|
822
|
+
type: "sync"
|
|
823
|
+
}
|
|
824
|
+
};
|
|
825
|
+
break;
|
|
826
|
+
}
|
|
827
|
+
}
|
|
828
|
+
};
|
|
829
|
+
const TriggerMeta = getFunctionMetaExtension(trigger, script)?.component;
|
|
830
|
+
return /* @__PURE__ */ import_react5.default.createElement("div", {
|
|
831
|
+
className: "flex flex-col py-1"
|
|
832
|
+
}, /* @__PURE__ */ import_react5.default.createElement("table", {
|
|
833
|
+
className: "is-full table-fixed"
|
|
834
|
+
}, /* @__PURE__ */ import_react5.default.createElement("tbody", null, /* @__PURE__ */ import_react5.default.createElement(InputRow, {
|
|
835
|
+
label: "Function"
|
|
836
|
+
}, /* @__PURE__ */ import_react5.default.createElement(import_react_ui3.Select.Root, {
|
|
837
|
+
value: script?.id,
|
|
838
|
+
onValueChange: handleSelectFunction
|
|
839
|
+
}, /* @__PURE__ */ import_react5.default.createElement(import_react_ui3.Select.TriggerButton, {
|
|
840
|
+
placeholder: "Select function"
|
|
841
|
+
}), /* @__PURE__ */ import_react5.default.createElement(import_react_ui3.Select.Portal, null, /* @__PURE__ */ import_react5.default.createElement(import_react_ui3.Select.Content, null, /* @__PURE__ */ import_react5.default.createElement(import_react_ui3.Select.Viewport, null, scripts.map(({ id, name }) => /* @__PURE__ */ import_react5.default.createElement(import_react_ui3.Select.Option, {
|
|
842
|
+
key: id,
|
|
843
|
+
value: id
|
|
844
|
+
}, name ?? "Unnamed"))))))), script?.description?.length && /* @__PURE__ */ import_react5.default.createElement(InputRow, null, /* @__PURE__ */ import_react5.default.createElement("div", {
|
|
845
|
+
className: "px-2"
|
|
846
|
+
}, /* @__PURE__ */ import_react5.default.createElement("p", {
|
|
847
|
+
className: "text-sm text-description"
|
|
848
|
+
}, script?.description?.length))), /* @__PURE__ */ import_react5.default.createElement(InputRow, {
|
|
849
|
+
label: "Type"
|
|
850
|
+
}, /* @__PURE__ */ import_react5.default.createElement(import_react_ui3.Select.Root, {
|
|
851
|
+
value: trigger.spec?.type,
|
|
852
|
+
onValueChange: handleSelectTriggerType
|
|
853
|
+
}, /* @__PURE__ */ import_react5.default.createElement(import_react_ui3.Select.TriggerButton, {
|
|
854
|
+
placeholder: "Select trigger"
|
|
855
|
+
}), /* @__PURE__ */ import_react5.default.createElement(import_react_ui3.Select.Portal, null, /* @__PURE__ */ import_react5.default.createElement(import_react_ui3.Select.Content, null, /* @__PURE__ */ import_react5.default.createElement(import_react_ui3.Select.Viewport, null, triggerTypes.map((trigger2) => /* @__PURE__ */ import_react5.default.createElement(import_react_ui3.Select.Option, {
|
|
856
|
+
key: trigger2,
|
|
857
|
+
value: trigger2
|
|
858
|
+
}, trigger2)))))))), /* @__PURE__ */ import_react5.default.createElement("tbody", null, trigger.spec && /* @__PURE__ */ import_react5.default.createElement(TriggerSpec, {
|
|
859
|
+
space,
|
|
860
|
+
spec: trigger.spec
|
|
861
|
+
}), /* @__PURE__ */ import_react5.default.createElement(InputRow, {
|
|
862
|
+
label: "Enabled"
|
|
863
|
+
}, /* @__PURE__ */ import_react5.default.createElement("div", {
|
|
864
|
+
className: "flex items-center h-8"
|
|
865
|
+
}, /* @__PURE__ */ import_react5.default.createElement(import_react_ui3.Input.Switch, {
|
|
866
|
+
checked: trigger.enabled,
|
|
867
|
+
onCheckedChange: (checked) => trigger.enabled = !!checked
|
|
868
|
+
})))), TriggerMeta && /* @__PURE__ */ import_react5.default.createElement("tbody", null, /* @__PURE__ */ import_react5.default.createElement("tr", null, /* @__PURE__ */ import_react5.default.createElement("td", null), /* @__PURE__ */ import_react5.default.createElement("td", {
|
|
869
|
+
className: "py-2"
|
|
870
|
+
}, /* @__PURE__ */ import_react5.default.createElement("div", {
|
|
871
|
+
className: "border-b border-separator"
|
|
872
|
+
}))), /* @__PURE__ */ import_react5.default.createElement(TriggerMeta, {
|
|
873
|
+
meta: trigger.meta
|
|
874
|
+
}))));
|
|
875
|
+
};
|
|
876
|
+
var TriggerSpecSubscription = ({ spec }) => {
|
|
877
|
+
if (!spec.filter) {
|
|
878
|
+
return null;
|
|
879
|
+
}
|
|
880
|
+
const handleSelectSchema = (typename) => {
|
|
881
|
+
spec.filter = [
|
|
882
|
+
{
|
|
883
|
+
type: typename
|
|
884
|
+
}
|
|
885
|
+
];
|
|
886
|
+
};
|
|
887
|
+
return /* @__PURE__ */ import_react5.default.createElement(import_react5.default.Fragment, null, /* @__PURE__ */ import_react5.default.createElement(InputRow, {
|
|
888
|
+
label: "Filter"
|
|
889
|
+
}, /* @__PURE__ */ import_react5.default.createElement(import_react_ui3.Select.Root, {
|
|
890
|
+
value: spec.filter.length > 0 ? spec.filter[0].type : void 0,
|
|
891
|
+
onValueChange: handleSelectSchema
|
|
892
|
+
}, /* @__PURE__ */ import_react5.default.createElement(import_react_ui3.Select.TriggerButton, {
|
|
893
|
+
classNames: "w-full",
|
|
894
|
+
placeholder: "Select type"
|
|
895
|
+
}), /* @__PURE__ */ import_react5.default.createElement(import_react_ui3.Select.Portal, null, /* @__PURE__ */ import_react5.default.createElement(import_react_ui3.Select.Content, null, /* @__PURE__ */ import_react5.default.createElement(import_react_ui3.Select.Viewport, null, state.schemas.map(({ typename }) => /* @__PURE__ */ import_react5.default.createElement(import_react_ui3.Select.Option, {
|
|
896
|
+
key: typename,
|
|
897
|
+
value: typename
|
|
898
|
+
}, typename))))))));
|
|
899
|
+
};
|
|
900
|
+
var TriggerSpecTimer = ({ spec }) => /* @__PURE__ */ import_react5.default.createElement(import_react5.default.Fragment, null, /* @__PURE__ */ import_react5.default.createElement(InputRow, {
|
|
901
|
+
label: "Cron"
|
|
902
|
+
}, /* @__PURE__ */ import_react5.default.createElement(import_react_ui3.Input.TextInput, {
|
|
903
|
+
value: spec.cron,
|
|
904
|
+
onChange: (event) => spec.cron = event.target.value
|
|
905
|
+
})));
|
|
906
|
+
var methods = [
|
|
907
|
+
"GET",
|
|
908
|
+
"POST"
|
|
909
|
+
];
|
|
910
|
+
var TriggerSpecWebhook = ({ spec }) => /* @__PURE__ */ import_react5.default.createElement(import_react5.default.Fragment, null, /* @__PURE__ */ import_react5.default.createElement(InputRow, {
|
|
911
|
+
label: "Method"
|
|
912
|
+
}, /* @__PURE__ */ import_react5.default.createElement(import_react_ui3.Select.Root, {
|
|
913
|
+
value: spec.method,
|
|
914
|
+
onValueChange: (value) => spec.method = value
|
|
915
|
+
}, /* @__PURE__ */ import_react5.default.createElement(import_react_ui3.Select.TriggerButton, {
|
|
916
|
+
placeholder: "type"
|
|
917
|
+
}), /* @__PURE__ */ import_react5.default.createElement(import_react_ui3.Select.Portal, null, /* @__PURE__ */ import_react5.default.createElement(import_react_ui3.Select.Content, null, /* @__PURE__ */ import_react5.default.createElement(import_react_ui3.Select.Viewport, null, methods.map((method) => /* @__PURE__ */ import_react5.default.createElement(import_react_ui3.Select.Option, {
|
|
918
|
+
key: method,
|
|
919
|
+
value: method
|
|
920
|
+
}, method))))))));
|
|
921
|
+
var TriggerSpecWebsocket = ({ spec }) => {
|
|
922
|
+
const handleChangeInit = (event) => {
|
|
923
|
+
try {
|
|
924
|
+
spec.init = JSON.parse(event.target.value);
|
|
925
|
+
} catch (err) {
|
|
926
|
+
}
|
|
927
|
+
};
|
|
928
|
+
return /* @__PURE__ */ import_react5.default.createElement(import_react5.default.Fragment, null, /* @__PURE__ */ import_react5.default.createElement(InputRow, {
|
|
929
|
+
label: "Endpoint"
|
|
930
|
+
}, /* @__PURE__ */ import_react5.default.createElement(import_react_ui3.Input.TextInput, {
|
|
931
|
+
value: spec.url,
|
|
932
|
+
onChange: (event) => spec.url = event.target.value,
|
|
933
|
+
placeholder: "https://"
|
|
934
|
+
})), /* @__PURE__ */ import_react5.default.createElement(InputRow, {
|
|
935
|
+
label: "Init"
|
|
936
|
+
}, /* @__PURE__ */ import_react5.default.createElement(import_react_ui3.Input.TextInput, {
|
|
937
|
+
value: JSON.stringify(spec.init),
|
|
938
|
+
onChange: handleChangeInit,
|
|
939
|
+
placeholder: "Initial message."
|
|
940
|
+
})));
|
|
941
|
+
};
|
|
942
|
+
var triggerRenderers = {
|
|
943
|
+
subscription: TriggerSpecSubscription,
|
|
944
|
+
timer: TriggerSpecTimer,
|
|
945
|
+
webhook: TriggerSpecWebhook,
|
|
946
|
+
websocket: TriggerSpecWebsocket
|
|
947
|
+
};
|
|
948
|
+
var TriggerSpec = ({ space, spec }) => {
|
|
949
|
+
const Component = triggerRenderers[spec.type];
|
|
950
|
+
return Component ? /* @__PURE__ */ import_react5.default.createElement(Component, {
|
|
951
|
+
space,
|
|
952
|
+
spec
|
|
953
|
+
}) : null;
|
|
954
|
+
};
|
|
955
|
+
var PromptContainer = (0, import_react2.lazy)(() => import("./PromptContainer-FRSY6FNL.cjs"));
|
|
956
|
+
var translations_default = [
|
|
957
|
+
{
|
|
958
|
+
"en-US": {
|
|
959
|
+
[import_chunk_UPPUTAPL.AUTOMATION_PLUGIN]: {
|
|
960
|
+
"plugin name": "Automation",
|
|
961
|
+
"object placeholder": "New prompt",
|
|
962
|
+
"create object label": "Create prompt",
|
|
963
|
+
"create trigger label": "Create trigger",
|
|
964
|
+
"create stack section label": "Create prompt",
|
|
965
|
+
"command placeholder": "Enter slash command...",
|
|
966
|
+
"template placeholder": "Enter template...",
|
|
967
|
+
"value placeholder": "Enter value...",
|
|
968
|
+
"select preset template placeholder": "Select preset"
|
|
969
|
+
}
|
|
970
|
+
}
|
|
971
|
+
}
|
|
972
|
+
];
|
|
973
|
+
var __dxlog_file4 = "/home/runner/work/dxos/dxos/packages/plugins/experimental/plugin-automation/src/AutomationPlugin.tsx";
|
|
974
|
+
var AutomationPlugin = () => {
|
|
975
|
+
return {
|
|
976
|
+
meta: import_chunk_UPPUTAPL.meta_default,
|
|
977
|
+
provides: {
|
|
978
|
+
metadata: {
|
|
979
|
+
records: {
|
|
980
|
+
[import_chunk_N5IDAUFU.ChainType.typename]: {
|
|
981
|
+
placeholder: [
|
|
982
|
+
"object placeholder",
|
|
983
|
+
{
|
|
984
|
+
ns: import_chunk_UPPUTAPL.AUTOMATION_PLUGIN
|
|
985
|
+
}
|
|
986
|
+
],
|
|
987
|
+
icon: "ph--magic-wand--regular",
|
|
988
|
+
// TODO(wittjosiah): Move out of metadata.
|
|
989
|
+
loadReferences: (chain) => (0, import_echo.loadObjectReferences)(chain, (chain2) => chain2.prompts)
|
|
990
|
+
}
|
|
991
|
+
}
|
|
992
|
+
},
|
|
993
|
+
translations: translations_default,
|
|
994
|
+
echo: {
|
|
995
|
+
schema: [
|
|
996
|
+
import_chunk_N5IDAUFU.ChainType,
|
|
997
|
+
import_chunk_N5IDAUFU.ChainPromptType,
|
|
998
|
+
import_types.FunctionDef,
|
|
999
|
+
import_types.FunctionTrigger
|
|
1000
|
+
]
|
|
1001
|
+
},
|
|
1002
|
+
graph: {
|
|
1003
|
+
builder: (plugins) => {
|
|
1004
|
+
const clientPlugin = (0, import_app_framework.resolvePlugin)(plugins, import_plugin_client.parseClientPlugin);
|
|
1005
|
+
const metadataPlugin = (0, import_app_framework.resolvePlugin)(plugins, import_app_framework.parseMetadataResolverPlugin);
|
|
1006
|
+
const resolve = metadataPlugin?.provides.metadata.resolver;
|
|
1007
|
+
const client = clientPlugin?.provides.client;
|
|
1008
|
+
(0, import_invariant.invariant)(resolve, void 0, {
|
|
1009
|
+
F: __dxlog_file4,
|
|
1010
|
+
L: 46,
|
|
1011
|
+
S: void 0,
|
|
1012
|
+
A: [
|
|
1013
|
+
"resolve",
|
|
1014
|
+
""
|
|
1015
|
+
]
|
|
1016
|
+
});
|
|
1017
|
+
(0, import_invariant.invariant)(client, void 0, {
|
|
1018
|
+
F: __dxlog_file4,
|
|
1019
|
+
L: 47,
|
|
1020
|
+
S: void 0,
|
|
1021
|
+
A: [
|
|
1022
|
+
"client",
|
|
1023
|
+
""
|
|
1024
|
+
]
|
|
1025
|
+
});
|
|
1026
|
+
return [
|
|
1027
|
+
// Create nodes for object settings.
|
|
1028
|
+
(0, import_plugin_graph.createExtension)({
|
|
1029
|
+
id: `${import_chunk_UPPUTAPL.AUTOMATION_PLUGIN}/automation-for-subject`,
|
|
1030
|
+
resolver: ({ id }) => {
|
|
1031
|
+
if (!id.endsWith("~automation")) {
|
|
1032
|
+
return;
|
|
1033
|
+
}
|
|
1034
|
+
const type = "orphan-settings-for-subject";
|
|
1035
|
+
const icon = "ph--magic-wand--regular";
|
|
1036
|
+
const [subjectId] = id.split("~");
|
|
1037
|
+
const { spaceId, objectId } = (0, import_echo.parseId)(subjectId);
|
|
1038
|
+
const space = client.spaces.get().find((space2) => space2.id === spaceId);
|
|
1039
|
+
if (!objectId) {
|
|
1040
|
+
const label2 = space ? space.properties.name || [
|
|
1041
|
+
"unnamed space label",
|
|
1042
|
+
{
|
|
1043
|
+
ns: import_chunk_UPPUTAPL.AUTOMATION_PLUGIN
|
|
1044
|
+
}
|
|
1045
|
+
] : [
|
|
1046
|
+
"unnamed object settings label",
|
|
1047
|
+
{
|
|
1048
|
+
ns: import_chunk_UPPUTAPL.AUTOMATION_PLUGIN
|
|
1049
|
+
}
|
|
1050
|
+
];
|
|
1051
|
+
return {
|
|
1052
|
+
id,
|
|
1053
|
+
type,
|
|
1054
|
+
data: null,
|
|
1055
|
+
properties: {
|
|
1056
|
+
icon,
|
|
1057
|
+
label: label2,
|
|
1058
|
+
showResolvedThreads: false,
|
|
1059
|
+
object: null,
|
|
1060
|
+
space
|
|
1061
|
+
}
|
|
1062
|
+
};
|
|
1063
|
+
}
|
|
1064
|
+
const object = (0, import_plugin_graph.toSignal)((onChange) => {
|
|
1065
|
+
const timeout = setTimeout(async () => {
|
|
1066
|
+
await space?.db.loadObjectById(objectId);
|
|
1067
|
+
onChange();
|
|
1068
|
+
});
|
|
1069
|
+
return () => clearTimeout(timeout);
|
|
1070
|
+
}, () => space?.db.getObjectById(objectId), subjectId);
|
|
1071
|
+
if (!object || !subjectId) {
|
|
1072
|
+
return;
|
|
1073
|
+
}
|
|
1074
|
+
const meta = resolve((0, import_echo.getTypename)(object) ?? "");
|
|
1075
|
+
const label = meta.label?.(object) || object.name || meta.placeholder || [
|
|
1076
|
+
"unnamed object settings label",
|
|
1077
|
+
{
|
|
1078
|
+
ns: import_chunk_UPPUTAPL.AUTOMATION_PLUGIN
|
|
1079
|
+
}
|
|
1080
|
+
];
|
|
1081
|
+
return {
|
|
1082
|
+
id,
|
|
1083
|
+
type,
|
|
1084
|
+
data: null,
|
|
1085
|
+
properties: {
|
|
1086
|
+
icon,
|
|
1087
|
+
label,
|
|
1088
|
+
object
|
|
1089
|
+
}
|
|
1090
|
+
};
|
|
1091
|
+
}
|
|
1092
|
+
})
|
|
1093
|
+
];
|
|
1094
|
+
}
|
|
1095
|
+
},
|
|
1096
|
+
surface: {
|
|
1097
|
+
component: ({ data, role }) => {
|
|
1098
|
+
switch (role) {
|
|
1099
|
+
// case 'article':
|
|
1100
|
+
// return data.object instanceof ChainType ? <ChainArticle chain={data.object} /> : null;
|
|
1101
|
+
case "complementary--automation":
|
|
1102
|
+
return /* @__PURE__ */ import_react.default.createElement(AutomationPanel, null);
|
|
1103
|
+
}
|
|
1104
|
+
return null;
|
|
1105
|
+
}
|
|
1106
|
+
},
|
|
1107
|
+
intent: {
|
|
1108
|
+
resolver: (intent) => {
|
|
1109
|
+
switch (intent.action) {
|
|
1110
|
+
case import_chunk_N5IDAUFU.AutomationAction.CREATE: {
|
|
1111
|
+
return {};
|
|
1112
|
+
}
|
|
1113
|
+
}
|
|
1114
|
+
}
|
|
1115
|
+
}
|
|
1116
|
+
}
|
|
1117
|
+
};
|
|
1118
|
+
};
|
|
1119
|
+
var src_default = AutomationPlugin;
|
|
1120
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
1121
|
+
0 && (module.exports = {
|
|
1122
|
+
AutomationAction,
|
|
1123
|
+
AutomationPanel,
|
|
1124
|
+
AutomationPlugin,
|
|
1125
|
+
Chain,
|
|
1126
|
+
ChainInputSchema,
|
|
1127
|
+
ChainInputType,
|
|
1128
|
+
ChainPresets,
|
|
1129
|
+
ChainPromptType,
|
|
1130
|
+
ChainType,
|
|
1131
|
+
PromptContainer,
|
|
1132
|
+
PromptEditor,
|
|
1133
|
+
TriggerEditor,
|
|
1134
|
+
chainPresets,
|
|
1135
|
+
str
|
|
1136
|
+
});
|
|
1137
|
+
//# sourceMappingURL=index.cjs.map
|