@mindstudio-ai/remy 0.1.162 → 0.1.163

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
@@ -1395,7 +1395,7 @@ var setProjectOnboardingStateTool = {
1395
1395
  clearable: false,
1396
1396
  definition: {
1397
1397
  name: "setProjectOnboardingState",
1398
- description: "Advance the project onboarding state. Only call this when an automated action explicitly instructs you to \u2014 calling it at the wrong time skips stages the user hasn't experienced. Forward-only: building \u2192 buildComplete \u2192 onboardingFinished. `onboardingFinished` is set by the frontend after the user dismisses the reveal; do not call it yourself.",
1398
+ description: "Advance the project onboarding state. Forward-only: building \u2192 buildComplete \u2192 onboardingFinished. Normally driven by automated actions \u2014 don't call this out of order during a normal build, or you'll skip stages the user hasn't experienced. Exception: if the project has been in `building` for a while, the build is clearly done (the user is iterating on a working app, deploying, etc.), and the user reports the editor seems stuck \u2014 disabled Preview/Spec/Code tabs, no reveal, etc. \u2014 call `setProjectOnboardingState({ state: 'buildComplete' })` to unstick them. `onboardingFinished` is always set by the frontend after the user dismisses the reveal; never call it yourself.",
1399
1399
  inputSchema: {
1400
1400
  type: "object",
1401
1401
  properties: {
@@ -2943,8 +2943,15 @@ ${summaryBlock.text}
2943
2943
  }
2944
2944
  return true;
2945
2945
  }).map((msg) => {
2946
- if (msg.role === "user" && typeof msg.content === "string" && isAutomatedMessage(msg.content)) {
2947
- return { ...msg, content: stripSentinelLine(msg.content) };
2946
+ if (msg.role === "user" && typeof msg.content === "string") {
2947
+ const { attachmentHeader, ...rest } = msg;
2948
+ let content = isAutomatedMessage(msg.content) ? stripSentinelLine(msg.content) : msg.content;
2949
+ if (attachmentHeader) {
2950
+ content = content ? `${attachmentHeader}
2951
+
2952
+ ${content}` : attachmentHeader;
2953
+ }
2954
+ return { ...rest, content };
2948
2955
  }
2949
2956
  if (!Array.isArray(msg.content)) {
2950
2957
  return msg;
@@ -5775,6 +5782,7 @@ async function runTurn(params) {
5775
5782
  state,
5776
5783
  userMessage,
5777
5784
  attachments,
5785
+ attachmentHeader,
5778
5786
  apiConfig,
5779
5787
  system,
5780
5788
  model,
@@ -5811,6 +5819,9 @@ async function runTurn(params) {
5811
5819
  if (hasAttachments) {
5812
5820
  userMsg.attachments = attachments;
5813
5821
  }
5822
+ if (attachmentHeader) {
5823
+ userMsg.attachmentHeader = attachmentHeader;
5824
+ }
5814
5825
  state.messages.push(userMsg);
5815
5826
  onEvent({
5816
5827
  type: "user_message",
@@ -7012,15 +7023,14 @@ var HeadlessSession = class {
7012
7023
  });
7013
7024
  }
7014
7025
  let userMessage = parsed.text ?? "";
7026
+ let attachmentHeader;
7015
7027
  if (attachments?.some((a) => !a.isVoice)) {
7016
7028
  try {
7017
7029
  const { documents, images } = await persistAttachments(attachments);
7018
7030
  const all = [...documents, ...images];
7019
7031
  const header = buildUploadHeader(all);
7020
7032
  if (header) {
7021
- userMessage = userMessage ? `${header}
7022
-
7023
- ${userMessage}` : header;
7033
+ attachmentHeader = header;
7024
7034
  }
7025
7035
  } catch (err) {
7026
7036
  log14.warn("Attachment persistence failed", { error: err.message });
@@ -7063,6 +7073,7 @@ ${userMessage}` : header;
7063
7073
  state: this.state,
7064
7074
  userMessage,
7065
7075
  attachments,
7076
+ attachmentHeader,
7066
7077
  apiConfig: this.config,
7067
7078
  system,
7068
7079
  model: this.opts.model,
package/dist/index.js CHANGED
@@ -919,7 +919,7 @@ var init_setProjectOnboardingState = __esm({
919
919
  clearable: false,
920
920
  definition: {
921
921
  name: "setProjectOnboardingState",
922
- description: "Advance the project onboarding state. Only call this when an automated action explicitly instructs you to \u2014 calling it at the wrong time skips stages the user hasn't experienced. Forward-only: building \u2192 buildComplete \u2192 onboardingFinished. `onboardingFinished` is set by the frontend after the user dismisses the reveal; do not call it yourself.",
922
+ description: "Advance the project onboarding state. Forward-only: building \u2192 buildComplete \u2192 onboardingFinished. Normally driven by automated actions \u2014 don't call this out of order during a normal build, or you'll skip stages the user hasn't experienced. Exception: if the project has been in `building` for a while, the build is clearly done (the user is iterating on a working app, deploying, etc.), and the user reports the editor seems stuck \u2014 disabled Preview/Spec/Code tabs, no reveal, etc. \u2014 call `setProjectOnboardingState({ state: 'buildComplete' })` to unstick them. `onboardingFinished` is always set by the frontend after the user dismisses the reveal; never call it yourself.",
923
923
  inputSchema: {
924
924
  type: "object",
925
925
  properties: {
@@ -3238,8 +3238,15 @@ ${summaryBlock.text}
3238
3238
  }
3239
3239
  return true;
3240
3240
  }).map((msg) => {
3241
- if (msg.role === "user" && typeof msg.content === "string" && isAutomatedMessage(msg.content)) {
3242
- return { ...msg, content: stripSentinelLine(msg.content) };
3241
+ if (msg.role === "user" && typeof msg.content === "string") {
3242
+ const { attachmentHeader, ...rest } = msg;
3243
+ let content = isAutomatedMessage(msg.content) ? stripSentinelLine(msg.content) : msg.content;
3244
+ if (attachmentHeader) {
3245
+ content = content ? `${attachmentHeader}
3246
+
3247
+ ${content}` : attachmentHeader;
3248
+ }
3249
+ return { ...rest, content };
3243
3250
  }
3244
3251
  if (!Array.isArray(msg.content)) {
3245
3252
  return msg;
@@ -6374,6 +6381,7 @@ async function runTurn(params) {
6374
6381
  state,
6375
6382
  userMessage,
6376
6383
  attachments,
6384
+ attachmentHeader,
6377
6385
  apiConfig,
6378
6386
  system,
6379
6387
  model,
@@ -6410,6 +6418,9 @@ async function runTurn(params) {
6410
6418
  if (hasAttachments) {
6411
6419
  userMsg.attachments = attachments;
6412
6420
  }
6421
+ if (attachmentHeader) {
6422
+ userMsg.attachmentHeader = attachmentHeader;
6423
+ }
6413
6424
  state.messages.push(userMsg);
6414
6425
  onEvent({
6415
6426
  type: "user_message",
@@ -7764,15 +7775,14 @@ var init_headless = __esm({
7764
7775
  });
7765
7776
  }
7766
7777
  let userMessage = parsed.text ?? "";
7778
+ let attachmentHeader;
7767
7779
  if (attachments?.some((a) => !a.isVoice)) {
7768
7780
  try {
7769
7781
  const { documents, images } = await persistAttachments(attachments);
7770
7782
  const all = [...documents, ...images];
7771
7783
  const header = buildUploadHeader(all);
7772
7784
  if (header) {
7773
- userMessage = userMessage ? `${header}
7774
-
7775
- ${userMessage}` : header;
7785
+ attachmentHeader = header;
7776
7786
  }
7777
7787
  } catch (err) {
7778
7788
  log14.warn("Attachment persistence failed", { error: err.message });
@@ -7815,6 +7825,7 @@ ${userMessage}` : header;
7815
7825
  state: this.state,
7816
7826
  userMessage,
7817
7827
  attachments,
7828
+ attachmentHeader,
7818
7829
  apiConfig: this.config,
7819
7830
  system,
7820
7831
  model: this.opts.model,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mindstudio-ai/remy",
3
- "version": "0.1.162",
3
+ "version": "0.1.163",
4
4
  "description": "MindStudio coding agent",
5
5
  "repository": {
6
6
  "type": "git",