urbit/pkg/interface/webterm/constants.ts
fang 0d2c135959
webterm: small cleanup, comments
Also includes a more-sane prompt() description.
2022-03-15 01:34:19 +01:00

27 lines
665 B
TypeScript

export const DEFAULT_SESSION = '';
export const DEFAULT_HANDLER = 'hood';
/**
* Session ID validity:
*
* - must start with an alphabetical
* - can be composed of alphanumerics with hyphens
* - can be length 1 or longer
*/
export const SESSION_ID_REGEX = /(^[a-z]{1}[a-z\d-]*$)/;
/**
* Open a session with a given agent using `[agent]![session_name]`
*
* For example:
* ```
* book!my-session
* ```
*
* This will create a new session in webterm for the `%book` agent.
*
* Note that the second capture group after the ! is composed of the session ID
* regex above.
*/
export const AGENT_SESSION_REGEX = /^([a-z]{1}[a-z\d-]*)!([a-z]{1}[a-z\d-]*$)/;