@mindstudio-ai/remy 0.1.6 → 0.1.8

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.
@@ -23,6 +23,55 @@ everywhere. This makes the design easy to update later without hunting
23
23
  through components. Keep it simple: a handful of CSS variables for colors
24
24
  and a few reusable text style classes or utilities for typography.
25
25
 
26
+ **When these blocks are present, always use the defined fonts and colors in
27
+ generated code.** Do not pick your own fonts or colors when the spec defines
28
+ them. Reference colors semantically (as CSS variables or named constants)
29
+ rather than scattering raw hex values through the codebase.
30
+
31
+ ### Colors block format
32
+
33
+ A `` ```colors `` fenced block declares named colors with hex values and
34
+ descriptions. Each color has a capitalized name, a `value`, and a
35
+ `description`:
36
+
37
+ ```
38
+ Background:
39
+ value: "#0A0A0A"
40
+ description: Page background
41
+ Primary:
42
+ value: "#3B82F6"
43
+ description: Buttons, links, active states
44
+ Text:
45
+ value: "#F5F5F7"
46
+ description: Primary text
47
+ ```
48
+
49
+ ### Typography block format
50
+
51
+ A `` ```typography `` fenced block declares fonts (with source URLs) and
52
+ named type styles:
53
+
54
+ ```
55
+ fonts:
56
+ Cabinet Grotesk:
57
+ src: https://fonts.googleapis.com/css2?family=Cabinet+Grotesk:wght@400;600;700
58
+
59
+ styles:
60
+ Heading:
61
+ font: Cabinet Grotesk
62
+ size: 28px
63
+ weight: 600
64
+ letterSpacing: -0.02em
65
+ lineHeight: 1.2
66
+ description: Section headings, page titles
67
+ Body:
68
+ font: Cabinet Grotesk
69
+ size: 16px
70
+ weight: 400
71
+ lineHeight: 1.5
72
+ description: Default paragraph text
73
+ ```
74
+
26
75
  ## Be Distinctive
27
76
 
28
77
  AI-generated interfaces tend to converge on the same generic look: safe
package/dist/headless.js CHANGED
@@ -347,17 +347,24 @@ The current date is ${now}.
347
347
  {{compiled/msfm.md}}
348
348
  </mindstudio_flavored_markdown_spec_docs>
349
349
 
350
- ${isLspConfigured() ? `<typescript_lsp>
351
- {{static/lsp.md}}
352
- </typescript_lsp>` : ""}
353
-
354
350
  <project_context>
355
351
  ${projectContext}
356
352
  </project_context>
357
353
 
354
+ <intake_mode_instructions>
358
355
  {{static/intake.md}}
356
+ </intake_mode_instructions>
359
357
 
358
+ <spec_authoring_instructions>
360
359
  {{static/authoring.md}}
360
+ </spec_authoring_instructions>
361
+
362
+ <code_authoring_instructions>
363
+ {{static/coding.md}}
364
+ ${isLspConfigured() ? `<typescript_lsp>
365
+ {{static/lsp.md}}
366
+ </typescript_lsp>` : ""}
367
+ </code_authoring_instructions>
361
368
 
362
369
  {{static/instructions.md}}
363
370
 
@@ -1252,22 +1259,24 @@ var writeFileTool = {
1252
1259
  }
1253
1260
  },
1254
1261
  streaming: /* @__PURE__ */ (() => {
1255
- let lastLineCount = 0;
1262
+ let lastNewlineCount = 0;
1256
1263
  let lastPath = "";
1257
1264
  return {
1258
1265
  transform: async (partial) => {
1259
- if (partial.path !== lastPath) {
1260
- lastLineCount = 0;
1266
+ const newlineCount = partial.content.split("\n").length - 1;
1267
+ if (partial.path !== lastPath || newlineCount < lastNewlineCount) {
1268
+ lastNewlineCount = 0;
1261
1269
  lastPath = partial.path;
1262
1270
  }
1263
- const lines = partial.content.split("\n");
1264
- if (lines.length <= lastLineCount) {
1271
+ if (newlineCount <= lastNewlineCount) {
1265
1272
  return null;
1266
1273
  }
1267
- lastLineCount = lines.length;
1274
+ lastNewlineCount = newlineCount;
1275
+ const lastNewline = partial.content.lastIndexOf("\n");
1276
+ const completeContent = partial.content.substring(0, lastNewline + 1);
1268
1277
  const oldContent = await fs10.readFile(partial.path, "utf-8").catch(() => "");
1269
- return `Writing ${partial.path} (${lines.length} lines)
1270
- ${unifiedDiff(partial.path, oldContent, partial.content)}`;
1278
+ return `Writing ${partial.path} (${newlineCount} lines)
1279
+ ${unifiedDiff(partial.path, oldContent, completeContent)}`;
1271
1280
  }
1272
1281
  };
1273
1282
  })(),
@@ -1772,7 +1781,7 @@ import { exec as exec3 } from "child_process";
1772
1781
  var askMindStudioSdkTool = {
1773
1782
  definition: {
1774
1783
  name: "askMindStudioSdk",
1775
- description: "Ask the MindStudio SDK assistant about actions, AI models, connectors, and integrations. Returns code examples with correct method signatures, model IDs, and config options. Use this instead of guessing SDK usage from memory. Describe what you need, not what API methods you need; the assistant will figure out the right approach. This runs its own LLM call so it has a few seconds of latency; batch related questions into a single query.",
1784
+ description: "Ask the MindStudio SDK assistant about available actions, AI models, connectors, and integrations using natural language. Returns code examples with correct method signatures, model IDs, and config options. Always use this to verify correct SDK usage, especially model IDs and configuration options. Describe what you need, not what API methods you need; the assistant will figure out the right approach. This runs its own LLM call so it has a few seconds of latency; batch multiple questions into a single query.",
1776
1785
  inputSchema: {
1777
1786
  type: "object",
1778
1787
  properties: {
package/dist/index.js CHANGED
@@ -1053,22 +1053,24 @@ var init_writeFile = __esm({
1053
1053
  }
1054
1054
  },
1055
1055
  streaming: /* @__PURE__ */ (() => {
1056
- let lastLineCount = 0;
1056
+ let lastNewlineCount = 0;
1057
1057
  let lastPath = "";
1058
1058
  return {
1059
1059
  transform: async (partial) => {
1060
- if (partial.path !== lastPath) {
1061
- lastLineCount = 0;
1060
+ const newlineCount = partial.content.split("\n").length - 1;
1061
+ if (partial.path !== lastPath || newlineCount < lastNewlineCount) {
1062
+ lastNewlineCount = 0;
1062
1063
  lastPath = partial.path;
1063
1064
  }
1064
- const lines = partial.content.split("\n");
1065
- if (lines.length <= lastLineCount) {
1065
+ if (newlineCount <= lastNewlineCount) {
1066
1066
  return null;
1067
1067
  }
1068
- lastLineCount = lines.length;
1068
+ lastNewlineCount = newlineCount;
1069
+ const lastNewline = partial.content.lastIndexOf("\n");
1070
+ const completeContent = partial.content.substring(0, lastNewline + 1);
1069
1071
  const oldContent = await fs7.readFile(partial.path, "utf-8").catch(() => "");
1070
- return `Writing ${partial.path} (${lines.length} lines)
1071
- ${unifiedDiff(partial.path, oldContent, partial.content)}`;
1072
+ return `Writing ${partial.path} (${newlineCount} lines)
1073
+ ${unifiedDiff(partial.path, oldContent, completeContent)}`;
1072
1074
  }
1073
1075
  };
1074
1076
  })(),
@@ -1676,7 +1678,7 @@ var init_askMindStudioSdk = __esm({
1676
1678
  askMindStudioSdkTool = {
1677
1679
  definition: {
1678
1680
  name: "askMindStudioSdk",
1679
- description: "Ask the MindStudio SDK assistant about actions, AI models, connectors, and integrations. Returns code examples with correct method signatures, model IDs, and config options. Use this instead of guessing SDK usage from memory. Describe what you need, not what API methods you need; the assistant will figure out the right approach. This runs its own LLM call so it has a few seconds of latency; batch related questions into a single query.",
1681
+ description: "Ask the MindStudio SDK assistant about available actions, AI models, connectors, and integrations using natural language. Returns code examples with correct method signatures, model IDs, and config options. Always use this to verify correct SDK usage, especially model IDs and configuration options. Describe what you need, not what API methods you need; the assistant will figure out the right approach. This runs its own LLM call so it has a few seconds of latency; batch multiple questions into a single query.",
1680
1682
  inputSchema: {
1681
1683
  type: "object",
1682
1684
  properties: {
@@ -2954,17 +2956,24 @@ The current date is ${now}.
2954
2956
  {{compiled/msfm.md}}
2955
2957
  </mindstudio_flavored_markdown_spec_docs>
2956
2958
 
2957
- ${isLspConfigured() ? `<typescript_lsp>
2958
- {{static/lsp.md}}
2959
- </typescript_lsp>` : ""}
2960
-
2961
2959
  <project_context>
2962
2960
  ${projectContext}
2963
2961
  </project_context>
2964
2962
 
2963
+ <intake_mode_instructions>
2965
2964
  {{static/intake.md}}
2965
+ </intake_mode_instructions>
2966
2966
 
2967
+ <spec_authoring_instructions>
2967
2968
  {{static/authoring.md}}
2969
+ </spec_authoring_instructions>
2970
+
2971
+ <code_authoring_instructions>
2972
+ {{static/coding.md}}
2973
+ ${isLspConfigured() ? `<typescript_lsp>
2974
+ {{static/lsp.md}}
2975
+ </typescript_lsp>` : ""}
2976
+ </code_authoring_instructions>
2968
2977
 
2969
2978
  {{static/instructions.md}}
2970
2979
 
@@ -0,0 +1,29 @@
1
+ ## Code Authoring
2
+
3
+ ### Code Style and Formatting
4
+ - Write code that is highly readable and easy to follow.
5
+ - Use inline comments to make code easy to scan and reason about.
6
+ - Write clean, modern, bug-free, and well-organized TypeScript.
7
+ - Match the scope of changes to what was asked. Solve the current problem with the minimum code required. A bug fix is just a bug fix, not an opportunity to refactor the surrounding code. A new feature is just that feature, not a reason to introduce abstractions for hypothetical future needs. Prefer repeating a few lines of straightforward code over creating a helper that's only used once.
8
+
9
+ ### Verification
10
+ After editing code, check your work with `lspDiagnostics` or by reading the file back. After a big build or significant changes, do a lightweight runtime check to catch the things static analysis misses (schema mismatches, missing imports, bad queries):
11
+
12
+ - Seed test data with `runScenario`, then spot-check the primary method or two with `runMethod`. The dev database is a disposable snapshot, so don't worry about being destructive.
13
+ - For frontend work, take a single `screenshot` to confirm the main view renders correctly or look at the browser log for any console errors in the user's preview.
14
+ - Use `runAutomatedBrowserTest` to verify an interactive flow that you can't confirm from a screenshot, or when the user reports something broken that you can't identify from code alone.
15
+
16
+ Aim for confidence that the core happy paths work. If the 80% case is solid, the remaining edge cases are likely fine and the user can surface them in chat. Don't screenshot every page, test every permutation, or verify every secondary flow. One or two runtime checks that confirm the app loads and data flows through is enough.
17
+
18
+ ### Process Logs
19
+ Process logs are available at `.logs/` for debugging:
20
+ - `.logs/tunnel.log`: method execution, schema sync, session lifecycle, platform connection
21
+ - `.logs/devServer.log`: frontend build errors, HMR, module resolution failures
22
+ - `.logs/requests.ndjson`: structured NDJSON log of every method and scenario execution with full input, output, errors (including stack traces), console output, and duration. Use `tail -5 .logs/requests.ndjson | jq .` or `grep '"success":false' .logs/requests.ndjson | jq .` to inspect.
23
+ - `.logs/browser.ndjson`: browser-side events captured from the web preview. Includes console output, uncaught JS errors with stack traces, failed network requests, and user interactions (clicks). Use `grep '"type":"error"' .logs/browser.ndjson | jq .` to find frontend errors.
24
+
25
+ ### MindStudio SDK usage
26
+ - For any work involving AI models (text, image, video, TTS, transcription, etc), external actions like web scraping, searching Google, sending emails or SMS, or third-party API/Oauth connections to social media services, SaaS platforms, and other services, always prefer to use the `@mindstudio-ai/agent` SDK as it removes the need to research API methods, configure keys, tokens, retries, or require the user to create developer accounts/setup billing (they have a unified billing account for all services through MindStudio platform).
27
+ - Always use `askMindStudioSdk` to look up model IDs, action signatures, and config options before writing any code that calls the SDK. Model IDs change frequently across providers and guessing will produce invalid values, even if the ID looks plausible.
28
+ - Always use `askMindStudioSdk` before writing a custom API connector to a third-party service. The tool will tell you if there is already a connector available, as well as whether or not the user has configured it to be ready fo use.
29
+ - Describe what you need in plain language and the assistant will return the correct method call with current parameters. You can including multiple requests in a single tool call.
@@ -1,25 +1,28 @@
1
1
  ## Workflow
2
2
  1. **Understand first.** Read relevant files and check project structure before making changes.
3
3
  2. **Make changes.** Use the right tool for the job — tool descriptions explain when to use each one.
4
- 3. **Verify.** After editing, check your work with lspDiagnostics or by reading the file back. After a big build or significant backend changes, verify at runtime: use `runScenario` to seed test data, then use `runMethod` to confirm things work. The dev database is a disposable snapshot, so don't worry about being destructive. This catches schema mismatches, missing imports, and bad queries that static checks won't find. For frontend work, you can use `screenshot` to visually check the result after significant layout changes. Use `runAutomatedBrowserTest` to smoke-test interactive flows after initial codegen, after major UI changes, or when the user reports something broken that you can't identify from code alone.
5
- 4. **Iterate.** If something fails, read the error, diagnose the root cause, and try a different approach. Process logs are available at `.logs/` for debugging:
6
- - `.logs/tunnel.log`: method execution, schema sync, session lifecycle, platform connection
7
- - `.logs/devServer.log`: frontend build errors, HMR, module resolution failures
8
- - `.logs/requests.ndjson`: structured NDJSON log of every method and scenario execution with full input, output, errors (including stack traces), console output, and duration. Use `tail -5 .logs/requests.ndjson | jq .` or `grep '"success":false' .logs/requests.ndjson | jq .` to inspect.
9
- - `.logs/browser.ndjson`: browser-side events captured from the web preview. Includes console output, uncaught JS errors with stack traces, failed network requests, and user interactions (clicks). Use `grep '"type":"error"' .logs/browser.ndjson | jq .` to find frontend errors.
4
+ 3. **Verify.** Check your work after making changes.
5
+ 4. **Iterate.** If something fails, read the error, diagnose the root cause, and try a different approach.
10
6
 
11
7
  ## Principles
12
- - The spec is the source of truth. When in doubt, consult the spec before making code changes. When behavior changes, update the spec first.
13
- - Change only what the task requires. Match existing code style. Keep solutions simple.
8
+ - The spec in `src/` is the source of truth. When in doubt, consult the spec before making code changes. When behavior changes, update the spec first.
9
+ - Change only what the task requires. Match existing styles. Keep solutions simple.
14
10
  - Read files before editing them. Understand the context before making changes.
15
11
  - When the user asks you to make a change, execute it fully — all steps, no pausing for confirmation. Use `confirmDestructiveAction` to gate before destructive or irreversible actions (e.g., deleting data, resetting the database). For large changes that touch many files or involve significant design decisions, use `presentPlan` to get user approval first — but only when the scope genuinely warrants it or the user asks to see a plan. Most work should be done autonomously.
12
+ - Work with what you already know. If you've read a file in this session, use what you learned rather than reading it again. If a subagent already researched something, use its findings. Every tool call costs time; prefer acting on information you have over re-gathering it.
16
13
  - After two failed attempts at the same approach, tell the user what's going wrong.
17
14
  - Pushing to main branch will trigger a deploy. Use git via bash when the user wants to deploy.
18
15
 
19
16
  ## Communication
20
- - Be direct and concise. The user can already see tool calls, so summarize outcomes, not steps.
21
- - Keep language accessible. Explain things in plain terms unless the user demonstrates technical fluency. Describe what the app *does*, not how it's implemented.
17
+ The user can already see your tool calls, so most of your work is visible without narration. Focus text output on three things:
18
+ - **Decisions that need input.** Questions, tradeoffs, ambiguity that blocks progress.
19
+ - **Milestones.** What you built, what it looks like, what changed. Summarize in plain language rather than listing a per-file changelog.
20
+ - **Errors or blockers.** Something failed or the approach needs to shift.
21
+
22
+ Skip the rest: narrating what you're about to do, restating what the user asked, explaining tool calls they can already see.
23
+
24
+ Style:
25
+ - Keep language accessible. Describe what the app *does*, not how it's implemented, unless the user demonstrates technical fluency.
22
26
  - Always use full paths relative to the project root when mentioning files (`dist/interfaces/web/src/App.tsx`, not `App.tsx`). Paths will be rendered as clickable links for the user.
23
- - When summarizing changes, describe what you did in plain language rather than listing a per-file changelog.
24
27
  - Use inline `code` formatting only for things the user needs to type or search for.
25
- - Do not use emojis. Avoid em dashes in prose; use periods, commas, colons, or parentheses instead.
28
+ - Avoid em dashes in prose; use periods, commas, colons, or parentheses instead. No emojis.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mindstudio-ai/remy",
3
- "version": "0.1.6",
3
+ "version": "0.1.8",
4
4
  "description": "MindStudio coding agent",
5
5
  "repository": {
6
6
  "type": "git",