stitchkit 0.76.1 → 0.77.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/dist/agent-runtime-coding-tools.js +1 -2
- package/dist/agent-runtime-harness.js +4 -5
- package/dist/agent-runtime.js +7 -8
- package/dist/application/decisions.d.ts +86 -0
- package/dist/application/decisions.d.ts.map +1 -0
- package/dist/application/kernel.d.ts +33 -1
- package/dist/application/kernel.d.ts.map +1 -1
- package/dist/application/watch-hub.d.ts +1 -1
- package/dist/application/watch-hub.d.ts.map +1 -1
- package/dist/application-schemas.d.ts +15 -0
- package/dist/application-schemas.d.ts.map +1 -0
- package/dist/application-schemas.js +111 -0
- package/dist/application.d.ts +3 -2
- package/dist/application.d.ts.map +1 -1
- package/dist/application.js +184 -114
- package/dist/cli.js +6 -7
- package/dist/contract/index.js +1 -2
- package/dist/{index-v5dm4bwq.js → index-58jzmnn4.js} +1 -1
- package/dist/{index-885chjxq.js → index-7qy2ex0m.js} +1 -1
- package/dist/index-a916km3r.js +45 -0
- package/dist/{index-28jsdwt1.js → index-aczggrty.js} +1 -1
- package/dist/{index-65kathdm.js → index-da1aqnhb.js} +4 -6
- package/dist/{index-xgahrwdf.js → index-ezmn6ac6.js} +3 -3
- package/dist/{index-4kp4fxvp.js → index-f6n5n7nz.js} +18 -4
- package/dist/{index-6wr9f6qm.js → index-jqtsc9mj.js} +2 -2
- package/dist/{index-9c5dbr5q.js → index-k2zczx1g.js} +1 -1
- package/dist/{index-v7xjfy10.js → index-m668wzyc.js} +1 -1
- package/dist/{index-e0a57ymn.js → index-nemjkxjp.js} +1 -1
- package/dist/{index-9my2n66s.js → index-s2rchahr.js} +4 -4
- package/dist/{index-k68e5jz0.js → index-s4c8wy8m.js} +2 -2
- package/dist/{index-52400rdd.js → index-t8qyvrvg.js} +3 -3
- package/dist/{index-endzd8sj.js → index-vbf2p6me.js} +1 -1
- package/dist/{index-hvftzz91.js → index-vc1b0b1b.js} +221 -117
- package/dist/{index-hsz2mmk0.js → index-vj3vvpaa.js} +17 -1
- package/dist/index.js +1 -2
- package/dist/internal/decision.d.ts +31 -0
- package/dist/internal/decision.d.ts.map +1 -0
- package/dist/internal/stable-digest.d.ts +40 -6
- package/dist/internal/stable-digest.d.ts.map +1 -1
- package/dist/live/events.d.ts +8 -13
- package/dist/live/events.d.ts.map +1 -1
- package/dist/live/watch-client.d.ts.map +1 -1
- package/dist/live.d.ts +1 -1
- package/dist/live.d.ts.map +1 -1
- package/dist/live.js +40 -57
- package/dist/node.js +4 -5
- package/dist/observability/index.js +3 -4
- package/dist/primitives.js +1 -2
- package/dist/remote.js +2 -3
- package/dist/server/event-bus.d.ts +3 -2
- package/dist/server/event-bus.d.ts.map +1 -1
- package/dist/server/index.js +5 -6
- package/dist/testing.js +3 -4
- package/dist/tool-invoker.js +5 -6
- package/dist/tools.js +13 -14
- package/llms-full.txt +184 -4
- package/package.json +6 -2
- package/dist/index-rxfy4cq7.js +0 -17
- package/dist/index-vdvmcy7r.js +0 -22
package/llms-full.txt
CHANGED
|
@@ -62,7 +62,7 @@ own, recorded as an ADR.
|
|
|
62
62
|
| `stitchkit/testing` | tests on Bun or Node | stable | in-process generated clients over a real Fetch handler, plus the store and managed-resource conformance kits |
|
|
63
63
|
| `stitchkit/declaration` | build and deployment tooling (Bun or Node) | evolving | `ProjectDeclarationSchema` — the one machine-readable statement a repository makes about itself |
|
|
64
64
|
| `stitchkit/react` | browser | stable | `createCursorQuery`, `createCacheBridge` |
|
|
65
|
-
| `stitchkit/agent-runtime` | server | evolving<br>_redefined in 11 of the
|
|
65
|
+
| `stitchkit/agent-runtime` | server | evolving<br>_redefined in 11 of the 22 minors since 0.56.2, most recently 0.75.0_ | optional durable conversation/run loop, history, models, prompts, fencing and events |
|
|
66
66
|
| `stitchkit/agent-runtime/harness` | server | evolving | resource-aware process-local facade over the canonical Agent runtime; supervision stays outside |
|
|
67
67
|
| `stitchkit/agent-runtime/coding-tools` | server (Bun or Node) | evolving | bounded host-authorized direct file and shell tools; a root boundary, not an OS sandbox |
|
|
68
68
|
| `stitchkit/agent-runtime/openrouter` | server | evolving | isolated OpenRouter language-model adapter |
|
|
@@ -70,9 +70,10 @@ own, recorded as an ADR.
|
|
|
70
70
|
| `stitchkit/agent-runtime/sqlite/bun` | server (Bun) | evolving | durable built-in SQLite store for the agent runtime |
|
|
71
71
|
| `stitchkit/agent-runtime/sqlite/node` | server (Node ≥ 22.5) | evolving | durable built-in SQLite store for the agent runtime |
|
|
72
72
|
| `stitchkit-tui` | terminal (Bun) | evolving | optional official OpenTUI host over a caller-composed headless runtime |
|
|
73
|
-
| `stitchkit/application` | server | evolving<br>_redefined in 4 of the
|
|
73
|
+
| `stitchkit/application` | server | evolving<br>_redefined in 4 of the 22 minors since 0.56.2, most recently 0.72.0_ | managed resource graph, readiness, admission, schedules and bounded shutdown |
|
|
74
74
|
| `stitchkit/application/grammy` | server | evolving | isolated grammY polling and webhook lifecycle adapters |
|
|
75
75
|
| `stitchkit/application/opentelemetry` | server | evolving | maps application snapshots onto an injected OpenTelemetry `Meter` |
|
|
76
|
+
| `stitchkit/application/schemas` | browser + server | evolving | the application's snapshot, health and shutdown schemas with no server runtime behind them |
|
|
76
77
|
|
|
77
78
|
Rule of thumb: browser code imports `stitchkit` and `stitchkit/react`; server
|
|
78
79
|
code adds `stitchkit/server` (or `stitchkit/node` on Node) and opts into
|
|
@@ -5478,6 +5479,105 @@ Every instrument uses unit `1` and reports an absolute current/lifetime value:
|
|
|
5478
5479
|
| `stitchkit.application.schedule.accepting`, `.active`, `.queued`, `.runs_started`, `.runs_completed`, `.runs_failed`, `.ticks_skipped` | current schedule state and absolute run/tick counts |
|
|
5479
5480
|
| `stitchkit.application.activity.active`, `.queued`, `.completed`, `.failed` | absolute stage projections for declared activity sources |
|
|
5480
5481
|
|
|
5482
|
+
## Replacing part of the graph without stopping the process
|
|
5483
|
+
|
|
5484
|
+
`restart` takes down one resource **and everything that depends on it**, then
|
|
5485
|
+
brings that subtree back. Everything else keeps running, and the process epoch
|
|
5486
|
+
does not move.
|
|
5487
|
+
|
|
5488
|
+
```ts
|
|
5489
|
+
const result = await app.restart({ resourceId: 'database' })
|
|
5490
|
+
|
|
5491
|
+
result.outcome // 'restarted' | 'failed' | 'refused'
|
|
5492
|
+
result.affected // ['database', 'repository', 'api'] — in start order
|
|
5493
|
+
```
|
|
5494
|
+
|
|
5495
|
+
The dependants come down with it because they are holding what the resource
|
|
5496
|
+
published. A repository that kept running across a database replacement holds a
|
|
5497
|
+
pool that has been closed: it still typechecks, still has methods, and fails at
|
|
5498
|
+
whatever moment the first call happens. There is no version of this where a
|
|
5499
|
+
dependant keeps a live handle, so the subtree — not the resource — is the unit.
|
|
5500
|
+
|
|
5501
|
+
A leaf restart affects one resource, and an independent neighbour is never
|
|
5502
|
+
touched:
|
|
5503
|
+
|
|
5504
|
+
```ts
|
|
5505
|
+
await app.restart({ resourceId: 'cache' })
|
|
5506
|
+
// mailer and database were not stopped, not started, not activated
|
|
5507
|
+
```
|
|
5508
|
+
|
|
5509
|
+
**Refused is not failed.** An unknown id, a restart during shutdown, and a
|
|
5510
|
+
restart before the application is ready all return `refused` with a reason and
|
|
5511
|
+
touch nothing. `failed` means the subtree came down and the new generation did
|
|
5512
|
+
not come up — the snapshot says so too, with the failing resource marked
|
|
5513
|
+
`failed` / `unhealthy`, because the restart records a failure the same way a
|
|
5514
|
+
startup does.
|
|
5515
|
+
|
|
5516
|
+
Restarts of overlapping subtrees queue behind each other rather than being
|
|
5517
|
+
refused. Two callers asking at once is ordinary; two generations of one resource
|
|
5518
|
+
alive at once is the thing this must make impossible.
|
|
5519
|
+
|
|
5520
|
+
```ts
|
|
5521
|
+
// Both succeed, one complete pass after the other.
|
|
5522
|
+
await Promise.all([
|
|
5523
|
+
app.restart({ resourceId: 'database' }),
|
|
5524
|
+
app.restart({ resourceId: 'database' }),
|
|
5525
|
+
])
|
|
5526
|
+
```
|
|
5527
|
+
|
|
5528
|
+
What a restart is **not** is a process restart: it replaces resources, and does
|
|
5529
|
+
not re-read configuration the kernel captured when it was constructed.
|
|
5530
|
+
|
|
5531
|
+
→ [ADR 0154](../decisions/0154-the-unit-of-a-restart-is-the-subtree.md).
|
|
5532
|
+
|
|
5533
|
+
## Decisions a policy set makes together
|
|
5534
|
+
|
|
5535
|
+
`createDecisionPipeline` runs an ordered list of policies that each vote
|
|
5536
|
+
`allow`, `deny` (with a reason) or `defer`. The first terminal verdict wins and
|
|
5537
|
+
the rest do not run.
|
|
5538
|
+
|
|
5539
|
+
```ts
|
|
5540
|
+
import { createDecisionPipeline } from 'stitchkit/application'
|
|
5541
|
+
|
|
5542
|
+
const pipeline = createDecisionPipeline<{ userId: string; scope: string }>([
|
|
5543
|
+
{ id: 'banned', decide: (r) => (isBanned(r.userId)
|
|
5544
|
+
? { outcome: 'deny', reason: 'account suspended' }
|
|
5545
|
+
: { outcome: 'defer' }) },
|
|
5546
|
+
{ id: 'scope', decide: (r) => (r.scope === 'admin'
|
|
5547
|
+
? { outcome: 'allow' }
|
|
5548
|
+
: { outcome: 'defer' }) },
|
|
5549
|
+
{ id: 'default', decide: () => ({ outcome: 'deny', reason: 'no policy allowed this' }) },
|
|
5550
|
+
])
|
|
5551
|
+
|
|
5552
|
+
const result = await pipeline.decide(request)
|
|
5553
|
+
result.outcome // 'allow' | 'deny' — never 'defer'
|
|
5554
|
+
result.trace // the policies that actually ran, in order
|
|
5555
|
+
```
|
|
5556
|
+
|
|
5557
|
+
Three things are deliberate.
|
|
5558
|
+
|
|
5559
|
+
**A deny carries a reason, by schema.** `{ outcome: 'deny' }` alone does not
|
|
5560
|
+
typecheck. A refusal whose cause exists only in the log of whoever refused is a
|
|
5561
|
+
support ticket.
|
|
5562
|
+
|
|
5563
|
+
**The trace is what ran, not what was declared.** It stops at the terminal
|
|
5564
|
+
verdict. When something was denied the question is which policy denied it and
|
|
5565
|
+
what the ones before it said, and a trace listing policies that never ran would
|
|
5566
|
+
answer that wrongly while looking complete.
|
|
5567
|
+
|
|
5568
|
+
**Every policy deferring raises.** `DecisionUndecidedError`, not a default —
|
|
5569
|
+
defaulting to `allow` turns an incomplete policy set into an open door, and
|
|
5570
|
+
defaulting to `deny` turns it into an outage whose cause reads as a legitimate
|
|
5571
|
+
refusal. A policy that throws or times out denies with the policy named
|
|
5572
|
+
(`DecisionPolicyError`): broken must not mean skipped.
|
|
5573
|
+
|
|
5574
|
+
The same `allow`/`deny`/`defer` type is what an event topic declared
|
|
5575
|
+
`mode: 'decision'` uses in `stitchkit/live` — one vocabulary, because a listener
|
|
5576
|
+
voting on an event and a policy voting on a request are answering the same
|
|
5577
|
+
question.
|
|
5578
|
+
|
|
5579
|
+
→ [ADR 0155](../decisions/0155-one-decision-vocabulary-and-an-unanswered-question-is-an-error.md).
|
|
5580
|
+
|
|
5481
5581
|
## Admission and graceful shutdown
|
|
5482
5582
|
|
|
5483
5583
|
Use the application operation lease for work that is not already counted by a
|
|
@@ -7657,6 +7757,13 @@ Without that, one address changing wakes every watcher of the operation. Twenty
|
|
|
7657
7757
|
conversations open means twenty reads for one change — nineteen of them publish
|
|
7658
7758
|
nothing, because nothing changed, and the read is paid anyway.
|
|
7659
7759
|
|
|
7760
|
+
The digest is a plain 128-bit hash computed in JavaScript, on purpose. It used
|
|
7761
|
+
to be SHA-256 through Web Crypto, which exists **only in a secure context** — so
|
|
7762
|
+
every watched read threw on a page served over plain HTTP from a LAN name, while
|
|
7763
|
+
`localhost` (secure by definition) and every test kept saying the code was fine.
|
|
7764
|
+
The key identifies a question; it does not protect one, and an attacker who can
|
|
7765
|
+
choose your watch arguments can already ask the question directly.
|
|
7766
|
+
|
|
7660
7767
|
### Who shares with whom
|
|
7661
7768
|
|
|
7662
7769
|
A key is `(service, action, digest of arguments)`, and everyone on that key gets
|
|
@@ -9994,6 +10101,29 @@ makes one thing your job rather than the resolver's:
|
|
|
9994
10101
|
The mechanical part is identical either way. Only the *noticing* differs, and an
|
|
9995
10102
|
exact pin moves it onto you.
|
|
9996
10103
|
|
|
10104
|
+
## Released migration: 0.77.0
|
|
10105
|
+
|
|
10106
|
+
Two type renames, and only if you named them. Nothing runtime moved.
|
|
10107
|
+
|
|
10108
|
+
```bash
|
|
10109
|
+
rg -n "EventDecision|EventUndecided" --glob '*.ts' --glob '*.tsx'
|
|
10110
|
+
```
|
|
10111
|
+
|
|
10112
|
+
```ts
|
|
10113
|
+
// before
|
|
10114
|
+
import type { EventDecision, EventUndecided } from 'stitchkit/live'
|
|
10115
|
+
// after
|
|
10116
|
+
import type { PolicyDecision, UndecidedOutcome } from 'stitchkit/live'
|
|
10117
|
+
```
|
|
10118
|
+
|
|
10119
|
+
The shapes are identical — `{ outcome: 'allow' } | { outcome: 'deny', reason } | { outcome: 'defer' }`
|
|
10120
|
+
and `'allow' | 'deny'`. If you only ever *return* decisions from listeners and never named the
|
|
10121
|
+
type, the search above finds nothing and there is nothing to do.
|
|
10122
|
+
|
|
10123
|
+
They were renamed because `createDecisionPipeline` (new in this release) votes with exactly the
|
|
10124
|
+
same three outcomes, and two identical types under two names is the thing that makes a search for
|
|
10125
|
+
either one return half the truth.
|
|
10126
|
+
|
|
9997
10127
|
## Released migration: 0.76.0
|
|
9998
10128
|
|
|
9999
10129
|
One change, and only if you hand `createWatchClient` a transport you wrote yourself.
|
|
@@ -13143,7 +13273,8 @@ realtime contract from `stitchkit`, and the server halves live in `stitchkit/app
|
|
|
13143
13273
|
|--------|------|---------|
|
|
13144
13274
|
| `defineEvents` | function | declare topics: a wire name, one payload schema and how the topic is delivered to in-process listeners |
|
|
13145
13275
|
| `toRealtimeContract` | function | project a declaration onto `RealtimeContract`, so the existing validated socket carries it |
|
|
13146
|
-
| `EventDeliveryMode`
|
|
13276
|
+
| `EventDeliveryMode` | _type_ | `emit` / `serial` / `decision` — how a topic reaches its in-process listeners |
|
|
13277
|
+
| `PolicyDecision` / `UndecidedOutcome` | _types_ | one voter's `allow` / `deny` / `defer`, and what a run settles on when every voter defers — the same two types the decision pipeline in `stitchkit/application` uses, because a listener voting on an event and a policy voting on a request are answering the same question |
|
|
13147
13278
|
| `EventTopicDeclaration` / `EventTopicRegistry` / `EventsConfig` / `EventsDeclaration` | _types_ | one topic's schema, mode, `whenAllDefer` and `listenerTimeoutMs`, and the declaration they compose into |
|
|
13148
13279
|
| `EventPayloads` / `EventTopicsOfMode` / `WireTopic` | _types_ | payload map keyed by wire topic, the topics of one mode, and the `prefix.name` a topic is addressed by |
|
|
13149
13280
|
| `createWatchClient` | function | contract-shaped watch client: `watch.action(args)` returns a ref-counted handle sharing one subscription |
|
|
@@ -13437,7 +13568,11 @@ cutovers are covered by the executable
|
|
|
13437
13568
|
|
|
13438
13569
|
| Export | Kind | Summary |
|
|
13439
13570
|
|--------|------|---------|
|
|
13440
|
-
| `createApplication` | function | compose a validated resource DAG into one
|
|
13571
|
+
| `createApplication` | function | compose a validated resource DAG into one startup, readiness, admission and shutdown state machine |
|
|
13572
|
+
| `ApplicationHandle.restart` | method | replace one resource and everything that depends on it, leaving the rest of the graph running and the process epoch unchanged |
|
|
13573
|
+
| `ApplicationRestartInputSchema` / `ApplicationRestartInput` | schema / _type_ | the resource to replace, by id |
|
|
13574
|
+
| `ApplicationRestartResultSchema` / `ApplicationRestartResult` | schema / _type_ | the subtree that was actually taken down and brought back, in start order, with the outcome, the reason on anything but success, and how long it took |
|
|
13575
|
+
| `ApplicationRestartOutcomeSchema` / `ApplicationRestartOutcome` | schema / _type_ | `restarted`, `failed` or `refused` — a refusal (unknown id, shutting down, not yet ready) is not a failure and touches nothing |
|
|
13441
13576
|
| `ApplicationResourceFailure` | _type_ | one resource failure with the cause its phase label cannot carry — delivered to `onResourceFailure` |
|
|
13442
13577
|
| `ApplicationResourcePhase` | _type_ | the phase a managed resource failed in — the vocabulary of `ApplicationResourceShutdown.failures` |
|
|
13443
13578
|
| `ApplicationShutdownOptionsSchema` / `ApplicationShutdownOptions` | schema / _type_ | the two shutdown budgets and an abort signal — without the HTTP-only `retryAfterSeconds` |
|
|
@@ -13561,6 +13696,10 @@ and `ApplicationEventSinkConfig`.
|
|
|
13561
13696
|
|
|
13562
13697
|
### Canonical application records
|
|
13563
13698
|
|
|
13699
|
+
These are also published on their own as
|
|
13700
|
+
[`stitchkit/application/schemas`](#stitchkitapplicationschemas), which carries
|
|
13701
|
+
no server runtime and can therefore be imported from a browser bundle.
|
|
13702
|
+
|
|
13564
13703
|
The entrypoint exports each Zod schema beside its inferred type:
|
|
13565
13704
|
`ApplicationIdSchema` / `ApplicationId`, `ApplicationLifecycleSchema` /
|
|
13566
13705
|
`ApplicationLifecycle`, `ApplicationHealthSchema` / `ApplicationHealth`,
|
|
@@ -13574,6 +13713,20 @@ the function that derives it from a snapshot,
|
|
|
13574
13713
|
`ApplicationResourceShutdownSchema` / `ApplicationResourceShutdown`, and
|
|
13575
13714
|
`ApplicationShutdownResultSchema` / `ApplicationShutdownResult`.
|
|
13576
13715
|
|
|
13716
|
+
### Decisions
|
|
13717
|
+
|
|
13718
|
+
A pipeline of policies that each vote `allow`, `deny` or `defer`, sharing its
|
|
13719
|
+
vocabulary with an event topic declared `mode: 'decision'`.
|
|
13720
|
+
|
|
13721
|
+
| Export | Kind | Summary |
|
|
13722
|
+
|--------|------|---------|
|
|
13723
|
+
| `createDecisionPipeline` | function | run policies in declaration order; the first terminal verdict wins and the rest do not run |
|
|
13724
|
+
| `PolicyDecisionSchema` / `PolicyDecision` | schema / _type_ | `allow`, `deny` with a reason, or `defer` — a deny cannot be silent |
|
|
13725
|
+
| `DecisionPolicy` / `DecisionPipeline` | _types_ | one named voter over the caller's subject, and the pipeline it composes into |
|
|
13726
|
+
| `DecisionResult` / `DecisionTraceEntry` | _types_ | the verdict, and the trace of what actually ran — not what was declared |
|
|
13727
|
+
| `DecisionUndecidedError` | class | every policy deferred and no undecided outcome was declared: an unanswered question, raised rather than guessed |
|
|
13728
|
+
| `DecisionPolicyError` | class | a policy threw or timed out; the pipeline denies with the policy named |
|
|
13729
|
+
|
|
13577
13730
|
### Keyspace and watched reads
|
|
13578
13731
|
|
|
13579
13732
|
| Export | Kind | Summary |
|
|
@@ -13617,6 +13770,33 @@ snapshots; the adapter owns no SDK lifecycle, polling or delta state.
|
|
|
13617
13770
|
| `ApplicationTelemetryMeter` | _type_ | minimal structural `Meter.createObservableGauge` boundary compatible with `@opentelemetry/api` |
|
|
13618
13771
|
| `ApplicationOpenTelemetryCollectionError` | _type_ | isolated instrument-name/error diagnostic without product/provider attributes |
|
|
13619
13772
|
|
|
13773
|
+
## `stitchkit/application/schemas`
|
|
13774
|
+
|
|
13775
|
+
The canonical application records — and nothing else. Every export here is also
|
|
13776
|
+
reachable from `stitchkit/application`; the difference is what comes with it.
|
|
13777
|
+
|
|
13778
|
+
`stitchkit/application` is the server runtime: it reaches `node:child_process`,
|
|
13779
|
+
`node:fs` and `node:crypto`. A browser bundler does not omit those, it
|
|
13780
|
+
substitutes stubs — so a module that merely *names* an application schema fails
|
|
13781
|
+
while it is initialising, and the page never mounts, on every route rather than
|
|
13782
|
+
the one that wanted the schema. A contract whose `output` is an application
|
|
13783
|
+
snapshot could be declared and never consumed, which is the one thing a contract
|
|
13784
|
+
is for.
|
|
13785
|
+
|
|
13786
|
+
So the same schemas ship a second way, from a module with nothing behind them:
|
|
13787
|
+
|
|
13788
|
+
```ts
|
|
13789
|
+
// browser and server alike
|
|
13790
|
+
import { ApplicationSnapshotSchema } from 'stitchkit/application/schemas';
|
|
13791
|
+
```
|
|
13792
|
+
|
|
13793
|
+
The exports are exactly those listed under
|
|
13794
|
+
[canonical application records](#canonical-application-records) above.
|
|
13795
|
+
`packages/core/scripts/check-browser-clean.mjs` holds the promise against the
|
|
13796
|
+
built artifact: it walks the browser lane's real `dist` output and refuses a
|
|
13797
|
+
`node:` import reachable from any of it, and refuses an entry built for the
|
|
13798
|
+
browser that no `exports` path leads to — which is how this one was missing.
|
|
13799
|
+
|
|
13620
13800
|
---
|
|
13621
13801
|
|
|
13622
13802
|
## `stitchkit/agent-runtime`
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "stitchkit",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.77.0",
|
|
4
4
|
"description": "Contract-first backend framework — one defineContract() into an HTTP API, MCP tools, AI-agent tools and a typed client. Bun and Node.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"bun",
|
|
@@ -129,6 +129,10 @@
|
|
|
129
129
|
"types": "./dist/application-opentelemetry.d.ts",
|
|
130
130
|
"import": "./dist/application-opentelemetry.js"
|
|
131
131
|
},
|
|
132
|
+
"./application/schemas": {
|
|
133
|
+
"types": "./dist/application-schemas.d.ts",
|
|
134
|
+
"import": "./dist/application-schemas.js"
|
|
135
|
+
},
|
|
132
136
|
"./testing": {
|
|
133
137
|
"types": "./dist/testing.d.ts",
|
|
134
138
|
"import": "./dist/testing.js"
|
|
@@ -156,7 +160,7 @@
|
|
|
156
160
|
"scripts": {
|
|
157
161
|
"build:native-contained-files": "node scripts/build-contained-files-native.mjs",
|
|
158
162
|
"check": "bun x tsc --noEmit",
|
|
159
|
-
"build:browser": "bun build src/index.ts src/live.ts src/react.ts src/contract/index.ts src/primitives.ts src/declaration.ts src/agent-runtime-browser.ts --outdir dist --target node --packages external --splitting --root src",
|
|
163
|
+
"build:browser": "bun build src/index.ts src/live.ts src/react.ts src/contract/index.ts src/primitives.ts src/declaration.ts src/application-schemas.ts src/agent-runtime-browser.ts --outdir dist --target node --packages external --splitting --root src",
|
|
160
164
|
"build:server": "bun build src/server/index.ts src/node.ts src/tools.ts src/tool-invoker.ts src/cli.ts src/remote.ts src/files.ts src/testing.ts src/observability/index.ts src/agent-runtime.ts src/agent-runtime-harness.ts src/agent-runtime-coding-tools.ts src/agent-runtime-openrouter.ts src/agent-runtime-sqlite-bun.ts src/agent-runtime-sqlite-node.ts src/application.ts src/application-grammy.ts src/application-opentelemetry.ts src/telegram.ts --outdir dist --target node --packages external --splitting --root src",
|
|
161
165
|
"build:js": "bun run build:browser && bun run build:server && bun scripts/preserve-webpack-ignore.mjs",
|
|
162
166
|
"build:types": "bun x tsc -p tsconfig.build.json --emitDeclarationOnly && bun scripts/rewrite-declaration-specifiers.mjs",
|
package/dist/index-rxfy4cq7.js
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
// src/internal/base64url.ts
|
|
2
|
-
function bytesToBase64Url(bytes) {
|
|
3
|
-
let binary = "";
|
|
4
|
-
for (const byte of bytes)
|
|
5
|
-
binary += String.fromCharCode(byte);
|
|
6
|
-
return btoa(binary).replace(/\+/g, "-").replace(/\//g, "_").replace(/=+$/, "");
|
|
7
|
-
}
|
|
8
|
-
function base64UrlToBytes(segment) {
|
|
9
|
-
if (!/^[A-Za-z0-9_-]*$/.test(segment) || segment.length % 4 === 1) {
|
|
10
|
-
throw new Error("invalid base64url segment");
|
|
11
|
-
}
|
|
12
|
-
const b64 = segment.replace(/-/g, "+").replace(/_/g, "/");
|
|
13
|
-
const padded = b64.padEnd(Math.ceil(b64.length / 4) * 4, "=");
|
|
14
|
-
return Uint8Array.from(atob(padded), (c) => c.charCodeAt(0));
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
export { bytesToBase64Url, base64UrlToBytes };
|
package/dist/index-vdvmcy7r.js
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
bytesToBase64Url
|
|
3
|
-
} from "./index-rxfy4cq7.js";
|
|
4
|
-
|
|
5
|
-
// src/internal/stable-digest.ts
|
|
6
|
-
function stableValue(value) {
|
|
7
|
-
if (Array.isArray(value))
|
|
8
|
-
return value.map(stableValue);
|
|
9
|
-
if (value === null || typeof value !== "object")
|
|
10
|
-
return value;
|
|
11
|
-
const result = {};
|
|
12
|
-
for (const key of Object.keys(value).sort()) {
|
|
13
|
-
result[key] = stableValue(Reflect.get(value, key));
|
|
14
|
-
}
|
|
15
|
-
return result;
|
|
16
|
-
}
|
|
17
|
-
async function argumentsDigest(args) {
|
|
18
|
-
const bytes = new TextEncoder().encode(JSON.stringify(stableValue(args)));
|
|
19
|
-
return bytesToBase64Url(new Uint8Array(await crypto.subtle.digest("SHA-256", bytes)));
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
export { stableValue, argumentsDigest };
|