framer-api 0.1.14-beta → 0.1.16
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.ts +208 -156
- package/dist/index.js +6 -6
- package/package.json +7 -4
package/dist/index.d.ts
CHANGED
|
@@ -64,8 +64,12 @@ interface RunSupervisorAgentCommandOptions {
|
|
|
64
64
|
goal: string;
|
|
65
65
|
/** Supervisor model id, optionally with eval-style reasoning effort suffix, e.g. `anthropic/claude-opus-4.6=low`. */
|
|
66
66
|
model: string;
|
|
67
|
-
/**
|
|
68
|
-
|
|
67
|
+
/**
|
|
68
|
+
* Inner Framer Agent model override. Defaults to `model` when omitted.
|
|
69
|
+
*
|
|
70
|
+
* Supports the same `model=effort` syntax. Omitting effort is equivalent to `none`.
|
|
71
|
+
*/
|
|
72
|
+
framerAgentModel?: string;
|
|
69
73
|
pagePath?: string;
|
|
70
74
|
maxSteps?: number;
|
|
71
75
|
/** When true, capture per-step (system, tools, messages) → response training rows for SFT. */
|
|
@@ -78,6 +82,10 @@ interface RunSupervisorAgentCommandResult {
|
|
|
78
82
|
trainingDataFilename?: string;
|
|
79
83
|
/** JSONL string with one training row per inner-agent step, present when `captureTrainingData` was set. */
|
|
80
84
|
trainingDataJsonl?: string;
|
|
85
|
+
/** Replay trace filename, present when the inner agent produced at least one model step. */
|
|
86
|
+
traceFilename?: string;
|
|
87
|
+
/** Replay trace JSON with system, tools, and final ModelMessage conversation. */
|
|
88
|
+
traceJson?: string;
|
|
81
89
|
/** Document fixture filename, always present after a completed run. */
|
|
82
90
|
fixtureFilename: string;
|
|
83
91
|
/** Document fixture JSON content (tree + code files). */
|
|
@@ -112,6 +120,27 @@ interface ContinueAgentConversationOptions extends AgentTurnOptions {
|
|
|
112
120
|
conversationId: string;
|
|
113
121
|
}
|
|
114
122
|
|
|
123
|
+
interface AgentBranch {
|
|
124
|
+
id: string;
|
|
125
|
+
title: string;
|
|
126
|
+
url: string;
|
|
127
|
+
baseId?: string;
|
|
128
|
+
joined: boolean;
|
|
129
|
+
}
|
|
130
|
+
interface AgentBranchCollectionItemChange {
|
|
131
|
+
nodeId: string;
|
|
132
|
+
name: string;
|
|
133
|
+
isRemoved: boolean;
|
|
134
|
+
}
|
|
135
|
+
interface AgentBranchChange {
|
|
136
|
+
type: "page" | "collection" | "designPage" | "siteSettings" | "component" | "layoutTemplate";
|
|
137
|
+
nodeId: string;
|
|
138
|
+
name: string;
|
|
139
|
+
isRemoved: boolean;
|
|
140
|
+
items?: AgentBranchCollectionItemChange[];
|
|
141
|
+
settingsTab?: "general" | "redirects";
|
|
142
|
+
}
|
|
143
|
+
|
|
115
144
|
/** @alpha */
|
|
116
145
|
interface Breakpoint {
|
|
117
146
|
/** Name of the breakpoint as displayed on the node */
|
|
@@ -4667,34 +4696,6 @@ declare const getChangedPaths: unique symbol;
|
|
|
4667
4696
|
declare const getChangeContributors: unique symbol;
|
|
4668
4697
|
declare const createManagedCollection: unique symbol;
|
|
4669
4698
|
declare const rejectAllPending: unique symbol;
|
|
4670
|
-
declare const readProjectForAgent: unique symbol;
|
|
4671
|
-
declare const readComponentControlsForAgent: unique symbol;
|
|
4672
|
-
declare const readIconSetControlsForAgent: unique symbol;
|
|
4673
|
-
declare const readIconsForAgent: unique symbol;
|
|
4674
|
-
declare const readLayoutTemplateControlsForAgent: unique symbol;
|
|
4675
|
-
declare const readShaderControlsForAgent: unique symbol;
|
|
4676
|
-
declare const getAgentSystemPrompt: unique symbol;
|
|
4677
|
-
declare const getAgentContext: unique symbol;
|
|
4678
|
-
declare const applyAgentChanges: unique symbol;
|
|
4679
|
-
declare const flattenComponentInstanceForAgent: unique symbol;
|
|
4680
|
-
declare const getAncestorsForAgent: unique symbol;
|
|
4681
|
-
declare const getGroundNodeForAgent: unique symbol;
|
|
4682
|
-
declare const getNodeForAgent: unique symbol;
|
|
4683
|
-
declare const getNodesForAgent: unique symbol;
|
|
4684
|
-
declare const getNodesOfTypesForAgent: unique symbol;
|
|
4685
|
-
declare const getParentNodeForAgent: unique symbol;
|
|
4686
|
-
declare const getScopeNodeForAgent: unique symbol;
|
|
4687
|
-
declare const makeExternalComponentLocalForAgent: unique symbol;
|
|
4688
|
-
declare const paginateForAgent: unique symbol;
|
|
4689
|
-
declare const publishForAgent: unique symbol;
|
|
4690
|
-
declare const queryImagesForAgent: unique symbol;
|
|
4691
|
-
declare const reviewChangesForAgent: unique symbol;
|
|
4692
|
-
declare const serializeForAgent: unique symbol;
|
|
4693
|
-
declare const serializeNodesForAgent: unique symbol;
|
|
4694
|
-
declare const startAgentConversation: unique symbol;
|
|
4695
|
-
declare const continueAgentConversation: unique symbol;
|
|
4696
|
-
declare const submitAgentClarification: unique symbol;
|
|
4697
|
-
declare const runSupervisorAgentCommand: unique symbol;
|
|
4698
4699
|
declare const ping: unique symbol;
|
|
4699
4700
|
declare const $framerApiOnly: {
|
|
4700
4701
|
readonly ping: typeof ping;
|
|
@@ -4705,34 +4706,6 @@ declare const $framerApiOnly: {
|
|
|
4705
4706
|
readonly getChangeContributors: typeof getChangeContributors;
|
|
4706
4707
|
readonly createManagedCollection: typeof createManagedCollection;
|
|
4707
4708
|
readonly rejectAllPending: typeof rejectAllPending;
|
|
4708
|
-
readonly readProjectForAgent: typeof readProjectForAgent;
|
|
4709
|
-
readonly readComponentControlsForAgent: typeof readComponentControlsForAgent;
|
|
4710
|
-
readonly readIconSetControlsForAgent: typeof readIconSetControlsForAgent;
|
|
4711
|
-
readonly readIconsForAgent: typeof readIconsForAgent;
|
|
4712
|
-
readonly readLayoutTemplateControlsForAgent: typeof readLayoutTemplateControlsForAgent;
|
|
4713
|
-
readonly readShaderControlsForAgent: typeof readShaderControlsForAgent;
|
|
4714
|
-
readonly getAgentSystemPrompt: typeof getAgentSystemPrompt;
|
|
4715
|
-
readonly getAgentContext: typeof getAgentContext;
|
|
4716
|
-
readonly applyAgentChanges: typeof applyAgentChanges;
|
|
4717
|
-
readonly flattenComponentInstanceForAgent: typeof flattenComponentInstanceForAgent;
|
|
4718
|
-
readonly getAncestorsForAgent: typeof getAncestorsForAgent;
|
|
4719
|
-
readonly getGroundNodeForAgent: typeof getGroundNodeForAgent;
|
|
4720
|
-
readonly getNodeForAgent: typeof getNodeForAgent;
|
|
4721
|
-
readonly getNodesForAgent: typeof getNodesForAgent;
|
|
4722
|
-
readonly getNodesOfTypesForAgent: typeof getNodesOfTypesForAgent;
|
|
4723
|
-
readonly getParentNodeForAgent: typeof getParentNodeForAgent;
|
|
4724
|
-
readonly getScopeNodeForAgent: typeof getScopeNodeForAgent;
|
|
4725
|
-
readonly makeExternalComponentLocalForAgent: typeof makeExternalComponentLocalForAgent;
|
|
4726
|
-
readonly paginateForAgent: typeof paginateForAgent;
|
|
4727
|
-
readonly publishForAgent: typeof publishForAgent;
|
|
4728
|
-
readonly queryImagesForAgent: typeof queryImagesForAgent;
|
|
4729
|
-
readonly reviewChangesForAgent: typeof reviewChangesForAgent;
|
|
4730
|
-
readonly serializeForAgent: typeof serializeForAgent;
|
|
4731
|
-
readonly serializeNodesForAgent: typeof serializeNodesForAgent;
|
|
4732
|
-
readonly startAgentConversation: typeof startAgentConversation;
|
|
4733
|
-
readonly continueAgentConversation: typeof continueAgentConversation;
|
|
4734
|
-
readonly submitAgentClarification: typeof submitAgentClarification;
|
|
4735
|
-
readonly runSupervisorAgentCommand: typeof runSupervisorAgentCommand;
|
|
4736
4709
|
};
|
|
4737
4710
|
|
|
4738
4711
|
type Ownership = {
|
|
@@ -4806,7 +4779,7 @@ type AllMembers = Omit<FramerPluginAPIAlpha, "isAllowedTo" | "subscribeToIsAllow
|
|
|
4806
4779
|
"WebPageNode.clone": WebPageNode["clone"];
|
|
4807
4780
|
"DesignPageNode.clone": DesignPageNode["clone"];
|
|
4808
4781
|
} & NamespaceMembers<ColorStyle, "ColorStyle"> & NamespaceMembers<TextStyle, "TextStyle"> & NamespaceMembers<Variable, "Variable"> & NamespaceMembers<BooleanVariable, "BooleanVariable", Variable> & NamespaceMembers<NumberVariable, "NumberVariable", Variable> & NamespaceMembers<StringVariable, "StringVariable", Variable> & NamespaceMembers<FormattedTextVariable, "FormattedTextVariable", Variable> & NamespaceMembers<EnumCase, "EnumCase"> & NamespaceMembers<EnumVariable, "EnumVariable", Variable> & NamespaceMembers<ColorVariable, "ColorVariable", Variable> & NamespaceMembers<ImageVariable, "ImageVariable", Variable> & NamespaceMembers<FileVariable, "FileVariable", Variable> & NamespaceMembers<LinkVariable, "LinkVariable", Variable> & NamespaceMembers<DateVariable, "DateVariable", Variable> & NamespaceMembers<BorderVariable, "BorderVariable", Variable> & NamespaceMembers<UnsupportedVariable, "UnsupportedVariable", Variable> & NamespaceMembers<VectorSet, "VectorSet"> & NamespaceMembers<VectorSetItem, "VectorSetItem">;
|
|
4809
|
-
declare const unprotectedMessageTypesSource: ["closeNotification", "closePlugin", "setCloseWarning", "getActiveCollection", "getActiveLocale", "getActiveManagedCollection", "getCanvasRoot", "getChildren", "getCollection", "getCollectionFields", "getCollectionFields2", "getCollectionItems", "getCollectionItems2", "getCollections", "getColorStyle", "getColorStyles", "getCurrentUser", "getCurrentUser2", "getCustomCode", "getDefaultLocale", "getFont", "getFonts", "getImage", "getImageData", "getLocales", "getLocaleLanguages", "getLocaleRegions", "getLocalizationGroups", "getManagedCollection", "getManagedCollectionFields", "getManagedCollectionFields2", "getManagedCollectionItemIds", "getManagedCollections", "getNode", "getNodesWithAttribute", "getNodesWithAttributeSet", "getNodesWithType", "getParent", "getPluginData", "getPluginDataForNode", "getPluginDataKeys", "getPluginDataKeysForNode", "getProjectInfo", "getProjectInfo2", "getPublishInfo", "getRect", "getSelection", "getSVGForNode", "getText", "getTextForNode", "getTextStyle", "getTextStyles", "hideUI", "setBackgroundMessage", "notify", "onPointerDown", "setActiveCollection", "setSelection", "showUI", "getCodeFileVersionContent", "typecheckCode", "getCodeFileVersions", "getCodeFiles", "getCodeFile", "unstable_getDependencyVersion", "getRedirects", "uploadFile", "uploadFiles", "uploadImage", "uploadImages", "zoomIntoView", "navigateTo", "getRuntimeErrorForModule", "getRuntimeErrorForCodeComponentNode", "showProgressOnInstances", "removeProgressFromInstances", "addComponentInstancePlaceholder", "updateComponentInstancePlaceholder", "removeComponentInstancePlaceholder", "setMenu", "showContextMenu", "getBreakpointSuggestionsForWebPage", "getActiveCollectionItemForWebPage", "getVariables", "getVectorSets", "getVectorSetItems", "getVectorSetItemVariables", "getChangedPaths", "getChangeContributors", "getDeployments", "readProjectForAgent", "readComponentControlsForAgent", "readIconSetControlsForAgent", "readIconsForAgent", "readLayoutTemplateControlsForAgent", "readShaderControlsForAgent", "getAgentSystemPrompt", "getAgentContext", "ping", "queryImagesForAgent", "reviewChangesForAgent", "getNodeForAgent", "getNodesForAgent", "getNodesOfTypesForAgent", "getScopeNodeForAgent", "getGroundNodeForAgent", "getParentNodeForAgent", "getAncestorsForAgent", "paginateForAgent", "serializeForAgent", "serializeNodesForAgent", "INTERNAL_getAiServiceInfo", "INTERNAL_sendTrackingEvent", "INTERNAL_getCurrentUser", "INTERNAL_getProjectInfo", "INTERNAL_getHTMLForNode", "getAiServiceInfo", "sendTrackingEvent", "unstable_getCodeFile", "unstable_getCodeFiles", "unstable_getCodeFileVersionContent", "unstable_getCodeFileLint2", "unstable_getCodeFileTypecheck2", "unstable_getCodeFileVersions", "lintCode"];
|
|
4782
|
+
declare const unprotectedMessageTypesSource: ["closeNotification", "closePlugin", "setCloseWarning", "getActiveCollection", "getActiveLocale", "getActiveManagedCollection", "getCanvasRoot", "getChildren", "getCollection", "getCollectionFields", "getCollectionFields2", "getCollectionItems", "getCollectionItems2", "getCollections", "getColorStyle", "getColorStyles", "getCurrentUser", "getCurrentUser2", "getCustomCode", "getDefaultLocale", "getFont", "getFonts", "getImage", "getImageData", "getLocales", "getLocaleLanguages", "getLocaleRegions", "getLocalizationGroups", "getManagedCollection", "getManagedCollectionFields", "getManagedCollectionFields2", "getManagedCollectionItemIds", "getManagedCollections", "getNode", "getNodesWithAttribute", "getNodesWithAttributeSet", "getNodesWithType", "getParent", "getPluginData", "getPluginDataForNode", "getPluginDataKeys", "getPluginDataKeysForNode", "getProjectInfo", "getProjectInfo2", "getPublishInfo", "getRect", "getSelection", "getSVGForNode", "getText", "getTextForNode", "getTextStyle", "getTextStyles", "hideUI", "setBackgroundMessage", "notify", "onPointerDown", "setActiveCollection", "setSelection", "showUI", "getCodeFileVersionContent", "typecheckCode", "getCodeFileVersions", "getCodeFiles", "getCodeFile", "unstable_getDependencyVersion", "getRedirects", "uploadFile", "uploadFiles", "uploadImage", "uploadImages", "zoomIntoView", "navigateTo", "getRuntimeErrorForModule", "getRuntimeErrorForCodeComponentNode", "showProgressOnInstances", "removeProgressFromInstances", "addComponentInstancePlaceholder", "updateComponentInstancePlaceholder", "removeComponentInstancePlaceholder", "setMenu", "showContextMenu", "getBreakpointSuggestionsForWebPage", "getActiveCollectionItemForWebPage", "getVariables", "getVectorSets", "getVectorSetItems", "getVectorSetItemVariables", "getChangedPaths", "getChangeContributors", "getDeployments", "readProjectForAgent", "readComponentControlsForAgent", "readIconSetControlsForAgent", "readIconsForAgent", "readLayoutTemplateControlsForAgent", "readShaderControlsForAgent", "getAgentSystemPrompt", "getAgentContext", "getActiveBranchForAgent", "getBranchesForAgent", "getBranchChangesForAgent", "ping", "queryImagesForAgent", "reviewChangesForAgent", "getNodeForAgent", "getNodesForAgent", "getNodesOfTypesForAgent", "getScopeNodeForAgent", "getGroundNodeForAgent", "getParentNodeForAgent", "getAncestorsForAgent", "paginateForAgent", "serializeForAgent", "serializeNodesForAgent", "INTERNAL_getAiServiceInfo", "INTERNAL_sendTrackingEvent", "INTERNAL_getCurrentUser", "INTERNAL_getProjectInfo", "INTERNAL_getHTMLForNode", "getAiServiceInfo", "sendTrackingEvent", "unstable_getCodeFile", "unstable_getCodeFiles", "unstable_getCodeFileVersionContent", "unstable_getCodeFileLint2", "unstable_getCodeFileTypecheck2", "unstable_getCodeFileVersions", "lintCode"];
|
|
4810
4783
|
type UnprotectedMessageType = (typeof unprotectedMessageTypesSource)[number];
|
|
4811
4784
|
type ProtectedMessageType = Exclude<keyof PluginMessageAPI, UnprotectedMessageType>;
|
|
4812
4785
|
type Method = keyof {
|
|
@@ -5051,35 +5024,7 @@ declare const methodToMessageTypes: {
|
|
|
5051
5024
|
readonly [getChangeContributors]: [];
|
|
5052
5025
|
readonly [createManagedCollection]: ["createManagedCollection"];
|
|
5053
5026
|
readonly [rejectAllPending]: [];
|
|
5054
|
-
readonly [readProjectForAgent]: [];
|
|
5055
|
-
readonly [readComponentControlsForAgent]: [];
|
|
5056
|
-
readonly [readIconSetControlsForAgent]: [];
|
|
5057
|
-
readonly [readIconsForAgent]: [];
|
|
5058
|
-
readonly [readLayoutTemplateControlsForAgent]: [];
|
|
5059
|
-
readonly [readShaderControlsForAgent]: [];
|
|
5060
|
-
readonly [getAgentSystemPrompt]: [];
|
|
5061
|
-
readonly [getAgentContext]: [];
|
|
5062
5027
|
readonly [ping]: [];
|
|
5063
|
-
readonly [applyAgentChanges]: ["applyAgentChanges"];
|
|
5064
|
-
readonly [flattenComponentInstanceForAgent]: ["flattenComponentInstanceForAgent"];
|
|
5065
|
-
readonly [getAncestorsForAgent]: [];
|
|
5066
|
-
readonly [getGroundNodeForAgent]: [];
|
|
5067
|
-
readonly [getNodeForAgent]: [];
|
|
5068
|
-
readonly [getNodesForAgent]: [];
|
|
5069
|
-
readonly [getNodesOfTypesForAgent]: [];
|
|
5070
|
-
readonly [getParentNodeForAgent]: [];
|
|
5071
|
-
readonly [getScopeNodeForAgent]: [];
|
|
5072
|
-
readonly [makeExternalComponentLocalForAgent]: ["makeExternalComponentLocalForAgent"];
|
|
5073
|
-
readonly [paginateForAgent]: [];
|
|
5074
|
-
readonly [publishForAgent]: ["publishForAgent"];
|
|
5075
|
-
readonly [queryImagesForAgent]: [];
|
|
5076
|
-
readonly [reviewChangesForAgent]: [];
|
|
5077
|
-
readonly [serializeForAgent]: [];
|
|
5078
|
-
readonly [serializeNodesForAgent]: [];
|
|
5079
|
-
readonly [startAgentConversation]: ["startAgentConversation"];
|
|
5080
|
-
readonly [continueAgentConversation]: ["continueAgentConversation"];
|
|
5081
|
-
readonly [submitAgentClarification]: ["submitAgentClarification"];
|
|
5082
|
-
readonly [runSupervisorAgentCommand]: ["runSupervisorAgentCommand"];
|
|
5083
5028
|
};
|
|
5084
5029
|
type AllMethods = keyof {
|
|
5085
5030
|
[K in Method as (typeof methodToMessageTypes)[K] extends [] ? never : K]: (typeof methodToMessageTypes)[K];
|
|
@@ -6576,6 +6521,20 @@ declare class FramerPluginAPIAlpha extends FramerPluginAPIBeta {
|
|
|
6576
6521
|
[$framerApiOnly.createManagedCollection](name: string): Promise<ManagedCollection>;
|
|
6577
6522
|
/** @internal - Rejects all pending method calls with the given error */
|
|
6578
6523
|
[$framerApiOnly.rejectAllPending](error: FramerPluginError): void;
|
|
6524
|
+
/** Liveness round-trip: resolves once Vekter's plugin handler answers. Used by the headless backend to verify the transport actually routes, not just that the page is alive. */
|
|
6525
|
+
[$framerApiOnly.ping](): Promise<void>;
|
|
6526
|
+
}
|
|
6527
|
+
/**
|
|
6528
|
+
* Agent-specific methods exposed by framer-api as its agent namespace.
|
|
6529
|
+
*
|
|
6530
|
+
* Each method delegates to the corresponding wire-protocol name on the engine
|
|
6531
|
+
* (e.g. `agent.publish(...)` invokes `"publishForAgent"`).
|
|
6532
|
+
*
|
|
6533
|
+
* @internal - Available only through framer-api
|
|
6534
|
+
*/
|
|
6535
|
+
declare class FramerAgentAPI {
|
|
6536
|
+
#private;
|
|
6537
|
+
constructor(engine: PluginEngine);
|
|
6579
6538
|
/**
|
|
6580
6539
|
* Returns the static agent system prompt as a string.
|
|
6581
6540
|
*
|
|
@@ -6583,17 +6542,17 @@ declare class FramerPluginAPIAlpha extends FramerPluginAPIBeta {
|
|
|
6583
6542
|
* - **Command reference** — syntax for adding, updating, removing, moving, and duplicating nodes.
|
|
6584
6543
|
* - **Design rules** — spacing, layout, typography, and responsive design guidance.
|
|
6585
6544
|
* - **Examples** — common UI patterns expressed as commands.
|
|
6586
|
-
* - **`
|
|
6545
|
+
* - **`readProject` query reference** — available query types and their parameters.
|
|
6587
6546
|
*
|
|
6588
|
-
* This is the sole documentation for the command syntax used by {@link
|
|
6589
|
-
* and the query types used by {@link
|
|
6547
|
+
* This is the sole documentation for the command syntax used by {@link applyChanges}
|
|
6548
|
+
* and the query types used by {@link readProject}.
|
|
6590
6549
|
*
|
|
6591
6550
|
* The prompt is static and does not depend on any specific project.
|
|
6592
|
-
* Call {@link
|
|
6551
|
+
* Call {@link getContext} to get the project-specific context.
|
|
6593
6552
|
*
|
|
6594
6553
|
* @returns A string containing the agent system prompt.
|
|
6595
6554
|
*/
|
|
6596
|
-
|
|
6555
|
+
getSystemPrompt(): Promise<string>;
|
|
6597
6556
|
/**
|
|
6598
6557
|
* Returns the dynamic project context as a string.
|
|
6599
6558
|
*
|
|
@@ -6604,108 +6563,176 @@ declare class FramerPluginAPIAlpha extends FramerPluginAPIBeta {
|
|
|
6604
6563
|
* - **Style presets** — text style presets defined in the project.
|
|
6605
6564
|
* - **Icon sets** — available icon sets and their definitions.
|
|
6606
6565
|
*
|
|
6607
|
-
* This data changes per project
|
|
6608
|
-
* from {@link
|
|
6566
|
+
* This data changes per project. Pair with the static prompt
|
|
6567
|
+
* from {@link getSystemPrompt} for complete agent context.
|
|
6609
6568
|
*
|
|
6610
|
-
* @param options.pagePath - Target page path (e.g. `"/about"`). Defaults to the active page.
|
|
6611
6569
|
* @returns A string containing the project context.
|
|
6612
6570
|
*/
|
|
6613
|
-
|
|
6614
|
-
|
|
6615
|
-
|
|
6571
|
+
getContext(): Promise<string>;
|
|
6572
|
+
/**
|
|
6573
|
+
* Returns the active project branch.
|
|
6574
|
+
*
|
|
6575
|
+
* @returns Branch metadata for the active branch.
|
|
6576
|
+
*/
|
|
6577
|
+
getActiveBranch(): Promise<AgentBranch>;
|
|
6578
|
+
/**
|
|
6579
|
+
* Returns the project branches.
|
|
6580
|
+
*
|
|
6581
|
+
* @returns Branch metadata for each available branch.
|
|
6582
|
+
*/
|
|
6583
|
+
getBranches(): Promise<AgentBranch[]>;
|
|
6584
|
+
/**
|
|
6585
|
+
* Returns a summarized changelog for a branch.
|
|
6586
|
+
*
|
|
6587
|
+
* @param branchId - Branch id.
|
|
6588
|
+
*/
|
|
6589
|
+
getBranchChanges(branchId: string): Promise<AgentBranchChange[]>;
|
|
6590
|
+
/**
|
|
6591
|
+
* Switches the active project branch.
|
|
6592
|
+
*
|
|
6593
|
+
* @param branchId - Branch id. Use `"main"` for the main branch.
|
|
6594
|
+
*/
|
|
6595
|
+
switchBranch(branchId: string): Promise<void>;
|
|
6596
|
+
/**
|
|
6597
|
+
* Creates a branch and switches to it.
|
|
6598
|
+
*
|
|
6599
|
+
* @param title - Optional branch title. The new branch is created from the active branch.
|
|
6600
|
+
* @returns The created branch.
|
|
6601
|
+
*/
|
|
6602
|
+
createBranch(title?: string): Promise<AgentBranch>;
|
|
6603
|
+
/**
|
|
6604
|
+
* Merges the active branch into its base or a target branch and switches to the target.
|
|
6605
|
+
*
|
|
6606
|
+
* @param targetBranchId - Optional target branch id. Use `"main"` for the main branch.
|
|
6607
|
+
*/
|
|
6608
|
+
mergeBranch(targetBranchId?: string): Promise<void>;
|
|
6609
|
+
/**
|
|
6610
|
+
* Joins a branch as a contributor so the current user can edit it when permissions allow.
|
|
6611
|
+
*
|
|
6612
|
+
* @param branchId - Branch id to join.
|
|
6613
|
+
*/
|
|
6614
|
+
joinBranch(branchId: string): Promise<void>;
|
|
6615
|
+
/**
|
|
6616
|
+
* Leaves a branch as a contributor.
|
|
6617
|
+
*
|
|
6618
|
+
* @param branchId - Branch id to leave.
|
|
6619
|
+
*/
|
|
6620
|
+
leaveBranch(branchId: string): Promise<void>;
|
|
6621
|
+
/**
|
|
6622
|
+
* Renames a branch.
|
|
6623
|
+
*
|
|
6624
|
+
* @param branchId - Branch id to rename.
|
|
6625
|
+
* @param title - New branch title.
|
|
6626
|
+
*/
|
|
6627
|
+
renameBranch(branchId: string, title: string): Promise<void>;
|
|
6628
|
+
/**
|
|
6629
|
+
* Deletes a branch.
|
|
6630
|
+
*
|
|
6631
|
+
* @param branchId - Branch id to delete.
|
|
6632
|
+
*/
|
|
6633
|
+
deleteBranch(branchId: string): Promise<void>;
|
|
6616
6634
|
/**
|
|
6617
6635
|
* Reads project state by executing an array of queries against the project.
|
|
6618
6636
|
*
|
|
6619
6637
|
* Returns one result per query. Available query types and their parameters
|
|
6620
|
-
* are documented in the string returned by {@link
|
|
6638
|
+
* are documented in the string returned by {@link getSystemPrompt}.
|
|
6621
6639
|
*
|
|
6622
|
-
* @param queries - Array of query objects. See {@link
|
|
6640
|
+
* @param queries - Array of query objects. See {@link getSystemPrompt} for available types.
|
|
6623
6641
|
* @param options.pagePath - Target page path (e.g. `"/about"`). Defaults to the active page.
|
|
6624
6642
|
* @returns An object with a `results` array, one entry per query.
|
|
6625
6643
|
*/
|
|
6626
|
-
|
|
6644
|
+
readProject(queries: Record<string, unknown>[], options?: {
|
|
6627
6645
|
pagePath?: string;
|
|
6628
6646
|
}): Promise<{
|
|
6629
6647
|
results: unknown[];
|
|
6630
6648
|
}>;
|
|
6631
|
-
/**
|
|
6632
|
-
|
|
6649
|
+
/**
|
|
6650
|
+
* Reads control definitions for project components.
|
|
6651
|
+
*
|
|
6652
|
+
* @param input - `{ componentIds }`: component ids from project context or previous reads.
|
|
6653
|
+
* @returns The matching component control definitions.
|
|
6654
|
+
*/
|
|
6655
|
+
readComponentControls(input: {
|
|
6633
6656
|
componentIds: readonly string[];
|
|
6634
|
-
}, options?: {
|
|
6635
|
-
pagePath?: string;
|
|
6636
6657
|
}): Promise<unknown>;
|
|
6637
|
-
/**
|
|
6638
|
-
|
|
6658
|
+
/**
|
|
6659
|
+
* Reads icon-set control definitions.
|
|
6660
|
+
*
|
|
6661
|
+
* @param input - `{ iconSetNames }`: icon set names from project context or previous reads.
|
|
6662
|
+
* @returns The matching icon-set control definitions.
|
|
6663
|
+
*/
|
|
6664
|
+
readIconSetControls(input: {
|
|
6639
6665
|
iconSetNames: readonly string[];
|
|
6640
|
-
}, options?: {
|
|
6641
|
-
pagePath?: string;
|
|
6642
6666
|
}): Promise<unknown>;
|
|
6643
|
-
/**
|
|
6644
|
-
|
|
6667
|
+
/**
|
|
6668
|
+
* Reads exact icon names for an icon set.
|
|
6669
|
+
*
|
|
6670
|
+
* @param input - `{ iconSetName }`: icon set name from project context or previous reads.
|
|
6671
|
+
* @returns The available icon names in that set.
|
|
6672
|
+
*/
|
|
6673
|
+
readIcons(input: {
|
|
6645
6674
|
iconSetName: string;
|
|
6646
|
-
}, options?: {
|
|
6647
|
-
pagePath?: string;
|
|
6648
6675
|
}): Promise<string[]>;
|
|
6649
|
-
/**
|
|
6650
|
-
|
|
6676
|
+
/**
|
|
6677
|
+
* Reads layout-template control definitions.
|
|
6678
|
+
*
|
|
6679
|
+
* @param input - `{ layoutTemplateIds }`: layout template ids from project context or previous reads.
|
|
6680
|
+
* @returns The matching layout-template control definitions.
|
|
6681
|
+
*/
|
|
6682
|
+
readLayoutTemplateControls(input: {
|
|
6651
6683
|
layoutTemplateIds: readonly string[];
|
|
6652
|
-
}, options?: {
|
|
6653
|
-
pagePath?: string;
|
|
6654
6684
|
}): Promise<unknown>;
|
|
6655
|
-
/**
|
|
6656
|
-
|
|
6685
|
+
/**
|
|
6686
|
+
* Reads shader control definitions.
|
|
6687
|
+
*
|
|
6688
|
+
* @param input - `{ shaderNames }`: shader names from project context or previous reads.
|
|
6689
|
+
* @returns The matching shader control definitions.
|
|
6690
|
+
*/
|
|
6691
|
+
readShaderControls(input: {
|
|
6657
6692
|
shaderNames: readonly string[];
|
|
6658
|
-
}, options?: {
|
|
6659
|
-
pagePath?: string;
|
|
6660
6693
|
}): Promise<unknown>;
|
|
6661
6694
|
/**
|
|
6662
6695
|
* Applies commands to the canvas to create, update, remove, move, or duplicate nodes.
|
|
6663
6696
|
*
|
|
6664
|
-
* The command syntax is documented in the string returned by {@link
|
|
6697
|
+
* The command syntax is documented in the string returned by {@link getSystemPrompt}.
|
|
6665
6698
|
* Each call is scoped to a single page.
|
|
6666
6699
|
*
|
|
6667
|
-
* @param dsl - A string of commands separated by `;`. See {@link
|
|
6700
|
+
* @param dsl - A string of commands separated by `;`. See {@link getSystemPrompt} for syntax.
|
|
6668
6701
|
* @param options.pagePath - Target page path (e.g. `"/about"`). Defaults to the active page.
|
|
6669
6702
|
*/
|
|
6670
|
-
|
|
6703
|
+
applyChanges(dsl: string, options?: {
|
|
6671
6704
|
pagePath?: string;
|
|
6672
6705
|
}): Promise<void>;
|
|
6673
|
-
/** Liveness round-trip: resolves once Vekter's plugin handler answers. Used by the headless
|
|
6674
|
-
* backend to verify the transport actually routes, not just that the page is alive. */
|
|
6675
|
-
[$framerApiOnly.ping](): Promise<void>;
|
|
6676
6706
|
/**
|
|
6677
6707
|
* Executes the publish flow on behalf of an agent.
|
|
6678
6708
|
*
|
|
6679
|
-
* The input schema is documented in the string returned by {@link
|
|
6709
|
+
* The input schema is documented in the string returned by {@link getSystemPrompt}.
|
|
6680
6710
|
*
|
|
6681
6711
|
* @param input - Action-discriminated input object (preview / confirm_publish / deploy_to_production).
|
|
6682
6712
|
* @returns The action's result — status, publish URLs, and any errors, warnings, or changes.
|
|
6683
6713
|
*/
|
|
6684
|
-
|
|
6714
|
+
publish(input?: Record<string, unknown>): Promise<unknown>;
|
|
6685
6715
|
/**
|
|
6686
6716
|
* Searches for stock images to use on the canvas (e.g. `"FrameNode"` `fill` values). Returns
|
|
6687
6717
|
* candidate images with preview thumbnails and a `url` field for each. The returned URLs are
|
|
6688
6718
|
* registered as trusted for this session so they can be applied directly via `fill="<url>"`
|
|
6689
|
-
* in a subsequent {@link
|
|
6719
|
+
* in a subsequent {@link applyChanges} DSL command. Without calling this method first,
|
|
6690
6720
|
* external image URLs are rejected at apply time.
|
|
6691
6721
|
*
|
|
6692
|
-
* The input schema is documented in the string returned by {@link
|
|
6722
|
+
* The input schema is documented in the string returned by {@link getSystemPrompt}.
|
|
6693
6723
|
*
|
|
6694
6724
|
* @param input - Search input object (source / query / count / orientation).
|
|
6695
6725
|
* @returns An object describing the candidates or an error.
|
|
6696
6726
|
*/
|
|
6697
|
-
|
|
6727
|
+
queryImages(input: Record<string, unknown>): Promise<unknown>;
|
|
6698
6728
|
/**
|
|
6699
|
-
* Reviews changes made by prior {@link
|
|
6729
|
+
* Reviews changes made by prior {@link applyChanges} calls in this session.
|
|
6700
6730
|
*
|
|
6701
6731
|
* Consumes accumulated diagnostics from the session's agent context.
|
|
6702
6732
|
*
|
|
6703
|
-
* @param options.pagePath - Target page path (e.g. `"/about"`). Defaults to the active page.
|
|
6704
6733
|
* @returns The session's accumulated changes, errors, warnings, and deferred trait reports.
|
|
6705
6734
|
*/
|
|
6706
|
-
|
|
6707
|
-
pagePath?: string;
|
|
6708
|
-
}): Promise<unknown>;
|
|
6735
|
+
reviewChanges(): Promise<unknown>;
|
|
6709
6736
|
/**
|
|
6710
6737
|
* Flattens a local component instance into raw editable layers.
|
|
6711
6738
|
*
|
|
@@ -6713,7 +6740,7 @@ declare class FramerPluginAPIAlpha extends FramerPluginAPIBeta {
|
|
|
6713
6740
|
* @param options.pagePath - Target page path (e.g. `"/about"`). Defaults to the active page.
|
|
6714
6741
|
* @returns The flatten result — `success` with a `replacementId`, or `blocked` with a reason.
|
|
6715
6742
|
*/
|
|
6716
|
-
|
|
6743
|
+
flattenComponentInstance(input: {
|
|
6717
6744
|
id: string;
|
|
6718
6745
|
}, options?: {
|
|
6719
6746
|
pagePath?: string;
|
|
@@ -6725,7 +6752,7 @@ declare class FramerPluginAPIAlpha extends FramerPluginAPIBeta {
|
|
|
6725
6752
|
* @param options.pagePath - Target page path (e.g. `"/about"`). Defaults to the active page.
|
|
6726
6753
|
* @returns `success` (with the local component name), `needs_confirmation` (retry with `replaceAll`), or `blocked` with a reason.
|
|
6727
6754
|
*/
|
|
6728
|
-
|
|
6755
|
+
makeExternalComponentLocal(input: {
|
|
6729
6756
|
id: string;
|
|
6730
6757
|
replaceAll?: boolean;
|
|
6731
6758
|
}, options?: {
|
|
@@ -6738,7 +6765,7 @@ declare class FramerPluginAPIAlpha extends FramerPluginAPIBeta {
|
|
|
6738
6765
|
* @param options.pagePath - Target page path (e.g. `"/about"`). Defaults to the active page.
|
|
6739
6766
|
* @returns The node, or `null` if no node with that id exists on the page.
|
|
6740
6767
|
*/
|
|
6741
|
-
|
|
6768
|
+
getNode(input: {
|
|
6742
6769
|
id: string;
|
|
6743
6770
|
}, options?: {
|
|
6744
6771
|
pagePath?: string;
|
|
@@ -6751,7 +6778,7 @@ declare class FramerPluginAPIAlpha extends FramerPluginAPIBeta {
|
|
|
6751
6778
|
* @param options.pagePath - Target page path (e.g. `"/about"`). Defaults to the active page.
|
|
6752
6779
|
* @returns The nodes that were found, in input order.
|
|
6753
6780
|
*/
|
|
6754
|
-
|
|
6781
|
+
getNodes(input: {
|
|
6755
6782
|
ids: readonly string[];
|
|
6756
6783
|
}, options?: {
|
|
6757
6784
|
pagePath?: string;
|
|
@@ -6763,7 +6790,7 @@ declare class FramerPluginAPIAlpha extends FramerPluginAPIBeta {
|
|
|
6763
6790
|
* @param options.pagePath - Target page path (e.g. `"/about"`). Defaults to the active page.
|
|
6764
6791
|
* @returns The matching nodes without their children.
|
|
6765
6792
|
*/
|
|
6766
|
-
|
|
6793
|
+
getNodesOfTypes(input: {
|
|
6767
6794
|
types: readonly string[];
|
|
6768
6795
|
}, options?: {
|
|
6769
6796
|
pagePath?: string;
|
|
@@ -6775,7 +6802,7 @@ declare class FramerPluginAPIAlpha extends FramerPluginAPIBeta {
|
|
|
6775
6802
|
* @param options.pagePath - Target page path (e.g. `"/about"`). Defaults to the active page.
|
|
6776
6803
|
* @returns The enclosing scope node, or `null` if the node isn't in any scope.
|
|
6777
6804
|
*/
|
|
6778
|
-
|
|
6805
|
+
getScopeNode(input: {
|
|
6779
6806
|
id: string;
|
|
6780
6807
|
}, options?: {
|
|
6781
6808
|
pagePath?: string;
|
|
@@ -6787,7 +6814,7 @@ declare class FramerPluginAPIAlpha extends FramerPluginAPIBeta {
|
|
|
6787
6814
|
* @param options.pagePath - Target page path (e.g. `"/about"`). Defaults to the active page.
|
|
6788
6815
|
* @returns The top-level node, or `null` if none applies.
|
|
6789
6816
|
*/
|
|
6790
|
-
|
|
6817
|
+
getGroundNode(input: {
|
|
6791
6818
|
id: string;
|
|
6792
6819
|
}, options?: {
|
|
6793
6820
|
pagePath?: string;
|
|
@@ -6799,7 +6826,7 @@ declare class FramerPluginAPIAlpha extends FramerPluginAPIBeta {
|
|
|
6799
6826
|
* @param options.pagePath - Target page path (e.g. `"/about"`). Defaults to the active page.
|
|
6800
6827
|
* @returns The parent node, or `null` if the node has no parent or doesn't exist.
|
|
6801
6828
|
*/
|
|
6802
|
-
|
|
6829
|
+
getParentNode(input: {
|
|
6803
6830
|
id: string;
|
|
6804
6831
|
}, options?: {
|
|
6805
6832
|
pagePath?: string;
|
|
@@ -6811,7 +6838,7 @@ declare class FramerPluginAPIAlpha extends FramerPluginAPIBeta {
|
|
|
6811
6838
|
* @param options.pagePath - Target page path (e.g. `"/about"`). Defaults to the active page.
|
|
6812
6839
|
* @returns The ancestors ordered from closest parent to the page root.
|
|
6813
6840
|
*/
|
|
6814
|
-
|
|
6841
|
+
getAncestors(input: {
|
|
6815
6842
|
id: string;
|
|
6816
6843
|
}, options?: {
|
|
6817
6844
|
pagePath?: string;
|
|
@@ -6826,7 +6853,7 @@ declare class FramerPluginAPIAlpha extends FramerPluginAPIBeta {
|
|
|
6826
6853
|
* @param options.pagePath - Target page path (e.g. `"/about"`). Defaults to the active page.
|
|
6827
6854
|
* @returns The serialized node, or `null` if no node with that id exists on the page.
|
|
6828
6855
|
*/
|
|
6829
|
-
|
|
6856
|
+
serialize(input: {
|
|
6830
6857
|
id: string;
|
|
6831
6858
|
depth?: number;
|
|
6832
6859
|
attributeFilter?: readonly string[];
|
|
@@ -6844,7 +6871,7 @@ declare class FramerPluginAPIAlpha extends FramerPluginAPIBeta {
|
|
|
6844
6871
|
* @param options.pagePath - Target page path (e.g. `"/about"`). Defaults to the active page.
|
|
6845
6872
|
* @returns The serialized nodes that were found, in input order.
|
|
6846
6873
|
*/
|
|
6847
|
-
|
|
6874
|
+
serializeNodes(input: {
|
|
6848
6875
|
ids: readonly string[];
|
|
6849
6876
|
depth?: number;
|
|
6850
6877
|
attributeFilter?: readonly string[];
|
|
@@ -6863,7 +6890,7 @@ declare class FramerPluginAPIAlpha extends FramerPluginAPIBeta {
|
|
|
6863
6890
|
* @param options.pagePath - Target page path (e.g. `"/about"`). Defaults to the active page.
|
|
6864
6891
|
* @returns The current page, including `keyName`, `cursor`, `results`, `totalResults`, and (if more pages remain) `nextCursor`.
|
|
6865
6892
|
*/
|
|
6866
|
-
|
|
6893
|
+
paginate(input: {
|
|
6867
6894
|
items: readonly unknown[];
|
|
6868
6895
|
keyName?: never;
|
|
6869
6896
|
cursor?: never;
|
|
@@ -6875,13 +6902,13 @@ declare class FramerPluginAPIAlpha extends FramerPluginAPIBeta {
|
|
|
6875
6902
|
pagePath?: string;
|
|
6876
6903
|
}): Promise<unknown>;
|
|
6877
6904
|
/** @internal - Available only through framer-api */
|
|
6878
|
-
|
|
6905
|
+
startConversation(prompt: string, options?: StartAgentConversationOptions): Promise<StartAgentConversationResult>;
|
|
6879
6906
|
/** @internal - Available only through framer-api */
|
|
6880
|
-
|
|
6907
|
+
continueConversation(prompt: string, options: ContinueAgentConversationOptions): Promise<ContinueAgentConversationResult>;
|
|
6881
6908
|
/** @internal - Available only through framer-api */
|
|
6882
|
-
|
|
6909
|
+
submitClarification(options: SubmitAgentClarificationOptions): Promise<SubmitAgentClarificationResult>;
|
|
6883
6910
|
/** @internal - Available only through framer-api */
|
|
6884
|
-
|
|
6911
|
+
runSupervisorCommand(options: RunSupervisorAgentCommandOptions): Promise<RunSupervisorAgentCommandResult>;
|
|
6885
6912
|
}
|
|
6886
6913
|
/**
|
|
6887
6914
|
* Methods that are only available through framer-api (server API),
|
|
@@ -7171,6 +7198,26 @@ interface PluginMessageAPI {
|
|
|
7171
7198
|
pagePath?: string;
|
|
7172
7199
|
}) => Promise<string>;
|
|
7173
7200
|
/** @alpha */
|
|
7201
|
+
getActiveBranchForAgent: () => Promise<AgentBranch>;
|
|
7202
|
+
/** @alpha */
|
|
7203
|
+
getBranchesForAgent: () => Promise<AgentBranch[]>;
|
|
7204
|
+
/** @alpha */
|
|
7205
|
+
getBranchChangesForAgent: (branchId: string) => Promise<AgentBranchChange[]>;
|
|
7206
|
+
/** @alpha */
|
|
7207
|
+
switchBranchForAgent: (branchId: string) => Promise<void>;
|
|
7208
|
+
/** @alpha */
|
|
7209
|
+
createBranchForAgent: (title?: string) => Promise<AgentBranch>;
|
|
7210
|
+
/** @alpha */
|
|
7211
|
+
mergeBranchForAgent: (targetBranchId?: string) => Promise<void>;
|
|
7212
|
+
/** @alpha */
|
|
7213
|
+
joinBranchForAgent: (branchId: string) => Promise<void>;
|
|
7214
|
+
/** @alpha */
|
|
7215
|
+
leaveBranchForAgent: (branchId: string) => Promise<void>;
|
|
7216
|
+
/** @alpha */
|
|
7217
|
+
renameBranchForAgent: (branchId: string, title: string) => Promise<void>;
|
|
7218
|
+
/** @alpha */
|
|
7219
|
+
deleteBranchForAgent: (branchId: string) => Promise<void>;
|
|
7220
|
+
/** @alpha */
|
|
7174
7221
|
readProjectForAgent: (queries: Record<string, unknown>[], options?: {
|
|
7175
7222
|
pagePath?: string;
|
|
7176
7223
|
}) => Promise<{
|
|
@@ -7375,7 +7422,7 @@ declare class PluginEngine {
|
|
|
7375
7422
|
reject: (error: FramerPluginError) => void;
|
|
7376
7423
|
}>;
|
|
7377
7424
|
readonly mode: Mode;
|
|
7378
|
-
readonly subscriptions: Map<"text" | "image" | "publishInfo" | "selection" | "canvasRoot" | "theme" | "customCode" | "colorStyles" | "textStyles" | "
|
|
7425
|
+
readonly subscriptions: Map<"redirects" | "text" | "image" | "publishInfo" | "selection" | "canvasRoot" | "theme" | "customCode" | "colorStyles" | "textStyles" | "codeFiles" | "openCodeFile", Set<(value: any) => void>>;
|
|
7379
7426
|
perMethodPermissionMap: PerMethodPermissionMap;
|
|
7380
7427
|
readonly permissionSubscriptions: Set<VoidFunction>;
|
|
7381
7428
|
readonly messageTypesCheckedInIsAllowedTo: Set<ProtectedMessageType>;
|
|
@@ -7744,10 +7791,13 @@ type BlockedMethods = {
|
|
|
7744
7791
|
}[keyof EnabledMethodsConfig];
|
|
7745
7792
|
/** Used by ActivePlugin.ts for vekter-side validation */
|
|
7746
7793
|
type AvailablePluginMethods = Omit<FramerPluginAPIAlpha, BlockedMethods>;
|
|
7794
|
+
interface FramerReconnectOptions {
|
|
7795
|
+
expectedInitialBranchId?: string;
|
|
7796
|
+
}
|
|
7747
7797
|
interface FramerConnectionMethods {
|
|
7748
7798
|
disconnect(): Promise<void>;
|
|
7749
7799
|
/** @internal */
|
|
7750
|
-
reconnect(): Promise<void>;
|
|
7800
|
+
reconnect(options?: FramerReconnectOptions): Promise<void>;
|
|
7751
7801
|
requestId?: string;
|
|
7752
7802
|
sessionId?: string;
|
|
7753
7803
|
[Symbol.dispose](): void;
|
|
@@ -7757,7 +7807,9 @@ interface FramerScreenshotMethods {
|
|
|
7757
7807
|
screenshot(nodeId: string, options?: ScreenshotOptions): Promise<ScreenshotResult>;
|
|
7758
7808
|
exportSVG(nodeId: string): Promise<string>;
|
|
7759
7809
|
}
|
|
7760
|
-
type Framer = AvailablePluginMethods & FramerConnectionMethods & FramerScreenshotMethods & FramerApiOnlyMethods
|
|
7810
|
+
type Framer = AvailablePluginMethods & FramerConnectionMethods & FramerScreenshotMethods & FramerApiOnlyMethods & {
|
|
7811
|
+
agent: FramerAgentAPI;
|
|
7812
|
+
};
|
|
7761
7813
|
|
|
7762
7814
|
/** @internal */
|
|
7763
7815
|
declare const $framerApiInternal: {
|