@inixiative/agent-session 0.1.0 → 0.2.0

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Inixiative
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -22,7 +22,7 @@ await session.start();
22
22
 
23
23
  const result = await session.send("Build a CLI that …");
24
24
  console.log(result.content); // final text
25
- console.log(result.tokens); // { input, output }
25
+ console.log(result.tokens); // input/output + reported cache/thinking counters
26
26
  for (const e of result.events) { // full classified event stream
27
27
  if (e.kind === "tool_use") console.log("tool:", e.toolName);
28
28
  }
@@ -51,6 +51,21 @@ session.kill();
51
51
  `fork` / `interrupt` + an event handler). `ClaudeCodeSession` implements it over
52
52
  `claude --print --input-format stream-json --output-format stream-json`.
53
53
 
54
+ ## Usage telemetry
55
+
56
+ Claude results preserve `cacheRead`, `cacheWrite`, `cacheWrite5m`, `cacheWrite1h`,
57
+ and `thinking` alongside `input`/`output`. Input excludes the disjoint cache
58
+ counters; thinking is already included in output and TTL counts are included in
59
+ cacheWrite. Unreported optional counters remain absent. `providerUsage` retains
60
+ the entire original usage object, including service tier and future tags.
61
+
62
+ `result` events and `send().tokens` carry the native turn aggregate. Session
63
+ `totalTokens` and artifact totals sum these completed results once. `usage`
64
+ events carry request snapshots with the original envelope (request/message IDs,
65
+ model and tags) in `raw`; they may repeat across content blocks. Do not sum
66
+ request snapshots together with result totals. Interrupted turns retain request
67
+ snapshots in the artifact but do not fabricate a completed-turn total.
68
+
54
69
  ## Roadmap
55
70
 
56
71
  | Runtime | Status |
@@ -62,6 +77,8 @@ session.kill();
62
77
 
63
78
  Opaque runtimes degrade gracefully — fewer event types, never a hard failure.
64
79
 
80
+ Proposed [subscription pooling goals](tickets/README.md) cover distributing session workloads across subscriptions while keeping working context independent of the capacity supplying it.
81
+
65
82
  ## Provenance
66
83
 
67
84
  Extracted from [`inixiative/foundry`](https://github.com/inixiative/foundry),
@@ -71,3 +88,7 @@ and the inixiative bench.
71
88
  ## License
72
89
 
73
90
  MIT
91
+
92
+ ## Runtime
93
+
94
+ Development and new continuation captures use Bun 1.4.2, pinned in `.bun-version` and `package.json`. Historical S0 recordings retain their original Bun 1.3.14 evidence; they are not new 1.4.2 captures.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inixiative/agent-session",
3
- "version": "0.1.0",
3
+ "version": "0.2.0",
4
4
  "description": "Drive coding-agent CLIs as persistent, streaming, event-captured sessions. Claude Code and Codex today; Gemini, Grok planned.",
5
5
  "type": "module",
6
6
  "main": "src/index.ts",
@@ -8,17 +8,42 @@
8
8
  "exports": {
9
9
  ".": "./src/index.ts"
10
10
  },
11
- "files": ["src"],
11
+ "files": [
12
+ "src"
13
+ ],
12
14
  "scripts": {
13
- "typecheck": "tsc --noEmit"
15
+ "typecheck": "tsc --noEmit",
16
+ "test": "bun test",
17
+ "check": "bun run typecheck && bun run test",
18
+ "prepublishOnly": "bun run check"
14
19
  },
15
20
  "keywords": [
16
- "claude-code", "codex", "agent", "session", "stream", "stream-json",
17
- "ai", "cli", "sandbox", "harness", "eval"
21
+ "claude-code",
22
+ "codex",
23
+ "agent",
24
+ "session",
25
+ "stream",
26
+ "stream-json",
27
+ "ai",
28
+ "cli",
29
+ "sandbox",
30
+ "harness",
31
+ "eval"
18
32
  ],
19
33
  "license": "MIT",
20
34
  "devDependencies": {
21
- "@types/bun": "latest",
22
- "typescript": "^5.7.0"
35
+ "@types/bun": "1.4.2",
36
+ "typescript": "6.0.3"
37
+ },
38
+ "packageManager": "bun@1.4.2",
39
+ "engines": {
40
+ "bun": ">=1.4.2"
41
+ },
42
+ "repository": {
43
+ "type": "git",
44
+ "url": "git+https://github.com/inixiative/agent-session.git"
45
+ },
46
+ "publishConfig": {
47
+ "access": "public"
23
48
  }
24
49
  }