@signetai/connector-base 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 +32 -32
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -32,9 +32,9 @@ var __commonJS = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports,
|
|
|
32
32
|
|
|
33
33
|
// src/index.ts
|
|
34
34
|
import { randomBytes } from "node:crypto";
|
|
35
|
-
import { existsSync, readFileSync, renameSync as renameSync2, statSync
|
|
35
|
+
import { existsSync, readFileSync, renameSync as renameSync2, statSync, unlinkSync as unlinkSync2, writeFileSync } from "node:fs";
|
|
36
36
|
import { homedir } from "node:os";
|
|
37
|
-
import { dirname as
|
|
37
|
+
import { dirname as dirname2, isAbsolute, join as join3, relative, sep } from "node:path";
|
|
38
38
|
|
|
39
39
|
// ../../platform/core/dist/index.js
|
|
40
40
|
import { createRequire } from "node:module";
|
|
@@ -52,19 +52,19 @@ import {
|
|
|
52
52
|
readFileSync as readFileSync3,
|
|
53
53
|
renameSync,
|
|
54
54
|
rmSync,
|
|
55
|
-
statSync,
|
|
55
|
+
statSync as statSync2,
|
|
56
56
|
writeSync
|
|
57
57
|
} from "node:fs";
|
|
58
|
-
import { homedir as homedir3 } from "node:os";
|
|
59
|
-
import { dirname as dirname2, join as join5, resolve } from "node:path";
|
|
60
|
-
import { createRequire as createRequire2 } from "node:module";
|
|
61
58
|
import { homedir as homedir4 } from "node:os";
|
|
62
|
-
import { dirname as dirname3, join as join6, resolve
|
|
63
|
-
import {
|
|
64
|
-
import {
|
|
65
|
-
import {
|
|
59
|
+
import { dirname as dirname3, join as join6, resolve } from "node:path";
|
|
60
|
+
import { createRequire as createRequire2 } from "node:module";
|
|
61
|
+
import { homedir as homedir5 } from "node:os";
|
|
62
|
+
import { dirname as dirname4, join as join7, resolve as resolve2 } from "node:path";
|
|
63
|
+
import { homedir as homedir6, platform as platform2 } from "node:os";
|
|
64
|
+
import { basename, dirname as dirname5, resolve as resolve4 } from "node:path";
|
|
65
|
+
import { homedir as homedir10 } from "node:os";
|
|
66
66
|
import { existsSync as existsSync13, lstatSync, mkdirSync as mkdirSync9, readdirSync as readdirSync6, symlinkSync, unlinkSync } from "node:fs";
|
|
67
|
-
import { join as
|
|
67
|
+
import { join as join14 } from "node:path";
|
|
68
68
|
var __create2 = Object.create;
|
|
69
69
|
var __getProtoOf2 = Object.getPrototypeOf;
|
|
70
70
|
var __defProp2 = Object.defineProperty;
|
|
@@ -12483,7 +12483,7 @@ function resolveSignetDaemonUrl(opts = {}) {
|
|
|
12483
12483
|
}
|
|
12484
12484
|
var WORKSPACE_ENV_KEYS = ["SIGNET_PATH", "SIGNET_WORKSPACE"];
|
|
12485
12485
|
var DEFAULT_AGENTS_DIRNAME = ".agents";
|
|
12486
|
-
function normalizeWorkspacePath(pathValue, home =
|
|
12486
|
+
function normalizeWorkspacePath(pathValue, home = homedir4()) {
|
|
12487
12487
|
return resolve(expandHome(pathValue.trim(), home));
|
|
12488
12488
|
}
|
|
12489
12489
|
function readTrimmedEnv(env, name) {
|
|
@@ -12496,13 +12496,13 @@ function readTrimmedEnv(env, name) {
|
|
|
12496
12496
|
function readConfigHome(env, home) {
|
|
12497
12497
|
const raw = env.XDG_CONFIG_HOME;
|
|
12498
12498
|
if (typeof raw !== "string")
|
|
12499
|
-
return
|
|
12499
|
+
return join6(home, ".config");
|
|
12500
12500
|
const trimmed = raw.trim();
|
|
12501
|
-
return trimmed.length > 0 ? normalizeWorkspacePath(trimmed, home) :
|
|
12501
|
+
return trimmed.length > 0 ? normalizeWorkspacePath(trimmed, home) : join6(home, ".config");
|
|
12502
12502
|
}
|
|
12503
12503
|
function isExistingDirectory(path) {
|
|
12504
12504
|
try {
|
|
12505
|
-
return
|
|
12505
|
+
return statSync2(path).isDirectory();
|
|
12506
12506
|
} catch {
|
|
12507
12507
|
return false;
|
|
12508
12508
|
}
|
|
@@ -12510,10 +12510,10 @@ function isExistingDirectory(path) {
|
|
|
12510
12510
|
function isRecord4(value) {
|
|
12511
12511
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
12512
12512
|
}
|
|
12513
|
-
function getWorkspaceConfigPath(env = process.env, home =
|
|
12514
|
-
return
|
|
12513
|
+
function getWorkspaceConfigPath(env = process.env, home = homedir4()) {
|
|
12514
|
+
return join6(readConfigHome(env, home), "signet", "workspace.json");
|
|
12515
12515
|
}
|
|
12516
|
-
function readConfiguredWorkspacePath(env = process.env, home =
|
|
12516
|
+
function readConfiguredWorkspacePath(env = process.env, home = homedir4(), _options = {}) {
|
|
12517
12517
|
const configPath = getWorkspaceConfigPath(env, home);
|
|
12518
12518
|
if (!existsSync4(configPath))
|
|
12519
12519
|
return null;
|
|
@@ -12535,7 +12535,7 @@ function readConfiguredWorkspacePath(env = process.env, home = homedir3(), _opti
|
|
|
12535
12535
|
}
|
|
12536
12536
|
function resolveWorkspacePath(options = {}) {
|
|
12537
12537
|
const env = options.env ?? process.env;
|
|
12538
|
-
const home = options.home ??
|
|
12538
|
+
const home = options.home ?? homedir4();
|
|
12539
12539
|
const requireExistingEnvPath = options.requireExistingEnvPath ?? false;
|
|
12540
12540
|
const configPath = getWorkspaceConfigPath(env, home);
|
|
12541
12541
|
const envPath = resolveEnvWorkspace(env, home, requireExistingEnvPath);
|
|
@@ -12557,7 +12557,7 @@ function resolveWorkspacePath(options = {}) {
|
|
|
12557
12557
|
};
|
|
12558
12558
|
}
|
|
12559
12559
|
return {
|
|
12560
|
-
path:
|
|
12560
|
+
path: join6(home, DEFAULT_AGENTS_DIRNAME),
|
|
12561
12561
|
source: "default",
|
|
12562
12562
|
configPath,
|
|
12563
12563
|
configuredPath: configValue
|
|
@@ -12580,7 +12580,7 @@ try {
|
|
|
12580
12580
|
const esmRequire = createRequire2(import.meta.url);
|
|
12581
12581
|
native = esmRequire("@signet/native");
|
|
12582
12582
|
} catch {}
|
|
12583
|
-
var GRAPHIQ_DEFAULT_INSTALL_DIR =
|
|
12583
|
+
var GRAPHIQ_DEFAULT_INSTALL_DIR = join7(homedir5(), ".local", "bin");
|
|
12584
12584
|
var SIGNET_SOURCE_CHECKOUT_DIRNAME = "signetai";
|
|
12585
12585
|
var SIGNET_GIT_ALLOWED_DIRECTORIES = ["skills", "tools", "dreaming"];
|
|
12586
12586
|
var SIGNET_GIT_PROTECTED_PATHS = [
|
|
@@ -12650,11 +12650,11 @@ var VALID_GITHUB_RESOURCE_TYPES = new Set(DEFAULT_GITHUB_RESOURCE_TYPES);
|
|
|
12650
12650
|
function defaultDiscordDesktopCachePath() {
|
|
12651
12651
|
switch (platform2()) {
|
|
12652
12652
|
case "darwin":
|
|
12653
|
-
return resolve4(
|
|
12653
|
+
return resolve4(homedir6(), "Library", "Application Support", "discord");
|
|
12654
12654
|
case "win32":
|
|
12655
|
-
return resolve4(process.env.APPDATA || resolve4(
|
|
12655
|
+
return resolve4(process.env.APPDATA || resolve4(homedir6(), "AppData", "Roaming"), "discord");
|
|
12656
12656
|
default:
|
|
12657
|
-
return resolve4(process.env.XDG_CONFIG_HOME || resolve4(
|
|
12657
|
+
return resolve4(process.env.XDG_CONFIG_HOME || resolve4(homedir6(), ".config"), "discord");
|
|
12658
12658
|
}
|
|
12659
12659
|
}
|
|
12660
12660
|
var IDENTITY_FILES = {
|
|
@@ -12725,7 +12725,7 @@ function symlinkSkills(sourceDir, targetDir, options = {}) {
|
|
|
12725
12725
|
if (!existsSync13(sourceDir)) {
|
|
12726
12726
|
return result;
|
|
12727
12727
|
}
|
|
12728
|
-
const targetParent =
|
|
12728
|
+
const targetParent = join14(targetDir, "..");
|
|
12729
12729
|
if (!existsSync13(targetParent)) {
|
|
12730
12730
|
mkdirSync9(targetParent, { recursive: true });
|
|
12731
12731
|
}
|
|
@@ -12743,8 +12743,8 @@ function symlinkSkills(sourceDir, targetDir, options = {}) {
|
|
|
12743
12743
|
return result;
|
|
12744
12744
|
}
|
|
12745
12745
|
for (const entry of entries) {
|
|
12746
|
-
const srcPath =
|
|
12747
|
-
const destPath =
|
|
12746
|
+
const srcPath = join14(sourceDir, entry);
|
|
12747
|
+
const destPath = join14(targetDir, entry);
|
|
12748
12748
|
try {
|
|
12749
12749
|
const src = lstatSync(srcPath);
|
|
12750
12750
|
if (src.isSymbolicLink() || !src.isDirectory()) {
|
|
@@ -12785,7 +12785,7 @@ function symlinkSkills(sourceDir, targetDir, options = {}) {
|
|
|
12785
12785
|
}
|
|
12786
12786
|
return result;
|
|
12787
12787
|
}
|
|
12788
|
-
var home =
|
|
12788
|
+
var home = homedir10();
|
|
12789
12789
|
var SIGNET_BLOCK_START = "<!-- SIGNET:START -->";
|
|
12790
12790
|
var SIGNET_BLOCK_END = "<!-- SIGNET:END -->";
|
|
12791
12791
|
function stripSignetBlock(content) {
|
|
@@ -12827,7 +12827,7 @@ class BaseConnector {
|
|
|
12827
12827
|
generateHeader(sourcePath, targetName) {
|
|
12828
12828
|
const name = targetName || this.name;
|
|
12829
12829
|
const safe = (p) => p.replace(/[\n\r]/g, "");
|
|
12830
|
-
const root =
|
|
12830
|
+
const root = dirname2(sourcePath);
|
|
12831
12831
|
return `# Auto-generated from ${safe(sourcePath)}
|
|
12832
12832
|
# Source: ${safe(sourcePath)}
|
|
12833
12833
|
# Generated: ${new Date().toISOString()}
|
|
@@ -12867,11 +12867,11 @@ function isSignetGeneratedFile(raw) {
|
|
|
12867
12867
|
});
|
|
12868
12868
|
}
|
|
12869
12869
|
function atomicWriteText(path, content, mode) {
|
|
12870
|
-
const tmp = join3(
|
|
12870
|
+
const tmp = join3(dirname2(path), `.${randomBytes(6).toString("hex")}.tmp`);
|
|
12871
12871
|
let writeMode = mode;
|
|
12872
12872
|
if (writeMode === undefined) {
|
|
12873
12873
|
try {
|
|
12874
|
-
writeMode =
|
|
12874
|
+
writeMode = statSync(path).mode & 511;
|
|
12875
12875
|
} catch {}
|
|
12876
12876
|
}
|
|
12877
12877
|
try {
|
|
@@ -12927,7 +12927,7 @@ function readManagedTrimmedEnv(name) {
|
|
|
12927
12927
|
}
|
|
12928
12928
|
function isExistingDirectory2(path) {
|
|
12929
12929
|
try {
|
|
12930
|
-
return
|
|
12930
|
+
return statSync(path).isDirectory();
|
|
12931
12931
|
} catch {
|
|
12932
12932
|
return false;
|
|
12933
12933
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@signetai/connector-base",
|
|
3
|
-
"version": "0.200.
|
|
3
|
+
"version": "0.200.4",
|
|
4
4
|
"description": "Base class for Signet harness connectors",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"typecheck": "tsc --noEmit"
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@signetai/core": "0.200.
|
|
29
|
+
"@signetai/core": "0.200.4",
|
|
30
30
|
"json5": "^2.2.3",
|
|
31
31
|
"jsonc-parser": "3.3.1"
|
|
32
32
|
},
|