@getforgeai/protocol 0.1.0-beta.1
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/LICENSE +201 -0
- package/dist/constants/agent-status.d.ts +2 -0
- package/dist/constants/agent-status.js +8 -0
- package/dist/constants/cli-status.d.ts +2 -0
- package/dist/constants/cli-status.js +6 -0
- package/dist/constants/release-status.d.ts +5 -0
- package/dist/constants/release-status.js +10 -0
- package/dist/constants/task-status.d.ts +16 -0
- package/dist/constants/task-status.js +50 -0
- package/dist/constants/workflow-scope.d.ts +3 -0
- package/dist/constants/workflow-scope.js +7 -0
- package/dist/constants/workflow-type.d.ts +3 -0
- package/dist/constants/workflow-type.js +2 -0
- package/dist/events/index.d.ts +4 -0
- package/dist/events/index.js +2 -0
- package/dist/events/journal-events.d.ts +29 -0
- package/dist/events/journal-events.js +22 -0
- package/dist/events/socket-events.d.ts +513 -0
- package/dist/events/socket-events.js +3 -0
- package/dist/index.d.ts +19 -0
- package/dist/index.js +11 -0
- package/dist/types/agent.d.ts +12 -0
- package/dist/types/agent.js +2 -0
- package/dist/types/project.d.ts +2 -0
- package/dist/types/project.js +2 -0
- package/dist/types/release.d.ts +18 -0
- package/dist/types/release.js +2 -0
- package/dist/types/task.d.ts +15 -0
- package/dist/types/task.js +2 -0
- package/dist/types/workflow.d.ts +2 -0
- package/dist/types/workflow.js +2 -0
- package/dist/validation/cli-api.schema.d.ts +94 -0
- package/dist/validation/cli-api.schema.js +73 -0
- package/dist/validation/index.d.ts +19 -0
- package/dist/validation/index.js +19 -0
- package/dist/validation/mcp-tools.schema.d.ts +299 -0
- package/dist/validation/mcp-tools.schema.js +248 -0
- package/dist/validation/release.schema.d.ts +50 -0
- package/dist/validation/release.schema.js +29 -0
- package/dist/validation/skill-pull.schema.d.ts +94 -0
- package/dist/validation/skill-pull.schema.js +54 -0
- package/dist/validation/task-generation.schema.d.ts +63 -0
- package/dist/validation/task-generation.schema.js +39 -0
- package/dist/validation/task-worktree.schema.d.ts +32 -0
- package/dist/validation/task-worktree.schema.js +32 -0
- package/dist/validation/workflow-branch.schema.d.ts +26 -0
- package/dist/validation/workflow-branch.schema.js +26 -0
- package/dist/validation/workflow-dispatch.schema.d.ts +22 -0
- package/dist/validation/workflow-dispatch.schema.js +22 -0
- package/dist/validation/workflow-merge.schema.d.ts +65 -0
- package/dist/validation/workflow-merge.schema.js +61 -0
- package/dist/validation/workflow-stream.schema.d.ts +112 -0
- package/dist/validation/workflow-stream.schema.js +100 -0
- package/package.json +52 -0
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
// --- Workflow Branch Create (Cloud Server → CLI, Story 5c.1) ---
|
|
3
|
+
export const WorkflowBranchCreateSchema = z.object({
|
|
4
|
+
workflowId: z.string(),
|
|
5
|
+
sourceBranch: z.string().min(1),
|
|
6
|
+
baseBranch: z.string().min(1),
|
|
7
|
+
repoUrl: z.string().min(1),
|
|
8
|
+
});
|
|
9
|
+
// --- Workflow Branch Created (CLI → Cloud Server, Story 5c.1) ---
|
|
10
|
+
export const WorkflowBranchCreatedSchema = z.object({
|
|
11
|
+
workflowId: z.string(),
|
|
12
|
+
baseBranch: z.string().min(1),
|
|
13
|
+
success: z.boolean(),
|
|
14
|
+
error: z.string().optional(),
|
|
15
|
+
});
|
|
16
|
+
// --- Workflow Branch List Request (Cloud UI → Server → CLI, Story 5c.1) ---
|
|
17
|
+
export const WorkflowBranchListRequestSchema = z.object({
|
|
18
|
+
repoUrl: z.string().min(1),
|
|
19
|
+
projectSlug: z.string().min(1).optional(),
|
|
20
|
+
});
|
|
21
|
+
// --- Workflow Branch List Response (CLI → Server → Cloud UI, Story 5c.1) ---
|
|
22
|
+
export const WorkflowBranchListResponseSchema = z.object({
|
|
23
|
+
branches: z.array(z.string()),
|
|
24
|
+
defaultBranch: z.string(),
|
|
25
|
+
});
|
|
26
|
+
//# sourceMappingURL=workflow-branch.schema.js.map
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const WorkflowStepDispatchPayloadSchema: z.ZodObject<{
|
|
3
|
+
orgId: z.ZodString;
|
|
4
|
+
projectId: z.ZodString;
|
|
5
|
+
workflowId: z.ZodString;
|
|
6
|
+
stepId: z.ZodString;
|
|
7
|
+
stepKey: z.ZodString;
|
|
8
|
+
stepTitle: z.ZodString;
|
|
9
|
+
stepCommand: z.ZodOptional<z.ZodString>;
|
|
10
|
+
conversationId: z.ZodString;
|
|
11
|
+
repoUrl: z.ZodOptional<z.ZodString>;
|
|
12
|
+
projectSlug: z.ZodString;
|
|
13
|
+
workflowSlug: z.ZodOptional<z.ZodString>;
|
|
14
|
+
baseBranch: z.ZodOptional<z.ZodString>;
|
|
15
|
+
sourceBranch: z.ZodOptional<z.ZodString>;
|
|
16
|
+
conversationHistory: z.ZodOptional<z.ZodString>;
|
|
17
|
+
skillSlug: z.ZodOptional<z.ZodString>;
|
|
18
|
+
hasSnapshot: z.ZodOptional<z.ZodBoolean>;
|
|
19
|
+
timestamp: z.ZodString;
|
|
20
|
+
}, z.core.$strip>;
|
|
21
|
+
export type WorkflowStepDispatchPayload = z.infer<typeof WorkflowStepDispatchPayloadSchema>;
|
|
22
|
+
//# sourceMappingURL=workflow-dispatch.schema.d.ts.map
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
// --- workflow:step:dispatch payload validation (Story 6b.7) ---
|
|
3
|
+
export const WorkflowStepDispatchPayloadSchema = z.object({
|
|
4
|
+
orgId: z.string(),
|
|
5
|
+
projectId: z.string(),
|
|
6
|
+
workflowId: z.string(),
|
|
7
|
+
stepId: z.string(),
|
|
8
|
+
stepKey: z.string(),
|
|
9
|
+
stepTitle: z.string(),
|
|
10
|
+
stepCommand: z.string().optional(),
|
|
11
|
+
conversationId: z.string().min(1),
|
|
12
|
+
repoUrl: z.string().optional(),
|
|
13
|
+
projectSlug: z.string(),
|
|
14
|
+
workflowSlug: z.string().optional(),
|
|
15
|
+
baseBranch: z.string().optional(),
|
|
16
|
+
sourceBranch: z.string().optional(),
|
|
17
|
+
conversationHistory: z.string().optional(),
|
|
18
|
+
skillSlug: z.string().optional(),
|
|
19
|
+
hasSnapshot: z.boolean().optional(),
|
|
20
|
+
timestamp: z.string(),
|
|
21
|
+
});
|
|
22
|
+
//# sourceMappingURL=workflow-dispatch.schema.js.map
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const WorkflowMergeTaskPrCreateSchema: z.ZodObject<{
|
|
3
|
+
taskId: z.ZodString;
|
|
4
|
+
taskBranch: z.ZodString;
|
|
5
|
+
workflowBaseBranch: z.ZodString;
|
|
6
|
+
repoUrl: z.ZodString;
|
|
7
|
+
prTitle: z.ZodString;
|
|
8
|
+
prBody: z.ZodOptional<z.ZodString>;
|
|
9
|
+
}, z.core.$strip>;
|
|
10
|
+
export type WorkflowMergeTaskPrCreate = z.infer<typeof WorkflowMergeTaskPrCreateSchema>;
|
|
11
|
+
export declare const WorkflowMergeTaskPrCreatedSchema: z.ZodObject<{
|
|
12
|
+
taskId: z.ZodString;
|
|
13
|
+
prUrl: z.ZodOptional<z.ZodString>;
|
|
14
|
+
prNumber: z.ZodOptional<z.ZodNumber>;
|
|
15
|
+
success: z.ZodBoolean;
|
|
16
|
+
error: z.ZodOptional<z.ZodString>;
|
|
17
|
+
}, z.core.$strip>;
|
|
18
|
+
export type WorkflowMergeTaskPrCreated = z.infer<typeof WorkflowMergeTaskPrCreatedSchema>;
|
|
19
|
+
export declare const WorkflowMergeFinalPrCreateSchema: z.ZodObject<{
|
|
20
|
+
workflowId: z.ZodString;
|
|
21
|
+
workflowBranch: z.ZodString;
|
|
22
|
+
sourceBranch: z.ZodString;
|
|
23
|
+
repoUrl: z.ZodString;
|
|
24
|
+
prTitle: z.ZodString;
|
|
25
|
+
prBody: z.ZodOptional<z.ZodString>;
|
|
26
|
+
}, z.core.$strip>;
|
|
27
|
+
export type WorkflowMergeFinalPrCreate = z.infer<typeof WorkflowMergeFinalPrCreateSchema>;
|
|
28
|
+
export declare const WorkflowMergeFinalPrCreatedSchema: z.ZodObject<{
|
|
29
|
+
workflowId: z.ZodString;
|
|
30
|
+
prUrl: z.ZodOptional<z.ZodString>;
|
|
31
|
+
prNumber: z.ZodOptional<z.ZodNumber>;
|
|
32
|
+
success: z.ZodBoolean;
|
|
33
|
+
error: z.ZodOptional<z.ZodString>;
|
|
34
|
+
}, z.core.$strip>;
|
|
35
|
+
export type WorkflowMergeFinalPrCreated = z.infer<typeof WorkflowMergeFinalPrCreatedSchema>;
|
|
36
|
+
export declare const WorkflowMergeExecuteSchema: z.ZodObject<{
|
|
37
|
+
workflowId: z.ZodString;
|
|
38
|
+
prNumber: z.ZodNumber;
|
|
39
|
+
mergeStrategy: z.ZodEnum<{
|
|
40
|
+
merge: "merge";
|
|
41
|
+
squash: "squash";
|
|
42
|
+
rebase: "rebase";
|
|
43
|
+
}>;
|
|
44
|
+
repoUrl: z.ZodString;
|
|
45
|
+
}, z.core.$strip>;
|
|
46
|
+
export type WorkflowMergeExecute = z.infer<typeof WorkflowMergeExecuteSchema>;
|
|
47
|
+
export declare const WorkflowMergeExecutedSchema: z.ZodObject<{
|
|
48
|
+
workflowId: z.ZodString;
|
|
49
|
+
success: z.ZodBoolean;
|
|
50
|
+
error: z.ZodOptional<z.ZodString>;
|
|
51
|
+
}, z.core.$strip>;
|
|
52
|
+
export type WorkflowMergeExecuted = z.infer<typeof WorkflowMergeExecutedSchema>;
|
|
53
|
+
export declare const WorkflowMergeCleanupSchema: z.ZodObject<{
|
|
54
|
+
workflowId: z.ZodString;
|
|
55
|
+
workflowBranch: z.ZodString;
|
|
56
|
+
repoUrl: z.ZodString;
|
|
57
|
+
}, z.core.$strip>;
|
|
58
|
+
export type WorkflowMergeCleanup = z.infer<typeof WorkflowMergeCleanupSchema>;
|
|
59
|
+
export declare const WorkflowMergeCleanedSchema: z.ZodObject<{
|
|
60
|
+
workflowId: z.ZodString;
|
|
61
|
+
success: z.ZodBoolean;
|
|
62
|
+
error: z.ZodOptional<z.ZodString>;
|
|
63
|
+
}, z.core.$strip>;
|
|
64
|
+
export type WorkflowMergeCleaned = z.infer<typeof WorkflowMergeCleanedSchema>;
|
|
65
|
+
//# sourceMappingURL=workflow-merge.schema.d.ts.map
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
// --- Task PR Create (Cloud Server → CLI, Story 5c.3) ---
|
|
3
|
+
export const WorkflowMergeTaskPrCreateSchema = z.object({
|
|
4
|
+
taskId: z.string(),
|
|
5
|
+
taskBranch: z.string().min(1),
|
|
6
|
+
workflowBaseBranch: z.string().min(1),
|
|
7
|
+
repoUrl: z.string().min(1),
|
|
8
|
+
prTitle: z.string().min(1),
|
|
9
|
+
prBody: z.string().optional(),
|
|
10
|
+
});
|
|
11
|
+
// --- Task PR Created (CLI → Cloud Server, Story 5c.3) ---
|
|
12
|
+
export const WorkflowMergeTaskPrCreatedSchema = z.object({
|
|
13
|
+
taskId: z.string(),
|
|
14
|
+
prUrl: z.string().optional(),
|
|
15
|
+
prNumber: z.number().int().optional(),
|
|
16
|
+
success: z.boolean(),
|
|
17
|
+
error: z.string().optional(),
|
|
18
|
+
});
|
|
19
|
+
// --- Final PR Create (Cloud Server → CLI, Story 5c.3) ---
|
|
20
|
+
export const WorkflowMergeFinalPrCreateSchema = z.object({
|
|
21
|
+
workflowId: z.string(),
|
|
22
|
+
workflowBranch: z.string().min(1),
|
|
23
|
+
sourceBranch: z.string().min(1),
|
|
24
|
+
repoUrl: z.string().min(1),
|
|
25
|
+
prTitle: z.string().min(1),
|
|
26
|
+
prBody: z.string().optional(),
|
|
27
|
+
});
|
|
28
|
+
// --- Final PR Created (CLI → Cloud Server, Story 5c.3) ---
|
|
29
|
+
export const WorkflowMergeFinalPrCreatedSchema = z.object({
|
|
30
|
+
workflowId: z.string(),
|
|
31
|
+
prUrl: z.string().optional(),
|
|
32
|
+
prNumber: z.number().int().optional(),
|
|
33
|
+
success: z.boolean(),
|
|
34
|
+
error: z.string().optional(),
|
|
35
|
+
});
|
|
36
|
+
// --- Merge Execute (Cloud Server → CLI, Story 5c.3) ---
|
|
37
|
+
export const WorkflowMergeExecuteSchema = z.object({
|
|
38
|
+
workflowId: z.string(),
|
|
39
|
+
prNumber: z.number().int(),
|
|
40
|
+
mergeStrategy: z.enum(["merge", "squash", "rebase"]),
|
|
41
|
+
repoUrl: z.string().min(1),
|
|
42
|
+
});
|
|
43
|
+
// --- Merge Executed (CLI → Cloud Server, Story 5c.3) ---
|
|
44
|
+
export const WorkflowMergeExecutedSchema = z.object({
|
|
45
|
+
workflowId: z.string(),
|
|
46
|
+
success: z.boolean(),
|
|
47
|
+
error: z.string().optional(),
|
|
48
|
+
});
|
|
49
|
+
// --- Merge Cleanup (Cloud Server → CLI, Story 5c.3) ---
|
|
50
|
+
export const WorkflowMergeCleanupSchema = z.object({
|
|
51
|
+
workflowId: z.string(),
|
|
52
|
+
workflowBranch: z.string().min(1),
|
|
53
|
+
repoUrl: z.string().min(1),
|
|
54
|
+
});
|
|
55
|
+
// --- Merge Cleaned (CLI → Cloud Server, Story 5c.3) ---
|
|
56
|
+
export const WorkflowMergeCleanedSchema = z.object({
|
|
57
|
+
workflowId: z.string(),
|
|
58
|
+
success: z.boolean(),
|
|
59
|
+
error: z.string().optional(),
|
|
60
|
+
});
|
|
61
|
+
//# sourceMappingURL=workflow-merge.schema.js.map
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const WorkflowStreamPayloadSchema: z.ZodObject<{
|
|
3
|
+
orgId: z.ZodString;
|
|
4
|
+
workflowId: z.ZodString;
|
|
5
|
+
stepId: z.ZodString;
|
|
6
|
+
conversationId: z.ZodString;
|
|
7
|
+
messageId: z.ZodString;
|
|
8
|
+
chunk: z.ZodString;
|
|
9
|
+
index: z.ZodNumber;
|
|
10
|
+
turnIndex: z.ZodOptional<z.ZodNumber>;
|
|
11
|
+
timestamp: z.ZodString;
|
|
12
|
+
}, z.core.$strip>;
|
|
13
|
+
export type WorkflowStreamPayloadValidated = z.infer<typeof WorkflowStreamPayloadSchema>;
|
|
14
|
+
export declare const WorkflowStreamEndPayloadSchema: z.ZodObject<{
|
|
15
|
+
orgId: z.ZodString;
|
|
16
|
+
workflowId: z.ZodString;
|
|
17
|
+
stepId: z.ZodString;
|
|
18
|
+
conversationId: z.ZodString;
|
|
19
|
+
messageId: z.ZodString;
|
|
20
|
+
finalContent: z.ZodString;
|
|
21
|
+
timestamp: z.ZodString;
|
|
22
|
+
}, z.core.$strip>;
|
|
23
|
+
export type WorkflowStreamEndPayloadValidated = z.infer<typeof WorkflowStreamEndPayloadSchema>;
|
|
24
|
+
export declare const WorkflowMessagePayloadSchema: z.ZodObject<{
|
|
25
|
+
orgId: z.ZodString;
|
|
26
|
+
workflowId: z.ZodString;
|
|
27
|
+
stepId: z.ZodString;
|
|
28
|
+
conversationId: z.ZodString;
|
|
29
|
+
messageId: z.ZodString;
|
|
30
|
+
content: z.ZodString;
|
|
31
|
+
role: z.ZodEnum<{
|
|
32
|
+
USER: "USER";
|
|
33
|
+
ASSISTANT: "ASSISTANT";
|
|
34
|
+
SYSTEM: "SYSTEM";
|
|
35
|
+
}>;
|
|
36
|
+
command: z.ZodOptional<z.ZodString>;
|
|
37
|
+
timestamp: z.ZodString;
|
|
38
|
+
}, z.core.$strip>;
|
|
39
|
+
export type WorkflowMessagePayloadValidated = z.infer<typeof WorkflowMessagePayloadSchema>;
|
|
40
|
+
export declare const WorkflowAgentIdlePayloadSchema: z.ZodObject<{
|
|
41
|
+
orgId: z.ZodString;
|
|
42
|
+
workflowId: z.ZodString;
|
|
43
|
+
stepId: z.ZodString;
|
|
44
|
+
idleUntil: z.ZodString;
|
|
45
|
+
timestamp: z.ZodString;
|
|
46
|
+
}, z.core.$strip>;
|
|
47
|
+
export type WorkflowAgentIdlePayloadValidated = z.infer<typeof WorkflowAgentIdlePayloadSchema>;
|
|
48
|
+
export declare const WorkflowAgentTimeoutPayloadSchema: z.ZodObject<{
|
|
49
|
+
orgId: z.ZodString;
|
|
50
|
+
workflowId: z.ZodString;
|
|
51
|
+
stepId: z.ZodString;
|
|
52
|
+
timestamp: z.ZodString;
|
|
53
|
+
}, z.core.$strip>;
|
|
54
|
+
export type WorkflowAgentTimeoutPayloadValidated = z.infer<typeof WorkflowAgentTimeoutPayloadSchema>;
|
|
55
|
+
export declare const WorkflowAgentDismissPayloadSchema: z.ZodObject<{
|
|
56
|
+
orgId: z.ZodString;
|
|
57
|
+
workflowId: z.ZodString;
|
|
58
|
+
stepId: z.ZodString;
|
|
59
|
+
timestamp: z.ZodString;
|
|
60
|
+
}, z.core.$strip>;
|
|
61
|
+
export type WorkflowAgentDismissPayloadValidated = z.infer<typeof WorkflowAgentDismissPayloadSchema>;
|
|
62
|
+
export declare const WorkflowToolActivityPayloadSchema: z.ZodObject<{
|
|
63
|
+
orgId: z.ZodString;
|
|
64
|
+
workflowId: z.ZodString;
|
|
65
|
+
stepId: z.ZodString;
|
|
66
|
+
toolName: z.ZodString;
|
|
67
|
+
toolDetail: z.ZodString;
|
|
68
|
+
toolUseId: z.ZodOptional<z.ZodString>;
|
|
69
|
+
parentToolUseId: z.ZodOptional<z.ZodString>;
|
|
70
|
+
timestamp: z.ZodString;
|
|
71
|
+
}, z.core.$strip>;
|
|
72
|
+
export type WorkflowToolActivityPayloadValidated = z.infer<typeof WorkflowToolActivityPayloadSchema>;
|
|
73
|
+
export declare const WorkflowTokenUsagePayloadSchema: z.ZodObject<{
|
|
74
|
+
orgId: z.ZodString;
|
|
75
|
+
workflowId: z.ZodString;
|
|
76
|
+
stepId: z.ZodString;
|
|
77
|
+
inputTokens: z.ZodNumber;
|
|
78
|
+
outputTokens: z.ZodNumber;
|
|
79
|
+
timestamp: z.ZodString;
|
|
80
|
+
}, z.core.$strip>;
|
|
81
|
+
export type WorkflowTokenUsagePayloadValidated = z.infer<typeof WorkflowTokenUsagePayloadSchema>;
|
|
82
|
+
export declare const WorkflowQuestionOptionSchema: z.ZodObject<{
|
|
83
|
+
label: z.ZodString;
|
|
84
|
+
description: z.ZodOptional<z.ZodString>;
|
|
85
|
+
}, z.core.$strip>;
|
|
86
|
+
export declare const WorkflowQuestionSchema: z.ZodObject<{
|
|
87
|
+
question: z.ZodString;
|
|
88
|
+
header: z.ZodOptional<z.ZodString>;
|
|
89
|
+
options: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
90
|
+
label: z.ZodString;
|
|
91
|
+
description: z.ZodOptional<z.ZodString>;
|
|
92
|
+
}, z.core.$strip>>>;
|
|
93
|
+
multiSelect: z.ZodOptional<z.ZodBoolean>;
|
|
94
|
+
}, z.core.$strip>;
|
|
95
|
+
export declare const WorkflowQuestionPayloadSchema: z.ZodObject<{
|
|
96
|
+
orgId: z.ZodString;
|
|
97
|
+
workflowId: z.ZodString;
|
|
98
|
+
stepId: z.ZodString;
|
|
99
|
+
conversationId: z.ZodString;
|
|
100
|
+
questions: z.ZodArray<z.ZodObject<{
|
|
101
|
+
question: z.ZodString;
|
|
102
|
+
header: z.ZodOptional<z.ZodString>;
|
|
103
|
+
options: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
104
|
+
label: z.ZodString;
|
|
105
|
+
description: z.ZodOptional<z.ZodString>;
|
|
106
|
+
}, z.core.$strip>>>;
|
|
107
|
+
multiSelect: z.ZodOptional<z.ZodBoolean>;
|
|
108
|
+
}, z.core.$strip>>;
|
|
109
|
+
timestamp: z.ZodString;
|
|
110
|
+
}, z.core.$strip>;
|
|
111
|
+
export type WorkflowQuestionPayloadValidated = z.infer<typeof WorkflowQuestionPayloadSchema>;
|
|
112
|
+
//# sourceMappingURL=workflow-stream.schema.d.ts.map
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
// --- workflow:stream payload validation (Story 6b.8) ---
|
|
3
|
+
export const WorkflowStreamPayloadSchema = z.object({
|
|
4
|
+
orgId: z.string().min(1),
|
|
5
|
+
workflowId: z.string().min(1),
|
|
6
|
+
stepId: z.string().min(1),
|
|
7
|
+
conversationId: z.string().min(1),
|
|
8
|
+
messageId: z.string().min(1),
|
|
9
|
+
chunk: z.string(),
|
|
10
|
+
index: z.number(),
|
|
11
|
+
/** Groups text chunks from the same API turn (incremented on message_start) */
|
|
12
|
+
turnIndex: z.number().int().min(0).optional(),
|
|
13
|
+
timestamp: z.string().min(1),
|
|
14
|
+
});
|
|
15
|
+
// --- workflow:stream:end payload validation (Story 6b.8) ---
|
|
16
|
+
export const WorkflowStreamEndPayloadSchema = z.object({
|
|
17
|
+
orgId: z.string().min(1),
|
|
18
|
+
workflowId: z.string().min(1),
|
|
19
|
+
stepId: z.string().min(1),
|
|
20
|
+
conversationId: z.string().min(1),
|
|
21
|
+
messageId: z.string().min(1),
|
|
22
|
+
finalContent: z.string().min(1),
|
|
23
|
+
timestamp: z.string().min(1),
|
|
24
|
+
});
|
|
25
|
+
// --- workflow:message payload validation (Story 6b.8) ---
|
|
26
|
+
export const WorkflowMessagePayloadSchema = z.object({
|
|
27
|
+
orgId: z.string().min(1),
|
|
28
|
+
workflowId: z.string().min(1),
|
|
29
|
+
stepId: z.string().min(1),
|
|
30
|
+
conversationId: z.string().min(1),
|
|
31
|
+
messageId: z.string().min(1),
|
|
32
|
+
content: z.string().min(1),
|
|
33
|
+
role: z.enum(["USER", "ASSISTANT", "SYSTEM"]),
|
|
34
|
+
command: z.string().optional(),
|
|
35
|
+
timestamp: z.string().min(1),
|
|
36
|
+
});
|
|
37
|
+
// --- workflow:agent:idle payload validation ---
|
|
38
|
+
export const WorkflowAgentIdlePayloadSchema = z.object({
|
|
39
|
+
orgId: z.string(),
|
|
40
|
+
workflowId: z.string(),
|
|
41
|
+
stepId: z.string(),
|
|
42
|
+
idleUntil: z.string(),
|
|
43
|
+
timestamp: z.string(),
|
|
44
|
+
});
|
|
45
|
+
// --- workflow:agent:timeout payload validation ---
|
|
46
|
+
export const WorkflowAgentTimeoutPayloadSchema = z.object({
|
|
47
|
+
orgId: z.string(),
|
|
48
|
+
workflowId: z.string(),
|
|
49
|
+
stepId: z.string(),
|
|
50
|
+
timestamp: z.string(),
|
|
51
|
+
});
|
|
52
|
+
// --- workflow:agent:dismiss payload validation ---
|
|
53
|
+
export const WorkflowAgentDismissPayloadSchema = z.object({
|
|
54
|
+
orgId: z.string(),
|
|
55
|
+
workflowId: z.string(),
|
|
56
|
+
stepId: z.string(),
|
|
57
|
+
timestamp: z.string(),
|
|
58
|
+
});
|
|
59
|
+
// --- workflow:tool-activity payload validation (ephemeral, not persisted) ---
|
|
60
|
+
export const WorkflowToolActivityPayloadSchema = z.object({
|
|
61
|
+
orgId: z.string().min(1),
|
|
62
|
+
workflowId: z.string().min(1),
|
|
63
|
+
stepId: z.string().min(1),
|
|
64
|
+
toolName: z.string().min(1),
|
|
65
|
+
toolDetail: z.string().max(500),
|
|
66
|
+
/** For Agent tool_use blocks: the block's own id */
|
|
67
|
+
toolUseId: z.string().optional(),
|
|
68
|
+
/** For sub-agent tools: the parent Agent tool_use id */
|
|
69
|
+
parentToolUseId: z.string().optional(),
|
|
70
|
+
timestamp: z.string().min(1),
|
|
71
|
+
});
|
|
72
|
+
// --- workflow:token-usage payload validation (ephemeral, not persisted) ---
|
|
73
|
+
export const WorkflowTokenUsagePayloadSchema = z.object({
|
|
74
|
+
orgId: z.string().min(1),
|
|
75
|
+
workflowId: z.string().min(1),
|
|
76
|
+
stepId: z.string().min(1),
|
|
77
|
+
inputTokens: z.number().int().min(0),
|
|
78
|
+
outputTokens: z.number().int().min(0),
|
|
79
|
+
timestamp: z.string().min(1),
|
|
80
|
+
});
|
|
81
|
+
// --- workflow:question payload validation (AskUserQuestion interactive form) ---
|
|
82
|
+
export const WorkflowQuestionOptionSchema = z.object({
|
|
83
|
+
label: z.string().min(1),
|
|
84
|
+
description: z.string().optional(),
|
|
85
|
+
});
|
|
86
|
+
export const WorkflowQuestionSchema = z.object({
|
|
87
|
+
question: z.string().min(1),
|
|
88
|
+
header: z.string().optional(),
|
|
89
|
+
options: z.array(WorkflowQuestionOptionSchema).optional(),
|
|
90
|
+
multiSelect: z.boolean().optional(),
|
|
91
|
+
});
|
|
92
|
+
export const WorkflowQuestionPayloadSchema = z.object({
|
|
93
|
+
orgId: z.string().min(1),
|
|
94
|
+
workflowId: z.string().min(1),
|
|
95
|
+
stepId: z.string().min(1),
|
|
96
|
+
conversationId: z.string().min(1),
|
|
97
|
+
questions: z.array(WorkflowQuestionSchema).min(1),
|
|
98
|
+
timestamp: z.string().min(1),
|
|
99
|
+
});
|
|
100
|
+
//# sourceMappingURL=workflow-stream.schema.js.map
|
package/package.json
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@getforgeai/protocol",
|
|
3
|
+
"version": "0.1.0-beta.1",
|
|
4
|
+
"description": "Shared types, constants, Socket.io event definitions and Zod schemas for the ForgeAI CLI/Cloud contract.",
|
|
5
|
+
"license": "Apache-2.0",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"main": "./dist/index.js",
|
|
8
|
+
"types": "./dist/index.d.ts",
|
|
9
|
+
"files": [
|
|
10
|
+
"dist",
|
|
11
|
+
"!dist/**/*.map"
|
|
12
|
+
],
|
|
13
|
+
"exports": {
|
|
14
|
+
".": {
|
|
15
|
+
"types": "./dist/index.d.ts",
|
|
16
|
+
"import": "./dist/index.js",
|
|
17
|
+
"require": "./dist/index.js",
|
|
18
|
+
"default": "./dist/index.js"
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
"engines": {
|
|
22
|
+
"node": ">=20.11"
|
|
23
|
+
},
|
|
24
|
+
"publishConfig": {
|
|
25
|
+
"access": "public"
|
|
26
|
+
},
|
|
27
|
+
"homepage": "https://forgeai-production-382c.up.railway.app/docs",
|
|
28
|
+
"bugs": {
|
|
29
|
+
"url": "https://forgeai-production-382c.up.railway.app/contact"
|
|
30
|
+
},
|
|
31
|
+
"keywords": [
|
|
32
|
+
"forgeai",
|
|
33
|
+
"protocol",
|
|
34
|
+
"types",
|
|
35
|
+
"zod",
|
|
36
|
+
"socket.io"
|
|
37
|
+
],
|
|
38
|
+
"peerDependencies": {
|
|
39
|
+
"zod": "^4.3.6"
|
|
40
|
+
},
|
|
41
|
+
"devDependencies": {
|
|
42
|
+
"typescript": "^5.9.3",
|
|
43
|
+
"vitest": "^4.0.15",
|
|
44
|
+
"zod": "^4.3.6"
|
|
45
|
+
},
|
|
46
|
+
"scripts": {
|
|
47
|
+
"build": "tsc",
|
|
48
|
+
"ts": "tsc --noEmit",
|
|
49
|
+
"test": "vitest",
|
|
50
|
+
"test:ci": "vitest run"
|
|
51
|
+
}
|
|
52
|
+
}
|