@agentic-kit/pi 0.21.11 → 0.22.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/embed/lanes.js CHANGED
@@ -21,15 +21,23 @@ function composeRun(options) {
21
21
  lanes.log = (0, run_log_1.createRunLogExtension)({ runId: options.runId, ...options.log });
22
22
  extensions.push(lanes.log.extension);
23
23
  }
24
+ // The run id rides on the metering identity so the gateway can book every
25
+ // model call against this run (`X-Run-Id`); a host may still pin it explicitly.
24
26
  const metering = options.metering;
25
27
  if (metering?.mode === 'gateway') {
26
- const { mode: _mode, ...meteredOptions } = metering;
27
- lanes.meteredModel = (0, metered_model_1.createMeteredModelExtension)(meteredOptions);
28
+ const { mode: _mode, identity, ...meteredOptions } = metering;
29
+ lanes.meteredModel = (0, metered_model_1.createMeteredModelExtension)({
30
+ ...meteredOptions,
31
+ identity: { runId: options.runId, ...identity }
32
+ });
28
33
  extensions.push(lanes.meteredModel.extension);
29
34
  }
30
35
  else if (metering?.mode === 'self-report') {
31
- const { mode: _mode, ...reportOptions } = metering;
32
- lanes.usageReport = (0, usage_report_1.createUsageReportExtension)(reportOptions);
36
+ const { mode: _mode, identity, ...reportOptions } = metering;
37
+ lanes.usageReport = (0, usage_report_1.createUsageReportExtension)({
38
+ ...reportOptions,
39
+ identity: { runId: options.runId, ...identity }
40
+ });
33
41
  extensions.push(lanes.usageReport.extension);
34
42
  }
35
43
  if (options.gate) {
@@ -18,15 +18,23 @@ export function composeRun(options) {
18
18
  lanes.log = createRunLogExtension({ runId: options.runId, ...options.log });
19
19
  extensions.push(lanes.log.extension);
20
20
  }
21
+ // The run id rides on the metering identity so the gateway can book every
22
+ // model call against this run (`X-Run-Id`); a host may still pin it explicitly.
21
23
  const metering = options.metering;
22
24
  if (metering?.mode === 'gateway') {
23
- const { mode: _mode, ...meteredOptions } = metering;
24
- lanes.meteredModel = createMeteredModelExtension(meteredOptions);
25
+ const { mode: _mode, identity, ...meteredOptions } = metering;
26
+ lanes.meteredModel = createMeteredModelExtension({
27
+ ...meteredOptions,
28
+ identity: { runId: options.runId, ...identity }
29
+ });
25
30
  extensions.push(lanes.meteredModel.extension);
26
31
  }
27
32
  else if (metering?.mode === 'self-report') {
28
- const { mode: _mode, ...reportOptions } = metering;
29
- lanes.usageReport = createUsageReportExtension(reportOptions);
33
+ const { mode: _mode, identity, ...reportOptions } = metering;
34
+ lanes.usageReport = createUsageReportExtension({
35
+ ...reportOptions,
36
+ identity: { runId: options.runId, ...identity }
37
+ });
30
38
  extensions.push(lanes.usageReport.extension);
31
39
  }
32
40
  if (options.gate) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agentic-kit/pi",
3
- "version": "0.21.11",
3
+ "version": "0.22.0",
4
4
  "author": "Dan Lynch <pyramation@gmail.com>",
5
5
  "description": "the pi adapter for agentic-kit — Constructive's typed db tools, confirm gate, and the run-log/metering/gate lanes attached to a pi coding-agent session",
6
6
  "main": "index.js",
@@ -31,7 +31,7 @@
31
31
  "dependencies": {
32
32
  "@agentic-kit/db-tools": "^0.5.11",
33
33
  "@agentic-kit/harness": "^0.15.0",
34
- "@agentic-kit/metering": "^0.3.1",
34
+ "@agentic-kit/metering": "^0.4.0",
35
35
  "@agentic-kit/run-log": "^0.6.0",
36
36
  "zod": "^4.4.3"
37
37
  },
@@ -47,5 +47,5 @@
47
47
  "coding-agent",
48
48
  "constructive"
49
49
  ],
50
- "gitHead": "10d3a11478d17a20c80da5a827f8e8da4facfc80"
50
+ "gitHead": "cc30249ddf84bc8c410d9681adb15f98228ab591"
51
51
  }