replicas-engine 0.1.50 → 0.1.51

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/src/index.js CHANGED
@@ -913,6 +913,8 @@ var WORKSPACE_FILE_CONTENT_MAX_SIZE_BYTES = 1 * 1024 * 1024;
913
913
  // src/services/environment-details-service.ts
914
914
  var REPLICAS_DIR = join5(homedir4(), ".replicas");
915
915
  var ENVIRONMENT_DETAILS_FILE = join5(REPLICAS_DIR, "environment-details.json");
916
+ var CLAUDE_CREDENTIALS_PATH = join5(homedir4(), ".claude", ".credentials.json");
917
+ var CODEX_AUTH_PATH = join5(homedir4(), ".codex", "auth.json");
916
918
  function createExecutionItem(status, details) {
917
919
  return { status, details: details ?? null };
918
920
  }
@@ -928,12 +930,49 @@ function createDefaultDetails() {
928
930
  repositoriesCloned: [],
929
931
  gitIdentityConfigured: false,
930
932
  githubCredentialsConfigured: false,
931
- codexAuthConfigured: false,
932
- claudeAuthConfigured: false,
933
- bedrockAuthConfigured: false,
933
+ linearAccessConfigured: false,
934
+ slackAccessConfigured: false,
935
+ githubAccessConfigured: false,
936
+ claudeAuthMethod: "none",
937
+ codexAuthMethod: "none",
934
938
  lastUpdatedAt: (/* @__PURE__ */ new Date()).toISOString()
935
939
  };
936
940
  }
941
+ function getClaudeAuthMethod() {
942
+ if (existsSync3(CLAUDE_CREDENTIALS_PATH)) {
943
+ return "oauth";
944
+ }
945
+ if (ENGINE_ENV.CLAUDE_CODE_USE_BEDROCK && ENGINE_ENV.AWS_ACCESS_KEY_ID && ENGINE_ENV.AWS_SECRET_ACCESS_KEY) {
946
+ return "bedrock";
947
+ }
948
+ if (ENGINE_ENV.ANTHROPIC_API_KEY) {
949
+ return "api_key";
950
+ }
951
+ return "none";
952
+ }
953
+ function getCodexAuthMethod() {
954
+ if (existsSync3(CODEX_AUTH_PATH)) {
955
+ return "oauth";
956
+ }
957
+ if (ENGINE_ENV.OPENAI_API_KEY) {
958
+ return "api_key";
959
+ }
960
+ return "none";
961
+ }
962
+ function getLiveDetails(current) {
963
+ const claudeAuthMethod = getClaudeAuthMethod();
964
+ const codexAuthMethod = getCodexAuthMethod();
965
+ return {
966
+ ...current,
967
+ engineVersion: REPLICAS_ENGINE_VERSION,
968
+ linearAccessConfigured: Boolean(ENGINE_ENV.LINEAR_SESSION_ID || ENGINE_ENV.LINEAR_ACCESS_TOKEN),
969
+ slackAccessConfigured: Boolean(ENGINE_ENV.SLACK_BOT_TOKEN),
970
+ githubAccessConfigured: Boolean(ENGINE_ENV.GH_TOKEN),
971
+ githubCredentialsConfigured: Boolean(ENGINE_ENV.GH_TOKEN),
972
+ claudeAuthMethod,
973
+ codexAuthMethod
974
+ };
975
+ }
937
976
  function mergeUnique(current, incoming) {
938
977
  if (!incoming || incoming.length === 0) {
939
978
  return current;
@@ -973,10 +1012,7 @@ var EnvironmentDetailsService = class {
973
1012
  }
974
1013
  async getDetails() {
975
1014
  const current = await this.readDetails();
976
- return {
977
- ...current,
978
- engineVersion: REPLICAS_ENGINE_VERSION
979
- };
1015
+ return getLiveDetails(current);
980
1016
  }
981
1017
  async track(update) {
982
1018
  const current = await this.readDetails();
@@ -992,9 +1028,6 @@ var EnvironmentDetailsService = class {
992
1028
  repositoriesCloned: mergeUnique(current.repositoriesCloned, update.repositoriesCloned),
993
1029
  gitIdentityConfigured: update.gitIdentityConfigured ?? current.gitIdentityConfigured,
994
1030
  githubCredentialsConfigured: update.githubCredentialsConfigured ?? current.githubCredentialsConfigured,
995
- codexAuthConfigured: update.codexAuthConfigured ?? current.codexAuthConfigured,
996
- claudeAuthConfigured: update.claudeAuthConfigured ?? current.claudeAuthConfigured,
997
- bedrockAuthConfigured: update.bedrockAuthConfigured ?? current.bedrockAuthConfigured,
998
1031
  lastUpdatedAt: (/* @__PURE__ */ new Date()).toISOString()
999
1032
  };
1000
1033
  await this.writeDetails(next);
@@ -1029,11 +1062,10 @@ var EnvironmentDetailsService = class {
1029
1062
  return createDefaultDetails();
1030
1063
  }
1031
1064
  const raw = await readFile2(ENVIRONMENT_DETAILS_FILE, "utf-8");
1032
- return {
1065
+ return getLiveDetails({
1033
1066
  ...createDefaultDetails(),
1034
- ...JSON.parse(raw),
1035
- engineVersion: REPLICAS_ENGINE_VERSION
1036
- };
1067
+ ...JSON.parse(raw)
1068
+ });
1037
1069
  } catch {
1038
1070
  return createDefaultDetails();
1039
1071
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "replicas-engine",
3
- "version": "0.1.50",
3
+ "version": "0.1.51",
4
4
  "description": "Lightweight API server for Replicas workspaces",
5
5
  "type": "module",
6
6
  "main": "dist/src/index.js",
@@ -1,28 +0,0 @@
1
- import { defineConfig } from 'tsup';
2
- export default defineConfig({
3
- entry: ['src/index.ts'],
4
- format: ['esm'],
5
- bundle: true,
6
- // Bundle @replicas/shared inline, all other dependencies are automatically external
7
- noExternal: ['@replicas/shared'],
8
- dts: false, // We don't need type definitions for the published package
9
- clean: true,
10
- // Output to dist/src to match existing structure
11
- outDir: 'dist/src',
12
- // Add shebang for the bin script
13
- banner: {
14
- js: '#!/usr/bin/env node',
15
- },
16
- // Preserve the directory structure
17
- outExtension() {
18
- return {
19
- js: '.js',
20
- };
21
- },
22
- // Resolve path mappings from tsconfig
23
- esbuildOptions(options) {
24
- options.alias = {
25
- '@replicas/shared': '../shared/src',
26
- };
27
- },
28
- });