bkper 5.5.1 → 5.5.3
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/pi-shared-modules.d.ts +2 -2
- package/lib/agent/themes/bkper-dark.json +1 -1
- package/lib/agent/themes/bkper-light.json +1 -1
- package/lib/docs/api/managed-agent.md +2 -2
- package/lib/docs/apps/ai.md +1 -1
- package/lib/docs/apps/context-menu.md +14 -2
- package/lib/docs/apps/overview.md +31 -14
- package/lib/docs/core/core-concepts.md +4 -4
- package/package.json +8 -4
|
@@ -2,8 +2,8 @@ import type * as PiTui from '@earendil-works/pi-tui';
|
|
|
2
2
|
/**
|
|
3
3
|
* Runtime access to the Pi packages that Pi itself uses.
|
|
4
4
|
*
|
|
5
|
-
* pi-coding-agent publishes an npm-shrinkwrap.json,
|
|
6
|
-
* under it instead of sharing ours. Importing those packages directly would load a second, separate instance:
|
|
5
|
+
* When pi-coding-agent publishes an npm-shrinkwrap.json (1.0.0 did), npm installs its own copies of pi-tui and
|
|
6
|
+
* pi-ai nested under it instead of sharing ours. Importing those packages directly would load a second, separate instance:
|
|
7
7
|
* `instanceof` checks against Pi's objects fail and module state such as the user's keybindings is not seen.
|
|
8
8
|
* Bun ignores the shrinkwrap and installs a single copy, so the problem never shows up in local development.
|
|
9
9
|
*
|
|
@@ -60,7 +60,7 @@ curl --fail-with-body \
|
|
|
60
60
|
-H "Authorization: Bearer ${BKPER_TOKEN}"
|
|
61
61
|
```
|
|
62
62
|
|
|
63
|
-
3. Read the reply. Its `content` holds `text` blocks, plus `thinking` and `tool_call` blocks for the agent's reasoning and steps.
|
|
63
|
+
3. Read the reply. Its `content` holds `text` blocks, plus `thinking` and `tool_call` blocks for the agent's reasoning and steps; a step's `summary` names it in a few plain words.
|
|
64
64
|
|
|
65
65
|
```bash
|
|
66
66
|
curl --fail-with-body \
|
|
@@ -83,7 +83,7 @@ The agent receives, in order:
|
|
|
83
83
|
3. **Each message**, with its optional `bookContext` as labeled information, never as instructions or permission.
|
|
84
84
|
4. **Each message's attached files**, copied into the workspace and listed with their paths as labeled information.
|
|
85
85
|
|
|
86
|
-
There is no default. Without `instructions`, the agent follows only Bkper's base, which does not ask anyone before acting. Bkper Agent sends its own instructions, so it asks questions and
|
|
86
|
+
There is no default. Without `instructions`, the agent follows only Bkper's base, which does not ask anyone before acting. Bkper Agent sends its own instructions, so it asks questions and makes only the changes it is asked for; your interface decides its own.
|
|
87
87
|
|
|
88
88
|
For a Slack bot:
|
|
89
89
|
|
package/lib/docs/apps/ai.md
CHANGED
|
@@ -98,7 +98,7 @@ Keep schemas simple. Constraints such as a string's minimum or maximum length ma
|
|
|
98
98
|
|
|
99
99
|
## Run an agent
|
|
100
100
|
|
|
101
|
-
For a chat that does real work on Books, start a session on the [Managed Agent API](https://bkper.com/docs/api/managed-agent.md) from the app's server. Bkper runs the agent in the user's private cloud workspace, with the `bkper` CLI, files, and durable sessions. Your app keeps its screens, prompts, and instructions. The Managed Agent is in
|
|
101
|
+
For a chat that does real work on Books, start a session on the [Managed Agent API](https://bkper.com/docs/api/managed-agent.md) from the app's server. Bkper runs the agent in the user's private cloud workspace, with the `bkper` CLI, files, and durable sessions. Your app keeps its screens, prompts, and instructions. The Managed Agent is in beta.
|
|
102
102
|
|
|
103
103
|
```ts
|
|
104
104
|
// No Authorization header: the platform adds the user's.
|
|
@@ -117,11 +117,11 @@ Each time the App iframe finishes loading, Bkper announces the requests it suppo
|
|
|
117
117
|
```js
|
|
118
118
|
{
|
|
119
119
|
type: 'bkper:host-ready',
|
|
120
|
-
supports: ['navigate'],
|
|
120
|
+
supports: ['navigate', 'show-book'],
|
|
121
121
|
}
|
|
122
122
|
```
|
|
123
123
|
|
|
124
|
-
Send `bkper:navigate` only after receiving this message with `navigate` in `supports`. Until then, keep the normal link behavior. Register the message listener when the App starts, so it does not miss the message.
|
|
124
|
+
Send `bkper:navigate` only after receiving this message with `navigate` in `supports`, and `bkper:show-book` only with `show-book` in `supports`. Until then, keep the normal link behavior. Register the message listener when the App starts, so it does not miss the message.
|
|
125
125
|
|
|
126
126
|
Apps opened with `NEW_TAB` do not receive this message, because they have no Bkper parent.
|
|
127
127
|
|
|
@@ -199,6 +199,18 @@ document.addEventListener('click', event => {
|
|
|
199
199
|
});
|
|
200
200
|
```
|
|
201
201
|
|
|
202
|
+
#### Showing the Book
|
|
203
|
+
|
|
204
|
+
An expanded panel covers the Book. When the user changes what the Book shows behind it, such as by clicking an account, the App can ask Bkper to let the user see the change:
|
|
205
|
+
|
|
206
|
+
```js
|
|
207
|
+
window.parent.postMessage({ type: 'bkper:show-book' }, BKPER_ORIGIN);
|
|
208
|
+
```
|
|
209
|
+
|
|
210
|
+
Bkper ignores the message when it does not come from the App iframe currently open in the panel, or not from that iframe's own origin. For a valid request, an expanded panel returns to sidebar size; otherwise nothing changes. Bkper does not reply.
|
|
211
|
+
|
|
212
|
+
The App decides when to ask. An App whose panel already reflects the Book's context, such as a report rebuilt for each query, may prefer to stay expanded and never send it. To follow the user's changes, send it when a [`bkper:app-url-changed`](#live-context-updates) message changes the context the Book shows.
|
|
213
|
+
|
|
202
214
|
### Available expressions
|
|
203
215
|
|
|
204
216
|
The menu URL supports these dynamic expressions:
|
|
@@ -16,11 +16,26 @@ The same Worker can expose app-defined `/api/*` routes. Treat those routes as th
|
|
|
16
16
|
- Scripts, external clients, and agents can call them too.
|
|
17
17
|
- The default template documents them with an app OpenAPI spec at `/openapi.json`.
|
|
18
18
|
|
|
19
|
-
### AI
|
|
19
|
+
### AI gateway
|
|
20
20
|
|
|
21
|
-
|
|
21
|
+
Apps call Bkper AI models through the AI gateway, with no provider accounts or keys:
|
|
22
22
|
|
|
23
|
-
|
|
23
|
+
- **Language models** — multi-provider models over the Open Responses protocol, for text and structured output.
|
|
24
|
+
- **Decision models** — typed answers with calibrated confidence: yes or no, one of your options, or a level on a scale.
|
|
25
|
+
|
|
26
|
+
Usage counts against the user's included Bkper AI allowance. An authenticated app API route or event establishes the user and app identity, and the platform adds authorization and usage attribution to the Worker's requests. For inference used only by the UI, the client can also call Bkper AI directly with the signed-in user's token.
|
|
27
|
+
|
|
28
|
+
See [Add Bkper AI to an App](https://bkper.com/docs/platform/apps/ai.md) for the authentication flow and SDK setup.
|
|
29
|
+
|
|
30
|
+
### Managed agents
|
|
31
|
+
|
|
32
|
+
Build your own agent, such as a chat inside a Book or a Slack bot, on the Managed Agent API. Your app keeps its screens and instructions; Bkper runs the rest:
|
|
33
|
+
|
|
34
|
+
- **The agent loop** — models, tool calls, and durable sessions that continue across apps, including Bkper Agent.
|
|
35
|
+
- **A dedicated sandbox machine for each user** — the `bkper` CLI, Node, Python, and a persistent workspace for files and reports.
|
|
36
|
+
- **The user's permissions** — the agent acts as the user, and credentials never enter the machine.
|
|
37
|
+
|
|
38
|
+
See [Add Bkper AI to an App → Run an agent](https://bkper.com/docs/platform/apps/ai.md#run-an-agent).
|
|
24
39
|
|
|
25
40
|
### Authentication
|
|
26
41
|
|
|
@@ -71,17 +86,19 @@ Your app is live at `{appId}.bkper.app`. The platform handles routing, SSL, and
|
|
|
71
86
|
|
|
72
87
|
Without the platform, creating a Bkper app with a UI, event handling, and authentication requires:
|
|
73
88
|
|
|
74
|
-
| Concern | Without the platform
|
|
75
|
-
| ------------------------ |
|
|
76
|
-
| **Hosting** | Provision servers, configure domains, SSL, CDN
|
|
77
|
-
| **Authentication** | Register OAuth client, build consent screen, handle token refresh, manage redirect URIs
|
|
78
|
-
| **Event webhooks** | Set up a public endpoint, configure DNS, handle JWT verification
|
|
79
|
-
| **Local dev webhooks** | Install ngrok or similar, manually configure tunnel URL
|
|
80
|
-
| **Secrets** | Set up a secrets manager, configure access
|
|
81
|
-
| **KV storage** | Deploy Redis/Memcached, manage connections
|
|
82
|
-
| **Preview environments** | Build a staging pipeline
|
|
83
|
-
| **Shared app source** | Operate a separate private Git host
|
|
84
|
-
| **
|
|
89
|
+
| Concern | Without the platform | With the platform |
|
|
90
|
+
| ------------------------ | ------------------------------------------------------------------------------------------------ | ----------------------------------------------- |
|
|
91
|
+
| **Hosting** | Provision servers, configure domains, SSL, CDN | `bkper app deploy` |
|
|
92
|
+
| **Authentication** | Register OAuth client, build consent screen, handle token refresh, manage redirect URIs | `auth.getAccessToken()` |
|
|
93
|
+
| **Event webhooks** | Set up a public endpoint, configure DNS, handle JWT verification | Declare in `bkper.yaml`, platform routes events |
|
|
94
|
+
| **Local dev webhooks** | Install ngrok or similar, manually configure tunnel URL | `bkper app dev` starts tunnel automatically |
|
|
95
|
+
| **Secrets** | Set up a secrets manager, configure access | `bkper app secrets put` |
|
|
96
|
+
| **KV storage** | Deploy Redis/Memcached, manage connections | Declare `KV` in `bkper.yaml` |
|
|
97
|
+
| **Preview environments** | Build a staging pipeline | `bkper app deploy --preview` |
|
|
98
|
+
| **Shared app source** | Operate a separate private Git host | Managed source for app developers and agents |
|
|
99
|
+
| **AI models** | Open provider accounts, manage API keys, pay separate bills | AI gateway with the included Bkper AI allowance |
|
|
100
|
+
| **Agents** | Run the agent loop and a sandbox for each user, persist sessions and files, keep credentials out | Managed Agent API |
|
|
101
|
+
| **Type safety** | Manually create type definitions | `env.d.ts` auto-generated |
|
|
85
102
|
|
|
86
103
|
The platform eliminates all of this. You write business logic, the platform handles infrastructure.
|
|
87
104
|
|
|
@@ -18,8 +18,8 @@ Bkper organizes Accounts into four types that determine how an Account behaves a
|
|
|
18
18
|
|
|
19
19
|
- **Asset** (blue) — **permanent**. Real resources you own: bank accounts, cash, receivables. Balances carry forward continuously, showing your position at any point in time.
|
|
20
20
|
- **Liability** (yellow) — **permanent**. Obligations you owe: credit cards, loans, supplier debts. Balances also carry forward continuously.
|
|
21
|
-
- **Incoming** (green) — **non-permanent**.
|
|
22
|
-
- **Outgoing** (red) — **non-permanent**.
|
|
21
|
+
- **Incoming** (green) — **non-permanent**. Where resources come in from: salary, sales, interest. Balances track activity within a selected period rather than as a cumulative position.
|
|
22
|
+
- **Outgoing** (red) — **non-permanent**. Where resources go out to: rent, supplies, payroll. Balances also track activity within a selected period.
|
|
23
23
|
|
|
24
24
|
## Transactions
|
|
25
25
|
|
|
@@ -59,8 +59,8 @@ Groups inherit the nature of the accounts they contain:
|
|
|
59
59
|
- **Asset-only group** — behaves as Asset (blue)
|
|
60
60
|
- **Liability-only group** — behaves as Liability (yellow)
|
|
61
61
|
- **Mixed Asset + Liability** — shows Equity (gray, net balance)
|
|
62
|
-
- **Incoming-only group** — behaves as
|
|
63
|
-
- **Outgoing-only group** — behaves as
|
|
62
|
+
- **Incoming-only group** — behaves as Incoming (green)
|
|
63
|
+
- **Outgoing-only group** — behaves as Outgoing (red)
|
|
64
64
|
- **Mixed Incoming + Outgoing** — shows Net Result (gray)
|
|
65
65
|
|
|
66
66
|
## Books
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "bkper",
|
|
3
|
-
"version": "5.5.
|
|
3
|
+
"version": "5.5.3",
|
|
4
4
|
"description": "Official Bkper CLI for accounting data, automation, apps, and AI agents",
|
|
5
5
|
"bin": {
|
|
6
6
|
"bkper": "lib/cli.js"
|
|
@@ -63,7 +63,13 @@
|
|
|
63
63
|
"upgrade:api": "bun update @bkper/bkper-api-types --latest && bun update bkper-js --latest"
|
|
64
64
|
},
|
|
65
65
|
"dependencies": {
|
|
66
|
-
"@earendil-works/pi-
|
|
66
|
+
"@earendil-works/pi-agent-core": "1.2.0",
|
|
67
|
+
"@earendil-works/pi-ai": "1.2.0",
|
|
68
|
+
"@earendil-works/pi-codemode": "1.2.0",
|
|
69
|
+
"@earendil-works/pi-coding-agent": "1.2.0",
|
|
70
|
+
"@earendil-works/pi-mcp": "1.2.0",
|
|
71
|
+
"@earendil-works/pi-telemetry": "1.2.0",
|
|
72
|
+
"@earendil-works/pi-tui": "1.2.0",
|
|
67
73
|
"bkper-js": "^2.42.0",
|
|
68
74
|
"commander": "^13.1.0",
|
|
69
75
|
"dotenv": "^8.2.0",
|
|
@@ -87,8 +93,6 @@
|
|
|
87
93
|
},
|
|
88
94
|
"devDependencies": {
|
|
89
95
|
"@bkper/bkper-api-types": "^5.44.0",
|
|
90
|
-
"@earendil-works/pi-ai": "1.1.0",
|
|
91
|
-
"@earendil-works/pi-tui": "1.1.0",
|
|
92
96
|
"@types/chai": "^4.3.0",
|
|
93
97
|
"@types/mocha": "^10.0.0",
|
|
94
98
|
"@types/node": "^22.5.1",
|