@clawrent/protocol 0.1.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/envelope.d.ts +53 -0
- package/dist/envelope.d.ts.map +1 -0
- package/dist/envelope.js +17 -0
- package/dist/envelope.js.map +1 -0
- package/dist/factory.d.ts +7 -0
- package/dist/factory.d.ts.map +1 -0
- package/dist/factory.js +18 -0
- package/dist/factory.js.map +1 -0
- package/dist/index.d.ts +16 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +16 -0
- package/dist/index.js.map +1 -0
- package/dist/instructions/batch.d.ts +334 -0
- package/dist/instructions/batch.d.ts.map +1 -0
- package/dist/instructions/batch.js +17 -0
- package/dist/instructions/batch.js.map +1 -0
- package/dist/instructions/exec.d.ts +46 -0
- package/dist/instructions/exec.d.ts.map +1 -0
- package/dist/instructions/exec.js +17 -0
- package/dist/instructions/exec.js.map +1 -0
- package/dist/instructions/read-dir.d.ts +16 -0
- package/dist/instructions/read-dir.d.ts.map +1 -0
- package/dist/instructions/read-dir.js +7 -0
- package/dist/instructions/read-dir.js.map +1 -0
- package/dist/instructions/read-file.d.ts +34 -0
- package/dist/instructions/read-file.d.ts.map +1 -0
- package/dist/instructions/read-file.js +13 -0
- package/dist/instructions/read-file.js.map +1 -0
- package/dist/instructions/write-file.d.ts +42 -0
- package/dist/instructions/write-file.d.ts.map +1 -0
- package/dist/instructions/write-file.js +15 -0
- package/dist/instructions/write-file.js.map +1 -0
- package/dist/message-types.d.ts +35 -0
- package/dist/message-types.d.ts.map +1 -0
- package/dist/message-types.js +40 -0
- package/dist/message-types.js.map +1 -0
- package/dist/results/error.d.ts +19 -0
- package/dist/results/error.d.ts.map +1 -0
- package/dist/results/error.js +8 -0
- package/dist/results/error.js.map +1 -0
- package/dist/results/permission-denied.d.ts +19 -0
- package/dist/results/permission-denied.d.ts.map +1 -0
- package/dist/results/permission-denied.js +8 -0
- package/dist/results/permission-denied.js.map +1 -0
- package/dist/results/success.d.ts +88 -0
- package/dist/results/success.d.ts.map +1 -0
- package/dist/results/success.js +21 -0
- package/dist/results/success.js.map +1 -0
- package/dist/session/control.d.ts +16 -0
- package/dist/session/control.d.ts.map +1 -0
- package/dist/session/control.js +7 -0
- package/dist/session/control.js.map +1 -0
- package/dist/session/dialogue.d.ts +16 -0
- package/dist/session/dialogue.d.ts.map +1 -0
- package/dist/session/dialogue.js +7 -0
- package/dist/session/dialogue.js.map +1 -0
- package/dist/staff/messages.d.ts +166 -0
- package/dist/staff/messages.d.ts.map +1 -0
- package/dist/staff/messages.js +74 -0
- package/dist/staff/messages.js.map +1 -0
- package/dist/validators.d.ts +3 -0
- package/dist/validators.d.ts.map +1 -0
- package/dist/validators.js +5 -0
- package/dist/validators.js.map +1 -0
- package/package.json +32 -0
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* Staff Task Assignment — Platform → Agent Staff
|
|
4
|
+
* Assigns an operational task to an agent staff member via HCP session.
|
|
5
|
+
*/
|
|
6
|
+
export const StaffTaskAssignSchema = z.object({
|
|
7
|
+
taskId: z.string(),
|
|
8
|
+
actionId: z.string(),
|
|
9
|
+
department: z.string(),
|
|
10
|
+
description: z.string(),
|
|
11
|
+
targetType: z.string().optional(),
|
|
12
|
+
targetId: z.string().optional(),
|
|
13
|
+
context: z.record(z.unknown()).optional(),
|
|
14
|
+
deadline: z.number().optional(),
|
|
15
|
+
});
|
|
16
|
+
/**
|
|
17
|
+
* Staff Task Result — Agent Staff → Platform
|
|
18
|
+
* Returns the result of a completed staff task.
|
|
19
|
+
*/
|
|
20
|
+
export const StaffTaskResultSchema = z.object({
|
|
21
|
+
taskId: z.string(),
|
|
22
|
+
actionId: z.string(),
|
|
23
|
+
status: z.enum(['completed', 'failed', 'needs_review']),
|
|
24
|
+
result: z.record(z.unknown()).optional(),
|
|
25
|
+
reasoning: z.string().optional(),
|
|
26
|
+
proposedAction: z
|
|
27
|
+
.object({
|
|
28
|
+
targetType: z.string(),
|
|
29
|
+
targetId: z.string(),
|
|
30
|
+
params: z.record(z.unknown()),
|
|
31
|
+
})
|
|
32
|
+
.optional(),
|
|
33
|
+
});
|
|
34
|
+
/**
|
|
35
|
+
* Staff Query — Platform → Agent Staff
|
|
36
|
+
* Platform asks agent staff for data analysis, recommendations, etc.
|
|
37
|
+
*/
|
|
38
|
+
export const StaffQuerySchema = z.object({
|
|
39
|
+
queryId: z.string(),
|
|
40
|
+
queryType: z.string(),
|
|
41
|
+
parameters: z.record(z.unknown()).optional(),
|
|
42
|
+
});
|
|
43
|
+
/**
|
|
44
|
+
* Staff Query Response — Agent Staff → Platform
|
|
45
|
+
* Agent staff responds with analysis results.
|
|
46
|
+
*/
|
|
47
|
+
export const StaffQueryResponseSchema = z.object({
|
|
48
|
+
queryId: z.string(),
|
|
49
|
+
data: z.record(z.unknown()),
|
|
50
|
+
summary: z.string().optional(),
|
|
51
|
+
});
|
|
52
|
+
/**
|
|
53
|
+
* Staff Action Proposal — Agent Staff → Platform
|
|
54
|
+
* Agent staff proposes an action for human approval.
|
|
55
|
+
*/
|
|
56
|
+
export const StaffActionProposalSchema = z.object({
|
|
57
|
+
proposalId: z.string().optional(),
|
|
58
|
+
actionId: z.string(),
|
|
59
|
+
targetType: z.string(),
|
|
60
|
+
targetId: z.string(),
|
|
61
|
+
params: z.record(z.unknown()),
|
|
62
|
+
reasoning: z.string(),
|
|
63
|
+
urgency: z.enum(['low', 'medium', 'high']).optional(),
|
|
64
|
+
});
|
|
65
|
+
/**
|
|
66
|
+
* Staff Action Approved/Rejected — Platform → Agent Staff
|
|
67
|
+
* Notifies agent staff of proposal outcome.
|
|
68
|
+
*/
|
|
69
|
+
export const StaffActionOutcomeSchema = z.object({
|
|
70
|
+
proposalId: z.string(),
|
|
71
|
+
decision: z.enum(['approved', 'rejected']),
|
|
72
|
+
note: z.string().optional(),
|
|
73
|
+
});
|
|
74
|
+
//# sourceMappingURL=messages.js.map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AAM,CAAC;IAC/C,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE;IACtB,QAAQ,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,UAAU,EAAE,UAAU,CAAC,CAAC;IAC1C,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CAC5B,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validators.d.ts","sourceRoot":"","sources":["../src/validators.ts"],"names":[],"mappings":"AAAA,OAAO,EAAyB,KAAK,eAAe,EAAE,MAAM,eAAe,CAAC;AAE5E,wBAAgB,eAAe,CAAC,GAAG,EAAE,OAAO,GAAG,eAAe,CAE7D"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validators.js","sourceRoot":"","sources":["../src/validators.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAwB,MAAM,eAAe,CAAC;AAE5E,MAAM,UAAU,eAAe,CAAC,GAAY;IAC1C,OAAO,qBAAqB,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;AAC1C,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@clawrent/protocol",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"main": "./dist/index.js",
|
|
6
|
+
"types": "./dist/index.d.ts",
|
|
7
|
+
"exports": {
|
|
8
|
+
".": {
|
|
9
|
+
"types": "./dist/index.d.ts",
|
|
10
|
+
"import": "./dist/index.js"
|
|
11
|
+
}
|
|
12
|
+
},
|
|
13
|
+
"files": [
|
|
14
|
+
"dist"
|
|
15
|
+
],
|
|
16
|
+
"publishConfig": {
|
|
17
|
+
"access": "public"
|
|
18
|
+
},
|
|
19
|
+
"dependencies": {
|
|
20
|
+
"zod": "^3.24.0"
|
|
21
|
+
},
|
|
22
|
+
"devDependencies": {
|
|
23
|
+
"typescript": "^5.7.0",
|
|
24
|
+
"@clawrent/config": "0.1.0",
|
|
25
|
+
"@clawrent/shared-types": "0.1.0"
|
|
26
|
+
},
|
|
27
|
+
"scripts": {
|
|
28
|
+
"build": "tsc",
|
|
29
|
+
"typecheck": "tsc --noEmit",
|
|
30
|
+
"lint": "eslint src/"
|
|
31
|
+
}
|
|
32
|
+
}
|