Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 453 lines (338 sloc) 21.724 kb
af77159 @unconed viewstream emitters
authored
1 TermKit
3f763ce @unconed WebSocket bridge between WebKit front-end and node.js back-end, w/ me…
authored
2 +++ -
973a91f @unconed Add autocomplete keyboard selection
authored
3 Goal: next gen terminal / command application
4
5 Addresses following problems:
3f763ce @unconed WebSocket bridge between WebKit front-end and node.js back-end, w/ me…
authored
6 1) Monospace character grid with ansi colors is not rich enough to display modern files / media / visualizations / metadata. Cannot effectively handle large output, long/wide tables or direct interaction.
973a91f @unconed Add autocomplete keyboard selection
authored
7 2) Piping binary or text streams between apps is bad for everyone:
8 * Humans have to suffer syntax, cannot reflow/manipulate output in real-time
9 * Computers have to suffer ambiguities
3f763ce @unconed WebSocket bridge between WebKit front-end and node.js back-end, w/ me…
authored
10 3) Synchronous input/output makes you wait. SSH keystroke latency is frustrating.
11 4) String-based command line requires arcane syntax, results in mistakes, repeated attempts at escaping, etc.
12 5) Unix commands are "useless by default", and when asked, will only tell you raw data, not useful facts. e.g. "rwxr-xr-x" instead of "You can't edit this file."
13
14 +++ -
973a91f @unconed Add autocomplete keyboard selection
authored
15
16 Programs / commands
17 * Output processor for common cli tools
18 * Custom implementation of ls and friends, with support for mimicking classic shell behaviour with a 2.0 twist
e8fb164 @unconed Icon / QuickLook support + protocol bridge
authored
19 * SQL shell
973a91f @unconed Add autocomplete keyboard selection
authored
20
21 Cool input scenarios:
3f763ce @unconed WebSocket bridge between WebKit front-end and node.js back-end, w/ me…
authored
22 * As you type, the command is visually tokenized and highlighted. tokens can display autocomplete suggestions, icons and indicators inline.
9a8175a @unconed Don't let autocomplete block submit
authored
23 * Instead of quoting and escaping, keys like " and > just trigger the creation of special tokens which are visually different and represent e.g. a quoted string, an argument, a regular expression. to type the special characters literally, just press them twice. the 'command' is just the concatenation of these tokens, interpreted the same way a shell interprets a command.
3f763ce @unconed WebSocket bridge between WebKit front-end and node.js back-end, w/ me…
authored
24 * Man pages are consulted inline with autocomplete options for arguments and (later) required arguments
973a91f @unconed Add autocomplete keyboard selection
authored
25
26 Cool output scenarios:
27 * Listings of files, anywhere, show an icon with distinguished typography for filename vs meta. Quicklook integration on the icon.
3f763ce @unconed WebSocket bridge between WebKit front-end and node.js back-end, w/ me…
authored
28 * Can complete several tasks at once asynchronously, show real-time progress for all of them together in e.g. a task-list widget.
973a91f @unconed Add autocomplete keyboard selection
authored
29 * Command output is interactive: has elements which can be focused, selected/unselected, opened, right clicked, dragged and dropped
30
31 Good desktop citizen:
32 * Dragging a file on the terminal window makes a folder icon appear on the side for dropping it on the CWD. Can also drag the file into the command line to reference it as an argument.
33 * Can drag files, snippets, JSON/CSV off the terminal
34 * Tear-off tabs/windows
35
b8e2230 @unconed Rewrite command/view protocol, use simpler routing. Execution pipeline.
authored
36 +++ - Roadmap
973a91f @unconed Add autocomplete keyboard selection
authored
37
e8fb164 @unconed Icon / QuickLook support + protocol bridge
authored
38 [0.1] UI prototype - DONE
b8e2230 @unconed Rewrite command/view protocol, use simpler routing. Execution pipeline.
authored
39 [X] simulated in safari/webkit.app
40 [X] functional input line with tokenization, cursor keys and backspace/delete
41 [X] functional autocomplete on tokens
42 [X] simulated commands
43 [X] simulated output with collapsible sections
973a91f @unconed Add autocomplete keyboard selection
authored
44
b8e2230 @unconed Rewrite command/view protocol, use simpler routing. Execution pipeline.
authored
45 [0.2] App prototype - DONE
46 [X] cocoa app
47 [X] webkit in single window view
48 [X] design back-end protocol
49 [X] node JS back-end, running separately
50 [X] connect socket
51 [X] run session worker
52 [X] passive command implementation
53 [X] JS module template, integrated both runtimes.
54 [X] wrap unix executable
55 [X] interactive output
973a91f @unconed Add autocomplete keyboard selection
authored
56
57 0.3: Command suite
b8e2230 @unconed Rewrite command/view protocol, use simpler routing. Execution pipeline.
authored
58 [X] Redesign message protocol
af77159 @unconed viewstream emitters
authored
59 [X] Viewstream integration
33bc4cc @unconed Working output formatter w/ mime type annotation. Allow widgets to be…
authored
60 [X] 5-pipe command execution
d77b1ec @unconed Consistent ~ support
authored
61 [X] fix tokenfield
20df933 @unconed Don't autocomplete immediately after filling in
authored
62 [X] filesystem autocomplete
4378ebd @unconed Change LS to output JSON listing of files. Add JSON pretty printer.
authored
63 [X] OS X icon loading
64 [X] inline image display
65 [X] json pretty printer
b8e2230 @unconed Rewrite command/view protocol, use simpler routing. Execution pipeline.
authored
66 [ ] unix command execution
971183d @unconed Fix autocompletion event handling around up/down arrows. Fix filesyst…
authored
67 [ ] http get/post data piping
d77b1ec @unconed Consistent ~ support
authored
68 [ ] code syntax highlighting
b8e2230 @unconed Rewrite command/view protocol, use simpler routing. Execution pipeline.
authored
69 [ ] command decoration
70 [ ] interactive execution
71 [ ] inline man-pages tips
72 [ ] version control
73 [ ] interactive quicklook
4378ebd @unconed Change LS to output JSON listing of files. Add JSON pretty printer.
authored
74 [ ] wildcard handling
971183d @unconed Fix autocompletion event handling around up/down arrows. Fix filesyst…
authored
75 [ ] regexp hinter
4378ebd @unconed Change LS to output JSON listing of files. Add JSON pretty printer.
authored
76
b8e2230 @unconed Rewrite command/view protocol, use simpler routing. Execution pipeline.
authored
77
78 0.4: Network & Modularity
79 [ ] SSH tunneling
80 [ ] Stand-alone daemon
81 [ ] network preview / local edit
82 [ ] tabs
83 [ ] split off command processor rules / autocomplete handlers into separable blocks
84 [ ] server-side hook system
85 [ ] add plug-in mechanism with drop-in functionality
86
87 0.5: Interactive & Unix Upgrades
88 [ ] widget system
89 [ ] graphing suite
90 [ ] alt view for LS with usable permissions, dates, etc
91 [ ] active 'top' monitor
92 [ ] gnu parallel integration/clone
93
94 0.6: Theming
95 [ ] server-side push css/js / integrated web
96 [ ] themes / stylesheets
97
98 +++ Components
99
100 Node JS daemon = 'NodeKit'.
e8fb164 @unconed Icon / QuickLook support + protocol bridge
authored
101 + Fast enough for server work, concurrency/scaling included
102 + New JS language features
103 + Cross-platform on unix
104 + Process / io / everything integration
105 + Self-contained binary, can be included in .app
106 - separate from UI / front-end, forced layer of indirection makes it unlike web programming
107 - no mac-specific APIs or low-level C access
3f763ce @unconed WebSocket bridge between WebKit front-end and node.js back-end, w/ me…
authored
108
b8e2230 @unconed Rewrite command/view protocol, use simpler routing. Execution pipeline.
authored
109 => back-end platform, runs locally, can run remotely, or perhaps tunnel its interaction over SSH
3f763ce @unconed WebSocket bridge between WebKit front-end and node.js back-end, w/ me…
authored
110
111 WebKit/Cocoa front-end
e8fb164 @unconed Icon / QuickLook support + protocol bridge
authored
112 + Rich, stylable display + jQuery
113 + New JS language features
114 + Intimate OS X access, Obj-C, bridgeable with JS
3f763ce @unconed WebSocket bridge between WebKit front-end and node.js back-end, w/ me…
authored
115
116 The split:
e8fb164 @unconed Icon / QuickLook support + protocol bridge
authored
117 Front-end = display, formatting, interaction. Always local. Runs in an (enhanced) webview/browser with a websocket to back-end.
3f763ce @unconed WebSocket bridge between WebKit front-end and node.js back-end, w/ me…
authored
118 Back-end:
119
120 1) Local NodeKit: Start node daemon on startup, connect using direct websocket ws://localhost:2222.
121 2) Remote NodeKit SSH: Daemon is running, use ssh to set up tunnel between local rand port # and remote 2222. connect local websocket to tunnel.
122 3) Remote NodeKit WSS: Daemon is running, use WSS to connect directly, must authenticate? don't want to replicate OpenSSH, but rudimentary auth could be useful.
e8fb164 @unconed Icon / QuickLook support + protocol bridge
authored
123 4) Basic remote shell: No nodekit daemon. Only literal commands supported. Enough to execute e.g. "apt-get install termkit".
124
b8e2230 @unconed Rewrite command/view protocol, use simpler routing. Execution pipeline.
authored
125 +++ UNIX execution model
126
127 In the traditional model of computing, a program has an input, an output and does some processing in between. A standard UNIX program follows this model closely, with the following pipes: standard in, out and error. Data flows in through standard in, and output flows either through the out or error pipes. This simple model allows us to chain programs together, redirect specific portions of output into log files and run commands in batch.
128
129 <img>
130
131 But however powerful, this model ignores an important factor in how programs are used, namely whether there is a person involved.
132
133 When run directly by a person, standard in is mainly hooked up to the keyboard while standard out will go directly to the display. The input will be irregular and error prone. The program will be interactive. Output will be unpredictable and formatted mainly for display purposes.
134
135 But if the program is part of a processing chain, hooked up to a data source and/or sink, the situation changes dramatically. The data is now structured, the operation of each step is predictable and certain guarantees have to be made about the formatting of the output. Programs might run for a long time, chugging away at invisible streams and passing around massive amounts of data.
136
137 These two contexts are radically different, but both are forced through the same standard pipes. Oddly enough, this multiplexing seems universally accepted and is woven throughout computing. And yet, it has some noticeable effects.
138
139 For instance, programs don't communicate anything about the data they're sending through: it's just an anonymous, binary stream. As a result, many programs have options to toggle their input/output between various formats, some for people, some for programs. Tools like git examine their environment and disable interactive mode if nobody's there to answer. Machine-friendly data may be requested in several formats. As a result, scripting together a command chain is a careful dance of matching impedances at each step.
140
141 However, because most tools are launched by people for people, the default interchange format of choice is still "somewhat parseable text". As a result, we still have to be careful with things like spaces or Unicode in filenames, in case someone puts text where it doesn't belong. It still matters sometimes whether there is a newline at the end of a file. A misplaced keystroke, easily missed in the cryptic bash wash, can wreak havoc. Relying on text makes us prone to errors, and has lead to a culture where new recruits have to pass a constant trial by fire—to not destroy their system at one of the many opportunities it gives them.
142
af77159 @unconed viewstream emitters
authored
143 In fact, where it seems to matter most is the interaction. Text has literally locked down our abililty to evolve the UI, by forcing us to use the same monospace character terminals the previous generations used. Even worse, we are still often limited to a headache inducing, fluorescent EGA color palette from 1984. A terminal can show you the load on your system, but it can't show you a historic graph. It can make little progress bars out of ASCII characters, but it can't show LaTeX math inline. Even the command-line itself with its clunky tab-complete, lack of text selection and standard copy/paste bears little resemblence to the standard text field widget we use every day in modern UIs.
b8e2230 @unconed Rewrite command/view protocol, use simpler routing. Execution pipeline.
authored
144
af77159 @unconed viewstream emitters
authored
145 In the past decade, user interaction has made astounding leaps. We consume and produce vast quantities of information daily. The web has changed from blobs of markup into full apps, with rich typography, complex infographics, inline interactivity, dynamic layout, etc. UIs like OS X have raised the bar on how we can present and interact with information naturally. Sure, fancy icons and smooth graphs are great in iLife, but they can also be used in technical applications. You are almost certainly sitting in front of a display with more than a million pixels. Why are you telling it to draw a dinky character terminal from the 80s?
b8e2230 @unconed Rewrite command/view protocol, use simpler routing. Execution pipeline.
authored
146
147 <h2>A new model</h2>
148
149 Criticism is easy of course, but what can we do about it? Well, after giving it some thought, I think we need to rebuild the model from the ground up.
150
151 First of all, we need a way to separate out the data between people and programs. The easiest is to split our pipes into 5:
152 * Data In, Data Out
153 * View In, View Out
154 * Error Out
155
156 When chaining together programs, we make a chain out of the Data pipes like usual. The View pipes however are hooked up to a global controller which proxies to the user's terminal.
157
158 Processing of data proceeds normally, but with the additional property that meta-data is explicitly attached to the data pipes, indicating content type, format, name, etc. as available.
159
160 Next, we need a way for programs to output a rich and dynamic UI through the View pipes and receive callback events. This is where things get tricky, because it essentially comes down to network-transparency of UI. This is a complex problem and has only worked for a couple of things, i.e. X11 and the Web, and each comes with a huge set of baggage. We need something simpler, that can be implemented as a thin library in a hundred lines of code. It should still feel like a command-line terminal, but be flexible enough to allow all the things we expect from modern applications.
161
162 Finally, we need a better way to enter commands. We need a modern textfield widget that is aware of strings, regular expressions, pipes, and can do tricks like inline icons, visual tokens, autocomplete dropdowns, etc.
163
164 After all this pontificating, it should be no surprise I'm building something to try and solve this problem. I call it TermKit, a next-gen Terminal and systems tool platform. There's even a shiny icon:
165
166 <img>
167
af77159 @unconed viewstream emitters
authored
168 It consists of a desktop WebKit app acting as the front-end, with the UI built out of HTML/CSS and JavaScript. OS services like QuickLook are integrated through Cocoa.
b8e2230 @unconed Rewrite command/view protocol, use simpler routing. Execution pipeline.
authored
169
170 On the flip side is a Node.js daemon, connected through Socket.IO, which maintains shells, runs programs and streams the visible output back to the front-end.
171
172 The front-end and back-end exchange messages, which are routed to views on the front, and to worker processes on the back.
173
174 Combining the oil and water of command-line Unix and web isn't an easy job, but it's better than trying to make WebKit sing Unix, or making a rich front-end from scratch. After working on this on and off for a couple of months, I managed to get a prototype of the UI and daemon working, with QuickLook icons as icing on the cake:
3f763ce @unconed WebSocket bridge between WebKit front-end and node.js back-end, w/ me…
authored
175
b8e2230 @unconed Rewrite command/view protocol, use simpler routing. Execution pipeline.
authored
176 <img>
177
178 It actually works, and the platform is pretty compelling. With Node.js you get a fast, asynchronous, scriptable back-end with excellent Unix libraries and modules. And using WebKit means you can display anything you can make in HTML5/CSS3, and millions know how to do it already.
179
180 However, despite the clear power of HTML5, it would be a mistake to make HTML the defacto output format of Unix: we'd be swapping one parseable text soup for a much bigger one.
181
182 <h2>Smart views</h2>
183
af77159 @unconed viewstream emitters
authored
184 Instead, I wrote a custom View layer. Using simple building blocks, like "item list", "sortable table", "image", "line graph" or "file with icon", the display is built. The idea is to have a wide range of UNIX concepts easily expressed, so it's easier to make nice UIs quickly. The View is interactive and can be updated asynchronously. Making a streaming dashboard is child's play for example.
185
186 On the back end, a bridge makes it easy to interface by instantiating objects and streaming them to the front-end.
b8e2230 @unconed Rewrite command/view protocol, use simpler routing. Execution pipeline.
authored
187
188 At the same time, you have access to HTML/CSS if you need it, or you can skip it altogether and just print plain text as well.
189
190 But what about the actual data? While it may sometimes be piped into a file, usually the data has to be displayed at the end. In the new model, data doesn't go to the terminal anymore, which complicates matters.
191
192 Imagine the case of "ls | grep": we're filtering items in a directory, which is displayed as a listing of files and icons. When the listing is output by "ls", sending it on the View out would send it directly to the terminal, preventing grep from filtering the items. If we instead pipe the items through grep, we lose the ability to view the data at all since it will remain in its raw form.
193
af77159 @unconed viewstream emitters
authored
194 To solve this, I use the meta-data added to each data pipe, with another unholy web ingredient: MIME. This allows me to keep the data pure, and identify it through its Content-Type and other values. In the case of "ls", we keep piping around plain-text filenames separated by newlines like before, but we annotate it so we can format it at the end of the command chain.
b8e2230 @unconed Rewrite command/view protocol, use simpler routing. Execution pipeline.
authored
195
af77159 @unconed viewstream emitters
authored
196 The formatter reads the final data and turns it into a View graph, and can be extended to display files, images, JSON, source code, diffs, etc. This can be enabled for existing tools by deriving the Content-Type based on the command. It also makes TermKit web-transparent: you can hook up the data pipes to HTTP GET and POST, and the header information will be correctly interpreted.
b8e2230 @unconed Rewrite command/view protocol, use simpler routing. Execution pipeline.
authored
197
198 <h2>Possibilities</h2>
199
af77159 @unconed viewstream emitters
authored
200 In practice, the Data/View split has been there all along. It comes down to people vs programs, and the line is not hard to draw. "Wget" outputs a progressbar while streaming data into a file. "Top" displays an interactive dashboard that updates continuously. In this model, each application can do both interactive tasks and data processing tasks at the same time, and do each in the most natural format for the job.
b8e2230 @unconed Rewrite command/view protocol, use simpler routing. Execution pipeline.
authored
201
af77159 @unconed viewstream emitters
authored
202 Additionally, routing view commands this way allows parallel or background processes to update the view independently in the scrollback, instead of colliding with each other and the prompt.
b8e2230 @unconed Rewrite command/view protocol, use simpler routing. Execution pipeline.
authored
203
204 The separation between front-end and back-end also brings other benefits: the back-end can be run remotely, tunneling the websocket over SSH to a local front-end. You get latency-free interaction for remote operations. Even more, we can replace the consoles-within-terminals of SQL and SFTP, and elevate them to first-class shells with all the benefits of the new interaction model.
205
af77159 @unconed viewstream emitters
authored
206 Doesn't this mean rewriting all our tools? Not necessarily. Traditional Unix tools can be slotted in transparently, they just don't get the benefits of asynchronous output. Wrapper scripts can add additional functionality, e.g. to give GIT colored, side-by-side diffs or show version control status in an 'ls' listing.
b8e2230 @unconed Rewrite command/view protocol, use simpler routing. Execution pipeline.
authored
207
208 <h2>Status</h2>
209 I've been slowly working on TermKit for about a year now, but it's still mostly vaporware. When I started, I didn't know what the right solution would look like, I just knew I wanted something more modern and usable. There's been a lot of writing and rewriting of code just to get to this stage. It also doesn't help that I'm a code perfectionist in unfamiliar territory.
210
af77159 @unconed viewstream emitters
authored
211 The reason I wanted to blog about it is because all of the above is starting to sound like a really compelling argument to me. The idea is to create a flexible platform for making better tools, built out of cross-platform parts and with enough useful assumptions built-in to make a difference.
3f763ce @unconed WebSocket bridge between WebKit front-end and node.js back-end, w/ me…
authored
212
af77159 @unconed viewstream emitters
authored
213 Feedback is welcome, and I invite you to browse the GitHub repo which has mockups and some code diagrams.
9b36728 @unconed Somewhat working view-stream and outputview tree
authored
214
215
216 +++ Protocol considerations
217
218
219 The output of a termkit command is split into data and view. The data is the raw information that is piped from one process to the next.
220
221 The view is a stream of dom-like objects and operators on them.
222
af77159 @unconed viewstream emitters
authored
223 View and data are fundamentally different:
224 * Data is a raw binary stream with meta-data annotation, from one process' stdout to another's stdin
225 * View is a packetized stream of UI updates and callback events, going directly to the terminal.
3f763ce @unconed WebSocket bridge between WebKit front-end and node.js back-end, w/ me…
authored
226
227
228 +++ Command architecture
229
230 The webkit front end is intended to be a view first and foremost. It is an active view that maintains its own contents based on messages to and from the back-end.
231
232 problem: if front-end is agnostic, then how to make commands smarter?
233
234 > shell-OS interface is server-side
235 > server-side only executes processes/commands, routes streams and provides output.
236 > separeate data in/out from ui in/out. datastream vs viewstream
237
238 data in/out:
239 content-type: unix/pipe
240 application/jsonstream
241 ...
242
9b36728 @unconed Somewhat working view-stream and outputview tree
authored
243
244 [ Front-End ] -----> [ Back-end ]
245 [ WebKit ] websocket [ Node.js ]
246 |
247 |
248 v *
249 [ Shell ]
250 [ Worker.js ]
251
252
9a8175a @unconed Don't let autocomplete block submit
authored
253 Worker sets up process chain:
9b36728 @unconed Somewhat working view-stream and outputview tree
authored
254
1cf66f2 @unconed - Cocoa: windows and tabs created on demand
authored
255
9a8175a @unconed Don't let autocomplete block submit
authored
256 view in - callbacks / command stream
257 view out - view stream
258 stdin = data in (mime typed)
259 stdout = data out (mime typed)
1cf66f2 @unconed - Cocoa: windows and tabs created on demand
authored
260
9a8175a @unconed Don't let autocomplete block submit
authored
261 | callbacks ^ view stream: view updates
262 stdin v |
263 ----> [ "command [args...]" ] ---->
264 stdout
265
266 View streams are multiplexed and sent to the front-end.
267 Front-end callbacks are routed back to the right process.
268
269 Each process has its own view, referenced by ID number.
270 Processes cannot break out of their view.
9b36728 @unconed Somewhat working view-stream and outputview tree
authored
271
272
d2e41bf @unconed Spin off shell interaction to separate worker.js. Stream environment …
authored
273 +++ Data vs UI glue
274
275 e.g.
276 get http://.../rss.xml
277 content-type: application/xml
278
279 -> process streams out xml data
280
281 get | grep
282 Data Stream: .txt|html|... > .txt|html|...
b8e2230 @unconed Rewrite command/view protocol, use simpler routing. Execution pipeline.
authored
283 View Stream: file metadata, download progress, grep stats (# hits)
9a8175a @unconed Don't let autocomplete block submit
authored
284 Output Formatting: turn application/xml into dynamic XML tree.
d2e41bf @unconed Spin off shell interaction to separate worker.js. Stream environment …
authored
285
286 get | ungzip | untar
287 Data Stream: .gz > .tar > nothing
b8e2230 @unconed Rewrite command/view protocol, use simpler routing. Execution pipeline.
authored
288 View Stream: file metadata, download progress, unzip progress (# files)
9a8175a @unconed Don't let autocomplete block submit
authored
289 Output Formatting: no data output.
d2e41bf @unconed Spin off shell interaction to separate worker.js. Stream environment …
authored
290
9a8175a @unconed Don't let autocomplete block submit
authored
291 The output formatter takes a mime-typed blob and turns into a display.
292 - Plain text or HTML
293 - Images
294 - Binary data (hex or escaped)
295 - Url/file reference with icon
296 ...
297
298 Existing tools are wrapped to provide richer output, either by parsing
299 old school output or by interacting directly with the raw library.
d2e41bf @unconed Spin off shell interaction to separate worker.js. Stream environment …
authored
300
b8e2230 @unconed Rewrite command/view protocol, use simpler routing. Execution pipeline.
authored
301 +++ stream structure
302
303 ><{
304 termkit: '1'
305 }
306
307 >{
308 query: 1
309 method: session.open
310 args:
311 }
312 <{
313 answer: 1
314 success: true
315 args: {
316 session: 1
317 }
318 }
319 >{
320 query: 2
321 method: shell.environment
322 session: 1
323 }
324 <{
325 answer: 2,
326 success: true
327 args: { ... }
328 }
329 >{
330 query: 3
331 method: shell.run
332 session: 1
333 args: {
334 command: ...
335 id: 0
336 }
337 }
338 <{
339 method: view.allocate,
340 session: 1
341 args: {
342 id: 0
343 views: [0, 1]
344 }
345 }
346 <{
347 method: view.add,
348 session: 1
349 args: {
350 view: 0
351 target: null
352 objects: [ ... ]
353 }
354 }
355 <{
356 method: view.add,
357 session: 1
358 args: {
359 view: 0
360 target: [ 0 ]
361 objects: [ ... ]
362 }
363 }
364 >{
365 method: view.callback,
366 session: 1
367 args: {
368 view: 0,
369 message: { .. }
370 }
371 }
372 <{
373 method: view.update
374 args: { ... }
375 }
376 <{
377 answer: 3,
378 success: true,
379 args: {
380 code: 0,
381 }
382 }
383
3f763ce @unconed WebSocket bridge between WebKit front-end and node.js back-end, w/ me…
authored
384
9b36728 @unconed Somewhat working view-stream and outputview tree
authored
385 viewstream:
386
971183d @unconed Fix autocompletion event handling around up/down arrows. Fix filesyst…
authored
387 > shell-specific interaction rules are server-side.
3f763ce @unconed WebSocket bridge between WebKit front-end and node.js back-end, w/ me…
authored
388 > rich widget lib for display, extensible
d2e41bf @unconed Spin off shell interaction to separate worker.js. Stream environment …
authored
389 > widgets are streamed to client like termkit-ML. objects are smartly typed and have callback commands defined for them. callbacks can be stateful or stateless. though stateful is only intended to be used for interactive commands.
3f763ce @unconed WebSocket bridge between WebKit front-end and node.js back-end, w/ me…
authored
390
971183d @unconed Fix autocompletion event handling around up/down arrows. Fix filesyst…
authored
391 tableview / listcontainer -> generic, scales from simple list to tabled headers w/ simple syntax
3f763ce @unconed WebSocket bridge between WebKit front-end and node.js back-end, w/ me…
authored
392 object references for files and other things. are multi-typed and annotated on server-side.
51ff599 @unconed Add Cocoa app. Reorganize graffles
authored
393
9b36728 @unconed Somewhat working view-stream and outputview tree
authored
394 +++ --
51ff599 @unconed Add Cocoa app. Reorganize graffles
authored
395 references:
396
397 textmate html output features
398 http://blog.macromates.com/2005/html-output-for-commands/
399
400 bcat: browser cat tool
3f763ce @unconed WebSocket bridge between WebKit front-end and node.js back-end, w/ me…
authored
401
b8e2230 @unconed Rewrite command/view protocol, use simpler routing. Execution pipeline.
authored
402 terminator: java-based terminal++
3f763ce @unconed WebSocket bridge between WebKit front-end and node.js back-end, w/ me…
authored
403
b8e2230 @unconed Rewrite command/view protocol, use simpler routing. Execution pipeline.
authored
404 protocol:
405 fastcgi
3f763ce @unconed WebSocket bridge between WebKit front-end and node.js back-end, w/ me…
authored
406
407 command output:
9a8175a @unconed Don't let autocomplete block submit
authored
408 * rich output, consisting of an element tree
409 * simple container types (list, table) and various viewers to represent common objects and data types
3f763ce @unconed WebSocket bridge between WebKit front-end and node.js back-end, w/ me…
authored
410
411 current widget model:
9a8175a @unconed Don't let autocomplete block submit
authored
412 * use a viewcontroller for each widget
413 * viewcontroller own its own markup
414 * simple object instantiation, widgets can create child widgets
3f763ce @unconed WebSocket bridge between WebKit front-end and node.js back-end, w/ me…
authored
415
416 more ideas:
417 * autocorrection of mistyped commands
418 * unified progress indicator during command
419 * history access
420 * don't execute if invalid command
9b36728 @unconed Somewhat working view-stream and outputview tree
authored
421
9a8175a @unconed Don't let autocomplete block submit
authored
422
423 +++ -
424
425 Code base on May 9th 2011
426
427 front
428 1200 tokenfield + autocomplete
429 690 output view
430 393 command handling
431 184 shell client
432 181 misc
433 465 CSS
434 55 HTML
435 = 3168
436
437 back
438 204 builtin commands
439 214 autocomplete
440 255 output formatter
441 250 command handling
442 103 router
443 166 misc
444 162 view bridge
445 160 processor
446 83 shell
447 = 1597
448
449 tests = 162
450
451 4927 lines of code
452 + jquery + socket.io + syntax highlighter + node + node-mime
Something went wrong with that request. Please try again.