We are proud to announce a new 3.5.1 update of " Alloy - Launcher and Automator 3".  


This update includes:


"Chat" Task Improvements

Draft Messages Support

The "Chat" task now supports draft messages. Any messages created by workflows can be marked as draft ones so they will not be sent automatically but rather will go to the message composer. Such draft messages will be shown above the text entry field and it is possible to remove any of them. This allows to check those messages before sending to avoid any privacy issues. 


To mark any message as draft one its draft property should be set to 1 using a "Set Variables" task:  chatMesage.draft = 1


Unread Messages Support

The "Chat" task now support tracking of unread messages. So when new messages arrive the conversation view will not scroll to them automatically; instead it will show the red dot indicator (inside the arrow button) showing that there are new messages available. Tapping to the arrow button with unread messages indicator will result scrolling to new messages. Though if the conversation is scrolled to the bottom any new messages will appear immediately.



New Context Menu Commands

There is a new kind of commands - context menu commands. They will be shown in the context menu invoked for a message and are intended to perform some actions with a single message. Such commands must be identified by the  ^  prefix. For context menu commands, the Command Workflow will be invoked with the following arguments:

  1. command::String -  a context menu command
  2. conversation::ChatConversation - a chat conversation with just one chosen message.


Also there are two predefined commands that are always available and should not be listed explicitly:

  • messageTap - fired when the user taps a message

  • messageDoubleTap - fired when the user double taps a message


For example, the following task handles both the preview and messageTap commands by showing image preview for chosen message:


New "newConversation" Command

There is a new newConversation command that allows to create a new chat conversation. The Command Workflow will be invoked with this command when the user taps the Compose button. If the newConversation command is not handled in the Command Workflow - a new empty conversation will be created by default. 


A "Set Variables" task can be used to create a new chat conversation. For example, the following statements create a new chat conversation with one test message in it :

  1. conversation = s:objectFactory.newChatConversation - creates a new conversation
  2. chatMessage = s:objectFactory.newChatMessage - creates a new chat message
  3. chatMessage.contact = "Kate Bell<kate.bell@apple.com>" - specifies a contact the message came from.
  4. chatMessage.message = Some Test Message - composes a message
  5. +conversation.messages = chatMessage - adds a reply to the chat conversation.


Better Handling of Changed Conversations

If current conversation is changed the user will be prompted to save it or discard changes when switching to other conversation or cancelling the "Chat" task. Also it is possible to save a copy of current conversation by long tap on the Done button and choosing the "Commit Copy" action.




Other Feature And Improvements

  • Updated "Image Chat" and "Chat Sample" actions to include messages preview on tap or via the context menu
  • Added type check during variable's properties assignment
  • Added logging of invalid variable's properties assignment (invalid type or missing property)




Also do not miss features introduced in the v 3.5.0:


New OpenAI Actions


There are two new actions to work with OpenAI services:


ChatGPT


The "ChatGPT" action provides communication with ChatGPT service utilizing familiar chat interface. So you can ask questions, get answers, observe an entire conversation, utilize conversation for immediate use or save it for any future needs, save conversations and continue them at a later time etc. 

 

You can optionally maintain the history of your conversations, access and continue any of your conversation at any time.



The following video demonstrates using the "ChatGPT" action.


Image Chat

The "Image Chat" action provides communication with OpenAI image services utilizing familiar chat interface. So you can generate images, get image variations and edit images in one place. Certainly you can observe entire conversations, utilize conversation for immediate use or save it for any future needs etc. To start using the action just type your image description and tap the Send button. This will invoke OpenAI image generation service and you will get an image after several seconds of wait.


The action supports several additional commands; each command is started with / . To enter a supported command just type / and choose a command from the popup. The following commands are currently supported:

  • /variations - provides several variations of the last or selected image
  • /edit - provides edited version of the last or selected image. You will be prompted to describe what you would like to see in entire image and where the edit should occur.


The following are: a generated image according to description and another image generated as a variation.



The following is an edited image.



New "Chat" Task

This task shows familiar chat user interface that can be used to design and implement chat conversations with chat and messaging services. The task utilizes three workflows to support its core functionality:

  • Send Workflow - this workflow is responsible for sending user's messages and for optionally getting replies. This workflow is called when the user types a message and taps the Send button.
  • Refresh Workflow - this optional workflow is responsible for refreshing the chat conversation by downloading new messages. This workflow is called automatically on the schedule.
  • Command Workflow - this optional workflow is responsible for processing of custom commands. This workflow is called when the user chooses a command either from the "+" or "..." menus.


Those Workflows will be called in background so the UI will be available while they are performing. Only one Workflow can be performed at a time so if there several transactions (like several messages to send) they will be queued.



Send Workflow

This Workflow is responsible for sending user's messages and for optionally getting replies. It is called when:

  • The user types a message and taps the Send button.
  • The Command Workflow produces new messages to send.


The Send Workflow takes the conversation::ChatConversation input argument with a copy of entire chat conversation; the last chat message in the conversation contains a chat message to send. 

The Send Workflow can optionally obtain some replies to the sent message. To return them it must modify passed chat conversation and return it back via Workflow's  the conversation::ChatConversation output argument. 

A "Set Variables" task can be used to compose replies and add them to the chat conversation. For example:

  1. chatMessage = s:objectFactory.newChatMessage - creates a new chat message
  2. chatMessage.contact = "Kate Bell<kate.bell@apple.com>" - specifies a contact the message came from.
  3. chatMessage.message = REPLY: $(conversation.messages.@lastObject.message) - composes a message as a reply to the sent message.
  4. +conversation.messages = chatMessage - adds a reply to the chat conversation.


Refresh Workflow

This optional Workflow is responsible for refreshing the chat conversation by downloading new messages. This Workflow is called automatically on the schedule controlled by the "Refresh Interval" property.


The Refresh Workflow takes the conversation::ChatConversation input argument with a copy of entire chat conversation. 

To return downloaded new messages it must modify passed chat conversation and return it back via Workflow's  the conversation::ChatConversation output argument. 

A "Set Variables" task can be used to compose downloaded new messages and add them to the chat conversation. For example, to simulate time chat bot:

  1. chatMessage = s:objectFactory.newChatMessage - creates a new chat message
  2. chatMessage.contact = "Time Chat Bot" - specifies a contact the message came from.
  3. chatMessage.message = $(s:dateTime) - composes a message as a current time.
  4. +conversation.messages = chatMessage - adds a reply to the chat conversation.


Command Workflow

This optional Workflow is responsible for processing of custom commands. This workflow is called when the user chooses a command either from the "+" or "..." menus. You can specify commands as the "Command Workflow | Command List" property. 

Each command has the following format:


prefixCommand<commandID>


Single character prefix identifies type of a command. It can be one of:

  •  /    specifies a chat command that goes "as is" to the message composer. Such commands will be shown when the user types the   in the message composer.
  •  +   specifies a new message command that goes to the "+" menu. Such commands should create new messages. For example the +Send Location<sendLocation> command creates a new message with current location.
  •  *    specifies a conversation command that goes the "..." menu. Such command should do something with entire conversation. For example, the *Share<share> command shares the conversation.


Command provides the name of a command and identifies it if no commandID is specified. The name will be shown in all the menus and lists.


Optional commandID provides immutable ID of a command. If it is specified it will be passed the the Command Workflow; otherwise Command will be passed instead. In any cases the prefix will be stripped. Note: it is better to always specify commandID so if you decide to change command name all the tasks that rely on a specific command will be held intact.


You may explore the "Chat Sample" task to learn how to make a chat action. This action:

  • Simulates sending and getting replies by  by posting "REPLY:" prefixed messages. 
  • Simulates refreshing and getting new messages by posting current time.
  • Showcases adding custom commands to send locations and contacts
  • Showcases adding custom commands to share and edit entire conversation



"Breakpoint" Task and Inspector Improvements

The following are improvements:
  • Ability to inspect several variables at once
  • Ability to add/change variables on the fly
  • Ability to add/maintain watches
  • Ability to watch macro expressions