{
  "schemaVersion": 1,
  "manifest": {
    "schemaVersion": 1,
    "product": {
      "id": "textmock",
      "name": "Textmock",
      "url": "https://textmock.com",
      "description": "Make iMessage-style conversations and save them as images or videos.",
      "agentGuideUrl": "https://textmock.com/docs/agents"
    },
    "runtime": {
      "command": "textmock-link",
      "version": "1.0.0",
      "versionScope": "helper",
      "install": {
        "type": "web",
        "url": "https://textmock.com"
      },
      "helper": {
        "path": "scripts/textmock-link.mjs",
        "node": ">=24.0.0"
      }
    },
    "license": "MIT"
  },
  "files": {
    "skills/textmock/SKILL.md": "---\nname: textmock\ndescription: Make fictional text conversations that open as editable Textmock links, or edit and render an existing Textmock conversation through its browser API or Mac command.\n---\n\nUse [Textmock](https://textmock.com) to make an iMessage-style conversation. For a new text-only mockup, use the bundled link helper. It runs locally with Node.js 24 or later and prints a link; it does not open a browser or change a saved conversation.\n\nFrom this skill's directory, run the helper below. If your shell is elsewhere, use the helper's absolute path:\n\n```sh\nnode scripts/textmock-link.mjs - <<'JSON'\n{\"name\":\"Mira\",\"messages\":[{\"from\":\"them\",\"text\":\"Did you bring the telescope?\"},{\"from\":\"me\",\"text\":\"Yes. You bring the clear sky.\"}]}\nJSON\n```\n\nGive the link to the user. It opens a preview; **Make a Copy** adds an editable conversation, subject to the app's conversation limit. The helper puts the text in the fragment after `#`, which browsers omit from navigation requests. Anyone who receives the full link can read it. Use fictional content unless the user asks to share their own material.\n\nThe helper accepts `name`, `messages`, optional `dark` and optional `clock`. Each message has `from` (`me` or `them`) and `text`. It refuses unknown fields, photos, imports and private notes. It supports one-to-one conversations, with 1–120 messages, up to 4,000 characters per message and a 180 KB document limit. Replies are off in the new copy.\n\nFor an existing conversation, images, video, groups or attachments, read [Use Textmock from an agent](https://textmock.com/docs/agents). In the editor, wait for `window.textmock` or `textmock:ready`. On Mac, use the app's `textmock` command. Inspect `status`, `list` and `get` before changing a saved conversation; follow the user's chosen conversation ID. A file passed to `textmock render --out` is replaced if it exists, so use a new path or a directory when preserving files matters.\n\nFree use allows one conversation and exports with a badge. Respect `pro_required`; only the user can subscribe. Do not import Messages, delete conversations or share private content unless the user requests that action. Use the installed API's `help` for its current fields and limits.\n",
    "LICENSE": "MIT License\n\nCopyright (c) 2026 Hraness\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n",
    "README.md": "# Textmock conversation links\n\nMake a fictional text conversation that opens as an editable copy in [Textmock](https://textmock.com). This package includes a coding-agent skill and a small local link helper. The helper needs Node.js 24 or later and has no dependencies.\n\n## Make your first link\n\nSave this as `conversation.json`:\n\n```json\n{\n  \"name\": \"Mira\",\n  \"messages\": [\n    { \"from\": \"them\", \"text\": \"Did you bring the telescope?\" },\n    { \"from\": \"me\", \"text\": \"Yes. You bring the clear sky.\" }\n  ]\n}\n```\n\nFrom this package's folder, run:\n\n```sh\nnode scripts/textmock-link.mjs conversation.json\n```\n\nOpen the printed link and choose **Make a Copy**. Edit the conversation, then choose **Save Image** or **Make Video**. Creating the link and viewing its preview change no saved conversation. Making a copy follows Textmock's usual conversation limit: free use keeps one conversation and adds a badge to exports; Pro allows more conversations and removes the badge. An untouched starter can be replaced by the new copy. An existing edited conversation is preserved if there is no room.\n\nThe helper accepts `name`, `messages`, optional `dark` and optional `clock`. Each message has `from` (`me` or `them`) and `text`. It creates one-to-one conversations with replies off, up to 120 messages and 4,000 characters per message, within a 180 KB JSON document limit. Unknown fields are refused. Use the app's agent interface for groups, photos, attachments and rendering.\n\nThe helper encodes conversation content in the fragment after `#`, which browsers omit from navigation requests. Anyone with the complete link can read it. Keep full links out of logs when they contain private material.\n\nRead [Use Textmock from an agent](https://textmock.com/docs/agents) for the browser API and Mac command, or the [conversation format](https://textmock.com/docs/conversation-format) for the app's full document shape. The MIT license covers this skill and helper; the Textmock application has its own terms.\n",
    "scripts/textmock-link.mjs": "// SPDX-License-Identifier: MIT\nimport { createReadStream } from \"node:fs\";\nimport { stat } from \"node:fs/promises\";\nimport { resolve } from \"node:path\";\nimport { pathToFileURL } from \"node:url\";\nimport { deflateRawSync } from \"node:zlib\";\n\nexport const LIMITS = Object.freeze({ inputBytes: 4_000_000, documentBytes: 180_000, fragment: 2_000_000, messages: 120, text: 4000, name: 60, clock: 12 });\nconst fail = (message) => { throw new Error(message); };\nconst object = (value) => value !== null && typeof value === \"object\" && !Array.isArray(value);\nconst fields = (value, allowed) => {\n  if (!object(value) || Object.keys(value).some((key) => !allowed.includes(key))) fail(\"Unsupported conversation field.\");\n};\nconst text = (value, maximum, label) => {\n  if (typeof value !== \"string\" || !value.trim() || value.length > maximum || !value.isWellFormed() || /[\\u0000-\\u0008\\u000b\\u000c\\u000e-\\u001f\\u007f]/.test(value)) fail(`Invalid ${label}.`);\n  return value;\n};\n\n/** Refuse duplicate object keys instead of silently accepting a later value. */\nexport function parseInput(raw) {\n  if (typeof raw !== \"string\" || Buffer.byteLength(raw) > LIMITS.inputBytes) fail(\"Input exceeds the size limit.\");\n  let at = 0;\n  const space = () => { while (/[\\x20\\t\\r\\n]/.test(raw[at] ?? \"\") && at < raw.length) at++; };\n  const string = () => {\n    const start = at++;\n    for (; at < raw.length; at++) {\n      if (raw[at] === \"\\\\\") at++;\n      else if (raw[at] === '\"') { at++; return JSON.parse(raw.slice(start, at)); }\n    }\n    fail(\"Invalid JSON.\");\n  };\n  const value = (depth = 0) => {\n    if (depth > 8) fail(\"JSON is nested too deeply.\");\n    space();\n    if (raw[at] === '\"') { string(); return; }\n    if (raw[at] === \"{\" || raw[at] === \"[\") {\n      const isObject = raw[at++] === \"{\";\n      const end = isObject ? \"}\" : \"]\";\n      const seen = new Set();\n      space();\n      if (raw[at] === end) { at++; return; }\n      for (;;) {\n        if (isObject) {\n          space();\n          if (raw[at] !== '\"') fail(\"Invalid JSON.\");\n          const key = string();\n          if (seen.has(key)) fail(\"Duplicate JSON field.\");\n          seen.add(key); space();\n          if (raw[at++] !== \":\") fail(\"Invalid JSON.\");\n        }\n        value(depth + 1); space();\n        const next = raw[at++];\n        if (next === end) return;\n        if (next !== \",\") fail(\"Invalid JSON.\");\n      }\n    }\n    const token = /^(?:true|false|null|-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?)/.exec(raw.slice(at));\n    if (!token) fail(\"Invalid JSON.\");\n    at += token[0].length;\n  };\n  value(); space();\n  if (at !== raw.length) fail(\"Invalid JSON.\");\n  return JSON.parse(raw);\n}\n\n/** A deliberately small text-only input, written in the editor's compatible share format. */\nexport function conversation(input) {\n  fields(input, [\"name\", \"messages\", \"dark\", \"clock\"]);\n  const name = text(input.name, LIMITS.name, \"name\");\n  const clock = input.clock === undefined ? \"9:41\" : text(input.clock, LIMITS.clock, \"clock\");\n  if (input.dark !== undefined && typeof input.dark !== \"boolean\") fail(\"Invalid dark setting.\");\n  if (!Array.isArray(input.messages) || input.messages.length < 1 || input.messages.length > LIMITS.messages) fail(\"Use 1 through 120 messages.\");\n  const messages = input.messages.map((message, index) => {\n    fields(message, [\"from\", \"text\"]);\n    if (message.from !== \"me\" && message.from !== \"them\") fail('A message sender must be \"me\" or \"them\".');\n    return { id: `m${index + 1}`, from: message.from, text: text(message.text, LIMITS.text, \"message text\") };\n  });\n  return { v: 6, dark: input.dark ?? false, name, clock, messages, replies: false };\n}\n\nexport function encodeLink(input) {\n  const bytes = Buffer.from(JSON.stringify(conversation(input)));\n  // Leave room for the editor's phone scene around this text-only document.\n  if (bytes.length > LIMITS.documentBytes) fail(\"Conversation exceeds the size limit.\");\n  const fragment = `1.${deflateRawSync(bytes).toString(\"base64url\")}`;\n  if (fragment.length > LIMITS.fragment) fail(\"Share link exceeds the size limit.\");\n  return `https://textmock.com/s#${fragment}`;\n}\n\nexport async function main(args = process.argv.slice(2)) {\n  if (args.length === 1 && args[0] === \"--help\") {\n    process.stdout.write(\"Usage: node textmock-link.mjs [conversation.json|-]\\nReads text-only conversation JSON and prints an editable Textmock link.\\n\");\n    return;\n  }\n  if (args.length > 1 || (args[0]?.startsWith(\"-\") && args[0] !== \"-\")) fail(\"Use a JSON file path or - for stdin.\");\n  if (Number(process.versions.node.split(\".\")[0]) < 24) fail(\"Node.js 24 or later is required.\");\n  const path = args[0];\n  if (path && path !== \"-\" && !(await stat(path)).isFile()) fail(\"Input must be a regular JSON file.\");\n  const input = path && path !== \"-\" ? createReadStream(path) : process.stdin;\n  const chunks = [];\n  let size = 0;\n  for await (const chunk of input) {\n    size += chunk.length;\n    if (size > LIMITS.inputBytes) fail(\"Input exceeds the size limit.\");\n    chunks.push(Buffer.from(chunk));\n  }\n  const raw = new TextDecoder(\"utf-8\", { fatal: true }).decode(Buffer.concat(chunks));\n  process.stdout.write(`${encodeLink(parseInput(raw))}\\n`);\n}\n\nif (process.argv[1] && import.meta.url === pathToFileURL(resolve(process.argv[1])).href) {\n  main().catch(() => { process.stderr.write(\"Textmock link could not be created. Use valid text-only conversation JSON; see --help and https://textmock.com/docs/agents.\\n\"); process.exitCode = 2; });\n}\n"
  }
}
