@happyvertical/smrt-chat 0.56.0 → 0.56.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/AGENTS.md CHANGED
@@ -97,6 +97,19 @@ fail-closed `allowedTools` offer/execution gates; RBAC, tenant, redaction,
97
97
  bounded query results, and audit authority remain in the authenticated
98
98
  `PrincipalRun` supplied by `@happyvertical/smrt-agents`.
99
99
 
100
+ ## Commerce money tools (#3937)
101
+
102
+ Hosts that offer invoice money work must explicitly register
103
+ `createCommerceMoneyTools()` from `@happyvertical/smrt-commerce` in
104
+ their authenticated assistant route's `extraTools` (for example, `extraTools: () => createCommerceMoneyTools()`) and
105
+ add only the desired `commerce.*` slugs to the persona's `allowedTools`.
106
+ They are not generic manifest CRUD tools: tax codes are selected by code,
107
+ preview is calculator-only, and line writes run through the document-money
108
+ coordinator. Each execution reasserts the principal allow-list and required
109
+ `Invoice`, `InvoiceLineItem`, `DocumentTax`, and `TaxCode` operations. The
110
+ generated MCP invoice `get` serializer remains commerce-owned; use its
111
+ stored-facts integration when that serializer exposes `DocumentTax` rows.
112
+
100
113
  ## Runtime report tools (#3711)
101
114
 
102
115
  `createRuntimeReportTools()` (`runtime-report-tools.ts`) returns four
package/README.md CHANGED
@@ -159,6 +159,34 @@ if (session.isActive()) {
159
159
  }
160
160
  ```
161
161
 
162
+ ### Commerce money assistant tools
163
+
164
+ An authenticated AssistantDock host can register the draft-invoice tools through
165
+ the same `extraTools` seam. Include only the tools the persona may use in its
166
+ server-controlled `allowedTools`; the tools repeat both the allow-list and
167
+ operation checks when invoked.
168
+
169
+ ```typescript
170
+ import { createCommerceMoneyTools } from '@happyvertical/smrt-commerce';
171
+ import { mountAssistantRoutes } from '@happyvertical/smrt-chat/sveltekit';
172
+
173
+ const routes = mountAssistantRoutes({
174
+ // The authenticated host resolves allowedTools for each principal.
175
+ extraTools: () => createCommerceMoneyTools(),
176
+ allowedTools: () => [
177
+ 'commerce.taxCodes.list',
178
+ 'commerce.invoice.preview',
179
+ 'commerce.invoice.line.add',
180
+ 'commerce.invoice.line.update',
181
+ ],
182
+ // ...the host's principal, database, and AI bindings
183
+ });
184
+ ```
185
+
186
+ These tools select tax codes by code and use the commerce calculator and
187
+ document-money coordinator. They do not expose raw amount, tax amount, or
188
+ numeric tax-rate writes.
189
+
162
190
  ### Voice gateway turns
163
191
 
164
192
  `smrt-chat` can expose a gateway-facing turn target for browser voice input.