bkper 4.29.4 → 4.30.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.
Files changed (69) hide show
  1. package/README.md +1 -1
  2. package/lib/commands/apps/deploy.d.ts +24 -3
  3. package/lib/commands/apps/deploy.d.ts.map +1 -1
  4. package/lib/commands/apps/deploy.js +41 -25
  5. package/lib/commands/apps/deploy.js.map +1 -1
  6. package/lib/commands/apps/git/clone.d.ts +8 -0
  7. package/lib/commands/apps/git/clone.d.ts.map +1 -1
  8. package/lib/commands/apps/git/clone.js +20 -31
  9. package/lib/commands/apps/git/clone.js.map +1 -1
  10. package/lib/commands/apps/git/credentials.d.ts +2 -1
  11. package/lib/commands/apps/git/credentials.d.ts.map +1 -1
  12. package/lib/commands/apps/git/credentials.js +28 -12
  13. package/lib/commands/apps/git/credentials.js.map +1 -1
  14. package/lib/commands/apps/git/external-source.d.ts +16 -0
  15. package/lib/commands/apps/git/external-source.d.ts.map +1 -0
  16. package/lib/commands/apps/git/external-source.js +113 -0
  17. package/lib/commands/apps/git/external-source.js.map +1 -0
  18. package/lib/commands/apps/git/index.d.ts +2 -1
  19. package/lib/commands/apps/git/index.d.ts.map +1 -1
  20. package/lib/commands/apps/git/index.js +2 -1
  21. package/lib/commands/apps/git/index.js.map +1 -1
  22. package/lib/commands/apps/git/inspect.d.ts.map +1 -1
  23. package/lib/commands/apps/git/inspect.js +7 -2
  24. package/lib/commands/apps/git/inspect.js.map +1 -1
  25. package/lib/commands/apps/git/mode.d.ts +3 -2
  26. package/lib/commands/apps/git/mode.d.ts.map +1 -1
  27. package/lib/commands/apps/git/mode.js +5 -6
  28. package/lib/commands/apps/git/mode.js.map +1 -1
  29. package/lib/commands/apps/git/preflight.d.ts +8 -3
  30. package/lib/commands/apps/git/preflight.d.ts.map +1 -1
  31. package/lib/commands/apps/git/preflight.js +19 -12
  32. package/lib/commands/apps/git/preflight.js.map +1 -1
  33. package/lib/commands/apps/git/push.d.ts +6 -1
  34. package/lib/commands/apps/git/push.d.ts.map +1 -1
  35. package/lib/commands/apps/git/push.js +50 -40
  36. package/lib/commands/apps/git/push.js.map +1 -1
  37. package/lib/commands/apps/git/run-git.d.ts +1 -0
  38. package/lib/commands/apps/git/run-git.d.ts.map +1 -1
  39. package/lib/commands/apps/git/run-git.js +1 -1
  40. package/lib/commands/apps/git/run-git.js.map +1 -1
  41. package/lib/commands/apps/git/types.d.ts +2 -2
  42. package/lib/commands/apps/git/types.d.ts.map +1 -1
  43. package/lib/commands/apps/git/types.js.map +1 -1
  44. package/lib/commands/apps/register.js +5 -5
  45. package/lib/commands/apps/register.js.map +1 -1
  46. package/lib/commands/apps/source-workflow.d.ts +4 -1
  47. package/lib/commands/apps/source-workflow.d.ts.map +1 -1
  48. package/lib/commands/apps/source-workflow.js +87 -32
  49. package/lib/commands/apps/source-workflow.js.map +1 -1
  50. package/lib/commands/apps/sync.d.ts.map +1 -1
  51. package/lib/commands/apps/sync.js +1 -0
  52. package/lib/commands/apps/sync.js.map +1 -1
  53. package/lib/docs/apps/app-listing.md +3 -3
  54. package/lib/docs/apps/architecture.md +3 -3
  55. package/lib/docs/apps/configuration.md +5 -5
  56. package/lib/docs/apps/context-menu.md +3 -3
  57. package/lib/docs/apps/deploying.md +10 -8
  58. package/lib/docs/apps/event-handlers.md +5 -5
  59. package/lib/docs/apps/first-app.md +12 -12
  60. package/lib/docs/apps/overview.md +10 -10
  61. package/lib/docs/apps/quality.md +5 -5
  62. package/lib/docs/apps/security.md +5 -5
  63. package/lib/docs/apps/self-hosted.md +4 -4
  64. package/lib/docs/apps/shared-app-source.md +16 -11
  65. package/lib/docs/cli/app-management.md +17 -12
  66. package/lib/docs/core/core-concepts.md +1 -1
  67. package/lib/docs/sdk/bkper-api-types.md +2 -0
  68. package/lib/docs/sdk/bkper-js.md +2 -0
  69. package/package.json +1 -1
@@ -6,11 +6,11 @@ Event handlers are the code that reacts to events in your Bkper Books. When a tr
6
6
 
7
7
  ## How it works
8
8
 
9
- 1. You declare which events your app handles in [`bkper.yaml`](https://bkper.com/docs/build/apps/configuration.md)
9
+ 1. You declare which events your app handles in [`bkper.yaml`](https://bkper.com/docs/platform/apps/configuration.md)
10
10
  2. Bkper sends an HTTP POST to your webhook URL when those events fire
11
11
  3. Your handler processes the event and returns a response
12
12
 
13
- On the [Bkper Platform](https://bkper.com/docs/build/apps/overview.md), events are routed to `/events` on your app's single Worker — including local development via tunnels. For [self-hosted](https://bkper.com/docs/build/apps/self-hosted.md) setups, you configure the webhook URL directly.
13
+ On the [Bkper Platform](https://bkper.com/docs/platform/apps/overview.md), events are routed to `/events` on your app's single Worker — including local development via tunnels. For [self-hosted](https://bkper.com/docs/platform/apps/self-hosted.md) setups, you configure the webhook URL directly.
14
14
 
15
15
  ## Agent identity
16
16
 
@@ -99,7 +99,7 @@ Do not read `bkper-oauth-token`, `bkper-agent-id`, or `Authorization` headers in
99
99
 
100
100
  > **Note**
101
101
  > During local development, events are routed through the Cloudflare tunnel started by `bkper app dev`. Local outbound uses your CLI credentials when the handler calls Bkper.
102
- For [self-hosted](https://bkper.com/docs/build/apps/self-hosted.md) setups, the event auth headers are sent to both `webhookUrl` and `webhookUrlDev` and must be handled directly by your infrastructure.
102
+ For [self-hosted](https://bkper.com/docs/platform/apps/self-hosted.md) setups, the event auth headers are sent to both `webhookUrl` and `webhookUrlDev` and must be handled directly by your infrastructure.
103
103
 
104
104
  ## Event routing pattern
105
105
 
@@ -197,7 +197,7 @@ The event payload has the following structure:
197
197
  }
198
198
  ```
199
199
 
200
- The event payload is the same structure exposed by the [REST API](https://bkper.com/docs/build/scripts/rest-api.md). If you use TypeScript, add the [`@bkper/bkper-api-types`](https://www.npmjs.com/package/@bkper/bkper-api-types) package to your project for full type definitions.
200
+ The event payload is the same structure exposed by the [REST API](https://bkper.com/docs/platform/scripts/rest-api.md). If you use TypeScript, add the [`@bkper/bkper-api-types`](https://www.npmjs.com/package/@bkper/bkper-api-types) package to your project for full type definitions.
201
201
 
202
202
  For update events, `data.previousAttributes` contains the fields that changed and their previous values — useful for computing diffs or reacting only to specific field changes.
203
203
 
@@ -212,7 +212,7 @@ events:
212
212
  - ACCOUNT_CREATED
213
213
  ```
214
214
 
215
- The complete current set of event types:
215
+ The complete API set of event types is listed below. `COMMENT_CREATED` and `COMMENT_DELETED` remain in the API for compatibility with historical Events; Comments are not available in the current Bkper PWA.
216
216
 
217
217
  | Event | Description |
218
218
  | --- | --- |
@@ -4,7 +4,7 @@ This tutorial walks you through building and deploying a Bkper app from scratch.
4
4
 
5
5
  ## Prerequisites
6
6
 
7
- [Development Setup](https://bkper.com/docs/build/getting-started/setup.md) — the CLI installed and authenticated.
7
+ [Development Setup](https://bkper.com/docs/platform/getting-started/setup.md) — the CLI installed and authenticated.
8
8
 
9
9
  ## Walkthrough
10
10
 
@@ -15,7 +15,7 @@ This tutorial walks you through building and deploying a Bkper app from scratch.
15
15
  cd my-app
16
16
  ```
17
17
 
18
- `bkper app init my-app` creates `./my-app` and uses `my-app` as the app id. The CLI sets your package name, URLs, and event-handler loop guards automatically. See [App Configuration](https://bkper.com/docs/build/apps/configuration.md) for the full `bkper.yaml` reference.
18
+ `bkper app init my-app` creates `./my-app` and uses `my-app` as the app id. The CLI sets your package name, URLs, and event-handler loop guards automatically. See [App Configuration](https://bkper.com/docs/platform/apps/configuration.md) for the full `bkper.yaml` reference.
19
19
 
20
20
  2. **Install and start developing**
21
21
 
@@ -24,7 +24,7 @@ This tutorial walks you through building and deploying a Bkper app from scratch.
24
24
  npm run dev
25
25
  ```
26
26
 
27
- This runs the Vite client dev server and the local Worker runtime with automatic event tunneling. See [Development Experience](https://bkper.com/docs/build/apps/development.md) for details.
27
+ This runs the Vite client dev server and the local Worker runtime with automatic event tunneling. See [Development Experience](https://bkper.com/docs/platform/apps/development.md) for details.
28
28
 
29
29
  3. **Open the app**
30
30
 
@@ -32,7 +32,7 @@ This tutorial walks you through building and deploying a Bkper app from scratch.
32
32
 
33
33
  4. **Trigger an event**
34
34
 
35
- Go to any Bkper book and check a transaction. The event handler creates a 20% draft using the original from and to Accounts. It does not affect balances unless posted. See [Event Handlers](https://bkper.com/docs/build/apps/event-handlers.md) for the full event model.
35
+ Go to any Bkper book and check a transaction. The event handler creates a 20% draft using the original from and to Accounts. It does not affect balances unless posted. See [Event Handlers](https://bkper.com/docs/platform/apps/event-handlers.md) for the full event model.
36
36
 
37
37
  5. **Make a change**
38
38
 
@@ -40,7 +40,7 @@ This tutorial walks you through building and deploying a Bkper app from scratch.
40
40
 
41
41
  6. **Customize your listing**
42
42
 
43
- Update `bkper.yaml` with your app's description and owner details. Replace the placeholder logos in `client/public/images/`. See [App Listing](https://bkper.com/docs/build/apps/app-listing.md) for publishing details.
43
+ Update `bkper.yaml` with your app's description and owner details. Replace the placeholder logos in `client/public/images/`. See [App Listing](https://bkper.com/docs/platform/apps/app-listing.md) for publishing details.
44
44
 
45
45
  7. **Update the README**
46
46
 
@@ -56,7 +56,7 @@ This tutorial walks you through building and deploying a Bkper app from scratch.
56
56
  bkper app sync
57
57
  ```
58
58
 
59
- For an eligible standalone app without an external remote, sync creates private Bkper-managed source and configures it as `origin`. Authorized teammates and coding agents can then clone the same codebase with `bkper app clone my-app`. See [Shared App Source](https://bkper.com/docs/build/apps/shared-app-source.md) for access rules and other source workflows.
59
+ Stored Git source is required before an app can sync or deploy. For this standalone app without an external remote, sync creates the recommended private Bkper-managed source and configures it as `origin`. Authorized teammates and coding agents can then clone the same codebase with `bkper app clone my-app`. See [Shared App Source](https://bkper.com/docs/platform/apps/shared-app-source.md) for access rules and external source workflows.
60
60
 
61
61
  9. **Check and deploy**
62
62
 
@@ -65,12 +65,12 @@ This tutorial walks you through building and deploying a Bkper app from scratch.
65
65
  npm run deploy
66
66
  ```
67
67
 
68
- Deployment is explicit: syncing or pushing source does not deploy the app. Your app is live at `https://my-app.bkper.app`. See [Building & Deploying](https://bkper.com/docs/build/apps/deploying.md) for preview environments, secrets, and KV.
68
+ Deployment is explicit: syncing or pushing source does not deploy the app. Your app is live at `https://my-app.bkper.app`. See [Building & Deploying](https://bkper.com/docs/platform/apps/deploying.md) for preview environments, secrets, and KV.
69
69
 
70
70
  ## Next steps
71
71
 
72
- - [Shared App Source](https://bkper.com/docs/build/apps/shared-app-source.md) — Clone and improve one private app codebase together
73
- - [App Architecture](https://bkper.com/docs/build/apps/architecture.md) — Understand the single Worker client/server structure
74
- - [App Configuration](https://bkper.com/docs/build/apps/configuration.md) — Full `bkper.yaml` reference
75
- - [Event Handlers](https://bkper.com/docs/build/apps/event-handlers.md) — All event types and patterns
76
- - [Building & Deploying](https://bkper.com/docs/build/apps/deploying.md) — Preview environments and secrets
72
+ - [Shared App Source](https://bkper.com/docs/platform/apps/shared-app-source.md) — Clone and improve one private app codebase together
73
+ - [App Architecture](https://bkper.com/docs/platform/apps/architecture.md) — Understand the single Worker client/server structure
74
+ - [App Configuration](https://bkper.com/docs/platform/apps/configuration.md) — Full `bkper.yaml` reference
75
+ - [Event Handlers](https://bkper.com/docs/platform/apps/event-handlers.md) — All event types and patterns
76
+ - [Building & Deploying](https://bkper.com/docs/platform/apps/deploying.md) — Preview environments and secrets
@@ -20,20 +20,20 @@ The same Worker can expose app-defined `/api/*` routes. Treat those routes as th
20
20
 
21
21
  When an app needs model inference, use Bkper AI by default. An authenticated app API route or event establishes the user and app identity, then platform outbound supplies authorization and usage attribution for the Worker's Bkper AI requests. The app does not need provider credentials.
22
22
 
23
- See [Add Bkper AI to an App](https://bkper.com/docs/build/apps/ai.md) for live model discovery, strict structured output, validation, and the client-to-Worker authentication flow.
23
+ See [Add Bkper AI to an App](https://bkper.com/docs/platform/apps/ai.md) for live model discovery, strict structured output, validation, and the client-to-Worker authentication flow.
24
24
 
25
25
  ### Authentication
26
26
 
27
27
  OAuth is pre-configured. No client IDs, no redirect URIs, no consent screens to build.
28
28
 
29
- - **Web client** — Use `@bkper/web-auth`: `auth.getAccessToken()`. See [App Architecture → Client authentication](https://bkper.com/docs/build/apps/architecture.md#client-authentication).
30
- - **Server API routes** — Send `Authorization: Bearer <token>` to `/api/*`; dispatch validates it and platform outbound injects auth for server-side Bkper API calls. See [App Architecture → Server API authentication](https://bkper.com/docs/build/apps/architecture.md#server-api-authentication).
31
- - **Event handlers** — Handle `/events` in the same Worker and call Bkper with server-side `new Bkper()`; dispatch/outbound handle auth and agent identity. See [Event Handlers → Authentication](https://bkper.com/docs/build/apps/event-handlers.md#authentication).
32
- - **Local development** — The Vite auth middleware uses your CLI credentials. See [Development Experience → Local development authentication](https://bkper.com/docs/build/apps/development.md#local-development-authentication).
29
+ - **Web client** — Use `@bkper/web-auth`: `auth.getAccessToken()`. See [App Architecture → Client authentication](https://bkper.com/docs/platform/apps/architecture.md#client-authentication).
30
+ - **Server API routes** — Send `Authorization: Bearer <token>` to `/api/*`; dispatch validates it and platform outbound injects auth for server-side Bkper API calls. See [App Architecture → Server API authentication](https://bkper.com/docs/platform/apps/architecture.md#server-api-authentication).
31
+ - **Event handlers** — Handle `/events` in the same Worker and call Bkper with server-side `new Bkper()`; dispatch/outbound handle auth and agent identity. See [Event Handlers → Authentication](https://bkper.com/docs/platform/apps/event-handlers.md#authentication).
32
+ - **Local development** — The Vite auth middleware uses your CLI credentials. See [Development Experience → Local development authentication](https://bkper.com/docs/platform/apps/development.md#local-development-authentication).
33
33
 
34
34
  ### Services
35
35
 
36
- Declare the services you need in [`bkper.yaml`](https://bkper.com/docs/build/apps/configuration.md) and the platform provisions them:
36
+ Declare the services you need in [`bkper.yaml`](https://bkper.com/docs/platform/apps/configuration.md) and the platform provisions them:
37
37
 
38
38
  - **KV storage** — Key-value storage for caching and state. Access via `c.env.KV` in your handlers.
39
39
  - **Secrets** — Securely stored environment variables. Set via `bkper app secrets put`, access via `c.env.SECRET_NAME`.
@@ -54,7 +54,7 @@ Bkper can host one private codebase for your app. Authorized teammates and codin
54
54
 
55
55
  Source synchronization remains separate from deployment. A Git push stores source but never builds or deploys the app.
56
56
 
57
- See [Shared App Source](https://bkper.com/docs/build/apps/shared-app-source.md) for the collaboration workflow, access rules, and external Git options.
57
+ See [Shared App Source](https://bkper.com/docs/platform/apps/shared-app-source.md) for the collaboration workflow, access rules, and external Git options.
58
58
 
59
59
  ### Deployment
60
60
 
@@ -101,6 +101,6 @@ This gives you a working app with a client UI, server API routes, and `/events`
101
101
 
102
102
  ## Next steps
103
103
 
104
- - [Your First App](https://bkper.com/docs/build/apps/first-app.md) — Build and deploy a complete platform app
105
- - [Shared App Source](https://bkper.com/docs/build/apps/shared-app-source.md) — Collaborate from one private codebase
106
- - [App Architecture](https://bkper.com/docs/build/apps/architecture.md) — Understand how platform apps are structured
104
+ - [Your First App](https://bkper.com/docs/platform/apps/first-app.md) — Build and deploy a complete platform app
105
+ - [Shared App Source](https://bkper.com/docs/platform/apps/shared-app-source.md) — Collaborate from one private codebase
106
+ - [App Architecture](https://bkper.com/docs/platform/apps/architecture.md) — Understand how platform apps are structured
@@ -66,7 +66,7 @@ Keep the security boundary simple and explicit:
66
66
  - Access only the Book data needed for the operation.
67
67
  - Make event handling safe to retry and prevent event loops.
68
68
 
69
- See [App Security](https://bkper.com/docs/build/apps/security.md) and [Event Handlers](https://bkper.com/docs/build/apps/event-handlers.md) for implementation details.
69
+ See [App Security](https://bkper.com/docs/platform/apps/security.md) and [Event Handlers](https://bkper.com/docs/platform/apps/event-handlers.md) for implementation details.
70
70
 
71
71
  ## Verification
72
72
 
@@ -81,7 +81,7 @@ App reviews should report concrete findings with file locations and suggested fi
81
81
 
82
82
  ## Next Steps
83
83
 
84
- - [App Architecture](https://bkper.com/docs/build/apps/architecture.md) — Client, server, API, and event structure.
85
- - [App Security](https://bkper.com/docs/build/apps/security.md) — Authentication and authorization boundaries.
86
- - [Context Menu](https://bkper.com/docs/build/apps/context-menu.md) — Embedded Book context and open modes.
87
- - [Development Experience](https://bkper.com/docs/build/apps/development.md) — Local development and deterministic checks.
84
+ - [App Architecture](https://bkper.com/docs/platform/apps/architecture.md) — Client, server, API, and event structure.
85
+ - [App Security](https://bkper.com/docs/platform/apps/security.md) — Authentication and authorization boundaries.
86
+ - [Context Menu](https://bkper.com/docs/platform/apps/context-menu.md) — Embedded Book context and open modes.
87
+ - [Development Experience](https://bkper.com/docs/platform/apps/development.md) — Local development and deterministic checks.
@@ -8,7 +8,7 @@ Authentication identifies the Bkper user making a request. The platform handles
8
8
 
9
9
  Authorization determines whether that user may perform a specific operation.
10
10
 
11
- See [App Architecture](https://bkper.com/docs/build/apps/architecture.md) for the client and server authentication flow.
11
+ See [App Architecture](https://bkper.com/docs/platform/apps/architecture.md) for the client and server authentication flow.
12
12
 
13
13
  ## Authorize app operations
14
14
 
@@ -68,7 +68,7 @@ if (!isInstalled) {
68
68
 
69
69
  ## Next Steps
70
70
 
71
- - [App Quality Guidelines](https://bkper.com/docs/build/apps/quality.md) — Review cross-cutting app quality and security expectations.
72
- - [App Architecture](https://bkper.com/docs/build/apps/architecture.md) — Understand client and server authentication flows.
73
- - [Building & Deploying](https://bkper.com/docs/build/apps/deploying.md#setting-secrets) — Store production and preview secrets.
74
- - [Event Handlers](https://bkper.com/docs/build/apps/event-handlers.md#authentication) — Understand authentication for platform and self-hosted events.
71
+ - [App Quality Guidelines](https://bkper.com/docs/platform/apps/quality.md) — Review cross-cutting app quality and security expectations.
72
+ - [App Architecture](https://bkper.com/docs/platform/apps/architecture.md) — Understand client and server authentication flows.
73
+ - [Building & Deploying](https://bkper.com/docs/platform/apps/deploying.md#setting-secrets) — Store production and preview secrets.
74
+ - [Event Handlers](https://bkper.com/docs/platform/apps/event-handlers.md#authentication) — Understand authentication for platform and self-hosted events.
@@ -1,6 +1,6 @@
1
1
  # Bkper Self-Hosted Webhooks
2
2
 
3
- The [Bkper Platform](https://bkper.com/docs/build/apps/overview.md) handles hosting, authentication, and deployment for you. However, you can host event handlers on your own infrastructure if you have specific requirements — existing cloud setup, compliance constraints, or legacy apps.
3
+ The [Bkper Platform](https://bkper.com/docs/platform/apps/overview.md) handles hosting, authentication, and deployment for you. However, you can host event handlers on your own infrastructure if you have specific requirements — existing cloud setup, compliance constraints, or legacy apps.
4
4
 
5
5
  > **Tip**
6
6
  > Use the Bkper Platform unless you have a specific reason to self-host. It eliminates the need to manage authentication, secrets, hosting, and deployment yourself.
@@ -8,7 +8,7 @@ The [Bkper Platform](https://bkper.com/docs/build/apps/overview.md) handles host
8
8
 
9
9
  A Bkper event handler running on [Google Cloud Functions](https://cloud.google.com/functions/) receives authenticated calls from the `bkper-hrd@appspot.gserviceaccount.com` service account. You need to grant this service account the [Cloud Functions Invoker IAM role](https://cloud.google.com/functions/docs/securing/managing-access-iam) (`roles/cloudfunctions.invoker`).
10
10
 
11
- Set the production endpoint in [`bkper.yaml`](https://bkper.com/docs/build/apps/configuration.md):
11
+ Set the production endpoint in [`bkper.yaml`](https://bkper.com/docs/platform/apps/configuration.md):
12
12
 
13
13
  ```yaml
14
14
  webhookUrl: https://us-central1-my-project.cloudfunctions.net/events
@@ -32,7 +32,7 @@ The function response must follow the standard format:
32
32
  { result?: any, error?: any }
33
33
  ```
34
34
 
35
- See [Event Handlers](https://bkper.com/docs/build/apps/event-handlers.md#response-format) for details on response handling.
35
+ See [Event Handlers](https://bkper.com/docs/platform/apps/event-handlers.md#response-format) for details on response handling.
36
36
 
37
37
  ### Considerations
38
38
 
@@ -46,7 +46,7 @@ See [Event Handlers](https://bkper.com/docs/build/apps/event-handlers.md#respons
46
46
 
47
47
  You can host event handlers on any infrastructure — other cloud providers, containers, on-premise servers.
48
48
 
49
- Configure the same `webhookUrl` property in [`bkper.yaml`](https://bkper.com/docs/build/apps/configuration.md):
49
+ Configure the same `webhookUrl` property in [`bkper.yaml`](https://bkper.com/docs/platform/apps/configuration.md):
50
50
 
51
51
  ```yaml
52
52
  webhookUrl: https://my-server.example.com/bkper/events
@@ -2,7 +2,7 @@
2
2
 
3
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
4
 
5
- Shared app source supports development collaboration. It does not automatically build or deploy your app.
5
+ Every app sync and deployment requires clean, committed source stored in a durable Git remote. Bkper-managed source is the recommended default for development collaboration. It does not automatically build or deploy your app.
6
6
 
7
7
  ## Who can access the source
8
8
 
@@ -66,7 +66,7 @@ Keep agent instructions such as `AGENTS.md` in the repository so every teammate
66
66
 
67
67
  ## Source synchronization is not deployment
68
68
 
69
- Source storage and app deployment are separate operations:
69
+ Source storage and app deployment are separate operations. Apps without a Git repository cannot sync or deploy; the CLI provides the initialization and managed-sync steps needed to establish source safely.
70
70
 
71
71
  | Action | What it does with source | Does it deploy? |
72
72
  | ------------------ | ------------------------------------------------------------------------------ | --------------- |
@@ -75,19 +75,24 @@ Source storage and app deployment are separate operations:
75
75
  | `npm run build` | Creates local build output in `dist/`. | No |
76
76
  | `bkper app deploy` | Pushes and verifies the managed commit, then uploads the existing local build. | Yes |
77
77
 
78
- 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.
78
+ 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. The CLI verifies the stored source commit but does not prove that the local `dist/` output was built from it.
79
79
 
80
- 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.
80
+ Managed sync and deploy require a clean, committed working tree and use fast-forward safety checks. External sync and deploy require the current branch to track an upstream containing the current clean commit. The CLI does not automatically commit, merge, rebase, force-push, reset, discard files, choose an external remote, or push to an external provider.
81
81
 
82
82
  ## External Git and monorepos
83
83
 
84
84
  Bkper-managed source is optional. Existing workflows remain external when:
85
85
 
86
- - the app already has a GitHub, GitLab, or other provider remote;
87
- - `bkper.yaml` is inside a monorepo rather than at the repository root; or
88
- - the app is otherwise not rooted in a standalone Git repository.
86
+ - the app already has a GitHub, GitLab, or other provider remote; or
87
+ - `bkper.yaml` is inside a monorepo rather than at the repository root.
89
88
 
90
- Clone those apps from their external provider. `bkper app clone` is for Bkper-managed source only.
89
+ The current branch must have a configured upstream containing the commit being synced or deployed. If no upstream is configured, choose the intended provider remote and store the branch explicitly:
90
+
91
+ ```bash
92
+ git push --set-upstream <remote> <branch>
93
+ ```
94
+
95
+ The CLI fetches and verifies the upstream without pushing or changing the working tree. Clone external apps from their provider. `bkper app clone` is for Bkper-managed source only.
91
96
 
92
97
  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.
93
98
 
@@ -95,7 +100,7 @@ The `repoUrl` field in `bkper.yaml` is app-listing metadata. It does not select
95
100
 
96
101
  ## Next steps
97
102
 
98
- - [Your First App](https://bkper.com/docs/build/apps/first-app.md) — Scaffold an app and establish its shared source
99
- - [Building & Deploying](https://bkper.com/docs/build/apps/deploying.md) — Build, sync, preview, and deploy explicitly
100
- - [CLI](https://bkper.com/docs/build/tools/cli.md) — Install the CLI and review its app-development workflows
103
+ - [Your First App](https://bkper.com/docs/platform/apps/first-app.md) — Scaffold an app and establish its shared source
104
+ - [Building & Deploying](https://bkper.com/docs/platform/apps/deploying.md) — Build, sync, preview, and deploy explicitly
105
+ - [CLI](https://bkper.com/docs/platform/tools/cli.md) — Install the CLI and review its app-development workflows
101
106
  - [Coding Agents](https://bkper.com/docs/ai/coding-agents.md) — Give coding agents the Bkper and project context they need
@@ -9,14 +9,16 @@ Build, deploy, and manage Bkper apps using the `bkper` CLI.
9
9
 
10
10
  ## Source control modes
11
11
 
12
- Bkper selects source mode without changing the local-build deployment model:
12
+ Every App sync and deployment requires an attached, clean, committed Git source stored in a durable remote. Bkper-managed private Git is the recommended default:
13
13
 
14
14
  - **Managed source:** `bkper app sync` activates private Bkper-managed Git for a new or existing App when `bkper.yaml` is at the root of a standalone Git repository, the current clean committed branch is `main`, and no Git remote exists. Bkper configures the managed repository as `origin`. New Apps initially upload `main`; existing Apps atomically upload all local branches and tags.
15
- - **External source:** an App keeps direct sync/deploy behavior when it has an external Git remote, is nested in a monorepo, or is not rooted at `bkper.yaml`. The CLI never changes an existing external remote.
15
+ - **External source:** an App keeps its provider when it has an external Git remote or is nested in a monorepo. Its current branch must track an upstream branch containing the current commit. The CLI fetches and verifies that upstream before sync or deploy, but never chooses a remote or pushes external source.
16
16
 
17
- To opt out, keep a GitHub, GitLab, or other provider remote configured. Managed mode is sticky after activation; adding another remote later does not change it, and Artifacts remains `origin`. The App listing `repoUrl` metadata does not select source mode.
17
+ Apps without a Git repository cannot sync or deploy. The CLI returns the exact initialization, review, commit, and managed-sync steps so a user or coding agent can establish source safely. To use GitHub, GitLab, or another provider instead, configure the intended branch upstream and push it before syncing.
18
18
 
19
- Source and deployment remain separate. `git push` stores source only and **never deploys**. `bkper app sync` pushes managed source before syncing local metadata. `bkper app deploy` pushes managed source, verifies that the exact commit exists in the linked repository, and then uploads the existing local `dist/server` and optional `dist/client` output. Builds remain local and explicit; Bkper does not claim reproducible remote CI or prove that the local bundle was built from the declared commit. Source linkage is best-effort provenance for already-authorized developers.
19
+ Managed mode is sticky after activation; adding another remote later does not change it, and Artifacts remains `origin`. The App listing `repoUrl` metadata does not select source mode.
20
+
21
+ Source and deployment remain separate. `git push` stores source only and **never deploys**. `bkper app sync` pushes managed source or verifies external source before syncing local metadata. `bkper app deploy` pushes and verifies managed source, or verifies that the external upstream contains the current commit, before uploading the existing local `dist/server` and optional `dist/client` output. Builds remain local and explicit; Bkper does not prove that the local bundle was built from the verified commit.
20
22
 
21
23
  CLI-managed pushes are clean-tree and fast-forward-only. The CLI never commits, merges, rebases, force-pushes, resets, or discards files. Authorized developers may use ordinary Git commands, including an intentional force-push, but a push still never deploys.
22
24
 
@@ -113,7 +115,7 @@ npm run build
113
115
  bkper app deploy
114
116
  ```
115
117
 
116
- For a managed App, sync and deploy safely push the current committed branch. For an external App, both commands preserve direct local metadata and bundle upload behavior without changing remotes.
118
+ For a managed App, sync and deploy safely push the current committed branch. For an external App, both commands require a configured upstream containing the current clean commit and preserve direct local metadata and bundle upload behavior without changing remotes.
117
119
 
118
120
  Verify:
119
121
 
@@ -191,8 +193,9 @@ bkper app get <appId> --json
191
193
  # Deploy to preview environment (URL: https://{appId}-preview.bkper.app)
192
194
  bkper app deploy --preview
193
195
 
194
- # Check deployment status
196
+ # Check deployment status from the current app or by ID
195
197
  bkper app status
198
+ bkper app status <appId>
196
199
  ```
197
200
 
198
201
  > **Note:** `bkper app dev` runs one local Worker runtime — Miniflare, file watching, and an optional Cloudflare tunnel to `/events` when the app subscribes to events. Miniflare is loaded from the app project's `devDependencies` so each app can keep its local Workers simulator aligned with its own code. The Vite client dev server is configured in the project's `vite.config.ts` and run separately. The project template composes both via `npm run dev` using `concurrently`. Open the printed `Open app` URL in your browser; the `Worker/API` URL is for `/api`, `/health`, `/openapi.json`, and events. If your Vite server uses a port other than `5173`, pass that port with `--cp, --client-port` so the local `ASSETS` binding can reach it. If needed, install Miniflare in the app root with `bun add -d miniflare` or `npm install -D miniflare`.
@@ -220,13 +223,13 @@ If Git authentication fails:
220
223
 
221
224
  The helper command is intentionally `bkper app git-credential <appId> [operation]`. It is internal Git plumbing, not a root `git` command or an `app git` group.
222
225
 
223
- ## Managed Git preflight recovery
226
+ ## Source preflight recovery
224
227
 
225
- Managed sync and deploy require `bkper.yaml` at the Git root, an attached branch, committed `HEAD`, and a clean tree. Ignored build output such as `dist/` is allowed.
228
+ Every sync and deploy requires an attached branch, committed `HEAD`, a clean tree, and durable source storage. Managed source additionally requires `bkper.yaml` at the Git root. Ignored build output such as `dist/` is allowed.
226
229
 
227
230
  | Failure | Safe recovery |
228
231
  | --- | --- |
229
- | No Git repository | For a standalone App, run `git init -b main`, review files, commit, and retry. An eligible new or existing App activates managed source on sync when no remote exists. |
232
+ | No Git repository | From the App root, run `git init -b main`, review `.gitignore` and all source files, commit, then run `bkper app sync` to activate the recommended managed source. |
230
233
  | `bkper.yaml` below Git root | Keep the monorepo/external workflow; managed monorepos are not supported. |
231
234
  | No commits | Review, then run `git add .` and `git commit -m "Initial app"`. |
232
235
  | Detached `HEAD` | Attach a branch with `git switch -c <branch>`; use `main` for first activation. |
@@ -234,6 +237,8 @@ Managed sync and deploy require `bkper.yaml` at the Git root, an attached branch
234
237
  | Staged changes | Inspect `git diff --cached`; commit them or intentionally unstage them before retrying. |
235
238
  | Modified tracked files | Inspect `git diff`; commit or intentionally restore them before retrying. |
236
239
  | Non-ignored untracked files | Inspect `git status`; commit, ignore, or intentionally remove them before retrying. |
240
+ | External branch has no upstream | Choose the intended provider remote and run `git push --set-upstream <remote> <branch>`, then retry. The CLI never guesses or pushes an external remote. |
241
+ | Current commit is not upstream | Push the current branch to its configured upstream, then retry. |
237
242
  | Missing or incorrect managed `origin` | Inspect `git remote -v`; compare with a fresh managed clone. Do not overwrite an external remote. |
238
243
  | Authentication or expired credential | Run `bkper auth login` if needed, then retry the Git operation for a new five-minute token. |
239
244
  | Remote branch ahead or divergent | Run `git fetch origin <branch>` and inspect `git log --oneline --left-right HEAD...origin/<branch>`; merge or rebase by your own choice, then push and retry. The CLI never force-resolves divergence. |
@@ -549,11 +554,11 @@ Inside the interactive agent:
549
554
  - `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.
550
555
  - `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.
551
556
  - `app list` - List all apps you have access to
552
- - `app sync` - Sync [bkper.yaml][bkper.yaml reference] configuration. For an eligible standalone repository with no remote, activate managed source for a new or existing App; existing migrations atomically upload all local branches and tags. If already managed, cleanly fast-forward-push the current committed branch first.
557
+ - `app sync` - Verify that source is clean, committed, and stored before syncing [bkper.yaml][bkper.yaml reference]. For an eligible standalone repository with no remote, activate managed source for a new or existing App; existing migrations atomically upload all local branches and tags. For external source, verify that the configured upstream contains the current commit.
553
558
  - `app build` - Build the server Worker bundle for deployment
554
- - `app deploy` - For managed Apps, cleanly fast-forward-push and verify the current commit, then explicitly deploy the existing local build. External Apps keep direct upload behavior.
559
+ - `app deploy` - Require stored source, then explicitly deploy the existing local build. Managed Apps safely push and Platform-verifies the current commit. External Apps keep direct upload behavior after the CLI verifies that their upstream contains the current commit.
555
560
  - `-p, --preview` - Deploy to preview environment
556
- - `app status` - Show deployment status
561
+ - `app status [appId]` - Show deployment status. When `appId` is omitted, the app id is read from local app config.
557
562
  - `app logs [appId]` - View recent app logs. When `appId` is omitted, the app id is read from local app config.
558
563
  - `--since <time>` - ISO8601 or relative lower bound (e.g. `5m`, `1h`, `15d`)
559
564
  - `--until <time>` - ISO8601 or relative upper bound
@@ -147,6 +147,6 @@ Collections can also serve as references for automations (Bots or Apps) that wor
147
147
 
148
148
  ## Events
149
149
 
150
- Every action in a Book — posting a transaction, editing an account, adding a comment — generates an **Event**. Events record _who_ (a user) or _what_ (a bot, an automation) performed the action and _when_, forming a complete audit trail essential for collaboration and trust.
150
+ Every action in a Book — such as posting a transaction, editing an account, or attaching a file — generates an **Event**. Events record _who_ (a user) or _what_ (a bot, an automation) performed the action and _when_, forming a complete audit trail essential for collaboration and trust.
151
151
 
152
152
  Events are also the foundation of Bkper's automation model. Bots and Agents listen for specific event types and react automatically — for example, calculating taxes when a transaction is posted or converting currencies when one is checked.
@@ -190,6 +190,8 @@ More information at the [Bkper Developer Documentation](https://bkper.com/docs/#
190
190
  - `startedTrial?`: `boolean` — True if the user has started the trial period
191
191
  - `totalTransactionsThisMonth?`: `number` — User-level total transactions this month
192
192
  - `totalTransactionsThisYear?`: `number` — User-level total transactions this year
193
+ - `transactionsAverage?`: `number` — Authoritative rounded-up rolling monthly average of posted transactions for the current plan
194
+ - `transactionsCapacity?`: `number` — Confirmed average monthly transaction capacity for the current plan
193
195
 
194
196
  ### Book
195
197
 
@@ -509,6 +509,8 @@ The Billing information includes the plan, the admin email, and the billing port
509
509
  - `getPortalUrl(returnUrl: string)` → `Promise<string | undefined>` — Gets the URL to redirect the User to the billing portal.
510
510
  - `getTotalTransactionsThisMonth()` → `number | undefined` — Gets the number of total transactions this month for the User's billing account.
511
511
  - `getTotalTransactionsThisYear()` → `number | undefined` — Gets the number of total transactions this year for the User's billing account.
512
+ - `getTransactionsAverage()` → `number | undefined` — Gets the authoritative rolling monthly average of posted transactions.
513
+ - `getTransactionsCapacity()` → `number | undefined` — Gets the confirmed average monthly transaction capacity.
512
514
  - `hasStartedTrial()` → `boolean | undefined` — Tells if the User has started the trial period.
513
515
  - `isEnabled()` → `boolean | undefined` — Tells if billing is enabled for the User.
514
516
  - `isPlanOverdue()` → `boolean | undefined` — Tells if the User's current plan payment is overdue.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bkper",
3
- "version": "4.29.4",
3
+ "version": "4.30.0",
4
4
  "description": "Official Bkper CLI for accounting data, automation, apps, and AI agents",
5
5
  "bin": {
6
6
  "bkper": "./lib/cli.js"