@integrity-labs/agt-cli 0.28.1088 → 0.28.1089
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/bin/agt.js +3 -3
- package/dist/{chunk-JAXSZCTH.js → chunk-OBSRWYMM.js} +2 -2
- package/dist/lib/manager-worker.js +2 -2
- package/dist/mcp/direct-chat-channel.js +173 -132
- package/dist/mcp/index.js +172 -40
- package/dist/mcp/slack-channel.js +344 -261
- package/dist/mcp/teams-channel.js +210 -86
- package/dist/mcp/telegram-channel.js +287 -206
- package/dist/mcp/whatsapp-channel.js +194 -69
- package/package.json +1 -1
- /package/dist/{chunk-JAXSZCTH.js.map → chunk-OBSRWYMM.js.map} +0 -0
|
@@ -3599,49 +3599,49 @@ var require_fast_uri = __commonJS({
|
|
|
3599
3599
|
schemelessOptions.skipEscape = true;
|
|
3600
3600
|
return serialize(resolved, schemelessOptions);
|
|
3601
3601
|
}
|
|
3602
|
-
function resolveComponent(base,
|
|
3602
|
+
function resolveComponent(base, relative2, options, skipNormalization) {
|
|
3603
3603
|
const target = {};
|
|
3604
3604
|
if (!skipNormalization) {
|
|
3605
3605
|
base = parse3(serialize(base, options), options);
|
|
3606
|
-
|
|
3606
|
+
relative2 = parse3(serialize(relative2, options), options);
|
|
3607
3607
|
}
|
|
3608
3608
|
options = options || {};
|
|
3609
|
-
if (!options.tolerant &&
|
|
3610
|
-
target.scheme =
|
|
3611
|
-
target.userinfo =
|
|
3612
|
-
target.host =
|
|
3613
|
-
target.port =
|
|
3614
|
-
target.path = removeDotSegments(
|
|
3615
|
-
target.query =
|
|
3609
|
+
if (!options.tolerant && relative2.scheme) {
|
|
3610
|
+
target.scheme = relative2.scheme;
|
|
3611
|
+
target.userinfo = relative2.userinfo;
|
|
3612
|
+
target.host = relative2.host;
|
|
3613
|
+
target.port = relative2.port;
|
|
3614
|
+
target.path = removeDotSegments(relative2.path || "");
|
|
3615
|
+
target.query = relative2.query;
|
|
3616
3616
|
} else {
|
|
3617
|
-
if (
|
|
3618
|
-
target.userinfo =
|
|
3619
|
-
target.host =
|
|
3620
|
-
target.port =
|
|
3621
|
-
target.path = removeDotSegments(
|
|
3622
|
-
target.query =
|
|
3617
|
+
if (relative2.userinfo !== void 0 || relative2.host !== void 0 || relative2.port !== void 0) {
|
|
3618
|
+
target.userinfo = relative2.userinfo;
|
|
3619
|
+
target.host = relative2.host;
|
|
3620
|
+
target.port = relative2.port;
|
|
3621
|
+
target.path = removeDotSegments(relative2.path || "");
|
|
3622
|
+
target.query = relative2.query;
|
|
3623
3623
|
} else {
|
|
3624
|
-
if (!
|
|
3624
|
+
if (!relative2.path) {
|
|
3625
3625
|
target.path = base.path;
|
|
3626
|
-
if (
|
|
3627
|
-
target.query =
|
|
3626
|
+
if (relative2.query !== void 0) {
|
|
3627
|
+
target.query = relative2.query;
|
|
3628
3628
|
} else {
|
|
3629
3629
|
target.query = base.query;
|
|
3630
3630
|
}
|
|
3631
3631
|
} else {
|
|
3632
|
-
if (
|
|
3633
|
-
target.path = removeDotSegments(
|
|
3632
|
+
if (relative2.path[0] === "/") {
|
|
3633
|
+
target.path = removeDotSegments(relative2.path);
|
|
3634
3634
|
} else {
|
|
3635
3635
|
if ((base.userinfo !== void 0 || base.host !== void 0 || base.port !== void 0) && !base.path) {
|
|
3636
|
-
target.path = "/" +
|
|
3636
|
+
target.path = "/" + relative2.path;
|
|
3637
3637
|
} else if (!base.path) {
|
|
3638
|
-
target.path =
|
|
3638
|
+
target.path = relative2.path;
|
|
3639
3639
|
} else {
|
|
3640
|
-
target.path = base.path.slice(0, base.path.lastIndexOf("/") + 1) +
|
|
3640
|
+
target.path = base.path.slice(0, base.path.lastIndexOf("/") + 1) + relative2.path;
|
|
3641
3641
|
}
|
|
3642
3642
|
target.path = removeDotSegments(target.path);
|
|
3643
3643
|
}
|
|
3644
|
-
target.query =
|
|
3644
|
+
target.query = relative2.query;
|
|
3645
3645
|
}
|
|
3646
3646
|
target.userinfo = base.userinfo;
|
|
3647
3647
|
target.host = base.host;
|
|
@@ -3649,7 +3649,7 @@ var require_fast_uri = __commonJS({
|
|
|
3649
3649
|
}
|
|
3650
3650
|
target.scheme = base.scheme;
|
|
3651
3651
|
}
|
|
3652
|
-
target.fragment =
|
|
3652
|
+
target.fragment = relative2.fragment;
|
|
3653
3653
|
return target;
|
|
3654
3654
|
}
|
|
3655
3655
|
function equal(uriA, uriB, options) {
|
|
@@ -11656,10 +11656,10 @@ var require_resolve_block_map = __commonJS({
|
|
|
11656
11656
|
let offset = bm.offset;
|
|
11657
11657
|
let commentEnd = null;
|
|
11658
11658
|
for (const collItem of bm.items) {
|
|
11659
|
-
const { start, key: key2, sep:
|
|
11659
|
+
const { start, key: key2, sep: sep3, value } = collItem;
|
|
11660
11660
|
const keyProps = resolveProps.resolveProps(start, {
|
|
11661
11661
|
indicator: "explicit-key-ind",
|
|
11662
|
-
next: key2 ??
|
|
11662
|
+
next: key2 ?? sep3?.[0],
|
|
11663
11663
|
offset,
|
|
11664
11664
|
onError,
|
|
11665
11665
|
parentIndent: bm.indent,
|
|
@@ -11673,7 +11673,7 @@ var require_resolve_block_map = __commonJS({
|
|
|
11673
11673
|
else if ("indent" in key2 && key2.indent !== bm.indent)
|
|
11674
11674
|
onError(offset, "BAD_INDENT", startColMsg);
|
|
11675
11675
|
}
|
|
11676
|
-
if (!keyProps.anchor && !keyProps.tag && !
|
|
11676
|
+
if (!keyProps.anchor && !keyProps.tag && !sep3) {
|
|
11677
11677
|
commentEnd = keyProps.end;
|
|
11678
11678
|
if (keyProps.comment) {
|
|
11679
11679
|
if (map.comment)
|
|
@@ -11697,7 +11697,7 @@ var require_resolve_block_map = __commonJS({
|
|
|
11697
11697
|
ctx.atKey = false;
|
|
11698
11698
|
if (utilMapIncludes.mapIncludes(ctx, map.items, keyNode))
|
|
11699
11699
|
onError(keyStart, "DUPLICATE_KEY", "Map keys must be unique");
|
|
11700
|
-
const valueProps = resolveProps.resolveProps(
|
|
11700
|
+
const valueProps = resolveProps.resolveProps(sep3 ?? [], {
|
|
11701
11701
|
indicator: "map-value-ind",
|
|
11702
11702
|
next: value,
|
|
11703
11703
|
offset: keyNode.range[2],
|
|
@@ -11713,7 +11713,7 @@ var require_resolve_block_map = __commonJS({
|
|
|
11713
11713
|
if (ctx.options.strict && keyProps.start < valueProps.found.offset - 1024)
|
|
11714
11714
|
onError(keyNode.range, "KEY_OVER_1024_CHARS", "The : indicator must be at most 1024 chars after the start of an implicit block mapping key");
|
|
11715
11715
|
}
|
|
11716
|
-
const valueNode = value ? composeNode(ctx, value, valueProps, onError) : composeEmptyNode(ctx, offset,
|
|
11716
|
+
const valueNode = value ? composeNode(ctx, value, valueProps, onError) : composeEmptyNode(ctx, offset, sep3, null, valueProps, onError);
|
|
11717
11717
|
if (ctx.schema.compat)
|
|
11718
11718
|
utilFlowIndentCheck.flowIndentCheck(bm.indent, value, onError);
|
|
11719
11719
|
offset = valueNode.range[2];
|
|
@@ -11804,7 +11804,7 @@ var require_resolve_end = __commonJS({
|
|
|
11804
11804
|
let comment = "";
|
|
11805
11805
|
if (end) {
|
|
11806
11806
|
let hasSpace = false;
|
|
11807
|
-
let
|
|
11807
|
+
let sep3 = "";
|
|
11808
11808
|
for (const token of end) {
|
|
11809
11809
|
const { source, type } = token;
|
|
11810
11810
|
switch (type) {
|
|
@@ -11818,13 +11818,13 @@ var require_resolve_end = __commonJS({
|
|
|
11818
11818
|
if (!comment)
|
|
11819
11819
|
comment = cb;
|
|
11820
11820
|
else
|
|
11821
|
-
comment +=
|
|
11822
|
-
|
|
11821
|
+
comment += sep3 + cb;
|
|
11822
|
+
sep3 = "";
|
|
11823
11823
|
break;
|
|
11824
11824
|
}
|
|
11825
11825
|
case "newline":
|
|
11826
11826
|
if (comment)
|
|
11827
|
-
|
|
11827
|
+
sep3 += source;
|
|
11828
11828
|
hasSpace = true;
|
|
11829
11829
|
break;
|
|
11830
11830
|
default:
|
|
@@ -11867,18 +11867,18 @@ var require_resolve_flow_collection = __commonJS({
|
|
|
11867
11867
|
let offset = fc.offset + fc.start.source.length;
|
|
11868
11868
|
for (let i = 0; i < fc.items.length; ++i) {
|
|
11869
11869
|
const collItem = fc.items[i];
|
|
11870
|
-
const { start, key: key2, sep:
|
|
11870
|
+
const { start, key: key2, sep: sep3, value } = collItem;
|
|
11871
11871
|
const props = resolveProps.resolveProps(start, {
|
|
11872
11872
|
flow: fcName,
|
|
11873
11873
|
indicator: "explicit-key-ind",
|
|
11874
|
-
next: key2 ??
|
|
11874
|
+
next: key2 ?? sep3?.[0],
|
|
11875
11875
|
offset,
|
|
11876
11876
|
onError,
|
|
11877
11877
|
parentIndent: fc.indent,
|
|
11878
11878
|
startOnNewline: false
|
|
11879
11879
|
});
|
|
11880
11880
|
if (!props.found) {
|
|
11881
|
-
if (!props.anchor && !props.tag && !
|
|
11881
|
+
if (!props.anchor && !props.tag && !sep3 && !value) {
|
|
11882
11882
|
if (i === 0 && props.comma)
|
|
11883
11883
|
onError(props.comma, "UNEXPECTED_TOKEN", `Unexpected , in ${fcName}`);
|
|
11884
11884
|
else if (i < fc.items.length - 1)
|
|
@@ -11932,8 +11932,8 @@ var require_resolve_flow_collection = __commonJS({
|
|
|
11932
11932
|
}
|
|
11933
11933
|
}
|
|
11934
11934
|
}
|
|
11935
|
-
if (!isMap && !
|
|
11936
|
-
const valueNode = value ? composeNode(ctx, value, props, onError) : composeEmptyNode(ctx, props.end,
|
|
11935
|
+
if (!isMap && !sep3 && !props.found) {
|
|
11936
|
+
const valueNode = value ? composeNode(ctx, value, props, onError) : composeEmptyNode(ctx, props.end, sep3, null, props, onError);
|
|
11937
11937
|
coll.items.push(valueNode);
|
|
11938
11938
|
offset = valueNode.range[2];
|
|
11939
11939
|
if (isBlock(value))
|
|
@@ -11945,7 +11945,7 @@ var require_resolve_flow_collection = __commonJS({
|
|
|
11945
11945
|
if (isBlock(key2))
|
|
11946
11946
|
onError(keyNode.range, "BLOCK_IN_FLOW", blockMsg);
|
|
11947
11947
|
ctx.atKey = false;
|
|
11948
|
-
const valueProps = resolveProps.resolveProps(
|
|
11948
|
+
const valueProps = resolveProps.resolveProps(sep3 ?? [], {
|
|
11949
11949
|
flow: fcName,
|
|
11950
11950
|
indicator: "map-value-ind",
|
|
11951
11951
|
next: value,
|
|
@@ -11956,8 +11956,8 @@ var require_resolve_flow_collection = __commonJS({
|
|
|
11956
11956
|
});
|
|
11957
11957
|
if (valueProps.found) {
|
|
11958
11958
|
if (!isMap && !props.found && ctx.options.strict) {
|
|
11959
|
-
if (
|
|
11960
|
-
for (const st of
|
|
11959
|
+
if (sep3)
|
|
11960
|
+
for (const st of sep3) {
|
|
11961
11961
|
if (st === valueProps.found)
|
|
11962
11962
|
break;
|
|
11963
11963
|
if (st.type === "newline") {
|
|
@@ -11974,7 +11974,7 @@ var require_resolve_flow_collection = __commonJS({
|
|
|
11974
11974
|
else
|
|
11975
11975
|
onError(valueProps.start, "MISSING_CHAR", `Missing , or : between ${fcName} items`);
|
|
11976
11976
|
}
|
|
11977
|
-
const valueNode = value ? composeNode(ctx, value, valueProps, onError) : valueProps.found ? composeEmptyNode(ctx, valueProps.end,
|
|
11977
|
+
const valueNode = value ? composeNode(ctx, value, valueProps, onError) : valueProps.found ? composeEmptyNode(ctx, valueProps.end, sep3, null, valueProps, onError) : null;
|
|
11978
11978
|
if (valueNode) {
|
|
11979
11979
|
if (isBlock(value))
|
|
11980
11980
|
onError(valueNode.range, "BLOCK_IN_FLOW", blockMsg);
|
|
@@ -12154,7 +12154,7 @@ var require_resolve_block_scalar = __commonJS({
|
|
|
12154
12154
|
chompStart = i + 1;
|
|
12155
12155
|
}
|
|
12156
12156
|
let value = "";
|
|
12157
|
-
let
|
|
12157
|
+
let sep3 = "";
|
|
12158
12158
|
let prevMoreIndented = false;
|
|
12159
12159
|
for (let i = 0; i < contentStart; ++i)
|
|
12160
12160
|
value += lines[i][0].slice(trimIndent) + "\n";
|
|
@@ -12171,24 +12171,24 @@ var require_resolve_block_scalar = __commonJS({
|
|
|
12171
12171
|
indent = "";
|
|
12172
12172
|
}
|
|
12173
12173
|
if (type === Scalar.Scalar.BLOCK_LITERAL) {
|
|
12174
|
-
value +=
|
|
12175
|
-
|
|
12174
|
+
value += sep3 + indent.slice(trimIndent) + content;
|
|
12175
|
+
sep3 = "\n";
|
|
12176
12176
|
} else if (indent.length > trimIndent || content[0] === " ") {
|
|
12177
|
-
if (
|
|
12178
|
-
|
|
12179
|
-
else if (!prevMoreIndented &&
|
|
12180
|
-
|
|
12181
|
-
value +=
|
|
12182
|
-
|
|
12177
|
+
if (sep3 === " ")
|
|
12178
|
+
sep3 = "\n";
|
|
12179
|
+
else if (!prevMoreIndented && sep3 === "\n")
|
|
12180
|
+
sep3 = "\n\n";
|
|
12181
|
+
value += sep3 + indent.slice(trimIndent) + content;
|
|
12182
|
+
sep3 = "\n";
|
|
12183
12183
|
prevMoreIndented = true;
|
|
12184
12184
|
} else if (content === "") {
|
|
12185
|
-
if (
|
|
12185
|
+
if (sep3 === "\n")
|
|
12186
12186
|
value += "\n";
|
|
12187
12187
|
else
|
|
12188
|
-
|
|
12188
|
+
sep3 = "\n";
|
|
12189
12189
|
} else {
|
|
12190
|
-
value +=
|
|
12191
|
-
|
|
12190
|
+
value += sep3 + content;
|
|
12191
|
+
sep3 = " ";
|
|
12192
12192
|
prevMoreIndented = false;
|
|
12193
12193
|
}
|
|
12194
12194
|
}
|
|
@@ -12370,25 +12370,25 @@ var require_resolve_flow_scalar = __commonJS({
|
|
|
12370
12370
|
if (!match)
|
|
12371
12371
|
return source;
|
|
12372
12372
|
let res = match[1];
|
|
12373
|
-
let
|
|
12373
|
+
let sep3 = " ";
|
|
12374
12374
|
let pos = first.lastIndex;
|
|
12375
12375
|
line.lastIndex = pos;
|
|
12376
12376
|
while (match = line.exec(source)) {
|
|
12377
12377
|
if (match[1] === "") {
|
|
12378
|
-
if (
|
|
12379
|
-
res +=
|
|
12378
|
+
if (sep3 === "\n")
|
|
12379
|
+
res += sep3;
|
|
12380
12380
|
else
|
|
12381
|
-
|
|
12381
|
+
sep3 = "\n";
|
|
12382
12382
|
} else {
|
|
12383
|
-
res +=
|
|
12384
|
-
|
|
12383
|
+
res += sep3 + match[1];
|
|
12384
|
+
sep3 = " ";
|
|
12385
12385
|
}
|
|
12386
12386
|
pos = line.lastIndex;
|
|
12387
12387
|
}
|
|
12388
12388
|
const last = /[ \t]*(.*)/sy;
|
|
12389
12389
|
last.lastIndex = pos;
|
|
12390
12390
|
match = last.exec(source);
|
|
12391
|
-
return res +
|
|
12391
|
+
return res + sep3 + (match?.[1] ?? "");
|
|
12392
12392
|
}
|
|
12393
12393
|
function doubleQuotedValue(source, onError) {
|
|
12394
12394
|
let res = "";
|
|
@@ -13196,14 +13196,14 @@ var require_cst_stringify = __commonJS({
|
|
|
13196
13196
|
}
|
|
13197
13197
|
}
|
|
13198
13198
|
}
|
|
13199
|
-
function stringifyItem({ start, key: key2, sep:
|
|
13199
|
+
function stringifyItem({ start, key: key2, sep: sep3, value }) {
|
|
13200
13200
|
let res = "";
|
|
13201
13201
|
for (const st of start)
|
|
13202
13202
|
res += st.source;
|
|
13203
13203
|
if (key2)
|
|
13204
13204
|
res += stringifyToken(key2);
|
|
13205
|
-
if (
|
|
13206
|
-
for (const st of
|
|
13205
|
+
if (sep3)
|
|
13206
|
+
for (const st of sep3)
|
|
13207
13207
|
res += st.source;
|
|
13208
13208
|
if (value)
|
|
13209
13209
|
res += stringifyToken(value);
|
|
@@ -14353,18 +14353,18 @@ var require_parser = __commonJS({
|
|
|
14353
14353
|
if (this.type === "map-value-ind") {
|
|
14354
14354
|
const prev = getPrevProps(this.peek(2));
|
|
14355
14355
|
const start = getFirstKeyStartProps(prev);
|
|
14356
|
-
let
|
|
14356
|
+
let sep3;
|
|
14357
14357
|
if (scalar.end) {
|
|
14358
|
-
|
|
14359
|
-
|
|
14358
|
+
sep3 = scalar.end;
|
|
14359
|
+
sep3.push(this.sourceToken);
|
|
14360
14360
|
delete scalar.end;
|
|
14361
14361
|
} else
|
|
14362
|
-
|
|
14362
|
+
sep3 = [this.sourceToken];
|
|
14363
14363
|
const map = {
|
|
14364
14364
|
type: "block-map",
|
|
14365
14365
|
offset: scalar.offset,
|
|
14366
14366
|
indent: scalar.indent,
|
|
14367
|
-
items: [{ start, key: scalar, sep:
|
|
14367
|
+
items: [{ start, key: scalar, sep: sep3 }]
|
|
14368
14368
|
};
|
|
14369
14369
|
this.onKeyLine = true;
|
|
14370
14370
|
this.stack[this.stack.length - 1] = map;
|
|
@@ -14517,15 +14517,15 @@ var require_parser = __commonJS({
|
|
|
14517
14517
|
} else if (isFlowToken(it.key) && !includesToken(it.sep, "newline")) {
|
|
14518
14518
|
const start2 = getFirstKeyStartProps(it.start);
|
|
14519
14519
|
const key2 = it.key;
|
|
14520
|
-
const
|
|
14521
|
-
|
|
14520
|
+
const sep3 = it.sep;
|
|
14521
|
+
sep3.push(this.sourceToken);
|
|
14522
14522
|
delete it.key;
|
|
14523
14523
|
delete it.sep;
|
|
14524
14524
|
this.stack.push({
|
|
14525
14525
|
type: "block-map",
|
|
14526
14526
|
offset: this.offset,
|
|
14527
14527
|
indent: this.indent,
|
|
14528
|
-
items: [{ start: start2, key: key2, sep:
|
|
14528
|
+
items: [{ start: start2, key: key2, sep: sep3 }]
|
|
14529
14529
|
});
|
|
14530
14530
|
} else if (start.length > 0) {
|
|
14531
14531
|
it.sep = it.sep.concat(start, this.sourceToken);
|
|
@@ -14719,13 +14719,13 @@ var require_parser = __commonJS({
|
|
|
14719
14719
|
const prev = getPrevProps(parent);
|
|
14720
14720
|
const start = getFirstKeyStartProps(prev);
|
|
14721
14721
|
fixFlowSeqItems(fc);
|
|
14722
|
-
const
|
|
14723
|
-
|
|
14722
|
+
const sep3 = fc.end.splice(1, fc.end.length);
|
|
14723
|
+
sep3.push(this.sourceToken);
|
|
14724
14724
|
const map = {
|
|
14725
14725
|
type: "block-map",
|
|
14726
14726
|
offset: fc.offset,
|
|
14727
14727
|
indent: fc.indent,
|
|
14728
|
-
items: [{ start, key: fc, sep:
|
|
14728
|
+
items: [{ start, key: fc, sep: sep3 }]
|
|
14729
14729
|
};
|
|
14730
14730
|
this.onKeyLine = true;
|
|
14731
14731
|
this.stack[this.stack.length - 1] = map;
|
|
@@ -18932,7 +18932,7 @@ var require_filters = __commonJS({
|
|
|
18932
18932
|
return r.copySafeness(str2, res);
|
|
18933
18933
|
}
|
|
18934
18934
|
_exports.indent = indent;
|
|
18935
|
-
function
|
|
18935
|
+
function join23(arr, del, attr) {
|
|
18936
18936
|
del = del || "";
|
|
18937
18937
|
if (attr) {
|
|
18938
18938
|
arr = lib.map(arr, function(v) {
|
|
@@ -18941,7 +18941,7 @@ var require_filters = __commonJS({
|
|
|
18941
18941
|
}
|
|
18942
18942
|
return arr.join(del);
|
|
18943
18943
|
}
|
|
18944
|
-
_exports.join =
|
|
18944
|
+
_exports.join = join23;
|
|
18945
18945
|
function last(arr) {
|
|
18946
18946
|
return arr[arr.length - 1];
|
|
18947
18947
|
}
|
|
@@ -20107,9 +20107,9 @@ var require_handler = __commonJS({
|
|
|
20107
20107
|
if (this.fsw.closed) {
|
|
20108
20108
|
return;
|
|
20109
20109
|
}
|
|
20110
|
-
const
|
|
20110
|
+
const dirname7 = sysPath.dirname(file);
|
|
20111
20111
|
const basename2 = sysPath.basename(file);
|
|
20112
|
-
const parent = this.fsw._getWatchedDir(
|
|
20112
|
+
const parent = this.fsw._getWatchedDir(dirname7);
|
|
20113
20113
|
let prevStats = stats;
|
|
20114
20114
|
if (parent.has(basename2))
|
|
20115
20115
|
return;
|
|
@@ -20136,7 +20136,7 @@ var require_handler = __commonJS({
|
|
|
20136
20136
|
prevStats = newStats2;
|
|
20137
20137
|
}
|
|
20138
20138
|
} catch (error2) {
|
|
20139
|
-
this.fsw._remove(
|
|
20139
|
+
this.fsw._remove(dirname7, basename2);
|
|
20140
20140
|
}
|
|
20141
20141
|
} else if (parent.has(basename2)) {
|
|
20142
20142
|
const at = newStats.atimeMs;
|
|
@@ -20400,11 +20400,11 @@ var require_chokidar = __commonJS({
|
|
|
20400
20400
|
if (matcher.path === string3)
|
|
20401
20401
|
return true;
|
|
20402
20402
|
if (matcher.recursive) {
|
|
20403
|
-
const
|
|
20404
|
-
if (!
|
|
20403
|
+
const relative2 = sysPath.relative(matcher.path, string3);
|
|
20404
|
+
if (!relative2) {
|
|
20405
20405
|
return false;
|
|
20406
20406
|
}
|
|
20407
|
-
return !
|
|
20407
|
+
return !relative2.startsWith("..") && !sysPath.isAbsolute(relative2);
|
|
20408
20408
|
}
|
|
20409
20409
|
return false;
|
|
20410
20410
|
};
|
|
@@ -21372,11 +21372,11 @@ var require_globals = __commonJS({
|
|
|
21372
21372
|
}
|
|
21373
21373
|
};
|
|
21374
21374
|
}
|
|
21375
|
-
function _joiner(
|
|
21376
|
-
|
|
21375
|
+
function _joiner(sep3) {
|
|
21376
|
+
sep3 = sep3 || ",";
|
|
21377
21377
|
var first = true;
|
|
21378
21378
|
return function() {
|
|
21379
|
-
var val = first ? "" :
|
|
21379
|
+
var val = first ? "" : sep3;
|
|
21380
21380
|
first = false;
|
|
21381
21381
|
return val;
|
|
21382
21382
|
};
|
|
@@ -21406,8 +21406,8 @@ var require_globals = __commonJS({
|
|
|
21406
21406
|
cycler: function cycler() {
|
|
21407
21407
|
return _cycler(Array.prototype.slice.call(arguments));
|
|
21408
21408
|
},
|
|
21409
|
-
joiner: function joiner(
|
|
21410
|
-
return _joiner(
|
|
21409
|
+
joiner: function joiner(sep3) {
|
|
21410
|
+
return _joiner(sep3);
|
|
21411
21411
|
}
|
|
21412
21412
|
};
|
|
21413
21413
|
}
|
|
@@ -30475,10 +30475,10 @@ function leadingAddresseeIds(text) {
|
|
|
30475
30475
|
ids.push(id);
|
|
30476
30476
|
if (after.length === 0)
|
|
30477
30477
|
break;
|
|
30478
|
-
const
|
|
30479
|
-
if (!
|
|
30478
|
+
const sep3 = ADDRESSEE_SEPARATOR.exec(after);
|
|
30479
|
+
if (!sep3)
|
|
30480
30480
|
break;
|
|
30481
|
-
rest = after.slice(
|
|
30481
|
+
rest = after.slice(sep3[0].length);
|
|
30482
30482
|
}
|
|
30483
30483
|
return ids;
|
|
30484
30484
|
}
|
|
@@ -41362,9 +41362,9 @@ function resolveEgressTargets(toolName, args, registry2) {
|
|
|
41362
41362
|
for (const field of spec.channelThread ?? []) {
|
|
41363
41363
|
const raw = str(a[field]);
|
|
41364
41364
|
if (!raw) continue;
|
|
41365
|
-
const
|
|
41366
|
-
if (
|
|
41367
|
-
push(raw.slice(0,
|
|
41365
|
+
const sep3 = raw.indexOf(":");
|
|
41366
|
+
if (sep3 <= 0) continue;
|
|
41367
|
+
push(raw.slice(0, sep3), str(raw.slice(sep3 + 1)));
|
|
41368
41368
|
}
|
|
41369
41369
|
for (const field of spec.inboundId ?? []) {
|
|
41370
41370
|
const id = str(a[field]);
|
|
@@ -42996,9 +42996,9 @@ import {
|
|
|
42996
42996
|
createWriteStream,
|
|
42997
42997
|
existsSync as existsSync10,
|
|
42998
42998
|
ftruncateSync,
|
|
42999
|
-
mkdirSync as
|
|
42999
|
+
mkdirSync as mkdirSync10,
|
|
43000
43000
|
openSync as openSync2,
|
|
43001
|
-
readFileSync as
|
|
43001
|
+
readFileSync as readFileSync19,
|
|
43002
43002
|
readdirSync as readdirSync7,
|
|
43003
43003
|
renameSync as renameSync5,
|
|
43004
43004
|
statSync as statSync5,
|
|
@@ -43007,8 +43007,8 @@ import {
|
|
|
43007
43007
|
writeFileSync as writeFileSync14,
|
|
43008
43008
|
writeSync
|
|
43009
43009
|
} from "fs";
|
|
43010
|
-
import { basename, join as
|
|
43011
|
-
import { homedir as
|
|
43010
|
+
import { basename, join as join22, resolve as resolve2 } from "path";
|
|
43011
|
+
import { homedir as homedir7 } from "os";
|
|
43012
43012
|
import { createHash as createHash3, randomUUID as randomUUID2 } from "crypto";
|
|
43013
43013
|
|
|
43014
43014
|
// src/slack-thread-store.ts
|
|
@@ -43312,7 +43312,7 @@ function reconnectDelayMs(attempt, opts = {}) {
|
|
|
43312
43312
|
function redactSocketUrl(text) {
|
|
43313
43313
|
return text.replace(
|
|
43314
43314
|
/([?&])(ticket|token|app_id_key)=[^&\s"']*/gi,
|
|
43315
|
-
(_m,
|
|
43315
|
+
(_m, sep3, key2) => `${sep3}${key2}=<redacted>`
|
|
43316
43316
|
);
|
|
43317
43317
|
}
|
|
43318
43318
|
function describeWebSocketError(err) {
|
|
@@ -43402,6 +43402,9 @@ function foldTurnInitiatorLedger(existing, marker, maxAgeMs = TURN_INITIATOR_MAX
|
|
|
43402
43402
|
sender_id: marker.sender_id,
|
|
43403
43403
|
...marker.sender_name ? { sender_name: marker.sender_name } : {},
|
|
43404
43404
|
...marker.channel_ref ? { channel_ref: marker.channel_ref } : {},
|
|
43405
|
+
...marker.chat_kind ? { chat_kind: marker.chat_kind } : {},
|
|
43406
|
+
...marker.chat_id ? { chat_id: marker.chat_id } : {},
|
|
43407
|
+
...marker.unattributed ? { unattributed: true } : {},
|
|
43405
43408
|
ts: marker.ts
|
|
43406
43409
|
});
|
|
43407
43410
|
kept.sort((a, b) => b.ts - a.ts);
|
|
@@ -43416,7 +43419,7 @@ function updateTurnInitiatorLedger(singleSlotFile, marker) {
|
|
|
43416
43419
|
} catch {
|
|
43417
43420
|
}
|
|
43418
43421
|
const next = foldTurnInitiatorLedger(existing, marker);
|
|
43419
|
-
const tmp = `${ledgerFile}.tmp`;
|
|
43422
|
+
const tmp = `${ledgerFile}.${process.pid}.${Date.now()}.tmp`;
|
|
43420
43423
|
writeFileSync7(tmp, JSON.stringify(next), "utf8");
|
|
43421
43424
|
renameSync2(tmp, ledgerFile);
|
|
43422
43425
|
}
|
|
@@ -43437,9 +43440,137 @@ function writeTurnInitiatorMarker(input) {
|
|
|
43437
43440
|
}
|
|
43438
43441
|
}
|
|
43439
43442
|
|
|
43443
|
+
// src/turn-context.ts
|
|
43444
|
+
import { mkdirSync as mkdirSync6, readFileSync as readFileSync11 } from "fs";
|
|
43445
|
+
import { homedir as homedir6 } from "os";
|
|
43446
|
+
import { dirname as dirname5, join as join15 } from "path";
|
|
43447
|
+
|
|
43448
|
+
// ../core/dist/provisioning/frameworks/claudecode/agent-dir-alias.js
|
|
43449
|
+
import { isAbsolute, join as join13, relative, sep as sep2 } from "path";
|
|
43450
|
+
var VALID_CODE_NAME = /^[a-z0-9]+(?:-[a-z0-9]+)*$/;
|
|
43451
|
+
var VALID_AGENT_ID = /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/;
|
|
43452
|
+
var INITIATOR_BASENAME = ".current-turn-initiator.json";
|
|
43453
|
+
function isSafeAgentSegment(segment) {
|
|
43454
|
+
return VALID_CODE_NAME.test(segment) || VALID_AGENT_ID.test(segment);
|
|
43455
|
+
}
|
|
43456
|
+
function initiatorDirSegment(initiatorFile, homeDir) {
|
|
43457
|
+
const rel = relative(join13(homeDir, ".augmented"), initiatorFile);
|
|
43458
|
+
if (!rel || isAbsolute(rel))
|
|
43459
|
+
return null;
|
|
43460
|
+
const parts = rel.split(sep2);
|
|
43461
|
+
if (parts.length !== 2 || parts[1] !== INITIATOR_BASENAME)
|
|
43462
|
+
return null;
|
|
43463
|
+
const segment = parts[0];
|
|
43464
|
+
if (segment === void 0)
|
|
43465
|
+
return null;
|
|
43466
|
+
return isSafeAgentSegment(segment) ? segment : null;
|
|
43467
|
+
}
|
|
43468
|
+
function resolveAgentDirAlias(input) {
|
|
43469
|
+
const { codeName, turnInitiatorFile, agentId, homeDir } = input;
|
|
43470
|
+
const codeNameTrimmed = typeof codeName === "string" ? codeName.trim() : "";
|
|
43471
|
+
if (codeNameTrimmed && VALID_CODE_NAME.test(codeNameTrimmed)) {
|
|
43472
|
+
return join13(homeDir, ".augmented", codeNameTrimmed);
|
|
43473
|
+
}
|
|
43474
|
+
const initiator = typeof turnInitiatorFile === "string" ? turnInitiatorFile.trim() : "";
|
|
43475
|
+
if (initiator) {
|
|
43476
|
+
const segment = initiatorDirSegment(initiator, homeDir);
|
|
43477
|
+
if (segment)
|
|
43478
|
+
return join13(homeDir, ".augmented", segment);
|
|
43479
|
+
}
|
|
43480
|
+
const agentIdTrimmed = typeof agentId === "string" ? agentId.trim() : "";
|
|
43481
|
+
if (agentIdTrimmed && VALID_AGENT_ID.test(agentIdTrimmed)) {
|
|
43482
|
+
return join13(homeDir, ".augmented", agentIdTrimmed);
|
|
43483
|
+
}
|
|
43484
|
+
return null;
|
|
43485
|
+
}
|
|
43486
|
+
|
|
43487
|
+
// src/scheduled-turn-marker.ts
|
|
43488
|
+
import { readFileSync as readFileSync10, unlinkSync as unlinkSync5 } from "fs";
|
|
43489
|
+
import { join as join14 } from "path";
|
|
43490
|
+
var SCHEDULED_TURN_MARKER_FILENAME2 = ".current-scheduled-turn.json";
|
|
43491
|
+
var SCHEDULED_TURN_MAX_AGE_MS = 15 * 60 * 1e3;
|
|
43492
|
+
function validateScheduledTurnMarker(raw, now, maxAgeMs = SCHEDULED_TURN_MAX_AGE_MS) {
|
|
43493
|
+
if (!raw || typeof raw !== "object") return null;
|
|
43494
|
+
const m = raw;
|
|
43495
|
+
if (typeof m.ts !== "number" || !Number.isFinite(m.ts)) return null;
|
|
43496
|
+
if (now - m.ts > maxAgeMs || now - m.ts < 0) return null;
|
|
43497
|
+
const out = { ts: m.ts };
|
|
43498
|
+
if (typeof m.task_id === "string" && m.task_id.length > 0) out.task_id = m.task_id;
|
|
43499
|
+
const t = m.target;
|
|
43500
|
+
if (t && typeof t === "object") {
|
|
43501
|
+
const tc = t;
|
|
43502
|
+
if (typeof tc.channel_id === "string" && tc.channel_id.length > 0) {
|
|
43503
|
+
out.target = {
|
|
43504
|
+
channel_id: tc.channel_id,
|
|
43505
|
+
...typeof tc.thread_ts === "string" && tc.thread_ts.length > 0 ? { thread_ts: tc.thread_ts } : {}
|
|
43506
|
+
};
|
|
43507
|
+
}
|
|
43508
|
+
}
|
|
43509
|
+
return out;
|
|
43510
|
+
}
|
|
43511
|
+
function resolveScheduledTurnDestination(marker, requested) {
|
|
43512
|
+
if (marker.target) {
|
|
43513
|
+
const channel = marker.target.channel_id;
|
|
43514
|
+
const thread_ts = marker.target.thread_ts;
|
|
43515
|
+
return {
|
|
43516
|
+
channel,
|
|
43517
|
+
thread_ts,
|
|
43518
|
+
retargeted: channel !== requested.channel || thread_ts !== requested.thread_ts
|
|
43519
|
+
};
|
|
43520
|
+
}
|
|
43521
|
+
return { channel: requested.channel, thread_ts: void 0, retargeted: Boolean(requested.thread_ts) };
|
|
43522
|
+
}
|
|
43523
|
+
function readScheduledTurnMarker(agentDir, now = Date.now()) {
|
|
43524
|
+
if (!agentDir) return null;
|
|
43525
|
+
try {
|
|
43526
|
+
const raw = JSON.parse(
|
|
43527
|
+
readFileSync10(join14(agentDir, SCHEDULED_TURN_MARKER_FILENAME2), "utf8")
|
|
43528
|
+
);
|
|
43529
|
+
return validateScheduledTurnMarker(raw, now);
|
|
43530
|
+
} catch {
|
|
43531
|
+
return null;
|
|
43532
|
+
}
|
|
43533
|
+
}
|
|
43534
|
+
function clearScheduledTurnMarker(agentDir) {
|
|
43535
|
+
if (!agentDir) return;
|
|
43536
|
+
try {
|
|
43537
|
+
unlinkSync5(join14(agentDir, SCHEDULED_TURN_MARKER_FILENAME2));
|
|
43538
|
+
} catch {
|
|
43539
|
+
}
|
|
43540
|
+
}
|
|
43541
|
+
|
|
43542
|
+
// src/turn-context.ts
|
|
43543
|
+
var TURN_INITIATOR_MARKER_FILENAME = ".current-turn-initiator.json";
|
|
43544
|
+
function writeUnattributedTurnMarker(channel, opts = {}) {
|
|
43545
|
+
try {
|
|
43546
|
+
const file = resolveTurnInitiatorFile(opts.env ?? process.env, opts.home ?? homedir6());
|
|
43547
|
+
if (!file) return;
|
|
43548
|
+
mkdirSync6(dirname5(file), { recursive: true });
|
|
43549
|
+
updateTurnInitiatorLedger(file, {
|
|
43550
|
+
channel,
|
|
43551
|
+
sender_id: "",
|
|
43552
|
+
channel_ref: "unattributed",
|
|
43553
|
+
unattributed: true,
|
|
43554
|
+
ts: opts.now ?? Date.now()
|
|
43555
|
+
});
|
|
43556
|
+
} catch {
|
|
43557
|
+
}
|
|
43558
|
+
}
|
|
43559
|
+
function resolveTurnInitiatorFile(env2 = process.env, home = homedir6()) {
|
|
43560
|
+
const injected = env2["AGT_TURN_INITIATOR_FILE"]?.trim();
|
|
43561
|
+
if (injected) return injected;
|
|
43562
|
+
const dir = resolveAgentDirAlias({
|
|
43563
|
+
codeName: env2["AGT_AGENT_CODE_NAME"],
|
|
43564
|
+
agentId: env2["AGT_AGENT_ID"],
|
|
43565
|
+
turnInitiatorFile: null,
|
|
43566
|
+
homeDir: home
|
|
43567
|
+
});
|
|
43568
|
+
return dir ? join15(dir, TURN_INITIATOR_MARKER_FILENAME) : null;
|
|
43569
|
+
}
|
|
43570
|
+
|
|
43440
43571
|
// src/slack-bot-photo.ts
|
|
43441
|
-
import { existsSync as existsSync7, mkdirSync as
|
|
43442
|
-
import { dirname as
|
|
43572
|
+
import { existsSync as existsSync7, mkdirSync as mkdirSync7, readFileSync as readFileSync12, writeFileSync as writeFileSync8 } from "fs";
|
|
43573
|
+
import { dirname as dirname6 } from "path";
|
|
43443
43574
|
async function applyBotPhoto(opts) {
|
|
43444
43575
|
const fetchImpl = opts.fetchImpl ?? fetch;
|
|
43445
43576
|
const log = opts.log ?? ((m) => {
|
|
@@ -43448,7 +43579,7 @@ async function applyBotPhoto(opts) {
|
|
|
43448
43579
|
const { token, avatarUrl, markerPath } = opts;
|
|
43449
43580
|
if (markerPath && existsSync7(markerPath)) {
|
|
43450
43581
|
try {
|
|
43451
|
-
if (
|
|
43582
|
+
if (readFileSync12(markerPath, "utf-8").trim() === avatarUrl) {
|
|
43452
43583
|
return { status: "skipped-unchanged" };
|
|
43453
43584
|
}
|
|
43454
43585
|
} catch {
|
|
@@ -43489,7 +43620,7 @@ async function applyBotPhoto(opts) {
|
|
|
43489
43620
|
}
|
|
43490
43621
|
if (markerPath) {
|
|
43491
43622
|
try {
|
|
43492
|
-
|
|
43623
|
+
mkdirSync7(dirname6(markerPath), { recursive: true, mode: 448 });
|
|
43493
43624
|
writeFileSync8(markerPath, avatarUrl, { mode: 384 });
|
|
43494
43625
|
} catch {
|
|
43495
43626
|
}
|
|
@@ -43573,8 +43704,8 @@ function conversationalLaneMeta(expectsReply = true) {
|
|
|
43573
43704
|
}
|
|
43574
43705
|
|
|
43575
43706
|
// src/inbound-lane-telemetry.ts
|
|
43576
|
-
import { readFileSync as
|
|
43577
|
-
import { join as
|
|
43707
|
+
import { readFileSync as readFileSync13, writeFileSync as writeFileSync9 } from "fs";
|
|
43708
|
+
import { join as join16 } from "path";
|
|
43578
43709
|
var LANE_CLASSIFICATION_COUNTER_SUFFIX = "-lane-classifications.json";
|
|
43579
43710
|
var SUSPECTED_MISCLASSIFICATION_KEY = "suspected_misclassification";
|
|
43580
43711
|
var HUMAN_CHANNEL_SOURCES = /* @__PURE__ */ new Set([
|
|
@@ -43591,10 +43722,10 @@ function isSuspectedMisclassification(lane, source) {
|
|
|
43591
43722
|
}
|
|
43592
43723
|
function recordLaneClassification(agentDir, channel, classification) {
|
|
43593
43724
|
if (!agentDir) return;
|
|
43594
|
-
const path =
|
|
43725
|
+
const path = join16(agentDir, `${channel}${LANE_CLASSIFICATION_COUNTER_SUFFIX}`);
|
|
43595
43726
|
let counts = {};
|
|
43596
43727
|
try {
|
|
43597
|
-
const parsed = JSON.parse(
|
|
43728
|
+
const parsed = JSON.parse(readFileSync13(path, "utf-8"));
|
|
43598
43729
|
if (parsed && typeof parsed === "object") counts = parsed;
|
|
43599
43730
|
} catch {
|
|
43600
43731
|
}
|
|
@@ -43610,8 +43741,8 @@ function recordLaneClassification(agentDir, channel, classification) {
|
|
|
43610
43741
|
}
|
|
43611
43742
|
|
|
43612
43743
|
// src/slack-inbound-registry.ts
|
|
43613
|
-
import { readdirSync as readdirSync5, readFileSync as
|
|
43614
|
-
import { join as
|
|
43744
|
+
import { readdirSync as readdirSync5, readFileSync as readFileSync14 } from "fs";
|
|
43745
|
+
import { join as join17 } from "path";
|
|
43615
43746
|
var DEFAULT_MAX_ENTRIES = 500;
|
|
43616
43747
|
var DEFAULT_CLEARED_TTL_MS = 6 * 60 * 60 * 1e3;
|
|
43617
43748
|
function entryKey(channel, messageTs) {
|
|
@@ -43732,7 +43863,7 @@ function createInboundRegistry(opts = {}) {
|
|
|
43732
43863
|
if (name.includes(".retry-") || name.includes(".poison")) continue;
|
|
43733
43864
|
let marker;
|
|
43734
43865
|
try {
|
|
43735
|
-
marker = JSON.parse(
|
|
43866
|
+
marker = JSON.parse(readFileSync14(join17(dir, name), "utf-8"));
|
|
43736
43867
|
} catch {
|
|
43737
43868
|
continue;
|
|
43738
43869
|
}
|
|
@@ -43777,17 +43908,17 @@ function slackInboundId(channel, threadTs, messageTs) {
|
|
|
43777
43908
|
}
|
|
43778
43909
|
|
|
43779
43910
|
// src/inbound-delivery-ledger.ts
|
|
43780
|
-
import { existsSync as existsSync8, mkdirSync as
|
|
43781
|
-
import { join as
|
|
43911
|
+
import { existsSync as existsSync8, mkdirSync as mkdirSync8, readdirSync as readdirSync6, readFileSync as readFileSync15, renameSync as renameSync3, writeFileSync as writeFileSync10 } from "fs";
|
|
43912
|
+
import { join as join18 } from "path";
|
|
43782
43913
|
function safeInboundId(inboundId) {
|
|
43783
43914
|
return inboundId.replace(/[^A-Za-z0-9_-]/g, "_");
|
|
43784
43915
|
}
|
|
43785
43916
|
var defaultDeps = {
|
|
43786
|
-
mkdir: (dir) =>
|
|
43917
|
+
mkdir: (dir) => mkdirSync8(dir, { recursive: true }),
|
|
43787
43918
|
writeFile: (path, data) => writeFileSync10(path, data, "utf8"),
|
|
43788
43919
|
rename: (from, to) => renameSync3(from, to),
|
|
43789
43920
|
readdir: (dir) => readdirSync6(dir),
|
|
43790
|
-
readFile: (path) =>
|
|
43921
|
+
readFile: (path) => readFileSync15(path, "utf8"),
|
|
43791
43922
|
exists: (path) => existsSync8(path)
|
|
43792
43923
|
};
|
|
43793
43924
|
function writeInboundDeliveryLedgerEntry(dir, record2, deps = defaultDeps) {
|
|
@@ -43796,7 +43927,7 @@ function writeInboundDeliveryLedgerEntry(dir, record2, deps = defaultDeps) {
|
|
|
43796
43927
|
if (!safe || safe.includes("/") || safe.includes("\\") || safe.includes("..")) return;
|
|
43797
43928
|
try {
|
|
43798
43929
|
deps.mkdir(dir);
|
|
43799
|
-
const final =
|
|
43930
|
+
const final = join18(dir, `${safe}.json`);
|
|
43800
43931
|
const tmp = `${final}.tmp`;
|
|
43801
43932
|
deps.writeFile(tmp, JSON.stringify(record2));
|
|
43802
43933
|
deps.rename(tmp, final);
|
|
@@ -43981,8 +44112,8 @@ function describeSendOutcome(dest) {
|
|
|
43981
44112
|
}
|
|
43982
44113
|
|
|
43983
44114
|
// src/slack-reply-binding-telemetry.ts
|
|
43984
|
-
import { readFileSync as
|
|
43985
|
-
import { join as
|
|
44115
|
+
import { readFileSync as readFileSync16, writeFileSync as writeFileSync11 } from "fs";
|
|
44116
|
+
import { join as join19 } from "path";
|
|
43986
44117
|
var REPLY_BINDING_CLASSIFICATION_COUNTER_SUFFIX = "-reply-binding-classifications.json";
|
|
43987
44118
|
var UNKNOWN_INBOUND_ID_KEY = "unknown_inbound_id";
|
|
43988
44119
|
var CHANNEL_MISTARGET_CORRECTED_KEY = "channel_mistarget_corrected";
|
|
@@ -43997,10 +44128,10 @@ function slackReplyBindingMode() {
|
|
|
43997
44128
|
}
|
|
43998
44129
|
function recordReplyBindingClassification(agentDir, channel, input) {
|
|
43999
44130
|
if (!agentDir) return;
|
|
44000
|
-
const path =
|
|
44131
|
+
const path = join19(agentDir, `${channel}${REPLY_BINDING_CLASSIFICATION_COUNTER_SUFFIX}`);
|
|
44001
44132
|
let counts = {};
|
|
44002
44133
|
try {
|
|
44003
|
-
const parsed = JSON.parse(
|
|
44134
|
+
const parsed = JSON.parse(readFileSync16(path, "utf-8"));
|
|
44004
44135
|
if (parsed && typeof parsed === "object") counts = parsed;
|
|
44005
44136
|
} catch {
|
|
44006
44137
|
}
|
|
@@ -44015,10 +44146,10 @@ function recordReplyBindingClassification(agentDir, channel, input) {
|
|
|
44015
44146
|
}
|
|
44016
44147
|
function recordScheduledChannelOverride(agentDir, channel, input) {
|
|
44017
44148
|
if (!agentDir) return;
|
|
44018
|
-
const path =
|
|
44149
|
+
const path = join19(agentDir, `${channel}${REPLY_BINDING_CLASSIFICATION_COUNTER_SUFFIX}`);
|
|
44019
44150
|
let counts = {};
|
|
44020
44151
|
try {
|
|
44021
|
-
const parsed = JSON.parse(
|
|
44152
|
+
const parsed = JSON.parse(readFileSync16(path, "utf-8"));
|
|
44022
44153
|
if (parsed && typeof parsed === "object") counts = parsed;
|
|
44023
44154
|
} catch {
|
|
44024
44155
|
}
|
|
@@ -44031,10 +44162,10 @@ function recordScheduledChannelOverride(agentDir, channel, input) {
|
|
|
44031
44162
|
}
|
|
44032
44163
|
function recordChannelMistarget(agentDir, channel, input) {
|
|
44033
44164
|
if (!agentDir) return;
|
|
44034
|
-
const path =
|
|
44165
|
+
const path = join19(agentDir, `${channel}${REPLY_BINDING_CLASSIFICATION_COUNTER_SUFFIX}`);
|
|
44035
44166
|
let counts = {};
|
|
44036
44167
|
try {
|
|
44037
|
-
const parsed = JSON.parse(
|
|
44168
|
+
const parsed = JSON.parse(readFileSync16(path, "utf-8"));
|
|
44038
44169
|
if (parsed && typeof parsed === "object") counts = parsed;
|
|
44039
44170
|
} catch {
|
|
44040
44171
|
}
|
|
@@ -44049,8 +44180,8 @@ function recordChannelMistarget(agentDir, channel, input) {
|
|
|
44049
44180
|
}
|
|
44050
44181
|
|
|
44051
44182
|
// src/slack-reply-target-telemetry.ts
|
|
44052
|
-
import { readFileSync as
|
|
44053
|
-
import { join as
|
|
44183
|
+
import { readFileSync as readFileSync17, writeFileSync as writeFileSync12 } from "fs";
|
|
44184
|
+
import { join as join20 } from "path";
|
|
44054
44185
|
var REPLY_TARGET_CLASSIFICATION_COUNTER_SUFFIX = "-reply-target-classifications.json";
|
|
44055
44186
|
function pendingThreadsBucket(n) {
|
|
44056
44187
|
if (n <= 0) return "0";
|
|
@@ -44083,10 +44214,10 @@ function classifyReplyTarget(input) {
|
|
|
44083
44214
|
}
|
|
44084
44215
|
function recordReplyTargetClassification(agentDir, channel, classification) {
|
|
44085
44216
|
if (!agentDir) return;
|
|
44086
|
-
const path =
|
|
44217
|
+
const path = join20(agentDir, `${channel}${REPLY_TARGET_CLASSIFICATION_COUNTER_SUFFIX}`);
|
|
44087
44218
|
let counts = {};
|
|
44088
44219
|
try {
|
|
44089
|
-
const parsed = JSON.parse(
|
|
44220
|
+
const parsed = JSON.parse(readFileSync17(path, "utf-8"));
|
|
44090
44221
|
if (parsed && typeof parsed === "object") counts = parsed;
|
|
44091
44222
|
} catch {
|
|
44092
44223
|
}
|
|
@@ -44101,61 +44232,6 @@ function recordReplyTargetClassification(agentDir, channel, classification) {
|
|
|
44101
44232
|
}
|
|
44102
44233
|
}
|
|
44103
44234
|
|
|
44104
|
-
// src/scheduled-turn-marker.ts
|
|
44105
|
-
import { readFileSync as readFileSync16, unlinkSync as unlinkSync5 } from "fs";
|
|
44106
|
-
import { join as join18 } from "path";
|
|
44107
|
-
var SCHEDULED_TURN_MARKER_FILENAME2 = ".current-scheduled-turn.json";
|
|
44108
|
-
var SCHEDULED_TURN_MAX_AGE_MS = 15 * 60 * 1e3;
|
|
44109
|
-
function validateScheduledTurnMarker(raw, now, maxAgeMs = SCHEDULED_TURN_MAX_AGE_MS) {
|
|
44110
|
-
if (!raw || typeof raw !== "object") return null;
|
|
44111
|
-
const m = raw;
|
|
44112
|
-
if (typeof m.ts !== "number" || !Number.isFinite(m.ts)) return null;
|
|
44113
|
-
if (now - m.ts > maxAgeMs || now - m.ts < 0) return null;
|
|
44114
|
-
const out = { ts: m.ts };
|
|
44115
|
-
if (typeof m.task_id === "string" && m.task_id.length > 0) out.task_id = m.task_id;
|
|
44116
|
-
const t = m.target;
|
|
44117
|
-
if (t && typeof t === "object") {
|
|
44118
|
-
const tc = t;
|
|
44119
|
-
if (typeof tc.channel_id === "string" && tc.channel_id.length > 0) {
|
|
44120
|
-
out.target = {
|
|
44121
|
-
channel_id: tc.channel_id,
|
|
44122
|
-
...typeof tc.thread_ts === "string" && tc.thread_ts.length > 0 ? { thread_ts: tc.thread_ts } : {}
|
|
44123
|
-
};
|
|
44124
|
-
}
|
|
44125
|
-
}
|
|
44126
|
-
return out;
|
|
44127
|
-
}
|
|
44128
|
-
function resolveScheduledTurnDestination(marker, requested) {
|
|
44129
|
-
if (marker.target) {
|
|
44130
|
-
const channel = marker.target.channel_id;
|
|
44131
|
-
const thread_ts = marker.target.thread_ts;
|
|
44132
|
-
return {
|
|
44133
|
-
channel,
|
|
44134
|
-
thread_ts,
|
|
44135
|
-
retargeted: channel !== requested.channel || thread_ts !== requested.thread_ts
|
|
44136
|
-
};
|
|
44137
|
-
}
|
|
44138
|
-
return { channel: requested.channel, thread_ts: void 0, retargeted: Boolean(requested.thread_ts) };
|
|
44139
|
-
}
|
|
44140
|
-
function readScheduledTurnMarker(agentDir, now = Date.now()) {
|
|
44141
|
-
if (!agentDir) return null;
|
|
44142
|
-
try {
|
|
44143
|
-
const raw = JSON.parse(
|
|
44144
|
-
readFileSync16(join18(agentDir, SCHEDULED_TURN_MARKER_FILENAME2), "utf8")
|
|
44145
|
-
);
|
|
44146
|
-
return validateScheduledTurnMarker(raw, now);
|
|
44147
|
-
} catch {
|
|
44148
|
-
return null;
|
|
44149
|
-
}
|
|
44150
|
-
}
|
|
44151
|
-
function clearScheduledTurnMarker(agentDir) {
|
|
44152
|
-
if (!agentDir) return;
|
|
44153
|
-
try {
|
|
44154
|
-
unlinkSync5(join18(agentDir, SCHEDULED_TURN_MARKER_FILENAME2));
|
|
44155
|
-
} catch {
|
|
44156
|
-
}
|
|
44157
|
-
}
|
|
44158
|
-
|
|
44159
44235
|
// src/slack-reply-scheduled-priority.ts
|
|
44160
44236
|
function scheduledDestOverridesNamedChannel(opts) {
|
|
44161
44237
|
if (opts.inboundId || opts.enforceBound) return false;
|
|
@@ -45088,15 +45164,15 @@ function textMentionsBot(text, botId) {
|
|
|
45088
45164
|
// src/mcp-spawn-lock.ts
|
|
45089
45165
|
import {
|
|
45090
45166
|
existsSync as existsSync9,
|
|
45091
|
-
mkdirSync as
|
|
45092
|
-
readFileSync as
|
|
45167
|
+
mkdirSync as mkdirSync9,
|
|
45168
|
+
readFileSync as readFileSync18,
|
|
45093
45169
|
renameSync as renameSync4,
|
|
45094
45170
|
statSync as statSync4,
|
|
45095
45171
|
unlinkSync as unlinkSync6,
|
|
45096
45172
|
utimesSync,
|
|
45097
45173
|
writeFileSync as writeFileSync13
|
|
45098
45174
|
} from "fs";
|
|
45099
|
-
import { join as
|
|
45175
|
+
import { join as join21 } from "path";
|
|
45100
45176
|
var STALE_LOCK_MS = 9e4;
|
|
45101
45177
|
var HEARTBEAT_INTERVAL_MS = 3e4;
|
|
45102
45178
|
function defaultIsPidAlive(pid) {
|
|
@@ -45119,7 +45195,7 @@ function acquireMcpSpawnLock(args) {
|
|
|
45119
45195
|
const nowMs = options.nowMs ?? (() => Date.now());
|
|
45120
45196
|
const lockMtimeMs = options.lockMtimeMs ?? defaultLockMtimeMs;
|
|
45121
45197
|
const staleMs = options.staleMs ?? STALE_LOCK_MS;
|
|
45122
|
-
const path =
|
|
45198
|
+
const path = join21(agentDir, basename2);
|
|
45123
45199
|
const existing = readLockHolder(path);
|
|
45124
45200
|
if (existing) {
|
|
45125
45201
|
if (existing.pid === selfPid) {
|
|
@@ -45133,7 +45209,7 @@ function acquireMcpSpawnLock(args) {
|
|
|
45133
45209
|
}
|
|
45134
45210
|
}
|
|
45135
45211
|
}
|
|
45136
|
-
|
|
45212
|
+
mkdirSync9(agentDir, { recursive: true, mode: 448 });
|
|
45137
45213
|
const tmpPath = `${path}.${selfPid}.tmp`;
|
|
45138
45214
|
const payload = { pid: selfPid, started_at: now() };
|
|
45139
45215
|
writeFileSync13(tmpPath, JSON.stringify(payload), { mode: 384 });
|
|
@@ -45186,7 +45262,7 @@ function defaultLockMtimeMs(path) {
|
|
|
45186
45262
|
function readLockHolder(path) {
|
|
45187
45263
|
if (!existsSync9(path)) return null;
|
|
45188
45264
|
try {
|
|
45189
|
-
const raw =
|
|
45265
|
+
const raw = readFileSync18(path, "utf8");
|
|
45190
45266
|
const parsed = JSON.parse(raw);
|
|
45191
45267
|
const pid = typeof parsed.pid === "number" ? parsed.pid : Number(parsed.pid);
|
|
45192
45268
|
if (!Number.isFinite(pid) || pid <= 0) return null;
|
|
@@ -45639,8 +45715,8 @@ var SLACK_TEAM_PEER_USER_IDS = parseTeamPeerUserIdsEnv(
|
|
|
45639
45715
|
process.env.SLACK_TEAM_PEER_USER_IDS
|
|
45640
45716
|
);
|
|
45641
45717
|
var PEER_HINT_SEEN = /* @__PURE__ */ new Set();
|
|
45642
|
-
var SLACK_AGENT_DIR = AGENT_CODE_NAME ?
|
|
45643
|
-
var SLACK_MCP_CONFIG_PATH = SLACK_AGENT_DIR ?
|
|
45718
|
+
var SLACK_AGENT_DIR = AGENT_CODE_NAME ? join22(homedir7(), ".augmented", AGENT_CODE_NAME) : null;
|
|
45719
|
+
var SLACK_MCP_CONFIG_PATH = SLACK_AGENT_DIR ? join22(SLACK_AGENT_DIR, "project", ".mcp.json") : null;
|
|
45644
45720
|
var liveAllowedUsersCache = null;
|
|
45645
45721
|
function readLiveAllowedUsers() {
|
|
45646
45722
|
if (!SLACK_MCP_CONFIG_PATH) return null;
|
|
@@ -45650,7 +45726,7 @@ function readLiveAllowedUsers() {
|
|
|
45650
45726
|
return liveAllowedUsersCache.value;
|
|
45651
45727
|
}
|
|
45652
45728
|
const value = extractAllowedUsersFromMcpJson(
|
|
45653
|
-
|
|
45729
|
+
readFileSync19(SLACK_MCP_CONFIG_PATH, "utf-8")
|
|
45654
45730
|
);
|
|
45655
45731
|
if (value === null) return null;
|
|
45656
45732
|
liveAllowedUsersCache = { mtimeMs, value };
|
|
@@ -45671,7 +45747,7 @@ function readLivePingAllowedUsers() {
|
|
|
45671
45747
|
return livePingAllowedUsersCache.value;
|
|
45672
45748
|
}
|
|
45673
45749
|
const value = extractPingAllowedUsersFromMcpJson(
|
|
45674
|
-
|
|
45750
|
+
readFileSync19(SLACK_MCP_CONFIG_PATH, "utf-8")
|
|
45675
45751
|
);
|
|
45676
45752
|
if (value === null) return null;
|
|
45677
45753
|
livePingAllowedUsersCache = { mtimeMs, value };
|
|
@@ -45683,18 +45759,18 @@ function readLivePingAllowedUsers() {
|
|
|
45683
45759
|
function getEffectivePingAllowedUsers() {
|
|
45684
45760
|
return readLivePingAllowedUsers() ?? PING_ALLOWED_USERS;
|
|
45685
45761
|
}
|
|
45686
|
-
var SLACK_PENDING_INBOUND_DIR = SLACK_AGENT_DIR ?
|
|
45687
|
-
var SLACK_PENDING_INBOUND_STALE_DIR = SLACK_AGENT_DIR ?
|
|
45688
|
-
var SLACK_RESTART_CONTEXT_DIR = SLACK_AGENT_DIR ?
|
|
45689
|
-
var SLACK_RECOVERY_OUTBOX_DIR = SLACK_AGENT_DIR ?
|
|
45690
|
-
var SLACK_RECOVERY_LEDGER_DIR = SLACK_AGENT_DIR ?
|
|
45691
|
-
var SLACK_DELIVERY_LEDGER_DIR = SLACK_AGENT_DIR ?
|
|
45762
|
+
var SLACK_PENDING_INBOUND_DIR = SLACK_AGENT_DIR ? join22(SLACK_AGENT_DIR, "slack-pending-inbound") : null;
|
|
45763
|
+
var SLACK_PENDING_INBOUND_STALE_DIR = SLACK_AGENT_DIR ? join22(SLACK_AGENT_DIR, "slack-pending-inbound-stale") : null;
|
|
45764
|
+
var SLACK_RESTART_CONTEXT_DIR = SLACK_AGENT_DIR ? join22(SLACK_AGENT_DIR, "slack-restart-context") : null;
|
|
45765
|
+
var SLACK_RECOVERY_OUTBOX_DIR = SLACK_AGENT_DIR ? join22(SLACK_AGENT_DIR, "slack-recovery-outbox") : null;
|
|
45766
|
+
var SLACK_RECOVERY_LEDGER_DIR = SLACK_AGENT_DIR ? join22(SLACK_AGENT_DIR, ".agt-slack-recovery-ledger") : null;
|
|
45767
|
+
var SLACK_DELIVERY_LEDGER_DIR = SLACK_AGENT_DIR ? join22(SLACK_AGENT_DIR, ".agt-inbound-delivery-ledger") : null;
|
|
45692
45768
|
var slackInboundRegistry = createInboundRegistry();
|
|
45693
|
-
var SLACK_RESTART_CONFIRM_FILE = SLACK_AGENT_DIR ?
|
|
45694
|
-
var SLACK_RECENT_DMS_FILE = SLACK_AGENT_DIR ?
|
|
45695
|
-
var SLACK_CHANNEL_ADD_RESTART_FILE = SLACK_AGENT_DIR ?
|
|
45769
|
+
var SLACK_RESTART_CONFIRM_FILE = SLACK_AGENT_DIR ? join22(SLACK_AGENT_DIR, "slack-restart-confirm.json") : null;
|
|
45770
|
+
var SLACK_RECENT_DMS_FILE = SLACK_AGENT_DIR ? join22(SLACK_AGENT_DIR, "slack-recent-dms.json") : null;
|
|
45771
|
+
var SLACK_CHANNEL_ADD_RESTART_FILE = SLACK_AGENT_DIR ? join22(SLACK_AGENT_DIR, "slack-channel-add-restart.json") : null;
|
|
45696
45772
|
var SLACK_MAX_RECOVERY_ATTEMPTS = 3;
|
|
45697
|
-
var SLACK_AVATAR_MARKER_PATH = SLACK_AGENT_DIR ?
|
|
45773
|
+
var SLACK_AVATAR_MARKER_PATH = SLACK_AGENT_DIR ? join22(SLACK_AGENT_DIR, "slack-avatar-applied") : null;
|
|
45698
45774
|
function redactSlackId(id) {
|
|
45699
45775
|
if (!id) return "<none>";
|
|
45700
45776
|
return createHash3("sha256").update(id).digest("hex").slice(0, 8);
|
|
@@ -45705,7 +45781,7 @@ function safeSlackMarkerName(channel, threadTs, messageTs) {
|
|
|
45705
45781
|
}
|
|
45706
45782
|
function slackPendingInboundPath(channel, threadTs, messageTs) {
|
|
45707
45783
|
if (!SLACK_PENDING_INBOUND_DIR) return null;
|
|
45708
|
-
return
|
|
45784
|
+
return join22(SLACK_PENDING_INBOUND_DIR, safeSlackMarkerName(channel, threadTs, messageTs));
|
|
45709
45785
|
}
|
|
45710
45786
|
function writeSlackPendingInboundMarker(channel, threadTs, messageTs, undeliverable = false, discretionary = false, payload) {
|
|
45711
45787
|
const path = slackPendingInboundPath(channel, threadTs, messageTs);
|
|
@@ -45728,7 +45804,7 @@ function writeSlackPendingInboundMarker(channel, threadTs, messageTs, undelivera
|
|
|
45728
45804
|
...ingressOnlyThreads.isIngressOnly(channel, threadTs) ? { ingress_only: true } : {}
|
|
45729
45805
|
};
|
|
45730
45806
|
try {
|
|
45731
|
-
|
|
45807
|
+
mkdirSync10(SLACK_PENDING_INBOUND_DIR, { recursive: true, mode: 448 });
|
|
45732
45808
|
writeFileSync14(path, JSON.stringify(marker), { mode: 384 });
|
|
45733
45809
|
} catch (err) {
|
|
45734
45810
|
process.stderr.write(
|
|
@@ -45763,7 +45839,7 @@ function markSlackMarkerPromisedInPlace(fullPath) {
|
|
|
45763
45839
|
function markSlackMarkerEngagedInPlace(fullPath, opts) {
|
|
45764
45840
|
let marker;
|
|
45765
45841
|
try {
|
|
45766
|
-
marker = JSON.parse(
|
|
45842
|
+
marker = JSON.parse(readFileSync19(fullPath, "utf-8"));
|
|
45767
45843
|
} catch {
|
|
45768
45844
|
return false;
|
|
45769
45845
|
}
|
|
@@ -45778,7 +45854,7 @@ function markSlackMarkerEngagedInPlace(fullPath, opts) {
|
|
|
45778
45854
|
rewriteSlackMarkerInPlace(fullPath, marker);
|
|
45779
45855
|
if (!opts.promise) return false;
|
|
45780
45856
|
try {
|
|
45781
|
-
const readBack = JSON.parse(
|
|
45857
|
+
const readBack = JSON.parse(readFileSync19(fullPath, "utf-8"));
|
|
45782
45858
|
return typeof readBack.promised_at === "string" && readBack.promised_at.length > 0;
|
|
45783
45859
|
} catch {
|
|
45784
45860
|
return false;
|
|
@@ -45789,7 +45865,7 @@ function attachSlackReplayPayload(channel, threadTs, messageTs, payload) {
|
|
|
45789
45865
|
if (!path) return;
|
|
45790
45866
|
let marker;
|
|
45791
45867
|
try {
|
|
45792
|
-
marker = JSON.parse(
|
|
45868
|
+
marker = JSON.parse(readFileSync19(path, "utf-8"));
|
|
45793
45869
|
} catch {
|
|
45794
45870
|
return;
|
|
45795
45871
|
}
|
|
@@ -45800,7 +45876,7 @@ function readSlackPendingInboundMarker(channel, threadTs, messageTs) {
|
|
|
45800
45876
|
const path = slackPendingInboundPath(channel, threadTs, messageTs);
|
|
45801
45877
|
if (!path || !existsSync10(path)) return null;
|
|
45802
45878
|
try {
|
|
45803
|
-
return JSON.parse(
|
|
45879
|
+
return JSON.parse(readFileSync19(path, "utf-8"));
|
|
45804
45880
|
} catch {
|
|
45805
45881
|
return null;
|
|
45806
45882
|
}
|
|
@@ -45850,7 +45926,7 @@ function slackConversationReplayFacts(channel, threadTs) {
|
|
|
45850
45926
|
threadTs,
|
|
45851
45927
|
(fullPath) => {
|
|
45852
45928
|
try {
|
|
45853
|
-
const marker = JSON.parse(
|
|
45929
|
+
const marker = JSON.parse(readFileSync19(fullPath, "utf-8"));
|
|
45854
45930
|
found.push({ hasPayload: Boolean(marker.payload), discretionary: marker.discretionary });
|
|
45855
45931
|
} catch {
|
|
45856
45932
|
found.push({ hasPayload: false });
|
|
@@ -45983,7 +46059,7 @@ function scheduleBusyAck(channel, threadTs, messageTs, isThreadReply, arrivedWhi
|
|
|
45983
46059
|
let paneLogFreshAgeMs = null;
|
|
45984
46060
|
if (SLACK_AGENT_DIR) {
|
|
45985
46061
|
try {
|
|
45986
|
-
const paneMtimeMs = statSync5(
|
|
46062
|
+
const paneMtimeMs = statSync5(join22(SLACK_AGENT_DIR, "pane.log")).mtimeMs;
|
|
45987
46063
|
paneLogFreshAgeMs = Math.max(0, Date.now() - paneMtimeMs);
|
|
45988
46064
|
} catch {
|
|
45989
46065
|
}
|
|
@@ -46019,7 +46095,7 @@ function __resetSlackBusyAckNoticeThrottle() {
|
|
|
46019
46095
|
function clearSlackMarkerFileWithHeal(fullPath) {
|
|
46020
46096
|
let marker = null;
|
|
46021
46097
|
try {
|
|
46022
|
-
marker = JSON.parse(
|
|
46098
|
+
marker = JSON.parse(readFileSync19(fullPath, "utf-8"));
|
|
46023
46099
|
} catch {
|
|
46024
46100
|
}
|
|
46025
46101
|
if (marker?.channel) {
|
|
@@ -46051,7 +46127,7 @@ var slackPromiseStampOutcome = { attempted: 0, stamped: 0 };
|
|
|
46051
46127
|
function healThenEngageSlackMarker(fullPath, opts) {
|
|
46052
46128
|
let marker = null;
|
|
46053
46129
|
try {
|
|
46054
|
-
marker = JSON.parse(
|
|
46130
|
+
marker = JSON.parse(readFileSync19(fullPath, "utf-8"));
|
|
46055
46131
|
} catch {
|
|
46056
46132
|
return false;
|
|
46057
46133
|
}
|
|
@@ -46149,7 +46225,7 @@ function readSlackThreadMarkerState(channel, threadTs) {
|
|
|
46149
46225
|
threadTs,
|
|
46150
46226
|
(fullPath) => {
|
|
46151
46227
|
try {
|
|
46152
|
-
const m = JSON.parse(
|
|
46228
|
+
const m = JSON.parse(readFileSync19(fullPath, "utf-8"));
|
|
46153
46229
|
markers.push({ ingress_only: m.ingress_only });
|
|
46154
46230
|
} catch {
|
|
46155
46231
|
markers.push({});
|
|
@@ -46167,10 +46243,10 @@ function readSlackThreadMarkerState(channel, threadTs) {
|
|
|
46167
46243
|
async function processSlackRecoveryOutboxFile(filename) {
|
|
46168
46244
|
if (!SLACK_RECOVERY_OUTBOX_DIR) return;
|
|
46169
46245
|
if (filename.endsWith(".poison.json") || filename.endsWith(".tmp")) return;
|
|
46170
|
-
const fullPath =
|
|
46246
|
+
const fullPath = join22(SLACK_RECOVERY_OUTBOX_DIR, filename);
|
|
46171
46247
|
let payload;
|
|
46172
46248
|
try {
|
|
46173
|
-
payload = JSON.parse(
|
|
46249
|
+
payload = JSON.parse(readFileSync19(fullPath, "utf-8"));
|
|
46174
46250
|
} catch (err) {
|
|
46175
46251
|
process.stderr.write(
|
|
46176
46252
|
`slack-channel(${AGENT_CODE_NAME}): recovery outbox parse failed (${filename}): ${err.message}
|
|
@@ -46300,7 +46376,7 @@ async function processSlackRecoveryOutboxFile(filename) {
|
|
|
46300
46376
|
const next = slackNextRetryName(filename);
|
|
46301
46377
|
if (next) {
|
|
46302
46378
|
try {
|
|
46303
|
-
renameSync5(fullPath,
|
|
46379
|
+
renameSync5(fullPath, join22(SLACK_RECOVERY_OUTBOX_DIR, next.next));
|
|
46304
46380
|
if (next.attempt >= SLACK_MAX_RECOVERY_ATTEMPTS) {
|
|
46305
46381
|
process.stderr.write(
|
|
46306
46382
|
`slack-channel(${AGENT_CODE_NAME}): ghost-reply recovery exhausted retries \u2014 moved to ${next.next}
|
|
@@ -46340,7 +46416,7 @@ function scanSlackRecoveryRetries() {
|
|
|
46340
46416
|
if (!f.includes(".retry-") || f.endsWith(".poison.json")) continue;
|
|
46341
46417
|
let mtimeMs;
|
|
46342
46418
|
try {
|
|
46343
|
-
mtimeMs = statSync5(
|
|
46419
|
+
mtimeMs = statSync5(join22(SLACK_RECOVERY_OUTBOX_DIR, f)).mtimeMs;
|
|
46344
46420
|
} catch {
|
|
46345
46421
|
continue;
|
|
46346
46422
|
}
|
|
@@ -46352,7 +46428,7 @@ function scanSlackRecoveryRetries() {
|
|
|
46352
46428
|
function startSlackRecoveryOutboxWatcher() {
|
|
46353
46429
|
if (!SLACK_RECOVERY_OUTBOX_DIR) return;
|
|
46354
46430
|
try {
|
|
46355
|
-
|
|
46431
|
+
mkdirSync10(SLACK_RECOVERY_OUTBOX_DIR, { recursive: true, mode: 448 });
|
|
46356
46432
|
} catch (err) {
|
|
46357
46433
|
process.stderr.write(
|
|
46358
46434
|
`slack-channel(${AGENT_CODE_NAME}): recovery outbox mkdir failed: ${err.message}
|
|
@@ -46370,7 +46446,7 @@ function startSlackRecoveryOutboxWatcher() {
|
|
|
46370
46446
|
const watcher = watch(SLACK_RECOVERY_OUTBOX_DIR, (event, filename) => {
|
|
46371
46447
|
if (event !== "rename" || !filename) return;
|
|
46372
46448
|
if (!isFirstAttemptSlackOutboxFile(filename)) return;
|
|
46373
|
-
if (existsSync10(
|
|
46449
|
+
if (existsSync10(join22(SLACK_RECOVERY_OUTBOX_DIR, filename))) {
|
|
46374
46450
|
void processSlackRecoveryOutboxFile(filename);
|
|
46375
46451
|
}
|
|
46376
46452
|
});
|
|
@@ -46385,7 +46461,7 @@ function startSlackRecoveryOutboxWatcher() {
|
|
|
46385
46461
|
retryTimer.unref?.();
|
|
46386
46462
|
}
|
|
46387
46463
|
startSlackRecoveryOutboxWatcher();
|
|
46388
|
-
var SLACK_NOTICE_OUTBOX_DIR = SLACK_AGENT_DIR ?
|
|
46464
|
+
var SLACK_NOTICE_OUTBOX_DIR = SLACK_AGENT_DIR ? join22(SLACK_AGENT_DIR, "slack-notice-outbox") : null;
|
|
46389
46465
|
var SLACK_NOTICE_MAX_AGE_MS = 9e4;
|
|
46390
46466
|
var SLACK_NOTICE_INFLIGHT = /* @__PURE__ */ new Set();
|
|
46391
46467
|
async function processSlackNoticeOutboxFile(filename) {
|
|
@@ -46393,7 +46469,7 @@ async function processSlackNoticeOutboxFile(filename) {
|
|
|
46393
46469
|
if (filename.startsWith(".") || filename.endsWith(".tmp") || !filename.endsWith(".json")) return;
|
|
46394
46470
|
if (SLACK_NOTICE_INFLIGHT.has(filename)) return;
|
|
46395
46471
|
SLACK_NOTICE_INFLIGHT.add(filename);
|
|
46396
|
-
const fullPath =
|
|
46472
|
+
const fullPath = join22(SLACK_NOTICE_OUTBOX_DIR, filename);
|
|
46397
46473
|
try {
|
|
46398
46474
|
let mtimeMs;
|
|
46399
46475
|
try {
|
|
@@ -46410,7 +46486,7 @@ async function processSlackNoticeOutboxFile(filename) {
|
|
|
46410
46486
|
}
|
|
46411
46487
|
let payload;
|
|
46412
46488
|
try {
|
|
46413
|
-
const parsed = JSON.parse(
|
|
46489
|
+
const parsed = JSON.parse(readFileSync19(fullPath, "utf-8"));
|
|
46414
46490
|
if (!parsed || typeof parsed !== "object") throw new Error("not an object");
|
|
46415
46491
|
payload = parsed;
|
|
46416
46492
|
} catch {
|
|
@@ -46484,7 +46560,7 @@ async function processSlackNoticeOutboxFile(filename) {
|
|
|
46484
46560
|
function startSlackNoticeOutboxWatcher() {
|
|
46485
46561
|
if (!SLACK_NOTICE_OUTBOX_DIR) return;
|
|
46486
46562
|
try {
|
|
46487
|
-
|
|
46563
|
+
mkdirSync10(SLACK_NOTICE_OUTBOX_DIR, { recursive: true, mode: 448 });
|
|
46488
46564
|
} catch (err) {
|
|
46489
46565
|
process.stderr.write(
|
|
46490
46566
|
`slack-channel(${AGENT_CODE_NAME}): notice outbox mkdir failed: ${err.message}
|
|
@@ -46499,7 +46575,7 @@ function startSlackNoticeOutboxWatcher() {
|
|
|
46499
46575
|
try {
|
|
46500
46576
|
const watcher = watch(SLACK_NOTICE_OUTBOX_DIR, (event, filename) => {
|
|
46501
46577
|
if (event !== "rename" || !filename) return;
|
|
46502
|
-
if (existsSync10(
|
|
46578
|
+
if (existsSync10(join22(SLACK_NOTICE_OUTBOX_DIR, filename))) {
|
|
46503
46579
|
void processSlackNoticeOutboxFile(filename);
|
|
46504
46580
|
}
|
|
46505
46581
|
});
|
|
@@ -46520,11 +46596,11 @@ function trackPendingMessage(channel, threadTs, messageTs, undeliverable = false
|
|
|
46520
46596
|
function deadLetterSlackMarker(fullPath, filename) {
|
|
46521
46597
|
if (!SLACK_PENDING_INBOUND_STALE_DIR) return false;
|
|
46522
46598
|
try {
|
|
46523
|
-
|
|
46599
|
+
mkdirSync10(SLACK_PENDING_INBOUND_STALE_DIR, { recursive: true, mode: 448 });
|
|
46524
46600
|
} catch {
|
|
46525
46601
|
return false;
|
|
46526
46602
|
}
|
|
46527
|
-
const target =
|
|
46603
|
+
const target = join22(SLACK_PENDING_INBOUND_STALE_DIR, filename);
|
|
46528
46604
|
try {
|
|
46529
46605
|
if (!existsSync10(target)) {
|
|
46530
46606
|
renameSync5(fullPath, target);
|
|
@@ -46566,10 +46642,10 @@ function sweepSlackStaleMarkers(thresholdMs) {
|
|
|
46566
46642
|
capped = true;
|
|
46567
46643
|
break;
|
|
46568
46644
|
}
|
|
46569
|
-
const fullPath =
|
|
46645
|
+
const fullPath = join22(SLACK_PENDING_INBOUND_DIR, filename);
|
|
46570
46646
|
let marker;
|
|
46571
46647
|
try {
|
|
46572
|
-
marker = JSON.parse(
|
|
46648
|
+
marker = JSON.parse(readFileSync19(fullPath, "utf-8"));
|
|
46573
46649
|
} catch (err) {
|
|
46574
46650
|
process.stderr.write(
|
|
46575
46651
|
`slack-channel(${AGENT_CODE_NAME}): stale-marker parse failed for ${redactSlackId(filename)}: ${err.message}
|
|
@@ -46643,13 +46719,13 @@ var slackOrphanSweepTimer = setInterval(() => {
|
|
|
46643
46719
|
checkSlackWatchdogGiveUpNotice();
|
|
46644
46720
|
}, orphanSweepIntervalMs());
|
|
46645
46721
|
slackOrphanSweepTimer.unref?.();
|
|
46646
|
-
var SLACK_PROGRESS_HEARTBEAT_PATH = SLACK_AGENT_DIR ?
|
|
46722
|
+
var SLACK_PROGRESS_HEARTBEAT_PATH = SLACK_AGENT_DIR ? join22(SLACK_AGENT_DIR, "channel-progress-heartbeat.json") : null;
|
|
46647
46723
|
var slackTrackedProgress = null;
|
|
46648
46724
|
var slackProgressTickRunning = false;
|
|
46649
46725
|
function readSlackProgressHeartbeat() {
|
|
46650
46726
|
if (!SLACK_PROGRESS_HEARTBEAT_PATH || !existsSync10(SLACK_PROGRESS_HEARTBEAT_PATH)) return null;
|
|
46651
46727
|
try {
|
|
46652
|
-
return parseProgressHeartbeat(
|
|
46728
|
+
return parseProgressHeartbeat(readFileSync19(SLACK_PROGRESS_HEARTBEAT_PATH, "utf-8"));
|
|
46653
46729
|
} catch {
|
|
46654
46730
|
return null;
|
|
46655
46731
|
}
|
|
@@ -46676,7 +46752,7 @@ function findSlackProgressTarget() {
|
|
|
46676
46752
|
if (!name.endsWith(".json")) continue;
|
|
46677
46753
|
let m;
|
|
46678
46754
|
try {
|
|
46679
|
-
m = JSON.parse(
|
|
46755
|
+
m = JSON.parse(readFileSync19(join22(SLACK_PENDING_INBOUND_DIR, name), "utf-8"));
|
|
46680
46756
|
} catch {
|
|
46681
46757
|
continue;
|
|
46682
46758
|
}
|
|
@@ -46827,7 +46903,7 @@ function listPendingSlackConversations() {
|
|
|
46827
46903
|
if (!name.endsWith(".json")) continue;
|
|
46828
46904
|
try {
|
|
46829
46905
|
const marker = JSON.parse(
|
|
46830
|
-
|
|
46906
|
+
readFileSync19(join22(SLACK_PENDING_INBOUND_DIR, name), "utf8")
|
|
46831
46907
|
);
|
|
46832
46908
|
if (typeof marker.channel !== "string" || !marker.channel) continue;
|
|
46833
46909
|
if (typeof marker.thread_ts !== "string" || !marker.thread_ts) continue;
|
|
@@ -46965,7 +47041,7 @@ function postSlackWatchdogGiveUpNotice(channel, threadTs, isThreadReply, reason,
|
|
|
46965
47041
|
}
|
|
46966
47042
|
function checkSlackWatchdogGiveUpNotice() {
|
|
46967
47043
|
if (!SLACK_AGENT_DIR) return;
|
|
46968
|
-
const signal = readGiveUpSignal(
|
|
47044
|
+
const signal = readGiveUpSignal(join22(SLACK_AGENT_DIR, GIVE_UP_SIGNAL_FILENAME));
|
|
46969
47045
|
const signalAtMs = signal?.atMs ?? null;
|
|
46970
47046
|
const act = decideGiveUpNotice({
|
|
46971
47047
|
signalAtMs,
|
|
@@ -46998,7 +47074,7 @@ function readRestartTopicForMarker(filename, channel, threadTs) {
|
|
|
46998
47074
|
if (!SLACK_RESTART_CONTEXT_DIR) return null;
|
|
46999
47075
|
let raw;
|
|
47000
47076
|
try {
|
|
47001
|
-
raw =
|
|
47077
|
+
raw = readFileSync19(join22(SLACK_RESTART_CONTEXT_DIR, filename), "utf-8");
|
|
47002
47078
|
} catch {
|
|
47003
47079
|
return null;
|
|
47004
47080
|
}
|
|
@@ -47007,7 +47083,7 @@ function readRestartTopicForMarker(filename, channel, threadTs) {
|
|
|
47007
47083
|
function removeRestartContextHint(filename) {
|
|
47008
47084
|
if (!SLACK_RESTART_CONTEXT_DIR) return;
|
|
47009
47085
|
try {
|
|
47010
|
-
unlinkSync7(
|
|
47086
|
+
unlinkSync7(join22(SLACK_RESTART_CONTEXT_DIR, filename));
|
|
47011
47087
|
} catch {
|
|
47012
47088
|
}
|
|
47013
47089
|
}
|
|
@@ -47022,7 +47098,7 @@ function clearAllRestartContextHints() {
|
|
|
47022
47098
|
for (const name of names) {
|
|
47023
47099
|
if (!name.endsWith(".json")) continue;
|
|
47024
47100
|
try {
|
|
47025
|
-
unlinkSync7(
|
|
47101
|
+
unlinkSync7(join22(SLACK_RESTART_CONTEXT_DIR, name));
|
|
47026
47102
|
} catch {
|
|
47027
47103
|
}
|
|
47028
47104
|
}
|
|
@@ -47049,10 +47125,10 @@ async function notifyStrandedInboundsOnFirstConnect() {
|
|
|
47049
47125
|
let notified = 0;
|
|
47050
47126
|
for (const filename of filenames) {
|
|
47051
47127
|
if (!filename.endsWith(".json")) continue;
|
|
47052
|
-
const fullPath =
|
|
47128
|
+
const fullPath = join22(SLACK_PENDING_INBOUND_DIR, filename);
|
|
47053
47129
|
let marker;
|
|
47054
47130
|
try {
|
|
47055
|
-
marker = JSON.parse(
|
|
47131
|
+
marker = JSON.parse(readFileSync19(fullPath, "utf-8"));
|
|
47056
47132
|
} catch {
|
|
47057
47133
|
continue;
|
|
47058
47134
|
}
|
|
@@ -47226,7 +47302,7 @@ function noteThreadActivityByMessageTs(channel, messageTs) {
|
|
|
47226
47302
|
markSeenAllSlackPendingMarkersForThread2(channel, messageTs);
|
|
47227
47303
|
markSeenSlackPendingMarkerByMessageTs2(channel, messageTs);
|
|
47228
47304
|
}
|
|
47229
|
-
var RESTART_FLAGS_DIR =
|
|
47305
|
+
var RESTART_FLAGS_DIR = join22(homedir7(), ".augmented", "restart-flags");
|
|
47230
47306
|
function actuateHostRestartSlack() {
|
|
47231
47307
|
return actuateHostRestart({
|
|
47232
47308
|
agtHost: AGT_HOST,
|
|
@@ -47828,9 +47904,9 @@ async function handleSlashCommandEnvelope(payload) {
|
|
|
47828
47904
|
} else {
|
|
47829
47905
|
writeSlackRestartConfirm(confirmReply, payload.user_name);
|
|
47830
47906
|
if (!existsSync10(RESTART_FLAGS_DIR)) {
|
|
47831
|
-
|
|
47907
|
+
mkdirSync10(RESTART_FLAGS_DIR, { recursive: true });
|
|
47832
47908
|
}
|
|
47833
|
-
const flagPath =
|
|
47909
|
+
const flagPath = join22(RESTART_FLAGS_DIR, `${codeName}.flag`);
|
|
47834
47910
|
const flag = {
|
|
47835
47911
|
codeName,
|
|
47836
47912
|
source: "slack",
|
|
@@ -47971,9 +48047,9 @@ async function handleRestartCommand(opts) {
|
|
|
47971
48047
|
} else {
|
|
47972
48048
|
writeSlackRestartConfirm(confirmReply, opts.requesterName);
|
|
47973
48049
|
if (!existsSync10(RESTART_FLAGS_DIR)) {
|
|
47974
|
-
|
|
48050
|
+
mkdirSync10(RESTART_FLAGS_DIR, { recursive: true });
|
|
47975
48051
|
}
|
|
47976
|
-
const flagPath =
|
|
48052
|
+
const flagPath = join22(RESTART_FLAGS_DIR, `${codeName}.flag`);
|
|
47977
48053
|
const flag = {
|
|
47978
48054
|
codeName,
|
|
47979
48055
|
source: "slack",
|
|
@@ -48095,7 +48171,7 @@ var SLACK_HOT_THREAD_WINDOW_MS = parseHotThreadWindowMs(
|
|
|
48095
48171
|
);
|
|
48096
48172
|
function resolveThreadStorePath() {
|
|
48097
48173
|
if (!AGENT_CODE_NAME) return null;
|
|
48098
|
-
return
|
|
48174
|
+
return join22(homedir7(), ".augmented", AGENT_CODE_NAME, "slack-tracked-threads.json");
|
|
48099
48175
|
}
|
|
48100
48176
|
function parseTtlDays(raw) {
|
|
48101
48177
|
if (!raw) return void 0;
|
|
@@ -48134,9 +48210,9 @@ if (!BOT_TOKEN || !APP_TOKEN) {
|
|
|
48134
48210
|
var slackStderrLogStream = null;
|
|
48135
48211
|
if (AGENT_CODE_NAME) {
|
|
48136
48212
|
try {
|
|
48137
|
-
const logDir =
|
|
48138
|
-
|
|
48139
|
-
slackStderrLogStream = createWriteStream(
|
|
48213
|
+
const logDir = join22(homedir7(), ".augmented", AGENT_CODE_NAME);
|
|
48214
|
+
mkdirSync10(logDir, { recursive: true });
|
|
48215
|
+
slackStderrLogStream = createWriteStream(join22(logDir, "slack-channel-stderr.log"), {
|
|
48140
48216
|
flags: "a",
|
|
48141
48217
|
mode: 384
|
|
48142
48218
|
});
|
|
@@ -49120,7 +49196,7 @@ ${result.formatted}` : "No messages in range, or the bot is not a member of this
|
|
|
49120
49196
|
isError: true
|
|
49121
49197
|
};
|
|
49122
49198
|
}
|
|
49123
|
-
const allowedRoot = resolve2(
|
|
49199
|
+
const allowedRoot = resolve2(homedir7(), ".augmented", AGENT_CODE_NAME, "project") + "/";
|
|
49124
49200
|
const resolvedPath = resolve2(path);
|
|
49125
49201
|
if (!resolvedPath.startsWith(allowedRoot)) {
|
|
49126
49202
|
return {
|
|
@@ -49142,7 +49218,7 @@ ${result.formatted}` : "No messages in range, or the bot is not a member of this
|
|
|
49142
49218
|
};
|
|
49143
49219
|
}
|
|
49144
49220
|
size = stat2.size;
|
|
49145
|
-
bytes =
|
|
49221
|
+
bytes = readFileSync19(resolvedPath);
|
|
49146
49222
|
} catch (err) {
|
|
49147
49223
|
return {
|
|
49148
49224
|
content: [{ type: "text", text: `Failed to read file: ${err.message}` }],
|
|
@@ -49810,7 +49886,7 @@ function isDownloadableFileId(fileId, channel) {
|
|
|
49810
49886
|
}
|
|
49811
49887
|
function redactAugmentedPaths2(msg) {
|
|
49812
49888
|
return msg.replaceAll(
|
|
49813
|
-
new RegExp(`${
|
|
49889
|
+
new RegExp(`${homedir7().replace(/[.*+?^${}()|[\\]\\\\]/g, "\\\\$&")}/\\.augmented/[^\\s'"\`]*`, "g"),
|
|
49814
49890
|
"<augmented-path>"
|
|
49815
49891
|
);
|
|
49816
49892
|
}
|
|
@@ -49868,7 +49944,7 @@ async function downloadSlackFile(fileId, codeName) {
|
|
|
49868
49944
|
if (!isPathInside(savedPath, dir)) {
|
|
49869
49945
|
throw new Error(`refusing to write ${savedPath} outside ${dir}`);
|
|
49870
49946
|
}
|
|
49871
|
-
|
|
49947
|
+
mkdirSync10(dir, { recursive: true });
|
|
49872
49948
|
writeFileSync14(savedPath, bytes, { mode: 384 });
|
|
49873
49949
|
try {
|
|
49874
49950
|
chmodSync(savedPath, 384);
|
|
@@ -49941,7 +50017,7 @@ async function replayPendingSlackMarkers() {
|
|
|
49941
50017
|
let paneFreshAgeMs = null;
|
|
49942
50018
|
if (SLACK_AGENT_DIR) {
|
|
49943
50019
|
try {
|
|
49944
|
-
paneFreshAgeMs = Math.max(0, now - statSync5(
|
|
50020
|
+
paneFreshAgeMs = Math.max(0, now - statSync5(join22(SLACK_AGENT_DIR, "pane.log")).mtimeMs);
|
|
49945
50021
|
} catch {
|
|
49946
50022
|
}
|
|
49947
50023
|
}
|
|
@@ -49949,10 +50025,10 @@ async function replayPendingSlackMarkers() {
|
|
|
49949
50025
|
const entries = [];
|
|
49950
50026
|
for (const name of filenames) {
|
|
49951
50027
|
if (!name.endsWith(".json") || name.endsWith(".tmp")) continue;
|
|
49952
|
-
const fullPath =
|
|
50028
|
+
const fullPath = join22(SLACK_PENDING_INBOUND_DIR, name);
|
|
49953
50029
|
let marker;
|
|
49954
50030
|
try {
|
|
49955
|
-
marker = JSON.parse(
|
|
50031
|
+
marker = JSON.parse(readFileSync19(fullPath, "utf-8"));
|
|
49956
50032
|
} catch {
|
|
49957
50033
|
continue;
|
|
49958
50034
|
}
|
|
@@ -49986,6 +50062,7 @@ async function replayPendingSlackMarkers() {
|
|
|
49986
50062
|
...payload,
|
|
49987
50063
|
meta: { ...payload.meta, replayed: "true" }
|
|
49988
50064
|
};
|
|
50065
|
+
writeUnattributedTurnMarker("slack");
|
|
49989
50066
|
try {
|
|
49990
50067
|
await mcp.notification({
|
|
49991
50068
|
method: "notifications/claude/channel",
|
|
@@ -50094,12 +50171,12 @@ function armOpenWatchdog(ws) {
|
|
|
50094
50171
|
function socketDownForMs() {
|
|
50095
50172
|
return reconnectScheduler.downForMs(isSocketConnected());
|
|
50096
50173
|
}
|
|
50097
|
-
var SLACK_SOCKET_STATE_PATH = SLACK_AGENT_DIR ?
|
|
50174
|
+
var SLACK_SOCKET_STATE_PATH = SLACK_AGENT_DIR ? join22(SLACK_AGENT_DIR, SLACK_SOCKET_STATE_FILENAME) : null;
|
|
50098
50175
|
function publishSocketState() {
|
|
50099
50176
|
if (!SLACK_SOCKET_STATE_PATH || !SLACK_AGENT_DIR) return;
|
|
50100
50177
|
const tmp = `${SLACK_SOCKET_STATE_PATH}.${process.pid}.tmp`;
|
|
50101
50178
|
try {
|
|
50102
|
-
|
|
50179
|
+
mkdirSync10(SLACK_AGENT_DIR, { recursive: true, mode: 448 });
|
|
50103
50180
|
writeFileSync14(
|
|
50104
50181
|
tmp,
|
|
50105
50182
|
serializeSlackSocketState({
|
|
@@ -50701,7 +50778,7 @@ async function connectSocketMode() {
|
|
|
50701
50778
|
let paneLogFreshAgeMs = null;
|
|
50702
50779
|
if (SLACK_AGENT_DIR) {
|
|
50703
50780
|
try {
|
|
50704
|
-
const paneMtimeMs = statSync5(
|
|
50781
|
+
const paneMtimeMs = statSync5(join22(SLACK_AGENT_DIR, "pane.log")).mtimeMs;
|
|
50705
50782
|
paneLogFreshAgeMs = Math.max(0, Date.now() - paneMtimeMs);
|
|
50706
50783
|
} catch {
|
|
50707
50784
|
}
|
|
@@ -50871,9 +50948,15 @@ async function connectSocketMode() {
|
|
|
50871
50948
|
channel: "slack",
|
|
50872
50949
|
sender_id: evt.user,
|
|
50873
50950
|
sender_name: userName,
|
|
50874
|
-
channel_ref: threadTs
|
|
50951
|
+
channel_ref: threadTs,
|
|
50952
|
+
// ENG-11348: only a 1:1 IM (`D…`) is one-to-one; a channel or group DM is not.
|
|
50953
|
+
chat_kind: isSlackDirectMessage(channel) ? "direct" : "group",
|
|
50954
|
+
// ENG-11348: the server verifies the asker with Slack using this.
|
|
50955
|
+
chat_id: channel
|
|
50875
50956
|
});
|
|
50876
50957
|
clearScheduledTurnMarker(SLACK_AGENT_DIR);
|
|
50958
|
+
} else {
|
|
50959
|
+
writeUnattributedTurnMarker("slack");
|
|
50877
50960
|
}
|
|
50878
50961
|
const dispatchedAtMs = Date.now();
|
|
50879
50962
|
await mcp.notification({
|