@dxos/plugin-assistant 0.8.1 → 0.8.2-main.f081794
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/{AssistantDialog-YSHMAHW5.mjs → AssistantDialog-77B4BSXR.mjs} +2 -2
- package/dist/lib/browser/{ChatContainer-V5GP7DYF.mjs → ChatContainer-4AMJKO3T.mjs} +2 -2
- package/dist/lib/browser/ChatContainer-4AMJKO3T.mjs.map +7 -0
- package/dist/lib/browser/TemplateContainer-WKU5XFSO.mjs +22 -0
- package/dist/lib/browser/TemplateContainer-WKU5XFSO.mjs.map +7 -0
- package/dist/lib/browser/{app-graph-builder-MF5EVDWW.mjs → app-graph-builder-GU6ZWSP4.mjs} +7 -7
- package/dist/lib/browser/app-graph-builder-GU6ZWSP4.mjs.map +7 -0
- package/dist/lib/browser/{chunk-FMB7RGMP.mjs → chunk-FQ4L5NYW.mjs} +43 -18
- package/dist/lib/browser/{chunk-FMB7RGMP.mjs.map → chunk-FQ4L5NYW.mjs.map} +3 -3
- package/dist/lib/browser/{chunk-KYMKVE6M.mjs → chunk-SBFJKCVU.mjs} +78 -18
- package/dist/lib/browser/chunk-SBFJKCVU.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +8 -5
- package/dist/lib/browser/index.mjs.map +2 -2
- package/dist/lib/browser/{intent-resolver-WJGLKKVO.mjs → intent-resolver-YAQELTFQ.mjs} +4 -4
- package/dist/lib/browser/intent-resolver-YAQELTFQ.mjs.map +7 -0
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/{react-surface-57VRDOQT.mjs → react-surface-JOATHBJ4.mjs} +17 -8
- package/dist/lib/browser/react-surface-JOATHBJ4.mjs.map +7 -0
- package/dist/lib/browser/{settings-U6UFQX32.mjs → settings-PAJLJEVW.mjs} +3 -3
- package/dist/lib/browser/settings-PAJLJEVW.mjs.map +7 -0
- package/dist/lib/node/{AssistantDialog-YI2BSGSX.cjs → AssistantDialog-7V7RRSIL.cjs} +6 -6
- package/dist/lib/node/{ChatContainer-ZJ5JXF6A.cjs → ChatContainer-UWYNOALW.cjs} +6 -6
- package/dist/lib/node/ChatContainer-UWYNOALW.cjs.map +7 -0
- package/dist/lib/node/TemplateContainer-EQXKHWTF.cjs +52 -0
- package/dist/lib/node/TemplateContainer-EQXKHWTF.cjs.map +7 -0
- package/dist/lib/node/{app-graph-builder-N5ZUUI2Z.cjs → app-graph-builder-CEMLCKAF.cjs} +8 -8
- package/dist/lib/node/app-graph-builder-CEMLCKAF.cjs.map +7 -0
- package/dist/lib/node/{chunk-RPBKMP2E.cjs → chunk-ENBPNIJZ.cjs} +57 -32
- package/dist/lib/node/chunk-ENBPNIJZ.cjs.map +7 -0
- package/dist/lib/node/{chunk-ZKOC4ZFY.cjs → chunk-KWBQ5P7D.cjs} +81 -23
- package/dist/lib/node/chunk-KWBQ5P7D.cjs.map +7 -0
- package/dist/lib/node/index.cjs +22 -19
- package/dist/lib/node/index.cjs.map +2 -2
- package/dist/lib/node/{intent-resolver-R3OSTIMH.cjs → intent-resolver-RNMYSJ3E.cjs} +6 -6
- package/dist/lib/node/intent-resolver-RNMYSJ3E.cjs.map +7 -0
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node/{react-surface-NUQTM6MS.cjs → react-surface-7RIXMLMN.cjs} +23 -15
- package/dist/lib/node/react-surface-7RIXMLMN.cjs.map +7 -0
- package/dist/lib/node/{settings-TXGRCYAL.cjs → settings-JBEYMZ4S.cjs} +5 -5
- package/dist/lib/node/settings-JBEYMZ4S.cjs.map +7 -0
- package/dist/lib/node-esm/{AssistantDialog-U2FQX5TD.mjs → AssistantDialog-N24M73FW.mjs} +2 -2
- package/dist/lib/node-esm/{ChatContainer-QW3OOXTT.mjs → ChatContainer-KPWY5UK4.mjs} +2 -2
- package/dist/lib/node-esm/ChatContainer-KPWY5UK4.mjs.map +7 -0
- package/dist/lib/node-esm/TemplateContainer-3LEBT5ZC.mjs +23 -0
- package/dist/lib/node-esm/TemplateContainer-3LEBT5ZC.mjs.map +7 -0
- package/dist/lib/node-esm/{app-graph-builder-DWBNIMHM.mjs → app-graph-builder-Y45WYAWL.mjs} +7 -7
- package/dist/lib/node-esm/app-graph-builder-Y45WYAWL.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-MVDAY3CZ.mjs → chunk-JE47GNTB.mjs} +43 -18
- package/dist/lib/node-esm/{chunk-MVDAY3CZ.mjs.map → chunk-JE47GNTB.mjs.map} +3 -3
- package/dist/lib/node-esm/{chunk-GBBXIW5F.mjs → chunk-PFWTW22U.mjs} +78 -18
- package/dist/lib/node-esm/chunk-PFWTW22U.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +8 -5
- package/dist/lib/node-esm/index.mjs.map +2 -2
- package/dist/lib/node-esm/{intent-resolver-H32TL4X6.mjs → intent-resolver-V2ZFI5C4.mjs} +4 -4
- package/dist/lib/node-esm/intent-resolver-V2ZFI5C4.mjs.map +7 -0
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/{react-surface-JBVZF6CP.mjs → react-surface-UUHNOYST.mjs} +17 -8
- package/dist/lib/node-esm/react-surface-UUHNOYST.mjs.map +7 -0
- package/dist/lib/node-esm/{settings-DZU5PNXM.mjs → settings-KAMA6RIY.mjs} +3 -3
- package/dist/lib/node-esm/settings-KAMA6RIY.mjs.map +7 -0
- package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -1
- package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
- package/dist/types/src/components/ChatContainer.d.ts +4 -3
- package/dist/types/src/components/ChatContainer.d.ts.map +1 -1
- package/dist/types/src/components/PromptSettings.d.ts +6 -0
- package/dist/types/src/components/PromptSettings.d.ts.map +1 -0
- package/dist/types/src/components/TemplateContainer.d.ts.map +1 -1
- package/dist/types/src/components/Thread/ThreadContainer.d.ts.map +1 -1
- package/dist/types/src/components/Thread/ThreadContainer.stories.d.ts.map +1 -1
- package/dist/types/src/components/index.d.ts +2 -5
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/hooks/processor.d.ts.map +1 -1
- package/dist/types/src/hooks/useMessageQueue.d.ts +0 -3
- package/dist/types/src/hooks/useMessageQueue.d.ts.map +1 -1
- package/dist/types/src/translations.d.ts +3 -0
- package/dist/types/src/translations.d.ts.map +1 -1
- package/package.json +57 -57
- package/src/capabilities/app-graph-builder.ts +5 -13
- package/src/capabilities/intent-resolver.ts +3 -3
- package/src/capabilities/react-surface.tsx +20 -5
- package/src/capabilities/settings.ts +2 -2
- package/src/components/ChatContainer.tsx +6 -8
- package/src/components/PromptSettings.tsx +91 -0
- package/src/components/TemplateContainer.tsx +3 -79
- package/src/components/TemplateEditor/TemplateEditor.stories.tsx +2 -2
- package/src/components/TemplateEditor/TemplateForm.stories.tsx +2 -2
- package/src/components/Thread/ThreadContainer.stories.tsx +9 -18
- package/src/components/Thread/ThreadContainer.tsx +24 -2
- package/src/components/Toolbox/Toolbox.stories.tsx +1 -1
- package/src/components/index.ts +1 -0
- package/src/hooks/processor.ts +1 -2
- package/src/hooks/useChatProcessor.tsx +1 -1
- package/src/testing/test-services.ts +6 -6
- package/src/translations.ts +4 -3
- package/dist/lib/browser/ChatContainer-V5GP7DYF.mjs.map +0 -7
- package/dist/lib/browser/TemplateContainer-K4EJNGIL.mjs +0 -78
- package/dist/lib/browser/TemplateContainer-K4EJNGIL.mjs.map +0 -7
- package/dist/lib/browser/app-graph-builder-MF5EVDWW.mjs.map +0 -7
- package/dist/lib/browser/chunk-KYMKVE6M.mjs.map +0 -7
- package/dist/lib/browser/intent-resolver-WJGLKKVO.mjs.map +0 -7
- package/dist/lib/browser/react-surface-57VRDOQT.mjs.map +0 -7
- package/dist/lib/browser/settings-U6UFQX32.mjs.map +0 -7
- package/dist/lib/node/ChatContainer-ZJ5JXF6A.cjs.map +0 -7
- package/dist/lib/node/TemplateContainer-XWFYJB4T.cjs +0 -104
- package/dist/lib/node/TemplateContainer-XWFYJB4T.cjs.map +0 -7
- package/dist/lib/node/app-graph-builder-N5ZUUI2Z.cjs.map +0 -7
- package/dist/lib/node/chunk-RPBKMP2E.cjs.map +0 -7
- package/dist/lib/node/chunk-ZKOC4ZFY.cjs.map +0 -7
- package/dist/lib/node/intent-resolver-R3OSTIMH.cjs.map +0 -7
- package/dist/lib/node/react-surface-NUQTM6MS.cjs.map +0 -7
- package/dist/lib/node/settings-TXGRCYAL.cjs.map +0 -7
- package/dist/lib/node-esm/ChatContainer-QW3OOXTT.mjs.map +0 -7
- package/dist/lib/node-esm/TemplateContainer-EUM2X65J.mjs +0 -79
- package/dist/lib/node-esm/TemplateContainer-EUM2X65J.mjs.map +0 -7
- package/dist/lib/node-esm/app-graph-builder-DWBNIMHM.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-GBBXIW5F.mjs.map +0 -7
- package/dist/lib/node-esm/intent-resolver-H32TL4X6.mjs.map +0 -7
- package/dist/lib/node-esm/react-surface-JBVZF6CP.mjs.map +0 -7
- package/dist/lib/node-esm/settings-DZU5PNXM.mjs.map +0 -7
- /package/dist/lib/browser/{AssistantDialog-YSHMAHW5.mjs.map → AssistantDialog-77B4BSXR.mjs.map} +0 -0
- /package/dist/lib/node/{AssistantDialog-YI2BSGSX.cjs.map → AssistantDialog-7V7RRSIL.cjs.map} +0 -0
- /package/dist/lib/node-esm/{AssistantDialog-U2FQX5TD.mjs.map → AssistantDialog-N24M73FW.mjs.map} +0 -0
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { type FC } from 'react';
|
|
2
2
|
import { type AssociatedArtifact } from '@dxos/artifact';
|
|
3
3
|
import { type AIChatType } from '../types';
|
|
4
|
-
export
|
|
4
|
+
export type ChatContainerProps = {
|
|
5
5
|
role: string;
|
|
6
6
|
chat: AIChatType;
|
|
7
7
|
associatedArtifact?: AssociatedArtifact;
|
|
8
|
-
}
|
|
8
|
+
};
|
|
9
|
+
export declare const ChatContainer: FC<ChatContainerProps>;
|
|
9
10
|
export default ChatContainer;
|
|
10
11
|
//# sourceMappingURL=ChatContainer.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChatContainer.d.ts","sourceRoot":"","sources":["../../../../src/components/ChatContainer.tsx"],"names":[],"mappings":"AAIA,
|
|
1
|
+
{"version":3,"file":"ChatContainer.d.ts","sourceRoot":"","sources":["../../../../src/components/ChatContainer.tsx"],"names":[],"mappings":"AAIA,OAAc,EAAE,KAAK,EAAE,EAAE,MAAM,OAAO,CAAC;AAGvC,OAAO,EAAE,KAAK,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAMzD,OAAO,EAA+B,KAAK,UAAU,EAAE,MAAM,UAAU,CAAC;AAExE,MAAM,MAAM,kBAAkB,GAAG;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,UAAU,CAAC;IACjB,kBAAkB,CAAC,EAAE,kBAAkB,CAAC;CACzC,CAAC;AAGF,eAAO,MAAM,aAAa,EAAE,EAAE,CAAC,kBAAkB,CAchD,CAAC;AAEF,eAAe,aAAa,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PromptSettings.d.ts","sourceRoot":"","sources":["../../../../src/components/PromptSettings.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAwC,MAAM,OAAO,CAAC;AAM7D,OAAO,EAAiB,KAAK,YAAY,EAA2B,MAAM,UAAU,CAAC;AAErF,eAAO,MAAM,cAAc,iBAAkB;IAAE,QAAQ,EAAE,YAAY,CAAA;CAAE,sBA6EtE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TemplateContainer.d.ts","sourceRoot":"","sources":["../../../../src/components/TemplateContainer.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"TemplateContainer.d.ts","sourceRoot":"","sources":["../../../../src/components/TemplateContainer.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,OAAO,CAAC;AAK1B,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,UAAU,CAAC;AAE7C,eAAO,MAAM,iBAAiB,uBAAwB;IAAE,QAAQ,EAAE,YAAY,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,sBAM7F,CAAC;AAEF,eAAe,iBAAiB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ThreadContainer.d.ts","sourceRoot":"","sources":["../../../../../src/components/Thread/ThreadContainer.tsx"],"names":[],"mappings":"AAIA,OAAc,EAAe,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"ThreadContainer.d.ts","sourceRoot":"","sources":["../../../../../src/components/Thread/ThreadContainer.tsx"],"names":[],"mappings":"AAIA,OAAc,EAAe,KAAK,EAAE,EAAa,MAAM,OAAO,CAAC;AAG/D,OAAO,EAAE,KAAK,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAMzD,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAEtD,OAAO,EAAU,KAAK,WAAW,EAAE,MAAM,UAAU,CAAC;AAEpD,OAAO,EAAE,KAAK,UAAU,EAAE,KAAK,sBAAsB,EAAE,MAAM,aAAa,CAAC;AAE3E,MAAM,MAAM,oBAAoB,GAAG;IACjC,IAAI,CAAC,EAAE,UAAU,CAAC;IAClB,QAAQ,CAAC,EAAE,sBAAsB,CAAC;IAClC,IAAI,CAAC,EAAE,MAAM,GAAG,QAAQ,CAAC;IACzB,kBAAkB,CAAC,EAAE,kBAAkB,CAAC;CACzC,GAAG,IAAI,CAAC,WAAW,EAAE,OAAO,GAAG,eAAe,GAAG,cAAc,CAAC,CAAC;AAGlE,eAAO,MAAM,eAAe,EAAE,EAAE,CAAC,eAAe,CAAC,oBAAoB,CAAC,CA+ErE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ThreadContainer.stories.d.ts","sourceRoot":"","sources":["../../../../../src/components/Thread/ThreadContainer.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,aAAa,CAAC;AAErB,OAAO,EAAE,KAAK,QAAQ,EAAE,KAAK,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAC5D,OAAO,KAAoD,MAAM,OAAO,CAAC;AAazE,OAAO,EAAuC,KAAK,QAAQ,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"ThreadContainer.stories.d.ts","sourceRoot":"","sources":["../../../../../src/components/Thread/ThreadContainer.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,aAAa,CAAC;AAErB,OAAO,EAAE,KAAK,QAAQ,EAAE,KAAK,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAC5D,OAAO,KAAoD,MAAM,OAAO,CAAC;AAazE,OAAO,EAAuC,KAAK,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAiB5F,OAAO,EAAU,KAAK,WAAW,EAAE,MAAM,UAAU,CAAC;AAOpD,KAAK,WAAW,GAAG;IACjB,KAAK,CAAC,EAAE,QAAQ,EAAE,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;CACpB,GAAG,IAAI,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC;AAG/B,QAAA,MAAM,YAAY,yCAA+C,WAAW,sBAsJ3E,CAAC;AAEF,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,YAAY,CA6BnC,CAAC;AAEF,eAAe,IAAI,CAAC;AAEpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,YAAY,CAAC,CAAC;AAE3C,eAAO,MAAM,OAAO,EAAE,KAKrB,CAAC;AAEF,eAAO,MAAM,gBAAgB,EAAE,KAS9B,CAAC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export * from './AssistantSettings';
|
|
2
|
+
export * from './PromptSettings';
|
|
2
3
|
export * from './ServiceRegistry';
|
|
3
4
|
export * from './TemplateEditor';
|
|
4
5
|
export * from './Thread';
|
|
@@ -6,11 +7,7 @@ export * from './Toolbox';
|
|
|
6
7
|
export declare const AssistantDialog: import("react").LazyExoticComponent<import("react").FC<{
|
|
7
8
|
chat?: import("..").AIChatType;
|
|
8
9
|
}>>;
|
|
9
|
-
export declare const ChatContainer: import("react").LazyExoticComponent<(
|
|
10
|
-
role: string;
|
|
11
|
-
chat: import("..").AIChatType;
|
|
12
|
-
associatedArtifact?: import("@dxos/artifact").AssociatedArtifact;
|
|
13
|
-
}) => import("react").JSX.Element>;
|
|
10
|
+
export declare const ChatContainer: import("react").LazyExoticComponent<import("react").FC<import("./ChatContainer").ChatContainerProps>>;
|
|
14
11
|
export declare const TemplateContainer: import("react").LazyExoticComponent<({ template, role }: {
|
|
15
12
|
template: import("..").TemplateType;
|
|
16
13
|
role: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/index.ts"],"names":[],"mappings":"AAMA,cAAc,qBAAqB,CAAC;AACpC,cAAc,mBAAmB,CAAC;AAClC,cAAc,kBAAkB,CAAC;AACjC,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAK1B,eAAO,MAAM,eAAe;;GAA0C,CAAC;AACvE,eAAO,MAAM,aAAa
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/index.ts"],"names":[],"mappings":"AAMA,cAAc,qBAAqB,CAAC;AACpC,cAAc,kBAAkB,CAAC;AACjC,cAAc,mBAAmB,CAAC;AAClC,cAAc,kBAAkB,CAAC;AACjC,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAK1B,eAAO,MAAM,eAAe;;GAA0C,CAAC;AACvE,eAAO,MAAM,aAAa,uGAAwC,CAAC;AACnE,eAAO,MAAM,iBAAiB;;;kCAA4C,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"processor.d.ts","sourceRoot":"","sources":["../../../../src/hooks/processor.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,MAAM,E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Queue: (chat?: AIChatType) => import("@dxos/echo-db").Queue<{
|
|
3
3
|
readonly id: string;
|
|
4
|
-
spaceId?: import("@dxos/keys").SpaceId | undefined;
|
|
5
4
|
role: "user" | "assistant";
|
|
6
5
|
content: ({
|
|
7
6
|
pending?: boolean | undefined;
|
|
@@ -35,7 +34,5 @@ export declare const useMessageQueue: (chat?: AIChatType) => import("@dxos/echo-
|
|
|
35
34
|
toolUseId: string;
|
|
36
35
|
isError?: boolean | undefined;
|
|
37
36
|
})[];
|
|
38
|
-
threadId?: string | undefined;
|
|
39
|
-
foreignId?: string | undefined;
|
|
40
37
|
}> | undefined;
|
|
41
38
|
//# sourceMappingURL=useMessageQueue.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useMessageQueue.d.ts","sourceRoot":"","sources":["../../../../src/hooks/useMessageQueue.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,UAAU,CAAC;AAE3C,eAAO,MAAM,eAAe,UAAW,UAAU
|
|
1
|
+
{"version":3,"file":"useMessageQueue.d.ts","sourceRoot":"","sources":["../../../../src/hooks/useMessageQueue.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,UAAU,CAAC;AAE3C,eAAO,MAAM,eAAe,UAAW,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAQhD,CAAC"}
|
|
@@ -14,6 +14,7 @@ declare const _default: {
|
|
|
14
14
|
'command placeholder'?: undefined;
|
|
15
15
|
'template placeholder'?: undefined;
|
|
16
16
|
'value placeholder'?: undefined;
|
|
17
|
+
'prompt rules label'?: undefined;
|
|
17
18
|
'typename placeholder'?: undefined;
|
|
18
19
|
'description placeholder'?: undefined;
|
|
19
20
|
'select preset template placeholder'?: undefined;
|
|
@@ -42,6 +43,7 @@ declare const _default: {
|
|
|
42
43
|
'command placeholder': string;
|
|
43
44
|
'template placeholder': string;
|
|
44
45
|
'value placeholder': string;
|
|
46
|
+
'prompt rules label': string;
|
|
45
47
|
'typename placeholder': string;
|
|
46
48
|
'description placeholder': string;
|
|
47
49
|
'select preset template placeholder': string;
|
|
@@ -73,6 +75,7 @@ declare const _default: {
|
|
|
73
75
|
'command placeholder': string;
|
|
74
76
|
'template placeholder': string;
|
|
75
77
|
'value placeholder': string;
|
|
78
|
+
'prompt rules label': string;
|
|
76
79
|
'typename placeholder': string;
|
|
77
80
|
'description placeholder': string;
|
|
78
81
|
'select preset template placeholder': string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"translations.d.ts","sourceRoot":"","sources":["../../../src/translations.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"translations.d.ts","sourceRoot":"","sources":["../../../src/translations.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAOA,wBAgDE"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxos/plugin-assistant",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.2-main.f081794",
|
|
4
4
|
"description": "Assistant plugin",
|
|
5
5
|
"homepage": "https://dxos.org",
|
|
6
6
|
"bugs": "https://github.com/dxos/dxos/issues",
|
|
@@ -46,50 +46,50 @@
|
|
|
46
46
|
"jsonpointer": "^5.0.1",
|
|
47
47
|
"lodash.get": "^4.4.2",
|
|
48
48
|
"unified": "^11.0.0",
|
|
49
|
-
"@dxos/
|
|
50
|
-
"@dxos/
|
|
51
|
-
"@dxos/
|
|
52
|
-
"@dxos/async": "0.8.
|
|
53
|
-
"@dxos/
|
|
54
|
-
"@dxos/
|
|
55
|
-
"@dxos/conductor": "0.8.
|
|
56
|
-
"@dxos/
|
|
57
|
-
"@dxos/
|
|
58
|
-
"@dxos/echo-protocol": "0.8.
|
|
59
|
-
"@dxos/echo-schema": "0.8.
|
|
60
|
-
"@dxos/
|
|
61
|
-
"@dxos/
|
|
62
|
-
"@dxos/functions": "0.8.
|
|
63
|
-
"@dxos/invariant": "0.8.
|
|
64
|
-
"@dxos/keys": "0.8.
|
|
65
|
-
"@dxos/live-object": "0.8.
|
|
66
|
-
"@dxos/local-storage": "0.8.
|
|
67
|
-
"@dxos/log": "0.8.
|
|
68
|
-
"@dxos/plugin-
|
|
69
|
-
"@dxos/plugin-
|
|
70
|
-
"@dxos/plugin-graph": "0.8.
|
|
71
|
-
"@dxos/plugin-inbox": "0.8.
|
|
72
|
-
"@dxos/plugin-
|
|
73
|
-
"@dxos/plugin-
|
|
74
|
-
"@dxos/plugin-
|
|
75
|
-
"@dxos/plugin-
|
|
76
|
-
"@dxos/plugin-
|
|
77
|
-
"@dxos/
|
|
78
|
-
"@dxos/plugin-
|
|
79
|
-
"@dxos/
|
|
80
|
-
"@dxos/react-
|
|
81
|
-
"@dxos/react-ui-canvas-
|
|
82
|
-
"@dxos/react-
|
|
83
|
-
"@dxos/react-ui-
|
|
84
|
-
"@dxos/react-ui-
|
|
85
|
-
"@dxos/react-ui-editor": "0.8.
|
|
86
|
-
"@dxos/react-ui-form": "0.8.
|
|
87
|
-
"@dxos/react-ui-
|
|
88
|
-
"@dxos/react-ui-
|
|
89
|
-
"@dxos/react-ui-sfx": "0.8.
|
|
90
|
-
"@dxos/
|
|
91
|
-
"@dxos/
|
|
92
|
-
"@dxos/util": "0.8.
|
|
49
|
+
"@dxos/artifact": "0.8.2-main.f081794",
|
|
50
|
+
"@dxos/app-framework": "0.8.2-main.f081794",
|
|
51
|
+
"@dxos/assistant": "0.8.2-main.f081794",
|
|
52
|
+
"@dxos/async": "0.8.2-main.f081794",
|
|
53
|
+
"@dxos/compute": "0.8.2-main.f081794",
|
|
54
|
+
"@dxos/client": "0.8.2-main.f081794",
|
|
55
|
+
"@dxos/conductor": "0.8.2-main.f081794",
|
|
56
|
+
"@dxos/echo-db": "0.8.2-main.f081794",
|
|
57
|
+
"@dxos/context": "0.8.2-main.f081794",
|
|
58
|
+
"@dxos/echo-protocol": "0.8.2-main.f081794",
|
|
59
|
+
"@dxos/echo-schema": "0.8.2-main.f081794",
|
|
60
|
+
"@dxos/edge-client": "0.8.2-main.f081794",
|
|
61
|
+
"@dxos/effect": "0.8.2-main.f081794",
|
|
62
|
+
"@dxos/functions": "0.8.2-main.f081794",
|
|
63
|
+
"@dxos/invariant": "0.8.2-main.f081794",
|
|
64
|
+
"@dxos/keys": "0.8.2-main.f081794",
|
|
65
|
+
"@dxos/live-object": "0.8.2-main.f081794",
|
|
66
|
+
"@dxos/local-storage": "0.8.2-main.f081794",
|
|
67
|
+
"@dxos/log": "0.8.2-main.f081794",
|
|
68
|
+
"@dxos/plugin-deck": "0.8.2-main.f081794",
|
|
69
|
+
"@dxos/plugin-client": "0.8.2-main.f081794",
|
|
70
|
+
"@dxos/plugin-graph": "0.8.2-main.f081794",
|
|
71
|
+
"@dxos/plugin-inbox": "0.8.2-main.f081794",
|
|
72
|
+
"@dxos/plugin-script": "0.8.2-main.f081794",
|
|
73
|
+
"@dxos/plugin-markdown": "0.8.2-main.f081794",
|
|
74
|
+
"@dxos/plugin-sketch": "0.8.2-main.f081794",
|
|
75
|
+
"@dxos/plugin-stack": "0.8.2-main.f081794",
|
|
76
|
+
"@dxos/plugin-transcription": "0.8.2-main.f081794",
|
|
77
|
+
"@dxos/plugin-space": "0.8.2-main.f081794",
|
|
78
|
+
"@dxos/plugin-wnfs": "0.8.2-main.f081794",
|
|
79
|
+
"@dxos/react-edge-client": "0.8.2-main.f081794",
|
|
80
|
+
"@dxos/react-ui-canvas-compute": "0.8.2-main.f081794",
|
|
81
|
+
"@dxos/react-ui-canvas-editor": "0.8.2-main.f081794",
|
|
82
|
+
"@dxos/react-client": "0.8.2-main.f081794",
|
|
83
|
+
"@dxos/react-ui-components": "0.8.2-main.f081794",
|
|
84
|
+
"@dxos/react-ui-dnd": "0.8.2-main.f081794",
|
|
85
|
+
"@dxos/react-ui-editor": "0.8.2-main.f081794",
|
|
86
|
+
"@dxos/react-ui-form": "0.8.2-main.f081794",
|
|
87
|
+
"@dxos/react-ui-stack": "0.8.2-main.f081794",
|
|
88
|
+
"@dxos/react-ui-list": "0.8.2-main.f081794",
|
|
89
|
+
"@dxos/react-ui-sfx": "0.8.2-main.f081794",
|
|
90
|
+
"@dxos/schema": "0.8.2-main.f081794",
|
|
91
|
+
"@dxos/react-ui-syntax-highlighter": "0.8.2-main.f081794",
|
|
92
|
+
"@dxos/util": "0.8.2-main.f081794"
|
|
93
93
|
},
|
|
94
94
|
"devDependencies": {
|
|
95
95
|
"@types/lodash.get": "^4.4.7",
|
|
@@ -99,22 +99,22 @@
|
|
|
99
99
|
"react": "~18.2.0",
|
|
100
100
|
"react-dom": "~18.2.0",
|
|
101
101
|
"vite": "5.4.7",
|
|
102
|
-
"@dxos/artifact-testing": "0.8.
|
|
103
|
-
"@dxos/echo-db": "0.8.
|
|
104
|
-
"@dxos/plugin-chess": "0.8.
|
|
105
|
-
"@dxos/plugin-inbox": "0.8.
|
|
106
|
-
"@dxos/plugin-map": "0.8.
|
|
107
|
-
"@dxos/plugin-table": "0.8.
|
|
108
|
-
"@dxos/
|
|
109
|
-
"@dxos/react-ui": "0.8.
|
|
110
|
-
"@dxos/
|
|
111
|
-
"@dxos/react-ui
|
|
102
|
+
"@dxos/artifact-testing": "0.8.2-main.f081794",
|
|
103
|
+
"@dxos/echo-db": "0.8.2-main.f081794",
|
|
104
|
+
"@dxos/plugin-chess": "0.8.2-main.f081794",
|
|
105
|
+
"@dxos/plugin-inbox": "0.8.2-main.f081794",
|
|
106
|
+
"@dxos/plugin-map": "0.8.2-main.f081794",
|
|
107
|
+
"@dxos/plugin-table": "0.8.2-main.f081794",
|
|
108
|
+
"@dxos/storybook-utils": "0.8.2-main.f081794",
|
|
109
|
+
"@dxos/react-ui-theme": "0.8.2-main.f081794",
|
|
110
|
+
"@dxos/random": "0.8.2-main.f081794",
|
|
111
|
+
"@dxos/react-ui": "0.8.2-main.f081794"
|
|
112
112
|
},
|
|
113
113
|
"peerDependencies": {
|
|
114
114
|
"react": "~18.2.0",
|
|
115
115
|
"react-dom": "~18.2.0",
|
|
116
|
-
"@dxos/react-ui
|
|
117
|
-
"@dxos/react-ui": "0.8.
|
|
116
|
+
"@dxos/react-ui": "0.8.2-main.f081794",
|
|
117
|
+
"@dxos/react-ui-theme": "0.8.2-main.f081794"
|
|
118
118
|
},
|
|
119
119
|
"publishConfig": {
|
|
120
120
|
"access": "public"
|
|
@@ -15,16 +15,8 @@ import { ClientCapabilities } from '@dxos/plugin-client';
|
|
|
15
15
|
import { PLANK_COMPANION_TYPE, ATTENDABLE_PATH_SEPARATOR, DECK_COMPANION_TYPE } from '@dxos/plugin-deck/types';
|
|
16
16
|
import { createExtension, type Node, ROOT_ID } from '@dxos/plugin-graph';
|
|
17
17
|
import { memoizeQuery } from '@dxos/plugin-space';
|
|
18
|
-
import { SpaceAction } from '@dxos/plugin-space/types';
|
|
19
|
-
import {
|
|
20
|
-
type Space,
|
|
21
|
-
Filter,
|
|
22
|
-
fullyQualifiedId,
|
|
23
|
-
getSpace,
|
|
24
|
-
isSpace,
|
|
25
|
-
isReactiveObject,
|
|
26
|
-
parseId,
|
|
27
|
-
} from '@dxos/react-client/echo';
|
|
18
|
+
import { SPACE_TYPE, SpaceAction } from '@dxos/plugin-space/types';
|
|
19
|
+
import { type Space, Filter, fullyQualifiedId, getSpace, isLiveObject, parseId } from '@dxos/react-client/echo';
|
|
28
20
|
|
|
29
21
|
import { ASSISTANT_DIALOG, ASSISTANT_PLUGIN } from '../meta';
|
|
30
22
|
import { AIChatType, AssistantAction, TemplateType } from '../types';
|
|
@@ -118,7 +110,7 @@ export default (context: PluginsContext) =>
|
|
|
118
110
|
createExtension({
|
|
119
111
|
id: `${ASSISTANT_PLUGIN}/object-chat-companion`,
|
|
120
112
|
filter: (node): node is Node<AIChatType> =>
|
|
121
|
-
|
|
113
|
+
isLiveObject(node.data) && node.data.assistantChatQueue && node.data.type !== AIChatType.typename,
|
|
122
114
|
connector: ({ node }) => [
|
|
123
115
|
{
|
|
124
116
|
id: [node.id, 'assistant-chat'].join(ATTENDABLE_PATH_SEPARATOR),
|
|
@@ -135,7 +127,7 @@ export default (context: PluginsContext) =>
|
|
|
135
127
|
|
|
136
128
|
createExtension({
|
|
137
129
|
id: `${ASSISTANT_PLUGIN}/root`,
|
|
138
|
-
filter: (node): node is Node<Space> =>
|
|
130
|
+
filter: (node): node is Node<Space> => node.type === SPACE_TYPE,
|
|
139
131
|
connector: ({ node }) => {
|
|
140
132
|
const templates = memoizeQuery(node.data, Filter.schema(TemplateType));
|
|
141
133
|
return templates.length > 0
|
|
@@ -171,7 +163,7 @@ export default (context: PluginsContext) =>
|
|
|
171
163
|
type: `${ASSISTANT_PLUGIN}/template`,
|
|
172
164
|
data: template,
|
|
173
165
|
properties: {
|
|
174
|
-
label: template.name ?? ['
|
|
166
|
+
label: template.name ?? ['object placeholder', { ns: ASSISTANT_PLUGIN }],
|
|
175
167
|
icon: 'ph--file-code--regular',
|
|
176
168
|
},
|
|
177
169
|
}));
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
import { Capabilities, contributes, createResolver } from '@dxos/app-framework';
|
|
6
6
|
import { ObjectId } from '@dxos/echo-schema';
|
|
7
7
|
import { DXN, QueueSubspaceTags } from '@dxos/keys';
|
|
8
|
-
import {
|
|
8
|
+
import { live, refFromDXN } from '@dxos/live-object';
|
|
9
9
|
|
|
10
10
|
import { AssistantAction, AIChatType, TemplateType } from '../types';
|
|
11
11
|
|
|
@@ -16,7 +16,7 @@ export default () => [
|
|
|
16
16
|
intent: AssistantAction.CreateChat,
|
|
17
17
|
resolve: ({ spaceId, name }) => ({
|
|
18
18
|
data: {
|
|
19
|
-
object:
|
|
19
|
+
object: live(AIChatType, {
|
|
20
20
|
assistantChatQueue: refFromDXN(
|
|
21
21
|
new DXN(DXN.kind.QUEUE, [QueueSubspaceTags.DATA, spaceId, ObjectId.random()]),
|
|
22
22
|
),
|
|
@@ -31,7 +31,7 @@ export default () => [
|
|
|
31
31
|
intent: AssistantAction.CreateTemplate,
|
|
32
32
|
resolve: ({ name }) => ({
|
|
33
33
|
data: {
|
|
34
|
-
object:
|
|
34
|
+
object: live(TemplateType, { name, kind: { include: 'manual' }, source: '{{! Template }}' }),
|
|
35
35
|
},
|
|
36
36
|
}),
|
|
37
37
|
}),
|
|
@@ -5,12 +5,18 @@
|
|
|
5
5
|
import React, { useMemo } from 'react';
|
|
6
6
|
|
|
7
7
|
import { Capabilities, contributes, createSurface } from '@dxos/app-framework';
|
|
8
|
-
import { isInstanceOf } from '@dxos/echo-schema';
|
|
9
|
-
import { getTypename } from '@dxos/live-object';
|
|
8
|
+
import { isInstanceOf, getTypename } from '@dxos/echo-schema';
|
|
10
9
|
import { SettingsStore } from '@dxos/local-storage';
|
|
11
|
-
import { fullyQualifiedId,
|
|
10
|
+
import { fullyQualifiedId, getSpace, isLiveObject, isSpace, type Space, type SpaceId } from '@dxos/react-client/echo';
|
|
12
11
|
|
|
13
|
-
import {
|
|
12
|
+
import {
|
|
13
|
+
AssistantDialog,
|
|
14
|
+
AssistantSettings,
|
|
15
|
+
ChatContainer,
|
|
16
|
+
PromptSettings,
|
|
17
|
+
ServiceRegistry,
|
|
18
|
+
TemplateContainer,
|
|
19
|
+
} from '../components';
|
|
14
20
|
import { ASSISTANT_PLUGIN, ASSISTANT_DIALOG } from '../meta';
|
|
15
21
|
import { AIChatType, type AssistantSettingsProps, TemplateType } from '../types';
|
|
16
22
|
|
|
@@ -40,12 +46,15 @@ export default () =>
|
|
|
40
46
|
id: `${ASSISTANT_PLUGIN}/object-chat`,
|
|
41
47
|
role: 'article',
|
|
42
48
|
filter: (data): data is { companionTo: AIChatType; subject: 'assistant-chat' } =>
|
|
43
|
-
|
|
49
|
+
isLiveObject(data.companionTo) &&
|
|
50
|
+
(data as any).companionTo.assistantChatQueue &&
|
|
51
|
+
data.subject === 'assistant-chat',
|
|
44
52
|
component: ({ data, role }) => {
|
|
45
53
|
const associatedArtifact = useMemo(
|
|
46
54
|
() => ({
|
|
47
55
|
id: fullyQualifiedId(data.companionTo),
|
|
48
56
|
typename: getTypename(data.companionTo) ?? 'unknown',
|
|
57
|
+
spaceId: (getSpace(data.companionTo)?.id ?? 'unknown') as SpaceId,
|
|
49
58
|
}),
|
|
50
59
|
[data.companionTo],
|
|
51
60
|
);
|
|
@@ -64,4 +73,10 @@ export default () =>
|
|
|
64
73
|
filter: (data): data is { subject: Space } => isSpace(data.subject),
|
|
65
74
|
component: ({ data }) => <ServiceRegistry space={data.subject} />,
|
|
66
75
|
}),
|
|
76
|
+
createSurface({
|
|
77
|
+
id: `${ASSISTANT_PLUGIN}/prompt-settings`,
|
|
78
|
+
role: 'object-settings',
|
|
79
|
+
filter: (data): data is { subject: TemplateType } => isInstanceOf(TemplateType, data.subject),
|
|
80
|
+
component: ({ data }) => <PromptSettings template={data.subject} />,
|
|
81
|
+
}),
|
|
67
82
|
]);
|
|
@@ -3,13 +3,13 @@
|
|
|
3
3
|
//
|
|
4
4
|
|
|
5
5
|
import { Capabilities, contributes } from '@dxos/app-framework';
|
|
6
|
-
import {
|
|
6
|
+
import { live } from '@dxos/live-object';
|
|
7
7
|
|
|
8
8
|
import { ASSISTANT_PLUGIN } from '../meta';
|
|
9
9
|
import { type AssistantSettingsProps, AssistantSettingsSchema } from '../types';
|
|
10
10
|
|
|
11
11
|
export default () => {
|
|
12
|
-
const settings =
|
|
12
|
+
const settings = live<AssistantSettingsProps>({});
|
|
13
13
|
|
|
14
14
|
return contributes(Capabilities.Settings, {
|
|
15
15
|
schema: AssistantSettingsSchema,
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import React from 'react';
|
|
5
|
+
import React, { type FC } from 'react';
|
|
6
6
|
|
|
7
7
|
import { Capabilities, useCapabilities, useCapability } from '@dxos/app-framework';
|
|
8
8
|
import { type AssociatedArtifact } from '@dxos/artifact';
|
|
@@ -13,16 +13,14 @@ import { ThreadContainer } from './Thread';
|
|
|
13
13
|
import { ASSISTANT_PLUGIN } from '../meta';
|
|
14
14
|
import { type AssistantSettingsProps, type AIChatType } from '../types';
|
|
15
15
|
|
|
16
|
-
|
|
17
|
-
export const ChatContainer = ({
|
|
18
|
-
role,
|
|
19
|
-
chat,
|
|
20
|
-
associatedArtifact,
|
|
21
|
-
}: {
|
|
16
|
+
export type ChatContainerProps = {
|
|
22
17
|
role: string;
|
|
23
18
|
chat: AIChatType;
|
|
24
19
|
associatedArtifact?: AssociatedArtifact;
|
|
25
|
-
}
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
// TODO(burdon): Attention.
|
|
23
|
+
export const ChatContainer: FC<ChatContainerProps> = ({ role, chat, associatedArtifact }) => {
|
|
26
24
|
const transcription = useCapabilities(TranscriptionCapabilities.Transcriber).length > 0;
|
|
27
25
|
const settings = useCapability(Capabilities.SettingsStore).getStore<AssistantSettingsProps>(ASSISTANT_PLUGIN)?.value;
|
|
28
26
|
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { Match, type Schema as S } from 'effect';
|
|
6
|
+
import React, { type ChangeEvent, useCallback } from 'react';
|
|
7
|
+
|
|
8
|
+
import { debounce } from '@dxos/async';
|
|
9
|
+
import { Input, Select, Toolbar, useTranslation } from '@dxos/react-ui';
|
|
10
|
+
|
|
11
|
+
import { ASSISTANT_PLUGIN } from '../meta';
|
|
12
|
+
import { TemplateKinds, type TemplateType, type TemplateKindSchema } from '../types';
|
|
13
|
+
|
|
14
|
+
export const PromptSettings = ({ template }: { template: TemplateType }) => {
|
|
15
|
+
const { t } = useTranslation(ASSISTANT_PLUGIN);
|
|
16
|
+
|
|
17
|
+
const handleKindChange = useCallback(
|
|
18
|
+
(value: string) => {
|
|
19
|
+
const kind = Match.type<string>().pipe(
|
|
20
|
+
Match.withReturnType<S.Schema.Type<typeof TemplateKindSchema>>(),
|
|
21
|
+
Match.when('always', () => ({ include: 'always' })),
|
|
22
|
+
Match.when('schema-matching', () => ({ include: 'schema-matching', typename: '' })),
|
|
23
|
+
Match.when('automatically', () => ({ include: 'automatically', description: '' })),
|
|
24
|
+
Match.orElse(() => ({ include: 'manual' })),
|
|
25
|
+
)(value);
|
|
26
|
+
|
|
27
|
+
template.kind = kind;
|
|
28
|
+
},
|
|
29
|
+
[template],
|
|
30
|
+
);
|
|
31
|
+
|
|
32
|
+
const handleTypenameChange = useCallback(
|
|
33
|
+
debounce((event: ChangeEvent<HTMLInputElement>) => {
|
|
34
|
+
if (template.kind.include === 'schema-matching') {
|
|
35
|
+
template.kind.typename = event.target.value;
|
|
36
|
+
}
|
|
37
|
+
}, 300),
|
|
38
|
+
[template.kind.include],
|
|
39
|
+
);
|
|
40
|
+
|
|
41
|
+
const handleDescriptionChange = useCallback(
|
|
42
|
+
debounce((event: ChangeEvent<HTMLInputElement>) => {
|
|
43
|
+
if (template.kind.include === 'automatically') {
|
|
44
|
+
template.kind.description = event.target.value;
|
|
45
|
+
}
|
|
46
|
+
}, 300),
|
|
47
|
+
[template.kind.include],
|
|
48
|
+
);
|
|
49
|
+
|
|
50
|
+
return (
|
|
51
|
+
<div className='p-2 flex flex-col gap-4'>
|
|
52
|
+
<h2>{t('prompt rules label')}</h2>
|
|
53
|
+
<Toolbar.Root>
|
|
54
|
+
<Select.Root value={template.kind.include} onValueChange={handleKindChange}>
|
|
55
|
+
<Toolbar.Button asChild>
|
|
56
|
+
<Select.TriggerButton />
|
|
57
|
+
</Toolbar.Button>
|
|
58
|
+
<Select.Portal>
|
|
59
|
+
<Select.Content>
|
|
60
|
+
<Select.Viewport>
|
|
61
|
+
{TemplateKinds.map((kind) => (
|
|
62
|
+
<Select.Option key={kind} value={kind}>
|
|
63
|
+
{kind}
|
|
64
|
+
</Select.Option>
|
|
65
|
+
))}
|
|
66
|
+
</Select.Viewport>
|
|
67
|
+
</Select.Content>
|
|
68
|
+
</Select.Portal>
|
|
69
|
+
</Select.Root>
|
|
70
|
+
{template.kind.include === 'schema-matching' && (
|
|
71
|
+
<Input.Root>
|
|
72
|
+
<Input.TextInput
|
|
73
|
+
placeholder={t('typename placeholder')}
|
|
74
|
+
defaultValue={template.kind.typename}
|
|
75
|
+
onChange={handleTypenameChange}
|
|
76
|
+
/>
|
|
77
|
+
</Input.Root>
|
|
78
|
+
)}
|
|
79
|
+
{template.kind.include === 'automatically' && (
|
|
80
|
+
<Input.Root>
|
|
81
|
+
<Input.TextInput
|
|
82
|
+
placeholder={t('description placeholder')}
|
|
83
|
+
defaultValue={template.kind.description}
|
|
84
|
+
onChange={handleDescriptionChange}
|
|
85
|
+
/>
|
|
86
|
+
</Input.Root>
|
|
87
|
+
)}
|
|
88
|
+
</Toolbar.Root>
|
|
89
|
+
</div>
|
|
90
|
+
);
|
|
91
|
+
};
|
|
@@ -2,92 +2,16 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import
|
|
6
|
-
import React, { type ChangeEvent, useCallback } from 'react';
|
|
5
|
+
import React from 'react';
|
|
7
6
|
|
|
8
|
-
import { debounce } from '@dxos/async';
|
|
9
|
-
import { Input, Select, Toolbar, useTranslation } from '@dxos/react-ui';
|
|
10
7
|
import { StackItem } from '@dxos/react-ui-stack';
|
|
11
8
|
|
|
12
9
|
import { TemplateEditor } from './TemplateEditor';
|
|
13
|
-
import {
|
|
14
|
-
import { TemplateKinds, type TemplateKindSchema, type TemplateType } from '../types';
|
|
10
|
+
import { type TemplateType } from '../types';
|
|
15
11
|
|
|
16
12
|
export const TemplateContainer = ({ template, role }: { template: TemplateType; role: string }) => {
|
|
17
|
-
const { t } = useTranslation(ASSISTANT_PLUGIN);
|
|
18
|
-
|
|
19
|
-
const handleKindChange = useCallback(
|
|
20
|
-
(value: string) => {
|
|
21
|
-
const kind = Match.type<string>().pipe(
|
|
22
|
-
Match.withReturnType<S.Schema.Type<typeof TemplateKindSchema>>(),
|
|
23
|
-
Match.when('always', () => ({ include: 'always' })),
|
|
24
|
-
Match.when('schema-matching', () => ({ include: 'schema-matching', typename: '' })),
|
|
25
|
-
Match.when('automatically', () => ({ include: 'automatically', description: '' })),
|
|
26
|
-
Match.orElse(() => ({ include: 'manual' })),
|
|
27
|
-
)(value);
|
|
28
|
-
|
|
29
|
-
template.kind = kind;
|
|
30
|
-
},
|
|
31
|
-
[template],
|
|
32
|
-
);
|
|
33
|
-
|
|
34
|
-
const handleTypenameChange = useCallback(
|
|
35
|
-
debounce((event: ChangeEvent<HTMLInputElement>) => {
|
|
36
|
-
if (template.kind.include === 'schema-matching') {
|
|
37
|
-
template.kind.typename = event.target.value;
|
|
38
|
-
}
|
|
39
|
-
}, 300),
|
|
40
|
-
[template.kind.include],
|
|
41
|
-
);
|
|
42
|
-
|
|
43
|
-
const handleDescriptionChange = useCallback(
|
|
44
|
-
debounce((event: ChangeEvent<HTMLInputElement>) => {
|
|
45
|
-
if (template.kind.include === 'automatically') {
|
|
46
|
-
template.kind.description = event.target.value;
|
|
47
|
-
}
|
|
48
|
-
}, 300),
|
|
49
|
-
[template.kind.include],
|
|
50
|
-
);
|
|
51
|
-
|
|
52
13
|
return (
|
|
53
|
-
<StackItem.Content role={role}
|
|
54
|
-
{/* TODO(wittjosiah): Move this toolbar into c11y sidebar. */}
|
|
55
|
-
<Toolbar.Root>
|
|
56
|
-
<Select.Root value={template.kind.include} onValueChange={handleKindChange}>
|
|
57
|
-
<Toolbar.Button asChild>
|
|
58
|
-
<Select.TriggerButton />
|
|
59
|
-
</Toolbar.Button>
|
|
60
|
-
<Select.Portal>
|
|
61
|
-
<Select.Content>
|
|
62
|
-
<Select.Viewport>
|
|
63
|
-
{TemplateKinds.map((kind) => (
|
|
64
|
-
<Select.Option key={kind} value={kind}>
|
|
65
|
-
{kind}
|
|
66
|
-
</Select.Option>
|
|
67
|
-
))}
|
|
68
|
-
</Select.Viewport>
|
|
69
|
-
</Select.Content>
|
|
70
|
-
</Select.Portal>
|
|
71
|
-
</Select.Root>
|
|
72
|
-
{template.kind.include === 'schema-matching' && (
|
|
73
|
-
<Input.Root>
|
|
74
|
-
<Input.TextInput
|
|
75
|
-
placeholder={t('typename placeholder')}
|
|
76
|
-
defaultValue={template.kind.typename}
|
|
77
|
-
onChange={handleTypenameChange}
|
|
78
|
-
/>
|
|
79
|
-
</Input.Root>
|
|
80
|
-
)}
|
|
81
|
-
{template.kind.include === 'automatically' && (
|
|
82
|
-
<Input.Root>
|
|
83
|
-
<Input.TextInput
|
|
84
|
-
placeholder={t('description placeholder')}
|
|
85
|
-
defaultValue={template.kind.description}
|
|
86
|
-
onChange={handleDescriptionChange}
|
|
87
|
-
/>
|
|
88
|
-
</Input.Root>
|
|
89
|
-
)}
|
|
90
|
-
</Toolbar.Root>
|
|
14
|
+
<StackItem.Content role={role} classNames='container-max-width'>
|
|
91
15
|
<TemplateEditor template={template} />
|
|
92
16
|
</StackItem.Content>
|
|
93
17
|
);
|