@agent-phonon/protocol 0.2.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/LICENSE +21 -0
- package/README.md +70 -0
- package/dist/index.d.ts +24 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +24 -0
- package/dist/index.js.map +1 -0
- package/dist/json-schema/_index.json +3794 -0
- package/dist/json-schema/connect.hello.json +117 -0
- package/dist/json-schema/discovery.changed.json +190 -0
- package/dist/json-schema/discovery.get.json +183 -0
- package/dist/json-schema/discovery.list.json +182 -0
- package/dist/json-schema/document.prepare_upload.json +96 -0
- package/dist/json-schema/document.send.json +165 -0
- package/dist/json-schema/hook.fired.json +100 -0
- package/dist/json-schema/hook.resolve.json +96 -0
- package/dist/json-schema/interaction.cancel.json +48 -0
- package/dist/json-schema/interaction.request.json +376 -0
- package/dist/json-schema/interaction.response.json +68 -0
- package/dist/json-schema/project.create.json +89 -0
- package/dist/json-schema/project.get.json +76 -0
- package/dist/json-schema/project.git.deleteBranch.json +64 -0
- package/dist/json-schema/project.list.json +72 -0
- package/dist/json-schema/project.remove.json +69 -0
- package/dist/json-schema/project.worktree.create.json +88 -0
- package/dist/json-schema/project.worktree.list.json +77 -0
- package/dist/json-schema/project.worktree.remove.json +61 -0
- package/dist/json-schema/session.compress.json +72 -0
- package/dist/json-schema/session.create.json +128 -0
- package/dist/json-schema/session.inject.json +72 -0
- package/dist/json-schema/session.interrupt.json +58 -0
- package/dist/json-schema/session.list.json +127 -0
- package/dist/json-schema/session.send.json +132 -0
- package/dist/json-schema/session.status.json +94 -0
- package/dist/json-schema/session.switchModel.json +73 -0
- package/dist/json-schema/session.terminate.json +54 -0
- package/dist/json-schema/skill.install.json +171 -0
- package/dist/json-schema/skill.list.json +101 -0
- package/dist/json-schema/skill.uninstall.json +76 -0
- package/dist/json-schema/stream.ack.json +36 -0
- package/dist/json-schema/stream.event.json +381 -0
- package/dist/schemas/capabilities.d.ts +90 -0
- package/dist/schemas/capabilities.d.ts.map +1 -0
- package/dist/schemas/capabilities.js +59 -0
- package/dist/schemas/capabilities.js.map +1 -0
- package/dist/schemas/common.d.ts +66 -0
- package/dist/schemas/common.d.ts.map +1 -0
- package/dist/schemas/common.js +97 -0
- package/dist/schemas/common.js.map +1 -0
- package/dist/schemas/connect.d.ts +111 -0
- package/dist/schemas/connect.d.ts.map +1 -0
- package/dist/schemas/connect.js +46 -0
- package/dist/schemas/connect.js.map +1 -0
- package/dist/schemas/device.d.ts +221 -0
- package/dist/schemas/device.d.ts.map +1 -0
- package/dist/schemas/device.js +59 -0
- package/dist/schemas/device.js.map +1 -0
- package/dist/schemas/discovery.d.ts +892 -0
- package/dist/schemas/discovery.d.ts.map +1 -0
- package/dist/schemas/discovery.js +66 -0
- package/dist/schemas/discovery.js.map +1 -0
- package/dist/schemas/document.d.ts +351 -0
- package/dist/schemas/document.d.ts.map +1 -0
- package/dist/schemas/document.js +103 -0
- package/dist/schemas/document.js.map +1 -0
- package/dist/schemas/env.d.ts +265 -0
- package/dist/schemas/env.d.ts.map +1 -0
- package/dist/schemas/env.js +44 -0
- package/dist/schemas/env.js.map +1 -0
- package/dist/schemas/file.d.ts +274 -0
- package/dist/schemas/file.d.ts.map +1 -0
- package/dist/schemas/file.js +72 -0
- package/dist/schemas/file.js.map +1 -0
- package/dist/schemas/hook.d.ts +132 -0
- package/dist/schemas/hook.d.ts.map +1 -0
- package/dist/schemas/hook.js +58 -0
- package/dist/schemas/hook.js.map +1 -0
- package/dist/schemas/interaction.d.ts +1583 -0
- package/dist/schemas/interaction.d.ts.map +1 -0
- package/dist/schemas/interaction.js +112 -0
- package/dist/schemas/interaction.js.map +1 -0
- package/dist/schemas/jsonrpc.d.ts +314 -0
- package/dist/schemas/jsonrpc.d.ts.map +1 -0
- package/dist/schemas/jsonrpc.js +64 -0
- package/dist/schemas/jsonrpc.js.map +1 -0
- package/dist/schemas/methods.d.ts +3826 -0
- package/dist/schemas/methods.d.ts.map +1 -0
- package/dist/schemas/methods.js +311 -0
- package/dist/schemas/methods.js.map +1 -0
- package/dist/schemas/policy.d.ts +81 -0
- package/dist/schemas/policy.d.ts.map +1 -0
- package/dist/schemas/policy.js +66 -0
- package/dist/schemas/policy.js.map +1 -0
- package/dist/schemas/project.d.ts +506 -0
- package/dist/schemas/project.d.ts.map +1 -0
- package/dist/schemas/project.js +148 -0
- package/dist/schemas/project.js.map +1 -0
- package/dist/schemas/session.d.ts +730 -0
- package/dist/schemas/session.d.ts.map +1 -0
- package/dist/schemas/session.js +287 -0
- package/dist/schemas/session.js.map +1 -0
- package/dist/schemas/skill.d.ts +465 -0
- package/dist/schemas/skill.d.ts.map +1 -0
- package/dist/schemas/skill.js +103 -0
- package/dist/schemas/skill.js.map +1 -0
- package/dist/schemas/stream.d.ts +688 -0
- package/dist/schemas/stream.d.ts.map +1 -0
- package/dist/schemas/stream.js +133 -0
- package/dist/schemas/stream.js.map +1 -0
- package/package.json +52 -0
- package/src/index.ts +24 -0
- package/src/schemas/capabilities.ts +62 -0
- package/src/schemas/common.ts +119 -0
- package/src/schemas/connect.ts +50 -0
- package/src/schemas/device.ts +67 -0
- package/src/schemas/discovery.ts +80 -0
- package/src/schemas/document.ts +121 -0
- package/src/schemas/env.ts +60 -0
- package/src/schemas/file.ts +97 -0
- package/src/schemas/hook.ts +66 -0
- package/src/schemas/interaction.ts +135 -0
- package/src/schemas/jsonrpc.ts +80 -0
- package/src/schemas/methods.ts +414 -0
- package/src/schemas/policy.ts +71 -0
- package/src/schemas/project.ts +185 -0
- package/src/schemas/session.ts +336 -0
- package/src/schemas/skill.ts +121 -0
- package/src/schemas/stream.ts +149 -0
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
{
|
|
2
|
+
"direction": "s2p",
|
|
3
|
+
"kind": "request",
|
|
4
|
+
"params": {
|
|
5
|
+
"$ref": "#/definitions/skill.list.params",
|
|
6
|
+
"definitions": {
|
|
7
|
+
"skill.list.params": {
|
|
8
|
+
"type": "object",
|
|
9
|
+
"properties": {
|
|
10
|
+
"agent": {
|
|
11
|
+
"type": "string",
|
|
12
|
+
"minLength": 1
|
|
13
|
+
},
|
|
14
|
+
"scope": {
|
|
15
|
+
"type": "string",
|
|
16
|
+
"enum": [
|
|
17
|
+
"global",
|
|
18
|
+
"project"
|
|
19
|
+
]
|
|
20
|
+
},
|
|
21
|
+
"projectId": {
|
|
22
|
+
"type": "string",
|
|
23
|
+
"minLength": 1
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
"additionalProperties": false
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
"$schema": "http://json-schema.org/draft-07/schema#"
|
|
30
|
+
},
|
|
31
|
+
"result": {
|
|
32
|
+
"$ref": "#/definitions/skill.list.result",
|
|
33
|
+
"definitions": {
|
|
34
|
+
"skill.list.result": {
|
|
35
|
+
"type": "object",
|
|
36
|
+
"properties": {
|
|
37
|
+
"skills": {
|
|
38
|
+
"type": "array",
|
|
39
|
+
"items": {
|
|
40
|
+
"type": "object",
|
|
41
|
+
"properties": {
|
|
42
|
+
"name": {
|
|
43
|
+
"type": "string",
|
|
44
|
+
"minLength": 1
|
|
45
|
+
},
|
|
46
|
+
"agent": {
|
|
47
|
+
"type": "string",
|
|
48
|
+
"minLength": 1
|
|
49
|
+
},
|
|
50
|
+
"scope": {
|
|
51
|
+
"type": "string",
|
|
52
|
+
"enum": [
|
|
53
|
+
"global",
|
|
54
|
+
"project"
|
|
55
|
+
]
|
|
56
|
+
},
|
|
57
|
+
"projectId": {
|
|
58
|
+
"type": "string",
|
|
59
|
+
"minLength": 1
|
|
60
|
+
},
|
|
61
|
+
"version": {
|
|
62
|
+
"type": "string"
|
|
63
|
+
},
|
|
64
|
+
"hash": {
|
|
65
|
+
"type": "string"
|
|
66
|
+
},
|
|
67
|
+
"compatibleAgents": {
|
|
68
|
+
"type": "array",
|
|
69
|
+
"items": {
|
|
70
|
+
"$ref": "#/definitions/skill.list.result/properties/skills/items/properties/agent"
|
|
71
|
+
}
|
|
72
|
+
},
|
|
73
|
+
"sourceTrusted": {
|
|
74
|
+
"type": "boolean"
|
|
75
|
+
},
|
|
76
|
+
"installedPath": {
|
|
77
|
+
"type": "string"
|
|
78
|
+
},
|
|
79
|
+
"installedAt": {
|
|
80
|
+
"type": "string",
|
|
81
|
+
"format": "date-time"
|
|
82
|
+
}
|
|
83
|
+
},
|
|
84
|
+
"required": [
|
|
85
|
+
"name",
|
|
86
|
+
"agent",
|
|
87
|
+
"scope"
|
|
88
|
+
],
|
|
89
|
+
"additionalProperties": false
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
},
|
|
93
|
+
"required": [
|
|
94
|
+
"skills"
|
|
95
|
+
],
|
|
96
|
+
"additionalProperties": false
|
|
97
|
+
}
|
|
98
|
+
},
|
|
99
|
+
"$schema": "http://json-schema.org/draft-07/schema#"
|
|
100
|
+
}
|
|
101
|
+
}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
{
|
|
2
|
+
"direction": "s2p",
|
|
3
|
+
"kind": "request",
|
|
4
|
+
"params": {
|
|
5
|
+
"$ref": "#/definitions/skill.uninstall.params",
|
|
6
|
+
"definitions": {
|
|
7
|
+
"skill.uninstall.params": {
|
|
8
|
+
"type": "object",
|
|
9
|
+
"properties": {
|
|
10
|
+
"agent": {
|
|
11
|
+
"type": "string",
|
|
12
|
+
"minLength": 1
|
|
13
|
+
},
|
|
14
|
+
"name": {
|
|
15
|
+
"type": "string",
|
|
16
|
+
"minLength": 1
|
|
17
|
+
},
|
|
18
|
+
"scope": {
|
|
19
|
+
"type": "string",
|
|
20
|
+
"enum": [
|
|
21
|
+
"global",
|
|
22
|
+
"project"
|
|
23
|
+
]
|
|
24
|
+
},
|
|
25
|
+
"projectId": {
|
|
26
|
+
"type": "string",
|
|
27
|
+
"minLength": 1
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
"required": [
|
|
31
|
+
"agent",
|
|
32
|
+
"name",
|
|
33
|
+
"scope"
|
|
34
|
+
],
|
|
35
|
+
"additionalProperties": false
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
"$schema": "http://json-schema.org/draft-07/schema#"
|
|
39
|
+
},
|
|
40
|
+
"result": {
|
|
41
|
+
"$ref": "#/definitions/skill.uninstall.result",
|
|
42
|
+
"definitions": {
|
|
43
|
+
"skill.uninstall.result": {
|
|
44
|
+
"type": "object",
|
|
45
|
+
"properties": {
|
|
46
|
+
"agent": {
|
|
47
|
+
"type": "string",
|
|
48
|
+
"minLength": 1
|
|
49
|
+
},
|
|
50
|
+
"name": {
|
|
51
|
+
"type": "string"
|
|
52
|
+
},
|
|
53
|
+
"scope": {
|
|
54
|
+
"type": "string",
|
|
55
|
+
"enum": [
|
|
56
|
+
"global",
|
|
57
|
+
"project"
|
|
58
|
+
]
|
|
59
|
+
},
|
|
60
|
+
"uninstalled": {
|
|
61
|
+
"type": "boolean",
|
|
62
|
+
"const": true
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
"required": [
|
|
66
|
+
"agent",
|
|
67
|
+
"name",
|
|
68
|
+
"scope",
|
|
69
|
+
"uninstalled"
|
|
70
|
+
],
|
|
71
|
+
"additionalProperties": false
|
|
72
|
+
}
|
|
73
|
+
},
|
|
74
|
+
"$schema": "http://json-schema.org/draft-07/schema#"
|
|
75
|
+
}
|
|
76
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
{
|
|
2
|
+
"direction": "s2p",
|
|
3
|
+
"kind": "notification",
|
|
4
|
+
"params": {
|
|
5
|
+
"$ref": "#/definitions/stream.ack.params",
|
|
6
|
+
"definitions": {
|
|
7
|
+
"stream.ack.params": {
|
|
8
|
+
"type": "object",
|
|
9
|
+
"properties": {
|
|
10
|
+
"sessionId": {
|
|
11
|
+
"type": "string",
|
|
12
|
+
"minLength": 1
|
|
13
|
+
},
|
|
14
|
+
"lastSeq": {
|
|
15
|
+
"type": "integer",
|
|
16
|
+
"minimum": 0
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
"required": [
|
|
20
|
+
"lastSeq"
|
|
21
|
+
],
|
|
22
|
+
"additionalProperties": false
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
"$schema": "http://json-schema.org/draft-07/schema#"
|
|
26
|
+
},
|
|
27
|
+
"result": {
|
|
28
|
+
"$ref": "#/definitions/stream.ack.result",
|
|
29
|
+
"definitions": {
|
|
30
|
+
"stream.ack.result": {
|
|
31
|
+
"not": {}
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
"$schema": "http://json-schema.org/draft-07/schema#"
|
|
35
|
+
}
|
|
36
|
+
}
|
|
@@ -0,0 +1,381 @@
|
|
|
1
|
+
{
|
|
2
|
+
"direction": "p2s",
|
|
3
|
+
"kind": "notification",
|
|
4
|
+
"params": {
|
|
5
|
+
"$ref": "#/definitions/stream.event.params",
|
|
6
|
+
"definitions": {
|
|
7
|
+
"stream.event.params": {
|
|
8
|
+
"anyOf": [
|
|
9
|
+
{
|
|
10
|
+
"type": "object",
|
|
11
|
+
"properties": {
|
|
12
|
+
"sessionId": {
|
|
13
|
+
"type": "string",
|
|
14
|
+
"minLength": 1
|
|
15
|
+
},
|
|
16
|
+
"turnId": {
|
|
17
|
+
"type": "string"
|
|
18
|
+
},
|
|
19
|
+
"origin": {
|
|
20
|
+
"type": "string",
|
|
21
|
+
"enum": [
|
|
22
|
+
"solicited",
|
|
23
|
+
"unsolicited"
|
|
24
|
+
],
|
|
25
|
+
"default": "solicited"
|
|
26
|
+
},
|
|
27
|
+
"source": {
|
|
28
|
+
"type": "string"
|
|
29
|
+
},
|
|
30
|
+
"seq": {
|
|
31
|
+
"type": "integer",
|
|
32
|
+
"minimum": 0
|
|
33
|
+
},
|
|
34
|
+
"at": {
|
|
35
|
+
"type": "string",
|
|
36
|
+
"format": "date-time"
|
|
37
|
+
},
|
|
38
|
+
"type": {
|
|
39
|
+
"type": "string",
|
|
40
|
+
"const": "message"
|
|
41
|
+
},
|
|
42
|
+
"role": {
|
|
43
|
+
"type": "string",
|
|
44
|
+
"enum": [
|
|
45
|
+
"assistant",
|
|
46
|
+
"user",
|
|
47
|
+
"system"
|
|
48
|
+
],
|
|
49
|
+
"default": "assistant"
|
|
50
|
+
},
|
|
51
|
+
"text": {
|
|
52
|
+
"type": "string"
|
|
53
|
+
},
|
|
54
|
+
"delta": {
|
|
55
|
+
"type": "boolean",
|
|
56
|
+
"default": false
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
"required": [
|
|
60
|
+
"sessionId",
|
|
61
|
+
"turnId",
|
|
62
|
+
"seq",
|
|
63
|
+
"at",
|
|
64
|
+
"type",
|
|
65
|
+
"text"
|
|
66
|
+
],
|
|
67
|
+
"additionalProperties": false
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
"type": "object",
|
|
71
|
+
"properties": {
|
|
72
|
+
"sessionId": {
|
|
73
|
+
"$ref": "#/definitions/stream.event.params/anyOf/0/properties/sessionId"
|
|
74
|
+
},
|
|
75
|
+
"turnId": {
|
|
76
|
+
"$ref": "#/definitions/stream.event.params/anyOf/0/properties/turnId"
|
|
77
|
+
},
|
|
78
|
+
"origin": {
|
|
79
|
+
"$ref": "#/definitions/stream.event.params/anyOf/0/properties/origin"
|
|
80
|
+
},
|
|
81
|
+
"source": {
|
|
82
|
+
"$ref": "#/definitions/stream.event.params/anyOf/0/properties/source"
|
|
83
|
+
},
|
|
84
|
+
"seq": {
|
|
85
|
+
"$ref": "#/definitions/stream.event.params/anyOf/0/properties/seq"
|
|
86
|
+
},
|
|
87
|
+
"at": {
|
|
88
|
+
"$ref": "#/definitions/stream.event.params/anyOf/0/properties/at"
|
|
89
|
+
},
|
|
90
|
+
"type": {
|
|
91
|
+
"type": "string",
|
|
92
|
+
"const": "thinking"
|
|
93
|
+
},
|
|
94
|
+
"text": {
|
|
95
|
+
"type": "string"
|
|
96
|
+
},
|
|
97
|
+
"delta": {
|
|
98
|
+
"type": "boolean",
|
|
99
|
+
"default": false
|
|
100
|
+
}
|
|
101
|
+
},
|
|
102
|
+
"required": [
|
|
103
|
+
"sessionId",
|
|
104
|
+
"turnId",
|
|
105
|
+
"seq",
|
|
106
|
+
"at",
|
|
107
|
+
"type",
|
|
108
|
+
"text"
|
|
109
|
+
],
|
|
110
|
+
"additionalProperties": false
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
"type": "object",
|
|
114
|
+
"properties": {
|
|
115
|
+
"sessionId": {
|
|
116
|
+
"$ref": "#/definitions/stream.event.params/anyOf/0/properties/sessionId"
|
|
117
|
+
},
|
|
118
|
+
"turnId": {
|
|
119
|
+
"$ref": "#/definitions/stream.event.params/anyOf/0/properties/turnId"
|
|
120
|
+
},
|
|
121
|
+
"origin": {
|
|
122
|
+
"$ref": "#/definitions/stream.event.params/anyOf/0/properties/origin"
|
|
123
|
+
},
|
|
124
|
+
"source": {
|
|
125
|
+
"$ref": "#/definitions/stream.event.params/anyOf/0/properties/source"
|
|
126
|
+
},
|
|
127
|
+
"seq": {
|
|
128
|
+
"$ref": "#/definitions/stream.event.params/anyOf/0/properties/seq"
|
|
129
|
+
},
|
|
130
|
+
"at": {
|
|
131
|
+
"$ref": "#/definitions/stream.event.params/anyOf/0/properties/at"
|
|
132
|
+
},
|
|
133
|
+
"type": {
|
|
134
|
+
"type": "string",
|
|
135
|
+
"const": "tool_call"
|
|
136
|
+
},
|
|
137
|
+
"toolName": {
|
|
138
|
+
"type": "string"
|
|
139
|
+
},
|
|
140
|
+
"args": {},
|
|
141
|
+
"toolCallId": {
|
|
142
|
+
"type": "string"
|
|
143
|
+
}
|
|
144
|
+
},
|
|
145
|
+
"required": [
|
|
146
|
+
"sessionId",
|
|
147
|
+
"turnId",
|
|
148
|
+
"seq",
|
|
149
|
+
"at",
|
|
150
|
+
"type",
|
|
151
|
+
"toolName"
|
|
152
|
+
],
|
|
153
|
+
"additionalProperties": false
|
|
154
|
+
},
|
|
155
|
+
{
|
|
156
|
+
"type": "object",
|
|
157
|
+
"properties": {
|
|
158
|
+
"sessionId": {
|
|
159
|
+
"$ref": "#/definitions/stream.event.params/anyOf/0/properties/sessionId"
|
|
160
|
+
},
|
|
161
|
+
"turnId": {
|
|
162
|
+
"$ref": "#/definitions/stream.event.params/anyOf/0/properties/turnId"
|
|
163
|
+
},
|
|
164
|
+
"origin": {
|
|
165
|
+
"$ref": "#/definitions/stream.event.params/anyOf/0/properties/origin"
|
|
166
|
+
},
|
|
167
|
+
"source": {
|
|
168
|
+
"$ref": "#/definitions/stream.event.params/anyOf/0/properties/source"
|
|
169
|
+
},
|
|
170
|
+
"seq": {
|
|
171
|
+
"$ref": "#/definitions/stream.event.params/anyOf/0/properties/seq"
|
|
172
|
+
},
|
|
173
|
+
"at": {
|
|
174
|
+
"$ref": "#/definitions/stream.event.params/anyOf/0/properties/at"
|
|
175
|
+
},
|
|
176
|
+
"type": {
|
|
177
|
+
"type": "string",
|
|
178
|
+
"const": "tool_result"
|
|
179
|
+
},
|
|
180
|
+
"toolName": {
|
|
181
|
+
"type": "string"
|
|
182
|
+
},
|
|
183
|
+
"toolCallId": {
|
|
184
|
+
"type": "string"
|
|
185
|
+
},
|
|
186
|
+
"ok": {
|
|
187
|
+
"type": "boolean"
|
|
188
|
+
},
|
|
189
|
+
"output": {}
|
|
190
|
+
},
|
|
191
|
+
"required": [
|
|
192
|
+
"sessionId",
|
|
193
|
+
"turnId",
|
|
194
|
+
"seq",
|
|
195
|
+
"at",
|
|
196
|
+
"type",
|
|
197
|
+
"toolName",
|
|
198
|
+
"ok"
|
|
199
|
+
],
|
|
200
|
+
"additionalProperties": false
|
|
201
|
+
},
|
|
202
|
+
{
|
|
203
|
+
"type": "object",
|
|
204
|
+
"properties": {
|
|
205
|
+
"sessionId": {
|
|
206
|
+
"$ref": "#/definitions/stream.event.params/anyOf/0/properties/sessionId"
|
|
207
|
+
},
|
|
208
|
+
"turnId": {
|
|
209
|
+
"$ref": "#/definitions/stream.event.params/anyOf/0/properties/turnId"
|
|
210
|
+
},
|
|
211
|
+
"origin": {
|
|
212
|
+
"$ref": "#/definitions/stream.event.params/anyOf/0/properties/origin"
|
|
213
|
+
},
|
|
214
|
+
"source": {
|
|
215
|
+
"$ref": "#/definitions/stream.event.params/anyOf/0/properties/source"
|
|
216
|
+
},
|
|
217
|
+
"seq": {
|
|
218
|
+
"$ref": "#/definitions/stream.event.params/anyOf/0/properties/seq"
|
|
219
|
+
},
|
|
220
|
+
"at": {
|
|
221
|
+
"$ref": "#/definitions/stream.event.params/anyOf/0/properties/at"
|
|
222
|
+
},
|
|
223
|
+
"type": {
|
|
224
|
+
"type": "string",
|
|
225
|
+
"const": "token"
|
|
226
|
+
},
|
|
227
|
+
"text": {
|
|
228
|
+
"type": "string"
|
|
229
|
+
}
|
|
230
|
+
},
|
|
231
|
+
"required": [
|
|
232
|
+
"sessionId",
|
|
233
|
+
"turnId",
|
|
234
|
+
"seq",
|
|
235
|
+
"at",
|
|
236
|
+
"type",
|
|
237
|
+
"text"
|
|
238
|
+
],
|
|
239
|
+
"additionalProperties": false
|
|
240
|
+
},
|
|
241
|
+
{
|
|
242
|
+
"type": "object",
|
|
243
|
+
"properties": {
|
|
244
|
+
"sessionId": {
|
|
245
|
+
"$ref": "#/definitions/stream.event.params/anyOf/0/properties/sessionId"
|
|
246
|
+
},
|
|
247
|
+
"turnId": {
|
|
248
|
+
"$ref": "#/definitions/stream.event.params/anyOf/0/properties/turnId"
|
|
249
|
+
},
|
|
250
|
+
"origin": {
|
|
251
|
+
"$ref": "#/definitions/stream.event.params/anyOf/0/properties/origin"
|
|
252
|
+
},
|
|
253
|
+
"source": {
|
|
254
|
+
"$ref": "#/definitions/stream.event.params/anyOf/0/properties/source"
|
|
255
|
+
},
|
|
256
|
+
"seq": {
|
|
257
|
+
"$ref": "#/definitions/stream.event.params/anyOf/0/properties/seq"
|
|
258
|
+
},
|
|
259
|
+
"at": {
|
|
260
|
+
"$ref": "#/definitions/stream.event.params/anyOf/0/properties/at"
|
|
261
|
+
},
|
|
262
|
+
"type": {
|
|
263
|
+
"type": "string",
|
|
264
|
+
"const": "result"
|
|
265
|
+
},
|
|
266
|
+
"text": {
|
|
267
|
+
"type": "string"
|
|
268
|
+
},
|
|
269
|
+
"usage": {
|
|
270
|
+
"type": "object",
|
|
271
|
+
"properties": {
|
|
272
|
+
"inputTokens": {
|
|
273
|
+
"type": "integer",
|
|
274
|
+
"minimum": 0
|
|
275
|
+
},
|
|
276
|
+
"outputTokens": {
|
|
277
|
+
"type": "integer",
|
|
278
|
+
"minimum": 0
|
|
279
|
+
}
|
|
280
|
+
},
|
|
281
|
+
"additionalProperties": false
|
|
282
|
+
},
|
|
283
|
+
"status": {
|
|
284
|
+
"type": "string",
|
|
285
|
+
"enum": [
|
|
286
|
+
"completed",
|
|
287
|
+
"interrupted",
|
|
288
|
+
"aborted",
|
|
289
|
+
"failed",
|
|
290
|
+
"timeout"
|
|
291
|
+
],
|
|
292
|
+
"default": "completed"
|
|
293
|
+
},
|
|
294
|
+
"final": {
|
|
295
|
+
"type": "boolean",
|
|
296
|
+
"const": true
|
|
297
|
+
}
|
|
298
|
+
},
|
|
299
|
+
"required": [
|
|
300
|
+
"sessionId",
|
|
301
|
+
"turnId",
|
|
302
|
+
"seq",
|
|
303
|
+
"at",
|
|
304
|
+
"type",
|
|
305
|
+
"text",
|
|
306
|
+
"final"
|
|
307
|
+
],
|
|
308
|
+
"additionalProperties": false
|
|
309
|
+
},
|
|
310
|
+
{
|
|
311
|
+
"type": "object",
|
|
312
|
+
"properties": {
|
|
313
|
+
"sessionId": {
|
|
314
|
+
"$ref": "#/definitions/stream.event.params/anyOf/0/properties/sessionId"
|
|
315
|
+
},
|
|
316
|
+
"turnId": {
|
|
317
|
+
"$ref": "#/definitions/stream.event.params/anyOf/0/properties/turnId"
|
|
318
|
+
},
|
|
319
|
+
"origin": {
|
|
320
|
+
"$ref": "#/definitions/stream.event.params/anyOf/0/properties/origin"
|
|
321
|
+
},
|
|
322
|
+
"source": {
|
|
323
|
+
"$ref": "#/definitions/stream.event.params/anyOf/0/properties/source"
|
|
324
|
+
},
|
|
325
|
+
"seq": {
|
|
326
|
+
"$ref": "#/definitions/stream.event.params/anyOf/0/properties/seq"
|
|
327
|
+
},
|
|
328
|
+
"at": {
|
|
329
|
+
"$ref": "#/definitions/stream.event.params/anyOf/0/properties/at"
|
|
330
|
+
},
|
|
331
|
+
"type": {
|
|
332
|
+
"type": "string",
|
|
333
|
+
"const": "error"
|
|
334
|
+
},
|
|
335
|
+
"message": {
|
|
336
|
+
"type": "string"
|
|
337
|
+
},
|
|
338
|
+
"appCode": {
|
|
339
|
+
"type": "string"
|
|
340
|
+
},
|
|
341
|
+
"status": {
|
|
342
|
+
"type": "string",
|
|
343
|
+
"enum": [
|
|
344
|
+
"failed",
|
|
345
|
+
"aborted",
|
|
346
|
+
"timeout",
|
|
347
|
+
"interrupted"
|
|
348
|
+
],
|
|
349
|
+
"default": "failed"
|
|
350
|
+
},
|
|
351
|
+
"final": {
|
|
352
|
+
"type": "boolean",
|
|
353
|
+
"const": true
|
|
354
|
+
}
|
|
355
|
+
},
|
|
356
|
+
"required": [
|
|
357
|
+
"sessionId",
|
|
358
|
+
"turnId",
|
|
359
|
+
"seq",
|
|
360
|
+
"at",
|
|
361
|
+
"type",
|
|
362
|
+
"message",
|
|
363
|
+
"final"
|
|
364
|
+
],
|
|
365
|
+
"additionalProperties": false
|
|
366
|
+
}
|
|
367
|
+
]
|
|
368
|
+
}
|
|
369
|
+
},
|
|
370
|
+
"$schema": "http://json-schema.org/draft-07/schema#"
|
|
371
|
+
},
|
|
372
|
+
"result": {
|
|
373
|
+
"$ref": "#/definitions/stream.event.result",
|
|
374
|
+
"definitions": {
|
|
375
|
+
"stream.event.result": {
|
|
376
|
+
"not": {}
|
|
377
|
+
}
|
|
378
|
+
},
|
|
379
|
+
"$schema": "http://json-schema.org/draft-07/schema#"
|
|
380
|
+
}
|
|
381
|
+
}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
/**
|
|
3
|
+
* Hook 类型 — 归一化的拦截点(design §8)。
|
|
4
|
+
* adapter 负责把各家原生 hook 点(Codex hooks / Claude Code PreToolUse /
|
|
5
|
+
* OpenClaw 审批…)映射成这些归一化类型。
|
|
6
|
+
*/
|
|
7
|
+
export declare const HookType: z.ZodEnum<["pre_tool", "post_tool", "pre_command", "pre_file_write", "pre_network", "session_start", "session_end", "notification"]>;
|
|
8
|
+
export type HookType = z.infer<typeof HookType>;
|
|
9
|
+
/**
|
|
10
|
+
* Adapter 能力声明(design §7)。
|
|
11
|
+
* adapter 不假装统一,而是声明自己原生支持什么,phonon core 据此补齐缺口。
|
|
12
|
+
* 这份能力随 discovery 一起暴露给服务端,服务端先知能力再决定怎么用。
|
|
13
|
+
*/
|
|
14
|
+
export declare const AgentCapabilities: z.ZodObject<{
|
|
15
|
+
/** 原生 session / resume(无则由 core 用注册表模拟)。 */
|
|
16
|
+
nativeSession: z.ZodBoolean;
|
|
17
|
+
/** 原生上下文压缩(决定 session.compress mode=native 是否可用)。 */
|
|
18
|
+
nativeCompression: z.ZodBoolean;
|
|
19
|
+
/** 原生上下文注入。 */
|
|
20
|
+
contextInjection: z.ZodBoolean;
|
|
21
|
+
/**
|
|
22
|
+
* 是否会**主动/非请求触发地输出**(design 订阅模型)。
|
|
23
|
+
* OpenClaw 这类有 cron/心跳/定时任务,同一 session 内会不定期自发冲泡 → true;
|
|
24
|
+
* Codex 这类一次性,流到结果就结束 → false。
|
|
25
|
+
* server 据此判断哪些 session 需要长期保持监听。
|
|
26
|
+
*/
|
|
27
|
+
proactiveOutput: z.ZodBoolean;
|
|
28
|
+
/** 是否支持同会话中途切换模型(design D16)。 */
|
|
29
|
+
modelSwitch: z.ZodBoolean;
|
|
30
|
+
/** 是否支持打断正在进行的 turn(session.interrupt / whenBusy=interrupt,D18)。 */
|
|
31
|
+
interrupt: z.ZodBoolean;
|
|
32
|
+
/** 是否支持中途插入输入(下一次 tool call 边界,whenBusy=inject,D18)。 */
|
|
33
|
+
injectMidTurn: z.ZodBoolean;
|
|
34
|
+
/** 是否支持给该 agent 安装/卸载 skill(skill.* 接口,D24)。 */
|
|
35
|
+
skillManagement: z.ZodBoolean;
|
|
36
|
+
/** 原生支持的 hook 点(其余由 core 尽力补齐或不支持)。 */
|
|
37
|
+
hooks: z.ZodArray<z.ZodEnum<["pre_tool", "post_tool", "pre_command", "pre_file_write", "pre_network", "session_start", "session_end", "notification"]>, "many">;
|
|
38
|
+
/** 是否支持流式输出。 */
|
|
39
|
+
streaming: z.ZodBoolean;
|
|
40
|
+
/**
|
|
41
|
+
* 可选调度限制(P2-13):server 据此做调度/背压。
|
|
42
|
+
*/
|
|
43
|
+
limits: z.ZodOptional<z.ZodObject<{
|
|
44
|
+
maxConcurrentSessions: z.ZodOptional<z.ZodNumber>;
|
|
45
|
+
maxContextTokens: z.ZodOptional<z.ZodNumber>;
|
|
46
|
+
maxMessageBytes: z.ZodOptional<z.ZodNumber>;
|
|
47
|
+
}, "strip", z.ZodTypeAny, {
|
|
48
|
+
maxConcurrentSessions?: number | undefined;
|
|
49
|
+
maxContextTokens?: number | undefined;
|
|
50
|
+
maxMessageBytes?: number | undefined;
|
|
51
|
+
}, {
|
|
52
|
+
maxConcurrentSessions?: number | undefined;
|
|
53
|
+
maxContextTokens?: number | undefined;
|
|
54
|
+
maxMessageBytes?: number | undefined;
|
|
55
|
+
}>>;
|
|
56
|
+
}, "strip", z.ZodTypeAny, {
|
|
57
|
+
nativeSession: boolean;
|
|
58
|
+
nativeCompression: boolean;
|
|
59
|
+
contextInjection: boolean;
|
|
60
|
+
proactiveOutput: boolean;
|
|
61
|
+
modelSwitch: boolean;
|
|
62
|
+
interrupt: boolean;
|
|
63
|
+
injectMidTurn: boolean;
|
|
64
|
+
skillManagement: boolean;
|
|
65
|
+
hooks: ("pre_tool" | "post_tool" | "pre_command" | "pre_file_write" | "pre_network" | "session_start" | "session_end" | "notification")[];
|
|
66
|
+
streaming: boolean;
|
|
67
|
+
limits?: {
|
|
68
|
+
maxConcurrentSessions?: number | undefined;
|
|
69
|
+
maxContextTokens?: number | undefined;
|
|
70
|
+
maxMessageBytes?: number | undefined;
|
|
71
|
+
} | undefined;
|
|
72
|
+
}, {
|
|
73
|
+
nativeSession: boolean;
|
|
74
|
+
nativeCompression: boolean;
|
|
75
|
+
contextInjection: boolean;
|
|
76
|
+
proactiveOutput: boolean;
|
|
77
|
+
modelSwitch: boolean;
|
|
78
|
+
interrupt: boolean;
|
|
79
|
+
injectMidTurn: boolean;
|
|
80
|
+
skillManagement: boolean;
|
|
81
|
+
hooks: ("pre_tool" | "post_tool" | "pre_command" | "pre_file_write" | "pre_network" | "session_start" | "session_end" | "notification")[];
|
|
82
|
+
streaming: boolean;
|
|
83
|
+
limits?: {
|
|
84
|
+
maxConcurrentSessions?: number | undefined;
|
|
85
|
+
maxContextTokens?: number | undefined;
|
|
86
|
+
maxMessageBytes?: number | undefined;
|
|
87
|
+
} | undefined;
|
|
88
|
+
}>;
|
|
89
|
+
export type AgentCapabilities = z.infer<typeof AgentCapabilities>;
|
|
90
|
+
//# sourceMappingURL=capabilities.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"capabilities.d.ts","sourceRoot":"","sources":["../../src/schemas/capabilities.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;;GAIG;AACH,eAAO,MAAM,QAAQ,sIASnB,CAAC;AACH,MAAM,MAAM,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,QAAQ,CAAC,CAAC;AAEhD;;;;GAIG;AACH,eAAO,MAAM,iBAAiB;IAC5B,4CAA4C;;IAE5C,qDAAqD;;IAErD,eAAe;;IAEf;;;;;OAKG;;IAEH,iCAAiC;;IAEjC,oEAAoE;;IAEpE,wDAAwD;;IAExD,gDAAgD;;IAEhD,uCAAuC;;IAEvC,gBAAgB;;IAEhB;;OAEG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAQH,CAAC;AACH,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC"}
|