Skip to content

Commit be93c12

Browse files
authored
feat: Adds chunk lifecycle support
1 parent 026337d commit be93c12

File tree

22 files changed

+1925
-222
lines changed

22 files changed

+1925
-222
lines changed

.changeset/twenty-toes-laugh.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
"@taskless/loader": patch
3+
---
4+
5+
feat: Refactors for support of chunked event-stream
6+
7+
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.
8+
9+
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.

.eslintignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@ __generated__/*
22
*.config.*
33
next-env.d.ts
44
examples/*
5-
test/fixtures/*
5+
test/fixtures/*
6+
src/vendor/*

.prettierignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,6 @@ __generated__
77
# unformattables
88
*.sh
99
*.cfg
10+
11+
# vendor
12+
vendor

scripts/generate.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,9 @@ import { rimraf } from "rimraf";
1313
const base = process.env.TASKLESS_HOST ?? `${TASKLESS_HOST}`;
1414
const ROOT = (await packageDirectory())!;
1515
const GENERATED = resolve(ROOT, "src/__generated__");
16-
const WASM = resolve(ROOT, "wasm");
1716

1817
await rimraf(GENERATED);
19-
await rimraf(WASM);
20-
2118
await mkdirp(GENERATED);
22-
await mkdirp(WASM);
2319

2420
const prettierOptions = {
2521
...(JSON.parse(

src/__generated__/manifest.ts

Lines changed: 55 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)