UNPKG

@minecraft/creator-tools

Version:

Minecraft Creator Tools command line and libraries.

184 lines (183 loc) 6.98 kB
"use strict"; // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. Object.defineProperty(exports, "__esModule", { value: true }); exports.SummarizerHumanifyType = exports.SummarizerTokenType = exports.SummarizerRole = exports.SummarizerSentiment = exports.SummarizerEmphasis = void 0; /** * Semantic emphasis level for token display. * * Use semantic emphasis rather than literal styling (bold, italic) so that * the rendering can adapt to different themes and contexts. * * @example * // Make a value stand out * { "type": "value", "field": "max", "effects": { "emphasis": "strong" } } */ var SummarizerEmphasis; (function (SummarizerEmphasis) { /** Normal text weight, no special styling */ SummarizerEmphasis["normal"] = "normal"; /** Make text stand out (typically bold or highlighted) */ SummarizerEmphasis["strong"] = "strong"; /** De-emphasize text (typically lighter/smaller) */ SummarizerEmphasis["subtle"] = "subtle"; })(SummarizerEmphasis || (exports.SummarizerEmphasis = SummarizerEmphasis = {})); /** * Semantic sentiment for color-coding tokens. * * Sentiment indicates the "meaning" of a value, allowing the renderer to * apply appropriate colors that work across themes. * * @example * // Show high health as positive (green) * { "type": "value", "field": "max", "effects": { "sentiment": "positive" } } * * // Show low health as negative (red) * { "type": "literal", "text": "very low health", "effects": { "sentiment": "negative" } } */ var SummarizerSentiment; (function (SummarizerSentiment) { /** No special color treatment */ SummarizerSentiment["neutral"] = "neutral"; /** Good/desirable value (typically green) */ SummarizerSentiment["positive"] = "positive"; /** Bad/dangerous value (typically red) */ SummarizerSentiment["negative"] = "negative"; /** Caution/attention needed (typically yellow/orange) */ SummarizerSentiment["warning"] = "warning"; /** Informational highlight (typically blue) */ SummarizerSentiment["info"] = "info"; })(SummarizerSentiment || (exports.SummarizerSentiment = SummarizerSentiment = {})); /** * Semantic role for consistent styling of different token types. * * This provides a way to ensure consistent styling for similar content * across different summarizers. * * @example * // Style as a value (might be monospace or highlighted) * { "type": "value", "field": "damage", "effects": { "role": "value" } } */ var SummarizerRole; (function (SummarizerRole) { /** Plain text, no special role */ SummarizerRole["text"] = "text"; /** A data value (number, identifier) */ SummarizerRole["value"] = "value"; /** A unit label (HP, blocks, seconds) */ SummarizerRole["unit"] = "unit"; /** A label or category name */ SummarizerRole["label"] = "label"; /** A comparison or reference */ SummarizerRole["comparison"] = "comparison"; })(SummarizerRole || (exports.SummarizerRole = SummarizerRole = {})); /** * Enumeration of all summarizer token types. * * @example * // A simple literal token * { "type": "literal", "text": "has " } * * @example * // A switch token for qualitative descriptions * { * "type": "switch", * "cases": [ * { "conditions": [{ "field": "max", "comparison": ">", "value": 100 }], * "tokens": [{ "type": "literal", "text": "extremely high health" }] } * ] * } */ var SummarizerTokenType; (function (SummarizerTokenType) { /** * Outputs a static text string. The most basic token type. * @example { "type": "literal", "text": "has " } */ SummarizerTokenType["literal"] = "literal"; /** * Inserts the value of a field from the data object. * @example { "type": "value", "field": "max", "format": "number" } */ SummarizerTokenType["value"] = "value"; /** * Selects one of several token arrays based on conditions. * Essential for qualitative descriptions ("low", "medium", "high"). * @example See ISwitchToken for full example */ SummarizerTokenType["switch"] = "switch"; /** * Renders a grammatically correct list of items. * Handles "a", "a and b", "a, b, and c" automatically. * @example See IListToken for full example */ SummarizerTokenType["list"] = "list"; /** * String interpolation with named placeholders. * Useful for complex phrases with multiple values. * @example { "type": "template", "template": "deals {damage} {type} damage" } */ SummarizerTokenType["template"] = "template"; /** * Handles singular/plural forms based on a numeric field. * @example "1 heart" vs "5 hearts" */ SummarizerTokenType["plural"] = "plural"; /** * Pulls a sample value from the form definition to use as a reference. * Encourages AI to use real-world examples from the data. * @example { "type": "sample", "samplePath": "entities/warden", "field": "max" } */ SummarizerTokenType["sample"] = "sample"; /** * Formats a value with units and optional conversion. * @example "200 ticks (10 seconds)" */ SummarizerTokenType["unit"] = "unit"; /** * Outputs tokens only if a field is defined (or undefined). * @example "has a custom loot table" (only if loot_table exists) */ SummarizerTokenType["exists"] = "exists"; /** * Groups tokens together, useful for applying visibility to multiple tokens. * @example Wrap "(stronger than X)" in a group with visibility condition */ SummarizerTokenType["group"] = "group"; /** * Joins child token arrays with a conjunction ("and", "or", "but"). * @example "can fly and swim" or "immune to fire but weak to water" */ SummarizerTokenType["conjunction"] = "conjunction"; })(SummarizerTokenType || (exports.SummarizerTokenType = SummarizerTokenType = {})); /** * Algorithms for making values more human-readable. * * @example * // In a value token: * { "type": "value", "field": "entity_type", "humanify": "minecraft" } * // Converts "minecraft:zombie_pigman""Zombie Pigman" */ var SummarizerHumanifyType; (function (SummarizerHumanifyType) { /** * No transformation, output the raw value. */ SummarizerHumanifyType["none"] = "none"; /** * General humanification: underscores to spaces, title case. * "my_cool_thing""My Cool Thing" */ SummarizerHumanifyType["general"] = "general"; /** * Minecraft-specific humanification: removes namespace, converts to title case. * "minecraft:zombie_pigman""Zombie Pigman" * "custom:my_entity""My Entity" */ SummarizerHumanifyType["minecraft"] = "minecraft"; /** * Capitalize first letter only. * "hello world""Hello world" */ SummarizerHumanifyType["sentence"] = "sentence"; })(SummarizerHumanifyType || (exports.SummarizerHumanifyType = SummarizerHumanifyType = {}));