dewee-webchat 0.3.0 → 0.4.1-beta.2
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 +237 -22
- package/dist/{chunk-ZTVGWFXL.js → chunk-2NRPUV6T.js} +580 -42
- package/dist/{chunk-W6A4HVFB.js → chunk-PUIN5ZCQ.js} +52 -7
- package/dist/dewee-webchat.js +36 -29
- package/dist/handler-DunrbnSD.d.ts +307 -0
- package/dist/index.d.ts +91 -7
- package/dist/index.js +2 -2
- package/dist/protocol-CLbGE9Ns.d.ts +170 -0
- package/dist/react.d.ts +1 -1
- package/dist/react.js +2 -2
- package/dist/server-identity.d.ts +6 -0
- package/dist/server-identity.js +6 -0
- package/dist/server.d.ts +33 -75
- package/dist/server.js +1507 -41
- package/dist/vue.d.ts +1 -1
- package/dist/vue.js +2 -2
- package/package.json +13 -1
- package/dist/protocol-B72Ry-fY.d.ts +0 -92
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-
|
|
4
|
+
import './protocol-CLbGE9Ns.js';
|
|
5
5
|
|
|
6
6
|
declare const DeweeChat: vue.DefineComponent<vue.ExtractPropTypes<{
|
|
7
7
|
endpoint: {
|
package/dist/vue.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dewee-webchat",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.1-beta.2",
|
|
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 };
|