{"_id":"@adhd/sox-authoring","_rev":"3-e1774978ac72b434add845a15b8ebd4a","name":"@adhd/sox-authoring","dist-tags":{"latest":"0.2.2"},"versions":{"0.2.0":{"name":"@adhd/sox-authoring","version":"0.2.0","license":"MIT","_id":"@adhd/sox-authoring@0.2.0","maintainers":[{"name":"pseudosky","email":"skywinston.sk@gmail.com"}],"dist":{"shasum":"22172babe94f6cfbdffc9d386194864f0d2ee709","tarball":"https://registry.npmjs.org/@adhd/sox-authoring/-/sox-authoring-0.2.0.tgz","fileCount":45,"integrity":"sha512-gWhhStZh6dNpy/0TTBsvuDmC8ZMKgDSs/vA5S2N/W/h8eLR6YE0z1JLXnHS15p9Z0Kajlk9YKxVHjR+eHDHDhQ==","signatures":[{"sig":"MEUCIDdgFHGEK9Z0KtlZ32iNfwMaVeFYVmtWZpLjH40HDZU9AiEAoLOUeyPJDErtOG9oQzVH1rTxKSWPwKE5+Vsf7ybDxlY=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":135084},"main":"./dist/index.js","_from":"file:adhd-sox-authoring-0.2.0.tgz","types":"./dist/index.d.ts","engines":{"node":">=20"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.js"}},"_npmUser":{"name":"pseudosky","email":"skywinston.sk@gmail.com"},"_resolved":"/private/var/folders/yg/cfczgtx54bzfh74lx2_mv0z80000gp/T/e4b774d3079b4bdd155823a8552bc559/adhd-sox-authoring-0.2.0.tgz","_integrity":"sha512-gWhhStZh6dNpy/0TTBsvuDmC8ZMKgDSs/vA5S2N/W/h8eLR6YE0z1JLXnHS15p9Z0Kajlk9YKxVHjR+eHDHDhQ==","_npmVersion":"11.6.2","description":"Pure scaffold core — scaffold(opts) → FileSet (no @nx/devkit dependency)","directories":{},"_nodeVersion":"24.11.1","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/sox-authoring_0.2.0_1782451182026_0.5708314991201835","host":"s3://npm-registry-packages-npm-production"}},"0.2.1":{"name":"@adhd/sox-authoring","version":"0.2.1","license":"MIT","_id":"@adhd/sox-authoring@0.2.1","maintainers":[{"name":"pseudosky","email":"skywinston.sk@gmail.com"}],"dist":{"shasum":"ae4a9a4647a041b00f58c7d23c36521793f842ab","tarball":"https://registry.npmjs.org/@adhd/sox-authoring/-/sox-authoring-0.2.1.tgz","fileCount":46,"integrity":"sha512-vfDBKMv+xsS85NQiUITtI8KGcMXJwZ6kIki1rp2+oKrRE/grak4gEmpgzxdA71JTJ8bK/epspPJkDxwF/BaAuQ==","signatures":[{"sig":"MEUCIQC5JlJ3LKC4v+Grtv8BbnhSSdouNXAV9jUQCdSDlTczmgIgQy1eW+ktSAN5Q0bjDVvDYXIVHYbshh9jr/jdE0ZEqXk=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":136841},"main":"./dist/index.js","_from":"file:adhd-sox-authoring-0.2.1.tgz","types":"./dist/index.d.ts","engines":{"node":">=20"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.js"}},"_npmUser":{"name":"pseudosky","email":"skywinston.sk@gmail.com"},"_resolved":"/private/var/folders/yg/cfczgtx54bzfh74lx2_mv0z80000gp/T/93b6b7804ccb2fbb05f0754ef8644725/adhd-sox-authoring-0.2.1.tgz","_integrity":"sha512-vfDBKMv+xsS85NQiUITtI8KGcMXJwZ6kIki1rp2+oKrRE/grak4gEmpgzxdA71JTJ8bK/epspPJkDxwF/BaAuQ==","_npmVersion":"11.6.2","description":"Pure scaffold core — scaffold(opts) → FileSet (no @nx/devkit dependency)","directories":{},"_nodeVersion":"24.11.1","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/sox-authoring_0.2.1_1786144734422_0.8903828556776807","host":"s3://npm-registry-packages-npm-production"}},"0.2.2":{"name":"@adhd/sox-authoring","version":"0.2.2","description":"Pure scaffold core — scaffold(opts) → FileSet (no @nx/devkit dependency)","license":"MIT","publishConfig":{"access":"public"},"engines":{"node":">=20"},"main":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.js"}},"keywords":["scaffold","codegen","authoring","typescript"],"repository":{"type":"git","url":"git+https://github.com/PseudoSky/adhd.git"},"homepage":"https://github.com/PseudoSky/adhd","_id":"@adhd/sox-authoring@0.2.2","bugs":{"url":"https://github.com/PseudoSky/adhd/issues"},"_integrity":"sha512-+11jjt3EMTn8GaZQ3nO+92c2o9soRTDFdrV/AX2x/eqyqko28YLiIw3IHcLJ2ekdanmYOFNhEdxADMLBzLtmNg==","_resolved":"/private/var/folders/yg/cfczgtx54bzfh74lx2_mv0z80000gp/T/1e7f6013cab8b696741e3ae7bc993e15/adhd-sox-authoring-0.2.2.tgz","_from":"file:adhd-sox-authoring-0.2.2.tgz","_nodeVersion":"24.11.1","_npmVersion":"11.6.2","dist":{"integrity":"sha512-+11jjt3EMTn8GaZQ3nO+92c2o9soRTDFdrV/AX2x/eqyqko28YLiIw3IHcLJ2ekdanmYOFNhEdxADMLBzLtmNg==","shasum":"40ecab89d419ad447c291073061869611c48e6a3","tarball":"https://registry.npmjs.org/@adhd/sox-authoring/-/sox-authoring-0.2.2.tgz","fileCount":48,"unpackedSize":147419,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIGvjTRuPI0SAPswff9Z4B7cYi7N0VZktPBZTCs6cIHtxAiEAwVhZvP22qM5k+hSdYvYzjqq1L+7w+2yDnzasfmSQjt0="}]},"_npmUser":{"name":"pseudosky","email":"skywinston.sk@gmail.com"},"directories":{},"maintainers":[{"name":"pseudosky","email":"skywinston.sk@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/sox-authoring_0.2.2_1788566479543_0.6635721928783458"},"_hasShrinkwrap":false}},"time":{"created":"2026-06-26T05:19:41.872Z","modified":"2026-09-05T00:01:19.876Z","0.2.0":"2026-06-26T05:19:42.158Z","0.2.1":"2026-08-07T23:18:54.569Z","0.2.2":"2026-09-05T00:01:19.695Z"},"license":"MIT","description":"Pure scaffold core — scaffold(opts) → FileSet (no @nx/devkit dependency)","maintainers":[{"name":"pseudosky","email":"skywinston.sk@gmail.com"}],"readme":"# @adhd/sox-authoring\n\nPure scaffold core for soxe extensions: `scaffold(opts)` takes a type and an id and returns a\ncomplete, ready-to-install file set — no filesystem access, no build tooling, no Nx dependency.\nCall `writeFileSet` when you're ready to put the result on disk. This is the same engine the\n`soxe init` CLI command uses, exposed as a library for anyone scaffolding extensions\nprogrammatically.\n\n```bash\npnpm add @adhd/sox-authoring\n```\n\n## Quick start\n\n```typescript\nimport { scaffold, writeFileSet } from '@adhd/sox-authoring';\n\nconst fileSet = scaffold({\n  type: 'skill',\n  id: 'my-helper',\n  title: 'My Helper',\n  description: 'Use this when the user needs help with X',\n});\n\nconsole.log(Object.keys(fileSet));\n// ['extension.json', 'package.json', 'SKILL.md', 'CHANGELOG.md', 'README.md']\n\nwriteFileSet(fileSet, './my-helper');\n// writes every entry above to ./my-helper/<relative-path>, creating directories as needed\n```\n\n## API reference\n\n### `scaffold(opts): FileSet`\n\nGenerates a complete, born-conformant file set for the given extension type. The returned\n`extension.json` validates against the soxe manifest schema as-is — no post-processing required.\n\n```typescript\ntype FileSet = Readonly<Record<string, string>>; // relative path → file content\n\ntype ActiveType = 'agent' | 'skill' | 'mcp-server' | 'hook' | 'command' | 'bundle' | 'service';\n\nconst ACTIVE_TYPES: ReadonlyArray<ActiveType>;\n\nfunction scaffold(opts: ScaffoldOpts): FileSet; // throws if type/id is invalid\n```\n\n`scaffold` throws when `opts.id` fails validation — see `validateId` below — rather than emitting\na broken file set:\n\n```typescript\nscaffold({ type: 'skill', id: 'Bad_ID', description: 'x' });\n// throws: 'scaffold: invalid id — id \"Bad_ID\" must match ^[a-z][a-z0-9-]*$'\n```\n\n### `ScaffoldOpts`\n\nOnly `type` and `id` are required; everything else has a sensible default or is omitted from the\noutput when absent.\n\n```typescript\ninterface ScaffoldOpts {\n  /** One of the 7 active types. 'prompt' is intentionally not accepted here — see below. */\n  type: ActiveType;\n  /** Extension id: must match ^[a-z][a-z0-9-]*$ and must NOT end with the type name. */\n  id: string;\n  /** Human-readable title. Defaults to id when omitted. */\n  title?: string;\n  /** One-line description. Defaults to \"<id> extension\" when omitted. */\n  description?: string;\n  /** Author string — written to extension.json and package.json. */\n  author?: string;\n  /** Keywords array — written to extension.json. */\n  keywords?: string[];\n\n  // Content / provenance\n  content?: string;   // body text read from a source path at init time\n  source?: string;    // origin path, stamped into install.source for later re-pull\n\n  // Install descriptor\n  hosts?: string[];               // chosen host targets, e.g. ['claude', 'codex']\n  scope?: string;                 // install scope override: project | user | local\n  permissions?: Record<string, unknown>;\n  env?: Record<string, string>;\n\n  // mcp-server specific\n  transports?: string[];          // stdio | sse | http\n  profile?: string;                // install-layer preset, e.g. standalone | shared\n  trust?: string;                  // prompt | auto\n\n  // command specific\n  surface?: string;                // e.g. claude-commands | codex-commands\n\n  // prompt specific (prompt type itself is parked — see below)\n  inject?: string;                 // rules | claude-md\n\n  // bundle specific\n  /** \"<type>:<member-id>\" pairs — scaffolds member extensions under members/. */\n  members?: Array<{ type: string; id: string }>;\n}\n```\n\nFields you omit are resolved with defaults (`title` → `id`, `description` → `\"<id> extension\"`)\nbefore being handed to the type-specific template; every other Appendix-A field is forwarded\nverbatim and shows up in the emitted `extension.json`'s install descriptor when present.\n\n### `writeFileSet(fileSet, outDir): void`\n\n```typescript\nfunction writeFileSet(fileSet: FileSet, outDir: string): void;\n```\n\nWrites every entry to `outDir`, creating parent directories as needed and overwriting anything\nalready there. Pure Node `fs`, synchronous, no return value.\n\n### `validateId(id, type): string | null`\n\n```typescript\nfunction validateId(id: string, type: ActiveType): string | null;\n```\n\nReturns `null` when `id` is valid, or a human-readable error string otherwise. This is the same\ncheck `scaffold` runs internally — call it directly when you want to validate user input before\nattempting to scaffold:\n\n```typescript\nimport { validateId } from '@adhd/sox-authoring';\n\nvalidateId('my-helper', 'skill');   // null — valid\nvalidateId('my-skill', 'skill');    // \"id \\\"my-skill\\\" must not end with the type name \\\"skill\\\"\"\nvalidateId('My_Helper', 'skill');   // \"id \\\"My_Helper\\\" must match ^[a-z][a-z0-9-]*$\"\n```\n\n## The 7 active types\n\n```typescript\nACTIVE_TYPES; // ['agent', 'skill', 'mcp-server', 'hook', 'command', 'bundle', 'service']\n```\n\n| Type | Runtime | Builds? |\n|------|---------|---------|\n| `agent` | declarative | no |\n| `skill` | declarative | no |\n| `mcp-server` | node | yes |\n| `hook` | shell (or node) | no |\n| `command` | node (or python) | yes |\n| `bundle` | declarative | no |\n| `service` | node | yes |\n\n`prompt` is an eighth manifest type recognized by the wider soxe ecosystem, but it is **not** in\n`ACTIVE_TYPES` — there is no active template for it (parked by design, not yet wired into the\nauthoring path). Passing `type: 'prompt'` to `scaffold` is unsupported: stick to the 7\n`ACTIVE_TYPES` above.\n\n## Bundle scaffolding\n\nPassing `members` scaffolds a `bundle` extension whose member extensions are generated inline\nunder `members/<member-id>/`, each with `visibility: \"internal\"`:\n\n```typescript\nconst fileSet = scaffold({\n  type: 'bundle',\n  id: 'my-toolkit',\n  description: 'A toolkit bundling a skill and an mcp-server',\n  members: [\n    { type: 'skill', id: 'toolkit-helper' },\n    { type: 'mcp-server', id: 'toolkit-server' },\n  ],\n});\n```\n\n## Design\n\n- **Nx-free** — zero `@nx/devkit` or Nx-package imports anywhere in this package's dependency\n  graph, so `scaffold`/`writeFileSet` run standalone outside an Nx workspace.\n- **Host-agnostic output** — `scaffold` never writes a literal install path (no hardcoded\n  `~/.claude/skills/<id>/`); it emits an `install` descriptor (type, hosts, scope) that a host\n  registry resolves to a concrete target at install time.\n- **Pure and synchronous** — `scaffold` does no I/O at all and is safe to call repeatedly with the\n  same inputs; `writeFileSet` is the only function that touches disk.\n","readmeFilename":"README.md","homepage":"https://github.com/PseudoSky/adhd","keywords":["scaffold","codegen","authoring","typescript"],"repository":{"type":"git","url":"git+https://github.com/PseudoSky/adhd.git"},"bugs":{"url":"https://github.com/PseudoSky/adhd/issues"}}