@runtypelabs/sdk 1.9.1 → 1.9.2
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/index.cjs +55 -44
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +24 -0
- package/dist/index.d.ts +24 -0
- package/dist/index.js +55 -44
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -2856,6 +2856,57 @@ var executionPhase = {
|
|
|
2856
2856
|
};
|
|
2857
2857
|
function classifyVariant(message) {
|
|
2858
2858
|
const lower = message.toLowerCase();
|
|
2859
|
+
const modificationVerbs = [
|
|
2860
|
+
"fix",
|
|
2861
|
+
"update",
|
|
2862
|
+
"change",
|
|
2863
|
+
"modify",
|
|
2864
|
+
"edit",
|
|
2865
|
+
"refactor",
|
|
2866
|
+
"improve",
|
|
2867
|
+
"add to",
|
|
2868
|
+
"remove",
|
|
2869
|
+
"delete",
|
|
2870
|
+
"rename",
|
|
2871
|
+
"migrate"
|
|
2872
|
+
];
|
|
2873
|
+
const hasModificationVerb = modificationVerbs.some(
|
|
2874
|
+
(v) => lower.startsWith(v) || new RegExp(`\\b${v}\\b`).test(lower)
|
|
2875
|
+
);
|
|
2876
|
+
const creationPatterns = [
|
|
2877
|
+
/^create\b/,
|
|
2878
|
+
/^build\b/,
|
|
2879
|
+
/^make\b/,
|
|
2880
|
+
/^generate\b/,
|
|
2881
|
+
/^scaffold\b/,
|
|
2882
|
+
/^set up\b/,
|
|
2883
|
+
/^setup\b/,
|
|
2884
|
+
/^bootstrap\b/,
|
|
2885
|
+
/^initialize\b/,
|
|
2886
|
+
/^init\b/,
|
|
2887
|
+
/^write a\b/,
|
|
2888
|
+
/^write an\b/,
|
|
2889
|
+
/^implement a\b/,
|
|
2890
|
+
/^implement an\b/,
|
|
2891
|
+
/^start a\b/,
|
|
2892
|
+
/^start an\b/,
|
|
2893
|
+
/^new\b/
|
|
2894
|
+
];
|
|
2895
|
+
const hasCreationStart = creationPatterns.some((p) => p.test(lower));
|
|
2896
|
+
const creationVerbs = [
|
|
2897
|
+
"build",
|
|
2898
|
+
"create",
|
|
2899
|
+
"make",
|
|
2900
|
+
"generate",
|
|
2901
|
+
"scaffold",
|
|
2902
|
+
"implement"
|
|
2903
|
+
];
|
|
2904
|
+
const hasCreationVerb = creationVerbs.some(
|
|
2905
|
+
(v) => new RegExp(`\\b${v}\\b`).test(lower)
|
|
2906
|
+
);
|
|
2907
|
+
if ((hasCreationStart || hasCreationVerb) && !hasModificationVerb) {
|
|
2908
|
+
return "create";
|
|
2909
|
+
}
|
|
2859
2910
|
const externalVerbs = [
|
|
2860
2911
|
"fetch",
|
|
2861
2912
|
"browse",
|
|
@@ -2895,49 +2946,9 @@ function classifyVariant(message) {
|
|
|
2895
2946
|
];
|
|
2896
2947
|
const hasExternalVerb = externalVerbs.some((v) => lower.includes(v));
|
|
2897
2948
|
const hasExternalTarget = externalTargets.some((t) => lower.includes(t));
|
|
2898
|
-
const modificationVerbs = [
|
|
2899
|
-
"fix",
|
|
2900
|
-
"update",
|
|
2901
|
-
"change",
|
|
2902
|
-
"modify",
|
|
2903
|
-
"edit",
|
|
2904
|
-
"refactor",
|
|
2905
|
-
"improve",
|
|
2906
|
-
"add to",
|
|
2907
|
-
"remove",
|
|
2908
|
-
"delete",
|
|
2909
|
-
"rename",
|
|
2910
|
-
"migrate"
|
|
2911
|
-
];
|
|
2912
|
-
const hasModificationVerb = modificationVerbs.some(
|
|
2913
|
-
(v) => lower.startsWith(v) || new RegExp(`\\b${v}\\b`).test(lower)
|
|
2914
|
-
);
|
|
2915
2949
|
if (hasExternalVerb && hasExternalTarget && !hasModificationVerb) {
|
|
2916
2950
|
return "external";
|
|
2917
2951
|
}
|
|
2918
|
-
const creationPatterns = [
|
|
2919
|
-
/^create\b/,
|
|
2920
|
-
/^build\b/,
|
|
2921
|
-
/^make\b/,
|
|
2922
|
-
/^generate\b/,
|
|
2923
|
-
/^scaffold\b/,
|
|
2924
|
-
/^set up\b/,
|
|
2925
|
-
/^setup\b/,
|
|
2926
|
-
/^bootstrap\b/,
|
|
2927
|
-
/^initialize\b/,
|
|
2928
|
-
/^init\b/,
|
|
2929
|
-
/^write a\b/,
|
|
2930
|
-
/^write an\b/,
|
|
2931
|
-
/^implement a\b/,
|
|
2932
|
-
/^implement an\b/,
|
|
2933
|
-
/^start a\b/,
|
|
2934
|
-
/^start an\b/,
|
|
2935
|
-
/^new\b/
|
|
2936
|
-
];
|
|
2937
|
-
const hasCreationStart = creationPatterns.some((p) => p.test(lower));
|
|
2938
|
-
if (hasCreationStart && !hasModificationVerb) {
|
|
2939
|
-
return "create";
|
|
2940
|
-
}
|
|
2941
2952
|
return "modify";
|
|
2942
2953
|
}
|
|
2943
2954
|
async function generateBootstrapContext(message, localTools, variant) {
|
|
@@ -5755,6 +5766,7 @@ var _AgentsEndpoint = class _AgentsEndpoint {
|
|
|
5755
5766
|
messages,
|
|
5756
5767
|
debugMode: options.debugMode,
|
|
5757
5768
|
model: options.model,
|
|
5769
|
+
...options.reasoning !== void 0 ? { reasoning: options.reasoning } : {},
|
|
5758
5770
|
...options.toolIds?.length ? { tools: { toolIds: options.toolIds } } : {},
|
|
5759
5771
|
...requestContextManagement ? { contextManagement: requestContextManagement } : {}
|
|
5760
5772
|
};
|
|
@@ -6471,9 +6483,12 @@ Do NOT redo any of the above work.`
|
|
|
6471
6483
|
const replayHistoryMessages = this.sanitizeReplayHistoryMessages(
|
|
6472
6484
|
continuationContext.previousMessages
|
|
6473
6485
|
);
|
|
6486
|
+
const continuationGuardrail = "IMPORTANT: You are continuing a previously completed task. The conversation above shows your prior work. Do NOT redo any of it. Build on what was already accomplished. If there is nothing new to do, respond with TASK_COMPLETE.";
|
|
6474
6487
|
const defaultContinueMessage = "Continue the task. Review your prior work above and proceed with any remaining work. If everything is already complete, respond with TASK_COMPLETE.";
|
|
6475
6488
|
const userMessage = continuationContext.newUserMessage || defaultContinueMessage;
|
|
6476
6489
|
const userContent = [
|
|
6490
|
+
continuationGuardrail,
|
|
6491
|
+
"",
|
|
6477
6492
|
userMessage,
|
|
6478
6493
|
phaseBlock,
|
|
6479
6494
|
toolsBlock,
|
|
@@ -6484,10 +6499,6 @@ Do NOT redo any of the above work.`
|
|
|
6484
6499
|
].join("\n");
|
|
6485
6500
|
const fullHistoryMessages = [
|
|
6486
6501
|
...replayHistoryMessages,
|
|
6487
|
-
{
|
|
6488
|
-
role: "system",
|
|
6489
|
-
content: "IMPORTANT: You are continuing a previously completed task. The conversation above shows your prior work. Do NOT redo any of it. Build on what was already accomplished. If there is nothing new to do, respond with TASK_COMPLETE."
|
|
6490
|
-
},
|
|
6491
6502
|
{
|
|
6492
6503
|
role: "user",
|
|
6493
6504
|
content: userContent
|