@frankieai/server 0.2.2 → 0.2.3
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/dist/{chunk-NSOMFNTK.js → chunk-37VMCQCI.js} +109 -15
- package/dist/chunk-37VMCQCI.js.map +1 -0
- package/dist/{chunk-JOADNB5J.js → chunk-MKN5663J.js} +288 -40
- package/dist/chunk-MKN5663J.js.map +1 -0
- package/dist/control-server.js +2 -2
- package/dist/index.d.ts +72 -1
- package/dist/index.js +2 -2
- package/dist/server.js +1 -1
- package/package.json +2 -2
- package/dist/chunk-JOADNB5J.js.map +0 -1
- package/dist/chunk-NSOMFNTK.js.map +0 -1
package/dist/control-server.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
createControlApp
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-37VMCQCI.js";
|
|
5
5
|
import {
|
|
6
6
|
createFrankieApp,
|
|
7
7
|
resolveStores
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-MKN5663J.js";
|
|
9
9
|
|
|
10
10
|
// src/control-server.ts
|
|
11
11
|
import { serve } from "@hono/node-server";
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Hono } from 'hono';
|
|
2
|
-
import { FrankieConfig, AuthConfig, WorkspaceSkill, ChatAttachment, FrankieServerEvent, McpServerConfig, ToolPolicy, ApiToolInventory, ApiSourceConfig } from '@frankieai/core';
|
|
2
|
+
import { FrankieConfig, AuthConfig, WorkspaceSkill, HostToolRequest, HostToolResult, ChatAttachment, FrankieServerEvent, McpServerConfig, ToolPolicy, ApiToolInventory, ApiSourceConfig } from '@frankieai/core';
|
|
3
3
|
export { matchPath } from '@frankieai/core';
|
|
4
4
|
import { AgentMessage, AgentTool } from '@earendil-works/pi-agent-core';
|
|
5
5
|
import { JWTPayload } from 'jose';
|
|
@@ -304,6 +304,24 @@ interface RepositoryInstallRecord {
|
|
|
304
304
|
checkedAt?: string;
|
|
305
305
|
updatedAt: string;
|
|
306
306
|
}
|
|
307
|
+
/**
|
|
308
|
+
* A Vercel integration installed for this workspace. The access token is a
|
|
309
|
+
* secret like `jwtSecret`: stored here, never returned by the public shape.
|
|
310
|
+
*/
|
|
311
|
+
interface VercelLinkRecord {
|
|
312
|
+
/** Token minted by the integration's OAuth exchange. Integration tokens don't expire. */
|
|
313
|
+
accessToken: string;
|
|
314
|
+
/** Vercel's id for this installation (`configurationId`), for support and uninstall. */
|
|
315
|
+
installationId: string;
|
|
316
|
+
/** Set when the integration was installed on a team rather than a personal account. */
|
|
317
|
+
teamId?: string;
|
|
318
|
+
/** The Vercel project linked to this workspace's repository, once matched. */
|
|
319
|
+
projectId?: string;
|
|
320
|
+
projectName?: string;
|
|
321
|
+
connectedAt: string;
|
|
322
|
+
}
|
|
323
|
+
/** `VercelLinkRecord` with the token stripped — what the dashboard sees. */
|
|
324
|
+
type PublicVercelLink = Omit<VercelLinkRecord, "accessToken">;
|
|
307
325
|
interface TenantRecord {
|
|
308
326
|
apiSpecSync?: Record<string, {
|
|
309
327
|
repository: string;
|
|
@@ -327,6 +345,8 @@ interface TenantRecord {
|
|
|
327
345
|
locked?: boolean;
|
|
328
346
|
/** Durable repository-install state surfaced in the dashboard and setup chat. */
|
|
329
347
|
repositoryInstall?: RepositoryInstallRecord;
|
|
348
|
+
/** Deployment provider connection, when the workspace has connected Vercel. */
|
|
349
|
+
vercel?: VercelLinkRecord;
|
|
330
350
|
createdAt: string;
|
|
331
351
|
updatedAt: string;
|
|
332
352
|
}
|
|
@@ -342,6 +362,8 @@ interface PublicTenant {
|
|
|
342
362
|
publishableKey: string;
|
|
343
363
|
allowedOrigins: string[];
|
|
344
364
|
allowAnonymous: boolean;
|
|
365
|
+
/** How the hosted MCP treats a caller's bearer: verify it as a JWT, or forward it opaquely. */
|
|
366
|
+
userCredential: "jwt" | "opaque";
|
|
345
367
|
connection: "knowledge" | "mcp" | "openapi";
|
|
346
368
|
mcpServers: string[];
|
|
347
369
|
apis: string[];
|
|
@@ -349,6 +371,8 @@ interface PublicTenant {
|
|
|
349
371
|
connections: Array<{
|
|
350
372
|
kind: "mcp" | "openapi";
|
|
351
373
|
name: string;
|
|
374
|
+
/** Friendly label for the dashboard; `name` remains the stable identifier. */
|
|
375
|
+
displayName?: string;
|
|
352
376
|
/** OpenAPI spec URL/path. */
|
|
353
377
|
spec?: string;
|
|
354
378
|
/** MCP server URL. */
|
|
@@ -369,7 +393,11 @@ interface PublicTenant {
|
|
|
369
393
|
}>;
|
|
370
394
|
selectedTools?: string[];
|
|
371
395
|
exposeAsMcp?: boolean;
|
|
396
|
+
/** Where the source's operations run: "server" (Frankie's server) or "client" (the user's browser). */
|
|
397
|
+
execution?: "server" | "client";
|
|
372
398
|
forwardsToken: boolean;
|
|
399
|
+
/** The header the user's credential is forwarded to your API as (empty when none). */
|
|
400
|
+
forwardTokenAs?: string;
|
|
373
401
|
/** Security scheme names with a credential configured (OpenAPI only). Never the values themselves. */
|
|
374
402
|
securedSchemes?: string[];
|
|
375
403
|
/** Whether this source is currently enabled for chat. */
|
|
@@ -381,6 +409,8 @@ interface PublicTenant {
|
|
|
381
409
|
locked: boolean;
|
|
382
410
|
/** A submitted or in-progress SDK installation for this workspace. */
|
|
383
411
|
repositoryInstall?: RepositoryInstallRecord;
|
|
412
|
+
/** The connected Vercel installation and matched project — never its token. */
|
|
413
|
+
vercel?: PublicVercelLink;
|
|
384
414
|
/** The customer's brand theme for the widget, so the dashboard can edit it. */
|
|
385
415
|
theme: TenantRecord["config"]["theme"];
|
|
386
416
|
/** Opt-in chat capabilities (attachments, model picker) for the dashboard to edit. */
|
|
@@ -593,7 +623,21 @@ declare class PostgresSessionStore implements SessionStore {
|
|
|
593
623
|
|
|
594
624
|
interface SkillGenerationInput {
|
|
595
625
|
goal: string;
|
|
626
|
+
/** Approved tool identifiers this skill may use. Validated against on return. */
|
|
596
627
|
tools: string[];
|
|
628
|
+
/**
|
|
629
|
+
* What each tool in `tools` actually does (method/path/summary, or an MCP
|
|
630
|
+
* tool's own description) — see `toolDescriptions()` in @frankieai/core.
|
|
631
|
+
* Without this the model has nothing to write concrete steps from but a
|
|
632
|
+
* bare identifier like `api__product__listItems`. Optional so older
|
|
633
|
+
* callers (and tests) that only have bare ids still work; the resulting
|
|
634
|
+
* draft is just less specific.
|
|
635
|
+
*/
|
|
636
|
+
toolDetails?: Array<{
|
|
637
|
+
id: string;
|
|
638
|
+
description: string;
|
|
639
|
+
}>;
|
|
640
|
+
/** Present when refining an existing skill rather than starting fresh. */
|
|
597
641
|
instructions?: string;
|
|
598
642
|
}
|
|
599
643
|
declare function generateSkill(resolved: ResolvedConfig, input: SkillGenerationInput): Promise<WorkspaceSkill>;
|
|
@@ -629,6 +673,22 @@ interface ControlOptions {
|
|
|
629
673
|
*/
|
|
630
674
|
declare function createControlApp(options: ControlOptions): Hono;
|
|
631
675
|
|
|
676
|
+
/**
|
|
677
|
+
* The per-turn handle an API tool uses to run itself in the user's browser
|
|
678
|
+
* instead of on Frankie's server. `available` says whether a live widget
|
|
679
|
+
* channel is bound for this session — false over the hosted MCP endpoint or any
|
|
680
|
+
* headless caller, where a browser-scoped call is impossible.
|
|
681
|
+
*/
|
|
682
|
+
interface ClientToolBridge {
|
|
683
|
+
readonly available: boolean;
|
|
684
|
+
/**
|
|
685
|
+
* Ask the browser to perform one HTTP call and resolve with its outcome.
|
|
686
|
+
* Rejects if no channel is bound, the turn is aborted, or the browser does
|
|
687
|
+
* not answer before `timeoutMs`.
|
|
688
|
+
*/
|
|
689
|
+
execute(name: string, request: HostToolRequest, signal?: AbortSignal): Promise<HostToolResult>;
|
|
690
|
+
}
|
|
691
|
+
|
|
632
692
|
interface RunTurnParams {
|
|
633
693
|
config: FrankieConfig;
|
|
634
694
|
session: ChatSession;
|
|
@@ -642,6 +702,8 @@ interface RunTurnParams {
|
|
|
642
702
|
modelOverride?: Model<Api>;
|
|
643
703
|
/** Files attached to this turn, already validated against the feature flags. */
|
|
644
704
|
attachments?: ChatAttachment[];
|
|
705
|
+
/** Browser channel for API sources marked `execution: "client"`, when a widget is connected. */
|
|
706
|
+
clientBridge?: ClientToolBridge;
|
|
645
707
|
signal: AbortSignal;
|
|
646
708
|
/** Called with the full transcript once the turn settles, to persist it. */
|
|
647
709
|
onTranscript?: (messages: AgentMessage[]) => void;
|
|
@@ -694,6 +756,13 @@ interface BuildApiToolsOptions {
|
|
|
694
756
|
session: ChatSession;
|
|
695
757
|
policy: ToolPolicy;
|
|
696
758
|
fetchImpl?: typeof fetch;
|
|
759
|
+
/**
|
|
760
|
+
* Bridge to the user's browser for sources marked `execution: "client"`. When
|
|
761
|
+
* absent (headless callers, the hosted MCP endpoint), a client-mode operation
|
|
762
|
+
* has no way to run and reports that clearly instead of falling back to a
|
|
763
|
+
* server-side call the user's session would not authorize.
|
|
764
|
+
*/
|
|
765
|
+
clientBridge?: ClientToolBridge;
|
|
697
766
|
onWarning?: (message: string, detail: Record<string, unknown>) => void;
|
|
698
767
|
}
|
|
699
768
|
interface ApiToolSet {
|
|
@@ -731,6 +800,8 @@ interface CollectToolsOptions {
|
|
|
731
800
|
fetchImpl?: typeof fetch;
|
|
732
801
|
/** Base URL of the account API for the built-in workspaceAdmin tools. */
|
|
733
802
|
accountApiUrl?: string;
|
|
803
|
+
/** Browser channel for API sources marked `execution: "client"`. */
|
|
804
|
+
clientBridge?: ClientToolBridge;
|
|
734
805
|
onWarning?: (message: string, detail: Record<string, unknown>) => void;
|
|
735
806
|
}
|
|
736
807
|
interface CollectedTools {
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createControlApp
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-37VMCQCI.js";
|
|
4
4
|
import {
|
|
5
5
|
ConfigError,
|
|
6
6
|
applyEnvOverrides,
|
|
@@ -42,7 +42,7 @@ import {
|
|
|
42
42
|
runTurn,
|
|
43
43
|
safeEqual,
|
|
44
44
|
toPublicTenant
|
|
45
|
-
} from "./chunk-
|
|
45
|
+
} from "./chunk-MKN5663J.js";
|
|
46
46
|
export {
|
|
47
47
|
API_TOOL_PREFIX,
|
|
48
48
|
AuthError,
|
package/dist/server.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@frankieai/server",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.3",
|
|
4
4
|
"description": "Frankie cloud agent server — auth, sessions, MCP wiring and streaming for the embedded onboarding agent.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"yaml": "^2.9.0",
|
|
29
29
|
"zod": "^4.0.0",
|
|
30
30
|
"pg": "^8.13.0",
|
|
31
|
-
"@frankieai/core": "0.2.
|
|
31
|
+
"@frankieai/core": "0.2.3"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
34
|
"@types/node": "^22.10.0",
|