{"_id":"@botfather/units-slack-block-kit","_rev":"3-61940d0bc3df92b025d746488d78c25e","name":"@botfather/units-slack-block-kit","dist-tags":{"latest":"0.2.1"},"versions":{"0.1.0":{"name":"@botfather/units-slack-block-kit","version":"0.1.0","license":"MIT","_id":"@botfather/units-slack-block-kit@0.1.0","maintainers":[{"name":"botfather","email":"mohan.tushar.11@gmail.com"}],"homepage":"https://github.com/Botfather/units/tree/main/packages/units-slack-block-kit","bugs":{"url":"https://github.com/Botfather/units/issues"},"dist":{"shasum":"434655062a2acb929ddb09e688a0da275036bb10","tarball":"https://registry.npmjs.org/@botfather/units-slack-block-kit/-/units-slack-block-kit-0.1.0.tgz","fileCount":5,"integrity":"sha512-MGARN8PKGn7xV6/cMLZsWvul9lXRZ786LsEv8r5BU726aElZHXjkytt+DLQm1WdJKnzoMUQYzZsVFmsK5Hn+Uw==","signatures":[{"sig":"MEYCIQCj8LLAP27rBhnbmEzYVHolGc/RJaZtIS0E+8PVvXQDvQIhAM/A5abkQYq0i2WhZsgynliCX5XCA3OaDfSdfFVPQDuH","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@botfather%2funits-slack-block-kit@0.1.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":37800},"main":"./index.js","type":"module","_from":"file:botfather-units-slack-block-kit-0.1.0.tgz","types":"./index.d.ts","exports":{".":{"types":"./index.d.ts","default":"./index.js"}},"_npmUser":{"name":"botfather","email":"mohan.tushar.11@gmail.com"},"_resolved":"/tmp/75591b6bb87d2838d5b3f1b40c77a4dd/botfather-units-slack-block-kit-0.1.0.tgz","_integrity":"sha512-MGARN8PKGn7xV6/cMLZsWvul9lXRZ786LsEv8r5BU726aElZHXjkytt+DLQm1WdJKnzoMUQYzZsVFmsK5Hn+Uw==","repository":{"url":"git+https://github.com/Botfather/units.git","type":"git","directory":"packages/units-slack-block-kit"},"_npmVersion":"11.17.0","description":"Convert Units DSL or AST into Slack Block Kit payloads.","directories":{},"_nodeVersion":"22.14.0","dependencies":{"@botfather/units":"2.0.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/units-slack-block-kit_0.1.0_1782196782781_0.21267731777555188","host":"s3://npm-registry-packages-npm-production"}},"0.2.0":{"name":"@botfather/units-slack-block-kit","version":"0.2.0","license":"MIT","_id":"@botfather/units-slack-block-kit@0.2.0","maintainers":[{"name":"botfather","email":"mohan.tushar.11@gmail.com"}],"homepage":"https://github.com/Botfather/units/tree/main/packages/units-slack-block-kit","bugs":{"url":"https://github.com/Botfather/units/issues"},"dist":{"shasum":"668697ffda01112c67c3232771e7a0ac6c074431","tarball":"https://registry.npmjs.org/@botfather/units-slack-block-kit/-/units-slack-block-kit-0.2.0.tgz","fileCount":5,"integrity":"sha512-ZVSsocBXN5Hk3kSfaddyKKSuXlWx5irp6Z9yaTu3FsDalKhpwFansEIHcXLAz9UAgVmxpgfpbuT1/D97MZNHkQ==","signatures":[{"sig":"MEUCIEiaNG4yIR2hShBuDqAAWWdYPPSJQYoWvkuU4lcfLOfqAiEA6umTuTTKHENqdQJjNQc3lFv+E37nrcRLTQ47kx7UbSw=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@botfather%2funits-slack-block-kit@0.2.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":50900},"main":"./index.js","type":"module","_from":"file:botfather-units-slack-block-kit-0.2.0.tgz","types":"./index.d.ts","exports":{".":{"types":"./index.d.ts","default":"./index.js"}},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:f99a5829-5dab-4452-9bf5-e6c03a8f61ca"}},"_resolved":"/tmp/02d64106b326434da91d44c9c89dd52f/botfather-units-slack-block-kit-0.2.0.tgz","_integrity":"sha512-ZVSsocBXN5Hk3kSfaddyKKSuXlWx5irp6Z9yaTu3FsDalKhpwFansEIHcXLAz9UAgVmxpgfpbuT1/D97MZNHkQ==","repository":{"url":"git+https://github.com/Botfather/units.git","type":"git","directory":"packages/units-slack-block-kit"},"_npmVersion":"11.17.0","description":"Convert Units DSL or AST into Slack Block Kit payloads.","directories":{},"_nodeVersion":"24.16.0","dependencies":{"@botfather/units":"2.0.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/units-slack-block-kit_0.2.0_1782204410025_0.27328927503156697","host":"s3://npm-registry-packages-npm-production"}},"0.2.1":{"name":"@botfather/units-slack-block-kit","version":"0.2.1","description":"Convert Units DSL or AST into Slack Block Kit payloads.","license":"MIT","type":"module","repository":{"type":"git","url":"git+https://github.com/Botfather/units.git","directory":"packages/units-slack-block-kit"},"homepage":"https://github.com/Botfather/units/tree/main/packages/units-slack-block-kit","bugs":{"url":"https://github.com/Botfather/units/issues"},"main":"./index.js","types":"./index.d.ts","exports":{".":{"types":"./index.d.ts","default":"./index.js"}},"dependencies":{"@botfather/units":"2.0.1"},"publishConfig":{"access":"public"},"_id":"@botfather/units-slack-block-kit@0.2.1","_integrity":"sha512-OomUkETzzQm2J2VDG7N2Z/lCyO4oB3lCwcceKtNxhEUCbNNT8kvnWVCr8WH4lHY7fljkMlQsV8GE2F/dPfTzSw==","_resolved":"/tmp/602e88160f0e6d457f754d9090b75ae0/botfather-units-slack-block-kit-0.2.1.tgz","_from":"file:botfather-units-slack-block-kit-0.2.1.tgz","_nodeVersion":"24.16.0","_npmVersion":"11.17.0","dist":{"integrity":"sha512-OomUkETzzQm2J2VDG7N2Z/lCyO4oB3lCwcceKtNxhEUCbNNT8kvnWVCr8WH4lHY7fljkMlQsV8GE2F/dPfTzSw==","shasum":"7d816604c7fc6720dbfbf051e545d17f4aa9483e","tarball":"https://registry.npmjs.org/@botfather/units-slack-block-kit/-/units-slack-block-kit-0.2.1.tgz","fileCount":5,"unpackedSize":50900,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@botfather%2funits-slack-block-kit@0.2.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIHVywQTvZTDlGL5TRFKZGDqB5ChP9V8uxcb8FMI3Gr+JAiB/vENM3DDofUjT3CuPKr2dboTRBUZIb1NeBt1DQ2XPvQ=="}]},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:f99a5829-5dab-4452-9bf5-e6c03a8f61ca"}},"directories":{},"maintainers":[{"name":"botfather","email":"mohan.tushar.11@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/units-slack-block-kit_0.2.1_1782219356527_0.5426242517256159"},"_hasShrinkwrap":false}},"time":{"created":"2026-06-23T06:39:42.489Z","modified":"2026-06-23T12:55:56.994Z","0.1.0":"2026-06-23T06:39:43.044Z","0.2.0":"2026-06-23T08:46:50.144Z","0.2.1":"2026-06-23T12:55:56.673Z"},"bugs":{"url":"https://github.com/Botfather/units/issues"},"license":"MIT","homepage":"https://github.com/Botfather/units/tree/main/packages/units-slack-block-kit","repository":{"type":"git","url":"git+https://github.com/Botfather/units.git","directory":"packages/units-slack-block-kit"},"description":"Convert Units DSL or AST into Slack Block Kit payloads.","maintainers":[{"name":"botfather","email":"mohan.tushar.11@gmail.com"}],"readme":"# @botfather/units-slack-block-kit\n\nConvert Units DSL, Units AST, or a rendered Units tree into Slack Block Kit payloads.\n\n## Install\n\n```sh\nnpm install @botfather/units @botfather/units-slack-block-kit\n```\n\n## Usage\n\n```js\nimport { unitsToSlackBlockKit } from \"@botfather/units-slack-block-kit\";\n\nconst payload = unitsToSlackBlockKit(`\nSlackMessage (channel:'C123', name:'Release request') {\n  Section (blockId:'summary') {\n    Strong { 'Release:' }\n    ' ready for approval by '\n    Mention (userId:'U012AB3CD')\n  }\n  Actions {\n    Button (name:'Approve', actionId:'approve', style:'primary')\n    Button (name:'Reject', actionId:'reject', style:'danger')\n  }\n}\n`);\n\nconsole.log(payload.blocks);\n```\n\nUse `compileUnitsToSlackBlockKit` when you want diagnostics:\n\n```js\nimport { compileUnitsToSlackBlockKit } from \"@botfather/units-slack-block-kit\";\n\nconst result = compileUnitsToSlackBlockKit(source, {\n  scope: { approvers },\n  strict: true,\n});\n\nconsole.log(result.payload);\nconsole.log(result.warnings);\n```\n\nThe adapter evaluates Units directives and expressions through `createUnitsRenderer`, so `#if`, `#for`, expression props, slots, and text interpolation are resolved before Slack serialization.\n\n## Supported Units Tags\n\nBlock tags:\n\n- `SlackMessage`, `Message`\n- `Section`, `Markdown`\n- `Header`, `Heading`\n- `Context`\n- `Actions`, `Group`\n- `Divider`, `Separator`\n- `Image`\n- `Input`\n- `File`, `Video`, `RichText`\n- `Block`, `RawBlock`, `SlackBlock` with `type`/`slackType`/`payload`\n\nElement tags:\n\n- `Button`, `WorkflowButton`\n- `Image`\n- `Overflow`\n- `DatePicker`, `TimePicker`, `DateTimePicker`\n- `PlainTextInput`, `EmailInput`, `UrlInput`, `NumberInput`, `RichTextInput`\n- `StaticSelect`, `ExternalSelect`, `UsersSelect`, `ConversationsSelect`, `ChannelsSelect`\n- `MultiStaticSelect`, `MultiExternalSelect`, `MultiUsersSelect`, `MultiConversationsSelect`, `MultiChannelsSelect`\n- `Checkboxes`, `RadioButtons`\n- `Element`, `RawElement`, `SlackElement` with `type`/`slackType`/`payload`\n\nInline mrkdwn tags:\n\n- `Strong`, `Emphasis`, `Strike`\n- `Code`, `Pre`\n- `Blockquote`\n- `Link`\n- `Mention`, `Channel`, `UserGroup`, `SpecialMention`\n- `Date`\n- `Emoji`\n- `Field`, `Label`, `Hint`\n\nCamel-case Slack props are converted to Slack snake-case fields where useful, for example `blockId -> block_id`, `actionId -> action_id`, `src -> image_url`, and `alt -> alt_text`.\n\n## LLM Structured Output\n\nFor model-generated messages, prefer schema-constrained structured output over free-form DSL. The emitter can only render valid input; it cannot make a model produce valid `.ui` syntax.\n\n```js\nimport {\n  SLACK_UNITS_STRUCTURED_OUTPUT_SCHEMA,\n  compileStructuredSlackToBlockKit,\n} from \"@botfather/units-slack-block-kit\";\n\n// Pass SLACK_UNITS_STRUCTURED_OUTPUT_SCHEMA to your model provider as the\n// required JSON schema. Then validate and render the returned object.\nconst result = compileStructuredSlackToBlockKit(modelJson, {\n  strict: true,\n});\n\nconsole.log(result.payload);\n```\n\nStructured output shape:\n\n```json\n{\n  \"type\": \"SlackMessage\",\n  \"channel\": \"C123\",\n  \"text\": \"Release request\",\n  \"blocks\": [\n    {\n      \"type\": \"Section\",\n      \"blockId\": \"summary\",\n      \"children\": [\n        { \"type\": \"Strong\", \"text\": \"Release:\" },\n        \" ready for approval by \",\n        { \"type\": \"Mention\", \"userId\": \"U012AB3CD\" }\n      ],\n      \"accessory\": {\n        \"type\": \"Button\",\n        \"name\": \"Open request\",\n        \"actionId\": \"open\",\n        \"href\": \"https://example.com/release\"\n      }\n    }\n  ]\n}\n```\n\nUse `validateStructuredSlack(modelJson)` if you want validation without rendering. Keep `compileUnitsToSlackBlockKit(source, { strict: true })` for human-authored DSL, migrations, tests, or fallback repair flows:\n\n```js\nconst { payload, warnings } = compileUnitsToSlackBlockKit(source, {\n  strict: true,\n});\n```\n","readmeFilename":"README.md"}