From 82a9ed0cf0be871277f6d91db27d5c0c78eebfff Mon Sep 17 00:00:00 2001 From: Ryan Cartwright Date: Thu, 5 Nov 2026 11:11:38 +1100 Subject: [PATCH 1/2] feat(ios): generate the API client, limits, catalogs, palette, icons and the apps' shared constants in Swift --- .gitattributes | 1 + apps/NATIVE.md | 89 + apps/codegen/api/swift.ts | 457 ++ apps/codegen/generate-api.ts | 6 +- apps/codegen/generate-artifact-pages.ts | 154 + apps/codegen/generate-bot-looks.ts | 137 + apps/codegen/generate-built-in-tools.ts | 45 + apps/codegen/generate-catalogs.ts | 271 + apps/codegen/generate-connection-marks.ts | 164 + apps/codegen/generate-emoji.ts | 27 + apps/codegen/generate-file-and-zone-lists.ts | 100 + apps/codegen/generate-limits.ts | 115 + apps/codegen/generate-lucide-icons.ts | 152 + apps/codegen/generate-native-constants.ts | 67 + apps/codegen/generate-palette.ts | 212 + apps/codegen/generate-provider-logos.ts | 161 + apps/codegen/generate.ts | 26 +- apps/codegen/generated-files.ts | 6 + apps/ios/Sugabots/API/API.generated.swift | 7139 +++++++++++++++++ .../ios/Sugabots/API/Catalogs.generated.swift | 183 + apps/ios/Sugabots/API/Limits.generated.swift | 54 + .../Artifacts/ArtifactPages.generated.swift | 65 + .../ProviderLogos/Contents.json | 9 + .../anthropic.imageset/Contents.json | 25 + .../anthropic.imageset/anthropic-dark.svg | 4 + .../anthropic.imageset/anthropic.svg | 4 + .../cerebras.imageset/Contents.json | 15 + .../cerebras.imageset/cerebras.svg | 7 + .../deepseek.imageset/Contents.json | 15 + .../deepseek.imageset/deepseek.svg | 3 + .../fireworks.imageset/Contents.json | 15 + .../fireworks.imageset/fireworks.svg | 5 + .../gemini.imageset/Contents.json | 15 + .../ProviderLogos/gemini.imageset/gemini.svg | 1 + .../ProviderLogos/groq.imageset/Contents.json | 15 + .../ProviderLogos/groq.imageset/groq.svg | 1 + .../llamacpp.imageset/Contents.json | 15 + .../llamacpp.imageset/llamacpp.svg | 77 + .../lmstudio.imageset/Contents.json | 15 + .../lmstudio.imageset/lmstudio.svg | 21 + .../mistral.imageset/Contents.json | 15 + .../mistral.imageset/mistral.svg | 12 + .../ollama.imageset/Contents.json | 25 + .../ollama.imageset/ollama-dark.svg | 3 + .../ProviderLogos/ollama.imageset/ollama.svg | 3 + .../openai.imageset/Contents.json | 25 + .../openai.imageset/openai-dark.svg | 3 + .../ProviderLogos/openai.imageset/openai.svg | 3 + .../openrouter.imageset/Contents.json | 25 + .../openrouter.imageset/openrouter-dark.svg | 3 + .../openrouter.imageset/openrouter.svg | 3 + .../together.imageset/Contents.json | 15 + .../together.imageset/together.svg | 21 + .../ProviderLogos/vllm.imageset/Contents.json | 15 + .../ProviderLogos/vllm.imageset/vllm.svg | 1 + .../ProviderLogos/xai.imageset/Contents.json | 25 + .../ProviderLogos/xai.imageset/xai-dark.svg | 4 + .../ProviderLogos/xai.imageset/xai.svg | 4 + .../Conversation/BuiltInTools.generated.swift | 34 + .../Conversation/FileLook.generated.swift | 6 + .../Sugabots/Design/BotLooks.generated.swift | 83 + .../Design/ConnectionMarks.generated.swift | 41 + .../Sugabots/Design/Lucide.generated.swift | 181 + .../Design/NativeConstants.generated.swift | 26 + .../Sugabots/Design/Palette.generated.swift | 118 + .../Design/ProviderLogos.generated.swift | 89 + apps/ios/Sugabots/Home/Mutes.generated.swift | 12 + apps/ios/Sugabots/Resources/Emoji.json | 1 + .../Settings/TimeZoneRegions.generated.swift | 16 + apps/native-constants.json | 50 + biome.json | 4 +- 71 files changed, 10756 insertions(+), 3 deletions(-) create mode 100644 apps/NATIVE.md create mode 100644 apps/codegen/api/swift.ts create mode 100644 apps/codegen/generate-artifact-pages.ts create mode 100644 apps/codegen/generate-bot-looks.ts create mode 100644 apps/codegen/generate-built-in-tools.ts create mode 100644 apps/codegen/generate-catalogs.ts create mode 100644 apps/codegen/generate-connection-marks.ts create mode 100644 apps/codegen/generate-emoji.ts create mode 100644 apps/codegen/generate-file-and-zone-lists.ts create mode 100644 apps/codegen/generate-limits.ts create mode 100644 apps/codegen/generate-lucide-icons.ts create mode 100644 apps/codegen/generate-native-constants.ts create mode 100644 apps/codegen/generate-palette.ts create mode 100644 apps/codegen/generate-provider-logos.ts create mode 100644 apps/ios/Sugabots/API/API.generated.swift create mode 100644 apps/ios/Sugabots/API/Catalogs.generated.swift create mode 100644 apps/ios/Sugabots/API/Limits.generated.swift create mode 100644 apps/ios/Sugabots/Artifacts/ArtifactPages.generated.swift create mode 100644 apps/ios/Sugabots/Assets.xcassets/ProviderLogos/Contents.json create mode 100644 apps/ios/Sugabots/Assets.xcassets/ProviderLogos/anthropic.imageset/Contents.json create mode 100644 apps/ios/Sugabots/Assets.xcassets/ProviderLogos/anthropic.imageset/anthropic-dark.svg create mode 100644 apps/ios/Sugabots/Assets.xcassets/ProviderLogos/anthropic.imageset/anthropic.svg create mode 100644 apps/ios/Sugabots/Assets.xcassets/ProviderLogos/cerebras.imageset/Contents.json create mode 100644 apps/ios/Sugabots/Assets.xcassets/ProviderLogos/cerebras.imageset/cerebras.svg create mode 100644 apps/ios/Sugabots/Assets.xcassets/ProviderLogos/deepseek.imageset/Contents.json create mode 100644 apps/ios/Sugabots/Assets.xcassets/ProviderLogos/deepseek.imageset/deepseek.svg create mode 100644 apps/ios/Sugabots/Assets.xcassets/ProviderLogos/fireworks.imageset/Contents.json create mode 100644 apps/ios/Sugabots/Assets.xcassets/ProviderLogos/fireworks.imageset/fireworks.svg create mode 100644 apps/ios/Sugabots/Assets.xcassets/ProviderLogos/gemini.imageset/Contents.json create mode 100644 apps/ios/Sugabots/Assets.xcassets/ProviderLogos/gemini.imageset/gemini.svg create mode 100644 apps/ios/Sugabots/Assets.xcassets/ProviderLogos/groq.imageset/Contents.json create mode 100644 apps/ios/Sugabots/Assets.xcassets/ProviderLogos/groq.imageset/groq.svg create mode 100644 apps/ios/Sugabots/Assets.xcassets/ProviderLogos/llamacpp.imageset/Contents.json create mode 100644 apps/ios/Sugabots/Assets.xcassets/ProviderLogos/llamacpp.imageset/llamacpp.svg create mode 100644 apps/ios/Sugabots/Assets.xcassets/ProviderLogos/lmstudio.imageset/Contents.json create mode 100644 apps/ios/Sugabots/Assets.xcassets/ProviderLogos/lmstudio.imageset/lmstudio.svg create mode 100644 apps/ios/Sugabots/Assets.xcassets/ProviderLogos/mistral.imageset/Contents.json create mode 100644 apps/ios/Sugabots/Assets.xcassets/ProviderLogos/mistral.imageset/mistral.svg create mode 100644 apps/ios/Sugabots/Assets.xcassets/ProviderLogos/ollama.imageset/Contents.json create mode 100644 apps/ios/Sugabots/Assets.xcassets/ProviderLogos/ollama.imageset/ollama-dark.svg create mode 100644 apps/ios/Sugabots/Assets.xcassets/ProviderLogos/ollama.imageset/ollama.svg create mode 100644 apps/ios/Sugabots/Assets.xcassets/ProviderLogos/openai.imageset/Contents.json create mode 100644 apps/ios/Sugabots/Assets.xcassets/ProviderLogos/openai.imageset/openai-dark.svg create mode 100644 apps/ios/Sugabots/Assets.xcassets/ProviderLogos/openai.imageset/openai.svg create mode 100644 apps/ios/Sugabots/Assets.xcassets/ProviderLogos/openrouter.imageset/Contents.json create mode 100644 apps/ios/Sugabots/Assets.xcassets/ProviderLogos/openrouter.imageset/openrouter-dark.svg create mode 100644 apps/ios/Sugabots/Assets.xcassets/ProviderLogos/openrouter.imageset/openrouter.svg create mode 100644 apps/ios/Sugabots/Assets.xcassets/ProviderLogos/together.imageset/Contents.json create mode 100644 apps/ios/Sugabots/Assets.xcassets/ProviderLogos/together.imageset/together.svg create mode 100644 apps/ios/Sugabots/Assets.xcassets/ProviderLogos/vllm.imageset/Contents.json create mode 100644 apps/ios/Sugabots/Assets.xcassets/ProviderLogos/vllm.imageset/vllm.svg create mode 100644 apps/ios/Sugabots/Assets.xcassets/ProviderLogos/xai.imageset/Contents.json create mode 100644 apps/ios/Sugabots/Assets.xcassets/ProviderLogos/xai.imageset/xai-dark.svg create mode 100644 apps/ios/Sugabots/Assets.xcassets/ProviderLogos/xai.imageset/xai.svg create mode 100644 apps/ios/Sugabots/Conversation/BuiltInTools.generated.swift create mode 100644 apps/ios/Sugabots/Conversation/FileLook.generated.swift create mode 100644 apps/ios/Sugabots/Design/BotLooks.generated.swift create mode 100644 apps/ios/Sugabots/Design/ConnectionMarks.generated.swift create mode 100644 apps/ios/Sugabots/Design/Lucide.generated.swift create mode 100644 apps/ios/Sugabots/Design/NativeConstants.generated.swift create mode 100644 apps/ios/Sugabots/Design/Palette.generated.swift create mode 100644 apps/ios/Sugabots/Design/ProviderLogos.generated.swift create mode 100644 apps/ios/Sugabots/Home/Mutes.generated.swift create mode 100644 apps/ios/Sugabots/Resources/Emoji.json create mode 100644 apps/ios/Sugabots/Settings/TimeZoneRegions.generated.swift create mode 100644 apps/native-constants.json diff --git a/.gitattributes b/.gitattributes index 2c07470fc..3e9240db4 100644 --- a/.gitattributes +++ b/.gitattributes @@ -3,4 +3,5 @@ packages/emoji/src/emoji.json linguist-generated=true # Generated by `bun run --cwd packages/contracts generate`; collapsed in diffs. packages/contracts/openapi.json linguist-generated=true # Generated by `node apps/codegen/generate.ts`; collapsed in diffs. +apps/ios/Sugabots/**/*.generated.swift linguist-generated=true apps/android/**/*.generated.kt linguist-generated=true diff --git a/apps/NATIVE.md b/apps/NATIVE.md new file mode 100644 index 000000000..5f6b5fd77 --- /dev/null +++ b/apps/NATIVE.md @@ -0,0 +1,89 @@ +# Where the native apps differ from the web + +The native apps copy the web app's phone layout (`packages/web`, below its `md` breakpoint) screen for screen. These are the places they deliberately don't, each with its value, why, and what the web does instead. A new native app (Android next) takes the same decisions. + +The numbers and strings below live in [`native-constants.json`](native-constants.json), which each app's generator turns into its own constants (`NativeConstants` in the iOS app, from `codegen/generate-native-constants.ts`). Change a value there, not in an app. Everything else the apps share with the web, such as limits, catalogs and words, is generated from `@sugabots/contracts` and `packages/web/src/lib` (see [`ios/README.md`](ios/README.md)). + +## Signing in starts with the workspace + +- **Value:** a box for the workspace's name with `.sugabots.ai` (`hostedWorkspaceEnding`) written after it, which opens `https://[name].sugabots.ai`. "Self-hosted?" swaps it for one box taking a server's whole address, such as `sugabots.yourcompany.com`. A whole address typed or pasted into the name box is split into the name and its ending. +- **Why:** an app isn't opened at an address, so it has to ask which server to talk to before it can sign anyone in. Slack's apps ask the same way. +- **Replaces:** the web signs in on whatever server served the page, so it never asks. + +## Holding a message slides its actions up from the foot + +- **Value:** a sheet with a row of quick reactions, 5 of them (`quickReactionCount`): the emoji chosen lately on the device first, then 👍 ❤️ 😂 🎉 👀 (`usualReactions`), then a button for the picker. Under them, Reply, Thread and Copy as tiles. Holding brings the sheet up rather than selecting the message's text. +- **Why:** a phone has no hover, and a held press is how iOS and Slack offer what can be done with something. +- **Replaces:** the web's toolbar that appears over a message on hover, with its emoji, reply and thread buttons; text on the web can be selected. + +## Reaction chips are a fingertip's size + +- **Value:** 32 points tall (`reactionChipHeight`). +- **Why:** the web's chips are sized for a pointer and are hard to hit with a finger. Slack's phone chips are about this size. +- **Replaces:** the web's smaller chips. + +## A conversation's header is a frosted row, after Slack's + +- **Value:** Back, then one glass pill 44 points tall (`headerPillHeight`) holding the conversation's face at 32 points (`headerFaceSize`, set 6 points in from the pill's rounded end), its name, and a quieter line under it: a bot's model, or for a pod's channel how many people and bots are in it. The pill opens Details. The header sits 8 points below the Dynamic Island (`headerGapBelowIsland`) and the conversation scrolls under its frost. +- **Why:** it reads as one thing to tap, puts the name where a thumb reaches, and keeps the conversation visible to the top of the screen. +- **Replaces:** the web's header, with the face over the name in the middle and Computer and Details at the right. + +## The tab bar and composer sit low and in from the sides + +- **Value:** the tab bar sinks up to 12 points (`tabBarSink`) into the home indicator's band, keeping 8 points off the screen's edge. The tab bar and the composer sit 21 points (`barSideInset`) in from the screen's sides. +- **Why:** it leaves the content more room and lines the bars up with the system's own floating bars. +- **Replaces:** the web's tab bar, which sits above the safe area (or 12 pixels off the edge without one), 16 pixels in from the sides. + +## The composer keeps a gap over the keyboard + +- **Value:** 8 points (`keyboardGap`) between the composer and the keyboard, backed by frost so the gap isn't a dark band. +- **Why:** iOS lifts the composer with the keyboard; without a gap it sits flush against it. +- **Replaces:** the web, where the browser decides how the keyboard and the page meet. + +## Routines live under a bot channel's ⋯ + +- **Value:** a bot's channel has a ⋯ at the right of its header with Computer and Routines. Home has no Routines row under a bot. A red dot marks both the bot's row on Home and the ⋯ while one of its routines' latest run failed. +- **Why:** the header has room for one control, and a bot's routines belong with the bot's own channel. +- **Replaces:** the web's Computer button in the header and the Routines row under each bot on Home. + +## Pages open on the open tab + +- **Value:** any page, such as Settings, a bot's routines, or a pod's settings, is pushed onto the tab that is open, and swiping back returns to where it was opened from. +- **Why:** an iOS tab keeps its own stack; jumping to another tab to show a page loses the person's place. +- **Replaces:** the web, where settings pages sit under You. + +## Tapping the open tab returns to its first page + +- **Value:** tapping the tab that is already open pops it back to its root. +- **Why:** it's what every iOS tab bar does. +- **Replaces:** nothing different in effect: each of the web's tabs is a link to its first page. An iOS tab keeps its stack, so the app pops it on purpose. + +## Settings switches are the system's, in the system's green + +- **Value:** the platform's own switch, at a phone's size, tinted the system's green. +- **Why:** the web's small switch is hard to hit with a finger, and the app's accent, near white in dark, hid the switch's white knob. +- **Replaces:** the web's small switch in the app's accent. + +## A bot's face is lively in its Details + +- **Value:** the bot's face at the top of its Details moves as the web's faces do where a bot is answering. +- **Why:** Details is where a person meets the bot on a phone, and the face is large there. +- **Replaces:** the web's still face in Details. The face's own values come with the face work on its own branch and join `native-constants.json` then. + +## Holding a pod's icon brings up its notifications + +- **Value:** holding a pod's icon in Home's rail opens the pod's notification menu, as holding a bot's row does. +- **Why:** a phone has no right-click; holding is how iOS offers a menu. +- **Replaces:** the web's notification menu on right-clicking a pod. + +## Holding a channel offers Rename and Archive + +- **Value:** holding a pod's channel on Home offers Rename and Archive, as its Details does. +- **Why:** holding is the phone's menu, and opening a channel's Details to rename it is a long way round on a phone. +- **Replaces:** the web, which offers them only in the channel's Details. + +## No New workspace + +- **Value:** You has no New workspace. +- **Why:** the app finds a workspace by its server when signing in, and each workspace has its own server, so the app has nowhere to make one. A new workspace is made on the web. +- **Replaces:** the web's New workspace in You. diff --git a/apps/codegen/api/swift.ts b/apps/codegen/api/swift.ts new file mode 100644 index 000000000..8224ef82e --- /dev/null +++ b/apps/codegen/api/swift.ts @@ -0,0 +1,457 @@ +/** + * Writes the API model as Swift: a `Codable` type for each of the API's types, + * and a typed request for each route, grouped as the web's client groups them, + * so `api.threads.get(...)` in TypeScript is `client.threads.get(...)` in Swift. + * + * It is written against `Sugabots/API/APISupport.swift`: `APIClient.call`, + * `QueryItems`, `ParameterValue`, `pathSegment`, `Omittable`, `AnyCodingKey` + * and `JSONValue`. + * + * - A struct is a `struct`. A field that may be left out is optional, and a + * clearable one is an `Omittable`, which tells left out from null. + * - An enum or a tagged union reads a value it doesn't know as its unknown case. + * - A number that may come as `Infinity`, `-Infinity` or `NaN` is a `Double`: + * `APIClient`'s decoder and encoder read and write those strings for any. + */ +import type { + ApiModel, + Definition, + Operation, + OperationGroup, + Presence, + Property, + StringEnum, + Struct, + TaggedUnion, + TypeRef, + UntaggedUnion, +} from "./model.ts"; +import { operationTypes, routesClassName } from "./model.ts"; +import { camelCase } from "./naming.ts"; + +const swiftKeywords = new Set( + `associatedtype class deinit enum extension fileprivate func import init inout internal let open operator private precedencegroup protocol public rethrows static struct subscript typealias var break case catch continue default defer do else fallthrough for guard if in repeat return throw switch where while as Any false is nil self Self super throws true try Type Protocol`.split( + " ", + ), +); + +/** A name as Swift will take it: backquoted when it's a keyword. */ +function identifier(name: string): string { + return swiftKeywords.has(name) ? `\`${name}\`` : name; +} + +const swiftString = (value: string) => JSON.stringify(value); + +function docComment(text: string | undefined, indent: string): string[] { + if (text === undefined || text.trim() === "") return []; + return text + .trim() + .split("\n") + .map((line) => `${indent}/// ${line.trim()}`.trimEnd()); +} + +function indented(lines: string[], depth = 1): string[] { + const prefix = "\t".repeat(depth); + return lines.map((line) => (line ? prefix + line : line)); +} + +/** Declarations, a blank line before each. */ +function spaced(blocks: string[][]): string[] { + return blocks.flatMap((lines) => ["", ...lines]); +} + +/** A field's type as a struct declares it, given its type without null, `base`. */ +function fieldType(presence: Presence, base: string): string { + switch (presence.kind) { + case "clearable": + return `Omittable<${base}>`; + case "required": + case "fixed": + return base; + case "requiredOrNull": + case "optional": + return `${base}?`; + } +} + +/** What a field defaults to, as Swift writes it after the type: in a struct and as a call's argument. */ +function fieldDefault(presence: Presence): string { + switch (presence.kind) { + case "clearable": + return " = .omitted"; + case "fixed": + return ` = ${typeof presence.value === "string" ? swiftString(presence.value) : presence.value}`; + case "required": + return ""; + case "requiredOrNull": + case "optional": + return " = nil"; + } +} + +/** Writes each definition with the types the model nests in it inside it. */ +class SwiftWriter { + /** The Swift type for `type`, with `inlinePrefix` before an inline type's name. */ + typeOf(type: TypeRef, inlinePrefix = ""): string { + switch (type.kind) { + case "reference": + return type.name; + case "nullable": + return `${this.typeOf(type.type, inlinePrefix)}?`; + case "inline": + return inlinePrefix + type.definition.name; + case "array": + return `[${this.typeOf(type.items, inlinePrefix)}]`; + case "map": + return `[String: ${this.typeOf(type.values, inlinePrefix)}]`; + case "string": + return "String"; + case "integer": + return "Int"; + case "number": + return "Double"; + case "boolean": + return "Bool"; + case "dateTime": + return "Date"; + case "binary": + return "Data"; + case "json": + return "JSONValue"; + } + } + + /** `definition`'s declaration, with the declarations of the types nested in it. */ + definition(definition: Definition): string[] { + switch (definition.kind) { + case "struct": + return this.struct(definition); + case "enum": + return this.stringEnum(definition); + case "taggedUnion": + return this.taggedUnion(definition); + case "untaggedUnion": + return this.untaggedUnion(definition); + case "alias": + // A type alias can't hold types, so what it names sits beside it. + return [ + ...docComment(definition.description, ""), + `typealias ${definition.name} = ${this.typeOf(definition.type)}`, + ...spaced(this.nestedIn(definition.type)), + ]; + } + } + + /** The declarations of the inline types `type` uses. */ + nestedIn(type: TypeRef): string[][] { + switch (type.kind) { + case "inline": + return [this.definition(type.definition)]; + case "nullable": + return this.nestedIn(type.type); + case "array": + return this.nestedIn(type.items); + case "map": + return this.nestedIn(type.values); + default: + return []; + } + } + + /** A type's body closed with the declarations nested in it, which the inline types of `types` are. */ + private closed(types: TypeRef[]): string[] { + return [...indented(spaced(types.flatMap((type) => this.nestedIn(type)))), "}"]; + } + + // MARK: Structs + + private struct(struct: Struct): string[] { + const properties = struct.properties; + const lines = [ + ...docComment(struct.description, ""), + `struct ${struct.name}: Codable, Hashable, Sendable {`, + ]; + for (const property of properties) { + lines.push(...docComment(property.description, "\t")); + const type = fieldType(property.presence, this.typeOf(property.type)); + lines.push( + `\tvar ${identifier(property.name)}: ${type}${this.structDefault(property.presence)}`, + ); + } + const needsCodingKeys = properties.some( + (property) => + property.name !== property.jsonName || property.presence.kind === "requiredOrNull", + ); + if (needsCodingKeys) lines.push("", ...this.codingKeys(properties)); + return [...lines, ...this.closed(properties.map((property) => property.type))]; + } + + /** What a struct's field defaults to: a field that may be left out defaults to nil without saying so. */ + private structDefault(presence: Presence): string { + return presence.kind === "optional" || presence.kind === "requiredOrNull" + ? "" + : fieldDefault(presence); + } + + /** Keys for a struct whose names differ from the JSON's, or which must write a null rather than leave it out. */ + private codingKeys(properties: Property[]): string[] { + const lines = ["\tprivate enum CodingKeys: String, CodingKey {"]; + for (const property of properties) { + const name = identifier(property.name); + lines.push( + property.name === property.jsonName + ? `\t\tcase ${name}` + : `\t\tcase ${name} = ${swiftString(property.jsonName)}`, + ); + } + lines.push("\t}"); + if (!properties.some((property) => property.presence.kind === "requiredOrNull")) return lines; + // A required field that may be null must be sent as null, which the synthesized encoding leaves out. + lines.push("", "\tfunc encode(to encoder: any Encoder) throws {"); + lines.push("\t\tvar container = encoder.container(keyedBy: CodingKeys.self)"); + for (const property of properties) { + const name = identifier(property.name); + const method = property.presence.kind === "optional" ? "encodeIfPresent" : "encode"; + lines.push(`\t\ttry container.${method}(${name}, forKey: .${name})`); + } + lines.push("\t}"); + return lines; + } + + // MARK: Enums + + private stringEnum(stringEnum: StringEnum): string[] { + const cases = stringEnum.cases.map((entry) => ({ + value: entry.value, + name: identifier(entry.label), + })); + const unknownCase = identifier(stringEnum.unknownLabel); + return [ + ...docComment(stringEnum.description, ""), + `enum ${stringEnum.name}: RawRepresentable, Codable, Hashable, Sendable, ParameterValue {`, + ...cases.map((entry) => `\tcase ${entry.name}`), + "\t/// A value from a newer server than this app knows.", + `\tcase ${unknownCase}(String)`, + "", + "\t/// Every value this app knows.", + `\tstatic let known: [Self] = [${cases.map((entry) => `.${entry.name}`).join(", ")}]`, + "", + "\tinit(rawValue: String) {", + "\t\tswitch rawValue {", + ...cases.map((entry) => `\t\tcase ${swiftString(entry.value)}: self = .${entry.name}`), + `\t\tdefault: self = .${unknownCase}(rawValue)`, + "\t\t}", + "\t}", + "", + "\tvar rawValue: String {", + "\t\tswitch self {", + ...cases.map((entry) => `\t\tcase .${entry.name}: ${swiftString(entry.value)}`), + `\t\tcase let .${unknownCase}(value): value`, + "\t\t}", + "\t}", + "", + "\tinit(from decoder: any Decoder) throws {", + "\t\tself.init(rawValue: try decoder.singleValueContainer().decode(String.self))", + "\t}", + "", + "\tfunc encode(to encoder: any Encoder) throws {", + "\t\tvar container = encoder.singleValueContainer()", + "\t\ttry container.encode(rawValue)", + "\t}", + "}", + ]; + } + + // MARK: Unions + + private taggedUnion(union: TaggedUnion): string[] { + const cases = union.cases.map((entry) => ({ + name: identifier(entry.label), + type: this.typeOf(entry.type), + values: entry.tagValues, + })); + const unknownCase = identifier(union.unknownCase.label); + const key = swiftString(union.tag); + return [ + ...docComment(union.description, ""), + `enum ${union.name}: Codable, Hashable, Sendable {`, + ...cases.map((entry) => `\tcase ${entry.name}(${entry.type})`), + `\t/// A kind from a newer server than this app knows, by its \`${union.tag}\`.`, + `\tcase ${unknownCase}(String)`, + "", + "\tinit(from decoder: any Decoder) throws {", + `\t\tlet tag = try decoder.container(keyedBy: AnyCodingKey.self).decode(String.self, forKey: AnyCodingKey(${key}))`, + "\t\tswitch tag {", + ...cases.map( + (entry) => + `\t\tcase ${entry.values.map(swiftString).join(", ")}: self = .${entry.name}(try ${entry.type}(from: decoder))`, + ), + `\t\tdefault: self = .${unknownCase}(tag)`, + "\t\t}", + "\t}", + "", + "\tfunc encode(to encoder: any Encoder) throws {", + "\t\tswitch self {", + ...cases.map((entry) => `\t\tcase let .${entry.name}(value): try value.encode(to: encoder)`), + `\t\tcase let .${unknownCase}(tag):`, + `\t\t\tthrow EncodingError.invalidValue(tag, .init(codingPath: encoder.codingPath, debugDescription: "A kind this app doesn't know can't be sent."))`, + "\t\t}", + "\t}", + ...this.closed(union.cases.map((entry) => entry.type)), + ]; + } + + /** A union whose members share no tag: each case is tried in turn, in the order the model lists them. */ + private untaggedUnion(union: UntaggedUnion): string[] { + const cases = union.cases.map((entry) => ({ + name: identifier(entry.label), + type: entry.type ? this.typeOf(entry.type) : undefined, + literal: swiftString(entry.literal ?? ""), + })); + return [ + ...docComment(union.description, ""), + `enum ${union.name}: Codable, Hashable, Sendable {`, + ...cases.map((entry) => + entry.type ? `\tcase ${entry.name}(${entry.type})` : `\tcase ${entry.name}`, + ), + "", + "\tinit(from decoder: any Decoder) throws {", + ...cases.map((entry) => + entry.type + ? `\t\tif let value = try? ${entry.type}(from: decoder) { self = .${entry.name}(value); return }` + : `\t\tif (try? decoder.singleValueContainer().decode(String.self)) == ${entry.literal} { self = .${entry.name}; return }`, + ), + `\t\tthrow DecodingError.dataCorrupted(.init(codingPath: decoder.codingPath, debugDescription: "None of ${union.name}'s kinds."))`, + "\t}", + "", + "\tfunc encode(to encoder: any Encoder) throws {", + "\t\tswitch self {", + ...cases.flatMap((entry) => + entry.type + ? [`\t\tcase let .${entry.name}(value): try value.encode(to: encoder)`] + : [ + `\t\tcase .${entry.name}:`, + "\t\t\tvar container = encoder.singleValueContainer()", + `\t\t\ttry container.encode(${entry.literal})`, + ], + ), + "\t\t}", + "\t}", + ...this.closed(union.cases.flatMap((entry) => (entry.type ? [entry.type] : []))), + ]; + } + + // MARK: Requests + + requests(groups: OperationGroup[]): string[] { + return groups.flatMap((group) => { + const nested = group.operations.flatMap((operation) => + operationTypes(operation).flatMap((type) => this.nestedIn(type)), + ); + if (!group.name) { + const methods = group.operations.flatMap((operation) => this.request(operation, "")); + return ["", "extension APIClient {", ...methods, ...indented(spaced(nested)), "}"]; + } + const typeName = routesClassName(group.name); + const methods = group.operations.flatMap((operation) => this.request(operation, "client.")); + return [ + "", + "extension APIClient {", + `\tvar ${camelCase(group.name)}: ${typeName} { ${typeName}(client: self) }`, + "", + `\t/// The \`${group.name}\` routes, as \`api.${group.name}\` in the web's client.`, + `\tstruct ${typeName}: Sendable {`, + "\t\tlet client: APIClient", + ...indented(methods), + ...indented(spaced(nested), 2), + "\t}", + "}", + ]; + }); + } + + /** A route's method, which sends through `receiver`: `client.`, or `` within `APIClient`. */ + private request(operation: Operation, receiver: string): string[] { + const parameters: string[] = []; + for (const parameter of operation.pathParameters) { + parameters.push(`${identifier(parameter.argumentName)}: ${this.typeOf(parameter.type)}`); + } + const query: string[] = []; + for (const parameter of operation.query) { + const name = identifier(parameter.argumentName); + const base = this.typeOf(parameter.type); + parameters.push(parameter.optional ? `${name}: ${base}? = nil` : `${name}: ${base}`); + query.push(`\t\tquery.add(${swiftString(parameter.name)}, ${name})`); + } + + const body = this.requestBody(operation); + parameters.push(...body.parameters); + + const returns = + operation.response.kind === "json" + ? this.typeOf(operation.response.type) + : operation.response.kind === "binary" + ? "Data" + : undefined; + const swiftPath = operation.path + .replace(/^\//, "") + .replace(/\{([^}]+)\}/g, (_, name: string) => { + const parameter = operation.pathParameters.find((candidate) => candidate.name === name); + if (!parameter) + throw new Error(`${operation.path} names {${name}}, which isn't one of its parameters.`); + return `\\(pathSegment(${identifier(parameter.argumentName)}))`; + }); + + const lines = [ + "", + ...docComment(operation.description, "\t"), + `\tfunc ${identifier(camelCase(operation.name))}(${parameters.join(", ")}) async throws${returns ? ` -> ${returns}` : ""} {`, + ]; + const queryArgument = query.length > 0 ? "query.items" : "[]"; + if (query.length > 0) lines.push("\t\tvar query = QueryItems()", ...query); + const callArguments = `${swiftString(operation.method)}, "${swiftPath}", query: ${queryArgument}${body.argument}`; + if (returns === "Data") + lines.push(`\t\treturn try await ${receiver}callForData(${callArguments})`); + else if (returns) lines.push(`\t\treturn try await ${receiver}call(${callArguments})`); + else lines.push(`\t\t_ = try await ${receiver}callForData(${callArguments})`); + lines.push("\t}"); + return lines; + } + + /** How a request's body is taken: the fields the model gives as arguments, so a call reads `update(podId:name:)`, or whole. */ + private requestBody(operation: Operation): { parameters: string[]; argument: string } { + if (operation.body.kind === "binary") { + return { parameters: ["data: Data"], argument: ", data: data" }; + } + if (operation.body.kind === "none") return { parameters: [], argument: "" }; + const type = this.typeOf(operation.body.type); + const fields = operation.body.fields; + if (!fields) return { parameters: [`body: ${type}`], argument: ", body: body" }; + // The body's own nested types, named from outside it. + return { + parameters: fields.map( + (field) => + `${identifier(field.name)}: ${fieldType(field.presence, this.typeOf(field.type, `${type}.`))}${fieldDefault(field.presence)}`, + ), + argument: `, body: ${type}(${fields.map((field) => `${field.name}: ${identifier(field.name)}`).join(", ")})`, + }; + } +} + +/** `Sugabots/API/API.generated.swift`'s contents. */ +export function swiftApi(model: ApiModel): string { + const writer = new SwiftWriter(); + return [ + "// Generated by apps/codegen/generate-api.ts from packages/contracts/openapi.json. Don't edit it by hand.", + "// swiftlint:disable all", + "", + "import Foundation", + "", + "// MARK: Schemas", + ...spaced(model.components.map((component) => writer.definition(component.definition))), + "", + "// MARK: Requests", + ...writer.requests(model.groups), + "", + ].join("\n"); +} diff --git a/apps/codegen/generate-api.ts b/apps/codegen/generate-api.ts index 69d2b3ac8..290dce3f4 100644 --- a/apps/codegen/generate-api.ts +++ b/apps/codegen/generate-api.ts @@ -3,6 +3,7 @@ * for each schema the API names, and a typed request for each route, grouped as * the web's client groups them. * + * - iOS: `Sugabots/API/API.generated.swift`, written by `api/swift.ts`. * - Android: `api/src/main/kotlin/ai/sugabots/api/Api.generated.kt`, written by * `api/kotlin.ts`. * @@ -13,13 +14,16 @@ import document from "../../packages/contracts/openapi.json" with { type: "json" }; import { kotlinApi } from "./api/kotlin.ts"; import { type OpenApiDocument, readModel } from "./api/model.ts"; +import { swiftApi } from "./api/swift.ts"; import type { Generator } from "./generated-files.ts"; export const generator: Generator = { - targets: ["android"], + targets: ["ios", "android"], generate(target) { const model = readModel(document as unknown as OpenApiDocument); switch (target) { + case "ios": + return { files: new Map([["Sugabots/API/API.generated.swift", swiftApi(model)]]) }; case "android": return { files: new Map([ diff --git a/apps/codegen/generate-artifact-pages.ts b/apps/codegen/generate-artifact-pages.ts new file mode 100644 index 000000000..079ca97e3 --- /dev/null +++ b/apps/codegen/generate-artifact-pages.ts @@ -0,0 +1,154 @@ +/** + * Writes `Sugabots/Artifacts/ArtifactPages.generated.swift` from how the web + * frames a bot-made page: the content policy and the theme's stylesheet in + * `@sugabots/contracts/artifact-pages`, the height report, the frame's height + * limits, and the tokens the page is given, with the values + * `packages/web/src/app.css` gives each colour in light and dark and each font; + * and from `packages/web/src/lib/artifact-kind-catalog.ts`, what each kind of + * artifact is called and what Download saves it as. + */ +import { readFileSync } from "node:fs"; +import { + PAGE_CONTENT_POLICY, + pageHeightObserver, + pageThemeCss, +} from "../../packages/contracts/src/artifact-pages.ts"; +import { + ARTIFACT_KIND_FILES, + ARTIFACT_KIND_LABELS, +} from "../../packages/web/src/lib/artifact-kind-catalog.ts"; +import { FIT_HEIGHT_PX, FRAME_TOKENS } from "../../packages/web/src/lib/page-frame.ts"; +import { colourTokens, type Rgba } from "./generate-palette.ts"; +import type { GeneratedFiles } from "./generated-files.ts"; + +/** The script message handler a page in the app's web view reports its height to. */ +const HEIGHT_MESSAGE_HANDLER = "pageHeight"; + +/** Placeholders for the stylesheet's two values, swapped for Swift's interpolations. */ +const COLOR_SCHEME_SLOT = "@@colorScheme@@"; +const TOKENS_SLOT = "@@tokens@@"; + +const stylesheet = new URL("../../packages/web/src/app.css", import.meta.url); + +/** The artifact kind an app shows a kind it doesn't know as. */ +const KIND_FOR_UNKNOWN = "document"; + +/** + * Each of `FRAME_TOKENS` with its value in light and dark: a colour as + * `app.css` resolves it on `:root`, or a font as `app.css` declares it, the + * same in both. + */ +function frameTokens(): { name: string; light: string; dark: string }[] { + const colours = colourTokens(); + const css = readFileSync(stylesheet, "utf8"); + return FRAME_TOKENS.map((token) => { + const colour = colours.get(token.slice("--".length)); + if (colour) + return { name: token, light: cssColour(colour.light), dark: cssColour(colour.dark) }; + const font = token.startsWith("--font-") && declaredValue(css, token); + if (font) return { name: token, light: font, dark: font }; + throw new Error(`${token} is neither a colour on :root nor a font app.css declares`); + }); +} + +/** The value of the first declaration of `property` in `css`, if it has one. */ +function declaredValue(css: string, property: string): string | undefined { + return css.match(new RegExp(`${property}:\\s*([^;]+);`))?.[1]?.trim(); +} + +const byte = (channel: number) => Math.round(channel * 255); + +function cssColour({ red, green, blue, alpha }: Rgba): string { + if (alpha !== 1) return `rgba(${byte(red)}, ${byte(green)}, ${byte(blue)}, ${alpha})`; + return `#${[red, green, blue].map((channel) => byte(channel).toString(16).padStart(2, "0")).join("")}`; +} + +/** Everything the generated file holds, as data, for each app's copy to be written from. */ +export function pageFrame() { + return { + contentPolicy: PAGE_CONTENT_POLICY, + heightMessageHandler: HEIGHT_MESSAGE_HANDLER, + heightReport: pageHeightObserver( + (height) => `window.webkit.messageHandlers.${HEIGHT_MESSAGE_HANDLER}.postMessage(${height})`, + ), + fitHeight: FIT_HEIGHT_PX, + tokens: frameTokens(), + themeCss: pageThemeCss({ colorScheme: COLOR_SCHEME_SLOT, tokens: TOKENS_SLOT }), + kinds: Object.keys(ARTIFACT_KIND_LABELS).map((kind) => ({ + kind, + label: ARTIFACT_KIND_LABELS[kind as keyof typeof ARTIFACT_KIND_LABELS], + fileExtension: ARTIFACT_KIND_FILES[kind as keyof typeof ARTIFACT_KIND_FILES].extension, + })), + }; +} + +const string = (text: string) => JSON.stringify(text); + +/** + * A Swift `switch self` over `ArtifactKind` returning `caseValue` of each kind's + * entry, and for a kind the app doesn't know, `KIND_FOR_UNKNOWN`'s. + */ +function switchOverKinds( + kinds: ReturnType["kinds"], + caseValue: (entry: ReturnType["kinds"][number]) => string, +): string { + const cases = kinds.map( + (entry) => + `\t\tcase .${entry.kind}${entry.kind === KIND_FOR_UNKNOWN ? ", .unknown" : ""}: ${caseValue(entry)}`, + ); + return `switch self {\n${cases.join("\n")}\n\t\t}`; +} + +export function swift(frame: ReturnType): string { + const themeCss = string(frame.themeCss) + .replace(COLOR_SCHEME_SLOT, "\\(colorScheme)") + .replace(TOKENS_SLOT, "\\(tokens)"); + return `// Generated by apps/codegen/generate-artifact-pages.ts from @sugabots/contracts, packages/web/src/lib/page-frame.ts and packages/web/src/app.css. Do not edit. +import CoreGraphics + +/// How a bot-made page is framed, as the web frames it. +enum PageFrame { + /// \`PAGE_CONTENT_POLICY\`: inline code and styles, scripts from one CDN, and data the page embeds. + static let contentPolicy = ${string(frame.contentPolicy)} + + /// The script message handler \`heightReport\` posts the page's height to. + static let heightMessageHandler = ${string(frame.heightMessageHandler)} + + /// Reports the page's height whenever it changes, as \`PAGE_HEIGHT_REPORT\` does to a parent frame. + static let heightReport = ${string(frame.heightReport)} + + /// \`FIT_HEIGHT_PX\`: how tall a frame fitted to its page may be before it is clipped. + static let fitHeight = (min: CGFloat(${frame.fitHeight.min}), max: CGFloat(${frame.fitHeight.max})) + + /// \`FRAME_TOKENS\`, with the values \`app.css\` gives each in light and dark. + static let tokens: [(name: String, light: String, dark: String)] = [ +${frame.tokens.map(({ name, light, dark }) => `\t\t(${string(name)}, ${string(light)}, ${string(dark)}),`).join("\n")} + ] + + /// \`pageThemeCss\`: the stylesheet a page gets its theme from, on a transparent ground. + static func themeCss(colorScheme: String, tokens: String) -> String { + ${themeCss} + } +} + +/// What each kind of artifact is called and saved as, as \`ARTIFACT_KIND_LABELS\` +/// and \`ARTIFACT_KIND_FILES\`; a kind this app doesn't know is shown as a ${KIND_FOR_UNKNOWN}. +extension ArtifactKind { + /// What it is called beside its title. + var label: String { + ${switchOverKinds(frame.kinds, (entry) => string(entry.label))} + } + + /// What Download ends its file with. + var fileExtension: String { + ${switchOverKinds(frame.kinds, (entry) => string(entry.fileExtension))} + } +} +`; +} + +export function generate(): GeneratedFiles { + return { + files: new Map([["Sugabots/Artifacts/ArtifactPages.generated.swift", swift(pageFrame())]]), + }; +} diff --git a/apps/codegen/generate-bot-looks.ts b/apps/codegen/generate-bot-looks.ts new file mode 100644 index 000000000..adf4ad43f --- /dev/null +++ b/apps/codegen/generate-bot-looks.ts @@ -0,0 +1,137 @@ +/** + * Writes `Sugabots/Design/BotLooks.generated.swift` from `@sugabots/avatars` + * and the web app's pod palette, so the app draws bots and pods from the same + * geometry and colours as the web. + */ +import { botColors } from "../../packages/avatars/src/bot-colors.ts"; +import { type FaceMark, faceMarks } from "../../packages/avatars/src/face-marks.ts"; +import { headShape } from "../../packages/avatars/src/head-shapes.ts"; +import { agentColors, agentFaces, agentShapes } from "../../packages/contracts/src/agents.ts"; +import { podColors } from "../../packages/contracts/src/pods.ts"; +import type { GeneratedFiles } from "./generated-files.ts"; + +/** The hue of each pod colour, as `podPalettes` in the web app's `PodTile` gives it. */ +const podHues: Record<(typeof podColors)[number], number> = { + green: 148, + blue: 255, + plum: 340, + amber: 78, + teal: 192, + purple: 298, + rose: 18, + orange: 50, +}; + +/** What the app draws a colour, head or pair of eyes newer than it knows as. */ +const FALLBACK_COLOR: (typeof agentColors)[number] = "green"; +const FALLBACK_SHAPE: (typeof agentShapes)[number] = "circle"; +const FALLBACK_FACE: (typeof agentFaces)[number] = "dot"; + +const swiftString = (value: string) => JSON.stringify(value); + +/** A snake_case value as the camelCase name of its Swift case, as the API's generated enums name them. */ +const swiftCase = (value: string) => + value.replace(/_([a-z0-9])/g, (_, letter: string) => letter.toUpperCase()); +const hex = (value: string) => `Color(hex: ${swiftString(value)})`; +const themed = ({ light, dark }: { light: string; dark: string }) => + `ThemedColor(light: ${hex(light)}, dark: ${hex(dark)})`; + +function headLiteral(shape: (typeof agentShapes)[number]): string { + const head = headShape(shape); + const parts = head.parts.map((part) => + part.kind === "circle" + ? `.circle(cx: ${part.cx}, cy: ${part.cy}, r: ${part.r})` + : `.path(${swiftString(part.d)})`, + ); + const { x, y, scale } = head.eyes; + return `HeadShape(parts: [${parts.join(", ")}], eyes: EyePlacement(x: ${x}, y: ${y}, scale: ${scale}))`; +} + +function marksLiteral(face: (typeof agentFaces)[number]): string { + return `[${faceMarks(face).map(markLiteral).join(", ")}]`; +} + +function markLiteral(mark: FaceMark): string { + switch (mark.shape) { + case "circle": + return `.circle(cx: ${mark.cx}, cy: ${mark.cy}, r: ${mark.r})`; + case "rect": + return `.rect(x: ${mark.x}, y: ${mark.y}, width: ${mark.width}, height: ${mark.height}, rx: ${mark.rx})`; + case "stroke": + return `.stroke(${swiftString(mark.d)}, width: ${mark.strokeWidth})`; + } +} + +/** An `oklch()` colour as sRGB hex, so Swift needs no colour space of its own for it. */ +function oklchHex(lightness: number, chroma: number, hue: number): string { + const radians = (hue * Math.PI) / 180; + const a = chroma * Math.cos(radians); + const b = chroma * Math.sin(radians); + const l = (lightness + 0.3963377774 * a + 0.2158037573 * b) ** 3; + const m = (lightness - 0.1055613458 * a - 0.0638541728 * b) ** 3; + const s = (lightness - 0.0894841775 * a - 1.291485548 * b) ** 3; + const linear = [ + 4.0767416621 * l - 3.3077115913 * m + 0.2309699292 * s, + -1.2684380046 * l + 2.6097574011 * m - 0.3413193965 * s, + -0.0041960863 * l - 0.7034186147 * m + 1.707614701 * s, + ]; + return `#${linear + .map((channel) => { + const clamped = Math.min(1, Math.max(0, channel)); + const encoded = clamped <= 0.0031308 ? 12.92 * clamped : 1.055 * clamped ** (1 / 2.4) - 0.055; + return Math.round(encoded * 255) + .toString(16) + .padStart(2, "0"); + }) + .join("")}`; +} + +export function generate(): GeneratedFiles { + const lines = [ + "// Generated by apps/codegen/generate-bot-looks.ts from @sugabots/avatars. Do not edit.", + "", + "import SwiftUI", + "", + "enum BotLooks {", + `\t/// How \`color\` is drawn; a colour this app doesn't know is drawn ${FALLBACK_COLOR}.`, + "\tstatic func palette(for color: AgentColor) -> BotPalette {", + `\t\tpalettes[color] ?? palettes[.${swiftCase(FALLBACK_COLOR)}]!`, + "\t}", + "", + `\t/// The head \`shape\` names; a shape this app doesn't know is a ${FALLBACK_SHAPE}.`, + "\tstatic func head(for shape: AgentShape) -> HeadShape {", + `\t\theads[shape] ?? heads[.${swiftCase(FALLBACK_SHAPE)}]!`, + "\t}", + "", + `\t/// The marks of the eyes \`face\` names; eyes this app doesn't know are ${FALLBACK_FACE}s.`, + "\tstatic func faces(for face: AgentFace) -> [FaceMark] {", + `\t\tfaces[face] ?? faces[.${swiftCase(FALLBACK_FACE)}]!`, + "\t}", + "", + "\tprivate static let palettes: [AgentColor: BotPalette] = [", + ...agentColors.map((color) => { + const palette = botColors[color]; + return `\t\t.${swiftCase(color)}: BotPalette(face: ${hex(palette.face)}, eyes: ${hex(palette.eyes)}, tint: ${themed(palette.tint)}, text: ${themed(palette.text)}, mono: ${themed(palette.mono)}),`; + }), + "\t]", + "", + "\tprivate static let heads: [AgentShape: HeadShape] = [", + ...agentShapes.map((shape) => `\t\t.${swiftCase(shape)}: ${headLiteral(shape)},`), + "\t]", + "", + "\tprivate static let faces: [AgentFace: [FaceMark]] = [", + ...agentFaces.map((face) => `\t\t.${swiftCase(face)}: ${marksLiteral(face)},`), + "\t]", + "", + "\t/// Each pod colour's tile tint and swatch, as `podPalettes` in the web app's `PodTile` draws them.", + "\tstatic let pods: [String: PodPalette] = [", + ...podColors.map((color) => { + const hue = podHues[color]; + return `\t\t${swiftString(color)}: PodPalette(tile: ThemedColor(light: ${hex(oklchHex(0.9, 0.05, hue))}, dark: ${hex(oklchHex(0.33, 0.07, hue))}), swatch: ${hex(oklchHex(0.7, 0.16, hue))}),`; + }), + "\t]", + "}", + "", + ]; + return { files: new Map([["Sugabots/Design/BotLooks.generated.swift", lines.join("\n")]]) }; +} diff --git a/apps/codegen/generate-built-in-tools.ts b/apps/codegen/generate-built-in-tools.ts new file mode 100644 index 000000000..41dea5256 --- /dev/null +++ b/apps/codegen/generate-built-in-tools.ts @@ -0,0 +1,45 @@ +/** + * Writes `Sugabots/Conversation/BuiltInTools.generated.swift` from the + * product's own tools in `@sugabots/contracts`, so a step names a built-in + * tool as the web does, and a bot's settings list them as the web's do. + */ +import { + type BuiltInToolEntry, + builtInToolCatalog, +} from "../../packages/contracts/src/built-in-tools.ts"; +import type { GeneratedFiles } from "./generated-files.ts"; + +export function swift(catalog: readonly BuiltInToolEntry[]): string { + const string = JSON.stringify; + return `// Generated by apps/codegen/generate-built-in-tools.ts from @sugabots/contracts. Do not edit. + +extension ToolNames { + /// The product's own tools' names, by key, as \`builtInToolCatalog\` names them. + static let builtIn: [String: String] = [ +${catalog.map((tool) => `\t\t${string(tool.key)}: ${string(tool.name)},`).join("\n")} + ] +} + +/// One of the bot's own tools, as \`builtInToolCatalog\` lists them. +struct BuiltInTool { + let key: String + let name: String + /// What the tool does, in one plain sentence. + let description: String + /// Whether it reaches the web, so works only while the workspace allows that. + let usesWeb: Bool + + static let catalog = [ +${catalog.map((tool) => `\t\tBuiltInTool(key: ${string(tool.key)}, name: ${string(tool.name)}, description: ${string(tool.description)}, usesWeb: ${tool.usesWeb}),`).join("\n")} + ] +} +`; +} + +export function generate(): GeneratedFiles { + return { + files: new Map([ + ["Sugabots/Conversation/BuiltInTools.generated.swift", swift(builtInToolCatalog)], + ]), + }; +} diff --git a/apps/codegen/generate-catalogs.ts b/apps/codegen/generate-catalogs.ts new file mode 100644 index 000000000..a838c3abd --- /dev/null +++ b/apps/codegen/generate-catalogs.ts @@ -0,0 +1,271 @@ +/** + * Writes `Sugabots/API/Catalogs.generated.swift` (and the mute lengths in + * `Sugabots/Home/Mutes.generated.swift`) from the catalogs and words + * the web's settings and routine pages show, so the app lists and names them + * as the web does: the search and computer providers, who makes a model, + * notification levels and how long a mute lasts, workspace roles, a tool's + * access, a webhook's senders and checks, a repository's events, and the + * hues of the usage breakdown. + * + * They come from `@sugabots/contracts` and from the web's plain data modules + * in `packages/web/src/lib`, which import nothing but types. + */ +import { REPOSITORY_EVENTS } from "../../packages/contracts/src/github.ts"; +import { WEBHOOK_SECRET_PREFIXES } from "../../packages/contracts/src/routines.ts"; +import { + SANDBOX_E2B_DEFAULT_SIZE, + sandboxProviderCatalog, +} from "../../packages/contracts/src/sandbox-providers.ts"; +import { + DEFAULT_SEARCH_PRESET, + searchProviderCatalog, +} from "../../packages/contracts/src/search-providers.ts"; +import { + WORKSPACE_ROLES, + workspaceRoleDescription, + workspaceRoleLabel, +} from "../../packages/contracts/src/workspaces.ts"; +import { MODEL_MAKER_NAMES } from "../../packages/web/src/lib/model-makers.ts"; +import { + MUTE_LENGTHS, + NOTIFICATION_LEVEL_LABELS, + NOTIFICATION_LEVEL_NOTES, +} from "../../packages/web/src/lib/notification-choices.ts"; +import { PROVIDER_HUES } from "../../packages/web/src/lib/provider-hues.ts"; +import { + REPOSITORY_EVENT_LABELS, + WEBHOOK_ALGORITHM_OPTIONS, + WEBHOOK_AUTH_OPTIONS, + WEBHOOK_ENCODING_OPTIONS, + WEBHOOK_SECRET_LABELS, + WEBHOOK_SOURCE_LABELS, + WEBHOOK_SOURCE_SECRET_PLACEHOLDERS, +} from "../../packages/web/src/lib/routine-trigger-words.ts"; +import { TOOL_ACCESS_LABELS } from "../../packages/web/src/lib/tool-access-labels.ts"; +import { camelCase } from "./api/naming.ts"; +import type { GeneratedFiles } from "./generated-files.ts"; + +/** Everything the generated file holds, as data, for each app's copy to be written from. */ +export const catalogs = { + searchProviders: searchProviderCatalog, + defaultSearchProvider: DEFAULT_SEARCH_PRESET, + sandboxProviders: sandboxProviderCatalog, + sandboxDefaultSize: SANDBOX_E2B_DEFAULT_SIZE, + modelMakerNames: MODEL_MAKER_NAMES, + notificationLevelLabels: NOTIFICATION_LEVEL_LABELS, + notificationLevelNotes: NOTIFICATION_LEVEL_NOTES, + muteLengths: MUTE_LENGTHS, + workspaceRoleLabels: Object.fromEntries( + WORKSPACE_ROLES.map((role) => [role, workspaceRoleLabel(role)]), + ), + workspaceRoleDescriptions: Object.fromEntries( + WORKSPACE_ROLES.map((role) => [role, workspaceRoleDescription(role)]), + ), + toolAccessLabels: TOOL_ACCESS_LABELS, + webhookSourceLabels: WEBHOOK_SOURCE_LABELS, + webhookSourceOptions: Object.entries(WEBHOOK_SOURCE_LABELS).map(([value, label]) => ({ + value, + label, + })), + webhookSourceSecretPlaceholders: WEBHOOK_SOURCE_SECRET_PLACEHOLDERS, + webhookSecretPrefixes: WEBHOOK_SECRET_PREFIXES, + webhookAuthOptions: WEBHOOK_AUTH_OPTIONS, + webhookAlgorithmOptions: WEBHOOK_ALGORITHM_OPTIONS, + webhookEncodingOptions: WEBHOOK_ENCODING_OPTIONS, + webhookSecretLabels: WEBHOOK_SECRET_LABELS, + repositoryEvents: REPOSITORY_EVENTS.map((value) => ({ + value, + label: REPOSITORY_EVENT_LABELS[value], + })), + providerHues: PROVIDER_HUES, +}; + +const string = (text: string) => JSON.stringify(text); + +/** A record as a Swift dictionary literal, an entry a line, indented by `depth` tabs. */ +function dictionary(record: Readonly>, depth: number): string { + const indent = "\t".repeat(depth); + const entries = Object.entries(record).map( + ([key, value]) => `${indent}\t${string(key)}: ${string(value)},`, + ); + return `[\n${entries.join("\n")}\n${indent}]`; +} + +/** + * A Swift computed property of `type` called `name`, switching over each case + * of an enum the API generator makes, with `record`'s entry for each case's raw + * value. A value the API adds is a new case, which fails to compile here until + * `record` has an entry for it. A value from a newer server, the enum's + * `unknown` case, takes `unknownValue`, a Swift expression in which + * `rawValue` is that value. + */ +function switchProperty( + name: string, + type: string, + record: Readonly>, + unknownValue: string, +): string { + const values = Object.keys(record); + // As the API generator names the case that holds a value it doesn't know. + const unknownCase = values.some((value) => camelCase(value) === "unknown") + ? "unrecognized" + : "unknown"; + const cases = Object.entries(record).map( + ([value, text]) => `\t\tcase .${camelCase(value)}: ${string(text)}`, + ); + return [ + `\tvar ${name}: ${type} {`, + "\t\tswitch self {", + ...cases, + `\t\tcase .${unknownCase}: ${unknownValue}`, + "\t\t}", + "\t}", + ].join("\n"); +} + +/** Choices as a Swift array of `(value:label:)` tuples. */ +function options(choices: readonly { value: string; label: string }[]): string { + const entries = choices.map(({ value, label }) => `(${string(value)}, ${string(label)})`); + return `[${entries.join(", ")}]`; +} + +function muteDuration({ label, length }: (typeof MUTE_LENGTHS)[number]): string { + const swiftLength = + "minutes" in length + ? `.minutes(${length.minutes})` + : `.tomorrow(atHour: ${length.tomorrowAtHour})`; + return `\t\tMuteDuration(label: ${string(label)}, length: ${swiftLength}),`; +} + +export function swift(data: typeof catalogs): string { + return `// Generated by apps/codegen/generate-catalogs.ts from @sugabots/contracts and packages/web/src/lib. Do not edit. +import Foundation + +/// A search provider in the catalog, as \`searchProviderCatalog\`. +struct SearchPreset { + let id: String + let name: String + let baseUrl: String + /// A server you run, rather than one with a fixed address. + let local: Bool + let requiresApiKey: Bool + /// What it is good for, in the line under its name. + let description: String + + static let catalog = [ +${data.searchProviders.map((preset) => `\t\tSearchPreset(id: ${string(preset.id)}, name: ${string(preset.name)}, baseUrl: ${string(preset.baseUrl)}, local: ${preset.hosting === "local"}, requiresApiKey: ${preset.requiresApiKey}, description: ${string(preset.description)}),`).join("\n")} + ] + + /// \`DEFAULT_SEARCH_PRESET\`: the provider a workspace has until it chooses another. + static let defaultId = ${string(data.defaultSearchProvider)} +} + +/// A computer provider in the catalog, as \`sandboxProviderCatalog\`. +struct SandboxPreset { + let id: String + let name: String + /// The address a local preset is usually at; nil for one with its own. + let baseUrl: String? + /// What computers are made from: an image, or a template. + let imageLabel: String + let defaultImage: String + /// What it is good for, in the line under its name. + let description: String + + static let catalog = [ +${data.sandboxProviders.map((preset) => `\t\tSandboxPreset(id: ${string(preset.id)}, name: ${string(preset.name)}, baseUrl: ${preset.baseUrl === undefined ? "nil" : string(preset.baseUrl)}, imageLabel: ${string(preset.imageLabel)}, defaultImage: ${string(preset.defaultImage)}, description: ${string(preset.description)}),`).join("\n")} + ] + + /// \`SANDBOX_E2B_DEFAULT_SIZE\`. + static let defaultSize = (cpuCount: ${data.sandboxDefaultSize.cpuCount}, memoryGiB: ${data.sandboxDefaultSize.memoryGiB}) +} + +extension ProviderModel { + /// Who makes a model, by the name before its slash, as \`MODEL_MAKER_NAMES\`. + static let makerNames: [String: String] = ${dictionary(data.modelMakerNames, 1)} +} + +extension NotificationLevel { + /// What the level is called where a person chooses one, as \`NOTIFICATION_LEVEL_LABELS\`. +${switchProperty("label", "String", data.notificationLevelLabels, string("Something else"))} + + /// What the level notifies about, as \`NOTIFICATION_LEVEL_NOTES\`; nil for a level this app doesn't know. +${switchProperty("note", "String?", data.notificationLevelNotes, "nil")} +} + +extension WorkspaceRole { + /// What the role is called, as \`workspaceRoleLabel\`. +${switchProperty("label", "String", data.workspaceRoleLabels, "rawValue.capitalized")} + + /// What the role may do, as \`workspaceRoleDescription\`. +${switchProperty("description", "String", data.workspaceRoleDescriptions, string(""))} +} + +extension ConnectionAccess { + /// The setting in words, as \`TOOL_ACCESS_LABELS\`. +${switchProperty("words", "String", data.toolAccessLabels, "rawValue")} +} + +extension WebhookAuthChoice { + /// Any sender, then each source that signs its own way, as \`WEBHOOK_SOURCE_LABELS\`. + static let sourceOptions: [(value: String, label: String)] = ${options(data.webhookSourceOptions)} + + /// What each of \`sourceOptions\` is called, by its value. + static let sourceLabels: [String: String] = ${dictionary(data.webhookSourceLabels, 1)} + + /// How each source's signing secret looks, as \`WEBHOOK_SOURCE_SECRET_PLACEHOLDERS\`. + static let sourceSecretPlaceholders: [String: String] = ${dictionary(data.webhookSourceSecretPlaceholders, 1)} + + /// How the secrets of each kind start, or "" for any, as \`WEBHOOK_SECRET_PREFIXES\`. + static let secretPrefixes: [String: String] = ${dictionary(data.webhookSecretPrefixes, 1)} + + /// \`WEBHOOK_AUTH_OPTIONS\`. + static let authOptions: [(value: String, label: String)] = ${options(data.webhookAuthOptions)} + /// \`WEBHOOK_ALGORITHM_OPTIONS\`. + static let algorithmOptions: [(value: String, label: String)] = ${options(data.webhookAlgorithmOptions)} + /// \`WEBHOOK_ENCODING_OPTIONS\`. + static let encodingOptions: [(value: String, label: String)] = ${options(data.webhookEncodingOptions)} + + /// What each generic kind calls its secret, as \`WEBHOOK_SECRET_LABELS\`. + static let secretLabels: [String: String] = ${dictionary(data.webhookSecretLabels, 1)} +} + +extension RepositoryDraft { + /// Each event in the order the switches list them, as \`REPOSITORY_EVENTS\`, with what its switch says. + static let events: [(value: String, label: String)] = [ +${data.repositoryEvents.map(({ value, label }) => `\t\t(${string(value)}, ${string(label)}),`).join("\n")} + ] +} + +extension WorkspaceUsage { + /// The pod colours each provider's models take in turn on the breakdown, as \`PROVIDER_HUES\`. + static let providerHues = [${data.providerHues.map(string).join(", ")}] +} +`; +} + +/** + * The pauses and mutes offered, apart from the rest so the rule checks, which + * build Foundation-only files, can build it beside `Home/Mutes.swift`. + */ +export function mutesSwift(data: typeof catalogs): string { + return `// Generated by apps/codegen/generate-catalogs.ts from packages/web/src/lib. Do not edit. +import Foundation + +extension MuteDuration { + /// The pauses and mutes offered, as \`MUTE_LENGTHS\`. + static let all = [ +${data.muteLengths.map(muteDuration).join("\n")} + ] +} +`; +} + +export function generate(): GeneratedFiles { + return { + files: new Map([ + ["Sugabots/API/Catalogs.generated.swift", swift(catalogs)], + ["Sugabots/Home/Mutes.generated.swift", mutesSwift(catalogs)], + ]), + }; +} diff --git a/apps/codegen/generate-connection-marks.ts b/apps/codegen/generate-connection-marks.ts new file mode 100644 index 000000000..06decca2b --- /dev/null +++ b/apps/codegen/generate-connection-marks.ts @@ -0,0 +1,164 @@ +/** + * Writes `Sugabots/Design/ConnectionMarks.generated.swift` from the web app's + * `ui/connection-mark.tsx` and the connection catalog in `@sugabots/contracts`, + * so the app draws a connection's mark with the same glyph and tint as the + * web. + */ +import { readFileSync } from "node:fs"; +import { fileURLToPath } from "node:url"; +import { connectionCatalog } from "../../packages/contracts/src/connections.ts"; +import type { GeneratedFiles } from "./generated-files.ts"; + +const source = readFileSync( + fileURLToPath(new URL("../../packages/web/src/ui/connection-mark.tsx", import.meta.url)), + "utf8", +); + +/** The object literal assigned to `const name` in the web source. */ +function literal(name: string): T { + const start = source.indexOf(`const ${name}`); + const open = source.indexOf("= {", start) + 2; + const close = source.indexOf("\n};", open) + 2; + if (start < 0 || close < 2) throw new Error(`No ${name} in connection-mark.tsx`); + return Function(`return ${source.slice(open, close)}`)() as T; +} + +interface Glyph { + hex: string; + d: string; +} + +interface ColourPath { + d: string; + fill?: string; + stroke?: string; + strokeWidth?: number; + strokeLinecap?: string; +} + +interface ColourMark { + viewBox: string; + transform?: string; + hex?: string; + paths: ColourPath[]; +} + +const marks = literal>("marks"); +const colourMarks = literal>("colourMarks"); +const darkBrands = [ + ...(/const darkBrands = new Set\(\[([^\]]*)\]\)/.exec(source)?.[1] ?? "").matchAll(/"([^"]+)"/g), +].map((match) => match[1]); + +// `color-mix(in oklab, 14%, var(--panel))`, worked out for each theme's panel. +const PANEL = { light: "#ffffff", dark: "#111113" }; +const BRAND_SHARE = 0.14; + +const toLinear = (c: number) => (c <= 0.04045 ? c / 12.92 : ((c + 0.055) / 1.055) ** 2.4); +const fromLinear = (c: number) => (c <= 0.0031308 ? 12.92 * c : 1.055 * c ** (1 / 2.4) - 0.055); + +function oklab(hex: string): [number, number, number] { + const [r, g, b] = [1, 3, 5].map((i) => toLinear(Number.parseInt(hex.slice(i, i + 2), 16) / 255)); + const l = Math.cbrt(0.4122214708 * r + 0.5363325363 * g + 0.0514459929 * b); + const m = Math.cbrt(0.2119034982 * r + 0.6806995451 * g + 0.1073969566 * b); + const s = Math.cbrt(0.0883024619 * r + 0.2817188376 * g + 0.6299787005 * b); + return [ + 0.2104542553 * l + 0.793617785 * m - 0.0040720468 * s, + 1.9779984951 * l - 2.428592205 * m + 0.4505937099 * s, + 0.0259040371 * l + 0.7827717662 * m - 0.808675766 * s, + ]; +} + +function hexOf([L, a, b]: [number, number, number]): string { + const l = (L + 0.3963377774 * a + 0.2158037573 * b) ** 3; + const m = (L - 0.1055613458 * a - 0.0638541728 * b) ** 3; + const s = (L - 0.0894841775 * a - 1.291485548 * b) ** 3; + const rgb = [ + 4.0767416621 * l - 3.3077115913 * m + 0.2309699292 * s, + -1.2684380046 * l + 2.6097574011 * m - 0.3413193965 * s, + -0.0041960863 * l - 0.7034186147 * m + 1.707614701 * s, + ]; + return `#${rgb + .map((c) => + Math.round(Math.min(1, Math.max(0, fromLinear(c))) * 255) + .toString(16) + .padStart(2, "0"), + ) + .join("")}`; +} + +function tint(brand: string, panel: string): string { + const [x, y] = [oklab(brand), oklab(panel)]; + return hexOf( + [0, 1, 2].map((i) => x[i] * BRAND_SHARE + y[i] * (1 - BRAND_SHARE)) as [number, number, number], + ); +} + +const swiftString = (text: string) => JSON.stringify(text); + +/** A path's paint: a literal colour, or the theme token a `var(--…)` names. */ +function paint(value: string | undefined): string { + if (value === undefined || value === "none") return "nil"; + const token = /^var\(--([a-z-]+)\)$/.exec(value)?.[1]; + if (token) return `.token(.${token.replace(/-([a-z])/g, (_, c: string) => c.toUpperCase())})`; + return `.hex(${swiftString(value)})`; +} + +function themedTint(hex: string): string { + return `ThemedColor(light: Color(hex: ${swiftString(tint(hex, PANEL.light))}), dark: Color(hex: ${swiftString(tint(hex, PANEL.dark))}))`; +} + +export function generate(): GeneratedFiles { + const swift = `// Generated by apps/codegen/generate-connection-marks.ts from the web app's +// ui/connection-mark.tsx and @sugabots/contracts. Do not edit. +import SwiftUI + +extension ConnectionMark { + /// One-colour glyphs on a 24-point square, with the tint behind them. + static let glyphs: [String: Glyph] = [ +${Object.entries(marks) + .map( + ([id, { hex, d }]) => + `\t\t${swiftString(id)}: Glyph(color: Color(hex: ${swiftString(hex)}), tint: ${themedTint(hex)}, path: ${swiftString(d)}),`, + ) + .join("\n")} + ] + + /// Marks drawn in their own colours, on a tint of their brand or on the panel. + static let colourGlyphs: [String: ColourGlyph] = [ +${Object.entries(colourMarks) + .map(([id, mark]) => { + const box = mark.viewBox.split(/\s+/).map(Number); + const paths = mark.paths + .map( + (path) => + `ColourGlyph.Part(path: ${swiftString(path.d)}, fill: ${paint(path.fill)}, stroke: ${paint(path.stroke)}, strokeWidth: ${path.strokeWidth ?? 0}, roundCap: ${path.strokeLinecap === "round"})`, + ) + .join(", "); + return `\t\t${swiftString(id)}: ColourGlyph(size: ${box[2]}, tint: ${mark.hex ? themedTint(mark.hex) : "nil"}, parts: [${paths}]),`; + }) + .join("\n")} + ] + + /// Brands drawn in the foreground colour, being too dark to read on a dark panel. + static let darkBrands: Set = [${darkBrands.map(swiftString).join(", ")}] +} + +/// An app in the connection catalog, as \`connectionCatalog\` lists it. +struct ConnectionPreset: Hashable, Identifiable { + let id: String + let name: String + let description: String + let url: String + + static let catalog: [ConnectionPreset] = [ +${connectionCatalog + .map( + (preset) => + `\t\tConnectionPreset(id: ${swiftString(preset.id)}, name: ${swiftString(preset.name)}, description: ${swiftString(preset.description)}, url: ${swiftString(preset.url)}),`, + ) + .join("\n")} + ] +} +`; + return { files: new Map([["Sugabots/Design/ConnectionMarks.generated.swift", swift]]) }; +} diff --git a/apps/codegen/generate-emoji.ts b/apps/codegen/generate-emoji.ts new file mode 100644 index 000000000..41c03bb04 --- /dev/null +++ b/apps/codegen/generate-emoji.ts @@ -0,0 +1,27 @@ +/** + * Writes `Sugabots/Resources/Emoji.json` from `@sugabots/emoji`, the dataset + * the web's picker and shortcodes load, keeping only what the app reads: + * each emoji, its name, category, Emoji version, search tags, shortcodes and + * skin tones, and whether it is a country's flag. + */ +import dataset from "../../packages/emoji/src/emoji.json" with { type: "json" }; +import type { GeneratedFiles } from "./generated-files.ts"; + +export function generate(): GeneratedFiles { + const compact = { + categories: dataset.categories, + skinTones: dataset.skinTones, + emojis: dataset.emojis.map((emoji) => ({ + emoji: emoji.emoji, + label: emoji.label, + category: emoji.category, + version: emoji.version, + // The shortcodes are among the tags already; they are kept apart only to look emoji up by them. + tags: emoji.tags.filter((tag) => !emoji.shortcodes.includes(tag)), + shortcodes: emoji.shortcodes, + ...("skins" in emoji && emoji.skins ? { skins: emoji.skins } : {}), + ...("countryFlag" in emoji && emoji.countryFlag ? { countryFlag: true } : {}), + })), + }; + return { files: new Map([["Sugabots/Resources/Emoji.json", JSON.stringify(compact)]]) }; +} diff --git a/apps/codegen/generate-file-and-zone-lists.ts b/apps/codegen/generate-file-and-zone-lists.ts new file mode 100644 index 000000000..db7f6ee73 --- /dev/null +++ b/apps/codegen/generate-file-and-zone-lists.ts @@ -0,0 +1,100 @@ +/** + * Writes two lists the web keeps private to its `lib` modules, read from their + * source, so the app's copies of those modules' rules use the same: + * + * - `Sugabots/Conversation/FileLook.generated.swift`: the extensions of the + * files drawn as a sheet, `SHEET_EXTENSIONS` in `lib/file-looks.ts`. + * - `Sugabots/Settings/TimeZoneRegions.generated.swift`: the regions time + * zones are listed under, `NAMED_REGIONS` and `OTHER_REGION` in + * `lib/time-zones.ts`. + * + * Those modules import values from `@sugabots/contracts`, which Node can't load + * from here, so each list is found in its module's text, and a list that is + * no longer written as expected stops the generator rather than going missing. + */ +import { readFileSync } from "node:fs"; +import type { GeneratedFiles } from "./generated-files.ts"; + +const fileLooks = new URL("../../packages/web/src/lib/file-looks.ts", import.meta.url); +const timeZones = new URL("../../packages/web/src/lib/time-zones.ts", import.meta.url); + +/** The text `pattern` captures in `source`, which must hold it. */ +function captured(source: URL, pattern: RegExp): string { + const match = readFileSync(source, "utf8").match(pattern)?.[1]; + if (match === undefined) throw new Error(`${pattern} matches nothing in ${source.pathname}`); + return match; +} + +/** The string literals in `text`, in order. */ +function stringLiterals(text: string): string[] { + return [...text.matchAll(/"((?:[^"\\]|\\.)*)"/g)].map( + ([literal]) => JSON.parse(literal) as string, + ); +} + +function sheetExtensions(): string[] { + const extensions = stringLiterals( + captured(fileLooks, /const SHEET_EXTENSIONS = new Set\(\[([^\]]*)\]\)/), + ); + if (extensions.length === 0) throw new Error("SHEET_EXTENSIONS lists no extensions"); + return extensions; +} + +/** The named regions, each the first part of its zones' names and what the region is called. */ +function namedRegions(): { prefix: string; name: string }[] { + const list = captured(timeZones, /const NAMED_REGIONS[^=]*= \[\n([\s\S]*?)\n\];/); + const regions = [...list.matchAll(/^\s*\[("[^"]*"), ("[^"]*")\],$/gm)].map( + ([, prefix, name]) => ({ + prefix: JSON.parse(prefix ?? "") as string, + name: JSON.parse(name ?? "") as string, + }), + ); + const lines = list.split("\n").filter((line) => line.trim() !== ""); + if (regions.length === 0 || regions.length !== lines.length) { + throw new Error("NAMED_REGIONS isn't a list of [prefix, name] pairs, one to a line"); + } + return regions; +} + +function otherRegion(): string { + return JSON.parse(captured(timeZones, /const OTHER_REGION = ("[^"]*");/)) as string; +} + +const string = (text: string) => JSON.stringify(text); + +function fileLookSwift(extensions: string[]): string { + return `// Generated by apps/codegen/generate-file-and-zone-lists.ts from packages/web/src/lib/file-looks.ts. Do not edit. + +extension FileLook { + /// The extensions of files drawn as a sheet, as \`SHEET_EXTENSIONS\`. + static let sheetExtensions: Set = [${extensions.map(string).join(", ")}] +} +`; +} + +function timeZoneRegionsSwift(regions: { prefix: string; name: string }[], other: string): string { + return `// Generated by apps/codegen/generate-file-and-zone-lists.ts from packages/web/src/lib/time-zones.ts. Do not edit. + +extension TimeZoneRegion { + /// The regions a zone's first part names, as people call them, in the order they are listed, as \`NAMED_REGIONS\`. + static let named: [(prefix: String, name: String)] = [ +${regions.map((region) => `\t\t(${string(region.prefix)}, ${string(region.name)}),`).join("\n")} + ] + + /// What the region of every zone outside the named ones is called, as \`OTHER_REGION\`. + static let otherName = ${string(other)} +} +`; +} + +export function generate(): GeneratedFiles { + return { + files: new Map([ + ["Sugabots/Conversation/FileLook.generated.swift", fileLookSwift(sheetExtensions())], + [ + "Sugabots/Settings/TimeZoneRegions.generated.swift", + timeZoneRegionsSwift(namedRegions(), otherRegion()), + ], + ]), + }; +} diff --git a/apps/codegen/generate-limits.ts b/apps/codegen/generate-limits.ts new file mode 100644 index 000000000..b0da0c68f --- /dev/null +++ b/apps/codegen/generate-limits.ts @@ -0,0 +1,115 @@ +/** + * Writes `Sugabots/API/Limits.generated.swift` from the limits the API's + * schemas check, in `@sugabots/contracts`, and the ones the web's screens are + * drawn with, in the plain data modules of `packages/web/src/lib`, so a field + * stops where the web's does. + * + * The file builds for macOS without UIKit, since `check-rules.sh` builds the + * rules that read it off the simulator. + */ +import { + AGENT_NAME_MAX_LENGTH, + DESCRIPTION_MAX_LENGTH, + PROMPT_MAX_LENGTH, +} from "../../packages/contracts/src/agents.ts"; +import { USER_NAME_MAX_LENGTH } from "../../packages/contracts/src/api.ts"; +import { + MAX_ATTACHMENT_BYTES, + MAX_ATTACHMENT_MEGABYTES, + MAX_ATTACHMENTS_PER_MESSAGE, +} from "../../packages/contracts/src/attachments.ts"; +import { CHAT_NAME_MAX_LENGTH } from "../../packages/contracts/src/chats.ts"; +import { + INVITE_LIFETIME_DAYS, + WORKSPACE_NAME_MAX_LENGTH, +} from "../../packages/contracts/src/membership.ts"; +import { POD_NAME_MAX_LENGTH } from "../../packages/contracts/src/pods.ts"; +import { + MAX_EVERY_DAYS, + MAX_EVERY_MONTHS, + MAX_EVERY_WEEKS, + MAX_ROUTINE_INSTRUCTIONS_CHARACTERS, + MAX_ROUTINE_NAME_CHARACTERS, + MAX_ROUTINE_SCHEDULE_TIMES, + MIN_WEBHOOK_SECRET_CHARACTERS, +} from "../../packages/contracts/src/routines.ts"; +import { + MAX_REACTION_EMOJI_PER_MESSAGE, + MESSAGE_MAX_LENGTH, + MESSAGE_PREVIEW_CHARACTERS, +} from "../../packages/contracts/src/threads.ts"; +import { DEFAULT_QUIET_HOURS } from "../../packages/web/src/lib/notification-choices.ts"; +import { MODEL_SEARCH_THRESHOLD, THREADS_SHOWN } from "../../packages/web/src/lib/screen-limits.ts"; +import type { GeneratedFiles } from "./generated-files.ts"; + +/** A limit's value: a whole number, some text, or a few of those under names. */ +type LimitValue = number | string | Readonly>; + +/** Each limit by the name its module exports it under. */ +export const limits: Readonly> = { + USER_NAME_MAX_LENGTH, + WORKSPACE_NAME_MAX_LENGTH, + POD_NAME_MAX_LENGTH, + CHAT_NAME_MAX_LENGTH, + AGENT_NAME_MAX_LENGTH, + DESCRIPTION_MAX_LENGTH, + PROMPT_MAX_LENGTH, + MAX_ROUTINE_NAME_CHARACTERS, + MAX_ROUTINE_INSTRUCTIONS_CHARACTERS, + MAX_ROUTINE_SCHEDULE_TIMES, + MAX_EVERY_DAYS, + MAX_EVERY_WEEKS, + MAX_EVERY_MONTHS, + MIN_WEBHOOK_SECRET_CHARACTERS, + MAX_REACTION_EMOJI_PER_MESSAGE, + MAX_ATTACHMENTS_PER_MESSAGE, + MAX_ATTACHMENT_BYTES, + MAX_ATTACHMENT_MEGABYTES, + MESSAGE_MAX_LENGTH, + MESSAGE_PREVIEW_CHARACTERS, + INVITE_LIFETIME_DAYS, + DEFAULT_QUIET_HOURS, + MODEL_SEARCH_THRESHOLD, + THREADS_SHOWN, +}; + +/** `MAX_EVERY_DAYS` as a Swift name: `maxEveryDays`. */ +const swiftName = (constant: string) => + constant.toLowerCase().replace(/_([a-z])/g, (_, letter: string) => letter.toUpperCase()); + +function swiftScalar(value: number | string): string { + if (typeof value === "string") return JSON.stringify(value); + if (!Number.isInteger(value)) throw new Error(`${value} is not a whole number`); + // Thousands set apart, as Swift writes them: `20_000`. + return Math.abs(value) < 10_000 + ? String(value) + : value.toLocaleString("en-US").replaceAll(",", "_"); +} + +/** A value as Swift: a number or text as it is, named values as a tuple. */ +function swiftValue(value: LimitValue): string { + if (typeof value !== "object") return swiftScalar(value); + const fields = Object.entries(value).map(([name, field]) => `${name}: ${swiftScalar(field)}`); + return `(${fields.join(", ")})`; +} + +export function swift(values: Readonly>): string { + const declarations = Object.entries(values).flatMap(([name, value]) => [ + `\t/// The web's \`${name}\`.`, + `\tstatic let ${swiftName(name)} = ${swiftValue(value)}`, + ]); + return [ + "// Generated by apps/codegen/generate-limits.ts from @sugabots/contracts and packages/web/src/lib. Do not edit.", + "import Foundation", + "", + "/// The limits the API checks and the apps' screens keep to, as the web's.", + "enum Limits {", + ...declarations, + "}", + "", + ].join("\n"); +} + +export function generate(): GeneratedFiles { + return { files: new Map([["Sugabots/API/Limits.generated.swift", swift(limits)]]) }; +} diff --git a/apps/codegen/generate-lucide-icons.ts b/apps/codegen/generate-lucide-icons.ts new file mode 100644 index 000000000..8b5c7c75f --- /dev/null +++ b/apps/codegen/generate-lucide-icons.ts @@ -0,0 +1,152 @@ +/** + * Writes `Sugabots/Design/Lucide.generated.swift` with every Lucide icon the + * web app imports, as SVG path data, so the app draws the same icons as the + * web rather than SF Symbols. + */ +import { readdirSync, readFileSync, statSync } from "node:fs"; +import { createRequire } from "node:module"; +import { dirname, join } from "node:path"; +import { fileURLToPath } from "node:url"; +import type { GeneratedFiles } from "./generated-files.ts"; + +const webSource = fileURLToPath(new URL("../../packages/web/src", import.meta.url)); +const lucide = join( + dirname(createRequire(join(webSource, "..", "package.json")).resolve("lucide-react")), + "..", + "esm", +); + +type Attributes = Record; +type IconNode = [string, Attributes][]; + +/** Every source file under `directory`, leaving out stories and tests. */ +function sourceFiles(directory: string): string[] { + return readdirSync(directory).flatMap((name) => { + const path = join(directory, name); + if (statSync(path).isDirectory()) return sourceFiles(path); + return /\.tsx?$/.test(name) && !/\.(stories|test)\.tsx?$/.test(name) ? [path] : []; + }); +} + +/** The names imported from `lucide-react`, leaving out its types. */ +function importedIcons(): Set { + const names = new Set(); + for (const file of sourceFiles(webSource)) { + for (const match of readFileSync(file, "utf8").matchAll( + /import\s*\{([^}]+)\}\s*from\s*"lucide-react"/g, + )) { + for (const part of match[1]?.split(",") ?? []) { + const name = part + .trim() + .replace(/^type\s+/, "") + .replace(/\s+as\s+\w+$/, ""); + if (name && !part.trim().startsWith("type ") && !name.startsWith("Lucide")) names.add(name); + } + } + } + return names; +} + +/** Each export of `lucide-react` with the file that defines it. */ +function iconFiles(): Map { + const files = new Map(); + const index = readFileSync(join(lucide, "lucide-react.mjs"), "utf8"); + for (const match of index.matchAll(/export \{([^}]+)\} from '\.\/icons\/([a-z0-9-]+)\.mjs'/g)) { + for (const part of match[1]?.split(",") ?? []) { + const name = part.trim().replace(/^default as /, ""); + if (match[2]) files.set(name, match[2]); + } + } + return files; +} + +function iconNode(file: string): IconNode { + const source = readFileSync(join(lucide, "icons", `${file}.mjs`), "utf8"); + const literal = source.match(/node: (\[[\s\S]*?\]),\n\s*aliases|node: (\[[\s\S]*?\])\n\};/); + const text = literal?.[1] ?? literal?.[2]; + if (!text) throw new Error(`No icon node in ${file}`); + return Function(`return ${text}`)() as IconNode; +} + +const number = (value: string | number | undefined) => Number(value ?? 0); + +/** One element of an icon as path data. */ +function pathData([tag, attributes]: [string, Attributes]): string { + switch (tag) { + case "path": + return String(attributes.d); + case "line": + return `M${attributes.x1} ${attributes.y1}L${attributes.x2} ${attributes.y2}`; + case "polyline": + case "polygon": { + const points = String(attributes.points) + .trim() + .split(/[\s,]+/); + const pairs = []; + for (let i = 0; i < points.length; i += 2) pairs.push(`${points[i]} ${points[i + 1]}`); + return `M${pairs.join("L")}${tag === "polygon" ? "Z" : ""}`; + } + case "circle": + case "ellipse": { + const cx = number(attributes.cx); + const cy = number(attributes.cy); + const rx = number(attributes.rx ?? attributes.r); + const ry = number(attributes.ry ?? attributes.r); + return `M${cx - rx} ${cy}A${rx} ${ry} 0 1 0 ${cx + rx} ${cy}A${rx} ${ry} 0 1 0 ${cx - rx} ${cy}Z`; + } + case "rect": { + const x = number(attributes.x); + const y = number(attributes.y); + const width = number(attributes.width); + const height = number(attributes.height); + const rx = Math.min(number(attributes.rx ?? attributes.ry), width / 2); + const ry = Math.min(number(attributes.ry ?? attributes.rx), height / 2); + if (rx === 0 && ry === 0) return `M${x} ${y}h${width}v${height}h${-width}Z`; + return [ + `M${x + rx} ${y}`, + `H${x + width - rx}`, + `A${rx} ${ry} 0 0 1 ${x + width} ${y + ry}`, + `V${y + height - ry}`, + `A${rx} ${ry} 0 0 1 ${x + width - rx} ${y + height}`, + `H${x + rx}`, + `A${rx} ${ry} 0 0 1 ${x} ${y + height - ry}`, + `V${y + ry}`, + `A${rx} ${ry} 0 0 1 ${x + rx} ${y}Z`, + ].join(""); + } + default: + throw new Error(`Unknown icon element ${tag}`); + } +} + +/** `ChevronRight` as a Swift case: `chevronRight`. */ +const caseName = (name: string) => name[0]?.toLowerCase() + name.slice(1); + +export function generate(): GeneratedFiles { + const files = iconFiles(); + const icons = [...importedIcons()] + .filter((name) => files.has(name)) + .sort() + .map((name) => ({ name, paths: iconNode(files.get(name) as string).map(pathData) })); + + const swift = `// Generated by apps/codegen/generate-lucide-icons.ts from lucide-react. Do not edit. + +/// Every Lucide icon the web app uses, by its name there. +enum Lucide: String, CaseIterable { +${icons.map(({ name }) => `\tcase ${caseName(name)}`).join("\n")} + + /// Its strokes, as path data on a 24-point square. + var paths: [String] { + switch self { +${icons + .map( + ({ name, paths }) => + `\t\tcase .${caseName(name)}: [${paths.map((path) => JSON.stringify(path)).join(", ")}]`, + ) + .join("\n")} + } + } +} +`; + return { files: new Map([["Sugabots/Design/Lucide.generated.swift", swift]]) }; +} diff --git a/apps/codegen/generate-native-constants.ts b/apps/codegen/generate-native-constants.ts new file mode 100644 index 000000000..8086de8c6 --- /dev/null +++ b/apps/codegen/generate-native-constants.ts @@ -0,0 +1,67 @@ +/** + * Writes `Sugabots/Design/NativeConstants.generated.swift` from + * `apps/native-constants.json`: the values where the native apps + * deliberately differ from the web, which `apps/NATIVE.md` gives the reasons + * for, so each native app takes the same ones. + */ +import { readFileSync } from "node:fs"; +import type { GeneratedFiles } from "./generated-files.ts"; + +const source = new URL("../native-constants.json", import.meta.url); + +/** One constant: a length in points, a count, some text, or a list of texts. */ +type NativeConstant = { about: string } & ( + | { value: number; unit: "points" | "count" } + | { value: string } + | { value: string[] } +); + +/** The constants by name, read from the JSON file and checked to be one of the kinds above. */ +export function nativeConstants(): Record { + const parsed: Record = JSON.parse(readFileSync(source, "utf8")); + for (const [name, constant] of Object.entries(parsed)) { + const { value } = constant; + const valid = + typeof constant.about === "string" && + (typeof value === "string" || + (Array.isArray(value) && value.every((item) => typeof item === "string")) || + (typeof value === "number" && + "unit" in constant && + ["points", "count"].includes(constant.unit))); + if (!valid) throw new Error(`${name} in native-constants.json is not a known kind of constant`); + } + return parsed; +} + +const string = (text: string) => JSON.stringify(text); + +function swiftDeclaration(name: string, constant: NativeConstant): string { + const { value } = constant; + if (typeof value === "string") return `static let ${name} = ${string(value)}`; + if (Array.isArray(value)) return `static let ${name} = [${value.map(string).join(", ")}]`; + const type = "unit" in constant && constant.unit === "points" ? "CGFloat" : "Int"; + return `static let ${name}: ${type} = ${value}`; +} + +export function swift(constants: Record): string { + const declarations = Object.entries(constants).flatMap(([name, constant]) => [ + `\t/// ${constant.about}`, + `\t${swiftDeclaration(name, constant)}`, + ]); + return [ + "// Generated by apps/codegen/generate-native-constants.ts from apps/native-constants.json. Do not edit.", + "import CoreGraphics", + "", + "/// Where the native apps deliberately differ from the web; `apps/NATIVE.md` says why.", + "enum NativeConstants {", + ...declarations, + "}", + "", + ].join("\n"); +} + +export function generate(): GeneratedFiles { + return { + files: new Map([["Sugabots/Design/NativeConstants.generated.swift", swift(nativeConstants())]]), + }; +} diff --git a/apps/codegen/generate-palette.ts b/apps/codegen/generate-palette.ts new file mode 100644 index 000000000..73eb1c8f1 --- /dev/null +++ b/apps/codegen/generate-palette.ts @@ -0,0 +1,212 @@ +/** + * Writes `Sugabots/Design/Palette.generated.swift` from the colour tokens the + * web app declares on `:root` in `packages/web/src/app.css`, each as light and + * dark draw it, so a token changed there changes here too. A token that isn't + * a colour, such as a shadow, is left out. + */ +import { readFileSync } from "node:fs"; +import type { GeneratedFiles } from "./generated-files.ts"; + +const stylesheet = new URL("../../packages/web/src/app.css", import.meta.url); + +/** A colour in sRGB, each channel from 0 to 1. */ +export interface Rgba { + red: number; + green: number; + blue: number; + alpha: number; +} + +type TokenValue = { kind: "colour"; light: Rgba; dark: Rgba } | { kind: "alias"; token: string }; + +interface Token { + name: string; + value: TokenValue; + /** The comment written above it in the stylesheet, if any. */ + comment?: string; +} + +/** The body of the first `:root { ... }` rule. */ +function rootRule(css: string): string { + const start = css.indexOf(":root {"); + const end = css.indexOf("\n}", start); + if (start < 0 || end < 0) throw new Error("No :root rule in app.css"); + return css.slice(start + ":root {".length, end); +} + +/** `a, b(c, d)` split at its top-level commas: `["a", "b(c, d)"]`. */ +function topLevelArguments(text: string): string[] { + const parts: string[] = []; + let depth = 0; + let current = ""; + for (const character of text) { + if (character === "(") depth += 1; + if (character === ")") depth -= 1; + if (character === "," && depth === 0) { + parts.push(current.trim()); + current = ""; + continue; + } + current += character; + } + parts.push(current.trim()); + return parts; +} + +const fromLinear = (c: number) => (c <= 0.0031308 ? 12.92 * c : 1.055 * c ** (1 / 2.4) - 0.055); +const clamp = (c: number) => Math.min(1, Math.max(0, c)); + +/** `oklch(L C H)` in sRGB, clamped to its gamut. */ +function oklchToRgb(lightness: number, chroma: number, hue: number): Rgba { + const radians = (hue * Math.PI) / 180; + const a = chroma * Math.cos(radians); + const b = chroma * Math.sin(radians); + const l = (lightness + 0.3963377774 * a + 0.2158037573 * b) ** 3; + const m = (lightness - 0.1055613458 * a - 0.0638541728 * b) ** 3; + const s = (lightness - 0.0894841775 * a - 1.291485548 * b) ** 3; + const [red, green, blue] = [ + 4.0767416621 * l - 3.3077115913 * m + 0.2309699292 * s, + -1.2684380046 * l + 2.6097574011 * m - 0.3413193965 * s, + -0.0041960863 * l - 0.7034186147 * m + 1.707614701 * s, + ].map((c) => clamp(fromLinear(c))) as [number, number, number]; + return { red, green, blue, alpha: 1 }; +} + +/** One CSS colour, or undefined if it's in a form this doesn't read. */ +function colour(text: string): Rgba | undefined { + const hex = /^#([0-9a-f]{6})$/i.exec(text)?.[1]; + if (hex) { + const channel = (index: number) => Number.parseInt(hex.slice(index, index + 2), 16) / 255; + return { red: channel(0), green: channel(2), blue: channel(4), alpha: 1 }; + } + const rgb = /^rgba?\(\s*([\d.]+)[\s,]+([\d.]+)[\s,]+([\d.]+)\s*(?:[,/]\s*([\d.]+))?\s*\)$/.exec( + text, + ); + if (rgb) { + const [red, green, blue] = rgb.slice(1, 4).map((channel) => Number(channel) / 255) as [ + number, + number, + number, + ]; + return { red, green, blue, alpha: rgb[4] === undefined ? 1 : Number(rgb[4]) }; + } + const oklch = /^oklch\(\s*([\d.]+)\s+([\d.]+)\s+([\d.]+)\s*\)$/.exec(text); + if (oklch) return oklchToRgb(Number(oklch[1]), Number(oklch[2]), Number(oklch[3])); + return undefined; +} + +/** A value written in one of CSS's colour forms, which `colour` must read. */ +const colourForm = /^(?:#|(?:rgba?|hsla?|hwb|lab|lch|oklab|oklch|color|color-mix|light-dark)\()/i; + +/** + * A token's value, or undefined if it isn't a colour, such as a shadow. + * Throws for a colour written in a form `colour` doesn't read, which would + * otherwise go missing from the app's palette. + */ +function tokenValue(text: string): TokenValue | undefined { + const alias = /^var\(--([\w-]+)\)$/.exec(text)?.[1]; + if (alias) return { kind: "alias", token: alias }; + const lightDark = /^light-dark\(([\s\S]*)\)$/.exec(text)?.[1]; + const [lightText, darkText] = lightDark ? topLevelArguments(lightDark) : [text, text]; + const light = colour(lightText ?? ""); + const dark = colour(darkText ?? ""); + if (light && dark) return { kind: "colour", light, dark }; + if (colourForm.test(text)) throw new Error(`app.css has a colour this can't read: ${text}`); + return undefined; +} + +/** The comment's text, without its `/*` and the `*` that starts each line. */ +function commentText(comment: string): string { + return comment + .split("\n") + .map((line) => line.replace(/^\s*\*?\s?/, "").trim()) + .filter(Boolean) + .join(" "); +} + +/** Each colour token on `:root`, in the stylesheet's order. */ +function tokens(css: string): Token[] { + const found: Token[] = []; + const known = new Set(); + let comment: string | undefined; + for (const match of rootRule(css).matchAll(/\/\*([\s\S]*?)\*\/|--([\w-]+):\s*([\s\S]*?);/g)) { + if (match[1] !== undefined) { + comment = commentText(match[1]); + continue; + } + const [name, text] = [match[2] as string, (match[3] as string).replace(/\s+/g, " ").trim()]; + const value = tokenValue(text); + if (value && (value.kind === "colour" || known.has(value.token))) { + found.push({ name, value, comment }); + known.add(name); + } + comment = undefined; + } + return found; +} + +/** Each colour token on `:root` by name, as light and dark draw it, with an alias resolved to the colour it names. */ +export function colourTokens(): Map { + const resolved = new Map(); + for (const { name, value } of tokens(readFileSync(stylesheet, "utf8"))) { + const colour = value.kind === "colour" ? value : resolved.get(value.token); + if (colour) resolved.set(name, { light: colour.light, dark: colour.dark }); + } + return resolved; +} + +/** `border-subtle` as a Swift name: `borderSubtle`. */ +const swiftName = (token: string) => + token.replace(/-([a-z])/g, (_, letter: string) => letter.toUpperCase()); + +const byte = (channel: number) => + Math.round(channel * 255) + .toString(16) + .padStart(2, "0") + .toUpperCase(); + +/** A colour as a `UIColor`. */ +function uiColor({ red, green, blue, alpha }: Rgba): string { + const hex = JSON.stringify(`#${byte(red)}${byte(green)}${byte(blue)}`); + return alpha === 1 ? `UIColor(hex: ${hex})` : `UIColor(hex: ${hex}, alpha: ${alpha})`; +} + +function swiftValue(value: TokenValue): string { + if (value.kind === "alias") return swiftName(value.token); + const [light, dark] = [uiColor(value.light), uiColor(value.dark)]; + return light === dark ? `Color(${light})` : `themed(light: ${light}, dark: ${dark})`; +} + +/** A comment as Swift doc comment lines, wrapped at about 100 columns. */ +function docComment(text: string): string[] { + const lines: string[] = []; + let line = ""; + for (const word of text.split(" ")) { + if (line && line.length + word.length + 1 > 92) { + lines.push(line); + line = word; + } else { + line = line ? `${line} ${word}` : word; + } + } + if (line) lines.push(line); + return lines.map((text) => `\t/// ${text}`); +} + +export function generate(): GeneratedFiles { + const declarations = tokens(readFileSync(stylesheet, "utf8")).flatMap((token) => [ + ...(token.comment ? docComment(token.comment) : []), + `\tstatic let ${swiftName(token.name)} = ${swiftValue(token.value)}`, + ]); + const swift = [ + "// Generated by apps/codegen/generate-palette.ts from packages/web/src/app.css. Do not edit.", + "import SwiftUI", + "import UIKit", + "", + "extension Palette {", + ...declarations, + "}", + "", + ].join("\n"); + return { files: new Map([["Sugabots/Design/Palette.generated.swift", swift]]) }; +} diff --git a/apps/codegen/generate-provider-logos.ts b/apps/codegen/generate-provider-logos.ts new file mode 100644 index 000000000..c635e8a8e --- /dev/null +++ b/apps/codegen/generate-provider-logos.ts @@ -0,0 +1,161 @@ +/** + * Copies `@sugabots/provider-logos`' SVGs, untouched as that package asks, + * into the app's asset catalog, a dark version as the dark appearance where + * there is one, and writes `Sugabots/Design/ProviderLogos.generated.swift` + * mapping each provider preset to its logo and scale. + */ +import { readFileSync } from "node:fs"; +import { fileURLToPath } from "node:url"; +import { providerModelCapabilityCatalog } from "../../packages/contracts/src/model-providers.ts"; +import { + OPENAI_COMPATIBLE_PATH, + providerCatalog, + seededPresets, + signInServiceNames, +} from "../../packages/contracts/src/provider-catalog.ts"; +import type { GeneratedFiles } from "./generated-files.ts"; + +const logos = fileURLToPath(new URL("../../packages/provider-logos/", import.meta.url)); +const catalog = "Sugabots/Assets.xcassets/ProviderLogos/"; +const source = readFileSync(`${logos}src/provider-logos.ts`, "utf8"); + +// `import openaiDark from "../logos/openai-dark.svg";`: each import's name and file. +const files = new Map( + [...source.matchAll(/import (\w+) from "\.\.\/logos\/([\w-]+)\.svg";/g)].map((match) => [ + match[1], + match[2], + ]), +); + +/** Each preset's light and dark logo and its scale, read from `providerLogos`. */ +const entries = [...source.matchAll(/\n\t([\w]+): \{([\s\S]*?)\n\t\},/g)].map((match) => { + const body = match[2] ?? ""; + const light = /light: (\w+)/.exec(body)?.[1]; + const dark = /dark: (\w+)/.exec(body)?.[1]; + const scale = /scale: "scale-(\d+)"/.exec(body)?.[1]; + if (!light || !files.has(light)) throw new Error(`No light logo for ${match[1]}`); + return { + preset: match[1] as string, + light: files.get(light) as string, + dark: dark ? files.get(dark) : undefined, + scale: scale ? Number(scale) / 100 : 1, + }; +}); + +/** The asset catalog: one image set per light logo, with its dark version where it has one. */ +function catalogFiles(): Map { + const files = new Map([ + [ + `${catalog}Contents.json`, + JSON.stringify( + { + info: { author: "xcode", version: 1 }, + // What Xcode writes for a folder whose images are named without it. + properties: { "provides-namespace": false }, + }, + null, + 2, + ), + ], + ]); + const logo = (name: string) => readFileSync(`${logos}logos/${name}.svg`, "utf8"); + const sets = new Map(entries.map((entry) => [entry.light, entry.dark])); + for (const [light, dark] of sets) { + const set = `${catalog}${light}.imageset/`; + files.set(`${set}${light}.svg`, logo(light)); + const images: object[] = [{ filename: `${light}.svg`, idiom: "universal" }]; + if (dark) { + files.set(`${set}${dark}.svg`, logo(dark)); + images.push({ + appearances: [{ appearance: "luminosity", value: "dark" }], + filename: `${dark}.svg`, + idiom: "universal", + }); + } + files.set( + `${set}Contents.json`, + JSON.stringify( + { + images, + info: { author: "xcode", version: 1 }, + properties: { "preserves-vector-representation": true }, + }, + null, + 2, + ), + ); + } + return files; +} + +const swift = `// Generated by apps/codegen/generate-provider-logos.ts from @sugabots/provider-logos. Do not edit. +import CoreGraphics + +/// Each provider preset's logo in the asset catalog, and how much it's scaled +/// up to even out the padding its owner built into the file. +enum ProviderLogos { + static let assets: [String: (image: String, scale: CGFloat)] = [ +${entries.map((entry) => `\t\t${JSON.stringify(entry.preset)}: (${JSON.stringify(entry.light)}, ${entry.scale}),`).join("\n")} + ] +} + +/// A provider in the catalog, as \`providerCatalog\` lists it. +struct ProviderPreset: Hashable, Identifiable { + let id: String + let name: String + let baseUrl: String + /// \`remote\` or \`local\`: on somebody else's servers, or on your own machine. + let hosting: String + /// \`api-key\`, \`optional\` or \`sign-in\`. + let credential: String + /// The service a \`sign-in\` preset signs in with: \`chatgpt\` or \`xai\`. + let signIn: String? + let hint: String + + static let catalog: [ProviderPreset] = [ +${providerCatalog + .map( + (preset) => + `\t\tProviderPreset(id: ${JSON.stringify(preset.id)}, name: ${JSON.stringify(preset.name)}, baseUrl: ${JSON.stringify(preset.baseUrl)}, hosting: ${JSON.stringify(preset.hosting)}, credential: ${JSON.stringify(preset.credential)}, signIn: ${"signIn" in preset ? JSON.stringify(preset.signIn) : "nil"}, hint: ${JSON.stringify(preset.hint)}),`, + ) + .join("\n")} + ] + + /// The providers every workspace starts with, which can't be deleted, only signed out and switched off. + static let seeded: Set = [${seededPresets.map((id) => JSON.stringify(id)).join(", ")}] + + /// Each sign-in service's name, as \`signInServiceNames\`. + static let signInServiceNames: [String: String] = [${Object.entries(signInServiceNames) + .map(([id, name]) => `${JSON.stringify(id)}: ${JSON.stringify(name)}`) + .join(", ")}] + + /// The path an OpenAI-compatible server answers under, which a bare address is given. + static let openAICompatiblePath = ${JSON.stringify(OPENAI_COMPATIBLE_PATH)} + + static func named(_ id: String?) -> ProviderPreset? { + id.flatMap { id in catalog.first { $0.id == id } } + } +} + +/// What a model can do, as \`providerModelCapabilityCatalog\` lists it. +struct ModelCapability: Hashable { + let key: String + let name: String + let description: String + + static let catalog: [ModelCapability] = [ +${providerModelCapabilityCatalog + .map( + (entry) => + `\t\tModelCapability(key: ${JSON.stringify(entry.key)}, name: ${JSON.stringify(entry.name)}, description: ${JSON.stringify(entry.description)}),`, + ) + .join("\n")} + ] +} +`; + +export function generate(): GeneratedFiles { + const files = catalogFiles(); + files.set("Sugabots/Design/ProviderLogos.generated.swift", swift); + return { files, folder: catalog }; +} diff --git a/apps/codegen/generate.ts b/apps/codegen/generate.ts index 66bd9f4de..95569a6bf 100644 --- a/apps/codegen/generate.ts +++ b/apps/codegen/generate.ts @@ -11,11 +11,35 @@ import { mkdirSync, rmSync, writeFileSync } from "node:fs"; import { dirname } from "node:path"; import * as api from "./generate-api.ts"; -import { type Generator, targetRoots } from "./generated-files.ts"; +import * as artifactPages from "./generate-artifact-pages.ts"; +import * as botLooks from "./generate-bot-looks.ts"; +import * as builtInTools from "./generate-built-in-tools.ts"; +import * as catalogs from "./generate-catalogs.ts"; +import * as connectionMarks from "./generate-connection-marks.ts"; +import * as emoji from "./generate-emoji.ts"; +import * as fileAndZoneLists from "./generate-file-and-zone-lists.ts"; +import * as limits from "./generate-limits.ts"; +import * as lucideIcons from "./generate-lucide-icons.ts"; +import * as nativeConstants from "./generate-native-constants.ts"; +import * as palette from "./generate-palette.ts"; +import * as providerLogos from "./generate-provider-logos.ts"; +import { type Generator, iosOnly, targetRoots } from "./generated-files.ts"; /** Every generator, by the script that holds it; a test checks each `generate-*.ts` is here. */ export const generators: Record = { "generate-api.ts": api.generator, + "generate-artifact-pages.ts": iosOnly(artifactPages.generate), + "generate-bot-looks.ts": iosOnly(botLooks.generate), + "generate-built-in-tools.ts": iosOnly(builtInTools.generate), + "generate-catalogs.ts": iosOnly(catalogs.generate), + "generate-connection-marks.ts": iosOnly(connectionMarks.generate), + "generate-emoji.ts": iosOnly(emoji.generate), + "generate-file-and-zone-lists.ts": iosOnly(fileAndZoneLists.generate), + "generate-limits.ts": iosOnly(limits.generate), + "generate-lucide-icons.ts": iosOnly(lucideIcons.generate), + "generate-native-constants.ts": iosOnly(nativeConstants.generate), + "generate-palette.ts": iosOnly(palette.generate), + "generate-provider-logos.ts": iosOnly(providerLogos.generate), }; if (import.meta.main) { diff --git a/apps/codegen/generated-files.ts b/apps/codegen/generated-files.ts index 09c9900f7..72fad87d0 100644 --- a/apps/codegen/generated-files.ts +++ b/apps/codegen/generated-files.ts @@ -2,6 +2,7 @@ import { fileURLToPath } from "node:url"; /** The apps generated files are written for, by the folder each one's paths are relative to. */ export const targetRoots = { + ios: fileURLToPath(new URL("../ios/", import.meta.url)), android: fileURLToPath(new URL("../android/", import.meta.url)), }; @@ -24,3 +25,8 @@ export interface Generator { targets: readonly Target[]; generate: (target: Target) => GeneratedFiles; } + +/** A generator that only the iOS app has yet. */ +export function iosOnly(generate: () => GeneratedFiles): Generator { + return { targets: ["ios"], generate }; +} diff --git a/apps/ios/Sugabots/API/API.generated.swift b/apps/ios/Sugabots/API/API.generated.swift new file mode 100644 index 000000000..b0d877d2a --- /dev/null +++ b/apps/ios/Sugabots/API/API.generated.swift @@ -0,0 +1,7139 @@ +// Generated by apps/codegen/generate-api.ts from packages/contracts/openapi.json. Don't edit it by hand. +// swiftlint:disable all + +import Foundation + +// MARK: Schemas + +struct AcceptedInvitation: Codable, Hashable, Sendable { + var workspaceId: String +} + +struct AcceptedRoutineExecution: Codable, Hashable, Sendable { + var executionId: String + var threadId: String + var duplicate: Bool +} + +struct AcceptedRoutineWebhook: Codable, Hashable, Sendable { + var executionId: String + var duplicate: Bool +} + +struct AccountRepository: Codable, Hashable, Sendable { + var repository: String + var `private`: Bool +} + +struct ActivityFeed: Codable, Hashable, Sendable { + var items: [ActivityItem] +} + +enum ActivityItem: Codable, Hashable, Sendable { + case mentionOrMessage(MentionOrMessage) + case routine(Routine) + case collaboration(Collaboration) + /// A kind from a newer server than this app knows, by its `kind`. + case unknown(String) + + init(from decoder: any Decoder) throws { + let tag = try decoder.container(keyedBy: AnyCodingKey.self).decode(String.self, forKey: AnyCodingKey("kind")) + switch tag { + case "mention", "message": self = .mentionOrMessage(try MentionOrMessage(from: decoder)) + case "routine": self = .routine(try Routine(from: decoder)) + case "collaboration": self = .collaboration(try Collaboration(from: decoder)) + default: self = .unknown(tag) + } + } + + func encode(to encoder: any Encoder) throws { + switch self { + case let .mentionOrMessage(value): try value.encode(to: encoder) + case let .routine(value): try value.encode(to: encoder) + case let .collaboration(value): try value.encode(to: encoder) + case let .unknown(tag): + throw EncodingError.invalidValue(tag, .init(codingPath: encoder.codingPath, debugDescription: "A kind this app doesn't know can't be sent.")) + } + } + + struct MentionOrMessage: Codable, Hashable, Sendable { + var kind: Kind + var messageId: String + var author: ThreadParticipant + var preview: String + var podId: String + var conversationId: String + var at: Date + var unread: Bool + + enum Kind: RawRepresentable, Codable, Hashable, Sendable, ParameterValue { + case mention + case message + /// A value from a newer server than this app knows. + case unknown(String) + + /// Every value this app knows. + static let known: [Self] = [.mention, .message] + + init(rawValue: String) { + switch rawValue { + case "mention": self = .mention + case "message": self = .message + default: self = .unknown(rawValue) + } + } + + var rawValue: String { + switch self { + case .mention: "mention" + case .message: "message" + case let .unknown(value): value + } + } + + init(from decoder: any Decoder) throws { + self.init(rawValue: try decoder.singleValueContainer().decode(String.self)) + } + + func encode(to encoder: any Encoder) throws { + var container = encoder.singleValueContainer() + try container.encode(rawValue) + } + } + } + + struct Routine: Codable, Hashable, Sendable { + var kind: String = "routine" + var threadId: String + var routineName: String + var state: RoutineExecutionState + var triggerKind: RoutineExecutionTriggerKind + var agent: AgentParticipant + var preview: String? + var podId: String + var conversationId: String + var at: Date + var unread: Bool + + private enum CodingKeys: String, CodingKey { + case kind + case threadId + case routineName + case state + case triggerKind + case agent + case preview + case podId + case conversationId + case at + case unread + } + + func encode(to encoder: any Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(kind, forKey: .kind) + try container.encode(threadId, forKey: .threadId) + try container.encode(routineName, forKey: .routineName) + try container.encode(state, forKey: .state) + try container.encode(triggerKind, forKey: .triggerKind) + try container.encode(agent, forKey: .agent) + try container.encode(preview, forKey: .preview) + try container.encode(podId, forKey: .podId) + try container.encode(conversationId, forKey: .conversationId) + try container.encode(at, forKey: .at) + try container.encode(unread, forKey: .unread) + } + } + + struct Collaboration: Codable, Hashable, Sendable { + var kind: String = "collaboration" + var threadId: String + var initiator: AgentParticipant + var recipient: AgentParticipant + var status: CollaborationStatus + var brief: String + var podId: String + var conversationId: String + var at: Date + var unread: Bool + } +} + +struct Agent: Codable, Hashable, Sendable { + var id: String + var workspaceId: String + var podId: String + var name: String + var handle: String + var systemAgentKey: SystemAgentKey? + var description: String? + var color: AgentColor + var face: AgentFace + var shape: AgentShape + var model: String? + var prompt: String + var disabledTools: [String] + var usesSandbox: Bool + var naturalBrowsing: Bool + var createdById: String? + var createdAt: Date + + private enum CodingKeys: String, CodingKey { + case id + case workspaceId + case podId + case name + case handle + case systemAgentKey + case description + case color + case face + case shape + case model + case prompt + case disabledTools + case usesSandbox + case naturalBrowsing + case createdById + case createdAt + } + + func encode(to encoder: any Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(id, forKey: .id) + try container.encode(workspaceId, forKey: .workspaceId) + try container.encode(podId, forKey: .podId) + try container.encode(name, forKey: .name) + try container.encode(handle, forKey: .handle) + try container.encode(systemAgentKey, forKey: .systemAgentKey) + try container.encode(description, forKey: .description) + try container.encode(color, forKey: .color) + try container.encode(face, forKey: .face) + try container.encode(shape, forKey: .shape) + try container.encode(model, forKey: .model) + try container.encode(prompt, forKey: .prompt) + try container.encode(disabledTools, forKey: .disabledTools) + try container.encode(usesSandbox, forKey: .usesSandbox) + try container.encode(naturalBrowsing, forKey: .naturalBrowsing) + try container.encode(createdById, forKey: .createdById) + try container.encode(createdAt, forKey: .createdAt) + } +} + +enum AgentColor: RawRepresentable, Codable, Hashable, Sendable, ParameterValue { + case red + case orange + case amber + case yellow + case lime + case green + case emerald + case teal + case sky + case ice + case indigo + case violet + case purple + case fuchsia + case pink + case rose + /// A value from a newer server than this app knows. + case unknown(String) + + /// Every value this app knows. + static let known: [Self] = [.red, .orange, .amber, .yellow, .lime, .green, .emerald, .teal, .sky, .ice, .indigo, .violet, .purple, .fuchsia, .pink, .rose] + + init(rawValue: String) { + switch rawValue { + case "red": self = .red + case "orange": self = .orange + case "amber": self = .amber + case "yellow": self = .yellow + case "lime": self = .lime + case "green": self = .green + case "emerald": self = .emerald + case "teal": self = .teal + case "sky": self = .sky + case "ice": self = .ice + case "indigo": self = .indigo + case "violet": self = .violet + case "purple": self = .purple + case "fuchsia": self = .fuchsia + case "pink": self = .pink + case "rose": self = .rose + default: self = .unknown(rawValue) + } + } + + var rawValue: String { + switch self { + case .red: "red" + case .orange: "orange" + case .amber: "amber" + case .yellow: "yellow" + case .lime: "lime" + case .green: "green" + case .emerald: "emerald" + case .teal: "teal" + case .sky: "sky" + case .ice: "ice" + case .indigo: "indigo" + case .violet: "violet" + case .purple: "purple" + case .fuchsia: "fuchsia" + case .pink: "pink" + case .rose: "rose" + case let .unknown(value): value + } + } + + init(from decoder: any Decoder) throws { + self.init(rawValue: try decoder.singleValueContainer().decode(String.self)) + } + + func encode(to encoder: any Encoder) throws { + var container = encoder.singleValueContainer() + try container.encode(rawValue) + } +} + +enum AgentFace: RawRepresentable, Codable, Hashable, Sendable, ParameterValue { + case pill + case dot + case arc + case square + case wink + /// A value from a newer server than this app knows. + case unknown(String) + + /// Every value this app knows. + static let known: [Self] = [.pill, .dot, .arc, .square, .wink] + + init(rawValue: String) { + switch rawValue { + case "pill": self = .pill + case "dot": self = .dot + case "arc": self = .arc + case "square": self = .square + case "wink": self = .wink + default: self = .unknown(rawValue) + } + } + + var rawValue: String { + switch self { + case .pill: "pill" + case .dot: "dot" + case .arc: "arc" + case .square: "square" + case .wink: "wink" + case let .unknown(value): value + } + } + + init(from decoder: any Decoder) throws { + self.init(rawValue: try decoder.singleValueContainer().decode(String.self)) + } + + func encode(to encoder: any Encoder) throws { + var container = encoder.singleValueContainer() + try container.encode(rawValue) + } +} + +struct AgentParticipant: Codable, Hashable, Sendable { + var kind: String = "agent" + var id: String + var name: String + var handle: String + var color: AgentColor + var face: AgentFace + var shape: AgentShape +} + +enum AgentShape: RawRepresentable, Codable, Hashable, Sendable, ParameterValue { + case circle + case squircle + case pebble + case blob + case wobble + case drop + case leaf + case dome + case bowl + case hexagon + case octagon + case triangle + case pentagon + case diamond + case shield + case star + case flower + case scallop + case ghost + case bear + case antenna + /// A value from a newer server than this app knows. + case unknown(String) + + /// Every value this app knows. + static let known: [Self] = [.circle, .squircle, .pebble, .blob, .wobble, .drop, .leaf, .dome, .bowl, .hexagon, .octagon, .triangle, .pentagon, .diamond, .shield, .star, .flower, .scallop, .ghost, .bear, .antenna] + + init(rawValue: String) { + switch rawValue { + case "circle": self = .circle + case "squircle": self = .squircle + case "pebble": self = .pebble + case "blob": self = .blob + case "wobble": self = .wobble + case "drop": self = .drop + case "leaf": self = .leaf + case "dome": self = .dome + case "bowl": self = .bowl + case "hexagon": self = .hexagon + case "octagon": self = .octagon + case "triangle": self = .triangle + case "pentagon": self = .pentagon + case "diamond": self = .diamond + case "shield": self = .shield + case "star": self = .star + case "flower": self = .flower + case "scallop": self = .scallop + case "ghost": self = .ghost + case "bear": self = .bear + case "antenna": self = .antenna + default: self = .unknown(rawValue) + } + } + + var rawValue: String { + switch self { + case .circle: "circle" + case .squircle: "squircle" + case .pebble: "pebble" + case .blob: "blob" + case .wobble: "wobble" + case .drop: "drop" + case .leaf: "leaf" + case .dome: "dome" + case .bowl: "bowl" + case .hexagon: "hexagon" + case .octagon: "octagon" + case .triangle: "triangle" + case .pentagon: "pentagon" + case .diamond: "diamond" + case .shield: "shield" + case .star: "star" + case .flower: "flower" + case .scallop: "scallop" + case .ghost: "ghost" + case .bear: "bear" + case .antenna: "antenna" + case let .unknown(value): value + } + } + + init(from decoder: any Decoder) throws { + self.init(rawValue: try decoder.singleValueContainer().decode(String.self)) + } + + func encode(to encoder: any Encoder) throws { + var container = encoder.singleValueContainer() + try container.encode(rawValue) + } +} + +struct AgentUpdate: Codable, Hashable, Sendable { + var name: String? + var handle: Omittable = .omitted + var description: Omittable = .omitted + var color: Omittable = .omitted + var face: Omittable = .omitted + var shape: Omittable = .omitted + var model: Omittable = .omitted + var prompt: Omittable = .omitted + var disabledTools: Omittable<[String]> = .omitted + var usesSandbox: Omittable = .omitted + var naturalBrowsing: Omittable = .omitted +} + +struct AnsweredApproval: Codable, Hashable, Sendable { + var call: ToolCallPart + var agent: AgentParticipant + var podId: String + var threadId: String + var conversationId: String? + var answer: Answer + + private enum CodingKeys: String, CodingKey { + case call + case agent + case podId + case threadId + case conversationId + case answer + } + + func encode(to encoder: any Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(call, forKey: .call) + try container.encode(agent, forKey: .agent) + try container.encode(podId, forKey: .podId) + try container.encode(threadId, forKey: .threadId) + try container.encode(conversationId, forKey: .conversationId) + try container.encode(answer, forKey: .answer) + } + + struct Answer: Codable, Hashable, Sendable { + var status: Status + var decidedByName: String? + var decidedAt: Date + + private enum CodingKeys: String, CodingKey { + case status + case decidedByName + case decidedAt + } + + func encode(to encoder: any Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(status, forKey: .status) + try container.encode(decidedByName, forKey: .decidedByName) + try container.encode(decidedAt, forKey: .decidedAt) + } + + enum Status: RawRepresentable, Codable, Hashable, Sendable, ParameterValue { + case allowed + case denied + /// A value from a newer server than this app knows. + case unknown(String) + + /// Every value this app knows. + static let known: [Self] = [.allowed, .denied] + + init(rawValue: String) { + switch rawValue { + case "allowed": self = .allowed + case "denied": self = .denied + default: self = .unknown(rawValue) + } + } + + var rawValue: String { + switch self { + case .allowed: "allowed" + case .denied: "denied" + case let .unknown(value): value + } + } + + init(from decoder: any Decoder) throws { + self.init(rawValue: try decoder.singleValueContainer().decode(String.self)) + } + + func encode(to encoder: any Encoder) throws { + var container = encoder.singleValueContainer() + try container.encode(rawValue) + } + } + } +} + +struct ApprovalInbox: Codable, Hashable, Sendable { + var waiting: [ApprovalRequest] + var answered: [AnsweredApproval] +} + +struct ApprovalRequest: Codable, Hashable, Sendable { + var call: ToolCallPart + var agent: AgentParticipant + var podId: String + var threadId: String + var conversationId: String? + + private enum CodingKeys: String, CodingKey { + case call + case agent + case podId + case threadId + case conversationId + } + + func encode(to encoder: any Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(call, forKey: .call) + try container.encode(agent, forKey: .agent) + try container.encode(podId, forKey: .podId) + try container.encode(threadId, forKey: .threadId) + try container.encode(conversationId, forKey: .conversationId) + } +} + +struct Artifact: Codable, Hashable, Sendable { + var id: String + var podId: String + var kind: ArtifactKind + var title: String + var version: Int + var createdBy: ArtifactAuthor? + var createdAt: Date + var updatedAt: Date + var content: String + var shownVersion: ArtifactVersionSummary + + private enum CodingKeys: String, CodingKey { + case id + case podId + case kind + case title + case version + case createdBy + case createdAt + case updatedAt + case content + case shownVersion + } + + func encode(to encoder: any Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(id, forKey: .id) + try container.encode(podId, forKey: .podId) + try container.encode(kind, forKey: .kind) + try container.encode(title, forKey: .title) + try container.encode(version, forKey: .version) + try container.encode(createdBy, forKey: .createdBy) + try container.encode(createdAt, forKey: .createdAt) + try container.encode(updatedAt, forKey: .updatedAt) + try container.encode(content, forKey: .content) + try container.encode(shownVersion, forKey: .shownVersion) + } +} + +struct ArtifactAuthor: Codable, Hashable, Sendable { + var agentId: String + var name: String +} + +enum ArtifactKind: RawRepresentable, Codable, Hashable, Sendable, ParameterValue { + case document + case html + /// A value from a newer server than this app knows. + case unknown(String) + + /// Every value this app knows. + static let known: [Self] = [.document, .html] + + init(rawValue: String) { + switch rawValue { + case "document": self = .document + case "html": self = .html + default: self = .unknown(rawValue) + } + } + + var rawValue: String { + switch self { + case .document: "document" + case .html: "html" + case let .unknown(value): value + } + } + + init(from decoder: any Decoder) throws { + self.init(rawValue: try decoder.singleValueContainer().decode(String.self)) + } + + func encode(to encoder: any Encoder) throws { + var container = encoder.singleValueContainer() + try container.encode(rawValue) + } +} + +struct ArtifactPart: Codable, Hashable, Sendable { + var type: String = "artifact" + var artifactId: String + var kind: ArtifactKind + var title: String + var version: Int +} + +struct ArtifactSummary: Codable, Hashable, Sendable { + var id: String + var podId: String + var kind: ArtifactKind + var title: String + var version: Int + var createdBy: ArtifactAuthor? + var createdAt: Date + var updatedAt: Date + + private enum CodingKeys: String, CodingKey { + case id + case podId + case kind + case title + case version + case createdBy + case createdAt + case updatedAt + } + + func encode(to encoder: any Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(id, forKey: .id) + try container.encode(podId, forKey: .podId) + try container.encode(kind, forKey: .kind) + try container.encode(title, forKey: .title) + try container.encode(version, forKey: .version) + try container.encode(createdBy, forKey: .createdBy) + try container.encode(createdAt, forKey: .createdAt) + try container.encode(updatedAt, forKey: .updatedAt) + } +} + +struct ArtifactVersionSummary: Codable, Hashable, Sendable { + var number: Int + var author: ArtifactAuthor? + var createdAt: Date + + private enum CodingKeys: String, CodingKey { + case number + case author + case createdAt + } + + func encode(to encoder: any Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(number, forKey: .number) + try container.encode(author, forKey: .author) + try container.encode(createdAt, forKey: .createdAt) + } +} + +enum AssignableWorkspaceRole: RawRepresentable, Codable, Hashable, Sendable, ParameterValue { + case admin + case member + case viewer + /// A value from a newer server than this app knows. + case unknown(String) + + /// Every value this app knows. + static let known: [Self] = [.admin, .member, .viewer] + + init(rawValue: String) { + switch rawValue { + case "admin": self = .admin + case "member": self = .member + case "viewer": self = .viewer + default: self = .unknown(rawValue) + } + } + + var rawValue: String { + switch self { + case .admin: "admin" + case .member: "member" + case .viewer: "viewer" + case let .unknown(value): value + } + } + + init(from decoder: any Decoder) throws { + self.init(rawValue: try decoder.singleValueContainer().decode(String.self)) + } + + func encode(to encoder: any Encoder) throws { + var container = encoder.singleValueContainer() + try container.encode(rawValue) + } +} + +struct BadRequestEncoded: Codable, Hashable, Sendable { + var tag: String = "BadRequest" + var message: String + var details: JSONValue? + var error: ErrorEncoded? + + private enum CodingKeys: String, CodingKey { + case tag = "_tag" + case message + case details + case error + } + + struct ErrorEncoded: Codable, Hashable, Sendable { + var tag: String + var userMessage: String + var isRetryable: Bool + var retryAfterMillis: Double? + + private enum CodingKeys: String, CodingKey { + case tag = "_tag" + case userMessage + case isRetryable + case retryAfterMillis + } + } +} + +struct BotChannel: Codable, Hashable, Sendable { + var kind: String = "bot_channel" + var id: String + var workspaceId: String + var podId: String + var title: String + var createdAt: Date + var updatedAt: Date + var hostAgentId: String +} + +struct BotMove: Codable, Hashable, Sendable { + var from: String + var to: String +} + +struct BotUsage: Codable, Hashable, Sendable { + var agentId: String + var name: String? + var color: AgentColor? + var face: AgentFace? + var shape: AgentShape? + var podName: String? + var usd: Double + var unpricedRequests: Int + + private enum CodingKeys: String, CodingKey { + case agentId + case name + case color + case face + case shape + case podName + case usd + case unpricedRequests + } + + func encode(to encoder: any Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(agentId, forKey: .agentId) + try container.encode(name, forKey: .name) + try container.encode(color, forKey: .color) + try container.encode(face, forKey: .face) + try container.encode(shape, forKey: .shape) + try container.encode(podName, forKey: .podName) + try container.encode(usd, forKey: .usd) + try container.encode(unpricedRequests, forKey: .unpricedRequests) + } +} + +struct BulkProviderModelUpdate: Codable, Hashable, Sendable { + var modelIds: [String] + var enabled: Bool +} + +struct ChatHistoryEntry: Codable, Hashable, Sendable { + var threadId: String + var parentThreadId: String? + var type: CustomerThreadType + var title: String + var participants: [ThreadParticipant] + var status: Status + var routineExecution: RoutineExecutionSummary? + var latestActivityAt: Date + + private enum CodingKeys: String, CodingKey { + case threadId + case parentThreadId + case type + case title + case participants + case status + case routineExecution + case latestActivityAt + } + + func encode(to encoder: any Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(threadId, forKey: .threadId) + try container.encode(parentThreadId, forKey: .parentThreadId) + try container.encode(type, forKey: .type) + try container.encode(title, forKey: .title) + try container.encode(participants, forKey: .participants) + try container.encode(status, forKey: .status) + try container.encode(routineExecution, forKey: .routineExecution) + try container.encode(latestActivityAt, forKey: .latestActivityAt) + } + + enum Status: RawRepresentable, Codable, Hashable, Sendable, ParameterValue { + case queued + case running + case completed + case failed + case cancelled + /// A value from a newer server than this app knows. + case unknown(String) + + /// Every value this app knows. + static let known: [Self] = [.queued, .running, .completed, .failed, .cancelled] + + init(rawValue: String) { + switch rawValue { + case "queued": self = .queued + case "running": self = .running + case "completed": self = .completed + case "failed": self = .failed + case "cancelled": self = .cancelled + default: self = .unknown(rawValue) + } + } + + var rawValue: String { + switch self { + case .queued: "queued" + case .running: "running" + case .completed: "completed" + case .failed: "failed" + case .cancelled: "cancelled" + case let .unknown(value): value + } + } + + init(from decoder: any Decoder) throws { + self.init(rawValue: try decoder.singleValueContainer().decode(String.self)) + } + + func encode(to encoder: any Encoder) throws { + var container = encoder.singleValueContainer() + try container.encode(rawValue) + } + } +} + +struct ChatHistoryPage: Codable, Hashable, Sendable { + var items: [ChatHistoryEntry] + var nextCursor: String? + + private enum CodingKeys: String, CodingKey { + case items + case nextCursor + } + + func encode(to encoder: any Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(items, forKey: .items) + try container.encode(nextCursor, forKey: .nextCursor) + } +} + +struct ChatList: Codable, Hashable, Sendable { + var chats: [Chat] + var channels: [Channel] + var threads: [ChatListItem] + var routines: [ListedRoutine] + + struct Chat: Codable, Hashable, Sendable { + var conversation: PodChat + var unreadMessages: Int + } + + struct Channel: Codable, Hashable, Sendable { + var agent: Agent + var conversation: BotChannel + var unreadMessages: Int + var needsApproval: Bool + var mentionsYou: Bool + } +} + +struct ChatListItem: Codable, Hashable, Sendable { + var agent: Agent? + var conversation: ConversationThread + var lastMessage: LastMessage? + var participants: [ThreadParticipant] + var waitingOn: String? + var unreadMessages: Int + var needsApproval: Bool + var mentionsYou: Bool + + private enum CodingKeys: String, CodingKey { + case agent + case conversation + case lastMessage + case participants + case waitingOn + case unreadMessages + case needsApproval + case mentionsYou + } + + func encode(to encoder: any Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(agent, forKey: .agent) + try container.encode(conversation, forKey: .conversation) + try container.encode(lastMessage, forKey: .lastMessage) + try container.encode(participants, forKey: .participants) + try container.encode(waitingOn, forKey: .waitingOn) + try container.encode(unreadMessages, forKey: .unreadMessages) + try container.encode(needsApproval, forKey: .needsApproval) + try container.encode(mentionsYou, forKey: .mentionsYou) + } + + struct LastMessage: Codable, Hashable, Sendable { + var preview: String + var authorUserId: String? + var at: Date + + private enum CodingKeys: String, CodingKey { + case preview + case authorUserId + case at + } + + func encode(to encoder: any Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(preview, forKey: .preview) + try container.encode(authorUserId, forKey: .authorUserId) + try container.encode(at, forKey: .at) + } + } +} + +enum ChatMessageItem: Codable, Hashable, Sendable { + case message(MessageItem) + case routine(Routine) + case collaboration(Collaboration) + case routinePaused(RoutinePaused) + case thread(Thread) + /// A kind from a newer server than this app knows, by its `kind`. + case unknown(String) + + init(from decoder: any Decoder) throws { + let tag = try decoder.container(keyedBy: AnyCodingKey.self).decode(String.self, forKey: AnyCodingKey("kind")) + switch tag { + case "message": self = .message(try MessageItem(from: decoder)) + case "routine": self = .routine(try Routine(from: decoder)) + case "collaboration": self = .collaboration(try Collaboration(from: decoder)) + case "routine_paused": self = .routinePaused(try RoutinePaused(from: decoder)) + case "thread": self = .thread(try Thread(from: decoder)) + default: self = .unknown(tag) + } + } + + func encode(to encoder: any Encoder) throws { + switch self { + case let .message(value): try value.encode(to: encoder) + case let .routine(value): try value.encode(to: encoder) + case let .collaboration(value): try value.encode(to: encoder) + case let .routinePaused(value): try value.encode(to: encoder) + case let .thread(value): try value.encode(to: encoder) + case let .unknown(tag): + throw EncodingError.invalidValue(tag, .init(codingPath: encoder.codingPath, debugDescription: "A kind this app doesn't know can't be sent.")) + } + } + + struct MessageItem: Codable, Hashable, Sendable { + var kind: String = "message" + var message: Message + } + + struct Routine: Codable, Hashable, Sendable { + var kind: String = "routine" + var id: String + var threadId: String + var routineName: String + var triggerKind: RoutineExecutionTriggerKind + var state: RoutineExecutionState + var error: String? + var report: String? + var createdAt: Date + + private enum CodingKeys: String, CodingKey { + case kind + case id + case threadId + case routineName + case triggerKind + case state + case error + case report + case createdAt + } + + func encode(to encoder: any Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(kind, forKey: .kind) + try container.encode(id, forKey: .id) + try container.encode(threadId, forKey: .threadId) + try container.encode(routineName, forKey: .routineName) + try container.encode(triggerKind, forKey: .triggerKind) + try container.encode(state, forKey: .state) + try container.encode(error, forKey: .error) + try container.encode(report, forKey: .report) + try container.encode(createdAt, forKey: .createdAt) + } + } + + struct Collaboration: Codable, Hashable, Sendable { + var kind: String = "collaboration" + var id: String + var threadId: String + var title: String + var initiator: AgentParticipant + var state: State + var createdAt: Date + + enum State: RawRepresentable, Codable, Hashable, Sendable, ParameterValue { + case running + case done + case failed + /// A value from a newer server than this app knows. + case unknown(String) + + /// Every value this app knows. + static let known: [Self] = [.running, .done, .failed] + + init(rawValue: String) { + switch rawValue { + case "running": self = .running + case "done": self = .done + case "failed": self = .failed + default: self = .unknown(rawValue) + } + } + + var rawValue: String { + switch self { + case .running: "running" + case .done: "done" + case .failed: "failed" + case let .unknown(value): value + } + } + + init(from decoder: any Decoder) throws { + self.init(rawValue: try decoder.singleValueContainer().decode(String.self)) + } + + func encode(to encoder: any Encoder) throws { + var container = encoder.singleValueContainer() + try container.encode(rawValue) + } + } + } + + struct RoutinePaused: Codable, Hashable, Sendable { + var kind: String = "routine_paused" + var id: String + var createdAt: Date + } + + struct Thread: Codable, Hashable, Sendable { + var kind: String = "thread" + var id: String + var threadId: String + var originMessageId: String? + var title: String + var agent: AgentParticipant? + var replies: Int + var lastReplyAt: Date? + var working: Bool + var createdAt: Date + + private enum CodingKeys: String, CodingKey { + case kind + case id + case threadId + case originMessageId + case title + case agent + case replies + case lastReplyAt + case working + case createdAt + } + + func encode(to encoder: any Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(kind, forKey: .kind) + try container.encode(id, forKey: .id) + try container.encode(threadId, forKey: .threadId) + try container.encode(originMessageId, forKey: .originMessageId) + try container.encode(title, forKey: .title) + try container.encode(agent, forKey: .agent) + try container.encode(replies, forKey: .replies) + try container.encode(lastReplyAt, forKey: .lastReplyAt) + try container.encode(working, forKey: .working) + try container.encode(createdAt, forKey: .createdAt) + } + } +} + +struct ChatMessagesPage: Codable, Hashable, Sendable { + var items: [ChatMessageItem] + var nextCursor: String? + + private enum CodingKeys: String, CodingKey { + case items + case nextCursor + } + + func encode(to encoder: any Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(items, forKey: .items) + try container.encode(nextCursor, forKey: .nextCursor) + } +} + +struct CollaborationPart: Codable, Hashable, Sendable { + var type: String = "collaboration" + var id: String + var agentId: String + var agentName: String + var threadId: String + var brief: String + var status: CollaborationStatus + var answer: String? + var atOffset: Int + + private enum CodingKeys: String, CodingKey { + case type + case id + case agentId + case agentName + case threadId + case brief + case status + case answer + case atOffset + } + + func encode(to encoder: any Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(type, forKey: .type) + try container.encode(id, forKey: .id) + try container.encode(agentId, forKey: .agentId) + try container.encode(agentName, forKey: .agentName) + try container.encode(threadId, forKey: .threadId) + try container.encode(brief, forKey: .brief) + try container.encode(status, forKey: .status) + try container.encode(answer, forKey: .answer) + try container.encode(atOffset, forKey: .atOffset) + } +} + +enum CollaborationStatus: RawRepresentable, Codable, Hashable, Sendable, ParameterValue { + case waiting + case pending + case answered + case failed + /// A value from a newer server than this app knows. + case unknown(String) + + /// Every value this app knows. + static let known: [Self] = [.waiting, .pending, .answered, .failed] + + init(rawValue: String) { + switch rawValue { + case "waiting": self = .waiting + case "pending": self = .pending + case "answered": self = .answered + case "failed": self = .failed + default: self = .unknown(rawValue) + } + } + + var rawValue: String { + switch self { + case .waiting: "waiting" + case .pending: "pending" + case .answered: "answered" + case .failed: "failed" + case let .unknown(value): value + } + } + + init(from decoder: any Decoder) throws { + self.init(rawValue: try decoder.singleValueContainer().decode(String.self)) + } + + func encode(to encoder: any Encoder) throws { + var container = encoder.singleValueContainer() + try container.encode(rawValue) + } +} + +struct CompleteOnboarding: Codable, Hashable, Sendable { + var workspaceId: String + var podId: String + var agentId: String +} + +struct ConflictEncoded: Codable, Hashable, Sendable { + var tag: String = "Conflict" + var message: String + var details: JSONValue? + var error: ErrorEncoded? + + private enum CodingKeys: String, CodingKey { + case tag = "_tag" + case message + case details + case error + } + + struct ErrorEncoded: Codable, Hashable, Sendable { + var tag: String + var userMessage: String + var isRetryable: Bool + var retryAfterMillis: Double? + + private enum CodingKeys: String, CodingKey { + case tag = "_tag" + case userMessage + case isRetryable + case retryAfterMillis + } + } +} + +struct ConnectFromCatalog: Codable, Hashable, Sendable { + var name: String + var url: String +} + +struct ConnectFromCatalogResult: Codable, Hashable, Sendable { + var connectionId: String + var authorizationUrl: String +} + +struct Connection: Codable, Hashable, Sendable { + var id: String + var workspaceId: String + var podId: String + var name: String + var handle: String + var kind: ConnectionKind + var url: String + var auth: ConnectionAuth + var signedIn: Bool + var signInExpired: Bool + var secretHeader: String? + var hasSecret: Bool + var appSettingsUrl: String? + var status: ProviderStatus + var toolCounts: ToolAccessCounts + var lastTestedAt: Date? + var lastTestError: String? + var connectedBy: String? + var createdAt: Date + + private enum CodingKeys: String, CodingKey { + case id + case workspaceId + case podId + case name + case handle + case kind + case url + case auth + case signedIn + case signInExpired + case secretHeader + case hasSecret + case appSettingsUrl + case status + case toolCounts + case lastTestedAt + case lastTestError + case connectedBy + case createdAt + } + + func encode(to encoder: any Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(id, forKey: .id) + try container.encode(workspaceId, forKey: .workspaceId) + try container.encode(podId, forKey: .podId) + try container.encode(name, forKey: .name) + try container.encode(handle, forKey: .handle) + try container.encode(kind, forKey: .kind) + try container.encode(url, forKey: .url) + try container.encode(auth, forKey: .auth) + try container.encode(signedIn, forKey: .signedIn) + try container.encode(signInExpired, forKey: .signInExpired) + try container.encode(secretHeader, forKey: .secretHeader) + try container.encode(hasSecret, forKey: .hasSecret) + try container.encode(appSettingsUrl, forKey: .appSettingsUrl) + try container.encode(status, forKey: .status) + try container.encode(toolCounts, forKey: .toolCounts) + try container.encode(lastTestedAt, forKey: .lastTestedAt) + try container.encode(lastTestError, forKey: .lastTestError) + try container.encode(connectedBy, forKey: .connectedBy) + try container.encode(createdAt, forKey: .createdAt) + } +} + +enum ConnectionAccess: RawRepresentable, Codable, Hashable, Sendable, ParameterValue { + case off + case ask + case allow + /// A value from a newer server than this app knows. + case unknown(String) + + /// Every value this app knows. + static let known: [Self] = [.off, .ask, .allow] + + init(rawValue: String) { + switch rawValue { + case "off": self = .off + case "ask": self = .ask + case "allow": self = .allow + default: self = .unknown(rawValue) + } + } + + var rawValue: String { + switch self { + case .off: "off" + case .ask: "ask" + case .allow: "allow" + case let .unknown(value): value + } + } + + init(from decoder: any Decoder) throws { + self.init(rawValue: try decoder.singleValueContainer().decode(String.self)) + } + + func encode(to encoder: any Encoder) throws { + var container = encoder.singleValueContainer() + try container.encode(rawValue) + } +} + +enum ConnectionAuth: RawRepresentable, Codable, Hashable, Sendable, ParameterValue { + case header + case oauth + /// A value from a newer server than this app knows. + case unknown(String) + + /// Every value this app knows. + static let known: [Self] = [.header, .oauth] + + init(rawValue: String) { + switch rawValue { + case "header": self = .header + case "oauth": self = .oauth + default: self = .unknown(rawValue) + } + } + + var rawValue: String { + switch self { + case .header: "header" + case .oauth: "oauth" + case let .unknown(value): value + } + } + + init(from decoder: any Decoder) throws { + self.init(rawValue: try decoder.singleValueContainer().decode(String.self)) + } + + func encode(to encoder: any Encoder) throws { + var container = encoder.singleValueContainer() + try container.encode(rawValue) + } +} + +enum ConnectionKind: RawRepresentable, Codable, Hashable, Sendable, ParameterValue { + case mcp + case github + case http + /// A value from a newer server than this app knows. + case unknown(String) + + /// Every value this app knows. + static let known: [Self] = [.mcp, .github, .http] + + init(rawValue: String) { + switch rawValue { + case "mcp": self = .mcp + case "github": self = .github + case "http": self = .http + default: self = .unknown(rawValue) + } + } + + var rawValue: String { + switch self { + case .mcp: "mcp" + case .github: "github" + case .http: "http" + case let .unknown(value): value + } + } + + init(from decoder: any Decoder) throws { + self.init(rawValue: try decoder.singleValueContainer().decode(String.self)) + } + + func encode(to encoder: any Encoder) throws { + var container = encoder.singleValueContainer() + try container.encode(rawValue) + } +} + +struct ConnectionOauthStart: Codable, Hashable, Sendable { + var authorizationUrl: String? + + private enum CodingKeys: String, CodingKey { + case authorizationUrl + } + + func encode(to encoder: any Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(authorizationUrl, forKey: .authorizationUrl) + } +} + +struct ConnectionRepositories: Codable, Hashable, Sendable { + var account: String? + var repositories: [Repository] + + private enum CodingKeys: String, CodingKey { + case account + case repositories + } + + func encode(to encoder: any Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(account, forKey: .account) + try container.encode(repositories, forKey: .repositories) + } + + struct Repository: Codable, Hashable, Sendable { + var repository: String + var addedByName: String? + var addedAt: Date + + private enum CodingKeys: String, CodingKey { + case repository + case addedByName + case addedAt + } + + func encode(to encoder: any Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(repository, forKey: .repository) + try container.encode(addedByName, forKey: .addedByName) + try container.encode(addedAt, forKey: .addedAt) + } + } +} + +struct ConnectionRepositoryChange: Codable, Hashable, Sendable { + var repository: String +} + +struct ConnectionTestResult: Codable, Hashable, Sendable { + var reachable: Bool + var latencyMs: Int + var tools: Int? + var error: String? +} + +struct ConnectionToolSetting: Codable, Hashable, Sendable { + var name: String + var readOnly: Bool? + var destructive: Bool? + var access: ConnectionAccess + + private enum CodingKeys: String, CodingKey { + case name + case readOnly + case destructive + case access + } + + func encode(to encoder: any Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(name, forKey: .name) + try container.encode(readOnly, forKey: .readOnly) + try container.encode(destructive, forKey: .destructive) + try container.encode(access, forKey: .access) + } +} + +struct ConnectionUpdate: Codable, Hashable, Sendable { + var name: String? + var url: String? + var secretHeader: Omittable = .omitted + var secret: Omittable = .omitted + var access: ConnectionAccess? + var toolAccess: [String: ConnectionAccess]? +} + +struct ConnectionWithTools: Codable, Hashable, Sendable { + var id: String + var workspaceId: String + var podId: String + var name: String + var handle: String + var kind: ConnectionKind + var url: String + var auth: ConnectionAuth + var signedIn: Bool + var signInExpired: Bool + var secretHeader: String? + var hasSecret: Bool + var appSettingsUrl: String? + var status: ProviderStatus + var toolCounts: ToolAccessCounts + var lastTestedAt: Date? + var lastTestError: String? + var connectedBy: String? + var createdAt: Date + var tools: [ConnectionToolSetting] + + private enum CodingKeys: String, CodingKey { + case id + case workspaceId + case podId + case name + case handle + case kind + case url + case auth + case signedIn + case signInExpired + case secretHeader + case hasSecret + case appSettingsUrl + case status + case toolCounts + case lastTestedAt + case lastTestError + case connectedBy + case createdAt + case tools + } + + func encode(to encoder: any Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(id, forKey: .id) + try container.encode(workspaceId, forKey: .workspaceId) + try container.encode(podId, forKey: .podId) + try container.encode(name, forKey: .name) + try container.encode(handle, forKey: .handle) + try container.encode(kind, forKey: .kind) + try container.encode(url, forKey: .url) + try container.encode(auth, forKey: .auth) + try container.encode(signedIn, forKey: .signedIn) + try container.encode(signInExpired, forKey: .signInExpired) + try container.encode(secretHeader, forKey: .secretHeader) + try container.encode(hasSecret, forKey: .hasSecret) + try container.encode(appSettingsUrl, forKey: .appSettingsUrl) + try container.encode(status, forKey: .status) + try container.encode(toolCounts, forKey: .toolCounts) + try container.encode(lastTestedAt, forKey: .lastTestedAt) + try container.encode(lastTestError, forKey: .lastTestError) + try container.encode(connectedBy, forKey: .connectedBy) + try container.encode(createdAt, forKey: .createdAt) + try container.encode(tools, forKey: .tools) + } +} + +struct ConversationThread: Codable, Hashable, Sendable { + var kind: String = "thread" + var id: String + var workspaceId: String + var podId: String + var title: String + var createdAt: Date + var updatedAt: Date + var hostAgentId: String? + var startedInChatId: String? + var doneAt: Date? + + private enum CodingKeys: String, CodingKey { + case kind + case id + case workspaceId + case podId + case title + case createdAt + case updatedAt + case hostAgentId + case startedInChatId + case doneAt + } + + func encode(to encoder: any Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(kind, forKey: .kind) + try container.encode(id, forKey: .id) + try container.encode(workspaceId, forKey: .workspaceId) + try container.encode(podId, forKey: .podId) + try container.encode(title, forKey: .title) + try container.encode(createdAt, forKey: .createdAt) + try container.encode(updatedAt, forKey: .updatedAt) + try container.encode(hostAgentId, forKey: .hostAgentId) + try container.encode(startedInChatId, forKey: .startedInChatId) + try container.encode(doneAt, forKey: .doneAt) + } +} + +enum CustomerThreadType: RawRepresentable, Codable, Hashable, Sendable, ParameterValue { + case collaboration + case routine + /// A value from a newer server than this app knows. + case unknown(String) + + /// Every value this app knows. + static let known: [Self] = [.collaboration, .routine] + + init(rawValue: String) { + switch rawValue { + case "collaboration": self = .collaboration + case "routine": self = .routine + default: self = .unknown(rawValue) + } + } + + var rawValue: String { + switch self { + case .collaboration: "collaboration" + case .routine: "routine" + case let .unknown(value): value + } + } + + init(from decoder: any Decoder) throws { + self.init(rawValue: try decoder.singleValueContainer().decode(String.self)) + } + + func encode(to encoder: any Encoder) throws { + var container = encoder.singleValueContainer() + try container.encode(rawValue) + } +} + +struct DefaultModelUpdate: Codable, Hashable, Sendable { + var model: String +} + +struct FilePart: Codable, Hashable, Sendable { + var type: String = "file" + var id: String + var name: String + var contentType: String + var size: Int +} + +struct ForbiddenEncoded: Codable, Hashable, Sendable { + var tag: String = "Forbidden" + var message: String + var details: JSONValue? + var error: ErrorEncoded? + + private enum CodingKeys: String, CodingKey { + case tag = "_tag" + case message + case details + case error + } + + struct ErrorEncoded: Codable, Hashable, Sendable { + var tag: String + var userMessage: String + var isRetryable: Bool + var retryAfterMillis: Double? + + private enum CodingKeys: String, CodingKey { + case tag = "_tag" + case userMessage + case isRetryable + case retryAfterMillis + } + } +} + +struct GitHubAppForm: Codable, Hashable, Sendable { + var url: String + var manifest: String +} + +struct GitHubAppInstall: Codable, Hashable, Sendable { + var url: String +} + +struct HealthResponse: Codable, Hashable, Sendable { + var status: String = "ok" + var version: String + var commit: String? + + private enum CodingKeys: String, CodingKey { + case status + case version + case commit + } + + func encode(to encoder: any Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(status, forKey: .status) + try container.encode(version, forKey: .version) + try container.encode(commit, forKey: .commit) + } +} + +struct IgnoredRoutineWebhook: Codable, Hashable, Sendable { + var ignored: Bool +} + +struct InternalServerErrorEncoded: Codable, Hashable, Sendable { + var tag: String = "InternalServerError" + var message: String + var details: JSONValue? + var error: ErrorEncoded? + + private enum CodingKeys: String, CodingKey { + case tag = "_tag" + case message + case details + case error + } + + struct ErrorEncoded: Codable, Hashable, Sendable { + var tag: String + var userMessage: String + var isRetryable: Bool + var retryAfterMillis: Double? + + private enum CodingKeys: String, CodingKey { + case tag = "_tag" + case userMessage + case isRetryable + case retryAfterMillis + } + } +} + +enum InvitationPreview: Codable, Hashable, Sendable { + case pending(Pending) + case accepted(Accepted) + /// A kind from a newer server than this app knows, by its `status`. + case unknown(String) + + init(from decoder: any Decoder) throws { + let tag = try decoder.container(keyedBy: AnyCodingKey.self).decode(String.self, forKey: AnyCodingKey("status")) + switch tag { + case "pending": self = .pending(try Pending(from: decoder)) + case "accepted": self = .accepted(try Accepted(from: decoder)) + default: self = .unknown(tag) + } + } + + func encode(to encoder: any Encoder) throws { + switch self { + case let .pending(value): try value.encode(to: encoder) + case let .accepted(value): try value.encode(to: encoder) + case let .unknown(tag): + throw EncodingError.invalidValue(tag, .init(codingPath: encoder.codingPath, debugDescription: "A kind this app doesn't know can't be sent.")) + } + } + + struct Pending: Codable, Hashable, Sendable { + var status: String = "pending" + var workspaceName: String + var inviterName: String + } + + struct Accepted: Codable, Hashable, Sendable { + var status: String = "accepted" + var workspaceId: String + } +} + +struct ListedRoutine: Codable, Hashable, Sendable { + var routine: Routine + var agent: Agent + var conversation: RoutineFeed? + var mentionsYou: Bool + + private enum CodingKeys: String, CodingKey { + case routine + case agent + case conversation + case mentionsYou + } + + func encode(to encoder: any Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(routine, forKey: .routine) + try container.encode(agent, forKey: .agent) + try container.encode(conversation, forKey: .conversation) + try container.encode(mentionsYou, forKey: .mentionsYou) + } + + struct Routine: Codable, Hashable, Sendable { + var id: String + var name: String + var state: RoutineState + var failed: Bool + var pausedAfterFailures: Bool + } +} + +struct ManualRoutineRun: Codable, Hashable, Sendable { + var requestId: String +} + +struct Me: Codable, Hashable, Sendable { + var user: SessionUser + var workspaces: [Workspace] +} + +struct Message: Codable, Hashable, Sendable { + var id: String + var threadId: String + var author: MessageAuthor + var kind: String = "text" + var status: MessageStatus + var parts: [MessagePart] + var content: String + var error: String? + var routineResultOf: RoutineResultOf? + var replyTo: MessageReplyTo? + var reactions: MessageReactions? + var createdAt: Date +} + +enum MessageAuthor: Codable, Hashable, Sendable { + case person(PersonParticipant) + case agent(AgentParticipant) + case routineTrigger(RoutineTriggerAuthor) + /// A kind from a newer server than this app knows, by its `kind`. + case unknown(String) + + init(from decoder: any Decoder) throws { + let tag = try decoder.container(keyedBy: AnyCodingKey.self).decode(String.self, forKey: AnyCodingKey("kind")) + switch tag { + case "person": self = .person(try PersonParticipant(from: decoder)) + case "agent": self = .agent(try AgentParticipant(from: decoder)) + case "routine_trigger": self = .routineTrigger(try RoutineTriggerAuthor(from: decoder)) + default: self = .unknown(tag) + } + } + + func encode(to encoder: any Encoder) throws { + switch self { + case let .person(value): try value.encode(to: encoder) + case let .agent(value): try value.encode(to: encoder) + case let .routineTrigger(value): try value.encode(to: encoder) + case let .unknown(tag): + throw EncodingError.invalidValue(tag, .init(codingPath: encoder.codingPath, debugDescription: "A kind this app doesn't know can't be sent.")) + } + } +} + +enum MessagePart: Codable, Hashable, Sendable { + case text(TextPart) + case collaboration(CollaborationPart) + case toolCall(ToolCallPart) + case file(FilePart) + case artifact(ArtifactPart) + /// A kind from a newer server than this app knows, by its `type`. + case unknown(String) + + init(from decoder: any Decoder) throws { + let tag = try decoder.container(keyedBy: AnyCodingKey.self).decode(String.self, forKey: AnyCodingKey("type")) + switch tag { + case "text": self = .text(try TextPart(from: decoder)) + case "collaboration": self = .collaboration(try CollaborationPart(from: decoder)) + case "tool_call": self = .toolCall(try ToolCallPart(from: decoder)) + case "file": self = .file(try FilePart(from: decoder)) + case "artifact": self = .artifact(try ArtifactPart(from: decoder)) + default: self = .unknown(tag) + } + } + + func encode(to encoder: any Encoder) throws { + switch self { + case let .text(value): try value.encode(to: encoder) + case let .collaboration(value): try value.encode(to: encoder) + case let .toolCall(value): try value.encode(to: encoder) + case let .file(value): try value.encode(to: encoder) + case let .artifact(value): try value.encode(to: encoder) + case let .unknown(tag): + throw EncodingError.invalidValue(tag, .init(codingPath: encoder.codingPath, debugDescription: "A kind this app doesn't know can't be sent.")) + } + } +} + +struct MessageReaction: Codable, Hashable, Sendable { + var emoji: String + var people: [PeopleItem] + + struct PeopleItem: Codable, Hashable, Sendable { + var id: String + var name: String + var at: Date + } +} + +typealias MessageReactions = [MessageReaction] + +struct MessageReplyTo: Codable, Hashable, Sendable { + var id: String + var author: MessageAuthor + var preview: String +} + +enum MessageStatus: RawRepresentable, Codable, Hashable, Sendable, ParameterValue { + case complete + case streaming + case failed + case cancelled + /// A value from a newer server than this app knows. + case unknown(String) + + /// Every value this app knows. + static let known: [Self] = [.complete, .streaming, .failed, .cancelled] + + init(rawValue: String) { + switch rawValue { + case "complete": self = .complete + case "streaming": self = .streaming + case "failed": self = .failed + case "cancelled": self = .cancelled + default: self = .unknown(rawValue) + } + } + + var rawValue: String { + switch self { + case .complete: "complete" + case .streaming: "streaming" + case .failed: "failed" + case .cancelled: "cancelled" + case let .unknown(value): value + } + } + + init(from decoder: any Decoder) throws { + self.init(rawValue: try decoder.singleValueContainer().decode(String.self)) + } + + func encode(to encoder: any Encoder) throws { + var container = encoder.singleValueContainer() + try container.encode(rawValue) + } +} + +struct ModelProvider: Codable, Hashable, Sendable { + var id: String + var workspaceId: String + var preset: ProviderPresetId? + var name: String + var baseUrl: String + var apiFormat: ProviderApiFormat + var active: Bool + var status: ProviderStatus + var hasApiKey: Bool + var signedIn: Bool + var customHeaders: [CustomHeader] + var modelCount: Int + var enabledModelCount: Int + var lastTestedAt: Date? + var lastTestError: String? + var models: [ProviderModel] + + private enum CodingKeys: String, CodingKey { + case id + case workspaceId + case preset + case name + case baseUrl + case apiFormat + case active + case status + case hasApiKey + case signedIn + case customHeaders + case modelCount + case enabledModelCount + case lastTestedAt + case lastTestError + case models + } + + func encode(to encoder: any Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(id, forKey: .id) + try container.encode(workspaceId, forKey: .workspaceId) + try container.encode(preset, forKey: .preset) + try container.encode(name, forKey: .name) + try container.encode(baseUrl, forKey: .baseUrl) + try container.encode(apiFormat, forKey: .apiFormat) + try container.encode(active, forKey: .active) + try container.encode(status, forKey: .status) + try container.encode(hasApiKey, forKey: .hasApiKey) + try container.encode(signedIn, forKey: .signedIn) + try container.encode(customHeaders, forKey: .customHeaders) + try container.encode(modelCount, forKey: .modelCount) + try container.encode(enabledModelCount, forKey: .enabledModelCount) + try container.encode(lastTestedAt, forKey: .lastTestedAt) + try container.encode(lastTestError, forKey: .lastTestError) + try container.encode(models, forKey: .models) + } + + struct CustomHeader: Codable, Hashable, Sendable { + var name: String + } +} + +struct ModelProviderUpdate: Codable, Hashable, Sendable { + var active: Bool? + var baseUrl: String? + var apiFormat: ProviderApiFormat? + var apiKey: Omittable = .omitted + var customHeaders: [ProviderHeader]? +} + +struct ModelTrial: Codable, Hashable, Sendable { + var systemAgentKey: SystemAgentKey + var model: String + var rating: TrialRating + var accuracy: TrialAccuracy + var speed: TrialSpeed + var verdict: [String] + var cases: [TrialCaseResult] +} + +struct ModelUsage: Codable, Hashable, Sendable { + var model: String + var displayName: String? + var providerName: String? + var preset: ProviderPresetId? + var usd: Double + var unpricedRequests: Int + + private enum CodingKeys: String, CodingKey { + case model + case displayName + case providerName + case preset + case usd + case unpricedRequests + } + + func encode(to encoder: any Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(model, forKey: .model) + try container.encode(displayName, forKey: .displayName) + try container.encode(providerName, forKey: .providerName) + try container.encode(preset, forKey: .preset) + try container.encode(usd, forKey: .usd) + try container.encode(unpricedRequests, forKey: .unpricedRequests) + } +} + +struct NewAgentInPod: Codable, Hashable, Sendable { + var name: String + var handle: String? + var description: Omittable = .omitted + var color: AgentColor? + var face: AgentFace? + var shape: AgentShape? + var model: String + var prompt: String? + var disabledTools: [String]? + var usesSandbox: Bool? + var naturalBrowsing: Bool? +} + +struct NewChat: Codable, Hashable, Sendable { + var name: String +} + +enum NewConnection: Codable, Hashable, Sendable { + case http(Http) + case mcp(Mcp) + + init(from decoder: any Decoder) throws { + if let value = try? Http(from: decoder) { self = .http(value); return } + if let value = try? Mcp(from: decoder) { self = .mcp(value); return } + throw DecodingError.dataCorrupted(.init(codingPath: decoder.codingPath, debugDescription: "None of NewConnection's kinds.")) + } + + func encode(to encoder: any Encoder) throws { + switch self { + case let .http(value): try value.encode(to: encoder) + case let .mcp(value): try value.encode(to: encoder) + } + } + + struct Http: Codable, Hashable, Sendable { + var kind: String = "http" + var name: String + var url: String + var secretHeader: String? + var secret: String? + } + + struct Mcp: Codable, Hashable, Sendable { + var kind: String? + var name: String + var url: String + var auth: ConnectionAuth? + var secretHeader: String? + var secret: String? + } +} + +struct NewCustomProvider: Codable, Hashable, Sendable { + var name: String + var baseUrl: String + var apiFormat: ProviderApiFormat + var apiKey: String? + var customHeaders: [CustomHeader]? + + struct CustomHeader: Codable, Hashable, Sendable { + var name: String + var value: String + } +} + +struct NewGitHubApp: Codable, Hashable, Sendable { + var organization: String? +} + +struct NewMessage: Codable, Hashable, Sendable { + var id: String + var message: String + var attachments: [String]? + var replyTo: String? +} + +enum NewModelProvider: Codable, Hashable, Sendable { + case newCustomProvider(NewCustomProvider) + case newProviderFromPreset(NewProviderFromPreset) + + init(from decoder: any Decoder) throws { + if let value = try? NewCustomProvider(from: decoder) { self = .newCustomProvider(value); return } + if let value = try? NewProviderFromPreset(from: decoder) { self = .newProviderFromPreset(value); return } + throw DecodingError.dataCorrupted(.init(codingPath: decoder.codingPath, debugDescription: "None of NewModelProvider's kinds.")) + } + + func encode(to encoder: any Encoder) throws { + switch self { + case let .newCustomProvider(value): try value.encode(to: encoder) + case let .newProviderFromPreset(value): try value.encode(to: encoder) + } + } +} + +struct NewModelTrial: Codable, Hashable, Sendable { + var systemAgentKey: SystemAgentKey + var model: String +} + +struct NewPod: Codable, Hashable, Sendable { + var name: String + var slug: String? + var color: PodColor? +} + +struct NewPodMember: Codable, Hashable, Sendable { + var userId: String +} + +struct NewProviderFromPreset: Codable, Hashable, Sendable { + var preset: ProviderPresetId + var apiKey: String? + var baseUrl: String? +} + +struct NewProviderModel: Codable, Hashable, Sendable { + var modelId: String + var displayName: Omittable = .omitted + var capabilities: [ProviderModelCapability]? + var contextLength: Omittable = .omitted +} + +struct NewRoutine: Codable, Hashable, Sendable { + var name: String + var instructions: String + var state: RoutineState? + var results: RoutineResults? + var chatId: Omittable = .omitted + var triggers: [RoutineTriggerInput] +} + +struct NewSandboxHost: Codable, Hashable, Sendable { + var host: String +} + +struct NewSandboxProvider: Codable, Hashable, Sendable { + var settings: SandboxProviderSettings + var enabled: Bool? + var apiKey: String? +} + +struct NewSearchProvider: Codable, Hashable, Sendable { + var preset: SearchProviderPresetId + var enabled: Bool? + var apiKey: String? + var baseUrl: String? +} + +struct NewThread: Codable, Hashable, Sendable { + var id: String + var message: String + var attachments: [String]? + var hostAgentId: String? + var replyTo: String? +} + +struct NewWorkspace: Codable, Hashable, Sendable { + var name: String + var slug: String + var timeZone: String? +} + +struct NewWorkspaceInvitation: Codable, Hashable, Sendable { + var email: String + var role: AssignableWorkspaceRole + var resend: Bool? +} + +struct NotFoundEncoded: Codable, Hashable, Sendable { + var tag: String = "NotFound" + var message: String + var details: JSONValue? + var error: ErrorEncoded? + + private enum CodingKeys: String, CodingKey { + case tag = "_tag" + case message + case details + case error + } + + struct ErrorEncoded: Codable, Hashable, Sendable { + var tag: String + var userMessage: String + var isRetryable: Bool + var retryAfterMillis: Double? + + private enum CodingKeys: String, CodingKey { + case tag = "_tag" + case userMessage + case isRetryable + case retryAfterMillis + } + } +} + +enum NotificationLevel: RawRepresentable, Codable, Hashable, Sendable, ParameterValue { + case all + case mentions + case nothing + /// A value from a newer server than this app knows. + case unknown(String) + + /// Every value this app knows. + static let known: [Self] = [.all, .mentions, .nothing] + + init(rawValue: String) { + switch rawValue { + case "all": self = .all + case "mentions": self = .mentions + case "nothing": self = .nothing + default: self = .unknown(rawValue) + } + } + + var rawValue: String { + switch self { + case .all: "all" + case .mentions: "mentions" + case .nothing: "nothing" + case let .unknown(value): value + } + } + + init(from decoder: any Decoder) throws { + self.init(rawValue: try decoder.singleValueContainer().decode(String.self)) + } + + func encode(to encoder: any Encoder) throws { + var container = encoder.singleValueContainer() + try container.encode(rawValue) + } +} + +struct NotificationLevelChoice: Codable, Hashable, Sendable { + var level: NotificationLevel? + + private enum CodingKeys: String, CodingKey { + case level + } + + func encode(to encoder: any Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(level, forKey: .level) + } +} + +struct NotificationMute: Codable, Hashable, Sendable { + var until: Date? + + private enum CodingKeys: String, CodingKey { + case until + } + + func encode(to encoder: any Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(until, forKey: .until) + } +} + +enum NotificationPlaceKind: RawRepresentable, Codable, Hashable, Sendable, ParameterValue { + case pod + case bot + /// A value from a newer server than this app knows. + case unknown(String) + + /// Every value this app knows. + static let known: [Self] = [.pod, .bot] + + init(rawValue: String) { + switch rawValue { + case "pod": self = .pod + case "bot": self = .bot + default: self = .unknown(rawValue) + } + } + + var rawValue: String { + switch self { + case .pod: "pod" + case .bot: "bot" + case let .unknown(value): value + } + } + + init(from decoder: any Decoder) throws { + self.init(rawValue: try decoder.singleValueContainer().decode(String.self)) + } + + func encode(to encoder: any Encoder) throws { + var container = encoder.singleValueContainer() + try container.encode(rawValue) + } +} + +struct NotificationPreferences: Codable, Hashable, Sendable { + var level: NotificationLevel + var pausedUntil: Date? + var quietHours: QuietHours? + var turnFailures: Bool + var routineRuns: RoutineRunNotifications + + private enum CodingKeys: String, CodingKey { + case level + case pausedUntil + case quietHours + case turnFailures + case routineRuns + } + + func encode(to encoder: any Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(level, forKey: .level) + try container.encode(pausedUntil, forKey: .pausedUntil) + try container.encode(quietHours, forKey: .quietHours) + try container.encode(turnFailures, forKey: .turnFailures) + try container.encode(routineRuns, forKey: .routineRuns) + } +} + +struct NotificationSettings: Codable, Hashable, Sendable { + var level: NotificationLevel + var pausedUntil: Date? + var quietHours: QuietHours? + var turnFailures: Bool + var routineRuns: RoutineRunNotifications + var pods: [String: NotificationLevel] + var bots: [String: NotificationLevel] + var mutedUntil: MutedUntil + + private enum CodingKeys: String, CodingKey { + case level + case pausedUntil + case quietHours + case turnFailures + case routineRuns + case pods + case bots + case mutedUntil + } + + func encode(to encoder: any Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(level, forKey: .level) + try container.encode(pausedUntil, forKey: .pausedUntil) + try container.encode(quietHours, forKey: .quietHours) + try container.encode(turnFailures, forKey: .turnFailures) + try container.encode(routineRuns, forKey: .routineRuns) + try container.encode(pods, forKey: .pods) + try container.encode(bots, forKey: .bots) + try container.encode(mutedUntil, forKey: .mutedUntil) + } + + struct MutedUntil: Codable, Hashable, Sendable { + var pods: [String: Date] + var bots: [String: Date] + } +} + +struct OpenBotChannel: Codable, Hashable, Sendable { + var podId: String + var hostAgentId: String +} + +struct OwnershipTransfer: Codable, Hashable, Sendable { + var memberId: String +} + +struct PayloadTooLargeEncoded: Codable, Hashable, Sendable { + var tag: String = "PayloadTooLarge" + var message: String + var details: JSONValue? + var error: ErrorEncoded? + + private enum CodingKeys: String, CodingKey { + case tag = "_tag" + case message + case details + case error + } + + struct ErrorEncoded: Codable, Hashable, Sendable { + var tag: String + var userMessage: String + var isRetryable: Bool + var retryAfterMillis: Double? + + private enum CodingKeys: String, CodingKey { + case tag = "_tag" + case userMessage + case isRetryable + case retryAfterMillis + } + } +} + +struct PersonParticipant: Codable, Hashable, Sendable { + var kind: String = "person" + var id: String + var name: String + var email: String + var handle: String + var image: String? + + private enum CodingKeys: String, CodingKey { + case kind + case id + case name + case email + case handle + case image + } + + func encode(to encoder: any Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(kind, forKey: .kind) + try container.encode(id, forKey: .id) + try container.encode(name, forKey: .name) + try container.encode(email, forKey: .email) + try container.encode(handle, forKey: .handle) + try container.encode(image, forKey: .image) + } +} + +enum PersonUpdateEvent: Codable, Hashable, Sendable { + case notification(Notification) + case presence(Presence) + case reset(Reset) + /// A kind from a newer server than this app knows, by its `type`. + case unknown(String) + + init(from decoder: any Decoder) throws { + let tag = try decoder.container(keyedBy: AnyCodingKey.self).decode(String.self, forKey: AnyCodingKey("type")) + switch tag { + case "notification": self = .notification(try Notification(from: decoder)) + case "presence": self = .presence(try Presence(from: decoder)) + case "reset": self = .reset(try Reset(from: decoder)) + default: self = .unknown(tag) + } + } + + func encode(to encoder: any Encoder) throws { + switch self { + case let .notification(value): try value.encode(to: encoder) + case let .presence(value): try value.encode(to: encoder) + case let .reset(value): try value.encode(to: encoder) + case let .unknown(tag): + throw EncodingError.invalidValue(tag, .init(codingPath: encoder.codingPath, debugDescription: "A kind this app doesn't know can't be sent.")) + } + } + + struct Notification: Codable, Hashable, Sendable { + var v: Int = 1 + var type: String = "notification" + var title: String + var body: String + var tag: String + var path: String + var conversationId: String? + + private enum CodingKeys: String, CodingKey { + case v + case type + case title + case body + case tag + case path + case conversationId + } + + func encode(to encoder: any Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(v, forKey: .v) + try container.encode(type, forKey: .type) + try container.encode(title, forKey: .title) + try container.encode(body, forKey: .body) + try container.encode(tag, forKey: .tag) + try container.encode(path, forKey: .path) + try container.encode(conversationId, forKey: .conversationId) + } + } + + struct Presence: Codable, Hashable, Sendable { + var v: Int = 1 + var type: String = "presence" + var clientId: String + var conversationId: String? + var sequence: Int + + private enum CodingKeys: String, CodingKey { + case v + case type + case clientId + case conversationId + case sequence + } + + func encode(to encoder: any Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(v, forKey: .v) + try container.encode(type, forKey: .type) + try container.encode(clientId, forKey: .clientId) + try container.encode(conversationId, forKey: .conversationId) + try container.encode(sequence, forKey: .sequence) + } + } + + struct Reset: Codable, Hashable, Sendable { + var v: Int = 1 + var type: String = "reset" + } +} + +struct Pod: Codable, Hashable, Sendable { + var id: String + var workspaceId: String + var ownerId: String? + var kind: Kind + var name: String + var slug: String + var color: PodColor? + var permissions: PodPermissions + var createdAt: Date + + private enum CodingKeys: String, CodingKey { + case id + case workspaceId + case ownerId + case kind + case name + case slug + case color + case permissions + case createdAt + } + + func encode(to encoder: any Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(id, forKey: .id) + try container.encode(workspaceId, forKey: .workspaceId) + try container.encode(ownerId, forKey: .ownerId) + try container.encode(kind, forKey: .kind) + try container.encode(name, forKey: .name) + try container.encode(slug, forKey: .slug) + try container.encode(color, forKey: .color) + try container.encode(permissions, forKey: .permissions) + try container.encode(createdAt, forKey: .createdAt) + } + + enum Kind: RawRepresentable, Codable, Hashable, Sendable, ParameterValue { + case personal + case shared + /// A value from a newer server than this app knows. + case unknown(String) + + /// Every value this app knows. + static let known: [Self] = [.personal, .shared] + + init(rawValue: String) { + switch rawValue { + case "personal": self = .personal + case "shared": self = .shared + default: self = .unknown(rawValue) + } + } + + var rawValue: String { + switch self { + case .personal: "personal" + case .shared: "shared" + case let .unknown(value): value + } + } + + init(from decoder: any Decoder) throws { + self.init(rawValue: try decoder.singleValueContainer().decode(String.self)) + } + + func encode(to encoder: any Encoder) throws { + var container = encoder.singleValueContainer() + try container.encode(rawValue) + } + } +} + +struct PodChat: Codable, Hashable, Sendable { + var kind: String = "pod_chat" + var id: String + var workspaceId: String + var podId: String + var title: String + var createdAt: Date + var updatedAt: Date + var main: Bool + var archivedAt: Date? + + private enum CodingKeys: String, CodingKey { + case kind + case id + case workspaceId + case podId + case title + case createdAt + case updatedAt + case main + case archivedAt + } + + func encode(to encoder: any Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(kind, forKey: .kind) + try container.encode(id, forKey: .id) + try container.encode(workspaceId, forKey: .workspaceId) + try container.encode(podId, forKey: .podId) + try container.encode(title, forKey: .title) + try container.encode(createdAt, forKey: .createdAt) + try container.encode(updatedAt, forKey: .updatedAt) + try container.encode(main, forKey: .main) + try container.encode(archivedAt, forKey: .archivedAt) + } +} + +struct PodChatMarkers: Codable, Hashable, Sendable { + var pods: [String: Pod] + + struct Pod: Codable, Hashable, Sendable { + var unreadMessages: Int + var needsApproval: Bool + var failedRoutines: Int + } +} + +enum PodColor: RawRepresentable, Codable, Hashable, Sendable, ParameterValue { + case green + case blue + case plum + case amber + case teal + case purple + case rose + case orange + /// A value from a newer server than this app knows. + case unknown(String) + + /// Every value this app knows. + static let known: [Self] = [.green, .blue, .plum, .amber, .teal, .purple, .rose, .orange] + + init(rawValue: String) { + switch rawValue { + case "green": self = .green + case "blue": self = .blue + case "plum": self = .plum + case "amber": self = .amber + case "teal": self = .teal + case "purple": self = .purple + case "rose": self = .rose + case "orange": self = .orange + default: self = .unknown(rawValue) + } + } + + var rawValue: String { + switch self { + case .green: "green" + case .blue: "blue" + case .plum: "plum" + case .amber: "amber" + case .teal: "teal" + case .purple: "purple" + case .rose: "rose" + case .orange: "orange" + case let .unknown(value): value + } + } + + init(from decoder: any Decoder) throws { + self.init(rawValue: try decoder.singleValueContainer().decode(String.self)) + } + + func encode(to encoder: any Encoder) throws { + var container = encoder.singleValueContainer() + try container.encode(rawValue) + } +} + +struct PodMember: Codable, Hashable, Sendable { + var userId: String + var name: String + var email: String + var image: String? + var addedAt: Date + var removable: Bool + + private enum CodingKeys: String, CodingKey { + case userId + case name + case email + case image + case addedAt + case removable + } + + func encode(to encoder: any Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(userId, forKey: .userId) + try container.encode(name, forKey: .name) + try container.encode(email, forKey: .email) + try container.encode(image, forKey: .image) + try container.encode(addedAt, forKey: .addedAt) + try container.encode(removable, forKey: .removable) + } +} + +struct PodPermissions: Codable, Hashable, Sendable { + var rename: Bool + var manageMembers: Bool + var leave: Bool + var createAgents: Bool + var updateAgents: Bool + var deleteAgents: Bool + var manageConnections: Bool + var manageSandbox: Bool + var useDesktops: Bool + var manageRoutines: Bool + var runRoutines: Bool + var deleteArtifacts: Bool +} + +struct PodSandbox: Codable, Hashable, Sendable { + var sandbox: PodSandboxState + var providerEnabled: Bool + var canManage: Bool +} + +struct PodSandboxDisk: Codable, Hashable, Sendable { + var podId: String + var disk: SandboxDisk +} + +struct PodSandboxNetwork: Codable, Hashable, Sendable { + var mode: SandboxNetworkMode + var blocking: Bool + var workspaceHosts: [WorkspaceHost] + var addedHosts: [AddedHost] + + struct WorkspaceHost: Codable, Hashable, Sendable { + var host: String + var blockedBy: String? + + private enum CodingKeys: String, CodingKey { + case host + case blockedBy + } + + func encode(to encoder: any Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(host, forKey: .host) + try container.encode(blockedBy, forKey: .blockedBy) + } + } + + struct AddedHost: Codable, Hashable, Sendable { + var host: String + var addedByName: String? + var addedAt: Date + var blockedBy: String? + + private enum CodingKeys: String, CodingKey { + case host + case addedByName + case addedAt + case blockedBy + } + + func encode(to encoder: any Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(host, forKey: .host) + try container.encode(addedByName, forKey: .addedByName) + try container.encode(addedAt, forKey: .addedAt) + try container.encode(blockedBy, forKey: .blockedBy) + } + } +} + +enum PodSandboxState: Codable, Hashable, Sendable { + case none(NoneState) + case present(Present) + /// A kind from a newer server than this app knows, by its `kind`. + case unknown(String) + + init(from decoder: any Decoder) throws { + let tag = try decoder.container(keyedBy: AnyCodingKey.self).decode(String.self, forKey: AnyCodingKey("kind")) + switch tag { + case "none": self = .none(try NoneState(from: decoder)) + case "present": self = .present(try Present(from: decoder)) + default: self = .unknown(tag) + } + } + + func encode(to encoder: any Encoder) throws { + switch self { + case let .none(value): try value.encode(to: encoder) + case let .present(value): try value.encode(to: encoder) + case let .unknown(tag): + throw EncodingError.invalidValue(tag, .init(codingPath: encoder.codingPath, debugDescription: "A kind this app doesn't know can't be sent.")) + } + } + + struct NoneState: Codable, Hashable, Sendable { + var kind: String = "none" + } + + struct Present: Codable, Hashable, Sendable { + var kind: String = "present" + var state: State + var image: String? + var providerName: String + var createdAt: Date + var lastUsedAt: Date + var turnsUsing: Int + var peopleWatching: Int + var upgradeAvailable: Bool + var disk: SandboxDisk? + + private enum CodingKeys: String, CodingKey { + case kind + case state + case image + case providerName + case createdAt + case lastUsedAt + case turnsUsing + case peopleWatching + case upgradeAvailable + case disk + } + + func encode(to encoder: any Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(kind, forKey: .kind) + try container.encode(state, forKey: .state) + try container.encode(image, forKey: .image) + try container.encode(providerName, forKey: .providerName) + try container.encode(createdAt, forKey: .createdAt) + try container.encode(lastUsedAt, forKey: .lastUsedAt) + try container.encode(turnsUsing, forKey: .turnsUsing) + try container.encode(peopleWatching, forKey: .peopleWatching) + try container.encode(upgradeAvailable, forKey: .upgradeAvailable) + try container.encode(disk, forKey: .disk) + } + + enum State: RawRepresentable, Codable, Hashable, Sendable, ParameterValue { + case running + case paused + case lost + case unreachable + /// A value from a newer server than this app knows. + case unknown(String) + + /// Every value this app knows. + static let known: [Self] = [.running, .paused, .lost, .unreachable] + + init(rawValue: String) { + switch rawValue { + case "running": self = .running + case "paused": self = .paused + case "lost": self = .lost + case "unreachable": self = .unreachable + default: self = .unknown(rawValue) + } + } + + var rawValue: String { + switch self { + case .running: "running" + case .paused: "paused" + case .lost: "lost" + case .unreachable: "unreachable" + case let .unknown(value): value + } + } + + init(from decoder: any Decoder) throws { + self.init(rawValue: try decoder.singleValueContainer().decode(String.self)) + } + + func encode(to encoder: any Encoder) throws { + var container = encoder.singleValueContainer() + try container.encode(rawValue) + } + } + } +} + +struct PodUpdate: Codable, Hashable, Sendable { + var name: String? + var slug: Omittable = .omitted + var color: Omittable = .omitted +} + +struct PodUsage: Codable, Hashable, Sendable { + var podId: String + var name: String? + var color: PodColor? + var botCount: Int + var usd: Double + var unpricedRequests: Int + + private enum CodingKeys: String, CodingKey { + case podId + case name + case color + case botCount + case usd + case unpricedRequests + } + + func encode(to encoder: any Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(podId, forKey: .podId) + try container.encode(name, forKey: .name) + try container.encode(color, forKey: .color) + try container.encode(botCount, forKey: .botCount) + try container.encode(usd, forKey: .usd) + try container.encode(unpricedRequests, forKey: .unpricedRequests) + } +} + +struct Presence: Codable, Hashable, Sendable { + var clientId: String + var conversationId: String? + var sequence: Int + + private enum CodingKeys: String, CodingKey { + case clientId + case conversationId + case sequence + } + + func encode(to encoder: any Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(clientId, forKey: .clientId) + try container.encode(conversationId, forKey: .conversationId) + try container.encode(sequence, forKey: .sequence) + } +} + +enum ProviderApiFormat: RawRepresentable, Codable, Hashable, Sendable, ParameterValue { + case openai + case anthropic + /// A value from a newer server than this app knows. + case unknown(String) + + /// Every value this app knows. + static let known: [Self] = [.openai, .anthropic] + + init(rawValue: String) { + switch rawValue { + case "openai": self = .openai + case "anthropic": self = .anthropic + default: self = .unknown(rawValue) + } + } + + var rawValue: String { + switch self { + case .openai: "openai" + case .anthropic: "anthropic" + case let .unknown(value): value + } + } + + init(from decoder: any Decoder) throws { + self.init(rawValue: try decoder.singleValueContainer().decode(String.self)) + } + + func encode(to encoder: any Encoder) throws { + var container = encoder.singleValueContainer() + try container.encode(rawValue) + } +} + +struct ProviderFetchResult: Codable, Hashable, Sendable { + var added: Int + var updated: Int + var unchanged: Int +} + +struct ProviderHeader: Codable, Hashable, Sendable { + var name: String + var value: String +} + +struct ProviderModel: Codable, Hashable, Sendable { + var id: String + var modelId: String + var displayName: String? + var capabilities: [ProviderModelCapability] + var disabledCapabilities: [ProviderModelCapability] + var contextLength: Int? + var enabled: Bool + var source: Source + + private enum CodingKeys: String, CodingKey { + case id + case modelId + case displayName + case capabilities + case disabledCapabilities + case contextLength + case enabled + case source + } + + func encode(to encoder: any Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(id, forKey: .id) + try container.encode(modelId, forKey: .modelId) + try container.encode(displayName, forKey: .displayName) + try container.encode(capabilities, forKey: .capabilities) + try container.encode(disabledCapabilities, forKey: .disabledCapabilities) + try container.encode(contextLength, forKey: .contextLength) + try container.encode(enabled, forKey: .enabled) + try container.encode(source, forKey: .source) + } + + enum Source: RawRepresentable, Codable, Hashable, Sendable, ParameterValue { + case fetched + case manual + /// A value from a newer server than this app knows. + case unknown(String) + + /// Every value this app knows. + static let known: [Self] = [.fetched, .manual] + + init(rawValue: String) { + switch rawValue { + case "fetched": self = .fetched + case "manual": self = .manual + default: self = .unknown(rawValue) + } + } + + var rawValue: String { + switch self { + case .fetched: "fetched" + case .manual: "manual" + case let .unknown(value): value + } + } + + init(from decoder: any Decoder) throws { + self.init(rawValue: try decoder.singleValueContainer().decode(String.self)) + } + + func encode(to encoder: any Encoder) throws { + var container = encoder.singleValueContainer() + try container.encode(rawValue) + } + } +} + +enum ProviderModelCapability: RawRepresentable, Codable, Hashable, Sendable, ParameterValue { + case tools + case vision + case images + case audio + case embeddings + case reasoning + /// A value from a newer server than this app knows. + case unknown(String) + + /// Every value this app knows. + static let known: [Self] = [.tools, .vision, .images, .audio, .embeddings, .reasoning] + + init(rawValue: String) { + switch rawValue { + case "tools": self = .tools + case "vision": self = .vision + case "images": self = .images + case "audio": self = .audio + case "embeddings": self = .embeddings + case "reasoning": self = .reasoning + default: self = .unknown(rawValue) + } + } + + var rawValue: String { + switch self { + case .tools: "tools" + case .vision: "vision" + case .images: "images" + case .audio: "audio" + case .embeddings: "embeddings" + case .reasoning: "reasoning" + case let .unknown(value): value + } + } + + init(from decoder: any Decoder) throws { + self.init(rawValue: try decoder.singleValueContainer().decode(String.self)) + } + + func encode(to encoder: any Encoder) throws { + var container = encoder.singleValueContainer() + try container.encode(rawValue) + } +} + +struct ProviderModelSwitchOff: Codable, Hashable, Sendable { + var moveBotsTo: String? + var newBotsTo: String? + var summariesTo: String? +} + +struct ProviderModelUpdate: Codable, Hashable, Sendable { + var enabled: Bool? + var disabledCapabilities: [ProviderModelCapability]? + var capabilities: [ProviderModelCapability]? +} + +enum ProviderPresetId: RawRepresentable, Codable, Hashable, Sendable, ParameterValue { + case anthropic + case openai + case chatgpt + case openrouter + case gemini + case groq + case xai + case supergrok + case mistral + case deepseek + case together + case fireworks + case cerebras + case ollama + case lmstudio + case llamacpp + case vllm + /// A value from a newer server than this app knows. + case unknown(String) + + /// Every value this app knows. + static let known: [Self] = [.anthropic, .openai, .chatgpt, .openrouter, .gemini, .groq, .xai, .supergrok, .mistral, .deepseek, .together, .fireworks, .cerebras, .ollama, .lmstudio, .llamacpp, .vllm] + + init(rawValue: String) { + switch rawValue { + case "anthropic": self = .anthropic + case "openai": self = .openai + case "chatgpt": self = .chatgpt + case "openrouter": self = .openrouter + case "gemini": self = .gemini + case "groq": self = .groq + case "xai": self = .xai + case "supergrok": self = .supergrok + case "mistral": self = .mistral + case "deepseek": self = .deepseek + case "together": self = .together + case "fireworks": self = .fireworks + case "cerebras": self = .cerebras + case "ollama": self = .ollama + case "lmstudio": self = .lmstudio + case "llamacpp": self = .llamacpp + case "vllm": self = .vllm + default: self = .unknown(rawValue) + } + } + + var rawValue: String { + switch self { + case .anthropic: "anthropic" + case .openai: "openai" + case .chatgpt: "chatgpt" + case .openrouter: "openrouter" + case .gemini: "gemini" + case .groq: "groq" + case .xai: "xai" + case .supergrok: "supergrok" + case .mistral: "mistral" + case .deepseek: "deepseek" + case .together: "together" + case .fireworks: "fireworks" + case .cerebras: "cerebras" + case .ollama: "ollama" + case .lmstudio: "lmstudio" + case .llamacpp: "llamacpp" + case .vllm: "vllm" + case let .unknown(value): value + } + } + + init(from decoder: any Decoder) throws { + self.init(rawValue: try decoder.singleValueContainer().decode(String.self)) + } + + func encode(to encoder: any Encoder) throws { + var container = encoder.singleValueContainer() + try container.encode(rawValue) + } +} + +struct ProviderSignInCompletion: Codable, Hashable, Sendable { + var attempt: String +} + +enum ProviderSignInOutcome: Codable, Hashable, Sendable { + case pending(Pending) + case signedIn(SignedIn) + /// A kind from a newer server than this app knows, by its `status`. + case unknown(String) + + init(from decoder: any Decoder) throws { + let tag = try decoder.container(keyedBy: AnyCodingKey.self).decode(String.self, forKey: AnyCodingKey("status")) + switch tag { + case "pending": self = .pending(try Pending(from: decoder)) + case "signed_in": self = .signedIn(try SignedIn(from: decoder)) + default: self = .unknown(tag) + } + } + + func encode(to encoder: any Encoder) throws { + switch self { + case let .pending(value): try value.encode(to: encoder) + case let .signedIn(value): try value.encode(to: encoder) + case let .unknown(tag): + throw EncodingError.invalidValue(tag, .init(codingPath: encoder.codingPath, debugDescription: "A kind this app doesn't know can't be sent.")) + } + } + + struct Pending: Codable, Hashable, Sendable { + var status: String = "pending" + } + + struct SignedIn: Codable, Hashable, Sendable { + var status: String = "signed_in" + var provider: ModelProvider + } +} + +struct ProviderSignInStarted: Codable, Hashable, Sendable { + var verificationUrl: String + var userCode: String + var attempt: String + var pollIntervalMs: Int + var expiresAt: Date +} + +enum ProviderStatus: RawRepresentable, Codable, Hashable, Sendable, ParameterValue { + case missingKey + case signedOut + case untested + case connected + case error + /// A value from a newer server than this app knows. + case unknown(String) + + /// Every value this app knows. + static let known: [Self] = [.missingKey, .signedOut, .untested, .connected, .error] + + init(rawValue: String) { + switch rawValue { + case "missing_key": self = .missingKey + case "signed_out": self = .signedOut + case "untested": self = .untested + case "connected": self = .connected + case "error": self = .error + default: self = .unknown(rawValue) + } + } + + var rawValue: String { + switch self { + case .missingKey: "missing_key" + case .signedOut: "signed_out" + case .untested: "untested" + case .connected: "connected" + case .error: "error" + case let .unknown(value): value + } + } + + init(from decoder: any Decoder) throws { + self.init(rawValue: try decoder.singleValueContainer().decode(String.self)) + } + + func encode(to encoder: any Encoder) throws { + var container = encoder.singleValueContainer() + try container.encode(rawValue) + } +} + +struct ProviderSwitchOff: Codable, Hashable, Sendable { + var moveBots: [BotMove] + var newBotsTo: String? + var summariesTo: String? +} + +struct ProviderTestResult: Codable, Hashable, Sendable { + var reachable: Bool + var latencyMs: Int + var error: String? +} + +struct QuietHours: Codable, Hashable, Sendable { + var from: String + var to: String + var timeZone: String +} + +struct ReferralLink: Codable, Hashable, Sendable { + var url: String? + + private enum CodingKeys: String, CodingKey { + case url + } + + func encode(to encoder: any Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(url, forKey: .url) + } +} + +enum RepositoryEvent: RawRepresentable, Codable, Hashable, Sendable, ParameterValue { + case pullRequestOpened + case pullRequestReview + case pullRequestComment + case issueOpened + case issueComment + case checksFailed + case push + /// A value from a newer server than this app knows. + case unknown(String) + + /// Every value this app knows. + static let known: [Self] = [.pullRequestOpened, .pullRequestReview, .pullRequestComment, .issueOpened, .issueComment, .checksFailed, .push] + + init(rawValue: String) { + switch rawValue { + case "pull_request_opened": self = .pullRequestOpened + case "pull_request_review": self = .pullRequestReview + case "pull_request_comment": self = .pullRequestComment + case "issue_opened": self = .issueOpened + case "issue_comment": self = .issueComment + case "checks_failed": self = .checksFailed + case "push": self = .push + default: self = .unknown(rawValue) + } + } + + var rawValue: String { + switch self { + case .pullRequestOpened: "pull_request_opened" + case .pullRequestReview: "pull_request_review" + case .pullRequestComment: "pull_request_comment" + case .issueOpened: "issue_opened" + case .issueComment: "issue_comment" + case .checksFailed: "checks_failed" + case .push: "push" + case let .unknown(value): value + } + } + + init(from decoder: any Decoder) throws { + self.init(rawValue: try decoder.singleValueContainer().decode(String.self)) + } + + func encode(to encoder: any Encoder) throws { + var container = encoder.singleValueContainer() + try container.encode(rawValue) + } +} + +struct ResetReferralLink: Codable, Hashable, Sendable { + var url: String +} + +struct Routine: Codable, Hashable, Sendable { + var id: String + var workspaceId: String + var agentId: String + var name: String + var instructions: String + var triggers: [RoutineTrigger] + var state: RoutineState + var results: RoutineResults + var chatId: String? + var createdById: String? + var createdByAgentId: String? + var createdAt: Date + var updatedAt: Date + + private enum CodingKeys: String, CodingKey { + case id + case workspaceId + case agentId + case name + case instructions + case triggers + case state + case results + case chatId + case createdById + case createdByAgentId + case createdAt + case updatedAt + } + + func encode(to encoder: any Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(id, forKey: .id) + try container.encode(workspaceId, forKey: .workspaceId) + try container.encode(agentId, forKey: .agentId) + try container.encode(name, forKey: .name) + try container.encode(instructions, forKey: .instructions) + try container.encode(triggers, forKey: .triggers) + try container.encode(state, forKey: .state) + try container.encode(results, forKey: .results) + try container.encode(chatId, forKey: .chatId) + try container.encode(createdById, forKey: .createdById) + try container.encode(createdByAgentId, forKey: .createdByAgentId) + try container.encode(createdAt, forKey: .createdAt) + try container.encode(updatedAt, forKey: .updatedAt) + } +} + +enum RoutineCurrentSecret: Codable, Hashable, Sendable { + case set(SetSecret) + case none(NoneSecret) + case hashed(Hashed) + /// A kind from a newer server than this app knows, by its `kind`. + case unknown(String) + + init(from decoder: any Decoder) throws { + let tag = try decoder.container(keyedBy: AnyCodingKey.self).decode(String.self, forKey: AnyCodingKey("kind")) + switch tag { + case "set": self = .set(try SetSecret(from: decoder)) + case "none": self = .none(try NoneSecret(from: decoder)) + case "hashed": self = .hashed(try Hashed(from: decoder)) + default: self = .unknown(tag) + } + } + + func encode(to encoder: any Encoder) throws { + switch self { + case let .set(value): try value.encode(to: encoder) + case let .none(value): try value.encode(to: encoder) + case let .hashed(value): try value.encode(to: encoder) + case let .unknown(tag): + throw EncodingError.invalidValue(tag, .init(codingPath: encoder.codingPath, debugDescription: "A kind this app doesn't know can't be sent.")) + } + } + + struct SetSecret: Codable, Hashable, Sendable { + var kind: String = "set" + var secret: String + } + + struct NoneSecret: Codable, Hashable, Sendable { + var kind: String = "none" + } + + struct Hashed: Codable, Hashable, Sendable { + var kind: String = "hashed" + } +} + +struct RoutineExecution: Codable, Hashable, Sendable { + var id: String + var routineId: String + var workspaceId: String + var agentId: String + var threadId: String + var conversationId: String + var routineName: String + var instructions: String + var trigger: RoutineExecutionTrigger + var state: RoutineExecutionState + var error: String? + var acceptedAt: Date + var startedAt: Date? + var finishedAt: Date? + + private enum CodingKeys: String, CodingKey { + case id + case routineId + case workspaceId + case agentId + case threadId + case conversationId + case routineName + case instructions + case trigger + case state + case error + case acceptedAt + case startedAt + case finishedAt + } + + func encode(to encoder: any Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(id, forKey: .id) + try container.encode(routineId, forKey: .routineId) + try container.encode(workspaceId, forKey: .workspaceId) + try container.encode(agentId, forKey: .agentId) + try container.encode(threadId, forKey: .threadId) + try container.encode(conversationId, forKey: .conversationId) + try container.encode(routineName, forKey: .routineName) + try container.encode(instructions, forKey: .instructions) + try container.encode(trigger, forKey: .trigger) + try container.encode(state, forKey: .state) + try container.encode(error, forKey: .error) + try container.encode(acceptedAt, forKey: .acceptedAt) + try container.encode(startedAt, forKey: .startedAt) + try container.encode(finishedAt, forKey: .finishedAt) + } +} + +struct RoutineExecutionPage: Codable, Hashable, Sendable { + var items: [RoutineExecution] + var nextCursor: String? + + private enum CodingKeys: String, CodingKey { + case items + case nextCursor + } + + func encode(to encoder: any Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(items, forKey: .items) + try container.encode(nextCursor, forKey: .nextCursor) + } +} + +enum RoutineExecutionState: RawRepresentable, Codable, Hashable, Sendable, ParameterValue { + case queued + case running + case completed + case failed + case cancelled + /// A value from a newer server than this app knows. + case unknown(String) + + /// Every value this app knows. + static let known: [Self] = [.queued, .running, .completed, .failed, .cancelled] + + init(rawValue: String) { + switch rawValue { + case "queued": self = .queued + case "running": self = .running + case "completed": self = .completed + case "failed": self = .failed + case "cancelled": self = .cancelled + default: self = .unknown(rawValue) + } + } + + var rawValue: String { + switch self { + case .queued: "queued" + case .running: "running" + case .completed: "completed" + case .failed: "failed" + case .cancelled: "cancelled" + case let .unknown(value): value + } + } + + init(from decoder: any Decoder) throws { + self.init(rawValue: try decoder.singleValueContainer().decode(String.self)) + } + + func encode(to encoder: any Encoder) throws { + var container = encoder.singleValueContainer() + try container.encode(rawValue) + } +} + +struct RoutineExecutionSummary: Codable, Hashable, Sendable { + var executionId: String + var routineId: String + var routineName: String + var triggerKind: RoutineExecutionTriggerKind + var triggeredAt: Date +} + +enum RoutineExecutionTrigger: Codable, Hashable, Sendable { + case cron(Cron) + case webhook(Webhook) + case github(Github) + case manual(Manual) + /// A kind from a newer server than this app knows, by its `kind`. + case unknown(String) + + init(from decoder: any Decoder) throws { + let tag = try decoder.container(keyedBy: AnyCodingKey.self).decode(String.self, forKey: AnyCodingKey("kind")) + switch tag { + case "cron": self = .cron(try Cron(from: decoder)) + case "webhook": self = .webhook(try Webhook(from: decoder)) + case "github": self = .github(try Github(from: decoder)) + case "manual": self = .manual(try Manual(from: decoder)) + default: self = .unknown(tag) + } + } + + func encode(to encoder: any Encoder) throws { + switch self { + case let .cron(value): try value.encode(to: encoder) + case let .webhook(value): try value.encode(to: encoder) + case let .github(value): try value.encode(to: encoder) + case let .manual(value): try value.encode(to: encoder) + case let .unknown(tag): + throw EncodingError.invalidValue(tag, .init(codingPath: encoder.codingPath, debugDescription: "A kind this app doesn't know can't be sent.")) + } + } + + struct Cron: Codable, Hashable, Sendable { + var kind: String = "cron" + var scheduledAt: Date + var acceptedAt: Date + } + + struct Webhook: Codable, Hashable, Sendable { + var kind: String = "webhook" + var receivedAt: Date + var idempotencyKey: String? + var payload: JSONValue + + private enum CodingKeys: String, CodingKey { + case kind + case receivedAt + case idempotencyKey + case payload + } + + func encode(to encoder: any Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(kind, forKey: .kind) + try container.encode(receivedAt, forKey: .receivedAt) + try container.encode(idempotencyKey, forKey: .idempotencyKey) + try container.encode(payload, forKey: .payload) + } + } + + struct Github: Codable, Hashable, Sendable { + var kind: String = "github" + var connectionId: String + var receivedAt: Date + var deliveryId: String + var event: RepositoryEvent + var repository: String + var sender: String + var url: String + var number: Int? + var title: String? + var text: String? + var branch: String? + var comment: Comment? + + private enum CodingKeys: String, CodingKey { + case kind + case connectionId + case receivedAt + case deliveryId + case event + case repository + case sender + case url + case number + case title + case text + case branch + case comment + } + + func encode(to encoder: any Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(kind, forKey: .kind) + try container.encode(connectionId, forKey: .connectionId) + try container.encode(receivedAt, forKey: .receivedAt) + try container.encode(deliveryId, forKey: .deliveryId) + try container.encode(event, forKey: .event) + try container.encode(repository, forKey: .repository) + try container.encode(sender, forKey: .sender) + try container.encode(url, forKey: .url) + try container.encode(number, forKey: .number) + try container.encode(title, forKey: .title) + try container.encode(text, forKey: .text) + try container.encode(branch, forKey: .branch) + try container.encodeIfPresent(comment, forKey: .comment) + } + + struct Comment: Codable, Hashable, Sendable { + var id: Int + var kind: Kind + + enum Kind: RawRepresentable, Codable, Hashable, Sendable, ParameterValue { + case comment + case codeComment + /// A value from a newer server than this app knows. + case unknown(String) + + /// Every value this app knows. + static let known: [Self] = [.comment, .codeComment] + + init(rawValue: String) { + switch rawValue { + case "comment": self = .comment + case "code_comment": self = .codeComment + default: self = .unknown(rawValue) + } + } + + var rawValue: String { + switch self { + case .comment: "comment" + case .codeComment: "code_comment" + case let .unknown(value): value + } + } + + init(from decoder: any Decoder) throws { + self.init(rawValue: try decoder.singleValueContainer().decode(String.self)) + } + + func encode(to encoder: any Encoder) throws { + var container = encoder.singleValueContainer() + try container.encode(rawValue) + } + } + } + } + + struct Manual: Codable, Hashable, Sendable { + var kind: String = "manual" + var requestedAt: Date + var requestedByUserId: String + var requestId: String + } +} + +enum RoutineExecutionTriggerKind: RawRepresentable, Codable, Hashable, Sendable, ParameterValue { + case cron + case webhook + case github + case manual + /// A value from a newer server than this app knows. + case unknown(String) + + /// Every value this app knows. + static let known: [Self] = [.cron, .webhook, .github, .manual] + + init(rawValue: String) { + switch rawValue { + case "cron": self = .cron + case "webhook": self = .webhook + case "github": self = .github + case "manual": self = .manual + default: self = .unknown(rawValue) + } + } + + var rawValue: String { + switch self { + case .cron: "cron" + case .webhook: "webhook" + case .github: "github" + case .manual: "manual" + case let .unknown(value): value + } + } + + init(from decoder: any Decoder) throws { + self.init(rawValue: try decoder.singleValueContainer().decode(String.self)) + } + + func encode(to encoder: any Encoder) throws { + var container = encoder.singleValueContainer() + try container.encode(rawValue) + } +} + +struct RoutineFeed: Codable, Hashable, Sendable { + var kind: String = "routine_feed" + var id: String + var workspaceId: String + var podId: String + var title: String + var createdAt: Date + var updatedAt: Date + var hostAgentId: String + var routineId: String +} + +struct RoutineResultOf: Codable, Hashable, Sendable { + var executionId: String + var threadId: String + var routineId: String + var routineName: String +} + +enum RoutineResults: RawRepresentable, Codable, Hashable, Sendable, ParameterValue { + case keepInRun + case postToChat + /// A value from a newer server than this app knows. + case unknown(String) + + /// Every value this app knows. + static let known: [Self] = [.keepInRun, .postToChat] + + init(rawValue: String) { + switch rawValue { + case "keep_in_run": self = .keepInRun + case "post_to_chat": self = .postToChat + default: self = .unknown(rawValue) + } + } + + var rawValue: String { + switch self { + case .keepInRun: "keep_in_run" + case .postToChat: "post_to_chat" + case let .unknown(value): value + } + } + + init(from decoder: any Decoder) throws { + self.init(rawValue: try decoder.singleValueContainer().decode(String.self)) + } + + func encode(to encoder: any Encoder) throws { + var container = encoder.singleValueContainer() + try container.encode(rawValue) + } +} + +enum RoutineRunNotifications: RawRepresentable, Codable, Hashable, Sendable, ParameterValue { + case failures + case all + case none + /// A value from a newer server than this app knows. + case unknown(String) + + /// Every value this app knows. + static let known: [Self] = [.failures, .all, .none] + + init(rawValue: String) { + switch rawValue { + case "failures": self = .failures + case "all": self = .all + case "none": self = .none + default: self = .unknown(rawValue) + } + } + + var rawValue: String { + switch self { + case .failures: "failures" + case .all: "all" + case .none: "none" + case let .unknown(value): value + } + } + + init(from decoder: any Decoder) throws { + self.init(rawValue: try decoder.singleValueContainer().decode(String.self)) + } + + func encode(to encoder: any Encoder) throws { + var container = encoder.singleValueContainer() + try container.encode(rawValue) + } +} + +enum RoutineSchedule: Codable, Hashable, Sendable { + case daily(Daily) + case weekly(Weekly) + case monthly(Monthly) + case cron(Cron) + /// A kind from a newer server than this app knows, by its `repeat`. + case unknown(String) + + init(from decoder: any Decoder) throws { + let tag = try decoder.container(keyedBy: AnyCodingKey.self).decode(String.self, forKey: AnyCodingKey("repeat")) + switch tag { + case "daily": self = .daily(try Daily(from: decoder)) + case "weekly": self = .weekly(try Weekly(from: decoder)) + case "monthly": self = .monthly(try Monthly(from: decoder)) + case "cron": self = .cron(try Cron(from: decoder)) + default: self = .unknown(tag) + } + } + + func encode(to encoder: any Encoder) throws { + switch self { + case let .daily(value): try value.encode(to: encoder) + case let .weekly(value): try value.encode(to: encoder) + case let .monthly(value): try value.encode(to: encoder) + case let .cron(value): try value.encode(to: encoder) + case let .unknown(tag): + throw EncodingError.invalidValue(tag, .init(codingPath: encoder.codingPath, debugDescription: "A kind this app doesn't know can't be sent.")) + } + } + + struct Daily: Codable, Hashable, Sendable { + var `repeat`: String = "daily" + var every: Int + var times: [Int] + var startsOn: String + } + + struct Weekly: Codable, Hashable, Sendable { + var `repeat`: String = "weekly" + var every: Int + var days: [Weekday] + var times: [Int] + var startsOn: String + } + + struct Monthly: Codable, Hashable, Sendable { + var `repeat`: String = "monthly" + var every: Int + var dayOfMonth: DayOfMonth + var times: [Int] + var startsOn: String + + enum DayOfMonth: Codable, Hashable, Sendable { + case last + case integer(Int) + + init(from decoder: any Decoder) throws { + if (try? decoder.singleValueContainer().decode(String.self)) == "last" { self = .last; return } + if let value = try? Int(from: decoder) { self = .integer(value); return } + throw DecodingError.dataCorrupted(.init(codingPath: decoder.codingPath, debugDescription: "None of DayOfMonth's kinds.")) + } + + func encode(to encoder: any Encoder) throws { + switch self { + case .last: + var container = encoder.singleValueContainer() + try container.encode("last") + case let .integer(value): try value.encode(to: encoder) + } + } + } + } + + struct Cron: Codable, Hashable, Sendable { + var `repeat`: String = "cron" + var expression: String + } +} + +typealias RoutineScheduleOccurrences = [Date] + +struct RoutineSchedulePreview: Codable, Hashable, Sendable { + var schedule: RoutineSchedule + var timezone: String +} + +struct RoutineSecret: Codable, Hashable, Sendable { + var secret: String? + + private enum CodingKeys: String, CodingKey { + case secret + } + + func encode(to encoder: any Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(secret, forKey: .secret) + } +} + +struct RoutineSecretReplacement: Codable, Hashable, Sendable { + var secret: Omittable = .omitted +} + +enum RoutineState: RawRepresentable, Codable, Hashable, Sendable, ParameterValue { + case enabled + case paused + /// A value from a newer server than this app knows. + case unknown(String) + + /// Every value this app knows. + static let known: [Self] = [.enabled, .paused] + + init(rawValue: String) { + switch rawValue { + case "enabled": self = .enabled + case "paused": self = .paused + default: self = .unknown(rawValue) + } + } + + var rawValue: String { + switch self { + case .enabled: "enabled" + case .paused: "paused" + case let .unknown(value): value + } + } + + init(from decoder: any Decoder) throws { + self.init(rawValue: try decoder.singleValueContainer().decode(String.self)) + } + + func encode(to encoder: any Encoder) throws { + var container = encoder.singleValueContainer() + try container.encode(rawValue) + } +} + +enum RoutineTrigger: Codable, Hashable, Sendable { + case cron(Cron) + case webhook(Webhook) + case github(Github) + /// A kind from a newer server than this app knows, by its `kind`. + case unknown(String) + + init(from decoder: any Decoder) throws { + let tag = try decoder.container(keyedBy: AnyCodingKey.self).decode(String.self, forKey: AnyCodingKey("kind")) + switch tag { + case "cron": self = .cron(try Cron(from: decoder)) + case "webhook": self = .webhook(try Webhook(from: decoder)) + case "github": self = .github(try Github(from: decoder)) + default: self = .unknown(tag) + } + } + + func encode(to encoder: any Encoder) throws { + switch self { + case let .cron(value): try value.encode(to: encoder) + case let .webhook(value): try value.encode(to: encoder) + case let .github(value): try value.encode(to: encoder) + case let .unknown(tag): + throw EncodingError.invalidValue(tag, .init(codingPath: encoder.codingPath, debugDescription: "A kind this app doesn't know can't be sent.")) + } + } + + struct Cron: Codable, Hashable, Sendable { + var id: String + var kind: String = "cron" + var schedule: RoutineSchedule + var timezone: String + var nextScheduledAt: Date? + + private enum CodingKeys: String, CodingKey { + case id + case kind + case schedule + case timezone + case nextScheduledAt + } + + func encode(to encoder: any Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(id, forKey: .id) + try container.encode(kind, forKey: .kind) + try container.encode(schedule, forKey: .schedule) + try container.encode(timezone, forKey: .timezone) + try container.encode(nextScheduledAt, forKey: .nextScheduledAt) + } + } + + struct Webhook: Codable, Hashable, Sendable { + var id: String + var kind: String = "webhook" + var auth: WebhookAuth + var deliveryIdHeader: String? + var filter: [WebhookCondition]? + } + + struct Github: Codable, Hashable, Sendable { + var id: String + var kind: String = "github" + var connectionId: String + var repository: String + var events: [RepositoryEvent] + } +} + +struct RoutineTriggerAuthor: Codable, Hashable, Sendable { + var kind: String = "routine_trigger" + var executionId: String + var routineName: String + var triggerKind: RoutineExecutionTriggerKind +} + +enum RoutineTriggerInput: Codable, Hashable, Sendable { + case cron(Cron) + case webhook(Webhook) + case github(Github) + /// A kind from a newer server than this app knows, by its `kind`. + case unknown(String) + + init(from decoder: any Decoder) throws { + let tag = try decoder.container(keyedBy: AnyCodingKey.self).decode(String.self, forKey: AnyCodingKey("kind")) + switch tag { + case "cron": self = .cron(try Cron(from: decoder)) + case "webhook": self = .webhook(try Webhook(from: decoder)) + case "github": self = .github(try Github(from: decoder)) + default: self = .unknown(tag) + } + } + + func encode(to encoder: any Encoder) throws { + switch self { + case let .cron(value): try value.encode(to: encoder) + case let .webhook(value): try value.encode(to: encoder) + case let .github(value): try value.encode(to: encoder) + case let .unknown(tag): + throw EncodingError.invalidValue(tag, .init(codingPath: encoder.codingPath, debugDescription: "A kind this app doesn't know can't be sent.")) + } + } + + struct Cron: Codable, Hashable, Sendable { + var kind: String = "cron" + var schedule: RoutineSchedule + var timezone: String + } + + struct Webhook: Codable, Hashable, Sendable { + var kind: String = "webhook" + var auth: WebhookAuth? + var deliveryIdHeader: Omittable = .omitted + var filter: [WebhookCondition]? + var secret: Omittable = .omitted + var schedule: JSONValue? + var timezone: JSONValue? + } + + struct Github: Codable, Hashable, Sendable { + var kind: String = "github" + var connectionId: String + var repository: String + var events: [RepositoryEvent] + } +} + +struct RoutineUpdate: Codable, Hashable, Sendable { + var name: String? + var instructions: String? + var state: RoutineState? + var results: RoutineResults? + var chatId: Omittable = .omitted +} + +struct RoutineWebhookChallenge: Codable, Hashable, Sendable { + var challenge: String +} + +struct RoutineWriteResult: Codable, Hashable, Sendable { + var routine: Routine + var secrets: [Secret] + + struct Secret: Codable, Hashable, Sendable { + var triggerId: String + var secret: String + } +} + +struct SandboxAccess: Codable, Hashable, Sendable { + var enabled: Bool +} + +struct SandboxAddedHost: Codable, Hashable, Sendable { + var host: String + var addedByName: String? + var addedAt: Date + + private enum CodingKeys: String, CodingKey { + case host + case addedByName + case addedAt + } + + func encode(to encoder: any Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(host, forKey: .host) + try container.encode(addedByName, forKey: .addedByName) + try container.encode(addedAt, forKey: .addedAt) + } +} + +struct SandboxBlockedHost: Codable, Hashable, Sendable { + var host: String + var blockedByName: String? + var blockedAt: Date + + private enum CodingKeys: String, CodingKey { + case host + case blockedByName + case blockedAt + } + + func encode(to encoder: any Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(host, forKey: .host) + try container.encode(blockedByName, forKey: .blockedByName) + try container.encode(blockedAt, forKey: .blockedAt) + } +} + +struct SandboxDisk: Codable, Hashable, Sendable { + var usedBytes: Int + var totalBytes: Int + var measuredAt: Date + var folders: [SandboxDiskFolder]? + + private enum CodingKeys: String, CodingKey { + case usedBytes + case totalBytes + case measuredAt + case folders + } + + func encode(to encoder: any Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(usedBytes, forKey: .usedBytes) + try container.encode(totalBytes, forKey: .totalBytes) + try container.encode(measuredAt, forKey: .measuredAt) + try container.encode(folders, forKey: .folders) + } +} + +enum SandboxDiskFolder: Codable, Hashable, Sendable { + case home(Home) + case threads(Threads) + case temporary(Temporary) + /// A kind from a newer server than this app knows, by its `kind`. + case unknown(String) + + init(from decoder: any Decoder) throws { + let tag = try decoder.container(keyedBy: AnyCodingKey.self).decode(String.self, forKey: AnyCodingKey("kind")) + switch tag { + case "home": self = .home(try Home(from: decoder)) + case "threads": self = .threads(try Threads(from: decoder)) + case "temporary": self = .temporary(try Temporary(from: decoder)) + default: self = .unknown(tag) + } + } + + func encode(to encoder: any Encoder) throws { + switch self { + case let .home(value): try value.encode(to: encoder) + case let .threads(value): try value.encode(to: encoder) + case let .temporary(value): try value.encode(to: encoder) + case let .unknown(tag): + throw EncodingError.invalidValue(tag, .init(codingPath: encoder.codingPath, debugDescription: "A kind this app doesn't know can't be sent.")) + } + } + + struct Home: Codable, Hashable, Sendable { + var kind: String = "home" + var agentId: String + var bytes: Int + } + + struct Threads: Codable, Hashable, Sendable { + var kind: String = "threads" + var bytes: Int + } + + struct Temporary: Codable, Hashable, Sendable { + var kind: String = "temporary" + var bytes: Int + } +} + +enum SandboxNetworkMode: RawRepresentable, Codable, Hashable, Sendable, ParameterValue { + case allowlist + case `open` + /// A value from a newer server than this app knows. + case unknown(String) + + /// Every value this app knows. + static let known: [Self] = [.allowlist, .`open`] + + init(rawValue: String) { + switch rawValue { + case "allowlist": self = .allowlist + case "open": self = .`open` + default: self = .unknown(rawValue) + } + } + + var rawValue: String { + switch self { + case .allowlist: "allowlist" + case .`open`: "open" + case let .unknown(value): value + } + } + + init(from decoder: any Decoder) throws { + self.init(rawValue: try decoder.singleValueContainer().decode(String.self)) + } + + func encode(to encoder: any Encoder) throws { + var container = encoder.singleValueContainer() + try container.encode(rawValue) + } +} + +struct SandboxNetworkSettings: Codable, Hashable, Sendable { + var mode: SandboxNetworkMode + var blocking: Bool + var trustedHosts: [String] + var addedHosts: [SandboxAddedHost] + var blockedHosts: [SandboxBlockedHost] +} + +struct SandboxProvider: Codable, Hashable, Sendable { + var id: String + var workspaceId: String + var preset: SandboxProviderPresetId + var name: String + var settings: SandboxProviderSettings + var enabled: Bool + var status: ProviderStatus + var hasApiKey: Bool + var lastTestedAt: Date? + var lastTestError: String? + var createdAt: Date + + private enum CodingKeys: String, CodingKey { + case id + case workspaceId + case preset + case name + case settings + case enabled + case status + case hasApiKey + case lastTestedAt + case lastTestError + case createdAt + } + + func encode(to encoder: any Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(id, forKey: .id) + try container.encode(workspaceId, forKey: .workspaceId) + try container.encode(preset, forKey: .preset) + try container.encode(name, forKey: .name) + try container.encode(settings, forKey: .settings) + try container.encode(enabled, forKey: .enabled) + try container.encode(status, forKey: .status) + try container.encode(hasApiKey, forKey: .hasApiKey) + try container.encode(lastTestedAt, forKey: .lastTestedAt) + try container.encode(lastTestError, forKey: .lastTestError) + try container.encode(createdAt, forKey: .createdAt) + } +} + +enum SandboxProviderPresetId: RawRepresentable, Codable, Hashable, Sendable, ParameterValue { + case opensandbox + case e2b + /// A value from a newer server than this app knows. + case unknown(String) + + /// Every value this app knows. + static let known: [Self] = [.opensandbox, .e2b] + + init(rawValue: String) { + switch rawValue { + case "opensandbox": self = .opensandbox + case "e2b": self = .e2b + default: self = .unknown(rawValue) + } + } + + var rawValue: String { + switch self { + case .opensandbox: "opensandbox" + case .e2b: "e2b" + case let .unknown(value): value + } + } + + init(from decoder: any Decoder) throws { + self.init(rawValue: try decoder.singleValueContainer().decode(String.self)) + } + + func encode(to encoder: any Encoder) throws { + var container = encoder.singleValueContainer() + try container.encode(rawValue) + } +} + +enum SandboxProviderSettings: Codable, Hashable, Sendable { + case opensandbox(Opensandbox) + case e2b(E2b) + /// A kind from a newer server than this app knows, by its `preset`. + case unknown(String) + + init(from decoder: any Decoder) throws { + let tag = try decoder.container(keyedBy: AnyCodingKey.self).decode(String.self, forKey: AnyCodingKey("preset")) + switch tag { + case "opensandbox": self = .opensandbox(try Opensandbox(from: decoder)) + case "e2b": self = .e2b(try E2b(from: decoder)) + default: self = .unknown(tag) + } + } + + func encode(to encoder: any Encoder) throws { + switch self { + case let .opensandbox(value): try value.encode(to: encoder) + case let .e2b(value): try value.encode(to: encoder) + case let .unknown(tag): + throw EncodingError.invalidValue(tag, .init(codingPath: encoder.codingPath, debugDescription: "A kind this app doesn't know can't be sent.")) + } + } + + struct Opensandbox: Codable, Hashable, Sendable { + var preset: String = "opensandbox" + var serverUrl: String? + var image: String? + var cpuCount: Int? + var memoryGiB: Int? + var networkMode: SandboxNetworkMode? + } + + struct E2b: Codable, Hashable, Sendable { + var preset: String = "e2b" + var apiUrl: String? + var sandboxUrl: String? + var template: String? + var cpuCount: Int? + var memoryGiB: Int? + var networkMode: SandboxNetworkMode? + } +} + +struct SandboxProviderTestResult: Codable, Hashable, Sendable { + var reachable: Bool + var latencyMs: Int + var error: String? +} + +struct SandboxProviderUpdate: Codable, Hashable, Sendable { + var enabled: Bool? + var apiKey: Omittable = .omitted + var settings: SandboxProviderSettings? +} + +struct SandboxTemplate: Codable, Hashable, Sendable { + var state: State? + + private enum CodingKeys: String, CodingKey { + case state + } + + func encode(to encoder: any Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(state, forKey: .state) + } + + enum State: RawRepresentable, Codable, Hashable, Sendable, ParameterValue { + case missing + case building + case ready + case failed + /// A value from a newer server than this app knows. + case unknown(String) + + /// Every value this app knows. + static let known: [Self] = [.missing, .building, .ready, .failed] + + init(rawValue: String) { + switch rawValue { + case "missing": self = .missing + case "building": self = .building + case "ready": self = .ready + case "failed": self = .failed + default: self = .unknown(rawValue) + } + } + + var rawValue: String { + switch self { + case .missing: "missing" + case .building: "building" + case .ready: "ready" + case .failed: "failed" + case let .unknown(value): value + } + } + + init(from decoder: any Decoder) throws { + self.init(rawValue: try decoder.singleValueContainer().decode(String.self)) + } + + func encode(to encoder: any Encoder) throws { + var container = encoder.singleValueContainer() + try container.encode(rawValue) + } + } +} + +struct SearchProvider: Codable, Hashable, Sendable { + var id: String + var workspaceId: String + var preset: SearchProviderPresetId + var name: String + var baseUrl: String + var enabled: Bool + var status: ProviderStatus + var hasApiKey: Bool + var lastTestedAt: Date? + var lastTestError: String? + var createdAt: Date + + private enum CodingKeys: String, CodingKey { + case id + case workspaceId + case preset + case name + case baseUrl + case enabled + case status + case hasApiKey + case lastTestedAt + case lastTestError + case createdAt + } + + func encode(to encoder: any Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(id, forKey: .id) + try container.encode(workspaceId, forKey: .workspaceId) + try container.encode(preset, forKey: .preset) + try container.encode(name, forKey: .name) + try container.encode(baseUrl, forKey: .baseUrl) + try container.encode(enabled, forKey: .enabled) + try container.encode(status, forKey: .status) + try container.encode(hasApiKey, forKey: .hasApiKey) + try container.encode(lastTestedAt, forKey: .lastTestedAt) + try container.encode(lastTestError, forKey: .lastTestError) + try container.encode(createdAt, forKey: .createdAt) + } +} + +enum SearchProviderPresetId: RawRepresentable, Codable, Hashable, Sendable, ParameterValue { + case brave + case exa + case tavily + case searxng + /// A value from a newer server than this app knows. + case unknown(String) + + /// Every value this app knows. + static let known: [Self] = [.brave, .exa, .tavily, .searxng] + + init(rawValue: String) { + switch rawValue { + case "brave": self = .brave + case "exa": self = .exa + case "tavily": self = .tavily + case "searxng": self = .searxng + default: self = .unknown(rawValue) + } + } + + var rawValue: String { + switch self { + case .brave: "brave" + case .exa: "exa" + case .tavily: "tavily" + case .searxng: "searxng" + case let .unknown(value): value + } + } + + init(from decoder: any Decoder) throws { + self.init(rawValue: try decoder.singleValueContainer().decode(String.self)) + } + + func encode(to encoder: any Encoder) throws { + var container = encoder.singleValueContainer() + try container.encode(rawValue) + } +} + +struct SearchProviderResponse: Codable, Hashable, Sendable { + var provider: SearchProvider? + + private enum CodingKeys: String, CodingKey { + case provider + } + + func encode(to encoder: any Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(provider, forKey: .provider) + } +} + +struct SearchProviderTestResult: Codable, Hashable, Sendable { + var reachable: Bool + var latencyMs: Int + var results: Int? + var error: String? +} + +struct SearchProviderUpdate: Codable, Hashable, Sendable { + var enabled: Bool? + var baseUrl: String? + var apiKey: Omittable = .omitted +} + +struct SessionUser: Codable, Hashable, Sendable { + var id: String + var email: String + var name: String + var image: String? + + private enum CodingKeys: String, CodingKey { + case id + case email + case name + case image + } + + func encode(to encoder: any Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(id, forKey: .id) + try container.encode(email, forKey: .email) + try container.encode(name, forKey: .name) + try container.encode(image, forKey: .image) + } +} + +struct StartedThread: Codable, Hashable, Sendable { + var conversation: ConversationThread + var message: Message +} + +struct SystemAgent: Codable, Hashable, Sendable { + var key: SystemAgentKey + var name: String + var description: String? + var color: AgentColor + var face: AgentFace + var shape: AgentShape + var model: String? + + private enum CodingKeys: String, CodingKey { + case key + case name + case description + case color + case face + case shape + case model + } + + func encode(to encoder: any Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(key, forKey: .key) + try container.encode(name, forKey: .name) + try container.encode(description, forKey: .description) + try container.encode(color, forKey: .color) + try container.encode(face, forKey: .face) + try container.encode(shape, forKey: .shape) + try container.encode(model, forKey: .model) + } +} + +enum SystemAgentKey: RawRepresentable, Codable, Hashable, Sendable, ParameterValue { + case summarise + case compact + /// A value from a newer server than this app knows. + case unknown(String) + + /// Every value this app knows. + static let known: [Self] = [.summarise, .compact] + + init(rawValue: String) { + switch rawValue { + case "summarise": self = .summarise + case "compact": self = .compact + default: self = .unknown(rawValue) + } + } + + var rawValue: String { + switch self { + case .summarise: "summarise" + case .compact: "compact" + case let .unknown(value): value + } + } + + init(from decoder: any Decoder) throws { + self.init(rawValue: try decoder.singleValueContainer().decode(String.self)) + } + + func encode(to encoder: any Encoder) throws { + var container = encoder.singleValueContainer() + try container.encode(rawValue) + } +} + +struct SystemAgentUpdate: Codable, Hashable, Sendable { + var model: String +} + +struct TextPart: Codable, Hashable, Sendable { + var type: String = "text" + var text: String +} + +struct Thread: Codable, Hashable, Sendable { + var id: String + var workspaceId: String + var podId: String + var hostAgentId: String? + var conversationId: String? + var type: ThreadType + var title: String + var status: Status + var parentThreadId: String? + var doneAt: Date? + var initiatorUserId: String? + var createdAt: Date + var updatedAt: Date + + private enum CodingKeys: String, CodingKey { + case id + case workspaceId + case podId + case hostAgentId + case conversationId + case type + case title + case status + case parentThreadId + case doneAt + case initiatorUserId + case createdAt + case updatedAt + } + + func encode(to encoder: any Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(id, forKey: .id) + try container.encode(workspaceId, forKey: .workspaceId) + try container.encode(podId, forKey: .podId) + try container.encode(hostAgentId, forKey: .hostAgentId) + try container.encode(conversationId, forKey: .conversationId) + try container.encode(type, forKey: .type) + try container.encode(title, forKey: .title) + try container.encode(status, forKey: .status) + try container.encode(parentThreadId, forKey: .parentThreadId) + try container.encode(doneAt, forKey: .doneAt) + try container.encode(initiatorUserId, forKey: .initiatorUserId) + try container.encode(createdAt, forKey: .createdAt) + try container.encode(updatedAt, forKey: .updatedAt) + } + + enum Status: RawRepresentable, Codable, Hashable, Sendable, ParameterValue { + case running + case done + /// A value from a newer server than this app knows. + case unknown(String) + + /// Every value this app knows. + static let known: [Self] = [.running, .done] + + init(rawValue: String) { + switch rawValue { + case "running": self = .running + case "done": self = .done + default: self = .unknown(rawValue) + } + } + + var rawValue: String { + switch self { + case .running: "running" + case .done: "done" + case let .unknown(value): value + } + } + + init(from decoder: any Decoder) throws { + self.init(rawValue: try decoder.singleValueContainer().decode(String.self)) + } + + func encode(to encoder: any Encoder) throws { + var container = encoder.singleValueContainer() + try container.encode(rawValue) + } + } +} + +struct ThreadActivity: Codable, Hashable, Sendable { + var summary: ThreadSummary? + var context: ThreadContext? + var recentParticipants: [ThreadParticipant] + + private enum CodingKeys: String, CodingKey { + case summary + case context + case recentParticipants + } + + func encode(to encoder: any Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(summary, forKey: .summary) + try container.encode(context, forKey: .context) + try container.encode(recentParticipants, forKey: .recentParticipants) + } +} + +struct ThreadContext: Codable, Hashable, Sendable { + var usedTokens: Int + var measuredAt: Date + var windowTokens: Int + var compactionLineTokens: Int + var compactedAt: Date? + + private enum CodingKeys: String, CodingKey { + case usedTokens + case measuredAt + case windowTokens + case compactionLineTokens + case compactedAt + } + + func encode(to encoder: any Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(usedTokens, forKey: .usedTokens) + try container.encode(measuredAt, forKey: .measuredAt) + try container.encode(windowTokens, forKey: .windowTokens) + try container.encode(compactionLineTokens, forKey: .compactionLineTokens) + try container.encode(compactedAt, forKey: .compactedAt) + } +} + +struct ThreadDetails: Codable, Hashable, Sendable { + var thread: Thread + var capabilities: Capabilities? + var routineExecution: RoutineExecution? + var routine: Routine? + var startedFrom: Message? + var participants: [ThreadParticipant] + var crew: [ThreadParticipant] + var members: [PersonParticipant] + var messages: [Message] + var olderMessagesCursor: String? + var queuedSince: Date? + var reads: [ThreadRead] + + private enum CodingKeys: String, CodingKey { + case thread + case capabilities + case routineExecution + case routine + case startedFrom + case participants + case crew + case members + case messages + case olderMessagesCursor + case queuedSince + case reads + } + + func encode(to encoder: any Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(thread, forKey: .thread) + try container.encodeIfPresent(capabilities, forKey: .capabilities) + try container.encode(routineExecution, forKey: .routineExecution) + try container.encodeIfPresent(routine, forKey: .routine) + try container.encode(startedFrom, forKey: .startedFrom) + try container.encode(participants, forKey: .participants) + try container.encode(crew, forKey: .crew) + try container.encode(members, forKey: .members) + try container.encode(messages, forKey: .messages) + try container.encode(olderMessagesCursor, forKey: .olderMessagesCursor) + try container.encode(queuedSince, forKey: .queuedSince) + try container.encode(reads, forKey: .reads) + } + + struct Capabilities: Codable, Hashable, Sendable { + var approveToolCalls: Bool + var approveSandboxRequests: Bool? + } + + struct Routine: Codable, Hashable, Sendable { + var id: String + var agentId: String + var state: RoutineState + var failed: Bool + var pausedAfterFailures: Bool + } +} + +enum ThreadParticipant: Codable, Hashable, Sendable { + case person(PersonParticipant) + case agent(AgentParticipant) + /// A kind from a newer server than this app knows, by its `kind`. + case unknown(String) + + init(from decoder: any Decoder) throws { + let tag = try decoder.container(keyedBy: AnyCodingKey.self).decode(String.self, forKey: AnyCodingKey("kind")) + switch tag { + case "person": self = .person(try PersonParticipant(from: decoder)) + case "agent": self = .agent(try AgentParticipant(from: decoder)) + default: self = .unknown(tag) + } + } + + func encode(to encoder: any Encoder) throws { + switch self { + case let .person(value): try value.encode(to: encoder) + case let .agent(value): try value.encode(to: encoder) + case let .unknown(tag): + throw EncodingError.invalidValue(tag, .init(codingPath: encoder.codingPath, debugDescription: "A kind this app doesn't know can't be sent.")) + } + } +} + +struct ThreadRead: Codable, Hashable, Sendable { + var person: PersonParticipant + var readThrough: Date + var readAt: Date +} + +struct ThreadSummary: Codable, Hashable, Sendable { + var content: String + var sourceMessageId: String + var updatedAt: Date +} + +enum ThreadType: RawRepresentable, Codable, Hashable, Sendable, ParameterValue { + case conversation + case podChat + case botChannel + case collaboration + case routine + case routineFeed + case systemAgent + /// A value from a newer server than this app knows. + case unknown(String) + + /// Every value this app knows. + static let known: [Self] = [.conversation, .podChat, .botChannel, .collaboration, .routine, .routineFeed, .systemAgent] + + init(rawValue: String) { + switch rawValue { + case "conversation": self = .conversation + case "pod_chat": self = .podChat + case "bot_channel": self = .botChannel + case "collaboration": self = .collaboration + case "routine": self = .routine + case "routine_feed": self = .routineFeed + case "system_agent": self = .systemAgent + default: self = .unknown(rawValue) + } + } + + var rawValue: String { + switch self { + case .conversation: "conversation" + case .podChat: "pod_chat" + case .botChannel: "bot_channel" + case .collaboration: "collaboration" + case .routine: "routine" + case .routineFeed: "routine_feed" + case .systemAgent: "system_agent" + case let .unknown(value): value + } + } + + init(from decoder: any Decoder) throws { + self.init(rawValue: try decoder.singleValueContainer().decode(String.self)) + } + + func encode(to encoder: any Encoder) throws { + var container = encoder.singleValueContainer() + try container.encode(rawValue) + } +} + +enum ThreadUpdateEvent: Codable, Hashable, Sendable { + case messageCreated(MessageCreated) + case messageDelta(MessageDelta) + case messageCompleted(MessageCompleted) + case messageFailed(MessageFailed) + case messageReactionsChanged(MessageReactionsChanged) + case messageFilesChanged(MessageFilesChanged) + case toolCallStarted(ToolCallStarted) + case toolCallCompleted(ToolCallCompleted) + case toolCallUpdated(ToolCallUpdated) + case turnStarted(TurnStarted) + case turnCancelRequested(TurnCancelRequested) + case turnCompleted(TurnCompleted) + case threadChanged(ThreadChanged) + case threadNotice(ThreadNotice) + case threadRead(ThreadRead) + case personTyping(PersonTyping) + case conversationThreadChanged(ConversationThreadChanged) + case collaborationUpdated(CollaborationUpdated) + case reset(Reset) + /// A kind from a newer server than this app knows, by its `type`. + case unknown(String) + + init(from decoder: any Decoder) throws { + let tag = try decoder.container(keyedBy: AnyCodingKey.self).decode(String.self, forKey: AnyCodingKey("type")) + switch tag { + case "message.created": self = .messageCreated(try MessageCreated(from: decoder)) + case "message.delta": self = .messageDelta(try MessageDelta(from: decoder)) + case "message.completed": self = .messageCompleted(try MessageCompleted(from: decoder)) + case "message.failed": self = .messageFailed(try MessageFailed(from: decoder)) + case "message.reactions_changed": self = .messageReactionsChanged(try MessageReactionsChanged(from: decoder)) + case "message.files_changed": self = .messageFilesChanged(try MessageFilesChanged(from: decoder)) + case "tool_call.started": self = .toolCallStarted(try ToolCallStarted(from: decoder)) + case "tool_call.completed": self = .toolCallCompleted(try ToolCallCompleted(from: decoder)) + case "tool_call.updated": self = .toolCallUpdated(try ToolCallUpdated(from: decoder)) + case "turn.started": self = .turnStarted(try TurnStarted(from: decoder)) + case "turn.cancel_requested": self = .turnCancelRequested(try TurnCancelRequested(from: decoder)) + case "turn.completed": self = .turnCompleted(try TurnCompleted(from: decoder)) + case "thread.changed": self = .threadChanged(try ThreadChanged(from: decoder)) + case "thread.notice": self = .threadNotice(try ThreadNotice(from: decoder)) + case "thread.read": self = .threadRead(try ThreadRead(from: decoder)) + case "person.typing": self = .personTyping(try PersonTyping(from: decoder)) + case "conversation.thread_changed": self = .conversationThreadChanged(try ConversationThreadChanged(from: decoder)) + case "collaboration.updated": self = .collaborationUpdated(try CollaborationUpdated(from: decoder)) + case "reset": self = .reset(try Reset(from: decoder)) + default: self = .unknown(tag) + } + } + + func encode(to encoder: any Encoder) throws { + switch self { + case let .messageCreated(value): try value.encode(to: encoder) + case let .messageDelta(value): try value.encode(to: encoder) + case let .messageCompleted(value): try value.encode(to: encoder) + case let .messageFailed(value): try value.encode(to: encoder) + case let .messageReactionsChanged(value): try value.encode(to: encoder) + case let .messageFilesChanged(value): try value.encode(to: encoder) + case let .toolCallStarted(value): try value.encode(to: encoder) + case let .toolCallCompleted(value): try value.encode(to: encoder) + case let .toolCallUpdated(value): try value.encode(to: encoder) + case let .turnStarted(value): try value.encode(to: encoder) + case let .turnCancelRequested(value): try value.encode(to: encoder) + case let .turnCompleted(value): try value.encode(to: encoder) + case let .threadChanged(value): try value.encode(to: encoder) + case let .threadNotice(value): try value.encode(to: encoder) + case let .threadRead(value): try value.encode(to: encoder) + case let .personTyping(value): try value.encode(to: encoder) + case let .conversationThreadChanged(value): try value.encode(to: encoder) + case let .collaborationUpdated(value): try value.encode(to: encoder) + case let .reset(value): try value.encode(to: encoder) + case let .unknown(tag): + throw EncodingError.invalidValue(tag, .init(codingPath: encoder.codingPath, debugDescription: "A kind this app doesn't know can't be sent.")) + } + } + + struct MessageCreated: Codable, Hashable, Sendable { + var v: Int = 1 + var type: String = "message.created" + var threadId: String + var message: Message + } + + struct MessageDelta: Codable, Hashable, Sendable { + var v: Int = 1 + var type: String = "message.delta" + var threadId: String + var messageId: String + var offset: Int + var text: String + } + + struct MessageCompleted: Codable, Hashable, Sendable { + var v: Int = 1 + var type: String = "message.completed" + var threadId: String + var messageId: String + var content: String + var status: MessageStatus + } + + struct MessageFailed: Codable, Hashable, Sendable { + var v: Int = 1 + var type: String = "message.failed" + var threadId: String + var messageId: String + var turnId: String + var willRetry: Bool + var error: String + } + + struct MessageReactionsChanged: Codable, Hashable, Sendable { + var v: Int = 1 + var type: String = "message.reactions_changed" + var threadId: String + var messageId: String + var reactions: MessageReactions + } + + struct MessageFilesChanged: Codable, Hashable, Sendable { + var v: Int = 1 + var type: String = "message.files_changed" + var threadId: String + var messageId: String + var files: [FilePart] + } + + struct ToolCallStarted: Codable, Hashable, Sendable { + var v: Int = 1 + var type: String = "tool_call.started" + var threadId: String + var messageId: String + var toolCall: ToolCallPart + } + + struct ToolCallCompleted: Codable, Hashable, Sendable { + var v: Int = 1 + var type: String = "tool_call.completed" + var threadId: String + var messageId: String + var toolCall: ToolCallPart + } + + struct ToolCallUpdated: Codable, Hashable, Sendable { + var v: Int = 1 + var type: String = "tool_call.updated" + var threadId: String + var messageId: String + var toolCall: ToolCallPart + } + + struct TurnStarted: Codable, Hashable, Sendable { + var v: Int = 1 + var type: String = "turn.started" + var threadId: String + var turnId: String + var agentId: String + } + + struct TurnCancelRequested: Codable, Hashable, Sendable { + var v: Int = 1 + var type: String = "turn.cancel_requested" + var threadId: String + var turnId: String + } + + struct TurnCompleted: Codable, Hashable, Sendable { + var v: Int = 1 + var type: String = "turn.completed" + var threadId: String + var turnId: String + var status: Status + + enum Status: RawRepresentable, Codable, Hashable, Sendable, ParameterValue { + case done + case cancelled + /// A value from a newer server than this app knows. + case unknown(String) + + /// Every value this app knows. + static let known: [Self] = [.done, .cancelled] + + init(rawValue: String) { + switch rawValue { + case "done": self = .done + case "cancelled": self = .cancelled + default: self = .unknown(rawValue) + } + } + + var rawValue: String { + switch self { + case .done: "done" + case .cancelled: "cancelled" + case let .unknown(value): value + } + } + + init(from decoder: any Decoder) throws { + self.init(rawValue: try decoder.singleValueContainer().decode(String.self)) + } + + func encode(to encoder: any Encoder) throws { + var container = encoder.singleValueContainer() + try container.encode(rawValue) + } + } + } + + struct ThreadChanged: Codable, Hashable, Sendable { + var v: Int = 1 + var type: String = "thread.changed" + var threadId: String + } + + struct ThreadNotice: Codable, Hashable, Sendable { + var v: Int = 1 + var type: String = "thread.notice" + var threadId: String + var notice: String + } + + struct ThreadRead: Codable, Hashable, Sendable { + var v: Int = 1 + var type: String = "thread.read" + var threadId: String + var person: PersonParticipant + var readThrough: Date + var readAt: Date + } + + struct PersonTyping: Codable, Hashable, Sendable { + var v: Int = 1 + var type: String = "person.typing" + var threadId: String + var person: PersonParticipant + } + + struct ConversationThreadChanged: Codable, Hashable, Sendable { + var v: Int = 1 + var type: String = "conversation.thread_changed" + var conversationId: String + var threadId: String + } + + struct CollaborationUpdated: Codable, Hashable, Sendable { + var v: Int = 1 + var type: String = "collaboration.updated" + var threadId: String + var messageId: String + var collaboration: CollaborationPart + } + + struct Reset: Codable, Hashable, Sendable { + var v: Int = 1 + var type: String = "reset" + } +} + +struct ToolAccessCounts: Codable, Hashable, Sendable { + var allow: Int + var ask: Int + var off: Int +} + +enum ToolApprovalDeciders: RawRepresentable, Codable, Hashable, Sendable, ParameterValue { + case pod + case sandboxManagers + /// A value from a newer server than this app knows. + case unknown(String) + + /// Every value this app knows. + static let known: [Self] = [.pod, .sandboxManagers] + + init(rawValue: String) { + switch rawValue { + case "pod": self = .pod + case "sandbox-managers": self = .sandboxManagers + default: self = .unknown(rawValue) + } + } + + var rawValue: String { + switch self { + case .pod: "pod" + case .sandboxManagers: "sandbox-managers" + case let .unknown(value): value + } + } + + init(from decoder: any Decoder) throws { + self.init(rawValue: try decoder.singleValueContainer().decode(String.self)) + } + + func encode(to encoder: any Encoder) throws { + var container = encoder.singleValueContainer() + try container.encode(rawValue) + } +} + +struct ToolApprovalDecision: Codable, Hashable, Sendable { + var decision: Decision + + enum Decision: RawRepresentable, Codable, Hashable, Sendable, ParameterValue { + case allowOnce + case deny + /// A value from a newer server than this app knows. + case unknown(String) + + /// Every value this app knows. + static let known: [Self] = [.allowOnce, .deny] + + init(rawValue: String) { + switch rawValue { + case "allow_once": self = .allowOnce + case "deny": self = .deny + default: self = .unknown(rawValue) + } + } + + var rawValue: String { + switch self { + case .allowOnce: "allow_once" + case .deny: "deny" + case let .unknown(value): value + } + } + + init(from decoder: any Decoder) throws { + self.init(rawValue: try decoder.singleValueContainer().decode(String.self)) + } + + func encode(to encoder: any Encoder) throws { + var container = encoder.singleValueContainer() + try container.encode(rawValue) + } + } +} + +enum ToolApprovalStatus: RawRepresentable, Codable, Hashable, Sendable, ParameterValue { + case pending + case allowed + case denied + case automatic + /// A value from a newer server than this app knows. + case unknown(String) + + /// Every value this app knows. + static let known: [Self] = [.pending, .allowed, .denied, .automatic] + + init(rawValue: String) { + switch rawValue { + case "pending": self = .pending + case "allowed": self = .allowed + case "denied": self = .denied + case "automatic": self = .automatic + default: self = .unknown(rawValue) + } + } + + var rawValue: String { + switch self { + case .pending: "pending" + case .allowed: "allowed" + case .denied: "denied" + case .automatic: "automatic" + case let .unknown(value): value + } + } + + init(from decoder: any Decoder) throws { + self.init(rawValue: try decoder.singleValueContainer().decode(String.self)) + } + + func encode(to encoder: any Encoder) throws { + var container = encoder.singleValueContainer() + try container.encode(rawValue) + } +} + +struct ToolCallPart: Codable, Hashable, Sendable { + var type: String = "tool_call" + var id: String + var tool: String + var input: JSONValue + var output: JSONValue? + var status: ToolCallStatus + var approval: Approval? + var error: String? + var mutating: Bool + var atOffset: Int + var startedAt: Date + var finishedAt: Date? + + private enum CodingKeys: String, CodingKey { + case type + case id + case tool + case input + case output + case status + case approval + case error + case mutating + case atOffset + case startedAt + case finishedAt + } + + func encode(to encoder: any Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(type, forKey: .type) + try container.encode(id, forKey: .id) + try container.encode(tool, forKey: .tool) + try container.encode(input, forKey: .input) + try container.encode(output, forKey: .output) + try container.encode(status, forKey: .status) + try container.encodeIfPresent(approval, forKey: .approval) + try container.encode(error, forKey: .error) + try container.encode(mutating, forKey: .mutating) + try container.encode(atOffset, forKey: .atOffset) + try container.encode(startedAt, forKey: .startedAt) + try container.encode(finishedAt, forKey: .finishedAt) + } + + struct Approval: Codable, Hashable, Sendable { + var status: ToolApprovalStatus + var deciders: ToolApprovalDeciders? + var decidedByName: String? + var decidedAt: Date? + + private enum CodingKeys: String, CodingKey { + case status + case deciders + case decidedByName + case decidedAt + } + + func encode(to encoder: any Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(status, forKey: .status) + try container.encodeIfPresent(deciders, forKey: .deciders) + try container.encode(decidedByName, forKey: .decidedByName) + try container.encode(decidedAt, forKey: .decidedAt) + } + } +} + +enum ToolCallStatus: RawRepresentable, Codable, Hashable, Sendable, ParameterValue { + case awaitingApproval + case running + case completed + case failed + /// A value from a newer server than this app knows. + case unknown(String) + + /// Every value this app knows. + static let known: [Self] = [.awaitingApproval, .running, .completed, .failed] + + init(rawValue: String) { + switch rawValue { + case "awaiting_approval": self = .awaitingApproval + case "running": self = .running + case "completed": self = .completed + case "failed": self = .failed + default: self = .unknown(rawValue) + } + } + + var rawValue: String { + switch self { + case .awaitingApproval: "awaiting_approval" + case .running: "running" + case .completed: "completed" + case .failed: "failed" + case let .unknown(value): value + } + } + + init(from decoder: any Decoder) throws { + self.init(rawValue: try decoder.singleValueContainer().decode(String.self)) + } + + func encode(to encoder: any Encoder) throws { + var container = encoder.singleValueContainer() + try container.encode(rawValue) + } +} + +struct TrialAccuracy: Codable, Hashable, Sendable { + var passed: Int + var attempts: Int + var share: Double + var needed: Double + var rating: TrialRating +} + +struct TrialCaseResult: Codable, Hashable, Sendable { + var name: String + var passed: Int + var attempts: Int + var example: String? +} + +enum TrialRating: RawRepresentable, Codable, Hashable, Sendable, ParameterValue { + case excellent + case good + case poor + case terrible + /// A value from a newer server than this app knows. + case unknown(String) + + /// Every value this app knows. + static let known: [Self] = [.excellent, .good, .poor, .terrible] + + init(rawValue: String) { + switch rawValue { + case "excellent": self = .excellent + case "good": self = .good + case "poor": self = .poor + case "terrible": self = .terrible + default: self = .unknown(rawValue) + } + } + + var rawValue: String { + switch self { + case .excellent: "excellent" + case .good: "good" + case .poor: "poor" + case .terrible: "terrible" + case let .unknown(value): value + } + } + + init(from decoder: any Decoder) throws { + self.init(rawValue: try decoder.singleValueContainer().decode(String.self)) + } + + func encode(to encoder: any Encoder) throws { + var container = encoder.singleValueContainer() + try container.encode(rawValue) + } +} + +struct TrialSpeed: Codable, Hashable, Sendable { + var typicalMs: Double + var slowestMs: Double + var budgetMs: Double + var rating: TrialRating +} + +struct UnauthorizedEncoded: Codable, Hashable, Sendable { + var tag: String = "Unauthorized" + var message: String + var details: JSONValue? + var error: ErrorEncoded? + + private enum CodingKeys: String, CodingKey { + case tag = "_tag" + case message + case details + case error + } + + struct ErrorEncoded: Codable, Hashable, Sendable { + var tag: String + var userMessage: String + var isRetryable: Bool + var retryAfterMillis: Double? + + private enum CodingKeys: String, CodingKey { + case tag = "_tag" + case userMessage + case isRetryable + case retryAfterMillis + } + } +} + +struct UnsavedConnection: Codable, Hashable, Sendable { + var url: String + var secretHeader: String? + var secret: String? +} + +struct UploadedAttachment: Codable, Hashable, Sendable { + var id: String + var name: String + var contentType: String + var size: Int +} + +struct UsageDay: Codable, Hashable, Sendable { + var date: String + var usd: Double +} + +struct WebAccess: Codable, Hashable, Sendable { + var enabled: Bool +} + +enum WebhookAuth: Codable, Hashable, Sendable { + case githubOrStripeOrSlackOrLinear(GithubOrStripeOrSlackOrLinear) + case hmac(Hmac) + case apiKey(ApiKey) + case bearer(Bearer) + case basic(Basic) + /// A kind from a newer server than this app knows, by its `kind`. + case unknown(String) + + init(from decoder: any Decoder) throws { + let tag = try decoder.container(keyedBy: AnyCodingKey.self).decode(String.self, forKey: AnyCodingKey("kind")) + switch tag { + case "github", "stripe", "slack", "linear": self = .githubOrStripeOrSlackOrLinear(try GithubOrStripeOrSlackOrLinear(from: decoder)) + case "hmac": self = .hmac(try Hmac(from: decoder)) + case "api_key": self = .apiKey(try ApiKey(from: decoder)) + case "bearer": self = .bearer(try Bearer(from: decoder)) + case "basic": self = .basic(try Basic(from: decoder)) + default: self = .unknown(tag) + } + } + + func encode(to encoder: any Encoder) throws { + switch self { + case let .githubOrStripeOrSlackOrLinear(value): try value.encode(to: encoder) + case let .hmac(value): try value.encode(to: encoder) + case let .apiKey(value): try value.encode(to: encoder) + case let .bearer(value): try value.encode(to: encoder) + case let .basic(value): try value.encode(to: encoder) + case let .unknown(tag): + throw EncodingError.invalidValue(tag, .init(codingPath: encoder.codingPath, debugDescription: "A kind this app doesn't know can't be sent.")) + } + } + + struct GithubOrStripeOrSlackOrLinear: Codable, Hashable, Sendable { + var kind: Kind + + enum Kind: RawRepresentable, Codable, Hashable, Sendable, ParameterValue { + case github + case stripe + case slack + case linear + /// A value from a newer server than this app knows. + case unknown(String) + + /// Every value this app knows. + static let known: [Self] = [.github, .stripe, .slack, .linear] + + init(rawValue: String) { + switch rawValue { + case "github": self = .github + case "stripe": self = .stripe + case "slack": self = .slack + case "linear": self = .linear + default: self = .unknown(rawValue) + } + } + + var rawValue: String { + switch self { + case .github: "github" + case .stripe: "stripe" + case .slack: "slack" + case .linear: "linear" + case let .unknown(value): value + } + } + + init(from decoder: any Decoder) throws { + self.init(rawValue: try decoder.singleValueContainer().decode(String.self)) + } + + func encode(to encoder: any Encoder) throws { + var container = encoder.singleValueContainer() + try container.encode(rawValue) + } + } + } + + struct Hmac: Codable, Hashable, Sendable { + var kind: String = "hmac" + var header: String + var algorithm: WebhookHmacAlgorithm + var encoding: WebhookSignatureEncoding + } + + struct ApiKey: Codable, Hashable, Sendable { + var kind: String = "api_key" + var header: String + } + + struct Bearer: Codable, Hashable, Sendable { + var kind: String = "bearer" + } + + struct Basic: Codable, Hashable, Sendable { + var kind: String = "basic" + var username: String + } +} + +struct WebhookCondition: Codable, Hashable, Sendable { + var path: String + var oneOf: [String] +} + +enum WebhookHmacAlgorithm: RawRepresentable, Codable, Hashable, Sendable, ParameterValue { + case sha1 + case sha256 + case sha512 + /// A value from a newer server than this app knows. + case unknown(String) + + /// Every value this app knows. + static let known: [Self] = [.sha1, .sha256, .sha512] + + init(rawValue: String) { + switch rawValue { + case "sha1": self = .sha1 + case "sha256": self = .sha256 + case "sha512": self = .sha512 + default: self = .unknown(rawValue) + } + } + + var rawValue: String { + switch self { + case .sha1: "sha1" + case .sha256: "sha256" + case .sha512: "sha512" + case let .unknown(value): value + } + } + + init(from decoder: any Decoder) throws { + self.init(rawValue: try decoder.singleValueContainer().decode(String.self)) + } + + func encode(to encoder: any Encoder) throws { + var container = encoder.singleValueContainer() + try container.encode(rawValue) + } +} + +enum WebhookSignatureEncoding: RawRepresentable, Codable, Hashable, Sendable, ParameterValue { + case hex + case base64 + /// A value from a newer server than this app knows. + case unknown(String) + + /// Every value this app knows. + static let known: [Self] = [.hex, .base64] + + init(rawValue: String) { + switch rawValue { + case "hex": self = .hex + case "base64": self = .base64 + default: self = .unknown(rawValue) + } + } + + var rawValue: String { + switch self { + case .hex: "hex" + case .base64: "base64" + case let .unknown(value): value + } + } + + init(from decoder: any Decoder) throws { + self.init(rawValue: try decoder.singleValueContainer().decode(String.self)) + } + + func encode(to encoder: any Encoder) throws { + var container = encoder.singleValueContainer() + try container.encode(rawValue) + } +} + +enum Weekday: RawRepresentable, Codable, Hashable, Sendable, ParameterValue { + case mon + case tue + case wed + case thu + case fri + case sat + case sun + /// A value from a newer server than this app knows. + case unknown(String) + + /// Every value this app knows. + static let known: [Self] = [.mon, .tue, .wed, .thu, .fri, .sat, .sun] + + init(rawValue: String) { + switch rawValue { + case "mon": self = .mon + case "tue": self = .tue + case "wed": self = .wed + case "thu": self = .thu + case "fri": self = .fri + case "sat": self = .sat + case "sun": self = .sun + default: self = .unknown(rawValue) + } + } + + var rawValue: String { + switch self { + case .mon: "mon" + case .tue: "tue" + case .wed: "wed" + case .thu: "thu" + case .fri: "fri" + case .sat: "sat" + case .sun: "sun" + case let .unknown(value): value + } + } + + init(from decoder: any Decoder) throws { + self.init(rawValue: try decoder.singleValueContainer().decode(String.self)) + } + + func encode(to encoder: any Encoder) throws { + var container = encoder.singleValueContainer() + try container.encode(rawValue) + } +} + +struct Workspace: Codable, Hashable, Sendable { + var id: String + var name: String + var slug: String + var timeZone: String + var setupCompletedAt: Date? + + private enum CodingKeys: String, CodingKey { + case id + case name + case slug + case timeZone + case setupCompletedAt + } + + func encode(to encoder: any Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(id, forKey: .id) + try container.encode(name, forKey: .name) + try container.encode(slug, forKey: .slug) + try container.encode(timeZone, forKey: .timeZone) + try container.encode(setupCompletedAt, forKey: .setupCompletedAt) + } +} + +struct WorkspaceDetails: Codable, Hashable, Sendable { + var name: String + var slug: String +} + +struct WorkspaceInvitation: Codable, Hashable, Sendable { + var id: String + var email: String + var role: AssignableWorkspaceRole + var expiresAt: Date + var sentAt: Date +} + +struct WorkspaceMember: Codable, Hashable, Sendable { + var id: String + var role: WorkspaceRole + var user: SessionUser + var joinedAt: Date +} + +struct WorkspaceMemberUpdate: Codable, Hashable, Sendable { + var role: AssignableWorkspaceRole +} + +struct WorkspaceModel: Codable, Hashable, Sendable { + var providerId: String + var providerName: String + var providerPreset: ProviderPresetId? + var providerActive: Bool + var modelId: String + var displayName: String? + var capabilities: [ProviderModelCapability] + + private enum CodingKeys: String, CodingKey { + case providerId + case providerName + case providerPreset + case providerActive + case modelId + case displayName + case capabilities + } + + func encode(to encoder: any Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(providerId, forKey: .providerId) + try container.encode(providerName, forKey: .providerName) + try container.encode(providerPreset, forKey: .providerPreset) + try container.encode(providerActive, forKey: .providerActive) + try container.encode(modelId, forKey: .modelId) + try container.encode(displayName, forKey: .displayName) + try container.encode(capabilities, forKey: .capabilities) + } +} + +struct WorkspaceModelsResponse: Codable, Hashable, Sendable { + var models: [WorkspaceModel] + var defaultModel: String? + + private enum CodingKeys: String, CodingKey { + case models + case defaultModel + } + + func encode(to encoder: any Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(models, forKey: .models) + try container.encode(defaultModel, forKey: .defaultModel) + } +} + +struct WorkspacePermissions: Codable, Hashable, Sendable { + var createPods: Bool + var updateWorkspace: Bool + var manageProviders: Bool + var manageMembers: Bool + var configureBuiltInAgents: Bool + var manageUsage: Bool + var manageAdmins: Bool + var transferOwnership: Bool + var deleteWorkspace: Bool +} + +enum WorkspaceRole: RawRepresentable, Codable, Hashable, Sendable, ParameterValue { + case owner + case admin + case member + case viewer + /// A value from a newer server than this app knows. + case unknown(String) + + /// Every value this app knows. + static let known: [Self] = [.owner, .admin, .member, .viewer] + + init(rawValue: String) { + switch rawValue { + case "owner": self = .owner + case "admin": self = .admin + case "member": self = .member + case "viewer": self = .viewer + default: self = .unknown(rawValue) + } + } + + var rawValue: String { + switch self { + case .owner: "owner" + case .admin: "admin" + case .member: "member" + case .viewer: "viewer" + case let .unknown(value): value + } + } + + init(from decoder: any Decoder) throws { + self.init(rawValue: try decoder.singleValueContainer().decode(String.self)) + } + + func encode(to encoder: any Encoder) throws { + var container = encoder.singleValueContainer() + try container.encode(rawValue) + } +} + +struct WorkspaceRoutine: Codable, Hashable, Sendable { + var routine: Routine + var agent: Agent + var pod: Pod + + struct Pod: Codable, Hashable, Sendable { + var id: String + var slug: String + } +} + +struct WorkspaceRoutineList: Codable, Hashable, Sendable { + var items: [WorkspaceRoutine] +} + +struct WorkspaceTimeZone: Codable, Hashable, Sendable { + var timeZone: String + var scheduledRoutines: Double +} + +struct WorkspaceTimeZoneChange: Codable, Hashable, Sendable { + var timeZone: String +} + +enum WorkspaceUpdateEvent: Codable, Hashable, Sendable { + case threadChanged(ThreadChanged) + case conversationThreadChanged(ConversationThreadChanged) + case reset(Reset) + /// A kind from a newer server than this app knows, by its `type`. + case unknown(String) + + init(from decoder: any Decoder) throws { + let tag = try decoder.container(keyedBy: AnyCodingKey.self).decode(String.self, forKey: AnyCodingKey("type")) + switch tag { + case "thread.changed": self = .threadChanged(try ThreadChanged(from: decoder)) + case "conversation.thread_changed": self = .conversationThreadChanged(try ConversationThreadChanged(from: decoder)) + case "reset": self = .reset(try Reset(from: decoder)) + default: self = .unknown(tag) + } + } + + func encode(to encoder: any Encoder) throws { + switch self { + case let .threadChanged(value): try value.encode(to: encoder) + case let .conversationThreadChanged(value): try value.encode(to: encoder) + case let .reset(value): try value.encode(to: encoder) + case let .unknown(tag): + throw EncodingError.invalidValue(tag, .init(codingPath: encoder.codingPath, debugDescription: "A kind this app doesn't know can't be sent.")) + } + } + + struct ThreadChanged: Codable, Hashable, Sendable { + var v: Int = 1 + var type: String = "thread.changed" + var threadId: String + } + + struct ConversationThreadChanged: Codable, Hashable, Sendable { + var v: Int = 1 + var type: String = "conversation.thread_changed" + var conversationId: String + var threadId: String + } + + struct Reset: Codable, Hashable, Sendable { + var v: Int = 1 + var type: String = "reset" + } +} + +struct WorkspaceUsage: Codable, Hashable, Sendable { + var month: String + var timeZone: String + var usd: Double + var unpricedRequests: Int + var days: [UsageDay] + var bots: [BotUsage] + var models: [ModelUsage] + var pods: [PodUsage] + var systemAgents: SystemAgents + + struct SystemAgents: Codable, Hashable, Sendable { + var usd: Double + var unpricedRequests: Int + } +} + +// MARK: Requests + +extension APIClient { + + func health() async throws -> HealthResponse { + return try await call("GET", "health", query: []) + } + + func me() async throws -> Me { + return try await call("GET", "me", query: []) + } + + func workspaceAccess(workspace: String) async throws -> WorkspaceAccessResponse { + return try await call("GET", "workspaces/\(pathSegment(workspace))/me", query: []) + } + + struct WorkspaceAccessResponse: Codable, Hashable, Sendable { + var role: WorkspaceRole? + var permissions: WorkspacePermissions + } +} + +extension APIClient { + var agents: AgentsRoutes { AgentsRoutes(client: self) } + + /// The `agents` routes, as `api.agents` in the web's client. + struct AgentsRoutes: Sendable { + let client: APIClient + + func list(workspace: String) async throws -> [Agent] { + return try await client.call("GET", "workspaces/\(pathSegment(workspace))/agents", query: []) + } + + func create(podId: String, name: String, handle: String? = nil, description: Omittable = .omitted, color: AgentColor? = nil, face: AgentFace? = nil, shape: AgentShape? = nil, model: String, prompt: String? = nil, disabledTools: [String]? = nil, usesSandbox: Bool? = nil, naturalBrowsing: Bool? = nil) async throws -> Agent { + return try await client.call("POST", "pods/\(pathSegment(podId))/agents", query: [], body: NewAgentInPod(name: name, handle: handle, description: description, color: color, face: face, shape: shape, model: model, prompt: prompt, disabledTools: disabledTools, usesSandbox: usesSandbox, naturalBrowsing: naturalBrowsing)) + } + + func get(agentId: String) async throws -> Agent { + return try await client.call("GET", "agents/\(pathSegment(agentId))", query: []) + } + + func update(agentId: String, name: String? = nil, handle: Omittable = .omitted, description: Omittable = .omitted, color: Omittable = .omitted, face: Omittable = .omitted, shape: Omittable = .omitted, model: Omittable = .omitted, prompt: Omittable = .omitted, disabledTools: Omittable<[String]> = .omitted, usesSandbox: Omittable = .omitted, naturalBrowsing: Omittable = .omitted) async throws -> Agent { + return try await client.call("PATCH", "agents/\(pathSegment(agentId))", query: [], body: AgentUpdate(name: name, handle: handle, description: description, color: color, face: face, shape: shape, model: model, prompt: prompt, disabledTools: disabledTools, usesSandbox: usesSandbox, naturalBrowsing: naturalBrowsing)) + } + + func remove(agentId: String) async throws { + _ = try await client.callForData("DELETE", "agents/\(pathSegment(agentId))", query: []) + } + } +} + +extension APIClient { + var artifacts: ArtifactsRoutes { ArtifactsRoutes(client: self) } + + /// The `artifacts` routes, as `api.artifacts` in the web's client. + struct ArtifactsRoutes: Sendable { + let client: APIClient + + func list(podId: String) async throws -> [ArtifactSummary] { + return try await client.call("GET", "pods/\(pathSegment(podId))/artifacts", query: []) + } + + func get(podId: String, artifactId: String) async throws -> Artifact { + return try await client.call("GET", "pods/\(pathSegment(podId))/artifacts/\(pathSegment(artifactId))", query: []) + } + + func remove(podId: String, artifactId: String) async throws { + _ = try await client.callForData("DELETE", "pods/\(pathSegment(podId))/artifacts/\(pathSegment(artifactId))", query: []) + } + + func versions(podId: String, artifactId: String) async throws -> [ArtifactVersionSummary] { + return try await client.call("GET", "pods/\(pathSegment(podId))/artifacts/\(pathSegment(artifactId))/versions", query: []) + } + + func getVersion(podId: String, artifactId: String, version: String) async throws -> Artifact { + return try await client.call("GET", "pods/\(pathSegment(podId))/artifacts/\(pathSegment(artifactId))/versions/\(pathSegment(version))", query: []) + } + + func pageAddress(podId: String, artifactId: String, version: String) async throws -> PageAddressResponse { + return try await client.call("GET", "pods/\(pathSegment(podId))/artifacts/\(pathSegment(artifactId))/versions/\(pathSegment(version))/page", query: []) + } + + struct PageAddressResponse: Codable, Hashable, Sendable { + var url: String? + + private enum CodingKeys: String, CodingKey { + case url + } + + func encode(to encoder: any Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(url, forKey: .url) + } + } + } +} + +extension APIClient { + var chats: ChatsRoutes { ChatsRoutes(client: self) } + + /// The `chats` routes, as `api.chats` in the web's client. + struct ChatsRoutes: Sendable { + let client: APIClient + + func list(workspace: String, pod: String) async throws -> ChatList { + var query = QueryItems() + query.add("pod", pod) + return try await client.call("GET", "workspaces/\(pathSegment(workspace))/chats", query: query.items) + } + + func podMarkers(workspace: String) async throws -> PodChatMarkers { + return try await client.call("GET", "workspaces/\(pathSegment(workspace))/chats/pod-markers", query: []) + } + + func activity(workspace: String) async throws -> ActivityFeed { + return try await client.call("GET", "workspaces/\(pathSegment(workspace))/chats/activity", query: []) + } + + func approvals(workspace: String) async throws -> ApprovalInbox { + return try await client.call("GET", "workspaces/\(pathSegment(workspace))/chats/approvals", query: []) + } + + func openBotChannel(workspace: String, podId: String, hostAgentId: String) async throws -> BotChannel { + return try await client.call("POST", "workspaces/\(pathSegment(workspace))/bot-channels", query: [], body: OpenBotChannel(podId: podId, hostAgentId: hostAgentId)) + } + + func openRoutineFeed(workspace: String, routineId: String) async throws -> RoutineFeed { + return try await client.call("POST", "workspaces/\(pathSegment(workspace))/routines/\(pathSegment(routineId))/thread", query: []) + } + + func openPodChat(workspace: String, podId: String) async throws -> PodChat { + return try await client.call("POST", "workspaces/\(pathSegment(workspace))/pods/\(pathSegment(podId))/chat", query: []) + } + + func startChat(podId: String, name: String) async throws -> PodChat { + return try await client.call("POST", "pods/\(pathSegment(podId))/chats", query: [], body: NewChat(name: name)) + } + + func renameChat(conversationId: String, name: String) async throws { + _ = try await client.callForData("PUT", "conversations/\(pathSegment(conversationId))/name", query: [], body: NewChat(name: name)) + } + + func archiveChat(conversationId: String) async throws { + _ = try await client.callForData("PUT", "conversations/\(pathSegment(conversationId))/archived", query: []) + } + + func startThread(conversationId: String, id: String, message: String, attachments: [String]? = nil, hostAgentId: String? = nil, replyTo: String? = nil) async throws -> StartedThread { + return try await client.call("POST", "conversations/\(pathSegment(conversationId))/threads", query: [], body: NewThread(id: id, message: message, attachments: attachments, hostAgentId: hostAgentId, replyTo: replyTo)) + } + + func threadFrom(messageId: String) async throws -> ConversationThread { + return try await client.call("POST", "messages/\(pathSegment(messageId))/thread", query: []) + } + + func messages(conversationId: String, cursor: String? = nil, limit: Int? = nil) async throws -> ChatMessagesPage { + var query = QueryItems() + query.add("cursor", cursor) + query.add("limit", limit) + return try await client.call("GET", "conversations/\(pathSegment(conversationId))/messages", query: query.items) + } + + func send(conversationId: String, id: String, message: String, attachments: [String]? = nil, replyTo: String? = nil) async throws -> Message { + return try await client.call("POST", "conversations/\(pathSegment(conversationId))/messages", query: [], body: NewMessage(id: id, message: message, attachments: attachments, replyTo: replyTo)) + } + + func history(conversationId: String, cursor: String? = nil, limit: Int? = nil) async throws -> ChatHistoryPage { + var query = QueryItems() + query.add("cursor", cursor) + query.add("limit", limit) + return try await client.call("GET", "conversations/\(pathSegment(conversationId))/history", query: query.items) + } + + func markDone(conversationId: String) async throws { + _ = try await client.callForData("PUT", "conversations/\(pathSegment(conversationId))/done", query: []) + } + + func reopen(conversationId: String) async throws { + _ = try await client.callForData("DELETE", "conversations/\(pathSegment(conversationId))/done", query: []) + } + + func markRead(conversationId: String) async throws { + _ = try await client.callForData("POST", "conversations/\(pathSegment(conversationId))/read", query: []) + } + + func uploadFile(conversationId: String, name: String, type: String? = nil, data: Data) async throws -> UploadedAttachment { + var query = QueryItems() + query.add("name", name) + query.add("type", type) + return try await client.call("POST", "conversations/\(pathSegment(conversationId))/files", query: query.items, data: data) + } + + func removeFile(conversationId: String, fileId: String) async throws { + _ = try await client.callForData("DELETE", "conversations/\(pathSegment(conversationId))/files/\(pathSegment(fileId))", query: []) + } + + func file(conversationId: String, fileId: String) async throws -> Data { + return try await client.callForData("GET", "conversations/\(pathSegment(conversationId))/files/\(pathSegment(fileId))", query: []) + } + } +} + +extension APIClient { + var connections: ConnectionsRoutes { ConnectionsRoutes(client: self) } + + /// The `connections` routes, as `api.connections` in the web's client. + struct ConnectionsRoutes: Sendable { + let client: APIClient + + func list(podId: String) async throws -> [Connection] { + return try await client.call("GET", "pods/\(pathSegment(podId))/connections", query: []) + } + + func create(podId: String, body: NewConnection) async throws -> Connection { + return try await client.call("POST", "pods/\(pathSegment(podId))/connections", query: [], body: body) + } + + func testUnsaved(podId: String, url: String, secretHeader: String? = nil, secret: String? = nil) async throws -> ConnectionTestResult { + return try await client.call("POST", "pods/\(pathSegment(podId))/connections/test", query: [], body: UnsavedConnection(url: url, secretHeader: secretHeader, secret: secret)) + } + + func get(podId: String, connectionId: String) async throws -> ConnectionWithTools { + return try await client.call("GET", "pods/\(pathSegment(podId))/connections/\(pathSegment(connectionId))", query: []) + } + + func update(podId: String, connectionId: String, name: String? = nil, url: String? = nil, secretHeader: Omittable = .omitted, secret: Omittable = .omitted, access: ConnectionAccess? = nil, toolAccess: [String: ConnectionAccess]? = nil) async throws -> Connection { + return try await client.call("PATCH", "pods/\(pathSegment(podId))/connections/\(pathSegment(connectionId))", query: [], body: ConnectionUpdate(name: name, url: url, secretHeader: secretHeader, secret: secret, access: access, toolAccess: toolAccess)) + } + + func remove(podId: String, connectionId: String) async throws { + _ = try await client.callForData("DELETE", "pods/\(pathSegment(podId))/connections/\(pathSegment(connectionId))", query: []) + } + + func test(podId: String, connectionId: String) async throws -> ConnectionTestResult { + return try await client.call("POST", "pods/\(pathSegment(podId))/connections/\(pathSegment(connectionId))/test", query: []) + } + + func connectFromCatalog(podId: String, name: String, url: String) async throws -> ConnectFromCatalogResult { + return try await client.call("POST", "pods/\(pathSegment(podId))/connections/connect", query: [], body: ConnectFromCatalog(name: name, url: url)) + } + + func startOAuth(podId: String, connectionId: String) async throws -> ConnectionOauthStart { + return try await client.call("POST", "pods/\(pathSegment(podId))/connections/\(pathSegment(connectionId))/oauth/start", query: []) + } + + func oauthCallback(code: String? = nil, state: String? = nil, error: String? = nil, errorDescription: String? = nil) async throws { + var query = QueryItems() + query.add("code", code) + query.add("state", state) + query.add("error", error) + query.add("error_description", errorDescription) + _ = try await client.callForData("GET", "connections/oauth/callback", query: query.items) + } + } +} + +extension APIClient { + var events: EventsRoutes { EventsRoutes(client: self) } + + /// The `events` routes, as `api.events` in the web's client. + struct EventsRoutes: Sendable { + let client: APIClient + + func typing(threadId: String) async throws { + _ = try await client.callForData("POST", "threads/\(pathSegment(threadId))/typing", query: []) + } + } +} + +extension APIClient { + var gitHubConnections: GitHubConnectionsRoutes { GitHubConnectionsRoutes(client: self) } + + /// The `gitHubConnections` routes, as `api.gitHubConnections` in the web's client. + struct GitHubConnectionsRoutes: Sendable { + let client: APIClient + + func start(podId: String, organization: String? = nil) async throws -> GitHubAppForm { + return try await client.call("POST", "pods/\(pathSegment(podId))/github", query: [], body: NewGitHubApp(organization: organization)) + } + + func installUrl(podId: String, connectionId: String) async throws -> GitHubAppInstall { + return try await client.call("POST", "pods/\(pathSegment(podId))/connections/\(pathSegment(connectionId))/github/install", query: []) + } + + func reachableRepositories(podId: String, connectionId: String) async throws -> [AccountRepository] { + return try await client.call("GET", "pods/\(pathSegment(podId))/connections/\(pathSegment(connectionId))/github/reachable", query: []) + } + + func repositories(podId: String, connectionId: String) async throws -> ConnectionRepositories { + return try await client.call("GET", "pods/\(pathSegment(podId))/connections/\(pathSegment(connectionId))/repositories", query: []) + } + + func addRepository(podId: String, connectionId: String, repository: String) async throws -> ConnectionRepositories { + return try await client.call("POST", "pods/\(pathSegment(podId))/connections/\(pathSegment(connectionId))/repositories", query: [], body: ConnectionRepositoryChange(repository: repository)) + } + + func removeRepository(podId: String, connectionId: String, repository: String) async throws -> ConnectionRepositories { + return try await client.call("POST", "pods/\(pathSegment(podId))/connections/\(pathSegment(connectionId))/repositories/remove", query: [], body: ConnectionRepositoryChange(repository: repository)) + } + + func gitHubAppMade(code: String? = nil, state: String? = nil) async throws { + var query = QueryItems() + query.add("code", code) + query.add("state", state) + _ = try await client.callForData("GET", "connections/github/made", query: query.items) + } + + func gitHubAppInstalled(installationId: String? = nil, state: String? = nil) async throws { + var query = QueryItems() + query.add("installation_id", installationId) + query.add("state", state) + _ = try await client.callForData("GET", "connections/github/installed", query: query.items) + } + } +} + +extension APIClient { + var gitHubWebhooks: GitHubWebhooksRoutes { GitHubWebhooksRoutes(client: self) } + + /// The `gitHubWebhooks` routes, as `api.gitHubWebhooks` in the web's client. + struct GitHubWebhooksRoutes: Sendable { + let client: APIClient + + func delivery(connectionId: String, body: JSONValue) async throws { + _ = try await client.callForData("POST", "hooks/connections/\(pathSegment(connectionId))", query: [], body: body) + } + } +} + +extension APIClient { + var modelProviders: ModelProvidersRoutes { ModelProvidersRoutes(client: self) } + + /// The `modelProviders` routes, as `api.modelProviders` in the web's client. + struct ModelProvidersRoutes: Sendable { + let client: APIClient + + func list(workspace: String) async throws -> [ModelProvider] { + return try await client.call("GET", "workspaces/\(pathSegment(workspace))/model-providers", query: []) + } + + func create(workspace: String, body: NewModelProvider) async throws -> ModelProvider { + return try await client.call("POST", "workspaces/\(pathSegment(workspace))/model-providers", query: [], body: body) + } + + func listEnabledModels(workspace: String) async throws -> WorkspaceModelsResponse { + return try await client.call("GET", "workspaces/\(pathSegment(workspace))/model-providers/models", query: []) + } + + func setDefaultModel(workspace: String, model: String) async throws -> WorkspaceModelsResponse { + return try await client.call("PUT", "workspaces/\(pathSegment(workspace))/model-providers/models/default", query: [], body: DefaultModelUpdate(model: model)) + } + + func get(workspace: String, providerId: String) async throws -> ModelProvider { + return try await client.call("GET", "workspaces/\(pathSegment(workspace))/model-providers/\(pathSegment(providerId))", query: []) + } + + func update(workspace: String, providerId: String, active: Bool? = nil, baseUrl: String? = nil, apiFormat: ProviderApiFormat? = nil, apiKey: Omittable = .omitted, customHeaders: [ProviderHeader]? = nil) async throws -> ModelProvider { + return try await client.call("PATCH", "workspaces/\(pathSegment(workspace))/model-providers/\(pathSegment(providerId))", query: [], body: ModelProviderUpdate(active: active, baseUrl: baseUrl, apiFormat: apiFormat, apiKey: apiKey, customHeaders: customHeaders)) + } + + func remove(workspace: String, providerId: String) async throws { + _ = try await client.callForData("DELETE", "workspaces/\(pathSegment(workspace))/model-providers/\(pathSegment(providerId))", query: []) + } + + func switchOff(workspace: String, providerId: String, moveBots: [BotMove], newBotsTo: String? = nil, summariesTo: String? = nil) async throws -> SwitchOffResponse { + return try await client.call("POST", "workspaces/\(pathSegment(workspace))/model-providers/\(pathSegment(providerId))/switch-off", query: [], body: ProviderSwitchOff(moveBots: moveBots, newBotsTo: newBotsTo, summariesTo: summariesTo)) + } + + func test(workspace: String, providerId: String) async throws -> ProviderTestResult { + return try await client.call("POST", "workspaces/\(pathSegment(workspace))/model-providers/\(pathSegment(providerId))/test", query: []) + } + + func startSignIn(workspace: String, providerId: String) async throws -> ProviderSignInStarted { + return try await client.call("POST", "workspaces/\(pathSegment(workspace))/model-providers/\(pathSegment(providerId))/sign-in", query: []) + } + + func signOut(workspace: String, providerId: String) async throws -> ModelProvider { + return try await client.call("DELETE", "workspaces/\(pathSegment(workspace))/model-providers/\(pathSegment(providerId))/sign-in", query: []) + } + + func completeSignIn(workspace: String, providerId: String, attempt: String) async throws -> ProviderSignInOutcome { + return try await client.call("POST", "workspaces/\(pathSegment(workspace))/model-providers/\(pathSegment(providerId))/sign-in/complete", query: [], body: ProviderSignInCompletion(attempt: attempt)) + } + + func fetchModels(workspace: String, providerId: String) async throws -> ProviderFetchResult { + return try await client.call("POST", "workspaces/\(pathSegment(workspace))/model-providers/\(pathSegment(providerId))/fetch-models", query: []) + } + + func addModel(workspace: String, providerId: String, modelId: String, displayName: Omittable = .omitted, capabilities: [ProviderModelCapability]? = nil, contextLength: Omittable = .omitted) async throws -> ModelProvider { + return try await client.call("POST", "workspaces/\(pathSegment(workspace))/model-providers/\(pathSegment(providerId))/models", query: [], body: NewProviderModel(modelId: modelId, displayName: displayName, capabilities: capabilities, contextLength: contextLength)) + } + + func setModelsEnabled(workspace: String, providerId: String, modelIds: [String], enabled: Bool) async throws -> SetModelsEnabledResponse { + return try await client.call("PATCH", "workspaces/\(pathSegment(workspace))/model-providers/\(pathSegment(providerId))/models", query: [], body: BulkProviderModelUpdate(modelIds: modelIds, enabled: enabled)) + } + + func updateModel(workspace: String, providerId: String, modelId: String, enabled: Bool? = nil, disabledCapabilities: [ProviderModelCapability]? = nil, capabilities: [ProviderModelCapability]? = nil) async throws -> UpdateModelResponse { + return try await client.call("PATCH", "workspaces/\(pathSegment(workspace))/model-providers/\(pathSegment(providerId))/models/\(pathSegment(modelId))", query: [], body: ProviderModelUpdate(enabled: enabled, disabledCapabilities: disabledCapabilities, capabilities: capabilities)) + } + + func removeModel(workspace: String, providerId: String, modelId: String) async throws { + _ = try await client.callForData("DELETE", "workspaces/\(pathSegment(workspace))/model-providers/\(pathSegment(providerId))/models/\(pathSegment(modelId))", query: []) + } + + func switchOffModel(workspace: String, providerId: String, modelId: String, moveBotsTo: String? = nil, newBotsTo: String? = nil, summariesTo: String? = nil) async throws -> SwitchOffModelResponse { + return try await client.call("POST", "workspaces/\(pathSegment(workspace))/model-providers/\(pathSegment(providerId))/models/\(pathSegment(modelId))/switch-off", query: [], body: ProviderModelSwitchOff(moveBotsTo: moveBotsTo, newBotsTo: newBotsTo, summariesTo: summariesTo)) + } + + struct SwitchOffResponse: Codable, Hashable, Sendable { + var moved: Int + } + + struct SetModelsEnabledResponse: Codable, Hashable, Sendable { + var updated: Int + } + + struct UpdateModelResponse: Codable, Hashable, Sendable { + var updated: Int + } + + struct SwitchOffModelResponse: Codable, Hashable, Sendable { + var moved: Int + } + } +} + +extension APIClient { + var modelTrials: ModelTrialsRoutes { ModelTrialsRoutes(client: self) } + + /// The `modelTrials` routes, as `api.modelTrials` in the web's client. + struct ModelTrialsRoutes: Sendable { + let client: APIClient + + func run(workspace: String, systemAgentKey: SystemAgentKey, model: String) async throws -> ModelTrial { + return try await client.call("POST", "workspaces/\(pathSegment(workspace))/model-trials", query: [], body: NewModelTrial(systemAgentKey: systemAgentKey, model: model)) + } + } +} + +extension APIClient { + var notifications: NotificationsRoutes { NotificationsRoutes(client: self) } + + /// The `notifications` routes, as `api.notifications` in the web's client. + struct NotificationsRoutes: Sendable { + let client: APIClient + + func settings() async throws -> NotificationSettings { + return try await client.call("GET", "notifications", query: []) + } + + func updatePreferences(level: NotificationLevel, pausedUntil: Date? = nil, quietHours: QuietHours? = nil, turnFailures: Bool, routineRuns: RoutineRunNotifications) async throws -> NotificationSettings { + return try await client.call("PUT", "notifications", query: [], body: NotificationPreferences(level: level, pausedUntil: pausedUntil, quietHours: quietHours, turnFailures: turnFailures, routineRuns: routineRuns)) + } + + func setLevel(kind: NotificationPlaceKind, id: String, level: NotificationLevel? = nil) async throws { + _ = try await client.callForData("PUT", "notifications/\(pathSegment(kind))/\(pathSegment(id))/level", query: [], body: NotificationLevelChoice(level: level)) + } + + func mute(kind: NotificationPlaceKind, id: String, until: Date? = nil) async throws { + _ = try await client.callForData("PUT", "notifications/\(pathSegment(kind))/\(pathSegment(id))/mute", query: [], body: NotificationMute(until: until)) + } + + func sendTest() async throws { + _ = try await client.callForData("POST", "notifications/test", query: []) + } + + func reportPresence(clientId: String, conversationId: String? = nil, sequence: Int) async throws { + _ = try await client.callForData("PUT", "notifications/presence", query: [], body: Presence(clientId: clientId, conversationId: conversationId, sequence: sequence)) + } + } +} + +extension APIClient { + var onboarding: OnboardingRoutes { OnboardingRoutes(client: self) } + + /// The `onboarding` routes, as `api.onboarding` in the web's client. + struct OnboardingRoutes: Sendable { + let client: APIClient + + func complete(workspaceId: String, podId: String, agentId: String) async throws { + _ = try await client.callForData("POST", "onboarding/complete", query: [], body: CompleteOnboarding(workspaceId: workspaceId, podId: podId, agentId: agentId)) + } + } +} + +extension APIClient { + var pods: PodsRoutes { PodsRoutes(client: self) } + + /// The `pods` routes, as `api.pods` in the web's client. + struct PodsRoutes: Sendable { + let client: APIClient + + func list(workspace: String) async throws -> [Pod] { + return try await client.call("GET", "workspaces/\(pathSegment(workspace))/pods", query: []) + } + + func create(workspace: String, name: String, slug: String? = nil, color: PodColor? = nil) async throws -> Pod { + return try await client.call("POST", "workspaces/\(pathSegment(workspace))/pods", query: [], body: NewPod(name: name, slug: slug, color: color)) + } + + func ensurePersonal(workspace: String, model: String) async throws -> Pod { + return try await client.call("POST", "workspaces/\(pathSegment(workspace))/personal-pod", query: [], body: EnsurePersonalBody(model: model)) + } + + func update(podId: String, name: String? = nil, slug: Omittable = .omitted, color: Omittable = .omitted) async throws -> Pod { + return try await client.call("PATCH", "pods/\(pathSegment(podId))", query: [], body: PodUpdate(name: name, slug: slug, color: color)) + } + + func remove(podId: String) async throws { + _ = try await client.callForData("DELETE", "pods/\(pathSegment(podId))", query: []) + } + + func listMembers(podId: String) async throws -> [PodMember] { + return try await client.call("GET", "pods/\(pathSegment(podId))/members", query: []) + } + + func addMember(podId: String, userId: String) async throws { + _ = try await client.callForData("POST", "pods/\(pathSegment(podId))/members", query: [], body: NewPodMember(userId: userId)) + } + + func removeMember(podId: String, userId: String) async throws { + _ = try await client.callForData("DELETE", "pods/\(pathSegment(podId))/members/\(pathSegment(userId))", query: []) + } + + func leave(podId: String) async throws { + _ = try await client.callForData("DELETE", "pods/\(pathSegment(podId))/membership", query: []) + } + + struct EnsurePersonalBody: Codable, Hashable, Sendable { + var model: String + } + } +} + +extension APIClient { + var podSandbox: PodSandboxRoutes { PodSandboxRoutes(client: self) } + + /// The `podSandbox` routes, as `api.podSandbox` in the web's client. + struct PodSandboxRoutes: Sendable { + let client: APIClient + + func get(podId: String) async throws -> PodSandbox { + return try await client.call("GET", "pods/\(pathSegment(podId))/sandbox", query: []) + } + + func reset(podId: String) async throws -> PodSandbox { + return try await client.call("POST", "pods/\(pathSegment(podId))/sandbox/reset", query: []) + } + + func upgrade(podId: String) async throws -> PodSandbox { + return try await client.call("POST", "pods/\(pathSegment(podId))/sandbox/upgrade", query: []) + } + + func network(podId: String) async throws -> PodSandboxNetwork { + return try await client.call("GET", "pods/\(pathSegment(podId))/sandbox/network", query: []) + } + + func addHost(podId: String, host: String) async throws -> PodSandboxNetwork { + return try await client.call("POST", "pods/\(pathSegment(podId))/sandbox/network/hosts", query: [], body: NewSandboxHost(host: host)) + } + + func removeHost(podId: String, host: String) async throws -> PodSandboxNetwork { + return try await client.call("DELETE", "pods/\(pathSegment(podId))/sandbox/network/hosts/\(pathSegment(host))", query: []) + } + } +} + +extension APIClient { + var referrals: ReferralsRoutes { ReferralsRoutes(client: self) } + + /// The `referrals` routes, as `api.referrals` in the web's client. + struct ReferralsRoutes: Sendable { + let client: APIClient + + func link() async throws -> ReferralLink { + return try await client.call("GET", "referral-link", query: []) + } + + func resetLink() async throws -> ResetReferralLink { + return try await client.call("POST", "referral-link/reset", query: []) + } + } +} + +extension APIClient { + var routines: RoutinesRoutes { RoutinesRoutes(client: self) } + + /// The `routines` routes, as `api.routines` in the web's client. + struct RoutinesRoutes: Sendable { + let client: APIClient + + func listInWorkspace(workspace: String) async throws -> WorkspaceRoutineList { + return try await client.call("GET", "workspaces/\(pathSegment(workspace))/routines", query: []) + } + + func list(agentId: String) async throws -> [Routine] { + return try await client.call("GET", "agents/\(pathSegment(agentId))/routines", query: []) + } + + func create(agentId: String, name: String, instructions: String, state: RoutineState? = nil, results: RoutineResults? = nil, chatId: Omittable = .omitted, triggers: [RoutineTriggerInput]) async throws -> RoutineWriteResult { + return try await client.call("POST", "agents/\(pathSegment(agentId))/routines", query: [], body: NewRoutine(name: name, instructions: instructions, state: state, results: results, chatId: chatId, triggers: triggers)) + } + + func previewSchedule(agentId: String, schedule: RoutineSchedule, timezone: String) async throws -> RoutineScheduleOccurrences { + return try await client.call("POST", "agents/\(pathSegment(agentId))/routines/schedule-preview", query: [], body: RoutineSchedulePreview(schedule: schedule, timezone: timezone)) + } + + func get(agentId: String, routineId: String) async throws -> Routine { + return try await client.call("GET", "agents/\(pathSegment(agentId))/routines/\(pathSegment(routineId))", query: []) + } + + func update(agentId: String, routineId: String, name: String? = nil, instructions: String? = nil, state: RoutineState? = nil, results: RoutineResults? = nil, chatId: Omittable = .omitted) async throws -> RoutineWriteResult { + return try await client.call("PATCH", "agents/\(pathSegment(agentId))/routines/\(pathSegment(routineId))", query: [], body: RoutineUpdate(name: name, instructions: instructions, state: state, results: results, chatId: chatId)) + } + + func remove(agentId: String, routineId: String) async throws { + _ = try await client.callForData("DELETE", "agents/\(pathSegment(agentId))/routines/\(pathSegment(routineId))", query: []) + } + + func run(agentId: String, routineId: String, requestId: String) async throws -> AcceptedRoutineExecution { + return try await client.call("POST", "agents/\(pathSegment(agentId))/routines/\(pathSegment(routineId))/run", query: [], body: ManualRoutineRun(requestId: requestId)) + } + + func addTrigger(agentId: String, routineId: String, body: RoutineTriggerInput) async throws -> RoutineWriteResult { + return try await client.call("POST", "agents/\(pathSegment(agentId))/routines/\(pathSegment(routineId))/triggers", query: [], body: body) + } + + func updateTrigger(agentId: String, routineId: String, triggerId: String, body: RoutineTriggerInput) async throws -> RoutineWriteResult { + return try await client.call("PUT", "agents/\(pathSegment(agentId))/routines/\(pathSegment(routineId))/triggers/\(pathSegment(triggerId))", query: [], body: body) + } + + func removeTrigger(agentId: String, routineId: String, triggerId: String) async throws -> Routine { + return try await client.call("DELETE", "agents/\(pathSegment(agentId))/routines/\(pathSegment(routineId))/triggers/\(pathSegment(triggerId))", query: []) + } + + func getSecret(agentId: String, routineId: String, triggerId: String) async throws -> RoutineCurrentSecret { + return try await client.call("GET", "agents/\(pathSegment(agentId))/routines/\(pathSegment(routineId))/triggers/\(pathSegment(triggerId))/secret", query: []) + } + + func rotateSecret(agentId: String, routineId: String, triggerId: String, secret: Omittable = .omitted) async throws -> RoutineSecret { + return try await client.call("POST", "agents/\(pathSegment(agentId))/routines/\(pathSegment(routineId))/triggers/\(pathSegment(triggerId))/secret", query: [], body: RoutineSecretReplacement(secret: secret)) + } + + func executions(agentId: String, routineId: String, cursor: String? = nil, limit: Int? = nil) async throws -> RoutineExecutionPage { + var query = QueryItems() + query.add("cursor", cursor) + query.add("limit", limit) + return try await client.call("GET", "agents/\(pathSegment(agentId))/routines/\(pathSegment(routineId))/executions", query: query.items) + } + + func webhook(triggerId: String, body: JSONValue) async throws -> WebhookResponse { + return try await client.call("POST", "hooks/triggers/\(pathSegment(triggerId))", query: [], body: body) + } + + func routineWebhook(routineId: String, body: JSONValue) async throws -> RoutineWebhookResponse { + return try await client.call("POST", "hooks/routines/\(pathSegment(routineId))", query: [], body: body) + } + + enum WebhookResponse: Codable, Hashable, Sendable { + case ignoredRoutineWebhook(IgnoredRoutineWebhook) + case routineWebhookChallenge(RoutineWebhookChallenge) + + init(from decoder: any Decoder) throws { + if let value = try? IgnoredRoutineWebhook(from: decoder) { self = .ignoredRoutineWebhook(value); return } + if let value = try? RoutineWebhookChallenge(from: decoder) { self = .routineWebhookChallenge(value); return } + throw DecodingError.dataCorrupted(.init(codingPath: decoder.codingPath, debugDescription: "None of WebhookResponse's kinds.")) + } + + func encode(to encoder: any Encoder) throws { + switch self { + case let .ignoredRoutineWebhook(value): try value.encode(to: encoder) + case let .routineWebhookChallenge(value): try value.encode(to: encoder) + } + } + } + + enum RoutineWebhookResponse: Codable, Hashable, Sendable { + case ignoredRoutineWebhook(IgnoredRoutineWebhook) + case routineWebhookChallenge(RoutineWebhookChallenge) + + init(from decoder: any Decoder) throws { + if let value = try? IgnoredRoutineWebhook(from: decoder) { self = .ignoredRoutineWebhook(value); return } + if let value = try? RoutineWebhookChallenge(from: decoder) { self = .routineWebhookChallenge(value); return } + throw DecodingError.dataCorrupted(.init(codingPath: decoder.codingPath, debugDescription: "None of RoutineWebhookResponse's kinds.")) + } + + func encode(to encoder: any Encoder) throws { + switch self { + case let .ignoredRoutineWebhook(value): try value.encode(to: encoder) + case let .routineWebhookChallenge(value): try value.encode(to: encoder) + } + } + } + } +} + +extension APIClient { + var sandboxProviders: SandboxProvidersRoutes { SandboxProvidersRoutes(client: self) } + + /// The `sandboxProviders` routes, as `api.sandboxProviders` in the web's client. + struct SandboxProvidersRoutes: Sendable { + let client: APIClient + + func list(workspace: String) async throws -> [SandboxProvider] { + return try await client.call("GET", "workspaces/\(pathSegment(workspace))/sandbox-providers", query: []) + } + + func create(workspace: String, settings: SandboxProviderSettings, enabled: Bool? = nil, apiKey: String? = nil) async throws -> SandboxProvider { + return try await client.call("POST", "workspaces/\(pathSegment(workspace))/sandbox-providers", query: [], body: NewSandboxProvider(settings: settings, enabled: enabled, apiKey: apiKey)) + } + + func access(workspace: String) async throws -> SandboxAccess { + return try await client.call("GET", "workspaces/\(pathSegment(workspace))/sandbox-providers/access", query: []) + } + + func update(workspace: String, providerId: String, enabled: Bool? = nil, apiKey: Omittable = .omitted, settings: SandboxProviderSettings? = nil) async throws -> SandboxProvider { + return try await client.call("PATCH", "workspaces/\(pathSegment(workspace))/sandbox-providers/\(pathSegment(providerId))", query: [], body: SandboxProviderUpdate(enabled: enabled, apiKey: apiKey, settings: settings)) + } + + func remove(workspace: String, providerId: String) async throws { + _ = try await client.callForData("DELETE", "workspaces/\(pathSegment(workspace))/sandbox-providers/\(pathSegment(providerId))", query: []) + } + + func template(workspace: String, providerId: String) async throws -> SandboxTemplate { + return try await client.call("GET", "workspaces/\(pathSegment(workspace))/sandbox-providers/\(pathSegment(providerId))/template", query: []) + } + + func prepareTemplate(workspace: String, providerId: String) async throws -> SandboxTemplate { + return try await client.call("POST", "workspaces/\(pathSegment(workspace))/sandbox-providers/\(pathSegment(providerId))/template", query: []) + } + + func test(workspace: String, providerId: String) async throws -> SandboxProviderTestResult { + return try await client.call("POST", "workspaces/\(pathSegment(workspace))/sandbox-providers/\(pathSegment(providerId))/test", query: []) + } + + func disks(workspace: String) async throws -> [PodSandboxDisk] { + return try await client.call("GET", "workspaces/\(pathSegment(workspace))/sandbox-disks", query: []) + } + + func network(workspace: String) async throws -> SandboxNetworkSettings { + return try await client.call("GET", "workspaces/\(pathSegment(workspace))/sandbox-network", query: []) + } + + func addHost(workspace: String, host: String) async throws -> SandboxNetworkSettings { + return try await client.call("POST", "workspaces/\(pathSegment(workspace))/sandbox-network/hosts", query: [], body: NewSandboxHost(host: host)) + } + + func removeHost(workspace: String, host: String) async throws -> SandboxNetworkSettings { + return try await client.call("DELETE", "workspaces/\(pathSegment(workspace))/sandbox-network/hosts/\(pathSegment(host))", query: []) + } + + func blockHost(workspace: String, host: String) async throws -> SandboxNetworkSettings { + return try await client.call("POST", "workspaces/\(pathSegment(workspace))/sandbox-network/blocked-hosts", query: [], body: NewSandboxHost(host: host)) + } + + func unblockHost(workspace: String, host: String) async throws -> SandboxNetworkSettings { + return try await client.call("DELETE", "workspaces/\(pathSegment(workspace))/sandbox-network/blocked-hosts/\(pathSegment(host))", query: []) + } + } +} + +extension APIClient { + var searchProviders: SearchProvidersRoutes { SearchProvidersRoutes(client: self) } + + /// The `searchProviders` routes, as `api.searchProviders` in the web's client. + struct SearchProvidersRoutes: Sendable { + let client: APIClient + + func get(workspace: String) async throws -> SearchProviderResponse { + return try await client.call("GET", "workspaces/\(pathSegment(workspace))/search-provider", query: []) + } + + func replace(workspace: String, preset: SearchProviderPresetId, enabled: Bool? = nil, apiKey: String? = nil, baseUrl: String? = nil) async throws -> SearchProvider { + return try await client.call("PUT", "workspaces/\(pathSegment(workspace))/search-provider", query: [], body: NewSearchProvider(preset: preset, enabled: enabled, apiKey: apiKey, baseUrl: baseUrl)) + } + + func update(workspace: String, enabled: Bool? = nil, baseUrl: String? = nil, apiKey: Omittable = .omitted) async throws -> SearchProvider { + return try await client.call("PATCH", "workspaces/\(pathSegment(workspace))/search-provider", query: [], body: SearchProviderUpdate(enabled: enabled, baseUrl: baseUrl, apiKey: apiKey)) + } + + func remove(workspace: String) async throws { + _ = try await client.callForData("DELETE", "workspaces/\(pathSegment(workspace))/search-provider", query: []) + } + + func webAccess(workspace: String) async throws -> WebAccess { + return try await client.call("GET", "workspaces/\(pathSegment(workspace))/search-provider/web-access", query: []) + } + + func test(workspace: String) async throws -> SearchProviderTestResult { + return try await client.call("POST", "workspaces/\(pathSegment(workspace))/search-provider/test", query: []) + } + } +} + +extension APIClient { + var systemAgents: SystemAgentsRoutes { SystemAgentsRoutes(client: self) } + + /// The `systemAgents` routes, as `api.systemAgents` in the web's client. + struct SystemAgentsRoutes: Sendable { + let client: APIClient + + func list(workspace: String) async throws -> [SystemAgent] { + return try await client.call("GET", "workspaces/\(pathSegment(workspace))/system-agents", query: []) + } + + func update(workspace: String, key: String, model: String) async throws -> SystemAgent { + return try await client.call("PATCH", "workspaces/\(pathSegment(workspace))/system-agents/\(pathSegment(key))", query: [], body: SystemAgentUpdate(model: model)) + } + } +} + +extension APIClient { + var threads: ThreadsRoutes { ThreadsRoutes(client: self) } + + /// The `threads` routes, as `api.threads` in the web's client. + struct ThreadsRoutes: Sendable { + let client: APIClient + + func list(workspace: String) async throws -> [Thread] { + return try await client.call("GET", "workspaces/\(pathSegment(workspace))/threads", query: []) + } + + func get(threadId: String, cursor: String? = nil, limit: Int? = nil) async throws -> ThreadDetails { + var query = QueryItems() + query.add("cursor", cursor) + query.add("limit", limit) + return try await client.call("GET", "threads/\(pathSegment(threadId))", query: query.items) + } + + func activity(threadId: String) async throws -> ThreadActivity { + return try await client.call("GET", "threads/\(pathSegment(threadId))/activity", query: []) + } + + func react(messageId: String, emoji: String) async throws -> MessageReactions { + return try await client.call("PUT", "messages/\(pathSegment(messageId))/reactions/\(pathSegment(emoji))", query: []) + } + + func unreact(messageId: String, emoji: String) async throws -> MessageReactions { + return try await client.call("DELETE", "messages/\(pathSegment(messageId))/reactions/\(pathSegment(emoji))", query: []) + } + + func cancelTurn(turnId: String) async throws { + _ = try await client.callForData("POST", "turns/\(pathSegment(turnId))/cancel", query: []) + } + } +} + +extension APIClient { + var toolApprovals: ToolApprovalsRoutes { ToolApprovalsRoutes(client: self) } + + /// The `toolApprovals` routes, as `api.toolApprovals` in the web's client. + struct ToolApprovalsRoutes: Sendable { + let client: APIClient + + func decide(podId: String, toolCallId: String, decision: ToolApprovalDecision.Decision) async throws { + _ = try await client.callForData("POST", "pods/\(pathSegment(podId))/tool-calls/\(pathSegment(toolCallId))/approval", query: [], body: ToolApprovalDecision(decision: decision)) + } + } +} + +extension APIClient { + var usage: UsageRoutes { UsageRoutes(client: self) } + + /// The `usage` routes, as `api.usage` in the web's client. + struct UsageRoutes: Sendable { + let client: APIClient + + func month(workspace: String, month: String) async throws -> WorkspaceUsage { + var query = QueryItems() + query.add("month", month) + return try await client.call("GET", "workspaces/\(pathSegment(workspace))/usage", query: query.items) + } + } +} + +extension APIClient { + var workspaces: WorkspacesRoutes { WorkspacesRoutes(client: self) } + + /// The `workspaces` routes, as `api.workspaces` in the web's client. + struct WorkspacesRoutes: Sendable { + let client: APIClient + + func list() async throws -> [Workspace] { + return try await client.call("GET", "workspaces", query: []) + } + + func create(name: String, slug: String, timeZone: String? = nil) async throws -> Workspace { + return try await client.call("POST", "workspaces", query: [], body: NewWorkspace(name: name, slug: slug, timeZone: timeZone)) + } + + func update(workspace: String, name: String, slug: String) async throws -> Workspace { + return try await client.call("PATCH", "workspaces/\(pathSegment(workspace))", query: [], body: WorkspaceDetails(name: name, slug: slug)) + } + + func delete(workspace: String) async throws { + _ = try await client.callForData("DELETE", "workspaces/\(pathSegment(workspace))", query: []) + } + + func timeZone(workspace: String) async throws -> WorkspaceTimeZone { + return try await client.call("GET", "workspaces/\(pathSegment(workspace))/time-zone", query: []) + } + + func changeTimeZone(workspace: String, timeZone: String) async throws { + _ = try await client.callForData("PUT", "workspaces/\(pathSegment(workspace))/time-zone", query: [], body: WorkspaceTimeZoneChange(timeZone: timeZone)) + } + + func members(workspace: String) async throws -> [WorkspaceMember] { + return try await client.call("GET", "workspaces/\(pathSegment(workspace))/members", query: []) + } + + func updateMember(workspace: String, memberId: String, role: AssignableWorkspaceRole) async throws { + _ = try await client.callForData("PATCH", "workspaces/\(pathSegment(workspace))/members/\(pathSegment(memberId))", query: [], body: WorkspaceMemberUpdate(role: role)) + } + + func removeMember(workspace: String, memberId: String) async throws { + _ = try await client.callForData("DELETE", "workspaces/\(pathSegment(workspace))/members/\(pathSegment(memberId))", query: []) + } + + func transferOwnership(workspace: String, memberId: String) async throws { + _ = try await client.callForData("PUT", "workspaces/\(pathSegment(workspace))/owner", query: [], body: OwnershipTransfer(memberId: memberId)) + } + + func leave(workspace: String) async throws { + _ = try await client.callForData("POST", "workspaces/\(pathSegment(workspace))/leave", query: []) + } + + func invitations(workspace: String) async throws -> [WorkspaceInvitation] { + return try await client.call("GET", "workspaces/\(pathSegment(workspace))/invitations", query: []) + } + + func invite(workspace: String, email: String, role: AssignableWorkspaceRole, resend: Bool? = nil) async throws -> WorkspaceInvitation { + return try await client.call("POST", "workspaces/\(pathSegment(workspace))/invitations", query: [], body: NewWorkspaceInvitation(email: email, role: role, resend: resend)) + } + + func cancelInvitation(invitationId: String) async throws { + _ = try await client.callForData("DELETE", "invitations/\(pathSegment(invitationId))", query: []) + } + + func invitation(invitationId: String) async throws -> InvitationPreview { + return try await client.call("GET", "invitations/\(pathSegment(invitationId))", query: []) + } + + func acceptInvitation(invitationId: String) async throws -> AcceptedInvitation { + return try await client.call("POST", "invitations/\(pathSegment(invitationId))/accept", query: []) + } + } +} diff --git a/apps/ios/Sugabots/API/Catalogs.generated.swift b/apps/ios/Sugabots/API/Catalogs.generated.swift new file mode 100644 index 000000000..89ade208d --- /dev/null +++ b/apps/ios/Sugabots/API/Catalogs.generated.swift @@ -0,0 +1,183 @@ +// Generated by apps/codegen/generate-catalogs.ts from @sugabots/contracts and packages/web/src/lib. Do not edit. +import Foundation + +/// A search provider in the catalog, as `searchProviderCatalog`. +struct SearchPreset { + let id: String + let name: String + let baseUrl: String + /// A server you run, rather than one with a fixed address. + let local: Bool + let requiresApiKey: Bool + /// What it is good for, in the line under its name. + let description: String + + static let catalog = [ + SearchPreset(id: "exa", name: "Exa", baseUrl: "https://api.exa.ai", local: false, requiresApiKey: false, description: "Works out of the box"), + SearchPreset(id: "brave", name: "Brave Search", baseUrl: "https://api.search.brave.com/res/v1", local: false, requiresApiKey: true, description: "Independent index, simple pricing"), + SearchPreset(id: "tavily", name: "Tavily", baseUrl: "https://api.tavily.com", local: false, requiresApiKey: true, description: "Made for AI agents"), + SearchPreset(id: "searxng", name: "SearXNG", baseUrl: "http://127.0.0.1:8080", local: true, requiresApiKey: false, description: "Runs on your own server"), + ] + + /// `DEFAULT_SEARCH_PRESET`: the provider a workspace has until it chooses another. + static let defaultId = "exa" +} + +/// A computer provider in the catalog, as `sandboxProviderCatalog`. +struct SandboxPreset { + let id: String + let name: String + /// The address a local preset is usually at; nil for one with its own. + let baseUrl: String? + /// What computers are made from: an image, or a template. + let imageLabel: String + let defaultImage: String + /// What it is good for, in the line under its name. + let description: String + + static let catalog = [ + SandboxPreset(id: "opensandbox", name: "OpenSandbox", baseUrl: "http://localhost:8090", imageLabel: "Image", defaultImage: "ghcr.io/nitrictech/sugabots-sandbox:latest", description: "Runs on your own Docker or Kubernetes"), + SandboxPreset(id: "e2b", name: "E2B", baseUrl: nil, imageLabel: "Template", defaultImage: "sugabots-sandbox", description: "Hosted microVMs, or E2B Embed on your own server"), + ] + + /// `SANDBOX_E2B_DEFAULT_SIZE`. + static let defaultSize = (cpuCount: 2, memoryGiB: 4) +} + +extension ProviderModel { + /// Who makes a model, by the name before its slash, as `MODEL_MAKER_NAMES`. + static let makerNames: [String: String] = [ + "openai": "OpenAI", + "meta-llama": "Meta", + "mistralai": "Mistral", + "deepseek": "DeepSeek", + "x-ai": "xAI", + "moonshotai": "Moonshot", + "qwen": "Qwen", + ] +} + +extension NotificationLevel { + /// What the level is called where a person chooses one, as `NOTIFICATION_LEVEL_LABELS`. + var label: String { + switch self { + case .all: "Everything" + case .mentions: "Mentions and replies" + case .nothing: "Nothing" + case .unknown: "Something else" + } + } + + /// What the level notifies about, as `NOTIFICATION_LEVEL_NOTES`; nil for a level this app doesn't know. + var note: String? { + switch self { + case .all: "Every new message in the conversations you can see, and approvals that wait on you." + case .mentions: "Messages that mention you, a bot's answers to you, replies in conversations you're part of, and approvals that wait on you." + case .nothing: "No notifications, wherever you are." + case .unknown: nil + } + } +} + +extension WorkspaceRole { + /// What the role is called, as `workspaceRoleLabel`. + var label: String { + switch self { + case .owner: "Owner" + case .admin: "Admin" + case .member: "Member" + case .viewer: "Viewer" + case .unknown: rawValue.capitalized + } + } + + /// What the role may do, as `workspaceRoleDescription`. + var description: String { + switch self { + case .owner: "Administers the workspace, decides who else does, and can hand it on." + case .admin: "Administers the workspace, its providers and every shared pod." + case .member: "Builds agents in the pods they are added to." + case .viewer: "Reads and takes part in the pods they are added to." + case .unknown: "" + } + } +} + +extension ConnectionAccess { + /// The setting in words, as `TOOL_ACCESS_LABELS`. + var words: String { + switch self { + case .allow: "Allowed" + case .ask: "Ask first" + case .off: "Off" + case .unknown: rawValue + } + } +} + +extension WebhookAuthChoice { + /// Any sender, then each source that signs its own way, as `WEBHOOK_SOURCE_LABELS`. + static let sourceOptions: [(value: String, label: String)] = [("generic", "Generic"), ("github", "GitHub"), ("stripe", "Stripe"), ("slack", "Slack"), ("linear", "Linear")] + + /// What each of `sourceOptions` is called, by its value. + static let sourceLabels: [String: String] = [ + "generic": "Generic", + "github": "GitHub", + "stripe": "Stripe", + "slack": "Slack", + "linear": "Linear", + ] + + /// How each source's signing secret looks, as `WEBHOOK_SOURCE_SECRET_PLACEHOLDERS`. + static let sourceSecretPlaceholders: [String: String] = [ + "github": "The secret set on the webhook in GitHub", + "stripe": "whsec_…", + "slack": "The app's Signing Secret", + "linear": "lin_wh_…", + ] + + /// How the secrets of each kind start, or "" for any, as `WEBHOOK_SECRET_PREFIXES`. + static let secretPrefixes: [String: String] = [ + "hmac": "whsec_", + "api_key": "sk_rt_", + "bearer": "rtb_", + "basic": "", + "github": "", + "stripe": "", + "slack": "", + "linear": "", + ] + + /// `WEBHOOK_AUTH_OPTIONS`. + static let authOptions: [(value: String, label: String)] = [("basic", "Basic"), ("bearer", "Bearer"), ("api_key", "API key"), ("hmac", "HMAC")] + /// `WEBHOOK_ALGORITHM_OPTIONS`. + static let algorithmOptions: [(value: String, label: String)] = [("sha1", "SHA-1"), ("sha256", "SHA-256"), ("sha512", "SHA-512")] + /// `WEBHOOK_ENCODING_OPTIONS`. + static let encodingOptions: [(value: String, label: String)] = [("hex", "Hex"), ("base64", "Base64")] + + /// What each generic kind calls its secret, as `WEBHOOK_SECRET_LABELS`. + static let secretLabels: [String: String] = [ + "hmac": "Signing secret", + "api_key": "Key", + "bearer": "Token", + "basic": "Password", + ] +} + +extension RepositoryDraft { + /// Each event in the order the switches list them, as `REPOSITORY_EVENTS`, with what its switch says. + static let events: [(value: String, label: String)] = [ + ("pull_request_opened", "A pull request is opened"), + ("pull_request_review", "A pull request is reviewed"), + ("pull_request_comment", "Someone comments on a pull request"), + ("issue_opened", "An issue is opened"), + ("issue_comment", "Someone comments on an issue"), + ("checks_failed", "Checks fail"), + ("push", "A branch is pushed to"), + ] +} + +extension WorkspaceUsage { + /// The pod colours each provider's models take in turn on the breakdown, as `PROVIDER_HUES`. + static let providerHues = ["blue", "purple", "teal", "amber", "rose", "green", "orange", "plum"] +} diff --git a/apps/ios/Sugabots/API/Limits.generated.swift b/apps/ios/Sugabots/API/Limits.generated.swift new file mode 100644 index 000000000..8edc660ee --- /dev/null +++ b/apps/ios/Sugabots/API/Limits.generated.swift @@ -0,0 +1,54 @@ +// Generated by apps/codegen/generate-limits.ts from @sugabots/contracts and packages/web/src/lib. Do not edit. +import Foundation + +/// The limits the API checks and the apps' screens keep to, as the web's. +enum Limits { + /// The web's `USER_NAME_MAX_LENGTH`. + static let userNameMaxLength = 100 + /// The web's `WORKSPACE_NAME_MAX_LENGTH`. + static let workspaceNameMaxLength = 64 + /// The web's `POD_NAME_MAX_LENGTH`. + static let podNameMaxLength = 64 + /// The web's `CHAT_NAME_MAX_LENGTH`. + static let chatNameMaxLength = 64 + /// The web's `AGENT_NAME_MAX_LENGTH`. + static let agentNameMaxLength = 64 + /// The web's `DESCRIPTION_MAX_LENGTH`. + static let descriptionMaxLength = 280 + /// The web's `PROMPT_MAX_LENGTH`. + static let promptMaxLength = 20_000 + /// The web's `MAX_ROUTINE_NAME_CHARACTERS`. + static let maxRoutineNameCharacters = 80 + /// The web's `MAX_ROUTINE_INSTRUCTIONS_CHARACTERS`. + static let maxRoutineInstructionsCharacters = 20_000 + /// The web's `MAX_ROUTINE_SCHEDULE_TIMES`. + static let maxRoutineScheduleTimes = 8 + /// The web's `MAX_EVERY_DAYS`. + static let maxEveryDays = 30 + /// The web's `MAX_EVERY_WEEKS`. + static let maxEveryWeeks = 12 + /// The web's `MAX_EVERY_MONTHS`. + static let maxEveryMonths = 12 + /// The web's `MIN_WEBHOOK_SECRET_CHARACTERS`. + static let minWebhookSecretCharacters = 16 + /// The web's `MAX_REACTION_EMOJI_PER_MESSAGE`. + static let maxReactionEmojiPerMessage = 20 + /// The web's `MAX_ATTACHMENTS_PER_MESSAGE`. + static let maxAttachmentsPerMessage = 20 + /// The web's `MAX_ATTACHMENT_BYTES`. + static let maxAttachmentBytes = 31_457_280 + /// The web's `MAX_ATTACHMENT_MEGABYTES`. + static let maxAttachmentMegabytes = 30 + /// The web's `MESSAGE_MAX_LENGTH`. + static let messageMaxLength = 20_000 + /// The web's `MESSAGE_PREVIEW_CHARACTERS`. + static let messagePreviewCharacters = 140 + /// The web's `INVITE_LIFETIME_DAYS`. + static let inviteLifetimeDays = 2 + /// The web's `DEFAULT_QUIET_HOURS`. + static let defaultQuietHours = (from: "22:00", to: "08:00") + /// The web's `MODEL_SEARCH_THRESHOLD`. + static let modelSearchThreshold = 20 + /// The web's `THREADS_SHOWN`. + static let threadsShown = 6 +} diff --git a/apps/ios/Sugabots/Artifacts/ArtifactPages.generated.swift b/apps/ios/Sugabots/Artifacts/ArtifactPages.generated.swift new file mode 100644 index 000000000..6e9cccfee --- /dev/null +++ b/apps/ios/Sugabots/Artifacts/ArtifactPages.generated.swift @@ -0,0 +1,65 @@ +// Generated by apps/codegen/generate-artifact-pages.ts from @sugabots/contracts, packages/web/src/lib/page-frame.ts and packages/web/src/app.css. Do not edit. +import CoreGraphics + +/// How a bot-made page is framed, as the web frames it. +enum PageFrame { + /// `PAGE_CONTENT_POLICY`: inline code and styles, scripts from one CDN, and data the page embeds. + static let contentPolicy = "default-src 'none'; script-src 'unsafe-inline' https://cdn.jsdelivr.net; style-src 'unsafe-inline'; img-src data: blob:; font-src data:; media-src data: blob:; form-action 'none'" + + /// The script message handler `heightReport` posts the page's height to. + static let heightMessageHandler = "pageHeight" + + /// Reports the page's height whenever it changes, as `PAGE_HEIGHT_REPORT` does to a parent frame. + static let heightReport = "new ResizeObserver(() => window.webkit.messageHandlers.pageHeight.postMessage(document.documentElement.scrollHeight)).observe(document.documentElement);" + + /// `FIT_HEIGHT_PX`: how tall a frame fitted to its page may be before it is clipped. + static let fitHeight = (min: CGFloat(120), max: CGFloat(560)) + + /// `FRAME_TOKENS`, with the values `app.css` gives each in light and dark. + static let tokens: [(name: String, light: String, dark: String)] = [ + ("--background", "#ffffff", "#0a0a0a"), + ("--card", "#f7f7f8", "#111113"), + ("--panel", "#ffffff", "#111113"), + ("--chip", "#f1f1f3", "#17171a"), + ("--hover", "#e4e4e7", "#1f1f23"), + ("--foreground", "#111113", "#ededed"), + ("--body-foreground", "#1c1c1f", "#ededed"), + ("--muted-foreground", "#52525b", "#a1a1aa"), + ("--subtle-foreground", "#6b6b73", "#808089"), + ("--border", "#e4e4e7", "#1c1c1f"), + ("--border-strong", "#d4d4d8", "#26262a"), + ("--primary", "#111113", "#ededed"), + ("--primary-foreground", "#ffffff", "#0a0a0a"), + ("--link", "#111113", "#ededed"), + ("--success-text", "#1a7f37", "#4ade80"), + ("--destructive-text", "#c42d45", "#f08a94"), + ("--warning", "#8a5a12", "#e0b67b"), + ("--font-sans", "\"Rubik Variable\", \"Rubik\", system-ui, sans-serif", "\"Rubik Variable\", \"Rubik\", system-ui, sans-serif"), + ("--font-mono", "\"JetBrains Mono Variable\", ui-monospace, Menlo, monospace", "\"JetBrains Mono Variable\", ui-monospace, Menlo, monospace"), + ] + + /// `pageThemeCss`: the stylesheet a page gets its theme from, on a transparent ground. + static func themeCss(colorScheme: String, tokens: String) -> String { + ":root { color-scheme: \(colorScheme); \(tokens) } html, body { background: transparent; } body { margin: 0; color: var(--body-foreground); font-family: var(--font-sans); }" + } +} + +/// What each kind of artifact is called and saved as, as `ARTIFACT_KIND_LABELS` +/// and `ARTIFACT_KIND_FILES`; a kind this app doesn't know is shown as a document. +extension ArtifactKind { + /// What it is called beside its title. + var label: String { + switch self { + case .document, .unknown: "Document" + case .html: "Page" + } + } + + /// What Download ends its file with. + var fileExtension: String { + switch self { + case .document, .unknown: "md" + case .html: "html" + } + } +} diff --git a/apps/ios/Sugabots/Assets.xcassets/ProviderLogos/Contents.json b/apps/ios/Sugabots/Assets.xcassets/ProviderLogos/Contents.json new file mode 100644 index 000000000..770882208 --- /dev/null +++ b/apps/ios/Sugabots/Assets.xcassets/ProviderLogos/Contents.json @@ -0,0 +1,9 @@ +{ + "info": { + "author": "xcode", + "version": 1 + }, + "properties": { + "provides-namespace": false + } +} \ No newline at end of file diff --git a/apps/ios/Sugabots/Assets.xcassets/ProviderLogos/anthropic.imageset/Contents.json b/apps/ios/Sugabots/Assets.xcassets/ProviderLogos/anthropic.imageset/Contents.json new file mode 100644 index 000000000..df4ca70b5 --- /dev/null +++ b/apps/ios/Sugabots/Assets.xcassets/ProviderLogos/anthropic.imageset/Contents.json @@ -0,0 +1,25 @@ +{ + "images": [ + { + "filename": "anthropic.svg", + "idiom": "universal" + }, + { + "appearances": [ + { + "appearance": "luminosity", + "value": "dark" + } + ], + "filename": "anthropic-dark.svg", + "idiom": "universal" + } + ], + "info": { + "author": "xcode", + "version": 1 + }, + "properties": { + "preserves-vector-representation": true + } +} \ No newline at end of file diff --git a/apps/ios/Sugabots/Assets.xcassets/ProviderLogos/anthropic.imageset/anthropic-dark.svg b/apps/ios/Sugabots/Assets.xcassets/ProviderLogos/anthropic.imageset/anthropic-dark.svg new file mode 100644 index 000000000..3e9956829 --- /dev/null +++ b/apps/ios/Sugabots/Assets.xcassets/ProviderLogos/anthropic.imageset/anthropic-dark.svg @@ -0,0 +1,4 @@ + + + + diff --git a/apps/ios/Sugabots/Assets.xcassets/ProviderLogos/anthropic.imageset/anthropic.svg b/apps/ios/Sugabots/Assets.xcassets/ProviderLogos/anthropic.imageset/anthropic.svg new file mode 100644 index 000000000..41afc8787 --- /dev/null +++ b/apps/ios/Sugabots/Assets.xcassets/ProviderLogos/anthropic.imageset/anthropic.svg @@ -0,0 +1,4 @@ + + + + diff --git a/apps/ios/Sugabots/Assets.xcassets/ProviderLogos/cerebras.imageset/Contents.json b/apps/ios/Sugabots/Assets.xcassets/ProviderLogos/cerebras.imageset/Contents.json new file mode 100644 index 000000000..339724e1c --- /dev/null +++ b/apps/ios/Sugabots/Assets.xcassets/ProviderLogos/cerebras.imageset/Contents.json @@ -0,0 +1,15 @@ +{ + "images": [ + { + "filename": "cerebras.svg", + "idiom": "universal" + } + ], + "info": { + "author": "xcode", + "version": 1 + }, + "properties": { + "preserves-vector-representation": true + } +} \ No newline at end of file diff --git a/apps/ios/Sugabots/Assets.xcassets/ProviderLogos/cerebras.imageset/cerebras.svg b/apps/ios/Sugabots/Assets.xcassets/ProviderLogos/cerebras.imageset/cerebras.svg new file mode 100644 index 000000000..61d5f1588 --- /dev/null +++ b/apps/ios/Sugabots/Assets.xcassets/ProviderLogos/cerebras.imageset/cerebras.svg @@ -0,0 +1,7 @@ + + + + + + + diff --git a/apps/ios/Sugabots/Assets.xcassets/ProviderLogos/deepseek.imageset/Contents.json b/apps/ios/Sugabots/Assets.xcassets/ProviderLogos/deepseek.imageset/Contents.json new file mode 100644 index 000000000..e0aa5aa1e --- /dev/null +++ b/apps/ios/Sugabots/Assets.xcassets/ProviderLogos/deepseek.imageset/Contents.json @@ -0,0 +1,15 @@ +{ + "images": [ + { + "filename": "deepseek.svg", + "idiom": "universal" + } + ], + "info": { + "author": "xcode", + "version": 1 + }, + "properties": { + "preserves-vector-representation": true + } +} \ No newline at end of file diff --git a/apps/ios/Sugabots/Assets.xcassets/ProviderLogos/deepseek.imageset/deepseek.svg b/apps/ios/Sugabots/Assets.xcassets/ProviderLogos/deepseek.imageset/deepseek.svg new file mode 100644 index 000000000..653b77e15 --- /dev/null +++ b/apps/ios/Sugabots/Assets.xcassets/ProviderLogos/deepseek.imageset/deepseek.svg @@ -0,0 +1,3 @@ + + + diff --git a/apps/ios/Sugabots/Assets.xcassets/ProviderLogos/fireworks.imageset/Contents.json b/apps/ios/Sugabots/Assets.xcassets/ProviderLogos/fireworks.imageset/Contents.json new file mode 100644 index 000000000..36e2c8295 --- /dev/null +++ b/apps/ios/Sugabots/Assets.xcassets/ProviderLogos/fireworks.imageset/Contents.json @@ -0,0 +1,15 @@ +{ + "images": [ + { + "filename": "fireworks.svg", + "idiom": "universal" + } + ], + "info": { + "author": "xcode", + "version": 1 + }, + "properties": { + "preserves-vector-representation": true + } +} \ No newline at end of file diff --git a/apps/ios/Sugabots/Assets.xcassets/ProviderLogos/fireworks.imageset/fireworks.svg b/apps/ios/Sugabots/Assets.xcassets/ProviderLogos/fireworks.imageset/fireworks.svg new file mode 100644 index 000000000..2dfdfa5ad --- /dev/null +++ b/apps/ios/Sugabots/Assets.xcassets/ProviderLogos/fireworks.imageset/fireworks.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/apps/ios/Sugabots/Assets.xcassets/ProviderLogos/gemini.imageset/Contents.json b/apps/ios/Sugabots/Assets.xcassets/ProviderLogos/gemini.imageset/Contents.json new file mode 100644 index 000000000..20f31c563 --- /dev/null +++ b/apps/ios/Sugabots/Assets.xcassets/ProviderLogos/gemini.imageset/Contents.json @@ -0,0 +1,15 @@ +{ + "images": [ + { + "filename": "gemini.svg", + "idiom": "universal" + } + ], + "info": { + "author": "xcode", + "version": 1 + }, + "properties": { + "preserves-vector-representation": true + } +} \ No newline at end of file diff --git a/apps/ios/Sugabots/Assets.xcassets/ProviderLogos/gemini.imageset/gemini.svg b/apps/ios/Sugabots/Assets.xcassets/ProviderLogos/gemini.imageset/gemini.svg new file mode 100644 index 000000000..74e2f8cb1 --- /dev/null +++ b/apps/ios/Sugabots/Assets.xcassets/ProviderLogos/gemini.imageset/gemini.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/apps/ios/Sugabots/Assets.xcassets/ProviderLogos/groq.imageset/Contents.json b/apps/ios/Sugabots/Assets.xcassets/ProviderLogos/groq.imageset/Contents.json new file mode 100644 index 000000000..c8fb4bb93 --- /dev/null +++ b/apps/ios/Sugabots/Assets.xcassets/ProviderLogos/groq.imageset/Contents.json @@ -0,0 +1,15 @@ +{ + "images": [ + { + "filename": "groq.svg", + "idiom": "universal" + } + ], + "info": { + "author": "xcode", + "version": 1 + }, + "properties": { + "preserves-vector-representation": true + } +} \ No newline at end of file diff --git a/apps/ios/Sugabots/Assets.xcassets/ProviderLogos/groq.imageset/groq.svg b/apps/ios/Sugabots/Assets.xcassets/ProviderLogos/groq.imageset/groq.svg new file mode 100644 index 000000000..e00197c12 --- /dev/null +++ b/apps/ios/Sugabots/Assets.xcassets/ProviderLogos/groq.imageset/groq.svg @@ -0,0 +1 @@ + diff --git a/apps/ios/Sugabots/Assets.xcassets/ProviderLogos/llamacpp.imageset/Contents.json b/apps/ios/Sugabots/Assets.xcassets/ProviderLogos/llamacpp.imageset/Contents.json new file mode 100644 index 000000000..ee973a42c --- /dev/null +++ b/apps/ios/Sugabots/Assets.xcassets/ProviderLogos/llamacpp.imageset/Contents.json @@ -0,0 +1,15 @@ +{ + "images": [ + { + "filename": "llamacpp.svg", + "idiom": "universal" + } + ], + "info": { + "author": "xcode", + "version": 1 + }, + "properties": { + "preserves-vector-representation": true + } +} \ No newline at end of file diff --git a/apps/ios/Sugabots/Assets.xcassets/ProviderLogos/llamacpp.imageset/llamacpp.svg b/apps/ios/Sugabots/Assets.xcassets/ProviderLogos/llamacpp.imageset/llamacpp.svg new file mode 100644 index 000000000..e28203f4e --- /dev/null +++ b/apps/ios/Sugabots/Assets.xcassets/ProviderLogos/llamacpp.imageset/llamacpp.svg @@ -0,0 +1,77 @@ + + + + + + + + + + + + + + + + + diff --git a/apps/ios/Sugabots/Assets.xcassets/ProviderLogos/lmstudio.imageset/Contents.json b/apps/ios/Sugabots/Assets.xcassets/ProviderLogos/lmstudio.imageset/Contents.json new file mode 100644 index 000000000..0c7e49af9 --- /dev/null +++ b/apps/ios/Sugabots/Assets.xcassets/ProviderLogos/lmstudio.imageset/Contents.json @@ -0,0 +1,15 @@ +{ + "images": [ + { + "filename": "lmstudio.svg", + "idiom": "universal" + } + ], + "info": { + "author": "xcode", + "version": 1 + }, + "properties": { + "preserves-vector-representation": true + } +} \ No newline at end of file diff --git a/apps/ios/Sugabots/Assets.xcassets/ProviderLogos/lmstudio.imageset/lmstudio.svg b/apps/ios/Sugabots/Assets.xcassets/ProviderLogos/lmstudio.imageset/lmstudio.svg new file mode 100644 index 000000000..16df236d9 --- /dev/null +++ b/apps/ios/Sugabots/Assets.xcassets/ProviderLogos/lmstudio.imageset/lmstudio.svg @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/apps/ios/Sugabots/Assets.xcassets/ProviderLogos/mistral.imageset/Contents.json b/apps/ios/Sugabots/Assets.xcassets/ProviderLogos/mistral.imageset/Contents.json new file mode 100644 index 000000000..87c42a4ce --- /dev/null +++ b/apps/ios/Sugabots/Assets.xcassets/ProviderLogos/mistral.imageset/Contents.json @@ -0,0 +1,15 @@ +{ + "images": [ + { + "filename": "mistral.svg", + "idiom": "universal" + } + ], + "info": { + "author": "xcode", + "version": 1 + }, + "properties": { + "preserves-vector-representation": true + } +} \ No newline at end of file diff --git a/apps/ios/Sugabots/Assets.xcassets/ProviderLogos/mistral.imageset/mistral.svg b/apps/ios/Sugabots/Assets.xcassets/ProviderLogos/mistral.imageset/mistral.svg new file mode 100644 index 000000000..f2051e978 --- /dev/null +++ b/apps/ios/Sugabots/Assets.xcassets/ProviderLogos/mistral.imageset/mistral.svg @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/apps/ios/Sugabots/Assets.xcassets/ProviderLogos/ollama.imageset/Contents.json b/apps/ios/Sugabots/Assets.xcassets/ProviderLogos/ollama.imageset/Contents.json new file mode 100644 index 000000000..783341eb8 --- /dev/null +++ b/apps/ios/Sugabots/Assets.xcassets/ProviderLogos/ollama.imageset/Contents.json @@ -0,0 +1,25 @@ +{ + "images": [ + { + "filename": "ollama.svg", + "idiom": "universal" + }, + { + "appearances": [ + { + "appearance": "luminosity", + "value": "dark" + } + ], + "filename": "ollama-dark.svg", + "idiom": "universal" + } + ], + "info": { + "author": "xcode", + "version": 1 + }, + "properties": { + "preserves-vector-representation": true + } +} \ No newline at end of file diff --git a/apps/ios/Sugabots/Assets.xcassets/ProviderLogos/ollama.imageset/ollama-dark.svg b/apps/ios/Sugabots/Assets.xcassets/ProviderLogos/ollama.imageset/ollama-dark.svg new file mode 100644 index 000000000..99d6b5e03 --- /dev/null +++ b/apps/ios/Sugabots/Assets.xcassets/ProviderLogos/ollama.imageset/ollama-dark.svg @@ -0,0 +1,3 @@ + + + diff --git a/apps/ios/Sugabots/Assets.xcassets/ProviderLogos/ollama.imageset/ollama.svg b/apps/ios/Sugabots/Assets.xcassets/ProviderLogos/ollama.imageset/ollama.svg new file mode 100644 index 000000000..b215c89b9 --- /dev/null +++ b/apps/ios/Sugabots/Assets.xcassets/ProviderLogos/ollama.imageset/ollama.svg @@ -0,0 +1,3 @@ + + + diff --git a/apps/ios/Sugabots/Assets.xcassets/ProviderLogos/openai.imageset/Contents.json b/apps/ios/Sugabots/Assets.xcassets/ProviderLogos/openai.imageset/Contents.json new file mode 100644 index 000000000..bbe907481 --- /dev/null +++ b/apps/ios/Sugabots/Assets.xcassets/ProviderLogos/openai.imageset/Contents.json @@ -0,0 +1,25 @@ +{ + "images": [ + { + "filename": "openai.svg", + "idiom": "universal" + }, + { + "appearances": [ + { + "appearance": "luminosity", + "value": "dark" + } + ], + "filename": "openai-dark.svg", + "idiom": "universal" + } + ], + "info": { + "author": "xcode", + "version": 1 + }, + "properties": { + "preserves-vector-representation": true + } +} \ No newline at end of file diff --git a/apps/ios/Sugabots/Assets.xcassets/ProviderLogos/openai.imageset/openai-dark.svg b/apps/ios/Sugabots/Assets.xcassets/ProviderLogos/openai.imageset/openai-dark.svg new file mode 100644 index 000000000..6341b6fa9 --- /dev/null +++ b/apps/ios/Sugabots/Assets.xcassets/ProviderLogos/openai.imageset/openai-dark.svg @@ -0,0 +1,3 @@ + + + diff --git a/apps/ios/Sugabots/Assets.xcassets/ProviderLogos/openai.imageset/openai.svg b/apps/ios/Sugabots/Assets.xcassets/ProviderLogos/openai.imageset/openai.svg new file mode 100644 index 000000000..7c119340c --- /dev/null +++ b/apps/ios/Sugabots/Assets.xcassets/ProviderLogos/openai.imageset/openai.svg @@ -0,0 +1,3 @@ + + + diff --git a/apps/ios/Sugabots/Assets.xcassets/ProviderLogos/openrouter.imageset/Contents.json b/apps/ios/Sugabots/Assets.xcassets/ProviderLogos/openrouter.imageset/Contents.json new file mode 100644 index 000000000..9e66b67b4 --- /dev/null +++ b/apps/ios/Sugabots/Assets.xcassets/ProviderLogos/openrouter.imageset/Contents.json @@ -0,0 +1,25 @@ +{ + "images": [ + { + "filename": "openrouter.svg", + "idiom": "universal" + }, + { + "appearances": [ + { + "appearance": "luminosity", + "value": "dark" + } + ], + "filename": "openrouter-dark.svg", + "idiom": "universal" + } + ], + "info": { + "author": "xcode", + "version": 1 + }, + "properties": { + "preserves-vector-representation": true + } +} \ No newline at end of file diff --git a/apps/ios/Sugabots/Assets.xcassets/ProviderLogos/openrouter.imageset/openrouter-dark.svg b/apps/ios/Sugabots/Assets.xcassets/ProviderLogos/openrouter.imageset/openrouter-dark.svg new file mode 100644 index 000000000..48bd2e8f7 --- /dev/null +++ b/apps/ios/Sugabots/Assets.xcassets/ProviderLogos/openrouter.imageset/openrouter-dark.svg @@ -0,0 +1,3 @@ + + + diff --git a/apps/ios/Sugabots/Assets.xcassets/ProviderLogos/openrouter.imageset/openrouter.svg b/apps/ios/Sugabots/Assets.xcassets/ProviderLogos/openrouter.imageset/openrouter.svg new file mode 100644 index 000000000..1d85b1082 --- /dev/null +++ b/apps/ios/Sugabots/Assets.xcassets/ProviderLogos/openrouter.imageset/openrouter.svg @@ -0,0 +1,3 @@ + + + diff --git a/apps/ios/Sugabots/Assets.xcassets/ProviderLogos/together.imageset/Contents.json b/apps/ios/Sugabots/Assets.xcassets/ProviderLogos/together.imageset/Contents.json new file mode 100644 index 000000000..42eb27405 --- /dev/null +++ b/apps/ios/Sugabots/Assets.xcassets/ProviderLogos/together.imageset/Contents.json @@ -0,0 +1,15 @@ +{ + "images": [ + { + "filename": "together.svg", + "idiom": "universal" + } + ], + "info": { + "author": "xcode", + "version": 1 + }, + "properties": { + "preserves-vector-representation": true + } +} \ No newline at end of file diff --git a/apps/ios/Sugabots/Assets.xcassets/ProviderLogos/together.imageset/together.svg b/apps/ios/Sugabots/Assets.xcassets/ProviderLogos/together.imageset/together.svg new file mode 100644 index 000000000..3c06b43d4 --- /dev/null +++ b/apps/ios/Sugabots/Assets.xcassets/ProviderLogos/together.imageset/together.svg @@ -0,0 +1,21 @@ + + + + + + + + + \ No newline at end of file diff --git a/apps/ios/Sugabots/Assets.xcassets/ProviderLogos/vllm.imageset/Contents.json b/apps/ios/Sugabots/Assets.xcassets/ProviderLogos/vllm.imageset/Contents.json new file mode 100644 index 000000000..376cf61be --- /dev/null +++ b/apps/ios/Sugabots/Assets.xcassets/ProviderLogos/vllm.imageset/Contents.json @@ -0,0 +1,15 @@ +{ + "images": [ + { + "filename": "vllm.svg", + "idiom": "universal" + } + ], + "info": { + "author": "xcode", + "version": 1 + }, + "properties": { + "preserves-vector-representation": true + } +} \ No newline at end of file diff --git a/apps/ios/Sugabots/Assets.xcassets/ProviderLogos/vllm.imageset/vllm.svg b/apps/ios/Sugabots/Assets.xcassets/ProviderLogos/vllm.imageset/vllm.svg new file mode 100644 index 000000000..6b9e5d1df --- /dev/null +++ b/apps/ios/Sugabots/Assets.xcassets/ProviderLogos/vllm.imageset/vllm.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/apps/ios/Sugabots/Assets.xcassets/ProviderLogos/xai.imageset/Contents.json b/apps/ios/Sugabots/Assets.xcassets/ProviderLogos/xai.imageset/Contents.json new file mode 100644 index 000000000..198132b08 --- /dev/null +++ b/apps/ios/Sugabots/Assets.xcassets/ProviderLogos/xai.imageset/Contents.json @@ -0,0 +1,25 @@ +{ + "images": [ + { + "filename": "xai.svg", + "idiom": "universal" + }, + { + "appearances": [ + { + "appearance": "luminosity", + "value": "dark" + } + ], + "filename": "xai-dark.svg", + "idiom": "universal" + } + ], + "info": { + "author": "xcode", + "version": 1 + }, + "properties": { + "preserves-vector-representation": true + } +} \ No newline at end of file diff --git a/apps/ios/Sugabots/Assets.xcassets/ProviderLogos/xai.imageset/xai-dark.svg b/apps/ios/Sugabots/Assets.xcassets/ProviderLogos/xai.imageset/xai-dark.svg new file mode 100644 index 000000000..7057a3bfa --- /dev/null +++ b/apps/ios/Sugabots/Assets.xcassets/ProviderLogos/xai.imageset/xai-dark.svg @@ -0,0 +1,4 @@ + + + + diff --git a/apps/ios/Sugabots/Assets.xcassets/ProviderLogos/xai.imageset/xai.svg b/apps/ios/Sugabots/Assets.xcassets/ProviderLogos/xai.imageset/xai.svg new file mode 100644 index 000000000..642d7b6b0 --- /dev/null +++ b/apps/ios/Sugabots/Assets.xcassets/ProviderLogos/xai.imageset/xai.svg @@ -0,0 +1,4 @@ + + + + diff --git a/apps/ios/Sugabots/Conversation/BuiltInTools.generated.swift b/apps/ios/Sugabots/Conversation/BuiltInTools.generated.swift new file mode 100644 index 000000000..8e29c100d --- /dev/null +++ b/apps/ios/Sugabots/Conversation/BuiltInTools.generated.swift @@ -0,0 +1,34 @@ +// Generated by apps/codegen/generate-built-in-tools.ts from @sugabots/contracts. Do not edit. + +extension ToolNames { + /// The product's own tools' names, by key, as `builtInToolCatalog` names them. + static let builtIn: [String: String] = [ + "web_fetch": "Read web pages", + "web_search": "Search the web", + "routines": "Manage its routines", + "artifact_list": "List artifacts", + "artifact_read": "Read artifacts", + "artifact_write": "Write artifacts", + "artifact_edit": "Edit artifacts", + ] +} + +/// One of the bot's own tools, as `builtInToolCatalog` lists them. +struct BuiltInTool { + let key: String + let name: String + /// What the tool does, in one plain sentence. + let description: String + /// Whether it reaches the web, so works only while the workspace allows that. + let usesWeb: Bool + + static let catalog = [ + BuiltInTool(key: "web_fetch", name: "Read web pages", description: "Fetches a public page by its address and reads it as text.", usesWeb: true), + BuiltInTool(key: "web_search", name: "Search the web", description: "Searches through the workspace's search provider, when one is switched on.", usesWeb: true), + BuiltInTool(key: "routines", name: "Manage its routines", description: "Lists, sets up and changes its own schedules when a pod admin asks it to.", usesWeb: false), + BuiltInTool(key: "artifact_list", name: "List artifacts", description: "Lists the documents and HTML pages kept in the bot's pod.", usesWeb: false), + BuiltInTool(key: "artifact_read", name: "Read artifacts", description: "Reads a document or HTML page kept in the bot's pod.", usesWeb: false), + BuiltInTool(key: "artifact_write", name: "Write artifacts", description: "Makes a document or HTML page the pod keeps, or saves a new version of one.", usesWeb: false), + BuiltInTool(key: "artifact_edit", name: "Edit artifacts", description: "Changes part of a document or HTML page, as a new version.", usesWeb: false), + ] +} diff --git a/apps/ios/Sugabots/Conversation/FileLook.generated.swift b/apps/ios/Sugabots/Conversation/FileLook.generated.swift new file mode 100644 index 000000000..29d680cf5 --- /dev/null +++ b/apps/ios/Sugabots/Conversation/FileLook.generated.swift @@ -0,0 +1,6 @@ +// Generated by apps/codegen/generate-file-and-zone-lists.ts from packages/web/src/lib/file-looks.ts. Do not edit. + +extension FileLook { + /// The extensions of files drawn as a sheet, as `SHEET_EXTENSIONS`. + static let sheetExtensions: Set = ["csv", "tsv", "xls", "xlsx", "ods", "numbers"] +} diff --git a/apps/ios/Sugabots/Design/BotLooks.generated.swift b/apps/ios/Sugabots/Design/BotLooks.generated.swift new file mode 100644 index 000000000..35db7a034 --- /dev/null +++ b/apps/ios/Sugabots/Design/BotLooks.generated.swift @@ -0,0 +1,83 @@ +// Generated by apps/codegen/generate-bot-looks.ts from @sugabots/avatars. Do not edit. + +import SwiftUI + +enum BotLooks { + /// How `color` is drawn; a colour this app doesn't know is drawn green. + static func palette(for color: AgentColor) -> BotPalette { + palettes[color] ?? palettes[.green]! + } + + /// The head `shape` names; a shape this app doesn't know is a circle. + static func head(for shape: AgentShape) -> HeadShape { + heads[shape] ?? heads[.circle]! + } + + /// The marks of the eyes `face` names; eyes this app doesn't know are dots. + static func faces(for face: AgentFace) -> [FaceMark] { + faces[face] ?? faces[.dot]! + } + + private static let palettes: [AgentColor: BotPalette] = [ + .red: BotPalette(face: Color(hex: "#ef4444"), eyes: Color(hex: "#450a0a"), tint: ThemedColor(light: Color(hex: "#fee2e2"), dark: Color(hex: "#2d1b1a")), text: ThemedColor(light: Color(hex: "#421917"), dark: Color(hex: "#f3e6e4")), mono: ThemedColor(light: Color(hex: "#a43b38"), dark: Color(hex: "#ffc3bd"))), + .orange: BotPalette(face: Color(hex: "#f97316"), eyes: Color(hex: "#431407"), tint: ThemedColor(light: Color(hex: "#fdeee2"), dark: Color(hex: "#2a1d14")), text: ThemedColor(light: Color(hex: "#431407"), dark: Color(hex: "#f3e7de")), mono: ThemedColor(light: Color(hex: "#c2410c"), dark: Color(hex: "#fdba74"))), + .amber: BotPalette(face: Color(hex: "#f59e0b"), eyes: Color(hex: "#451a03"), tint: ThemedColor(light: Color(hex: "#fef3c7"), dark: Color(hex: "#291e11")), text: ThemedColor(light: Color(hex: "#3a2100"), dark: Color(hex: "#f0e8df")), mono: ThemedColor(light: Color(hex: "#8a5600"), dark: Color(hex: "#f7cc9b"))), + .yellow: BotPalette(face: Color(hex: "#eab308"), eyes: Color(hex: "#422006"), tint: ThemedColor(light: Color(hex: "#fef9c3"), dark: Color(hex: "#27231a")), text: ThemedColor(light: Color(hex: "#342500"), dark: Color(hex: "#eee9de")), mono: ThemedColor(light: Color(hex: "#7d5e00"), dark: Color(hex: "#ecd197"))), + .lime: BotPalette(face: Color(hex: "#84cc16"), eyes: Color(hex: "#1a2e05"), tint: ThemedColor(light: Color(hex: "#ecfccb"), dark: Color(hex: "#1c2315")), text: ThemedColor(light: Color(hex: "#1c2e07"), dark: Color(hex: "#e6ece1")), mono: ThemedColor(light: Color(hex: "#477200"), dark: Color(hex: "#c2e0a9"))), + .green: BotPalette(face: Color(hex: "#22c55e"), eyes: Color(hex: "#052e16"), tint: ThemedColor(light: Color(hex: "#e3f5ea"), dark: Color(hex: "#1a2621")), text: ThemedColor(light: Color(hex: "#10321d"), dark: Color(hex: "#e6ece8")), mono: ThemedColor(light: Color(hex: "#166534"), dark: Color(hex: "#bfe8d0"))), + .emerald: BotPalette(face: Color(hex: "#10b981"), eyes: Color(hex: "#022c22"), tint: ThemedColor(light: Color(hex: "#d1fae5"), dark: Color(hex: "#14251c")), text: ThemedColor(light: Color(hex: "#00301f"), dark: Color(hex: "#e1ede6")), mono: ThemedColor(light: Color(hex: "#007650"), dark: Color(hex: "#a4e5c5"))), + .teal: BotPalette(face: Color(hex: "#14b8a6"), eyes: Color(hex: "#042f2e"), tint: ThemedColor(light: Color(hex: "#ccfbf1"), dark: Color(hex: "#15261f")), text: ThemedColor(light: Color(hex: "#002f2a"), dark: Color(hex: "#dfedea")), mono: ThemedColor(light: Color(hex: "#007367"), dark: Color(hex: "#97e6d9"))), + .sky: BotPalette(face: Color(hex: "#0ea5e9"), eyes: Color(hex: "#082f49"), tint: ThemedColor(light: Color(hex: "#e0f2fe"), dark: Color(hex: "#15222b")), text: ThemedColor(light: Color(hex: "#002b41"), dark: Color(hex: "#e1ebf2")), mono: ThemedColor(light: Color(hex: "#006b9a"), dark: Color(hex: "#a7dcff"))), + .ice: BotPalette(face: Color(hex: "#38bdf8"), eyes: Color(hex: "#0c4a6e"), tint: ThemedColor(light: Color(hex: "#e0f2fe"), dark: Color(hex: "#15232b")), text: ThemedColor(light: Color(hex: "#002c3f"), dark: Color(hex: "#e0ecf2")), mono: ThemedColor(light: Color(hex: "#006c94"), dark: Color(hex: "#a1deff"))), + .indigo: BotPalette(face: Color(hex: "#6366f1"), eyes: Color(hex: "#1e1b4b"), tint: ThemedColor(light: Color(hex: "#e0e7ff"), dark: Color(hex: "#1d1f2e")), text: ThemedColor(light: Color(hex: "#202347"), dark: Color(hex: "#e7e9f4")), mono: ThemedColor(light: Color(hex: "#5157b1"), dark: Color(hex: "#c9d1ff"))), + .violet: BotPalette(face: Color(hex: "#8b5cf6"), eyes: Color(hex: "#2e1065"), tint: ThemedColor(light: Color(hex: "#ede9fe"), dark: Color(hex: "#211e2d")), text: ThemedColor(light: Color(hex: "#292044"), dark: Color(hex: "#e9e8f3")), mono: ThemedColor(light: Color(hex: "#6850ab"), dark: Color(hex: "#d5ccff"))), + .purple: BotPalette(face: Color(hex: "#a855f7"), eyes: Color(hex: "#2e1065"), tint: ThemedColor(light: Color(hex: "#f3e8ff"), dark: Color(hex: "#221a2b")), text: ThemedColor(light: Color(hex: "#2e1d42"), dark: Color(hex: "#ebe6f2")), mono: ThemedColor(light: Color(hex: "#754ba3"), dark: Color(hex: "#dfc8ff"))), + .fuchsia: BotPalette(face: Color(hex: "#d946ef"), eyes: Color(hex: "#4a044e"), tint: ThemedColor(light: Color(hex: "#fae8ff"), dark: Color(hex: "#271c28")), text: ThemedColor(light: Color(hex: "#361c3a"), dark: Color(hex: "#eee6f0")), mono: ThemedColor(light: Color(hex: "#874392"), dark: Color(hex: "#eec3f4"))), + .pink: BotPalette(face: Color(hex: "#ec4899"), eyes: Color(hex: "#500724"), tint: ThemedColor(light: Color(hex: "#fce7f3"), dark: Color(hex: "#2b1b21")), text: ThemedColor(light: Color(hex: "#3f182a"), dark: Color(hex: "#f2e6ea")), mono: ThemedColor(light: Color(hex: "#9d3a68"), dark: Color(hex: "#ffbfd7"))), + .rose: BotPalette(face: Color(hex: "#f43f5e"), eyes: Color(hex: "#4c0519"), tint: ThemedColor(light: Color(hex: "#ffe4e6"), dark: Color(hex: "#2a1519")), text: ThemedColor(light: Color(hex: "#42181c"), dark: Color(hex: "#f3e6e6")), mono: ThemedColor(light: Color(hex: "#a33947"), dark: Color(hex: "#ffc2c4"))), + ] + + private static let heads: [AgentShape: HeadShape] = [ + .circle: HeadShape(parts: [.circle(cx: 20, cy: 20, r: 20)], eyes: EyePlacement(x: 20, y: 20, scale: 1)), + .squircle: HeadShape(parts: [.path("M20 1C34.5 1 39 5.5 39 20S34.5 39 20 39 1 34.5 1 20 5.5 1 20 1Z")], eyes: EyePlacement(x: 20, y: 20, scale: 1)), + .pebble: HeadShape(parts: [.path("M21 3.5C32.5 3.5 39 10 39 20.5S32 37 20 37 1 31 1 21 9 3.5 21 3.5Z")], eyes: EyePlacement(x: 20, y: 20.5, scale: 0.95)), + .blob: HeadShape(parts: [.path("M24.5 2.5C34.5 3.5 39.5 12 37.5 23S27.5 39.5 17 37.5.5 28 2.5 18 14.5 1.5 24.5 2.5Z")], eyes: EyePlacement(x: 20, y: 20.5, scale: 0.95)), + .wobble: HeadShape(parts: [.path("M28 2C36 2.5 39.5 9.5 37.5 19.5S29.5 38 18.5 38 1.5 31.5 2.5 22.5 16.5 1.5 28 2Z")], eyes: EyePlacement(x: 20, y: 21, scale: 0.95)), + .drop: HeadShape(parts: [.path("M20 2C30 2 38 10 38 20S30 38 20 38H7C4.2 38 2 35.8 2 33V20C2 10 10 2 20 2Z")], eyes: EyePlacement(x: 20, y: 20, scale: 1)), + .leaf: HeadShape(parts: [.path("M7 2H22C31 2 38 9 38 18V33C38 35.8 35.8 38 33 38H18C9 38 2 31 2 22V7C2 4.2 4.2 2 7 2Z")], eyes: EyePlacement(x: 20, y: 20, scale: 1)), + .dome: HeadShape(parts: [.path("M2 21C2 11 10 3 20 3S38 11 38 21V33C38 35.8 35.8 38 33 38H7C4.2 38 2 35.8 2 33Z")], eyes: EyePlacement(x: 20, y: 22, scale: 1)), + .bowl: HeadShape(parts: [.path("M7 3H33C35.8 3 38 5.2 38 8V19C38 29.5 30 38 20 38S2 29.5 2 19V8C2 5.2 4.2 3 7 3Z")], eyes: EyePlacement(x: 20, y: 19, scale: 1)), + .hexagon: HeadShape(parts: [.path("M25.75 3.11Q29.75 3.11 31.75 6.58L37.5 16.54Q39.5 20 37.5 23.46L31.75 33.42Q29.75 36.89 25.75 36.89L14.25 36.89Q10.25 36.89 8.25 33.42L2.5 23.46Q0.5 20 2.5 16.54L8.25 6.58Q10.25 3.11 14.25 3.11Z")], eyes: EyePlacement(x: 20, y: 20, scale: 0.9)), + .octagon: HeadShape(parts: [.path("M24.35 1.06Q27.85 1.06 30.32 3.54L36.46 9.68Q38.94 12.15 38.94 15.65L38.94 24.35Q38.94 27.85 36.46 30.32L30.32 36.46Q27.85 38.94 24.35 38.94L15.65 38.94Q12.15 38.94 9.68 36.46L3.54 30.32Q1.06 27.85 1.06 24.35L1.06 15.65Q1.06 12.15 3.54 9.68L9.68 3.54Q12.15 1.06 15.65 1.06Z")], eyes: EyePlacement(x: 20, y: 20, scale: 0.95)), + .triangle: HeadShape(parts: [.path("M15.33 9.77Q20 1.5 24.67 9.77L34.83 27.73Q39.5 36 30 36L10 36Q0.5 36 5.17 27.73Z")], eyes: EyePlacement(x: 20, y: 24.5, scale: 0.8)), + .pentagon: HeadShape(parts: [.path("M16.36 3.65Q20 1 23.64 3.65L35.86 12.52Q39.5 15.17 38.11 19.44L33.44 33.81Q32.05 38.08 27.55 38.08L12.45 38.08Q7.95 38.08 6.56 33.81L1.89 19.44Q0.5 15.17 4.14 12.52Z")], eyes: EyePlacement(x: 20, y: 22.5, scale: 0.85)), + .diamond: HeadShape(parts: [.path("M15.76 4.74Q20 0.5 24.24 4.74L35.26 15.76Q39.5 20 35.26 24.24L24.24 35.26Q20 39.5 15.76 35.26L4.74 24.24Q0.5 20 4.74 15.76Z")], eyes: EyePlacement(x: 20, y: 20, scale: 0.8)), + .shield: HeadShape(parts: [.path("M3 8Q3 3 8 3L32 3Q37 3 37 8L37 16Q37 21 33.46 24.54L23.54 34.46Q20 38 16.46 34.46L6.54 24.54Q3 21 3 16Z")], eyes: EyePlacement(x: 20, y: 17, scale: 0.9)), + .star: HeadShape(parts: [.path("M17.72 3.28Q20 0 22.28 3.28L25.36 7.7Q27.64 10.98 31.47 12.14L36.62 13.7Q40.45 14.86 38.03 18.04L34.78 22.33Q32.36 25.52 32.45 29.52L32.56 34.89Q32.64 38.89 28.86 37.58L23.78 35.81Q20 34.5 16.22 35.81L11.14 37.58Q7.36 38.89 7.44 34.89L7.55 29.52Q7.64 25.52 5.22 22.33L1.97 18.04Q-0.45 14.86 3.38 13.7L8.53 12.14Q12.36 10.98 14.64 7.7Z")], eyes: EyePlacement(x: 20, y: 22, scale: 0.75)), + .flower: HeadShape(parts: [.circle(cx: 20, cy: 10.5, r: 10.5), .circle(cx: 29.5, cy: 20, r: 10.5), .circle(cx: 20, cy: 29.5, r: 10.5), .circle(cx: 10.5, cy: 20, r: 10.5), .circle(cx: 20, cy: 20, r: 12)], eyes: EyePlacement(x: 20, y: 20, scale: 0.9)), + .scallop: HeadShape(parts: [.circle(cx: 20, cy: 7, r: 7), .circle(cx: 29.19, cy: 10.81, r: 7), .circle(cx: 33, cy: 20, r: 7), .circle(cx: 29.19, cy: 29.19, r: 7), .circle(cx: 20, cy: 33, r: 7), .circle(cx: 10.81, cy: 29.19, r: 7), .circle(cx: 7, cy: 20, r: 7), .circle(cx: 10.81, cy: 10.81, r: 7), .circle(cx: 20, cy: 20, r: 14)], eyes: EyePlacement(x: 20, y: 20, scale: 0.85)), + .ghost: HeadShape(parts: [.path("M4 18C4 9.2 11.2 2 20 2S36 9.2 36 18V34a5.33 5.33 0 0 1-10.67 0a5.33 5.33 0 0 1-10.66 0a5.33 5.33 0 0 1-10.67 0Z")], eyes: EyePlacement(x: 20, y: 17, scale: 0.9)), + .bear: HeadShape(parts: [.circle(cx: 8, cy: 9, r: 6.5), .circle(cx: 32, cy: 9, r: 6.5), .circle(cx: 20, cy: 23, r: 16)], eyes: EyePlacement(x: 20, y: 23.5, scale: 0.8)), + .antenna: HeadShape(parts: [.circle(cx: 20, cy: 5, r: 3.8), .path("M18.8 7h2.4v5h-2.4Z"), .circle(cx: 20, cy: 25, r: 15)], eyes: EyePlacement(x: 20, y: 25.5, scale: 0.75)), + ] + + private static let faces: [AgentFace: [FaceMark]] = [ + .pill: [.rect(x: 11.6, y: 15, width: 5, height: 10, rx: 2.8), .rect(x: 23.4, y: 15, width: 5, height: 10, rx: 2.8)], + .dot: [.circle(cx: 14.2, cy: 20, r: 2.8), .circle(cx: 25.8, cy: 20, r: 2.8)], + .arc: [.stroke("M10.9 22a3.1 3.1 0 0 1 6.2 0M22.9 22a3.1 3.1 0 0 1 6.2 0", width: 1.8)], + .square: [.rect(x: 11.2, y: 16.8, width: 6.4, height: 6.4, rx: 1.8), .rect(x: 22.4, y: 16.8, width: 6.4, height: 6.4, rx: 1.8)], + .wink: [.circle(cx: 13.6, cy: 20, r: 2.8), .stroke("M22.5 22.4a2.9 2.9 0 0 1 5.8 0", width: 1.8)], + ] + + /// Each pod colour's tile tint and swatch, as `podPalettes` in the web app's `PodTile` draws them. + static let pods: [String: PodPalette] = [ + "green": PodPalette(tile: ThemedColor(light: Color(hex: "#c9e8cc"), dark: Color(hex: "#183f20")), swatch: Color(hex: "#4ab962")), + "blue": PodPalette(tile: ThemedColor(light: Color(hex: "#c8e0ff"), dark: Color(hex: "#1a3658")), swatch: Color(hex: "#53a0ff")), + "plum": PodPalette(tile: ThemedColor(light: Color(hex: "#f6d2e9"), dark: Color(hex: "#4d2641")), swatch: Color(hex: "#de73bd")), + "amber": PodPalette(tile: ThemedColor(light: Color(hex: "#f1dbba"), dark: Color(hex: "#493000")), swatch: Color(hex: "#d48f00")), + "teal": PodPalette(tile: ThemedColor(light: Color(hex: "#b9e9e6"), dark: Color(hex: "#00403f")), swatch: Color(hex: "#00bcb8")), + "purple": PodPalette(tile: ThemedColor(light: Color(hex: "#e2d8fc"), dark: Color(hex: "#3a2d54")), swatch: Color(hex: "#ab85f4")), + "rose": PodPalette(tile: ThemedColor(light: Color(hex: "#fed1d2"), dark: Color(hex: "#542527")), swatch: Color(hex: "#f16f78")), + "orange": PodPalette(tile: ThemedColor(light: Color(hex: "#fbd5c1"), dark: Color(hex: "#512910")), swatch: Color(hex: "#eb7c33")), + ] +} diff --git a/apps/ios/Sugabots/Design/ConnectionMarks.generated.swift b/apps/ios/Sugabots/Design/ConnectionMarks.generated.swift new file mode 100644 index 000000000..828c615a2 --- /dev/null +++ b/apps/ios/Sugabots/Design/ConnectionMarks.generated.swift @@ -0,0 +1,41 @@ +// Generated by apps/codegen/generate-connection-marks.ts from the web app's +// ui/connection-mark.tsx and @sugabots/contracts. Do not edit. +import SwiftUI + +extension ConnectionMark { + /// One-colour glyphs on a 24-point square, with the tint behind them. + static let glyphs: [String: Glyph] = [ + "github": Glyph(color: Color(hex: "#181717"), tint: ThemedColor(light: Color(hex: "#dadada"), dark: Color(hex: "#121214")), path: "M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12"), + "linear": Glyph(color: Color(hex: "#5E6AD2"), tint: ThemedColor(light: Color(hex: "#e6eafa"), dark: Color(hex: "#1a1d2a")), path: "M2.886 4.18A11.982 11.982 0 0 1 11.99 0C18.624 0 24 5.376 24 12.009c0 3.64-1.62 6.903-4.18 9.105L2.887 4.18ZM1.817 5.626l16.556 16.556c-.524.33-1.075.62-1.65.866L.951 7.277c.247-.575.537-1.126.866-1.65ZM.322 9.163l14.515 14.515c-.71.172-1.443.282-2.195.322L0 11.358a12 12 0 0 1 .322-2.195Zm-.17 4.862 9.823 9.824a12.02 12.02 0 0 1-9.824-9.824Z"), + "stripe": Glyph(color: Color(hex: "#635BFF"), tint: ThemedColor(light: Color(hex: "#e6eaff"), dark: Color(hex: "#1a1c2f")), path: "M13.976 9.15c-2.172-.806-3.356-1.426-3.356-2.409 0-.831.683-1.305 1.901-1.305 2.227 0 4.515.858 6.09 1.631l.89-5.494C18.252.975 15.697 0 12.165 0 9.667 0 7.589.654 6.104 1.872 4.56 3.147 3.757 4.992 3.757 7.218c0 4.039 2.467 5.76 6.476 7.219 2.585.92 3.445 1.574 3.445 2.583 0 .98-.84 1.545-2.354 1.545-1.875 0-4.965-.921-6.99-2.109l-.9 5.555C5.175 22.99 8.385 24 11.714 24c2.641 0 4.843-.624 6.328-1.813 1.664-1.305 2.525-3.236 2.525-5.732 0-4.128-2.524-5.851-6.594-7.305h.003z"), + "notion": Glyph(color: Color(hex: "#000000"), tint: ThemedColor(light: Color(hex: "#d1d1d1"), dark: Color(hex: "#0c0c0d")), path: "M4.459 4.208c.746.606 1.026.56 2.428.466l13.215-.793c.28 0 .047-.28-.046-.326L17.86 1.968c-.42-.326-.981-.7-2.055-.607L3.01 2.295c-.466.046-.56.28-.374.466zm.793 3.08v13.904c0 .747.373 1.027 1.214.98l14.523-.84c.841-.046.935-.56.935-1.167V6.354c0-.606-.233-.933-.748-.887l-15.177.887c-.56.047-.747.327-.747.933zm14.337.745c.093.42 0 .84-.42.888l-.7.14v10.264c-.608.327-1.168.514-1.635.514-.748 0-.935-.234-1.495-.933l-4.577-7.186v6.952L12.21 19s0 .84-1.168.84l-3.222.186c-.093-.186 0-.653.327-.746l.84-.233V9.854L7.822 9.76c-.094-.42.14-1.026.793-1.073l3.456-.233 4.764 7.279v-6.44l-1.215-.139c-.093-.514.28-.887.747-.933zM1.936 1.035l13.31-.98c1.634-.14 2.055-.047 3.082.7l4.249 2.986c.7.513.934.653.934 1.213v16.378c0 1.026-.373 1.634-1.68 1.726l-15.458.934c-.98.047-1.448-.093-1.962-.747l-3.129-4.06c-.56-.747-.793-1.306-.793-1.96V2.667c0-.839.374-1.54 1.447-1.632z"), + "sentry": Glyph(color: Color(hex: "#362D59"), tint: ThemedColor(light: Color(hex: "#e0dfe7"), dark: Color(hex: "#16151c")), path: "M13.91 2.505c-.873-1.448-2.972-1.448-3.844 0L6.904 7.92a15.478 15.478 0 0 1 8.53 12.811h-2.221A13.301 13.301 0 0 0 5.784 9.814l-2.926 5.06a7.65 7.65 0 0 1 4.435 5.848H2.194a.365.365 0 0 1-.298-.534l1.413-2.402a5.16 5.16 0 0 0-1.614-.913L.296 19.275a2.182 2.182 0 0 0 .812 2.999 2.24 2.24 0 0 0 1.086.288h6.983a9.322 9.322 0 0 0-3.845-8.318l1.11-1.922a11.47 11.47 0 0 1 4.95 10.24h5.915a17.242 17.242 0 0 0-7.885-15.28l2.244-3.845a.37.37 0 0 1 .504-.13c.255.14 9.75 16.708 9.928 16.9a.365.365 0 0 1-.327.543h-2.287c.029.612.029 1.223 0 1.831h2.297a2.206 2.206 0 0 0 1.922-3.31z"), + "jira": Glyph(color: Color(hex: "#0052CC"), tint: ThemedColor(light: Color(hex: "#dce8fa"), dark: Color(hex: "#131b29")), path: "M11.571 11.513H0a5.218 5.218 0 0 0 5.232 5.215h2.13v2.057A5.215 5.215 0 0 0 12.575 24V12.518a1.005 1.005 0 0 0-1.005-1.005zm5.723-5.756H5.736a5.215 5.215 0 0 0 5.215 5.214h2.129v2.058a5.218 5.218 0 0 0 5.215 5.214V6.758a1.001 1.001 0 0 0-1.001-1.001zM23.013 0H11.455a5.215 5.215 0 0 0 5.215 5.215h2.129v2.057A5.215 5.215 0 0 0 24 12.483V1.005A1.001 1.001 0 0 0 23.013 0Z"), + ] + + /// Marks drawn in their own colours, on a tint of their brand or on the panel. + static let colourGlyphs: [String: ColourGlyph] = [ + "suga": ColourGlyph(size: 550, tint: ThemedColor(light: Color(hex: "#d1d1d1"), dark: Color(hex: "#0c0c0d")), parts: [ColourGlyph.Part(path: "M225 28.8675C255.94 11.0042 294.06 11.0042 325 28.8675L463.157 108.632C494.097 126.496 513.157 159.508 513.157 195.235V354.765C513.157 390.492 494.097 423.504 463.157 441.368L325 521.133C294.06 538.996 255.94 538.996 225 521.133L86.843 441.368C55.9029 423.504 36.843 390.492 36.843 354.765V195.235C36.843 159.508 55.9029 126.496 86.843 108.632L225 28.8675Z", fill: .token(.foreground), stroke: nil, strokeWidth: 0, roundCap: false), ColourGlyph.Part(path: "M279 467V328.524C279 291.432 299.531 257.387 332.337 240.079L450 178", fill: nil, stroke: .token(.panel), strokeWidth: 25, roundCap: true)]), + "slack": ColourGlyph(size: 24, tint: nil, parts: [ColourGlyph.Part(path: "M5.042 15.165a2.528 2.528 0 0 1-2.52 2.523A2.528 2.528 0 0 1 0 15.165a2.527 2.527 0 0 1 2.522-2.52h2.52v2.52z", fill: .hex("#E01E5A"), stroke: nil, strokeWidth: 0, roundCap: false), ColourGlyph.Part(path: "M6.313 15.165a2.527 2.527 0 0 1 2.521-2.52 2.527 2.527 0 0 1 2.521 2.52v6.313A2.528 2.528 0 0 1 8.834 24a2.528 2.528 0 0 1-2.521-2.522v-6.313z", fill: .hex("#E01E5A"), stroke: nil, strokeWidth: 0, roundCap: false), ColourGlyph.Part(path: "M8.834 5.042a2.528 2.528 0 0 1-2.521-2.52A2.528 2.528 0 0 1 8.834 0a2.528 2.528 0 0 1 2.521 2.522v2.52H8.834z", fill: .hex("#36C5F0"), stroke: nil, strokeWidth: 0, roundCap: false), ColourGlyph.Part(path: "M8.834 6.313a2.528 2.528 0 0 1 2.521 2.521 2.528 2.528 0 0 1-2.521 2.521H2.522A2.528 2.528 0 0 1 0 8.834a2.528 2.528 0 0 1 2.522-2.521h6.312z", fill: .hex("#36C5F0"), stroke: nil, strokeWidth: 0, roundCap: false), ColourGlyph.Part(path: "M18.956 8.834a2.528 2.528 0 0 1 2.522-2.521A2.528 2.528 0 0 1 24 8.834a2.528 2.528 0 0 1-2.522 2.521h-2.522V8.834z", fill: .hex("#2EB67D"), stroke: nil, strokeWidth: 0, roundCap: false), ColourGlyph.Part(path: "M17.688 8.834a2.528 2.528 0 0 1-2.523 2.521 2.527 2.527 0 0 1-2.52-2.521V2.522A2.527 2.527 0 0 1 15.165 0a2.528 2.528 0 0 1 2.523 2.522v6.312z", fill: .hex("#2EB67D"), stroke: nil, strokeWidth: 0, roundCap: false), ColourGlyph.Part(path: "M15.165 18.956a2.528 2.528 0 0 1 2.523 2.522A2.528 2.528 0 0 1 15.165 24a2.527 2.527 0 0 1-2.52-2.522v-2.522h2.52z", fill: .hex("#ECB22E"), stroke: nil, strokeWidth: 0, roundCap: false), ColourGlyph.Part(path: "M15.165 17.688a2.527 2.527 0 0 1-2.52-2.523 2.526 2.526 0 0 1 2.52-2.52h6.313A2.527 2.527 0 0 1 24 15.165a2.528 2.528 0 0 1-2.522 2.523h-6.313z", fill: .hex("#ECB22E"), stroke: nil, strokeWidth: 0, roundCap: false)]), + ] + + /// Brands drawn in the foreground colour, being too dark to read on a dark panel. + static let darkBrands: Set = ["notion", "github"] +} + +/// An app in the connection catalog, as `connectionCatalog` lists it. +struct ConnectionPreset: Hashable, Identifiable { + let id: String + let name: String + let description: String + let url: String + + static let catalog: [ConnectionPreset] = [ + ConnectionPreset(id: "linear", name: "Linear", description: "Issues, projects and cycles", url: "https://mcp.linear.app/mcp"), + ConnectionPreset(id: "stripe", name: "Stripe", description: "Customers, payments and invoices", url: "https://mcp.stripe.com"), + ConnectionPreset(id: "notion", name: "Notion", description: "Pages and databases", url: "https://mcp.notion.com/mcp"), + ConnectionPreset(id: "sentry", name: "Sentry", description: "Errors and performance issues", url: "https://mcp.sentry.dev/mcp"), + ConnectionPreset(id: "jira", name: "Jira", description: "Issues and boards", url: "https://mcp.atlassian.com/v1/mcp"), + ConnectionPreset(id: "suga", name: "Suga", description: "Projects, environments and deployments", url: "https://dashboard.suga.app/api/mcp"), + ] +} diff --git a/apps/ios/Sugabots/Design/Lucide.generated.swift b/apps/ios/Sugabots/Design/Lucide.generated.swift new file mode 100644 index 000000000..35c4a78c1 --- /dev/null +++ b/apps/ios/Sugabots/Design/Lucide.generated.swift @@ -0,0 +1,181 @@ +// Generated by apps/codegen/generate-lucide-icons.ts from lucide-react. Do not edit. + +/// Every Lucide icon the web app uses, by its name there. +enum Lucide: String, CaseIterable { + case archive + case arrowLeft + case arrowUp + case arrowUpRight + case atSign + case audioLines + case bell + case bellOff + case bellRing + case bookOpen + case bot + case braces + case brain + case bug + case check + case checkCheck + case chevronDown + case chevronLeft + case chevronRight + case chevronUp + case circleAlert + case circleCheck + case circleHelp + case clock + case code + case copy + case cornerUpLeft + case download + case ellipsis + case externalLink + case eye + case eyeOff + case fileIcon + case fileSpreadsheet + case fileText + case gitBranch + case globe + case grid2X2 + case hash + case house + case image + case inbox + case info + case keyboard + case library + case link2 + case listFilter + case lock + case logOut + case maximize2 + case messageCircle + case messageSquarePlus + case messagesSquare + case mic + case minus + case monitor + case panelRight + case panelsTopLeft + case paperclip + case pause + case pencil + case play + case plus + case refreshCcw + case refreshCw + case reply + case rotateCcw + case search + case send + case settings + case shieldCheck + case smile + case smilePlus + case sparkles + case star + case trash2 + case triangleAlert + case upload + case user + case userPlus + case userRound + case users + case webhook + case wrench + case x + + /// Its strokes, as path data on a 24-point square. + var paths: [String] { + switch self { + case .archive: ["M3 3H21A1 1 0 0 1 22 4V7A1 1 0 0 1 21 8H3A1 1 0 0 1 2 7V4A1 1 0 0 1 3 3Z", "M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8", "M10 12h4"] + case .arrowLeft: ["m12 19-7-7 7-7", "M19 12H5"] + case .arrowUp: ["m5 12 7-7 7 7", "M12 19V5"] + case .arrowUpRight: ["M7 7h10v10", "M7 17 17 7"] + case .atSign: ["M8 12A4 4 0 1 0 16 12A4 4 0 1 0 8 12Z", "M16 8v5a3 3 0 0 0 6 0v-1a10 10 0 1 0-4 8"] + case .audioLines: ["M2 10v3", "M6 6v11", "M10 3v18", "M14 8v7", "M18 5v13", "M22 10v3"] + case .bell: ["M10.268 21a2 2 0 0 0 3.464 0", "M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326"] + case .bellOff: ["M10.268 21a2 2 0 0 0 3.464 0", "M17 17H4a1 1 0 0 1-.74-1.673C4.59 13.956 6 12.499 6 8a6 6 0 0 1 .258-1.742", "m2 2 20 20", "M8.668 3.01A6 6 0 0 1 18 8c0 2.687.77 4.653 1.707 6.05"] + case .bellRing: ["M10.268 21a2 2 0 0 0 3.464 0", "M22 8c0-2.3-.8-4.3-2-6", "M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326", "M4 2C2.8 3.7 2 5.7 2 8"] + case .bookOpen: ["M12 5v16", "M20.001 19A2 2 0 0022 17V5a2 2 0 00-1.999-2L16 3.002A5 5 0 0012 5a5 5 0 00-4-2H4a2 2 0 00-2 2v12a2 2 0 001.999 2H8a5 5 0 014 2 5 5 0 014-2z"] + case .bot: ["M12 8V4H8", "M6 8H18A2 2 0 0 1 20 10V18A2 2 0 0 1 18 20H6A2 2 0 0 1 4 18V10A2 2 0 0 1 6 8Z", "M2 14h2", "M20 14h2", "M15 13v2", "M9 13v2"] + case .braces: ["M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1", "M16 21h1a2 2 0 0 0 2-2v-5c0-1.1.9-2 2-2a2 2 0 0 1-2-2V5a2 2 0 0 0-2-2h-1"] + case .brain: ["M12 18V5", "M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4", "M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5", "M17.997 5.125a4 4 0 0 1 2.526 5.77", "M18 18a4 4 0 0 0 2-7.464", "M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517", "M6 18a4 4 0 0 1-2-7.464", "M6.003 5.125a4 4 0 0 0-2.526 5.77"] + case .bug: ["M12 20v-9", "M14 7a4 4 0 0 1 4 4v3a6 6 0 0 1-12 0v-3a4 4 0 0 1 4-4z", "M14.12 3.88 16 2", "M21 21a4 4 0 0 0-3.81-4", "M21 5a4 4 0 0 1-3.55 3.97", "M22 13h-4", "M3 21a4 4 0 0 1 3.81-4", "M3 5a4 4 0 0 0 3.55 3.97", "M6 13H2", "m8 2 1.88 1.88", "M9 7.13V6a3 3 0 1 1 6 0v1.13"] + case .check: ["M20 6 9 17l-5-5"] + case .checkCheck: ["M18 6 7 17l-5-5", "m22 10-7.5 7.5L13 16"] + case .chevronDown: ["m6 9 6 6 6-6"] + case .chevronLeft: ["m15 18-6-6 6-6"] + case .chevronRight: ["m9 18 6-6-6-6"] + case .chevronUp: ["m18 15-6-6-6 6"] + case .circleAlert: ["M2 12A10 10 0 1 0 22 12A10 10 0 1 0 2 12Z", "M12 8L12 12", "M12 16L12.01 16"] + case .circleCheck: ["M2 12A10 10 0 1 0 22 12A10 10 0 1 0 2 12Z", "m16 9-5.5 5.5L8 12"] + case .circleHelp: ["M2 12A10 10 0 1 0 22 12A10 10 0 1 0 2 12Z", "M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3", "M12 17h.01"] + case .clock: ["M2 12A10 10 0 1 0 22 12A10 10 0 1 0 2 12Z", "M12 6v6l4 2"] + case .code: ["m16 18 6-6-6-6", "m8 6-6 6 6 6"] + case .copy: ["M10 8H20A2 2 0 0 1 22 10V20A2 2 0 0 1 20 22H10A2 2 0 0 1 8 20V10A2 2 0 0 1 10 8Z", "M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"] + case .cornerUpLeft: ["M20 20v-7a4 4 0 0 0-4-4H4", "M9 14 4 9l5-5"] + case .download: ["M12 15V3", "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4", "m7 10 5 5 5-5"] + case .ellipsis: ["M11 12A1 1 0 1 0 13 12A1 1 0 1 0 11 12Z", "M18 12A1 1 0 1 0 20 12A1 1 0 1 0 18 12Z", "M4 12A1 1 0 1 0 6 12A1 1 0 1 0 4 12Z"] + case .externalLink: ["M15 3h6v6", "M10 14 21 3", "M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"] + case .eye: ["M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0", "M9 12A3 3 0 1 0 15 12A3 3 0 1 0 9 12Z"] + case .eyeOff: ["M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49", "M14.084 14.158a3 3 0 0 1-4.242-4.242", "M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143", "m2 2 20 20"] + case .fileIcon: ["M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z", "M14 2v5a1 1 0 0 0 1 1h5"] + case .fileSpreadsheet: ["M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z", "M14 2v5a1 1 0 0 0 1 1h5", "M8 13h2", "M14 13h2", "M8 17h2", "M14 17h2"] + case .fileText: ["M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z", "M14 2v5a1 1 0 0 0 1 1h5", "M10 9H8", "M16 13H8", "M16 17H8"] + case .gitBranch: ["M15 6a9 9 0 0 0-9 9V3", "M15 6A3 3 0 1 0 21 6A3 3 0 1 0 15 6Z", "M3 18A3 3 0 1 0 9 18A3 3 0 1 0 3 18Z"] + case .globe: ["M2 12A10 10 0 1 0 22 12A10 10 0 1 0 2 12Z", "M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20", "M2 12h20"] + case .grid2X2: ["M12 3v18", "M3 12h18", "M5 3H19A2 2 0 0 1 21 5V19A2 2 0 0 1 19 21H5A2 2 0 0 1 3 19V5A2 2 0 0 1 5 3Z"] + case .hash: ["M4 9L20 9", "M4 15L20 15", "M10 3L8 21", "M16 3L14 21"] + case .house: ["M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8", "M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z"] + case .image: ["M5 3H19A2 2 0 0 1 21 5V19A2 2 0 0 1 19 21H5A2 2 0 0 1 3 19V5A2 2 0 0 1 5 3Z", "M7 9A2 2 0 1 0 11 9A2 2 0 1 0 7 9Z", "m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21"] + case .inbox: ["M22 12L16 12L14 15L10 15L8 12L2 12", "M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z"] + case .info: ["M2 12A10 10 0 1 0 22 12A10 10 0 1 0 2 12Z", "M12 16v-4", "M12 8h.01"] + case .keyboard: ["M10 8h.01", "M12 12h.01", "M14 8h.01", "M16 12h.01", "M18 8h.01", "M6 8h.01", "M7 16h10", "M8 12h.01", "M4 4H20A2 2 0 0 1 22 6V18A2 2 0 0 1 20 20H4A2 2 0 0 1 2 18V6A2 2 0 0 1 4 4Z"] + case .library: ["m16 6 4 14", "M12 6v14", "M8 8v12", "M4 4v16"] + case .link2: ["M9 17H7A5 5 0 0 1 7 7h2", "M15 7h2a5 5 0 1 1 0 10h-2", "M8 12L16 12"] + case .listFilter: ["M2 5h20", "M6 12h12", "M9 19h6"] + case .lock: ["M5 11H19A2 2 0 0 1 21 13V20A2 2 0 0 1 19 22H5A2 2 0 0 1 3 20V13A2 2 0 0 1 5 11Z", "M7 11V7a5 5 0 0 1 10 0v4"] + case .logOut: ["m16 17 5-5-5-5", "M21 12H9", "M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4"] + case .maximize2: ["M15 3h6v6", "m21 3-7 7", "m3 21 7-7", "M9 21H3v-6"] + case .messageCircle: ["M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719"] + case .messageSquarePlus: ["M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z", "M12 8v6", "M9 11h6"] + case .messagesSquare: ["M16 10a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 14.286V4a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2z", "M20 9a2 2 0 0 1 2 2v10.286a.71.71 0 0 1-1.212.502l-2.202-2.202A2 2 0 0 0 17.172 19H10a2 2 0 0 1-2-2v-1"] + case .mic: ["M12 19v3", "M19 10v2a7 7 0 0 1-14 0v-2", "M12 2H12A3 3 0 0 1 15 5V12A3 3 0 0 1 12 15H12A3 3 0 0 1 9 12V5A3 3 0 0 1 12 2Z"] + case .minus: ["M5 12h14"] + case .monitor: ["M4 3H20A2 2 0 0 1 22 5V15A2 2 0 0 1 20 17H4A2 2 0 0 1 2 15V5A2 2 0 0 1 4 3Z", "M8 21L16 21", "M12 17L12 21"] + case .panelRight: ["M5 3H19A2 2 0 0 1 21 5V19A2 2 0 0 1 19 21H5A2 2 0 0 1 3 19V5A2 2 0 0 1 5 3Z", "M15 3v18"] + case .panelsTopLeft: ["M5 3H19A2 2 0 0 1 21 5V19A2 2 0 0 1 19 21H5A2 2 0 0 1 3 19V5A2 2 0 0 1 5 3Z", "M3 9h18", "M9 21V9"] + case .paperclip: ["m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551"] + case .pause: ["M15 3H18A1 1 0 0 1 19 4V20A1 1 0 0 1 18 21H15A1 1 0 0 1 14 20V4A1 1 0 0 1 15 3Z", "M6 3H9A1 1 0 0 1 10 4V20A1 1 0 0 1 9 21H6A1 1 0 0 1 5 20V4A1 1 0 0 1 6 3Z"] + case .pencil: ["M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z", "m15 5 4 4"] + case .play: ["M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z"] + case .plus: ["M5 12h14", "M12 5v14"] + case .refreshCcw: ["M21 12a9 9 0 0 0-9-9 9.75 9.75 0 0 0-6.74 2.74L3 8", "M3 3v5h5", "M3 12a9 9 0 0 0 9 9 9.75 9.75 0 0 0 6.74-2.74L21 16", "M16 16h5v5"] + case .refreshCw: ["M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8", "M21 3v5h-5", "M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16", "M8 16H3v5"] + case .reply: ["M20 18v-2a4 4 0 0 0-4-4H4", "m9 17-5-5 5-5"] + case .rotateCcw: ["M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8", "M3 3v5h5"] + case .search: ["m21 21-4.34-4.34", "M3 11A8 8 0 1 0 19 11A8 8 0 1 0 3 11Z"] + case .send: ["M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z", "m21.854 2.147-10.94 10.939"] + case .settings: ["M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915", "M9 12A3 3 0 1 0 15 12A3 3 0 1 0 9 12Z"] + case .shieldCheck: ["M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z", "m9 12 2 2 4-4"] + case .smile: ["M15 10V9", "M16.472 15a6 6 0 01-8.943 0", "M9 10V9", "M2 12A10 10 0 1 0 22 12A10 10 0 1 0 2 12Z"] + case .smilePlus: ["M13.267 2.08a10 10 0 108.653 8.653", "M15 10V9", "M16 5h6", "M16.472 15a6 6 0 01-8.943 0", "M19 2v6", "M9 10V9"] + case .sparkles: ["M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z", "M20 2v4", "M22 4h-4", "M2 20A2 2 0 1 0 6 20A2 2 0 1 0 2 20Z"] + case .star: ["M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z"] + case .trash2: ["M10 11v6", "M14 11v6", "M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6", "M3 6h18", "M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"] + case .triangleAlert: ["m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3", "M12 9v4", "M12 17h.01"] + case .upload: ["M12 3v12", "m17 8-5-5-5 5", "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"] + case .user: ["M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2", "M8 7A4 4 0 1 0 16 7A4 4 0 1 0 8 7Z"] + case .userPlus: ["M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2", "M5 7A4 4 0 1 0 13 7A4 4 0 1 0 5 7Z", "M19 8L19 14", "M22 11L16 11"] + case .userRound: ["M7 8A5 5 0 1 0 17 8A5 5 0 1 0 7 8Z", "M20 21a8 8 0 0 0-16 0"] + case .users: ["M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2", "M16 3.128a4 4 0 0 1 0 7.744", "M22 21v-2a4 4 0 0 0-3-3.87", "M5 7A4 4 0 1 0 13 7A4 4 0 1 0 5 7Z"] + case .webhook: ["M18 16.98h-5.99c-1.1 0-1.95.94-2.48 1.9A4 4 0 0 1 2 17c.01-.7.2-1.4.57-2", "m6 17 3.13-5.78c.53-.97.1-2.18-.5-3.1a4 4 0 1 1 6.89-4.06", "m12 6 3.13 5.73C15.66 12.7 16.9 13 18 13a4 4 0 0 1 0 8"] + case .wrench: ["M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z"] + case .x: ["M18 6 6 18", "m6 6 12 12"] + } + } +} diff --git a/apps/ios/Sugabots/Design/NativeConstants.generated.swift b/apps/ios/Sugabots/Design/NativeConstants.generated.swift new file mode 100644 index 000000000..1d04641e1 --- /dev/null +++ b/apps/ios/Sugabots/Design/NativeConstants.generated.swift @@ -0,0 +1,26 @@ +// Generated by apps/codegen/generate-native-constants.ts from apps/native-constants.json. Do not edit. +import CoreGraphics + +/// Where the native apps deliberately differ from the web; `apps/NATIVE.md` says why. +enum NativeConstants { + /// What sign-in writes after a workspace's name: a hosted workspace is at [name].sugabots.ai. + static let hostedWorkspaceEnding = ".sugabots.ai" + /// How many emoji a held message's actions offer before the button for the picker. + static let quickReactionCount: Int = 5 + /// What fills the quick reactions after the emoji chosen lately on this device. + static let usualReactions = ["👍", "❤️", "😂", "🎉", "👀"] + /// A reaction chip's height under a message: a fingertip's, as Slack's on a phone. + static let reactionChipHeight: CGFloat = 32 + /// A face in a conversation's title pill: 6 points inside its rounded end, and 6 over and under. + static let headerFaceSize: CGFloat = 32 + /// How tall a conversation's title pill is, after Slack's. + static let headerPillHeight: CGFloat = 44 + /// The gap a conversation's header keeps below the Dynamic Island. + static let headerGapBelowIsland: CGFloat = 8 + /// How far the tab bar reaches down into the home indicator's band, as Slack's does. + static let tabBarSink: CGFloat = 12 + /// How far the tab bar and the composer sit in from the screen's sides. + static let barSideInset: CGFloat = 21 + /// The space between the composer and the keyboard, backed by frost. + static let keyboardGap: CGFloat = 8 +} diff --git a/apps/ios/Sugabots/Design/Palette.generated.swift b/apps/ios/Sugabots/Design/Palette.generated.swift new file mode 100644 index 000000000..42256064c --- /dev/null +++ b/apps/ios/Sugabots/Design/Palette.generated.swift @@ -0,0 +1,118 @@ +// Generated by apps/codegen/generate-palette.ts from packages/web/src/app.css. Do not edit. +import SwiftUI +import UIKit + +extension Palette { + /// Surfaces. The thread and the sidebar share the ground in dark; light gives the sidebar its + /// own grey so the white thread reads as the working area. + static let background = themed(light: UIColor(hex: "#FFFFFF"), dark: UIColor(hex: "#0A0A0A")) + static let rail = themed(light: UIColor(hex: "#F7F7F8"), dark: UIColor(hex: "#000000")) + /// The conversation list column, and the grouped rows in settings. + static let list = themed(light: UIColor(hex: "#F7F7F8"), dark: UIColor(hex: "#0F0F11")) + /// The column beside a chat: Details, or a collaboration or run. + static let aside = themed(light: UIColor(hex: "#FFFFFF"), dark: UIColor(hex: "#0A0A0A")) + /// Behind a page opened beside a chat, such as an artifact. + static let stage = themed(light: UIColor(hex: "#F1F1F3"), dark: UIColor(hex: "#0F0F11")) + /// A card among the messages, such as an approval request. + static let card = themed(light: UIColor(hex: "#F7F7F8"), dark: UIColor(hex: "#111113")) + /// A raised panel: a dialog, the composer's input. + static let panel = themed(light: UIColor(hex: "#FFFFFF"), dark: UIColor(hex: "#111113")) + /// A settings card: barely lifted off the page in dark, held by its border rather than its + /// fill, so a page of them stays calm. + static let settingsCard = themed(light: UIColor(hex: "#FFFFFF"), dark: UIColor(hex: "#0C0C0E")) + static let settingsCardBorder = themed(light: UIColor(hex: "#E4E4E7"), dark: UIColor(hex: "#1F1F23")) + /// Usage's bar for a day gone by, and today's, picked out as the one still adding up. + static let usageBar = themed(light: UIColor(hex: "#8AB0E7"), dark: UIColor(hex: "#3F69A7")) + static let usageBarToday = themed(light: UIColor(hex: "#3370C7"), dark: UIColor(hex: "#6FA7EE")) + /// A settings row under the pointer, a step up from its card. + static let settingsRowHover = themed(light: UIColor(hex: "#F7F7F8"), dark: UIColor(hex: "#111113")) + /// A chip, a secondary button, the search pill. + static let chip = themed(light: UIColor(hex: "#F1F1F3"), dark: UIColor(hex: "#17171A")) + static let hover = themed(light: UIColor(hex: "#E4E4E7"), dark: UIColor(hex: "#1F1F23")) + /// A control already filled with `--hover`, such as Deny, under the pointer. + static let hoverStrong = themed(light: UIColor(hex: "#D4D4D8"), dark: UIColor(hex: "#26262A")) + /// Rows sit on the list column, which is already a step up, so their hover is quieter. + static let rowHover = themed(light: UIColor(hex: "#F1F1F3"), dark: UIColor(hex: "#151518")) + /// A message row under the pointer, barely lifted off the chat. + static let messageHover = themed(light: UIColor(hex: "#F7F7F8"), dark: UIColor(hex: "#111113")) + /// The open conversation in the list. + static let rowSelected = themed(light: UIColor(hex: "#E4E4E7"), dark: UIColor(hex: "#17171A")) + static let foreground = themed(light: UIColor(hex: "#111113"), dark: UIColor(hex: "#EDEDED")) + /// A message's words: as strong as a name in dark, a step softer in light. + static let bodyForeground = themed(light: UIColor(hex: "#1C1C1F"), dark: UIColor(hex: "#EDEDED")) + static let softForeground = themed(light: UIColor(hex: "#3F3F46"), dark: UIColor(hex: "#C4C4CA")) + static let mutedForeground = themed(light: UIColor(hex: "#52525B"), dark: UIColor(hex: "#A1A1AA")) + /// Times, section labels, hints. A shade lighter in dark than the design's #6b6b73, and darker + /// in light than its #71717a, so both pass AA on a chip. + static let subtleForeground = themed(light: UIColor(hex: "#6B6B73"), dark: UIColor(hex: "#808089")) + static let disabledForeground = themed(light: UIColor(hex: "#A1A1AA"), dark: UIColor(hex: "#52525B")) + /// A text action, such as Cancel or Create in a dialog header. + static let link = themed(light: UIColor(hex: "#111113"), dark: UIColor(hex: "#EDEDED")) + /// Hairlines, faintest first; `border-strong` edges a field or the composer. + static let borderSubtle = themed(light: UIColor(hex: "#F1F1F3"), dark: UIColor(hex: "#1C1C1F")) + static let border = themed(light: UIColor(hex: "#E4E4E7"), dark: UIColor(hex: "#1C1C1F")) + static let borderStrong = themed(light: UIColor(hex: "#D4D4D8"), dark: UIColor(hex: "#26262A")) + static let borderDashed = themed(light: UIColor(hex: "#D4D4D8"), dark: UIColor(hex: "#3F3F46")) + /// The `glass` of a phone's floating controls, over whatever scrolls under them. + static let glass = themed(light: UIColor(hex: "#F7F7F8", alpha: 0.8), dark: UIColor(hex: "#1E1E22", alpha: 0.72)) + static let glassEdge = themed(light: UIColor(hex: "#000000", alpha: 0.06), dark: UIColor(hex: "#FFFFFF", alpha: 0.08)) + /// The send button with nothing to send. + static let chipStrong = themed(light: UIColor(hex: "#E4E4E7"), dark: UIColor(hex: "#1F1F23")) + /// A pod tile, and a slot in one with no bot in it. + static let tile = themed(light: UIColor(hex: "#E4E4E7"), dark: UIColor(hex: "#26262A")) + static let tileEmpty = themed(light: UIColor(hex: "#000000", alpha: 0.07), dark: UIColor(hex: "#FFFFFF", alpha: 0.06)) + /// There is no hue: the accent is the strongest ink, near-black in light and near-white in + /// dark, so primary buttons, switches and counts invert the page. + static let primary = themed(light: UIColor(hex: "#111113"), dark: UIColor(hex: "#EDEDED")) + static let primaryForeground = themed(light: UIColor(hex: "#FFFFFF"), dark: UIColor(hex: "#0A0A0A")) + static let primaryHover = themed(light: UIColor(hex: "#26262A"), dark: UIColor(hex: "#D4D4D8")) + static let switchOn = primary + static let primaryTintBorder = themed(light: UIColor(hex: "#A1A1AA"), dark: UIColor(hex: "#52525B")) + /// `--ring` is a solid colour, because that is what a shadcn-registry component means by + /// `ring-ring`. Our own focus treatment is a soft halo rather than a hard ring, so the + /// translucent value it needs lives beside it as `--ring-halo` and `focus-ring` composes the + /// two. + static let ring = themed(light: UIColor(hex: "#71717A"), dark: UIColor(hex: "#A1A1AA")) + static let ringHalo = themed(light: UIColor(hex: "#0A0A0A", alpha: 0.12), dark: UIColor(hex: "#FFFFFF", alpha: 0.2)) + /// How full a bot's short-term memory is. + static let meter = primary + /// The count of what is unread or waiting, on Inbox, a menu row or a tab, and the hand when a + /// chat waits for your approval. + static let railCount = primary + static let approvalMarker = primary + /// A reaction you are among, under a message: a grey wash edged in the accent. Others' are a + /// card on a chip's edge. + static let reactionMine = themed(light: UIColor(hex: "#F1F1F3"), dark: UIColor(hex: "#1F1F23")) + static let reactionMineForeground = foreground + /// Red is only for errors and delete. + static let destructive = Color(UIColor(hex: "#F0505E")) + /// Red text, such as Delete pod, and the wash behind it on hover. Light is a shade darker than + /// the design's #d6384e so it passes AA on a chip. + static let destructiveText = themed(light: UIColor(hex: "#C42D45"), dark: UIColor(hex: "#F08A94")) + static let destructiveHover = themed(light: UIColor(hex: "#FDE8EA"), dark: UIColor(hex: "#2A1A1E")) + /// A routine's failed run: its card, its edge, its heading, and why it failed. + static let failedCard = themed(light: UIColor(hex: "#FDF1F3"), dark: UIColor(hex: "#200E0E")) + static let failedCardBorder = themed(light: UIColor(hex: "#F3C4CC"), dark: UIColor(hex: "#642629")) + static let failedCardHeading = themed(light: UIColor(hex: "#8E1F31"), dark: UIColor(hex: "#FBD5DA")) + static let failedCardText = themed(light: UIColor(hex: "#7A2B38"), dark: UIColor(hex: "#E3C3C8")) + static let warning = themed(light: UIColor(hex: "#8A5A12"), dark: UIColor(hex: "#E0B67B")) + /// A dot for something that went ahead, such as an allowed request. + static let success = Color(UIColor(hex: "#3FCB6B")) + /// Green text for something that worked. Both pass AA on a panel. + static let successText = themed(light: UIColor(hex: "#1A7F37"), dark: UIColor(hex: "#4ADE80")) + /// A file attached in the composer: the page drawn for a document and the badge naming its + /// type. One that failed uses the destructive colours. + static let filePage = themed(light: UIColor(hex: "#FFFFFF"), dark: UIColor(hex: "#E7E8EC")) + static let filePageLine = themed(light: UIColor(hex: "#D4D6DC"), dark: UIColor(hex: "#B9BCC4")) + static let filePageHeading = themed(light: UIColor(hex: "#9A9EA8"), dark: UIColor(hex: "#8B8F99")) + static let fileBadgeSheet = Color(UIColor(hex: "#1A7A43")) + static let fileBadgeOther = themed(light: UIColor(hex: "#52525B"), dark: UIColor(hex: "#3F3F46")) + /// Over the chat while files are dragged onto it, and the wash inside its dashed edge. + static let dropVeil = themed(light: UIColor(hex: "#FFFFFF", alpha: 0.8), dark: UIColor(hex: "#0A0A0A", alpha: 0.8)) + static let dropTarget = themed(light: UIColor(hex: "#F1F1F3", alpha: 0.7), dark: UIColor(hex: "#17171A", alpha: 0.6)) + /// A person with no photo: initials on a grey disc. + static let personAvatar = themed(light: UIColor(hex: "#E4E4E7"), dark: UIColor(hex: "#26262A")) + static let personAvatarForeground = themed(light: UIColor(hex: "#3F3F46"), dark: UIColor(hex: "#EDEDED")) + /// Separation is by colour and hairline, not shadow; only floating things cast one. + static let scrim = Color(UIColor(hex: "#000000", alpha: 0.55)) +} diff --git a/apps/ios/Sugabots/Design/ProviderLogos.generated.swift b/apps/ios/Sugabots/Design/ProviderLogos.generated.swift new file mode 100644 index 000000000..046a67ed4 --- /dev/null +++ b/apps/ios/Sugabots/Design/ProviderLogos.generated.swift @@ -0,0 +1,89 @@ +// Generated by apps/codegen/generate-provider-logos.ts from @sugabots/provider-logos. Do not edit. +import CoreGraphics + +/// Each provider preset's logo in the asset catalog, and how much it's scaled +/// up to even out the padding its owner built into the file. +enum ProviderLogos { + static let assets: [String: (image: String, scale: CGFloat)] = [ + "anthropic": ("anthropic", 1), + "openai": ("openai", 1.75), + "chatgpt": ("openai", 1.75), + "gemini": ("gemini", 1), + "xai": ("xai", 1), + "supergrok": ("xai", 1), + "mistral": ("mistral", 1.5), + "openrouter": ("openrouter", 1), + "groq": ("groq", 1), + "deepseek": ("deepseek", 1), + "together": ("together", 1), + "fireworks": ("fireworks", 1), + "cerebras": ("cerebras", 1), + "ollama": ("ollama", 1), + "lmstudio": ("lmstudio", 1), + "llamacpp": ("llamacpp", 1), + "vllm": ("vllm", 1), + ] +} + +/// A provider in the catalog, as `providerCatalog` lists it. +struct ProviderPreset: Hashable, Identifiable { + let id: String + let name: String + let baseUrl: String + /// `remote` or `local`: on somebody else's servers, or on your own machine. + let hosting: String + /// `api-key`, `optional` or `sign-in`. + let credential: String + /// The service a `sign-in` preset signs in with: `chatgpt` or `xai`. + let signIn: String? + let hint: String + + static let catalog: [ProviderPreset] = [ + ProviderPreset(id: "anthropic", name: "Anthropic", baseUrl: "https://api.anthropic.com", hosting: "remote", credential: "api-key", signIn: nil, hint: "Claude models. Keys are issued at console.anthropic.com."), + ProviderPreset(id: "openai", name: "OpenAI", baseUrl: "https://api.openai.com/v1", hosting: "remote", credential: "api-key", signIn: nil, hint: "GPT models. Keys are issued at platform.openai.com."), + ProviderPreset(id: "chatgpt", name: "ChatGPT", baseUrl: "https://chatgpt.com/backend-api/codex", hosting: "remote", credential: "sign-in", signIn: "chatgpt", hint: "GPT models on your ChatGPT Plus or Pro plan, signed in the way Codex CLI does. Unofficial."), + ProviderPreset(id: "openrouter", name: "OpenRouter", baseUrl: "https://openrouter.ai/api/v1", hosting: "remote", credential: "api-key", signIn: nil, hint: "Many providers' models behind one key, issued at openrouter.ai."), + ProviderPreset(id: "gemini", name: "Google Gemini", baseUrl: "https://generativelanguage.googleapis.com/v1beta/openai", hosting: "remote", credential: "api-key", signIn: nil, hint: "Google's Gemini models. Keys are issued at aistudio.google.com."), + ProviderPreset(id: "groq", name: "Groq", baseUrl: "https://api.groq.com/openai/v1", hosting: "remote", credential: "api-key", signIn: nil, hint: "Fast open-weight models. Keys are issued at console.groq.com."), + ProviderPreset(id: "xai", name: "xAI", baseUrl: "https://api.x.ai/v1", hosting: "remote", credential: "api-key", signIn: nil, hint: "Grok models. Keys are issued at console.x.ai."), + ProviderPreset(id: "supergrok", name: "SuperGrok", baseUrl: "https://api.x.ai/v1", hosting: "remote", credential: "sign-in", signIn: "xai", hint: "Grok models on your SuperGrok or X Premium+ plan, signed in the way Grok Build does. Unofficial."), + ProviderPreset(id: "mistral", name: "Mistral", baseUrl: "https://api.mistral.ai/v1", hosting: "remote", credential: "api-key", signIn: nil, hint: "Mistral models. Keys are issued at console.mistral.ai."), + ProviderPreset(id: "deepseek", name: "DeepSeek", baseUrl: "https://api.deepseek.com/v1", hosting: "remote", credential: "api-key", signIn: nil, hint: "DeepSeek models. Keys are issued at platform.deepseek.com."), + ProviderPreset(id: "together", name: "Together AI", baseUrl: "https://api.together.xyz/v1", hosting: "remote", credential: "api-key", signIn: nil, hint: "Hosted open-weight models. Keys are issued at api.together.ai."), + ProviderPreset(id: "fireworks", name: "Fireworks AI", baseUrl: "https://api.fireworks.ai/inference/v1", hosting: "remote", credential: "api-key", signIn: nil, hint: "Hosted open-weight models. Keys are issued at fireworks.ai."), + ProviderPreset(id: "cerebras", name: "Cerebras", baseUrl: "https://api.cerebras.ai/v1", hosting: "remote", credential: "api-key", signIn: nil, hint: "Fast open-weight models. Keys are issued at cloud.cerebras.ai."), + ProviderPreset(id: "ollama", name: "Ollama", baseUrl: "http://127.0.0.1:11434/v1", hosting: "local", credential: "optional", signIn: nil, hint: "Models you run yourself with Ollama. No key; the stock install listens on port 11434."), + ProviderPreset(id: "lmstudio", name: "LM Studio", baseUrl: "http://127.0.0.1:1234/v1", hosting: "local", credential: "optional", signIn: nil, hint: "LM Studio's local server. No key; it listens on port 1234 once started."), + ProviderPreset(id: "llamacpp", name: "llama.cpp", baseUrl: "http://127.0.0.1:8080/v1", hosting: "local", credential: "optional", signIn: nil, hint: "A llama-server you run yourself. No key unless you started it with one."), + ProviderPreset(id: "vllm", name: "vLLM", baseUrl: "http://127.0.0.1:8000/v1", hosting: "local", credential: "optional", signIn: nil, hint: "A vLLM server you run yourself. No key unless you started it with one."), + ] + + /// The providers every workspace starts with, which can't be deleted, only signed out and switched off. + static let seeded: Set = ["anthropic", "openai", "chatgpt", "ollama"] + + /// Each sign-in service's name, as `signInServiceNames`. + static let signInServiceNames: [String: String] = ["chatgpt": "ChatGPT", "xai": "xAI"] + + /// The path an OpenAI-compatible server answers under, which a bare address is given. + static let openAICompatiblePath = "/v1" + + static func named(_ id: String?) -> ProviderPreset? { + id.flatMap { id in catalog.first { $0.id == id } } + } +} + +/// What a model can do, as `providerModelCapabilityCatalog` lists it. +struct ModelCapability: Hashable { + let key: String + let name: String + let description: String + + static let catalog: [ModelCapability] = [ + ModelCapability(key: "tools", name: "Tools", description: "Can call tools: collaborate, search, fetch a page."), + ModelCapability(key: "vision", name: "Vision", description: "Reads images sent to it."), + ModelCapability(key: "images", name: "Images", description: "Makes images."), + ModelCapability(key: "audio", name: "Audio", description: "Hears or speaks."), + ModelCapability(key: "reasoning", name: "Reasoning", description: "Thinks before it answers."), + ModelCapability(key: "embeddings", name: "Embeddings", description: "Turns text into vectors. Not offered to agents as a chat model."), + ] +} diff --git a/apps/ios/Sugabots/Home/Mutes.generated.swift b/apps/ios/Sugabots/Home/Mutes.generated.swift new file mode 100644 index 000000000..16d36d9dd --- /dev/null +++ b/apps/ios/Sugabots/Home/Mutes.generated.swift @@ -0,0 +1,12 @@ +// Generated by apps/codegen/generate-catalogs.ts from packages/web/src/lib. Do not edit. +import Foundation + +extension MuteDuration { + /// The pauses and mutes offered, as `MUTE_LENGTHS`. + static let all = [ + MuteDuration(label: "For 30 minutes", length: .minutes(30)), + MuteDuration(label: "For 1 hour", length: .minutes(60)), + MuteDuration(label: "For 2 hours", length: .minutes(120)), + MuteDuration(label: "Until tomorrow", length: .tomorrow(atHour: 9)), + ] +} diff --git a/apps/ios/Sugabots/Resources/Emoji.json b/apps/ios/Sugabots/Resources/Emoji.json new file mode 100644 index 000000000..aa5a2536c --- /dev/null +++ b/apps/ios/Sugabots/Resources/Emoji.json @@ -0,0 +1 @@ +{"categories":[{"index":0,"label":"Smileys & emotion"},{"index":1,"label":"People & body"},{"index":3,"label":"Animals & nature"},{"index":4,"label":"Food & drink"},{"index":5,"label":"Travel & places"},{"index":6,"label":"Activities"},{"index":7,"label":"Objects"},{"index":8,"label":"Symbols"},{"index":9,"label":"Flags"}],"skinTones":{"dark":"Dark skin tone","light":"Light skin tone","medium":"Medium skin tone","medium-dark":"Medium-dark skin tone","medium-light":"Medium-light skin tone"},"emojis":[{"emoji":"😀","label":"Grinning face","category":0,"version":1,"tags":["cheerful","cheery","face","grin","happy","laugh","nice","smile","smiling","teeth"],"shortcodes":["grinning"]},{"emoji":"😃","label":"Grinning face with big eyes","category":0,"version":0.6,"tags":["awesome","big","eyes","face","grin","grinning","happy","mouth","open","smile","smiling","teeth","yay"],"shortcodes":["smiley"]},{"emoji":"😄","label":"Grinning face with smiling eyes","category":0,"version":0.6,"tags":["eye","eyes","face","grin","grinning","happy","laugh","lol","mouth","open","smiling"],"shortcodes":["smile"]},{"emoji":"😁","label":"Beaming face with smiling eyes","category":0,"version":0.6,"tags":["beaming","eye","eyes","face","grinning","happy","nice","smile","smiling","teeth"],"shortcodes":["grin"]},{"emoji":"😆","label":"Grinning squinting face","category":0,"version":0.6,"tags":["closed","eyes","face","grinning","haha","hahaha","happy","laugh","lol","mouth","open","rofl","smile","smiling","squinting"],"shortcodes":["laughing","satisfied"]},{"emoji":"😅","label":"Grinning face with sweat","category":0,"version":0.6,"tags":["cold","dejected","excited","face","grinning","mouth","nervous","open","smile","smiling","stress","stressed","sweat"],"shortcodes":["sweat_smile"]},{"emoji":"🤣","label":"Rolling on the floor laughing","category":0,"version":3,"tags":["crying","face","floor","funny","haha","happy","hehe","hilarious","joy","laugh","lmao","lol","roflmao","rolling","tear"],"shortcodes":["rofl"]},{"emoji":"😂","label":"Face with tears of joy","category":0,"version":0.6,"tags":["crying","face","feels","funny","haha","happy","hehe","hilarious","laugh","lmao","lol","rofl","roflmao","tear"],"shortcodes":["joy"]},{"emoji":"🙂","label":"Slightly smiling face","category":0,"version":1,"tags":["face","happy","slightly","smile","smiling"],"shortcodes":["slightly_smiling_face"]},{"emoji":"🙃","label":"Upside-down face","category":0,"version":1,"tags":["face","hehe","smile","upside-down"],"shortcodes":["upside_down_face"]},{"emoji":"🫠","label":"Melting face","category":0,"version":14,"tags":["disappear","dissolve","embarrassed","face","haha","heat","hot","liquid","lol","melt","melting","sarcasm","sarcastic"],"shortcodes":["melting_face"]},{"emoji":"😉","label":"Winking face","category":0,"version":0.6,"tags":["face","flirt","heartbreaker","sexy","slide","tease","winking","winks"],"shortcodes":["wink"]},{"emoji":"😊","label":"Smiling face with smiling eyes","category":0,"version":0.6,"tags":["eye","eyes","face","glad","satisfied","smile","smiling"],"shortcodes":["blush"]},{"emoji":"😇","label":"Smiling face with halo","category":0,"version":1,"tags":["angel","angelic","angels","blessed","face","fairy","fairytale","fantasy","halo","happy","peaceful","smile","smiling","spirit","tale"],"shortcodes":["innocent"]},{"emoji":"🥰","label":"Smiling face with hearts","category":0,"version":11,"tags":["3","adore","crush","face","heart","hearts","ily","love","romance","smile","smiling","you"],"shortcodes":["smiling_face_with_three_hearts"]},{"emoji":"😍","label":"Smiling face with heart-eyes","category":0,"version":0.6,"tags":["143","bae","eye","face","feels","heart-eyes","hearts","ily","kisses","love","romance","romantic","smile","xoxo"],"shortcodes":["heart_eyes"]},{"emoji":"🤩","label":"Star-struck","category":0,"version":5,"tags":["excited","eyes","face","grinning","smile","star","starry-eyed","wow"],"shortcodes":["star_struck"]},{"emoji":"😘","label":"Face blowing a kiss","category":0,"version":0.6,"tags":["adorbs","bae","blowing","face","flirt","heart","ily","kiss","love","lover","miss","muah","romantic","smooch","xoxo","you"],"shortcodes":["kissing_heart"]},{"emoji":"😗","label":"Kissing face","category":0,"version":1,"tags":["143","date","dating","face","flirt","ily","kiss","love","smooch","smooches","xoxo","you"],"shortcodes":["kissing"]},{"emoji":"☺️","label":"Smiling face","category":0,"version":0.6,"tags":["face","happy","outlined","smile","smiling"],"shortcodes":["relaxed"]},{"emoji":"😚","label":"Kissing face with closed eyes","category":0,"version":0.6,"tags":["143","bae","blush","closed","date","dating","eye","eyes","face","flirt","ily","kisses","kissing","smooches","xoxo"],"shortcodes":["kissing_closed_eyes"]},{"emoji":"😙","label":"Kissing face with smiling eyes","category":0,"version":1,"tags":["143","closed","date","dating","eye","eyes","face","flirt","ily","kiss","kisses","kissing","love","night","smile","smiling"],"shortcodes":["kissing_smiling_eyes"]},{"emoji":"🥲","label":"Smiling face with tear","category":0,"version":13,"tags":["face","glad","grateful","happy","joy","pain","proud","relieved","smile","smiley","smiling","tear","touched"],"shortcodes":["smiling_face_with_tear"]},{"emoji":"😋","label":"Face savoring food","category":0,"version":0.6,"tags":["delicious","eat","face","food","full","hungry","savor","smile","smiling","tasty","um","yummy"],"shortcodes":["yum"]},{"emoji":"😛","label":"Face with tongue","category":0,"version":1,"tags":["awesome","cool","face","nice","party","stuck-out","sweet","tongue"],"shortcodes":["stuck_out_tongue"]},{"emoji":"😜","label":"Winking face with tongue","category":0,"version":0.6,"tags":["crazy","epic","eye","face","funny","joke","loopy","nutty","party","stuck-out","tongue","wacky","weirdo","wink","winking","yolo"],"shortcodes":["stuck_out_tongue_winking_eye"]},{"emoji":"🤪","label":"Zany face","category":0,"version":5,"tags":["crazy","eye","eyes","face","goofy","large","small","zany"],"shortcodes":["zany_face"]},{"emoji":"😝","label":"Squinting face with tongue","category":0,"version":0.6,"tags":["closed","eye","eyes","face","gross","horrible","omg","squinting","stuck-out","taste","tongue","whatever","yolo"],"shortcodes":["stuck_out_tongue_closed_eyes"]},{"emoji":"🤑","label":"Money-mouth face","category":0,"version":1,"tags":["face","money","money-mouth","mouth","paid"],"shortcodes":["money_mouth_face"]},{"emoji":"🤗","label":"Smiling face with open hands","category":0,"version":1,"tags":["face","hands","hug","hugging","open","smiling"],"shortcodes":["hugs"]},{"emoji":"🤭","label":"Face with hand over mouth","category":0,"version":5,"tags":["face","giggle","giggling","hand","mouth","oops","realization","secret","shock","sudden","surprise","whoops"],"shortcodes":["hand_over_mouth"]},{"emoji":"🫢","label":"Face with open eyes and hand over mouth","category":0,"version":14,"tags":["amazement","awe","disbelief","embarrass","eyes","face","gasp","hand","mouth","omg","open","over","quiet","scared","shock","surprise"],"shortcodes":["face_with_open_eyes_and_hand_over_mouth"]},{"emoji":"🫣","label":"Face with peeking eye","category":0,"version":14,"tags":["captivated","embarrass","eye","face","hide","hiding","peek","peeking","peep","scared","shy","stare"],"shortcodes":["face_with_peeking_eye"]},{"emoji":"🤫","label":"Shushing face","category":0,"version":5,"tags":["face","quiet","shh","shush","shushing"],"shortcodes":["shushing_face"]},{"emoji":"🤔","label":"Thinking face","category":0,"version":1,"tags":["chin","consider","face","hmm","ponder","pondering","wondering"],"shortcodes":["thinking"]},{"emoji":"🫡","label":"Saluting face","category":0,"version":14,"tags":["face","good","luck","ma’am","ok","respect","salute","saluting","sir","troops","yes"],"shortcodes":["saluting_face"]},{"emoji":"🤐","label":"Zipper-mouth face","category":0,"version":1,"tags":["face","keep","mouth","quiet","secret","shut","zip","zipper","zipper-mouth"],"shortcodes":["zipper_mouth_face"]},{"emoji":"🤨","label":"Face with raised eyebrow","category":0,"version":5,"tags":["disapproval","disbelief","distrust","emoji","eyebrow","face","hmm","mild","raised","skeptic","skeptical","skepticism","surprise","what"],"shortcodes":["raised_eyebrow"]},{"emoji":"😐️","label":"Neutral face","category":0,"version":0.7,"tags":["awkward","blank","deadpan","expressionless","face","fine","jealous","meh","neutral","oh","shade","straight","unamused","unhappy","unimpressed","whatever"],"shortcodes":["neutral_face"]},{"emoji":"😑","label":"Expressionless face","category":0,"version":1,"tags":["awkward","dead","face","fine","inexpressive","jealous","meh","not","oh","omg","straight","uh","unhappy","unimpressed","whatever"],"shortcodes":["expressionless"]},{"emoji":"😶","label":"Face without mouth","category":0,"version":1,"tags":["awkward","blank","expressionless","face","mouth","mouthless","mute","quiet","secret","silence","silent","speechless"],"shortcodes":["no_mouth"]},{"emoji":"🫥","label":"Dotted line face","category":0,"version":14,"tags":["depressed","disappear","dotted","face","hidden","hide","introvert","invisible","line","meh","whatever","wtv"],"shortcodes":["dotted_line_face"]},{"emoji":"😶‍🌫️","label":"Face in clouds","category":0,"version":13.1,"tags":["absentminded","clouds","face","fog","head"],"shortcodes":["face_in_clouds"]},{"emoji":"😏","label":"Smirking face","category":0,"version":0.6,"tags":["boss","dapper","face","flirt","homie","kidding","leer","shade","slick","sly","smug","snicker","suave","suspicious","swag"],"shortcodes":["smirk"]},{"emoji":"😒","label":"Unamused face","category":0,"version":0.6,"tags":["...","bored","face","fine","jealous","jel","jelly","pissed","smh","ugh","uhh","unhappy","weird","whatever"],"shortcodes":["unamused"]},{"emoji":"🙄","label":"Face with rolling eyes","category":0,"version":1,"tags":["eyeroll","eyes","face","rolling","shade","ugh","whatever"],"shortcodes":["roll_eyes"]},{"emoji":"😬","label":"Grimacing face","category":0,"version":1,"tags":["awk","awkward","dentist","face","grimace","grinning","smile","smiling"],"shortcodes":["grimacing"]},{"emoji":"😮‍💨","label":"Face exhaling","category":0,"version":13.1,"tags":["blow","blowing","exhale","exhaling","exhausted","face","gasp","groan","relief","sigh","smiley","smoke","whisper","whistle"],"shortcodes":["face_exhaling"]},{"emoji":"🤥","label":"Lying face","category":0,"version":3,"tags":["face","liar","lie","lying","pinocchio"],"shortcodes":["lying_face"]},{"emoji":"🫨","label":"Shaking face","category":0,"version":15,"tags":["crazy","daze","earthquake","face","omg","panic","shaking","shock","surprise","vibrate","whoa","wow"],"shortcodes":["shaking_face"]},{"emoji":"🙂‍↔️","label":"Head shaking horizontally","category":0,"version":15.1,"tags":["head","horizontally","no","shake","shaking"],"shortcodes":[]},{"emoji":"🙂‍↕️","label":"Head shaking vertically","category":0,"version":15.1,"tags":["head","nod","shaking","vertically","yes"],"shortcodes":[]},{"emoji":"😌","label":"Relieved face","category":0,"version":0.6,"tags":["calm","face","peace","relief","zen"],"shortcodes":["relieved"]},{"emoji":"😔","label":"Pensive face","category":0,"version":0.6,"tags":["awful","bored","dejected","died","disappointed","face","losing","lost","sad","sucks"],"shortcodes":["pensive"]},{"emoji":"😪","label":"Sleepy face","category":0,"version":0.6,"tags":["crying","face","good","night","sad","sleep","sleeping","tired"],"shortcodes":["sleepy"]},{"emoji":"🤤","label":"Drooling face","category":0,"version":3,"tags":["drooling","face"],"shortcodes":["drooling_face"]},{"emoji":"😴","label":"Sleeping face","category":0,"version":1,"tags":["bed","bedtime","face","good","goodnight","nap","night","sleep","tired","whatever","yawn","zzz"],"shortcodes":["sleeping"]},{"emoji":"🫩","label":"Face with bags under eyes","category":0,"version":16,"tags":["bags","bored","exhausted","eyes","face","fatigued","late","sleepy","tired","weary"],"shortcodes":[]},{"emoji":"😷","label":"Face with medical mask","category":0,"version":0.6,"tags":["cold","dentist","dermatologist","doctor","dr","face","germs","medical","medicine","sick"],"shortcodes":["mask"]},{"emoji":"🤒","label":"Face with thermometer","category":0,"version":1,"tags":["face","ill","sick","thermometer"],"shortcodes":["face_with_thermometer"]},{"emoji":"🤕","label":"Face with head-bandage","category":0,"version":1,"tags":["bandage","face","head-bandage","hurt","injury","ouch"],"shortcodes":["face_with_head_bandage"]},{"emoji":"🤢","label":"Nauseated face","category":0,"version":3,"tags":["face","gross","nasty","nauseated","sick","vomit"],"shortcodes":["nauseated_face"]},{"emoji":"🤮","label":"Face vomiting","category":0,"version":5,"tags":["barf","ew","face","gross","puke","sick","spew","throw","up","vomit","vomiting"],"shortcodes":["vomiting_face"]},{"emoji":"🤧","label":"Sneezing face","category":0,"version":3,"tags":["face","fever","flu","gesundheit","sick","sneeze","sneezing"],"shortcodes":["sneezing_face"]},{"emoji":"🥵","label":"Hot face","category":0,"version":11,"tags":["dying","face","feverish","heat","hot","panting","red-faced","stroke","sweating","tongue"],"shortcodes":["hot_face"]},{"emoji":"🥶","label":"Cold face","category":0,"version":11,"tags":["blue","blue-faced","cold","face","freezing","frostbite","icicles","subzero","teeth"],"shortcodes":["cold_face"]},{"emoji":"🥴","label":"Woozy face","category":0,"version":11,"tags":["dizzy","drunk","eyes","face","intoxicated","mouth","tipsy","uneven","wavy","woozy"],"shortcodes":["woozy_face"]},{"emoji":"😵","label":"Face with crossed-out eyes","category":0,"version":0.6,"tags":["crossed-out","dead","dizzy","eyes","face","feels","knocked","out","sick","tired"],"shortcodes":["dizzy_face"]},{"emoji":"😵‍💫","label":"Face with spiral eyes","category":0,"version":13.1,"tags":["confused","dizzy","eyes","face","hypnotized","omg","smiley","spiral","trouble","whoa","woah","woozy"],"shortcodes":["face_with_spiral_eyes"]},{"emoji":"🤯","label":"Exploding head","category":0,"version":5,"tags":["blown","explode","exploding","head","mind","mindblown","no","shocked","way"],"shortcodes":["exploding_head"]},{"emoji":"🤠","label":"Cowboy hat face","category":0,"version":3,"tags":["cowboy","cowgirl","face","hat"],"shortcodes":["cowboy_hat_face"]},{"emoji":"🥳","label":"Partying face","category":0,"version":11,"tags":["bday","birthday","celebrate","celebration","excited","face","happy","hat","hooray","horn","party","partying"],"shortcodes":["partying_face"]},{"emoji":"🥸","label":"Disguised face","category":0,"version":13,"tags":["disguise","eyebrow","face","glasses","incognito","moustache","mustache","nose","person","spy","tache","tash"],"shortcodes":["disguised_face"]},{"emoji":"😎","label":"Smiling face with sunglasses","category":0,"version":1,"tags":["awesome","beach","bright","bro","chilling","cool","face","rad","relaxed","shades","slay","smile","style","swag","win"],"shortcodes":["sunglasses"]},{"emoji":"🤓","label":"Nerd face","category":0,"version":1,"tags":["brainy","clever","expert","face","geek","gifted","glasses","intelligent","nerd","smart"],"shortcodes":["nerd_face"]},{"emoji":"🧐","label":"Face with monocle","category":0,"version":5,"tags":["classy","face","fancy","monocle","rich","stuffy","wealthy"],"shortcodes":["monocle_face"]},{"emoji":"😕","label":"Confused face","category":0,"version":1,"tags":["befuddled","confusing","dunno","face","frown","hm","meh","not","sad","sorry","sure"],"shortcodes":["confused"]},{"emoji":"🫤","label":"Face with diagonal mouth","category":0,"version":14,"tags":["confused","confusion","diagonal","disappointed","doubt","doubtful","face","frustrated","frustration","meh","mouth","skeptical","unsure","whatever","wtv"],"shortcodes":["face_with_diagonal_mouth"]},{"emoji":"😟","label":"Worried face","category":0,"version":1,"tags":["anxious","butterflies","face","nerves","nervous","sad","stress","stressed","surprised","worry"],"shortcodes":["worried"]},{"emoji":"🙁","label":"Slightly frowning face","category":0,"version":1,"tags":["face","frown","frowning","sad","slightly"],"shortcodes":["slightly_frowning_face"]},{"emoji":"☹️","label":"Frowning face","category":0,"version":0.7,"tags":["face","frown","frowning","sad"],"shortcodes":["frowning_face"]},{"emoji":"😮","label":"Face with open mouth","category":0,"version":1,"tags":["believe","face","forgot","mouth","omg","open","shocked","surprised","sympathy","unbelievable","unreal","whoa","wow","you"],"shortcodes":["open_mouth"]},{"emoji":"😯","label":"Hushed face","category":0,"version":1,"tags":["epic","face","omg","stunned","surprised","whoa","woah"],"shortcodes":["hushed"]},{"emoji":"😲","label":"Astonished face","category":0,"version":0.6,"tags":["cost","face","no","omg","shocked","totally","way"],"shortcodes":["astonished"]},{"emoji":"😳","label":"Flushed face","category":0,"version":0.6,"tags":["amazed","awkward","crazy","dazed","dead","disbelief","embarrassed","face","geez","heat","hot","impressed","jeez","what","wow"],"shortcodes":["flushed"]},{"emoji":"🫪","label":"Distorted face","category":0,"version":17,"tags":["anxiety","bloated","panic","shocked","surprised","vulnerable"],"shortcodes":[]},{"emoji":"🥺","label":"Pleading face","category":0,"version":11,"tags":["begging","big","eyes","face","mercy","not","pleading","please","pretty","puppy","sad","why"],"shortcodes":["pleading_face"]},{"emoji":"🥹","label":"Face holding back tears","category":0,"version":14,"tags":["admiration","aww","back","cry","embarrassed","face","feelings","grateful","gratitude","holding","joy","please","proud","resist","sad","tears"],"shortcodes":["face_holding_back_tears"]},{"emoji":"😦","label":"Frowning face with open mouth","category":0,"version":1,"tags":["caught","face","frown","guard","mouth","open","scared","scary","surprise","what","wow"],"shortcodes":["frowning"]},{"emoji":"😧","label":"Anguished face","category":0,"version":1,"tags":["face","forgot","scared","scary","stressed","surprise","unhappy","what","wow"],"shortcodes":["anguished"]},{"emoji":"😨","label":"Fearful face","category":0,"version":0.6,"tags":["afraid","anxious","blame","face","fear","scared","worried"],"shortcodes":["fearful"]},{"emoji":"😰","label":"Anxious face with sweat","category":0,"version":0.6,"tags":["anxious","blue","cold","eek","face","mouth","nervous","open","rushed","scared","sweat","yikes"],"shortcodes":["cold_sweat"]},{"emoji":"😥","label":"Sad but relieved face","category":0,"version":0.6,"tags":["anxious","call","close","complicated","disappointed","face","not","relieved","sad","sweat","time","whew"],"shortcodes":["disappointed_relieved"]},{"emoji":"😢","label":"Crying face","category":0,"version":0.6,"tags":["awful","crying","face","feels","miss","sad","tear","triste","unhappy"],"shortcodes":["cry"]},{"emoji":"😭","label":"Loudly crying face","category":0,"version":0.6,"tags":["bawling","cry","crying","face","loudly","sad","tear","tears","unhappy"],"shortcodes":["sob"]},{"emoji":"😱","label":"Face screaming in fear","category":0,"version":0.6,"tags":["epic","face","fear","fearful","munch","scared","screamer","screaming","shocked","surprised","woah"],"shortcodes":["scream"]},{"emoji":"😖","label":"Confounded face","category":0,"version":0.6,"tags":["annoyed","confused","cringe","distraught","face","feels","frustrated","mad","sad"],"shortcodes":["confounded"]},{"emoji":"😣","label":"Persevering face","category":0,"version":0.6,"tags":["concentrate","concentration","face","focus","headache","persevering"],"shortcodes":["persevere"]},{"emoji":"😞","label":"Disappointed face","category":0,"version":0.6,"tags":["awful","blame","dejected","face","fail","losing","sad","unhappy"],"shortcodes":["disappointed"]},{"emoji":"😓","label":"Downcast face with sweat","category":0,"version":0.6,"tags":["close","cold","downcast","face","feels","headache","nervous","sad","scared","yikes"],"shortcodes":["sweat"]},{"emoji":"😩","label":"Weary face","category":0,"version":0.6,"tags":["crying","face","fail","feels","hungry","mad","nooo","sad","sleepy","tired","unhappy"],"shortcodes":["weary"]},{"emoji":"😫","label":"Tired face","category":0,"version":0.6,"tags":["cost","face","feels","nap","sad","sneeze","tired"],"shortcodes":["tired_face"]},{"emoji":"🥱","label":"Yawning face","category":0,"version":12,"tags":["bedtime","bored","face","goodnight","nap","night","sleep","sleepy","tired","whatever","yawn","yawning","zzz"],"shortcodes":["yawning_face"]},{"emoji":"😤","label":"Face with steam from nose","category":0,"version":0.6,"tags":["anger","angry","face","feels","fume","fuming","furious","fury","mad","nose","steam","unhappy","won"],"shortcodes":["triumph"]},{"emoji":"😡","label":"Enraged face","category":0,"version":0.6,"tags":["anger","angry","enraged","face","feels","mad","maddening","pouting","red","shade","unhappy","upset"],"shortcodes":["pout","rage"]},{"emoji":"😠","label":"Angry face","category":0,"version":0.6,"tags":["anger","blame","face","feels","frustrated","mad","maddening","rage","shade","unhappy","upset"],"shortcodes":["angry"]},{"emoji":"🤬","label":"Face with symbols on mouth","category":0,"version":5,"tags":["censor","cursing","cussing","face","mad","mouth","pissed","swearing","symbols"],"shortcodes":["cursing_face"]},{"emoji":"😈","label":"Smiling face with horns","category":0,"version":1,"tags":["demon","devil","evil","face","fairy","fairytale","fantasy","horns","purple","shade","smile","smiling","tale"],"shortcodes":["smiling_imp"]},{"emoji":"👿","label":"Angry face with horns","category":0,"version":0.6,"tags":["angry","demon","devil","evil","face","fairy","fairytale","fantasy","horns","mischievous","purple","shade","tale"],"shortcodes":["imp"]},{"emoji":"💀","label":"Skull","category":0,"version":0.6,"tags":["body","dead","death","face","fairy","fairytale","i’m","lmao","monster","tale","yolo"],"shortcodes":["skull"]},{"emoji":"☠️","label":"Skull and crossbones","category":0,"version":1,"tags":["bone","crossbones","dead","death","face","monster","skull"],"shortcodes":["skull_and_crossbones"]},{"emoji":"💩","label":"Pile of poo","category":0,"version":0.6,"tags":["bs","comic","doo","dung","face","fml","monster","pile","poo","smelly","smh","stink","stinks","stinky","turd"],"shortcodes":["hankey","poop","shit"]},{"emoji":"🤡","label":"Clown face","category":0,"version":3,"tags":["clown","face"],"shortcodes":["clown_face"]},{"emoji":"👹","label":"Ogre","category":0,"version":0.6,"tags":["creature","devil","face","fairy","fairytale","fantasy","mask","monster","scary","tale"],"shortcodes":["japanese_ogre"]},{"emoji":"👺","label":"Goblin","category":0,"version":0.6,"tags":["angry","creature","face","fairy","fairytale","fantasy","mask","mean","monster","tale"],"shortcodes":["japanese_goblin"]},{"emoji":"👻","label":"Ghost","category":0,"version":0.6,"tags":["boo","creature","excited","face","fairy","fairytale","fantasy","halloween","haunting","monster","scary","silly","tale"],"shortcodes":["ghost"]},{"emoji":"👽️","label":"Alien","category":0,"version":0.6,"tags":["creature","extraterrestrial","face","fairy","fairytale","fantasy","monster","space","tale","ufo"],"shortcodes":["alien"]},{"emoji":"👾","label":"Alien monster","category":0,"version":0.6,"tags":["alien","creature","extraterrestrial","face","fairy","fairytale","fantasy","game","gamer","games","monster","pixelated","space","tale","ufo"],"shortcodes":["space_invader"]},{"emoji":"🤖","label":"Robot","category":0,"version":1,"tags":["face","monster"],"shortcodes":["robot"]},{"emoji":"😺","label":"Grinning cat","category":0,"version":0.6,"tags":["animal","cat","face","grinning","mouth","open","smile","smiling"],"shortcodes":["smiley_cat"]},{"emoji":"😸","label":"Grinning cat with smiling eyes","category":0,"version":0.6,"tags":["animal","cat","eye","eyes","face","grin","grinning","smile","smiling"],"shortcodes":["smile_cat"]},{"emoji":"😹","label":"Cat with tears of joy","category":0,"version":0.6,"tags":["animal","cat","face","joy","laugh","laughing","lol","tear","tears"],"shortcodes":["joy_cat"]},{"emoji":"😻","label":"Smiling cat with heart-eyes","category":0,"version":0.6,"tags":["animal","cat","eye","face","heart","heart-eyes","love","smile","smiling"],"shortcodes":["heart_eyes_cat"]},{"emoji":"😼","label":"Cat with wry smile","category":0,"version":0.6,"tags":["animal","cat","face","ironic","smile","wry"],"shortcodes":["smirk_cat"]},{"emoji":"😽","label":"Kissing cat","category":0,"version":0.6,"tags":["animal","cat","closed","eye","eyes","face","kiss","kissing"],"shortcodes":["kissing_cat"]},{"emoji":"🙀","label":"Weary cat","category":0,"version":0.6,"tags":["animal","cat","face","oh","surprised","weary"],"shortcodes":["scream_cat"]},{"emoji":"😿","label":"Crying cat","category":0,"version":0.6,"tags":["animal","cat","cry","crying","face","sad","tear"],"shortcodes":["crying_cat_face"]},{"emoji":"😾","label":"Pouting cat","category":0,"version":0.6,"tags":["animal","cat","face","pouting"],"shortcodes":["pouting_cat"]},{"emoji":"🙈","label":"See-no-evil monkey","category":0,"version":0.6,"tags":["embarrassed","evil","face","forbidden","forgot","gesture","hide","monkey","no","omg","prohibited","scared","secret","smh","watch"],"shortcodes":["see_no_evil"]},{"emoji":"🙉","label":"Hear-no-evil monkey","category":0,"version":0.6,"tags":["animal","ears","evil","face","forbidden","gesture","hear","listen","monkey","no","not","prohibited","secret","shh","tmi"],"shortcodes":["hear_no_evil"]},{"emoji":"🙊","label":"Speak-no-evil monkey","category":0,"version":0.6,"tags":["animal","evil","face","forbidden","gesture","monkey","no","not","oops","prohibited","quiet","secret","speak","stealth"],"shortcodes":["speak_no_evil"]},{"emoji":"💌","label":"Love letter","category":0,"version":0.6,"tags":["heart","letter","love","mail","romance","valentine"],"shortcodes":["love_letter"]},{"emoji":"💘","label":"Heart with arrow","category":0,"version":0.6,"tags":["143","adorbs","arrow","date","emotion","heart","ily","love","romance","valentine"],"shortcodes":["cupid"]},{"emoji":"💝","label":"Heart with ribbon","category":0,"version":0.6,"tags":["143","anniversary","emotion","heart","ily","kisses","ribbon","valentine","xoxo"],"shortcodes":["gift_heart"]},{"emoji":"💖","label":"Sparkling heart","category":0,"version":0.6,"tags":["143","emotion","excited","good","heart","ily","kisses","morning","night","sparkle","sparkling","xoxo"],"shortcodes":["sparkling_heart"]},{"emoji":"💗","label":"Growing heart","category":0,"version":0.6,"tags":["143","emotion","excited","growing","heart","ily","kisses","muah","nervous","pulse","xoxo"],"shortcodes":["heartpulse"]},{"emoji":"💓","label":"Beating heart","category":0,"version":0.6,"tags":["143","beating","cardio","emotion","heart","ily","love","pulsating","pulse"],"shortcodes":["heartbeat"]},{"emoji":"💞","label":"Revolving hearts","category":0,"version":0.6,"tags":["143","adorbs","anniversary","emotion","heart","hearts","revolving"],"shortcodes":["revolving_hearts"]},{"emoji":"💕","label":"Two hearts","category":0,"version":0.6,"tags":["143","anniversary","date","dating","emotion","heart","hearts","ily","kisses","love","loving","two","xoxo"],"shortcodes":["two_hearts"]},{"emoji":"💟","label":"Heart decoration","category":0,"version":0.6,"tags":["143","decoration","emotion","heart","hearth","purple","white"],"shortcodes":["heart_decoration"]},{"emoji":"❣️","label":"Heart exclamation","category":0,"version":1,"tags":["exclamation","heart","heavy","mark","punctuation"],"shortcodes":["heavy_heart_exclamation"]},{"emoji":"💔","label":"Broken heart","category":0,"version":0.6,"tags":["break","broken","crushed","emotion","heart","heartbroken","lonely","sad"],"shortcodes":["broken_heart"]},{"emoji":"❤️‍🔥","label":"Heart on fire","category":0,"version":13.1,"tags":["burn","fire","heart","love","lust","sacred"],"shortcodes":["heart_on_fire"]},{"emoji":"❤️‍🩹","label":"Mending heart","category":0,"version":13.1,"tags":["healthier","heart","improving","mending","recovering","recuperating","well"],"shortcodes":["mending_heart"]},{"emoji":"❤️","label":"Red heart","category":0,"version":0.6,"tags":["emotion","love","red"],"shortcodes":["heart"]},{"emoji":"🩷","label":"Pink heart","category":0,"version":15,"tags":["143","adorable","cute","emotion","heart","ily","like","love","pink","special","sweet"],"shortcodes":["pink_heart"]},{"emoji":"🧡","label":"Orange heart","category":0,"version":5,"tags":["143","heart","orange"],"shortcodes":["orange_heart"]},{"emoji":"💛","label":"Yellow heart","category":0,"version":0.6,"tags":["143","cardiac","emotion","heart","ily","love","yellow"],"shortcodes":["yellow_heart"]},{"emoji":"💚","label":"Green heart","category":0,"version":0.6,"tags":["143","emotion","green","heart","ily","love","romantic"],"shortcodes":["green_heart"]},{"emoji":"💙","label":"Blue heart","category":0,"version":0.6,"tags":["143","blue","emotion","heart","ily","love","romance"],"shortcodes":["blue_heart"]},{"emoji":"🩵","label":"Light blue heart","category":0,"version":15,"tags":["143","blue","cute","cyan","emotion","heart","ily","light","like","love","sky","special","teal"],"shortcodes":["light_blue_heart"]},{"emoji":"💜","label":"Purple heart","category":0,"version":0.6,"tags":["143","bestest","emotion","heart","ily","love","purple"],"shortcodes":["purple_heart"]},{"emoji":"🤎","label":"Brown heart","category":0,"version":12,"tags":["143","brown","heart"],"shortcodes":["brown_heart"]},{"emoji":"🖤","label":"Black heart","category":0,"version":3,"tags":["black","evil","heart","wicked"],"shortcodes":["black_heart"]},{"emoji":"🩶","label":"Grey heart","category":0,"version":15,"tags":["143","emotion","gray","grey","heart","ily","love","silver","slate","special"],"shortcodes":["grey_heart"]},{"emoji":"🤍","label":"White heart","category":0,"version":12,"tags":["143","heart","white"],"shortcodes":["white_heart"]},{"emoji":"💋","label":"Kiss mark","category":0,"version":0.6,"tags":["dating","emotion","heart","kissing","lips","mark","romance","sexy"],"shortcodes":["kiss"]},{"emoji":"💯","label":"Hundred points","category":0,"version":0.6,"tags":["a+","agree","clearly","definitely","faithful","fleek","full","hundred","keep","perfect","point","score","true","truth","yup"],"shortcodes":["100"]},{"emoji":"💢","label":"Anger symbol","category":0,"version":0.6,"tags":["angry","comic","mad","symbol","upset"],"shortcodes":["anger"]},{"emoji":"🫯","label":"Fight cloud","category":0,"version":17,"tags":["argument","brawl","debate","disagreement","fight","ruckus","wrestle"],"shortcodes":[]},{"emoji":"💥","label":"Collision","category":0,"version":0.6,"tags":["bomb","collide","comic","explode"],"shortcodes":["boom","collision"]},{"emoji":"💫","label":"Dizzy","category":0,"version":0.6,"tags":["comic","shining","shooting","star","stars"],"shortcodes":["dizzy"]},{"emoji":"💦","label":"Sweat droplets","category":0,"version":0.6,"tags":["comic","drip","droplet","droplets","drops","splashing","squirt","sweat","water","wet","work","workout"],"shortcodes":["sweat_drops"]},{"emoji":"💨","label":"Dashing away","category":0,"version":0.6,"tags":["away","cloud","comic","dashing","fart","fast","go","gone","gotta","running","smoke"],"shortcodes":["dash"]},{"emoji":"🕳️","label":"Hole","category":0,"version":0.7,"tags":[],"shortcodes":["hole"]},{"emoji":"💬","label":"Speech balloon","category":0,"version":0.6,"tags":["balloon","bubble","comic","dialog","message","sms","speech","talk","text","typing"],"shortcodes":["speech_balloon"]},{"emoji":"👁️‍🗨️","label":"Eye in speech bubble","category":0,"version":2,"tags":["balloon","bubble","eye","speech","witness"],"shortcodes":["eye_speech_bubble"]},{"emoji":"🗨️","label":"Left speech bubble","category":0,"version":2,"tags":["balloon","bubble","dialog","left","speech"],"shortcodes":["left_speech_bubble"]},{"emoji":"🗯️","label":"Right anger bubble","category":0,"version":0.7,"tags":["anger","angry","balloon","bubble","mad","right"],"shortcodes":["right_anger_bubble"]},{"emoji":"💭","label":"Thought balloon","category":0,"version":1,"tags":["balloon","bubble","cartoon","cloud","comic","daydream","decisions","dream","idea","invent","invention","realize","think","thoughts","wonder"],"shortcodes":["thought_balloon"]},{"emoji":"💤","label":"ZZZ","category":0,"version":0.6,"tags":["comic","good","goodnight","night","sleep","sleeping","sleepy","tired"],"shortcodes":["zzz"]},{"emoji":"👋","label":"Waving hand","category":1,"version":0.6,"tags":["bye","cya","g2g","greetings","gtg","hand","hello","hey","hi","later","outtie","ttfn","ttyl","yo","you"],"shortcodes":["wave"],"skins":{"light":"👋🏻","medium-light":"👋🏼","medium":"👋🏽","medium-dark":"👋🏾","dark":"👋🏿"}},{"emoji":"🤚","label":"Raised back of hand","category":1,"version":3,"tags":["back","backhand","hand","raised"],"shortcodes":["raised_back_of_hand"],"skins":{"light":"🤚🏻","medium-light":"🤚🏼","medium":"🤚🏽","medium-dark":"🤚🏾","dark":"🤚🏿"}},{"emoji":"🖐️","label":"Hand with fingers splayed","category":1,"version":0.7,"tags":["finger","fingers","hand","raised","splayed","stop"],"shortcodes":["raised_hand_with_fingers_splayed"],"skins":{"light":"🖐🏻","medium-light":"🖐🏼","medium":"🖐🏽","medium-dark":"🖐🏾","dark":"🖐🏿"}},{"emoji":"✋️","label":"Raised hand","category":1,"version":0.6,"tags":["5","five","high","raised","stop"],"shortcodes":["hand","raised_hand"],"skins":{"light":"✋🏻","medium-light":"✋🏼","medium":"✋🏽","medium-dark":"✋🏾","dark":"✋🏿"}},{"emoji":"🖖","label":"Vulcan salute","category":1,"version":1,"tags":["finger","hand","hands","salute","vulcan"],"shortcodes":["vulcan_salute"],"skins":{"light":"🖖🏻","medium-light":"🖖🏼","medium":"🖖🏽","medium-dark":"🖖🏾","dark":"🖖🏿"}},{"emoji":"🫱","label":"Rightwards hand","category":1,"version":14,"tags":["hand","handshake","hold","reach","right","rightward","rightwards","shake"],"shortcodes":["rightwards_hand"],"skins":{"light":"🫱🏻","medium-light":"🫱🏼","medium":"🫱🏽","medium-dark":"🫱🏾","dark":"🫱🏿"}},{"emoji":"🫲","label":"Leftwards hand","category":1,"version":14,"tags":["hand","handshake","hold","left","leftward","leftwards","reach","shake"],"shortcodes":["leftwards_hand"],"skins":{"light":"🫲🏻","medium-light":"🫲🏼","medium":"🫲🏽","medium-dark":"🫲🏾","dark":"🫲🏿"}},{"emoji":"🫳","label":"Palm down hand","category":1,"version":14,"tags":["dismiss","down","drop","dropped","hand","palm","pick","shoo","up"],"shortcodes":["palm_down_hand"],"skins":{"light":"🫳🏻","medium-light":"🫳🏼","medium":"🫳🏽","medium-dark":"🫳🏾","dark":"🫳🏿"}},{"emoji":"🫴","label":"Palm up hand","category":1,"version":14,"tags":["beckon","catch","come","hand","hold","know","lift","me","offer","palm","tell"],"shortcodes":["palm_up_hand"],"skins":{"light":"🫴🏻","medium-light":"🫴🏼","medium":"🫴🏽","medium-dark":"🫴🏾","dark":"🫴🏿"}},{"emoji":"🫷","label":"Leftwards pushing hand","category":1,"version":15,"tags":["block","five","halt","hand","high","hold","leftward","leftwards","pause","push","pushing","refuse","slap","stop","wait"],"shortcodes":["leftwards_pushing_hand"],"skins":{"light":"🫷🏻","medium-light":"🫷🏼","medium":"🫷🏽","medium-dark":"🫷🏾","dark":"🫷🏿"}},{"emoji":"🫸","label":"Rightwards pushing hand","category":1,"version":15,"tags":["block","five","halt","hand","high","hold","pause","push","pushing","refuse","rightward","rightwards","slap","stop","wait"],"shortcodes":["rightwards_pushing_hand"],"skins":{"light":"🫸🏻","medium-light":"🫸🏼","medium":"🫸🏽","medium-dark":"🫸🏾","dark":"🫸🏿"}},{"emoji":"👌","label":"OK hand","category":1,"version":0.6,"tags":["awesome","bet","dope","fleek","fosho","got","gotcha","hand","legit","ok","okay","pinch","rad","sure","sweet","three"],"shortcodes":["ok_hand"],"skins":{"light":"👌🏻","medium-light":"👌🏼","medium":"👌🏽","medium-dark":"👌🏾","dark":"👌🏿"}},{"emoji":"🤌","label":"Pinched fingers","category":1,"version":13,"tags":["fingers","gesture","hand","hold","huh","interrogation","patience","pinched","relax","sarcastic","ugh","what","zip"],"shortcodes":["pinched_fingers"],"skins":{"light":"🤌🏻","medium-light":"🤌🏼","medium":"🤌🏽","medium-dark":"🤌🏾","dark":"🤌🏿"}},{"emoji":"🤏","label":"Pinching hand","category":1,"version":12,"tags":["amount","bit","fingers","hand","little","pinching","small","sort"],"shortcodes":["pinching_hand"],"skins":{"light":"🤏🏻","medium-light":"🤏🏼","medium":"🤏🏽","medium-dark":"🤏🏾","dark":"🤏🏿"}},{"emoji":"✌️","label":"Victory hand","category":1,"version":0.6,"tags":["hand","peace","victory"],"shortcodes":["v"],"skins":{"light":"✌🏻","medium-light":"✌🏼","medium":"✌🏽","medium-dark":"✌🏾","dark":"✌🏿"}},{"emoji":"🤞","label":"Crossed fingers","category":1,"version":3,"tags":["cross","crossed","finger","fingers","hand","luck"],"shortcodes":["crossed_fingers"],"skins":{"light":"🤞🏻","medium-light":"🤞🏼","medium":"🤞🏽","medium-dark":"🤞🏾","dark":"🤞🏿"}},{"emoji":"🫰","label":"Hand with index finger and thumb crossed","category":1,"version":14,"tags":["<3","crossed","expensive","finger","hand","heart","index","love","money","snap","thumb"],"shortcodes":["hand_with_index_finger_and_thumb_crossed"],"skins":{"light":"🫰🏻","medium-light":"🫰🏼","medium":"🫰🏽","medium-dark":"🫰🏾","dark":"🫰🏿"}},{"emoji":"🤟","label":"Love-you gesture","category":1,"version":5,"tags":["fingers","gesture","hand","ily","love","love-you","three","you"],"shortcodes":["love_you_gesture"],"skins":{"light":"🤟🏻","medium-light":"🤟🏼","medium":"🤟🏽","medium-dark":"🤟🏾","dark":"🤟🏿"}},{"emoji":"🤘","label":"Sign of the horns","category":1,"version":1,"tags":["finger","hand","horns","rock-on","sign"],"shortcodes":["metal"],"skins":{"light":"🤘🏻","medium-light":"🤘🏼","medium":"🤘🏽","medium-dark":"🤘🏾","dark":"🤘🏿"}},{"emoji":"🤙","label":"Call me hand","category":1,"version":3,"tags":["call","hand","hang","loose","me","shaka"],"shortcodes":["call_me_hand"],"skins":{"light":"🤙🏻","medium-light":"🤙🏼","medium":"🤙🏽","medium-dark":"🤙🏾","dark":"🤙🏿"}},{"emoji":"👈️","label":"Backhand index pointing left","category":1,"version":0.6,"tags":["backhand","finger","hand","index","left","point","pointing"],"shortcodes":["point_left"],"skins":{"light":"👈🏻","medium-light":"👈🏼","medium":"👈🏽","medium-dark":"👈🏾","dark":"👈🏿"}},{"emoji":"👉️","label":"Backhand index pointing right","category":1,"version":0.6,"tags":["backhand","finger","hand","index","point","pointing","right"],"shortcodes":["point_right"],"skins":{"light":"👉🏻","medium-light":"👉🏼","medium":"👉🏽","medium-dark":"👉🏾","dark":"👉🏿"}},{"emoji":"👆️","label":"Backhand index pointing up","category":1,"version":0.6,"tags":["backhand","finger","hand","index","point","pointing","up"],"shortcodes":["point_up_2"],"skins":{"light":"👆🏻","medium-light":"👆🏼","medium":"👆🏽","medium-dark":"👆🏾","dark":"👆🏿"}},{"emoji":"🖕","label":"Middle finger","category":1,"version":1,"tags":["finger","hand","middle"],"shortcodes":["fu","middle_finger"],"skins":{"light":"🖕🏻","medium-light":"🖕🏼","medium":"🖕🏽","medium-dark":"🖕🏾","dark":"🖕🏿"}},{"emoji":"👇️","label":"Backhand index pointing down","category":1,"version":0.6,"tags":["backhand","down","finger","hand","index","point","pointing"],"shortcodes":["point_down"],"skins":{"light":"👇🏻","medium-light":"👇🏼","medium":"👇🏽","medium-dark":"👇🏾","dark":"👇🏿"}},{"emoji":"☝️","label":"Index pointing up","category":1,"version":0.6,"tags":["finger","hand","index","point","pointing","this","up"],"shortcodes":["point_up"],"skins":{"light":"☝🏻","medium-light":"☝🏼","medium":"☝🏽","medium-dark":"☝🏾","dark":"☝🏿"}},{"emoji":"🫵","label":"Index pointing at the viewer","category":1,"version":14,"tags":["at","finger","hand","index","pointing","poke","viewer","you"],"shortcodes":["index_pointing_at_the_viewer"],"skins":{"light":"🫵🏻","medium-light":"🫵🏼","medium":"🫵🏽","medium-dark":"🫵🏾","dark":"🫵🏿"}},{"emoji":"👍️","label":"Thumbs up","category":1,"version":0.6,"tags":["good","hand","like","thumb","up","yes"],"shortcodes":["+1","thumbsup"],"skins":{"light":"👍🏻","medium-light":"👍🏼","medium":"👍🏽","medium-dark":"👍🏾","dark":"👍🏿"}},{"emoji":"👎️","label":"Thumbs down","category":1,"version":0.6,"tags":["bad","dislike","down","good","hand","no","nope","thumb","thumbs"],"shortcodes":["-1","thumbsdown"],"skins":{"light":"👎🏻","medium-light":"👎🏼","medium":"👎🏽","medium-dark":"👎🏾","dark":"👎🏿"}},{"emoji":"✊️","label":"Raised fist","category":1,"version":0.6,"tags":["clenched","hand","punch","raised","solidarity"],"shortcodes":["fist","fist_raised"],"skins":{"light":"✊🏻","medium-light":"✊🏼","medium":"✊🏽","medium-dark":"✊🏾","dark":"✊🏿"}},{"emoji":"👊","label":"Oncoming fist","category":1,"version":0.6,"tags":["absolutely","agree","boom","bro","bruh","bump","clenched","correct","fist","hand","knuckle","oncoming","pound","rock","ttyl"],"shortcodes":["facepunch","fist_oncoming","punch"],"skins":{"light":"👊🏻","medium-light":"👊🏼","medium":"👊🏽","medium-dark":"👊🏾","dark":"👊🏿"}},{"emoji":"🤛","label":"Left-facing fist","category":1,"version":3,"tags":["fist","left-facing","leftwards"],"shortcodes":["fist_left"],"skins":{"light":"🤛🏻","medium-light":"🤛🏼","medium":"🤛🏽","medium-dark":"🤛🏾","dark":"🤛🏿"}},{"emoji":"🤜","label":"Right-facing fist","category":1,"version":3,"tags":["fist","right-facing","rightwards"],"shortcodes":["fist_right"],"skins":{"light":"🤜🏻","medium-light":"🤜🏼","medium":"🤜🏽","medium-dark":"🤜🏾","dark":"🤜🏿"}},{"emoji":"👏","label":"Clapping hands","category":1,"version":0.6,"tags":["applause","approval","awesome","congrats","congratulations","excited","good","great","hand","homie","job","nice","prayed","well","yay"],"shortcodes":["clap"],"skins":{"light":"👏🏻","medium-light":"👏🏼","medium":"👏🏽","medium-dark":"👏🏾","dark":"👏🏿"}},{"emoji":"🙌","label":"Raising hands","category":1,"version":0.6,"tags":["celebration","gesture","hand","hands","hooray","praise","raised","raising"],"shortcodes":["raised_hands"],"skins":{"light":"🙌🏻","medium-light":"🙌🏼","medium":"🙌🏽","medium-dark":"🙌🏾","dark":"🙌🏿"}},{"emoji":"🫶","label":"Heart hands","category":1,"version":14,"tags":["<3","hands","heart","love","you"],"shortcodes":["heart_hands"],"skins":{"light":"🫶🏻","medium-light":"🫶🏼","medium":"🫶🏽","medium-dark":"🫶🏾","dark":"🫶🏿"}},{"emoji":"👐","label":"Open hands","category":1,"version":0.6,"tags":["hand","hands","hug","jazz","open","swerve"],"shortcodes":["open_hands"],"skins":{"light":"👐🏻","medium-light":"👐🏼","medium":"👐🏽","medium-dark":"👐🏾","dark":"👐🏿"}},{"emoji":"🤲","label":"Palms up together","category":1,"version":5,"tags":["cupped","dua","hands","palms","pray","prayer","together","up","wish"],"shortcodes":["palms_up_together"],"skins":{"light":"🤲🏻","medium-light":"🤲🏼","medium":"🤲🏽","medium-dark":"🤲🏾","dark":"🤲🏿"}},{"emoji":"🤝","label":"Handshake","category":1,"version":3,"tags":["agreement","deal","hand","meeting","shake"],"shortcodes":["handshake"],"skins":{"light":"🤝🏻","medium-light":"🤝🏼","medium":"🤝🏽","medium-dark":"🤝🏾","dark":"🤝🏿"}},{"emoji":"🙏","label":"Folded hands","category":1,"version":0.6,"tags":["appreciate","ask","beg","blessed","bow","cmon","five","folded","gesture","hand","high","please","thanks","thx"],"shortcodes":["pray"],"skins":{"light":"🙏🏻","medium-light":"🙏🏼","medium":"🙏🏽","medium-dark":"🙏🏾","dark":"🙏🏿"}},{"emoji":"✍️","label":"Writing hand","category":1,"version":0.7,"tags":["hand","write","writing"],"shortcodes":["writing_hand"],"skins":{"light":"✍🏻","medium-light":"✍🏼","medium":"✍🏽","medium-dark":"✍🏾","dark":"✍🏿"}},{"emoji":"💅","label":"Nail polish","category":1,"version":0.6,"tags":["bored","care","cosmetics","done","makeup","manicure","nail","polish","whatever"],"shortcodes":["nail_care"],"skins":{"light":"💅🏻","medium-light":"💅🏼","medium":"💅🏽","medium-dark":"💅🏾","dark":"💅🏿"}},{"emoji":"🤳","label":"Selfie","category":1,"version":3,"tags":["camera","phone"],"shortcodes":["selfie"],"skins":{"light":"🤳🏻","medium-light":"🤳🏼","medium":"🤳🏽","medium-dark":"🤳🏾","dark":"🤳🏿"}},{"emoji":"💪","label":"Flexed biceps","category":1,"version":0.6,"tags":["arm","beast","bench","biceps","bodybuilder","bro","curls","flex","gains","gym","jacked","press","ripped","strong","weightlift"],"shortcodes":["muscle"],"skins":{"light":"💪🏻","medium-light":"💪🏼","medium":"💪🏽","medium-dark":"💪🏾","dark":"💪🏿"}},{"emoji":"🦾","label":"Mechanical arm","category":1,"version":12,"tags":["accessibility","arm","mechanical","prosthetic"],"shortcodes":["mechanical_arm"]},{"emoji":"🦿","label":"Mechanical leg","category":1,"version":12,"tags":["accessibility","leg","mechanical","prosthetic"],"shortcodes":["mechanical_leg"]},{"emoji":"🦵","label":"Leg","category":1,"version":11,"tags":["bent","foot","kick","knee","limb"],"shortcodes":["leg"],"skins":{"light":"🦵🏻","medium-light":"🦵🏼","medium":"🦵🏽","medium-dark":"🦵🏾","dark":"🦵🏿"}},{"emoji":"🦶","label":"Foot","category":1,"version":11,"tags":["ankle","feet","kick","stomp"],"shortcodes":["foot"],"skins":{"light":"🦶🏻","medium-light":"🦶🏼","medium":"🦶🏽","medium-dark":"🦶🏾","dark":"🦶🏿"}},{"emoji":"👂️","label":"Ear","category":1,"version":0.6,"tags":["body","ears","hear","hearing","listen","listening","sound"],"shortcodes":["ear"],"skins":{"light":"👂🏻","medium-light":"👂🏼","medium":"👂🏽","medium-dark":"👂🏾","dark":"👂🏿"}},{"emoji":"🦻","label":"Ear with hearing aid","category":1,"version":12,"tags":["accessibility","aid","ear","hard","hearing"],"shortcodes":["ear_with_hearing_aid"],"skins":{"light":"🦻🏻","medium-light":"🦻🏼","medium":"🦻🏽","medium-dark":"🦻🏾","dark":"🦻🏿"}},{"emoji":"👃","label":"Nose","category":1,"version":0.6,"tags":["body","noses","nosey","odor","smell","smells"],"shortcodes":["nose"],"skins":{"light":"👃🏻","medium-light":"👃🏼","medium":"👃🏽","medium-dark":"👃🏾","dark":"👃🏿"}},{"emoji":"🧠","label":"Brain","category":1,"version":5,"tags":["intelligent","smart"],"shortcodes":["brain"]},{"emoji":"🫀","label":"Anatomical heart","category":1,"version":13,"tags":["anatomical","beat","cardiology","heart","heartbeat","organ","pulse","real","red"],"shortcodes":["anatomical_heart"]},{"emoji":"🫁","label":"Lungs","category":1,"version":13,"tags":["breath","breathe","exhalation","inhalation","lung","organ","respiration"],"shortcodes":["lungs"]},{"emoji":"🦷","label":"Tooth","category":1,"version":11,"tags":["dentist","pearly","teeth","white"],"shortcodes":["tooth"]},{"emoji":"🦴","label":"Bone","category":1,"version":11,"tags":["bones","dog","skeleton","wishbone"],"shortcodes":["bone"]},{"emoji":"👀","label":"Eyes","category":1,"version":0.6,"tags":["body","eye","face","googly","look","looking","omg","peep","see","seeing"],"shortcodes":["eyes"]},{"emoji":"👁️","label":"Eye","category":1,"version":0.7,"tags":["1","body","one"],"shortcodes":["eye"]},{"emoji":"👅","label":"Tongue","category":1,"version":0.6,"tags":["body","lick","slurp"],"shortcodes":["tongue"]},{"emoji":"👄","label":"Mouth","category":1,"version":0.6,"tags":["beauty","body","kiss","kissing","lipstick"],"shortcodes":["lips"]},{"emoji":"🫦","label":"Biting lip","category":1,"version":14,"tags":["anxious","bite","biting","fear","flirt","flirting","kiss","lip","lipstick","nervous","sexy","uncomfortable","worried","worry"],"shortcodes":["biting_lip"]},{"emoji":"👶","label":"Baby","category":1,"version":0.6,"tags":["babies","children","goo","infant","newborn","pregnant","young"],"shortcodes":["baby"],"skins":{"light":"👶🏻","medium-light":"👶🏼","medium":"👶🏽","medium-dark":"👶🏾","dark":"👶🏿"}},{"emoji":"🧒","label":"Child","category":1,"version":5,"tags":["bright-eyed","grandchild","kid","young","younger"],"shortcodes":["child"],"skins":{"light":"🧒🏻","medium-light":"🧒🏼","medium":"🧒🏽","medium-dark":"🧒🏾","dark":"🧒🏿"}},{"emoji":"👦","label":"Boy","category":1,"version":0.6,"tags":["bright-eyed","child","grandson","kid","son","young","younger"],"shortcodes":["boy"],"skins":{"light":"👦🏻","medium-light":"👦🏼","medium":"👦🏽","medium-dark":"👦🏾","dark":"👦🏿"}},{"emoji":"👧","label":"Girl","category":1,"version":0.6,"tags":["bright-eyed","child","daughter","granddaughter","kid","virgo","young","younger","zodiac"],"shortcodes":["girl"],"skins":{"light":"👧🏻","medium-light":"👧🏼","medium":"👧🏽","medium-dark":"👧🏾","dark":"👧🏿"}},{"emoji":"🧑","label":"Person","category":1,"version":5,"tags":[],"shortcodes":["adult"],"skins":{"light":"🧑🏻","medium-light":"🧑🏼","medium":"🧑🏽","medium-dark":"🧑🏾","dark":"🧑🏿"}},{"emoji":"👱","label":"Person: blond hair","category":1,"version":0.6,"tags":["blond","blond-haired","human","person"],"shortcodes":["blond_haired_person"],"skins":{"light":"👱🏻","medium-light":"👱🏼","medium":"👱🏽","medium-dark":"👱🏾","dark":"👱🏿"}},{"emoji":"👨","label":"Man","category":1,"version":0.6,"tags":["adult","bro"],"shortcodes":["man"],"skins":{"light":"👨🏻","medium-light":"👨🏼","medium":"👨🏽","medium-dark":"👨🏾","dark":"👨🏿"}},{"emoji":"🧔","label":"Person: beard","category":1,"version":5,"tags":["beard","bearded","person","whiskers"],"shortcodes":["bearded_person"],"skins":{"light":"🧔🏻","medium-light":"🧔🏼","medium":"🧔🏽","medium-dark":"🧔🏾","dark":"🧔🏿"}},{"emoji":"🧔‍♂️","label":"Man: beard","category":1,"version":13.1,"tags":["beard","bearded","man","whiskers"],"shortcodes":["man_beard"],"skins":{"light":"🧔🏻‍♂️","medium-light":"🧔🏼‍♂️","medium":"🧔🏽‍♂️","medium-dark":"🧔🏾‍♂️","dark":"🧔🏿‍♂️"}},{"emoji":"🧔‍♀️","label":"Woman: beard","category":1,"version":13.1,"tags":["beard","bearded","whiskers","woman"],"shortcodes":["woman_beard"],"skins":{"light":"🧔🏻‍♀️","medium-light":"🧔🏼‍♀️","medium":"🧔🏽‍♀️","medium-dark":"🧔🏾‍♀️","dark":"🧔🏿‍♀️"}},{"emoji":"👨‍🦰","label":"Man: red hair","category":1,"version":11,"tags":["adult","bro","man","red hair"],"shortcodes":["red_haired_man"],"skins":{"light":"👨🏻‍🦰","medium-light":"👨🏼‍🦰","medium":"👨🏽‍🦰","medium-dark":"👨🏾‍🦰","dark":"👨🏿‍🦰"}},{"emoji":"👨‍🦱","label":"Man: curly hair","category":1,"version":11,"tags":["adult","bro","curly hair","man"],"shortcodes":["curly_haired_man"],"skins":{"light":"👨🏻‍🦱","medium-light":"👨🏼‍🦱","medium":"👨🏽‍🦱","medium-dark":"👨🏾‍🦱","dark":"👨🏿‍🦱"}},{"emoji":"👨‍🦳","label":"Man: white hair","category":1,"version":11,"tags":["adult","bro","man","white hair"],"shortcodes":["white_haired_man"],"skins":{"light":"👨🏻‍🦳","medium-light":"👨🏼‍🦳","medium":"👨🏽‍🦳","medium-dark":"👨🏾‍🦳","dark":"👨🏿‍🦳"}},{"emoji":"👨‍🦲","label":"Man: bald","category":1,"version":11,"tags":["adult","bald","bro","man"],"shortcodes":["bald_man"],"skins":{"light":"👨🏻‍🦲","medium-light":"👨🏼‍🦲","medium":"👨🏽‍🦲","medium-dark":"👨🏾‍🦲","dark":"👨🏿‍🦲"}},{"emoji":"👩","label":"Woman","category":1,"version":0.6,"tags":["adult","lady"],"shortcodes":["woman"],"skins":{"light":"👩🏻","medium-light":"👩🏼","medium":"👩🏽","medium-dark":"👩🏾","dark":"👩🏿"}},{"emoji":"👩‍🦰","label":"Woman: red hair","category":1,"version":11,"tags":["adult","lady","red hair","woman"],"shortcodes":["red_haired_woman"],"skins":{"light":"👩🏻‍🦰","medium-light":"👩🏼‍🦰","medium":"👩🏽‍🦰","medium-dark":"👩🏾‍🦰","dark":"👩🏿‍🦰"}},{"emoji":"🧑‍🦰","label":"Person: red hair","category":1,"version":12.1,"tags":["adult","person","red hair"],"shortcodes":["person_red_hair"],"skins":{"light":"🧑🏻‍🦰","medium-light":"🧑🏼‍🦰","medium":"🧑🏽‍🦰","medium-dark":"🧑🏾‍🦰","dark":"🧑🏿‍🦰"}},{"emoji":"👩‍🦱","label":"Woman: curly hair","category":1,"version":11,"tags":["adult","curly hair","lady","woman"],"shortcodes":["curly_haired_woman"],"skins":{"light":"👩🏻‍🦱","medium-light":"👩🏼‍🦱","medium":"👩🏽‍🦱","medium-dark":"👩🏾‍🦱","dark":"👩🏿‍🦱"}},{"emoji":"🧑‍🦱","label":"Person: curly hair","category":1,"version":12.1,"tags":["adult","curly hair","person"],"shortcodes":["person_curly_hair"],"skins":{"light":"🧑🏻‍🦱","medium-light":"🧑🏼‍🦱","medium":"🧑🏽‍🦱","medium-dark":"🧑🏾‍🦱","dark":"🧑🏿‍🦱"}},{"emoji":"👩‍🦳","label":"Woman: white hair","category":1,"version":11,"tags":["adult","lady","white hair","woman"],"shortcodes":["white_haired_woman"],"skins":{"light":"👩🏻‍🦳","medium-light":"👩🏼‍🦳","medium":"👩🏽‍🦳","medium-dark":"👩🏾‍🦳","dark":"👩🏿‍🦳"}},{"emoji":"🧑‍🦳","label":"Person: white hair","category":1,"version":12.1,"tags":["adult","person","white hair"],"shortcodes":["person_white_hair"],"skins":{"light":"🧑🏻‍🦳","medium-light":"🧑🏼‍🦳","medium":"🧑🏽‍🦳","medium-dark":"🧑🏾‍🦳","dark":"🧑🏿‍🦳"}},{"emoji":"👩‍🦲","label":"Woman: bald","category":1,"version":11,"tags":["adult","bald","lady","woman"],"shortcodes":["bald_woman"],"skins":{"light":"👩🏻‍🦲","medium-light":"👩🏼‍🦲","medium":"👩🏽‍🦲","medium-dark":"👩🏾‍🦲","dark":"👩🏿‍🦲"}},{"emoji":"🧑‍🦲","label":"Person: bald","category":1,"version":12.1,"tags":["adult","bald","person"],"shortcodes":["person_bald"],"skins":{"light":"🧑🏻‍🦲","medium-light":"🧑🏼‍🦲","medium":"🧑🏽‍🦲","medium-dark":"🧑🏾‍🦲","dark":"🧑🏿‍🦲"}},{"emoji":"👱‍♀️","label":"Woman: blond hair","category":1,"version":4,"tags":["blond","blond-haired","blonde","hair","woman"],"shortcodes":["blond_haired_woman","blonde_woman"],"skins":{"light":"👱🏻‍♀️","medium-light":"👱🏼‍♀️","medium":"👱🏽‍♀️","medium-dark":"👱🏾‍♀️","dark":"👱🏿‍♀️"}},{"emoji":"👱‍♂️","label":"Man: blond hair","category":1,"version":4,"tags":["blond","blond-haired","hair","man"],"shortcodes":["blond_haired_man"],"skins":{"light":"👱🏻‍♂️","medium-light":"👱🏼‍♂️","medium":"👱🏽‍♂️","medium-dark":"👱🏾‍♂️","dark":"👱🏿‍♂️"}},{"emoji":"🧓","label":"Older person","category":1,"version":5,"tags":["adult","elderly","grandparent","old","person","wise"],"shortcodes":["older_adult"],"skins":{"light":"🧓🏻","medium-light":"🧓🏼","medium":"🧓🏽","medium-dark":"🧓🏾","dark":"🧓🏿"}},{"emoji":"👴","label":"Old man","category":1,"version":0.6,"tags":["adult","bald","elderly","gramps","grandfather","grandpa","man","old","wise"],"shortcodes":["older_man"],"skins":{"light":"👴🏻","medium-light":"👴🏼","medium":"👴🏽","medium-dark":"👴🏾","dark":"👴🏿"}},{"emoji":"👵","label":"Old woman","category":1,"version":0.6,"tags":["adult","elderly","grandma","grandmother","granny","lady","old","wise","woman"],"shortcodes":["older_woman"],"skins":{"light":"👵🏻","medium-light":"👵🏼","medium":"👵🏽","medium-dark":"👵🏾","dark":"👵🏿"}},{"emoji":"🙍","label":"Person frowning","category":1,"version":0.6,"tags":["annoyed","disappointed","disgruntled","disturbed","frown","frowning","frustrated","gesture","irritated","person","upset"],"shortcodes":["frowning_person"],"skins":{"light":"🙍🏻","medium-light":"🙍🏼","medium":"🙍🏽","medium-dark":"🙍🏾","dark":"🙍🏿"}},{"emoji":"🙍‍♂️","label":"Man frowning","category":1,"version":4,"tags":["annoyed","disappointed","disgruntled","disturbed","frown","frowning","frustrated","gesture","irritated","man","upset"],"shortcodes":["frowning_man"],"skins":{"light":"🙍🏻‍♂️","medium-light":"🙍🏼‍♂️","medium":"🙍🏽‍♂️","medium-dark":"🙍🏾‍♂️","dark":"🙍🏿‍♂️"}},{"emoji":"🙍‍♀️","label":"Woman frowning","category":1,"version":4,"tags":["annoyed","disappointed","disgruntled","disturbed","frown","frowning","frustrated","gesture","irritated","upset","woman"],"shortcodes":["frowning_woman"],"skins":{"light":"🙍🏻‍♀️","medium-light":"🙍🏼‍♀️","medium":"🙍🏽‍♀️","medium-dark":"🙍🏾‍♀️","dark":"🙍🏿‍♀️"}},{"emoji":"🙎","label":"Person pouting","category":1,"version":0.6,"tags":["disappointed","downtrodden","frown","grimace","person","pouting","scowl","sulk","upset","whine"],"shortcodes":["pouting_face"],"skins":{"light":"🙎🏻","medium-light":"🙎🏼","medium":"🙎🏽","medium-dark":"🙎🏾","dark":"🙎🏿"}},{"emoji":"🙎‍♂️","label":"Man pouting","category":1,"version":4,"tags":["disappointed","downtrodden","frown","grimace","man","pouting","scowl","sulk","upset","whine"],"shortcodes":["pouting_man"],"skins":{"light":"🙎🏻‍♂️","medium-light":"🙎🏼‍♂️","medium":"🙎🏽‍♂️","medium-dark":"🙎🏾‍♂️","dark":"🙎🏿‍♂️"}},{"emoji":"🙎‍♀️","label":"Woman pouting","category":1,"version":4,"tags":["disappointed","downtrodden","frown","grimace","pouting","scowl","sulk","upset","whine","woman"],"shortcodes":["pouting_woman"],"skins":{"light":"🙎🏻‍♀️","medium-light":"🙎🏼‍♀️","medium":"🙎🏽‍♀️","medium-dark":"🙎🏾‍♀️","dark":"🙎🏿‍♀️"}},{"emoji":"🙅","label":"Person gesturing NO","category":1,"version":0.6,"tags":["forbidden","gesture","hand","no","not","person","prohibit"],"shortcodes":["no_good"],"skins":{"light":"🙅🏻","medium-light":"🙅🏼","medium":"🙅🏽","medium-dark":"🙅🏾","dark":"🙅🏿"}},{"emoji":"🙅‍♂️","label":"Man gesturing NO","category":1,"version":4,"tags":["forbidden","gesture","hand","man","no","not","prohibit"],"shortcodes":["ng_man","no_good_man"],"skins":{"light":"🙅🏻‍♂️","medium-light":"🙅🏼‍♂️","medium":"🙅🏽‍♂️","medium-dark":"🙅🏾‍♂️","dark":"🙅🏿‍♂️"}},{"emoji":"🙅‍♀️","label":"Woman gesturing NO","category":1,"version":4,"tags":["forbidden","gesture","hand","no","not","prohibit","woman"],"shortcodes":["ng_woman","no_good_woman"],"skins":{"light":"🙅🏻‍♀️","medium-light":"🙅🏼‍♀️","medium":"🙅🏽‍♀️","medium-dark":"🙅🏾‍♀️","dark":"🙅🏿‍♀️"}},{"emoji":"🙆","label":"Person gesturing OK","category":1,"version":0.6,"tags":["exercise","gesture","gesturing","hand","ok","omg","person"],"shortcodes":["ok_person"],"skins":{"light":"🙆🏻","medium-light":"🙆🏼","medium":"🙆🏽","medium-dark":"🙆🏾","dark":"🙆🏿"}},{"emoji":"🙆‍♂️","label":"Man gesturing OK","category":1,"version":4,"tags":["exercise","gesture","gesturing","hand","man","ok","omg"],"shortcodes":["ok_man"],"skins":{"light":"🙆🏻‍♂️","medium-light":"🙆🏼‍♂️","medium":"🙆🏽‍♂️","medium-dark":"🙆🏾‍♂️","dark":"🙆🏿‍♂️"}},{"emoji":"🙆‍♀️","label":"Woman gesturing OK","category":1,"version":4,"tags":["exercise","gesture","gesturing","hand","ok","omg","woman"],"shortcodes":["ok_woman"],"skins":{"light":"🙆🏻‍♀️","medium-light":"🙆🏼‍♀️","medium":"🙆🏽‍♀️","medium-dark":"🙆🏾‍♀️","dark":"🙆🏿‍♀️"}},{"emoji":"💁","label":"Person tipping hand","category":1,"version":0.6,"tags":["fetch","flick","flip","gossip","hand","person","sarcasm","sarcastic","sassy","seriously","tipping","whatever"],"shortcodes":["information_desk_person","tipping_hand_person"],"skins":{"light":"💁🏻","medium-light":"💁🏼","medium":"💁🏽","medium-dark":"💁🏾","dark":"💁🏿"}},{"emoji":"💁‍♂️","label":"Man tipping hand","category":1,"version":4,"tags":["fetch","flick","flip","gossip","hand","man","sarcasm","sarcastic","sassy","seriously","tipping","whatever"],"shortcodes":["sassy_man","tipping_hand_man"],"skins":{"light":"💁🏻‍♂️","medium-light":"💁🏼‍♂️","medium":"💁🏽‍♂️","medium-dark":"💁🏾‍♂️","dark":"💁🏿‍♂️"}},{"emoji":"💁‍♀️","label":"Woman tipping hand","category":1,"version":4,"tags":["fetch","flick","flip","gossip","hand","sarcasm","sarcastic","sassy","seriously","tipping","whatever","woman"],"shortcodes":["sassy_woman","tipping_hand_woman"],"skins":{"light":"💁🏻‍♀️","medium-light":"💁🏼‍♀️","medium":"💁🏽‍♀️","medium-dark":"💁🏾‍♀️","dark":"💁🏿‍♀️"}},{"emoji":"🙋","label":"Person raising hand","category":1,"version":0.6,"tags":["gesture","hand","here","know","me","person","pick","question","raise","raising"],"shortcodes":["raising_hand"],"skins":{"light":"🙋🏻","medium-light":"🙋🏼","medium":"🙋🏽","medium-dark":"🙋🏾","dark":"🙋🏿"}},{"emoji":"🙋‍♂️","label":"Man raising hand","category":1,"version":4,"tags":["gesture","hand","here","know","man","me","pick","question","raise","raising"],"shortcodes":["raising_hand_man"],"skins":{"light":"🙋🏻‍♂️","medium-light":"🙋🏼‍♂️","medium":"🙋🏽‍♂️","medium-dark":"🙋🏾‍♂️","dark":"🙋🏿‍♂️"}},{"emoji":"🙋‍♀️","label":"Woman raising hand","category":1,"version":4,"tags":["gesture","hand","here","know","me","pick","question","raise","raising","woman"],"shortcodes":["raising_hand_woman"],"skins":{"light":"🙋🏻‍♀️","medium-light":"🙋🏼‍♀️","medium":"🙋🏽‍♀️","medium-dark":"🙋🏾‍♀️","dark":"🙋🏿‍♀️"}},{"emoji":"🧏","label":"Deaf person","category":1,"version":12,"tags":["accessibility","deaf","ear","gesture","hear","person"],"shortcodes":["deaf_person"],"skins":{"light":"🧏🏻","medium-light":"🧏🏼","medium":"🧏🏽","medium-dark":"🧏🏾","dark":"🧏🏿"}},{"emoji":"🧏‍♂️","label":"Deaf man","category":1,"version":12,"tags":["accessibility","deaf","ear","gesture","hear","man"],"shortcodes":["deaf_man"],"skins":{"light":"🧏🏻‍♂️","medium-light":"🧏🏼‍♂️","medium":"🧏🏽‍♂️","medium-dark":"🧏🏾‍♂️","dark":"🧏🏿‍♂️"}},{"emoji":"🧏‍♀️","label":"Deaf woman","category":1,"version":12,"tags":["accessibility","deaf","ear","gesture","hear","woman"],"shortcodes":["deaf_woman"],"skins":{"light":"🧏🏻‍♀️","medium-light":"🧏🏼‍♀️","medium":"🧏🏽‍♀️","medium-dark":"🧏🏾‍♀️","dark":"🧏🏿‍♀️"}},{"emoji":"🙇","label":"Person bowing","category":1,"version":0.6,"tags":["apology","ask","beg","bowing","favor","forgive","gesture","meditate","meditation","person","pity","regret","sorry"],"shortcodes":["bow"],"skins":{"light":"🙇🏻","medium-light":"🙇🏼","medium":"🙇🏽","medium-dark":"🙇🏾","dark":"🙇🏿"}},{"emoji":"🙇‍♂️","label":"Man bowing","category":1,"version":4,"tags":["apology","ask","beg","bow","bowing","favor","forgive","gesture","man","meditate","meditation","pity","regret","sorry"],"shortcodes":["bowing_man"],"skins":{"light":"🙇🏻‍♂️","medium-light":"🙇🏼‍♂️","medium":"🙇🏽‍♂️","medium-dark":"🙇🏾‍♂️","dark":"🙇🏿‍♂️"}},{"emoji":"🙇‍♀️","label":"Woman bowing","category":1,"version":4,"tags":["apology","ask","beg","bow","bowing","favor","forgive","gesture","meditate","meditation","pity","regret","sorry","woman"],"shortcodes":["bowing_woman"],"skins":{"light":"🙇🏻‍♀️","medium-light":"🙇🏼‍♀️","medium":"🙇🏽‍♀️","medium-dark":"🙇🏾‍♀️","dark":"🙇🏿‍♀️"}},{"emoji":"🤦","label":"Person facepalming","category":1,"version":3,"tags":["again","bewilder","disbelief","exasperation","no","not","oh","omg","person","shock","smh"],"shortcodes":["facepalm"],"skins":{"light":"🤦🏻","medium-light":"🤦🏼","medium":"🤦🏽","medium-dark":"🤦🏾","dark":"🤦🏿"}},{"emoji":"🤦‍♂️","label":"Man facepalming","category":1,"version":4,"tags":["again","bewilder","disbelief","exasperation","facepalm","man","no","not","oh","omg","shock","smh"],"shortcodes":["man_facepalming"],"skins":{"light":"🤦🏻‍♂️","medium-light":"🤦🏼‍♂️","medium":"🤦🏽‍♂️","medium-dark":"🤦🏾‍♂️","dark":"🤦🏿‍♂️"}},{"emoji":"🤦‍♀️","label":"Woman facepalming","category":1,"version":4,"tags":["again","bewilder","disbelief","exasperation","facepalm","no","not","oh","omg","shock","smh","woman"],"shortcodes":["woman_facepalming"],"skins":{"light":"🤦🏻‍♀️","medium-light":"🤦🏼‍♀️","medium":"🤦🏽‍♀️","medium-dark":"🤦🏾‍♀️","dark":"🤦🏿‍♀️"}},{"emoji":"🤷","label":"Person shrugging","category":1,"version":3,"tags":["doubt","dunno","guess","idk","ignorance","indifference","knows","maybe","person","shrugging","whatever","who"],"shortcodes":["shrug"],"skins":{"light":"🤷🏻","medium-light":"🤷🏼","medium":"🤷🏽","medium-dark":"🤷🏾","dark":"🤷🏿"}},{"emoji":"🤷‍♂️","label":"Man shrugging","category":1,"version":4,"tags":["doubt","dunno","guess","idk","ignorance","indifference","knows","man","maybe","shrug","shrugging","whatever","who"],"shortcodes":["man_shrugging"],"skins":{"light":"🤷🏻‍♂️","medium-light":"🤷🏼‍♂️","medium":"🤷🏽‍♂️","medium-dark":"🤷🏾‍♂️","dark":"🤷🏿‍♂️"}},{"emoji":"🤷‍♀️","label":"Woman shrugging","category":1,"version":4,"tags":["doubt","dunno","guess","idk","ignorance","indifference","knows","maybe","shrug","shrugging","whatever","who","woman"],"shortcodes":["woman_shrugging"],"skins":{"light":"🤷🏻‍♀️","medium-light":"🤷🏼‍♀️","medium":"🤷🏽‍♀️","medium-dark":"🤷🏾‍♀️","dark":"🤷🏿‍♀️"}},{"emoji":"🧑‍⚕️","label":"Health worker","category":1,"version":12.1,"tags":["doctor","health","healthcare","nurse","therapist","worker"],"shortcodes":["health_worker"],"skins":{"light":"🧑🏻‍⚕️","medium-light":"🧑🏼‍⚕️","medium":"🧑🏽‍⚕️","medium-dark":"🧑🏾‍⚕️","dark":"🧑🏿‍⚕️"}},{"emoji":"👨‍⚕️","label":"Man health worker","category":1,"version":4,"tags":["doctor","health","healthcare","man","nurse","therapist","worker"],"shortcodes":["man_health_worker"],"skins":{"light":"👨🏻‍⚕️","medium-light":"👨🏼‍⚕️","medium":"👨🏽‍⚕️","medium-dark":"👨🏾‍⚕️","dark":"👨🏿‍⚕️"}},{"emoji":"👩‍⚕️","label":"Woman health worker","category":1,"version":4,"tags":["doctor","health","healthcare","nurse","therapist","woman","worker"],"shortcodes":["woman_health_worker"],"skins":{"light":"👩🏻‍⚕️","medium-light":"👩🏼‍⚕️","medium":"👩🏽‍⚕️","medium-dark":"👩🏾‍⚕️","dark":"👩🏿‍⚕️"}},{"emoji":"🧑‍🎓","label":"Student","category":1,"version":12.1,"tags":["graduate"],"shortcodes":["student"],"skins":{"light":"🧑🏻‍🎓","medium-light":"🧑🏼‍🎓","medium":"🧑🏽‍🎓","medium-dark":"🧑🏾‍🎓","dark":"🧑🏿‍🎓"}},{"emoji":"👨‍🎓","label":"Man student","category":1,"version":4,"tags":["graduate","man","student"],"shortcodes":["man_student"],"skins":{"light":"👨🏻‍🎓","medium-light":"👨🏼‍🎓","medium":"👨🏽‍🎓","medium-dark":"👨🏾‍🎓","dark":"👨🏿‍🎓"}},{"emoji":"👩‍🎓","label":"Woman student","category":1,"version":4,"tags":["graduate","student","woman"],"shortcodes":["woman_student"],"skins":{"light":"👩🏻‍🎓","medium-light":"👩🏼‍🎓","medium":"👩🏽‍🎓","medium-dark":"👩🏾‍🎓","dark":"👩🏿‍🎓"}},{"emoji":"🧑‍🏫","label":"Teacher","category":1,"version":12.1,"tags":["instructor","lecturer","professor"],"shortcodes":["teacher"],"skins":{"light":"🧑🏻‍🏫","medium-light":"🧑🏼‍🏫","medium":"🧑🏽‍🏫","medium-dark":"🧑🏾‍🏫","dark":"🧑🏿‍🏫"}},{"emoji":"👨‍🏫","label":"Man teacher","category":1,"version":4,"tags":["instructor","lecturer","man","professor","teacher"],"shortcodes":["man_teacher"],"skins":{"light":"👨🏻‍🏫","medium-light":"👨🏼‍🏫","medium":"👨🏽‍🏫","medium-dark":"👨🏾‍🏫","dark":"👨🏿‍🏫"}},{"emoji":"👩‍🏫","label":"Woman teacher","category":1,"version":4,"tags":["instructor","lecturer","professor","teacher","woman"],"shortcodes":["woman_teacher"],"skins":{"light":"👩🏻‍🏫","medium-light":"👩🏼‍🏫","medium":"👩🏽‍🏫","medium-dark":"👩🏾‍🏫","dark":"👩🏿‍🏫"}},{"emoji":"🧑‍⚖️","label":"Judge","category":1,"version":12.1,"tags":["justice","law","scales"],"shortcodes":["judge"],"skins":{"light":"🧑🏻‍⚖️","medium-light":"🧑🏼‍⚖️","medium":"🧑🏽‍⚖️","medium-dark":"🧑🏾‍⚖️","dark":"🧑🏿‍⚖️"}},{"emoji":"👨‍⚖️","label":"Man judge","category":1,"version":4,"tags":["judge","justice","law","man","scales"],"shortcodes":["man_judge"],"skins":{"light":"👨🏻‍⚖️","medium-light":"👨🏼‍⚖️","medium":"👨🏽‍⚖️","medium-dark":"👨🏾‍⚖️","dark":"👨🏿‍⚖️"}},{"emoji":"👩‍⚖️","label":"Woman judge","category":1,"version":4,"tags":["judge","justice","law","scales","woman"],"shortcodes":["woman_judge"],"skins":{"light":"👩🏻‍⚖️","medium-light":"👩🏼‍⚖️","medium":"👩🏽‍⚖️","medium-dark":"👩🏾‍⚖️","dark":"👩🏿‍⚖️"}},{"emoji":"🧑‍🌾","label":"Farmer","category":1,"version":12.1,"tags":["gardener","rancher"],"shortcodes":["farmer"],"skins":{"light":"🧑🏻‍🌾","medium-light":"🧑🏼‍🌾","medium":"🧑🏽‍🌾","medium-dark":"🧑🏾‍🌾","dark":"🧑🏿‍🌾"}},{"emoji":"👨‍🌾","label":"Man farmer","category":1,"version":4,"tags":["farmer","gardener","man","rancher"],"shortcodes":["man_farmer"],"skins":{"light":"👨🏻‍🌾","medium-light":"👨🏼‍🌾","medium":"👨🏽‍🌾","medium-dark":"👨🏾‍🌾","dark":"👨🏿‍🌾"}},{"emoji":"👩‍🌾","label":"Woman farmer","category":1,"version":4,"tags":["farmer","gardener","rancher","woman"],"shortcodes":["woman_farmer"],"skins":{"light":"👩🏻‍🌾","medium-light":"👩🏼‍🌾","medium":"👩🏽‍🌾","medium-dark":"👩🏾‍🌾","dark":"👩🏿‍🌾"}},{"emoji":"🧑‍🍳","label":"Cook","category":1,"version":12.1,"tags":["chef"],"shortcodes":["cook"],"skins":{"light":"🧑🏻‍🍳","medium-light":"🧑🏼‍🍳","medium":"🧑🏽‍🍳","medium-dark":"🧑🏾‍🍳","dark":"🧑🏿‍🍳"}},{"emoji":"👨‍🍳","label":"Man cook","category":1,"version":4,"tags":["chef","cook","man"],"shortcodes":["man_cook"],"skins":{"light":"👨🏻‍🍳","medium-light":"👨🏼‍🍳","medium":"👨🏽‍🍳","medium-dark":"👨🏾‍🍳","dark":"👨🏿‍🍳"}},{"emoji":"👩‍🍳","label":"Woman cook","category":1,"version":4,"tags":["chef","cook","woman"],"shortcodes":["woman_cook"],"skins":{"light":"👩🏻‍🍳","medium-light":"👩🏼‍🍳","medium":"👩🏽‍🍳","medium-dark":"👩🏾‍🍳","dark":"👩🏿‍🍳"}},{"emoji":"🧑‍🔧","label":"Mechanic","category":1,"version":12.1,"tags":["electrician","plumber","tradesperson"],"shortcodes":["mechanic"],"skins":{"light":"🧑🏻‍🔧","medium-light":"🧑🏼‍🔧","medium":"🧑🏽‍🔧","medium-dark":"🧑🏾‍🔧","dark":"🧑🏿‍🔧"}},{"emoji":"👨‍🔧","label":"Man mechanic","category":1,"version":4,"tags":["electrician","man","mechanic","plumber","tradesperson"],"shortcodes":["man_mechanic"],"skins":{"light":"👨🏻‍🔧","medium-light":"👨🏼‍🔧","medium":"👨🏽‍🔧","medium-dark":"👨🏾‍🔧","dark":"👨🏿‍🔧"}},{"emoji":"👩‍🔧","label":"Woman mechanic","category":1,"version":4,"tags":["electrician","mechanic","plumber","tradesperson","woman"],"shortcodes":["woman_mechanic"],"skins":{"light":"👩🏻‍🔧","medium-light":"👩🏼‍🔧","medium":"👩🏽‍🔧","medium-dark":"👩🏾‍🔧","dark":"👩🏿‍🔧"}},{"emoji":"🧑‍🏭","label":"Factory worker","category":1,"version":12.1,"tags":["assembly","factory","industrial","worker"],"shortcodes":["factory_worker"],"skins":{"light":"🧑🏻‍🏭","medium-light":"🧑🏼‍🏭","medium":"🧑🏽‍🏭","medium-dark":"🧑🏾‍🏭","dark":"🧑🏿‍🏭"}},{"emoji":"👨‍🏭","label":"Man factory worker","category":1,"version":4,"tags":["assembly","factory","industrial","man","worker"],"shortcodes":["man_factory_worker"],"skins":{"light":"👨🏻‍🏭","medium-light":"👨🏼‍🏭","medium":"👨🏽‍🏭","medium-dark":"👨🏾‍🏭","dark":"👨🏿‍🏭"}},{"emoji":"👩‍🏭","label":"Woman factory worker","category":1,"version":4,"tags":["assembly","factory","industrial","woman","worker"],"shortcodes":["woman_factory_worker"],"skins":{"light":"👩🏻‍🏭","medium-light":"👩🏼‍🏭","medium":"👩🏽‍🏭","medium-dark":"👩🏾‍🏭","dark":"👩🏿‍🏭"}},{"emoji":"🧑‍💼","label":"Office worker","category":1,"version":12.1,"tags":["architect","business","manager","office","white-collar","worker"],"shortcodes":["office_worker"],"skins":{"light":"🧑🏻‍💼","medium-light":"🧑🏼‍💼","medium":"🧑🏽‍💼","medium-dark":"🧑🏾‍💼","dark":"🧑🏿‍💼"}},{"emoji":"👨‍💼","label":"Man office worker","category":1,"version":4,"tags":["architect","business","man","manager","office","white-collar","worker"],"shortcodes":["man_office_worker"],"skins":{"light":"👨🏻‍💼","medium-light":"👨🏼‍💼","medium":"👨🏽‍💼","medium-dark":"👨🏾‍💼","dark":"👨🏿‍💼"}},{"emoji":"👩‍💼","label":"Woman office worker","category":1,"version":4,"tags":["architect","business","manager","office","white-collar","woman","worker"],"shortcodes":["woman_office_worker"],"skins":{"light":"👩🏻‍💼","medium-light":"👩🏼‍💼","medium":"👩🏽‍💼","medium-dark":"👩🏾‍💼","dark":"👩🏿‍💼"}},{"emoji":"🧑‍🔬","label":"Scientist","category":1,"version":12.1,"tags":["biologist","chemist","engineer","mathematician","physicist"],"shortcodes":["scientist"],"skins":{"light":"🧑🏻‍🔬","medium-light":"🧑🏼‍🔬","medium":"🧑🏽‍🔬","medium-dark":"🧑🏾‍🔬","dark":"🧑🏿‍🔬"}},{"emoji":"👨‍🔬","label":"Man scientist","category":1,"version":4,"tags":["biologist","chemist","engineer","man","mathematician","physicist","scientist"],"shortcodes":["man_scientist"],"skins":{"light":"👨🏻‍🔬","medium-light":"👨🏼‍🔬","medium":"👨🏽‍🔬","medium-dark":"👨🏾‍🔬","dark":"👨🏿‍🔬"}},{"emoji":"👩‍🔬","label":"Woman scientist","category":1,"version":4,"tags":["biologist","chemist","engineer","mathematician","physicist","scientist","woman"],"shortcodes":["woman_scientist"],"skins":{"light":"👩🏻‍🔬","medium-light":"👩🏼‍🔬","medium":"👩🏽‍🔬","medium-dark":"👩🏾‍🔬","dark":"👩🏿‍🔬"}},{"emoji":"🧑‍💻","label":"Technologist","category":1,"version":12.1,"tags":["coder","computer","developer","inventor","software"],"shortcodes":["technologist"],"skins":{"light":"🧑🏻‍💻","medium-light":"🧑🏼‍💻","medium":"🧑🏽‍💻","medium-dark":"🧑🏾‍💻","dark":"🧑🏿‍💻"}},{"emoji":"👨‍💻","label":"Man technologist","category":1,"version":4,"tags":["coder","computer","developer","inventor","man","software","technologist"],"shortcodes":["man_technologist"],"skins":{"light":"👨🏻‍💻","medium-light":"👨🏼‍💻","medium":"👨🏽‍💻","medium-dark":"👨🏾‍💻","dark":"👨🏿‍💻"}},{"emoji":"👩‍💻","label":"Woman technologist","category":1,"version":4,"tags":["coder","computer","developer","inventor","software","technologist","woman"],"shortcodes":["woman_technologist"],"skins":{"light":"👩🏻‍💻","medium-light":"👩🏼‍💻","medium":"👩🏽‍💻","medium-dark":"👩🏾‍💻","dark":"👩🏿‍💻"}},{"emoji":"🧑‍🎤","label":"Singer","category":1,"version":12.1,"tags":["actor","entertainer","rock","rockstar","star"],"shortcodes":["singer"],"skins":{"light":"🧑🏻‍🎤","medium-light":"🧑🏼‍🎤","medium":"🧑🏽‍🎤","medium-dark":"🧑🏾‍🎤","dark":"🧑🏿‍🎤"}},{"emoji":"👨‍🎤","label":"Man singer","category":1,"version":4,"tags":["actor","entertainer","man","rock","rockstar","singer","star"],"shortcodes":["man_singer"],"skins":{"light":"👨🏻‍🎤","medium-light":"👨🏼‍🎤","medium":"👨🏽‍🎤","medium-dark":"👨🏾‍🎤","dark":"👨🏿‍🎤"}},{"emoji":"👩‍🎤","label":"Woman singer","category":1,"version":4,"tags":["actor","entertainer","rock","rockstar","singer","star","woman"],"shortcodes":["woman_singer"],"skins":{"light":"👩🏻‍🎤","medium-light":"👩🏼‍🎤","medium":"👩🏽‍🎤","medium-dark":"👩🏾‍🎤","dark":"👩🏿‍🎤"}},{"emoji":"🧑‍🎨","label":"Artist","category":1,"version":12.1,"tags":["palette"],"shortcodes":["artist"],"skins":{"light":"🧑🏻‍🎨","medium-light":"🧑🏼‍🎨","medium":"🧑🏽‍🎨","medium-dark":"🧑🏾‍🎨","dark":"🧑🏿‍🎨"}},{"emoji":"👨‍🎨","label":"Man artist","category":1,"version":4,"tags":["artist","man","palette"],"shortcodes":["man_artist"],"skins":{"light":"👨🏻‍🎨","medium-light":"👨🏼‍🎨","medium":"👨🏽‍🎨","medium-dark":"👨🏾‍🎨","dark":"👨🏿‍🎨"}},{"emoji":"👩‍🎨","label":"Woman artist","category":1,"version":4,"tags":["artist","palette","woman"],"shortcodes":["woman_artist"],"skins":{"light":"👩🏻‍🎨","medium-light":"👩🏼‍🎨","medium":"👩🏽‍🎨","medium-dark":"👩🏾‍🎨","dark":"👩🏿‍🎨"}},{"emoji":"🧑‍✈️","label":"Pilot","category":1,"version":12.1,"tags":["plane"],"shortcodes":["pilot"],"skins":{"light":"🧑🏻‍✈️","medium-light":"🧑🏼‍✈️","medium":"🧑🏽‍✈️","medium-dark":"🧑🏾‍✈️","dark":"🧑🏿‍✈️"}},{"emoji":"👨‍✈️","label":"Man pilot","category":1,"version":4,"tags":["man","pilot","plane"],"shortcodes":["man_pilot"],"skins":{"light":"👨🏻‍✈️","medium-light":"👨🏼‍✈️","medium":"👨🏽‍✈️","medium-dark":"👨🏾‍✈️","dark":"👨🏿‍✈️"}},{"emoji":"👩‍✈️","label":"Woman pilot","category":1,"version":4,"tags":["pilot","plane","woman"],"shortcodes":["woman_pilot"],"skins":{"light":"👩🏻‍✈️","medium-light":"👩🏼‍✈️","medium":"👩🏽‍✈️","medium-dark":"👩🏾‍✈️","dark":"👩🏿‍✈️"}},{"emoji":"🧑‍🚀","label":"Astronaut","category":1,"version":12.1,"tags":["rocket","space"],"shortcodes":["astronaut"],"skins":{"light":"🧑🏻‍🚀","medium-light":"🧑🏼‍🚀","medium":"🧑🏽‍🚀","medium-dark":"🧑🏾‍🚀","dark":"🧑🏿‍🚀"}},{"emoji":"👨‍🚀","label":"Man astronaut","category":1,"version":4,"tags":["astronaut","man","rocket","space"],"shortcodes":["man_astronaut"],"skins":{"light":"👨🏻‍🚀","medium-light":"👨🏼‍🚀","medium":"👨🏽‍🚀","medium-dark":"👨🏾‍🚀","dark":"👨🏿‍🚀"}},{"emoji":"👩‍🚀","label":"Woman astronaut","category":1,"version":4,"tags":["astronaut","rocket","space","woman"],"shortcodes":["woman_astronaut"],"skins":{"light":"👩🏻‍🚀","medium-light":"👩🏼‍🚀","medium":"👩🏽‍🚀","medium-dark":"👩🏾‍🚀","dark":"👩🏿‍🚀"}},{"emoji":"🧑‍🚒","label":"Firefighter","category":1,"version":12.1,"tags":["fire","firetruck"],"shortcodes":["firefighter"],"skins":{"light":"🧑🏻‍🚒","medium-light":"🧑🏼‍🚒","medium":"🧑🏽‍🚒","medium-dark":"🧑🏾‍🚒","dark":"🧑🏿‍🚒"}},{"emoji":"👨‍🚒","label":"Man firefighter","category":1,"version":4,"tags":["fire","firefighter","firetruck","man"],"shortcodes":["man_firefighter"],"skins":{"light":"👨🏻‍🚒","medium-light":"👨🏼‍🚒","medium":"👨🏽‍🚒","medium-dark":"👨🏾‍🚒","dark":"👨🏿‍🚒"}},{"emoji":"👩‍🚒","label":"Woman firefighter","category":1,"version":4,"tags":["fire","firefighter","firetruck","woman"],"shortcodes":["woman_firefighter"],"skins":{"light":"👩🏻‍🚒","medium-light":"👩🏼‍🚒","medium":"👩🏽‍🚒","medium-dark":"👩🏾‍🚒","dark":"👩🏿‍🚒"}},{"emoji":"👮","label":"Police officer","category":1,"version":0.6,"tags":["apprehend","arrest","citation","law","officer","over","police","pulled","undercover"],"shortcodes":["cop","police_officer"],"skins":{"light":"👮🏻","medium-light":"👮🏼","medium":"👮🏽","medium-dark":"👮🏾","dark":"👮🏿"}},{"emoji":"👮‍♂️","label":"Man police officer","category":1,"version":4,"tags":["apprehend","arrest","citation","cop","law","man","officer","over","police","pulled","undercover"],"shortcodes":["policeman"],"skins":{"light":"👮🏻‍♂️","medium-light":"👮🏼‍♂️","medium":"👮🏽‍♂️","medium-dark":"👮🏾‍♂️","dark":"👮🏿‍♂️"}},{"emoji":"👮‍♀️","label":"Woman police officer","category":1,"version":4,"tags":["apprehend","arrest","citation","cop","law","officer","over","police","pulled","undercover","woman"],"shortcodes":["policewoman"],"skins":{"light":"👮🏻‍♀️","medium-light":"👮🏼‍♀️","medium":"👮🏽‍♀️","medium-dark":"👮🏾‍♀️","dark":"👮🏿‍♀️"}},{"emoji":"🕵️","label":"Detective","category":1,"version":0.7,"tags":["sleuth","spy"],"shortcodes":["detective"],"skins":{"light":"🕵🏻","medium-light":"🕵🏼","medium":"🕵🏽","medium-dark":"🕵🏾","dark":"🕵🏿"}},{"emoji":"🕵️‍♂️","label":"Man detective","category":1,"version":4,"tags":["detective","man","sleuth","spy"],"shortcodes":["male_detective"],"skins":{"light":"🕵🏻‍♂️","medium-light":"🕵🏼‍♂️","medium":"🕵🏽‍♂️","medium-dark":"🕵🏾‍♂️","dark":"🕵🏿‍♂️"}},{"emoji":"🕵️‍♀️","label":"Woman detective","category":1,"version":4,"tags":["detective","sleuth","spy","woman"],"shortcodes":["female_detective"],"skins":{"light":"🕵🏻‍♀️","medium-light":"🕵🏼‍♀️","medium":"🕵🏽‍♀️","medium-dark":"🕵🏾‍♀️","dark":"🕵🏿‍♀️"}},{"emoji":"💂","label":"Guard","category":1,"version":0.6,"tags":["buckingham","helmet","london","palace"],"shortcodes":["guard"],"skins":{"light":"💂🏻","medium-light":"💂🏼","medium":"💂🏽","medium-dark":"💂🏾","dark":"💂🏿"}},{"emoji":"💂‍♂️","label":"Man guard","category":1,"version":4,"tags":["buckingham","guard","helmet","london","man","palace"],"shortcodes":["guardsman"],"skins":{"light":"💂🏻‍♂️","medium-light":"💂🏼‍♂️","medium":"💂🏽‍♂️","medium-dark":"💂🏾‍♂️","dark":"💂🏿‍♂️"}},{"emoji":"💂‍♀️","label":"Woman guard","category":1,"version":4,"tags":["buckingham","guard","helmet","london","palace","woman"],"shortcodes":["guardswoman"],"skins":{"light":"💂🏻‍♀️","medium-light":"💂🏼‍♀️","medium":"💂🏽‍♀️","medium-dark":"💂🏾‍♀️","dark":"💂🏿‍♀️"}},{"emoji":"🥷","label":"Ninja","category":1,"version":13,"tags":["assassin","fight","fighter","hidden","person","secret","skills","sly","soldier","stealth","war"],"shortcodes":["ninja"],"skins":{"light":"🥷🏻","medium-light":"🥷🏼","medium":"🥷🏽","medium-dark":"🥷🏾","dark":"🥷🏿"}},{"emoji":"👷","label":"Construction worker","category":1,"version":0.6,"tags":["build","construction","fix","hardhat","hat","man","person","rebuild","remodel","repair","work","worker"],"shortcodes":["construction_worker"],"skins":{"light":"👷🏻","medium-light":"👷🏼","medium":"👷🏽","medium-dark":"👷🏾","dark":"👷🏿"}},{"emoji":"👷‍♂️","label":"Man construction worker","category":1,"version":4,"tags":["build","construction","fix","hardhat","hat","man","rebuild","remodel","repair","work","worker"],"shortcodes":["construction_worker_man"],"skins":{"light":"👷🏻‍♂️","medium-light":"👷🏼‍♂️","medium":"👷🏽‍♂️","medium-dark":"👷🏾‍♂️","dark":"👷🏿‍♂️"}},{"emoji":"👷‍♀️","label":"Woman construction worker","category":1,"version":4,"tags":["build","construction","fix","hardhat","hat","man","rebuild","remodel","repair","woman","work","worker"],"shortcodes":["construction_worker_woman"],"skins":{"light":"👷🏻‍♀️","medium-light":"👷🏼‍♀️","medium":"👷🏽‍♀️","medium-dark":"👷🏾‍♀️","dark":"👷🏿‍♀️"}},{"emoji":"🫅","label":"Person with crown","category":1,"version":14,"tags":["crown","monarch","noble","person","regal","royal","royalty"],"shortcodes":["person_with_crown"],"skins":{"light":"🫅🏻","medium-light":"🫅🏼","medium":"🫅🏽","medium-dark":"🫅🏾","dark":"🫅🏿"}},{"emoji":"🤴","label":"Prince","category":1,"version":3,"tags":["crown","fairy","fairytale","fantasy","king","royal","royalty","tale"],"shortcodes":["prince"],"skins":{"light":"🤴🏻","medium-light":"🤴🏼","medium":"🤴🏽","medium-dark":"🤴🏾","dark":"🤴🏿"}},{"emoji":"👸","label":"Princess","category":1,"version":0.6,"tags":["crown","fairy","fairytale","fantasy","queen","royal","royalty","tale"],"shortcodes":["princess"],"skins":{"light":"👸🏻","medium-light":"👸🏼","medium":"👸🏽","medium-dark":"👸🏾","dark":"👸🏿"}},{"emoji":"👳","label":"Person wearing turban","category":1,"version":0.6,"tags":["person","turban","wearing"],"shortcodes":["person_with_turban"],"skins":{"light":"👳🏻","medium-light":"👳🏼","medium":"👳🏽","medium-dark":"👳🏾","dark":"👳🏿"}},{"emoji":"👳‍♂️","label":"Man wearing turban","category":1,"version":4,"tags":["man","turban","wearing"],"shortcodes":["man_with_turban"],"skins":{"light":"👳🏻‍♂️","medium-light":"👳🏼‍♂️","medium":"👳🏽‍♂️","medium-dark":"👳🏾‍♂️","dark":"👳🏿‍♂️"}},{"emoji":"👳‍♀️","label":"Woman wearing turban","category":1,"version":4,"tags":["turban","wearing","woman"],"shortcodes":["woman_with_turban"],"skins":{"light":"👳🏻‍♀️","medium-light":"👳🏼‍♀️","medium":"👳🏽‍♀️","medium-dark":"👳🏾‍♀️","dark":"👳🏿‍♀️"}},{"emoji":"👲","label":"Person with skullcap","category":1,"version":0.6,"tags":["cap","chinese","gua","guapi","hat","mao","person","pi","skullcap"],"shortcodes":["man_with_gua_pi_mao"],"skins":{"light":"👲🏻","medium-light":"👲🏼","medium":"👲🏽","medium-dark":"👲🏾","dark":"👲🏿"}},{"emoji":"🧕","label":"Woman with headscarf","category":1,"version":5,"tags":["bandana","head","headscarf","hijab","kerchief","mantilla","tichel","woman"],"shortcodes":["woman_with_headscarf"],"skins":{"light":"🧕🏻","medium-light":"🧕🏼","medium":"🧕🏽","medium-dark":"🧕🏾","dark":"🧕🏿"}},{"emoji":"🤵","label":"Person in tuxedo","category":1,"version":3,"tags":["formal","person","tuxedo","wedding"],"shortcodes":["person_in_tuxedo"],"skins":{"light":"🤵🏻","medium-light":"🤵🏼","medium":"🤵🏽","medium-dark":"🤵🏾","dark":"🤵🏿"}},{"emoji":"🤵‍♂️","label":"Man in tuxedo","category":1,"version":13,"tags":["formal","groom","man","tuxedo","wedding"],"shortcodes":["man_in_tuxedo"],"skins":{"light":"🤵🏻‍♂️","medium-light":"🤵🏼‍♂️","medium":"🤵🏽‍♂️","medium-dark":"🤵🏾‍♂️","dark":"🤵🏿‍♂️"}},{"emoji":"🤵‍♀️","label":"Woman in tuxedo","category":1,"version":13,"tags":["formal","tuxedo","wedding","woman"],"shortcodes":["woman_in_tuxedo"],"skins":{"light":"🤵🏻‍♀️","medium-light":"🤵🏼‍♀️","medium":"🤵🏽‍♀️","medium-dark":"🤵🏾‍♀️","dark":"🤵🏿‍♀️"}},{"emoji":"👰","label":"Person with veil","category":1,"version":0.6,"tags":["person","veil","wedding"],"shortcodes":["person_with_veil"],"skins":{"light":"👰🏻","medium-light":"👰🏼","medium":"👰🏽","medium-dark":"👰🏾","dark":"👰🏿"}},{"emoji":"👰‍♂️","label":"Man with veil","category":1,"version":13,"tags":["man","veil","wedding"],"shortcodes":["man_with_veil"],"skins":{"light":"👰🏻‍♂️","medium-light":"👰🏼‍♂️","medium":"👰🏽‍♂️","medium-dark":"👰🏾‍♂️","dark":"👰🏿‍♂️"}},{"emoji":"👰‍♀️","label":"Woman with veil","category":1,"version":13,"tags":["bride","veil","wedding","woman"],"shortcodes":["bride_with_veil","woman_with_veil"],"skins":{"light":"👰🏻‍♀️","medium-light":"👰🏼‍♀️","medium":"👰🏽‍♀️","medium-dark":"👰🏾‍♀️","dark":"👰🏿‍♀️"}},{"emoji":"🤰","label":"Pregnant woman","category":1,"version":3,"tags":["pregnant","woman"],"shortcodes":["pregnant_woman"],"skins":{"light":"🤰🏻","medium-light":"🤰🏼","medium":"🤰🏽","medium-dark":"🤰🏾","dark":"🤰🏿"}},{"emoji":"🫃","label":"Pregnant man","category":1,"version":14,"tags":["belly","bloated","full","man","overeat","pregnant"],"shortcodes":["pregnant_man"],"skins":{"light":"🫃🏻","medium-light":"🫃🏼","medium":"🫃🏽","medium-dark":"🫃🏾","dark":"🫃🏿"}},{"emoji":"🫄","label":"Pregnant person","category":1,"version":14,"tags":["belly","bloated","full","overeat","person","pregnant","stuffed"],"shortcodes":["pregnant_person"],"skins":{"light":"🫄🏻","medium-light":"🫄🏼","medium":"🫄🏽","medium-dark":"🫄🏾","dark":"🫄🏿"}},{"emoji":"🤱","label":"Breast-feeding","category":1,"version":5,"tags":["baby","breast","feeding","mom","mother","nursing","woman"],"shortcodes":["breast_feeding"],"skins":{"light":"🤱🏻","medium-light":"🤱🏼","medium":"🤱🏽","medium-dark":"🤱🏾","dark":"🤱🏿"}},{"emoji":"👩‍🍼","label":"Woman feeding baby","category":1,"version":13,"tags":["baby","feed","feeding","mom","mother","nanny","newborn","nursing","woman"],"shortcodes":["woman_feeding_baby"],"skins":{"light":"👩🏻‍🍼","medium-light":"👩🏼‍🍼","medium":"👩🏽‍🍼","medium-dark":"👩🏾‍🍼","dark":"👩🏿‍🍼"}},{"emoji":"👨‍🍼","label":"Man feeding baby","category":1,"version":13,"tags":["baby","dad","father","feed","feeding","man","nanny","newborn","nursing"],"shortcodes":["man_feeding_baby"],"skins":{"light":"👨🏻‍🍼","medium-light":"👨🏼‍🍼","medium":"👨🏽‍🍼","medium-dark":"👨🏾‍🍼","dark":"👨🏿‍🍼"}},{"emoji":"🧑‍🍼","label":"Person feeding baby","category":1,"version":13,"tags":["baby","feed","feeding","nanny","newborn","nursing","parent"],"shortcodes":["person_feeding_baby"],"skins":{"light":"🧑🏻‍🍼","medium-light":"🧑🏼‍🍼","medium":"🧑🏽‍🍼","medium-dark":"🧑🏾‍🍼","dark":"🧑🏿‍🍼"}},{"emoji":"👼","label":"Baby angel","category":1,"version":0.6,"tags":["baby","church","face","fairy","fairytale","fantasy","tale"],"shortcodes":["angel"],"skins":{"light":"👼🏻","medium-light":"👼🏼","medium":"👼🏽","medium-dark":"👼🏾","dark":"👼🏿"}},{"emoji":"🎅","label":"Santa Claus","category":1,"version":0.6,"tags":["celebration","christmas","claus","fairy","fantasy","father","holiday","merry","tale","xmas"],"shortcodes":["santa"],"skins":{"light":"🎅🏻","medium-light":"🎅🏼","medium":"🎅🏽","medium-dark":"🎅🏾","dark":"🎅🏿"}},{"emoji":"🤶","label":"Mrs. Claus","category":1,"version":3,"tags":["celebration","christmas","claus","fairy","fantasy","holiday","merry","mother","mrs","santa","tale","xmas"],"shortcodes":["mrs_claus"],"skins":{"light":"🤶🏻","medium-light":"🤶🏼","medium":"🤶🏽","medium-dark":"🤶🏾","dark":"🤶🏿"}},{"emoji":"🧑‍🎄","label":"Mx Claus","category":1,"version":13,"tags":["celebration","christmas","claus","fairy","fantasy","holiday","merry","mx","santa","tale","xmas"],"shortcodes":["mx_claus"],"skins":{"light":"🧑🏻‍🎄","medium-light":"🧑🏼‍🎄","medium":"🧑🏽‍🎄","medium-dark":"🧑🏾‍🎄","dark":"🧑🏿‍🎄"}},{"emoji":"🦸","label":"Superhero","category":1,"version":11,"tags":["good","hero","superpower"],"shortcodes":["superhero"],"skins":{"light":"🦸🏻","medium-light":"🦸🏼","medium":"🦸🏽","medium-dark":"🦸🏾","dark":"🦸🏿"}},{"emoji":"🦸‍♂️","label":"Man superhero","category":1,"version":11,"tags":["good","hero","man","superhero","superpower"],"shortcodes":["superhero_man"],"skins":{"light":"🦸🏻‍♂️","medium-light":"🦸🏼‍♂️","medium":"🦸🏽‍♂️","medium-dark":"🦸🏾‍♂️","dark":"🦸🏿‍♂️"}},{"emoji":"🦸‍♀️","label":"Woman superhero","category":1,"version":11,"tags":["good","hero","heroine","superhero","superpower","woman"],"shortcodes":["superhero_woman"],"skins":{"light":"🦸🏻‍♀️","medium-light":"🦸🏼‍♀️","medium":"🦸🏽‍♀️","medium-dark":"🦸🏾‍♀️","dark":"🦸🏿‍♀️"}},{"emoji":"🦹","label":"Supervillain","category":1,"version":11,"tags":["bad","criminal","evil","superpower","villain"],"shortcodes":["supervillain"],"skins":{"light":"🦹🏻","medium-light":"🦹🏼","medium":"🦹🏽","medium-dark":"🦹🏾","dark":"🦹🏿"}},{"emoji":"🦹‍♂️","label":"Man supervillain","category":1,"version":11,"tags":["bad","criminal","evil","man","superpower","supervillain","villain"],"shortcodes":["supervillain_man"],"skins":{"light":"🦹🏻‍♂️","medium-light":"🦹🏼‍♂️","medium":"🦹🏽‍♂️","medium-dark":"🦹🏾‍♂️","dark":"🦹🏿‍♂️"}},{"emoji":"🦹‍♀️","label":"Woman supervillain","category":1,"version":11,"tags":["bad","criminal","evil","superpower","supervillain","villain","woman"],"shortcodes":["supervillain_woman"],"skins":{"light":"🦹🏻‍♀️","medium-light":"🦹🏼‍♀️","medium":"🦹🏽‍♀️","medium-dark":"🦹🏾‍♀️","dark":"🦹🏿‍♀️"}},{"emoji":"🧙","label":"Mage","category":1,"version":5,"tags":["fantasy","magic","play","sorcerer","sorceress","sorcery","spell","summon","witch","wizard"],"shortcodes":["mage"],"skins":{"light":"🧙🏻","medium-light":"🧙🏼","medium":"🧙🏽","medium-dark":"🧙🏾","dark":"🧙🏿"}},{"emoji":"🧙‍♂️","label":"Man mage","category":1,"version":5,"tags":["fantasy","mage","magic","man","play","sorcerer","sorceress","sorcery","spell","summon","witch","wizard"],"shortcodes":["mage_man"],"skins":{"light":"🧙🏻‍♂️","medium-light":"🧙🏼‍♂️","medium":"🧙🏽‍♂️","medium-dark":"🧙🏾‍♂️","dark":"🧙🏿‍♂️"}},{"emoji":"🧙‍♀️","label":"Woman mage","category":1,"version":5,"tags":["fantasy","mage","magic","play","sorcerer","sorceress","sorcery","spell","summon","witch","wizard","woman"],"shortcodes":["mage_woman"],"skins":{"light":"🧙🏻‍♀️","medium-light":"🧙🏼‍♀️","medium":"🧙🏽‍♀️","medium-dark":"🧙🏾‍♀️","dark":"🧙🏿‍♀️"}},{"emoji":"🧚","label":"Fairy","category":1,"version":5,"tags":["fairytale","fantasy","myth","person","pixie","tale","wings"],"shortcodes":["fairy"],"skins":{"light":"🧚🏻","medium-light":"🧚🏼","medium":"🧚🏽","medium-dark":"🧚🏾","dark":"🧚🏿"}},{"emoji":"🧚‍♂️","label":"Man fairy","category":1,"version":5,"tags":["fairy","fairytale","fantasy","man","myth","oberon","person","pixie","puck","tale","wings"],"shortcodes":["fairy_man"],"skins":{"light":"🧚🏻‍♂️","medium-light":"🧚🏼‍♂️","medium":"🧚🏽‍♂️","medium-dark":"🧚🏾‍♂️","dark":"🧚🏿‍♂️"}},{"emoji":"🧚‍♀️","label":"Woman fairy","category":1,"version":5,"tags":["fairy","fairytale","fantasy","myth","person","pixie","tale","titania","wings","woman"],"shortcodes":["fairy_woman"],"skins":{"light":"🧚🏻‍♀️","medium-light":"🧚🏼‍♀️","medium":"🧚🏽‍♀️","medium-dark":"🧚🏾‍♀️","dark":"🧚🏿‍♀️"}},{"emoji":"🧛","label":"Vampire","category":1,"version":5,"tags":["blood","dracula","fangs","halloween","scary","supernatural","teeth","undead"],"shortcodes":["vampire"],"skins":{"light":"🧛🏻","medium-light":"🧛🏼","medium":"🧛🏽","medium-dark":"🧛🏾","dark":"🧛🏿"}},{"emoji":"🧛‍♂️","label":"Man vampire","category":1,"version":5,"tags":["blood","fangs","halloween","man","scary","supernatural","teeth","undead","vampire"],"shortcodes":["vampire_man"],"skins":{"light":"🧛🏻‍♂️","medium-light":"🧛🏼‍♂️","medium":"🧛🏽‍♂️","medium-dark":"🧛🏾‍♂️","dark":"🧛🏿‍♂️"}},{"emoji":"🧛‍♀️","label":"Woman vampire","category":1,"version":5,"tags":["blood","fangs","halloween","scary","supernatural","teeth","undead","vampire","woman"],"shortcodes":["vampire_woman"],"skins":{"light":"🧛🏻‍♀️","medium-light":"🧛🏼‍♀️","medium":"🧛🏽‍♀️","medium-dark":"🧛🏾‍♀️","dark":"🧛🏿‍♀️"}},{"emoji":"🧜","label":"Merperson","category":1,"version":5,"tags":["creature","fairytale","folklore","ocean","sea","siren","trident"],"shortcodes":["merperson"],"skins":{"light":"🧜🏻","medium-light":"🧜🏼","medium":"🧜🏽","medium-dark":"🧜🏾","dark":"🧜🏿"}},{"emoji":"🧜‍♂️","label":"Merman","category":1,"version":5,"tags":["creature","fairytale","folklore","neptune","ocean","poseidon","sea","siren","trident","triton"],"shortcodes":["merman"],"skins":{"light":"🧜🏻‍♂️","medium-light":"🧜🏼‍♂️","medium":"🧜🏽‍♂️","medium-dark":"🧜🏾‍♂️","dark":"🧜🏿‍♂️"}},{"emoji":"🧜‍♀️","label":"Mermaid","category":1,"version":5,"tags":["creature","fairytale","folklore","merwoman","ocean","sea","siren","trident"],"shortcodes":["mermaid"],"skins":{"light":"🧜🏻‍♀️","medium-light":"🧜🏼‍♀️","medium":"🧜🏽‍♀️","medium-dark":"🧜🏾‍♀️","dark":"🧜🏿‍♀️"}},{"emoji":"🧝","label":"Elf","category":1,"version":5,"tags":["elves","enchantment","fantasy","folklore","magic","magical","myth"],"shortcodes":["elf"],"skins":{"light":"🧝🏻","medium-light":"🧝🏼","medium":"🧝🏽","medium-dark":"🧝🏾","dark":"🧝🏿"}},{"emoji":"🧝‍♂️","label":"Man elf","category":1,"version":5,"tags":["elf","elves","enchantment","fantasy","folklore","magic","magical","man","myth"],"shortcodes":["elf_man"],"skins":{"light":"🧝🏻‍♂️","medium-light":"🧝🏼‍♂️","medium":"🧝🏽‍♂️","medium-dark":"🧝🏾‍♂️","dark":"🧝🏿‍♂️"}},{"emoji":"🧝‍♀️","label":"Woman elf","category":1,"version":5,"tags":["elf","elves","enchantment","fantasy","folklore","magic","magical","myth","woman"],"shortcodes":["elf_woman"],"skins":{"light":"🧝🏻‍♀️","medium-light":"🧝🏼‍♀️","medium":"🧝🏽‍♀️","medium-dark":"🧝🏾‍♀️","dark":"🧝🏿‍♀️"}},{"emoji":"🧞","label":"Genie","category":1,"version":5,"tags":["djinn","fantasy","jinn","lamp","myth","rub","wishes"],"shortcodes":["genie"]},{"emoji":"🧞‍♂️","label":"Man genie","category":1,"version":5,"tags":["djinn","fantasy","genie","jinn","lamp","man","myth","rub","wishes"],"shortcodes":["genie_man"]},{"emoji":"🧞‍♀️","label":"Woman genie","category":1,"version":5,"tags":["djinn","fantasy","genie","jinn","lamp","myth","rub","wishes","woman"],"shortcodes":["genie_woman"]},{"emoji":"🧟","label":"Zombie","category":1,"version":5,"tags":["apocalypse","dead","halloween","horror","scary","undead","walking"],"shortcodes":["zombie"]},{"emoji":"🧟‍♂️","label":"Man zombie","category":1,"version":5,"tags":["apocalypse","dead","halloween","horror","man","scary","undead","walking","zombie"],"shortcodes":["zombie_man"]},{"emoji":"🧟‍♀️","label":"Woman zombie","category":1,"version":5,"tags":["apocalypse","dead","halloween","horror","scary","undead","walking","woman","zombie"],"shortcodes":["zombie_woman"]},{"emoji":"🧌","label":"Troll","category":1,"version":14,"tags":["fairy","fantasy","monster","tale","trolling"],"shortcodes":["troll"]},{"emoji":"🫈","label":"Hairy creature","category":1,"version":17,"tags":["bigfoot","cryptid","forest","giant","hairy","sasquatch","woodwose","yeti"],"shortcodes":[]},{"emoji":"💆","label":"Person getting massage","category":1,"version":0.6,"tags":["face","getting","headache","person","relax","relaxing","salon","soothe","spa","tension","therapy","treatment"],"shortcodes":["massage"],"skins":{"light":"💆🏻","medium-light":"💆🏼","medium":"💆🏽","medium-dark":"💆🏾","dark":"💆🏿"}},{"emoji":"💆‍♂️","label":"Man getting massage","category":1,"version":4,"tags":["face","getting","headache","man","massage","relax","relaxing","salon","soothe","spa","tension","therapy","treatment"],"shortcodes":["massage_man"],"skins":{"light":"💆🏻‍♂️","medium-light":"💆🏼‍♂️","medium":"💆🏽‍♂️","medium-dark":"💆🏾‍♂️","dark":"💆🏿‍♂️"}},{"emoji":"💆‍♀️","label":"Woman getting massage","category":1,"version":4,"tags":["face","getting","headache","massage","relax","relaxing","salon","soothe","spa","tension","therapy","treatment","woman"],"shortcodes":["massage_woman"],"skins":{"light":"💆🏻‍♀️","medium-light":"💆🏼‍♀️","medium":"💆🏽‍♀️","medium-dark":"💆🏾‍♀️","dark":"💆🏿‍♀️"}},{"emoji":"💇","label":"Person getting haircut","category":1,"version":0.6,"tags":["barber","beauty","chop","cosmetology","cut","groom","hair","parlor","person","shears","style"],"shortcodes":["haircut"],"skins":{"light":"💇🏻","medium-light":"💇🏼","medium":"💇🏽","medium-dark":"💇🏾","dark":"💇🏿"}},{"emoji":"💇‍♂️","label":"Man getting haircut","category":1,"version":4,"tags":["barber","beauty","chop","cosmetology","cut","groom","hair","haircut","man","parlor","person","shears","style"],"shortcodes":["haircut_man"],"skins":{"light":"💇🏻‍♂️","medium-light":"💇🏼‍♂️","medium":"💇🏽‍♂️","medium-dark":"💇🏾‍♂️","dark":"💇🏿‍♂️"}},{"emoji":"💇‍♀️","label":"Woman getting haircut","category":1,"version":4,"tags":["barber","beauty","chop","cosmetology","cut","groom","hair","haircut","parlor","person","shears","style","woman"],"shortcodes":["haircut_woman"],"skins":{"light":"💇🏻‍♀️","medium-light":"💇🏼‍♀️","medium":"💇🏽‍♀️","medium-dark":"💇🏾‍♀️","dark":"💇🏿‍♀️"}},{"emoji":"🚶","label":"Person walking","category":1,"version":0.6,"tags":["amble","gait","hike","man","pace","pedestrian","person","stride","stroll","walk"],"shortcodes":["walking"],"skins":{"light":"🚶🏻","medium-light":"🚶🏼","medium":"🚶🏽","medium-dark":"🚶🏾","dark":"🚶🏿"}},{"emoji":"🚶‍♂️","label":"Man walking","category":1,"version":4,"tags":["amble","gait","hike","man","pace","pedestrian","stride","stroll","walk","walking"],"shortcodes":["walking_man"],"skins":{"light":"🚶🏻‍♂️","medium-light":"🚶🏼‍♂️","medium":"🚶🏽‍♂️","medium-dark":"🚶🏾‍♂️","dark":"🚶🏿‍♂️"}},{"emoji":"🚶‍♀️","label":"Woman walking","category":1,"version":4,"tags":["amble","gait","hike","man","pace","pedestrian","stride","stroll","walk","walking","woman"],"shortcodes":["walking_woman"],"skins":{"light":"🚶🏻‍♀️","medium-light":"🚶🏼‍♀️","medium":"🚶🏽‍♀️","medium-dark":"🚶🏾‍♀️","dark":"🚶🏿‍♀️"}},{"emoji":"🚶‍➡️","label":"Person walking: facing right","category":1,"version":15.1,"tags":["amble","facing","gait","hike","man","pace","pedestrian","person","right","stride","stroll","walk","walking"],"shortcodes":[],"skins":{"light":"🚶🏻‍➡️","medium-light":"🚶🏼‍➡️","medium":"🚶🏽‍➡️","medium-dark":"🚶🏾‍➡️","dark":"🚶🏿‍➡️"}},{"emoji":"🚶‍♀️‍➡️","label":"Woman walking: facing right","category":1,"version":15.1,"tags":["amble","facing","gait","hike","man","pace","pedestrian","right","stride","stroll","walk","walking","woman"],"shortcodes":[],"skins":{"light":"🚶🏻‍♀️‍➡️","medium-light":"🚶🏼‍♀️‍➡️","medium":"🚶🏽‍♀️‍➡️","medium-dark":"🚶🏾‍♀️‍➡️","dark":"🚶🏿‍♀️‍➡️"}},{"emoji":"🚶‍♂️‍➡️","label":"Man walking: facing right","category":1,"version":15.1,"tags":["amble","facing","gait","hike","man","pace","pedestrian","right","stride","stroll","walk","walking"],"shortcodes":[],"skins":{"light":"🚶🏻‍♂️‍➡️","medium-light":"🚶🏼‍♂️‍➡️","medium":"🚶🏽‍♂️‍➡️","medium-dark":"🚶🏾‍♂️‍➡️","dark":"🚶🏿‍♂️‍➡️"}},{"emoji":"🧍","label":"Person standing","category":1,"version":12,"tags":["person","stand","standing"],"shortcodes":["standing_person"],"skins":{"light":"🧍🏻","medium-light":"🧍🏼","medium":"🧍🏽","medium-dark":"🧍🏾","dark":"🧍🏿"}},{"emoji":"🧍‍♂️","label":"Man standing","category":1,"version":12,"tags":["man","stand","standing"],"shortcodes":["standing_man"],"skins":{"light":"🧍🏻‍♂️","medium-light":"🧍🏼‍♂️","medium":"🧍🏽‍♂️","medium-dark":"🧍🏾‍♂️","dark":"🧍🏿‍♂️"}},{"emoji":"🧍‍♀️","label":"Woman standing","category":1,"version":12,"tags":["stand","standing","woman"],"shortcodes":["standing_woman"],"skins":{"light":"🧍🏻‍♀️","medium-light":"🧍🏼‍♀️","medium":"🧍🏽‍♀️","medium-dark":"🧍🏾‍♀️","dark":"🧍🏿‍♀️"}},{"emoji":"🧎","label":"Person kneeling","category":1,"version":12,"tags":["kneel","kneeling","knees","person"],"shortcodes":["kneeling_person"],"skins":{"light":"🧎🏻","medium-light":"🧎🏼","medium":"🧎🏽","medium-dark":"🧎🏾","dark":"🧎🏿"}},{"emoji":"🧎‍♂️","label":"Man kneeling","category":1,"version":12,"tags":["kneel","kneeling","knees","man"],"shortcodes":["kneeling_man"],"skins":{"light":"🧎🏻‍♂️","medium-light":"🧎🏼‍♂️","medium":"🧎🏽‍♂️","medium-dark":"🧎🏾‍♂️","dark":"🧎🏿‍♂️"}},{"emoji":"🧎‍♀️","label":"Woman kneeling","category":1,"version":12,"tags":["kneel","kneeling","knees","woman"],"shortcodes":["kneeling_woman"],"skins":{"light":"🧎🏻‍♀️","medium-light":"🧎🏼‍♀️","medium":"🧎🏽‍♀️","medium-dark":"🧎🏾‍♀️","dark":"🧎🏿‍♀️"}},{"emoji":"🧎‍➡️","label":"Person kneeling: facing right","category":1,"version":15.1,"tags":["facing","kneel","kneeling","knees","person","right"],"shortcodes":[],"skins":{"light":"🧎🏻‍➡️","medium-light":"🧎🏼‍➡️","medium":"🧎🏽‍➡️","medium-dark":"🧎🏾‍➡️","dark":"🧎🏿‍➡️"}},{"emoji":"🧎‍♀️‍➡️","label":"Woman kneeling: facing right","category":1,"version":15.1,"tags":["facing","kneel","kneeling","knees","right","woman"],"shortcodes":[],"skins":{"light":"🧎🏻‍♀️‍➡️","medium-light":"🧎🏼‍♀️‍➡️","medium":"🧎🏽‍♀️‍➡️","medium-dark":"🧎🏾‍♀️‍➡️","dark":"🧎🏿‍♀️‍➡️"}},{"emoji":"🧎‍♂️‍➡️","label":"Man kneeling: facing right","category":1,"version":15.1,"tags":["facing","kneel","kneeling","knees","man","right"],"shortcodes":[],"skins":{"light":"🧎🏻‍♂️‍➡️","medium-light":"🧎🏼‍♂️‍➡️","medium":"🧎🏽‍♂️‍➡️","medium-dark":"🧎🏾‍♂️‍➡️","dark":"🧎🏿‍♂️‍➡️"}},{"emoji":"🧑‍🦯","label":"Person with white cane","category":1,"version":12.1,"tags":["accessibility","blind","cane","person","probing","white"],"shortcodes":["person_with_probing_cane"],"skins":{"light":"🧑🏻‍🦯","medium-light":"🧑🏼‍🦯","medium":"🧑🏽‍🦯","medium-dark":"🧑🏾‍🦯","dark":"🧑🏿‍🦯"}},{"emoji":"🧑‍🦯‍➡️","label":"Person with white cane: facing right","category":1,"version":15.1,"tags":["accessibility","blind","cane","facing","person","probing","right","white"],"shortcodes":[],"skins":{"light":"🧑🏻‍🦯‍➡️","medium-light":"🧑🏼‍🦯‍➡️","medium":"🧑🏽‍🦯‍➡️","medium-dark":"🧑🏾‍🦯‍➡️","dark":"🧑🏿‍🦯‍➡️"}},{"emoji":"👨‍🦯","label":"Man with white cane","category":1,"version":12,"tags":["accessibility","blind","cane","man","probing","white"],"shortcodes":["man_with_probing_cane"],"skins":{"light":"👨🏻‍🦯","medium-light":"👨🏼‍🦯","medium":"👨🏽‍🦯","medium-dark":"👨🏾‍🦯","dark":"👨🏿‍🦯"}},{"emoji":"👨‍🦯‍➡️","label":"Man with white cane: facing right","category":1,"version":15.1,"tags":["accessibility","blind","cane","facing","man","probing","right","white"],"shortcodes":[],"skins":{"light":"👨🏻‍🦯‍➡️","medium-light":"👨🏼‍🦯‍➡️","medium":"👨🏽‍🦯‍➡️","medium-dark":"👨🏾‍🦯‍➡️","dark":"👨🏿‍🦯‍➡️"}},{"emoji":"👩‍🦯","label":"Woman with white cane","category":1,"version":12,"tags":["accessibility","blind","cane","probing","white","woman"],"shortcodes":["woman_with_probing_cane"],"skins":{"light":"👩🏻‍🦯","medium-light":"👩🏼‍🦯","medium":"👩🏽‍🦯","medium-dark":"👩🏾‍🦯","dark":"👩🏿‍🦯"}},{"emoji":"👩‍🦯‍➡️","label":"Woman with white cane: facing right","category":1,"version":15.1,"tags":["accessibility","blind","cane","facing","probing","right","white","woman"],"shortcodes":[],"skins":{"light":"👩🏻‍🦯‍➡️","medium-light":"👩🏼‍🦯‍➡️","medium":"👩🏽‍🦯‍➡️","medium-dark":"👩🏾‍🦯‍➡️","dark":"👩🏿‍🦯‍➡️"}},{"emoji":"🧑‍🦼","label":"Person in motorized wheelchair","category":1,"version":12.1,"tags":["accessibility","motorized","person","wheelchair"],"shortcodes":["person_in_motorized_wheelchair"],"skins":{"light":"🧑🏻‍🦼","medium-light":"🧑🏼‍🦼","medium":"🧑🏽‍🦼","medium-dark":"🧑🏾‍🦼","dark":"🧑🏿‍🦼"}},{"emoji":"🧑‍🦼‍➡️","label":"Person in motorized wheelchair: facing right","category":1,"version":15.1,"tags":["accessibility","facing","motorized","person","right","wheelchair"],"shortcodes":[],"skins":{"light":"🧑🏻‍🦼‍➡️","medium-light":"🧑🏼‍🦼‍➡️","medium":"🧑🏽‍🦼‍➡️","medium-dark":"🧑🏾‍🦼‍➡️","dark":"🧑🏿‍🦼‍➡️"}},{"emoji":"👨‍🦼","label":"Man in motorized wheelchair","category":1,"version":12,"tags":["accessibility","man","motorized","wheelchair"],"shortcodes":["man_in_motorized_wheelchair"],"skins":{"light":"👨🏻‍🦼","medium-light":"👨🏼‍🦼","medium":"👨🏽‍🦼","medium-dark":"👨🏾‍🦼","dark":"👨🏿‍🦼"}},{"emoji":"👨‍🦼‍➡️","label":"Man in motorized wheelchair: facing right","category":1,"version":15.1,"tags":["accessibility","facing","man","motorized","right","wheelchair"],"shortcodes":[],"skins":{"light":"👨🏻‍🦼‍➡️","medium-light":"👨🏼‍🦼‍➡️","medium":"👨🏽‍🦼‍➡️","medium-dark":"👨🏾‍🦼‍➡️","dark":"👨🏿‍🦼‍➡️"}},{"emoji":"👩‍🦼","label":"Woman in motorized wheelchair","category":1,"version":12,"tags":["accessibility","motorized","wheelchair","woman"],"shortcodes":["woman_in_motorized_wheelchair"],"skins":{"light":"👩🏻‍🦼","medium-light":"👩🏼‍🦼","medium":"👩🏽‍🦼","medium-dark":"👩🏾‍🦼","dark":"👩🏿‍🦼"}},{"emoji":"👩‍🦼‍➡️","label":"Woman in motorized wheelchair: facing right","category":1,"version":15.1,"tags":["accessibility","facing","motorized","right","wheelchair","woman"],"shortcodes":[],"skins":{"light":"👩🏻‍🦼‍➡️","medium-light":"👩🏼‍🦼‍➡️","medium":"👩🏽‍🦼‍➡️","medium-dark":"👩🏾‍🦼‍➡️","dark":"👩🏿‍🦼‍➡️"}},{"emoji":"🧑‍🦽","label":"Person in manual wheelchair","category":1,"version":12.1,"tags":["accessibility","manual","person","wheelchair"],"shortcodes":["person_in_manual_wheelchair"],"skins":{"light":"🧑🏻‍🦽","medium-light":"🧑🏼‍🦽","medium":"🧑🏽‍🦽","medium-dark":"🧑🏾‍🦽","dark":"🧑🏿‍🦽"}},{"emoji":"🧑‍🦽‍➡️","label":"Person in manual wheelchair: facing right","category":1,"version":15.1,"tags":["accessibility","facing","manual","person","right","wheelchair"],"shortcodes":[],"skins":{"light":"🧑🏻‍🦽‍➡️","medium-light":"🧑🏼‍🦽‍➡️","medium":"🧑🏽‍🦽‍➡️","medium-dark":"🧑🏾‍🦽‍➡️","dark":"🧑🏿‍🦽‍➡️"}},{"emoji":"👨‍🦽","label":"Man in manual wheelchair","category":1,"version":12,"tags":["accessibility","man","manual","wheelchair"],"shortcodes":["man_in_manual_wheelchair"],"skins":{"light":"👨🏻‍🦽","medium-light":"👨🏼‍🦽","medium":"👨🏽‍🦽","medium-dark":"👨🏾‍🦽","dark":"👨🏿‍🦽"}},{"emoji":"👨‍🦽‍➡️","label":"Man in manual wheelchair: facing right","category":1,"version":15.1,"tags":["accessibility","facing","man","manual","right","wheelchair"],"shortcodes":[],"skins":{"light":"👨🏻‍🦽‍➡️","medium-light":"👨🏼‍🦽‍➡️","medium":"👨🏽‍🦽‍➡️","medium-dark":"👨🏾‍🦽‍➡️","dark":"👨🏿‍🦽‍➡️"}},{"emoji":"👩‍🦽","label":"Woman in manual wheelchair","category":1,"version":12,"tags":["accessibility","manual","wheelchair","woman"],"shortcodes":["woman_in_manual_wheelchair"],"skins":{"light":"👩🏻‍🦽","medium-light":"👩🏼‍🦽","medium":"👩🏽‍🦽","medium-dark":"👩🏾‍🦽","dark":"👩🏿‍🦽"}},{"emoji":"👩‍🦽‍➡️","label":"Woman in manual wheelchair: facing right","category":1,"version":15.1,"tags":["accessibility","facing","manual","right","wheelchair","woman"],"shortcodes":[],"skins":{"light":"👩🏻‍🦽‍➡️","medium-light":"👩🏼‍🦽‍➡️","medium":"👩🏽‍🦽‍➡️","medium-dark":"👩🏾‍🦽‍➡️","dark":"👩🏿‍🦽‍➡️"}},{"emoji":"🏃","label":"Person running","category":1,"version":0.6,"tags":["fast","hurry","marathon","move","person","quick","race","racing","run","rush","speed"],"shortcodes":["runner","running"],"skins":{"light":"🏃🏻","medium-light":"🏃🏼","medium":"🏃🏽","medium-dark":"🏃🏾","dark":"🏃🏿"}},{"emoji":"🏃‍♂️","label":"Man running","category":1,"version":4,"tags":["fast","hurry","man","marathon","move","quick","race","racing","run","rush","speed"],"shortcodes":["running_man"],"skins":{"light":"🏃🏻‍♂️","medium-light":"🏃🏼‍♂️","medium":"🏃🏽‍♂️","medium-dark":"🏃🏾‍♂️","dark":"🏃🏿‍♂️"}},{"emoji":"🏃‍♀️","label":"Woman running","category":1,"version":4,"tags":["fast","hurry","marathon","move","quick","race","racing","run","rush","speed","woman"],"shortcodes":["running_woman"],"skins":{"light":"🏃🏻‍♀️","medium-light":"🏃🏼‍♀️","medium":"🏃🏽‍♀️","medium-dark":"🏃🏾‍♀️","dark":"🏃🏿‍♀️"}},{"emoji":"🏃‍➡️","label":"Person running: facing right","category":1,"version":15.1,"tags":["facing","fast","hurry","marathon","move","person","quick","race","racing","right","run","rush","speed"],"shortcodes":[],"skins":{"light":"🏃🏻‍➡️","medium-light":"🏃🏼‍➡️","medium":"🏃🏽‍➡️","medium-dark":"🏃🏾‍➡️","dark":"🏃🏿‍➡️"}},{"emoji":"🏃‍♀️‍➡️","label":"Woman running: facing right","category":1,"version":15.1,"tags":["facing","fast","hurry","marathon","move","quick","race","racing","right","run","rush","speed","woman"],"shortcodes":[],"skins":{"light":"🏃🏻‍♀️‍➡️","medium-light":"🏃🏼‍♀️‍➡️","medium":"🏃🏽‍♀️‍➡️","medium-dark":"🏃🏾‍♀️‍➡️","dark":"🏃🏿‍♀️‍➡️"}},{"emoji":"🏃‍♂️‍➡️","label":"Man running: facing right","category":1,"version":15.1,"tags":["facing","fast","hurry","man","marathon","move","quick","race","racing","right","run","rush","speed"],"shortcodes":[],"skins":{"light":"🏃🏻‍♂️‍➡️","medium-light":"🏃🏼‍♂️‍➡️","medium":"🏃🏽‍♂️‍➡️","medium-dark":"🏃🏾‍♂️‍➡️","dark":"🏃🏿‍♂️‍➡️"}},{"emoji":"🧑‍🩰","label":"Ballet dancer","category":1,"version":17,"tags":["ballet","dancer"],"shortcodes":[],"skins":{"light":"🧑🏻‍🩰","medium-light":"🧑🏼‍🩰","medium":"🧑🏽‍🩰","medium-dark":"🧑🏾‍🩰","dark":"🧑🏿‍🩰"}},{"emoji":"💃","label":"Woman dancing","category":1,"version":0.6,"tags":["dance","dancing","elegant","festive","flair","flamenco","groove","let’s","salsa","tango","woman"],"shortcodes":["dancer","woman_dancing"],"skins":{"light":"💃🏻","medium-light":"💃🏼","medium":"💃🏽","medium-dark":"💃🏾","dark":"💃🏿"}},{"emoji":"🕺","label":"Man dancing","category":1,"version":3,"tags":["dance","dancer","dancing","elegant","festive","flair","flamenco","groove","let’s","man","salsa","tango"],"shortcodes":["man_dancing"],"skins":{"light":"🕺🏻","medium-light":"🕺🏼","medium":"🕺🏽","medium-dark":"🕺🏾","dark":"🕺🏿"}},{"emoji":"🕴️","label":"Person in suit levitating","category":1,"version":0.7,"tags":["business","levitating","person","suit"],"shortcodes":["business_suit_levitating"],"skins":{"light":"🕴🏻","medium-light":"🕴🏼","medium":"🕴🏽","medium-dark":"🕴🏾","dark":"🕴🏿"}},{"emoji":"👯","label":"People with bunny ears","category":1,"version":0.6,"tags":["bestie","bff","bunny","counterpart","dancer","double","ear","identical","pair","party","partying","people","soulmate","twin","twinsies"],"shortcodes":["dancers"],"skins":{"light":"👯🏻","medium-light":"👯🏼","medium":"👯🏽","medium-dark":"👯🏾","dark":"👯🏿"}},{"emoji":"👯‍♂️","label":"Men with bunny ears","category":1,"version":4,"tags":["bestie","bff","bunny","counterpart","dancer","double","ear","identical","men","pair","party","partying","people","soulmate","twin","twinsies"],"shortcodes":["dancing_men"],"skins":{"light":"👯🏻‍♂️","medium-light":"👯🏼‍♂️","medium":"👯🏽‍♂️","medium-dark":"👯🏾‍♂️","dark":"👯🏿‍♂️"}},{"emoji":"👯‍♀️","label":"Women with bunny ears","category":1,"version":4,"tags":["bestie","bff","bunny","counterpart","dancer","double","ear","identical","pair","party","partying","people","soulmate","twin","twinsies","women"],"shortcodes":["dancing_women"],"skins":{"light":"👯🏻‍♀️","medium-light":"👯🏼‍♀️","medium":"👯🏽‍♀️","medium-dark":"👯🏾‍♀️","dark":"👯🏿‍♀️"}},{"emoji":"🧖","label":"Person in steamy room","category":1,"version":5,"tags":["day","luxurious","pamper","person","relax","room","sauna","spa","steam","steambath","unwind"],"shortcodes":["sauna_person"],"skins":{"light":"🧖🏻","medium-light":"🧖🏼","medium":"🧖🏽","medium-dark":"🧖🏾","dark":"🧖🏿"}},{"emoji":"🧖‍♂️","label":"Man in steamy room","category":1,"version":5,"tags":["day","luxurious","man","pamper","relax","room","sauna","spa","steam","steambath","unwind"],"shortcodes":["sauna_man"],"skins":{"light":"🧖🏻‍♂️","medium-light":"🧖🏼‍♂️","medium":"🧖🏽‍♂️","medium-dark":"🧖🏾‍♂️","dark":"🧖🏿‍♂️"}},{"emoji":"🧖‍♀️","label":"Woman in steamy room","category":1,"version":5,"tags":["day","luxurious","pamper","relax","room","sauna","spa","steam","steambath","unwind","woman"],"shortcodes":["sauna_woman"],"skins":{"light":"🧖🏻‍♀️","medium-light":"🧖🏼‍♀️","medium":"🧖🏽‍♀️","medium-dark":"🧖🏾‍♀️","dark":"🧖🏿‍♀️"}},{"emoji":"🧗","label":"Person climbing","category":1,"version":5,"tags":["climb","climber","mountain","person","rock","scale","up"],"shortcodes":["climbing"],"skins":{"light":"🧗🏻","medium-light":"🧗🏼","medium":"🧗🏽","medium-dark":"🧗🏾","dark":"🧗🏿"}},{"emoji":"🧗‍♂️","label":"Man climbing","category":1,"version":5,"tags":["climb","climber","climbing","man","mountain","rock","scale","up"],"shortcodes":["climbing_man"],"skins":{"light":"🧗🏻‍♂️","medium-light":"🧗🏼‍♂️","medium":"🧗🏽‍♂️","medium-dark":"🧗🏾‍♂️","dark":"🧗🏿‍♂️"}},{"emoji":"🧗‍♀️","label":"Woman climbing","category":1,"version":5,"tags":["climb","climber","climbing","mountain","rock","scale","up","woman"],"shortcodes":["climbing_woman"],"skins":{"light":"🧗🏻‍♀️","medium-light":"🧗🏼‍♀️","medium":"🧗🏽‍♀️","medium-dark":"🧗🏾‍♀️","dark":"🧗🏿‍♀️"}},{"emoji":"🤺","label":"Person fencing","category":1,"version":3,"tags":["fencer","fencing","person","sword"],"shortcodes":["person_fencing"]},{"emoji":"🏇","label":"Horse racing","category":1,"version":1,"tags":["horse","jockey","racehorse","racing","riding","sport"],"shortcodes":["horse_racing"],"skins":{"light":"🏇🏻","medium-light":"🏇🏼","medium":"🏇🏽","medium-dark":"🏇🏾","dark":"🏇🏿"}},{"emoji":"⛷️","label":"Skier","category":1,"version":0.7,"tags":["ski","snow"],"shortcodes":["skier"]},{"emoji":"🏂️","label":"Snowboarder","category":1,"version":0.6,"tags":["ski","snow","snowboard","sport"],"shortcodes":["snowboarder"],"skins":{"light":"🏂🏻","medium-light":"🏂🏼","medium":"🏂🏽","medium-dark":"🏂🏾","dark":"🏂🏿"}},{"emoji":"🏌️","label":"Person golfing","category":1,"version":0.7,"tags":["ball","birdie","caddy","driving","golf","green","person","pga","putt","range","tee"],"shortcodes":["golfing"],"skins":{"light":"🏌🏻","medium-light":"🏌🏼","medium":"🏌🏽","medium-dark":"🏌🏾","dark":"🏌🏿"}},{"emoji":"🏌️‍♂️","label":"Man golfing","category":1,"version":4,"tags":["ball","birdie","caddy","driving","golf","golfing","green","man","pga","putt","range","tee"],"shortcodes":["golfing_man"],"skins":{"light":"🏌🏻‍♂️","medium-light":"🏌🏼‍♂️","medium":"🏌🏽‍♂️","medium-dark":"🏌🏾‍♂️","dark":"🏌🏿‍♂️"}},{"emoji":"🏌️‍♀️","label":"Woman golfing","category":1,"version":4,"tags":["ball","birdie","caddy","driving","golf","golfing","green","pga","putt","range","tee","woman"],"shortcodes":["golfing_woman"],"skins":{"light":"🏌🏻‍♀️","medium-light":"🏌🏼‍♀️","medium":"🏌🏽‍♀️","medium-dark":"🏌🏾‍♀️","dark":"🏌🏿‍♀️"}},{"emoji":"🏄️","label":"Person surfing","category":1,"version":0.6,"tags":["beach","ocean","person","sport","surf","surfing","swell","waves"],"shortcodes":["surfer"],"skins":{"light":"🏄🏻","medium-light":"🏄🏼","medium":"🏄🏽","medium-dark":"🏄🏾","dark":"🏄🏿"}},{"emoji":"🏄‍♂️","label":"Man surfing","category":1,"version":4,"tags":["beach","man","ocean","sport","surf","surfer","surfing","swell","waves"],"shortcodes":["surfing_man"],"skins":{"light":"🏄🏻‍♂️","medium-light":"🏄🏼‍♂️","medium":"🏄🏽‍♂️","medium-dark":"🏄🏾‍♂️","dark":"🏄🏿‍♂️"}},{"emoji":"🏄‍♀️","label":"Woman surfing","category":1,"version":4,"tags":["beach","ocean","person","sport","surf","surfer","surfing","swell","waves"],"shortcodes":["surfing_woman"],"skins":{"light":"🏄🏻‍♀️","medium-light":"🏄🏼‍♀️","medium":"🏄🏽‍♀️","medium-dark":"🏄🏾‍♀️","dark":"🏄🏿‍♀️"}},{"emoji":"🚣","label":"Person rowing boat","category":1,"version":1,"tags":["boat","canoe","cruise","fishing","lake","oar","paddle","person","raft","river","row","rowing"],"shortcodes":["rowboat"],"skins":{"light":"🚣🏻","medium-light":"🚣🏼","medium":"🚣🏽","medium-dark":"🚣🏾","dark":"🚣🏿"}},{"emoji":"🚣‍♂️","label":"Man rowing boat","category":1,"version":4,"tags":["boat","canoe","cruise","fishing","lake","man","oar","paddle","raft","river","row","rowboat","rowing"],"shortcodes":["rowing_man"],"skins":{"light":"🚣🏻‍♂️","medium-light":"🚣🏼‍♂️","medium":"🚣🏽‍♂️","medium-dark":"🚣🏾‍♂️","dark":"🚣🏿‍♂️"}},{"emoji":"🚣‍♀️","label":"Woman rowing boat","category":1,"version":4,"tags":["boat","canoe","cruise","fishing","lake","oar","paddle","raft","river","row","rowboat","rowing","woman"],"shortcodes":["rowing_woman"],"skins":{"light":"🚣🏻‍♀️","medium-light":"🚣🏼‍♀️","medium":"🚣🏽‍♀️","medium-dark":"🚣🏾‍♀️","dark":"🚣🏿‍♀️"}},{"emoji":"🏊️","label":"Person swimming","category":1,"version":0.6,"tags":["freestyle","person","sport","swim","swimming","triathlon"],"shortcodes":["swimmer"],"skins":{"light":"🏊🏻","medium-light":"🏊🏼","medium":"🏊🏽","medium-dark":"🏊🏾","dark":"🏊🏿"}},{"emoji":"🏊‍♂️","label":"Man swimming","category":1,"version":4,"tags":["freestyle","man","sport","swim","swimmer","swimming","triathlon"],"shortcodes":["swimming_man"],"skins":{"light":"🏊🏻‍♂️","medium-light":"🏊🏼‍♂️","medium":"🏊🏽‍♂️","medium-dark":"🏊🏾‍♂️","dark":"🏊🏿‍♂️"}},{"emoji":"🏊‍♀️","label":"Woman swimming","category":1,"version":4,"tags":["freestyle","man","sport","swim","swimmer","swimming","triathlon"],"shortcodes":["swimming_woman"],"skins":{"light":"🏊🏻‍♀️","medium-light":"🏊🏼‍♀️","medium":"🏊🏽‍♀️","medium-dark":"🏊🏾‍♀️","dark":"🏊🏿‍♀️"}},{"emoji":"⛹️","label":"Person bouncing ball","category":1,"version":0.7,"tags":["athletic","ball","basketball","bouncing","championship","dribble","net","person","player","throw"],"shortcodes":["bouncing_ball_person"],"skins":{"light":"⛹🏻","medium-light":"⛹🏼","medium":"⛹🏽","medium-dark":"⛹🏾","dark":"⛹🏿"}},{"emoji":"⛹️‍♂️","label":"Man bouncing ball","category":1,"version":4,"tags":["athletic","ball","basketball","bouncing","championship","dribble","man","net","player","throw"],"shortcodes":["basketball_man","bouncing_ball_man"],"skins":{"light":"⛹🏻‍♂️","medium-light":"⛹🏼‍♂️","medium":"⛹🏽‍♂️","medium-dark":"⛹🏾‍♂️","dark":"⛹🏿‍♂️"}},{"emoji":"⛹️‍♀️","label":"Woman bouncing ball","category":1,"version":4,"tags":["athletic","ball","basketball","bouncing","championship","dribble","net","player","throw","woman"],"shortcodes":["basketball_woman","bouncing_ball_woman"],"skins":{"light":"⛹🏻‍♀️","medium-light":"⛹🏼‍♀️","medium":"⛹🏽‍♀️","medium-dark":"⛹🏾‍♀️","dark":"⛹🏿‍♀️"}},{"emoji":"🏋️","label":"Person lifting weights","category":1,"version":0.7,"tags":["barbell","bodybuilder","deadlift","lifter","lifting","person","powerlifting","weight","weightlifter","weights","workout"],"shortcodes":["weight_lifting"],"skins":{"light":"🏋🏻","medium-light":"🏋🏼","medium":"🏋🏽","medium-dark":"🏋🏾","dark":"🏋🏿"}},{"emoji":"🏋️‍♂️","label":"Man lifting weights","category":1,"version":4,"tags":["barbell","bodybuilder","deadlift","lifter","lifting","man","powerlifting","weight","weightlifter","weights","workout"],"shortcodes":["weight_lifting_man"],"skins":{"light":"🏋🏻‍♂️","medium-light":"🏋🏼‍♂️","medium":"🏋🏽‍♂️","medium-dark":"🏋🏾‍♂️","dark":"🏋🏿‍♂️"}},{"emoji":"🏋️‍♀️","label":"Woman lifting weights","category":1,"version":4,"tags":["barbell","bodybuilder","deadlift","lifter","lifting","powerlifting","weight","weightlifter","weights","woman","workout"],"shortcodes":["weight_lifting_woman"],"skins":{"light":"🏋🏻‍♀️","medium-light":"🏋🏼‍♀️","medium":"🏋🏽‍♀️","medium-dark":"🏋🏾‍♀️","dark":"🏋🏿‍♀️"}},{"emoji":"🚴","label":"Person biking","category":1,"version":1,"tags":["bicycle","bike","biking","cycle","cyclist","person","riding","sport"],"shortcodes":["bicyclist"],"skins":{"light":"🚴🏻","medium-light":"🚴🏼","medium":"🚴🏽","medium-dark":"🚴🏾","dark":"🚴🏿"}},{"emoji":"🚴‍♂️","label":"Man biking","category":1,"version":4,"tags":["bicycle","bicyclist","bike","biking","cycle","cyclist","man","riding","sport"],"shortcodes":["biking_man"],"skins":{"light":"🚴🏻‍♂️","medium-light":"🚴🏼‍♂️","medium":"🚴🏽‍♂️","medium-dark":"🚴🏾‍♂️","dark":"🚴🏿‍♂️"}},{"emoji":"🚴‍♀️","label":"Woman biking","category":1,"version":4,"tags":["bicycle","bicyclist","bike","biking","cycle","cyclist","riding","sport","woman"],"shortcodes":["biking_woman"],"skins":{"light":"🚴🏻‍♀️","medium-light":"🚴🏼‍♀️","medium":"🚴🏽‍♀️","medium-dark":"🚴🏾‍♀️","dark":"🚴🏿‍♀️"}},{"emoji":"🚵","label":"Person mountain biking","category":1,"version":1,"tags":["bicycle","bicyclist","bike","biking","cycle","cyclist","mountain","person","riding","sport"],"shortcodes":["mountain_bicyclist"],"skins":{"light":"🚵🏻","medium-light":"🚵🏼","medium":"🚵🏽","medium-dark":"🚵🏾","dark":"🚵🏿"}},{"emoji":"🚵‍♂️","label":"Man mountain biking","category":1,"version":4,"tags":["bicycle","bicyclist","bike","biking","cycle","cyclist","man","mountain","riding","sport"],"shortcodes":["mountain_biking_man"],"skins":{"light":"🚵🏻‍♂️","medium-light":"🚵🏼‍♂️","medium":"🚵🏽‍♂️","medium-dark":"🚵🏾‍♂️","dark":"🚵🏿‍♂️"}},{"emoji":"🚵‍♀️","label":"Woman mountain biking","category":1,"version":4,"tags":["bicycle","bicyclist","bike","biking","cycle","cyclist","mountain","riding","sport","woman"],"shortcodes":["mountain_biking_woman"],"skins":{"light":"🚵🏻‍♀️","medium-light":"🚵🏼‍♀️","medium":"🚵🏽‍♀️","medium-dark":"🚵🏾‍♀️","dark":"🚵🏿‍♀️"}},{"emoji":"🤸","label":"Person cartwheeling","category":1,"version":3,"tags":["active","cartwheel","excited","flip","gymnastics","happy","person","somersault"],"shortcodes":["cartwheeling"],"skins":{"light":"🤸🏻","medium-light":"🤸🏼","medium":"🤸🏽","medium-dark":"🤸🏾","dark":"🤸🏿"}},{"emoji":"🤸‍♂️","label":"Man cartwheeling","category":1,"version":4,"tags":["active","cartwheel","cartwheeling","excited","flip","gymnastics","happy","man","somersault"],"shortcodes":["man_cartwheeling"],"skins":{"light":"🤸🏻‍♂️","medium-light":"🤸🏼‍♂️","medium":"🤸🏽‍♂️","medium-dark":"🤸🏾‍♂️","dark":"🤸🏿‍♂️"}},{"emoji":"🤸‍♀️","label":"Woman cartwheeling","category":1,"version":4,"tags":["active","cartwheel","cartwheeling","excited","flip","gymnastics","happy","somersault","woman"],"shortcodes":["woman_cartwheeling"],"skins":{"light":"🤸🏻‍♀️","medium-light":"🤸🏼‍♀️","medium":"🤸🏽‍♀️","medium-dark":"🤸🏾‍♀️","dark":"🤸🏿‍♀️"}},{"emoji":"🤼","label":"People wrestling","category":1,"version":3,"tags":["combat","duel","grapple","people","ring","tournament","wrestle"],"shortcodes":["wrestling"],"skins":{"light":"🤼🏻","medium-light":"🤼🏼","medium":"🤼🏽","medium-dark":"🤼🏾","dark":"🤼🏿"}},{"emoji":"🤼‍♂️","label":"Men wrestling","category":1,"version":4,"tags":["combat","duel","grapple","men","ring","tournament","wrestle","wrestling"],"shortcodes":["men_wrestling"],"skins":{"light":"🤼🏻‍♂️","medium-light":"🤼🏼‍♂️","medium":"🤼🏽‍♂️","medium-dark":"🤼🏾‍♂️","dark":"🤼🏿‍♂️"}},{"emoji":"🤼‍♀️","label":"Women wrestling","category":1,"version":4,"tags":["combat","duel","grapple","ring","tournament","women","wrestle","wrestling"],"shortcodes":["women_wrestling"],"skins":{"light":"🤼🏻‍♀️","medium-light":"🤼🏼‍♀️","medium":"🤼🏽‍♀️","medium-dark":"🤼🏾‍♀️","dark":"🤼🏿‍♀️"}},{"emoji":"🤽","label":"Person playing water polo","category":1,"version":3,"tags":["person","playing","polo","sport","swimming","water","waterpolo"],"shortcodes":["water_polo"],"skins":{"light":"🤽🏻","medium-light":"🤽🏼","medium":"🤽🏽","medium-dark":"🤽🏾","dark":"🤽🏿"}},{"emoji":"🤽‍♂️","label":"Man playing water polo","category":1,"version":4,"tags":["man","playing","polo","sport","swimming","water","waterpolo"],"shortcodes":["man_playing_water_polo"],"skins":{"light":"🤽🏻‍♂️","medium-light":"🤽🏼‍♂️","medium":"🤽🏽‍♂️","medium-dark":"🤽🏾‍♂️","dark":"🤽🏿‍♂️"}},{"emoji":"🤽‍♀️","label":"Woman playing water polo","category":1,"version":4,"tags":["playing","polo","sport","swimming","water","waterpolo","woman"],"shortcodes":["woman_playing_water_polo"],"skins":{"light":"🤽🏻‍♀️","medium-light":"🤽🏼‍♀️","medium":"🤽🏽‍♀️","medium-dark":"🤽🏾‍♀️","dark":"🤽🏿‍♀️"}},{"emoji":"🤾","label":"Person playing handball","category":1,"version":3,"tags":["athletics","ball","catch","chuck","handball","hurl","lob","person","pitch","playing","sport","throw","toss"],"shortcodes":["handball_person"],"skins":{"light":"🤾🏻","medium-light":"🤾🏼","medium":"🤾🏽","medium-dark":"🤾🏾","dark":"🤾🏿"}},{"emoji":"🤾‍♂️","label":"Man playing handball","category":1,"version":4,"tags":["athletics","ball","catch","chuck","handball","hurl","lob","man","pitch","playing","sport","throw","toss"],"shortcodes":["man_playing_handball"],"skins":{"light":"🤾🏻‍♂️","medium-light":"🤾🏼‍♂️","medium":"🤾🏽‍♂️","medium-dark":"🤾🏾‍♂️","dark":"🤾🏿‍♂️"}},{"emoji":"🤾‍♀️","label":"Woman playing handball","category":1,"version":4,"tags":["athletics","ball","catch","chuck","handball","hurl","lob","pitch","playing","sport","throw","toss","woman"],"shortcodes":["woman_playing_handball"],"skins":{"light":"🤾🏻‍♀️","medium-light":"🤾🏼‍♀️","medium":"🤾🏽‍♀️","medium-dark":"🤾🏾‍♀️","dark":"🤾🏿‍♀️"}},{"emoji":"🤹","label":"Person juggling","category":1,"version":3,"tags":["act","balance","balancing","handle","juggle","juggling","manage","multitask","person","skill"],"shortcodes":["juggling_person"],"skins":{"light":"🤹🏻","medium-light":"🤹🏼","medium":"🤹🏽","medium-dark":"🤹🏾","dark":"🤹🏿"}},{"emoji":"🤹‍♂️","label":"Man juggling","category":1,"version":4,"tags":["act","balance","balancing","handle","juggle","juggling","man","manage","multitask","skill"],"shortcodes":["man_juggling"],"skins":{"light":"🤹🏻‍♂️","medium-light":"🤹🏼‍♂️","medium":"🤹🏽‍♂️","medium-dark":"🤹🏾‍♂️","dark":"🤹🏿‍♂️"}},{"emoji":"🤹‍♀️","label":"Woman juggling","category":1,"version":4,"tags":["act","balance","balancing","handle","juggle","juggling","manage","multitask","skill","woman"],"shortcodes":["woman_juggling"],"skins":{"light":"🤹🏻‍♀️","medium-light":"🤹🏼‍♀️","medium":"🤹🏽‍♀️","medium-dark":"🤹🏾‍♀️","dark":"🤹🏿‍♀️"}},{"emoji":"🧘","label":"Person in lotus position","category":1,"version":5,"tags":["cross","legged","legs","lotus","meditation","peace","person","position","relax","serenity","yoga","yogi","zen"],"shortcodes":["lotus_position"],"skins":{"light":"🧘🏻","medium-light":"🧘🏼","medium":"🧘🏽","medium-dark":"🧘🏾","dark":"🧘🏿"}},{"emoji":"🧘‍♂️","label":"Man in lotus position","category":1,"version":5,"tags":["cross","legged","legs","lotus","man","meditation","peace","position","relax","serenity","yoga","yogi","zen"],"shortcodes":["lotus_position_man"],"skins":{"light":"🧘🏻‍♂️","medium-light":"🧘🏼‍♂️","medium":"🧘🏽‍♂️","medium-dark":"🧘🏾‍♂️","dark":"🧘🏿‍♂️"}},{"emoji":"🧘‍♀️","label":"Woman in lotus position","category":1,"version":5,"tags":["cross","legged","legs","lotus","meditation","peace","position","relax","serenity","woman","yoga","yogi","zen"],"shortcodes":["lotus_position_woman"],"skins":{"light":"🧘🏻‍♀️","medium-light":"🧘🏼‍♀️","medium":"🧘🏽‍♀️","medium-dark":"🧘🏾‍♀️","dark":"🧘🏿‍♀️"}},{"emoji":"🛀","label":"Person taking bath","category":1,"version":0.6,"tags":["bathtub","person","taking","tub"],"shortcodes":["bath"],"skins":{"light":"🛀🏻","medium-light":"🛀🏼","medium":"🛀🏽","medium-dark":"🛀🏾","dark":"🛀🏿"}},{"emoji":"🛌","label":"Person in bed","category":1,"version":1,"tags":["bed","bedtime","good","goodnight","hotel","nap","night","person","sleep","tired","zzz"],"shortcodes":["sleeping_bed"],"skins":{"light":"🛌🏻","medium-light":"🛌🏼","medium":"🛌🏽","medium-dark":"🛌🏾","dark":"🛌🏿"}},{"emoji":"🧑‍🤝‍🧑","label":"People holding hands","category":1,"version":12,"tags":["bae","bestie","bff","couple","dating","flirt","friends","hand","hold","people","twins"],"shortcodes":["people_holding_hands"],"skins":{"light":"🧑🏻‍🤝‍🧑🏻","medium-light":"🧑🏼‍🤝‍🧑🏼","medium":"🧑🏽‍🤝‍🧑🏽","medium-dark":"🧑🏾‍🤝‍🧑🏾","dark":"🧑🏿‍🤝‍🧑🏿"}},{"emoji":"👭","label":"Women holding hands","category":1,"version":1,"tags":["bae","bestie","bff","couple","dating","flirt","friends","girls","hand","hold","sisters","twins","women"],"shortcodes":["two_women_holding_hands"],"skins":{"light":"👭🏻","medium-light":"👭🏼","medium":"👭🏽","medium-dark":"👭🏾","dark":"👭🏿"}},{"emoji":"👫","label":"Woman and man holding hands","category":1,"version":0.6,"tags":["bae","bestie","bff","dating","flirt","friends","hand","hold","man","twins","woman"],"shortcodes":["couple"],"skins":{"light":"👫🏻","medium-light":"👫🏼","medium":"👫🏽","medium-dark":"👫🏾","dark":"👫🏿"}},{"emoji":"👬","label":"Men holding hands","category":1,"version":1,"tags":["bae","bestie","bff","boys","brothers","couple","dating","flirt","friends","hand","hold","men","twins"],"shortcodes":["two_men_holding_hands"],"skins":{"light":"👬🏻","medium-light":"👬🏼","medium":"👬🏽","medium-dark":"👬🏾","dark":"👬🏿"}},{"emoji":"💏","label":"Kiss","category":1,"version":0.6,"tags":["anniversary","babe","bae","couple","date","dating","heart","love","mwah","person","romance","together","xoxo"],"shortcodes":["couplekiss"],"skins":{"light":"💏🏻","medium-light":"💏🏼","medium":"💏🏽","medium-dark":"💏🏾","dark":"💏🏿"}},{"emoji":"👩‍❤️‍💋‍👨","label":"Kiss: woman, man","category":1,"version":2,"tags":["anniversary","babe","bae","couple","date","dating","heart","kiss","love","man","mwah","person","romance","together","woman","xoxo"],"shortcodes":["couplekiss_man_woman"],"skins":{"light":"👩🏻‍❤️‍💋‍👨🏻","medium-light":"👩🏼‍❤️‍💋‍👨🏼","medium":"👩🏽‍❤️‍💋‍👨🏽","medium-dark":"👩🏾‍❤️‍💋‍👨🏾","dark":"👩🏿‍❤️‍💋‍👨🏿"}},{"emoji":"👨‍❤️‍💋‍👨","label":"Kiss: man, man","category":1,"version":2,"tags":["anniversary","babe","bae","couple","date","dating","heart","kiss","love","man","mwah","person","romance","together","xoxo"],"shortcodes":["couplekiss_man_man"],"skins":{"light":"👨🏻‍❤️‍💋‍👨🏻","medium-light":"👨🏼‍❤️‍💋‍👨🏼","medium":"👨🏽‍❤️‍💋‍👨🏽","medium-dark":"👨🏾‍❤️‍💋‍👨🏾","dark":"👨🏿‍❤️‍💋‍👨🏿"}},{"emoji":"👩‍❤️‍💋‍👩","label":"Kiss: woman, woman","category":1,"version":2,"tags":["anniversary","babe","bae","couple","date","dating","heart","kiss","love","mwah","person","romance","together","woman","xoxo"],"shortcodes":["couplekiss_woman_woman"],"skins":{"light":"👩🏻‍❤️‍💋‍👩🏻","medium-light":"👩🏼‍❤️‍💋‍👩🏼","medium":"👩🏽‍❤️‍💋‍👩🏽","medium-dark":"👩🏾‍❤️‍💋‍👩🏾","dark":"👩🏿‍❤️‍💋‍👩🏿"}},{"emoji":"💑","label":"Couple with heart","category":1,"version":0.6,"tags":["anniversary","babe","bae","couple","dating","heart","kiss","love","person","relationship","romance","together","you"],"shortcodes":["couple_with_heart"],"skins":{"light":"💑🏻","medium-light":"💑🏼","medium":"💑🏽","medium-dark":"💑🏾","dark":"💑🏿"}},{"emoji":"👩‍❤️‍👨","label":"Couple with heart: woman, man","category":1,"version":2,"tags":["anniversary","babe","bae","couple","dating","heart","kiss","love","man","person","relationship","romance","together","woman","you"],"shortcodes":["couple_with_heart_woman_man"],"skins":{"light":"👩🏻‍❤️‍👨🏻","medium-light":"👩🏼‍❤️‍👨🏼","medium":"👩🏽‍❤️‍👨🏽","medium-dark":"👩🏾‍❤️‍👨🏾","dark":"👩🏿‍❤️‍👨🏿"}},{"emoji":"👨‍❤️‍👨","label":"Couple with heart: man, man","category":1,"version":2,"tags":["anniversary","babe","bae","couple","dating","heart","kiss","love","man","person","relationship","romance","together","you"],"shortcodes":["couple_with_heart_man_man"],"skins":{"light":"👨🏻‍❤️‍👨🏻","medium-light":"👨🏼‍❤️‍👨🏼","medium":"👨🏽‍❤️‍👨🏽","medium-dark":"👨🏾‍❤️‍👨🏾","dark":"👨🏿‍❤️‍👨🏿"}},{"emoji":"👩‍❤️‍👩","label":"Couple with heart: woman, woman","category":1,"version":2,"tags":["anniversary","babe","bae","couple","dating","heart","kiss","love","person","relationship","romance","together","woman","you"],"shortcodes":["couple_with_heart_woman_woman"],"skins":{"light":"👩🏻‍❤️‍👩🏻","medium-light":"👩🏼‍❤️‍👩🏼","medium":"👩🏽‍❤️‍👩🏽","medium-dark":"👩🏾‍❤️‍👩🏾","dark":"👩🏿‍❤️‍👩🏿"}},{"emoji":"👨‍👩‍👦","label":"Family: man, woman, boy","category":1,"version":2,"tags":["boy","child","family","man","woman"],"shortcodes":["family_man_woman_boy"]},{"emoji":"👨‍👩‍👧","label":"Family: man, woman, girl","category":1,"version":2,"tags":["child","family","girl","man","woman"],"shortcodes":["family_man_woman_girl"]},{"emoji":"👨‍👩‍👧‍👦","label":"Family: man, woman, girl, boy","category":1,"version":2,"tags":["boy","child","family","girl","man","woman"],"shortcodes":["family_man_woman_girl_boy"]},{"emoji":"👨‍👩‍👦‍👦","label":"Family: man, woman, boy, boy","category":1,"version":2,"tags":["boy","child","family","man","woman"],"shortcodes":["family_man_woman_boy_boy"]},{"emoji":"👨‍👩‍👧‍👧","label":"Family: man, woman, girl, girl","category":1,"version":2,"tags":["child","family","girl","man","woman"],"shortcodes":["family_man_woman_girl_girl"]},{"emoji":"👨‍👨‍👦","label":"Family: man, man, boy","category":1,"version":2,"tags":["boy","child","family","man"],"shortcodes":["family_man_man_boy"]},{"emoji":"👨‍👨‍👧","label":"Family: man, man, girl","category":1,"version":2,"tags":["child","family","girl","man"],"shortcodes":["family_man_man_girl"]},{"emoji":"👨‍👨‍👧‍👦","label":"Family: man, man, girl, boy","category":1,"version":2,"tags":["boy","child","family","girl","man"],"shortcodes":["family_man_man_girl_boy"]},{"emoji":"👨‍👨‍👦‍👦","label":"Family: man, man, boy, boy","category":1,"version":2,"tags":["boy","child","family","man"],"shortcodes":["family_man_man_boy_boy"]},{"emoji":"👨‍👨‍👧‍👧","label":"Family: man, man, girl, girl","category":1,"version":2,"tags":["child","family","girl","man"],"shortcodes":["family_man_man_girl_girl"]},{"emoji":"👩‍👩‍👦","label":"Family: woman, woman, boy","category":1,"version":2,"tags":["boy","child","family","woman"],"shortcodes":["family_woman_woman_boy"]},{"emoji":"👩‍👩‍👧","label":"Family: woman, woman, girl","category":1,"version":2,"tags":["child","family","girl","woman"],"shortcodes":["family_woman_woman_girl"]},{"emoji":"👩‍👩‍👧‍👦","label":"Family: woman, woman, girl, boy","category":1,"version":2,"tags":["boy","child","family","girl","woman"],"shortcodes":["family_woman_woman_girl_boy"]},{"emoji":"👩‍👩‍👦‍👦","label":"Family: woman, woman, boy, boy","category":1,"version":2,"tags":["boy","child","family","woman"],"shortcodes":["family_woman_woman_boy_boy"]},{"emoji":"👩‍👩‍👧‍👧","label":"Family: woman, woman, girl, girl","category":1,"version":2,"tags":["child","family","girl","woman"],"shortcodes":["family_woman_woman_girl_girl"]},{"emoji":"👨‍👦","label":"Family: man, boy","category":1,"version":4,"tags":["boy","child","family","man"],"shortcodes":["family_man_boy"]},{"emoji":"👨‍👦‍👦","label":"Family: man, boy, boy","category":1,"version":4,"tags":["boy","child","family","man"],"shortcodes":["family_man_boy_boy"]},{"emoji":"👨‍👧","label":"Family: man, girl","category":1,"version":4,"tags":["child","family","girl","man"],"shortcodes":["family_man_girl"]},{"emoji":"👨‍👧‍👦","label":"Family: man, girl, boy","category":1,"version":4,"tags":["boy","child","family","girl","man"],"shortcodes":["family_man_girl_boy"]},{"emoji":"👨‍👧‍👧","label":"Family: man, girl, girl","category":1,"version":4,"tags":["child","family","girl","man"],"shortcodes":["family_man_girl_girl"]},{"emoji":"👩‍👦","label":"Family: woman, boy","category":1,"version":4,"tags":["boy","child","family","woman"],"shortcodes":["family_woman_boy"]},{"emoji":"👩‍👦‍👦","label":"Family: woman, boy, boy","category":1,"version":4,"tags":["boy","child","family","woman"],"shortcodes":["family_woman_boy_boy"]},{"emoji":"👩‍👧","label":"Family: woman, girl","category":1,"version":4,"tags":["child","family","girl","woman"],"shortcodes":["family_woman_girl"]},{"emoji":"👩‍👧‍👦","label":"Family: woman, girl, boy","category":1,"version":4,"tags":["boy","child","family","girl","woman"],"shortcodes":["family_woman_girl_boy"]},{"emoji":"👩‍👧‍👧","label":"Family: woman, girl, girl","category":1,"version":4,"tags":["child","family","girl","woman"],"shortcodes":["family_woman_girl_girl"]},{"emoji":"🗣️","label":"Speaking head","category":1,"version":0.7,"tags":["face","head","silhouette","speak","speaking"],"shortcodes":["speaking_head"]},{"emoji":"👤","label":"Bust in silhouette","category":1,"version":0.6,"tags":["bust","mysterious","shadow","silhouette"],"shortcodes":["bust_in_silhouette"]},{"emoji":"👥","label":"Busts in silhouette","category":1,"version":1,"tags":["bff","bust","busts","everyone","friend","friends","people","silhouette"],"shortcodes":["busts_in_silhouette"]},{"emoji":"🫂","label":"People hugging","category":1,"version":13,"tags":["comfort","embrace","farewell","friendship","goodbye","hello","hug","hugging","love","people","thanks"],"shortcodes":["people_hugging"]},{"emoji":"👪️","label":"Family","category":1,"version":0.6,"tags":["child"],"shortcodes":["family"]},{"emoji":"🧑‍🧑‍🧒","label":"Family: adult, adult, child","category":1,"version":15.1,"tags":["adult","child","family"],"shortcodes":[]},{"emoji":"🧑‍🧑‍🧒‍🧒","label":"Family: adult, adult, child, child","category":1,"version":15.1,"tags":["adult","child","family"],"shortcodes":[]},{"emoji":"🧑‍🧒","label":"Family: adult, child","category":1,"version":15.1,"tags":["adult","child","family"],"shortcodes":[]},{"emoji":"🧑‍🧒‍🧒","label":"Family: adult, child, child","category":1,"version":15.1,"tags":["adult","child","family"],"shortcodes":[]},{"emoji":"👣","label":"Footprints","category":1,"version":0.6,"tags":["barefoot","clothing","footprint","omw","print","walk"],"shortcodes":["footprints"]},{"emoji":"🫆","label":"Fingerprint","category":1,"version":16,"tags":["clue","crime","detective","forensics","identity","mystery","print","safety","trace"],"shortcodes":[]},{"emoji":"🐵","label":"Monkey face","category":3,"version":0.6,"tags":["animal","banana","face","monkey"],"shortcodes":["monkey_face"]},{"emoji":"🐒","label":"Monkey","category":3,"version":0.6,"tags":["animal","banana"],"shortcodes":["monkey"]},{"emoji":"🦍","label":"Gorilla","category":3,"version":3,"tags":["animal"],"shortcodes":["gorilla"]},{"emoji":"🦧","label":"Orangutan","category":3,"version":12,"tags":["animal","ape","monkey"],"shortcodes":["orangutan"]},{"emoji":"🐶","label":"Dog face","category":3,"version":0.6,"tags":["adorbs","animal","face","pet","puppies","puppy"],"shortcodes":["dog"]},{"emoji":"🐕️","label":"Dog","category":3,"version":0.7,"tags":["animal","animals","dogs","pet"],"shortcodes":["dog2"]},{"emoji":"🦮","label":"Guide dog","category":3,"version":12,"tags":["accessibility","animal","blind","dog","guide"],"shortcodes":["guide_dog"]},{"emoji":"🐕‍🦺","label":"Service dog","category":3,"version":12,"tags":["accessibility","animal","assistance","dog","service"],"shortcodes":["service_dog"]},{"emoji":"🐩","label":"Poodle","category":3,"version":0.6,"tags":["animal","dog","fluffy"],"shortcodes":["poodle"]},{"emoji":"🐺","label":"Wolf","category":3,"version":0.6,"tags":["animal","face"],"shortcodes":["wolf"]},{"emoji":"🦊","label":"Fox","category":3,"version":3,"tags":["animal","face"],"shortcodes":["fox_face"]},{"emoji":"🦝","label":"Raccoon","category":3,"version":11,"tags":["animal","curious","sly"],"shortcodes":["raccoon"]},{"emoji":"🐱","label":"Cat face","category":3,"version":0.6,"tags":["animal","face","kitten","kitty","pet"],"shortcodes":["cat"]},{"emoji":"🐈️","label":"Cat","category":3,"version":0.7,"tags":["animal","animals","cats","kitten","pet"],"shortcodes":["cat2"]},{"emoji":"🐈‍⬛","label":"Black cat","category":3,"version":13,"tags":["animal","black","cat","feline","halloween","meow","unlucky"],"shortcodes":["black_cat"]},{"emoji":"🦁","label":"Lion","category":3,"version":1,"tags":["alpha","animal","face","leo","mane","order","rawr","roar","safari","strong","zodiac"],"shortcodes":["lion"]},{"emoji":"🐯","label":"Tiger face","category":3,"version":0.6,"tags":["animal","big","cat","face","predator"],"shortcodes":["tiger"]},{"emoji":"🐅","label":"Tiger","category":3,"version":1,"tags":["animal","big","cat","predator","zoo"],"shortcodes":["tiger2"]},{"emoji":"🐆","label":"Leopard","category":3,"version":1,"tags":["animal","big","cat","predator","zoo"],"shortcodes":["leopard"]},{"emoji":"🐴","label":"Horse face","category":3,"version":0.6,"tags":["animal","dressage","equine","face","farm","horses"],"shortcodes":["horse"]},{"emoji":"🫎","label":"Moose","category":3,"version":15,"tags":["alces","animal","antlers","elk","mammal"],"shortcodes":["moose"]},{"emoji":"🫏","label":"Donkey","category":3,"version":15,"tags":["animal","ass","burro","hinny","mammal","mule","stubborn"],"shortcodes":["donkey"]},{"emoji":"🐎","label":"Horse","category":3,"version":0.6,"tags":["animal","equestrian","farm","racing"],"shortcodes":["racehorse"]},{"emoji":"🦄","label":"Unicorn","category":3,"version":1,"tags":["face"],"shortcodes":["unicorn"]},{"emoji":"🦓","label":"Zebra","category":3,"version":5,"tags":["animal","stripe"],"shortcodes":["zebra"]},{"emoji":"🦌","label":"Deer","category":3,"version":3,"tags":["animal"],"shortcodes":["deer"]},{"emoji":"🦬","label":"Bison","category":3,"version":13,"tags":["animal","buffalo","herd","wisent"],"shortcodes":["bison"]},{"emoji":"🐮","label":"Cow face","category":3,"version":0.6,"tags":["animal","face","farm","milk","moo"],"shortcodes":["cow"]},{"emoji":"🐂","label":"Ox","category":3,"version":1,"tags":["animal","animals","bull","farm","taurus","zodiac"],"shortcodes":["ox"]},{"emoji":"🐃","label":"Water buffalo","category":3,"version":1,"tags":["animal","buffalo","water","zoo"],"shortcodes":["water_buffalo"]},{"emoji":"🐄","label":"Cow","category":3,"version":1,"tags":["animal","animals","farm","milk","moo"],"shortcodes":["cow2"]},{"emoji":"🐷","label":"Pig face","category":3,"version":0.6,"tags":["animal","bacon","face","farm","pork"],"shortcodes":["pig"]},{"emoji":"🐖","label":"Pig","category":3,"version":1,"tags":["animal","bacon","farm","pork","sow"],"shortcodes":["pig2"]},{"emoji":"🐗","label":"Boar","category":3,"version":0.6,"tags":["animal","pig"],"shortcodes":["boar"]},{"emoji":"🐽","label":"Pig nose","category":3,"version":0.6,"tags":["animal","face","farm","nose","pig","smell","snout"],"shortcodes":["pig_nose"]},{"emoji":"🐏","label":"Ram","category":3,"version":1,"tags":["animal","aries","horns","male","sheep","zodiac","zoo"],"shortcodes":["ram"]},{"emoji":"🐑","label":"Ewe","category":3,"version":0.6,"tags":["animal","baa","farm","female","fluffy","lamb","wool"],"shortcodes":["sheep"]},{"emoji":"🐐","label":"Goat","category":3,"version":1,"tags":["animal","capricorn","farm","milk","zodiac"],"shortcodes":["goat"]},{"emoji":"🐪","label":"Camel","category":3,"version":1,"tags":["animal","desert","dromedary","hump","one"],"shortcodes":["dromedary_camel"]},{"emoji":"🐫","label":"Two-hump camel","category":3,"version":0.6,"tags":["animal","bactrian","desert","hump","two","two-hump"],"shortcodes":["camel"]},{"emoji":"🦙","label":"Llama","category":3,"version":11,"tags":["alpaca","animal","guanaco","vicuña","wool"],"shortcodes":["llama"]},{"emoji":"🦒","label":"Giraffe","category":3,"version":5,"tags":["animal","spots"],"shortcodes":["giraffe"]},{"emoji":"🐘","label":"Elephant","category":3,"version":0.6,"tags":["animal"],"shortcodes":["elephant"]},{"emoji":"🦣","label":"Mammoth","category":3,"version":13,"tags":["animal","extinction","large","tusk","wooly"],"shortcodes":["mammoth"]},{"emoji":"🦏","label":"Rhinoceros","category":3,"version":3,"tags":["animal"],"shortcodes":["rhinoceros"]},{"emoji":"🦛","label":"Hippopotamus","category":3,"version":11,"tags":["animal","hippo"],"shortcodes":["hippopotamus"]},{"emoji":"🐭","label":"Mouse face","category":3,"version":0.6,"tags":["animal","face"],"shortcodes":["mouse"]},{"emoji":"🐁","label":"Mouse","category":3,"version":1,"tags":["animal","animals"],"shortcodes":["mouse2"]},{"emoji":"🐀","label":"Rat","category":3,"version":1,"tags":["animal"],"shortcodes":["rat"]},{"emoji":"🐹","label":"Hamster","category":3,"version":0.6,"tags":["animal","face","pet"],"shortcodes":["hamster"]},{"emoji":"🐰","label":"Rabbit face","category":3,"version":0.6,"tags":["animal","bunny","face","pet"],"shortcodes":["rabbit"]},{"emoji":"🐇","label":"Rabbit","category":3,"version":1,"tags":["animal","bunny","pet"],"shortcodes":["rabbit2"]},{"emoji":"🐿️","label":"Chipmunk","category":3,"version":0.7,"tags":["animal","squirrel"],"shortcodes":["chipmunk"]},{"emoji":"🦫","label":"Beaver","category":3,"version":13,"tags":["animal","dam","teeth"],"shortcodes":["beaver"]},{"emoji":"🦔","label":"Hedgehog","category":3,"version":5,"tags":["animal","spiny"],"shortcodes":["hedgehog"]},{"emoji":"🦇","label":"Bat","category":3,"version":3,"tags":["animal","vampire"],"shortcodes":["bat"]},{"emoji":"🐻","label":"Bear","category":3,"version":0.6,"tags":["animal","face","grizzly","growl","honey"],"shortcodes":["bear"]},{"emoji":"🐻‍❄️","label":"Polar bear","category":3,"version":13,"tags":["animal","arctic","bear","polar","white"],"shortcodes":["polar_bear"]},{"emoji":"🐨","label":"Koala","category":3,"version":0.6,"tags":["animal","australia","bear","down","face","marsupial","under"],"shortcodes":["koala"]},{"emoji":"🐼","label":"Panda","category":3,"version":0.6,"tags":["animal","bamboo","face"],"shortcodes":["panda_face"]},{"emoji":"🦥","label":"Sloth","category":3,"version":12,"tags":["lazy","slow"],"shortcodes":["sloth"]},{"emoji":"🦦","label":"Otter","category":3,"version":12,"tags":["animal","fishing","playful"],"shortcodes":["otter"]},{"emoji":"🦨","label":"Skunk","category":3,"version":12,"tags":["animal","stink"],"shortcodes":["skunk"]},{"emoji":"🦘","label":"Kangaroo","category":3,"version":11,"tags":["animal","joey","jump","marsupial"],"shortcodes":["kangaroo"]},{"emoji":"🦡","label":"Badger","category":3,"version":11,"tags":["animal","honey","pester"],"shortcodes":["badger"]},{"emoji":"🐾","label":"Paw prints","category":3,"version":0.6,"tags":["paw","paws","print","prints"],"shortcodes":["feet","paw_prints"]},{"emoji":"🦃","label":"Turkey","category":3,"version":1,"tags":["bird","gobble","thanksgiving"],"shortcodes":["turkey"]},{"emoji":"🐔","label":"Chicken","category":3,"version":0.6,"tags":["animal","bird","ornithology"],"shortcodes":["chicken"]},{"emoji":"🐓","label":"Rooster","category":3,"version":1,"tags":["animal","bird","ornithology"],"shortcodes":["rooster"]},{"emoji":"🐣","label":"Hatching chick","category":3,"version":0.6,"tags":["animal","baby","bird","chick","egg","hatching"],"shortcodes":["hatching_chick"]},{"emoji":"🐤","label":"Baby chick","category":3,"version":0.6,"tags":["animal","baby","bird","chick","ornithology"],"shortcodes":["baby_chick"]},{"emoji":"🐥","label":"Front-facing baby chick","category":3,"version":0.6,"tags":["animal","baby","bird","chick","front-facing","newborn","ornithology"],"shortcodes":["hatched_chick"]},{"emoji":"🐦️","label":"Bird","category":3,"version":0.6,"tags":["animal","ornithology"],"shortcodes":["bird"]},{"emoji":"🐧","label":"Penguin","category":3,"version":0.6,"tags":["animal","antarctica","bird","ornithology"],"shortcodes":["penguin"]},{"emoji":"🕊️","label":"Dove","category":3,"version":0.7,"tags":["bird","fly","ornithology","peace"],"shortcodes":["dove"]},{"emoji":"🦅","label":"Eagle","category":3,"version":3,"tags":["animal","bird","ornithology"],"shortcodes":["eagle"]},{"emoji":"🦆","label":"Duck","category":3,"version":3,"tags":["animal","bird","ornithology"],"shortcodes":["duck"]},{"emoji":"🦢","label":"Swan","category":3,"version":11,"tags":["animal","bird","cygnet","duckling","ornithology","ugly"],"shortcodes":["swan"]},{"emoji":"🦉","label":"Owl","category":3,"version":3,"tags":["animal","bird","ornithology","wise"],"shortcodes":["owl"]},{"emoji":"🦤","label":"Dodo","category":3,"version":13,"tags":["animal","bird","extinction","large","ornithology"],"shortcodes":["dodo"]},{"emoji":"🪶","label":"Feather","category":3,"version":13,"tags":["bird","flight","light","plumage"],"shortcodes":["feather"]},{"emoji":"🦩","label":"Flamingo","category":3,"version":12,"tags":["animal","bird","flamboyant","ornithology","tropical"],"shortcodes":["flamingo"]},{"emoji":"🦚","label":"Peacock","category":3,"version":11,"tags":["animal","bird","colorful","ornithology","ostentatious","peahen","pretty","proud"],"shortcodes":["peacock"]},{"emoji":"🦜","label":"Parrot","category":3,"version":11,"tags":["animal","bird","ornithology","pirate","talk"],"shortcodes":["parrot"]},{"emoji":"🪽","label":"Wing","category":3,"version":15,"tags":["angelic","ascend","aviation","bird","fly","flying","heavenly","mythology","soar"],"shortcodes":["wing"]},{"emoji":"🐦‍⬛","label":"Black bird","category":3,"version":15,"tags":["animal","beak","bird","black","caw","corvid","crow","ornithology","raven","rook"],"shortcodes":["black_bird"]},{"emoji":"🪿","label":"Goose","category":3,"version":15,"tags":["animal","bird","duck","flock","fowl","gaggle","gander","geese","honk","ornithology","silly"],"shortcodes":["goose"]},{"emoji":"🐦‍🔥","label":"Phoenix","category":3,"version":15.1,"tags":["ascend","ascension","emerge","fantasy","firebird","glory","immortal","rebirth","reincarnation","reinvent","renewal","revival","revive","rise","transform"],"shortcodes":[]},{"emoji":"🐸","label":"Frog","category":3,"version":0.6,"tags":["animal","face"],"shortcodes":["frog"]},{"emoji":"🐊","label":"Crocodile","category":3,"version":1,"tags":["animal","zoo"],"shortcodes":["crocodile"]},{"emoji":"🐢","label":"Turtle","category":3,"version":0.6,"tags":["animal","terrapin","tortoise"],"shortcodes":["turtle"]},{"emoji":"🦎","label":"Lizard","category":3,"version":3,"tags":["animal","reptile"],"shortcodes":["lizard"]},{"emoji":"🐍","label":"Snake","category":3,"version":0.6,"tags":["animal","bearer","ophiuchus","serpent","zodiac"],"shortcodes":["snake"]},{"emoji":"🐲","label":"Dragon face","category":3,"version":0.6,"tags":["animal","dragon","face","fairy","fairytale","tale"],"shortcodes":["dragon_face"]},{"emoji":"🐉","label":"Dragon","category":3,"version":1,"tags":["animal","fairy","fairytale","knights","tale"],"shortcodes":["dragon"]},{"emoji":"🦕","label":"Sauropod","category":3,"version":5,"tags":["brachiosaurus","brontosaurus","dinosaur","diplodocus"],"shortcodes":["sauropod"]},{"emoji":"🦖","label":"T-Rex","category":3,"version":5,"tags":["dinosaur","rex","t","tyrannosaurus"],"shortcodes":["t-rex"]},{"emoji":"🐳","label":"Spouting whale","category":3,"version":0.6,"tags":["animal","beach","face","ocean","spouting"],"shortcodes":["whale"]},{"emoji":"🐋","label":"Whale","category":3,"version":1,"tags":["animal","beach","ocean"],"shortcodes":["whale2"]},{"emoji":"🐬","label":"Dolphin","category":3,"version":0.6,"tags":["animal","beach","ocean"],"shortcodes":["dolphin","flipper"]},{"emoji":"🫍","label":"Orca","category":3,"version":17,"tags":["marine","ocean","whale"],"shortcodes":[]},{"emoji":"🦭","label":"Seal","category":3,"version":13,"tags":["animal","lion","ocean","sea"],"shortcodes":["seal"]},{"emoji":"🐟️","label":"Fish","category":3,"version":0.6,"tags":["animal","dinner","fishes","fishing","pisces","zodiac"],"shortcodes":["fish"]},{"emoji":"🐠","label":"Tropical fish","category":3,"version":0.6,"tags":["animal","fish","fishes","tropical"],"shortcodes":["tropical_fish"]},{"emoji":"🐡","label":"Blowfish","category":3,"version":0.6,"tags":["animal","fish"],"shortcodes":["blowfish"]},{"emoji":"🦈","label":"Shark","category":3,"version":3,"tags":["animal","fish"],"shortcodes":["shark"]},{"emoji":"🐙","label":"Octopus","category":3,"version":0.6,"tags":["animal","creature","ocean"],"shortcodes":["octopus"]},{"emoji":"🐚","label":"Spiral shell","category":3,"version":0.6,"tags":["animal","beach","conch","sea","spiral"],"shortcodes":["shell"]},{"emoji":"🪸","label":"Coral","category":3,"version":14,"tags":["change","climate","ocean","reef","sea"],"shortcodes":["coral"]},{"emoji":"🪼","label":"Jellyfish","category":3,"version":15,"tags":["animal","aquarium","burn","invertebrate","jelly","life","marine","ocean","ouch","plankton","sea","sting","stinger","tentacles"],"shortcodes":["jellyfish"]},{"emoji":"🦀","label":"Crab","category":3,"version":1,"tags":["cancer","zodiac"],"shortcodes":["crab"]},{"emoji":"🦞","label":"Lobster","category":3,"version":11,"tags":["animal","bisque","claws","seafood"],"shortcodes":["lobster"]},{"emoji":"🦐","label":"Shrimp","category":3,"version":3,"tags":["food","shellfish","small"],"shortcodes":["shrimp"]},{"emoji":"🦑","label":"Squid","category":3,"version":3,"tags":["animal","food","mollusk"],"shortcodes":["squid"]},{"emoji":"🦪","label":"Oyster","category":3,"version":12,"tags":["diving","pearl"],"shortcodes":["oyster"]},{"emoji":"🐌","label":"Snail","category":3,"version":0.6,"tags":["animal","escargot","garden","nature","slug"],"shortcodes":["snail"]},{"emoji":"🦋","label":"Butterfly","category":3,"version":3,"tags":["insect","pretty"],"shortcodes":["butterfly"]},{"emoji":"🐛","label":"Bug","category":3,"version":0.6,"tags":["animal","garden","insect"],"shortcodes":["bug"]},{"emoji":"🐜","label":"Ant","category":3,"version":0.6,"tags":["animal","garden","insect"],"shortcodes":["ant"]},{"emoji":"🐝","label":"Honeybee","category":3,"version":0.6,"tags":["animal","bumblebee","honey","insect","nature","spring"],"shortcodes":["bee","honeybee"]},{"emoji":"🪲","label":"Beetle","category":3,"version":13,"tags":["animal","bug","insect"],"shortcodes":["beetle"]},{"emoji":"🐞","label":"Lady beetle","category":3,"version":0.6,"tags":["animal","beetle","garden","insect","lady","ladybird","ladybug","nature"],"shortcodes":["lady_beetle"]},{"emoji":"🦗","label":"Cricket","category":3,"version":5,"tags":["animal","bug","grasshopper","insect","orthoptera"],"shortcodes":["cricket"]},{"emoji":"🪳","label":"Cockroach","category":3,"version":13,"tags":["animal","insect","pest","roach"],"shortcodes":["cockroach"]},{"emoji":"🕷️","label":"Spider","category":3,"version":0.7,"tags":["animal","insect"],"shortcodes":["spider"]},{"emoji":"🕸️","label":"Spider web","category":3,"version":0.7,"tags":["spider","web"],"shortcodes":["spider_web"]},{"emoji":"🦂","label":"Scorpion","category":3,"version":1,"tags":["scorpio","scorpius","zodiac"],"shortcodes":["scorpion"]},{"emoji":"🦟","label":"Mosquito","category":3,"version":11,"tags":["bite","disease","fever","insect","malaria","pest","virus"],"shortcodes":["mosquito"]},{"emoji":"🪰","label":"Fly","category":3,"version":13,"tags":["animal","disease","insect","maggot","pest","rotting"],"shortcodes":["fly"]},{"emoji":"🪱","label":"Worm","category":3,"version":13,"tags":["animal","annelid","earthworm","parasite"],"shortcodes":["worm"]},{"emoji":"🦠","label":"Microbe","category":3,"version":11,"tags":["amoeba","bacteria","science","virus"],"shortcodes":["microbe"]},{"emoji":"💐","label":"Bouquet","category":3,"version":0.6,"tags":["anniversary","birthday","date","flower","love","plant","romance"],"shortcodes":["bouquet"]},{"emoji":"🌸","label":"Cherry blossom","category":3,"version":0.6,"tags":["blossom","cherry","flower","plant","spring","springtime"],"shortcodes":["cherry_blossom"]},{"emoji":"💮","label":"White flower","category":3,"version":0.6,"tags":["flower","white"],"shortcodes":["white_flower"]},{"emoji":"🪷","label":"Lotus","category":3,"version":14,"tags":["beauty","buddhism","calm","flower","hinduism","peace","purity","serenity"],"shortcodes":["lotus"]},{"emoji":"🏵️","label":"Rosette","category":3,"version":0.7,"tags":["plant"],"shortcodes":["rosette"]},{"emoji":"🌹","label":"Rose","category":3,"version":0.6,"tags":["beauty","elegant","flower","love","plant","red","valentine"],"shortcodes":["rose"]},{"emoji":"🥀","label":"Wilted flower","category":3,"version":3,"tags":["dying","flower","wilted"],"shortcodes":["wilted_flower"]},{"emoji":"🌺","label":"Hibiscus","category":3,"version":0.6,"tags":["flower","plant"],"shortcodes":["hibiscus"]},{"emoji":"🌻","label":"Sunflower","category":3,"version":0.6,"tags":["flower","outdoors","plant","sun"],"shortcodes":["sunflower"]},{"emoji":"🌼","label":"Blossom","category":3,"version":0.6,"tags":["buttercup","dandelion","flower","plant"],"shortcodes":["blossom"]},{"emoji":"🌷","label":"Tulip","category":3,"version":0.6,"tags":["blossom","flower","growth","plant"],"shortcodes":["tulip"]},{"emoji":"🪻","label":"Hyacinth","category":3,"version":15,"tags":["bloom","bluebonnet","flower","indigo","lavender","lilac","lupine","plant","purple","shrub","snapdragon","spring","violet"],"shortcodes":["hyacinth"]},{"emoji":"🌱","label":"Seedling","category":3,"version":0.6,"tags":["plant","sapling","sprout","young"],"shortcodes":["seedling"]},{"emoji":"🪴","label":"Potted plant","category":3,"version":13,"tags":["decor","grow","house","nurturing","plant","pot","potted"],"shortcodes":["potted_plant"]},{"emoji":"🌲","label":"Evergreen tree","category":3,"version":1,"tags":["christmas","evergreen","forest","pine","tree"],"shortcodes":["evergreen_tree"]},{"emoji":"🌳","label":"Deciduous tree","category":3,"version":1,"tags":["deciduous","forest","green","habitat","shedding","tree"],"shortcodes":["deciduous_tree"]},{"emoji":"🌴","label":"Palm tree","category":3,"version":0.6,"tags":["beach","palm","plant","tree","tropical"],"shortcodes":["palm_tree"]},{"emoji":"🌵","label":"Cactus","category":3,"version":0.6,"tags":["desert","drought","nature","plant"],"shortcodes":["cactus"]},{"emoji":"🌾","label":"Sheaf of rice","category":3,"version":0.6,"tags":["ear","grain","grains","plant","rice","sheaf"],"shortcodes":["ear_of_rice"]},{"emoji":"🌿","label":"Herb","category":3,"version":0.6,"tags":["leaf","plant"],"shortcodes":["herb"]},{"emoji":"☘️","label":"Shamrock","category":3,"version":1,"tags":["irish","plant"],"shortcodes":["shamrock"]},{"emoji":"🍀","label":"Four leaf clover","category":3,"version":0.6,"tags":["4","clover","four","four-leaf","irish","leaf","lucky","plant"],"shortcodes":["four_leaf_clover"]},{"emoji":"🍁","label":"Maple leaf","category":3,"version":0.6,"tags":["falling","leaf","maple"],"shortcodes":["maple_leaf"]},{"emoji":"🍂","label":"Fallen leaf","category":3,"version":0.6,"tags":["autumn","fall","fallen","falling","leaf"],"shortcodes":["fallen_leaf"]},{"emoji":"🍃","label":"Leaf fluttering in wind","category":3,"version":0.6,"tags":["blow","flutter","fluttering","leaf","wind"],"shortcodes":["leaves"]},{"emoji":"🪹","label":"Empty nest","category":3,"version":14,"tags":["branch","empty","home","nest","nesting"],"shortcodes":["empty_nest"]},{"emoji":"🪺","label":"Nest with eggs","category":3,"version":14,"tags":["bird","branch","egg","eggs","nest","nesting"],"shortcodes":["nest_with_eggs"]},{"emoji":"🍄","label":"Mushroom","category":3,"version":0.6,"tags":["fungus","toadstool"],"shortcodes":["mushroom"]},{"emoji":"🪾","label":"Leafless tree","category":3,"version":16,"tags":["bare","barren","branches","dead","drought","leafless","tree","trunk","winter","wood"],"shortcodes":[]},{"emoji":"🍇","label":"Grapes","category":4,"version":0.6,"tags":["dionysus","fruit","grape"],"shortcodes":["grapes"]},{"emoji":"🍈","label":"Melon","category":4,"version":0.6,"tags":["cantaloupe","fruit"],"shortcodes":["melon"]},{"emoji":"🍉","label":"Watermelon","category":4,"version":0.6,"tags":["fruit"],"shortcodes":["watermelon"]},{"emoji":"🍊","label":"Tangerine","category":4,"version":0.6,"tags":["c","citrus","fruit","nectarine","vitamin"],"shortcodes":["mandarin","orange","tangerine"]},{"emoji":"🍋","label":"Lemon","category":4,"version":1,"tags":["citrus","fruit","sour"],"shortcodes":["lemon"]},{"emoji":"🍋‍🟩","label":"Lime","category":4,"version":15.1,"tags":["acidity","citrus","cocktail","fruit","garnish","key","margarita","mojito","refreshing","salsa","sour","tangy","tequila","tropical","zest"],"shortcodes":[]},{"emoji":"🍌","label":"Banana","category":4,"version":0.6,"tags":["fruit","potassium"],"shortcodes":["banana"]},{"emoji":"🍍","label":"Pineapple","category":4,"version":0.6,"tags":["colada","fruit","pina","tropical"],"shortcodes":["pineapple"]},{"emoji":"🥭","label":"Mango","category":4,"version":11,"tags":["food","fruit","tropical"],"shortcodes":["mango"]},{"emoji":"🍎","label":"Red apple","category":4,"version":0.6,"tags":["diet","food","fruit","health","red","ripe"],"shortcodes":["apple"]},{"emoji":"🍏","label":"Green apple","category":4,"version":0.6,"tags":["apple","fruit","green"],"shortcodes":["green_apple"]},{"emoji":"🍐","label":"Pear","category":4,"version":1,"tags":["fruit"],"shortcodes":["pear"]},{"emoji":"🍑","label":"Peach","category":4,"version":0.6,"tags":["fruit"],"shortcodes":["peach"]},{"emoji":"🍒","label":"Cherries","category":4,"version":0.6,"tags":["berries","cherry","fruit","red"],"shortcodes":["cherries"]},{"emoji":"🍓","label":"Strawberry","category":4,"version":0.6,"tags":["berry","fruit"],"shortcodes":["strawberry"]},{"emoji":"🫐","label":"Blueberries","category":4,"version":13,"tags":["berries","berry","bilberry","blue","blueberry","food","fruit"],"shortcodes":["blueberries"]},{"emoji":"🥝","label":"Kiwi fruit","category":4,"version":3,"tags":["food","fruit","kiwi"],"shortcodes":["kiwi_fruit"]},{"emoji":"🍅","label":"Tomato","category":4,"version":0.6,"tags":["food","fruit","vegetable"],"shortcodes":["tomato"]},{"emoji":"🫒","label":"Olive","category":4,"version":13,"tags":["food"],"shortcodes":["olive"]},{"emoji":"🥥","label":"Coconut","category":4,"version":5,"tags":["colada","palm","piña"],"shortcodes":["coconut"]},{"emoji":"🥑","label":"Avocado","category":4,"version":3,"tags":["food","fruit"],"shortcodes":["avocado"]},{"emoji":"🍆","label":"Eggplant","category":4,"version":0.6,"tags":["aubergine","vegetable"],"shortcodes":["eggplant"]},{"emoji":"🥔","label":"Potato","category":4,"version":3,"tags":["food","vegetable"],"shortcodes":["potato"]},{"emoji":"🥕","label":"Carrot","category":4,"version":3,"tags":["food","vegetable"],"shortcodes":["carrot"]},{"emoji":"🌽","label":"Ear of corn","category":4,"version":0.6,"tags":["crops","ear","farm","maize","maze"],"shortcodes":["corn"]},{"emoji":"🌶️","label":"Hot pepper","category":4,"version":0.7,"tags":["hot","pepper"],"shortcodes":["hot_pepper"]},{"emoji":"🫑","label":"Bell pepper","category":4,"version":13,"tags":["bell","capsicum","food","pepper","vegetable"],"shortcodes":["bell_pepper"]},{"emoji":"🥒","label":"Cucumber","category":4,"version":3,"tags":["food","pickle","vegetable"],"shortcodes":["cucumber"]},{"emoji":"🥬","label":"Leafy green","category":4,"version":11,"tags":["bok","burgers","cabbage","choy","green","kale","leafy","lettuce","salad"],"shortcodes":["leafy_green"]},{"emoji":"🥦","label":"Broccoli","category":4,"version":5,"tags":["cabbage","wild"],"shortcodes":["broccoli"]},{"emoji":"🧄","label":"Garlic","category":4,"version":12,"tags":["flavoring"],"shortcodes":["garlic"]},{"emoji":"🧅","label":"Onion","category":4,"version":12,"tags":["flavoring"],"shortcodes":["onion"]},{"emoji":"🥜","label":"Peanuts","category":4,"version":3,"tags":["food","nut","peanut","vegetable"],"shortcodes":["peanuts"]},{"emoji":"🫘","label":"Beans","category":4,"version":14,"tags":["food","kidney","legume","small"],"shortcodes":["beans"]},{"emoji":"🌰","label":"Chestnut","category":4,"version":0.6,"tags":["almond","plant"],"shortcodes":["chestnut"]},{"emoji":"🫚","label":"Ginger root","category":4,"version":15,"tags":["beer","ginger","health","herb","natural","root","spice"],"shortcodes":["ginger_root"]},{"emoji":"🫛","label":"Pea pod","category":4,"version":15,"tags":["beans","beanstalk","edamame","legume","pea","pod","soybean","vegetable","veggie"],"shortcodes":["pea_pod"]},{"emoji":"🍄‍🟫","label":"Brown mushroom","category":4,"version":15.1,"tags":["food","fungi","fungus","mushroom","nature","pizza","portobello","shiitake","shroom","spore","sprout","toppings","truffle","vegetable","vegetarian","veggie"],"shortcodes":[]},{"emoji":"🫜","label":"Root vegetable","category":4,"version":16,"tags":["beet","food","garden","radish","root","salad","turnip","vegetable","vegetarian"],"shortcodes":[]},{"emoji":"🍞","label":"Bread","category":4,"version":0.6,"tags":["carbs","food","grain","loaf","restaurant","toast","wheat"],"shortcodes":["bread"]},{"emoji":"🥐","label":"Croissant","category":4,"version":3,"tags":["bread","breakfast","crescent","food","french","roll"],"shortcodes":["croissant"]},{"emoji":"🥖","label":"Baguette bread","category":4,"version":3,"tags":["baguette","bread","food","french"],"shortcodes":["baguette_bread"]},{"emoji":"🫓","label":"Flatbread","category":4,"version":13,"tags":["arepa","bread","food","gordita","lavash","naan","pita"],"shortcodes":["flatbread"]},{"emoji":"🥨","label":"Pretzel","category":4,"version":5,"tags":["convoluted","twisted"],"shortcodes":["pretzel"]},{"emoji":"🥯","label":"Bagel","category":4,"version":11,"tags":["bakery","bread","breakfast","schmear"],"shortcodes":["bagel"]},{"emoji":"🥞","label":"Pancakes","category":4,"version":3,"tags":["breakfast","crêpe","food","hotcake","pancake"],"shortcodes":["pancakes"]},{"emoji":"🧇","label":"Waffle","category":4,"version":12,"tags":["breakfast","indecisive","iron"],"shortcodes":["waffle"]},{"emoji":"🧀","label":"Cheese wedge","category":4,"version":1,"tags":["wedge"],"shortcodes":["cheese"]},{"emoji":"🍖","label":"Meat on bone","category":4,"version":0.6,"tags":["bone","meat"],"shortcodes":["meat_on_bone"]},{"emoji":"🍗","label":"Poultry leg","category":4,"version":0.6,"tags":["bone","chicken","drumstick","hungry","leg","poultry","turkey"],"shortcodes":["poultry_leg"]},{"emoji":"🥩","label":"Cut of meat","category":4,"version":5,"tags":["chop","cut","lambchop","meat","porkchop","red","steak"],"shortcodes":["cut_of_meat"]},{"emoji":"🥓","label":"Bacon","category":4,"version":3,"tags":["breakfast","food","meat"],"shortcodes":["bacon"]},{"emoji":"🍔","label":"Hamburger","category":4,"version":0.6,"tags":["burger","eat","fast","food","hungry"],"shortcodes":["hamburger"]},{"emoji":"🍟","label":"French fries","category":4,"version":0.6,"tags":["fast","food","french"],"shortcodes":["fries"]},{"emoji":"🍕","label":"Pizza","category":4,"version":0.6,"tags":["cheese","food","hungry","pepperoni","slice"],"shortcodes":["pizza"]},{"emoji":"🌭","label":"Hot dog","category":4,"version":1,"tags":["dog","frankfurter","hot","sausage"],"shortcodes":["hotdog"]},{"emoji":"🥪","label":"Sandwich","category":4,"version":5,"tags":["bread"],"shortcodes":["sandwich"]},{"emoji":"🌮","label":"Taco","category":4,"version":1,"tags":["mexican"],"shortcodes":["taco"]},{"emoji":"🌯","label":"Burrito","category":4,"version":1,"tags":["mexican","wrap"],"shortcodes":["burrito"]},{"emoji":"🫔","label":"Tamale","category":4,"version":13,"tags":["food","mexican","pamonha","wrapped"],"shortcodes":["tamale"]},{"emoji":"🥙","label":"Stuffed flatbread","category":4,"version":3,"tags":["falafel","flatbread","food","gyro","kebab","stuffed"],"shortcodes":["stuffed_flatbread"]},{"emoji":"🧆","label":"Falafel","category":4,"version":12,"tags":["chickpea","meatball"],"shortcodes":["falafel"]},{"emoji":"🥚","label":"Egg","category":4,"version":3,"tags":["breakfast","food"],"shortcodes":["egg"]},{"emoji":"🍳","label":"Cooking","category":4,"version":0.6,"tags":["breakfast","easy","egg","fry","frying","over","pan","restaurant","side","sunny","up"],"shortcodes":["fried_egg"]},{"emoji":"🥘","label":"Shallow pan of food","category":4,"version":3,"tags":["casserole","food","paella","pan","shallow"],"shortcodes":["shallow_pan_of_food"]},{"emoji":"🍲","label":"Pot of food","category":4,"version":0.6,"tags":["food","pot","soup"],"shortcodes":["stew"]},{"emoji":"🫕","label":"Fondue","category":4,"version":13,"tags":["cheese","chocolate","food","melted","pot","ski"],"shortcodes":["fondue"]},{"emoji":"🥣","label":"Bowl with spoon","category":4,"version":5,"tags":["bowl","breakfast","cereal","congee","oatmeal","porridge","spoon"],"shortcodes":["bowl_with_spoon"]},{"emoji":"🥗","label":"Green salad","category":4,"version":3,"tags":["food","green","salad"],"shortcodes":["green_salad"]},{"emoji":"🍿","label":"Popcorn","category":4,"version":1,"tags":["corn","movie","pop"],"shortcodes":["popcorn"]},{"emoji":"🧈","label":"Butter","category":4,"version":12,"tags":["dairy"],"shortcodes":["butter"]},{"emoji":"🧂","label":"Salt","category":4,"version":11,"tags":["condiment","flavor","mad","salty","shaker","taste","upset"],"shortcodes":["salt"]},{"emoji":"🥫","label":"Canned food","category":4,"version":5,"tags":["can","canned","food"],"shortcodes":["canned_food"]},{"emoji":"🍱","label":"Bento box","category":4,"version":0.6,"tags":["box","food"],"shortcodes":["bento"]},{"emoji":"🍘","label":"Rice cracker","category":4,"version":0.6,"tags":["cracker","food","rice"],"shortcodes":["rice_cracker"]},{"emoji":"🍙","label":"Rice ball","category":4,"version":0.6,"tags":["ball","food","japanese","rice"],"shortcodes":["rice_ball"]},{"emoji":"🍚","label":"Cooked rice","category":4,"version":0.6,"tags":["cooked","food"],"shortcodes":["rice"]},{"emoji":"🍛","label":"Curry rice","category":4,"version":0.6,"tags":["food","rice"],"shortcodes":["curry"]},{"emoji":"🍜","label":"Steaming bowl","category":4,"version":0.6,"tags":["bowl","chopsticks","food","noodle","pho","soup","steaming"],"shortcodes":["ramen"]},{"emoji":"🍝","label":"Spaghetti","category":4,"version":0.6,"tags":["food","meatballs","pasta","restaurant"],"shortcodes":["spaghetti"]},{"emoji":"🍠","label":"Roasted sweet potato","category":4,"version":0.6,"tags":["food","potato","roasted","sweet"],"shortcodes":["sweet_potato"]},{"emoji":"🍢","label":"Oden","category":4,"version":0.6,"tags":["food","kebab","restaurant","seafood","skewer","stick"],"shortcodes":["oden"]},{"emoji":"🍣","label":"Sushi","category":4,"version":0.6,"tags":["food"],"shortcodes":["sushi"]},{"emoji":"🍤","label":"Fried shrimp","category":4,"version":0.6,"tags":["fried","prawn","shrimp","tempura"],"shortcodes":["fried_shrimp"]},{"emoji":"🍥","label":"Fish cake with swirl","category":4,"version":0.6,"tags":["cake","fish","food","pastry","restaurant","swirl"],"shortcodes":["fish_cake"]},{"emoji":"🥮","label":"Moon cake","category":4,"version":11,"tags":["autumn","cake","festival","moon","yuèbǐng"],"shortcodes":["moon_cake"]},{"emoji":"🍡","label":"Dango","category":4,"version":0.6,"tags":["dessert","japanese","skewer","stick","sweet"],"shortcodes":["dango"]},{"emoji":"🥟","label":"Dumpling","category":4,"version":5,"tags":["empanada","gyōza","jiaozi","pierogi","potsticker"],"shortcodes":["dumpling"]},{"emoji":"🥠","label":"Fortune cookie","category":4,"version":5,"tags":["cookie","fortune","prophecy"],"shortcodes":["fortune_cookie"]},{"emoji":"🥡","label":"Takeout box","category":4,"version":5,"tags":["box","chopsticks","delivery","food","oyster","pail","takeout"],"shortcodes":["takeout_box"]},{"emoji":"🍦","label":"Soft ice cream","category":4,"version":0.6,"tags":["cream","dessert","food","ice","restaurant","serve","soft","sweet"],"shortcodes":["icecream"]},{"emoji":"🍧","label":"Shaved ice","category":4,"version":0.6,"tags":["dessert","ice","restaurant","shaved","sweet"],"shortcodes":["shaved_ice"]},{"emoji":"🍨","label":"Ice cream","category":4,"version":0.6,"tags":["cream","dessert","food","ice","restaurant","sweet"],"shortcodes":["ice_cream"]},{"emoji":"🍩","label":"Doughnut","category":4,"version":0.6,"tags":["breakfast","dessert","donut","food","sweet"],"shortcodes":["doughnut"]},{"emoji":"🍪","label":"Cookie","category":4,"version":0.6,"tags":["chip","chocolate","dessert","sweet"],"shortcodes":["cookie"]},{"emoji":"🎂","label":"Birthday cake","category":4,"version":0.6,"tags":["bday","cake","celebration","dessert","happy","pastry","sweet"],"shortcodes":["birthday"]},{"emoji":"🍰","label":"Shortcake","category":4,"version":0.6,"tags":["dessert","pastry","slice","sweet"],"shortcodes":["cake"]},{"emoji":"🧁","label":"Cupcake","category":4,"version":11,"tags":["bakery","dessert","sprinkles","sugar","sweet","treat"],"shortcodes":["cupcake"]},{"emoji":"🥧","label":"Pie","category":4,"version":5,"tags":["apple","filling","fruit","meat","pastry","pumpkin","slice"],"shortcodes":["pie"]},{"emoji":"🍫","label":"Chocolate bar","category":4,"version":0.6,"tags":["bar","candy","chocolate","dessert","halloween","sweet","tooth"],"shortcodes":["chocolate_bar"]},{"emoji":"🍬","label":"Candy","category":4,"version":0.6,"tags":["cavities","dessert","halloween","restaurant","sweet","tooth","wrapper"],"shortcodes":["candy"]},{"emoji":"🍭","label":"Lollipop","category":4,"version":0.6,"tags":["candy","dessert","food","restaurant","sweet"],"shortcodes":["lollipop"]},{"emoji":"🍮","label":"Custard","category":4,"version":0.6,"tags":["dessert","pudding","sweet"],"shortcodes":["custard"]},{"emoji":"🍯","label":"Honey pot","category":4,"version":0.6,"tags":["barrel","bear","food","honey","honeypot","jar","pot","sweet"],"shortcodes":["honey_pot"]},{"emoji":"🍼","label":"Baby bottle","category":4,"version":1,"tags":["babies","baby","birth","born","bottle","drink","infant","milk","newborn"],"shortcodes":["baby_bottle"]},{"emoji":"🥛","label":"Glass of milk","category":4,"version":3,"tags":["drink","glass","milk"],"shortcodes":["milk_glass"]},{"emoji":"☕️","label":"Hot beverage","category":4,"version":0.6,"tags":["beverage","cafe","caffeine","chai","drink","hot","morning","steaming","tea"],"shortcodes":["coffee"]},{"emoji":"🫖","label":"Teapot","category":4,"version":13,"tags":["brew","drink","food","pot","tea"],"shortcodes":["teapot"]},{"emoji":"🍵","label":"Teacup without handle","category":4,"version":0.6,"tags":["beverage","cup","drink","handle","oolong","teacup"],"shortcodes":["tea"]},{"emoji":"🍶","label":"Sake","category":4,"version":0.6,"tags":["bar","beverage","bottle","cup","drink","restaurant"],"shortcodes":["sake"]},{"emoji":"🍾","label":"Bottle with popping cork","category":4,"version":1,"tags":["bar","bottle","cork","drink","popping"],"shortcodes":["champagne"]},{"emoji":"🍷","label":"Wine glass","category":4,"version":0.6,"tags":["alcohol","bar","beverage","booze","club","drink","drinking","drinks","glass","restaurant","wine"],"shortcodes":["wine_glass"]},{"emoji":"🍸️","label":"Cocktail glass","category":4,"version":0.6,"tags":["alcohol","bar","booze","club","drink","drinking","drinks","glass","mad","martini","men"],"shortcodes":["cocktail"]},{"emoji":"🍹","label":"Tropical drink","category":4,"version":0.6,"tags":["alcohol","bar","booze","club","cocktail","drink","drinking","drinks","drunk","mai","party","tai","tropical","tropics"],"shortcodes":["tropical_drink"]},{"emoji":"🍺","label":"Beer mug","category":4,"version":0.6,"tags":["alcohol","ale","bar","booze","drink","drinking","drinks","mug","octoberfest","oktoberfest","pint","stein","summer"],"shortcodes":["beer"]},{"emoji":"🍻","label":"Clinking beer mugs","category":4,"version":0.6,"tags":["alcohol","bar","beer","booze","bottoms","cheers","clink","clinking","drinking","drinks","mugs"],"shortcodes":["beers"]},{"emoji":"🥂","label":"Clinking glasses","category":4,"version":3,"tags":["celebrate","clink","clinking","drink","glass","glasses"],"shortcodes":["clinking_glasses"]},{"emoji":"🥃","label":"Tumbler glass","category":4,"version":3,"tags":["glass","liquor","scotch","shot","tumbler","whiskey","whisky"],"shortcodes":["tumbler_glass"]},{"emoji":"🫗","label":"Pouring liquid","category":4,"version":14,"tags":["accident","drink","empty","glass","liquid","oops","pour","pouring","spill","water"],"shortcodes":["pouring_liquid"]},{"emoji":"🥤","label":"Cup with straw","category":4,"version":5,"tags":["cup","drink","juice","malt","soda","soft","straw","water"],"shortcodes":["cup_with_straw"]},{"emoji":"🧋","label":"Bubble tea","category":4,"version":13,"tags":["boba","bubble","food","milk","pearl","tea"],"shortcodes":["bubble_tea"]},{"emoji":"🧃","label":"Beverage box","category":4,"version":12,"tags":["beverage","box","juice","straw","sweet"],"shortcodes":["beverage_box"]},{"emoji":"🧉","label":"Mate","category":4,"version":12,"tags":["drink"],"shortcodes":["mate"]},{"emoji":"🧊","label":"Ice","category":4,"version":12,"tags":["cold","cube","iceberg"],"shortcodes":["ice_cube"]},{"emoji":"🥢","label":"Chopsticks","category":4,"version":5,"tags":["hashi","jeotgarak","kuaizi"],"shortcodes":["chopsticks"]},{"emoji":"🍽️","label":"Fork and knife with plate","category":4,"version":0.7,"tags":["cooking","dinner","eat","fork","knife","plate"],"shortcodes":["plate_with_cutlery"]},{"emoji":"🍴","label":"Fork and knife","category":4,"version":0.6,"tags":["breakfast","breaky","cooking","cutlery","delicious","dinner","eat","feed","food","fork","hungry","knife","lunch","restaurant","yum","yummy"],"shortcodes":["fork_and_knife"]},{"emoji":"🥄","label":"Spoon","category":4,"version":3,"tags":["eat","tableware"],"shortcodes":["spoon"]},{"emoji":"🔪","label":"Kitchen knife","category":4,"version":0.6,"tags":["chef","cooking","kitchen","tool","weapon"],"shortcodes":["hocho","knife"]},{"emoji":"🫙","label":"Jar","category":4,"version":14,"tags":["condiment","container","empty","nothing","sauce","store"],"shortcodes":["jar"]},{"emoji":"🏺","label":"Amphora","category":4,"version":1,"tags":["aquarius","cooking","drink","jug","tool","weapon","zodiac"],"shortcodes":["amphora"]},{"emoji":"🌍️","label":"Globe showing Europe-Africa","category":5,"version":0.7,"tags":["africa","earth","europe","europe-africa","globe","showing","world"],"shortcodes":["earth_africa"]},{"emoji":"🌎️","label":"Globe showing Americas","category":5,"version":0.7,"tags":["americas","earth","globe","showing","world"],"shortcodes":["earth_americas"]},{"emoji":"🌏️","label":"Globe showing Asia-Australia","category":5,"version":0.6,"tags":["asia","asia-australia","australia","earth","globe","showing","world"],"shortcodes":["earth_asia"]},{"emoji":"🌐","label":"Globe with meridians","category":5,"version":1,"tags":["earth","globe","internet","meridians","web","world","worldwide"],"shortcodes":["globe_with_meridians"]},{"emoji":"🗺️","label":"World map","category":5,"version":0.7,"tags":["map","world"],"shortcodes":["world_map"]},{"emoji":"🗾","label":"Map of Japan","category":5,"version":0.6,"tags":["map"],"shortcodes":["japan"]},{"emoji":"🧭","label":"Compass","category":5,"version":11,"tags":["direction","magnetic","navigation","orienteering"],"shortcodes":["compass"]},{"emoji":"🏔️","label":"Snow-capped mountain","category":5,"version":0.7,"tags":["cold","mountain","snow","snow-capped"],"shortcodes":["mountain_snow"]},{"emoji":"⛰️","label":"Mountain","category":5,"version":0.7,"tags":[],"shortcodes":["mountain"]},{"emoji":"🛘","label":"Landslide","category":5,"version":17,"tags":["avalanche","danger","disaster","earthquake","mountain","mudslide","rocks"],"shortcodes":[]},{"emoji":"🌋","label":"Volcano","category":5,"version":0.6,"tags":["eruption","mountain","nature"],"shortcodes":["volcano"]},{"emoji":"🗻","label":"Mount fuji","category":5,"version":0.6,"tags":["fuji","mount","mountain","nature"],"shortcodes":["mount_fuji"]},{"emoji":"🏕️","label":"Camping","category":5,"version":0.7,"tags":[],"shortcodes":["camping"]},{"emoji":"🏖️","label":"Beach with umbrella","category":5,"version":0.7,"tags":["beach","umbrella"],"shortcodes":["beach_umbrella"]},{"emoji":"🏜️","label":"Desert","category":5,"version":0.7,"tags":[],"shortcodes":["desert"]},{"emoji":"🏝️","label":"Desert island","category":5,"version":0.7,"tags":["desert","island"],"shortcodes":["desert_island"]},{"emoji":"🏞️","label":"National park","category":5,"version":0.7,"tags":["national","park"],"shortcodes":["national_park"]},{"emoji":"🏟️","label":"Stadium","category":5,"version":0.7,"tags":[],"shortcodes":["stadium"]},{"emoji":"🏛️","label":"Classical building","category":5,"version":0.7,"tags":["building","classical"],"shortcodes":["classical_building"]},{"emoji":"🏗️","label":"Building construction","category":5,"version":0.7,"tags":["building","construction","crane"],"shortcodes":["building_construction"]},{"emoji":"🧱","label":"Brick","category":5,"version":11,"tags":["clay","mortar","wall"],"shortcodes":["bricks"]},{"emoji":"🪨","label":"Rock","category":5,"version":13,"tags":["boulder","heavy","solid","stone","tough"],"shortcodes":["rock"]},{"emoji":"🪵","label":"Wood","category":5,"version":13,"tags":["log","lumber","timber"],"shortcodes":["wood"]},{"emoji":"🛖","label":"Hut","category":5,"version":13,"tags":["home","house","roundhouse","shelter","yurt"],"shortcodes":["hut"]},{"emoji":"🏘️","label":"Houses","category":5,"version":0.7,"tags":["house"],"shortcodes":["houses"]},{"emoji":"🏚️","label":"Derelict house","category":5,"version":0.7,"tags":["derelict","home","house"],"shortcodes":["derelict_house"]},{"emoji":"🏠️","label":"House","category":5,"version":0.6,"tags":["building","country","heart","home","ranch","settle","simple","suburban","suburbia","where"],"shortcodes":["house"]},{"emoji":"🏡","label":"House with garden","category":5,"version":0.6,"tags":["building","country","garden","heart","home","house","ranch","settle","simple","suburban","suburbia","where"],"shortcodes":["house_with_garden"]},{"emoji":"🏢","label":"Office building","category":5,"version":0.6,"tags":["building","city","cubical","job"],"shortcodes":["office"]},{"emoji":"🏣","label":"Japanese post office","category":5,"version":0.6,"tags":["building","japanese","office","post"],"shortcodes":["post_office"]},{"emoji":"🏤","label":"Post office","category":5,"version":1,"tags":["building","european","office","post"],"shortcodes":["european_post_office"]},{"emoji":"🏥","label":"Hospital","category":5,"version":0.6,"tags":["building","doctor","medicine"],"shortcodes":["hospital"]},{"emoji":"🏦","label":"Bank","category":5,"version":0.6,"tags":["building"],"shortcodes":["bank"]},{"emoji":"🏨","label":"Hotel","category":5,"version":0.6,"tags":["building"],"shortcodes":["hotel"]},{"emoji":"🏩","label":"Love hotel","category":5,"version":0.6,"tags":["building","hotel","love"],"shortcodes":["love_hotel"]},{"emoji":"🏪","label":"Convenience store","category":5,"version":0.6,"tags":["24","building","convenience","hours","store"],"shortcodes":["convenience_store"]},{"emoji":"🏫","label":"School","category":5,"version":0.6,"tags":["building"],"shortcodes":["school"]},{"emoji":"🏬","label":"Department store","category":5,"version":0.6,"tags":["building","department","store"],"shortcodes":["department_store"]},{"emoji":"🏭️","label":"Factory","category":5,"version":0.6,"tags":["building"],"shortcodes":["factory"]},{"emoji":"🏯","label":"Japanese castle","category":5,"version":0.6,"tags":["building","castle","japanese"],"shortcodes":["japanese_castle"]},{"emoji":"🏰","label":"Castle","category":5,"version":0.6,"tags":["building","european"],"shortcodes":["european_castle"]},{"emoji":"💒","label":"Wedding","category":5,"version":0.6,"tags":["chapel","hitched","nuptials","romance"],"shortcodes":["wedding"]},{"emoji":"🗼","label":"Tokyo tower","category":5,"version":0.6,"tags":["tokyo","tower"],"shortcodes":["tokyo_tower"]},{"emoji":"🗽","label":"Statue of Liberty","category":5,"version":0.6,"tags":["liberty","new","ny","nyc","statue","york"],"shortcodes":["statue_of_liberty"]},{"emoji":"⛪️","label":"Church","category":5,"version":0.6,"tags":["bless","chapel","christian","cross","religion"],"shortcodes":["church"]},{"emoji":"🕌","label":"Mosque","category":5,"version":1,"tags":["islam","masjid","muslim","religion"],"shortcodes":["mosque"]},{"emoji":"🛕","label":"Hindu temple","category":5,"version":12,"tags":["hindu","temple"],"shortcodes":["hindu_temple"]},{"emoji":"🕍","label":"Synagogue","category":5,"version":1,"tags":["jew","jewish","judaism","religion","temple"],"shortcodes":["synagogue"]},{"emoji":"⛩️","label":"Shinto shrine","category":5,"version":0.7,"tags":["religion","shinto","shrine"],"shortcodes":["shinto_shrine"]},{"emoji":"🕋","label":"Kaaba","category":5,"version":1,"tags":["hajj","islam","muslim","religion","umrah"],"shortcodes":["kaaba"]},{"emoji":"⛲️","label":"Fountain","category":5,"version":0.6,"tags":[],"shortcodes":["fountain"]},{"emoji":"⛺️","label":"Tent","category":5,"version":0.6,"tags":["camping"],"shortcodes":["tent"]},{"emoji":"🌁","label":"Foggy","category":5,"version":0.6,"tags":["fog"],"shortcodes":["foggy"]},{"emoji":"🌃","label":"Night with stars","category":5,"version":0.6,"tags":["night","star","stars"],"shortcodes":["night_with_stars"]},{"emoji":"🏙️","label":"Cityscape","category":5,"version":0.7,"tags":["city"],"shortcodes":["cityscape"]},{"emoji":"🌄","label":"Sunrise over mountains","category":5,"version":0.6,"tags":["morning","mountains","over","sun","sunrise"],"shortcodes":["sunrise_over_mountains"]},{"emoji":"🌅","label":"Sunrise","category":5,"version":0.6,"tags":["morning","nature","sun"],"shortcodes":["sunrise"]},{"emoji":"🌆","label":"Cityscape at dusk","category":5,"version":0.6,"tags":["at","building","city","cityscape","dusk","evening","landscape","sun","sunset"],"shortcodes":["city_sunset"]},{"emoji":"🌇","label":"Sunset","category":5,"version":0.6,"tags":["building","dusk","sun"],"shortcodes":["city_sunrise"]},{"emoji":"🌉","label":"Bridge at night","category":5,"version":0.6,"tags":["at","bridge","night"],"shortcodes":["bridge_at_night"]},{"emoji":"♨️","label":"Hot springs","category":5,"version":0.6,"tags":["hot","springs","steaming"],"shortcodes":["hotsprings"]},{"emoji":"🎠","label":"Carousel horse","category":5,"version":0.6,"tags":["carousel","entertainment","horse"],"shortcodes":["carousel_horse"]},{"emoji":"🛝","label":"Playground slide","category":5,"version":14,"tags":["amusement","park","play","playground","playing","slide","sliding","theme"],"shortcodes":["playground_slide"]},{"emoji":"🎡","label":"Ferris wheel","category":5,"version":0.6,"tags":["amusement","ferris","park","theme","wheel"],"shortcodes":["ferris_wheel"]},{"emoji":"🎢","label":"Roller coaster","category":5,"version":0.6,"tags":["amusement","coaster","park","roller","theme"],"shortcodes":["roller_coaster"]},{"emoji":"💈","label":"Barber pole","category":5,"version":0.6,"tags":["cut","fresh","haircut","pole","shave"],"shortcodes":["barber"]},{"emoji":"🎪","label":"Circus tent","category":5,"version":0.6,"tags":["circus","tent"],"shortcodes":["circus_tent"]},{"emoji":"🚂","label":"Locomotive","category":5,"version":1,"tags":["caboose","engine","railway","steam","train","trains","travel"],"shortcodes":["steam_locomotive"]},{"emoji":"🚃","label":"Railway car","category":5,"version":0.6,"tags":["car","electric","railway","train","tram","travel","trolleybus"],"shortcodes":["railway_car"]},{"emoji":"🚄","label":"High-speed train","category":5,"version":0.6,"tags":["high-speed","railway","shinkansen","speed","train"],"shortcodes":["bullettrain_side"]},{"emoji":"🚅","label":"Bullet train","category":5,"version":0.6,"tags":["bullet","high-speed","nose","railway","shinkansen","speed","train","travel"],"shortcodes":["bullettrain_front"]},{"emoji":"🚆","label":"Train","category":5,"version":1,"tags":["arrived","choo","railway"],"shortcodes":["train2"]},{"emoji":"🚇️","label":"Metro","category":5,"version":0.6,"tags":["subway","travel"],"shortcodes":["metro"]},{"emoji":"🚈","label":"Light rail","category":5,"version":1,"tags":["arrived","light","monorail","rail","railway"],"shortcodes":["light_rail"]},{"emoji":"🚉","label":"Station","category":5,"version":0.6,"tags":["railway","train"],"shortcodes":["station"]},{"emoji":"🚊","label":"Tram","category":5,"version":1,"tags":["trolleybus"],"shortcodes":["tram"]},{"emoji":"🚝","label":"Monorail","category":5,"version":1,"tags":["vehicle"],"shortcodes":["monorail"]},{"emoji":"🚞","label":"Mountain railway","category":5,"version":1,"tags":["car","mountain","railway","trip"],"shortcodes":["mountain_railway"]},{"emoji":"🚋","label":"Tram car","category":5,"version":1,"tags":["bus","car","tram","trolley","trolleybus"],"shortcodes":["train"]},{"emoji":"🚌","label":"Bus","category":5,"version":0.6,"tags":["school","vehicle"],"shortcodes":["bus"]},{"emoji":"🚍️","label":"Oncoming bus","category":5,"version":0.7,"tags":["bus","cars","oncoming"],"shortcodes":["oncoming_bus"]},{"emoji":"🚎","label":"Trolleybus","category":5,"version":1,"tags":["bus","tram","trolley"],"shortcodes":["trolleybus"]},{"emoji":"🚐","label":"Minibus","category":5,"version":1,"tags":["bus","drive","van","vehicle"],"shortcodes":["minibus"]},{"emoji":"🚑️","label":"Ambulance","category":5,"version":0.6,"tags":["emergency","vehicle"],"shortcodes":["ambulance"]},{"emoji":"🚒","label":"Fire engine","category":5,"version":0.6,"tags":["engine","fire","truck"],"shortcodes":["fire_engine"]},{"emoji":"🚓","label":"Police car","category":5,"version":0.6,"tags":["5–0","car","cops","patrol","police"],"shortcodes":["police_car"]},{"emoji":"🚔️","label":"Oncoming police car","category":5,"version":0.7,"tags":["car","oncoming","police"],"shortcodes":["oncoming_police_car"]},{"emoji":"🚕","label":"Taxi","category":5,"version":0.6,"tags":["cab","cabbie","car","drive","vehicle","yellow"],"shortcodes":["taxi"]},{"emoji":"🚖","label":"Oncoming taxi","category":5,"version":1,"tags":["cab","cabbie","cars","drove","hail","oncoming","taxi","yellow"],"shortcodes":["oncoming_taxi"]},{"emoji":"🚗","label":"Automobile","category":5,"version":0.6,"tags":["driving","vehicle"],"shortcodes":["car","red_car"]},{"emoji":"🚘️","label":"Oncoming automobile","category":5,"version":0.7,"tags":["automobile","car","cars","drove","oncoming","vehicle"],"shortcodes":["oncoming_automobile"]},{"emoji":"🚙","label":"Sport utility vehicle","category":5,"version":0.6,"tags":["car","drive","recreational","sport","sportutility","utility","vehicle"],"shortcodes":["blue_car"]},{"emoji":"🛻","label":"Pickup truck","category":5,"version":13,"tags":["automobile","car","flatbed","pick-up","pickup","transportation","truck"],"shortcodes":["pickup_truck"]},{"emoji":"🚚","label":"Delivery truck","category":5,"version":0.6,"tags":["car","delivery","drive","vehicle"],"shortcodes":["truck"]},{"emoji":"🚛","label":"Articulated lorry","category":5,"version":1,"tags":["articulated","car","drive","lorry","move","semi","truck","vehicle"],"shortcodes":["articulated_lorry"]},{"emoji":"🚜","label":"Tractor","category":5,"version":1,"tags":["vehicle"],"shortcodes":["tractor"]},{"emoji":"🏎️","label":"Racing car","category":5,"version":0.7,"tags":["car","racing","zoom"],"shortcodes":["racing_car"]},{"emoji":"🏍️","label":"Motorcycle","category":5,"version":0.7,"tags":["racing"],"shortcodes":["motorcycle"]},{"emoji":"🛵","label":"Motor scooter","category":5,"version":3,"tags":["motor","scooter"],"shortcodes":["motor_scooter"]},{"emoji":"🦽","label":"Manual wheelchair","category":5,"version":12,"tags":["accessibility","manual","wheelchair"],"shortcodes":["manual_wheelchair"]},{"emoji":"🦼","label":"Motorized wheelchair","category":5,"version":12,"tags":["accessibility","motorized","wheelchair"],"shortcodes":["motorized_wheelchair"]},{"emoji":"🛺","label":"Auto rickshaw","category":5,"version":12,"tags":["auto","rickshaw","tuk"],"shortcodes":["auto_rickshaw"]},{"emoji":"🚲️","label":"Bicycle","category":5,"version":0.6,"tags":["class","cycle","cycling","cyclist","gang","ride","spin","spinning"],"shortcodes":["bike"]},{"emoji":"🛴","label":"Kick scooter","category":5,"version":3,"tags":["kick","scooter"],"shortcodes":["kick_scooter"]},{"emoji":"🛹","label":"Skateboard","category":5,"version":11,"tags":["board","skate","skater","wheels"],"shortcodes":["skateboard"]},{"emoji":"🛼","label":"Roller skate","category":5,"version":13,"tags":["blades","roller","skate","skates","sport"],"shortcodes":["roller_skate"]},{"emoji":"🚏","label":"Bus stop","category":5,"version":0.6,"tags":["bus","stop"],"shortcodes":["busstop"]},{"emoji":"🛣️","label":"Motorway","category":5,"version":0.7,"tags":["highway","road"],"shortcodes":["motorway"]},{"emoji":"🛤️","label":"Railway track","category":5,"version":0.7,"tags":["railway","track","train"],"shortcodes":["railway_track"]},{"emoji":"🛢️","label":"Oil drum","category":5,"version":0.7,"tags":["drum","oil"],"shortcodes":["oil_drum"]},{"emoji":"⛽️","label":"Fuel pump","category":5,"version":0.6,"tags":["diesel","fuel","gas","gasoline","pump","station"],"shortcodes":["fuelpump"]},{"emoji":"🛞","label":"Wheel","category":5,"version":14,"tags":["car","circle","tire","turn","vehicle"],"shortcodes":["wheel"]},{"emoji":"🚨","label":"Police car light","category":5,"version":0.6,"tags":["alarm","alert","beacon","car","emergency","light","police","revolving","siren"],"shortcodes":["rotating_light"]},{"emoji":"🚥","label":"Horizontal traffic light","category":5,"version":0.6,"tags":["horizontal","intersection","light","signal","stop","stoplight","traffic"],"shortcodes":["traffic_light"]},{"emoji":"🚦","label":"Vertical traffic light","category":5,"version":1,"tags":["drove","intersection","light","signal","stop","stoplight","traffic","vertical"],"shortcodes":["vertical_traffic_light"]},{"emoji":"🛑","label":"Stop sign","category":5,"version":3,"tags":["octagonal","sign","stop"],"shortcodes":["stop_sign"]},{"emoji":"🚧","label":"Construction","category":5,"version":0.6,"tags":["barrier"],"shortcodes":["construction"]},{"emoji":"⚓️","label":"Anchor","category":5,"version":0.6,"tags":["ship","tool"],"shortcodes":["anchor"]},{"emoji":"🛟","label":"Ring buoy","category":5,"version":14,"tags":["buoy","float","life","lifesaver","preserver","rescue","ring","safety","save","saver","swim"],"shortcodes":["ring_buoy"]},{"emoji":"⛵️","label":"Sailboat","category":5,"version":0.6,"tags":["resort","sailing","sea","yacht"],"shortcodes":["boat","sailboat"]},{"emoji":"🛶","label":"Canoe","category":5,"version":3,"tags":["boat"],"shortcodes":["canoe"]},{"emoji":"🚤","label":"Speedboat","category":5,"version":0.6,"tags":["billionaire","boat","lake","luxury","millionaire","summer","travel"],"shortcodes":["speedboat"]},{"emoji":"🛳️","label":"Passenger ship","category":5,"version":0.7,"tags":["passenger","ship"],"shortcodes":["passenger_ship"]},{"emoji":"⛴️","label":"Ferry","category":5,"version":0.7,"tags":["boat","passenger"],"shortcodes":["ferry"]},{"emoji":"🛥️","label":"Motor boat","category":5,"version":0.7,"tags":["boat","motor","motorboat"],"shortcodes":["motor_boat"]},{"emoji":"🚢","label":"Ship","category":5,"version":0.6,"tags":["boat","passenger","travel"],"shortcodes":["ship"]},{"emoji":"✈️","label":"Airplane","category":5,"version":0.6,"tags":["aeroplane","fly","flying","jet","plane","travel"],"shortcodes":["airplane"]},{"emoji":"🛩️","label":"Small airplane","category":5,"version":0.7,"tags":["aeroplane","airplane","plane","small"],"shortcodes":["small_airplane"]},{"emoji":"🛫","label":"Airplane departure","category":5,"version":1,"tags":["aeroplane","airplane","check-in","departure","departures","plane"],"shortcodes":["flight_departure"]},{"emoji":"🛬","label":"Airplane arrival","category":5,"version":1,"tags":["aeroplane","airplane","arrival","arrivals","arriving","landing","plane"],"shortcodes":["flight_arrival"]},{"emoji":"🪂","label":"Parachute","category":5,"version":12,"tags":["hang-glide","parasail","skydive"],"shortcodes":["parachute"]},{"emoji":"💺","label":"Seat","category":5,"version":0.6,"tags":["chair"],"shortcodes":["seat"]},{"emoji":"🚁","label":"Helicopter","category":5,"version":1,"tags":["copter","roflcopter","travel","vehicle"],"shortcodes":["helicopter"]},{"emoji":"🚟","label":"Suspension railway","category":5,"version":1,"tags":["railway","suspension"],"shortcodes":["suspension_railway"]},{"emoji":"🚠","label":"Mountain cableway","category":5,"version":1,"tags":["cable","cableway","gondola","lift","mountain","ski"],"shortcodes":["mountain_cableway"]},{"emoji":"🚡","label":"Aerial tramway","category":5,"version":1,"tags":["aerial","cable","car","gondola","ropeway","tramway"],"shortcodes":["aerial_tramway"]},{"emoji":"🛰️","label":"Satellite","category":5,"version":0.7,"tags":["space"],"shortcodes":["artificial_satellite"]},{"emoji":"🚀","label":"Rocket","category":5,"version":0.6,"tags":["launch","rockets","space","travel"],"shortcodes":["rocket"]},{"emoji":"🛸","label":"Flying saucer","category":5,"version":5,"tags":["aliens","extra","flying","saucer","terrestrial","ufo"],"shortcodes":["flying_saucer"]},{"emoji":"🛎️","label":"Bellhop bell","category":5,"version":0.7,"tags":["bell","bellhop","hotel"],"shortcodes":["bellhop_bell"]},{"emoji":"🧳","label":"Luggage","category":5,"version":11,"tags":["bag","packing","roller","suitcase","travel"],"shortcodes":["luggage"]},{"emoji":"⌛️","label":"Hourglass done","category":5,"version":0.6,"tags":["done","sand","time","timer"],"shortcodes":["hourglass"]},{"emoji":"⏳️","label":"Hourglass not done","category":5,"version":0.6,"tags":["done","flowing","hourglass","hours","not","sand","timer","waiting","yolo"],"shortcodes":["hourglass_flowing_sand"]},{"emoji":"⌚️","label":"Watch","category":5,"version":0.6,"tags":["clock","time"],"shortcodes":["watch"]},{"emoji":"⏰️","label":"Alarm clock","category":5,"version":0.6,"tags":["alarm","clock","hours","hrs","late","time","waiting"],"shortcodes":["alarm_clock"]},{"emoji":"⏱️","label":"Stopwatch","category":5,"version":1,"tags":["clock","time"],"shortcodes":["stopwatch"]},{"emoji":"⏲️","label":"Timer clock","category":5,"version":1,"tags":["clock","timer"],"shortcodes":["timer_clock"]},{"emoji":"🕰️","label":"Mantelpiece clock","category":5,"version":0.7,"tags":["clock","mantelpiece","time"],"shortcodes":["mantelpiece_clock"]},{"emoji":"🕛️","label":"Twelve o’clock","category":5,"version":0.6,"tags":["12","12:00","clock","o’clock","time","twelve"],"shortcodes":["clock12"]},{"emoji":"🕧️","label":"Twelve-thirty","category":5,"version":0.7,"tags":["12","12:30","30","clock","thirty","time","twelve"],"shortcodes":["clock1230"]},{"emoji":"🕐️","label":"One o’clock","category":5,"version":0.6,"tags":["1","1:00","clock","one","o’clock","time"],"shortcodes":["clock1"]},{"emoji":"🕜️","label":"One-thirty","category":5,"version":0.7,"tags":["1","1:30","30","clock","one","thirty","time"],"shortcodes":["clock130"]},{"emoji":"🕑️","label":"Two o’clock","category":5,"version":0.6,"tags":["2","2:00","clock","o’clock","time","two"],"shortcodes":["clock2"]},{"emoji":"🕝️","label":"Two-thirty","category":5,"version":0.7,"tags":["2","2:30","30","clock","thirty","time","two"],"shortcodes":["clock230"]},{"emoji":"🕒️","label":"Three o’clock","category":5,"version":0.6,"tags":["3","3:00","clock","o’clock","three","time"],"shortcodes":["clock3"]},{"emoji":"🕞️","label":"Three-thirty","category":5,"version":0.7,"tags":["3","30","3:30","clock","thirty","three","time"],"shortcodes":["clock330"]},{"emoji":"🕓️","label":"Four o’clock","category":5,"version":0.6,"tags":["4","4:00","clock","four","o’clock","time"],"shortcodes":["clock4"]},{"emoji":"🕟️","label":"Four-thirty","category":5,"version":0.7,"tags":["30","4","4:30","clock","four","thirty","time"],"shortcodes":["clock430"]},{"emoji":"🕔️","label":"Five o’clock","category":5,"version":0.6,"tags":["5","5:00","clock","five","o’clock","time"],"shortcodes":["clock5"]},{"emoji":"🕠️","label":"Five-thirty","category":5,"version":0.7,"tags":["30","5","5:30","clock","five","thirty","time"],"shortcodes":["clock530"]},{"emoji":"🕕️","label":"Six o’clock","category":5,"version":0.6,"tags":["6","6:00","clock","o’clock","six","time"],"shortcodes":["clock6"]},{"emoji":"🕡️","label":"Six-thirty","category":5,"version":0.7,"tags":["30","6","6:30","clock","six","thirty"],"shortcodes":["clock630"]},{"emoji":"🕖️","label":"Seven o’clock","category":5,"version":0.6,"tags":["0","7","7:00","clock","o’clock","seven"],"shortcodes":["clock7"]},{"emoji":"🕢️","label":"Seven-thirty","category":5,"version":0.7,"tags":["30","7","7:30","clock","seven","thirty"],"shortcodes":["clock730"]},{"emoji":"🕗️","label":"Eight o’clock","category":5,"version":0.6,"tags":["8","8:00","clock","eight","o’clock","time"],"shortcodes":["clock8"]},{"emoji":"🕣️","label":"Eight-thirty","category":5,"version":0.7,"tags":["30","8","8:30","clock","eight","thirty","time"],"shortcodes":["clock830"]},{"emoji":"🕘️","label":"Nine o’clock","category":5,"version":0.6,"tags":["9","9:00","clock","nine","o’clock","time"],"shortcodes":["clock9"]},{"emoji":"🕤️","label":"Nine-thirty","category":5,"version":0.7,"tags":["30","9","9:30","clock","nine","thirty","time"],"shortcodes":["clock930"]},{"emoji":"🕙️","label":"Ten o’clock","category":5,"version":0.6,"tags":["0","10","10:00","clock","o’clock","ten"],"shortcodes":["clock10"]},{"emoji":"🕥️","label":"Ten-thirty","category":5,"version":0.7,"tags":["10","10:30","30","clock","ten","thirty","time"],"shortcodes":["clock1030"]},{"emoji":"🕚️","label":"Eleven o’clock","category":5,"version":0.6,"tags":["11","11:00","clock","eleven","o’clock","time"],"shortcodes":["clock11"]},{"emoji":"🕦️","label":"Eleven-thirty","category":5,"version":0.7,"tags":["11","11:30","30","clock","eleven","thirty","time"],"shortcodes":["clock1130"]},{"emoji":"🌑","label":"New moon","category":5,"version":0.6,"tags":["dark","moon","new","space"],"shortcodes":["new_moon"]},{"emoji":"🌒","label":"Waxing crescent moon","category":5,"version":1,"tags":["crescent","dreams","moon","space","waxing"],"shortcodes":["waxing_crescent_moon"]},{"emoji":"🌓","label":"First quarter moon","category":5,"version":0.6,"tags":["first","moon","quarter","space"],"shortcodes":["first_quarter_moon"]},{"emoji":"🌔","label":"Waxing gibbous moon","category":5,"version":0.6,"tags":["gibbous","space","waxing"],"shortcodes":["moon","waxing_gibbous_moon"]},{"emoji":"🌕️","label":"Full moon","category":5,"version":0.6,"tags":["full","moon","space"],"shortcodes":["full_moon"]},{"emoji":"🌖","label":"Waning gibbous moon","category":5,"version":1,"tags":["gibbous","moon","space","waning"],"shortcodes":["waning_gibbous_moon"]},{"emoji":"🌗","label":"Last quarter moon","category":5,"version":1,"tags":["last","moon","quarter","space"],"shortcodes":["last_quarter_moon"]},{"emoji":"🌘","label":"Waning crescent moon","category":5,"version":1,"tags":["crescent","moon","space","waning"],"shortcodes":["waning_crescent_moon"]},{"emoji":"🌙","label":"Crescent moon","category":5,"version":0.6,"tags":["crescent","moon","ramadan","space"],"shortcodes":["crescent_moon"]},{"emoji":"🌚","label":"New moon face","category":5,"version":1,"tags":["face","moon","new","space"],"shortcodes":["new_moon_with_face"]},{"emoji":"🌛","label":"First quarter moon face","category":5,"version":0.6,"tags":["face","first","moon","quarter","space"],"shortcodes":["first_quarter_moon_with_face"]},{"emoji":"🌜️","label":"Last quarter moon face","category":5,"version":0.7,"tags":["dreams","face","last","moon","quarter"],"shortcodes":["last_quarter_moon_with_face"]},{"emoji":"🌡️","label":"Thermometer","category":5,"version":0.7,"tags":["weather"],"shortcodes":["thermometer"]},{"emoji":"☀️","label":"Sun","category":5,"version":0.6,"tags":["bright","rays","space","weather"],"shortcodes":["sunny"]},{"emoji":"🌝","label":"Full moon face","category":5,"version":1,"tags":["bright","face","full","moon"],"shortcodes":["full_moon_with_face"]},{"emoji":"🌞","label":"Sun with face","category":5,"version":1,"tags":["beach","bright","day","face","heat","shine","sun","sunny","sunshine","weather"],"shortcodes":["sun_with_face"]},{"emoji":"🪐","label":"Ringed planet","category":5,"version":12,"tags":["planet","ringed","saturn","saturnine"],"shortcodes":["ringed_planet"]},{"emoji":"⭐️","label":"Star","category":5,"version":0.6,"tags":["astronomy","medium","stars","white"],"shortcodes":["star"]},{"emoji":"🌟","label":"Glowing star","category":5,"version":0.6,"tags":["glittery","glow","glowing","night","shining","sparkle","star","win"],"shortcodes":["star2"]},{"emoji":"🌠","label":"Shooting star","category":5,"version":0.6,"tags":["falling","night","shooting","space","star"],"shortcodes":["stars"]},{"emoji":"🌌","label":"Milky way","category":5,"version":0.6,"tags":["milky","space","way"],"shortcodes":["milky_way"]},{"emoji":"☁️","label":"Cloud","category":5,"version":0.6,"tags":["weather"],"shortcodes":["cloud"]},{"emoji":"⛅️","label":"Sun behind cloud","category":5,"version":0.6,"tags":["behind","cloud","cloudy","sun","weather"],"shortcodes":["partly_sunny"]},{"emoji":"⛈️","label":"Cloud with lightning and rain","category":5,"version":0.7,"tags":["cloud","lightning","rain","thunder","thunderstorm"],"shortcodes":["cloud_with_lightning_and_rain"]},{"emoji":"🌤️","label":"Sun behind small cloud","category":5,"version":0.7,"tags":["behind","cloud","sun","weather"],"shortcodes":["sun_behind_small_cloud"]},{"emoji":"🌥️","label":"Sun behind large cloud","category":5,"version":0.7,"tags":["behind","cloud","sun","weather"],"shortcodes":["sun_behind_large_cloud"]},{"emoji":"🌦️","label":"Sun behind rain cloud","category":5,"version":0.7,"tags":["behind","cloud","rain","sun","weather"],"shortcodes":["sun_behind_rain_cloud"]},{"emoji":"🌧️","label":"Cloud with rain","category":5,"version":0.7,"tags":["cloud","rain","weather"],"shortcodes":["cloud_with_rain"]},{"emoji":"🌨️","label":"Cloud with snow","category":5,"version":0.7,"tags":["cloud","cold","snow","weather"],"shortcodes":["cloud_with_snow"]},{"emoji":"🌩️","label":"Cloud with lightning","category":5,"version":0.7,"tags":["cloud","lightning","weather"],"shortcodes":["cloud_with_lightning"]},{"emoji":"🌪️","label":"Tornado","category":5,"version":0.7,"tags":["cloud","weather","whirlwind"],"shortcodes":["tornado"]},{"emoji":"🌫️","label":"Fog","category":5,"version":0.7,"tags":["cloud","weather"],"shortcodes":["fog"]},{"emoji":"🌬️","label":"Wind face","category":5,"version":0.7,"tags":["blow","cloud","face","wind"],"shortcodes":["wind_face"]},{"emoji":"🌀","label":"Cyclone","category":5,"version":0.6,"tags":["dizzy","hurricane","twister","typhoon","weather"],"shortcodes":["cyclone"]},{"emoji":"🌈","label":"Rainbow","category":5,"version":0.6,"tags":["gay","genderqueer","glbt","glbtq","lesbian","lgbt","lgbtq","lgbtqia","nature","pride","queer","rain","trans","transgender","weather"],"shortcodes":["rainbow"]},{"emoji":"🌂","label":"Closed umbrella","category":5,"version":0.6,"tags":["closed","clothing","rain","umbrella"],"shortcodes":["closed_umbrella"]},{"emoji":"☂️","label":"Umbrella","category":5,"version":0.7,"tags":["clothing","rain"],"shortcodes":["open_umbrella"]},{"emoji":"☔️","label":"Umbrella with rain drops","category":5,"version":0.6,"tags":["clothing","drop","drops","rain","weather"],"shortcodes":["umbrella"]},{"emoji":"⛱️","label":"Umbrella on ground","category":5,"version":0.7,"tags":["ground","rain","sun","umbrella"],"shortcodes":["parasol_on_ground"]},{"emoji":"⚡️","label":"High voltage","category":5,"version":0.6,"tags":["danger","electric","electricity","high","lightning","nature","thunder","thunderbolt","voltage"],"shortcodes":["zap"]},{"emoji":"❄️","label":"Snowflake","category":5,"version":0.6,"tags":["cold","snow","weather"],"shortcodes":["snowflake"]},{"emoji":"☃️","label":"Snowman","category":5,"version":0.7,"tags":["cold","man","snow"],"shortcodes":["snowman_with_snow"]},{"emoji":"⛄️","label":"Snowman without snow","category":5,"version":0.6,"tags":["cold","man","snow"],"shortcodes":["snowman"]},{"emoji":"☄️","label":"Comet","category":5,"version":1,"tags":["space"],"shortcodes":["comet"]},{"emoji":"🔥","label":"Fire","category":5,"version":0.6,"tags":["af","burn","flame","hot","lit","litaf","tool"],"shortcodes":["fire"]},{"emoji":"💧","label":"Droplet","category":5,"version":0.6,"tags":["cold","comic","drop","nature","sad","sweat","tear","water","weather"],"shortcodes":["droplet"]},{"emoji":"🌊","label":"Water wave","category":5,"version":0.6,"tags":["nature","surf","surfer","surfing","water","wave"],"shortcodes":["ocean"]},{"emoji":"🎃","label":"Jack-o-lantern","category":6,"version":0.6,"tags":["celebration","halloween","jack","lantern","pumpkin"],"shortcodes":["jack_o_lantern"]},{"emoji":"🎄","label":"Christmas tree","category":6,"version":0.6,"tags":["celebration","christmas","tree"],"shortcodes":["christmas_tree"]},{"emoji":"🎆","label":"Fireworks","category":6,"version":0.6,"tags":["boom","celebration","entertainment","yolo"],"shortcodes":["fireworks"]},{"emoji":"🎇","label":"Sparkler","category":6,"version":0.6,"tags":["boom","celebration","fireworks","sparkle"],"shortcodes":["sparkler"]},{"emoji":"🧨","label":"Firecracker","category":6,"version":11,"tags":["dynamite","explosive","fire","fireworks","light","pop","popping","spark"],"shortcodes":["firecracker"]},{"emoji":"✨️","label":"Sparkles","category":6,"version":0.6,"tags":["*","magic","sparkle","star"],"shortcodes":["sparkles"]},{"emoji":"🎈","label":"Balloon","category":6,"version":0.6,"tags":["birthday","celebrate","celebration"],"shortcodes":["balloon"]},{"emoji":"🎉","label":"Party popper","category":6,"version":0.6,"tags":["awesome","birthday","celebrate","celebration","excited","hooray","party","popper","woohoo"],"shortcodes":["tada"]},{"emoji":"🎊","label":"Confetti ball","category":6,"version":0.6,"tags":["ball","celebrate","celebration","confetti","party","woohoo"],"shortcodes":["confetti_ball"]},{"emoji":"🎋","label":"Tanabata tree","category":6,"version":0.6,"tags":["banner","celebration","japanese","tanabata","tree"],"shortcodes":["tanabata_tree"]},{"emoji":"🎍","label":"Pine decoration","category":6,"version":0.6,"tags":["celebration","decoration","japanese","pine","plant"],"shortcodes":["bamboo"]},{"emoji":"🎎","label":"Japanese dolls","category":6,"version":0.6,"tags":["celebration","doll","festival","japanese"],"shortcodes":["dolls"]},{"emoji":"🎏","label":"Carp streamer","category":6,"version":0.6,"tags":["carp","celebration","streamer"],"shortcodes":["flags"]},{"emoji":"🎐","label":"Wind chime","category":6,"version":0.6,"tags":["bell","celebration","chime","wind"],"shortcodes":["wind_chime"]},{"emoji":"🎑","label":"Moon viewing ceremony","category":6,"version":0.6,"tags":["celebration","ceremony","moon","viewing"],"shortcodes":["rice_scene"]},{"emoji":"🧧","label":"Red envelope","category":6,"version":11,"tags":["envelope","gift","good","hóngbāo","lai","luck","money","red","see"],"shortcodes":["red_envelope"]},{"emoji":"🎀","label":"Ribbon","category":6,"version":0.6,"tags":["celebration"],"shortcodes":["ribbon"]},{"emoji":"🎁","label":"Wrapped gift","category":6,"version":0.6,"tags":["birthday","bow","box","celebration","christmas","present","surprise","wrapped"],"shortcodes":["gift"]},{"emoji":"🎗️","label":"Reminder ribbon","category":6,"version":0.7,"tags":["celebration","reminder","ribbon"],"shortcodes":["reminder_ribbon"]},{"emoji":"🎟️","label":"Admission tickets","category":6,"version":0.7,"tags":["admission","ticket"],"shortcodes":["tickets"]},{"emoji":"🎫","label":"Ticket","category":6,"version":0.6,"tags":["admission","stub"],"shortcodes":["ticket"]},{"emoji":"🎖️","label":"Military medal","category":6,"version":0.7,"tags":["award","celebration","medal","military"],"shortcodes":["medal_military"]},{"emoji":"🏆️","label":"Trophy","category":6,"version":0.6,"tags":["champion","champs","prize","slay","sport","victory","win","winning"],"shortcodes":["trophy"]},{"emoji":"🏅","label":"Sports medal","category":6,"version":1,"tags":["award","gold","medal","sports","winner"],"shortcodes":["medal_sports"]},{"emoji":"🥇","label":"1st place medal","category":6,"version":3,"tags":["1st","first","gold","medal","place"],"shortcodes":["1st_place_medal"]},{"emoji":"🥈","label":"2nd place medal","category":6,"version":3,"tags":["2nd","medal","place","second","silver"],"shortcodes":["2nd_place_medal"]},{"emoji":"🥉","label":"3rd place medal","category":6,"version":3,"tags":["3rd","bronze","medal","place","third"],"shortcodes":["3rd_place_medal"]},{"emoji":"⚽️","label":"Soccer ball","category":6,"version":0.6,"tags":["ball","football","futbol","sport"],"shortcodes":["soccer"]},{"emoji":"⚾️","label":"Baseball","category":6,"version":0.6,"tags":["ball","sport"],"shortcodes":["baseball"]},{"emoji":"🥎","label":"Softball","category":6,"version":11,"tags":["ball","glove","sports","underarm"],"shortcodes":["softball"]},{"emoji":"🏀","label":"Basketball","category":6,"version":0.6,"tags":["ball","hoop","sport"],"shortcodes":["basketball"]},{"emoji":"🏐","label":"Volleyball","category":6,"version":1,"tags":["ball","game"],"shortcodes":["volleyball"]},{"emoji":"🏈","label":"American football","category":6,"version":0.6,"tags":["american","ball","bowl","sport","super"],"shortcodes":["football"]},{"emoji":"🏉","label":"Rugby football","category":6,"version":1,"tags":["ball","football","rugby","sport"],"shortcodes":["rugby_football"]},{"emoji":"🎾","label":"Tennis","category":6,"version":0.6,"tags":["ball","racquet","sport"],"shortcodes":["tennis"]},{"emoji":"🥏","label":"Flying disc","category":6,"version":11,"tags":["disc","flying","ultimate"],"shortcodes":["flying_disc"]},{"emoji":"🎳","label":"Bowling","category":6,"version":0.6,"tags":["ball","game","sport","strike"],"shortcodes":["bowling"]},{"emoji":"🏏","label":"Cricket game","category":6,"version":1,"tags":["ball","bat","cricket","game"],"shortcodes":["cricket_game"]},{"emoji":"🏑","label":"Field hockey","category":6,"version":1,"tags":["ball","field","game","hockey","stick"],"shortcodes":["field_hockey"]},{"emoji":"🏒","label":"Ice hockey","category":6,"version":1,"tags":["game","hockey","ice","puck","stick"],"shortcodes":["ice_hockey"]},{"emoji":"🥍","label":"Lacrosse","category":6,"version":11,"tags":["ball","goal","sports","stick"],"shortcodes":["lacrosse"]},{"emoji":"🏓","label":"Ping pong","category":6,"version":1,"tags":["ball","bat","game","paddle","ping","pingpong","pong","table","tennis"],"shortcodes":["ping_pong"]},{"emoji":"🏸","label":"Badminton","category":6,"version":1,"tags":["birdie","game","racquet","shuttlecock"],"shortcodes":["badminton"]},{"emoji":"🥊","label":"Boxing glove","category":6,"version":3,"tags":["boxing","glove"],"shortcodes":["boxing_glove"]},{"emoji":"🥋","label":"Martial arts uniform","category":6,"version":3,"tags":["arts","judo","karate","martial","taekwondo","uniform"],"shortcodes":["martial_arts_uniform"]},{"emoji":"🥅","label":"Goal net","category":6,"version":3,"tags":["goal","net"],"shortcodes":["goal_net"]},{"emoji":"⛳️","label":"Flag in hole","category":6,"version":0.6,"tags":["flag","hole","sport"],"shortcodes":["golf"]},{"emoji":"⛸️","label":"Ice skate","category":6,"version":0.7,"tags":["ice","skate","skating"],"shortcodes":["ice_skate"]},{"emoji":"🎣","label":"Fishing pole","category":6,"version":0.6,"tags":["entertainment","fish","fishing","pole","sport"],"shortcodes":["fishing_pole_and_fish"]},{"emoji":"🤿","label":"Diving mask","category":6,"version":12,"tags":["diving","mask","scuba","snorkeling"],"shortcodes":["diving_mask"]},{"emoji":"🎽","label":"Running shirt","category":6,"version":0.6,"tags":["athletics","running","sash","shirt"],"shortcodes":["running_shirt_with_sash"]},{"emoji":"🎿","label":"Skis","category":6,"version":0.6,"tags":["snow","sport"],"shortcodes":["ski"]},{"emoji":"🛷","label":"Sled","category":6,"version":5,"tags":["luge","sledge","sleigh","snow","toboggan"],"shortcodes":["sled"]},{"emoji":"🥌","label":"Curling stone","category":6,"version":5,"tags":["curling","game","rock","stone"],"shortcodes":["curling_stone"]},{"emoji":"🎯","label":"Bullseye","category":6,"version":0.6,"tags":["bull","direct","entertainment","game","hit","target"],"shortcodes":["dart"]},{"emoji":"🪀","label":"Yo-yo","category":6,"version":12,"tags":["fluctuate","toy"],"shortcodes":["yo_yo"]},{"emoji":"🪁","label":"Kite","category":6,"version":12,"tags":["fly","soar"],"shortcodes":["kite"]},{"emoji":"🔫","label":"Water pistol","category":6,"version":0.6,"tags":["handgun","pistol","revolver","tool","water","weapon"],"shortcodes":["gun"]},{"emoji":"🎱","label":"Pool 8 ball","category":6,"version":0.6,"tags":["8","ball","billiard","eight","game","pool"],"shortcodes":["8ball"]},{"emoji":"🔮","label":"Crystal ball","category":6,"version":0.6,"tags":["ball","crystal","fairy","fairytale","fantasy","fortune","future","magic","tale","tool"],"shortcodes":["crystal_ball"]},{"emoji":"🪄","label":"Magic wand","category":6,"version":13,"tags":["magic","magician","wand","witch","wizard"],"shortcodes":["magic_wand"]},{"emoji":"🎮️","label":"Video game","category":6,"version":0.6,"tags":["controller","entertainment","game","video"],"shortcodes":["video_game"]},{"emoji":"🕹️","label":"Joystick","category":6,"version":0.7,"tags":["game","video","videogame"],"shortcodes":["joystick"]},{"emoji":"🎰","label":"Slot machine","category":6,"version":0.6,"tags":["casino","gamble","gambling","game","machine","slot","slots"],"shortcodes":["slot_machine"]},{"emoji":"🎲","label":"Game die","category":6,"version":0.6,"tags":["dice","die","entertainment","game"],"shortcodes":["game_die"]},{"emoji":"🧩","label":"Puzzle piece","category":6,"version":11,"tags":["clue","interlocking","piece","puzzle"],"shortcodes":["jigsaw"]},{"emoji":"🧸","label":"Teddy bear","category":6,"version":11,"tags":["bear","plaything","plush","stuffed","teddy","toy"],"shortcodes":["teddy_bear"]},{"emoji":"🪅","label":"Piñata","category":6,"version":13,"tags":["candy","celebrate","celebration","cinco","de","festive","mayo","party","pinada"],"shortcodes":["pinata"]},{"emoji":"🪩","label":"Mirror ball","category":6,"version":14,"tags":["ball","dance","disco","glitter","mirror","party"],"shortcodes":["mirror_ball"]},{"emoji":"🪆","label":"Nesting dolls","category":6,"version":13,"tags":["babooshka","baboushka","babushka","doll","dolls","matryoshka","nesting","russia"],"shortcodes":["nesting_dolls"]},{"emoji":"♠️","label":"Spade suit","category":6,"version":0.6,"tags":["card","game","spade","suit"],"shortcodes":["spades"]},{"emoji":"♥️","label":"Heart suit","category":6,"version":0.6,"tags":["card","emotion","game","heart","suit"],"shortcodes":["hearts"]},{"emoji":"♦️","label":"Diamond suit","category":6,"version":0.6,"tags":["card","diamond","game","suit"],"shortcodes":["diamonds"]},{"emoji":"♣️","label":"Club suit","category":6,"version":0.6,"tags":["card","club","game","suit"],"shortcodes":["clubs"]},{"emoji":"♟️","label":"Chess pawn","category":6,"version":11,"tags":["chess","dupe","expendable","pawn"],"shortcodes":["chess_pawn"]},{"emoji":"🃏","label":"Joker","category":6,"version":0.6,"tags":["card","game","wildcard"],"shortcodes":["black_joker"]},{"emoji":"🀄️","label":"Mahjong red dragon","category":6,"version":0.6,"tags":["dragon","game","red"],"shortcodes":["mahjong"]},{"emoji":"🎴","label":"Flower playing cards","category":6,"version":0.6,"tags":["card","cards","flower","game","japanese","playing"],"shortcodes":["flower_playing_cards"]},{"emoji":"🎭️","label":"Performing arts","category":6,"version":0.6,"tags":["actor","actress","art","arts","entertainment","mask","performing","theater","theatre","thespian"],"shortcodes":["performing_arts"]},{"emoji":"🖼️","label":"Framed picture","category":6,"version":0.7,"tags":["art","frame","framed","museum","painting","picture"],"shortcodes":["framed_picture"]},{"emoji":"🎨","label":"Artist palette","category":6,"version":0.6,"tags":["artist","artsy","arty","colorful","creative","entertainment","museum","painter","painting","palette"],"shortcodes":["art"]},{"emoji":"🧵","label":"Thread","category":6,"version":11,"tags":["needle","sewing","spool","string"],"shortcodes":["thread"]},{"emoji":"🪡","label":"Sewing needle","category":6,"version":13,"tags":["embroidery","needle","sew","sewing","stitches","sutures","tailoring","thread"],"shortcodes":["sewing_needle"]},{"emoji":"🧶","label":"Yarn","category":6,"version":11,"tags":["ball","crochet","knit"],"shortcodes":["yarn"]},{"emoji":"🪢","label":"Knot","category":6,"version":13,"tags":["cord","rope","tangled","tie","twine","twist"],"shortcodes":["knot"]},{"emoji":"👓️","label":"Glasses","category":7,"version":0.6,"tags":["clothing","eye","eyewear"],"shortcodes":["eyeglasses"]},{"emoji":"🕶️","label":"Sunglasses","category":7,"version":0.7,"tags":["dark","eye","eyewear","glasses"],"shortcodes":["dark_sunglasses"]},{"emoji":"🥽","label":"Goggles","category":7,"version":11,"tags":["dive","eye","protection","scuba","swimming","welding"],"shortcodes":["goggles"]},{"emoji":"🥼","label":"Lab coat","category":7,"version":11,"tags":["clothes","coat","doctor","dr","experiment","jacket","lab","scientist","white"],"shortcodes":["lab_coat"]},{"emoji":"🦺","label":"Safety vest","category":7,"version":12,"tags":["emergency","safety","vest"],"shortcodes":["safety_vest"]},{"emoji":"👔","label":"Necktie","category":7,"version":0.6,"tags":["clothing","employed","serious","shirt","tie"],"shortcodes":["necktie"]},{"emoji":"👕","label":"T-shirt","category":7,"version":0.6,"tags":["blue","casual","clothes","clothing","collar","dressed","shopping","weekend"],"shortcodes":["shirt","tshirt"]},{"emoji":"👖","label":"Jeans","category":7,"version":0.6,"tags":["blue","casual","clothes","clothing","denim","dressed","pants","shopping","trousers","weekend"],"shortcodes":["jeans"]},{"emoji":"🧣","label":"Scarf","category":7,"version":5,"tags":["bundle","cold","neck","up"],"shortcodes":["scarf"]},{"emoji":"🧤","label":"Gloves","category":7,"version":5,"tags":["hand"],"shortcodes":["gloves"]},{"emoji":"🧥","label":"Coat","category":7,"version":5,"tags":["brr","bundle","cold","jacket","up"],"shortcodes":["coat"]},{"emoji":"🧦","label":"Socks","category":7,"version":5,"tags":["stocking"],"shortcodes":["socks"]},{"emoji":"👗","label":"Dress","category":7,"version":0.6,"tags":["clothes","clothing","dressed","fancy","shopping"],"shortcodes":["dress"]},{"emoji":"👘","label":"Kimono","category":7,"version":0.6,"tags":["clothing","comfortable"],"shortcodes":["kimono"]},{"emoji":"🥻","label":"Sari","category":7,"version":12,"tags":["clothing","dress"],"shortcodes":["sari"]},{"emoji":"🩱","label":"One-piece swimsuit","category":7,"version":12,"tags":["bathing","one-piece","suit","swimsuit"],"shortcodes":["one_piece_swimsuit"]},{"emoji":"🩲","label":"Briefs","category":7,"version":12,"tags":["bathing","one-piece","suit","swimsuit","underwear"],"shortcodes":["swim_brief"]},{"emoji":"🩳","label":"Shorts","category":7,"version":12,"tags":["bathing","pants","suit","swimsuit","underwear"],"shortcodes":["shorts"]},{"emoji":"👙","label":"Bikini","category":7,"version":0.6,"tags":["bathing","beach","clothing","pool","suit","swim"],"shortcodes":["bikini"]},{"emoji":"👚","label":"Woman’s clothes","category":7,"version":0.6,"tags":["blouse","clothes","clothing","collar","dress","dressed","lady","shirt","shopping","woman","woman’s"],"shortcodes":["womans_clothes"]},{"emoji":"🪭","label":"Folding hand fan","category":7,"version":15,"tags":["clack","clap","cool","cooling","dance","fan","flirt","flutter","folding","hand","hot","shy"],"shortcodes":["folding_hand_fan"]},{"emoji":"👛","label":"Purse","category":7,"version":0.6,"tags":["clothes","clothing","coin","dress","fancy","handbag","shopping"],"shortcodes":["purse"]},{"emoji":"👜","label":"Handbag","category":7,"version":0.6,"tags":["bag","clothes","clothing","dress","lady","purse","shopping"],"shortcodes":["handbag"]},{"emoji":"👝","label":"Clutch bag","category":7,"version":0.6,"tags":["bag","clothes","clothing","clutch","dress","handbag","purse"],"shortcodes":["pouch"]},{"emoji":"🛍️","label":"Shopping bags","category":7,"version":0.7,"tags":["bag","bags","hotel"],"shortcodes":["shopping"]},{"emoji":"🎒","label":"Backpack","category":7,"version":0.6,"tags":["backpacking","bag","bookbag","education","rucksack","satchel","school"],"shortcodes":["school_satchel"]},{"emoji":"🩴","label":"Thong sandal","category":7,"version":13,"tags":["beach","flip","flop","sandal","sandals","shoe","thong","thongs","zōri"],"shortcodes":["thong_sandal"]},{"emoji":"👞","label":"Man’s shoe","category":7,"version":0.6,"tags":["brown","clothes","clothing","feet","foot","kick","man","man’s","shoes","shopping"],"shortcodes":["mans_shoe","shoe"]},{"emoji":"👟","label":"Running shoe","category":7,"version":0.6,"tags":["athletic","clothes","clothing","fast","kick","running","shoe","shoes","shopping","sneaker","tennis"],"shortcodes":["athletic_shoe"]},{"emoji":"🥾","label":"Hiking boot","category":7,"version":11,"tags":["backpacking","boot","brown","camping","hiking","outdoors","shoe"],"shortcodes":["hiking_boot"]},{"emoji":"🥿","label":"Flat shoe","category":7,"version":11,"tags":["ballet","comfy","flat","flats","shoe","slip-on","slipper"],"shortcodes":["flat_shoe"]},{"emoji":"👠","label":"High-heeled shoe","category":7,"version":0.6,"tags":["clothes","clothing","dress","fashion","heel","heels","high-heeled","shoe","shoes","shopping","stiletto","woman"],"shortcodes":["high_heel"]},{"emoji":"👡","label":"Woman’s sandal","category":7,"version":0.6,"tags":["clothing","shoe","woman","woman’s"],"shortcodes":["sandal"]},{"emoji":"🩰","label":"Ballet shoes","category":7,"version":12,"tags":["ballet","dance","shoes"],"shortcodes":["ballet_shoes"]},{"emoji":"👢","label":"Woman’s boot","category":7,"version":0.6,"tags":["clothes","clothing","dress","shoe","shoes","shopping","woman","woman’s"],"shortcodes":["boot"]},{"emoji":"🪮","label":"Hair pick","category":7,"version":15,"tags":["afro","comb","groom","hair","pick"],"shortcodes":["hair_pick"]},{"emoji":"👑","label":"Crown","category":7,"version":0.6,"tags":["clothing","family","king","medieval","queen","royal","royalty","win"],"shortcodes":["crown"]},{"emoji":"👒","label":"Woman’s hat","category":7,"version":0.6,"tags":["clothes","clothing","garden","hat","hats","party","woman","woman’s"],"shortcodes":["womans_hat"]},{"emoji":"🎩","label":"Top hat","category":7,"version":0.6,"tags":["clothes","clothing","fancy","formal","hat","magic","top"],"shortcodes":["tophat"]},{"emoji":"🎓️","label":"Graduation cap","category":7,"version":0.6,"tags":["cap","celebration","clothing","education","graduation","hat","scholar"],"shortcodes":["mortar_board"]},{"emoji":"🧢","label":"Billed cap","category":7,"version":5,"tags":["baseball","bent","billed","cap","dad","hat"],"shortcodes":["billed_cap"]},{"emoji":"🪖","label":"Military helmet","category":7,"version":13,"tags":["army","helmet","military","soldier","war","warrior"],"shortcodes":["military_helmet"]},{"emoji":"⛑️","label":"Rescue worker’s helmet","category":7,"version":0.7,"tags":["aid","cross","face","hat","helmet","rescue","worker’s"],"shortcodes":["rescue_worker_helmet"]},{"emoji":"📿","label":"Prayer beads","category":7,"version":1,"tags":["beads","clothing","necklace","prayer","religion"],"shortcodes":["prayer_beads"]},{"emoji":"💄","label":"Lipstick","category":7,"version":0.6,"tags":["cosmetics","date","makeup"],"shortcodes":["lipstick"]},{"emoji":"💍","label":"Ring","category":7,"version":0.6,"tags":["diamond","engaged","engagement","married","romance","shiny","sparkling","wedding"],"shortcodes":["ring"]},{"emoji":"💎","label":"Gem stone","category":7,"version":0.6,"tags":["diamond","engagement","jewel","money","romance","stone","wedding"],"shortcodes":["gem"]},{"emoji":"🔇","label":"Muted speaker","category":7,"version":1,"tags":["muted","quiet","silent","sound","speaker"],"shortcodes":["mute"]},{"emoji":"🔈️","label":"Speaker low volume","category":7,"version":0.7,"tags":["low","soft","sound","volume"],"shortcodes":["speaker"]},{"emoji":"🔉","label":"Speaker medium volume","category":7,"version":1,"tags":["medium","speaker","volume"],"shortcodes":["sound"]},{"emoji":"🔊","label":"Speaker high volume","category":7,"version":0.6,"tags":["high","loud","music","sound","speaker","volume"],"shortcodes":["loud_sound"]},{"emoji":"📢","label":"Loudspeaker","category":7,"version":0.6,"tags":["address","communication","loud","public","sound"],"shortcodes":["loudspeaker"]},{"emoji":"📣","label":"Megaphone","category":7,"version":0.6,"tags":["cheering","sound"],"shortcodes":["mega"]},{"emoji":"📯","label":"Postal horn","category":7,"version":1,"tags":["horn","post","postal"],"shortcodes":["postal_horn"]},{"emoji":"🔔","label":"Bell","category":7,"version":0.6,"tags":["break","church","sound"],"shortcodes":["bell"]},{"emoji":"🔕","label":"Bell with slash","category":7,"version":1,"tags":["bell","forbidden","mute","no","not","prohibited","quiet","silent","slash","sound"],"shortcodes":["no_bell"]},{"emoji":"🎼","label":"Musical score","category":7,"version":0.6,"tags":["music","musical","note","score"],"shortcodes":["musical_score"]},{"emoji":"🎵","label":"Musical note","category":7,"version":0.6,"tags":["music","musical","note","sound"],"shortcodes":["musical_note"]},{"emoji":"🎶","label":"Musical notes","category":7,"version":0.6,"tags":["music","musical","note","sound"],"shortcodes":["notes"]},{"emoji":"🎙️","label":"Studio microphone","category":7,"version":0.7,"tags":["mic","microphone","music","studio"],"shortcodes":["studio_microphone"]},{"emoji":"🎚️","label":"Level slider","category":7,"version":0.7,"tags":["level","music","slider"],"shortcodes":["level_slider"]},{"emoji":"🎛️","label":"Control knobs","category":7,"version":0.7,"tags":["control","knobs","music"],"shortcodes":["control_knobs"]},{"emoji":"🎤","label":"Microphone","category":7,"version":0.6,"tags":["karaoke","mic","music","sing","sound"],"shortcodes":["microphone"]},{"emoji":"🎧️","label":"Headphone","category":7,"version":0.6,"tags":["earbud","sound"],"shortcodes":["headphones"]},{"emoji":"📻️","label":"Radio","category":7,"version":0.6,"tags":["entertainment","tbt","video"],"shortcodes":["radio"]},{"emoji":"🎷","label":"Saxophone","category":7,"version":0.6,"tags":["instrument","music","sax"],"shortcodes":["saxophone"]},{"emoji":"🎺","label":"Trumpet","category":7,"version":0.6,"tags":["instrument","music"],"shortcodes":["trumpet"]},{"emoji":"🪊","label":"Trombone","category":7,"version":17,"tags":["brass","instrument","jazz","music","sad","slide"],"shortcodes":[]},{"emoji":"🪗","label":"Accordion","category":7,"version":13,"tags":["box","concertina","instrument","music","squeeze","squeezebox"],"shortcodes":["accordion"]},{"emoji":"🎸","label":"Guitar","category":7,"version":0.6,"tags":["instrument","music","strat"],"shortcodes":["guitar"]},{"emoji":"🎹","label":"Musical keyboard","category":7,"version":0.6,"tags":["instrument","keyboard","music","musical","piano"],"shortcodes":["musical_keyboard"]},{"emoji":"🎻","label":"Violin","category":7,"version":0.6,"tags":["instrument","music"],"shortcodes":["violin"]},{"emoji":"🪕","label":"Banjo","category":7,"version":12,"tags":["music","stringed"],"shortcodes":["banjo"]},{"emoji":"🥁","label":"Drum","category":7,"version":3,"tags":["drumsticks","music"],"shortcodes":["drum"]},{"emoji":"🪘","label":"Long drum","category":7,"version":13,"tags":["beat","conga","drum","instrument","long","rhythm"],"shortcodes":["long_drum"]},{"emoji":"🪇","label":"Maracas","category":7,"version":15,"tags":["cha","dance","instrument","music","party","percussion","rattle","shake","shaker"],"shortcodes":["maracas"]},{"emoji":"🪈","label":"Flute","category":7,"version":15,"tags":["band","fife","flautist","instrument","marching","music","orchestra","piccolo","pipe","recorder","woodwind"],"shortcodes":["flute"]},{"emoji":"🪉","label":"Harp","category":7,"version":16,"tags":["cupid","instrument","love","music","orchestra"],"shortcodes":[]},{"emoji":"📱","label":"Mobile phone","category":7,"version":0.6,"tags":["cell","communication","mobile","phone","telephone"],"shortcodes":["iphone"]},{"emoji":"📲","label":"Mobile phone with arrow","category":7,"version":0.6,"tags":["arrow","build","call","cell","communication","mobile","phone","receive","telephone"],"shortcodes":["calling"]},{"emoji":"☎️","label":"Telephone","category":7,"version":0.6,"tags":[],"shortcodes":["phone","telephone"]},{"emoji":"📞","label":"Telephone receiver","category":7,"version":0.6,"tags":["communication","phone","receiver","telephone","voip"],"shortcodes":["telephone_receiver"]},{"emoji":"📟️","label":"Pager","category":7,"version":0.6,"tags":["communication"],"shortcodes":["pager"]},{"emoji":"📠","label":"Fax machine","category":7,"version":0.6,"tags":["communication","machine"],"shortcodes":["fax"]},{"emoji":"🔋","label":"Battery","category":7,"version":0.6,"tags":[],"shortcodes":["battery"]},{"emoji":"🪫","label":"Low battery","category":7,"version":14,"tags":["battery","drained","electronic","energy","low","power"],"shortcodes":["low_battery"]},{"emoji":"🔌","label":"Electric plug","category":7,"version":0.6,"tags":["electric","electricity","plug"],"shortcodes":["electric_plug"]},{"emoji":"💻️","label":"Laptop","category":7,"version":0.6,"tags":["office","pc","personal"],"shortcodes":["computer"]},{"emoji":"🖥️","label":"Desktop computer","category":7,"version":0.7,"tags":["computer","desktop","monitor"],"shortcodes":["desktop_computer"]},{"emoji":"🖨️","label":"Printer","category":7,"version":0.7,"tags":["computer"],"shortcodes":["printer"]},{"emoji":"⌨️","label":"Keyboard","category":7,"version":1,"tags":["computer"],"shortcodes":["keyboard"]},{"emoji":"🖱️","label":"Computer mouse","category":7,"version":0.7,"tags":["computer","mouse"],"shortcodes":["computer_mouse"]},{"emoji":"🖲️","label":"Trackball","category":7,"version":0.7,"tags":["computer"],"shortcodes":["trackball"]},{"emoji":"💽","label":"Computer disk","category":7,"version":0.6,"tags":["computer","disk","minidisk","optical"],"shortcodes":["minidisc"]},{"emoji":"💾","label":"Floppy disk","category":7,"version":0.6,"tags":["computer","disk","floppy"],"shortcodes":["floppy_disk"]},{"emoji":"💿️","label":"Optical disk","category":7,"version":0.6,"tags":["blu-ray","computer","disk","dvd","optical"],"shortcodes":["cd"]},{"emoji":"📀","label":"Dvd","category":7,"version":0.6,"tags":["blu-ray","cd","computer","disk","optical"],"shortcodes":["dvd"]},{"emoji":"🧮","label":"Abacus","category":7,"version":11,"tags":["calculation","calculator"],"shortcodes":["abacus"]},{"emoji":"🎥","label":"Movie camera","category":7,"version":0.6,"tags":["bollywood","camera","cinema","film","hollywood","movie","record"],"shortcodes":["movie_camera"]},{"emoji":"🎞️","label":"Film frames","category":7,"version":0.7,"tags":["cinema","film","frames","movie"],"shortcodes":["film_strip"]},{"emoji":"📽️","label":"Film projector","category":7,"version":0.7,"tags":["cinema","film","movie","projector","video"],"shortcodes":["film_projector"]},{"emoji":"🎬️","label":"Clapper board","category":7,"version":0.6,"tags":["action","board","movie"],"shortcodes":["clapper"]},{"emoji":"📺️","label":"Television","category":7,"version":0.6,"tags":["video"],"shortcodes":["tv"]},{"emoji":"📷️","label":"Camera","category":7,"version":0.6,"tags":["photo","selfie","snap","tbt","trip","video"],"shortcodes":["camera"]},{"emoji":"📸","label":"Camera with flash","category":7,"version":1,"tags":["camera","flash","video"],"shortcodes":["camera_flash"]},{"emoji":"📹️","label":"Video camera","category":7,"version":0.6,"tags":["camcorder","camera","tbt","video"],"shortcodes":["video_camera"]},{"emoji":"📼","label":"Videocassette","category":7,"version":0.6,"tags":["old","school","tape","vcr","video"],"shortcodes":["vhs"]},{"emoji":"🔍️","label":"Magnifying glass tilted left","category":7,"version":0.6,"tags":["glass","lab","left","left-pointing","magnifying","science","search","tilted","tool"],"shortcodes":["mag"]},{"emoji":"🔎","label":"Magnifying glass tilted right","category":7,"version":0.6,"tags":["contact","glass","lab","magnifying","right","right-pointing","science","search","tilted","tool"],"shortcodes":["mag_right"]},{"emoji":"🕯️","label":"Candle","category":7,"version":0.7,"tags":["light"],"shortcodes":["candle"]},{"emoji":"💡","label":"Light bulb","category":7,"version":0.6,"tags":["comic","electric","idea","light"],"shortcodes":["bulb"]},{"emoji":"🔦","label":"Flashlight","category":7,"version":0.6,"tags":["electric","light","tool","torch"],"shortcodes":["flashlight"]},{"emoji":"🏮","label":"Red paper lantern","category":7,"version":0.6,"tags":["bar","light","paper","red","restaurant"],"shortcodes":["izakaya_lantern","lantern"]},{"emoji":"🪔","label":"Diya lamp","category":7,"version":12,"tags":["diya","lamp","light","oil"],"shortcodes":["diya_lamp"]},{"emoji":"📔","label":"Notebook with decorative cover","category":7,"version":0.6,"tags":["book","cover","decorated","decorative","education","notebook","school","writing"],"shortcodes":["notebook_with_decorative_cover"]},{"emoji":"📕","label":"Closed book","category":7,"version":0.6,"tags":["book","closed","education"],"shortcodes":["closed_book"]},{"emoji":"📖","label":"Open book","category":7,"version":0.6,"tags":["education","fantasy","knowledge","library","novels","open","reading"],"shortcodes":["book","open_book"]},{"emoji":"📗","label":"Green book","category":7,"version":0.6,"tags":["book","education","fantasy","green","library","reading"],"shortcodes":["green_book"]},{"emoji":"📘","label":"Blue book","category":7,"version":0.6,"tags":["blue","book","education","fantasy","library","reading"],"shortcodes":["blue_book"]},{"emoji":"📙","label":"Orange book","category":7,"version":0.6,"tags":["book","education","fantasy","library","orange","reading"],"shortcodes":["orange_book"]},{"emoji":"📚️","label":"Books","category":7,"version":0.6,"tags":["book","education","fantasy","knowledge","library","novels","reading","school","study"],"shortcodes":["books"]},{"emoji":"📓","label":"Notebook","category":7,"version":0.6,"tags":[],"shortcodes":["notebook"]},{"emoji":"📒","label":"Ledger","category":7,"version":0.6,"tags":["notebook"],"shortcodes":["ledger"]},{"emoji":"📃","label":"Page with curl","category":7,"version":0.6,"tags":["curl","document","page","paper"],"shortcodes":["page_with_curl"]},{"emoji":"📜","label":"Scroll","category":7,"version":0.6,"tags":["paper"],"shortcodes":["scroll"]},{"emoji":"📄","label":"Page facing up","category":7,"version":0.6,"tags":["document","facing","page","paper","up"],"shortcodes":["page_facing_up"]},{"emoji":"📰","label":"Newspaper","category":7,"version":0.6,"tags":["communication","news","paper"],"shortcodes":["newspaper"]},{"emoji":"🗞️","label":"Rolled-up newspaper","category":7,"version":0.7,"tags":["news","newspaper","paper","rolled","rolled-up"],"shortcodes":["newspaper_roll"]},{"emoji":"📑","label":"Bookmark tabs","category":7,"version":0.6,"tags":["bookmark","mark","marker","tabs"],"shortcodes":["bookmark_tabs"]},{"emoji":"🔖","label":"Bookmark","category":7,"version":0.6,"tags":["mark"],"shortcodes":["bookmark"]},{"emoji":"🏷️","label":"Label","category":7,"version":0.7,"tags":["tag"],"shortcodes":["label"]},{"emoji":"🪙","label":"Coin","category":7,"version":13,"tags":["dollar","euro","gold","metal","money","rich","silver","treasure"],"shortcodes":["coin"]},{"emoji":"💰️","label":"Money bag","category":7,"version":0.6,"tags":["bag","bank","bet","billion","cash","cost","dollar","gold","million","money","paid","paying","pot","rich","win"],"shortcodes":["moneybag"]},{"emoji":"🪎","label":"Treasure chest","category":7,"version":17,"tags":["gem","gold","jewels","loot","money","prize","silver","valuables","wealth"],"shortcodes":[]},{"emoji":"💴","label":"Yen banknote","category":7,"version":0.6,"tags":["bank","banknote","bill","currency","money","note"],"shortcodes":["yen"]},{"emoji":"💵","label":"Dollar banknote","category":7,"version":0.6,"tags":["bank","banknote","bill","currency","money","note"],"shortcodes":["dollar"]},{"emoji":"💶","label":"Euro banknote","category":7,"version":1,"tags":["100","bank","banknote","bill","currency","money","note","rich"],"shortcodes":["euro"]},{"emoji":"💷","label":"Pound banknote","category":7,"version":1,"tags":["bank","banknote","bill","billion","cash","currency","money","note","pounds"],"shortcodes":["pound"]},{"emoji":"💸","label":"Money with wings","category":7,"version":0.6,"tags":["bank","banknote","bill","billion","cash","dollar","fly","million","money","note","pay","wings"],"shortcodes":["money_with_wings"]},{"emoji":"💳️","label":"Credit card","category":7,"version":0.6,"tags":["bank","card","cash","charge","credit","money","pay"],"shortcodes":["credit_card"]},{"emoji":"🧾","label":"Receipt","category":7,"version":11,"tags":["accounting","bookkeeping","evidence","invoice","proof"],"shortcodes":["receipt"]},{"emoji":"💹","label":"Chart increasing with yen","category":7,"version":0.6,"tags":["bank","currency","graph","growth","increasing","market","money","rise","trend","upward","yen"],"shortcodes":["chart"]},{"emoji":"✉️","label":"Envelope","category":7,"version":0.6,"tags":["e-mail","email","letter"],"shortcodes":["envelope"]},{"emoji":"📧","label":"E-mail","category":7,"version":0.6,"tags":["letter","mail"],"shortcodes":["e-mail","email"]},{"emoji":"📨","label":"Incoming envelope","category":7,"version":0.6,"tags":["delivering","e-mail","email","envelope","incoming","letter","mail","receive","sent"],"shortcodes":["incoming_envelope"]},{"emoji":"📩","label":"Envelope with arrow","category":7,"version":0.6,"tags":["arrow","communication","down","e-mail","email","envelope","letter","mail","outgoing","send","sent"],"shortcodes":["envelope_with_arrow"]},{"emoji":"📤️","label":"Outbox tray","category":7,"version":0.6,"tags":["box","email","letter","mail","outbox","sent","tray"],"shortcodes":["outbox_tray"]},{"emoji":"📥️","label":"Inbox tray","category":7,"version":0.6,"tags":["box","email","inbox","letter","mail","receive","tray","zero"],"shortcodes":["inbox_tray"]},{"emoji":"📦️","label":"Package","category":7,"version":0.6,"tags":["box","communication","delivery","parcel","shipping"],"shortcodes":["package"]},{"emoji":"📫️","label":"Closed mailbox with raised flag","category":7,"version":0.6,"tags":["closed","communication","flag","mail","postbox","raised"],"shortcodes":["mailbox"]},{"emoji":"📪️","label":"Closed mailbox with lowered flag","category":7,"version":0.6,"tags":["closed","flag","lowered","mail","mailbox","postbox"],"shortcodes":["mailbox_closed"]},{"emoji":"📬️","label":"Open mailbox with raised flag","category":7,"version":0.7,"tags":["flag","mail","mailbox","open","postbox","raised"],"shortcodes":["mailbox_with_mail"]},{"emoji":"📭️","label":"Open mailbox with lowered flag","category":7,"version":0.7,"tags":["flag","lowered","mail","mailbox","open","postbox"],"shortcodes":["mailbox_with_no_mail"]},{"emoji":"📮","label":"Postbox","category":7,"version":0.6,"tags":["mail","mailbox"],"shortcodes":["postbox"]},{"emoji":"🗳️","label":"Ballot box with ballot","category":7,"version":0.7,"tags":["ballot","box"],"shortcodes":["ballot_box"]},{"emoji":"✏️","label":"Pencil","category":7,"version":0.6,"tags":["pencil"],"shortcodes":["pencil2"]},{"emoji":"✒️","label":"Black nib","category":7,"version":0.6,"tags":["black","nib","pen"],"shortcodes":["black_nib"]},{"emoji":"🖋️","label":"Fountain pen","category":7,"version":0.7,"tags":["fountain","pen"],"shortcodes":["fountain_pen"]},{"emoji":"🖊️","label":"Pen","category":7,"version":0.7,"tags":["ballpoint"],"shortcodes":["pen"]},{"emoji":"🖌️","label":"Paintbrush","category":7,"version":0.7,"tags":["painting"],"shortcodes":["paintbrush"]},{"emoji":"🖍️","label":"Crayon","category":7,"version":0.7,"tags":[],"shortcodes":["crayon"]},{"emoji":"📝","label":"Memo","category":7,"version":0.6,"tags":["communication","media","notes"],"shortcodes":["memo","pencil"]},{"emoji":"💼","label":"Briefcase","category":7,"version":0.6,"tags":["office"],"shortcodes":["briefcase"]},{"emoji":"📁","label":"File folder","category":7,"version":0.6,"tags":["file","folder"],"shortcodes":["file_folder"]},{"emoji":"📂","label":"Open file folder","category":7,"version":0.6,"tags":["file","folder","open"],"shortcodes":["open_file_folder"]},{"emoji":"🗂️","label":"Card index dividers","category":7,"version":0.7,"tags":["card","dividers","index"],"shortcodes":["card_index_dividers"]},{"emoji":"📅","label":"Calendar","category":7,"version":0.6,"tags":[],"shortcodes":["date"]},{"emoji":"📆","label":"Tear-off calendar","category":7,"version":0.6,"tags":["tear-off"],"shortcodes":["calendar"]},{"emoji":"🗒️","label":"Spiral notepad","category":7,"version":0.7,"tags":["note","notepad","pad","spiral"],"shortcodes":["spiral_notepad"]},{"emoji":"🗓️","label":"Spiral calendar","category":7,"version":0.7,"tags":["calendar","pad","spiral"],"shortcodes":["spiral_calendar"]},{"emoji":"📇","label":"Card index","category":7,"version":0.6,"tags":["card","index","old","rolodex","school"],"shortcodes":["card_index"]},{"emoji":"📈","label":"Chart increasing","category":7,"version":0.6,"tags":["chart","data","graph","growth","increasing","right","trend","up","upward"],"shortcodes":["chart_with_upwards_trend"]},{"emoji":"📉","label":"Chart decreasing","category":7,"version":0.6,"tags":["chart","data","decreasing","down","downward","graph","negative","trend"],"shortcodes":["chart_with_downwards_trend"]},{"emoji":"📊","label":"Bar chart","category":7,"version":0.6,"tags":["bar","chart","data","graph"],"shortcodes":["bar_chart"]},{"emoji":"📋️","label":"Clipboard","category":7,"version":0.6,"tags":["do","list","notes"],"shortcodes":["clipboard"]},{"emoji":"📌","label":"Pushpin","category":7,"version":0.6,"tags":["collage","pin"],"shortcodes":["pushpin"]},{"emoji":"📍","label":"Round pushpin","category":7,"version":0.6,"tags":["location","map","pin","pushpin","round"],"shortcodes":["round_pushpin"]},{"emoji":"📎","label":"Paperclip","category":7,"version":0.6,"tags":[],"shortcodes":["paperclip"]},{"emoji":"🖇️","label":"Linked paperclips","category":7,"version":0.7,"tags":["link","linked","paperclip"],"shortcodes":["paperclips"]},{"emoji":"📏","label":"Straight ruler","category":7,"version":0.6,"tags":["angle","edge","math","ruler","straight","straightedge"],"shortcodes":["straight_ruler"]},{"emoji":"📐","label":"Triangular ruler","category":7,"version":0.6,"tags":["angle","math","rule","ruler","set","slide","triangle","triangular"],"shortcodes":["triangular_ruler"]},{"emoji":"✂️","label":"Scissors","category":7,"version":0.6,"tags":["cut","cutting","paper","tool"],"shortcodes":["scissors"]},{"emoji":"🗃️","label":"Card file box","category":7,"version":0.7,"tags":["box","card","file"],"shortcodes":["card_file_box"]},{"emoji":"🗄️","label":"File cabinet","category":7,"version":0.7,"tags":["cabinet","file","filing","paper"],"shortcodes":["file_cabinet"]},{"emoji":"🗑️","label":"Wastebasket","category":7,"version":0.7,"tags":["can","garbage","trash","waste"],"shortcodes":["wastebasket"]},{"emoji":"🔒️","label":"Locked","category":7,"version":0.6,"tags":["closed","private"],"shortcodes":["lock"]},{"emoji":"🔓️","label":"Unlocked","category":7,"version":0.6,"tags":["cracked","lock","open"],"shortcodes":["unlock"]},{"emoji":"🔏","label":"Locked with pen","category":7,"version":0.6,"tags":["ink","lock","locked","nib","pen","privacy"],"shortcodes":["lock_with_ink_pen"]},{"emoji":"🔐","label":"Locked with key","category":7,"version":0.6,"tags":["bike","closed","key","lock","locked","secure"],"shortcodes":["closed_lock_with_key"]},{"emoji":"🔑","label":"Key","category":7,"version":0.6,"tags":["keys","lock","major","password","unlock"],"shortcodes":["key"]},{"emoji":"🗝️","label":"Old key","category":7,"version":0.7,"tags":["clue","key","lock","old"],"shortcodes":["old_key"]},{"emoji":"🔨","label":"Hammer","category":7,"version":0.6,"tags":["home","improvement","repairs","tool"],"shortcodes":["hammer"]},{"emoji":"🪓","label":"Axe","category":7,"version":12,"tags":["ax","chop","hatchet","split","wood"],"shortcodes":["axe"]},{"emoji":"⛏️","label":"Pick","category":7,"version":0.7,"tags":["hammer","mining","tool"],"shortcodes":["pick"]},{"emoji":"⚒️","label":"Hammer and pick","category":7,"version":1,"tags":["hammer","pick","tool"],"shortcodes":["hammer_and_pick"]},{"emoji":"🛠️","label":"Hammer and wrench","category":7,"version":0.7,"tags":["hammer","spanner","tool","wrench"],"shortcodes":["hammer_and_wrench"]},{"emoji":"🗡️","label":"Dagger","category":7,"version":0.7,"tags":["knife","weapon"],"shortcodes":["dagger"]},{"emoji":"⚔️","label":"Crossed swords","category":7,"version":1,"tags":["crossed","swords","weapon"],"shortcodes":["crossed_swords"]},{"emoji":"💣️","label":"Bomb","category":7,"version":0.6,"tags":["boom","comic","dangerous","explosion","hot"],"shortcodes":["bomb"]},{"emoji":"🪃","label":"Boomerang","category":7,"version":13,"tags":["rebound","repercussion","weapon"],"shortcodes":["boomerang"]},{"emoji":"🏹","label":"Bow and arrow","category":7,"version":1,"tags":["archer","archery","arrow","bow","sagittarius","tool","weapon","zodiac"],"shortcodes":["bow_and_arrow"]},{"emoji":"🛡️","label":"Shield","category":7,"version":0.7,"tags":["weapon"],"shortcodes":["shield"]},{"emoji":"🪚","label":"Carpentry saw","category":7,"version":13,"tags":["carpenter","carpentry","cut","lumber","saw","tool","trim"],"shortcodes":["carpentry_saw"]},{"emoji":"🔧","label":"Wrench","category":7,"version":0.6,"tags":["home","improvement","spanner","tool"],"shortcodes":["wrench"]},{"emoji":"🪛","label":"Screwdriver","category":7,"version":13,"tags":["flathead","handy","screw","tool"],"shortcodes":["screwdriver"]},{"emoji":"🔩","label":"Nut and bolt","category":7,"version":0.6,"tags":["bolt","home","improvement","nut","tool"],"shortcodes":["nut_and_bolt"]},{"emoji":"⚙️","label":"Gear","category":7,"version":1,"tags":["cog","cogwheel","tool"],"shortcodes":["gear"]},{"emoji":"🗜️","label":"Clamp","category":7,"version":0.7,"tags":["compress","tool","vice"],"shortcodes":["clamp"]},{"emoji":"⚖️","label":"Balance scale","category":7,"version":1,"tags":["balance","justice","libra","scale","scales","tool","weight","zodiac"],"shortcodes":["balance_scale"]},{"emoji":"🦯","label":"White cane","category":7,"version":12,"tags":["accessibility","blind","cane","probing","white"],"shortcodes":["probing_cane"]},{"emoji":"🔗","label":"Link","category":7,"version":0.6,"tags":["links"],"shortcodes":["link"]},{"emoji":"⛓️‍💥","label":"Broken chain","category":7,"version":15.1,"tags":["break","breaking","broken","chain","cuffs","freedom"],"shortcodes":[]},{"emoji":"⛓️","label":"Chains","category":7,"version":0.7,"tags":["chain"],"shortcodes":["chains"]},{"emoji":"🪝","label":"Hook","category":7,"version":13,"tags":["catch","crook","curve","ensnare","point","selling"],"shortcodes":["hook"]},{"emoji":"🧰","label":"Toolbox","category":7,"version":11,"tags":["box","chest","mechanic","red","tool"],"shortcodes":["toolbox"]},{"emoji":"🧲","label":"Magnet","category":7,"version":11,"tags":["attraction","horseshoe","magnetic","negative","positive","shape","u"],"shortcodes":["magnet"]},{"emoji":"🪜","label":"Ladder","category":7,"version":13,"tags":["climb","rung","step"],"shortcodes":["ladder"]},{"emoji":"🪏","label":"Shovel","category":7,"version":16,"tags":["bury","dig","garden","hole","plant","scoop","snow","spade"],"shortcodes":[]},{"emoji":"⚗️","label":"Alembic","category":7,"version":1,"tags":["chemistry","tool"],"shortcodes":["alembic"]},{"emoji":"🧪","label":"Test tube","category":7,"version":11,"tags":["chemist","chemistry","experiment","lab","science","test","tube"],"shortcodes":["test_tube"]},{"emoji":"🧫","label":"Petri dish","category":7,"version":11,"tags":["bacteria","biologist","biology","culture","dish","lab","petri"],"shortcodes":["petri_dish"]},{"emoji":"🧬","label":"Dna","category":7,"version":11,"tags":["biologist","evolution","gene","genetics","life"],"shortcodes":["dna"]},{"emoji":"🔬","label":"Microscope","category":7,"version":1,"tags":["experiment","lab","science","tool"],"shortcodes":["microscope"]},{"emoji":"🔭","label":"Telescope","category":7,"version":1,"tags":["contact","extraterrestrial","science","tool"],"shortcodes":["telescope"]},{"emoji":"📡","label":"Satellite antenna","category":7,"version":0.6,"tags":["aliens","antenna","contact","dish","science"],"shortcodes":["satellite"]},{"emoji":"💉","label":"Syringe","category":7,"version":0.6,"tags":["doctor","flu","medicine","needle","shot","sick","tool","vaccination"],"shortcodes":["syringe"]},{"emoji":"🩸","label":"Drop of blood","category":7,"version":12,"tags":["bleed","blood","donation","drop","injury","medicine","menstruation"],"shortcodes":["drop_of_blood"]},{"emoji":"💊","label":"Pill","category":7,"version":0.6,"tags":["doctor","drugs","medicated","medicine","pills","sick","vitamin"],"shortcodes":["pill"]},{"emoji":"🩹","label":"Adhesive bandage","category":7,"version":12,"tags":["adhesive","bandage"],"shortcodes":["adhesive_bandage"]},{"emoji":"🩼","label":"Crutch","category":7,"version":14,"tags":["aid","cane","disability","help","hurt","injured","mobility","stick"],"shortcodes":["crutch"]},{"emoji":"🩺","label":"Stethoscope","category":7,"version":12,"tags":["doctor","heart","medicine"],"shortcodes":["stethoscope"]},{"emoji":"🩻","label":"X-ray","category":7,"version":14,"tags":["bones","doctor","medical","skeleton","skull","xray"],"shortcodes":["x_ray"]},{"emoji":"🚪","label":"Door","category":7,"version":0.6,"tags":["back","closet","front"],"shortcodes":["door"]},{"emoji":"🛗","label":"Elevator","category":7,"version":13,"tags":["accessibility","hoist","lift"],"shortcodes":["elevator"]},{"emoji":"🪞","label":"Mirror","category":7,"version":13,"tags":["makeup","reflection","reflector","speculum"],"shortcodes":["mirror"]},{"emoji":"🪟","label":"Window","category":7,"version":13,"tags":["air","frame","fresh","opening","transparent","view"],"shortcodes":["window"]},{"emoji":"🛏️","label":"Bed","category":7,"version":0.7,"tags":["hotel","sleep"],"shortcodes":["bed"]},{"emoji":"🛋️","label":"Couch and lamp","category":7,"version":0.7,"tags":["couch","hotel","lamp"],"shortcodes":["couch_and_lamp"]},{"emoji":"🪑","label":"Chair","category":7,"version":12,"tags":["seat","sit"],"shortcodes":["chair"]},{"emoji":"🚽","label":"Toilet","category":7,"version":0.6,"tags":["bathroom"],"shortcodes":["toilet"]},{"emoji":"🪠","label":"Plunger","category":7,"version":13,"tags":["cup","force","plumber","poop","suction","toilet"],"shortcodes":["plunger"]},{"emoji":"🚿","label":"Shower","category":7,"version":1,"tags":["water"],"shortcodes":["shower"]},{"emoji":"🛁","label":"Bathtub","category":7,"version":1,"tags":["bath"],"shortcodes":["bathtub"]},{"emoji":"🪤","label":"Mouse trap","category":7,"version":13,"tags":["bait","cheese","lure","mouse","mousetrap","snare","trap"],"shortcodes":["mouse_trap"]},{"emoji":"🪒","label":"Razor","category":7,"version":12,"tags":["sharp","shave"],"shortcodes":["razor"]},{"emoji":"🧴","label":"Lotion bottle","category":7,"version":11,"tags":["bottle","lotion","moisturizer","shampoo","sunscreen"],"shortcodes":["lotion_bottle"]},{"emoji":"🧷","label":"Safety pin","category":7,"version":11,"tags":["diaper","pin","punk","rock","safety"],"shortcodes":["safety_pin"]},{"emoji":"🧹","label":"Broom","category":7,"version":11,"tags":["cleaning","sweeping","witch"],"shortcodes":["broom"]},{"emoji":"🧺","label":"Basket","category":7,"version":11,"tags":["farming","laundry","picnic"],"shortcodes":["basket"]},{"emoji":"🧻","label":"Roll of paper","category":7,"version":11,"tags":["paper","roll","toilet","towels"],"shortcodes":["roll_of_paper"]},{"emoji":"🪣","label":"Bucket","category":7,"version":13,"tags":["cask","pail","vat"],"shortcodes":["bucket"]},{"emoji":"🧼","label":"Soap","category":7,"version":11,"tags":["bar","bathing","clean","cleaning","lather","soapdish"],"shortcodes":["soap"]},{"emoji":"🫧","label":"Bubbles","category":7,"version":14,"tags":["bubble","burp","clean","floating","pearl","soap","underwater"],"shortcodes":["bubbles"]},{"emoji":"🪥","label":"Toothbrush","category":7,"version":13,"tags":["bathroom","brush","clean","dental","hygiene","teeth","toiletry"],"shortcodes":["toothbrush"]},{"emoji":"🧽","label":"Sponge","category":7,"version":11,"tags":["absorbing","cleaning","porous","soak"],"shortcodes":["sponge"]},{"emoji":"🧯","label":"Fire extinguisher","category":7,"version":11,"tags":["extinguish","extinguisher","fire","quench"],"shortcodes":["fire_extinguisher"]},{"emoji":"🛒","label":"Shopping cart","category":7,"version":3,"tags":["cart","shopping","trolley"],"shortcodes":["shopping_cart"]},{"emoji":"🚬","label":"Cigarette","category":7,"version":0.6,"tags":[],"shortcodes":["smoking"]},{"emoji":"⚰️","label":"Coffin","category":7,"version":1,"tags":["dead","death","vampire"],"shortcodes":["coffin"]},{"emoji":"🪦","label":"Headstone","category":7,"version":13,"tags":["cemetery","dead","grave","graveyard","memorial","rip","tomb","tombstone"],"shortcodes":["headstone"]},{"emoji":"⚱️","label":"Funeral urn","category":7,"version":1,"tags":["ashes","death","funeral","urn"],"shortcodes":["funeral_urn"]},{"emoji":"🧿","label":"Nazar amulet","category":7,"version":11,"tags":["amulet","bead","blue","charm","evil-eye","nazar","talisman"],"shortcodes":["nazar_amulet"]},{"emoji":"🪬","label":"Hamsa","category":7,"version":14,"tags":["amulet","fatima","fortune","guide","hand","mary","miriam","palm","protect","protection"],"shortcodes":["hamsa"]},{"emoji":"🗿","label":"Moai","category":7,"version":0.6,"tags":["face","statue","stoneface","travel"],"shortcodes":["moyai"]},{"emoji":"🪧","label":"Placard","category":7,"version":13,"tags":["card","demonstration","notice","picket","plaque","protest","sign"],"shortcodes":["placard"]},{"emoji":"🪪","label":"Identification card","category":7,"version":14,"tags":["card","credentials","document","id","identification","license","security"],"shortcodes":["identification_card"]},{"emoji":"🏧","label":"ATM sign","category":8,"version":0.6,"tags":["automated","bank","cash","money","sign","teller"],"shortcodes":["atm"]},{"emoji":"🚮","label":"Litter in bin sign","category":8,"version":1,"tags":["bin","litter","litterbin","sign"],"shortcodes":["put_litter_in_its_place"]},{"emoji":"🚰","label":"Potable water","category":8,"version":1,"tags":["drinking","potable","water"],"shortcodes":["potable_water"]},{"emoji":"♿️","label":"Wheelchair symbol","category":8,"version":0.6,"tags":["access","handicap","symbol"],"shortcodes":["wheelchair"]},{"emoji":"🚹️","label":"Men’s room","category":8,"version":0.6,"tags":["bathroom","lavatory","man","men’s","restroom","room","toilet","wc"],"shortcodes":["mens"]},{"emoji":"🚺️","label":"Women’s room","category":8,"version":0.6,"tags":["bathroom","lavatory","restroom","room","toilet","wc","woman","women’s"],"shortcodes":["womens"]},{"emoji":"🚻","label":"Restroom","category":8,"version":0.6,"tags":["bathroom","lavatory","toilet","wc"],"shortcodes":["restroom"]},{"emoji":"🚼️","label":"Baby symbol","category":8,"version":0.6,"tags":["baby","changing","symbol"],"shortcodes":["baby_symbol"]},{"emoji":"🚾","label":"Water closet","category":8,"version":0.6,"tags":["bathroom","closet","lavatory","restroom","toilet","water"],"shortcodes":["wc"]},{"emoji":"🛂","label":"Passport control","category":8,"version":1,"tags":["control","passport"],"shortcodes":["passport_control"]},{"emoji":"🛃","label":"Customs","category":8,"version":1,"tags":["packing"],"shortcodes":["customs"]},{"emoji":"🛄","label":"Baggage claim","category":8,"version":1,"tags":["arrived","baggage","bags","case","checked","claim","journey","packing","plane","ready","travel","trip"],"shortcodes":["baggage_claim"]},{"emoji":"🛅","label":"Left luggage","category":8,"version":1,"tags":["baggage","case","left","locker","luggage"],"shortcodes":["left_luggage"]},{"emoji":"⚠️","label":"Warning","category":8,"version":0.6,"tags":["caution"],"shortcodes":["warning"]},{"emoji":"🚸","label":"Children crossing","category":8,"version":1,"tags":["child","children","crossing","pedestrian","traffic"],"shortcodes":["children_crossing"]},{"emoji":"⛔️","label":"No entry","category":8,"version":0.6,"tags":["do","entry","fail","forbidden","no","not","pass","prohibited","traffic"],"shortcodes":["no_entry"]},{"emoji":"🚫","label":"Prohibited","category":8,"version":0.6,"tags":["entry","forbidden","no","not","smoke"],"shortcodes":["no_entry_sign"]},{"emoji":"🚳","label":"No bicycles","category":8,"version":1,"tags":["bicycle","bicycles","bike","forbidden","no","not","prohibited"],"shortcodes":["no_bicycles"]},{"emoji":"🚭️","label":"No smoking","category":8,"version":0.6,"tags":["forbidden","no","not","prohibited","smoke","smoking"],"shortcodes":["no_smoking"]},{"emoji":"🚯","label":"No littering","category":8,"version":1,"tags":["forbidden","litter","littering","no","not","prohibited"],"shortcodes":["do_not_litter"]},{"emoji":"🚱","label":"Non-potable water","category":8,"version":1,"tags":["dry","non-drinking","non-potable","prohibited","water"],"shortcodes":["non-potable_water"]},{"emoji":"🚷","label":"No pedestrians","category":8,"version":1,"tags":["forbidden","no","not","pedestrian","pedestrians","prohibited"],"shortcodes":["no_pedestrians"]},{"emoji":"📵","label":"No mobile phones","category":8,"version":1,"tags":["cell","forbidden","mobile","no","not","phone","phones","prohibited","telephone"],"shortcodes":["no_mobile_phones"]},{"emoji":"🔞","label":"No one under eighteen","category":8,"version":0.6,"tags":["18","age","eighteen","forbidden","no","not","one","prohibited","restriction"],"shortcodes":["underage"]},{"emoji":"☢️","label":"Radioactive","category":8,"version":1,"tags":["sign"],"shortcodes":["radioactive"]},{"emoji":"☣️","label":"Biohazard","category":8,"version":1,"tags":["sign"],"shortcodes":["biohazard"]},{"emoji":"⬆️","label":"Up arrow","category":8,"version":0.6,"tags":["arrow","cardinal","direction","north","up"],"shortcodes":["arrow_up"]},{"emoji":"↗️","label":"Up-right arrow","category":8,"version":0.6,"tags":["arrow","direction","intercardinal","northeast","up-right"],"shortcodes":["arrow_upper_right"]},{"emoji":"➡️","label":"Right arrow","category":8,"version":0.6,"tags":["arrow","cardinal","direction","east","right"],"shortcodes":["arrow_right"]},{"emoji":"↘️","label":"Down-right arrow","category":8,"version":0.6,"tags":["arrow","direction","down-right","intercardinal","southeast"],"shortcodes":["arrow_lower_right"]},{"emoji":"⬇️","label":"Down arrow","category":8,"version":0.6,"tags":["arrow","cardinal","direction","down","south"],"shortcodes":["arrow_down"]},{"emoji":"↙️","label":"Down-left arrow","category":8,"version":0.6,"tags":["arrow","direction","down-left","intercardinal","southwest"],"shortcodes":["arrow_lower_left"]},{"emoji":"⬅️","label":"Left arrow","category":8,"version":0.6,"tags":["arrow","cardinal","direction","left","west"],"shortcodes":["arrow_left"]},{"emoji":"↖️","label":"Up-left arrow","category":8,"version":0.6,"tags":["arrow","direction","intercardinal","northwest","up-left"],"shortcodes":["arrow_upper_left"]},{"emoji":"↕️","label":"Up-down arrow","category":8,"version":0.6,"tags":["arrow","up-down"],"shortcodes":["arrow_up_down"]},{"emoji":"↔️","label":"Left-right arrow","category":8,"version":0.6,"tags":["arrow","left-right"],"shortcodes":["left_right_arrow"]},{"emoji":"↩️","label":"Right arrow curving left","category":8,"version":0.6,"tags":["arrow","curving","left","right"],"shortcodes":["leftwards_arrow_with_hook"]},{"emoji":"↪️","label":"Left arrow curving right","category":8,"version":0.6,"tags":["arrow","curving","left","right"],"shortcodes":["arrow_right_hook"]},{"emoji":"⤴️","label":"Right arrow curving up","category":8,"version":0.6,"tags":["arrow","curving","right","up"],"shortcodes":["arrow_heading_up"]},{"emoji":"⤵️","label":"Right arrow curving down","category":8,"version":0.6,"tags":["arrow","curving","down","right"],"shortcodes":["arrow_heading_down"]},{"emoji":"🔃","label":"Clockwise vertical arrows","category":8,"version":0.6,"tags":["arrow","arrows","clockwise","refresh","reload","vertical"],"shortcodes":["arrows_clockwise"]},{"emoji":"🔄","label":"Counterclockwise arrows button","category":8,"version":1,"tags":["again","anticlockwise","arrow","arrows","button","counterclockwise","deja","refresh","rewindershins","vu"],"shortcodes":["arrows_counterclockwise"]},{"emoji":"🔙","label":"BACK arrow","category":8,"version":0.6,"tags":["arrow"],"shortcodes":["back"]},{"emoji":"🔚","label":"END arrow","category":8,"version":0.6,"tags":["arrow"],"shortcodes":["end"]},{"emoji":"🔛","label":"ON! arrow","category":8,"version":0.6,"tags":["arrow","mark","on!"],"shortcodes":["on"]},{"emoji":"🔜","label":"SOON arrow","category":8,"version":0.6,"tags":["arrow","brb","omw"],"shortcodes":["soon"]},{"emoji":"🔝","label":"TOP arrow","category":8,"version":0.6,"tags":["arrow","homie","up"],"shortcodes":["top"]},{"emoji":"🛐","label":"Place of worship","category":8,"version":1,"tags":["place","pray","religion","worship"],"shortcodes":["place_of_worship"]},{"emoji":"⚛️","label":"Atom symbol","category":8,"version":1,"tags":["atheist","atom","symbol"],"shortcodes":["atom_symbol"]},{"emoji":"🕉️","label":"Om","category":8,"version":0.7,"tags":["hindu","religion"],"shortcodes":["om"]},{"emoji":"✡️","label":"Star of David","category":8,"version":0.7,"tags":["david","jew","jewish","judaism","religion","star"],"shortcodes":["star_of_david"]},{"emoji":"☸️","label":"Wheel of dharma","category":8,"version":0.7,"tags":["buddhist","dharma","religion","wheel"],"shortcodes":["wheel_of_dharma"]},{"emoji":"☯️","label":"Yin yang","category":8,"version":0.7,"tags":["difficult","lives","religion","tao","taoist","total","yang","yin","yinyang"],"shortcodes":["yin_yang"]},{"emoji":"✝️","label":"Latin cross","category":8,"version":0.7,"tags":["christ","christian","cross","latin","religion"],"shortcodes":["latin_cross"]},{"emoji":"☦️","label":"Orthodox cross","category":8,"version":1,"tags":["christian","cross","orthodox","religion"],"shortcodes":["orthodox_cross"]},{"emoji":"☪️","label":"Star and crescent","category":8,"version":0.7,"tags":["crescent","islam","muslim","ramadan","religion","star"],"shortcodes":["star_and_crescent"]},{"emoji":"☮️","label":"Peace symbol","category":8,"version":1,"tags":["healing","peace","peaceful","symbol"],"shortcodes":["peace_symbol"]},{"emoji":"🕎","label":"Menorah","category":8,"version":1,"tags":["candelabrum","candlestick","hanukkah","jewish","judaism","religion"],"shortcodes":["menorah"]},{"emoji":"🔯","label":"Dotted six-pointed star","category":8,"version":0.6,"tags":["dotted","fortune","jewish","judaism","six-pointed","star"],"shortcodes":["six_pointed_star"]},{"emoji":"🪯","label":"Khanda","category":8,"version":15,"tags":["deg","fateh","khalsa","religion","sikh","sikhism","tegh"],"shortcodes":["khanda"]},{"emoji":"♈️","label":"Aries","category":8,"version":0.6,"tags":["horoscope","ram","zodiac"],"shortcodes":["aries"]},{"emoji":"♉️","label":"Taurus","category":8,"version":0.6,"tags":["bull","horoscope","ox","zodiac"],"shortcodes":["taurus"]},{"emoji":"♊️","label":"Gemini","category":8,"version":0.6,"tags":["horoscope","twins","zodiac"],"shortcodes":["gemini"]},{"emoji":"♋️","label":"Cancer","category":8,"version":0.6,"tags":["crab","horoscope","zodiac"],"shortcodes":["cancer"]},{"emoji":"♌️","label":"Leo","category":8,"version":0.6,"tags":["horoscope","lion","zodiac"],"shortcodes":["leo"]},{"emoji":"♍️","label":"Virgo","category":8,"version":0.6,"tags":["horoscope","zodiac"],"shortcodes":["virgo"]},{"emoji":"♎️","label":"Libra","category":8,"version":0.6,"tags":["balance","horoscope","justice","scales","zodiac"],"shortcodes":["libra"]},{"emoji":"♏️","label":"Scorpio","category":8,"version":0.6,"tags":["horoscope","scorpio","scorpion","zodiac"],"shortcodes":["scorpius"]},{"emoji":"♐️","label":"Sagittarius","category":8,"version":0.6,"tags":["archer","horoscope","zodiac"],"shortcodes":["sagittarius"]},{"emoji":"♑️","label":"Capricorn","category":8,"version":0.6,"tags":["goat","horoscope","zodiac"],"shortcodes":["capricorn"]},{"emoji":"♒️","label":"Aquarius","category":8,"version":0.6,"tags":["bearer","horoscope","water","zodiac"],"shortcodes":["aquarius"]},{"emoji":"♓️","label":"Pisces","category":8,"version":0.6,"tags":["fish","horoscope","zodiac"],"shortcodes":["pisces"]},{"emoji":"⛎️","label":"Ophiuchus","category":8,"version":0.6,"tags":["bearer","serpent","snake","zodiac"],"shortcodes":["ophiuchus"]},{"emoji":"🔀","label":"Shuffle tracks button","category":8,"version":1,"tags":["arrow","button","crossed","shuffle","tracks"],"shortcodes":["twisted_rightwards_arrows"]},{"emoji":"🔁","label":"Repeat button","category":8,"version":1,"tags":["arrow","button","clockwise"],"shortcodes":["repeat"]},{"emoji":"🔂","label":"Repeat single button","category":8,"version":1,"tags":["arrow","button","clockwise","once","repeat","single"],"shortcodes":["repeat_one"]},{"emoji":"▶️","label":"Play button","category":8,"version":0.6,"tags":["arrow","button","play","right","triangle"],"shortcodes":["arrow_forward"]},{"emoji":"⏩️","label":"Fast-forward button","category":8,"version":0.6,"tags":["arrow","button","double","fast","fast-forward","forward"],"shortcodes":["fast_forward"]},{"emoji":"⏭️","label":"Next track button","category":8,"version":0.7,"tags":["arrow","button","next","scene","track","triangle"],"shortcodes":["next_track_button"]},{"emoji":"⏯️","label":"Play or pause button","category":8,"version":1,"tags":["arrow","button","pause","play","right","triangle"],"shortcodes":["play_or_pause_button"]},{"emoji":"◀️","label":"Reverse button","category":8,"version":0.6,"tags":["arrow","button","left","reverse","triangle"],"shortcodes":["arrow_backward"]},{"emoji":"⏪️","label":"Fast reverse button","category":8,"version":0.6,"tags":["arrow","button","double","fast","reverse"],"shortcodes":["rewind"]},{"emoji":"⏮️","label":"Last track button","category":8,"version":0.7,"tags":["arrow","button","last","previous","scene","track","triangle"],"shortcodes":["previous_track_button"]},{"emoji":"🔼","label":"Upwards button","category":8,"version":0.6,"tags":["arrow","button","red","up","upwards"],"shortcodes":["arrow_up_small"]},{"emoji":"⏫️","label":"Fast up button","category":8,"version":0.6,"tags":["arrow","button","double","fast","up"],"shortcodes":["arrow_double_up"]},{"emoji":"🔽","label":"Downwards button","category":8,"version":0.6,"tags":["arrow","button","down","downwards","red"],"shortcodes":["arrow_down_small"]},{"emoji":"⏬️","label":"Fast down button","category":8,"version":0.6,"tags":["arrow","button","double","down","fast"],"shortcodes":["arrow_double_down"]},{"emoji":"⏸️","label":"Pause button","category":8,"version":0.7,"tags":["bar","button","double","pause","vertical"],"shortcodes":["pause_button"]},{"emoji":"⏹️","label":"Stop button","category":8,"version":0.7,"tags":["button","square","stop"],"shortcodes":["stop_button"]},{"emoji":"⏺️","label":"Record button","category":8,"version":0.7,"tags":["button","circle","record"],"shortcodes":["record_button"]},{"emoji":"⏏️","label":"Eject button","category":8,"version":1,"tags":["button","eject"],"shortcodes":["eject_button"]},{"emoji":"🎦","label":"Cinema","category":8,"version":0.6,"tags":["camera","film","movie"],"shortcodes":["cinema"]},{"emoji":"🔅","label":"Dim button","category":8,"version":1,"tags":["brightness","button","dim","low"],"shortcodes":["low_brightness"]},{"emoji":"🔆","label":"Bright button","category":8,"version":1,"tags":["bright","brightness","button","light"],"shortcodes":["high_brightness"]},{"emoji":"📶","label":"Antenna bars","category":8,"version":0.6,"tags":["antenna","bar","bars","cell","communication","mobile","phone","signal","telephone"],"shortcodes":["signal_strength"]},{"emoji":"🛜","label":"Wireless","category":8,"version":15,"tags":["broadband","computer","connectivity","hotspot","internet","network","router","smartphone","wi-fi","wifi","wlan"],"shortcodes":["wireless"]},{"emoji":"📳","label":"Vibration mode","category":8,"version":0.6,"tags":["cell","communication","mobile","mode","phone","telephone","vibration"],"shortcodes":["vibration_mode"]},{"emoji":"📴","label":"Mobile phone off","category":8,"version":0.6,"tags":["cell","mobile","off","phone","telephone"],"shortcodes":["mobile_phone_off"]},{"emoji":"♀️","label":"Female sign","category":8,"version":4,"tags":["female","sign","woman"],"shortcodes":["female_sign"]},{"emoji":"♂️","label":"Male sign","category":8,"version":4,"tags":["male","man","sign"],"shortcodes":["male_sign"]},{"emoji":"⚧️","label":"Transgender symbol","category":8,"version":13,"tags":["symbol","transgender"],"shortcodes":["transgender_symbol"]},{"emoji":"✖️","label":"Multiply","category":8,"version":0.6,"tags":["cancel","multiplication","sign","x","×"],"shortcodes":["heavy_multiplication_x"]},{"emoji":"➕️","label":"Plus","category":8,"version":0.6,"tags":["+"],"shortcodes":["heavy_plus_sign"]},{"emoji":"➖️","label":"Minus","category":8,"version":0.6,"tags":["-","heavy","math","sign","−"],"shortcodes":["heavy_minus_sign"]},{"emoji":"➗️","label":"Divide","category":8,"version":0.6,"tags":["division","heavy","math","sign","÷"],"shortcodes":["heavy_division_sign"]},{"emoji":"🟰","label":"Heavy equals sign","category":8,"version":14,"tags":["answer","equal","equality","equals","heavy","math","sign"],"shortcodes":["heavy_equals_sign"]},{"emoji":"♾️","label":"Infinity","category":8,"version":11,"tags":["forever","unbounded","universal"],"shortcodes":["infinity"]},{"emoji":"‼️","label":"Double exclamation mark","category":8,"version":0.6,"tags":["!","!!","double","exclamation","mark","punctuation"],"shortcodes":["bangbang"]},{"emoji":"⁉️","label":"Exclamation question mark","category":8,"version":0.6,"tags":["!","!?","?","exclamation","mark","punctuation","question"],"shortcodes":["interrobang"]},{"emoji":"❓️","label":"Red question mark","category":8,"version":0.6,"tags":["?","mark","punctuation","red"],"shortcodes":["question"]},{"emoji":"❔️","label":"White question mark","category":8,"version":0.6,"tags":["?","mark","outlined","punctuation","question","white"],"shortcodes":["grey_question"]},{"emoji":"❕️","label":"White exclamation mark","category":8,"version":0.6,"tags":["!","exclamation","mark","outlined","punctuation","white"],"shortcodes":["grey_exclamation"]},{"emoji":"❗️","label":"Red exclamation mark","category":8,"version":0.6,"tags":["!","mark","punctuation","red"],"shortcodes":["exclamation","heavy_exclamation_mark"]},{"emoji":"〰️","label":"Wavy dash","category":8,"version":0.6,"tags":["dash","punctuation","wavy"],"shortcodes":["wavy_dash"]},{"emoji":"💱","label":"Currency exchange","category":8,"version":0.6,"tags":["bank","currency","exchange","money"],"shortcodes":["currency_exchange"]},{"emoji":"💲","label":"Heavy dollar sign","category":8,"version":0.6,"tags":["billion","cash","charge","currency","dollar","heavy","million","money","pay","sign"],"shortcodes":["heavy_dollar_sign"]},{"emoji":"⚕️","label":"Medical symbol","category":8,"version":4,"tags":["aesculapius","medical","medicine","staff","symbol"],"shortcodes":["medical_symbol"]},{"emoji":"♻️","label":"Recycling symbol","category":8,"version":0.6,"tags":["recycling","symbol"],"shortcodes":["recycle"]},{"emoji":"⚜️","label":"Fleur-de-lis","category":8,"version":1,"tags":["knights"],"shortcodes":["fleur_de_lis"]},{"emoji":"🔱","label":"Trident emblem","category":8,"version":0.6,"tags":["anchor","emblem","poseidon","ship","tool"],"shortcodes":["trident"]},{"emoji":"📛","label":"Name badge","category":8,"version":0.6,"tags":["badge","name"],"shortcodes":["name_badge"]},{"emoji":"🔰","label":"Japanese symbol for beginner","category":8,"version":0.6,"tags":["chevron","green","japanese","leaf","symbol","tool","yellow"],"shortcodes":["beginner"]},{"emoji":"⭕️","label":"Hollow red circle","category":8,"version":0.6,"tags":["circle","heavy","hollow","large","red"],"shortcodes":["o"]},{"emoji":"✅️","label":"Check mark button","category":8,"version":0.6,"tags":["button","check","checked","checkmark","complete","completed","done","fixed","mark","tick","✓"],"shortcodes":["white_check_mark"]},{"emoji":"☑️","label":"Check box with check","category":8,"version":0.6,"tags":["ballot","box","check","checked","done","off","tick","✓"],"shortcodes":["ballot_box_with_check"]},{"emoji":"✔️","label":"Check mark","category":8,"version":0.6,"tags":["check","checked","checkmark","done","heavy","mark","tick","✓"],"shortcodes":["heavy_check_mark"]},{"emoji":"❌️","label":"Cross mark","category":8,"version":0.6,"tags":["cancel","cross","mark","multiplication","multiply","×"],"shortcodes":["x"]},{"emoji":"❎️","label":"Cross mark button","category":8,"version":0.6,"tags":["button","cross","mark","multiplication","multiply","square","x","×"],"shortcodes":["negative_squared_cross_mark"]},{"emoji":"➰️","label":"Curly loop","category":8,"version":0.6,"tags":["curl","curly","loop"],"shortcodes":["curly_loop"]},{"emoji":"➿️","label":"Double curly loop","category":8,"version":1,"tags":["curl","curly","double"],"shortcodes":["loop"]},{"emoji":"〽️","label":"Part alternation mark","category":8,"version":0.6,"tags":["alternation","mark","part"],"shortcodes":["part_alternation_mark"]},{"emoji":"✳️","label":"Eight-spoked asterisk","category":8,"version":0.6,"tags":["*","asterisk","eight-spoked"],"shortcodes":["eight_spoked_asterisk"]},{"emoji":"✴️","label":"Eight-pointed star","category":8,"version":0.6,"tags":["*","eight-pointed","star"],"shortcodes":["eight_pointed_black_star"]},{"emoji":"❇️","label":"Sparkle","category":8,"version":0.6,"tags":["*"],"shortcodes":["sparkle"]},{"emoji":"©️","label":"Copyright","category":8,"version":0.6,"tags":["c"],"shortcodes":["copyright"]},{"emoji":"®️","label":"Registered","category":8,"version":0.6,"tags":["r"],"shortcodes":["registered"]},{"emoji":"™️","label":"Trade mark","category":8,"version":0.6,"tags":["mark","trade","trademark"],"shortcodes":["tm"]},{"emoji":"🫟","label":"Splatter","category":8,"version":16,"tags":["drip","holi","ink","liquid","mess","paint","spill","stain"],"shortcodes":[]},{"emoji":"#️⃣","label":"Keycap: #","category":8,"version":0.6,"tags":["keycap"],"shortcodes":["hash"]},{"emoji":"*️⃣","label":"Keycap: *","category":8,"version":2,"tags":["keycap"],"shortcodes":["asterisk"]},{"emoji":"0️⃣","label":"Keycap: 0","category":8,"version":0.6,"tags":["0","keycap"],"shortcodes":["zero"]},{"emoji":"1️⃣","label":"Keycap: 1","category":8,"version":0.6,"tags":["1","keycap"],"shortcodes":["one"]},{"emoji":"2️⃣","label":"Keycap: 2","category":8,"version":0.6,"tags":["2","keycap"],"shortcodes":["two"]},{"emoji":"3️⃣","label":"Keycap: 3","category":8,"version":0.6,"tags":["3","keycap"],"shortcodes":["three"]},{"emoji":"4️⃣","label":"Keycap: 4","category":8,"version":0.6,"tags":["4","keycap"],"shortcodes":["four"]},{"emoji":"5️⃣","label":"Keycap: 5","category":8,"version":0.6,"tags":["5","keycap"],"shortcodes":["five"]},{"emoji":"6️⃣","label":"Keycap: 6","category":8,"version":0.6,"tags":["6","keycap"],"shortcodes":["six"]},{"emoji":"7️⃣","label":"Keycap: 7","category":8,"version":0.6,"tags":["7","keycap"],"shortcodes":["seven"]},{"emoji":"8️⃣","label":"Keycap: 8","category":8,"version":0.6,"tags":["8","keycap"],"shortcodes":["eight"]},{"emoji":"9️⃣","label":"Keycap: 9","category":8,"version":0.6,"tags":["9","keycap"],"shortcodes":["nine"]},{"emoji":"🔟","label":"Keycap: 10","category":8,"version":0.6,"tags":["keycap"],"shortcodes":["keycap_ten"]},{"emoji":"🔠","label":"Input latin uppercase","category":8,"version":0.6,"tags":["abcd","input","latin","letters","uppercase"],"shortcodes":["capital_abcd"]},{"emoji":"🔡","label":"Input latin lowercase","category":8,"version":0.6,"tags":["input","latin","letters","lowercase"],"shortcodes":["abcd"]},{"emoji":"🔢","label":"Input numbers","category":8,"version":0.6,"tags":["input","numbers"],"shortcodes":["1234"]},{"emoji":"🔣","label":"Input symbols","category":8,"version":0.6,"tags":["%","&","input","♪","〒"],"shortcodes":["symbols"]},{"emoji":"🔤","label":"Input latin letters","category":8,"version":0.6,"tags":["alphabet","input","latin","letters"],"shortcodes":["abc"]},{"emoji":"🅰️","label":"A button (blood type)","category":8,"version":0.6,"tags":["blood","button","type"],"shortcodes":["a"]},{"emoji":"🆎","label":"AB button (blood type)","category":8,"version":0.6,"tags":["blood","button","type"],"shortcodes":["ab"]},{"emoji":"🅱️","label":"B button (blood type)","category":8,"version":0.6,"tags":["blood","button","type"],"shortcodes":["b"]},{"emoji":"🆑","label":"CL button","category":8,"version":0.6,"tags":["button"],"shortcodes":["cl"]},{"emoji":"🆒","label":"COOL button","category":8,"version":0.6,"tags":["button"],"shortcodes":["cool"]},{"emoji":"🆓","label":"FREE button","category":8,"version":0.6,"tags":["button"],"shortcodes":["free"]},{"emoji":"ℹ️","label":"Information","category":8,"version":0.6,"tags":["i"],"shortcodes":["information_source"]},{"emoji":"🆔","label":"ID button","category":8,"version":0.6,"tags":["button","identity"],"shortcodes":["id"]},{"emoji":"Ⓜ️","label":"Circled M","category":8,"version":0.6,"tags":["circle","circled"],"shortcodes":["m"]},{"emoji":"🆕","label":"NEW button","category":8,"version":0.6,"tags":["button"],"shortcodes":["new"]},{"emoji":"🆖","label":"NG button","category":8,"version":0.6,"tags":["button"],"shortcodes":["ng"]},{"emoji":"🅾️","label":"O button (blood type)","category":8,"version":0.6,"tags":["blood","button","o","type"],"shortcodes":["o2"]},{"emoji":"🆗","label":"OK button","category":8,"version":0.6,"tags":["button","okay"],"shortcodes":["ok"]},{"emoji":"🅿️","label":"P button","category":8,"version":0.6,"tags":["button","p"],"shortcodes":["parking"]},{"emoji":"🆘","label":"SOS button","category":8,"version":0.6,"tags":["button","help"],"shortcodes":["sos"]},{"emoji":"🆙","label":"UP! button","category":8,"version":0.6,"tags":["button","mark","up!"],"shortcodes":["up"]},{"emoji":"🆚","label":"VS button","category":8,"version":0.6,"tags":["button","versus"],"shortcodes":["vs"]},{"emoji":"🈁","label":"Japanese “here” button","category":8,"version":0.6,"tags":["button","here","japanese","katakana"],"shortcodes":["koko"]},{"emoji":"🈂️","label":"Japanese “service charge” button","category":8,"version":0.6,"tags":["button","charge","japanese","katakana","service"],"shortcodes":["sa"]},{"emoji":"🈷️","label":"Japanese “monthly amount” button","category":8,"version":0.6,"tags":["amount","button","ideograph","japanese","monthly"],"shortcodes":["u6708"]},{"emoji":"🈶","label":"Japanese “not free of charge” button","category":8,"version":0.6,"tags":["button","charge","free","ideograph","japanese","not"],"shortcodes":["u6709"]},{"emoji":"🈯️","label":"Japanese “reserved” button","category":8,"version":0.6,"tags":["button","ideograph","japanese","reserved"],"shortcodes":["u6307"]},{"emoji":"🉐","label":"Japanese “bargain” button","category":8,"version":0.6,"tags":["bargain","button","ideograph","japanese"],"shortcodes":["ideograph_advantage"]},{"emoji":"🈹","label":"Japanese “discount” button","category":8,"version":0.6,"tags":["button","discount","ideograph","japanese"],"shortcodes":["u5272"]},{"emoji":"🈚️","label":"Japanese “free of charge” button","category":8,"version":0.6,"tags":["button","charge","free","ideograph","japanese"],"shortcodes":["u7121"]},{"emoji":"🈲","label":"Japanese “prohibited” button","category":8,"version":0.6,"tags":["button","ideograph","japanese","prohibited"],"shortcodes":["u7981"]},{"emoji":"🉑","label":"Japanese “acceptable” button","category":8,"version":0.6,"tags":["acceptable","button","ideograph","japanese"],"shortcodes":["accept"]},{"emoji":"🈸","label":"Japanese “application” button","category":8,"version":0.6,"tags":["application","button","ideograph","japanese"],"shortcodes":["u7533"]},{"emoji":"🈴","label":"Japanese “passing grade” button","category":8,"version":0.6,"tags":["button","grade","ideograph","japanese","passing"],"shortcodes":["u5408"]},{"emoji":"🈳","label":"Japanese “vacancy” button","category":8,"version":0.6,"tags":["button","ideograph","japanese","vacancy"],"shortcodes":["u7a7a"]},{"emoji":"㊗️","label":"Japanese “congratulations” button","category":8,"version":0.6,"tags":["button","ideograph","japanese"],"shortcodes":["congratulations"]},{"emoji":"㊙️","label":"Japanese “secret” button","category":8,"version":0.6,"tags":["button","ideograph","japanese"],"shortcodes":["secret"]},{"emoji":"🈺","label":"Japanese “open for business” button","category":8,"version":0.6,"tags":["business","button","ideograph","japanese","open"],"shortcodes":["u55b6"]},{"emoji":"🈵","label":"Japanese “no vacancy” button","category":8,"version":0.6,"tags":["button","ideograph","japanese","no","vacancy"],"shortcodes":["u6e80"]},{"emoji":"🔴","label":"Red circle","category":8,"version":0.6,"tags":["circle","geometric","red"],"shortcodes":["red_circle"]},{"emoji":"🟠","label":"Orange circle","category":8,"version":12,"tags":["circle","orange"],"shortcodes":["orange_circle"]},{"emoji":"🟡","label":"Yellow circle","category":8,"version":12,"tags":["circle","yellow"],"shortcodes":["yellow_circle"]},{"emoji":"🟢","label":"Green circle","category":8,"version":12,"tags":["circle","green"],"shortcodes":["green_circle"]},{"emoji":"🔵","label":"Blue circle","category":8,"version":0.6,"tags":["blue","circle","geometric"],"shortcodes":["large_blue_circle"]},{"emoji":"🟣","label":"Purple circle","category":8,"version":12,"tags":["circle","purple"],"shortcodes":["purple_circle"]},{"emoji":"🟤","label":"Brown circle","category":8,"version":12,"tags":["brown","circle"],"shortcodes":["brown_circle"]},{"emoji":"⚫️","label":"Black circle","category":8,"version":0.6,"tags":["black","circle","geometric"],"shortcodes":["black_circle"]},{"emoji":"⚪️","label":"White circle","category":8,"version":0.6,"tags":["circle","geometric","white"],"shortcodes":["white_circle"]},{"emoji":"🟥","label":"Red square","category":8,"version":12,"tags":["card","penalty","red","square"],"shortcodes":["red_square"]},{"emoji":"🟧","label":"Orange square","category":8,"version":12,"tags":["orange","square"],"shortcodes":["orange_square"]},{"emoji":"🟨","label":"Yellow square","category":8,"version":12,"tags":["card","penalty","square","yellow"],"shortcodes":["yellow_square"]},{"emoji":"🟩","label":"Green square","category":8,"version":12,"tags":["green","square"],"shortcodes":["green_square"]},{"emoji":"🟦","label":"Blue square","category":8,"version":12,"tags":["blue","square"],"shortcodes":["blue_square"]},{"emoji":"🟪","label":"Purple square","category":8,"version":12,"tags":["purple","square"],"shortcodes":["purple_square"]},{"emoji":"🟫","label":"Brown square","category":8,"version":12,"tags":["brown","square"],"shortcodes":["brown_square"]},{"emoji":"⬛️","label":"Black large square","category":8,"version":0.6,"tags":["black","geometric","large","square"],"shortcodes":["black_large_square"]},{"emoji":"⬜️","label":"White large square","category":8,"version":0.6,"tags":["geometric","large","square","white"],"shortcodes":["white_large_square"]},{"emoji":"◼️","label":"Black medium square","category":8,"version":0.6,"tags":["black","geometric","medium","square"],"shortcodes":["black_medium_square"]},{"emoji":"◻️","label":"White medium square","category":8,"version":0.6,"tags":["geometric","medium","square","white"],"shortcodes":["white_medium_square"]},{"emoji":"◾️","label":"Black medium-small square","category":8,"version":0.6,"tags":["black","geometric","medium-small","square"],"shortcodes":["black_medium_small_square"]},{"emoji":"◽️","label":"White medium-small square","category":8,"version":0.6,"tags":["geometric","medium-small","square","white"],"shortcodes":["white_medium_small_square"]},{"emoji":"▪️","label":"Black small square","category":8,"version":0.6,"tags":["black","geometric","small","square"],"shortcodes":["black_small_square"]},{"emoji":"▫️","label":"White small square","category":8,"version":0.6,"tags":["geometric","small","square","white"],"shortcodes":["white_small_square"]},{"emoji":"🔶","label":"Large orange diamond","category":8,"version":0.6,"tags":["diamond","geometric","large","orange"],"shortcodes":["large_orange_diamond"]},{"emoji":"🔷","label":"Large blue diamond","category":8,"version":0.6,"tags":["blue","diamond","geometric","large"],"shortcodes":["large_blue_diamond"]},{"emoji":"🔸","label":"Small orange diamond","category":8,"version":0.6,"tags":["diamond","geometric","orange","small"],"shortcodes":["small_orange_diamond"]},{"emoji":"🔹","label":"Small blue diamond","category":8,"version":0.6,"tags":["blue","diamond","geometric","small"],"shortcodes":["small_blue_diamond"]},{"emoji":"🔺","label":"Red triangle pointed up","category":8,"version":0.6,"tags":["geometric","pointed","red","triangle","up"],"shortcodes":["small_red_triangle"]},{"emoji":"🔻","label":"Red triangle pointed down","category":8,"version":0.6,"tags":["down","geometric","pointed","red","triangle"],"shortcodes":["small_red_triangle_down"]},{"emoji":"💠","label":"Diamond with a dot","category":8,"version":0.6,"tags":["comic","diamond","dot","geometric"],"shortcodes":["diamond_shape_with_a_dot_inside"]},{"emoji":"🔘","label":"Radio button","category":8,"version":0.6,"tags":["button","geometric","radio"],"shortcodes":["radio_button"]},{"emoji":"🔳","label":"White square button","category":8,"version":0.6,"tags":["button","geometric","outlined","square","white"],"shortcodes":["white_square_button"]},{"emoji":"🔲","label":"Black square button","category":8,"version":0.6,"tags":["black","button","geometric","square"],"shortcodes":["black_square_button"]},{"emoji":"🏁","label":"Chequered flag","category":9,"version":0.6,"tags":["checkered","chequered","finish","flag","flags","game","race","racing","sport","win"],"shortcodes":["checkered_flag"]},{"emoji":"🚩","label":"Triangular flag","category":9,"version":0.6,"tags":["construction","flag","golf","post","triangular"],"shortcodes":["triangular_flag_on_post"]},{"emoji":"🎌","label":"Crossed flags","category":9,"version":0.6,"tags":["celebration","cross","crossed","flags","japanese"],"shortcodes":["crossed_flags"]},{"emoji":"🏴","label":"Black flag","category":9,"version":1,"tags":["black","flag","waving"],"shortcodes":["black_flag"]},{"emoji":"🏳️","label":"White flag","category":9,"version":0.7,"tags":["flag","waving","white"],"shortcodes":["white_flag"]},{"emoji":"🏳️‍🌈","label":"Rainbow flag","category":9,"version":4,"tags":["bisexual","flag","gay","genderqueer","glbt","glbtq","lesbian","lgbt","lgbtq","lgbtqia","pride","queer","rainbow","trans","transgender"],"shortcodes":["rainbow_flag"]},{"emoji":"🏳️‍⚧️","label":"Transgender flag","category":9,"version":13,"tags":["blue","flag","light","pink","transgender","white"],"shortcodes":["transgender_flag"]},{"emoji":"🏴‍☠️","label":"Pirate flag","category":9,"version":11,"tags":["flag","jolly","pirate","plunder","roger","treasure"],"shortcodes":["pirate_flag"]},{"emoji":"🇦🇨","label":"Flag: Ascension Island","category":9,"version":2,"tags":["AC","flag"],"shortcodes":["ascension_island"],"countryFlag":true},{"emoji":"🇦🇩","label":"Flag: Andorra","category":9,"version":2,"tags":["AD","flag"],"shortcodes":["andorra"],"countryFlag":true},{"emoji":"🇦🇪","label":"Flag: United Arab Emirates","category":9,"version":2,"tags":["AE","flag"],"shortcodes":["united_arab_emirates"],"countryFlag":true},{"emoji":"🇦🇫","label":"Flag: Afghanistan","category":9,"version":2,"tags":["AF","flag"],"shortcodes":["afghanistan"],"countryFlag":true},{"emoji":"🇦🇬","label":"Flag: Antigua & Barbuda","category":9,"version":2,"tags":["AG","flag"],"shortcodes":["antigua_barbuda"],"countryFlag":true},{"emoji":"🇦🇮","label":"Flag: Anguilla","category":9,"version":2,"tags":["AI","flag"],"shortcodes":["anguilla"],"countryFlag":true},{"emoji":"🇦🇱","label":"Flag: Albania","category":9,"version":2,"tags":["AL","flag"],"shortcodes":["albania"],"countryFlag":true},{"emoji":"🇦🇲","label":"Flag: Armenia","category":9,"version":2,"tags":["AM","flag"],"shortcodes":["armenia"],"countryFlag":true},{"emoji":"🇦🇴","label":"Flag: Angola","category":9,"version":2,"tags":["AO","flag"],"shortcodes":["angola"],"countryFlag":true},{"emoji":"🇦🇶","label":"Flag: Antarctica","category":9,"version":2,"tags":["AQ","flag"],"shortcodes":["antarctica"],"countryFlag":true},{"emoji":"🇦🇷","label":"Flag: Argentina","category":9,"version":2,"tags":["AR","flag"],"shortcodes":["argentina"],"countryFlag":true},{"emoji":"🇦🇸","label":"Flag: American Samoa","category":9,"version":2,"tags":["AS","flag"],"shortcodes":["american_samoa"],"countryFlag":true},{"emoji":"🇦🇹","label":"Flag: Austria","category":9,"version":2,"tags":["AT","flag"],"shortcodes":["austria"],"countryFlag":true},{"emoji":"🇦🇺","label":"Flag: Australia","category":9,"version":2,"tags":["AU","flag"],"shortcodes":["australia"],"countryFlag":true},{"emoji":"🇦🇼","label":"Flag: Aruba","category":9,"version":2,"tags":["AW","flag"],"shortcodes":["aruba"],"countryFlag":true},{"emoji":"🇦🇽","label":"Flag: Åland Islands","category":9,"version":2,"tags":["AX","flag"],"shortcodes":["aland_islands"],"countryFlag":true},{"emoji":"🇦🇿","label":"Flag: Azerbaijan","category":9,"version":2,"tags":["AZ","flag"],"shortcodes":["azerbaijan"],"countryFlag":true},{"emoji":"🇧🇦","label":"Flag: Bosnia & Herzegovina","category":9,"version":2,"tags":["BA","flag"],"shortcodes":["bosnia_herzegovina"],"countryFlag":true},{"emoji":"🇧🇧","label":"Flag: Barbados","category":9,"version":2,"tags":["BB","flag"],"shortcodes":["barbados"],"countryFlag":true},{"emoji":"🇧🇩","label":"Flag: Bangladesh","category":9,"version":2,"tags":["BD","flag"],"shortcodes":["bangladesh"],"countryFlag":true},{"emoji":"🇧🇪","label":"Flag: Belgium","category":9,"version":2,"tags":["BE","flag"],"shortcodes":["belgium"],"countryFlag":true},{"emoji":"🇧🇫","label":"Flag: Burkina Faso","category":9,"version":2,"tags":["BF","flag"],"shortcodes":["burkina_faso"],"countryFlag":true},{"emoji":"🇧🇬","label":"Flag: Bulgaria","category":9,"version":2,"tags":["BG","flag"],"shortcodes":["bulgaria"],"countryFlag":true},{"emoji":"🇧🇭","label":"Flag: Bahrain","category":9,"version":2,"tags":["BH","flag"],"shortcodes":["bahrain"],"countryFlag":true},{"emoji":"🇧🇮","label":"Flag: Burundi","category":9,"version":2,"tags":["BI","flag"],"shortcodes":["burundi"],"countryFlag":true},{"emoji":"🇧🇯","label":"Flag: Benin","category":9,"version":2,"tags":["BJ","flag"],"shortcodes":["benin"],"countryFlag":true},{"emoji":"🇧🇱","label":"Flag: St. Barthélemy","category":9,"version":2,"tags":["BL","flag"],"shortcodes":["st_barthelemy"],"countryFlag":true},{"emoji":"🇧🇲","label":"Flag: Bermuda","category":9,"version":2,"tags":["BM","flag"],"shortcodes":["bermuda"],"countryFlag":true},{"emoji":"🇧🇳","label":"Flag: Brunei","category":9,"version":2,"tags":["BN","flag"],"shortcodes":["brunei"],"countryFlag":true},{"emoji":"🇧🇴","label":"Flag: Bolivia","category":9,"version":2,"tags":["BO","flag"],"shortcodes":["bolivia"],"countryFlag":true},{"emoji":"🇧🇶","label":"Flag: Caribbean Netherlands","category":9,"version":2,"tags":["BQ","flag"],"shortcodes":["caribbean_netherlands"],"countryFlag":true},{"emoji":"🇧🇷","label":"Flag: Brazil","category":9,"version":2,"tags":["BR","flag"],"shortcodes":["brazil"],"countryFlag":true},{"emoji":"🇧🇸","label":"Flag: Bahamas","category":9,"version":2,"tags":["BS","flag"],"shortcodes":["bahamas"],"countryFlag":true},{"emoji":"🇧🇹","label":"Flag: Bhutan","category":9,"version":2,"tags":["BT","flag"],"shortcodes":["bhutan"],"countryFlag":true},{"emoji":"🇧🇻","label":"Flag: Bouvet Island","category":9,"version":2,"tags":["BV","flag"],"shortcodes":["bouvet_island"],"countryFlag":true},{"emoji":"🇧🇼","label":"Flag: Botswana","category":9,"version":2,"tags":["BW","flag"],"shortcodes":["botswana"],"countryFlag":true},{"emoji":"🇧🇾","label":"Flag: Belarus","category":9,"version":2,"tags":["BY","flag"],"shortcodes":["belarus"],"countryFlag":true},{"emoji":"🇧🇿","label":"Flag: Belize","category":9,"version":2,"tags":["BZ","flag"],"shortcodes":["belize"],"countryFlag":true},{"emoji":"🇨🇦","label":"Flag: Canada","category":9,"version":2,"tags":["CA","flag"],"shortcodes":["canada"],"countryFlag":true},{"emoji":"🇨🇨","label":"Flag: Cocos (Keeling) Islands","category":9,"version":2,"tags":["CC","flag"],"shortcodes":["cocos_islands"],"countryFlag":true},{"emoji":"🇨🇩","label":"Flag: Congo - Kinshasa","category":9,"version":2,"tags":["CD","flag"],"shortcodes":["congo_kinshasa"],"countryFlag":true},{"emoji":"🇨🇫","label":"Flag: Central African Republic","category":9,"version":2,"tags":["CF","flag"],"shortcodes":["central_african_republic"],"countryFlag":true},{"emoji":"🇨🇬","label":"Flag: Congo - Brazzaville","category":9,"version":2,"tags":["CG","flag"],"shortcodes":["congo_brazzaville"],"countryFlag":true},{"emoji":"🇨🇭","label":"Flag: Switzerland","category":9,"version":2,"tags":["CH","flag"],"shortcodes":["switzerland"],"countryFlag":true},{"emoji":"🇨🇮","label":"Flag: Côte d’Ivoire","category":9,"version":2,"tags":["CI","flag"],"shortcodes":["cote_divoire"],"countryFlag":true},{"emoji":"🇨🇰","label":"Flag: Cook Islands","category":9,"version":2,"tags":["CK","flag"],"shortcodes":["cook_islands"],"countryFlag":true},{"emoji":"🇨🇱","label":"Flag: Chile","category":9,"version":2,"tags":["CL","flag"],"shortcodes":["chile"],"countryFlag":true},{"emoji":"🇨🇲","label":"Flag: Cameroon","category":9,"version":2,"tags":["CM","flag"],"shortcodes":["cameroon"],"countryFlag":true},{"emoji":"🇨🇳","label":"Flag: China","category":9,"version":0.6,"tags":["CN","flag"],"shortcodes":["cn"],"countryFlag":true},{"emoji":"🇨🇴","label":"Flag: Colombia","category":9,"version":2,"tags":["CO","flag"],"shortcodes":["colombia"],"countryFlag":true},{"emoji":"🇨🇵","label":"Flag: Clipperton Island","category":9,"version":2,"tags":["CP","flag"],"shortcodes":["clipperton_island"],"countryFlag":true},{"emoji":"🇨🇶","label":"Flag: Sark","category":9,"version":16,"tags":["CQ","flag"],"shortcodes":[],"countryFlag":true},{"emoji":"🇨🇷","label":"Flag: Costa Rica","category":9,"version":2,"tags":["CR","flag"],"shortcodes":["costa_rica"],"countryFlag":true},{"emoji":"🇨🇺","label":"Flag: Cuba","category":9,"version":2,"tags":["CU","flag"],"shortcodes":["cuba"],"countryFlag":true},{"emoji":"🇨🇻","label":"Flag: Cape Verde","category":9,"version":2,"tags":["CV","flag"],"shortcodes":["cape_verde"],"countryFlag":true},{"emoji":"🇨🇼","label":"Flag: Curaçao","category":9,"version":2,"tags":["CW","flag"],"shortcodes":["curacao"],"countryFlag":true},{"emoji":"🇨🇽","label":"Flag: Christmas Island","category":9,"version":2,"tags":["CX","flag"],"shortcodes":["christmas_island"],"countryFlag":true},{"emoji":"🇨🇾","label":"Flag: Cyprus","category":9,"version":2,"tags":["CY","flag"],"shortcodes":["cyprus"],"countryFlag":true},{"emoji":"🇨🇿","label":"Flag: Czechia","category":9,"version":2,"tags":["CZ","flag"],"shortcodes":["czech_republic"],"countryFlag":true},{"emoji":"🇩🇪","label":"Flag: Germany","category":9,"version":0.6,"tags":["DE","flag"],"shortcodes":["de"],"countryFlag":true},{"emoji":"🇩🇬","label":"Flag: Diego Garcia","category":9,"version":2,"tags":["DG","flag"],"shortcodes":["diego_garcia"],"countryFlag":true},{"emoji":"🇩🇯","label":"Flag: Djibouti","category":9,"version":2,"tags":["DJ","flag"],"shortcodes":["djibouti"],"countryFlag":true},{"emoji":"🇩🇰","label":"Flag: Denmark","category":9,"version":2,"tags":["DK","flag"],"shortcodes":["denmark"],"countryFlag":true},{"emoji":"🇩🇲","label":"Flag: Dominica","category":9,"version":2,"tags":["DM","flag"],"shortcodes":["dominica"],"countryFlag":true},{"emoji":"🇩🇴","label":"Flag: Dominican Republic","category":9,"version":2,"tags":["DO","flag"],"shortcodes":["dominican_republic"],"countryFlag":true},{"emoji":"🇩🇿","label":"Flag: Algeria","category":9,"version":2,"tags":["DZ","flag"],"shortcodes":["algeria"],"countryFlag":true},{"emoji":"🇪🇦","label":"Flag: Ceuta & Melilla","category":9,"version":2,"tags":["EA","flag"],"shortcodes":["ceuta_melilla"],"countryFlag":true},{"emoji":"🇪🇨","label":"Flag: Ecuador","category":9,"version":2,"tags":["EC","flag"],"shortcodes":["ecuador"],"countryFlag":true},{"emoji":"🇪🇪","label":"Flag: Estonia","category":9,"version":2,"tags":["EE","flag"],"shortcodes":["estonia"],"countryFlag":true},{"emoji":"🇪🇬","label":"Flag: Egypt","category":9,"version":2,"tags":["EG","flag"],"shortcodes":["egypt"],"countryFlag":true},{"emoji":"🇪🇭","label":"Flag: Western Sahara","category":9,"version":2,"tags":["EH","flag"],"shortcodes":["western_sahara"],"countryFlag":true},{"emoji":"🇪🇷","label":"Flag: Eritrea","category":9,"version":2,"tags":["ER","flag"],"shortcodes":["eritrea"],"countryFlag":true},{"emoji":"🇪🇸","label":"Flag: Spain","category":9,"version":0.6,"tags":["ES","flag"],"shortcodes":["es"],"countryFlag":true},{"emoji":"🇪🇹","label":"Flag: Ethiopia","category":9,"version":2,"tags":["ET","flag"],"shortcodes":["ethiopia"],"countryFlag":true},{"emoji":"🇪🇺","label":"Flag: European Union","category":9,"version":2,"tags":["EU","flag"],"shortcodes":["eu","european_union"],"countryFlag":true},{"emoji":"🇫🇮","label":"Flag: Finland","category":9,"version":2,"tags":["FI","flag"],"shortcodes":["finland"],"countryFlag":true},{"emoji":"🇫🇯","label":"Flag: Fiji","category":9,"version":2,"tags":["FJ","flag"],"shortcodes":["fiji"],"countryFlag":true},{"emoji":"🇫🇰","label":"Flag: Falkland Islands","category":9,"version":2,"tags":["FK","flag"],"shortcodes":["falkland_islands"],"countryFlag":true},{"emoji":"🇫🇲","label":"Flag: Micronesia","category":9,"version":2,"tags":["FM","flag"],"shortcodes":["micronesia"],"countryFlag":true},{"emoji":"🇫🇴","label":"Flag: Faroe Islands","category":9,"version":2,"tags":["FO","flag"],"shortcodes":["faroe_islands"],"countryFlag":true},{"emoji":"🇫🇷","label":"Flag: France","category":9,"version":0.6,"tags":["FR","flag"],"shortcodes":["fr"],"countryFlag":true},{"emoji":"🇬🇦","label":"Flag: Gabon","category":9,"version":2,"tags":["GA","flag"],"shortcodes":["gabon"],"countryFlag":true},{"emoji":"🇬🇧","label":"Flag: United Kingdom","category":9,"version":0.6,"tags":["GB","flag"],"shortcodes":["gb","uk"],"countryFlag":true},{"emoji":"🇬🇩","label":"Flag: Grenada","category":9,"version":2,"tags":["GD","flag"],"shortcodes":["grenada"],"countryFlag":true},{"emoji":"🇬🇪","label":"Flag: Georgia","category":9,"version":2,"tags":["GE","flag"],"shortcodes":["georgia"],"countryFlag":true},{"emoji":"🇬🇫","label":"Flag: French Guiana","category":9,"version":2,"tags":["GF","flag"],"shortcodes":["french_guiana"],"countryFlag":true},{"emoji":"🇬🇬","label":"Flag: Guernsey","category":9,"version":2,"tags":["GG","flag"],"shortcodes":["guernsey"],"countryFlag":true},{"emoji":"🇬🇭","label":"Flag: Ghana","category":9,"version":2,"tags":["GH","flag"],"shortcodes":["ghana"],"countryFlag":true},{"emoji":"🇬🇮","label":"Flag: Gibraltar","category":9,"version":2,"tags":["GI","flag"],"shortcodes":["gibraltar"],"countryFlag":true},{"emoji":"🇬🇱","label":"Flag: Greenland","category":9,"version":2,"tags":["GL","flag"],"shortcodes":["greenland"],"countryFlag":true},{"emoji":"🇬🇲","label":"Flag: Gambia","category":9,"version":2,"tags":["GM","flag"],"shortcodes":["gambia"],"countryFlag":true},{"emoji":"🇬🇳","label":"Flag: Guinea","category":9,"version":2,"tags":["GN","flag"],"shortcodes":["guinea"],"countryFlag":true},{"emoji":"🇬🇵","label":"Flag: Guadeloupe","category":9,"version":2,"tags":["GP","flag"],"shortcodes":["guadeloupe"],"countryFlag":true},{"emoji":"🇬🇶","label":"Flag: Equatorial Guinea","category":9,"version":2,"tags":["GQ","flag"],"shortcodes":["equatorial_guinea"],"countryFlag":true},{"emoji":"🇬🇷","label":"Flag: Greece","category":9,"version":2,"tags":["GR","flag"],"shortcodes":["greece"],"countryFlag":true},{"emoji":"🇬🇸","label":"Flag: South Georgia & South Sandwich Islands","category":9,"version":2,"tags":["GS","flag"],"shortcodes":["south_georgia_south_sandwich_islands"],"countryFlag":true},{"emoji":"🇬🇹","label":"Flag: Guatemala","category":9,"version":2,"tags":["GT","flag"],"shortcodes":["guatemala"],"countryFlag":true},{"emoji":"🇬🇺","label":"Flag: Guam","category":9,"version":2,"tags":["GU","flag"],"shortcodes":["guam"],"countryFlag":true},{"emoji":"🇬🇼","label":"Flag: Guinea-Bissau","category":9,"version":2,"tags":["GW","flag"],"shortcodes":["guinea_bissau"],"countryFlag":true},{"emoji":"🇬🇾","label":"Flag: Guyana","category":9,"version":2,"tags":["GY","flag"],"shortcodes":["guyana"],"countryFlag":true},{"emoji":"🇭🇰","label":"Flag: Hong Kong SAR China","category":9,"version":2,"tags":["HK","flag"],"shortcodes":["hong_kong"],"countryFlag":true},{"emoji":"🇭🇲","label":"Flag: Heard & McDonald Islands","category":9,"version":2,"tags":["HM","flag"],"shortcodes":["heard_mcdonald_islands"],"countryFlag":true},{"emoji":"🇭🇳","label":"Flag: Honduras","category":9,"version":2,"tags":["HN","flag"],"shortcodes":["honduras"],"countryFlag":true},{"emoji":"🇭🇷","label":"Flag: Croatia","category":9,"version":2,"tags":["HR","flag"],"shortcodes":["croatia"],"countryFlag":true},{"emoji":"🇭🇹","label":"Flag: Haiti","category":9,"version":2,"tags":["HT","flag"],"shortcodes":["haiti"],"countryFlag":true},{"emoji":"🇭🇺","label":"Flag: Hungary","category":9,"version":2,"tags":["HU","flag"],"shortcodes":["hungary"],"countryFlag":true},{"emoji":"🇮🇨","label":"Flag: Canary Islands","category":9,"version":2,"tags":["IC","flag"],"shortcodes":["canary_islands"],"countryFlag":true},{"emoji":"🇮🇩","label":"Flag: Indonesia","category":9,"version":2,"tags":["ID","flag"],"shortcodes":["indonesia"],"countryFlag":true},{"emoji":"🇮🇪","label":"Flag: Ireland","category":9,"version":2,"tags":["IE","flag"],"shortcodes":["ireland"],"countryFlag":true},{"emoji":"🇮🇱","label":"Flag: Israel","category":9,"version":2,"tags":["IL","flag"],"shortcodes":["israel"],"countryFlag":true},{"emoji":"🇮🇲","label":"Flag: Isle of Man","category":9,"version":2,"tags":["IM","flag"],"shortcodes":["isle_of_man"],"countryFlag":true},{"emoji":"🇮🇳","label":"Flag: India","category":9,"version":2,"tags":["IN","flag"],"shortcodes":["india"],"countryFlag":true},{"emoji":"🇮🇴","label":"Flag: British Indian Ocean Territory","category":9,"version":2,"tags":["IO","flag"],"shortcodes":["british_indian_ocean_territory"],"countryFlag":true},{"emoji":"🇮🇶","label":"Flag: Iraq","category":9,"version":2,"tags":["IQ","flag"],"shortcodes":["iraq"],"countryFlag":true},{"emoji":"🇮🇷","label":"Flag: Iran","category":9,"version":2,"tags":["IR","flag"],"shortcodes":["iran"],"countryFlag":true},{"emoji":"🇮🇸","label":"Flag: Iceland","category":9,"version":2,"tags":["IS","flag"],"shortcodes":["iceland"],"countryFlag":true},{"emoji":"🇮🇹","label":"Flag: Italy","category":9,"version":0.6,"tags":["IT","flag"],"shortcodes":["it"],"countryFlag":true},{"emoji":"🇯🇪","label":"Flag: Jersey","category":9,"version":2,"tags":["JE","flag"],"shortcodes":["jersey"],"countryFlag":true},{"emoji":"🇯🇲","label":"Flag: Jamaica","category":9,"version":2,"tags":["JM","flag"],"shortcodes":["jamaica"],"countryFlag":true},{"emoji":"🇯🇴","label":"Flag: Jordan","category":9,"version":2,"tags":["JO","flag"],"shortcodes":["jordan"],"countryFlag":true},{"emoji":"🇯🇵","label":"Flag: Japan","category":9,"version":0.6,"tags":["JP","flag"],"shortcodes":["jp"],"countryFlag":true},{"emoji":"🇰🇪","label":"Flag: Kenya","category":9,"version":2,"tags":["KE","flag"],"shortcodes":["kenya"],"countryFlag":true},{"emoji":"🇰🇬","label":"Flag: Kyrgyzstan","category":9,"version":2,"tags":["KG","flag"],"shortcodes":["kyrgyzstan"],"countryFlag":true},{"emoji":"🇰🇭","label":"Flag: Cambodia","category":9,"version":2,"tags":["KH","flag"],"shortcodes":["cambodia"],"countryFlag":true},{"emoji":"🇰🇮","label":"Flag: Kiribati","category":9,"version":2,"tags":["KI","flag"],"shortcodes":["kiribati"],"countryFlag":true},{"emoji":"🇰🇲","label":"Flag: Comoros","category":9,"version":2,"tags":["KM","flag"],"shortcodes":["comoros"],"countryFlag":true},{"emoji":"🇰🇳","label":"Flag: St. Kitts & Nevis","category":9,"version":2,"tags":["KN","flag"],"shortcodes":["st_kitts_nevis"],"countryFlag":true},{"emoji":"🇰🇵","label":"Flag: North Korea","category":9,"version":2,"tags":["KP","flag"],"shortcodes":["north_korea"],"countryFlag":true},{"emoji":"🇰🇷","label":"Flag: South Korea","category":9,"version":0.6,"tags":["KR","flag"],"shortcodes":["kr"],"countryFlag":true},{"emoji":"🇰🇼","label":"Flag: Kuwait","category":9,"version":2,"tags":["KW","flag"],"shortcodes":["kuwait"],"countryFlag":true},{"emoji":"🇰🇾","label":"Flag: Cayman Islands","category":9,"version":2,"tags":["KY","flag"],"shortcodes":["cayman_islands"],"countryFlag":true},{"emoji":"🇰🇿","label":"Flag: Kazakhstan","category":9,"version":2,"tags":["KZ","flag"],"shortcodes":["kazakhstan"],"countryFlag":true},{"emoji":"🇱🇦","label":"Flag: Laos","category":9,"version":2,"tags":["LA","flag"],"shortcodes":["laos"],"countryFlag":true},{"emoji":"🇱🇧","label":"Flag: Lebanon","category":9,"version":2,"tags":["LB","flag"],"shortcodes":["lebanon"],"countryFlag":true},{"emoji":"🇱🇨","label":"Flag: St. Lucia","category":9,"version":2,"tags":["LC","flag"],"shortcodes":["st_lucia"],"countryFlag":true},{"emoji":"🇱🇮","label":"Flag: Liechtenstein","category":9,"version":2,"tags":["LI","flag"],"shortcodes":["liechtenstein"],"countryFlag":true},{"emoji":"🇱🇰","label":"Flag: Sri Lanka","category":9,"version":2,"tags":["LK","flag"],"shortcodes":["sri_lanka"],"countryFlag":true},{"emoji":"🇱🇷","label":"Flag: Liberia","category":9,"version":2,"tags":["LR","flag"],"shortcodes":["liberia"],"countryFlag":true},{"emoji":"🇱🇸","label":"Flag: Lesotho","category":9,"version":2,"tags":["LS","flag"],"shortcodes":["lesotho"],"countryFlag":true},{"emoji":"🇱🇹","label":"Flag: Lithuania","category":9,"version":2,"tags":["LT","flag"],"shortcodes":["lithuania"],"countryFlag":true},{"emoji":"🇱🇺","label":"Flag: Luxembourg","category":9,"version":2,"tags":["LU","flag"],"shortcodes":["luxembourg"],"countryFlag":true},{"emoji":"🇱🇻","label":"Flag: Latvia","category":9,"version":2,"tags":["LV","flag"],"shortcodes":["latvia"],"countryFlag":true},{"emoji":"🇱🇾","label":"Flag: Libya","category":9,"version":2,"tags":["LY","flag"],"shortcodes":["libya"],"countryFlag":true},{"emoji":"🇲🇦","label":"Flag: Morocco","category":9,"version":2,"tags":["MA","flag"],"shortcodes":["morocco"],"countryFlag":true},{"emoji":"🇲🇨","label":"Flag: Monaco","category":9,"version":2,"tags":["MC","flag"],"shortcodes":["monaco"],"countryFlag":true},{"emoji":"🇲🇩","label":"Flag: Moldova","category":9,"version":2,"tags":["MD","flag"],"shortcodes":["moldova"],"countryFlag":true},{"emoji":"🇲🇪","label":"Flag: Montenegro","category":9,"version":2,"tags":["ME","flag"],"shortcodes":["montenegro"],"countryFlag":true},{"emoji":"🇲🇫","label":"Flag: St. Martin","category":9,"version":2,"tags":["MF","flag"],"shortcodes":["st_martin"],"countryFlag":true},{"emoji":"🇲🇬","label":"Flag: Madagascar","category":9,"version":2,"tags":["MG","flag"],"shortcodes":["madagascar"],"countryFlag":true},{"emoji":"🇲🇭","label":"Flag: Marshall Islands","category":9,"version":2,"tags":["MH","flag"],"shortcodes":["marshall_islands"],"countryFlag":true},{"emoji":"🇲🇰","label":"Flag: North Macedonia","category":9,"version":2,"tags":["MK","flag"],"shortcodes":["macedonia"],"countryFlag":true},{"emoji":"🇲🇱","label":"Flag: Mali","category":9,"version":2,"tags":["ML","flag"],"shortcodes":["mali"],"countryFlag":true},{"emoji":"🇲🇲","label":"Flag: Myanmar (Burma)","category":9,"version":2,"tags":["MM","flag"],"shortcodes":["myanmar"],"countryFlag":true},{"emoji":"🇲🇳","label":"Flag: Mongolia","category":9,"version":2,"tags":["MN","flag"],"shortcodes":["mongolia"],"countryFlag":true},{"emoji":"🇲🇴","label":"Flag: Macao SAR China","category":9,"version":2,"tags":["MO","flag"],"shortcodes":["macau"],"countryFlag":true},{"emoji":"🇲🇵","label":"Flag: Northern Mariana Islands","category":9,"version":2,"tags":["MP","flag"],"shortcodes":["northern_mariana_islands"],"countryFlag":true},{"emoji":"🇲🇶","label":"Flag: Martinique","category":9,"version":2,"tags":["MQ","flag"],"shortcodes":["martinique"],"countryFlag":true},{"emoji":"🇲🇷","label":"Flag: Mauritania","category":9,"version":2,"tags":["MR","flag"],"shortcodes":["mauritania"],"countryFlag":true},{"emoji":"🇲🇸","label":"Flag: Montserrat","category":9,"version":2,"tags":["MS","flag"],"shortcodes":["montserrat"],"countryFlag":true},{"emoji":"🇲🇹","label":"Flag: Malta","category":9,"version":2,"tags":["MT","flag"],"shortcodes":["malta"],"countryFlag":true},{"emoji":"🇲🇺","label":"Flag: Mauritius","category":9,"version":2,"tags":["MU","flag"],"shortcodes":["mauritius"],"countryFlag":true},{"emoji":"🇲🇻","label":"Flag: Maldives","category":9,"version":2,"tags":["MV","flag"],"shortcodes":["maldives"],"countryFlag":true},{"emoji":"🇲🇼","label":"Flag: Malawi","category":9,"version":2,"tags":["MW","flag"],"shortcodes":["malawi"],"countryFlag":true},{"emoji":"🇲🇽","label":"Flag: Mexico","category":9,"version":2,"tags":["MX","flag"],"shortcodes":["mexico"],"countryFlag":true},{"emoji":"🇲🇾","label":"Flag: Malaysia","category":9,"version":2,"tags":["MY","flag"],"shortcodes":["malaysia"],"countryFlag":true},{"emoji":"🇲🇿","label":"Flag: Mozambique","category":9,"version":2,"tags":["MZ","flag"],"shortcodes":["mozambique"],"countryFlag":true},{"emoji":"🇳🇦","label":"Flag: Namibia","category":9,"version":2,"tags":["NA","flag"],"shortcodes":["namibia"],"countryFlag":true},{"emoji":"🇳🇨","label":"Flag: New Caledonia","category":9,"version":2,"tags":["NC","flag"],"shortcodes":["new_caledonia"],"countryFlag":true},{"emoji":"🇳🇪","label":"Flag: Niger","category":9,"version":2,"tags":["NE","flag"],"shortcodes":["niger"],"countryFlag":true},{"emoji":"🇳🇫","label":"Flag: Norfolk Island","category":9,"version":2,"tags":["NF","flag"],"shortcodes":["norfolk_island"],"countryFlag":true},{"emoji":"🇳🇬","label":"Flag: Nigeria","category":9,"version":2,"tags":["NG","flag"],"shortcodes":["nigeria"],"countryFlag":true},{"emoji":"🇳🇮","label":"Flag: Nicaragua","category":9,"version":2,"tags":["NI","flag"],"shortcodes":["nicaragua"],"countryFlag":true},{"emoji":"🇳🇱","label":"Flag: Netherlands","category":9,"version":2,"tags":["NL","flag"],"shortcodes":["netherlands"],"countryFlag":true},{"emoji":"🇳🇴","label":"Flag: Norway","category":9,"version":2,"tags":["NO","flag"],"shortcodes":["norway"],"countryFlag":true},{"emoji":"🇳🇵","label":"Flag: Nepal","category":9,"version":2,"tags":["NP","flag"],"shortcodes":["nepal"],"countryFlag":true},{"emoji":"🇳🇷","label":"Flag: Nauru","category":9,"version":2,"tags":["NR","flag"],"shortcodes":["nauru"],"countryFlag":true},{"emoji":"🇳🇺","label":"Flag: Niue","category":9,"version":2,"tags":["NU","flag"],"shortcodes":["niue"],"countryFlag":true},{"emoji":"🇳🇿","label":"Flag: New Zealand","category":9,"version":2,"tags":["NZ","flag"],"shortcodes":["new_zealand"],"countryFlag":true},{"emoji":"🇴🇲","label":"Flag: Oman","category":9,"version":2,"tags":["OM","flag"],"shortcodes":["oman"],"countryFlag":true},{"emoji":"🇵🇦","label":"Flag: Panama","category":9,"version":2,"tags":["PA","flag"],"shortcodes":["panama"],"countryFlag":true},{"emoji":"🇵🇪","label":"Flag: Peru","category":9,"version":2,"tags":["PE","flag"],"shortcodes":["peru"],"countryFlag":true},{"emoji":"🇵🇫","label":"Flag: French Polynesia","category":9,"version":2,"tags":["PF","flag"],"shortcodes":["french_polynesia"],"countryFlag":true},{"emoji":"🇵🇬","label":"Flag: Papua New Guinea","category":9,"version":2,"tags":["PG","flag"],"shortcodes":["papua_new_guinea"],"countryFlag":true},{"emoji":"🇵🇭","label":"Flag: Philippines","category":9,"version":2,"tags":["PH","flag"],"shortcodes":["philippines"],"countryFlag":true},{"emoji":"🇵🇰","label":"Flag: Pakistan","category":9,"version":2,"tags":["PK","flag"],"shortcodes":["pakistan"],"countryFlag":true},{"emoji":"🇵🇱","label":"Flag: Poland","category":9,"version":2,"tags":["PL","flag"],"shortcodes":["poland"],"countryFlag":true},{"emoji":"🇵🇲","label":"Flag: St. Pierre & Miquelon","category":9,"version":2,"tags":["PM","flag"],"shortcodes":["st_pierre_miquelon"],"countryFlag":true},{"emoji":"🇵🇳","label":"Flag: Pitcairn Islands","category":9,"version":2,"tags":["PN","flag"],"shortcodes":["pitcairn_islands"],"countryFlag":true},{"emoji":"🇵🇷","label":"Flag: Puerto Rico","category":9,"version":2,"tags":["PR","flag"],"shortcodes":["puerto_rico"],"countryFlag":true},{"emoji":"🇵🇸","label":"Flag: Palestinian Territories","category":9,"version":2,"tags":["PS","flag"],"shortcodes":["palestinian_territories"],"countryFlag":true},{"emoji":"🇵🇹","label":"Flag: Portugal","category":9,"version":2,"tags":["PT","flag"],"shortcodes":["portugal"],"countryFlag":true},{"emoji":"🇵🇼","label":"Flag: Palau","category":9,"version":2,"tags":["PW","flag"],"shortcodes":["palau"],"countryFlag":true},{"emoji":"🇵🇾","label":"Flag: Paraguay","category":9,"version":2,"tags":["PY","flag"],"shortcodes":["paraguay"],"countryFlag":true},{"emoji":"🇶🇦","label":"Flag: Qatar","category":9,"version":2,"tags":["QA","flag"],"shortcodes":["qatar"],"countryFlag":true},{"emoji":"🇷🇪","label":"Flag: Réunion","category":9,"version":2,"tags":["RE","flag"],"shortcodes":["reunion"],"countryFlag":true},{"emoji":"🇷🇴","label":"Flag: Romania","category":9,"version":2,"tags":["RO","flag"],"shortcodes":["romania"],"countryFlag":true},{"emoji":"🇷🇸","label":"Flag: Serbia","category":9,"version":2,"tags":["RS","flag"],"shortcodes":["serbia"],"countryFlag":true},{"emoji":"🇷🇺","label":"Flag: Russia","category":9,"version":0.6,"tags":["RU","flag"],"shortcodes":["ru"],"countryFlag":true},{"emoji":"🇷🇼","label":"Flag: Rwanda","category":9,"version":2,"tags":["RW","flag"],"shortcodes":["rwanda"],"countryFlag":true},{"emoji":"🇸🇦","label":"Flag: Saudi Arabia","category":9,"version":2,"tags":["SA","flag"],"shortcodes":["saudi_arabia"],"countryFlag":true},{"emoji":"🇸🇧","label":"Flag: Solomon Islands","category":9,"version":2,"tags":["SB","flag"],"shortcodes":["solomon_islands"],"countryFlag":true},{"emoji":"🇸🇨","label":"Flag: Seychelles","category":9,"version":2,"tags":["SC","flag"],"shortcodes":["seychelles"],"countryFlag":true},{"emoji":"🇸🇩","label":"Flag: Sudan","category":9,"version":2,"tags":["SD","flag"],"shortcodes":["sudan"],"countryFlag":true},{"emoji":"🇸🇪","label":"Flag: Sweden","category":9,"version":2,"tags":["SE","flag"],"shortcodes":["sweden"],"countryFlag":true},{"emoji":"🇸🇬","label":"Flag: Singapore","category":9,"version":2,"tags":["SG","flag"],"shortcodes":["singapore"],"countryFlag":true},{"emoji":"🇸🇭","label":"Flag: St. Helena","category":9,"version":2,"tags":["SH","flag"],"shortcodes":["st_helena"],"countryFlag":true},{"emoji":"🇸🇮","label":"Flag: Slovenia","category":9,"version":2,"tags":["SI","flag"],"shortcodes":["slovenia"],"countryFlag":true},{"emoji":"🇸🇯","label":"Flag: Svalbard & Jan Mayen","category":9,"version":2,"tags":["SJ","flag"],"shortcodes":["svalbard_jan_mayen"],"countryFlag":true},{"emoji":"🇸🇰","label":"Flag: Slovakia","category":9,"version":2,"tags":["SK","flag"],"shortcodes":["slovakia"],"countryFlag":true},{"emoji":"🇸🇱","label":"Flag: Sierra Leone","category":9,"version":2,"tags":["SL","flag"],"shortcodes":["sierra_leone"],"countryFlag":true},{"emoji":"🇸🇲","label":"Flag: San Marino","category":9,"version":2,"tags":["SM","flag"],"shortcodes":["san_marino"],"countryFlag":true},{"emoji":"🇸🇳","label":"Flag: Senegal","category":9,"version":2,"tags":["SN","flag"],"shortcodes":["senegal"],"countryFlag":true},{"emoji":"🇸🇴","label":"Flag: Somalia","category":9,"version":2,"tags":["SO","flag"],"shortcodes":["somalia"],"countryFlag":true},{"emoji":"🇸🇷","label":"Flag: Suriname","category":9,"version":2,"tags":["SR","flag"],"shortcodes":["suriname"],"countryFlag":true},{"emoji":"🇸🇸","label":"Flag: South Sudan","category":9,"version":2,"tags":["SS","flag"],"shortcodes":["south_sudan"],"countryFlag":true},{"emoji":"🇸🇹","label":"Flag: São Tomé & Príncipe","category":9,"version":2,"tags":["ST","flag"],"shortcodes":["sao_tome_principe"],"countryFlag":true},{"emoji":"🇸🇻","label":"Flag: El Salvador","category":9,"version":2,"tags":["SV","flag"],"shortcodes":["el_salvador"],"countryFlag":true},{"emoji":"🇸🇽","label":"Flag: Sint Maarten","category":9,"version":2,"tags":["SX","flag"],"shortcodes":["sint_maarten"],"countryFlag":true},{"emoji":"🇸🇾","label":"Flag: Syria","category":9,"version":2,"tags":["SY","flag"],"shortcodes":["syria"],"countryFlag":true},{"emoji":"🇸🇿","label":"Flag: Eswatini","category":9,"version":2,"tags":["SZ","flag"],"shortcodes":["swaziland"],"countryFlag":true},{"emoji":"🇹🇦","label":"Flag: Tristan da Cunha","category":9,"version":2,"tags":["TA","flag"],"shortcodes":["tristan_da_cunha"],"countryFlag":true},{"emoji":"🇹🇨","label":"Flag: Turks & Caicos Islands","category":9,"version":2,"tags":["TC","flag"],"shortcodes":["turks_caicos_islands"],"countryFlag":true},{"emoji":"🇹🇩","label":"Flag: Chad","category":9,"version":2,"tags":["TD","flag"],"shortcodes":["chad"],"countryFlag":true},{"emoji":"🇹🇫","label":"Flag: French Southern Territories","category":9,"version":2,"tags":["TF","flag"],"shortcodes":["french_southern_territories"],"countryFlag":true},{"emoji":"🇹🇬","label":"Flag: Togo","category":9,"version":2,"tags":["TG","flag"],"shortcodes":["togo"],"countryFlag":true},{"emoji":"🇹🇭","label":"Flag: Thailand","category":9,"version":2,"tags":["TH","flag"],"shortcodes":["thailand"],"countryFlag":true},{"emoji":"🇹🇯","label":"Flag: Tajikistan","category":9,"version":2,"tags":["TJ","flag"],"shortcodes":["tajikistan"],"countryFlag":true},{"emoji":"🇹🇰","label":"Flag: Tokelau","category":9,"version":2,"tags":["TK","flag"],"shortcodes":["tokelau"],"countryFlag":true},{"emoji":"🇹🇱","label":"Flag: Timor-Leste","category":9,"version":2,"tags":["TL","flag"],"shortcodes":["timor_leste"],"countryFlag":true},{"emoji":"🇹🇲","label":"Flag: Turkmenistan","category":9,"version":2,"tags":["TM","flag"],"shortcodes":["turkmenistan"],"countryFlag":true},{"emoji":"🇹🇳","label":"Flag: Tunisia","category":9,"version":2,"tags":["TN","flag"],"shortcodes":["tunisia"],"countryFlag":true},{"emoji":"🇹🇴","label":"Flag: Tonga","category":9,"version":2,"tags":["TO","flag"],"shortcodes":["tonga"],"countryFlag":true},{"emoji":"🇹🇷","label":"Flag: Türkiye","category":9,"version":2,"tags":["TR","flag"],"shortcodes":["tr"],"countryFlag":true},{"emoji":"🇹🇹","label":"Flag: Trinidad & Tobago","category":9,"version":2,"tags":["TT","flag"],"shortcodes":["trinidad_tobago"],"countryFlag":true},{"emoji":"🇹🇻","label":"Flag: Tuvalu","category":9,"version":2,"tags":["TV","flag"],"shortcodes":["tuvalu"],"countryFlag":true},{"emoji":"🇹🇼","label":"Flag: Taiwan","category":9,"version":2,"tags":["TW","flag"],"shortcodes":["taiwan"],"countryFlag":true},{"emoji":"🇹🇿","label":"Flag: Tanzania","category":9,"version":2,"tags":["TZ","flag"],"shortcodes":["tanzania"],"countryFlag":true},{"emoji":"🇺🇦","label":"Flag: Ukraine","category":9,"version":2,"tags":["UA","flag"],"shortcodes":["ukraine"],"countryFlag":true},{"emoji":"🇺🇬","label":"Flag: Uganda","category":9,"version":2,"tags":["UG","flag"],"shortcodes":["uganda"],"countryFlag":true},{"emoji":"🇺🇲","label":"Flag: U.S. Outlying Islands","category":9,"version":2,"tags":["UM","flag"],"shortcodes":["us_outlying_islands"],"countryFlag":true},{"emoji":"🇺🇳","label":"Flag: United Nations","category":9,"version":4,"tags":["UN","flag"],"shortcodes":["united_nations"],"countryFlag":true},{"emoji":"🇺🇸","label":"Flag: United States","category":9,"version":0.6,"tags":["US","flag"],"shortcodes":["us"],"countryFlag":true},{"emoji":"🇺🇾","label":"Flag: Uruguay","category":9,"version":2,"tags":["UY","flag"],"shortcodes":["uruguay"],"countryFlag":true},{"emoji":"🇺🇿","label":"Flag: Uzbekistan","category":9,"version":2,"tags":["UZ","flag"],"shortcodes":["uzbekistan"],"countryFlag":true},{"emoji":"🇻🇦","label":"Flag: Vatican City","category":9,"version":2,"tags":["VA","flag"],"shortcodes":["vatican_city"],"countryFlag":true},{"emoji":"🇻🇨","label":"Flag: St. Vincent & Grenadines","category":9,"version":2,"tags":["VC","flag"],"shortcodes":["st_vincent_grenadines"],"countryFlag":true},{"emoji":"🇻🇪","label":"Flag: Venezuela","category":9,"version":2,"tags":["VE","flag"],"shortcodes":["venezuela"],"countryFlag":true},{"emoji":"🇻🇬","label":"Flag: British Virgin Islands","category":9,"version":2,"tags":["VG","flag"],"shortcodes":["british_virgin_islands"],"countryFlag":true},{"emoji":"🇻🇮","label":"Flag: U.S. Virgin Islands","category":9,"version":2,"tags":["VI","flag"],"shortcodes":["us_virgin_islands"],"countryFlag":true},{"emoji":"🇻🇳","label":"Flag: Vietnam","category":9,"version":2,"tags":["VN","flag"],"shortcodes":["vietnam"],"countryFlag":true},{"emoji":"🇻🇺","label":"Flag: Vanuatu","category":9,"version":2,"tags":["VU","flag"],"shortcodes":["vanuatu"],"countryFlag":true},{"emoji":"🇼🇫","label":"Flag: Wallis & Futuna","category":9,"version":2,"tags":["WF","flag"],"shortcodes":["wallis_futuna"],"countryFlag":true},{"emoji":"🇼🇸","label":"Flag: Samoa","category":9,"version":2,"tags":["WS","flag"],"shortcodes":["samoa"],"countryFlag":true},{"emoji":"🇽🇰","label":"Flag: Kosovo","category":9,"version":2,"tags":["XK","flag"],"shortcodes":["kosovo"],"countryFlag":true},{"emoji":"🇾🇪","label":"Flag: Yemen","category":9,"version":2,"tags":["YE","flag"],"shortcodes":["yemen"],"countryFlag":true},{"emoji":"🇾🇹","label":"Flag: Mayotte","category":9,"version":2,"tags":["YT","flag"],"shortcodes":["mayotte"],"countryFlag":true},{"emoji":"🇿🇦","label":"Flag: South Africa","category":9,"version":2,"tags":["ZA","flag"],"shortcodes":["south_africa"],"countryFlag":true},{"emoji":"🇿🇲","label":"Flag: Zambia","category":9,"version":2,"tags":["ZM","flag"],"shortcodes":["zambia"],"countryFlag":true},{"emoji":"🇿🇼","label":"Flag: Zimbabwe","category":9,"version":2,"tags":["ZW","flag"],"shortcodes":["zimbabwe"],"countryFlag":true},{"emoji":"🏴󠁧󠁢󠁥󠁮󠁧󠁿","label":"Flag: England","category":9,"version":5,"tags":["flag","gbeng"],"shortcodes":["england"],"countryFlag":true},{"emoji":"🏴󠁧󠁢󠁳󠁣󠁴󠁿","label":"Flag: Scotland","category":9,"version":5,"tags":["flag","gbsct"],"shortcodes":["scotland"],"countryFlag":true},{"emoji":"🏴󠁧󠁢󠁷󠁬󠁳󠁿","label":"Flag: Wales","category":9,"version":5,"tags":["flag","gbwls"],"shortcodes":["wales"],"countryFlag":true}]} \ No newline at end of file diff --git a/apps/ios/Sugabots/Settings/TimeZoneRegions.generated.swift b/apps/ios/Sugabots/Settings/TimeZoneRegions.generated.swift new file mode 100644 index 000000000..f58864f4a --- /dev/null +++ b/apps/ios/Sugabots/Settings/TimeZoneRegions.generated.swift @@ -0,0 +1,16 @@ +// Generated by apps/codegen/generate-file-and-zone-lists.ts from packages/web/src/lib/time-zones.ts. Do not edit. + +extension TimeZoneRegion { + /// The regions a zone's first part names, as people call them, in the order they are listed, as `NAMED_REGIONS`. + static let named: [(prefix: String, name: String)] = [ + ("Africa", "Africa"), + ("America", "Americas"), + ("Asia", "Asia"), + ("Australia", "Australia"), + ("Europe", "Europe"), + ("Pacific", "Pacific"), + ] + + /// What the region of every zone outside the named ones is called, as `OTHER_REGION`. + static let otherName = "Other" +} diff --git a/apps/native-constants.json b/apps/native-constants.json new file mode 100644 index 000000000..5d0e63c3a --- /dev/null +++ b/apps/native-constants.json @@ -0,0 +1,50 @@ +{ + "hostedWorkspaceEnding": { + "value": ".sugabots.ai", + "about": "What sign-in writes after a workspace's name: a hosted workspace is at [name].sugabots.ai." + }, + "quickReactionCount": { + "value": 5, + "unit": "count", + "about": "How many emoji a held message's actions offer before the button for the picker." + }, + "usualReactions": { + "value": ["👍", "❤️", "😂", "🎉", "👀"], + "about": "What fills the quick reactions after the emoji chosen lately on this device." + }, + "reactionChipHeight": { + "value": 32, + "unit": "points", + "about": "A reaction chip's height under a message: a fingertip's, as Slack's on a phone." + }, + "headerFaceSize": { + "value": 32, + "unit": "points", + "about": "A face in a conversation's title pill: 6 points inside its rounded end, and 6 over and under." + }, + "headerPillHeight": { + "value": 44, + "unit": "points", + "about": "How tall a conversation's title pill is, after Slack's." + }, + "headerGapBelowIsland": { + "value": 8, + "unit": "points", + "about": "The gap a conversation's header keeps below the Dynamic Island." + }, + "tabBarSink": { + "value": 12, + "unit": "points", + "about": "How far the tab bar reaches down into the home indicator's band, as Slack's does." + }, + "barSideInset": { + "value": 21, + "unit": "points", + "about": "How far the tab bar and the composer sit in from the screen's sides." + }, + "keyboardGap": { + "value": 8, + "unit": "points", + "about": "The space between the composer and the keyboard, backed by frost." + } +} diff --git a/biome.json b/biome.json index 1ff43fd4e..afe01e1cd 100644 --- a/biome.json +++ b/biome.json @@ -16,7 +16,9 @@ "!packages/web/.storybook/public/mockServiceWorker.js", "!packages/website/src/routeTree.gen.ts", "!packages/emoji/src/emoji.json", - "!packages/contracts/openapi.json" + "!packages/contracts/openapi.json", + "!apps/ios/**/*.xcassets", + "!apps/ios/Sugabots/Resources/Emoji.json" ] }, "formatter": { From bd87910b9d74a72b540aebc83c33828f94a8a90d Mon Sep 17 00:00:00 2001 From: Ryan Cartwright Date: Thu, 5 Nov 2026 11:11:38 +1100 Subject: [PATCH 2/2] feat(ios): copy the web's rules into Foundation-only Swift --- apps/codegen/generate-limits.ts | 3 - apps/ios/Sugabots/API/APIClient.swift | 189 ++++++++++ apps/ios/Sugabots/API/APISupport.swift | 252 +++++++++++++ apps/ios/Sugabots/API/Models.swift | 343 ++++++++++++++++++ apps/ios/Sugabots/API/RoutineModels.swift | 232 ++++++++++++ apps/ios/Sugabots/API/TokenStore.swift | 88 +++++ .../Sugabots/Conversation/ChatGroups.swift | 94 +++++ apps/ios/Sugabots/Conversation/FileLook.swift | 34 ++ .../Conversation/MarkdownBlocks.swift | 271 ++++++++++++++ apps/ios/Sugabots/Conversation/Mentions.swift | 169 +++++++++ apps/ios/Sugabots/Conversation/Names.swift | 20 + apps/ios/Sugabots/Conversation/Previews.swift | 39 ++ apps/ios/Sugabots/Conversation/Segments.swift | 90 +++++ apps/ios/Sugabots/Conversation/Times.swift | 76 ++++ .../ios/Sugabots/Conversation/ToolNames.swift | 63 ++++ .../ios/Sugabots/Conversation/ToolSteps.swift | 296 +++++++++++++++ apps/ios/Sugabots/Design/Avatars.swift | 24 ++ apps/ios/Sugabots/Home/Mutes.swift | 35 ++ .../ios/Sugabots/Routines/ScheduleWords.swift | 288 +++++++++++++++ .../Sugabots/Settings/TimeZoneChoices.swift | 49 +++ 20 files changed, 2652 insertions(+), 3 deletions(-) create mode 100644 apps/ios/Sugabots/API/APIClient.swift create mode 100644 apps/ios/Sugabots/API/APISupport.swift create mode 100644 apps/ios/Sugabots/API/Models.swift create mode 100644 apps/ios/Sugabots/API/RoutineModels.swift create mode 100644 apps/ios/Sugabots/API/TokenStore.swift create mode 100644 apps/ios/Sugabots/Conversation/ChatGroups.swift create mode 100644 apps/ios/Sugabots/Conversation/FileLook.swift create mode 100644 apps/ios/Sugabots/Conversation/MarkdownBlocks.swift create mode 100644 apps/ios/Sugabots/Conversation/Mentions.swift create mode 100644 apps/ios/Sugabots/Conversation/Names.swift create mode 100644 apps/ios/Sugabots/Conversation/Previews.swift create mode 100644 apps/ios/Sugabots/Conversation/Segments.swift create mode 100644 apps/ios/Sugabots/Conversation/Times.swift create mode 100644 apps/ios/Sugabots/Conversation/ToolNames.swift create mode 100644 apps/ios/Sugabots/Conversation/ToolSteps.swift create mode 100644 apps/ios/Sugabots/Design/Avatars.swift create mode 100644 apps/ios/Sugabots/Home/Mutes.swift create mode 100644 apps/ios/Sugabots/Routines/ScheduleWords.swift create mode 100644 apps/ios/Sugabots/Settings/TimeZoneChoices.swift diff --git a/apps/codegen/generate-limits.ts b/apps/codegen/generate-limits.ts index b0da0c68f..e6e8d203b 100644 --- a/apps/codegen/generate-limits.ts +++ b/apps/codegen/generate-limits.ts @@ -3,9 +3,6 @@ * schemas check, in `@sugabots/contracts`, and the ones the web's screens are * drawn with, in the plain data modules of `packages/web/src/lib`, so a field * stops where the web's does. - * - * The file builds for macOS without UIKit, since `check-rules.sh` builds the - * rules that read it off the simulator. */ import { AGENT_NAME_MAX_LENGTH, diff --git a/apps/ios/Sugabots/API/APIClient.swift b/apps/ios/Sugabots/API/APIClient.swift new file mode 100644 index 000000000..a87dfa6e2 --- /dev/null +++ b/apps/ios/Sugabots/API/APIClient.swift @@ -0,0 +1,189 @@ +import Foundation + +/// A refusal or failure the API answered with, in its own words. +struct APIFailure: LocalizedError { + let status: Int + let message: String + /// better-auth's reason for refusing, such as `EMAIL_NOT_VERIFIED`. + var code: String? + + var errorDescription: String? { message } + var isUnauthorized: Bool { status == 401 } + /// The account exists but its address hasn't been proven, so signing in waits on the emailed link. + var isEmailUnverified: Bool { code == "EMAIL_NOT_VERIFIED" } +} + +/// The server at the address given answered, but not as a Sugabots server +/// does: it issued no token for a sign-in that succeeded. +struct NotASugabotsServer: LocalizedError { + var errorDescription: String? { "The server did not issue a token. Is this a Sugabots server?" } +} + +/// The API, over HTTP with a bearer token, as `packages/sdk` reaches it in +/// `bearer` mode. `baseURL` carries the API's mount path: `https://sugabots.example.com/api`. +struct APIClient { + let baseURL: URL + let tokens: TokenStore + var session: URLSession = .shared + + /// The web app's address, which the API is mounted under: `https://sugabots.example.com/`. + var webRoot: URL { baseURL.deletingLastPathComponent() } + + /// How answers are read: timestamps as the API writes them, and the strings + /// Effect writes for numbers JSON can't hold as those numbers. + static let decoder: JSONDecoder = { + let decoder = JSONDecoder() + decoder.nonConformingFloatDecodingStrategy = .convertFromString( + positiveInfinity: NonFiniteNumberText.positiveInfinity, + negativeInfinity: NonFiniteNumberText.negativeInfinity, + nan: NonFiniteNumberText.nan + ) + decoder.dateDecodingStrategy = .custom { decoder in + let text = try decoder.singleValueContainer().decode(String.self) + guard let date = Date(iso8601: text) else { + throw DecodingError.dataCorrupted(.init(codingPath: decoder.codingPath, debugDescription: "Not an ISO 8601 timestamp: \(text)")) + } + return date + } + return decoder + }() + + // MARK: The account, through better-auth + + /// Signs in with better-auth's email route, and keeps the bearer token it issues. + func signIn(email: String, password: String) async throws { + var request = request("auth/sign-in/email", method: "POST", body: ["email": email, "password": password]) + // better-auth refuses a sign-in without an Origin it trusts. The app is + // not a web page, so it gives the API's own, as the SDK does outside a browser. + request.setValue(origin, forHTTPHeaderField: "Origin") + let (_, response) = try await send(request) + guard let token = response.value(forHTTPHeaderField: "set-auth-token") else { throw NotASugabotsServer() } + try tokens.store(token) + } + + /// Makes an account with better-auth's email route. Answers whether it signed + /// in: an installation that requires a proven address issues no token until + /// the emailed link is opened. + func signUp(name: String, email: String, password: String) async throws -> Bool { + var request = request("auth/sign-up/email", method: "POST", body: ["name": name, "email": email, "password": password]) + request.setValue(origin, forHTTPHeaderField: "Origin") + let (_, response) = try await send(request) + guard let token = response.value(forHTTPHeaderField: "set-auth-token") else { return false } + try tokens.store(token) + return true + } + + /// Emails a reset link to `email` if it has an account, opening `redirectTo` on the web. + func requestPasswordReset(email: String, redirectTo: String) async throws { + var request = request("auth/request-password-reset", method: "POST", body: ["email": email, "redirectTo": redirectTo]) + request.setValue(origin, forHTTPHeaderField: "Origin") + _ = try await send(request) + } + + /// Renames the signed-in person. + func updateName(_ name: String) async throws { + var request = request("auth/update-user", method: "POST", body: ["name": name]) + request.setValue(origin, forHTTPHeaderField: "Origin") + _ = try await send(request) + } + + func signOut() async { + var request = request("auth/sign-out", method: "POST", body: [:]) + request.setValue(origin, forHTTPHeaderField: "Origin") + _ = try? await send(request) + tokens.clear() + } + + // MARK: Requests + + // The API's routes are requested through `API.generated.swift`, which is + // generated from the API's definition. What's here is for what that can't + // describe: better-auth's routes and the event streams. + + /// A request with the bearer token, for an event stream or another caller + /// that reads the body itself. `path` is relative to `baseURL`, and already + /// percent-encoded, as `pathSegment` encodes each of its parameters. + func request(_ path: String, method: String = "GET", queryItems: [URLQueryItem] = [], body: [String: Any]? = nil) -> URLRequest { + var components = URLComponents(url: baseURL, resolvingAgainstBaseURL: false)! + let basePath = components.percentEncodedPath.hasSuffix("/") ? components.percentEncodedPath : components.percentEncodedPath + "/" + components.percentEncodedPath = basePath + path + if !queryItems.isEmpty { + components.percentEncodedQueryItems = queryItems.map(Self.encodingPlus) + } + var request = URLRequest(url: components.url!) + request.httpMethod = method + request.setValue("application/json", forHTTPHeaderField: "Accept") + if let token = tokens.token { + request.setValue("Bearer \(token)", forHTTPHeaderField: "Authorization") + } + if let body { + request.setValue("application/json", forHTTPHeaderField: "Content-Type") + request.httpBody = try? JSONSerialization.data(withJSONObject: body) + } + return request + } + + /// Characters a query name or value may hold unencoded. `URLComponents` + /// leaves `+` as it is, but the server reads a query as a form, where `+` + /// is a space, so `image/svg+xml` would arrive as `image/svg xml`. + private static let queryAllowed = CharacterSet.urlQueryAllowed.subtracting(CharacterSet(charactersIn: "+&=#")) + + private static func encodingPlus(_ item: URLQueryItem) -> URLQueryItem { + URLQueryItem( + name: item.name.addingPercentEncoding(withAllowedCharacters: queryAllowed) ?? item.name, + value: item.value?.addingPercentEncoding(withAllowedCharacters: queryAllowed) + ) + } + + private var origin: String { + var components = URLComponents() + components.scheme = baseURL.scheme + components.host = baseURL.host() + components.port = baseURL.port + return components.string ?? "" + } + + func send(_ request: URLRequest) async throws -> (Data, HTTPURLResponse) { + let (data, response) = try await session.data(for: request) + guard let http = response as? HTTPURLResponse else { + throw APIFailure(status: 0, message: "The server sent something other than HTTP.") + } + guard (200..<300).contains(http.statusCode) else { + throw Self.failure(from: data, status: http.statusCode) + } + return (data, http) + } + + /// The API answers failures as `{ "_tag": "NotFound", "message": "…" }`, and better-auth as `{ "message": "…" }`. + static func failure(from data: Data, status: Int) -> APIFailure { + struct Body: Decodable { + let message: String? + /// better-auth's reason, such as `EMAIL_NOT_VERIFIED`. + let code: String? + } + let body = try? JSONDecoder().decode(Body.self, from: data) + return APIFailure( + status: status, + message: body?.message ?? HTTPURLResponse.localizedString(forStatusCode: status).capitalized, + code: body?.code + ) + } +} + +extension Date { + private static let withFraction: ISO8601DateFormatter = { + let formatter = ISO8601DateFormatter() + formatter.formatOptions = [.withInternetDateTime, .withFractionalSeconds] + return formatter + }() + + private static let withoutFraction = ISO8601DateFormatter() + + /// As the API writes a timestamp: `2026-10-30T09:00:00.000Z`. + var iso8601: String { Self.withFraction.string(from: self) } + + init?(iso8601 text: String) { + guard let date = Self.withFraction.date(from: text) ?? Self.withoutFraction.date(from: text) else { return nil } + self = date + } +} diff --git a/apps/ios/Sugabots/API/APISupport.swift b/apps/ios/Sugabots/API/APISupport.swift new file mode 100644 index 000000000..23f22e555 --- /dev/null +++ b/apps/ios/Sugabots/API/APISupport.swift @@ -0,0 +1,252 @@ +import Foundation + +// What `API.generated.swift` is written against: how a request is sent and +// how its parts are encoded. + +extension APIClient { + /// How request bodies are written: timestamps as the API writes them, and + /// numbers JSON can't hold as the strings Effect writes for them. + static let encoder: JSONEncoder = { + let encoder = JSONEncoder() + encoder.dateEncodingStrategy = .custom { date, encoder in + var container = encoder.singleValueContainer() + try container.encode(date.iso8601) + } + encoder.nonConformingFloatEncodingStrategy = .convertToString( + positiveInfinity: NonFiniteNumberText.positiveInfinity, + negativeInfinity: NonFiniteNumberText.negativeInfinity, + nan: NonFiniteNumberText.nan + ) + return encoder + }() + + /// Sends a request and decodes its answer. + func call( + _ method: String, _ path: String, query: [URLQueryItem], body: (some Encodable)? = Empty?.none + ) async throws -> Response { + let data = try await callForData(method, path, query: query, body: body) + return try Self.decoder.decode(Response.self, from: data) + } + + /// Sends a request and answers with its body as it came. + @discardableResult + func callForData( + _ method: String, _ path: String, query: [URLQueryItem], body: (some Encodable)? = Empty?.none + ) async throws -> Data { + var request = request(path, method: method, queryItems: query) + if let body { + request.setValue("application/json", forHTTPHeaderField: "Content-Type") + request.httpBody = try Self.encoder.encode(body) + } + return try await send(request).0 + } + + /// Sends `data` as the body as it is, as an upload. + func callForData(_ method: String, _ path: String, query: [URLQueryItem], data: Data) async throws -> Data { + var request = request(path, method: method, queryItems: query) + request.setValue("application/octet-stream", forHTTPHeaderField: "Content-Type") + request.httpBody = data + return try await send(request).0 + } + + /// Sends `data` as the body as it is, and decodes the answer. + func call(_ method: String, _ path: String, query: [URLQueryItem], data: Data) async throws -> Response { + try Self.decoder.decode(Response.self, from: await callForData(method, path, query: query, data: data)) + } + + /// A request with no body. + struct Empty: Encodable {} +} + +/// The strings Effect writes for the numbers JSON can't hold. +enum NonFiniteNumberText { + static let positiveInfinity = "Infinity" + static let negativeInfinity = "-Infinity" + static let nan = "NaN" +} + +/// A value a request can carry in its path or its query string. +protocol ParameterValue { + var parameterText: String { get } +} + +extension ParameterValue where Self: RawRepresentable, RawValue == String { + var parameterText: String { rawValue } +} + +extension String: ParameterValue { + var parameterText: String { self } +} + +extension Int: ParameterValue { + var parameterText: String { String(self) } +} + +extension Double: ParameterValue { + var parameterText: String { String(self) } +} + +extension Bool: ParameterValue { + var parameterText: String { self ? "true" : "false" } +} + +extension Date: ParameterValue { + var parameterText: String { iso8601 } +} + +/// The characters a path segment keeps as they are: RFC 3986's unreserved ones. +private let unreservedCharacters = CharacterSet(charactersIn: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~") + +/// `value` as one segment of a request's path, every other character percent-encoded, so a `/` or `?` in it stays inside the segment. +func pathSegment(_ value: some ParameterValue) -> String { + value.parameterText.addingPercentEncoding(withAllowedCharacters: unreservedCharacters) ?? value.parameterText +} + +/// A request's query, built a parameter at a time; one left out is not sent. +struct QueryItems { + private(set) var items: [URLQueryItem] = [] + + mutating func add(_ name: String, _ value: (some ParameterValue)?) { + guard let value else { return } + items.append(URLQueryItem(name: name, value: value.parameterText)) + } + + mutating func add(_ name: String, _ values: [some ParameterValue]?) { + for value in values ?? [] { + items.append(URLQueryItem(name: name, value: value.parameterText)) + } + } +} + +/// A field a request may leave out, to keep what the server has, or send, even +/// as nil, to change it: `.omitted`, or `.present(nil)` to clear it. +/// +/// A struct's synthesized `Codable` writes and reads an `Omittable` field +/// through the `KeyedEncodingContainer` and `KeyedDecodingContainer` methods +/// below, which leave an omitted field out, and read a missing one as omitted. +enum Omittable: Codable, Hashable, Sendable { + case omitted + case present(Wrapped?) + + /// The value given, or nil when the field is omitted or cleared. + var presentValue: Wrapped? { + if case let .present(value) = self { return value } + return nil + } + + init(from decoder: any Decoder) throws { + let container = try decoder.singleValueContainer() + self = .present(container.decodeNil() ? nil : try container.decode(Wrapped.self)) + } + + func encode(to encoder: any Encoder) throws { + var container = encoder.singleValueContainer() + switch self { + case .omitted, .present(nil): try container.encodeNil() + case let .present(value?): try container.encode(value) + } + } +} + +extension KeyedEncodingContainer { + mutating func encode(_ value: Omittable, forKey key: Key) throws { + switch value { + case .omitted: return + case .present(nil): try encodeNil(forKey: key) + case let .present(wrapped?): try encode(wrapped, forKey: key) + } + } +} + +extension KeyedDecodingContainer { + func decode(_: Omittable.Type, forKey key: Key) throws -> Omittable { + guard contains(key) else { return .omitted } + return .present(try decodeIfPresent(Wrapped.self, forKey: key)) + } +} + +/// A key named at runtime: the property a union is told apart by. +struct AnyCodingKey: CodingKey { + let stringValue: String + var intValue: Int? { nil } + + init(_ stringValue: String) { + self.stringValue = stringValue + } + + init?(stringValue: String) { + self.stringValue = stringValue + } + + init?(intValue _: Int) { + nil + } +} + +/// Any JSON value: what a tool call took and returned. +enum JSONValue: Codable, Hashable, Sendable { + case string(String) + case number(Double) + case bool(Bool) + case null + case array([JSONValue]) + case object([String: JSONValue]) + + init(from decoder: any Decoder) throws { + let container = try decoder.singleValueContainer() + // A string is tried before a number: `APIClient.decoder` reads the strings + // `Infinity`, `-Infinity` and `NaN` as numbers, which here are strings. + if container.decodeNil() { + self = .null + } else if let value = try? container.decode(Bool.self) { + self = .bool(value) + } else if let value = try? container.decode(String.self) { + self = .string(value) + } else if let value = try? container.decode(Double.self) { + self = .number(value) + } else if let value = try? container.decode([JSONValue].self) { + self = .array(value) + } else { + self = try .object(container.decode([String: JSONValue].self)) + } + } + + func encode(to encoder: any Encoder) throws { + var container = encoder.singleValueContainer() + switch self { + case let .string(value): try container.encode(value) + case let .number(value): try container.encode(value) + case let .bool(value): try container.encode(value) + case .null: try container.encodeNil() + case let .array(values): try container.encode(values) + case let .object(fields): try container.encode(fields) + } + } + + /// Pretty-printed, as a request's fields are shown for approval. + var prettyPrinted: String { + switch self { + case let .string(value): return value + case let .number(value): return value.rounded() == value ? String(Int(value)) : String(value) + case let .bool(value): return String(value) + case .null: return "null" + case .array, .object: + guard + let data = try? JSONSerialization.data(withJSONObject: foundationValue, options: [.prettyPrinted, .sortedKeys]), + let text = String(data: data, encoding: .utf8) + else { return "" } + return text + } + } + + private var foundationValue: Any { + switch self { + case let .string(value): value + case let .number(value): value + case let .bool(value): value + case .null: NSNull() + case let .array(values): values.map(\.foundationValue) + case let .object(fields): fields.mapValues(\.foundationValue) + } + } +} diff --git a/apps/ios/Sugabots/API/Models.swift b/apps/ios/Sugabots/API/Models.swift new file mode 100644 index 000000000..8bc03e7fd --- /dev/null +++ b/apps/ios/Sugabots/API/Models.swift @@ -0,0 +1,343 @@ +import Foundation + +// What the app adds to the API's types in `API.generated.swift`: how it +// identifies them in lists, and what it reads from them often enough to name. + +extension Workspace: Identifiable {} +extension Pod: Identifiable {} +extension Agent: Identifiable {} +extension Message: Identifiable {} +extension ToolCallPart: Identifiable {} +extension CollaborationPart: Identifiable {} +extension FilePart: Identifiable {} +extension Thread: Identifiable {} +extension ConversationThread: Identifiable {} +extension BotChannel: Identifiable {} +extension PodChat: Identifiable {} +extension RoutineFeed: Identifiable {} +extension Routine: Identifiable {} +extension RoutineExecution: Identifiable {} +extension ArtifactSummary: Identifiable {} +extension WorkspaceMember: Identifiable {} +extension WorkspaceInvitation: Identifiable {} +extension Connection: Identifiable {} + +extension PodPermissions { + /// Nothing allowed, for a pod drawn before it exists. + static let nothingAllowed = PodPermissions( + rename: false, manageMembers: false, leave: false, createAgents: false, updateAgents: false, deleteAgents: false, + manageConnections: false, manageSandbox: false, useDesktops: false, manageRoutines: false, runRoutines: false, deleteArtifacts: false + ) +} + +extension Agent { + /// Its description, or nil when it has none or it was left empty. + var givenDescription: String? { description.flatMap { $0.isEmpty ? nil : $0 } } +} + +extension WorkspaceModel: Identifiable { + var id: String { "\(providerName)/\(modelId)" } + var name: String { displayName ?? modelId } +} + +extension ThreadDetails { + /// Who is in a pod's channel, each counted in words: `1 person`, `2 bots`. + var headCount: (people: String, bots: String) { + (Names.count(members.count, "person", "people"), Names.count(crew.compactMap(\.agent).count, "bot", "bots")) + } +} + +// MARK: Messages + +extension Message { + /// The files the message carries, in order. + var files: [FilePart] { + parts.compactMap { if case let .file(file) = $0 { file } else { nil } } + } +} + +extension MessageAuthor { + var name: String { + switch self { + case let .person(person): person.name + case let .agent(agent): agent.name + case let .routineTrigger(trigger): trigger.routineName + case .unknown: "Someone" + } + } + + var personId: String? { + if case let .person(person) = self { person.id } else { nil } + } + + var agentParticipant: AgentParticipant? { + if case let .agent(agent) = self { agent } else { nil } + } + + /// The author as somebody in the thread; nil for a routine's trigger. + var participant: ThreadParticipant? { + switch self { + case let .person(person): .person(person) + case let .agent(agent): .agent(agent) + default: nil + } + } + + /// Whether a reply can quote it: anything but a routine's trigger. + var isReplyable: Bool { + if case .routineTrigger = self { false } else { true } + } +} + +extension AgentParticipant { + init(_ agent: Agent) { + self.init(id: agent.id, name: agent.name, handle: agent.handle, color: agent.color, face: agent.face, shape: agent.shape) + } +} + +extension ThreadParticipant: Identifiable { + var id: String { + switch self { + case let .person(person): person.id + case let .agent(agent): agent.id + // The app keeps only an unknown participant's kind, so its id is apart + // from every known one's, though shared with others of that kind. + case let .unknown(kind): "unknown:\(kind)" + } + } + + var name: String { + switch self { + case let .person(person): person.name + case let .agent(agent): agent.name + case .unknown: "" + } + } + + var handle: String { + switch self { + case let .person(person): person.handle + case let .agent(agent): agent.handle + case .unknown: "" + } + } + + var agent: AgentParticipant? { + if case let .agent(agent) = self { agent } else { nil } + } +} + +// MARK: Conversations + +/// A conversation as a list shows it, with what is unread in it and what waits on the person. +protocol ListedConversation { + var unreadMessages: Int { get } + var needsApproval: Bool { get } + var mentionsYou: Bool { get } +} + +extension ListedConversation { + /// Whether it has something the person hasn't seen: unread messages, or an approval. + var isNew: Bool { unreadMessages > 0 || needsApproval } + /// Whether it waits on the person: an approval, or a mention of them. + var needsYou: Bool { needsApproval || mentionsYou } +} + +extension ChatListItem: Identifiable, ListedConversation { + var id: String { conversation.id } +} + +extension ListedRoutine: Identifiable { + var id: String { routine.id } +} + +extension ChatList.Chat: Identifiable { + var id: String { conversation.id } +} + +extension ChatList.Channel: Identifiable, ListedConversation { + var id: String { conversation.id } +} + +extension ChatMessageItem: Identifiable { + /// The message, when the item is one. + var message: Message? { + if case let .message(item) = self { item.message } else { nil } + } + + /// Unique across kinds, as the web keys them. + var id: String { + switch self { + case let .message(item): "message:\(item.message.id)" + case let .routine(run): "routine:\(run.id)" + case let .routinePaused(paused): "routine_paused:\(paused.id)" + case let .collaboration(asked): "collaboration:\(asked.id)" + case let .thread(thread): "thread:\(thread.id)" + case let .unknown(kind): "unknown:\(kind)" + } + } + + var createdAt: Date { + switch self { + case let .message(item): item.message.createdAt + case let .routine(run): run.createdAt + case let .routinePaused(paused): paused.createdAt + case let .collaboration(asked): asked.createdAt + case let .thread(thread): thread.createdAt + case .unknown: .distantPast + } + } +} + +extension ChatMessageItem.Thread: Identifiable {} +extension ChatMessageItem.Routine: Identifiable {} + +extension ChatHistoryEntry: Identifiable { + var id: String { threadId } +} + +// MARK: Inbox and approvals + +extension ActivityItem: Identifiable { + var id: String { + switch self { + case let .mentionOrMessage(message): message.messageId + case let .routine(run): run.threadId + case let .collaboration(collaboration): collaboration.threadId + case let .unknown(kind): "unknown:\(kind)" + } + } + + var podId: String? { + switch self { + case let .mentionOrMessage(message): message.podId + case let .routine(run): run.podId + case let .collaboration(collaboration): collaboration.podId + case .unknown: nil + } + } + + var conversationId: String? { + switch self { + case let .mentionOrMessage(message): message.conversationId + case let .routine(run): run.conversationId + case let .collaboration(collaboration): collaboration.conversationId + case .unknown: nil + } + } + + var at: Date { + switch self { + case let .mentionOrMessage(message): message.at + case let .routine(run): run.at + case let .collaboration(collaboration): collaboration.at + case .unknown: .distantPast + } + } + + var unread: Bool { + switch self { + case let .mentionOrMessage(message): message.unread + case let .routine(run): run.unread + case let .collaboration(collaboration): collaboration.unread + case .unknown: false + } + } + + var preview: String? { + switch self { + case let .mentionOrMessage(message): message.preview + case let .routine(run): run.preview + case let .collaboration(collaboration): collaboration.brief + case .unknown: nil + } + } +} + +/// A tool call somebody was asked to approve, waiting or answered, as Approvals lists both. +struct ApprovalEntry: Identifiable { + let call: ToolCallPart + let agent: AgentParticipant + let podId: String + let threadId: String + let conversationId: String? + /// Present once somebody answered it. + let answer: AnsweredApproval.Answer? + + var id: String { call.id } + + init(_ request: ApprovalRequest) { + call = request.call + agent = request.agent + podId = request.podId + threadId = request.threadId + conversationId = request.conversationId + answer = nil + } + + init(_ request: AnsweredApproval) { + call = request.call + agent = request.agent + podId = request.podId + threadId = request.threadId + conversationId = request.conversationId + answer = request.answer + } +} + +// MARK: Notifications + +extension NotificationLevel: Identifiable { + var id: String { rawValue } +} + +/// A pod or one of its bots, where a person may choose a level of their own. +enum NotificationPlace: Hashable { + case pod(id: String) + case bot(id: String, podId: String) + + var kind: NotificationPlaceKind { + switch self { + case .pod: .pod + case .bot: .bot + } + } + + var id: String { + switch self { + case let .pod(id), let .bot(id, _): id + } + } +} + +extension NotificationSettings { + /// The level chosen for the place itself, or nil when it follows the one above it. + func levelChosen(for place: NotificationPlace) -> NotificationLevel? { + switch place { + case let .pod(id): pods[id] + case let .bot(id, _): bots[id] + } + } + + /// The level a place follows when none is chosen for it: its pod's, or the person's own. + func levelAbove(_ place: NotificationPlace) -> NotificationLevel { + if case let .bot(_, podId) = place, let podLevel = pods[podId] { return podLevel } + return level + } + + /// When the place's mute ends, or nil when it isn't muted for a while. + func mutedUntil(_ place: NotificationPlace, now: Date = .now) -> Date? { + let until: Date? = + switch place { + case let .pod(id): mutedUntil.pods[id] + case let .bot(id, _): mutedUntil.bots[id] + } + guard let until, until > now else { return nil } + return until + } + + /// Whether the place is muted, for good or for a while. + func isMuted(_ place: NotificationPlace) -> Bool { + mutedUntil(place) != nil || levelChosen(for: place) == .nothing + } +} diff --git a/apps/ios/Sugabots/API/RoutineModels.swift b/apps/ios/Sugabots/API/RoutineModels.swift new file mode 100644 index 000000000..e9eee72d2 --- /dev/null +++ b/apps/ios/Sugabots/API/RoutineModels.swift @@ -0,0 +1,232 @@ +import Foundation + +// How the routine pages edit what starts a routine, and how those edits become +// the API's `RoutineSchedule`, `WebhookAuth` and `RoutineTriggerInput`. + +/// Which day of the month a monthly schedule runs on: the 1st to the 28th, or the last. +enum MonthDay: Hashable { + case day(Int) + case last +} + +/// A schedule picked by its parts: every so many days, weeks or months, from +/// `startsOn`, at `times`; on `days` of a week, or on `dayOfMonth` of a month. +struct CalendarSchedule: Hashable { + enum Repeat: String, CaseIterable, Hashable { + case daily, weekly, monthly + } + + var repeatKind: Repeat + var every: Int + /// Minutes past midnight. + var times: [Int] + /// `YYYY-MM-DD`, which the count of days, weeks or months starts from. + var startsOn: String + /// A weekly schedule's days. + var days: [Weekday] = [] + /// A monthly schedule's day. + var dayOfMonth: MonthDay = .day(1) + + var apiValue: RoutineSchedule { + switch repeatKind { + case .daily: + .daily(.init(every: every, times: times, startsOn: startsOn)) + case .weekly: + .weekly(.init(every: every, days: days, times: times, startsOn: startsOn)) + case .monthly: + .monthly(.init(every: every, dayOfMonth: dayOfMonth.apiValue, times: times, startsOn: startsOn)) + } + } +} + +extension MonthDay { + var apiValue: RoutineSchedule.Monthly.DayOfMonth { + switch self { + case let .day(number): .integer(number) + case .last: .last + } + } +} + +/// When a scheduled routine runs: picked by its parts, or a cron expression +/// kept as written before schedules were picked this way, or a kind from a +/// newer server than this app knows, which can't be sent back. +enum TriggerSchedule: Hashable { + case calendar(CalendarSchedule) + case cron(String) + case unknown(kind: String) + + init(_ schedule: RoutineSchedule) { + switch schedule { + case let .daily(daily): + self = .calendar(CalendarSchedule(repeatKind: .daily, every: daily.every, times: daily.times, startsOn: daily.startsOn)) + case let .weekly(weekly): + self = .calendar(CalendarSchedule(repeatKind: .weekly, every: weekly.every, times: weekly.times, startsOn: weekly.startsOn, days: weekly.days)) + case let .monthly(monthly): + let day: MonthDay = + switch monthly.dayOfMonth { + case let .integer(number): .day(number) + case .last: .last + } + self = .calendar(CalendarSchedule(repeatKind: .monthly, every: monthly.every, times: monthly.times, startsOn: monthly.startsOn, dayOfMonth: day)) + case let .cron(cron): + self = .cron(cron.expression) + case let .unknown(kind): + self = .unknown(kind: kind) + } + } + + var apiValue: RoutineSchedule { + switch self { + case let .calendar(schedule): schedule.apiValue + case let .cron(expression): .cron(.init(expression: expression)) + // Its encoding throws, so a routine with it fails to save rather than losing it. + case let .unknown(kind): .unknown(kind) + } + } +} + +/// How a webhook's caller proves it holds the routine's secret, as its editor +/// picks it: as a known source signs, or one of the generic kinds. +enum WebhookAuthChoice: Hashable { + /// `github`, `stripe`, `slack` or `linear`, each signing its own way. + case source(String) + case hmac(header: String, algorithm: String, encoding: String) + case apiKey(header: String) + case bearer + case basic(username: String) + + /// The senders that sign their own way, as the API knows them. + static let sources = WebhookAuth.GithubOrStripeOrSlackOrLinear.Kind.known.map(\.rawValue) + + /// What a webhook starts with until somebody chooses: a signature, which most senders make. + static let `default` = WebhookAuthChoice.hmac(header: "X-Signature", algorithm: "sha256", encoding: "hex") + + init(_ auth: WebhookAuth) { + switch auth { + case let .githubOrStripeOrSlackOrLinear(source): self = .source(source.kind.rawValue) + case let .hmac(hmac): self = .hmac(header: hmac.header, algorithm: hmac.algorithm.rawValue, encoding: hmac.encoding.rawValue) + case let .apiKey(apiKey): self = .apiKey(header: apiKey.header) + case .bearer: self = .bearer + case let .basic(basic): self = .basic(username: basic.username) + case .unknown: self = .default + } + } + + var kind: String { + switch self { + case let .source(source): source + case .hmac: "hmac" + case .apiKey: "api_key" + case .bearer: "bearer" + case .basic: "basic" + } + } + + var isSource: Bool { + if case .source = self { return true } + return false + } + + var apiValue: WebhookAuth { + switch self { + case let .source(source): .githubOrStripeOrSlackOrLinear(.init(kind: .init(rawValue: source))) + case let .hmac(header, algorithm, encoding): + .hmac(.init(header: header, algorithm: .init(rawValue: algorithm), encoding: .init(rawValue: encoding))) + case let .apiKey(header): .apiKey(.init(header: header)) + case .bearer: .bearer(.init()) + case let .basic(username): .basic(.init(username: username)) + } + } +} + +/// A trigger as it is written to make or change it. +enum TriggerInput: Hashable { + case cron(schedule: TriggerSchedule, timezone: String) + /// `secret` nil for none, so the address alone runs it. + case webhook(auth: WebhookAuthChoice, secret: String?) + case github(connectionId: String, repository: String, events: [RepositoryEvent]) + + var kind: String { + switch self { + case .cron: "cron" + case .webhook: "webhook" + case .github: "github" + } + } + + var apiValue: RoutineTriggerInput { + switch self { + case let .cron(schedule, timezone): + .cron(.init(schedule: schedule.apiValue, timezone: timezone)) + case let .webhook(auth, secret): + .webhook(.init(auth: auth.apiValue, secret: .present(secret))) + case let .github(connectionId, repository, events): + .github(.init(connectionId: connectionId, repository: repository, events: events)) + } + } +} + +extension RoutineTrigger: Identifiable { + var id: String { + switch self { + case let .cron(cron): cron.id + case let .webhook(webhook): webhook.id + case let .github(github): github.id + case let .unknown(kind): "unknown:\(kind)" + } + } + + var kind: String { + switch self { + case .cron: "cron" + case .webhook: "webhook" + case .github: "github" + case let .unknown(kind): kind + } + } + + /// When it next runs on its schedule; nil while paused, or off a schedule. + var nextScheduledAt: Date? { + if case let .cron(cron) = self { cron.nextScheduledAt } else { nil } + } + + /// The trigger as written to save it again. + var input: TriggerInput { + switch self { + case let .cron(cron): .cron(schedule: TriggerSchedule(cron.schedule), timezone: cron.timezone) + case let .github(github): .github(connectionId: github.connectionId, repository: github.repository, events: github.events) + case let .webhook(webhook): .webhook(auth: WebhookAuthChoice(webhook.auth), secret: nil) + case .unknown: .webhook(auth: .default, secret: nil) + } + } +} + +extension Routine { + /// A copy on the same bot, paused so the two don't both run, as the web's + /// `copyOf`: a webhook copy gets its own address and a new secret, and a + /// repository copy runs on the same repository and events. + func copy(siblingNames: [String]) -> NewRoutine { + NewRoutine( + name: Self.copyName(name, taken: siblingNames), + instructions: instructions, + state: .paused, + results: results, + triggers: triggers.map { trigger in + if case let .webhook(auth, _) = trigger.input { return .webhook(.init(auth: auth.apiValue)) } + return trigger.input.apiValue + } + ) + } + + /// "{name} copy", or "{name} copy 2" and on when that is taken, shortened to fit. + static func copyName(_ name: String, taken: [String]) -> String { + var number = 1 + while true { + let suffix = number == 1 ? " copy" : " copy \(number)" + let candidate = String(name.prefix(Limits.maxRoutineNameCharacters - suffix.count)) + suffix + if !taken.contains(candidate) { return candidate } + number += 1 + } + } +} diff --git a/apps/ios/Sugabots/API/TokenStore.swift b/apps/ios/Sugabots/API/TokenStore.swift new file mode 100644 index 000000000..acb5ac760 --- /dev/null +++ b/apps/ios/Sugabots/API/TokenStore.swift @@ -0,0 +1,88 @@ +import Foundation +import Security + +/// The bearer token, kept in the Keychain and read from memory, since every request reads it. +final class TokenStore: @unchecked Sendable { + private static let service = "ai.sugabots.app.session" + + private let account: String + /// Guards `cached` and the Keychain item, so the two never disagree. + private let lock = NSLock() + private var cached: String? + + /// One token per server, so signing in to a second server keeps the first's. + init(server: URL) { + account = Self.account(for: server) + cached = Self.read(account: account) + } + + var token: String? { lock.withLock { cached } } + + /// Keeps `token`, replacing any kept before. Throws when the Keychain refuses + /// it, when the token is not kept for the next launch either. + func store(_ token: String) throws { + try lock.withLock { + try Self.write(token, account: account) + cached = token + } + } + + /// Forgets the token, signing this app out of the server. + func clear() { + lock.withLock { + cached = nil + SecItemDelete(Self.query(account: account) as CFDictionary) + } + } + + /// The Keychain account `server`'s token is kept under: its address with + /// its scheme and host in lowercase and no trailing slash, so + /// `https://Example.com/api/` and `https://example.com/api` share one. + static func account(for server: URL) -> String { + guard var components = URLComponents(url: server, resolvingAgainstBaseURL: false) else { return server.absoluteString } + components.scheme = components.scheme?.lowercased() + components.host = components.host?.lowercased() + while components.path.hasSuffix("/") { + components.path.removeLast() + } + return components.string ?? server.absoluteString + } + + private static func query(account: String) -> [String: Any] { + [ + kSecClass as String: kSecClassGenericPassword, + kSecAttrService as String: service, + kSecAttrAccount as String: account, + ] + } + + private static func read(account: String) -> String? { + var query = query(account: account) + query[kSecReturnData as String] = true + query[kSecMatchLimit as String] = kSecMatchLimitOne + var result: CFTypeRef? + guard SecItemCopyMatching(query as CFDictionary, &result) == errSecSuccess, let data = result as? Data else { return nil } + return String(data: data, encoding: .utf8) + } + + /// Updates the account's item to `token`, or adds the item when there is none. + private static func write(_ token: String, account: String) throws { + let attributes: [String: Any] = [ + kSecValueData as String: Data(token.utf8), + kSecAttrAccessible as String: kSecAttrAccessibleAfterFirstUnlockThisDeviceOnly, + ] + let updated = SecItemUpdate(query(account: account) as CFDictionary, attributes as CFDictionary) + if updated == errSecSuccess { return } + guard updated == errSecItemNotFound else { throw KeychainFailure(status: updated) } + let item = query(account: account).merging(attributes) { _, new in new } + let added = SecItemAdd(item as CFDictionary, nil) + guard added == errSecSuccess else { throw KeychainFailure(status: added) } + } +} + +/// The Keychain refused to keep the sign-in, with `status`, a Security framework result code. +struct KeychainFailure: LocalizedError { + let status: OSStatus + + var errorDescription: String? { "Your sign-in could not be kept in the Keychain (error \(status))." } +} diff --git a/apps/ios/Sugabots/Conversation/ChatGroups.swift b/apps/ios/Sugabots/Conversation/ChatGroups.swift new file mode 100644 index 000000000..67accc9df --- /dev/null +++ b/apps/ios/Sugabots/Conversation/ChatGroups.swift @@ -0,0 +1,94 @@ +import Foundation + +/// A conversation's items in groups, as the web's `chatGroupsOf`: runs of +/// messages, and each other item on its own, each marked where a new day +/// (or in a routine's thread, a new run) starts. +enum ChatGroups { + struct Group: Identifiable { + enum Content { + case messages([Message]) + case thread(ChatMessageItem.Thread) + case paused(Date) + case run(ChatMessageItem.Routine) + } + + let id: String + let at: Date + let separated: Bool + var content: Content + } + + /// How long a quiet spell is before the same author starts a new group. + private static let longQuiet: TimeInterval = 60 * 60 + + static func of(_ items: [ChatMessageItem], byRun: Bool, under: Set) -> [Group] { + var groups: [Group] = [] + var previousAt: Date? + for item in items { + if case let .thread(thread) = item, under.contains(thread.id) { continue } + // Another bot asking a channel's bot for help, which the web draws as a row; not drawn here yet. + if case .collaboration = item { continue } + let at = item.createdAt + let separated = byRun ? startsRun(item) : startsNewDay(previousAt, at) + previousAt = at + switch item { + case let .message(messageItem): + let message = messageItem.message + if !separated, let last = groups.last, case var .messages(messages) = last.content { + messages.append(message) + groups[groups.count - 1].content = .messages(messages) + } else { + groups.append(Group(id: item.id, at: at, separated: separated, content: .messages([message]))) + } + case let .thread(thread): + groups.append(Group(id: item.id, at: at, separated: separated, content: .thread(thread))) + case let .routinePaused(paused): + groups.append(Group(id: item.id, at: at, separated: separated, content: .paused(paused.createdAt))) + case let .routine(run): + groups.append(Group(id: item.id, at: at, separated: separated, content: .run(run))) + case .collaboration, .unknown: + continue + } + } + return groups + } + + /// Whether `at` is the first thing shown, or falls on a new day from `previous`, and so wants a day marker. + static func startsNewDay(_ previous: Date?, _ at: Date, calendar: Calendar = .current) -> Bool { + guard let previous else { return true } + return !calendar.isDate(previous, inSameDayAs: at) + } + + private static func startsRun(_ item: ChatMessageItem) -> Bool { + switch item { + case .routine: true + case let .message(item): item.message.routineResultOf != nil + default: false + } + } + + /// Whether a reply's turn is still going, so the typing line stands in for it, as the web's `isTyping`. + /// Neither while it waits on a collaborator, whose line says so, nor on an approval, whose card does. + static func isTyping(_ message: Message) -> Bool { + if case .collaboration? = message.parts.last { return false } + let awaiting = message.parts.contains { if case let .toolCall(call) = $0 { call.awaitsApproval } else { false } } + return message.status == .streaming && !awaiting + } + + /// Whether `message` starts a group under its author's face and name: a new + /// author, an hour's quiet, a reply, whose quote sits over its author's name, + /// or a message after one that opened a collaboration, whose thread line ends that group. + static func startsGroup(_ previous: Message?, _ message: Message) -> Bool { + guard let previous, sameAuthor(previous, message), message.replyTo == nil else { return true } + if previous.parts.contains(where: { if case .collaboration = $0 { true } else { false } }) { return true } + return message.createdAt.timeIntervalSince(previous.createdAt) >= longQuiet + } + + private static func sameAuthor(_ left: Message, _ right: Message) -> Bool { + switch (left.author, right.author) { + case let (.person(a), .person(b)): a.id == b.id + case let (.agent(a), .agent(b)): a.id == b.id + default: false + } + } +} diff --git a/apps/ios/Sugabots/Conversation/FileLook.swift b/apps/ios/Sugabots/Conversation/FileLook.swift new file mode 100644 index 000000000..b2ba5a155 --- /dev/null +++ b/apps/ios/Sugabots/Conversation/FileLook.swift @@ -0,0 +1,34 @@ +import Foundation + +/// How a file is drawn, by its media type and name; its raw value is the web's name for it. +enum FileLook: String { + case image, pdf, sheet, other + + static func of(_ file: FilePart) -> FileLook { + let type = mediaTypeEssence(file.contentType) + if type.hasPrefix("image/") { return .image } + let ext = extensionOf(file.name) + if type == "application/pdf" || ext == "pdf" { return .pdf } + if type == "text/csv" || sheetExtensions.contains(ext) { return .sheet } + return .other + } + + /// A media type without its parameters, as `mediaTypeEssence`: ` Text/CSV; charset=utf-8` is `text/csv`. + static func mediaTypeEssence(_ mediaType: String) -> String { + (mediaType.split(separator: ";", omittingEmptySubsequences: false).first.map(String.init) ?? "").trimmingCharacters(in: .whitespacesAndNewlines).lowercased() + } + + /// The part of `name` after its last dot, lowercased, or nothing when it has none. + static func extensionOf(_ name: String) -> String { + guard let dot = name.lastIndex(of: "."), dot > name.startIndex else { return "" } + return name[name.index(after: dot)...].lowercased() + } + + /// `512 B`, `40 KB`, `1.2 MB`. + static func sizeLabel(_ bytes: Int) -> String { + if bytes < 1024 { return "\(bytes) B" } + let kilobytes = Int((Double(bytes) / 1024).rounded()) + if kilobytes < 1024 { return "\(kilobytes) KB" } + return String(format: "%.1f MB", Double(bytes) / (1024 * 1024)) + } +} diff --git a/apps/ios/Sugabots/Conversation/MarkdownBlocks.swift b/apps/ios/Sugabots/Conversation/MarkdownBlocks.swift new file mode 100644 index 000000000..fcb28a3cd --- /dev/null +++ b/apps/ios/Sugabots/Conversation/MarkdownBlocks.swift @@ -0,0 +1,271 @@ +import Foundation + +/// Markdown split into blocks, as the web's renderer splits GitHub's flavour of +/// it, enough of it for what bots write. Each block's words are still markdown, +/// for `inline` to read their marks, but its lines are already joined as they +/// read: a line break where markdown breaks the line, and a space elsewhere. +enum MarkdownBlocks { + struct ListItem { + let text: String + /// Whether a task is done, for an item that is a task: `- [x] Done`. + var checked: Bool? + /// Lines nested under it, as markdown of their own. + let children: String + } + + enum Block { + case paragraph(String) + case heading(level: Int, text: String) + case list(items: [ListItem], ordered: Bool, start: Int) + case quote(String) + case code(language: String?, code: String) + case table(header: [String], rows: [[String]]) + case rule + } + + /// How far code is indented to be a block of its own without a fence. + private static let codeIndent = 4 + + static func parse(_ markdown: String) -> [Block] { + let lines = markdown.replacingOccurrences(of: "\r\n", with: "\n").components(separatedBy: "\n") + var blocks: [Block] = [] + var index = 0 + var paragraph: [String] = [] + func closeParagraph() { + if !paragraph.isEmpty { + blocks.append(.paragraph(joined(paragraph))) + paragraph = [] + } + } + while index < lines.count { + let line = lines[index] + let trimmed = line.trimmingCharacters(in: .whitespaces) + if trimmed.hasPrefix("```") || trimmed.hasPrefix("~~~") { + closeParagraph() + let fence = String(trimmed.prefix(3)) + let language = String(trimmed.dropFirst(3)).trimmingCharacters(in: .whitespaces) + var code: [String] = [] + index += 1 + while index < lines.count, !lines[index].trimmingCharacters(in: .whitespaces).hasPrefix(fence) { + code.append(lines[index]) + index += 1 + } + blocks.append(.code(language: language.isEmpty ? nil : language, code: code.joined(separator: "\n"))) + index += 1 + continue + } + if trimmed.isEmpty { + closeParagraph() + index += 1 + continue + } + // A line of = or - under a paragraph makes it a heading. + if !paragraph.isEmpty, let underline = trimmed.wholeMatch(of: /(=+|-+)/) { + blocks.append(.heading(level: underline.1.first == "=" ? 1 : 2, text: joined(paragraph))) + paragraph = [] + index += 1 + continue + } + if paragraph.isEmpty, indentOf(line) >= codeIndent { + var code: [String] = [] + while index < lines.count { + let next = lines[index] + if next.trimmingCharacters(in: .whitespaces).isEmpty { + code.append("") + } else if indentOf(next) >= codeIndent { + code.append(String(next.dropFirst(codeIndent))) + } else { + break + } + index += 1 + } + while code.last?.isEmpty == true { code.removeLast() } + blocks.append(.code(language: nil, code: code.joined(separator: "\n"))) + continue + } + if let heading = trimmed.wholeMatch(of: /(#{1,6})(?:\s+(.*?))?(?:\s+#+)?\s*/) { + closeParagraph() + blocks.append(.heading(level: heading.1.count, text: joined([String(heading.2 ?? "")]))) + index += 1 + continue + } + if isRule(trimmed) { + closeParagraph() + blocks.append(.rule) + index += 1 + continue + } + if trimmed.hasPrefix(">") { + closeParagraph() + var quoted: [String] = [] + while index < lines.count, lines[index].trimmingCharacters(in: .whitespaces).hasPrefix(">") { + quoted.append(String(lines[index].trimmingCharacters(in: .whitespaces).dropFirst()).trimmingCharacters(in: .init(charactersIn: " "))) + index += 1 + } + blocks.append(.quote(quoted.joined(separator: "\n"))) + continue + } + if let header = tableHeader(at: index, in: lines) { + closeParagraph() + var rows: [[String]] = [] + index += 2 + while index < lines.count, !lines[index].trimmingCharacters(in: .whitespaces).isEmpty, lines[index].contains("|") { + // A row has the header's cells: any past them are dropped, and any it lacks are empty. + let row = cells(lines[index]) + rows.append((0.. Block { + var items: [ListItem] = [] + func isSibling(_ marker: ListMarker) -> Bool { + marker.ordered == first.ordered && marker.delimiter == first.delimiter && marker.indent <= first.indent + } + while index < lines.count, let marker = listMarker(lines[index]), isSibling(marker) { + var text = [marker.text] + var nested: [String] = [] + index += 1 + while index < lines.count { + let next = lines[index] + if next.trimmingCharacters(in: .whitespaces).isEmpty { + // After a blank line the item goes on only with lines indented under it. + guard let following = lines[(index + 1)...].first(where: { !$0.trimmingCharacters(in: .whitespaces).isEmpty }), + indentOf(following) > first.indent + else { break } + nested.append("") + index += 1 + continue + } + if let deeper = listMarker(next), deeper.indent <= first.indent { break } + let indent = indentOf(next) + if indent > first.indent { + nested.append(String(next.dropFirst(min(indent, first.indent + 2)))) + } else if nested.isEmpty, !startsBlock(next) { + // A line that isn't indented carries on the item's words. + text.append(next) + } else { + break + } + index += 1 + } + // Blank lines between items keep them in one list, a loose one. + var after = index + while after < lines.count, lines[after].trimmingCharacters(in: .whitespaces).isEmpty { after += 1 } + if after > index, after < lines.count, let sibling = listMarker(lines[after]), isSibling(sibling) { index = after } + var checked: Bool? + if let task = text[0].wholeMatch(of: /\[([ xX])\]\s+(.*)/) { + checked = task.1 != " " + text[0] = String(task.2) + } + while nested.first?.isEmpty == true { nested.removeFirst() } + items.append(ListItem(text: joined(text), checked: checked, children: nested.joined(separator: "\n"))) + } + return .list(items: items, ordered: first.ordered, start: first.number ?? 1) + } + + /// Lines of a paragraph as they read: each line break a space, unless two + /// spaces or a backslash end its line, where it breaks the line. Runs of + /// spaces read as one, as a browser draws them. + private static func joined(_ lines: [String]) -> String { + lines.enumerated().map { index, line in + let hardBreak = line.hasSuffix(" ") + let words = line.trimmingCharacters(in: .whitespaces).replacing(/[ \t]+/, with: " ") + guard index < lines.count - 1 else { return words } + // Foundation reads a backslash before a line break as a break of its own. + if hardBreak || words.hasSuffix("\\") { return words + "\n" } + return words + " " + }.joined() + } + + private static func isRule(_ trimmed: String) -> Bool { + trimmed.wholeMatch(of: /([-*_])(\s*\1){2,}/) != nil + } + + /// Whether `line` starts a block of its own, which ends the paragraph before it. + private static func startsBlock(_ line: String) -> Bool { + let trimmed = line.trimmingCharacters(in: .whitespaces) + return trimmed.hasPrefix("```") || trimmed.hasPrefix("~~~") || trimmed.hasPrefix(">") || trimmed.hasPrefix("#") || isRule(trimmed) + } + + /// The header's cells, when the line at `index` heads a table: one with a + /// pipe, over a row of dashes with as many cells, colons marking alignment. + private static func tableHeader(at index: Int, in lines: [String]) -> [String]? { + guard index + 1 < lines.count, lines[index].contains("|") else { return nil } + let delimiter = lines[index + 1].trimmingCharacters(in: .whitespaces) + guard delimiter.wholeMatch(of: /\|?\s*:?-+:?\s*(\|\s*:?-+:?\s*)*\|?/) != nil else { return nil } + let header = cells(lines[index]) + return cells(delimiter).count == header.count ? header : nil + } + + /// A row's cells, split at each pipe that isn't escaped. An escaped one is + /// left for `inline` to read as the pipe it stands for. + private static func cells(_ row: String) -> [String] { + var inner = Substring(row.trimmingCharacters(in: .whitespaces)) + if inner.hasPrefix("|") { inner.removeFirst() } + if inner.hasSuffix("|"), !inner.hasSuffix("\\|") { inner.removeLast() } + var cells: [String] = [] + var cell = "" + var escaped = false + for character in inner { + if character == "|", !escaped { + cells.append(cell) + cell = "" + } else { + cell.append(character) + } + escaped = character == "\\" && !escaped + } + cells.append(cell) + return cells.map { joined([$0]) } + } + + /// A list item's marker: how far it is indented, a bullet's character or a + /// number's delimiter, the number, and the words after it. + private struct ListMarker { + let indent: Int + let ordered: Bool + let delimiter: Character + let number: Int? + let text: String + } + + private static func listMarker(_ line: String) -> ListMarker? { + let indent = indentOf(line) + let rest = line.dropFirst(indent) + if let bullet = rest.wholeMatch(of: /([-*+])\s+(.*)/) { + return ListMarker(indent: indent, ordered: false, delimiter: bullet.1.first ?? "-", number: nil, text: String(bullet.2)) + } + if let numbered = rest.wholeMatch(of: /(\d{1,9})([.)])\s+(.*)/) { + return ListMarker(indent: indent, ordered: true, delimiter: numbered.2.first ?? ".", number: Int(numbered.1), text: String(numbered.3)) + } + return nil + } + + private static func indentOf(_ line: String) -> Int { + line.prefix { $0 == " " || $0 == "\t" }.count + } + + /// A block's words with their inline marks read: emphasis, code and links as + /// presentation intents and links, the marks themselves gone. + static func inline(_ text: String) -> AttributedString { + let options = AttributedString.MarkdownParsingOptions(interpretedSyntax: .inlineOnlyPreservingWhitespace) + return (try? AttributedString(markdown: text, options: options)) ?? AttributedString(text) + } +} diff --git a/apps/ios/Sugabots/Conversation/Mentions.swift b/apps/ios/Sugabots/Conversation/Mentions.swift new file mode 100644 index 000000000..92c19c781 --- /dev/null +++ b/apps/ios/Sugabots/Conversation/Mentions.swift @@ -0,0 +1,169 @@ +import Foundation + +/// Whom a mention can name, as the web's `MentionTarget`: a person or a bot, +/// or with `@here` or `@channel`, everyone who can see the conversation. +/// `@here` or `@channel`, which a person writes to notify everyone who can see the conversation. +struct GroupMention: Hashable { + let handle: String + /// The people it would notify: the pod's people but its writer, never a bot. + let notifies: [PersonParticipant] + + var target: MentionTarget { .group(handle: handle) } +} + +enum MentionTarget: Hashable { + case participant(ThreadParticipant) + case group(handle: String) + + var handle: String { + switch self { + case let .participant(participant): participant.handle + case let .group(handle): handle + } + } + + /// What tells it apart from the others in a list of them, as `mentionTargetKey`. + var key: String { + switch self { + case let .participant(.person(person)): "person-\(person.id)" + case let .participant(.agent(agent)): "agent-\(agent.id)" + case let .participant(participant): "unknown-\(participant.id)" + case let .group(handle): handle + } + } + + var participant: ThreadParticipant? { + if case let .participant(participant) = self { participant } else { nil } + } +} + +/// Mentions in text, as `@sugabots/contracts` finds them: `@handle` for a +/// person or bot somebody may mention here, or `@here` and `@channel` for everyone. +enum Mentions { + /// What may not come just before a mention's `@`, as the inside of a + /// character class, as `NOT_BEFORE_MENTION` in `@sugabots/contracts`: a word + /// character, so an email address is not a mention, and a `.` or `@`, so + /// neither is a domain or `@@`. Spelled out rather than as `\w`, which in + /// Swift takes in letters beyond ASCII where JavaScript's does not. Regex + /// literals don't compose, so the patterns below are built from strings. + private static let notBeforeMention = "A-Za-z0-9_.@" + private static let notBeforeMentionCharacter = try! Regex("[\(notBeforeMention)]") + /// A handle as a mention writes it: ASCII letters and digits, in runs joined by + /// single hyphens. Both cases are spelled out rather than matched ignoring + /// case, which in Swift also takes in letters that fold to ASCII, as `K` does. + private static let handle = "[A-Za-z0-9]+(?:-[A-Za-z0-9]+)*" + + /// `@handle`, as `MENTION` in `@sugabots/contracts`. Swift's regexes can't + /// look behind, so what comes before the `@` is matched as the first group, + /// and the handle, without its `@`, is the second. Matched a Unicode scalar + /// at a time, as JavaScript does, so a handle ends before an accent that + /// would join its last letter. + private static let pattern = try! Regex( + "(^|[^\(notBeforeMention)])@(\(handle))", + as: (Substring, Substring, Substring).self + ).matchingSemantics(.unicodeScalar) + + /// A mention a space or line break has finished, as the composer turns into + /// a chip: what comes before the `@` as the first group, then `@handle`. + static let finished = try! Regex( + "(^|[^\(notBeforeMention)])(@\(handle))(?=\\s)", + as: (Substring, Substring, Substring).self + ).matchingSemantics(.unicodeScalar) + + /// The handles that address everyone in a conversation, as `GROUP_MENTION_HANDLES`. + static let groupHandles = ["here", "channel"] + + /// The threads whose messages notify people, where `@here` and `@channel` reach somebody, as `NOTIFYING_THREAD_TYPES`. + private static let notifyingThreadTypes: Set = [.conversation, .podChat, .botChannel] + + /// Whether the `@` at `index` in `text` can start a mention, as the contract's `canStartMention`. + static func canStart(at index: String.Index, in text: String) -> Bool { + guard index < text.endIndex, text[index] == "@" else { return false } + guard index > text.startIndex else { return true } + return String(text[text.index(before: index)]).wholeMatch(of: notBeforeMentionCharacter) == nil + } + + /// `text` split around its mentions, as `splitAroundMentions`: text at even + /// indexes and, between them, each mentioned handle as written, without its `@`. + static func split(_ text: String) -> [String] { + var parts: [String] = [] + var rest = text.startIndex + for match in text.matches(of: pattern) { + let at = text.unicodeScalars.index(before: match.2.startIndex) + parts.append(String(text.unicodeScalars[rest.. [Piece] { + split(text).enumerated().map { index, part in index.isMultiple(of: 2) ? .text(part) : .mention(handle: part) } + } + + /// The handles `text` mentions, lowercased, in order, as the contract's `mentionedHandles`. + static func handles(in text: String) -> [String] { + var found: [String] = [] + for (index, part) in split(text).enumerated() where index % 2 == 1 && !found.contains(part.lowercased()) { + found.append(part.lowercased()) + } + return found + } + + /// Those among `mentionable` whom `text` mentions. + static func mentioned(in text: String, among mentionable: [ThreadParticipant]) -> [ThreadParticipant] { + let named = handles(in: text) + return mentionable.filter { named.contains($0.handle) } + } + + /// The bot `text` mentions first among `crew`, whom sending from a pod's + /// channel starts a thread with, as the web's `firstBotNamed`; any named + /// after it are only mentioned. + static func firstBot(in text: String, among crew: [ThreadParticipant]) -> AgentParticipant? { + let bots = crew.compactMap(\.agent) + return handles(in: text).lazy.compactMap { handle in bots.first { $0.handle == handle } }.first + } + + /// `@here` and `@channel` as a message's writer can use them in a thread of + /// `threadType`, each notifying `members`, the pod's people, but the writer, + /// as `groupMentionsBy`. `writerPersonId` is the writer's id when a person + /// writes, and nil for a bot or a routine. None where they would notify + /// nobody, so they stay text. + static func groupMentions( + writtenBy writerPersonId: String?, + members: [PersonParticipant], + threadType: ThreadType? + ) -> [GroupMention] { + guard let writerPersonId, let threadType, notifyingThreadTypes.contains(threadType) else { return [] } + let notifies = members.filter { $0.id != writerPersonId } + if notifies.isEmpty { return [] } + return groupHandles.map { GroupMention(handle: $0, notifies: notifies) } + } + + /// Whom `handle`, as a mention writes it, names among `mentionable`, as + /// `targetWithHandle`. A person whose handle is `here` or `channel` is + /// mentioned with everyone else. + static func target(withHandle handle: String, among mentionable: [MentionTarget]) -> MentionTarget? { + let lowered = handle.lowercased() + return mentionable.first { if case .group(lowered) = $0 { true } else { false } } + ?? mentionable.first { $0.handle == lowered } + } +} diff --git a/apps/ios/Sugabots/Conversation/Names.swift b/apps/ios/Sugabots/Conversation/Names.swift new file mode 100644 index 000000000..ce6746e15 --- /dev/null +++ b/apps/ios/Sugabots/Conversation/Names.swift @@ -0,0 +1,20 @@ +import Foundation + +/// Lists of names and counts, as the web's `name-list.ts` writes them. +enum Names { + /// The most names written out; the rest are counted as "others". + private static let maxNamed = 3 + + /// `Jay Yu`, `Jay Yu and Priya Kaur`, `Jay, Priya and Sam`, or `Jay, Priya and 3 others`. + static func list(_ names: [String]) -> String { + guard names.count > 1, let last = names.last else { return names.first ?? "" } + guard names.count > maxNamed else { return names.dropLast().joined(separator: ", ") + " and " + last } + let named = names.prefix(maxNamed - 1) + return named.joined(separator: ", ") + " and \(names.count - named.count) others" + } + + /// `1 reply`, `3 replies`. + static func count(_ amount: Int, _ one: String, _ many: String) -> String { + "\(amount) \(amount == 1 ? one : many)" + } +} diff --git a/apps/ios/Sugabots/Conversation/Previews.swift b/apps/ios/Sugabots/Conversation/Previews.swift new file mode 100644 index 000000000..908fe7fb8 --- /dev/null +++ b/apps/ios/Sugabots/Conversation/Previews.swift @@ -0,0 +1,39 @@ +import Foundation + +/// Messages shortened for one line, as `messagePreview` in `@sugabots/contracts`. +enum Previews { + /// The longest a preview runs. + static let maxCharacters = Limits.messagePreviewCharacters + + static func message(_ content: String) -> String { + let line = content.components(separatedBy: "\n") + .lazy + .map { plain($0).replacingOccurrences(of: #"\s+"#, with: " ", options: .regularExpression).trimmingCharacters(in: .whitespaces) } + .first { !$0.isEmpty } ?? "" + guard line.count > maxCharacters else { return line } + let cut = String(line.prefix(maxCharacters - 1)) + let atWord = cut.lastIndex(of: " ").map { String(cut[..<$0]) } ?? cut + return atWord.trimmingCharacters(in: .whitespaces) + "…" + } + + /// A message as a reply quotes it: its spoken text, without narration. + static func quoted(_ message: Message) -> String { + var spoken = "" + for (index, part) in message.parts.enumerated() { + guard case let .text(textPart) = part else { continue } + if index + 1 < message.parts.count, case .toolCall = message.parts[index + 1] { continue } + spoken += textPart.text + } + return Self.message(spoken.isEmpty ? message.content : spoken) + } + + /// One line of markdown as the text it reads as once rendered, without its + /// syntax, as `markdownText`. A rule reads as nothing, where Foundation draws one. + private static func plain(_ line: String) -> String { + guard let parsed = try? AttributedString(markdown: line) else { return line } + return parsed.runs + .filter { run in !(run.presentationIntent?.components.contains { $0.kind == .thematicBreak } ?? false) } + .map { String(parsed[$0.range].characters) } + .joined() + } +} diff --git a/apps/ios/Sugabots/Conversation/Segments.swift b/apps/ios/Sugabots/Conversation/Segments.swift new file mode 100644 index 000000000..20bc661e5 --- /dev/null +++ b/apps/ios/Sugabots/Conversation/Segments.swift @@ -0,0 +1,90 @@ +import Foundation + +/// A message's parts in the order it says them, as the web's `segmentsOf`: +/// its words, the collaborations it started, and the requests it put to +/// somebody. Narration before a step is left to the step's line. +enum Segments { + struct Segment: Identifiable { + enum Kind { + case text(String) + case collaboration(CollaborationPart) + case toolCall(ToolCallPart) + } + + let id: String + let kind: Kind + + var text: String? { + if case let .text(text) = kind, !text.isEmpty { text } else { nil } + } + + var isEmptyText: Bool { + if case let .text(text) = kind { text.isEmpty } else { false } + } + } + + /// A reply still being written shows only its collaborations, the calls put + /// to somebody, and text something has followed: the run it is still writing + /// waits until it is finished. + static func of(_ message: Message) -> [Segment] { + let finished = message.status != .streaming + // A text run is keyed by where in the message it starts, in UTF-16 units as the web counts. + var written = 0 + var segments: [Segment] = [] + for (index, part) in message.parts.enumerated() { + switch part { + case let .collaboration(collaboration): + segments.append(Segment(id: collaboration.id, kind: .collaboration(collaboration))) + case let .toolCall(call): + // Only a call put to somebody shows as its own card; the rest are steps. + if wasPutToSomeone(call) { + segments.append(Segment(id: call.id, kind: .toolCall(call))) + } + case let .text(part): + let text = part.text + let later = message.parts.dropFirst(index + 1) + // Files and a routine result's artifacts go after all of a reply's text as + // they are attached, so one shared mid-reply doesn't mean the text before it is finished. + let followed = !text.trimmingCharacters(in: .whitespacesAndNewlines).isEmpty && later.contains { !isAttached($0) } + let narration: Bool = if case .toolCall? = later.first { true } else { false } + if (finished || followed) && !narration { + segments.append(Segment(id: "text@\(written)", kind: .text(text))) + } + written += text.utf16.count + case .file, .artifact, .unknown: + break + } + } + // A finished reply that said nothing still shows, so its notes have a row. + if finished && !segments.contains(where: { if case .text = $0.kind { true } else { false } }) { + segments.append(Segment(id: "text@\(written)", kind: .text(""))) + } + return segments + } + + /// Whether a reply being written has nothing settled to show yet, so shows only as its typing line. + static func showsNothingYet(_ message: Message) -> Bool { + guard message.status == .streaming else { return false } + let hasCallsOrFiles = message.parts.contains { part in + switch part { + case .toolCall, .file: true + default: false + } + } + return !hasCallsOrFiles && of(message).allSatisfy(\.isEmptyText) + } + + /// Whether a person was asked to allow the call, rather than policy allowing it on its own. + private static func wasPutToSomeone(_ call: ToolCallPart) -> Bool { + guard let status = call.approval?.status else { return false } + return [.pending, .allowed, .denied].contains(status) + } + + /// A part attached to a message after its text rather than placed in it, as `isAttached`. + private static func isAttached(_ part: MessagePart) -> Bool { + switch part { + case .file, .artifact: true + default: false + } + } +} diff --git a/apps/ios/Sugabots/Conversation/Times.swift b/apps/ios/Sugabots/Conversation/Times.swift new file mode 100644 index 000000000..9844e4855 --- /dev/null +++ b/apps/ios/Sugabots/Conversation/Times.swift @@ -0,0 +1,76 @@ +import Foundation + +/// Times as the web's `list-time.ts` writes them, and the day a conversation +/// moves on to. Each takes the locale and calendar to write in, which are the +/// device's unless a check gives its own. +enum Times { + private static let daysInWeek = 7 + private static let monthsInYear = 12 + private static let yesterday = "Yesterday" + + /// `6:12`: the hour and minute without AM or PM, as `formatClockTime`. + /// The day beside it, or the conversation around it, makes the period plain. + static func clock(_ date: Date, locale: Locale = .current, calendar: Calendar = .current) -> String { + let formatter = DateFormatter() + formatter.locale = locale + formatter.calendar = calendar + formatter.timeZone = calendar.timeZone + formatter.setLocalizedDateFormatFromTemplate("jmm") + return formatter.string(from: date) + .replacingOccurrences(of: formatter.amSymbol, with: "") + .replacingOccurrences(of: formatter.pmSymbol, with: "") + .trimmingCharacters(in: .whitespaces) + } + + /// As `formatListTime`: the time today, Yesterday, a weekday this week, + /// then the date, with the year only when it isn't this one. + static func list(_ date: Date, now: Date = .now, locale: Locale = .current, calendar: Calendar = .current) -> String { + let days = daysAgo(date, now: now, calendar: calendar) + if days <= 0 { return clock(date, locale: locale, calendar: calendar) } + if days == 1 { return yesterday } + let style = Date.FormatStyle(locale: locale, calendar: calendar, timeZone: calendar.timeZone) + if days < daysInWeek { return date.formatted(style.weekday(.abbreviated)) } + let sameYear = calendar.component(.year, from: date) == calendar.component(.year, from: now) + return date.formatted(sameYear ? style.day().month(.abbreviated) : style.day().month(.abbreviated).year()) + } + + /// As `formatListTimeInSentence`: `list` for the middle of a sentence, such as + /// "Last used yesterday". Only Yesterday is lowered; weekday and month names keep their capitals. + static func listInSentence(_ date: Date, now: Date = .now, locale: Locale = .current, calendar: Calendar = .current) -> String { + let shown = list(date, now: now, locale: locale, calendar: calendar) + return shown == yesterday ? shown.lowercased() : shown + } + + /// As `formatAge`: the time today, then whole days (`5d`), then whole + /// months once a calendar month has passed (`1m`), then whole years (`1y`). + static func age(_ date: Date, now: Date = .now, locale: Locale = .current, calendar: Calendar = .current) -> String { + let days = daysAgo(date, now: now, calendar: calendar) + if days <= 0 { return clock(date, locale: locale, calendar: calendar) } + let months = wholeMonths(from: date, to: now, calendar) + if months < 1 { return "\(days)d" } + if months < monthsInYear { return "\(months)m" } + return "\(months / monthsInYear)y" + } + + /// `Today`, `Yesterday`, `Mar 3`, or `Mar 3, 2025` in another year: where a conversation moves on to a new day, as `formatDay`. + static func day(_ date: Date, now: Date = .now, locale: Locale = .current, calendar: Calendar = .current) -> String { + let days = daysAgo(date, now: now, calendar: calendar) + if days == 0 { return "Today" } + if days == 1 { return yesterday } + let sameYear = calendar.component(.year, from: date) == calendar.component(.year, from: now) + let style = Date.FormatStyle(locale: locale, calendar: calendar, timeZone: calendar.timeZone).month(.abbreviated).day() + return date.formatted(sameYear ? style : style.year()) + } + + /// How many days before `now`'s day `date`'s day is: 0 today, 1 yesterday, negative in the future. + static func daysAgo(_ date: Date, now: Date = .now, calendar: Calendar = .current) -> Int { + calendar.dateComponents([.day], from: calendar.startOfDay(for: date), to: calendar.startOfDay(for: now)).day ?? 0 + } + + /// Calendar months from `from` to `to`, counting one only once its day of the month is reached. + private static func wholeMonths(from: Date, to: Date, _ calendar: Calendar) -> Int { + let (start, end) = (calendar.dateComponents([.year, .month, .day], from: from), calendar.dateComponents([.year, .month, .day], from: to)) + let months = ((end.year ?? 0) - (start.year ?? 0)) * monthsInYear + (end.month ?? 0) - (start.month ?? 0) + return (end.day ?? 0) < (start.day ?? 0) ? months - 1 : months + } +} diff --git a/apps/ios/Sugabots/Conversation/ToolNames.swift b/apps/ios/Sugabots/Conversation/ToolNames.swift new file mode 100644 index 000000000..e886736e2 --- /dev/null +++ b/apps/ios/Sugabots/Conversation/ToolNames.swift @@ -0,0 +1,63 @@ +import Foundation + +/// What a tool call is called wherever it is shown, as `lib/tool-names.ts` in the web app names it. +enum ToolNames { + /// Separates a connection's handle from its tool's name in a tool key: `linear__create_issue`. + private static let connectionSeparator = "__" + static let browserPrefix = "browser_" + static let artifactPrefix = "artifact_" + static let networkRequestTool = "request_network_access" + + /// What the step does: `Search issues`, or a built-in tool's name. + static func step(_ tool: String) -> String { + if let name = builtIn[tool] { return name } + if tool.hasPrefix(browserPrefix) { return words(fromKey: String(tool.dropFirst(browserPrefix.count))) } + return words(fromKey: split(tool).name) + } + + /// The step and the app it is in: `Search issues in Linear`. + static func title(_ tool: String) -> String { + let (handle, _) = split(tool) + guard let handle else { return step(tool) } + return "\(step(tool)) in \(words(fromKey: handle))" + } + + /// The connection's handle in a tool's key, or empty for a built-in tool. + static func handle(_ tool: String) -> String { split(tool).handle ?? "" } + + /// A connection as a step names it: its name, or words from its handle. + static func connectionLabel(_ handle: String, name: String? = nil) -> String { + handle.isEmpty ? "Built-in tools" : name ?? words(fromKey: handle) + } + + private static func split(_ tool: String) -> (handle: String?, name: String) { + guard let range = tool.range(of: connectionSeparator) else { return (nil, tool) } + return (String(tool[.. String { + var words = "" + var previous: Character? + for character in key { + if character == "_" || character == "-" { + words.append(" ") + } else if character.isUppercase, let previous, previous.isLowercase || previous.isNumber { + words.append(" ") + words.append(Character(character.lowercased())) + } else { + words.append(character) + } + previous = character + } + let trimmed = words.split(separator: " ").joined(separator: " ") + guard let first = trimmed.first else { return key } + return first.uppercased() + trimmed.dropFirst() + } +} + +/// What a connection is shown with elsewhere, by its handle, as `useConnectionLooks`. +struct ConnectionLook: Hashable { + let name: String + let presetId: String? +} diff --git a/apps/ios/Sugabots/Conversation/ToolSteps.swift b/apps/ios/Sugabots/Conversation/ToolSteps.swift new file mode 100644 index 000000000..b09de1b61 --- /dev/null +++ b/apps/ios/Sugabots/Conversation/ToolSteps.swift @@ -0,0 +1,296 @@ +import Foundation + +/// How a bot's tool calls read, as the web's `tool-steps.ts`, `tool-activity.ts` +/// and `ToolLine`'s helpers say them. +enum ToolSteps { + /// A run of calls one after another, with the line of text that introduced it. + struct Run { + var narration: String? + var calls: [ToolCallPart] + } + + /// What a step did, and to what. + struct Step { + let action: String + var subject: (text: String, asCode: Bool)? + } + + /// What a step's details show: what it was given, and what it gave back. + struct Details { + var input: JSONValue? + var otherArguments: JSONValue? + var output: JSONValue? + var outputCut: String? + } + + static func runs(of parts: [MessagePart]) -> [Run] { + var runs: [Run] = [] + for (index, part) in parts.enumerated() { + guard case let .toolCall(call) = part else { continue } + let before = index > 0 ? parts[index - 1] : nil + if case .toolCall = before, !runs.isEmpty { + runs[runs.count - 1].calls.append(call) + continue + } + var narration: String? + if case let .text(part) = before { + let line = Previews.message(part.text).replacingOccurrences(of: #":\s*$"#, with: "", options: .regularExpression) + narration = line.isEmpty ? nil : line + } + runs.append(Run(narration: narration, calls: [call])) + } + return runs + } + + // MARK: The line over a message's steps + + /// `Used Linear and Web for 4s`, `Used Linear, waiting on GitHub approval`. + static func lineText(_ calls: [ToolCallPart], looks: [String: ConnectionLook]) -> String { + func apps(_ matching: (ToolCallPart) -> Bool) -> String { + var seen: [String] = [] + for call in calls where matching(call) { + let app = appOf(call, look: looks[ToolNames.handle(call.tool)]) + if !seen.contains(app) { seen.append(app) } + } + return listed(seen) + } + let denied: (ToolCallPart) -> Bool = { call in call.approval?.status == .denied } + let running = { (call: ToolCallPart) in + call.status == .running || (call.status == .awaitingApproval && call.approval?.status == .allowed) + } + let finished: (ToolCallPart) -> Bool = { call in (call.status == .completed || call.status == .failed) && !denied(call) } + let used = apps(finished) + let tail: String? = + calls.contains(where: \.awaitsApproval) ? "waiting on \(apps(\.awaitsApproval)) approval" + : calls.contains(where: running) ? "using \(apps(running))" + : calls.contains(where: denied) ? "\(apps(denied)) denied" + : nil + guard let tail else { + let total = calls.filter(finished).reduce(0) { $0 + duration(of: $1) } + return "Used \(used) for \(formatTotal(total))" + } + return used.isEmpty ? tail.prefix(1).uppercased() + tail.dropFirst() : "Used \(used), \(tail)" + } + + /// The app a step was taken in: a connection by its name, the browser, artifacts, or the built-in tool. + static func appOf(_ call: ToolCallPart, look: ConnectionLook?) -> String { + let handle = ToolNames.handle(call.tool) + if call.tool.hasPrefix(ToolNames.browserPrefix) { return "Browser" } + if call.tool.hasPrefix(ToolNames.artifactPrefix) { return "Artifacts" } + return handle.isEmpty ? ToolNames.words(fromKey: call.tool) : ToolNames.connectionLabel(handle, name: look?.name) + } + + private static func listed(_ names: [String]) -> String { + guard names.count > 1, let last = names.last else { return names.first ?? "" } + return names.dropLast().joined(separator: ", ") + " and " + last + } + + /// How long a call took, in whole milliseconds as its times are written; nothing until it finished. + static func duration(of call: ToolCallPart) -> Double { + guard let finishedAt = call.finishedAt else { return 0 } + return max((finishedAt.timeIntervalSince(call.startedAt) * 1000).rounded(), 0) + } + + /// `850ms`, `1.4s`. + static func formatDuration(_ ms: Double) -> String { + ms < 1000 ? "\(Int(ms.rounded()))ms" : String(format: "%.1fs", ms / 1000) + } + + /// `850ms`, `4s`. + static func formatTotal(_ ms: Double) -> String { + ms < 1000 ? "\(Int(ms.rounded()))ms" : "\(Int((ms / 1000).rounded()))s" + } + + // MARK: One step + + static func describe(_ call: ToolCallPart, fileNames: [String: String]) -> Step { + let input = call.input.fields + let output = call.output?.fields ?? [:] + func fileName(_ value: JSONValue?) -> String? { value?.string.flatMap { fileNames[$0] } } + switch call.tool { + case "run_command": return step("Ran", code(input["command"]?.string?.firstLine), "Ran a command") + case "read_file": return step("Read", code(input["path"]?.string), "Read a file") + case "write_file": return step("Wrote", code(input["path"]?.string), "Wrote a file") + case "copy_file_to_sandbox": return step("Copied", name(fileName(input["file"])), "Copied a file to the sandbox") + case "share_file": + return step("Shared", name(output["shared"]?.string ?? input["name"]?.string ?? input["path"]?.string?.split(separator: "/").last.map(String.init)), "Shared a file") + case "read_thread_file": return step("Read", name(fileName(input["file"])), "Read a long result") + case "web_search": return step("Searched the web for", name(input["query"]?.string), "Searched the web") + case "web_fetch": + return step("Read", name(output["page"]?.fields["title"]?.string) ?? code(withoutScheme(input["url"]?.string)), "Read a page") + case "tool_search": return step("Looked for tools to", name(input["query"]?.string), "Looked for tools") + case "search_history": return step("Searched the thread for", name(input["query"]?.string), "Read back through the thread") + case "read_docs": return step("Read the docs on", name(input["page"]?.string), "Read the docs") + case "artifact_list": return Step(action: "Listed artifacts") + case "artifact_read": return step("Read", name(output["title"]?.string), "Read an artifact") + case "artifact_write": + let title = name(output["title"]?.string ?? input["title"]?.string) + return input["artifactId"] == nil ? step("Created", title, "Created an artifact") : step("Rewrote", title, "Rewrote an artifact") + case "artifact_edit": return step("Edited", name(output["title"]?.string), "Edited an artifact") + case "list_routines": return Step(action: "Listed its routines") + case "create_routine": return step("Set up the routine", name(input["name"]?.string), "Set up a routine") + case "update_routine": return step("Changed the routine", name(input["name"]?.string), "Changed a routine") + case "save_instructions": return Step(action: "Saved its instructions") + case "request_network_access": return step("Asked to reach", code(input["host"]?.string), "Asked to reach a host") + case "workspace_access": return step("Checked the access of", name(input["person"]?.string), "Checked a person's access") + default: break + } + let action = ToolNames.step(call.tool) + if call.tool.hasPrefix(ToolNames.browserPrefix) { + return Step(action: action, subject: code(withoutScheme(input["url"]?.string))) + } + let subject = ["query", "title", "name", "url", "path"].compactMap { input[$0]?.string }.first { !$0.trimmingCharacters(in: .whitespacesAndNewlines).isEmpty } + return Step(action: action, subject: name(subject)) + } + + /// What a step's row says at its end: how it ended, or how many results it found. + static func note(of call: ToolCallPart) -> (text: String, failed: Bool)? { + if call.approval?.status == .denied { + return (call.approval?.decidedByName.map { "Denied by \($0)" } ?? "Denied", true) + } + if call.status == .failed { return (call.error ?? "Failed", true) } + if call.awaitsApproval { return ("Waiting for approval", false) } + if call.status == .awaitingApproval { + return (call.approval?.decidedByName.map { "Allowed by \($0)" } ?? "Allowed", false) + } + if call.status == .running { return ("Running", false) } + if let refusal = refusal(in: call.output) { return (refusal, true) } + guard let count = resultCount(in: outputValue(call.output)) else { return nil } + return ("\(count) \(count == 1 ? "result" : "results")", false) + } + + private static func refusal(in output: JSONValue?) -> String? { + guard case let .object(answer)? = output else { return nil } + let why = [answer["reason"], answer["error"], answer["message"]].compactMap { $0?.string }.first + if let refused = answer["refused"]?.string { return refused } + if answer["ok"] == .bool(false) || answer["status"] == .string("refused") || answer["status"] == .string("failed") { + return why ?? "Failed" + } + if answer["isError"] == .bool(true) { return outputValue(output)?.string ?? "Failed" } + if case let .number(code)? = answer["exitCode"], code != 0 { return "Exit \(Int(code))" } + if answer["timedOut"] == .bool(true) { return "Timed out" } + return nil + } + + private static func resultCount(in output: JSONValue?) -> Int? { + switch output { + case let .array(items)?: return items.count + case let .object(fields)?: + for (key, value) in fields.sorted(by: { $0.key < $1.key }) where key != "images" { + if case let .array(items) = value { return items.count } + } + return nil + default: return nil + } + } + + /// What an MCP tool answered, unwrapped from its content parts. + static func outputValue(_ output: JSONValue?) -> JSONValue? { + guard case let .object(answer)? = output else { return output } + if let structured = answer["structuredContent"] { return structured } + guard case let .array(parts)? = answer["content"] else { return output } + let texts = parts.compactMap { part -> String? in + guard case let .object(fields) = part, fields["type"] == .string("text") else { return nil } + return fields["text"]?.string + } + guard texts.count == parts.count else { return output } + let text = texts.joined(separator: "\n") + if text.range(of: #"^\s*[\[{]"#, options: .regularExpression) != nil, + let data = text.data(using: .utf8), + let parsed = try? JSONDecoder().decode(JSONValue.self, from: data) + { + return parsed + } + return .string(text) + } + + static func details(of call: ToolCallPart) -> Details { + let (stored, cut) = storedOutput(call.output) + let output = stored?.fields ?? [:] + func inputWithText(_ key: String) -> Details { + var rest = call.input.fields + let text = rest.removeValue(forKey: key) + return Details(input: text?.string.map { .string($0) }, otherArguments: shown(.object(rest))) + } + var details: Details + switch call.tool { + case "run_command": + details = inputWithText("command") + if stored != nil && stored != .null { + let printed = [output["stdout"], output["stderr"]].compactMap { $0?.string }.filter { !$0.trimmingCharacters(in: .whitespacesAndNewlines).isEmpty } + details.output = .string(printed.isEmpty ? "No output" : printed.map { $0.replacingOccurrences(of: #"\s+$"#, with: "", options: .regularExpression) }.joined(separator: "\n")) + } + case "read_file": + details = inputWithText("path") + details.output = output["content"]?.string.map { .string($0) } ?? shown(stored) + case "write_file": + details = inputWithText("content") + details.output = shown(stored) + case "read_thread_file": + details = Details(input: shown(call.input), output: output["lines"]?.string.map { .string($0) } ?? shown(stored)) + default: + details = Details(input: shown(call.input), output: shown(outputValue(stored))) + } + details.outputCut = cut + return details + } + + private static func storedOutput(_ output: JSONValue?) -> (JSONValue?, String?) { + guard case let .object(stored)? = output, stored["truncated"] == .bool(true), let preview = stored["preview"]?.string else { + return (output, nil) + } + var characters = "" + if case let .number(count)? = stored["characters"] { characters = " of \(Int(count).formatted())" } + return (.string(preview), "Only the first \(preview.count.formatted())\(characters) characters were kept.") + } + + private static func shown(_ value: JSONValue?) -> JSONValue? { + switch value { + case nil, .null?: return nil + case let .object(fields)? where fields.isEmpty: return nil + case let .array(items)? where items.isEmpty: return nil + default: return value + } + } + + private static func step(_ action: String, _ subject: (text: String, asCode: Bool)?, _ otherwise: String) -> Step { + subject.map { Step(action: action, subject: $0) } ?? Step(action: otherwise) + } + + private static func code(_ value: String?) -> (text: String, asCode: Bool)? { + guard let value, !value.trimmingCharacters(in: .whitespacesAndNewlines).isEmpty else { return nil } + return (value, true) + } + + private static func name(_ value: String?) -> (text: String, asCode: Bool)? { + guard let value, !value.trimmingCharacters(in: .whitespacesAndNewlines).isEmpty else { return nil } + return (value, false) + } + + private static func withoutScheme(_ value: String?) -> String? { + value?.replacingOccurrences(of: #"^https?://"#, with: "", options: .regularExpression) + } +} + +extension JSONValue { + var string: String? { + if case let .string(value) = self { value } else { nil } + } + + /// An object's fields, or none for anything else. + var fields: [String: JSONValue] { + if case let .object(fields) = self { fields } else { [:] } + } +} + +private extension String { + var firstLine: String { + trimmingCharacters(in: .whitespacesAndNewlines).components(separatedBy: "\n").first ?? self + } +} + +extension ToolCallPart { + /// Whether the call is stopped until a person allows or denies it, as the web's `awaitsApproval`. + /// An allowed call keeps `awaitingApproval` until its turn starts it, a moment later, but waits on nobody. + var awaitsApproval: Bool { status == .awaitingApproval && approval?.status == .pending } +} diff --git a/apps/ios/Sugabots/Design/Avatars.swift b/apps/ios/Sugabots/Design/Avatars.swift new file mode 100644 index 000000000..d573cdfcd --- /dev/null +++ b/apps/ios/Sugabots/Design/Avatars.swift @@ -0,0 +1,24 @@ +import CryptoKit +import Foundation + +/// A person's initials for their avatar, as the web's `initials`: the first and +/// last names' first letters, or a single name's first two. +enum Initials { + static func of(_ name: String) -> String { + let parts = name.split(whereSeparator: \.isWhitespace) + guard let first = parts.first else { return "?" } + let last = parts.count > 1 ? parts.last : nil + return (last.map { String(first.prefix(1)) + String($0.prefix(1)) } ?? String(first.prefix(2))).uppercased() + } +} + +/// Gravatar's address for an email, as `gravatarUrl` in the web app's `ui/avatar.tsx` builds it. +enum Gravatar { + /// The picture for `email`, `pixels` wide and high. It answers 404 when the + /// address has no Gravatar, rather than a generated placeholder. + static func url(for email: String, pixels: Int) -> URL { + let normalized = email.trimmingCharacters(in: .whitespacesAndNewlines).lowercased() + let hash = SHA256.hash(data: Data(normalized.utf8)).map { String(format: "%02x", $0) }.joined() + return URL(string: "https://gravatar.com/avatar/\(hash)?s=\(pixels)&d=404")! + } +} diff --git a/apps/ios/Sugabots/Home/Mutes.swift b/apps/ios/Sugabots/Home/Mutes.swift new file mode 100644 index 000000000..8ef6ff537 --- /dev/null +++ b/apps/ios/Sugabots/Home/Mutes.swift @@ -0,0 +1,35 @@ +import Foundation + +/// How long a pause or a mute lasts, as Slack offers them; `all`, generated +/// from the web's `notification-choices.ts`, lists them. +struct MuteDuration { + enum Length { + case minutes(Int) + /// Until this hour tomorrow, on this device's clock. + case tomorrow(atHour: Int) + } + + let label: String + let length: Length + + /// When it ends, if started `now`. + func until(_ now: Date) -> Date { + switch length { + case let .minutes(minutes): + return now.addingTimeInterval(TimeInterval(minutes * 60)) + case let .tomorrow(hour): + let tomorrow = Calendar.current.date(byAdding: .day, value: 1, to: now) ?? now + return Calendar.current.date(bySettingHour: hour, minute: 0, second: 0, of: tomorrow) ?? tomorrow + } + } + + /// When a pause or mute ends, as `formatUntil`: a time today, or a weekday and time after. + static func formatUntil(_ until: Date, now: Date = .now, locale: Locale = .current, calendar: Calendar = .current) -> String { + let style = Date.FormatStyle(locale: locale, calendar: calendar, timeZone: calendar.timeZone) + let written = calendar.isDate(until, inSameDayAs: now) + ? until.formatted(style.hour().minute()) + : until.formatted(style.weekday(.abbreviated).hour().minute()) + // Apple's dates put a narrow space before AM or PM, where the web's have a plain one. + return written.replacingOccurrences(of: "\u{202F}", with: " ") + } +} diff --git a/apps/ios/Sugabots/Routines/ScheduleWords.swift b/apps/ios/Sugabots/Routines/ScheduleWords.swift new file mode 100644 index 000000000..3275d4187 --- /dev/null +++ b/apps/ios/Sugabots/Routines/ScheduleWords.swift @@ -0,0 +1,288 @@ +import Foundation + +/// A routine's schedule as people pick and read it, as the web's +/// `lib/routine-schedule.ts`: every so many days, weeks or months, on some +/// days, at some times. A schedule written as cron is read into those parts +/// where it can be, and otherwise kept as written, by a name. A schedule of +/// a kind from a newer server than this app knows is kept as it is, by its kind. +enum ScheduleReading: Hashable { + case picked(CalendarSchedule) + case written(expression: String, label: String) + case unrecognized(kind: String) + + var schedule: CalendarSchedule? { + if case let .picked(schedule) = self { return schedule } + return nil + } +} + +enum ScheduleWords { + struct Day { + let value: Weekday + let letter: String + let short: String + let long: String + let cron: String + } + + static let days = [ + Day(value: .mon, letter: "M", short: "Mon", long: "Monday", cron: "1"), + Day(value: .tue, letter: "T", short: "Tue", long: "Tuesday", cron: "2"), + Day(value: .wed, letter: "W", short: "Wed", long: "Wednesday", cron: "3"), + Day(value: .thu, letter: "T", short: "Thu", long: "Thursday", cron: "4"), + Day(value: .fri, letter: "F", short: "Fri", long: "Friday", cron: "5"), + Day(value: .sat, letter: "S", short: "Sat", long: "Saturday", cron: "6"), + Day(value: .sun, letter: "S", short: "Sun", long: "Sunday", cron: "0"), + ] + + static let repeatOptions: [(value: CalendarSchedule.Repeat, label: String)] = [ + (.daily, "Daily"), (.weekly, "Weekly"), (.monthly, "Monthly"), + ] + + private static let weekdays: [Weekday] = [.mon, .tue, .wed, .thu, .fri] + private static let minutesPerDay = 24 * 60 + /// How far a time added after the last one goes: far enough to be a different part of the day. + private static let nextTimeGapMinutes = 4 * 60 + /// How far a new time steps aside from one already taken, and the times a day can be picked from. + static let timeStepMinutes = 30 + /// The most of each unit a schedule can skip between runs. + static func maxEvery(_ repeatKind: CalendarSchedule.Repeat) -> Int { + switch repeatKind { + case .daily: Limits.maxEveryDays + case .weekly: Limits.maxEveryWeeks + case .monthly: Limits.maxEveryMonths + } + } + + /// The day `now` falls on in this device's time zone, as `YYYY-MM-DD`. + static func today(now: Date = .now) -> String { + let parts = Calendar.current.dateComponents([.year, .month, .day], from: now) + return String(format: "%04d-%02d-%02d", parts.year ?? 2000, parts.month ?? 1, parts.day ?? 1) + } + + /// What a new routine runs on until somebody chooses: every day at 9:00, counted from the day of `now`. + static func defaultSchedule(now: Date = .now) -> CalendarSchedule { + CalendarSchedule(repeatKind: .daily, every: 1, times: [9 * 60], startsOn: today(now: now)) + } + + /// A stored schedule, read into its parts where they can say it; a cron expression read into parts counts from the day of `now`. + static func read(_ schedule: TriggerSchedule, now: Date = .now) -> ScheduleReading { + switch schedule { + case let .calendar(picked): .picked(picked) + case let .cron(expression): readCron(expression.trimmingCharacters(in: .whitespaces), now: now) + case let .unknown(kind): .unrecognized(kind: kind) + } + } + + static func scheduleOf(_ reading: ScheduleReading) -> TriggerSchedule { + switch reading { + case let .picked(schedule): .calendar(schedule) + case let .written(expression, _): .cron(expression) + case let .unrecognized(kind): .unknown(kind: kind) + } + } + + /// Whether a picked schedule can run: a weekly one needs a day. + static func ready(_ reading: ScheduleReading) -> Bool { + guard let schedule = reading.schedule else { return true } + return schedule.repeatKind != .weekly || !schedule.days.isEmpty + } + + /// The schedule with `repeatKind` picked in its place: every back to 1, counted from the day of `now`; days and times stay. + static func withRepeat(_ reading: ScheduleReading, _ repeatKind: CalendarSchedule.Repeat, now: Date = .now) -> CalendarSchedule { + var schedule = CalendarSchedule( + repeatKind: repeatKind, + every: 1, + times: reading.schedule?.times ?? defaultSchedule(now: now).times, + startsOn: today(now: now) + ) + switch repeatKind { + case .daily: break + case .weekly: + schedule.days = reading.schedule?.repeatKind == .weekly ? reading.schedule?.days ?? [.mon] : [.mon] + case .monthly: + schedule.dayOfMonth = .day(min(Calendar.current.component(.day, from: now), 28)) + } + return schedule + } + + /// The time a new one starts at: some hours after the last, stepped past any taken. + static func nextTime(_ times: [Int]) -> Int { + var time = step(times.last ?? 9 * 60, by: nextTimeGapMinutes) + while times.contains(time) { time = step(time, by: timeStepMinutes) } + return time + } + + /// Moves a time of day by `minutes`, round the clock either way. + static func step(_ minutesPastMidnight: Int, by minutes: Int) -> Int { + (((minutesPastMidnight + minutes) % minutesPerDay) + minutesPerDay) % minutesPerDay + } + + /// "9:00", "18:30". + static func formatTime(_ minutesPastMidnight: Int) -> String { + String(format: "%d:%02d", minutesPastMidnight / 60, minutesPastMidnight % 60) + } + + /// "1st", "22nd", or "last day". + static func formatDayOfMonth(_ day: MonthDay) -> String { + guard case let .day(number) = day else { return "last day" } + let tens = number % 100 + let suffix = (11...13).contains(tens) ? "th" : [1: "st", 2: "nd", 3: "rd"][number % 10] ?? "th" + return "\(number)\(suffix)" + } + + /// "1 day", "3 weeks". + static func formatEvery(_ schedule: CalendarSchedule) -> String { + let unit = ["daily": "day", "weekly": "week", "monthly": "month"][schedule.repeatKind.rawValue] ?? "day" + return "\(schedule.every) \(unit)\(schedule.every == 1 ? "" : "s")" + } + + /// "every day at 9:00", "every 2 weeks on Mon and Thu at 9:00 and 17:30". + static func summary(_ schedule: CalendarSchedule) -> String { + let at = "at \(listOf(schedule.times.sorted().map(formatTime)))" + switch schedule.repeatKind { + case .daily: + return "\(every(schedule.every, "day")) \(at)" + case .weekly: + if schedule.every == 1, isWeekdays(schedule.days) { return "every weekday \(at)" } + return "\(every(schedule.every, "week")) on \(listOf(ordered(schedule.days).map(\.short))) \(at)" + case .monthly: + return "\(every(schedule.every, "month")) on the \(formatDayOfMonth(schedule.dayOfMonth)) \(at)" + } + } + + /// How a routine starts, short enough for a list's line: "Daily at 22:00", "Webhook +2". + static func scheduleLabel(_ routine: Routine) -> String? { + guard let first = routine.triggers.first else { return nil } + let label = triggerLabel(first.input) + return routine.triggers.count > 1 ? "\(label) +\(routine.triggers.count - 1)" : label + } + + /// One trigger, short enough for a row: "Daily at 22:00", "Webhook", "On acme/web". + static func triggerLabel(_ trigger: TriggerInput) -> String { + switch trigger { + case .webhook: "Webhook" + case let .github(_, repository, _): "On \(repository)" + case let .cron(schedule, _): readingLabel(read(schedule)) + } + } + + /// "Daily at 22:00", "Mon Wed Fri, 3 times". + static func readingLabel(_ reading: ScheduleReading) -> String { + switch reading { + case let .written(_, label): + return label + case .unrecognized: + return customScheduleLabel + case let .picked(schedule): + return schedule.times.count == 1 + ? "\(repeatLabel(schedule)) at \(formatTime(schedule.times[0]))" + : "\(repeatLabel(schedule)), \(schedule.times.count) times" + } + } + + /// When the routine runs next on a schedule: "Today at 14:00", "Tomorrow at 7:00", "Mon at 9:00", "3 Nov at 10:00". + static func nextRunAt(_ routine: Routine, now: Date = .now) -> String? { + guard let next = routine.triggers.compactMap({ $0.kind == "cron" ? $0.nextScheduledAt : nil }).min() else { return nil } + let calendar = Calendar.current + let days = calendar.dateComponents([.day], from: calendar.startOfDay(for: now), to: calendar.startOfDay(for: next)).day ?? 0 + let day = + days <= 0 ? "Today" + : days == 1 ? "Tomorrow" + : days < 7 ? next.formatted(.dateTime.weekday(.abbreviated)) + : next.formatted(.dateTime.day().month(.abbreviated)) + return "\(day) at \(Times.clock(next))" + } + + /// When the routine runs next, in words: its soonest time on a schedule, or what starts it, if anything does. + static func nextRunWords(_ routine: Routine) -> String? { + if let next = nextRunAt(routine) { + let lowered = next.hasPrefix("Today") || next.hasPrefix("Tomorrow") ? next.prefix(1).lowercased() + next.dropFirst() : next + return "Next run \(lowered)" + } + if !routine.triggers.isEmpty, routine.triggers.allSatisfy({ $0.kind == "webhook" }) { + return "Runs when its address is called" + } + return scheduleLabel(routine) + } + + /// The note under a schedule: when it runs, and in which time zone. + static func note(_ reading: ScheduleReading, timezone: String) -> String { + let when = reading.schedule.map(summary) ?? "on its own schedule" + return "Runs \(when), \(zoneName(timezone))." + } + + /// "your time (AEDT)" for this device's zone, else "Los Angeles time (PDT)", or "UTC". + static func zoneName(_ timezone: String) -> String { + let zone = TimeZone(identifier: timezone) + let abbreviation = zone?.abbreviation() + if timezone == TimeZone.current.identifier { + return abbreviation.map { "your time (\($0))" } ?? "your time" + } + let city = (timezone.split(separator: "/").last.map(String.init) ?? timezone).replacingOccurrences(of: "_", with: " ") + guard let abbreviation, abbreviation != city else { return city } + return "\(city) time (\(abbreviation))" + } + + private static func repeatLabel(_ schedule: CalendarSchedule) -> String { + if schedule.every > 1 { return "Every \(formatEvery(schedule))" } + switch schedule.repeatKind { + case .daily: return "Daily" + case .weekly: return isWeekdays(schedule.days) ? "Weekdays" : ordered(schedule.days).map(\.short).joined(separator: " ") + case .monthly: return "Monthly" + } + } + + private static func every(_ count: Int, _ unit: String) -> String { + count == 1 ? "every \(unit)" : "every \(count) \(unit)s" + } + + private static func listOf(_ items: [String]) -> String { + guard items.count > 1 else { return items.joined() } + return "\(items.dropLast().joined(separator: ", ")) and \(items[items.count - 1])" + } + + private static func ordered(_ chosen: [Weekday]) -> [Day] { + days.filter { chosen.contains($0.value) } + } + + private static func isWeekdays(_ chosen: [Weekday]) -> Bool { + chosen.count == weekdays.count && weekdays.allSatisfy(chosen.contains) + } + + /// What a schedule that can't be read into its parts is called. + private static let customScheduleLabel = "Custom schedule" + + /// A cron expression in parts, where it says times each day or on some days + /// of the week; anything else is kept as written, by a name. + private static func readCron(_ expression: String, now: Date) -> ScheduleReading { + let fields = expression.split(whereSeparator: \.isWhitespace).map(String.init) + let written = { (label: String) in ScheduleReading.written(expression: expression, label: label) } + guard fields.count == 5, fields[2] == "*", fields[3] == "*" else { return written(customScheduleLabel) } + let (minute, hour, dayOfWeek) = (fields[0], fields[1], fields[4]) + let digits = { (text: Substring) in !text.isEmpty && text.allSatisfy(\.isASCII) && text.allSatisfy(\.isNumber) } + if digits(Substring(minute)), hour.hasSuffix("-23"), digits(hour.dropLast(3)), dayOfWeek == "*" { + let from = (Int(hour.dropLast(3)) ?? 0) * 60 + (Int(minute) ?? 0) + return written("Every hour from \(formatTime(from))") + } + let hours = hour.split(separator: ",", omittingEmptySubsequences: false) + guard digits(Substring(minute)), hours.allSatisfy(digits), let minutes = Int(minute) else { return written(customScheduleLabel) } + let times = hours.map { (Int($0) ?? minutesPerDay) * 60 + minutes } + // Only times a picked schedule can hold: each once, and no more than it allows. + guard times.allSatisfy({ $0 < minutesPerDay }), Set(times).count == times.count, times.count <= Limits.maxRoutineScheduleTimes else { + return written(customScheduleLabel) + } + var schedule = CalendarSchedule(repeatKind: .daily, every: 1, times: times, startsOn: today(now: now)) + if dayOfWeek == "*" { return .picked(schedule) } + let chosen: [Weekday]? = + dayOfWeek == "1-5" + ? weekdays + : dayOfWeek.split(separator: ",").map { day in + days.first { $0.cron == (day == "7" ? "0" : String(day)) }?.value + }.reduce([Weekday]?.some([])) { list, day in day.flatMap { day in list.map { $0 + [day] } } } + guard let chosen else { return written(customScheduleLabel) } + schedule.repeatKind = .weekly + schedule.days = chosen + return .picked(schedule) + } +} diff --git a/apps/ios/Sugabots/Settings/TimeZoneChoices.swift b/apps/ios/Sugabots/Settings/TimeZoneChoices.swift new file mode 100644 index 000000000..fc4ee6f3c --- /dev/null +++ b/apps/ios/Sugabots/Settings/TimeZoneChoices.swift @@ -0,0 +1,49 @@ +import Foundation + +/// A time zone as the picker lists it: its place, its identifier, and its offset now. +struct TimeZoneChoice: Hashable { + let zone: String + let place: String + let offset: String + + /// Every zone the device knows, with UTC among them, as `timeZoneChoices`. + static func all(at now: Date) -> [TimeZoneChoice] { + let zones = TimeZone.knownTimeZoneIdentifiers + let named = zones.contains("UTC") ? zones : ["UTC"] + zones + return named.map { zone in + TimeZoneChoice(zone: zone, place: place(of: zone), offset: offset(of: zone, at: now)) + } + } + + /// As `timeZonePlace`: `America/New_York` is `New York`. + static func place(of zone: String) -> String { + (zone.split(separator: "/").last.map(String.init) ?? zone).replacingOccurrences(of: "_", with: " ") + } + + /// `UTC+10`, `UTC-3:30`, or `UTC`, as the web's short offset reads. + static func offset(of zone: String, at now: Date) -> String { + guard let seconds = TimeZone(identifier: zone)?.secondsFromGMT(for: now) else { return "" } + if seconds == 0 { return "UTC" } + let minutes = abs(seconds) / 60 + let sign = seconds < 0 ? "-" : "+" + return minutes % 60 == 0 ? "UTC\(sign)\(minutes / 60)" : String(format: "UTC%@%d:%02d", sign, minutes / 60, minutes % 60) + } + + func matches(_ needle: String) -> Bool { + needle.isEmpty || zone.lowercased().replacingOccurrences(of: "_", with: " ").contains(needle) || offset.lowercased().contains(needle) + } +} + +/// The zones under one part of the world, as `timeZoneRegions` groups them. +struct TimeZoneRegion: Hashable { + let name: String + let choices: [TimeZoneChoice] + + static func of(_ choices: [TimeZoneChoice]) -> [TimeZoneRegion] { + let byPlace = choices.sorted { $0.place.localizedCompare($1.place) == .orderedAscending } + let regions = named.map { prefix, name in TimeZoneRegion(name: name, choices: byPlace.filter { $0.zone.hasPrefix("\(prefix)/") }) } + let inRegion = Set(regions.flatMap(\.choices)) + let others = TimeZoneRegion(name: otherName, choices: byPlace.filter { !inRegion.contains($0) }) + return (regions + [others]).filter { !$0.choices.isEmpty } + } +}