@lota-sdk/core 0.4.5 → 0.4.7
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lota-sdk/core",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.7",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./src/index.ts",
|
|
6
6
|
"types": "./src/index.ts",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"@chat-adapter/slack": "^4.23.0",
|
|
33
33
|
"@chat-adapter/state-ioredis": "^4.23.0",
|
|
34
34
|
"@logtape/logtape": "^2.0.5",
|
|
35
|
-
"@lota-sdk/shared": "0.4.
|
|
35
|
+
"@lota-sdk/shared": "0.4.7",
|
|
36
36
|
"@mendable/firecrawl-js": "^4.18.1",
|
|
37
37
|
"@surrealdb/node": "^3.0.3",
|
|
38
38
|
"ai": "^6.0.145",
|
|
@@ -183,7 +183,7 @@ export function buildThreadAgentToolPolicy<TAgent extends string, TSkill extends
|
|
|
183
183
|
includeMemoryRemember: !params.onboardingActive,
|
|
184
184
|
includeOrgActionSearch: !params.onboardingActive,
|
|
185
185
|
includeMemoryBlockAppend: true,
|
|
186
|
-
includeReadFileParts:
|
|
186
|
+
includeReadFileParts: true,
|
|
187
187
|
includeExecutionPlanTools: !params.onboardingActive,
|
|
188
188
|
includeInspectWebsite: params.onboardingActive && params.agentId === onboardingOwnerAgentId,
|
|
189
189
|
includeProceedInOnboarding: params.onboardingActive && params.agentId === onboardingOwnerAgentId,
|
|
@@ -10,6 +10,8 @@ const EXECUTION_PLAN_AGENT_PROTOCOL_PROMPT = `<execution-plan-protocol>
|
|
|
10
10
|
- During plan-triggered turns, use the dedicated result-submission tool.
|
|
11
11
|
- Treat the active execution runs in <execution-plan-state> as authoritative for whether a plan already exists.
|
|
12
12
|
- If contracts or criteria materially change, replace the plan.
|
|
13
|
+
- Never append status labels in brackets to plan or node titles (e.g. "[blocked]", "[failed]", "[running]"). Use plain prose to describe status.
|
|
14
|
+
- Never expose raw run IDs (planRun:..., Run: UUID) in user-facing messages. Reference plans by their title only.
|
|
13
15
|
</execution-plan-protocol>`
|
|
14
16
|
|
|
15
17
|
function toExecutionPlanPromptSummaries(plans: SerializableExecutionPlan[]): ExecutionPlanPromptSummary[] {
|
|
@@ -25,3 +25,12 @@ export function assertSubstantiveAgentResult(value: string, label = 'Agent resul
|
|
|
25
25
|
|
|
26
26
|
return normalized
|
|
27
27
|
}
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Returns the normalized text if substantive, otherwise returns the fallback.
|
|
31
|
+
* Useful for delegated agent results where the agent may end on a tool call without prose output.
|
|
32
|
+
*/
|
|
33
|
+
export function resolveSubstantiveAgentResult(value: string, fallback: string): string {
|
|
34
|
+
const normalized = normalizeAgentResultText(value)
|
|
35
|
+
return isSubstantiveAgentResult(normalized) ? normalized : fallback
|
|
36
|
+
}
|
|
@@ -5,6 +5,7 @@ import {
|
|
|
5
5
|
ExecutionPlanQueryArgsSchema,
|
|
6
6
|
ExecutionPlanReplaceArgsSchema,
|
|
7
7
|
ExecutionPlanResumeArgsSchema,
|
|
8
|
+
ExecutionPlanUpdateNodeArgsSchema,
|
|
8
9
|
SubmitExecutionNodeResultArgsSchema,
|
|
9
10
|
AgentPlanDraftSchema,
|
|
10
11
|
expandAgentPlanDraft,
|
|
@@ -26,6 +27,7 @@ type ExecutionPlanExecutionPlanService = Pick<
|
|
|
26
27
|
| 'createPlan'
|
|
27
28
|
| 'replacePlan'
|
|
28
29
|
| 'resumeRun'
|
|
30
|
+
| 'submitNodeResult'
|
|
29
31
|
| 'listActivePlanSummaries'
|
|
30
32
|
| 'getActivePlanToolResult'
|
|
31
33
|
| 'getActivePlansForThread'
|
|
@@ -46,7 +48,7 @@ export function createExecutionPlanTool(params: {
|
|
|
46
48
|
|
|
47
49
|
return tool({
|
|
48
50
|
description:
|
|
49
|
-
'Manage execution plans. Actions: create (inline, 1-2 nodes), create-project (dedicated project thread, 3+ nodes), replace (swap active plan), resume (resume interrupted plan).',
|
|
51
|
+
'Manage execution plans. Actions: create (inline, 1-2 nodes), create-project (dedicated project thread, 3+ nodes), replace (swap active plan), resume (resume interrupted plan), update-node (submit result for a specific node).',
|
|
50
52
|
inputSchema: ExecutionPlanArgsSchema,
|
|
51
53
|
execute: async (input) => {
|
|
52
54
|
const parsed = parseExecutionPlanArgs(input)
|
|
@@ -148,6 +150,19 @@ export function createExecutionPlanTool(params: {
|
|
|
148
150
|
input: { runId: parsed.runId },
|
|
149
151
|
})
|
|
150
152
|
break
|
|
153
|
+
|
|
154
|
+
case 'update-node':
|
|
155
|
+
result = await resolvedEpService.submitNodeResult({
|
|
156
|
+
threadId: params.threadId,
|
|
157
|
+
emittedBy: params.agentId,
|
|
158
|
+
input: {
|
|
159
|
+
runId: parsed.runId,
|
|
160
|
+
nodeId: parsed.node.id,
|
|
161
|
+
notes: parsed.node.latestNotes,
|
|
162
|
+
artifacts: parsed.node.deliverables ?? [],
|
|
163
|
+
},
|
|
164
|
+
})
|
|
165
|
+
break
|
|
151
166
|
}
|
|
152
167
|
|
|
153
168
|
params.onPlanChanged?.()
|
|
@@ -168,6 +183,8 @@ function parseExecutionPlanArgs(input: unknown): ExecutionPlanArgs {
|
|
|
168
183
|
return ExecutionPlanReplaceArgsSchema.parse(parsed)
|
|
169
184
|
case 'resume':
|
|
170
185
|
return ExecutionPlanResumeArgsSchema.parse(parsed)
|
|
186
|
+
case 'update-node':
|
|
187
|
+
return ExecutionPlanUpdateNodeArgsSchema.parse(parsed)
|
|
171
188
|
}
|
|
172
189
|
}
|
|
173
190
|
|