@fayz-ai/sdk 0.8.4 → 0.9.0-next.0
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 +46 -0
- package/dist/agent.d.ts.map +1 -1
- package/dist/agent.js +1 -1
- package/dist/{chunk-CTQGNKJD.js → chunk-LSBVNW75.js} +2 -2
- package/dist/chunk-LSBVNW75.js.map +1 -0
- package/dist/{chunk-SKARZBEH.js → chunk-YZQW3BJA.js} +59 -59
- package/dist/{chunk-SKARZBEH.js.map → chunk-YZQW3BJA.js.map} +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -2
- package/dist/release-channels.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 +49 -0
- package/src/index.ts +3 -0
- package/src/release-channels.json +57 -57
- 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-B6FHOO34.cjs +0 -63
- package/dist/chunk-B6FHOO34.cjs.map +0 -1
- package/dist/chunk-CTQGNKJD.js.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-EUC3F4WH.cjs +0 -773
- package/dist/chunk-EUC3F4WH.cjs.map +0 -1
- package/dist/chunk-F547THSH.cjs +0 -142
- package/dist/chunk-F547THSH.cjs.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/src/agent.ts
CHANGED
|
@@ -39,6 +39,50 @@ export interface FayzAgentToolResult {
|
|
|
39
39
|
content: string
|
|
40
40
|
}
|
|
41
41
|
|
|
42
|
+
/**
|
|
43
|
+
* A file the user attached, described rather than uploaded.
|
|
44
|
+
*
|
|
45
|
+
* The bytes stay in the browser: a spreadsheet of clients or patients is
|
|
46
|
+
* personal data, and handing it to a model provider so it can "take a look" is
|
|
47
|
+
* a disclosure, not a convenience. What travels is the shape — sheets,
|
|
48
|
+
* headers, how many rows, the inferred type per column and a handful of sample
|
|
49
|
+
* rows. Enough to plan an import; never the data set itself.
|
|
50
|
+
*/
|
|
51
|
+
export interface AgentAttachmentColumn {
|
|
52
|
+
name: string
|
|
53
|
+
type: 'text' | 'number' | 'date' | 'boolean' | 'email' | 'phone'
|
|
54
|
+
/** Literal shape when known ('dd/mm/yyyy', '1.234,56'). */
|
|
55
|
+
format?: string
|
|
56
|
+
/** Why the column is not the type it looks like (ambiguous dates, mixed values). */
|
|
57
|
+
note?: string
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export interface AgentAttachmentSheet {
|
|
61
|
+
name: string
|
|
62
|
+
headers: string[]
|
|
63
|
+
rowCount?: number
|
|
64
|
+
sample: string[][]
|
|
65
|
+
columnTypes: AgentAttachmentColumn[]
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export interface AgentAttachmentDigest {
|
|
69
|
+
id: string
|
|
70
|
+
name: string
|
|
71
|
+
mime: string
|
|
72
|
+
size: number
|
|
73
|
+
kind: 'spreadsheet' | 'csv' | 'text' | 'image' | 'pdf' | 'binary'
|
|
74
|
+
/** Multi-tab spreadsheets. Single-tab files use the flat fields below. */
|
|
75
|
+
sheets?: AgentAttachmentSheet[]
|
|
76
|
+
headers?: string[]
|
|
77
|
+
rowCount?: number
|
|
78
|
+
sample?: string[][]
|
|
79
|
+
columnTypes?: AgentAttachmentColumn[]
|
|
80
|
+
/** Head of a text/markdown file. */
|
|
81
|
+
preview?: string
|
|
82
|
+
/** What the reader had to guess at, truncate or give up on. */
|
|
83
|
+
warnings?: string[]
|
|
84
|
+
}
|
|
85
|
+
|
|
42
86
|
export interface FayzAgentChatInput {
|
|
43
87
|
/** New end-user message. Omit when replying with tool results. */
|
|
44
88
|
message?: string
|
|
@@ -53,6 +97,8 @@ export interface FayzAgentChatInput {
|
|
|
53
97
|
confirmAction?: { id: string; approved: boolean }
|
|
54
98
|
/** Runtime context the agent should know about (page, locale, tenant). */
|
|
55
99
|
context?: Record<string, unknown>
|
|
100
|
+
/** Files the user attached this turn, as digests — never as bytes. */
|
|
101
|
+
attachments?: AgentAttachmentDigest[]
|
|
56
102
|
signal?: AbortSignal
|
|
57
103
|
}
|
|
58
104
|
|
|
@@ -101,6 +147,9 @@ export interface FayzAgentConversationMessage {
|
|
|
101
147
|
role: string
|
|
102
148
|
content: string
|
|
103
149
|
createdAt: string
|
|
150
|
+
/** Files the user attached to this turn, as the digest that was sent. Only
|
|
151
|
+
* the description — the bytes never left the browser that produced them. */
|
|
152
|
+
attachments?: AgentAttachmentDigest[]
|
|
104
153
|
/** Tool calls this reply made, with their results — so a resumed thread shows
|
|
105
154
|
* the same trace and record links it showed live. */
|
|
106
155
|
toolCalls?: Array<{
|
package/src/index.ts
CHANGED
|
@@ -43,6 +43,9 @@ export {
|
|
|
43
43
|
} from './runtime'
|
|
44
44
|
export { createFayzAgentClient, FayzAgentError } from './agent'
|
|
45
45
|
export type {
|
|
46
|
+
AgentAttachmentColumn,
|
|
47
|
+
AgentAttachmentDigest,
|
|
48
|
+
AgentAttachmentSheet,
|
|
46
49
|
FayzAgentChatInput,
|
|
47
50
|
FayzAgentChatResponse,
|
|
48
51
|
FayzAgentClient,
|
|
@@ -1,103 +1,103 @@
|
|
|
1
1
|
{
|
|
2
2
|
"channels": {
|
|
3
3
|
"stable": {
|
|
4
|
-
"@fayz-ai/sdk": "^0.8.
|
|
5
|
-
"@fayz-ai/core": "^0.8.
|
|
6
|
-
"@fayz-ai/auth": "^0.8.
|
|
7
|
-
"@fayz-ai/ui": "^0.8.
|
|
8
|
-
"@fayz-ai/saas": "^0.8.
|
|
9
|
-
"@fayz-ai/shop": "^0.8.
|
|
10
|
-
"@fayz-ai/storefront": "^0.8.
|
|
4
|
+
"@fayz-ai/sdk": "^0.8.5",
|
|
5
|
+
"@fayz-ai/core": "^0.8.5",
|
|
6
|
+
"@fayz-ai/auth": "^0.8.5",
|
|
7
|
+
"@fayz-ai/ui": "^0.8.5",
|
|
8
|
+
"@fayz-ai/saas": "^0.8.5",
|
|
9
|
+
"@fayz-ai/shop": "^0.8.4",
|
|
10
|
+
"@fayz-ai/storefront": "^0.8.5",
|
|
11
11
|
"@fayz-ai/portal": "^0.8.0",
|
|
12
|
-
"@fayz-ai/courses": "^0.8.
|
|
13
|
-
"@fayz-ai/db": "^0.8.
|
|
14
|
-
"@fayz-ai/plugin-agenda": "^0.8.
|
|
12
|
+
"@fayz-ai/courses": "^0.8.1",
|
|
13
|
+
"@fayz-ai/db": "^0.8.4",
|
|
14
|
+
"@fayz-ai/plugin-agenda": "^0.8.4",
|
|
15
15
|
"@fayz-ai/plugin-auth": "^0.8.0",
|
|
16
16
|
"@fayz-ai/plugin-automations": "^0.8.0",
|
|
17
17
|
"@fayz-ai/plugin-blog": "^0.8.1",
|
|
18
|
-
"@fayz-ai/plugin-conversations": "^0.8.
|
|
19
|
-
"@fayz-ai/plugin-courses": "^0.8.
|
|
20
|
-
"@fayz-ai/plugin-crm": "^0.8.
|
|
18
|
+
"@fayz-ai/plugin-conversations": "^0.8.3",
|
|
19
|
+
"@fayz-ai/plugin-courses": "^0.8.4",
|
|
20
|
+
"@fayz-ai/plugin-crm": "^0.8.5",
|
|
21
21
|
"@fayz-ai/plugin-dashboard": "^0.8.0",
|
|
22
|
-
"@fayz-ai/plugin-financial": "^0.8.
|
|
23
|
-
"@fayz-ai/plugin-forms": "^0.8.
|
|
24
|
-
"@fayz-ai/plugin-inventory": "^0.8.
|
|
25
|
-
"@fayz-ai/plugin-marketing": "^0.8.
|
|
22
|
+
"@fayz-ai/plugin-financial": "^0.8.4",
|
|
23
|
+
"@fayz-ai/plugin-forms": "^0.8.1",
|
|
24
|
+
"@fayz-ai/plugin-inventory": "^0.8.3",
|
|
25
|
+
"@fayz-ai/plugin-marketing": "^0.8.2",
|
|
26
26
|
"@fayz-ai/plugin-menu": "^0.8.0",
|
|
27
27
|
"@fayz-ai/plugin-orders": "^0.8.0",
|
|
28
28
|
"@fayz-ai/plugin-payments": "^0.8.0",
|
|
29
29
|
"@fayz-ai/plugin-reports": "^0.8.0",
|
|
30
30
|
"@fayz-ai/plugin-reputation": "^0.8.0",
|
|
31
|
-
"@fayz-ai/plugin-shop": "^0.8.
|
|
31
|
+
"@fayz-ai/plugin-shop": "^0.8.4",
|
|
32
32
|
"@fayz-ai/plugin-sites": "^0.8.0",
|
|
33
33
|
"@fayz-ai/plugin-tables": "^0.8.0",
|
|
34
|
-
"@fayz-ai/plugin-tasks": "^0.8.
|
|
34
|
+
"@fayz-ai/plugin-tasks": "^0.8.3"
|
|
35
35
|
},
|
|
36
36
|
"latest": {
|
|
37
|
-
"@fayz-ai/sdk": "^0.8.
|
|
38
|
-
"@fayz-ai/core": "^0.8.
|
|
39
|
-
"@fayz-ai/auth": "^0.8.
|
|
40
|
-
"@fayz-ai/ui": "^0.8.
|
|
41
|
-
"@fayz-ai/saas": "^0.8.
|
|
42
|
-
"@fayz-ai/shop": "^0.8.
|
|
43
|
-
"@fayz-ai/storefront": "^0.8.
|
|
37
|
+
"@fayz-ai/sdk": "^0.8.5",
|
|
38
|
+
"@fayz-ai/core": "^0.8.5",
|
|
39
|
+
"@fayz-ai/auth": "^0.8.5",
|
|
40
|
+
"@fayz-ai/ui": "^0.8.5",
|
|
41
|
+
"@fayz-ai/saas": "^0.8.5",
|
|
42
|
+
"@fayz-ai/shop": "^0.8.4",
|
|
43
|
+
"@fayz-ai/storefront": "^0.8.5",
|
|
44
44
|
"@fayz-ai/portal": "^0.8.0",
|
|
45
|
-
"@fayz-ai/courses": "^0.8.
|
|
46
|
-
"@fayz-ai/db": "^0.8.
|
|
47
|
-
"@fayz-ai/plugin-agenda": "^0.8.
|
|
45
|
+
"@fayz-ai/courses": "^0.8.1",
|
|
46
|
+
"@fayz-ai/db": "^0.8.4",
|
|
47
|
+
"@fayz-ai/plugin-agenda": "^0.8.4",
|
|
48
48
|
"@fayz-ai/plugin-auth": "^0.8.0",
|
|
49
49
|
"@fayz-ai/plugin-automations": "^0.8.0",
|
|
50
50
|
"@fayz-ai/plugin-blog": "^0.8.1",
|
|
51
|
-
"@fayz-ai/plugin-conversations": "^0.8.
|
|
52
|
-
"@fayz-ai/plugin-courses": "^0.8.
|
|
53
|
-
"@fayz-ai/plugin-crm": "^0.8.
|
|
51
|
+
"@fayz-ai/plugin-conversations": "^0.8.3",
|
|
52
|
+
"@fayz-ai/plugin-courses": "^0.8.4",
|
|
53
|
+
"@fayz-ai/plugin-crm": "^0.8.5",
|
|
54
54
|
"@fayz-ai/plugin-dashboard": "^0.8.0",
|
|
55
|
-
"@fayz-ai/plugin-financial": "^0.8.
|
|
56
|
-
"@fayz-ai/plugin-forms": "^0.8.
|
|
57
|
-
"@fayz-ai/plugin-inventory": "^0.8.
|
|
58
|
-
"@fayz-ai/plugin-marketing": "^0.8.
|
|
55
|
+
"@fayz-ai/plugin-financial": "^0.8.4",
|
|
56
|
+
"@fayz-ai/plugin-forms": "^0.8.1",
|
|
57
|
+
"@fayz-ai/plugin-inventory": "^0.8.3",
|
|
58
|
+
"@fayz-ai/plugin-marketing": "^0.8.2",
|
|
59
59
|
"@fayz-ai/plugin-menu": "^0.8.0",
|
|
60
60
|
"@fayz-ai/plugin-orders": "^0.8.0",
|
|
61
61
|
"@fayz-ai/plugin-payments": "^0.8.0",
|
|
62
62
|
"@fayz-ai/plugin-reports": "^0.8.0",
|
|
63
63
|
"@fayz-ai/plugin-reputation": "^0.8.0",
|
|
64
|
-
"@fayz-ai/plugin-shop": "^0.8.
|
|
64
|
+
"@fayz-ai/plugin-shop": "^0.8.4",
|
|
65
65
|
"@fayz-ai/plugin-sites": "^0.8.0",
|
|
66
66
|
"@fayz-ai/plugin-tables": "^0.8.0",
|
|
67
|
-
"@fayz-ai/plugin-tasks": "^0.8.
|
|
67
|
+
"@fayz-ai/plugin-tasks": "^0.8.3"
|
|
68
68
|
},
|
|
69
69
|
"preview": {
|
|
70
|
-
"@fayz-ai/sdk": "^0.8.
|
|
71
|
-
"@fayz-ai/core": "^0.8.
|
|
72
|
-
"@fayz-ai/auth": "^0.8.
|
|
73
|
-
"@fayz-ai/ui": "^0.8.
|
|
74
|
-
"@fayz-ai/saas": "^0.8.
|
|
75
|
-
"@fayz-ai/shop": "^0.8.
|
|
76
|
-
"@fayz-ai/storefront": "^0.8.
|
|
70
|
+
"@fayz-ai/sdk": "^0.8.5",
|
|
71
|
+
"@fayz-ai/core": "^0.8.5",
|
|
72
|
+
"@fayz-ai/auth": "^0.8.5",
|
|
73
|
+
"@fayz-ai/ui": "^0.8.5",
|
|
74
|
+
"@fayz-ai/saas": "^0.8.5",
|
|
75
|
+
"@fayz-ai/shop": "^0.8.4",
|
|
76
|
+
"@fayz-ai/storefront": "^0.8.5",
|
|
77
77
|
"@fayz-ai/portal": "^0.8.0",
|
|
78
|
-
"@fayz-ai/courses": "^0.8.
|
|
79
|
-
"@fayz-ai/db": "^0.8.
|
|
80
|
-
"@fayz-ai/plugin-agenda": "^0.8.
|
|
78
|
+
"@fayz-ai/courses": "^0.8.1",
|
|
79
|
+
"@fayz-ai/db": "^0.8.4",
|
|
80
|
+
"@fayz-ai/plugin-agenda": "^0.8.4",
|
|
81
81
|
"@fayz-ai/plugin-auth": "^0.8.0",
|
|
82
82
|
"@fayz-ai/plugin-automations": "^0.8.0",
|
|
83
83
|
"@fayz-ai/plugin-blog": "^0.8.1",
|
|
84
|
-
"@fayz-ai/plugin-conversations": "^0.8.
|
|
85
|
-
"@fayz-ai/plugin-courses": "^0.8.
|
|
86
|
-
"@fayz-ai/plugin-crm": "^0.8.
|
|
84
|
+
"@fayz-ai/plugin-conversations": "^0.8.3",
|
|
85
|
+
"@fayz-ai/plugin-courses": "^0.8.4",
|
|
86
|
+
"@fayz-ai/plugin-crm": "^0.8.5",
|
|
87
87
|
"@fayz-ai/plugin-dashboard": "^0.8.0",
|
|
88
|
-
"@fayz-ai/plugin-financial": "^0.8.
|
|
89
|
-
"@fayz-ai/plugin-forms": "^0.8.
|
|
90
|
-
"@fayz-ai/plugin-inventory": "^0.8.
|
|
91
|
-
"@fayz-ai/plugin-marketing": "^0.8.
|
|
88
|
+
"@fayz-ai/plugin-financial": "^0.8.4",
|
|
89
|
+
"@fayz-ai/plugin-forms": "^0.8.1",
|
|
90
|
+
"@fayz-ai/plugin-inventory": "^0.8.3",
|
|
91
|
+
"@fayz-ai/plugin-marketing": "^0.8.2",
|
|
92
92
|
"@fayz-ai/plugin-menu": "^0.8.0",
|
|
93
93
|
"@fayz-ai/plugin-orders": "^0.8.0",
|
|
94
94
|
"@fayz-ai/plugin-payments": "^0.8.0",
|
|
95
95
|
"@fayz-ai/plugin-reports": "^0.8.0",
|
|
96
96
|
"@fayz-ai/plugin-reputation": "^0.8.0",
|
|
97
|
-
"@fayz-ai/plugin-shop": "^0.8.
|
|
97
|
+
"@fayz-ai/plugin-shop": "^0.8.4",
|
|
98
98
|
"@fayz-ai/plugin-sites": "^0.8.0",
|
|
99
99
|
"@fayz-ai/plugin-tables": "^0.8.0",
|
|
100
|
-
"@fayz-ai/plugin-tasks": "^0.8.
|
|
100
|
+
"@fayz-ai/plugin-tasks": "^0.8.3"
|
|
101
101
|
}
|
|
102
102
|
}
|
|
103
103
|
}
|
package/src/vite.ts
CHANGED
|
@@ -94,7 +94,7 @@ export function fayzVite(opts: FayzViteOptions = {}): UserConfig {
|
|
|
94
94
|
// (so they're hoisted to its root node_modules) — deduping a transitive
|
|
95
95
|
// like @tanstack/react-table makes Vite resolve it from the app root,
|
|
96
96
|
// which fails in local-source mode and 500s the aliased UI source.
|
|
97
|
-
dedupe: userDedupe ?? ['react', 'react-dom', 'zustand', 'lucide-react'],
|
|
97
|
+
dedupe: userDedupe ?? ['react', 'react-dom', 'zustand', 'lucide-react', '@supabase/supabase-js', 'sonner'],
|
|
98
98
|
conditions: useLocal ? ['source', 'browser', 'module', 'jsnext:main', 'jsnext'] : undefined,
|
|
99
99
|
},
|
|
100
100
|
optimizeDeps: { exclude: useLocal ? Object.keys(localAliases) : [] },
|
package/dist/agent.cjs
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var chunkF547THSH_cjs = require('./chunk-F547THSH.cjs');
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
Object.defineProperty(exports, "FayzAgentError", {
|
|
8
|
-
enumerable: true,
|
|
9
|
-
get: function () { return chunkF547THSH_cjs.FayzAgentError; }
|
|
10
|
-
});
|
|
11
|
-
Object.defineProperty(exports, "createFayzAgentClient", {
|
|
12
|
-
enumerable: true,
|
|
13
|
-
get: function () { return chunkF547THSH_cjs.createFayzAgentClient; }
|
|
14
|
-
});
|
|
15
|
-
//# sourceMappingURL=agent.cjs.map
|
|
16
|
-
//# sourceMappingURL=agent.cjs.map
|
package/dist/agent.cjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":[],"names":[],"mappings":"","file":"agent.cjs"}
|
package/dist/ai-builder.cjs
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var chunkDAUDGR5N_cjs = require('./chunk-DAUDGR5N.cjs');
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
Object.defineProperty(exports, "AI_BUILDER_REQUEST_CLASSES", {
|
|
8
|
-
enumerable: true,
|
|
9
|
-
get: function () { return chunkDAUDGR5N_cjs.AI_BUILDER_REQUEST_CLASSES; }
|
|
10
|
-
});
|
|
11
|
-
Object.defineProperty(exports, "AI_BUILDER_REQUEST_CLASS_IDS", {
|
|
12
|
-
enumerable: true,
|
|
13
|
-
get: function () { return chunkDAUDGR5N_cjs.AI_BUILDER_REQUEST_CLASS_IDS; }
|
|
14
|
-
});
|
|
15
|
-
Object.defineProperty(exports, "isAllowedRequestClass", {
|
|
16
|
-
enumerable: true,
|
|
17
|
-
get: function () { return chunkDAUDGR5N_cjs.isAllowedRequestClass; }
|
|
18
|
-
});
|
|
19
|
-
//# sourceMappingURL=ai-builder.cjs.map
|
|
20
|
-
//# sourceMappingURL=ai-builder.cjs.map
|
package/dist/ai-builder.cjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":[],"names":[],"mappings":"","file":"ai-builder.cjs"}
|
package/dist/app-params.cjs
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var chunkZMHI2XGY_cjs = require('./chunk-ZMHI2XGY.cjs');
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
Object.defineProperty(exports, "appParams", {
|
|
8
|
-
enumerable: true,
|
|
9
|
-
get: function () { return chunkZMHI2XGY_cjs.appParams; }
|
|
10
|
-
});
|
|
11
|
-
Object.defineProperty(exports, "resolveAppParams", {
|
|
12
|
-
enumerable: true,
|
|
13
|
-
get: function () { return chunkZMHI2XGY_cjs.resolveAppParams; }
|
|
14
|
-
});
|
|
15
|
-
//# sourceMappingURL=app-params.cjs.map
|
|
16
|
-
//# sourceMappingURL=app-params.cjs.map
|
package/dist/app-params.cjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":[],"names":[],"mappings":"","file":"app-params.cjs"}
|
package/dist/chunk-B6FHOO34.cjs
DELETED
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
// src/supported-surface.json
|
|
4
|
-
var supported_surface_default = {
|
|
5
|
-
surfaceVersion: 1,
|
|
6
|
-
description: "Packages a generated Fayz app may depend on. fayz doctor warns on any app dependency outside this list. See docs/ARCHITECTURE.md (boundary model).",
|
|
7
|
-
tiers: {
|
|
8
|
-
stable: "semver-tracked, supported public API"
|
|
9
|
-
},
|
|
10
|
-
supported: {
|
|
11
|
-
"@fayz-ai/auth": "stable",
|
|
12
|
-
"@fayz-ai/core": "stable",
|
|
13
|
-
"@fayz-ai/courses": "stable",
|
|
14
|
-
"@fayz-ai/db": "stable",
|
|
15
|
-
"@fayz-ai/portal": "stable",
|
|
16
|
-
"@fayz-ai/saas": "stable",
|
|
17
|
-
"@fayz-ai/sdk": "stable",
|
|
18
|
-
"@fayz-ai/shop": "stable",
|
|
19
|
-
"@fayz-ai/storefront": "stable",
|
|
20
|
-
"@fayz-ai/ui": "stable",
|
|
21
|
-
"@fayz-ai/plugin-agenda": "stable",
|
|
22
|
-
"@fayz-ai/plugin-automations": "stable",
|
|
23
|
-
"@fayz-ai/plugin-conversations": "stable",
|
|
24
|
-
"@fayz-ai/plugin-courses": "stable",
|
|
25
|
-
"@fayz-ai/plugin-crm": "stable",
|
|
26
|
-
"@fayz-ai/plugin-dashboard": "stable",
|
|
27
|
-
"@fayz-ai/plugin-financial": "stable",
|
|
28
|
-
"@fayz-ai/plugin-forms": "stable",
|
|
29
|
-
"@fayz-ai/plugin-inventory": "stable",
|
|
30
|
-
"@fayz-ai/plugin-marketing": "stable",
|
|
31
|
-
"@fayz-ai/plugin-menu": "stable",
|
|
32
|
-
"@fayz-ai/plugin-orders": "stable",
|
|
33
|
-
"@fayz-ai/plugin-reports": "stable",
|
|
34
|
-
"@fayz-ai/plugin-reputation": "stable",
|
|
35
|
-
"@fayz-ai/plugin-shop": "stable",
|
|
36
|
-
"@fayz-ai/plugin-sites": "stable",
|
|
37
|
-
"@fayz-ai/plugin-tables": "stable",
|
|
38
|
-
"@fayz-ai/plugin-tasks": "stable"
|
|
39
|
-
},
|
|
40
|
-
internal: [
|
|
41
|
-
"@fayz-ai/app-runtime"
|
|
42
|
-
]
|
|
43
|
-
};
|
|
44
|
-
|
|
45
|
-
// src/supported-surface.ts
|
|
46
|
-
var surface = supported_surface_default;
|
|
47
|
-
function getSupportedPackages() {
|
|
48
|
-
return Object.keys(surface.supported);
|
|
49
|
-
}
|
|
50
|
-
function getInternalPackages() {
|
|
51
|
-
return [...surface.internal];
|
|
52
|
-
}
|
|
53
|
-
function isSupportedPackage(packageName) {
|
|
54
|
-
if (!packageName.startsWith("@fayz-ai/")) return true;
|
|
55
|
-
return packageName in surface.supported;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
exports.getInternalPackages = getInternalPackages;
|
|
59
|
-
exports.getSupportedPackages = getSupportedPackages;
|
|
60
|
-
exports.isSupportedPackage = isSupportedPackage;
|
|
61
|
-
exports.surface = surface;
|
|
62
|
-
//# sourceMappingURL=chunk-B6FHOO34.cjs.map
|
|
63
|
-
//# sourceMappingURL=chunk-B6FHOO34.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/supported-surface.json","../src/supported-surface.ts"],"names":[],"mappings":";;;AAAA,IAAA,yBAAA,GAAA;AAAA,EACE,cAAA,EAAkB,CAAA;AAAA,EAClB,WAAA,EAAe,o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AC,GAAG,OAAA,CAAQ,QAAQ,CAAA;AAC7B;AAOO,SAAS,mBAAmB,WAAA,EAA8B;AAC/D,EAAA,IAAI,CAAC,WAAA,CAAY,UAAA,CAAW,WAAW,GAAG,OAAO,IAAA;AACjD,EAAA,OAAO,eAAe,OAAA,CAAQ,SAAA;AAChC","file":"chunk-B6FHOO34.cjs","sourcesContent":["{\n \"surfaceVersion\": 1,\n \"description\": \"Packages a generated Fayz app may depend on. fayz doctor warns on any app dependency outside this list. See docs/ARCHITECTURE.md (boundary model).\",\n \"tiers\": {\n \"stable\": \"semver-tracked, supported public API\"\n },\n \"supported\": {\n \"@fayz-ai/auth\": \"stable\",\n \"@fayz-ai/core\": \"stable\",\n \"@fayz-ai/courses\": \"stable\",\n \"@fayz-ai/db\": \"stable\",\n \"@fayz-ai/portal\": \"stable\",\n \"@fayz-ai/saas\": \"stable\",\n \"@fayz-ai/sdk\": \"stable\",\n \"@fayz-ai/shop\": \"stable\",\n \"@fayz-ai/storefront\": \"stable\",\n \"@fayz-ai/ui\": \"stable\",\n \"@fayz-ai/plugin-agenda\": \"stable\",\n \"@fayz-ai/plugin-automations\": \"stable\",\n \"@fayz-ai/plugin-conversations\": \"stable\",\n \"@fayz-ai/plugin-courses\": \"stable\",\n \"@fayz-ai/plugin-crm\": \"stable\",\n \"@fayz-ai/plugin-dashboard\": \"stable\",\n \"@fayz-ai/plugin-financial\": \"stable\",\n \"@fayz-ai/plugin-forms\": \"stable\",\n \"@fayz-ai/plugin-inventory\": \"stable\",\n \"@fayz-ai/plugin-marketing\": \"stable\",\n \"@fayz-ai/plugin-menu\": \"stable\",\n \"@fayz-ai/plugin-orders\": \"stable\",\n \"@fayz-ai/plugin-reports\": \"stable\",\n \"@fayz-ai/plugin-reputation\": \"stable\",\n \"@fayz-ai/plugin-shop\": \"stable\",\n \"@fayz-ai/plugin-sites\": \"stable\",\n \"@fayz-ai/plugin-tables\": \"stable\",\n \"@fayz-ai/plugin-tasks\": \"stable\"\n },\n \"internal\": [\n \"@fayz-ai/app-runtime\"\n ]\n}\n","import supportedSurface from './supported-surface.json'\n\nexport type FayzPackageTier = 'stable'\n\nexport interface FayzSupportedSurface {\n surfaceVersion: number\n supported: Record<string, FayzPackageTier>\n internal: string[]\n}\n\nconst surface = supportedSurface as unknown as FayzSupportedSurface\n\n/** Every package a generated Fayz app is allowed to depend on (the public surface). */\nexport function getSupportedPackages(): string[] {\n return Object.keys(surface.supported)\n}\n\n/** Packages that exist but are NOT part of the public surface (deprecated/internal). */\nexport function getInternalPackages(): string[] {\n return [...surface.internal]\n}\n\n/**\n * True when `packageName` is part of the supported public surface. Used by\n * `fayz doctor` to warn (never fail) when an app depends on something off-surface.\n * Non-Fayz packages (no `@fayz-ai/` prefix) are out of scope and return true.\n */\nexport function isSupportedPackage(packageName: string): boolean {\n if (!packageName.startsWith('@fayz-ai/')) return true\n return packageName in surface.supported\n}\n\nexport { surface as fayzSupportedSurface }\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/agent.ts"],"names":["eventName"],"mappings":";AAiFO,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;AAuDA,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,M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mB,kBAAA,CAAmB,cAAc,CAAC,CAAA,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-CTQGNKJD.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\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 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 /** 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"]}
|
package/dist/chunk-DAUDGR5N.cjs
DELETED
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
// src/ai-builder.ts
|
|
4
|
-
var AI_BUILDER_REQUEST_CLASSES = {
|
|
5
|
-
"app-edit": {
|
|
6
|
-
id: "app-edit",
|
|
7
|
-
label: "App edit",
|
|
8
|
-
layer: "app",
|
|
9
|
-
editableBy: "ai",
|
|
10
|
-
needsCode: false,
|
|
11
|
-
needsDeploy: false,
|
|
12
|
-
description: "Change the generated app: pages, routes, layout, theme, copy, blocks, slots. Manifest-level edits (ladder 1\u20134) need no code; custom components/pages (ladder 5\u20136) are app-owned code.",
|
|
13
|
-
examples: [
|
|
14
|
-
"Change the brand color and headline",
|
|
15
|
-
"Add a new landing page with a hero and product grid",
|
|
16
|
-
"Reorder dashboard cards"
|
|
17
|
-
]
|
|
18
|
-
},
|
|
19
|
-
"plugin-config": {
|
|
20
|
-
id: "plugin-config",
|
|
21
|
-
label: "Plugin config",
|
|
22
|
-
layer: "plugin-config",
|
|
23
|
-
editableBy: "ai",
|
|
24
|
-
needsCode: false,
|
|
25
|
-
needsDeploy: false,
|
|
26
|
-
description: "Configure an installed plugin as manifest data: enabled modules, fields, statuses, rules, feature flags, labels, currency.",
|
|
27
|
-
examples: [
|
|
28
|
-
"Enable the reconciliation module in financial",
|
|
29
|
-
'Add a "VIP" status to clients',
|
|
30
|
-
"Turn on delivery pricing in the menu"
|
|
31
|
-
]
|
|
32
|
-
},
|
|
33
|
-
"private-extension": {
|
|
34
|
-
id: "private-extension",
|
|
35
|
-
label: "Private extension",
|
|
36
|
-
layer: "private-extension",
|
|
37
|
-
editableBy: "partner",
|
|
38
|
-
needsCode: true,
|
|
39
|
-
needsDeploy: true,
|
|
40
|
-
description: "Add new business behaviour as an app-local plugin (own entities, data, migrations, AI tools, connectors). The sanctioned partner/Silvio path \u2014 scaffold with `fayz create plugin`. See CUSTOMIZATION.md.",
|
|
41
|
-
examples: [
|
|
42
|
-
"Build a loyalty-points engine with its own table",
|
|
43
|
-
"Add a custom importer for a legacy ERP",
|
|
44
|
-
"Integrate a provider Fayz does not support yet (adapter)"
|
|
45
|
-
]
|
|
46
|
-
},
|
|
47
|
-
"platform-or-plugin-upgrade": {
|
|
48
|
-
id: "platform-or-plugin-upgrade",
|
|
49
|
-
label: "Platform / plugin upgrade",
|
|
50
|
-
layer: "platform",
|
|
51
|
-
editableBy: "fayz",
|
|
52
|
-
needsCode: true,
|
|
53
|
-
needsDeploy: true,
|
|
54
|
-
description: "Change owned by Fayz: bump SDK/plugin versions, run manifest/DB migrations, evolve an engine. Not editable from a generated app.",
|
|
55
|
-
examples: [
|
|
56
|
-
"Upgrade @fayz-ai/core across the fleet",
|
|
57
|
-
"Migrate manifests v2 \u2192 v3",
|
|
58
|
-
"Add a capability to an official plugin"
|
|
59
|
-
]
|
|
60
|
-
},
|
|
61
|
-
"unsafe-blocked": {
|
|
62
|
-
id: "unsafe-blocked",
|
|
63
|
-
label: "Unsafe / blocked",
|
|
64
|
-
layer: "none",
|
|
65
|
-
editableBy: "none",
|
|
66
|
-
needsCode: false,
|
|
67
|
-
needsDeploy: false,
|
|
68
|
-
description: "Requests that would break the boundary and must be refused or rerouted: mutating SDK/runtime/plugin internals, forking an SDK page, importing a provider SDK directly into app code, or bypassing tenancy/permissions/security.",
|
|
69
|
-
examples: [
|
|
70
|
-
"Edit the code inside @fayz-ai/plugin-crm",
|
|
71
|
-
"Copy an SDK page into the app and modify it",
|
|
72
|
-
"Call the Supabase client directly from a storefront component",
|
|
73
|
-
"Disable row-level security for a tenant"
|
|
74
|
-
]
|
|
75
|
-
}
|
|
76
|
-
};
|
|
77
|
-
var AI_BUILDER_REQUEST_CLASS_IDS = Object.keys(
|
|
78
|
-
AI_BUILDER_REQUEST_CLASSES
|
|
79
|
-
);
|
|
80
|
-
function isAllowedRequestClass(id) {
|
|
81
|
-
return id !== "unsafe-blocked";
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
exports.AI_BUILDER_REQUEST_CLASSES = AI_BUILDER_REQUEST_CLASSES;
|
|
85
|
-
exports.AI_BUILDER_REQUEST_CLASS_IDS = AI_BUILDER_REQUEST_CLASS_IDS;
|
|
86
|
-
exports.isAllowedRequestClass = isAllowedRequestClass;
|
|
87
|
-
//# sourceMappingURL=chunk-DAUDGR5N.cjs.map
|
|
88
|
-
//# sourceMappingURL=chunk-DAUDGR5N.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/ai-builder.ts"],"names":[],"mappings":";;;AA4BO,IAAM,0BAAA,GAAsF;AAAA,EACjG,UAAA,EAAY;AAAA,IACV,EAAA,EAAI,UAAA;AAAA,IACJ,KAAA,EAAO,UAAA;AAAA,IACP,KAAA,EAAO,KAAA;AAAA,IACP,UAAA,EAAY,IAAA;AAAA,IACZ,SAAA,EAAW,KAAA;AAAA,IACX,WAAA,EAAa,KAAA;AAAA,IACb,WAAA,EACE,iMAAA;AAAA,IACF,QAAA,EAAU;AAAA,MACR,qCAAA;AAAA,MACA,qDAAA;AAAA,MACA;AAAA;AACF,GACF;AAAA,EACA,eAAA,EAAiB;AAAA,IACf,EAAA,EAA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AAA;AACF;AAEJ;AAEO,IAAM,+BAA+B,MAAA,CAAO,IAAA;AAAA,EACjD;AACF;AAGO,SAAS,sBAAsB,EAAA,EAAoC;AACxE,EAAA,OAAO,EAAA,KAAO,gBAAA;AAChB","file":"chunk-DAUDGR5N.cjs","sourcesContent":["// The AI Builder request taxonomy — the contract the platform's request\n// classifier targets. The classifier itself lives in the `fayz` platform repo;\n// this is the canonical source of truth for the request classes and the\n// architecture layer each is allowed to touch (docs/ARCHITECTURE.md).\n\n/** Ownership layer a request may modify. */\nexport type FayzLayer = 'app' | 'plugin-config' | 'private-extension' | 'platform' | 'none'\n\nexport type AiBuilderRequestClass =\n | 'app-edit'\n | 'plugin-config'\n | 'private-extension'\n | 'platform-or-plugin-upgrade'\n | 'unsafe-blocked'\n\nexport interface AiBuilderRequestClassDef {\n id: AiBuilderRequestClass\n label: string\n /** Which ownership layer this class is allowed to modify. */\n layer: FayzLayer\n /** Who may perform it. */\n editableBy: 'ai' | 'partner' | 'fayz' | 'none'\n needsCode: boolean\n needsDeploy: boolean\n description: string\n examples: string[]\n}\n\nexport const AI_BUILDER_REQUEST_CLASSES: Record<AiBuilderRequestClass, AiBuilderRequestClassDef> = {\n 'app-edit': {\n id: 'app-edit',\n label: 'App edit',\n layer: 'app',\n editableBy: 'ai',\n needsCode: false,\n needsDeploy: false,\n description:\n 'Change the generated app: pages, routes, layout, theme, copy, blocks, slots. Manifest-level edits (ladder 1–4) need no code; custom components/pages (ladder 5–6) are app-owned code.',\n examples: [\n 'Change the brand color and headline',\n 'Add a new landing page with a hero and product grid',\n 'Reorder dashboard cards',\n ],\n },\n 'plugin-config': {\n id: 'plugin-config',\n label: 'Plugin config',\n layer: 'plugin-config',\n editableBy: 'ai',\n needsCode: false,\n needsDeploy: false,\n description:\n 'Configure an installed plugin as manifest data: enabled modules, fields, statuses, rules, feature flags, labels, currency.',\n examples: [\n 'Enable the reconciliation module in financial',\n 'Add a \"VIP\" status to clients',\n 'Turn on delivery pricing in the menu',\n ],\n },\n 'private-extension': {\n id: 'private-extension',\n label: 'Private extension',\n layer: 'private-extension',\n editableBy: 'partner',\n needsCode: true,\n needsDeploy: true,\n description:\n 'Add new business behaviour as an app-local plugin (own entities, data, migrations, AI tools, connectors). The sanctioned partner/Silvio path — scaffold with `fayz create plugin`. See CUSTOMIZATION.md.',\n examples: [\n 'Build a loyalty-points engine with its own table',\n 'Add a custom importer for a legacy ERP',\n 'Integrate a provider Fayz does not support yet (adapter)',\n ],\n },\n 'platform-or-plugin-upgrade': {\n id: 'platform-or-plugin-upgrade',\n label: 'Platform / plugin upgrade',\n layer: 'platform',\n editableBy: 'fayz',\n needsCode: true,\n needsDeploy: true,\n description:\n 'Change owned by Fayz: bump SDK/plugin versions, run manifest/DB migrations, evolve an engine. Not editable from a generated app.',\n examples: [\n 'Upgrade @fayz-ai/core across the fleet',\n 'Migrate manifests v2 → v3',\n 'Add a capability to an official plugin',\n ],\n },\n 'unsafe-blocked': {\n id: 'unsafe-blocked',\n label: 'Unsafe / blocked',\n layer: 'none',\n editableBy: 'none',\n needsCode: false,\n needsDeploy: false,\n description:\n 'Requests that would break the boundary and must be refused or rerouted: mutating SDK/runtime/plugin internals, forking an SDK page, importing a provider SDK directly into app code, or bypassing tenancy/permissions/security.',\n examples: [\n 'Edit the code inside @fayz-ai/plugin-crm',\n 'Copy an SDK page into the app and modify it',\n 'Call the Supabase client directly from a storefront component',\n 'Disable row-level security for a tenant',\n ],\n },\n}\n\nexport const AI_BUILDER_REQUEST_CLASS_IDS = Object.keys(\n AI_BUILDER_REQUEST_CLASSES,\n) as AiBuilderRequestClass[]\n\n/** True when a request class is permitted (anything but unsafe-blocked). */\nexport function isAllowedRequestClass(id: AiBuilderRequestClass): boolean {\n return id !== 'unsafe-blocked'\n}\n"]}
|