agentrace 0.0.3 → 0.0.4
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.
|
@@ -22,8 +22,10 @@ function getSessionIdFromFile() {
|
|
|
22
22
|
return undefined;
|
|
23
23
|
}
|
|
24
24
|
// Tool schemas
|
|
25
|
-
const
|
|
26
|
-
git_remote_url: z.string().describe("Git remote URL to filter
|
|
25
|
+
const SearchPlansSchema = z.object({
|
|
26
|
+
git_remote_url: z.string().optional().describe("Git remote URL to filter by project"),
|
|
27
|
+
status: z.string().optional().describe("Comma-separated statuses to filter (e.g., 'planning,implementation')"),
|
|
28
|
+
description: z.string().optional().describe("Partial match search on plan description"),
|
|
27
29
|
});
|
|
28
30
|
const ReadPlanSchema = z.object({
|
|
29
31
|
id: z.string().describe("Plan document ID"),
|
|
@@ -42,12 +44,14 @@ const SetPlanStatusSchema = z.object({
|
|
|
42
44
|
});
|
|
43
45
|
// Tool descriptions with usage guidance
|
|
44
46
|
const TOOL_DESCRIPTIONS = {
|
|
45
|
-
|
|
47
|
+
search_plans: `Search plan documents with filtering options.
|
|
46
48
|
|
|
47
49
|
WHEN TO USE:
|
|
48
50
|
- When you need to check existing plans for the current repository
|
|
49
51
|
- When the user asks about available plans or implementation documents
|
|
50
|
-
- Before creating a new plan to avoid duplicates
|
|
52
|
+
- Before creating a new plan to avoid duplicates
|
|
53
|
+
- When searching for plans by status (e.g., find all plans in 'scratch' status)
|
|
54
|
+
- When searching for plans by description keyword`,
|
|
51
55
|
read_plan: `Read a plan document by ID.
|
|
52
56
|
|
|
53
57
|
WHEN TO USE:
|
|
@@ -119,16 +123,20 @@ IMPORTANT GUIDELINES:
|
|
|
119
123
|
}
|
|
120
124
|
return client;
|
|
121
125
|
}
|
|
122
|
-
//
|
|
123
|
-
server.tool("
|
|
126
|
+
// search_plans tool
|
|
127
|
+
server.tool("search_plans", TOOL_DESCRIPTIONS.search_plans, SearchPlansSchema.shape, async (args) => {
|
|
124
128
|
try {
|
|
125
|
-
const plans = await getClient().
|
|
129
|
+
const plans = await getClient().searchPlans({
|
|
130
|
+
gitRemoteUrl: args.git_remote_url,
|
|
131
|
+
status: args.status,
|
|
132
|
+
description: args.description,
|
|
133
|
+
});
|
|
126
134
|
if (plans.length === 0) {
|
|
127
135
|
return {
|
|
128
136
|
content: [
|
|
129
137
|
{
|
|
130
138
|
type: "text",
|
|
131
|
-
text: "No plans found
|
|
139
|
+
text: "No plans found matching the search criteria.",
|
|
132
140
|
},
|
|
133
141
|
],
|
|
134
142
|
};
|
package/dist/index.js
CHANGED
|
File without changes
|
|
@@ -28,6 +28,11 @@ export interface PlanDocumentEvent {
|
|
|
28
28
|
export interface ListPlansResponse {
|
|
29
29
|
plans: PlanDocument[];
|
|
30
30
|
}
|
|
31
|
+
export interface SearchPlansParams {
|
|
32
|
+
gitRemoteUrl?: string;
|
|
33
|
+
status?: string;
|
|
34
|
+
description?: string;
|
|
35
|
+
}
|
|
31
36
|
export interface ListEventsResponse {
|
|
32
37
|
events: PlanDocumentEvent[];
|
|
33
38
|
}
|
|
@@ -47,7 +52,7 @@ export declare class PlanDocumentClient {
|
|
|
47
52
|
private apiKey;
|
|
48
53
|
constructor();
|
|
49
54
|
private request;
|
|
50
|
-
|
|
55
|
+
searchPlans(params?: SearchPlansParams): Promise<PlanDocument[]>;
|
|
51
56
|
getPlan(id: string): Promise<PlanDocument>;
|
|
52
57
|
getPlanEvents(id: string): Promise<PlanDocumentEvent[]>;
|
|
53
58
|
createPlan(req: CreatePlanRequest): Promise<PlanDocument>;
|
|
@@ -31,11 +31,19 @@ export class PlanDocumentClient {
|
|
|
31
31
|
}
|
|
32
32
|
return response.json();
|
|
33
33
|
}
|
|
34
|
-
async
|
|
35
|
-
|
|
36
|
-
if (gitRemoteUrl) {
|
|
37
|
-
|
|
34
|
+
async searchPlans(params = {}) {
|
|
35
|
+
const searchParams = new URLSearchParams();
|
|
36
|
+
if (params.gitRemoteUrl) {
|
|
37
|
+
searchParams.set("git_remote_url", params.gitRemoteUrl);
|
|
38
38
|
}
|
|
39
|
+
if (params.status) {
|
|
40
|
+
searchParams.set("status", params.status);
|
|
41
|
+
}
|
|
42
|
+
if (params.description) {
|
|
43
|
+
searchParams.set("description", params.description);
|
|
44
|
+
}
|
|
45
|
+
const query = searchParams.toString();
|
|
46
|
+
const path = query ? `/api/plans?${query}` : "/api/plans";
|
|
39
47
|
const response = await this.request("GET", path);
|
|
40
48
|
return response.plans;
|
|
41
49
|
}
|