@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.d.cts
CHANGED
|
@@ -3982,6 +3982,26 @@ interface AgentToolInputDeltaEvent extends BaseAgentEvent {
|
|
|
3982
3982
|
toolCallId: string;
|
|
3983
3983
|
delta: string;
|
|
3984
3984
|
}
|
|
3985
|
+
/**
|
|
3986
|
+
* Agent tool input delta event — streamed input fragment
|
|
3987
|
+
*/
|
|
3988
|
+
interface AgentToolInputDeltaEvent extends BaseAgentEvent {
|
|
3989
|
+
type: 'agent_tool_input_delta';
|
|
3990
|
+
iteration: number;
|
|
3991
|
+
toolCallId: string;
|
|
3992
|
+
delta: string;
|
|
3993
|
+
}
|
|
3994
|
+
/**
|
|
3995
|
+
* Agent tool input complete event — resolved parameters after streaming
|
|
3996
|
+
*/
|
|
3997
|
+
interface AgentToolInputCompleteEvent extends BaseAgentEvent {
|
|
3998
|
+
type: 'agent_tool_input_complete';
|
|
3999
|
+
iteration: number;
|
|
4000
|
+
toolCallId: string;
|
|
4001
|
+
toolName: string;
|
|
4002
|
+
parameters: Record<string, unknown>;
|
|
4003
|
+
hiddenParameterNames?: string[];
|
|
4004
|
+
}
|
|
3985
4005
|
/**
|
|
3986
4006
|
* Agent tool input complete event — resolved parameters after streaming
|
|
3987
4007
|
*/
|
|
@@ -4197,6 +4217,8 @@ interface AgentExecuteRequest {
|
|
|
4197
4217
|
debugMode?: boolean;
|
|
4198
4218
|
/** Model ID to use for this session (overrides agent config) */
|
|
4199
4219
|
model?: string;
|
|
4220
|
+
/** Enable reasoning/thinking for models that support it (e.g. Gemini 3, o-series) */
|
|
4221
|
+
reasoning?: boolean;
|
|
4200
4222
|
/** Runtime tools to make available during execution */
|
|
4201
4223
|
tools?: {
|
|
4202
4224
|
runtimeTools?: AgentRuntimeToolDefinition[];
|
|
@@ -4455,6 +4477,8 @@ interface RunTaskOptions {
|
|
|
4455
4477
|
localTools?: Record<string, LocalToolDefinition>;
|
|
4456
4478
|
/** Model ID to use (overrides agent's configured model) */
|
|
4457
4479
|
model?: string;
|
|
4480
|
+
/** Enable reasoning/thinking for models that support it (e.g. Gemini 3, o-series) */
|
|
4481
|
+
reasoning?: boolean;
|
|
4458
4482
|
/** Previous messages from a prior run (for continuation/resume) */
|
|
4459
4483
|
previousMessages?: AgentMessage[];
|
|
4460
4484
|
/** New user message for continuation (appended after previous context) */
|
package/dist/index.d.ts
CHANGED
|
@@ -3982,6 +3982,26 @@ interface AgentToolInputDeltaEvent extends BaseAgentEvent {
|
|
|
3982
3982
|
toolCallId: string;
|
|
3983
3983
|
delta: string;
|
|
3984
3984
|
}
|
|
3985
|
+
/**
|
|
3986
|
+
* Agent tool input delta event — streamed input fragment
|
|
3987
|
+
*/
|
|
3988
|
+
interface AgentToolInputDeltaEvent extends BaseAgentEvent {
|
|
3989
|
+
type: 'agent_tool_input_delta';
|
|
3990
|
+
iteration: number;
|
|
3991
|
+
toolCallId: string;
|
|
3992
|
+
delta: string;
|
|
3993
|
+
}
|
|
3994
|
+
/**
|
|
3995
|
+
* Agent tool input complete event — resolved parameters after streaming
|
|
3996
|
+
*/
|
|
3997
|
+
interface AgentToolInputCompleteEvent extends BaseAgentEvent {
|
|
3998
|
+
type: 'agent_tool_input_complete';
|
|
3999
|
+
iteration: number;
|
|
4000
|
+
toolCallId: string;
|
|
4001
|
+
toolName: string;
|
|
4002
|
+
parameters: Record<string, unknown>;
|
|
4003
|
+
hiddenParameterNames?: string[];
|
|
4004
|
+
}
|
|
3985
4005
|
/**
|
|
3986
4006
|
* Agent tool input complete event — resolved parameters after streaming
|
|
3987
4007
|
*/
|
|
@@ -4197,6 +4217,8 @@ interface AgentExecuteRequest {
|
|
|
4197
4217
|
debugMode?: boolean;
|
|
4198
4218
|
/** Model ID to use for this session (overrides agent config) */
|
|
4199
4219
|
model?: string;
|
|
4220
|
+
/** Enable reasoning/thinking for models that support it (e.g. Gemini 3, o-series) */
|
|
4221
|
+
reasoning?: boolean;
|
|
4200
4222
|
/** Runtime tools to make available during execution */
|
|
4201
4223
|
tools?: {
|
|
4202
4224
|
runtimeTools?: AgentRuntimeToolDefinition[];
|
|
@@ -4455,6 +4477,8 @@ interface RunTaskOptions {
|
|
|
4455
4477
|
localTools?: Record<string, LocalToolDefinition>;
|
|
4456
4478
|
/** Model ID to use (overrides agent's configured model) */
|
|
4457
4479
|
model?: string;
|
|
4480
|
+
/** Enable reasoning/thinking for models that support it (e.g. Gemini 3, o-series) */
|
|
4481
|
+
reasoning?: boolean;
|
|
4458
4482
|
/** Previous messages from a prior run (for continuation/resume) */
|
|
4459
4483
|
previousMessages?: AgentMessage[];
|
|
4460
4484
|
/** New user message for continuation (appended after previous context) */
|
package/dist/index.js
CHANGED
|
@@ -2786,6 +2786,57 @@ var executionPhase = {
|
|
|
2786
2786
|
};
|
|
2787
2787
|
function classifyVariant(message) {
|
|
2788
2788
|
const lower = message.toLowerCase();
|
|
2789
|
+
const modificationVerbs = [
|
|
2790
|
+
"fix",
|
|
2791
|
+
"update",
|
|
2792
|
+
"change",
|
|
2793
|
+
"modify",
|
|
2794
|
+
"edit",
|
|
2795
|
+
"refactor",
|
|
2796
|
+
"improve",
|
|
2797
|
+
"add to",
|
|
2798
|
+
"remove",
|
|
2799
|
+
"delete",
|
|
2800
|
+
"rename",
|
|
2801
|
+
"migrate"
|
|
2802
|
+
];
|
|
2803
|
+
const hasModificationVerb = modificationVerbs.some(
|
|
2804
|
+
(v) => lower.startsWith(v) || new RegExp(`\\b${v}\\b`).test(lower)
|
|
2805
|
+
);
|
|
2806
|
+
const creationPatterns = [
|
|
2807
|
+
/^create\b/,
|
|
2808
|
+
/^build\b/,
|
|
2809
|
+
/^make\b/,
|
|
2810
|
+
/^generate\b/,
|
|
2811
|
+
/^scaffold\b/,
|
|
2812
|
+
/^set up\b/,
|
|
2813
|
+
/^setup\b/,
|
|
2814
|
+
/^bootstrap\b/,
|
|
2815
|
+
/^initialize\b/,
|
|
2816
|
+
/^init\b/,
|
|
2817
|
+
/^write a\b/,
|
|
2818
|
+
/^write an\b/,
|
|
2819
|
+
/^implement a\b/,
|
|
2820
|
+
/^implement an\b/,
|
|
2821
|
+
/^start a\b/,
|
|
2822
|
+
/^start an\b/,
|
|
2823
|
+
/^new\b/
|
|
2824
|
+
];
|
|
2825
|
+
const hasCreationStart = creationPatterns.some((p) => p.test(lower));
|
|
2826
|
+
const creationVerbs = [
|
|
2827
|
+
"build",
|
|
2828
|
+
"create",
|
|
2829
|
+
"make",
|
|
2830
|
+
"generate",
|
|
2831
|
+
"scaffold",
|
|
2832
|
+
"implement"
|
|
2833
|
+
];
|
|
2834
|
+
const hasCreationVerb = creationVerbs.some(
|
|
2835
|
+
(v) => new RegExp(`\\b${v}\\b`).test(lower)
|
|
2836
|
+
);
|
|
2837
|
+
if ((hasCreationStart || hasCreationVerb) && !hasModificationVerb) {
|
|
2838
|
+
return "create";
|
|
2839
|
+
}
|
|
2789
2840
|
const externalVerbs = [
|
|
2790
2841
|
"fetch",
|
|
2791
2842
|
"browse",
|
|
@@ -2825,49 +2876,9 @@ function classifyVariant(message) {
|
|
|
2825
2876
|
];
|
|
2826
2877
|
const hasExternalVerb = externalVerbs.some((v) => lower.includes(v));
|
|
2827
2878
|
const hasExternalTarget = externalTargets.some((t) => lower.includes(t));
|
|
2828
|
-
const modificationVerbs = [
|
|
2829
|
-
"fix",
|
|
2830
|
-
"update",
|
|
2831
|
-
"change",
|
|
2832
|
-
"modify",
|
|
2833
|
-
"edit",
|
|
2834
|
-
"refactor",
|
|
2835
|
-
"improve",
|
|
2836
|
-
"add to",
|
|
2837
|
-
"remove",
|
|
2838
|
-
"delete",
|
|
2839
|
-
"rename",
|
|
2840
|
-
"migrate"
|
|
2841
|
-
];
|
|
2842
|
-
const hasModificationVerb = modificationVerbs.some(
|
|
2843
|
-
(v) => lower.startsWith(v) || new RegExp(`\\b${v}\\b`).test(lower)
|
|
2844
|
-
);
|
|
2845
2879
|
if (hasExternalVerb && hasExternalTarget && !hasModificationVerb) {
|
|
2846
2880
|
return "external";
|
|
2847
2881
|
}
|
|
2848
|
-
const creationPatterns = [
|
|
2849
|
-
/^create\b/,
|
|
2850
|
-
/^build\b/,
|
|
2851
|
-
/^make\b/,
|
|
2852
|
-
/^generate\b/,
|
|
2853
|
-
/^scaffold\b/,
|
|
2854
|
-
/^set up\b/,
|
|
2855
|
-
/^setup\b/,
|
|
2856
|
-
/^bootstrap\b/,
|
|
2857
|
-
/^initialize\b/,
|
|
2858
|
-
/^init\b/,
|
|
2859
|
-
/^write a\b/,
|
|
2860
|
-
/^write an\b/,
|
|
2861
|
-
/^implement a\b/,
|
|
2862
|
-
/^implement an\b/,
|
|
2863
|
-
/^start a\b/,
|
|
2864
|
-
/^start an\b/,
|
|
2865
|
-
/^new\b/
|
|
2866
|
-
];
|
|
2867
|
-
const hasCreationStart = creationPatterns.some((p) => p.test(lower));
|
|
2868
|
-
if (hasCreationStart && !hasModificationVerb) {
|
|
2869
|
-
return "create";
|
|
2870
|
-
}
|
|
2871
2882
|
return "modify";
|
|
2872
2883
|
}
|
|
2873
2884
|
async function generateBootstrapContext(message, localTools, variant) {
|
|
@@ -5685,6 +5696,7 @@ var _AgentsEndpoint = class _AgentsEndpoint {
|
|
|
5685
5696
|
messages,
|
|
5686
5697
|
debugMode: options.debugMode,
|
|
5687
5698
|
model: options.model,
|
|
5699
|
+
...options.reasoning !== void 0 ? { reasoning: options.reasoning } : {},
|
|
5688
5700
|
...options.toolIds?.length ? { tools: { toolIds: options.toolIds } } : {},
|
|
5689
5701
|
...requestContextManagement ? { contextManagement: requestContextManagement } : {}
|
|
5690
5702
|
};
|
|
@@ -6401,9 +6413,12 @@ Do NOT redo any of the above work.`
|
|
|
6401
6413
|
const replayHistoryMessages = this.sanitizeReplayHistoryMessages(
|
|
6402
6414
|
continuationContext.previousMessages
|
|
6403
6415
|
);
|
|
6416
|
+
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.";
|
|
6404
6417
|
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.";
|
|
6405
6418
|
const userMessage = continuationContext.newUserMessage || defaultContinueMessage;
|
|
6406
6419
|
const userContent = [
|
|
6420
|
+
continuationGuardrail,
|
|
6421
|
+
"",
|
|
6407
6422
|
userMessage,
|
|
6408
6423
|
phaseBlock,
|
|
6409
6424
|
toolsBlock,
|
|
@@ -6414,10 +6429,6 @@ Do NOT redo any of the above work.`
|
|
|
6414
6429
|
].join("\n");
|
|
6415
6430
|
const fullHistoryMessages = [
|
|
6416
6431
|
...replayHistoryMessages,
|
|
6417
|
-
{
|
|
6418
|
-
role: "system",
|
|
6419
|
-
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."
|
|
6420
|
-
},
|
|
6421
6432
|
{
|
|
6422
6433
|
role: "user",
|
|
6423
6434
|
content: userContent
|