@deliverd/sdk 0.39.1 → 0.40.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/dist/adapters/index.d.ts +2 -0
- package/dist/adapters/index.d.ts.map +1 -1
- package/dist/adapters/index.js +1 -0
- package/dist/ledgers.d.ts +192 -0
- package/dist/ledgers.d.ts.map +1 -0
- package/dist/ledgers.js +672 -0
- package/dist/released.d.ts +1 -1
- package/dist/released.d.ts.map +1 -1
- package/dist/released.js +1568 -0
- package/package.json +1 -1
- package/src/adapters/index.ts +11 -0
- package/src/ledgers.ts +733 -0
- package/src/released.ts +1569 -0
package/dist/adapters/index.d.ts
CHANGED
|
@@ -30,4 +30,6 @@ export { deliverdAllow, deliverdWebMcpAllow, describeStep, uiSdkApprovalRoute, U
|
|
|
30
30
|
export type { DeliverdAllowOptions, UiSdkApprovalAnswer, UiSdkApprovalRouteOptions, UiSdkAskContext, UiSdkStep } from "./ui-sdk.js";
|
|
31
31
|
export { defaultDescription, DEFAULT_TOOL_EXPIRY } from "./shared.js";
|
|
32
32
|
export type { Approver, CallDescription, CallOutcome, ToolApprovalOptions } from "./shared.js";
|
|
33
|
+
export { FINANCE_ACTIONS, FINANCE_ACTION_IDS, LEDGERS, LEDGER_LABEL, classifyLedgerRequest, classifyLedgerTool, financeActionLabel, maskAccount, } from "../ledgers.js";
|
|
34
|
+
export type { FinanceActionId, Ledger, LedgerCall, LedgerInput } from "../ledgers.js";
|
|
33
35
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/adapters/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAC3D,YAAY,EACV,gBAAgB,EAChB,uBAAuB,EACvB,sBAAsB,EACtB,yBAAyB,GAC1B,MAAM,uBAAuB,CAAC;AAC/B,OA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,GAC1B,MAAM,iBAAiB,CAAC;AACzB,YAAY,EACV,yBAAyB,EACzB,yBAAyB,EACzB,0BAA0B,EAC1B,mBAAmB,EACnB,gBAAgB,EAChB,sBAAsB,EACtB,4BAA4B,EAC5B,kBAAkB,EAClB,oBAAoB,GACrB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,aAAa,EAAE,mBAAmB,EAAE,YAAY,EAAE,kBAAkB,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;AAC3H,YAAY,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,yBAAyB,EAAE,eAAe,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACpI,OAAO,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AACtE,YAAY,EAAE,QAAQ,EAAE,eAAe,EAAE,WAAW,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAC/F,OAAO,EACL,eAAe,EACf,kBAAkB,EAClB,OAAO,EACP,YAAY,EACZ,qBAAqB,EACrB,kBAAkB,EAClB,kBAAkB,EAClB,WAAW,GACZ,MAAM,eAAe,CAAC;AACvB,YAAY,EAAE,eAAe,EAAE,MAAM,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC"}
|
package/dist/adapters/index.js
CHANGED
|
@@ -18,3 +18,4 @@ export { runMuseFunctionCalls, runMuseToolCalls } from "./muse-spark.js";
|
|
|
18
18
|
export { answerPerplexityApprovals, runPerplexityFunctionCalls, runPerplexityWithDeliverd, } from "./perplexity.js";
|
|
19
19
|
export { deliverdAllow, deliverdWebMcpAllow, describeStep, uiSdkApprovalRoute, UI_SDK_DEFAULT_TIMEOUT } from "./ui-sdk.js";
|
|
20
20
|
export { defaultDescription, DEFAULT_TOOL_EXPIRY } from "./shared.js";
|
|
21
|
+
export { FINANCE_ACTIONS, FINANCE_ACTION_IDS, LEDGERS, LEDGER_LABEL, classifyLedgerRequest, classifyLedgerTool, financeActionLabel, maskAccount, } from "../ledgers.js";
|
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Accounting ledgers: what an agent's call to Xero or QuickBooks Online is,
|
|
3
|
+
* in the words a finance approver and a policy rule use.
|
|
4
|
+
*
|
|
5
|
+
* Agents now write to the books. Xero's remote MCP server and its open-source
|
|
6
|
+
* one (`@xeroapi/xero-mcp-server`), Intuit's open-source QuickBooks server
|
|
7
|
+
* (`intuit/quickbooks-online-mcp-server`), and plain calls to both REST APIs
|
|
8
|
+
* can create payments, post journals and change a supplier's bank details.
|
|
9
|
+
* None of them asks anybody first. This module turns any of those calls into
|
|
10
|
+
* one of a handful of finance actions (approve a bill, record a payment,
|
|
11
|
+
* change a supplier's bank details...) with the amount, currency and
|
|
12
|
+
* counterparty pulled out, so a rule can say "over 5,000 needs two people"
|
|
13
|
+
* and mean it, whichever door the agent came through.
|
|
14
|
+
*
|
|
15
|
+
* It also reads what the ledgers' webhooks say, and turns a record the ledger
|
|
16
|
+
* sends back into a change worth watching, so a bill authorised or a bank
|
|
17
|
+
* account swapped with no yes behind it shows on the Enforcement panel.
|
|
18
|
+
*
|
|
19
|
+
* Three lines are held throughout:
|
|
20
|
+
*
|
|
21
|
+
* - **Pure, no imports.** This file is copied verbatim into
|
|
22
|
+
* `packages/sdk/src/ledgers.ts`, and a test fails when they differ, so an
|
|
23
|
+
* agent classifies its own calls the same way the hosted gateway does. The
|
|
24
|
+
* local MCP hook carries a JavaScript copy of the tool map
|
|
25
|
+
* (`integrations/agent-hooks/deliverd/ledgers.mjs`), held to the same cases.
|
|
26
|
+
* - **Unknown writes are still asked about.** A tool or route this file does
|
|
27
|
+
* not recognise but that changes something is `finance.ledger_write`, never
|
|
28
|
+
* waved through. Reads are never asked about.
|
|
29
|
+
* - **Bank details never travel whole.** Only masked forms (`•••• 1234`) are
|
|
30
|
+
* put in front of an approver or stored.
|
|
31
|
+
*/
|
|
32
|
+
export declare const LEDGERS: readonly ["xero", "quickbooks"];
|
|
33
|
+
export type Ledger = (typeof LEDGERS)[number];
|
|
34
|
+
export declare const LEDGER_LABEL: Record<Ledger, string>;
|
|
35
|
+
/** The finance actions, by the id policy keys on. `finance.*` in a rule catches every one. */
|
|
36
|
+
export declare const FINANCE_ACTIONS: {
|
|
37
|
+
readonly approveBill: "finance.approve_bill";
|
|
38
|
+
readonly recordPayment: "finance.record_payment";
|
|
39
|
+
readonly postJournal: "finance.post_journal";
|
|
40
|
+
readonly bankTransaction: "finance.bank_transaction";
|
|
41
|
+
readonly supplierBankDetails: "finance.change_supplier_bank_details";
|
|
42
|
+
readonly sendInvoice: "finance.send_invoice";
|
|
43
|
+
readonly creditNote: "finance.issue_credit_note";
|
|
44
|
+
readonly payroll: "finance.approve_payroll";
|
|
45
|
+
readonly voidRecord: "finance.void_record";
|
|
46
|
+
readonly ledgerWrite: "finance.ledger_write";
|
|
47
|
+
};
|
|
48
|
+
export type FinanceActionId = (typeof FINANCE_ACTIONS)[keyof typeof FINANCE_ACTIONS];
|
|
49
|
+
export declare const FINANCE_ACTION_IDS: readonly FinanceActionId[];
|
|
50
|
+
/**
|
|
51
|
+
* What every finance gate carries. One shape for all of them, so a rule
|
|
52
|
+
* written for one (`amount gte 5000`, `newCounterparty eq true`) reads the
|
|
53
|
+
* same on the others. Flat and primitive, because the action schema subset is.
|
|
54
|
+
*/
|
|
55
|
+
export interface LedgerInput {
|
|
56
|
+
ledger: Ledger;
|
|
57
|
+
/** What was called: `create-payment`, `POST /Payments`. */
|
|
58
|
+
tool: string;
|
|
59
|
+
recordType?: string;
|
|
60
|
+
amount?: number;
|
|
61
|
+
currency?: string;
|
|
62
|
+
counterparty?: string;
|
|
63
|
+
reference?: string;
|
|
64
|
+
recordId?: string;
|
|
65
|
+
status?: string;
|
|
66
|
+
/** The ledger has no earlier bill or payment for this counterparty. Set only when Deliverd could look. */
|
|
67
|
+
newCounterparty?: boolean;
|
|
68
|
+
/** The record is dated inside a period the ledger has locked. Set only when Deliverd could look. */
|
|
69
|
+
closedPeriod?: boolean;
|
|
70
|
+
/** The call changes where a supplier is paid. */
|
|
71
|
+
bankDetailsChanged?: boolean;
|
|
72
|
+
previousBankDetails?: string;
|
|
73
|
+
newBankDetails?: string;
|
|
74
|
+
/** What the approver should know, one finding a line: duplicates, recent bills. */
|
|
75
|
+
checks?: string;
|
|
76
|
+
}
|
|
77
|
+
export interface LedgerCall {
|
|
78
|
+
actionId: FinanceActionId;
|
|
79
|
+
input: LedgerInput;
|
|
80
|
+
/** One line for the approval card and the agent: "Record a payment of 1,200.00 GBP to Acme". */
|
|
81
|
+
summary: string;
|
|
82
|
+
}
|
|
83
|
+
type Rec = Record<string, unknown>;
|
|
84
|
+
export declare function primaryRecord(args: unknown): Rec;
|
|
85
|
+
export declare function amountOf(record: Rec): number | undefined;
|
|
86
|
+
export declare function currencyOf(record: Rec): string | undefined;
|
|
87
|
+
/**
|
|
88
|
+
* Who a record is with: a name wherever one is given, and an id only when no
|
|
89
|
+
* name is. `self` is for a contact or vendor record, which names itself.
|
|
90
|
+
*/
|
|
91
|
+
export declare function counterpartyOf(record: Rec, self?: boolean): string | undefined;
|
|
92
|
+
/** `YYYY-MM-DD` from an ISO date, a QuickBooks `TxnDate`, or Xero's `/Date(1731628800000+0000)/`. */
|
|
93
|
+
export declare function isoDay(v: unknown): string | undefined;
|
|
94
|
+
export declare function dateOf(record: Rec): string | undefined;
|
|
95
|
+
/** The bank details a call sets, flattened to one string, or undefined when it sets none. */
|
|
96
|
+
export declare function bankDetailsIn(record: Rec): string | undefined;
|
|
97
|
+
/** `•••• 1234`: enough for a person to recognise an account, not enough to pay into it. */
|
|
98
|
+
export declare function maskAccount(value: string | undefined | null): string;
|
|
99
|
+
/** `xero__create-payment`, `mcp__qbo__create_bill`, `create-payment` → `create_payment`. */
|
|
100
|
+
export declare function toolKey(tool: string): string;
|
|
101
|
+
export declare function financeActionLabel(actionId: string): string;
|
|
102
|
+
export declare function summarise(call: {
|
|
103
|
+
actionId: FinanceActionId;
|
|
104
|
+
input: LedgerInput;
|
|
105
|
+
}): string;
|
|
106
|
+
/**
|
|
107
|
+
* One MCP tool call (or an SDK tool call with the same name), as a finance
|
|
108
|
+
* action. Null for a read: listing invoices or running a report asks nobody.
|
|
109
|
+
*/
|
|
110
|
+
export declare function classifyLedgerTool(ledger: Ledger, tool: string, args: unknown): LedgerCall | null;
|
|
111
|
+
/**
|
|
112
|
+
* One REST request to a ledger, as a finance action. `path` is relative to
|
|
113
|
+
* the ledger's API root: `/api.xro/2.0/Invoices/…` for Xero, `/bill?…` for
|
|
114
|
+
* QuickBooks (whose root already names the company). Null for a read.
|
|
115
|
+
*/
|
|
116
|
+
export declare function classifyLedgerRequest(ledger: Ledger, method: string, path: string, body?: string | null): LedgerCall | null;
|
|
117
|
+
export interface LedgerEvent {
|
|
118
|
+
ledger: Ledger;
|
|
119
|
+
/** Xero's tenant id, or the QuickBooks company's realm id. */
|
|
120
|
+
tenantId: string;
|
|
121
|
+
/** `invoice`, `contact`, `bill`, `vendor`, `billpayment`, `journalentry`… lower case. */
|
|
122
|
+
entity: string;
|
|
123
|
+
entityId: string;
|
|
124
|
+
/** `create`, `update`, `delete`, `void`, `emailed`, `merge`. */
|
|
125
|
+
operation: string;
|
|
126
|
+
at: string;
|
|
127
|
+
/** Unique per event, for recording each once. */
|
|
128
|
+
eventId: string;
|
|
129
|
+
}
|
|
130
|
+
/** Xero's batch: `{ events: [ { resourceId, tenantId, eventCategory, eventType, eventDateUtc } ] }`. */
|
|
131
|
+
export declare function parseXeroWebhook(body: unknown): LedgerEvent[];
|
|
132
|
+
/**
|
|
133
|
+
* Intuit sends either format during its move to CloudEvents: a JSON array of
|
|
134
|
+
* CloudEvents (`type: "qbo.bill.created.v1"`, `intuitaccountid`,
|
|
135
|
+
* `intuitentityid`), or the older `{ eventNotifications: [ { realmId,
|
|
136
|
+
* dataChangeEvent: { entities: [ { name, id, operation, lastUpdated } ] } } ] }`.
|
|
137
|
+
*/
|
|
138
|
+
export declare function parseQuickbooksWebhook(body: unknown): LedgerEvent[];
|
|
139
|
+
/** The record a ledger event names, as the ledger's API answers for it. Xero: `/Invoices/{id}`; QuickBooks: `/{entity}/{id}`. */
|
|
140
|
+
export declare function recordPath(event: Pick<LedgerEvent, "ledger" | "entity" | "entityId">): string | null;
|
|
141
|
+
/** The record out of the ledger's answer: Xero's `{ Invoices: [x] }`, QuickBooks' `{ Bill: x }`. */
|
|
142
|
+
export declare function unwrapRecord(answer: unknown): Rec;
|
|
143
|
+
/**
|
|
144
|
+
* A change worth watching, from an event and the record as it now stands.
|
|
145
|
+
* Null for one nobody needs to see: a draft saved, a contact's phone number.
|
|
146
|
+
*
|
|
147
|
+
* `previousBank` is the masked bank details Deliverd last saw on that
|
|
148
|
+
* contact (null the first time, which records a baseline and flags nothing).
|
|
149
|
+
*/
|
|
150
|
+
export interface LedgerChange {
|
|
151
|
+
actionId: FinanceActionId;
|
|
152
|
+
summary: string;
|
|
153
|
+
/** What a covering gate's input must mention. */
|
|
154
|
+
subjectTerms: string[];
|
|
155
|
+
/** A contact's bank details, masked: store it as the next baseline. */
|
|
156
|
+
bankNow?: string;
|
|
157
|
+
/** Nothing to record: only the baseline changed hands (the first sight of a contact, or no bank change). */
|
|
158
|
+
baselineOnly?: boolean;
|
|
159
|
+
}
|
|
160
|
+
export declare function changeFrom(event: LedgerEvent, record: Rec, previousBank: string | null | undefined): LedgerChange | null;
|
|
161
|
+
/** Is this Xero record a bill waiting for someone to approve it? */
|
|
162
|
+
export declare function awaitingApproval(record: Rec): boolean;
|
|
163
|
+
export interface PastRecord {
|
|
164
|
+
id?: string;
|
|
165
|
+
reference?: string;
|
|
166
|
+
amount?: number;
|
|
167
|
+
date?: string;
|
|
168
|
+
status?: string;
|
|
169
|
+
}
|
|
170
|
+
export interface CheckInput {
|
|
171
|
+
amount?: number;
|
|
172
|
+
currency?: string;
|
|
173
|
+
reference?: string;
|
|
174
|
+
recordId?: string;
|
|
175
|
+
/** The counterparty's recent records of the same kind, newest first. */
|
|
176
|
+
recent?: PastRecord[];
|
|
177
|
+
/** The record's date, `YYYY-MM-DD`. */
|
|
178
|
+
date?: string;
|
|
179
|
+
/** The ledger's lock date, `YYYY-MM-DD`: nothing on or before it should change. */
|
|
180
|
+
lockDate?: string | null;
|
|
181
|
+
}
|
|
182
|
+
/**
|
|
183
|
+
* The findings an approver reads above Approve, and the flags rules key on.
|
|
184
|
+
* A duplicate is the same reference, or the same amount within 30 days.
|
|
185
|
+
*/
|
|
186
|
+
export declare function ledgerChecks(c: CheckInput): {
|
|
187
|
+
checks: string[];
|
|
188
|
+
newCounterparty?: boolean;
|
|
189
|
+
closedPeriod?: boolean;
|
|
190
|
+
};
|
|
191
|
+
export {};
|
|
192
|
+
//# sourceMappingURL=ledgers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ledgers.d.ts","sourceRoot":"","sources":["../src/ledgers.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AAEH,eAAO,MAAM,OAAO,iCAAkC,CAAC;AACvD,MAAM,MAAM,MAAM,GAAG,CAAC,OAAO,OAAO,CAAC,CAAC,MAAM,CAAC,CAAC;AAE9C,eAAO,MAAM,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAqD,CAAC;AAEtG,8FAA8F;AAC9F,eAAO,MAAM,eAAe;;;;;;;;;;;CAWlB,CAAC;AACX,MAAM,MAAM,eAAe,GAAG,CAAC,OAAO,eAAe,CAAC,CAAC,MAAM,OAAO,eAAe,CAAC,CAAC;AAErF,eAAO,MAAM,kBAAkB,EAAE,SAAS,eAAe,EAAmC,CAAC;AAE7F;;;;GAIG;AACH,MAAM,WAAW,WAAW;IAC1B,MAAM,EAAE,MAAM,CAAC;IACf,2DAA2D;IAC3D,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE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