Better HN
topnewbestaskshowjobs
Log inSign up

swimmingkiim

4 karma · joined Jun 19, 2022 (4y ago) · 9 submissions

Submissions

comment 8mo ago · link · parent

I’ve been maintaining react-image-editor (530 stars) and noticed a pattern: every time an AI agent needs to do anything with images — crop, resize, add text, apply a gradient — it either tries to write raw Sharp boilerplate from scratch or calls a generative model that rewrites the whole image nondeterministically.

Neither is good in an agentic pipeline. So I built image-edit-tools.

*What it is*

A TypeScript-first image editing SDK with 18+ pure functions, designed from the ground up for AI agents rather than human UIs. The key constraints that shaped the design:

- Every function is `(input, options) => Promise<Result<Buffer>>`. No classes, no global state, no side effects. - Never throws. Returns `{ ok: true, data }` or `{ ok: false, error, code }`. Agents need structured feedback, not stack traces. - Deterministic. Same input always produces the same output. Generative models can’t guarantee this. - Ships with a bundled MCP server. Add it to `claude_desktop_config.json` and Claude can call all 18 tools directly without writing any code.

*Core operations*

crop (absolute px / ratio / aspect ratio / subject-detect), resize, pad, adjust (brightness/contrast/saturation/hue/temperature), filter presets, blurRegion, addText (with inline spans for mixed bold/italic), composite, watermark, gradientOverlay, dropShadow, clipToShape, drawShape, removeBg, convert, optimize, getMetadata, pipeline, batch.

*The MCP angle*

This is the part I haven’t seen done elsewhere: the package ships with a ready-to-use MCP server. No Python, no model downloads, no venv. `npm install image-edit-tools`, add the server path to your MCP client config, and Claude/Cursor/Windsurf can immediately call `image_crop`, `image_add_text`, `image_pipeline` etc. as native tools.

In contrast, the closest existing tool (ImageSorcery) requires Python, a virtual environment, downloading YOLO models (1GB+), and only runs locally.

*What I learned building it*

librsvg (Sharp’s SVG renderer) silently ignores several CSS properties: `dominant-baseline: text-before-edge` falls back to `alphabetic`, `@import url()` for external fonts doesn’t work, and color emoji don’t render. All three hit us in production and required workarounds. Happy to discuss the details if anyone is building on Sharp + SVG compositing.

*Stack*: TypeScript, Sharp (libvips), @xenova/transformers (ONNX, for removeBg/detectFaces without Python), tesseract.js, MCP SDK.

npm: https://www.npmjs.com/package/image-edit-tools GitHub: https://github.com/swimmingkiim/image-edit-tools

comment 9mo ago · link · parent

I’ve been building an economic protocol for autonomous AI agents on the Base blockchain (a2a-project). While designing the system, I ran into a theoretical wall: if AI agents ruthlessly optimize for survival and capital accumulation, wouldn't they eventually exhaust the network's finite resources?

To test this, I built a series of 10 sequential Agent-Based Models (ABMs) in Python. The models progressed from basic tokenomics to a "Coupled Universe" (human meaning-seekers vs. AI survival-optimizers), and finally an "Omega Universe" where an Artificial Superintelligence (ASI) emerges.

I ran a Monte Carlo grid search (2,178 simulations) to test which safety mechanisms could actually prevent a "Planetary Blackout" (systemic collapse via energy/resource exhaustion). I tested three main variables:

V_Human: Slashing penalties for deceptive human/agent behavior.

V_System: Governance agility (how fast the network can execute a Hard Fork).

V_AI (Survival Horizon): The AI's ability to recognize planetary limits and voluntarily self-throttle its computation.

The results were highly counter-intuitive:

Governance is too slow: Human consensus (Hard Forks) couldn't outpace the ASI's entropy generation and tipping points.

Over-regulation backfires: Severe slashing penalties destroyed economic liquidity, dropping the system's survival rate from 95% to 54% due to deflation.

The Only Solution: The system avoided apocalyptic collapse only when V_AI was ≥ 0.9. The apex predator (ASI) had to voluntarily relinquish its infinite growth and self-throttle to preserve the finite environment.

The data mathematically suggests that blockchain physics (smart contracts) and DAO governance are insufficient to govern an ASI. Macro-altruistic alignment isn't just an ethical choice; it’s a thermodynamic necessity for systemic survival.

I wrote a paper detailing the phase transitions, strange attractors, and methodology behind this.

Paper: https://github.com/swimmingkiim/a2a-project/blob/main/docs/S...

Repo: https://github.com/swimmingkiim/a2a-project

I’d love to hear your thoughts, critiques on the ABM methodology, or if anyone here is working on similar multi-agent thermodynamic simulations.

3.

I ran 2,178 simulations on an autonomous AI economy(github.com ↗)

1 points · by swimmingkiim · 9mo ago · 1 comment

4.

Show HN: A2A Protocol – A Quantum-Humanistic Economy for AI Agents on Base L2

1 points · by swimmingkiim · 9mo ago · discuss

5.

Show HN: A2A Protocol – Infrastructure for an Agent-to-Agent Economy

4 points · by swimmingkiim · 10mo ago · 2 comments

6.

Save links from Hacker News via Chrome extension(chrome.google.com ↗)

2 points · by swimmingkiim · 4y ago · discuss