bkper 5.3.3 → 5.4.0

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.
Files changed (65) hide show
  1. package/lib/agent/extensions/builtins.d.ts +2 -1
  2. package/lib/agent/extensions/builtins.d.ts.map +1 -1
  3. package/lib/agent/extensions/builtins.js +2 -6
  4. package/lib/agent/extensions/builtins.js.map +1 -1
  5. package/lib/agent/extensions/handoff-goal-editor.d.ts +18 -28
  6. package/lib/agent/extensions/handoff-goal-editor.d.ts.map +1 -1
  7. package/lib/agent/extensions/handoff-goal-editor.js +27 -36
  8. package/lib/agent/extensions/handoff-goal-editor.js.map +1 -1
  9. package/lib/agent/extensions/handoff.d.ts +3 -1
  10. package/lib/agent/extensions/handoff.d.ts.map +1 -1
  11. package/lib/agent/extensions/handoff.js +47 -24
  12. package/lib/agent/extensions/handoff.js.map +1 -1
  13. package/lib/agent/interactive/interactive-mode.d.ts +0 -1
  14. package/lib/agent/interactive/interactive-mode.d.ts.map +1 -1
  15. package/lib/agent/interactive/interactive-mode.js +2 -22
  16. package/lib/agent/interactive/interactive-mode.js.map +1 -1
  17. package/lib/agent/interactive/run-agent-mode.d.ts.map +1 -1
  18. package/lib/agent/interactive/run-agent-mode.js +8 -1
  19. package/lib/agent/interactive/run-agent-mode.js.map +1 -1
  20. package/lib/agent/pi-shared-modules.d.ts +2 -1
  21. package/lib/agent/pi-shared-modules.d.ts.map +1 -1
  22. package/lib/agent/pi-shared-modules.js +1 -1
  23. package/lib/agent/pi-shared-modules.js.map +1 -1
  24. package/lib/agent/system-prompt.d.ts.map +1 -1
  25. package/lib/agent/system-prompt.js +1 -8
  26. package/lib/agent/system-prompt.js.map +1 -1
  27. package/lib/commands/events/delete.d.ts +8 -0
  28. package/lib/commands/events/delete.d.ts.map +1 -0
  29. package/lib/commands/events/delete.js +27 -0
  30. package/lib/commands/events/delete.js.map +1 -0
  31. package/lib/commands/events/index.d.ts +1 -0
  32. package/lib/commands/events/index.d.ts.map +1 -1
  33. package/lib/commands/events/index.js +1 -0
  34. package/lib/commands/events/index.js.map +1 -1
  35. package/lib/commands/events/register.d.ts.map +1 -1
  36. package/lib/commands/events/register.js +16 -2
  37. package/lib/commands/events/register.js.map +1 -1
  38. package/lib/docs/ai/decision-models.md +1 -0
  39. package/lib/docs/apps/ai.md +15 -2
  40. package/lib/docs/apps/architecture.md +1 -0
  41. package/lib/docs/apps/overview.md +1 -1
  42. package/lib/docs/cli/app-management.md +1 -1
  43. package/lib/docs/cli/data-management.md +7 -3
  44. package/lib/docs/index.md +1 -4
  45. package/package.json +3 -4
  46. package/lib/agent/core-concepts-routing.d.ts +0 -9
  47. package/lib/agent/core-concepts-routing.d.ts.map +0 -1
  48. package/lib/agent/core-concepts-routing.js +0 -34
  49. package/lib/agent/core-concepts-routing.js.map +0 -1
  50. package/lib/agent/extensions/core-concepts-preload.d.ts +0 -27
  51. package/lib/agent/extensions/core-concepts-preload.d.ts.map +0 -1
  52. package/lib/agent/extensions/core-concepts-preload.js +0 -122
  53. package/lib/agent/extensions/core-concepts-preload.js.map +0 -1
  54. package/lib/agent/extensions/prompt-routing.d.ts +0 -12
  55. package/lib/agent/extensions/prompt-routing.d.ts.map +0 -1
  56. package/lib/agent/extensions/prompt-routing.js +0 -38
  57. package/lib/agent/extensions/prompt-routing.js.map +0 -1
  58. package/lib/agent/interactive/pending-user-message.d.ts +0 -24
  59. package/lib/agent/interactive/pending-user-message.d.ts.map +0 -1
  60. package/lib/agent/interactive/pending-user-message.js +0 -82
  61. package/lib/agent/interactive/pending-user-message.js.map +0 -1
  62. package/lib/agent/prompt-routing.d.ts +0 -33
  63. package/lib/agent/prompt-routing.d.ts.map +0 -1
  64. package/lib/agent/prompt-routing.js +0 -106
  65. package/lib/agent/prompt-routing.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"run-agent-mode.js","sourceRoot":"","sources":["../../../src/agent/interactive/run-agent-mode.ts"],"names":[],"mappings":";;;;;;;;;AAA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C,cAAc,CAAC,MAAM,CAAC,UAAU,EAAE,UAAU,CAAC,CAC5E,CAAC;YACN,CAAC;YAED,MAAM,OAAO,GAAG,MAAM,yBAAyB,CAAC,aAAa,EAAE;gBAC3D,GAAG;gBACH,QAAQ;gBACR,cAAc;aACjB,CAAC,CAAC;YAEH,OAAO;gBACH,OAAO;gBACP,oBAAoB,EAAE,OAAO,CAAC,oBAAoB;gBAClD,WAAW,EAAE,CAAC,GAAG,kBAAkB,EAAE,GAAG,OAAO,CAAC,WAAW,CAAC;aAC/D,CAAC;QACN,CAAC,CAAA;QACD,qBAAqB,EAAE,CAAC,OAAO,EAAE,oBAAoB,EAAE,EAAE,CACrD,IAAI,oBAAoB,CAAC,OAAO,EAAE;YAC9B,oBAAoB;YACpB,mBAAmB,EAAE,+BAA+B,CAChD,OAAO,CAAC,QAAQ,CAAC,eAAe,CACnC;SACJ,CAAC;KACT,CAAC;AACN,CAAC;AAED,MAAM,UAAgB,YAAY;yDAC9B,eAAsC,2BAA2B,EAAE;;;QAEnE,YAAA,OAAO,CAAC,GAAG,EAAC,qBAAqB,uCAArB,qBAAqB,GAAK,GAAG,EAAC;QAE1C,MAAM,EAAC,OAAO,EAAE,oBAAoB,EAAE,WAAW,GAAG,EAAE,EAAC,GACnD,MAAM,YAAY,CAAC,aAAa,EAAE,CAAC;QACvC,iBAAiB,CAAC,WAAW,CAAC,CAAC;QAE/B,MAAM,IAAI,GAAG,YAAY,CAAC,qBAAqB,CAAC,OAAO,EAAE,oBAAoB,CAAC,CAAC;QAE/E,MAAM,IAAI,CAAC,GAAG,EAAE,CAAC;IACrB,CAAC;CAAA"}
@@ -15,7 +15,8 @@ export interface PiSharedModulePaths {
15
15
  }
16
16
  /** The files pi-coding-agent, at `codingAgentEntry`, loads for the modules bkper shares with it. */
17
17
  export declare function resolvePiSharedModulePaths(codingAgentEntry: string): PiSharedModulePaths;
18
- export declare const backgroundAnsi: typeof PiTui.backgroundAnsi, Box: typeof PiTui.Box, colorToRgb: typeof PiTui.colorToRgb, CombinedAutocompleteProvider: typeof PiTui.CombinedAutocompleteProvider, foregroundAnsi: typeof PiTui.foregroundAnsi, getKeybindings: typeof PiTui.getKeybindings, indexedColor: typeof PiTui.indexedColor, matchesKey: typeof PiTui.matchesKey, rgbColor: typeof PiTui.rgbColor, truncateToWidth: typeof PiTui.truncateToWidth, TuiAltScreen: typeof PiTui.TuiAltScreen, visibleWidth: typeof PiTui.visibleWidth;
18
+ export declare const backgroundAnsi: typeof PiTui.backgroundAnsi, Box: typeof PiTui.Box, colorToRgb: typeof PiTui.colorToRgb, CombinedAutocompleteProvider: typeof PiTui.CombinedAutocompleteProvider, Editor: typeof PiTui.Editor, foregroundAnsi: typeof PiTui.foregroundAnsi, getKeybindings: typeof PiTui.getKeybindings, indexedColor: typeof PiTui.indexedColor, matchesKey: typeof PiTui.matchesKey, rgbColor: typeof PiTui.rgbColor, truncateToWidth: typeof PiTui.truncateToWidth, TuiAltScreen: typeof PiTui.TuiAltScreen, visibleWidth: typeof PiTui.visibleWidth;
19
19
  export type Box = PiTui.Box;
20
+ export type Editor = PiTui.Editor;
20
21
  export declare const typesafeSystemOneApi: () => import("@earendil-works/pi-ai").ProviderClassifier;
21
22
  //# sourceMappingURL=pi-shared-modules.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"pi-shared-modules.d.ts","sourceRoot":"","sources":["../../src/agent/pi-shared-modules.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,KAAK,KAAK,MAAM,wBAAwB,CAAC;AAErD;;;;;;;;;GASG;AAEH,MAAM,WAAW,mBAAmB;IAChC,GAAG,EAAE,MAAM,CAAC;IACZ,mBAAmB,EAAE,MAAM,CAAC;CAC/B;AAED,oGAAoG;AACpG,wBAAgB,0BAA0B,CAAC,gBAAgB,EAAE,MAAM,GAAG,mBAAmB,CAcxF;AAiBD,eAAO,MACH,cAAc,+BACd,GAAG,oBACH,UAAU,2BACV,4BAA4B,6CAC5B,cAAc,+BACd,cAAc,+BACd,YAAY,6BACZ,UAAU,2BACV,QAAQ,yBACR,eAAe,gCACf,YAAY,6BACZ,YAAY,2BACP,CAAC;AACV,MAAM,MAAM,GAAG,GAAG,KAAK,CAAC,GAAG,CAAC;AAE5B,eAAO,MAAO,oBAAoB,0DAAyB,CAAC"}
1
+ {"version":3,"file":"pi-shared-modules.d.ts","sourceRoot":"","sources":["../../src/agent/pi-shared-modules.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,KAAK,KAAK,MAAM,wBAAwB,CAAC;AAErD;;;;;;;;;GASG;AAEH,MAAM,WAAW,mBAAmB;IAChC,GAAG,EAAE,MAAM,CAAC;IACZ,mBAAmB,EAAE,MAAM,CAAC;CAC/B;AAED,oGAAoG;AACpG,wBAAgB,0BAA0B,CAAC,gBAAgB,EAAE,MAAM,GAAG,mBAAmB,CAcxF;AAiBD,eAAO,MACH,cAAc,+BACd,GAAG,oBACH,UAAU,2BACV,4BAA4B,6CAC5B,MAAM,uBACN,cAAc,+BACd,cAAc,+BACd,YAAY,6BACZ,UAAU,2BACV,QAAQ,yBACR,eAAe,gCACf,YAAY,6BACZ,YAAY,2BACP,CAAC;AACV,MAAM,MAAM,GAAG,GAAG,KAAK,CAAC,GAAG,CAAC;AAC5B,MAAM,MAAM,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC;AAElC,eAAO,MAAO,oBAAoB,0DAAyB,CAAC"}
@@ -27,6 +27,6 @@ const paths = resolvePiSharedModulePaths(codingAgentEntry);
27
27
  const requireModule = createRequire(codingAgentEntry);
28
28
  const piTui = requireModule(paths.tui);
29
29
  const piAiTypesafeSystemOne = requireModule(paths.aiTypesafeSystemOne);
30
- export const { backgroundAnsi, Box, colorToRgb, CombinedAutocompleteProvider, foregroundAnsi, getKeybindings, indexedColor, matchesKey, rgbColor, truncateToWidth, TuiAltScreen, visibleWidth, } = piTui;
30
+ export const { backgroundAnsi, Box, colorToRgb, CombinedAutocompleteProvider, Editor, foregroundAnsi, getKeybindings, indexedColor, matchesKey, rgbColor, truncateToWidth, TuiAltScreen, visibleWidth, } = piTui;
31
31
  export const { typesafeSystemOneApi } = piAiTypesafeSystemOne;
32
32
  //# sourceMappingURL=pi-shared-modules.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"pi-shared-modules.js","sourceRoot":"","sources":["../../src/agent/pi-shared-modules.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAC,MAAM,SAAS,CAAC;AACnC,OAAO,EAAC,aAAa,EAAC,MAAM,aAAa,CAAC;AAC1C,OAAO,IAAI,MAAM,WAAW,CAAC;AAoB7B,oGAAoG;AACpG,MAAM,UAAU,0BAA0B,CAAC,gBAAwB;IAC/D,MAAM,sBAAsB,GAAG,aAAa,CAAC,gBAAgB,CAAC,CAAC;IAC/D,OAAO;QACH,GAAG,EAAE,sBAAsB,CAAC,OAAO,CAAC,wBAAwB,CAAC;QAC7D,0GAA0G;QAC1G,yGAAyG;QACzG,sFAAsF;QACtF,mBAAmB,EAAE,IAAI,CAAC,IAAI,CAC1B,iBAAiB,CAAC,sBAAsB,EAAE,uBAAuB,CAAC,EAClE,MAAM,EACN,KAAK,EACL,6BAA6B,CAChC;KACJ,CAAC;AACN,CAAC;AAED,SAAS,iBAAiB,CAAC,OAAuB,EAAE,WAAmB;;IACnE,KAAK,MAAM,cAAc,IAAI,MAAA,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC,WAAW,CAAC,mCAAI,EAAE,EAAE,CAAC;QACpE,MAAM,UAAU,GAAG,IAAI,CAAC,IAAI,CAAC,cAAc,EAAE,WAAW,CAAC,CAAC;QAC1D,IAAI,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,cAAc,CAAC,CAAC;YAAE,OAAO,UAAU,CAAC;IAC7E,CAAC;IACD,MAAM,IAAI,KAAK,CAAC,eAAe,WAAW,uCAAuC,CAAC,CAAC;AACvF,CAAC;AAED,MAAM,gBAAgB,GAAG,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,iCAA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,CAAC,OAAO,CAAC,KAAK,CAAC,WAAW,CAAC,mCAAI,EAAE,EAAE,CAAC;QACpE,MAAM,UAAU,GAAG,IAAI,CAAC,IAAI,CAAC,cAAc,EAAE,WAAW,CAAC,CAAC;QAC1D,IAAI,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,cAAc,CAAC,CAAC;YAAE,OAAO,UAAU,CAAC;IAC7E,CAAC;IACD,MAAM,IAAI,KAAK,CAAC,eAAe,WAAW,uCAAuC,CAAC,CAAC;AACvF,CAAC;AAED,MAAM,gBAAgB,GAAG,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,iCAAiC,CAAC,CAAC;AAChF,MAAM,KAAK,GAAG,0BAA0B,CAAC,gBAAgB,CAAC,CAAC;AAC3D,uFAAuF;AACvF,MAAM,aAAa,GAAG,aAAa,CAAC,gBAAgB,CAAC,CAAC;AACtD,MAAM,KAAK,GAAiB,aAAa,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;AACrD,MAAM,qBAAqB,GAAiC,aAAa,CAAC,KAAK,CAAC,mBAAmB,CAAC,CAAC;AAErG,MAAM,CAAC,MAAM,EACT,cAAc,EACd,GAAG,EACH,UAAU,EACV,4BAA4B,EAC5B,MAAM,EACN,cAAc,EACd,cAAc,EACd,YAAY,EACZ,UAAU,EACV,QAAQ,EACR,eAAe,EACf,YAAY,EACZ,YAAY,GACf,GAAG,KAAK,CAAC;AAIV,MAAM,CAAC,MAAM,EAAC,oBAAoB,EAAC,GAAG,qBAAqB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"system-prompt.d.ts","sourceRoot":"","sources":["../../src/agent/system-prompt.ts"],"names":[],"mappings":"AA0KA,wBAAgB,yBAAyB,CACrC,aAAa,GAAE,MAAM,EAAsC,GAC5D,MAAM,CAsDR;AA4BD,eAAO,MAAM,yBAAyB,QAKpC,CAAC"}
1
+ {"version":3,"file":"system-prompt.d.ts","sourceRoot":"","sources":["../../src/agent/system-prompt.ts"],"names":[],"mappings":"AAkKA,wBAAgB,yBAAyB,CACrC,aAAa,GAAE,MAAM,EAAsC,GAC5D,MAAM,CAsDR;AA4BD,eAAO,MAAM,yBAAyB,QAKpC,CAAC"}
@@ -17,13 +17,6 @@ function resolveDocsIndexPath(filename) {
17
17
  path.resolve(thisDir, '..', '..', 'skill', 'references', filename),
18
18
  ]);
19
19
  }
20
- function resolveReferenceDocPath(relativePath) {
21
- const thisDir = path.dirname(fileURLToPath(import.meta.url));
22
- return resolveFirstExistingPath([
23
- path.resolve(thisDir, '..', 'docs', relativePath),
24
- path.resolve(thisDir, '..', '..', 'skill', 'references', relativePath),
25
- ]);
26
- }
27
20
  function resolvePiPackageRoot() {
28
21
  const piIndexPath = fileURLToPath(import.meta.resolve('@earendil-works/pi-coding-agent'));
29
22
  let dir = path.dirname(piIndexPath);
@@ -135,7 +128,7 @@ function buildToolPromptSection(selectedTools) {
135
128
  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')}`;
136
129
  }
137
130
  export function getBkperAgentSystemPrompt(selectedTools = ['read', 'bash', 'edit', 'write']) {
138
- const coreConceptsPath = resolveReferenceDocPath('core/core-concepts.md');
131
+ const coreConceptsPath = resolveDocsIndexPath('core/core-concepts.md');
139
132
  const indexPath = resolveDocsIndexPath('index.md');
140
133
  const referenceDocsDir = path.dirname(indexPath);
141
134
  const piRoot = resolvePiPackageRoot();
@@ -1 +1 @@
1
- {"version":3,"file":"system-prompt.js","sourceRoot":"","sources":["../../src/agent/system-prompt.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,wBAAwB,EACxB,uBAAuB,EACvB,wBAAwB,EACxB,8BAA8B,EAC9B,wBAAwB,EACxB,yBAAyB,GAE5B,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,aAAa,E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f,CAAC;AACF,CAAC;AAED,SAAS,0BAA0B,CAAC,aAAuB;IACvD,OAAO;;;;;;;;EAQT,sBAAsB,CAAC,aAAa,CAAC;;;;;;;;;;;;;;CActC,CAAC;AACF,CAAC;AAED,MAAM,CAAC,MAAM,yBAAyB,GAAG,0BAA0B,CAAC;IAChE,MAAM;IACN,MAAM;IACN,MAAM;IACN,OAAO;CACV,CAAC,CAAC"}
@@ -0,0 +1,8 @@
1
+ import { Event } from 'bkper-js';
2
+ /**
3
+ * Deletes one bot response without deleting its event or reversing bot effects.
4
+ *
5
+ * @returns The updated event payload after deletion
6
+ */
7
+ export declare function deleteEventBotResponse(bookId: string, eventId: string, agentId: string): Promise<Event>;
8
+ //# sourceMappingURL=delete.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"delete.d.ts","sourceRoot":"","sources":["../../../src/commands/events/delete.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,KAAK,EAAE,MAAM,UAAU,CAAC;AAG9C;;;;GAIG;AACH,wBAAsB,sBAAsB,CACxC,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,MAAM,GAChB,OAAO,CAAC,KAAK,CAAC,CAOhB"}
@@ -0,0 +1,27 @@
1
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
+ return new (P || (P = Promise))(function (resolve, reject) {
4
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
8
+ });
9
+ };
10
+ import { BotResponse, Event } from 'bkper-js';
11
+ import { getBkperInstance } from '../../bkper-factory.js';
12
+ /**
13
+ * Deletes one bot response without deleting its event or reversing bot effects.
14
+ *
15
+ * @returns The updated event payload after deletion
16
+ */
17
+ export function deleteEventBotResponse(bookId, eventId, agentId) {
18
+ return __awaiter(this, void 0, void 0, function* () {
19
+ const bkper = getBkperInstance();
20
+ const book = yield bkper.getBook(bookId);
21
+ const event = new Event(book, { id: eventId });
22
+ const botResponse = new BotResponse(event, { agentId });
23
+ yield botResponse.remove();
24
+ return event;
25
+ });
26
+ }
27
+ //# sourceMappingURL=delete.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"delete.js","sourceRoot":"","sources":["../../../src/commands/events/delete.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,WAAW,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAC9C,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAE1D;;;;GAIG;AACH,MAAM,UAAgB,sBAAsB,CACxC,MAAc,EACd,OAAe,EACf,OAAe;;QAEf,MAAM,KAAK,GAAG,gBAAgB,EAAE,CAAC;QACjC,MAAM,IAAI,GAAG,MAAM,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;QACzC,MAAM,KAAK,GAAG,IAAI,KAAK,CAAC,IAAI,EAAE,EAAE,EAAE,EAAE,OAAO,EAAE,CAAC,CAAC;QAC/C,MAAM,WAAW,GAAG,IAAI,WAAW,CAAC,KAAK,EAAE,EAAE,OAAO,EAAE,CAAC,CAAC;QACxD,MAAM,WAAW,CAAC,MAAM,EAAE,CAAC;QAC3B,OAAO,KAAK,CAAC;IACjB,CAAC;CAAA"}
@@ -1,3 +1,4 @@
1
1
  export { DEFAULT_EVENT_LIST_LIMIT, listEvents, listEventsFormatted, type ListBookEventsOptions, type ListBookEventsResult, } from './list.js';
2
2
  export { replayEventBotResponse } from './replay.js';
3
+ export { deleteEventBotResponse } from './delete.js';
3
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/events/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,wBAAwB,EACxB,UAAU,EACV,mBAAmB,EACnB,KAAK,qBAAqB,EAC1B,KAAK,oBAAoB,GAC5B,MAAM,WAAW,CAAC;AACnB,OAAO,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/events/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,wBAAwB,EACxB,UAAU,EACV,mBAAmB,EACnB,KAAK,qBAAqB,EAC1B,KAAK,oBAAoB,GAC5B,MAAM,WAAW,CAAC;AACnB,OAAO,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;AACrD,OAAO,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC"}
@@ -1,3 +1,4 @@
1
1
  export { DEFAULT_EVENT_LIST_LIMIT, listEvents, listEventsFormatted, } from './list.js';
2
2
  export { replayEventBotResponse } from './replay.js';
3
+ export { deleteEventBotResponse } from './delete.js';
3
4
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/commands/events/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,wBAAwB,EACxB,UAAU,EACV,mBAAmB,GAGtB,MAAM,WAAW,CAAC;AACnB,OAAO,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/commands/events/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,wBAAwB,EACxB,UAAU,EACV,mBAAmB,GAGtB,MAAM,WAAW,CAAC;AACnB,OAAO,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;AACrD,OAAO,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"register.d.ts","sourceRoot":"","sources":["../../../src/commands/events/register.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAUrC;;GAEG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,CAOvD;AAED,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAmD5D"}
1
+ {"version":3,"file":"register.d.ts","sourceRoot":"","sources":["../../../src/commands/events/register.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAerC;;GAEG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,CAOvD;AAED,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAuE5D"}
@@ -12,7 +12,7 @@ import { withAction } from '../action.js';
12
12
  import { parsePositiveInteger } from '../cli-helpers.js';
13
13
  import { renderItem, renderList } from '../../render/index.js';
14
14
  import { validateRequiredOptions, throwIfErrors } from '../../utils/validation.js';
15
- import { listEventsFormatted, replayEventBotResponse } from './index.js';
15
+ import { listEventsFormatted, replayEventBotResponse, deleteEventBotResponse } from './index.js';
16
16
  import { eventToJson } from './event-json.js';
17
17
  const EVENT_TYPE_VALUES = new Set(Object.values(EventType));
18
18
  /**
@@ -50,7 +50,8 @@ export function registerEventCommands(program) {
50
50
  });
51
51
  renderList(result);
52
52
  }))());
53
- eventCommand
53
+ const responseCommand = eventCommand.command('response').description('Manage event bot responses');
54
+ responseCommand
54
55
  .command('replay <eventId>')
55
56
  .description('Replay one bot response for an event')
56
57
  .option('-b, --book <bookId>', 'Book ID')
@@ -63,5 +64,18 @@ export function registerEventCommands(program) {
63
64
  const event = yield replayEventBotResponse(options.book, eventId, options.agentId);
64
65
  renderItem(eventToJson(event.json()));
65
66
  }))());
67
+ responseCommand
68
+ .command('delete <eventId>')
69
+ .description('Delete one bot response; preserves the event and does not undo bot effects')
70
+ .option('-b, --book <bookId>', 'Book ID')
71
+ .option('--agent-id <agentId>', 'Bot/agent ID whose response should be deleted')
72
+ .action((eventId, options) => withAction('deleting event bot response', () => __awaiter(this, void 0, void 0, function* () {
73
+ throwIfErrors(validateRequiredOptions(options, [
74
+ { name: 'book', flag: '--book' },
75
+ { name: 'agentId', flag: '--agent-id' },
76
+ ]));
77
+ const event = yield deleteEventBotResponse(options.book, eventId, options.agentId);
78
+ renderItem(eventToJson(event.json()));
79
+ }))());
66
80
  }
67
81
  //# sourceMappingURL=register.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"register.js","sourceRoot":"","sources":["../../../src/commands/events/register.ts"],"names":[],"mappings":";;;;;;;;;AACA,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AACrC,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AACzD,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAC/D,OAAO,EAAE,uBAAuB,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AACnF,OAAO,EAAE,mBAAmB,EAAE,sBAAsB,EAAE,MAAM,YAAY,CAAC;AACzE,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAE9C,MAAM,iBAAiB,GAAG,IAAI,GAAG,CAAS,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC;AAEpE;;GAEG;AACH,MAAM,UAAU,cAAc,CAAC,KAAa;IACxC,IAAI,CAAC,iBAAiB,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC;QAChC,MAAM,IAAI,KAAK,CACX,uBAAuB,KAAK,mBAAmB,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CACvF,CAAC;IACN,CAAC;IACD,OAAO,KAAkB,CAAC;AAC9B,CAAC;AAED,MAAM,UA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CACP,CAAC;IAEN,eAAe;SACV,OAAO,CAAC,kBAAkB,CAAC;SAC3B,WAAW,CAAC,4EAA4E,CAAC;SACzF,MAAM,CAAC,qBAAqB,EAAE,SAAS,CAAC;SACxC,MAAM,CAAC,sBAAsB,EAAE,+CAA+C,CAAC;SAC/E,MAAM,CAAC,CAAC,OAAe,EAAE,OAA6B,EAAE,EAAE,CACvD,UAAU,CAAC,6BAA6B,EAAE,GAAS,EAAE;QACjD,aAAa,CACT,uBAAuB,CAAC,OAAO,EAAE;YAC7B,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE;YAChC,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,YAAY,EAAE;SAC1C,CAAC,CACL,CAAC;QACF,MAAM,KAAK,GAAG,MAAM,sBAAsB,CAAC,OAAO,CAAC,IAAK,EAAE,OAAO,EAAE,OAAO,CAAC,OAAQ,CAAC,CAAC;QACrF,UAAU,CAAC,WAAW,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;IAC1C,CAAC,CAAA,CAAC,EAAE,CACP,CAAC;AACV,CAAC"}
@@ -244,6 +244,7 @@ TypeSafe's JavaScript SDK, `@typesafe-ai/sdk`, works with Bkper AI and infers an
244
244
 
245
245
  - **In a Bkper Platform app Worker**, send no `Authorization` header. Platform outbound adds authorization and app attribution.
246
246
  - **In scripts and servers**, send your own Bkper access token as a bearer token.
247
+ - **In a browser page**, send the signed-in user's access token. Any origin may call, usage counts against that user's allowance, and the user can see your questions. See [Call from a browser](https://bkper.com/docs/ai/ai-gateway.md#call-from-a-browser).
247
248
  - **In [Bkper CLI Agent](https://bkper.com/docs/ai/bkper-cli-agent.md#what-it-can-do)**, no setup is needed. Describe the outcome and the agent asks the decision model for you.
248
249
 
249
250
  See [Add Bkper AI to an App](https://bkper.com/docs/platform/apps/ai.md#ask-a-decision-model) for the SDK setup in both cases and its limits with Bkper AI.
@@ -9,7 +9,7 @@ Model output is a suggestion, not permission to change a Book. Keep decisions ab
9
9
  - **A yes/no, a choice, or a level on a scale?** Ask a decision model, such as `jev`, with TypeSafe's SDK, `@typesafe-ai/sdk`.
10
10
  - **Text or a custom JSON object?** Ask a language model (LLM), such as `gpt-luna`, with AI SDK's Open Responses provider, `@ai-sdk/open-responses`.
11
11
 
12
- Add the SDK to the **Worker** package. Keep the call in a server service used by your authenticated app API route, and define the route's request and response in the app's Zod/OpenAPI contract.
12
+ By default, add the SDK to the **Worker** package. Keep the call in a server service used by your authenticated app API route, and define the route's request and response in the app's Zod/OpenAPI contract. For inference used only by the UI, the client can also [call Bkper AI directly](#call-from-the-browser).
13
13
 
14
14
  ## Keep authentication in the platform
15
15
 
@@ -19,7 +19,20 @@ For an interactive app, the flow is:
19
19
  2. Bkper verifies the user's token, removes it before invoking the Worker, and establishes user and app context for outbound requests.
20
20
  3. The Worker calls Bkper AI. Platform outbound adds authorization and app attribution. **Do not read, forward, or store the user's token in the Worker.**
21
21
 
22
- An authenticated `/events` handler has the same outbound context. A page request does not; start inference from an authenticated `/api/*` route, not from the page handler or the browser.
22
+ An authenticated `/events` handler has the same outbound context. A page request does not, so the page handler cannot call Bkper AI.
23
+
24
+ ## Call from the browser
25
+
26
+ The client can call Bkper AI directly with `auth.authenticatedFetch()`, which sends the signed-in user's token. Choose the path by what the inference needs:
27
+
28
+ | | App API route | Browser |
29
+ | ----------------------------------- | ---------------------------------- | ----------------------------------------------- |
30
+ | Usage attribution | The app, set by platform outbound | The `bkper-ai-source` header the client sends |
31
+ | Prompts, questions, and criteria | Private to the Worker | Visible to the user |
32
+ | Reuse by scripts, agents, or events | Yes, through the route | No |
33
+ | Request path | Client → app Worker → Bkper AI | Client → Bkper AI |
34
+
35
+ In both cases usage counts against the user's allowance. See [Call from a browser](https://bkper.com/docs/ai/ai-gateway.md#call-from-a-browser) for a request example.
23
36
 
24
37
  ## Ask a decision model
25
38
 
@@ -49,6 +49,7 @@ Client code has two data paths. Choose based on who owns the behavior:
49
49
 
50
50
  - **Direct Bkper calls** use `bkper-js` for generic Bkper data needed only by the browser UI.
51
51
  - **App API calls** use the generated typed client in `client/src/api/` with `auth.authenticatedFetch()` for app-owned behavior, especially when it needs server-only capabilities or more than one caller.
52
+ - **Direct Bkper AI calls** use `auth.authenticatedFetch()` for inference needed only by the browser UI, when its prompts may be visible to the user. See [Call from the browser](https://bkper.com/docs/platform/apps/ai.md#call-from-the-browser).
52
53
 
53
54
  Keep app-owned behavior in one place. Do not implement the same behavior separately in the UI and the app API.
54
55
 
@@ -18,7 +18,7 @@ The same Worker can expose app-defined `/api/*` routes. Treat those routes as th
18
18
 
19
19
  ### AI inference
20
20
 
21
- When an app needs model inference, use Bkper AI by default. An authenticated app API route or event establishes the user and app identity, then platform outbound supplies authorization and usage attribution for the Worker's Bkper AI requests. The app does not need provider credentials.
21
+ When an app needs model inference, use Bkper AI by default. An authenticated app API route or event establishes the user and app identity, then platform outbound supplies authorization and usage attribution for the Worker's Bkper AI requests. The app does not need provider credentials. For inference used only by the UI, the client can also call Bkper AI directly with the signed-in user's token.
22
22
 
23
23
  See [Add Bkper AI to an App](https://bkper.com/docs/platform/apps/ai.md) for the client-to-Worker authentication flow and SDK setup for decision and language models.
24
24
 
@@ -566,7 +566,7 @@ Inside the interactive agent:
566
566
  - `--last <n>` - Show newest N requests after filters (default: 100)
567
567
  - `-p, --preview` - Query preview logs instead of production
568
568
  - `-w, --web` - Filter to normal web/API requests
569
- - `-e, --events` - Filter to `/events` requests
569
+ - `-e, --events` - Filter to `/events` requests (for bot errors shown in a Book, start with `event list --error`)
570
570
  - `--level <level>` - Minimum log level threshold (`info`, `warn`, or `error`)
571
571
  - `--status-code <code>` - Filter by HTTP status code
572
572
  - `app undeploy` - Remove app from platform
@@ -326,7 +326,7 @@ bkper transaction merge tx_123 tx_456 -b abc123
326
326
 
327
327
  ## Events
328
328
 
329
- Inspect book events and bot responses — useful for debugging automations and recovering from intermittent bot errors.
329
+ Inspect book events and bot responses — start here when debugging bot errors shown in a Book.
330
330
 
331
331
  ```bash
332
332
  # List recent events (one page, default limit 50)
@@ -345,7 +345,10 @@ bkper event list -b abc123 --type TRANSACTION_POSTED --after 2026-01-01T00:00:00
345
345
  bkper event list -b abc123 --limit 50 --cursor cursor_123
346
346
 
347
347
  # Replay one bot response after inspecting an error
348
- bkper event replay evt_789 -b abc123 --agent-id tax-bot
348
+ bkper event response replay evt_789 -b abc123 --agent-id tax-bot
349
+
350
+ # Delete one bot response
351
+ bkper event response delete evt_789 -b abc123 --agent-id tax-bot
349
352
  ```
350
353
 
351
354
  <details>
@@ -359,7 +362,8 @@ bkper event replay evt_789 -b abc123 --agent-id tax-bot
359
362
  - `--type <type>` - Filter by event type (e.g. `TRANSACTION_POSTED`, `ACCOUNT_CREATED`)
360
363
  - `--limit <number>` - Fetch one page with up to this many events (default `50`, max `200`)
361
364
  - `--cursor <cursor>` - Cursor for fetching the next page
362
- - `event replay <eventId> -b <bookId> --agent-id <agentId>` - Replay one bot response for an event (returns the updated event with bot responses)
365
+ - `event response replay <eventId> -b <bookId> --agent-id <agentId>` - Replay one bot response for an event (returns the updated event with bot responses)
366
+ - `event response delete <eventId> -b <bookId> --agent-id <agentId>` - Delete one bot response for an event (does not undo its effects; returns the updated event)
363
367
 
364
368
  Output includes the full event payload, including nested `botResponses` (`agentId`, `type`, `message`, `createdAt`), for LLM-assisted debugging.
365
369
 
package/lib/docs/index.md CHANGED
@@ -2,12 +2,9 @@
2
2
 
3
3
  Reference docs for Bkper tasks. Load only the specific doc(s) relevant to the task — do not load all of them.
4
4
 
5
- For Bkper data, accounting, reporting, tax, or financial-flow tasks, read `core/core-concepts.md` first.
6
-
7
5
  For Bkper app implementation, refactoring, or code review, always read `apps/quality.md` alongside the task-specific references. After implementation, review the changed code against the guidelines before considering the work complete.
8
6
 
9
- - `core/core-concepts.md` — canonical Bkper data model: resources, movements, balances, accounts, groups, books, transactions, properties, and the zero-sum invariant.
10
- - `cli/data-management.md` — CLI reference for managing financial data and files: books, accounts, groups, files, transactions, per-account balance queries, query operators (on:, after:, before:, account:, group:), JSON output shapes and jq reshaping, human-review Bkper UI links, batch operations via stdin/piping, collections.
7
+ - `cli/data-management.md` — CLI reference for managing financial data and files: books, accounts, groups, files, transactions, events and bot responses (bot errors, replay, delete), per-account balance queries, query operators (on:, after:, before:, account:, group:), JSON output shapes and jq reshaping, human-review Bkper UI links, batch operations via stdin/piping, collections.
11
8
  - `cli/app-management.md` — CLI reference for building and deploying Bkper apps: init/git clone/credential helpers, dev/build/deploy workflow, app install/uninstall, secrets management, app logs, bkper.yaml configuration reference (identity, branding, events, menu integration, deployment).
12
9
  - `apps/overview.md` — Platform evaluation and capability overview: use when comparing managed Bkper hosting with self-managed infrastructure or clarifying platform responsibilities; use the task-specific app references for implementation.
13
10
  - `apps/ai.md` — Bkper AI in apps, scripts, and tools: ask the Jev decision model with TypeSafe's SDK or language models with AI SDK Open Responses, authenticate through app `/api/*` routes or a Bkper token outside the platform, handle errors, and keep Book writes under deterministic application control.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bkper",
3
- "version": "5.3.3",
3
+ "version": "5.4.0",
4
4
  "description": "Official Bkper CLI for accounting data, automation, apps, and AI agents",
5
5
  "bin": {
6
6
  "bkper": "lib/cli.js"
@@ -44,7 +44,7 @@
44
44
  "build:copy-themes": "mkdir -p lib/agent && rm -rf lib/agent/themes && cp -R src/agent/themes lib/agent/themes",
45
45
  "skill:package": "bun ./scripts/generate-skill-distribution.ts",
46
46
  "api:platform": "openapi-typescript https://platform.bkper.app/openapi.json -o src/platform/types.d.ts",
47
- "api:platform:local": "openapi-typescript http://localhost:8790/openapi.json -o src/platform/types.d.ts",
47
+ "api:platform:local": "openapi-typescript http://localhost:8703/openapi.json -o src/platform/types.d.ts",
48
48
  "predev": "bun run build",
49
49
  "dev": "tsc -w",
50
50
  "ports": "devpod ssh ../ -L 6274",
@@ -52,7 +52,7 @@
52
52
  "test": "bun run test:typecheck && TS_NODE_TRANSPILE_ONLY=true TS_NODE_PROJECT=tsconfig.test.json mocha",
53
53
  "test:unit": "bun run test:typecheck && TS_NODE_TRANSPILE_ONLY=true TS_NODE_PROJECT=tsconfig.test.json mocha --config .mocharc.json",
54
54
  "test:integration": "bun run test:typecheck && TS_NODE_TRANSPILE_ONLY=true BKPER_API_URL=${BKPER_API_URL:-http://localhost:8081/_ah/api/bkper} TS_NODE_PROJECT=tsconfig.test.json mocha --config .mocharc.integration.json",
55
- "test:deploy": "bun run test:typecheck && TS_NODE_TRANSPILE_ONLY=true BKPER_PLATFORM_URL=http://localhost:8790 BKPER_API_URL=https://api-dev.bkper.app TS_NODE_PROJECT=tsconfig.test.json mocha --config .mocharc.deploy.json",
55
+ "test:deploy": "bun run test:typecheck && TS_NODE_TRANSPILE_ONLY=true BKPER_PLATFORM_URL=http://localhost:8703 BKPER_API_URL=https://api-dev.bkper.app TS_NODE_PROJECT=tsconfig.test.json mocha --config .mocharc.deploy.json",
56
56
  "test:all": "bun run test:unit && bun run test:integration",
57
57
  "version": "bun ./scripts/sync-plugin-version.ts && git add .claude-plugin/plugin.json .claude-plugin/marketplace.json .codex-plugin/plugin.json",
58
58
  "release:patch": "npm version patch -m \"chore(release): v%s\"",
@@ -60,7 +60,6 @@
60
60
  "release:major": "npm version major -m \"chore(release): v%s\"",
61
61
  "docs:compliance": "TS_NODE_PROJECT=tsconfig.test.json node --loader ts-node/esm ./test/tools/docs-compliance/check.ts",
62
62
  "docs:compliance:live": "TS_NODE_PROJECT=tsconfig.test.json node --loader ts-node/esm ./test/tools/docs-compliance/live.ts",
63
- "eval:prompt-routing": "bun ./test/tools/prompt-routing/live.ts",
64
63
  "upgrade:api": "bun update @bkper/bkper-api-types --latest && bun update bkper-js --latest"
65
64
  },
66
65
  "dependencies": {
@@ -1,9 +0,0 @@
1
- import type { PromptRoute } from './prompt-routing.js';
2
- export type CoreConceptsPreloadLevel = 'none' | 'full';
3
- export interface CoreConceptsPreloadInput {
4
- prompt: string;
5
- }
6
- /** Conservative keyword fallback only. Jev is the primary detector. */
7
- export declare function detectCoreConceptsPreloadLevel(input: CoreConceptsPreloadInput): CoreConceptsPreloadLevel;
8
- export declare const CORE_CONCEPTS_ROUTE: PromptRoute;
9
- //# sourceMappingURL=core-concepts-routing.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"core-concepts-routing.d.ts","sourceRoot":"","sources":["../../src/agent/core-concepts-routing.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,WAAW,EAAqB,MAAM,qBAAqB,CAAC;AAazE,MAAM,MAAM,wBAAwB,GAAG,MAAM,GAAG,MAAM,CAAC;AACvD,MAAM,WAAW,wBAAwB;IACrC,MAAM,EAAE,MAAM,CAAC;CAClB;AAED,uEAAuE;AACvE,wBAAgB,8BAA8B,CAC1C,KAAK,EAAE,wBAAwB,GAChC,wBAAwB,CAW1B;AAED,eAAO,MAAM,mBAAmB,EAAE,WAiBjC,CAAC"}
@@ -1,34 +0,0 @@
1
- const DOCS_PATTERN = /\b(doc|docs|documentation|readme|guide|guides|example|examples|spec|specs|reference)\b/i;
2
- const ANALYSIS_PATTERN = /\b(review|audit|validate|verify|critique|rewrite|document|describe|explain|design|model|map|check|spot)\b/i;
3
- const AUTOMATION_PATTERN = /\b(bot|bots|app|apps|automation|automations)\b/i;
4
- const BOT_PATTERN = /\b(bot|bots)\b/i;
5
- const SEMANTIC_PATTERN = /\b(bkper|book|books|account|accounts|group|groups|transaction|transactions|balance|balances|incoming|outgoing|asset|assets|liability|liabilities|receivable|receivables|payable|payables|statement|statements|ledger|flow|flows|movement|movements|collection|collections|draft|drafts|checked|unchecked|posted|trashed|tax|taxes)\b/i;
6
- const FINANCE_PATTERN = /\b(finance|financial|accounting|bookkeeping|money|bank|banking|cash|income|revenue|expense|expenses|budget|budgeting|invoice|invoices|payment|payments|loan|loans|debt|payroll|investment|investments|reconcile|reconciliation|credit|profit|loss|equity|inventory|owe|owed|afford|refund|refunds|salary|interest|dividend|dividends|fee|fees|deposit|deposits|withdrawal|withdrawals|cost|costs|receipt|receipts|contas|transações|transacoes|saldo|saldos|dinheiro|contabilidade)\b/i;
7
- /** Conservative keyword fallback only. Jev is the primary detector. */
8
- export function detectCoreConceptsPreloadLevel(input) {
9
- const prompt = input.prompt.trim();
10
- if (!prompt)
11
- return 'none';
12
- if (SEMANTIC_PATTERN.test(prompt) || FINANCE_PATTERN.test(prompt) || BOT_PATTERN.test(prompt))
13
- return 'full';
14
- if ((DOCS_PATTERN.test(prompt) || ANALYSIS_PATTERN.test(prompt)) &&
15
- AUTOMATION_PATTERN.test(prompt))
16
- return 'full';
17
- return 'none';
18
- }
19
- export const CORE_CONCEPTS_ROUTE = {
20
- id: 'bkper-core-concepts',
21
- threshold: 0.4,
22
- question: {
23
- type: 'bool',
24
- instructions: "Is the user's present goal in `prompt` a finance/accounting task, a Bkper user task, or a task involving the meaning of Bkper's domain model? Use `recentUserMessages` to resolve ambiguous references, but follow explicit topic changes. For app and bot development, answer yes for financial/resource-flow business logic and no for technical infrastructure or general application work. The application's business area or use of Bkper does not by itself make technical work a domain task. Ambiguous Bkper app/bot troubleshooting, reviews, and documentation requests default to domain relevance unless the current task or recent context establishes a technical-only purpose. Do not assume that a documentation review is merely technical.",
25
- criteria: {
26
- true: 'Working with finance, money, accounting, bookkeeping, or inventory/resource movements; using or learning Bkper, including user setup, login, permissions, and connecting banks; designing, implementing, debugging, reviewing, explaining, or testing financial rules or Bkper data semantics. Examples of semantics are where resources move, which Accounts/Groups/Books represent a business process, transaction states, balances, taxes, valuation, payments, and refunds. In this CLI, unspecified books, accounts, transactions, checked entries, and bot problems default to Bkper domain tasks unless a different subject or technical cause is established. This includes general Bkper/bot documentation and README reviews whose scope is not limited to installation or tooling.',
27
- false: "The requested work is general software engineering, UI styling, framework/hosting choice, codebase organization, package installation, compiler/import errors, bundling/build configuration, HTTP routing, deployment/CI plumbing, or configuring the test harness rather than testing business rules. This remains no for Bkper apps/bots and financial products. Vague requests inherit the immediate task's technical subject, not the application's financial domain. Also no for clearly unrelated uses of account, transaction, book, or bot, and unrelated Git work.",
28
- },
29
- },
30
- fallback(input) {
31
- return [input.prompt, ...input.recentUserMessages].some(prompt => detectCoreConceptsPreloadLevel({ prompt }) === 'full');
32
- },
33
- };
34
- //# sourceMappingURL=core-concepts-routing.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"core-concepts-routing.js","sourceRoot":"","sources":["../../src/agent/core-concepts-routing.ts"],"names":[],"mappings":"AAEA,MAAM,YAAY,GACd,yFAAyF,CAAC;AAC9F,MAAM,gBAAgB,GAClB,4GAA4G,CAAC;AACjH,MAAM,kBAAkB,GAAG,iDAAiD,CAAC;AAC7E,MAAM,WAAW,GAAG,iBAAiB,CAAC;AACtC,MAAM,gBAAgB,GAClB,uUAAuU,CAAC;AAC5U,MAAM,eAAe,GACjB,wdAAwd,CAAC;AAO7d,uEAAuE;AACvE,MAAM,UAAU,8BAA8B,CAC1C,KAA+B;IAE/B,MAAM,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC;IACnC,IAAI,CAAC,MAAM;QAAE,OAAO,MAAM,CAAC;IAC3B,IAAI,gBAAgB,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,eAAe,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,WAAW,CAAC,IAAI,CAAC,MAAM,CAAC;QACzF,OAAO,MAAM,CAAC;IAClB,IACI,CAAC,YAAY,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,gBAAgB,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QAC5D,kBAAkB,CAAC,IAAI,CAAC,MAAM,CAAC;QAE/B,OAAO,MAAM,CAAC;IAClB,OAAO,MAAM,CAAC;AAClB,CAAC;AAED,MAAM,CAAC,MAAM,mBAAmB,GAAgB;IAC5C,EAAE,EAAE,qBAAqB;IACzB,SAAS,EAAE,GAAG;IACd,QAAQ,EAAE;QACN,IAAI,EAAE,MAAM;QACZ,YAAY,EACR,8tBAA8tB;QACluB,QAAQ,EAAE;YACN,IAAI,EAAE,+vBAA+vB;YACrwB,KAAK,EAAE,6iBAA6iB;SACvjB;KACJ;IACD,QAAQ,CAAC,KAAyB;QAC9B,OAAO,CAAC,KAAK,CAAC,MAAM,EAAE,GAAG,KAAK,CAAC,kBAAkB,CAAC,CAAC,IAAI,CACnD,MAAM,CAAC,EAAE,CAAC,8BAA8B,CAAC,EAAC,MAAM,EAAC,CAAC,KAAK,MAAM,CAChE,CAAC;IACN,CAAC;CACJ,CAAC"}
@@ -1,27 +0,0 @@
1
- import { type ExtensionAPI } from '@earendil-works/pi-coding-agent';
2
- import { type PromptLoaderRouter } from './prompt-routing.js';
3
- export { detectCoreConceptsPreloadLevel } from '../core-concepts-routing.js';
4
- export type { CoreConceptsPreloadInput, CoreConceptsPreloadLevel } from '../core-concepts-routing.js';
5
- export interface CoreConceptsPreloadDefinition {
6
- docPath: string;
7
- markdown: string;
8
- }
9
- /** System prompt section that grounds the session in the Bkper data model. */
10
- export declare const CORE_CONCEPTS_SECTION = "bkper-core-concepts";
11
- /**
12
- * Display-only session entry marking where the section was loaded. Never sent to the model.
13
- * Sessions saved before the section existed carry custom messages of the same type.
14
- */
15
- export declare const CORE_CONCEPTS_ENTRY_TYPE = "bkper-core-concepts";
16
- export declare function resolveBkperDocPathFromModuleDir(moduleDir: string, relativePath: string): string;
17
- export declare function getCoreConceptsDocPath(): string;
18
- export declare function getDefaultCoreConceptsPreloadDefinition(): CoreConceptsPreloadDefinition;
19
- /**
20
- * Grounds accounting and finance sessions in the Bkper data model through a system
21
- * prompt section. Once loaded, the section is kept for the rest of the session: Pi
22
- * rebuilds the prompt from its base options on every prompt, so a section that is
23
- * not set again would be removed. Pi appends the section as a mid-conversation
24
- * system message, which keeps the cached prefix on models that accept those messages.
25
- */
26
- export declare function registerBkperCoreConceptsPreloadExtension(pi: Pick<ExtensionAPI, 'on' | 'registerEntryRenderer' | 'registerMessageRenderer' | 'appendEntry'>, definition?: CoreConceptsPreloadDefinition, router?: PromptLoaderRouter): void;
27
- //# sourceMappingURL=core-concepts-preload.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"core-concepts-preload.d.ts","sourceRoot":"","sources":["../../../src/agent/extensions/core-concepts-preload.ts"],"names":[],"mappings":"AAGA,OAAO,EAIH,KAAK,YAAY,EAOpB,MAAM,iCAAiC,CAAC;AAGzC,OAAO,EAAiC,KAAK,kBAAkB,EAAC,MAAM,qBAAqB,CAAC;AAE5F,OAAO,EAAC,8BAA8B,EAAC,MAAM,6BAA6B,CAAC;AAC3E,YAAY,EAAC,wBAAwB,EAAE,wBAAwB,EAAC,MAAM,6BAA6B,CAAC;AAEpG,MAAM,WAAW,6BAA6B;IAC1C,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;CACpB;AAED,8EAA8E;AAC9E,eAAO,MAAM,qBAAqB,wBAAwB,CAAC;AAE3D;;;GAGG;AACH,eAAO,MAAM,wBAAwB,wBAAwB,CAAC;AAK9D,wBAAgB,gCAAgC,CAC5C,SAAS,EAAE,MAAM,EACjB,YAAY,EAAE,MAAM,GACrB,MAAM,CAaR;AAOD,wBAAgB,sBAAsB,IAAI,MAAM,CAE/C;AAED,wBAAgB,uCAAuC,IAAI,6BAA6B,CAMvF;AA8ED;;;;;;GAMG;AACH,wBAAgB,yCAAyC,CACrD,EAAE,EAAE,IAAI,CAAC,YAAY,EAAE,IAAI,GAAG,uBAAuB,GAAG,yBAAyB,GAAG,aAAa,CAAC,EAClG,UAAU,GAAE,6BAAyE,EACrF,MAAM,GAAE,kBAAuD,GAChE,IAAI,CA8BN"}