illuma-agents 1.0.65 → 1.0.67
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/cjs/common/enum.cjs +2 -0
- package/dist/cjs/common/enum.cjs.map +1 -1
- package/dist/cjs/graphs/Graph.cjs +3 -132
- package/dist/cjs/graphs/Graph.cjs.map +1 -1
- package/dist/cjs/main.cjs +47 -4
- package/dist/cjs/main.cjs.map +1 -1
- package/dist/cjs/messages/format.cjs +0 -50
- package/dist/cjs/messages/format.cjs.map +1 -1
- package/dist/cjs/prompts/collab.cjs +11 -0
- package/dist/cjs/prompts/collab.cjs.map +1 -0
- package/dist/cjs/prompts/taskmanager.cjs +66 -0
- package/dist/cjs/prompts/taskmanager.cjs.map +1 -0
- package/dist/cjs/prompts/taskplanning.cjs +99 -0
- package/dist/cjs/prompts/taskplanning.cjs.map +1 -0
- package/dist/cjs/tools/Calculator.cjs +23 -2
- package/dist/cjs/tools/Calculator.cjs.map +1 -1
- package/dist/cjs/tools/CodeExecutor.cjs +19 -1
- package/dist/cjs/tools/CodeExecutor.cjs.map +1 -1
- package/dist/cjs/tools/TaskProgress.cjs +172 -0
- package/dist/cjs/tools/TaskProgress.cjs.map +1 -0
- package/dist/cjs/tools/ToolNode.cjs +2 -1
- package/dist/cjs/tools/ToolNode.cjs.map +1 -1
- package/dist/cjs/tools/search/schema.cjs +45 -0
- package/dist/cjs/tools/search/schema.cjs.map +1 -1
- package/dist/cjs/tools/search/tool.cjs.map +1 -1
- package/dist/esm/common/enum.mjs +2 -0
- package/dist/esm/common/enum.mjs.map +1 -1
- package/dist/esm/graphs/Graph.mjs +3 -132
- package/dist/esm/graphs/Graph.mjs.map +1 -1
- package/dist/esm/main.mjs +8 -3
- package/dist/esm/main.mjs.map +1 -1
- package/dist/esm/messages/format.mjs +2 -51
- package/dist/esm/messages/format.mjs.map +1 -1
- package/dist/esm/prompts/collab.mjs +9 -0
- package/dist/esm/prompts/collab.mjs.map +1 -0
- package/dist/esm/prompts/taskmanager.mjs +60 -0
- package/dist/esm/prompts/taskmanager.mjs.map +1 -0
- package/dist/esm/prompts/taskplanning.mjs +94 -0
- package/dist/esm/prompts/taskplanning.mjs.map +1 -0
- package/dist/esm/tools/Calculator.mjs +20 -3
- package/dist/esm/tools/Calculator.mjs.map +1 -1
- package/dist/esm/tools/CodeExecutor.mjs +16 -2
- package/dist/esm/tools/CodeExecutor.mjs.map +1 -1
- package/dist/esm/tools/TaskProgress.mjs +163 -0
- package/dist/esm/tools/TaskProgress.mjs.map +1 -0
- package/dist/esm/tools/ToolNode.mjs +2 -1
- package/dist/esm/tools/ToolNode.mjs.map +1 -1
- package/dist/esm/tools/search/schema.mjs +42 -1
- package/dist/esm/tools/search/schema.mjs.map +1 -1
- package/dist/esm/tools/search/tool.mjs.map +1 -1
- package/dist/types/common/enum.d.ts +2 -0
- package/dist/types/index.d.ts +2 -0
- package/dist/types/messages/format.d.ts +0 -9
- package/dist/types/prompts/index.d.ts +1 -0
- package/dist/types/prompts/taskplanning.d.ts +54 -0
- package/dist/types/tools/Calculator.d.ts +26 -0
- package/dist/types/tools/CodeExecutor.d.ts +51 -0
- package/dist/types/tools/TaskProgress.d.ts +142 -0
- package/dist/types/tools/search/index.d.ts +1 -0
- package/dist/types/tools/search/schema.d.ts +69 -0
- package/package.json +1 -1
- package/src/common/enum.ts +2 -0
- package/src/graphs/Graph.ts +5 -160
- package/src/index.ts +4 -0
- package/src/messages/format.ts +0 -60
- package/src/prompts/index.ts +2 -1
- package/src/prompts/taskplanning.ts +96 -0
- package/src/specs/task-progress.test.ts +330 -0
- package/src/tools/Calculator.ts +24 -3
- package/src/tools/CodeExecutor.ts +19 -2
- package/src/tools/TaskProgress.ts +247 -0
- package/src/tools/ToolNode.ts +2 -1
- package/src/tools/search/index.ts +1 -0
- package/src/tools/search/schema.ts +45 -0
- package/src/tools/search/tool.ts +3 -3
package/src/graphs/Graph.ts
CHANGED
|
@@ -731,7 +731,7 @@ export class StandardGraph extends Graph<t.BaseGraphState, t.GraphNode> {
|
|
|
731
731
|
const {
|
|
732
732
|
name = 'StructuredResponse',
|
|
733
733
|
mode = 'auto',
|
|
734
|
-
includeRaw = false,
|
|
734
|
+
includeRaw: _includeRaw = false,
|
|
735
735
|
handleErrors = true,
|
|
736
736
|
maxRetries = 2,
|
|
737
737
|
} = structuredOutputConfig;
|
|
@@ -793,7 +793,6 @@ export class StandardGraph extends Graph<t.BaseGraphState, t.GraphNode> {
|
|
|
793
793
|
|
|
794
794
|
// Debug: log what we got back
|
|
795
795
|
console.log('[Graph] Structured output raw result type:', typeof result);
|
|
796
|
-
console.log('[Graph] Structured output result keys:', result ? Object.keys(result) : 'null');
|
|
797
796
|
if (result?.raw) {
|
|
798
797
|
const rawMsg = result.raw;
|
|
799
798
|
console.log('[Graph] Raw message content type:', typeof rawMsg?.content);
|
|
@@ -801,31 +800,17 @@ export class StandardGraph extends Graph<t.BaseGraphState, t.GraphNode> {
|
|
|
801
800
|
if (rawMsg?.content && typeof rawMsg.content === 'string' && rawMsg.content.length > 0) {
|
|
802
801
|
console.log('[Graph] Raw message text content (first 200):', rawMsg.content.substring(0, 200));
|
|
803
802
|
}
|
|
804
|
-
// Log the parsed result if available
|
|
805
|
-
if (result?.parsed) {
|
|
806
|
-
console.log('[Graph] Parsed result keys:', Object.keys(result.parsed));
|
|
807
|
-
}
|
|
808
803
|
}
|
|
809
804
|
|
|
810
805
|
// Handle response - we always use includeRaw internally
|
|
811
806
|
if (result?.raw && result?.parsed !== undefined) {
|
|
812
|
-
console.log('[Graph] Using parsed result from structured output');
|
|
813
807
|
return {
|
|
814
808
|
structuredResponse: result.parsed as Record<string, unknown>,
|
|
815
809
|
rawMessage: result.raw as AIMessageChunk,
|
|
816
810
|
};
|
|
817
811
|
}
|
|
818
812
|
|
|
819
|
-
// Fallback: If result itself is the parsed object (no raw wrapper)
|
|
820
|
-
if (result && typeof result === 'object' && !result.raw && !result.parsed) {
|
|
821
|
-
console.log('[Graph] Result is the structured object directly');
|
|
822
|
-
return {
|
|
823
|
-
structuredResponse: result as Record<string, unknown>,
|
|
824
|
-
};
|
|
825
|
-
}
|
|
826
|
-
|
|
827
813
|
// Fallback for models that don't support includeRaw
|
|
828
|
-
console.log('[Graph] Using fallback - treating result as structured response');
|
|
829
814
|
return {
|
|
830
815
|
structuredResponse: result as Record<string, unknown>,
|
|
831
816
|
};
|
|
@@ -1151,17 +1136,10 @@ export class StandardGraph extends Graph<t.BaseGraphState, t.GraphNode> {
|
|
|
1151
1136
|
);
|
|
1152
1137
|
|
|
1153
1138
|
// Check if structured output mode is enabled
|
|
1154
|
-
|
|
1155
|
-
// Only use structured output when:
|
|
1156
|
-
// 1. No tools are configured, OR
|
|
1157
|
-
// 2. The model has already used tools and is ready to give final response
|
|
1158
|
-
const hasTools = agentContext.tools && agentContext.tools.length > 0;
|
|
1159
|
-
const shouldUseStructuredOutputNow =
|
|
1139
|
+
if (
|
|
1160
1140
|
agentContext.isStructuredOutputMode &&
|
|
1161
|
-
agentContext.structuredOutput
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
if (shouldUseStructuredOutputNow) {
|
|
1141
|
+
agentContext.structuredOutput
|
|
1142
|
+
) {
|
|
1165
1143
|
const schema = agentContext.getStructuredOutputSchema();
|
|
1166
1144
|
if (!schema) {
|
|
1167
1145
|
throw new Error('Structured output schema is not configured');
|
|
@@ -1206,16 +1184,13 @@ export class StandardGraph extends Graph<t.BaseGraphState, t.GraphNode> {
|
|
|
1206
1184
|
clientOptions: structuredClientOptions,
|
|
1207
1185
|
});
|
|
1208
1186
|
|
|
1209
|
-
// For no-tools case, we pass the original messages directly
|
|
1210
|
-
// There shouldn't be thinking blocks since this is the first invocation
|
|
1211
|
-
|
|
1212
1187
|
const { structuredResponse, rawMessage } =
|
|
1213
1188
|
await this.attemptStructuredInvoke(
|
|
1214
1189
|
{
|
|
1215
1190
|
currentModel: structuredModel,
|
|
1216
1191
|
finalMessages,
|
|
1217
1192
|
schema,
|
|
1218
|
-
structuredOutputConfig: agentContext.structuredOutput
|
|
1193
|
+
structuredOutputConfig: agentContext.structuredOutput,
|
|
1219
1194
|
provider: agentContext.provider,
|
|
1220
1195
|
},
|
|
1221
1196
|
config
|
|
@@ -1488,136 +1463,6 @@ If I seem to be missing something we discussed earlier, just give me a quick rem
|
|
|
1488
1463
|
if (!result) {
|
|
1489
1464
|
throw new Error('No result after model invocation');
|
|
1490
1465
|
}
|
|
1491
|
-
|
|
1492
|
-
// Check if we need to apply structured output for the final response
|
|
1493
|
-
// This handles the case where tools were used, and now the model is giving its final answer
|
|
1494
|
-
const resultMessage = result.messages?.[0] as AIMessageChunk | undefined;
|
|
1495
|
-
const hasToolCalls = (resultMessage?.tool_calls?.length ?? 0) > 0;
|
|
1496
|
-
|
|
1497
|
-
if (
|
|
1498
|
-
agentContext.isStructuredOutputMode &&
|
|
1499
|
-
agentContext.structuredOutput &&
|
|
1500
|
-
!hasToolCalls && // Model is giving final response (no tool calls)
|
|
1501
|
-
hasTools // We skipped structured output earlier because tools were available
|
|
1502
|
-
) {
|
|
1503
|
-
const schema = agentContext.getStructuredOutputSchema();
|
|
1504
|
-
if (schema) {
|
|
1505
|
-
try {
|
|
1506
|
-
console.log('[Graph] Applying structured output for final response after tool execution');
|
|
1507
|
-
|
|
1508
|
-
// Get a fresh model for structured output
|
|
1509
|
-
const structuredClientOptions = { ...agentContext.clientOptions } as t.ClientOptions;
|
|
1510
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1511
|
-
(structuredClientOptions as any).streaming = false;
|
|
1512
|
-
|
|
1513
|
-
// Remove thinking configuration
|
|
1514
|
-
if (agentContext.provider === Providers.BEDROCK) {
|
|
1515
|
-
const bedrockOpts = structuredClientOptions as t.BedrockAnthropicClientOptions;
|
|
1516
|
-
if (bedrockOpts.additionalModelRequestFields) {
|
|
1517
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1518
|
-
const additionalFields = Object.assign({}, bedrockOpts.additionalModelRequestFields) as any;
|
|
1519
|
-
delete additionalFields.thinking;
|
|
1520
|
-
delete additionalFields.budgetTokens;
|
|
1521
|
-
bedrockOpts.additionalModelRequestFields = additionalFields;
|
|
1522
|
-
}
|
|
1523
|
-
}
|
|
1524
|
-
if (agentContext.provider === Providers.ANTHROPIC) {
|
|
1525
|
-
const anthropicOpts = structuredClientOptions as t.AnthropicClientOptions;
|
|
1526
|
-
if (anthropicOpts.thinking) {
|
|
1527
|
-
delete anthropicOpts.thinking;
|
|
1528
|
-
}
|
|
1529
|
-
}
|
|
1530
|
-
|
|
1531
|
-
const structuredModel = this.getNewModel({
|
|
1532
|
-
provider: agentContext.provider,
|
|
1533
|
-
clientOptions: structuredClientOptions,
|
|
1534
|
-
});
|
|
1535
|
-
|
|
1536
|
-
// Following LangGraph's Option 2 pattern:
|
|
1537
|
-
// Instead of passing the full conversation (which has thinking blocks),
|
|
1538
|
-
// just pass the model's final response text as a HumanMessage asking for structured output.
|
|
1539
|
-
// This avoids issues with thinking blocks and is more token-efficient.
|
|
1540
|
-
let responseContent = '';
|
|
1541
|
-
if (resultMessage) {
|
|
1542
|
-
if (typeof resultMessage.content === 'string') {
|
|
1543
|
-
responseContent = resultMessage.content;
|
|
1544
|
-
} else if (Array.isArray(resultMessage.content)) {
|
|
1545
|
-
// Extract text parts only (skip thinking blocks, tool_use, etc.)
|
|
1546
|
-
responseContent = resultMessage.content
|
|
1547
|
-
.filter((c): c is { type: string; text: string } =>
|
|
1548
|
-
typeof c === 'object' && c !== null &&
|
|
1549
|
-
(c as { type?: string }).type === 'text' &&
|
|
1550
|
-
typeof (c as { text?: string }).text === 'string'
|
|
1551
|
-
)
|
|
1552
|
-
.map(c => c.text)
|
|
1553
|
-
.join('\n');
|
|
1554
|
-
}
|
|
1555
|
-
}
|
|
1556
|
-
|
|
1557
|
-
if (!responseContent) {
|
|
1558
|
-
console.log('[Graph] No response content to structure, skipping');
|
|
1559
|
-
throw new Error('No response content available for structured output');
|
|
1560
|
-
}
|
|
1561
|
-
|
|
1562
|
-
console.log('[Graph] Structuring response content (first 200 chars):', responseContent.substring(0, 200));
|
|
1563
|
-
|
|
1564
|
-
// Create a simple message asking to structure the response
|
|
1565
|
-
const structuredMessages: BaseMessage[] = [
|
|
1566
|
-
new HumanMessage({
|
|
1567
|
-
content: `Based on the following response, extract and return the data in the required structured format:\n\n${responseContent}`,
|
|
1568
|
-
}),
|
|
1569
|
-
];
|
|
1570
|
-
|
|
1571
|
-
const { structuredResponse, rawMessage } =
|
|
1572
|
-
await this.attemptStructuredInvoke(
|
|
1573
|
-
{
|
|
1574
|
-
currentModel: structuredModel,
|
|
1575
|
-
finalMessages: structuredMessages,
|
|
1576
|
-
schema,
|
|
1577
|
-
structuredOutputConfig: agentContext.structuredOutput!,
|
|
1578
|
-
provider: agentContext.provider,
|
|
1579
|
-
},
|
|
1580
|
-
config
|
|
1581
|
-
);
|
|
1582
|
-
|
|
1583
|
-
// Emit structured output event
|
|
1584
|
-
await safeDispatchCustomEvent(
|
|
1585
|
-
GraphEvents.ON_STRUCTURED_OUTPUT,
|
|
1586
|
-
{
|
|
1587
|
-
structuredResponse,
|
|
1588
|
-
schema,
|
|
1589
|
-
raw: rawMessage,
|
|
1590
|
-
},
|
|
1591
|
-
config
|
|
1592
|
-
);
|
|
1593
|
-
|
|
1594
|
-
agentContext.currentUsage = rawMessage
|
|
1595
|
-
? this.getUsageMetadata(rawMessage)
|
|
1596
|
-
: undefined;
|
|
1597
|
-
this.cleanupSignalListener();
|
|
1598
|
-
|
|
1599
|
-
// Return clean message without tool_calls
|
|
1600
|
-
let cleanMessage: AIMessageChunk | undefined;
|
|
1601
|
-
if (rawMessage) {
|
|
1602
|
-
cleanMessage = new AIMessageChunk({
|
|
1603
|
-
content: JSON.stringify(structuredResponse, null, 2),
|
|
1604
|
-
id: rawMessage.id,
|
|
1605
|
-
response_metadata: rawMessage.response_metadata,
|
|
1606
|
-
usage_metadata: rawMessage.usage_metadata,
|
|
1607
|
-
});
|
|
1608
|
-
}
|
|
1609
|
-
|
|
1610
|
-
return {
|
|
1611
|
-
messages: cleanMessage ? [cleanMessage] : [],
|
|
1612
|
-
structuredResponse,
|
|
1613
|
-
};
|
|
1614
|
-
} catch (structuredError) {
|
|
1615
|
-
console.error('[Graph] Structured output failed after tool execution:', structuredError);
|
|
1616
|
-
// Fall through to return normal result
|
|
1617
|
-
}
|
|
1618
|
-
}
|
|
1619
|
-
}
|
|
1620
|
-
|
|
1621
1466
|
agentContext.currentUsage = this.getUsageMetadata(result.messages?.[0]);
|
|
1622
1467
|
this.cleanupSignalListener();
|
|
1623
1468
|
return result;
|
package/src/index.ts
CHANGED
|
@@ -14,11 +14,15 @@ export * from './tools/CodeExecutor';
|
|
|
14
14
|
export * from './tools/BrowserTools';
|
|
15
15
|
export * from './tools/ProgrammaticToolCalling';
|
|
16
16
|
export * from './tools/ToolSearch';
|
|
17
|
+
export * from './tools/TaskProgress';
|
|
17
18
|
export * from './tools/ToolNode';
|
|
18
19
|
export * from './tools/schema';
|
|
19
20
|
export * from './tools/handlers';
|
|
20
21
|
export * from './tools/search';
|
|
21
22
|
|
|
23
|
+
/* Prompts */
|
|
24
|
+
export * from './prompts';
|
|
25
|
+
|
|
22
26
|
/* Schemas */
|
|
23
27
|
export * from './schemas';
|
|
24
28
|
|
package/src/messages/format.ts
CHANGED
|
@@ -934,63 +934,3 @@ export function ensureThinkingBlockInMessages(
|
|
|
934
934
|
|
|
935
935
|
return result;
|
|
936
936
|
}
|
|
937
|
-
|
|
938
|
-
/**
|
|
939
|
-
* Strips thinking blocks from messages for structured output invocation.
|
|
940
|
-
* When switching from thinking-enabled mode to structured output (which requires thinking disabled),
|
|
941
|
-
* we need to remove thinking/reasoning blocks from the conversation to avoid Bedrock errors.
|
|
942
|
-
*
|
|
943
|
-
* @param messages - Array of messages to process
|
|
944
|
-
* @returns The messages array with thinking blocks stripped from AI messages
|
|
945
|
-
*/
|
|
946
|
-
export function stripThinkingBlocksFromMessages(
|
|
947
|
-
messages: BaseMessage[]
|
|
948
|
-
): BaseMessage[] {
|
|
949
|
-
return messages.map((msg) => {
|
|
950
|
-
const isAI = msg instanceof AIMessage || msg instanceof AIMessageChunk;
|
|
951
|
-
|
|
952
|
-
if (!isAI) {
|
|
953
|
-
return msg;
|
|
954
|
-
}
|
|
955
|
-
|
|
956
|
-
const aiMsg = msg as AIMessage | AIMessageChunk;
|
|
957
|
-
const content = aiMsg.content;
|
|
958
|
-
|
|
959
|
-
// If content is not an array, nothing to strip
|
|
960
|
-
if (!Array.isArray(content)) {
|
|
961
|
-
return msg;
|
|
962
|
-
}
|
|
963
|
-
|
|
964
|
-
// Filter out thinking/reasoning blocks
|
|
965
|
-
const filteredContent = content.filter((c) => {
|
|
966
|
-
if (typeof c !== 'object' || c === null) {
|
|
967
|
-
return true;
|
|
968
|
-
}
|
|
969
|
-
const type = (c as ExtendedMessageContent).type;
|
|
970
|
-
return (
|
|
971
|
-
type !== ContentTypes.THINKING &&
|
|
972
|
-
type !== ContentTypes.REASONING_CONTENT &&
|
|
973
|
-
type !== ContentTypes.REASONING &&
|
|
974
|
-
type !== 'thinking' &&
|
|
975
|
-
type !== 'redacted_thinking'
|
|
976
|
-
);
|
|
977
|
-
});
|
|
978
|
-
|
|
979
|
-
// If no content left after filtering, add a placeholder
|
|
980
|
-
if (filteredContent.length === 0) {
|
|
981
|
-
filteredContent.push({
|
|
982
|
-
type: 'text',
|
|
983
|
-
text: '(previous response)',
|
|
984
|
-
});
|
|
985
|
-
}
|
|
986
|
-
|
|
987
|
-
// Create a new AI message with the filtered content
|
|
988
|
-
return new AIMessageChunk({
|
|
989
|
-
content: filteredContent,
|
|
990
|
-
id: aiMsg.id,
|
|
991
|
-
response_metadata: aiMsg.response_metadata,
|
|
992
|
-
usage_metadata: aiMsg.usage_metadata,
|
|
993
|
-
// Don't include tool_calls - we're stripping those for structured output context
|
|
994
|
-
});
|
|
995
|
-
});
|
|
996
|
-
}
|
package/src/prompts/index.ts
CHANGED
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
// src/prompts/taskplanning.ts
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* System prompt fragment for task planning capabilities.
|
|
5
|
+
*
|
|
6
|
+
* Include this in the agent's system prompt when:
|
|
7
|
+
* - Agent is ephemeral (not a persistent workflow)
|
|
8
|
+
* - Agent handles complex, multi-step research or coding tasks
|
|
9
|
+
* - You want visible progress tracking for the user
|
|
10
|
+
*
|
|
11
|
+
* Do NOT include for:
|
|
12
|
+
* - Simple tool-calling agents
|
|
13
|
+
* - Workflow/builder agents with predefined steps
|
|
14
|
+
* - Agents with fixed execution patterns
|
|
15
|
+
*/
|
|
16
|
+
export const taskPlanningPrompt = `## Task Planning & Progress
|
|
17
|
+
|
|
18
|
+
You have access to a \`manage_todo_list\` tool for tracking complex tasks.
|
|
19
|
+
|
|
20
|
+
### When to Use Task Planning
|
|
21
|
+
- **USE** for complex work requiring 3+ steps (research, multi-file changes, analysis)
|
|
22
|
+
- **SKIP** for simple requests (single file edit, quick lookup, conversational responses)
|
|
23
|
+
|
|
24
|
+
### Task Workflow
|
|
25
|
+
1. **Plan First**: Before starting complex work, create a todo list with 3-6 clear, actionable items
|
|
26
|
+
2. **One at a Time**: Mark ONE task as "in-progress" before starting work on it
|
|
27
|
+
3. **Multiple Tool Calls OK**: A single task may require multiple tool calls (searches, reads, writes)
|
|
28
|
+
4. **Complete Immediately**: Mark task "completed" right after finishing, don't batch updates
|
|
29
|
+
5. **Iterate**: Move to next task, repeat until done
|
|
30
|
+
|
|
31
|
+
### Task Best Practices
|
|
32
|
+
- Keep titles short and action-oriented (3-7 words): "Research API options", "Implement auth flow"
|
|
33
|
+
- Group related work into single tasks rather than micro-tasks
|
|
34
|
+
- Update status promptly so user sees real-time progress
|
|
35
|
+
- For simple 1-2 step work, just do it directly without creating todos
|
|
36
|
+
|
|
37
|
+
### Example Task Breakdown
|
|
38
|
+
For "Add user authentication to the app":
|
|
39
|
+
1. Review existing auth code and dependencies
|
|
40
|
+
2. Implement login endpoint
|
|
41
|
+
3. Add session management
|
|
42
|
+
4. Create protected route middleware
|
|
43
|
+
5. Test authentication flow
|
|
44
|
+
|
|
45
|
+
Each task above might involve multiple file reads, code writes, and searches - that's expected.
|
|
46
|
+
`;
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Short version of task planning prompt for constrained context
|
|
50
|
+
*/
|
|
51
|
+
export const taskPlanningPromptShort = `## Task Tracking
|
|
52
|
+
Use \`manage_todo_list\` for complex multi-step work (3+ steps).
|
|
53
|
+
- Create 3-6 actionable todos before starting
|
|
54
|
+
- Mark one "in-progress" at a time
|
|
55
|
+
- Mark "completed" immediately after finishing
|
|
56
|
+
- Skip for simple 1-2 step tasks
|
|
57
|
+
`;
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* Function description for structured output agents
|
|
61
|
+
*/
|
|
62
|
+
export const manageTodoListFunctionDescription =
|
|
63
|
+
'Manage a todo list for tracking progress on complex multi-step tasks. Create todos before starting work, mark in-progress while working, mark completed when done.';
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* Function parameters schema (for agents using function calling format)
|
|
67
|
+
*/
|
|
68
|
+
export const manageTodoListFunctionParameters = {
|
|
69
|
+
type: 'object',
|
|
70
|
+
properties: {
|
|
71
|
+
todoList: {
|
|
72
|
+
type: 'array',
|
|
73
|
+
description: 'Complete array of all todo items (existing and new)',
|
|
74
|
+
items: {
|
|
75
|
+
type: 'object',
|
|
76
|
+
properties: {
|
|
77
|
+
id: {
|
|
78
|
+
type: 'number',
|
|
79
|
+
description: 'Sequential ID starting from 1',
|
|
80
|
+
},
|
|
81
|
+
title: {
|
|
82
|
+
type: 'string',
|
|
83
|
+
description: 'Short action-oriented title (3-7 words)',
|
|
84
|
+
},
|
|
85
|
+
status: {
|
|
86
|
+
type: 'string',
|
|
87
|
+
enum: ['not-started', 'in-progress', 'completed'],
|
|
88
|
+
description: 'Current task status',
|
|
89
|
+
},
|
|
90
|
+
},
|
|
91
|
+
required: ['id', 'title', 'status'],
|
|
92
|
+
},
|
|
93
|
+
},
|
|
94
|
+
},
|
|
95
|
+
required: ['todoList'],
|
|
96
|
+
};
|