@qawolf/api-contracts 0.68.0 → 0.69.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/dist/v1/agent/status.js +1 -1
- package/dist/v1/agent/status.js.map +1 -1
- package/dist/v1/index.d.ts +422 -0
- package/dist/v1/index.d.ts.map +1 -1
- package/dist/v1/index.js +2 -0
- package/dist/v1/index.js.map +1 -1
- package/dist/v1/investigation/finding.d.ts +51 -0
- package/dist/v1/investigation/finding.d.ts.map +1 -0
- package/dist/v1/investigation/finding.js +55 -0
- package/dist/v1/investigation/finding.js.map +1 -0
- package/dist/v1/investigation/findingInputFields.d.ts +14 -0
- package/dist/v1/investigation/findingInputFields.d.ts.map +1 -0
- package/dist/v1/investigation/findingInputFields.js +46 -0
- package/dist/v1/investigation/findingInputFields.js.map +1 -0
- package/dist/v1/investigation/get.d.ts +74 -0
- package/dist/v1/investigation/get.d.ts.map +1 -0
- package/dist/v1/investigation/get.js +30 -0
- package/dist/v1/investigation/get.js.map +1 -0
- package/dist/v1/investigation/index.d.ts +219 -0
- package/dist/v1/investigation/index.d.ts.map +1 -0
- package/dist/v1/investigation/index.js +7 -0
- package/dist/v1/investigation/index.js.map +1 -0
- package/dist/v1/investigation/recordFinding.d.ts +153 -0
- package/dist/v1/investigation/recordFinding.d.ts.map +1 -0
- package/dist/v1/investigation/recordFinding.js +112 -0
- package/dist/v1/investigation/recordFinding.js.map +1 -0
- package/dist/v1/mcpInputSchema.d.ts +6 -0
- package/dist/v1/mcpInputSchema.d.ts.map +1 -1
- package/dist/v1/mcpInputSchema.js +51 -20
- package/dist/v1/mcpInputSchema.js.map +1 -1
- package/dist/v1/mcpInputShape.d.ts +13 -0
- package/dist/v1/mcpInputShape.d.ts.map +1 -0
- package/dist/v1/mcpInputShape.js +31 -0
- package/dist/v1/mcpInputShape.js.map +1 -0
- package/dist/v1/mcpInputUnion.d.ts +3 -0
- package/dist/v1/mcpInputUnion.d.ts.map +1 -0
- package/dist/v1/mcpInputUnion.js +83 -0
- package/dist/v1/mcpInputUnion.js.map +1 -0
- package/dist/v1/mcpToolDescription.d.ts.map +1 -1
- package/dist/v1/mcpToolDescription.js +1 -0
- package/dist/v1/mcpToolDescription.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { issuePrioritySchema } from "../issue/index.js";
|
|
3
|
+
import { makeInvestigationFindingSchema } from "./finding.js";
|
|
4
|
+
import { answerDescription, answerTitle, bugReport, commitHash, headline, matchReason, question, summary, } from "./findingInputFields.js";
|
|
5
|
+
export const makeRecordInvestigationFindingContract = (ids) => {
|
|
6
|
+
const common = {
|
|
7
|
+
findingId: z
|
|
8
|
+
.string()
|
|
9
|
+
.regex(/^[a-z0-9]+(-[a-z0-9]+)*$/)
|
|
10
|
+
.max(80)
|
|
11
|
+
.describe("Stable per cause, in kebab-case. Recording the same id again replaces the finding."),
|
|
12
|
+
flowIds: z
|
|
13
|
+
.array(ids.flow)
|
|
14
|
+
.min(1)
|
|
15
|
+
.max(100)
|
|
16
|
+
.refine((flowIds) => new Set(flowIds).size === flowIds.length, "flowIds must be unique")
|
|
17
|
+
.describe("The failed flows in the run that share this cause. A flow moves here from any other finding."),
|
|
18
|
+
runId: ids.run,
|
|
19
|
+
sessionId: ids.chatSession.describe("The run's investigation session, the only session that records its findings. Read it from investigation.get."),
|
|
20
|
+
subSessionIds: z
|
|
21
|
+
.array(ids.chatSession)
|
|
22
|
+
.max(50)
|
|
23
|
+
.optional()
|
|
24
|
+
.describe("The sub-sessions whose work went into this finding."),
|
|
25
|
+
};
|
|
26
|
+
const input = z.discriminatedUnion("state", [
|
|
27
|
+
z.object({
|
|
28
|
+
...common,
|
|
29
|
+
headline: headline.optional(),
|
|
30
|
+
state: z.literal("investigating"),
|
|
31
|
+
summary: summary.optional(),
|
|
32
|
+
}),
|
|
33
|
+
z.object({
|
|
34
|
+
...common,
|
|
35
|
+
commitHash,
|
|
36
|
+
headline,
|
|
37
|
+
state: z.literal("fixed"),
|
|
38
|
+
summary,
|
|
39
|
+
}),
|
|
40
|
+
z.object({
|
|
41
|
+
...common,
|
|
42
|
+
commitHash,
|
|
43
|
+
headline,
|
|
44
|
+
question: question
|
|
45
|
+
.optional()
|
|
46
|
+
.describe('Defaults to "Should I update the test?".'),
|
|
47
|
+
state: z.literal("fix-proposed"),
|
|
48
|
+
summary,
|
|
49
|
+
}),
|
|
50
|
+
z.object({
|
|
51
|
+
...common,
|
|
52
|
+
...bugReport,
|
|
53
|
+
headline,
|
|
54
|
+
issueId: ids.issue.describe("The report the flows were filed under or added to."),
|
|
55
|
+
matchReason: matchReason.optional(),
|
|
56
|
+
state: z.literal("reported"),
|
|
57
|
+
summary,
|
|
58
|
+
}),
|
|
59
|
+
z.object({
|
|
60
|
+
...common,
|
|
61
|
+
...bugReport,
|
|
62
|
+
headline,
|
|
63
|
+
issueId: ids.issue
|
|
64
|
+
.optional()
|
|
65
|
+
.describe("An already open report the flows match."),
|
|
66
|
+
matchReason: matchReason.optional(),
|
|
67
|
+
priority: issuePrioritySchema,
|
|
68
|
+
question: question
|
|
69
|
+
.optional()
|
|
70
|
+
.describe('Defaults to "Is this what you expect?".'),
|
|
71
|
+
state: z.literal("report-proposed"),
|
|
72
|
+
summary,
|
|
73
|
+
}),
|
|
74
|
+
z.object({ ...common, headline, state: z.literal("flake"), summary }),
|
|
75
|
+
z.object({
|
|
76
|
+
...common,
|
|
77
|
+
bugAnswer: answerTitle.describe("The answer that means the app is wrong."),
|
|
78
|
+
bugAnswerDescription: answerDescription
|
|
79
|
+
.optional()
|
|
80
|
+
.describe("What the AI does after that answer."),
|
|
81
|
+
headline,
|
|
82
|
+
maintenanceAnswer: answerTitle.describe("The answer that means the test is out of date."),
|
|
83
|
+
maintenanceAnswerDescription: answerDescription
|
|
84
|
+
.optional()
|
|
85
|
+
.describe("What the AI does after that answer."),
|
|
86
|
+
question,
|
|
87
|
+
state: z.literal("question"),
|
|
88
|
+
summary,
|
|
89
|
+
}),
|
|
90
|
+
]);
|
|
91
|
+
const output = z.object({
|
|
92
|
+
finding: makeInvestigationFindingSchema(ids),
|
|
93
|
+
});
|
|
94
|
+
return {
|
|
95
|
+
annotations: {
|
|
96
|
+
destructiveHint: true,
|
|
97
|
+
openWorldHint: false,
|
|
98
|
+
readOnlyHint: false,
|
|
99
|
+
},
|
|
100
|
+
description: "Record what the QA Wolf AI investigating a run concluded about one cause of its failures. " +
|
|
101
|
+
'state says what it concluded: "investigating" while sub-sessions work on the flows, "fixed" once a fix is published and the flows reattempted, ' +
|
|
102
|
+
'"fix-proposed" for a committed fix waiting for a person\'s approval, "reported" once the flows are filed or added to an open report, ' +
|
|
103
|
+
'"report-proposed" for a drafted report waiting for approval, "flake" when a reattempt passed with no change, ' +
|
|
104
|
+
'and "question" when the AI can\'t tell whether the test or the app is wrong. ' +
|
|
105
|
+
"Each flow belongs to one finding at a time, and a finding a person decided can't be replaced.",
|
|
106
|
+
input,
|
|
107
|
+
kind: "write",
|
|
108
|
+
name: "investigation.recordFinding",
|
|
109
|
+
output,
|
|
110
|
+
};
|
|
111
|
+
};
|
|
112
|
+
//# sourceMappingURL=recordFinding.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"recordFinding.js","sourceRoot":"","sources":["../../../src/v1/investigation/recordFinding.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAExD,OAAO,EAAE,8BAA8B,EAAE,MAAM,cAAc,CAAC;AAC9D,OAAO,EACL,iBAAiB,EACjB,WAAW,EACX,SAAS,EACT,UAAU,EACV,QAAQ,EACR,WAAW,EACX,QAAQ,EACR,OAAO,GACR,MAAM,yBAAyB,CAAC;AAEjC,MAAM,CAAC,MAAM,sCAAsC,GAAG,CAKpD,GAMD,EAAE,EAAE;IACH,MAAM,M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C;YAClD,QAAQ;YACR,KAAK,EAAE,CAAC,CAAC,OAAO,CAAC,UAAU,CAAC;YAC5B,OAAO;SACR,CAAC;KACH,CAAC,CAAC;IAEH,MAAM,MAAM,GAAG,CAAC,CAAC,MAAM,CAAC;QACtB,OAAO,EAAE,8BAA8B,CAAC,GAAG,CAAC;KAC7C,CAAC,CAAC;IAEH,OAAO;QACL,WAAW,EAAE;YACX,eAAe,EAAE,IAAI;YACrB,aAAa,EAAE,KAAK;YACpB,YAAY,EAAE,KAAK;SACpB;QACD,WAAW,EACT,4FAA4F;YAC5F,iJAAiJ;YACjJ,uIAAuI;YACvI,+GAA+G;YAC/G,+EAA+E;YAC/E,+FAA+F;QACjG,KAAK;QACL,IAAI,EAAE,OAAO;QACb,IAAI,EAAE,6BAA6B;QACnC,MAAM;KAMP,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -5,5 +5,11 @@ export type McpInputSchema = {
|
|
|
5
5
|
required?: string[];
|
|
6
6
|
type: "object";
|
|
7
7
|
};
|
|
8
|
+
/**
|
|
9
|
+
* Converts a contract input to the JSON Schema an MCP tool advertises: always
|
|
10
|
+
* one flat object, with no `allOf`, `anyOf` or `oneOf` at the root. The
|
|
11
|
+
* contract still validates every call, so the rules a flat object cannot
|
|
12
|
+
* enforce, such as a field required for one kind only, stay enforced there.
|
|
13
|
+
*/
|
|
8
14
|
export declare function toMcpInputSchema(input: z.ZodType): McpInputSchema;
|
|
9
15
|
//# sourceMappingURL=mcpInputSchema.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mcpInputSchema.d.ts","sourceRoot":"","sources":["../../src/v1/mcpInputSchema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"mcpInputSchema.d.ts","sourceRoot":"","sources":["../../src/v1/mcpInputSchema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAaxB,MAAM,MAAM,cAAc,GAAG;IAC3B,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;IACvB,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACpC,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB,IAAI,EAAE,QAAQ,CAAC;CAChB,CAAC;AAsDF;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,CAAC,CAAC,OAAO,GAAG,cAAc,CAYjE"}
|
|
@@ -1,30 +1,61 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
2
|
+
import { declarationsOf, oneOrAll, propertyNamesOf, toSchemaObject, unique, } from "./mcpInputShape.js";
|
|
3
|
+
import { mergeDiscriminatedUnion } from "./mcpInputUnion.js";
|
|
4
|
+
const structuralKeys = new Set([
|
|
5
|
+
"$schema",
|
|
6
|
+
"allOf",
|
|
7
|
+
"anyOf",
|
|
8
|
+
"oneOf",
|
|
9
|
+
"properties",
|
|
10
|
+
"required",
|
|
11
|
+
"type",
|
|
12
|
+
]);
|
|
13
|
+
function mergeIntersection(shapes) {
|
|
14
|
+
return {
|
|
15
|
+
properties: Object.fromEntries(propertyNamesOf(shapes).map((name) => [
|
|
16
|
+
name,
|
|
17
|
+
oneOrAll(declarationsOf(shapes, name), "allOf"),
|
|
18
|
+
])),
|
|
19
|
+
required: unique(shapes.flatMap((shape) => shape.required)),
|
|
20
|
+
};
|
|
8
21
|
}
|
|
9
|
-
function
|
|
10
|
-
|
|
11
|
-
|
|
22
|
+
function toObjectShape(schema) {
|
|
23
|
+
if (schema.allOf)
|
|
24
|
+
return mergeIntersection(schema.allOf.map(toObjectShape));
|
|
25
|
+
const alternatives = schema.oneOf ?? schema.anyOf;
|
|
26
|
+
if (alternatives)
|
|
27
|
+
return mergeDiscriminatedUnion(alternatives.map(toObjectShape));
|
|
28
|
+
if (schema.type !== "object") {
|
|
29
|
+
throw Error(`An MCP tool input must be an object schema, not ${schema.type ?? "an untyped schema"}.`);
|
|
30
|
+
}
|
|
12
31
|
return {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
32
|
+
properties: Object.fromEntries(Object.entries(schema.properties ?? {}).map(([name, property]) => [
|
|
33
|
+
name,
|
|
34
|
+
toSchemaObject(property),
|
|
35
|
+
])),
|
|
36
|
+
required: schema.required ?? [],
|
|
18
37
|
};
|
|
19
38
|
}
|
|
39
|
+
function requiringWorkspaceId(shape) {
|
|
40
|
+
const declaresWorkspaceId = "workspaceId" in shape.properties;
|
|
41
|
+
if (!declaresWorkspaceId || shape.required.includes("workspaceId"))
|
|
42
|
+
return shape;
|
|
43
|
+
return { ...shape, required: [...shape.required, "workspaceId"] };
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Converts a contract input to the JSON Schema an MCP tool advertises: always
|
|
47
|
+
* one flat object, with no `allOf`, `anyOf` or `oneOf` at the root. The
|
|
48
|
+
* contract still validates every call, so the rules a flat object cannot
|
|
49
|
+
* enforce, such as a field required for one kind only, stay enforced there.
|
|
50
|
+
*/
|
|
20
51
|
export function toMcpInputSchema(input) {
|
|
21
|
-
const generated =
|
|
22
|
-
|
|
23
|
-
const
|
|
52
|
+
const generated = z.toJSONSchema(input, { io: "input" });
|
|
53
|
+
const shape = requiringWorkspaceId(toObjectShape(generated));
|
|
54
|
+
const annotations = Object.fromEntries(Object.entries(generated).filter(([key]) => !structuralKeys.has(key)));
|
|
24
55
|
return {
|
|
25
|
-
...
|
|
26
|
-
|
|
27
|
-
...(required ? { required } : {}),
|
|
56
|
+
...annotations,
|
|
57
|
+
properties: shape.properties,
|
|
58
|
+
...(shape.required.length > 0 ? { required: shape.required } : {}),
|
|
28
59
|
type: "object",
|
|
29
60
|
};
|
|
30
61
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mcpInputSchema.js","sourceRoot":"","sources":["../../src/v1/mcpInputSchema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"mcpInputSchema.js","sourceRoot":"","sources":["../../src/v1/mcpInputSchema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAGL,cAAc,EACd,QAAQ,EACR,eAAe,EACf,cAAc,EACd,MAAM,GACP,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,uBAAuB,EAAE,MAAM,oBAAoB,CAAC;AAS7D,MAAM,cAAc,GAAG,IAAI,GAAG,CAAC;IAC7B,SAAS;IACT,OAAO;IACP,OAAO;IACP,OAAO;IACP,YAAY;IACZ,UAAU;IACV,MAAM;CACP,CAAC,CAAC;AAEH,SAAS,iBAAiB,CAAC,MAAqB;IAC9C,OAAO;QACL,UAAU,EAAE,MAAM,CAAC,WAAW,CAC5B,eAAe,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC;YACpC,IAAI;YACJ,QAAQ,CAAC,cAAc,CAAC,MAAM,EAAE,IAAI,CAAC,EAAE,OAAO,CAAC;SAChD,CAAC,CACH;QACD,QAAQ,EAAE,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;KAC5D,CAAC;AACJ,CAAC;AAED,SAAS,aAAa,CAAC,MAAkB;IACvC,IAAI,MAAM,CAAC,KAAK;QAAE,OAAO,iBAAiB,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC,CAAC;IAC5E,MAAM,YAAY,GAAG,MAAM,CAAC,KAAK,IAAI,MAAM,CAAC,KAAK,CAAC;IAClD,IAAI,YAAY;QACd,OAAO,uBAAuB,CAAC,YA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,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CACtE,CAAC;IACF,OAAO;QACL,GAAG,WAAW;QACd,UAAU,EAAE,KAAK,CAAC,UAAU;QAC5B,GAAG,CAAC,KAAK,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,KAAK,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QAClE,IAAI,EAAE,QAAQ;KACf,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { z } from "zod";
|
|
2
|
+
export type JsonSchema = z.core.JSONSchema.JSONSchema;
|
|
3
|
+
export type ObjectShape = {
|
|
4
|
+
properties: Record<string, JsonSchema>;
|
|
5
|
+
required: string[];
|
|
6
|
+
};
|
|
7
|
+
export declare function unique<Item>(items: Item[]): Item[];
|
|
8
|
+
export declare function toSchemaObject(schema: z.core.JSONSchema._JSONSchema): JsonSchema;
|
|
9
|
+
export declare function propertyOf(shape: ObjectShape, name: string): JsonSchema | undefined;
|
|
10
|
+
export declare function declarationsOf(shapes: ObjectShape[], name: string): JsonSchema[];
|
|
11
|
+
export declare function propertyNamesOf(shapes: ObjectShape[]): string[];
|
|
12
|
+
export declare function oneOrAll(schemas: JsonSchema[], combinator: "allOf" | "anyOf"): JsonSchema;
|
|
13
|
+
//# sourceMappingURL=mcpInputShape.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mcpInputShape.d.ts","sourceRoot":"","sources":["../../src/v1/mcpInputShape.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAE7B,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,UAAU,CAAC;AAEtD,MAAM,MAAM,WAAW,GAAG;IACxB,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;IACvC,QAAQ,EAAE,MAAM,EAAE,CAAC;CACpB,CAAC;AAEF,wBAAgB,MAAM,CAAC,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,GAAG,IAAI,EAAE,CAElD;AASD,wBAAgB,cAAc,CAC5B,MAAM,EAAE,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,WAAW,GACpC,UAAU,CAGZ;AAED,wBAAgB,UAAU,CACxB,KAAK,EAAE,WAAW,EAClB,IAAI,EAAE,MAAM,GACX,UAAU,GAAG,SAAS,CAExB;AAED,wBAAgB,cAAc,CAC5B,MAAM,EAAE,WAAW,EAAE,EACrB,IAAI,EAAE,MAAM,GACX,UAAU,EAAE,CAKd;AAED,wBAAgB,eAAe,CAAC,MAAM,EAAE,WAAW,EAAE,GAAG,MAAM,EAAE,CAE/D;AAED,wBAAgB,QAAQ,CACtB,OAAO,EAAE,UAAU,EAAE,EACrB,UAAU,EAAE,OAAO,GAAG,OAAO,GAC5B,UAAU,CAIZ"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
export function unique(items) {
|
|
2
|
+
return [...new Set(items)];
|
|
3
|
+
}
|
|
4
|
+
function distinctSchemas(schemas) {
|
|
5
|
+
const byJson = new Map(schemas.map((schema) => [JSON.stringify(schema), schema]));
|
|
6
|
+
return [...byJson.values()];
|
|
7
|
+
}
|
|
8
|
+
export function toSchemaObject(schema) {
|
|
9
|
+
if (typeof schema !== "boolean")
|
|
10
|
+
return schema;
|
|
11
|
+
return schema ? {} : { not: {} };
|
|
12
|
+
}
|
|
13
|
+
export function propertyOf(shape, name) {
|
|
14
|
+
return Object.entries(shape.properties).find(([key]) => key === name)?.[1];
|
|
15
|
+
}
|
|
16
|
+
export function declarationsOf(shapes, name) {
|
|
17
|
+
return shapes.flatMap((shape) => {
|
|
18
|
+
const property = propertyOf(shape, name);
|
|
19
|
+
return property === undefined ? [] : [property];
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
export function propertyNamesOf(shapes) {
|
|
23
|
+
return unique(shapes.flatMap((shape) => Object.keys(shape.properties)));
|
|
24
|
+
}
|
|
25
|
+
export function oneOrAll(schemas, combinator) {
|
|
26
|
+
const [only, ...others] = distinctSchemas(schemas);
|
|
27
|
+
if (!only)
|
|
28
|
+
throw Error("Cannot merge a property no branch declares.");
|
|
29
|
+
return others.length === 0 ? only : { [combinator]: [only, ...others] };
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=mcpInputShape.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mcpInputShape.js","sourceRoot":"","sources":["../../src/v1/mcpInputShape.ts"],"names":[],"mappings":"AASA,MAAM,UAAU,MAAM,CAAO,KAAa;IACxC,OAAO,CAAC,GAAG,IAAI,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC;AAC7B,CAAC;AAED,SAAS,eAAe,CAAC,OAAqB;IAC5C,MAAM,MAAM,GAAG,IAAI,GAAG,CACpB,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC,CAAC,CAC1D,CAAC;IACF,OAAO,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC;AAC9B,CAAC;AAED,MAAM,UAAU,cAAc,CAC5B,MAAqC;IAErC,IAAI,OAAO,MAAM,KAAK,SAAS;QAAE,OAAO,MAAM,CAAC;IAC/C,OAAO,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,EAAE,EAAE,CAAC;AACnC,CAAC;AAED,MAAM,UAAU,UAAU,CACxB,KAAkB,EAClB,IAAY;IAEZ,OAAO,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,EAAE,CAAC,GAAG,KAAK,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;AAC7E,CAAC;AAED,MAAM,UAAU,cAAc,CAC5B,MAAqB,EACrB,IAAY;IAEZ,OAAO,MAAM,CAAC,OAAO,CAAC,CAAC,KAAK,EAAgB,EAAE;QAC5C,MAAM,QAAQ,GAAG,UAAU,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;QACzC,OAAO,QAAQ,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC;IAClD,CAAC,CAAC,CAAC;AACL,CAAC;AAED,MAAM,UAAU,eAAe,CAAC,MAAqB;IACnD,OAAO,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;AAC1E,CAAC;AAED,MAAM,UAAU,QAAQ,CACtB,OAAqB,EACrB,UAA6B;IAE7B,MAAM,CAAC,IAAI,EAAE,GAAG,MAAM,CAAC,GAAG,eAAe,CAAC,OAAO,CAAC,CAAC;IACnD,IAAI,CAAC,IAAI;QAAE,MAAM,KAAK,CAAC,6CAA6C,CAAC,CAAC;IACtE,OAAO,MAAM,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,UAAU,CAAC,EAAE,CAAC,IAAI,EAAE,GAAG,MAAM,CAAC,EAAE,CAAC;AAC1E,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mcpInputUnion.d.ts","sourceRoot":"","sources":["../../src/v1/mcpInputUnion.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,WAAW,EAKjB,MAAM,oBAAoB,CAAC;AA+E5B,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,WAAW,EAAE,GAAG,WAAW,CAyC1E"}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { declarationsOf, oneOrAll, propertyNamesOf, propertyOf, } from "./mcpInputShape.js";
|
|
2
|
+
function pinnedValueOf(shape, name) {
|
|
3
|
+
const pinned = propertyOf(shape, name)?.const;
|
|
4
|
+
return typeof pinned === "string" ? pinned : undefined;
|
|
5
|
+
}
|
|
6
|
+
function branchesPinnedBy(shapes, name) {
|
|
7
|
+
return shapes.flatMap((shape) => {
|
|
8
|
+
const value = pinnedValueOf(shape, name);
|
|
9
|
+
return value === undefined ? [] : [{ shape, value }];
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
function findDiscriminator(shapes) {
|
|
13
|
+
return propertyNamesOf(shapes)
|
|
14
|
+
.map((name) => ({ branches: branchesPinnedBy(shapes, name), name }))
|
|
15
|
+
.find(({ branches }) => branches.length === shapes.length &&
|
|
16
|
+
new Set(branches.map((branch) => branch.value)).size === shapes.length);
|
|
17
|
+
}
|
|
18
|
+
function listAlternatives(values) {
|
|
19
|
+
const quoted = values.map((value) => JSON.stringify(value));
|
|
20
|
+
if (quoted.length < 2)
|
|
21
|
+
return quoted.join("");
|
|
22
|
+
return `${quoted.slice(0, -1).join(", ")} or ${quoted.slice(-1).join("")}`;
|
|
23
|
+
}
|
|
24
|
+
function describeCondition(options) {
|
|
25
|
+
const { branchCount, discriminator, presentIn, requiredIn } = options;
|
|
26
|
+
const onlySome = presentIn.length < branchCount;
|
|
27
|
+
const requiredInSome = requiredIn.length > 0 && requiredIn.length < branchCount;
|
|
28
|
+
const when = (values) => `${discriminator} is ${listAlternatives(values)}`;
|
|
29
|
+
if (onlySome && requiredIn.length === presentIn.length)
|
|
30
|
+
return `Applies only when ${when(presentIn)}, and is required then.`;
|
|
31
|
+
const sentences = [
|
|
32
|
+
...(onlySome ? [`Applies only when ${when(presentIn)}.`] : []),
|
|
33
|
+
...(requiredInSome ? [`Required when ${when(requiredIn)}.`] : []),
|
|
34
|
+
];
|
|
35
|
+
return sentences.length === 0 ? undefined : sentences.join(" ");
|
|
36
|
+
}
|
|
37
|
+
function withCondition(schema, condition) {
|
|
38
|
+
if (condition === undefined)
|
|
39
|
+
return schema;
|
|
40
|
+
const description = typeof schema.description === "string"
|
|
41
|
+
? `${schema.description} ${condition}`
|
|
42
|
+
: condition;
|
|
43
|
+
return { ...schema, description };
|
|
44
|
+
}
|
|
45
|
+
function withoutPin(schema) {
|
|
46
|
+
return Object.fromEntries(Object.entries(schema).filter(([key]) => key !== "const"));
|
|
47
|
+
}
|
|
48
|
+
// The Claude API refuses a combinator at the root of a tool's input schema,
|
|
49
|
+
// and clients that flatten it themselves either drop branches or leave array
|
|
50
|
+
// fields untyped. A discriminated union keeps every branch: the discriminator
|
|
51
|
+
// becomes an enum, and a field that belongs to some branches says which.
|
|
52
|
+
export function mergeDiscriminatedUnion(shapes) {
|
|
53
|
+
const found = findDiscriminator(shapes);
|
|
54
|
+
if (found === undefined) {
|
|
55
|
+
throw Error("An MCP tool input that is a union needs a discriminator: a property every branch pins to a distinct string.");
|
|
56
|
+
}
|
|
57
|
+
const { branches, name: discriminator } = found;
|
|
58
|
+
const valuesWhere = (matches) => branches.filter(({ shape }) => matches(shape)).map(({ value }) => value);
|
|
59
|
+
const properties = propertyNamesOf(shapes).map((name) => {
|
|
60
|
+
const declared = declarationsOf(shapes, name);
|
|
61
|
+
if (name === discriminator) {
|
|
62
|
+
return [
|
|
63
|
+
name,
|
|
64
|
+
{
|
|
65
|
+
...oneOrAll(declared.map(withoutPin), "anyOf"),
|
|
66
|
+
enum: branches.map(({ value }) => value),
|
|
67
|
+
},
|
|
68
|
+
];
|
|
69
|
+
}
|
|
70
|
+
const condition = describeCondition({
|
|
71
|
+
branchCount: shapes.length,
|
|
72
|
+
discriminator,
|
|
73
|
+
presentIn: valuesWhere((shape) => propertyOf(shape, name) !== undefined),
|
|
74
|
+
requiredIn: valuesWhere((shape) => shape.required.includes(name)),
|
|
75
|
+
});
|
|
76
|
+
return [name, withCondition(oneOrAll(declared, "anyOf"), condition)];
|
|
77
|
+
});
|
|
78
|
+
return {
|
|
79
|
+
properties: Object.fromEntries(properties),
|
|
80
|
+
required: propertyNamesOf(shapes).filter((name) => shapes.every((shape) => shape.required.includes(name))),
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
//# sourceMappingURL=mcpInputUnion.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mcpInputUnion.js","sourceRoot":"","sources":["../../src/v1/mcpInputUnion.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,cAAc,EACd,QAAQ,EACR,eAAe,EACf,UAAU,GACX,MAAM,oBAAoB,CAAC;AAE5B,SAAS,aAAa,CAAC,KAAkB,EAAE,IAAY;IACrD,MAAM,MAAM,GAAG,UAAU,CAAC,KAAK,EAAE,IAAI,CAAC,EAAE,KAAK,CAAC;IAC9C,OAAO,OAAO,MAAM,KAAK,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC;AACzD,CAAC;AAID,SAAS,gBAAgB,CAAC,MAAqB,EAAE,IAAY;IAC3D,OAAO,MAAM,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,EAAE;QAC9B,MAAM,KAAK,GAAG,aAAa,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;QACzC,OAAO,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,CAAC;IACvD,CAAC,CAAC,CAAC;AACL,CAAC;AAED,SAAS,iBAAiB,CACxB,MAAqB;IAErB,OAAO,eAAe,CAAC,MAAM,CAAC;SAC3B,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,EAAE,QAAQ,EAAE,gBAAgB,CAAC,MAAM,EAAE,IAAI,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC;SACnE,IAAI,CACH,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE,CACf,QAAQ,CAAC,MAAM,KAAK,MAAM,CAAC,MAAM;QACjC,IAAI,GAAG,CAAC,QAAQ,CAAC,GAAG,CA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AAK,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,QAAQ,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CACvD;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mcpToolDescription.d.ts","sourceRoot":"","sources":["../../src/v1/mcpToolDescription.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AAC5D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAEpD,KAAK,YAAY,CAAC,IAAI,IAAI,IAAI,SAAS;IAAE,IAAI,EAAE,MAAM,IAAI,SAAS,MAAM,CAAA;CAAE,GACtE,IAAI,GACJ,IAAI,SAAS,MAAM,GACjB;KAAG,GAAG,IAAI,MAAM,IAAI,GAAG,YAAY,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;CAAE,CAAC,MAAM,IAAI,CAAC,GAC5D,KAAK,CAAC;AAEZ,MAAM,MAAM,kBAAkB,GAAG,YAAY,CAAC,OAAO,iBAAiB,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"mcpToolDescription.d.ts","sourceRoot":"","sources":["../../src/v1/mcpToolDescription.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AAC5D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAEpD,KAAK,YAAY,CAAC,IAAI,IAAI,IAAI,SAAS;IAAE,IAAI,EAAE,MAAM,IAAI,SAAS,MAAM,CAAA;CAAE,GACtE,IAAI,GACJ,IAAI,SAAS,MAAM,GACjB;KAAG,GAAG,IAAI,MAAM,IAAI,GAAG,YAAY,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;CAAE,CAAC,MAAM,IAAI,CAAC,GAC5D,KAAK,CAAC;AAEZ,MAAM,MAAM,kBAAkB,GAAG,YAAY,CAAC,OAAO,iBAAiB,CAAC,CAAC;AA6BxE,wBAAgB,uBAAuB,CACrC,QAAQ,EAAE,oBAAoB,GAC7B,MAAM,CAKR"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
const descriptionAddenda = {
|
|
2
2
|
"environment.update": "At least one of name or runConcurrencyLimit is required.",
|
|
3
3
|
"flow.list": "An empty flows array is not on its own evidence that QA Wolf lost a flow. Read emptyReason, report what it says, and claim no more than it establishes.",
|
|
4
|
+
"investigation.recordFinding": "Read investigation.get first, and keep one findingId per cause: recording it again replaces the finding instead of adding one.",
|
|
4
5
|
"issue.update": "At least one of description, name, priority or status is required.",
|
|
5
6
|
"run.create": "At least one flow or tag is required, so send flowIds, tagNames, or both. Send at most one of aiTaskId and chatSessionId. This call has no idempotency key, so a lost response cannot be safely resubmitted: read run.find before sending it again.",
|
|
6
7
|
"run.get": 'Read a run with flowStatuses: ["failed"] first. A flow that passed on a retry reads passed, so when the flow you want is missing, add "passed" to the filter.',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mcpToolDescription.js","sourceRoot":"","sources":["../../src/v1/mcpToolDescription.ts"],"names":[],"mappings":"AAWA,MAAM,kBAAkB,GAAgD;IACtE,oBAAoB,EAClB,0DAA0D;IAC5D,WAAW,EACT,yJAAyJ;IAC3J,cAAc,EACZ,oEAAoE;IACtE,YAAY,EACV,qPAAqP;IACvP,SAAS,EACP,+JAA+J;IACjK,sBAAsB,EACpB,+IAA+I;IACjJ,gBAAgB,EACd,oUAAoU;IACtU,uBAAuB,EACrB,+LAA+L;CAClM,CAAC;AAEF,SAAS,YAAY,CAAC,YAAoB;IACxC,OAAO,MAAM,CAAC,OAAO,CAAC,kBAAkB,CAAC,CAAC,IAAI,CAC5C,CAAC,CAAC,IAAI,CAAC,EAAE,EAAE,CAAC,IAAI,KAAK,YAAY,CAClC,EAAE,CAAC,CAAC,CAAC,CAAC;AACT,CAAC;AAED,MAAM,UAAU,uBAAuB,CACrC,QAA8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