Skip to main content

Typesafe Batch

@webframp/typesafe-batchv2026.11.10.1· Apache-2.0· 11d agoEXTENDS
01README

Bounded batch triage for @swamp/typesafe-ai. Adds one method, triage_batch, that evaluates many compact {id, state} items against one shared set of typed questions (noul, choice, score) while holding the model lock once. It writes a single triage-batch-<name> resource with each item's answers, a SHA-256 fingerprint of the input, aggregate token usage, and one failure record per item that could not be evaluated. Raw item state and question text are never stored.

Authentication

Uses the @swamp/typesafe-ai global arguments. Store the API key in a vault and wire apiKey with a vault.get expression. The TYPESAFE_API_KEY environment variable is read as a fallback, but it is not redacted and is not recommended.

Quick Start

swamp extension pull @webframp/typesafe-batch
swamp vault create local_encryption typesafe   # once, if you have no vault yet
swamp vault put typesafe API_KEY   # prompts for the key
swamp model create @swamp/typesafe-ai jev \
  --global-arg 'apiKey=${{ vault.get("typesafe", "API_KEY") }}'
swamp model method run jev triage_batch --input-file batch.yaml
swamp data get jev triage-batch-latest --json
02Release Notes

2026.11.10.1

Changed: Bump @swamp/typesafe-ai 2026.09.15.1 → 2026.10.23.1

2026.11.03.1

Changed: Bump zod 4.6.5 → 4.6.7

2026.10.21.1

Changed: The README, manifest and missing-key error now lead with the vault: store the key with swamp vault put typesafe API_KEY and wire apiKey with ${{ vault.get("typesafe", "API_KEY") }}. The manifest Quick Start previously created the model with no key at all. The TYPESAFE_API_KEY environment variable still works as a fallback, but is described as discouraged because swamp does not redact it.

Changed: The manifest Quick Start creates the vault first with swamp vault create local_encryption <name> (a once-only step for a repo with no vault yet), so it works in a fresh repo.

Upgrade note: No behavioral or schema changes. Only documentation and error message text changed.

03Extends1
@swamp/typesafe-aitriage_batch.ts
fn triage_batch(items: array, name?: string, concurrency?: number, model?: string)
Evaluate compact queue items with shared typed questions, returning one source-scoped batch and isolating individual failures
ArgumentTypeDescription
itemsarray
name?string
concurrency?number
model?string

Resources

triageBatch(infinite)— One source-scoped batch of TypeSafe triage answers; raw caller state is never retained
04Previous Versions4
2026.11.03.1Apache-2.0

2026.11.03.1

Changed: Bump zod 4.6.5 → 4.6.7

2026.10.21.1

Changed: The README, manifest and missing-key error now lead with the vault: store the key with swamp vault put typesafe API_KEY and wire apiKey with ${{ vault.get("typesafe", "API_KEY") }}. The manifest Quick Start previously created the model with no key at all. The TYPESAFE_API_KEY environment variable still works as a fallback, but is described as discouraged because swamp does not redact it.

Changed: The manifest Quick Start creates the vault first with swamp vault create local_encryption <name> (a once-only step for a repo with no vault yet), so it works in a fresh repo.

Upgrade note: No behavioral or schema changes. Only documentation and error message text changed.

2026.10.21.1Apache-2.0

2026.10.21.1

Changed: The README, manifest and missing-key error now lead with the vault: store the key with swamp vault put typesafe API_KEY and wire apiKey with ${{ vault.get("typesafe", "API_KEY") }}. The manifest Quick Start previously created the model with no key at all. The TYPESAFE_API_KEY environment variable still works as a fallback, but is described as discouraged because swamp does not redact it.

Changed: The manifest Quick Start creates the vault first with swamp vault create local_encryption <name> (a once-only step for a repo with no vault yet), so it works in a fresh repo.

Upgrade note: No behavioral or schema changes. Only documentation and error message text changed.

2026.10.14.1Apache-2.0(was none)

2026.10.14.1

Added: The manifest now declares license: Apache-2.0 (SPDX). The registry quality rubric scores a declared license separately from the bundled LICENSE.md.

Upgrade note: Metadata only. No code, schema, or behavioral changes.

2026.09.26.1

Added: triage_batch, an extension method on @swamp/typesafe-ai, moved here from @webframp/operator-briefing 2026.09.25.1 so packages other than the briefing can depend on it. The method name, arguments, and the triageBatch resource (triage-batch-<name>) are the same, so existing workflows and stored batches keep working. The only behavior change is the request User-Agent, now webframp-typesafe-batch/1.

2026.09.26.1

2026.09.26.1

Added: triage_batch, an extension method on @swamp/typesafe-ai, moved here from @webframp/operator-briefing 2026.09.25.1 so packages other than the briefing can depend on it. The method name, arguments, and the triageBatch resource (triage-batch-<name>) are the same, so existing workflows and stored batches keep working. The only behavior change is the request User-Agent, now webframp-typesafe-batch/1.

05Stats
A
100 / 100
Downloads
1,034
Archive size
13.7 KB
  • Has README or module doc2/2earned
  • README has a code example1/1earned
  • README is substantive1/1earned
  • Most symbols documented1/1earned
  • No slow types (deprecated)1/1earned
  • Dependencies pass trust audit2/2earned
  • Docs keep secrets in a vault1/1earned
  • Has description1/1earned
  • Platform support declared (or universal)2/2earned
  • License2/2earned
  • Verified public repository2/2earned
06Platforms
07Labels