@signetai/connector-opencode 0.163.16 → 0.163.18
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 +124 -121
- 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;;;;;;;;;;;;;;;;;;;GAmBG;AAKH,OAAO,EACN,aAAa,EACb,KAAK,aAAa,EAClB,KAAK,eAAe,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAKH,OAAO,EACN,aAAa,EACb,KAAK,aAAa,EAClB,KAAK,eAAe,EAOpB,MAAM,wBAAwB,CAAC;AA6EhC;;;;;GAKG;AACH,qBAAa,iBAAkB,SAAQ,aAAa;IACnD,QAAQ,CAAC,IAAI,cAAc;IAC3B,QAAQ,CAAC,SAAS,cAAc;IAEhC,SAAS,CAAC,eAAe,IAAI,MAAM;IAInC,aAAa,IAAI,MAAM;IAUvB,OAAO,CAAC,cAAc;IAItB,OAAO,CAAC,iBAAiB;IAIzB,OAAO,CAAC,iBAAiB;IAIzB,OAAO,CAAC,oBAAoB;IAI5B;;;;;;;;OAQG;IACG,OAAO,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC;IAyGvD;;OAEG;IACG,SAAS,IAAI,OAAO,CAAC,eAAe,CAAC;IAqC3C;;OAEG;IACH,WAAW,IAAI,OAAO;IAItB;;OAEG;IACH,MAAM,CAAC,kBAAkB,IAAI,OAAO;IAqBpC;;OAEG;IACH,OAAO,CAAC,iBAAiB;IAmBzB,OAAO,CAAC,UAAU;IASlB,OAAO,CAAC,wBAAwB;IAMhC,OAAO,CAAC,oBAAoB;IAS5B,OAAO,CAAC,mBAAmB;IAM3B,OAAO,CAAC,eAAe;IAMvB,OAAO,CAAC,kBAAkB;IAW1B,OAAO,CAAC,cAAc;IAatB,OAAO,CAAC,YAAY;IAWpB,OAAO,CAAC,iBAAiB;IA8BzB,OAAO,CAAC,eAAe;IAavB,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,qBAAqB,CAM3C;IAEF,OAAO,CAAC,qBAAqB;IAS7B,OAAO,CAAC,mBAAmB;IAa3B,OAAO,CAAC,gBAAgB;IAQxB,OAAO,CAAC,mBAAmB;IAW3B;;OAEG;YACW,gBAAgB;CAmB9B;AAMD,eAAO,MAAM,iBAAiB,mBAA0B,CAAC;AACzD,eAAe,iBAAiB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
// src/index.ts
|
|
2
2
|
import { existsSync as existsSync2, mkdirSync, readFileSync as readFileSync2, rmSync, writeFileSync as writeFileSync2 } from "node:fs";
|
|
3
3
|
import { homedir } from "node:os";
|
|
4
|
-
import { join as join4, relative } from "node:path";
|
|
4
|
+
import { join as join4, relative as relative2 } from "node:path";
|
|
5
5
|
|
|
6
6
|
// ../../../libs/connector-base/dist/index.js
|
|
7
7
|
import { randomBytes } from "node:crypto";
|
|
8
8
|
import { existsSync, readFileSync, renameSync, statSync as statSync2, unlinkSync as unlinkSync2, writeFileSync } from "node:fs";
|
|
9
|
-
import { dirname as dirname3, join as join3 } from "node:path";
|
|
9
|
+
import { dirname as dirname3, isAbsolute, join as join3, relative, sep } from "node:path";
|
|
10
10
|
import { createRequire } from "node:module";
|
|
11
11
|
import { dirname, join } from "node:path";
|
|
12
12
|
import { fileURLToPath } from "node:url";
|
|
@@ -3624,10 +3624,10 @@ var require_resolve_block_map = __commonJS2((exports) => {
|
|
|
3624
3624
|
let offset = bm.offset;
|
|
3625
3625
|
let commentEnd = null;
|
|
3626
3626
|
for (const collItem of bm.items) {
|
|
3627
|
-
const { start, key, sep, value } = collItem;
|
|
3627
|
+
const { start, key, sep: sep2, value } = collItem;
|
|
3628
3628
|
const keyProps = resolveProps.resolveProps(start, {
|
|
3629
3629
|
indicator: "explicit-key-ind",
|
|
3630
|
-
next: key ??
|
|
3630
|
+
next: key ?? sep2?.[0],
|
|
3631
3631
|
offset,
|
|
3632
3632
|
onError,
|
|
3633
3633
|
parentIndent: bm.indent,
|
|
@@ -3641,7 +3641,7 @@ var require_resolve_block_map = __commonJS2((exports) => {
|
|
|
3641
3641
|
else if ("indent" in key && key.indent !== bm.indent)
|
|
3642
3642
|
onError(offset, "BAD_INDENT", startColMsg);
|
|
3643
3643
|
}
|
|
3644
|
-
if (!keyProps.anchor && !keyProps.tag && !
|
|
3644
|
+
if (!keyProps.anchor && !keyProps.tag && !sep2) {
|
|
3645
3645
|
commentEnd = keyProps.end;
|
|
3646
3646
|
if (keyProps.comment) {
|
|
3647
3647
|
if (map.comment)
|
|
@@ -3666,7 +3666,7 @@ var require_resolve_block_map = __commonJS2((exports) => {
|
|
|
3666
3666
|
ctx.atKey = false;
|
|
3667
3667
|
if (utilMapIncludes.mapIncludes(ctx, map.items, keyNode))
|
|
3668
3668
|
onError(keyStart, "DUPLICATE_KEY", "Map keys must be unique");
|
|
3669
|
-
const valueProps = resolveProps.resolveProps(
|
|
3669
|
+
const valueProps = resolveProps.resolveProps(sep2 ?? [], {
|
|
3670
3670
|
indicator: "map-value-ind",
|
|
3671
3671
|
next: value,
|
|
3672
3672
|
offset: keyNode.range[2],
|
|
@@ -3682,7 +3682,7 @@ var require_resolve_block_map = __commonJS2((exports) => {
|
|
|
3682
3682
|
if (ctx.options.strict && keyProps.start < valueProps.found.offset - 1024)
|
|
3683
3683
|
onError(keyNode.range, "KEY_OVER_1024_CHARS", "The : indicator must be at most 1024 chars after the start of an implicit block mapping key");
|
|
3684
3684
|
}
|
|
3685
|
-
const valueNode = value ? composeNode(ctx, value, valueProps, onError) : composeEmptyNode(ctx, offset,
|
|
3685
|
+
const valueNode = value ? composeNode(ctx, value, valueProps, onError) : composeEmptyNode(ctx, offset, sep2, null, valueProps, onError);
|
|
3686
3686
|
if (ctx.schema.compat)
|
|
3687
3687
|
utilFlowIndentCheck.flowIndentCheck(bm.indent, value, onError);
|
|
3688
3688
|
offset = valueNode.range[2];
|
|
@@ -3764,7 +3764,7 @@ var require_resolve_end = __commonJS2((exports) => {
|
|
|
3764
3764
|
let comment = "";
|
|
3765
3765
|
if (end) {
|
|
3766
3766
|
let hasSpace = false;
|
|
3767
|
-
let
|
|
3767
|
+
let sep2 = "";
|
|
3768
3768
|
for (const token of end) {
|
|
3769
3769
|
const { source, type } = token;
|
|
3770
3770
|
switch (type) {
|
|
@@ -3778,13 +3778,13 @@ var require_resolve_end = __commonJS2((exports) => {
|
|
|
3778
3778
|
if (!comment)
|
|
3779
3779
|
comment = cb;
|
|
3780
3780
|
else
|
|
3781
|
-
comment +=
|
|
3782
|
-
|
|
3781
|
+
comment += sep2 + cb;
|
|
3782
|
+
sep2 = "";
|
|
3783
3783
|
break;
|
|
3784
3784
|
}
|
|
3785
3785
|
case "newline":
|
|
3786
3786
|
if (comment)
|
|
3787
|
-
|
|
3787
|
+
sep2 += source;
|
|
3788
3788
|
hasSpace = true;
|
|
3789
3789
|
break;
|
|
3790
3790
|
default:
|
|
@@ -3822,18 +3822,18 @@ var require_resolve_flow_collection = __commonJS2((exports) => {
|
|
|
3822
3822
|
let offset = fc.offset + fc.start.source.length;
|
|
3823
3823
|
for (let i = 0;i < fc.items.length; ++i) {
|
|
3824
3824
|
const collItem = fc.items[i];
|
|
3825
|
-
const { start, key, sep, value } = collItem;
|
|
3825
|
+
const { start, key, sep: sep2, value } = collItem;
|
|
3826
3826
|
const props = resolveProps.resolveProps(start, {
|
|
3827
3827
|
flow: fcName,
|
|
3828
3828
|
indicator: "explicit-key-ind",
|
|
3829
|
-
next: key ??
|
|
3829
|
+
next: key ?? sep2?.[0],
|
|
3830
3830
|
offset,
|
|
3831
3831
|
onError,
|
|
3832
3832
|
parentIndent: fc.indent,
|
|
3833
3833
|
startOnNewline: false
|
|
3834
3834
|
});
|
|
3835
3835
|
if (!props.found) {
|
|
3836
|
-
if (!props.anchor && !props.tag && !
|
|
3836
|
+
if (!props.anchor && !props.tag && !sep2 && !value) {
|
|
3837
3837
|
if (i === 0 && props.comma)
|
|
3838
3838
|
onError(props.comma, "UNEXPECTED_TOKEN", `Unexpected , in ${fcName}`);
|
|
3839
3839
|
else if (i < fc.items.length - 1)
|
|
@@ -3885,8 +3885,8 @@ var require_resolve_flow_collection = __commonJS2((exports) => {
|
|
|
3885
3885
|
}
|
|
3886
3886
|
}
|
|
3887
3887
|
}
|
|
3888
|
-
if (!isMap && !
|
|
3889
|
-
const valueNode = value ? composeNode(ctx, value, props, onError) : composeEmptyNode(ctx, props.end,
|
|
3888
|
+
if (!isMap && !sep2 && !props.found) {
|
|
3889
|
+
const valueNode = value ? composeNode(ctx, value, props, onError) : composeEmptyNode(ctx, props.end, sep2, null, props, onError);
|
|
3890
3890
|
coll.items.push(valueNode);
|
|
3891
3891
|
offset = valueNode.range[2];
|
|
3892
3892
|
if (isBlock(value))
|
|
@@ -3898,7 +3898,7 @@ var require_resolve_flow_collection = __commonJS2((exports) => {
|
|
|
3898
3898
|
if (isBlock(key))
|
|
3899
3899
|
onError(keyNode.range, "BLOCK_IN_FLOW", blockMsg);
|
|
3900
3900
|
ctx.atKey = false;
|
|
3901
|
-
const valueProps = resolveProps.resolveProps(
|
|
3901
|
+
const valueProps = resolveProps.resolveProps(sep2 ?? [], {
|
|
3902
3902
|
flow: fcName,
|
|
3903
3903
|
indicator: "map-value-ind",
|
|
3904
3904
|
next: value,
|
|
@@ -3909,8 +3909,8 @@ var require_resolve_flow_collection = __commonJS2((exports) => {
|
|
|
3909
3909
|
});
|
|
3910
3910
|
if (valueProps.found) {
|
|
3911
3911
|
if (!isMap && !props.found && ctx.options.strict) {
|
|
3912
|
-
if (
|
|
3913
|
-
for (const st of
|
|
3912
|
+
if (sep2)
|
|
3913
|
+
for (const st of sep2) {
|
|
3914
3914
|
if (st === valueProps.found)
|
|
3915
3915
|
break;
|
|
3916
3916
|
if (st.type === "newline") {
|
|
@@ -3927,7 +3927,7 @@ var require_resolve_flow_collection = __commonJS2((exports) => {
|
|
|
3927
3927
|
else
|
|
3928
3928
|
onError(valueProps.start, "MISSING_CHAR", `Missing , or : between ${fcName} items`);
|
|
3929
3929
|
}
|
|
3930
|
-
const valueNode = value ? composeNode(ctx, value, valueProps, onError) : valueProps.found ? composeEmptyNode(ctx, valueProps.end,
|
|
3930
|
+
const valueNode = value ? composeNode(ctx, value, valueProps, onError) : valueProps.found ? composeEmptyNode(ctx, valueProps.end, sep2, null, valueProps, onError) : null;
|
|
3931
3931
|
if (valueNode) {
|
|
3932
3932
|
if (isBlock(value))
|
|
3933
3933
|
onError(valueNode.range, "BLOCK_IN_FLOW", blockMsg);
|
|
@@ -4100,7 +4100,7 @@ var require_resolve_block_scalar = __commonJS2((exports) => {
|
|
|
4100
4100
|
chompStart = i + 1;
|
|
4101
4101
|
}
|
|
4102
4102
|
let value = "";
|
|
4103
|
-
let
|
|
4103
|
+
let sep2 = "";
|
|
4104
4104
|
let prevMoreIndented = false;
|
|
4105
4105
|
for (let i = 0;i < contentStart; ++i)
|
|
4106
4106
|
value += lines[i][0].slice(trimIndent) + `
|
|
@@ -4118,33 +4118,33 @@ var require_resolve_block_scalar = __commonJS2((exports) => {
|
|
|
4118
4118
|
indent = "";
|
|
4119
4119
|
}
|
|
4120
4120
|
if (type === Scalar.Scalar.BLOCK_LITERAL) {
|
|
4121
|
-
value +=
|
|
4122
|
-
|
|
4121
|
+
value += sep2 + indent.slice(trimIndent) + content;
|
|
4122
|
+
sep2 = `
|
|
4123
4123
|
`;
|
|
4124
4124
|
} else if (indent.length > trimIndent || content[0] === "\t") {
|
|
4125
|
-
if (
|
|
4126
|
-
|
|
4125
|
+
if (sep2 === " ")
|
|
4126
|
+
sep2 = `
|
|
4127
4127
|
`;
|
|
4128
|
-
else if (!prevMoreIndented &&
|
|
4128
|
+
else if (!prevMoreIndented && sep2 === `
|
|
4129
4129
|
`)
|
|
4130
|
-
|
|
4130
|
+
sep2 = `
|
|
4131
4131
|
|
|
4132
4132
|
`;
|
|
4133
|
-
value +=
|
|
4134
|
-
|
|
4133
|
+
value += sep2 + indent.slice(trimIndent) + content;
|
|
4134
|
+
sep2 = `
|
|
4135
4135
|
`;
|
|
4136
4136
|
prevMoreIndented = true;
|
|
4137
4137
|
} else if (content === "") {
|
|
4138
|
-
if (
|
|
4138
|
+
if (sep2 === `
|
|
4139
4139
|
`)
|
|
4140
4140
|
value += `
|
|
4141
4141
|
`;
|
|
4142
4142
|
else
|
|
4143
|
-
|
|
4143
|
+
sep2 = `
|
|
4144
4144
|
`;
|
|
4145
4145
|
} else {
|
|
4146
|
-
value +=
|
|
4147
|
-
|
|
4146
|
+
value += sep2 + content;
|
|
4147
|
+
sep2 = " ";
|
|
4148
4148
|
prevMoreIndented = false;
|
|
4149
4149
|
}
|
|
4150
4150
|
}
|
|
@@ -4323,27 +4323,27 @@ var require_resolve_flow_scalar = __commonJS2((exports) => {
|
|
|
4323
4323
|
if (!match)
|
|
4324
4324
|
return source;
|
|
4325
4325
|
let res = match[1];
|
|
4326
|
-
let
|
|
4326
|
+
let sep2 = " ";
|
|
4327
4327
|
let pos = first.lastIndex;
|
|
4328
4328
|
line.lastIndex = pos;
|
|
4329
4329
|
while (match = line.exec(source)) {
|
|
4330
4330
|
if (match[1] === "") {
|
|
4331
|
-
if (
|
|
4331
|
+
if (sep2 === `
|
|
4332
4332
|
`)
|
|
4333
|
-
res +=
|
|
4333
|
+
res += sep2;
|
|
4334
4334
|
else
|
|
4335
|
-
|
|
4335
|
+
sep2 = `
|
|
4336
4336
|
`;
|
|
4337
4337
|
} else {
|
|
4338
|
-
res +=
|
|
4339
|
-
|
|
4338
|
+
res += sep2 + match[1];
|
|
4339
|
+
sep2 = " ";
|
|
4340
4340
|
}
|
|
4341
4341
|
pos = line.lastIndex;
|
|
4342
4342
|
}
|
|
4343
4343
|
const last = /[ \t]*(.*)/sy;
|
|
4344
4344
|
last.lastIndex = pos;
|
|
4345
4345
|
match = last.exec(source);
|
|
4346
|
-
return res +
|
|
4346
|
+
return res + sep2 + (match?.[1] ?? "");
|
|
4347
4347
|
}
|
|
4348
4348
|
function doubleQuotedValue(source, onError) {
|
|
4349
4349
|
let res = "";
|
|
@@ -5110,14 +5110,14 @@ var require_cst_stringify = __commonJS2((exports) => {
|
|
|
5110
5110
|
}
|
|
5111
5111
|
}
|
|
5112
5112
|
}
|
|
5113
|
-
function stringifyItem({ start, key, sep, value }) {
|
|
5113
|
+
function stringifyItem({ start, key, sep: sep2, value }) {
|
|
5114
5114
|
let res = "";
|
|
5115
5115
|
for (const st of start)
|
|
5116
5116
|
res += st.source;
|
|
5117
5117
|
if (key)
|
|
5118
5118
|
res += stringifyToken(key);
|
|
5119
|
-
if (
|
|
5120
|
-
for (const st of
|
|
5119
|
+
if (sep2)
|
|
5120
|
+
for (const st of sep2)
|
|
5121
5121
|
res += st.source;
|
|
5122
5122
|
if (value)
|
|
5123
5123
|
res += stringifyToken(value);
|
|
@@ -6256,18 +6256,18 @@ var require_parser = __commonJS2((exports) => {
|
|
|
6256
6256
|
if (this.type === "map-value-ind") {
|
|
6257
6257
|
const prev = getPrevProps(this.peek(2));
|
|
6258
6258
|
const start = getFirstKeyStartProps(prev);
|
|
6259
|
-
let
|
|
6259
|
+
let sep2;
|
|
6260
6260
|
if (scalar.end) {
|
|
6261
|
-
|
|
6262
|
-
|
|
6261
|
+
sep2 = scalar.end;
|
|
6262
|
+
sep2.push(this.sourceToken);
|
|
6263
6263
|
delete scalar.end;
|
|
6264
6264
|
} else
|
|
6265
|
-
|
|
6265
|
+
sep2 = [this.sourceToken];
|
|
6266
6266
|
const map = {
|
|
6267
6267
|
type: "block-map",
|
|
6268
6268
|
offset: scalar.offset,
|
|
6269
6269
|
indent: scalar.indent,
|
|
6270
|
-
items: [{ start, key: scalar, sep }]
|
|
6270
|
+
items: [{ start, key: scalar, sep: sep2 }]
|
|
6271
6271
|
};
|
|
6272
6272
|
this.onKeyLine = true;
|
|
6273
6273
|
this.stack[this.stack.length - 1] = map;
|
|
@@ -6421,15 +6421,15 @@ var require_parser = __commonJS2((exports) => {
|
|
|
6421
6421
|
} else if (isFlowToken(it.key) && !includesToken(it.sep, "newline")) {
|
|
6422
6422
|
const start2 = getFirstKeyStartProps(it.start);
|
|
6423
6423
|
const key = it.key;
|
|
6424
|
-
const
|
|
6425
|
-
|
|
6424
|
+
const sep2 = it.sep;
|
|
6425
|
+
sep2.push(this.sourceToken);
|
|
6426
6426
|
delete it.key;
|
|
6427
6427
|
delete it.sep;
|
|
6428
6428
|
this.stack.push({
|
|
6429
6429
|
type: "block-map",
|
|
6430
6430
|
offset: this.offset,
|
|
6431
6431
|
indent: this.indent,
|
|
6432
|
-
items: [{ start: start2, key, sep }]
|
|
6432
|
+
items: [{ start: start2, key, sep: sep2 }]
|
|
6433
6433
|
});
|
|
6434
6434
|
} else if (start.length > 0) {
|
|
6435
6435
|
it.sep = it.sep.concat(start, this.sourceToken);
|
|
@@ -6623,13 +6623,13 @@ var require_parser = __commonJS2((exports) => {
|
|
|
6623
6623
|
const prev = getPrevProps(parent);
|
|
6624
6624
|
const start = getFirstKeyStartProps(prev);
|
|
6625
6625
|
fixFlowSeqItems(fc);
|
|
6626
|
-
const
|
|
6627
|
-
|
|
6626
|
+
const sep2 = fc.end.splice(1, fc.end.length);
|
|
6627
|
+
sep2.push(this.sourceToken);
|
|
6628
6628
|
const map = {
|
|
6629
6629
|
type: "block-map",
|
|
6630
6630
|
offset: fc.offset,
|
|
6631
6631
|
indent: fc.indent,
|
|
6632
|
-
items: [{ start, key: fc, sep }]
|
|
6632
|
+
items: [{ start, key: fc, sep: sep2 }]
|
|
6633
6633
|
};
|
|
6634
6634
|
this.onKeyLine = true;
|
|
6635
6635
|
this.stack[this.stack.length - 1] = map;
|
|
@@ -11496,6 +11496,16 @@ function resolvePackagedSignetCommand(bareCommand, scriptDirectory, scriptName,
|
|
|
11496
11496
|
function resolveSignetMcpCommand() {
|
|
11497
11497
|
return resolvePackagedSignetCommand("signet-mcp", "dist", "mcp-stdio.js", true);
|
|
11498
11498
|
}
|
|
11499
|
+
function isJsonObject(value) {
|
|
11500
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
11501
|
+
}
|
|
11502
|
+
function readTrimmedEnv2(name) {
|
|
11503
|
+
const value = process.env[name];
|
|
11504
|
+
if (typeof value !== "string")
|
|
11505
|
+
return;
|
|
11506
|
+
const trimmed = value.trim().replace(/[\r\n]+/g, "");
|
|
11507
|
+
return trimmed.length > 0 ? trimmed : undefined;
|
|
11508
|
+
}
|
|
11499
11509
|
|
|
11500
11510
|
// ../../../libs/connector-base/dist/lenient-json.js
|
|
11501
11511
|
var __create = Object.create;
|
|
@@ -17108,10 +17118,10 @@ var require_resolve_block_map2 = __commonJS3((exports) => {
|
|
|
17108
17118
|
let offset = bm.offset;
|
|
17109
17119
|
let commentEnd = null;
|
|
17110
17120
|
for (const collItem of bm.items) {
|
|
17111
|
-
const { start, key, sep, value } = collItem;
|
|
17121
|
+
const { start, key, sep: sep2, value } = collItem;
|
|
17112
17122
|
const keyProps = resolveProps.resolveProps(start, {
|
|
17113
17123
|
indicator: "explicit-key-ind",
|
|
17114
|
-
next: key ??
|
|
17124
|
+
next: key ?? sep2?.[0],
|
|
17115
17125
|
offset,
|
|
17116
17126
|
onError,
|
|
17117
17127
|
parentIndent: bm.indent,
|
|
@@ -17125,7 +17135,7 @@ var require_resolve_block_map2 = __commonJS3((exports) => {
|
|
|
17125
17135
|
else if ("indent" in key && key.indent !== bm.indent)
|
|
17126
17136
|
onError(offset, "BAD_INDENT", startColMsg);
|
|
17127
17137
|
}
|
|
17128
|
-
if (!keyProps.anchor && !keyProps.tag && !
|
|
17138
|
+
if (!keyProps.anchor && !keyProps.tag && !sep2) {
|
|
17129
17139
|
commentEnd = keyProps.end;
|
|
17130
17140
|
if (keyProps.comment) {
|
|
17131
17141
|
if (map.comment)
|
|
@@ -17150,7 +17160,7 @@ var require_resolve_block_map2 = __commonJS3((exports) => {
|
|
|
17150
17160
|
ctx.atKey = false;
|
|
17151
17161
|
if (utilMapIncludes.mapIncludes(ctx, map.items, keyNode))
|
|
17152
17162
|
onError(keyStart, "DUPLICATE_KEY", "Map keys must be unique");
|
|
17153
|
-
const valueProps = resolveProps.resolveProps(
|
|
17163
|
+
const valueProps = resolveProps.resolveProps(sep2 ?? [], {
|
|
17154
17164
|
indicator: "map-value-ind",
|
|
17155
17165
|
next: value,
|
|
17156
17166
|
offset: keyNode.range[2],
|
|
@@ -17166,7 +17176,7 @@ var require_resolve_block_map2 = __commonJS3((exports) => {
|
|
|
17166
17176
|
if (ctx.options.strict && keyProps.start < valueProps.found.offset - 1024)
|
|
17167
17177
|
onError(keyNode.range, "KEY_OVER_1024_CHARS", "The : indicator must be at most 1024 chars after the start of an implicit block mapping key");
|
|
17168
17178
|
}
|
|
17169
|
-
const valueNode = value ? composeNode(ctx, value, valueProps, onError) : composeEmptyNode(ctx, offset,
|
|
17179
|
+
const valueNode = value ? composeNode(ctx, value, valueProps, onError) : composeEmptyNode(ctx, offset, sep2, null, valueProps, onError);
|
|
17170
17180
|
if (ctx.schema.compat)
|
|
17171
17181
|
utilFlowIndentCheck.flowIndentCheck(bm.indent, value, onError);
|
|
17172
17182
|
offset = valueNode.range[2];
|
|
@@ -17248,7 +17258,7 @@ var require_resolve_end2 = __commonJS3((exports) => {
|
|
|
17248
17258
|
let comment = "";
|
|
17249
17259
|
if (end) {
|
|
17250
17260
|
let hasSpace = false;
|
|
17251
|
-
let
|
|
17261
|
+
let sep2 = "";
|
|
17252
17262
|
for (const token of end) {
|
|
17253
17263
|
const { source, type } = token;
|
|
17254
17264
|
switch (type) {
|
|
@@ -17262,13 +17272,13 @@ var require_resolve_end2 = __commonJS3((exports) => {
|
|
|
17262
17272
|
if (!comment)
|
|
17263
17273
|
comment = cb;
|
|
17264
17274
|
else
|
|
17265
|
-
comment +=
|
|
17266
|
-
|
|
17275
|
+
comment += sep2 + cb;
|
|
17276
|
+
sep2 = "";
|
|
17267
17277
|
break;
|
|
17268
17278
|
}
|
|
17269
17279
|
case "newline":
|
|
17270
17280
|
if (comment)
|
|
17271
|
-
|
|
17281
|
+
sep2 += source;
|
|
17272
17282
|
hasSpace = true;
|
|
17273
17283
|
break;
|
|
17274
17284
|
default:
|
|
@@ -17306,18 +17316,18 @@ var require_resolve_flow_collection2 = __commonJS3((exports) => {
|
|
|
17306
17316
|
let offset = fc.offset + fc.start.source.length;
|
|
17307
17317
|
for (let i = 0;i < fc.items.length; ++i) {
|
|
17308
17318
|
const collItem = fc.items[i];
|
|
17309
|
-
const { start, key, sep, value } = collItem;
|
|
17319
|
+
const { start, key, sep: sep2, value } = collItem;
|
|
17310
17320
|
const props = resolveProps.resolveProps(start, {
|
|
17311
17321
|
flow: fcName,
|
|
17312
17322
|
indicator: "explicit-key-ind",
|
|
17313
|
-
next: key ??
|
|
17323
|
+
next: key ?? sep2?.[0],
|
|
17314
17324
|
offset,
|
|
17315
17325
|
onError,
|
|
17316
17326
|
parentIndent: fc.indent,
|
|
17317
17327
|
startOnNewline: false
|
|
17318
17328
|
});
|
|
17319
17329
|
if (!props.found) {
|
|
17320
|
-
if (!props.anchor && !props.tag && !
|
|
17330
|
+
if (!props.anchor && !props.tag && !sep2 && !value) {
|
|
17321
17331
|
if (i === 0 && props.comma)
|
|
17322
17332
|
onError(props.comma, "UNEXPECTED_TOKEN", `Unexpected , in ${fcName}`);
|
|
17323
17333
|
else if (i < fc.items.length - 1)
|
|
@@ -17369,8 +17379,8 @@ var require_resolve_flow_collection2 = __commonJS3((exports) => {
|
|
|
17369
17379
|
}
|
|
17370
17380
|
}
|
|
17371
17381
|
}
|
|
17372
|
-
if (!isMap && !
|
|
17373
|
-
const valueNode = value ? composeNode(ctx, value, props, onError) : composeEmptyNode(ctx, props.end,
|
|
17382
|
+
if (!isMap && !sep2 && !props.found) {
|
|
17383
|
+
const valueNode = value ? composeNode(ctx, value, props, onError) : composeEmptyNode(ctx, props.end, sep2, null, props, onError);
|
|
17374
17384
|
coll.items.push(valueNode);
|
|
17375
17385
|
offset = valueNode.range[2];
|
|
17376
17386
|
if (isBlock(value))
|
|
@@ -17382,7 +17392,7 @@ var require_resolve_flow_collection2 = __commonJS3((exports) => {
|
|
|
17382
17392
|
if (isBlock(key))
|
|
17383
17393
|
onError(keyNode.range, "BLOCK_IN_FLOW", blockMsg);
|
|
17384
17394
|
ctx.atKey = false;
|
|
17385
|
-
const valueProps = resolveProps.resolveProps(
|
|
17395
|
+
const valueProps = resolveProps.resolveProps(sep2 ?? [], {
|
|
17386
17396
|
flow: fcName,
|
|
17387
17397
|
indicator: "map-value-ind",
|
|
17388
17398
|
next: value,
|
|
@@ -17393,8 +17403,8 @@ var require_resolve_flow_collection2 = __commonJS3((exports) => {
|
|
|
17393
17403
|
});
|
|
17394
17404
|
if (valueProps.found) {
|
|
17395
17405
|
if (!isMap && !props.found && ctx.options.strict) {
|
|
17396
|
-
if (
|
|
17397
|
-
for (const st of
|
|
17406
|
+
if (sep2)
|
|
17407
|
+
for (const st of sep2) {
|
|
17398
17408
|
if (st === valueProps.found)
|
|
17399
17409
|
break;
|
|
17400
17410
|
if (st.type === "newline") {
|
|
@@ -17411,7 +17421,7 @@ var require_resolve_flow_collection2 = __commonJS3((exports) => {
|
|
|
17411
17421
|
else
|
|
17412
17422
|
onError(valueProps.start, "MISSING_CHAR", `Missing , or : between ${fcName} items`);
|
|
17413
17423
|
}
|
|
17414
|
-
const valueNode = value ? composeNode(ctx, value, valueProps, onError) : valueProps.found ? composeEmptyNode(ctx, valueProps.end,
|
|
17424
|
+
const valueNode = value ? composeNode(ctx, value, valueProps, onError) : valueProps.found ? composeEmptyNode(ctx, valueProps.end, sep2, null, valueProps, onError) : null;
|
|
17415
17425
|
if (valueNode) {
|
|
17416
17426
|
if (isBlock(value))
|
|
17417
17427
|
onError(valueNode.range, "BLOCK_IN_FLOW", blockMsg);
|
|
@@ -17584,7 +17594,7 @@ var require_resolve_block_scalar2 = __commonJS3((exports) => {
|
|
|
17584
17594
|
chompStart = i + 1;
|
|
17585
17595
|
}
|
|
17586
17596
|
let value = "";
|
|
17587
|
-
let
|
|
17597
|
+
let sep2 = "";
|
|
17588
17598
|
let prevMoreIndented = false;
|
|
17589
17599
|
for (let i = 0;i < contentStart; ++i)
|
|
17590
17600
|
value += lines[i][0].slice(trimIndent) + `
|
|
@@ -17602,33 +17612,33 @@ var require_resolve_block_scalar2 = __commonJS3((exports) => {
|
|
|
17602
17612
|
indent = "";
|
|
17603
17613
|
}
|
|
17604
17614
|
if (type === Scalar.Scalar.BLOCK_LITERAL) {
|
|
17605
|
-
value +=
|
|
17606
|
-
|
|
17615
|
+
value += sep2 + indent.slice(trimIndent) + content;
|
|
17616
|
+
sep2 = `
|
|
17607
17617
|
`;
|
|
17608
17618
|
} else if (indent.length > trimIndent || content[0] === "\t") {
|
|
17609
|
-
if (
|
|
17610
|
-
|
|
17619
|
+
if (sep2 === " ")
|
|
17620
|
+
sep2 = `
|
|
17611
17621
|
`;
|
|
17612
|
-
else if (!prevMoreIndented &&
|
|
17622
|
+
else if (!prevMoreIndented && sep2 === `
|
|
17613
17623
|
`)
|
|
17614
|
-
|
|
17624
|
+
sep2 = `
|
|
17615
17625
|
|
|
17616
17626
|
`;
|
|
17617
|
-
value +=
|
|
17618
|
-
|
|
17627
|
+
value += sep2 + indent.slice(trimIndent) + content;
|
|
17628
|
+
sep2 = `
|
|
17619
17629
|
`;
|
|
17620
17630
|
prevMoreIndented = true;
|
|
17621
17631
|
} else if (content === "") {
|
|
17622
|
-
if (
|
|
17632
|
+
if (sep2 === `
|
|
17623
17633
|
`)
|
|
17624
17634
|
value += `
|
|
17625
17635
|
`;
|
|
17626
17636
|
else
|
|
17627
|
-
|
|
17637
|
+
sep2 = `
|
|
17628
17638
|
`;
|
|
17629
17639
|
} else {
|
|
17630
|
-
value +=
|
|
17631
|
-
|
|
17640
|
+
value += sep2 + content;
|
|
17641
|
+
sep2 = " ";
|
|
17632
17642
|
prevMoreIndented = false;
|
|
17633
17643
|
}
|
|
17634
17644
|
}
|
|
@@ -17807,27 +17817,27 @@ var require_resolve_flow_scalar2 = __commonJS3((exports) => {
|
|
|
17807
17817
|
if (!match)
|
|
17808
17818
|
return source;
|
|
17809
17819
|
let res = match[1];
|
|
17810
|
-
let
|
|
17820
|
+
let sep2 = " ";
|
|
17811
17821
|
let pos = first.lastIndex;
|
|
17812
17822
|
line.lastIndex = pos;
|
|
17813
17823
|
while (match = line.exec(source)) {
|
|
17814
17824
|
if (match[1] === "") {
|
|
17815
|
-
if (
|
|
17825
|
+
if (sep2 === `
|
|
17816
17826
|
`)
|
|
17817
|
-
res +=
|
|
17827
|
+
res += sep2;
|
|
17818
17828
|
else
|
|
17819
|
-
|
|
17829
|
+
sep2 = `
|
|
17820
17830
|
`;
|
|
17821
17831
|
} else {
|
|
17822
|
-
res +=
|
|
17823
|
-
|
|
17832
|
+
res += sep2 + match[1];
|
|
17833
|
+
sep2 = " ";
|
|
17824
17834
|
}
|
|
17825
17835
|
pos = line.lastIndex;
|
|
17826
17836
|
}
|
|
17827
17837
|
const last = /[ \t]*(.*)/sy;
|
|
17828
17838
|
last.lastIndex = pos;
|
|
17829
17839
|
match = last.exec(source);
|
|
17830
|
-
return res +
|
|
17840
|
+
return res + sep2 + (match?.[1] ?? "");
|
|
17831
17841
|
}
|
|
17832
17842
|
function doubleQuotedValue(source, onError) {
|
|
17833
17843
|
let res = "";
|
|
@@ -18594,14 +18604,14 @@ var require_cst_stringify2 = __commonJS3((exports) => {
|
|
|
18594
18604
|
}
|
|
18595
18605
|
}
|
|
18596
18606
|
}
|
|
18597
|
-
function stringifyItem({ start, key, sep, value }) {
|
|
18607
|
+
function stringifyItem({ start, key, sep: sep2, value }) {
|
|
18598
18608
|
let res = "";
|
|
18599
18609
|
for (const st of start)
|
|
18600
18610
|
res += st.source;
|
|
18601
18611
|
if (key)
|
|
18602
18612
|
res += stringifyToken(key);
|
|
18603
|
-
if (
|
|
18604
|
-
for (const st of
|
|
18613
|
+
if (sep2)
|
|
18614
|
+
for (const st of sep2)
|
|
18605
18615
|
res += st.source;
|
|
18606
18616
|
if (value)
|
|
18607
18617
|
res += stringifyToken(value);
|
|
@@ -19740,18 +19750,18 @@ var require_parser2 = __commonJS3((exports) => {
|
|
|
19740
19750
|
if (this.type === "map-value-ind") {
|
|
19741
19751
|
const prev = getPrevProps(this.peek(2));
|
|
19742
19752
|
const start = getFirstKeyStartProps(prev);
|
|
19743
|
-
let
|
|
19753
|
+
let sep2;
|
|
19744
19754
|
if (scalar.end) {
|
|
19745
|
-
|
|
19746
|
-
|
|
19755
|
+
sep2 = scalar.end;
|
|
19756
|
+
sep2.push(this.sourceToken);
|
|
19747
19757
|
delete scalar.end;
|
|
19748
19758
|
} else
|
|
19749
|
-
|
|
19759
|
+
sep2 = [this.sourceToken];
|
|
19750
19760
|
const map = {
|
|
19751
19761
|
type: "block-map",
|
|
19752
19762
|
offset: scalar.offset,
|
|
19753
19763
|
indent: scalar.indent,
|
|
19754
|
-
items: [{ start, key: scalar, sep }]
|
|
19764
|
+
items: [{ start, key: scalar, sep: sep2 }]
|
|
19755
19765
|
};
|
|
19756
19766
|
this.onKeyLine = true;
|
|
19757
19767
|
this.stack[this.stack.length - 1] = map;
|
|
@@ -19905,15 +19915,15 @@ var require_parser2 = __commonJS3((exports) => {
|
|
|
19905
19915
|
} else if (isFlowToken(it.key) && !includesToken(it.sep, "newline")) {
|
|
19906
19916
|
const start2 = getFirstKeyStartProps(it.start);
|
|
19907
19917
|
const key = it.key;
|
|
19908
|
-
const
|
|
19909
|
-
|
|
19918
|
+
const sep2 = it.sep;
|
|
19919
|
+
sep2.push(this.sourceToken);
|
|
19910
19920
|
delete it.key;
|
|
19911
19921
|
delete it.sep;
|
|
19912
19922
|
this.stack.push({
|
|
19913
19923
|
type: "block-map",
|
|
19914
19924
|
offset: this.offset,
|
|
19915
19925
|
indent: this.indent,
|
|
19916
|
-
items: [{ start: start2, key, sep }]
|
|
19926
|
+
items: [{ start: start2, key, sep: sep2 }]
|
|
19917
19927
|
});
|
|
19918
19928
|
} else if (start.length > 0) {
|
|
19919
19929
|
it.sep = it.sep.concat(start, this.sourceToken);
|
|
@@ -20107,13 +20117,13 @@ var require_parser2 = __commonJS3((exports) => {
|
|
|
20107
20117
|
const prev = getPrevProps(parent);
|
|
20108
20118
|
const start = getFirstKeyStartProps(prev);
|
|
20109
20119
|
fixFlowSeqItems(fc);
|
|
20110
|
-
const
|
|
20111
|
-
|
|
20120
|
+
const sep2 = fc.end.splice(1, fc.end.length);
|
|
20121
|
+
sep2.push(this.sourceToken);
|
|
20112
20122
|
const map = {
|
|
20113
20123
|
type: "block-map",
|
|
20114
20124
|
offset: fc.offset,
|
|
20115
20125
|
indent: fc.indent,
|
|
20116
|
-
items: [{ start, key: fc, sep }]
|
|
20126
|
+
items: [{ start, key: fc, sep: sep2 }]
|
|
20117
20127
|
};
|
|
20118
20128
|
this.onKeyLine = true;
|
|
20119
20129
|
this.stack[this.stack.length - 1] = map;
|
|
@@ -25667,11 +25677,11 @@ function parseTree(text, errors = [], options = ParseOptions2.DEFAULT) {
|
|
|
25667
25677
|
onValue({ type: getNodeType(value), offset, length, parent: currentParent, value });
|
|
25668
25678
|
ensurePropertyComplete(offset + length);
|
|
25669
25679
|
},
|
|
25670
|
-
onSeparator: (
|
|
25680
|
+
onSeparator: (sep2, offset, length) => {
|
|
25671
25681
|
if (currentParent.type === "property") {
|
|
25672
|
-
if (
|
|
25682
|
+
if (sep2 === ":") {
|
|
25673
25683
|
currentParent.colonOffset = offset;
|
|
25674
|
-
} else if (
|
|
25684
|
+
} else if (sep2 === ",") {
|
|
25675
25685
|
ensurePropertyComplete(offset);
|
|
25676
25686
|
}
|
|
25677
25687
|
}
|
|
@@ -28718,18 +28728,11 @@ Set the \\\`cycles\\\` parameter to \\\`"ref"\\\` to resolve cyclical schemas wi
|
|
|
28718
28728
|
|
|
28719
28729
|
// src/index.ts
|
|
28720
28730
|
var API_KEY_FILE_NAME = ".signet-api-key";
|
|
28721
|
-
function isJsonObject(value) {
|
|
28722
|
-
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
28723
|
-
}
|
|
28724
|
-
function readTrimmedEnv(name) {
|
|
28725
|
-
const value = process.env[name];
|
|
28726
|
-
return typeof value === "string" && value.trim().length > 0 ? value.trim().replace(/[\r\n]+/g, "") : undefined;
|
|
28727
|
-
}
|
|
28728
28731
|
function signetRuntimeEnv() {
|
|
28729
28732
|
const env = {};
|
|
28730
28733
|
const daemonUrl = configuredDaemonUrl();
|
|
28731
|
-
const apiKey =
|
|
28732
|
-
const agentId =
|
|
28734
|
+
const apiKey = readTrimmedEnv2("SIGNET_API_KEY") ?? readTrimmedEnv2("SIGNET_TOKEN");
|
|
28735
|
+
const agentId = readTrimmedEnv2("SIGNET_AGENT_ID");
|
|
28733
28736
|
if (daemonUrl)
|
|
28734
28737
|
env.SIGNET_DAEMON_URL = daemonUrl;
|
|
28735
28738
|
if (apiKey)
|
|
@@ -28775,7 +28778,7 @@ function writeConfigValue(configPath, path, value) {
|
|
|
28775
28778
|
atomicWriteText(configPath, hasBom ? `\uFEFF${updated}` : updated);
|
|
28776
28779
|
}
|
|
28777
28780
|
function configuredDaemonUrl() {
|
|
28778
|
-
const daemonUrl =
|
|
28781
|
+
const daemonUrl = readTrimmedEnv2("SIGNET_DAEMON_URL");
|
|
28779
28782
|
if (!daemonUrl)
|
|
28780
28783
|
return;
|
|
28781
28784
|
return resolveSignetDaemonUrl({ env: { SIGNET_DAEMON_URL: daemonUrl } });
|
|
@@ -28806,7 +28809,7 @@ class OpenCodeConnector extends BaseConnector {
|
|
|
28806
28809
|
return join4(this.getPluginsPath(opencodePath), API_KEY_FILE_NAME);
|
|
28807
28810
|
}
|
|
28808
28811
|
getPluginConfigEntry(opencodePath) {
|
|
28809
|
-
return `./${
|
|
28812
|
+
return `./${relative2(opencodePath, this.getPluginFilePath(opencodePath)).replaceAll("\\", "/")}`;
|
|
28810
28813
|
}
|
|
28811
28814
|
async install(basePath) {
|
|
28812
28815
|
const filesWritten = [];
|
|
@@ -28837,7 +28840,7 @@ class OpenCodeConnector extends BaseConnector {
|
|
|
28837
28840
|
mkdirSync(pluginsPath, { recursive: true });
|
|
28838
28841
|
}
|
|
28839
28842
|
this.migrateFromLegacy(opencodePath);
|
|
28840
|
-
const apiKey =
|
|
28843
|
+
const apiKey = readTrimmedEnv2("SIGNET_API_KEY") ?? readTrimmedEnv2("SIGNET_TOKEN");
|
|
28841
28844
|
const apiKeyFilePath = this.getApiKeyFilePath(opencodePath);
|
|
28842
28845
|
if (apiKey) {
|
|
28843
28846
|
atomicWriteText(apiKeyFilePath, `${apiKey}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@signetai/connector-opencode",
|
|
3
|
-
"version": "0.163.
|
|
3
|
+
"version": "0.163.18",
|
|
4
4
|
"description": "Signet connector for OpenCode - installs hooks and generates config",
|
|
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.163.
|
|
29
|
-
"@signetai/core": "0.163.
|
|
28
|
+
"@signetai/connector-base": "0.163.18",
|
|
29
|
+
"@signetai/core": "0.163.18",
|
|
30
30
|
"jsonc-parser": "3.3.1"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|