@frankieai/core 0.2.7 → 0.2.9
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/index.cjs +394 -16
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +150 -1
- package/dist/index.d.ts +150 -1
- package/dist/index.js +387 -16
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -248,6 +248,7 @@ declare const agentConfigSchema: z.ZodObject<{
|
|
|
248
248
|
denyByDefault: z.ZodDefault<z.ZodBoolean>;
|
|
249
249
|
}, z.core.$strip>>;
|
|
250
250
|
showToolActivity: z.ZodDefault<z.ZodBoolean>;
|
|
251
|
+
confirmWrites: z.ZodDefault<z.ZodBoolean>;
|
|
251
252
|
}, z.core.$strip>;
|
|
252
253
|
declare const authConfigSchema: z.ZodObject<{
|
|
253
254
|
publishableKey: z.ZodString;
|
|
@@ -348,6 +349,7 @@ declare const personaProfileSchema: z.ZodObject<{
|
|
|
348
349
|
denyByDefault: z.ZodDefault<z.ZodBoolean>;
|
|
349
350
|
}, z.core.$strip>>;
|
|
350
351
|
showToolActivity: z.ZodDefault<z.ZodBoolean>;
|
|
352
|
+
confirmWrites: z.ZodDefault<z.ZodBoolean>;
|
|
351
353
|
}, z.core.$strip>>;
|
|
352
354
|
features: z.ZodPrefault<z.ZodObject<{
|
|
353
355
|
attachments: z.ZodPrefault<z.ZodObject<{
|
|
@@ -454,6 +456,7 @@ declare const frankieConfigSchema: z.ZodObject<{
|
|
|
454
456
|
denyByDefault: z.ZodDefault<z.ZodBoolean>;
|
|
455
457
|
}, z.core.$strip>>;
|
|
456
458
|
showToolActivity: z.ZodDefault<z.ZodBoolean>;
|
|
459
|
+
confirmWrites: z.ZodDefault<z.ZodBoolean>;
|
|
457
460
|
}, z.core.$strip>>;
|
|
458
461
|
auth: z.ZodObject<{
|
|
459
462
|
publishableKey: z.ZodString;
|
|
@@ -624,6 +627,7 @@ declare const frankieConfigSchema: z.ZodObject<{
|
|
|
624
627
|
denyByDefault: z.ZodDefault<z.ZodBoolean>;
|
|
625
628
|
}, z.core.$strip>>;
|
|
626
629
|
showToolActivity: z.ZodDefault<z.ZodBoolean>;
|
|
630
|
+
confirmWrites: z.ZodDefault<z.ZodBoolean>;
|
|
627
631
|
}, z.core.$strip>>;
|
|
628
632
|
features: z.ZodPrefault<z.ZodObject<{
|
|
629
633
|
attachments: z.ZodPrefault<z.ZodObject<{
|
|
@@ -655,6 +659,7 @@ declare const frankieConfigSchema: z.ZodObject<{
|
|
|
655
659
|
maxPages: z.ZodDefault<z.ZodNumber>;
|
|
656
660
|
}, z.core.$strip>>;
|
|
657
661
|
}, z.core.$strip>>>;
|
|
662
|
+
agentId: z.ZodOptional<z.ZodString>;
|
|
658
663
|
}, z.core.$strip>;
|
|
659
664
|
type ThinkingLevel = z.infer<typeof thinkingLevelSchema>;
|
|
660
665
|
type WidgetThemeConfig = z.infer<typeof widgetThemeSchema>;
|
|
@@ -761,6 +766,18 @@ type FrankieServerEvent = {
|
|
|
761
766
|
name: string;
|
|
762
767
|
reason: string;
|
|
763
768
|
}
|
|
769
|
+
/**
|
|
770
|
+
* An action that changes data is waiting for the user. The widget shows it
|
|
771
|
+
* with Approve and Cancel and answers with `confirm` on the next message.
|
|
772
|
+
* Nothing has run yet; on Approve the server runs exactly this call.
|
|
773
|
+
*/
|
|
774
|
+
| {
|
|
775
|
+
type: "action_confirm";
|
|
776
|
+
toolUseId: string;
|
|
777
|
+
name: string;
|
|
778
|
+
label: string;
|
|
779
|
+
preview: ActionPreview;
|
|
780
|
+
}
|
|
764
781
|
/**
|
|
765
782
|
* Client-side tool execution: the server asks the widget to make one HTTP
|
|
766
783
|
* call to the host's own API, from the user's browser and on the user's
|
|
@@ -849,6 +866,13 @@ interface ChatRequestBody {
|
|
|
849
866
|
/** Omit to start a new conversation; the server replies with a `session` event. */
|
|
850
867
|
sessionId?: string;
|
|
851
868
|
message: string;
|
|
869
|
+
/**
|
|
870
|
+
* A fresh host-signed user token for the session's own user. Host tokens are
|
|
871
|
+
* short-lived (minutes) while a session lasts an hour, so the widget sends a
|
|
872
|
+
* new one with each message and the server forwards that one to the
|
|
873
|
+
* workspace's tools instead of the expired one it started with.
|
|
874
|
+
*/
|
|
875
|
+
userToken?: string;
|
|
852
876
|
/**
|
|
853
877
|
* Free-form page context the host passes through (current route, plan tier,
|
|
854
878
|
* feature flags). Surfaced to the agent as a system reminder, never trusted
|
|
@@ -862,6 +886,33 @@ interface ChatRequestBody {
|
|
|
862
886
|
model?: string;
|
|
863
887
|
/** Files attached to this turn. Honoured only when attachments are enabled. */
|
|
864
888
|
attachments?: ChatAttachment[];
|
|
889
|
+
/**
|
|
890
|
+
* The widget can show an `action_confirm` card. Without it, actions run as
|
|
891
|
+
* they always have, so an SDK that can't ask the user is never left with a
|
|
892
|
+
* paused action and no button to approve it.
|
|
893
|
+
*/
|
|
894
|
+
confirmActions?: boolean;
|
|
895
|
+
/**
|
|
896
|
+
* The widget renders Markdown tables, so the agent may answer report-style
|
|
897
|
+
* questions with one. Older widgets would show raw `|` text, so it's opt-in.
|
|
898
|
+
*/
|
|
899
|
+
markdownTables?: boolean;
|
|
900
|
+
/** The user's answer to the action waiting for approval (`action_confirm`). */
|
|
901
|
+
confirm?: ActionDecision;
|
|
902
|
+
}
|
|
903
|
+
/** Approve or cancel the action an `action_confirm` event paused. */
|
|
904
|
+
interface ActionDecision {
|
|
905
|
+
/** The `toolUseId` from the `action_confirm` event. */
|
|
906
|
+
toolUseId: string;
|
|
907
|
+
approved: boolean;
|
|
908
|
+
}
|
|
909
|
+
/** What an action that's waiting for approval will do, for the confirmation card. */
|
|
910
|
+
interface ActionPreview {
|
|
911
|
+
/** HTTP method and path for an API action, when there is one. */
|
|
912
|
+
method?: string;
|
|
913
|
+
path?: string;
|
|
914
|
+
/** The exact inputs it will run with. */
|
|
915
|
+
input?: unknown;
|
|
865
916
|
}
|
|
866
917
|
/** Client -> server body for `POST /v1/session`. */
|
|
867
918
|
interface CreateSessionBody {
|
|
@@ -915,6 +966,12 @@ interface PublicWidgetConfig {
|
|
|
915
966
|
features: PublicFeatures;
|
|
916
967
|
/** App-Router path globs this agent shows on; empty = every page no other agent claims. Optional so older servers stay compatible. */
|
|
917
968
|
pages?: string[];
|
|
969
|
+
/**
|
|
970
|
+
* Whether the chat shows the "Agent context" bar (skills and APIs loaded for
|
|
971
|
+
* the turn). Off for visitor-facing page agents such as Support and Docs,
|
|
972
|
+
* where it means nothing to the person chatting. Absent (older servers) = shown.
|
|
973
|
+
*/
|
|
974
|
+
agentContext?: boolean;
|
|
918
975
|
}
|
|
919
976
|
/** The subset of `features` config the widget needs to render its controls. */
|
|
920
977
|
interface PublicFeatures {
|
|
@@ -1103,6 +1160,20 @@ declare function renderJson(value: unknown, original: string | undefined): strin
|
|
|
1103
1160
|
*/
|
|
1104
1161
|
declare function moduleImporter(files: Record<string, string>, root: string, sourceRoot: string): (fromFile: string, module: string) => string;
|
|
1105
1162
|
|
|
1163
|
+
/**
|
|
1164
|
+
* A prompt a developer pastes into their AI coding assistant (Claude Code,
|
|
1165
|
+
* Cursor, Copilot…) to add Frankie to their app. The docs show it with
|
|
1166
|
+
* placeholders; the dashboard fills in the workspace's own ID and public key.
|
|
1167
|
+
* It never contains a secret: FRANKIE_JWT_SECRET is only ever named.
|
|
1168
|
+
*/
|
|
1169
|
+
interface InstallPromptOptions {
|
|
1170
|
+
workspaceId?: string;
|
|
1171
|
+
publishableKey?: string;
|
|
1172
|
+
/** The workspace lets visitors chat without signing in: no token endpoint. */
|
|
1173
|
+
allowAnonymous?: boolean;
|
|
1174
|
+
}
|
|
1175
|
+
declare function installPrompt(options?: InstallPromptOptions): string;
|
|
1176
|
+
|
|
1106
1177
|
declare const skillSchema: z.ZodObject<{
|
|
1107
1178
|
id: z.ZodString;
|
|
1108
1179
|
name: z.ZodString;
|
|
@@ -1223,4 +1294,82 @@ declare function normalizeColor(raw: string): string | undefined;
|
|
|
1223
1294
|
*/
|
|
1224
1295
|
declare function inferTheme(files: Record<string, string>, root?: string): InferredTheme | undefined;
|
|
1225
1296
|
|
|
1226
|
-
|
|
1297
|
+
/** Who an end user is, as far as their own app's sign-in token said. */
|
|
1298
|
+
type EndUser = {
|
|
1299
|
+
id: string;
|
|
1300
|
+
displayName?: string;
|
|
1301
|
+
email?: string;
|
|
1302
|
+
anonymous: boolean;
|
|
1303
|
+
};
|
|
1304
|
+
/**
|
|
1305
|
+
* One label for the person behind a conversation, used by the list, the
|
|
1306
|
+
* transcript and the escalations inbox so they always agree. A token's name
|
|
1307
|
+
* wins, then its email; a signed-in user whose app sent neither still gets a
|
|
1308
|
+
* short id, so two people never read as the same "Signed-in user".
|
|
1309
|
+
*/
|
|
1310
|
+
declare function userLabel(user: EndUser): string;
|
|
1311
|
+
/** What a conversation log is built from: the stored conversation as the dashboard and the server both see it. */
|
|
1312
|
+
interface ConversationLogInput {
|
|
1313
|
+
id: string;
|
|
1314
|
+
title: string;
|
|
1315
|
+
createdAt: number;
|
|
1316
|
+
updatedAt: number;
|
|
1317
|
+
costUsd: number;
|
|
1318
|
+
busy: boolean;
|
|
1319
|
+
user: EndUser;
|
|
1320
|
+
/** The transcript the chat UI saved. */
|
|
1321
|
+
messages: unknown[];
|
|
1322
|
+
/** The server's model and tool transcript. */
|
|
1323
|
+
agentMessages: unknown[];
|
|
1324
|
+
escalations?: Array<{
|
|
1325
|
+
id: string;
|
|
1326
|
+
at: number;
|
|
1327
|
+
reason: string;
|
|
1328
|
+
summary: string;
|
|
1329
|
+
email?: string;
|
|
1330
|
+
name?: string;
|
|
1331
|
+
}>;
|
|
1332
|
+
}
|
|
1333
|
+
/**
|
|
1334
|
+
* One conversation as plain Markdown, written to be pasted into any LLM to ask
|
|
1335
|
+
* what happened: a summary, the chat as the person saw it, then the agent's
|
|
1336
|
+
* full trace (model messages, tool calls with their inputs, tool results and
|
|
1337
|
+
* errors). Images are noted, not inlined, and very long blocks are cut so the
|
|
1338
|
+
* log stays pasteable.
|
|
1339
|
+
*/
|
|
1340
|
+
declare function conversationLog(conversation: ConversationLogInput, options?: {
|
|
1341
|
+
workspace?: {
|
|
1342
|
+
id: string;
|
|
1343
|
+
name: string;
|
|
1344
|
+
};
|
|
1345
|
+
agent?: string;
|
|
1346
|
+
}): string;
|
|
1347
|
+
/** A file name for the downloaded log. */
|
|
1348
|
+
declare function conversationLogFileName(conversation: {
|
|
1349
|
+
id: string;
|
|
1350
|
+
title: string;
|
|
1351
|
+
}): string;
|
|
1352
|
+
|
|
1353
|
+
/** Where Frankie's sync workflow lives in a repository. */
|
|
1354
|
+
declare const API_SYNC_WORKFLOW_PATH = ".github/workflows/frankie-api-sync.yml";
|
|
1355
|
+
interface ApiSyncWorkflowOptions {
|
|
1356
|
+
/** The Frankie service the workflow posts to (the control plane's public URL). */
|
|
1357
|
+
url: string;
|
|
1358
|
+
/** The workspace id. */
|
|
1359
|
+
workspace: string;
|
|
1360
|
+
/** The API connection's name in that workspace. */
|
|
1361
|
+
api: string;
|
|
1362
|
+
/** The API description file in the repository, e.g. "public/openapi.json". */
|
|
1363
|
+
path: string;
|
|
1364
|
+
}
|
|
1365
|
+
/**
|
|
1366
|
+
* A repository-owned workflow that sends the API description to Frankie on
|
|
1367
|
+
* every push to the default branch that changes it. It holds no secret: it
|
|
1368
|
+
* asks GitHub for an OIDC token (audience "frankie") that proves the
|
|
1369
|
+
* repository and commit, and Frankie checks that against the workspace.
|
|
1370
|
+
*/
|
|
1371
|
+
declare function apiSyncWorkflow(options: ApiSyncWorkflowOptions): string;
|
|
1372
|
+
/** A plain file path in the repository: no traversal, quoting or glob characters. */
|
|
1373
|
+
declare function isSafeRepositoryPath(path: string): boolean;
|
|
1374
|
+
|
|
1375
|
+
export { API_SYNC_WORKFLOW_PATH, type ActionDecision, type ActionPreview, type AgentConfig, type ApiCapability, type ApiDocument, type ApiSourceConfig, type ApiSyncWorkflowOptions, type ApiToolInventory, type AuthConfig, type AuthStrategy, type BrandingConfig, type ChatAttachment, type ChatRequestBody, type ConversationLogInput, type CreateSessionBody, type CreateSessionResponse, type EndUser, FIREWORKS_MODELS, type FeaturesConfig, type FrankieConfig, type FrankieConfigInput, type FrankieErrorCode, type FrankieServerEvent, type HostToolRequest, type HostToolResult, type InferredTheme, type InstallPlan, type InstallProject, type InstallPromptOptions, type KnowledgeBaseConfig, type LimitsConfig, type LoadedSkill, type McpServerConfig, type ModelChoice, type ModelConfig, type PersonaProfile, type PublicFeatures, type PublicWidgetConfig, SKILL_TOOL_NAME, STANDARD_AGENT_IDS, STARTER_PROMPT_ICONS, type StarterPrompt, type StarterPromptIcon, type StopReason, type ThinkingLevel, type ToolDecision, type ToolPolicy, type ToolResultBody, type UsageSummary, type WidgetTheme, type WidgetThemeConfig, type WorkspaceSkill, activeSkills, agentConfigSchema, apiCapabilitySchema, apiMethods, apiOperations, apiSourceSchema, apiSyncWorkflow, approvedSkillTools, assertNoCommittedFrankieKeys, authConfigSchema, brandingConfigSchema, canonicalJson, compareApiDocuments, conversationLog, conversationLogFileName, defineFrankieConfig, describeTool, draftSkill, evaluateToolPolicy, featuresConfigSchema, frankieConfigSchema, inferTheme, insertImport, installAgentIds, installBranch, installPrompt, installTitle, isSafeRepositoryPath, knowledgeBaseSchema, knowledgeSourceSchema, limitsConfigSchema, matchPath, matchesAnyPagePattern, matchesInstallBranch, matchesPagePattern, mcpServerSchema, modelChoiceSchema, modelConfigSchema, moduleImporter, mountWidget, normalizeColor, operationId, parseFrankieConfig, personaEnvKey, personaInstructions, personaProfileSchema, plainText, planHostedInstall, renderJson, resolvePersonaConfig, sdkUpdateWorkflow, skillSchema, starterPromptSchema, suggestedPromptsFromSkills, thinkingLevelSchema, toolDescriptions, toolPolicySchema, userLabel, validateApiDocument, widgetThemeSchema, withDependencies };
|
package/dist/index.d.ts
CHANGED
|
@@ -248,6 +248,7 @@ declare const agentConfigSchema: z.ZodObject<{
|
|
|
248
248
|
denyByDefault: z.ZodDefault<z.ZodBoolean>;
|
|
249
249
|
}, z.core.$strip>>;
|
|
250
250
|
showToolActivity: z.ZodDefault<z.ZodBoolean>;
|
|
251
|
+
confirmWrites: z.ZodDefault<z.ZodBoolean>;
|
|
251
252
|
}, z.core.$strip>;
|
|
252
253
|
declare const authConfigSchema: z.ZodObject<{
|
|
253
254
|
publishableKey: z.ZodString;
|
|
@@ -348,6 +349,7 @@ declare const personaProfileSchema: z.ZodObject<{
|
|
|
348
349
|
denyByDefault: z.ZodDefault<z.ZodBoolean>;
|
|
349
350
|
}, z.core.$strip>>;
|
|
350
351
|
showToolActivity: z.ZodDefault<z.ZodBoolean>;
|
|
352
|
+
confirmWrites: z.ZodDefault<z.ZodBoolean>;
|
|
351
353
|
}, z.core.$strip>>;
|
|
352
354
|
features: z.ZodPrefault<z.ZodObject<{
|
|
353
355
|
attachments: z.ZodPrefault<z.ZodObject<{
|
|
@@ -454,6 +456,7 @@ declare const frankieConfigSchema: z.ZodObject<{
|
|
|
454
456
|
denyByDefault: z.ZodDefault<z.ZodBoolean>;
|
|
455
457
|
}, z.core.$strip>>;
|
|
456
458
|
showToolActivity: z.ZodDefault<z.ZodBoolean>;
|
|
459
|
+
confirmWrites: z.ZodDefault<z.ZodBoolean>;
|
|
457
460
|
}, z.core.$strip>>;
|
|
458
461
|
auth: z.ZodObject<{
|
|
459
462
|
publishableKey: z.ZodString;
|
|
@@ -624,6 +627,7 @@ declare const frankieConfigSchema: z.ZodObject<{
|
|
|
624
627
|
denyByDefault: z.ZodDefault<z.ZodBoolean>;
|
|
625
628
|
}, z.core.$strip>>;
|
|
626
629
|
showToolActivity: z.ZodDefault<z.ZodBoolean>;
|
|
630
|
+
confirmWrites: z.ZodDefault<z.ZodBoolean>;
|
|
627
631
|
}, z.core.$strip>>;
|
|
628
632
|
features: z.ZodPrefault<z.ZodObject<{
|
|
629
633
|
attachments: z.ZodPrefault<z.ZodObject<{
|
|
@@ -655,6 +659,7 @@ declare const frankieConfigSchema: z.ZodObject<{
|
|
|
655
659
|
maxPages: z.ZodDefault<z.ZodNumber>;
|
|
656
660
|
}, z.core.$strip>>;
|
|
657
661
|
}, z.core.$strip>>>;
|
|
662
|
+
agentId: z.ZodOptional<z.ZodString>;
|
|
658
663
|
}, z.core.$strip>;
|
|
659
664
|
type ThinkingLevel = z.infer<typeof thinkingLevelSchema>;
|
|
660
665
|
type WidgetThemeConfig = z.infer<typeof widgetThemeSchema>;
|
|
@@ -761,6 +766,18 @@ type FrankieServerEvent = {
|
|
|
761
766
|
name: string;
|
|
762
767
|
reason: string;
|
|
763
768
|
}
|
|
769
|
+
/**
|
|
770
|
+
* An action that changes data is waiting for the user. The widget shows it
|
|
771
|
+
* with Approve and Cancel and answers with `confirm` on the next message.
|
|
772
|
+
* Nothing has run yet; on Approve the server runs exactly this call.
|
|
773
|
+
*/
|
|
774
|
+
| {
|
|
775
|
+
type: "action_confirm";
|
|
776
|
+
toolUseId: string;
|
|
777
|
+
name: string;
|
|
778
|
+
label: string;
|
|
779
|
+
preview: ActionPreview;
|
|
780
|
+
}
|
|
764
781
|
/**
|
|
765
782
|
* Client-side tool execution: the server asks the widget to make one HTTP
|
|
766
783
|
* call to the host's own API, from the user's browser and on the user's
|
|
@@ -849,6 +866,13 @@ interface ChatRequestBody {
|
|
|
849
866
|
/** Omit to start a new conversation; the server replies with a `session` event. */
|
|
850
867
|
sessionId?: string;
|
|
851
868
|
message: string;
|
|
869
|
+
/**
|
|
870
|
+
* A fresh host-signed user token for the session's own user. Host tokens are
|
|
871
|
+
* short-lived (minutes) while a session lasts an hour, so the widget sends a
|
|
872
|
+
* new one with each message and the server forwards that one to the
|
|
873
|
+
* workspace's tools instead of the expired one it started with.
|
|
874
|
+
*/
|
|
875
|
+
userToken?: string;
|
|
852
876
|
/**
|
|
853
877
|
* Free-form page context the host passes through (current route, plan tier,
|
|
854
878
|
* feature flags). Surfaced to the agent as a system reminder, never trusted
|
|
@@ -862,6 +886,33 @@ interface ChatRequestBody {
|
|
|
862
886
|
model?: string;
|
|
863
887
|
/** Files attached to this turn. Honoured only when attachments are enabled. */
|
|
864
888
|
attachments?: ChatAttachment[];
|
|
889
|
+
/**
|
|
890
|
+
* The widget can show an `action_confirm` card. Without it, actions run as
|
|
891
|
+
* they always have, so an SDK that can't ask the user is never left with a
|
|
892
|
+
* paused action and no button to approve it.
|
|
893
|
+
*/
|
|
894
|
+
confirmActions?: boolean;
|
|
895
|
+
/**
|
|
896
|
+
* The widget renders Markdown tables, so the agent may answer report-style
|
|
897
|
+
* questions with one. Older widgets would show raw `|` text, so it's opt-in.
|
|
898
|
+
*/
|
|
899
|
+
markdownTables?: boolean;
|
|
900
|
+
/** The user's answer to the action waiting for approval (`action_confirm`). */
|
|
901
|
+
confirm?: ActionDecision;
|
|
902
|
+
}
|
|
903
|
+
/** Approve or cancel the action an `action_confirm` event paused. */
|
|
904
|
+
interface ActionDecision {
|
|
905
|
+
/** The `toolUseId` from the `action_confirm` event. */
|
|
906
|
+
toolUseId: string;
|
|
907
|
+
approved: boolean;
|
|
908
|
+
}
|
|
909
|
+
/** What an action that's waiting for approval will do, for the confirmation card. */
|
|
910
|
+
interface ActionPreview {
|
|
911
|
+
/** HTTP method and path for an API action, when there is one. */
|
|
912
|
+
method?: string;
|
|
913
|
+
path?: string;
|
|
914
|
+
/** The exact inputs it will run with. */
|
|
915
|
+
input?: unknown;
|
|
865
916
|
}
|
|
866
917
|
/** Client -> server body for `POST /v1/session`. */
|
|
867
918
|
interface CreateSessionBody {
|
|
@@ -915,6 +966,12 @@ interface PublicWidgetConfig {
|
|
|
915
966
|
features: PublicFeatures;
|
|
916
967
|
/** App-Router path globs this agent shows on; empty = every page no other agent claims. Optional so older servers stay compatible. */
|
|
917
968
|
pages?: string[];
|
|
969
|
+
/**
|
|
970
|
+
* Whether the chat shows the "Agent context" bar (skills and APIs loaded for
|
|
971
|
+
* the turn). Off for visitor-facing page agents such as Support and Docs,
|
|
972
|
+
* where it means nothing to the person chatting. Absent (older servers) = shown.
|
|
973
|
+
*/
|
|
974
|
+
agentContext?: boolean;
|
|
918
975
|
}
|
|
919
976
|
/** The subset of `features` config the widget needs to render its controls. */
|
|
920
977
|
interface PublicFeatures {
|
|
@@ -1103,6 +1160,20 @@ declare function renderJson(value: unknown, original: string | undefined): strin
|
|
|
1103
1160
|
*/
|
|
1104
1161
|
declare function moduleImporter(files: Record<string, string>, root: string, sourceRoot: string): (fromFile: string, module: string) => string;
|
|
1105
1162
|
|
|
1163
|
+
/**
|
|
1164
|
+
* A prompt a developer pastes into their AI coding assistant (Claude Code,
|
|
1165
|
+
* Cursor, Copilot…) to add Frankie to their app. The docs show it with
|
|
1166
|
+
* placeholders; the dashboard fills in the workspace's own ID and public key.
|
|
1167
|
+
* It never contains a secret: FRANKIE_JWT_SECRET is only ever named.
|
|
1168
|
+
*/
|
|
1169
|
+
interface InstallPromptOptions {
|
|
1170
|
+
workspaceId?: string;
|
|
1171
|
+
publishableKey?: string;
|
|
1172
|
+
/** The workspace lets visitors chat without signing in: no token endpoint. */
|
|
1173
|
+
allowAnonymous?: boolean;
|
|
1174
|
+
}
|
|
1175
|
+
declare function installPrompt(options?: InstallPromptOptions): string;
|
|
1176
|
+
|
|
1106
1177
|
declare const skillSchema: z.ZodObject<{
|
|
1107
1178
|
id: z.ZodString;
|
|
1108
1179
|
name: z.ZodString;
|
|
@@ -1223,4 +1294,82 @@ declare function normalizeColor(raw: string): string | undefined;
|
|
|
1223
1294
|
*/
|
|
1224
1295
|
declare function inferTheme(files: Record<string, string>, root?: string): InferredTheme | undefined;
|
|
1225
1296
|
|
|
1226
|
-
|
|
1297
|
+
/** Who an end user is, as far as their own app's sign-in token said. */
|
|
1298
|
+
type EndUser = {
|
|
1299
|
+
id: string;
|
|
1300
|
+
displayName?: string;
|
|
1301
|
+
email?: string;
|
|
1302
|
+
anonymous: boolean;
|
|
1303
|
+
};
|
|
1304
|
+
/**
|
|
1305
|
+
* One label for the person behind a conversation, used by the list, the
|
|
1306
|
+
* transcript and the escalations inbox so they always agree. A token's name
|
|
1307
|
+
* wins, then its email; a signed-in user whose app sent neither still gets a
|
|
1308
|
+
* short id, so two people never read as the same "Signed-in user".
|
|
1309
|
+
*/
|
|
1310
|
+
declare function userLabel(user: EndUser): string;
|
|
1311
|
+
/** What a conversation log is built from: the stored conversation as the dashboard and the server both see it. */
|
|
1312
|
+
interface ConversationLogInput {
|
|
1313
|
+
id: string;
|
|
1314
|
+
title: string;
|
|
1315
|
+
createdAt: number;
|
|
1316
|
+
updatedAt: number;
|
|
1317
|
+
costUsd: number;
|
|
1318
|
+
busy: boolean;
|
|
1319
|
+
user: EndUser;
|
|
1320
|
+
/** The transcript the chat UI saved. */
|
|
1321
|
+
messages: unknown[];
|
|
1322
|
+
/** The server's model and tool transcript. */
|
|
1323
|
+
agentMessages: unknown[];
|
|
1324
|
+
escalations?: Array<{
|
|
1325
|
+
id: string;
|
|
1326
|
+
at: number;
|
|
1327
|
+
reason: string;
|
|
1328
|
+
summary: string;
|
|
1329
|
+
email?: string;
|
|
1330
|
+
name?: string;
|
|
1331
|
+
}>;
|
|
1332
|
+
}
|
|
1333
|
+
/**
|
|
1334
|
+
* One conversation as plain Markdown, written to be pasted into any LLM to ask
|
|
1335
|
+
* what happened: a summary, the chat as the person saw it, then the agent's
|
|
1336
|
+
* full trace (model messages, tool calls with their inputs, tool results and
|
|
1337
|
+
* errors). Images are noted, not inlined, and very long blocks are cut so the
|
|
1338
|
+
* log stays pasteable.
|
|
1339
|
+
*/
|
|
1340
|
+
declare function conversationLog(conversation: ConversationLogInput, options?: {
|
|
1341
|
+
workspace?: {
|
|
1342
|
+
id: string;
|
|
1343
|
+
name: string;
|
|
1344
|
+
};
|
|
1345
|
+
agent?: string;
|
|
1346
|
+
}): string;
|
|
1347
|
+
/** A file name for the downloaded log. */
|
|
1348
|
+
declare function conversationLogFileName(conversation: {
|
|
1349
|
+
id: string;
|
|
1350
|
+
title: string;
|
|
1351
|
+
}): string;
|
|
1352
|
+
|
|
1353
|
+
/** Where Frankie's sync workflow lives in a repository. */
|
|
1354
|
+
declare const API_SYNC_WORKFLOW_PATH = ".github/workflows/frankie-api-sync.yml";
|
|
1355
|
+
interface ApiSyncWorkflowOptions {
|
|
1356
|
+
/** The Frankie service the workflow posts to (the control plane's public URL). */
|
|
1357
|
+
url: string;
|
|
1358
|
+
/** The workspace id. */
|
|
1359
|
+
workspace: string;
|
|
1360
|
+
/** The API connection's name in that workspace. */
|
|
1361
|
+
api: string;
|
|
1362
|
+
/** The API description file in the repository, e.g. "public/openapi.json". */
|
|
1363
|
+
path: string;
|
|
1364
|
+
}
|
|
1365
|
+
/**
|
|
1366
|
+
* A repository-owned workflow that sends the API description to Frankie on
|
|
1367
|
+
* every push to the default branch that changes it. It holds no secret: it
|
|
1368
|
+
* asks GitHub for an OIDC token (audience "frankie") that proves the
|
|
1369
|
+
* repository and commit, and Frankie checks that against the workspace.
|
|
1370
|
+
*/
|
|
1371
|
+
declare function apiSyncWorkflow(options: ApiSyncWorkflowOptions): string;
|
|
1372
|
+
/** A plain file path in the repository: no traversal, quoting or glob characters. */
|
|
1373
|
+
declare function isSafeRepositoryPath(path: string): boolean;
|
|
1374
|
+
|
|
1375
|
+
export { API_SYNC_WORKFLOW_PATH, type ActionDecision, type ActionPreview, type AgentConfig, type ApiCapability, type ApiDocument, type ApiSourceConfig, type ApiSyncWorkflowOptions, type ApiToolInventory, type AuthConfig, type AuthStrategy, type BrandingConfig, type ChatAttachment, type ChatRequestBody, type ConversationLogInput, type CreateSessionBody, type CreateSessionResponse, type EndUser, FIREWORKS_MODELS, type FeaturesConfig, type FrankieConfig, type FrankieConfigInput, type FrankieErrorCode, type FrankieServerEvent, type HostToolRequest, type HostToolResult, type InferredTheme, type InstallPlan, type InstallProject, type InstallPromptOptions, type KnowledgeBaseConfig, type LimitsConfig, type LoadedSkill, type McpServerConfig, type ModelChoice, type ModelConfig, type PersonaProfile, type PublicFeatures, type PublicWidgetConfig, SKILL_TOOL_NAME, STANDARD_AGENT_IDS, STARTER_PROMPT_ICONS, type StarterPrompt, type StarterPromptIcon, type StopReason, type ThinkingLevel, type ToolDecision, type ToolPolicy, type ToolResultBody, type UsageSummary, type WidgetTheme, type WidgetThemeConfig, type WorkspaceSkill, activeSkills, agentConfigSchema, apiCapabilitySchema, apiMethods, apiOperations, apiSourceSchema, apiSyncWorkflow, approvedSkillTools, assertNoCommittedFrankieKeys, authConfigSchema, brandingConfigSchema, canonicalJson, compareApiDocuments, conversationLog, conversationLogFileName, defineFrankieConfig, describeTool, draftSkill, evaluateToolPolicy, featuresConfigSchema, frankieConfigSchema, inferTheme, insertImport, installAgentIds, installBranch, installPrompt, installTitle, isSafeRepositoryPath, knowledgeBaseSchema, knowledgeSourceSchema, limitsConfigSchema, matchPath, matchesAnyPagePattern, matchesInstallBranch, matchesPagePattern, mcpServerSchema, modelChoiceSchema, modelConfigSchema, moduleImporter, mountWidget, normalizeColor, operationId, parseFrankieConfig, personaEnvKey, personaInstructions, personaProfileSchema, plainText, planHostedInstall, renderJson, resolvePersonaConfig, sdkUpdateWorkflow, skillSchema, starterPromptSchema, suggestedPromptsFromSkills, thinkingLevelSchema, toolDescriptions, toolPolicySchema, userLabel, validateApiDocument, widgetThemeSchema, withDependencies };
|