dewee-webchat 0.3.0 → 0.4.1-beta.1

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/vue.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import * as vue from 'vue';
2
2
  import { PropType } from 'vue';
3
3
  export { ActionConfirmHook, ActionEventDetail, DeweeChatConfig, DeweeChatElement, PageAction, PageActionContext, RequestHeadersOption } from './index.js';
4
- import './protocol-B72Ry-fY.js';
4
+ import './protocol-CLbGE9Ns.js';
5
5
 
6
6
  declare const DeweeChat: vue.DefineComponent<vue.ExtractPropTypes<{
7
7
  endpoint: {
@@ -138,7 +138,7 @@ declare const DeweeChat: vue.DefineComponent<vue.ExtractPropTypes<{
138
138
  };
139
139
  }>, () => vue.VNode<vue.RendererNode, vue.RendererElement, {
140
140
  [key: string]: any;
141
- }>, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, ("open" | "ready" | "send" | "reply" | "error" | "close" | "action")[], "open" | "ready" | "send" | "reply" | "error" | "close" | "action", vue.PublicProps, Readonly<vue.ExtractPropTypes<{
141
+ }>, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, ("open" | "close" | "error" | "send" | "action" | "ready" | "reply")[], "open" | "close" | "error" | "send" | "action" | "ready" | "reply", vue.PublicProps, Readonly<vue.ExtractPropTypes<{
142
142
  endpoint: {
143
143
  type: PropType<any>;
144
144
  default: undefined;
@@ -272,11 +272,11 @@ declare const DeweeChat: vue.DefineComponent<vue.ExtractPropTypes<{
272
272
  default: undefined;
273
273
  };
274
274
  }>> & Readonly<{
275
- onOpen?: ((...args: any[]) => any) | undefined;
276
275
  onReady?: ((...args: any[]) => any) | undefined;
277
276
  onSend?: ((...args: any[]) => any) | undefined;
278
277
  onReply?: ((...args: any[]) => any) | undefined;
279
278
  onError?: ((...args: any[]) => any) | undefined;
279
+ onOpen?: ((...args: any[]) => any) | undefined;
280
280
  onClose?: ((...args: any[]) => any) | undefined;
281
281
  onAction?: ((...args: any[]) => any) | undefined;
282
282
  }>, {
package/dist/vue.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  defineDeweeChat
3
- } from "./chunk-ZTVGWFXL.js";
4
- import "./chunk-W6A4HVFB.js";
3
+ } from "./chunk-7WT3JK64.js";
4
+ import "./chunk-USXVB3AC.js";
5
5
 
6
6
  // src/vue.ts
7
7
  import { defineComponent, h, onMounted, ref, watch } from "vue";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dewee-webchat",
3
- "version": "0.3.0",
3
+ "version": "0.4.1-beta.1",
4
4
  "description": "Embeddable chat widget for Dewee AI agents — web component, React/Vue/Astro wrappers and a secure backend handler (Workers, Next.js, Node, Bun, Deno).",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -45,6 +45,10 @@
45
45
  "types": "./dist/server.d.ts",
46
46
  "import": "./dist/server.js"
47
47
  },
48
+ "./server/identity": {
49
+ "types": "./dist/server-identity.d.ts",
50
+ "import": "./dist/server-identity.js"
51
+ },
48
52
  "./react": {
49
53
  "types": "./dist/react.d.ts",
50
54
  "import": "./dist/react.js"
@@ -67,13 +71,18 @@
67
71
  "build": "node -e \"require('fs').rmSync('dist',{recursive:true,force:true})\" && tsup",
68
72
  "dev": "tsup --watch",
69
73
  "test": "vitest run",
74
+ "test:bundlers": "node scripts/bundler-smoke.mjs",
70
75
  "typecheck": "tsc --noEmit"
71
76
  },
72
77
  "peerDependencies": {
78
+ "@dewee/identity": ">=0.1.0-beta.0 <1",
73
79
  "react": ">=18",
74
80
  "vue": ">=3.3"
75
81
  },
76
82
  "peerDependenciesMeta": {
83
+ "@dewee/identity": {
84
+ "optional": true
85
+ },
77
86
  "react": {
78
87
  "optional": true
79
88
  },
@@ -82,15 +91,18 @@
82
91
  }
83
92
  },
84
93
  "devDependencies": {
94
+ "@dewee/identity": "file:../../vendor/dewee-identity-0.1.0-beta.0.tgz",
85
95
  "@types/node": "^22.15.0",
86
96
  "@types/react": "^19.1.0",
87
97
  "@types/ws": "^8.18.2",
98
+ "esbuild": "^0.28.2",
88
99
  "happy-dom": "^18.0.1",
89
100
  "react": "^19.1.0",
90
101
  "tsup": "^8.5.0",
91
102
  "typescript": "^5.9.2",
92
103
  "vitest": "^3.2.4",
93
104
  "vue": "^3.5.18",
105
+ "webpack": "^5.112.0",
94
106
  "ws": "^8.22.0"
95
107
  },
96
108
  "engines": {
@@ -1,92 +0,0 @@
1
- /** Server-Sent Events emitted by `POST {basePath}/chat`. */
2
- type ChatStreamEvent = {
3
- type: "start";
4
- runId?: string;
5
- conversationId: string;
6
- agent: string;
7
- actionsHash?: string;
8
- } | {
9
- type: "thinking";
10
- text: string;
11
- } | {
12
- type: "delta";
13
- text: string;
14
- } | {
15
- type: "tool_call";
16
- id: string;
17
- name: string;
18
- arguments?: unknown;
19
- } | {
20
- type: "tool_result";
21
- id: string;
22
- name: string;
23
- isError: boolean;
24
- result?: string;
25
- } | {
26
- type: "done";
27
- content: string;
28
- usage?: Record<string, number>;
29
- } | {
30
- type: "error";
31
- message: string;
32
- code?: string;
33
- };
34
- interface AgentInfo {
35
- id: string;
36
- name?: string;
37
- description?: string;
38
- }
39
- /** Response of `GET {basePath}/config` — safe to expose publicly. */
40
- interface PublicConfig {
41
- agents: AgentInfo[];
42
- defaultAgent: string;
43
- allowAgentSwitch: boolean;
44
- allowClientCredentials: boolean;
45
- turnstileSiteKey?: string;
46
- maxMessageLength: number;
47
- version: string;
48
- }
49
- /** Response of `POST {basePath}/session`. */
50
- interface SessionResponse {
51
- visitorId: string;
52
- token: string;
53
- expiresAt: number;
54
- }
55
- interface ToolCallView {
56
- id: string;
57
- name: string;
58
- arguments?: unknown;
59
- result?: string;
60
- isError?: boolean;
61
- status: "running" | "done" | "error";
62
- }
63
- /** A transcript message as returned by `GET {basePath}/history`. */
64
- interface HistoryMessage {
65
- role: "user" | "assistant";
66
- content: string;
67
- thinking?: string;
68
- toolCalls?: ToolCallView[];
69
- createdAt?: string;
70
- }
71
- /** How much an agent-invoked page action can change. `mutate`/`destructive` always need user approval. */
72
- type ActionSensitivity = "read" | "navigate" | "mutate" | "destructive";
73
- /** What the backend (and the agent) learns about a page action. Handlers never leave the browser. */
74
- interface ActionManifestEntry {
75
- name: string;
76
- description: string;
77
- /** JSON Schema subset describing `args` (object). */
78
- parameters: Record<string, unknown>;
79
- sensitivity: ActionSensitivity;
80
- }
81
- /** Body of `POST {basePath}/chat`. `actions`/`actionsHash`/`pageContext` are optional (page actions). */
82
- interface ChatRequestBody {
83
- message: string;
84
- agent?: string;
85
- conversationId?: string;
86
- actions?: ActionManifestEntry[];
87
- /** Hash from the `start` event of the last completed turn; the manifest is re-sent to the agent only when it differs. */
88
- actionsHash?: string;
89
- pageContext?: unknown;
90
- }
91
-
92
- export type { AgentInfo as A, ChatStreamEvent as C, HistoryMessage as H, PublicConfig as P, SessionResponse as S, ToolCallView as T, ActionManifestEntry as a, ActionSensitivity as b, ChatRequestBody as c };