Skip to content

[EPIC-D][LOU-D35] Remove flows-ai converters and the nanoid dependency - #82

Merged
LinuxDevil merged 2 commits into
mainfrom
lou-d35-drop-converters-nanoid
Oct 1, 2026
Merged

LinuxDevil merged 2 commits into
mainfrom
lou-d35-drop-converters-nanoid

Conversation

@LinuxDevil

Copy link
Copy Markdown
Owner

What

  • Deletes src/flows/converters.ts (convertToFlowDefinition / convertFromFlowDefinition) and its test, and removes the export * from './converters' re-export (it was part of the root and ./flows public export).
  • Adds src/utils/id.ts with newId(prefix?) built on globalThis.crypto.randomUUID() (plus id.test.ts), and replaces every nanoid() call (10 files: FlowBuilder, sessionStream, data/mocks, AgentBuilder, json-path, errors, tracing, agentRun, MemoryManager, AgentExecutor, import swap only).
  • Removes nanoid from package.json and package-lock.json (lockfile edited by hand to the single node_modules/nanoid entry plus the root dependency line; 19 deletions, no npm-version libc churn). Transitive nanoid 3.x copies used by ai/postcss are untouched.
  • CHANGELOG Removed entries with migration notes; two doc comments in src/types/flow.ts no longer mention the converters.

Why

The converters targeted a flows-ai engine that was never a dependency and FlowExecutor never used them (donor-project residue, AUDIT section 4). nanoid is a runtime dependency used only to make opaque ids; Node 22 and Cloudflare Workers both provide crypto.randomUUID(), so no dependency or node:crypto import is needed (the Workers bundle stays Node-builtin free). No code in apps/agent-forge, examples or packages/create-loushy-agent imported the converters or nanoid.

Acceptance criteria

  • src/flows/converters.ts and its test deleted; re-export removed; CHANGELOG Removed entry with migration note (no replacement)
  • src/utils/id.ts exports newId(prefix?) on globalThis.crypto.randomUUID(); no node:crypto fallback needed
  • Every nanoid import replaced; no test asserted the old id format (session test regex ^[A-Za-z0-9_-]+$ still matches)
  • nanoid removed from package.json and package-lock.json; no workspace depends on it; npm ci --dry-run succeeds
  • npm run build (incl. src/deploy/runtime.worker.ts bundle) and cloudflare adapter tests pass
  • .fallowrc.json unchanged
  • No changes to createAgent.ts, context/, react/, providers/*; AgentExecutor.ts import swap only

How verified

  • npx tsc --noEmit: no errors
  • npm run lint: 0 errors, 420 warnings (main: 433, so down 13)
  • npm run test:types: no type errors
  • npx vitest run (after build): 140 files passed, 2044 tests passed, 3 skipped
  • npm run build && npm run build --workspace=packages/create-loushy-agent: success
  • npx vitest run src/deploy: 5 files, 36 passed, 1 skipped
  • npm run test:coverage: 140 files, 2044 passed
  • npm run fallow: exit 0, 0 above threshold
  • npm run docs:llms:check: passes (no README/docs changes)

🤖 Generated with Claude Code

https://claude.ai/code/session_016bY29ibQgv3MDdjAbUT4YR


Generated by Claude Code

claude added 2 commits October 1, 2026 14:03
Delete src/flows/converters.ts (+ test): it targeted a flows-ai engine that was
never a dependency and FlowExecutor never used it. Replace every nanoid() call
with a tiny newId() built on globalThis.crypto.randomUUID() (Node 22 and
Cloudflare Workers both provide it) and drop nanoid from package.json and the
lockfile.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016bY29ibQgv3MDdjAbUT4YR
@LinuxDevil
LinuxDevil merged commit 05ce266 into main Oct 1, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants