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
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ action_plane/typescript/node_modules/
action_plane/typescript/dist/
action_plane/typescript/*.tgz
action_plane/typescript/*.tsbuildinfo
bot_delivery/typescript/node_modules/
bot_delivery/typescript/dist/
bot_delivery/typescript/*.tgz
bot_delivery/typescript/*.tsbuildinfo

# --- OS / editor ---
.DS_Store
Expand Down
18 changes: 15 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,19 +1,21 @@
.PHONY: install build lint typecheck test catalog security-gate smoke db-up db-down db-reset integration openapi-generate openapi-check openapi-breaking-check sdk-generate sdk-check sdk-build sdk-test sdk-pack action-typecheck action-build action-test check
.PHONY: install build lint typecheck test catalog security-gate smoke db-up db-down db-reset integration openapi-generate openapi-check openapi-breaking-check sdk-generate sdk-check sdk-build sdk-test sdk-pack action-typecheck action-build action-test bot-typecheck bot-build bot-test check

install:
uv sync --frozen
npm --prefix sdk/typescript ci --ignore-scripts
npm --prefix action_plane/typescript ci --ignore-scripts
npm --prefix bot_delivery/typescript ci --ignore-scripts

build:
uv build

lint:
uv run ruff check .

typecheck:
typecheck: sdk-build
uv run mypy
npm --prefix action_plane/typescript run typecheck
npm --prefix bot_delivery/typescript run typecheck

test:
uv run pytest -q tests/unit
Expand Down Expand Up @@ -74,4 +76,14 @@ action-test: action-build
npm --prefix action_plane/typescript run test:runtime
npm --prefix action_plane/typescript run test:package

check: build lint typecheck openapi-check sdk-check sdk-build sdk-test sdk-pack action-build action-test test catalog smoke integration security-gate
bot-typecheck:
npm --prefix bot_delivery/typescript run typecheck

bot-build: sdk-build
npm --prefix bot_delivery/typescript run build

bot-test: bot-build
npm --prefix bot_delivery/typescript run test:runtime
npm --prefix bot_delivery/typescript run test:package

check: build lint typecheck openapi-check sdk-check sdk-build sdk-test sdk-pack action-build action-test bot-build bot-test test catalog smoke integration security-gate
1 change: 1 addition & 0 deletions bot_delivery/typescript/.node-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
22.12.0
34 changes: 34 additions & 0 deletions bot_delivery/typescript/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# ContextEngine BotDelivery model egress

This private TypeScript module owns the only active model-generation boundary
for BotDelivery. It accepts a nominal `AuthorizedModelInput` built from exactly
one complete, current, audience-bound `ContextPackage` returned by the generated
resolve SDK, one opaque model `EgressGrant`, and the module-owned
`privateModelGatewayProfileV1()` policy. Callers cannot construct or modify the
registered profile. Before any provider bytes leave, the sealed
`createPrivateModelGenerationBoundary` factory creates and owns the PostgreSQL
client; no public constructor or structural query object can supply authority.
It redeems the grant through the dedicated non-owner, function-only PostgreSQL
egress authority with exact Organization, Package, audience, purpose, Policy Epoch,
provider, model, region, retention, sensitivity, issuer, consumer, and profile
bindings.

Issue #70 activates only `DeterministicModelGatewayTwin`. The twin receives the
authorized Package blocks plus the declared question and instructions—never the
grant, trusted identity, denied details, audit data, or arbitrary extra text. A
successful result is bounded by the versioned profile, cites only Evidence from
that Package, and is recorded in digest-only restricted audit before release.
All binding, replay, provider, output, or audit failures return one generic
unavailable result. Real model providers, streaming, group delivery, and action
effects remain inactive; effects must use `ActionPlane.prepare` and
`ActionPlane.perform`.

Repository verification builds the generated SDK before this package. Run the
`bot-typecheck`, `bot-build`, and `bot-test` Make targets for the standalone
contract, runtime, and installed-package checks. Real PostgreSQL and local API
evidence is exercised by the repository integration suite.

All hashed JSON first passes the same I-JSON Unicode-scalar domain used by the
Python Package digest implementation. A shared fixture proves RFC 8785 Unicode,
UTF-16 property ordering, number serialization, and lone-surrogate rejection
across both runtimes.
14 changes: 14 additions & 0 deletions bot_delivery/typescript/THIRD_PARTY_NOTICES.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Third-party notices

Production dependencies are pinned by `package-lock.json`.

- `canonicalize` 3.0.0 — Apache License 2.0. Used only to encode RFC 8785 JSON
documents before hashing.
- `pg` 8.22.0 and its pinned transitive dependencies — MIT or compatible
licenses. Used by the sealed boundary to reach the dedicated PostgreSQL
egress authority; callers cannot inject a database implementation.
- `@context-engine/resolve-sdk` 0.0.0-v0 — private peer package from this
repository, used only for the frozen public resolve wire types.

Complete third-party license texts are included with installed packages and
their published distributions.
250 changes: 250 additions & 0 deletions bot_delivery/typescript/package-lock.json

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

Loading
Loading