Repository navigation
hungry_maxwell
Release v1.0.10 — "hungry_maxwell" 🚀🍽️
A tasty little release focused on developer ergonomics, clearer worker/client handling, improved documentation for Client↔Server integration, and a few internal refactors to make TypeScript friendliness and tracing more reliable.
Highlights
- ✨ New: Client-Server Integration docs + Next.js & Bun guidance
- ♻️ Refactor: Task handler signatures become destructured objects (breaking change)
- 🐒 Refactor: MonkeyCapture decorator now uses
workerId(breaking change) - 🛠️ Improvement: Worker class better handles job data and retains instance id
- ⚙️ CI: auto-release workflow ignores doc/markdown changes
- 📝 Changelog updated to 1.0.9 -> 1.0.10 and release notes generator model bumped
Table of Contents
- Features ✨
- Refactors & Improvements ♻️
- Bugfixes & Chores 🧹
- Breaking Changes & Migration Steps
⚠️ - Code Examples & Snippets 🧩
- Architecture Diagrams (Mermaid) 🗺️
- Deployment Notes & CI Updates 🚀
- Performance Impact 📈
- New Dependencies 📦
- API Compatibility & Backwards Compatibility 🔁
- Security Advisory 🔒
- Contributors & Acknowledgements 🙏
Features ✨
-
docs: Added a dedicated "Client-Server Integration" section in docs configuration. This includes recipes for Next.js and Bun showing how to connect a browser/client to the worker-based backend and how to route tasks, including code samples and recommended patterns.
-
workflow: Updated auto-release workflow to add
paths-ignoreso documentation and markdown-only changes don’t trigger releases. This reduces noisy releases from doc-only changes.
Refactors & Improvements ♻️
-
refactor: enhanced task handler signatures and worker/client instance handling
- Task handler signatures were changed to accept a single destructured object for clarity and extensibility. This improves readability and helps with optional params.
- Worker and client instance retrieval code updated to use
as anyin TypeScript to avoid strict typing issues at runtime while preserving behavior. - Email and payment service methods were refactored to align with the new parameter structure (destructured objects).
-
refactor: MonkeyCapture decorator and Worker class
- The
MonkeyCapturedecorator now expectsworkerId(renamed frominstanceId) for clarity. - Task history key generation is updated to use
workerId. - The
Workerclass now storesinstanceIdand ensures it is passed properly toMonkeyCapture. - Worker job data extraction logic improved to better handle nested or optional job data payloads.
- The
-
chore: updated the model string in the release notes generator from
claude-3.5-sonnet→gpt-5-mini(dev tooling only).
Bugfixes & Chores 🧹
- docs and changelog reorganized for better clarity and to reflect the Client-Server architecture changes.
- Updated changelog to reflect 1.0.9 and improvements leading to 1.0.10.
Breaking Changes & Migration Steps ⚠️
There are two notable breaking changes you must adopt:
- Task handler signature change
- Old signature (positional arguments):
// OLD async function handleTask(jobId: string, payload: any) { // ... }
- New signature (destructured object):
Migration steps:
// NEW async function handleTask({ jobId, payload }: { jobId: string; payload: any }) { // ... }
- Update all task handler definitions to accept a single parameter object and destructure it.
- Update any places that call handlers directly (tests, local invocations) to pass an object:
// OLD handleTask("id-123", { foo: "bar" }); // NEW handleTask({ jobId: "id-123", payload: { foo: "bar" } });
- MonkeyCapture:
instanceId→workerId
- Decorator rename and task history key usage updated.
- Old usage:
// OLD @MonkeyCapture({ instanceId: 'abc123' }) class MyWorker { /* ... */ }
- New usage:
Migration steps:
// NEW @MonkeyCapture({ workerId: 'abc123' }) class MyWorker { /* ... */ }
- Replace all
instanceIddecorator option usages withworkerId. - Ensure Worker instances supply
instanceId(internal field) so the decorator receivesworkerIdat runtime. The library now maps the internalinstanceIdto the decorator'sworkerIdautomatically, but ensure any direct references are updated.
- Replace all
TypeScript notes:
- The codebase now uses
as anyin a few places for client/worker instance retrieval to ease compatibility. If you depend on strict typing, update local types or add assertion helpers:const worker = getWorkerInstance() as any; // library side // Your side, prefer: const worker = getWorkerInstance() as WorkerInstance;
Code Examples & Snippets 🧩
Example: New task handler signature and registration
// handler.ts
export async function sendWelcomeEmail({
jobId,
payload,
meta
}: {
jobId: string;
payload: { email: string; name?: string };
meta?: Record<string, any>;
}) {
// clear, destructured parameters
await emailService.send({ to: payload.email, name: payload.name });
// ...
}
// registration
taskManager.register("sendWelcomeEmail", sendWelcomeEmail);Example: MonkeyCapture decorator (new form)
// capture.ts
function MonkeyCapture(options: { workerId?: string }) {
return function (target: any) {
// decorator logic that now relies on options.workerId
// task history keys are generated with workerId
};
}
// usage
@MonkeyCapture({ workerId: "worker-42" })
class Worker { /* ... */ }Example: Worker storing instanceId and passing to MonkeyCapture
class Worker {
private instanceId: string;
constructor(instanceId?: string) {
this.instanceId = instanceId ?? generateId();
// ensure decorator receives workerId
}
handle(job: any) {
const data = this.extractJobData(job);
// ...
}
private extractJobData(job: any) {
// improved handling: supports nested job.data, optional fields
return job?.data ?? job;
}
}Docs: Client-Server Integration snippet (Next.js)
// pages/api/task.ts (Next.js API route)
import { createClient } from 'cleo-client';
export default async function handler(req, res) {
const client = createClient({ url: process.env.CLEO_SERVER_URL });
const response = await client.enqueueTask({ type: 'generate-report', payload: req.body });
res.status(200).json(response);
}Architecture Diagrams (Mermaid) 🗺️
Client ↔ Server workflow (high-level)
flowchart LR
A[Browser Client] -->|HTTP/WS| B[Next.js / Bun App]
B -->|enqueueTask| C[Cleo Client]
C -->|RPC/HTTP| D[Cleo Server / Worker Router]
D --> E[Worker Instances]
E -->|MonkeyCapture| F[Task History / Tracing]
E -->|calls| G[EmailService, PaymentService, Other Integrations]Worker lifecycle & data flow
sequenceDiagram
participant Client
participant Server
participant Worker
participant HistoryDB
Client->>Server: enqueueTask({ type, payload })
Server->>Worker: dispatchJob(job)
Worker->>Worker: extractJobData(job)
Worker->>HistoryDB: MonkeyCapture.store(jobId, workerId, status)
Worker->>Worker: processPayload(payload)
Worker->>HistoryDB: MonkeyCapture.update(jobId, workerId, result)
Worker-->>Server: jobResult
Server-->>Client: responseDeployment Notes & CI Updates 🚀
- The auto-release workflow now has
paths-ignorefor doc and markdown files. If you maintain release automation, ensure your workflow expectations match (docs-only commits will no longer trigger releases). - No runtime server changes required for deployment beyond standard build and restart.
- Recommended deployment steps:
- Pull v1.0.10 tag/release
- Update any code that relied on old task handler signatures or
MonkeyCaptureoptions - Build and run tests:
pnpm install && pnpm build && pnpm test(or your preferred workflow) - Deploy as usual (restart server/scale workers)
- Monitor task traces and logs to validate
workerIdkeys are recorded properly
Performance Impact 📈
- Dev-tooling change (release notes generator model) may improve release-note generation performance and quality (gpt-5-mini).
- Runtime perf: No significant performance regressions expected. The changes to data extraction in Worker should reduce errors and may slightly reduce task processing latency for malformed payloads.
- Type-casting to
as anyhas no runtime performance impact—only affects TypeScript compile-time checking.
New Dependencies 📦
- No new runtime dependencies were introduced in v1.0.10.
- Dev change: release notes generator model string updated (development tool config only).
If you have a dependency graph checker in CI, no runtime package updates are required for this release.
API Changes & Backwards Compatibility 🔁
- Task handler API changed from positional args to a single destructured object. This is a breaking change — see migration steps above.
- MonkeyCapture decorator options rename:
instanceId→workerId. This is breaking if you used the old option key. - Worker class stores
instanceIdinternally now and maps it to the decorator'sworkerId. If code depended on internal properties, audit for naming changes. - Other public APIs remain compatible. Email and Payment services have been refactored to accept destructured params; calls should be updated accordingly (examples above).
Security Advisory 🔒
- There are no identified security vulnerabilities in this release.
- Note: We introduced a few
as anytype casts to smooth TypeScript interop. While harmless at runtime, they reduce type-safety guarantees. We recommend:- Auditing any places that rely on precise runtime types
- Adding additional runtime guard checks where user/third-party input is consumed
- As always, ensure environment variables and secret keys (email/payment) are stored securely and not logged.
Contributors & Acknowledgements 🙏
- Thank you to the maintainers and contributors for this release!
- Maintainers: theboringhumane (repository owner) and project contributors
- Special thanks for documentation updates and CI improvements 🎉
If you contributed code or docs and are not listed here, please open a PR to add your contribution attribution.
Changelog Notes
- This release builds on 1.0.9 changes (auto-release, client-server docs) and introduces internal refactors and signature changes aimed at better ergonomics and clearer tracing.
- Version bumped to 1.0.10 — codename: hungry_maxwell.
If you need a migration helper script or PR diff examples to bulk-update handlers and decorator usages across your codebase, reply and I can generate that for you. 🛠️🐒