bkper 4.12.14 → 4.12.15
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.
|
@@ -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,CA4DlD;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,6 +17,62 @@ 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
77
|
const cliRefPath = resolveDocPath('cli-reference.md');
|
|
21
78
|
const coreConceptsPath = resolveDocPath('core-concepts.md');
|
|
@@ -64,11 +121,17 @@ ${piExamplesPath}
|
|
|
64
121
|
|
|
65
122
|
- For generic engineering work, do not load Bkper reference docs unless directly relevant.
|
|
66
123
|
- 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 —
|
|
124
|
+
- For any other question about Bkper — product features, accounting guides, app architecture, integrations, or general usage — first read the core concepts file for foundational vocabulary and invariants:
|
|
125
|
+
|
|
126
|
+
\`\`\`
|
|
127
|
+
${coreConceptsPath}
|
|
128
|
+
\`\`\`
|
|
129
|
+
|
|
130
|
+
Then fetch and read:
|
|
68
131
|
|
|
69
132
|
https://bkper.com/llms.txt
|
|
70
133
|
|
|
71
|
-
|
|
134
|
+
And follow the most relevant link to find the answer.
|
|
72
135
|
`;
|
|
73
136
|
}
|
|
74
137
|
export const BKPER_AGENT_SYSTEM_PROMPT = `# Bkper Context
|
|
@@ -79,21 +142,7 @@ Protect the zero-sum invariant above all else.
|
|
|
79
142
|
|
|
80
143
|
You help users by reading files, executing commands, editing code, and writing new files.
|
|
81
144
|
|
|
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.
|
|
145
|
+
${buildToolPromptSection()}
|
|
97
146
|
|
|
98
147
|
## Operating Principles
|
|
99
148
|
|
|
@@ -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;IACzB,MAAM,WAAW,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,+BAA+B,CAAC,CAAC,CAAC;IACxF,IAAI,GAAG,GAAG,IA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"./lib/cli.js"
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
"upgrade:api": "bun update @bkper/bkper-api-types --latest && bun update bkper-js --latest"
|
|
48
48
|
},
|
|
49
49
|
"dependencies": {
|
|
50
|
-
"@mariozechner/pi-coding-agent": "
|
|
50
|
+
"@mariozechner/pi-coding-agent": "0.67.2",
|
|
51
51
|
"bkper-js": "^2.32.2",
|
|
52
52
|
"commander": "^13.1.0",
|
|
53
53
|
"dotenv": "^8.2.0",
|