bkper 4.16.2 → 4.16.4
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/lib/agent/run-agent-mode.d.ts +9 -0
- package/lib/agent/run-agent-mode.d.ts.map +1 -1
- package/lib/agent/run-agent-mode.js +56 -4
- package/lib/agent/run-agent-mode.js.map +1 -1
- package/lib/agent/system-prompt.d.ts.map +1 -1
- package/lib/agent/system-prompt.js +1 -0
- package/lib/agent/system-prompt.js.map +1 -1
- package/lib/docs/bkper-api-types.md +9 -2
- package/lib/docs/bkper-js.md +24 -2
- package/lib/docs/financial-statements.md +49 -196
- package/lib/docs/index.md +2 -2
- package/lib/docs/taxes.md +52 -236
- package/package.json +2 -2
|
@@ -28,6 +28,13 @@ type SessionManagerLike = {
|
|
|
28
28
|
messages: unknown[];
|
|
29
29
|
};
|
|
30
30
|
};
|
|
31
|
+
type KeybindingsConfigValue = string | string[] | undefined;
|
|
32
|
+
type KeybindingsConfigLike = Record<string, KeybindingsConfigValue>;
|
|
33
|
+
export type BkperKeybindingsManager = {
|
|
34
|
+
getUserBindings(): KeybindingsConfigLike;
|
|
35
|
+
setUserBindings(userBindings: KeybindingsConfigLike): void;
|
|
36
|
+
reload(): void;
|
|
37
|
+
};
|
|
31
38
|
type ScopedModel<TModel extends ModelLike = ModelLike> = {
|
|
32
39
|
model: TModel;
|
|
33
40
|
thinkingLevel?: ScopedThinkingLevel;
|
|
@@ -54,6 +61,8 @@ export interface AgentModeDependencies {
|
|
|
54
61
|
export declare function collectSettingsDiagnostics(settingsManager: Pick<SettingsManagerLike, 'drainErrors'>, context: string): AgentSessionRuntimeDiagnostic[];
|
|
55
62
|
export declare function createStartupSessionManager<TSessionManager>(cwd: string, settingsManager: Pick<SettingsManagerLike, 'getSessionDir'>, createSessionManager: (cwd: string, sessionDir?: string) => TSessionManager): TSessionManager;
|
|
56
63
|
export declare function restorePersistedSessionOptions<TModel extends ModelLike>(settingsManager: Pick<SettingsManagerLike, 'getEnabledModels' | 'getDefaultProvider' | 'getDefaultModel'>, modelRegistry: ModelRegistryLike<TModel>, sessionManager: SessionManagerLike): RestoredPersistedSessionOptions<TModel>;
|
|
64
|
+
export declare function applyBkperSessionKeybindings(keybindings: Pick<BkperKeybindingsManager, 'getUserBindings' | 'setUserBindings'>): void;
|
|
65
|
+
export declare function installBkperSessionKeybindings(keybindings: BkperKeybindingsManager): void;
|
|
57
66
|
export declare function registerBkperAgentStartupExtension(pi: StartupExtensionAPI, startupMaintenance?: typeof runStartupMaintenance, settingsManager?: Pick<SettingsManagerLike, 'getQuietStartup'>): void;
|
|
58
67
|
export interface SessionOptions {
|
|
59
68
|
continueSession?: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"run-agent-mode.d.ts","sourceRoot":"","sources":["../../src/agent/run-agent-mode.ts"],"names":[],"mappings":"AAAA,OAAO,EAKH,eAAe,EAIf,KAAK,6BAA6B,EAElC,KAAK,YAAY,EAEpB,MAAM,iCAAiC,CAAC;AAGzC,OAAO,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AAGjE,MAAM,MAAM,sBAAsB,GAAG,qBAAqB,CAAC,OAAO,eAAe,CAAC,CAAC,CAAC,CAAC,CAAC;AAGtF,KAAK,mBAAmB,GAAG,KAAK,GAAG,SAAS,GAAG,KAAK,GAAG,QAAQ,GAAG,MAAM,GAAG,OAAO,CAAC;AAUnF,KAAK,mBAAmB,GAAG,IAAI,CAAC,YAAY,EAAE,IAAI,CAAC,CAAC;AAEpD,KAAK,aAAa,GAAG;IACjB,KAAK,EAAE,QAAQ,GAAG,SAAS,CAAC;IAC5B,KAAK,EAAE,KAAK,CAAC;CAChB,CAAC;AAEF,KAAK,mBAAmB,GAAG;IACvB,WAAW,IAAI,aAAa,EAAE,CAAC;IAC/B,aAAa,IAAI,MAAM,GAAG,SAAS,CAAC;IACpC,gBAAgB,IAAI,MAAM,EAAE,GAAG,SAAS,CAAC;IACzC,kBAA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E,MAAM,EAAE,UAAU,CAAC,EAAE,MAAM,KAAK,eAAe,GAC5E,eAAe,CAEjB;AAkHD,wBAAgB,8BAA8B,CAAC,MAAM,SAAS,SAAS,EACnE,eAAe,EAAE,IAAI,CACjB,mBAAmB,EACnB,kBAAkB,GAAG,oBAAoB,GAAG,iBAAiB,CAChE,EACD,aAAa,EAAE,iBAAiB,CAAC,MAAM,CAAC,EACxC,cAAc,EAAE,kBAAkB,GACnC,+BAA+B,CAAC,MAAM,CAAC,CA6DzC;AAoDD,wBAAgB,4BAA4B,CACxC,WAAW,EAAE,IAAI,CAAC,uBAAuB,EAAE,iBAAiB,GAAG,iBAAiB,CAAC,GAClF,IAAI,CAoBN;AAED,wBAAgB,8BAA8B,CAAC,WAAW,EAAE,uBAAuB,GAAG,IAAI,CAWzF;AA+HD,wBAAgB,kCAAkC,CAC9C,EAAE,EAAE,mBAAmB,EACvB,kBAAkB,GAAE,OAAO,qBAA6C,EACxE,eAAe,CAAC,EAAE,IAAI,CAAC,mBAAmB,EAAE,iBAAiB,CAAC,GAC/D,IAAI,CAiBN;AAED,MAAM,WAAW,cAAc;IAC3B,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,SAAS,CAAC,EAAE,OAAO,CAAC;CACvB;AAED,wBAAgB,2BAA2B,CACvC,cAAc,GAAE,cAAmB,GACpC,qBAAqB,CA8FvB;AAED,wBAAsB,YAAY,CAC9B,YAAY,GAAE,qBAAqD,GACpE,OAAO,CAAC,IAAI,CAAC,CASf"}
|
|
@@ -18,7 +18,11 @@ export class BkperInteractiveMode extends InteractiveMode {
|
|
|
18
18
|
init: { get: () => super.init }
|
|
19
19
|
});
|
|
20
20
|
return __awaiter(this, void 0, void 0, function* () {
|
|
21
|
-
|
|
21
|
+
const interactiveMode = this;
|
|
22
|
+
interactiveMode.getChangelogForDisplay = () => undefined;
|
|
23
|
+
if (interactiveMode.keybindings) {
|
|
24
|
+
installBkperSessionKeybindings(interactiveMode.keybindings);
|
|
25
|
+
}
|
|
22
26
|
yield _super.init.call(this);
|
|
23
27
|
});
|
|
24
28
|
}
|
|
@@ -174,7 +178,51 @@ function reportDiagnostics(diagnostics) {
|
|
|
174
178
|
}
|
|
175
179
|
}
|
|
176
180
|
const STARTUP_LEFT_PADDING = ' ';
|
|
181
|
+
const BKPER_SESSION_KEYBINDINGS = {
|
|
182
|
+
'app.session.resume': 'ctrl+s',
|
|
183
|
+
'app.session.tree': 'ctrl+r',
|
|
184
|
+
'app.session.fork': 'ctrl+x',
|
|
185
|
+
};
|
|
186
|
+
const installedBkperKeybindingsManagers = new WeakSet();
|
|
177
187
|
const NO_MODELS_STARTUP_HINT = 'No model provider configured. Use /login or add an API key.';
|
|
188
|
+
function keybindingConfigIncludesShortcut(configuredBinding, shortcut) {
|
|
189
|
+
const normalizedShortcut = shortcut.toLowerCase();
|
|
190
|
+
const configuredShortcuts = Array.isArray(configuredBinding)
|
|
191
|
+
? configuredBinding
|
|
192
|
+
: [configuredBinding];
|
|
193
|
+
return configuredShortcuts.some(configuredShortcut => (configuredShortcut === null || configuredShortcut === void 0 ? void 0 : configuredShortcut.toLowerCase()) === normalizedShortcut);
|
|
194
|
+
}
|
|
195
|
+
function isShortcutClaimedByUserBinding(userBindings, targetKeybinding, shortcut) {
|
|
196
|
+
return Object.entries(userBindings).some(([keybinding, configuredBinding]) => keybinding !== targetKeybinding &&
|
|
197
|
+
keybindingConfigIncludesShortcut(configuredBinding, shortcut));
|
|
198
|
+
}
|
|
199
|
+
export function applyBkperSessionKeybindings(keybindings) {
|
|
200
|
+
const userBindings = keybindings.getUserBindings();
|
|
201
|
+
const nextBindings = Object.assign({}, userBindings);
|
|
202
|
+
let changed = false;
|
|
203
|
+
for (const [keybinding, shortcut] of Object.entries(BKPER_SESSION_KEYBINDINGS)) {
|
|
204
|
+
if (nextBindings[keybinding] !== undefined ||
|
|
205
|
+
isShortcutClaimedByUserBinding(userBindings, keybinding, shortcut)) {
|
|
206
|
+
continue;
|
|
207
|
+
}
|
|
208
|
+
nextBindings[keybinding] = shortcut;
|
|
209
|
+
changed = true;
|
|
210
|
+
}
|
|
211
|
+
if (changed) {
|
|
212
|
+
keybindings.setUserBindings(nextBindings);
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
export function installBkperSessionKeybindings(keybindings) {
|
|
216
|
+
if (!installedBkperKeybindingsManagers.has(keybindings)) {
|
|
217
|
+
const reload = keybindings.reload.bind(keybindings);
|
|
218
|
+
keybindings.reload = () => {
|
|
219
|
+
reload();
|
|
220
|
+
applyBkperSessionKeybindings(keybindings);
|
|
221
|
+
};
|
|
222
|
+
installedBkperKeybindingsManagers.add(keybindings);
|
|
223
|
+
}
|
|
224
|
+
applyBkperSessionKeybindings(keybindings);
|
|
225
|
+
}
|
|
178
226
|
function wrapStartupHeaderLine(line, width) {
|
|
179
227
|
const normalizedWidth = Math.max(1, width);
|
|
180
228
|
const trimmedLine = line.trim();
|
|
@@ -225,6 +273,10 @@ const BKPER_BANNER = [
|
|
|
225
273
|
function formatStartupHint(theme, key, description) {
|
|
226
274
|
return theme.fg('dim', key) + theme.fg('muted', ` ${description}`);
|
|
227
275
|
}
|
|
276
|
+
function formatStartupCommandShortcut(command, keybinding) {
|
|
277
|
+
const shortcut = keyText(keybinding);
|
|
278
|
+
return shortcut ? `${command} (${shortcut})` : command;
|
|
279
|
+
}
|
|
228
280
|
function buildStartupHeaderLines(theme, modelRegistry, width) {
|
|
229
281
|
const lines = [
|
|
230
282
|
...BKPER_BANNER.map(line => theme.bold(theme.fg('accent', line))),
|
|
@@ -235,10 +287,10 @@ function buildStartupHeaderLines(theme, modelRegistry, width) {
|
|
|
235
287
|
formatStartupHint(theme, `${keyText('app.clear')} twice`, 'to exit'),
|
|
236
288
|
formatStartupHint(theme, '/', 'for commands'),
|
|
237
289
|
formatStartupHint(theme, '/new', 'to start new session'),
|
|
238
|
-
formatStartupHint(theme, '/resume', 'to resume a session'),
|
|
290
|
+
formatStartupHint(theme, formatStartupCommandShortcut('/resume', 'app.session.resume'), 'to resume a session'),
|
|
239
291
|
formatStartupHint(theme, '/clone', 'to duplicate session'),
|
|
240
|
-
formatStartupHint(theme, '/fork', 'to branch from a message'),
|
|
241
|
-
formatStartupHint(theme, '/tree', 'for session tree'),
|
|
292
|
+
formatStartupHint(theme, formatStartupCommandShortcut('/fork', 'app.session.fork'), 'to branch from a message'),
|
|
293
|
+
formatStartupHint(theme, formatStartupCommandShortcut('/tree', 'app.session.tree'), 'for session tree'),
|
|
242
294
|
formatStartupHint(theme, '!', 'to run bash'),
|
|
243
295
|
];
|
|
244
296
|
if (modelRegistry.getAvailable().length === 0) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"run-agent-mode.js","sourceRoot":"","sources":["../../src/agent/run-agent-mode.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EACH,8BAA8B,EAC9B,yBAAyB,EACzB,0BAA0B,EAC1B,WAAW,EACX,eAAe,EACf,OAAO,EACP,cAAc,EACd,eAAe,GAKlB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,iCAAiC,CAAC;AACxE,OAAO,EAAE,yCAAyC,EAAE,MAAM,4BAA4B,CAAC;AACvF,OAAO,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AACjE,OAAO,EAAE,yBAAyB,EAAE,MAAM,oBAAoB,CAAC;AA2D/D,MAAM,OAAO,oBAAqB,SAAQ,eAAe;IAC/C,IAAI;;;;;YACL,IAA2C,CAAC,sBAAsB,GAAG,GAAG,EAAE,CAAC,SAAS,CAAC;YACtF,MAAM,OAAM,IAAI,WAAE,CAAC;QACvB,CAAC;KAAA;CACJ;AAgBD,MAAM,UAAU,0BAA0B,CACtC,eAAyD,EACzD,OAAe;IAEf,OAAO,eAAe,CAAC,WAAW,EAAE,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,CAAC;QAC5D,IAAI,EAA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gB,YAAY;yDAC9B,eAAsC,2BAA2B,EAAE;;;QAEnE,YAAA,OAAO,CAAC,GAAG,EAAC,qBAAqB,uCAArB,qBAAqB,GAAK,GAAG,EAAC;QAE1C,MAAM,EAAE,OAAO,EAAE,oBAAoB,EAAE,WAAW,GAAG,EAAE,EAAE,GAAG,MAAM,YAAY,CAAC,aAAa,EAAE,CAAC;QAC/F,iBAAiB,CAAC,WAAW,CAAC,CAAC;QAE/B,MAAM,IAAI,GAAG,YAAY,CAAC,qBAAqB,CAAC,OAAO,EAAE,oBAAoB,CAAC,CAAC;QAE/E,MAAM,IAAI,CAAC,GAAG,EAAE,CAAC;IACrB,CAAC;CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"system-prompt.d.ts","sourceRoot":"","sources":["../../src/agent/system-prompt.ts"],"names":[],"mappings":"AAiGA,wBAAgB,yBAAyB,IAAI,MAAM,CAgDlD;AAED,eAAO,MAAM,yBAAyB,
|
|
1
|
+
{"version":3,"file":"system-prompt.d.ts","sourceRoot":"","sources":["../../src/agent/system-prompt.ts"],"names":[],"mappings":"AAiGA,wBAAgB,yBAAyB,IAAI,MAAM,CAgDlD;AAED,eAAO,MAAM,yBAAyB,QAsBrC,CAAC"}
|
|
@@ -142,6 +142,7 @@ ${buildToolPromptSection()}
|
|
|
142
142
|
- If a question can be answered by exploring the codebase, explore the codebase instead.
|
|
143
143
|
- Only perform mutating actions (creating/editing files, destructive shell commands, API writes) when the user has explicitly requested that change in the current turn. When exploring, debugging, or unsure, propose the change and wait for confirmation instead of acting.
|
|
144
144
|
- Treat any \`bkper\` CLI command that writes to a Book (transactions, accounts, groups, books, collections, apps, imports, batch ops) as irreversible: show the exact command and wait for explicit user confirmation before running it. Read-only commands (list, get, balances, search, export) need no confirmation.
|
|
145
|
+
- For accounting numbers — balances, statements, reconciliations, taxes — never let raw LLM output be final; use or establish a deterministic, auditable route, keep computation separate from commentary, and make assumptions explicit.
|
|
145
146
|
- Think in resources, movements, and balances — not debits and credits.
|
|
146
147
|
- Extend meaning with properties before adding structural complexity.
|
|
147
148
|
- Model domain and flows before coding; represent business reality, not technical shortcuts.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"system-prompt.js","sourceRoot":"","sources":["../../src/agent/system-prompt.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,wBAAwB,EACxB,wBAAwB,EACxB,wBAAwB,EACxB,yBAAyB,GAC5B,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC,SAAS,cAAc,CAAC,QAAgB;IACpC,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;IAC7D,OAAO,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC;AACzD,CAAC;AAED,SAAS,oBAAoB;IACzB,MAAM,WAAW,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,iCAAiC,CAAC,CAAC,CAAC;IAC1F,IAAI,GAAG,GAAG,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC;IACpC,OAAO,GAAG,KAAK,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC;QAC/B,IAAI,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,cAAc,CAAC,CAAC,EAAE,CAAC;YAC7C,OAAO,GAAG,CAAC;QACf,CAAC;QACD,GAAG,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IAC5B,CAAC;IACD,OAAO,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC;AACrC,CAAC;AAED,SAAS,sBAAsB,CAAC,IAAwB;I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GAAG,SAAS,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,QAAQ,CAAC;IAC9D,OAAO,qBAAqB,SAAS,2HAA2H,cAAc,CAAC,IAAI,CAC/K,IAAI,CACP,EAAE,CAAC;AACR,CAAC;AAED,MAAM,UAAU,yBAAyB;IACrC,MAAM,gBAAgB,GAAG,cAAc,CAAC,kBAAkB,CAAC,CAAC;IAC5D,MAAM,SAAS,GAAG,cAAc,CAAC,UAAU,CAAC,CAAC;IAC7C,MAAM,MAAM,GAAG,oBAAoB,EAAE,CAAC;IACtC,MAAM,UAAU,GAAG,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAChD,MAAM,cAAc,GAAG,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;IACxD,OAAO,GAAG,yBAAyB;;;;;;;;EAQrC,gBAAgB;;;;;;;;;;;EAWhB,SAAS;;;;;;;;EAQT,UAAU;;;;;;EAMV,cAAc;;;;;;;;CAQf,CAAC;AACF,CAAC;AAED,MAAM,CAAC,MAAM,yBAAyB,GAAG;;;;;;;;EAQvC,sBAAsB,EAAE;;;;;;;;;;;;;;CAczB,CAAC"}
|
|
@@ -96,8 +96,8 @@ More information at the [Bkper Developer Documentation](https://bkper.com/docs/#
|
|
|
96
96
|
- `logoUrl?`: `string` — The App logo url
|
|
97
97
|
- `logoUrlDark?`: `string` — The App logo url in dark mode
|
|
98
98
|
- `menuOpenMode?`: `"SIDEBAR" | "EXPANDED" | "NEW_TAB"` — How the app menu opens. Default to SIDEBAR
|
|
99
|
-
- `menuPopupHeight?`: `string` —
|
|
100
|
-
- `menuPopupWidth?`: `string` —
|
|
99
|
+
- `menuPopupHeight?`: `string` — Deprecated
|
|
100
|
+
- `menuPopupWidth?`: `string` — Deprecated
|
|
101
101
|
- `menuText?`: `string` — The contex menu text - default to the App name
|
|
102
102
|
- `menuUrl?`: `string` — The context menu url
|
|
103
103
|
- `menuUrlDev?`: `string` — The context menu url in dev mode
|
|
@@ -360,6 +360,13 @@ More information at the [Bkper Developer Documentation](https://bkper.com/docs/#
|
|
|
360
360
|
- `updatedAt?`: `string` — The last update timestamp, in milliseconds
|
|
361
361
|
- `url?`: `string` — The file serving url
|
|
362
362
|
|
|
363
|
+
### FileList
|
|
364
|
+
|
|
365
|
+
**Properties:**
|
|
366
|
+
|
|
367
|
+
- `cursor?`: `string` — The cursor, for pagination
|
|
368
|
+
- `items?`: `bkper.File[]` — List items
|
|
369
|
+
|
|
363
370
|
### Group
|
|
364
371
|
|
|
365
372
|
**Properties:**
|
package/lib/docs/bkper-js.md
CHANGED
|
@@ -631,9 +631,10 @@ It contains all `Accounts` where `Transactions` are recorded/posted;
|
|
|
631
631
|
- `getTransaction(id: string)` → `Promise<Transaction | undefined>` — Retrieve a transaction by id.
|
|
632
632
|
- `getVisibility()` / `setVisibility(visibility: Visibility)` → `Visibility` — Gets the visibility of the book.
|
|
633
633
|
- `json()` → `bkper.Book` — Gets an immutable copy of the JSON payload for this resource.
|
|
634
|
-
- `listEvents(afterDate: string | null, beforeDate: string | null, onError: boolean, resourceId: string | null, limit: number, cursor?: string)` → `Promise<EventList>` — Lists events in the Book based on the provided parameters.
|
|
634
|
+
- `listEvents(afterDate: string | null, beforeDate: string | null, onError: boolean | null, resourceId: string | null, limit: number, cursor?: string)` → `Promise<EventList>` — Lists events in the Book based on the provided parameters.
|
|
635
|
+
- `listFiles(limit?: number, cursor?: string)` → `Promise<FileList>` — Lists files in the Book, for pagination.
|
|
635
636
|
- `listTransactions(query?: string, limit?: number, cursor?: string)` → `Promise<TransactionList>` — Lists transactions in the Book based on the provided query, limit, and cursor, for pagination.
|
|
636
|
-
- `mergeTransactions(transaction1: Transaction, transaction2: Transaction)` → `Promise<Transaction>` — Merge two `Transactions` into a single new canonical transaction.
|
|
637
|
+
- `mergeTransactions(transaction1: string | bkper.Transaction | Transaction, transaction2: string | bkper.Transaction | Transaction)` → `Promise<Transaction>` — Merge two `Transactions` into a single new canonical transaction.
|
|
637
638
|
- `parseDate(date: string)` → `Date` — Parse a date string according to date pattern and timezone of the Book. Also parse ISO yyyy-mm-dd format.
|
|
638
639
|
- `parseValue(value: string)` → `Amount | undefined` — Parse a value string according to `DecimalSeparator` and fraction digits of the Book.
|
|
639
640
|
- `remove()` → `Promise<Book>` — Warning!
|
|
@@ -909,6 +910,19 @@ A File can be attached to a `Transaction` or used to import data.
|
|
|
909
910
|
|
|
910
911
|
*Standard property methods (deleteProperty, getProperties, getProperty, getPropertyKeys, getVisibleProperties, setProperties, setProperty, setVisibleProperties, setVisibleProperty) — see Account.*
|
|
911
912
|
|
|
913
|
+
### FileList
|
|
914
|
+
|
|
915
|
+
A list associated with a file query.
|
|
916
|
+
|
|
917
|
+
**Constructor:** `new FileList(book: Book, payload: bkper.FileList)`
|
|
918
|
+
|
|
919
|
+
**Methods:**
|
|
920
|
+
|
|
921
|
+
- `getCursor()` → `string | undefined` — Gets the cursor associated with the query for pagination.
|
|
922
|
+
- `getFirst()` → `File | undefined` — Gets the first File in the list.
|
|
923
|
+
- `getItems()` → `File[]` — Gets the files in the list.
|
|
924
|
+
- `size()` → `number` — Gets the total number of files in the list.
|
|
925
|
+
|
|
912
926
|
### Group *(extends ResourceProperty<bkper.Group>)*
|
|
913
927
|
|
|
914
928
|
This class defines a Group of `Accounts`.
|
|
@@ -1284,6 +1298,12 @@ Use your own API key for dedicated quota limits and project-level usage tracking
|
|
|
1284
1298
|
API keys are for project identification only, not for authentication or agent attribution.
|
|
1285
1299
|
Agent attribution is handled separately via the `agentIdProvider`.
|
|
1286
1300
|
|
|
1301
|
+
**oauthTokenProvider**
|
|
1302
|
+
|
|
1303
|
+
If omitted or if it returns undefined, requests are sent without an Authorization header.
|
|
1304
|
+
This supports environments where authentication is injected outside bkper-js, such as
|
|
1305
|
+
Bkper Platform outbound for server-side app routes.
|
|
1306
|
+
|
|
1287
1307
|
**requestRetryHandler**
|
|
1288
1308
|
|
|
1289
1309
|
This function is called when a request fails and needs to be retried.
|
|
@@ -1330,6 +1350,8 @@ Enum that represents event types.
|
|
|
1330
1350
|
- `ACCOUNT_CREATED`
|
|
1331
1351
|
- `ACCOUNT_DELETED`
|
|
1332
1352
|
- `ACCOUNT_UPDATED`
|
|
1353
|
+
- `BOOK_AUDITED`
|
|
1354
|
+
- `BOOK_CREATED`
|
|
1333
1355
|
- `BOOK_DELETED`
|
|
1334
1356
|
- `BOOK_UPDATED`
|
|
1335
1357
|
- `COLLABORATOR_ADDED`
|
|
@@ -1,225 +1,78 @@
|
|
|
1
|
-
# Financial Statements — Deterministic
|
|
1
|
+
# Financial Statements — Deterministic Reporting
|
|
2
2
|
|
|
3
|
-
Use this guide when a user asks for a balance sheet, P&L, income statement, profit and loss, or
|
|
3
|
+
Use this guide when a user asks for a balance sheet, P&L, income statement, profit and loss, or another ledger-derived financial report from a Bkper Book.
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## Principle
|
|
6
6
|
|
|
7
|
-
Financial statements are
|
|
7
|
+
Financial statements are deterministic accounting work. For the same Book snapshot, statement type, period, and reporting assumptions, the same inputs must produce the same numbers.
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
Do not make raw LLM reasoning the final source of statement values. Use or establish a deterministic, auditable reporting route, then keep optional AI commentary separate from the computed statement.
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
Prefer existing trusted routes before creating new ones. A trusted route may be a script, CLI pipeline, platform app, bot, report config, template, or another project-standard artifact that the user already relies on.
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
If none exists, recommend the smallest auditable route that fits the user's context.
|
|
14
14
|
|
|
15
|
-
##
|
|
15
|
+
## Bkper statement semantics
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
Statements come from balances calculated from Transactions and organized by Groups.
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
| Statement | Accounts | Time basis | Query pattern |
|
|
20
|
+
| --- | --- | --- | --- |
|
|
21
|
+
| Balance Sheet | Asset and/or Liability | Position at a point in time | `group:'<root>' before:<date>` |
|
|
22
|
+
| P&L / Income Statement | Incoming and/or Outgoing | Activity during a period | `group:'<root>' after:<start> before:<end>` |
|
|
20
23
|
|
|
21
|
-
|
|
22
|
-
- `scripts/`
|
|
23
|
-
- `package.json` scripts
|
|
24
|
-
- local config/spec files
|
|
25
|
-
- `AGENTS.md`
|
|
26
|
-
|
|
27
|
-
If a local statement runner already exists:
|
|
28
|
-
|
|
29
|
-
- Use it as the default route
|
|
30
|
-
- Pass explicit parameters for book, statement type, and dates/period
|
|
31
|
-
- Return the result produced by that runner
|
|
32
|
-
- Do **not** rediscover groups or rebuild fresh balance queries unless the user explicitly asks to update or rebuild the reporting logic
|
|
33
|
-
|
|
34
|
-
Once a deterministic route exists, prefer it over live ad-hoc querying.
|
|
35
|
-
|
|
36
|
-
---
|
|
37
|
-
|
|
38
|
-
## Step 1 — If none exists, bootstrap one
|
|
39
|
-
|
|
40
|
-
If no deterministic runner exists yet, do **not** treat a live one-off balance query as the canonical solution.
|
|
41
|
-
|
|
42
|
-
Instead:
|
|
43
|
-
|
|
44
|
-
1. Explain briefly that financial statements should be generated by repeatable local code/config
|
|
45
|
-
2. Offer to create that local statement runner for the project
|
|
46
|
-
3. Ask approval before writing files
|
|
47
|
-
4. Use live Bkper queries only as **bootstrap/discovery steps** to build the deterministic route correctly
|
|
48
|
-
|
|
49
|
-
If the request is ambiguous (for example, “run a financial statement”), clarify whether the user wants:
|
|
50
|
-
|
|
51
|
-
- Balance Sheet
|
|
52
|
-
- Profit & Loss / Income Statement
|
|
53
|
-
- Both
|
|
54
|
-
|
|
55
|
-
During bootstrap, it is acceptable to create either:
|
|
56
|
-
|
|
57
|
-
- a small shell script that runs fixed CLI queries and formats the output, or
|
|
58
|
-
- a `bkper-js` script that resolves dates, loads groups, and renders the statement in a stable format
|
|
59
|
-
|
|
60
|
-
Prefer the smallest boring solution that is easy to rerun and inspect.
|
|
61
|
-
|
|
62
|
-
---
|
|
63
|
-
|
|
64
|
-
## Step 2 — Discover the correct root groups
|
|
65
|
-
|
|
66
|
-
Use these commands during bootstrap to identify the correct statement roots.
|
|
67
|
-
|
|
68
|
-
```bash
|
|
69
|
-
bkper group list -b <bookId> --format csv
|
|
70
|
-
```
|
|
71
|
-
|
|
72
|
-
Inspect the output and identify **top-level groups** (no parent). Root group names vary by book — common examples: `Total Equity`, `Balance Sheet`, `Profit & Loss`, `Results`, `Net Worth`.
|
|
73
|
-
|
|
74
|
-
Identify each root group by the account types it contains:
|
|
75
|
-
|
|
76
|
-
| Root group contains | Statement |
|
|
77
|
-
| ---------------------------------- | ---------------------------- |
|
|
78
|
-
| ASSET and/or LIABILITY accounts | Balance Sheet |
|
|
79
|
-
| INCOMING and/or OUTGOING accounts | Profit & Loss / Income Statement |
|
|
80
|
-
|
|
81
|
-
When you discover the correct roots, persist them for future runs.
|
|
82
|
-
|
|
83
|
-
Prefer storing the **group ID** in the local report config/script. If the execution route also needs the group name for a query string, persist the name as well.
|
|
84
|
-
|
|
85
|
-
### If the book has no usable statement hierarchy
|
|
86
|
-
|
|
87
|
-
If Step 2 does **not** reveal clear statement roots, treat that as a modeling gap, not as permission to improvise one silently.
|
|
88
|
-
|
|
89
|
-
In that case:
|
|
24
|
+
Rules:
|
|
90
25
|
|
|
91
|
-
-
|
|
92
|
-
-
|
|
93
|
-
-
|
|
94
|
-
-
|
|
95
|
-
-
|
|
96
|
-
- once approved, validate the hierarchy with live balance queries and then persist it in the local runner/config
|
|
26
|
+
- Use the relevant **root reporting group**. Do not silently substitute subgroups such as `Assets`, `Liabilities`, `Revenue`, or `Expenses` when the Book has a higher reporting root.
|
|
27
|
+
- Balance Sheet uses `before:` because permanent Accounts accumulate continuously.
|
|
28
|
+
- P&L uses `after:` + `before:` because non-permanent Accounts report activity within a period.
|
|
29
|
+
- `after:` is inclusive and `before:` is exclusive.
|
|
30
|
+
- Do not query the whole Book without a reporting group or account filter.
|
|
97
31
|
|
|
98
|
-
|
|
32
|
+
Date examples:
|
|
99
33
|
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
34
|
+
| Request | Balance Sheet | P&L |
|
|
35
|
+
| --- | --- | --- |
|
|
36
|
+
| Current month | `before:$m` | `after:$m-1 before:$m` |
|
|
37
|
+
| Current year | `before:$y` | `after:$y-1 before:$y` |
|
|
38
|
+
| Full year 2024 | `before:2025-01-01` | `after:2024-01-01 before:2025-01-01` |
|
|
103
39
|
|
|
104
|
-
|
|
40
|
+
`$m` and `$y` are Bkper query date variables for current month-end and current year-end. In shell commands, wrap queries containing `$` variables in single quotes to prevent shell expansion.
|
|
105
41
|
|
|
106
|
-
|
|
42
|
+
## Working route
|
|
107
43
|
|
|
108
|
-
|
|
44
|
+
Before computing a statement, inspect local project context for an existing reporting route:
|
|
109
45
|
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
-q "group:'<rootGroup>' before:<date>" \
|
|
117
|
-
--format csv --expanded 2
|
|
118
|
-
```
|
|
119
|
-
|
|
120
|
-
**Profit & Loss / Income Statement** — non-permanent accounts, activity within a period:
|
|
121
|
-
|
|
122
|
-
```bash
|
|
123
|
-
bkper balance list -b <bookId> \
|
|
124
|
-
-q "group:'<rootGroup>' after:<start> before:<end>" \
|
|
125
|
-
--format csv --expanded 2
|
|
126
|
-
```
|
|
127
|
-
|
|
128
|
-
Use the output to confirm the correct hierarchy, totals, and period semantics before persisting the script/spec.
|
|
129
|
-
|
|
130
|
-
---
|
|
131
|
-
|
|
132
|
-
## Step 4 — Persist the deterministic route locally
|
|
133
|
-
|
|
134
|
-
After discovery and validation, create or update local artifacts so future requests reuse the same route.
|
|
135
|
-
|
|
136
|
-
Typical artifacts:
|
|
46
|
+
- `AGENTS.md`
|
|
47
|
+
- `reports/`
|
|
48
|
+
- `scripts/`
|
|
49
|
+
- package scripts
|
|
50
|
+
- report config/spec files
|
|
51
|
+
- platform app or bot code
|
|
137
52
|
|
|
138
|
-
|
|
139
|
-
- `reports/profit-and-loss.sh`
|
|
140
|
-
- `scripts/financial-statements.ts`
|
|
141
|
-
- `reports/financial-statements.json`
|
|
142
|
-
- `package.json` scripts such as `report:balance-sheet` and `report:pl`
|
|
53
|
+
If a route exists, use it and pass explicit Book, statement, and date parameters. Do not rediscover groups or rebuild the report unless the user asks to change the reporting logic.
|
|
143
54
|
|
|
144
|
-
Persist the decisions that make the report
|
|
55
|
+
If no route exists, use read-only Bkper queries only for discovery and validation, then propose a repeatable route. Persist the decisions that make the report reproducible:
|
|
145
56
|
|
|
146
|
-
-
|
|
57
|
+
- Book ID
|
|
147
58
|
- statement type
|
|
148
|
-
- root group
|
|
149
|
-
-
|
|
150
|
-
- timezone, if relevant to date boundaries
|
|
151
|
-
- expanded depth / output detail level
|
|
152
|
-
- exact date semantics for each statement type
|
|
59
|
+
- root group IDs and names
|
|
60
|
+
- date boundaries and timezone, when relevant
|
|
153
61
|
- output format
|
|
62
|
+
- detail/expansion level
|
|
63
|
+
- any local reporting assumptions
|
|
154
64
|
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
If helpful, also create or update a local `AGENTS.md` note telling future agent sessions to use the canonical financial statement script. `AGENTS.md` is **optional persistence**, not a prerequisite for the first request.
|
|
158
|
-
|
|
159
|
-
---
|
|
160
|
-
|
|
161
|
-
## Step 5 — Use the script for future requests
|
|
162
|
-
|
|
163
|
-
Once the local statement runner exists:
|
|
164
|
-
|
|
165
|
-
- Use it as the default route for balance sheet and P&L requests
|
|
166
|
-
- Resolve relative periods like “last year” into explicit date boundaries in code/config
|
|
167
|
-
- Keep deterministic statement generation separate from optional AI commentary
|
|
168
|
-
- If the reporting logic must change, update the script/config instead of improvising a fresh one-off route
|
|
169
|
-
|
|
170
|
-
Do not re-decide the accounting method on every request.
|
|
171
|
-
|
|
172
|
-
---
|
|
173
|
-
|
|
174
|
-
## One-off exploratory fallback
|
|
175
|
-
|
|
176
|
-
If the user explicitly does **not** want to create the script now and only wants a quick one-off answer, you may run live balance queries directly.
|
|
177
|
-
|
|
178
|
-
In that case:
|
|
179
|
-
|
|
180
|
-
- Clearly label the result as **exploratory / provisional**
|
|
181
|
-
- State that it is **not yet** the canonical deterministic reporting route for the project
|
|
182
|
-
- Recommend persisting a local script/config if the user wants repeatable accounting output in future requests
|
|
183
|
-
|
|
184
|
-
---
|
|
185
|
-
|
|
186
|
-
## Date patterns
|
|
187
|
-
|
|
188
|
-
Use these patterns when validating or implementing the deterministic runner.
|
|
189
|
-
|
|
190
|
-
| Request | Balance Sheet | Profit & Loss |
|
|
191
|
-
| -------------- | -------------------------- | ------------------------------ |
|
|
192
|
-
| Current month | `before:$m` | `after:$m-1 before:$m` |
|
|
193
|
-
| Current year | `before:$y` | `after:$y-1 before:$y` |
|
|
194
|
-
| Full year 2024 | `before:2025-01-01` | `after:2024-01-01 before:2025-01-01` |
|
|
195
|
-
|
|
196
|
-
- `after:` is **inclusive**, `before:` is **exclusive**
|
|
197
|
-
- `$d` = today, `$m` = current month-end, `$y` = current year-end
|
|
198
|
-
- In shell, wrap queries containing `$` variables in **single quotes** to prevent shell expansion
|
|
65
|
+
If the Book has no clear reporting hierarchy, treat that as a modeling gap. Do not invent a hierarchy silently. Inspect the Book's existing language and structure, propose the smallest hierarchy that fits the user's goal, and ask before changing Accounts or Groups.
|
|
199
66
|
|
|
200
|
-
|
|
67
|
+
## Examples & Patterns
|
|
201
68
|
|
|
202
|
-
|
|
69
|
+
Use the implementation style that matches the user's context:
|
|
203
70
|
|
|
204
|
-
- **
|
|
205
|
-
- **
|
|
206
|
-
- **P&L** uses `after:` + `before:` — non-permanent accounts track period activity
|
|
207
|
-
- **Use `--format csv`** for token efficiency when loading bootstrap results into an LLM context
|
|
208
|
-
- **Use `--expanded 2`** to see meaningful sub-totals in the hierarchy
|
|
209
|
-
- Once a canonical local report route exists, **reuse it instead of rediscovering the logic**
|
|
210
|
-
- Prefer persisting reporting decisions in code/config rather than relying on session memory
|
|
71
|
+
- **Scripts & CLI** — best for local, inspectable, repeatable reports and lightweight project workflows.
|
|
72
|
+
- **Platform Apps / Bots** — best for shared, durable, event-driven, or operational reporting workflows.
|
|
211
73
|
|
|
212
|
-
|
|
74
|
+
Existing trusted reports or templates may be reused when they are already the user's accepted reporting route, but they are not required by this guide.
|
|
213
75
|
|
|
214
|
-
##
|
|
76
|
+
## Provisional answers
|
|
215
77
|
|
|
216
|
-
|
|
217
|
-
| --- | --- |
|
|
218
|
-
| Immediately running ad-hoc balance queries as the default response to a first statement request | First look for a local runner; if none exists, propose creating one and use queries only for bootstrap |
|
|
219
|
-
| Assuming `AGENTS.md` must already exist | `AGENTS.md` can be created or updated during bootstrap to route future requests |
|
|
220
|
-
| `group:'Assets' before:2025-01-01` | `group:'Total Equity' before:2025-01-01` — use root group, not subgroup |
|
|
221
|
-
| Inventing a new statement hierarchy silently because no roots were found | Explain that the book is not yet statement-ready, propose a minimal hierarchy aligned with the user's language and local standards, and ask approval before changing structure |
|
|
222
|
-
| `before:$m` for P&L | `after:$m-1 before:$m` — P&L needs a period, not just an end date |
|
|
223
|
-
| `after:$y-1 before:$d` | `after:$y-1 before:$y` — use consistent date basis on both ends |
|
|
224
|
-
| `-q 'before:2025-01-01'` without group filter | `-q "group:'<rootGroup>' before:2025-01-01"` — always filter by group |
|
|
225
|
-
| Re-interpreting “last year” differently each time | Resolve relative periods into explicit dates inside the canonical script/config |
|
|
78
|
+
If the user explicitly wants a quick answer and does not want to establish a route, live read-only balance queries are acceptable. Label the result as **exploratory / provisional** and recommend a deterministic route for future repeatability.
|
package/lib/docs/index.md
CHANGED
|
@@ -5,7 +5,7 @@ Reference docs for Bkper tasks. Load only the specific doc(s) relevant to the ta
|
|
|
5
5
|
- **data-management.md** — CLI reference for managing financial data and files: books, accounts, groups, files, transactions, per-account balance queries, query operators (on:, after:, before:, account:, group:), output formats (table/json/csv), batch operations via stdin/piping, collections.
|
|
6
6
|
- **app-management.md** — CLI reference for building and deploying Bkper apps: dev/build/deploy workflow, app install/uninstall, secrets management, app logs, bkper.yaml configuration reference (identity, branding, events, menu integration, deployment).
|
|
7
7
|
- **app-building.md** — Full app-building reference: single Worker app architecture (`client/` + `server/`), development loop, `/api/*` routes, `/events` handlers, deployment patterns, the Bkper Platform, and self-hosted alternatives. Includes authentication patterns for web clients (`@bkper/web-auth`), server API routes (`Authorization: Bearer` on `/api/*` with outbound auth injection), platform event handlers (`new Bkper()` with outbound auth injection), and local development.
|
|
8
|
-
- **financial-statements.md** —
|
|
9
|
-
- **taxes.md** — Deterministic
|
|
8
|
+
- **financial-statements.md** — Deterministic reporting principles and Bkper query semantics for balance sheet and P&L: trusted routes, root reporting groups, permanent vs period date rules, and provisional query patterns.
|
|
9
|
+
- **taxes.md** — Deterministic tax reporting principles: trusted routes, user-approved tax-relevant groups/accounts, period activity queries, explicit jurisdiction assumptions, and provisional query patterns.
|
|
10
10
|
- **bkper-js.md** — bkper-js Node.js/browser SDK: Bkper, Book, Account, Transaction, Group, Balance classes, all methods, getBalancesReport, OAuth configuration, library setup.
|
|
11
11
|
- **bkper-api-types.md** — Bkper REST API TypeScript interfaces: Book, Account, Transaction, Group, Balance, Collection, File — field names and types used by the API and bkper-js.
|
package/lib/docs/taxes.md
CHANGED
|
@@ -1,264 +1,80 @@
|
|
|
1
|
-
# Taxes — Deterministic
|
|
1
|
+
# Taxes — Deterministic Reporting
|
|
2
2
|
|
|
3
|
-
Use this guide when a user asks to
|
|
3
|
+
Use this guide when a user asks to do taxes, compute a tax position, prepare a filing summary, or reconcile tax-related balances from a Bkper Book.
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## Principle
|
|
6
6
|
|
|
7
|
-
Tax reporting is
|
|
7
|
+
Tax reporting is deterministic accounting work, but tax law is jurisdiction-specific. Do not invent rates, deductions, filing rules, or tax categories from general knowledge.
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
Do not make raw LLM reasoning the final source of tax numbers. Use or establish a deterministic, auditable route, then keep optional AI commentary separate from computed values.
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
A tax route may compute tax owed only when the applicable rules, rates, and assumptions are supplied by the user or encoded in a reviewed deterministic artifact. Otherwise, produce raw period data or a filing worksheet for the user or their advisor to apply local rules.
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
Prefer existing trusted routes before creating new ones. If none exists, recommend the smallest auditable route that fits the user's context.
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
## Bkper tax semantics
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
Tax reports usually combine period activity with tax-account positions or movements.
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
| Need | Time basis | Query pattern |
|
|
20
|
+
| --- | --- | --- |
|
|
21
|
+
| Revenue / income activity | Period activity | `group:'<revenueRoot>' after:<start> before:<end>` |
|
|
22
|
+
| Deductible cost / expense activity | Period activity | `group:'<expenseRoot>' after:<start> before:<end>` |
|
|
23
|
+
| Tax account movements | Period activity | `account:'<taxAccount>' after:<start> before:<end>` |
|
|
24
|
+
| Tax liability / credit balance | Position at period end | `account:'<taxAccount>' before:<end>` |
|
|
20
25
|
|
|
21
|
-
|
|
26
|
+
Rules:
|
|
22
27
|
|
|
23
|
-
|
|
28
|
+
- Use user-approved tax-relevant Groups and Accounts. Do not assume standard names such as `Revenue`, `VAT`, `Taxes`, or `Deductible Expenses` are correct for the Book.
|
|
29
|
+
- Period activity uses `after:` + `before:`.
|
|
30
|
+
- Tax liability or credit Accounts may need either period movements or an end balance, depending on the question.
|
|
31
|
+
- `after:` is inclusive and `before:` is exclusive.
|
|
32
|
+
- Do not query the whole Book without a tax-relevant group or account filter.
|
|
24
33
|
|
|
25
|
-
|
|
26
|
-
- `scripts/`
|
|
27
|
-
- `package.json` scripts
|
|
28
|
-
- local config/spec files
|
|
29
|
-
- `AGENTS.md`
|
|
30
|
-
|
|
31
|
-
If a local tax runner already exists:
|
|
32
|
-
|
|
33
|
-
- Use it as the default route
|
|
34
|
-
- Pass explicit parameters for book, period, and any tax-relevant overrides
|
|
35
|
-
- Return the result produced by that runner
|
|
36
|
-
- Do **not** rediscover groups or rebuild fresh queries unless the user explicitly asks to update or rebuild the tax logic
|
|
37
|
-
|
|
38
|
-
Once a deterministic route exists, prefer it over live ad-hoc querying.
|
|
39
|
-
|
|
40
|
-
---
|
|
41
|
-
|
|
42
|
-
## Step 1 — If none exists, bootstrap one
|
|
43
|
-
|
|
44
|
-
If no deterministic runner exists yet, do **not** treat a live one-off query as the canonical solution.
|
|
45
|
-
|
|
46
|
-
Instead:
|
|
47
|
-
|
|
48
|
-
1. Explain briefly that tax positions should be generated by a repeatable local engine
|
|
49
|
-
2. Offer to create that tax runner for the project
|
|
50
|
-
3. Ask approval before writing files
|
|
51
|
-
4. Use live Bkper queries only as **bootstrap/discovery steps** to build the deterministic route correctly
|
|
52
|
-
|
|
53
|
-
If the request is ambiguous (for example, "do my taxes"), clarify what the user wants:
|
|
54
|
-
|
|
55
|
-
- Tax position for a specific period (e.g., quarterly VAT, annual income tax)
|
|
56
|
-
- Tax filing summary / worksheet for their jurisdiction
|
|
57
|
-
- Reconciliation of tax-related balances
|
|
58
|
-
|
|
59
|
-
During bootstrap, it is acceptable to create either:
|
|
60
|
-
|
|
61
|
-
- a small shell script that runs fixed CLI queries and formats the output, or
|
|
62
|
-
- a `bkper-js` script that resolves dates, loads groups, and renders the tax position in a stable format
|
|
63
|
-
|
|
64
|
-
Prefer the smallest boring solution that is easy to rerun and inspect.
|
|
65
|
-
|
|
66
|
-
---
|
|
67
|
-
|
|
68
|
-
## Step 2 — Discover the tax-relevant groups
|
|
69
|
-
|
|
70
|
-
Tax positions are usually derived from **period activity** — revenue, deductible expenses, and tax liability accounts. The specific groups that matter depend on the user's jurisdiction and how they have structured their book.
|
|
71
|
-
|
|
72
|
-
The deterministic engine can work from **aggregated balances** or from **individual transactions**, depending on what the user needs:
|
|
73
|
-
|
|
74
|
-
- **Balance-level** — faster, gives period totals per group/account. Good for computing a tax position or filing summary.
|
|
75
|
-
- **Transaction-level** — slower, gives itemized detail. Good for audit trails, per-transaction deductions, or reconciling tax-account movements.
|
|
76
|
-
|
|
77
|
-
During bootstrap, ask the user which level they need, or default to balance-level and note that transaction-level detail can be added later.
|
|
78
|
-
|
|
79
|
-
Use these commands during bootstrap to identify candidate tax-relevant roots:
|
|
80
|
-
|
|
81
|
-
```bash
|
|
82
|
-
bkper group list -b <bookId> --format csv
|
|
83
|
-
bkper account list -b <bookId> --format csv
|
|
84
|
-
```
|
|
85
|
-
|
|
86
|
-
Inspect the output and look for groups or accounts that the user already treats as tax-related. Common patterns include:
|
|
87
|
-
|
|
88
|
-
- A root group or account for **revenue / income** (often INCOMING type)
|
|
89
|
-
- A root group or account for **deductible expenses** (often OUTGOING type)
|
|
90
|
-
- Accounts or groups that track **tax liabilities** or **tax credits** (often LIABILITY or ASSET type)
|
|
91
|
-
|
|
92
|
-
Do **not** assume standard names. Root group names vary by book — examples: `Revenue`, `Income`, `Sales`, `Deductible Expenses`, `Operating Costs`, `Taxes`, `VAT`, `Income Tax`.
|
|
93
|
-
|
|
94
|
-
Ask the user which groups represent their **tax-relevant activity** for the period in question. If they are unsure, propose the smallest set of top-level groups that cover:
|
|
95
|
-
|
|
96
|
-
1. **Gross revenue or income** for the period
|
|
97
|
-
2. **Deductible costs or expenses** for the period
|
|
98
|
-
3. Any **tax liability or credit accounts** already in use
|
|
99
|
-
|
|
100
|
-
When you discover the correct groups, persist them for future runs.
|
|
101
|
-
|
|
102
|
-
Prefer storing the **group IDs** in the local tax config/script. If the execution route also needs group names for query strings, persist the names as well.
|
|
103
|
-
|
|
104
|
-
### If the book has no usable tax-relevant grouping
|
|
105
|
-
|
|
106
|
-
If Step 2 does not reveal clear tax-relevant roots, treat that as a modeling gap, not as permission to improvise one silently.
|
|
107
|
-
|
|
108
|
-
In that case:
|
|
109
|
-
|
|
110
|
-
- explain that the book is **not yet tax-ready** for deterministic reporting
|
|
111
|
-
- do **not** invent arbitrary tax categories from subgroup names or partial account matches
|
|
112
|
-
- inspect the existing account names, language, and reporting style already present in the book
|
|
113
|
-
- propose the **smallest** grouping that fits the user's actual use case and local standards
|
|
114
|
-
- ask approval before creating groups, moving accounts, or persisting the proposed roots
|
|
115
|
-
- once approved, validate the grouping with live queries and then persist it in the local runner/config
|
|
116
|
-
|
|
117
|
-
If the user only wants a quick answer for now, you may still provide an **exploratory / provisional** result, but state clearly that the book still needs an approved tax-relevant hierarchy for future deterministic tax runs.
|
|
34
|
+
Date examples:
|
|
118
35
|
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
Tax positions are period-based — query **activity within a period**, not cumulative position.
|
|
126
|
-
|
|
127
|
-
### Balance-level bootstrap (aggregated)
|
|
128
|
-
|
|
129
|
-
```bash
|
|
130
|
-
# Revenue / income activity for the period
|
|
131
|
-
bkper balance list -b <bookId> \
|
|
132
|
-
-q "group:'<revenueRoot>' after:<start> before:<end>" \
|
|
133
|
-
--format csv --expanded 2
|
|
134
|
-
|
|
135
|
-
# Deductible expense activity for the period
|
|
136
|
-
bkper balance list -b <bookId> \
|
|
137
|
-
-q "group:'<expenseRoot>' after:<start> before:<end>" \
|
|
138
|
-
--format csv --expanded 2
|
|
139
|
-
|
|
140
|
-
# Tax liability or credit balance at period end (optional)
|
|
141
|
-
bkper balance list -b <bookId> \
|
|
142
|
-
-q "account:'<taxLiabilityAccount>' before:<end>" \
|
|
143
|
-
--format csv --expanded 2
|
|
144
|
-
```
|
|
145
|
-
|
|
146
|
-
### Transaction-level bootstrap (itemized)
|
|
147
|
-
|
|
148
|
-
```bash
|
|
149
|
-
# Revenue / income transactions for the period
|
|
150
|
-
bkper transaction list -b <bookId> \
|
|
151
|
-
-q "group:'<revenueRoot>' after:<start> before:<end>" \
|
|
152
|
-
--format csv
|
|
153
|
-
|
|
154
|
-
# Deductible expense transactions for the period
|
|
155
|
-
bkper transaction list -b <bookId> \
|
|
156
|
-
-q "group:'<expenseRoot>' after:<start> before:<end>" \
|
|
157
|
-
--format csv
|
|
158
|
-
|
|
159
|
-
# Tax-account movements for the period (optional)
|
|
160
|
-
bkper transaction list -b <bookId> \
|
|
161
|
-
-q "account:'<taxLiabilityAccount>' after:<start> before:<end>" \
|
|
162
|
-
--format csv
|
|
163
|
-
```
|
|
164
|
-
|
|
165
|
-
> **Bootstrap-only flags:** `--format csv` and `--expanded <level>` are conveniences for the discovery phase. CSV is compact for loading into an LLM context to inspect hierarchy structure; `--expanded <level>` reveals sub-totals so you can confirm the group tree is correct. The canonical runner you persist should output whatever format the user actually needs — structured JSON, Markdown tables, plain CSV, or rendered CLI tables — not necessarily the raw CLI dump.
|
|
166
|
-
|
|
167
|
-
Use the output to confirm the correct groups, period totals, and hierarchy before persisting the script/spec.
|
|
168
|
-
|
|
169
|
-
**Do not compute tax owed in the agent's reasoning.** The deterministic runner should output raw period data. The user (or a jurisdiction-specific layer they add later) applies rates, deductions, and rules.
|
|
36
|
+
| Request | Period activity query |
|
|
37
|
+
| --- | --- |
|
|
38
|
+
| Current month | `after:$m-1 before:$m` |
|
|
39
|
+
| Current year | `after:$y-1 before:$y` |
|
|
40
|
+
| Full year 2024 | `after:2024-01-01 before:2025-01-01` |
|
|
41
|
+
| Last quarter | Resolve to explicit `after:<start> before:<end>` boundaries |
|
|
170
42
|
|
|
171
|
-
|
|
43
|
+
`$m` and `$y` are Bkper query date variables for current month-end and current year-end. In shell commands, wrap queries containing `$` variables in single quotes to prevent shell expansion.
|
|
172
44
|
|
|
173
|
-
##
|
|
45
|
+
## Working route
|
|
174
46
|
|
|
175
|
-
|
|
47
|
+
Before computing a tax position, inspect local project context for an existing tax route:
|
|
176
48
|
|
|
177
|
-
|
|
49
|
+
- `AGENTS.md`
|
|
50
|
+
- `reports/`
|
|
51
|
+
- `scripts/`
|
|
52
|
+
- package scripts
|
|
53
|
+
- tax config/spec files
|
|
54
|
+
- platform app or bot code
|
|
178
55
|
|
|
179
|
-
|
|
180
|
-
- `scripts/taxes.ts`
|
|
181
|
-
- `reports/taxes.json`
|
|
182
|
-
- `package.json` scripts such as `report:taxes`
|
|
56
|
+
If a route exists, use it and pass explicit Book, period, and supported override parameters. Do not rediscover tax Groups or rebuild the logic unless the user asks to change it.
|
|
183
57
|
|
|
184
|
-
Persist the decisions that make the tax run
|
|
58
|
+
If no route exists, clarify the user's goal and recommend a repeatable route. Persist the decisions that make the tax run reproducible:
|
|
185
59
|
|
|
186
|
-
-
|
|
187
|
-
- tax
|
|
188
|
-
-
|
|
189
|
-
-
|
|
190
|
-
- timezone, if relevant to date boundaries
|
|
191
|
-
- expanded depth for balance queries, if used
|
|
60
|
+
- Book ID
|
|
61
|
+
- tax period and timezone, when relevant
|
|
62
|
+
- tax-relevant Group and Account IDs and names
|
|
63
|
+
- balance-level or transaction-level detail
|
|
192
64
|
- output format
|
|
65
|
+
- jurisdiction-specific rules, rates, and assumptions, if supplied
|
|
193
66
|
|
|
194
|
-
|
|
67
|
+
If the Book has no clear tax-relevant grouping, treat that as a modeling gap. Do not invent tax categories silently. Inspect the Book's existing language and structure, propose the smallest grouping that fits the user's goal, and ask before changing Accounts or Groups.
|
|
195
68
|
|
|
196
|
-
|
|
69
|
+
## Examples & Patterns
|
|
197
70
|
|
|
198
|
-
|
|
71
|
+
Use the implementation style that matches the user's context:
|
|
199
72
|
|
|
200
|
-
|
|
73
|
+
- **Scripts & CLI** — best for local, inspectable tax worksheets, reconciliations, and lightweight repeatable summaries.
|
|
74
|
+
- **Platform Apps / Bots** — best for shared, durable, event-driven tax automation such as applying configured tax rules when Transactions are posted.
|
|
201
75
|
|
|
202
|
-
|
|
76
|
+
Existing trusted reports or templates may be reused when they are already the user's accepted tax route, but they are not required by this guide.
|
|
203
77
|
|
|
204
|
-
|
|
205
|
-
- Resolve relative periods like "last quarter" or "last year" into explicit date boundaries in code/config
|
|
206
|
-
- Keep deterministic tax generation separate from optional AI commentary or filing advice
|
|
207
|
-
- If the tax logic must change (new groups, different period boundaries), update the script/config instead of improvising a fresh one-off route
|
|
78
|
+
## Provisional answers
|
|
208
79
|
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
---
|
|
212
|
-
|
|
213
|
-
## One-off exploratory fallback
|
|
214
|
-
|
|
215
|
-
If the user explicitly does **not** want to create the script now and only wants a quick one-off answer, you may run live queries directly.
|
|
216
|
-
|
|
217
|
-
In that case:
|
|
218
|
-
|
|
219
|
-
- Clearly label the result as **exploratory / provisional**
|
|
220
|
-
- State that it is **not yet** the canonical deterministic tax route for the project
|
|
221
|
-
- Recommend persisting a local script/config if the user wants repeatable tax output in future requests
|
|
222
|
-
|
|
223
|
-
---
|
|
224
|
-
|
|
225
|
-
## Date patterns
|
|
226
|
-
|
|
227
|
-
Use these patterns when validating or implementing the deterministic runner.
|
|
228
|
-
|
|
229
|
-
| Request | Period activity query |
|
|
230
|
-
| -------------- | ---------------------------------------------- |
|
|
231
|
-
| Current month | `after:$m-1 before:$m` |
|
|
232
|
-
| Current year | `after:$y-1 before:$y` |
|
|
233
|
-
| Full year 2024 | `after:2024-01-01 before:2025-01-01` |
|
|
234
|
-
| Last quarter | Resolve to explicit `after:<start> before:<end>` in script |
|
|
235
|
-
|
|
236
|
-
- `after:` is **inclusive**, `before:` is **exclusive**
|
|
237
|
-
- `$d` = today, `$m` = current month-end, `$y` = current year-end
|
|
238
|
-
- In shell, wrap queries containing `$` variables in **single quotes** to prevent shell expansion
|
|
239
|
-
|
|
240
|
-
---
|
|
241
|
-
|
|
242
|
-
## Key rules
|
|
243
|
-
|
|
244
|
-
- **The agent orchestrates the engine; the engine produces the output** — the canonical runner is what generates the tax report, not the agent's direct reasoning
|
|
245
|
-
- **Tax positions are period-based** — use `after:` + `before:` for revenue and expense activity, not `before:` alone
|
|
246
|
-
- **Always query by group or account** — never run unfiltered queries across the whole book
|
|
247
|
-
- **Output raw data, not computed tax owed** — the deterministic runner exposes totals; jurisdiction-specific calculation is a user concern
|
|
248
|
-
- **Bootstrap queries** may use `--format csv` and `--expanded <level>` to inspect hierarchy structure efficiently; the canonical runner should use programmatic formatting suited to the end user
|
|
249
|
-
- Once a canonical local tax route exists, **reuse it instead of rediscovering the logic**
|
|
250
|
-
- Prefer persisting tax-relevant group decisions in code/config rather than relying on session memory
|
|
251
|
-
|
|
252
|
-
---
|
|
253
|
-
|
|
254
|
-
## Common mistakes
|
|
255
|
-
|
|
256
|
-
| Wrong | Right |
|
|
257
|
-
| --- | --- |
|
|
258
|
-
| The agent computing tax owed directly from queried data using guessed rates or rules | The agent building or reusing a local runner that outputs raw data; the user applies jurisdiction-specific rules |
|
|
259
|
-
| Immediately running ad-hoc queries as the default response to a first tax request | First look for a local runner; if none exists, propose creating one and use queries only for bootstrap |
|
|
260
|
-
| Assuming `AGENTS.md` must already exist | `AGENTS.md` can be created or updated during bootstrap to route future requests |
|
|
261
|
-
| Using `before:` only for tax-relevant queries | Use `after:` + `before:` for period-based activity (revenue, expenses) |
|
|
262
|
-
| Inventing a new tax hierarchy silently because no roots were found | Explain that the book is not yet tax-ready, propose a minimal grouping aligned with the user's language and local standards, and ask approval before changing structure |
|
|
263
|
-
| Re-interpreting "last quarter" differently each time | Resolve relative periods into explicit dates inside the canonical script/config |
|
|
264
|
-
| Mixing tax-bot specifics into the generic tax workflow | Keep this workflow independent of any bot or automation; it works from plain balances and transactions |
|
|
80
|
+
If the user explicitly wants a quick answer and does not want to establish a route, live read-only queries are acceptable. Label the result as **exploratory / provisional** and avoid applying unsupplied tax law.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "bkper",
|
|
3
|
-
"version": "4.16.
|
|
3
|
+
"version": "4.16.4",
|
|
4
4
|
"description": "Command line client for Bkper",
|
|
5
5
|
"bin": {
|
|
6
6
|
"bkper": "./lib/cli.js"
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
"upgrade:api": "bun update @bkper/bkper-api-types --latest && bun update bkper-js --latest"
|
|
52
52
|
},
|
|
53
53
|
"dependencies": {
|
|
54
|
-
"@earendil-works/pi-coding-agent": "0.
|
|
54
|
+
"@earendil-works/pi-coding-agent": "0.79.1",
|
|
55
55
|
"bkper-js": "^2.35.2",
|
|
56
56
|
"commander": "^13.1.0",
|
|
57
57
|
"dotenv": "^8.2.0",
|