@fayz-ai/sdk 0.8.3 → 0.8.5
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/agent.d.ts +57 -0
- package/dist/agent.d.ts.map +1 -1
- package/dist/agent.js +1 -1
- package/dist/{chunk-SKARZBEH.js → chunk-F6PAMHPI.js} +59 -59
- package/dist/{chunk-SKARZBEH.js.map → chunk-F6PAMHPI.js.map} +1 -1
- package/dist/chunk-LSBVNW75.js +139 -0
- package/dist/chunk-LSBVNW75.js.map +1 -0
- package/dist/{chunk-7ZHG7XTA.js → chunk-V4GWI7WH.js} +12 -13
- package/dist/chunk-V4GWI7WH.js.map +1 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -3
- package/dist/release-channels.js +1 -1
- package/dist/shop.d.ts.map +1 -1
- package/dist/shop.js +1 -1
- package/dist/vite.js +1 -1
- package/dist/vite.js.map +1 -1
- package/package.json +15 -24
- package/src/agent.ts +152 -5
- package/src/index.ts +3 -0
- package/src/release-channels.json +57 -57
- package/src/shop.ts +22 -20
- package/src/vite.ts +1 -1
- package/dist/agent.cjs +0 -16
- package/dist/agent.cjs.map +0 -1
- package/dist/ai-builder.cjs +0 -20
- package/dist/ai-builder.cjs.map +0 -1
- package/dist/app-params.cjs +0 -16
- package/dist/app-params.cjs.map +0 -1
- package/dist/chunk-746EA3BV.cjs +0 -774
- package/dist/chunk-746EA3BV.cjs.map +0 -1
- package/dist/chunk-7UZH4XEV.cjs +0 -66
- package/dist/chunk-7UZH4XEV.cjs.map +0 -1
- package/dist/chunk-7ZHG7XTA.js.map +0 -1
- package/dist/chunk-B6FHOO34.cjs +0 -63
- package/dist/chunk-B6FHOO34.cjs.map +0 -1
- package/dist/chunk-DAUDGR5N.cjs +0 -88
- package/dist/chunk-DAUDGR5N.cjs.map +0 -1
- package/dist/chunk-DK3ZA6NA.cjs +0 -139
- package/dist/chunk-DK3ZA6NA.cjs.map +0 -1
- package/dist/chunk-ENWSXKQE.cjs +0 -125
- package/dist/chunk-ENWSXKQE.cjs.map +0 -1
- package/dist/chunk-VPMRURSI.js +0 -63
- package/dist/chunk-VPMRURSI.js.map +0 -1
- package/dist/chunk-WMH7SIER.cjs +0 -140
- package/dist/chunk-WMH7SIER.cjs.map +0 -1
- package/dist/chunk-ZMHI2XGY.cjs +0 -68
- package/dist/chunk-ZMHI2XGY.cjs.map +0 -1
- package/dist/client.cjs +0 -22
- package/dist/client.cjs.map +0 -1
- package/dist/index.cjs +0 -103
- package/dist/index.cjs.map +0 -1
- package/dist/release-channels.cjs +0 -24
- package/dist/release-channels.cjs.map +0 -1
- package/dist/runtime.cjs +0 -16
- package/dist/runtime.cjs.map +0 -1
- package/dist/shop.cjs +0 -20
- package/dist/shop.cjs.map +0 -1
- package/dist/supported-surface.cjs +0 -24
- package/dist/supported-surface.cjs.map +0 -1
- package/dist/types.cjs +0 -4
- package/dist/types.cjs.map +0 -1
- package/dist/vite.cjs +0 -101
- package/dist/vite.cjs.map +0 -1
package/dist/agent.d.ts
CHANGED
|
@@ -34,6 +34,47 @@ export interface FayzAgentToolResult {
|
|
|
34
34
|
toolCallId: string;
|
|
35
35
|
content: string;
|
|
36
36
|
}
|
|
37
|
+
/**
|
|
38
|
+
* A file the user attached, described rather than uploaded.
|
|
39
|
+
*
|
|
40
|
+
* The bytes stay in the browser: a spreadsheet of clients or patients is
|
|
41
|
+
* personal data, and handing it to a model provider so it can "take a look" is
|
|
42
|
+
* a disclosure, not a convenience. What travels is the shape — sheets,
|
|
43
|
+
* headers, how many rows, the inferred type per column and a handful of sample
|
|
44
|
+
* rows. Enough to plan an import; never the data set itself.
|
|
45
|
+
*/
|
|
46
|
+
export interface AgentAttachmentColumn {
|
|
47
|
+
name: string;
|
|
48
|
+
type: 'text' | 'number' | 'date' | 'boolean' | 'email' | 'phone';
|
|
49
|
+
/** Literal shape when known ('dd/mm/yyyy', '1.234,56'). */
|
|
50
|
+
format?: string;
|
|
51
|
+
/** Why the column is not the type it looks like (ambiguous dates, mixed values). */
|
|
52
|
+
note?: string;
|
|
53
|
+
}
|
|
54
|
+
export interface AgentAttachmentSheet {
|
|
55
|
+
name: string;
|
|
56
|
+
headers: string[];
|
|
57
|
+
rowCount?: number;
|
|
58
|
+
sample: string[][];
|
|
59
|
+
columnTypes: AgentAttachmentColumn[];
|
|
60
|
+
}
|
|
61
|
+
export interface AgentAttachmentDigest {
|
|
62
|
+
id: string;
|
|
63
|
+
name: string;
|
|
64
|
+
mime: string;
|
|
65
|
+
size: number;
|
|
66
|
+
kind: 'spreadsheet' | 'csv' | 'text' | 'image' | 'pdf' | 'binary';
|
|
67
|
+
/** Multi-tab spreadsheets. Single-tab files use the flat fields below. */
|
|
68
|
+
sheets?: AgentAttachmentSheet[];
|
|
69
|
+
headers?: string[];
|
|
70
|
+
rowCount?: number;
|
|
71
|
+
sample?: string[][];
|
|
72
|
+
columnTypes?: AgentAttachmentColumn[];
|
|
73
|
+
/** Head of a text/markdown file. */
|
|
74
|
+
preview?: string;
|
|
75
|
+
/** What the reader had to guess at, truncate or give up on. */
|
|
76
|
+
warnings?: string[];
|
|
77
|
+
}
|
|
37
78
|
export interface FayzAgentChatInput {
|
|
38
79
|
/** New end-user message. Omit when replying with tool results. */
|
|
39
80
|
message?: string;
|
|
@@ -51,6 +92,8 @@ export interface FayzAgentChatInput {
|
|
|
51
92
|
};
|
|
52
93
|
/** Runtime context the agent should know about (page, locale, tenant). */
|
|
53
94
|
context?: Record<string, unknown>;
|
|
95
|
+
/** Files the user attached this turn, as digests — never as bytes. */
|
|
96
|
+
attachments?: AgentAttachmentDigest[];
|
|
54
97
|
signal?: AbortSignal;
|
|
55
98
|
}
|
|
56
99
|
/** A server-plane write the broker parked pending human confirmation. */
|
|
@@ -88,6 +131,9 @@ export interface FayzAgentConversationMessage {
|
|
|
88
131
|
role: string;
|
|
89
132
|
content: string;
|
|
90
133
|
createdAt: string;
|
|
134
|
+
/** Files the user attached to this turn, as the digest that was sent. Only
|
|
135
|
+
* the description — the bytes never left the browser that produced them. */
|
|
136
|
+
attachments?: AgentAttachmentDigest[];
|
|
91
137
|
/** Tool calls this reply made, with their results — so a resumed thread shows
|
|
92
138
|
* the same trace and record links it showed live. */
|
|
93
139
|
toolCalls?: Array<{
|
|
@@ -101,10 +147,21 @@ export interface FayzAgentConversationDetail {
|
|
|
101
147
|
title: string | null;
|
|
102
148
|
messages: FayzAgentConversationMessage[];
|
|
103
149
|
}
|
|
150
|
+
export interface FayzAgentStreamCallbacks {
|
|
151
|
+
/** Fired per text delta with the accumulated text so far (fill-in-place UIs). */
|
|
152
|
+
onDelta?: (accumulated: string, delta: string) => void;
|
|
153
|
+
}
|
|
104
154
|
export interface FayzAgentClient {
|
|
105
155
|
/** Identity of the agent behind the key, for rendering its name/icon. */
|
|
106
156
|
getInfo(signal?: AbortSignal): Promise<FayzAgentInfo>;
|
|
107
157
|
chat(input: FayzAgentChatInput): Promise<FayzAgentChatResponse>;
|
|
158
|
+
/**
|
|
159
|
+
* Like `chat`, but asks the broker for an SSE stream (`Accept:
|
|
160
|
+
* text/event-stream`) and reports text deltas as they arrive. Falls back
|
|
161
|
+
* transparently to the JSON round-trip when the broker predates streaming —
|
|
162
|
+
* callers can always use this and treat `onDelta` as best-effort.
|
|
163
|
+
*/
|
|
164
|
+
chatStream(input: FayzAgentChatInput, callbacks?: FayzAgentStreamCallbacks): Promise<FayzAgentChatResponse>;
|
|
108
165
|
/** The signed-in user's own threads, most-recently-active first. */
|
|
109
166
|
listConversations(externalUserId?: string, signal?: AbortSignal): Promise<FayzAgentConversationSummary[]>;
|
|
110
167
|
/** One thread with its transcript — 404s on another user's thread. */
|
package/dist/agent.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent.d.ts","sourceRoot":"","sources":["../src/agent.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,MAAM,WAAW,sBAAsB;IACrC,8C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AAW,GACnB,OAAO,CAAC,2BAA2B,CAAC,CAAA;CACxC;AAWD,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,sBAAsB,GAAG,eAAe,CAoItF"}
|
package/dist/agent.js
CHANGED
|
@@ -2,103 +2,103 @@
|
|
|
2
2
|
var release_channels_default = {
|
|
3
3
|
channels: {
|
|
4
4
|
stable: {
|
|
5
|
-
"@fayz-ai/sdk": "^0.8.
|
|
6
|
-
"@fayz-ai/core": "^0.8.
|
|
7
|
-
"@fayz-ai/auth": "^0.8.
|
|
8
|
-
"@fayz-ai/ui": "^0.8.
|
|
9
|
-
"@fayz-ai/saas": "^0.8.
|
|
10
|
-
"@fayz-ai/shop": "^0.8.
|
|
11
|
-
"@fayz-ai/storefront": "^0.8.
|
|
5
|
+
"@fayz-ai/sdk": "^0.8.4",
|
|
6
|
+
"@fayz-ai/core": "^0.8.4",
|
|
7
|
+
"@fayz-ai/auth": "^0.8.4",
|
|
8
|
+
"@fayz-ai/ui": "^0.8.4",
|
|
9
|
+
"@fayz-ai/saas": "^0.8.4",
|
|
10
|
+
"@fayz-ai/shop": "^0.8.4",
|
|
11
|
+
"@fayz-ai/storefront": "^0.8.4",
|
|
12
12
|
"@fayz-ai/portal": "^0.8.0",
|
|
13
|
-
"@fayz-ai/courses": "^0.8.
|
|
14
|
-
"@fayz-ai/db": "^0.8.
|
|
15
|
-
"@fayz-ai/plugin-agenda": "^0.8.
|
|
13
|
+
"@fayz-ai/courses": "^0.8.1",
|
|
14
|
+
"@fayz-ai/db": "^0.8.4",
|
|
15
|
+
"@fayz-ai/plugin-agenda": "^0.8.4",
|
|
16
16
|
"@fayz-ai/plugin-auth": "^0.8.0",
|
|
17
17
|
"@fayz-ai/plugin-automations": "^0.8.0",
|
|
18
18
|
"@fayz-ai/plugin-blog": "^0.8.1",
|
|
19
|
-
"@fayz-ai/plugin-conversations": "^0.8.
|
|
20
|
-
"@fayz-ai/plugin-courses": "^0.8.
|
|
21
|
-
"@fayz-ai/plugin-crm": "^0.8.
|
|
19
|
+
"@fayz-ai/plugin-conversations": "^0.8.3",
|
|
20
|
+
"@fayz-ai/plugin-courses": "^0.8.4",
|
|
21
|
+
"@fayz-ai/plugin-crm": "^0.8.4",
|
|
22
22
|
"@fayz-ai/plugin-dashboard": "^0.8.0",
|
|
23
|
-
"@fayz-ai/plugin-financial": "^0.8.
|
|
24
|
-
"@fayz-ai/plugin-forms": "^0.8.
|
|
25
|
-
"@fayz-ai/plugin-inventory": "^0.8.
|
|
26
|
-
"@fayz-ai/plugin-marketing": "^0.8.
|
|
23
|
+
"@fayz-ai/plugin-financial": "^0.8.4",
|
|
24
|
+
"@fayz-ai/plugin-forms": "^0.8.1",
|
|
25
|
+
"@fayz-ai/plugin-inventory": "^0.8.3",
|
|
26
|
+
"@fayz-ai/plugin-marketing": "^0.8.2",
|
|
27
27
|
"@fayz-ai/plugin-menu": "^0.8.0",
|
|
28
28
|
"@fayz-ai/plugin-orders": "^0.8.0",
|
|
29
29
|
"@fayz-ai/plugin-payments": "^0.8.0",
|
|
30
30
|
"@fayz-ai/plugin-reports": "^0.8.0",
|
|
31
31
|
"@fayz-ai/plugin-reputation": "^0.8.0",
|
|
32
|
-
"@fayz-ai/plugin-shop": "^0.8.
|
|
32
|
+
"@fayz-ai/plugin-shop": "^0.8.4",
|
|
33
33
|
"@fayz-ai/plugin-sites": "^0.8.0",
|
|
34
34
|
"@fayz-ai/plugin-tables": "^0.8.0",
|
|
35
|
-
"@fayz-ai/plugin-tasks": "^0.8.
|
|
35
|
+
"@fayz-ai/plugin-tasks": "^0.8.3"
|
|
36
36
|
},
|
|
37
37
|
latest: {
|
|
38
|
-
"@fayz-ai/sdk": "^0.8.
|
|
39
|
-
"@fayz-ai/core": "^0.8.
|
|
40
|
-
"@fayz-ai/auth": "^0.8.
|
|
41
|
-
"@fayz-ai/ui": "^0.8.
|
|
42
|
-
"@fayz-ai/saas": "^0.8.
|
|
43
|
-
"@fayz-ai/shop": "^0.8.
|
|
44
|
-
"@fayz-ai/storefront": "^0.8.
|
|
38
|
+
"@fayz-ai/sdk": "^0.8.4",
|
|
39
|
+
"@fayz-ai/core": "^0.8.4",
|
|
40
|
+
"@fayz-ai/auth": "^0.8.4",
|
|
41
|
+
"@fayz-ai/ui": "^0.8.4",
|
|
42
|
+
"@fayz-ai/saas": "^0.8.4",
|
|
43
|
+
"@fayz-ai/shop": "^0.8.4",
|
|
44
|
+
"@fayz-ai/storefront": "^0.8.4",
|
|
45
45
|
"@fayz-ai/portal": "^0.8.0",
|
|
46
|
-
"@fayz-ai/courses": "^0.8.
|
|
47
|
-
"@fayz-ai/db": "^0.8.
|
|
48
|
-
"@fayz-ai/plugin-agenda": "^0.8.
|
|
46
|
+
"@fayz-ai/courses": "^0.8.1",
|
|
47
|
+
"@fayz-ai/db": "^0.8.4",
|
|
48
|
+
"@fayz-ai/plugin-agenda": "^0.8.4",
|
|
49
49
|
"@fayz-ai/plugin-auth": "^0.8.0",
|
|
50
50
|
"@fayz-ai/plugin-automations": "^0.8.0",
|
|
51
51
|
"@fayz-ai/plugin-blog": "^0.8.1",
|
|
52
|
-
"@fayz-ai/plugin-conversations": "^0.8.
|
|
53
|
-
"@fayz-ai/plugin-courses": "^0.8.
|
|
54
|
-
"@fayz-ai/plugin-crm": "^0.8.
|
|
52
|
+
"@fayz-ai/plugin-conversations": "^0.8.3",
|
|
53
|
+
"@fayz-ai/plugin-courses": "^0.8.4",
|
|
54
|
+
"@fayz-ai/plugin-crm": "^0.8.4",
|
|
55
55
|
"@fayz-ai/plugin-dashboard": "^0.8.0",
|
|
56
|
-
"@fayz-ai/plugin-financial": "^0.8.
|
|
57
|
-
"@fayz-ai/plugin-forms": "^0.8.
|
|
58
|
-
"@fayz-ai/plugin-inventory": "^0.8.
|
|
59
|
-
"@fayz-ai/plugin-marketing": "^0.8.
|
|
56
|
+
"@fayz-ai/plugin-financial": "^0.8.4",
|
|
57
|
+
"@fayz-ai/plugin-forms": "^0.8.1",
|
|
58
|
+
"@fayz-ai/plugin-inventory": "^0.8.3",
|
|
59
|
+
"@fayz-ai/plugin-marketing": "^0.8.2",
|
|
60
60
|
"@fayz-ai/plugin-menu": "^0.8.0",
|
|
61
61
|
"@fayz-ai/plugin-orders": "^0.8.0",
|
|
62
62
|
"@fayz-ai/plugin-payments": "^0.8.0",
|
|
63
63
|
"@fayz-ai/plugin-reports": "^0.8.0",
|
|
64
64
|
"@fayz-ai/plugin-reputation": "^0.8.0",
|
|
65
|
-
"@fayz-ai/plugin-shop": "^0.8.
|
|
65
|
+
"@fayz-ai/plugin-shop": "^0.8.4",
|
|
66
66
|
"@fayz-ai/plugin-sites": "^0.8.0",
|
|
67
67
|
"@fayz-ai/plugin-tables": "^0.8.0",
|
|
68
|
-
"@fayz-ai/plugin-tasks": "^0.8.
|
|
68
|
+
"@fayz-ai/plugin-tasks": "^0.8.3"
|
|
69
69
|
},
|
|
70
70
|
preview: {
|
|
71
|
-
"@fayz-ai/sdk": "^0.8.
|
|
72
|
-
"@fayz-ai/core": "^0.8.
|
|
73
|
-
"@fayz-ai/auth": "^0.8.
|
|
74
|
-
"@fayz-ai/ui": "^0.8.
|
|
75
|
-
"@fayz-ai/saas": "^0.8.
|
|
76
|
-
"@fayz-ai/shop": "^0.8.
|
|
77
|
-
"@fayz-ai/storefront": "^0.8.
|
|
71
|
+
"@fayz-ai/sdk": "^0.8.4",
|
|
72
|
+
"@fayz-ai/core": "^0.8.4",
|
|
73
|
+
"@fayz-ai/auth": "^0.8.4",
|
|
74
|
+
"@fayz-ai/ui": "^0.8.4",
|
|
75
|
+
"@fayz-ai/saas": "^0.8.4",
|
|
76
|
+
"@fayz-ai/shop": "^0.8.4",
|
|
77
|
+
"@fayz-ai/storefront": "^0.8.4",
|
|
78
78
|
"@fayz-ai/portal": "^0.8.0",
|
|
79
|
-
"@fayz-ai/courses": "^0.8.
|
|
80
|
-
"@fayz-ai/db": "^0.8.
|
|
81
|
-
"@fayz-ai/plugin-agenda": "^0.8.
|
|
79
|
+
"@fayz-ai/courses": "^0.8.1",
|
|
80
|
+
"@fayz-ai/db": "^0.8.4",
|
|
81
|
+
"@fayz-ai/plugin-agenda": "^0.8.4",
|
|
82
82
|
"@fayz-ai/plugin-auth": "^0.8.0",
|
|
83
83
|
"@fayz-ai/plugin-automations": "^0.8.0",
|
|
84
84
|
"@fayz-ai/plugin-blog": "^0.8.1",
|
|
85
|
-
"@fayz-ai/plugin-conversations": "^0.8.
|
|
86
|
-
"@fayz-ai/plugin-courses": "^0.8.
|
|
87
|
-
"@fayz-ai/plugin-crm": "^0.8.
|
|
85
|
+
"@fayz-ai/plugin-conversations": "^0.8.3",
|
|
86
|
+
"@fayz-ai/plugin-courses": "^0.8.4",
|
|
87
|
+
"@fayz-ai/plugin-crm": "^0.8.4",
|
|
88
88
|
"@fayz-ai/plugin-dashboard": "^0.8.0",
|
|
89
|
-
"@fayz-ai/plugin-financial": "^0.8.
|
|
90
|
-
"@fayz-ai/plugin-forms": "^0.8.
|
|
91
|
-
"@fayz-ai/plugin-inventory": "^0.8.
|
|
92
|
-
"@fayz-ai/plugin-marketing": "^0.8.
|
|
89
|
+
"@fayz-ai/plugin-financial": "^0.8.4",
|
|
90
|
+
"@fayz-ai/plugin-forms": "^0.8.1",
|
|
91
|
+
"@fayz-ai/plugin-inventory": "^0.8.3",
|
|
92
|
+
"@fayz-ai/plugin-marketing": "^0.8.2",
|
|
93
93
|
"@fayz-ai/plugin-menu": "^0.8.0",
|
|
94
94
|
"@fayz-ai/plugin-orders": "^0.8.0",
|
|
95
95
|
"@fayz-ai/plugin-payments": "^0.8.0",
|
|
96
96
|
"@fayz-ai/plugin-reports": "^0.8.0",
|
|
97
97
|
"@fayz-ai/plugin-reputation": "^0.8.0",
|
|
98
|
-
"@fayz-ai/plugin-shop": "^0.8.
|
|
98
|
+
"@fayz-ai/plugin-shop": "^0.8.4",
|
|
99
99
|
"@fayz-ai/plugin-sites": "^0.8.0",
|
|
100
100
|
"@fayz-ai/plugin-tables": "^0.8.0",
|
|
101
|
-
"@fayz-ai/plugin-tasks": "^0.8.
|
|
101
|
+
"@fayz-ai/plugin-tasks": "^0.8.3"
|
|
102
102
|
}
|
|
103
103
|
}
|
|
104
104
|
};
|
|
@@ -131,5 +131,5 @@ function resolveFayzPackageVersion(packageName, channel = "stable") {
|
|
|
131
131
|
}
|
|
132
132
|
|
|
133
133
|
export { fayzPackageVersionSets, resolveFayzPackageDependencies, resolveFayzPackageVersion, resolveFayzPackageVersions };
|
|
134
|
-
//# sourceMappingURL=chunk-
|
|
135
|
-
//# sourceMappingURL=chunk-
|
|
134
|
+
//# sourceMappingURL=chunk-F6PAMHPI.js.map
|
|
135
|
+
//# sourceMappingURL=chunk-F6PAMHPI.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/release-channels.json","../src/release-channels.ts"],"names":[],"mappings":";AAAA,IAAA,wBAAA,GAAA;AAAA,EACE,QAAA,EAAY;AAAA,IACV,MAAA,EAAU;AAAA,MACR,cAAA,EAAgB,QAAA;AAAA,MAChB,eAAA,EAAiB,QAAA;AAAA,MACjB,eAAA,EAAiB,QAAA;AAAA,MACjB,aAAA,EAAe,QAAA;AAAA,MACf,eAAA,EAAiB,QAAA;AAAA,MACjB,eAAA,EAAiB,QAAA;AAAA,MACjB,qBAAA,EAAuB,QAAA;AAAA,MACvB,iBAAA,EAAmB,QAAA;AAAA,MACnB,kBAAA,EAAoB,QAAA;AAAA,MACpB,aAAA,EAAe,QAAA;AAAA,MACf,wBAAA,EAA0B,QAAA;AAAA,MAC1B,sBAAA,EAAwB,QAAA;AAAA,MACxB,6BAAA,EAA+B,QAAA;AAAA,MAC/B,sBAAA,EAAwB,QAAA;AAAA,MACxB,+BAAA,EAAiC,QAAA;AAAA,MACjC,yBAAA,EAA2B,QAAA;AAAA,MAC3B,qBAAA,EAAuB,QAAA;AAAA,MACvB,2BAAA,EAA6B,QAAA;AAAA,MAC7B,2BAAA,EAA6B,QAAA;AAAA,MAC7B,uBAAA,EA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,IAAA,MAAM,IAAI,KAAA,CAAM,CAAA,uCAAA,EAA0C,WAAW,CAAA,IAAA,EAAO,OAAO,CAAA,QAAA,CAAU,CAAA;AAAA,EAC/F;AAEA,EAAA,OAAO,OAAA;AACT","file":"chunk-F6PAMHPI.js","sourcesContent":["{\n \"channels\": {\n \"stable\": {\n \"@fayz-ai/sdk\": \"^0.8.4\",\n \"@fayz-ai/core\": \"^0.8.4\",\n \"@fayz-ai/auth\": \"^0.8.4\",\n \"@fayz-ai/ui\": \"^0.8.4\",\n \"@fayz-ai/saas\": \"^0.8.4\",\n \"@fayz-ai/shop\": \"^0.8.4\",\n \"@fayz-ai/storefront\": \"^0.8.4\",\n \"@fayz-ai/portal\": \"^0.8.0\",\n \"@fayz-ai/courses\": \"^0.8.1\",\n \"@fayz-ai/db\": \"^0.8.4\",\n \"@fayz-ai/plugin-agenda\": \"^0.8.4\",\n \"@fayz-ai/plugin-auth\": \"^0.8.0\",\n \"@fayz-ai/plugin-automations\": \"^0.8.0\",\n \"@fayz-ai/plugin-blog\": \"^0.8.1\",\n \"@fayz-ai/plugin-conversations\": \"^0.8.3\",\n \"@fayz-ai/plugin-courses\": \"^0.8.4\",\n \"@fayz-ai/plugin-crm\": \"^0.8.4\",\n \"@fayz-ai/plugin-dashboard\": \"^0.8.0\",\n \"@fayz-ai/plugin-financial\": \"^0.8.4\",\n \"@fayz-ai/plugin-forms\": \"^0.8.1\",\n \"@fayz-ai/plugin-inventory\": \"^0.8.3\",\n \"@fayz-ai/plugin-marketing\": \"^0.8.2\",\n \"@fayz-ai/plugin-menu\": \"^0.8.0\",\n \"@fayz-ai/plugin-orders\": \"^0.8.0\",\n \"@fayz-ai/plugin-payments\": \"^0.8.0\",\n \"@fayz-ai/plugin-reports\": \"^0.8.0\",\n \"@fayz-ai/plugin-reputation\": \"^0.8.0\",\n \"@fayz-ai/plugin-shop\": \"^0.8.4\",\n \"@fayz-ai/plugin-sites\": \"^0.8.0\",\n \"@fayz-ai/plugin-tables\": \"^0.8.0\",\n \"@fayz-ai/plugin-tasks\": \"^0.8.3\"\n },\n \"latest\": {\n \"@fayz-ai/sdk\": \"^0.8.4\",\n \"@fayz-ai/core\": \"^0.8.4\",\n \"@fayz-ai/auth\": \"^0.8.4\",\n \"@fayz-ai/ui\": \"^0.8.4\",\n \"@fayz-ai/saas\": \"^0.8.4\",\n \"@fayz-ai/shop\": \"^0.8.4\",\n \"@fayz-ai/storefront\": \"^0.8.4\",\n \"@fayz-ai/portal\": \"^0.8.0\",\n \"@fayz-ai/courses\": \"^0.8.1\",\n \"@fayz-ai/db\": \"^0.8.4\",\n \"@fayz-ai/plugin-agenda\": \"^0.8.4\",\n \"@fayz-ai/plugin-auth\": \"^0.8.0\",\n \"@fayz-ai/plugin-automations\": \"^0.8.0\",\n \"@fayz-ai/plugin-blog\": \"^0.8.1\",\n \"@fayz-ai/plugin-conversations\": \"^0.8.3\",\n \"@fayz-ai/plugin-courses\": \"^0.8.4\",\n \"@fayz-ai/plugin-crm\": \"^0.8.4\",\n \"@fayz-ai/plugin-dashboard\": \"^0.8.0\",\n \"@fayz-ai/plugin-financial\": \"^0.8.4\",\n \"@fayz-ai/plugin-forms\": \"^0.8.1\",\n \"@fayz-ai/plugin-inventory\": \"^0.8.3\",\n \"@fayz-ai/plugin-marketing\": \"^0.8.2\",\n \"@fayz-ai/plugin-menu\": \"^0.8.0\",\n \"@fayz-ai/plugin-orders\": \"^0.8.0\",\n \"@fayz-ai/plugin-payments\": \"^0.8.0\",\n \"@fayz-ai/plugin-reports\": \"^0.8.0\",\n \"@fayz-ai/plugin-reputation\": \"^0.8.0\",\n \"@fayz-ai/plugin-shop\": \"^0.8.4\",\n \"@fayz-ai/plugin-sites\": \"^0.8.0\",\n \"@fayz-ai/plugin-tables\": \"^0.8.0\",\n \"@fayz-ai/plugin-tasks\": \"^0.8.3\"\n },\n \"preview\": {\n \"@fayz-ai/sdk\": \"^0.8.4\",\n \"@fayz-ai/core\": \"^0.8.4\",\n \"@fayz-ai/auth\": \"^0.8.4\",\n \"@fayz-ai/ui\": \"^0.8.4\",\n \"@fayz-ai/saas\": \"^0.8.4\",\n \"@fayz-ai/shop\": \"^0.8.4\",\n \"@fayz-ai/storefront\": \"^0.8.4\",\n \"@fayz-ai/portal\": \"^0.8.0\",\n \"@fayz-ai/courses\": \"^0.8.1\",\n \"@fayz-ai/db\": \"^0.8.4\",\n \"@fayz-ai/plugin-agenda\": \"^0.8.4\",\n \"@fayz-ai/plugin-auth\": \"^0.8.0\",\n \"@fayz-ai/plugin-automations\": \"^0.8.0\",\n \"@fayz-ai/plugin-blog\": \"^0.8.1\",\n \"@fayz-ai/plugin-conversations\": \"^0.8.3\",\n \"@fayz-ai/plugin-courses\": \"^0.8.4\",\n \"@fayz-ai/plugin-crm\": \"^0.8.4\",\n \"@fayz-ai/plugin-dashboard\": \"^0.8.0\",\n \"@fayz-ai/plugin-financial\": \"^0.8.4\",\n \"@fayz-ai/plugin-forms\": \"^0.8.1\",\n \"@fayz-ai/plugin-inventory\": \"^0.8.3\",\n \"@fayz-ai/plugin-marketing\": \"^0.8.2\",\n \"@fayz-ai/plugin-menu\": \"^0.8.0\",\n \"@fayz-ai/plugin-orders\": \"^0.8.0\",\n \"@fayz-ai/plugin-payments\": \"^0.8.0\",\n \"@fayz-ai/plugin-reports\": \"^0.8.0\",\n \"@fayz-ai/plugin-reputation\": \"^0.8.0\",\n \"@fayz-ai/plugin-shop\": \"^0.8.4\",\n \"@fayz-ai/plugin-sites\": \"^0.8.0\",\n \"@fayz-ai/plugin-tables\": \"^0.8.0\",\n \"@fayz-ai/plugin-tasks\": \"^0.8.3\"\n }\n }\n}\n","import releaseChannels from './release-channels.json'\n\nexport type FayzPackageChannel = 'stable' | 'latest' | 'preview'\n\nexport interface FayzPackageVersionSet {\n channel: FayzPackageChannel\n packages: Record<string, string>\n}\n\nconst releaseChannelPackages = releaseChannels.channels as Record<FayzPackageChannel, Record<string, string>>\n\nfunction buildVersionSet(channel: FayzPackageChannel): FayzPackageVersionSet {\n return {\n channel,\n packages: { ...releaseChannelPackages[channel] },\n }\n}\n\nexport const fayzPackageVersionSets: Record<FayzPackageChannel, FayzPackageVersionSet> = {\n stable: buildVersionSet('stable'),\n latest: buildVersionSet('latest'),\n preview: buildVersionSet('preview'),\n}\n\nexport function resolveFayzPackageVersions(channel: FayzPackageChannel = 'stable'): FayzPackageVersionSet {\n return fayzPackageVersionSets[channel]\n}\n\nexport function resolveFayzPackageDependencies(channel: FayzPackageChannel = 'stable'): Record<string, string> {\n return { ...resolveFayzPackageVersions(channel).packages }\n}\n\nexport function resolveFayzPackageVersion(packageName: string, channel: FayzPackageChannel = 'stable'): string {\n const version = resolveFayzPackageVersions(channel).packages[packageName]\n\n if (!version) {\n throw new Error(`No Fayz package version configured for ${packageName} in ${channel} channel`)\n }\n\n return version\n}\n"]}
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
// src/agent.ts
|
|
2
|
+
var FayzAgentError = class extends Error {
|
|
3
|
+
constructor(message, status) {
|
|
4
|
+
super(message);
|
|
5
|
+
this.status = status;
|
|
6
|
+
this.name = "FayzAgentError";
|
|
7
|
+
}
|
|
8
|
+
};
|
|
9
|
+
function normalizeResponse(body) {
|
|
10
|
+
return {
|
|
11
|
+
conversationId: body.conversationId ?? "",
|
|
12
|
+
content: body.content ?? "",
|
|
13
|
+
toolCalls: body.toolCalls ?? [],
|
|
14
|
+
...body.pendingAction ? { pendingAction: body.pendingAction } : {}
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
function createFayzAgentClient(options) {
|
|
18
|
+
const fetcher = options.fetcher ?? globalThis.fetch;
|
|
19
|
+
const base = `${options.baseUrl.replace(/\/+$/, "")}/public/projects/${options.projectId}/agents`;
|
|
20
|
+
const headers = {
|
|
21
|
+
"Content-Type": "application/json",
|
|
22
|
+
"x-fayz-agent-key": options.publishableKey
|
|
23
|
+
};
|
|
24
|
+
async function request(path, init) {
|
|
25
|
+
const response = await fetcher(`${base}${path}`, { ...init, headers });
|
|
26
|
+
if (!response.ok) {
|
|
27
|
+
const body = await response.json().catch(() => null);
|
|
28
|
+
throw new FayzAgentError(body?.error ?? `Agent request failed (${response.status})`, response.status);
|
|
29
|
+
}
|
|
30
|
+
return await response.json();
|
|
31
|
+
}
|
|
32
|
+
return {
|
|
33
|
+
async getInfo(signal) {
|
|
34
|
+
const body = await request("/config", { method: "GET", signal });
|
|
35
|
+
return body.agent;
|
|
36
|
+
},
|
|
37
|
+
async chat({ signal, ...input }) {
|
|
38
|
+
const body = await request("/chat", {
|
|
39
|
+
method: "POST",
|
|
40
|
+
body: JSON.stringify(input),
|
|
41
|
+
signal
|
|
42
|
+
});
|
|
43
|
+
return normalizeResponse(body);
|
|
44
|
+
},
|
|
45
|
+
async chatStream({ signal, ...input }, callbacks) {
|
|
46
|
+
const response = await fetcher(`${base}/chat`, {
|
|
47
|
+
method: "POST",
|
|
48
|
+
body: JSON.stringify(input),
|
|
49
|
+
signal,
|
|
50
|
+
headers: { ...headers, Accept: "text/event-stream" }
|
|
51
|
+
});
|
|
52
|
+
if (!response.ok) {
|
|
53
|
+
const body = await response.json().catch(() => null);
|
|
54
|
+
throw new FayzAgentError(body?.error ?? `Agent request failed (${response.status})`, response.status);
|
|
55
|
+
}
|
|
56
|
+
const contentType = response.headers.get("content-type") ?? "";
|
|
57
|
+
if (!contentType.includes("text/event-stream") || !response.body) {
|
|
58
|
+
return normalizeResponse(await response.json());
|
|
59
|
+
}
|
|
60
|
+
const reader = response.body.getReader();
|
|
61
|
+
const decoder = new TextDecoder();
|
|
62
|
+
let buffer = "";
|
|
63
|
+
let accumulated = "";
|
|
64
|
+
let done = null;
|
|
65
|
+
const dispatch = (eventName2, data) => {
|
|
66
|
+
if (!data) return;
|
|
67
|
+
let payload;
|
|
68
|
+
try {
|
|
69
|
+
payload = JSON.parse(data);
|
|
70
|
+
} catch {
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
if (eventName2 === "delta") {
|
|
74
|
+
const text = typeof payload.text === "string" ? payload.text : "";
|
|
75
|
+
if (text) {
|
|
76
|
+
accumulated += text;
|
|
77
|
+
callbacks?.onDelta?.(accumulated, text);
|
|
78
|
+
}
|
|
79
|
+
} else if (eventName2 === "done") {
|
|
80
|
+
done = payload;
|
|
81
|
+
} else if (eventName2 === "error") {
|
|
82
|
+
throw new FayzAgentError(
|
|
83
|
+
typeof payload.error === "string" ? payload.error : "Agent stream failed",
|
|
84
|
+
response.status
|
|
85
|
+
);
|
|
86
|
+
}
|
|
87
|
+
};
|
|
88
|
+
let eventName = "message";
|
|
89
|
+
let dataLines = [];
|
|
90
|
+
const processLine = (line) => {
|
|
91
|
+
if (line === "") {
|
|
92
|
+
dispatch(eventName, dataLines.join("\n"));
|
|
93
|
+
eventName = "message";
|
|
94
|
+
dataLines = [];
|
|
95
|
+
} else if (line.startsWith("event:")) {
|
|
96
|
+
eventName = line.slice(6).trim();
|
|
97
|
+
} else if (line.startsWith("data:")) {
|
|
98
|
+
dataLines.push(line.slice(5).trimStart());
|
|
99
|
+
}
|
|
100
|
+
};
|
|
101
|
+
for (; ; ) {
|
|
102
|
+
const { value, done: streamDone } = await reader.read();
|
|
103
|
+
if (streamDone) break;
|
|
104
|
+
buffer += decoder.decode(value, { stream: true });
|
|
105
|
+
let newline = buffer.indexOf("\n");
|
|
106
|
+
while (newline >= 0) {
|
|
107
|
+
processLine(buffer.slice(0, newline).replace(/\r$/, ""));
|
|
108
|
+
buffer = buffer.slice(newline + 1);
|
|
109
|
+
newline = buffer.indexOf("\n");
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
processLine(buffer.replace(/\r$/, ""));
|
|
113
|
+
processLine("");
|
|
114
|
+
const finalPayload = { ...done ?? {} };
|
|
115
|
+
if (!finalPayload.content) finalPayload.content = accumulated;
|
|
116
|
+
return normalizeResponse(finalPayload);
|
|
117
|
+
},
|
|
118
|
+
async listConversations(externalUserId, signal) {
|
|
119
|
+
const query = externalUserId ? `?externalUserId=${encodeURIComponent(externalUserId)}` : "";
|
|
120
|
+
const body = await request(
|
|
121
|
+
`/conversations${query}`,
|
|
122
|
+
{ method: "GET", signal }
|
|
123
|
+
);
|
|
124
|
+
return body.conversations ?? [];
|
|
125
|
+
},
|
|
126
|
+
async getConversation(conversationId, externalUserId, signal) {
|
|
127
|
+
const query = externalUserId ? `?externalUserId=${encodeURIComponent(externalUserId)}` : "";
|
|
128
|
+
const body = await request(
|
|
129
|
+
`/conversations/${encodeURIComponent(conversationId)}${query}`,
|
|
130
|
+
{ method: "GET", signal }
|
|
131
|
+
);
|
|
132
|
+
return body.conversation;
|
|
133
|
+
}
|
|
134
|
+
};
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
export { FayzAgentError, createFayzAgentClient };
|
|
138
|
+
//# sourceMappingURL=chunk-LSBVNW75.js.map
|
|
139
|
+
//# sourceMappingURL=chunk-LSBVNW75.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/agent.ts"],"names":["eventName"],"mappings":";AA+HO,IAAM,cAAA,GAAN,cAA6B,KAAA,CAAM;AAAA,EACxC,WAAA,CACE,SACS,MAAA,EACT;AACA,IAAA,KAAA,CAAM,OAAO,CAAA;AAFJ,IAAA,IAAA,CAAA,MAAA,GAAA,MAAA;AAGT,IAAA,IAAA,CAAK,IAAA,GAAO,gBAAA;AAAA,EACd;AACF;AA0DA,SAAS,kBAAkB,IAAA,EAA6D;AACtF,EAAA,OAAO;AAAA,IACL,cAAA,EAAgB,KAAK,cAAA,IAAkB,EAAA;AAAA,IACvC,OAAA,EAAS,KAAK,OAAA,IAAW,EAAA;AAAA,IACzB,SAAA,EAAW,IAAA,CAAK,SAAA,IAAa,EAAC;AAAA,IAC9B,GAAI,KAAK,aAAA,GAAgB,EAAE,eAAe,IAAA,CAAK,aAAA,KAAkB;AAAC,GACpE;AACF;AAEO,SAAS,sBAAsB,OAAA,EAAkD;AACtF,EAAA,MAAM,OAAA,GAAU,OAAA,CAAQ,OA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AA,CAAA,GAAK,EAAA;AACzF,MAAA,MAAM,OAAO,MAAM,OAAA;AAAA,QACjB,iBAAiB,KAAK,CAAA,CAAA;AAAA,QACtB,EAAE,MAAA,EAAQ,KAAA,EAAO,MAAA;AAAO,OAC1B;AACA,MAAA,OAAO,IAAA,CAAK,iBAAiB,EAAC;AAAA,IAChC,CAAA;AAAA,IAEA,MAAM,eAAA,CAAgB,cAAA,EAAgB,cAAA,EAAgB,MAAA,EAAQ;AAC5D,MAAA,MAAM,QAAQ,cAAA,GAAiB,CAAA,gBAAA,EAAmB,kBAAA,CAAmB,cAAc,CAAC,CAAA,CAAA,GAAK,EAAA;AACzF,MAAA,MAAM,OAAO,MAAM,OAAA;AAAA,QACjB,CAAA,eAAA,EAAkB,kBAAA,CAAmB,cAAc,CAAC,GAAG,KAAK,CAAA,CAAA;AAAA,QAC5D,EAAE,MAAA,EAAQ,KAAA,EAAO,MAAA;AAAO,OAC1B;AACA,MAAA,OAAO,IAAA,CAAK,YAAA;AAAA,IACd;AAAA,GACF;AACF","file":"chunk-LSBVNW75.js","sourcesContent":["/**\n * Client for the Fayz agent broker — the runtime surface a generated app uses\n * to reach the AI agent configured for its project in Fayz.\n *\n * Mirrors `createFayzShopProvider`: the app holds a publishable key, Fayz holds\n * the model credentials. The key ships in the bundle the same way a Supabase\n * anon key does; it only ever resolves to the one agent its web channel belongs\n * to, and the broker rate-limits per project.\n *\n * Tools are client-plane. The app declares what it can do (`tools`), the model\n * decides what to call, and the app executes the calls against its own session\n * before handing results back. Fayz never needs the app's data credentials.\n */\n\nexport interface FayzAgentClientOptions {\n /** Fayz API base, e.g. https://fayz.ai/api */\n baseUrl: string\n projectId: string\n /** Publishable key of the project's WEB agent channel. */\n publishableKey: string\n fetcher?: typeof fetch\n}\n\nexport interface FayzAgentTool {\n name: string\n description: string\n /** JSON Schema for the tool's arguments. */\n parameters?: Record<string, unknown>\n}\n\nexport interface FayzAgentToolCall {\n id: string\n name: string\n arguments: Record<string, unknown>\n}\n\nexport interface FayzAgentToolResult {\n toolCallId: string\n content: string\n}\n\n/**\n * A file the user attached, described rather than uploaded.\n *\n * The bytes stay in the browser: a spreadsheet of clients or patients is\n * personal data, and handing it to a model provider so it can \"take a look\" is\n * a disclosure, not a convenience. What travels is the shape — sheets,\n * headers, how many rows, the inferred type per column and a handful of sample\n * rows. Enough to plan an import; never the data set itself.\n */\nexport interface AgentAttachmentColumn {\n name: string\n type: 'text' | 'number' | 'date' | 'boolean' | 'email' | 'phone'\n /** Literal shape when known ('dd/mm/yyyy', '1.234,56'). */\n format?: string\n /** Why the column is not the type it looks like (ambiguous dates, mixed values). */\n note?: string\n}\n\nexport interface AgentAttachmentSheet {\n name: string\n headers: string[]\n rowCount?: number\n sample: string[][]\n columnTypes: AgentAttachmentColumn[]\n}\n\nexport interface AgentAttachmentDigest {\n id: string\n name: string\n mime: string\n size: number\n kind: 'spreadsheet' | 'csv' | 'text' | 'image' | 'pdf' | 'binary'\n /** Multi-tab spreadsheets. Single-tab files use the flat fields below. */\n sheets?: AgentAttachmentSheet[]\n headers?: string[]\n rowCount?: number\n sample?: string[][]\n columnTypes?: AgentAttachmentColumn[]\n /** Head of a text/markdown file. */\n preview?: string\n /** What the reader had to guess at, truncate or give up on. */\n warnings?: string[]\n}\n\nexport interface FayzAgentChatInput {\n /** New end-user message. Omit when replying with tool results. */\n message?: string\n conversationId?: string\n /** Identity of the end user, required by channels with an INTERNAL audience. */\n externalUserId?: string\n /** Human label for that user, so the owner's dashboard shows a name. */\n externalUserName?: string\n tools?: FayzAgentTool[]\n toolResults?: FayzAgentToolResult[]\n /** Decision for a server-parked write (broker PENDING_CONFIRMATION step). */\n confirmAction?: { id: string; approved: boolean }\n /** Runtime context the agent should know about (page, locale, tenant). */\n context?: Record<string, unknown>\n /** Files the user attached this turn, as digests — never as bytes. */\n attachments?: AgentAttachmentDigest[]\n signal?: AbortSignal\n}\n\n/** A server-plane write the broker parked pending human confirmation. */\nexport interface FayzAgentPendingAction {\n id: string\n toolName: string\n title?: string\n params?: Record<string, unknown>\n}\n\nexport interface FayzAgentChatResponse {\n conversationId: string\n content: string\n toolCalls: FayzAgentToolCall[]\n /** Present when the broker is waiting on a confirmAction for this write. */\n pendingAction?: FayzAgentPendingAction\n}\n\nexport interface FayzAgentInfo {\n id: string\n name: string\n description: string | null\n icon: string | null\n}\n\nexport class FayzAgentError extends Error {\n constructor(\n message: string,\n readonly status: number,\n ) {\n super(message)\n this.name = 'FayzAgentError'\n }\n}\n\nexport interface FayzAgentConversationSummary {\n id: string\n title: string | null\n /** Last activity — the field the list is ordered by. */\n updatedAt: string\n}\n\nexport interface FayzAgentConversationMessage {\n id: string\n role: string\n content: string\n createdAt: string\n /** Files the user attached to this turn, as the digest that was sent. Only\n * the description — the bytes never left the browser that produced them. */\n attachments?: AgentAttachmentDigest[]\n /** Tool calls this reply made, with their results — so a resumed thread shows\n * the same trace and record links it showed live. */\n toolCalls?: Array<{\n name: string\n arguments?: Record<string, unknown>\n result?: string\n }>\n}\n\nexport interface FayzAgentConversationDetail {\n id: string\n title: string | null\n messages: FayzAgentConversationMessage[]\n}\n\nexport interface FayzAgentStreamCallbacks {\n /** Fired per text delta with the accumulated text so far (fill-in-place UIs). */\n onDelta?: (accumulated: string, delta: string) => void\n}\n\nexport interface FayzAgentClient {\n /** Identity of the agent behind the key, for rendering its name/icon. */\n getInfo(signal?: AbortSignal): Promise<FayzAgentInfo>\n chat(input: FayzAgentChatInput): Promise<FayzAgentChatResponse>\n /**\n * Like `chat`, but asks the broker for an SSE stream (`Accept:\n * text/event-stream`) and reports text deltas as they arrive. Falls back\n * transparently to the JSON round-trip when the broker predates streaming —\n * callers can always use this and treat `onDelta` as best-effort.\n */\n chatStream(input: FayzAgentChatInput, callbacks?: FayzAgentStreamCallbacks): Promise<FayzAgentChatResponse>\n /** The signed-in user's own threads, most-recently-active first. */\n listConversations(externalUserId?: string, signal?: AbortSignal): Promise<FayzAgentConversationSummary[]>\n /** One thread with its transcript — 404s on another user's thread. */\n getConversation(\n conversationId: string,\n externalUserId?: string,\n signal?: AbortSignal,\n ): Promise<FayzAgentConversationDetail>\n}\n\nfunction normalizeResponse(body: Partial<FayzAgentChatResponse>): FayzAgentChatResponse {\n return {\n conversationId: body.conversationId ?? '',\n content: body.content ?? '',\n toolCalls: body.toolCalls ?? [],\n ...(body.pendingAction ? { pendingAction: body.pendingAction } : {}),\n }\n}\n\nexport function createFayzAgentClient(options: FayzAgentClientOptions): FayzAgentClient {\n const fetcher = options.fetcher ?? globalThis.fetch\n const base = `${options.baseUrl.replace(/\\/+$/, '')}/public/projects/${options.projectId}/agents`\n const headers = {\n 'Content-Type': 'application/json',\n 'x-fayz-agent-key': options.publishableKey,\n }\n\n async function request<T>(path: string, init: RequestInit): Promise<T> {\n const response = await fetcher(`${base}${path}`, { ...init, headers })\n if (!response.ok) {\n const body = (await response.json().catch(() => null)) as { error?: string } | null\n throw new FayzAgentError(body?.error ?? `Agent request failed (${response.status})`, response.status)\n }\n return (await response.json()) as T\n }\n\n return {\n async getInfo(signal) {\n const body = await request<{ agent: FayzAgentInfo }>('/config', { method: 'GET', signal })\n return body.agent\n },\n\n async chat({ signal, ...input }) {\n const body = await request<Partial<FayzAgentChatResponse>>('/chat', {\n method: 'POST',\n body: JSON.stringify(input),\n signal,\n })\n return normalizeResponse(body)\n },\n\n async chatStream({ signal, ...input }, callbacks) {\n const response = await fetcher(`${base}/chat`, {\n method: 'POST',\n body: JSON.stringify(input),\n signal,\n headers: { ...headers, Accept: 'text/event-stream' },\n })\n if (!response.ok) {\n const body = (await response.json().catch(() => null)) as { error?: string } | null\n throw new FayzAgentError(body?.error ?? `Agent request failed (${response.status})`, response.status)\n }\n // Broker predates streaming (or chose not to): plain JSON round-trip.\n const contentType = response.headers.get('content-type') ?? ''\n if (!contentType.includes('text/event-stream') || !response.body) {\n return normalizeResponse((await response.json()) as Partial<FayzAgentChatResponse>)\n }\n\n const reader = response.body.getReader()\n const decoder = new TextDecoder()\n let buffer = ''\n let accumulated = ''\n let done: Partial<FayzAgentChatResponse> | null = null\n\n const dispatch = (eventName: string, data: string) => {\n if (!data) return\n let payload: Record<string, unknown>\n try {\n payload = JSON.parse(data) as Record<string, unknown>\n } catch {\n return\n }\n if (eventName === 'delta') {\n const text = typeof payload.text === 'string' ? payload.text : ''\n if (text) {\n accumulated += text\n callbacks?.onDelta?.(accumulated, text)\n }\n } else if (eventName === 'done') {\n done = payload as Partial<FayzAgentChatResponse>\n } else if (eventName === 'error') {\n throw new FayzAgentError(\n typeof payload.error === 'string' ? payload.error : 'Agent stream failed',\n response.status,\n )\n }\n }\n\n let eventName = 'message'\n let dataLines: string[] = []\n const processLine = (line: string) => {\n if (line === '') {\n dispatch(eventName, dataLines.join('\\n'))\n eventName = 'message'\n dataLines = []\n } else if (line.startsWith('event:')) {\n eventName = line.slice(6).trim()\n } else if (line.startsWith('data:')) {\n dataLines.push(line.slice(5).trimStart())\n }\n }\n\n for (;;) {\n const { value, done: streamDone } = await reader.read()\n if (streamDone) break\n buffer += decoder.decode(value, { stream: true })\n let newline = buffer.indexOf('\\n')\n while (newline >= 0) {\n processLine(buffer.slice(0, newline).replace(/\\r$/, ''))\n buffer = buffer.slice(newline + 1)\n newline = buffer.indexOf('\\n')\n }\n }\n processLine(buffer.replace(/\\r$/, ''))\n processLine('')\n\n // The final `done` event carries the same payload shape as the JSON\n // route; accumulated deltas back-fill `content` if the broker omits it.\n const finalPayload: Partial<FayzAgentChatResponse> = { ...(done ?? {}) }\n if (!finalPayload.content) finalPayload.content = accumulated\n return normalizeResponse(finalPayload)\n },\n\n async listConversations(externalUserId, signal) {\n const query = externalUserId ? `?externalUserId=${encodeURIComponent(externalUserId)}` : ''\n const body = await request<{ conversations?: FayzAgentConversationSummary[] }>(\n `/conversations${query}`,\n { method: 'GET', signal },\n )\n return body.conversations ?? []\n },\n\n async getConversation(conversationId, externalUserId, signal) {\n const query = externalUserId ? `?externalUserId=${encodeURIComponent(externalUserId)}` : ''\n const body = await request<{ conversation: FayzAgentConversationDetail }>(\n `/conversations/${encodeURIComponent(conversationId)}${query}`,\n { method: 'GET', signal },\n )\n return body.conversation\n },\n }\n}\n"]}
|
|
@@ -325,19 +325,18 @@ function createFayzShopProvider(options) {
|
|
|
325
325
|
query.set("order", "created_at.desc");
|
|
326
326
|
if (options2?.limit) query.set("limit", String(options2.limit));
|
|
327
327
|
if (options2?.offset) query.set("offset", String(options2.offset));
|
|
328
|
+
let rows = [];
|
|
328
329
|
try {
|
|
329
|
-
|
|
330
|
-
} catch (
|
|
331
|
-
if (!options2?.customerId) throw
|
|
332
|
-
const rows = await request("rpc/shop_list_orders", {
|
|
333
|
-
method: "POST",
|
|
334
|
-
body: JSON.stringify({
|
|
335
|
-
p_customer_id: options2.customerId,
|
|
336
|
-
p_limit: options2.limit ?? 50
|
|
337
|
-
})
|
|
338
|
-
});
|
|
339
|
-
return (rows ?? []).map(rowToOrder);
|
|
330
|
+
rows = await request("plg_shop_orders", { query });
|
|
331
|
+
} catch (error) {
|
|
332
|
+
if (!options2?.customerId) throw error;
|
|
340
333
|
}
|
|
334
|
+
if (rows.length || !options2?.customerId) return rows.map(rowToOrder);
|
|
335
|
+
const rpcRows = await request("rpc/shop_list_orders", {
|
|
336
|
+
method: "POST",
|
|
337
|
+
body: JSON.stringify({ p_customer_id: options2.customerId, p_limit: options2.limit ?? 50 })
|
|
338
|
+
});
|
|
339
|
+
return (rpcRows ?? []).map(rowToOrder);
|
|
341
340
|
},
|
|
342
341
|
async getOrder(id) {
|
|
343
342
|
const query = singleById(id);
|
|
@@ -766,5 +765,5 @@ function createBrokerShopProvider(options) {
|
|
|
766
765
|
}
|
|
767
766
|
|
|
768
767
|
export { FayzShopError, createFayzShopProvider, setShopAccessTokenResolver };
|
|
769
|
-
//# sourceMappingURL=chunk-
|
|
770
|
-
//# sourceMappingURL=chunk-
|
|
768
|
+
//# sourceMappingURL=chunk-V4GWI7WH.js.map
|
|
769
|
+
//# sourceMappingURL=chunk-V4GWI7WH.js.map
|