@go-labs-sg/bb 2.25.0 → 2.27.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/README.md CHANGED
@@ -12,6 +12,12 @@ For AI agents using this CLI: do not execute mutations until the user explicitly
12
12
 
13
13
  **Registry:** [`@go-labs-sg/bb`](https://www.npmjs.com/package/@go-labs-sg/bb)
14
14
 
15
+ ## Shared catalogue editing
16
+
17
+ All active authenticated users can edit suppliers, inventory items and item categories. Normal-user supplier updates submit a revision for approval in the shared API; item/category edits apply immediately. Lead/Admin supplier edits bypass human review. `bb supplier update` returns the server-owned approval/synchronization result without issuing another approval request. New supplier usage stays on hold during review and linked QuickBooks synchronization; existing usage continues with the last approved details until the edit is approved. Creator identity and delete/archive permissions are unchanged.
18
+
19
+ See the [supplier review and rollout policy](../api/docs/supplier-edit-review.md). Deploy the backend before publishing this CLI change.
20
+
15
21
  ## Runtime and installation
16
22
 
17
23
  The CLI requires [Bun](https://bun.com/docs/installation) 1.4.0 or newer and a Budget Builder account with any active user role.
@@ -328,6 +334,6 @@ bun run build
328
334
  bun run pack:artifact
329
335
  ```
330
336
 
331
- `pack:artifact` copies only the publish allowlist into a temporary staging directory and writes a sanitized publish manifest there. It never edits the source `package.json`, and the staged archive contains no workspace-only development dependencies. The release workflow packs once, validates the resulting archive, tests that exact tarball under Node and Bun, then publishes that exact tarball. Types from `@go-labs/budget-builder-api` are compile-time only (`import type`). Prisma enum **values** used at runtime live in `src/prisma-enums.ts` (kept in sync with `packages/budget-builder/db` generated enums) so npm installs do not need `@go-labs/budget-builder-db`.
337
+ `pack:artifact` copies only the publish allowlist into a temporary staging directory and writes a sanitized publish manifest there. It never edits the source `package.json`, and the staged archive contains no workspace-only development dependencies. The release workflow packs once, validates the resulting archive, smoke-tests that exact tarball under Bun 1.4, then publishes that exact tarball. Types from `@go-labs/budget-builder-api` are compile-time only (`import type`). Prisma enum **values** used at runtime live in `src/prisma-enums.ts` (kept in sync with `packages/budget-builder/db` generated enums) so npm installs do not need `@go-labs/budget-builder-db`.
332
338
 
333
339
  The generated `command-reference.md` and `command-manifest.json` are release artifacts. Regenerate them whenever the command registry changes; the release workflow rejects a tarball that does not include both files.
package/dist/index.js CHANGED
@@ -22243,57 +22243,13 @@ async function createSupplierFromPayload(raw) {
22243
22243
  }
22244
22244
  async function updateSupplierFromPayload(raw) {
22245
22245
  const input2 = parseSupplierUpdatePayload(raw);
22246
- const updated = await api2.supplier.updateSupplier.mutate(input2);
22247
- const supplier = updated.result;
22248
- if (supplier.status !== "PENDING_APPROVAL") {
22249
- out(updated);
22250
- return;
22251
- }
22252
22246
  await assertSensitiveWorkflowConfirmed({
22253
- action: "Create supplier approval request",
22254
- entity: `supplier ${supplier.id}`,
22255
- details: "and send approval request emails"
22256
- });
22257
- let approvalResult;
22258
- try {
22259
- const approval = await api2.supplier.createSupplierApproval.mutate({
22260
- supplierId: supplier.id
22261
- });
22262
- const approvalIds = (approval.results ?? []).map((item) => ({
22263
- id: item.id
22264
- }));
22265
- if (approvalIds.length === 0) {
22266
- approvalResult = {
22267
- requested: true,
22268
- approvalCount: 0,
22269
- email: createApprovalEmailDeliveryFailure("No approval ids returned")
22270
- };
22271
- } else {
22272
- try {
22273
- const delivery = approval.emailDelivery;
22274
- approvalResult = {
22275
- requested: true,
22276
- approvalCount: approvalIds.length,
22277
- email: createApprovalEmailDeliveryReport(delivery)
22278
- };
22279
- } catch (error61) {
22280
- approvalResult = {
22281
- requested: true,
22282
- approvalCount: approvalIds.length,
22283
- email: createApprovalEmailDeliveryFailure(error61 instanceof Error ? error61.message : String(error61))
22284
- };
22285
- }
22286
- }
22287
- } catch (error61) {
22288
- approvalResult = {
22289
- requested: false,
22290
- error: error61 instanceof Error ? error61.message : String(error61)
22291
- };
22292
- }
22293
- out({
22294
- ...updated,
22295
- supplierApproval: approvalResult
22247
+ action: "Update supplier",
22248
+ entity: `supplier ${input2.id}`,
22249
+ details: "Normal-user edits also request approval and queue approval emails."
22296
22250
  });
22251
+ const updated = await api2.supplier.updateSupplier.mutate(input2);
22252
+ out(updated);
22297
22253
  }
22298
22254
  async function createItemFromPayload(raw) {
22299
22255
  const input2 = parseItemCreatePayload(raw);
@@ -23970,7 +23926,7 @@ Suppliers & items
23970
23926
  list-suppliers [--name] [--page] [--perPage] [--sortBy createdAt|updatedAt|name|email|phone|gstRegistered|status|active] [--sortDir asc|desc] [--createdBy <csv>] [--gstRegistered true|false] [--status CSV] [--supplierTags <csv>] [--active true|false]
23971
23927
  Defaults: --active true, --perPage 10, --sortBy createdAt, --sortDir desc (same as the web list); pass --active false for archived suppliers.
23972
23928
  create-supplier --payload '<json>' (supplier.createSupplier; auto-requests approval + emails when status is PENDING_APPROVAL)
23973
- update-supplier --payload '<json>' (supplier.updateSupplier; must include id; auto-requests approval + emails when status is PENDING_APPROVAL)
23929
+ update-supplier --payload '<json>' (authenticated; normal-user edits require server-enforced approval)
23974
23930
  delete-suppliers --ids <csv> (supplier.deleteSuppliers; admin; archives/deactivates supplier items)
23975
23931
  reactivate-suppliers --ids <csv> (supplier.reactivateSuppliers; admin; reactivates supplier items)
23976
23932
  create-certification --name (supplier.createCertification)
@@ -23987,7 +23943,7 @@ Suppliers & items
23987
23943
  get-item <id>
23988
23944
  list-item-categories [--page] [--perPage]
23989
23945
  create-item-category --name (admin)
23990
- update-item-category --id --name (admin)
23946
+ update-item-category --id --name (authenticated; applies immediately)
23991
23947
  delete-item-categories --ids <csv> (itemCategory.deleteItemCategories; admin; empty categories only)
23992
23948
 
23993
23949
  Dashboard & users
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@go-labs-sg/bb",
3
- "version": "2.25.0",
3
+ "version": "2.27.0",
4
4
  "description": "Budget Builder CLI for AI agents — manage budgets, bills, claims, quotations, and customer invoices with explicit workflow previews for sensitive changes.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -93,6 +93,7 @@ This table highlights the role-sensitive command groups an agent is most likely
93
93
  | Budget/project mutations, estimates, and budget attachments | `ADMIN`, budget creator, or project assignment as Business Development, Inside Sales, or Project Manager, depending on the endpoint. |
94
94
  | `bb budget item exception approve` | `LEAD` or `ADMIN`; requires an unavailable line and a specific audited reason. |
95
95
  | `bb project hub status`, `bb project hub setup`, and `bb project hub sync` | `ADMIN`, project creator, or project assignment as Business Development, Inside Sales, or Project Manager. Setup and sync also enforce Project Hub lifecycle/readiness checks. |
96
+ | `bb supplier update`, `bb item update`, `bb item category update` | Any active authenticated role. Normal-user supplier edits are submitted for approval by the shared API; item/category edits apply immediately. Human review and provider synchronization can temporarily block further supplier edits/new usage. |
96
97
  | Edit/delete a bill or quotation | Usually creator or `ADMIN`, with a supported status. |
97
98
  | `bb budget approve`, `bb budget reject`, `bb supplier approve`, and `bb supplier reject` | Current user must be the pending approver and currently have role `LEAD` or `ADMIN`. |
98
99
  | `bb bill approve` and `bb bill reject` | Current user must be the pending approver and currently have role `ACCOUNTING_TEAM` for the finance/check stage or `ADMIN` for the final approval stage. |
@@ -103,7 +104,7 @@ This table highlights the role-sensitive command groups an agent is most likely
103
104
  | `bb customer-invoice approve` and `bb customer-invoice reject` | `ADMIN` batch operations selected by batch ID; the API resolves the internal pending Admin approval record. |
104
105
  | `bb customer-invoice pdf download` | `ADMIN` for pending-approval batches; other roles may download after pending approval. QuickBooks sync errors cannot be previewed or downloaded. |
105
106
  | Dashboard/performance, supplier analytics, errors, integration operations | `ADMIN`. |
106
- | `bb item category create`, `bb item category update`, `bb item category delete`, `bb supplier delete`, `bb supplier reactivate`, and `bb budget item placeholder-bill create` | `ADMIN`. |
107
+ | `bb item category create`, `bb item category delete`, `bb supplier delete`, `bb supplier reactivate`, and `bb budget item placeholder-bill create` | `ADMIN`. |
107
108
 
108
109
  ## Command-selection rules
109
110