UKADOC Project
SHIORI/3.0

References: SHIORI/3.0 (external site) SHIORI/2.x (external site)

Detecting implementation support

Implementation support for extended headers is notified early in SHIORI execution through ID: capability.

request

Sample

GET SHIORI/3.0
Charset: UTF-8
Sender: SSP
SenderType: internal,raise
SecurityLevel: local
Status: choosing,balloon(0=0)
ID: OnFirstBoot
BaseID: OnBoot
Reference0: 1

※The line ending is CR+LF.
※The request ends with a blank line (two consecutive CR+LF sequences, including the preceding line's terminator).

Method
GET
A method that assumes that something will be returned in a Value response header.
NOTIFY
A method that assumes no value will be returned. The Value response header is ignored.
Mainly used when a mode constraint prevents the ghost from speaking, or for status notification events immediately after startup.
Note that the same ID (event name) may be used with both GET and NOTIFY.
Charset
Character encoding. It is preferable to put this on the first line, or at least before any line containing characters outside the ASCII range.
Sender
Event sender.
SenderType [SSP 2.5.05~拡張]

Attributes of the event sender. The values are as follows. If there are multiple values, they are comma-separated.
For ID: OnTranslate, the attributes of the event being translated are inherited.

internal
An event from within the application.
external
An event from outside the application.
sakuraapi
An event triggered by the Sakura API.
embed
An event triggered by the \![embed] tag.
raise
An event triggered by the \![raise] tag.
property
An event triggered by the result of a property system reference command.
plugin
An event triggered by a plugin.
sstp
An event triggered by SSTP.
communicate
An event triggered by the Communicate specification.
SecurityLevel

Security level when executing a script. One of the following.
For ID: OnTranslate, the attributes of the event being translated are inherited.
It is notified as early as possible, and appears at least before the ID header.

local
A notification from within the machine on which the application is running.
external
A notification from outside the machine on which the application is running.

An external notification originates outside the machine on which the application is running, so handle it with security in mind.
This is a different concept from SenderType internal/external. An event originating outside the application may be considered safe and therefore classified as local, so SecurityLevel may be local even when SenderType is external.

SecurityOrigin [SSP拡張]
A URL-like string indicating the sending server. It has the following formats. Its concept is the same as that of the Origin HTTP header.
SecurityOrigin: null
SecurityOrigin: <scheme>://<hostname>
SecurityOrigin: <scheme>://<hostname>:<port>
scheme is usually one of http, https, or sstp. hostname is the sending server's name or IP address. port is a port that can receive replies.
If information is unavailable, such as when a header is not specified in SSTP or there is no concept of a sender, the value is null.
See also SecurityOrigin in the SSTP specification.
Status [SSP拡張]

The ghost's execution state. The values are as follows. If there are multiple values, they are comma-separated.

talking
Speaking
choosing
Displaying choices
minimizing
Being minimized
induction
In \![enter,inductionmode]
passive
In \![enter,passivemode]
timecritical
In a time-critical section (\t)
nouserbreak
In \![enter,nouserbreak]
online
Communicating over the network
opening(type)
An input box or similar is open.
If multiple types are open, they are listed separated by /.
"dialog" means a file picker, color picker, and similar dialogs.
Example: opening(communicate/input/teach/dialog)
balloon(group of IDs)
Balloons are displayed.
Listed in the format character ID=balloon ID.
If multiple balloons are open, they are listed separated by /.
For example, balloon(0=2/1=0) means that a large balloon is displayed for \0 and a normal balloon for \1.
ID
Event name or text resource identifier.
BaseID [SSP拡張]
Compatible base event name.
For example, OnFirstBoot is compatible with OnBoot and is a variant of OnBoot, so OnBoot is set as the BaseID for OnFirstBoot.
Reference*
Additional information associated with the event. A number follows Reference. There is no limit to the number of lines (as long as memory permits).
X-SSTP-PassThru-(arbitrary string) [SSP 2.5.05~拡張]
Only when an event notification arrives via SSTP, headers in the SSTP request beginning with "X-SSTP-PassThru-" are passed through unchanged.
These are not added for other sources.

response

Sample

SHIORI/3.0 200 OK
Charset: UTF-8
Sender: AYA
Value: \1\s[10]\0\s[0]\e

※The line ending is CR+LF.
※The response must end with a blank line (two consecutive CR+LF line endings).

Status code

As with HTTP, codes in the 200 range indicate success, while all others indicate some kind of failure (error).
The codes primarily used at present are as follows.

200
200 OK
Success, with a return value (Value).
204
204 No Content
Success, with no return value.
311
311 Not Enough
For ID: OnTeach (the SHIORI/2-series TEACH method), indicates that additional information is required.
Reopen the input box and ask the user, then add a Reference containing the input string after input is complete.
312
312 Advice
For ID: OnTeach (the SHIORI/2-series TEACH method), indicates that the most recently entered string cannot be interpreted and should be discarded.
Discard the last Reference, reopen the input box and ask the user, then add a Reference containing the input string after input is complete.
400
400 Bad Request
The request string could not be interpreted.
500
500 Internal Server Error
An error occurred inside SHIORI, and it could not return a response.
Charset
Character encoding. It is preferable to place this on the first line, or at least before any line containing characters outside the ASCII range.
Sender
The sender. Usually the name of the SHIORI.
Value
The script to speak.
ValueNotify [SSP extension 2.5.35]

[Experimental feature]
An extension for executing Sakura Script even when the request method is NOTIFY.
When Sakura Script is returned in this header, it is executed immediately. For GET, it is executed before the script in the Value header.
The tags that can be executed are extremely limited; all other tags and text are ignored.
Ignored when the method is not NOTIFY or when the Value header is already present. Restriction removed in 2.6.76
The tags that can currently be executed are as follows:

  • \![sound]
  • \![set,trayicon]
  • \![set,trayballoon]
  • \![raise]
  • \![raiseother]
  • \![raiseplugin]
  • \![timerraiseother]
  • \![timerraiseplugin]
  • \![notify]
  • \![notifyother]
  • \![notifyplugin]
  • \![get,property] +2.6.82
  • \![set,property] +2.6.82
SecurityLevel [SSP extension]

One of the following.

local
A security level equivalent to a script from within the running machine.
external
A security level equivalent to a script from outside the running machine.

The SecurityLevel of the script to speak. When external, some scripts cannot be executed due to security features.

Marker [SSP extension]
The string to display in the balloon marker (additional information below the balloon).
ErrorLevel [SSP extension]

The level of an error that occurred inside SHIORI. One of the following. To represent multiple errors, separate them with byte value 1.

info
Information. Not an error.
notice
Notice. Descriptions that should be corrected, although they are not necessarily errors.
warning
Warning. There are errors such as incorrect descriptions; processing has not stopped, but they should be addressed.
error
Ordinary error. Processing has stopped due to an issue such as an incorrect description and cannot be resumed.
critical
Critical error. More severe than error; it should be addressed immediately.

If this header is present, the user is notified that some kind of error has occurred.
The notification level can be changed by the user. Usually, it is error or higher.
In SSP, the error is recorded in the error log, and an error icon appears in the notification area.

ErrorDescription [SSP extension]
Detailed information about an error that occurred inside SHIORI. Valid only when ErrorLevel is present.
To represent multiple errors, separate them with byte value 1.
The number of elements in ErrorLevel and ErrorDescription must be the same.
BalloonOffset [SSP extension]
Balloon offset values (X,Y).
Reference0
If you want to send a Communicate, the name of the ghost's \0 side.
Reference1 onward
Additional information for Communicate.
Response Reference1 = SSTP Communicate Reference0 = recipient's OnCommunicate Reference2
Note that these are offset as shown above for compatibility reasons.
Age [SSP extension]
The generation number of the Communicate. The first is zero. It increases by 1 each time the exchange continues.
Although this is an SSP extension, in practice it is SHIORI/2.x compatibility processing.
MarkerSend [SSP extension]
The balloon marker string to display “on the other side” during Communicate.
Sent as the SSTP Marker header.
X-SSTP-PassThru-(any string) [SSP 2.5.03~ extension]
Only in a response to an event notification from SSTP, this header is added unchanged to the SSTP response.
Ignored for anything other than SSTP.
Multiple headers can be specified, but if you want to return multiple headers, change the header names.
(Old header name: X-SSTP-Return- is deprecated)