@anybio/govern 0.0.0 → 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 +34 -0
- package/LICENSE +202 -0
- package/NOTICE +5 -0
- package/README.md +374 -0
- package/dist/cli.js +1891 -0
- package/dist/client-CU46a__g.d.cts +1928 -0
- package/dist/client-CU46a__g.d.ts +1928 -0
- package/dist/index.cjs +1541 -0
- package/dist/index.d.cts +97 -0
- package/dist/index.d.ts +97 -0
- package/dist/index.js +1503 -0
- package/dist/langchain.cjs +1700 -0
- package/dist/langchain.d.cts +148 -0
- package/dist/langchain.d.ts +148 -0
- package/dist/langchain.js +1695 -0
- package/dist/vercel-ai.cjs +1725 -0
- package/dist/vercel-ai.d.cts +94 -0
- package/dist/vercel-ai.d.ts +94 -0
- package/dist/vercel-ai.js +1721 -0
- package/package.json +127 -5
- package/spec/README.md +17 -0
- package/spec/openapi.json +3967 -0
- package/README +0 -3
package/package.json
CHANGED
|
@@ -1,7 +1,129 @@
|
|
|
1
1
|
{
|
|
2
|
-
"name": "@anybio/govern",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
"
|
|
2
|
+
"name": "@anybio/govern",
|
|
3
|
+
"version": "0.2.2",
|
|
4
|
+
"license": "Apache-2.0",
|
|
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
|
+
"keywords": [
|
|
7
|
+
"anybio",
|
|
8
|
+
"govern",
|
|
9
|
+
"healthcare",
|
|
10
|
+
"ai-safety",
|
|
11
|
+
"compliance-gate",
|
|
12
|
+
"vercel-ai-sdk",
|
|
13
|
+
"langchain"
|
|
14
|
+
],
|
|
15
|
+
"homepage": "https://developer.anybio.io",
|
|
16
|
+
"author": {
|
|
17
|
+
"name": "AnyBio Engineering",
|
|
18
|
+
"email": "platform@anybio.io",
|
|
19
|
+
"url": "https://developer.anybio.io"
|
|
20
|
+
},
|
|
21
|
+
"repository": {
|
|
22
|
+
"type": "git",
|
|
23
|
+
"url": "git+https://github.com/anybio/govern-js.git"
|
|
24
|
+
},
|
|
25
|
+
"bugs": {
|
|
26
|
+
"url": "https://github.com/anybio/govern-js/issues"
|
|
27
|
+
},
|
|
28
|
+
"type": "module",
|
|
29
|
+
"sideEffects": false,
|
|
30
|
+
"engines": {
|
|
31
|
+
"node": ">=20"
|
|
32
|
+
},
|
|
33
|
+
"packageManager": "pnpm@9.15.9",
|
|
34
|
+
"main": "./dist/index.cjs",
|
|
35
|
+
"module": "./dist/index.js",
|
|
36
|
+
"types": "./dist/index.d.cts",
|
|
37
|
+
"typesVersions": {
|
|
38
|
+
"*": {
|
|
39
|
+
"vercel-ai": ["./dist/vercel-ai.d.cts"],
|
|
40
|
+
"langchain": ["./dist/langchain.d.cts"]
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
"exports": {
|
|
44
|
+
".": {
|
|
45
|
+
"import": {
|
|
46
|
+
"types": "./dist/index.d.ts",
|
|
47
|
+
"default": "./dist/index.js"
|
|
48
|
+
},
|
|
49
|
+
"require": {
|
|
50
|
+
"types": "./dist/index.d.cts",
|
|
51
|
+
"default": "./dist/index.cjs"
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
"./vercel-ai": {
|
|
55
|
+
"import": {
|
|
56
|
+
"types": "./dist/vercel-ai.d.ts",
|
|
57
|
+
"default": "./dist/vercel-ai.js"
|
|
58
|
+
},
|
|
59
|
+
"require": {
|
|
60
|
+
"types": "./dist/vercel-ai.d.cts",
|
|
61
|
+
"default": "./dist/vercel-ai.cjs"
|
|
62
|
+
}
|
|
63
|
+
},
|
|
64
|
+
"./langchain": {
|
|
65
|
+
"import": {
|
|
66
|
+
"types": "./dist/langchain.d.ts",
|
|
67
|
+
"default": "./dist/langchain.js"
|
|
68
|
+
},
|
|
69
|
+
"require": {
|
|
70
|
+
"types": "./dist/langchain.d.cts",
|
|
71
|
+
"default": "./dist/langchain.cjs"
|
|
72
|
+
}
|
|
73
|
+
},
|
|
74
|
+
"./package.json": "./package.json"
|
|
75
|
+
},
|
|
76
|
+
"bin": {
|
|
77
|
+
"govern": "./dist/cli.js"
|
|
78
|
+
},
|
|
79
|
+
"files": [
|
|
80
|
+
"dist",
|
|
81
|
+
"spec/openapi.json",
|
|
82
|
+
"README.md",
|
|
83
|
+
"CHANGELOG.md",
|
|
84
|
+
"LICENSE",
|
|
85
|
+
"NOTICE"
|
|
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
|
+
},
|
|
101
|
+
"peerDependencies": {
|
|
102
|
+
"@langchain/core": "^1.0.0",
|
|
103
|
+
"ai": "^7.0.0"
|
|
104
|
+
},
|
|
105
|
+
"peerDependenciesMeta": {
|
|
106
|
+
"@langchain/core": {
|
|
107
|
+
"optional": true
|
|
108
|
+
},
|
|
109
|
+
"ai": {
|
|
110
|
+
"optional": true
|
|
111
|
+
}
|
|
112
|
+
},
|
|
113
|
+
"devDependencies": {
|
|
114
|
+
"@eslint/js": "^9.39.5",
|
|
115
|
+
"@langchain/core": "^1.2.11",
|
|
116
|
+
"@types/node": "^22.19.0",
|
|
117
|
+
"ai": "^7.0.105",
|
|
118
|
+
"eslint": "^9.39.5",
|
|
119
|
+
"openapi-typescript": "^7.13.0",
|
|
120
|
+
"tsup": "^8.5.1",
|
|
121
|
+
"typescript": "^5.9.3",
|
|
122
|
+
"typescript-eslint": "^8.70.0",
|
|
123
|
+
"vitest": "^4.1.11",
|
|
124
|
+
"zod": "^4.1.8"
|
|
125
|
+
},
|
|
126
|
+
"publishConfig": {
|
|
127
|
+
"access": "public"
|
|
128
|
+
}
|
|
7
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.
|