@go-labs-sg/bb 3.22.1 → 3.24.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
@@ -80,7 +80,7 @@ Roll out the API and maintained CLI together: `suppliers`/`pageCount` and offset
80
80
 
81
81
  **Customer-invoice readiness and quotation list loading:** `customerInvoice.getInvoiceReadiness`, `getInvoiceAmountPreview`, `getEligibleBudgets` and `getProjectInvoiceReadiness` read the budget through one selected shape (only the budget, project, contact, invoice-settings, discount and item fields the readiness and amount helpers use) with Prisma's default join instead of forced per-relation queries. The quotation list page and metrics reads also use the default join. Their outputs are unchanged.
82
82
 
83
- **Bill item, quotation download and invoice-candidate reads:** `bill.getBudgetItemsForBill` / `getBudgetItemsForProject` rows now carry only the budget-item fields the bill, claim, quotation and line-item screens use: `item { id, catalogueCode }`, `supplier { id, name, gstRegistered, lowerCaseName }` (plus `address` on the project list for supplier verification), `itemCategory { id, name }`, and, on the project list only, `actualSpendings[] { id, amount, supplier }` (the bill list has no spendings). Neither is called by the CLI. `bb quotation pdf download` / `download-quotation-pdf` (`quotation.getSignedDownloadUrl`) returns `attachment { id, name, size, supplierQuotationFileRole }` with the signed `url`, without the internal storage key and row bookkeeping. `bb customer-invoice existing list` / `list-available-qbo-customer-invoices` (`customerInvoice.getExistingInvoiceCandidates`) reads only the budget state and project access fields; its output is unchanged.
83
+ **Bill item, quotation download and invoice-candidate reads:** `bill.getBudgetItemsForBill` / `getBudgetItemsForProject` rows now carry only the budget-item fields the bill, claim, quotation and line-item screens use: `item { id, catalogueCode }`, `supplier { id, name, gstRegistered, lowerCaseName }` (plus `address` on the project list for supplier verification), `itemCategory { id, name }`, and, on the project list only, `actualSpendings[] { id, amount, supplier }` (the bill list has no spendings). Neither is called by the CLI. `bb quotation pdf download` / `download-quotation-pdf` (`quotation.getSignedDownloadUrl`) returns `attachment { id, name, size, supplierQuotationFileRole }` with the signed `url`, without the internal storage key and row bookkeeping. `bb customer-invoice existing list` / `list-available-qbo-customer-invoices` (`customerInvoice.getExistingInvoiceCandidates`) reads only the budget state and project access fields. Each item also carries `requiresEstimateLineageConfirmation` (see [Link an existing QuickBooks invoice](#link-an-existing-quickbooks-invoice)).
84
84
 
85
85
  **Project and item-category list read shapes:** `bb project list` / `bb list-projects` (`project.getAllProjects`) items keep every column the project table, cards and edit dialog use. They drop the deal-automation, calendar, win-override and lost-reason bookkeeping columns. Their relations narrow to `contactPerson { id, displayName, email }`, `company { id, name }`, `createdBy { id, name, email, image }` and `wonBy { id, name }`; `asanaProjectGid`/`asanaProjectUrl` are unchanged. Use `bb get-project <id>` for project details. `bb list-item-categories` rows carry `createdBy { id, name, email, image }` instead of the full user row.
86
86
 
@@ -669,6 +669,29 @@ Authenticate and run `bb auth whoami` first. Preview and import use the same pro
669
669
 
670
670
  Use the **BB budget ID** whose existing estimate should receive the invoice, and the numeric **QBO invoice transaction ID**, not the displayed invoice number or an estimate number. Accepted and closed estimates are supported; linking does not reopen them. Fully invoiced means all estimate coverage has been billed; it does not mean the invoices are fully paid.
671
671
 
672
+ QuickBooks often drops the estimate link on invoices created directly in QBO. Such an unlinked invoice blocks readiness and billing on every budget of its project ("ambiguous estimate lineage") until it is linked to its budget. Budget Builder assigns it on its own only under the existing final-balance rule: an unlinked invoice that completes the estimate's coverage after its earlier invoices, on a project with one accepted estimate or after a native deposit, can still be linked without confirmation. `existing list` marks an unlinked invoice that matches the budget's estimate line by line (the same items, unit prices, tax and a uniform share of every line, discount, GST and total) with `requiresEstimateLineageConfirmation: true` (the final invoice that already completes coverage under the final-balance rule is listed without the mark). After checking which estimate it bills, pass `--confirmEstimateLineage true` (or a bare `--confirmEstimateLineage`) to both `preview-qbo` and `import-qbo`. The preview then reports `estimateLineage: "REVIEWER_CONFIRMED"` and lists:
673
+
674
+ - `alsoMatchesEstimates`: other estimates of the project the invoice also matches. Budget Builder cannot tell these apart; link only after confirming which one it bills.
675
+ - `unresolvedInvoices`: other unlinked invoices that match another estimate of the project line by line, but not this one. They do not stop this link unless one could complete this estimate's coverage (see below), but they keep new billing blocked until each is linked to its budget. They are not counted toward this estimate's allocation, so review them before relying on its coverage.
676
+
677
+ The confirmed preview is refused when:
678
+
679
+ - another estimate held by the budgets of this project or of any project mapped to the same QuickBooks project (archived ones included) has a QuickBooks link to the invoice, at estimate or line level;
680
+ - QuickBooks links an invoice to both this estimate and another one (resolve that in QuickBooks first);
681
+ - one of those estimates cannot be read. A budget whose QuickBooks estimate was deleted blocks reviewed links on its project until its estimate reference is corrected;
682
+ - the project's budgets hold more than 30 other estimates;
683
+ - another unlinked invoice of the project matches neither this estimate nor any other estimate of the project line by line (reconcile it first). This includes the last invoice of a split whose rounding differs from a uniform share of every line: such splits cannot be confirmed and still need manual reconciliation;
684
+ - QuickBooks already links the selected invoice to an estimate (preview it without the flag), or another budget already owns it;
685
+ - an invoice tied to this estimate (linked from either side, at estimate or line level, or carrying this budget's Budget Builder marker) cannot be counted toward its allocation, because it does not match the estimate line by line or belongs to another project, estimate or budget;
686
+ - another invoice could complete this estimate's coverage on its own or with the invoices already linked here, or an uncounted one would complete it together with the selection or with the other invoices counted toward the cap (reconcile that invoice first);
687
+ - the QuickBooks totals of the invoices counted for this estimate would exceed its total by more than one cent;
688
+ - a Budget Builder invoice creation is still in progress anywhere;
689
+ - the selected invoice carries a Budget Builder marker (resolve it through the budget it names, or in QuickBooks).
690
+
691
+ Re-running a link that already exists skips the last five checks.
692
+
693
+ Only a confirmed preview or import checks every estimate held by the project's budgets (an ordinary preview of a final balance still compares it with the other accepted estimates, as before). During a confirmed one, an invoice another estimate claims cannot be taken as this estimate's final balance, and other unlinked invoices that also match this estimate count toward its 100% allocation. Invoices whose own QuickBooks link names another estimate are skipped. Invoices linked only from another estimate's side are neither counted nor listed, but still block this budget's billing until they are linked to that estimate's budget. Previews and imports without the flag behave as before. Once linked, the project's other budgets skip the invoice. Estimates in the same QuickBooks project that no Budget Builder budget holds are not checked.
694
+
672
695
  ```bash
673
696
  bb customer-invoice preview-qbo <budgetId> <qboInvoiceId>
674
697
  bb customer-invoice import-qbo <budgetId> <qboInvoiceId> --token <previewToken>
@@ -737,7 +760,7 @@ Admin/Lead users can run `bb supplier approve <supplierId>` to directly re-appro
737
760
  | **Bills / claims** | `list-bills` (`--isClaimable false` for bills, `--isClaimable true` for claims, omit for both), `list-claims` (claims only), `validate-bill-selection` (`--payload`, plus `--quotationIds q1,q2` or legacy `--quotationId q1`; validates the approved supplier and quotation coverage), `link-bill-quotations` (`<billId> --quotationIds q1,q2`; Admin source-link repair for eligible supplier bills), `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 and provide approved `quotationIds`, or use `--quotation-exempt` for an eligible server-validated exemption; set `isClaimable=true` for a claim without quotations; supplier bills require positive **before-GST** `extractedAmount` (full invoice subtotal) and `amount` (portion billed), with `amount <= extractedAmount`; line and quotation allocation amounts also exclude GST; an already-paid supplier bill sets `alreadyPaid=true` and requires `paymentReference` plus a staged PDF in `paymentProofAttachments`; an Admin's unpaid bill is approved on creation and its QuickBooks bill is created by a queued job (`quickBooksSyncQueued: true`, `operationId`; track it with `list-integration-operations`), an Admin's already-paid bill queues paid-bill finalization, and other roles remain pending approval; the request never writes to QuickBooks), `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` (newest-first cursor pages: `--limit` 1–50, `--cursor`; returns `{ items, pageInfo }`), `upload-bill-attachment` (`<billId>` + local path), `get-bill-details` (the web bill summary: status, amounts, people, payment, line totals), `get-bill-line-items` / `get-bill-approvals` (newest-first cursor pages: `--limit`, `--cursor`; `{ items, pageInfo }`), `get-bill-payment` (payment status, reference, date, tracking URL, QuickBooks link, external payment) |
738
761
  | **Quotations** | `list-quotations` (project, budget, supplier, status, requester and text-search filters; newest-first cursor pages via `--limit` / `--cursor` / `--direction` returning `{ items, pageInfo }`; `--page` / `--perPage` / `--pageSize` are rejected), `count-quotations` (`quotation.getCounts`: filters only, returns `totalCount`, status facets that ignore their own status filter, and `--includeMetrics true` amount metrics), `get-quotation` (web quotation shape), `get-quotation-line-items` (`<quotationId>`; newest-first cursor pages, `--limit 1-100`, `--cursor`), `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`, `gstAmount`, and `lineAmounts` entries `{ budgetItemId, amount }` for multiple selected items; `documentOnly: true` with all amounts `0` creates a $0 supplier document that is never a bill source and does not count as quotation coverage), `update-quotation` (`--payload`; updates a `DRAFT` or `REJECTED` quotation; a full replace, so resend `documentOnly: true` for a document-only quotation), `delete-quotation`, `submit-quotation`, `approve-quotation`, `reject-quotation`, `download-quotation-pdf` (`original`, `staff`, or `final`). PDF work runs in queued jobs, not in the request: `create-quotation` / `update-quotation` queue the upload check and PDF conversion, `submit-quotation` and `approve-quotation` queue the staff-signed and final signed PDFs. `get-quotation` reports `pdfProcessing` (`PROCESSING` or `FAILED`, with the step and error) until the PDF is linked, and `download-quotation-pdf` answers "still processing" meanwhile. `create-quotation`, `update-quotation`, `submit-quotation` and `get-quotation` return `gstMismatch`: `null`, or `{ basis, expectedGstAmount, enteredGstAmount, difference, message }` when a non-zero `gstAmount` is more than $0.05 away from the expected GST. `basis` `TAXABLE_LINES` is the bill calculation for the quoted lines (9% of each in-scope line, rounded per line; none for a non-GST-registered supplier); `FULL_SUBTOTAL` is 9% of `amountWithoutGst`, used when line amounts are unknown. It is a warning only; GST `0` is always accepted |
739
762
  | **Customer invoices** | `check-customer-invoice-readiness`, `list-eligible-customer-invoice-budgets`, `preview-customer-invoice-amount`, `list-available-qbo-customer-invoices`, `list-customer-invoices` (global/project/budget filters; cursor pages via `--limit` / `--cursor` / `--direction` returning `{ items, pageInfo }`, `--page` / `--perPage` rejected; `--sortBy totalInvoiceAmount` sorts provider-confirmed totals including GST, with unknown amounts last), `count-customer-invoices` (`customerInvoice.getCounts`: filters only; `totalCount`, lifecycle status facets that ignore their own status filter, and amount metrics), `get-customer-invoice` (web-shaped batch), `get-customer-invoice-invoices`, `get-customer-invoice-lines`, `get-customer-invoice-approvals`, `get-customer-invoice-history`, `get-customer-invoice-payments` (live QuickBooks payments for one invoice), `get-customer-invoice-email-context`, `preview-qbo-customer-invoice`, `import-qbo-customer-invoice` (BB-only link with reviewed token), `create-customer-invoice`, `resubmit-customer-invoice` (original requester only; one replacement after confirmed expiry voiding; repeated calls return the same replacement), `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), `mark-customer-invoice-sent-externally` (admin; `--sentAt` ISO, `--recipients` comma list, optional `--note`; records an APPROVED invoice as SENT/EXTERNAL, sends no email), `sync-customer-invoice` (status only: QuickBooks edits to bill-to address, memo, bill email or total are held as `qboDetailsDrift` and admins are emailed once per QuickBooks revision), `update-customer-invoice-details` (bill-to address and memo; external QuickBooks write; bill email is managed in QuickBooks), `update-customer-invoice-qbo-drift` (admin; `--resolution ACCEPT_QBO` writes BB only, `KEEP_BB` queues BB's address and memo to QuickBooks) |
740
- | **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; approval and Lead/Admin re-approval queue the QuickBooks vendor sync, and the supplier is usable once it confirms), `approve-quotation` / `reject-quotation`, `approve-customer-invoice` / `reject-customer-invoice` |
763
+ | **Approvals** | `approval list` (`--type budget\|supplier\|bill\|quotation\|customer_invoice\|all`, `--limit`, `--cursor`, `--direction`), `approval get <approvalId>`, `approve-bill` / `reject-bill` (send reply email), `approve-budget` / `reject-budget` (send reply email), `approve-supplier` / `reject-supplier` (send reply email; approval and Lead/Admin re-approval queue the QuickBooks vendor sync, and the supplier is usable once it confirms), `approve-quotation` / `reject-quotation`, `approve-customer-invoice` / `reject-customer-invoice` |
741
764
  | **Companies & projects** | `list-companies`, `get-company`, `create-company` / `use-existing-company` (save the BB company now and queue its QuickBooks customer find/create or link, returning `quickBooksSyncQueued` / `operationId`; a QBO-only import passes `--name` from `search-existing-companies`; estimates, invoices and QuickBooks projects wait until the customer is linked; `get-company-quickbooks-sync-status` shows the queued or stopped link), `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` (saved state only, no provider read; a project whose hub link exists only in its Asana notes shows as not set up until `setup-project-hub` links that existing hub; also reports `rotation` while a web-started share-link rotation is `QUEUED` or has `FAILED`; the rotation runs as a queued job and the current link keeps working until it finishes), `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 links the selected deal card; optional `--asanaSearch`, `--pax`, `--endDate`, `--description`, `--projectManagerId`; always requests QBO project import like the web app; the deal card name is updated by a queued job reported as `asanaNameSyncQueued` / `asanaNameSyncOperationId`), `update-project` (`--payload` with `dateRange.from` / `dateRange.to` for the project window; optional `projectManagerId` and `requestQboAccountantNotification` in JSON; a rename queues the Asana project and deal card rename and returns `asanaNameSyncQueued` / `asanaNameSyncOperationId`; a Business Development change queues the deal card assignee update and returns `asanaAssigneeSyncQueued` / `asanaAssigneeSyncOperationId`, with `integrationWarnings` only when the deal card or Asana user mapping is missing — the request never calls Asana), `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`) |
742
765
  | **Contacts** | `list-contacts`, `create-contact-person` (`--payload`), `update-contact-person` (`--payload`) |
743
766
  | **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; each row carries `quickBooksSync` while a QuickBooks vendor job is queued or stopped), `create-supplier` (`--payload`; when supplier status is `PENDING_APPROVAL`, also runs `supplier.createSupplierApproval` and `email.sendSupplierApprovalRequestEmail`; a Lead/Admin create or archived-name revival instead queues the QuickBooks vendor create or link, returning `quickBooksSyncQueued` and `operationId`, and the supplier becomes usable once QuickBooks confirms), `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; queues one job per inactive supplier that reactivates or links its QuickBooks vendor and only then makes the supplier and its supplier-deactivated items active; returns `queuedSuppliers` and `operations`), `create-certification` / `create-payment-method` / `create-supplier-role` / `create-supplier-tag` (`--name`), `get-supplier-details` (includes `quickBooksSync` while a QuickBooks vendor job is `QUEUED` or has `FAILED`, and `supplierApprovalSummary` for pending approvers, superseded approvers, and the actual responder/respondedAt metadata), `get-supplier-overview` / `get-supplier-usage` / `get-supplier-items` `<supplierId>` (the supplier page's per-tab reads: profile, approvals and tab counts without usage or items; usage rows with spending; inventory items), `get-supplier-analytics` (admin; cursor pages: `--limit` / `--cursor` / `--direction`, optional `--name`, `--status` CSV, `--gstRegistered true|false`, `--createdBy`, `--timeFrame` (with `--startDate`/`--endDate` for `CUSTOM` only), `--sortBy name|gstRegistered|status|phone|email|updatedAt|createdAt`, `--sortDir`; `--page` / `--perPage` rejected; invalid filters are rejected instead of silently widening results), `count-supplier-analytics` (admin; `{ totalCount }` for the same filters), `list-items` (`--includeQuickBooksDeactivationPending true` discovers interrupted QuickBooks deactivations for Admin retry), `create-item` (`--payload`; saves the item and queues its QuickBooks item create, returning `quickBooksSyncQueued` and `operationId`; edits, archives and reactivation wait until that create links the QuickBooks item), `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` (cursor pages of active categories: `--limit` / `--cursor` / `--direction`, optional `--name`, `--sortBy createdAt|name|itemCount|createdBy`, `--sortDir`; `--page` / `--perPage` rejected), `count-item-categories` (`{ totalCount }` for the same `--name`), `create-item-category` / `update-item-category` / `delete-item-categories` (admin; `--ids` CSV for delete; `create-item-category` saves the category and queues its QuickBooks create or link — `list-item-categories` rows show `quickBooksSync` while it is queued or stopped, and items can be created in the category meanwhile; `update-item-category` saves the name immediately and queues the QuickBooks rename for a linked category, returning `quickBooksSyncQueued` and `operationId`) |
@@ -825,6 +848,19 @@ approval transaction. Multiple source quotations use canonical bill quotation
825
848
  allocation rows; apply the updated database schema and deploy the API before
826
849
  releasing the CLI. Unresolved historical overlaps continue to block approval.
827
850
 
851
+ ## Approval inbox
852
+
853
+ `bb approval list [--type bill] [--limit 50] [--cursor '<token>'] [--direction forward|backward]` returns one bounded page of your assigned pending requests, oldest first, with `{ items, pageInfo }`. Follow `pageInfo.nextCursor` to continue, retaining the same type filter. Offset `--page`/`--perPage` are rejected. Decided notification history is not scanned, and budgets already linked to a QuickBooks estimate remain excluded because those requests can no longer be decided. `bb approval get <approvalId>` reads one still-pending assigned request or returns null.
854
+
855
+ ## Advisory bill review
856
+
857
+ ```sh
858
+ bb bill request-review <billId> --allow-state-change --allow-external-write
859
+ bb bill review <billId>
860
+ ```
861
+
862
+ Requires a bill currently assigned to you for approval. The request queues an AI review using the same evidence and permissions as Android; it never approves, rejects or pays. Use `--requestId <id>` for a specific idempotent request or a deliberate new attempt after failure. Reopening unchanged evidence reuses current work. The passive read returns the evidence hash, checks, operation state, cited recommendation and review time. Changed evidence returns STALE with no recommendation. API and worker deployment is required before these commands are available.
863
+
828
864
  ## Build artifact compatibility
829
865
 
830
866
  `bun run build` uses the shared CLI builder and checks the executable against
@@ -3319,6 +3319,106 @@
3319
3319
  "effects": [],
3320
3320
  "legacyTarget": "get-bill-details"
3321
3321
  },
3322
+ {
3323
+ "path": ["bill", "review"],
3324
+ "legacyAliases": ["get-bill-review", "get_bill_review"],
3325
+ "summary": "Read current advisory AI bill review and evidence. Passive; no provider calls. Argument: <billId>.",
3326
+ "globalOptions": [
3327
+ {
3328
+ "name": "--help",
3329
+ "description": "Show help for this command."
3330
+ },
3331
+ {
3332
+ "name": "--quiet",
3333
+ "description": "Suppress non-error diagnostics."
3334
+ },
3335
+ {
3336
+ "name": "--debug",
3337
+ "description": "Emit sanitized diagnostic traces."
3338
+ },
3339
+ {
3340
+ "name": "--api-url",
3341
+ "description": "Override the Budget Builder API base URL."
3342
+ },
3343
+ {
3344
+ "name": "--no-browser",
3345
+ "description": "Print the authorization URL without opening a browser."
3346
+ },
3347
+ {
3348
+ "name": "--allow-state-change",
3349
+ "description": "Allow a Budget Builder state change in non-interactive use."
3350
+ },
3351
+ {
3352
+ "name": "--allow-email",
3353
+ "description": "Allow sending email in non-interactive use."
3354
+ },
3355
+ {
3356
+ "name": "--allow-external-write",
3357
+ "description": "Allow writes to external systems in non-interactive use."
3358
+ },
3359
+ {
3360
+ "name": "--allow-delete",
3361
+ "description": "Allow deleting data in non-interactive use."
3362
+ },
3363
+ {
3364
+ "name": "--allow-financial-write",
3365
+ "description": "Allow financial-record changes in non-interactive use."
3366
+ }
3367
+ ],
3368
+ "argumentMode": "legacy-passthrough",
3369
+ "effects": [],
3370
+ "legacyTarget": "get-bill-review"
3371
+ },
3372
+ {
3373
+ "path": ["bill", "request-review"],
3374
+ "legacyAliases": ["request-bill-review", "request_bill_review"],
3375
+ "summary": "Queue an advisory AI review of a bill pending your approval. No financial decision is made. <billId> [--requestId <id>]",
3376
+ "globalOptions": [
3377
+ {
3378
+ "name": "--help",
3379
+ "description": "Show help for this command."
3380
+ },
3381
+ {
3382
+ "name": "--quiet",
3383
+ "description": "Suppress non-error diagnostics."
3384
+ },
3385
+ {
3386
+ "name": "--debug",
3387
+ "description": "Emit sanitized diagnostic traces."
3388
+ },
3389
+ {
3390
+ "name": "--api-url",
3391
+ "description": "Override the Budget Builder API base URL."
3392
+ },
3393
+ {
3394
+ "name": "--no-browser",
3395
+ "description": "Print the authorization URL without opening a browser."
3396
+ },
3397
+ {
3398
+ "name": "--allow-state-change",
3399
+ "description": "Allow a Budget Builder state change in non-interactive use."
3400
+ },
3401
+ {
3402
+ "name": "--allow-email",
3403
+ "description": "Allow sending email in non-interactive use."
3404
+ },
3405
+ {
3406
+ "name": "--allow-external-write",
3407
+ "description": "Allow writes to external systems in non-interactive use."
3408
+ },
3409
+ {
3410
+ "name": "--allow-delete",
3411
+ "description": "Allow deleting data in non-interactive use."
3412
+ },
3413
+ {
3414
+ "name": "--allow-financial-write",
3415
+ "description": "Allow financial-record changes in non-interactive use."
3416
+ }
3417
+ ],
3418
+ "argumentMode": "legacy-passthrough",
3419
+ "effects": ["state-change", "external-write"],
3420
+ "legacyTarget": "request-bill-review"
3421
+ },
3322
3422
  {
3323
3423
  "path": ["bill", "line-item", "list"],
3324
3424
  "legacyAliases": ["get-bill-line-items", "get_bill_line_items"],
@@ -4893,7 +4993,7 @@
4893
4993
  "preview-qbo-customer-invoice",
4894
4994
  "preview_qbo_customer_invoice"
4895
4995
  ],
4896
- "summary": "Preview an available QuickBooks invoice selected for a BB budget using read-only QBO access. Arguments: <budgetId> <qboInvoiceId>.",
4996
+ "summary": "Preview an available QuickBooks invoice selected for a BB budget using read-only QBO access. Arguments: <budgetId> <qboInvoiceId> [--confirmEstimateLineage true]. Use --confirmEstimateLineage only after confirming an invoice with no QuickBooks estimate link belongs to this budget's estimate.",
4897
4997
  "globalOptions": [
4898
4998
  {
4899
4999
  "name": "--help",
@@ -4946,7 +5046,7 @@
4946
5046
  "import-qbo-customer-invoice",
4947
5047
  "import_qbo_customer_invoice"
4948
5048
  ],
4949
- "summary": "Link an existing QuickBooks invoice in BB only after reviewing preview-qbo. Arguments: <budgetId> <qboInvoiceId> --token <previewToken>. Supports closed estimates; no QBO writes or emails.",
5049
+ "summary": "Link an existing QuickBooks invoice in BB only after reviewing preview-qbo. Arguments: <budgetId> <qboInvoiceId> --token <previewToken> [--confirmEstimateLineage true] (repeat the preview's flag). Supports closed estimates; no QBO writes or emails.",
4950
5050
  "globalOptions": [
4951
5051
  {
4952
5052
  "name": "--help",
@@ -5666,7 +5766,7 @@
5666
5766
  "get-pending-approvals",
5667
5767
  "get_pending_approvals"
5668
5768
  ],
5669
- "summary": "List approvals.",
5769
+ "summary": "List one page of requests currently assigned to you and pending approval, oldest first. Returns { items, pageInfo }; follow nextCursor with unchanged --type. --page/--perPage are rejected.",
5670
5770
  "globalOptions": [
5671
5771
  {
5672
5772
  "name": "--help",
@@ -5707,12 +5807,78 @@
5707
5807
  {
5708
5808
  "name": "--allow-financial-write",
5709
5809
  "description": "Allow financial-record changes in non-interactive use."
5810
+ },
5811
+ {
5812
+ "name": "--type <type>",
5813
+ "description": "Filter budget, supplier, bill, quotation, customer_invoice, or all."
5814
+ },
5815
+ {
5816
+ "name": "--limit <number>",
5817
+ "description": "Page size 1–100; default 50."
5818
+ },
5819
+ {
5820
+ "name": "--cursor <token>",
5821
+ "description": "Opaque cursor from pageInfo."
5822
+ },
5823
+ {
5824
+ "name": "--direction <direction>",
5825
+ "description": "forward (default) or backward; backward requires a cursor."
5710
5826
  }
5711
5827
  ],
5712
5828
  "argumentMode": "legacy-passthrough",
5713
5829
  "effects": [],
5714
5830
  "legacyTarget": "list-approvals"
5715
5831
  },
5832
+ {
5833
+ "path": ["approval", "get"],
5834
+ "legacyAliases": ["get-pending-approval", "get_pending_approval"],
5835
+ "summary": "Read one request still pending your approval, or null if it is no longer pending/assigned. Argument: <approvalId>.",
5836
+ "globalOptions": [
5837
+ {
5838
+ "name": "--help",
5839
+ "description": "Show help for this command."
5840
+ },
5841
+ {
5842
+ "name": "--quiet",
5843
+ "description": "Suppress non-error diagnostics."
5844
+ },
5845
+ {
5846
+ "name": "--debug",
5847
+ "description": "Emit sanitized diagnostic traces."
5848
+ },
5849
+ {
5850
+ "name": "--api-url",
5851
+ "description": "Override the Budget Builder API base URL."
5852
+ },
5853
+ {
5854
+ "name": "--no-browser",
5855
+ "description": "Print the authorization URL without opening a browser."
5856
+ },
5857
+ {
5858
+ "name": "--allow-state-change",
5859
+ "description": "Allow a Budget Builder state change in non-interactive use."
5860
+ },
5861
+ {
5862
+ "name": "--allow-email",
5863
+ "description": "Allow sending email in non-interactive use."
5864
+ },
5865
+ {
5866
+ "name": "--allow-external-write",
5867
+ "description": "Allow writes to external systems in non-interactive use."
5868
+ },
5869
+ {
5870
+ "name": "--allow-delete",
5871
+ "description": "Allow deleting data in non-interactive use."
5872
+ },
5873
+ {
5874
+ "name": "--allow-financial-write",
5875
+ "description": "Allow financial-record changes in non-interactive use."
5876
+ }
5877
+ ],
5878
+ "argumentMode": "legacy-passthrough",
5879
+ "effects": [],
5880
+ "legacyTarget": "get-pending-approval"
5881
+ },
5716
5882
  {
5717
5883
  "path": ["bill", "approve"],
5718
5884
  "legacyAliases": ["approve-bill", "approve_bill"],
@@ -571,6 +571,22 @@ Legacy aliases: `get-bill-details`, `get_bill_details`.
571
571
 
572
572
  Effects: none.
573
573
 
574
+ ## `bb bill review`
575
+
576
+ Read current advisory AI bill review and evidence. Passive; no provider calls. Argument: <billId>.
577
+
578
+ Legacy aliases: `get-bill-review`, `get_bill_review`.
579
+
580
+ Effects: none.
581
+
582
+ ## `bb bill request-review`
583
+
584
+ Queue an advisory AI review of a bill pending your approval. No financial decision is made. <billId> [--requestId <id>]
585
+
586
+ Legacy aliases: `request-bill-review`, `request_bill_review`.
587
+
588
+ Effects: state-change, external-write.
589
+
574
590
  ## `bb bill line-item list`
575
591
 
576
592
  List a bill's line items with budget-item and quotation-allocation detail. <billId> [--limit 1-100] [--cursor <token>] Newest first. Returns { items, pageInfo }; follow nextCursor.
@@ -815,7 +831,7 @@ Effects: none.
815
831
 
816
832
  ## `bb customer-invoice preview-qbo`
817
833
 
818
- Preview an available QuickBooks invoice selected for a BB budget using read-only QBO access. Arguments: <budgetId> <qboInvoiceId>.
834
+ Preview an available QuickBooks invoice selected for a BB budget using read-only QBO access. Arguments: <budgetId> <qboInvoiceId> [--confirmEstimateLineage true]. Use --confirmEstimateLineage only after confirming an invoice with no QuickBooks estimate link belongs to this budget's estimate.
819
835
 
820
836
  Legacy aliases: `preview-qbo-customer-invoice`, `preview_qbo_customer_invoice`.
821
837
 
@@ -823,7 +839,7 @@ Effects: none.
823
839
 
824
840
  ## `bb customer-invoice import-qbo`
825
841
 
826
- Link an existing QuickBooks invoice in BB only after reviewing preview-qbo. Arguments: <budgetId> <qboInvoiceId> --token <previewToken>. Supports closed estimates; no QBO writes or emails.
842
+ Link an existing QuickBooks invoice in BB only after reviewing preview-qbo. Arguments: <budgetId> <qboInvoiceId> --token <previewToken> [--confirmEstimateLineage true] (repeat the preview's flag). Supports closed estimates; no QBO writes or emails.
827
843
 
828
844
  Legacy aliases: `import-qbo-customer-invoice`, `import_qbo_customer_invoice`.
829
845
 
@@ -945,12 +961,20 @@ Effects: state-change, financial-write.
945
961
 
946
962
  ## `bb approval list`
947
963
 
948
- List approvals.
964
+ List one page of requests currently assigned to you and pending approval, oldest first. Returns { items, pageInfo }; follow nextCursor with unchanged --type. --page/--perPage are rejected.
949
965
 
950
966
  Legacy aliases: `list-approvals`, `list_approvals`, `get-pending-approvals`, `get_pending_approvals`.
951
967
 
952
968
  Effects: none.
953
969
 
970
+ ## `bb approval get`
971
+
972
+ Read one request still pending your approval, or null if it is no longer pending/assigned. Argument: <approvalId>.
973
+
974
+ Legacy aliases: `get-pending-approval`, `get_pending_approval`.
975
+
976
+ Effects: none.
977
+
954
978
  ## `bb bill approve`
955
979
 
956
980
  Approve Bill.