@go-labs-sg/bb 2.17.0 → 2.18.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 +7 -5
- package/command-manifest.json +96 -1
- package/command-reference.md +17 -1
- package/dist/commands.js +12 -1
- package/dist/index.js +36 -7
- package/dist/parse-mutation-payload.js +7 -0
- package/dist/registry/index.js +12 -0
- package/package.json +1 -1
- package/role-aware-agent-guide.md +3 -1
package/README.md
CHANGED
|
@@ -193,11 +193,13 @@ Every canonical command is classified by effect: `state-change`, `email`, `exter
|
|
|
193
193
|
|
|
194
194
|
**Locked estimate budget changes:** Legacy flat commands retain their additional interactive `yes` prompt when the current budget is locked. Canonical v2 commands use the single effect-aware confirmation gate; non-interactive execution requires `--allow-state-change` plus any other effects declared for that command.
|
|
195
195
|
|
|
196
|
-
**Mutations with `--payload`:** Commands such as `bb budget create`, `bb bill create`, and `bb supplier update` take a single JSON object (`--payload '<json>'`) matching the corresponding tRPC procedure input. Use ISO strings for date/datetime fields; the CLI coerces them where needed. The API still validates the full shape. Plain `description` fields for item create/update are converted to `descriptionRichText`; pass `descriptionRichText` directly when formatted Tiptap JSON is required. For **`bb project update`**, the project window is `dateRange.from` and `dateRange.to` (optional end); there are no separate event-date fields on the project payload. **`bb budget create` / `bb budget update`** do not accept `asanaTaskId`; configure the deal card on the project (`bb project update` / project settings).
|
|
196
|
+
**Mutations with `--payload`:** Commands such as `bb budget create`, `bb bill create`, and `bb supplier update` take a single JSON object (`--payload '<json>'`) matching the corresponding tRPC procedure input. Use ISO strings for date/datetime fields; the CLI coerces them where needed. The API still validates the full shape. Plain `description` fields for item create/update are converted to `descriptionRichText`; pass `descriptionRichText` directly when formatted Tiptap JSON is required. For **`bb project update`**, the project window is `dateRange.from` and `dateRange.to` (optional end); there are no separate event-date fields on the project payload. **`bb budget create` / `bb budget update`** do not accept `asanaTaskId`; configure the deal card on the project (`bb project update` / project settings). When `bb budget create` clones a `sourceBudgetId` containing unavailable catalogue lines, the API preserves those snapshots for review and rejects the clone until the caller explicitly sets `unavailableItemReviewAcknowledged: true`.
|
|
197
|
+
|
|
198
|
+
**Unavailable catalogue lines:** Budget Builder-only `bb item archive --ids <csv>` may retire catalogue items referenced by open estimates. The estimate snapshots remain intact, but sending or accepting is blocked until each unavailable line is resolved with `bb budget item replace --budgetItemId <id> --replacementItemId <active-item-id>`, `bb budget item remove <id>`, or the Lead/Admin-only `bb budget item exception approve --budgetItemId <id> --reason <text>`. The approved-exception reason is audited. `bb item delete <id>` also attempts QuickBooks deactivation and therefore remains blocked while an open estimate references the item.
|
|
197
199
|
|
|
198
200
|
**Contact-person estimate email:** `bb budget estimate send --payload '<json>'` calls the same `email.sendEstimateToContactPerson` procedure as the web composer. The payload requires `budgetId`, `estimateId`, optional `estimateDocNumber`, `to`, `cc`, `replyTo`, `subject`, HTML `content`, and HTML `signature`. It durably queues worker delivery of the QuickBooks PDF, standard terms, and Budget Builder budget attachments, and returns the outbound-email and operation IDs immediately. Worker retries reuse one provider idempotency key; the budget becomes `ESTIMATE_SENT` only after Resend accepts the email. The command requires interactive `CONFIRM`; inspect the budget, recipients, and HTML first.
|
|
199
201
|
|
|
200
|
-
**Customer-invoice workflow parity:** `bb customer-invoice list` uses the same global/project list procedure and metrics as the web pages; omit filters for the global list or use `--projectId` for project scope. `bb customer-invoice send` uses the same protected email workflow as the web composer
|
|
202
|
+
**Customer-invoice workflow parity:** `bb customer-invoice list` uses the same global/project list procedure and metrics as the web pages; omit filters for the global list or use `--projectId` for project scope. `bb customer-invoice send --payload '<json>'` uses the same protected email workflow as the web composer, sends to the payload's `to` address, saves that address as the project's configured billing email after a successful send, and marks the invoice `SENT`. `bb customer-invoice approve` and `bb customer-invoice reject` are Admin-only batch operations: callers select a batch ID, and the API resolves its internal pending Admin approval record. `bb customer-invoice sync` follows QuickBooks' paid state and zero balance, restoring `SENT` or `APPROVED` if that payment is reversed. Invoice approval refuses voided invoices and closes the estimate only when approved invoice coverage totals 100%; deletion, voiding, rejection, expiry, and QBO synchronization use the same estimate-reopening and live-payment guards as the web app.
|
|
201
203
|
|
|
202
204
|
For agent-driven invoice work, use this read-before-write sequence:
|
|
203
205
|
|
|
@@ -233,14 +235,14 @@ Project and budget query payloads keep the Asana identities explicit: `asanaTask
|
|
|
233
235
|
|
|
234
236
|
| Area | Legacy handler labels (reference only; non-exhaustive) |
|
|
235
237
|
| --- | --- |
|
|
236
|
-
| **Budgets** | `list-budgets` (full payload by default; `--summary` or `--includeDetails false` for slim list), `get-budget`, `get-budget-items`, `get-budget-details`, `get-budget-categories`, `get-budget-versions`, `rename-budget-version`, `restore-budget-version`, `update-budget-status` (`ESTIMATE_ACCEPTED` requires win proof, auto-marks `PITCH` or `LOST` projects `WON`, and auto-creates an Asana Event Ops section from Prompt 5 tasks when enabled; Prompt 5 skips quantity-zero items, combines matching non-GO-internal suppliers, keeps each GO internal item separate, removes generated work that repeats another line item or group, and schedules applicable subtasks relative to the project start date; `--projectStatusOnCommercialRejection PITCH\|LOST` is required when rejecting the only accepted/closed budget on a commercial project), `mark-budget-won` (`<budgetId>` + proof file path; `PITCH` or `LOST` projects become `WON` automatically), `create-budget` / `update-budget` (`--payload`), `delete-budget`, `create-budget-approval` (also sends approval request emails), `create-estimate`, `send-estimate-to-contact-person` (same contact-person email workflow as web), `add-budget-items`, `update-budget-item`, `remove-budget-item`, `reorder-budget-items`, `update-budget-item-supplier`, `mark-budget-items-not-utilized`, `restore-budget-item`, `create-placeholder-bill` (admin recovery), `create-budget-category`, `update-budget-category`, `delete-budget-category`, `update-budget-commission`, `delete-budget-commission`, `update-budget-discount`, `delete-budget-discount` (`--payload` where noted), `upload-budget-attachment` (`<budgetId>` + local file path; uses `attachment.requestBudgetAttachmentUpload` + PUT + `attachment.confirmBudgetAttachment`) |
|
|
237
|
-
| **Bills / claims** | `list-bills` (`--isClaimable false` for bills, `--isClaimable true` for claims, omit for both), `list-claims` (claims only), `validate-bill-selection` (`--payload`;
|
|
238
|
+
| **Budgets** | `list-budgets` (full payload by default; `--summary` or `--includeDetails false` for slim list), `get-budget`, `get-budget-items`, `get-budget-details`, `get-budget-categories`, `get-budget-versions`, `rename-budget-version`, `restore-budget-version`, `update-budget-status` (`ESTIMATE_ACCEPTED` requires win proof, auto-marks `PITCH` or `LOST` projects `WON`, and auto-creates an Asana Event Ops section from Prompt 5 tasks when enabled; Prompt 5 skips quantity-zero items, combines matching non-GO-internal suppliers, keeps each GO internal item separate, removes generated work that repeats another line item or group, and schedules applicable subtasks relative to the project start date; `--projectStatusOnCommercialRejection PITCH\|LOST` is required when rejecting the only accepted/closed budget on a commercial project), `mark-budget-won` (`<budgetId>` + proof file path; `PITCH` or `LOST` projects become `WON` automatically), `create-budget` / `update-budget` (`--payload`; cloned unavailable lines require `unavailableItemReviewAcknowledged: true`), `delete-budget`, `create-budget-approval` (also sends approval request emails), `create-estimate`, `send-estimate-to-contact-person` (same contact-person email workflow as web), `add-budget-items`, `update-budget-item`, `replace-budget-item`, `approve-unavailable-item-exception` (Lead/Admin), `remove-budget-item`, `reorder-budget-items`, `update-budget-item-supplier`, `mark-budget-items-not-utilized`, `restore-budget-item`, `create-placeholder-bill` (admin recovery), `create-budget-category`, `update-budget-category`, `delete-budget-category`, `update-budget-commission`, `delete-budget-commission`, `update-budget-discount`, `delete-budget-discount` (`--payload` where noted), `upload-budget-attachment` (`<budgetId>` + local file path; uses `attachment.requestBudgetAttachmentUpload` + PUT + `attachment.confirmBudgetAttachment`) |
|
|
239
|
+
| **Bills / claims** | `list-bills` (`--isClaimable false` for bills, `--isClaimable true` for claims, omit for both), `list-claims` (claims only), `validate-bill-selection` (`--payload`; validates the project and supplier separately, then checks approved quotation links for each selected budget line item independent of the bill supplier; `alreadyPaid` never bypasses the checks), `stage-bill-attachment` (securely uploads invoice/payment-proof files before creation and returns attachment JSON; ownership and one-hour expiry are enforced by a server-side staged-upload record rather than encoded in the object key), `cleanup-staged-bill-attachments`, `create-bill` (`--payload`; set `isClaimable=false` for a bill, `isClaimable=true` for a claim; supplier bills require positive `extractedAmount` and `amount`, with `amount <= extractedAmount`; an already-paid supplier bill sets `alreadyPaid=true` and requires `paymentReference` plus a staged PDF in `paymentProofAttachments`; admin creation automatically queues QBO finalization while other roles remain pending approval; non-legacy supplier bills from 1 Jul 2026 00:00 SGT require approved quotation coverage linked to every selected line item, independent of the bill supplier, even when already paid), `update-bill` (`--payload`), `update-bill-payment-evidence` (`--payload`; replaces the payment reference and payment-proof PDFs for an already-paid bill), `delete-bill`, `create-bill-approval` (also sends approval request emails), `update-bill-status` (`PAID` requires `--paymentReference`; pass `--paymentProof <receipt.pdf>` to stage and submit a PDF up to 20MB atomically, or omit it only when BB already has payment proof; moving to `PAID` runs the server's paid-bill notification workflow), `patch-bill-payment` (PAID bills: `--paymentTrackingUrl`, `--paymentReference`, `--quickbooksBillId`, `--paymentDate` ISO; clearing a paid bill's QuickBooks link is not allowed), `patch-bill-invoice-number`, `get-bill-attachments`, `upload-bill-attachment` (`<billId>` + local path), `get-bill-details` |
|
|
238
240
|
| **Quotations** | `list-quotations` (supports project, budget, supplier, status, requester, and text-search filters), `get-quotation`, `upload-quotation-attachment` (`<projectId>` + PDF/JPEG/PNG path up to 20MB; returns attachment JSON for payload use), `cleanup-staged-quotation-attachments`, `create-quotation` (`--payload` for `quotation.createDraft`; include `amountWithoutGst` and `gstAmount`), `update-quotation` (`--payload`; updates a `DRAFT` or `REJECTED` quotation), `delete-quotation`, `submit-quotation`, `approve-quotation`, `reject-quotation`, `download-quotation-pdf` (`original`, `staff`, or `final`) |
|
|
239
241
|
| **Customer invoices** | `check-customer-invoice-readiness`, `list-eligible-customer-invoice-budgets`, `list-customer-invoices` (global/project/budget filters plus summary metrics), `get-customer-invoice`, `get-customer-invoice-email-context`, `create-customer-invoice`, `discard-customer-invoice`, `delete-customer-invoice`, `void-customer-invoice`, `approve-customer-invoice` (admin), `reject-customer-invoice` (admin), `send-customer-invoice-to-contact-person`, `download-customer-invoice-pdf` (non-admins cannot download while approval is pending), `sync-customer-invoice` |
|
|
240
242
|
| **Approvals** | `list-approvals` / `get-pending-approvals` (`--type budget\|supplier\|bill\|quotation\|customer_invoice\|all`), `approve-bill` / `reject-bill` (send reply email), `approve-budget` / `reject-budget` (send reply email), `approve-supplier` / `reject-supplier` (send reply email), `approve-quotation` / `reject-quotation`, `approve-customer-invoice` / `reject-customer-invoice` |
|
|
241
243
|
| **Companies & projects** | `list-companies`, `get-company`, `create-company`, `update-company` (`--payload`), `delete-company`, `list-projects`, `get-project` (its budget overview returns `totalRevenue`, calculated only from Estimate Accepted and Estimate Closed budgets), `get-project-hub-status`, `setup-project-hub`, `sync-project-hub-commercial-documents`, `create-project` (required: `--name`, `--companyId`, `--contactPersonId`, `--insideSalesId`, `--businessDevelopmentId`, `--venue`, `--startDate` as ISO datetime for project/window start; when `--asanaTaskId` is omitted, the CLI searches open Asana lead tasks in the Deals project, prompts for one of the top five matches, and resolves Slack channel fields from the selected deal card; optional `--asanaSearch`, `--pax`, `--endDate`, `--description`, `--projectManagerId`; always requests QBO project import like the web app), `update-project` (`--payload` with `dateRange.from` / `dateRange.to` for the project window; optional `projectManagerId` and `requestQboAccountantNotification` in JSON), `delete-project`, `check-project-reconciliation <id>` (runs the web app's live checks without changing status), `reconcile-project <id>` (reruns checks transactionally and marks an eligible project `RECONCILED`), `complete-project <id>` (reruns validation, marks a reconciled project `COMPLETED`, and queues QuickBooks placeholder cleanup), `import-qbo-project`, `update-project-status` (`<id>` `<status>`: `PITCH` \| `WON` \| `COMPLETED` \| `RECONCILED` \| `LOST`; close-out follows `WON` → `RECONCILED` → `COMPLETED`, and reconciliation requires every accepted/closed budget line to have an Approved/Paid bill or claim or be explicitly Not Utilized; marking `COMPLETED` queues deletion of every remaining project placeholder bill from QuickBooks; for `PITCH` → `WON` also pass a Budget Builder user `--projectManagerId` or `--projectManagerEmail`; when marking `WON` without an accepted/closed budget or proof, pass `--wonOverrideReason`) |
|
|
242
244
|
| **Contacts** | `list-contacts`, `create-contact-person` (`--payload`), `update-contact-person` (`--payload`) |
|
|
243
|
-
| **Suppliers & items** | `list-suppliers` (defaults to active suppliers, `--perPage 10`, sorted by `createdAt` desc; supports `--name`, `--sortBy` for scalar supplier fields, `--sortDir`, `--createdBy`, `--gstRegistered`, `--status`, `--supplierTags`, `--active false` for archived suppliers), `create-supplier` (`--payload`; when supplier status is `PENDING_APPROVAL`, also runs `supplier.createSupplierApproval` and `email.sendSupplierApprovalRequestEmail`), `update-supplier` (`--payload`; when supplier status is `PENDING_APPROVAL`, also runs `supplier.createSupplierApproval` and `email.sendSupplierApprovalRequestEmail`), `delete-suppliers` (`--ids` CSV; admin; archives/deactivates related items), `reactivate-suppliers` (`--ids` CSV; admin; reactivates related items), `create-certification` / `create-payment-method` / `create-supplier-role` / `create-supplier-tag` (`--name`), `get-supplier-details` (includes `supplierApprovalSummary` for pending approvers, superseded approvers, and the actual responder/respondedAt metadata), `get-supplier-analytics` (admin), `list-items
|
|
245
|
+
| **Suppliers & items** | `list-suppliers` (defaults to active suppliers, `--perPage 10`, sorted by `createdAt` desc; supports `--name`, `--sortBy` for scalar supplier fields, `--sortDir`, `--createdBy`, `--gstRegistered`, `--status`, `--supplierTags`, `--active false` for archived suppliers), `create-supplier` (`--payload`; when supplier status is `PENDING_APPROVAL`, also runs `supplier.createSupplierApproval` and `email.sendSupplierApprovalRequestEmail`), `update-supplier` (`--payload`; when supplier status is `PENDING_APPROVAL`, also runs `supplier.createSupplierApproval` and `email.sendSupplierApprovalRequestEmail`), `delete-suppliers` (`--ids` CSV; admin; archives/deactivates related items), `reactivate-suppliers` (`--ids` CSV; admin; reactivates related items), `create-certification` / `create-payment-method` / `create-supplier-role` / `create-supplier-tag` (`--name`), `get-supplier-details` (includes `supplierApprovalSummary` for pending approvers, superseded approvers, and the actual responder/respondedAt metadata), `get-supplier-analytics` (admin), `list-items` (`--includeQuickBooksDeactivationPending true` discovers interrupted QuickBooks deactivations for Admin retry), `create-item` (`--payload`), `update-item` (`--payload`), `archive-items` (`--ids` CSV, max 100; Budget Builder-only; open estimates retain unavailable snapshot lines for resolution), `delete-item` (admin; archives in Budget Builder and makes the item inactive in QuickBooks; blocked while an open estimate references it), `get-item`, `list-item-categories`, `create-item-category` / `update-item-category` / `delete-item-categories` (admin; `--ids` CSV for delete) |
|
|
244
246
|
| **Dashboard & users** | `whoami` (current API-key owner identity and role), `list-users`, `create-user` (admin; provisions an API-only service identity with no Google sign-in; `--email`, optional `--name`, optional `--role` defaulting to `USER`), `create-api-key` (`--name`; defaults to the caller; admin-only `--userId` for another user; raw key shown once), `list-api-keys` (defaults to the caller; admin-only `--userId` for another user), `revoke-api-key` (key ID; admin-only `--userId` for another user), `get-user-performance`, `get-dashboard`, `get-monthly-metrics`, `get-system-overview`, `get-estimate-performance`, `get-financial-overview` (performance/dashboard commands are admin-only) |
|
|
245
247
|
| **Errors (admin)** | `get-recent-errors`, `get-error-metrics` |
|
|
246
248
|
| **Automation (admin)** | `list-integration-operations`, `retry-integration-operation` (Resend resolution requires `--confirmExternalStateReconciled true` plus `--outboundEmailResolution ACCEPTED\|NOT_ACCEPTED_RETRY`; include `--providerMessageId` when accepted) |
|
package/command-manifest.json
CHANGED
|
@@ -970,6 +970,101 @@
|
|
|
970
970
|
"effects": ["state-change", "delete"],
|
|
971
971
|
"legacyTarget": "remove-budget-item"
|
|
972
972
|
},
|
|
973
|
+
{
|
|
974
|
+
"path": ["budget", "item", "replace"],
|
|
975
|
+
"legacyAliases": ["replace-budget-item", "replace_budget_item"],
|
|
976
|
+
"summary": "Replace Budget Item.",
|
|
977
|
+
"globalOptions": [
|
|
978
|
+
{
|
|
979
|
+
"name": "--help",
|
|
980
|
+
"description": "Show help for this command."
|
|
981
|
+
},
|
|
982
|
+
{
|
|
983
|
+
"name": "--quiet",
|
|
984
|
+
"description": "Suppress non-error diagnostics."
|
|
985
|
+
},
|
|
986
|
+
{
|
|
987
|
+
"name": "--debug",
|
|
988
|
+
"description": "Emit sanitized diagnostic traces."
|
|
989
|
+
},
|
|
990
|
+
{
|
|
991
|
+
"name": "--api-url",
|
|
992
|
+
"description": "Override the Budget Builder API base URL."
|
|
993
|
+
},
|
|
994
|
+
{
|
|
995
|
+
"name": "--allow-state-change",
|
|
996
|
+
"description": "Allow a Budget Builder state change in non-interactive use."
|
|
997
|
+
},
|
|
998
|
+
{
|
|
999
|
+
"name": "--allow-email",
|
|
1000
|
+
"description": "Allow sending email in non-interactive use."
|
|
1001
|
+
},
|
|
1002
|
+
{
|
|
1003
|
+
"name": "--allow-external-write",
|
|
1004
|
+
"description": "Allow writes to external systems in non-interactive use."
|
|
1005
|
+
},
|
|
1006
|
+
{
|
|
1007
|
+
"name": "--allow-delete",
|
|
1008
|
+
"description": "Allow deleting data in non-interactive use."
|
|
1009
|
+
},
|
|
1010
|
+
{
|
|
1011
|
+
"name": "--allow-financial-write",
|
|
1012
|
+
"description": "Allow financial-record changes in non-interactive use."
|
|
1013
|
+
}
|
|
1014
|
+
],
|
|
1015
|
+
"argumentMode": "legacy-passthrough",
|
|
1016
|
+
"effects": ["state-change", "financial-write"],
|
|
1017
|
+
"legacyTarget": "replace-budget-item"
|
|
1018
|
+
},
|
|
1019
|
+
{
|
|
1020
|
+
"path": ["budget", "item", "exception", "approve"],
|
|
1021
|
+
"legacyAliases": [
|
|
1022
|
+
"approve-unavailable-item-exception",
|
|
1023
|
+
"approve_unavailable_item_exception"
|
|
1024
|
+
],
|
|
1025
|
+
"summary": "Approve Unavailable Item Exception.",
|
|
1026
|
+
"globalOptions": [
|
|
1027
|
+
{
|
|
1028
|
+
"name": "--help",
|
|
1029
|
+
"description": "Show help for this command."
|
|
1030
|
+
},
|
|
1031
|
+
{
|
|
1032
|
+
"name": "--quiet",
|
|
1033
|
+
"description": "Suppress non-error diagnostics."
|
|
1034
|
+
},
|
|
1035
|
+
{
|
|
1036
|
+
"name": "--debug",
|
|
1037
|
+
"description": "Emit sanitized diagnostic traces."
|
|
1038
|
+
},
|
|
1039
|
+
{
|
|
1040
|
+
"name": "--api-url",
|
|
1041
|
+
"description": "Override the Budget Builder API base URL."
|
|
1042
|
+
},
|
|
1043
|
+
{
|
|
1044
|
+
"name": "--allow-state-change",
|
|
1045
|
+
"description": "Allow a Budget Builder state change in non-interactive use."
|
|
1046
|
+
},
|
|
1047
|
+
{
|
|
1048
|
+
"name": "--allow-email",
|
|
1049
|
+
"description": "Allow sending email in non-interactive use."
|
|
1050
|
+
},
|
|
1051
|
+
{
|
|
1052
|
+
"name": "--allow-external-write",
|
|
1053
|
+
"description": "Allow writes to external systems in non-interactive use."
|
|
1054
|
+
},
|
|
1055
|
+
{
|
|
1056
|
+
"name": "--allow-delete",
|
|
1057
|
+
"description": "Allow deleting data in non-interactive use."
|
|
1058
|
+
},
|
|
1059
|
+
{
|
|
1060
|
+
"name": "--allow-financial-write",
|
|
1061
|
+
"description": "Allow financial-record changes in non-interactive use."
|
|
1062
|
+
}
|
|
1063
|
+
],
|
|
1064
|
+
"argumentMode": "legacy-passthrough",
|
|
1065
|
+
"effects": ["state-change"],
|
|
1066
|
+
"legacyTarget": "approve-unavailable-item-exception"
|
|
1067
|
+
},
|
|
973
1068
|
{
|
|
974
1069
|
"path": ["budget", "item", "reorder"],
|
|
975
1070
|
"legacyAliases": ["reorder-budget-items", "reorder_budget_items"],
|
|
@@ -3403,7 +3498,7 @@
|
|
|
3403
3498
|
"send-customer-invoice-to-contact-person",
|
|
3404
3499
|
"send_customer_invoice_to_contact_person"
|
|
3405
3500
|
],
|
|
3406
|
-
"summary": "Send
|
|
3501
|
+
"summary": "Send a customer invoice and update the project billing email.",
|
|
3407
3502
|
"globalOptions": [
|
|
3408
3503
|
{
|
|
3409
3504
|
"name": "--help",
|
package/command-reference.md
CHANGED
|
@@ -184,6 +184,22 @@ Legacy aliases: `remove-budget-item`, `remove_budget_item`.
|
|
|
184
184
|
|
|
185
185
|
Effects: state-change, delete.
|
|
186
186
|
|
|
187
|
+
## `bb budget item replace`
|
|
188
|
+
|
|
189
|
+
Replace Budget Item.
|
|
190
|
+
|
|
191
|
+
Legacy aliases: `replace-budget-item`, `replace_budget_item`.
|
|
192
|
+
|
|
193
|
+
Effects: state-change, financial-write.
|
|
194
|
+
|
|
195
|
+
## `bb budget item exception approve`
|
|
196
|
+
|
|
197
|
+
Approve Unavailable Item Exception.
|
|
198
|
+
|
|
199
|
+
Legacy aliases: `approve-unavailable-item-exception`, `approve_unavailable_item_exception`.
|
|
200
|
+
|
|
201
|
+
Effects: state-change.
|
|
202
|
+
|
|
187
203
|
## `bb budget item reorder`
|
|
188
204
|
|
|
189
205
|
Reorder Budget Items.
|
|
@@ -602,7 +618,7 @@ Effects: state-change, email, external-write, financial-write.
|
|
|
602
618
|
|
|
603
619
|
## `bb customer-invoice send`
|
|
604
620
|
|
|
605
|
-
Send
|
|
621
|
+
Send a customer invoice and update the project billing email.
|
|
606
622
|
|
|
607
623
|
Legacy aliases: `send-customer-invoice-to-contact-person`, `send_customer_invoice_to_contact_person`.
|
|
608
624
|
|
package/dist/commands.js
CHANGED
|
@@ -1037,6 +1037,16 @@ export async function removeBudgetItem(budgetItemId) {
|
|
|
1037
1037
|
});
|
|
1038
1038
|
out(result);
|
|
1039
1039
|
}
|
|
1040
|
+
export const replaceBudgetItem = async (input) => {
|
|
1041
|
+
await confirmLockedBudgetChangeByBudgetItemId(input.budgetItemId, "Replace unavailable budget item");
|
|
1042
|
+
const result = await api.budgetItem.replaceBudgetItem.mutate(input);
|
|
1043
|
+
out(result);
|
|
1044
|
+
};
|
|
1045
|
+
export const approveUnavailableItemException = async (input) => {
|
|
1046
|
+
await confirmLockedBudgetChangeByBudgetItemId(input.budgetItemId, "Approve unavailable item exception");
|
|
1047
|
+
const result = await api.budgetItem.approveUnavailableItemException.mutate(input);
|
|
1048
|
+
out(result);
|
|
1049
|
+
};
|
|
1040
1050
|
export async function getBudgetCategories() {
|
|
1041
1051
|
const categories = await api.budget.getBudgetCategories.query();
|
|
1042
1052
|
out(categories);
|
|
@@ -1425,7 +1435,7 @@ export const syncCustomerInvoice = async (invoiceId) => {
|
|
|
1425
1435
|
});
|
|
1426
1436
|
out(result);
|
|
1427
1437
|
};
|
|
1428
|
-
export const describeCustomerInvoiceEmailConfirmation = (input) => `emails the QBO invoice PDF to ${input.to}; requested CC ${input.cc.length > 0 ? input.cc.join(", ") : "none"}; reply-to ${input.replyTo}; subject "${input.subject}"; server-required admin, creator, business-development, and inside-sales CC recipients are added; success marks the invoice SENT; do not retry blindly after an ambiguous delivery failure`;
|
|
1438
|
+
export const describeCustomerInvoiceEmailConfirmation = (input) => `emails the QBO invoice PDF to ${input.to} and saves that address as the project's billing email; requested CC ${input.cc.length > 0 ? input.cc.join(", ") : "none"}; reply-to ${input.replyTo}; subject "${input.subject}"; server-required admin, creator, business-development, and inside-sales CC recipients are added; success marks the invoice SENT; do not retry blindly after an ambiguous delivery failure`;
|
|
1429
1439
|
export const sendCustomerInvoiceToContactPersonFromPayload = async (raw) => {
|
|
1430
1440
|
const input = parseSendCustomerInvoiceToContactPersonPayload(raw);
|
|
1431
1441
|
await assertSensitiveWorkflowConfirmed({
|
|
@@ -2097,6 +2107,7 @@ export async function listContacts(companyId) {
|
|
|
2097
2107
|
// --- Items ---
|
|
2098
2108
|
export async function listItems(opts) {
|
|
2099
2109
|
const result = await api.item.getItems.query({
|
|
2110
|
+
includeQuickBooksDeactivationPending: opts.includeQuickBooksDeactivationPending,
|
|
2100
2111
|
page: opts.page ?? 1,
|
|
2101
2112
|
perPage: opts.perPage ?? 20,
|
|
2102
2113
|
name: opts.name,
|
package/dist/index.js
CHANGED
|
@@ -5,7 +5,7 @@ import { resolve } from "node:path";
|
|
|
5
5
|
import { fileURLToPath } from "node:url";
|
|
6
6
|
import { BUDGET_BUILDER_API_BASE_URL, configureBudgetBuilderApiBaseUrl, DEFAULT_BUDGET_BUILDER_API_BASE_URL, requireApiKey, } from "./api-client.js";
|
|
7
7
|
import { consumeCliQuietFlags, logCliAction, sanitizeFlagsForTrace, setCliQuiet, shouldLogCliActions, } from "./cli-trace.js";
|
|
8
|
-
import { addBudgetItems, approveBill, approveBudget, approveCustomerInvoice, approveQuotation, approveSupplier, archiveItemsByIds, checkCustomerInvoiceReadiness, checkProjectReconciliation, cleanupStagedBillAttachments, cleanupStagedQuotationAttachments, completeProject, createApiKeyForUser, createBillApproval, createBillFromPayload, createBudgetApproval, createBudgetCategory, createBudgetFromPayload, createCompany, createContactPersonFromPayload, createCustomerInvoice, createEstimate, createInboundSource, createItemCategory, createItemFromPayload, createPlaceholderBillForBudgetItem, createProject, createQuotationFromPayload, createSupplierCertification, createSupplierFromPayload, createSupplierPaymentMethod, createSupplierRoleOption, createSupplierTagOption, createUser, deleteBillById, deleteBudgetById, deleteBudgetCategory, deleteBudgetCommission, deleteBudgetDiscount, deleteCompanyById, deleteCustomerInvoice, deleteItemById, deleteItemCategoriesByIds, deleteProjectById, deleteQuotationById, deleteSuppliersByIds, discardCreatingCustomerInvoice, downloadCustomerInvoicePdf, downloadQuotationPdf, getApprovedBudgets, getBillAttachments, getBillDetails, getBudget, getBudgetCategories, getBudgetCategoryBenchmarks, getBudgetDetails, getBudgetItemsOnly, getBudgetVersions, getCompany, getCustomerInvoice, getCustomerInvoiceEmailContext, getDashboard, getErrorMetrics, getEstimatePerformance, getFinancialOverview, getInboundSource, getInboundSubmission, getItem, getItemPricingHistory, getMonthlyMetrics, getProject, getProjectHubStatus, getQuotationDetails, getRecentErrors, getSupplierAnalytics, getSupplierDetails, getSupplierPricingHistory, getSystemOverview, getUserPerformance, importQuickBooksProjectId, listApiKeysForUser, listApprovals, listBills, listBudgets, listCompanies, listContacts, listCustomerInvoices, listEligibleCustomerInvoiceBudgets, listInboundSources, listInboundSubmissions, listIntegrationOperations, listItemCategories, listItems, listProjectHubs, listProjects, listQuotations, listSuppliers, listUsers, markBudgetWonWithProof, patchBillInvoiceNumber, patchBillPayment, reactivateSuppliersByIds, reconcileProject, rejectBill, rejectBudget, rejectCustomerInvoice, rejectQuotation, rejectSupplier, removeBudgetItem, renameBudgetVersion, reorderBudgetItemsCli, restoreBudgetVersion, retryIntegrationOperation, revokeApiKeyForUser, saveInboundAutomationConfig, saveInboundMappingVersion, sendCustomerInvoiceToContactPersonFromPayload, sendEstimateToContactPersonFromPayload, setBudgetItemsNotUtilized, setupProjectHub, stageBillAttachmentsFromPaths, submitQuotation, syncCustomerInvoice, syncProjectHubCommercialDocuments, updateBillFromPayload, updateBillPaymentEvidenceFromPayload, updateBillStatus, updateBudgetCategory, updateBudgetCommissionFromPayload, updateBudgetDiscountFromPayload, updateBudgetFromPayload, updateBudgetItem, updateBudgetItemSupplierCli, updateBudgetStatus, updateCompanyFromPayload, updateContactPersonFromPayload, updateInboundProcessing, updateInboundSource, updateItemCategory, updateItemFromPayload, updateProjectFromPayload, updateProjectStatus, updateQuotationFromPayload, updateSupplierFromPayload, uploadBillAttachmentFromPath, uploadBillAttachmentsFromPaths, uploadBillDocumentsFromPaths, uploadBudgetAttachmentFromPath, uploadQuotationAttachmentFromPath, validateBillSelectionFromPayload, voidCustomerInvoice, whoAmI, } from "./commands.js";
|
|
8
|
+
import { addBudgetItems, approveBill, approveBudget, approveCustomerInvoice, approveQuotation, approveSupplier, approveUnavailableItemException, archiveItemsByIds, checkCustomerInvoiceReadiness, checkProjectReconciliation, cleanupStagedBillAttachments, cleanupStagedQuotationAttachments, completeProject, createApiKeyForUser, createBillApproval, createBillFromPayload, createBudgetApproval, createBudgetCategory, createBudgetFromPayload, createCompany, createContactPersonFromPayload, createCustomerInvoice, createEstimate, createInboundSource, createItemCategory, createItemFromPayload, createPlaceholderBillForBudgetItem, createProject, createQuotationFromPayload, createSupplierCertification, createSupplierFromPayload, createSupplierPaymentMethod, createSupplierRoleOption, createSupplierTagOption, createUser, deleteBillById, deleteBudgetById, deleteBudgetCategory, deleteBudgetCommission, deleteBudgetDiscount, deleteCompanyById, deleteCustomerInvoice, deleteItemById, deleteItemCategoriesByIds, deleteProjectById, deleteQuotationById, deleteSuppliersByIds, discardCreatingCustomerInvoice, downloadCustomerInvoicePdf, downloadQuotationPdf, getApprovedBudgets, getBillAttachments, getBillDetails, getBudget, getBudgetCategories, getBudgetCategoryBenchmarks, getBudgetDetails, getBudgetItemsOnly, getBudgetVersions, getCompany, getCustomerInvoice, getCustomerInvoiceEmailContext, getDashboard, getErrorMetrics, getEstimatePerformance, getFinancialOverview, getInboundSource, getInboundSubmission, getItem, getItemPricingHistory, getMonthlyMetrics, getProject, getProjectHubStatus, getQuotationDetails, getRecentErrors, getSupplierAnalytics, getSupplierDetails, getSupplierPricingHistory, getSystemOverview, getUserPerformance, importQuickBooksProjectId, listApiKeysForUser, listApprovals, listBills, listBudgets, listCompanies, listContacts, listCustomerInvoices, listEligibleCustomerInvoiceBudgets, listInboundSources, listInboundSubmissions, listIntegrationOperations, listItemCategories, listItems, listProjectHubs, listProjects, listQuotations, listSuppliers, listUsers, markBudgetWonWithProof, patchBillInvoiceNumber, patchBillPayment, reactivateSuppliersByIds, reconcileProject, rejectBill, rejectBudget, rejectCustomerInvoice, rejectQuotation, rejectSupplier, removeBudgetItem, renameBudgetVersion, reorderBudgetItemsCli, replaceBudgetItem, restoreBudgetVersion, retryIntegrationOperation, revokeApiKeyForUser, saveInboundAutomationConfig, saveInboundMappingVersion, sendCustomerInvoiceToContactPersonFromPayload, sendEstimateToContactPersonFromPayload, setBudgetItemsNotUtilized, setupProjectHub, stageBillAttachmentsFromPaths, submitQuotation, syncCustomerInvoice, syncProjectHubCommercialDocuments, updateBillFromPayload, updateBillPaymentEvidenceFromPayload, updateBillStatus, updateBudgetCategory, updateBudgetCommissionFromPayload, updateBudgetDiscountFromPayload, updateBudgetFromPayload, updateBudgetItem, updateBudgetItemSupplierCli, updateBudgetStatus, updateCompanyFromPayload, updateContactPersonFromPayload, updateInboundProcessing, updateInboundSource, updateItemCategory, updateItemFromPayload, updateProjectFromPayload, updateProjectStatus, updateQuotationFromPayload, updateSupplierFromPayload, uploadBillAttachmentFromPath, uploadBillAttachmentsFromPaths, uploadBillDocumentsFromPaths, uploadBudgetAttachmentFromPath, uploadQuotationAttachmentFromPath, validateBillSelectionFromPayload, voidCustomerInvoice, whoAmI, } from "./commands.js";
|
|
9
9
|
import { getFlag, parseArgs } from "./parse-args.js";
|
|
10
10
|
import { billStatusesForUpdateHelp, budgetStatusesForHelp, isBudgetStatusUpdate, parseApprovalTypeFlag, parseBillStatusForUpdate, parseCommaSeparatedBillStatuses, parseCommaSeparatedBudgetStatuses, parseCommaSeparatedCustomerInvoiceStatuses, parseCommaSeparatedIds, parseCommaSeparatedIntegrationOperationStatuses, parseCommaSeparatedProjectStatuses, parseCommaSeparatedQuotationStatuses, parseCommaSeparatedSupplierStatuses, parseOptionalBillListSortBy, parseOptionalBillListSortDir, parseOptionalDashboardRole, parseOptionalDeals, parseOptionalErrorSeverity, parseOptionalErrorStatus, parseOptionalExtendedProjectStatus, parseOptionalFinancialRole, parseOptionalProjectHubSortBy, parseOptionalSupplierAnalyticsTimeFrame, parseOptionalTimeFrame, parseProjectStatusForUpdate, parseUserRole, projectStatusesForHelp, userRolesForHelp, } from "./parse-cli-enums.js";
|
|
11
11
|
import { parseJsonFlag, parseOptionalNumber as parseOptNum, } from "./parse-json-flag.js";
|
|
@@ -173,7 +173,7 @@ Budgets
|
|
|
173
173
|
ESTIMATE_REJECTED requires --projectStatusOnCommercialRejection when rejecting the only accepted/closed budget on a commercial project.
|
|
174
174
|
status: ${budgetStatusesForHelp.join(", ")}
|
|
175
175
|
mark-budget-won <budgetId> <filePath> [--projectManagerId <id>] [--invoiceSettings <json>] Upload signed quote/PO proof and set status to ESTIMATE_ACCEPTED; first acceptance requires invoice settings when customer invoicing is enabled
|
|
176
|
-
create-budget --payload '<json>' (budget.createBudget;
|
|
176
|
+
create-budget --payload '<json>' (budget.createBudget; when sourceBudgetId contains unavailable items, set unavailableItemReviewAcknowledged=true after explicit review)
|
|
177
177
|
update-budget --payload '<json>' (budget.updateBudget; must include id)
|
|
178
178
|
delete-budget <budgetId>
|
|
179
179
|
create-budget-approval <budgetId> (also sends approval request emails)
|
|
@@ -182,6 +182,8 @@ Budgets
|
|
|
182
182
|
add-budget-items --budgetId --items '[{"itemId":"…","quantity":1,"markup":30},…]'
|
|
183
183
|
update-budget-item --id <budgetItemId> [--description plain-text] [--note plain-text] [--quantity] [--markup] [--cost] [--unitPrice] [--isFreeOfCharge true|false] [--gstInclusive true|false] [--gstOutOfScope true|false]
|
|
184
184
|
remove-budget-item <budgetItemId>
|
|
185
|
+
replace-budget-item --budgetItemId <id> --replacementItemId <activeCatalogueItemId>
|
|
186
|
+
approve-unavailable-item-exception --budgetItemId <id> --reason <text> Lead/Admin only; reason must be 5-1000 characters.
|
|
185
187
|
reorder-budget-items <budgetId> --itemIds <csv>
|
|
186
188
|
update-budget-item-supplier --budgetItemId --supplierId
|
|
187
189
|
create-budget-category --name <text>
|
|
@@ -200,10 +202,10 @@ Bills
|
|
|
200
202
|
list-bills [--projectId] [--budgetId] [--status CSV] [--search <text>] [--isClaimable true|false] [--createdByIds <csv>] [--sortBy createdAt|amount|status] [--sortDir asc|desc] [--page] [--pageSize]
|
|
201
203
|
list-claims same flags as list-bills; only reimbursable claims (ignores --isClaimable)
|
|
202
204
|
isClaimable differentiates the shared bill/claim records: false = bill, true = claim.
|
|
203
|
-
|
|
205
|
+
Non-legacy supplier bills from 1 Jul 2026 00:00 SGT require approved quotation coverage linked to every selected line item, independent of the bill supplier, including already-paid bills.
|
|
204
206
|
create-bill-approval <billId> (also sends approval request emails)
|
|
205
207
|
create-bill --payload '<json>' (bill.create; payload.isClaimable false = bill, true = claim)
|
|
206
|
-
validate-bill-selection --payload '<json>' Check
|
|
208
|
+
validate-bill-selection --payload '<json>' Check project and supplier validity separately, then verify approved quotation links for each budgetItemId; alreadyPaid never bypasses quotation checks.
|
|
207
209
|
stage-bill-attachment <projectId> <filePath...> [--file <path>] [--files <csv>] Upload files before create-bill; returns attachment JSON for attachments/paymentProofAttachments
|
|
208
210
|
cleanup-staged-bill-attachments <projectId> --keys <csv> Delete unattached staged bill/claim uploads.
|
|
209
211
|
update-bill --payload '<json>' (bill.update; must include id)
|
|
@@ -305,11 +307,11 @@ Suppliers & items
|
|
|
305
307
|
create-supplier-tag --name (supplier.createSupplierTag)
|
|
306
308
|
create-item --payload '<json>' (item.createItem)
|
|
307
309
|
update-item --payload '<json>' (item.updateItem; must include id)
|
|
308
|
-
archive-items --ids <csv> (item.archiveItems; Budget Builder only; max 100; users can archive their own items, leads/admins any item;
|
|
309
|
-
delete-item <id> (item.deleteItem; admin; archives in Budget Builder and makes the item inactive in QuickBooks)
|
|
310
|
+
archive-items --ids <csv> (item.archiveItems; Budget Builder only; max 100; users can archive their own items, leads/admins any item; open estimates retain snapshot lines and require resolution before send/acceptance)
|
|
311
|
+
delete-item <id> (item.deleteItem; admin; archives in Budget Builder and makes the item inactive in QuickBooks; blocked while used by an open estimate)
|
|
310
312
|
get-supplier-details <supplierId>
|
|
311
313
|
get-supplier-analytics [--name] [--page] [--perPage] [--timeFrame ALL|LAST_YEAR|…] (admin)
|
|
312
|
-
list-items [--name] [--page] [--perPage]
|
|
314
|
+
list-items [--name] [--page] [--perPage] [--includeQuickBooksDeactivationPending true]
|
|
313
315
|
get-item <id>
|
|
314
316
|
list-item-categories [--page] [--perPage]
|
|
315
317
|
create-item-category --name (admin)
|
|
@@ -845,6 +847,30 @@ export async function runCli(argv = process.argv, runtime = createProcessRuntime
|
|
|
845
847
|
await removeBudgetItem(id);
|
|
846
848
|
break;
|
|
847
849
|
}
|
|
850
|
+
case "replace-budget-item": {
|
|
851
|
+
const budgetItemId = getFlag(flags, "budgetItemId");
|
|
852
|
+
const replacementItemId = getFlag(flags, "replacementItemId");
|
|
853
|
+
if (!budgetItemId || !replacementItemId) {
|
|
854
|
+
throw new Error("replace-budget-item requires --budgetItemId and --replacementItemId");
|
|
855
|
+
}
|
|
856
|
+
await replaceBudgetItem({
|
|
857
|
+
budgetItemId: String(budgetItemId),
|
|
858
|
+
replacementItemId: String(replacementItemId),
|
|
859
|
+
});
|
|
860
|
+
break;
|
|
861
|
+
}
|
|
862
|
+
case "approve-unavailable-item-exception": {
|
|
863
|
+
const budgetItemId = getFlag(flags, "budgetItemId");
|
|
864
|
+
const reason = getFlag(flags, "reason");
|
|
865
|
+
if (!budgetItemId || !reason) {
|
|
866
|
+
throw new Error("approve-unavailable-item-exception requires --budgetItemId and --reason");
|
|
867
|
+
}
|
|
868
|
+
await approveUnavailableItemException({
|
|
869
|
+
budgetItemId: String(budgetItemId),
|
|
870
|
+
reason: String(reason),
|
|
871
|
+
});
|
|
872
|
+
break;
|
|
873
|
+
}
|
|
848
874
|
case "reorder-budget-items": {
|
|
849
875
|
const budgetId = positional[0];
|
|
850
876
|
const itemIdsRaw = getFlag(flags, "itemIds");
|
|
@@ -1840,6 +1866,9 @@ export async function runCli(argv = process.argv, runtime = createProcessRuntime
|
|
|
1840
1866
|
}
|
|
1841
1867
|
case "list-items": {
|
|
1842
1868
|
await listItems({
|
|
1869
|
+
includeQuickBooksDeactivationPending: flags.includeQuickBooksDeactivationPending === true
|
|
1870
|
+
? true
|
|
1871
|
+
: parseOptionalBoolFlag(flags, "includeQuickBooksDeactivationPending"),
|
|
1843
1872
|
name: getFlag(flags, "name"),
|
|
1844
1873
|
page: parsePositiveIntFlag(getFlag(flags, "page"), "--page"),
|
|
1845
1874
|
perPage: parsePositiveIntFlag(getFlag(flags, "perPage"), "--perPage"),
|
|
@@ -76,6 +76,10 @@ export const parseSendCustomerInvoiceToContactPersonPayload = (raw) => {
|
|
|
76
76
|
/** Matches budget.createBudget — optional pipedriveDealId; Asana deal is project.asanaTaskId. */
|
|
77
77
|
export function parseCreateBudgetPayload(raw) {
|
|
78
78
|
const o = requireObject(raw, "create-budget payload");
|
|
79
|
+
if (o.unavailableItemReviewAcknowledged !== undefined &&
|
|
80
|
+
typeof o.unavailableItemReviewAcknowledged !== "boolean") {
|
|
81
|
+
throw new Error("create-budget payload.unavailableItemReviewAcknowledged must be a boolean when set.");
|
|
82
|
+
}
|
|
79
83
|
return {
|
|
80
84
|
name: requiredString(o.name, "create-budget payload.name"),
|
|
81
85
|
budget: requiredString(o.budget, "create-budget payload.budget"),
|
|
@@ -83,6 +87,9 @@ export function parseCreateBudgetPayload(raw) {
|
|
|
83
87
|
categoryId: requiredString(o.categoryId, "create-budget payload.categoryId"),
|
|
84
88
|
projectId: requiredString(o.projectId, "create-budget payload.projectId"),
|
|
85
89
|
sourceBudgetId: optionalString(o.sourceBudgetId),
|
|
90
|
+
...(o.unavailableItemReviewAcknowledged !== undefined && {
|
|
91
|
+
unavailableItemReviewAcknowledged: o.unavailableItemReviewAcknowledged,
|
|
92
|
+
}),
|
|
86
93
|
pipedriveDealId: optionalString(o.pipedriveDealId),
|
|
87
94
|
};
|
|
88
95
|
}
|
package/dist/registry/index.js
CHANGED
|
@@ -51,6 +51,7 @@ const mutationPrefixes = [
|
|
|
51
51
|
"reconcile-",
|
|
52
52
|
"reject-",
|
|
53
53
|
"remove-",
|
|
54
|
+
"replace-",
|
|
54
55
|
"rename-",
|
|
55
56
|
"reorder-",
|
|
56
57
|
"restore-",
|
|
@@ -149,6 +150,7 @@ const financialWriteTargets = new Set([
|
|
|
149
150
|
"reject-customer-invoice",
|
|
150
151
|
"restore-budget-item",
|
|
151
152
|
"restore-budget-version",
|
|
153
|
+
"replace-budget-item",
|
|
152
154
|
"sync-customer-invoice",
|
|
153
155
|
"update-bill",
|
|
154
156
|
"update-bill-payment-evidence",
|
|
@@ -195,6 +197,9 @@ const summaryFor = (legacyTarget) => {
|
|
|
195
197
|
if (legacyTarget === "download-customer-invoice-pdf") {
|
|
196
198
|
return "Download a customer invoice PDF when permitted.";
|
|
197
199
|
}
|
|
200
|
+
if (legacyTarget === "send-customer-invoice-to-contact-person") {
|
|
201
|
+
return "Send a customer invoice and update the project billing email.";
|
|
202
|
+
}
|
|
198
203
|
if (legacyTarget.startsWith("list-")) {
|
|
199
204
|
return `List ${legacyTarget.slice("list-".length).replaceAll("-", " ")}.`;
|
|
200
205
|
}
|
|
@@ -239,6 +244,13 @@ const registry = [
|
|
|
239
244
|
legacyCommand("add-budget-items", ["budget", "item", "add"]),
|
|
240
245
|
legacyCommand("update-budget-item", ["budget", "item", "update"]),
|
|
241
246
|
legacyCommand("remove-budget-item", ["budget", "item", "remove"]),
|
|
247
|
+
legacyCommand("replace-budget-item", ["budget", "item", "replace"]),
|
|
248
|
+
legacyCommand("approve-unavailable-item-exception", [
|
|
249
|
+
"budget",
|
|
250
|
+
"item",
|
|
251
|
+
"exception",
|
|
252
|
+
"approve",
|
|
253
|
+
]),
|
|
242
254
|
legacyCommand("reorder-budget-items", ["budget", "item", "reorder"]),
|
|
243
255
|
legacyCommand("update-budget-item-supplier", [
|
|
244
256
|
"budget",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@go-labs-sg/bb",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.18.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",
|
|
@@ -53,7 +53,7 @@ Do not treat Inside Sales as Lead or Admin. Budget and supplier decisions still
|
|
|
53
53
|
|
|
54
54
|
### `LEAD`
|
|
55
55
|
|
|
56
|
-
Apply the base resource rules, plus Lead-stage budget and supplier workflows. Lead-created suppliers are auto-approved,
|
|
56
|
+
Apply the base resource rules, plus Lead-stage budget and supplier workflows. Lead-created suppliers are auto-approved, Leads can handle budget/supplier approvals that the API assigns to them, and Leads may approve an audited exception for an unavailable catalogue line after reviewing the exact estimate impact and reason.
|
|
57
57
|
|
|
58
58
|
Do not use Lead credentials for Admin-only dashboards, user/service-identity administration, errors, integration retries, final bill payment, or admin customer-invoice actions.
|
|
59
59
|
|
|
@@ -76,6 +76,7 @@ Admin credentials may perform global and final-control operations, including:
|
|
|
76
76
|
- Cross-user `bb user api-key create`, `bb user api-key list`, and `bb user api-key revoke` with `--userId`.
|
|
77
77
|
- Global dashboard/performance, error-log, and integration-operation commands.
|
|
78
78
|
- Admin-only supplier/category recovery and archive operations.
|
|
79
|
+
- Approving audited unavailable-item exceptions after confirming that replacement or removal is not appropriate.
|
|
79
80
|
- Final bill approval/payment and Admin customer-invoice decisions/payment.
|
|
80
81
|
|
|
81
82
|
Admin is not a force flag. State transitions, evidence, consistency checks, external-operation locks, and interactive confirmation rules still apply.
|
|
@@ -90,6 +91,7 @@ This table highlights the role-sensitive command groups an agent is most likely
|
|
|
90
91
|
| `bb auth whoami`; own `bb user api-key create`, `bb user api-key list`, and `bb user api-key revoke` | Any active role; omit `--userId` to act as the current user. |
|
|
91
92
|
| Cross-user API-key commands; `bb user create` | `ADMIN`. |
|
|
92
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
|
+
| `bb budget item exception approve` | `LEAD` or `ADMIN`; requires an unavailable line and a specific audited reason. |
|
|
93
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. |
|
|
94
96
|
| Edit/delete a bill or quotation | Usually creator or `ADMIN`, with a supported status. |
|
|
95
97
|
| `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`. |
|