ai-stream-auditor 1.0.1 → 1.0.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
@@ -4,7 +4,15 @@ All notable changes follow [Keep a Changelog](https://keepachangelog.com/en/1.1.
4
4
 
5
5
  ## [Unreleased]
6
6
 
7
- ## [1.0.1] - 2026-10-05
7
+ ## [1.0.2] - 2026-10-10
8
+
9
+ ### Added
10
+
11
+ - Ship the runnable OpenAI Responses lifecycle example in the npm tarball.
12
+ - Execute the example as part of the aggregate package check.
13
+ - Document how lifecycle auditing composes with async-iterator deadlines.
14
+
15
+ ## [1.0.1] - 2026-10-06
8
16
 
9
17
  ### Fixed
10
18
 
package/README.md CHANGED
@@ -226,6 +226,17 @@ The auditor does not retain raw event payloads or generated text by default beca
226
226
 
227
227
  See [SECURITY.md](SECURITY.md) for vulnerability reporting.
228
228
 
229
+ ## Runnable example and related tool
230
+
231
+ [`examples/audit-openai.mjs`](examples/audit-openai.mjs) feeds a minimal valid
232
+ OpenAI Responses lifecycle through the auditor. It is executed by
233
+ `npm run check` and ships in the npm tarball.
234
+
235
+ Use [`async-iterator-watchdog`](https://www.npmjs.com/package/async-iterator-watchdog)
236
+ when you also need active first-progress, idle, or total deadlines around the
237
+ source iterator. The watchdog enforces time; this package validates protocol
238
+ lifecycle and outcome.
239
+
229
240
  ## Development
230
241
 
231
242
  ```sh
@@ -0,0 +1,14 @@
1
+ import { createStreamAuditor } from 'ai-stream-auditor';
2
+
3
+ const auditor = createStreamAuditor('openai-responses');
4
+
5
+ // Feed decoded SDK events as they arrive. The auditor does not parse SSE bytes.
6
+ for (const event of [
7
+ { type: 'response.created', sequence_number: 0 },
8
+ { type: 'response.completed', sequence_number: 1, response: { status: 'completed' } },
9
+ ]) {
10
+ auditor.push(event);
11
+ }
12
+
13
+ const report = auditor.finish({ cause: 'iterator_end' });
14
+ console.log(report);
package/package.json CHANGED
@@ -1,26 +1,55 @@
1
1
  {
2
2
  "name": "ai-stream-auditor",
3
- "version": "1.0.1",
3
+ "version": "1.0.2",
4
4
  "description": "Audit decoded OpenAI Responses and Anthropic Messages event lifecycles for silent or malformed stream endings.",
5
- "keywords": ["ai", "streaming", "openai", "anthropic", "llm", "diagnostics", "testing"],
5
+ "keywords": [
6
+ "ai",
7
+ "streaming",
8
+ "openai",
9
+ "anthropic",
10
+ "llm",
11
+ "diagnostics",
12
+ "testing"
13
+ ],
6
14
  "license": "MIT",
7
15
  "author": "Huzaifa Asif",
8
- "repository": { "type": "git", "url": "git+https://github.com/Huzaifa-Asif/ai-stream-auditor.git" },
9
- "bugs": { "url": "https://github.com/Huzaifa-Asif/ai-stream-auditor/issues" },
16
+ "repository": {
17
+ "type": "git",
18
+ "url": "git+https://github.com/Huzaifa-Asif/ai-stream-auditor.git"
19
+ },
20
+ "bugs": {
21
+ "url": "https://github.com/Huzaifa-Asif/ai-stream-auditor/issues"
22
+ },
10
23
  "homepage": "https://github.com/Huzaifa-Asif/ai-stream-auditor#readme",
11
24
  "type": "module",
12
25
  "main": "./src/index.cjs",
13
26
  "module": "./src/index.js",
14
27
  "types": "./src/index.d.ts",
15
- "exports": { ".": { "types": "./src/index.d.ts", "import": "./src/index.js", "require": "./src/index.cjs" } },
16
- "files": ["src", "README.md", "LICENSE", "CHANGELOG.md"],
17
- "engines": { "node": ">=18" },
28
+ "exports": {
29
+ ".": {
30
+ "types": "./src/index.d.ts",
31
+ "import": "./src/index.js",
32
+ "require": "./src/index.cjs"
33
+ }
34
+ },
35
+ "files": [
36
+ "src",
37
+ "examples",
38
+ "README.md",
39
+ "LICENSE",
40
+ "CHANGELOG.md"
41
+ ],
42
+ "engines": {
43
+ "node": ">=18"
44
+ },
18
45
  "sideEffects": false,
19
46
  "scripts": {
20
47
  "lint": "node scripts/lint.mjs",
21
48
  "test": "node --test",
22
49
  "test:coverage": "node --experimental-test-coverage --test",
23
- "check": "npm run lint && npm run test:coverage && npm pack --dry-run"
50
+ "check": "npm run lint && npm run test:coverage && node examples/audit-openai.mjs && npm pack --dry-run"
24
51
  },
25
- "publishConfig": { "access": "public" }
52
+ "publishConfig": {
53
+ "access": "public"
54
+ }
26
55
  }