@lota-sdk/shared 0.3.1 → 0.3.3
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 +1 -1
- package/src/constants/execution-plan.ts +4 -4
- package/src/schemas/tools.ts +42 -17
package/package.json
CHANGED
|
@@ -5,13 +5,13 @@ export const HUMAN_NODE_TYPES = ['human-input', 'human-approval', 'human-review-
|
|
|
5
5
|
export const STRUCTURAL_NODE_TYPES = ['switch', 'join', 'deliberation-fork'] as const
|
|
6
6
|
|
|
7
7
|
export const PROJECT_PLAN_ROUTING_PROMPT = `<project-plan-routing>
|
|
8
|
-
- Use
|
|
9
|
-
- Use
|
|
10
|
-
-
|
|
8
|
+
- Use executionPlan with action "create" for small inline work inside the current thread.
|
|
9
|
+
- Use executionPlan with action "create-project" when the work needs a dedicated project thread, should stay visible in the sidebar or board, or needs 3 or more meaningful execution nodes.
|
|
10
|
+
- Never invent other plan tool names.
|
|
11
11
|
</project-plan-routing>`
|
|
12
12
|
|
|
13
13
|
export const EXECUTION_PLAN_SELF_START_PROMPT = `<execution-plan-self-start>
|
|
14
|
-
- When you create an execution plan with
|
|
14
|
+
- When you create an execution plan with executionPlan and the first node is assigned to you, begin executing that node immediately in the same turn. Do not wait for the user to ask.
|
|
15
15
|
- After completing a node, submit the result and check whether the next ready node is also yours. If so, continue working.
|
|
16
16
|
- When the user's message relates to an active plan where you own ready nodes, inspect the plan state and proactively work on your ready nodes.
|
|
17
17
|
- When you own a blocked or failed node, tell the user what is blocked and what resolution is needed.
|
package/src/schemas/tools.ts
CHANGED
|
@@ -71,24 +71,49 @@ export const ExecutionPlanActionSchema = z
|
|
|
71
71
|
)
|
|
72
72
|
export type ExecutionPlanAction = z.infer<typeof ExecutionPlanActionSchema>
|
|
73
73
|
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
74
|
+
const projectTitleSchema = z
|
|
75
|
+
.string()
|
|
76
|
+
.trim()
|
|
77
|
+
.min(1)
|
|
78
|
+
.max(200)
|
|
79
|
+
.describe('Required for create-project when creating a new thread.')
|
|
80
|
+
|
|
81
|
+
const targetThreadIdSchema = z
|
|
82
|
+
.string()
|
|
83
|
+
.trim()
|
|
84
|
+
.min(1)
|
|
85
|
+
.describe('Target existing thread. For create-project, provide either this or projectTitle.')
|
|
86
|
+
|
|
87
|
+
const runIdSchema = z.string().trim().min(1)
|
|
88
|
+
const replaceReasonSchema = z.string().trim().min(1).max(1000)
|
|
89
|
+
|
|
90
|
+
const ExecutionPlanCreateArgsSchema = AgentPlanDraftSchema.extend({
|
|
91
|
+
action: z.literal('create'),
|
|
92
|
+
targetThreadId: targetThreadIdSchema.optional(),
|
|
91
93
|
}).strict()
|
|
94
|
+
|
|
95
|
+
const ExecutionPlanCreateProjectArgsSchema = AgentPlanDraftSchema.extend({
|
|
96
|
+
action: z.literal('create-project'),
|
|
97
|
+
projectTitle: projectTitleSchema.optional(),
|
|
98
|
+
targetThreadId: targetThreadIdSchema.optional(),
|
|
99
|
+
}).strict()
|
|
100
|
+
|
|
101
|
+
const ExecutionPlanReplaceArgsSchema = AgentPlanDraftSchema.extend({
|
|
102
|
+
action: z.literal('replace'),
|
|
103
|
+
runId: runIdSchema.describe('Required for replace and resume.'),
|
|
104
|
+
reason: replaceReasonSchema.describe('Required for replace.'),
|
|
105
|
+
}).strict()
|
|
106
|
+
|
|
107
|
+
const ExecutionPlanResumeArgsSchema = z
|
|
108
|
+
.object({ action: z.literal('resume'), runId: runIdSchema.describe('Required for replace and resume.') })
|
|
109
|
+
.strict()
|
|
110
|
+
|
|
111
|
+
export const ExecutionPlanArgsSchema = z.discriminatedUnion('action', [
|
|
112
|
+
ExecutionPlanCreateArgsSchema,
|
|
113
|
+
ExecutionPlanCreateProjectArgsSchema,
|
|
114
|
+
ExecutionPlanReplaceArgsSchema,
|
|
115
|
+
ExecutionPlanResumeArgsSchema,
|
|
116
|
+
])
|
|
92
117
|
export type ExecutionPlanArgs = z.infer<typeof ExecutionPlanArgsSchema>
|
|
93
118
|
|
|
94
119
|
export const ExecutionPlanQueryArgsSchema = z
|