bkper 5.5.2 → 5.5.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/agent-command-runner.d.ts +5 -1
- package/lib/agent/agent-command-runner.d.ts.map +1 -1
- package/lib/agent/agent-command-runner.js +11 -2
- package/lib/agent/agent-command-runner.js.map +1 -1
- package/lib/agent/agent-entry.d.ts +1 -1
- package/lib/agent/agent-entry.d.ts.map +1 -1
- package/lib/agent/agent-entry.js +1 -0
- package/lib/agent/agent-entry.js.map +1 -1
- package/lib/agent/bundle/agent-entry.js +2379 -0
- package/lib/agent/bundle/anthropic.js +75 -0
- package/lib/agent/bundle/bedrock-converse-stream.js +133 -0
- package/lib/agent/bundle/codemode-worker.js +478 -0
- package/lib/agent/bundle/github-copilot.js +2 -0
- package/lib/agent/bundle/image-resize-worker.js +2 -0
- package/lib/agent/bundle/kimi-coding.js +2 -0
- package/lib/agent/bundle/meta.js +2 -0
- package/lib/agent/bundle/openai-chatgpt.js +75 -0
- package/lib/agent/bundle/openai-codex.js +75 -0
- package/lib/agent/bundle/openrouter.js +75 -0
- package/lib/agent/bundle/radius.js +75 -0
- package/lib/agent/bundle/update-worker.js +3 -0
- package/lib/agent/bundle/xai.js +2 -0
- package/lib/agent/extensions/bkper-ai-provider.d.ts.map +1 -1
- package/lib/agent/extensions/bkper-ai-provider.js +62 -2
- package/lib/agent/extensions/bkper-ai-provider.js.map +1 -1
- package/lib/agent/extensions/startup.d.ts.map +1 -1
- package/lib/agent/extensions/startup.js +8 -3
- package/lib/agent/extensions/startup.js.map +1 -1
- package/lib/agent/interactive/interactive-mode.d.ts.map +1 -1
- package/lib/agent/interactive/interactive-mode.js +26 -0
- package/lib/agent/interactive/interactive-mode.js.map +1 -1
- package/lib/agent/pi-package-env.d.ts +2 -0
- package/lib/agent/pi-package-env.d.ts.map +1 -0
- package/lib/agent/pi-package-env.js +4 -0
- package/lib/agent/pi-package-env.js.map +1 -0
- package/lib/agent/pi-shared-modules.d.ts +6 -17
- package/lib/agent/pi-shared-modules.d.ts.map +1 -1
- package/lib/agent/pi-shared-modules.js +10 -31
- package/lib/agent/pi-shared-modules.js.map +1 -1
- package/lib/agent/system-prompt.d.ts.map +1 -1
- package/lib/agent/system-prompt.js +8 -19
- package/lib/agent/system-prompt.js.map +1 -1
- package/lib/commands/agent-command.d.ts +2 -1
- package/lib/commands/agent-command.d.ts.map +1 -1
- package/lib/commands/agent-command.js +12 -4
- package/lib/commands/agent-command.js.map +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/lib/upgrade/installation.d.ts +2 -2
- package/lib/upgrade/installation.d.ts.map +1 -1
- package/lib/upgrade/installation.js +4 -7
- package/lib/upgrade/installation.js.map +1 -1
- package/lib/utils/package-dir.d.ts +15 -0
- package/lib/utils/package-dir.d.ts.map +1 -0
- package/lib/utils/package-dir.js +32 -0
- package/lib/utils/package-dir.js.map +1 -0
- package/package.json +8 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent-command.js","sourceRoot":"","sources":["../../src/commands/agent-command.ts"],"names":[],"mappings":";;;;;;;;;AACA,OAAO,EAAE,IAAI,IAAI,SAAS,
|
|
1
|
+
{"version":3,"file":"agent-command.js","sourceRoot":"","sources":["../../src/commands/agent-command.ts"],"names":[],"mappings":";;;;;;;;;AACA,OAAO,EAAE,IAAI,IAAI,SAAS,EAAoB,MAAM,iCAAiC,CAAC;AACtF,OAAO,EAAE,uBAAuB,EAAE,MAAM,0CAA0C,CAAC;AACnF,OAAO,EACH,2BAA2B,EAC3B,YAAY,GAEf,MAAM,wCAAwC,CAAC;AAChD,OAAO,EAAE,yBAAyB,EAAE,MAAM,2BAA2B,CAAC;AAatE,kFAAkF;AAClF,2EAA2E;AAC3E,MAAM,+BAA+B,GAA4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}"
|
|
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
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
/** Current installed version of the CLI. */
|
|
2
|
-
export declare const VERSION: string;
|
|
3
1
|
/** Directory of the running bkper package (the folder holding its package.json). */
|
|
4
2
|
export declare const PACKAGE_DIR: string;
|
|
3
|
+
/** Current installed version of the CLI. */
|
|
4
|
+
export declare const VERSION: string;
|
|
5
5
|
/** Supported installation methods. */
|
|
6
6
|
export type InstallMethod = 'npm' | 'pnpm' | 'yarn' | 'bun' | 'unknown';
|
|
7
7
|
/** Where the running CLI lives and how it was started. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"installation.d.ts","sourceRoot":"","sources":["../../src/upgrade/installation.ts"],"names":[],"mappings":"
|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,QAAQ,GAAE,eAAsC,GAAG,aAAa,CAkBnG;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAAC,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,CAAC,QAAQ,GAAG,MAAM,GAAG,SAAS,CAWhG;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAC7B,MAAM,EAAE,aAAa,EACrB,OAAO,EAAE,MAAM,EACf,SAAS,CAAC,EAAE,MAAM,GACnB,MAAM,GAAG,IAAI,CAgBf;AA+FD;;;;GAIG;AACH,wBAAgB,iBAAiB,CAC7B,OAAO,EAAE,MAAM,EACf,QAAQ,GAAE,eAAsC,EAChD,WAAW,GAAE,qBAAyD,GACvE,cAAc,CA6ChB;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,eAAe,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAOhF;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAGvD;AAED;;;GAGG;AACH,wBAAsB,kBAAkB,CAAC,SAAS,SAAO,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAiBjF"}
|
|
@@ -9,18 +9,15 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
};
|
|
10
10
|
import { execSync } from 'child_process';
|
|
11
11
|
import { accessSync, constants, existsSync, readFileSync, realpathSync } from 'fs';
|
|
12
|
-
import { createRequire } from 'module';
|
|
13
12
|
import os from 'os';
|
|
14
13
|
import path from 'path';
|
|
15
|
-
import {
|
|
16
|
-
|
|
17
|
-
const
|
|
14
|
+
import { BKPER_PACKAGE_DIR } from '../utils/package-dir.js';
|
|
15
|
+
/** Directory of the running bkper package (the folder holding its package.json). */
|
|
16
|
+
export const PACKAGE_DIR = BKPER_PACKAGE_DIR;
|
|
18
17
|
/** Current installed version of the CLI. */
|
|
19
|
-
export const VERSION =
|
|
18
|
+
export const VERSION = JSON.parse(readFileSync(path.join(PACKAGE_DIR, 'package.json'), 'utf8')).version;
|
|
20
19
|
/** Package name on npm. */
|
|
21
20
|
const PACKAGE_NAME = 'bkper';
|
|
22
|
-
/** Directory of the running bkper package (the folder holding its package.json). */
|
|
23
|
-
export const PACKAGE_DIR = fileURLToPath(new URL('../../', import.meta.url)).replace(/[\\/]$/, '');
|
|
24
21
|
export function getRuntimeLocation() {
|
|
25
22
|
return {
|
|
26
23
|
packageDir: PACKAGE_DIR,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"installation.js","sourceRoot":"","sources":["../../src/upgrade/installation.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,UAAU,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,IAAI,CAAC;AACnF,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"installation.js","sourceRoot":"","sources":["../../src/upgrade/installation.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,UAAU,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,IAAI,CAAC;AACnF,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAE5D,oFAAoF;AACpF,MAAM,CAAC,MAAM,WAAW,GAAW,iBAAiB,CAAC;AAErD,4CAA4C;AAC5C,MAAM,CAAC,MAAM,OAAO,GAAW,IAAI,CAAC,KAAK,CACrC,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,cAAc,CAAC,EAAE,MAAM,CAAC,CAC/D,CAAC,OAAO,CAAC;AAEV,2BAA2B;AAC3B,MAAM,YAAY,GAAG,OAAO,CAAC;AAwC7B,MAAM,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QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC;IACvE,CAAC;IAAC,WAAM,CAAC;QACL,OAAO,SAAS,CAAC;IACrB,CAAC;AACL,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,iBAAiB,CAAC,OAAe;IAC7C,MAAM,gBAAgB,GAAG,OAAO,CAAC,GAAG,CAAC,wBAAwB,IAAI,OAAO,CAAC;IACzE,QAAQ,CAAC,gBAAgB,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,IAAI,EAAE,CAAC,CAAC;AACtF,CAAC;AAED;;;GAGG;AACH,MAAM,UAAgB,kBAAkB;yDAAC,SAAS,GAAG,IAAI;;QACrD,MAAM,qBAAqB,GAAG,OAAO,CAAC,GAAG,CAAC,+BAA+B,CAAC;QAC1E,IAAI,qBAAqB,EAAE,CAAC;YACxB,OAAO,qBAAqB,CAAC;QACjC,CAAC;QAED,IAAI,CAAC;YACD,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,8BAA8B,YAAY,SAAS,EAAE;gBAC9E,OAAO,EAAE,EAAE,MAAM,EAAE,kBAAkB,EAAE;gBACvC,MAAM,EAAE,WAAW,CAAC,OAAO,CAAC,SAAS,CAAC;aACzC,CAAC,CAAC;YACH,IAAI,CAAC,QAAQ,CAAC,EAAE;gBAAE,OAAO,IAAI,CAAC;YAC9B,MAAM,IAAI,GAAG,CAAC,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAyB,CAAC;YAC7D,OAAO,MAAA,IAAI,CAAC,OAAO,mCAAI,IAAI,CAAC;QAChC,CAAC;QAAC,WAAM,CAAC;YACL,OAAO,IAAI,CAAC;QAChB,CAAC;IACL,CAAC;CAAA"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/** The nearest directory at or above `startDir` that holds a package.json. */
|
|
2
|
+
export declare function findPackageDir(startDir: string): string;
|
|
3
|
+
/**
|
|
4
|
+
* Root of the running bkper package. Found by walking up, so it holds from `src/` under ts-node,
|
|
5
|
+
* from `lib/` after tsc, and from the agent bundle in `lib/agent/bundle/`.
|
|
6
|
+
*/
|
|
7
|
+
export declare const BKPER_PACKAGE_DIR: string;
|
|
8
|
+
/** Root of the installed `@earendil-works/pi-coding-agent` package. */
|
|
9
|
+
export declare function getPiPackageDir(): string;
|
|
10
|
+
/**
|
|
11
|
+
* Bundled into the agent, Pi would look for its package.json, themes, and docs above the bundle and
|
|
12
|
+
* find bkper's instead. PI_PACKAGE_DIR points it back at its installed package; a user value wins.
|
|
13
|
+
*/
|
|
14
|
+
export declare function applyPiPackageDir(env?: NodeJS.ProcessEnv): void;
|
|
15
|
+
//# sourceMappingURL=package-dir.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"package-dir.d.ts","sourceRoot":"","sources":["../../src/utils/package-dir.ts"],"names":[],"mappings":"AAIA,8EAA8E;AAC9E,wBAAgB,cAAc,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CASvD;AAED;;;GAGG;AACH,eAAO,MAAM,iBAAiB,EAAE,MAE/B,CAAC;AAEF,uEAAuE;AACvE,wBAAgB,eAAe,IAAI,MAAM,CAIxC;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,GAAG,GAAE,MAAM,CAAC,UAAwB,GAAG,IAAI,CAE5E"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { existsSync } from 'node:fs';
|
|
2
|
+
import path from 'node:path';
|
|
3
|
+
import { fileURLToPath } from 'node:url';
|
|
4
|
+
/** The nearest directory at or above `startDir` that holds a package.json. */
|
|
5
|
+
export function findPackageDir(startDir) {
|
|
6
|
+
let dir = startDir;
|
|
7
|
+
while (dir !== path.dirname(dir)) {
|
|
8
|
+
if (existsSync(path.join(dir, 'package.json'))) {
|
|
9
|
+
return dir;
|
|
10
|
+
}
|
|
11
|
+
dir = path.dirname(dir);
|
|
12
|
+
}
|
|
13
|
+
return startDir;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Root of the running bkper package. Found by walking up, so it holds from `src/` under ts-node,
|
|
17
|
+
* from `lib/` after tsc, and from the agent bundle in `lib/agent/bundle/`.
|
|
18
|
+
*/
|
|
19
|
+
export const BKPER_PACKAGE_DIR = findPackageDir(path.dirname(fileURLToPath(import.meta.url)));
|
|
20
|
+
/** Root of the installed `@earendil-works/pi-coding-agent` package. */
|
|
21
|
+
export function getPiPackageDir() {
|
|
22
|
+
return findPackageDir(path.dirname(fileURLToPath(import.meta.resolve('@earendil-works/pi-coding-agent'))));
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Bundled into the agent, Pi would look for its package.json, themes, and docs above the bundle and
|
|
26
|
+
* find bkper's instead. PI_PACKAGE_DIR points it back at its installed package; a user value wins.
|
|
27
|
+
*/
|
|
28
|
+
export function applyPiPackageDir(env = process.env) {
|
|
29
|
+
var _a;
|
|
30
|
+
(_a = env.PI_PACKAGE_DIR) !== null && _a !== void 0 ? _a : (env.PI_PACKAGE_DIR = getPiPackageDir());
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=package-dir.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"package-dir.js","sourceRoot":"","sources":["../../src/utils/package-dir.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAC,MAAM,SAAS,CAAC;AACnC,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAC,aAAa,EAAC,MAAM,UAAU,CAAC;AAEvC,8EAA8E;AAC9E,MAAM,UAAU,cAAc,CAAC,QAAgB;IAC3C,IAAI,GAAG,GAAG,QAAQ,CAAC;IACnB,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,QAAQ,CAAC;AACpB,CAAC;AAED;;;GAGG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAW,cAAc,CACnD,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAC/C,CAAC;AAEF,uEAAuE;AACvE,MAAM,UAAU,eAAe;IAC3B,OAAO,cAAc,CACjB,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,iCAAiC,CAAC,CAAC,CAAC,CACtF,CAAC;AACN,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,iBAAiB,CAAC,MAAyB,OAAO,CAAC,GAAG;;IAClE,MAAA,GAAG,CAAC,cAAc,oCAAlB,GAAG,CAAC,cAAc,GAAK,eAAe,EAAE,EAAC;AAC7C,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "bkper",
|
|
3
|
-
"version": "5.5.
|
|
3
|
+
"version": "5.5.4",
|
|
4
4
|
"description": "Official Bkper CLI for accounting data, automation, apps, and AI agents",
|
|
5
5
|
"bin": {
|
|
6
6
|
"bkper": "lib/cli.js"
|
|
@@ -37,16 +37,17 @@
|
|
|
37
37
|
"clean": "rm -rf ./lib & rm -rf ./node_modules & wait",
|
|
38
38
|
"sync:docs": "bun ./scripts/sync-docs.ts",
|
|
39
39
|
"prebuild": "bun install && bun sync:docs",
|
|
40
|
-
"build": "run-s build:clean build:compile build:copy-docs build:copy-themes",
|
|
40
|
+
"build": "run-s build:clean build:compile build:copy-docs build:copy-themes build:bundle-agent",
|
|
41
41
|
"build:clean": "gts clean && rimraf temp",
|
|
42
|
-
"build:compile": "tsc",
|
|
42
|
+
"build:compile": "rimraf lib/agent/bundle && tsc",
|
|
43
|
+
"build:bundle-agent": "bun ./scripts/build-agent-bundle.ts",
|
|
43
44
|
"build:copy-docs": "mkdir -p lib && rm -rf lib/docs && cp -R skill/references lib/docs",
|
|
44
45
|
"build:copy-themes": "mkdir -p lib/agent && rm -rf lib/agent/themes && cp -R src/agent/themes lib/agent/themes",
|
|
45
46
|
"skill:package": "bun ./scripts/generate-skill-distribution.ts",
|
|
46
47
|
"api:platform": "openapi-typescript https://platform.bkper.app/openapi.json -o src/platform/types.d.ts",
|
|
47
48
|
"api:platform:local": "openapi-typescript http://localhost:8703/openapi.json -o src/platform/types.d.ts",
|
|
48
49
|
"predev": "bun run build",
|
|
49
|
-
"dev": "tsc -w",
|
|
50
|
+
"dev": "rimraf lib/agent/bundle && tsc -w",
|
|
50
51
|
"ports": "devpod ssh ../ -L 6274",
|
|
51
52
|
"test:typecheck": "tsc --noEmit -p tsconfig.test.json",
|
|
52
53
|
"test": "bun run test:typecheck && TS_NODE_TRANSPILE_ONLY=true TS_NODE_PROJECT=tsconfig.test.json mocha",
|
|
@@ -70,13 +71,16 @@
|
|
|
70
71
|
"@earendil-works/pi-mcp": "1.2.0",
|
|
71
72
|
"@earendil-works/pi-telemetry": "1.2.0",
|
|
72
73
|
"@earendil-works/pi-tui": "1.2.0",
|
|
74
|
+
"@silvia-odwyer/photon-node": "0.3.4",
|
|
73
75
|
"bkper-js": "^2.42.0",
|
|
74
76
|
"commander": "^13.1.0",
|
|
75
77
|
"dotenv": "^8.2.0",
|
|
76
78
|
"esbuild": "^0.28.1",
|
|
77
79
|
"google-auth-library": "^10.5.0",
|
|
80
|
+
"jiti": "2.7.0",
|
|
78
81
|
"mime": "^4.1.0",
|
|
79
82
|
"openapi-fetch": "^0.15.0",
|
|
83
|
+
"quickjs-wasi": "3.6.2",
|
|
80
84
|
"tar": "^7.5.22",
|
|
81
85
|
"yaml": "^2.8.3"
|
|
82
86
|
},
|