bkper 4.12.3 → 4.12.5

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 CHANGED
@@ -115,7 +115,7 @@ bkper agent install <pi-package-source>
115
115
  bkper agent --help
116
116
  ```
117
117
 
118
- `bkper agent` keeps Bkper defaults (appending Bkper domain context to Pi's default prompt) unless you explicitly pass `--system-prompt`.
118
+ `bkper agent` keeps Bkper defaults (including the Bkper system prompt) unless you explicitly pass `--system-prompt`.
119
119
  Use `bkper help agent` for the Bkper CLI command help, and `bkper agent --help` for Pi help.
120
120
 
121
121
  For all available passthrough flags and commands, see the Pi CLI reference:
@@ -871,7 +871,7 @@ deployment:
871
871
  #### Agent
872
872
 
873
873
  - `agent` - Start the interactive Bkper Agent
874
- - `agent <pi-args...>` - Run Pi CLI with Bkper defaults (domain context/resources)
874
+ - `agent <pi-args...>` - Run Pi CLI with Bkper defaults (system prompt/resources)
875
875
 
876
876
  #### App Lifecycle
877
877
 
@@ -1,7 +1,6 @@
1
+ import { InteractiveMode } from '@mariozechner/pi-coding-agent';
1
2
  import { runStartupMaintenance } from './startup-maintenance.js';
2
- type ReloadableResourceLoader = {
3
- reload(): Promise<void>;
4
- };
3
+ export type InteractiveRuntimeHost = ConstructorParameters<typeof InteractiveMode>[0];
5
4
  type NotificationType = 'info' | 'warning' | 'error';
6
5
  type SessionStartContext = {
7
6
  ui: {
@@ -13,18 +12,14 @@ type StartupExtensionAPI = {
13
12
  on: (event: 'session_start', handler: SessionStartHandler) => void;
14
13
  };
15
14
  export interface AgentModeDependencies {
16
- createResourceLoader: () => ReloadableResourceLoader;
17
- createSession: (options: {
18
- resourceLoader: ReloadableResourceLoader;
19
- }) => Promise<{
20
- session: unknown;
15
+ createRuntime: () => Promise<{
16
+ runtime: InteractiveRuntimeHost;
21
17
  modelFallbackMessage?: string;
22
18
  }>;
23
- createInteractiveMode: (session: unknown, modelFallbackMessage?: string) => {
19
+ createInteractiveMode: (runtime: InteractiveRuntimeHost, modelFallbackMessage?: string) => {
24
20
  run(): Promise<void>;
25
21
  };
26
22
  }
27
- export declare function appendBkperAgentPrompt(base: string[]): string[];
28
23
  export declare function registerBkperAgentStartupExtension(pi: StartupExtensionAPI, startupMaintenance?: typeof runStartupMaintenance): void;
29
24
  export declare function runAgentMode(dependencies?: AgentModeDependencies): Promise<void>;
30
25
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"run-agent-mode.d.ts","sourceRoot":"","sources":["../../src/agent/run-agent-mode.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AAGjE,KAAK,wBAAwB,GAAG;IAC5B,MAAM,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CAC3B,CAAC;AAEF,KAAK,gBAAgB,GAAG,MAAM,GAAG,SAAS,GAAG,OAAO,CAAC;AAErD,KAAK,mBAAmB,GAAG;IACvB,EAAE,EAAE;QACA,MAAM,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,gBAAgB,KAAK,IAAI,CAAC;KAC9D,CAAC;CACL,CAAC;AAEF,KAAK,mBAAmB,GAAG,CAAC,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,mBAAmB,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;AAE3F,KAAK,mBAAmB,GAAG;IACvB,EAAE,EAAE,CAAC,KAAK,EAAE,eAAe,EAAE,OAAO,EAAE,mBAAmB,KAAK,IAAI,CAAC;CACtE,CAAC;AAEF,MAAM,WAAW,qBAAqB;IAClC,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;IACrD,aAAa,EAAE,CAAC,OAAO,EAAE;QACrB,cAAc,EAAE,wBAAwB,CAAC;KAC5C,KAAK,OAAO,CAAC;QACV,OAAO,EAAE,OAAO,CAAC;QACjB,oBAAoB,CAAC,EAAE,MAAM,CAAC;KACjC,CAAC,CAAC;IACH,qBAAqB,EAAE,CACnB,OAAO,EAAE,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C,EAAE,MAAM,CAAC;KACjC,CAAC,CAAC;IACH,qBAAqB,EAAE,CACnB,OAAO,EAAE,sBAAsB,EAC/B,oBAAoB,CAAC,EAAE,MAAM,KAC5B;QACD,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;KACxB,CAAC;CACL;AAED,wBAAgB,kCAAkC,CAC9C,EAAE,EAAE,mBAAmB,EACvB,kBAAkB,GAAE,OAAO,qBAA6C,GACzE,IAAI,CAeN;AAqDD,wBAAsB,YAAY,CAC9B,YAAY,GAAE,qBAAmD,GAClE,OAAO,CAAC,IAAI,CAAC,CAOf"}
@@ -7,12 +7,9 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
7
7
  step((generator = generator.apply(thisArg, _arguments || [])).next());
8
8
  });
9
9
  };
10
- import { createAgentSession, DefaultResourceLoader, InteractiveMode, } from '@mariozechner/pi-coding-agent';
10
+ import { createAgentSessionFromServices, createAgentSessionRuntime, createAgentSessionServices, getAgentDir, InteractiveMode, SessionManager, } from '@mariozechner/pi-coding-agent';
11
11
  import { runStartupMaintenance } from './startup-maintenance.js';
12
- import { getBkperAgentAppendPrompt } from './system-prompt.js';
13
- export function appendBkperAgentPrompt(base) {
14
- return [...base, getBkperAgentAppendPrompt()];
15
- }
12
+ import { getBkperAgentSystemPrompt } from './system-prompt.js';
16
13
  export function registerBkperAgentStartupExtension(pi, startupMaintenance = runStartupMaintenance) {
17
14
  let startupMaintenanceTriggered = false;
18
15
  pi.on('session_start', (_event, ctx) => __awaiter(this, void 0, void 0, function* () {
@@ -28,20 +25,37 @@ export function registerBkperAgentStartupExtension(pi, startupMaintenance = runS
28
25
  }
29
26
  function createDefaultDependencies() {
30
27
  return {
31
- createResourceLoader: () => new DefaultResourceLoader({
32
- appendSystemPromptOverride: appendBkperAgentPrompt,
33
- extensionFactories: [
34
- (pi) => {
35
- registerBkperAgentStartupExtension(pi);
36
- },
37
- ],
38
- }),
39
- createSession: (_a) => __awaiter(this, [_a], void 0, function* ({ resourceLoader }) {
40
- return createAgentSession({
41
- resourceLoader: resourceLoader,
28
+ createRuntime: () => __awaiter(this, void 0, void 0, function* () {
29
+ const createRuntime = (_a) => __awaiter(this, [_a], void 0, function* ({ cwd, agentDir, sessionManager, sessionStartEvent, }) {
30
+ const services = yield createAgentSessionServices({
31
+ cwd,
32
+ agentDir,
33
+ resourceLoaderOptions: {
34
+ systemPromptOverride: () => getBkperAgentSystemPrompt(),
35
+ extensionFactories: [
36
+ (pi) => {
37
+ registerBkperAgentStartupExtension(pi);
38
+ },
39
+ ],
40
+ },
41
+ });
42
+ return Object.assign(Object.assign({}, (yield createAgentSessionFromServices({
43
+ services,
44
+ sessionManager,
45
+ sessionStartEvent,
46
+ }))), { services, diagnostics: services.diagnostics });
47
+ });
48
+ const runtime = yield createAgentSessionRuntime(createRuntime, {
49
+ cwd: process.cwd(),
50
+ agentDir: getAgentDir(),
51
+ sessionManager: SessionManager.create(process.cwd()),
42
52
  });
53
+ return {
54
+ runtime,
55
+ modelFallbackMessage: runtime.modelFallbackMessage,
56
+ };
43
57
  }),
44
- createInteractiveMode: (session, modelFallbackMessage) => new InteractiveMode(session, {
58
+ createInteractiveMode: (runtime, modelFallbackMessage) => new InteractiveMode(runtime, {
45
59
  modelFallbackMessage,
46
60
  }),
47
61
  };
@@ -51,10 +65,8 @@ export function runAgentMode() {
51
65
  var _a;
52
66
  var _b;
53
67
  (_a = (_b = process.env).PI_SKIP_VERSION_CHECK) !== null && _a !== void 0 ? _a : (_b.PI_SKIP_VERSION_CHECK = '1');
54
- const resourceLoader = dependencies.createResourceLoader();
55
- yield resourceLoader.reload();
56
- const { session, modelFallbackMessage } = yield dependencies.createSession({ resourceLoader });
57
- const mode = dependencies.createInteractiveMode(session, modelFallbackMessage);
68
+ const { runtime, modelFallbackMessage } = yield dependencies.createRuntime();
69
+ const mode = dependencies.createInteractiveMode(runtime, modelFallbackMessage);
58
70
  yield mode.run();
59
71
  });
60
72
  }
@@ -1 +1 @@
1
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AAO;gBACP,oBAAoB,EAAE,OAAO,CAAC,oBAAoB;aACrD,CAAC;QACN,CAAC,CAAA;QACD,qBAAqB,EAAE,CAAC,OAAO,EAAE,oBAAoB,EAAE,EAAE,CACrD,IAAI,eAAe,CAAC,OAAO,EAAE;YACzB,oBAAoB;SACvB,CAAC;KACT,CAAC;AACN,CAAC;AAED,MAAM,UAAgB,YAAY;yDAC9B,eAAsC,yBAAyB,EAAE;;;QAEjE,YAAA,OAAO,CAAC,GAAG,EAAC,qBAAqB,uCAArB,qBAAqB,GAAK,GAAG,EAAC;QAE1C,MAAM,EAAE,OAAO,EAAE,oBAAoB,EAAE,GAAG,MAAM,YAAY,CAAC,aAAa,EAAE,CAAC;QAC7E,MAAM,IAAI,GAAG,YAAY,CAAC,qBAAqB,CAAC,OAAO,EAAE,oBAAoB,CAAC,CAAC;QAE/E,MAAM,IAAI,CAAC,GAAG,EAAE,CAAC;IACrB,CAAC;CAAA"}
@@ -1,3 +1,3 @@
1
- export declare function getBkperAgentAppendPrompt(): string;
2
- export declare const BKPER_AGENT_APPEND_PROMPT = "# Bkper Context\n\nYou are a Bkper team member.\n\nFor normal Bkper work, prioritize Bkper domain context, local project instructions, and surrounding files over Pi customization topics. Pi documentation is relevant only when the task is specifically about Pi itself or its runtime or customization.\n\n## Operating Principles\n\n- Protect the zero-sum invariant above all else.\n- Preserve invariants and data integrity first, then user intent, then implementation convenience.\n- Think in resources, movements, and balances \u2014 not debits and credits.\n- Extend meaning with properties before adding structural complexity.\n- Model domain and flows before coding; represent business reality, not technical shortcuts.\n- Prefer simplicity over cleverness; choose small, boring, maintainable solutions.\n- Question the premise before adding complexity; prefer simplifying or removing over layering new structure.\n- Design for global readiness from day one: currencies, timezones, units, and formats.\n- Treat performance and security as foundational concerns.\n- For conceptual questions, answer directly and concisely before reaching for tools.\n";
1
+ export declare function getBkperAgentSystemPrompt(): string;
2
+ export declare const BKPER_AGENT_SYSTEM_PROMPT = "# Bkper Context\n\nYou are a Bkper team member.\n\nProtect the zero-sum invariant above all else.\n\nYou help users by reading files, executing commands, editing code, and writing new files.\n\nAvailable tools:\n- read: read file contents\n- bash: run shell commands for search and discovery\n- edit: make precise file edits\n- write: create or replace files\n\nGuidelines:\n- Use bash for discovery and search like ls, rg, and find. Use it to run bkper CLI commands when relevant.\n- Use read to inspect file contents instead of cat or sed.\n- Use edit for precise changes.\n- When changing multiple separate locations in one file, use one edit call with multiple entries in edits[].\n- 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.\n- Keep edits[].oldText as small as possible while still being unique in the file.\n- Use write only for new files or complete rewrites.\n- Do not claim builds, tests, or command results unless you actually ran them.\n\n## Operating Principles\n\n- Preserve invariants and data integrity first, then user intent, then implementation convenience.\n- Think in resources, movements, and balances \u2014 not debits and credits.\n- Extend meaning with properties before adding structural complexity.\n- Model domain and flows before coding; represent business reality, not technical shortcuts.\n- Prefer simplicity over cleverness; choose small, boring, maintainable solutions.\n- Design for global readiness from day one: currencies, timezones, units, and formats.\n";
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":"AAaA,wBAAgB,yBAAyB,IAAI,MAAM,CAuBlD;AAED,eAAO,MAAM,yBAAyB,ooCAkBrC,CAAC"}
1
+ {"version":3,"file":"system-prompt.d.ts","sourceRoot":"","sources":["../../src/agent/system-prompt.ts"],"names":[],"mappings":"AAaA,wBAAgB,yBAAyB,IAAI,MAAM,CAsBlD;AAED,eAAO,MAAM,yBAAyB,2lDAgCrC,CAAC"}
@@ -8,10 +8,10 @@ function resolveCoreConceptsPath() {
8
8
  const thisDir = path.dirname(fileURLToPath(import.meta.url));
9
9
  return path.resolve(thisDir, '..', 'docs', 'core-concepts.md');
10
10
  }
11
- export function getBkperAgentAppendPrompt() {
11
+ export function getBkperAgentSystemPrompt() {
12
12
  const cliRefPath = resolveCliReferencePath();
13
13
  const coreConceptsPath = resolveCoreConceptsPath();
14
- return `${BKPER_AGENT_APPEND_PROMPT}
14
+ return `${BKPER_AGENT_SYSTEM_PROMPT}
15
15
  ## Reference Routing
16
16
 
17
17
  - Read local \`AGENTS.md\`, nearby files, and existing tests first for project-specific work.
@@ -27,28 +27,41 @@ ${coreConceptsPath}
27
27
  ${cliRefPath}
28
28
  \`\`\`
29
29
 
30
- - Read Pi documentation only when the task is specifically about Pi itself: prompt behavior, extensions, skills, themes, TUI, SDK, custom tools, model/provider integration, or other Pi runtime customization.
31
- - For generic engineering work, do not load Bkper or Pi reference docs unless directly relevant.
30
+ - For generic engineering work, do not load Bkper reference docs unless directly relevant.
32
31
  - When scope is unclear, inspect local files and project instructions first; load reference docs only after identifying a concrete need.
33
32
  `;
34
33
  }
35
- export const BKPER_AGENT_APPEND_PROMPT = `# Bkper Context
34
+ export const BKPER_AGENT_SYSTEM_PROMPT = `# Bkper Context
36
35
 
37
36
  You are a Bkper team member.
38
37
 
39
- For normal Bkper work, prioritize Bkper domain context, local project instructions, and surrounding files over Pi customization topics. Pi documentation is relevant only when the task is specifically about Pi itself or its runtime or customization.
38
+ Protect the zero-sum invariant above all else.
39
+
40
+ You help users by reading files, executing commands, editing code, and writing new files.
41
+
42
+ Available tools:
43
+ - read: read file contents
44
+ - bash: run shell commands for search and discovery
45
+ - edit: make precise file edits
46
+ - write: create or replace files
47
+
48
+ Guidelines:
49
+ - Use bash for discovery and search like ls, rg, and find. Use it to run bkper CLI commands when relevant.
50
+ - Use read to inspect file contents instead of cat or sed.
51
+ - Use edit for precise changes.
52
+ - When changing multiple separate locations in one file, use one edit call with multiple entries in edits[].
53
+ - 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.
54
+ - Keep edits[].oldText as small as possible while still being unique in the file.
55
+ - Use write only for new files or complete rewrites.
56
+ - Do not claim builds, tests, or command results unless you actually ran them.
40
57
 
41
58
  ## Operating Principles
42
59
 
43
- - Protect the zero-sum invariant above all else.
44
60
  - Preserve invariants and data integrity first, then user intent, then implementation convenience.
45
61
  - Think in resources, movements, and balances — not debits and credits.
46
62
  - Extend meaning with properties before adding structural complexity.
47
63
  - Model domain and flows before coding; represent business reality, not technical shortcuts.
48
64
  - Prefer simplicity over cleverness; choose small, boring, maintainable solutions.
49
- - Question the premise before adding complexity; prefer simplifying or removing over layering new structure.
50
65
  - Design for global readiness from day one: currencies, timezones, units, and formats.
51
- - Treat performance and security as foundational concerns.
52
- - For conceptual questions, answer directly and concisely before reaching for tools.
53
66
  `;
54
67
  //# sourceMappingURL=system-prompt.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"system-prompt.js","sourceRoot":"","sources":["../../src/agent/system-prompt.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,SAAS,uBAAuB;IAC5B,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,kBAAkB,CAAC,CAAC;AACnE,CAAC;AAED,SAAS,uBAAuB;IAC5B,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,kBAAkB,CAAC,CAAC;AACnE,CAAC;AAED,MAAM,UAAU,yBAAyB;IACrC,MAAM,UAAU,GAAG,uBAAuB,EAAE,CAAC;IAC7C,MAAM,gBAAgB,GAAG,uBAAuB,EAAE,CAAC;IACnD,OAAO,GAAG,yBAAyB;;;;;;;EAOrC,gBAAgB;;;;;;EAMhB,UAAU;;;;;;CAMX,CAAC;AACF,CAAC;AAED,MAAM,CAAC,MAAM,yBAAyB,GAAG;;;;;;;;;;;;;;;;;;CAkBxC,CAAC"}
1
+ {"version":3,"file":"system-prompt.js","sourceRoot":"","sources":["../../src/agent/system-prompt.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,SAAS,uBAAuB;IAC5B,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,kBAAkB,CAAC,CAAC;AACnE,CAAC;AAED,SAAS,uBAAuB;IAC5B,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,kBAAkB,CAAC,CAAC;AACnE,CAAC;AAED,MAAM,UAAU,yBAAyB;IACrC,MAAM,UAAU,GAAG,uBAAuB,EAAE,CAAC;IAC7C,MAAM,gBAAgB,GAAG,uBAAuB,EAAE,CAAC;IACnD,OAAO,GAAG,yBAAyB;;;;;;;EAOrC,gBAAgB;;;;;;EAMhB,UAAU;;;;;CAKX,CAAC;AACF,CAAC;AAED,MAAM,CAAC,MAAM,yBAAyB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgCxC,CAAC"}
@@ -9,7 +9,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
9
9
  };
10
10
  import { main as runPiMain } from '@mariozechner/pi-coding-agent';
11
11
  import { runAgentMode } from '../agent/run-agent-mode.js';
12
- import { getBkperAgentAppendPrompt } from '../agent/system-prompt.js';
12
+ import { getBkperAgentSystemPrompt } from '../agent/system-prompt.js';
13
13
  function createDefaultDependencies() {
14
14
  return {
15
15
  runPi: (args) => runPiMain(args),
@@ -23,7 +23,7 @@ function buildPiArgs(args) {
23
23
  if (hasSystemPromptArg(args)) {
24
24
  return args;
25
25
  }
26
- return ['--append-system-prompt', getBkperAgentAppendPrompt(), ...args];
26
+ return ['--system-prompt', getBkperAgentSystemPrompt(), ...args];
27
27
  }
28
28
  export function runAgentCommand(piArgs_1) {
29
29
  return __awaiter(this, arguments, void 0, function* (piArgs, dependencies = createDefaultDependencies()) {
@@ -1 +1 @@
1
- {"version":3,"file":"agent-command.js","sourceRoot":"","sources":["../../src/commands/agent-command.ts"],"names":[],"mappings":";;;;;;;;;AACA,OAAO,EAAE,IAAI,IAAI,SAAS,EAAE,MAAM,+BAA+B,CAAC;AAClE,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EAAE,yBAAyB,EAAE,MAAM,2BAA2B,CAAC;AAOtE,SAAS,yBAAyB;IAC9B,OAAO;QACH,KAAK,EAAE,CAAC,IAAc,EAAE,EAAE,CAAC,SAAS,CAAC,IAAI,CAAC;QAC1C,kBAAkB,EAAE,GAAG,EAAE,CAAC,YAAY,EAAE;KAC3C,CAAC;AACN,CAAC;AAED,SAAS,kBAAkB,CAAC,IAAc;IACtC,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,iBAAiB,IAAI,GAAG,CAAC,UAAU,CAAC,kBAAkB,CAAC,CAAC,CAAC;AAC7F,CAAC;AAED,SAAS,WAAW,CAAC,IAAc;IAC/B,IAAI,kBAAkB,CAAC,IAAI,CAAC,EAAE,CAAC;QAC3B,OAAO,IAAI,CAAC;IAChB,CAAC;IAED,OAAO,CAAC,wBAAwB,EAAE,yBAAyB,EAAE,EAAE,GAAG,IAAI,CAAC,CAAC;AAC5E,CAAC;AAED,MAAM,UAAgB,eAAe;yDACjC,MAAg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B,EAAE,yBAAyB,EAAE,EAAE,GAAG,IAAI,CAAC,CAAC;AACrE,CAAC;AAED,MAAM,UAAgB,eAAe;yDACjC,MAAgB,EAChB,eAAyC,yBAAyB,EAAE;QAEpE,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACtB,MAAM,YAAY,CAAC,kBAAkB,EAAE,CAAC;YACxC,OAAO;QACX,CAAC;QAED,MAAM,IAAI,GAAG,WAAW,CAAC,MAAM,CAAC,CAAC;QACjC,MAAM,YAAY,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IACnC,CAAC;CAAA;AAED,MAAM,UAAU,qBAAqB,CAAC,OAAgB;IAClD,OAAO;SACF,OAAO,CAAC,mBAAmB,CAAC;SAC5B,WAAW,CAAC,qDAAqD,CAAC;SAClE,kBAAkB,CAAC,IAAI,CAAC;SACxB,oBAAoB,CAAC,IAAI,CAAC,CAAC;AACpC,CAAC"}
@@ -115,7 +115,7 @@ bkper agent install <pi-package-source>
115
115
  bkper agent --help
116
116
  ```
117
117
 
118
- `bkper agent` keeps Bkper defaults (appending Bkper domain context to Pi's default prompt) unless you explicitly pass `--system-prompt`.
118
+ `bkper agent` keeps Bkper defaults (including the Bkper system prompt) unless you explicitly pass `--system-prompt`.
119
119
  Use `bkper help agent` for the Bkper CLI command help, and `bkper agent --help` for Pi help.
120
120
 
121
121
  For all available passthrough flags and commands, see the Pi CLI reference:
@@ -871,7 +871,7 @@ deployment:
871
871
  #### Agent
872
872
 
873
873
  - `agent` - Start the interactive Bkper Agent
874
- - `agent <pi-args...>` - Run Pi CLI with Bkper defaults (domain context/resources)
874
+ - `agent <pi-args...>` - Run Pi CLI with Bkper defaults (system prompt/resources)
875
875
 
876
876
  #### App Lifecycle
877
877
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bkper",
3
- "version": "4.12.3",
3
+ "version": "4.12.5",
4
4
  "description": "Command line client for Bkper",
5
5
  "bin": {
6
6
  "bkper": "./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": "^0.64.0",
50
+ "@mariozechner/pi-coding-agent": "^0.65.2",
51
51
  "bkper-js": "^2.32.1",
52
52
  "commander": "^13.1.0",
53
53
  "dotenv": "^8.2.0",