ssh-agent.tcl at [e4e500972a]

File build/tcl/ssh-agent.tcl artifact 0cbe74a449 part of check-in e4e500972a


#! /home/rkeene/tmp/cackey/build/tcl/tclkit

package require duktape
package require tuapi

proc initSSHAgent {} {
	if {[info exists ::jsHandle]} {
		return
	}

	set chromeEmuJS [read [open chrome-emu.js]]
	set sshAgentJS [read [open ssh-agent-noasync.js]]

	set ::jsHandle [::duktape::init]

	::duktape::eval $::jsHandle $chromeEmuJS
	::duktape::eval $::jsHandle $sshAgentJS

	puts [::duktape::eval $::jsHandle {
		chrome.runtime.connectCallbacks[0]({
			sender: {
				id: "pnhechapfaindjhompbnflcldabbghjo"
			},
			onMessage: {
				addListener: function() {
					/* XXX:TODO */
				}
			}
		})
	}]
}

initSSHAgent