framer-dalton 0.0.16 → 0.0.17
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/cli.js +242 -2
- package/dist/start-relay-server.js +2 -2
- package/docs/skills/framer.md +36 -0
- package/package.json +2 -2
package/dist/cli.js
CHANGED
|
@@ -10,7 +10,7 @@ import { z } from 'zod';
|
|
|
10
10
|
import { fileURLToPath } from 'url';
|
|
11
11
|
import { createTRPCClient, httpLink } from '@trpc/client';
|
|
12
12
|
|
|
13
|
-
/* @framer/ai CLI v0.0.
|
|
13
|
+
/* @framer/ai CLI v0.0.17 */
|
|
14
14
|
var __defProp = Object.defineProperty;
|
|
15
15
|
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
16
16
|
function openUrl(url) {
|
|
@@ -538,6 +538,121 @@ var types = {
|
|
|
538
538
|
}
|
|
539
539
|
]
|
|
540
540
|
},
|
|
541
|
+
agentclarificationanswer: {
|
|
542
|
+
name: "AgentClarificationAnswer",
|
|
543
|
+
description: "",
|
|
544
|
+
kind: "interface",
|
|
545
|
+
references: ["AgentClarificationSuggestedAnswer"],
|
|
546
|
+
members: [
|
|
547
|
+
{
|
|
548
|
+
name: "questionIndex",
|
|
549
|
+
type: "number",
|
|
550
|
+
description: "",
|
|
551
|
+
optional: false
|
|
552
|
+
},
|
|
553
|
+
{
|
|
554
|
+
name: "answer",
|
|
555
|
+
type: "AgentClarificationSuggestedAnswer",
|
|
556
|
+
description: "",
|
|
557
|
+
optional: false
|
|
558
|
+
}
|
|
559
|
+
]
|
|
560
|
+
},
|
|
561
|
+
agentclarificationquestion: {
|
|
562
|
+
name: "AgentClarificationQuestion",
|
|
563
|
+
description: "",
|
|
564
|
+
kind: "interface",
|
|
565
|
+
references: ["AgentClarificationSuggestedAnswer"],
|
|
566
|
+
members: [
|
|
567
|
+
{
|
|
568
|
+
name: "question",
|
|
569
|
+
type: "string",
|
|
570
|
+
description: "",
|
|
571
|
+
optional: false
|
|
572
|
+
},
|
|
573
|
+
{
|
|
574
|
+
name: "suggestedAnswers",
|
|
575
|
+
type: "readonly AgentClarificationSuggestedAnswer[]",
|
|
576
|
+
description: "",
|
|
577
|
+
optional: false
|
|
578
|
+
}
|
|
579
|
+
]
|
|
580
|
+
},
|
|
581
|
+
agentclarificationsuggestedanswer: {
|
|
582
|
+
name: "AgentClarificationSuggestedAnswer",
|
|
583
|
+
description: "",
|
|
584
|
+
kind: "alias",
|
|
585
|
+
alias: "string | AgentClarificationSuggestedAnswerWithDescription",
|
|
586
|
+
references: ["AgentClarificationSuggestedAnswerWithDescription"]
|
|
587
|
+
},
|
|
588
|
+
agentclarificationsuggestedanswerwithdescription: {
|
|
589
|
+
name: "AgentClarificationSuggestedAnswerWithDescription",
|
|
590
|
+
description: "",
|
|
591
|
+
kind: "interface",
|
|
592
|
+
references: [],
|
|
593
|
+
members: [
|
|
594
|
+
{
|
|
595
|
+
name: "answer",
|
|
596
|
+
type: "string",
|
|
597
|
+
description: "",
|
|
598
|
+
optional: false
|
|
599
|
+
},
|
|
600
|
+
{
|
|
601
|
+
name: "description",
|
|
602
|
+
type: "string",
|
|
603
|
+
description: "",
|
|
604
|
+
optional: false
|
|
605
|
+
}
|
|
606
|
+
]
|
|
607
|
+
},
|
|
608
|
+
agentconversationcompletedresult: {
|
|
609
|
+
name: "AgentConversationCompletedResult",
|
|
610
|
+
description: "",
|
|
611
|
+
kind: "interface",
|
|
612
|
+
references: [],
|
|
613
|
+
members: [
|
|
614
|
+
{
|
|
615
|
+
name: "responseMessages",
|
|
616
|
+
type: "readonly unknown[]",
|
|
617
|
+
description: "",
|
|
618
|
+
optional: false
|
|
619
|
+
}
|
|
620
|
+
]
|
|
621
|
+
},
|
|
622
|
+
agentconversationneedsclarificationresult: {
|
|
623
|
+
name: "AgentConversationNeedsClarificationResult",
|
|
624
|
+
description: "",
|
|
625
|
+
kind: "interface",
|
|
626
|
+
references: ["AgentClarificationQuestion"],
|
|
627
|
+
members: [
|
|
628
|
+
{
|
|
629
|
+
name: "clarificationQuestions",
|
|
630
|
+
type: "readonly AgentClarificationQuestion[]",
|
|
631
|
+
description: "",
|
|
632
|
+
optional: false
|
|
633
|
+
}
|
|
634
|
+
]
|
|
635
|
+
},
|
|
636
|
+
agentturnoptions: {
|
|
637
|
+
name: "AgentTurnOptions",
|
|
638
|
+
description: "",
|
|
639
|
+
kind: "interface",
|
|
640
|
+
references: [],
|
|
641
|
+
members: [
|
|
642
|
+
{
|
|
643
|
+
name: "selectionNodeIds",
|
|
644
|
+
type: "readonly string[]",
|
|
645
|
+
description: "Treat these nodes as the implicit selection for this agent turn.\n\nWhen provided, all node ids must exist. If a node is not currently loaded in the session, it may not be found.",
|
|
646
|
+
optional: true
|
|
647
|
+
},
|
|
648
|
+
{
|
|
649
|
+
name: "imageUrls",
|
|
650
|
+
type: "readonly string[]",
|
|
651
|
+
description: "Attach images to this agent turn by URL.\n\nURLs can be external or existing Framer asset URLs. They will be ingested into the\nproject's assets if needed, then sent to the model as image parts.\n\nTip: if you have a local file (or bytes), upload it first (e.g. `framer.uploadImage(...)`) and\npass the returned asset URL here.",
|
|
652
|
+
optional: true
|
|
653
|
+
}
|
|
654
|
+
]
|
|
655
|
+
},
|
|
541
656
|
aiserviceinfo: {
|
|
542
657
|
name: "AiServiceInfo",
|
|
543
658
|
description: "",
|
|
@@ -1809,6 +1924,31 @@ var types = {
|
|
|
1809
1924
|
}
|
|
1810
1925
|
]
|
|
1811
1926
|
},
|
|
1927
|
+
continueagentconversationoptions: {
|
|
1928
|
+
name: "ContinueAgentConversationOptions",
|
|
1929
|
+
description: "",
|
|
1930
|
+
kind: "interface",
|
|
1931
|
+
references: ["AgentTurnOptions"],
|
|
1932
|
+
members: [
|
|
1933
|
+
{
|
|
1934
|
+
name: "conversationId",
|
|
1935
|
+
type: "string",
|
|
1936
|
+
description: "Existing agent conversation to continue.",
|
|
1937
|
+
optional: false
|
|
1938
|
+
}
|
|
1939
|
+
],
|
|
1940
|
+
extends: ["AgentTurnOptions"]
|
|
1941
|
+
},
|
|
1942
|
+
continueagentconversationresult: {
|
|
1943
|
+
name: "ContinueAgentConversationResult",
|
|
1944
|
+
description: "",
|
|
1945
|
+
kind: "alias",
|
|
1946
|
+
alias: "AgentConversationCompletedResult | AgentConversationNeedsClarificationResult",
|
|
1947
|
+
references: [
|
|
1948
|
+
"AgentConversationCompletedResult",
|
|
1949
|
+
"AgentConversationNeedsClarificationResult"
|
|
1950
|
+
]
|
|
1951
|
+
},
|
|
1812
1952
|
control: {
|
|
1813
1953
|
name: "Control",
|
|
1814
1954
|
description: "",
|
|
@@ -6639,6 +6779,24 @@ var types = {
|
|
|
6639
6779
|
description: "@alpha",
|
|
6640
6780
|
optional: false
|
|
6641
6781
|
},
|
|
6782
|
+
{
|
|
6783
|
+
name: "startAgentConversation",
|
|
6784
|
+
type: "(prompt: string, options?: StartAgentConversationOptions) => Promise<StartAgentConversationResult>",
|
|
6785
|
+
description: "@alpha",
|
|
6786
|
+
optional: false
|
|
6787
|
+
},
|
|
6788
|
+
{
|
|
6789
|
+
name: "continueAgentConversation",
|
|
6790
|
+
type: "(prompt: string, options: ContinueAgentConversationOptions) => Promise<ContinueAgentConversationResult>",
|
|
6791
|
+
description: "@alpha",
|
|
6792
|
+
optional: false
|
|
6793
|
+
},
|
|
6794
|
+
{
|
|
6795
|
+
name: "submitAgentClarification",
|
|
6796
|
+
type: "(options: SubmitAgentClarificationOptions) => Promise<SubmitAgentClarificationResult>",
|
|
6797
|
+
description: "@alpha",
|
|
6798
|
+
optional: false
|
|
6799
|
+
},
|
|
6642
6800
|
{
|
|
6643
6801
|
name: "[getAiServiceInfoMessageType]",
|
|
6644
6802
|
type: "() => Promise<AiServiceInfo>",
|
|
@@ -7412,6 +7570,31 @@ var types = {
|
|
|
7412
7570
|
}
|
|
7413
7571
|
]
|
|
7414
7572
|
},
|
|
7573
|
+
startagentconversationoptions: {
|
|
7574
|
+
name: "StartAgentConversationOptions",
|
|
7575
|
+
description: "",
|
|
7576
|
+
kind: "interface",
|
|
7577
|
+
references: ["AgentTurnOptions"],
|
|
7578
|
+
members: [
|
|
7579
|
+
{
|
|
7580
|
+
name: "pagePath",
|
|
7581
|
+
type: "string",
|
|
7582
|
+
description: 'Target page path (e.g. `"/about"`). Defaults to the active page.',
|
|
7583
|
+
optional: true
|
|
7584
|
+
}
|
|
7585
|
+
],
|
|
7586
|
+
extends: ["AgentTurnOptions"]
|
|
7587
|
+
},
|
|
7588
|
+
startagentconversationresult: {
|
|
7589
|
+
name: "StartAgentConversationResult",
|
|
7590
|
+
description: "",
|
|
7591
|
+
kind: "alias",
|
|
7592
|
+
alias: "({\n conversationId: string;\n} & AgentConversationCompletedResult) | ({\n conversationId: string;\n} & AgentConversationNeedsClarificationResult)",
|
|
7593
|
+
references: [
|
|
7594
|
+
"AgentConversationCompletedResult",
|
|
7595
|
+
"AgentConversationNeedsClarificationResult"
|
|
7596
|
+
]
|
|
7597
|
+
},
|
|
7415
7598
|
stringcontrol: {
|
|
7416
7599
|
name: "StringControl",
|
|
7417
7600
|
description: "",
|
|
@@ -7543,6 +7726,33 @@ var types = {
|
|
|
7543
7726
|
"WithStringDefaultValue"
|
|
7544
7727
|
]
|
|
7545
7728
|
},
|
|
7729
|
+
submitagentclarificationoptions: {
|
|
7730
|
+
name: "SubmitAgentClarificationOptions",
|
|
7731
|
+
description: "",
|
|
7732
|
+
kind: "interface",
|
|
7733
|
+
references: ["AgentClarificationAnswer"],
|
|
7734
|
+
members: [
|
|
7735
|
+
{
|
|
7736
|
+
name: "conversationId",
|
|
7737
|
+
type: "string",
|
|
7738
|
+
description: "",
|
|
7739
|
+
optional: false
|
|
7740
|
+
},
|
|
7741
|
+
{
|
|
7742
|
+
name: "answers",
|
|
7743
|
+
type: "AgentClarificationAnswer[]",
|
|
7744
|
+
description: "",
|
|
7745
|
+
optional: false
|
|
7746
|
+
}
|
|
7747
|
+
]
|
|
7748
|
+
},
|
|
7749
|
+
submitagentclarificationresult: {
|
|
7750
|
+
name: "SubmitAgentClarificationResult",
|
|
7751
|
+
description: "",
|
|
7752
|
+
kind: "alias",
|
|
7753
|
+
alias: "ContinueAgentConversationResult",
|
|
7754
|
+
references: ["ContinueAgentConversationResult"]
|
|
7755
|
+
},
|
|
7546
7756
|
supportedfielddefinitiondata: {
|
|
7547
7757
|
name: "SupportedFieldDefinitionData",
|
|
7548
7758
|
description: "A collection field that Framer knows about and the plugin API fully supports.",
|
|
@@ -12377,6 +12587,16 @@ var methodsByCategory = {
|
|
|
12377
12587
|
description: "Clone a node.",
|
|
12378
12588
|
references: ["AnyNode"]
|
|
12379
12589
|
},
|
|
12590
|
+
{
|
|
12591
|
+
name: "continueAgentConversation",
|
|
12592
|
+
category: "framer",
|
|
12593
|
+
signature: "continueAgentConversation(prompt: string, options: ContinueAgentConversationOptions): Promise<ContinueAgentConversationResult>",
|
|
12594
|
+
description: "",
|
|
12595
|
+
references: [
|
|
12596
|
+
"ContinueAgentConversationOptions",
|
|
12597
|
+
"ContinueAgentConversationResult"
|
|
12598
|
+
]
|
|
12599
|
+
},
|
|
12380
12600
|
{
|
|
12381
12601
|
name: "createCodeFile",
|
|
12382
12602
|
category: "framer",
|
|
@@ -12853,6 +13073,26 @@ var methodsByCategory = {
|
|
|
12853
13073
|
description: "Set the text of the current selection or insert it onto the canvas.",
|
|
12854
13074
|
references: []
|
|
12855
13075
|
},
|
|
13076
|
+
{
|
|
13077
|
+
name: "startAgentConversation",
|
|
13078
|
+
category: "framer",
|
|
13079
|
+
signature: "startAgentConversation(prompt: string, options?: StartAgentConversationOptions): Promise<StartAgentConversationResult>",
|
|
13080
|
+
description: "",
|
|
13081
|
+
references: [
|
|
13082
|
+
"StartAgentConversationOptions",
|
|
13083
|
+
"StartAgentConversationResult"
|
|
13084
|
+
]
|
|
13085
|
+
},
|
|
13086
|
+
{
|
|
13087
|
+
name: "submitAgentClarification",
|
|
13088
|
+
category: "framer",
|
|
13089
|
+
signature: "submitAgentClarification(options: SubmitAgentClarificationOptions): Promise<SubmitAgentClarificationResult>",
|
|
13090
|
+
description: "",
|
|
13091
|
+
references: [
|
|
13092
|
+
"SubmitAgentClarificationOptions",
|
|
13093
|
+
"SubmitAgentClarificationResult"
|
|
13094
|
+
]
|
|
13095
|
+
},
|
|
12856
13096
|
{
|
|
12857
13097
|
name: "typecheckCode",
|
|
12858
13098
|
category: "framer",
|
|
@@ -14982,7 +15222,7 @@ __name(renderDocs, "renderDocs");
|
|
|
14982
15222
|
// src/version.ts
|
|
14983
15223
|
var VERSION = (
|
|
14984
15224
|
// typeof is used to ensure this can be used just via tsx or node etc. without build
|
|
14985
|
-
"0.0.
|
|
15225
|
+
"0.0.17"
|
|
14986
15226
|
);
|
|
14987
15227
|
|
|
14988
15228
|
// src/relay-client.ts
|
|
@@ -13,7 +13,7 @@ import { createRequire } from 'module';
|
|
|
13
13
|
import * as vm from 'vm';
|
|
14
14
|
import { connect } from 'framer-api';
|
|
15
15
|
|
|
16
|
-
/* @framer/ai relay server v0.0.
|
|
16
|
+
/* @framer/ai relay server v0.0.17 */
|
|
17
17
|
var __defProp = Object.defineProperty;
|
|
18
18
|
var __knownSymbol = (name, symbol) => (symbol = Symbol[name]) ? symbol : /* @__PURE__ */ Symbol.for("Symbol." + name);
|
|
19
19
|
var __typeError = (msg) => {
|
|
@@ -93,7 +93,7 @@ __name(log, "log");
|
|
|
93
93
|
// src/version.ts
|
|
94
94
|
var VERSION = (
|
|
95
95
|
// typeof is used to ensure this can be used just via tsx or node etc. without build
|
|
96
|
-
"0.0.
|
|
96
|
+
"0.0.17"
|
|
97
97
|
);
|
|
98
98
|
|
|
99
99
|
// src/relay-client.ts
|
package/docs/skills/framer.md
CHANGED
|
@@ -146,6 +146,42 @@ For design tasks, do not try to build or restyle pages with low-level node APIs.
|
|
|
146
146
|
|
|
147
147
|
After session creation, load the dynamically created project-scoped skill `framer-canvas-editing-project-<projectId>` for canvas editing on the connected project. It contains the canvas editing guidance, the live agent system prompt, and the live project context for `pagePath: "/"`.
|
|
148
148
|
|
|
149
|
+
Do not call `framer.startAgentConversation()` or `framer.continueAgentConversation()` with this approach.
|
|
150
|
+
|
|
151
|
+
## Canvas Editing: Alternative Approach (“Prompt the Framer agent”)
|
|
152
|
+
|
|
153
|
+
Use this approach only if the user asks for it. Do not mention this approach to the user otherwise.
|
|
154
|
+
|
|
155
|
+
This approach is called “Prompt the Framer agent”. With this approach, use `framer.startAgentConversation()` to start a stateful design subagent. Keep the `conversationId` it returns in `state`, and call `framer.continueAgentConversation()` with it to continue the same design task.
|
|
156
|
+
|
|
157
|
+
Do not call `framer.getAgentSystemPrompt()` or `framer.getAgentContext()` or `framer.applyAgentChanges()` with this approach.
|
|
158
|
+
|
|
159
|
+
Example:
|
|
160
|
+
|
|
161
|
+
```js
|
|
162
|
+
state.agent ??= {};
|
|
163
|
+
const first = await framer.startAgentConversation(
|
|
164
|
+
"Build me a landing page based on the attached screenshot",
|
|
165
|
+
{
|
|
166
|
+
pagePath: "/",
|
|
167
|
+
imageUrls: ["https://example.com/image.png"],
|
|
168
|
+
// selectionNodeIds: [...]
|
|
169
|
+
},
|
|
170
|
+
);
|
|
171
|
+
state.agent.conversationId = first.conversationId;
|
|
172
|
+
console.log(first.responseMessages);
|
|
173
|
+
|
|
174
|
+
const second = await framer.continueAgentConversation("Now make it pink", {
|
|
175
|
+
conversationId: state.agent.conversationId,
|
|
176
|
+
selectionNodeIds: ["someNodeId"],
|
|
177
|
+
// imageUrls: [...],
|
|
178
|
+
// changing pagePath or model is not supported
|
|
179
|
+
});
|
|
180
|
+
console.log(second.responseMessages);
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
Prompting may take a while to complete, so set the command timeout to 10 minutes.
|
|
184
|
+
|
|
149
185
|
## Execute Code
|
|
150
186
|
|
|
151
187
|
Write your code to a unique file under `{{FRAMER_TEMPORARY_DIR}}/` and execute with `-f`:
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "framer-dalton",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.17",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"bin": {
|
|
6
6
|
"framer-dalton": "./dist/cli.js"
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"@trpc/client": "^11.9.0",
|
|
26
26
|
"@trpc/server": "^11.9.0",
|
|
27
27
|
"commander": "^12.1.0",
|
|
28
|
-
"framer-api": "^0.1.4",
|
|
28
|
+
"framer-api": "^0.1.4-alpha.1",
|
|
29
29
|
"zod": "^4.3.6"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|