@signetai/connector-forge 0.147.21 → 0.147.22

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 +13 -5
  2. package/package.json +3 -3
package/dist/index.js CHANGED
@@ -15,7 +15,7 @@ import { isAbsolute, join as join6, relative, resolve as resolve2, sep } from "n
15
15
 
16
16
  // ../../../libs/connector-base/dist/index.js
17
17
  import { randomBytes } from "node:crypto";
18
- import { existsSync, readFileSync, renameSync, unlinkSync as unlinkSync2, writeFileSync } from "node:fs";
18
+ import { existsSync, readFileSync, renameSync, statSync, unlinkSync as unlinkSync2, writeFileSync } from "node:fs";
19
19
  import { homedir } from "node:os";
20
20
  import { dirname as dirname2, join as join3, resolve } from "node:path";
21
21
  import { createRequire } from "node:module";
@@ -11019,12 +11019,16 @@ function isSignetGeneratedFile(raw) {
11019
11019
  `).slice(0, 6);
11020
11020
  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]));
11021
11021
  }
11022
- function atomicWriteJson(path, data, indent = 2) {
11023
- const content = `${JSON.stringify(data, null, indent)}
11024
- `;
11022
+ function atomicWriteText(path, content, mode) {
11025
11023
  const tmp = join3(dirname2(path), `.${randomBytes(6).toString("hex")}.tmp`);
11024
+ let writeMode = mode;
11025
+ if (writeMode === undefined) {
11026
+ try {
11027
+ writeMode = statSync(path).mode & 511;
11028
+ } catch {}
11029
+ }
11026
11030
  try {
11027
- writeFileSync(tmp, content, "utf-8");
11031
+ writeFileSync(tmp, content, { encoding: "utf-8", mode: writeMode });
11028
11032
  renameSync(tmp, path);
11029
11033
  } catch (err) {
11030
11034
  try {
@@ -11033,6 +11037,10 @@ function atomicWriteJson(path, data, indent = 2) {
11033
11037
  throw err;
11034
11038
  }
11035
11039
  }
11040
+ function atomicWriteJson(path, data, indent = 2) {
11041
+ atomicWriteText(path, `${JSON.stringify(data, null, indent)}
11042
+ `);
11043
+ }
11036
11044
  function readManagedTrimmedEnv(name) {
11037
11045
  const value = process.env[name];
11038
11046
  if (typeof value !== "string")
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@signetai/connector-forge",
3
- "version": "0.147.21",
3
+ "version": "0.147.22",
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.147.21",
28
- "@signetai/core": "0.147.21"
27
+ "@signetai/connector-base": "0.147.22",
28
+ "@signetai/core": "0.147.22"
29
29
  },
30
30
  "devDependencies": {
31
31
  "@types/node": "^22.0.0",