@anybio/govern 0.2.1 → 0.2.2

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
@@ -2,6 +2,10 @@
2
2
 
3
3
  All notable changes to `@anybio/govern` are recorded here. The format follows Keep a Changelog; versions follow Semantic Versioning. Until 1.0.0, a minor version may change the public surface.
4
4
 
5
+ ## 0.2.2
6
+
7
+ No change to the SDK. Built and published from github.com/anybio/govern-js with a provenance statement.
8
+
5
9
  ## 0.2.1
6
10
 
7
11
  First public release.
package/dist/cli.js CHANGED
@@ -3,7 +3,7 @@ import { existsSync, readFileSync, mkdirSync, writeFileSync, appendFileSync } fr
3
3
  import { resolve, join } from 'path';
4
4
 
5
5
  // src/version.ts
6
- var SDK_VERSION = "0.2.1";
6
+ var SDK_VERSION = "0.2.2";
7
7
  var SDK_NAME = "@anybio/govern";
8
8
 
9
9
  // src/cli/detect.ts
package/dist/index.cjs CHANGED
@@ -145,7 +145,7 @@ function randomId() {
145
145
  }
146
146
 
147
147
  // src/version.ts
148
- var SDK_VERSION = "0.2.1";
148
+ var SDK_VERSION = "0.2.2";
149
149
  var SDK_NAME = "@anybio/govern";
150
150
 
151
151
  // src/http.ts
package/dist/index.d.cts CHANGED
@@ -91,7 +91,7 @@ declare function isGovernError(error: unknown): error is GovernError;
91
91
  /** SHA-256 over the UTF-8 bytes of `text`, lowercase hex. The outcome hash the API expects. */
92
92
  declare function sha256Hex(text: string): Promise<string>;
93
93
 
94
- declare const SDK_VERSION = "0.2.1";
94
+ declare const SDK_VERSION = "0.2.2";
95
95
  declare const SDK_NAME = "@anybio/govern";
96
96
 
97
97
  export { GovernAbortError, GovernApiError, GovernConfigError, GovernConflictError, GovernError, GovernNetworkError, GovernNotAvailableError, GovernTimeoutError, GovernWebhookError, SDK_NAME, SDK_VERSION, isGovernError, sha256Hex };
package/dist/index.d.ts CHANGED
@@ -91,7 +91,7 @@ declare function isGovernError(error: unknown): error is GovernError;
91
91
  /** SHA-256 over the UTF-8 bytes of `text`, lowercase hex. The outcome hash the API expects. */
92
92
  declare function sha256Hex(text: string): Promise<string>;
93
93
 
94
- declare const SDK_VERSION = "0.2.1";
94
+ declare const SDK_VERSION = "0.2.2";
95
95
  declare const SDK_NAME = "@anybio/govern";
96
96
 
97
97
  export { GovernAbortError, GovernApiError, GovernConfigError, GovernConflictError, GovernError, GovernNetworkError, GovernNotAvailableError, GovernTimeoutError, GovernWebhookError, SDK_NAME, SDK_VERSION, isGovernError, sha256Hex };
package/dist/index.js CHANGED
@@ -143,7 +143,7 @@ function randomId() {
143
143
  }
144
144
 
145
145
  // src/version.ts
146
- var SDK_VERSION = "0.2.1";
146
+ var SDK_VERSION = "0.2.2";
147
147
  var SDK_NAME = "@anybio/govern";
148
148
 
149
149
  // src/http.ts
@@ -145,7 +145,7 @@ function randomId() {
145
145
  }
146
146
 
147
147
  // src/version.ts
148
- var SDK_VERSION = "0.2.1";
148
+ var SDK_VERSION = "0.2.2";
149
149
  var SDK_NAME = "@anybio/govern";
150
150
 
151
151
  // src/http.ts
package/dist/langchain.js CHANGED
@@ -143,7 +143,7 @@ function randomId() {
143
143
  }
144
144
 
145
145
  // src/version.ts
146
- var SDK_VERSION = "0.2.1";
146
+ var SDK_VERSION = "0.2.2";
147
147
  var SDK_NAME = "@anybio/govern";
148
148
 
149
149
  // src/http.ts
@@ -139,7 +139,7 @@ function randomId() {
139
139
  }
140
140
 
141
141
  // src/version.ts
142
- var SDK_VERSION = "0.2.1";
142
+ var SDK_VERSION = "0.2.2";
143
143
  var SDK_NAME = "@anybio/govern";
144
144
 
145
145
  // src/http.ts
package/dist/vercel-ai.js CHANGED
@@ -137,7 +137,7 @@ function randomId() {
137
137
  }
138
138
 
139
139
  // src/version.ts
140
- var SDK_VERSION = "0.2.1";
140
+ var SDK_VERSION = "0.2.2";
141
141
  var SDK_NAME = "@anybio/govern";
142
142
 
143
143
  // src/http.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@anybio/govern",
3
- "version": "0.2.1",
3
+ "version": "0.2.2",
4
4
  "license": "Apache-2.0",
5
5
  "description": "AnyBio Govern SDK for JavaScript and TypeScript: one server-side call between the text your AI produced and the moment it reaches a patient. Evaluate, allow, hold, block; observe first, then enforce.",
6
6
  "keywords": [
@@ -22,22 +22,22 @@
22
22
  "type": "git",
23
23
  "url": "git+https://github.com/anybio/govern-js.git"
24
24
  },
25
+ "bugs": {
26
+ "url": "https://github.com/anybio/govern-js/issues"
27
+ },
25
28
  "type": "module",
26
29
  "sideEffects": false,
27
30
  "engines": {
28
31
  "node": ">=20"
29
32
  },
33
+ "packageManager": "pnpm@9.15.9",
30
34
  "main": "./dist/index.cjs",
31
35
  "module": "./dist/index.js",
32
36
  "types": "./dist/index.d.cts",
33
37
  "typesVersions": {
34
38
  "*": {
35
- "vercel-ai": [
36
- "./dist/vercel-ai.d.cts"
37
- ],
38
- "langchain": [
39
- "./dist/langchain.d.cts"
40
- ]
39
+ "vercel-ai": ["./dist/vercel-ai.d.cts"],
40
+ "langchain": ["./dist/langchain.d.cts"]
41
41
  }
42
42
  },
43
43
  "exports": {
@@ -84,6 +84,20 @@
84
84
  "LICENSE",
85
85
  "NOTICE"
86
86
  ],
87
+ "scripts": {
88
+ "build": "tsup",
89
+ "dev": "tsup --watch",
90
+ "clean": "rm -rf dist coverage",
91
+ "typecheck": "tsc --noEmit -p tsconfig.json",
92
+ "lint": "eslint .",
93
+ "test": "vitest run",
94
+ "test:watch": "vitest",
95
+ "generate:types": "node scripts/generate-types.mjs",
96
+ "spec:extract": "node scripts/extract-govern-openapi.mjs",
97
+ "check:package": "node scripts/check-package.mjs",
98
+ "check": "pnpm lint && pnpm typecheck && pnpm test && pnpm build && pnpm check:package",
99
+ "prepublishOnly": "pnpm check"
100
+ },
87
101
  "peerDependencies": {
88
102
  "@langchain/core": "^1.0.0",
89
103
  "ai": "^7.0.0"
@@ -111,18 +125,5 @@
111
125
  },
112
126
  "publishConfig": {
113
127
  "access": "public"
114
- },
115
- "scripts": {
116
- "build": "tsup",
117
- "dev": "tsup --watch",
118
- "clean": "rm -rf dist coverage",
119
- "typecheck": "tsc --noEmit -p tsconfig.json",
120
- "lint": "eslint .",
121
- "test": "vitest run",
122
- "test:watch": "vitest",
123
- "generate:types": "node scripts/generate-types.mjs",
124
- "spec:extract": "node scripts/extract-govern-openapi.mjs",
125
- "check:package": "node scripts/check-package.mjs",
126
- "check": "pnpm lint && pnpm typecheck && pnpm test && pnpm build && pnpm check:package"
127
128
  }
128
- }
129
+ }
package/spec/README.md ADDED
@@ -0,0 +1,17 @@
1
+ # spec/
2
+
3
+ `openapi.json` is the Govern surface of the AnyBio API: every path under `/api/v1/govern/` and the schemas they reference. Generated from the AnyBio Govern API specification, 2026-09-26.
4
+
5
+ - `pnpm generate:types` writes `src/generated/openapi.ts` from it.
6
+ - `test/spec.test.ts` fails when the committed types differ from what the document generates, checks that every route `Govern` calls exists in the document, and holds the reason codes in `src/types.ts` to the API's set.
7
+ - `scripts/extract-govern-openapi.mjs` produces the document from the full API specification, sorted so an unchanged regeneration has no diff, and passes every description through `scripts/lib/sanitize-openapi.mjs`. Re-running it on `openapi.json` itself re-applies that step.
8
+
9
+ ## What is not in the document
10
+
11
+ Three caller-visible rules are enforced by the API and are not expressible in OpenAPI. They are in the README, and the SDK checks the first two before it sends:
12
+
13
+ - `turn_id` and `Idempotency-Key` may not start with `govern:`, which is reserved for the rows the API writes.
14
+ - `conversation_id` is at most 187 characters and `turn_id` at most 206.
15
+ - A presented `disclosure.ref` that is not the conversation's own reference is ignored, never refused.
16
+
17
+ The reason codes do not appear in the document either; `REASONS` in `src/types.ts` lists them.