bkper 4.25.0 → 4.26.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 (51) hide show
  1. package/README.md +1 -1
  2. package/lib/agent/extensions/handoff.d.ts.map +1 -1
  3. package/lib/agent/extensions/handoff.js +2 -0
  4. package/lib/agent/extensions/handoff.js.map +1 -1
  5. package/lib/agent/startup-maintenance.d.ts +1 -0
  6. package/lib/agent/startup-maintenance.d.ts.map +1 -1
  7. package/lib/agent/startup-maintenance.js +7 -1
  8. package/lib/agent/startup-maintenance.js.map +1 -1
  9. package/lib/agent/system-prompt.js +1 -1
  10. package/lib/commands/apps/git/clone.js +1 -1
  11. package/lib/commands/apps/git/clone.js.map +1 -1
  12. package/lib/commands/apps/init.d.ts +3 -1
  13. package/lib/commands/apps/init.d.ts.map +1 -1
  14. package/lib/commands/apps/init.js +105 -58
  15. package/lib/commands/apps/init.js.map +1 -1
  16. package/lib/commands/apps/register.js +2 -2
  17. package/lib/commands/apps/register.js.map +1 -1
  18. package/lib/dev/local-outbound.d.ts.map +1 -1
  19. package/lib/dev/local-outbound.js +17 -3
  20. package/lib/dev/local-outbound.js.map +1 -1
  21. package/lib/dev/miniflare.js +1 -1
  22. package/lib/dev/miniflare.js.map +1 -1
  23. package/lib/dev/preflight.js +1 -1
  24. package/lib/dev/preflight.js.map +1 -1
  25. package/lib/dev/shared.js +1 -1
  26. package/lib/dev/shared.js.map +1 -1
  27. package/lib/docs/apps/ai.md +270 -0
  28. package/lib/docs/apps/app-listing.md +86 -0
  29. package/lib/docs/apps/architecture.md +188 -0
  30. package/lib/docs/apps/configuration.md +171 -0
  31. package/lib/docs/apps/context-menu.md +69 -0
  32. package/lib/docs/apps/deploying.md +181 -0
  33. package/lib/docs/apps/development.md +122 -0
  34. package/lib/docs/apps/event-handlers.md +248 -0
  35. package/lib/docs/apps/first-app.md +76 -0
  36. package/lib/docs/apps/overview.md +106 -0
  37. package/lib/docs/apps/self-hosted.md +63 -0
  38. package/lib/docs/apps/shared-app-source.md +85 -0
  39. package/lib/docs/cli/app-management.md +16 -4
  40. package/lib/docs/index.md +12 -1
  41. package/lib/docs/sdk/bkper-js.md +5 -0
  42. package/lib/upgrade/index.d.ts +1 -1
  43. package/lib/upgrade/index.d.ts.map +1 -1
  44. package/lib/upgrade/index.js +1 -1
  45. package/lib/upgrade/index.js.map +1 -1
  46. package/lib/upgrade/installation.d.ts +4 -0
  47. package/lib/upgrade/installation.d.ts.map +1 -1
  48. package/lib/upgrade/installation.js +23 -0
  49. package/lib/upgrade/installation.js.map +1 -1
  50. package/package.json +3 -3
  51. package/lib/docs/apps/app-building.md +0 -1429
@@ -0,0 +1,85 @@
1
+ # Shared App Source
2
+
3
+ Bkper-managed app source gives your team and coding agents one shared private codebase for a Bkper app. Authorized app developers can clone the same repository, improve it locally, and continue from one shared history without setting up a separate Git host.
4
+
5
+ Shared app source supports development collaboration. It does not automatically build or deploy your app.
6
+
7
+ ## Who can access the source
8
+
9
+ The app owner and users matched by the `developers` field in `bkper.yaml` can read and update managed source. This includes configured domain patterns such as `*@example.com`.
10
+
11
+ App users and Book collaborators do not receive source access unless they also match the app's developer policy.
12
+
13
+ ## Start a shared codebase
14
+
15
+ A standalone app becomes eligible for Bkper-managed source when:
16
+
17
+ - `bkper.yaml` is at the root of its Git repository.
18
+ - The current branch is `main` for the first managed sync.
19
+ - The working tree is clean and has at least one commit.
20
+ - No Git remote is configured.
21
+
22
+ `bkper app init` initializes Git on `main`, but it does not create the first commit. Review and commit the app before its first sync:
23
+
24
+ ```bash
25
+ bkper app init my-app
26
+ cd my-app
27
+
28
+ # Review the generated app, then commit it
29
+ git add .
30
+ git commit -m "Initial app"
31
+
32
+ bkper app sync
33
+ ```
34
+
35
+ For an eligible app, `bkper app sync` creates its private Bkper-managed source and configures it as `origin`. The same command also syncs app metadata from `bkper.yaml`.
36
+
37
+ ## Clone and continue together
38
+
39
+ Any authorized app developer can start from the shared codebase:
40
+
41
+ ```bash
42
+ bkper app clone <appId>
43
+ cd <appId>
44
+ npm install
45
+ ```
46
+
47
+ `bkper app clone` copies the repository but does not install dependencies or run repository scripts. A teammate or coding agent can then work in the local clone, run the project's checks, commit changes, and push them back to the shared repository. Another authorized developer can pull or clone that history and continue the work.
48
+
49
+ Keep agent instructions such as `AGENTS.md` in the repository so every teammate and coding agent starts with the same project context and safety rules.
50
+
51
+ ## Source synchronization is not deployment
52
+
53
+ Source storage and app deployment are separate operations:
54
+
55
+ | Action | What it does with source | Does it deploy? |
56
+ | ------------------ | ------------------------------------------------------------------------------ | --------------- |
57
+ | `git push` | Stores committed source in the managed repository. | No |
58
+ | `bkper app sync` | Safely pushes managed source, then syncs app metadata from `bkper.yaml`. | No |
59
+ | `npm run build` | Creates local build output in `dist/`. | No |
60
+ | `bkper app deploy` | Pushes and verifies the managed commit, then uploads the existing local build. | Yes |
61
+
62
+ An ordinary Git push never deploys. `bkper app deploy` also does not run a build, so build locally before deploying the result you intend to release.
63
+
64
+ Managed sync and deploy require a clean, committed working tree and use fast-forward safety checks. The CLI does not automatically commit, merge, rebase, force-push, reset, or discard files.
65
+
66
+ ## External Git and monorepos
67
+
68
+ Bkper-managed source is optional. Existing workflows remain external when:
69
+
70
+ - the app already has a GitHub, GitLab, or other provider remote;
71
+ - `bkper.yaml` is inside a monorepo rather than at the repository root; or
72
+ - the app is otherwise not rooted in a standalone Git repository.
73
+
74
+ Clone those apps from their external provider. `bkper app clone` is for Bkper-managed source only.
75
+
76
+ Moving an existing standalone app from an external provider is intentional: the CLI never removes or renames an existing remote. Before changing remotes, make sure every branch and tag you want to preserve is available locally and the current `main` branch is clean and committed. Removing all external remotes and running `bkper app sync` then activates managed source for an eligible app.
77
+
78
+ The `repoUrl` field in `bkper.yaml` is app-listing metadata. It does not select managed or external source mode.
79
+
80
+ ## Next steps
81
+
82
+ - [Your First App](https://bkper.com/docs/build/apps/first-app.md) — Scaffold an app and establish its shared source
83
+ - [Building & Deploying](https://bkper.com/docs/build/apps/deploying.md) — Build, sync, preview, and deploy explicitly
84
+ - [CLI](https://bkper.com/docs/build/tools/cli.md) — Install the CLI and review its app-development workflows
85
+ - [Coding Agents](https://bkper.com/docs/ai/coding-agents.md) — Give coding agents the Bkper and project context they need
@@ -53,18 +53,30 @@ bkper app init my-app
53
53
  cd my-app
54
54
  ```
55
55
 
56
- `bkper app init <name>` creates and scaffolds `./<name>` using the same value as the app id. Run `bkper app init` with no name inside an existing empty or VCS-only directory to use the current folder name as the app id. Init initializes Git on `main` when needed, but does not create commits.
56
+ `bkper app init <name>` creates and scaffolds `./<name>` using the same value as the app id. Run `bkper app init` with no name inside an existing empty or VCS-only directory to use the current folder name as the app id. Init validates the guidance markers in `AGENTS.md` and blocks scaffolding when they are missing, duplicated, malformed, nested, or out of order. It initializes Git on `main` when needed, but never stages, commits, pushes, syncs, or deploys.
57
+
58
+ Init does not install dependencies or execute package lifecycle scripts. The current template uses Bun; enter the App directory and run `bun install` explicitly when ready.
59
+
60
+ Before specializing the App, the active coding agent must read the newly created `AGENTS.md` at the path printed by init. When its marker pairs are present:
61
+
62
+ - Preserve `<!-- APP_STANDARDS:START -->` / `<!-- APP_STANDARDS:END -->` and `<!-- APP_SPECIFICS:START -->` / `<!-- APP_SPECIFICS:END -->`.
63
+ - Preserve `APP_STANDARDS` by default and change it only when explicitly requested.
64
+ - Maintain `APP_SPECIFICS` with the App's purpose, behavior, domain flows, resources, routes, and implementation decisions.
65
+ - Never replace `AGENTS.md` wholesale merely to specialize the App.
57
66
 
58
67
  Verify:
59
68
 
69
+ - `AGENTS.md` contains each marker exactly once, with `APP_STANDARDS` before `APP_SPECIFICS`
60
70
  - `client/` and `server/` exist
61
71
  - `bkper.yaml` has `id`, `name`, `description`, and `developers`
62
- - `package.json` scripts include `dev` and `build`
63
- - `.git` exists on branch `main` with no automatic commit
72
+ - `package.json` scripts include `dev`, `build`, and `check:agent-guidance`
73
+ - dependencies are not installed by init
74
+ - `.git` exists on branch `main` with no automatic staging or commit
64
75
 
65
76
  ### 2. Develop
66
77
 
67
78
  ```bash
79
+ bun install
68
80
  npm run dev
69
81
  ```
70
82
 
@@ -531,7 +543,7 @@ Inside the interactive agent:
531
543
 
532
544
  ### App Lifecycle
533
545
 
534
- - `app init [name]` - Scaffold a new app from the template. With `name`, creates `./<name>` and uses it as the app id. Without `name`, initializes the current directory and derives the app id from the folder name. Initializes Git on `main` when the target is not already a repository, without staging or committing files.
546
+ - `app init [name]` - Scaffold a new app from the template. With `name`, creates `./<name>` and uses it as the app id. Without `name`, initializes the current directory and derives the app id from the folder name. Validates the marked `AGENTS.md`, initializes Git on `main` when needed without staging or committing, and does not install dependencies. Read the printed `AGENTS.md` path before specialization and preserve its standards, specifics, and marker pairs.
535
547
  - `app clone <appId> [path]` - Clone a Bkper-managed App source repository. Does not install dependencies; run `bun install` explicitly afterward. External-source Apps must be cloned from their provider instead.
536
548
  - `app git-credential <appId> [operation]` - Internal noninteractive Git credential helper for managed Artifacts source. Generated repository config pins the App ID and exact remote URL/path; Git appends `get`, `store`, or `erase`. Never persists tokens.
537
549
  - `app list` - List all apps you have access to
package/lib/docs/index.md CHANGED
@@ -7,7 +7,18 @@ For Bkper data, accounting, reporting, tax, or financial-flow tasks, read `core/
7
7
  - `core/core-concepts.md` — canonical Bkper data model: resources, movements, balances, accounts, groups, books, transactions, properties, and the zero-sum invariant.
8
8
  - `cli/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), human-review Bkper UI links, batch operations via stdin/piping, collections.
9
9
  - `cli/app-management.md` — CLI reference for building and deploying Bkper apps: init/git clone/credential helpers, dev/build/deploy workflow, app install/uninstall, secrets management, app logs, bkper.yaml configuration reference (identity, branding, events, menu integration, deployment).
10
- - `apps/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.
10
+ - `apps/overview.md` — Platform evaluation and capability overview: use when comparing managed Bkper hosting with self-managed infrastructure or clarifying platform responsibilities; use the task-specific app references for implementation.
11
+ - `apps/ai.md` — Bkper AI integration for Platform apps: authenticated `/api/*` request flow, outbound authorization and app attribution, live model discovery, strict structured output, response validation, error preservation, data minimization, and unit-test boundaries.
12
+ - `apps/first-app.md` — First-app walkthrough: scaffold, install, run locally, trigger an event, customize the listing, establish shared source, check, and deploy.
13
+ - `apps/architecture.md` — App and template architecture: npm workspace structure, Lit/Vite client, Hono Worker, typed `/api/*` contracts, authentication, `/events`, static assets, and supported app shapes.
14
+ - `apps/configuration.md` — Complete `bkper.yaml` reference: identity, branding, ownership, access, context menus, event subscriptions, property schemas, and single-Worker deployment settings.
15
+ - `apps/development.md` — Local development: Vite and Worker processes, ports, API proxy, local authentication, secrets, KV, generated environment types, development loop, and debugging.
16
+ - `apps/event-handlers.md` — Event handler behavior: `/events` routing, responses, replay, loop prevention, platform and self-hosted authentication, event payloads, and event types.
17
+ - `apps/deploying.md` — Build, sync, and explicit deploy workflow; production and preview environments, secrets, KV, deployment status, and book installation.
18
+ - `apps/shared-app-source.md` — Bkper-managed private Git source: developer access, first sync, clone workflow, source/deployment separation, safety checks, external remotes, and monorepos.
19
+ - `apps/context-menu.md` — Book context-menu integration: production/development URLs, open modes, and dynamic Book, query, Account, and Group expressions.
20
+ - `apps/app-listing.md` — App listing metadata, visibility, publication review, end-user README guidance, and public listing locations.
21
+ - `apps/self-hosted.md` — Self-hosted event-handler alternatives: Cloud Functions, generic webhooks, direct authentication responsibilities, scaling, responses, and retries.
11
22
  - `reporting/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.
12
23
  - `reporting/taxes.md` — Deterministic tax reporting principles: trusted routes, external tax-rule loading/discovery, user-approved tax-relevant groups/accounts, period activity queries, explicit jurisdiction assumptions, and provisional query patterns.
13
24
  - `advisory/accountant-recommendations.md` — Human accountant / advisor recommendation flow using the OpenAccountants verified network endpoint: jurisdiction resolution, live JSON fetching, no-private-data handoff, profile_url introductions, no-match handling, and tax-review cross-reference.
@@ -630,6 +630,7 @@ It contains all `Accounts` where `Transactions` are recorded/posted;
630
630
  - `getTotalTransactionsCurrentMonth()` → `number` — Gets the total number of posted transactions on current month.
631
631
  - `getTotalTransactionsCurrentYear()` → `number` — Gets the total number of posted transactions on current year.
632
632
  - `getTransaction(id: string)` → `Promise<Transaction | undefined>` — Retrieve a transaction by id.
633
+ - `getTransactionsByIds(ids: string[])` → `Promise<Transaction[]>` — Retrieve complete transactions by id.
633
634
  - `getVisibility()` / `setVisibility(visibility: Visibility)` → `Visibility` — Gets the visibility of the book.
634
635
  - `json()` → `bkper.Book` — Gets an immutable copy of the JSON payload for this resource.
635
636
  - `listEvents(options: ListEventsOptions)` → `Promise<EventList>` — Lists events in the Book based on the provided options.
@@ -731,6 +732,10 @@ const bookWithGroups = await Bkper.getBook(bookId, false, true);
731
732
  const groups2 = await bookWithGroups.getGroups(); // Already cached
732
733
  ```
733
734
 
735
+ **getTransactionsByIds**
736
+
737
+ Requests are sent sequentially in batches of up to 200 IDs.
738
+
734
739
  **mergeTransactions**
735
740
 
736
741
  The merged transaction is created synchronously. Cleanup of the two
@@ -1,4 +1,4 @@
1
- export { VERSION, detectMethod, detectMethodAsync, fetchLatestVersion, getUpgradeCommand, startDetachedUpgrade, } from './installation.js';
1
+ export { VERSION, detectMethod, detectMethodAsync, fetchLatestVersion, getUpgradeCommand, isVersionInstalledAsync, startDetachedUpgrade, } from './installation.js';
2
2
  export { autoUpgrade, foregroundUpgrade, getAvailableUpgrade, isNewerVersion, } from './upgrade.js';
3
3
  export type { InstallMethod } from './installation.js';
4
4
  export type { AvailableUpgrade } from './upgrade.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/upgrade/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,OAAO,EACP,YAAY,EACZ,iBAAiB,EACjB,kBAAkB,EAClB,iBAAiB,EACjB,oBAAoB,GACvB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACH,WAAW,EACX,iBAAiB,EACjB,mBAAmB,EACnB,cAAc,GACjB,MAAM,cAAc,CAAC;AACtB,YAAY,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AACvD,YAAY,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/upgrade/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,OAAO,EACP,YAAY,EACZ,iBAAiB,EACjB,kBAAkB,EAClB,iBAAiB,EACjB,uBAAuB,EACvB,oBAAoB,GACvB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACH,WAAW,EACX,iBAAiB,EACjB,mBAAmB,EACnB,cAAc,GACjB,MAAM,cAAc,CAAC;AACtB,YAAY,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AACvD,YAAY,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC"}
@@ -1,3 +1,3 @@
1
- export { VERSION, detectMethod, detectMethodAsync, fetchLatestVersion, getUpgradeCommand, startDetachedUpgrade, } from './installation.js';
1
+ export { VERSION, detectMethod, detectMethodAsync, fetchLatestVersion, getUpgradeCommand, isVersionInstalledAsync, startDetachedUpgrade, } from './installation.js';
2
2
  export { autoUpgrade, foregroundUpgrade, getAvailableUpgrade, isNewerVersion, } from './upgrade.js';
3
3
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/upgrade/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,OAAO,EACP,YAAY,EACZ,iBAAiB,EACjB,kBAAkB,EAClB,iBAAiB,EACjB,oBAAoB,GACvB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACH,WAAW,EACX,iBAAiB,EACjB,mBAAmB,EACnB,cAAc,GACjB,MAAM,cAAc,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/upgrade/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,OAAO,EACP,YAAY,EACZ,iBAAiB,EACjB,kBAAkB,EAClB,iBAAiB,EACjB,uBAAuB,EACvB,oBAAoB,GACvB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACH,WAAW,EACX,iBAAiB,EACjB,mBAAmB,EACnB,cAAc,GACjB,MAAM,cAAc,CAAC"}
@@ -13,6 +13,10 @@ export declare function detectMethod(): InstallMethod;
13
13
  * Async version of installation method detection to avoid blocking the event loop.
14
14
  */
15
15
  export declare function detectMethodAsync(commandRunner?: CommandRunner): Promise<InstallMethod>;
16
+ /**
17
+ * Checks whether a specific Bkper version is already installed globally.
18
+ */
19
+ export declare function isVersionInstalledAsync(method: InstallMethod, version: string, commandRunner?: CommandRunner): Promise<boolean>;
16
20
  /**
17
21
  * Fetches the latest published version from the npm registry.
18
22
  * Returns null if the fetch fails.
@@ -1 +1 @@
1
- {"version":3,"file":"installation.d.ts","sourceRoot":"","sources":["../../src/upgrade/installation.ts"],"names":[],"mappings":"AAMA,4CAA4C;AAC5C,eAAO,MAAM,OAAO,EAAE,MAAoB,CAAC;AAK3C,sCAAsC;AACtC,MAAM,MAAM,aAAa,GAAG,KAAK,GAAG,KAAK,GAAG,MAAM,GAAG,SAAS,CAAC;AAE/D,MAAM,MAAM,aAAa,GAAG,CAAC,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;AACpF,MAAM,MAAM,sBAAsB,GAAG,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;AAwC/D;;;GAGG;AACH,wBAAgB,YAAY,IAAI,aAAa,CAkB5C;AAED;;GAEG;AACH,wBAAsB,iBAAiB,CACnC,aA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AI,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAiBjE;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,aAAa,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAWvF;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,aAAa,EAAE,OAAO,EAAE,MAAM,GAAG,IAAI,CAS3E;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAChC,MAAM,EAAE,aAAa,EACrB,OAAO,EAAE,MAAM,EACf,cAAc,GAAE,sBAAsD,GACvE,IAAI,CAUN"}
@@ -90,6 +90,29 @@ export function detectMethodAsync() {
90
90
  return 'unknown';
91
91
  });
92
92
  }
93
+ /**
94
+ * Checks whether a specific Bkper version is already installed globally.
95
+ */
96
+ export function isVersionInstalledAsync(method_1, version_1) {
97
+ return __awaiter(this, arguments, void 0, function* (method, version, commandRunner = defaultCommandRunner) {
98
+ const check = getDetectionChecks().find(check => check.method === method);
99
+ if (!check) {
100
+ return false;
101
+ }
102
+ try {
103
+ const output = yield commandRunner(check.command, 10000);
104
+ const packageVersion = `${PACKAGE_NAME}@${version}`;
105
+ return output.split(/\s+/).some(token => {
106
+ const normalizedToken = token.replace(/^[^A-Za-z0-9@/._+-]+|[^A-Za-z0-9@/._+-]+$/g, '');
107
+ return normalizedToken === packageVersion;
108
+ });
109
+ }
110
+ catch (_a) {
111
+ // Preserve the existing upgrade flow when the check cannot be completed.
112
+ return false;
113
+ }
114
+ });
115
+ }
93
116
  /**
94
117
  * Fetches the latest published version from the npm registry.
95
118
  * Returns null if the fetch fails.
@@ -1 +1 @@
1
- {"version":3,"file":"installation.js","sourceRoot":"","sources":["../../src/upgrade/installation.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACtD,OAAO,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AAEvC,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AiB,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACnD,IAAI,CAAC,OAAO,EAAE,CAAC;QACX,MAAM,IAAI,KAAK,CACX,uDAAuD;YACnD,2CAA2C,YAAY,IAAI,OAAO,EAAE,CAC3E,CAAC;IACN,CAAC;IACD,QAAQ,CAAC,OAAO,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE,IAAI,EAAE,CAAC,CAAC;AAC5E,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,oBAAoB,CAChC,MAAqB,EACrB,OAAe,EACf,iBAAyC,6BAA6B;;IAEtE,MAAM,OAAO,GAAG,MAAA,yBAAyB,EAAE,mCAAI,iBAAiB,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAClF,IAAI,CAAC,OAAO,EAAE,CAAC;QACX,MAAM,IAAI,KAAK,CACX,uDAAuD;YACnD,2CAA2C,YAAY,IAAI,OAAO,EAAE,CAC3E,CAAC;IACN,CAAC;IAED,cAAc,CAAC,OAAO,CAAC,CAAC;AAC5B,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bkper",
3
- "version": "4.25.0",
3
+ "version": "4.26.1",
4
4
  "description": "Command line client for Bkper",
5
5
  "bin": {
6
6
  "bkper": "./lib/cli.js"
@@ -52,8 +52,8 @@
52
52
  "upgrade:api": "bun update @bkper/bkper-api-types --latest && bun update bkper-js --latest"
53
53
  },
54
54
  "dependencies": {
55
- "@earendil-works/pi-coding-agent": "0.84.1",
56
- "@earendil-works/pi-tui": "0.84.1",
55
+ "@earendil-works/pi-coding-agent": "0.84.2",
56
+ "@earendil-works/pi-tui": "0.84.2",
57
57
  "bkper-js": "^2.42.0",
58
58
  "commander": "^13.1.0",
59
59
  "dotenv": "^8.2.0",