@warlock.js/context 5.28.0 → 5.29.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/llms-full.txt +8 -8
- package/llms.txt +2 -2
- package/package.json +1 -1
- package/skills/define-context/SKILL.md +2 -2
- package/skills/orchestrate-contexts/SKILL.md +2 -2
- package/skills/overview/SKILL.md +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,12 @@ All notable changes to `@warlock.js/context` are documented in this file.
|
|
|
4
4
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/). `@warlock.js/*` packages are released in lockstep — every package shares the same version number, so a version below may list only the changes that affected this package.
|
|
6
6
|
|
|
7
|
+
## 5.29.0 - 2026-10-01
|
|
8
|
+
|
|
9
|
+
### Changed
|
|
10
|
+
|
|
11
|
+
- Lockstep release; package APIs are unchanged. Skills refer to other topics by name instead of file paths, so cross-references keep working after `agent-kit` copies them into an app.
|
|
12
|
+
|
|
7
13
|
## 5.28.0 - 2026-10-01
|
|
8
14
|
|
|
9
15
|
### Changed
|
package/llms-full.txt
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
---
|
|
10
10
|
name: define-context
|
|
11
|
-
description: 'Extend Context<TStore> to define an AsyncLocalStorage-backed typed context — implement buildStore, use run / enter / update / get / set / getStore / clear / hasContext. Triggers: `Context`, `Context<TStore>`, `buildStore`, `run`, `enter`, `update`, `get`, `set`, `getStore`, `clear`, `hasContext`; "share user/tenant/trace id across async calls", "AsyncLocalStorage typed wrapper", "request-scoped store without thread-through"; typical import `import { Context } from "@warlock.js/context"`. Skip: orchestrating multiple contexts —
|
|
11
|
+
description: 'Extend Context<TStore> to define an AsyncLocalStorage-backed typed context — implement buildStore, use run / enter / update / get / set / getStore / clear / hasContext. Triggers: `Context`, `Context<TStore>`, `buildStore`, `run`, `enter`, `update`, `get`, `set`, `getStore`, `clear`, `hasContext`; "share user/tenant/trace id across async calls", "AsyncLocalStorage typed wrapper", "request-scoped store without thread-through"; typical import `import { Context } from "@warlock.js/context"`. Skip: orchestrating multiple contexts — the `orchestrate-contexts` topic; native `AsyncLocalStorage`, `cls-hooked`, `nest-context`, React Context.'
|
|
12
12
|
---
|
|
13
13
|
|
|
14
14
|
# Define a context
|
|
@@ -158,7 +158,7 @@ Now `tenantContext.tenantId` reads better than `tenantContext.get("tenantId")` a
|
|
|
158
158
|
|
|
159
159
|
## See also
|
|
160
160
|
|
|
161
|
-
-
|
|
161
|
+
- The `orchestrate-contexts` topic — running multiple contexts together via the `contextManager` singleton.
|
|
162
162
|
|
|
163
163
|
## Things NOT to do
|
|
164
164
|
|
|
@@ -172,7 +172,7 @@ Now `tenantContext.tenantId` reads better than `tenantContext.get("tenantId")` a
|
|
|
172
172
|
|
|
173
173
|
---
|
|
174
174
|
name: orchestrate-contexts
|
|
175
|
-
description: 'Orchestrate multiple Context<TStore> instances via the contextManager singleton — register, buildStores, runAll, enterAll, clearAll. Triggers: `contextManager`, `register`, `buildStores`, `runAll`, `enterAll`, `clearAll`, `unregister`, `getContext`, `hasContext`; "run multiple contexts active for the same scope", "register contexts at boot", "avoid nested run() calls for request + database + tenant"; typical import `import { contextManager } from "@warlock.js/context"`. Skip: defining a single context class —
|
|
175
|
+
description: 'Orchestrate multiple Context<TStore> instances via the contextManager singleton — register, buildStores, runAll, enterAll, clearAll. Triggers: `contextManager`, `register`, `buildStores`, `runAll`, `enterAll`, `clearAll`, `unregister`, `getContext`, `hasContext`; "run multiple contexts active for the same scope", "register contexts at boot", "avoid nested run() calls for request + database + tenant"; typical import `import { contextManager } from "@warlock.js/context"`. Skip: defining a single context class — the `define-context` topic; native `AsyncLocalStorage` nesting, `cls-hooked` namespaces.'
|
|
176
176
|
---
|
|
177
177
|
|
|
178
178
|
# Orchestrate contexts — `contextManager`
|
|
@@ -229,7 +229,7 @@ app.use(async (req, res, next) => {
|
|
|
229
229
|
});
|
|
230
230
|
```
|
|
231
231
|
|
|
232
|
-
`buildStores(payload)` calls each registered context's `buildStore(payload)` (the abstract method on `Context<TStore>` — see
|
|
232
|
+
`buildStores(payload)` calls each registered context's `buildStore(payload)` (the abstract method on `Context<TStore>` — see the `define-context` topic) and returns `{ [contextName]: store }`.
|
|
233
233
|
|
|
234
234
|
`runAll(stores, fn)` nests every context's `run()` in registration order, then invokes `fn` at the innermost layer. All contexts are active inside `fn`.
|
|
235
235
|
|
|
@@ -360,7 +360,7 @@ Each `Context<TStore>` subclass declares a typed store shape and what payload bu
|
|
|
360
360
|
|
|
361
361
|
Two task skills cover everything. The first one is the daily-use one; the second is for when you have multiple contexts active at the same time.
|
|
362
362
|
|
|
363
|
-
###
|
|
363
|
+
### `define-context`
|
|
364
364
|
|
|
365
365
|
Extend `Context<TStore>` to declare what your context stores and how it's
|
|
366
366
|
built. Implement `buildStore(payload?)`; use `run` / `enter` / `update` /
|
|
@@ -371,7 +371,7 @@ Load when sharing data (user, tenant, trace id) across async calls
|
|
|
371
371
|
without threading it through every function — i.e. ~90% of the time you
|
|
372
372
|
use this package.
|
|
373
373
|
|
|
374
|
-
###
|
|
374
|
+
### `orchestrate-contexts`
|
|
375
375
|
|
|
376
376
|
Register multiple `Context<TStore>` instances on the `contextManager`
|
|
377
377
|
singleton and run them all together with a single call. Covers
|
|
@@ -400,7 +400,7 @@ Load when several contexts apply to the same scope (request + database
|
|
|
400
400
|
|
|
401
401
|
## See also
|
|
402
402
|
|
|
403
|
-
-
|
|
404
|
-
- `mongez-agent-kit-authoring-skills` (load via agent-kit sync) — how this `overview
|
|
403
|
+
- The `overview` topic of the `warlock-js-core` skill — the parent framework; `context` is one of its foundation packages.
|
|
404
|
+
- `mongez-agent-kit-authoring-skills` (load via agent-kit sync) — how this `overview` topic becomes the front-door skill in `.claude/skills/warlock-js-context-overview/`.
|
|
405
405
|
|
|
406
406
|
|
package/llms.txt
CHANGED
|
@@ -6,6 +6,6 @@
|
|
|
6
6
|
|
|
7
7
|
## Skills
|
|
8
8
|
|
|
9
|
-
- [define-context](@warlock.js/context/define-context/SKILL.md): Extend Context<TStore> to define an AsyncLocalStorage-backed typed context — implement buildStore, use run / enter / update / get / set / getStore / clear / hasContext. Triggers: `Context`, `Context<TStore>`, `buildStore`, `run`, `enter`, `update`, `get`, `set`, `getStore`, `clear`, `hasContext`; "share user/tenant/trace id across async calls", "AsyncLocalStorage typed wrapper", "request-scoped store without thread-through"; typical import `import { Context } from "@warlock.js/context"`. Skip: orchestrating multiple contexts —
|
|
10
|
-
- [orchestrate-contexts](@warlock.js/context/orchestrate-contexts/SKILL.md): Orchestrate multiple Context<TStore> instances via the contextManager singleton — register, buildStores, runAll, enterAll, clearAll. Triggers: `contextManager`, `register`, `buildStores`, `runAll`, `enterAll`, `clearAll`, `unregister`, `getContext`, `hasContext`; "run multiple contexts active for the same scope", "register contexts at boot", "avoid nested run() calls for request + database + tenant"; typical import `import { contextManager } from "@warlock.js/context"`. Skip: defining a single context class —
|
|
9
|
+
- [define-context](@warlock.js/context/define-context/SKILL.md): Extend Context<TStore> to define an AsyncLocalStorage-backed typed context — implement buildStore, use run / enter / update / get / set / getStore / clear / hasContext. Triggers: `Context`, `Context<TStore>`, `buildStore`, `run`, `enter`, `update`, `get`, `set`, `getStore`, `clear`, `hasContext`; "share user/tenant/trace id across async calls", "AsyncLocalStorage typed wrapper", "request-scoped store without thread-through"; typical import `import { Context } from "@warlock.js/context"`. Skip: orchestrating multiple contexts — the `orchestrate-contexts` topic; native `AsyncLocalStorage`, `cls-hooked`, `nest-context`, React Context.
|
|
10
|
+
- [orchestrate-contexts](@warlock.js/context/orchestrate-contexts/SKILL.md): Orchestrate multiple Context<TStore> instances via the contextManager singleton — register, buildStores, runAll, enterAll, clearAll. Triggers: `contextManager`, `register`, `buildStores`, `runAll`, `enterAll`, `clearAll`, `unregister`, `getContext`, `hasContext`; "run multiple contexts active for the same scope", "register contexts at boot", "avoid nested run() calls for request + database + tenant"; typical import `import { contextManager } from "@warlock.js/context"`. Skip: defining a single context class — the `define-context` topic; native `AsyncLocalStorage` nesting, `cls-hooked` namespaces.
|
|
11
11
|
- [overview](@warlock.js/context/overview/SKILL.md): @warlock.js/context overview for orientation and choosing the focused skill for the task.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: define-context
|
|
3
|
-
description: 'Extend Context<TStore> to define an AsyncLocalStorage-backed typed context — implement buildStore, use run / enter / update / get / set / getStore / clear / hasContext. Triggers: `Context`, `Context<TStore>`, `buildStore`, `run`, `enter`, `update`, `get`, `set`, `getStore`, `clear`, `hasContext`; "share user/tenant/trace id across async calls", "AsyncLocalStorage typed wrapper", "request-scoped store without thread-through"; typical import `import { Context } from "@warlock.js/context"`. Skip: orchestrating multiple contexts —
|
|
3
|
+
description: 'Extend Context<TStore> to define an AsyncLocalStorage-backed typed context — implement buildStore, use run / enter / update / get / set / getStore / clear / hasContext. Triggers: `Context`, `Context<TStore>`, `buildStore`, `run`, `enter`, `update`, `get`, `set`, `getStore`, `clear`, `hasContext`; "share user/tenant/trace id across async calls", "AsyncLocalStorage typed wrapper", "request-scoped store without thread-through"; typical import `import { Context } from "@warlock.js/context"`. Skip: orchestrating multiple contexts — the `orchestrate-contexts` topic; native `AsyncLocalStorage`, `cls-hooked`, `nest-context`, React Context.'
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Define a context
|
|
@@ -150,7 +150,7 @@ Now `tenantContext.tenantId` reads better than `tenantContext.get("tenantId")` a
|
|
|
150
150
|
|
|
151
151
|
## See also
|
|
152
152
|
|
|
153
|
-
-
|
|
153
|
+
- The `orchestrate-contexts` topic — running multiple contexts together via the `contextManager` singleton.
|
|
154
154
|
|
|
155
155
|
## Things NOT to do
|
|
156
156
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: orchestrate-contexts
|
|
3
|
-
description: 'Orchestrate multiple Context<TStore> instances via the contextManager singleton — register, buildStores, runAll, enterAll, clearAll. Triggers: `contextManager`, `register`, `buildStores`, `runAll`, `enterAll`, `clearAll`, `unregister`, `getContext`, `hasContext`; "run multiple contexts active for the same scope", "register contexts at boot", "avoid nested run() calls for request + database + tenant"; typical import `import { contextManager } from "@warlock.js/context"`. Skip: defining a single context class —
|
|
3
|
+
description: 'Orchestrate multiple Context<TStore> instances via the contextManager singleton — register, buildStores, runAll, enterAll, clearAll. Triggers: `contextManager`, `register`, `buildStores`, `runAll`, `enterAll`, `clearAll`, `unregister`, `getContext`, `hasContext`; "run multiple contexts active for the same scope", "register contexts at boot", "avoid nested run() calls for request + database + tenant"; typical import `import { contextManager } from "@warlock.js/context"`. Skip: defining a single context class — the `define-context` topic; native `AsyncLocalStorage` nesting, `cls-hooked` namespaces.'
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Orchestrate contexts — `contextManager`
|
|
@@ -57,7 +57,7 @@ app.use(async (req, res, next) => {
|
|
|
57
57
|
});
|
|
58
58
|
```
|
|
59
59
|
|
|
60
|
-
`buildStores(payload)` calls each registered context's `buildStore(payload)` (the abstract method on `Context<TStore>` — see
|
|
60
|
+
`buildStores(payload)` calls each registered context's `buildStore(payload)` (the abstract method on `Context<TStore>` — see the `define-context` topic) and returns `{ [contextName]: store }`.
|
|
61
61
|
|
|
62
62
|
`runAll(stores, fn)` nests every context's `run()` in registration order, then invokes `fn` at the innermost layer. All contexts are active inside `fn`.
|
|
63
63
|
|
package/skills/overview/SKILL.md
CHANGED
|
@@ -23,7 +23,7 @@ Each `Context<TStore>` subclass declares a typed store shape and what payload bu
|
|
|
23
23
|
|
|
24
24
|
Two task skills cover everything. The first one is the daily-use one; the second is for when you have multiple contexts active at the same time.
|
|
25
25
|
|
|
26
|
-
###
|
|
26
|
+
### `define-context`
|
|
27
27
|
|
|
28
28
|
Extend `Context<TStore>` to declare what your context stores and how it's
|
|
29
29
|
built. Implement `buildStore(payload?)`; use `run` / `enter` / `update` /
|
|
@@ -34,7 +34,7 @@ Load when sharing data (user, tenant, trace id) across async calls
|
|
|
34
34
|
without threading it through every function — i.e. ~90% of the time you
|
|
35
35
|
use this package.
|
|
36
36
|
|
|
37
|
-
###
|
|
37
|
+
### `orchestrate-contexts`
|
|
38
38
|
|
|
39
39
|
Register multiple `Context<TStore>` instances on the `contextManager`
|
|
40
40
|
singleton and run them all together with a single call. Covers
|
|
@@ -63,5 +63,5 @@ Load when several contexts apply to the same scope (request + database
|
|
|
63
63
|
|
|
64
64
|
## See also
|
|
65
65
|
|
|
66
|
-
-
|
|
67
|
-
- `mongez-agent-kit-authoring-skills` (load via agent-kit sync) — how this `overview
|
|
66
|
+
- The `overview` topic of the `warlock-js-core` skill — the parent framework; `context` is one of its foundation packages.
|
|
67
|
+
- `mongez-agent-kit-authoring-skills` (load via agent-kit sync) — how this `overview` topic becomes the front-door skill in `.claude/skills/warlock-js-context-overview/`.
|