Double Agent, WSLv2 and named pipes

So digging around an old SDK I came across an old friend, Microsoft Agent:

This was the bold new strategy of having a digital assistant that you could interact with on the desktop to help you with common tasks, and help with common issues. Oddly enough as popular a Alexa is these days, Microsoft’s attempts didn’t work out so well.

Perhaps it was the infamous Clippy of Microsoft Office infamy that left a bad taste in the world of talking animated agents. circling back to the popular Alexa perhaps Clarke/Kubrick had it right in that people prefer an omnipresent voice rather than some animated animal. Perhaps the need to animate Cortana led to it’s downfall as well.

Agent was at least an open ended platform so 3rd parties could drive the agent. However like so many other innovate things Microsoft made in the late 1990’s like Internet Explorer, Comic Chat, and Active-X, Microsoft Agent is no longer supported on Windows 10 (I didn’t even try Vista or 7). Enter Double Agent, a 32bit/64bit Active-X emulator of the old Microsoft Agent control. Download some characters for end users, and install them as Administrator, and you are in business!

How cool. Now for the fun part I took the sample ‘Hello’ from the Microsoft Agent Web SDK for C, and added a named pipe, so it simply sits on \\.\pipe\agent1 and will speak anything you send it. Pretty simple, right?

Adding WSLv2

Now one of the cool things about WSL(Windows Subsystem for Linux), is that you can run Linux commands from the CMD prompt. For example:

C:\Users\jason>wsl uname -a
Linux remlazar 5.10.16.3-microsoft-standard-WSL2 #1 SMP Fri Apr 2 22:23:49 UTC 2021 x86_64 GNU/Linux

Although there is a mechanism for sharing Unix sockets between WSL & Windows, I opted for something more casual and simpler, stdio redirection and a named pipe. I instead opted for the simple command:

@wsl x=$(fortune %1);echo ${x,,} > \\.\pipe\agent1

I should add, I found the hard way that UPPERCASE words are read letter by letter by agent, so I have to do the ‘,,’ trick to force the output to lowercase. Pipes and redirects appear to be interpreted by CMD, so I opted for environment variables instead.

So with some pipes, and a simple example I now have one of those annoying desktop agents reading jokes to me from Linux. It’s not a terribly complicated or involved program, but sometimes it doesn’t have to be. I do like how reading from a pipe is a great LCD, as anything that can open a file can send data to a named pipe, so this makes it ubiquitious.

I guess if I was more involved, I’d add timers, and have the agent walk around, sleep disappear etc etc. But I’m happy enough for it to be acting as a text to speech. The only downside is once kids see it, it’ll be the greatest thing ever. Perhaps Microsoft wasn’t wrong it’s just that the magic of an animated bird reading ‘zippy the pinhead‘ fortunes appeals more to children than to adults.

I’m sure there is books written about user interfaces, and the rise and fall, and rise again of the PDA, but I wonder what they have to say about Microsoft Agent?

2 thoughts on “Double Agent, WSLv2 and named pipes

Leave a Reply