@signetai/connector-forge 0.154.4 → 0.154.7

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/dist/index.js +161 -77
  2. package/package.json +3 -3
package/dist/index.js CHANGED
@@ -6,29 +6,32 @@ import {
6
6
  readFileSync as readFileSync2,
7
7
  readdirSync,
8
8
  readlinkSync,
9
- rmSync,
9
+ rmSync as rmSync2,
10
10
  unlinkSync as unlinkSync3,
11
- writeFileSync as writeFileSync2
11
+ writeFileSync as writeFileSync3
12
12
  } from "node:fs";
13
- import { homedir as homedir4 } from "node:os";
13
+ import { homedir as homedir5 } from "node:os";
14
14
  import { isAbsolute, join as join6, relative, resolve as resolve2, sep } from "node:path";
15
15
 
16
16
  // ../../../libs/connector-base/dist/index.js
17
17
  import { randomBytes } from "node:crypto";
18
- import { existsSync, readFileSync, renameSync, statSync, unlinkSync as unlinkSync2, writeFileSync } from "node:fs";
18
+ import { existsSync, readFileSync, renameSync, statSync as statSync2, unlinkSync as unlinkSync2, writeFileSync } from "node:fs";
19
19
  import { homedir } from "node:os";
20
- import { dirname as dirname2, join as join3, resolve } from "node:path";
20
+ import { dirname as dirname3, join as join3 } from "node:path";
21
21
  import { createRequire } from "node:module";
22
22
  import { dirname, join } from "node:path";
23
23
  import { fileURLToPath } from "node:url";
24
24
  import { homedir as homedir2 } from "os";
25
25
  import { join as join2 } from "path";
26
+ import { existsSync as existsSync4, mkdirSync as mkdirSync2, readFileSync as readFileSync3, rmSync, statSync, writeFileSync as writeFileSync2 } from "node:fs";
27
+ import { homedir as homedir3 } from "node:os";
28
+ import { dirname as dirname2, join as join5, resolve } from "node:path";
26
29
  import { createRequire as createRequire2 } from "node:module";
27
- import { homedir as homedir3, platform as platform2 } from "node:os";
28
- import { basename, dirname as dirname3, resolve as resolve3 } from "node:path";
29
- import { homedir as homedir7 } from "node:os";
30
- import { existsSync as existsSync12, lstatSync, mkdirSync as mkdirSync8, readdirSync as readdirSync6, symlinkSync, unlinkSync } from "node:fs";
31
- import { join as join12 } from "node:path";
30
+ import { homedir as homedir4, platform as platform2 } from "node:os";
31
+ import { basename, dirname as dirname4, resolve as resolve4 } from "node:path";
32
+ import { homedir as homedir8 } from "node:os";
33
+ import { existsSync as existsSync13, lstatSync, mkdirSync as mkdirSync9, readdirSync as readdirSync6, symlinkSync, unlinkSync } from "node:fs";
34
+ import { join as join13 } from "node:path";
32
35
  var __create2 = Object.create;
33
36
  var __getProtoOf2 = Object.getPrototypeOf;
34
37
  var __defProp2 = Object.defineProperty;
@@ -10714,6 +10717,109 @@ function expandHome(p, home = homedir2()) {
10714
10717
  }
10715
10718
  var LOCAL_BINDS = new Set(["127.0.0.1", "localhost", "::1", "::ffff:127.0.0.1"]);
10716
10719
  var import_yaml2 = __toESM2(require_dist(), 1);
10720
+ var WORKSPACE_ENV_KEYS = ["SIGNET_PATH", "SIGNET_WORKSPACE"];
10721
+ var DEFAULT_AGENTS_DIRNAME = ".agents";
10722
+ function normalizeWorkspacePath(pathValue, home = homedir3()) {
10723
+ return resolve(expandHome(pathValue.trim(), home));
10724
+ }
10725
+ function readTrimmedEnv(env, name) {
10726
+ const value = env[name];
10727
+ if (typeof value !== "string")
10728
+ return;
10729
+ const trimmed = value.trim();
10730
+ return trimmed.length > 0 ? trimmed : undefined;
10731
+ }
10732
+ function readConfigHome(env, home) {
10733
+ const raw = env.XDG_CONFIG_HOME;
10734
+ if (typeof raw !== "string")
10735
+ return join5(home, ".config");
10736
+ const trimmed = raw.trim();
10737
+ return trimmed.length > 0 ? normalizeWorkspacePath(trimmed, home) : join5(home, ".config");
10738
+ }
10739
+ function isExistingDirectory(path) {
10740
+ try {
10741
+ return statSync(path).isDirectory();
10742
+ } catch {
10743
+ return false;
10744
+ }
10745
+ }
10746
+ function isRecord4(value) {
10747
+ return typeof value === "object" && value !== null && !Array.isArray(value);
10748
+ }
10749
+ function getWorkspaceConfigPath(env = process.env, home = homedir3()) {
10750
+ return join5(readConfigHome(env, home), "signet", "workspace.json");
10751
+ }
10752
+ function readConfiguredWorkspacePath(env = process.env, home = homedir3(), options = {}) {
10753
+ const strict = options.strict ?? false;
10754
+ const configPath = getWorkspaceConfigPath(env, home);
10755
+ if (!existsSync4(configPath))
10756
+ return null;
10757
+ let raw;
10758
+ try {
10759
+ raw = JSON.parse(readFileSync3(configPath, "utf-8"));
10760
+ } catch (err) {
10761
+ if (strict) {
10762
+ const detail = err instanceof Error ? err.message : String(err);
10763
+ throw new Error(`Invalid Signet workspace config at ${configPath}: ${detail}`);
10764
+ }
10765
+ return null;
10766
+ }
10767
+ if (!isRecord4(raw) || !("workspace" in raw)) {
10768
+ if (strict)
10769
+ throw new Error(`Invalid Signet workspace config at ${configPath}: missing workspace`);
10770
+ return null;
10771
+ }
10772
+ const workspace = raw.workspace;
10773
+ if (typeof workspace !== "string" || workspace.trim().length === 0) {
10774
+ if (strict)
10775
+ throw new Error(`Invalid Signet workspace config at ${configPath}: workspace must be a non-empty string`);
10776
+ return null;
10777
+ }
10778
+ return normalizeWorkspacePath(workspace, home);
10779
+ }
10780
+ function resolveWorkspacePath(options = {}) {
10781
+ const env = options.env ?? process.env;
10782
+ const home = options.home ?? homedir3();
10783
+ const strict = options.strict ?? false;
10784
+ const requireExistingEnvPath = options.requireExistingEnvPath ?? false;
10785
+ const configPath = getWorkspaceConfigPath(env, home);
10786
+ const envPath = resolveEnvWorkspace(env, home, requireExistingEnvPath);
10787
+ const configValue = readConfiguredWorkspacePath(env, home, { strict: envPath ? false : strict });
10788
+ if (envPath) {
10789
+ return {
10790
+ path: envPath,
10791
+ source: "env",
10792
+ configPath,
10793
+ configuredPath: configValue
10794
+ };
10795
+ }
10796
+ if (configValue) {
10797
+ return {
10798
+ path: configValue,
10799
+ source: "config",
10800
+ configPath,
10801
+ configuredPath: configValue
10802
+ };
10803
+ }
10804
+ return {
10805
+ path: join5(home, DEFAULT_AGENTS_DIRNAME),
10806
+ source: "default",
10807
+ configPath,
10808
+ configuredPath: configValue
10809
+ };
10810
+ }
10811
+ function resolveEnvWorkspace(env, home, requireExisting) {
10812
+ for (const key of WORKSPACE_ENV_KEYS) {
10813
+ const raw = readTrimmedEnv(env, key);
10814
+ if (!raw)
10815
+ continue;
10816
+ const normalized = normalizeWorkspacePath(raw, home);
10817
+ if (!requireExisting || isExistingDirectory(normalized))
10818
+ return normalized;
10819
+ console.warn(`[signet] ${key}="${raw}" does not point to an existing workspace directory; using the default workspace resolution instead.`);
10820
+ }
10821
+ return null;
10822
+ }
10717
10823
  var native = null;
10718
10824
  try {
10719
10825
  const esmRequire = createRequire2(import.meta.url);
@@ -10788,11 +10894,11 @@ var VALID_GITHUB_RESOURCE_TYPES = new Set(DEFAULT_GITHUB_RESOURCE_TYPES);
10788
10894
  function defaultDiscordDesktopCachePath() {
10789
10895
  switch (platform2()) {
10790
10896
  case "darwin":
10791
- return resolve3(homedir3(), "Library", "Application Support", "discord");
10897
+ return resolve4(homedir4(), "Library", "Application Support", "discord");
10792
10898
  case "win32":
10793
- return resolve3(process.env.APPDATA || resolve3(homedir3(), "AppData", "Roaming"), "discord");
10899
+ return resolve4(process.env.APPDATA || resolve4(homedir4(), "AppData", "Roaming"), "discord");
10794
10900
  default:
10795
- return resolve3(process.env.XDG_CONFIG_HOME || resolve3(homedir3(), ".config"), "discord");
10901
+ return resolve4(process.env.XDG_CONFIG_HOME || resolve4(homedir4(), ".config"), "discord");
10796
10902
  }
10797
10903
  }
10798
10904
  var IDENTITY_FILES = {
@@ -10860,15 +10966,15 @@ function symlinkSkills(sourceDir, targetDir, options = {}) {
10860
10966
  skipped: [],
10861
10967
  errors: []
10862
10968
  };
10863
- if (!existsSync12(sourceDir)) {
10969
+ if (!existsSync13(sourceDir)) {
10864
10970
  return result;
10865
10971
  }
10866
- const targetParent = join12(targetDir, "..");
10867
- if (!existsSync12(targetParent)) {
10868
- mkdirSync8(targetParent, { recursive: true });
10972
+ const targetParent = join13(targetDir, "..");
10973
+ if (!existsSync13(targetParent)) {
10974
+ mkdirSync9(targetParent, { recursive: true });
10869
10975
  }
10870
- if (!existsSync12(targetDir)) {
10871
- mkdirSync8(targetDir, { recursive: true });
10976
+ if (!existsSync13(targetDir)) {
10977
+ mkdirSync9(targetDir, { recursive: true });
10872
10978
  }
10873
10979
  let entries;
10874
10980
  try {
@@ -10881,8 +10987,8 @@ function symlinkSkills(sourceDir, targetDir, options = {}) {
10881
10987
  return result;
10882
10988
  }
10883
10989
  for (const entry of entries) {
10884
- const srcPath = join12(sourceDir, entry);
10885
- const destPath = join12(targetDir, entry);
10990
+ const srcPath = join13(sourceDir, entry);
10991
+ const destPath = join13(targetDir, entry);
10886
10992
  try {
10887
10993
  const src = lstatSync(srcPath);
10888
10994
  if (src.isSymbolicLink() || !src.isDirectory()) {
@@ -10923,7 +11029,7 @@ function symlinkSkills(sourceDir, targetDir, options = {}) {
10923
11029
  }
10924
11030
  return result;
10925
11031
  }
10926
- var home = homedir7();
11032
+ var home = homedir8();
10927
11033
  var SIGNET_BLOCK_START = "<!-- SIGNET:START -->";
10928
11034
  var SIGNET_BLOCK_END = "<!-- SIGNET:END -->";
10929
11035
  function stripSignetBlock(content) {
@@ -11080,7 +11186,7 @@ class BaseConnector {
11080
11186
  generateHeader(sourcePath, targetName) {
11081
11187
  const name = targetName || this.name;
11082
11188
  const safe = (p) => p.replace(/[\n\r]/g, "");
11083
- const root = dirname2(sourcePath);
11189
+ const root = dirname3(sourcePath);
11084
11190
  return `# Auto-generated from ${safe(sourcePath)}
11085
11191
  # Source: ${safe(sourcePath)}
11086
11192
  # Generated: ${new Date().toISOString()}
@@ -11117,11 +11223,11 @@ function isSignetGeneratedFile(raw) {
11117
11223
  return lines.some((line, i) => /^#\s+AUTO-GENERATED\s+from\s+.*\s+by\s+Signet/i.test(line) || /^#\s+Auto-generated\s+from\s+/.test(line) && i + 1 < lines.length && /^#\s+Source:\s+/.test(lines[i + 1]));
11118
11224
  }
11119
11225
  function atomicWriteText(path, content, mode) {
11120
- const tmp = join3(dirname2(path), `.${randomBytes(6).toString("hex")}.tmp`);
11226
+ const tmp = join3(dirname3(path), `.${randomBytes(6).toString("hex")}.tmp`);
11121
11227
  let writeMode = mode;
11122
11228
  if (writeMode === undefined) {
11123
11229
  try {
11124
- writeMode = statSync(path).mode & 511;
11230
+ writeMode = statSync2(path).mode & 511;
11125
11231
  } catch {}
11126
11232
  }
11127
11233
  try {
@@ -11161,29 +11267,7 @@ function readManagedTrimmedEnv(name) {
11161
11267
  return trimmed.length > 0 ? trimmed : undefined;
11162
11268
  }
11163
11269
  function resolveSignetWorkspacePath(home2 = homedir()) {
11164
- const configured = readManagedTrimmedEnv("SIGNET_PATH");
11165
- if (configured)
11166
- return resolve(expandHome(configured));
11167
- const defaultWorkspace = join3(home2, ".agents");
11168
- const configHome = readManagedTrimmedEnv("XDG_CONFIG_HOME") ?? join3(home2, ".config");
11169
- const workspaceConfigPath = join3(configHome, "signet", "workspace.json");
11170
- if (!existsSync(workspaceConfigPath))
11171
- return defaultWorkspace;
11172
- let raw;
11173
- try {
11174
- raw = JSON.parse(readFileSync(workspaceConfigPath, "utf8"));
11175
- } catch (err) {
11176
- const detail = err instanceof Error ? err.message : String(err);
11177
- throw new Error(`Invalid Signet workspace config at ${workspaceConfigPath}: ${detail}`);
11178
- }
11179
- if (typeof raw !== "object" || raw === null || !("workspace" in raw)) {
11180
- throw new Error(`Invalid Signet workspace config at ${workspaceConfigPath}: missing workspace`);
11181
- }
11182
- const workspace = raw.workspace;
11183
- if (typeof workspace !== "string" || workspace.trim().length === 0) {
11184
- throw new Error(`Invalid Signet workspace config at ${workspaceConfigPath}: workspace must be a non-empty string`);
11185
- }
11186
- return resolve(expandHome(workspace.trim()));
11270
+ return resolveWorkspacePath({ home: home2, strict: true, requireExistingEnvPath: true }).path;
11187
11271
  }
11188
11272
  function resolveSignetApiKey() {
11189
11273
  return readManagedTrimmedEnv("SIGNET_API_KEY") ?? readManagedTrimmedEnv("SIGNET_TOKEN");
@@ -11191,16 +11275,16 @@ function resolveSignetApiKey() {
11191
11275
 
11192
11276
  // ../../../platform/core/dist/index.js
11193
11277
  import { createRequire as createRequire3 } from "node:module";
11194
- import { dirname as dirname4, join as join4 } from "node:path";
11278
+ import { dirname as dirname5, join as join4 } from "node:path";
11195
11279
  import { fileURLToPath as fileURLToPath2 } from "node:url";
11196
11280
  import { homedir as homedir22 } from "os";
11197
11281
  import { join as join22 } from "path";
11198
11282
  import { createRequire as createRequire22 } from "node:module";
11199
- import { homedir as homedir32, platform as platform22 } from "node:os";
11200
- import { basename as basename2, dirname as dirname32, resolve as resolve32 } from "node:path";
11201
- import { existsSync as existsSync10, readFileSync as readFileSync8, readdirSync as readdirSync4, realpathSync, statSync as statSync4 } from "node:fs";
11202
- import { dirname as dirname6, join as join10 } from "node:path";
11203
- import { homedir as homedir72 } from "node:os";
11283
+ import { homedir as homedir42, platform as platform22 } from "node:os";
11284
+ import { basename as basename2, dirname as dirname42, resolve as resolve42 } from "node:path";
11285
+ import { existsSync as existsSync11, readFileSync as readFileSync9, readdirSync as readdirSync4, realpathSync, statSync as statSync5 } from "node:fs";
11286
+ import { dirname as dirname7, join as join11 } from "node:path";
11287
+ import { homedir as homedir82 } from "node:os";
11204
11288
  var __create = Object.create;
11205
11289
  var __getProtoOf = Object.getPrototypeOf;
11206
11290
  var __defProp = Object.defineProperty;
@@ -21875,7 +21959,7 @@ var MIGRATIONS2 = [
21875
21959
  ];
21876
21960
  var LATEST_SCHEMA_VERSION2 = MIGRATIONS2[MIGRATIONS2.length - 1]?.version ?? 0;
21877
21961
  var __filename22 = fileURLToPath2(import.meta.url);
21878
- var __dirname22 = dirname4(__filename22);
21962
+ var __dirname22 = dirname5(__filename22);
21879
21963
  var import_yaml3 = __toESM(require_dist2(), 1);
21880
21964
  function expandHome2(p, home2 = homedir22()) {
21881
21965
  if (p === "~")
@@ -22039,11 +22123,11 @@ var VALID_GITHUB_RESOURCE_TYPES2 = new Set(DEFAULT_GITHUB_RESOURCE_TYPES2);
22039
22123
  function defaultDiscordDesktopCachePath2() {
22040
22124
  switch (platform22()) {
22041
22125
  case "darwin":
22042
- return resolve32(homedir32(), "Library", "Application Support", "discord");
22126
+ return resolve42(homedir42(), "Library", "Application Support", "discord");
22043
22127
  case "win32":
22044
- return resolve32(process.env.APPDATA || resolve32(homedir32(), "AppData", "Roaming"), "discord");
22128
+ return resolve42(process.env.APPDATA || resolve42(homedir42(), "AppData", "Roaming"), "discord");
22045
22129
  default:
22046
- return resolve32(process.env.XDG_CONFIG_HOME || resolve32(homedir32(), ".config"), "discord");
22130
+ return resolve42(process.env.XDG_CONFIG_HOME || resolve42(homedir42(), ".config"), "discord");
22047
22131
  }
22048
22132
  }
22049
22133
  var IDENTITY_MODES = ["managed", "passthrough", "off"];
@@ -22108,7 +22192,7 @@ function hasValidIdentity(basePath) {
22108
22192
  return true;
22109
22193
  for (const key of REQUIRED_IDENTITY_KEYS2) {
22110
22194
  const spec = IDENTITY_FILES2[key];
22111
- if (!existsSync10(join10(basePath, spec.path))) {
22195
+ if (!existsSync11(join11(basePath, spec.path))) {
22112
22196
  return false;
22113
22197
  }
22114
22198
  }
@@ -22134,16 +22218,16 @@ function resolveIdentityModeFromConfig(config) {
22134
22218
  return "managed";
22135
22219
  }
22136
22220
  function loadIdentityMode(agentsDir) {
22137
- const agentYaml = join10(agentsDir, "agent.yaml");
22138
- if (!existsSync10(agentYaml))
22221
+ const agentYaml = join11(agentsDir, "agent.yaml");
22222
+ if (!existsSync11(agentYaml))
22139
22223
  return "managed";
22140
22224
  try {
22141
- return resolveIdentityModeFromConfig(parseSimpleYaml(readFileSync8(agentYaml, "utf-8")));
22225
+ return resolveIdentityModeFromConfig(parseSimpleYaml(readFileSync9(agentYaml, "utf-8")));
22142
22226
  } catch {
22143
22227
  return "managed";
22144
22228
  }
22145
22229
  }
22146
- var home2 = homedir72();
22230
+ var home2 = homedir82();
22147
22231
  var SKIP_SUBTYPES2 = new Set([
22148
22232
  "channel_join",
22149
22233
  "channel_leave",
@@ -22266,7 +22350,7 @@ var SIGNET_FORGE_MARKER = "Managed by Signet (@signetai/connector-forge)";
22266
22350
  function isJsonObject(value) {
22267
22351
  return typeof value === "object" && value !== null && !Array.isArray(value);
22268
22352
  }
22269
- function readTrimmedEnv(name) {
22353
+ function readTrimmedEnv2(name) {
22270
22354
  const value = process.env[name];
22271
22355
  if (typeof value !== "string")
22272
22356
  return;
@@ -22274,8 +22358,8 @@ function readTrimmedEnv(name) {
22274
22358
  return trimmed.length > 0 ? trimmed : undefined;
22275
22359
  }
22276
22360
  function getHomeDir() {
22277
- const home3 = readTrimmedEnv("HOME");
22278
- return home3 ?? homedir4();
22361
+ const home3 = readTrimmedEnv2("HOME");
22362
+ return home3 ?? homedir5();
22279
22363
  }
22280
22364
  function readJsonObject(path) {
22281
22365
  if (!existsSync2(path))
@@ -22295,9 +22379,9 @@ function readMcpServers(config) {
22295
22379
  }
22296
22380
  function signetRuntimeEnv(basePath) {
22297
22381
  const env = { SIGNET_PATH: basePath };
22298
- const daemonUrl = readTrimmedEnv("SIGNET_DAEMON_URL");
22299
- const apiKey = readTrimmedEnv("SIGNET_API_KEY") ?? readTrimmedEnv("SIGNET_TOKEN");
22300
- const agentId = readTrimmedEnv("SIGNET_AGENT_ID");
22382
+ const daemonUrl = readTrimmedEnv2("SIGNET_DAEMON_URL");
22383
+ const apiKey = readTrimmedEnv2("SIGNET_API_KEY") ?? readTrimmedEnv2("SIGNET_TOKEN");
22384
+ const agentId = readTrimmedEnv2("SIGNET_AGENT_ID");
22301
22385
  if (daemonUrl)
22302
22386
  env.SIGNET_DAEMON_URL = daemonUrl;
22303
22387
  if (apiKey)
@@ -22307,7 +22391,7 @@ function signetRuntimeEnv(basePath) {
22307
22391
  return env;
22308
22392
  }
22309
22393
  function resolveRemoteDaemonUrl() {
22310
- return readTrimmedEnv("SIGNET_DAEMON_URL") ? resolveSignetDaemonUrl() : null;
22394
+ return readTrimmedEnv2("SIGNET_DAEMON_URL") ? resolveSignetDaemonUrl() : null;
22311
22395
  }
22312
22396
  function buildMcpServer(basePath) {
22313
22397
  const remoteDaemonUrl = resolveRemoteDaemonUrl();
@@ -22334,7 +22418,7 @@ class ForgeConnector extends BaseConnector {
22334
22418
  name = "ForgeCode";
22335
22419
  harnessId = "forge";
22336
22420
  getForgeHome() {
22337
- const configured = readTrimmedEnv("FORGE_CONFIG");
22421
+ const configured = readTrimmedEnv2("FORGE_CONFIG");
22338
22422
  if (configured)
22339
22423
  return resolve2(expandHome2(configured));
22340
22424
  const legacyPath = join6(getHomeDir(), "forge");
@@ -22385,7 +22469,7 @@ class ForgeConnector extends BaseConnector {
22385
22469
  try {
22386
22470
  const raw = readFileSync2(staleAgentsPath, "utf-8");
22387
22471
  if (isSignetGeneratedFile(raw) || raw.includes(SIGNET_FORGE_MARKER))
22388
- rmSync(staleAgentsPath);
22472
+ rmSync2(staleAgentsPath);
22389
22473
  } catch {}
22390
22474
  }
22391
22475
  }
@@ -22421,7 +22505,7 @@ class ForgeConnector extends BaseConnector {
22421
22505
  try {
22422
22506
  const raw = readFileSync2(agentsPath, "utf-8");
22423
22507
  if (isSignetGeneratedFile(raw) || raw.includes(SIGNET_FORGE_MARKER)) {
22424
- rmSync(agentsPath, { force: true });
22508
+ rmSync2(agentsPath, { force: true });
22425
22509
  filesRemoved.push(agentsPath);
22426
22510
  }
22427
22511
  } catch {}
@@ -22441,7 +22525,7 @@ class ForgeConnector extends BaseConnector {
22441
22525
  const patched = this.removeMcpServer(config);
22442
22526
  if (patched) {
22443
22527
  if (Object.keys(config).length === 0) {
22444
- rmSync(this.getMcpConfigPath(), { force: true });
22528
+ rmSync2(this.getMcpConfigPath(), { force: true });
22445
22529
  filesRemoved.push(this.getMcpConfigPath());
22446
22530
  } else {
22447
22531
  atomicWriteJson(this.getMcpConfigPath(), config);
@@ -22462,7 +22546,7 @@ class ForgeConnector extends BaseConnector {
22462
22546
  }
22463
22547
  static isHarnessInstalled() {
22464
22548
  const home3 = getHomeDir();
22465
- return existsSync2(readTrimmedEnv("FORGE_CONFIG") ?? "") || existsSync2(join6(home3, "forge", ".mcp.json")) || existsSync2(join6(home3, ".forge", ".mcp.json")) || existsSync2(join6(home3, "forge")) || existsSync2(join6(home3, ".forge"));
22549
+ return existsSync2(readTrimmedEnv2("FORGE_CONFIG") ?? "") || existsSync2(join6(home3, "forge", ".mcp.json")) || existsSync2(join6(home3, ".forge", ".mcp.json")) || existsSync2(join6(home3, "forge")) || existsSync2(join6(home3, ".forge"));
22466
22550
  }
22467
22551
  getAgentsPath() {
22468
22552
  return join6(this.getForgeHome(), "AGENTS.md");
@@ -22483,7 +22567,7 @@ class ForgeConnector extends BaseConnector {
22483
22567
  const body = extras ? `${userContent}${extras}` : userContent;
22484
22568
  const header = this.generateHeader(sourcePath, this.name);
22485
22569
  const targetPath = this.getAgentsPath();
22486
- writeFileSync2(targetPath, `# ${SIGNET_FORGE_MARKER}
22570
+ writeFileSync3(targetPath, `# ${SIGNET_FORGE_MARKER}
22487
22571
  ${header}${body}
22488
22572
  `, "utf-8");
22489
22573
  return targetPath;
@@ -22544,7 +22628,7 @@ ${header}${body}
22544
22628
  }
22545
22629
  try {
22546
22630
  if (readdirSync(skillsDir).length === 0)
22547
- rmSync(skillsDir, { recursive: true, force: true });
22631
+ rmSync2(skillsDir, { recursive: true, force: true });
22548
22632
  } catch {}
22549
22633
  }
22550
22634
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@signetai/connector-forge",
3
- "version": "0.154.4",
3
+ "version": "0.154.7",
4
4
  "description": "Signet connector for ForgeCode - installs MCP, identity, and skills integration",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -24,8 +24,8 @@
24
24
  "typecheck": "tsc --noEmit"
25
25
  },
26
26
  "dependencies": {
27
- "@signetai/connector-base": "0.154.4",
28
- "@signetai/core": "0.154.4"
27
+ "@signetai/connector-base": "0.154.7",
28
+ "@signetai/core": "0.154.7"
29
29
  },
30
30
  "devDependencies": {
31
31
  "@types/node": "^22.0.0",