logicsrc/packages/agentstack
Anthony Ettinger 297c5df54a
chore(deps): upgrade all dependencies; next 16.4.3 (RCE GHSA-2464-fhr4-w9xw) (#257)
- next 16.3.8 -> 16.4.3 (GHSA-2464-fhr4-w9xw, GHSA-673q-mjm6-r5xr)
- every workspace dependency to latest; majors: express 5, @simplewebauthn 14,
  imapflow 2 (status() may return false), nodemailer 10, libsodium-wrappers 0.8,
  commander 15, vite 8, @vitejs/plugin-react 6, typescript 7 (base tsconfig
  lists types: ["node"]), @logicsrc/validators 0.6, openmcp 0.4, hqtui 0.11,
  stack 0.5, x402-gateway 0.13
- bun 1.4.4 (image + packageManager)
- bun audit: 3 critical / 34 high -> 0

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-26 07:06:46 -07:00
..
src feat(agentstack): add delegation authority checks (#87) 2026-07-01 01:14:40 -07:00
package.json chore(deps): upgrade all dependencies; next 16.4.3 (RCE GHSA-2464-fhr4-w9xw) (#257) 2026-10-26 07:06:46 -07:00
PRD.md feat(agentstack): add delegation authority checks (#87) 2026-07-01 01:14:40 -07:00
README.md feat(agentstack): add delegation authority checks (#87) 2026-07-01 01:14:40 -07:00
tsconfig.json feat(agentstack): add @logicsrc/agentstack coordination module (#5) 2026-06-10 16:39:32 -07:00

@logicsrc/agentstack

AgentStack is the LogicSRC module for portable agent, task, payment, and reputation coordination across Profullstack microsaas apps (sh1pt, uGig, qaaas.dev, crawlproof, commandboard.run, coinpayportal, logicsrc, intr0s).

It is the reference implementation of the agentstack capability in the Profullstack Shared AppKit OpenSpec (profullstack-web/openspec/specs/agentstack).

What it provides

  • DID helpers for CoinPay-linked identities: userDid, agentDid, makeDid, parseDid (did:coinpay:user:123, did:coinpay:agent:abc).
  • DidTask — a portable task model with a defined status lifecycle (pending → queued → running → blocked → complete | failed | cancelled) that can bind to payment, escrow, and reputation events.
  • AgentStack — an in-memory coordinator that registers agents, tracks tasks, records delegation grants, checks active scoped authority, and emits coordination events. Storage backends can wrap the same API.
  • agentStackPlugin — a LogicSRC PluginDefinition (validated against the plugin manifest schema) exposing AgentStack as a coordination plugin with routes, events, permissions, and a TUI panel.

Usage

import { AgentStack, userDid, agentDid } from "@logicsrc/agentstack";

const stack = new AgentStack();
const owner = userDid("123");

stack.registerAgent({
  did: agentDid("abc"),
  name: "Build Agent",
  sourceApp: "commandboard.run",
  supportedProtocols: ["logicsrc/1"]
});

const task = stack.createTask({ ownerDid: owner, sourceApp: "sh1pt.com", title: "Ship build" });
stack.assignTask(task.id, agentDid("abc"));
stack.updateTaskStatus(task.id, "running");
stack.updateTaskStatus(task.id, "complete", { reputationEventId: "rep_1" });

const grant = stack.delegate(owner, agentDid("abc"), ["tasks:create"]);
stack.hasDelegation(owner, agentDid("abc"), "tasks:create"); // true while the grant is active
stack.revokeDelegation(grant.id);

Cross-app identity

Each app keeps a local users.id and links it to a CoinPay DID, giving cross-app identity without shared cookies or one global account database:

sh1pt.users.id -> did:coinpay:user:123
ugig.users.id  -> did:coinpay:user:123

Runtime

Runtime-neutral by design — pure TypeScript with no Bun- or Node-only APIs (time is injected via the AgentStack constructor). Runs on Bun, Node.js, Cloudflare Workers, and the browser, matching the Profullstack dual-runtime standard.

Environment

AGENTSTACK_API_URL
AGENTSTACK_API_KEY
COINPAY_API_BASE_URL

Scripts

npm run build   # tsc -> dist
npm test        # vitest