@fayz-ai/plugin-inventory 0.18.15 → 0.18.16
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/InventoryGeneralSettings-GTSBWOTS.js +3 -0
- package/dist/InventoryGeneralSettings-GTSBWOTS.js.map +1 -0
- package/dist/InventoryPage-WHNVIP4B.js +6673 -0
- package/dist/InventoryPage-WHNVIP4B.js.map +1 -0
- package/dist/UnitStockLocationsWidget-ZHB4HLRG.js +49 -0
- package/dist/UnitStockLocationsWidget-ZHB4HLRG.js.map +1 -0
- package/dist/chunk-MJZZ4EZB.js +82 -0
- package/dist/chunk-MJZZ4EZB.js.map +1 -0
- package/dist/chunk-UZLEFDCX.js +56 -0
- package/dist/chunk-UZLEFDCX.js.map +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2322 -18498
- package/dist/index.js.map +1 -1
- package/dist/migrations/main.browser.js +37 -0
- package/dist/migrations/main.browser.js.map +1 -0
- package/dist/migrations/main.js +9363 -0
- package/dist/migrations/main.js.map +1 -0
- package/package.json +11 -5
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { recordRailFields, RECORD_GROUP, activeFacet } from '@fayz-ai/core';
|
|
2
|
+
import { RelatedListTab } from '@fayz-ai/admin';
|
|
3
|
+
import { jsx } from 'react/jsx-runtime';
|
|
4
|
+
|
|
5
|
+
// src/views/UnitStockLocationsWidget.tsx
|
|
6
|
+
var stockLocationEntity = {
|
|
7
|
+
name: "Local de estoque",
|
|
8
|
+
namePlural: "Locais de estoque",
|
|
9
|
+
icon: "Package",
|
|
10
|
+
displayField: "name",
|
|
11
|
+
defaultSort: "name",
|
|
12
|
+
formColumns: 2,
|
|
13
|
+
facets: [activeFacet({ active: "Ativos", inactive: "Inativos", all: "Todos" })],
|
|
14
|
+
fieldGroups: [{ id: "identity", label: "O local", columns: 2 }, { ...RECORD_GROUP }],
|
|
15
|
+
fields: [
|
|
16
|
+
{ key: "name", label: "Nome", type: "text", required: true, showInTable: true, searchable: true, group: "identity" },
|
|
17
|
+
{ key: "description", label: "Descri\xE7\xE3o", type: "text", showInTable: true, group: "identity", span: 2 },
|
|
18
|
+
{ key: "code", label: "C\xF3digo", type: "text", group: "identity" },
|
|
19
|
+
...recordRailFields({ tagsTable: "plg_inventory_stock_locations", activeLabel: "Ativo", unitRequired: true }).filter((f) => f.key !== "tags" && f.key !== "notes")
|
|
20
|
+
],
|
|
21
|
+
data: {
|
|
22
|
+
table: "plg_inventory_stock_locations",
|
|
23
|
+
schema: "public",
|
|
24
|
+
tenantScoped: true,
|
|
25
|
+
searchColumns: ["name", "description", "code"]
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
function UnitStockLocationsWidget({ item }) {
|
|
29
|
+
if (!item?.id) return null;
|
|
30
|
+
return /* @__PURE__ */ jsx(
|
|
31
|
+
RelatedListTab,
|
|
32
|
+
{
|
|
33
|
+
item,
|
|
34
|
+
entityDef: stockLocationEntity,
|
|
35
|
+
parentTabId: "locations",
|
|
36
|
+
related: {
|
|
37
|
+
id: "stock-locations",
|
|
38
|
+
label: "Locais de estoque",
|
|
39
|
+
entity: stockLocationEntity,
|
|
40
|
+
foreignKey: "unitId",
|
|
41
|
+
emptyHint: "Nenhum local de estoque nesta unidade ainda. Toda entrada e sa\xEDda precisa dizer de onde."
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export { UnitStockLocationsWidget, stockLocationEntity };
|
|
48
|
+
//# sourceMappingURL=UnitStockLocationsWidget-ZHB4HLRG.js.map
|
|
49
|
+
//# sourceMappingURL=UnitStockLocationsWidget-ZHB4HLRG.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/views/UnitStockLocationsWidget.tsx"],"names":[],"mappings":";;;;;AAMO,IAAM,mBAAA,GAAiC;AAAA,EAC5C,IAAA,EAAM,kBAAA;AAAA,EACN,UAAA,E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,aAAA,EAAe,MAAM;AAAA;AAEjD;AAEO,SAAS,wBAAA,CAAyB,EAAE,IAAA,EAAK,EAA+B;AAC7E,EAAA,IAAI,CAAC,IAAA,EAAM,EAAA,EAAI,OAAO,IAAA;AACtB,EAAA,uBACE,GAAA;AAAA,IAAC,cAAA;AAAA,IAAA;AAAA,MACC,IAAA;AAAA,MACA,SAAA,EAAW,mBAAA;AAAA,MACX,WAAA,EAAY,WAAA;AAAA,MACZ,OAAA,EAAS;AAAA,QACP,EAAA,EAAI,iBAAA;AAAA,QAAmB,KAAA,EAAO,mBAAA;AAAA,QAAqB,MAAA,EAAQ,mBAAA;AAAA,QAAqB,UAAA,EAAY,QAAA;AAAA,QAC5F,SAAA,EAAW;AAAA;AACb;AAAA,GACF;AAEJ","file":"UnitStockLocationsWidget-ZHB4HLRG.js","sourcesContent":["import React from 'react'\nimport type { EntityDef } from '@fayz-ai/core'\nimport { RECORD_GROUP, recordRailFields, activeFacet } from '@fayz-ai/core'\nimport { RelatedListTab } from '@fayz-ai/admin'\n\n/** V1 stock_locations → plg_inventory_stock_locations. Deleting deactivates, as in V1. */\nexport const stockLocationEntity: EntityDef = {\n name: 'Local de estoque',\n namePlural: 'Locais de estoque',\n icon: 'Package',\n displayField: 'name',\n defaultSort: 'name',\n formColumns: 2,\n facets: [activeFacet({ active: 'Ativos', inactive: 'Inativos', all: 'Todos' })],\n fieldGroups: [{ id: 'identity', label: 'O local', columns: 2 }, { ...RECORD_GROUP }],\n fields: [\n { key: 'name', label: 'Nome', type: 'text', required: true, showInTable: true, searchable: true, group: 'identity' },\n { key: 'description', label: 'Descrição', type: 'text', showInTable: true, group: 'identity', span: 2 },\n { key: 'code', label: 'Código', type: 'text', group: 'identity' },\n ...recordRailFields({ tagsTable: 'plg_inventory_stock_locations', activeLabel: 'Ativo', unitRequired: true })\n .filter((f) => f.key !== 'tags' && f.key !== 'notes'),\n ],\n data: {\n table: 'plg_inventory_stock_locations',\n schema: 'public',\n tenantScoped: true,\n searchColumns: ['name', 'description', 'code'],\n },\n}\n\nexport function UnitStockLocationsWidget({ item }: { item?: { id?: string } }) {\n if (!item?.id) return null\n return (\n <RelatedListTab\n item={item}\n entityDef={stockLocationEntity}\n parentTabId=\"locations\"\n related={{\n id: 'stock-locations', label: 'Locais de estoque', entity: stockLocationEntity, foreignKey: 'unitId',\n emptyHint: 'Nenhum local de estoque nesta unidade ainda. Toda entrada e saída precisa dizer de onde.',\n }}\n />\n )\n}\n"]}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { useOrganizationStore, useTenantPluginSettings, SettingsGroup, ToggleRow } from '@fayz-ai/admin';
|
|
3
|
+
import { useTranslation } from '@fayz-ai/core';
|
|
4
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
5
|
+
|
|
6
|
+
// src/components/InventoryGeneralSettings.tsx
|
|
7
|
+
var INVENTORY_MODULE_DEFAULTS = {
|
|
8
|
+
recipes: true,
|
|
9
|
+
requisitions: true,
|
|
10
|
+
usageAudit: true,
|
|
11
|
+
temperature: true,
|
|
12
|
+
// Tabs another plugin lends to Inventory (invoice entry), switched off by id.
|
|
13
|
+
hiddenViews: []
|
|
14
|
+
};
|
|
15
|
+
var NO_RECIPE_VERTICALS = /* @__PURE__ */ new Set(["beauty"]);
|
|
16
|
+
function inventoryModuleDefaults(verticalId) {
|
|
17
|
+
return NO_RECIPE_VERTICALS.has(verticalId ?? "") ? { ...INVENTORY_MODULE_DEFAULTS, recipes: false } : INVENTORY_MODULE_DEFAULTS;
|
|
18
|
+
}
|
|
19
|
+
function useInventoryHouseModules() {
|
|
20
|
+
const verticalId = useOrganizationStore((state) => state.currentOrg?.verticalId);
|
|
21
|
+
const defaults = React.useMemo(() => inventoryModuleDefaults(verticalId), [verticalId]);
|
|
22
|
+
return useTenantPluginSettings("inventory", defaults);
|
|
23
|
+
}
|
|
24
|
+
var INVENTORY_DEFAULTS = {
|
|
25
|
+
lowStockAlerts: true,
|
|
26
|
+
requireReason: true,
|
|
27
|
+
autoDeduct: false,
|
|
28
|
+
requireSku: false,
|
|
29
|
+
allowNegative: false,
|
|
30
|
+
lowStockEmail: false,
|
|
31
|
+
expiryWarnings: true
|
|
32
|
+
};
|
|
33
|
+
function InventoryGeneralSettings({ config }) {
|
|
34
|
+
const t = useTranslation();
|
|
35
|
+
const s = useTenantPluginSettings("inventory", INVENTORY_DEFAULTS);
|
|
36
|
+
const mods = useInventoryHouseModules();
|
|
37
|
+
return /* @__PURE__ */ jsxs("div", { className: "space-y-4", children: [
|
|
38
|
+
/* @__PURE__ */ jsxs(SettingsGroup, { title: t("inventory.settings.modules"), description: t("inventory.settings.modulesDesc"), children: [
|
|
39
|
+
config?.modules.recipes && /* @__PURE__ */ jsx(
|
|
40
|
+
ToggleRow,
|
|
41
|
+
{
|
|
42
|
+
label: t("inventory.settings.recipes"),
|
|
43
|
+
description: t("inventory.settings.recipesDesc"),
|
|
44
|
+
checked: mods.get("recipes"),
|
|
45
|
+
onChange: (v) => mods.set("recipes", v)
|
|
46
|
+
}
|
|
47
|
+
),
|
|
48
|
+
/* @__PURE__ */ jsx(ToggleRow, { label: t("inventory.settings.requisitions"), description: t("inventory.settings.requisitionsDesc"), checked: mods.get("requisitions"), onChange: (v) => mods.set("requisitions", v) }),
|
|
49
|
+
/* @__PURE__ */ jsx(ToggleRow, { label: t("inventory.nav.usageAudit"), description: t("inventory.settings.usageAuditDesc"), checked: mods.get("usageAudit"), onChange: (v) => mods.set("usageAudit", v) }),
|
|
50
|
+
/* @__PURE__ */ jsx(ToggleRow, { label: t("inventory.settings.temperature"), description: t("inventory.settings.temperatureDesc"), checked: mods.get("temperature"), onChange: (v) => mods.set("temperature", v) }),
|
|
51
|
+
(config?.extraViews ?? []).map((extra) => {
|
|
52
|
+
const hidden = mods.get("hiddenViews");
|
|
53
|
+
return /* @__PURE__ */ jsx(
|
|
54
|
+
ToggleRow,
|
|
55
|
+
{
|
|
56
|
+
label: extra.label,
|
|
57
|
+
checked: !hidden.includes(extra.id),
|
|
58
|
+
onChange: (v) => mods.set("hiddenViews", v ? hidden.filter((id) => id !== extra.id) : [...hidden, extra.id])
|
|
59
|
+
},
|
|
60
|
+
extra.id
|
|
61
|
+
);
|
|
62
|
+
})
|
|
63
|
+
] }),
|
|
64
|
+
/* @__PURE__ */ jsxs(SettingsGroup, { title: t("inventory.settings.stockManagement"), description: t("inventory.settings.stockManagementDesc"), children: [
|
|
65
|
+
/* @__PURE__ */ jsx(ToggleRow, { pending: true, label: t("inventory.settings.lowStockAlerts"), description: t("inventory.settings.lowStockAlertsDesc"), checked: s.get("lowStockAlerts"), onChange: (v) => s.set("lowStockAlerts", v) }),
|
|
66
|
+
/* @__PURE__ */ jsx(ToggleRow, { pending: true, label: t("inventory.settings.requireReason"), description: t("inventory.settings.requireReasonDesc"), checked: s.get("requireReason"), onChange: (v) => s.set("requireReason", v) }),
|
|
67
|
+
/* @__PURE__ */ jsx(ToggleRow, { pending: true, label: t("inventory.settings.autoDeduct"), description: t("inventory.settings.autoDeductDesc"), checked: s.get("autoDeduct"), onChange: (v) => s.set("autoDeduct", v) })
|
|
68
|
+
] }),
|
|
69
|
+
/* @__PURE__ */ jsxs(SettingsGroup, { title: t("inventory.settings.products"), description: t("inventory.settings.productsDesc"), children: [
|
|
70
|
+
/* @__PURE__ */ jsx(ToggleRow, { pending: true, label: t("inventory.settings.requireSku"), description: t("inventory.settings.requireSkuDesc"), checked: s.get("requireSku"), onChange: (v) => s.set("requireSku", v) }),
|
|
71
|
+
/* @__PURE__ */ jsx(ToggleRow, { pending: true, label: t("inventory.settings.allowNegative"), description: t("inventory.settings.allowNegativeDesc"), checked: s.get("allowNegative"), onChange: (v) => s.set("allowNegative", v) })
|
|
72
|
+
] }),
|
|
73
|
+
/* @__PURE__ */ jsxs(SettingsGroup, { title: t("inventory.settings.notifications"), description: t("inventory.settings.notificationsDesc"), children: [
|
|
74
|
+
/* @__PURE__ */ jsx(ToggleRow, { pending: true, label: t("inventory.settings.lowStockEmail"), description: t("inventory.settings.lowStockEmailDesc"), checked: s.get("lowStockEmail"), onChange: (v) => s.set("lowStockEmail", v) }),
|
|
75
|
+
/* @__PURE__ */ jsx(ToggleRow, { pending: true, label: t("inventory.settings.expiryWarnings"), description: t("inventory.settings.expiryWarningsDesc"), checked: s.get("expiryWarnings"), onChange: (v) => s.set("expiryWarnings", v) })
|
|
76
|
+
] })
|
|
77
|
+
] });
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
export { INVENTORY_MODULE_DEFAULTS, InventoryGeneralSettings, inventoryModuleDefaults, useInventoryHouseModules };
|
|
81
|
+
//# sourceMappingURL=chunk-MJZZ4EZB.js.map
|
|
82
|
+
//# sourceMappingURL=chunk-MJZZ4EZB.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/InventoryGeneralSettings.tsx"],"names":[],"mappings":";;;;;;AAaO,IAAM,yBAAA,GAA4B;AAAA,EACvC,OAAA,EAAS,IAAA;AAAA,EACT,YAAA,EAAc,IAAA;AAAA,EACd,UAAA,EAAY,IAAA;AAAA,EACZ,WAAA,EAAa,IAAA;AAAA;AAAA,EAEb,aAAa;AACf;AAGA,IAAM,mBAAA,mBAAsB,IAAI,GAAA,CAAI,CAAC,QAAQ,CAAC,CAAA;AAGvC,SAAS,wBAAwB,UAAA,EAA8D;AACpG,EAAA,OAAO,mBAAA,CAAoB,GAAA,CAAI,UAAA,IAAc,EAAE,CAAA,GAC3C,EAAE,GAAG,yBAAA,EAA2B,OAAA,EAAS,KAAA,EAAM,GAC/C,yBAAA;AACN;AAGO,SAAS,wBAAA,GAA2B;AACzC,EAAA,MAAM,aAAa,oBAAA,CAAqB,CAAC,KAAA,KAAU,KAAA,CAAM,YAAY,UAAU,CAAA;AAC/E,EAAA,MAAM,QAAA,GAAW,MAAM,OAAA,CAAQ,MAAM,wBAAwB,UAAU,CAAA,EAAG,CAAC,UAAU,CAAC,CAAA;AACtF,EAAA,OAAO,u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{ useTranslation } from '@fayz-ai/core'\nimport type { ResolvedInventoryConfig } from '../context'\n\n/**\n * Os módulos do Estoque que a CASA liga e desliga — não o pacote.\n *\n * `modules.recipes` na fábrica diz se este aplicativo OFERECE ficha técnica;\n * isto diz se esta conta a usa. Uma cozinha vive dela e um salão não tem\n * nenhuma — e os dois rodam o mesmo pacote central. Ver\n * FINANCIAL_MODULE_DEFAULTS, que é a mesma decisão no Financeiro.\n */\nexport const INVENTORY_MODULE_DEFAULTS = {\n recipes: true,\n requisitions: true,\n usageAudit: true,\n temperature: true,\n // Tabs another plugin lends to Inventory (invoice entry), switched off by id.\n hiddenViews: [] as string[],\n}\n\n/** Trades with nothing to produce. The sheet starts OFF there; the house can still turn it on. */\nconst NO_RECIPE_VERTICALS = new Set(['beauty'])\n\n/** The defaults for THIS account's trade — a salon does not open on a recipe book. */\nexport function inventoryModuleDefaults(verticalId?: string | null): typeof INVENTORY_MODULE_DEFAULTS {\n return NO_RECIPE_VERTICALS.has(verticalId ?? '')\n ? { ...INVENTORY_MODULE_DEFAULTS, recipes: false }\n : INVENTORY_MODULE_DEFAULTS\n}\n\n/** The house's module switches, over the defaults of its trade. One reader, so no screen disagrees. */\nexport function useInventoryHouseModules() {\n const verticalId = useOrganizationStore((state) => state.currentOrg?.verticalId)\n const defaults = React.useMemo(() => inventoryModuleDefaults(verticalId), [verticalId])\n return useTenantPluginSettings('inventory', defaults)\n}\n\n// Per-tenant defaults. Rows marked `pending` save but nothing reads them yet\n// (docs/status/SETTINGS-AUDIT.md).\nconst INVENTORY_DEFAULTS = {\n lowStockAlerts: true,\n requireReason: true,\n autoDeduct: false,\n requireSku: false,\n allowNegative: false,\n lowStockEmail: false,\n expiryWarnings: true,\n}\n\nexport function InventoryGeneralSettings({ config }: { config?: ResolvedInventoryConfig }) {\n const t = useTranslation()\n const s = useTenantPluginSettings('inventory', INVENTORY_DEFAULTS)\n const mods = useInventoryHouseModules()\n return (\n <div className=\"space-y-4\">\n {/* Só o que o aplicativo OFERECE aparece aqui. */}\n <SettingsGroup title={t('inventory.settings.modules')} description={t('inventory.settings.modulesDesc')}>\n {config?.modules.recipes && (\n <ToggleRow\n label={t('inventory.settings.recipes')}\n description={t('inventory.settings.recipesDesc')}\n checked={mods.get('recipes')}\n onChange={(v) => mods.set('recipes', v)}\n />\n )}\n <ToggleRow label={t('inventory.settings.requisitions')} description={t('inventory.settings.requisitionsDesc')} checked={mods.get('requisitions')} onChange={(v) => mods.set('requisitions', v)} />\n <ToggleRow label={t('inventory.nav.usageAudit')} description={t('inventory.settings.usageAuditDesc')} checked={mods.get('usageAudit')} onChange={(v) => mods.set('usageAudit', v)} />\n <ToggleRow label={t('inventory.settings.temperature')} description={t('inventory.settings.temperatureDesc')} checked={mods.get('temperature')} onChange={(v) => mods.set('temperature', v)} />\n {(config?.extraViews ?? []).map((extra) => {\n const hidden = mods.get('hiddenViews')\n return (\n <ToggleRow\n key={extra.id}\n label={extra.label}\n checked={!hidden.includes(extra.id)}\n onChange={(v) => mods.set('hiddenViews', v ? hidden.filter((id) => id !== extra.id) : [...hidden, extra.id])}\n />\n )\n })}\n </SettingsGroup>\n <SettingsGroup title={t('inventory.settings.stockManagement')} description={t('inventory.settings.stockManagementDesc')}>\n <ToggleRow pending label={t('inventory.settings.lowStockAlerts')} description={t('inventory.settings.lowStockAlertsDesc')} checked={s.get('lowStockAlerts')} onChange={(v) => s.set('lowStockAlerts', v)} />\n <ToggleRow pending label={t('inventory.settings.requireReason')} description={t('inventory.settings.requireReasonDesc')} checked={s.get('requireReason')} onChange={(v) => s.set('requireReason', v)} />\n <ToggleRow pending label={t('inventory.settings.autoDeduct')} description={t('inventory.settings.autoDeductDesc')} checked={s.get('autoDeduct')} onChange={(v) => s.set('autoDeduct', v)} />\n </SettingsGroup>\n\n <SettingsGroup title={t('inventory.settings.products')} description={t('inventory.settings.productsDesc')}>\n <ToggleRow pending label={t('inventory.settings.requireSku')} description={t('inventory.settings.requireSkuDesc')} checked={s.get('requireSku')} onChange={(v) => s.set('requireSku', v)} />\n <ToggleRow pending label={t('inventory.settings.allowNegative')} description={t('inventory.settings.allowNegativeDesc')} checked={s.get('allowNegative')} onChange={(v) => s.set('allowNegative', v)} />\n </SettingsGroup>\n\n <SettingsGroup title={t('inventory.settings.notifications')} description={t('inventory.settings.notificationsDesc')}>\n <ToggleRow pending label={t('inventory.settings.lowStockEmail')} description={t('inventory.settings.lowStockEmailDesc')} checked={s.get('lowStockEmail')} onChange={(v) => s.set('lowStockEmail', v)} />\n <ToggleRow pending label={t('inventory.settings.expiryWarnings')} description={t('inventory.settings.expiryWarningsDesc')} checked={s.get('expiryWarnings')} onChange={(v) => s.set('expiryWarnings', v)} />\n </SettingsGroup>\n </div>\n )\n}\n"]}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { createPluginContext } from '@fayz-ai/admin';
|
|
2
|
+
export { formatCurrency } from '@fayz-ai/admin';
|
|
3
|
+
|
|
4
|
+
// src/context.tsx
|
|
5
|
+
var ctx = createPluginContext("InventoryPage");
|
|
6
|
+
var InventoryContextProvider = ctx.ContextProvider;
|
|
7
|
+
var useInventoryConfig = ctx.useConfig;
|
|
8
|
+
var useInventoryProvider = ctx.useProvider;
|
|
9
|
+
var useInventoryStore = ctx.useStore;
|
|
10
|
+
|
|
11
|
+
// src/lib/agent-tools.ts
|
|
12
|
+
var INGREDIENT_SHAPE = "An ingredient line: { product_id?, name, quantity, notes? }. Prefer product_id from the catalogue in the screen context; send `name` too so an unmatched line can still be shown to the user. quantity is a number in the ingredient's own unit \u2014 the catalogue lists that unit.";
|
|
13
|
+
var upsertRecipeTool = {
|
|
14
|
+
id: "inventory.upsertRecipe",
|
|
15
|
+
name: "upsertRecipe",
|
|
16
|
+
description: "Creates or edits a ficha t\xE9cnica (recipe) for a menu item: what it is made of, how much it yields and how it is prepared. Persisted server-side, so it works from ANY page. Omit recipeId to CREATE (name required); pass recipeId to EDIT. Propose the WHOLE recipe in a single call \u2014 ingredients, quantities, yield and preparation together. Do NOT interview the user ingredient by ingredient. Use the ingredient catalogue in the screen context to pick real product ids; name anything else in `name` and it will come back flagged for the user to pick or create. The user confirms before it is saved.",
|
|
17
|
+
icon: "BookOpen",
|
|
18
|
+
mode: "persist",
|
|
19
|
+
role: "finance",
|
|
20
|
+
limitKey: "recipes",
|
|
21
|
+
permission: { feature: "inventory.recipes", action: "create" },
|
|
22
|
+
execution: { plane: "server", kind: "rpc", rpc: "agent_inventory_upsert_recipe" },
|
|
23
|
+
category: "Inventory",
|
|
24
|
+
suggestions: [
|
|
25
|
+
{ label: "Monte a ficha t\xE9cnica do cupim defumado com queijo, 400g" },
|
|
26
|
+
{ label: "Quais itens do card\xE1pio ainda n\xE3o t\xEAm ficha t\xE9cnica?" }
|
|
27
|
+
],
|
|
28
|
+
parameters: {
|
|
29
|
+
type: "object",
|
|
30
|
+
properties: {
|
|
31
|
+
recipeId: { type: "string", description: "Existing recipe id to EDIT. Omit to create a new one." },
|
|
32
|
+
name: { type: "string", description: "Recipe name \u2014 required when creating." },
|
|
33
|
+
product_id: { type: "string", description: "Id of the product this recipe produces, from the screen context." },
|
|
34
|
+
product_name: { type: "string", description: "Name of the produced product, when its id is unknown. Resolved against the catalogue." },
|
|
35
|
+
description: { type: "string", description: "Optional short description." },
|
|
36
|
+
yield_quantity: { type: "number", description: "How many units one batch yields. Defaults to 1." },
|
|
37
|
+
preparation_time_minutes: { type: "number", description: "Preparation time in minutes." },
|
|
38
|
+
instructions: { type: "string", description: "Step-by-step preparation." },
|
|
39
|
+
ingredients: {
|
|
40
|
+
type: "array",
|
|
41
|
+
description: `The FULL ingredient list \u2014 REPLACES every existing line. Each item: ${INGREDIENT_SHAPE}`,
|
|
42
|
+
items: { type: "object", description: INGREDIENT_SHAPE }
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
var RECIPE_SURFACE_INSTRUCTIONS = [
|
|
48
|
+
"Voc\xEA est\xE1 na tela de FICHAS T\xC9CNICAS. Para montar ou editar uma ficha use a tool upsertRecipe (ela persiste no backend).",
|
|
49
|
+
"O cat\xE1logo de insumos (id, nome, unidade, custo) e os itens do card\xE1pio sem ficha est\xE3o no JSON da tela em contexto \u2014 use os ids de l\xE1 em vez de inventar.",
|
|
50
|
+
"Proponha a ficha inteira numa \xFAnica chamada: ingredientes, quantidades, rendimento e preparo juntos. N\xE3o pergunte ingrediente a ingrediente.",
|
|
51
|
+
"Insumo que n\xE3o existir no cat\xE1logo: mande mesmo assim em `name` \u2014 ele volta marcado para o usu\xE1rio escolher ou cadastrar."
|
|
52
|
+
].join(" ");
|
|
53
|
+
|
|
54
|
+
export { InventoryContextProvider, RECIPE_SURFACE_INSTRUCTIONS, upsertRecipeTool, useInventoryConfig, useInventoryProvider, useInventoryStore };
|
|
55
|
+
//# sourceMappingURL=chunk-UZLEFDCX.js.map
|
|
56
|
+
//# sourceMappingURL=chunk-UZLEFDCX.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/context.tsx","../src/lib/agent-tools.ts"],"names":[],"mappings":";;;;AAyEA,IAAM,GAAA,GAAM,oBAAsF,eAAe,CAAA;AAE1G,IAAM,2BAA2B,GAAA,CAAI;AACrC,IAAM,qBAAqB,GAAA,CAAI;AAC/B,IAAM,uBAAuB,GAAA,CAAI;AACjC,IAAM,oBAAoB,GAAA,CAAI;;;AC7DrC,IAAM,gBAAA,GACJ,uRAAA;AAKK,IAAM,gBAAA,GAAiC;AAAA,EAC5C,EAAA,EAAI,wBAAA;AAAA,EACJ,IAAA,EAAM,cAAA;AAAA,EACN,WAAA,EACE,4lBAAA;AAAA,EAMF,IAAA,EAAM,UAAA;AAAA,EACN,IAAA,EAAM,SAAA;AAAA,EACN,IAAA,EAAM,SAAA;AAAA,EACN,QAAA,EAAU,SAAA;AAAA,EACV,UAAA,EAAY,EAAE,OAAA,EAAS,mBAAA,EAAqB,QAAQ,QAAA,EAAS;AAAA,EAC7D,WAAW,EAAE,KAAA,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port type { DetailTab } from '@fayz-ai/core'\nimport { createPluginContext, formatCurrency, type CurrencyConfig } from '@fayz-ai/admin'\nimport type { InventoryPluginLabels } from './index'\nimport type { InventoryDataProvider } from '@fayz-ai/inventory/data/provider'\nimport type { InventoryUIState } from '@fayz-ai/inventory/store'\nimport type { StockMovement } from '@fayz-ai/inventory/domain/movement'\n\nexport interface InventoryModules {\n /** Product catalogue screens. Off when the host registers products elsewhere. */\n products: boolean\n recipes: boolean\n stockLocations: boolean\n batchTracking: boolean\n}\n\nexport type InventoryCurrency = CurrencyConfig\n\nexport interface ProductTypeOption {\n value: string\n label: string\n /**\n * Chave de tradução do rótulo, quando ele é do PRODUTO e não do app.\n *\n * Sem isto, a lista de uma casa brasileira mostrava «For Sale» e\n * «Ingredient» na coluna Classificação: o padrão é uma literal inglesa\n * escrita no manifesto, e só os apps que a sobrescreveram escapavam.\n * Quando há chave, ela vence; o rótulo do app continua ganhando quando ele\n * declara o seu.\n */\n labelKey?: string\n}\n\nexport interface LocationOption {\n id: string\n name: string\n isHQ?: boolean\n}\n\nexport interface ResolvedInventoryConfig {\n /** Ver `InventoryPluginOptions.moduleNav`. */\n moduleNav?: 'rail' | 'tabs' | 'sidebar'\n modules: InventoryModules\n labels: InventoryPluginLabels\n currency: InventoryCurrency\n productTypes: ProductTypeOption[]\n locations: LocationOption[]\n /** Tabs contributed to the product record. See `InventoryPluginOptions.productDetailTabs`. */\n productDetailTabs: DetailTab[]\n /** Telas emprestadas por outro plugin. Ver `InventoryPluginOptions.extraViews`. */\n extraViews: Array<{\n id: string\n label: string\n icon?: string\n render: () => React.ReactNode\n children?: Array<{ id: string; label: string; render: () => React.ReactNode }>\n defaultChildLabel?: string\n }>\n /**\n * O documento que originou um movimento, DENTRO DE UM MODAL — como no V1.\n *\n * Recebe o movimento (tem `documentType` e `operationId`) e devolve o conteúdo\n * do modal, ou `undefined` quando não há documento para abrir. O Estoque desenha\n * a moldura e cuida do abrir/fechar; quem sabe o que é uma NF-e é o outro\n * plugin.\n *\n * Era uma ROTA, e rota tira a pessoa da lista: ela estava percorrendo o razão,\n * clicava no motivo e perdia o lugar. O V1 abre em modal, e é o certo — o\n * documento é uma consulta, não um destino.\n */\n documentModal?: (movement: StockMovement, close: () => void) => React.ReactNode\n}\n\nconst ctx = createPluginContext<ResolvedInventoryConfig, InventoryDataProvider, InventoryUIState>('InventoryPage')\n\nexport const InventoryContextProvider = ctx.ContextProvider\nexport const useInventoryConfig = ctx.useConfig\nexport const useInventoryProvider = ctx.useProvider\nexport const useInventoryStore = ctx.useStore\n\nexport { formatCurrency }\n","import type { PluginAITool } from '@fayz-ai/core'\n\n/**\n * The assistant's ficha-técnica tool. A SERVER-PLANE write (a pool RPC), so it\n * works from any page and any channel and persists straight to the tenant's\n * recipes — the same pattern agenda/financial/forms use.\n *\n * `role: 'finance'` is explicit and load-bearing: the plugin's\n * `defaultAgentRole` is 'operations', and cost per dish is the finance\n * colleague's job (Selma, \"Gerente Administrativa\" in resto-saas). Without it\n * the tool would land on the operations colleague instead.\n *\n * The recipes screen publishes the ingredient CATALOGUE through\n * `useAgentSurface`, so the model sends real product ids; the RPC still\n * resolves names for whatever it names without one.\n */\n\nconst INGREDIENT_SHAPE =\n 'An ingredient line: { product_id?, name, quantity, notes? }. ' +\n 'Prefer product_id from the catalogue in the screen context; send `name` too so an ' +\n 'unmatched line can still be shown to the user. quantity is a number in the ' +\n \"ingredient's own unit — the catalogue lists that unit.\"\n\nexport const upsertRecipeTool: PluginAITool = {\n id: 'inventory.upsertRecipe',\n name: 'upsertRecipe',\n description:\n 'Creates or edits a ficha técnica (recipe) for a menu item: what it is made of, how much it yields and how it is prepared. ' +\n 'Persisted server-side, so it works from ANY page. ' +\n 'Omit recipeId to CREATE (name required); pass recipeId to EDIT. ' +\n 'Propose the WHOLE recipe in a single call — ingredients, quantities, yield and preparation together. Do NOT interview the user ingredient by ingredient. ' +\n 'Use the ingredient catalogue in the screen context to pick real product ids; name anything else in `name` and it will come back flagged for the user to pick or create. ' +\n 'The user confirms before it is saved.',\n icon: 'BookOpen',\n mode: 'persist',\n role: 'finance',\n limitKey: 'recipes',\n permission: { feature: 'inventory.recipes', action: 'create' },\n execution: { plane: 'server', kind: 'rpc', rpc: 'agent_inventory_upsert_recipe' },\n category: 'Inventory',\n suggestions: [\n { label: 'Monte a ficha técnica do cupim defumado com queijo, 400g' },\n { label: 'Quais itens do cardápio ainda não têm ficha técnica?' },\n ],\n parameters: {\n type: 'object',\n properties: {\n recipeId: { type: 'string', description: 'Existing recipe id to EDIT. Omit to create a new one.' },\n name: { type: 'string', description: 'Recipe name — required when creating.' },\n product_id: { type: 'string', description: 'Id of the product this recipe produces, from the screen context.' },\n product_name: { type: 'string', description: 'Name of the produced product, when its id is unknown. Resolved against the catalogue.' },\n description: { type: 'string', description: 'Optional short description.' },\n yield_quantity: { type: 'number', description: 'How many units one batch yields. Defaults to 1.' },\n preparation_time_minutes: { type: 'number', description: 'Preparation time in minutes.' },\n instructions: { type: 'string', description: 'Step-by-step preparation.' },\n ingredients: {\n type: 'array',\n description: `The FULL ingredient list — REPLACES every existing line. Each item: ${INGREDIENT_SHAPE}`,\n items: { type: 'object', description: INGREDIENT_SHAPE },\n },\n },\n },\n}\n\nexport const RECIPE_SURFACE_INSTRUCTIONS = [\n 'Você está na tela de FICHAS TÉCNICAS. Para montar ou editar uma ficha use a tool upsertRecipe (ela persiste no backend).',\n 'O catálogo de insumos (id, nome, unidade, custo) e os itens do cardápio sem ficha estão no JSON da tela em contexto — use os ids de lá em vez de inventar.',\n 'Proponha a ficha inteira numa única chamada: ingredientes, quantidades, rendimento e preparo juntos. Não pergunte ingrediente a ingrediente.',\n 'Insumo que não existir no catálogo: mande mesmo assim em `name` — ele volta marcado para o usuário escolher ou cadastrar.',\n].join(' ')\n"]}
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,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