@harness-control/protocol 0.4.6 → 0.4.8

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.
File without changes
@@ -3,11 +3,34 @@ import { z } from "zod";
3
3
  export declare const MCP_REVIEW_META_KEY = "io.harness-control/review-v1";
4
4
  export declare const MCP_REVIEW_MAX_ACTION_BYTES: number;
5
5
  export declare const MCP_REVIEW_MAX_REQUEST_ID_LENGTH = 256;
6
+ export declare const mcpDelegatedReviewSubjectSchema: z.ZodObject<{
7
+ operation_id: z.ZodString;
8
+ tool_name: z.ZodString;
9
+ arguments: z.ZodRecord<z.ZodString, z.ZodJSONSchema>;
10
+ binding: z.ZodString;
11
+ }, z.core.$strict>;
12
+ export type McpDelegatedReviewSubject = z.infer<typeof mcpDelegatedReviewSubjectSchema>;
13
+ export declare const mcpDelegatedReviewRequestSchema: z.ZodObject<{
14
+ kind: z.ZodLiteral<"delegated">;
15
+ input_request_id: z.ZodString;
16
+ subject: z.ZodObject<{
17
+ operation_id: z.ZodString;
18
+ tool_name: z.ZodString;
19
+ arguments: z.ZodRecord<z.ZodString, z.ZodJSONSchema>;
20
+ binding: z.ZodString;
21
+ }, z.core.$strict>;
22
+ }, z.core.$strict>;
6
23
  export declare const mcpReviewActionSchema: z.ZodObject<{
7
24
  kind: z.ZodLiteral<"mcp_tool">;
8
25
  attachment_name: z.ZodString;
9
26
  tool_name: z.ZodString;
10
27
  arguments: z.ZodRecord<z.ZodString, z.ZodJSONSchema>;
28
+ delegated_subject: z.ZodOptional<z.ZodObject<{
29
+ operation_id: z.ZodString;
30
+ tool_name: z.ZodString;
31
+ arguments: z.ZodRecord<z.ZodString, z.ZodJSONSchema>;
32
+ binding: z.ZodString;
33
+ }, z.core.$strict>>;
11
34
  }, z.core.$strict>;
12
35
  export type McpReviewAction = z.infer<typeof mcpReviewActionSchema>;
13
36
  export declare function mcpReviewActionBytes(json: string): Uint8Array;
@@ -37,6 +60,12 @@ export declare function createMcpReviewContract(): {
37
60
  attachment_name: z.ZodString;
38
61
  tool_name: z.ZodString;
39
62
  arguments: z.ZodRecord<z.ZodString, z.ZodJSONSchema>;
63
+ delegated_subject: z.ZodOptional<z.ZodObject<{
64
+ operation_id: z.ZodString;
65
+ tool_name: z.ZodString;
66
+ arguments: z.ZodRecord<z.ZodString, z.ZodJSONSchema>;
67
+ binding: z.ZodString;
68
+ }, z.core.$strict>>;
40
69
  }, z.core.$strict>>;
41
70
  grant: z.core.ZodStandardJSONSchemaPayload<z.ZodObject<{
42
71
  request_id: z.ZodString;
@@ -49,6 +78,16 @@ export declare function createMcpReviewContract(): {
49
78
  argument: z.ZodString;
50
79
  values: z.ZodArray<z.ZodString>;
51
80
  }, z.core.$strict>], "kind">>;
81
+ delegated_request: z.core.ZodStandardJSONSchemaPayload<z.ZodObject<{
82
+ kind: z.ZodLiteral<"delegated">;
83
+ input_request_id: z.ZodString;
84
+ subject: z.ZodObject<{
85
+ operation_id: z.ZodString;
86
+ tool_name: z.ZodString;
87
+ arguments: z.ZodRecord<z.ZodString, z.ZodJSONSchema>;
88
+ binding: z.ZodString;
89
+ }, z.core.$strict>;
90
+ }, z.core.$strict>>;
52
91
  };
53
92
  };
54
93
  //# sourceMappingURL=mcp-review.d.ts.map
@@ -3,9 +3,21 @@ import { z } from "zod";
3
3
  export const MCP_REVIEW_META_KEY = "io.harness-control/review-v1";
4
4
  export const MCP_REVIEW_MAX_ACTION_BYTES = 64 * 1024;
5
5
  export const MCP_REVIEW_MAX_REQUEST_ID_LENGTH = 256;
6
+ export const mcpDelegatedReviewSubjectSchema = z.object({
7
+ operation_id: z.string().min(1).max(256),
8
+ tool_name: z.string().min(1),
9
+ arguments: z.record(z.string(), z.json()),
10
+ binding: z.string().min(1).max(MCP_REVIEW_MAX_ACTION_BYTES),
11
+ }).strict();
12
+ export const mcpDelegatedReviewRequestSchema = z.object({
13
+ kind: z.literal("delegated"),
14
+ input_request_id: z.string().min(1).max(MCP_REVIEW_MAX_REQUEST_ID_LENGTH),
15
+ subject: mcpDelegatedReviewSubjectSchema,
16
+ }).strict();
6
17
  export const mcpReviewActionSchema = z.object({
7
18
  kind: z.literal("mcp_tool"), attachment_name: z.string().min(1),
8
19
  tool_name: z.string().min(1), arguments: z.record(z.string(), z.json()),
20
+ delegated_subject: mcpDelegatedReviewSubjectSchema.optional(),
9
21
  }).strict();
10
22
  export function mcpReviewActionBytes(json) {
11
23
  const bytes = new TextEncoder().encode(json);
@@ -39,6 +51,7 @@ export function createMcpReviewContract() {
39
51
  return { version: 1, metadata_key: MCP_REVIEW_META_KEY, max_action_bytes: MCP_REVIEW_MAX_ACTION_BYTES,
40
52
  hashing: "sha256-exact-utf8-lowercase-hex", schemas: {
41
53
  action: z.toJSONSchema(mcpReviewActionSchema), grant: z.toJSONSchema(mcpReviewGrantSchema), policy: z.toJSONSchema(mcpReviewPolicySchema),
54
+ delegated_request: z.toJSONSchema(mcpDelegatedReviewRequestSchema),
42
55
  } };
43
56
  }
44
57
  //# sourceMappingURL=mcp-review.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@harness-control/protocol",
3
- "version": "0.4.6",
3
+ "version": "0.4.8",
4
4
  "license": "Apache-2.0",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -40,7 +40,7 @@
40
40
  "test": "tsx --test src/**/*.test.ts test/**/*.test.ts"
41
41
  },
42
42
  "dependencies": {
43
- "zod": "^4.4.3"
43
+ "zod": "4.4.3"
44
44
  },
45
45
  "description": "Types, validation, JSON Schema and reducers for Harness Control Protocol",
46
46
  "engines": {
@@ -28,6 +28,41 @@
28
28
  "additionalProperties": {
29
29
  "$ref": "#/$defs/__schema0"
30
30
  }
31
+ },
32
+ "delegated_subject": {
33
+ "type": "object",
34
+ "properties": {
35
+ "operation_id": {
36
+ "type": "string",
37
+ "minLength": 1,
38
+ "maxLength": 256
39
+ },
40
+ "tool_name": {
41
+ "type": "string",
42
+ "minLength": 1
43
+ },
44
+ "arguments": {
45
+ "type": "object",
46
+ "propertyNames": {
47
+ "type": "string"
48
+ },
49
+ "additionalProperties": {
50
+ "$ref": "#/$defs/__schema1"
51
+ }
52
+ },
53
+ "binding": {
54
+ "type": "string",
55
+ "minLength": 1,
56
+ "maxLength": 65536
57
+ }
58
+ },
59
+ "required": [
60
+ "operation_id",
61
+ "tool_name",
62
+ "arguments",
63
+ "binding"
64
+ ],
65
+ "additionalProperties": false
31
66
  }
32
67
  },
33
68
  "required": [
@@ -68,6 +103,37 @@
68
103
  }
69
104
  }
70
105
  ]
106
+ },
107
+ "__schema1": {
108
+ "anyOf": [
109
+ {
110
+ "type": "string"
111
+ },
112
+ {
113
+ "type": "number"
114
+ },
115
+ {
116
+ "type": "boolean"
117
+ },
118
+ {
119
+ "type": "null"
120
+ },
121
+ {
122
+ "type": "array",
123
+ "items": {
124
+ "$ref": "#/$defs/__schema1"
125
+ }
126
+ },
127
+ {
128
+ "type": "object",
129
+ "propertyNames": {
130
+ "type": "string"
131
+ },
132
+ "additionalProperties": {
133
+ "$ref": "#/$defs/__schema1"
134
+ }
135
+ }
136
+ ]
71
137
  }
72
138
  }
73
139
  },
@@ -136,6 +202,95 @@
136
202
  "additionalProperties": false
137
203
  }
138
204
  ]
205
+ },
206
+ "delegated_request": {
207
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
208
+ "type": "object",
209
+ "properties": {
210
+ "kind": {
211
+ "type": "string",
212
+ "const": "delegated"
213
+ },
214
+ "input_request_id": {
215
+ "type": "string",
216
+ "minLength": 1,
217
+ "maxLength": 256
218
+ },
219
+ "subject": {
220
+ "type": "object",
221
+ "properties": {
222
+ "operation_id": {
223
+ "type": "string",
224
+ "minLength": 1,
225
+ "maxLength": 256
226
+ },
227
+ "tool_name": {
228
+ "type": "string",
229
+ "minLength": 1
230
+ },
231
+ "arguments": {
232
+ "type": "object",
233
+ "propertyNames": {
234
+ "type": "string"
235
+ },
236
+ "additionalProperties": {
237
+ "$ref": "#/$defs/__schema0"
238
+ }
239
+ },
240
+ "binding": {
241
+ "type": "string",
242
+ "minLength": 1,
243
+ "maxLength": 65536
244
+ }
245
+ },
246
+ "required": [
247
+ "operation_id",
248
+ "tool_name",
249
+ "arguments",
250
+ "binding"
251
+ ],
252
+ "additionalProperties": false
253
+ }
254
+ },
255
+ "required": [
256
+ "kind",
257
+ "input_request_id",
258
+ "subject"
259
+ ],
260
+ "additionalProperties": false,
261
+ "$defs": {
262
+ "__schema0": {
263
+ "anyOf": [
264
+ {
265
+ "type": "string"
266
+ },
267
+ {
268
+ "type": "number"
269
+ },
270
+ {
271
+ "type": "boolean"
272
+ },
273
+ {
274
+ "type": "null"
275
+ },
276
+ {
277
+ "type": "array",
278
+ "items": {
279
+ "$ref": "#/$defs/__schema0"
280
+ }
281
+ },
282
+ {
283
+ "type": "object",
284
+ "propertyNames": {
285
+ "type": "string"
286
+ },
287
+ "additionalProperties": {
288
+ "$ref": "#/$defs/__schema0"
289
+ }
290
+ }
291
+ ]
292
+ }
293
+ }
139
294
  }
140
295
  }
141
296
  }