@gempack/squad-mcp 0.5.0 → 0.6.0
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/.claude-plugin/marketplace.json +2 -2
- package/.claude-plugin/plugin.json +3 -2
- package/CHANGELOG.md +260 -17
- package/INSTALL.md +156 -24
- package/README.md +279 -27
- package/agents/{PO.md → product-owner.md} +33 -1
- package/agents/{Senior-Architect.md → senior-architect.md} +33 -1
- package/agents/{Senior-DBA.md → senior-dba.md} +33 -1
- package/agents/{Senior-Dev-Reviewer.md → senior-dev-reviewer.md} +33 -1
- package/agents/{Senior-Dev-Security.md → senior-dev-security.md} +33 -1
- package/agents/{Senior-Developer.md → senior-developer.md} +33 -1
- package/agents/{Senior-QA.md → senior-qa.md} +33 -1
- package/agents/{TechLead-Consolidator.md → tech-lead-consolidator.md} +7 -1
- package/agents/{TechLead-Planner.md → tech-lead-planner.md} +7 -1
- package/commands/squad-review.md +10 -58
- package/commands/squad.md +11 -70
- package/dist/config/ownership-matrix.d.ts +24 -2
- package/dist/config/ownership-matrix.js +466 -139
- package/dist/config/ownership-matrix.js.map +1 -1
- package/dist/config/squad-yaml.d.ts +242 -0
- package/dist/config/squad-yaml.js +403 -0
- package/dist/config/squad-yaml.js.map +1 -0
- package/dist/errors.d.ts +1 -1
- package/dist/errors.js +1 -1
- package/dist/errors.js.map +1 -1
- package/dist/format/pr-review.d.ts +61 -0
- package/dist/format/pr-review.js +146 -0
- package/dist/format/pr-review.js.map +1 -0
- package/dist/index.js +19 -13
- package/dist/index.js.map +1 -1
- package/dist/learning/format.d.ts +29 -0
- package/dist/learning/format.js +55 -0
- package/dist/learning/format.js.map +1 -0
- package/dist/learning/store.d.ts +102 -0
- package/dist/learning/store.js +169 -0
- package/dist/learning/store.js.map +1 -0
- package/dist/resources/agent-loader.d.ts +1 -1
- package/dist/resources/agent-loader.js +53 -40
- package/dist/resources/agent-loader.js.map +1 -1
- package/dist/tasks/select.d.ts +64 -0
- package/dist/tasks/select.js +84 -0
- package/dist/tasks/select.js.map +1 -0
- package/dist/tasks/store.d.ts +338 -0
- package/dist/tasks/store.js +321 -0
- package/dist/tasks/store.js.map +1 -0
- package/dist/tools/compose-advisory-bundle.d.ts +5 -5
- package/dist/tools/compose-advisory-bundle.js +24 -12
- package/dist/tools/compose-advisory-bundle.js.map +1 -1
- package/dist/tools/compose-prd-parse.d.ts +53 -0
- package/dist/tools/compose-prd-parse.js +167 -0
- package/dist/tools/compose-prd-parse.js.map +1 -0
- package/dist/tools/compose-squad-workflow.d.ts +28 -10
- package/dist/tools/compose-squad-workflow.js +0 -0
- package/dist/tools/compose-squad-workflow.js.map +1 -1
- package/dist/tools/consolidate.d.ts +55 -4
- package/dist/tools/consolidate.js +87 -15
- package/dist/tools/consolidate.js.map +1 -1
- package/dist/tools/expand-task.d.ts +51 -0
- package/dist/tools/expand-task.js +35 -0
- package/dist/tools/expand-task.js.map +1 -0
- package/dist/tools/list-tasks.d.ts +31 -0
- package/dist/tools/list-tasks.js +50 -0
- package/dist/tools/list-tasks.js.map +1 -0
- package/dist/tools/next-task.d.ts +37 -0
- package/dist/tools/next-task.js +60 -0
- package/dist/tools/next-task.js.map +1 -0
- package/dist/tools/read-learnings.d.ts +53 -0
- package/dist/tools/read-learnings.js +72 -0
- package/dist/tools/read-learnings.js.map +1 -0
- package/dist/tools/read-squad-config.d.ts +23 -0
- package/dist/tools/read-squad-config.js +34 -0
- package/dist/tools/read-squad-config.js.map +1 -0
- package/dist/tools/record-learning.d.ts +62 -0
- package/dist/tools/record-learning.js +80 -0
- package/dist/tools/record-learning.js.map +1 -0
- package/dist/tools/record-tasks.d.ts +71 -0
- package/dist/tools/record-tasks.js +45 -0
- package/dist/tools/record-tasks.js.map +1 -0
- package/dist/tools/registry.d.ts +1 -1
- package/dist/tools/registry.js +71 -39
- package/dist/tools/registry.js.map +1 -1
- package/dist/tools/score-rubric.d.ts +74 -0
- package/dist/tools/score-rubric.js +140 -0
- package/dist/tools/score-rubric.js.map +1 -0
- package/dist/tools/slice-files-for-task.d.ts +31 -0
- package/dist/tools/slice-files-for-task.js +52 -0
- package/dist/tools/slice-files-for-task.js.map +1 -0
- package/dist/tools/update-task-status.d.ts +29 -0
- package/dist/tools/update-task-status.js +35 -0
- package/dist/tools/update-task-status.js.map +1 -0
- package/package.json +4 -1
- package/skills/squad/SKILL.md +454 -0
- package/tools/post-review.mjs +212 -0
- /package/agents/{Skill-Squad-Dev.md → _shared/Skill-Squad-Dev.md} +0 -0
- /package/agents/{Skill-Squad-Review.md → _shared/Skill-Squad-Review.md} +0 -0
- /package/agents/{_Severity-and-Ownership.md → _shared/_Severity-and-Ownership.md} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compose-prd-parse.js","sourceRoot":"","sources":["../../src/tools/compose-prd-parse.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,SAAS,EAAa,MAAM,mBAAmB,CAAC;AACzD,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAE,eAAe,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AAChF,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAElE,MAAM,MAAM,GAAG,CAAC,CAAC,MAAM,CAAC;IACtB,cAAc,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC;IAC3C,4EAA4E;IAC5E,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC;IACxC,6EAA6E;IAC7E,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,CAAC,OA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G,CAAC,GAAG;QACnD,CAAC,CAAC;wDACkD,CAAC;IAEvD,MAAM,SAAS,GAAG,iBAAiB,CAAC,MAAM,CACxC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,mBAAmB,IAAI,CAAC,KAAK,wBAAwB,CACnE,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAEb,MAAM,MAAM,GAAG;;;;;;;;;;;;EAYf,IAAI,CAAC,SAAS,CAAC,aAAa,EAAE,IAAI,EAAE,CAAC,CAAC;;;;;;;;;;UAU9B,WAAW,GAAG,CAAC;cACX,KAAK,CAAC,SAAS;;;;;;iCAMI,SAAS;;;;;;;;;;;;;;;;;;;;EAoBxC,eAAe;;;;EAIf,KAAK,CAAC,QAAQ;;;;mEAImD,CAAC;IAElE,OAAO;QACL,MAAM;QACN,aAAa,EAAE,aAAa;QAC5B,QAAQ,EAAE,YAAY,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;YACvC,EAAE,EAAE,CAAC,CAAC,EAAE;YACR,KAAK,EAAE,CAAC,CAAC,KAAK;YACd,MAAM,EAAE,CAAC,CAAC,MAAM;SACjB,CAAC,CAAC;QACH,aAAa,EAAE,WAAW;QAC1B,WAAW,EAAE,0CAA0C;KACxD,CAAC;AACJ,CAAC;AAED,MAAM,CAAC,MAAM,sBAAsB,GAA2B;IAC5D,IAAI,EAAE,mBAAmB;IACzB,WAAW,EACT,oSAAoS;IACtS,MAAM;IACN,OAAO,EAAE,mBAAmB;CAC7B,CAAC"}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { z } from
|
|
2
|
-
import type { ToolDef } from
|
|
3
|
-
import { type DetectChangedFilesOutput } from
|
|
4
|
-
import { type ClassifyOutput } from
|
|
5
|
-
import { type RiskOutput } from
|
|
6
|
-
import { type SelectSquadOutput } from
|
|
7
|
-
import { type WorkType } from
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import type { ToolDef } from "./registry.js";
|
|
3
|
+
import { type DetectChangedFilesOutput } from "./detect-changed-files.js";
|
|
4
|
+
import { type ClassifyOutput } from "./classify-work-type.js";
|
|
5
|
+
import { type RiskOutput } from "./score-risk.js";
|
|
6
|
+
import { type SelectSquadOutput } from "./select-squad.js";
|
|
7
|
+
import { type AgentName, type WorkType } from "../config/ownership-matrix.js";
|
|
8
|
+
import { type ResolvedSquadConfig } from "../config/squad-yaml.js";
|
|
8
9
|
declare const schema: z.ZodObject<{
|
|
9
10
|
workspace_root: z.ZodEffects<z.ZodString, string, string>;
|
|
10
11
|
user_prompt: z.ZodEffects<z.ZodString, string, string>;
|
|
@@ -12,7 +13,7 @@ declare const schema: z.ZodObject<{
|
|
|
12
13
|
staged_only: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
13
14
|
read_content: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
14
15
|
force_work_type: z.ZodOptional<z.ZodEnum<["Feature", "Bug Fix", "Refactor", "Performance", "Security", "Business Rule"]>>;
|
|
15
|
-
force_agents: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodEnum<[
|
|
16
|
+
force_agents: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodEnum<[AgentName, ...AgentName[]]>, "many">>>;
|
|
16
17
|
risk_signals: z.ZodOptional<z.ZodObject<{
|
|
17
18
|
touches_auth: z.ZodOptional<z.ZodBoolean>;
|
|
18
19
|
touches_money: z.ZodOptional<z.ZodBoolean>;
|
|
@@ -34,7 +35,7 @@ declare const schema: z.ZodObject<{
|
|
|
34
35
|
}>>;
|
|
35
36
|
}, "strip", z.ZodTypeAny, {
|
|
36
37
|
read_content: boolean;
|
|
37
|
-
force_agents:
|
|
38
|
+
force_agents: AgentName[];
|
|
38
39
|
workspace_root: string;
|
|
39
40
|
user_prompt: string;
|
|
40
41
|
staged_only: boolean;
|
|
@@ -51,7 +52,7 @@ declare const schema: z.ZodObject<{
|
|
|
51
52
|
workspace_root: string;
|
|
52
53
|
user_prompt: string;
|
|
53
54
|
read_content?: boolean | undefined;
|
|
54
|
-
force_agents?:
|
|
55
|
+
force_agents?: AgentName[] | undefined;
|
|
55
56
|
base_ref?: string | undefined;
|
|
56
57
|
staged_only?: boolean | undefined;
|
|
57
58
|
force_work_type?: "Feature" | "Bug Fix" | "Refactor" | "Performance" | "Security" | "Business Rule" | undefined;
|
|
@@ -78,6 +79,23 @@ export interface ComposeWorkflowOutput {
|
|
|
78
79
|
new_module: boolean;
|
|
79
80
|
api_contract_change: boolean;
|
|
80
81
|
};
|
|
82
|
+
/**
|
|
83
|
+
* Resolved `.squad.yaml` config (defaults filled in). `source` is null if no
|
|
84
|
+
* config file existed in workspace_root. Downstream callers (compose_advisory_bundle,
|
|
85
|
+
* apply_consolidation_rules) can lift weights/threshold/min_score from here.
|
|
86
|
+
*/
|
|
87
|
+
config: ResolvedSquadConfig;
|
|
88
|
+
/**
|
|
89
|
+
* Files removed from advisory by `config.skip_paths`. Surfaced so callers can
|
|
90
|
+
* see *why* the slice list got narrower.
|
|
91
|
+
*/
|
|
92
|
+
skipped_paths: string[];
|
|
93
|
+
/**
|
|
94
|
+
* Agents removed from the selected squad by `config.disable_agents`. Empty
|
|
95
|
+
* unless config disabled at least one of the agents the matrix would have
|
|
96
|
+
* picked.
|
|
97
|
+
*/
|
|
98
|
+
disabled_agents: AgentName[];
|
|
81
99
|
}
|
|
82
100
|
export declare function composeSquadWorkflow(input: Input): Promise<ComposeWorkflowOutput>;
|
|
83
101
|
export declare const composeSquadWorkflowTool: ToolDef<typeof schema>;
|
|
Binary file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compose-squad-workflow.js","sourceRoot":"","sources":["../../src/tools/compose-squad-workflow.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,
|
|
1
|
+
{"version":3,"file":"compose-squad-workflow.js","sourceRoot":"","sources":["../../src/tools/compose-squad-workflow.ts"],"names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ChC,CAAC;AACJ,CAAC;AAED,MAAM,CAAC,MAAM,wBAAwB,GAA2B;IAC9D,IAAI,EAAE,wBAAwB;IAC9B,WAAW,EACT,wGAAwG;QACxG,8GAA8G;QAC9G,2GAA2G;QAC3G,uGAAuG;QACvG,sDAAsD;IACxD,MAAM;IACN,OAAO,EAAE,oBAAoB;CAC9B,CAAC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { z } from
|
|
2
|
-
import type { ToolDef } from
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import type { ToolDef } from "./registry.js";
|
|
3
|
+
import { type RubricOutput } from "./score-rubric.js";
|
|
3
4
|
declare const schema: z.ZodObject<{
|
|
4
5
|
reports: z.ZodArray<z.ZodObject<{
|
|
5
6
|
agent: z.ZodEnum<[import("../config/ownership-matrix.js").AgentName, ...import("../config/ownership-matrix.js").AgentName[]]>;
|
|
@@ -23,6 +24,14 @@ declare const schema: z.ZodObject<{
|
|
|
23
24
|
justified?: boolean | undefined;
|
|
24
25
|
}>, "many">;
|
|
25
26
|
not_evaluated: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
27
|
+
/**
|
|
28
|
+
* Optional dimension score 0-100 produced by the agent. When at least one
|
|
29
|
+
* report carries a score, the consolidator emits a rubric scorecard and the
|
|
30
|
+
* verdict can be downgraded if `min_score` is supplied. Backward compatible:
|
|
31
|
+
* pre-rubric clients omit this field and behave exactly as before.
|
|
32
|
+
*/
|
|
33
|
+
score: z.ZodOptional<z.ZodNumber>;
|
|
34
|
+
score_rationale: z.ZodOptional<z.ZodString>;
|
|
26
35
|
}, "strip", z.ZodTypeAny, {
|
|
27
36
|
agent: import("../config/ownership-matrix.js").AgentName;
|
|
28
37
|
findings: {
|
|
@@ -33,6 +42,8 @@ declare const schema: z.ZodObject<{
|
|
|
33
42
|
forwarded_to?: import("../config/ownership-matrix.js").AgentName | undefined;
|
|
34
43
|
}[];
|
|
35
44
|
not_evaluated: boolean;
|
|
45
|
+
score?: number | undefined;
|
|
46
|
+
score_rationale?: string | undefined;
|
|
36
47
|
}, {
|
|
37
48
|
agent: import("../config/ownership-matrix.js").AgentName;
|
|
38
49
|
findings: {
|
|
@@ -42,9 +53,28 @@ declare const schema: z.ZodObject<{
|
|
|
42
53
|
forwarded_to?: import("../config/ownership-matrix.js").AgentName | undefined;
|
|
43
54
|
justified?: boolean | undefined;
|
|
44
55
|
}[];
|
|
56
|
+
score?: number | undefined;
|
|
45
57
|
not_evaluated?: boolean | undefined;
|
|
58
|
+
score_rationale?: string | undefined;
|
|
46
59
|
}>, "many">;
|
|
60
|
+
/**
|
|
61
|
+
* Optional weight overrides for the rubric (sum must be 100). Forwarded to
|
|
62
|
+
* `score_rubric`. Ignored when no report carries a score.
|
|
63
|
+
*/
|
|
64
|
+
weights: z.ZodOptional<z.ZodRecord<z.ZodEnum<[import("../config/ownership-matrix.js").AgentName, ...import("../config/ownership-matrix.js").AgentName[]]>, z.ZodNumber>>;
|
|
65
|
+
/**
|
|
66
|
+
* Per-dimension threshold for flagging individual scores. Defaults to 75.
|
|
67
|
+
*/
|
|
68
|
+
threshold: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
69
|
+
/**
|
|
70
|
+
* If supplied AND the weighted score is below this floor AND severity rules
|
|
71
|
+
* would otherwise return APPROVED, downgrade to CHANGES_REQUIRED. Lets a
|
|
72
|
+
* project enforce a "minimum quality bar" beyond just absence of Blockers.
|
|
73
|
+
* Independent of `threshold` (which flags individual dimensions).
|
|
74
|
+
*/
|
|
75
|
+
min_score: z.ZodOptional<z.ZodNumber>;
|
|
47
76
|
}, "strip", z.ZodTypeAny, {
|
|
77
|
+
threshold: number;
|
|
48
78
|
reports: {
|
|
49
79
|
agent: import("../config/ownership-matrix.js").AgentName;
|
|
50
80
|
findings: {
|
|
@@ -55,7 +85,11 @@ declare const schema: z.ZodObject<{
|
|
|
55
85
|
forwarded_to?: import("../config/ownership-matrix.js").AgentName | undefined;
|
|
56
86
|
}[];
|
|
57
87
|
not_evaluated: boolean;
|
|
88
|
+
score?: number | undefined;
|
|
89
|
+
score_rationale?: string | undefined;
|
|
58
90
|
}[];
|
|
91
|
+
weights?: Partial<Record<import("../config/ownership-matrix.js").AgentName, number>> | undefined;
|
|
92
|
+
min_score?: number | undefined;
|
|
59
93
|
}, {
|
|
60
94
|
reports: {
|
|
61
95
|
agent: import("../config/ownership-matrix.js").AgentName;
|
|
@@ -66,12 +100,17 @@ declare const schema: z.ZodObject<{
|
|
|
66
100
|
forwarded_to?: import("../config/ownership-matrix.js").AgentName | undefined;
|
|
67
101
|
justified?: boolean | undefined;
|
|
68
102
|
}[];
|
|
103
|
+
score?: number | undefined;
|
|
69
104
|
not_evaluated?: boolean | undefined;
|
|
105
|
+
score_rationale?: string | undefined;
|
|
70
106
|
}[];
|
|
107
|
+
weights?: Partial<Record<import("../config/ownership-matrix.js").AgentName, number>> | undefined;
|
|
108
|
+
threshold?: number | undefined;
|
|
109
|
+
min_score?: number | undefined;
|
|
71
110
|
}>;
|
|
72
111
|
type Input = z.infer<typeof schema>;
|
|
73
|
-
export type Verdict =
|
|
74
|
-
export type Severity =
|
|
112
|
+
export type Verdict = "APPROVED" | "CHANGES_REQUIRED" | "REJECTED";
|
|
113
|
+
export type Severity = "Blocker" | "Major" | "Minor" | "Suggestion";
|
|
75
114
|
export interface ConsolidationOutput {
|
|
76
115
|
verdict: Verdict;
|
|
77
116
|
blockers: {
|
|
@@ -91,6 +130,18 @@ export interface ConsolidationOutput {
|
|
|
91
130
|
severity_counts: Record<Severity, number>;
|
|
92
131
|
agents_involved: string[];
|
|
93
132
|
summary: string;
|
|
133
|
+
/**
|
|
134
|
+
* Weighted-rubric scorecard if any report carried a score, else null.
|
|
135
|
+
* Independent of verdict — verdict logic preserves the legacy severity rules,
|
|
136
|
+
* extended only by the optional `min_score` floor.
|
|
137
|
+
*/
|
|
138
|
+
rubric: RubricOutput | null;
|
|
139
|
+
/**
|
|
140
|
+
* True iff the verdict was downgraded from APPROVED to CHANGES_REQUIRED
|
|
141
|
+
* because the weighted score fell below `min_score`. Helps callers explain
|
|
142
|
+
* the downgrade in their output.
|
|
143
|
+
*/
|
|
144
|
+
downgraded_by_score: boolean;
|
|
94
145
|
}
|
|
95
146
|
export declare function applyConsolidationRules(input: Input): ConsolidationOutput;
|
|
96
147
|
export declare const applyConsolidationRulesTool: ToolDef<typeof schema>;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { z } from
|
|
2
|
-
import { AGENT_NAMES_TUPLE } from
|
|
3
|
-
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { AGENT_NAMES_TUPLE } from "../config/ownership-matrix.js";
|
|
3
|
+
import { scoreRubric } from "./score-rubric.js";
|
|
4
|
+
const severity = z.enum(["Blocker", "Major", "Minor", "Suggestion"]);
|
|
4
5
|
const reportSchema = z.object({
|
|
5
6
|
agent: z.enum(AGENT_NAMES_TUPLE),
|
|
6
7
|
findings: z
|
|
@@ -13,9 +14,35 @@ const reportSchema = z.object({
|
|
|
13
14
|
}))
|
|
14
15
|
.max(500),
|
|
15
16
|
not_evaluated: z.boolean().optional().default(false),
|
|
17
|
+
/**
|
|
18
|
+
* Optional dimension score 0-100 produced by the agent. When at least one
|
|
19
|
+
* report carries a score, the consolidator emits a rubric scorecard and the
|
|
20
|
+
* verdict can be downgraded if `min_score` is supplied. Backward compatible:
|
|
21
|
+
* pre-rubric clients omit this field and behave exactly as before.
|
|
22
|
+
*/
|
|
23
|
+
score: z.number().min(0).max(100).optional(),
|
|
24
|
+
score_rationale: z.string().max(2048).optional(),
|
|
16
25
|
});
|
|
17
26
|
const schema = z.object({
|
|
18
27
|
reports: z.array(reportSchema).max(50),
|
|
28
|
+
/**
|
|
29
|
+
* Optional weight overrides for the rubric (sum must be 100). Forwarded to
|
|
30
|
+
* `score_rubric`. Ignored when no report carries a score.
|
|
31
|
+
*/
|
|
32
|
+
weights: z
|
|
33
|
+
.record(z.enum(AGENT_NAMES_TUPLE), z.number().min(0).max(100))
|
|
34
|
+
.optional(),
|
|
35
|
+
/**
|
|
36
|
+
* Per-dimension threshold for flagging individual scores. Defaults to 75.
|
|
37
|
+
*/
|
|
38
|
+
threshold: z.number().min(0).max(100).optional().default(75),
|
|
39
|
+
/**
|
|
40
|
+
* If supplied AND the weighted score is below this floor AND severity rules
|
|
41
|
+
* would otherwise return APPROVED, downgrade to CHANGES_REQUIRED. Lets a
|
|
42
|
+
* project enforce a "minimum quality bar" beyond just absence of Blockers.
|
|
43
|
+
* Independent of `threshold` (which flags individual dimensions).
|
|
44
|
+
*/
|
|
45
|
+
min_score: z.number().min(0).max(100).optional(),
|
|
19
46
|
});
|
|
20
47
|
export function applyConsolidationRules(input) {
|
|
21
48
|
const blockers = [];
|
|
@@ -23,7 +50,12 @@ export function applyConsolidationRules(input) {
|
|
|
23
50
|
const forwarded = [];
|
|
24
51
|
const notEvaluated = [];
|
|
25
52
|
const agentsInvolved = new Set();
|
|
26
|
-
const counts = {
|
|
53
|
+
const counts = {
|
|
54
|
+
Blocker: 0,
|
|
55
|
+
Major: 0,
|
|
56
|
+
Minor: 0,
|
|
57
|
+
Suggestion: 0,
|
|
58
|
+
};
|
|
27
59
|
for (const r of input.reports) {
|
|
28
60
|
agentsInvolved.add(r.agent);
|
|
29
61
|
if (r.not_evaluated) {
|
|
@@ -32,27 +64,62 @@ export function applyConsolidationRules(input) {
|
|
|
32
64
|
}
|
|
33
65
|
for (const f of r.findings) {
|
|
34
66
|
counts[f.severity] += 1;
|
|
35
|
-
if (f.severity ===
|
|
67
|
+
if (f.severity === "Blocker")
|
|
36
68
|
blockers.push({ agent: r.agent, title: f.title });
|
|
37
|
-
if (f.severity ===
|
|
69
|
+
if (f.severity === "Major" && !f.justified)
|
|
38
70
|
majorsUnjustified.push({ agent: r.agent, title: f.title });
|
|
39
71
|
if (f.forwarded_to)
|
|
40
72
|
forwarded.push({ from: r.agent, to: f.forwarded_to, title: f.title });
|
|
41
73
|
}
|
|
42
74
|
}
|
|
75
|
+
// Compute rubric only if at least one report carried a score. Avoids
|
|
76
|
+
// disrupting legacy callers that never opted in.
|
|
77
|
+
const scoredReports = input.reports.filter((r) => typeof r.score === "number" && !r.not_evaluated);
|
|
78
|
+
let rubric = null;
|
|
79
|
+
if (scoredReports.length > 0) {
|
|
80
|
+
rubric = scoreRubric({
|
|
81
|
+
scores: scoredReports.map((r) => ({
|
|
82
|
+
agent: r.agent,
|
|
83
|
+
score: r.score,
|
|
84
|
+
rationale: r.score_rationale,
|
|
85
|
+
})),
|
|
86
|
+
weights: input.weights,
|
|
87
|
+
threshold: input.threshold,
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
// Severity rules (legacy, unchanged)
|
|
43
91
|
let verdict;
|
|
44
92
|
if (blockers.length)
|
|
45
|
-
verdict =
|
|
93
|
+
verdict = "REJECTED";
|
|
46
94
|
else if (majorsUnjustified.length)
|
|
47
|
-
verdict =
|
|
95
|
+
verdict = "REJECTED";
|
|
48
96
|
else if (counts.Major + counts.Minor > 0)
|
|
49
|
-
verdict =
|
|
97
|
+
verdict = "CHANGES_REQUIRED";
|
|
50
98
|
else
|
|
51
|
-
verdict =
|
|
99
|
+
verdict = "APPROVED";
|
|
100
|
+
// Optional score floor: APPROVED with weighted_score < min_score → CHANGES_REQUIRED.
|
|
101
|
+
// Never PROMOTES a verdict (a low score doesn't override a Blocker rejection),
|
|
102
|
+
// and never demotes below CHANGES_REQUIRED.
|
|
103
|
+
let downgradedByScore = false;
|
|
104
|
+
if (typeof input.min_score === "number" &&
|
|
105
|
+
rubric !== null &&
|
|
106
|
+
verdict === "APPROVED" &&
|
|
107
|
+
rubric.weighted_score < input.min_score) {
|
|
108
|
+
verdict = "CHANGES_REQUIRED";
|
|
109
|
+
downgradedByScore = true;
|
|
110
|
+
}
|
|
111
|
+
const scoreSummary = rubric
|
|
112
|
+
? ` Weighted score: ${rubric.weighted_score.toFixed(1)}/100${rubric.passes_threshold ? "" : " (below threshold)"}.`
|
|
113
|
+
: "";
|
|
114
|
+
const downgradeSummary = downgradedByScore
|
|
115
|
+
? ` Downgraded from APPROVED to CHANGES_REQUIRED because weighted score < min_score (${input.min_score}).`
|
|
116
|
+
: "";
|
|
52
117
|
const summary = `Verdict: ${verdict}. ` +
|
|
53
118
|
`${blockers.length} blocker(s), ${majorsUnjustified.length} unjustified major(s), ` +
|
|
54
119
|
`${forwarded.length} forwarded item(s), ${notEvaluated.length} agent(s) not evaluated. ` +
|
|
55
|
-
`Severity counts: ${counts.Blocker} blocker / ${counts.Major} major / ${counts.Minor} minor / ${counts.Suggestion} suggestion
|
|
120
|
+
`Severity counts: ${counts.Blocker} blocker / ${counts.Major} major / ${counts.Minor} minor / ${counts.Suggestion} suggestion.` +
|
|
121
|
+
scoreSummary +
|
|
122
|
+
downgradeSummary;
|
|
56
123
|
return {
|
|
57
124
|
verdict,
|
|
58
125
|
blockers,
|
|
@@ -62,13 +129,18 @@ export function applyConsolidationRules(input) {
|
|
|
62
129
|
severity_counts: counts,
|
|
63
130
|
agents_involved: Array.from(agentsInvolved).sort(),
|
|
64
131
|
summary,
|
|
132
|
+
rubric,
|
|
133
|
+
downgraded_by_score: downgradedByScore,
|
|
65
134
|
};
|
|
66
135
|
}
|
|
67
136
|
export const applyConsolidationRulesTool = {
|
|
68
|
-
name:
|
|
69
|
-
description:
|
|
70
|
-
|
|
71
|
-
|
|
137
|
+
name: "apply_consolidation_rules",
|
|
138
|
+
description: "Aggregate advisory reports and emit a verdict per the rules in _shared/_Severity-and-Ownership.md. " +
|
|
139
|
+
"Blocker -> REJECTED. Unjustified Major -> REJECTED. Otherwise CHANGES_REQUIRED or APPROVED. " +
|
|
140
|
+
"When reports carry per-dimension scores (0-100), also returns a weighted rubric scorecard " +
|
|
141
|
+
"(see score_rubric). Optional `min_score` downgrades APPROVED to CHANGES_REQUIRED if the " +
|
|
142
|
+
"weighted score is below the floor — useful for projects that want a quality bar beyond " +
|
|
143
|
+
"absence of blockers. Includes severity_counts and agents_involved for downstream summarization.",
|
|
72
144
|
schema,
|
|
73
145
|
handler: applyConsolidationRules,
|
|
74
146
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"consolidate.js","sourceRoot":"","sources":["../../src/tools/consolidate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;
|
|
1
|
+
{"version":3,"file":"consolidate.js","sourceRoot":"","sources":["../../src/tools/consolidate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAClE,OAAO,EAAE,WAAW,EAAqB,MAAM,mBAAmB,CAAC;AAEnE,MAAM,QAAQ,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,SAAS,EAAE,OAAO,EAAE,OAAO,EAAE,YAAY,CAAC,CAAC,CAAC;AAErE,MAAM,YAAY,GAAG,CAAC,CAAC,MAAM,CAAC;IAC5B,KAAK,EAAE,CAAC,CAAC,IAAI,CAAC,iBAAiB,CAAC;IAChC,QAAQ,EAAE,CAAC;SACR,KAAK,CACJ,CAAC,CAAC,MAAM,CAAC;QACP,QAAQ;QACR,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC;QAC3B,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE;QACvC,YAAY,EAAE,CAAC,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAC,QAAQ,EAAE;QAClD,SAAS,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC;KACjD,CAAC,CACH;SACA,GAAG,CAAC,GAAG,CAAC;IACX,aAAa,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE,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AAC,EAAE,CAAC;IACP,MAAM,gBAAgB,GAAG,iBAAiB;QACxC,CAAC,CAAC,qFAAqF,KAAK,CAAC,SAAS,IAAI;QAC1G,CAAC,CAAC,EAAE,CAAC;IACP,MAAM,OAAO,GACX,YAAY,OAAO,IAAI;QACvB,GAAG,QAAQ,CAAC,MAAM,gBAAgB,iBAAiB,CAAC,MAAM,yBAAyB;QACnF,GAAG,SAAS,CAAC,MAAM,uBAAuB,YAAY,CAAC,MAAM,2BAA2B;QACxF,oBAAoB,MAAM,CAAC,OAAO,cAAc,MAAM,CAAC,KAAK,YAAY,MAAM,CAAC,KAAK,YAAY,MAAM,CAAC,UAAU,cAAc;QAC/H,YAAY;QACZ,gBAAgB,CAAC;IAEnB,OAAO;QACL,OAAO;QACP,QAAQ;QACR,kBAAkB,EAAE,iBAAiB;QACrC,SAAS;QACT,aAAa,EAAE,YAAY;QAC3B,eAAe,EAAE,MAAM;QACvB,eAAe,EAAE,KAAK,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC,IAAI,EAAE;QAClD,OAAO;QACP,MAAM;QACN,mBAAmB,EAAE,iBAAiB;KACvC,CAAC;AACJ,CAAC;AAED,MAAM,CAAC,MAAM,2BAA2B,GAA2B;IACjE,IAAI,EAAE,2BAA2B;IACjC,WAAW,EACT,qGAAqG;QACrG,8FAA8F;QAC9F,4FAA4F;QAC5F,0FAA0F;QAC1F,yFAAyF;QACzF,iGAAiG;IACnG,MAAM;IACN,OAAO,EAAE,uBAAuB;CACjC,CAAC"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import type { ToolDef } from "./registry.js";
|
|
3
|
+
import { type Task } from "../tasks/store.js";
|
|
4
|
+
declare const schema: z.ZodObject<{
|
|
5
|
+
workspace_root: z.ZodString;
|
|
6
|
+
task_id: z.ZodNumber;
|
|
7
|
+
subtasks: z.ZodArray<z.ZodObject<{
|
|
8
|
+
title: z.ZodString;
|
|
9
|
+
description: z.ZodOptional<z.ZodString>;
|
|
10
|
+
/** Reference sibling subtasks by id (assigned in input order, starting at max+1). */
|
|
11
|
+
dependencies: z.ZodOptional<z.ZodArray<z.ZodNumber, "many">>;
|
|
12
|
+
details: z.ZodOptional<z.ZodString>;
|
|
13
|
+
}, "strip", z.ZodTypeAny, {
|
|
14
|
+
title: string;
|
|
15
|
+
details?: string | undefined;
|
|
16
|
+
description?: string | undefined;
|
|
17
|
+
dependencies?: number[] | undefined;
|
|
18
|
+
}, {
|
|
19
|
+
title: string;
|
|
20
|
+
details?: string | undefined;
|
|
21
|
+
description?: string | undefined;
|
|
22
|
+
dependencies?: number[] | undefined;
|
|
23
|
+
}>, "many">;
|
|
24
|
+
}, "strip", z.ZodTypeAny, {
|
|
25
|
+
workspace_root: string;
|
|
26
|
+
subtasks: {
|
|
27
|
+
title: string;
|
|
28
|
+
details?: string | undefined;
|
|
29
|
+
description?: string | undefined;
|
|
30
|
+
dependencies?: number[] | undefined;
|
|
31
|
+
}[];
|
|
32
|
+
task_id: number;
|
|
33
|
+
}, {
|
|
34
|
+
workspace_root: string;
|
|
35
|
+
subtasks: {
|
|
36
|
+
title: string;
|
|
37
|
+
details?: string | undefined;
|
|
38
|
+
description?: string | undefined;
|
|
39
|
+
dependencies?: number[] | undefined;
|
|
40
|
+
}[];
|
|
41
|
+
task_id: number;
|
|
42
|
+
}>;
|
|
43
|
+
type Input = z.infer<typeof schema>;
|
|
44
|
+
export interface ExpandTaskOutput {
|
|
45
|
+
expanded: true;
|
|
46
|
+
file: string;
|
|
47
|
+
task: Task;
|
|
48
|
+
}
|
|
49
|
+
export declare function expandTaskTool(input: Input): Promise<ExpandTaskOutput>;
|
|
50
|
+
export declare const expandTaskToolDef: ToolDef<typeof schema>;
|
|
51
|
+
export {};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { expandTask } from "../tasks/store.js";
|
|
3
|
+
import { readSquadYaml } from "../config/squad-yaml.js";
|
|
4
|
+
import { resolveSafePath, createSafePathContext } from "../util/path-safety.js";
|
|
5
|
+
const subtaskInputSchema = z.object({
|
|
6
|
+
title: z.string().min(1).max(512),
|
|
7
|
+
description: z.string().max(4096).optional(),
|
|
8
|
+
/** Reference sibling subtasks by id (assigned in input order, starting at max+1). */
|
|
9
|
+
dependencies: z.array(z.number().int().positive()).max(50).optional(),
|
|
10
|
+
details: z.string().max(8192).optional(),
|
|
11
|
+
});
|
|
12
|
+
const schema = z.object({
|
|
13
|
+
workspace_root: z.string().min(1).max(4096),
|
|
14
|
+
task_id: z.number().int().positive(),
|
|
15
|
+
subtasks: z.array(subtaskInputSchema).min(1).max(50),
|
|
16
|
+
});
|
|
17
|
+
export async function expandTaskTool(input) {
|
|
18
|
+
const ctx = createSafePathContext();
|
|
19
|
+
const safeRoot = await resolveSafePath(input.workspace_root, ".", ctx);
|
|
20
|
+
const config = await readSquadYaml(safeRoot);
|
|
21
|
+
const result = await expandTask(safeRoot, input.task_id, input.subtasks.map((s) => ({
|
|
22
|
+
title: s.title,
|
|
23
|
+
...(s.description !== undefined && { description: s.description }),
|
|
24
|
+
...(s.dependencies !== undefined && { dependencies: s.dependencies }),
|
|
25
|
+
...(s.details !== undefined && { details: s.details }),
|
|
26
|
+
})), { configuredPath: config.tasks.path });
|
|
27
|
+
return { expanded: true, file: result.filePath, task: result.task };
|
|
28
|
+
}
|
|
29
|
+
export const expandTaskToolDef = {
|
|
30
|
+
name: "expand_task",
|
|
31
|
+
description: "Append subtasks to an existing task. Mechanical only — the caller (skill or LLM) supplies the subtask inputs. Subtask ids allocated sequentially starting from `max(existing.subtasks.id) + 1`. Side-effecting, atomic write.",
|
|
32
|
+
schema,
|
|
33
|
+
handler: expandTaskTool,
|
|
34
|
+
};
|
|
35
|
+
//# sourceMappingURL=expand-task.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"expand-task.js","sourceRoot":"","sources":["../../src/tools/expand-task.ts"],"names":[],"mappings":"AAAA,OAAO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CAAC,KAAK,CAAC,cAAc,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;IACvE,MAAM,MAAM,GAAG,MAAM,aAAa,CAAC,QAAQ,CAAC,CAAC;IAE7C,MAAM,MAAM,GAAG,MAAM,UAAU,CAC7B,QAAQ,EACR,KAAK,CAAC,OAAO,EACb,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;QACzB,KAAK,EAAE,CAAC,CAAC,KAAK;QACd,GAAG,CAAC,CAAC,CAAC,WAAW,KAAK,SAAS,IAAI,EAAE,WAAW,EAAE,CAAC,CAAC,WAAW,EAAE,CAAC;QAClE,GAAG,CAAC,CAAC,CAAC,YAAY,KAAK,SAAS,IAAI,EAAE,YAAY,EAAE,CAAC,CAAC,YAAY,EAAE,CAAC;QACrE,GAAG,CAAC,CAAC,CAAC,OAAO,KAAK,SAAS,IAAI,EAAE,OAAO,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC;KACvD,CAAC,CAAC,EACH,EAAE,cAAc,EAAE,MAAM,CAAC,KAAK,CAAC,IAAI,EAAE,CACtC,CAAC;IAEF,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,CAAC,QAAQ,EAAE,IAAI,EAAE,MAAM,CAAC,IAAI,EAAE,CAAC;AACtE,CAAC;AAED,MAAM,CAAC,MAAM,iBAAiB,GAA2B;IACvD,IAAI,EAAE,aAAa;IACnB,WAAW,EACT,+NAA+N;IACjO,MAAM;IACN,OAAO,EAAE,cAAc;CACxB,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import type { ToolDef } from "./registry.js";
|
|
3
|
+
import { type Task } from "../tasks/store.js";
|
|
4
|
+
declare const schema: z.ZodObject<{
|
|
5
|
+
workspace_root: z.ZodString;
|
|
6
|
+
status: z.ZodOptional<z.ZodArray<z.ZodEnum<["pending", "in-progress", "review", "done", "blocked", "cancelled"]>, "many">>;
|
|
7
|
+
agent: z.ZodOptional<z.ZodEnum<[import("../config/ownership-matrix.js").AgentName, ...import("../config/ownership-matrix.js").AgentName[]]>>;
|
|
8
|
+
changed_files: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
9
|
+
limit: z.ZodOptional<z.ZodNumber>;
|
|
10
|
+
}, "strip", z.ZodTypeAny, {
|
|
11
|
+
workspace_root: string;
|
|
12
|
+
status?: ("pending" | "in-progress" | "review" | "done" | "blocked" | "cancelled")[] | undefined;
|
|
13
|
+
agent?: import("../config/ownership-matrix.js").AgentName | undefined;
|
|
14
|
+
limit?: number | undefined;
|
|
15
|
+
changed_files?: string[] | undefined;
|
|
16
|
+
}, {
|
|
17
|
+
workspace_root: string;
|
|
18
|
+
status?: ("pending" | "in-progress" | "review" | "done" | "blocked" | "cancelled")[] | undefined;
|
|
19
|
+
agent?: import("../config/ownership-matrix.js").AgentName | undefined;
|
|
20
|
+
limit?: number | undefined;
|
|
21
|
+
changed_files?: string[] | undefined;
|
|
22
|
+
}>;
|
|
23
|
+
type Input = z.infer<typeof schema>;
|
|
24
|
+
export interface ListTasksOutput {
|
|
25
|
+
tasks: Task[];
|
|
26
|
+
total_in_store: number;
|
|
27
|
+
source: string | null;
|
|
28
|
+
}
|
|
29
|
+
export declare function listTasksTool(input: Input): Promise<ListTasksOutput>;
|
|
30
|
+
export declare const listTasksToolDef: ToolDef<typeof schema>;
|
|
31
|
+
export {};
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { readTasks } from "../tasks/store.js";
|
|
3
|
+
import { listTasks as listTasksFn } from "../tasks/select.js";
|
|
4
|
+
import { readSquadYaml } from "../config/squad-yaml.js";
|
|
5
|
+
import { resolveSafePath, createSafePathContext } from "../util/path-safety.js";
|
|
6
|
+
import { AGENT_NAMES_TUPLE } from "../config/ownership-matrix.js";
|
|
7
|
+
const taskStatusEnum = z.enum([
|
|
8
|
+
"pending",
|
|
9
|
+
"in-progress",
|
|
10
|
+
"review",
|
|
11
|
+
"done",
|
|
12
|
+
"blocked",
|
|
13
|
+
"cancelled",
|
|
14
|
+
]);
|
|
15
|
+
const schema = z.object({
|
|
16
|
+
workspace_root: z.string().min(1).max(4096),
|
|
17
|
+
status: z.array(taskStatusEnum).max(6).optional(),
|
|
18
|
+
agent: z.enum(AGENT_NAMES_TUPLE).optional(),
|
|
19
|
+
changed_files: z.array(z.string().min(1).max(4096)).max(5000).optional(),
|
|
20
|
+
limit: z.number().int().positive().max(2000).optional(),
|
|
21
|
+
});
|
|
22
|
+
export async function listTasksTool(input) {
|
|
23
|
+
const ctx = createSafePathContext();
|
|
24
|
+
const safeRoot = await resolveSafePath(input.workspace_root, ".", ctx);
|
|
25
|
+
const config = await readSquadYaml(safeRoot);
|
|
26
|
+
if (!config.tasks.enabled) {
|
|
27
|
+
return { tasks: [], total_in_store: 0, source: null };
|
|
28
|
+
}
|
|
29
|
+
const file = await readTasks(safeRoot, { configuredPath: config.tasks.path });
|
|
30
|
+
const filtered = listTasksFn(file.tasks, {
|
|
31
|
+
...(input.status !== undefined && { status: input.status }),
|
|
32
|
+
...(input.agent !== undefined && { agent: input.agent }),
|
|
33
|
+
...(input.changed_files !== undefined && {
|
|
34
|
+
changed_files: input.changed_files,
|
|
35
|
+
}),
|
|
36
|
+
...(input.limit !== undefined && { limit: input.limit }),
|
|
37
|
+
});
|
|
38
|
+
return {
|
|
39
|
+
tasks: filtered,
|
|
40
|
+
total_in_store: file.tasks.length,
|
|
41
|
+
source: file.tasks.length > 0 ? `${safeRoot}/${config.tasks.path}` : null,
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
export const listTasksToolDef = {
|
|
45
|
+
name: "list_tasks",
|
|
46
|
+
description: "List tasks from `.squad/tasks.json` with optional filters (status, agent, changed_files glob match against task.scope). Returns the filtered tasks plus the total count in the store.",
|
|
47
|
+
schema,
|
|
48
|
+
handler: listTasksTool,
|
|
49
|
+
};
|
|
50
|
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AQ,IAAI,MAAM,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,IAAI;KAC1E,CAAC;AACJ,CAAC;AAED,MAAM,CAAC,MAAM,gBAAgB,GAA2B;IACtD,IAAI,EAAE,YAAY;IAClB,WAAW,EACT,uLAAuL;IACzL,MAAM;IACN,OAAO,EAAE,aAAa;CACvB,CAAC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import type { ToolDef } from "./registry.js";
|
|
3
|
+
import { type Task } from "../tasks/store.js";
|
|
4
|
+
declare const schema: z.ZodObject<{
|
|
5
|
+
workspace_root: z.ZodString;
|
|
6
|
+
agent: z.ZodOptional<z.ZodEnum<[import("../config/ownership-matrix.js").AgentName, ...import("../config/ownership-matrix.js").AgentName[]]>>;
|
|
7
|
+
changed_files: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
8
|
+
/** Override default candidate statuses (default `["pending"]`). */
|
|
9
|
+
candidate_statuses: z.ZodOptional<z.ZodArray<z.ZodEnum<["pending", "in-progress", "review", "done", "blocked", "cancelled"]>, "many">>;
|
|
10
|
+
/** Override what "complete" means for dep checks (default `["done"]`). */
|
|
11
|
+
done_statuses: z.ZodOptional<z.ZodArray<z.ZodEnum<["pending", "in-progress", "review", "done", "blocked", "cancelled"]>, "many">>;
|
|
12
|
+
}, "strip", z.ZodTypeAny, {
|
|
13
|
+
workspace_root: string;
|
|
14
|
+
agent?: import("../config/ownership-matrix.js").AgentName | undefined;
|
|
15
|
+
changed_files?: string[] | undefined;
|
|
16
|
+
candidate_statuses?: ("pending" | "in-progress" | "review" | "done" | "blocked" | "cancelled")[] | undefined;
|
|
17
|
+
done_statuses?: ("pending" | "in-progress" | "review" | "done" | "blocked" | "cancelled")[] | undefined;
|
|
18
|
+
}, {
|
|
19
|
+
workspace_root: string;
|
|
20
|
+
agent?: import("../config/ownership-matrix.js").AgentName | undefined;
|
|
21
|
+
changed_files?: string[] | undefined;
|
|
22
|
+
candidate_statuses?: ("pending" | "in-progress" | "review" | "done" | "blocked" | "cancelled")[] | undefined;
|
|
23
|
+
done_statuses?: ("pending" | "in-progress" | "review" | "done" | "blocked" | "cancelled")[] | undefined;
|
|
24
|
+
}>;
|
|
25
|
+
type Input = z.infer<typeof schema>;
|
|
26
|
+
export interface NextTaskOutput {
|
|
27
|
+
task: Task | null;
|
|
28
|
+
reason: "no_candidates" | "all_blocked" | "ok";
|
|
29
|
+
blocked: Array<{
|
|
30
|
+
id: number;
|
|
31
|
+
title: string;
|
|
32
|
+
missing_deps: number[];
|
|
33
|
+
}>;
|
|
34
|
+
}
|
|
35
|
+
export declare function nextTaskTool(input: Input): Promise<NextTaskOutput>;
|
|
36
|
+
export declare const nextTaskToolDef: ToolDef<typeof schema>;
|
|
37
|
+
export {};
|