Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .changeset/twenty-toes-laugh.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
"@taskless/loader": patch
---

feat: Refactors for support of chunked event-stream

Previously Taskless Loader only knew of "pre" and "post" lifecycle events. This loader change introduces a new "chunk" event that allows for control over readable stream segments such as those used in event-streams. This is useful for Packs that want to process data in chunks rather than waiting for the entire response such as an MCP integration.

This change is backwards compatible with existing Packs and the current `pre2` schema. To enable chunk processing, a new `methods` field is added to the `pre2` manifest. Valid options for "methods" are `pre`, `post`, and `chunk`. If a Pack does not declare `chunk` in its manifest, it will continue to function as before, processing the entire response in one go with the standard `pre` and `post` lifecycle events.
3 changes: 2 additions & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ __generated__/*
*.config.*
next-env.d.ts
examples/*
test/fixtures/*
test/fixtures/*
src/vendor/*
3 changes: 3 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,6 @@ __generated__
# unformattables
*.sh
*.cfg

# vendor
vendor
4 changes: 0 additions & 4 deletions scripts/generate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,9 @@ import { rimraf } from "rimraf";
const base = process.env.TASKLESS_HOST ?? `${TASKLESS_HOST}`;
const ROOT = (await packageDirectory())!;
const GENERATED = resolve(ROOT, "src/__generated__");
const WASM = resolve(ROOT, "wasm");

await rimraf(GENERATED);
await rimraf(WASM);

await mkdirp(GENERATED);
await mkdirp(WASM);

const prettierOptions = {
...(JSON.parse(
Expand Down
57 changes: 55 additions & 2 deletions src/__generated__/manifest.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading