@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, markup-with-images, plain-text",
    tooltips, "The document content is sent to the platform as XML (including all markup tags).,\
The document content is sent to the platform as XML (including all markup tags), and any referenced images are also sent to the LLM.,\
The document content is sent to the platform as plain text, with all markup tags removed.");
}

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_content,\
    get_ditamap_structure,\
    search_project_resources,\
    get_document_content,\
    find_reusable_components,\
    save_document,\
    get_current_document_location,\
    add_dita_reference_to_ditamap,\
    resolve_dita_reference,\
    validate_content,\
    invoke_ai_action,\
    retrieve_ai_actions,\
    search_webhelp_content,\
    get_dita_keyrefs,\
    get_xsl_components,\
    get_xsd_components,\
    get_schematron_components",
    tooltips, 
    "Read content from the currently active document in the editor. Returns content with line numbers.,\
    Returns the hierarchical structure of the DITA Map around a selected topic\\, including ancestors\\, siblings\\, and optionally descendants.,\
    Searches the local project for resources matching keywords and returns an overview with title\\, description\\, and relevance ranking.,\
    Read content from a local file or remote URL resource by specifying its file path or URL. Returns content with line numbers.,\
    Find reusable components matching specified keywords.,\
    Write content to a file at the specified path or URL. Creates new files or overwrites existing ones.,\
    Get absolute path or URL of currently opened document.,\
    Add a reference to a target resource at a specified location within a DITA Map structure.,\
    Resolve DITA key references\\, content key references\\, or content references to their actual content.,\
    Validate specified content and return error messages with location and severity information in JSON format.,\
    Execute AI actions when explicitly requested by user. First retrieve available action IDs using 'retrieve_ai_actions' tool.,\
    Retrieve available AI action IDs and descriptions. Use only when user explicitly requests to invoke AI actions.,\
    Retrieve relevant content from the WebHelp online help system based on keywords.,\
    Get mapping between product names and corresponding DITA key references in JSON format.,\
    Retrieve XSLT components (templates\\, functions\\, variables\\, parameters\\, keys) from the current file and any imported or included stylesheets.,\
    Retrieve XML Schema components (simpleTypes\\, elements\\, annotations\\, complexTypes\\, attributes\\, groups) from the current file and any imported or included schemas.,\
    Retrieve Schematron components (patterns\\, titles\\, phases\\, diagnostics) from the current file and any imported or included stylesheets."
);
}

engine>name {
    visibility: -oxy-collapse-text;
    content: oxy_combobox(edit, "#text", fontInherit, true, columns, 30,
    values, "GPT-4.1 (2025-04-14), 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");
}
