@frankieai/core 0.2.4 → 0.2.5

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.d.cts CHANGED
@@ -180,14 +180,35 @@ declare const toolPolicySchema: z.ZodObject<{
180
180
  denyByDefault: z.ZodDefault<z.ZodBoolean>;
181
181
  }, z.core.$strip>;
182
182
  /**
183
- * A starter card shown on the empty chat screen: a title and short description
184
- * the reader sees, and the message that is sent as if they typed it when they
185
- * click the card. Configured per workspace in the dashboard's Appearance tab.
183
+ * The icons a starter card may use, shared by the dashboard picker and the SDK
184
+ * so the choices stay in step. Each maps to a concrete icon in the widget.
185
+ */
186
+ declare const STARTER_PROMPT_ICONS: readonly ["sparkles", "wand", "book", "chat", "chart", "bolt", "music", "mic", "image", "compass", "lightbulb", "file"];
187
+ type StarterPromptIcon = (typeof STARTER_PROMPT_ICONS)[number];
188
+ /**
189
+ * A starter card shown on the empty chat screen: an icon, a title and short
190
+ * description the reader sees, and the message that is sent as if they typed it
191
+ * when they click the card. Configured per workspace in the dashboard's
192
+ * Appearance tab.
186
193
  */
187
194
  declare const starterPromptSchema: z.ZodObject<{
188
195
  title: z.ZodString;
189
196
  description: z.ZodOptional<z.ZodString>;
190
197
  message: z.ZodString;
198
+ icon: z.ZodOptional<z.ZodEnum<{
199
+ file: "file";
200
+ sparkles: "sparkles";
201
+ wand: "wand";
202
+ book: "book";
203
+ chat: "chat";
204
+ chart: "chart";
205
+ bolt: "bolt";
206
+ music: "music";
207
+ mic: "mic";
208
+ image: "image";
209
+ compass: "compass";
210
+ lightbulb: "lightbulb";
211
+ }>>;
191
212
  }, z.core.$strip>;
192
213
  declare const agentConfigSchema: z.ZodObject<{
193
214
  systemPrompt: z.ZodDefault<z.ZodString>;
@@ -197,6 +218,20 @@ declare const agentConfigSchema: z.ZodObject<{
197
218
  title: z.ZodString;
198
219
  description: z.ZodOptional<z.ZodString>;
199
220
  message: z.ZodString;
221
+ icon: z.ZodOptional<z.ZodEnum<{
222
+ file: "file";
223
+ sparkles: "sparkles";
224
+ wand: "wand";
225
+ book: "book";
226
+ chat: "chat";
227
+ chart: "chart";
228
+ bolt: "bolt";
229
+ music: "music";
230
+ mic: "mic";
231
+ image: "image";
232
+ compass: "compass";
233
+ lightbulb: "lightbulb";
234
+ }>>;
200
235
  }, z.core.$strip>>>;
201
236
  maxTurns: z.ZodDefault<z.ZodNumber>;
202
237
  maxBudgetUsd: z.ZodOptional<z.ZodNumber>;
@@ -286,6 +321,20 @@ declare const frankieConfigSchema: z.ZodObject<{
286
321
  title: z.ZodString;
287
322
  description: z.ZodOptional<z.ZodString>;
288
323
  message: z.ZodString;
324
+ icon: z.ZodOptional<z.ZodEnum<{
325
+ file: "file";
326
+ sparkles: "sparkles";
327
+ wand: "wand";
328
+ book: "book";
329
+ chat: "chat";
330
+ chart: "chart";
331
+ bolt: "bolt";
332
+ music: "music";
333
+ mic: "mic";
334
+ image: "image";
335
+ compass: "compass";
336
+ lightbulb: "lightbulb";
337
+ }>>;
289
338
  }, z.core.$strip>>>;
290
339
  maxTurns: z.ZodDefault<z.ZodNumber>;
291
340
  maxBudgetUsd: z.ZodOptional<z.ZodNumber>;
@@ -614,6 +663,8 @@ interface StarterPrompt {
614
663
  title: string;
615
664
  description?: string;
616
665
  message: string;
666
+ /** One of STARTER_PROMPT_ICONS; the widget maps it to a concrete icon. */
667
+ icon?: string;
617
668
  }
618
669
  /** The subset of tenant config the widget is allowed to see. */
619
670
  interface PublicWidgetConfig {
@@ -686,6 +737,13 @@ interface ToolDecision {
686
737
  * also allows every tool on the `acme` server.
687
738
  */
688
739
  declare function evaluateToolPolicy(toolName: string, policy: ToolPolicy): ToolDecision;
740
+ /**
741
+ * The agent-harness tool a skill-following agent calls to announce which
742
+ * reviewed workspace skill it is about to apply. It grants no permissions and
743
+ * does nothing on its own — it exists so a skill shows up in the transcript like
744
+ * any other tool call, instead of being followed invisibly.
745
+ */
746
+ declare const SKILL_TOOL_NAME = "frankie__use_skill";
689
747
  /** A short human label for a tool call, for the "Frankie is …" line in the UI. */
690
748
  declare function describeTool(toolName: string, input: unknown): string;
691
749
 
@@ -807,4 +865,4 @@ declare function compareApiDocuments(before: ApiDocument, after: ApiDocument): {
807
865
  unchangedIds: string[];
808
866
  };
809
867
 
810
- export { type AgentConfig, type ApiCapability, type ApiDocument, type ApiSourceConfig, type ApiToolInventory, type AuthConfig, type AuthStrategy, type BrandingConfig, type ChatAttachment, type ChatRequestBody, type CreateSessionBody, type CreateSessionResponse, FIREWORKS_MODELS, type FeaturesConfig, type FrankieConfig, type FrankieConfigInput, type FrankieErrorCode, type FrankieServerEvent, type HostToolRequest, type HostToolResult, type InstallPlan, type InstallProject, type LimitsConfig, type LoadedSkill, type McpServerConfig, type ModelChoice, type ModelConfig, type PublicFeatures, type PublicWidgetConfig, type StarterPrompt, type StopReason, type ThinkingLevel, type ToolDecision, type ToolPolicy, type ToolResultBody, type UsageSummary, type WidgetTheme, type WidgetThemeConfig, type WorkspaceSkill, activeSkills, agentConfigSchema, apiCapabilitySchema, apiMethods, apiOperations, apiSourceSchema, approvedSkillTools, assertNoCommittedFrankieKeys, authConfigSchema, brandingConfigSchema, canonicalJson, compareApiDocuments, defineFrankieConfig, describeTool, draftSkill, evaluateToolPolicy, featuresConfigSchema, frankieConfigSchema, limitsConfigSchema, matchPath, mcpServerSchema, modelChoiceSchema, modelConfigSchema, operationId, parseFrankieConfig, planHostedInstall, sdkUpdateWorkflow, skillSchema, starterPromptSchema, suggestedPromptsFromSkills, thinkingLevelSchema, toolDescriptions, toolPolicySchema, validateApiDocument, widgetThemeSchema };
868
+ export { type AgentConfig, type ApiCapability, type ApiDocument, type ApiSourceConfig, type ApiToolInventory, type AuthConfig, type AuthStrategy, type BrandingConfig, type ChatAttachment, type ChatRequestBody, type CreateSessionBody, type CreateSessionResponse, FIREWORKS_MODELS, type FeaturesConfig, type FrankieConfig, type FrankieConfigInput, type FrankieErrorCode, type FrankieServerEvent, type HostToolRequest, type HostToolResult, type InstallPlan, type InstallProject, type LimitsConfig, type LoadedSkill, type McpServerConfig, type ModelChoice, type ModelConfig, type PublicFeatures, type PublicWidgetConfig, SKILL_TOOL_NAME, 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, approvedSkillTools, assertNoCommittedFrankieKeys, authConfigSchema, brandingConfigSchema, canonicalJson, compareApiDocuments, defineFrankieConfig, describeTool, draftSkill, evaluateToolPolicy, featuresConfigSchema, frankieConfigSchema, limitsConfigSchema, matchPath, mcpServerSchema, modelChoiceSchema, modelConfigSchema, operationId, parseFrankieConfig, planHostedInstall, sdkUpdateWorkflow, skillSchema, starterPromptSchema, suggestedPromptsFromSkills, thinkingLevelSchema, toolDescriptions, toolPolicySchema, validateApiDocument, widgetThemeSchema };
package/dist/index.d.ts CHANGED
@@ -180,14 +180,35 @@ declare const toolPolicySchema: z.ZodObject<{
180
180
  denyByDefault: z.ZodDefault<z.ZodBoolean>;
181
181
  }, z.core.$strip>;
182
182
  /**
183
- * A starter card shown on the empty chat screen: a title and short description
184
- * the reader sees, and the message that is sent as if they typed it when they
185
- * click the card. Configured per workspace in the dashboard's Appearance tab.
183
+ * The icons a starter card may use, shared by the dashboard picker and the SDK
184
+ * so the choices stay in step. Each maps to a concrete icon in the widget.
185
+ */
186
+ declare const STARTER_PROMPT_ICONS: readonly ["sparkles", "wand", "book", "chat", "chart", "bolt", "music", "mic", "image", "compass", "lightbulb", "file"];
187
+ type StarterPromptIcon = (typeof STARTER_PROMPT_ICONS)[number];
188
+ /**
189
+ * A starter card shown on the empty chat screen: an icon, a title and short
190
+ * description the reader sees, and the message that is sent as if they typed it
191
+ * when they click the card. Configured per workspace in the dashboard's
192
+ * Appearance tab.
186
193
  */
187
194
  declare const starterPromptSchema: z.ZodObject<{
188
195
  title: z.ZodString;
189
196
  description: z.ZodOptional<z.ZodString>;
190
197
  message: z.ZodString;
198
+ icon: z.ZodOptional<z.ZodEnum<{
199
+ file: "file";
200
+ sparkles: "sparkles";
201
+ wand: "wand";
202
+ book: "book";
203
+ chat: "chat";
204
+ chart: "chart";
205
+ bolt: "bolt";
206
+ music: "music";
207
+ mic: "mic";
208
+ image: "image";
209
+ compass: "compass";
210
+ lightbulb: "lightbulb";
211
+ }>>;
191
212
  }, z.core.$strip>;
192
213
  declare const agentConfigSchema: z.ZodObject<{
193
214
  systemPrompt: z.ZodDefault<z.ZodString>;
@@ -197,6 +218,20 @@ declare const agentConfigSchema: z.ZodObject<{
197
218
  title: z.ZodString;
198
219
  description: z.ZodOptional<z.ZodString>;
199
220
  message: z.ZodString;
221
+ icon: z.ZodOptional<z.ZodEnum<{
222
+ file: "file";
223
+ sparkles: "sparkles";
224
+ wand: "wand";
225
+ book: "book";
226
+ chat: "chat";
227
+ chart: "chart";
228
+ bolt: "bolt";
229
+ music: "music";
230
+ mic: "mic";
231
+ image: "image";
232
+ compass: "compass";
233
+ lightbulb: "lightbulb";
234
+ }>>;
200
235
  }, z.core.$strip>>>;
201
236
  maxTurns: z.ZodDefault<z.ZodNumber>;
202
237
  maxBudgetUsd: z.ZodOptional<z.ZodNumber>;
@@ -286,6 +321,20 @@ declare const frankieConfigSchema: z.ZodObject<{
286
321
  title: z.ZodString;
287
322
  description: z.ZodOptional<z.ZodString>;
288
323
  message: z.ZodString;
324
+ icon: z.ZodOptional<z.ZodEnum<{
325
+ file: "file";
326
+ sparkles: "sparkles";
327
+ wand: "wand";
328
+ book: "book";
329
+ chat: "chat";
330
+ chart: "chart";
331
+ bolt: "bolt";
332
+ music: "music";
333
+ mic: "mic";
334
+ image: "image";
335
+ compass: "compass";
336
+ lightbulb: "lightbulb";
337
+ }>>;
289
338
  }, z.core.$strip>>>;
290
339
  maxTurns: z.ZodDefault<z.ZodNumber>;
291
340
  maxBudgetUsd: z.ZodOptional<z.ZodNumber>;
@@ -614,6 +663,8 @@ interface StarterPrompt {
614
663
  title: string;
615
664
  description?: string;
616
665
  message: string;
666
+ /** One of STARTER_PROMPT_ICONS; the widget maps it to a concrete icon. */
667
+ icon?: string;
617
668
  }
618
669
  /** The subset of tenant config the widget is allowed to see. */
619
670
  interface PublicWidgetConfig {
@@ -686,6 +737,13 @@ interface ToolDecision {
686
737
  * also allows every tool on the `acme` server.
687
738
  */
688
739
  declare function evaluateToolPolicy(toolName: string, policy: ToolPolicy): ToolDecision;
740
+ /**
741
+ * The agent-harness tool a skill-following agent calls to announce which
742
+ * reviewed workspace skill it is about to apply. It grants no permissions and
743
+ * does nothing on its own — it exists so a skill shows up in the transcript like
744
+ * any other tool call, instead of being followed invisibly.
745
+ */
746
+ declare const SKILL_TOOL_NAME = "frankie__use_skill";
689
747
  /** A short human label for a tool call, for the "Frankie is …" line in the UI. */
690
748
  declare function describeTool(toolName: string, input: unknown): string;
691
749
 
@@ -807,4 +865,4 @@ declare function compareApiDocuments(before: ApiDocument, after: ApiDocument): {
807
865
  unchangedIds: string[];
808
866
  };
809
867
 
810
- export { type AgentConfig, type ApiCapability, type ApiDocument, type ApiSourceConfig, type ApiToolInventory, type AuthConfig, type AuthStrategy, type BrandingConfig, type ChatAttachment, type ChatRequestBody, type CreateSessionBody, type CreateSessionResponse, FIREWORKS_MODELS, type FeaturesConfig, type FrankieConfig, type FrankieConfigInput, type FrankieErrorCode, type FrankieServerEvent, type HostToolRequest, type HostToolResult, type InstallPlan, type InstallProject, type LimitsConfig, type LoadedSkill, type McpServerConfig, type ModelChoice, type ModelConfig, type PublicFeatures, type PublicWidgetConfig, type StarterPrompt, type StopReason, type ThinkingLevel, type ToolDecision, type ToolPolicy, type ToolResultBody, type UsageSummary, type WidgetTheme, type WidgetThemeConfig, type WorkspaceSkill, activeSkills, agentConfigSchema, apiCapabilitySchema, apiMethods, apiOperations, apiSourceSchema, approvedSkillTools, assertNoCommittedFrankieKeys, authConfigSchema, brandingConfigSchema, canonicalJson, compareApiDocuments, defineFrankieConfig, describeTool, draftSkill, evaluateToolPolicy, featuresConfigSchema, frankieConfigSchema, limitsConfigSchema, matchPath, mcpServerSchema, modelChoiceSchema, modelConfigSchema, operationId, parseFrankieConfig, planHostedInstall, sdkUpdateWorkflow, skillSchema, starterPromptSchema, suggestedPromptsFromSkills, thinkingLevelSchema, toolDescriptions, toolPolicySchema, validateApiDocument, widgetThemeSchema };
868
+ export { type AgentConfig, type ApiCapability, type ApiDocument, type ApiSourceConfig, type ApiToolInventory, type AuthConfig, type AuthStrategy, type BrandingConfig, type ChatAttachment, type ChatRequestBody, type CreateSessionBody, type CreateSessionResponse, FIREWORKS_MODELS, type FeaturesConfig, type FrankieConfig, type FrankieConfigInput, type FrankieErrorCode, type FrankieServerEvent, type HostToolRequest, type HostToolResult, type InstallPlan, type InstallProject, type LimitsConfig, type LoadedSkill, type McpServerConfig, type ModelChoice, type ModelConfig, type PublicFeatures, type PublicWidgetConfig, SKILL_TOOL_NAME, 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, approvedSkillTools, assertNoCommittedFrankieKeys, authConfigSchema, brandingConfigSchema, canonicalJson, compareApiDocuments, defineFrankieConfig, describeTool, draftSkill, evaluateToolPolicy, featuresConfigSchema, frankieConfigSchema, limitsConfigSchema, matchPath, mcpServerSchema, modelChoiceSchema, modelConfigSchema, operationId, parseFrankieConfig, planHostedInstall, sdkUpdateWorkflow, skillSchema, starterPromptSchema, suggestedPromptsFromSkills, thinkingLevelSchema, toolDescriptions, toolPolicySchema, validateApiDocument, widgetThemeSchema };
package/dist/index.js CHANGED
@@ -26,12 +26,24 @@ function matches(toolName, pattern) {
26
26
  if (toolName === pattern) return true;
27
27
  return toolName.startsWith(`${pattern}__`);
28
28
  }
29
+ var SKILL_TOOL_NAME = "frankie__use_skill";
29
30
  function describeTool(toolName, input) {
31
+ if (toolName === SKILL_TOOL_NAME) {
32
+ const skill = typeof input === "object" && input !== null ? input["skill"] : void 0;
33
+ return typeof skill === "string" && skill.trim() ? `Using skill: ${skill.trim()}` : "Using a skill";
34
+ }
30
35
  const mcp = /^mcp__([^_]+(?:_[^_]+)*)__(.+)$/.exec(toolName);
31
36
  if (mcp) {
32
37
  const [, server, tool] = mcp;
33
38
  return `${humanise(tool ?? toolName)} \xB7 ${server}`;
34
39
  }
40
+ if (toolName.startsWith("api__")) {
41
+ const rest = toolName.slice("api__".length);
42
+ const sep = rest.indexOf("__");
43
+ const operation = (sep >= 0 ? rest.slice(sep + 2) : rest).replace(/__+/g, "_");
44
+ const verb = /^(get|post|put|patch|delete|head|options)_(.+)$/i.exec(operation);
45
+ return verb ? `${verb[1].toUpperCase()} ${humanise(verb[2])}` : humanise(operation);
46
+ }
35
47
  const inputRecord = typeof input === "object" && input !== null ? input : {};
36
48
  const hint = inputRecord["path"] ?? inputRecord["url"] ?? inputRecord["query"] ?? inputRecord["command"];
37
49
  return typeof hint === "string" ? `${humanise(toolName)}: ${truncate(hint, 60)}` : humanise(toolName);
@@ -364,10 +376,26 @@ var toolPolicySchema = z2.object({
364
376
  */
365
377
  denyByDefault: z2.boolean().default(true)
366
378
  });
379
+ var STARTER_PROMPT_ICONS = [
380
+ "sparkles",
381
+ "wand",
382
+ "book",
383
+ "chat",
384
+ "chart",
385
+ "bolt",
386
+ "music",
387
+ "mic",
388
+ "image",
389
+ "compass",
390
+ "lightbulb",
391
+ "file"
392
+ ];
367
393
  var starterPromptSchema = z2.object({
368
394
  title: z2.string().trim().min(1).max(80),
369
395
  description: z2.string().trim().max(160).optional(),
370
- message: z2.string().trim().min(1).max(2e3)
396
+ message: z2.string().trim().min(1).max(2e3),
397
+ /** One of STARTER_PROMPT_ICONS; unknown values fall back to a default icon. */
398
+ icon: z2.enum(STARTER_PROMPT_ICONS).optional()
371
399
  });
372
400
  var agentConfigSchema = z2.object({
373
401
  /** Prepended to the runtime's own operating instructions. */
@@ -1050,6 +1078,8 @@ function compareApiDocuments(before, after) {
1050
1078
  }
1051
1079
  export {
1052
1080
  FIREWORKS_MODELS,
1081
+ SKILL_TOOL_NAME,
1082
+ STARTER_PROMPT_ICONS,
1053
1083
  activeSkills,
1054
1084
  agentConfigSchema,
1055
1085
  apiCapabilitySchema,