{"file":"scripts/pack-npm.mjs","version":318,"total":73,"from":1,"to":73,"lines":[{"n":1,"text":"// Packs the npm package @abso-cli/abso from this checkout: the client as scripts/build-client.mjs builds it,","atom":"a1867","author":"node20","version":172},{"n":2,"text":"// for Node 20 or later. It never publishes and never reads npm's sign-in.","atom":"a1867","author":"node20","version":172},{"n":3,"text":"//","atom":"a1828","author":"node20","version":169},{"n":4,"text":"//   npm ci && npm run pack:npm -- <version>      (e.g. 0.171.0)","atom":"a1867","author":"node20","version":172},{"n":5,"text":"//","atom":"a1867","author":"node20","version":172},{"n":6,"text":"// It writes the package to dist/npm/package/ and its tarball, as npm pack names it, to dist/npm/.","atom":"a1867","author":"node20","version":172},{"n":7,"text":"// The package's layout: bin/abso.mjs checks Node's version and loads dist/abso.mjs, the bundle, stamped","atom":"a1867","author":"node20","version":172},{"n":8,"text":"// with the version so the client knows it is an installed package.","atom":"a1867","author":"node20","version":172},{"n":9,"text":"import { execFileSync } from \"node:child_process\";","atom":"a1867","author":"node20","version":172},{"n":10,"text":"import { mkdirSync, readFileSync, rmSync, writeFileSync } from \"node:fs\";","atom":"a1867","author":"node20","version":172},{"n":11,"text":"import { dirname, join, resolve } from \"node:path\";","atom":"a1867","author":"node20","version":172},{"n":12,"text":"import { fileURLToPath } from \"node:url\";","atom":"a1867","author":"node20","version":172},{"n":13,"text":"import { buildClient } from \"./build-client.mjs\";","atom":"a1867","author":"node20","version":172},{"n":14,"text":"","atom":"a1867","author":"node20","version":172},{"n":15,"text":"const root = resolve(dirname(fileURLToPath(import.meta.url)), \"..\");","atom":"a1867","author":"node20","version":172},{"n":16,"text":"const version = process.argv[2];","atom":"a1867","author":"node20","version":172},{"n":17,"text":"if (!version || !/^\\d+\\.\\d+\\.\\d+$/.test(version)) {","atom":"a1867","author":"node20","version":172},{"n":18,"text":"\tprocess.stderr.write(\"Use: npm run pack:npm -- <version>, such as 0.171.0\\n\");","atom":"a1867","author":"node20","version":172},{"n":19,"text":"\tprocess.exit(2);","atom":"a1867","author":"node20","version":172},{"n":20,"text":"}","atom":"a1867","author":"node20","version":172},{"n":21,"text":"const node = 20;","atom":"a1867","author":"node20","version":172},{"n":22,"text":"","atom":"a1867","author":"node20","version":172},{"n":23,"text":"const files = {","atom":"a1867","author":"node20","version":172},{"n":24,"text":"\t\"package.json\": `${JSON.stringify(","atom":"a1867","author":"node20","version":172},{"n":25,"text":"\t\t{","atom":"a1867","author":"node20","version":172},{"n":26,"text":"\t\t\tname: \"@abso-cli/abso\",","atom":"a1867","author":"node20","version":172},{"n":27,"text":"\t\t\tversion,","atom":"a1867","author":"node20","version":172},{"n":28,"text":"\t\t\tdescription: \"abso: version control built for AI agents first. The command line client.\",","atom":"a1867","author":"node20","version":172},{"n":29,"text":"\t\t\tlicense: \"MIT\",","atom":"a1867","author":"node20","version":172},{"n":30,"text":"\t\t\thomepage: \"https://abso.dev\",","atom":"a1867","author":"node20","version":172},{"n":31,"text":"\t\t\tkeywords: [\"version control\", \"vcs\", \"agents\", \"ai\", \"abso\"],","atom":"a1867","author":"node20","version":172},{"n":32,"text":"\t\t\ttype: \"module\",","atom":"a1867","author":"node20","version":172},{"n":33,"text":"\t\t\tengines: { node: `>=${node}` },","atom":"a1867","author":"node20","version":172},{"n":34,"text":"\t\t\tbin: { abso: \"bin/abso.mjs\" },","atom":"a1867","author":"node20","version":172},{"n":35,"text":"\t\t\tfiles: [\"bin\", \"dist\"],","atom":"a1867","author":"node20","version":172},{"n":36,"text":"\t\t\tpublishConfig: { access: \"public\" },","atom":"a1867","author":"node20","version":172},{"n":37,"text":"\t\t},","atom":"a1867","author":"node20","version":172},{"n":38,"text":"\t\tnull,","atom":"a1867","author":"node20","version":172},{"n":39,"text":"\t\t2,","atom":"a1867","author":"node20","version":172},{"n":40,"text":"\t)}\\n`,","atom":"a1867","author":"node20","version":172},{"n":41,"text":"\t// A dynamic import, so an older Node reaches the version check before it reads the bundle.","atom":"a1867","author":"node20","version":172},{"n":42,"text":"\t\"bin/abso.mjs\": `#!/usr/bin/env node","atom":"a1867","author":"node20","version":172},{"n":43,"text":"const major = Number(process.versions.node.split(\".\")[0]);","atom":"a1867","author":"node20","version":172},{"n":44,"text":"if (major < ${node}) {","atom":"a1867","author":"node20","version":172},{"n":45,"text":"\tprocess.stderr.write(\"abso needs Node ${node} or later, and this is Node \" + process.versions.node + \". Install a newer Node from https://nodejs.org and run abso again.\\\\n\");","atom":"a1867","author":"node20","version":172},{"n":46,"text":"\tprocess.exit(1);","atom":"a1867","author":"node20","version":172},{"n":47,"text":"}","atom":"a1867","author":"node20","version":172},{"n":48,"text":"await import(\"../dist/abso.mjs\");","atom":"a1867","author":"node20","version":172},{"n":49,"text":"`,","atom":"a1867","author":"node20","version":172},{"n":50,"text":"\t\"dist/abso.mjs\": buildClient([`globalThis.__ABSO_PACKAGE_VERSION__ = ${JSON.stringify(version)};`]),","atom":"a1867","author":"node20","version":172},{"n":51,"text":"\t\"README.md\": `# abso\\n\\nabso is version control for agents. This package is the abso command line.\\n\\nIt needs Node ${node} or later. Install it with \\`npm install -g @abso-cli/abso\\`, or run \\`npx @abso-cli/abso help\\`.\\n\\n[abso.dev](https://abso.dev)\\n`,","atom":"a1867","author":"node20","version":172},{"n":52,"text":"\tLICENSE: readFileSync(join(root, \"LICENSE\"), \"utf8\"),","atom":"a1867","author":"node20","version":172},{"n":53,"text":"};","atom":"a1867","author":"node20","version":172},{"n":54,"text":"","atom":"a1867","author":"node20","version":172},{"n":55,"text":"const out = join(root, \"dist\", \"npm\");","atom":"a1867","author":"node20","version":172},{"n":56,"text":"const pkg = join(out, \"package\");","atom":"a1867","author":"node20","version":172},{"n":57,"text":"rmSync(pkg, { recursive: true, force: true });","atom":"a1867","author":"node20","version":172},{"n":58,"text":"for (const [path, text] of Object.entries(files)) {","atom":"a1867","author":"node20","version":172},{"n":59,"text":"\tmkdirSync(dirname(join(pkg, path)), { recursive: true });","atom":"a1867","author":"node20","version":172},{"n":60,"text":"\twriteFileSync(join(pkg, path), text);","atom":"a1867","author":"node20","version":172},{"n":61,"text":"}","atom":"a1867","author":"node20","version":172},{"n":62,"text":"// Under npm run, npm_execpath is npm's own script, which runs without a shell on every platform.","atom":"a1867","author":"node20","version":172},{"n":63,"text":"const npm = process.env.npm_execpath;","atom":"a1867","author":"node20","version":172},{"n":64,"text":"const pack = [\"pack\", pkg, \"--pack-destination\", out, \"--ignore-scripts\"];","atom":"a1867","author":"node20","version":172},{"n":65,"text":"const tarball = (","atom":"a1867","author":"node20","version":172},{"n":66,"text":"\tnpm","atom":"a1867","author":"node20","version":172},{"n":67,"text":"\t\t? execFileSync(process.execPath, [npm, ...pack], { cwd: root, encoding: \"utf8\" })","atom":"a1867","author":"node20","version":172},{"n":68,"text":"\t\t: execFileSync(\"npm\", pack, { cwd: root, encoding: \"utf8\", shell: process.platform === \"win32\" })","atom":"a1867","author":"node20","version":172},{"n":69,"text":")","atom":"a1867","author":"node20","version":172},{"n":70,"text":"\t.trim()","atom":"a1867","author":"node20","version":172},{"n":71,"text":"\t.split(\"\\n\")","atom":"a1867","author":"node20","version":172},{"n":72,"text":"\t.pop();","atom":"a1867","author":"node20","version":172},{"n":73,"text":"process.stdout.write(`Packed @abso-cli/abso ${version}: dist/npm/${tarball}\\n`);","atom":"a1867","author":"node20","version":172}],"atoms":[{"atom":"a1828","author":"node20","message":"","time":1791962809547,"timeIso":"2026-10-14T07:26:49.547Z","publish":{"draft":null,"version":169,"agent":"node20","message":"Run the client on Node 20: commit a plain-JS build of it as client/bin/abso.mjs, built by npm run build:client and checked current by the project's check. Docs give each real Node minimum: the client 20 (bundle) or 24 (TypeScript), the server's wrangler 22, with a way to run it from Node 20. engines is now >=20.","time":1791963902087,"timeIso":"2026-10-14T07:45:02.087Z"}},{"atom":"a1867","author":"node20","message":"","time":1791965182282,"timeIso":"2026-10-14T08:06:22.282Z","publish":{"draft":null,"version":172,"agent":"node20","message":"Build the client for Node 20 instead of committing the build: npm run build writes client/bin/abso.mjs from client/abso.ts, and npm run pack:npm -- <version> packs that same build as the npm package @abso-cli/abso (it never publishes). The committed bundle and the check that kept it current are gone, so client changes need no rebuild. The READMEs give the build steps.","time":1791965182282,"timeIso":"2026-10-14T08:06:22.282Z"}}]}