{"_id":"@adcops/autocore-varpick","name":"@adcops/autocore-varpick","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"@adcops/autocore-varpick","version":"1.0.0","description":"Headless model behind autocore's variable pickers: catalog shape, search ranking, caret-aware insertion, and the ${fqdn} token grammar. No UI, no dependencies.","type":"module","main":"dist/index.js","module":"dist/index.js","types":"dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"scripts":{"build":"tsc -p tsconfig.build.json","clean":"rm -rf dist","prepare":"npm run build","test":"npm run build && node tools/varpick.test.mjs","watch":"tsc -w -p tsconfig.build.json"},"license":"UNLICENSED","private":false,"sideEffects":false,"devDependencies":{"typescript":"^5.0.2"},"publishConfig":{"access":"public"},"gitHead":"08ae02dd1c2797d850b308570c727c1ece2b98d0","_id":"@adcops/autocore-varpick@1.0.0","_nodeVersion":"22.21.1","_npmVersion":"11.8.0","dist":{"integrity":"sha512-9PuiQiTl3I7K58McFkxi92FQCf62nfm0IqvjQmc377cvoy6pWg9gZ+2gZPPpayDGSeqBr5QFvSUAsIZ0NkLeTw==","shasum":"247c7b422835b573e7910f4f8c854b9fbfaa9a01","tarball":"https://registry.npmjs.org/@adcops/autocore-varpick/-/autocore-varpick-1.0.0.tgz","fileCount":20,"unpackedSize":56423,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQC6cK/laeie5JUfjkZ0qjQvv2bPyRN+tCnX0KBIQCWEQgIgSvpmxPFubK6Il0pRU0sv/PyISDP9opkHQR4kuKoXSAE="}]},"_npmUser":{"name":"adc_tbj","email":"tbj@automateddesign.com"},"directories":{},"maintainers":[{"name":"adc_tbj","email":"tbj@automateddesign.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/autocore-varpick_1.0.0_1788211324762_0.40910030263036723"},"_hasShrinkwrap":false}},"time":{"created":"2026-08-31T21:22:04.549Z","1.0.0":"2026-08-31T21:22:04.904Z","modified":"2026-08-31T21:22:05.211Z"},"maintainers":[{"name":"adc_tbj","email":"tbj@automateddesign.com"}],"description":"Headless model behind autocore's variable pickers: catalog shape, search ranking, caret-aware insertion, and the ${fqdn} token grammar. No UI, no dependencies.","license":"UNLICENSED","readme":"# @adcops/autocore-varpick\n\nThe model behind autocore's variable pickers. **Headless** — no React, no\nwidgets, no dependencies.\n\n## Why it exists\n\nEvery screen that asks an author to name a machine value used to be a bare text\nbox: a TIS field's `source` hinting `gm.<variable_name>`, a `${gm.…}` bound, a\nsequence expression over signals nobody published a description for. Nobody can\ntype a variable from a program they cannot see, and the names themselves are\noften no help — `pos` is the ram position, but the file never says so.\n\nTwo packages fix that by rendering a picker, and they cannot share a line of UI:\n\n| | widget layer |\n|---|---|\n| `@adcops/autocore-react` | PrimeReact today, `@adcops/autocore-ui` at 4.0 |\n| `@adcops/autocore-seq-react` | plain HTML over design tokens, so one build renders on 3.5 **and** 4.0 |\n\nWhat they must not differ on is what a variable *is*, how a search ranks, where\na pick lands in the text, and how a `${fqdn}` token is spelled. That is this\npackage.\n\n## What's in it\n\n- **`model.ts`** — `VariableEntry` / `CatalogGroup` / `Catalog`. An entry\n  carries `insert` separately from `name`, because the same variable is\n  `press_position`, `gm.press_position` or `${gm.press_position}` depending on\n  the field it lands in.\n- **`search.ts`** — separator- and case-insensitive ranking. Descriptions are\n  searched, so a variable is findable by what it *means*: `\"EL3356\"` finds\n  `zforce_load`.\n- **`insert.ts`** — caret-aware insertion. An author who typed `pos` and then\n  opened the picker gets `press_position`, not `pospress_position`.\n- **`token.ts`** — the `${fqdn}` grammar, in one place. It briefly lived in two\n  TypeScript files and that is how the editor and the runtime came to disagree\n  about what a bound was.\n- **`gm.ts`** — turns a `gm.get_variables` payload into a catalog, grouped by\n  ownership and filtered by whether a UI may write the variable.\n\n## Design rules\n\n1. **No JSX here, ever.** The moment this package renders anything it pins a\n   consumer to one side of the 3.5 → 4.0 migration.\n2. **A disabled entry is shown, greyed, with the reason.** Hiding it answers\n   \"where is my variable?\" with silence, which is the problem we started with.\n3. **Never guess a unit or a label.** `unitFor` comes from the host's resolved\n   `units.json`; absent means absent.\n\n## Publishing\n\n**This package must be published before either consumer can ship.** Both declare\nit as a normal semver dependency (`^1.0.0`), which is correct on publish and\nunresolvable until it exists on the registry. Local development uses a symlink:\n\n```sh\nln -s /path/to/autocore-varpick <consumer>/node_modules/@adcops/autocore-varpick\n```\n\n### It must be published PUBLIC, explicitly\n\n`package.json` carries `\"publishConfig\": { \"access\": \"public\" }`. **Do not\nremove it, and do not assume omitting `publishConfig` is the same thing.**\n\nA scoped package (`@adcops/…`) defaults to **restricted** on npm. Restricted\nmeans a private package, private packages need a paid plan, and a free account\ngets:\n\n```\nnpm error code E402\nnpm error 402 Payment Required - You must sign up for private packages\n```\n\nThat is the same error `@adcops/autocore-seq-react` hits — but for the opposite\nreason: it asks for restricted *on purpose*\n(`publishConfig.access: \"restricted\"`), which is why it ships by git instead.\nHere the access is public and the key is what makes it so.\n\n`@adcops/autocore-react` has no `publishConfig` at all and publishes fine only\nbecause its **first** publish set the access to public; npm remembers a\npackage's access level after that, so later publishes inherit it. A brand-new\nscoped package has no such history, so the first publish is the one that has to\nsay `public` — either through the key above or `npm publish --access public`.\n\n## Development\n\n```sh\nnpm test     # builds, then runs tools/varpick.test.mjs against dist/\n```\n\nThe tests import the **compiled** output on purpose: both consumers import\n`dist`, and a `.ts`-only test would not catch an export that never made it out\nof the barrel.\n","readmeFilename":"README.md","_rev":"1-9542b0eeddb12d513bfef5353ecf64ba"}