@sentisec/sdk 0.1.0-rc.6 → 0.1.0-rc.7

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 CHANGED
@@ -4,12 +4,88 @@ All notable changes to this package are documented here.
4
4
  Format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
5
5
  Versioning follows [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6
6
 
7
+ Every dated heading below is a version that exists on the npm registry,
8
+ dated by its registry publish time — except the topmost heading while its
9
+ release run is still in flight, which is dated by its release tag.
10
+ Versions that were prepared but never reached npm are listed under
11
+ **Unreleased** and are not installable.
12
+
7
13
  ---
8
14
 
9
15
  ## [Unreleased]
10
16
 
11
- Closes the endpoint trap S1-FU-05 found on the Python side. A reader
12
- running a local or self-hosted control plane had no way to say so:
17
+ ### 0.1.0 (GA)
18
+
19
+ Not published. The GA version number has never been cut; the general
20
+ availability release is still pending. Everything described in the
21
+ release-candidate entries below shipped under an `-rc.N` version.
22
+
23
+ ### 0.1.0-rc.3
24
+
25
+ Prepared but **never published** — the release run for this version did
26
+ not complete, so npm skips from `0.1.0-rc.2` to `0.1.0-rc.4`. The work
27
+ it carried (the `sentisec` bin wrapper and the zero-dependency
28
+ postinstall CLI fetcher) first reached the registry in `0.1.0-rc.4`, and
29
+ is documented there.
30
+
31
+ ---
32
+
33
+ ## [0.1.0-rc.7] — 2026-09-10
34
+
35
+ **Documentation-only release. No runtime change since `0.1.0-rc.6`** —
36
+ every exported name, call signature, thrown error, default and dependency
37
+ is byte-for-byte what `0.1.0-rc.6` shipped. Upgrading changes nothing you
38
+ can call.
39
+
40
+ ### Changed
41
+
42
+ - **The published TypeScript declarations now describe what the code
43
+ does.** The doc comments that ship inside `dist/*.d.ts` — the text your
44
+ editor shows on hover — carried internal task identifiers, references to
45
+ files in a private repository, and parity claims about a Python package
46
+ that the TypeScript source does not implement. All of it is replaced
47
+ with a plain description of the actual behaviour: what each wrapper
48
+ wraps, what each error means, and which fields it carries.
49
+ - **`README.md`** drops a reference to a path that does not exist in
50
+ anything you can install, and its feature list now matches the source.
51
+
52
+ ### Fixed
53
+
54
+ - **The version history in this file matches the npm registry.**
55
+ `0.1.0-rc.5` had no heading; `0.1.0-rc.6` is now recorded as the
56
+ version-only release it was; `0.1.0-rc.2` had shipped with no entry at
57
+ all; and the entries for `0.1.0` and `0.1.0-rc.3` no longer read as
58
+ though those versions are installable, because neither was ever
59
+ published. An earlier entry also named a hostname the SDK stopped using
60
+ before the first release candidate.
61
+
62
+ ---
63
+
64
+ ## [0.1.0-rc.6] — 2026-08-14
65
+
66
+ **Version-only release. No source changes since `0.1.0-rc.5`** — the
67
+ published tarball is identical in substance; only the version field
68
+ differs.
69
+
70
+ It exists so the npm `latest` dist-tag could move. `latest` had been
71
+ left pointing at `0.1.0-rc.1` (2026-05-07), so `npm install
72
+ @sentisec/sdk` was serving code from before the hosted-plane host change
73
+ (rc.2), the CLI bin wrapper and postinstall fetcher (rc.4), and the
74
+ `endpoint` override (rc.5). npm refuses to re-publish an existing
75
+ version, so graduating the pointer onto current code required a new
76
+ version number to point it at.
77
+
78
+ `latest` now resolves to `0.1.0-rc.6`; the `next` dist-tag resolves to
79
+ `0.1.0-rc.5`.
80
+
81
+ If you are already on `0.1.0-rc.5`, there is nothing here for you.
82
+
83
+ ---
84
+
85
+ ## [0.1.0-rc.5] — 2026-08-02
86
+
87
+ Closes an endpoint trap first found on the Python side. A reader running
88
+ a local or self-hosted control plane had no way to say so:
13
89
  `new Monitor({...})` always resolved to `https://api.sentisec.ch`, and
14
90
  `wrap()` rewrote the client's `baseURL` unconditionally — so their
15
91
  prompts left the machine. Python already had `Monitor(endpoint=...)`;
@@ -48,46 +124,40 @@ exists and the docs stop implying one is unnecessary.
48
124
 
49
125
  ## [0.1.0-rc.4] — 2026-05-17
50
126
 
51
- Routes the CLI binary fetch through the public Cloudflare R2 mirror
52
- at `https://releases.sentisec.ch/cli/` instead of the GitHub Releases
53
- URL directly. Keeps the public-facing scripts free of internal repo
54
- URLs (per `.claude/rules/02-opacity.md`).
55
-
56
- ### Changed
57
-
58
- - `scripts/install-binary.js` — `RELEASES_BASE` defaults to
59
- `https://releases.sentisec.ch/cli`; `SENTISEC_RELEASES_BASE` env
60
- var overrides. Manifest + tarball URL layout flattened to
61
- `/<tag>/<file>` to match the R2 bucket key prefix scheme.
62
-
63
- The CLI tarballs themselves are unchanged — the release-cli.yml
64
- workflow mirrors every cli-v* artifact from GitHub Releases into R2
65
- so this URL stays in sync.
66
-
67
- ---
68
-
69
- ## [0.1.0-rc.3] — 2026-05-17
70
-
71
- Adds the CLI bin wrapper + zero-dep postinstall fetcher (P-INST-04).
127
+ The first release to carry the CLI. Because `0.1.0-rc.3` never reached
128
+ npm, this version delivers **both** the bin wrapper / postinstall
129
+ fetcher prepared for rc.3 **and** the public download-mirror change made
130
+ on top of it. Upgrading from `0.1.0-rc.2` you get all of the following.
72
131
 
73
132
  ### Added
74
133
 
75
134
  - **`bin/sentisec.js`** — ESM shim that execs the platform-native
76
- CLI binary. Resolves the binary via a `PYMINOR` marker file under
77
- `node_modules/@sentisec/sdk/native/<platform>/<arch>/`. Prints
135
+ `sentisec` CLI binary. Resolves the binary via a `PYMINOR` marker file
136
+ under `node_modules/@sentisec/sdk/native/<platform>/<arch>/`. Prints
78
137
  curl / pipx recovery hints when the binary is absent.
79
- - **`scripts/install-binary.js`** — postinstall fetcher (zero deps,
80
- uses `node:https` + `node:crypto` + system `tar`). Downloads the
81
- matching `sentisec-cli-vX-<platform>-py<minor>.tar.gz` from GitHub
82
- Releases, verifies sha256, extracts under
138
+ - **`scripts/install-binary.js`** — postinstall fetcher with zero
139
+ dependencies (`node:https` + `node:crypto` + system `tar`). Downloads
140
+ the matching `sentisec-cli-vX-<platform>-py<minor>.tar.gz`, verifies
141
+ its sha256, and extracts under
83
142
  `node_modules/@sentisec/sdk/native/`. Soft-fails on every
84
- non-security error (CI guard, no python3, unsupported python-minor,
143
+ non-security error (CI guard, no `python3`, unsupported python-minor,
85
144
  manifest 404, network failure, tuple missing) so the SDK remains
86
- installable as a JS library; only sha256 mismatch hard-fails.
87
- - **`"bin": { "sentisec": "./bin/sentisec.js" }`** in package.json
88
- so `npm install -g @sentisec/sdk` puts `sentisec` on PATH.
145
+ installable as a plain JS library; only a sha256 mismatch hard-fails.
146
+ - **`"bin": { "sentisec": "./bin/sentisec.js" }`** in `package.json`, so
147
+ `npm install -g @sentisec/sdk` puts `sentisec` on `PATH`.
89
148
  - Env overrides: `SENTISEC_SKIP_POSTINSTALL`,
90
- `SENTISEC_NPM_FETCH_IN_CI`, `SENTISEC_CLI_VERSION_OVERRIDE`.
149
+ `SENTISEC_NPM_FETCH_IN_CI`, `SENTISEC_CLI_VERSION_OVERRIDE`,
150
+ `SENTISEC_RELEASES_BASE`.
151
+
152
+ ### Changed
153
+
154
+ - The CLI download now goes through the public release mirror at
155
+ `https://releases.sentisec.ch/cli` (`RELEASES_BASE` in
156
+ `scripts/install-binary.js`), overridable with
157
+ `SENTISEC_RELEASES_BASE`. Manifest and tarball URLs use a flat
158
+ `/<tag>/<file>` layout to match the mirror's key prefixes. The CLI
159
+ tarballs themselves are unchanged — every published CLI artifact is
160
+ mirrored to that host, so the URL stays in sync.
91
161
 
92
162
  ### Supports
93
163
 
@@ -96,63 +166,78 @@ Adds the CLI bin wrapper + zero-dep postinstall fetcher (P-INST-04).
96
166
 
97
167
  ---
98
168
 
99
- ## [0.1.0] — 2026-04-22
169
+ ## [0.1.0-rc.2] — 2026-05-12
170
+
171
+ Points the SDK at the hosted plane's current address. Published
172
+ alongside the control-plane release that moved the ingress hostname.
173
+
174
+ ### Changed
175
+
176
+ - The default rewrite target for `wrap()` is now
177
+ `https://api.sentisec.ch/ws/<workspace>/v1`. `0.1.0-rc.1` shipped the
178
+ retired `ingress.sentisec.ch` host, which no longer answers — **any
179
+ installation still on `0.1.0-rc.1` must upgrade**, or pass an explicit
180
+ `wrap(client, { baseUrl })`.
181
+ - `DEFAULT_INGRESS_TEMPLATE` (exported) and the OpenAI / Anthropic wrap
182
+ docstrings updated to the same host. No API shape changed; this is a
183
+ destination change only.
184
+
185
+ ---
186
+
187
+ ## [0.1.0-rc.1] — 2026-05-07
100
188
 
101
- First public release of `@sentisec/sdk`. Ships the full Phase-1.5 TS SDK:
189
+ First release of `@sentisec/sdk` on npm. Ships the full TypeScript SDK:
102
190
  Monitor + OpenAI wrap + Anthropic wrap + SSE streaming adapter.
103
191
 
192
+ > Superseded. The hosted-plane host it rewrites to was retired in
193
+ > `0.1.0-rc.2`; install `0.1.0-rc.6` (the `latest` tag) instead.
194
+
104
195
  ### Added
105
196
 
106
- - **`Monitor`** — configuration object; validates policy id against built-in
107
- registry (`research_agent`, `customer_support`, `coding_agent`) and `.yaml`
108
- path shape. Throws `UnknownPolicyError` for unrecognised ids.
109
- - **`Monitor.wrap(client)`** — polymorphic vendor-dispatch:
110
- - **OpenAI** (`wrap-openai.ts`, T-151): rewrites `baseURL` to
111
- `https://ingress.sentisec.ch/ws/<workspace>/v1`, injects
112
- `x-sentisec-session-id` header, translates proxy HALT body to
197
+ - **`Monitor`** — configuration object; validates the policy id against
198
+ the built-in registry (`research_agent`, `customer_support`,
199
+ `coding_agent`) and the `.yaml` bundle-path shape. Throws
200
+ `UnknownPolicyError` for anything else.
201
+ - **`Monitor.prototype.wrap(client)`** — polymorphic vendor dispatch:
202
+ - **OpenAI** (`wrap-openai.ts`): rewrites `baseURL` to the
203
+ workspace-scoped Sentisec path, injects an `x-sentisec-session-id`
204
+ header, and translates a HALT response body into
113
205
  `SentisecHijackError`.
114
- - **Anthropic** (`wrap-anthropic.ts`, T-152): same URL/header
115
- rewrite; translates HALT body to a synthetic `tool_use` content
116
- block (`sentisec_block`) by default. Opt-in exception surface via
206
+ - **Anthropic** (`wrap-anthropic.ts`): same URL and header rewrite;
207
+ translates a HALT body into a synthetic `tool_use` content block
208
+ (`sentisec_block`) by default. Opt-in exception surface via
117
209
  `{ onBlock: "throw" }` → `SentisecAnthropicBlockError`.
118
- - **`wrapOpenAIStream` / `wrapAnthropicStream`** — SSE streaming adapters
119
- (`streaming.ts`, T-153):
210
+ - **`wrapOpenAIStream` / `wrapAnthropicStream`** — SSE streaming
211
+ adapters (`streaming.ts`):
120
212
  - Consume `fetch` + `ReadableStream`; browser-compatible and
121
213
  Node-compatible (Node 20+ built-in fetch).
122
- - `AsyncIterator<OpenAIStreamChunk>` / `AsyncIterator<AnthropicStreamEvent>`.
123
- - Attaches `sentisec: {verdict, session_id}` to the final clean-exit chunk.
124
- - Mid-stream HALT: yields a synthetic HALT sentinel and terminates.
125
- - `AbortSignal` support: abort mid-stream yields a `session_closed`
214
+ - `AsyncIterator<OpenAIStreamChunk>` /
215
+ `AsyncIterator<AnthropicStreamEvent>`.
216
+ - Attach `sentisec: {verdict, session_id}` to the final clean-exit
217
+ chunk.
218
+ - Mid-stream HALT: yield a synthetic HALT sentinel and terminate.
219
+ - `AbortSignal` support: aborting mid-stream yields a `session_closed`
126
220
  sentinel and stops iteration.
127
221
  - **Error surface** (pinned at `sdk_error_surface_version: v1.0-phase1`):
128
- - `SentisecError` (base)
129
- - `UnknownPolicyError`
130
- - `VerifierBackendNotConfigured`
131
- - `TaskTamperError`
132
- - `SentisecHijackError` (OpenAI HALT)
133
- - `SentisecAnthropicBlockError` (Anthropic HALT opt-in)
222
+ `SentisecError` (base), `UnknownPolicyError`,
223
+ `VerifierBackendNotConfigured`, `TaskTamperError`,
224
+ `SentisecHijackError` (OpenAI HALT), `SentisecAnthropicBlockError`
225
+ (Anthropic HALT, opt-in).
134
226
  - **Type exports**: `ResponsePolicy`, `SessionStatus`, `BuiltinPolicy`,
135
227
  `MonitorConfig`, `OpenAILike`, `AnthropicLike`, `WrapOptions`,
136
228
  `OpenAIStreamChunk`, `AnthropicStreamEvent`, `Verdict`, `VerdictValue`,
137
229
  `StreamOptions`, `StreamCloseReason`, and the full Anthropic
138
230
  message-shape family.
139
- - **Apache-2.0 license** (Sentisec defensive-patent posture; ADR D-007).
140
- - **Dual CJS/ESM exports**: `dist/index.js` (ESM) + `dist/index.cjs` (CJS)
141
- + `dist/index.d.ts` types.
142
- - **SLSA provenance attestation** via `.github/workflows/publish-sdk.yml`
143
- (manual-trigger, `npm publish --provenance`).
144
-
145
- ### Implementation cards
146
-
147
- T-150 (scaffold), T-151 (OpenAI wrap), T-152 (Anthropic wrap),
148
- T-153 (streaming adapter), T-154 (publish prep + dry-run).
149
-
150
- ---
231
+ - **Apache-2.0 license.**
232
+ - **Dual CJS/ESM exports**: `dist/index.js` (ESM) + `dist/index.cjs`
233
+ (CJS) + `dist/index.d.ts` types.
151
234
 
152
- ## [0.1.0-rc.1] — 2026-04-22
235
+ ### Known limitations in this release
153
236
 
154
- Release candidate. Functionally identical to `0.1.0`; published to npm
155
- for final integration check before the GA tag.
237
+ - `Monitor.prototype.session()` and `Session.wrap()` are unimplemented
238
+ placeholders and throw when called. The supported entry point is
239
+ `Monitor.prototype.wrap(client)`. They remain unimplemented in every
240
+ version published so far and are slated for removal.
156
241
 
157
242
  ---
158
243
 
package/README.md CHANGED
@@ -44,8 +44,8 @@ Resolution order, highest first:
44
44
  export SENTISEC_ENDPOINT=http://localhost:8080
45
45
  ```
46
46
 
47
- Identical field, identical precedence, identical failure mode as the
48
- Python SDK's `Monitor(endpoint=...)`.
47
+ The Python SDK also supports `SENTISEC_ENDPOINT`, but resolves saved
48
+ credentials and uses different proxy paths; see the feature table below.
49
49
 
50
50
  **`wrap()` replaces your client's `baseURL`.** That is what the wrapper
51
51
  is for — traffic has to go through Sentisec to be gated. But if your
@@ -253,11 +253,22 @@ const monitor = new Monitor({
253
253
 
254
254
  ---
255
255
 
256
- ## Python parity
256
+ ## Features and Python SDK differences
257
257
 
258
- Every public symbol in this package has a 1:1 counterpart in
259
- `platform/sentisec/sdk/`. The error-surface is a cross-language contract
260
- pinned at `sdk_error_surface_version: v1.0-phase1`.
258
+ The TypeScript SDK and the Python package `sentisec-sdk` expose different
259
+ APIs. Choose the integration for your language; they are not drop-in
260
+ replacements for each other.
261
+
262
+ | Feature | TypeScript (`@sentisec/sdk`) | Python (`sentisec-sdk`) |
263
+ |---|---|---|
264
+ | Provider wrappers | `monitor.wrap(client)` dispatches to OpenAI or Anthropic and returns the same client. | `monitor.wrap_openai(client)` and `monitor.wrap_anthropic(client)` return the same client. |
265
+ | Proxy destination | Appends `/ws/<customerId>/v1` to the endpoint host; `wrap(client, { baseUrl })` overrides the complete URL. | Appends `/v1/proxy/openai` or `/v1/proxy/anthropic` to the endpoint host. |
266
+ | Configuration | `apiKey`, `model` and `task` are required constructor fields; `customerId` defaults to `cust_local`. Endpoint precedence is wrap override, constructor, environment, hosted default. | Resolves credentials from explicit arguments, environment and saved profiles; the endpoint falls back to the hosted default. |
267
+ | Response handling | OpenAI HALT responses raise `SentisecHijackError`. Anthropic returns a synthetic block tool-use response by default, or raises `SentisecAnthropicBlockError` with `onBlock: "throw"`. | Thin wrappers rewrite the destination and API key; response handling remains with the provider client. |
268
+ | Streaming | Separate `wrapOpenAIStream` and `wrapAnthropicStream` helpers expose verdict metadata and AbortSignal support. | Thin wrappers leave the provider client's streaming interface in place; no matching Sentisec streaming helpers are exported. |
269
+ | Session lifecycle and forensic export | `Monitor.session()`, `Session.wrap()` and `Session.exportForensicBundle()` are reserved methods that currently throw. Use `Monitor.wrap()` for provider calls. | Exports a frozen `Session` record; `Monitor` has no session lifecycle or forensic export methods. |
270
+
271
+ Matching type names do not imply feature parity between the distributions.
261
272
 
262
273
  ---
263
274
 
package/dist/index.cjs CHANGED
@@ -713,11 +713,8 @@ var Session = class {
713
713
  this.status = "ACTIVE";
714
714
  }
715
715
  /**
716
- * Wrap a provider SDK client so every request/response is monitored.
717
- *
718
- * T-151 (OpenAI) and T-152 (Anthropic) fill this in. Calling it at
719
- * T-150 throws so downstream code can't accidentally ship against
720
- * a silently-passthrough stub.
716
+ * Reserved provider wrapper; currently throws. Use `Monitor.wrap()`
717
+ * instead.
721
718
  */
722
719
  wrap(_client) {
723
720
  throw new Error(
@@ -725,8 +722,7 @@ var Session = class {
725
722
  );
726
723
  }
727
724
  /**
728
- * Emit the hash-chained forensic bundle for this session. Lands with
729
- * T-153 alongside the Python `export_forensic_bundle` parity work.
725
+ * Reserved forensic export method; currently throws.
730
726
  */
731
727
  exportForensicBundle() {
732
728
  throw new Error(
@@ -764,12 +760,8 @@ var Monitor = class {
764
760
  );
765
761
  }
766
762
  /**
767
- * Start a new monitored session.
768
- *
769
- * T-153 fills in the sha256 task-hash computation + `_checkTaskIntegrity`
770
- * parity. T-150 throws a `NotImplementedError`-shaped exception so
771
- * accidental usage during wave-2 development does not silently
772
- * produce a session with an empty hash.
763
+ * Reserved session lifecycle method; currently throws.
764
+ * Use `Monitor.wrap()` to configure a provider client.
773
765
  */
774
766
  session() {
775
767
  throw new Error(