reflex-agent 0.2.3 → 0.3.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/.next/BUILD_ID +1 -1
- package/.next/app-build-manifest.json +116 -103
- package/.next/app-path-routes-manifest.json +10 -10
- package/.next/build-manifest.json +5 -5
- package/.next/prerender-manifest.json +4 -54
- package/.next/react-loadable-manifest.json +1 -1
- package/.next/server/app/_not-found/page.js +1 -1
- package/.next/server/app/_not-found/page.js.nft.json +1 -1
- package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/.next/server/app/agents/[agentId]/page.js +3 -3
- package/.next/server/app/agents/[agentId]/page.js.nft.json +1 -1
- package/.next/server/app/agents/[agentId]/page_client-reference-manifest.js +1 -1
- package/.next/server/app/api/agents/[agentId]/respond/route.js +2 -2
- package/.next/server/app/api/agents/[agentId]/respond/route.js.nft.json +1 -1
- package/.next/server/app/api/agents/[agentId]/respond/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/images/[rootId]/[file]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/oauth/callback/route.js +4 -4
- package/.next/server/app/api/oauth/callback/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/oauth/start/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/roots/[id]/attachments/route.js +0 -0
- package/.next/server/app/api/roots/[id]/attachments/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/roots/[id]/chat/[topicId]/send/route.js +2 -2
- package/.next/server/app/api/roots/[id]/chat/[topicId]/send/route.js.nft.json +1 -1
- package/.next/server/app/api/roots/[id]/chat/[topicId]/send/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/roots/[id]/chat/[topicId]/stop/route.js +2 -2
- package/.next/server/app/api/roots/[id]/chat/[topicId]/stop/route.js.nft.json +1 -1
- package/.next/server/app/api/roots/[id]/chat/[topicId]/stop/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/roots/[id]/chat/[topicId]/stream/route.js +3 -3
- package/.next/server/app/api/roots/[id]/chat/[topicId]/stream/route.js.nft.json +1 -1
- package/.next/server/app/api/roots/[id]/chat/[topicId]/stream/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/roots/[id]/dashboard/route.js +1 -1
- package/.next/server/app/api/roots/[id]/dashboard/route.js.nft.json +1 -1
- package/.next/server/app/api/roots/[id]/dashboard/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/roots/[id]/suggestions/route.js +1 -1
- package/.next/server/app/api/roots/[id]/suggestions/route.js.nft.json +1 -1
- package/.next/server/app/api/roots/[id]/suggestions/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/utilities/[scope]/[id]/bundle.js/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/utilities/[scope]/[id]/host/route.js +2 -2
- package/.next/server/app/api/utilities/[scope]/[id]/host/route.js.nft.json +1 -1
- package/.next/server/app/api/utilities/[scope]/[id]/host/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/utilities/[scope]/[id]/host-api.mjs/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/utilities/[scope]/[id]/host-ui.mjs/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/utilities/[scope]/[id]/iframe/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/utilities/[scope]/[id]/style.css/route_client-reference-manifest.js +1 -1
- package/.next/server/app/audit/page.js +2 -2
- package/.next/server/app/audit/page.js.nft.json +1 -1
- package/.next/server/app/audit/page_client-reference-manifest.js +1 -1
- package/.next/server/app/onboarding/page.js +3 -3
- package/.next/server/app/onboarding/page.js.nft.json +1 -1
- package/.next/server/app/onboarding/page_client-reference-manifest.js +1 -1
- package/.next/server/app/page.js +2 -2
- package/.next/server/app/page.js.nft.json +1 -1
- package/.next/server/app/page_client-reference-manifest.js +1 -1
- package/.next/server/app/roots/[id]/chat/[topicId]/page.js +2 -6
- package/.next/server/app/roots/[id]/chat/[topicId]/page.js.nft.json +1 -1
- package/.next/server/app/roots/[id]/chat/[topicId]/page_client-reference-manifest.js +1 -1
- package/.next/server/app/roots/[id]/kb/[...slug]/page.js +2 -6
- package/.next/server/app/roots/[id]/kb/[...slug]/page.js.nft.json +1 -1
- package/.next/server/app/roots/[id]/kb/[...slug]/page_client-reference-manifest.js +1 -1
- package/.next/server/app/roots/[id]/page.js +3 -3
- package/.next/server/app/roots/[id]/page.js.nft.json +1 -1
- package/.next/server/app/roots/[id]/page_client-reference-manifest.js +1 -1
- package/.next/server/app/roots/[id]/workflows/[wfId]/page.js +2 -2
- package/.next/server/app/roots/[id]/workflows/[wfId]/page.js.nft.json +1 -1
- package/.next/server/app/roots/[id]/workflows/[wfId]/page_client-reference-manifest.js +1 -1
- package/.next/server/app/roots/[id]/workflows/page.js +2 -2
- package/.next/server/app/roots/[id]/workflows/page.js.nft.json +1 -1
- package/.next/server/app/roots/[id]/workflows/page_client-reference-manifest.js +1 -1
- package/.next/server/app/roots/new/page.js +5 -3
- package/.next/server/app/roots/new/page.js.nft.json +1 -1
- package/.next/server/app/roots/new/page_client-reference-manifest.js +1 -1
- package/.next/server/app/settings/page.js +6 -6
- package/.next/server/app/settings/page.js.nft.json +1 -1
- package/.next/server/app/settings/page_client-reference-manifest.js +1 -1
- package/.next/server/app/share/[id]/file/page.js +2 -2
- package/.next/server/app/share/[id]/file/page.js.nft.json +1 -1
- package/.next/server/app/share/[id]/file/page_client-reference-manifest.js +1 -1
- package/.next/server/app/share/[id]/page.js +2 -2
- package/.next/server/app/share/[id]/page.js.nft.json +1 -1
- package/.next/server/app/share/[id]/page_client-reference-manifest.js +1 -1
- package/.next/server/app/utilities/[scope]/[id]/page.js +2 -2
- package/.next/server/app/utilities/[scope]/[id]/page.js.nft.json +1 -1
- package/.next/server/app/utilities/[scope]/[id]/page_client-reference-manifest.js +1 -1
- package/.next/server/app/utilities/page.js +2 -17
- package/.next/server/app/utilities/page.js.nft.json +1 -1
- package/.next/server/app/utilities/page_client-reference-manifest.js +1 -1
- package/.next/server/app-paths-manifest.json +10 -10
- package/.next/server/chunks/1.js +3 -0
- package/.next/server/chunks/1223.js +1 -1
- package/.next/server/chunks/133.js +1 -490
- package/.next/server/chunks/1888.js +1 -1
- package/.next/server/chunks/{9739.js → 1988.js} +13 -9
- package/.next/server/chunks/2192.js +1 -0
- package/.next/server/chunks/2433.js +1 -1
- package/.next/server/chunks/2503.js +1 -1
- package/.next/server/chunks/285.js +471 -0
- package/.next/server/chunks/2995.js +1 -0
- package/.next/server/chunks/3240.js +1 -1
- package/.next/server/chunks/3332.js +1 -1
- package/.next/server/chunks/{2528.js → 3512.js} +2 -2
- package/.next/server/chunks/3657.js +1 -1
- package/.next/server/chunks/4066.js +1 -1
- package/.next/server/chunks/4438.js +1 -0
- package/.next/server/chunks/4553.js +1 -1
- package/.next/server/chunks/4812.js +179 -0
- package/.next/server/chunks/4925.js +1 -1
- package/.next/server/chunks/5319.js +1 -1
- package/.next/server/chunks/569.js +1 -1
- package/.next/server/chunks/6730.js +1 -1
- package/.next/server/chunks/6734.js +1 -0
- package/.next/server/chunks/6909.js +142 -161
- package/.next/server/chunks/7215.js +1 -0
- package/.next/server/chunks/8262.js +1 -1
- package/.next/server/chunks/9098.js +1 -1
- package/.next/server/chunks/94.js +1 -1
- package/.next/server/chunks/9835.js +1 -1
- package/.next/server/chunks/9944.js +1 -0
- package/.next/server/functions-config-manifest.json +1 -1
- package/.next/server/middleware-build-manifest.js +1 -1
- package/.next/server/middleware-manifest.json +5 -5
- package/.next/server/middleware-react-loadable-manifest.js +1 -1
- package/.next/server/pages/500.html +1 -1
- package/.next/server/pages-manifest.json +1 -2
- package/.next/server/server-reference-manifest.js +1 -1
- package/.next/server/server-reference-manifest.json +1 -1
- package/.next/static/chunks/1082-326e649fb24d4945.js +1 -0
- package/.next/static/chunks/3736-f4e42d6d38be50b0.js +1 -0
- package/.next/static/chunks/4108.ca0bdf3cbf3c56cc.js +1 -0
- package/.next/static/chunks/6445-99824866a51b582a.js +1 -0
- package/.next/static/chunks/7482-7ef26030a10ce14f.js +1 -0
- package/.next/static/chunks/8944-c4f2406ecd61094f.js +1 -0
- package/.next/static/chunks/9411-af5f758c57741929.js +3 -0
- package/.next/static/chunks/9415-eb6b5d4c2de3a7c0.js +1 -0
- package/.next/static/chunks/app/agents/[agentId]/page-5d6f4cb16b42d02b.js +1 -0
- package/.next/static/chunks/app/layout-85eb1fd21dab0895.js +1 -0
- package/.next/static/chunks/app/onboarding/page-2013bd8124b9162e.js +1 -0
- package/.next/static/chunks/app/page-558a224e13ffb52c.js +1 -0
- package/.next/static/chunks/app/roots/[id]/chat/[topicId]/page-b42f03fd58669d12.js +1 -0
- package/.next/static/chunks/app/roots/[id]/kb/[...slug]/page-7d17b4e6a5231f56.js +1 -0
- package/.next/static/chunks/app/roots/[id]/page-4aab5266f432e37e.js +1 -0
- package/.next/static/chunks/app/roots/[id]/workflows/[wfId]/page-1ee3320bf5744efc.js +1 -0
- package/.next/static/chunks/app/roots/new/page-df8d2c1f0c64c37a.js +1 -0
- package/.next/static/chunks/app/settings/page-fdba798d9e243ad3.js +1 -0
- package/.next/static/chunks/app/share/[id]/page-818a451d05e08d26.js +1 -0
- package/.next/static/chunks/app/utilities/[scope]/[id]/page-2cee09cc2ab9b5e8.js +1 -0
- package/.next/static/chunks/app/utilities/page-44a51522b347f13e.js +1 -0
- package/.next/static/chunks/{webpack-87b4bb79fdc48563.js → webpack-2b0eab4ccdf44f63.js} +1 -1
- package/.next/static/css/4b367c1d0fa99b78.css +1 -0
- package/.next/trace +47 -46
- package/README.md +4 -1
- package/dist/lib/reflex/agents/prompts.js +46 -46
- package/dist/lib/reflex/agents/prompts.js.map +1 -1
- package/dist/lib/reflex/prompts/defaults.js +102 -102
- package/next.config.ts +4 -1
- package/package.json +4 -3
- package/packages/utilities/learn-anything/README.md +29 -29
- package/packages/utilities/learn-anything/actions/_json.ts +11 -11
- package/packages/utilities/learn-anything/actions/_store.ts +2 -2
- package/packages/utilities/learn-anything/actions/buildModule.ts +60 -59
- package/packages/utilities/learn-anything/actions/explainSelection.ts +14 -13
- package/packages/utilities/learn-anything/actions/generateOutline.ts +15 -15
- package/packages/utilities/learn-anything/actions/generateQuiz.ts +8 -8
- package/packages/utilities/learn-anything/actions/generateTrainer.ts +15 -15
- package/packages/utilities/learn-anything/actions/refreshCourseCard.ts +4 -4
- package/packages/utilities/learn-anything/actions/tutorAsk.ts +15 -15
- package/packages/utilities/learn-anything/article-view.tsx +4 -4
- package/packages/utilities/learn-anything/manifest.json +5 -5
- package/packages/utilities/learn-anything/ui.tsx +57 -57
- package/.next/server/app/_not-found.html +0 -1
- package/.next/server/app/_not-found.meta +0 -8
- package/.next/server/app/_not-found.rsc +0 -18
- package/.next/server/app/index.html +0 -1
- package/.next/server/app/index.meta +0 -9
- package/.next/server/app/index.rsc +0 -19
- package/.next/server/chunks/1986.js +0 -1
- package/.next/server/chunks/4065.js +0 -1
- package/.next/server/chunks/6981.js +0 -1
- package/.next/server/chunks/7017.js +0 -3
- package/.next/server/chunks/7800.js +0 -1
- package/.next/server/chunks/8494.js +0 -1
- package/.next/server/chunks/8843.js +0 -1
- package/.next/server/chunks/9328.js +0 -179
- package/.next/server/chunks/9423.js +0 -3
- package/.next/server/chunks/9455.js +0 -1
- package/.next/server/pages/404.html +0 -1
- package/.next/static/chunks/1384-d28fb6c6c058876f.js +0 -1
- package/.next/static/chunks/2718-78fee2c0de782178.js +0 -1
- package/.next/static/chunks/4108.1ef6b5e7679b56ac.js +0 -1
- package/.next/static/chunks/7238-11701befb3ca3e41.js +0 -1
- package/.next/static/chunks/7951-590bf2004d7935b5.js +0 -1
- package/.next/static/chunks/8423-ffded33a21b27360.js +0 -1
- package/.next/static/chunks/9045-731ff0865352dd95.js +0 -1
- package/.next/static/chunks/app/agents/[agentId]/page-0b5c2838354d0eba.js +0 -1
- package/.next/static/chunks/app/layout-4fbf9f91ad45e221.js +0 -1
- package/.next/static/chunks/app/onboarding/page-532b193d1c4b0dee.js +0 -1
- package/.next/static/chunks/app/page-e3ec0990b78ce7c7.js +0 -1
- package/.next/static/chunks/app/roots/[id]/chat/[topicId]/page-11aad9a40def2e0d.js +0 -1
- package/.next/static/chunks/app/roots/[id]/kb/[...slug]/page-d8757a85e873dfa1.js +0 -1
- package/.next/static/chunks/app/roots/[id]/page-76216026efb90ae0.js +0 -1
- package/.next/static/chunks/app/roots/[id]/workflows/[wfId]/page-c4b6e3825f8626f5.js +0 -1
- package/.next/static/chunks/app/roots/new/page-53ea8d2787e79425.js +0 -1
- package/.next/static/chunks/app/settings/page-7ebaf2b62f256538.js +0 -1
- package/.next/static/chunks/app/share/[id]/page-d5bbbb7e454d1375.js +0 -1
- package/.next/static/chunks/app/utilities/[scope]/[id]/page-e2f928a37483d113.js +0 -1
- package/.next/static/chunks/app/utilities/page-839262ff726a52a2.js +0 -1
- package/.next/static/css/87e01f779d555d04.css +0 -1
- /package/.next/static/{vTfQfQnAWV_hFVZjWEYvZ → fhVNqfmJl5Mdfhyhg6orp}/_buildManifest.js +0 -0
- /package/.next/static/{vTfQfQnAWV_hFVZjWEYvZ → fhVNqfmJl5Mdfhyhg6orp}/_ssgManifest.js +0 -0
package/README.md
CHANGED
|
@@ -24,6 +24,9 @@ reflex start # opens http://localhost:3210 in your browser
|
|
|
24
24
|
reflex start --port 4000 --no-open
|
|
25
25
|
```
|
|
26
26
|
|
|
27
|
+
Dev runs on `:3211` by default so a `pnpm dev` and an installed
|
|
28
|
+
`reflex start` can co-exist without a port collision.
|
|
29
|
+
|
|
27
30
|
Home page lists registered "Reflex roots". Add a directory via the built-in
|
|
28
31
|
file picker, then click **Run init** on the detail page to have the agent
|
|
29
32
|
build the KB. The left sidebar shows the resulting MD tree under `.reflex/`;
|
|
@@ -42,7 +45,7 @@ reflex chat <dir> # open a chat scoped to dir's KB
|
|
|
42
45
|
|
|
43
46
|
```sh
|
|
44
47
|
pnpm install
|
|
45
|
-
pnpm dev # http://localhost:
|
|
48
|
+
pnpm dev # http://localhost:3211 (Next dev server with HMR)
|
|
46
49
|
pnpm build # produce dist/ + .next/ for `reflex start`
|
|
47
50
|
```
|
|
48
51
|
|
|
@@ -50,37 +50,37 @@ function imageGenInstructions() {
|
|
|
50
50
|
return [
|
|
51
51
|
"## Generating images inline",
|
|
52
52
|
"",
|
|
53
|
-
"When the user asks to draw, generate, or illustrate something (\"
|
|
53
|
+
"When the user asks to draw, generate, or illustrate something (\"draw a cat\", \"make an illustration\", \"generate a preview\"), DON'T describe what you'd draw — emit an image-gen marker and Reflex will render the actual image inside your reply.",
|
|
54
54
|
"",
|
|
55
55
|
"```",
|
|
56
56
|
`<<reflex:image-gen>>{`,
|
|
57
|
-
` "prompt": "
|
|
57
|
+
` "prompt": "detailed prompt describing the picture",`,
|
|
58
58
|
` "provider": "gemini",`,
|
|
59
59
|
` "aspectRatio": "16:9",`,
|
|
60
|
-
` "caption": "
|
|
60
|
+
` "caption": "short caption (optional)",`,
|
|
61
61
|
` "attachToKb": false`,
|
|
62
62
|
`}<</reflex:image-gen>>`,
|
|
63
63
|
"```",
|
|
64
64
|
"",
|
|
65
|
-
"- `provider`: `\"gemini\"` (Nano Banana,
|
|
66
|
-
"- `aspectRatio`: `\"1:1\"`, `\"16:9\"`, `\"9:16\"`, `\"4:3\"
|
|
67
|
-
"- `attachToKb: true` —
|
|
68
|
-
"-
|
|
69
|
-
"-
|
|
70
|
-
"-
|
|
65
|
+
"- `provider`: `\"gemini\"` (Nano Banana, default, cheap and fast) or `\"codex\"` (via `$imagegen` in Codex CLI).",
|
|
66
|
+
"- `aspectRatio`: `\"1:1\"`, `\"16:9\"`, `\"9:16\"`, `\"4:3\"`, etc. Optional.",
|
|
67
|
+
"- `attachToKb: true` — also save the image to the KB as `kind: \"image\"` for future reuse.",
|
|
68
|
+
"- You can emit multiple markers in one reply — that produces N images in a row.",
|
|
69
|
+
"- Write a detailed prompt: style (photorealism / watercolor / 3D / illustration), composition, lighting, mood. The more specific — the better the result.",
|
|
70
|
+
"- DO NOT describe in words \"here is a picture of a cat\" — just emit the marker; Reflex inserts the image into your reply itself.",
|
|
71
71
|
].join("\n");
|
|
72
72
|
}
|
|
73
73
|
/**
|
|
74
74
|
* Workflows are linear "recipes" (steps run sequentially). Designed for
|
|
75
75
|
* non-programmers — the agent's job is to compose them from typed nodes
|
|
76
76
|
* (text-template, http-request, web-fetch, ask-agent, kb-write) when
|
|
77
|
-
* the user asks for "
|
|
77
|
+
* the user asks for "automation", "a recurring task", "a robot".
|
|
78
78
|
*/
|
|
79
79
|
function workflowInstructions() {
|
|
80
80
|
return [
|
|
81
|
-
"## Workflows —
|
|
81
|
+
"## Workflows — built-in \"n8n for non-techies\"",
|
|
82
82
|
"",
|
|
83
|
-
"
|
|
83
|
+
"When the user wants to automate something recurring (morning digest, page monitor, \"fetch → process → save\" routine), emit a `<<reflex:workflow-create>>` marker — Reflex will save the workflow to disk and show a preview with a link to the editor.",
|
|
84
84
|
"",
|
|
85
85
|
"```",
|
|
86
86
|
`<<reflex:workflow-create>>{`,
|
|
@@ -89,29 +89,29 @@ function workflowInstructions() {
|
|
|
89
89
|
` "description": "<one line>",`,
|
|
90
90
|
` "trigger": "manual" | "hourly" | "daily" | "weekly",`,
|
|
91
91
|
` "steps": [`,
|
|
92
|
-
` {"id": "fetch", "kind": "web-fetch", "label": "
|
|
93
|
-
` {"id": "digest", "kind": "ask-agent", "label": "
|
|
94
|
-
` {"id": "save", "kind": "kb-write", "label": "
|
|
92
|
+
` {"id": "fetch", "kind": "web-fetch", "label": "Fetch HN", "params": {"url": "https://news.ycombinator.com/rss"}},`,
|
|
93
|
+
` {"id": "digest", "kind": "ask-agent", "label": "Compress into digest", "params": {"prompt": "Summarize the top 5 headlines from the RSS:\\n{{prev}}"}},`,
|
|
94
|
+
` {"id": "save", "kind": "kb-write", "label": "Write to KB", "params": {"kind": "digest", "title": "HN digest", "body": "{{prev}}"}}`,
|
|
95
95
|
` ]`,
|
|
96
96
|
`}<</reflex:workflow-create>>`,
|
|
97
97
|
"```",
|
|
98
98
|
"",
|
|
99
|
-
"###
|
|
99
|
+
"### Available step `kind`s",
|
|
100
100
|
"",
|
|
101
|
-
"- `text-template` — `{template: string}`.
|
|
102
|
-
"- `http-request` — `{url, method?, headers?: string-JSON, body?}`. Output:
|
|
103
|
-
"- `web-fetch` — `{url}`.
|
|
104
|
-
"- `ask-agent` — `{prompt}`.
|
|
105
|
-
"- `kb-write` — `{kind, title, body}`.
|
|
101
|
+
"- `text-template` — `{template: string}`. Substitutions: `{{prev}}`, `{{steps.<id>.output}}`, `{{input.<field>}}`, `{{workflow.label}}`.",
|
|
102
|
+
"- `http-request` — `{url, method?, headers?: string-JSON, body?}`. Output: text or JSON (by content-type).",
|
|
103
|
+
"- `web-fetch` — `{url}`. Simple GET; output is the response text.",
|
|
104
|
+
"- `ask-agent` — `{prompt}`. Runs a headless orchestrator and returns the response text. Use for summarization, paraphrasing, classification.",
|
|
105
|
+
"- `kb-write` — `{kind, title, body}`. Saves to the knowledge base as a regular KB file.",
|
|
106
106
|
"",
|
|
107
|
-
"###
|
|
107
|
+
"### Rules",
|
|
108
108
|
"",
|
|
109
|
-
"-
|
|
110
|
-
"- `id`
|
|
111
|
-
"-
|
|
112
|
-
"-
|
|
113
|
-
"- Trigger `manual
|
|
114
|
-
"-
|
|
109
|
+
"- Each step passes its output to the next via `{{prev}}` or `{{steps.<id>.output}}`. This is the only link between steps.",
|
|
110
|
+
"- A step's `id` must be stable and kebab-case — templates reference it.",
|
|
111
|
+
"- Steps run strictly sequentially. If a step fails — the rest won't run, and the run is marked failed.",
|
|
112
|
+
"- Keep workflows SHORT (3-5 steps). If the task is larger — split it into several workflows or let the agent handle the complex part via `ask-agent`.",
|
|
113
|
+
"- Trigger defaults to `manual`. `hourly`/`daily`/`weekly` currently work only via manual launch; the scheduler is in progress.",
|
|
114
|
+
"- After emitting the marker — a short message to the user: what you assembled, how to run it, where to edit it.",
|
|
115
115
|
].join("\n");
|
|
116
116
|
}
|
|
117
117
|
/**
|
|
@@ -162,28 +162,28 @@ function widgetInstructions() {
|
|
|
162
162
|
"- `progress` — `{items: [{label, current, target, unit?}]}`. Goal-tracking bars.",
|
|
163
163
|
"- `image` — `{url, alt?, caption?}`. Single image card.",
|
|
164
164
|
"- `stat-table` — `{columns?: [string], rows: [[string, ...]]}`. Compact comparison table.",
|
|
165
|
-
"- `map` — `{points: [{lat, lng, title, description?}], center?, zoom?, route?: {stops: number[], color?, mode?}}`.
|
|
165
|
+
"- `map` — `{points: [{lat, lng, title, description?}], center?, zoom?, route?: {stops: number[], color?, mode?}}`. Map with points + an optional route (polyline + multi-waypoint deep-links: google/yandex/2gis/apple/osm/waze/organic). `route.stops` — array of indices in `points` in traversal order (minimum 2). Each point gets a popup with branded service buttons. By default the map auto-fits to the points. IMPORTANT: `lat`/`lng` are numbers in decimal degrees (lat=55.7558, lng=37.6173 — Moscow). NOT strings. If you have an address — find coordinates via WebSearch/WebFetch (geocoding); don't invent them. The user can search for places (Nominatim) and build a route right in the widget — the \"Route\" button switches to point-pick-by-click mode.",
|
|
166
166
|
"",
|
|
167
167
|
"### Interactivity",
|
|
168
168
|
"",
|
|
169
|
-
"
|
|
170
|
-
" - **checklist**:
|
|
171
|
-
" - **link-list**:
|
|
172
|
-
" - **news-list**:
|
|
173
|
-
" - **kb-pinned**:
|
|
174
|
-
" - **progress**: ±
|
|
169
|
+
"Dashboard widgets are interactive — the user can, right in the UI:",
|
|
170
|
+
" - **checklist**: tick checkboxes (toggle done), delete items, add new ones.",
|
|
171
|
+
" - **link-list**: delete links.",
|
|
172
|
+
" - **news-list**: mark a news item as read (`read:true`), remove the card.",
|
|
173
|
+
" - **kb-pinned**: unpin files.",
|
|
174
|
+
" - **progress**: ± buttons on `current`.",
|
|
175
175
|
"",
|
|
176
|
-
"
|
|
177
|
-
" -
|
|
178
|
-
" -
|
|
179
|
-
" -
|
|
176
|
+
"These changes are written straight to disk, bypassing you. On the next `widget-update` you'll see the current state. Strategy:",
|
|
177
|
+
" - If the user deleted a checklist item — don't add it back (that's a signal).",
|
|
178
|
+
" - If the user marked a news item as read — record its URL in `memory` for dedup.",
|
|
179
|
+
" - If the user reset progress — apparently it's a new cycle; respect it.",
|
|
180
180
|
"",
|
|
181
181
|
"### Rules",
|
|
182
182
|
"",
|
|
183
183
|
"- Pick the SIMPLEST kind that fits — don't squeeze a news digest into `markdown` if `news-list` exists.",
|
|
184
184
|
"- `id` is stable: same id across `widget-create` and `widget-update`. Pick a slug from the topic content (e.g. `tech-news-weekly`, `okrs-q2`).",
|
|
185
|
-
"- `size.mode`: `\"sm\"` (3
|
|
186
|
-
"- After emitting the marker, briefly tell the user in plain text WHAT
|
|
185
|
+
"- `size.mode`: `\"sm\"` (3 per row, icons/KPI) | `\"md\"` (default, 2 per row) | `\"wide\"` (full row, for long tables/markdown). Match it to the content, but the user can override via the UI — your choice is only a hint.",
|
|
186
|
+
"- After emitting the marker, briefly tell the user in plain text WHAT widget you assembled. IMPORTANT: a new widget does NOT appear on the dashboard automatically — it sits in the library as a draft. The user sees it right in the chat (preview) and can pin it with the \"Pin to dashboard\" button or via the library. Don't claim the widget is already on the dashboard.",
|
|
187
187
|
"- Reflex automatically shows a live preview of the widget inside this chat turn — no need to re-render in markdown.",
|
|
188
188
|
].join("\n");
|
|
189
189
|
}
|
|
@@ -200,15 +200,15 @@ function dispatchInstructions() {
|
|
|
200
200
|
"For anything non-trivial (deep KB reading, multi-file research, code writes, utility creation, summarization of large texts) — DELEGATE to a specialist sub-agent instead of doing it yourself. Sub-agents run with a focused system prompt and a constrained toolset.",
|
|
201
201
|
"",
|
|
202
202
|
"Available roles:",
|
|
203
|
-
" - **researcher** — read-only KB / web research. Use for \"
|
|
204
|
-
" - **coder** — writes/edits files (Write/Edit + read tools). Use for \"
|
|
205
|
-
" - **summarizer** — no tools; compresses long text from the brief. Use for \"
|
|
203
|
+
" - **researcher** — read-only KB / web research. Use for \"find / gather / quote\".",
|
|
204
|
+
" - **coder** — writes/edits files (Write/Edit + read tools). Use for \"do / fix / create a file\".",
|
|
205
|
+
" - **summarizer** — no tools; compresses long text from the brief. Use for \"compress / extract the main points\" from a large chunk.",
|
|
206
206
|
" - **kb-writer** — designs a structured KB entry (returns JSON for <<reflex:kb>>). Use when something is worth saving but the shape is non-trivial.",
|
|
207
207
|
" - **utility-builder** — designs a Reflex utility (manifest + ui.tsx). Use when the user asks to build a new utility.",
|
|
208
208
|
"",
|
|
209
209
|
"To dispatch, emit one or more markers in a single turn and STOP:",
|
|
210
210
|
"",
|
|
211
|
-
" <<reflex:dispatch>>{\"id\":\"r1\",\"role\":\"researcher\",\"brief\":\"
|
|
211
|
+
" <<reflex:dispatch>>{\"id\":\"r1\",\"role\":\"researcher\",\"brief\":\"Read INDEX.md and collect a list of topics.\"}<</reflex:dispatch>>",
|
|
212
212
|
"",
|
|
213
213
|
"Rules:",
|
|
214
214
|
" - `brief` must be self-contained — sub-agents do NOT see the chat transcript. Include all rel-paths, expected output shape, constraints.",
|
|
@@ -222,7 +222,7 @@ function dispatchInstructions() {
|
|
|
222
222
|
" – task is heavy code synthesis / refactor / type-fixing — Codex shines there.",
|
|
223
223
|
" – task is short text classification / extraction — `\"harness\":\"ollama\"` is cheap and fast.",
|
|
224
224
|
" - Without `harness`, the sub-agent inherits the orchestrator's runtime — usually fine. Override only when you have a concrete reason.",
|
|
225
|
-
" - Example: `<<reflex:dispatch>>{\"role\":\"coder\",\"harness\":\"codex\",\"brief\":\"
|
|
225
|
+
" - Example: `<<reflex:dispatch>>{\"role\":\"coder\",\"harness\":\"codex\",\"brief\":\"Rewrite X in TypeScript strict mode\"}<</reflex:dispatch>>`",
|
|
226
226
|
].join("\n");
|
|
227
227
|
}
|
|
228
228
|
//# sourceMappingURL=prompts.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prompts.js","sourceRoot":"","sources":["../../../../lib/reflex/agents/prompts.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,C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