@integrity-labs/agt-cli 0.27.79 → 0.27.80
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
CHANGED
|
@@ -28,7 +28,7 @@ import {
|
|
|
28
28
|
success,
|
|
29
29
|
table,
|
|
30
30
|
warn
|
|
31
|
-
} from "../chunk-
|
|
31
|
+
} from "../chunk-Y4INY5FA.js";
|
|
32
32
|
import {
|
|
33
33
|
CHANNEL_REGISTRY,
|
|
34
34
|
DEPLOYMENT_TEMPLATES,
|
|
@@ -4930,7 +4930,7 @@ import { execFileSync, execSync } from "child_process";
|
|
|
4930
4930
|
import { existsSync as existsSync10, realpathSync as realpathSync2 } from "fs";
|
|
4931
4931
|
import chalk18 from "chalk";
|
|
4932
4932
|
import ora16 from "ora";
|
|
4933
|
-
var cliVersion = true ? "0.27.
|
|
4933
|
+
var cliVersion = true ? "0.27.80" : "dev";
|
|
4934
4934
|
async function fetchLatestVersion() {
|
|
4935
4935
|
const host2 = getHost();
|
|
4936
4936
|
if (!host2) return null;
|
|
@@ -5853,7 +5853,7 @@ function handleError(err) {
|
|
|
5853
5853
|
}
|
|
5854
5854
|
|
|
5855
5855
|
// src/bin/agt.ts
|
|
5856
|
-
var cliVersion2 = true ? "0.27.
|
|
5856
|
+
var cliVersion2 = true ? "0.27.80" : "dev";
|
|
5857
5857
|
var program = new Command();
|
|
5858
5858
|
program.name("agt").description("Augmented CLI \u2014 agent provisioning and management").version(cliVersion2).option("--json", "Emit machine-readable JSON output (suppress spinners and colors)").option("--skip-update-check", "Skip the automatic update check on startup");
|
|
5859
5859
|
program.hook("preAction", async (thisCommand, actionCommand) => {
|
|
@@ -16,7 +16,7 @@ import {
|
|
|
16
16
|
provisionStopHook,
|
|
17
17
|
requireHost,
|
|
18
18
|
safeWriteJsonAtomic
|
|
19
|
-
} from "../chunk-
|
|
19
|
+
} from "../chunk-Y4INY5FA.js";
|
|
20
20
|
import {
|
|
21
21
|
getProjectDir as getProjectDir2,
|
|
22
22
|
getReadyTasks,
|
|
@@ -680,6 +680,20 @@ function decideSenderPolicyRestart(input) {
|
|
|
680
680
|
return { restart: true, firstPoll: false, changed: true };
|
|
681
681
|
}
|
|
682
682
|
|
|
683
|
+
// src/lib/msteams-behaviour-restart.ts
|
|
684
|
+
function extractMsTeamsBehaviourSubset(config2) {
|
|
685
|
+
const adaptiveCardsEnabled = config2?.["adaptive_cards_enabled"] === true;
|
|
686
|
+
return {
|
|
687
|
+
thread_auto_follow: config2?.["thread_auto_follow"] ?? "off",
|
|
688
|
+
channel_response_mode: config2?.["channel_response_mode"] ?? "mention_only",
|
|
689
|
+
adaptive_cards_enabled: adaptiveCardsEnabled,
|
|
690
|
+
// The adapter only emits MSTEAMS_ADAPTIVE_CARDS_ASK_USER_ENABLED when the
|
|
691
|
+
// parent flag is also on — mirror that so toggling ask_user while
|
|
692
|
+
// Adaptive Cards is off (a no-op for the env) doesn't restart.
|
|
693
|
+
adaptive_cards_ask_user_enabled: adaptiveCardsEnabled && config2?.["adaptive_cards_ask_user_enabled"] === true
|
|
694
|
+
};
|
|
695
|
+
}
|
|
696
|
+
|
|
683
697
|
// src/lib/channel-quarantine.ts
|
|
684
698
|
import { readFileSync } from "fs";
|
|
685
699
|
import { join } from "path";
|
|
@@ -1288,6 +1302,7 @@ var GATEABLE_RESTART_REASONS = /* @__PURE__ */ new Set([
|
|
|
1288
1302
|
"model-change",
|
|
1289
1303
|
"channel-set-change",
|
|
1290
1304
|
"sender-policy-change",
|
|
1305
|
+
"channel-behaviour-change",
|
|
1291
1306
|
"hot-reload-mcp",
|
|
1292
1307
|
"mcp-presence-reaper"
|
|
1293
1308
|
]);
|
|
@@ -2658,6 +2673,16 @@ var agentState = {
|
|
|
2658
2673
|
* (they read SLACK_SENDER_POLICY / MSTEAMS_SENDER_POLICY only at boot).
|
|
2659
2674
|
*/
|
|
2660
2675
|
knownSenderPolicyHashes: /* @__PURE__ */ new Map(),
|
|
2676
|
+
/**
|
|
2677
|
+
* ENG-6024: hash of the Teams behaviour subset (thread_auto_follow,
|
|
2678
|
+
* channel_response_mode, adaptive_cards_enabled/_ask_user_enabled) from the
|
|
2679
|
+
* agent's msteams channel config. Same last-hop rationale as
|
|
2680
|
+
* `knownSenderPolicyHashes`: teams-channel reads the corresponding env vars
|
|
2681
|
+
* once at boot, and neither the channel-set restart nor the .mcp.json drift
|
|
2682
|
+
* watcher fires on a value-only change, so this dedicated trigger restarts
|
|
2683
|
+
* the session when an operator saves the webapp's Teams Advanced panel.
|
|
2684
|
+
*/
|
|
2685
|
+
knownMsTeamsBehaviourHashes: /* @__PURE__ */ new Map(),
|
|
2661
2686
|
// ---------------------------------------------------------------------------
|
|
2662
2687
|
// codeName-keyed
|
|
2663
2688
|
// ---------------------------------------------------------------------------
|
|
@@ -2688,6 +2713,7 @@ function clearAgentState(agentId, codeName) {
|
|
|
2688
2713
|
agentState.knownManagedMcpHashes.delete(agentId);
|
|
2689
2714
|
agentState.knownManagedMcpStructure.delete(agentId);
|
|
2690
2715
|
agentState.knownSenderPolicyHashes.delete(agentId);
|
|
2716
|
+
agentState.knownMsTeamsBehaviourHashes.delete(agentId);
|
|
2691
2717
|
agentState.agentDisplayNames.delete(codeName);
|
|
2692
2718
|
agentState.codeNameToAgentId.delete(codeName);
|
|
2693
2719
|
let channelCacheMutated = false;
|
|
@@ -3686,7 +3712,7 @@ var cachedMaintenanceWindow = null;
|
|
|
3686
3712
|
var lastVersionCheckAt = 0;
|
|
3687
3713
|
var VERSION_CHECK_INTERVAL_MS = 5 * 60 * 1e3;
|
|
3688
3714
|
var lastResponsivenessProbeAt = 0;
|
|
3689
|
-
var agtCliVersion = true ? "0.27.
|
|
3715
|
+
var agtCliVersion = true ? "0.27.80" : "dev";
|
|
3690
3716
|
function resolveBrewPath(execFileSync4) {
|
|
3691
3717
|
try {
|
|
3692
3718
|
const out = execFileSync4("which", ["brew"], { timeout: 5e3 }).toString().trim();
|
|
@@ -5779,6 +5805,52 @@ async function processAgent(agent, agentStates) {
|
|
|
5779
5805
|
);
|
|
5780
5806
|
}
|
|
5781
5807
|
agentState.knownSenderPolicyHashes.set(agent.agent_id, senderPolicyHash);
|
|
5808
|
+
if (currentChannelIds.has("msteams")) {
|
|
5809
|
+
const msteamsEntry = refreshData.channel_configs?.["msteams"];
|
|
5810
|
+
const behaviourSubset = extractMsTeamsBehaviourSubset(
|
|
5811
|
+
msteamsEntry?.config
|
|
5812
|
+
);
|
|
5813
|
+
const behaviourHash = createHash3("sha256").update(canonicalJson(behaviourSubset)).digest("hex");
|
|
5814
|
+
const prevBehaviourHash = agentState.knownMsTeamsBehaviourHashes.get(agent.agent_id);
|
|
5815
|
+
const behaviourDecision = decideSenderPolicyRestart({
|
|
5816
|
+
previousHash: prevBehaviourHash,
|
|
5817
|
+
currentHash: behaviourHash,
|
|
5818
|
+
sessionMode: refreshData.agent.session_mode,
|
|
5819
|
+
framework: agentFrameworkCache.get(agent.code_name) ?? "openclaw",
|
|
5820
|
+
sessionHealthy: isSessionHealthy(agent.code_name),
|
|
5821
|
+
// A channel-set or sender-policy restart scheduled this tick will
|
|
5822
|
+
// respawn the MCP children with the freshly-written env for free.
|
|
5823
|
+
channelSetRestartAlreadyScheduled: channelSetRestartScheduled || senderPolicyDecision.restart
|
|
5824
|
+
});
|
|
5825
|
+
if (behaviourDecision.restart) {
|
|
5826
|
+
log(
|
|
5827
|
+
`[hot-reload] msteams behaviour settings changed for '${agent.code_name}' (${prevBehaviourHash?.slice(0, 8) ?? "first"} \u2192 ${behaviourHash.slice(0, 8)}) \u2014 restarting session`
|
|
5828
|
+
);
|
|
5829
|
+
const behaviourNotice = "Your Microsoft Teams channel behaviour settings were updated. Restarting session shortly so the teams-channel MCP picks up the new configuration.";
|
|
5830
|
+
const behaviourDelivered = await injectMessage(
|
|
5831
|
+
agent.code_name,
|
|
5832
|
+
"system",
|
|
5833
|
+
behaviourNotice,
|
|
5834
|
+
{ task_name: "channel-update" },
|
|
5835
|
+
log
|
|
5836
|
+
).catch(() => false);
|
|
5837
|
+
const behaviourDelay = behaviourDelivered ? 8e3 : 3e3;
|
|
5838
|
+
if (!behaviourDelivered) {
|
|
5839
|
+
log(
|
|
5840
|
+
`[hot-reload] Inject notification unconfirmed for '${agent.code_name}' \u2014 proceeding with shorter delay`
|
|
5841
|
+
);
|
|
5842
|
+
}
|
|
5843
|
+
scheduleSessionRestart(
|
|
5844
|
+
agent.code_name,
|
|
5845
|
+
behaviourDelay,
|
|
5846
|
+
"msteams behaviour change",
|
|
5847
|
+
"channel-behaviour-change"
|
|
5848
|
+
);
|
|
5849
|
+
}
|
|
5850
|
+
agentState.knownMsTeamsBehaviourHashes.set(agent.agent_id, behaviourHash);
|
|
5851
|
+
} else {
|
|
5852
|
+
agentState.knownMsTeamsBehaviourHashes.delete(agent.agent_id);
|
|
5853
|
+
}
|
|
5782
5854
|
}
|
|
5783
5855
|
const agentSessionMode = refreshData.agent.session_mode;
|
|
5784
5856
|
if (agentSessionMode === "persistent" && (agentFrameworkCache.get(agent.code_name) ?? "openclaw") === "claude-code") {
|