Panels dialog saves a ready I/O port draft on close and keeps an unfinished one; one qualified message-name rule on both sides
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WgBfkm4rCmtd1T4vHWjEPx
This commit is contained in:
@@ -8,6 +8,19 @@ export function qualify(flow: string, name: string): string {
|
||||
return name.includes(".") ? name : `${flow}.${name}`
|
||||
}
|
||||
|
||||
/**
|
||||
* A message named with its flow, as the server checks it wherever a name has
|
||||
* to arrive qualified (`QUALIFIED_PATTERN` in `flow/messages.py`).
|
||||
*/
|
||||
const QUALIFIED_MESSAGE = /^[a-z][a-z0-9_]*(\.[A-Za-z0-9_]+)+$/
|
||||
|
||||
/** What is wrong with a name that has to be qualified, or null. */
|
||||
export function qualifiedProblem(name: string): string | null {
|
||||
return QUALIFIED_MESSAGE.test(name)
|
||||
? null
|
||||
: "Name the message as flow.name: a lowercase flow name, a dot, then letters, digits and underscores"
|
||||
}
|
||||
|
||||
/** The flow a qualified message belongs to. */
|
||||
export function flowOf(message: string): string {
|
||||
return message.split(".", 1)[0]
|
||||
|
||||
Reference in New Issue
Block a user