@go-labs-sg/bb 2.26.0 → 2.28.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 +6 -0
- package/dist/index.js +8 -51
- package/package.json +1 -1
- package/role-aware-agent-guide.md +2 -1
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.
|
package/dist/index.js
CHANGED
|
@@ -20298,6 +20298,7 @@ function parseCreateBillPayload(raw) {
|
|
|
20298
20298
|
budgetId: requiredString(o.budgetId, "create-bill payload.budgetId"),
|
|
20299
20299
|
projectId: requiredString(o.projectId, "create-bill payload.projectId"),
|
|
20300
20300
|
supplierId: requiredString(o.supplierId, "create-bill payload.supplierId"),
|
|
20301
|
+
quotationId: optionalString(o.quotationId),
|
|
20301
20302
|
amount,
|
|
20302
20303
|
budgetItemIds: budgetItemIds.map((id, i) => requiredString(id, `create-bill payload.budgetItemIds[${i}]`)),
|
|
20303
20304
|
comment: optionalString(o.comment),
|
|
@@ -22243,57 +22244,13 @@ async function createSupplierFromPayload(raw) {
|
|
|
22243
22244
|
}
|
|
22244
22245
|
async function updateSupplierFromPayload(raw) {
|
|
22245
22246
|
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
22247
|
await assertSensitiveWorkflowConfirmed({
|
|
22253
|
-
action: "
|
|
22254
|
-
entity: `supplier ${
|
|
22255
|
-
details: "and
|
|
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
|
|
22248
|
+
action: "Update supplier",
|
|
22249
|
+
entity: `supplier ${input2.id}`,
|
|
22250
|
+
details: "Normal-user edits also request approval and queue approval emails."
|
|
22296
22251
|
});
|
|
22252
|
+
const updated = await api2.supplier.updateSupplier.mutate(input2);
|
|
22253
|
+
out(updated);
|
|
22297
22254
|
}
|
|
22298
22255
|
async function createItemFromPayload(raw) {
|
|
22299
22256
|
const input2 = parseItemCreatePayload(raw);
|
|
@@ -23970,7 +23927,7 @@ Suppliers & items
|
|
|
23970
23927
|
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
23928
|
Defaults: --active true, --perPage 10, --sortBy createdAt, --sortDir desc (same as the web list); pass --active false for archived suppliers.
|
|
23972
23929
|
create-supplier --payload '<json>' (supplier.createSupplier; auto-requests approval + emails when status is PENDING_APPROVAL)
|
|
23973
|
-
update-supplier --payload '<json>' (
|
|
23930
|
+
update-supplier --payload '<json>' (authenticated; normal-user edits require server-enforced approval)
|
|
23974
23931
|
delete-suppliers --ids <csv> (supplier.deleteSuppliers; admin; archives/deactivates supplier items)
|
|
23975
23932
|
reactivate-suppliers --ids <csv> (supplier.reactivateSuppliers; admin; reactivates supplier items)
|
|
23976
23933
|
create-certification --name (supplier.createCertification)
|
|
@@ -23987,7 +23944,7 @@ Suppliers & items
|
|
|
23987
23944
|
get-item <id>
|
|
23988
23945
|
list-item-categories [--page] [--perPage]
|
|
23989
23946
|
create-item-category --name (admin)
|
|
23990
|
-
update-item-category --id --name (
|
|
23947
|
+
update-item-category --id --name (authenticated; applies immediately)
|
|
23991
23948
|
delete-item-categories --ids <csv> (itemCategory.deleteItemCategories; admin; empty categories only)
|
|
23992
23949
|
|
|
23993
23950
|
Dashboard & users
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@go-labs-sg/bb",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.28.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
|
|
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
|
|