@mindstudio-ai/remy 0.1.161 → 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 +22 -7
- package/dist/index.js +22 -7
- package/package.json +1 -1
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.
|
|
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"
|
|
2947
|
-
|
|
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;
|
|
@@ -5725,7 +5732,11 @@ var patterns = [
|
|
|
5725
5732
|
/HTTP 5\d\d/i,
|
|
5726
5733
|
"The AI service is temporarily unavailable. Please try again."
|
|
5727
5734
|
],
|
|
5728
|
-
[/Stream stalled/i, "The connection was interrupted. Please try again."]
|
|
5735
|
+
[/Stream stalled/i, "The connection was interrupted. Please try again."],
|
|
5736
|
+
[
|
|
5737
|
+
/content filter|Output blocked/i,
|
|
5738
|
+
"The AI model's content moderation filter blocked this response. These are usually false positives, we apologize for the interruption. Rephrasing your request typically fixes this."
|
|
5739
|
+
]
|
|
5729
5740
|
];
|
|
5730
5741
|
function friendlyError(raw) {
|
|
5731
5742
|
for (const [pattern, message] of patterns) {
|
|
@@ -5771,6 +5782,7 @@ async function runTurn(params) {
|
|
|
5771
5782
|
state,
|
|
5772
5783
|
userMessage,
|
|
5773
5784
|
attachments,
|
|
5785
|
+
attachmentHeader,
|
|
5774
5786
|
apiConfig,
|
|
5775
5787
|
system,
|
|
5776
5788
|
model,
|
|
@@ -5807,6 +5819,9 @@ async function runTurn(params) {
|
|
|
5807
5819
|
if (hasAttachments) {
|
|
5808
5820
|
userMsg.attachments = attachments;
|
|
5809
5821
|
}
|
|
5822
|
+
if (attachmentHeader) {
|
|
5823
|
+
userMsg.attachmentHeader = attachmentHeader;
|
|
5824
|
+
}
|
|
5810
5825
|
state.messages.push(userMsg);
|
|
5811
5826
|
onEvent({
|
|
5812
5827
|
type: "user_message",
|
|
@@ -7008,15 +7023,14 @@ var HeadlessSession = class {
|
|
|
7008
7023
|
});
|
|
7009
7024
|
}
|
|
7010
7025
|
let userMessage = parsed.text ?? "";
|
|
7026
|
+
let attachmentHeader;
|
|
7011
7027
|
if (attachments?.some((a) => !a.isVoice)) {
|
|
7012
7028
|
try {
|
|
7013
7029
|
const { documents, images } = await persistAttachments(attachments);
|
|
7014
7030
|
const all = [...documents, ...images];
|
|
7015
7031
|
const header = buildUploadHeader(all);
|
|
7016
7032
|
if (header) {
|
|
7017
|
-
|
|
7018
|
-
|
|
7019
|
-
${userMessage}` : header;
|
|
7033
|
+
attachmentHeader = header;
|
|
7020
7034
|
}
|
|
7021
7035
|
} catch (err) {
|
|
7022
7036
|
log14.warn("Attachment persistence failed", { error: err.message });
|
|
@@ -7059,6 +7073,7 @@ ${userMessage}` : header;
|
|
|
7059
7073
|
state: this.state,
|
|
7060
7074
|
userMessage,
|
|
7061
7075
|
attachments,
|
|
7076
|
+
attachmentHeader,
|
|
7062
7077
|
apiConfig: this.config,
|
|
7063
7078
|
system,
|
|
7064
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.
|
|
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"
|
|
3242
|
-
|
|
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;
|
|
@@ -6056,7 +6063,11 @@ var init_errors = __esm({
|
|
|
6056
6063
|
/HTTP 5\d\d/i,
|
|
6057
6064
|
"The AI service is temporarily unavailable. Please try again."
|
|
6058
6065
|
],
|
|
6059
|
-
[/Stream stalled/i, "The connection was interrupted. Please try again."]
|
|
6066
|
+
[/Stream stalled/i, "The connection was interrupted. Please try again."],
|
|
6067
|
+
[
|
|
6068
|
+
/content filter|Output blocked/i,
|
|
6069
|
+
"The AI model's content moderation filter blocked this response. These are usually false positives, we apologize for the interruption. Rephrasing your request typically fixes this."
|
|
6070
|
+
]
|
|
6060
6071
|
];
|
|
6061
6072
|
}
|
|
6062
6073
|
});
|
|
@@ -6370,6 +6381,7 @@ async function runTurn(params) {
|
|
|
6370
6381
|
state,
|
|
6371
6382
|
userMessage,
|
|
6372
6383
|
attachments,
|
|
6384
|
+
attachmentHeader,
|
|
6373
6385
|
apiConfig,
|
|
6374
6386
|
system,
|
|
6375
6387
|
model,
|
|
@@ -6406,6 +6418,9 @@ async function runTurn(params) {
|
|
|
6406
6418
|
if (hasAttachments) {
|
|
6407
6419
|
userMsg.attachments = attachments;
|
|
6408
6420
|
}
|
|
6421
|
+
if (attachmentHeader) {
|
|
6422
|
+
userMsg.attachmentHeader = attachmentHeader;
|
|
6423
|
+
}
|
|
6409
6424
|
state.messages.push(userMsg);
|
|
6410
6425
|
onEvent({
|
|
6411
6426
|
type: "user_message",
|
|
@@ -7760,15 +7775,14 @@ var init_headless = __esm({
|
|
|
7760
7775
|
});
|
|
7761
7776
|
}
|
|
7762
7777
|
let userMessage = parsed.text ?? "";
|
|
7778
|
+
let attachmentHeader;
|
|
7763
7779
|
if (attachments?.some((a) => !a.isVoice)) {
|
|
7764
7780
|
try {
|
|
7765
7781
|
const { documents, images } = await persistAttachments(attachments);
|
|
7766
7782
|
const all = [...documents, ...images];
|
|
7767
7783
|
const header = buildUploadHeader(all);
|
|
7768
7784
|
if (header) {
|
|
7769
|
-
|
|
7770
|
-
|
|
7771
|
-
${userMessage}` : header;
|
|
7785
|
+
attachmentHeader = header;
|
|
7772
7786
|
}
|
|
7773
7787
|
} catch (err) {
|
|
7774
7788
|
log14.warn("Attachment persistence failed", { error: err.message });
|
|
@@ -7811,6 +7825,7 @@ ${userMessage}` : header;
|
|
|
7811
7825
|
state: this.state,
|
|
7812
7826
|
userMessage,
|
|
7813
7827
|
attachments,
|
|
7828
|
+
attachmentHeader,
|
|
7814
7829
|
apiConfig: this.config,
|
|
7815
7830
|
system,
|
|
7816
7831
|
model: this.opts.model,
|