@signetai/connector-forge 0.163.17 → 0.163.19
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.d.ts.map +1 -1
- package/dist/index.js +213 -212
- package/package.json +3 -3
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAaA,OAAO,EACN,aAAa,EACb,KAAK,aAAa,EAClB,KAAK,eAAe,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAaA,OAAO,EACN,aAAa,EACb,KAAK,aAAa,EAClB,KAAK,eAAe,EAWpB,MAAM,wBAAwB,CAAC;AAyDhC,qBAAa,cAAe,SAAQ,aAAa;IAChD,QAAQ,CAAC,IAAI,eAAe;IAC5B,QAAQ,CAAC,SAAS,WAAW;IAE7B,SAAS,CAAC,YAAY,IAAI,MAAM;IAUhC,aAAa,IAAI,MAAM;IAIjB,OAAO,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC;IA4EjD,SAAS,IAAI,OAAO,CAAC,eAAe,CAAC;IAiD3C,WAAW,IAAI,OAAO;IAStB,MAAM,CAAC,kBAAkB,IAAI,OAAO;IAWpC,OAAO,CAAC,aAAa;IAIrB,OAAO,CAAC,aAAa;IAIrB,OAAO,CAAC,gBAAgB;IAIxB,OAAO,CAAC,gBAAgB;IAcxB,OAAO,CAAC,iBAAiB;IAMzB,OAAO,CAAC,eAAe;IAYvB,OAAO,CAAC,iBAAiB;IAWzB,OAAO,CAAC,mBAAmB;CAgC3B;AAED,eAAO,MAAM,cAAc,gBAAuB,CAAC;AACnD,eAAe,cAAc,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -11,13 +11,13 @@ import {
|
|
|
11
11
|
writeFileSync as writeFileSync3
|
|
12
12
|
} from "node:fs";
|
|
13
13
|
import { homedir as homedir5 } from "node:os";
|
|
14
|
-
import {
|
|
14
|
+
import { join as join6, resolve as resolve2 } from "node:path";
|
|
15
15
|
|
|
16
16
|
// ../../../libs/connector-base/dist/index.js
|
|
17
17
|
import { randomBytes } from "node:crypto";
|
|
18
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 dirname3, join as join3 } from "node:path";
|
|
20
|
+
import { dirname as dirname3, 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";
|
|
@@ -3640,10 +3640,10 @@ var require_resolve_block_map = __commonJS2((exports) => {
|
|
|
3640
3640
|
let offset = bm.offset;
|
|
3641
3641
|
let commentEnd = null;
|
|
3642
3642
|
for (const collItem of bm.items) {
|
|
3643
|
-
const { start, key, sep, value } = collItem;
|
|
3643
|
+
const { start, key, sep: sep2, value } = collItem;
|
|
3644
3644
|
const keyProps = resolveProps.resolveProps(start, {
|
|
3645
3645
|
indicator: "explicit-key-ind",
|
|
3646
|
-
next: key ??
|
|
3646
|
+
next: key ?? sep2?.[0],
|
|
3647
3647
|
offset,
|
|
3648
3648
|
onError,
|
|
3649
3649
|
parentIndent: bm.indent,
|
|
@@ -3657,7 +3657,7 @@ var require_resolve_block_map = __commonJS2((exports) => {
|
|
|
3657
3657
|
else if ("indent" in key && key.indent !== bm.indent)
|
|
3658
3658
|
onError(offset, "BAD_INDENT", startColMsg);
|
|
3659
3659
|
}
|
|
3660
|
-
if (!keyProps.anchor && !keyProps.tag && !
|
|
3660
|
+
if (!keyProps.anchor && !keyProps.tag && !sep2) {
|
|
3661
3661
|
commentEnd = keyProps.end;
|
|
3662
3662
|
if (keyProps.comment) {
|
|
3663
3663
|
if (map.comment)
|
|
@@ -3682,7 +3682,7 @@ var require_resolve_block_map = __commonJS2((exports) => {
|
|
|
3682
3682
|
ctx.atKey = false;
|
|
3683
3683
|
if (utilMapIncludes.mapIncludes(ctx, map.items, keyNode))
|
|
3684
3684
|
onError(keyStart, "DUPLICATE_KEY", "Map keys must be unique");
|
|
3685
|
-
const valueProps = resolveProps.resolveProps(
|
|
3685
|
+
const valueProps = resolveProps.resolveProps(sep2 ?? [], {
|
|
3686
3686
|
indicator: "map-value-ind",
|
|
3687
3687
|
next: value,
|
|
3688
3688
|
offset: keyNode.range[2],
|
|
@@ -3698,7 +3698,7 @@ var require_resolve_block_map = __commonJS2((exports) => {
|
|
|
3698
3698
|
if (ctx.options.strict && keyProps.start < valueProps.found.offset - 1024)
|
|
3699
3699
|
onError(keyNode.range, "KEY_OVER_1024_CHARS", "The : indicator must be at most 1024 chars after the start of an implicit block mapping key");
|
|
3700
3700
|
}
|
|
3701
|
-
const valueNode = value ? composeNode(ctx, value, valueProps, onError) : composeEmptyNode(ctx, offset,
|
|
3701
|
+
const valueNode = value ? composeNode(ctx, value, valueProps, onError) : composeEmptyNode(ctx, offset, sep2, null, valueProps, onError);
|
|
3702
3702
|
if (ctx.schema.compat)
|
|
3703
3703
|
utilFlowIndentCheck.flowIndentCheck(bm.indent, value, onError);
|
|
3704
3704
|
offset = valueNode.range[2];
|
|
@@ -3780,7 +3780,7 @@ var require_resolve_end = __commonJS2((exports) => {
|
|
|
3780
3780
|
let comment = "";
|
|
3781
3781
|
if (end) {
|
|
3782
3782
|
let hasSpace = false;
|
|
3783
|
-
let
|
|
3783
|
+
let sep2 = "";
|
|
3784
3784
|
for (const token of end) {
|
|
3785
3785
|
const { source, type } = token;
|
|
3786
3786
|
switch (type) {
|
|
@@ -3794,13 +3794,13 @@ var require_resolve_end = __commonJS2((exports) => {
|
|
|
3794
3794
|
if (!comment)
|
|
3795
3795
|
comment = cb;
|
|
3796
3796
|
else
|
|
3797
|
-
comment +=
|
|
3798
|
-
|
|
3797
|
+
comment += sep2 + cb;
|
|
3798
|
+
sep2 = "";
|
|
3799
3799
|
break;
|
|
3800
3800
|
}
|
|
3801
3801
|
case "newline":
|
|
3802
3802
|
if (comment)
|
|
3803
|
-
|
|
3803
|
+
sep2 += source;
|
|
3804
3804
|
hasSpace = true;
|
|
3805
3805
|
break;
|
|
3806
3806
|
default:
|
|
@@ -3838,18 +3838,18 @@ var require_resolve_flow_collection = __commonJS2((exports) => {
|
|
|
3838
3838
|
let offset = fc.offset + fc.start.source.length;
|
|
3839
3839
|
for (let i = 0;i < fc.items.length; ++i) {
|
|
3840
3840
|
const collItem = fc.items[i];
|
|
3841
|
-
const { start, key, sep, value } = collItem;
|
|
3841
|
+
const { start, key, sep: sep2, value } = collItem;
|
|
3842
3842
|
const props = resolveProps.resolveProps(start, {
|
|
3843
3843
|
flow: fcName,
|
|
3844
3844
|
indicator: "explicit-key-ind",
|
|
3845
|
-
next: key ??
|
|
3845
|
+
next: key ?? sep2?.[0],
|
|
3846
3846
|
offset,
|
|
3847
3847
|
onError,
|
|
3848
3848
|
parentIndent: fc.indent,
|
|
3849
3849
|
startOnNewline: false
|
|
3850
3850
|
});
|
|
3851
3851
|
if (!props.found) {
|
|
3852
|
-
if (!props.anchor && !props.tag && !
|
|
3852
|
+
if (!props.anchor && !props.tag && !sep2 && !value) {
|
|
3853
3853
|
if (i === 0 && props.comma)
|
|
3854
3854
|
onError(props.comma, "UNEXPECTED_TOKEN", `Unexpected , in ${fcName}`);
|
|
3855
3855
|
else if (i < fc.items.length - 1)
|
|
@@ -3901,8 +3901,8 @@ var require_resolve_flow_collection = __commonJS2((exports) => {
|
|
|
3901
3901
|
}
|
|
3902
3902
|
}
|
|
3903
3903
|
}
|
|
3904
|
-
if (!isMap && !
|
|
3905
|
-
const valueNode = value ? composeNode(ctx, value, props, onError) : composeEmptyNode(ctx, props.end,
|
|
3904
|
+
if (!isMap && !sep2 && !props.found) {
|
|
3905
|
+
const valueNode = value ? composeNode(ctx, value, props, onError) : composeEmptyNode(ctx, props.end, sep2, null, props, onError);
|
|
3906
3906
|
coll.items.push(valueNode);
|
|
3907
3907
|
offset = valueNode.range[2];
|
|
3908
3908
|
if (isBlock(value))
|
|
@@ -3914,7 +3914,7 @@ var require_resolve_flow_collection = __commonJS2((exports) => {
|
|
|
3914
3914
|
if (isBlock(key))
|
|
3915
3915
|
onError(keyNode.range, "BLOCK_IN_FLOW", blockMsg);
|
|
3916
3916
|
ctx.atKey = false;
|
|
3917
|
-
const valueProps = resolveProps.resolveProps(
|
|
3917
|
+
const valueProps = resolveProps.resolveProps(sep2 ?? [], {
|
|
3918
3918
|
flow: fcName,
|
|
3919
3919
|
indicator: "map-value-ind",
|
|
3920
3920
|
next: value,
|
|
@@ -3925,8 +3925,8 @@ var require_resolve_flow_collection = __commonJS2((exports) => {
|
|
|
3925
3925
|
});
|
|
3926
3926
|
if (valueProps.found) {
|
|
3927
3927
|
if (!isMap && !props.found && ctx.options.strict) {
|
|
3928
|
-
if (
|
|
3929
|
-
for (const st of
|
|
3928
|
+
if (sep2)
|
|
3929
|
+
for (const st of sep2) {
|
|
3930
3930
|
if (st === valueProps.found)
|
|
3931
3931
|
break;
|
|
3932
3932
|
if (st.type === "newline") {
|
|
@@ -3943,7 +3943,7 @@ var require_resolve_flow_collection = __commonJS2((exports) => {
|
|
|
3943
3943
|
else
|
|
3944
3944
|
onError(valueProps.start, "MISSING_CHAR", `Missing , or : between ${fcName} items`);
|
|
3945
3945
|
}
|
|
3946
|
-
const valueNode = value ? composeNode(ctx, value, valueProps, onError) : valueProps.found ? composeEmptyNode(ctx, valueProps.end,
|
|
3946
|
+
const valueNode = value ? composeNode(ctx, value, valueProps, onError) : valueProps.found ? composeEmptyNode(ctx, valueProps.end, sep2, null, valueProps, onError) : null;
|
|
3947
3947
|
if (valueNode) {
|
|
3948
3948
|
if (isBlock(value))
|
|
3949
3949
|
onError(valueNode.range, "BLOCK_IN_FLOW", blockMsg);
|
|
@@ -4116,7 +4116,7 @@ var require_resolve_block_scalar = __commonJS2((exports) => {
|
|
|
4116
4116
|
chompStart = i + 1;
|
|
4117
4117
|
}
|
|
4118
4118
|
let value = "";
|
|
4119
|
-
let
|
|
4119
|
+
let sep2 = "";
|
|
4120
4120
|
let prevMoreIndented = false;
|
|
4121
4121
|
for (let i = 0;i < contentStart; ++i)
|
|
4122
4122
|
value += lines[i][0].slice(trimIndent) + `
|
|
@@ -4134,33 +4134,33 @@ var require_resolve_block_scalar = __commonJS2((exports) => {
|
|
|
4134
4134
|
indent = "";
|
|
4135
4135
|
}
|
|
4136
4136
|
if (type === Scalar.Scalar.BLOCK_LITERAL) {
|
|
4137
|
-
value +=
|
|
4138
|
-
|
|
4137
|
+
value += sep2 + indent.slice(trimIndent) + content;
|
|
4138
|
+
sep2 = `
|
|
4139
4139
|
`;
|
|
4140
4140
|
} else if (indent.length > trimIndent || content[0] === "\t") {
|
|
4141
|
-
if (
|
|
4142
|
-
|
|
4141
|
+
if (sep2 === " ")
|
|
4142
|
+
sep2 = `
|
|
4143
4143
|
`;
|
|
4144
|
-
else if (!prevMoreIndented &&
|
|
4144
|
+
else if (!prevMoreIndented && sep2 === `
|
|
4145
4145
|
`)
|
|
4146
|
-
|
|
4146
|
+
sep2 = `
|
|
4147
4147
|
|
|
4148
4148
|
`;
|
|
4149
|
-
value +=
|
|
4150
|
-
|
|
4149
|
+
value += sep2 + indent.slice(trimIndent) + content;
|
|
4150
|
+
sep2 = `
|
|
4151
4151
|
`;
|
|
4152
4152
|
prevMoreIndented = true;
|
|
4153
4153
|
} else if (content === "") {
|
|
4154
|
-
if (
|
|
4154
|
+
if (sep2 === `
|
|
4155
4155
|
`)
|
|
4156
4156
|
value += `
|
|
4157
4157
|
`;
|
|
4158
4158
|
else
|
|
4159
|
-
|
|
4159
|
+
sep2 = `
|
|
4160
4160
|
`;
|
|
4161
4161
|
} else {
|
|
4162
|
-
value +=
|
|
4163
|
-
|
|
4162
|
+
value += sep2 + content;
|
|
4163
|
+
sep2 = " ";
|
|
4164
4164
|
prevMoreIndented = false;
|
|
4165
4165
|
}
|
|
4166
4166
|
}
|
|
@@ -4339,27 +4339,27 @@ var require_resolve_flow_scalar = __commonJS2((exports) => {
|
|
|
4339
4339
|
if (!match)
|
|
4340
4340
|
return source;
|
|
4341
4341
|
let res = match[1];
|
|
4342
|
-
let
|
|
4342
|
+
let sep2 = " ";
|
|
4343
4343
|
let pos = first.lastIndex;
|
|
4344
4344
|
line.lastIndex = pos;
|
|
4345
4345
|
while (match = line.exec(source)) {
|
|
4346
4346
|
if (match[1] === "") {
|
|
4347
|
-
if (
|
|
4347
|
+
if (sep2 === `
|
|
4348
4348
|
`)
|
|
4349
|
-
res +=
|
|
4349
|
+
res += sep2;
|
|
4350
4350
|
else
|
|
4351
|
-
|
|
4351
|
+
sep2 = `
|
|
4352
4352
|
`;
|
|
4353
4353
|
} else {
|
|
4354
|
-
res +=
|
|
4355
|
-
|
|
4354
|
+
res += sep2 + match[1];
|
|
4355
|
+
sep2 = " ";
|
|
4356
4356
|
}
|
|
4357
4357
|
pos = line.lastIndex;
|
|
4358
4358
|
}
|
|
4359
4359
|
const last = /[ \t]*(.*)/sy;
|
|
4360
4360
|
last.lastIndex = pos;
|
|
4361
4361
|
match = last.exec(source);
|
|
4362
|
-
return res +
|
|
4362
|
+
return res + sep2 + (match?.[1] ?? "");
|
|
4363
4363
|
}
|
|
4364
4364
|
function doubleQuotedValue(source, onError) {
|
|
4365
4365
|
let res = "";
|
|
@@ -5126,14 +5126,14 @@ var require_cst_stringify = __commonJS2((exports) => {
|
|
|
5126
5126
|
}
|
|
5127
5127
|
}
|
|
5128
5128
|
}
|
|
5129
|
-
function stringifyItem({ start, key, sep, value }) {
|
|
5129
|
+
function stringifyItem({ start, key, sep: sep2, value }) {
|
|
5130
5130
|
let res = "";
|
|
5131
5131
|
for (const st of start)
|
|
5132
5132
|
res += st.source;
|
|
5133
5133
|
if (key)
|
|
5134
5134
|
res += stringifyToken(key);
|
|
5135
|
-
if (
|
|
5136
|
-
for (const st of
|
|
5135
|
+
if (sep2)
|
|
5136
|
+
for (const st of sep2)
|
|
5137
5137
|
res += st.source;
|
|
5138
5138
|
if (value)
|
|
5139
5139
|
res += stringifyToken(value);
|
|
@@ -6272,18 +6272,18 @@ var require_parser = __commonJS2((exports) => {
|
|
|
6272
6272
|
if (this.type === "map-value-ind") {
|
|
6273
6273
|
const prev = getPrevProps(this.peek(2));
|
|
6274
6274
|
const start = getFirstKeyStartProps(prev);
|
|
6275
|
-
let
|
|
6275
|
+
let sep2;
|
|
6276
6276
|
if (scalar.end) {
|
|
6277
|
-
|
|
6278
|
-
|
|
6277
|
+
sep2 = scalar.end;
|
|
6278
|
+
sep2.push(this.sourceToken);
|
|
6279
6279
|
delete scalar.end;
|
|
6280
6280
|
} else
|
|
6281
|
-
|
|
6281
|
+
sep2 = [this.sourceToken];
|
|
6282
6282
|
const map = {
|
|
6283
6283
|
type: "block-map",
|
|
6284
6284
|
offset: scalar.offset,
|
|
6285
6285
|
indent: scalar.indent,
|
|
6286
|
-
items: [{ start, key: scalar, sep }]
|
|
6286
|
+
items: [{ start, key: scalar, sep: sep2 }]
|
|
6287
6287
|
};
|
|
6288
6288
|
this.onKeyLine = true;
|
|
6289
6289
|
this.stack[this.stack.length - 1] = map;
|
|
@@ -6437,15 +6437,15 @@ var require_parser = __commonJS2((exports) => {
|
|
|
6437
6437
|
} else if (isFlowToken(it.key) && !includesToken(it.sep, "newline")) {
|
|
6438
6438
|
const start2 = getFirstKeyStartProps(it.start);
|
|
6439
6439
|
const key = it.key;
|
|
6440
|
-
const
|
|
6441
|
-
|
|
6440
|
+
const sep2 = it.sep;
|
|
6441
|
+
sep2.push(this.sourceToken);
|
|
6442
6442
|
delete it.key;
|
|
6443
6443
|
delete it.sep;
|
|
6444
6444
|
this.stack.push({
|
|
6445
6445
|
type: "block-map",
|
|
6446
6446
|
offset: this.offset,
|
|
6447
6447
|
indent: this.indent,
|
|
6448
|
-
items: [{ start: start2, key, sep }]
|
|
6448
|
+
items: [{ start: start2, key, sep: sep2 }]
|
|
6449
6449
|
});
|
|
6450
6450
|
} else if (start.length > 0) {
|
|
6451
6451
|
it.sep = it.sep.concat(start, this.sourceToken);
|
|
@@ -6639,13 +6639,13 @@ var require_parser = __commonJS2((exports) => {
|
|
|
6639
6639
|
const prev = getPrevProps(parent);
|
|
6640
6640
|
const start = getFirstKeyStartProps(prev);
|
|
6641
6641
|
fixFlowSeqItems(fc);
|
|
6642
|
-
const
|
|
6643
|
-
|
|
6642
|
+
const sep2 = fc.end.splice(1, fc.end.length);
|
|
6643
|
+
sep2.push(this.sourceToken);
|
|
6644
6644
|
const map = {
|
|
6645
6645
|
type: "block-map",
|
|
6646
6646
|
offset: fc.offset,
|
|
6647
6647
|
indent: fc.indent,
|
|
6648
|
-
items: [{ start, key: fc, sep }]
|
|
6648
|
+
items: [{ start, key: fc, sep: sep2 }]
|
|
6649
6649
|
};
|
|
6650
6650
|
this.onKeyLine = true;
|
|
6651
6651
|
this.stack[this.stack.length - 1] = map;
|
|
@@ -11196,6 +11196,79 @@ function expandHome(p, home = homedir2()) {
|
|
|
11196
11196
|
}
|
|
11197
11197
|
var LOCAL_BINDS = new Set(["127.0.0.1", "localhost", "::1", "::ffff:127.0.0.1"]);
|
|
11198
11198
|
var import_yaml2 = __toESM2(require_dist(), 1);
|
|
11199
|
+
function readEnv(env, name) {
|
|
11200
|
+
const value = env[name];
|
|
11201
|
+
if (typeof value !== "string")
|
|
11202
|
+
return;
|
|
11203
|
+
const trimmed = value.trim();
|
|
11204
|
+
return trimmed.length > 0 ? trimmed : undefined;
|
|
11205
|
+
}
|
|
11206
|
+
function normalizePort(raw, fallback) {
|
|
11207
|
+
if (!raw)
|
|
11208
|
+
return String(fallback);
|
|
11209
|
+
if (!/^\d+$/.test(raw)) {
|
|
11210
|
+
throw new Error(`SIGNET_PORT must be an integer between 1 and 65535: ${raw}`);
|
|
11211
|
+
}
|
|
11212
|
+
const port = Number.parseInt(raw, 10);
|
|
11213
|
+
if (!Number.isFinite(port) || port < 1 || port > 65535) {
|
|
11214
|
+
throw new Error(`SIGNET_PORT must be an integer between 1 and 65535: ${raw}`);
|
|
11215
|
+
}
|
|
11216
|
+
return String(port);
|
|
11217
|
+
}
|
|
11218
|
+
function bracketIpv6Host(host) {
|
|
11219
|
+
if (host.startsWith("[") || !host.includes(":"))
|
|
11220
|
+
return host;
|
|
11221
|
+
return `[${host}]`;
|
|
11222
|
+
}
|
|
11223
|
+
function assertPlainHost(raw) {
|
|
11224
|
+
if (raw.includes("/") || raw.includes("@") || raw.includes("?") || raw.includes("#")) {
|
|
11225
|
+
throw new Error(`SIGNET_HOST must be a hostname or IP address, not a URL: ${raw}`);
|
|
11226
|
+
}
|
|
11227
|
+
const host = raw.startsWith("[") && raw.endsWith("]") ? raw.slice(1, -1) : raw;
|
|
11228
|
+
if (host.includes(":")) {
|
|
11229
|
+
if (/^[0-9A-Fa-f:.]+$/.test(host))
|
|
11230
|
+
return;
|
|
11231
|
+
throw new Error(`SIGNET_HOST must be a hostname or IP address: ${raw}`);
|
|
11232
|
+
}
|
|
11233
|
+
if (!/^[A-Za-z0-9]([A-Za-z0-9.-]*[A-Za-z0-9])?$/.test(host)) {
|
|
11234
|
+
throw new Error(`SIGNET_HOST must be a hostname or IP address: ${raw}`);
|
|
11235
|
+
}
|
|
11236
|
+
}
|
|
11237
|
+
function normalizeDaemonUrl(raw, source) {
|
|
11238
|
+
let parsed;
|
|
11239
|
+
try {
|
|
11240
|
+
parsed = new URL(raw);
|
|
11241
|
+
} catch {
|
|
11242
|
+
throw new Error(`${source} must be an http(s) URL: ${raw}`);
|
|
11243
|
+
}
|
|
11244
|
+
if (parsed.protocol !== "http:" && parsed.protocol !== "https:") {
|
|
11245
|
+
throw new Error(`${source} must use http or https: ${raw}`);
|
|
11246
|
+
}
|
|
11247
|
+
if (parsed.username || parsed.password) {
|
|
11248
|
+
throw new Error(`${source} must not include username or password credentials`);
|
|
11249
|
+
}
|
|
11250
|
+
if (parsed.search || parsed.hash) {
|
|
11251
|
+
throw new Error(`${source} must not include query strings or fragments`);
|
|
11252
|
+
}
|
|
11253
|
+
if (parsed.pathname !== "/" && parsed.pathname !== "") {
|
|
11254
|
+
throw new Error(`${source} must point at the daemon origin, not a path: ${raw}`);
|
|
11255
|
+
}
|
|
11256
|
+
return parsed.toString().replace(/\/$/, "");
|
|
11257
|
+
}
|
|
11258
|
+
function resolveSignetDaemonUrl(opts = {}) {
|
|
11259
|
+
const env = opts.env ?? process.env;
|
|
11260
|
+
const fallbackHost = opts.defaultHost ?? "127.0.0.1";
|
|
11261
|
+
const fallbackPort = opts.defaultPort ?? 3850;
|
|
11262
|
+
const explicit = readEnv(env, "SIGNET_DAEMON_URL");
|
|
11263
|
+
if (explicit)
|
|
11264
|
+
return normalizeDaemonUrl(explicit, "SIGNET_DAEMON_URL");
|
|
11265
|
+
if (opts.configUrl)
|
|
11266
|
+
return normalizeDaemonUrl(opts.configUrl, "daemon.url");
|
|
11267
|
+
const host = readEnv(env, "SIGNET_HOST") ?? fallbackHost;
|
|
11268
|
+
assertPlainHost(host);
|
|
11269
|
+
const port = normalizePort(readEnv(env, "SIGNET_PORT"), fallbackPort);
|
|
11270
|
+
return normalizeDaemonUrl(`http://${bracketIpv6Host(host)}:${port}`, "SIGNET_HOST/SIGNET_PORT");
|
|
11271
|
+
}
|
|
11199
11272
|
var WORKSPACE_ENV_KEYS = ["SIGNET_PATH", "SIGNET_WORKSPACE"];
|
|
11200
11273
|
var DEFAULT_AGENTS_DIRNAME = ".agents";
|
|
11201
11274
|
function normalizeWorkspacePath(pathValue, home = homedir3()) {
|
|
@@ -11622,19 +11695,50 @@ function resolvePackagedSignetCommand(bareCommand, scriptDirectory, scriptName,
|
|
|
11622
11695
|
function resolveSignetMcpCommand() {
|
|
11623
11696
|
return resolvePackagedSignetCommand("signet-mcp", "dist", "mcp-stdio.js", true);
|
|
11624
11697
|
}
|
|
11625
|
-
function
|
|
11698
|
+
function isJsonObject(value) {
|
|
11699
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
11700
|
+
}
|
|
11701
|
+
function isChildOf(candidate, parent) {
|
|
11702
|
+
const rel = relative(parent, candidate);
|
|
11703
|
+
return rel !== "" && rel !== ".." && !rel.startsWith(`..${sep}`) && !isAbsolute(rel);
|
|
11704
|
+
}
|
|
11705
|
+
function readTrimmedEnv2(name) {
|
|
11626
11706
|
const value = process.env[name];
|
|
11627
11707
|
if (typeof value !== "string")
|
|
11628
11708
|
return;
|
|
11629
|
-
const trimmed = value.trim();
|
|
11709
|
+
const trimmed = value.trim().replace(/[\r\n]+/g, "");
|
|
11630
11710
|
return trimmed.length > 0 ? trimmed : undefined;
|
|
11631
11711
|
}
|
|
11712
|
+
function readManagedTrimmedEnv(name) {
|
|
11713
|
+
return readTrimmedEnv2(name);
|
|
11714
|
+
}
|
|
11632
11715
|
function resolveSignetWorkspacePath(home2 = homedir()) {
|
|
11633
11716
|
return resolveWorkspacePath({ home: home2, strict: true, requireExistingEnvPath: true }).path;
|
|
11634
11717
|
}
|
|
11718
|
+
function resolveSignetDaemonUrl2() {
|
|
11719
|
+
return resolveSignetDaemonUrl();
|
|
11720
|
+
}
|
|
11635
11721
|
function resolveSignetApiKey() {
|
|
11636
11722
|
return readManagedTrimmedEnv("SIGNET_API_KEY") ?? readManagedTrimmedEnv("SIGNET_TOKEN");
|
|
11637
11723
|
}
|
|
11724
|
+
function buildSignetRuntimeEnv(opts = {}) {
|
|
11725
|
+
const env = {};
|
|
11726
|
+
if (opts.basePath)
|
|
11727
|
+
env.SIGNET_PATH = opts.basePath;
|
|
11728
|
+
const daemonUrl = readManagedTrimmedEnv("SIGNET_DAEMON_URL");
|
|
11729
|
+
const apiKey = resolveSignetApiKey();
|
|
11730
|
+
const agentId = readManagedTrimmedEnv("SIGNET_AGENT_ID");
|
|
11731
|
+
if (daemonUrl)
|
|
11732
|
+
env.SIGNET_DAEMON_URL = resolveSignetDaemonUrl2();
|
|
11733
|
+
if (apiKey)
|
|
11734
|
+
env.SIGNET_API_KEY = apiKey;
|
|
11735
|
+
if (agentId)
|
|
11736
|
+
env.SIGNET_AGENT_ID = agentId;
|
|
11737
|
+
return env;
|
|
11738
|
+
}
|
|
11739
|
+
function resolveRemoteDaemonUrl() {
|
|
11740
|
+
return readManagedTrimmedEnv("SIGNET_DAEMON_URL") ? resolveSignetDaemonUrl2() : null;
|
|
11741
|
+
}
|
|
11638
11742
|
|
|
11639
11743
|
// ../../../platform/core/dist/index.js
|
|
11640
11744
|
import { createRequire as createRequire3 } from "node:module";
|
|
@@ -15256,10 +15360,10 @@ var require_resolve_block_map2 = __commonJS((exports) => {
|
|
|
15256
15360
|
let offset = bm.offset;
|
|
15257
15361
|
let commentEnd = null;
|
|
15258
15362
|
for (const collItem of bm.items) {
|
|
15259
|
-
const { start, key, sep, value } = collItem;
|
|
15363
|
+
const { start, key, sep: sep2, value } = collItem;
|
|
15260
15364
|
const keyProps = resolveProps.resolveProps(start, {
|
|
15261
15365
|
indicator: "explicit-key-ind",
|
|
15262
|
-
next: key ??
|
|
15366
|
+
next: key ?? sep2?.[0],
|
|
15263
15367
|
offset,
|
|
15264
15368
|
onError,
|
|
15265
15369
|
parentIndent: bm.indent,
|
|
@@ -15273,7 +15377,7 @@ var require_resolve_block_map2 = __commonJS((exports) => {
|
|
|
15273
15377
|
else if ("indent" in key && key.indent !== bm.indent)
|
|
15274
15378
|
onError(offset, "BAD_INDENT", startColMsg);
|
|
15275
15379
|
}
|
|
15276
|
-
if (!keyProps.anchor && !keyProps.tag && !
|
|
15380
|
+
if (!keyProps.anchor && !keyProps.tag && !sep2) {
|
|
15277
15381
|
commentEnd = keyProps.end;
|
|
15278
15382
|
if (keyProps.comment) {
|
|
15279
15383
|
if (map.comment)
|
|
@@ -15298,7 +15402,7 @@ var require_resolve_block_map2 = __commonJS((exports) => {
|
|
|
15298
15402
|
ctx.atKey = false;
|
|
15299
15403
|
if (utilMapIncludes.mapIncludes(ctx, map.items, keyNode))
|
|
15300
15404
|
onError(keyStart, "DUPLICATE_KEY", "Map keys must be unique");
|
|
15301
|
-
const valueProps = resolveProps.resolveProps(
|
|
15405
|
+
const valueProps = resolveProps.resolveProps(sep2 ?? [], {
|
|
15302
15406
|
indicator: "map-value-ind",
|
|
15303
15407
|
next: value,
|
|
15304
15408
|
offset: keyNode.range[2],
|
|
@@ -15314,7 +15418,7 @@ var require_resolve_block_map2 = __commonJS((exports) => {
|
|
|
15314
15418
|
if (ctx.options.strict && keyProps.start < valueProps.found.offset - 1024)
|
|
15315
15419
|
onError(keyNode.range, "KEY_OVER_1024_CHARS", "The : indicator must be at most 1024 chars after the start of an implicit block mapping key");
|
|
15316
15420
|
}
|
|
15317
|
-
const valueNode = value ? composeNode(ctx, value, valueProps, onError) : composeEmptyNode(ctx, offset,
|
|
15421
|
+
const valueNode = value ? composeNode(ctx, value, valueProps, onError) : composeEmptyNode(ctx, offset, sep2, null, valueProps, onError);
|
|
15318
15422
|
if (ctx.schema.compat)
|
|
15319
15423
|
utilFlowIndentCheck.flowIndentCheck(bm.indent, value, onError);
|
|
15320
15424
|
offset = valueNode.range[2];
|
|
@@ -15396,7 +15500,7 @@ var require_resolve_end2 = __commonJS((exports) => {
|
|
|
15396
15500
|
let comment = "";
|
|
15397
15501
|
if (end) {
|
|
15398
15502
|
let hasSpace = false;
|
|
15399
|
-
let
|
|
15503
|
+
let sep2 = "";
|
|
15400
15504
|
for (const token of end) {
|
|
15401
15505
|
const { source, type } = token;
|
|
15402
15506
|
switch (type) {
|
|
@@ -15410,13 +15514,13 @@ var require_resolve_end2 = __commonJS((exports) => {
|
|
|
15410
15514
|
if (!comment)
|
|
15411
15515
|
comment = cb;
|
|
15412
15516
|
else
|
|
15413
|
-
comment +=
|
|
15414
|
-
|
|
15517
|
+
comment += sep2 + cb;
|
|
15518
|
+
sep2 = "";
|
|
15415
15519
|
break;
|
|
15416
15520
|
}
|
|
15417
15521
|
case "newline":
|
|
15418
15522
|
if (comment)
|
|
15419
|
-
|
|
15523
|
+
sep2 += source;
|
|
15420
15524
|
hasSpace = true;
|
|
15421
15525
|
break;
|
|
15422
15526
|
default:
|
|
@@ -15454,18 +15558,18 @@ var require_resolve_flow_collection2 = __commonJS((exports) => {
|
|
|
15454
15558
|
let offset = fc.offset + fc.start.source.length;
|
|
15455
15559
|
for (let i = 0;i < fc.items.length; ++i) {
|
|
15456
15560
|
const collItem = fc.items[i];
|
|
15457
|
-
const { start, key, sep, value } = collItem;
|
|
15561
|
+
const { start, key, sep: sep2, value } = collItem;
|
|
15458
15562
|
const props = resolveProps.resolveProps(start, {
|
|
15459
15563
|
flow: fcName,
|
|
15460
15564
|
indicator: "explicit-key-ind",
|
|
15461
|
-
next: key ??
|
|
15565
|
+
next: key ?? sep2?.[0],
|
|
15462
15566
|
offset,
|
|
15463
15567
|
onError,
|
|
15464
15568
|
parentIndent: fc.indent,
|
|
15465
15569
|
startOnNewline: false
|
|
15466
15570
|
});
|
|
15467
15571
|
if (!props.found) {
|
|
15468
|
-
if (!props.anchor && !props.tag && !
|
|
15572
|
+
if (!props.anchor && !props.tag && !sep2 && !value) {
|
|
15469
15573
|
if (i === 0 && props.comma)
|
|
15470
15574
|
onError(props.comma, "UNEXPECTED_TOKEN", `Unexpected , in ${fcName}`);
|
|
15471
15575
|
else if (i < fc.items.length - 1)
|
|
@@ -15517,8 +15621,8 @@ var require_resolve_flow_collection2 = __commonJS((exports) => {
|
|
|
15517
15621
|
}
|
|
15518
15622
|
}
|
|
15519
15623
|
}
|
|
15520
|
-
if (!isMap && !
|
|
15521
|
-
const valueNode = value ? composeNode(ctx, value, props, onError) : composeEmptyNode(ctx, props.end,
|
|
15624
|
+
if (!isMap && !sep2 && !props.found) {
|
|
15625
|
+
const valueNode = value ? composeNode(ctx, value, props, onError) : composeEmptyNode(ctx, props.end, sep2, null, props, onError);
|
|
15522
15626
|
coll.items.push(valueNode);
|
|
15523
15627
|
offset = valueNode.range[2];
|
|
15524
15628
|
if (isBlock(value))
|
|
@@ -15530,7 +15634,7 @@ var require_resolve_flow_collection2 = __commonJS((exports) => {
|
|
|
15530
15634
|
if (isBlock(key))
|
|
15531
15635
|
onError(keyNode.range, "BLOCK_IN_FLOW", blockMsg);
|
|
15532
15636
|
ctx.atKey = false;
|
|
15533
|
-
const valueProps = resolveProps.resolveProps(
|
|
15637
|
+
const valueProps = resolveProps.resolveProps(sep2 ?? [], {
|
|
15534
15638
|
flow: fcName,
|
|
15535
15639
|
indicator: "map-value-ind",
|
|
15536
15640
|
next: value,
|
|
@@ -15541,8 +15645,8 @@ var require_resolve_flow_collection2 = __commonJS((exports) => {
|
|
|
15541
15645
|
});
|
|
15542
15646
|
if (valueProps.found) {
|
|
15543
15647
|
if (!isMap && !props.found && ctx.options.strict) {
|
|
15544
|
-
if (
|
|
15545
|
-
for (const st of
|
|
15648
|
+
if (sep2)
|
|
15649
|
+
for (const st of sep2) {
|
|
15546
15650
|
if (st === valueProps.found)
|
|
15547
15651
|
break;
|
|
15548
15652
|
if (st.type === "newline") {
|
|
@@ -15559,7 +15663,7 @@ var require_resolve_flow_collection2 = __commonJS((exports) => {
|
|
|
15559
15663
|
else
|
|
15560
15664
|
onError(valueProps.start, "MISSING_CHAR", `Missing , or : between ${fcName} items`);
|
|
15561
15665
|
}
|
|
15562
|
-
const valueNode = value ? composeNode(ctx, value, valueProps, onError) : valueProps.found ? composeEmptyNode(ctx, valueProps.end,
|
|
15666
|
+
const valueNode = value ? composeNode(ctx, value, valueProps, onError) : valueProps.found ? composeEmptyNode(ctx, valueProps.end, sep2, null, valueProps, onError) : null;
|
|
15563
15667
|
if (valueNode) {
|
|
15564
15668
|
if (isBlock(value))
|
|
15565
15669
|
onError(valueNode.range, "BLOCK_IN_FLOW", blockMsg);
|
|
@@ -15732,7 +15836,7 @@ var require_resolve_block_scalar2 = __commonJS((exports) => {
|
|
|
15732
15836
|
chompStart = i + 1;
|
|
15733
15837
|
}
|
|
15734
15838
|
let value = "";
|
|
15735
|
-
let
|
|
15839
|
+
let sep2 = "";
|
|
15736
15840
|
let prevMoreIndented = false;
|
|
15737
15841
|
for (let i = 0;i < contentStart; ++i)
|
|
15738
15842
|
value += lines[i][0].slice(trimIndent) + `
|
|
@@ -15750,33 +15854,33 @@ var require_resolve_block_scalar2 = __commonJS((exports) => {
|
|
|
15750
15854
|
indent = "";
|
|
15751
15855
|
}
|
|
15752
15856
|
if (type === Scalar.Scalar.BLOCK_LITERAL) {
|
|
15753
|
-
value +=
|
|
15754
|
-
|
|
15857
|
+
value += sep2 + indent.slice(trimIndent) + content;
|
|
15858
|
+
sep2 = `
|
|
15755
15859
|
`;
|
|
15756
15860
|
} else if (indent.length > trimIndent || content[0] === "\t") {
|
|
15757
|
-
if (
|
|
15758
|
-
|
|
15861
|
+
if (sep2 === " ")
|
|
15862
|
+
sep2 = `
|
|
15759
15863
|
`;
|
|
15760
|
-
else if (!prevMoreIndented &&
|
|
15864
|
+
else if (!prevMoreIndented && sep2 === `
|
|
15761
15865
|
`)
|
|
15762
|
-
|
|
15866
|
+
sep2 = `
|
|
15763
15867
|
|
|
15764
15868
|
`;
|
|
15765
|
-
value +=
|
|
15766
|
-
|
|
15869
|
+
value += sep2 + indent.slice(trimIndent) + content;
|
|
15870
|
+
sep2 = `
|
|
15767
15871
|
`;
|
|
15768
15872
|
prevMoreIndented = true;
|
|
15769
15873
|
} else if (content === "") {
|
|
15770
|
-
if (
|
|
15874
|
+
if (sep2 === `
|
|
15771
15875
|
`)
|
|
15772
15876
|
value += `
|
|
15773
15877
|
`;
|
|
15774
15878
|
else
|
|
15775
|
-
|
|
15879
|
+
sep2 = `
|
|
15776
15880
|
`;
|
|
15777
15881
|
} else {
|
|
15778
|
-
value +=
|
|
15779
|
-
|
|
15882
|
+
value += sep2 + content;
|
|
15883
|
+
sep2 = " ";
|
|
15780
15884
|
prevMoreIndented = false;
|
|
15781
15885
|
}
|
|
15782
15886
|
}
|
|
@@ -15955,27 +16059,27 @@ var require_resolve_flow_scalar2 = __commonJS((exports) => {
|
|
|
15955
16059
|
if (!match)
|
|
15956
16060
|
return source;
|
|
15957
16061
|
let res = match[1];
|
|
15958
|
-
let
|
|
16062
|
+
let sep2 = " ";
|
|
15959
16063
|
let pos = first.lastIndex;
|
|
15960
16064
|
line.lastIndex = pos;
|
|
15961
16065
|
while (match = line.exec(source)) {
|
|
15962
16066
|
if (match[1] === "") {
|
|
15963
|
-
if (
|
|
16067
|
+
if (sep2 === `
|
|
15964
16068
|
`)
|
|
15965
|
-
res +=
|
|
16069
|
+
res += sep2;
|
|
15966
16070
|
else
|
|
15967
|
-
|
|
16071
|
+
sep2 = `
|
|
15968
16072
|
`;
|
|
15969
16073
|
} else {
|
|
15970
|
-
res +=
|
|
15971
|
-
|
|
16074
|
+
res += sep2 + match[1];
|
|
16075
|
+
sep2 = " ";
|
|
15972
16076
|
}
|
|
15973
16077
|
pos = line.lastIndex;
|
|
15974
16078
|
}
|
|
15975
16079
|
const last = /[ \t]*(.*)/sy;
|
|
15976
16080
|
last.lastIndex = pos;
|
|
15977
16081
|
match = last.exec(source);
|
|
15978
|
-
return res +
|
|
16082
|
+
return res + sep2 + (match?.[1] ?? "");
|
|
15979
16083
|
}
|
|
15980
16084
|
function doubleQuotedValue(source, onError) {
|
|
15981
16085
|
let res = "";
|
|
@@ -16742,14 +16846,14 @@ var require_cst_stringify2 = __commonJS((exports) => {
|
|
|
16742
16846
|
}
|
|
16743
16847
|
}
|
|
16744
16848
|
}
|
|
16745
|
-
function stringifyItem({ start, key, sep, value }) {
|
|
16849
|
+
function stringifyItem({ start, key, sep: sep2, value }) {
|
|
16746
16850
|
let res = "";
|
|
16747
16851
|
for (const st of start)
|
|
16748
16852
|
res += st.source;
|
|
16749
16853
|
if (key)
|
|
16750
16854
|
res += stringifyToken(key);
|
|
16751
|
-
if (
|
|
16752
|
-
for (const st of
|
|
16855
|
+
if (sep2)
|
|
16856
|
+
for (const st of sep2)
|
|
16753
16857
|
res += st.source;
|
|
16754
16858
|
if (value)
|
|
16755
16859
|
res += stringifyToken(value);
|
|
@@ -17888,18 +17992,18 @@ var require_parser2 = __commonJS((exports) => {
|
|
|
17888
17992
|
if (this.type === "map-value-ind") {
|
|
17889
17993
|
const prev = getPrevProps(this.peek(2));
|
|
17890
17994
|
const start = getFirstKeyStartProps(prev);
|
|
17891
|
-
let
|
|
17995
|
+
let sep2;
|
|
17892
17996
|
if (scalar.end) {
|
|
17893
|
-
|
|
17894
|
-
|
|
17997
|
+
sep2 = scalar.end;
|
|
17998
|
+
sep2.push(this.sourceToken);
|
|
17895
17999
|
delete scalar.end;
|
|
17896
18000
|
} else
|
|
17897
|
-
|
|
18001
|
+
sep2 = [this.sourceToken];
|
|
17898
18002
|
const map = {
|
|
17899
18003
|
type: "block-map",
|
|
17900
18004
|
offset: scalar.offset,
|
|
17901
18005
|
indent: scalar.indent,
|
|
17902
|
-
items: [{ start, key: scalar, sep }]
|
|
18006
|
+
items: [{ start, key: scalar, sep: sep2 }]
|
|
17903
18007
|
};
|
|
17904
18008
|
this.onKeyLine = true;
|
|
17905
18009
|
this.stack[this.stack.length - 1] = map;
|
|
@@ -18053,15 +18157,15 @@ var require_parser2 = __commonJS((exports) => {
|
|
|
18053
18157
|
} else if (isFlowToken(it.key) && !includesToken(it.sep, "newline")) {
|
|
18054
18158
|
const start2 = getFirstKeyStartProps(it.start);
|
|
18055
18159
|
const key = it.key;
|
|
18056
|
-
const
|
|
18057
|
-
|
|
18160
|
+
const sep2 = it.sep;
|
|
18161
|
+
sep2.push(this.sourceToken);
|
|
18058
18162
|
delete it.key;
|
|
18059
18163
|
delete it.sep;
|
|
18060
18164
|
this.stack.push({
|
|
18061
18165
|
type: "block-map",
|
|
18062
18166
|
offset: this.offset,
|
|
18063
18167
|
indent: this.indent,
|
|
18064
|
-
items: [{ start: start2, key, sep }]
|
|
18168
|
+
items: [{ start: start2, key, sep: sep2 }]
|
|
18065
18169
|
});
|
|
18066
18170
|
} else if (start.length > 0) {
|
|
18067
18171
|
it.sep = it.sep.concat(start, this.sourceToken);
|
|
@@ -18255,13 +18359,13 @@ var require_parser2 = __commonJS((exports) => {
|
|
|
18255
18359
|
const prev = getPrevProps(parent);
|
|
18256
18360
|
const start = getFirstKeyStartProps(prev);
|
|
18257
18361
|
fixFlowSeqItems(fc);
|
|
18258
|
-
const
|
|
18259
|
-
|
|
18362
|
+
const sep2 = fc.end.splice(1, fc.end.length);
|
|
18363
|
+
sep2.push(this.sourceToken);
|
|
18260
18364
|
const map = {
|
|
18261
18365
|
type: "block-map",
|
|
18262
18366
|
offset: fc.offset,
|
|
18263
18367
|
indent: fc.indent,
|
|
18264
|
-
items: [{ start, key: fc, sep }]
|
|
18368
|
+
items: [{ start, key: fc, sep: sep2 }]
|
|
18265
18369
|
};
|
|
18266
18370
|
this.onKeyLine = true;
|
|
18267
18371
|
this.stack[this.stack.length - 1] = map;
|
|
@@ -22820,79 +22924,6 @@ function parseSimpleYaml(text) {
|
|
|
22820
22924
|
return {};
|
|
22821
22925
|
}
|
|
22822
22926
|
}
|
|
22823
|
-
function readEnv(env, name) {
|
|
22824
|
-
const value = env[name];
|
|
22825
|
-
if (typeof value !== "string")
|
|
22826
|
-
return;
|
|
22827
|
-
const trimmed = value.trim();
|
|
22828
|
-
return trimmed.length > 0 ? trimmed : undefined;
|
|
22829
|
-
}
|
|
22830
|
-
function normalizePort(raw, fallback) {
|
|
22831
|
-
if (!raw)
|
|
22832
|
-
return String(fallback);
|
|
22833
|
-
if (!/^\d+$/.test(raw)) {
|
|
22834
|
-
throw new Error(`SIGNET_PORT must be an integer between 1 and 65535: ${raw}`);
|
|
22835
|
-
}
|
|
22836
|
-
const port = Number.parseInt(raw, 10);
|
|
22837
|
-
if (!Number.isFinite(port) || port < 1 || port > 65535) {
|
|
22838
|
-
throw new Error(`SIGNET_PORT must be an integer between 1 and 65535: ${raw}`);
|
|
22839
|
-
}
|
|
22840
|
-
return String(port);
|
|
22841
|
-
}
|
|
22842
|
-
function bracketIpv6Host(host) {
|
|
22843
|
-
if (host.startsWith("[") || !host.includes(":"))
|
|
22844
|
-
return host;
|
|
22845
|
-
return `[${host}]`;
|
|
22846
|
-
}
|
|
22847
|
-
function assertPlainHost(raw) {
|
|
22848
|
-
if (raw.includes("/") || raw.includes("@") || raw.includes("?") || raw.includes("#")) {
|
|
22849
|
-
throw new Error(`SIGNET_HOST must be a hostname or IP address, not a URL: ${raw}`);
|
|
22850
|
-
}
|
|
22851
|
-
const host = raw.startsWith("[") && raw.endsWith("]") ? raw.slice(1, -1) : raw;
|
|
22852
|
-
if (host.includes(":")) {
|
|
22853
|
-
if (/^[0-9A-Fa-f:.]+$/.test(host))
|
|
22854
|
-
return;
|
|
22855
|
-
throw new Error(`SIGNET_HOST must be a hostname or IP address: ${raw}`);
|
|
22856
|
-
}
|
|
22857
|
-
if (!/^[A-Za-z0-9]([A-Za-z0-9.-]*[A-Za-z0-9])?$/.test(host)) {
|
|
22858
|
-
throw new Error(`SIGNET_HOST must be a hostname or IP address: ${raw}`);
|
|
22859
|
-
}
|
|
22860
|
-
}
|
|
22861
|
-
function normalizeDaemonUrl(raw, source) {
|
|
22862
|
-
let parsed;
|
|
22863
|
-
try {
|
|
22864
|
-
parsed = new URL(raw);
|
|
22865
|
-
} catch {
|
|
22866
|
-
throw new Error(`${source} must be an http(s) URL: ${raw}`);
|
|
22867
|
-
}
|
|
22868
|
-
if (parsed.protocol !== "http:" && parsed.protocol !== "https:") {
|
|
22869
|
-
throw new Error(`${source} must use http or https: ${raw}`);
|
|
22870
|
-
}
|
|
22871
|
-
if (parsed.username || parsed.password) {
|
|
22872
|
-
throw new Error(`${source} must not include username or password credentials`);
|
|
22873
|
-
}
|
|
22874
|
-
if (parsed.search || parsed.hash) {
|
|
22875
|
-
throw new Error(`${source} must not include query strings or fragments`);
|
|
22876
|
-
}
|
|
22877
|
-
if (parsed.pathname !== "/" && parsed.pathname !== "") {
|
|
22878
|
-
throw new Error(`${source} must point at the daemon origin, not a path: ${raw}`);
|
|
22879
|
-
}
|
|
22880
|
-
return parsed.toString().replace(/\/$/, "");
|
|
22881
|
-
}
|
|
22882
|
-
function resolveSignetDaemonUrl(opts = {}) {
|
|
22883
|
-
const env = opts.env ?? process.env;
|
|
22884
|
-
const fallbackHost = opts.defaultHost ?? "127.0.0.1";
|
|
22885
|
-
const fallbackPort = opts.defaultPort ?? 3850;
|
|
22886
|
-
const explicit = readEnv(env, "SIGNET_DAEMON_URL");
|
|
22887
|
-
if (explicit)
|
|
22888
|
-
return normalizeDaemonUrl(explicit, "SIGNET_DAEMON_URL");
|
|
22889
|
-
if (opts.configUrl)
|
|
22890
|
-
return normalizeDaemonUrl(opts.configUrl, "daemon.url");
|
|
22891
|
-
const host = readEnv(env, "SIGNET_HOST") ?? fallbackHost;
|
|
22892
|
-
assertPlainHost(host);
|
|
22893
|
-
const port = normalizePort(readEnv(env, "SIGNET_PORT"), fallbackPort);
|
|
22894
|
-
return normalizeDaemonUrl(`http://${bracketIpv6Host(host)}:${port}`, "SIGNET_HOST/SIGNET_PORT");
|
|
22895
|
-
}
|
|
22896
22927
|
var native2 = null;
|
|
22897
22928
|
try {
|
|
22898
22929
|
const esmRequire = createRequire22(import.meta.url);
|
|
@@ -23078,16 +23109,6 @@ var home2 = homedir82();
|
|
|
23078
23109
|
|
|
23079
23110
|
// src/index.ts
|
|
23080
23111
|
var SIGNET_FORGE_MARKER = "Managed by Signet (@signetai/connector-forge)";
|
|
23081
|
-
function isJsonObject(value) {
|
|
23082
|
-
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
23083
|
-
}
|
|
23084
|
-
function readTrimmedEnv2(name) {
|
|
23085
|
-
const value = process.env[name];
|
|
23086
|
-
if (typeof value !== "string")
|
|
23087
|
-
return;
|
|
23088
|
-
const trimmed = value.trim().replace(/[\r\n]+/g, "");
|
|
23089
|
-
return trimmed.length > 0 ? trimmed : undefined;
|
|
23090
|
-
}
|
|
23091
23112
|
function getHomeDir() {
|
|
23092
23113
|
const home3 = readTrimmedEnv2("HOME");
|
|
23093
23114
|
return home3 ?? homedir5();
|
|
@@ -23108,22 +23129,6 @@ function readMcpServers(config) {
|
|
|
23108
23129
|
return { ...config.mcpServers };
|
|
23109
23130
|
throw new Error("Forge MCP config field 'mcpServers' must be an object");
|
|
23110
23131
|
}
|
|
23111
|
-
function signetRuntimeEnv(basePath) {
|
|
23112
|
-
const env = { SIGNET_PATH: basePath };
|
|
23113
|
-
const daemonUrl = readTrimmedEnv2("SIGNET_DAEMON_URL");
|
|
23114
|
-
const apiKey = readTrimmedEnv2("SIGNET_API_KEY") ?? readTrimmedEnv2("SIGNET_TOKEN");
|
|
23115
|
-
const agentId = readTrimmedEnv2("SIGNET_AGENT_ID");
|
|
23116
|
-
if (daemonUrl)
|
|
23117
|
-
env.SIGNET_DAEMON_URL = daemonUrl;
|
|
23118
|
-
if (apiKey)
|
|
23119
|
-
env.SIGNET_API_KEY = apiKey;
|
|
23120
|
-
if (agentId)
|
|
23121
|
-
env.SIGNET_AGENT_ID = agentId;
|
|
23122
|
-
return env;
|
|
23123
|
-
}
|
|
23124
|
-
function resolveRemoteDaemonUrl() {
|
|
23125
|
-
return readTrimmedEnv2("SIGNET_DAEMON_URL") ? resolveSignetDaemonUrl() : null;
|
|
23126
|
-
}
|
|
23127
23132
|
function buildMcpServer(basePath) {
|
|
23128
23133
|
const remoteDaemonUrl = resolveRemoteDaemonUrl();
|
|
23129
23134
|
if (remoteDaemonUrl) {
|
|
@@ -23137,13 +23142,9 @@ function buildMcpServer(basePath) {
|
|
|
23137
23142
|
return {
|
|
23138
23143
|
command: mcp.command,
|
|
23139
23144
|
...mcp.args && mcp.args.length > 0 ? { args: mcp.args } : {},
|
|
23140
|
-
env:
|
|
23145
|
+
env: buildSignetRuntimeEnv({ basePath })
|
|
23141
23146
|
};
|
|
23142
23147
|
}
|
|
23143
|
-
function isChildOf(candidate, parent) {
|
|
23144
|
-
const rel = relative(parent, candidate);
|
|
23145
|
-
return rel !== "" && rel !== ".." && !rel.startsWith(`..${sep}`) && !isAbsolute(rel);
|
|
23146
|
-
}
|
|
23147
23148
|
|
|
23148
23149
|
class ForgeConnector extends BaseConnector {
|
|
23149
23150
|
name = "ForgeCode";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@signetai/connector-forge",
|
|
3
|
-
"version": "0.163.
|
|
3
|
+
"version": "0.163.19",
|
|
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.163.
|
|
28
|
-
"@signetai/core": "0.163.
|
|
27
|
+
"@signetai/connector-base": "0.163.19",
|
|
28
|
+
"@signetai/core": "0.163.19"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
31
|
"@types/node": "^22.0.0",
|