@signetai/connector-pi 0.154.4 → 0.154.6
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 +23 -7
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -11180,10 +11180,21 @@ function readManagedTrimmedEnv(name) {
|
|
|
11180
11180
|
const trimmed = value.trim();
|
|
11181
11181
|
return trimmed.length > 0 ? trimmed : undefined;
|
|
11182
11182
|
}
|
|
11183
|
+
function isExistingDirectory(path) {
|
|
11184
|
+
try {
|
|
11185
|
+
return statSync(path).isDirectory();
|
|
11186
|
+
} catch {
|
|
11187
|
+
return false;
|
|
11188
|
+
}
|
|
11189
|
+
}
|
|
11183
11190
|
function resolveSignetWorkspacePath(home2 = homedir()) {
|
|
11184
11191
|
const configured = readManagedTrimmedEnv("SIGNET_PATH");
|
|
11185
|
-
if (configured)
|
|
11186
|
-
|
|
11192
|
+
if (configured) {
|
|
11193
|
+
const resolved = resolve(expandHome(configured));
|
|
11194
|
+
if (isExistingDirectory(resolved))
|
|
11195
|
+
return resolved;
|
|
11196
|
+
console.warn(`[signet] SIGNET_PATH="${configured}" does not point to an existing workspace directory; using the default workspace resolution instead.`);
|
|
11197
|
+
}
|
|
11187
11198
|
const defaultWorkspace = join3(home2, ".agents");
|
|
11188
11199
|
const configHome = readManagedTrimmedEnv("XDG_CONFIG_HOME") ?? join3(home2, ".config");
|
|
11189
11200
|
const workspaceConfigPath = join3(configHome, "signet", "workspace.json");
|
|
@@ -11215,10 +11226,18 @@ function resolveSignetApiKey() {
|
|
|
11215
11226
|
return readManagedTrimmedEnv("SIGNET_API_KEY") ?? readManagedTrimmedEnv("SIGNET_TOKEN");
|
|
11216
11227
|
}
|
|
11217
11228
|
function buildManagedExtensionEnvBootstrap(env) {
|
|
11218
|
-
const workspace = JSON.stringify(env.signetPath);
|
|
11219
11229
|
const daemonUrl = JSON.stringify(env.daemonUrl);
|
|
11220
11230
|
const agentId = JSON.stringify(env.agentId);
|
|
11221
11231
|
const apiKey = env.apiKey ? JSON.stringify(env.apiKey) : null;
|
|
11232
|
+
const isDefaultWorkspace = env.signetPath === join3(homedir(), ".agents");
|
|
11233
|
+
const workspaceExists = isExistingDirectory(env.signetPath);
|
|
11234
|
+
if (!isDefaultWorkspace && !workspaceExists) {
|
|
11235
|
+
console.warn(`[signet] resolved workspace "${env.signetPath}" does not exist; not embedding it in the managed extension to avoid propagating a stale path (issue #1016).`);
|
|
11236
|
+
}
|
|
11237
|
+
const signetPathBlock = isDefaultWorkspace || !workspaceExists ? "" : ` if (!__signetReadEnv("SIGNET_PATH")) {
|
|
11238
|
+
Reflect.set(__signetRuntimeEnv, "SIGNET_PATH", ${JSON.stringify(env.signetPath)});
|
|
11239
|
+
}
|
|
11240
|
+
`;
|
|
11222
11241
|
return `const __signetRuntimeProcess = Reflect.get(globalThis, "process");
|
|
11223
11242
|
if (__signetRuntimeProcess && typeof __signetRuntimeProcess === "object") {
|
|
11224
11243
|
const __signetRuntimeEnv = Reflect.get(__signetRuntimeProcess, "env");
|
|
@@ -11228,10 +11247,7 @@ if (__signetRuntimeProcess && typeof __signetRuntimeProcess === "object") {
|
|
|
11228
11247
|
return typeof value === "string" && value.trim().length > 0 ? value : undefined;
|
|
11229
11248
|
};
|
|
11230
11249
|
if (__signetRuntimeEnv && typeof __signetRuntimeEnv === "object") {
|
|
11231
|
-
if (!__signetReadEnv("
|
|
11232
|
-
Reflect.set(__signetRuntimeEnv, "SIGNET_PATH", ${workspace});
|
|
11233
|
-
}
|
|
11234
|
-
if (!__signetReadEnv("SIGNET_DAEMON_URL")) {
|
|
11250
|
+
${signetPathBlock} if (!__signetReadEnv("SIGNET_DAEMON_URL")) {
|
|
11235
11251
|
Reflect.set(__signetRuntimeEnv, "SIGNET_DAEMON_URL", ${daemonUrl});
|
|
11236
11252
|
}
|
|
11237
11253
|
if (!__signetReadEnv("SIGNET_AGENT_ID")) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@signetai/connector-pi",
|
|
3
|
-
"version": "0.154.
|
|
3
|
+
"version": "0.154.6",
|
|
4
4
|
"description": "Signet connector for pi",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -25,8 +25,8 @@
|
|
|
25
25
|
"typecheck": "tsc --noEmit"
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@signetai/connector-base": "0.154.
|
|
29
|
-
"@signetai/core": "0.154.
|
|
28
|
+
"@signetai/connector-base": "0.154.6",
|
|
29
|
+
"@signetai/core": "0.154.6"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
32
|
"@types/node": "^22.0.0",
|