import { Lex, } from '@ibgib/helper-gib/dist/helpers/lex-helper.mjs';
import { Ssml } from '@ibgib/helper-gib/dist/helpers/ssml-helper.mjs';
import { clone } from '@ibgib/helper-gib/dist/helpers/utils-helper.mjs';
import { ROBBOT_TAG_TJP_ADDRS_REL8N_NAME } from './robbot-constants.mjs';
/**
 * default value for a robbot request escape string (that string to signify
 * a comment is a request of a robbot)
 */
export const DEFAULT_ROBBOT_REQUEST_ESCAPE_STRING = '?';
export const DEFAULT_ROBBOT_REQUEST_MAX_LENGTH = 100;
/** Cmds for interacting with ibgib spaces. */
export const RobbotCmd = {
    /**
     * it's more like a grunt that is intepreted by context from the robbot.
     *
     * my initial use of this will be to add an ibgib to a robbot's
     * awareness. (input)
     */
    ib: 'ib',
    /**
     * it's more like a grunt that is intepreted by context from the robbot.
     *
     * my initial use of this will be to indicate to a robbot to add to a
     * conversation. (output)
     */
    gib: 'gib',
    /**
     * third placeholder command.
     *
     * I imagine this will be like "what's up", but who knows.
     */
    ibgib: 'ibgib',
    /**
     * power on
     */
    activate: 'activate',
    /** power off */
    deactivate: 'deactivate',
};
/**
 * Flags to affect the command's interpretation.
 */
export const RobbotCmdModifier = {
    /**
     * hmm...
     */
    ib: 'ib',
    /**
     * hmm...
     */
    gib: 'gib',
    /**
     * hmm...
     */
    ibgib: 'ibgib',
};
/**
 * When a robbot creates a comment on a context ibgib, he/she also relates it to
 * itself via this rel8nName.
 *
 * @example robbot.rel8ns.my_comment = 'comment myawesomeopinion wordyrobbot123^ABC'
 *
 * ## notes
 *
 * * "my" prefix is used to differentiate between the robbot's comments and comments
 *   on the robbot itself.
 */
export const ROBBOT_MY_COMMENTS_REL8N_NAME = 'my_comment';
/**
 * When a robbot participates in a conversation, that context is related via
 * this rel8n name.
 * @example robbot.rel8ns.context = 'comment someconvo^ABC'
 */
export const ROBBOT_CONTEXT_REL8N_NAME = 'context';
/**
 * Used to rel8 session ibgibs to robbots.
 * @example robbot.rel8ns.session = ['session 123^ABC'];
 */
export const ROBBOT_SESSION_REL8N_NAME = 'session';
/**
 * Used to rel8 interaction to sessions,
 * @example session.rel8ns.interaction = ['interaction 123^ABC'];
 */
export const ROBBOT_INTERACTION_REL8N_NAME = 'interaction';
export const ROBBOT_ATOM = "robbot";
export const ROBBOT_SESSION_ATOM = 'robbot_session';
export const ROBBOT_ANALYSIS_ATOM = 'robbot_analysis';
export const ROBBOT_INTERACTION_ATOM = 'robbot_interaction';
export const RobbotInteractionType = {
    /**
     * opening statement of a robbot
     */
    greeting: 'greeting',
    /**
     * stimulates a certain ibgib.
     */
    stimulation: 'stimulation',
    /**
     * closing statements of a robbot
     */
    farewell: 'farewell',
    /**
     * small nudges of info, including possibly repeating previous statement.
     */
    info: 'info',
    /**
     * providing info about context to aid the user in their options.
     */
    help: 'help',
};
export const DEFAULT_INTERACTION_SUBJECTTJPGIBS_DELIM = '_';
export const UNDEFINED_INTERACTION_SUBJECTTJPGIBS_STRING = 'undefined';
export const AtomicId = {
    hi: 'hi',
    welcome: 'welcome',
    bye: 'bye',
    yes: 'yes',
    no: 'no',
    learn: 'learn',
    wtg: 'wtg',
};
/**
 * enum constant for use with {@link SemanticInfo}.
 */
export const SemanticId = {
    help: 'semantic_help',
    hello: 'semantic_hello',
    bye: 'semantic_bye',
    yes: 'semantic_yes',
    no: 'semantic_no',
    cancel: 'semantic_cancel',
    skip: 'semantic_skip',
    forget: 'semantic_forget',
    next: 'semantic_next',
    please: 'semantic_please',
    in_progress: 'semantic_in_progress',
    list: 'semantic_list',
    request: 'semantic_request',
    count: 'semantic_count',
    options: 'semantic_options',
    ready: 'semantic_ready',
    stop: 'semantic_stop',
    result: 'semantic_result',
    unknown: 'semantic_unknown',
    default: 'semantic_default',
};
export function toLexDatums_Semantics(semanticId, texts) {
    return texts.flatMap(t => {
        return {
            texts: [t],
            language: 'en-US',
            props: { semanticId },
        };
    });
}
export function toLexDatums_Atomics(atomicId, texts) {
    return texts.flatMap(t => {
        return {
            texts: [t],
            language: 'en-US',
            props: { atomicId },
        };
    });
}
export const DEFAULT_HUMAN_LEX_DATA_ENGLISH_SEMANTICS = {
    [SemanticId.help]: [
        ...toLexDatums_Semantics(SemanticId.help, [
            'h', 'help', 'help me',
        ]),
    ],
    [SemanticId.yes]: [
        ...toLexDatums_Semantics(SemanticId.yes, [
            'yes', 'y', 'yeah', 'yea', 'aye', 'yup', 'yep', 'sure', 'ok',
            'sounds good', 'go for it', 'yes please', 'yes thanks', 'ok thanks',
            'uh huh', 'god yes', 'affirmative', 'ten four', '10-4', 'roger',
        ]),
    ],
    [SemanticId.no]: [
        ...toLexDatums_Semantics(SemanticId.no, [
            'no', 'n', 'nah', 'nay', 'nope', 'uh uh', 'no thanks', 'ick', 'nuh uh',
            'god no', 'no way', 'not at all', 'negative', 'that\'s a negative', 'nein',
        ])
    ],
    [SemanticId.cancel]: [
        ...toLexDatums_Semantics(SemanticId.cancel, [
            'cancel', 'nm', 'nevermind', 'cancel that', 'don\'t worry about it'
        ])
    ],
    [SemanticId.skip]: [
        ...toLexDatums_Semantics(SemanticId.skip, [
            'skip', 'sk',
        ])
    ],
    [SemanticId.forget]: [
        ...toLexDatums_Semantics(SemanticId.forget, [
            'forget', 'forget this', 'forget this one',
        ])
    ],
    [SemanticId.next]: [
        ...toLexDatums_Semantics(SemanticId.next, [
            'next', // 'next $(please)' /* need to get this kind of thing working */
        ])
    ],
    [SemanticId.bye]: [
        ...toLexDatums_Semantics(SemanticId.bye, [
            'bye', 'bye bye', 'see you later', 'see you',
        ])
    ],
    [SemanticId.unknown]: [
        ...toLexDatums_Semantics(SemanticId.unknown, [
            'are you mocking me, human?', 'mmhmm...', 'i see...', 'does not compute...', 'indeed'
        ])
    ],
};
export const DEFAULT_HUMAN_LEX_DATA_ENGLISH_ATOMICS = {
    [AtomicId.hi]: [
        ...toLexDatums_Atomics(AtomicId.hi, [
            'hi', 'howdy', 'hello', 'greetings', 'good day', 'hello there', 'good day to you', 'yo',
        ]),
    ],
    [AtomicId.welcome]: [
        ...toLexDatums_Atomics(AtomicId.welcome, [
            'welcome',
        ]),
    ],
    [AtomicId.yes]: [
        ...toLexDatums_Atomics(AtomicId.yes, [
            'yes', 'y', 'yeah', 'yea', 'aye', 'yup', 'yep', 'sure', 'ok',
            'sounds good', 'go for it', 'yes please', 'yes thanks', 'ok thanks',
            'uh huh', 'god yes', 'affirmative', 'ten four', '10-4', 'roger',
        ]),
    ],
    [AtomicId.no]: [
        ...toLexDatums_Atomics(AtomicId.no, [
            'no', 'n', 'nope', 'no thanks', 'no thank you',
        ]),
    ],
    [AtomicId.bye]: [
        ...toLexDatums_Atomics(AtomicId.bye, [
            'bye', 'bye bye', 'adios', 'ciao', 'later',
        ]),
    ],
    [AtomicId.learn]: [
        ...toLexDatums_Atomics(AtomicId.learn, [
            'learn', 'study', 'review',
        ]),
    ],
    [AtomicId.wtg]: [
        ...toLexDatums_Atomics(AtomicId.wtg, [
            'wtg', 'nice', 'not bad', 'pretty good', 'good job',
        ]),
    ],
};
export const DEFAULT_HUMAN_LEX_DATA_ENGLISH = {
    ...DEFAULT_HUMAN_LEX_DATA_ENGLISH_SEMANTICS,
    ...DEFAULT_HUMAN_LEX_DATA_ENGLISH_ATOMICS,
};
export const DEFAULT_HUMAN_LEX_DATA = {
    ...clone(DEFAULT_HUMAN_LEX_DATA_ENGLISH),
};
export const DEFAULT_USER_LEX_DATA = {
    ...clone(DEFAULT_HUMAN_LEX_DATA),
};
/**
 * This lex is to be used for parsing user responses.
 *
 * Also, you can use this in the robbot's responses, if you initialize the
 * robbot's lex to include this. This way, the robbot speaks as he/she expects
 * to be spoken to.
 *
 * So when a user says 'yes', we can interpret it via a lookup in the lex data.
 * we will find the id filter via keywords.
 */
export const DEFAULT_USER_LEX = new Lex(DEFAULT_USER_LEX_DATA, {
    requestLanguage: "en-US", defaultLanguage: "en-US",
    defaultCapitalize: "none",
    defaultLineConcat: "delim", defaultDelim: "\n\n",
    defaultKeywordMode: "any", defaultPropsMode: "prop",
});
/**
 * default phrases for the robbot to use when chatting.
 */
export const DEFAULT_ROBBOT_LEX_DATA = {
    ...clone(DEFAULT_HUMAN_LEX_DATA),
};
// adjust for robbot-ness a bit
DEFAULT_ROBBOT_LEX_DATA[SemanticId.bye].push({
    texts: ['EOL',],
    ssmls: [Ssml.sub('EOL', 'end of line'),],
    language: 'en-US',
    props: { semanticId: SemanticId.bye, },
    weighting: 100,
});
DEFAULT_ROBBOT_LEX_DATA[SemanticId.unknown] = [
    ...toLexDatums_Semantics(SemanticId.unknown, [
        'i\'m not quite sure what you mean', 'does not compute',
    ])
];
//# sourceMappingURL=robbot-types.mjs.map