@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.
Files changed (127) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +70 -0
  3. package/dist/index.d.ts +24 -0
  4. package/dist/index.d.ts.map +1 -0
  5. package/dist/index.js +24 -0
  6. package/dist/index.js.map +1 -0
  7. package/dist/json-schema/_index.json +3794 -0
  8. package/dist/json-schema/connect.hello.json +117 -0
  9. package/dist/json-schema/discovery.changed.json +190 -0
  10. package/dist/json-schema/discovery.get.json +183 -0
  11. package/dist/json-schema/discovery.list.json +182 -0
  12. package/dist/json-schema/document.prepare_upload.json +96 -0
  13. package/dist/json-schema/document.send.json +165 -0
  14. package/dist/json-schema/hook.fired.json +100 -0
  15. package/dist/json-schema/hook.resolve.json +96 -0
  16. package/dist/json-schema/interaction.cancel.json +48 -0
  17. package/dist/json-schema/interaction.request.json +376 -0
  18. package/dist/json-schema/interaction.response.json +68 -0
  19. package/dist/json-schema/project.create.json +89 -0
  20. package/dist/json-schema/project.get.json +76 -0
  21. package/dist/json-schema/project.git.deleteBranch.json +64 -0
  22. package/dist/json-schema/project.list.json +72 -0
  23. package/dist/json-schema/project.remove.json +69 -0
  24. package/dist/json-schema/project.worktree.create.json +88 -0
  25. package/dist/json-schema/project.worktree.list.json +77 -0
  26. package/dist/json-schema/project.worktree.remove.json +61 -0
  27. package/dist/json-schema/session.compress.json +72 -0
  28. package/dist/json-schema/session.create.json +128 -0
  29. package/dist/json-schema/session.inject.json +72 -0
  30. package/dist/json-schema/session.interrupt.json +58 -0
  31. package/dist/json-schema/session.list.json +127 -0
  32. package/dist/json-schema/session.send.json +132 -0
  33. package/dist/json-schema/session.status.json +94 -0
  34. package/dist/json-schema/session.switchModel.json +73 -0
  35. package/dist/json-schema/session.terminate.json +54 -0
  36. package/dist/json-schema/skill.install.json +171 -0
  37. package/dist/json-schema/skill.list.json +101 -0
  38. package/dist/json-schema/skill.uninstall.json +76 -0
  39. package/dist/json-schema/stream.ack.json +36 -0
  40. package/dist/json-schema/stream.event.json +381 -0
  41. package/dist/schemas/capabilities.d.ts +90 -0
  42. package/dist/schemas/capabilities.d.ts.map +1 -0
  43. package/dist/schemas/capabilities.js +59 -0
  44. package/dist/schemas/capabilities.js.map +1 -0
  45. package/dist/schemas/common.d.ts +66 -0
  46. package/dist/schemas/common.d.ts.map +1 -0
  47. package/dist/schemas/common.js +97 -0
  48. package/dist/schemas/common.js.map +1 -0
  49. package/dist/schemas/connect.d.ts +111 -0
  50. package/dist/schemas/connect.d.ts.map +1 -0
  51. package/dist/schemas/connect.js +46 -0
  52. package/dist/schemas/connect.js.map +1 -0
  53. package/dist/schemas/device.d.ts +221 -0
  54. package/dist/schemas/device.d.ts.map +1 -0
  55. package/dist/schemas/device.js +59 -0
  56. package/dist/schemas/device.js.map +1 -0
  57. package/dist/schemas/discovery.d.ts +892 -0
  58. package/dist/schemas/discovery.d.ts.map +1 -0
  59. package/dist/schemas/discovery.js +66 -0
  60. package/dist/schemas/discovery.js.map +1 -0
  61. package/dist/schemas/document.d.ts +351 -0
  62. package/dist/schemas/document.d.ts.map +1 -0
  63. package/dist/schemas/document.js +103 -0
  64. package/dist/schemas/document.js.map +1 -0
  65. package/dist/schemas/env.d.ts +265 -0
  66. package/dist/schemas/env.d.ts.map +1 -0
  67. package/dist/schemas/env.js +44 -0
  68. package/dist/schemas/env.js.map +1 -0
  69. package/dist/schemas/file.d.ts +274 -0
  70. package/dist/schemas/file.d.ts.map +1 -0
  71. package/dist/schemas/file.js +72 -0
  72. package/dist/schemas/file.js.map +1 -0
  73. package/dist/schemas/hook.d.ts +132 -0
  74. package/dist/schemas/hook.d.ts.map +1 -0
  75. package/dist/schemas/hook.js +58 -0
  76. package/dist/schemas/hook.js.map +1 -0
  77. package/dist/schemas/interaction.d.ts +1583 -0
  78. package/dist/schemas/interaction.d.ts.map +1 -0
  79. package/dist/schemas/interaction.js +112 -0
  80. package/dist/schemas/interaction.js.map +1 -0
  81. package/dist/schemas/jsonrpc.d.ts +314 -0
  82. package/dist/schemas/jsonrpc.d.ts.map +1 -0
  83. package/dist/schemas/jsonrpc.js +64 -0
  84. package/dist/schemas/jsonrpc.js.map +1 -0
  85. package/dist/schemas/methods.d.ts +3826 -0
  86. package/dist/schemas/methods.d.ts.map +1 -0
  87. package/dist/schemas/methods.js +311 -0
  88. package/dist/schemas/methods.js.map +1 -0
  89. package/dist/schemas/policy.d.ts +81 -0
  90. package/dist/schemas/policy.d.ts.map +1 -0
  91. package/dist/schemas/policy.js +66 -0
  92. package/dist/schemas/policy.js.map +1 -0
  93. package/dist/schemas/project.d.ts +506 -0
  94. package/dist/schemas/project.d.ts.map +1 -0
  95. package/dist/schemas/project.js +148 -0
  96. package/dist/schemas/project.js.map +1 -0
  97. package/dist/schemas/session.d.ts +730 -0
  98. package/dist/schemas/session.d.ts.map +1 -0
  99. package/dist/schemas/session.js +287 -0
  100. package/dist/schemas/session.js.map +1 -0
  101. package/dist/schemas/skill.d.ts +465 -0
  102. package/dist/schemas/skill.d.ts.map +1 -0
  103. package/dist/schemas/skill.js +103 -0
  104. package/dist/schemas/skill.js.map +1 -0
  105. package/dist/schemas/stream.d.ts +688 -0
  106. package/dist/schemas/stream.d.ts.map +1 -0
  107. package/dist/schemas/stream.js +133 -0
  108. package/dist/schemas/stream.js.map +1 -0
  109. package/package.json +52 -0
  110. package/src/index.ts +24 -0
  111. package/src/schemas/capabilities.ts +62 -0
  112. package/src/schemas/common.ts +119 -0
  113. package/src/schemas/connect.ts +50 -0
  114. package/src/schemas/device.ts +67 -0
  115. package/src/schemas/discovery.ts +80 -0
  116. package/src/schemas/document.ts +121 -0
  117. package/src/schemas/env.ts +60 -0
  118. package/src/schemas/file.ts +97 -0
  119. package/src/schemas/hook.ts +66 -0
  120. package/src/schemas/interaction.ts +135 -0
  121. package/src/schemas/jsonrpc.ts +80 -0
  122. package/src/schemas/methods.ts +414 -0
  123. package/src/schemas/policy.ts +71 -0
  124. package/src/schemas/project.ts +185 -0
  125. package/src/schemas/session.ts +336 -0
  126. package/src/schemas/skill.ts +121 -0
  127. package/src/schemas/stream.ts +149 -0
@@ -0,0 +1,96 @@
1
+ {
2
+ "direction": "p2s",
3
+ "kind": "request",
4
+ "params": {
5
+ "$ref": "#/definitions/document.prepare_upload.params",
6
+ "definitions": {
7
+ "document.prepare_upload.params": {
8
+ "type": "object",
9
+ "properties": {
10
+ "sessionId": {
11
+ "type": "string",
12
+ "minLength": 1
13
+ },
14
+ "turnId": {
15
+ "type": "string"
16
+ },
17
+ "filename": {
18
+ "type": "string",
19
+ "minLength": 1
20
+ },
21
+ "sizeBytes": {
22
+ "type": "integer",
23
+ "minimum": 0
24
+ },
25
+ "mimeType": {
26
+ "type": "string"
27
+ },
28
+ "sha256": {
29
+ "type": "string"
30
+ },
31
+ "kind": {
32
+ "type": "string",
33
+ "enum": [
34
+ "attachment",
35
+ "document",
36
+ "image",
37
+ "file"
38
+ ],
39
+ "default": "file"
40
+ },
41
+ "at": {
42
+ "type": "string",
43
+ "format": "date-time"
44
+ }
45
+ },
46
+ "required": [
47
+ "filename",
48
+ "sizeBytes",
49
+ "at"
50
+ ],
51
+ "additionalProperties": false
52
+ }
53
+ },
54
+ "$schema": "http://json-schema.org/draft-07/schema#"
55
+ },
56
+ "result": {
57
+ "$ref": "#/definitions/document.prepare_upload.result",
58
+ "definitions": {
59
+ "document.prepare_upload.result": {
60
+ "type": "object",
61
+ "properties": {
62
+ "uploadRef": {
63
+ "type": "string"
64
+ },
65
+ "uploadUrl": {
66
+ "type": "string"
67
+ },
68
+ "method": {
69
+ "type": "string",
70
+ "enum": [
71
+ "PUT",
72
+ "POST"
73
+ ],
74
+ "default": "PUT"
75
+ },
76
+ "headers": {
77
+ "type": "object",
78
+ "additionalProperties": {
79
+ "type": "string"
80
+ }
81
+ },
82
+ "expiresAt": {
83
+ "type": "string",
84
+ "format": "date-time"
85
+ }
86
+ },
87
+ "required": [
88
+ "uploadRef",
89
+ "uploadUrl"
90
+ ],
91
+ "additionalProperties": false
92
+ }
93
+ },
94
+ "$schema": "http://json-schema.org/draft-07/schema#"
95
+ }
96
+ }
@@ -0,0 +1,165 @@
1
+ {
2
+ "direction": "p2s",
3
+ "kind": "request",
4
+ "params": {
5
+ "$ref": "#/definitions/document.send.params",
6
+ "definitions": {
7
+ "document.send.params": {
8
+ "type": "object",
9
+ "properties": {
10
+ "sessionId": {
11
+ "type": "string",
12
+ "minLength": 1
13
+ },
14
+ "turnId": {
15
+ "type": "string"
16
+ },
17
+ "documents": {
18
+ "type": "array",
19
+ "items": {
20
+ "type": "object",
21
+ "properties": {
22
+ "name": {
23
+ "type": "string",
24
+ "minLength": 1
25
+ },
26
+ "relativePath": {
27
+ "type": "string"
28
+ },
29
+ "mimeType": {
30
+ "type": "string"
31
+ },
32
+ "kind": {
33
+ "type": "string",
34
+ "enum": [
35
+ "attachment",
36
+ "document",
37
+ "image",
38
+ "file"
39
+ ],
40
+ "default": "file"
41
+ },
42
+ "caption": {
43
+ "type": "string"
44
+ },
45
+ "sizeBytes": {
46
+ "type": "integer",
47
+ "minimum": 0
48
+ },
49
+ "sha256": {
50
+ "type": "string"
51
+ },
52
+ "content": {
53
+ "anyOf": [
54
+ {
55
+ "type": "object",
56
+ "properties": {
57
+ "encoding": {
58
+ "type": "string",
59
+ "const": "base64"
60
+ },
61
+ "data": {
62
+ "type": "string"
63
+ }
64
+ },
65
+ "required": [
66
+ "encoding",
67
+ "data"
68
+ ],
69
+ "additionalProperties": false
70
+ },
71
+ {
72
+ "type": "object",
73
+ "properties": {
74
+ "encoding": {
75
+ "type": "string",
76
+ "const": "utf8"
77
+ },
78
+ "data": {
79
+ "type": "string"
80
+ }
81
+ },
82
+ "required": [
83
+ "encoding",
84
+ "data"
85
+ ],
86
+ "additionalProperties": false
87
+ },
88
+ {
89
+ "type": "object",
90
+ "properties": {
91
+ "ref": {
92
+ "type": "string"
93
+ }
94
+ },
95
+ "required": [
96
+ "ref"
97
+ ],
98
+ "additionalProperties": false
99
+ }
100
+ ]
101
+ }
102
+ },
103
+ "required": [
104
+ "name",
105
+ "content"
106
+ ],
107
+ "additionalProperties": false
108
+ },
109
+ "minItems": 1
110
+ },
111
+ "at": {
112
+ "type": "string",
113
+ "format": "date-time"
114
+ }
115
+ },
116
+ "required": [
117
+ "documents",
118
+ "at"
119
+ ],
120
+ "additionalProperties": false
121
+ }
122
+ },
123
+ "$schema": "http://json-schema.org/draft-07/schema#"
124
+ },
125
+ "result": {
126
+ "$ref": "#/definitions/document.send.result",
127
+ "definitions": {
128
+ "document.send.result": {
129
+ "type": "object",
130
+ "properties": {
131
+ "delivered": {
132
+ "type": "array",
133
+ "items": {
134
+ "type": "object",
135
+ "properties": {
136
+ "name": {
137
+ "type": "string"
138
+ },
139
+ "ok": {
140
+ "type": "boolean"
141
+ },
142
+ "serverRef": {
143
+ "type": "string"
144
+ },
145
+ "error": {
146
+ "type": "string"
147
+ }
148
+ },
149
+ "required": [
150
+ "name",
151
+ "ok"
152
+ ],
153
+ "additionalProperties": false
154
+ }
155
+ }
156
+ },
157
+ "required": [
158
+ "delivered"
159
+ ],
160
+ "additionalProperties": false
161
+ }
162
+ },
163
+ "$schema": "http://json-schema.org/draft-07/schema#"
164
+ }
165
+ }
@@ -0,0 +1,100 @@
1
+ {
2
+ "direction": "p2s",
3
+ "kind": "request",
4
+ "params": {
5
+ "$ref": "#/definitions/hook.fired.params",
6
+ "definitions": {
7
+ "hook.fired.params": {
8
+ "type": "object",
9
+ "properties": {
10
+ "sessionId": {
11
+ "type": "string",
12
+ "minLength": 1
13
+ },
14
+ "hookId": {
15
+ "type": "string",
16
+ "minLength": 1
17
+ },
18
+ "hookType": {
19
+ "type": "string",
20
+ "enum": [
21
+ "pre_tool",
22
+ "post_tool",
23
+ "pre_command",
24
+ "pre_file_write",
25
+ "pre_network",
26
+ "session_start",
27
+ "session_end",
28
+ "notification"
29
+ ]
30
+ },
31
+ "payload": {
32
+ "type": "object",
33
+ "properties": {
34
+ "toolName": {
35
+ "type": "string"
36
+ },
37
+ "command": {
38
+ "type": "string"
39
+ },
40
+ "filePath": {
41
+ "type": "string"
42
+ },
43
+ "url": {
44
+ "type": "string"
45
+ },
46
+ "extra": {
47
+ "type": "object",
48
+ "additionalProperties": {}
49
+ }
50
+ },
51
+ "additionalProperties": false,
52
+ "default": {}
53
+ },
54
+ "turnId": {
55
+ "type": "string"
56
+ },
57
+ "at": {
58
+ "type": "string",
59
+ "format": "date-time"
60
+ }
61
+ },
62
+ "required": [
63
+ "sessionId",
64
+ "hookId",
65
+ "hookType",
66
+ "at"
67
+ ],
68
+ "additionalProperties": false
69
+ }
70
+ },
71
+ "$schema": "http://json-schema.org/draft-07/schema#"
72
+ },
73
+ "result": {
74
+ "$ref": "#/definitions/hook.fired.result",
75
+ "definitions": {
76
+ "hook.fired.result": {
77
+ "type": "object",
78
+ "properties": {
79
+ "sessionId": {
80
+ "type": "string",
81
+ "minLength": 1
82
+ },
83
+ "hookId": {
84
+ "type": "string"
85
+ },
86
+ "applied": {
87
+ "type": "boolean"
88
+ }
89
+ },
90
+ "required": [
91
+ "sessionId",
92
+ "hookId",
93
+ "applied"
94
+ ],
95
+ "additionalProperties": false
96
+ }
97
+ },
98
+ "$schema": "http://json-schema.org/draft-07/schema#"
99
+ }
100
+ }
@@ -0,0 +1,96 @@
1
+ {
2
+ "direction": "s2p",
3
+ "kind": "request",
4
+ "params": {
5
+ "$ref": "#/definitions/hook.resolve.params",
6
+ "definitions": {
7
+ "hook.resolve.params": {
8
+ "type": "object",
9
+ "properties": {
10
+ "sessionId": {
11
+ "type": "string",
12
+ "minLength": 1
13
+ },
14
+ "hookId": {
15
+ "type": "string",
16
+ "minLength": 1
17
+ },
18
+ "action": {
19
+ "type": "string",
20
+ "enum": [
21
+ "continue",
22
+ "inject",
23
+ "modify",
24
+ "abort"
25
+ ]
26
+ },
27
+ "context": {
28
+ "type": "array",
29
+ "items": {
30
+ "type": "object",
31
+ "properties": {
32
+ "role": {
33
+ "type": "string",
34
+ "enum": [
35
+ "system",
36
+ "user",
37
+ "assistant"
38
+ ]
39
+ },
40
+ "content": {
41
+ "type": "string"
42
+ }
43
+ },
44
+ "required": [
45
+ "role",
46
+ "content"
47
+ ],
48
+ "additionalProperties": false
49
+ }
50
+ },
51
+ "patch": {
52
+ "type": "object",
53
+ "additionalProperties": {}
54
+ },
55
+ "reason": {
56
+ "type": "string"
57
+ }
58
+ },
59
+ "required": [
60
+ "sessionId",
61
+ "hookId",
62
+ "action"
63
+ ],
64
+ "additionalProperties": false
65
+ }
66
+ },
67
+ "$schema": "http://json-schema.org/draft-07/schema#"
68
+ },
69
+ "result": {
70
+ "$ref": "#/definitions/hook.resolve.result",
71
+ "definitions": {
72
+ "hook.resolve.result": {
73
+ "type": "object",
74
+ "properties": {
75
+ "sessionId": {
76
+ "type": "string",
77
+ "minLength": 1
78
+ },
79
+ "hookId": {
80
+ "type": "string"
81
+ },
82
+ "applied": {
83
+ "type": "boolean"
84
+ }
85
+ },
86
+ "required": [
87
+ "sessionId",
88
+ "hookId",
89
+ "applied"
90
+ ],
91
+ "additionalProperties": false
92
+ }
93
+ },
94
+ "$schema": "http://json-schema.org/draft-07/schema#"
95
+ }
96
+ }
@@ -0,0 +1,48 @@
1
+ {
2
+ "direction": "s2p",
3
+ "kind": "request",
4
+ "params": {
5
+ "$ref": "#/definitions/interaction.cancel.params",
6
+ "definitions": {
7
+ "interaction.cancel.params": {
8
+ "type": "object",
9
+ "properties": {
10
+ "requestId": {
11
+ "type": "string",
12
+ "minLength": 1
13
+ },
14
+ "reason": {
15
+ "type": "string"
16
+ }
17
+ },
18
+ "required": [
19
+ "requestId"
20
+ ],
21
+ "additionalProperties": false
22
+ }
23
+ },
24
+ "$schema": "http://json-schema.org/draft-07/schema#"
25
+ },
26
+ "result": {
27
+ "$ref": "#/definitions/interaction.cancel.result",
28
+ "definitions": {
29
+ "interaction.cancel.result": {
30
+ "type": "object",
31
+ "properties": {
32
+ "requestId": {
33
+ "type": "string"
34
+ },
35
+ "cancelled": {
36
+ "type": "boolean"
37
+ }
38
+ },
39
+ "required": [
40
+ "requestId",
41
+ "cancelled"
42
+ ],
43
+ "additionalProperties": false
44
+ }
45
+ },
46
+ "$schema": "http://json-schema.org/draft-07/schema#"
47
+ }
48
+ }