@namespace oxy "http://www.oxygenxml.com/extensions/author";

output-action {
    visibility: -oxy-collapse-text;
    content: oxy_combobox(edit, "#text", fontInherit, true, columns, 30, 
    editable, false,
    values, 
    "replace,\
    insert,\
    create-new-document,\
    none",
    tooltips, 
    "Provide an action that replaces the selected content with the AI response.,\
     Provide an action that inserts the AI response at a specified location within the current document.,\
     Provide an action that creates a new document based on the AI response.,\
     Do not provide any action that utilizes the AI response.");}
     
input {
    visibility: -oxy-collapse-text;
    content: oxy_combobox(edit, "#text", fontInherit, true, columns, 30,
    editable, false,
    values, "document, selection, selection${comma} document, none",
    tooltips, "Use the entire document as context.,\
               Use only the selected content as context.,\
               Use the selected text if available; otherwise${comma} use the entire document.,\
               Do not use any content from the current document.");
}

input-type {
    visibility: -oxy-collapse-text;
    content: oxy_combobox(edit, "#text", fontInherit, true, columns, 30,
    editable, false,
    values, "markup, plain-text",
    tooltips, "The content from the document which is sent to the platform should be processed as XML including markup tags.,\
               The content from the document which is sent to the platform should be processed as plain text without the tags.");
}

quick-assist {
    visibility: -oxy-collapse-text;
    content: oxy_combobox(edit, "#text", fontInherit, true, columns, 30, 
    values, "true, false",
    tooltips, "Make this action available as a quick assist., Make this action not available as a quick assist (default).");
}

embed-assist{
    visibility: -oxy-collapse-text;
    content: oxy_combobox(edit, "#text", fontInherit, true, columns, 30,
    values, "true, false",
    tooltips, "Make this action available in an embedded button in the editor., Make this action not available in an embedded button in the editor (default).");
}

action {
    visibility: -oxy-collapse-text;
    content: oxy_combobox(edit, "#text", fontInherit, true, columns, 30,
    values, "replace, insert-after, insert-before",
    tooltips, "Insertion type: replace the target element., Insertion type: insert after the target element location., Insertion type: insert before the target element location.");
}

choice-type {
    visibility: -oxy-collapse-text;
    content: oxy_combobox(edit, "#text", fontInherit, true, columns, 30,
    values, "multi-choice, single-choice, editable-combo-choice, none",
    tooltips, "The parameter should be configured by the end user as a single choice value.,\
               The parameter should be configured by the end user as multiple choice values.,\
               The parameter should be configured by the end user as an editable combo-box from which to choose a value.,\
               The parameter should be configured by the end user should not be shown at all for configuration.");
}

ref {
    padding-left: 0em;
    visibility: -oxy-collapse-text;
    content: oxy_combobox(edit, "#text",fontInherit, true,columns, 30,
    values, 
    "get_current_document_plain_text_content,\
    get_current_document_marked_up_content,\
    get_text_around_caret,\
    get_topic_context_in_toc,\
    get_related_resources_overview_from_project,\
    get_content_for_document_url,\
    find_similar_reusable_content,\
    save_document,\
    get_current_editor_file_location,\
    add_to_toc,\
    resolve_dita_key_or_content_reference,\
    validate_document_content,\
    invoke_ai_action,\
    retrieve_all_ai_actions,\
    get_related_content_from_webhelp,\
    get_corresponding_dita_keyrefs,\
    get_xsl_component_details,\
    get_xsd_component_details,\
    get_schematron_component_details",
    tooltips, 
    "Gets all text without mark-up from the current editor.,\
    Gets all text with mark-up from the current editor.,\
    Gets content from the current document around caret.,\
    Provides the hierarchical structure of the table of contents for a selected topic\\, showing its parent\\, uncles\\, siblings\\, and nearby nodes to clarify its position.,\
    Retrieves content from the first 5 documents retrieved by searching for keywords using the project indexing capabilities in the desktop application.,\
    Retrieves overviews from the first 5 documents retrieved by searching for keywords using the project indexing capabilities in the desktop application.,\
    Retrieves content for a certain document URL.,\
    Finds reusable DITA XML components in the current indexed project content matching the keywords.,\
    Saves content to a specified URL location.,\
    Returns the location (absolute path/URL) of the current file opened in the editor.,\
    Adds a reference to a dita topic in a Dita Map at a specific position.,\
    Resolves a DITA XML element which has a conref or keyref to the target content.,\
    Validates the content of a document and returns the validation problems in JSON format.,\
    Invokes an AI action by its ID and passes the content for processing.,\
    Retrieves the action IDs and their descriptions for all AI actions.,\
    Retrieves content from the user's online help system based on the provided keywords.,\
    Retrieves a JSON object mapping product names to DITA XML key references.,\
    Retrieves Extensible Stylesheet components from the current file\\, including those from imported or included schemas. The function gathers and categorizes elements such as templates\\, functions\\, variables\\, parameters\\, keys for subsequent processing or analysis.,\
    Retrieves XML Schema components from the current file\\, including those from imported or included schemas. The function gathers and categorizes elements such as simpleTypes\\, elements\\, notations\\, complexTypes\\, attributes\\, groups for subsequent processing or analysis.,\
    Retrieves Schematron components from the current file\\, including those from imported or included schemas. The function gathers and categorizes elements such as pattern\\, title\\, phase\\, diagnostics for subsequent processing or analysis."
);
}

engine>name {
    visibility: -oxy-collapse-text;
    content: oxy_combobox(edit, "#text", fontInherit, true, columns, 30,
    values, "GPT-4.1 (2025-04-14), GPT-4, GPT-4o, GPT-4o Mini, o3, o3 Mini, o4 Mini, GPT-4.1, GPT-4.1 Mini, GPT-4.1 Nano");
}

array>array:last-of-type:after(10) {
    display:block;
    position:relative;
    top:4em;
    left:0;
    content: ""
      oxy_editor(
        action, oxy_action(
            arg-fragment, "<array><id></id><title></title><short-description></short-description><description></description><categoryId></categoryId><type></type><context></context></array>",
            arg-insertPosition, "After",
            arg-insertLocation, ".",
            name, " New action ",
            description, "Insert new action item.",
            operation, "ro.sync.ecss.extensions.commons.operations.InsertFragmentOperation"),
            type, "button");
}

examples:last-of-type:after(10) {
    content: ""
      oxy_editor(
        action, oxy_action(
            arg-fragment, "<examples><prompt></prompt><completion></completion></examples>",
            arg-insertPosition, "After",
            arg-insertLocation, ".",
            name, " New example ",
            description, "Insert new example item.",
            operation, "ro.sync.ecss.extensions.commons.operations.InsertFragmentOperation"),
            type, "button");
}

function_refs:last-of-type:after(10) {
    position:relative;
    top:1em;
    content: ""
      oxy_editor(
        action, oxy_action(
            arg-fragment, "<function_refs><ref></ref></function_refs>",
            arg-insertPosition, "After",
            arg-insertLocation, ".",
            name, " New function ",
            description, "Insert new function item.",
            operation, "ro.sync.ecss.extensions.commons.operations.InsertFragmentOperation"),
            type, "button");
}

array>array, examples {
    border: 1px solid #c5c5c5;
    border-radius: 0.5em;
    padding: 1em;
    margin: 0.75em 0.75em 0.75em 0;
}

prompt, completion, id, description, short-description, categoryId, title, context {
    -oxy-show-placeholder: always
}
prompt {
    -oxy-placeholder-content: "An example for the user prompt.";
}
completion {
    -oxy-placeholder-content: "An example for the assistant completion response.";
}
prompt {
    -oxy-placeholder-content: "The prompt which is defined in the action.";
}
short-description {
    -oxy-placeholder-content: "A short description of the action.";
}
description {
    -oxy-placeholder-content: "A long description of the action, used as a tooltip.";
}
categoryId {
    -oxy-placeholder-content: "The category for the action.";
}
id {
    -oxy-placeholder-content: "The action ID which must have an unique value.";
}
title {
    -oxy-placeholder-content: "The name of the action displayed on the action's button or menu item.";
}


prompt:before {
    content: "Prompt: ";
}
completion:before {
    content: "Assistant response: "
}
temperature:before {
    content: "Temperature: ";
}
id:before {
    content: "Action ID: "
}
categoryId:before {
    content: "Action category: "
}
output-action:before {
    content: "Output action: "
}
input:before {
    content: "Input: "
}
title:before {
    content: "Action name: "
}
prompt_ref:before {
    content: "Prompt reference: ";
}

array>description:before, JSON>description:before {
    content: "Action description: "
}

short-description:before {
    content: "Action short description: "
}

input-type:before {
    content: "Input document type: "
}

framework:before {
    content: "Framework name: "
}

additional_info:before {
    content: "Additional info: "
}

examples:before {
    content: "Example: "
}

max_tokens:before {
    content: "Max tokens: "
}

parameters:before {
    content: "Advanced configuration parameters: ";
}

choice-type:before {
    content: "Choice type: ";
}

embed-assist:before {
    content: "Embedded button: ";
}

quick-assist:before {
    content: "Quick assist: ";
}

engine:before {
    content: "AI platform model name: ";
}

insert-modes:before {
    content: "Insert modes: ";
}

file_extension:before {
    content: "File extension: ";
}

input_content:before {
    content: "Input content: ";
}

engine>* {
    display:inline;
    -oxy-display-tags: none;
}

engine > name {
    padding: 0em;
}

parameters>*, expand-params>*, additional_info>* {
    padding-left: 1em;
}

engine, function_refs, expand-params, examples>* {
    -oxy-foldable:false
}

function_refs:before, function_refs>description,
expand-params:before, array:before, engine>name:before {
    display:none
}

function_refs:first-of-type {
    content: "Functions to be used: ";
    color : rgb(0,0,150);
}

ref:before {
    content: "";
}
expand-params:first-of-type {
    content: "Parameters to be expanded in the prompt content: ";
    color : rgb(0,0,150);
}

expand-params>* {
    color: black
}

alternate-values, alternate-value-labels{
    display: inline;
    -oxy-display-tags: none;
}

alternate-values ~ alternate-values:before,
alternate-value-labels ~ alternate-value-labels:before{
    content:'';
}

array {
    -oxy-not-foldable-child:title;
}

array:after {
    content:""!important;
}

prompt:before, completion:before {
    font-family: default;
    letter-spacing: 0em;
}
prompt, completion {
    margin-top: 0.25em;
    margin-bottom: 0.25em;
    letter-spacing: -0.05em;
    font-family: monospace;
}

id { font-weight:bold; }
id:before { font-weight:normal; }

* { padding: 0.4em; }
*:before { width: 12em; }

prompt_ref {
    content: oxy_urlChooser(edit, "#text", fontInherit, true, fileFilter, "md,markdown", columns 39);
    visibility:-oxy-collapse-text;
    -oxy-placeholder-content: "A relative URI reference to a file containing a prompt which is defined in the action.";
}

prompt_ref:after {
    link: oxy_xpath("text()");
    content: url("../img/link.png");
}
