@lmctl-ai/lmctl 0.2.84 → 0.2.86

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.
@@ -511,8 +511,51 @@ CREATE TABLE IF NOT EXISTS team_chat_log (
511
511
  error_detail TEXT,
512
512
  truncated INTEGER NOT NULL DEFAULT 0,
513
513
  created_at TEXT NOT NULL,
514
- message_type TEXT CHECK(message_type IN ('batch'))
515
- );
514
+ message_type TEXT CHECK(message_type IN ('batch')),
515
+ attempt_key TEXT,
516
+ provider TEXT,
517
+ native_session_id TEXT,
518
+ cwd TEXT,
519
+ ended_at TEXT,
520
+ turn_outcome TEXT,
521
+ model_requested TEXT,
522
+ model_reported TEXT,
523
+ tok_input_uncached INTEGER,
524
+ tok_cache_read INTEGER,
525
+ tok_cache_write INTEGER,
526
+ tok_output INTEGER,
527
+ tok_reasoning INTEGER,
528
+ usage_source TEXT CHECK(usage_source IN ('wire','native','cumulative_delta')),
529
+ usage_reason TEXT,
530
+ price_record_id TEXT,
531
+ price_snapshot_sha256 TEXT,
532
+ rate_input_1m REAL,
533
+ rate_output_1m REAL,
534
+ rate_cache_read_1m REAL,
535
+ rate_cache_write_1m REAL,
536
+ cost_reason TEXT,
537
+ provider_cost_usd REAL
538
+ );
539
+ CREATE UNIQUE INDEX IF NOT EXISTS idx_team_chat_attempt_unique ON team_chat_log(attempt_key) WHERE attempt_key IS NOT NULL;
540
+ CREATE INDEX IF NOT EXISTS idx_team_chat_started ON team_chat_log(created_at);
541
+ CREATE INDEX IF NOT EXISTS idx_team_chat_provider_model ON team_chat_log(provider, model_reported);
542
+ CREATE INDEX IF NOT EXISTS idx_team_chat_provider_session ON team_chat_log(provider, native_session_id);
543
+ CREATE VIEW IF NOT EXISTS turn_usage AS SELECT
544
+ id, attempt_key, root_teamfile = '(direct)' AS is_direct,
545
+ CASE WHEN root_teamfile = '(direct)' THEN NULL ELSE root_teamfile END AS team,
546
+ CASE WHEN root_teamfile = '(direct)' THEN NULL ELSE receiver_alias END AS alias,
547
+ provider,native_session_id,cwd,created_at AS started_at,ended_at,substr(created_at,1,10) AS day,
548
+ COALESCE(turn_outcome,status) AS status,model_requested,model_reported,COALESCE(model_reported,model_requested) AS model,
549
+ tok_input_uncached,tok_cache_read,tok_cache_write,tok_output,tok_reasoning,
550
+ COALESCE(tok_input_uncached,0)+COALESCE(tok_cache_read,0)+COALESCE(tok_cache_write,0)+COALESCE(tok_output,0) AS billed_tokens,
551
+ usage_source,usage_reason,price_record_id,cost_reason,provider_cost_usd,
552
+ CASE WHEN cost_reason IS NULL AND usage_source IS NOT NULL THEN
553
+ (COALESCE(tok_input_uncached,0)*COALESCE(rate_input_1m,0)
554
+ +COALESCE(tok_cache_read,0)*COALESCE(rate_cache_read_1m,0)
555
+ +COALESCE(tok_cache_write,0)*COALESCE(rate_cache_write_1m,rate_input_1m,0)
556
+ +COALESCE(tok_output,0)*COALESCE(rate_output_1m,0))/1e6 END AS cost_usd
557
+ FROM team_chat_log WHERE attempt_key IS NOT NULL;
558
+
516
559
  CREATE INDEX IF NOT EXISTS idx_team_chat_log_root_time
517
560
  ON team_chat_log(root_teamfile, created_at);
518
561
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lmctl-ai/lmctl",
3
- "version": "0.2.84",
3
+ "version": "0.2.86",
4
4
  "description": "A provider-agnostic control plane for teams of AI coding agents — across providers, with independent review and durable memory.",
5
5
  "type": "module",
6
6
  "homepage": "https://lmctl.com",