@mindstudio-ai/remy 0.1.43 → 0.1.44

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/headless.js CHANGED
@@ -2225,7 +2225,7 @@ function startStatusWatcher(config) {
2225
2225
  inflight = true;
2226
2226
  try {
2227
2227
  const ctx = getContext();
2228
- if (!ctx.assistantText && !ctx.lastToolName) {
2228
+ if (!ctx.assistantText && !ctx.lastToolName && !ctx.userMessage) {
2229
2229
  return;
2230
2230
  }
2231
2231
  const res = await fetch(url, {
@@ -2368,7 +2368,8 @@ ${partial}` : "[INTERRUPTED] Agent was interrupted before producing output.",
2368
2368
  getContext: () => ({
2369
2369
  assistantText: getPartialText(contentBlocks),
2370
2370
  lastToolName: currentToolNames || void 0,
2371
- lastToolResult: lastToolResult || void 0
2371
+ lastToolResult: lastToolResult || void 0,
2372
+ userMessage: task
2372
2373
  }),
2373
2374
  onStatus: (label) => emit2({ type: "status", message: label }),
2374
2375
  signal
@@ -2597,14 +2598,30 @@ Current date/time: ${(/* @__PURE__ */ new Date()).toISOString().replace("T", " "
2597
2598
  return wrapRun();
2598
2599
  }
2599
2600
  log4.info("Sub-agent backgrounded", { requestId, parentToolId, agentName });
2601
+ toolRegistry?.register({
2602
+ id: parentToolId,
2603
+ name: agentName,
2604
+ input: { task },
2605
+ abortController: bgAbort,
2606
+ startedAt: Date.now(),
2607
+ settle: () => {
2608
+ },
2609
+ rerun: () => {
2610
+ },
2611
+ getPartialResult: () => ""
2612
+ });
2600
2613
  const ack = await generateBackgroundAck({
2601
2614
  apiConfig,
2602
2615
  agentName: subAgentId || "agent",
2603
2616
  task
2604
2617
  });
2605
- wrapRun().then((finalResult) => onBackgroundComplete?.(finalResult)).catch(
2606
- (err) => onBackgroundComplete?.({ text: `Error: ${err.message}`, messages: [] })
2607
- );
2618
+ wrapRun().then((finalResult) => {
2619
+ toolRegistry?.unregister(parentToolId);
2620
+ onBackgroundComplete?.(finalResult);
2621
+ }).catch((err) => {
2622
+ toolRegistry?.unregister(parentToolId);
2623
+ onBackgroundComplete?.({ text: `Error: ${err.message}`, messages: [] });
2624
+ });
2608
2625
  return { text: ack, messages: [], backgrounded: true };
2609
2626
  }
2610
2627
 
@@ -3053,15 +3070,18 @@ async function enhanceImagePrompt(params) {
3053
3070
  "Transparent background: yes \u2014 the background will be removed. Focus on the subject as an isolated element."
3054
3071
  );
3055
3072
  }
3056
- const message = `<context>
3073
+ const context = `<context>
3057
3074
  ${contextParts.join("\n")}
3058
- </context>
3075
+ </context>`;
3076
+ const message = `${SYSTEM_PROMPT}
3077
+
3078
+ ${context}
3059
3079
 
3060
3080
  <brief>
3061
3081
  ${brief}
3062
3082
  </brief>`;
3063
3083
  const enhanced = await runCli(
3064
- `mindstudio generate-text --prompt ${JSON.stringify(SYSTEM_PROMPT)} --message ${JSON.stringify(message)} --output-key enhanced --no-meta`,
3084
+ `mindstudio generate-text --message ${JSON.stringify(message)} --output-key content --no-meta`,
3065
3085
  { timeout: 6e4, onLog }
3066
3086
  );
3067
3087
  return enhanced.trim();
@@ -4738,7 +4758,9 @@ async function runTurn(params) {
4738
4758
  toolRegistry?.register(entry);
4739
4759
  run(tc.input);
4740
4760
  const r = await resultPromise;
4741
- toolRegistry?.unregister(tc.id);
4761
+ if (!tc.input.background) {
4762
+ toolRegistry?.unregister(tc.id);
4763
+ }
4742
4764
  log7.info("Tool completed", {
4743
4765
  requestId,
4744
4766
  toolCallId: tc.id,
package/dist/index.js CHANGED
@@ -2163,7 +2163,7 @@ function startStatusWatcher(config) {
2163
2163
  inflight = true;
2164
2164
  try {
2165
2165
  const ctx = getContext();
2166
- if (!ctx.assistantText && !ctx.lastToolName) {
2166
+ if (!ctx.assistantText && !ctx.lastToolName && !ctx.userMessage) {
2167
2167
  return;
2168
2168
  }
2169
2169
  const res = await fetch(url, {
@@ -2315,7 +2315,8 @@ ${partial}` : "[INTERRUPTED] Agent was interrupted before producing output.",
2315
2315
  getContext: () => ({
2316
2316
  assistantText: getPartialText(contentBlocks),
2317
2317
  lastToolName: currentToolNames || void 0,
2318
- lastToolResult: lastToolResult || void 0
2318
+ lastToolResult: lastToolResult || void 0,
2319
+ userMessage: task
2319
2320
  }),
2320
2321
  onStatus: (label) => emit2({ type: "status", message: label }),
2321
2322
  signal
@@ -2544,14 +2545,30 @@ Current date/time: ${(/* @__PURE__ */ new Date()).toISOString().replace("T", " "
2544
2545
  return wrapRun();
2545
2546
  }
2546
2547
  log3.info("Sub-agent backgrounded", { requestId, parentToolId, agentName });
2548
+ toolRegistry?.register({
2549
+ id: parentToolId,
2550
+ name: agentName,
2551
+ input: { task },
2552
+ abortController: bgAbort,
2553
+ startedAt: Date.now(),
2554
+ settle: () => {
2555
+ },
2556
+ rerun: () => {
2557
+ },
2558
+ getPartialResult: () => ""
2559
+ });
2547
2560
  const ack = await generateBackgroundAck({
2548
2561
  apiConfig,
2549
2562
  agentName: subAgentId || "agent",
2550
2563
  task
2551
2564
  });
2552
- wrapRun().then((finalResult) => onBackgroundComplete?.(finalResult)).catch(
2553
- (err) => onBackgroundComplete?.({ text: `Error: ${err.message}`, messages: [] })
2554
- );
2565
+ wrapRun().then((finalResult) => {
2566
+ toolRegistry?.unregister(parentToolId);
2567
+ onBackgroundComplete?.(finalResult);
2568
+ }).catch((err) => {
2569
+ toolRegistry?.unregister(parentToolId);
2570
+ onBackgroundComplete?.({ text: `Error: ${err.message}`, messages: [] });
2571
+ });
2555
2572
  return { text: ack, messages: [], backgrounded: true };
2556
2573
  }
2557
2574
  var log3;
@@ -3106,15 +3123,18 @@ async function enhanceImagePrompt(params) {
3106
3123
  "Transparent background: yes \u2014 the background will be removed. Focus on the subject as an isolated element."
3107
3124
  );
3108
3125
  }
3109
- const message = `<context>
3126
+ const context = `<context>
3110
3127
  ${contextParts.join("\n")}
3111
- </context>
3128
+ </context>`;
3129
+ const message = `${SYSTEM_PROMPT}
3130
+
3131
+ ${context}
3112
3132
 
3113
3133
  <brief>
3114
3134
  ${brief}
3115
3135
  </brief>`;
3116
3136
  const enhanced = await runCli(
3117
- `mindstudio generate-text --prompt ${JSON.stringify(SYSTEM_PROMPT)} --message ${JSON.stringify(message)} --output-key enhanced --no-meta`,
3137
+ `mindstudio generate-text --message ${JSON.stringify(message)} --output-key content --no-meta`,
3118
3138
  { timeout: 6e4, onLog }
3119
3139
  );
3120
3140
  return enhanced.trim();
@@ -4980,7 +5000,9 @@ async function runTurn(params) {
4980
5000
  toolRegistry?.register(entry);
4981
5001
  run(tc.input);
4982
5002
  const r = await resultPromise;
4983
- toolRegistry?.unregister(tc.id);
5003
+ if (!tc.input.background) {
5004
+ toolRegistry?.unregister(tc.id);
5005
+ }
4984
5006
  log6.info("Tool completed", {
4985
5007
  requestId,
4986
5008
  toolCallId: tc.id,
@@ -59,6 +59,8 @@ When you receive background results:
59
59
 
60
60
  #### When to Background
61
61
 
62
- Only background the following tasks, unless the user specifically asks you to do work in the background:
62
+ You can only background the following two tasks, unless the user specifically asks you to do work in the background:
63
63
  - `productVision` seeding the intiial roadmap after writing the spec for the first time. This task takes a while and we can allow the user to continue building while it happens in the background
64
64
  - After writing the spec, once you have finalized the shape of the app, ask `visualDesignExpert` to create an "iphone app store" style icon for the app, then set it with `setProjectMetadata({ iconUrl: ... })`
65
+
66
+ Do not background any other tasks.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mindstudio-ai/remy",
3
- "version": "0.1.43",
3
+ "version": "0.1.44",
4
4
  "description": "MindStudio coding agent",
5
5
  "repository": {
6
6
  "type": "git",