npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@haneinfo/assignment

v0.8.8

Published

Assignment mechanism: Assignment definitions (who must respond when a state machine enters a state) and the task runtime, registered with @haneinfo/definition-registry.

Readme

@haneinfo/assignment

See agent-guide.md for integration details.

Instance readers and stored query values

Every task creation (including initial-state entry, later rounds and self-entry) grants its assignee permanent read access to that instance in the same transaction. Assignment injects the state-machine-owned StateMachineReaderGrants service instead of writing another package's table. It requires state-machine 0.6 or later and the App's reader-table migration/backfill. OPEN, RESPONDED, CLOSED and CANCELLED tasks all retain their reader grants; there is no revoke operation. The grant is instance-specific and covers comments, following, lists and exports.

After creating the reader table, Apps must backfill every existing task, regardless of status:

INSERT INTO state_machine_instance_readers (instance_id, user_id, reason)
SELECT DISTINCT instance_id, assignee_id, 'ASSIGNED'
FROM assignment_tasks
ON CONFLICT (instance_id, user_id) DO NOTHING;

Date comparisons

GT/GTE/LT/LTE compare numbers, valid calendar dates (YYYY-MM-DD), or timezone-qualified datetimes (YYYY-MM-DDTHH:mm:ss with optional fractional seconds and Z or +/-HH:mm). Both operands must have the same category. Dates use calendar order; datetimes compare UTC instants at millisecond precision. Invalid dates, mixed categories and empty operands yield false. EQ/NEQ/IN retain strict scalar equality; matching instants with different textual offsets are still unequal for those operators.

Instance privacy boundary

Task reads and responses first check task ownership and return identical TASK_NOT_FOUND/404 for another person's or a missing task. Every assignee receives a permanent state-machine reader grant on task creation, so the internal runtime snapshot read is restricted to an already authorized reader. tasksOf is a trusted internal API, not an HTTP/MCP instance lookup. USER transitions outside task responses apply state-machine's read-before-write checks; Assignment triggers keep their existing authorization.

Period delegation (draft implementation)

With the optional delegation resolver, original tasks remain and delegates receive separate tasks with nullable onBehalfOfId and delegationId. Proxy titles start with [Delegate]. Task creation grants permanent instance readership in the same transaction. No resolver means the existing behavior. Migrate the two nullable assignment_tasks columns before deploying; no backfill of those columns is needed for older tasks. Upgrade state-machine for optional actingUserId/onBehalfOfId history output.

ANY_ONE/SINGLE completes on the first original or delegated response. JOINT counts one vote per original assignee; the first response closes that vote's other tasks and does not add votes. A proxy never expands into another proxy. A delegate already present in the round is not duplicated; when several originals share a delegate, deterministic delegation-id order picks one represented original. Other originals keep their own required votes.

Delegation registers internal effects for immediate, idempotent backfill of original OPEN tasks and transactional revocation cancellation. Future periods do not backfill tasks open before the start. Expired OPEN proxy tasks are hidden in GET /assignments/mine and list_my_assignments; a response commits CANCELLED and then raises DELEGATION_ENDED/409. Revocation cancels OPEN proxies in its own transaction. Permanent readers survive both. GET /assignments/:id returns no response choices for an expired OPEN proxy. Task ownership still hides other people's tasks as TASK_NOT_FOUND/404.

Task reads add optional onBehalfOfId and onBehalfOfName. Names use one authorized-page batch through identity-store.findActiveNamesByIds; missing/inactive/older providers yield null. MCP names are $userContent. A successful proxy response records actual actingUserId, and notifies the original with assignment-response:. Appointment notifications belong to delegation; task notification keys remain assignment:. Missing inbox capability skips notifications as before.

See @haneinfo/delegation's agent guide for period rules, human management and read-only MCP. There is no MCP response, creation, revocation, per-task reassignment or delegation frontend.

Instance access lists (draft implementation)

Implemented against draft decision 202610-c8e3; the decision remains draft.

Assignment calls StateMachineReaderGrants.grantAssigned(instanceId, userIds, tx, source?) in the same task transaction. The optional source defaults to ASSIGNED; notifyTasks groups original and one-hop delegate tasks and passes DELEGATED for delegates. The original call shape is compatible. Both sources are permanent READ; task completion/cancellation and delegation expiry/revocation never remove them. Manual GRANTED READ/WRITE entries coexist under a source-specific key. Task ownership and ASSIGNMENT transition authorization remain unchanged.

Upgrade the affected mechanisms together after applying the App migration. The maintained model, HTTP routes, read-only list_instance_access MCP tool, errors and permission contract are documented in @haneinfo/state-machine/agent-guide.md. Its prisma/instance-access.sql migrates the existing reader table to USER/ROLE, READ/WRITE and ASSIGNED/DELEGATED/GRANTED rows while retaining timestamps. The maintainer selected (instanceId, principalType, principalId, source) uniqueness. Manual grants are limited to 100 by default; permanent READ entries survive manual removal. See the package repository validation/equipment-loan/instance-access/report.md for SQL, tests and App restoration evidence.

Instance lifecycle (draft 202610-f1a8)

Implemented from draft decision 202610-f1a8; the decision remains draft. Upgrade state-machine, list-view, collaboration, attachments, import-export, assignment and timer together. No frontend, automatic archive or bulk lifecycle operations are included. Permanently purged data cannot be restored by this API: database and private file backups must cover the entire deletion retention period and be restored consistently.

Task reads/responses require a live runtime instance; deleted instances return INSTANCE_NOT_FOUND and are omitted from personal task lists. Delegation backfill skips deleted instances. On the transaction-bound state-machine.instance.purging event, built-in stores remove instance tasks and bindings using that same transaction. They are plain instance ids without cross-package foreign keys. Custom stores can implement purgeInstance for equivalent cleanup. No notifications are sent.

Human workflow UI (draft decision 202610-d1f4)

Assignment specs may declare fallbackAssignees using the same resolver array as assignees. It is evaluated only when the primary resolution is empty, incomplete or includes inactive people. The fallback replaces the primary result; it is never combined with it. A failed fallback raises ASSIGNEE_UNRESOLVED before state-entry writes. Pinned definitions are unchanged.

GET /assignments/instances/:instanceId returns { tasks } for any instance reader and hides unreadable instances with 404. Tasks add assigneeName, canRespond, commentRules ({ required: false, maxLength: 2000 }) and nullable instance.number/submitterName. GET /assignments/mine?status=ALL includes completed tasks; OPEN remains the default. GET /assignments/mine/count returns { count } for eligible OPEN tasks, excluding deleted instances and ended delegations. Task ownership still authorizes detail/response; instance readership does not grant a response. Due dates remain timer anchors, not a new expiry policy. Names use a batched active identity lookup and all task content must be rendered as plain text. Upgrade state-machine and common with the frontend. No new plugin API contract is introduced.