@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
package/LICENSE
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
Copyright (c) 2022 DXOS
|
|
3
|
+
|
|
4
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
5
|
+
|
|
6
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
7
|
+
|
|
8
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# @dxos/plugin-automation
|
|
2
|
+
|
|
3
|
+
Automation plugin.
|
|
4
|
+
|
|
5
|
+
## DXOS Resources
|
|
6
|
+
|
|
7
|
+
- [Website](https://dxos.org)
|
|
8
|
+
- [Developer Documentation](https://docs.dxos.org)
|
|
9
|
+
- Talk to us on [Discord](https://dxos.org/discord)
|
|
10
|
+
|
|
11
|
+
## Contributions
|
|
12
|
+
|
|
13
|
+
Your ideas, issues, and code are most welcome. Please take a look at our [community code of conduct](https://github.com/dxos/dxos/blob/main/CODE_OF_CONDUCT.md), the [issue guide](https://github.com/dxos/dxos/blob/main/CONTRIBUTING.md#submitting-issues), and the [PR contribution guide](https://github.com/dxos/dxos/blob/main/CONTRIBUTING.md#submitting-prs).
|
|
14
|
+
|
|
15
|
+
License: [MIT](./LICENSE) Copyright 2023 © DXOS
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import {
|
|
2
|
+
PromptEditor
|
|
3
|
+
} from "./chunk-PSSWFA6A.mjs";
|
|
4
|
+
import "./chunk-GGA62V7D.mjs";
|
|
5
|
+
import "./chunk-3TNRXJTD.mjs";
|
|
6
|
+
|
|
7
|
+
// packages/plugins/experimental/plugin-automation/src/components/PromptContainer.tsx
|
|
8
|
+
import React from "react";
|
|
9
|
+
var PromptContainer = (props) => {
|
|
10
|
+
return /* @__PURE__ */ React.createElement("div", {
|
|
11
|
+
role: "none",
|
|
12
|
+
className: "row-span-2 pli-2"
|
|
13
|
+
}, /* @__PURE__ */ React.createElement(PromptEditor, props));
|
|
14
|
+
};
|
|
15
|
+
var PromptContainer_default = PromptContainer;
|
|
16
|
+
export {
|
|
17
|
+
PromptContainer_default as default
|
|
18
|
+
};
|
|
19
|
+
//# sourceMappingURL=PromptContainer-RFMJXMUA.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/components/PromptContainer.tsx"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2024 DXOS.org\n//\n\nimport React from 'react';\n\nimport { PromptEditor, type PromptEditorProps } from './PromptEditor';\n\ntype PromptContainerProps = PromptEditorProps;\n\nconst PromptContainer = (props: PromptContainerProps) => {\n return (\n <div role='none' className='row-span-2 pli-2'>\n <PromptEditor {...props} />\n </div>\n );\n};\n\nexport default PromptContainer;\n"],
|
|
5
|
+
"mappings": ";;;;;;;AAIA,OAAOA,WAAW;AAMlB,IAAMC,kBAAkB,CAACC,UAAAA;AACvB,SACE,sBAAA,cAACC,OAAAA;IAAIC,MAAK;IAAOC,WAAU;KACzB,sBAAA,cAACC,cAAiBJ,KAAAA,CAAAA;AAGxB;AAEA,IAAA,0BAAeD;",
|
|
6
|
+
"names": ["React", "PromptContainer", "props", "div", "role", "className", "PromptEditor"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// packages/plugins/experimental/plugin-automation/src/meta.ts
|
|
2
|
+
var AUTOMATION_PLUGIN = "dxos.org/plugin/automation";
|
|
3
|
+
var meta_default = {
|
|
4
|
+
id: AUTOMATION_PLUGIN,
|
|
5
|
+
name: "Automation",
|
|
6
|
+
description: "Automation workflows.",
|
|
7
|
+
icon: "ph--magic-wand--regular"
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
export {
|
|
11
|
+
AUTOMATION_PLUGIN,
|
|
12
|
+
meta_default
|
|
13
|
+
};
|
|
14
|
+
//# sourceMappingURL=chunk-3TNRXJTD.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/meta.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { type PluginMeta } from '@dxos/app-framework';\n\nexport const AUTOMATION_PLUGIN = 'dxos.org/plugin/automation';\n\nexport default {\n id: AUTOMATION_PLUGIN,\n name: 'Automation',\n description: 'Automation workflows.',\n icon: 'ph--magic-wand--regular',\n} satisfies PluginMeta;\n"],
|
|
5
|
+
"mappings": ";AAMO,IAAMA,oBAAoB;AAEjC,IAAA,eAAe;EACbC,IAAID;EACJE,MAAM;EACNC,aAAa;EACbC,MAAM;AACR;",
|
|
6
|
+
"names": ["AUTOMATION_PLUGIN", "id", "name", "description", "icon"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import {
|
|
2
|
+
AUTOMATION_PLUGIN
|
|
3
|
+
} from "./chunk-3TNRXJTD.mjs";
|
|
4
|
+
|
|
5
|
+
// packages/plugins/experimental/plugin-automation/src/types/chain.ts
|
|
6
|
+
import { ref, S, TypedObject } from "@dxos/echo-schema";
|
|
7
|
+
var ChainInputType;
|
|
8
|
+
(function(ChainInputType2) {
|
|
9
|
+
ChainInputType2[ChainInputType2["VALUE"] = 0] = "VALUE";
|
|
10
|
+
ChainInputType2[ChainInputType2["PASS_THROUGH"] = 1] = "PASS_THROUGH";
|
|
11
|
+
ChainInputType2[ChainInputType2["RETRIEVER"] = 2] = "RETRIEVER";
|
|
12
|
+
ChainInputType2[ChainInputType2["FUNCTION"] = 3] = "FUNCTION";
|
|
13
|
+
ChainInputType2[ChainInputType2["QUERY"] = 4] = "QUERY";
|
|
14
|
+
ChainInputType2[ChainInputType2["RESOLVER"] = 5] = "RESOLVER";
|
|
15
|
+
ChainInputType2[ChainInputType2["CONTEXT"] = 6] = "CONTEXT";
|
|
16
|
+
ChainInputType2[ChainInputType2["SCHEMA"] = 7] = "SCHEMA";
|
|
17
|
+
})(ChainInputType || (ChainInputType = {}));
|
|
18
|
+
var ChainInputSchema = S.mutable(S.Struct({
|
|
19
|
+
name: S.String,
|
|
20
|
+
type: S.optional(S.Enums(ChainInputType)),
|
|
21
|
+
value: S.optional(S.String)
|
|
22
|
+
}));
|
|
23
|
+
var ChainPromptType = class extends TypedObject({
|
|
24
|
+
typename: "dxos.org/type/ChainPrompt",
|
|
25
|
+
version: "0.1.0"
|
|
26
|
+
})({
|
|
27
|
+
command: S.optional(S.String),
|
|
28
|
+
template: S.String,
|
|
29
|
+
inputs: S.optional(S.mutable(S.Array(ChainInputSchema)))
|
|
30
|
+
}) {
|
|
31
|
+
};
|
|
32
|
+
var ChainType = class extends TypedObject({
|
|
33
|
+
typename: "dxos.org/type/Chain",
|
|
34
|
+
version: "0.1.0"
|
|
35
|
+
})({
|
|
36
|
+
name: S.optional(S.String),
|
|
37
|
+
prompts: S.optional(S.mutable(S.Array(ref(ChainPromptType))))
|
|
38
|
+
}) {
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
// packages/plugins/experimental/plugin-automation/src/types/types.ts
|
|
42
|
+
var AUTOMATION_ACTION = `${AUTOMATION_PLUGIN}/action`;
|
|
43
|
+
var AutomationAction;
|
|
44
|
+
(function(AutomationAction2) {
|
|
45
|
+
AutomationAction2[AutomationAction2["CREATE"] = `${AUTOMATION_ACTION}/create`] = "CREATE";
|
|
46
|
+
})(AutomationAction || (AutomationAction = {}));
|
|
47
|
+
|
|
48
|
+
export {
|
|
49
|
+
ChainInputType,
|
|
50
|
+
ChainInputSchema,
|
|
51
|
+
ChainPromptType,
|
|
52
|
+
ChainType,
|
|
53
|
+
AutomationAction
|
|
54
|
+
};
|
|
55
|
+
//# sourceMappingURL=chunk-GGA62V7D.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/types/chain.ts", "../../../src/types/types.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2024 DXOS.org\n//\n\nimport { ref, S, TypedObject } from '@dxos/echo-schema';\n\n// TODO(burdon): Change to S.Literal (and discriminated union).\nexport enum ChainInputType {\n VALUE = 0,\n PASS_THROUGH = 1,\n RETRIEVER = 2,\n FUNCTION = 3,\n QUERY = 4,\n RESOLVER = 5,\n CONTEXT = 6,\n SCHEMA = 7,\n}\n\nexport const ChainInputSchema = S.mutable(\n S.Struct({\n name: S.String,\n type: S.optional(S.Enums(ChainInputType)),\n value: S.optional(S.String),\n }),\n);\n\nexport type ChainInput = S.Schema.Type<typeof ChainInputSchema>;\n\nexport class ChainPromptType extends TypedObject({ typename: 'dxos.org/type/ChainPrompt', version: '0.1.0' })({\n command: S.optional(S.String),\n template: S.String,\n inputs: S.optional(S.mutable(S.Array(ChainInputSchema))),\n}) {}\n\nexport class ChainType extends TypedObject({ typename: 'dxos.org/type/Chain', version: '0.1.0' })({\n name: S.optional(S.String),\n prompts: S.optional(S.mutable(S.Array(ref(ChainPromptType)))),\n}) {}\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport type {\n GraphBuilderProvides,\n IntentResolverProvides,\n MetadataRecordsProvides,\n SurfaceProvides,\n TranslationsProvides,\n} from '@dxos/app-framework';\nimport { type SchemaProvides } from '@dxos/plugin-client';\n\nimport { AUTOMATION_PLUGIN } from '../meta';\n\nconst AUTOMATION_ACTION = `${AUTOMATION_PLUGIN}/action`;\n\nexport enum AutomationAction {\n CREATE = `${AUTOMATION_ACTION}/create`,\n}\n\nexport type AutomationPluginProvides = SurfaceProvides &\n IntentResolverProvides &\n MetadataRecordsProvides &\n TranslationsProvides &\n GraphBuilderProvides &\n SchemaProvides;\n"],
|
|
5
|
+
"mappings": ";;;;;AAIA,SAASA,KAAKC,GAAGC,mBAAmB;;UAGxBC,iBAAAA;;;;;;;;;GAAAA,mBAAAA,iBAAAA,CAAAA,EAAAA;AAWL,IAAMC,mBAAmBC,EAAEC,QAChCD,EAAEE,OAAO;EACPC,MAAMH,EAAEI;EACRC,MAAML,EAAEM,SAASN,EAAEO,MAAMT,cAAAA,CAAAA;EACzBU,OAAOR,EAAEM,SAASN,EAAEI,MAAM;AAC5B,CAAA,CAAA;AAKK,IAAMK,kBAAN,cAA8BC,YAAY;EAAEC,UAAU;EAA6BC,SAAS;AAAQ,CAAA,EAAG;EAC5GC,SAASb,EAAEM,SAASN,EAAEI,MAAM;EAC5BU,UAAUd,EAAEI;EACZW,QAAQf,EAAEM,SAASN,EAAEC,QAAQD,EAAEgB,MAAMjB,gBAAAA,CAAAA,CAAAA;AACvC,CAAA,EAAA;AAAI;AAEG,IAAMkB,YAAN,cAAwBP,YAAY;EAAEC,UAAU;EAAuBC,SAAS;AAAQ,CAAA,EAAG;EAChGT,MAAMH,EAAEM,SAASN,EAAEI,MAAM;EACzBc,SAASlB,EAAEM,SAASN,EAAEC,QAAQD,EAAEgB,MAAMG,IAAIV,eAAAA,CAAAA,CAAAA,CAAAA;AAC5C,CAAA,EAAA;AAAI;;;ACtBJ,IAAMW,oBAAoB,GAAGC,iBAAAA;;UAEjBC,mBAAAA;kDACD,GAAGF,iBAAAA,SAA0B,IAAA;GAD5BE,qBAAAA,mBAAAA,CAAAA,EAAAA;",
|
|
6
|
+
"names": ["ref", "S", "TypedObject", "ChainInputType", "ChainInputSchema", "S", "mutable", "Struct", "name", "String", "type", "optional", "Enums", "value", "ChainPromptType", "TypedObject", "typename", "version", "command", "template", "inputs", "Array", "ChainType", "prompts", "ref", "AUTOMATION_ACTION", "AUTOMATION_PLUGIN", "AutomationAction"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,217 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ChainInputType
|
|
3
|
+
} from "./chunk-GGA62V7D.mjs";
|
|
4
|
+
import {
|
|
5
|
+
AUTOMATION_PLUGIN
|
|
6
|
+
} from "./chunk-3TNRXJTD.mjs";
|
|
7
|
+
|
|
8
|
+
// packages/plugins/experimental/plugin-automation/src/components/PromptEditor/PromptEditor.tsx
|
|
9
|
+
import React, { useEffect } from "react";
|
|
10
|
+
import { createDocAccessor } from "@dxos/react-client/echo";
|
|
11
|
+
import { Input, Select, useThemeContext, useTranslation } from "@dxos/react-ui";
|
|
12
|
+
import { createBasicExtensions, createDataExtensions, createThemeExtensions, useTextEditor } from "@dxos/react-ui-editor";
|
|
13
|
+
import { attentionSurface, groupBorder, mx as mx2 } from "@dxos/react-ui-theme";
|
|
14
|
+
import { nonNullable } from "@dxos/util";
|
|
15
|
+
|
|
16
|
+
// packages/plugins/experimental/plugin-automation/src/components/PromptEditor/prompt-extension.ts
|
|
17
|
+
import { HighlightStyle, StreamLanguage, syntaxHighlighting } from "@codemirror/language";
|
|
18
|
+
import { tags } from "@dxos/react-ui-editor";
|
|
19
|
+
import { mx } from "@dxos/react-ui-theme";
|
|
20
|
+
var nameRegex = /\{([\w-]+)}/;
|
|
21
|
+
var parser = StreamLanguage.define({
|
|
22
|
+
token: (stream) => {
|
|
23
|
+
if (stream.eatSpace()) {
|
|
24
|
+
return null;
|
|
25
|
+
}
|
|
26
|
+
if (stream.match(/^#.*/)) {
|
|
27
|
+
return "lineComment";
|
|
28
|
+
}
|
|
29
|
+
if (stream.match(/^-+$/)) {
|
|
30
|
+
return "lineComment";
|
|
31
|
+
}
|
|
32
|
+
if (stream.match(nameRegex)) {
|
|
33
|
+
return "variableName";
|
|
34
|
+
}
|
|
35
|
+
stream.next();
|
|
36
|
+
return null;
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
var highlightStyles = HighlightStyle.define([
|
|
40
|
+
{
|
|
41
|
+
tag: tags.variableName,
|
|
42
|
+
class: mx("rounded border border-yellow-500 bg-yellow-100 text-black font-mono text-sm")
|
|
43
|
+
}
|
|
44
|
+
]);
|
|
45
|
+
var promptExtension = [
|
|
46
|
+
parser,
|
|
47
|
+
syntaxHighlighting(highlightStyles)
|
|
48
|
+
];
|
|
49
|
+
|
|
50
|
+
// packages/plugins/experimental/plugin-automation/src/components/PromptEditor/PromptEditor.tsx
|
|
51
|
+
var inputTypes = [
|
|
52
|
+
{
|
|
53
|
+
value: ChainInputType.VALUE,
|
|
54
|
+
label: "Value"
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
value: ChainInputType.PASS_THROUGH,
|
|
58
|
+
label: "Pass through"
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
value: ChainInputType.RETRIEVER,
|
|
62
|
+
label: "Retriever"
|
|
63
|
+
},
|
|
64
|
+
// {
|
|
65
|
+
// value: ChainInputType.FUNCTION,
|
|
66
|
+
// label: 'Function',
|
|
67
|
+
// },
|
|
68
|
+
// {
|
|
69
|
+
// value: ChainInputType.QUERY,
|
|
70
|
+
// label: 'Query',
|
|
71
|
+
// },
|
|
72
|
+
{
|
|
73
|
+
value: ChainInputType.RESOLVER,
|
|
74
|
+
label: "Resolver"
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
value: ChainInputType.CONTEXT,
|
|
78
|
+
label: "Context"
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
value: ChainInputType.SCHEMA,
|
|
82
|
+
label: "Schema"
|
|
83
|
+
}
|
|
84
|
+
];
|
|
85
|
+
var getInputType = (type) => inputTypes.find(({ value }) => String(value) === type)?.value;
|
|
86
|
+
var usePromptInputs = (prompt) => {
|
|
87
|
+
useEffect(() => {
|
|
88
|
+
const text = prompt.template ?? "";
|
|
89
|
+
if (!prompt.inputs) {
|
|
90
|
+
prompt.inputs = [];
|
|
91
|
+
}
|
|
92
|
+
const regex = new RegExp(nameRegex, "g");
|
|
93
|
+
const variables = new Set([
|
|
94
|
+
...text.matchAll(regex)
|
|
95
|
+
].map((m) => m[1]));
|
|
96
|
+
const unclaimed = new Map(prompt.inputs?.filter(nonNullable).map((input) => [
|
|
97
|
+
input.name,
|
|
98
|
+
input
|
|
99
|
+
]));
|
|
100
|
+
const missing = [];
|
|
101
|
+
Array.from(variables.values()).forEach((name) => {
|
|
102
|
+
if (unclaimed.has(name)) {
|
|
103
|
+
unclaimed.delete(name);
|
|
104
|
+
} else {
|
|
105
|
+
missing.push(name);
|
|
106
|
+
}
|
|
107
|
+
});
|
|
108
|
+
const values = unclaimed.values();
|
|
109
|
+
missing.forEach((name) => {
|
|
110
|
+
const next = values.next().value;
|
|
111
|
+
if (next) {
|
|
112
|
+
next.name = name;
|
|
113
|
+
} else {
|
|
114
|
+
prompt.inputs?.push({
|
|
115
|
+
name
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
});
|
|
119
|
+
for (const input of values) {
|
|
120
|
+
prompt.inputs.splice(prompt.inputs.indexOf(input), 1);
|
|
121
|
+
}
|
|
122
|
+
}, [
|
|
123
|
+
prompt.template
|
|
124
|
+
]);
|
|
125
|
+
};
|
|
126
|
+
var PromptEditor = ({ prompt, commandEditable = true }) => {
|
|
127
|
+
const { t } = useTranslation(AUTOMATION_PLUGIN);
|
|
128
|
+
const { themeMode } = useThemeContext();
|
|
129
|
+
const { parentRef } = useTextEditor(() => ({
|
|
130
|
+
initialValue: prompt.template,
|
|
131
|
+
extensions: [
|
|
132
|
+
createDataExtensions({
|
|
133
|
+
id: prompt.id,
|
|
134
|
+
text: prompt.template !== void 0 ? createDocAccessor(prompt, [
|
|
135
|
+
"template"
|
|
136
|
+
]) : void 0
|
|
137
|
+
}),
|
|
138
|
+
createBasicExtensions({
|
|
139
|
+
bracketMatching: false,
|
|
140
|
+
lineWrapping: true,
|
|
141
|
+
placeholder: t("template placeholder")
|
|
142
|
+
}),
|
|
143
|
+
createThemeExtensions({
|
|
144
|
+
themeMode,
|
|
145
|
+
slots: {
|
|
146
|
+
content: {
|
|
147
|
+
className: "!p-3"
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
}),
|
|
151
|
+
promptExtension
|
|
152
|
+
]
|
|
153
|
+
}), [
|
|
154
|
+
themeMode,
|
|
155
|
+
prompt
|
|
156
|
+
]);
|
|
157
|
+
usePromptInputs(prompt);
|
|
158
|
+
return /* @__PURE__ */ React.createElement("div", {
|
|
159
|
+
className: mx2("flex flex-col w-full overflow-hidden gap-4", groupBorder)
|
|
160
|
+
}, commandEditable && /* @__PURE__ */ React.createElement("div", {
|
|
161
|
+
className: "flex items-center pl-4"
|
|
162
|
+
}, /* @__PURE__ */ React.createElement("span", {
|
|
163
|
+
className: "text-neutral-500"
|
|
164
|
+
}, "/"), /* @__PURE__ */ React.createElement(Input.Root, null, /* @__PURE__ */ React.createElement(Input.TextInput, {
|
|
165
|
+
placeholder: t("command placeholder"),
|
|
166
|
+
classNames: mx2("is-full bg-transparent m-2"),
|
|
167
|
+
value: prompt.command ?? "",
|
|
168
|
+
onChange: (event) => {
|
|
169
|
+
prompt.command = event.target.value.replace(/\w/g, "");
|
|
170
|
+
}
|
|
171
|
+
}))), /* @__PURE__ */ React.createElement("div", {
|
|
172
|
+
ref: parentRef,
|
|
173
|
+
className: mx2(attentionSurface, "rounded", "min-h-[120px]")
|
|
174
|
+
}), (prompt.inputs?.length ?? 0) > 0 && /* @__PURE__ */ React.createElement("div", {
|
|
175
|
+
className: "flex flex-col"
|
|
176
|
+
}, /* @__PURE__ */ React.createElement("table", {
|
|
177
|
+
className: "w-full table-fixed border-collapse my-2"
|
|
178
|
+
}, /* @__PURE__ */ React.createElement("tbody", null, prompt.inputs?.filter(nonNullable).map((input) => /* @__PURE__ */ React.createElement("tr", {
|
|
179
|
+
key: input.name
|
|
180
|
+
}, /* @__PURE__ */ React.createElement("td", {
|
|
181
|
+
className: "w-[160px] p-1 font-mono text-sm whitespace-nowrap truncate"
|
|
182
|
+
}, /* @__PURE__ */ React.createElement("code", {
|
|
183
|
+
className: "px-2"
|
|
184
|
+
}, input.name)), /* @__PURE__ */ React.createElement("td", {
|
|
185
|
+
className: "w-[120px] p-1"
|
|
186
|
+
}, /* @__PURE__ */ React.createElement(Input.Root, null, /* @__PURE__ */ React.createElement(Select.Root, {
|
|
187
|
+
value: String(input.type),
|
|
188
|
+
onValueChange: (type) => {
|
|
189
|
+
input.type = getInputType(type) ?? ChainInputType.VALUE;
|
|
190
|
+
}
|
|
191
|
+
}, /* @__PURE__ */ React.createElement(Select.TriggerButton, {
|
|
192
|
+
placeholder: "Type",
|
|
193
|
+
classNames: "is-full"
|
|
194
|
+
}), /* @__PURE__ */ React.createElement(Select.Portal, null, /* @__PURE__ */ React.createElement(Select.Content, null, /* @__PURE__ */ React.createElement(Select.Viewport, null, inputTypes.map(({ value, label }) => /* @__PURE__ */ React.createElement(Select.Option, {
|
|
195
|
+
key: value,
|
|
196
|
+
value: String(value)
|
|
197
|
+
}, label)))))))), /* @__PURE__ */ React.createElement("td", {
|
|
198
|
+
className: "p-1 pr-2"
|
|
199
|
+
}, input.type !== void 0 && [
|
|
200
|
+
ChainInputType.VALUE,
|
|
201
|
+
ChainInputType.CONTEXT,
|
|
202
|
+
ChainInputType.RESOLVER,
|
|
203
|
+
ChainInputType.SCHEMA
|
|
204
|
+
].includes(input.type) && /* @__PURE__ */ React.createElement("div", null, /* @__PURE__ */ React.createElement(Input.Root, null, /* @__PURE__ */ React.createElement(Input.TextInput, {
|
|
205
|
+
placeholder: t("command placeholder"),
|
|
206
|
+
classNames: mx2("is-full bg-transparent"),
|
|
207
|
+
value: input.value ?? "",
|
|
208
|
+
onChange: (event) => {
|
|
209
|
+
input.value = event.target.value;
|
|
210
|
+
}
|
|
211
|
+
}))))))))));
|
|
212
|
+
};
|
|
213
|
+
|
|
214
|
+
export {
|
|
215
|
+
PromptEditor
|
|
216
|
+
};
|
|
217
|
+
//# sourceMappingURL=chunk-PSSWFA6A.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/components/PromptEditor/PromptEditor.tsx", "../../../src/components/PromptEditor/prompt-extension.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { type Schema as S } from '@effect/schema';\nimport React, { useEffect } from 'react';\n\nimport { createDocAccessor } from '@dxos/react-client/echo';\nimport { Input, Select, useThemeContext, useTranslation } from '@dxos/react-ui';\nimport {\n createBasicExtensions,\n createDataExtensions,\n createThemeExtensions,\n useTextEditor,\n} from '@dxos/react-ui-editor';\nimport { attentionSurface, groupBorder, mx } from '@dxos/react-ui-theme';\nimport { nonNullable } from '@dxos/util';\n\nimport { nameRegex, promptExtension } from './prompt-extension';\nimport { AUTOMATION_PLUGIN } from '../../meta';\nimport { type ChainInput, ChainInputType, type ChainPromptType } from '../../types';\n\nconst inputTypes = [\n {\n value: ChainInputType.VALUE,\n label: 'Value',\n },\n {\n value: ChainInputType.PASS_THROUGH,\n label: 'Pass through',\n },\n {\n value: ChainInputType.RETRIEVER,\n label: 'Retriever',\n },\n // {\n // value: ChainInputType.FUNCTION,\n // label: 'Function',\n // },\n // {\n // value: ChainInputType.QUERY,\n // label: 'Query',\n // },\n {\n value: ChainInputType.RESOLVER,\n label: 'Resolver',\n },\n {\n value: ChainInputType.CONTEXT,\n label: 'Context',\n },\n {\n value: ChainInputType.SCHEMA,\n label: 'Schema',\n },\n];\n\nconst getInputType = (type: string) => inputTypes.find(({ value }) => String(value) === type)?.value;\n\nconst usePromptInputs = (prompt: ChainPromptType) => {\n useEffect(() => {\n const text = prompt.template ?? '';\n if (!prompt.inputs) {\n prompt.inputs = []; // TODO(burdon): Required?\n }\n\n const regex = new RegExp(nameRegex, 'g');\n const variables = new Set<string>([...text.matchAll(regex)].map((m) => m[1]));\n\n // Create map of unclaimed inputs.\n const unclaimed = new Map<string, ChainInput>(\n prompt.inputs?.filter(nonNullable).map((input) => [input.name, input]),\n );\n const missing: string[] = [];\n Array.from(variables.values()).forEach((name) => {\n if (unclaimed.has(name)) {\n unclaimed.delete(name);\n } else {\n missing.push(name);\n }\n });\n\n // Match or create new inputs.\n const values = unclaimed.values();\n missing.forEach((name) => {\n const next = values.next().value;\n if (next) {\n next.name = name;\n } else {\n prompt.inputs?.push({ name });\n }\n });\n\n // Remove unclaimed (deleted) inputs.\n // TODO(burdon): If user types incorrect name value, it will be deleted. Garbage collect?\n for (const input of values) {\n prompt.inputs.splice(prompt.inputs.indexOf(input), 1);\n }\n }, [prompt.template]);\n};\n\nexport type PromptEditorProps = {\n prompt: ChainPromptType;\n commandEditable?: boolean;\n schema?: S.Schema<any, any, any>;\n};\n\nexport const PromptEditor = ({ prompt, commandEditable = true }: PromptEditorProps) => {\n const { t } = useTranslation(AUTOMATION_PLUGIN);\n const { themeMode } = useThemeContext();\n\n const { parentRef } = useTextEditor(\n () => ({\n initialValue: prompt.template,\n extensions: [\n createDataExtensions({\n id: prompt.id,\n text: prompt.template !== undefined ? createDocAccessor(prompt, ['template']) : undefined,\n }),\n createBasicExtensions({\n bracketMatching: false,\n lineWrapping: true,\n placeholder: t('template placeholder'),\n }),\n createThemeExtensions({\n themeMode,\n slots: {\n content: { className: '!p-3' },\n },\n }),\n promptExtension,\n ],\n }),\n [themeMode, prompt],\n );\n\n usePromptInputs(prompt);\n\n return (\n <div className={mx('flex flex-col w-full overflow-hidden gap-4', groupBorder)}>\n {commandEditable && (\n <div className='flex items-center pl-4'>\n <span className='text-neutral-500'>/</span>\n <Input.Root>\n <Input.TextInput\n placeholder={t('command placeholder')}\n classNames={mx('is-full bg-transparent m-2')}\n value={prompt.command ?? ''}\n onChange={(event) => {\n prompt.command = event.target.value.replace(/\\w/g, '');\n }}\n />\n </Input.Root>\n </div>\n )}\n\n <div ref={parentRef} className={mx(attentionSurface, 'rounded', 'min-h-[120px]')} />\n\n {(prompt.inputs?.length ?? 0) > 0 && (\n <div className='flex flex-col'>\n {/* TODO(zan): Improve layout with grid */}\n <table className='w-full table-fixed border-collapse my-2'>\n <tbody>\n {prompt.inputs?.filter(nonNullable).map((input) => (\n <tr key={input.name}>\n <td className='w-[160px] p-1 font-mono text-sm whitespace-nowrap truncate'>\n <code className='px-2'>{input.name}</code>\n </td>\n <td className='w-[120px] p-1'>\n <Input.Root>\n <Select.Root\n value={String(input.type)}\n onValueChange={(type) => {\n input.type = getInputType(type) ?? ChainInputType.VALUE;\n }}\n >\n <Select.TriggerButton placeholder='Type' classNames='is-full' />\n <Select.Portal>\n <Select.Content>\n <Select.Viewport>\n {inputTypes.map(({ value, label }) => (\n <Select.Option key={value} value={String(value)}>\n {label}\n </Select.Option>\n ))}\n </Select.Viewport>\n </Select.Content>\n </Select.Portal>\n </Select.Root>\n </Input.Root>\n </td>\n <td className='p-1 pr-2'>\n {input.type !== undefined &&\n [\n ChainInputType.VALUE,\n ChainInputType.CONTEXT,\n ChainInputType.RESOLVER,\n ChainInputType.SCHEMA,\n ].includes(input.type) && (\n <div>\n <Input.Root>\n <Input.TextInput\n placeholder={t('command placeholder')}\n classNames={mx('is-full bg-transparent')}\n value={input.value ?? ''}\n onChange={(event) => {\n input.value = event.target.value;\n }}\n />\n </Input.Root>\n </div>\n )}\n </td>\n </tr>\n ))}\n </tbody>\n </table>\n </div>\n )}\n </div>\n );\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { HighlightStyle, StreamLanguage, syntaxHighlighting } from '@codemirror/language';\nimport { type Extension } from '@codemirror/state';\n\nimport { tags } from '@dxos/react-ui-editor';\nimport { mx } from '@dxos/react-ui-theme';\n\nexport const nameRegex = /\\{([\\w-]+)}/;\n\nconst parser = StreamLanguage.define({\n token: (stream) => {\n if (stream.eatSpace()) {\n return null;\n }\n if (stream.match(/^#.*/)) {\n return 'lineComment';\n }\n if (stream.match(/^-+$/)) {\n return 'lineComment';\n }\n if (stream.match(nameRegex)) {\n return 'variableName';\n }\n stream.next();\n return null;\n },\n});\n\n/**\n * https://codemirror.net/examples/styling\n * https://lezer.codemirror.net/docs/ref/#highlight\n */\nconst highlightStyles = HighlightStyle.define([\n {\n tag: tags.variableName,\n class: mx('rounded border border-yellow-500 bg-yellow-100 text-black font-mono text-sm'),\n },\n]);\n\nexport const promptExtension: Extension = [parser, syntaxHighlighting(highlightStyles)];\n"],
|
|
5
|
+
"mappings": ";;;;;;;;AAKA,OAAOA,SAASC,iBAAiB;AAEjC,SAASC,yBAAyB;AAClC,SAASC,OAAOC,QAAQC,iBAAiBC,sBAAsB;AAC/D,SACEC,uBACAC,sBACAC,uBACAC,qBACK;AACP,SAASC,kBAAkBC,aAAaC,MAAAA,WAAU;AAClD,SAAS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C,IAAAA,KAAST,eAAeC;IACpD;KAEA,sBAAA,cAACwF,OAAOE,eAAa;IAAC9B,aAAY;IAAOa,YAAW;MACpD,sBAAA,cAACe,OAAOG,QAAM,MACZ,sBAAA,cAACH,OAAOI,SAAO,MACb,sBAAA,cAACJ,OAAOK,UAAQ,MACbhG,WAAW0B,IAAI,CAAC,EAAEzB,OAAOG,MAAK,MAC7B,sBAAA,cAACuF,OAAOM,QAAM;IAACT,KAAKvF;IAAOA,OAAOY,OAAOZ,KAAAA;KACtCG,KAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,GASjB,sBAAA,cAACqF,MAAAA;IAAGtB,WAAU;KACXnC,MAAMrB,SAAS+C,UACd;IACExD,eAAeC;IACfD,eAAeM;IACfN,eAAeK;IACfL,eAAeO;IACfyF,SAASlE,MAAMrB,IAAI,KACnB,sBAAA,cAAC0D,OAAAA,MACC,sBAAA,cAACI,MAAMC,MAAI,MACT,sBAAA,cAACD,MAAME,WAAS;IACdZ,aAAahB,EAAE,qBAAA;IACf6B,YAAYN,IAAG,wBAAA;IACfrE,OAAO+B,MAAM/B,SAAS;IACtB6E,UAAU,CAACC,UAAAA;AACT/C,YAAM/B,QAAQ8E,MAAMC,OAAO/E;IAC7B;;AAc9B;",
|
|
6
|
+
"names": ["React", "useEffect", "createDocAccessor", "Input", "Select", "useThemeContext", "useTranslation", "createBasicExtensions", "createDataExtensions", "createThemeExtensions", "useTextEditor", "attentionSurface", "groupBorder", "mx", "nonNullable", "HighlightStyle", "StreamLanguage", "syntaxHighlighting", "tags", "mx", "nameRegex", "parser", "StreamLanguage", "define", "token", "stream", "eatSpace", "match", "next", "highlightStyles", "HighlightStyle", "tag", "tags", "variableName", "class", "mx", "promptExtension", "syntaxHighlighting", "inputTypes", "value", "ChainInputType", "VALUE", "label", "PASS_THROUGH", "RETRIEVER", "RESOLVER", "CONTEXT", "SCHEMA", "getInputType", "type", "find", "String", "usePromptInputs", "prompt", "useEffect", "text", "template", "inputs", "regex", "RegExp", "nameRegex", "variables", "Set", "matchAll", "map", "m", "unclaimed", "Map", "filter", "nonNullable", "input", "name", "missing", "Array", "from", "values", "forEach", "has", "delete", "push", "next", "splice", "indexOf", "PromptEditor", "commandEditable", "t", "useTranslation", "AUTOMATION_PLUGIN", "themeMode", "useThemeContext", "parentRef", "useTextEditor", "initialValue", "extensions", "createDataExtensions", "id", "undefined", "createDocAccessor", "createBasicExtensions", "bracketMatching", "lineWrapping", "placeholder", "createThemeExtensions", "slots", "content", "className", "promptExtension", "div", "mx", "groupBorder", "span", "Input", "Root", "TextInput", "classNames", "command", "onChange", "event", "target", "replace", "ref", "attentionSurface", "length", "table", "tbody", "tr", "key", "td", "code", "Select", "onValueChange", "TriggerButton", "Portal", "Content", "Viewport", "Option", "includes"]
|
|
7
|
+
}
|