bkper 4.12.14 → 4.12.16
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/README.md +9 -769
- package/lib/agent/system-prompt.d.ts +1 -1
- package/lib/agent/system-prompt.d.ts.map +1 -1
- package/lib/agent/system-prompt.js +67 -36
- package/lib/agent/system-prompt.js.map +1 -1
- package/lib/docs/app-management.md +345 -0
- package/lib/docs/cli-reference.md +9 -769
- package/lib/docs/data-management.md +469 -0
- package/lib/docs/financial-statements.md +225 -0
- package/lib/docs/index.md +9 -0
- package/package.json +5 -2
- package/lib/release/versioning.d.ts +0 -5
- package/lib/release/versioning.d.ts.map +0 -1
- package/lib/release/versioning.js +0 -32
- package/lib/release/versioning.js.map +0 -1
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export declare function getBkperAgentSystemPrompt(): string;
|
|
2
|
-
export declare const BKPER_AGENT_SYSTEM_PROMPT
|
|
2
|
+
export declare const BKPER_AGENT_SYSTEM_PROMPT: string;
|
|
3
3
|
//# sourceMappingURL=system-prompt.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"system-prompt.d.ts","sourceRoot":"","sources":["../../src/agent/system-prompt.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"system-prompt.d.ts","sourceRoot":"","sources":["../../src/agent/system-prompt.ts"],"names":[],"mappings":"AA0FA,wBAAgB,yBAAyB,IAAI,MAAM,CA0ClD;AAED,eAAO,MAAM,yBAAyB,QAkBrC,CAAC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import { createBashToolDefinition, createEditToolDefinition, createReadToolDefinition, createWriteToolDefinition, } from '@mariozechner/pi-coding-agent';
|
|
1
2
|
import { existsSync } from 'node:fs';
|
|
2
|
-
import { fileURLToPath } from 'node:url';
|
|
3
3
|
import path from 'node:path';
|
|
4
|
+
import { fileURLToPath } from 'node:url';
|
|
4
5
|
function resolveDocPath(filename) {
|
|
5
6
|
const thisDir = path.dirname(fileURLToPath(import.meta.url));
|
|
6
7
|
return path.resolve(thisDir, '..', 'docs', filename);
|
|
@@ -16,11 +17,65 @@ function resolvePiPackageRoot() {
|
|
|
16
17
|
}
|
|
17
18
|
return path.dirname(piIndexPath);
|
|
18
19
|
}
|
|
20
|
+
function normalizePromptSnippet(text) {
|
|
21
|
+
if (!text) {
|
|
22
|
+
return undefined;
|
|
23
|
+
}
|
|
24
|
+
const oneLine = text.replace(/[\r\n]+/g, ' ').replace(/\s+/g, ' ').trim();
|
|
25
|
+
return oneLine.length > 0 ? oneLine : undefined;
|
|
26
|
+
}
|
|
27
|
+
function normalizePromptGuidelines(guidelines) {
|
|
28
|
+
if (!guidelines || guidelines.length === 0) {
|
|
29
|
+
return [];
|
|
30
|
+
}
|
|
31
|
+
const unique = new Set();
|
|
32
|
+
for (const guideline of guidelines) {
|
|
33
|
+
const normalized = guideline.trim();
|
|
34
|
+
if (normalized.length > 0) {
|
|
35
|
+
unique.add(normalized);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
return Array.from(unique);
|
|
39
|
+
}
|
|
40
|
+
function getCodingToolDefinitions() {
|
|
41
|
+
return [
|
|
42
|
+
createReadToolDefinition(process.cwd()),
|
|
43
|
+
createBashToolDefinition(process.cwd()),
|
|
44
|
+
createEditToolDefinition(process.cwd()),
|
|
45
|
+
createWriteToolDefinition(process.cwd()),
|
|
46
|
+
];
|
|
47
|
+
}
|
|
48
|
+
function buildToolPromptSection() {
|
|
49
|
+
const toolDefinitions = getCodingToolDefinitions();
|
|
50
|
+
const toolLines = toolDefinitions
|
|
51
|
+
.flatMap(definition => {
|
|
52
|
+
const snippet = normalizePromptSnippet(definition.promptSnippet);
|
|
53
|
+
return snippet ? [`- ${definition.name}: ${snippet}`] : [];
|
|
54
|
+
})
|
|
55
|
+
.join('\n');
|
|
56
|
+
const guidelineLines = [];
|
|
57
|
+
const seenGuidelines = new Set();
|
|
58
|
+
const addGuideline = (guideline) => {
|
|
59
|
+
const normalized = guideline.trim();
|
|
60
|
+
if (normalized.length === 0 || seenGuidelines.has(normalized)) {
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
seenGuidelines.add(normalized);
|
|
64
|
+
guidelineLines.push(`- ${normalized}`);
|
|
65
|
+
};
|
|
66
|
+
addGuideline('Use bash for discovery and search like ls, rg, and find. Use it to run bkper CLI commands when relevant.');
|
|
67
|
+
for (const definition of toolDefinitions) {
|
|
68
|
+
for (const guideline of normalizePromptGuidelines(definition.promptGuidelines)) {
|
|
69
|
+
addGuideline(guideline);
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
addGuideline('Do not claim builds, tests, or command results unless you actually ran them.');
|
|
73
|
+
const toolsList = toolLines.length > 0 ? toolLines : '(none)';
|
|
74
|
+
return `Available tools:\n${toolsList}\n\nIn addition to the tools above, you may have access to other custom tools depending on the project.\n\nGuidelines:\n${guidelineLines.join('\n')}`;
|
|
75
|
+
}
|
|
19
76
|
export function getBkperAgentSystemPrompt() {
|
|
20
|
-
const cliRefPath = resolveDocPath('cli-reference.md');
|
|
21
77
|
const coreConceptsPath = resolveDocPath('core-concepts.md');
|
|
22
|
-
const
|
|
23
|
-
const bkperApiTypesPath = resolveDocPath('bkper-api-types.md');
|
|
78
|
+
const indexPath = resolveDocPath('index.md');
|
|
24
79
|
const piRoot = resolvePiPackageRoot();
|
|
25
80
|
const piDocsPath = path.resolve(piRoot, 'docs');
|
|
26
81
|
const piExamplesPath = path.resolve(piRoot, 'examples');
|
|
@@ -28,28 +83,20 @@ export function getBkperAgentSystemPrompt() {
|
|
|
28
83
|
## Reference Routing
|
|
29
84
|
|
|
30
85
|
- Read local \`AGENTS.md\`, nearby files, and existing tests first for project-specific work.
|
|
31
|
-
-
|
|
86
|
+
- For any Bkper question or task — accounting concepts, CLI usage, SDK code, data management, or financial reports — start by reading both:
|
|
32
87
|
|
|
33
88
|
\`\`\`
|
|
34
89
|
${coreConceptsPath}
|
|
35
90
|
\`\`\`
|
|
36
91
|
|
|
37
|
-
- If the task involves using, generating, or executing \`bkper\` CLI commands, read full file:
|
|
38
|
-
|
|
39
92
|
\`\`\`
|
|
40
|
-
${
|
|
93
|
+
${indexPath}
|
|
41
94
|
\`\`\`
|
|
42
95
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
\`\`\`
|
|
46
|
-
${bkperJsPath}
|
|
47
|
-
\`\`\`
|
|
48
|
-
|
|
49
|
-
\`\`\`
|
|
50
|
-
${bkperApiTypesPath}
|
|
51
|
-
\`\`\`
|
|
96
|
+
Then load the additional specific doc(s) the index points to based on what is relevant to the task.
|
|
52
97
|
|
|
98
|
+
- For generic engineering work unrelated to Bkper, do not load Bkper reference docs unless directly relevant.
|
|
99
|
+
- When scope is unclear, inspect local files and project instructions first; load reference docs only after identifying a concrete need.
|
|
53
100
|
- If the task involves building or debugging pi extensions, custom tools, themes, or skills — read the pi docs directory and follow cross-references within:
|
|
54
101
|
|
|
55
102
|
\`\`\`
|
|
@@ -62,13 +109,11 @@ Check extension examples at:
|
|
|
62
109
|
${piExamplesPath}
|
|
63
110
|
\`\`\`
|
|
64
111
|
|
|
65
|
-
- For
|
|
66
|
-
- When scope is unclear, inspect local files and project instructions first; load reference docs only after identifying a concrete need.
|
|
67
|
-
- For any other question about Bkper — product features, accounting guides, app architecture, integrations, or general usage — fetch and read:
|
|
112
|
+
- For anything not covered by the local docs index, fetch and read:
|
|
68
113
|
|
|
69
114
|
https://bkper.com/llms.txt
|
|
70
115
|
|
|
71
|
-
|
|
116
|
+
And follow the most relevant link to find the answer.
|
|
72
117
|
`;
|
|
73
118
|
}
|
|
74
119
|
export const BKPER_AGENT_SYSTEM_PROMPT = `# Bkper Context
|
|
@@ -79,21 +124,7 @@ Protect the zero-sum invariant above all else.
|
|
|
79
124
|
|
|
80
125
|
You help users by reading files, executing commands, editing code, and writing new files.
|
|
81
126
|
|
|
82
|
-
|
|
83
|
-
- read: read file contents
|
|
84
|
-
- bash: run shell commands for search and discovery
|
|
85
|
-
- edit: make precise file edits
|
|
86
|
-
- write: create or replace files
|
|
87
|
-
|
|
88
|
-
IMPORTANT Guidelines:
|
|
89
|
-
- Use bash for discovery and search like ls, rg, and find. Use it to run bkper CLI commands when relevant.
|
|
90
|
-
- Use read to inspect file contents instead of cat or sed.
|
|
91
|
-
- Use edit for precise changes.
|
|
92
|
-
- When changing multiple separate locations in one file, use one edit call with multiple entries in edits[].
|
|
93
|
-
- Each edits[].oldText is matched against the original file, not after earlier edits are applied. Do not use overlapping or nested edits. Merge nearby changes into one edit.
|
|
94
|
-
- Keep edits[].oldText as small as possible while still being unique in the file.
|
|
95
|
-
- Use write only for new files or complete rewrites.
|
|
96
|
-
- Do not claim builds, tests, or command results unless you actually ran them.
|
|
127
|
+
${buildToolPromptSection()}
|
|
97
128
|
|
|
98
129
|
## Operating Principles
|
|
99
130
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"system-prompt.js","sourceRoot":"","sources":["../../src/agent/system-prompt.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"system-prompt.js","sourceRoot":"","sources":["../../src/agent/system-prompt.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,wBAAwB,EACxB,wBAAwB,EACxB,wBAAwB,EACxB,yBAAyB,GAC5B,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC,SAAS,cAAc,CAAC,QAAgB;IACpC,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;IAC7D,OAAO,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC;AACzD,CAAC;AAED,SAAS,oBAAoB;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U,IAAI,eAAe,EAAE,CAAC;QACvC,KAAK,MAAM,SAAS,IAAI,yBAAyB,CAAC,UAAU,CAAC,gBAAgB,CAAC,EAAE,CAAC;YAC7E,YAAY,CAAC,SAAS,CAAC,CAAC;QAC5B,CAAC;IACL,CAAC;IACD,YAAY,CAAC,8EAA8E,CAAC,CAAC;IAE7F,MAAM,SAAS,GAAG,SAAS,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,QAAQ,CAAC;IAC9D,OAAO,qBAAqB,SAAS,2HAA2H,cAAc,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;AAChM,CAAC;AAED,MAAM,UAAU,yBAAyB;IACrC,MAAM,gBAAgB,GAAG,cAAc,CAAC,kBAAkB,CAAC,CAAC;IAC5D,MAAM,SAAS,GAAG,cAAc,CAAC,UAAU,CAAC,CAAC;IAC7C,MAAM,MAAM,GAAG,oBAAoB,EAAE,CAAC;IACtC,MAAM,UAAU,GAAG,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAChD,MAAM,cAAc,GAAG,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;IACxD,OAAO,GAAG,yBAAyB;;;;;;;EAOrC,gBAAgB;;;;EAIhB,SAAS;;;;;;;;;;EAUT,UAAU;;;;;;EAMV,cAAc;;;;;;;;CAQf,CAAC;AACF,CAAC;AAED,MAAM,CAAC,MAAM,yBAAyB,GAAG;;;;;;;;EAQvC,sBAAsB,EAAE;;;;;;;;;;CAUzB,CAAC"}
|
|
@@ -0,0 +1,345 @@
|
|
|
1
|
+
[bkper.yaml reference]: #bkperyaml-reference
|
|
2
|
+
[App Template]: https://github.com/bkper/bkper-app-template
|
|
3
|
+
|
|
4
|
+
# App Management
|
|
5
|
+
|
|
6
|
+
Build, deploy, and manage Bkper apps using the `bkper` CLI.
|
|
7
|
+
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
## Development Workflow
|
|
11
|
+
|
|
12
|
+
```bash
|
|
13
|
+
# Scaffold a new app from the template
|
|
14
|
+
bkper app init my-app
|
|
15
|
+
|
|
16
|
+
# Start the worker runtime (Miniflare + tunnel + file watching)
|
|
17
|
+
# In your project, use "npm run dev" to run both Vite and workers concurrently
|
|
18
|
+
bkper app dev
|
|
19
|
+
|
|
20
|
+
# Build worker bundles (web server + events handler)
|
|
21
|
+
# In your project, use "npm run build" to build both client (Vite) and workers
|
|
22
|
+
bkper app build
|
|
23
|
+
|
|
24
|
+
# Sync configuration and deploy to production
|
|
25
|
+
bkper app sync && bkper app deploy
|
|
26
|
+
|
|
27
|
+
# Deploy to development environment
|
|
28
|
+
bkper app deploy --preview
|
|
29
|
+
|
|
30
|
+
# Deploy only the events handler
|
|
31
|
+
bkper app deploy --events
|
|
32
|
+
|
|
33
|
+
# Check deployment status
|
|
34
|
+
bkper app status
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
> **Note:** `bkper app dev` runs the worker runtime only — Miniflare, file watching, and the Cloudflare tunnel. 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`.
|
|
38
|
+
|
|
39
|
+
---
|
|
40
|
+
|
|
41
|
+
## Install Apps on Books
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
# Install an app on a book
|
|
45
|
+
bkper app install my-app -b abc123
|
|
46
|
+
|
|
47
|
+
# Uninstall an app from a book
|
|
48
|
+
bkper app uninstall my-app -b abc123
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
---
|
|
52
|
+
|
|
53
|
+
## Secrets
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
# Store a secret (prompts for value)
|
|
57
|
+
bkper app secrets put API_KEY
|
|
58
|
+
|
|
59
|
+
# List all secrets
|
|
60
|
+
bkper app secrets list
|
|
61
|
+
|
|
62
|
+
# Delete a secret
|
|
63
|
+
bkper app secrets delete API_KEY
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
---
|
|
67
|
+
|
|
68
|
+
## Configuration
|
|
69
|
+
|
|
70
|
+
Apps are configured via a `bkper.yaml` file in the project root. See the complete **[bkper.yaml reference]** below.
|
|
71
|
+
|
|
72
|
+
<details>
|
|
73
|
+
<summary>bkper.yaml reference</summary>
|
|
74
|
+
|
|
75
|
+
```yaml
|
|
76
|
+
# =============================================================================
|
|
77
|
+
# bkper.yaml Reference
|
|
78
|
+
# =============================================================================
|
|
79
|
+
# This file documents all available configuration options for Bkper Apps.
|
|
80
|
+
# Copy the fields you need to your app's bkper.yaml file.
|
|
81
|
+
#
|
|
82
|
+
# For a minimal working template, see:
|
|
83
|
+
# https://github.com/bkper/bkper-app-template
|
|
84
|
+
# =============================================================================
|
|
85
|
+
|
|
86
|
+
# -----------------------------------------------------------------------------
|
|
87
|
+
# APP IDENTITY
|
|
88
|
+
# -----------------------------------------------------------------------------
|
|
89
|
+
# The app id is permanent and cannot be changed after creation.
|
|
90
|
+
# Use lowercase letters, numbers, and hyphens only.
|
|
91
|
+
id: my-app
|
|
92
|
+
|
|
93
|
+
# Display name shown in the Bkper UI
|
|
94
|
+
name: My App
|
|
95
|
+
|
|
96
|
+
# Brief description of what the app does
|
|
97
|
+
description: A Bkper app that does something useful
|
|
98
|
+
|
|
99
|
+
# -----------------------------------------------------------------------------
|
|
100
|
+
# BRANDING
|
|
101
|
+
# -----------------------------------------------------------------------------
|
|
102
|
+
# App logo for light mode (SVG recommended, PNG/JPG supported)
|
|
103
|
+
logoUrl: https://example.com/logo.svg
|
|
104
|
+
|
|
105
|
+
# App logo for dark mode (required for proper theming)
|
|
106
|
+
logoUrlDark: https://example.com/logo-dark.svg
|
|
107
|
+
|
|
108
|
+
# App website or documentation URL
|
|
109
|
+
website: https://example.com
|
|
110
|
+
|
|
111
|
+
# -----------------------------------------------------------------------------
|
|
112
|
+
# OWNERSHIP
|
|
113
|
+
# -----------------------------------------------------------------------------
|
|
114
|
+
# Developer/company name
|
|
115
|
+
ownerName: Your Name
|
|
116
|
+
|
|
117
|
+
# Owner's logo/avatar URL
|
|
118
|
+
ownerLogoUrl: https://example.com/owner-logo.png
|
|
119
|
+
|
|
120
|
+
# Owner's website
|
|
121
|
+
ownerWebsite: https://yoursite.com
|
|
122
|
+
|
|
123
|
+
# Source code repository URL
|
|
124
|
+
repoUrl: https://github.com/you/my-app
|
|
125
|
+
|
|
126
|
+
# Whether the repository is private
|
|
127
|
+
repoPrivate: true
|
|
128
|
+
|
|
129
|
+
# Mark as deprecated (hides from app listings, existing installs continue working)
|
|
130
|
+
deprecated: false
|
|
131
|
+
|
|
132
|
+
# -----------------------------------------------------------------------------
|
|
133
|
+
# ACCESS CONTROL
|
|
134
|
+
# -----------------------------------------------------------------------------
|
|
135
|
+
# Who can update the app configuration and deploy new versions.
|
|
136
|
+
# Comma-separated list of Bkper usernames (not emails).
|
|
137
|
+
# Supports domain wildcards for registered custom domains: *@yourdomain.com
|
|
138
|
+
developers: victor, aldo, *@bkper.com
|
|
139
|
+
|
|
140
|
+
# Who can install and use the app.
|
|
141
|
+
# Same format as developers. Leave empty for public apps.
|
|
142
|
+
users: maria, *@acme.com
|
|
143
|
+
|
|
144
|
+
# -----------------------------------------------------------------------------
|
|
145
|
+
# MENU INTEGRATION (optional)
|
|
146
|
+
# -----------------------------------------------------------------------------
|
|
147
|
+
# When configured, adds a menu item to Bkper's "More" menu.
|
|
148
|
+
# Clicking opens a popup with the specified URL.
|
|
149
|
+
|
|
150
|
+
# Production menu URL (supports variable substitution)
|
|
151
|
+
menuUrl: https://${id}.bkper.app?bookId=${book.id}
|
|
152
|
+
|
|
153
|
+
# Development menu URL (used when developer runs the app)
|
|
154
|
+
menuUrlDev: http://localhost:8787?bookId=${book.id}
|
|
155
|
+
|
|
156
|
+
# Custom menu text (defaults to app name if not specified)
|
|
157
|
+
menuText: Open My App
|
|
158
|
+
|
|
159
|
+
# Popup dimensions in pixels
|
|
160
|
+
menuPopupWidth: 500
|
|
161
|
+
menuPopupHeight: 300
|
|
162
|
+
|
|
163
|
+
# -----------------------------------------------------------------------------
|
|
164
|
+
# Menu URL Variables
|
|
165
|
+
# -----------------------------------------------------------------------------
|
|
166
|
+
# The following variables can be used in menuUrl and menuUrlDev:
|
|
167
|
+
#
|
|
168
|
+
# ${book.id} - Current book ID
|
|
169
|
+
# ${book.properties.xxx} - Book property value (replace xxx with property key)
|
|
170
|
+
# ${account.id} - Selected account ID (in account context)
|
|
171
|
+
# ${account.properties.xxx} - Account property value
|
|
172
|
+
# ${group.id} - Selected group ID (in group context)
|
|
173
|
+
# ${group.properties.xxx} - Group property value
|
|
174
|
+
# ${transactions.ids} - Comma-separated selected transaction IDs
|
|
175
|
+
# ${transactions.query} - Current search query
|
|
176
|
+
# -----------------------------------------------------------------------------
|
|
177
|
+
|
|
178
|
+
# -----------------------------------------------------------------------------
|
|
179
|
+
# EVENT HANDLING (optional)
|
|
180
|
+
# -----------------------------------------------------------------------------
|
|
181
|
+
# When configured, Bkper calls your webhook URL when subscribed events occur.
|
|
182
|
+
|
|
183
|
+
# Production webhook URL
|
|
184
|
+
webhookUrl: https://${id}.bkper.app/events
|
|
185
|
+
|
|
186
|
+
# Development webhook URL (auto-updated by bkper app dev)
|
|
187
|
+
webhookUrlDev: https://<random>.trycloudflare.com/events
|
|
188
|
+
|
|
189
|
+
# API version for event payloads
|
|
190
|
+
apiVersion: v5
|
|
191
|
+
|
|
192
|
+
# Events to subscribe to (remove events you don't need)
|
|
193
|
+
events:
|
|
194
|
+
# Transaction
|
|
195
|
+
- TRANSACTION_CREATED
|
|
196
|
+
- TRANSACTION_POSTED
|
|
197
|
+
- TRANSACTION_CHECKED
|
|
198
|
+
- TRANSACTION_UNCHECKED
|
|
199
|
+
- TRANSACTION_UPDATED
|
|
200
|
+
- TRANSACTION_DELETED
|
|
201
|
+
- TRANSACTION_RESTORED
|
|
202
|
+
# Account
|
|
203
|
+
- ACCOUNT_CREATED
|
|
204
|
+
- ACCOUNT_UPDATED
|
|
205
|
+
- ACCOUNT_DELETED
|
|
206
|
+
# Group
|
|
207
|
+
- GROUP_CREATED
|
|
208
|
+
- GROUP_UPDATED
|
|
209
|
+
- GROUP_DELETED
|
|
210
|
+
# File
|
|
211
|
+
- FILE_CREATED
|
|
212
|
+
- FILE_UPDATED
|
|
213
|
+
# Query
|
|
214
|
+
- QUERY_CREATED
|
|
215
|
+
- QUERY_UPDATED
|
|
216
|
+
- QUERY_DELETED
|
|
217
|
+
# Comment
|
|
218
|
+
- COMMENT_CREATED
|
|
219
|
+
- COMMENT_DELETED
|
|
220
|
+
# Collaborator
|
|
221
|
+
- COLLABORATOR_ADDED
|
|
222
|
+
- COLLABORATOR_UPDATED
|
|
223
|
+
- COLLABORATOR_REMOVED
|
|
224
|
+
# Integration
|
|
225
|
+
- INTEGRATION_CREATED
|
|
226
|
+
- INTEGRATION_UPDATED
|
|
227
|
+
- INTEGRATION_DELETED
|
|
228
|
+
# Book
|
|
229
|
+
- BOOK_CREATED
|
|
230
|
+
- BOOK_UPDATED
|
|
231
|
+
- BOOK_DELETED
|
|
232
|
+
- BOOK_AUDITED
|
|
233
|
+
|
|
234
|
+
# -----------------------------------------------------------------------------
|
|
235
|
+
# FILE PATTERNS (optional)
|
|
236
|
+
# -----------------------------------------------------------------------------
|
|
237
|
+
# For file processing apps. When a file matching these patterns is uploaded,
|
|
238
|
+
# a FILE_CREATED event is triggered with the file content.
|
|
239
|
+
filePatterns:
|
|
240
|
+
- '*.ofx'
|
|
241
|
+
- '*.csv'
|
|
242
|
+
|
|
243
|
+
# -----------------------------------------------------------------------------
|
|
244
|
+
# PROPERTIES SCHEMA (optional)
|
|
245
|
+
# -----------------------------------------------------------------------------
|
|
246
|
+
# Defines autocomplete suggestions for custom properties in the Bkper UI.
|
|
247
|
+
# Helps users discover and use the correct property keys/values for your app.
|
|
248
|
+
propertiesSchema:
|
|
249
|
+
book:
|
|
250
|
+
keys:
|
|
251
|
+
- my_app_enabled
|
|
252
|
+
- my_app_config
|
|
253
|
+
values:
|
|
254
|
+
- 'true'
|
|
255
|
+
- 'false'
|
|
256
|
+
group:
|
|
257
|
+
keys:
|
|
258
|
+
- my_app_category
|
|
259
|
+
values:
|
|
260
|
+
- category_a
|
|
261
|
+
- category_b
|
|
262
|
+
account:
|
|
263
|
+
keys:
|
|
264
|
+
- my_app_sync_id
|
|
265
|
+
transaction:
|
|
266
|
+
keys:
|
|
267
|
+
- my_app_reference
|
|
268
|
+
|
|
269
|
+
# -----------------------------------------------------------------------------
|
|
270
|
+
# DEPLOYMENT CONFIGURATION (optional)
|
|
271
|
+
# -----------------------------------------------------------------------------
|
|
272
|
+
# For apps deployed to Bkper's Workers for Platforms infrastructure.
|
|
273
|
+
deployment:
|
|
274
|
+
# Web handler (serves UI and API)
|
|
275
|
+
web:
|
|
276
|
+
bundle: packages/web/server/dist
|
|
277
|
+
# assets: packages/web/client/dist # Static assets (when supported)
|
|
278
|
+
|
|
279
|
+
# Events handler (processes webhooks)
|
|
280
|
+
events:
|
|
281
|
+
bundle: packages/events/dist
|
|
282
|
+
|
|
283
|
+
# Platform services available to your app (one per type, auto-provisioned)
|
|
284
|
+
# See: https://developers.cloudflare.com/kv/
|
|
285
|
+
services:
|
|
286
|
+
- KV # Key-value storage
|
|
287
|
+
```
|
|
288
|
+
|
|
289
|
+
</details>
|
|
290
|
+
|
|
291
|
+
**Environment variables:**
|
|
292
|
+
|
|
293
|
+
- `BKPER_API_KEY` -- Optional. If not set, uses the Bkper API proxy with a managed API key. Set it for direct API access with your own quotas. Follow [these steps](https://bkper.com/docs/#rest-api-enabling) to enable.
|
|
294
|
+
|
|
295
|
+
---
|
|
296
|
+
|
|
297
|
+
## Command Reference
|
|
298
|
+
|
|
299
|
+
### Authentication
|
|
300
|
+
|
|
301
|
+
- `auth login` - Authenticate with Bkper, storing credentials locally
|
|
302
|
+
- `auth logout` - Revoke the stored refresh token and clear local credentials
|
|
303
|
+
- `auth token` - Print the current OAuth access token to stdout (requires prior login)
|
|
304
|
+
|
|
305
|
+
### Agent
|
|
306
|
+
|
|
307
|
+
- `agent` - Start the interactive Bkper Agent
|
|
308
|
+
- `agent <pi-args...>` - Run Pi CLI with Bkper defaults (system prompt/resources)
|
|
309
|
+
|
|
310
|
+
### App Lifecycle
|
|
311
|
+
|
|
312
|
+
- `app init <name>` - Scaffold a new app from the template
|
|
313
|
+
- `app list` - List all apps you have access to
|
|
314
|
+
- `app sync` - Sync [bkper.yaml][bkper.yaml reference] configuration (URLs, description) to Bkper API
|
|
315
|
+
- `app build` - Build worker bundles for deployment
|
|
316
|
+
- `app deploy` - Deploy built artifacts to Cloudflare Workers for Platforms
|
|
317
|
+
- `-p, --preview` - Deploy to preview environment
|
|
318
|
+
- `--events` - Deploy events handler instead of web handler
|
|
319
|
+
- `app status` - Show deployment status
|
|
320
|
+
- `app undeploy` - Remove app from platform
|
|
321
|
+
- `-p, --preview` - Remove from preview environment
|
|
322
|
+
- `--events` - Remove events handler instead of web handler
|
|
323
|
+
- `--delete-data` - Permanently delete all associated data (requires confirmation)
|
|
324
|
+
- `--force` - Skip confirmation prompts (use with `--delete-data` for automation)
|
|
325
|
+
- `app dev` - Start the worker runtime for local development
|
|
326
|
+
- `--sp, --server-port <port>` - Server simulation port (default: `8787`)
|
|
327
|
+
- `--ep, --events-port <port>` - Events handler port (default: `8791`)
|
|
328
|
+
- `-w, --web` - Run only the web handler
|
|
329
|
+
- `-e, --events` - Run only the events handler
|
|
330
|
+
|
|
331
|
+
> **Note:** `sync` and `deploy` are independent operations. Use `sync` to update your app's URLs in Bkper (required for webhooks and menu integration). Use `deploy` to push code to Cloudflare. For a typical deployment workflow, run both: `bkper app sync && bkper app deploy`
|
|
332
|
+
|
|
333
|
+
### App Installation
|
|
334
|
+
|
|
335
|
+
- `app install <appId> -b <bookId>` - Install an app on a book
|
|
336
|
+
- `app uninstall <appId> -b <bookId>` - Uninstall an app from a book
|
|
337
|
+
|
|
338
|
+
### Secrets Management
|
|
339
|
+
|
|
340
|
+
- `app secrets put <name>` - Store a secret
|
|
341
|
+
- `-p, --preview` - Set in preview environment
|
|
342
|
+
- `app secrets list` - List all secrets
|
|
343
|
+
- `-p, --preview` - List from preview environment
|
|
344
|
+
- `app secrets delete <name>` - Delete a secret
|
|
345
|
+
- `-p, --preview` - Delete from preview environment
|