@integrity-labs/agt-cli 0.28.435 → 0.28.437
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 +4 -4
- package/dist/{chunk-VIOLJEBT.js → chunk-7C3W6FP7.js} +3 -3
- package/dist/{chunk-ZLFZXMNL.js → chunk-MOASN7XT.js} +30 -9
- package/dist/chunk-MOASN7XT.js.map +1 -0
- package/dist/{claude-pair-runtime-CHKX4WH2.js → claude-pair-runtime-QDNXOLED.js} +2 -2
- package/dist/lib/manager-worker.js +10 -10
- package/dist/mcp/direct-chat-channel.js +26 -8
- package/dist/mcp/origami.js +26 -8
- package/dist/mcp/slack-channel.js +26 -8
- package/dist/mcp/telegram-channel.js +88 -14
- package/dist/{persistent-session-D2POY3KV.js → persistent-session-2TTEAJDH.js} +2 -2
- package/dist/{responsiveness-probe-ARRF5CAQ.js → responsiveness-probe-PMDNQ4J4.js} +2 -2
- package/package.json +1 -1
- package/dist/chunk-ZLFZXMNL.js.map +0 -1
- /package/dist/{chunk-VIOLJEBT.js.map → chunk-7C3W6FP7.js.map} +0 -0
- /package/dist/{claude-pair-runtime-CHKX4WH2.js.map → claude-pair-runtime-QDNXOLED.js.map} +0 -0
- /package/dist/{persistent-session-D2POY3KV.js.map → persistent-session-2TTEAJDH.js.map} +0 -0
- /package/dist/{responsiveness-probe-ARRF5CAQ.js.map → responsiveness-probe-PMDNQ4J4.js.map} +0 -0
|
@@ -100,7 +100,7 @@ async function spawnPairSession(session) {
|
|
|
100
100
|
return { ok: true };
|
|
101
101
|
} catch {
|
|
102
102
|
}
|
|
103
|
-
const { resolveClaudeBinary } = await import("./persistent-session-
|
|
103
|
+
const { resolveClaudeBinary } = await import("./persistent-session-2TTEAJDH.js");
|
|
104
104
|
const claudeBin = resolveClaudeBinary();
|
|
105
105
|
const pairEnv = {
|
|
106
106
|
...process.env,
|
|
@@ -373,4 +373,4 @@ export {
|
|
|
373
373
|
startClaudePair,
|
|
374
374
|
submitClaudePairCode
|
|
375
375
|
};
|
|
376
|
-
//# sourceMappingURL=claude-pair-runtime-
|
|
376
|
+
//# sourceMappingURL=claude-pair-runtime-QDNXOLED.js.map
|
|
@@ -42,7 +42,7 @@ import {
|
|
|
42
42
|
resolveEffectivePinRaw,
|
|
43
43
|
safeWriteJsonAtomic,
|
|
44
44
|
setConfigHash
|
|
45
|
-
} from "../chunk-
|
|
45
|
+
} from "../chunk-7C3W6FP7.js";
|
|
46
46
|
import {
|
|
47
47
|
getProjectDir as getProjectDir2,
|
|
48
48
|
getReadyTasks,
|
|
@@ -155,7 +155,7 @@ import {
|
|
|
155
155
|
transcriptActivityAgeSeconds,
|
|
156
156
|
writeEgressAllowlist,
|
|
157
157
|
writeUsageLimitMarker
|
|
158
|
-
} from "../chunk-
|
|
158
|
+
} from "../chunk-MOASN7XT.js";
|
|
159
159
|
import {
|
|
160
160
|
reapOrphanChannelMcps
|
|
161
161
|
} from "../chunk-XWVM4KPK.js";
|
|
@@ -9667,7 +9667,7 @@ var agentRestartTimezoneInputs = /* @__PURE__ */ new Map();
|
|
|
9667
9667
|
var lastVersionCheckAt = 0;
|
|
9668
9668
|
var VERSION_CHECK_INTERVAL_MS = 5 * 60 * 1e3;
|
|
9669
9669
|
var lastResponsivenessProbeAt = 0;
|
|
9670
|
-
var agtCliVersion = true ? "0.28.
|
|
9670
|
+
var agtCliVersion = true ? "0.28.437" : "dev";
|
|
9671
9671
|
function resolveBrewPath(execFileSync2) {
|
|
9672
9672
|
try {
|
|
9673
9673
|
const out = execFileSync2("which", ["brew"], { timeout: 5e3 }).toString().trim();
|
|
@@ -10825,7 +10825,7 @@ function flushRestartedAgentDiagnostics(hostId, codeNames) {
|
|
|
10825
10825
|
if (codeNames.length === 0) return;
|
|
10826
10826
|
void (async () => {
|
|
10827
10827
|
try {
|
|
10828
|
-
const { collectDiagnostics } = await import("../persistent-session-
|
|
10828
|
+
const { collectDiagnostics } = await import("../persistent-session-2TTEAJDH.js");
|
|
10829
10829
|
await api.post("/host/heartbeat", {
|
|
10830
10830
|
host_id: hostId,
|
|
10831
10831
|
agent_diagnostics: collectDiagnostics(codeNames, quarantineEntriesFor, claudeMdSizeFor)
|
|
@@ -10932,7 +10932,7 @@ async function pollCycle() {
|
|
|
10932
10932
|
}
|
|
10933
10933
|
try {
|
|
10934
10934
|
const { detectHostSecurity } = await import("../host-security-6PDFG7F5.js");
|
|
10935
|
-
const { collectDiagnostics } = await import("../persistent-session-
|
|
10935
|
+
const { collectDiagnostics } = await import("../persistent-session-2TTEAJDH.js");
|
|
10936
10936
|
const diagCodeNames = [...agentState.persistentSessionAgents];
|
|
10937
10937
|
const agentDiagnostics = diagCodeNames.length > 0 ? collectDiagnostics(diagCodeNames, quarantineEntriesFor, claudeMdSizeFor) : void 0;
|
|
10938
10938
|
let tailscaleHostname;
|
|
@@ -11046,7 +11046,7 @@ async function pollCycle() {
|
|
|
11046
11046
|
collectResponsivenessProbes,
|
|
11047
11047
|
collectPanelessActivityProbes,
|
|
11048
11048
|
getResponsivenessIntervalMs
|
|
11049
|
-
} = await import("../responsiveness-probe-
|
|
11049
|
+
} = await import("../responsiveness-probe-PMDNQ4J4.js");
|
|
11050
11050
|
const probeIntervalMs = getResponsivenessIntervalMs();
|
|
11051
11051
|
if (now - lastResponsivenessProbeAt > probeIntervalMs) {
|
|
11052
11052
|
const probeCodeNames = [...agentState.persistentSessionAgents];
|
|
@@ -11110,7 +11110,7 @@ async function pollCycle() {
|
|
|
11110
11110
|
collectResponsivenessProbes,
|
|
11111
11111
|
livePendingInboundOldestAgeSeconds,
|
|
11112
11112
|
parkPendingInbound
|
|
11113
|
-
} = await import("../responsiveness-probe-
|
|
11113
|
+
} = await import("../responsiveness-probe-PMDNQ4J4.js");
|
|
11114
11114
|
const { getProjectDir: wedgeProjectDir } = await import("../scheduler-engine-NDP36U7O.js");
|
|
11115
11115
|
const wedgeNow = /* @__PURE__ */ new Date();
|
|
11116
11116
|
const liveAgents = agentState.persistentSessionAgents;
|
|
@@ -14428,7 +14428,7 @@ async function handleRestartDoorbell(agentId, requestedAt, restartReason) {
|
|
|
14428
14428
|
void api.post("/host/restart-ack", { host_id: hostId, agent_id: agentId, restart_requested_at: requestedAt }).catch((err) => log(`[restart-lane] ack failed for '${codeName}': ${err.message}`));
|
|
14429
14429
|
void (async () => {
|
|
14430
14430
|
try {
|
|
14431
|
-
const { collectDiagnostics } = await import("../persistent-session-
|
|
14431
|
+
const { collectDiagnostics } = await import("../persistent-session-2TTEAJDH.js");
|
|
14432
14432
|
await api.post("/host/heartbeat", {
|
|
14433
14433
|
host_id: hostId,
|
|
14434
14434
|
agent_diagnostics: collectDiagnostics([codeName], quarantineEntriesFor, claudeMdSizeFor)
|
|
@@ -14478,7 +14478,7 @@ async function respawnAgentAfterMcpStop(codeName, reason) {
|
|
|
14478
14478
|
}
|
|
14479
14479
|
try {
|
|
14480
14480
|
const hostId = await getHostId();
|
|
14481
|
-
const { collectDiagnostics } = await import("../persistent-session-
|
|
14481
|
+
const { collectDiagnostics } = await import("../persistent-session-2TTEAJDH.js");
|
|
14482
14482
|
await api.post("/host/heartbeat", {
|
|
14483
14483
|
host_id: hostId,
|
|
14484
14484
|
agent_diagnostics: collectDiagnostics([codeName], quarantineEntriesFor, claudeMdSizeFor)
|
|
@@ -14931,7 +14931,7 @@ async function processClaudePairSessions(agents) {
|
|
|
14931
14931
|
killPairSession,
|
|
14932
14932
|
pairTmuxSession,
|
|
14933
14933
|
finalizeClaudePairOnboarding
|
|
14934
|
-
} = await import("../claude-pair-runtime-
|
|
14934
|
+
} = await import("../claude-pair-runtime-QDNXOLED.js");
|
|
14935
14935
|
for (const pairId of pendingResp.cancelled_pair_ids ?? []) {
|
|
14936
14936
|
log(`[claude-pair] sweeping orphan tmux session for pair ${pairId.slice(0, 8)}`);
|
|
14937
14937
|
const killed = await killPairSession(pairTmuxSession(pairId));
|
|
@@ -33942,16 +33942,27 @@ var INTEGRATION_REGISTRY = [
|
|
|
33942
33942
|
// Premium (billable). The upstream pay-per-event cost is per-Actor and
|
|
33943
33943
|
// VARIABLE (each Actor's creator sets its own event prices), unlike X-Search's
|
|
33944
33944
|
// fixed per-post price. So we meter the ACTUAL cost charged to us for each
|
|
33945
|
-
// run, as a pass-through: `units` = the run's `usageTotalUsd` in
|
|
33946
|
-
//
|
|
33947
|
-
// a managed markup (1.5x
|
|
33948
|
-
//
|
|
33945
|
+
// run, as a pass-through: `units` = the run's `usageTotalUsd` in US dollars
|
|
33946
|
+
// (the physical unit `usd`), and the rate card prices each of those dollars at
|
|
33947
|
+
// a managed markup (1.5x). This keeps margin safe across cheap and expensive
|
|
33948
|
+
// scrapes alike. `event_type` must match what the broker writes to
|
|
33949
33949
|
// integration_usage_events. Until the rate row is seeded a run prices at 0
|
|
33950
33950
|
// (budget gate inert) - the rate-card migration ships in the same PR.
|
|
33951
|
+
//
|
|
33952
|
+
// The unit is US DOLLARS, not cents. Metering in cents priced the meter at
|
|
33953
|
+
// A$0.0225/unit, which rendered to the customer as "Actor Run (per usd_cent):
|
|
33954
|
+
// A$0.02" - jargon, and rounded 11% below the real rate because the shared
|
|
33955
|
+
// formatter only widens past 2dp below A$0.01. Per-dollar gives a whole-cent
|
|
33956
|
+
// price and a line a customer can reason about; the money billed is identical.
|
|
33951
33957
|
premium: {
|
|
33952
33958
|
pricing: "usage",
|
|
33953
|
-
note: "Billed
|
|
33954
|
-
meters: [{
|
|
33959
|
+
note: "Billed on the upstream pay-per-event cost of each scrape, at a managed markup. A 50-post TikTok scrape costs about A$0.19.",
|
|
33960
|
+
meters: [{
|
|
33961
|
+
event_type: "actor_run",
|
|
33962
|
+
unit: "usd",
|
|
33963
|
+
label: "Scraping usage",
|
|
33964
|
+
unit_label: "US$1 of scraping cost"
|
|
33965
|
+
}]
|
|
33955
33966
|
}
|
|
33956
33967
|
},
|
|
33957
33968
|
{
|
|
@@ -33974,10 +33985,17 @@ var INTEGRATION_REGISTRY = [
|
|
|
33974
33985
|
],
|
|
33975
33986
|
docs_url: "https://docs.apify.com/api/v2",
|
|
33976
33987
|
beta: true,
|
|
33988
|
+
// Same cost pass-through metering as Social Scraping - see the note there for
|
|
33989
|
+
// why the unit is US dollars rather than cents.
|
|
33977
33990
|
premium: {
|
|
33978
33991
|
pricing: "usage",
|
|
33979
|
-
note: "Billed
|
|
33980
|
-
meters: [{
|
|
33992
|
+
note: "Billed on the upstream pay-per-event cost of each search, at a managed markup. A 20-place search costs about A$0.07.",
|
|
33993
|
+
meters: [{
|
|
33994
|
+
event_type: "actor_run",
|
|
33995
|
+
unit: "usd",
|
|
33996
|
+
label: "Search usage",
|
|
33997
|
+
unit_label: "US$1 of search cost"
|
|
33998
|
+
}]
|
|
33981
33999
|
}
|
|
33982
34000
|
},
|
|
33983
34001
|
{
|
package/dist/mcp/origami.js
CHANGED
|
@@ -39580,16 +39580,27 @@ var INTEGRATION_REGISTRY = [
|
|
|
39580
39580
|
// Premium (billable). The upstream pay-per-event cost is per-Actor and
|
|
39581
39581
|
// VARIABLE (each Actor's creator sets its own event prices), unlike X-Search's
|
|
39582
39582
|
// fixed per-post price. So we meter the ACTUAL cost charged to us for each
|
|
39583
|
-
// run, as a pass-through: `units` = the run's `usageTotalUsd` in
|
|
39584
|
-
//
|
|
39585
|
-
// a managed markup (1.5x
|
|
39586
|
-
//
|
|
39583
|
+
// run, as a pass-through: `units` = the run's `usageTotalUsd` in US dollars
|
|
39584
|
+
// (the physical unit `usd`), and the rate card prices each of those dollars at
|
|
39585
|
+
// a managed markup (1.5x). This keeps margin safe across cheap and expensive
|
|
39586
|
+
// scrapes alike. `event_type` must match what the broker writes to
|
|
39587
39587
|
// integration_usage_events. Until the rate row is seeded a run prices at 0
|
|
39588
39588
|
// (budget gate inert) - the rate-card migration ships in the same PR.
|
|
39589
|
+
//
|
|
39590
|
+
// The unit is US DOLLARS, not cents. Metering in cents priced the meter at
|
|
39591
|
+
// A$0.0225/unit, which rendered to the customer as "Actor Run (per usd_cent):
|
|
39592
|
+
// A$0.02" - jargon, and rounded 11% below the real rate because the shared
|
|
39593
|
+
// formatter only widens past 2dp below A$0.01. Per-dollar gives a whole-cent
|
|
39594
|
+
// price and a line a customer can reason about; the money billed is identical.
|
|
39589
39595
|
premium: {
|
|
39590
39596
|
pricing: "usage",
|
|
39591
|
-
note: "Billed
|
|
39592
|
-
meters: [{
|
|
39597
|
+
note: "Billed on the upstream pay-per-event cost of each scrape, at a managed markup. A 50-post TikTok scrape costs about A$0.19.",
|
|
39598
|
+
meters: [{
|
|
39599
|
+
event_type: "actor_run",
|
|
39600
|
+
unit: "usd",
|
|
39601
|
+
label: "Scraping usage",
|
|
39602
|
+
unit_label: "US$1 of scraping cost"
|
|
39603
|
+
}]
|
|
39593
39604
|
}
|
|
39594
39605
|
},
|
|
39595
39606
|
{
|
|
@@ -39612,10 +39623,17 @@ var INTEGRATION_REGISTRY = [
|
|
|
39612
39623
|
],
|
|
39613
39624
|
docs_url: "https://docs.apify.com/api/v2",
|
|
39614
39625
|
beta: true,
|
|
39626
|
+
// Same cost pass-through metering as Social Scraping - see the note there for
|
|
39627
|
+
// why the unit is US dollars rather than cents.
|
|
39615
39628
|
premium: {
|
|
39616
39629
|
pricing: "usage",
|
|
39617
|
-
note: "Billed
|
|
39618
|
-
meters: [{
|
|
39630
|
+
note: "Billed on the upstream pay-per-event cost of each search, at a managed markup. A 20-place search costs about A$0.07.",
|
|
39631
|
+
meters: [{
|
|
39632
|
+
event_type: "actor_run",
|
|
39633
|
+
unit: "usd",
|
|
39634
|
+
label: "Search usage",
|
|
39635
|
+
unit_label: "US$1 of search cost"
|
|
39636
|
+
}]
|
|
39619
39637
|
}
|
|
39620
39638
|
},
|
|
39621
39639
|
{
|
|
@@ -33511,16 +33511,27 @@ var INTEGRATION_REGISTRY = [
|
|
|
33511
33511
|
// Premium (billable). The upstream pay-per-event cost is per-Actor and
|
|
33512
33512
|
// VARIABLE (each Actor's creator sets its own event prices), unlike X-Search's
|
|
33513
33513
|
// fixed per-post price. So we meter the ACTUAL cost charged to us for each
|
|
33514
|
-
// run, as a pass-through: `units` = the run's `usageTotalUsd` in
|
|
33515
|
-
//
|
|
33516
|
-
// a managed markup (1.5x
|
|
33517
|
-
//
|
|
33514
|
+
// run, as a pass-through: `units` = the run's `usageTotalUsd` in US dollars
|
|
33515
|
+
// (the physical unit `usd`), and the rate card prices each of those dollars at
|
|
33516
|
+
// a managed markup (1.5x). This keeps margin safe across cheap and expensive
|
|
33517
|
+
// scrapes alike. `event_type` must match what the broker writes to
|
|
33518
33518
|
// integration_usage_events. Until the rate row is seeded a run prices at 0
|
|
33519
33519
|
// (budget gate inert) - the rate-card migration ships in the same PR.
|
|
33520
|
+
//
|
|
33521
|
+
// The unit is US DOLLARS, not cents. Metering in cents priced the meter at
|
|
33522
|
+
// A$0.0225/unit, which rendered to the customer as "Actor Run (per usd_cent):
|
|
33523
|
+
// A$0.02" - jargon, and rounded 11% below the real rate because the shared
|
|
33524
|
+
// formatter only widens past 2dp below A$0.01. Per-dollar gives a whole-cent
|
|
33525
|
+
// price and a line a customer can reason about; the money billed is identical.
|
|
33520
33526
|
premium: {
|
|
33521
33527
|
pricing: "usage",
|
|
33522
|
-
note: "Billed
|
|
33523
|
-
meters: [{
|
|
33528
|
+
note: "Billed on the upstream pay-per-event cost of each scrape, at a managed markup. A 50-post TikTok scrape costs about A$0.19.",
|
|
33529
|
+
meters: [{
|
|
33530
|
+
event_type: "actor_run",
|
|
33531
|
+
unit: "usd",
|
|
33532
|
+
label: "Scraping usage",
|
|
33533
|
+
unit_label: "US$1 of scraping cost"
|
|
33534
|
+
}]
|
|
33524
33535
|
}
|
|
33525
33536
|
},
|
|
33526
33537
|
{
|
|
@@ -33543,10 +33554,17 @@ var INTEGRATION_REGISTRY = [
|
|
|
33543
33554
|
],
|
|
33544
33555
|
docs_url: "https://docs.apify.com/api/v2",
|
|
33545
33556
|
beta: true,
|
|
33557
|
+
// Same cost pass-through metering as Social Scraping - see the note there for
|
|
33558
|
+
// why the unit is US dollars rather than cents.
|
|
33546
33559
|
premium: {
|
|
33547
33560
|
pricing: "usage",
|
|
33548
|
-
note: "Billed
|
|
33549
|
-
meters: [{
|
|
33561
|
+
note: "Billed on the upstream pay-per-event cost of each search, at a managed markup. A 20-place search costs about A$0.07.",
|
|
33562
|
+
meters: [{
|
|
33563
|
+
event_type: "actor_run",
|
|
33564
|
+
unit: "usd",
|
|
33565
|
+
label: "Search usage",
|
|
33566
|
+
unit_label: "US$1 of search cost"
|
|
33567
|
+
}]
|
|
33550
33568
|
}
|
|
33551
33569
|
},
|
|
33552
33570
|
{
|
|
@@ -33813,16 +33813,27 @@ var INTEGRATION_REGISTRY = [
|
|
|
33813
33813
|
// Premium (billable). The upstream pay-per-event cost is per-Actor and
|
|
33814
33814
|
// VARIABLE (each Actor's creator sets its own event prices), unlike X-Search's
|
|
33815
33815
|
// fixed per-post price. So we meter the ACTUAL cost charged to us for each
|
|
33816
|
-
// run, as a pass-through: `units` = the run's `usageTotalUsd` in
|
|
33817
|
-
//
|
|
33818
|
-
// a managed markup (1.5x
|
|
33819
|
-
//
|
|
33816
|
+
// run, as a pass-through: `units` = the run's `usageTotalUsd` in US dollars
|
|
33817
|
+
// (the physical unit `usd`), and the rate card prices each of those dollars at
|
|
33818
|
+
// a managed markup (1.5x). This keeps margin safe across cheap and expensive
|
|
33819
|
+
// scrapes alike. `event_type` must match what the broker writes to
|
|
33820
33820
|
// integration_usage_events. Until the rate row is seeded a run prices at 0
|
|
33821
33821
|
// (budget gate inert) - the rate-card migration ships in the same PR.
|
|
33822
|
+
//
|
|
33823
|
+
// The unit is US DOLLARS, not cents. Metering in cents priced the meter at
|
|
33824
|
+
// A$0.0225/unit, which rendered to the customer as "Actor Run (per usd_cent):
|
|
33825
|
+
// A$0.02" - jargon, and rounded 11% below the real rate because the shared
|
|
33826
|
+
// formatter only widens past 2dp below A$0.01. Per-dollar gives a whole-cent
|
|
33827
|
+
// price and a line a customer can reason about; the money billed is identical.
|
|
33822
33828
|
premium: {
|
|
33823
33829
|
pricing: "usage",
|
|
33824
|
-
note: "Billed
|
|
33825
|
-
meters: [{
|
|
33830
|
+
note: "Billed on the upstream pay-per-event cost of each scrape, at a managed markup. A 50-post TikTok scrape costs about A$0.19.",
|
|
33831
|
+
meters: [{
|
|
33832
|
+
event_type: "actor_run",
|
|
33833
|
+
unit: "usd",
|
|
33834
|
+
label: "Scraping usage",
|
|
33835
|
+
unit_label: "US$1 of scraping cost"
|
|
33836
|
+
}]
|
|
33826
33837
|
}
|
|
33827
33838
|
},
|
|
33828
33839
|
{
|
|
@@ -33845,10 +33856,17 @@ var INTEGRATION_REGISTRY = [
|
|
|
33845
33856
|
],
|
|
33846
33857
|
docs_url: "https://docs.apify.com/api/v2",
|
|
33847
33858
|
beta: true,
|
|
33859
|
+
// Same cost pass-through metering as Social Scraping - see the note there for
|
|
33860
|
+
// why the unit is US dollars rather than cents.
|
|
33848
33861
|
premium: {
|
|
33849
33862
|
pricing: "usage",
|
|
33850
|
-
note: "Billed
|
|
33851
|
-
meters: [{
|
|
33863
|
+
note: "Billed on the upstream pay-per-event cost of each search, at a managed markup. A 20-place search costs about A$0.07.",
|
|
33864
|
+
meters: [{
|
|
33865
|
+
event_type: "actor_run",
|
|
33866
|
+
unit: "usd",
|
|
33867
|
+
label: "Search usage",
|
|
33868
|
+
unit_label: "US$1 of search cost"
|
|
33869
|
+
}]
|
|
33852
33870
|
}
|
|
33853
33871
|
},
|
|
33854
33872
|
{
|
|
@@ -35640,18 +35658,39 @@ function createPeerRateLimiter(config2 = DEFAULT_RATE_LIMITER_CONFIG) {
|
|
|
35640
35658
|
}
|
|
35641
35659
|
};
|
|
35642
35660
|
}
|
|
35643
|
-
function createPresenceTracker() {
|
|
35661
|
+
function createPresenceTracker(opts = {}) {
|
|
35662
|
+
const retainMs = opts.retainMs ?? DAY_MS;
|
|
35644
35663
|
const lastHumanByChat = /* @__PURE__ */ new Map();
|
|
35664
|
+
for (const [chatId, at] of Object.entries(opts.initial ?? {})) {
|
|
35665
|
+
if (typeof at === "number" && Number.isFinite(at)) lastHumanByChat.set(chatId, at);
|
|
35666
|
+
}
|
|
35667
|
+
const snapshot = (now = Date.now()) => {
|
|
35668
|
+
const out = {};
|
|
35669
|
+
for (const [chatId, at] of lastHumanByChat) {
|
|
35670
|
+
if (now - at < retainMs) out[chatId] = at;
|
|
35671
|
+
}
|
|
35672
|
+
return out;
|
|
35673
|
+
};
|
|
35645
35674
|
return {
|
|
35646
35675
|
noteInbound(chatId, kind, now) {
|
|
35647
|
-
if (kind
|
|
35676
|
+
if (kind !== "human") return;
|
|
35677
|
+
const prev = lastHumanByChat.get(chatId);
|
|
35678
|
+
if (prev !== void 0 && prev >= now) return;
|
|
35679
|
+
lastHumanByChat.set(chatId, now);
|
|
35680
|
+
if (opts.onChange) {
|
|
35681
|
+
try {
|
|
35682
|
+
opts.onChange(snapshot(now));
|
|
35683
|
+
} catch {
|
|
35684
|
+
}
|
|
35685
|
+
}
|
|
35648
35686
|
},
|
|
35649
35687
|
shouldDropOutgress(chatId, now, maxAgeMs = 30 * MINUTE_MS) {
|
|
35650
35688
|
const last = lastHumanByChat.get(chatId);
|
|
35651
35689
|
if (last === void 0) return "no_human_recent";
|
|
35652
35690
|
if (now - last >= maxAgeMs) return "no_human_recent";
|
|
35653
35691
|
return null;
|
|
35654
|
-
}
|
|
35692
|
+
},
|
|
35693
|
+
snapshot
|
|
35655
35694
|
};
|
|
35656
35695
|
}
|
|
35657
35696
|
|
|
@@ -37932,6 +37971,10 @@ if (PEER_DISABLED_MODE !== "off") {
|
|
|
37932
37971
|
);
|
|
37933
37972
|
}
|
|
37934
37973
|
PEER_CLASSIFIER_CONFIG.peer_disabled_mode = PEER_DISABLED_MODE;
|
|
37974
|
+
function peerSurfaceActiveOnChat(chatId) {
|
|
37975
|
+
if (!chatId.startsWith("-")) return false;
|
|
37976
|
+
return PEER_CLASSIFIER_CONFIG.peer_agent_mode !== "off" && PEER_CLASSIFIER_CONFIG.peer_group_ids.length > 0 && PEER_CLASSIFIER_CONFIG.peer_group_ids.includes(chatId);
|
|
37977
|
+
}
|
|
37935
37978
|
var crossTeamPeerAuditClient = createCrossTeamPeerAuditClient({
|
|
37936
37979
|
agtHost: AGT_HOST,
|
|
37937
37980
|
agtApiKey: AGT_API_KEY,
|
|
@@ -37990,7 +38033,35 @@ var peerRateLimiter = peerRateApiClient && parsePeerAgentModeEnv(process.env.TEL
|
|
|
37990
38033
|
log: (line) => process.stderr.write(`telegram-channel(${AGENT_CODE_NAME}): ${line}
|
|
37991
38034
|
`)
|
|
37992
38035
|
}) : createPeerRateLimiter();
|
|
37993
|
-
var
|
|
38036
|
+
var PEER_PRESENCE_STATE_FILE = TELEGRAM_AGENT_DIR ? join15(TELEGRAM_AGENT_DIR, "telegram-peer-presence.json") : null;
|
|
38037
|
+
function readPeerPresenceState() {
|
|
38038
|
+
if (!PEER_PRESENCE_STATE_FILE) return null;
|
|
38039
|
+
try {
|
|
38040
|
+
const parsed = JSON.parse(readFileSync15(PEER_PRESENCE_STATE_FILE, "utf-8"));
|
|
38041
|
+
if (!parsed || typeof parsed !== "object" || Array.isArray(parsed)) return null;
|
|
38042
|
+
return parsed;
|
|
38043
|
+
} catch {
|
|
38044
|
+
return null;
|
|
38045
|
+
}
|
|
38046
|
+
}
|
|
38047
|
+
function writePeerPresenceState(snapshot) {
|
|
38048
|
+
if (!PEER_PRESENCE_STATE_FILE || !TELEGRAM_AGENT_DIR) return;
|
|
38049
|
+
const tmp = `${PEER_PRESENCE_STATE_FILE}.tmp`;
|
|
38050
|
+
try {
|
|
38051
|
+
mkdirSync9(TELEGRAM_AGENT_DIR, { recursive: true, mode: 448 });
|
|
38052
|
+
writeFileSync11(tmp, JSON.stringify(snapshot), { mode: 384 });
|
|
38053
|
+
renameSync7(tmp, PEER_PRESENCE_STATE_FILE);
|
|
38054
|
+
} catch (err) {
|
|
38055
|
+
process.stderr.write(
|
|
38056
|
+
`telegram-channel(${AGENT_CODE_NAME}): peer-presence persist failed: ${err.message}
|
|
38057
|
+
`
|
|
38058
|
+
);
|
|
38059
|
+
}
|
|
38060
|
+
}
|
|
38061
|
+
var peerPresence = createPresenceTracker({
|
|
38062
|
+
initial: readPeerPresenceState(),
|
|
38063
|
+
onChange: writePeerPresenceState
|
|
38064
|
+
});
|
|
37994
38065
|
var dailyBudgetWarned = false;
|
|
37995
38066
|
if (!BOT_TOKEN) {
|
|
37996
38067
|
process.stderr.write(
|
|
@@ -40233,7 +40304,7 @@ mcp.setRequestHandler(CallToolRequestSchema, async (req) => {
|
|
|
40233
40304
|
isError: true
|
|
40234
40305
|
};
|
|
40235
40306
|
}
|
|
40236
|
-
const peerActiveOnChat =
|
|
40307
|
+
const peerActiveOnChat = peerSurfaceActiveOnChat(chat_id);
|
|
40237
40308
|
if (peerActiveOnChat) {
|
|
40238
40309
|
if (PEER_DISABLED_GLOBAL) {
|
|
40239
40310
|
process.stderr.write(
|
|
@@ -40326,7 +40397,7 @@ mcp.setRequestHandler(CallToolRequestSchema, async (req) => {
|
|
|
40326
40397
|
isError: true
|
|
40327
40398
|
};
|
|
40328
40399
|
}
|
|
40329
|
-
const peerActiveOnChat =
|
|
40400
|
+
const peerActiveOnChat = peerSurfaceActiveOnChat(chat_id);
|
|
40330
40401
|
if (peerActiveOnChat) {
|
|
40331
40402
|
if (PEER_DISABLED_GLOBAL) {
|
|
40332
40403
|
process.stderr.write(
|
|
@@ -40900,6 +40971,9 @@ async function replayPendingTelegramMarkers() {
|
|
|
40900
40971
|
params: replayParams
|
|
40901
40972
|
});
|
|
40902
40973
|
seedTelegramProgressHeartbeat();
|
|
40974
|
+
if (replayPayload.meta?.["source_role"] !== "agent") {
|
|
40975
|
+
peerPresence.noteInbound(marker.chat_id, "human", now);
|
|
40976
|
+
}
|
|
40903
40977
|
} catch (err) {
|
|
40904
40978
|
process.stderr.write(
|
|
40905
40979
|
`telegram-channel(${AGENT_CODE_NAME}): replay push failed: ${err.message}
|
|
@@ -36,7 +36,7 @@ import {
|
|
|
36
36
|
writeDirectChatSessionState,
|
|
37
37
|
writeEgressAllowlist,
|
|
38
38
|
writePersistentClaudeWrapper
|
|
39
|
-
} from "./chunk-
|
|
39
|
+
} from "./chunk-MOASN7XT.js";
|
|
40
40
|
import "./chunk-XWVM4KPK.js";
|
|
41
41
|
export {
|
|
42
42
|
EGRESS_BASELINE_DOMAINS,
|
|
@@ -77,4 +77,4 @@ export {
|
|
|
77
77
|
writeEgressAllowlist,
|
|
78
78
|
writePersistentClaudeWrapper
|
|
79
79
|
};
|
|
80
|
-
//# sourceMappingURL=persistent-session-
|
|
80
|
+
//# sourceMappingURL=persistent-session-2TTEAJDH.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
paneLogPath
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-MOASN7XT.js";
|
|
4
4
|
import "./chunk-XWVM4KPK.js";
|
|
5
5
|
|
|
6
6
|
// src/lib/responsiveness-probe.ts
|
|
@@ -471,4 +471,4 @@ export {
|
|
|
471
471
|
readAndResetSlackReplyBindingClassifications,
|
|
472
472
|
readAndResetSlackReplyTargetClassifications
|
|
473
473
|
};
|
|
474
|
-
//# sourceMappingURL=responsiveness-probe-
|
|
474
|
+
//# sourceMappingURL=responsiveness-probe-PMDNQ4J4.js.map
|