jaz-clio 4.5.0 → 4.17.1

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.
Files changed (76) hide show
  1. package/README.md +7 -0
  2. package/assets/skills/api/SKILL.md +19 -3
  3. package/assets/skills/api/help-center-mirror/help-center-index.json +1 -0
  4. package/assets/skills/api/references/endpoints.md +4 -2
  5. package/assets/skills/api/references/field-map.md +2 -1
  6. package/assets/skills/api/references/full-api-surface.md +2 -0
  7. package/assets/skills/api/references/search-reference.md +5 -3
  8. package/assets/skills/conversion/SKILL.md +3 -1
  9. package/assets/skills/conversion/references/edge-cases.md +14 -0
  10. package/assets/skills/conversion/references/mapping-rules.md +22 -0
  11. package/assets/skills/conversion/references/option1-full.md +22 -1
  12. package/assets/skills/conversion/references/option2-quick.md +14 -6
  13. package/assets/skills/conversion/references/verification.md +20 -4
  14. package/assets/skills/jobs/SKILL.md +1 -1
  15. package/assets/skills/jobs/references/credit-control.md +2 -2
  16. package/assets/skills/jobs/references/document-collection.md +31 -2
  17. package/assets/skills/jobs/references/gst-vat-filing.md +2 -2
  18. package/assets/skills/jobs/references/payment-run.md +3 -3
  19. package/assets/skills/jobs/references/sg-tax/data-extraction.md +1 -1
  20. package/assets/skills/jobs/references/supplier-recon.md +3 -3
  21. package/assets/skills/transaction-recipes/SKILL.md +28 -6
  22. package/dist/commands/attachments.js +81 -0
  23. package/dist/commands/bookmarks.js +123 -0
  24. package/dist/commands/calc.js +66 -1
  25. package/dist/commands/cashflow.js +68 -0
  26. package/dist/commands/currency-rates.js +43 -1
  27. package/dist/commands/exports.js +49 -0
  28. package/dist/commands/jobs.js +199 -30
  29. package/dist/commands/kb.js +68 -0
  30. package/dist/commands/magic.js +161 -4
  31. package/dist/commands/org-users.js +174 -0
  32. package/dist/commands/picker.js +192 -0
  33. package/dist/commands/recipe.js +88 -38
  34. package/dist/commands/reports.js +28 -0
  35. package/dist/commands/schedulers.js +248 -0
  36. package/dist/commands/tax-profiles.js +88 -0
  37. package/dist/core/api/attachments.js +6 -0
  38. package/dist/core/api/client.js +22 -0
  39. package/dist/core/api/message-pdf.js +7 -0
  40. package/dist/core/calc/accrued-expense.js +74 -0
  41. package/dist/core/calc/dividend.js +100 -0
  42. package/dist/core/calc/leave-accrual.js +73 -0
  43. package/dist/core/calc/types.js +14 -4
  44. package/dist/core/intelligence/index.js +2 -0
  45. package/dist/core/intelligence/no-reply.js +58 -0
  46. package/dist/core/intelligence/recipe-resolver.js +106 -0
  47. package/dist/core/jobs/credit-control/blueprint.js +2 -2
  48. package/dist/core/jobs/document-collection/tools/ingest/classify.js +1 -1
  49. package/dist/core/jobs/document-collection/tools/ingest/cloud/dropbox.js +28 -3
  50. package/dist/core/jobs/document-collection/tools/ingest/ingest.js +45 -14
  51. package/dist/core/jobs/document-collection/tools/ingest/scanner.js +41 -5
  52. package/dist/core/jobs/gst-vat/blueprint.js +2 -2
  53. package/dist/core/jobs/month-end/blueprint.js +1 -1
  54. package/dist/core/jobs/payment-run/blueprint.js +6 -4
  55. package/dist/core/jobs/payment-run/tools/bank-file/format.js +64 -0
  56. package/dist/core/jobs/payment-run/tools/bank-file/formats/dbs-giro.js +177 -0
  57. package/dist/core/jobs/payment-run/tools/bank-file/formats/index.js +3 -0
  58. package/dist/core/jobs/payment-run/tools/bank-file/formats/ocbc-giro.js +171 -0
  59. package/dist/core/jobs/payment-run/tools/bank-file/formats/uob-giro.js +240 -0
  60. package/dist/core/jobs/payment-run/tools/bank-file/generate.js +24 -0
  61. package/dist/core/jobs/payment-run/tools/bank-file/index.js +3 -0
  62. package/dist/core/jobs/payment-run/tools/bank-file/types.js +25 -0
  63. package/dist/core/jobs/payment-run/tools/bank-file/validate.js +217 -0
  64. package/dist/core/jobs/payment-run/tools/outstanding/format.js +61 -0
  65. package/dist/core/jobs/payment-run/tools/outstanding/group.js +90 -0
  66. package/dist/core/jobs/payment-run/tools/outstanding/index.js +2 -0
  67. package/dist/core/jobs/payment-run/tools/outstanding/types.js +5 -0
  68. package/dist/core/jobs/supplier-recon/blueprint.js +1 -1
  69. package/dist/core/kb/embeddings.js +218 -0
  70. package/dist/core/kb/index.js +2 -0
  71. package/dist/core/kb/search.js +235 -0
  72. package/dist/core/kb/types.js +2 -0
  73. package/dist/core/recipe/dispatch.js +155 -0
  74. package/dist/core/recipe/types.js +2 -0
  75. package/dist/index.js +33 -1
  76. package/package.json +2 -2
package/README.md CHANGED
@@ -113,6 +113,13 @@ clio payments search # Search payments
113
113
  clio bank import --file statement.csv # Import bank statement
114
114
  clio reports generate --type pnl # Generate reports
115
115
  clio capsules list # List capsules (transaction groups)
116
+ clio schedulers list-invoices # List scheduled (recurring) invoices
117
+ clio exports download --type INVOICES # Download data export
118
+ clio attachments list <id> # List attachments on a transaction
119
+ clio tax-profiles list # List tax profiles
120
+ clio magic create --file receipt.pdf # AI-extract from attachment
121
+ clio cashflow search # Search cashflow transactions
122
+ clio context # Generate agent context
116
123
  clio versions # Show version info
117
124
  clio update # Update to latest
118
125
  ```
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: jaz-api
3
- version: 4.5.0
3
+ version: 4.17.1
4
4
  description: Complete reference for the Jaz REST API — the accounting platform backend. Use this skill whenever building, modifying, debugging, or extending any code that calls the API — including API clients, integrations, data seeding, test data, or new endpoint work. Contains every field name, response shape, error, gotcha, and edge case discovered through live production testing.
5
5
  license: MIT
6
6
  compatibility: Requires Jaz API key (x-jk-api-key header). Works with Claude Code, Google Antigravity, OpenAI Codex, GitHub Copilot, Cursor, and any agent that reads markdown.
@@ -123,7 +123,7 @@ You are working with the **Jaz REST API** — the accounting platform backend. A
123
123
  ### Search & Filter
124
124
  50. **Search endpoint universal pattern** — All 28 `POST /*/search` endpoints share identical structure: `{ filter?, sort: { sortBy: ["field"], order: "ASC"|"DESC" }, limit: 1-1000, offset: 0-65536 }`. Sort is REQUIRED when offset is present (even `offset: 0`). Default limit: 100. `sortBy` is always an array on all endpoints (no exceptions). See `references/search-reference.md` for per-endpoint filter/sort fields.
125
125
  51. **Filter operator reference** — String: `eq`, `neq`, `contains`, `in` (array, max 100), `likeIn` (array, max 100), `reg` (regex array, max 100), `isNull` (bool). Numeric: `eq`, `gt`, `gte`, `lt`, `lte`, `in`. Date (YYYY-MM-DD): `eq`, `gt`, `gte`, `lt`, `lte`, `between` (exactly 2 values). DateTime (RFC3339): same operators, converted to epoch ms internally. Boolean: `eq`. JSON: `jsonIn`, `jsonNotIn`. Logical: nest with `and`/`or`/`not` objects, or use `andGroup`/`orGroup` arrays (invoices, bills, journals, credit notes).
126
- 52. **Date format asymmetry (CRITICAL)** — Request dates: `YYYY-MM-DD` strings (all create/update and DateExpression filters). Request datetimes: RFC3339 strings (DateTimeExpression filters for `createdAt`, `updatedAt`, `approvedAt`, `submittedAt`). **ALL response dates**: `int64` epoch milliseconds — including `valueDate`, `createdAt`, `updatedAt`, `approvedAt`, `submittedAt`, `matchDate`. Convert: `new Date(epochMs).toISOString().slice(0,10)`.
126
+ 52. **Date format asymmetry (CRITICAL)** — Request dates: `YYYY-MM-DD` strings (all create/update and DateExpression filters). Request datetimes: RFC3339 strings (DateTimeExpression filters for `createdAt`, `updatedAt`, `approvedAt`, `submittedAt`). **ALL response dates**: `int64` epoch milliseconds — including `valueDate`, `createdAt`, `updatedAt`, `approvedAt`, `submittedAt`, `matchDate`. Convert: `new Date(epochMs).toISOString().slice(0,10)`. **Timezone convention**: ALL business dates (`valueDate`, `dueDate`, `startDate`, `endDate`, etc.) are in the **organization's timezone** — never UTC. The epoch ms stored in the DB represents the org-local date (no timezone conversion is ever needed). Only audit timestamps (`createdAt`, `updatedAt`, `action_at`) are UTC.
127
127
  53. **Field aliases on create endpoints** — Middleware transparently maps: `issueDate`/`date` → `valueDate` (invoices, bills, credit notes, journals). `name` → `tagName` (tags) or `internalName` (items). `paymentDate` → `valueDate`, `bankAccountResourceId` → `accountResourceId` (payments). `paymentAmount` → `refundAmount`, `paymentMethod` → `refundMethod` (credit note refunds). `accountType` → `classificationType`, `currencyCode` → `currency` (CoA). Canonical names always work; aliases are convenience only.
128
128
  54. **All search/list responses are flat** — every search and list endpoint returns `{ totalElements, totalPages, data: [...] }` directly (no outer `data` wrapper). Access the array via `response.data`, pagination via `response.totalElements`. **Two exceptions**: (a) `GET /bank-accounts` returns a plain array `[{...}]` (see Rule 18), (b) `GET /invoices/:id` returns a flat object `{...}` (no `data` wrapper) — unlike `GET /bills/:id`, `GET /contacts/:id`, `GET /journals/:id` which wrap in `{ data: {...} }`. Normalize the invoice GET response before use.
129
129
  55. **Scheduled endpoints support date aliases** — `txnDateAliases` middleware (mapping `issueDate`/`date` → `valueDate`) now applies to all scheduled create/update endpoints: `POST/PUT /scheduled/invoices`, `POST/PUT /scheduled/bills`, `POST/PUT /scheduled/journals`, `POST/PUT /scheduled/subscriptions`.
@@ -148,7 +148,7 @@ You are working with the **Jaz REST API** — the accounting platform backend. A
148
148
  67. **Finalized statuses differ by resource type** — NOT `"FINALIZED"`, `"FINAL"`, or `"POSTED"`. Journals → `"APPROVED"`. Invoices/Bills → `"UNPAID"` (progresses to `"PAID"`, `"OVERDUE"`). Customer/Supplier Credit Notes → `"UNAPPLIED"` (progresses to `"APPLIED"`). All types support `"DRAFT"` and `"VOIDED"`. When creating without `saveAsDraft: true`, the response status matches the type's finalized status.
149
149
  68. **Create/pay responses are minimal** — POST create endpoints (invoices, bills, journals, contacts, payments) return only `{ resourceId: "..." }` (plus a few metadata fields). They do NOT return the full entity. To verify field values after creation, you MUST do a subsequent `GET /:type/:resourceId`. Never assert on field values from a create response.
150
150
  69. **No `amountDue` field** — Invoices and bills do NOT have an `amountDue` field. To check if a transaction is fully paid, inspect the `paymentRecords` array: if `paymentRecords.length > 0`, payments exist. Compare `totalAmount` with the sum of `paymentRecords[].transactionAmount` to determine remaining balance.
151
- 70. **Response dates include time component** — Even though request dates are `YYYY-MM-DD`, response dates are epoch milliseconds (see Rule 52). When comparing dates from responses, always convert with `new Date(epochMs).toISOString().slice(0, 10)` — never string-match against the raw epoch value.
151
+ 70. **Response dates include time component** — Even though request dates are `YYYY-MM-DD`, response dates are epoch milliseconds (see Rule 52). When comparing dates from responses, always convert with `new Date(epochMs).toISOString().slice(0, 10)` — never string-match against the raw epoch value. Remember: business dates are org-timezone (see Rule 52).
152
152
  71. **Items POST requires `saleItemName`/`purchaseItemName`** — When creating items with `appliesToSale: true` or `appliesToPurchase: true`, you MUST include `saleItemName` and/or `purchaseItemName` respectively. These are the display names shown on sale/purchase documents. Omitting them causes 422: "saleItemName is a required field". If not specified, default to the `internalName` value.
153
153
  72. **Items PUT requires `itemCode` + `internalName`** — Even for partial updates, `PUT /items/:id` requires both `itemCode` and `internalName` in the body. Omitting either causes 422. Use read-modify-write pattern: GET current item, merge your updates, PUT the full payload. Clio handles this automatically.
154
154
  73. **Capsules PUT requires `resourceId` + `capsuleTypeResourceId`** — Even for partial updates, `PUT /capsules/:id` requires `resourceId` and `capsuleTypeResourceId` in the body. Omitting either causes 422 or "Capsule type not found". Use read-modify-write pattern: GET current capsule, merge updates, PUT full payload. Clio handles this automatically.
@@ -235,6 +235,22 @@ For detailed reference, read these files in this skill directory:
235
235
  - **[references/feature-glossary.md](./references/feature-glossary.md)** — Business context per feature — what each feature does and why, extracted from [help.jaz.ai](https://help.jaz.ai)
236
236
  - **[help-center-mirror/](./help-center-mirror/)** — Full help center content split by section (auto-generated from [help.jaz.ai](https://help.jaz.ai))
237
237
 
238
+ ## Help Center Knowledge Base (`clio help-center` / `clio hc`)
239
+
240
+ For product questions (how-to, feature behavior, troubleshooting), use `clio help-center` instead of reading raw help-center-mirror files:
241
+
242
+ ```bash
243
+ clio help-center "how to apply credit note" # search help center
244
+ clio help-center "bank recon" --limit 3 # limit results
245
+ clio help-center "scheduled invoices" --section invoices # filter by section
246
+ ```
247
+
248
+ Supports `--json` for structured output. 186 articles across 20 sections. Automatically uses hybrid search (embeddings + keyword) when available, falls back to keyword + synonym expansion offline.
249
+
250
+ **When to use `clio help-center` vs reading raw files:**
251
+ - Use `clio help-center` when you need specific answers (returns only relevant articles, saves context)
252
+ - Read `help-center-mirror/*.md` directly only when you need to scan an entire section comprehensively
253
+
238
254
  ## DX Overhaul (Implemented)
239
255
 
240
256
  The backend DX overhaul is live. Key improvements now available: