@certalis/agent-smith 0.1.9 → 0.1.10

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/dist/bin.js CHANGED
@@ -335,13 +335,13 @@ class PriceCatalogue {
335
335
  return PriceCatalogue.instance;
336
336
  }
337
337
  getCacheDir() {
338
- return join2(tmpdir(), "ccflare");
338
+ return join2(tmpdir(), "agent-smith");
339
339
  }
340
340
  getCachePath() {
341
341
  return join2(this.getCacheDir(), "models.dev.json");
342
342
  }
343
343
  getCacheDurationMs() {
344
- const hours = Number(process.env.CF_PRICING_REFRESH_HOURS) || 24;
344
+ const hours = Number(process.env.AGENT_SMITH_PRICING_REFRESH_HOURS) || 24;
345
345
  return hours * TIME_CONSTANTS.HOUR;
346
346
  }
347
347
  async ensureCacheDir() {
@@ -1035,7 +1035,7 @@ class LogFileWriter {
1035
1035
  stream = null;
1036
1036
  maxFileSize = BUFFER_SIZES.LOG_FILE_MAX_SIZE;
1037
1037
  constructor() {
1038
- this.logDir = join3(tmpdir2(), "ccflare-logs");
1038
+ this.logDir = join3(tmpdir2(), "agent-smith-logs");
1039
1039
  if (!existsSync(this.logDir)) {
1040
1040
  mkdirSync(this.logDir, { recursive: true });
1041
1041
  }
@@ -1121,11 +1121,11 @@ class Logger {
1121
1121
  constructor(prefix = "", level = 1 /* INFO */, options = {}) {
1122
1122
  this.prefix = prefix;
1123
1123
  this.level = this.getLogLevelFromEnv() || level;
1124
- this.format = process.env.LOG_FORMAT || "pretty";
1125
- this.silentConsole = options.silentConsole ?? !(process.env.ccflare_DEBUG === "1" || this.level === 0 /* DEBUG */);
1124
+ this.format = process.env.AGENT_SMITH_LOG_FORMAT || "pretty";
1125
+ this.silentConsole = options.silentConsole ?? !(process.env.AGENT_SMITH_DEBUG === "1" || this.level === 0 /* DEBUG */);
1126
1126
  }
1127
1127
  getLogLevelFromEnv() {
1128
- const envLevel = process.env.LOG_LEVEL?.toUpperCase();
1128
+ const envLevel = process.env.AGENT_SMITH_LOG_LEVEL?.toUpperCase();
1129
1129
  if (envLevel && envLevel in LogLevel) {
1130
1130
  return LogLevel[envLevel];
1131
1131
  }
@@ -1202,7 +1202,7 @@ class Logger {
1202
1202
  }
1203
1203
  setLevel(level) {
1204
1204
  this.level = level;
1205
- this.silentConsole = !(process.env.ccflare_DEBUG === "1" || this.level === 0 /* DEBUG */);
1205
+ this.silentConsole = !(process.env.AGENT_SMITH_DEBUG === "1" || this.level === 0 /* DEBUG */);
1206
1206
  }
1207
1207
  getLevel() {
1208
1208
  return this.level;
@@ -1237,11 +1237,11 @@ import { platform } from "process";
1237
1237
  function getPlatformConfigDir() {
1238
1238
  if (platform === "win32") {
1239
1239
  const baseDir = process.env.LOCALAPPDATA ?? process.env.APPDATA ?? join4(homedir(), "AppData", "Local");
1240
- return join4(baseDir, "ccflare");
1240
+ return join4(baseDir, "agent-smith");
1241
1241
  } else {
1242
1242
  const xdgConfig = process.env.XDG_CONFIG_HOME;
1243
1243
  const baseDir = xdgConfig ?? join4(homedir(), ".config");
1244
- return join4(baseDir, "ccflare");
1244
+ return join4(baseDir, "agent-smith");
1245
1245
  }
1246
1246
  }
1247
1247
  var init_paths_common = () => {};
@@ -1249,12 +1249,12 @@ var init_paths_common = () => {};
1249
1249
  // ../../packages/config/src/paths.ts
1250
1250
  import { join as join5 } from "path";
1251
1251
  function resolveConfigPath() {
1252
- const explicitPath = process.env.ccflare_CONFIG_PATH;
1252
+ const explicitPath = process.env.AGENT_SMITH_CONFIG_PATH;
1253
1253
  if (explicitPath) {
1254
1254
  return explicitPath;
1255
1255
  }
1256
1256
  const configDir = getPlatformConfigDir();
1257
- return join5(configDir, "ccflare.json");
1257
+ return join5(configDir, "agent-smith.json");
1258
1258
  }
1259
1259
  var init_paths = __esm(() => {
1260
1260
  init_paths_common();
@@ -1638,7 +1638,7 @@ var init_src4 = __esm(() => {
1638
1638
  this.emit("change", { key, oldValue, newValue: value });
1639
1639
  }
1640
1640
  getStrategy() {
1641
- const envStrategy = process.env.LB_STRATEGY;
1641
+ const envStrategy = process.env.AGENT_SMITH_LB_STRATEGY;
1642
1642
  if (envStrategy && isValidStrategy(envStrategy)) {
1643
1643
  return envStrategy;
1644
1644
  }
@@ -1658,7 +1658,7 @@ var init_src4 = __esm(() => {
1658
1658
  return Math.max(min, Math.min(max, n));
1659
1659
  }
1660
1660
  getDataRetentionDays() {
1661
- const fromEnv = process.env.DATA_RETENTION_DAYS;
1661
+ const fromEnv = process.env.AGENT_SMITH_DATA_RETENTION_DAYS;
1662
1662
  if (fromEnv) {
1663
1663
  const n = parseInt(fromEnv, 10);
1664
1664
  if (!Number.isNaN(n))
@@ -1674,7 +1674,7 @@ var init_src4 = __esm(() => {
1674
1674
  this.set("data_retention_days", clamped);
1675
1675
  }
1676
1676
  getRequestRetentionDays() {
1677
- const fromEnv = process.env.REQUEST_RETENTION_DAYS;
1677
+ const fromEnv = process.env.AGENT_SMITH_REQUEST_RETENTION_DAYS;
1678
1678
  if (fromEnv) {
1679
1679
  const n = parseInt(fromEnv, 10);
1680
1680
  if (!Number.isNaN(n))
@@ -1859,34 +1859,34 @@ var init_src4 = __esm(() => {
1859
1859
  port: NETWORK.DEFAULT_PORT,
1860
1860
  teamRouting: this.getTeamRouting()
1861
1861
  };
1862
- if (process.env.CLIENT_ID) {
1863
- defaults.clientId = process.env.CLIENT_ID;
1862
+ if (process.env.AGENT_SMITH_CLIENT_ID) {
1863
+ defaults.clientId = process.env.AGENT_SMITH_CLIENT_ID;
1864
1864
  }
1865
- const retryAttempts = parseNumber(process.env.RETRY_ATTEMPTS);
1865
+ const retryAttempts = parseNumber(process.env.AGENT_SMITH_RETRY_ATTEMPTS);
1866
1866
  if (retryAttempts !== undefined) {
1867
1867
  defaults.retry.attempts = retryAttempts;
1868
1868
  }
1869
- const maxBodyBytes = parseNumber(process.env.MAX_BODY_BYTES);
1869
+ const maxBodyBytes = parseNumber(process.env.AGENT_SMITH_MAX_BODY_BYTES);
1870
1870
  if (maxBodyBytes !== undefined) {
1871
1871
  defaults.maxBodyBytes = maxBodyBytes;
1872
1872
  }
1873
- const quotaThreshold = parseNumber(process.env.QUOTA_THRESHOLD);
1873
+ const quotaThreshold = parseNumber(process.env.AGENT_SMITH_QUOTA_THRESHOLD);
1874
1874
  if (quotaThreshold !== undefined && quotaThreshold > 0 && quotaThreshold <= 1) {
1875
1875
  defaults.quotaThreshold = quotaThreshold;
1876
1876
  }
1877
- const retryDelayMs = parseNumber(process.env.RETRY_DELAY_MS);
1877
+ const retryDelayMs = parseNumber(process.env.AGENT_SMITH_RETRY_DELAY_MS);
1878
1878
  if (retryDelayMs !== undefined) {
1879
1879
  defaults.retry.delayMs = retryDelayMs;
1880
1880
  }
1881
- const retryBackoff = parseNumber(process.env.RETRY_BACKOFF);
1881
+ const retryBackoff = parseNumber(process.env.AGENT_SMITH_RETRY_BACKOFF);
1882
1882
  if (retryBackoff !== undefined) {
1883
1883
  defaults.retry.backoff = retryBackoff;
1884
1884
  }
1885
- const requestScopedRetryDelayMs = parseNumber(process.env.REQUEST_SCOPED_429_RETRY_DELAY_MS);
1885
+ const requestScopedRetryDelayMs = parseNumber(process.env.AGENT_SMITH_REQUEST_SCOPED_429_RETRY_DELAY_MS);
1886
1886
  if (requestScopedRetryDelayMs !== undefined) {
1887
1887
  defaults.requestScopedRetryDelayMs = requestScopedRetryDelayMs;
1888
1888
  }
1889
- const sessionDurationMs = parseNumber(process.env.SESSION_DURATION_MS);
1889
+ const sessionDurationMs = parseNumber(process.env.AGENT_SMITH_SESSION_DURATION_MS);
1890
1890
  if (sessionDurationMs !== undefined) {
1891
1891
  defaults.sessionDurationMs = sessionDurationMs;
1892
1892
  }
@@ -1982,12 +1982,12 @@ var init_analytics_query = __esm(() => {
1982
1982
  // ../../packages/database/src/paths.ts
1983
1983
  import { join as join6 } from "path";
1984
1984
  function resolveDbPath() {
1985
- const explicitPath = process.env.ccflare_DB_PATH;
1985
+ const explicitPath = process.env.AGENT_SMITH_DB_PATH;
1986
1986
  if (explicitPath) {
1987
1987
  return explicitPath;
1988
1988
  }
1989
1989
  const configDir = getPlatformConfigDir();
1990
- return join6(configDir, "ccflare.db");
1990
+ return join6(configDir, "agent-smith.db");
1991
1991
  }
1992
1992
  var init_paths2 = __esm(() => {
1993
1993
  init_src4();
@@ -6477,7 +6477,7 @@ function createAuthCallbackHandler(dbOps, config, providerRegistry) {
6477
6477
  sessionId: authSession.id,
6478
6478
  code
6479
6479
  });
6480
- return htmlPage(200, "Account connected", "Your OAuth account has been connected successfully. You can close this window and return to ccflare.");
6480
+ return htmlPage(200, "Account connected", "Your OAuth account has been connected successfully. You can close this window and return to agent-smith.");
6481
6481
  } catch (error) {
6482
6482
  dbOps.deleteAuthSession(authSession.id);
6483
6483
  return htmlPage(400, "Authorization failed", escapeHtml(error instanceof Error ? error.message : "Failed to complete OAuth flow."));
@@ -8649,11 +8649,12 @@ async function prepareRequestBody(req, maxBodyBytes = DEFAULT_MAX_BODY_BYTES) {
8649
8649
  }
8650
8650
  };
8651
8651
  }
8652
- async function makeProxyRequest(targetUrl, method, headers3, createBodyStream, hasBody) {
8652
+ async function makeProxyRequest(targetUrl, method, headers3, createBodyStream, hasBody, signal) {
8653
8653
  return fetch(targetUrl, {
8654
8654
  method,
8655
8655
  headers: headers3,
8656
8656
  body: createBodyStream(),
8657
+ signal,
8657
8658
  ...hasBody ? { duplex: "half" } : {}
8658
8659
  });
8659
8660
  }
@@ -9677,7 +9678,7 @@ function createUpstreamSender(input) {
9677
9678
  const requestAccount = token === input.account.access_token ? input.account : { ...input.account, access_token: token };
9678
9679
  const headers3 = input.ctx.provider.prepareHeaders(input.req.headers, requestAccount);
9679
9680
  const upstreamRequestStartedAt = Date.now();
9680
- const response = await makeProxyRequest(targetUrl, input.req.method, headers3, () => input.createBodyStream(input.requestBody), !!input.req.body);
9681
+ const response = await makeProxyRequest(targetUrl, input.req.method, headers3, () => input.createBodyStream(input.requestBody), !!input.req.body, input.req.signal);
9681
9682
  return {
9682
9683
  response,
9683
9684
  responseHeadersReceivedAt: Date.now(),
@@ -9801,6 +9802,7 @@ async function proxyWithAccount(req, url, account2, requestMeta, requestBodyBuff
9801
9802
  const upstream = await sendAuthorizedRequest(input, createUpstreamSender(input));
9802
9803
  return isProxyAttempt(upstream) ? upstream : await classifyUpstreamResponse(input, upstream);
9803
9804
  } catch (err) {
9805
+ req.signal.throwIfAborted();
9804
9806
  handleProxyError(err, account2, log20);
9805
9807
  return err instanceof TokenRefreshError ? { kind: "failed" } : { kind: "transport-failure" };
9806
9808
  }
@@ -9873,6 +9875,7 @@ function quotaExhaustionResponse(resetAt2) {
9873
9875
  });
9874
9876
  }
9875
9877
  async function attemptAccount(request2, account2, failoverAttempts) {
9878
+ request2.req.signal.throwIfAborted();
9876
9879
  const admission = request2.ctx.teamAdmission;
9877
9880
  let permit;
9878
9881
  try {
@@ -10428,7 +10431,7 @@ function createDefaultLogger() {
10428
10431
  };
10429
10432
  }
10430
10433
  function resolveUsageWorkerEntrypoint() {
10431
- const configuredPath = process.env.CF_USAGE_WORKER_PATH?.trim();
10434
+ const configuredPath = process.env.AGENT_SMITH_USAGE_WORKER_PATH?.trim();
10432
10435
  if (!configuredPath) {
10433
10436
  return new URL("./post-processor.worker.ts", import.meta.url).href;
10434
10437
  }
@@ -10766,8 +10769,8 @@ var DEFAULT_READY_TIMEOUT_MS, DEFAULT_ACK_TIMEOUT_MS, DEFAULT_SHUTDOWN_DELAY_MS
10766
10769
  var init_usage_worker = __esm(() => {
10767
10770
  init_src2();
10768
10771
  init_src();
10769
- DEFAULT_READY_TIMEOUT_MS = Number(process.env.CF_USAGE_WORKER_READY_TIMEOUT_MS || TIME_CONSTANTS.RETRY_DELAY_DEFAULT * 5);
10770
- DEFAULT_ACK_TIMEOUT_MS = Number(process.env.CF_USAGE_WORKER_ACK_TIMEOUT_MS || TIME_CONSTANTS.RETRY_DELAY_DEFAULT * 5);
10772
+ DEFAULT_READY_TIMEOUT_MS = Number(process.env.AGENT_SMITH_USAGE_WORKER_READY_TIMEOUT_MS || TIME_CONSTANTS.RETRY_DELAY_DEFAULT * 5);
10773
+ DEFAULT_ACK_TIMEOUT_MS = Number(process.env.AGENT_SMITH_USAGE_WORKER_ACK_TIMEOUT_MS || TIME_CONSTANTS.RETRY_DELAY_DEFAULT * 5);
10771
10774
  });
10772
10775
 
10773
10776
  // ../../packages/proxy/src/proxy.ts
@@ -11752,13 +11755,13 @@ function configuredKey(value) {
11752
11755
  return typeof value === "string" && value.length > 0 ? value : undefined;
11753
11756
  }
11754
11757
  function createExposureConfig(config) {
11755
- const configuredHost = configuredKey(process.env.CF_HOST) ?? configuredKey(config.get("host"));
11756
- const configuredTrustLoopback = process.env.CF_TRUST_LOOPBACK;
11758
+ const configuredHost = configuredKey(process.env.AGENT_SMITH_HOST) ?? configuredKey(config.get("host"));
11759
+ const configuredTrustLoopback = process.env.AGENT_SMITH_TRUST_LOOPBACK;
11757
11760
  return {
11758
- adminKey: configuredKey(process.env.CF_ADMIN_KEY),
11761
+ adminKey: configuredKey(process.env.AGENT_SMITH_ADMIN_KEY),
11759
11762
  bindHost: configuredHost ?? "127.0.0.1",
11760
- proxyKey: configuredKey(process.env.CF_PROXY_KEY),
11761
- clientKeysFile: configuredKey(process.env.CF_CLIENT_KEYS_FILE),
11763
+ proxyKey: configuredKey(process.env.AGENT_SMITH_PROXY_KEY),
11764
+ clientKeysFile: configuredKey(process.env.AGENT_SMITH_CLIENT_KEYS_FILE),
11762
11765
  trustLoopback: configuredTrustLoopback === undefined ? config.get("trust_loopback") !== false : configuredTrustLoopback !== "false"
11763
11766
  };
11764
11767
  }
@@ -11926,7 +11929,7 @@ function bootstrapRuntime(port, serverLog) {
11926
11929
  container.registerInstance(SERVICE_KEYS.PricingLogger, pricingLogger);
11927
11930
  setPricingLogger(pricingLogger);
11928
11931
  const apiRouter = new APIRouter({
11929
- enrollmentOrigin: process.env.CF_ENROLLMENT_ORIGIN,
11932
+ enrollmentOrigin: process.env.AGENT_SMITH_ENROLLMENT_ORIGIN,
11930
11933
  config,
11931
11934
  dbOps,
11932
11935
  providerRegistry,
@@ -12081,7 +12084,7 @@ function serveDashboardRoute(url) {
12081
12084
  }
12082
12085
  return null;
12083
12086
  }
12084
- var DASHBOARD_MANIFEST_EXPORT = "@ccflare/web/manifest.json", DASHBOARD_DIST_DIR_ENV = "CF_DASHBOARD_DIST_DIR", DASHBOARD_MANIFEST_PATH_ENV = "CF_DASHBOARD_MANIFEST_PATH", dashboardAssets = null;
12087
+ var DASHBOARD_MANIFEST_EXPORT = "@agent-smith/web/manifest.json", DASHBOARD_DIST_DIR_ENV = "AGENT_SMITH_DASHBOARD_DIST_DIR", DASHBOARD_MANIFEST_PATH_ENV = "AGENT_SMITH_DASHBOARD_MANIFEST_PATH", dashboardAssets = null;
12085
12088
  var init_dashboard_assets = __esm(() => {
12086
12089
  init_src2();
12087
12090
  });
@@ -12106,7 +12109,7 @@ var init_oauth_token = __esm(() => {
12106
12109
  "host",
12107
12110
  "content-length",
12108
12111
  "x-api-key",
12109
- "x-ccflare-scenario-client-id"
12112
+ "x-agent-smith-scenario-client-id"
12110
12113
  ];
12111
12114
  });
12112
12115
 
@@ -12201,7 +12204,7 @@ function createStartupBanner(options) {
12201
12204
  const dashboardUrl = withDashboard ? `http://localhost:${port}` : "disabled";
12202
12205
  const supportedProviders = providers2.join(", ");
12203
12206
  return `
12204
- \uD83C\uDFAF ccflare Server v${version}
12207
+ \uD83C\uDFAF Agent Smith Server v${version}
12205
12208
  \uD83C\uDF10 Port: ${port}
12206
12209
  \uD83D\uDCCA Dashboard: ${dashboardUrl}
12207
12210
  \uD83D\uDD17 Management API: http://localhost:${port}/api
@@ -12808,6 +12811,79 @@ var init_request_presenters = __esm(() => {
12808
12811
  };
12809
12812
  });
12810
12813
 
12814
+ // ../../packages/ui/src/themes/agent-smith.ts
12815
+ var agentSmithLight, agentSmithDark;
12816
+ var init_agent_smith = __esm(() => {
12817
+ agentSmithLight = {
12818
+ id: "agent-smith-light",
12819
+ name: "Agent Smith Light",
12820
+ family: "agent-smith",
12821
+ appearance: "light",
12822
+ background: "#ffffff",
12823
+ foreground: "#0a0a0f",
12824
+ card: "#ffffff",
12825
+ cardForeground: "#0a0a0f",
12826
+ popover: "#ffffff",
12827
+ popoverForeground: "#0a0a0f",
12828
+ primary: "#f38020",
12829
+ primaryForeground: "#ffffff",
12830
+ secondary: "#f0f0f3",
12831
+ secondaryForeground: "#191920",
12832
+ muted: "#f0f0f3",
12833
+ mutedForeground: "#6e6e7a",
12834
+ accent: "#f38020",
12835
+ accentForeground: "#ffffff",
12836
+ destructive: "#e5484d",
12837
+ destructiveForeground: "#fafafa",
12838
+ border: "#e4e4e9",
12839
+ input: "#e4e4e9",
12840
+ ring: "#f38020",
12841
+ success: "#16a34a",
12842
+ warning: "#ca8a04",
12843
+ error: "#dc2626",
12844
+ info: "#2563eb",
12845
+ chart1: "#f38020",
12846
+ chart2: "#3b82f6",
12847
+ chart3: "#8b5cf6",
12848
+ chart4: "#ec4899",
12849
+ chart5: "#10b981"
12850
+ };
12851
+ agentSmithDark = {
12852
+ id: "agent-smith-dark",
12853
+ name: "Agent Smith Dark",
12854
+ family: "agent-smith",
12855
+ appearance: "dark",
12856
+ background: "#111318",
12857
+ foreground: "#f2f2f2",
12858
+ card: "#181b22",
12859
+ cardForeground: "#f2f2f2",
12860
+ popover: "#181b22",
12861
+ popoverForeground: "#f2f2f2",
12862
+ primary: "#f38020",
12863
+ primaryForeground: "#ffffff",
12864
+ secondary: "#262b33",
12865
+ secondaryForeground: "#f2f2f2",
12866
+ muted: "#262b33",
12867
+ mutedForeground: "#838996",
12868
+ accent: "#f38020",
12869
+ accentForeground: "#ffffff",
12870
+ destructive: "#e5484d",
12871
+ destructiveForeground: "#fafafa",
12872
+ border: "#2a303a",
12873
+ input: "#262b33",
12874
+ ring: "#f38020",
12875
+ success: "#3fb950",
12876
+ warning: "#d29922",
12877
+ error: "#f85149",
12878
+ info: "#58a6ff",
12879
+ chart1: "#f38020",
12880
+ chart2: "#58a6ff",
12881
+ chart3: "#bc8cff",
12882
+ chart4: "#f778ba",
12883
+ chart5: "#3fb950"
12884
+ };
12885
+ });
12886
+
12811
12887
  // ../../packages/ui/src/themes/catppuccin.ts
12812
12888
  var catppuccinMocha, catppuccinMacchiato, catppuccinFrappe, catppuccinLatte;
12813
12889
  var init_catppuccin = __esm(() => {
@@ -12949,79 +13025,6 @@ var init_catppuccin = __esm(() => {
12949
13025
  };
12950
13026
  });
12951
13027
 
12952
- // ../../packages/ui/src/themes/ccflare.ts
12953
- var ccflareLight, ccflareDark;
12954
- var init_ccflare = __esm(() => {
12955
- ccflareLight = {
12956
- id: "ccflare-light",
12957
- name: "ccflare Light",
12958
- family: "ccflare",
12959
- appearance: "light",
12960
- background: "#ffffff",
12961
- foreground: "#0a0a0f",
12962
- card: "#ffffff",
12963
- cardForeground: "#0a0a0f",
12964
- popover: "#ffffff",
12965
- popoverForeground: "#0a0a0f",
12966
- primary: "#f38020",
12967
- primaryForeground: "#ffffff",
12968
- secondary: "#f0f0f3",
12969
- secondaryForeground: "#191920",
12970
- muted: "#f0f0f3",
12971
- mutedForeground: "#6e6e7a",
12972
- accent: "#f38020",
12973
- accentForeground: "#ffffff",
12974
- destructive: "#e5484d",
12975
- destructiveForeground: "#fafafa",
12976
- border: "#e4e4e9",
12977
- input: "#e4e4e9",
12978
- ring: "#f38020",
12979
- success: "#16a34a",
12980
- warning: "#ca8a04",
12981
- error: "#dc2626",
12982
- info: "#2563eb",
12983
- chart1: "#f38020",
12984
- chart2: "#3b82f6",
12985
- chart3: "#8b5cf6",
12986
- chart4: "#ec4899",
12987
- chart5: "#10b981"
12988
- };
12989
- ccflareDark = {
12990
- id: "ccflare-dark",
12991
- name: "ccflare Dark",
12992
- family: "ccflare",
12993
- appearance: "dark",
12994
- background: "#111318",
12995
- foreground: "#f2f2f2",
12996
- card: "#181b22",
12997
- cardForeground: "#f2f2f2",
12998
- popover: "#181b22",
12999
- popoverForeground: "#f2f2f2",
13000
- primary: "#f38020",
13001
- primaryForeground: "#ffffff",
13002
- secondary: "#262b33",
13003
- secondaryForeground: "#f2f2f2",
13004
- muted: "#262b33",
13005
- mutedForeground: "#838996",
13006
- accent: "#f38020",
13007
- accentForeground: "#ffffff",
13008
- destructive: "#e5484d",
13009
- destructiveForeground: "#fafafa",
13010
- border: "#2a303a",
13011
- input: "#262b33",
13012
- ring: "#f38020",
13013
- success: "#3fb950",
13014
- warning: "#d29922",
13015
- error: "#f85149",
13016
- info: "#58a6ff",
13017
- chart1: "#f38020",
13018
- chart2: "#58a6ff",
13019
- chart3: "#bc8cff",
13020
- chart4: "#f778ba",
13021
- chart5: "#3fb950"
13022
- };
13023
- });
13024
-
13025
13028
  // ../../packages/ui/src/themes/dracula.ts
13026
13029
  var dracula;
13027
13030
  var init_dracula = __esm(() => {
@@ -13499,12 +13502,12 @@ function getThemeById(id) {
13499
13502
  return THEME_REGISTRY.find((t) => t.id === id);
13500
13503
  }
13501
13504
  function getDefaultTheme(appearance) {
13502
- return appearance === "dark" ? ccflareDark : ccflareLight;
13505
+ return appearance === "dark" ? agentSmithDark : agentSmithLight;
13503
13506
  }
13504
13507
  var THEME_REGISTRY, THEME_FAMILIES;
13505
13508
  var init_themes = __esm(() => {
13509
+ init_agent_smith();
13506
13510
  init_catppuccin();
13507
- init_ccflare();
13508
13511
  init_dracula();
13509
13512
  init_gruvbox();
13510
13513
  init_nord();
@@ -13513,8 +13516,8 @@ var init_themes = __esm(() => {
13513
13516
  init_solarized();
13514
13517
  init_tokyo_night();
13515
13518
  THEME_REGISTRY = [
13516
- ccflareLight,
13517
- ccflareDark,
13519
+ agentSmithLight,
13520
+ agentSmithDark,
13518
13521
  tokyoNight,
13519
13522
  catppuccinMocha,
13520
13523
  catppuccinMacchiato,
@@ -14059,17 +14062,17 @@ function validateProxyKeyFile(proxyKeyFile) {
14059
14062
  try {
14060
14063
  metadata = statSync3(resolvedPath);
14061
14064
  } catch {
14062
- throw new Error("Agent-smith forwarding-key file is not readable");
14065
+ throw new Error("Agent Smith forwarding-key file is not readable");
14063
14066
  }
14064
14067
  if (!metadata.isFile()) {
14065
- throw new Error("Agent-smith forwarding-key path must be a file");
14068
+ throw new Error("Agent Smith forwarding-key path must be a file");
14066
14069
  }
14067
14070
  if ((metadata.mode & 63) !== 0) {
14068
- throw new Error("Agent-smith forwarding-key file must be owner-only");
14071
+ throw new Error("Agent Smith forwarding-key file must be owner-only");
14069
14072
  }
14070
14073
  const key = readFileSync4(resolvedPath, "utf8").trim();
14071
14074
  if (!/^[\x21-\x7e]{1,512}$/.test(key)) {
14072
- throw new Error("Agent-smith forwarding-key file is invalid");
14075
+ throw new Error("Agent Smith forwarding-key file is invalid");
14073
14076
  }
14074
14077
  return resolvedPath;
14075
14078
  }
@@ -14078,7 +14081,7 @@ function proxyKeySetup(proxyKeyFile) {
14078
14081
  return `export AGENT_SMITH_PROXY_KEY=${shellQuote(LOCAL_CLIENT_KEY)}`;
14079
14082
  }
14080
14083
  return `if [ ! -r ${shellQuote(proxyKeyFile)} ]; then
14081
- echo "Agent-smith forwarding-key file is not readable" >&2
14084
+ echo "Agent Smith forwarding-key file is not readable" >&2
14082
14085
  exit 1
14083
14086
  fi
14084
14087
  export AGENT_SMITH_PROXY_KEY=$(cat ${shellQuote(proxyKeyFile)})`;
@@ -14086,11 +14089,12 @@ export AGENT_SMITH_PROXY_KEY=$(cat ${shellQuote(proxyKeyFile)})`;
14086
14089
  function claudeWrapper(claudePath, baseUrl, proxyKeyFile) {
14087
14090
  return `#!/bin/sh
14088
14091
  # Generated by agent-smith. This file delegates to the real Claude Code binary.
14089
- unset CF_ADMIN_KEY
14090
- unset CF_PROXY_KEY
14092
+ unset AGENT_SMITH_ADMIN_KEY
14093
+ unset AGENT_SMITH_PROXY_KEY
14094
+ unset ANTHROPIC_AUTH_TOKEN
14091
14095
  ${proxyKeySetup(proxyKeyFile)}
14092
14096
  export ANTHROPIC_API_KEY="$AGENT_SMITH_PROXY_KEY"
14093
- export ANTHROPIC_AUTH_TOKEN="$AGENT_SMITH_PROXY_KEY"
14097
+ unset AGENT_SMITH_PROXY_KEY
14094
14098
  export ANTHROPIC_BASE_URL=${shellQuote(baseUrl)}
14095
14099
  exec ${shellQuote(claudePath)} "$@"
14096
14100
  `;
@@ -14098,7 +14102,7 @@ exec ${shellQuote(claudePath)} "$@"
14098
14102
  function codexWrapper(codexPath, baseUrl, proxyKeyFile) {
14099
14103
  const config = [
14100
14104
  'model_provider="agent_smith"',
14101
- 'model_providers.agent_smith.name="Agent-smith"',
14105
+ 'model_providers.agent_smith.name="Agent Smith"',
14102
14106
  `model_providers.agent_smith.base_url="${baseUrl}"`,
14103
14107
  'model_providers.agent_smith.env_key="AGENT_SMITH_PROXY_KEY"',
14104
14108
  'model_providers.agent_smith.wire_api="responses"',
@@ -14108,8 +14112,8 @@ function codexWrapper(codexPath, baseUrl, proxyKeyFile) {
14108
14112
  const overrides = config.map((entry) => ` -c ${shellQuote(entry)}`).join(" \\\n");
14109
14113
  return `#!/bin/sh
14110
14114
  # Generated by agent-smith. This file delegates to the real Codex binary.
14111
- unset CF_ADMIN_KEY
14112
- unset CF_PROXY_KEY
14115
+ unset AGENT_SMITH_ADMIN_KEY
14116
+ unset AGENT_SMITH_PROXY_KEY
14113
14117
  ${proxyKeySetup(proxyKeyFile)}
14114
14118
  exec ${shellQuote(codexPath)} \\
14115
14119
  ${overrides} \\
@@ -14118,7 +14122,7 @@ ${overrides} \\
14118
14122
  }
14119
14123
  async function installClientWrappers(options) {
14120
14124
  if (options.baseUrl && !options.proxyKeyFile) {
14121
- throw new Error("A configured Agent-smith server requires a forwarding key file");
14125
+ throw new Error("A configured Agent Smith server requires a forwarding key file");
14122
14126
  }
14123
14127
  mkdirSync4(options.binDir, { recursive: true, mode: 448 });
14124
14128
  const proxyKeyFile = options.proxyKeyFile ? validateProxyKeyFile(options.proxyKeyFile) : undefined;
@@ -14373,18 +14377,18 @@ function claudeProxyBaseUrl(port, usePool = false) {
14373
14377
  }
14374
14378
  function claudeRunEnvironment(port, proxyKey, environment = process.env, usePool = false) {
14375
14379
  const childEnvironment = { ...environment };
14376
- delete childEnvironment.CF_ADMIN_KEY;
14377
- delete childEnvironment.CF_PROXY_KEY;
14380
+ delete childEnvironment.AGENT_SMITH_ADMIN_KEY;
14381
+ delete childEnvironment.AGENT_SMITH_PROXY_KEY;
14382
+ delete childEnvironment.ANTHROPIC_AUTH_TOKEN;
14378
14383
  return {
14379
14384
  ...childEnvironment,
14380
14385
  ANTHROPIC_API_KEY: proxyKey,
14381
- ANTHROPIC_AUTH_TOKEN: proxyKey,
14382
14386
  ANTHROPIC_BASE_URL: claudeProxyBaseUrl(port, usePool)
14383
14387
  };
14384
14388
  }
14385
14389
  function requireProxyKey(proxyKey) {
14386
14390
  if (!proxyKey) {
14387
- throw new Error("ccflare run requires CF_PROXY_KEY to authenticate its local proxy");
14391
+ throw new Error("agent-smith run requires AGENT_SMITH_PROXY_KEY to authenticate its local proxy");
14388
14392
  }
14389
14393
  return proxyKey;
14390
14394
  }
@@ -14515,7 +14519,7 @@ function loadPersistedThemeId() {
14515
14519
  }
14516
14520
  }
14517
14521
  } catch {}
14518
- return "ccflare-dark";
14522
+ return "agent-smith-dark";
14519
14523
  }
14520
14524
  function persistThemeId(themeId) {
14521
14525
  try {
@@ -14547,7 +14551,7 @@ function getAvailableThemes() {
14547
14551
  var CONFIG_DIR, CONFIG_FILE, currentThemeId, currentColors, C, NAV_ITEMS, SCREEN_TITLES;
14548
14552
  var init_theme = __esm(() => {
14549
14553
  init_src12();
14550
- CONFIG_DIR = join9(homedir3(), ".config", "ccflare");
14554
+ CONFIG_DIR = join9(homedir3(), ".config", "agent-smith");
14551
14555
  CONFIG_FILE = join9(CONFIG_DIR, "theme.json");
14552
14556
  currentThemeId = loadPersistedThemeId();
14553
14557
  currentColors = themeToTuiColors(getThemeById(currentThemeId) ?? getDefaultTheme("dark"));
@@ -15137,7 +15141,7 @@ function AccountsScreen({ refreshKey, port }) {
15137
15141
  /* @__PURE__ */ jsxs("text", {
15138
15142
  fg: C.dim,
15139
15143
  children: [
15140
- "The real clients are not overwritten. Agent-smith adds only its marked PATH block to ",
15144
+ "The real clients are not overwritten. Agent Smith adds only its marked PATH block to ",
15141
15145
  paths2.shellProfile,
15142
15146
  "."
15143
15147
  ]
@@ -15145,7 +15149,7 @@ function AccountsScreen({ refreshKey, port }) {
15145
15149
  ]
15146
15150
  }) : /* @__PURE__ */ jsx("text", {
15147
15151
  fg: C.dim,
15148
- children: "Remove Agent-smith's wrappers and its marked PATH block. The real clients remain unchanged."
15152
+ children: "Remove Agent Smith's wrappers and its marked PATH block. The real clients remain unchanged."
15149
15153
  }),
15150
15154
  /* @__PURE__ */ jsx("text", {
15151
15155
  fg: C.muted,
@@ -17647,7 +17651,7 @@ function ThemePicker({ onClose }) {
17647
17651
  }),
17648
17652
  /* @__PURE__ */ jsx12("text", {
17649
17653
  fg: C.muted,
17650
- children: "Persists to ~/.config/ccflare/theme.json"
17654
+ children: "Persists to ~/.config/agent-smith/theme.json"
17651
17655
  })
17652
17656
  ]
17653
17657
  }) : /* @__PURE__ */ jsx12("text", {
@@ -17993,7 +17997,7 @@ Examples:
17993
17997
  agent-smith --pause work # Pause account
17994
17998
  agent-smith --analyze # Run performance analysis
17995
17999
  agent-smith --stats # View stats
17996
- agent-smith install-client # Configure Claude Code and Codex for this Agent-smith server
18000
+ agent-smith install-client # Configure Claude Code and Codex for this Agent Smith server
17997
18001
  `);
17998
18002
  process.exit(0);
17999
18003
  }
@@ -18022,14 +18026,15 @@ Examples:
18022
18026
  baseUrl: client2.baseUrl,
18023
18027
  proxyKeyFile: client2.proxyKeyFile
18024
18028
  });
18025
- console.log(`Claude Code and Codex now route through ${client2.baseUrl}`);
18029
+ console.log(`Client wrappers configured for ${client2.baseUrl}.`);
18030
+ console.log("Open a new shell and launch Claude Code or Codex through these wrappers. Already-running sessions are unchanged; restart or resume them through the wrapper.");
18026
18031
  return;
18027
18032
  }
18028
18033
  if (parsed.run) {
18029
18034
  printPocNotice();
18030
18035
  const config2 = new Config;
18031
18036
  const port2 = parsed.port || config2.getRuntime().port || NETWORK.DEFAULT_PORT;
18032
- const proxyKey = requireProxyKey(process.env.CF_PROXY_KEY ?? "");
18037
+ const proxyKey = requireProxyKey(process.env.AGENT_SMITH_PROXY_KEY ?? "");
18033
18038
  const proxyServer = startServer({ port: port2, withDashboard: false });
18034
18039
  let exitCode;
18035
18040
  try {
@@ -18180,8 +18185,8 @@ var init_main = __esm(() => {
18180
18185
 
18181
18186
  // src/bundled-assets.ts
18182
18187
  import { join } from "path";
18183
- process.env.CF_DASHBOARD_DIST_DIR ??= join(import.meta.dir, "dashboard");
18184
- process.env.CF_USAGE_WORKER_PATH ??= join(import.meta.dir, "post-processor.worker.js");
18188
+ process.env.AGENT_SMITH_DASHBOARD_DIST_DIR ??= join(import.meta.dir, "dashboard");
18189
+ process.env.AGENT_SMITH_USAGE_WORKER_PATH ??= join(import.meta.dir, "post-processor.worker.js");
18185
18190
 
18186
18191
  // src/bin.ts
18187
18192
  await Promise.resolve().then(() => (init_main(), exports_main));