-
Notifications
You must be signed in to change notification settings - Fork 20
/
Ipython_json.atd
220 lines (183 loc) · 5.55 KB
/
Ipython_json.atd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
(*
* iocaml - an OCaml kernel for IPython
*
* (c) 2014 MicroJamJar Ltd
*
* Author(s): [email protected]
* Description: JSON messages sent to/from the kernel
*
*)
type dyn <ocaml module="Yojson.Safe" t="json"> = abstract
(* connection information provided by file in $(PROFILE)/secutiry *)
type connection_info = {
stdin_port : int;
ip : string;
control_port : int;
hb_port : int;
signature_scheme : string;
key : string;
shell_port : int;
transport : string;
iopub_port : int;
}
(* header (and parent) information in ZMQ messages *)
type header_info = {
~date : string;
~username : string;
~session : string;
~msg_id : string;
~msg_type : string;
}
(*********************************************************************)
(* code execution *)
(*********************************************************************)
type execute_request = {
code : string;
silent : bool;
store_history : bool;
user_expressions : dyn;
allow_stdin : bool;
}
type payload = {
html : string;
source : string;
start_line_number : int;
text : string;
}
type execute_reply = {
status : string;
execution_count : int;
(* if there was an error *)
?ename : string option;
?evalue : string option;
?traceback : string list option;
(* if execution was ok *)
?payload : payload list option;
?er_user_expressions <json name="user_expressions"> : dyn option;
}
(*********************************************************************)
(* object info *)
(*********************************************************************)
type object_info_request = {
oname : string;
detail_level : int;
}
type arg_spec = {
args : string list;
varargs : string;
varkw : string;
defaults : string list;
}
type object_info_reply = {
name : string;
found : bool;
ismagic : bool;
isalias : bool;
namespace : string;
type_name : string;
string_form : string;
base_class : string;
length : int;
oi_file <json name="file"> : string;
definition : string;
argspec : arg_spec;
init_definition : string;
docstring : string;
class_docstring : string;
call_def : string;
call_docstring : string;
oi_source <json name="source"> : string;
}
(*********************************************************************)
(* code completion *)
(*********************************************************************)
type complete_request = {
line <json name="code"> : string;
cursor_pos : int;
}
type complete_reply = {
matches : string list;
matched_text : string;
cr_status <json name="status"> : string;
}
(*********************************************************************)
(* history *)
(*********************************************************************)
type history_request = {
output : bool;
raw : bool;
hist_access_type : string;
~hr_session <json name="session"> : int;
~start : int;
~stop : int;
n : int;
~pattern : string;
~unique : bool;
}
type history_reply = {
history : string list; (* XXX *)
}
(*********************************************************************)
(* connection information *)
(*********************************************************************)
type connect_reply = {
cr_shell_port <json name="shell_port"> : int;
cr_iopub_port <json name="iopub_port"> : int;
cr_stdin_port <json name="stdin_port"> : int;
cr_hb_port <json name="hb_port"> : int;
}
(*********************************************************************)
(* kernel information *)
(*********************************************************************)
type kernel_info_reply = {
protocol_version : int list;
(* ipython_version : int * int * int * string; *)
language_version : int list;
language : string;
}
(*********************************************************************)
(* kernel status *)
(*********************************************************************)
type status = {
execution_state : string;
}
(*********************************************************************)
(* kernel shutdown *)
(*********************************************************************)
type shutdown = {
restart : bool;
}
(*********************************************************************)
(*********************************************************************)
type display_data = {
dd_source <json name="source"> : string;
dd_data <json name="data"> : dyn;
dd_metadata <json name="metadata"> : dyn;
}
(*********************************************************************)
(*********************************************************************)
type pyin = {
pi_code <json name="code"> : string;
pi_execution_count <json name="execution_count"> : int;
}
(*********************************************************************)
(*********************************************************************)
type pyout = {
po_execution_count <json name="execution_count"> : int;
po_data <json name="data"> : dyn;
po_metadata <json name="metadata"> : dyn;
}
(*********************************************************************)
(*********************************************************************)
type stream = {
st_name <json name="name"> : string;
st_data <json name="data"> : string;
}
(*********************************************************************)
(*********************************************************************)
type clear_output = {
wait : bool;
stdout : bool;
stderr : bool;
other : bool;
}