bkper 4.25.0 → 4.26.1
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 +1 -1
- package/lib/agent/extensions/handoff.d.ts.map +1 -1
- package/lib/agent/extensions/handoff.js +2 -0
- package/lib/agent/extensions/handoff.js.map +1 -1
- package/lib/agent/startup-maintenance.d.ts +1 -0
- package/lib/agent/startup-maintenance.d.ts.map +1 -1
- package/lib/agent/startup-maintenance.js +7 -1
- package/lib/agent/startup-maintenance.js.map +1 -1
- package/lib/agent/system-prompt.js +1 -1
- package/lib/commands/apps/git/clone.js +1 -1
- package/lib/commands/apps/git/clone.js.map +1 -1
- package/lib/commands/apps/init.d.ts +3 -1
- package/lib/commands/apps/init.d.ts.map +1 -1
- package/lib/commands/apps/init.js +105 -58
- package/lib/commands/apps/init.js.map +1 -1
- package/lib/commands/apps/register.js +2 -2
- package/lib/commands/apps/register.js.map +1 -1
- package/lib/dev/local-outbound.d.ts.map +1 -1
- package/lib/dev/local-outbound.js +17 -3
- package/lib/dev/local-outbound.js.map +1 -1
- package/lib/dev/miniflare.js +1 -1
- package/lib/dev/miniflare.js.map +1 -1
- package/lib/dev/preflight.js +1 -1
- package/lib/dev/preflight.js.map +1 -1
- package/lib/dev/shared.js +1 -1
- package/lib/dev/shared.js.map +1 -1
- package/lib/docs/apps/ai.md +270 -0
- package/lib/docs/apps/app-listing.md +86 -0
- package/lib/docs/apps/architecture.md +188 -0
- package/lib/docs/apps/configuration.md +171 -0
- package/lib/docs/apps/context-menu.md +69 -0
- package/lib/docs/apps/deploying.md +181 -0
- package/lib/docs/apps/development.md +122 -0
- package/lib/docs/apps/event-handlers.md +248 -0
- package/lib/docs/apps/first-app.md +76 -0
- package/lib/docs/apps/overview.md +106 -0
- package/lib/docs/apps/self-hosted.md +63 -0
- package/lib/docs/apps/shared-app-source.md +85 -0
- package/lib/docs/cli/app-management.md +16 -4
- package/lib/docs/index.md +12 -1
- package/lib/docs/sdk/bkper-js.md +5 -0
- package/lib/upgrade/index.d.ts +1 -1
- package/lib/upgrade/index.d.ts.map +1 -1
- package/lib/upgrade/index.js +1 -1
- package/lib/upgrade/index.js.map +1 -1
- package/lib/upgrade/installation.d.ts +4 -0
- package/lib/upgrade/installation.d.ts.map +1 -1
- package/lib/upgrade/installation.js +23 -0
- package/lib/upgrade/installation.js.map +1 -1
- package/package.json +3 -3
- package/lib/docs/apps/app-building.md +0 -1429
|
@@ -10,6 +10,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
10
10
|
import { AUTHENTICATION_REQUIRED_MESSAGE } from '../auth/auth-errors.js';
|
|
11
11
|
import { getStoredOAuthToken } from '../auth/local-auth-service.js';
|
|
12
12
|
const PUBLIC_BKPER_API_HOST = 'api.bkper.app';
|
|
13
|
+
const BKPER_AI_HOSTS = new Set(['ai.bkper.app', 'ai-dev.bkper.app']);
|
|
13
14
|
const PLATFORM_SESSION_COOKIE_NAMES = new Set([
|
|
14
15
|
'bkper_session',
|
|
15
16
|
'bkper_session_dev',
|
|
@@ -20,7 +21,8 @@ export function createLocalOutboundService(options) {
|
|
|
20
21
|
const getAccessToken = (_a = options.getAccessToken) !== null && _a !== void 0 ? _a : getStoredOAuthToken;
|
|
21
22
|
const forwardFetch = (_b = options.forwardFetch) !== null && _b !== void 0 ? _b : ((request) => fetch(request));
|
|
22
23
|
return (request) => __awaiter(this, void 0, void 0, function* () {
|
|
23
|
-
|
|
24
|
+
const service = getAuthorizedBkperService(request);
|
|
25
|
+
if (!service) {
|
|
24
26
|
return forwardFetch(createForwardRequest(request, new Headers(request.headers), request.redirect));
|
|
25
27
|
}
|
|
26
28
|
const accessToken = normalizeBearerToken(yield getAccessToken());
|
|
@@ -33,6 +35,9 @@ export function createLocalOutboundService(options) {
|
|
|
33
35
|
const headers = new Headers(request.headers);
|
|
34
36
|
headers.set('Authorization', `Bearer ${accessToken}`);
|
|
35
37
|
headers.set('bkper-agent-id', options.appId);
|
|
38
|
+
if (service === 'ai') {
|
|
39
|
+
headers.set('bkper-ai-source', options.appId);
|
|
40
|
+
}
|
|
36
41
|
stripPlatformCookieHeaders(headers);
|
|
37
42
|
return forwardFetch(createForwardRequest(request, headers, 'manual'));
|
|
38
43
|
});
|
|
@@ -51,9 +56,18 @@ function createForwardRequest(request, headers, redirect) {
|
|
|
51
56
|
}
|
|
52
57
|
return new Request(request.url, init);
|
|
53
58
|
}
|
|
54
|
-
function
|
|
59
|
+
function getAuthorizedBkperService(request) {
|
|
55
60
|
const url = new URL(request.url);
|
|
56
|
-
|
|
61
|
+
if (url.protocol !== 'https:') {
|
|
62
|
+
return undefined;
|
|
63
|
+
}
|
|
64
|
+
if (url.host === PUBLIC_BKPER_API_HOST) {
|
|
65
|
+
return 'api';
|
|
66
|
+
}
|
|
67
|
+
if (BKPER_AI_HOSTS.has(url.host)) {
|
|
68
|
+
return 'ai';
|
|
69
|
+
}
|
|
70
|
+
return undefined;
|
|
57
71
|
}
|
|
58
72
|
function normalizeBearerToken(token) {
|
|
59
73
|
const trimmed = token === null || token === void 0 ? void 0 : token.trim();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"local-outbound.js","sourceRoot":"","sources":["../../src/dev/local-outbound.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,+BAA+B,EAAE,MAAM,wBAAwB,CAAC;AACzE,OAAO,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AAEpE,MAAM,qBAAqB,GAAG,eAAe,CAAC;AAC9C,MAAM,6BAA6B,GAAG,IAAI,GAAG,CAAC;IAC1C,eAAe;IACf,mBAAmB;IACnB,qBAAqB;CACxB,CAAC,CAAC;AAcH,MAAM,UAAU,0BAA0B,CAAC,OAA6B;;IACpE,MAAM,cAAc,GAAG,MAAA,OAAO,CAAC,cAAc,mCAAI,mBAAmB,CAAC;IACrE,MAAM,YAAY,GAAG,MAAA,OAAO,CAAC,YAAY,mCAAI,CAAC,CA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C,QAAQ,CAAC,CAAC;IAC7B,CAAC;AACL,CAAC;AAED,SAAS,oBAAoB,CAAC,UAAkB;;IAC5C,MAAM,UAAU,GAAG,MAAA,UAAU,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,0CAAE,IAAI,GAAG,WAAW,EAAE,CAAC;IACrE,OAAO,6BAA6B,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;AACzD,CAAC"}
|
package/lib/dev/miniflare.js
CHANGED
|
@@ -170,7 +170,7 @@ function loadMiniflare() {
|
|
|
170
170
|
}
|
|
171
171
|
catch (_a) {
|
|
172
172
|
console.error('miniflare is required for local development.');
|
|
173
|
-
console.error(
|
|
173
|
+
console.error("Add it to the app root devDependencies using the project's package manager.");
|
|
174
174
|
process.exit(1);
|
|
175
175
|
}
|
|
176
176
|
return (yield import(pathToFileURL(resolvedPath).href));
|
package/lib/dev/miniflare.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"miniflare.js","sourceRoot":"","sources":["../../src/dev/miniflare.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AACA,OAAO,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AACvC,OAAO,EAAE,aAAa,EAAE,MAAM,KAAK,CAAC;AACpC,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAkC3C;;;GAGG;AACH,MAAM,eAAe,GAAG,IAAI,OAAO,EAAyB,CAAC;AAC7D,MAAM,OAAO,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAQ/C,MAAM,sBAAsB,GAAG,eAAe,CAAC;AAC/C,MAAM,2BAA2B,GAAG,UAAU,CAAC;AAE/C,SAAS,0BAA0B,CAAC,YAAgC;IAChE,MAAM,sBAAsB,GAAG,IAAI,CAAC,SAAS,CAAC,YAAY,aAAZ,YAAY,cAAZ,YAAY,GAAI,EAAE,CAAC,CAAC;IAElE,OAAO;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EAAE,CAAC,UAAU,iCACZ,mBAAmB,KACtB,OAAO,EAAE,kBAAkB,CAAC,IAAI,EAAE,YAAY,CAAC,IACjD,CAAC;IACP,CAAC;CAAA;AAED;;;;GAIG;AACH,MAAM,UAAgB,gBAAgB,CAAC,EAAa;;QAChD,MAAM,EAAE,CAAC,OAAO,EAAE,CAAC;IACvB,CAAC;CAAA"}
|
package/lib/dev/preflight.js
CHANGED
|
@@ -65,7 +65,7 @@ export function preflightDependencies(projectRoot, options = {}) {
|
|
|
65
65
|
if (!isDeclaredDependency(projectRoot, 'miniflare')) {
|
|
66
66
|
return {
|
|
67
67
|
ok: false,
|
|
68
|
-
message:
|
|
68
|
+
message: "Missing Miniflare. Add it to the app root devDependencies using the project's package manager.",
|
|
69
69
|
};
|
|
70
70
|
}
|
|
71
71
|
if (!isDependencyResolvable(projectRoot, 'miniflare')) {
|
package/lib/dev/preflight.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"preflight.js","sourceRoot":"","sources":["../../src/dev/preflight.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AAgBvC,SAAS,qBAAqB,CAAC,WAAmB,EAAE,OAAe;IAC/D,MAAM,OAAO,GAAG,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,cAAc,EAAE,OAAO,EAAE,cAAc,CAAC,CAAC;IAChF,OAAO,EAAE,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;AAClC,CAAC;AAED,SAAS,sBAAsB,CAAC,WAAmB,EAAE,OAAe;IAChE,MAAM,OAAO,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAE/C,IAAI,CAAC;QACD,OAAO,CAAC,OAAO,CAAC,OAAO,EAAE,EAAE,KAAK,EAAE,CAAC,WAAW,CAAC,EAAE,C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D,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,eAAe,CAAC,EAAE,CAAC;QAClC,OAAO;YACH,EAAE,EAAE,KAAK;YACT,OAAO,EACH,sFAAsF;SAC7F,CAAC;IACN,CAAC;IAED,gDAAgD;IAChD,IAAI,gBAAgB,CAAC,WAAW,CAAC,IAAI,CAAC,qBAAqB,CAAC,WAAW,EAAE,YAAY,CAAC,EAAE,CAAC;QACrF,OAAO;YACH,EAAE,EAAE,KAAK;YACT,OAAO,EACH,+FAA+F;SACtG,CAAC;IACN,CAAC;IAED,IAAI,OAAO,CAAC,gBAAgB,EAAE,CAAC;QAC3B,IAAI,CAAC,oBAAoB,CAAC,WAAW,EAAE,WAAW,CAAC,EAAE,CAAC;YAClD,OAAO;gBACH,EAAE,EAAE,KAAK;gBACT,OAAO,EACH,gGAAgG;aACvG,CAAC;QACN,CAAC;QAED,IAAI,CAAC,sBAAsB,CAAC,WAAW,EAAE,WAAW,CAAC,EAAE,CAAC;YACpD,OAAO;gBACH,EAAE,EAAE,KAAK;gBACT,OAAO,EACH,qFAAqF;aAC5F,CAAC;QACN,CAAC;IACL,CAAC;IAED,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,CAAC;AACxB,CAAC"}
|
package/lib/dev/shared.js
CHANGED
|
@@ -59,7 +59,7 @@ export function buildSharedIfPresent(projectRoot) {
|
|
|
59
59
|
built: false,
|
|
60
60
|
success: false,
|
|
61
61
|
diagnostics: [
|
|
62
|
-
|
|
62
|
+
"TypeScript not found. Install dependencies at the app root using the project's package manager (required for shared package build).",
|
|
63
63
|
],
|
|
64
64
|
};
|
|
65
65
|
}
|
package/lib/dev/shared.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shared.js","sourceRoot":"","sources":["../../src/dev/shared.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,aA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,iBAAiB;SAC9C,CAAC,CAAC;QAEH,MAAM,kBAAkB,GAAG,EAAE,CAAC,qBAAqB,CAAC,OAAO,CAAC,CAAC;QAC7D,MAAM,UAAU,GAAG,OAAO,CAAC,IAAI,EAAE,CAAC;QAClC,MAAM,WAAW,GAAG,kBAAkB,CAAC,MAAM,CAAC,MAAA,UAAU,CAAC,WAAW,mCAAI,EAAE,CAAC,CAAC;QAC5E,MAAM,SAAS,GAAG,WAAW,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,gBAAgB,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC;QAEhE,OAAO;YACH,KAAK,EAAE,IAAI;YACX,OAAO,EAAE,WAAW,CAAC,MAAM,KAAK,CAAC;YACjC,WAAW,EAAE,SAAS,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS;SAC5D,CAAC;IACN,CAAC;CAAA"}
|
|
@@ -0,0 +1,270 @@
|
|
|
1
|
+
# Add Bkper AI to an App
|
|
2
|
+
|
|
3
|
+
Bkper AI is the preferred inference provider for Bkper Platform apps. It uses the authenticated user's included AI allowance, attributes usage to the app, and does not require the app to store provider credentials.
|
|
4
|
+
|
|
5
|
+
Use another provider only when Bkper AI lacks a required capability, model, compliance boundary, or customer-mandated provider. External providers require their own authentication, secrets, billing, and privacy review.
|
|
6
|
+
|
|
7
|
+
This guide covers the preferred current pattern: a non-streaming response with strict structured output. Streaming, tool calls, file inputs, and agent runtimes require additional design.
|
|
8
|
+
|
|
9
|
+
## Request flow
|
|
10
|
+
|
|
11
|
+
Keep model calls behind the app's typed `/api/*` contract:
|
|
12
|
+
|
|
13
|
+
1. The web client calls an app `/api/*` route with a Bkper bearer token. The template's `auth.authenticatedFetch()` handles this.
|
|
14
|
+
2. Bkper validates the token, mounts the user and app identity as outbound context, and removes the token before invoking the app Worker.
|
|
15
|
+
3. The Worker calls `https://ai.bkper.app/v1/*` without reading, storing, or forwarding the token.
|
|
16
|
+
4. Platform outbound injects Bkper authorization and overwrites `bkper-agent-id` and `bkper-ai-source` with the authenticated app identity.
|
|
17
|
+
|
|
18
|
+
Event handlers use the same Worker-to-Bkper-AI step. Their outbound context comes from the authenticated Bkper event. A normal page request does not establish user outbound context, so start interactive inference from an authenticated `/api/*` route rather than a page handler.
|
|
19
|
+
|
|
20
|
+
## Call the app API from the client
|
|
21
|
+
|
|
22
|
+
Use the authenticated fetch provider already configured by the app template:
|
|
23
|
+
|
|
24
|
+
```ts
|
|
25
|
+
interface AnalyzeRequest {
|
|
26
|
+
first: {
|
|
27
|
+
date: string;
|
|
28
|
+
amount: string;
|
|
29
|
+
description: string;
|
|
30
|
+
fromAccount: string | null;
|
|
31
|
+
toAccount: string | null;
|
|
32
|
+
};
|
|
33
|
+
second: {
|
|
34
|
+
date: string;
|
|
35
|
+
amount: string;
|
|
36
|
+
description: string;
|
|
37
|
+
fromAccount: string | null;
|
|
38
|
+
toAccount: string | null;
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export async function analyzePair(auth: AuthProvider, request: AnalyzeRequest): Promise {
|
|
43
|
+
return auth.authenticatedFetch('/api/v1/analyze', {
|
|
44
|
+
method: 'POST',
|
|
45
|
+
headers: { 'content-type': 'application/json' },
|
|
46
|
+
body: JSON.stringify(request),
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
In a full app, define this operation in the server's Zod/OpenAPI schemas and call it through the generated typed client. The important boundary is that the client authenticates the app API request; the Worker never handles that bearer token directly.
|
|
52
|
+
|
|
53
|
+
## Discover the current default model
|
|
54
|
+
|
|
55
|
+
The live model catalog is authoritative. It publishes the current default, model IDs, modalities, structured-output support, reasoning levels, context and output limits, and effective usage rates.
|
|
56
|
+
|
|
57
|
+
```ts
|
|
58
|
+
const AI_BASE_URL = 'https://ai.bkper.app/v1';
|
|
59
|
+
type Fetcher = (input: RequestInfo | URL, init?: RequestInit) => Promise;
|
|
60
|
+
|
|
61
|
+
function isRecord(value: unknown): value is Record<string, unknown> {
|
|
62
|
+
return value !== null && typeof value === 'object' && !Array.isArray(value);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
export async function getStructuredOutputModel(fetcher: Fetcher = fetch): Promise<string> {
|
|
66
|
+
const response = await fetcher(`${AI_BASE_URL}/models`);
|
|
67
|
+
if (!response.ok) {
|
|
68
|
+
throw new Error(`Bkper AI model discovery failed (${response.status}).`);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
const catalog: unknown = await response.json();
|
|
72
|
+
if (
|
|
73
|
+
!isRecord(catalog) ||
|
|
74
|
+
typeof catalog.default_model !== 'string' ||
|
|
75
|
+
!Array.isArray(catalog.data)
|
|
76
|
+
) {
|
|
77
|
+
throw new Error('Bkper AI returned an invalid model catalog.');
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
const defaultModel = catalog.default_model;
|
|
81
|
+
const model = catalog.data.find(item => isRecord(item) && item.id === defaultModel);
|
|
82
|
+
if (
|
|
83
|
+
!isRecord(model) ||
|
|
84
|
+
!isRecord(model.structured_output) ||
|
|
85
|
+
model.structured_output.json_schema !== true ||
|
|
86
|
+
model.structured_output.strict !== true
|
|
87
|
+
) {
|
|
88
|
+
throw new Error('The default Bkper AI model does not support strict structured output.');
|
|
89
|
+
}
|
|
90
|
+
return defaultModel;
|
|
91
|
+
}
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
This example uses `default_model` after validating the capability required by the request. If an app requires another modality, file type, reasoning level, or limit, intentionally select and validate another model from the catalog's `data` array. Apps may cache the catalog briefly rather than fetching it for every inference request.
|
|
95
|
+
|
|
96
|
+
## Request strict structured output
|
|
97
|
+
|
|
98
|
+
Keep inference in a server service and make `fetch` injectable for unit tests. This example sends only the transaction facts needed for duplicate evaluation. It omits transaction IDs, Account IDs, unrelated properties, and other Book data.
|
|
99
|
+
|
|
100
|
+
```ts
|
|
101
|
+
const EvaluationJsonSchema = {
|
|
102
|
+
type: 'object',
|
|
103
|
+
properties: {
|
|
104
|
+
duplicate: { type: 'boolean' },
|
|
105
|
+
strength: { type: 'string', enum: ['Strong', 'Possible'] },
|
|
106
|
+
explanation: { type: 'string', maxLength: 180 },
|
|
107
|
+
},
|
|
108
|
+
required: ['duplicate', 'strength', 'explanation'],
|
|
109
|
+
additionalProperties: false,
|
|
110
|
+
} as const;
|
|
111
|
+
|
|
112
|
+
export interface DuplicateEvaluation {
|
|
113
|
+
duplicate: boolean;
|
|
114
|
+
strength: 'Strong' | 'Possible';
|
|
115
|
+
explanation: string;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
export class BkperAiError extends Error {
|
|
119
|
+
constructor(
|
|
120
|
+
readonly status: number,
|
|
121
|
+
readonly code: string,
|
|
122
|
+
message: string
|
|
123
|
+
) {
|
|
124
|
+
super(message);
|
|
125
|
+
this.name = 'BkperAiError';
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
export async function evaluateDuplicate(
|
|
130
|
+
candidate: AnalyzeRequest,
|
|
131
|
+
fetcher: Fetcher = fetch
|
|
132
|
+
): Promise {
|
|
133
|
+
const model = await getStructuredOutputModel(fetcher);
|
|
134
|
+
const response = await fetcher(`${AI_BASE_URL}/responses`, {
|
|
135
|
+
method: 'POST',
|
|
136
|
+
headers: { 'content-type': 'application/json' },
|
|
137
|
+
body: JSON.stringify({
|
|
138
|
+
model,
|
|
139
|
+
instructions:
|
|
140
|
+
'Decide whether both records represent the same movement. ' +
|
|
141
|
+
'Return Strong only when the evidence is compelling.',
|
|
142
|
+
input: [
|
|
143
|
+
{
|
|
144
|
+
role: 'user',
|
|
145
|
+
content: [
|
|
146
|
+
{
|
|
147
|
+
type: 'input_text',
|
|
148
|
+
text: JSON.stringify(candidate),
|
|
149
|
+
},
|
|
150
|
+
],
|
|
151
|
+
},
|
|
152
|
+
],
|
|
153
|
+
text: {
|
|
154
|
+
format: {
|
|
155
|
+
type: 'json_schema',
|
|
156
|
+
name: 'duplicate_evaluation',
|
|
157
|
+
schema: EvaluationJsonSchema,
|
|
158
|
+
strict: true,
|
|
159
|
+
},
|
|
160
|
+
},
|
|
161
|
+
stream: false,
|
|
162
|
+
store: false,
|
|
163
|
+
}),
|
|
164
|
+
});
|
|
165
|
+
|
|
166
|
+
const payload: unknown = await response.json();
|
|
167
|
+
if (!response.ok) {
|
|
168
|
+
const error = readAiError(payload);
|
|
169
|
+
throw new BkperAiError(response.status, error.code, error.message);
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
const value: unknown = JSON.parse(getOutputText(payload));
|
|
173
|
+
if (!isDuplicateEvaluation(value)) {
|
|
174
|
+
throw new Error('Bkper AI output did not match the required schema.');
|
|
175
|
+
}
|
|
176
|
+
return value;
|
|
177
|
+
}
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
Do not add an `Authorization`, `bkper-agent-id`, or `bkper-ai-source` header to the Worker's Bkper AI request. Platform outbound derives those values from the authenticated app request or event and overwrites them before dispatch.
|
|
181
|
+
|
|
182
|
+
## Validate the response and preserve errors
|
|
183
|
+
|
|
184
|
+
Strict structured output constrains generation, but the app must still parse and validate the returned value before using it.
|
|
185
|
+
|
|
186
|
+
```ts
|
|
187
|
+
function getOutputText(payload: unknown): string {
|
|
188
|
+
if (!isRecord(payload) || payload.status !== 'completed' || !Array.isArray(payload.output)) {
|
|
189
|
+
throw new Error('Bkper AI did not return a complete response.');
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
const texts: string[] = [];
|
|
193
|
+
for (const item of payload.output) {
|
|
194
|
+
if (!isRecord(item) || item.type !== 'message' || !Array.isArray(item.content)) continue;
|
|
195
|
+
for (const part of item.content) {
|
|
196
|
+
if (isRecord(part) && part.type === 'output_text' && typeof part.text === 'string') {
|
|
197
|
+
texts.push(part.text);
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
if (texts.length === 0) throw new Error('Bkper AI returned no output text.');
|
|
202
|
+
return texts.join('');
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
function isDuplicateEvaluation(value: unknown): value is DuplicateEvaluation {
|
|
206
|
+
return (
|
|
207
|
+
isRecord(value) &&
|
|
208
|
+
typeof value.duplicate === 'boolean' &&
|
|
209
|
+
(value.strength === 'Strong' || value.strength === 'Possible') &&
|
|
210
|
+
typeof value.explanation === 'string' &&
|
|
211
|
+
value.explanation.length <= 180
|
|
212
|
+
);
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
function readAiError(payload: unknown): { code: string; message: string } {
|
|
216
|
+
if (
|
|
217
|
+
isRecord(payload) &&
|
|
218
|
+
isRecord(payload.error) &&
|
|
219
|
+
typeof payload.error.code === 'string' &&
|
|
220
|
+
typeof payload.error.message === 'string'
|
|
221
|
+
) {
|
|
222
|
+
return { code: payload.error.code, message: payload.error.message };
|
|
223
|
+
}
|
|
224
|
+
return { code: 'bkper_ai_error', message: 'Bkper AI request failed.' };
|
|
225
|
+
}
|
|
226
|
+
```
|
|
227
|
+
|
|
228
|
+
Preserve the upstream HTTP status, error code, and message when mapping a `BkperAiError` into the app's typed error envelope. Bkper AI centralizes actionable messages such as allowance guidance and pricing links. Bot event responses may reuse that message directly when the surface supports it. Interactive apps can use the status and code to provide a tailored experience without duplicating the upstream policy or CTA.
|
|
229
|
+
|
|
230
|
+
## Test the boundary
|
|
231
|
+
|
|
232
|
+
Use a mocked `fetch` to protect the integration contract without making live model calls:
|
|
233
|
+
|
|
234
|
+
```ts
|
|
235
|
+
expect(capturedRequest.headers.get('authorization')).toBeNull();
|
|
236
|
+
expect(requestBody.store).toBe(false);
|
|
237
|
+
expect(requestBody.stream).toBe(false);
|
|
238
|
+
expect(requestBody.text).toMatchObject({
|
|
239
|
+
format: { type: 'json_schema', strict: true },
|
|
240
|
+
});
|
|
241
|
+
```
|
|
242
|
+
|
|
243
|
+
Also test that the service:
|
|
244
|
+
|
|
245
|
+
- validates that the catalog's `default_model` supports strict structured output;
|
|
246
|
+
- rejects malformed or schema-incompatible output;
|
|
247
|
+
- preserves Bkper AI error status, code, and message;
|
|
248
|
+
- does not send internal identifiers or unrelated Book data.
|
|
249
|
+
|
|
250
|
+
## Implementation checklist
|
|
251
|
+
|
|
252
|
+
Before considering the integration complete:
|
|
253
|
+
|
|
254
|
+
- [ ] The client calls a typed `/api/*` route through authenticated fetch.
|
|
255
|
+
- [ ] Worker code never reads, stores, or forwards the Bkper bearer token.
|
|
256
|
+
- [ ] The app discovers models from `GET /v1/models` and intentionally chooses a returned ID.
|
|
257
|
+
- [ ] Inference runs in a server service with an injectable `fetch`.
|
|
258
|
+
- [ ] The request uses strict structured output, `stream: false`, and `store: false`.
|
|
259
|
+
- [ ] Only data required for the task is sent to inference.
|
|
260
|
+
- [ ] Returned JSON is parsed and independently validated.
|
|
261
|
+
- [ ] Error status, code, and message remain available to the caller.
|
|
262
|
+
- [ ] Unit tests cover the request, response, validation, and error boundaries.
|
|
263
|
+
- [ ] The app's normal `npm run check` or `bun run check` succeeds.
|
|
264
|
+
|
|
265
|
+
## Next steps
|
|
266
|
+
|
|
267
|
+
- [Read the client-agnostic Bkper AI Provider guide](https://bkper.com/docs/ai/bkper-ai-provider.md) for privacy boundaries, the complete supported profile, and advanced features.
|
|
268
|
+
- [Inspect the live model catalog](https://ai.bkper.app/v1/models).
|
|
269
|
+
- [Browse the generated AI API reference](https://bkper.com/docs/api/ai.md) when exact request or response schema details are needed.
|
|
270
|
+
- [Review the Merge Duplicates implementation](https://github.com/bkper/bkper-apps/tree/main/merge-duplicates) for a platform-app example with deterministic candidate filtering, strict structured output, and human-confirmed merges.
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
# App Listing
|
|
2
|
+
|
|
3
|
+
All Bkper apps are listed on the Automations Portal at _[app.bkper.com](https://app.bkper.com/) > Automations > Apps_. Each app has its own page with logo, description, and details:
|
|
4
|
+
|
|
5
|
+

|
|
6
|
+
|
|
7
|
+
App listings are populated from the fields you declare in [`bkper.yaml`](https://bkper.com/docs/build/apps/configuration.md). Sync metadata changes with `bkper app sync`. Deploying code is a separate step.
|
|
8
|
+
|
|
9
|
+
## Listing fields
|
|
10
|
+
|
|
11
|
+
Make sure your `bkper.yaml` has the following fields populated for a complete listing:
|
|
12
|
+
|
|
13
|
+
```yaml
|
|
14
|
+
id: your-app-id
|
|
15
|
+
name: Your App Name
|
|
16
|
+
description: A clear description of what your app does
|
|
17
|
+
|
|
18
|
+
logoUrl: https://your-app.bkper.app/images/logo.svg
|
|
19
|
+
logoUrlDark: https://your-app.bkper.app/images/logo-dark.svg
|
|
20
|
+
|
|
21
|
+
ownerName: Your Name or Organization
|
|
22
|
+
ownerWebsite: https://yourwebsite.com
|
|
23
|
+
|
|
24
|
+
website: https://your-app.bkper.app
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
See [App Configuration](https://bkper.com/docs/build/apps/configuration.md) for the full `bkper.yaml` reference.
|
|
28
|
+
|
|
29
|
+
## Default visibility
|
|
30
|
+
|
|
31
|
+
By default, installation is limited to the users you've declared in `bkper.yaml`:
|
|
32
|
+
|
|
33
|
+
```yaml
|
|
34
|
+
# Specific Bkper usernames
|
|
35
|
+
users: alice bob
|
|
36
|
+
|
|
37
|
+
# Your entire domain
|
|
38
|
+
users: *@yourcompany.com
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
Use Bkper usernames for individual access, not email addresses.
|
|
42
|
+
|
|
43
|
+
Your team can install and use the app, but it doesn't appear in the public Bkper app directory for other users.
|
|
44
|
+
|
|
45
|
+
## Publishing to all users
|
|
46
|
+
|
|
47
|
+
To make your app available to all Bkper users, contact us at [support@bkper.com](mailto:support@bkper.com?subject=Publish+Bkper+App). We'll review your app and, once approved, publish it.
|
|
48
|
+
|
|
49
|
+
### What the review involves
|
|
50
|
+
|
|
51
|
+
- **Functionality check** — The app works correctly and handles errors gracefully
|
|
52
|
+
- **Security review** — Event handlers are idempotent and include loop prevention
|
|
53
|
+
- **Listing quality** — The app has a clear name, description, logo, and user-facing documentation
|
|
54
|
+
|
|
55
|
+
### README matters
|
|
56
|
+
|
|
57
|
+
Your app's `README.md` is displayed to end users on the app listing page. Write it for the people who will install and use your app — not for developers.
|
|
58
|
+
|
|
59
|
+
**README should explain:**
|
|
60
|
+
|
|
61
|
+
- What the app does from a user's perspective
|
|
62
|
+
- How to use it (step-by-step for non-technical users)
|
|
63
|
+
- What features are available
|
|
64
|
+
- API access details when the app intentionally exposes `/api/*` routes for users or integrators
|
|
65
|
+
|
|
66
|
+
**API access details should stay concise:**
|
|
67
|
+
|
|
68
|
+
- App base URL for production and preview
|
|
69
|
+
- OpenAPI spec URL at `/openapi.json`
|
|
70
|
+
- One minimal authenticated example, such as a `curl` call with `Authorization: Bearer <token>`
|
|
71
|
+
|
|
72
|
+
**README should NOT contain:**
|
|
73
|
+
|
|
74
|
+
- Tech stack or architecture details
|
|
75
|
+
- Build commands or development setup
|
|
76
|
+
- Project structure or internal file paths
|
|
77
|
+
- Long API references, generated schemas, SDK internals, or route-by-route developer docs
|
|
78
|
+
|
|
79
|
+
Put developer documentation in `AGENTS.md` or internal docs instead. Keep `README.md` focused on the user experience and any integration entry points users need.
|
|
80
|
+
|
|
81
|
+
### Where published apps appear
|
|
82
|
+
|
|
83
|
+
Once published, your app appears in:
|
|
84
|
+
|
|
85
|
+
- **[bkper.com/apps](https://bkper.com/apps)** — The public app directory
|
|
86
|
+
- **Automations Portal** — Inside every Bkper book, users can find and install your app
|