@fayz-ai/sdk 0.19.1 → 0.36.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 +14 -0
- package/dist/agent.d.ts.map +1 -1
- package/dist/agent.js +1 -1
- package/dist/{chunk-KTRZI44K.js → chunk-DOSYIWOR.js} +2 -2
- package/dist/chunk-DOSYIWOR.js.map +1 -0
- package/dist/chunk-QBNP7UYY.js +135 -0
- package/dist/chunk-QBNP7UYY.js.map +1 -0
- package/dist/index.js +2 -2
- package/dist/lib/app-shell-pwa.d.ts.map +1 -1
- package/dist/release-channels.js +1 -1
- package/dist/release-channels.json +93 -93
- package/dist/vite.js +64 -1
- package/dist/vite.js.map +1 -1
- package/package.json +1 -1
- package/dist/chunk-KTRZI44K.js.map +0 -1
- package/dist/chunk-L2FWBQU6.js +0 -135
- package/dist/chunk-L2FWBQU6.js.map +0 -1
package/dist/agent.d.ts
CHANGED
|
@@ -113,6 +113,20 @@ export interface FayzAgentChatInput {
|
|
|
113
113
|
};
|
|
114
114
|
/** Runtime context the agent should know about (page, locale, tenant). */
|
|
115
115
|
context?: Record<string, unknown>;
|
|
116
|
+
/**
|
|
117
|
+
* This turn is a TASK, not a conversation: do not keep it.
|
|
118
|
+
*
|
|
119
|
+
* A chat turn is worth storing because someone will scroll back to it. A
|
|
120
|
+
* feature asking «which product is this NF-e line?» is not: it is one
|
|
121
|
+
* question, with a JSON answer, that nobody reads twice. Storing it buries the
|
|
122
|
+
* person's real threads under machine traffic and keeps a copy of their
|
|
123
|
+
* catalogue in the broker for no reader.
|
|
124
|
+
*
|
|
125
|
+
* Pair it with omitting `externalUserId` and `conversationId` — the two fields
|
|
126
|
+
* that attach a turn to a person and to a thread. `createOneShotAsk` in
|
|
127
|
+
* `@fayz-ai/admin` is the sanctioned door and omits all three by construction.
|
|
128
|
+
*/
|
|
129
|
+
ephemeral?: boolean;
|
|
116
130
|
/** Files the user attached this turn, as digests — never as bytes. */
|
|
117
131
|
attachments?: AgentAttachmentDigest[];
|
|
118
132
|
/**
|
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,8CAA8C;IAC9C,OAAO,EAAE,MAAM,CAAA;IACf,SAAS,EAAE,MAAM,CAAA;IACjB,0DAA0D;IAC1D,cAAc,EAAE,MAAM,CAAA;IACtB,OAAO,CAAC,EAAE,OAAO,KAAK,CAAA;CACvB;AAED,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAA;IACZ,WAAW,EAAE,MAAM,CAAA;IACnB,4CAA4C;IAC5C,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CACrC;AAED,MAAM,WAAW,iBAAiB;IAChC,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,MAAM,CAAA;IACZ,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CACnC;AAED,MAAM,WAAW,mBAAmB;IAClC,UAAU,EAAE,MAAM,CAAA;IAClB,OAAO,EAAE,MAAM,CAAA;CAChB;AAED;;;;;;;;GAQG;AACH,MAAM,WAAW,qBAAqB;IACpC,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,MAAM,GAAG,QAAQ,GAAG,MAAM,GAAG,SAAS,GAAG,OAAO,GAAG,OAAO,CAAA;IAChE,2DAA2D;IAC3D,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,oFAAoF;IACpF,IAAI,CAAC,EAAE,MAAM,CAAA;CACd;AAED,MAAM,WAAW,oBAAoB;IACnC,IAAI,EAAE,MAAM,CAAA;IACZ,OAAO,EAAE,MAAM,EAAE,CAAA;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,MAAM,EAAE,MA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options) {
|
|
|
135
135
|
}
|
|
136
136
|
|
|
137
137
|
export { FayzAgentError, createFayzAgentClient };
|
|
138
|
-
//# sourceMappingURL=chunk-
|
|
139
|
-
//# sourceMappingURL=chunk-
|
|
138
|
+
//# sourceMappingURL=chunk-DOSYIWOR.js.map
|
|
139
|
+
//# sourceMappingURL=chunk-DOSYIWOR.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/agent.ts"],"names":["eventName"],"mappings":";AA2KO,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,OAAA,IAAW,UAAA,CAAW,KAAA;AAC9C,EAAA,MAAM,IAAA,GAAO,CAAA,EAAG,OAAA,CAAQ,OAAA,CAAQ,OAAA,CAAQ,QAAQ,EAAE,CAAC,CAAA,iBAAA,EAAoB,OAAA,CAAQ,SAAS,CAAA,OAAA,CAAA;AACxF,EAAA,MAAM,OAAA,GAAU;AAAA,IACd,cAAA,EAAgB,kBAAA;AAAA,IAChB,oBAAoB,OAAA,CAAQ;AAAA,GAC9B;AAEA,EAAA,eAAe,OAAA,CAAW,MAAc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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-DOSYIWOR.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\n/**\n * A file the user handed over TO BE READ — bytes, not a shape.\n *\n * The rule above holds and this is its one exception, drawn narrowly. A\n * spreadsheet of patients gets DIGESTED because nobody asked for it to be read;\n * it was attached so the agent could plan an import, and shipping it to a model\n * provider would be a disclosure nobody consented to.\n *\n * A photographed receipt is the opposite case in every respect: one document,\n * handed over on purpose, by a person whose whole request is \"read this\". The\n * gesture IS the consent, so bytes travel — and ONLY for a file that arrived\n * through an explicit request to read it. Never because an attachment happened\n * to be an image.\n */\nexport interface AgentInlineFile {\n name: string\n /** `image/jpeg`, `image/png`, `application/pdf`. */\n mime: string\n /** Base64 of the file, without the `data:` prefix. */\n data: 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 /**\n * This turn is a TASK, not a conversation: do not keep it.\n *\n * A chat turn is worth storing because someone will scroll back to it. A\n * feature asking «which product is this NF-e line?» is not: it is one\n * question, with a JSON answer, that nobody reads twice. Storing it buries the\n * person's real threads under machine traffic and keeps a copy of their\n * catalogue in the broker for no reader.\n *\n * Pair it with omitting `externalUserId` and `conversationId` — the two fields\n * that attach a turn to a person and to a thread. `createOneShotAsk` in\n * `@fayz-ai/admin` is the sanctioned door and omits all three by construction.\n */\n ephemeral?: boolean\n /** Files the user attached this turn, as digests — never as bytes. */\n attachments?: AgentAttachmentDigest[]\n /**\n * Files the user handed over to be READ this turn — see AgentInlineFile.\n *\n * Separate from `attachments` on purpose: two fields means the boundary is\n * visible at every call site and in every request log, instead of being a\n * flag someone can flip by accident on a digest.\n */\n inlineFiles?: AgentInlineFile[]\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"]}
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
// src/release-channels.json
|
|
2
|
+
var release_channels_default = {
|
|
3
|
+
channels: {
|
|
4
|
+
stable: {
|
|
5
|
+
"@fayz-ai/sdk": "^0.36.0",
|
|
6
|
+
"@fayz-ai/admin": "^0.36.0",
|
|
7
|
+
"@fayz-ai/core": "^0.36.0",
|
|
8
|
+
"@fayz-ai/auth": "^0.36.0",
|
|
9
|
+
"@fayz-ai/ui": "^0.36.0",
|
|
10
|
+
"@fayz-ai/shop": "^0.36.0",
|
|
11
|
+
"@fayz-ai/storefront": "^0.36.0",
|
|
12
|
+
"@fayz-ai/portal": "^0.36.0",
|
|
13
|
+
"@fayz-ai/courses": "^0.36.0",
|
|
14
|
+
"@fayz-ai/db": "^0.22.0",
|
|
15
|
+
"@fayz-ai/plugin-agenda": "^0.21.0",
|
|
16
|
+
"@fayz-ai/plugin-auth": "^0.12.16",
|
|
17
|
+
"@fayz-ai/plugin-automations": "^0.15.3",
|
|
18
|
+
"@fayz-ai/plugin-blog": "^0.12.19",
|
|
19
|
+
"@fayz-ai/plugin-conversations": "^0.22.3",
|
|
20
|
+
"@fayz-ai/plugin-courses": "^0.10.24",
|
|
21
|
+
"@fayz-ai/plugin-crm": "^0.31.4",
|
|
22
|
+
"@fayz-ai/plugin-dashboard": "^0.9.23",
|
|
23
|
+
"@fayz-ai/plugin-financial": "^0.19.0",
|
|
24
|
+
"@fayz-ai/plugin-forms": "^0.13.3",
|
|
25
|
+
"@fayz-ai/plugin-inventory": "^0.14.0",
|
|
26
|
+
"@fayz-ai/plugin-marketing": "^0.13.7",
|
|
27
|
+
"@fayz-ai/plugin-menu": "^0.11.3",
|
|
28
|
+
"@fayz-ai/plugin-orders": "^0.12.20",
|
|
29
|
+
"@fayz-ai/plugin-payments": "^0.9.21",
|
|
30
|
+
"@fayz-ai/plugin-reports": "^0.16.3",
|
|
31
|
+
"@fayz-ai/plugin-reputation": "^0.10.18",
|
|
32
|
+
"@fayz-ai/plugin-shop": "^0.16.7",
|
|
33
|
+
"@fayz-ai/plugin-sites": "^0.9.21",
|
|
34
|
+
"@fayz-ai/plugin-tables": "^0.12.4",
|
|
35
|
+
"@fayz-ai/plugin-tasks": "^0.10.21"
|
|
36
|
+
},
|
|
37
|
+
latest: {
|
|
38
|
+
"@fayz-ai/sdk": "^0.36.0",
|
|
39
|
+
"@fayz-ai/admin": "^0.36.0",
|
|
40
|
+
"@fayz-ai/core": "^0.36.0",
|
|
41
|
+
"@fayz-ai/auth": "^0.36.0",
|
|
42
|
+
"@fayz-ai/ui": "^0.36.0",
|
|
43
|
+
"@fayz-ai/shop": "^0.36.0",
|
|
44
|
+
"@fayz-ai/storefront": "^0.36.0",
|
|
45
|
+
"@fayz-ai/portal": "^0.36.0",
|
|
46
|
+
"@fayz-ai/courses": "^0.36.0",
|
|
47
|
+
"@fayz-ai/db": "^0.22.0",
|
|
48
|
+
"@fayz-ai/plugin-agenda": "^0.21.0",
|
|
49
|
+
"@fayz-ai/plugin-auth": "^0.12.16",
|
|
50
|
+
"@fayz-ai/plugin-automations": "^0.15.3",
|
|
51
|
+
"@fayz-ai/plugin-blog": "^0.12.19",
|
|
52
|
+
"@fayz-ai/plugin-conversations": "^0.22.3",
|
|
53
|
+
"@fayz-ai/plugin-courses": "^0.10.24",
|
|
54
|
+
"@fayz-ai/plugin-crm": "^0.31.4",
|
|
55
|
+
"@fayz-ai/plugin-dashboard": "^0.9.23",
|
|
56
|
+
"@fayz-ai/plugin-financial": "^0.19.0",
|
|
57
|
+
"@fayz-ai/plugin-forms": "^0.13.3",
|
|
58
|
+
"@fayz-ai/plugin-inventory": "^0.14.0",
|
|
59
|
+
"@fayz-ai/plugin-marketing": "^0.13.7",
|
|
60
|
+
"@fayz-ai/plugin-menu": "^0.11.3",
|
|
61
|
+
"@fayz-ai/plugin-orders": "^0.12.20",
|
|
62
|
+
"@fayz-ai/plugin-payments": "^0.9.21",
|
|
63
|
+
"@fayz-ai/plugin-reports": "^0.16.3",
|
|
64
|
+
"@fayz-ai/plugin-reputation": "^0.10.18",
|
|
65
|
+
"@fayz-ai/plugin-shop": "^0.16.7",
|
|
66
|
+
"@fayz-ai/plugin-sites": "^0.9.21",
|
|
67
|
+
"@fayz-ai/plugin-tables": "^0.12.4",
|
|
68
|
+
"@fayz-ai/plugin-tasks": "^0.10.21"
|
|
69
|
+
},
|
|
70
|
+
preview: {
|
|
71
|
+
"@fayz-ai/sdk": "^0.36.0",
|
|
72
|
+
"@fayz-ai/admin": "^0.36.0",
|
|
73
|
+
"@fayz-ai/core": "^0.36.0",
|
|
74
|
+
"@fayz-ai/auth": "^0.36.0",
|
|
75
|
+
"@fayz-ai/ui": "^0.36.0",
|
|
76
|
+
"@fayz-ai/shop": "^0.36.0",
|
|
77
|
+
"@fayz-ai/storefront": "^0.36.0",
|
|
78
|
+
"@fayz-ai/portal": "^0.36.0",
|
|
79
|
+
"@fayz-ai/courses": "^0.36.0",
|
|
80
|
+
"@fayz-ai/db": "^0.22.0",
|
|
81
|
+
"@fayz-ai/plugin-agenda": "^0.21.0",
|
|
82
|
+
"@fayz-ai/plugin-auth": "^0.12.16",
|
|
83
|
+
"@fayz-ai/plugin-automations": "^0.15.3",
|
|
84
|
+
"@fayz-ai/plugin-blog": "^0.12.19",
|
|
85
|
+
"@fayz-ai/plugin-conversations": "^0.22.3",
|
|
86
|
+
"@fayz-ai/plugin-courses": "^0.10.24",
|
|
87
|
+
"@fayz-ai/plugin-crm": "^0.31.4",
|
|
88
|
+
"@fayz-ai/plugin-dashboard": "^0.9.23",
|
|
89
|
+
"@fayz-ai/plugin-financial": "^0.19.0",
|
|
90
|
+
"@fayz-ai/plugin-forms": "^0.13.3",
|
|
91
|
+
"@fayz-ai/plugin-inventory": "^0.14.0",
|
|
92
|
+
"@fayz-ai/plugin-marketing": "^0.13.7",
|
|
93
|
+
"@fayz-ai/plugin-menu": "^0.11.3",
|
|
94
|
+
"@fayz-ai/plugin-orders": "^0.12.20",
|
|
95
|
+
"@fayz-ai/plugin-payments": "^0.9.21",
|
|
96
|
+
"@fayz-ai/plugin-reports": "^0.16.3",
|
|
97
|
+
"@fayz-ai/plugin-reputation": "^0.10.18",
|
|
98
|
+
"@fayz-ai/plugin-shop": "^0.16.7",
|
|
99
|
+
"@fayz-ai/plugin-sites": "^0.9.21",
|
|
100
|
+
"@fayz-ai/plugin-tables": "^0.12.4",
|
|
101
|
+
"@fayz-ai/plugin-tasks": "^0.10.21"
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
};
|
|
105
|
+
|
|
106
|
+
// src/release-channels.ts
|
|
107
|
+
var releaseChannelPackages = release_channels_default.channels;
|
|
108
|
+
function buildVersionSet(channel) {
|
|
109
|
+
return {
|
|
110
|
+
channel,
|
|
111
|
+
packages: { ...releaseChannelPackages[channel] }
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
var fayzPackageVersionSets = {
|
|
115
|
+
stable: buildVersionSet("stable"),
|
|
116
|
+
latest: buildVersionSet("latest"),
|
|
117
|
+
preview: buildVersionSet("preview")
|
|
118
|
+
};
|
|
119
|
+
function resolveFayzPackageVersions(channel = "stable") {
|
|
120
|
+
return fayzPackageVersionSets[channel];
|
|
121
|
+
}
|
|
122
|
+
function resolveFayzPackageDependencies(channel = "stable") {
|
|
123
|
+
return { ...resolveFayzPackageVersions(channel).packages };
|
|
124
|
+
}
|
|
125
|
+
function resolveFayzPackageVersion(packageName, channel = "stable") {
|
|
126
|
+
const version = resolveFayzPackageVersions(channel).packages[packageName];
|
|
127
|
+
if (!version) {
|
|
128
|
+
throw new Error(`No Fayz package version configured for ${packageName} in ${channel} channel`);
|
|
129
|
+
}
|
|
130
|
+
return version;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
export { fayzPackageVersionSets, resolveFayzPackageDependencies, resolveFayzPackageVersion, resolveFayzPackageVersions };
|
|
134
|
+
//# sourceMappingURL=chunk-QBNP7UYY.js.map
|
|
135
|
+
//# sourceMappingURL=chunk-QBNP7UYY.js.map
|
|
@@ -0,0 +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,SAAA;AAAA,MAChB,gBAAA,EAAkB,SAAA;AAAA,MAClB,eAAA,EAAiB,SAAA;AAAA,MACjB,eAAA,EAAiB,SAAA;AAAA,MACjB,aAAA,EAAe,SAAA;AAAA,MACf,eAAA,EAAiB,SAAA;AAAA,MACjB,qBAAA,EAAuB,SAAA;AAAA,MACvB,iBAAA,EAAmB,SAAA;AAAA,MACnB,kBAAA,EAAoB,SAAA;AAAA,MACpB,aAAA,EAAe,SAAA;AAAA,MACf,wBAAA,EAA0B,SAAA;AAAA,MAC1B,sBAAA,EAAwB,UAAA;AAAA,MACxB,6BAAA,EAA+B,SAAA;AAAA,MAC/B,sBAAA,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.36.0\",\n \"@fayz-ai/core\": \"^0.36.0\",\n \"@fayz-ai/auth\": \"^0.36.0\",\n \"@fayz-ai/ui\": \"^0.36.0\",\n \"@fayz-ai/shop\": \"^0.36.0\",\n \"@fayz-ai/storefront\": \"^0.36.0\",\n \"@fayz-ai/portal\": \"^0.36.0\",\n \"@fayz-ai/courses\": \"^0.36.0\",\n \"@fayz-ai/db\": \"^0.22.0\",\n \"@fayz-ai/plugin-agenda\": \"^0.21.0\",\n \"@fayz-ai/plugin-auth\": \"^0.12.16\",\n \"@fayz-ai/plugin-automations\": \"^0.15.3\",\n \"@fayz-ai/plugin-blog\": \"^0.12.19\",\n \"@fayz-ai/plugin-conversations\": \"^0.22.3\",\n \"@fayz-ai/plugin-courses\": \"^0.10.24\",\n \"@fayz-ai/plugin-crm\": \"^0.31.4\",\n \"@fayz-ai/plugin-dashboard\": \"^0.9.23\",\n \"@fayz-ai/plugin-financial\": \"^0.19.0\",\n \"@fayz-ai/plugin-forms\": \"^0.13.3\",\n \"@fayz-ai/plugin-inventory\": \"^0.14.0\",\n \"@fayz-ai/plugin-marketing\": \"^0.13.7\",\n \"@fayz-ai/plugin-menu\": \"^0.11.3\",\n \"@fayz-ai/plugin-orders\": \"^0.12.20\",\n \"@fayz-ai/plugin-payments\": \"^0.9.21\",\n \"@fayz-ai/plugin-reports\": \"^0.16.3\",\n \"@fayz-ai/plugin-reputation\": \"^0.10.18\",\n \"@fayz-ai/plugin-shop\": \"^0.16.7\",\n \"@fayz-ai/plugin-sites\": \"^0.9.21\",\n \"@fayz-ai/plugin-tables\": \"^0.12.4\",\n \"@fayz-ai/plugin-tasks\": \"^0.10.21\"\n },\n \"latest\": {\n \"@fayz-ai/sdk\": \"^0.36.0\",\n \"@fayz-ai/admin\": \"^0.36.0\",\n \"@fayz-ai/core\": \"^0.36.0\",\n \"@fayz-ai/auth\": \"^0.36.0\",\n \"@fayz-ai/ui\": \"^0.36.0\",\n \"@fayz-ai/shop\": \"^0.36.0\",\n \"@fayz-ai/storefront\": \"^0.36.0\",\n \"@fayz-ai/portal\": \"^0.36.0\",\n \"@fayz-ai/courses\": \"^0.36.0\",\n \"@fayz-ai/db\": \"^0.22.0\",\n \"@fayz-ai/plugin-agenda\": \"^0.21.0\",\n \"@fayz-ai/plugin-auth\": \"^0.12.16\",\n \"@fayz-ai/plugin-automations\": \"^0.15.3\",\n \"@fayz-ai/plugin-blog\": \"^0.12.19\",\n \"@fayz-ai/plugin-conversations\": \"^0.22.3\",\n \"@fayz-ai/plugin-courses\": \"^0.10.24\",\n \"@fayz-ai/plugin-crm\": \"^0.31.4\",\n \"@fayz-ai/plugin-dashboard\": \"^0.9.23\",\n \"@fayz-ai/plugin-financial\": \"^0.19.0\",\n \"@fayz-ai/plugin-forms\": \"^0.13.3\",\n \"@fayz-ai/plugin-inventory\": \"^0.14.0\",\n \"@fayz-ai/plugin-marketing\": \"^0.13.7\",\n \"@fayz-ai/plugin-menu\": \"^0.11.3\",\n \"@fayz-ai/plugin-orders\": \"^0.12.20\",\n \"@fayz-ai/plugin-payments\": \"^0.9.21\",\n \"@fayz-ai/plugin-reports\": \"^0.16.3\",\n \"@fayz-ai/plugin-reputation\": \"^0.10.18\",\n \"@fayz-ai/plugin-shop\": \"^0.16.7\",\n \"@fayz-ai/plugin-sites\": \"^0.9.21\",\n \"@fayz-ai/plugin-tables\": \"^0.12.4\",\n \"@fayz-ai/plugin-tasks\": \"^0.10.21\"\n },\n \"preview\": {\n \"@fayz-ai/sdk\": \"^0.36.0\",\n \"@fayz-ai/admin\": \"^0.36.0\",\n \"@fayz-ai/core\": \"^0.36.0\",\n \"@fayz-ai/auth\": \"^0.36.0\",\n \"@fayz-ai/ui\": \"^0.36.0\",\n \"@fayz-ai/shop\": \"^0.36.0\",\n \"@fayz-ai/storefront\": \"^0.36.0\",\n \"@fayz-ai/portal\": \"^0.36.0\",\n \"@fayz-ai/courses\": \"^0.36.0\",\n \"@fayz-ai/db\": \"^0.22.0\",\n \"@fayz-ai/plugin-agenda\": \"^0.21.0\",\n \"@fayz-ai/plugin-auth\": \"^0.12.16\",\n \"@fayz-ai/plugin-automations\": \"^0.15.3\",\n \"@fayz-ai/plugin-blog\": \"^0.12.19\",\n \"@fayz-ai/plugin-conversations\": \"^0.22.3\",\n \"@fayz-ai/plugin-courses\": \"^0.10.24\",\n \"@fayz-ai/plugin-crm\": \"^0.31.4\",\n \"@fayz-ai/plugin-dashboard\": \"^0.9.23\",\n \"@fayz-ai/plugin-financial\": \"^0.19.0\",\n \"@fayz-ai/plugin-forms\": \"^0.13.3\",\n \"@fayz-ai/plugin-inventory\": \"^0.14.0\",\n \"@fayz-ai/plugin-marketing\": \"^0.13.7\",\n \"@fayz-ai/plugin-menu\": \"^0.11.3\",\n \"@fayz-ai/plugin-orders\": \"^0.12.20\",\n \"@fayz-ai/plugin-payments\": \"^0.9.21\",\n \"@fayz-ai/plugin-reports\": \"^0.16.3\",\n \"@fayz-ai/plugin-reputation\": \"^0.10.18\",\n \"@fayz-ai/plugin-shop\": \"^0.16.7\",\n \"@fayz-ai/plugin-sites\": \"^0.9.21\",\n \"@fayz-ai/plugin-tables\": \"^0.12.4\",\n \"@fayz-ai/plugin-tasks\": \"^0.10.21\"\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"]}
|
package/dist/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
export { fayzPackageVersionSets, resolveFayzPackageDependencies, resolveFayzPackageVersion, resolveFayzPackageVersions } from './chunk-
|
|
1
|
+
export { fayzPackageVersionSets, resolveFayzPackageDependencies, resolveFayzPackageVersion, resolveFayzPackageVersions } from './chunk-QBNP7UYY.js';
|
|
2
2
|
export { surface as fayzSupportedSurface, getInternalPackages, getSupportedPackages, isSupportedPackage } from './chunk-6UZOXHGJ.js';
|
|
3
3
|
export { AI_BUILDER_REQUEST_CLASSES, AI_BUILDER_REQUEST_CLASS_IDS, isAllowedRequestClass } from './chunk-BJFMBVMP.js';
|
|
4
4
|
export { FayzApiError, createFayzClient, fayz } from './chunk-UWOQAD5A.js';
|
|
5
5
|
export { FayzRuntimeError, createFayzRuntimeClient } from './chunk-FRIOW6KW.js';
|
|
6
6
|
export { appParams, resolveAppParams } from './chunk-YGX37DT3.js';
|
|
7
|
-
export { FayzAgentError, createFayzAgentClient } from './chunk-
|
|
7
|
+
export { FayzAgentError, createFayzAgentClient } from './chunk-DOSYIWOR.js';
|
|
8
8
|
export { FayzShopError, createDedupedFetch, createFayzShopProvider, getDedupeStats, resetDedupeStats } from './chunk-BTXIUI4E.js';
|
|
9
9
|
export { deprecationMessage, deprecationWindowMinors, deprecationsForCodemod, fayzDeprecationPolicy, table as fayzDeprecationRegistry, getDeprecation, hasDeprecation, isDeprecationShimmed, listDeprecationCodemods, listDeprecations, resetDeprecationWarnings, warnDeprecated } from './chunk-LCW5ZV5S.js';
|
|
10
10
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app-shell-pwa.d.ts","sourceRoot":"","sources":["../../src/lib/app-shell-pwa.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,MAAM,CAAA;AAqBlC,MAAM,WAAW,kBAAkB;IACjC,gFAAgF;IAChF,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,0EAA0E;IAC1E,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,4EAA4E;IAC5E,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,8EAA8E;IAC9E,eAAe,CAAC,EAAE,MAAM,CAAA;CACzB;AA+
|
|
1
|
+
{"version":3,"file":"app-shell-pwa.d.ts","sourceRoot":"","sources":["../../src/lib/app-shell-pwa.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,MAAM,CAAA;AAqBlC,MAAM,WAAW,kBAAkB;IACjC,gFAAgF;IAChF,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,0EAA0E;IAC1E,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,4EAA4E;IAC5E,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,8EAA8E;IAC9E,eAAe,CAAC,EAAE,MAAM,CAAA;CACzB;AA+UD,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,GAAE,kBAAuB,GAAG,MAAM,CA8E/E"}
|
package/dist/release-channels.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { fayzPackageVersionSets, resolveFayzPackageDependencies, resolveFayzPackageVersion, resolveFayzPackageVersions } from './chunk-
|
|
1
|
+
export { fayzPackageVersionSets, resolveFayzPackageDependencies, resolveFayzPackageVersion, resolveFayzPackageVersions } from './chunk-QBNP7UYY.js';
|
|
2
2
|
//# sourceMappingURL=release-channels.js.map
|
|
3
3
|
//# sourceMappingURL=release-channels.js.map
|
|
@@ -1,103 +1,103 @@
|
|
|
1
1
|
{
|
|
2
2
|
"channels": {
|
|
3
3
|
"stable": {
|
|
4
|
-
"@fayz-ai/sdk": "^0.
|
|
5
|
-
"@fayz-ai/admin": "^0.
|
|
6
|
-
"@fayz-ai/core": "^0.
|
|
7
|
-
"@fayz-ai/auth": "^0.
|
|
8
|
-
"@fayz-ai/ui": "^0.
|
|
9
|
-
"@fayz-ai/shop": "^0.
|
|
10
|
-
"@fayz-ai/storefront": "^0.
|
|
11
|
-
"@fayz-ai/portal": "^0.
|
|
12
|
-
"@fayz-ai/courses": "^0.
|
|
13
|
-
"@fayz-ai/db": "^0.
|
|
14
|
-
"@fayz-ai/plugin-agenda": "^0.
|
|
15
|
-
"@fayz-ai/plugin-auth": "^0.12.
|
|
16
|
-
"@fayz-ai/plugin-automations": "^0.
|
|
17
|
-
"@fayz-ai/plugin-blog": "^0.12.
|
|
18
|
-
"@fayz-ai/plugin-conversations": "^0.
|
|
19
|
-
"@fayz-ai/plugin-courses": "^0.10.
|
|
20
|
-
"@fayz-ai/plugin-crm": "^0.
|
|
21
|
-
"@fayz-ai/plugin-dashboard": "^0.9.
|
|
22
|
-
"@fayz-ai/plugin-financial": "^0.
|
|
23
|
-
"@fayz-ai/plugin-forms": "^0.
|
|
24
|
-
"@fayz-ai/plugin-inventory": "^0.
|
|
25
|
-
"@fayz-ai/plugin-marketing": "^0.
|
|
26
|
-
"@fayz-ai/plugin-menu": "^0.
|
|
27
|
-
"@fayz-ai/plugin-orders": "^0.12.
|
|
28
|
-
"@fayz-ai/plugin-payments": "^0.9.
|
|
29
|
-
"@fayz-ai/plugin-reports": "^0.
|
|
30
|
-
"@fayz-ai/plugin-reputation": "^0.10.
|
|
31
|
-
"@fayz-ai/plugin-shop": "^0.
|
|
32
|
-
"@fayz-ai/plugin-sites": "^0.9.
|
|
33
|
-
"@fayz-ai/plugin-tables": "^0.
|
|
34
|
-
"@fayz-ai/plugin-tasks": "^0.10.
|
|
4
|
+
"@fayz-ai/sdk": "^0.36.0",
|
|
5
|
+
"@fayz-ai/admin": "^0.36.0",
|
|
6
|
+
"@fayz-ai/core": "^0.36.0",
|
|
7
|
+
"@fayz-ai/auth": "^0.36.0",
|
|
8
|
+
"@fayz-ai/ui": "^0.36.0",
|
|
9
|
+
"@fayz-ai/shop": "^0.36.0",
|
|
10
|
+
"@fayz-ai/storefront": "^0.36.0",
|
|
11
|
+
"@fayz-ai/portal": "^0.36.0",
|
|
12
|
+
"@fayz-ai/courses": "^0.36.0",
|
|
13
|
+
"@fayz-ai/db": "^0.22.0",
|
|
14
|
+
"@fayz-ai/plugin-agenda": "^0.21.0",
|
|
15
|
+
"@fayz-ai/plugin-auth": "^0.12.16",
|
|
16
|
+
"@fayz-ai/plugin-automations": "^0.15.3",
|
|
17
|
+
"@fayz-ai/plugin-blog": "^0.12.19",
|
|
18
|
+
"@fayz-ai/plugin-conversations": "^0.22.3",
|
|
19
|
+
"@fayz-ai/plugin-courses": "^0.10.24",
|
|
20
|
+
"@fayz-ai/plugin-crm": "^0.31.4",
|
|
21
|
+
"@fayz-ai/plugin-dashboard": "^0.9.23",
|
|
22
|
+
"@fayz-ai/plugin-financial": "^0.19.0",
|
|
23
|
+
"@fayz-ai/plugin-forms": "^0.13.3",
|
|
24
|
+
"@fayz-ai/plugin-inventory": "^0.14.0",
|
|
25
|
+
"@fayz-ai/plugin-marketing": "^0.13.7",
|
|
26
|
+
"@fayz-ai/plugin-menu": "^0.11.3",
|
|
27
|
+
"@fayz-ai/plugin-orders": "^0.12.20",
|
|
28
|
+
"@fayz-ai/plugin-payments": "^0.9.21",
|
|
29
|
+
"@fayz-ai/plugin-reports": "^0.16.3",
|
|
30
|
+
"@fayz-ai/plugin-reputation": "^0.10.18",
|
|
31
|
+
"@fayz-ai/plugin-shop": "^0.16.7",
|
|
32
|
+
"@fayz-ai/plugin-sites": "^0.9.21",
|
|
33
|
+
"@fayz-ai/plugin-tables": "^0.12.4",
|
|
34
|
+
"@fayz-ai/plugin-tasks": "^0.10.21"
|
|
35
35
|
},
|
|
36
36
|
"latest": {
|
|
37
|
-
"@fayz-ai/sdk": "^0.
|
|
38
|
-
"@fayz-ai/admin": "^0.
|
|
39
|
-
"@fayz-ai/core": "^0.
|
|
40
|
-
"@fayz-ai/auth": "^0.
|
|
41
|
-
"@fayz-ai/ui": "^0.
|
|
42
|
-
"@fayz-ai/shop": "^0.
|
|
43
|
-
"@fayz-ai/storefront": "^0.
|
|
44
|
-
"@fayz-ai/portal": "^0.
|
|
45
|
-
"@fayz-ai/courses": "^0.
|
|
46
|
-
"@fayz-ai/db": "^0.
|
|
47
|
-
"@fayz-ai/plugin-agenda": "^0.
|
|
48
|
-
"@fayz-ai/plugin-auth": "^0.12.
|
|
49
|
-
"@fayz-ai/plugin-automations": "^0.
|
|
50
|
-
"@fayz-ai/plugin-blog": "^0.12.
|
|
51
|
-
"@fayz-ai/plugin-conversations": "^0.
|
|
52
|
-
"@fayz-ai/plugin-courses": "^0.10.
|
|
53
|
-
"@fayz-ai/plugin-crm": "^0.
|
|
54
|
-
"@fayz-ai/plugin-dashboard": "^0.9.
|
|
55
|
-
"@fayz-ai/plugin-financial": "^0.
|
|
56
|
-
"@fayz-ai/plugin-forms": "^0.
|
|
57
|
-
"@fayz-ai/plugin-inventory": "^0.
|
|
58
|
-
"@fayz-ai/plugin-marketing": "^0.
|
|
59
|
-
"@fayz-ai/plugin-menu": "^0.
|
|
60
|
-
"@fayz-ai/plugin-orders": "^0.12.
|
|
61
|
-
"@fayz-ai/plugin-payments": "^0.9.
|
|
62
|
-
"@fayz-ai/plugin-reports": "^0.
|
|
63
|
-
"@fayz-ai/plugin-reputation": "^0.10.
|
|
64
|
-
"@fayz-ai/plugin-shop": "^0.
|
|
65
|
-
"@fayz-ai/plugin-sites": "^0.9.
|
|
66
|
-
"@fayz-ai/plugin-tables": "^0.
|
|
67
|
-
"@fayz-ai/plugin-tasks": "^0.10.
|
|
37
|
+
"@fayz-ai/sdk": "^0.36.0",
|
|
38
|
+
"@fayz-ai/admin": "^0.36.0",
|
|
39
|
+
"@fayz-ai/core": "^0.36.0",
|
|
40
|
+
"@fayz-ai/auth": "^0.36.0",
|
|
41
|
+
"@fayz-ai/ui": "^0.36.0",
|
|
42
|
+
"@fayz-ai/shop": "^0.36.0",
|
|
43
|
+
"@fayz-ai/storefront": "^0.36.0",
|
|
44
|
+
"@fayz-ai/portal": "^0.36.0",
|
|
45
|
+
"@fayz-ai/courses": "^0.36.0",
|
|
46
|
+
"@fayz-ai/db": "^0.22.0",
|
|
47
|
+
"@fayz-ai/plugin-agenda": "^0.21.0",
|
|
48
|
+
"@fayz-ai/plugin-auth": "^0.12.16",
|
|
49
|
+
"@fayz-ai/plugin-automations": "^0.15.3",
|
|
50
|
+
"@fayz-ai/plugin-blog": "^0.12.19",
|
|
51
|
+
"@fayz-ai/plugin-conversations": "^0.22.3",
|
|
52
|
+
"@fayz-ai/plugin-courses": "^0.10.24",
|
|
53
|
+
"@fayz-ai/plugin-crm": "^0.31.4",
|
|
54
|
+
"@fayz-ai/plugin-dashboard": "^0.9.23",
|
|
55
|
+
"@fayz-ai/plugin-financial": "^0.19.0",
|
|
56
|
+
"@fayz-ai/plugin-forms": "^0.13.3",
|
|
57
|
+
"@fayz-ai/plugin-inventory": "^0.14.0",
|
|
58
|
+
"@fayz-ai/plugin-marketing": "^0.13.7",
|
|
59
|
+
"@fayz-ai/plugin-menu": "^0.11.3",
|
|
60
|
+
"@fayz-ai/plugin-orders": "^0.12.20",
|
|
61
|
+
"@fayz-ai/plugin-payments": "^0.9.21",
|
|
62
|
+
"@fayz-ai/plugin-reports": "^0.16.3",
|
|
63
|
+
"@fayz-ai/plugin-reputation": "^0.10.18",
|
|
64
|
+
"@fayz-ai/plugin-shop": "^0.16.7",
|
|
65
|
+
"@fayz-ai/plugin-sites": "^0.9.21",
|
|
66
|
+
"@fayz-ai/plugin-tables": "^0.12.4",
|
|
67
|
+
"@fayz-ai/plugin-tasks": "^0.10.21"
|
|
68
68
|
},
|
|
69
69
|
"preview": {
|
|
70
|
-
"@fayz-ai/sdk": "^0.
|
|
71
|
-
"@fayz-ai/admin": "^0.
|
|
72
|
-
"@fayz-ai/core": "^0.
|
|
73
|
-
"@fayz-ai/auth": "^0.
|
|
74
|
-
"@fayz-ai/ui": "^0.
|
|
75
|
-
"@fayz-ai/shop": "^0.
|
|
76
|
-
"@fayz-ai/storefront": "^0.
|
|
77
|
-
"@fayz-ai/portal": "^0.
|
|
78
|
-
"@fayz-ai/courses": "^0.
|
|
79
|
-
"@fayz-ai/db": "^0.
|
|
80
|
-
"@fayz-ai/plugin-agenda": "^0.
|
|
81
|
-
"@fayz-ai/plugin-auth": "^0.12.
|
|
82
|
-
"@fayz-ai/plugin-automations": "^0.
|
|
83
|
-
"@fayz-ai/plugin-blog": "^0.12.
|
|
84
|
-
"@fayz-ai/plugin-conversations": "^0.
|
|
85
|
-
"@fayz-ai/plugin-courses": "^0.10.
|
|
86
|
-
"@fayz-ai/plugin-crm": "^0.
|
|
87
|
-
"@fayz-ai/plugin-dashboard": "^0.9.
|
|
88
|
-
"@fayz-ai/plugin-financial": "^0.
|
|
89
|
-
"@fayz-ai/plugin-forms": "^0.
|
|
90
|
-
"@fayz-ai/plugin-inventory": "^0.
|
|
91
|
-
"@fayz-ai/plugin-marketing": "^0.
|
|
92
|
-
"@fayz-ai/plugin-menu": "^0.
|
|
93
|
-
"@fayz-ai/plugin-orders": "^0.12.
|
|
94
|
-
"@fayz-ai/plugin-payments": "^0.9.
|
|
95
|
-
"@fayz-ai/plugin-reports": "^0.
|
|
96
|
-
"@fayz-ai/plugin-reputation": "^0.10.
|
|
97
|
-
"@fayz-ai/plugin-shop": "^0.
|
|
98
|
-
"@fayz-ai/plugin-sites": "^0.9.
|
|
99
|
-
"@fayz-ai/plugin-tables": "^0.
|
|
100
|
-
"@fayz-ai/plugin-tasks": "^0.10.
|
|
70
|
+
"@fayz-ai/sdk": "^0.36.0",
|
|
71
|
+
"@fayz-ai/admin": "^0.36.0",
|
|
72
|
+
"@fayz-ai/core": "^0.36.0",
|
|
73
|
+
"@fayz-ai/auth": "^0.36.0",
|
|
74
|
+
"@fayz-ai/ui": "^0.36.0",
|
|
75
|
+
"@fayz-ai/shop": "^0.36.0",
|
|
76
|
+
"@fayz-ai/storefront": "^0.36.0",
|
|
77
|
+
"@fayz-ai/portal": "^0.36.0",
|
|
78
|
+
"@fayz-ai/courses": "^0.36.0",
|
|
79
|
+
"@fayz-ai/db": "^0.22.0",
|
|
80
|
+
"@fayz-ai/plugin-agenda": "^0.21.0",
|
|
81
|
+
"@fayz-ai/plugin-auth": "^0.12.16",
|
|
82
|
+
"@fayz-ai/plugin-automations": "^0.15.3",
|
|
83
|
+
"@fayz-ai/plugin-blog": "^0.12.19",
|
|
84
|
+
"@fayz-ai/plugin-conversations": "^0.22.3",
|
|
85
|
+
"@fayz-ai/plugin-courses": "^0.10.24",
|
|
86
|
+
"@fayz-ai/plugin-crm": "^0.31.4",
|
|
87
|
+
"@fayz-ai/plugin-dashboard": "^0.9.23",
|
|
88
|
+
"@fayz-ai/plugin-financial": "^0.19.0",
|
|
89
|
+
"@fayz-ai/plugin-forms": "^0.13.3",
|
|
90
|
+
"@fayz-ai/plugin-inventory": "^0.14.0",
|
|
91
|
+
"@fayz-ai/plugin-marketing": "^0.13.7",
|
|
92
|
+
"@fayz-ai/plugin-menu": "^0.11.3",
|
|
93
|
+
"@fayz-ai/plugin-orders": "^0.12.20",
|
|
94
|
+
"@fayz-ai/plugin-payments": "^0.9.21",
|
|
95
|
+
"@fayz-ai/plugin-reports": "^0.16.3",
|
|
96
|
+
"@fayz-ai/plugin-reputation": "^0.10.18",
|
|
97
|
+
"@fayz-ai/plugin-shop": "^0.16.7",
|
|
98
|
+
"@fayz-ai/plugin-sites": "^0.9.21",
|
|
99
|
+
"@fayz-ai/plugin-tables": "^0.12.4",
|
|
100
|
+
"@fayz-ai/plugin-tasks": "^0.10.21"
|
|
101
101
|
}
|
|
102
102
|
}
|
|
103
103
|
}
|
package/dist/vite.js
CHANGED
|
@@ -4,6 +4,7 @@ import { createHash } from 'crypto';
|
|
|
4
4
|
|
|
5
5
|
// src/vite.ts
|
|
6
6
|
var SW_FILE = "sw.js";
|
|
7
|
+
var HEADERS_FILE = "_headers";
|
|
7
8
|
var MANIFEST_FILE = "manifest.webmanifest";
|
|
8
9
|
var ICON_FILE = "icon.svg";
|
|
9
10
|
var CACHE_PREFIX = "app-shell-";
|
|
@@ -115,6 +116,13 @@ self.addEventListener('activate', function (event) {
|
|
|
115
116
|
);
|
|
116
117
|
});
|
|
117
118
|
|
|
119
|
+
// The ONLY way to take over early, and it comes from outside. The page asks;
|
|
120
|
+
// if the person says yes, it sends this message. Without it the behaviour is
|
|
121
|
+
// what it always was: install quietly, take over when allowed.
|
|
122
|
+
self.addEventListener('message', function (event) {
|
|
123
|
+
if (event.data === 'skip-waiting') self.skipWaiting();
|
|
124
|
+
});
|
|
125
|
+
|
|
118
126
|
self.addEventListener('fetch', function (event) {
|
|
119
127
|
var request = event.request;
|
|
120
128
|
if (request.method !== 'GET') return;
|
|
@@ -158,12 +166,62 @@ function insertAfter(html, anchor, chunk) {
|
|
|
158
166
|
${chunk}${html.slice(at)}`;
|
|
159
167
|
}
|
|
160
168
|
function registrationScript(swUrl) {
|
|
161
|
-
|
|
169
|
+
const source = `
|
|
170
|
+
if ('serviceWorker' in navigator) {
|
|
171
|
+
addEventListener('load', function () {
|
|
172
|
+
navigator.serviceWorker.register('${swUrl}').then(function (reg) {
|
|
173
|
+
var reloading = false;
|
|
174
|
+
navigator.serviceWorker.addEventListener('controllerchange', function () {
|
|
175
|
+
if (reloading) return;
|
|
176
|
+
reloading = true;
|
|
177
|
+
location.reload();
|
|
178
|
+
});
|
|
179
|
+
window.fayzApplyUpdate = function () {
|
|
180
|
+
if (reg.waiting) reg.waiting.postMessage('skip-waiting');
|
|
181
|
+
};
|
|
182
|
+
function announce() {
|
|
183
|
+
// Only when a controller ALREADY exists: without one this is a first
|
|
184
|
+
// visit, the worker is installing for the first time and there is no
|
|
185
|
+
// "new version" to offer \u2014 announcing here would ask someone to
|
|
186
|
+
// reload a page they just opened.
|
|
187
|
+
if (reg.waiting && navigator.serviceWorker.controller) {
|
|
188
|
+
dispatchEvent(new CustomEvent('fayz:update-ready'));
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
announce();
|
|
192
|
+
reg.addEventListener('updatefound', function () {
|
|
193
|
+
var sw = reg.installing;
|
|
194
|
+
if (!sw) return;
|
|
195
|
+
sw.addEventListener('statechange', function () {
|
|
196
|
+
if (sw.state === 'installed') announce();
|
|
197
|
+
});
|
|
198
|
+
});
|
|
199
|
+
// A tab left open all day never re-checks the worker on its own. Hourly
|
|
200
|
+
// is cheap (a conditional GET of a few KB) and it is what gets the
|
|
201
|
+
// invitation to the people who never close the browser.
|
|
202
|
+
setInterval(function () { reg.update().catch(function () {}); }, 3600000);
|
|
203
|
+
}).catch(function () {});
|
|
204
|
+
});
|
|
205
|
+
}`.trim();
|
|
206
|
+
return `<script>${source}</script>`;
|
|
162
207
|
}
|
|
163
208
|
function isPrecacheable(fileName) {
|
|
164
209
|
if (fileName === SW_FILE || fileName === MANIFEST_FILE) return false;
|
|
165
210
|
return !fileName.endsWith(".map") && !fileName.endsWith(".html");
|
|
166
211
|
}
|
|
212
|
+
function headersSource(base) {
|
|
213
|
+
return [
|
|
214
|
+
`${base}assets/*`,
|
|
215
|
+
" Cache-Control: public, max-age=31536000, immutable",
|
|
216
|
+
"",
|
|
217
|
+
`${base}${SW_FILE}`,
|
|
218
|
+
" Cache-Control: no-cache",
|
|
219
|
+
"",
|
|
220
|
+
`${base}index.html`,
|
|
221
|
+
" Cache-Control: no-cache",
|
|
222
|
+
""
|
|
223
|
+
].join("\n");
|
|
224
|
+
}
|
|
167
225
|
function appShellPwa(root, opts = {}) {
|
|
168
226
|
const app = identity(root, opts);
|
|
169
227
|
const themeColor = opts.themeColor ?? DEFAULT_THEME;
|
|
@@ -190,6 +248,11 @@ function appShellPwa(root, opts = {}) {
|
|
|
190
248
|
fileName: SW_FILE,
|
|
191
249
|
source: serviceWorkerSource(buildId, shell, precache)
|
|
192
250
|
});
|
|
251
|
+
this.emitFile({
|
|
252
|
+
type: "asset",
|
|
253
|
+
fileName: HEADERS_FILE,
|
|
254
|
+
source: headersSource(base)
|
|
255
|
+
});
|
|
193
256
|
this.emitFile({
|
|
194
257
|
type: "asset",
|
|
195
258
|
fileName: MANIFEST_FILE,
|
package/dist/vite.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/lib/app-shell-pwa.ts","../src/lib/boot-skeleton.ts","../src/vite.ts"],"names":["identity","lightnessOf","resolve","existsSync","readFileSync","HEAD_ANCHOR","insertAfter"],"mappings":";;;;;AAoCA,IAAM,OAAA,GAAU,OAAA;AAChB,IAAM,aAAA,GAAgB,sBAAA;AACtB,IAAM,SAAA,GAAY,UAAA;AAIlB,IAAM,YAAA,GAAe,YAAA;AAIrB,IAAM,aAAA,GAAgB,SAAA;AACtB,IAAM,kBAAA,GAAqB,SAAA;AAQ3B,SAAS,YAAY,GAAA,EAAqB;AACxC,EAAA,MAAM,MAAM,GAAA,CAAI,IAAA,EAAK,CAAE,OAAA,CAAQ,KAAK,EAAE,CAAA;AACtC,EAAA,MAAM,IAAA,GAAO,GAAA,CAAI,MAAA,KAAW,CAAA,GAAI,GAAA,CAAI,OAAA,CAAQ,IAAA,EAAM,CAAC,CAAA,KAAM,CAAA,GAAI,CAAC,CAAA,GAAI,GAAA;AAClE,EAAA,IAAI,CAAC,gBAAA,CAAiB,IAAA,CAAK,IAAI,GAAG,OAAO,GAAA;AACzC,EAAA,MAAM,CAAC,GAAG,CAAA,EAAG,CAAC,IAAI,CAAC,CAAA,EAAG,CAAA,EAAG,CAAC,CAAA,CAAE,GAAA,CAAI,CAAC,CAAA,KAAM,QAAA,CAAS,KAAK,KAAA,CAAM,CAAA,EAAG,IAAI,CAAC,CAAA,EAAG,EAAE,CAAA,GAAI,GAAG,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AAsB,qBAAA;AAAA,QAAuB,uBAAA;AAAA,QAC7C,wBAAA;AAAA,QAA0B,oBAAA;AAAA,QAAsB,2BAAA;AAAA,QAChD,8BAAA;AAAA,QAAgC,wBAAA;AAAA,QAChC,gCAAA;AAAA,QAAkC;AAAA,OACpC;AAAA,MACA,UAAA,EAAY,WAAW,CAAC,QAAA,EAAU,WAAW,QAAA,EAAU,aAAA,EAAe,QAAQ,CAAA,GAAI;AAAA,KACpF;AAAA,IACA,YAAA,EAAc;AAAA,MACZ,SAAS,QAAA,GAAW,MAAA,CAAO,IAAA,CAAK,YAAY,IAAI,EAAC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,MAOjD,OAAA,EAAS,QAAA,GAAW,aAAA,CAAc,IAAA,EAAM,cAAc,CAAA,GAAI;AAAA,KAC5D;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAOA,MAAA,EAAQ;AAAA,MACN,IAAA,EAAM,IAAA;AAAA,MACN,MAAM,IAAA,CAAK,IAAA;AAAA,MACX,YAAY,IAAA,CAAK,UAAA;AAAA,MACjB,IAAA,EAAM,IAAA;AAAA,MACN,YAAA,EAAc,IAAA;AAAA,MACd,OAAA,EAAS;AAAA,QACP,6BAAA,EAA+B,GAAA;AAAA,QAC/B,8BAAA,EAAgC;AAAA,OAClC;AAAA,MACA,IAAI,EAAE,KAAA,EAAO,CAAC,IAAA,EAAM,OAAO,CAAA,EAAE;AAAA,MAC7B,GAAI,IAAA,CAAK,MAAA,IAAU;AAAC;AACtB,GACF;AACF","file":"vite.js","sourcesContent":["import { createHash } from 'node:crypto'\nimport { existsSync, readFileSync } from 'node:fs'\nimport { resolve } from 'node:path'\nimport type { Plugin } from 'vite'\n\n// ---------------------------------------------------------------------------\n// App shell, cached — the second load, and every load after it.\n//\n// The boot screen fixes the blank page; it does not fix the WAIT. A deployed\n// app still fetches its entry chunk over the network every single time, and on\n// a phone on café wifi that is the whole perceived cost of \"opening the app\".\n// A service worker that precaches the build turns the shell into something the\n// device already has: reload is instant, and a dropped connection still gets\n// the app (its own data is another story — see the fetch rules below).\n//\n// Hand-rolled on purpose. What we need is a precache list, a cache name and\n// three event listeners — about a page of JavaScript, against a build-time\n// dependency the preview container would have to cold-install on every start.\n//\n// Build only. A dev server that installs a service worker serves yesterday's\n// bundle to a developer who just saved a file, and the confusion costs more\n// than the caching saves.\n// ---------------------------------------------------------------------------\n\nexport interface AppShellPwaOptions {\n /** Install name. Default: the app's package.json name, de-scoped and titled. */\n name?: string\n /** Home-screen label, ideally ≤12 chars. Default: derived from `name`. */\n shortName?: string\n /** Browser chrome / icon color. Default: the boot screen's neutral rail. */\n themeColor?: string\n /** Splash background while the app boots. Default: the boot screen's page. */\n backgroundColor?: string\n}\n\n/** The emitted file names, at the bundle root (not under assets/). */\nconst SW_FILE = 'sw.js'\nconst MANIFEST_FILE = 'manifest.webmanifest'\nconst ICON_FILE = 'icon.svg'\n\n/** Every cache this SW owns is `<prefix><build id>`, so activate can tell its\n * own stale generations apart from caches belonging to anything else. */\nconst CACHE_PREFIX = 'app-shell-'\n\n// The same neutral defaults the boot screen paints with (see boot-skeleton.ts),\n// so the manifest, the theme-color meta and the first paint agree.\nconst DEFAULT_THEME = '#131c26'\nconst DEFAULT_BACKGROUND = '#f1f1f1'\n\ninterface AppIdentity {\n name: string\n shortName: string\n}\n\n/** Perceived lightness of a hex color, 0-100; non-hex is assumed light. */\nfunction lightnessOf(css: string): number {\n const hex = css.trim().replace('#', '')\n const full = hex.length === 3 ? hex.replace(/./g, (c) => c + c) : hex\n if (!/^[0-9a-f]{6}$/i.test(full)) return 100\n const [r, g, b] = [0, 2, 4].map((i) => parseInt(full.slice(i, i + 2), 16) / 255)\n return ((Math.max(r, g, b) + Math.min(r, g, b)) / 2) * 100\n}\n\nfunction readPackageName(root: string): string | undefined {\n const pkgPath = resolve(root, 'package.json')\n if (!existsSync(pkgPath)) return undefined\n try {\n const pkg = JSON.parse(readFileSync(pkgPath, 'utf8')) as { name?: string }\n return pkg.name\n } catch {\n return undefined\n }\n}\n\n/** `@acme/beauty-saas` → `Beauty Saas`. Good enough for a home-screen label,\n * and `name` overrides it whenever the app cares. */\nfunction titleize(pkgName: string): string {\n const bare = pkgName.replace(/^@[^/]+\\//, '')\n return (\n bare\n .split(/[-_.\\s]+/)\n .filter(Boolean)\n .map((word) => word.charAt(0).toUpperCase() + word.slice(1))\n .join(' ') || bare\n )\n}\n\nfunction identity(root: string, opts: AppShellPwaOptions): AppIdentity {\n const pkgName = readPackageName(root)\n const name = opts.name ?? (pkgName ? titleize(pkgName) : 'App')\n const shortName = opts.shortName ?? (name.length <= 12 ? name : name.split(' ')[0].slice(0, 12))\n return { name, shortName }\n}\n\n/** A maskable mark: rounded square in the theme color, app initial on top.\n * The glyph stays well inside the 80% safe zone, so a circular mask on\n * Android does not clip it. PNG sizes are a follow-up. */\nfunction iconSvg(identity: AppIdentity, themeColor: string): string {\n const initial = (identity.name.match(/[a-z0-9]/i)?.[0] ?? 'A').toUpperCase()\n const ink = lightnessOf(themeColor) > 55 ? '#111111' : '#ffffff'\n return `<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 512 512\" width=\"512\" height=\"512\" role=\"img\" aria-label=\"${escapeXml(identity.name)}\">\n<rect width=\"512\" height=\"512\" rx=\"112\" fill=\"${themeColor}\"/>\n<text x=\"256\" y=\"256\" fill=\"${ink}\" font-family=\"system-ui,-apple-system,'Segoe UI',sans-serif\" font-size=\"232\" font-weight=\"600\" text-anchor=\"middle\" dominant-baseline=\"central\">${escapeXml(initial)}</text>\n</svg>\n`\n}\n\nfunction escapeXml(value: string): string {\n return value.replace(/[<>&\"']/g, (c) => `&#${c.charCodeAt(0)};`)\n}\n\nfunction manifestJson(\n identity: AppIdentity,\n base: string,\n themeColor: string,\n backgroundColor: string,\n): string {\n return `${JSON.stringify(\n {\n name: identity.name,\n short_name: identity.shortName,\n start_url: base,\n scope: base,\n display: 'standalone',\n theme_color: themeColor,\n background_color: backgroundColor,\n icons: [\n {\n src: `${base}${ICON_FILE}`,\n sizes: 'any',\n type: 'image/svg+xml',\n purpose: 'any maskable',\n },\n ],\n },\n null,\n 2,\n )}\\n`\n}\n\n/**\n * The worker itself, as plain JS with the build's precache list baked in.\n *\n * Caching rules, in the order the fetch handler applies them:\n * - non-GET, or cross-origin → untouched, the network answers\n * - navigation → network first, cached index.html offline\n * - a precached (hashed) asset → cache first, it can never go stale\n * - anything else same-origin → untouched (API reads/writes land here)\n *\n * The last rule is the important one: Supabase and every other API call goes\n * straight to the network, always. A service worker that answers a data\n * request from cache shows the user a number that is quietly wrong, which is\n * worse than an error.\n *\n * There is no `skipWaiting`. A new build installs in the background and takes\n * over on the NEXT load, so a tab in the middle of a form never has its code\n * swapped underneath it.\n */\nfunction serviceWorkerSource(buildId: string, shell: string, precache: string[]): string {\n return `// Generated by @fayz-ai/sdk at build time. Do not edit.\nconst BUILD_ID = ${JSON.stringify(buildId)};\nconst CACHE = ${JSON.stringify(CACHE_PREFIX)} + BUILD_ID;\nconst SHELL = ${JSON.stringify(shell)};\nconst PRECACHE = ${JSON.stringify(precache, null, 2)};\nconst PRECACHED = new Set(PRECACHE);\n\nself.addEventListener('install', function (event) {\n event.waitUntil(\n caches.open(CACHE).then(function (cache) {\n // One request at a time and forgiving: a single 404 must not void the\n // whole precache the way cache.addAll() would.\n return Promise.all(\n PRECACHE.map(function (url) {\n return cache.add(new Request(url, { cache: 'reload' })).catch(function () {});\n })\n );\n })\n );\n});\n\nself.addEventListener('activate', function (event) {\n event.waitUntil(\n caches\n .keys()\n .then(function (keys) {\n return Promise.all(\n keys\n .filter(function (key) {\n return key.indexOf(${JSON.stringify(CACHE_PREFIX)}) === 0 && key !== CACHE;\n })\n .map(function (key) {\n return caches.delete(key);\n })\n );\n })\n .then(function () {\n return self.clients.claim();\n })\n );\n});\n\nself.addEventListener('fetch', function (event) {\n var request = event.request;\n if (request.method !== 'GET') return;\n var url;\n try {\n url = new URL(request.url);\n } catch (e) {\n return;\n }\n if (url.origin !== self.location.origin) return;\n\n if (request.mode === 'navigate') {\n event.respondWith(\n fetch(request).catch(function () {\n return caches.match(SHELL, { cacheName: CACHE }).then(function (hit) {\n return hit || Response.error();\n });\n })\n );\n return;\n }\n\n // Only the build's own hashed assets, which are immutable by construction.\n // Everything else same-origin (API calls above all) is left to the network.\n if (!PRECACHED.has(url.pathname)) return;\n event.respondWith(\n caches.match(request, { cacheName: CACHE }).then(function (hit) {\n return hit || fetch(request);\n })\n );\n});\n`\n}\n\nconst HEAD_ANCHOR = /<head[^>]*>/i\nconst BODY_END = /<\\/body>/i\n\nfunction insertAfter(html: string, anchor: RegExp, chunk: string): string | null {\n const match = anchor.exec(html)\n if (!match) return null\n const at = match.index + match[0].length\n return `${html.slice(0, at)}\\n${chunk}${html.slice(at)}`\n}\n\nfunction registrationScript(swUrl: string): string {\n return `<script>if('serviceWorker' in navigator){addEventListener('load',function(){navigator.serviceWorker.register('${swUrl}').catch(function(){})})}</script>`\n}\n\n/** What goes in the precache list: the build's own output, minus the things a\n * cache has no use for (sourcemaps, the worker itself, other HTML). */\nfunction isPrecacheable(fileName: string): boolean {\n if (fileName === SW_FILE || fileName === MANIFEST_FILE) return false\n return !fileName.endsWith('.map') && !fileName.endsWith('.html')\n}\n\nexport function appShellPwa(root: string, opts: AppShellPwaOptions = {}): Plugin {\n const app = identity(root, opts)\n const themeColor = opts.themeColor ?? DEFAULT_THEME\n const backgroundColor = opts.backgroundColor ?? DEFAULT_BACKGROUND\n // Deployments under a subpath exist (preview containers, docs sites); every\n // emitted URL is base-relative so `/` is just the common case.\n let base = '/'\n\n return {\n name: 'fayz:app-shell-pwa',\n apply: 'build',\n\n configResolved(config) {\n base = config.base || '/'\n if (!base.endsWith('/')) base += '/'\n },\n\n generateBundle: {\n order: 'post',\n handler(_options, bundle) {\n const precache = Object.keys(bundle)\n .filter(isPrecacheable)\n .sort()\n .map((fileName) => `${base}${fileName}`)\n const shell = `${base}index.html`\n precache.unshift(shell)\n\n // The index.html source joins the hash: its asset names already change\n // per build, but its INLINE content (boot screen, meta) can change on\n // its own, and a shell served from an old cache would be that content.\n const indexAsset = bundle['index.html']\n const indexSource =\n indexAsset && indexAsset.type === 'asset' ? String(indexAsset.source) : ''\n const buildId = createHash('sha256')\n .update(precache.join('\\n'))\n .update(indexSource)\n .digest('hex')\n .slice(0, 12)\n\n this.emitFile({\n type: 'asset',\n fileName: SW_FILE,\n source: serviceWorkerSource(buildId, shell, precache),\n })\n this.emitFile({\n type: 'asset',\n fileName: MANIFEST_FILE,\n source: manifestJson(app, base, themeColor, backgroundColor),\n })\n this.emitFile({ type: 'asset', fileName: ICON_FILE, source: iconSvg(app, themeColor) })\n },\n },\n\n transformIndexHtml: {\n order: 'post',\n handler(html: string) {\n const manifestHref = `${base}${MANIFEST_FILE}`\n const link = /<link[^>]+rel=[\"']?manifest/i.test(html)\n ? ''\n : `<link rel=\"manifest\" href=\"${manifestHref}\" />`\n const script = html.includes('serviceWorker.register')\n ? ''\n : registrationScript(`${base}${SW_FILE}`)\n if (!link && !script) return html\n\n const withLink = link ? (insertAfter(html, HEAD_ANCHOR, link) ?? `${link}\\n${html}`) : html\n if (!script) return withLink\n return BODY_END.test(withLink)\n ? withLink.replace(BODY_END, `${script}\\n</body>`)\n : `${withLink}\\n${script}`\n },\n },\n }\n}\n","import { existsSync, readFileSync } from 'node:fs'\nimport { resolve } from 'node:path'\nimport type { Plugin } from 'vite'\n\n// ---------------------------------------------------------------------------\n// Boot screen — the first thing painted, from the HTML itself.\n//\n// The React boot screen only exists once React exists, and the wait BEFORE that\n// (fetch the entry chunk, parse it, run it) is the long part of a cold load:\n// the page sat blank for most of the wait. Anything that fills that window has\n// to be in the document the server already sent — markup and CSS the browser\n// can paint on its own, with no module graph behind it.\n//\n// What it paints is the THEME BACKGROUND and a spinner in the middle — light in\n// light mode, dark in dark mode. It used to paint the rail's color edge to\n// edge, but a dark splash in front of a light interface reads as a flash, not\n// a hand-off; the surface the app is about to paint is the only color that\n// disappears into it. It is deliberately the SAME image as AppShellSkeleton in\n// @fayz-ai/ui, so the handoff HTML → React → app never swaps anything the eye\n// can catch.\n//\n// The same inline script also resolves the theme mode before first paint, so a\n// dark-mode reload never flashes a light frame while React boots.\n//\n// It dismisses itself the moment React puts anything in #root.\n// ---------------------------------------------------------------------------\n\nexport interface BootSkeletonOptions {\n /**\n * 'admin' additionally seeds the app's stored palette tokens (sidebar) into\n * the document before React paints, so the console's rail mounts in its own\n * color; 'page' skips that; 'none' injects nothing. Both visible surfaces\n * paint the same background-colored screen. Default: 'admin' when the app\n * depends on @fayz-ai/admin or @fayz-ai/saas and not on @fayz-ai/storefront,\n * 'page' otherwise.\n */\n surface?: 'admin' | 'page' | 'none'\n /** @deprecated The boot screen paints the theme background, not the rail.\n * Accepted and ignored. */\n sidebar?: string\n /** Boot background, light mode. */\n background?: string\n /** Boot background, dark mode. */\n backgroundDark?: string\n}\n\n/** localStorage key the admin writes its resolved palette to, so the NEXT boot\n * paints in the app's own colors instead of the neutral default. */\nexport const BOOT_THEME_STORAGE_KEY = 'fayz:boot-theme'\n\n/** localStorage key the admin theme store writes the chosen mode to\n * ('light' | 'dark' | 'system', default 'light'). Duplicated as a literal on\n * both sides — see persistBootPalette in packages/admin/src/theme/utils.ts:\n * the app runtime must not depend on the build-tool package, and this file\n * must not depend on the admin package. */\nexport const THEME_MODE_STORAGE_KEY = 'saas-core:theme-mode'\n\n/** The same thing under @fayz-ai/ui's own theme store, which is what a\n * storefront or member app runs (packages/ui/src/stores/theme.store.ts). */\nexport const UI_THEME_MODE_STORAGE_KEY = 'fayz-ui:theme-mode'\n\n// The light/dark values of `--background` in @fayz-ai/ui — so React's first\n// real paint changes nothing.\nconst DEFAULT_PAGE = '#f1f1f1'\nconst DEFAULT_PAGE_DARK = '#1a1a1a'\n\nconst RING_ON_DARK = ['rgba(255,255,255,.18)', 'rgba(255,255,255,.7)'] as const\nconst RING_ON_LIGHT = ['rgba(0,0,0,.15)', 'rgba(0,0,0,.55)'] as const\n\n/** Perceived lightness of a hex color, 0-100. Non-hex CSS is assumed light —\n * a dark ring on an unknown surface is the safer miss on a white default. */\nfunction lightnessOf(css: string): number {\n const hex = css.trim().replace('#', '')\n const full = hex.length === 3 ? hex.replace(/./g, (c) => c + c) : hex\n if (!/^[0-9a-f]{6}$/i.test(full)) return 100\n const [r, g, b] = [0, 2, 4].map((i) => parseInt(full.slice(i, i + 2), 16) / 255)\n return ((Math.max(r, g, b) + Math.min(r, g, b)) / 2) * 100\n}\n\nfunction ringTones(background: string): readonly [string, string] {\n return lightnessOf(background) > 55 ? RING_ON_LIGHT : RING_ON_DARK\n}\n\nfunction markup(): string {\n return `<div id=\"fayz-boot\" role=\"status\" aria-live=\"polite\" aria-label=\"Carregando\"><span class=\"fb-spin\"></span></div>`\n}\n\n/** The overlay's own CSS. The `.dark` rule makes the screen correct at the\n * very first paint: the inline script sets the class synchronously before\n * the browser draws. The ring is drawn in rgba rather than a theme token,\n * which could land invisible. */\nfunction style(colors: { light: string; dark: string }): string {\n const [ring, ringLit] = ringTones(colors.light)\n const [darkRing, darkRingLit] = ringTones(colors.dark)\n return `<style id=\"fayz-boot-style\">\n#fayz-boot{--fb-bg:${colors.light};--fb-ring:${ring};--fb-ring-lit:${ringLit};position:fixed;inset:0;z-index:2147483000;display:flex;align-items:center;justify-content:center;background:var(--fb-bg);opacity:1;transition:opacity .2s ease}\n.dark #fayz-boot{--fb-bg:${colors.dark};--fb-ring:${darkRing};--fb-ring-lit:${darkRingLit}}\n#fayz-boot[data-leaving]{opacity:0;pointer-events:none}\n#fayz-boot .fb-spin{display:block;width:1.75rem;height:1.75rem;border-radius:9999px;border:2px solid var(--fb-ring);border-top-color:var(--fb-ring-lit);animation:fb-spin .7s linear infinite}\n@keyframes fb-spin{to{transform:rotate(360deg)}}\n@media (prefers-reduced-motion:reduce){#fayz-boot .fb-spin{animation:none;border-top-color:var(--fb-ring)}}\n</style>`\n}\n\n/**\n * Resolves the theme mode, seeds the app's stored palette tokens, then removes\n * the whole thing as soon as React fills #root.\n *\n * The mode has to be resolved HERE and not in React: the class that makes the\n * page dark only exists once the theme store runs, which is a whole module\n * graph too late — the browser has already painted a light frame by then.\n *\n * The MutationObserver is the handoff: no import, no callback the app has to\n * remember to call, and it works for any scaffold. The timeout is the safety\n * net — a boot that never mounts must not leave a fixed overlay on top of\n * whatever error the page is trying to show.\n */\nfunction dismissScript(surface: 'admin' | 'page', colors: { light: string; dark: string }): string {\n // Seed the app's own sidebar tokens before the bundle paints: the console's\n // rail (and the React skeleton's spinner) mount BEFORE the theme effect\n // applies the palette, and the default tokens would flash the wrong colors\n // for one theme-effect's worth of frames. applyTheme overwrites these same\n // inline properties on every boot.\n const paletteSeed =\n surface === 'admin'\n ? `\n try{\n var t=JSON.parse(localStorage.getItem('${BOOT_THEME_STORAGE_KEY}')||'null');\n if(t&&t.sidebar){\n de.style.setProperty('--sidebar',t.sidebar);\n if(t.sidebarForeground)de.style.setProperty('--sidebar-foreground',t.sidebarForeground);\n }\n }catch(e){}`\n : ''\n return `<script>(function(){\n var de=document.documentElement,dark=false;\n try{\n var m=localStorage.getItem('${THEME_MODE_STORAGE_KEY}')||localStorage.getItem('${UI_THEME_MODE_STORAGE_KEY}');\n dark=m==='dark'||(m==='system'&&!!window.matchMedia&&window.matchMedia('(prefers-color-scheme: dark)').matches);\n }catch(e){}\n de.classList.toggle('dark',dark);\n de.style.colorScheme=dark?'dark':'light';${paletteSeed}\n var boot=document.getElementById('fayz-boot'),root=document.getElementById('root');\n if(!boot)return;\n var meta=document.querySelector('meta[name=\"theme-color\"]');\n if(meta)meta.setAttribute('content',dark?'${colors.dark}':'${colors.light}');\n var gone=false,drop=function(){\n if(gone)return;gone=true;boot.setAttribute('data-leaving','');\n setTimeout(function(){boot.parentNode&&boot.parentNode.removeChild(boot)},250);\n };\n if(!root){drop();return}\n if(root.childNodes.length){drop();return}\n var mo=new MutationObserver(function(){\n if(!root.childNodes.length)return;\n mo.disconnect();\n (window.requestAnimationFrame||setTimeout)(drop);\n });\n mo.observe(root,{childList:true});\n setTimeout(function(){mo.disconnect();drop()},15000);\n})();</script>`\n}\n\n/** True when the app on disk renders an admin console. */\nfunction looksLikeAdminApp(root: string): boolean {\n const pkgPath = resolve(root, 'package.json')\n if (!existsSync(pkgPath)) return false\n try {\n const pkg = JSON.parse(readFileSync(pkgPath, 'utf8')) as {\n dependencies?: Record<string, string>\n devDependencies?: Record<string, string>\n }\n const deps = { ...pkg.dependencies, ...pkg.devDependencies }\n if (deps['@fayz-ai/storefront']) return false\n return Boolean(deps['@fayz-ai/admin'] || deps['@fayz-ai/saas'])\n } catch {\n return false\n }\n}\n\n// The head anchor swallows a leading charset meta if there is one: that\n// declaration has to stay inside the document's first 1024 bytes, and the boot\n// style is most of a kilobyte on its own.\nconst HEAD_ANCHOR = /<head[^>]*>(\\s*<meta[^>]+charset[^>]*>)?/i\nconst BODY_ANCHOR = /<body[^>]*>/i\n\n/** Inserts right after the opening tag, so the overlay paints before whatever\n * the template already had in there. */\nfunction insertAfter(html: string, anchor: RegExp, chunk: string): string | null {\n const match = anchor.exec(html)\n if (!match) return null\n const at = match.index + match[0].length\n return `${html.slice(0, at)}\\n${chunk}${html.slice(at)}`\n}\n\nexport function fayzBootSkeleton(root: string, opts: BootSkeletonOptions = {}): Plugin {\n const surface = opts.surface ?? (looksLikeAdminApp(root) ? 'admin' : 'page')\n // Neutral, not a guess at the brand: @fayz-ai/ui's own background values,\n // which is exactly what the app paints next.\n const colors = {\n light: opts.background ?? DEFAULT_PAGE,\n dark: opts.backgroundDark ?? DEFAULT_PAGE_DARK,\n }\n\n return {\n name: 'fayz:boot-skeleton',\n transformIndexHtml: {\n order: 'post',\n handler(html: string) {\n if (surface === 'none') return html\n if (!html.includes('id=\"root\"')) return html\n\n const hasThemeColor = /<meta[^>]+name=[\"']?theme-color/i.test(html)\n const headChunk = hasThemeColor\n ? style(colors)\n : `<meta name=\"theme-color\" content=\"${colors.light}\" />\\n${style(colors)}`\n const bodyChunk = `${markup()}\\n${dismissScript(surface, colors)}`\n\n const withHead = insertAfter(html, HEAD_ANCHOR, headChunk)\n // No <head> in the template: the style rides along at the top of the\n // body, still ahead of the markup it paints.\n const base = withHead ?? html\n const pending = withHead ? bodyChunk : `${headChunk}\\n${bodyChunk}`\n return insertAfter(base, BODY_ANCHOR, pending) ?? `${base}\\n${pending}`\n },\n },\n }\n}\n","import { existsSync, readdirSync } from 'node:fs'\nimport { resolve } from 'node:path'\nimport type { UserConfig, PluginOption, AliasOptions } from 'vite'\nimport { appShellPwa, type AppShellPwaOptions } from './lib/app-shell-pwa'\nimport { fayzBootSkeleton, type BootSkeletonOptions } from './lib/boot-skeleton'\n\nexport { BOOT_THEME_STORAGE_KEY, type BootSkeletonOptions } from './lib/boot-skeleton'\nexport { appShellPwa, type AppShellPwaOptions } from './lib/app-shell-pwa'\n\n/**\n * Every `@fayz-ai/*` package in the checkout, as a Vite alias map (root src).\n * Subpaths (e.g. `@fayz-ai/admin/ui`, `@fayz-ai/storefront/catalog`) resolve\n * automatically via Vite's prefix alias matching — the shim files mirror the\n * subpath under `src/`.\n *\n * Read from disk rather than listed, because a hardcoded list is only correct\n * for the version it shipped in and apps run the INSTALLED `fayzVite`, not this\n * one. That is how the `saas` → `admin` rename half-broke the fleet: `admin`\n * was not in 0.9.0's list, so every app resolved it through the workspace to\n * `packages/admin/dist` — a stale build in the middle of an otherwise\n * source-resolved app, which reads as a bug in the code rather than in the\n * setup. A directory listing cannot go stale.\n */\nfunction sdkAliases(sdkDir: string): Record<string, string> {\n const out: Record<string, string> = {}\n for (const group of ['packages', 'plugins']) {\n const dir = resolve(sdkDir, group)\n if (!existsSync(dir)) continue\n for (const name of readdirSync(dir)) {\n const src = resolve(dir, name, 'src')\n // The directory name is the package name minus the scope, for both groups\n // (packages/admin → @fayz-ai/admin, plugins/plugin-crm → …/plugin-crm).\n if (existsSync(resolve(src, 'index.ts'))) out[`@fayz-ai/${name}`] = src\n }\n }\n return out\n}\n\nexport interface FayzViteOptions {\n /** Dev server port. */\n port?: number\n /** Fail instead of incrementing if the port is taken. */\n strictPort?: boolean\n /** Extra app-specific aliases, merged after the SDK aliases. */\n aliases?: Record<string, string>\n /** Extra Vite plugins, appended after @vitejs/plugin-react. */\n plugins?: PluginOption[]\n /**\n * SDK source location, absolute or relative to the app root\n * (default `../../fayz-sdk`).\n *\n * The `FAYZ_SDK_DIR` environment variable OVERRIDES this — see\n * {@link resolveSdkDir}.\n */\n sdkDir?: string\n /** App root directory (default process.cwd()). */\n root?: string\n /**\n * Extra Vite `server` config, merged over the SDK server defaults. The\n * preview-container contract (host/cors/allowedHosts/headers) is applied\n * first, so an override can add e.g. `proxy` without dropping it.\n */\n server?: UserConfig['server']\n /**\n * Extra Vite `resolve` config, merged over the SDK resolve defaults. The SDK\n * alias map / dedupe / conditions win for `@fayz-ai/*` local-source\n * resolution; any other resolve keys (and extra aliases) are merged in.\n */\n resolve?: UserConfig['resolve']\n /**\n * The shell outline painted into index.html, so the wait for the entry chunk\n * is not a blank page. Auto-detected from the app's dependencies; pass\n * `{ surface: 'none' }` to opt out, or colors to match the app's palette on a\n * first-ever visit (later visits reuse the palette the app itself stored).\n */\n bootSkeleton?: BootSkeletonOptions\n /**\n * The built app precaches itself: a service worker + webmanifest emitted at\n * build time, so a deployed app reloads instantly and still opens with no\n * network. On by default, and build-only by construction — the dev server\n * never registers a worker. Pass `false` to opt out, or an object to name\n * the install / set its colors.\n */\n pwa?: boolean | AppShellPwaOptions\n}\n\n/**\n * Shared Vite config for Fayz dogfood apps. Resolves `@fayz-ai/*` from the local\n * SDK source when it is checked out next to the app AND `FAYZ_SDK_SOURCE` is not\n * `published`; otherwise from node_modules (the Fayz editor sandbox / published\n * npm). Apps no longer hand-maintain alias maps or the local-vs-npm guard.\n *\n * import { defineConfig } from 'vite'\n * import react from '@vitejs/plugin-react'\n * import { fayzVite } from '@fayz-ai/sdk/vite'\n * export default defineConfig(fayzVite({ port: 5185, plugins: [react()] }))\n *\n * Where that local source is read from is {@link resolveSdkDir}: `FAYZ_SDK_DIR`\n * beats the `sdkDir` option beats `../../fayz-sdk`.\n *\n * The app passes its own `@vitejs/plugin-react` so `@fayz-ai/sdk` carries no\n * build-tool peer deps (which otherwise choke npm's peer resolution, since sdk\n * sits in every dependency path).\n */\n/** Env var that redirects local-source resolution to another SDK checkout. */\nexport const FAYZ_SDK_DIR_ENV = 'FAYZ_SDK_DIR'\n\n/**\n * Where the local SDK source is, as an absolute path. Resolution order:\n *\n * 1. `FAYZ_SDK_DIR` (env) — wins, absolute or root-relative\n * 2. `sdkDir` (option) — what the app's vite config declares\n * 3. `../../fayz-sdk` — the sibling-checkout convention\n *\n * Env wins deliberately. `sdkDir` lives in the app's COMMITTED vite config, so\n * without an override there was no way to build, dev or `fayz validate` a\n * store against a different SDK tree (a worktree, a release branch) short of\n * editing that committed file or dropping an untracked config shim next to it\n * — which is exactly what the fleet ended up doing. An env var is the one\n * knob a CLI flag and a container can both set without touching the repo.\n *\n * Exported so the CLI and the tests agree on the precedence by construction\n * rather than by comment.\n */\nexport function resolveSdkDir(\n root: string,\n sdkDir?: string,\n env: Record<string, string | undefined> = process.env,\n): string {\n const fromEnv = env[FAYZ_SDK_DIR_ENV]?.trim()\n return resolve(root, fromEnv || sdkDir || '../../fayz-sdk')\n}\n\n/**\n * Bare deps that only ever appear behind a `React.lazy()` inside an @fayz-ai\n * package. See the `optimizeDeps.include` comment below for why they have to be\n * named. Filtered by what is actually installed, because a plugin the app does\n * not carry leaves its deps uninstalled and `include` hard-fails on those.\n */\nconst LAZY_ONLY_DEPS = ['recharts', '@dnd-kit/core', '@dnd-kit/sortable', '@dnd-kit/modifiers', '@dnd-kit/utilities']\n\nfunction installedDeps(root: string, names: string[]): string[] {\n const roots: string[] = []\n for (let dir = root, prev = ''; dir !== prev; prev = dir, dir = resolve(dir, '..')) {\n roots.push(resolve(dir, 'node_modules'))\n }\n return names.filter((name) => roots.some((nm) => existsSync(resolve(nm, name, 'package.json'))))\n}\n\nexport function fayzVite(opts: FayzViteOptions = {}): UserConfig {\n const root = opts.root ?? process.cwd()\n const fayzSdk = resolveSdkDir(root, opts.sdkDir)\n const wantLocal = process.env.FAYZ_SDK_SOURCE !== 'published'\n const localPresent = existsSync(resolve(fayzSdk, 'packages/core/src/index.ts'))\n const useLocal = wantLocal && localPresent\n\n const localAliases = useLocal ? sdkAliases(fayzSdk) : {}\n\n // Pull SDK-owned resolve keys out of any caller override so they can't clobber\n // local-source @fayz-ai/* resolution; the rest of `resolve` is merged in.\n const { alias: userAlias, dedupe: userDedupe, conditions: _ignore, ...restResolve } =\n (opts.resolve ?? {}) as Exclude<UserConfig['resolve'], undefined>\n\n const pwa = opts.pwa ?? true\n // The install colors follow the boot screen's, so the splash, the browser\n // chrome and the first paint are one surface rather than three guesses.\n const pwaPlugins =\n pwa === false\n ? []\n : [\n appShellPwa(root, {\n themeColor: opts.bootSkeleton?.sidebar ?? opts.bootSkeleton?.background,\n backgroundColor: opts.bootSkeleton?.background ?? opts.bootSkeleton?.sidebar,\n ...(pwa === true ? {} : pwa),\n }),\n ]\n\n return {\n plugins: [...(opts.plugins ?? []), fayzBootSkeleton(root, opts.bootSkeleton), ...pwaPlugins],\n envPrefix: ['VITE_', 'PUBLIC_'],\n resolve: {\n ...restResolve,\n alias: {\n '@': resolve(root, 'src'),\n ...localAliases,\n ...(opts.aliases ?? {}),\n ...((userAlias as Record<string, string> | undefined) ?? {}),\n } as AliasOptions,\n // lucide-react is a direct dep of both the app and every @fayz-ai/*\n // package; without dedupe a version skew installs two copies and esbuild\n // pre-bundles each barrel separately (~1,500 icon modules each).\n // Collapsing to one copy is the single biggest cut to the editor-container\n // optimize RAM/CPU spike. Only dedupe deps the *app* directly depends on\n // (so they're hoisted to its root node_modules) — deduping a transitive\n // like @tanstack/react-table makes Vite resolve it from the app root,\n // which fails in local-source mode and 500s the aliased UI source.\n //\n // @fullcalendar/* is here for a different reason: plugin-agenda and the\n // app each carry a copy, and only the app's has `premium-common`. Split\n // across two copies, the resource views register their ScrollGrid into a\n // `core` the calendar is not the instance of, and the week grid dies with\n // \"No ScrollGrid implementation\" — a failure that only surfaces after the\n // dep cache is cleared, so it reads as random.\n dedupe: userDedupe ?? [\n 'react', 'react-dom', 'zustand', 'lucide-react', 'react-router-dom',\n '@supabase/supabase-js', 'sonner',\n '@fullcalendar/core', '@fullcalendar/react', '@fullcalendar/daygrid',\n '@fullcalendar/timegrid', '@fullcalendar/list', '@fullcalendar/interaction',\n '@fullcalendar/premium-common', '@fullcalendar/resource',\n '@fullcalendar/resource-daygrid', '@fullcalendar/resource-timegrid',\n ],\n conditions: useLocal ? ['source', 'browser', 'module', 'jsnext:main', 'jsnext'] : undefined,\n },\n optimizeDeps: {\n exclude: useLocal ? Object.keys(localAliases) : [],\n // Excluding @fayz-ai/* also hides THEIR bare deps from Vite's initial\n // scan. A dep that first appears behind a React.lazy() is then discovered\n // at click time, and the re-optimize that follows kills the very imports\n // that triggered it — the screen fails with \"Failed to fetch dynamically\n // imported module\" (recharts: every chart at once; @dnd-kit: the forms\n // builder). Naming them keeps the exclude that keeps SDK source hot.\n include: useLocal ? installedDeps(root, LAZY_ONLY_DEPS) : undefined,\n },\n // The preview-container runtime contract: Vite's host-check 403s any\n // non-local Host (browser iframe via Caddy, health probe via\n // host.docker.internal) unless allowedHosts is set. host/cors/headers keep\n // the proxied iframe + cross-origin asset fetches working. Owned here\n // because the app's vite.config has no literal `server: {` for the\n // container's text patchers to anchor on. Caller `server` merges last.\n server: {\n host: true,\n port: opts.port,\n strictPort: opts.strictPort,\n cors: true,\n allowedHosts: true,\n headers: {\n 'Access-Control-Allow-Origin': '*',\n 'Cross-Origin-Resource-Policy': 'cross-origin',\n },\n fs: { allow: [root, fayzSdk] },\n ...(opts.server ?? {}),\n },\n }\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/lib/app-shell-pwa.ts","../src/lib/boot-skeleton.ts","../src/vite.ts"],"names":["identity","lightnessOf","resolve","existsSync","readFileSync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AAA,OAClC;AAAA,MACA,IAAI,EAAE,KAAA,EAAO,CAAC,IAAA,EAAM,OAAO,CAAA,EAAE;AAAA,MAC7B,GAAI,IAAA,CAAK,MAAA,IAAU;AAAC;AACtB,GACF;AACF","file":"vite.js","sourcesContent":["import { createHash } from 'node:crypto'\nimport { existsSync, readFileSync } from 'node:fs'\nimport { resolve } from 'node:path'\nimport type { Plugin } from 'vite'\n\n// ---------------------------------------------------------------------------\n// App shell, cached — the second load, and every load after it.\n//\n// The boot screen fixes the blank page; it does not fix the WAIT. A deployed\n// app still fetches its entry chunk over the network every single time, and on\n// a phone on café wifi that is the whole perceived cost of \"opening the app\".\n// A service worker that precaches the build turns the shell into something the\n// device already has: reload is instant, and a dropped connection still gets\n// the app (its own data is another story — see the fetch rules below).\n//\n// Hand-rolled on purpose. What we need is a precache list, a cache name and\n// three event listeners — about a page of JavaScript, against a build-time\n// dependency the preview container would have to cold-install on every start.\n//\n// Build only. A dev server that installs a service worker serves yesterday's\n// bundle to a developer who just saved a file, and the confusion costs more\n// than the caching saves.\n// ---------------------------------------------------------------------------\n\nexport interface AppShellPwaOptions {\n /** Install name. Default: the app's package.json name, de-scoped and titled. */\n name?: string\n /** Home-screen label, ideally ≤12 chars. Default: derived from `name`. */\n shortName?: string\n /** Browser chrome / icon color. Default: the boot screen's neutral rail. */\n themeColor?: string\n /** Splash background while the app boots. Default: the boot screen's page. */\n backgroundColor?: string\n}\n\n/** The emitted file names, at the bundle root (not under assets/). */\nconst SW_FILE = 'sw.js'\nconst HEADERS_FILE = '_headers'\nconst MANIFEST_FILE = 'manifest.webmanifest'\nconst ICON_FILE = 'icon.svg'\n\n/** Every cache this SW owns is `<prefix><build id>`, so activate can tell its\n * own stale generations apart from caches belonging to anything else. */\nconst CACHE_PREFIX = 'app-shell-'\n\n// The same neutral defaults the boot screen paints with (see boot-skeleton.ts),\n// so the manifest, the theme-color meta and the first paint agree.\nconst DEFAULT_THEME = '#131c26'\nconst DEFAULT_BACKGROUND = '#f1f1f1'\n\ninterface AppIdentity {\n name: string\n shortName: string\n}\n\n/** Perceived lightness of a hex color, 0-100; non-hex is assumed light. */\nfunction lightnessOf(css: string): number {\n const hex = css.trim().replace('#', '')\n const full = hex.length === 3 ? hex.replace(/./g, (c) => c + c) : hex\n if (!/^[0-9a-f]{6}$/i.test(full)) return 100\n const [r, g, b] = [0, 2, 4].map((i) => parseInt(full.slice(i, i + 2), 16) / 255)\n return ((Math.max(r, g, b) + Math.min(r, g, b)) / 2) * 100\n}\n\nfunction readPackageName(root: string): string | undefined {\n const pkgPath = resolve(root, 'package.json')\n if (!existsSync(pkgPath)) return undefined\n try {\n const pkg = JSON.parse(readFileSync(pkgPath, 'utf8')) as { name?: string }\n return pkg.name\n } catch {\n return undefined\n }\n}\n\n/** `@acme/beauty-saas` → `Beauty Saas`. Good enough for a home-screen label,\n * and `name` overrides it whenever the app cares. */\nfunction titleize(pkgName: string): string {\n const bare = pkgName.replace(/^@[^/]+\\//, '')\n return (\n bare\n .split(/[-_.\\s]+/)\n .filter(Boolean)\n .map((word) => word.charAt(0).toUpperCase() + word.slice(1))\n .join(' ') || bare\n )\n}\n\nfunction identity(root: string, opts: AppShellPwaOptions): AppIdentity {\n const pkgName = readPackageName(root)\n const name = opts.name ?? (pkgName ? titleize(pkgName) : 'App')\n const shortName = opts.shortName ?? (name.length <= 12 ? name : name.split(' ')[0].slice(0, 12))\n return { name, shortName }\n}\n\n/** A maskable mark: rounded square in the theme color, app initial on top.\n * The glyph stays well inside the 80% safe zone, so a circular mask on\n * Android does not clip it. PNG sizes are a follow-up. */\nfunction iconSvg(identity: AppIdentity, themeColor: string): string {\n const initial = (identity.name.match(/[a-z0-9]/i)?.[0] ?? 'A').toUpperCase()\n const ink = lightnessOf(themeColor) > 55 ? '#111111' : '#ffffff'\n return `<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 512 512\" width=\"512\" height=\"512\" role=\"img\" aria-label=\"${escapeXml(identity.name)}\">\n<rect width=\"512\" height=\"512\" rx=\"112\" fill=\"${themeColor}\"/>\n<text x=\"256\" y=\"256\" fill=\"${ink}\" font-family=\"system-ui,-apple-system,'Segoe UI',sans-serif\" font-size=\"232\" font-weight=\"600\" text-anchor=\"middle\" dominant-baseline=\"central\">${escapeXml(initial)}</text>\n</svg>\n`\n}\n\nfunction escapeXml(value: string): string {\n return value.replace(/[<>&\"']/g, (c) => `&#${c.charCodeAt(0)};`)\n}\n\nfunction manifestJson(\n identity: AppIdentity,\n base: string,\n themeColor: string,\n backgroundColor: string,\n): string {\n return `${JSON.stringify(\n {\n name: identity.name,\n short_name: identity.shortName,\n start_url: base,\n scope: base,\n display: 'standalone',\n theme_color: themeColor,\n background_color: backgroundColor,\n icons: [\n {\n src: `${base}${ICON_FILE}`,\n sizes: 'any',\n type: 'image/svg+xml',\n purpose: 'any maskable',\n },\n ],\n },\n null,\n 2,\n )}\\n`\n}\n\n/**\n * The worker itself, as plain JS with the build's precache list baked in.\n *\n * Caching rules, in the order the fetch handler applies them:\n * - non-GET, or cross-origin → untouched, the network answers\n * - navigation → network first, cached index.html offline\n * - a precached (hashed) asset → cache first, it can never go stale\n * - anything else same-origin → untouched (API reads/writes land here)\n *\n * The last rule is the important one: Supabase and every other API call goes\n * straight to the network, always. A service worker that answers a data\n * request from cache shows the user a number that is quietly wrong, which is\n * worse than an error.\n *\n * ── a troca de versão ──────────────────────────────────────────────────────\n *\n * There is no UNCONDITIONAL `skipWaiting`, and that part was right: a tab in\n * the middle of a form must never have its code swapped underneath it.\n *\n * What was wrong is what came with it. Without skipWaiting the new worker sits\n * in `waiting` until every tab of the origin is CLOSED — not reloaded, closed.\n * F5 on a controlled page does not replace the worker. So a deploy reached the\n * edge and did not reach the person, and the only gesture they knew that did\n * replace it was \"clear the browser cache\", because that unregisters the\n * worker. We were teaching non-technical users to clear site data on every\n * release.\n *\n * So the worker now skips waiting ON REQUEST — `postMessage('skip-waiting')`\n * — and the page asks first. The decision is the person's, taken in one click,\n * with the form still on screen. It is the Workbox pattern, and it is the only\n * one that keeps both halves: no silent swap, no cache ritual.\n */\nfunction serviceWorkerSource(buildId: string, shell: string, precache: string[]): string {\n return `// Generated by @fayz-ai/sdk at build time. Do not edit.\nconst BUILD_ID = ${JSON.stringify(buildId)};\nconst CACHE = ${JSON.stringify(CACHE_PREFIX)} + BUILD_ID;\nconst SHELL = ${JSON.stringify(shell)};\nconst PRECACHE = ${JSON.stringify(precache, null, 2)};\nconst PRECACHED = new Set(PRECACHE);\n\nself.addEventListener('install', function (event) {\n event.waitUntil(\n caches.open(CACHE).then(function (cache) {\n // One request at a time and forgiving: a single 404 must not void the\n // whole precache the way cache.addAll() would.\n return Promise.all(\n PRECACHE.map(function (url) {\n return cache.add(new Request(url, { cache: 'reload' })).catch(function () {});\n })\n );\n })\n );\n});\n\nself.addEventListener('activate', function (event) {\n event.waitUntil(\n caches\n .keys()\n .then(function (keys) {\n return Promise.all(\n keys\n .filter(function (key) {\n return key.indexOf(${JSON.stringify(CACHE_PREFIX)}) === 0 && key !== CACHE;\n })\n .map(function (key) {\n return caches.delete(key);\n })\n );\n })\n .then(function () {\n return self.clients.claim();\n })\n );\n});\n\n// The ONLY way to take over early, and it comes from outside. The page asks;\n// if the person says yes, it sends this message. Without it the behaviour is\n// what it always was: install quietly, take over when allowed.\nself.addEventListener('message', function (event) {\n if (event.data === 'skip-waiting') self.skipWaiting();\n});\n\nself.addEventListener('fetch', function (event) {\n var request = event.request;\n if (request.method !== 'GET') return;\n var url;\n try {\n url = new URL(request.url);\n } catch (e) {\n return;\n }\n if (url.origin !== self.location.origin) return;\n\n if (request.mode === 'navigate') {\n event.respondWith(\n fetch(request).catch(function () {\n return caches.match(SHELL, { cacheName: CACHE }).then(function (hit) {\n return hit || Response.error();\n });\n })\n );\n return;\n }\n\n // Only the build's own hashed assets, which are immutable by construction.\n // Everything else same-origin (API calls above all) is left to the network.\n if (!PRECACHED.has(url.pathname)) return;\n event.respondWith(\n caches.match(request, { cacheName: CACHE }).then(function (hit) {\n return hit || fetch(request);\n })\n );\n});\n`\n}\n\nconst HEAD_ANCHOR = /<head[^>]*>/i\nconst BODY_END = /<\\/body>/i\n\nfunction insertAfter(html: string, anchor: RegExp, chunk: string): string | null {\n const match = anchor.exec(html)\n if (!match) return null\n const at = match.index + match[0].length\n return `${html.slice(0, at)}\\n${chunk}${html.slice(at)}`\n}\n\n/**\n * Registra o worker E avisa a página quando há versão nova esperando.\n *\n * O aviso é um `CustomEvent` no `window`, não um import: este script é uma\n * tag inline no HTML, roda antes de qualquer bundle, e não pode depender de\n * React nem de nada que o app monte depois. Quem quiser desenhar o convite\n * escuta `fayz:update-ready`; quem não escutar não ganha comportamento\n * nenhum — a versão nova continua entrando na próxima visita, como antes.\n *\n * `window.fayzApplyUpdate()` é a outra metade: manda o worker assumir e\n * recarrega quando ele assumir. Recarregar no `controllerchange` e não no\n * clique é o que garante que a página que volta é a NOVA — recarregar antes\n * pega o worker velho de novo e o convite reaparece, que é a falha que faz o\n * usuário clicar três vezes e desistir.\n *\n * `reloading` existe porque o Chrome dispara `controllerchange` mais de uma\n * vez quando há abas irmãs, e dois `location.reload()` numa mesma navegação\n * deixam a aba piscando.\n */\nfunction registrationScript(swUrl: string): string {\n const source = `\nif ('serviceWorker' in navigator) {\n addEventListener('load', function () {\n navigator.serviceWorker.register('${swUrl}').then(function (reg) {\n var reloading = false;\n navigator.serviceWorker.addEventListener('controllerchange', function () {\n if (reloading) return;\n reloading = true;\n location.reload();\n });\n window.fayzApplyUpdate = function () {\n if (reg.waiting) reg.waiting.postMessage('skip-waiting');\n };\n function announce() {\n // Only when a controller ALREADY exists: without one this is a first\n // visit, the worker is installing for the first time and there is no\n // \"new version\" to offer — announcing here would ask someone to\n // reload a page they just opened.\n if (reg.waiting && navigator.serviceWorker.controller) {\n dispatchEvent(new CustomEvent('fayz:update-ready'));\n }\n }\n announce();\n reg.addEventListener('updatefound', function () {\n var sw = reg.installing;\n if (!sw) return;\n sw.addEventListener('statechange', function () {\n if (sw.state === 'installed') announce();\n });\n });\n // A tab left open all day never re-checks the worker on its own. Hourly\n // is cheap (a conditional GET of a few KB) and it is what gets the\n // invitation to the people who never close the browser.\n setInterval(function () { reg.update().catch(function () {}); }, 3600000);\n }).catch(function () {});\n });\n}`.trim()\n return `<script>${source}</script>`\n}\n\n/** What goes in the precache list: the build's own output, minus the things a\n * cache has no use for (sourcemaps, the worker itself, other HTML). */\nfunction isPrecacheable(fileName: string): boolean {\n if (fileName === SW_FILE || fileName === MANIFEST_FILE) return false\n return !fileName.endsWith('.map') && !fileName.endsWith('.html')\n}\n\n\n/**\n * The HOST's cache rules, which the worker alone cannot reach.\n *\n * Cloudflare (Pages and Workers Static Assets) reads `_headers` from the\n * published directory. Without one the default is `max-age=0,\n * must-revalidate` for EVERYTHING — including `/assets/app-BzniUHZd.js`,\n * whose name carries the hash of its content and therefore can never change\n * content. The result is revalidating several megabytes on every load, for\n * nothing, to confirm what the name already proved.\n *\n * The inverse is what has to stay volatile:\n *\n * index.html is the map to the build's hashes; serving it stale serves\n * the whole stale build, and is the one way a deploy fails to\n * reach someone who has visited before.\n * sw.js is what replaces the worker. Cached, a new version would\n * never be discovered. (Browsers already cap this one at 24h\n * on their own; saying `no-cache` removes the doubt.)\n */\nfunction headersSource(base: string): string {\n return [\n `${base}assets/*`,\n ' Cache-Control: public, max-age=31536000, immutable',\n '',\n `${base}${SW_FILE}`,\n ' Cache-Control: no-cache',\n '',\n `${base}index.html`,\n ' Cache-Control: no-cache',\n '',\n ].join('\\n')\n}\n\nexport function appShellPwa(root: string, opts: AppShellPwaOptions = {}): Plugin {\n const app = identity(root, opts)\n const themeColor = opts.themeColor ?? DEFAULT_THEME\n const backgroundColor = opts.backgroundColor ?? DEFAULT_BACKGROUND\n // Deployments under a subpath exist (preview containers, docs sites); every\n // emitted URL is base-relative so `/` is just the common case.\n let base = '/'\n\n return {\n name: 'fayz:app-shell-pwa',\n apply: 'build',\n\n configResolved(config) {\n base = config.base || '/'\n if (!base.endsWith('/')) base += '/'\n },\n\n generateBundle: {\n order: 'post',\n handler(_options, bundle) {\n const precache = Object.keys(bundle)\n .filter(isPrecacheable)\n .sort()\n .map((fileName) => `${base}${fileName}`)\n const shell = `${base}index.html`\n precache.unshift(shell)\n\n // The index.html source joins the hash: its asset names already change\n // per build, but its INLINE content (boot screen, meta) can change on\n // its own, and a shell served from an old cache would be that content.\n const indexAsset = bundle['index.html']\n const indexSource =\n indexAsset && indexAsset.type === 'asset' ? String(indexAsset.source) : ''\n const buildId = createHash('sha256')\n .update(precache.join('\\n'))\n .update(indexSource)\n .digest('hex')\n .slice(0, 12)\n\n this.emitFile({\n type: 'asset',\n fileName: SW_FILE,\n source: serviceWorkerSource(buildId, shell, precache),\n })\n this.emitFile({\n type: 'asset',\n fileName: HEADERS_FILE,\n source: headersSource(base),\n })\n this.emitFile({\n type: 'asset',\n fileName: MANIFEST_FILE,\n source: manifestJson(app, base, themeColor, backgroundColor),\n })\n this.emitFile({ type: 'asset', fileName: ICON_FILE, source: iconSvg(app, themeColor) })\n },\n },\n\n transformIndexHtml: {\n order: 'post',\n handler(html: string) {\n const manifestHref = `${base}${MANIFEST_FILE}`\n const link = /<link[^>]+rel=[\"']?manifest/i.test(html)\n ? ''\n : `<link rel=\"manifest\" href=\"${manifestHref}\" />`\n const script = html.includes('serviceWorker.register')\n ? ''\n : registrationScript(`${base}${SW_FILE}`)\n if (!link && !script) return html\n\n const withLink = link ? (insertAfter(html, HEAD_ANCHOR, link) ?? `${link}\\n${html}`) : html\n if (!script) return withLink\n return BODY_END.test(withLink)\n ? withLink.replace(BODY_END, `${script}\\n</body>`)\n : `${withLink}\\n${script}`\n },\n },\n }\n}\n","import { existsSync, readFileSync } from 'node:fs'\nimport { resolve } from 'node:path'\nimport type { Plugin } from 'vite'\n\n// ---------------------------------------------------------------------------\n// Boot screen — the first thing painted, from the HTML itself.\n//\n// The React boot screen only exists once React exists, and the wait BEFORE that\n// (fetch the entry chunk, parse it, run it) is the long part of a cold load:\n// the page sat blank for most of the wait. Anything that fills that window has\n// to be in the document the server already sent — markup and CSS the browser\n// can paint on its own, with no module graph behind it.\n//\n// What it paints is the THEME BACKGROUND and a spinner in the middle — light in\n// light mode, dark in dark mode. It used to paint the rail's color edge to\n// edge, but a dark splash in front of a light interface reads as a flash, not\n// a hand-off; the surface the app is about to paint is the only color that\n// disappears into it. It is deliberately the SAME image as AppShellSkeleton in\n// @fayz-ai/ui, so the handoff HTML → React → app never swaps anything the eye\n// can catch.\n//\n// The same inline script also resolves the theme mode before first paint, so a\n// dark-mode reload never flashes a light frame while React boots.\n//\n// It dismisses itself the moment React puts anything in #root.\n// ---------------------------------------------------------------------------\n\nexport interface BootSkeletonOptions {\n /**\n * 'admin' additionally seeds the app's stored palette tokens (sidebar) into\n * the document before React paints, so the console's rail mounts in its own\n * color; 'page' skips that; 'none' injects nothing. Both visible surfaces\n * paint the same background-colored screen. Default: 'admin' when the app\n * depends on @fayz-ai/admin or @fayz-ai/saas and not on @fayz-ai/storefront,\n * 'page' otherwise.\n */\n surface?: 'admin' | 'page' | 'none'\n /** @deprecated The boot screen paints the theme background, not the rail.\n * Accepted and ignored. */\n sidebar?: string\n /** Boot background, light mode. */\n background?: string\n /** Boot background, dark mode. */\n backgroundDark?: string\n}\n\n/** localStorage key the admin writes its resolved palette to, so the NEXT boot\n * paints in the app's own colors instead of the neutral default. */\nexport const BOOT_THEME_STORAGE_KEY = 'fayz:boot-theme'\n\n/** localStorage key the admin theme store writes the chosen mode to\n * ('light' | 'dark' | 'system', default 'light'). Duplicated as a literal on\n * both sides — see persistBootPalette in packages/admin/src/theme/utils.ts:\n * the app runtime must not depend on the build-tool package, and this file\n * must not depend on the admin package. */\nexport const THEME_MODE_STORAGE_KEY = 'saas-core:theme-mode'\n\n/** The same thing under @fayz-ai/ui's own theme store, which is what a\n * storefront or member app runs (packages/ui/src/stores/theme.store.ts). */\nexport const UI_THEME_MODE_STORAGE_KEY = 'fayz-ui:theme-mode'\n\n// The light/dark values of `--background` in @fayz-ai/ui — so React's first\n// real paint changes nothing.\nconst DEFAULT_PAGE = '#f1f1f1'\nconst DEFAULT_PAGE_DARK = '#1a1a1a'\n\nconst RING_ON_DARK = ['rgba(255,255,255,.18)', 'rgba(255,255,255,.7)'] as const\nconst RING_ON_LIGHT = ['rgba(0,0,0,.15)', 'rgba(0,0,0,.55)'] as const\n\n/** Perceived lightness of a hex color, 0-100. Non-hex CSS is assumed light —\n * a dark ring on an unknown surface is the safer miss on a white default. */\nfunction lightnessOf(css: string): number {\n const hex = css.trim().replace('#', '')\n const full = hex.length === 3 ? hex.replace(/./g, (c) => c + c) : hex\n if (!/^[0-9a-f]{6}$/i.test(full)) return 100\n const [r, g, b] = [0, 2, 4].map((i) => parseInt(full.slice(i, i + 2), 16) / 255)\n return ((Math.max(r, g, b) + Math.min(r, g, b)) / 2) * 100\n}\n\nfunction ringTones(background: string): readonly [string, string] {\n return lightnessOf(background) > 55 ? RING_ON_LIGHT : RING_ON_DARK\n}\n\nfunction markup(): string {\n return `<div id=\"fayz-boot\" role=\"status\" aria-live=\"polite\" aria-label=\"Carregando\"><span class=\"fb-spin\"></span></div>`\n}\n\n/** The overlay's own CSS. The `.dark` rule makes the screen correct at the\n * very first paint: the inline script sets the class synchronously before\n * the browser draws. The ring is drawn in rgba rather than a theme token,\n * which could land invisible. */\nfunction style(colors: { light: string; dark: string }): string {\n const [ring, ringLit] = ringTones(colors.light)\n const [darkRing, darkRingLit] = ringTones(colors.dark)\n return `<style id=\"fayz-boot-style\">\n#fayz-boot{--fb-bg:${colors.light};--fb-ring:${ring};--fb-ring-lit:${ringLit};position:fixed;inset:0;z-index:2147483000;display:flex;align-items:center;justify-content:center;background:var(--fb-bg);opacity:1;transition:opacity .2s ease}\n.dark #fayz-boot{--fb-bg:${colors.dark};--fb-ring:${darkRing};--fb-ring-lit:${darkRingLit}}\n#fayz-boot[data-leaving]{opacity:0;pointer-events:none}\n#fayz-boot .fb-spin{display:block;width:1.75rem;height:1.75rem;border-radius:9999px;border:2px solid var(--fb-ring);border-top-color:var(--fb-ring-lit);animation:fb-spin .7s linear infinite}\n@keyframes fb-spin{to{transform:rotate(360deg)}}\n@media (prefers-reduced-motion:reduce){#fayz-boot .fb-spin{animation:none;border-top-color:var(--fb-ring)}}\n</style>`\n}\n\n/**\n * Resolves the theme mode, seeds the app's stored palette tokens, then removes\n * the whole thing as soon as React fills #root.\n *\n * The mode has to be resolved HERE and not in React: the class that makes the\n * page dark only exists once the theme store runs, which is a whole module\n * graph too late — the browser has already painted a light frame by then.\n *\n * The MutationObserver is the handoff: no import, no callback the app has to\n * remember to call, and it works for any scaffold. The timeout is the safety\n * net — a boot that never mounts must not leave a fixed overlay on top of\n * whatever error the page is trying to show.\n */\nfunction dismissScript(surface: 'admin' | 'page', colors: { light: string; dark: string }): string {\n // Seed the app's own sidebar tokens before the bundle paints: the console's\n // rail (and the React skeleton's spinner) mount BEFORE the theme effect\n // applies the palette, and the default tokens would flash the wrong colors\n // for one theme-effect's worth of frames. applyTheme overwrites these same\n // inline properties on every boot.\n const paletteSeed =\n surface === 'admin'\n ? `\n try{\n var t=JSON.parse(localStorage.getItem('${BOOT_THEME_STORAGE_KEY}')||'null');\n if(t&&t.sidebar){\n de.style.setProperty('--sidebar',t.sidebar);\n if(t.sidebarForeground)de.style.setProperty('--sidebar-foreground',t.sidebarForeground);\n }\n }catch(e){}`\n : ''\n return `<script>(function(){\n var de=document.documentElement,dark=false;\n try{\n var m=localStorage.getItem('${THEME_MODE_STORAGE_KEY}')||localStorage.getItem('${UI_THEME_MODE_STORAGE_KEY}');\n dark=m==='dark'||(m==='system'&&!!window.matchMedia&&window.matchMedia('(prefers-color-scheme: dark)').matches);\n }catch(e){}\n de.classList.toggle('dark',dark);\n de.style.colorScheme=dark?'dark':'light';${paletteSeed}\n var boot=document.getElementById('fayz-boot'),root=document.getElementById('root');\n if(!boot)return;\n var meta=document.querySelector('meta[name=\"theme-color\"]');\n if(meta)meta.setAttribute('content',dark?'${colors.dark}':'${colors.light}');\n var gone=false,drop=function(){\n if(gone)return;gone=true;boot.setAttribute('data-leaving','');\n setTimeout(function(){boot.parentNode&&boot.parentNode.removeChild(boot)},250);\n };\n if(!root){drop();return}\n if(root.childNodes.length){drop();return}\n var mo=new MutationObserver(function(){\n if(!root.childNodes.length)return;\n mo.disconnect();\n (window.requestAnimationFrame||setTimeout)(drop);\n });\n mo.observe(root,{childList:true});\n setTimeout(function(){mo.disconnect();drop()},15000);\n})();</script>`\n}\n\n/** True when the app on disk renders an admin console. */\nfunction looksLikeAdminApp(root: string): boolean {\n const pkgPath = resolve(root, 'package.json')\n if (!existsSync(pkgPath)) return false\n try {\n const pkg = JSON.parse(readFileSync(pkgPath, 'utf8')) as {\n dependencies?: Record<string, string>\n devDependencies?: Record<string, string>\n }\n const deps = { ...pkg.dependencies, ...pkg.devDependencies }\n if (deps['@fayz-ai/storefront']) return false\n return Boolean(deps['@fayz-ai/admin'] || deps['@fayz-ai/saas'])\n } catch {\n return false\n }\n}\n\n// The head anchor swallows a leading charset meta if there is one: that\n// declaration has to stay inside the document's first 1024 bytes, and the boot\n// style is most of a kilobyte on its own.\nconst HEAD_ANCHOR = /<head[^>]*>(\\s*<meta[^>]+charset[^>]*>)?/i\nconst BODY_ANCHOR = /<body[^>]*>/i\n\n/** Inserts right after the opening tag, so the overlay paints before whatever\n * the template already had in there. */\nfunction insertAfter(html: string, anchor: RegExp, chunk: string): string | null {\n const match = anchor.exec(html)\n if (!match) return null\n const at = match.index + match[0].length\n return `${html.slice(0, at)}\\n${chunk}${html.slice(at)}`\n}\n\nexport function fayzBootSkeleton(root: string, opts: BootSkeletonOptions = {}): Plugin {\n const surface = opts.surface ?? (looksLikeAdminApp(root) ? 'admin' : 'page')\n // Neutral, not a guess at the brand: @fayz-ai/ui's own background values,\n // which is exactly what the app paints next.\n const colors = {\n light: opts.background ?? DEFAULT_PAGE,\n dark: opts.backgroundDark ?? DEFAULT_PAGE_DARK,\n }\n\n return {\n name: 'fayz:boot-skeleton',\n transformIndexHtml: {\n order: 'post',\n handler(html: string) {\n if (surface === 'none') return html\n if (!html.includes('id=\"root\"')) return html\n\n const hasThemeColor = /<meta[^>]+name=[\"']?theme-color/i.test(html)\n const headChunk = hasThemeColor\n ? style(colors)\n : `<meta name=\"theme-color\" content=\"${colors.light}\" />\\n${style(colors)}`\n const bodyChunk = `${markup()}\\n${dismissScript(surface, colors)}`\n\n const withHead = insertAfter(html, HEAD_ANCHOR, headChunk)\n // No <head> in the template: the style rides along at the top of the\n // body, still ahead of the markup it paints.\n const base = withHead ?? html\n const pending = withHead ? bodyChunk : `${headChunk}\\n${bodyChunk}`\n return insertAfter(base, BODY_ANCHOR, pending) ?? `${base}\\n${pending}`\n },\n },\n }\n}\n","import { existsSync, readdirSync } from 'node:fs'\nimport { resolve } from 'node:path'\nimport type { UserConfig, PluginOption, AliasOptions } from 'vite'\nimport { appShellPwa, type AppShellPwaOptions } from './lib/app-shell-pwa'\nimport { fayzBootSkeleton, type BootSkeletonOptions } from './lib/boot-skeleton'\n\nexport { BOOT_THEME_STORAGE_KEY, type BootSkeletonOptions } from './lib/boot-skeleton'\nexport { appShellPwa, type AppShellPwaOptions } from './lib/app-shell-pwa'\n\n/**\n * Every `@fayz-ai/*` package in the checkout, as a Vite alias map (root src).\n * Subpaths (e.g. `@fayz-ai/admin/ui`, `@fayz-ai/storefront/catalog`) resolve\n * automatically via Vite's prefix alias matching — the shim files mirror the\n * subpath under `src/`.\n *\n * Read from disk rather than listed, because a hardcoded list is only correct\n * for the version it shipped in and apps run the INSTALLED `fayzVite`, not this\n * one. That is how the `saas` → `admin` rename half-broke the fleet: `admin`\n * was not in 0.9.0's list, so every app resolved it through the workspace to\n * `packages/admin/dist` — a stale build in the middle of an otherwise\n * source-resolved app, which reads as a bug in the code rather than in the\n * setup. A directory listing cannot go stale.\n */\nfunction sdkAliases(sdkDir: string): Record<string, string> {\n const out: Record<string, string> = {}\n for (const group of ['packages', 'plugins']) {\n const dir = resolve(sdkDir, group)\n if (!existsSync(dir)) continue\n for (const name of readdirSync(dir)) {\n const src = resolve(dir, name, 'src')\n // The directory name is the package name minus the scope, for both groups\n // (packages/admin → @fayz-ai/admin, plugins/plugin-crm → …/plugin-crm).\n if (existsSync(resolve(src, 'index.ts'))) out[`@fayz-ai/${name}`] = src\n }\n }\n return out\n}\n\nexport interface FayzViteOptions {\n /** Dev server port. */\n port?: number\n /** Fail instead of incrementing if the port is taken. */\n strictPort?: boolean\n /** Extra app-specific aliases, merged after the SDK aliases. */\n aliases?: Record<string, string>\n /** Extra Vite plugins, appended after @vitejs/plugin-react. */\n plugins?: PluginOption[]\n /**\n * SDK source location, absolute or relative to the app root\n * (default `../../fayz-sdk`).\n *\n * The `FAYZ_SDK_DIR` environment variable OVERRIDES this — see\n * {@link resolveSdkDir}.\n */\n sdkDir?: string\n /** App root directory (default process.cwd()). */\n root?: string\n /**\n * Extra Vite `server` config, merged over the SDK server defaults. The\n * preview-container contract (host/cors/allowedHosts/headers) is applied\n * first, so an override can add e.g. `proxy` without dropping it.\n */\n server?: UserConfig['server']\n /**\n * Extra Vite `resolve` config, merged over the SDK resolve defaults. The SDK\n * alias map / dedupe / conditions win for `@fayz-ai/*` local-source\n * resolution; any other resolve keys (and extra aliases) are merged in.\n */\n resolve?: UserConfig['resolve']\n /**\n * The shell outline painted into index.html, so the wait for the entry chunk\n * is not a blank page. Auto-detected from the app's dependencies; pass\n * `{ surface: 'none' }` to opt out, or colors to match the app's palette on a\n * first-ever visit (later visits reuse the palette the app itself stored).\n */\n bootSkeleton?: BootSkeletonOptions\n /**\n * The built app precaches itself: a service worker + webmanifest emitted at\n * build time, so a deployed app reloads instantly and still opens with no\n * network. On by default, and build-only by construction — the dev server\n * never registers a worker. Pass `false` to opt out, or an object to name\n * the install / set its colors.\n */\n pwa?: boolean | AppShellPwaOptions\n}\n\n/**\n * Shared Vite config for Fayz dogfood apps. Resolves `@fayz-ai/*` from the local\n * SDK source when it is checked out next to the app AND `FAYZ_SDK_SOURCE` is not\n * `published`; otherwise from node_modules (the Fayz editor sandbox / published\n * npm). Apps no longer hand-maintain alias maps or the local-vs-npm guard.\n *\n * import { defineConfig } from 'vite'\n * import react from '@vitejs/plugin-react'\n * import { fayzVite } from '@fayz-ai/sdk/vite'\n * export default defineConfig(fayzVite({ port: 5185, plugins: [react()] }))\n *\n * Where that local source is read from is {@link resolveSdkDir}: `FAYZ_SDK_DIR`\n * beats the `sdkDir` option beats `../../fayz-sdk`.\n *\n * The app passes its own `@vitejs/plugin-react` so `@fayz-ai/sdk` carries no\n * build-tool peer deps (which otherwise choke npm's peer resolution, since sdk\n * sits in every dependency path).\n */\n/** Env var that redirects local-source resolution to another SDK checkout. */\nexport const FAYZ_SDK_DIR_ENV = 'FAYZ_SDK_DIR'\n\n/**\n * Where the local SDK source is, as an absolute path. Resolution order:\n *\n * 1. `FAYZ_SDK_DIR` (env) — wins, absolute or root-relative\n * 2. `sdkDir` (option) — what the app's vite config declares\n * 3. `../../fayz-sdk` — the sibling-checkout convention\n *\n * Env wins deliberately. `sdkDir` lives in the app's COMMITTED vite config, so\n * without an override there was no way to build, dev or `fayz validate` a\n * store against a different SDK tree (a worktree, a release branch) short of\n * editing that committed file or dropping an untracked config shim next to it\n * — which is exactly what the fleet ended up doing. An env var is the one\n * knob a CLI flag and a container can both set without touching the repo.\n *\n * Exported so the CLI and the tests agree on the precedence by construction\n * rather than by comment.\n */\nexport function resolveSdkDir(\n root: string,\n sdkDir?: string,\n env: Record<string, string | undefined> = process.env,\n): string {\n const fromEnv = env[FAYZ_SDK_DIR_ENV]?.trim()\n return resolve(root, fromEnv || sdkDir || '../../fayz-sdk')\n}\n\n/**\n * Bare deps that only ever appear behind a `React.lazy()` inside an @fayz-ai\n * package. See the `optimizeDeps.include` comment below for why they have to be\n * named. Filtered by what is actually installed, because a plugin the app does\n * not carry leaves its deps uninstalled and `include` hard-fails on those.\n */\nconst LAZY_ONLY_DEPS = ['recharts', '@dnd-kit/core', '@dnd-kit/sortable', '@dnd-kit/modifiers', '@dnd-kit/utilities']\n\nfunction installedDeps(root: string, names: string[]): string[] {\n const roots: string[] = []\n for (let dir = root, prev = ''; dir !== prev; prev = dir, dir = resolve(dir, '..')) {\n roots.push(resolve(dir, 'node_modules'))\n }\n return names.filter((name) => roots.some((nm) => existsSync(resolve(nm, name, 'package.json'))))\n}\n\nexport function fayzVite(opts: FayzViteOptions = {}): UserConfig {\n const root = opts.root ?? process.cwd()\n const fayzSdk = resolveSdkDir(root, opts.sdkDir)\n const wantLocal = process.env.FAYZ_SDK_SOURCE !== 'published'\n const localPresent = existsSync(resolve(fayzSdk, 'packages/core/src/index.ts'))\n const useLocal = wantLocal && localPresent\n\n const localAliases = useLocal ? sdkAliases(fayzSdk) : {}\n\n // Pull SDK-owned resolve keys out of any caller override so they can't clobber\n // local-source @fayz-ai/* resolution; the rest of `resolve` is merged in.\n const { alias: userAlias, dedupe: userDedupe, conditions: _ignore, ...restResolve } =\n (opts.resolve ?? {}) as Exclude<UserConfig['resolve'], undefined>\n\n const pwa = opts.pwa ?? true\n // The install colors follow the boot screen's, so the splash, the browser\n // chrome and the first paint are one surface rather than three guesses.\n const pwaPlugins =\n pwa === false\n ? []\n : [\n appShellPwa(root, {\n themeColor: opts.bootSkeleton?.sidebar ?? opts.bootSkeleton?.background,\n backgroundColor: opts.bootSkeleton?.background ?? opts.bootSkeleton?.sidebar,\n ...(pwa === true ? {} : pwa),\n }),\n ]\n\n return {\n plugins: [...(opts.plugins ?? []), fayzBootSkeleton(root, opts.bootSkeleton), ...pwaPlugins],\n envPrefix: ['VITE_', 'PUBLIC_'],\n resolve: {\n ...restResolve,\n alias: {\n '@': resolve(root, 'src'),\n ...localAliases,\n ...(opts.aliases ?? {}),\n ...((userAlias as Record<string, string> | undefined) ?? {}),\n } as AliasOptions,\n // lucide-react is a direct dep of both the app and every @fayz-ai/*\n // package; without dedupe a version skew installs two copies and esbuild\n // pre-bundles each barrel separately (~1,500 icon modules each).\n // Collapsing to one copy is the single biggest cut to the editor-container\n // optimize RAM/CPU spike. Only dedupe deps the *app* directly depends on\n // (so they're hoisted to its root node_modules) — deduping a transitive\n // like @tanstack/react-table makes Vite resolve it from the app root,\n // which fails in local-source mode and 500s the aliased UI source.\n //\n // @fullcalendar/* is here for a different reason: plugin-agenda and the\n // app each carry a copy, and only the app's has `premium-common`. Split\n // across two copies, the resource views register their ScrollGrid into a\n // `core` the calendar is not the instance of, and the week grid dies with\n // \"No ScrollGrid implementation\" — a failure that only surfaces after the\n // dep cache is cleared, so it reads as random.\n dedupe: userDedupe ?? [\n 'react', 'react-dom', 'zustand', 'lucide-react', 'react-router-dom',\n '@supabase/supabase-js', 'sonner',\n '@fullcalendar/core', '@fullcalendar/react', '@fullcalendar/daygrid',\n '@fullcalendar/timegrid', '@fullcalendar/list', '@fullcalendar/interaction',\n '@fullcalendar/premium-common', '@fullcalendar/resource',\n '@fullcalendar/resource-daygrid', '@fullcalendar/resource-timegrid',\n ],\n conditions: useLocal ? ['source', 'browser', 'module', 'jsnext:main', 'jsnext'] : undefined,\n },\n optimizeDeps: {\n exclude: useLocal ? Object.keys(localAliases) : [],\n // Excluding @fayz-ai/* also hides THEIR bare deps from Vite's initial\n // scan. A dep that first appears behind a React.lazy() is then discovered\n // at click time, and the re-optimize that follows kills the very imports\n // that triggered it — the screen fails with \"Failed to fetch dynamically\n // imported module\" (recharts: every chart at once; @dnd-kit: the forms\n // builder). Naming them keeps the exclude that keeps SDK source hot.\n include: useLocal ? installedDeps(root, LAZY_ONLY_DEPS) : undefined,\n },\n // The preview-container runtime contract: Vite's host-check 403s any\n // non-local Host (browser iframe via Caddy, health probe via\n // host.docker.internal) unless allowedHosts is set. host/cors/headers keep\n // the proxied iframe + cross-origin asset fetches working. Owned here\n // because the app's vite.config has no literal `server: {` for the\n // container's text patchers to anchor on. Caller `server` merges last.\n server: {\n host: true,\n port: opts.port,\n strictPort: opts.strictPort,\n cors: true,\n allowedHosts: true,\n headers: {\n 'Access-Control-Allow-Origin': '*',\n 'Cross-Origin-Resource-Policy': 'cross-origin',\n },\n fs: { allow: [root, fayzSdk] },\n ...(opts.server ?? {}),\n },\n }\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/agent.ts"],"names":["eventName"],"mappings":";AA6JO,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,OAAA,IAAW,UAAA,CAAW,KAAA;AAC9C,EAAA,MAAM,IAAA,GAAO,CAAA,EAAG,OAAA,CAAQ,OAAA,CAAQ,OAAA,CAAQ,QAAQ,EAAE,CAAC,CAAA,iBAAA,EAAoB,OAAA,CAAQ,SAAS,CAAA,OAAA,CAAA;AACxF,EAAA,MAAM,OAAA,GAAU;AAAA,IACd,cAAA,EAAgB,kBAAA;AAAA,IAChB,oBAAoB,OAAA,CAAQ;AAAA,GAC9B;AAEA,EAAA,eAAe,OAAA,CAAW,MAAc,IAAA,EAA+B;AACrE,IAAA,MAAM,QAAA,GAAW,MAAM,OAAA,CAAQ,CAAA,EAAG,IAAI,CAAA,EAAG,IAAI,CAAA,CAAA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A,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-KTRZI44K.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\n/**\n * A file the user handed over TO BE READ — bytes, not a shape.\n *\n * The rule above holds and this is its one exception, drawn narrowly. A\n * spreadsheet of patients gets DIGESTED because nobody asked for it to be read;\n * it was attached so the agent could plan an import, and shipping it to a model\n * provider would be a disclosure nobody consented to.\n *\n * A photographed receipt is the opposite case in every respect: one document,\n * handed over on purpose, by a person whose whole request is \"read this\". The\n * gesture IS the consent, so bytes travel — and ONLY for a file that arrived\n * through an explicit request to read it. Never because an attachment happened\n * to be an image.\n */\nexport interface AgentInlineFile {\n name: string\n /** `image/jpeg`, `image/png`, `application/pdf`. */\n mime: string\n /** Base64 of the file, without the `data:` prefix. */\n data: 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 /**\n * Files the user handed over to be READ this turn — see AgentInlineFile.\n *\n * Separate from `attachments` on purpose: two fields means the boundary is\n * visible at every call site and in every request log, instead of being a\n * flag someone can flip by accident on a digest.\n */\n inlineFiles?: AgentInlineFile[]\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"]}
|
package/dist/chunk-L2FWBQU6.js
DELETED
|
@@ -1,135 +0,0 @@
|
|
|
1
|
-
// src/release-channels.json
|
|
2
|
-
var release_channels_default = {
|
|
3
|
-
channels: {
|
|
4
|
-
stable: {
|
|
5
|
-
"@fayz-ai/sdk": "^0.19.1",
|
|
6
|
-
"@fayz-ai/admin": "^0.19.1",
|
|
7
|
-
"@fayz-ai/core": "^0.19.1",
|
|
8
|
-
"@fayz-ai/auth": "^0.19.0",
|
|
9
|
-
"@fayz-ai/ui": "^0.19.0",
|
|
10
|
-
"@fayz-ai/shop": "^0.19.0",
|
|
11
|
-
"@fayz-ai/storefront": "^0.19.1",
|
|
12
|
-
"@fayz-ai/portal": "^0.19.0",
|
|
13
|
-
"@fayz-ai/courses": "^0.19.0",
|
|
14
|
-
"@fayz-ai/db": "^0.14.0",
|
|
15
|
-
"@fayz-ai/plugin-agenda": "^0.13.0",
|
|
16
|
-
"@fayz-ai/plugin-auth": "^0.12.2",
|
|
17
|
-
"@fayz-ai/plugin-automations": "^0.12.4",
|
|
18
|
-
"@fayz-ai/plugin-blog": "^0.12.7",
|
|
19
|
-
"@fayz-ai/plugin-conversations": "^0.11.3",
|
|
20
|
-
"@fayz-ai/plugin-courses": "^0.10.7",
|
|
21
|
-
"@fayz-ai/plugin-crm": "^0.11.0",
|
|
22
|
-
"@fayz-ai/plugin-dashboard": "^0.9.9",
|
|
23
|
-
"@fayz-ai/plugin-financial": "^0.13.0",
|
|
24
|
-
"@fayz-ai/plugin-forms": "^0.10.4",
|
|
25
|
-
"@fayz-ai/plugin-inventory": "^0.12.0",
|
|
26
|
-
"@fayz-ai/plugin-marketing": "^0.12.0",
|
|
27
|
-
"@fayz-ai/plugin-menu": "^0.10.5",
|
|
28
|
-
"@fayz-ai/plugin-orders": "^0.12.1",
|
|
29
|
-
"@fayz-ai/plugin-payments": "^0.9.9",
|
|
30
|
-
"@fayz-ai/plugin-reports": "^0.13.0",
|
|
31
|
-
"@fayz-ai/plugin-reputation": "^0.10.4",
|
|
32
|
-
"@fayz-ai/plugin-shop": "^0.15.0",
|
|
33
|
-
"@fayz-ai/plugin-sites": "^0.9.7",
|
|
34
|
-
"@fayz-ai/plugin-tables": "^0.10.5",
|
|
35
|
-
"@fayz-ai/plugin-tasks": "^0.10.4"
|
|
36
|
-
},
|
|
37
|
-
latest: {
|
|
38
|
-
"@fayz-ai/sdk": "^0.19.1",
|
|
39
|
-
"@fayz-ai/admin": "^0.19.1",
|
|
40
|
-
"@fayz-ai/core": "^0.19.1",
|
|
41
|
-
"@fayz-ai/auth": "^0.19.0",
|
|
42
|
-
"@fayz-ai/ui": "^0.19.0",
|
|
43
|
-
"@fayz-ai/shop": "^0.19.0",
|
|
44
|
-
"@fayz-ai/storefront": "^0.19.1",
|
|
45
|
-
"@fayz-ai/portal": "^0.19.0",
|
|
46
|
-
"@fayz-ai/courses": "^0.19.0",
|
|
47
|
-
"@fayz-ai/db": "^0.14.0",
|
|
48
|
-
"@fayz-ai/plugin-agenda": "^0.13.0",
|
|
49
|
-
"@fayz-ai/plugin-auth": "^0.12.2",
|
|
50
|
-
"@fayz-ai/plugin-automations": "^0.12.4",
|
|
51
|
-
"@fayz-ai/plugin-blog": "^0.12.7",
|
|
52
|
-
"@fayz-ai/plugin-conversations": "^0.11.3",
|
|
53
|
-
"@fayz-ai/plugin-courses": "^0.10.7",
|
|
54
|
-
"@fayz-ai/plugin-crm": "^0.11.0",
|
|
55
|
-
"@fayz-ai/plugin-dashboard": "^0.9.9",
|
|
56
|
-
"@fayz-ai/plugin-financial": "^0.13.0",
|
|
57
|
-
"@fayz-ai/plugin-forms": "^0.10.4",
|
|
58
|
-
"@fayz-ai/plugin-inventory": "^0.12.0",
|
|
59
|
-
"@fayz-ai/plugin-marketing": "^0.12.0",
|
|
60
|
-
"@fayz-ai/plugin-menu": "^0.10.5",
|
|
61
|
-
"@fayz-ai/plugin-orders": "^0.12.1",
|
|
62
|
-
"@fayz-ai/plugin-payments": "^0.9.9",
|
|
63
|
-
"@fayz-ai/plugin-reports": "^0.13.0",
|
|
64
|
-
"@fayz-ai/plugin-reputation": "^0.10.4",
|
|
65
|
-
"@fayz-ai/plugin-shop": "^0.15.0",
|
|
66
|
-
"@fayz-ai/plugin-sites": "^0.9.7",
|
|
67
|
-
"@fayz-ai/plugin-tables": "^0.10.5",
|
|
68
|
-
"@fayz-ai/plugin-tasks": "^0.10.4"
|
|
69
|
-
},
|
|
70
|
-
preview: {
|
|
71
|
-
"@fayz-ai/sdk": "^0.19.1",
|
|
72
|
-
"@fayz-ai/admin": "^0.19.1",
|
|
73
|
-
"@fayz-ai/core": "^0.19.1",
|
|
74
|
-
"@fayz-ai/auth": "^0.19.0",
|
|
75
|
-
"@fayz-ai/ui": "^0.19.0",
|
|
76
|
-
"@fayz-ai/shop": "^0.19.0",
|
|
77
|
-
"@fayz-ai/storefront": "^0.19.1",
|
|
78
|
-
"@fayz-ai/portal": "^0.19.0",
|
|
79
|
-
"@fayz-ai/courses": "^0.19.0",
|
|
80
|
-
"@fayz-ai/db": "^0.14.0",
|
|
81
|
-
"@fayz-ai/plugin-agenda": "^0.13.0",
|
|
82
|
-
"@fayz-ai/plugin-auth": "^0.12.2",
|
|
83
|
-
"@fayz-ai/plugin-automations": "^0.12.4",
|
|
84
|
-
"@fayz-ai/plugin-blog": "^0.12.7",
|
|
85
|
-
"@fayz-ai/plugin-conversations": "^0.11.3",
|
|
86
|
-
"@fayz-ai/plugin-courses": "^0.10.7",
|
|
87
|
-
"@fayz-ai/plugin-crm": "^0.11.0",
|
|
88
|
-
"@fayz-ai/plugin-dashboard": "^0.9.9",
|
|
89
|
-
"@fayz-ai/plugin-financial": "^0.13.0",
|
|
90
|
-
"@fayz-ai/plugin-forms": "^0.10.4",
|
|
91
|
-
"@fayz-ai/plugin-inventory": "^0.12.0",
|
|
92
|
-
"@fayz-ai/plugin-marketing": "^0.12.0",
|
|
93
|
-
"@fayz-ai/plugin-menu": "^0.10.5",
|
|
94
|
-
"@fayz-ai/plugin-orders": "^0.12.1",
|
|
95
|
-
"@fayz-ai/plugin-payments": "^0.9.9",
|
|
96
|
-
"@fayz-ai/plugin-reports": "^0.13.0",
|
|
97
|
-
"@fayz-ai/plugin-reputation": "^0.10.4",
|
|
98
|
-
"@fayz-ai/plugin-shop": "^0.15.0",
|
|
99
|
-
"@fayz-ai/plugin-sites": "^0.9.7",
|
|
100
|
-
"@fayz-ai/plugin-tables": "^0.10.5",
|
|
101
|
-
"@fayz-ai/plugin-tasks": "^0.10.4"
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
};
|
|
105
|
-
|
|
106
|
-
// src/release-channels.ts
|
|
107
|
-
var releaseChannelPackages = release_channels_default.channels;
|
|
108
|
-
function buildVersionSet(channel) {
|
|
109
|
-
return {
|
|
110
|
-
channel,
|
|
111
|
-
packages: { ...releaseChannelPackages[channel] }
|
|
112
|
-
};
|
|
113
|
-
}
|
|
114
|
-
var fayzPackageVersionSets = {
|
|
115
|
-
stable: buildVersionSet("stable"),
|
|
116
|
-
latest: buildVersionSet("latest"),
|
|
117
|
-
preview: buildVersionSet("preview")
|
|
118
|
-
};
|
|
119
|
-
function resolveFayzPackageVersions(channel = "stable") {
|
|
120
|
-
return fayzPackageVersionSets[channel];
|
|
121
|
-
}
|
|
122
|
-
function resolveFayzPackageDependencies(channel = "stable") {
|
|
123
|
-
return { ...resolveFayzPackageVersions(channel).packages };
|
|
124
|
-
}
|
|
125
|
-
function resolveFayzPackageVersion(packageName, channel = "stable") {
|
|
126
|
-
const version = resolveFayzPackageVersions(channel).packages[packageName];
|
|
127
|
-
if (!version) {
|
|
128
|
-
throw new Error(`No Fayz package version configured for ${packageName} in ${channel} channel`);
|
|
129
|
-
}
|
|
130
|
-
return version;
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
export { fayzPackageVersionSets, resolveFayzPackageDependencies, resolveFayzPackageVersion, resolveFayzPackageVersions };
|
|
134
|
-
//# sourceMappingURL=chunk-L2FWBQU6.js.map
|
|
135
|
-
//# sourceMappingURL=chunk-L2FWBQU6.js.map
|
|
@@ -1 +0,0 @@
|
|
|
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,SAAA;AAAA,MAChB,gBAAA,EAAkB,SAAA;AAAA,MAClB,eAAA,EAAiB,SAAA;AAAA,MACjB,eAAA,EAAiB,SAAA;AAAA,MACjB,aAAA,EAAe,SAAA;AAAA,MACf,eAAA,EAAiB,SAAA;AAAA,MACjB,qBAAA,EAAuB,SAAA;AAAA,MACvB,iBAAA,EAAmB,SAAA;AAAA,MACnB,kBAAA,EAAoB,SAAA;AAAA,MACpB,aAAA,EAAe,SAAA;AAAA,MACf,wBAAA,EAA0B,SAAA;AAAA,MAC1B,sBAAA,EAAwB,SAAA;AAAA,MACxB,6BAAA,EAA+B,SAAA;AAAA,MAC/B,sBAAA,EAAwB,SAAA;AAAA,MACxB,+BAAA,EAAiC,SAAA;AAAA,MACjC,yBAAA,EAA2B,SAAA;AAAA,MAC3B,qBAAA,EAAuB,SAAA;AAAA,MACvB,2BAAA,EAA6B,QAAA;AAAA,MAC7B,2BAAA,EAA6B,SAAA;AAAA,MAC7B,uBAAA,EAAyB,SAAA;AAAA,MACzB,2BAAA,EAA6B,SAAA;AAAA,MAC7B,2BAAA,EAA6B,SAAA;AAAA,MAC7B,sBAAA,EAAwB,SAAA;AAAA,MACxB,wBAAA,EAA0B,SAAA;AAAA,MAC1B,0BAAA,EAA4B,QAAA;AAAA,MAC5B,y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,GACjD;AACF;AAEO,IAAM,sBAAA,GAA4E;AAAA,EACvF,MAAA,EAAQ,gBAAgB,QAAQ,CAAA;AAAA,EAChC,MAAA,EAAQ,gBAAgB,QAAQ,CAAA;AAAA,EAChC,OAAA,EAAS,gBAAgB,SAAS;AACpC;AAEO,SAAS,0BAAA,CAA2B,UAA8B,QAAA,EAAiC;AACxG,EAAA,OAAO,uBAAuB,OAAO,CAAA;AACvC;AAEO,SAAS,8BAAA,CAA+B,UAA8B,QAAA,EAAkC;AAC7G,EAAA,OAAO,EAAE,GAAG,0BAAA,CAA2B,OAAO,EAAE,QAAA,EAAS;AAC3D;AAEO,SAAS,yBAAA,CAA0B,WAAA,EAAqB,OAAA,GAA8B,QAAA,EAAkB;AAC7G,EAAA,MAAM,OAAA,GAAU,0BAAA,CAA2B,OAAO,CAAA,CAAE,SAAS,WAAW,CAAA;AAExE,EAAA,IAAI,CAAC,OAAA,EAAS;AACZ,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-L2FWBQU6.js","sourcesContent":["{\n \"channels\": {\n \"stable\": {\n \"@fayz-ai/sdk\": \"^0.19.1\",\n \"@fayz-ai/admin\": \"^0.19.1\",\n \"@fayz-ai/core\": \"^0.19.1\",\n \"@fayz-ai/auth\": \"^0.19.0\",\n \"@fayz-ai/ui\": \"^0.19.0\",\n \"@fayz-ai/shop\": \"^0.19.0\",\n \"@fayz-ai/storefront\": \"^0.19.1\",\n \"@fayz-ai/portal\": \"^0.19.0\",\n \"@fayz-ai/courses\": \"^0.19.0\",\n \"@fayz-ai/db\": \"^0.14.0\",\n \"@fayz-ai/plugin-agenda\": \"^0.13.0\",\n \"@fayz-ai/plugin-auth\": \"^0.12.2\",\n \"@fayz-ai/plugin-automations\": \"^0.12.4\",\n \"@fayz-ai/plugin-blog\": \"^0.12.7\",\n \"@fayz-ai/plugin-conversations\": \"^0.11.3\",\n \"@fayz-ai/plugin-courses\": \"^0.10.7\",\n \"@fayz-ai/plugin-crm\": \"^0.11.0\",\n \"@fayz-ai/plugin-dashboard\": \"^0.9.9\",\n \"@fayz-ai/plugin-financial\": \"^0.13.0\",\n \"@fayz-ai/plugin-forms\": \"^0.10.4\",\n \"@fayz-ai/plugin-inventory\": \"^0.12.0\",\n \"@fayz-ai/plugin-marketing\": \"^0.12.0\",\n \"@fayz-ai/plugin-menu\": \"^0.10.5\",\n \"@fayz-ai/plugin-orders\": \"^0.12.1\",\n \"@fayz-ai/plugin-payments\": \"^0.9.9\",\n \"@fayz-ai/plugin-reports\": \"^0.13.0\",\n \"@fayz-ai/plugin-reputation\": \"^0.10.4\",\n \"@fayz-ai/plugin-shop\": \"^0.15.0\",\n \"@fayz-ai/plugin-sites\": \"^0.9.7\",\n \"@fayz-ai/plugin-tables\": \"^0.10.5\",\n \"@fayz-ai/plugin-tasks\": \"^0.10.4\"\n },\n \"latest\": {\n \"@fayz-ai/sdk\": \"^0.19.1\",\n \"@fayz-ai/admin\": \"^0.19.1\",\n \"@fayz-ai/core\": \"^0.19.1\",\n \"@fayz-ai/auth\": \"^0.19.0\",\n \"@fayz-ai/ui\": \"^0.19.0\",\n \"@fayz-ai/shop\": \"^0.19.0\",\n \"@fayz-ai/storefront\": \"^0.19.1\",\n \"@fayz-ai/portal\": \"^0.19.0\",\n \"@fayz-ai/courses\": \"^0.19.0\",\n \"@fayz-ai/db\": \"^0.14.0\",\n \"@fayz-ai/plugin-agenda\": \"^0.13.0\",\n \"@fayz-ai/plugin-auth\": \"^0.12.2\",\n \"@fayz-ai/plugin-automations\": \"^0.12.4\",\n \"@fayz-ai/plugin-blog\": \"^0.12.7\",\n \"@fayz-ai/plugin-conversations\": \"^0.11.3\",\n \"@fayz-ai/plugin-courses\": \"^0.10.7\",\n \"@fayz-ai/plugin-crm\": \"^0.11.0\",\n \"@fayz-ai/plugin-dashboard\": \"^0.9.9\",\n \"@fayz-ai/plugin-financial\": \"^0.13.0\",\n \"@fayz-ai/plugin-forms\": \"^0.10.4\",\n \"@fayz-ai/plugin-inventory\": \"^0.12.0\",\n \"@fayz-ai/plugin-marketing\": \"^0.12.0\",\n \"@fayz-ai/plugin-menu\": \"^0.10.5\",\n \"@fayz-ai/plugin-orders\": \"^0.12.1\",\n \"@fayz-ai/plugin-payments\": \"^0.9.9\",\n \"@fayz-ai/plugin-reports\": \"^0.13.0\",\n \"@fayz-ai/plugin-reputation\": \"^0.10.4\",\n \"@fayz-ai/plugin-shop\": \"^0.15.0\",\n \"@fayz-ai/plugin-sites\": \"^0.9.7\",\n \"@fayz-ai/plugin-tables\": \"^0.10.5\",\n \"@fayz-ai/plugin-tasks\": \"^0.10.4\"\n },\n \"preview\": {\n \"@fayz-ai/sdk\": \"^0.19.1\",\n \"@fayz-ai/admin\": \"^0.19.1\",\n \"@fayz-ai/core\": \"^0.19.1\",\n \"@fayz-ai/auth\": \"^0.19.0\",\n \"@fayz-ai/ui\": \"^0.19.0\",\n \"@fayz-ai/shop\": \"^0.19.0\",\n \"@fayz-ai/storefront\": \"^0.19.1\",\n \"@fayz-ai/portal\": \"^0.19.0\",\n \"@fayz-ai/courses\": \"^0.19.0\",\n \"@fayz-ai/db\": \"^0.14.0\",\n \"@fayz-ai/plugin-agenda\": \"^0.13.0\",\n \"@fayz-ai/plugin-auth\": \"^0.12.2\",\n \"@fayz-ai/plugin-automations\": \"^0.12.4\",\n \"@fayz-ai/plugin-blog\": \"^0.12.7\",\n \"@fayz-ai/plugin-conversations\": \"^0.11.3\",\n \"@fayz-ai/plugin-courses\": \"^0.10.7\",\n \"@fayz-ai/plugin-crm\": \"^0.11.0\",\n \"@fayz-ai/plugin-dashboard\": \"^0.9.9\",\n \"@fayz-ai/plugin-financial\": \"^0.13.0\",\n \"@fayz-ai/plugin-forms\": \"^0.10.4\",\n \"@fayz-ai/plugin-inventory\": \"^0.12.0\",\n \"@fayz-ai/plugin-marketing\": \"^0.12.0\",\n \"@fayz-ai/plugin-menu\": \"^0.10.5\",\n \"@fayz-ai/plugin-orders\": \"^0.12.1\",\n \"@fayz-ai/plugin-payments\": \"^0.9.9\",\n \"@fayz-ai/plugin-reports\": \"^0.13.0\",\n \"@fayz-ai/plugin-reputation\": \"^0.10.4\",\n \"@fayz-ai/plugin-shop\": \"^0.15.0\",\n \"@fayz-ai/plugin-sites\": \"^0.9.7\",\n \"@fayz-ai/plugin-tables\": \"^0.10.5\",\n \"@fayz-ai/plugin-tasks\": \"^0.10.4\"\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"]}
|