Conversation
Evaluating HumanJS required writing code first. `humanjs demo <url>` removes that: it drives any page the way a person skims it, so the motion can be judged in ten seconds with nothing to set up. `humanjs run <script>` wires the browser and the Human instance so a script is only the flow. TypeScript runs directly through tsx. Two things worth knowing: The unscoped `humanjs` name on npm belongs to an unrelated 2022 package, so `npx humanjs` does not reach this CLI -- it is `npx @humanjs/cli`. The help text and README both say so, because people will try. `demo` runs against pages nobody here has seen, so every step degrades instead of failing, and it hovers rather than clicks -- it must not navigate away or fire a side effect on someone else's site. Selector lookups return locators already narrowed with .first(); handing a bare 'a[href]' to a primitive trips Playwright's strict mode and hangs, which is exactly what happened the first time this was run for real.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Evaluating HumanJS currently requires writing code first. This closes that gap:
A browser opens, lands, reads the heading, scrolls in stages, and drifts the cursor over a link — the way a person skims. Ten seconds, nothing to set up.
Two commands
demo <url>— the look-at-it command.run <script>— executes a HumanJS flow with the browser andHumanalready wired, so the file is only the flow:.tsruns directly through tsx, no build step. Both take--record <file>(extension picks the format, including.spec.tsfor a committable Playwright test),--personality,--speed,--seed,--viewport,--headless.npx humanjswill not work, and that changes the pitchThe unscoped
humanjsname on npm is taken — an unrelated CLI from 2022,v1.0.1, last published June 2022.npx humanjsfetches that, not this. So the entry point isnpx @humanjs/cli; installed globally, the binary is plainhumanjs.This is called out in the help text and the README because people will try it. If the shorter form matters, claiming the dormant name through npm's dispute process is a separate decision and yours to make.
Design notes
demoruns on other people's sites. Every step degrades instead of failing — no heading, nothing to scroll, no links each just means fewer steps. And it hovers, never clicks: it must not navigate away, submit a form, or fire a side effect on a site it was pointed at.Selector lookups return locators already narrowed with
.first(). The first real run against a live page hung: a barea[href]matches dozens of elements, trips Playwright's strict mode, and waits out the timeout. Returning a narrowed locator rather than a selector string means a caller cannot reintroduce that.The version is injected at build time via tsup's
define. Readingpackage.jsonat runtime means resolving a path out ofdist/, which differs between the ESM and CJS outputs — and a CLI that misreports its own version is a support ticket waiting to happen.Arg parsing is hand-rolled and unit-tested. On a CLI the error messages are the interface, so every rejection names the bad value and lists what was expected.
--viewportaccepts1440×900as well as1440x800, because that is what gets pasted from a design tool.Package checklist (per
CLAUDE.md)version: 0.0.0+publishConfig.access: publicso the first changeset publishes0.1.0; tsconfig and tsup config mirrored frompackages/mcp; badge row on the README; regulardependenciesrather than peers, since anpx-launched package has no host app to supply them; Packages table updated.Verification
31 unit tests. Whole suite green with the package wired in:
lint,typecheck(11/11),test(10/10),build(8/8),check:exports(15/15).Smoke-tested from
dist/: help,--version, a usage error (clean message, exit 2, no stack), anddemo https://example.com --record t.gif --headless, which recorded 6 actions to a GIF.Found while dogfooding
demoagainsthttps://humanjs.devfails — but upstream, not here. A single transientPage.captureScreenshotprotocol error permanently stops the capture loop inpackages/playwright/src/recording/capture.ts, so zero frames are captured and the export dies with "No frames were captured". A dropped frame should not cost the whole recording. Fix coming in its own PR.