@qawolf/api-contracts 0.39.0 → 0.42.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/get.d.ts +30 -0
- package/dist/v1/agent/get.d.ts.map +1 -0
- package/dist/v1/agent/get.js +23 -0
- package/dist/v1/agent/get.js.map +1 -0
- package/dist/v1/agent/send.d.ts +29 -0
- package/dist/v1/agent/send.d.ts.map +1 -0
- package/dist/v1/agent/send.js +34 -0
- package/dist/v1/agent/send.js.map +1 -0
- package/dist/v1/agent/status.d.ts +16 -0
- package/dist/v1/agent/status.d.ts.map +1 -0
- package/dist/v1/agent/status.js +22 -0
- package/dist/v1/agent/status.js.map +1 -0
- package/dist/v1/flow/addTag.d.ts +8 -1
- package/dist/v1/flow/addTag.d.ts.map +1 -1
- package/dist/v1/flow/addTag.js +10 -2
- package/dist/v1/flow/addTag.js.map +1 -1
- package/dist/v1/flow/removeTag.d.ts +26 -0
- package/dist/v1/flow/removeTag.d.ts.map +1 -0
- package/dist/v1/flow/removeTag.js +37 -0
- package/dist/v1/flow/removeTag.js.map +1 -0
- package/dist/v1/flow/skippedFlows.d.ts +19 -0
- package/dist/v1/flow/skippedFlows.d.ts.map +1 -0
- package/dist/v1/flow/skippedFlows.js +15 -0
- package/dist/v1/flow/skippedFlows.js.map +1 -0
- package/dist/v1/index.d.ts +347 -4
- package/dist/v1/index.d.ts.map +1 -1
- package/dist/v1/index.js +13 -0
- package/dist/v1/index.js.map +1 -1
- package/dist/v1/issue/addFlows.js +1 -1
- package/dist/v1/issue/addFlows.js.map +1 -1
- package/dist/v1/issue/removeFlows.d.ts +55 -0
- package/dist/v1/issue/removeFlows.d.ts.map +1 -0
- package/dist/v1/issue/removeFlows.js +27 -0
- package/dist/v1/issue/removeFlows.js.map +1 -0
- package/dist/v1/run/diagnose.d.ts +56 -0
- package/dist/v1/run/diagnose.d.ts.map +1 -0
- package/dist/v1/run/diagnose.js +31 -0
- package/dist/v1/run/diagnose.js.map +1 -0
- package/dist/v1/run/index.d.ts +1 -1
- package/dist/v1/runner/browserAction.d.ts +2 -0
- package/dist/v1/runner/browserAction.d.ts.map +1 -1
- package/dist/v1/runner/browserAction.js +1 -1
- package/dist/v1/runner/browserAction.js.map +1 -1
- package/dist/v1/runnerReexports.d.ts +1 -1
- package/dist/v1/runnerReexports.d.ts.map +1 -1
- package/dist/v1/runnerReexports.js +1 -1
- package/dist/v1/runnerReexports.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import type { PublicIdSchema } from "../ids.js";
|
|
3
|
+
export declare const makeAgentGetContract: <ChatSessionId extends PublicIdSchema, WorkspaceId extends PublicIdSchema>(ids: {
|
|
4
|
+
chatSession: ChatSessionId;
|
|
5
|
+
workspace: WorkspaceId;
|
|
6
|
+
}) => {
|
|
7
|
+
readonly description: "Read what the QA Wolf AI has said and whether it is still working. Poll this after agent.send until the status settles. A status of \"waiting-for-you\" means the last reply is a question the work is blocked on, and answering it with agent.send is what unblocks it. Replies accumulate, so a caller that polls repeatedly sees the earlier ones again.";
|
|
8
|
+
readonly input: z.ZodObject<{
|
|
9
|
+
sessionId: ChatSessionId;
|
|
10
|
+
}, z.core.$strip>;
|
|
11
|
+
readonly kind: "read";
|
|
12
|
+
readonly name: "agent.get";
|
|
13
|
+
readonly output: z.ZodObject<{
|
|
14
|
+
replies: z.ZodArray<z.ZodObject<{
|
|
15
|
+
askedAt: z.ZodISODateTime;
|
|
16
|
+
choices: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
17
|
+
text: z.ZodString;
|
|
18
|
+
}, z.core.$strip>>;
|
|
19
|
+
sessionId: ChatSessionId;
|
|
20
|
+
status: z.ZodEnum<{
|
|
21
|
+
working: "working";
|
|
22
|
+
"waiting-for-you": "waiting-for-you";
|
|
23
|
+
completed: "completed";
|
|
24
|
+
failed: "failed";
|
|
25
|
+
cancelled: "cancelled";
|
|
26
|
+
}>;
|
|
27
|
+
url: z.ZodURL;
|
|
28
|
+
}, z.core.$strip>;
|
|
29
|
+
};
|
|
30
|
+
//# sourceMappingURL=get.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get.d.ts","sourceRoot":"","sources":["../../../src/v1/agent/get.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAKhD,eAAO,MAAM,oBAAoB,GAC/B,aAAa,SAAS,cAAc,EACpC,WAAW,SAAS,cAAc,EAClC,KAAK;IACL,WAAW,EAAE,aAAa,CAAC;IAC3B,SAAS,EAAE,WAAW,CAAC;CACxB;;;;;;;;;;;;;;;;;;;;;;;CA8BA,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { resource } from "../resource.js";
|
|
3
|
+
import { agentReplySchema, agentSessionStatusSchema } from "./status.js";
|
|
4
|
+
export const makeAgentGetContract = (ids) => {
|
|
5
|
+
const input = z.object({
|
|
6
|
+
sessionId: ids.chatSession.describe("The id agent.send answered with."),
|
|
7
|
+
});
|
|
8
|
+
const output = resource({
|
|
9
|
+
replies: z
|
|
10
|
+
.array(agentReplySchema)
|
|
11
|
+
.describe("Everything the AI has said so far, oldest first. A reply carrying choices is a question the work is blocked on."),
|
|
12
|
+
sessionId: ids.chatSession,
|
|
13
|
+
status: agentSessionStatusSchema,
|
|
14
|
+
}, { urlFieldDescription: "Absolute URL of the session in the QA Wolf app." });
|
|
15
|
+
return {
|
|
16
|
+
description: 'Read what the QA Wolf AI has said and whether it is still working. Poll this after agent.send until the status settles. A status of "waiting-for-you" means the last reply is a question the work is blocked on, and answering it with agent.send is what unblocks it. Replies accumulate, so a caller that polls repeatedly sees the earlier ones again.',
|
|
17
|
+
input,
|
|
18
|
+
kind: "read",
|
|
19
|
+
name: "agent.get",
|
|
20
|
+
output,
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
//# sourceMappingURL=get.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get.js","sourceRoot":"","sources":["../../../src/v1/agent/get.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAE1C,OAAO,EAAE,gBAAgB,EAAE,wBAAwB,EAAE,MAAM,aAAa,CAAC;AAEzE,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAGlC,GAGD,EAAE,EAAE;IACH,MAAM,KAAK,GAAG,CAAC,CAAC,MAAM,CAAC;QACrB,SAAS,EAAE,GAAG,CAAC,WAAW,CAAC,QAAQ,CAAC,kCAAkC,CAAC;KACxE,CAAC,CAAC;IACH,MAAM,MAAM,GAAG,QAAQ,CACrB;QACE,OAAO,EAAE,CAAC;aACP,KAAK,CAAC,gBAAgB,CAAC;aACvB,QAAQ,CACP,iHAAiH,CAClH;QACH,SAAS,EAAE,GAAG,CAAC,WAAW;QAC1B,MAAM,EAAE,wBAAwB;KACjC,EACD,EAAE,mBAAmB,EAAE,iDAAiD,EAAE,CAC3E,CAAC;IAEF,OAAO;QACL,WAAW,EACT,2VAA2V;QAC7V,KAAK;QACL,IAAI,EAAE,MAAM;QACZ,IAAI,EAAE,WAAW;QACjB,MAAM;KAMP,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import type { PublicIdSchema } from "../ids.js";
|
|
3
|
+
export declare const makeAgentSendContract: <ChatSessionId extends PublicIdSchema, WorkspaceId extends PublicIdSchema>(ids: {
|
|
4
|
+
chatSession: ChatSessionId;
|
|
5
|
+
environmentRef: PublicIdSchema;
|
|
6
|
+
workspace: WorkspaceId;
|
|
7
|
+
}) => {
|
|
8
|
+
readonly description: "Ask the QA Wolf AI to do a piece of work in plain language, such as covering a user journey, investigating a failing run, or fixing a broken flow. This is the one verb that starts work from nothing: every other write acts on a flow, run or issue that already exists. Answers as soon as the request is accepted, with the id to follow it by, because the work runs for minutes to tens of minutes. Poll agent.get for progress, and send here again to answer a question or add context to work already running.";
|
|
9
|
+
readonly input: z.ZodObject<{
|
|
10
|
+
environmentId: z.ZodOptional<PublicIdSchema>;
|
|
11
|
+
message: z.ZodString;
|
|
12
|
+
sessionId: z.ZodOptional<ChatSessionId>;
|
|
13
|
+
workspaceId: z.ZodOptional<WorkspaceId>;
|
|
14
|
+
}, z.core.$strip>;
|
|
15
|
+
readonly kind: "write";
|
|
16
|
+
readonly name: "agent.send";
|
|
17
|
+
readonly output: z.ZodObject<{
|
|
18
|
+
sessionId: ChatSessionId;
|
|
19
|
+
status: z.ZodEnum<{
|
|
20
|
+
working: "working";
|
|
21
|
+
"waiting-for-you": "waiting-for-you";
|
|
22
|
+
completed: "completed";
|
|
23
|
+
failed: "failed";
|
|
24
|
+
cancelled: "cancelled";
|
|
25
|
+
}>;
|
|
26
|
+
url: z.ZodURL;
|
|
27
|
+
}, z.core.$strip>;
|
|
28
|
+
};
|
|
29
|
+
//# sourceMappingURL=send.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"send.d.ts","sourceRoot":"","sources":["../../../src/v1/agent/send.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAKhD,eAAO,MAAM,qBAAqB,GAChC,aAAa,SAAS,cAAc,EACpC,WAAW,SAAS,cAAc,EAClC,KAAK;IACL,WAAW,EAAE,aAAa,CAAC;IAC3B,cAAc,EAAE,cAAc,CAAC;IAC/B,SAAS,EAAE,WAAW,CAAC;CACxB;;;;;;;;;;;;;;;;;;;;;CAiDA,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { resource } from "../resource.js";
|
|
3
|
+
import { agentSessionStatusSchema } from "./status.js";
|
|
4
|
+
export const makeAgentSendContract = (ids) => {
|
|
5
|
+
const input = z.object({
|
|
6
|
+
environmentId: ids.environmentRef
|
|
7
|
+
.optional()
|
|
8
|
+
.describe("The environment to work in. Omit to use the team's default environment. Ignored when sessionId is given, because a session keeps the environment it opened in."),
|
|
9
|
+
message: z
|
|
10
|
+
.string()
|
|
11
|
+
.trim()
|
|
12
|
+
.min(1)
|
|
13
|
+
.max(10_000)
|
|
14
|
+
.describe("What you want QA Wolf to do, in plain language. Name the journey, the part of the app it covers, and anything the AI cannot discover for itself, such as a test account, a feature flag, or how to reach a staging environment. When answering a question from agent.get, send the answer here."),
|
|
15
|
+
sessionId: ids.chatSession
|
|
16
|
+
.optional()
|
|
17
|
+
.describe("Continue the session with this id instead of opening a new one. Omit to start fresh. Send this to answer a question or to add context to work already running."),
|
|
18
|
+
workspaceId: ids.workspace
|
|
19
|
+
.optional()
|
|
20
|
+
.describe("The workspace to work in. Required when authenticating with an organization or user API key."),
|
|
21
|
+
});
|
|
22
|
+
const output = resource({
|
|
23
|
+
sessionId: ids.chatSession.describe("Follow the work by passing this to agent.get."),
|
|
24
|
+
status: agentSessionStatusSchema,
|
|
25
|
+
}, { urlFieldDescription: "Absolute URL of the session in the QA Wolf app." });
|
|
26
|
+
return {
|
|
27
|
+
description: "Ask the QA Wolf AI to do a piece of work in plain language, such as covering a user journey, investigating a failing run, or fixing a broken flow. This is the one verb that starts work from nothing: every other write acts on a flow, run or issue that already exists. Answers as soon as the request is accepted, with the id to follow it by, because the work runs for minutes to tens of minutes. Poll agent.get for progress, and send here again to answer a question or add context to work already running.",
|
|
28
|
+
input,
|
|
29
|
+
kind: "write",
|
|
30
|
+
name: "agent.send",
|
|
31
|
+
output,
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
//# sourceMappingURL=send.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"send.js","sourceRoot":"","sources":["../../../src/v1/agent/send.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAE1C,OAAO,EAAE,wBAAwB,EAAE,MAAM,aAAa,CAAC;AAEvD,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAGnC,GAID,EAAE,EAAE;IACH,MAAM,KAAK,GAAG,CAAC,CAAC,MAAM,CAAC;QACrB,aAAa,EAAE,GAAG,CAAC,cAAc;aAC9B,QAAQ,EAAE;aACV,QAAQ,CACP,gKAAgK,CACjK;QACH,OAAO,EAAE,CAAC;aACP,MAAM,EAAE;aACR,IAAI,EAAE;aACN,GAAG,CAAC,CAAC,CAAC;aACN,GAAG,CAAC,MAAM,CAAC;aACX,QAAQ,CACP,iSAAiS,CAClS;QACH,SAAS,EAAE,GAAG,CAAC,WAAW;aACvB,QAAQ,EAAE;aACV,QAAQ,CACP,gKAAgK,CACjK;QACH,WAAW,EAAE,GAAG,CAAC,SAAS;aACvB,QAAQ,EAAE;aACV,QAAQ,CACP,8FAA8F,CAC/F;KACJ,CAAC,CAAC;IACH,MAAM,MAAM,GAAG,QAAQ,CACrB;QACE,SAAS,EAAE,GAAG,CAAC,WAAW,CAAC,QAAQ,CACjC,+CAA+C,CAChD;QACD,MAAM,EAAE,wBAAwB;KACjC,EACD,EAAE,mBAAmB,EAAE,iDAAiD,EAAE,CAC3E,CAAC;IAEF,OAAO;QACL,WAAW,EACT,yfAAyf;QAC3f,KAAK;QACL,IAAI,EAAE,OAAO;QACb,IAAI,EAAE,YAAY;QAClB,MAAM;KAMP,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const agentSessionStatuses: readonly ["working", "waiting-for-you", "completed", "failed", "cancelled"];
|
|
3
|
+
export declare const agentSessionStatusSchema: z.ZodEnum<{
|
|
4
|
+
working: "working";
|
|
5
|
+
"waiting-for-you": "waiting-for-you";
|
|
6
|
+
completed: "completed";
|
|
7
|
+
failed: "failed";
|
|
8
|
+
cancelled: "cancelled";
|
|
9
|
+
}>;
|
|
10
|
+
export declare const agentReplySchema: z.ZodObject<{
|
|
11
|
+
askedAt: z.ZodISODateTime;
|
|
12
|
+
choices: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
13
|
+
text: z.ZodString;
|
|
14
|
+
}, z.core.$strip>;
|
|
15
|
+
export type AgentSessionStatus = z.infer<typeof agentSessionStatusSchema>;
|
|
16
|
+
//# sourceMappingURL=status.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"status.d.ts","sourceRoot":"","sources":["../../../src/v1/agent/status.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,oBAAoB,6EAMvB,CAAC;AAEX,eAAO,MAAM,wBAAwB;;;;;;EAIlC,CAAC;AAEJ,eAAO,MAAM,gBAAgB;;;;iBAW3B,CAAC;AAEH,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export const agentSessionStatuses = [
|
|
3
|
+
"working",
|
|
4
|
+
"waiting-for-you",
|
|
5
|
+
"completed",
|
|
6
|
+
"failed",
|
|
7
|
+
"cancelled",
|
|
8
|
+
];
|
|
9
|
+
export const agentSessionStatusSchema = z
|
|
10
|
+
.enum(agentSessionStatuses)
|
|
11
|
+
.describe('Where the work stands. "working" means the AI is still on it. "waiting-for-you" means it asked a question and cannot continue until agent.send answers it. "completed", "failed" and "cancelled" are settled and will not change.');
|
|
12
|
+
export const agentReplySchema = z.object({
|
|
13
|
+
askedAt: z.iso
|
|
14
|
+
.datetime()
|
|
15
|
+
.describe("When the AI wrote this, as an ISO 8601 timestamp."),
|
|
16
|
+
choices: z
|
|
17
|
+
.array(z.string())
|
|
18
|
+
.optional()
|
|
19
|
+
.describe("The answers the AI offered, when the reply is a question with a fixed set of them. Answer by sending one of these back through agent.send."),
|
|
20
|
+
text: z.string().describe("What the AI said."),
|
|
21
|
+
});
|
|
22
|
+
//# sourceMappingURL=status.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"status.js","sourceRoot":"","sources":["../../../src/v1/agent/status.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,CAAC,MAAM,oBAAoB,GAAG;IAClC,SAAS;IACT,iBAAiB;IACjB,WAAW;IACX,QAAQ;IACR,WAAW;CACH,CAAC;AAEX,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC;KACtC,IAAI,CAAC,oBAAoB,CAAC;KAC1B,QAAQ,CACP,mOAAmO,CACpO,CAAC;AAEJ,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,CAAC,MAAM,CAAC;IACvC,OAAO,EAAE,CAAC,CAAC,GAAG;SACX,QAAQ,EAAE;SACV,QAAQ,CAAC,mDAAmD,CAAC;IAChE,OAAO,EAAE,CAAC;SACP,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;SACjB,QAAQ,EAAE;SACV,QAAQ,CACP,4IAA4I,CAC7I;IACH,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,mBAAmB,CAAC;CAC/C,CAAC,CAAC"}
|
package/dist/v1/flow/addTag.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import type { PublicIdSchema } from "../ids.js";
|
|
|
3
3
|
export declare const makeAddTagToFlowsContract: <FlowId extends PublicIdSchema>(ids: {
|
|
4
4
|
flow: FlowId;
|
|
5
5
|
}) => {
|
|
6
|
-
readonly description: "Assign an existing tag to the selected flows. Create tags with tag.create.";
|
|
6
|
+
readonly description: "Assign an existing tag to the selected flows. Create tags with tag.create. Flows that already carry the tag are reported in skippedFlows.";
|
|
7
7
|
readonly input: z.ZodObject<{
|
|
8
8
|
flowIds: z.ZodArray<FlowId>;
|
|
9
9
|
tagName: z.ZodString;
|
|
@@ -14,6 +14,13 @@ export declare const makeAddTagToFlowsContract: <FlowId extends PublicIdSchema>(
|
|
|
14
14
|
color: z.ZodString;
|
|
15
15
|
name: z.ZodString;
|
|
16
16
|
url: z.ZodURL;
|
|
17
|
+
skippedFlows: z.ZodArray<z.ZodObject<{
|
|
18
|
+
flowId: FlowId;
|
|
19
|
+
name: z.ZodString;
|
|
20
|
+
reason: z.ZodEnum<{
|
|
21
|
+
"already-tagged": "already-tagged";
|
|
22
|
+
}>;
|
|
23
|
+
}, z.core.$strip>>;
|
|
17
24
|
}, z.core.$strip>;
|
|
18
25
|
};
|
|
19
26
|
//# sourceMappingURL=addTag.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"addTag.d.ts","sourceRoot":"","sources":["../../../src/v1/flow/addTag.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"addTag.d.ts","sourceRoot":"","sources":["../../../src/v1/flow/addTag.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAKhD,eAAO,MAAM,yBAAyB,GAAI,MAAM,SAAS,cAAc,EAAE,KAAK;IAC5E,IAAI,EAAE,MAAM,CAAC;CACd;;;;;;;;;;;;;;;;;;;;CA6CA,CAAC"}
|
package/dist/v1/flow/addTag.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import { makeTagResourceSchema } from "../tag/index.js";
|
|
3
|
+
import { makeSkippedFlowsSchema } from "./skippedFlows.js";
|
|
3
4
|
export const makeAddTagToFlowsContract = (ids) => {
|
|
4
5
|
const input = z.object({
|
|
5
6
|
flowIds: z
|
|
@@ -17,9 +18,16 @@ export const makeAddTagToFlowsContract = (ids) => {
|
|
|
17
18
|
.min(1)
|
|
18
19
|
.describe("The name of an existing tag on the caller's team."),
|
|
19
20
|
});
|
|
20
|
-
const output = makeTagResourceSchema()
|
|
21
|
+
const output = makeTagResourceSchema().extend({
|
|
22
|
+
skippedFlows: makeSkippedFlowsSchema(ids, {
|
|
23
|
+
description: "Requested flows that already carried the tag, so nothing changed for them.",
|
|
24
|
+
reason: z
|
|
25
|
+
.enum(["already-tagged"])
|
|
26
|
+
.describe('Why the flow was skipped: "already-tagged" means the flow already carried the tag.'),
|
|
27
|
+
}),
|
|
28
|
+
});
|
|
21
29
|
return {
|
|
22
|
-
description: "Assign an existing tag to the selected flows. Create tags with tag.create.",
|
|
30
|
+
description: "Assign an existing tag to the selected flows. Create tags with tag.create. Flows that already carry the tag are reported in skippedFlows.",
|
|
23
31
|
input,
|
|
24
32
|
kind: "write",
|
|
25
33
|
name: "flow.addTag",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"addTag.js","sourceRoot":"","sources":["../../../src/v1/flow/addTag.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,OAAO,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AAExD,MAAM,CAAC,MAAM,yBAAyB,GAAG,CAAgC,GAExE,EAAE,EAAE;IACH,MAAM,KAAK,GAAG,CAAC,CAAC,MAAM,CAAC;QACrB,OAAO,EAAE,CAAC;aACP,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC;aACf,GAAG,CAAC,CAAC,CAAC;YACP,sDAAsD;aACrD,GAAG,CAAC,GAAG,CAAC;aACR,MAAM,CACL,CAAC,OAAO,EAAE,EAAE,CAAC,IAAI,GAAG,CAAC,OAAO,CAAC,CAAC,IAAI,KAAK,OAAO,CAAC,MAAM,EACrD,wBAAwB,CACzB;aACA,QAAQ,CAAC,iCAAiC,CAAC;QAC9C,sEAAsE;QACtE,8DAA8D;QAC9D,OAAO,EAAE,CAAC;aACP,MAAM,EAAE;aACR,IAAI,EAAE;aACN,GAAG,CAAC,CAAC,CAAC;aACN,QAAQ,CAAC,mDAAmD,CAAC;KACjE,CAAC,CAAC;IACH,MAAM,MAAM,GAAG,qBAAqB,EAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"addTag.js","sourceRoot":"","sources":["../../../src/v1/flow/addTag.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,OAAO,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AAExD,OAAO,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAC;AAE3D,MAAM,CAAC,MAAM,yBAAyB,GAAG,CAAgC,GAExE,EAAE,EAAE;IACH,MAAM,KAAK,GAAG,CAAC,CAAC,MAAM,CAAC;QACrB,OAAO,EAAE,CAAC;aACP,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC;aACf,GAAG,CAAC,CAAC,CAAC;YACP,sDAAsD;aACrD,GAAG,CAAC,GAAG,CAAC;aACR,MAAM,CACL,CAAC,OAAO,EAAE,EAAE,CAAC,IAAI,GAAG,CAAC,OAAO,CAAC,CAAC,IAAI,KAAK,OAAO,CAAC,MAAM,EACrD,wBAAwB,CACzB;aACA,QAAQ,CAAC,iCAAiC,CAAC;QAC9C,sEAAsE;QACtE,8DAA8D;QAC9D,OAAO,EAAE,CAAC;aACP,MAAM,EAAE;aACR,IAAI,EAAE;aACN,GAAG,CAAC,CAAC,CAAC;aACN,QAAQ,CAAC,mDAAmD,CAAC;KACjE,CAAC,CAAC;IACH,MAAM,MAAM,GAAG,qBAAqB,EAAE,CAAC,MAAM,CAAC;QAC5C,YAAY,EAAE,sBAAsB,CAAC,GAAG,EAAE;YACxC,WAAW,EACT,4EAA4E;YAC9E,MAAM,EAAE,CAAC;iBACN,IAAI,CAAC,CAAC,gBAAgB,CAAC,CAAC;iBACxB,QAAQ,CACP,oFAAoF,CACrF;SACJ,CAAC;KACH,CAAC,CAAC;IAEH,OAAO;QACL,WAAW,EACT,2IAA2I;QAC7I,KAAK;QACL,IAAI,EAAE,OAAO;QACb,IAAI,EAAE,aAAa;QACnB,MAAM;KAMP,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import type { PublicIdSchema } from "../ids.js";
|
|
3
|
+
export declare const makeRemoveTagFromFlowsContract: <FlowId extends PublicIdSchema>(ids: {
|
|
4
|
+
flow: FlowId;
|
|
5
|
+
}) => {
|
|
6
|
+
readonly description: "Remove a tag from the selected flows. Succeeds whether or not each flow carried the tag; the flows that did not are reported in skippedFlows.";
|
|
7
|
+
readonly input: z.ZodObject<{
|
|
8
|
+
flowIds: z.ZodArray<FlowId>;
|
|
9
|
+
tagName: z.ZodString;
|
|
10
|
+
}, z.core.$strip>;
|
|
11
|
+
readonly kind: "write";
|
|
12
|
+
readonly name: "flow.removeTag";
|
|
13
|
+
readonly output: z.ZodObject<{
|
|
14
|
+
color: z.ZodString;
|
|
15
|
+
name: z.ZodString;
|
|
16
|
+
url: z.ZodURL;
|
|
17
|
+
skippedFlows: z.ZodArray<z.ZodObject<{
|
|
18
|
+
flowId: FlowId;
|
|
19
|
+
name: z.ZodString;
|
|
20
|
+
reason: z.ZodEnum<{
|
|
21
|
+
"not-tagged": "not-tagged";
|
|
22
|
+
}>;
|
|
23
|
+
}, z.core.$strip>>;
|
|
24
|
+
}, z.core.$strip>;
|
|
25
|
+
};
|
|
26
|
+
//# sourceMappingURL=removeTag.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"removeTag.d.ts","sourceRoot":"","sources":["../../../src/v1/flow/removeTag.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAKhD,eAAO,MAAM,8BAA8B,GACzC,MAAM,SAAS,cAAc,EAC7B,KAAK;IACL,IAAI,EAAE,MAAM,CAAC;CACd;;;;;;;;;;;;;;;;;;;;CA6CA,CAAC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { makeTagResourceSchema } from "../tag/index.js";
|
|
3
|
+
import { makeSkippedFlowsSchema } from "./skippedFlows.js";
|
|
4
|
+
export const makeRemoveTagFromFlowsContract = (ids) => {
|
|
5
|
+
const input = z.object({
|
|
6
|
+
flowIds: z
|
|
7
|
+
.array(ids.flow)
|
|
8
|
+
.min(1)
|
|
9
|
+
// Matches the flow.addTag selection cap.
|
|
10
|
+
.max(300)
|
|
11
|
+
.refine((flowIds) => new Set(flowIds).size === flowIds.length, "flowIds must be unique")
|
|
12
|
+
.describe("The flows that lose the tag."),
|
|
13
|
+
// A lookup, not an insert: a name that cannot exist simply misses and
|
|
14
|
+
// returns the not-found error, so no format rules apply here.
|
|
15
|
+
tagName: z
|
|
16
|
+
.string()
|
|
17
|
+
.trim()
|
|
18
|
+
.min(1)
|
|
19
|
+
.describe("The name of an existing tag on the caller's team."),
|
|
20
|
+
});
|
|
21
|
+
const output = makeTagResourceSchema().extend({
|
|
22
|
+
skippedFlows: makeSkippedFlowsSchema(ids, {
|
|
23
|
+
description: "Requested flows that did not carry the tag, so nothing changed for them.",
|
|
24
|
+
reason: z
|
|
25
|
+
.enum(["not-tagged"])
|
|
26
|
+
.describe('Why the flow was skipped: "not-tagged" means the flow did not carry the tag.'),
|
|
27
|
+
}),
|
|
28
|
+
});
|
|
29
|
+
return {
|
|
30
|
+
description: "Remove a tag from the selected flows. Succeeds whether or not each flow carried the tag; the flows that did not are reported in skippedFlows.",
|
|
31
|
+
input,
|
|
32
|
+
kind: "write",
|
|
33
|
+
name: "flow.removeTag",
|
|
34
|
+
output,
|
|
35
|
+
};
|
|
36
|
+
};
|
|
37
|
+
//# sourceMappingURL=removeTag.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"removeTag.js","sourceRoot":"","sources":["../../../src/v1/flow/removeTag.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,OAAO,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AAExD,OAAO,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAC;AAE3D,MAAM,CAAC,MAAM,8BAA8B,GAAG,CAE5C,GAED,EAAE,EAAE;IACH,MAAM,KAAK,GAAG,CAAC,CAAC,MAAM,CAAC;QACrB,OAAO,EAAE,CAAC;aACP,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC;aACf,GAAG,CAAC,CAAC,CAAC;YACP,yCAAyC;aACxC,GAAG,CAAC,GAAG,CAAC;aACR,MAAM,CACL,CAAC,OAAO,EAAE,EAAE,CAAC,IAAI,GAAG,CAAC,OAAO,CAAC,CAAC,IAAI,KAAK,OAAO,CAAC,MAAM,EACrD,wBAAwB,CACzB;aACA,QAAQ,CAAC,8BAA8B,CAAC;QAC3C,sEAAsE;QACtE,8DAA8D;QAC9D,OAAO,EAAE,CAAC;aACP,MAAM,EAAE;aACR,IAAI,EAAE;aACN,GAAG,CAAC,CAAC,CAAC;aACN,QAAQ,CAAC,mDAAmD,CAAC;KACjE,CAAC,CAAC;IACH,MAAM,MAAM,GAAG,qBAAqB,EAAE,CAAC,MAAM,CAAC;QAC5C,YAAY,EAAE,sBAAsB,CAAC,GAAG,EAAE;YACxC,WAAW,EACT,0EAA0E;YAC5E,MAAM,EAAE,CAAC;iBACN,IAAI,CAAC,CAAC,YAAY,CAAC,CAAC;iBACpB,QAAQ,CACP,8EAA8E,CAC/E;SACJ,CAAC;KACH,CAAC,CAAC;IAEH,OAAO;QACL,WAAW,EACT,+IAA+I;QACjJ,KAAK;QACL,IAAI,EAAE,OAAO;QACb,IAAI,EAAE,gBAAgB;QACtB,MAAM;KAMP,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import type { PublicIdSchema } from "../ids.js";
|
|
3
|
+
/**
|
|
4
|
+
* The flows a tag write left untouched, each with the reason.
|
|
5
|
+
*
|
|
6
|
+
* flow.addTag and flow.removeTag both report their receipt through this
|
|
7
|
+
* factory, so an agent parses one row shape for the pair.
|
|
8
|
+
*/
|
|
9
|
+
export declare const makeSkippedFlowsSchema: <FlowId extends PublicIdSchema, ReasonSchema extends z.ZodType>(ids: {
|
|
10
|
+
flow: FlowId;
|
|
11
|
+
}, { description, reason }: {
|
|
12
|
+
description: string;
|
|
13
|
+
reason: ReasonSchema;
|
|
14
|
+
}) => z.ZodArray<z.ZodObject<{
|
|
15
|
+
flowId: FlowId;
|
|
16
|
+
name: z.ZodString;
|
|
17
|
+
reason: ReasonSchema;
|
|
18
|
+
}, z.core.$strip>>;
|
|
19
|
+
//# sourceMappingURL=skippedFlows.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"skippedFlows.d.ts","sourceRoot":"","sources":["../../../src/v1/flow/skippedFlows.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAEhD;;;;;GAKG;AACH,eAAO,MAAM,sBAAsB,GACjC,MAAM,SAAS,cAAc,EAC7B,YAAY,SAAS,CAAC,CAAC,OAAO,EAE9B,KAAK;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,EACrB,yBAAyB;IAAE,WAAW,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,YAAY,CAAA;CAAE;;;;kBAU9C,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
/**
|
|
3
|
+
* The flows a tag write left untouched, each with the reason.
|
|
4
|
+
*
|
|
5
|
+
* flow.addTag and flow.removeTag both report their receipt through this
|
|
6
|
+
* factory, so an agent parses one row shape for the pair.
|
|
7
|
+
*/
|
|
8
|
+
export const makeSkippedFlowsSchema = (ids, { description, reason }) => z
|
|
9
|
+
.array(z.object({
|
|
10
|
+
flowId: ids.flow,
|
|
11
|
+
name: z.string().describe("The name of the flow."),
|
|
12
|
+
reason,
|
|
13
|
+
}))
|
|
14
|
+
.describe(description);
|
|
15
|
+
//# sourceMappingURL=skippedFlows.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"skippedFlows.js","sourceRoot":"","sources":["../../../src/v1/flow/skippedFlows.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB;;;;;GAKG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAIpC,GAAqB,EACrB,EAAE,WAAW,EAAE,MAAM,EAAiD,EACtE,EAAE,CACF,CAAC;KACE,KAAK,CACJ,CAAC,CAAC,MAAM,CAAC;IACP,MAAM,EAAE,GAAG,CAAC,IAAI;IAChB,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,uBAAuB,CAAC;IAClD,MAAM;CACP,CAAC,CACH;KACA,QAAQ,CAAC,WAAW,CAAC,CAAC"}
|