@inerrata-corporation/errata 2.0.0-dev.68 → 2.0.0-dev.69

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.
Files changed (2) hide show
  1. package/errata.mjs +38 -2
  2. package/package.json +1 -1
package/errata.mjs CHANGED
@@ -20914,6 +20914,17 @@ function chunkArray(items, size) {
20914
20914
  for (let i2 = 0; i2 < items.length; i2 += size) out2.push(items.slice(i2, i2 + size));
20915
20915
  return out2;
20916
20916
  }
20917
+ function provenanceHeaders(provenance) {
20918
+ return {
20919
+ ...provenance.clientProduct ? { "x-inerrata-client-product": provenance.clientProduct } : {},
20920
+ ...provenance.clientKind ? { "x-inerrata-client-kind": provenance.clientKind } : {},
20921
+ ...provenance.clientVersion ? { "x-inerrata-client-version": provenance.clientVersion } : {},
20922
+ ...provenance.hostHarness ? { "x-inerrata-host-harness": provenance.hostHarness } : {},
20923
+ ...provenance.runtime ? { "x-inerrata-runtime": provenance.runtime } : {},
20924
+ ...provenance.agentProvider ? { "x-inerrata-agent-provider": provenance.agentProvider } : {},
20925
+ ...provenance.agentModel ? { "x-inerrata-agent-model": provenance.agentModel } : {}
20926
+ };
20927
+ }
20917
20928
  var asWireCount, INGEST_NODE_CHUNK, CloudClient, CloudError;
20918
20929
  var init_client = __esm({
20919
20930
  "../../packages/cloud-client/src/client.ts"() {
@@ -20935,6 +20946,7 @@ var init_client = __esm({
20935
20946
  timeoutMs;
20936
20947
  daemonVersion;
20937
20948
  daemonChannel;
20949
+ provenance;
20938
20950
  constructor(opts) {
20939
20951
  this.baseUrl = opts.baseUrl.replace(/\/+$/, "");
20940
20952
  if (opts.apiKey !== void 0) this.apiKey = opts.apiKey;
@@ -20948,6 +20960,12 @@ var init_client = __esm({
20948
20960
  this.timeoutMs = opts.timeoutMs ?? 15e3;
20949
20961
  this.daemonVersion = opts.daemonVersion;
20950
20962
  this.daemonChannel = opts.daemonChannel;
20963
+ this.provenance = opts.provenance ?? {
20964
+ clientProduct: "inerrata_cloud_client",
20965
+ clientKind: "sdk",
20966
+ runtime: "unknown",
20967
+ hostHarness: "unknown"
20968
+ };
20951
20969
  }
20952
20970
  /**
20953
20971
  * The bearer token to send: a fresh OAuth access token (refreshing it first if
@@ -21323,7 +21341,8 @@ var init_client = __esm({
21323
21341
  const url2 = `${this.baseUrl}${path2}`;
21324
21342
  const headers = {
21325
21343
  "content-type": "application/json",
21326
- accept: "application/json"
21344
+ accept: "application/json",
21345
+ ...provenanceHeaders(this.provenance)
21327
21346
  };
21328
21347
  if (!opts?.skipAuth) {
21329
21348
  const token = await this.authToken();
@@ -21813,6 +21832,21 @@ var init_cloud_endpoint_policy = __esm({
21813
21832
  function oauthClientId() {
21814
21833
  return process.env["ERRATA_OAUTH_CLIENT_ID"] ?? "errata-daemon";
21815
21834
  }
21835
+ function daemonProvenance(env2 = process.env) {
21836
+ const explicit = env2["ERRATA_HOST_HARNESS"];
21837
+ const hostHarness = explicit === "claude_code" || explicit === "codex" || explicit === "cursor" || explicit === "gemini_cli" || explicit === "openclaw" || explicit === "custom" ? explicit : env2["CODEX_HOME"] || env2["CODEX_THREAD_ID"] ? "codex" : env2["CLAUDE_PROJECT_DIR"] || env2["CLAUDECODE"] ? "claude_code" : env2["CURSOR_TRACE_ID"] ? "cursor" : "unknown";
21838
+ const provider = env2["ERRATA_AGENT_PROVIDER"];
21839
+ const agentProvider = provider === "anthropic" || provider === "openai" || provider === "google" || provider === "aws" || provider === "azure" || provider === "custom" ? provider : "unknown";
21840
+ return {
21841
+ clientProduct: "inerrata_daemon",
21842
+ clientKind: "sidecar",
21843
+ clientVersion: "2.0.0-alpha.0",
21844
+ hostHarness,
21845
+ runtime: "local",
21846
+ agentProvider,
21847
+ ...env2["ERRATA_AGENT_MODEL"] ? { agentModel: env2["ERRATA_AGENT_MODEL"] } : {}
21848
+ };
21849
+ }
21816
21850
  function authedCloudClient(cfg, opts = {}) {
21817
21851
  const baseUrl = normalizeCloudUrl(cfg.cloudUrl);
21818
21852
  const fetchFn = guardCloudFetch(baseUrl, opts.fetchFn ?? fetch);
@@ -21825,6 +21859,7 @@ function authedCloudClient(cfg, opts = {}) {
21825
21859
  ...cfg.refreshToken ? { refreshToken: cfg.refreshToken } : {},
21826
21860
  fetchFn,
21827
21861
  ...versionOpts,
21862
+ provenance: daemonProvenance(),
21828
21863
  ...opts.timeoutMs ? { timeoutMs: opts.timeoutMs } : {},
21829
21864
  ...tokenEndpoint && cfg.refreshToken ? {
21830
21865
  refreshFn: (rt) => refreshAccessToken(opts.fetchFn ?? fetch, tokenEndpoint, {
@@ -21846,6 +21881,7 @@ function authedCloudClient(cfg, opts = {}) {
21846
21881
  ...cfg.apiKey ? { apiKey: cfg.apiKey } : {},
21847
21882
  fetchFn,
21848
21883
  ...versionOpts,
21884
+ provenance: daemonProvenance(),
21849
21885
  ...opts.timeoutMs ? { timeoutMs: opts.timeoutMs } : {}
21850
21886
  });
21851
21887
  }
@@ -42940,7 +42976,7 @@ function startLoopLagMonitor(thresholdMs = 1e3) {
42940
42976
  }
42941
42977
 
42942
42978
  // src/engine.ts
42943
- var DAEMON_VERSION = true ? "2.0.0-dev.68" : "2.0.0-alpha.0";
42979
+ var DAEMON_VERSION = true ? "2.0.0-dev.69" : "2.0.0-alpha.0";
42944
42980
  var IGNORED_PATH = /[\\/](?:\.git|node_modules|\.errata|\.claude|\.codex|\.cursor|\.turbo|\.next|dist|coverage|test-results|playwright-report|__pycache__)(?:[\\/]|$)/;
42945
42981
  var IGNORED_NOISE = /castalia\.db|eventlog\.sqlite|turn-cursors/;
42946
42982
  var GIT_OP_MUTE_MS = 4e3;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inerrata-corporation/errata",
3
- "version": "2.0.0-dev.68",
3
+ "version": "2.0.0-dev.69",
4
4
  "description": "errata - local-first observation engine for AI coding agents",
5
5
  "type": "module",
6
6
  "bin": {