bkper 5.0.0 → 5.2.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 (75) hide show
  1. package/README.md +16 -0
  2. package/lib/agent/extensions/bkper-ai-provider.d.ts.map +1 -1
  3. package/lib/agent/extensions/bkper-ai-provider.js +47 -16
  4. package/lib/agent/extensions/bkper-ai-provider.js.map +1 -1
  5. package/lib/agent/extensions/builtins.d.ts.map +1 -1
  6. package/lib/agent/extensions/builtins.js +10 -2
  7. package/lib/agent/extensions/builtins.js.map +1 -1
  8. package/lib/agent/extensions/startup-logo.d.ts +9 -0
  9. package/lib/agent/extensions/startup-logo.d.ts.map +1 -0
  10. package/lib/agent/extensions/startup-logo.js +96 -0
  11. package/lib/agent/extensions/startup-logo.js.map +1 -0
  12. package/lib/agent/extensions/startup.d.ts.map +1 -1
  13. package/lib/agent/extensions/startup.js +63 -33
  14. package/lib/agent/extensions/startup.js.map +1 -1
  15. package/lib/agent/interactive/prompt-history-store.d.ts +1 -0
  16. package/lib/agent/interactive/prompt-history-store.d.ts.map +1 -1
  17. package/lib/agent/interactive/prompt-history-store.js +19 -5
  18. package/lib/agent/interactive/prompt-history-store.js.map +1 -1
  19. package/lib/agent/interactive/run-agent-mode.d.ts.map +1 -1
  20. package/lib/agent/interactive/run-agent-mode.js +5 -2
  21. package/lib/agent/interactive/run-agent-mode.js.map +1 -1
  22. package/lib/agent/interactive/settings.d.ts +26 -4
  23. package/lib/agent/interactive/settings.d.ts.map +1 -1
  24. package/lib/agent/interactive/settings.js +106 -16
  25. package/lib/agent/interactive/settings.js.map +1 -1
  26. package/lib/agent/interactive/themes.d.ts +13 -0
  27. package/lib/agent/interactive/themes.d.ts.map +1 -0
  28. package/lib/agent/interactive/themes.js +36 -0
  29. package/lib/agent/interactive/themes.js.map +1 -0
  30. package/lib/agent/startup-maintenance.d.ts +7 -4
  31. package/lib/agent/startup-maintenance.d.ts.map +1 -1
  32. package/lib/agent/startup-maintenance.js +13 -29
  33. package/lib/agent/startup-maintenance.js.map +1 -1
  34. package/lib/agent/system-prompt.d.ts.map +1 -1
  35. package/lib/agent/system-prompt.js +19 -7
  36. package/lib/agent/system-prompt.js.map +1 -1
  37. package/lib/agent/themes/bkper-dark.json +80 -0
  38. package/lib/agent/themes/bkper-light.json +80 -0
  39. package/lib/cli.js +6 -2
  40. package/lib/cli.js.map +1 -1
  41. package/lib/commands/agent-command.d.ts.map +1 -1
  42. package/lib/commands/agent-command.js +2 -1
  43. package/lib/commands/agent-command.js.map +1 -1
  44. package/lib/commands/upgrade.d.ts.map +1 -1
  45. package/lib/commands/upgrade.js +2 -3
  46. package/lib/commands/upgrade.js.map +1 -1
  47. package/lib/docs/ai/decision-models.md +316 -0
  48. package/lib/docs/apps/ai.md +120 -88
  49. package/lib/docs/apps/event-handlers.md +12 -0
  50. package/lib/docs/apps/overview.md +1 -1
  51. package/lib/docs/cli/app-management.md +1 -0
  52. package/lib/docs/index.md +2 -1
  53. package/lib/docs/sdk/bkper-api-types.md +4 -2
  54. package/lib/docs/sdk/bkper-js.md +1 -0
  55. package/lib/upgrade/index.d.ts +5 -4
  56. package/lib/upgrade/index.d.ts.map +1 -1
  57. package/lib/upgrade/index.js +3 -2
  58. package/lib/upgrade/index.js.map +1 -1
  59. package/lib/upgrade/installation.d.ts +54 -20
  60. package/lib/upgrade/installation.d.ts.map +1 -1
  61. package/lib/upgrade/installation.js +222 -122
  62. package/lib/upgrade/installation.js.map +1 -1
  63. package/lib/upgrade/update-check.d.ts +69 -0
  64. package/lib/upgrade/update-check.d.ts.map +1 -0
  65. package/lib/upgrade/update-check.js +253 -0
  66. package/lib/upgrade/update-check.js.map +1 -0
  67. package/lib/upgrade/update-worker.d.ts +2 -0
  68. package/lib/upgrade/update-worker.d.ts.map +1 -0
  69. package/lib/upgrade/update-worker.js +6 -0
  70. package/lib/upgrade/update-worker.js.map +1 -0
  71. package/lib/upgrade/upgrade.d.ts +11 -28
  72. package/lib/upgrade/upgrade.d.ts.map +1 -1
  73. package/lib/upgrade/upgrade.js +49 -96
  74. package/lib/upgrade/upgrade.js.map +1 -1
  75. package/package.json +6 -4
@@ -0,0 +1,80 @@
1
+ {
2
+ "$schema": "https://raw.githubusercontent.com/earendil-works/pi/main/packages/coding-agent/src/modes/interactive/theme/theme-schema.json",
3
+ "name": "bkper-dark",
4
+ "appearance": "dark",
5
+ "vars": {
6
+ "text": "okhsl(241 4% 89%)",
7
+ "muted": "okhsl(241 7% 67%)",
8
+ "blue": "okhsl(241 80% 68%)",
9
+ "sky": "okhsl(215 70% 76%)",
10
+ "teal": "okhsl(195 65% 74%)",
11
+ "green": "okhsl(149 68% 68%)",
12
+ "red": "okhsl(30 82% 67%)",
13
+ "yellow": "okhsl(81 96% 76%)",
14
+ "orange": "okhsl(55 92% 72%)",
15
+ "blueBg": "okhsl(241 45% 23%)"
16
+ },
17
+ "colors": {
18
+ "accent": "blue",
19
+ "border": "okhsl(241 60% 58%)",
20
+ "borderAccent": "okhsl(241 80% 66%)",
21
+ "borderMuted": "okhsl(241 8% 50%)",
22
+ "success": "green",
23
+ "error": "red",
24
+ "warning": "yellow",
25
+ "muted": "muted",
26
+ "dim": "okhsl(241 7% 55%)",
27
+ "text": "text",
28
+ "thinkingText": "okhsl(241 7% 65%)",
29
+ "selectedBg": "blueBg",
30
+ "scrollbarTrack": "okhsl(241 7% 33%)",
31
+ "scrollbarThumb": "okhsl(241 7% 65%)",
32
+ "searchMatchBg": "okhsl(81 55% 26%)",
33
+ "searchMatchText": "muted",
34
+ "userMessageBg": "okhsl(241 38% 21%)",
35
+ "userMessageText": "text",
36
+ "customMessageBg": "okhsl(81 35% 20%)",
37
+ "customMessageText": "muted",
38
+ "customMessageLabel": "yellow",
39
+ "toolPendingBg": "okhsl(241 6% 21%)",
40
+ "toolSuccessBg": "okhsl(149 30% 19%)",
41
+ "toolErrorBg": "okhsl(30 45% 21%)",
42
+ "toolTitle": "text",
43
+ "toolOutput": "muted",
44
+ "mdHeading": "yellow",
45
+ "mdLink": "blue",
46
+ "mdLinkUrl": "muted",
47
+ "mdCode": "teal",
48
+ "mdCodeBlock": "green",
49
+ "mdCodeBlockBorder": "muted",
50
+ "mdQuote": "muted",
51
+ "mdQuoteBorder": "muted",
52
+ "mdHr": "muted",
53
+ "mdListBullet": "blue",
54
+ "toolDiffAdded": "green",
55
+ "toolDiffRemoved": "red",
56
+ "toolDiffContext": "muted",
57
+ "syntaxComment": "muted",
58
+ "syntaxKeyword": "blue",
59
+ "syntaxFunction": "yellow",
60
+ "syntaxVariable": "sky",
61
+ "syntaxString": "orange",
62
+ "syntaxNumber": "green",
63
+ "syntaxType": "red",
64
+ "syntaxOperator": "muted",
65
+ "syntaxPunctuation": "muted",
66
+ "thinkingOff": "okhsl(241 6% 42%)",
67
+ "thinkingMinimal": "okhsl(241 18% 48%)",
68
+ "thinkingLow": "okhsl(241 35% 52%)",
69
+ "thinkingMedium": "okhsl(241 55% 57%)",
70
+ "thinkingHigh": "okhsl(241 72% 62%)",
71
+ "thinkingXhigh": "okhsl(236 92% 67%)",
72
+ "thinkingMax": "okhsl(30 92% 62%)",
73
+ "bashMode": "okhsl(149 70% 62%)"
74
+ },
75
+ "export": {
76
+ "pageBg": "okhsl(241 14% 15%)",
77
+ "cardBg": "okhsl(241 13% 18%)",
78
+ "infoBg": "okhsl(81 45% 22%)"
79
+ }
80
+ }
@@ -0,0 +1,80 @@
1
+ {
2
+ "$schema": "https://raw.githubusercontent.com/earendil-works/pi/main/packages/coding-agent/src/modes/interactive/theme/theme-schema.json",
3
+ "name": "bkper-light",
4
+ "appearance": "light",
5
+ "vars": {
6
+ "text": "okhsl(241 6% 25%)",
7
+ "muted": "okhsl(241 8% 46%)",
8
+ "blue": "okhsl(241 85% 45%)",
9
+ "sky": "okhsl(215 80% 44%)",
10
+ "teal": "okhsl(195 90% 38%)",
11
+ "green": "okhsl(149 85% 42%)",
12
+ "red": "okhsl(30 90% 46%)",
13
+ "yellow": "okhsl(78 100% 47%)",
14
+ "orange": "okhsl(55 95% 48%)",
15
+ "blueBg": "okhsl(241 40% 91%)"
16
+ },
17
+ "colors": {
18
+ "accent": "blue",
19
+ "border": "okhsl(241 70% 55%)",
20
+ "borderAccent": "okhsl(241 85% 50%)",
21
+ "borderMuted": "okhsl(241 8% 70%)",
22
+ "success": "green",
23
+ "error": "red",
24
+ "warning": "yellow",
25
+ "muted": "muted",
26
+ "dim": "okhsl(241 7% 58%)",
27
+ "text": "text",
28
+ "thinkingText": "okhsl(241 8% 55%)",
29
+ "selectedBg": "blueBg",
30
+ "scrollbarTrack": "okhsl(241 4% 90%)",
31
+ "scrollbarThumb": "okhsl(241 7% 65%)",
32
+ "searchMatchBg": "okhsl(81 45% 88%)",
33
+ "searchMatchText": "muted",
34
+ "userMessageBg": "okhsl(241 45% 93%)",
35
+ "userMessageText": "text",
36
+ "customMessageBg": "okhsl(81 60% 92%)",
37
+ "customMessageText": "muted",
38
+ "customMessageLabel": "orange",
39
+ "toolPendingBg": "okhsl(241 5% 93%)",
40
+ "toolSuccessBg": "okhsl(149 35% 93%)",
41
+ "toolErrorBg": "okhsl(30 45% 93%)",
42
+ "toolTitle": "text",
43
+ "toolOutput": "muted",
44
+ "mdHeading": "yellow",
45
+ "mdLink": "blue",
46
+ "mdLinkUrl": "muted",
47
+ "mdCode": "teal",
48
+ "mdCodeBlock": "green",
49
+ "mdCodeBlockBorder": "muted",
50
+ "mdQuote": "muted",
51
+ "mdQuoteBorder": "muted",
52
+ "mdHr": "muted",
53
+ "mdListBullet": "blue",
54
+ "toolDiffAdded": "green",
55
+ "toolDiffRemoved": "red",
56
+ "toolDiffContext": "muted",
57
+ "syntaxComment": "muted",
58
+ "syntaxKeyword": "blue",
59
+ "syntaxFunction": "yellow",
60
+ "syntaxVariable": "sky",
61
+ "syntaxString": "orange",
62
+ "syntaxNumber": "green",
63
+ "syntaxType": "red",
64
+ "syntaxOperator": "muted",
65
+ "syntaxPunctuation": "muted",
66
+ "thinkingOff": "okhsl(241 5% 80%)",
67
+ "thinkingMinimal": "okhsl(241 15% 74%)",
68
+ "thinkingLow": "okhsl(241 35% 66%)",
69
+ "thinkingMedium": "okhsl(241 55% 58%)",
70
+ "thinkingHigh": "okhsl(241 75% 52%)",
71
+ "thinkingXhigh": "okhsl(236 92% 48%)",
72
+ "thinkingMax": "okhsl(30 92% 52%)",
73
+ "bashMode": "okhsl(149 75% 50%)"
74
+ },
75
+ "export": {
76
+ "pageBg": "okhsl(241 5% 95%)",
77
+ "cardBg": "okhsl(241 6% 98%)",
78
+ "infoBg": "okhsl(81 50% 92%)"
79
+ }
80
+ }
package/lib/cli.js CHANGED
@@ -24,12 +24,12 @@ import { registerUpgradeCommand } from './commands/upgrade.js';
24
24
  import { registerOutputOptions } from './commands/cli-helpers.js';
25
25
  import { getAgentCommandArgs, shouldRunAgentCommand, shouldShowHelpForBareInvocation, } from './agent/cli-dispatch.js';
26
26
  import { runAgentCommandInChild } from './agent/agent-command-runner.js';
27
- import { VERSION } from './upgrade/index.js';
27
+ import { VERSION, runCommandUpdateCheck } from './upgrade/index.js';
28
28
  import { getUnsupportedNodeVersionMessage } from './utils/node-version.js';
29
29
  function registerAgentCommands(command) {
30
30
  command
31
31
  .command('agent [piArgs...]')
32
- .description('Start Bkper Agent or run Pi CLI with Bkper defaults')
32
+ .description('Start Bkper Agent, or run Pi CLI commands as `bkper agent <command>` (e.g. `bkper agent mcp add`)')
33
33
  .allowUnknownOption(true)
34
34
  .allowExcessArguments(true);
35
35
  }
@@ -50,6 +50,10 @@ function main() {
50
50
  process.exit(1);
51
51
  }
52
52
  }
53
+ // Daily background update check (never blocks, installs only safe global copies)
54
+ if (process.argv[2] !== 'upgrade') {
55
+ runCommandUpdateCheck();
56
+ }
53
57
  // Version
54
58
  program.name('bkper');
55
59
  program.version(VERSION, '-v, --version');
package/lib/cli.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";;;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W,wBAAwB;IACrC,KAAK,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACzC,kBAAkB,EAAE,CAAC,OAAO,CAAC,EAAE,cAAc,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAChE,WAAW,CAAC,EAAE,uBAAuB,CAAC;CACzC;AAwGD,wBAAsB,eAAe,CACjC,MAAM,EAAE,MAAM,EAAE,EAChB,YAAY,GAAE,wBAAsD,GACrE,OAAO,CAAC,IAAI,CAAC,CAmCf;AAED,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAM5D"}
1
+ {"version":3,"file":"agent-command.d.ts","sourceRoot":"","sources":["../../src/commands/agent-command.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEzC,OAAO,EAGH,KAAK,cAAc,EACtB,MAAM,wCAAwC,CAAC;AAGhD,MAAM,WAAW,uBAAuB;IACpC,UAAU,EAAE,OAAO,CAAC;IACpB,WAAW,EAAE,OAAO,CAAC;CACxB;AAED,MAAM,WAAW,wBAAwB;IACrC,KAAK,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACzC,kBAAkB,EAAE,CAAC,OAAO,CAAC,EAAE,cAAc,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAChE,WAAW,CAAC,EAAE,uBAAuB,CAAC;CACzC;AAyGD,wBAAsB,eAAe,CACjC,MAAM,EAAE,MAAM,EAAE,EAChB,YAAY,GAAE,wBAAsD,GACrE,OAAO,CAAC,IAAI,CAAC,CAmCf;AAED,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAQ5D"}
@@ -76,6 +76,7 @@ const PI_MANAGEMENT_COMMANDS = new Set([
76
76
  'update',
77
77
  'list',
78
78
  'config',
79
+ 'mcp',
79
80
  ]);
80
81
  function isPiManagementCommand(args) {
81
82
  const [command] = args;
@@ -135,7 +136,7 @@ export function runAgentCommand(piArgs_1) {
135
136
  export function registerAgentCommands(program) {
136
137
  program
137
138
  .command('agent [piArgs...]')
138
- .description('Start Bkper Agent or run Pi CLI with Bkper defaults')
139
+ .description('Start Bkper Agent, or run Pi CLI commands as `bkper agent <command>` (e.g. `bkper agent mcp add`)')
139
140
  .allowUnknownOption(true)
140
141
  .allowExcessArguments(true);
141
142
  }
@@ -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,iCAAiC,CAAC;AACpE,OAAO,EACH,2BAA2B,EAC3B,YAAY,GAEf,MAAM,wCAAwC,CAAC;AAChD,OAAO,EAAE,yBAAyB,EAAE,MAAM,2BAA2B,CAAC;AAatE,kFAAkF;AAClF,2EAA2E;AAC3E,MAAM,+BAA+B,GAA4B;IAC7D,UAAU,EAAE,IAAI;IAChB,WAAW,EAAE,IAAI;CACpB,CAAC;AAEF,SAAS,yBAAyB;IAC9B,OAAO;QACH,KAAK,EAAE,CAAC,IAAc,EAAE,EAAE,CAAC,SAAS,CAAC,IAAI,CAAC;QAC1C,kBAAkB,EAAE,CAAC,OAAO,EAAE,EAAE,CAAC,YAAY,CAAC,2BAA2B,CAAC,OAAO,CAAC,CAAC;QACnF,WAAW,EAAE;YACT,UAAU,EAAE,OAAO,CAAC,KAAK,CAAC,KAAK,KAAK,IAAI;YACxC,WAAW,EAAE,OAAO,CAAC,MAAM,CAAC,KAAK,KAAK,IAAI;SAC7C;KACJ,CAAC;AACN,CAAC;AAED,SAAS,6BAA6B,CAAC,YAAsC;;IACzE,MAAM,WAAW,GAAG,MAAA,YAAY,CAAC,WAAW,mCAAI,+BAA+B,CAAC;IAChF,OAAO,WAAW,CAAC,UAAU,IAAI,WAAW,CAAC,WAAW,CAAC;AAC7D,CAAC;AAED,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B,EAAE,CAAC;YACzD,2EAA2E;YAC3E,iEAAiE;YACjE,MAAM,IAAI,GAAG,WAAW,CAAC,MAAM,CAAC,CAAC;YACjC,MAAM,YAAY,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;YAC/B,OAAO;QACX,CAAC;QAED,MAAM,YAAY,CAAC,kBAAkB,CAAC,OAAO,CAAC,CAAC;IACnD,CAAC;CAAA;AAED,MAAM,UAAU,qBAAqB,CAAC,OAAgB;IAClD,OAAO;SACF,OAAO,CAAC,mBAAmB,CAAC;SAC5B,WAAW,CACR,mGAAmG,CACtG;SACA,kBAAkB,CAAC,IAAI,CAAC;SACxB,oBAAoB,CAAC,IAAI,CAAC,CAAC;AACpC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"upgrade.d.ts","sourceRoot":"","sources":["../../src/commands/upgrade.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAGzC,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAQ7D"}
1
+ {"version":3,"file":"upgrade.d.ts","sourceRoot":"","sources":["../../src/commands/upgrade.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAGzC,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAO7D"}
@@ -12,9 +12,8 @@ export function registerUpgradeCommand(program) {
12
12
  program
13
13
  .command('upgrade [version]')
14
14
  .description('Upgrade bkper CLI to the latest version')
15
- .option('--method <method>', 'Override install method detection (npm, bun, yarn)')
16
- .action((version, options) => __awaiter(this, void 0, void 0, function* () {
17
- yield foregroundUpgrade(version, options.method);
15
+ .action((version) => __awaiter(this, void 0, void 0, function* () {
16
+ yield foregroundUpgrade(version);
18
17
  }));
19
18
  }
20
19
  //# sourceMappingURL=upgrade.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"upgrade.js","sourceRoot":"","sources":["../../src/commands/upgrade.ts"],"names":[],"mappings":";;;;;;;;;AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAExD,MAAM,UAAU,sBAAsB,CAAC,OAAgB;IACnD,OAAO;SACF,OAAO,CAAC,mBAAmB,CAAC;SAC5B,WAAW,CAAC,yCAAyC,CAAC;SACtD,MAAM,CAAC,mBAAmB,EAAE,oDAAoD,CAAC;SACjF,MAAM,CAAC,CAAO,OAA2B,EAAE,OAA4B,EAAE,EAAE;QACxE,MAAM,iBAAiB,CAAC,OAAO,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC;IACrD,CAAC,CAAA,CAAC,CAAC;AACX,CAAC"}
1
+ {"version":3,"file":"upgrade.js","sourceRoot":"","sources":["../../src/commands/upgrade.ts"],"names":[],"mappings":";;;;;;;;;AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAExD,MAAM,UAAU,sBAAsB,CAAC,OAAgB;IACnD,OAAO;SACF,OAAO,CAAC,mBAAmB,CAAC;SAC5B,WAAW,CAAC,yCAAyC,CAAC;SACtD,MAAM,CAAC,CAAO,OAA2B,EAAE,EAAE;QAC1C,MAAM,iBAAiB,CAAC,OAAO,CAAC,CAAC;IACrC,CAAC,CAAA,CAAC,CAAC;AACX,CAAC"}
@@ -0,0 +1,316 @@
1
+ # Decision Models
2
+
3
+ A decision model answers bounded questions about a state. Each answer is typed: the probability that a statement is true, one option from a set you define, or a level on a scale you define. The model writes no text. The model evaluates; your code decides.
4
+
5
+ `POST /v1/decisions` serves decision models: models trained for calibrated decisions. [Jev](#jev-by-typesafe), from TypeSafe, is the first. The interface and its concepts come from TypeSafe's [System One](https://docs.typesafe.ai/concepts/system-one) API, and their documentation is a good companion to this page.
6
+
7
+ ## When to use a decision model
8
+
9
+ | When your code needs | Use |
10
+ | ------------------------------------------------------------- | --------------------------------------------------------------- |
11
+ | A yes/no, one of known options, or a level on a scale | A decision model |
12
+ | Text, explanations, code, tool calls, or a custom JSON object | A [language model](https://bkper.com/docs/ai/ai-gateway.md#send-a-complete-request) |
13
+
14
+ Why decision models suit accounting operations is covered in [AI Fundamentals](https://bkper.com/docs/ai/fundamentals.md#decision-models).
15
+
16
+ ## How a request works
17
+
18
+ A request has one **state** and one or more **questions**. The state is what the model judges: a string, JSON object, or array. Prefer an object with descriptive field names. Decision models currently read text only, so convert images and files to text first.
19
+
20
+ The model evaluates each question independently, in parallel, against the same state, and returns one typed answer per question. There are three question types:
21
+
22
+ - **`noul`** — _Is this true?_ Optional `criteria` describe what yes and no mean. Returns `noul`, the probability of yes from 0 to 1.
23
+ - **`choice`** — _Which one of these?_ `criteria` maps 1–255 options to descriptions, or `null`. Returns the `choice` with `probabilities` and `confidence`.
24
+ - **`score`** — _Which level on this scale?_ `criteria` lists 2–10 levels, lowest first. Returns a weighted `score` with `legend`, `probabilities`, and `confidence`.
25
+
26
+ Ask one snap judgment per question — something a knowledgeable person decides in seconds. Split bigger judgments into several questions and combine the answers in code. Keep arithmetic, balances, and date comparisons in code too, and ask the model only the part that needs judgment. See TypeSafe's [Primitives](https://docs.typesafe.ai/primitives) and [State](https://docs.typesafe.ai/concepts/state).
27
+
28
+ ## Send a request
29
+
30
+ For an incoming bank line, this request asks three questions at once: which Account it belongs to, whether it is already recorded, and how urgently it needs review.
31
+
32
+ ```bash
33
+ curl --fail-with-body https://ai.bkper.app/v1/decisions \
34
+ -H "Authorization: Bearer ${BKPER_TOKEN}" \
35
+ -H "Content-Type: application/json" \
36
+ -H "bkper-ai-source: my-app" \
37
+ --data '{
38
+ "model": "jev",
39
+ "state": {
40
+ "bank_line": {
41
+ "date": "2025-03-11",
42
+ "description": "AMAZON MKTPL*2K4LM",
43
+ "amount": 89.90,
44
+ "direction": "money out of Checking"
45
+ },
46
+ "existing_transaction": {
47
+ "date": "2025-03-10",
48
+ "amount": 89.90,
49
+ "from": "Checking",
50
+ "to": "Office Supplies",
51
+ "description": "Printer toner, Amazon order 114-2K4LM",
52
+ "origin": "manual entry"
53
+ }
54
+ },
55
+ "questions": {
56
+ "account": {
57
+ "type": "choice",
58
+ "instructions": "Which Account should receive the money that left Checking in `bank_line`?",
59
+ "criteria": {
60
+ "Cloud Hosting": "Servers, cloud infrastructure, storage, and hosting providers",
61
+ "Software Subscriptions": "SaaS tools and per-seat software licenses",
62
+ "Office Supplies": "Physical supplies and equipment for the office",
63
+ "Travel": "Flights, hotels, ground transport, and meals while traveling"
64
+ }
65
+ },
66
+ "already_recorded": {
67
+ "type": "noul",
68
+ "instructions": "Does `existing_transaction` already record the movement in `bank_line`?"
69
+ },
70
+ "review_priority": {
71
+ "type": "score",
72
+ "instructions": "How urgently should a bookkeeper review `bank_line`?",
73
+ "criteria": [
74
+ "Routine: consistent with normal activity",
75
+ "Check: unusual but plausibly legitimate",
76
+ "Urgent: large, unapproved, or suspicious"
77
+ ]
78
+ }
79
+ }
80
+ }'
81
+ ```
82
+
83
+ - **`model`** — any model with `type: "decision"` in [`GET /v1/models`](https://bkper.com/docs/ai/ai-gateway.md#model-ids). Each entry lists its `question_types`, `context_window`, and `max_state_question_tokens`.
84
+ - **Question IDs** such as `account` are yours. Answers come back under the same IDs, but **IDs are not sent to the model**, so each `instructions` must stand on its own.
85
+ - **Refer to state fields by name** in backticks, as in `` `bank_line` ``.
86
+ - Each question accepts only `type`, `instructions`, and `criteria`. Instructions, descriptions, and levels can be strings or [structured JSON](https://docs.typesafe.ai/primitives/advanced).
87
+
88
+ ## Read the response
89
+
90
+ A real response to the request above:
91
+
92
+ ```json
93
+ {
94
+ "model": "jev-1.13.0",
95
+ "answers": {
96
+ "account": {
97
+ "type": "choice",
98
+ "choice": "Office Supplies",
99
+ "confidence": 1,
100
+ "probabilities": {
101
+ "Office Supplies": 1,
102
+ "Cloud Hosting": 0,
103
+ "Travel": 0,
104
+ "Software Subscriptions": 0
105
+ }
106
+ },
107
+ "already_recorded": {
108
+ "type": "noul",
109
+ "noul": 0.89
110
+ },
111
+ "review_priority": {
112
+ "type": "score",
113
+ "score": 0.09,
114
+ "confidence": 0.86,
115
+ "legend": {
116
+ "0": "Routine: consistent with normal activity",
117
+ "1": "Check: unusual but plausibly legitimate",
118
+ "2": "Urgent: large, unapproved, or suspicious"
119
+ },
120
+ "probabilities": {
121
+ "0": 0.91,
122
+ "1": 0.09,
123
+ "2": 0
124
+ }
125
+ }
126
+ },
127
+ "usage": { "input_tokens": 607, "output_tokens": 86 }
128
+ }
129
+ ```
130
+
131
+ Bkper validates every answer before returning it, so your code can rely on these guarantees:
132
+
133
+ - `answers` has exactly one entry per question ID, and each answer's `type` matches its question.
134
+ - `choice` is always one of your `criteria` keys.
135
+ - `score` is the probability-weighted level, from `0` to the number of levels minus one. It can fall between levels.
136
+ - `probabilities` has one entry per option or level, and `legend` maps level indexes back to your text. Read both by key: order is not guaranteed, and values can be exactly `0` or `1`.
137
+ - `confidence`, on choice and score answers, runs from 0 to 1 and is higher when probability concentrates on one answer. Noul answers have no `confidence`; the probability itself is the signal. See TypeSafe's [Confidence](https://docs.typesafe.ai/confidence).
138
+ - `model` is the concrete revision that answered, such as `jev-1.13.0`.
139
+
140
+ Usage counts against your allowance at the model's [usage rates](https://bkper.com/docs/ai/models.md#usage-rates).
141
+
142
+ ### Context changes confidence
143
+
144
+ Ask about the same bank line without `existing_transaction`:
145
+
146
+ ```json
147
+ {
148
+ "model": "jev",
149
+ "state": {
150
+ "bank_line": {
151
+ "date": "2025-03-11",
152
+ "description": "AMAZON MKTPL*2K4LM",
153
+ "amount": 89.9,
154
+ "direction": "money out of Checking"
155
+ }
156
+ },
157
+ "questions": {
158
+ "account": {
159
+ "type": "choice",
160
+ "instructions": "Which Account should receive the money that left Checking in `bank_line`?",
161
+ "criteria": {
162
+ "Cloud Hosting": "Servers, cloud infrastructure, storage, and hosting providers",
163
+ "Software Subscriptions": "SaaS tools and per-seat software licenses",
164
+ "Office Supplies": "Physical supplies and equipment for the office",
165
+ "Travel": "Flights, hotels, ground transport, and meals while traveling"
166
+ }
167
+ }
168
+ }
169
+ }
170
+ ```
171
+
172
+ ```json
173
+ {
174
+ "model": "jev-1.13.0",
175
+ "answers": {
176
+ "account": {
177
+ "type": "choice",
178
+ "choice": "Office Supplies",
179
+ "confidence": 0.75,
180
+ "probabilities": {
181
+ "Software Subscriptions": 0.14,
182
+ "Cloud Hosting": 0.02,
183
+ "Office Supplies": 0.81,
184
+ "Travel": 0.02
185
+ }
186
+ }
187
+ },
188
+ "usage": { "input_tokens": 440, "output_tokens": 52 }
189
+ }
190
+ ```
191
+
192
+ The top option is the same, but confidence drops from 1 to 0.75: the model reports that it is less sure.
193
+
194
+ Give the model the context a person would need, such as nearby Transactions, how an Account is usually described, or Book and Account properties. Select that context in code. For example, find Transactions with the same amount inside a date window, then ask the model only whether the descriptions describe the same movement.
195
+
196
+ ## Turn answers into decisions
197
+
198
+ An answer is a judgment, not permission to change a Book. Your code owns the thresholds and the actions, and sends uncertain cases to a person. This is TypeSafe's [confidence-gated routing](https://docs.typesafe.ai/patterns/confidence-routing) pattern:
199
+
200
+ ```ts
201
+ // Keep questions and thresholds in one reviewable place.
202
+ const DUPLICATE_THRESHOLD = 0.8;
203
+ const REVIEW_SCORE_THRESHOLD = 1.5;
204
+ const AUTO_POST_CONFIDENCE = 0.9;
205
+
206
+ interface BankLineAnswers {
207
+ account: { type: 'choice'; choice: string; confidence: number };
208
+ already_recorded: { type: 'noul'; noul: number };
209
+ review_priority: { type: 'score'; score: number; confidence: number };
210
+ }
211
+
212
+ type BankLineDecision =
213
+ | { action: 'check-duplicate' }
214
+ | { action: 'review'; suggestedAccount: string }
215
+ | { action: 'post'; toAccount: string; confidence: number };
216
+
217
+ export function decideBankLine(answers: BankLineAnswers): BankLineDecision {
218
+ if (answers.already_recorded.noul >= DUPLICATE_THRESHOLD) {
219
+ return { action: 'check-duplicate' };
220
+ }
221
+ if (
222
+ answers.review_priority.score >= REVIEW_SCORE_THRESHOLD ||
223
+ answers.account.confidence < AUTO_POST_CONFIDENCE
224
+ ) {
225
+ return { action: 'review', suggestedAccount: answers.account.choice };
226
+ }
227
+ return {
228
+ action: 'post',
229
+ toAccount: answers.account.choice,
230
+ confidence: answers.account.confidence,
231
+ };
232
+ }
233
+ ```
234
+
235
+ The first response returns `check-duplicate`: the movement is probably already recorded. The bank line on its own, at 0.75 confidence, goes to `review`.
236
+
237
+ When your code does post, it creates a normal Transaction from `Checking` to the chosen Account, so the Book stays zero-sum whatever the model answered. The risks to control are a wrong Account and a duplicate movement, which is why those checks come before posting. Store `model` and `confidence` as Transaction properties for the audit trail.
238
+
239
+ Start with conservative thresholds, test them against your own records, and re-check them when the returned `model` changes. For more designs, see TypeSafe's [Patterns](https://docs.typesafe.ai/patterns) and [Cookbooks](https://docs.typesafe.ai/cookbooks), and the open-source [Merge Duplicates app](https://github.com/bkper/bkper-apps/tree/main/merge-duplicates), which suggests duplicate pairs for human review.
240
+
241
+ ## Call from code
242
+
243
+ TypeSafe's JavaScript SDK, `@typesafe-ai/sdk`, works with Bkper AI and infers answer types from your questions. Any other HTTP client can call `POST /v1/decisions` directly:
244
+
245
+ - **In a Bkper Platform app Worker**, send no `Authorization` header. Platform outbound adds authorization and app attribution.
246
+ - **In scripts and servers**, send your own Bkper access token as a bearer token.
247
+ - **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
+ 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.
250
+
251
+ ## Errors and retries
252
+
253
+ Errors use the same envelope as every [Bkper AI endpoint](https://bkper.com/docs/ai/ai-gateway.md#errors). Branch on `error.code`, not only on the HTTP status:
254
+
255
+ ```json
256
+ {
257
+ "error": {
258
+ "message": "Unknown field: questions.route.threshold.",
259
+ "type": "invalid_request_error",
260
+ "param": "questions.route.threshold",
261
+ "code": "invalid_request"
262
+ }
263
+ }
264
+ ```
265
+
266
+ | Status | `error.code` | What to do |
267
+ | ----------- | ---------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------- |
268
+ | `400` | `invalid_request`, `missing_model`, `unsupported_model`, `invalid_state`, `invalid_questions`, `invalid_question`, `unsupported_question_type` | Fix the field named in `error.param`. Do not retry unchanged. |
269
+ | `400` | `provider_rejected` | The model rejected the request. Check its size against the model's limits. |
270
+ | `401`–`403` | `unauthorized`, `billing_overdue`, `entitlement_unavailable` | Fix authentication or account access. Do not retry. |
271
+ | `429` | `usage_limit_exceeded` | The monthly allowance is exhausted. Do not retry. |
272
+ | `429` | `provider_rate_limited` | Retry with backoff. Honor `retry-after` when present. |
273
+ | `503` | `provider_overloaded`, `usage_unavailable` | Retry with backoff. Honor `retry-after` when present. |
274
+ | `502` | `provider_error`, `provider_rejected` | Retry a limited number of times, then fail. |
275
+
276
+ ## Caching
277
+
278
+ Bkper caches decision results for 15 minutes per user. An identical request in that window returns the same answers without calling the model or consuming allowance, and repeats the original `usage`. Aliases of the same model share one cache entry. To get fresh answers, change the request or wait. See [Privacy, retention, and caching](https://bkper.com/docs/ai/ai-gateway.md#privacy-retention-and-caching).
279
+
280
+ ## Common mistakes
281
+
282
+ - **Sending Responses fields.** The body accepts only `model`, `state`, and `questions`. `input`, `stream`, `store`, `temperature`, and `metadata` are rejected.
283
+ - **Putting the question in the ID.** The model never sees IDs. Write the full question in `instructions`.
284
+ - **Asking for analysis.** Ask one snap judgment per question and combine answers in code.
285
+ - **Asking the model to calculate.** Match amounts, compute date windows, and check balances in code.
286
+ - **Treating `noul` as a boolean or `score` as an integer.** Both are continuous. Compare them with thresholds.
287
+ - **Expecting an explanation.** Decision models return no text. Use a [language model](https://bkper.com/docs/ai/ai-gateway.md) when you need one.
288
+
289
+ ## Jev by TypeSafe
290
+
291
+ [Jev](https://docs.typesafe.ai/introduction) is TypeSafe's flagship model and the first System One model. Its Bkper model ID is `jev`.
292
+
293
+ - **Versions.** `jev-latest` and versioned IDs are accepted but always select the current Jev; you cannot pin a version. Log the returned `model`, and re-check tuned thresholds when it changes.
294
+ - **Input.** Text only. English is Jev's primary training language; other languages work with lower accuracy.
295
+ - **Known weak spots.** Literal reading, arithmetic, date comparison, and large states full of irrelevant detail. See [Jev 1.13 jaggedness](https://docs.typesafe.ai/model-jaggedness/jev-1.13).
296
+
297
+ ### Differences from the TypeSafe API
298
+
299
+ Request and answer shapes match TypeSafe's [`POST /v1/systemone`](https://docs.typesafe.ai/api), so TypeSafe's guidance on questions, state, confidence, and patterns applies unchanged. Only the surroundings differ:
300
+
301
+ - **Endpoint and authentication.** Call `https://ai.bkper.app/v1/decisions` with a Bkper access token. TypeSafe API keys do not work here.
302
+ - **SDKs.** TypeSafe SDKs work with base URL `https://ai.bkper.app` and a Bkper access token. See [Call from code](#call-from-code).
303
+ - **Errors.** Bkper returns `400` where TypeSafe returns `422`, and `503` with `provider_overloaded` where TypeSafe returns `529`. A `429` can also mean your Bkper AI allowance is exhausted.
304
+ - **Usage.** Requests count against your [Bkper AI allowance](https://bkper.com/docs/ai/models.md#how-usage-works), not a TypeSafe account.
305
+
306
+ ### Build with a coding agent
307
+
308
+ TypeSafe's [agent skill](https://docs.typesafe.ai/agent-skill) gives coding agents context on questions and patterns. When you use it for a Bkper integration, point the agent to this page — `https://bkper.com/docs/ai/decision-models.md` — for the endpoint, authentication, model ID, and errors.
309
+
310
+ ## Learn more
311
+
312
+ - [`createDecision` API reference](https://bkper.com/docs/api/ai/operations/createdecision.md) — the field-by-field contract.
313
+ - [Models and Usage](https://bkper.com/docs/ai/models.md) — decision models, limits, and usage rates.
314
+ - [Bkper AI Gateway](https://bkper.com/docs/ai/ai-gateway.md) — access, tokens, and privacy.
315
+ - [Add Bkper AI to an App](https://bkper.com/docs/platform/apps/ai.md) — TypeSafe SDK setup for apps and scripts.
316
+ - TypeSafe: [System One](https://docs.typesafe.ai/concepts/system-one), [AI primer](https://docs.typesafe.ai/introduction/machine-learning-primer), [Primitives](https://docs.typesafe.ai/primitives), [State](https://docs.typesafe.ai/concepts/state), [Confidence](https://docs.typesafe.ai/confidence), and [Patterns](https://docs.typesafe.ai/patterns).