@meistrari/chat-nuxt 4.10.0-rc.2 → 4.10.0-rc.21
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/README.md +8 -6
- package/dist/module.json +1 -1
- package/dist/module.mjs +2 -0
- package/dist/runtime/conversations/components/chat-conversation-export-modal.d.vue.ts +10 -0
- package/dist/runtime/conversations/components/chat-conversation-export-modal.vue +126 -0
- package/dist/runtime/conversations/components/chat-conversation-export-modal.vue.d.ts +10 -0
- package/dist/runtime/conversations/components/chat-conversation-list.vue +8 -1
- package/dist/runtime/{rendering/components/openui/bar-chart.d.vue.ts → conversations/components/chat-export-document.d.vue.ts} +2 -5
- package/dist/runtime/conversations/components/chat-export-document.vue +26 -0
- package/dist/runtime/{rendering/components/openui/bar-chart.vue.d.ts → conversations/components/chat-export-document.vue.d.ts} +2 -5
- package/dist/runtime/{rendering/components/openui/checkbox.d.vue.ts → conversations/components/chat-export-file.d.vue.ts} +1 -1
- package/dist/runtime/conversations/components/chat-export-file.vue +12 -0
- package/dist/runtime/{rendering/components/openui/checkbox.vue.d.ts → conversations/components/chat-export-file.vue.d.ts} +1 -1
- package/dist/runtime/{rendering/components/openui/buttons.d.vue.ts → conversations/components/chat-export-message.d.vue.ts} +2 -3
- package/dist/runtime/conversations/components/chat-export-message.vue +84 -0
- package/dist/runtime/{rendering/components/openui/bar.vue.d.ts → conversations/components/chat-export-message.vue.d.ts} +2 -5
- package/dist/runtime/{rendering/components/openui/bar.d.vue.ts → conversations/components/chat-export-openui.d.vue.ts} +3 -4
- package/dist/runtime/conversations/components/chat-export-openui.vue +19 -0
- package/dist/runtime/conversations/components/chat-export-openui.vue.d.ts +9 -0
- package/dist/runtime/{rendering/components/openui/callout.d.vue.ts → conversations/components/chat-export-questions.d.vue.ts} +12 -4
- package/dist/runtime/conversations/components/chat-export-questions.vue +22 -0
- package/dist/runtime/{rendering/components/openui/callout.vue.d.ts → conversations/components/chat-export-questions.vue.d.ts} +12 -4
- package/dist/runtime/conversations/composables/conversation-list.d.ts +2 -1
- package/dist/runtime/conversations/composables/conversation-list.js +4 -13
- package/dist/runtime/conversations/export-document.d.ts +1 -0
- package/dist/runtime/conversations/export-document.js +154 -0
- package/dist/runtime/conversations/export.d.ts +4 -0
- package/dist/runtime/conversations/export.js +69 -4
- package/dist/runtime/embed/components/chat-embed-inner.vue +81 -7
- package/dist/runtime/embed/components/mobile/chat-mobile-shell.d.vue.ts +3 -2
- package/dist/runtime/embed/components/mobile/chat-mobile-shell.vue +2 -0
- package/dist/runtime/embed/components/mobile/chat-mobile-shell.vue.d.ts +3 -2
- package/dist/runtime/embed/execution-controls.d.ts +2 -1
- package/dist/runtime/embed/execution-controls.js +2 -2
- package/dist/runtime/messages/components/chat-execution-mode-selector.vue +10 -6
- package/dist/runtime/messages/components/chat-message-bubble.vue +7 -0
- package/dist/runtime/messages/components/chat-message-input.d.vue.ts +2 -0
- package/dist/runtime/messages/components/chat-message-input.vue +18 -1
- package/dist/runtime/messages/components/chat-message-input.vue.d.ts +2 -0
- package/dist/runtime/messages/composables/chat.d.ts +15 -0
- package/dist/runtime/messages/composables/chat.js +49 -5
- package/dist/runtime/messages/composer-draft.d.ts +16 -0
- package/dist/runtime/messages/composer-draft.js +61 -0
- package/dist/runtime/messages/composer-pending-send.d.ts +8 -0
- package/dist/runtime/messages/composer-pending-send.js +34 -0
- package/dist/runtime/messages/conversation-timeline.js +1 -1
- package/dist/runtime/rendering/components/openui/{markdown.d.vue.ts → markdown-prose.d.vue.ts} +1 -3
- package/dist/runtime/rendering/components/openui/{markdown.vue → markdown-prose.vue} +3 -3
- package/dist/runtime/rendering/components/openui/{markdown.vue.d.ts → markdown-prose.vue.d.ts} +1 -3
- package/dist/runtime/rendering/components/openui-block.vue +26 -52
- package/dist/runtime/rendering/openui/context.d.ts +2 -17
- package/dist/runtime/rendering/openui/context.js +0 -2
- package/dist/runtime/server/utils/chat-api-proxy.d.ts +1 -1
- package/dist/runtime/server/utils/chat-api-proxy.js +3 -2
- package/dist/runtime/types/composer.d.ts +6 -0
- package/dist/runtime/types/schemas/chat/chat-config.d.ts +6 -2
- package/dist/runtime/types/schemas/chat/chat-config.js +1 -0
- package/dist/runtime/types/schemas/chat/conversation-runtime.d.ts +8 -0
- package/dist/runtime/types/schemas/chat/conversations.d.ts +8 -0
- package/dist/runtime/types/schemas/chat/messages.d.ts +12 -0
- package/dist/runtime/types/schemas/chat/ui-language.d.ts +19 -2
- package/dist/runtime/types/schemas/chat/ui-language.js +8 -3
- package/dist/runtime/types/schemas/chat/v3.d.ts +160 -2
- package/dist/runtime/types/schemas/chat/v3.js +91 -5
- package/dist/runtime/types/schemas/integrations/slack-apps.d.ts +53 -0
- package/dist/runtime/types/schemas/integrations/slack-apps.js +6 -0
- package/dist/runtime/types/schemas/integrations/slack-identity.d.ts +26 -0
- package/dist/runtime/types/schemas/integrations/slack-identity.js +23 -0
- package/dist/runtime/types/schemas/integrations/tela-agent-api.d.ts +40 -0
- package/dist/runtime/types/schemas/integrations/tela-agent-api.js +3 -0
- package/dist/runtime/types/schemas/integrations/tela-api.d.ts +11 -0
- package/dist/runtime/types/schemas/integrations/tela-api.js +8 -0
- package/dist/runtime/types/schemas/integrations/tela-auth.d.ts +39 -0
- package/dist/runtime/types/schemas/integrations/tela-auth.js +12 -0
- package/dist/runtime/types/schemas/slack/apps.d.ts +144 -0
- package/dist/runtime/types/schemas/slack/apps.js +53 -0
- package/dist/runtime/types/schemas/slack/identities.d.ts +58 -0
- package/dist/runtime/types/schemas/slack/identities.js +19 -0
- package/dist/runtime/types/schemas/slack/installations.d.ts +39 -0
- package/dist/runtime/types/schemas/slack/installations.js +18 -0
- package/package.json +2 -2
- package/dist/runtime/rendering/components/openui/bar-chart.vue +0 -39
- package/dist/runtime/rendering/components/openui/bar.vue +0 -12
- package/dist/runtime/rendering/components/openui/button.d.vue.ts +0 -11
- package/dist/runtime/rendering/components/openui/button.vue +0 -30
- package/dist/runtime/rendering/components/openui/button.vue.d.ts +0 -11
- package/dist/runtime/rendering/components/openui/buttons.vue +0 -14
- package/dist/runtime/rendering/components/openui/buttons.vue.d.ts +0 -8
- package/dist/runtime/rendering/components/openui/callout.vue +0 -27
- package/dist/runtime/rendering/components/openui/card.d.vue.ts +0 -9
- package/dist/runtime/rendering/components/openui/card.vue +0 -19
- package/dist/runtime/rendering/components/openui/card.vue.d.ts +0 -9
- package/dist/runtime/rendering/components/openui/checkbox.vue +0 -26
- package/dist/runtime/rendering/components/openui/col.d.vue.ts +0 -10
- package/dist/runtime/rendering/components/openui/col.vue +0 -16
- package/dist/runtime/rendering/components/openui/col.vue.d.ts +0 -10
- package/dist/runtime/rendering/components/openui/form.d.vue.ts +0 -10
- package/dist/runtime/rendering/components/openui/form.vue +0 -60
- package/dist/runtime/rendering/components/openui/form.vue.d.ts +0 -10
- package/dist/runtime/rendering/components/openui/input.d.vue.ts +0 -10
- package/dist/runtime/rendering/components/openui/input.vue +0 -23
- package/dist/runtime/rendering/components/openui/input.vue.d.ts +0 -10
- package/dist/runtime/rendering/components/openui/metric.d.vue.ts +0 -11
- package/dist/runtime/rendering/components/openui/metric.vue +0 -20
- package/dist/runtime/rendering/components/openui/metric.vue.d.ts +0 -11
- package/dist/runtime/rendering/components/openui/option.d.vue.ts +0 -10
- package/dist/runtime/rendering/components/openui/option.vue +0 -12
- package/dist/runtime/rendering/components/openui/option.vue.d.ts +0 -10
- package/dist/runtime/rendering/components/openui/question.d.vue.ts +0 -11
- package/dist/runtime/rendering/components/openui/question.vue +0 -15
- package/dist/runtime/rendering/components/openui/question.vue.d.ts +0 -11
- package/dist/runtime/rendering/components/openui/questions.d.vue.ts +0 -9
- package/dist/runtime/rendering/components/openui/questions.vue +0 -91
- package/dist/runtime/rendering/components/openui/questions.vue.d.ts +0 -9
- package/dist/runtime/rendering/components/openui/select.d.vue.ts +0 -10
- package/dist/runtime/rendering/components/openui/select.vue +0 -27
- package/dist/runtime/rendering/components/openui/select.vue.d.ts +0 -10
- package/dist/runtime/rendering/components/openui/stack.d.vue.ts +0 -9
- package/dist/runtime/rendering/components/openui/stack.vue +0 -18
- package/dist/runtime/rendering/components/openui/stack.vue.d.ts +0 -9
- package/dist/runtime/rendering/components/openui/table.d.vue.ts +0 -9
- package/dist/runtime/rendering/components/openui/table.vue +0 -41
- package/dist/runtime/rendering/components/openui/table.vue.d.ts +0 -9
- package/dist/runtime/rendering/openui/actions.d.ts +0 -15
- package/dist/runtime/rendering/openui/actions.js +0 -40
- package/dist/runtime/rendering/openui/form-fields.d.ts +0 -10
- package/dist/runtime/rendering/openui/form-fields.js +0 -30
- package/dist/runtime/rendering/openui/program.d.ts +0 -15
- package/dist/runtime/rendering/openui/program.js +0 -74
- package/dist/runtime/rendering/openui/registry.d.ts +0 -5
- package/dist/runtime/rendering/openui/registry.js +0 -44
- package/dist/runtime/rendering/openui/render.d.ts +0 -21
- package/dist/runtime/rendering/openui/render.js +0 -45
- package/dist/runtime/rendering/openui/use-openui-context.d.ts +0 -2
- package/dist/runtime/rendering/openui/use-openui-context.js +0 -8
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
import { createStore, createStreamingParser, evaluateElementProps } from "@openuidev/lang-core";
|
|
2
|
-
import { library } from "@meistrari/chat-ui-lang";
|
|
3
|
-
import { computed, shallowRef, watch } from "vue";
|
|
4
|
-
const schema = library.toJSONSchema();
|
|
5
|
-
function parserErrors(result) {
|
|
6
|
-
return result.meta.errors.map((error) => ({
|
|
7
|
-
source: "parser",
|
|
8
|
-
code: error.code,
|
|
9
|
-
message: error.message,
|
|
10
|
-
component: error.component,
|
|
11
|
-
path: error.path || void 0,
|
|
12
|
-
statementId: error.statementId
|
|
13
|
-
}));
|
|
14
|
-
}
|
|
15
|
-
function describe(error) {
|
|
16
|
-
return error instanceof Error ? error.message : String(error);
|
|
17
|
-
}
|
|
18
|
-
export function useOpenuiProgram(code, complete) {
|
|
19
|
-
const parser = createStreamingParser(schema, library.root);
|
|
20
|
-
const store = createStore();
|
|
21
|
-
const storeRevision = shallowRef(0);
|
|
22
|
-
store.subscribe(() => {
|
|
23
|
-
storeRevision.value++;
|
|
24
|
-
});
|
|
25
|
-
const parsed = computed(() => {
|
|
26
|
-
if (!code.value.trim())
|
|
27
|
-
return { result: null, errors: [] };
|
|
28
|
-
try {
|
|
29
|
-
const result = parser.set(code.value, complete.value);
|
|
30
|
-
return { result, errors: parserErrors(result) };
|
|
31
|
-
} catch (error) {
|
|
32
|
-
return { result: null, errors: [{ source: "parser", code: "parse-exception", message: describe(error) }] };
|
|
33
|
-
}
|
|
34
|
-
});
|
|
35
|
-
const stateDefaults = computed(() => parsed.value.result?.stateDeclarations ?? {});
|
|
36
|
-
let seededDefaults = "";
|
|
37
|
-
watch(stateDefaults, (defaults) => {
|
|
38
|
-
const key = JSON.stringify(defaults);
|
|
39
|
-
if (key === seededDefaults)
|
|
40
|
-
return;
|
|
41
|
-
seededDefaults = key;
|
|
42
|
-
store.initialize(defaults, {});
|
|
43
|
-
}, { immediate: true });
|
|
44
|
-
const evaluated = computed(() => {
|
|
45
|
-
const result = parsed.value.result;
|
|
46
|
-
if (!result?.root)
|
|
47
|
-
return { root: null, errors: [] };
|
|
48
|
-
void storeRevision.value;
|
|
49
|
-
const errors = [];
|
|
50
|
-
const context = {
|
|
51
|
-
ctx: {
|
|
52
|
-
getState: (name) => store.get(name),
|
|
53
|
-
resolveRef: () => null,
|
|
54
|
-
// Without the library actions, @CopyText(...) evaluates to a plain node and its button sends the label instead.
|
|
55
|
-
actions: schema.actions
|
|
56
|
-
},
|
|
57
|
-
library,
|
|
58
|
-
store,
|
|
59
|
-
errors
|
|
60
|
-
};
|
|
61
|
-
try {
|
|
62
|
-
return { root: evaluateElementProps(result.root, context), errors };
|
|
63
|
-
} catch (error) {
|
|
64
|
-
return { root: result.root, errors: [...errors, { source: "runtime", code: "runtime-error", message: describe(error) }] };
|
|
65
|
-
}
|
|
66
|
-
});
|
|
67
|
-
return {
|
|
68
|
-
root: computed(() => evaluated.value.root),
|
|
69
|
-
errors: computed(() => [...parsed.value.errors, ...evaluated.value.errors]),
|
|
70
|
-
incomplete: computed(() => !complete.value || (parsed.value.result?.meta.incomplete ?? true)),
|
|
71
|
-
stateDefaults,
|
|
72
|
-
store
|
|
73
|
-
};
|
|
74
|
-
}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import type { Component } from 'vue';
|
|
2
|
-
import type { componentNames } from '@meistrari/chat-ui-lang';
|
|
3
|
-
export type OpenuiComponentName = (typeof componentNames)[number];
|
|
4
|
-
/** Every component the library exposes to the model must have a renderer here. */
|
|
5
|
-
export declare const OPENUI_REGISTRY: Record<OpenuiComponentName, Component>;
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import OpenuiBar from "../components/openui/bar.vue";
|
|
2
|
-
import OpenuiBarChart from "../components/openui/bar-chart.vue";
|
|
3
|
-
import OpenuiButton from "../components/openui/button.vue";
|
|
4
|
-
import OpenuiButtons from "../components/openui/buttons.vue";
|
|
5
|
-
import OpenuiCallout from "../components/openui/callout.vue";
|
|
6
|
-
import OpenuiCard from "../components/openui/card.vue";
|
|
7
|
-
import OpenuiCheckbox from "../components/openui/checkbox.vue";
|
|
8
|
-
import OpenuiCitation from "../components/openui/citation.vue";
|
|
9
|
-
import OpenuiCol from "../components/openui/col.vue";
|
|
10
|
-
import OpenuiFileCard from "../components/openui/file-card.vue";
|
|
11
|
-
import OpenuiForm from "../components/openui/form.vue";
|
|
12
|
-
import OpenuiImage from "../components/openui/image.vue";
|
|
13
|
-
import OpenuiInput from "../components/openui/input.vue";
|
|
14
|
-
import OpenuiMarkdown from "../components/openui/markdown.vue";
|
|
15
|
-
import OpenuiMetric from "../components/openui/metric.vue";
|
|
16
|
-
import OpenuiOption from "../components/openui/option.vue";
|
|
17
|
-
import OpenuiQuestion from "../components/openui/question.vue";
|
|
18
|
-
import OpenuiQuestions from "../components/openui/questions.vue";
|
|
19
|
-
import OpenuiSelect from "../components/openui/select.vue";
|
|
20
|
-
import OpenuiStack from "../components/openui/stack.vue";
|
|
21
|
-
import OpenuiTable from "../components/openui/table.vue";
|
|
22
|
-
export const OPENUI_REGISTRY = {
|
|
23
|
-
Stack: OpenuiStack,
|
|
24
|
-
Card: OpenuiCard,
|
|
25
|
-
Markdown: OpenuiMarkdown,
|
|
26
|
-
Callout: OpenuiCallout,
|
|
27
|
-
Metric: OpenuiMetric,
|
|
28
|
-
Col: OpenuiCol,
|
|
29
|
-
Table: OpenuiTable,
|
|
30
|
-
Bar: OpenuiBar,
|
|
31
|
-
BarChart: OpenuiBarChart,
|
|
32
|
-
Button: OpenuiButton,
|
|
33
|
-
Buttons: OpenuiButtons,
|
|
34
|
-
Input: OpenuiInput,
|
|
35
|
-
Select: OpenuiSelect,
|
|
36
|
-
Checkbox: OpenuiCheckbox,
|
|
37
|
-
Form: OpenuiForm,
|
|
38
|
-
Option: OpenuiOption,
|
|
39
|
-
Question: OpenuiQuestion,
|
|
40
|
-
Questions: OpenuiQuestions,
|
|
41
|
-
FileCard: OpenuiFileCard,
|
|
42
|
-
Image: OpenuiImage,
|
|
43
|
-
Citation: OpenuiCitation
|
|
44
|
-
};
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import type { ElementNode } from '@openuidev/lang-core';
|
|
2
|
-
import type { PropType } from 'vue';
|
|
3
|
-
import type { RenderedNode } from './context.js';
|
|
4
|
-
/**
|
|
5
|
-
* One parsed element. Unknown components render nothing: the parser already
|
|
6
|
-
* reported them, and dropping a node is safer than showing raw text.
|
|
7
|
-
*/
|
|
8
|
-
export declare const OpenuiNode: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
9
|
-
node: {
|
|
10
|
-
type: PropType<ElementNode>;
|
|
11
|
-
required: true;
|
|
12
|
-
};
|
|
13
|
-
}>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
14
|
-
[key: string]: any;
|
|
15
|
-
}> | null, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
16
|
-
node: {
|
|
17
|
-
type: PropType<ElementNode>;
|
|
18
|
-
required: true;
|
|
19
|
-
};
|
|
20
|
-
}>> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
21
|
-
export declare function renderNode(value: unknown): RenderedNode;
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import { defineComponent, h, onErrorCaptured, ref, watch } from "vue";
|
|
2
|
-
import { OPENUI_REGISTRY } from "./registry.js";
|
|
3
|
-
function isElementNode(value) {
|
|
4
|
-
return typeof value === "object" && value !== null && value.type === "element";
|
|
5
|
-
}
|
|
6
|
-
export const OpenuiNode = defineComponent({
|
|
7
|
-
name: "OpenuiNode",
|
|
8
|
-
props: {
|
|
9
|
-
node: { type: Object, required: true }
|
|
10
|
-
},
|
|
11
|
-
setup(props) {
|
|
12
|
-
const failed = ref(false);
|
|
13
|
-
onErrorCaptured((error) => {
|
|
14
|
-
console.error("[openui] widget render failed", { component: props.node.typeName, error });
|
|
15
|
-
failed.value = true;
|
|
16
|
-
return false;
|
|
17
|
-
});
|
|
18
|
-
watch(() => props.node, () => {
|
|
19
|
-
failed.value = false;
|
|
20
|
-
});
|
|
21
|
-
return () => {
|
|
22
|
-
const component = OPENUI_REGISTRY[props.node.typeName];
|
|
23
|
-
if (!component || failed.value)
|
|
24
|
-
return null;
|
|
25
|
-
return h(component, { props: props.node.props, partial: props.node.partial });
|
|
26
|
-
};
|
|
27
|
-
}
|
|
28
|
-
});
|
|
29
|
-
export function renderNode(value) {
|
|
30
|
-
if (value == null)
|
|
31
|
-
return null;
|
|
32
|
-
if (typeof value === "string")
|
|
33
|
-
return value;
|
|
34
|
-
if (typeof value === "number" || typeof value === "boolean")
|
|
35
|
-
return String(value);
|
|
36
|
-
if (Array.isArray(value)) {
|
|
37
|
-
return value.flatMap((item, index) => {
|
|
38
|
-
const rendered = isElementNode(item) ? h(OpenuiNode, { node: item, key: item.statementId ?? `inline-${index}` }) : renderNode(item);
|
|
39
|
-
return Array.isArray(rendered) ? rendered : [rendered];
|
|
40
|
-
});
|
|
41
|
-
}
|
|
42
|
-
if (isElementNode(value))
|
|
43
|
-
return h(OpenuiNode, { node: value, key: value.statementId });
|
|
44
|
-
return null;
|
|
45
|
-
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { inject } from "vue";
|
|
2
|
-
import { OPENUI_CONTEXT_KEY } from "./context.js";
|
|
3
|
-
export function useOpenuiContext() {
|
|
4
|
-
const context = inject(OPENUI_CONTEXT_KEY, null);
|
|
5
|
-
if (!context)
|
|
6
|
-
throw new Error("OpenUI widgets must render inside OpenuiBlock");
|
|
7
|
-
return context;
|
|
8
|
-
}
|