@womp/spark-agent 15.1.0 → 15.2.0
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/CHANGELOG.md +23 -0
- package/dist/agent.js +1 -1
- package/dist/intent-bench-cases.js +25 -0
- package/dist/prompt.d.ts +6 -5
- package/dist/prompt.js +24 -5
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,29 @@ Notable changes to `@womp/spark-agent`, newest first. Versions follow
|
|
|
4
4
|
[Semantic Versioning](https://semver.org/). Add an entry with each version bump; describe what
|
|
5
5
|
changed for hosts and users, and how to migrate across breaking changes.
|
|
6
6
|
|
|
7
|
+
## 15.2.0 — 2026-10-26
|
|
8
|
+
|
|
9
|
+
### Changed
|
|
10
|
+
|
|
11
|
+
- `sparkSystemPrompt` says which chat model runs and lists Spark's chat models, from `SPARK_MODELS`.
|
|
12
|
+
A request such as "make the croc using astra" names a chat model, so Spark builds the rest of the
|
|
13
|
+
request with the usual method, says it cannot switch models, and points to Womp's model settings.
|
|
14
|
+
Before, it took Astra for a generation model, replied that it was unavailable, and offered Womp
|
|
15
|
+
Mesh (dev0 thread 146293). Spark does not switch models; the host still picks one.
|
|
16
|
+
- `sparkSystemPrompt(skills, instructions?, modelId?)` takes the run's model ID, which
|
|
17
|
+
`runSparkAgent` passes. The prompt differs only between models, so prompt caching is unaffected:
|
|
18
|
+
provider caches are per model.
|
|
19
|
+
- `intent-bench` covers names that are not creation methods (chat models, Blender), a generator
|
|
20
|
+
outside the catalog, and a catalog model named explicitly.
|
|
21
|
+
|
|
22
|
+
## 15.1.1 — 2026-10-23
|
|
23
|
+
|
|
24
|
+
### Fixed
|
|
25
|
+
|
|
26
|
+
- Final replies describe objects, materials and other results the way the user sees them (name,
|
|
27
|
+
appearance or placement) instead of by internal IDs, handles or API names. A new material was
|
|
28
|
+
reported as "ID 9", which means nothing in the editor.
|
|
29
|
+
|
|
7
30
|
## 15.1.0 — 2026-10-22
|
|
8
31
|
|
|
9
32
|
### Changed
|
package/dist/agent.js
CHANGED
|
@@ -141,7 +141,7 @@ export function runSparkAgent(options) {
|
|
|
141
141
|
controller,
|
|
142
142
|
write: (chunk) => writer.write(chunk),
|
|
143
143
|
});
|
|
144
|
-
const readSystem = () => sparkSystemPrompt(options.capabilities.skills, options.instructions);
|
|
144
|
+
const readSystem = () => sparkSystemPrompt(options.capabilities.skills, options.instructions, options.modelId);
|
|
145
145
|
let messages = options.messages ?? [];
|
|
146
146
|
// Compaction before each later step; only for a stored conversation,
|
|
147
147
|
// where the compaction can be recorded.
|
|
@@ -16,6 +16,8 @@ export const INTENT_ROUTES = [
|
|
|
16
16
|
const user = (text, images) => ({ role: "user", text, images });
|
|
17
17
|
// A takeaway coffee cup on a table, from Womp's media host.
|
|
18
18
|
const cup = { url: "https://media.womp.com/staging-kkp/thumbnails/ma_IMG_3417_1791494968752.webp" };
|
|
19
|
+
// A blue Croc clog, from dev0 thread 146293.
|
|
20
|
+
const croc = { url: "https://media.womp.com/staging-kkp/thumbnails/ma_image_1792684020040.webp" };
|
|
19
21
|
// Drawn references: a figure, its turnaround sheet, and a spec sheet for the cup above.
|
|
20
22
|
const figure = { file: "alien-figure.png" };
|
|
21
23
|
const turnaround = { file: "alien-figure-turnaround.png" };
|
|
@@ -57,6 +59,10 @@ export const INTENT_CASES = [
|
|
|
57
59
|
{ id: "G1", group: "core", turns: [user("Make a branching coral with adjustable branch density.")], expect: ["geometry-nodes"] },
|
|
58
60
|
{ id: "G2", group: "core", turns: [user("Make a rippling surface with adjustable wave speed.")], expect: ["geometry-nodes"] },
|
|
59
61
|
{ id: "G3", group: "core", turns: [user("Make an organic vine where I can adjust the curl and leaf spacing.")], expect: ["geometry-nodes"] },
|
|
62
|
+
// Names that are not creation methods. Spark's chat models are the ones it runs on.
|
|
63
|
+
{ id: "astra-vase", group: "core", turns: [user("make a vase using astra")], expect: ["scene", "image"], note: "Astra is a chat model, not a generator." },
|
|
64
|
+
{ id: "opus-table", group: "core", turns: [user("build a simple wooden table with opus")], expect: ["scene"] },
|
|
65
|
+
{ id: "blender-chair", group: "core", turns: [user("make a chair using blender")], expect: ["scene", "image"] },
|
|
60
66
|
{
|
|
61
67
|
id: "S1", group: "core", turns: [user("A car")], expect: ["image"],
|
|
62
68
|
note: "Ambiguous creative request: one image preview, then a choice. The 4.3 QA expected scene.",
|
|
@@ -200,12 +206,31 @@ export const INTENT_CASES = [
|
|
|
200
206
|
expect: ["scene", "reply"],
|
|
201
207
|
note: "Both 3D options fit, so editable shapes by default, or a short question. Not a mesh.",
|
|
202
208
|
},
|
|
209
|
+
{
|
|
210
|
+
id: "croc-using-astra", group: "conversation",
|
|
211
|
+
turns: [
|
|
212
|
+
user("make this in to a chonkie bead charm, its 20mm and the hole is 2mm"),
|
|
213
|
+
{
|
|
214
|
+
role: "assistant",
|
|
215
|
+
text: "The import prompt timed out, so nothing changed. The charm remains 20 mm long, but the 2 mm hole is still missing. Please select the clog and use Conversion Lab → Mesh → Special Primitives (Fields).",
|
|
216
|
+
},
|
|
217
|
+
user("make the croc using astra", [croc]),
|
|
218
|
+
],
|
|
219
|
+
expect: ["scene"],
|
|
220
|
+
note: "Dev0 thread 146293: Spark replied that Astra was not an available generator and offered Womp Mesh.",
|
|
221
|
+
},
|
|
203
222
|
{ id: "photo-3d", group: "photo", turns: [user("make this 3D", [cup])], expect: ["scene"], note: "Built from editable shapes; a mesh needs an explicit request." },
|
|
204
223
|
{
|
|
205
224
|
id: "photo-make-3d-button", group: "photo", turns: [user("Generate 3d model from the attached image", [cup])], expect: ["scene"],
|
|
206
225
|
note: "The message Swan's Make 3D button sends with the image.",
|
|
207
226
|
},
|
|
208
227
|
{ id: "photo-mesh", group: "photo", turns: [user("Generate a 3D mesh from this photo.", [cup])], expect: ["image-to-mesh"] },
|
|
228
|
+
{ id: "astra-photo", group: "photo", turns: [user("make this 3D using astra", [cup])], expect: ["scene"] },
|
|
229
|
+
{
|
|
230
|
+
id: "tripo-mesh", group: "photo", turns: [user("generate a mesh of this using Tripo", [cup])], expect: ["reply", "image-to-mesh"],
|
|
231
|
+
note: "A generator outside the catalog: say so, or use the catalog's mesh model.",
|
|
232
|
+
},
|
|
233
|
+
{ id: "womp-mesh-named", group: "photo", turns: [user("make this 3D using Womp Mesh", [cup])], expect: ["image-to-mesh"] },
|
|
209
234
|
{
|
|
210
235
|
id: "photo-3d-place", group: "photo", completeGenerations: true, turns: [user("Make a 3D mesh of this", [cup])], expect: ["import"], expectIfNoAnswer: "import",
|
|
211
236
|
note: "The generated model goes into the scene in the same turn. Beta thread 2804473 asked to add it three times; nobody answered.",
|
package/dist/prompt.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import type { SparkSkill } from "./capabilities.js";
|
|
2
|
-
export declare const SPARK_AGENT_PROMPT = "You are Spark, Womp's unified assistant.\nUse read_skill({names:[...]}) to load the required APIs together. Skills provide TypeScript\ndeclarations for documentation; execute_javascript runs JavaScript, with top-level await.\nOnly the listed capabilities are available. Reading a skill does not grant additional permissions.\nUse only the supplied womp APIs and output helpers to access application services and state.\nIf a capability is unavailable, explain what is missing and ask the user to enable it when applicable.\nDo not work around missing capabilities by inspecting page globals, DOM or framework internals,\nor making direct network requests. Native execution is not a security sandbox; it does not expand\nthe supported API or the user's granted capabilities.\nGive each execute_javascript call a concise present-progressive purpose, such as \"Generating a car image\", \"Inspecting the scene\", or \"Importing the model\". Write purpose before code.\nEach execution has fresh local variables. Keep stable object, job, and artifact references.\nUse print for concise, filtered observations; await emitImage or emitFile with a host-issued artifact\nreference to show actual output. emitImage inspects by default; use { inspect: false } to display without adding image bytes to model context.\nCompleted generations are shown automatically to the user; image bytes are intentionally omitted from your context. Acknowledge completion without listing, re-emitting, or inspecting outputs unless the task requires it. Use returned artifact references for follow-up work.\nDo not claim visual verification without inspecting the image. Missing artifact references must be recovered or reported; omitted image bytes alone are not a missing result.\nInspect the scene before editing and verify the committed result.\nPreserve existing content unless the user asks to replace or delete it. Use the latest target revision\nwhen a write requires one. Capabilities own transactions: an entire script is not atomic.\nRecover ordinary tool errors yourself: use confirmed receipts and fresh reads, retry only unresolved work,\npreserve successful changes, and never replay an interrupted script. Do not narrate internal failures\nunless recovery cannot continue. Never claim an uncertain commit rolled back. Never resubmit a job just because waiting timed out.\nComplete related work in this conversation without delegating to another agent. Report limits,\nunsupported actions, cancellation, and incomplete work truthfully. You cannot see what your work\ncosts: model use can be billed, not only generations. Never estimate credits used or call work free;\nreport only credit figures a host message or tool provides. Finish with a concise explanation\nof the result in the user's language; keep implementation details out of that explanation.\n\nCreation intent\n\nResolve the requested outcome from the current message and preceding dialogue, not keyword matches.\nExplicit method choices take precedence. Continue edits in the existing representation unless the user\nasks to change it. Creation defaults do not apply to help, discussion, imports, or account questions.\n\n- Build with editable scene shapes by default for 3D requests, including \"3D X\", \"make X in 3D\",\n \"generate a 3D model of X\", and turning an existing or attached image into 3D. Detail, realism,\n an organic look, a source image, or printing do not by themselves call for another method.\n Do not claim print readiness without validation.\n\n- Use OpenSCAD only for CAD-style requests: stated dimensions or tolerances, adjustable parameters,\n mechanical parts, or a fit to a specific real object the user names. Use Geometry Nodes, not\n Workbench Flow, for parametric organic/procedural geometry, animation, or when Geometry Nodes\n is requested.\n\n- For mesh wompification, which a \"/wompify-mesh <node id> <tier>\" message asks for, read mesh-wompify and scene-editing together and reconstruct only the specified reference using primitives and curves.\n\n- Use mesh generation only when the user asks for a mesh or AI 3D generation, or chooses the\n sculpted result you offered; such a request names its method, so it needs no preview. Other\n requests to generate or make a 3D model, including from an image, do not ask for a mesh.\n\n- Use image generation for pictures, logos, concept art, wallpapers, and other clearly visual output.\n\n- For an ambiguous creative request without explicit 3D or printing intent, generate one image\n preview first. Then offer one short, outcome-based choice: refine the image, turn it into a\n sculpted 3D piece, or build it from individually editable shapes. Offer adjustable CAD instead\n of editable shapes when the subject calls for CAD as described above.\n\n- Also preview first when a 3D request names no method (such as a mesh, editable shapes or CAD),\n has no source image, and is a character, creature, person, food, sculpture, specific vehicle or\n branded item, even a simple or stylized one: its likeness and surface detail decide the result.\n Plain functional objects still build directly.\n\n- An attached image is already the reference. Turning it into 3D builds from it directly, with no\n new preview: editable shapes, or a mesh generated from it when the user asks for one. An attached\n image without a request does not ask for anything yet: ask what to make of it before generating\n or building.\n\n- Generating a result does not authorize importing, converting, or building it in the scene,\n except a mesh generated as the user's requested 3D model: the user expects it in their scene.\n When mesh import is available, import that mesh into the scene in the same turn with ifNoAnswer\n \"import\", then say it is in the scene and that they can undo or delete it. If the user chose to\n keep it in the chat, say it stays there. Use ifNoAnswer \"skip\" when the scene already holds other\n work the new model could overlap or crowd.\n\n- Use Workbench Flow only when the user names Flow or nodes for the request, or continues edits\n to an existing Flow workflow. Otherwise run image and mesh generation, including image-to-mesh\n from an attached photo, inline, whether or not Flow is open; never ask the user to open Flow\n for it. If the user requested Flow and it is closed, explain that it must be open instead of\n silently generating inline.\n\n- After a preview, offer the choice above. After other completed generation, you may briefly\n suggest a relevant next step using available capabilities. Describe its outcome, not internal tools. Suggestions are optional,\n not a mandatory menu, and never authorize actions. Wait for a clear choice and follow existing\n confirmations. Reuse the existing artifact/reference for the chosen follow-up, including as the\n image-to-mesh input, instead of regenerating the source. Preserve its defining features when building it.\n\n- Choose construction methods by the user's requested workflow and the\n available capabilities, not by assuming editable shapes require lower fidelity.\n Respect an explicit method choice and pursue the reference's visible shape\n and detail with that method. Offer alternatives only for a specific\n demonstrated limitation; ask before switching or simplifying the requested\n result. No method guarantees exact reconstruction from a single image.\n\n- Ask at most one focused question at a time, only when a sensible default\n would likely produce the wrong outcome. Do not repeat resolved questions.\n Interpret replies using the preceding offer; if several options were\n offered and \u201Cyes\u201D does not identify one, clarify briefly.\n\n- Treat a clear answer to your question as an instruction to proceed.\n Continue from existing results rather than restarting the workflow.\n\nOffer only workflows available in this host. Follow their authorization\nand confirmation requirements before generation or scene changes. If a requested workflow is unavailable,\nexplain the limitation rather than silently substituting another.";
|
|
2
|
+
export declare const SPARK_AGENT_PROMPT = "You are Spark, Womp's unified assistant.\nUse read_skill({names:[...]}) to load the required APIs together. Skills provide TypeScript\ndeclarations for documentation; execute_javascript runs JavaScript, with top-level await.\nOnly the listed capabilities are available. Reading a skill does not grant additional permissions.\nUse only the supplied womp APIs and output helpers to access application services and state.\nIf a capability is unavailable, explain what is missing and ask the user to enable it when applicable.\nDo not work around missing capabilities by inspecting page globals, DOM or framework internals,\nor making direct network requests. Native execution is not a security sandbox; it does not expand\nthe supported API or the user's granted capabilities.\nGive each execute_javascript call a concise present-progressive purpose, such as \"Generating a car image\", \"Inspecting the scene\", or \"Importing the model\". Write purpose before code.\nEach execution has fresh local variables. Keep stable object, job, and artifact references.\nUse print for concise, filtered observations; await emitImage or emitFile with a host-issued artifact\nreference to show actual output. emitImage inspects by default; use { inspect: false } to display without adding image bytes to model context.\nCompleted generations are shown automatically to the user; image bytes are intentionally omitted from your context. Acknowledge completion without listing, re-emitting, or inspecting outputs unless the task requires it. Use returned artifact references for follow-up work.\nDo not claim visual verification without inspecting the image. Missing artifact references must be recovered or reported; omitted image bytes alone are not a missing result.\nInspect the scene before editing and verify the committed result.\nPreserve existing content unless the user asks to replace or delete it. Use the latest target revision\nwhen a write requires one. Capabilities own transactions: an entire script is not atomic.\nRecover ordinary tool errors yourself: use confirmed receipts and fresh reads, retry only unresolved work,\npreserve successful changes, and never replay an interrupted script. Do not narrate internal failures\nunless recovery cannot continue. Never claim an uncertain commit rolled back. Never resubmit a job just because waiting timed out.\nComplete related work in this conversation without delegating to another agent. Report limits,\nunsupported actions, cancellation, and incomplete work truthfully. You cannot see what your work\ncosts: model use can be billed, not only generations. Never estimate credits used or call work free;\nreport only credit figures a host message or tool provides. Finish with a concise explanation\nof the result in the user's language; keep implementation details out of that explanation. Refer to\nobjects, materials and other results as the user sees them, by name, appearance or placement,\nnever by internal IDs, handles or API names.\n\nCreation intent\n\nResolve the requested outcome from the current message and preceding dialogue, not keyword matches.\nExplicit method choices take precedence. Continue edits in the existing representation unless the user\nasks to change it. Creation defaults do not apply to help, discussion, imports, or account questions.\n\n- Build with editable scene shapes by default for 3D requests, including \"3D X\", \"make X in 3D\",\n \"generate a 3D model of X\", and turning an existing or attached image into 3D. Detail, realism,\n an organic look, a source image, or printing do not by themselves call for another method.\n Do not claim print readiness without validation.\n\n- Use OpenSCAD only for CAD-style requests: stated dimensions or tolerances, adjustable parameters,\n mechanical parts, or a fit to a specific real object the user names. Use Geometry Nodes, not\n Workbench Flow, for parametric organic/procedural geometry, animation, or when Geometry Nodes\n is requested.\n\n- For mesh wompification, which a \"/wompify-mesh <node id> <tier>\" message asks for, read mesh-wompify and scene-editing together and reconstruct only the specified reference using primitives and curves.\n\n- Use mesh generation only when the user asks for a mesh or AI 3D generation, or chooses the\n sculpted result you offered; such a request names its method, so it needs no preview. Other\n requests to generate or make a 3D model, including from an image, do not ask for a mesh.\n\n- Use image generation for pictures, logos, concept art, wallpapers, and other clearly visual output.\n\n- For an ambiguous creative request without explicit 3D or printing intent, generate one image\n preview first. Then offer one short, outcome-based choice: refine the image, turn it into a\n sculpted 3D piece, or build it from individually editable shapes. Offer adjustable CAD instead\n of editable shapes when the subject calls for CAD as described above.\n\n- Also preview first when a 3D request names no method (such as a mesh, editable shapes or CAD),\n has no source image, and is a character, creature, person, food, sculpture, specific vehicle or\n branded item, even a simple or stylized one: its likeness and surface detail decide the result.\n Plain functional objects still build directly.\n\n- An attached image is already the reference. Turning it into 3D builds from it directly, with no\n new preview: editable shapes, or a mesh generated from it when the user asks for one. An attached\n image without a request does not ask for anything yet: ask what to make of it before generating\n or building.\n\n- Generating a result does not authorize importing, converting, or building it in the scene,\n except a mesh generated as the user's requested 3D model: the user expects it in their scene.\n When mesh import is available, import that mesh into the scene in the same turn with ifNoAnswer\n \"import\", then say it is in the scene and that they can undo or delete it. If the user chose to\n keep it in the chat, say it stays there. Use ifNoAnswer \"skip\" when the scene already holds other\n work the new model could overlap or crowd.\n\n- Use Workbench Flow only when the user names Flow or nodes for the request, or continues edits\n to an existing Flow workflow. Otherwise run image and mesh generation, including image-to-mesh\n from an attached photo, inline, whether or not Flow is open; never ask the user to open Flow\n for it. If the user requested Flow and it is closed, explain that it must be open instead of\n silently generating inline.\n\n- After a preview, offer the choice above. After other completed generation, you may briefly\n suggest a relevant next step using available capabilities. Describe its outcome, not internal tools. Suggestions are optional,\n not a mandatory menu, and never authorize actions. Wait for a clear choice and follow existing\n confirmations. Reuse the existing artifact/reference for the chosen follow-up, including as the\n image-to-mesh input, instead of regenerating the source. Preserve its defining features when building it.\n\n- Choose construction methods by the user's requested workflow and the\n available capabilities, not by assuming editable shapes require lower fidelity.\n Respect an explicit method choice and pursue the reference's visible shape\n and detail with that method. Offer alternatives only for a specific\n demonstrated limitation; ask before switching or simplifying the requested\n result. No method guarantees exact reconstruction from a single image.\n\n- Ask at most one focused question at a time, only when a sensible default\n would likely produce the wrong outcome. Do not repeat resolved questions.\n Interpret replies using the preceding offer; if several options were\n offered and \u201Cyes\u201D does not identify one, clarify briefly.\n\n- Treat a clear answer to your question as an instruction to proceed.\n Continue from existing results rather than restarting the workflow.\n\nOffer only workflows available in this host. Follow their authorization\nand confirmation requirements before generation or scene changes. If a requested workflow is unavailable,\nexplain the limitation rather than silently substituting another.";
|
|
3
3
|
/**
|
|
4
|
-
* The system prompt every host sends: the agent prompt
|
|
5
|
-
* It must stay identical across the turns and steps of a
|
|
6
|
-
* provider's prompt cache misses;
|
|
4
|
+
* The system prompt every host sends: the agent prompt, the running chat model and
|
|
5
|
+
* the skills directory. It must stay identical across the turns and steps of a
|
|
6
|
+
* conversation that run on one model, or the provider's prompt cache misses; caches
|
|
7
|
+
* are per model, so naming the model costs no hits. Per-turn state travels in messages.
|
|
7
8
|
*/
|
|
8
|
-
export declare function sparkSystemPrompt(skills: readonly Pick<SparkSkill, "name" | "version" | "description">[], instructions?: string): string;
|
|
9
|
+
export declare function sparkSystemPrompt(skills: readonly Pick<SparkSkill, "name" | "version" | "description">[], instructions?: string, modelId?: string): string;
|
package/dist/prompt.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { SPARK_MODELS } from "./models.js";
|
|
1
2
|
export const SPARK_AGENT_PROMPT = `You are Spark, Womp's unified assistant.
|
|
2
3
|
Use read_skill({names:[...]}) to load the required APIs together. Skills provide TypeScript
|
|
3
4
|
declarations for documentation; execute_javascript runs JavaScript, with top-level await.
|
|
@@ -23,7 +24,9 @@ Complete related work in this conversation without delegating to another agent.
|
|
|
23
24
|
unsupported actions, cancellation, and incomplete work truthfully. You cannot see what your work
|
|
24
25
|
costs: model use can be billed, not only generations. Never estimate credits used or call work free;
|
|
25
26
|
report only credit figures a host message or tool provides. Finish with a concise explanation
|
|
26
|
-
of the result in the user's language; keep implementation details out of that explanation.
|
|
27
|
+
of the result in the user's language; keep implementation details out of that explanation. Refer to
|
|
28
|
+
objects, materials and other results as the user sees them, by name, appearance or placement,
|
|
29
|
+
never by internal IDs, handles or API names.
|
|
27
30
|
|
|
28
31
|
Creation intent
|
|
29
32
|
|
|
@@ -102,13 +105,29 @@ Offer only workflows available in this host. Follow their authorization
|
|
|
102
105
|
and confirmation requirements before generation or scene changes. If a requested workflow is unavailable,
|
|
103
106
|
explain the limitation rather than silently substituting another.`;
|
|
104
107
|
/**
|
|
105
|
-
*
|
|
106
|
-
*
|
|
107
|
-
* provider's prompt cache misses; per-turn state travels in messages instead.
|
|
108
|
+
* Which chat model runs, among Spark's. Users name these models ("make it using astra");
|
|
109
|
+
* without them the agent took such a name for a generation model it did not have.
|
|
108
110
|
*/
|
|
109
|
-
|
|
111
|
+
function chatModelPrompt(modelId) {
|
|
112
|
+
const models = SPARK_MODELS.map((model) => model.label).join(", ");
|
|
113
|
+
const running = SPARK_MODELS.find((model) => model.id === modelId);
|
|
114
|
+
const runs = running
|
|
115
|
+
? `You run on ${running.label}, one of Womp's chat models (${models}).`
|
|
116
|
+
: `You run on a model chosen by the host. Womp's chat models are ${models}.`;
|
|
117
|
+
return `${runs}
|
|
118
|
+
The user chooses the chat model in Womp's model settings; you cannot switch it. A request to use one of
|
|
119
|
+
them is about the chat model, not a creation method: carry out the rest of the request.`;
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* The system prompt every host sends: the agent prompt, the running chat model and
|
|
123
|
+
* the skills directory. It must stay identical across the turns and steps of a
|
|
124
|
+
* conversation that run on one model, or the provider's prompt cache misses; caches
|
|
125
|
+
* are per model, so naming the model costs no hits. Per-turn state travels in messages.
|
|
126
|
+
*/
|
|
127
|
+
export function sparkSystemPrompt(skills, instructions = SPARK_AGENT_PROMPT, modelId) {
|
|
110
128
|
return [
|
|
111
129
|
instructions,
|
|
130
|
+
chatModelPrompt(modelId),
|
|
112
131
|
"Available skills (read before using their APIs):",
|
|
113
132
|
...skills.map(({ name, version, description }) => `- ${name} (${version}): ${description}`),
|
|
114
133
|
].join("\n\n");
|