@signetai/connector-forge 0.200.2 → 0.200.4
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/index.js +58 -58
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -10,14 +10,14 @@ import {
|
|
|
10
10
|
unlinkSync as unlinkSync3,
|
|
11
11
|
writeFileSync as writeFileSync2
|
|
12
12
|
} from "node:fs";
|
|
13
|
-
import { homedir as
|
|
14
|
-
import { join as
|
|
13
|
+
import { homedir as homedir3 } from "node:os";
|
|
14
|
+
import { join as join8, resolve as resolve3 } 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 as renameSync2, statSync
|
|
18
|
+
import { existsSync, readFileSync, renameSync as renameSync2, statSync, unlinkSync as unlinkSync2, writeFileSync } from "node:fs";
|
|
19
19
|
import { homedir } from "node:os";
|
|
20
|
-
import { dirname as
|
|
20
|
+
import { dirname as dirname2, isAbsolute, join as join3, relative, sep } 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";
|
|
@@ -33,19 +33,19 @@ import {
|
|
|
33
33
|
readFileSync as readFileSync3,
|
|
34
34
|
renameSync,
|
|
35
35
|
rmSync,
|
|
36
|
-
statSync,
|
|
36
|
+
statSync as statSync2,
|
|
37
37
|
writeSync
|
|
38
38
|
} from "node:fs";
|
|
39
|
-
import { homedir as homedir3 } from "node:os";
|
|
40
|
-
import { dirname as dirname2, join as join5, resolve } from "node:path";
|
|
41
|
-
import { createRequire as createRequire2 } from "node:module";
|
|
42
39
|
import { homedir as homedir4 } from "node:os";
|
|
43
|
-
import { dirname as dirname3, join as join6, resolve
|
|
44
|
-
import {
|
|
45
|
-
import {
|
|
46
|
-
import {
|
|
40
|
+
import { dirname as dirname3, join as join6, resolve } from "node:path";
|
|
41
|
+
import { createRequire as createRequire2 } from "node:module";
|
|
42
|
+
import { homedir as homedir5 } from "node:os";
|
|
43
|
+
import { dirname as dirname4, join as join7, resolve as resolve2 } from "node:path";
|
|
44
|
+
import { homedir as homedir6, platform as platform2 } from "node:os";
|
|
45
|
+
import { basename, dirname as dirname5, resolve as resolve4 } from "node:path";
|
|
46
|
+
import { homedir as homedir10 } from "node:os";
|
|
47
47
|
import { existsSync as existsSync13, lstatSync, mkdirSync as mkdirSync9, readdirSync as readdirSync6, symlinkSync, unlinkSync } from "node:fs";
|
|
48
|
-
import { join as
|
|
48
|
+
import { join as join14 } from "node:path";
|
|
49
49
|
var __create2 = Object.create;
|
|
50
50
|
var __getProtoOf2 = Object.getPrototypeOf;
|
|
51
51
|
var __defProp2 = Object.defineProperty;
|
|
@@ -12464,7 +12464,7 @@ function resolveSignetDaemonUrl(opts = {}) {
|
|
|
12464
12464
|
}
|
|
12465
12465
|
var WORKSPACE_ENV_KEYS = ["SIGNET_PATH", "SIGNET_WORKSPACE"];
|
|
12466
12466
|
var DEFAULT_AGENTS_DIRNAME = ".agents";
|
|
12467
|
-
function normalizeWorkspacePath(pathValue, home =
|
|
12467
|
+
function normalizeWorkspacePath(pathValue, home = homedir4()) {
|
|
12468
12468
|
return resolve(expandHome(pathValue.trim(), home));
|
|
12469
12469
|
}
|
|
12470
12470
|
function readTrimmedEnv(env, name) {
|
|
@@ -12477,13 +12477,13 @@ function readTrimmedEnv(env, name) {
|
|
|
12477
12477
|
function readConfigHome(env, home) {
|
|
12478
12478
|
const raw = env.XDG_CONFIG_HOME;
|
|
12479
12479
|
if (typeof raw !== "string")
|
|
12480
|
-
return
|
|
12480
|
+
return join6(home, ".config");
|
|
12481
12481
|
const trimmed = raw.trim();
|
|
12482
|
-
return trimmed.length > 0 ? normalizeWorkspacePath(trimmed, home) :
|
|
12482
|
+
return trimmed.length > 0 ? normalizeWorkspacePath(trimmed, home) : join6(home, ".config");
|
|
12483
12483
|
}
|
|
12484
12484
|
function isExistingDirectory(path) {
|
|
12485
12485
|
try {
|
|
12486
|
-
return
|
|
12486
|
+
return statSync2(path).isDirectory();
|
|
12487
12487
|
} catch {
|
|
12488
12488
|
return false;
|
|
12489
12489
|
}
|
|
@@ -12491,10 +12491,10 @@ function isExistingDirectory(path) {
|
|
|
12491
12491
|
function isRecord4(value) {
|
|
12492
12492
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
12493
12493
|
}
|
|
12494
|
-
function getWorkspaceConfigPath(env = process.env, home =
|
|
12495
|
-
return
|
|
12494
|
+
function getWorkspaceConfigPath(env = process.env, home = homedir4()) {
|
|
12495
|
+
return join6(readConfigHome(env, home), "signet", "workspace.json");
|
|
12496
12496
|
}
|
|
12497
|
-
function readConfiguredWorkspacePath(env = process.env, home =
|
|
12497
|
+
function readConfiguredWorkspacePath(env = process.env, home = homedir4(), _options = {}) {
|
|
12498
12498
|
const configPath = getWorkspaceConfigPath(env, home);
|
|
12499
12499
|
if (!existsSync4(configPath))
|
|
12500
12500
|
return null;
|
|
@@ -12516,7 +12516,7 @@ function readConfiguredWorkspacePath(env = process.env, home = homedir3(), _opti
|
|
|
12516
12516
|
}
|
|
12517
12517
|
function resolveWorkspacePath(options = {}) {
|
|
12518
12518
|
const env = options.env ?? process.env;
|
|
12519
|
-
const home = options.home ??
|
|
12519
|
+
const home = options.home ?? homedir4();
|
|
12520
12520
|
const requireExistingEnvPath = options.requireExistingEnvPath ?? false;
|
|
12521
12521
|
const configPath = getWorkspaceConfigPath(env, home);
|
|
12522
12522
|
const envPath = resolveEnvWorkspace(env, home, requireExistingEnvPath);
|
|
@@ -12538,7 +12538,7 @@ function resolveWorkspacePath(options = {}) {
|
|
|
12538
12538
|
};
|
|
12539
12539
|
}
|
|
12540
12540
|
return {
|
|
12541
|
-
path:
|
|
12541
|
+
path: join6(home, DEFAULT_AGENTS_DIRNAME),
|
|
12542
12542
|
source: "default",
|
|
12543
12543
|
configPath,
|
|
12544
12544
|
configuredPath: configValue
|
|
@@ -12561,7 +12561,7 @@ try {
|
|
|
12561
12561
|
const esmRequire = createRequire2(import.meta.url);
|
|
12562
12562
|
native = esmRequire("@signet/native");
|
|
12563
12563
|
} catch {}
|
|
12564
|
-
var GRAPHIQ_DEFAULT_INSTALL_DIR =
|
|
12564
|
+
var GRAPHIQ_DEFAULT_INSTALL_DIR = join7(homedir5(), ".local", "bin");
|
|
12565
12565
|
var SIGNET_SOURCE_CHECKOUT_DIRNAME = "signetai";
|
|
12566
12566
|
var SIGNET_GIT_ALLOWED_DIRECTORIES = ["skills", "tools", "dreaming"];
|
|
12567
12567
|
var SIGNET_GIT_PROTECTED_PATHS = [
|
|
@@ -12631,11 +12631,11 @@ var VALID_GITHUB_RESOURCE_TYPES = new Set(DEFAULT_GITHUB_RESOURCE_TYPES);
|
|
|
12631
12631
|
function defaultDiscordDesktopCachePath() {
|
|
12632
12632
|
switch (platform2()) {
|
|
12633
12633
|
case "darwin":
|
|
12634
|
-
return resolve4(
|
|
12634
|
+
return resolve4(homedir6(), "Library", "Application Support", "discord");
|
|
12635
12635
|
case "win32":
|
|
12636
|
-
return resolve4(process.env.APPDATA || resolve4(
|
|
12636
|
+
return resolve4(process.env.APPDATA || resolve4(homedir6(), "AppData", "Roaming"), "discord");
|
|
12637
12637
|
default:
|
|
12638
|
-
return resolve4(process.env.XDG_CONFIG_HOME || resolve4(
|
|
12638
|
+
return resolve4(process.env.XDG_CONFIG_HOME || resolve4(homedir6(), ".config"), "discord");
|
|
12639
12639
|
}
|
|
12640
12640
|
}
|
|
12641
12641
|
var IDENTITY_FILES = {
|
|
@@ -12706,7 +12706,7 @@ function symlinkSkills(sourceDir, targetDir, options = {}) {
|
|
|
12706
12706
|
if (!existsSync13(sourceDir)) {
|
|
12707
12707
|
return result;
|
|
12708
12708
|
}
|
|
12709
|
-
const targetParent =
|
|
12709
|
+
const targetParent = join14(targetDir, "..");
|
|
12710
12710
|
if (!existsSync13(targetParent)) {
|
|
12711
12711
|
mkdirSync9(targetParent, { recursive: true });
|
|
12712
12712
|
}
|
|
@@ -12724,8 +12724,8 @@ function symlinkSkills(sourceDir, targetDir, options = {}) {
|
|
|
12724
12724
|
return result;
|
|
12725
12725
|
}
|
|
12726
12726
|
for (const entry of entries) {
|
|
12727
|
-
const srcPath =
|
|
12728
|
-
const destPath =
|
|
12727
|
+
const srcPath = join14(sourceDir, entry);
|
|
12728
|
+
const destPath = join14(targetDir, entry);
|
|
12729
12729
|
try {
|
|
12730
12730
|
const src = lstatSync(srcPath);
|
|
12731
12731
|
if (src.isSymbolicLink() || !src.isDirectory()) {
|
|
@@ -12766,7 +12766,7 @@ function symlinkSkills(sourceDir, targetDir, options = {}) {
|
|
|
12766
12766
|
}
|
|
12767
12767
|
return result;
|
|
12768
12768
|
}
|
|
12769
|
-
var home =
|
|
12769
|
+
var home = homedir10();
|
|
12770
12770
|
var SIGNET_BLOCK_START = "<!-- SIGNET:START -->";
|
|
12771
12771
|
var SIGNET_BLOCK_END = "<!-- SIGNET:END -->";
|
|
12772
12772
|
function stripSignetBlock(content) {
|
|
@@ -12807,7 +12807,7 @@ class BaseConnector {
|
|
|
12807
12807
|
generateHeader(sourcePath, targetName) {
|
|
12808
12808
|
const name = targetName || this.name;
|
|
12809
12809
|
const safe = (p) => p.replace(/[\n\r]/g, "");
|
|
12810
|
-
const root =
|
|
12810
|
+
const root = dirname2(sourcePath);
|
|
12811
12811
|
return `# Auto-generated from ${safe(sourcePath)}
|
|
12812
12812
|
# Source: ${safe(sourcePath)}
|
|
12813
12813
|
# Generated: ${new Date().toISOString()}
|
|
@@ -12847,11 +12847,11 @@ function isSignetGeneratedFile(raw) {
|
|
|
12847
12847
|
});
|
|
12848
12848
|
}
|
|
12849
12849
|
function atomicWriteText(path, content, mode) {
|
|
12850
|
-
const tmp = join3(
|
|
12850
|
+
const tmp = join3(dirname2(path), `.${randomBytes(6).toString("hex")}.tmp`);
|
|
12851
12851
|
let writeMode = mode;
|
|
12852
12852
|
if (writeMode === undefined) {
|
|
12853
12853
|
try {
|
|
12854
|
-
writeMode =
|
|
12854
|
+
writeMode = statSync(path).mode & 511;
|
|
12855
12855
|
} catch {}
|
|
12856
12856
|
}
|
|
12857
12857
|
try {
|
|
@@ -12936,13 +12936,13 @@ import { createHash as createHash2 } from "node:crypto";
|
|
|
12936
12936
|
import { homedir as homedir22 } from "os";
|
|
12937
12937
|
import { join as join22 } from "path";
|
|
12938
12938
|
import { createRequire as createRequire22 } from "node:module";
|
|
12939
|
-
import { homedir as
|
|
12940
|
-
import { dirname as
|
|
12941
|
-
import { homedir as
|
|
12942
|
-
import { basename as basename2, dirname as
|
|
12943
|
-
import { existsSync as existsSync11, readFileSync as readFileSync9, readdirSync as readdirSync4, realpathSync, statSync as
|
|
12944
|
-
import { dirname as
|
|
12945
|
-
import { homedir as
|
|
12939
|
+
import { homedir as homedir52 } from "node:os";
|
|
12940
|
+
import { dirname as dirname42, join as join72, resolve as resolve22 } from "node:path";
|
|
12941
|
+
import { homedir as homedir62, platform as platform22 } from "node:os";
|
|
12942
|
+
import { basename as basename2, dirname as dirname52, resolve as resolve42 } from "node:path";
|
|
12943
|
+
import { existsSync as existsSync11, readFileSync as readFileSync9, readdirSync as readdirSync4, realpathSync, statSync as statSync6 } from "node:fs";
|
|
12944
|
+
import { dirname as dirname8, join as join12 } from "node:path";
|
|
12945
|
+
import { homedir as homedir102 } from "node:os";
|
|
12946
12946
|
var __create = Object.create;
|
|
12947
12947
|
var __getProtoOf = Object.getPrototypeOf;
|
|
12948
12948
|
var __defProp = Object.defineProperty;
|
|
@@ -25299,7 +25299,7 @@ try {
|
|
|
25299
25299
|
const esmRequire = createRequire22(import.meta.url);
|
|
25300
25300
|
native2 = esmRequire("@signet/native");
|
|
25301
25301
|
} catch {}
|
|
25302
|
-
var GRAPHIQ_DEFAULT_INSTALL_DIR2 =
|
|
25302
|
+
var GRAPHIQ_DEFAULT_INSTALL_DIR2 = join72(homedir52(), ".local", "bin");
|
|
25303
25303
|
var SIGNET_SOURCE_CHECKOUT_DIRNAME2 = "signetai";
|
|
25304
25304
|
var SIGNET_GIT_ALLOWED_DIRECTORIES2 = ["skills", "tools", "dreaming"];
|
|
25305
25305
|
var SIGNET_GIT_PROTECTED_PATHS2 = [
|
|
@@ -25369,11 +25369,11 @@ var VALID_GITHUB_RESOURCE_TYPES2 = new Set(DEFAULT_GITHUB_RESOURCE_TYPES2);
|
|
|
25369
25369
|
function defaultDiscordDesktopCachePath2() {
|
|
25370
25370
|
switch (platform22()) {
|
|
25371
25371
|
case "darwin":
|
|
25372
|
-
return resolve42(
|
|
25372
|
+
return resolve42(homedir62(), "Library", "Application Support", "discord");
|
|
25373
25373
|
case "win32":
|
|
25374
|
-
return resolve42(process.env.APPDATA || resolve42(
|
|
25374
|
+
return resolve42(process.env.APPDATA || resolve42(homedir62(), "AppData", "Roaming"), "discord");
|
|
25375
25375
|
default:
|
|
25376
|
-
return resolve42(process.env.XDG_CONFIG_HOME || resolve42(
|
|
25376
|
+
return resolve42(process.env.XDG_CONFIG_HOME || resolve42(homedir62(), ".config"), "discord");
|
|
25377
25377
|
}
|
|
25378
25378
|
}
|
|
25379
25379
|
var IDENTITY_MODES = ["managed", "off"];
|
|
@@ -25438,7 +25438,7 @@ function hasValidIdentity(basePath) {
|
|
|
25438
25438
|
return true;
|
|
25439
25439
|
for (const key of REQUIRED_IDENTITY_KEYS2) {
|
|
25440
25440
|
const spec = IDENTITY_FILES2[key];
|
|
25441
|
-
if (!existsSync11(
|
|
25441
|
+
if (!existsSync11(join12(basePath, spec.path))) {
|
|
25442
25442
|
return false;
|
|
25443
25443
|
}
|
|
25444
25444
|
}
|
|
@@ -25467,7 +25467,7 @@ function resolveIdentityModeFromConfig(config) {
|
|
|
25467
25467
|
return "managed";
|
|
25468
25468
|
}
|
|
25469
25469
|
function loadIdentityMode(agentsDir) {
|
|
25470
|
-
const agentYaml =
|
|
25470
|
+
const agentYaml = join12(agentsDir, "agent.yaml");
|
|
25471
25471
|
if (!existsSync11(agentYaml))
|
|
25472
25472
|
return "managed";
|
|
25473
25473
|
try {
|
|
@@ -25476,13 +25476,13 @@ function loadIdentityMode(agentsDir) {
|
|
|
25476
25476
|
return "managed";
|
|
25477
25477
|
}
|
|
25478
25478
|
}
|
|
25479
|
-
var home2 =
|
|
25479
|
+
var home2 = homedir102();
|
|
25480
25480
|
|
|
25481
25481
|
// src/index.ts
|
|
25482
25482
|
var SIGNET_FORGE_MARKER = "Managed by Signet (@signetai/connector-forge)";
|
|
25483
25483
|
function getHomeDir() {
|
|
25484
25484
|
const home3 = readTrimmedEnv2("HOME");
|
|
25485
|
-
return home3 ??
|
|
25485
|
+
return home3 ?? homedir3();
|
|
25486
25486
|
}
|
|
25487
25487
|
function readJsonObject(path) {
|
|
25488
25488
|
if (!existsSync2(path))
|
|
@@ -25524,10 +25524,10 @@ class ForgeConnector extends BaseConnector {
|
|
|
25524
25524
|
const configured = readTrimmedEnv2("FORGE_CONFIG");
|
|
25525
25525
|
if (configured)
|
|
25526
25526
|
return resolve3(expandHome2(configured));
|
|
25527
|
-
const legacyPath =
|
|
25527
|
+
const legacyPath = join8(getHomeDir(), "forge");
|
|
25528
25528
|
if (existsSync2(legacyPath))
|
|
25529
25529
|
return legacyPath;
|
|
25530
|
-
return
|
|
25530
|
+
return join8(getHomeDir(), ".forge");
|
|
25531
25531
|
}
|
|
25532
25532
|
getConfigPath() {
|
|
25533
25533
|
return this.getMcpConfigPath();
|
|
@@ -25535,7 +25535,7 @@ class ForgeConnector extends BaseConnector {
|
|
|
25535
25535
|
async install(basePath) {
|
|
25536
25536
|
const filesWritten = [];
|
|
25537
25537
|
const configsPatched = [];
|
|
25538
|
-
const expandedBasePath = expandHome2(basePath ||
|
|
25538
|
+
const expandedBasePath = expandHome2(basePath || join8(getHomeDir(), ".agents"));
|
|
25539
25539
|
const identityMode = loadIdentityMode(expandedBasePath);
|
|
25540
25540
|
if (!hasValidIdentity(expandedBasePath)) {
|
|
25541
25541
|
return {
|
|
@@ -25589,7 +25589,7 @@ class ForgeConnector extends BaseConnector {
|
|
|
25589
25589
|
configsPatched
|
|
25590
25590
|
};
|
|
25591
25591
|
}
|
|
25592
|
-
const skillsSource =
|
|
25592
|
+
const skillsSource = join8(expandedBasePath, "skills");
|
|
25593
25593
|
if (existsSync2(skillsSource)) {
|
|
25594
25594
|
this.symlinkSkills(skillsSource, this.getSkillsPath());
|
|
25595
25595
|
}
|
|
@@ -25649,19 +25649,19 @@ class ForgeConnector extends BaseConnector {
|
|
|
25649
25649
|
}
|
|
25650
25650
|
static isHarnessInstalled() {
|
|
25651
25651
|
const home3 = getHomeDir();
|
|
25652
|
-
return existsSync2(readTrimmedEnv2("FORGE_CONFIG") ?? "") || existsSync2(
|
|
25652
|
+
return existsSync2(readTrimmedEnv2("FORGE_CONFIG") ?? "") || existsSync2(join8(home3, "forge", ".mcp.json")) || existsSync2(join8(home3, ".forge", ".mcp.json")) || existsSync2(join8(home3, "forge")) || existsSync2(join8(home3, ".forge"));
|
|
25653
25653
|
}
|
|
25654
25654
|
getAgentsPath() {
|
|
25655
|
-
return
|
|
25655
|
+
return join8(this.getForgeHome(), "AGENTS.md");
|
|
25656
25656
|
}
|
|
25657
25657
|
getSkillsPath() {
|
|
25658
|
-
return
|
|
25658
|
+
return join8(this.getForgeHome(), "skills");
|
|
25659
25659
|
}
|
|
25660
25660
|
getMcpConfigPath() {
|
|
25661
|
-
return
|
|
25661
|
+
return join8(this.getForgeHome(), ".mcp.json");
|
|
25662
25662
|
}
|
|
25663
25663
|
generateAgentsMd(basePath) {
|
|
25664
|
-
const sourcePath =
|
|
25664
|
+
const sourcePath = join8(basePath, "AGENTS.md");
|
|
25665
25665
|
if (!existsSync2(sourcePath))
|
|
25666
25666
|
return null;
|
|
25667
25667
|
const raw = readFileSync2(sourcePath, "utf-8");
|
|
@@ -25717,7 +25717,7 @@ ${header}${body}
|
|
|
25717
25717
|
return;
|
|
25718
25718
|
}
|
|
25719
25719
|
for (const entry of entries) {
|
|
25720
|
-
const entryPath =
|
|
25720
|
+
const entryPath = join8(skillsDir, entry);
|
|
25721
25721
|
try {
|
|
25722
25722
|
if (!lstatSync2(entryPath).isSymbolicLink())
|
|
25723
25723
|
continue;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@signetai/connector-forge",
|
|
3
|
-
"version": "0.200.
|
|
3
|
+
"version": "0.200.4",
|
|
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.200.
|
|
28
|
-
"@signetai/core": "0.200.
|
|
27
|
+
"@signetai/connector-base": "0.200.4",
|
|
28
|
+
"@signetai/core": "0.200.4"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
31
|
"@types/node": "^22.0.0",
|