@integrity-labs/agt-cli 0.28.1 → 0.28.2
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
|
@@ -33,7 +33,7 @@ import {
|
|
|
33
33
|
success,
|
|
34
34
|
table,
|
|
35
35
|
warn
|
|
36
|
-
} from "../chunk-
|
|
36
|
+
} from "../chunk-ZBMZTL7G.js";
|
|
37
37
|
import {
|
|
38
38
|
CHANNEL_REGISTRY,
|
|
39
39
|
DEPLOYMENT_TEMPLATES,
|
|
@@ -4773,7 +4773,7 @@ import { execFileSync, execSync } from "child_process";
|
|
|
4773
4773
|
import { existsSync as existsSync10, realpathSync as realpathSync2 } from "fs";
|
|
4774
4774
|
import chalk18 from "chalk";
|
|
4775
4775
|
import ora16 from "ora";
|
|
4776
|
-
var cliVersion = true ? "0.28.
|
|
4776
|
+
var cliVersion = true ? "0.28.2" : "dev";
|
|
4777
4777
|
async function fetchLatestVersion() {
|
|
4778
4778
|
const host2 = getHost();
|
|
4779
4779
|
if (!host2) return null;
|
|
@@ -5696,7 +5696,7 @@ function handleError(err) {
|
|
|
5696
5696
|
}
|
|
5697
5697
|
|
|
5698
5698
|
// src/bin/agt.ts
|
|
5699
|
-
var cliVersion2 = true ? "0.28.
|
|
5699
|
+
var cliVersion2 = true ? "0.28.2" : "dev";
|
|
5700
5700
|
var program = new Command();
|
|
5701
5701
|
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");
|
|
5702
5702
|
program.hook("preAction", async (thisCommand, actionCommand) => {
|
|
@@ -22,7 +22,7 @@ import {
|
|
|
22
22
|
provisionStopHook,
|
|
23
23
|
requireHost,
|
|
24
24
|
safeWriteJsonAtomic
|
|
25
|
-
} from "../chunk-
|
|
25
|
+
} from "../chunk-ZBMZTL7G.js";
|
|
26
26
|
import {
|
|
27
27
|
getProjectDir as getProjectDir2,
|
|
28
28
|
getReadyTasks,
|
|
@@ -3599,7 +3599,22 @@ var agentState = {
|
|
|
3599
3599
|
// compound-keyed (`agentId:<suffix>`)
|
|
3600
3600
|
// ---------------------------------------------------------------------------
|
|
3601
3601
|
knownChannelConfigHashes: /* @__PURE__ */ new Map(),
|
|
3602
|
-
knownSkillHashes: /* @__PURE__ */ new Map()
|
|
3602
|
+
knownSkillHashes: /* @__PURE__ */ new Map(),
|
|
3603
|
+
// ---------------------------------------------------------------------------
|
|
3604
|
+
// agentId-keyed (global skills, ENG-6349)
|
|
3605
|
+
// ---------------------------------------------------------------------------
|
|
3606
|
+
/**
|
|
3607
|
+
* ENG-6349 (ADR-0023): per-agent set of global-skill ids (bare code_names)
|
|
3608
|
+
* this worker installed on the previous refresh. Global skills have no folder
|
|
3609
|
+
* prefix (they're written as `.claude/skills/<code_name>/` so `/<code_name>`
|
|
3610
|
+
* resolves), so the integration orphan sweep — which scans for `integration-`/
|
|
3611
|
+
* `plugin-` prefixes — can't see them. We track the delivered set here instead
|
|
3612
|
+
* and remove only the ids that drop out (an unpublished global), never the
|
|
3613
|
+
* agent's own or integration skills. In-memory only: a manager restart resets
|
|
3614
|
+
* it, so an unpublish during a restart window leaves the folder until the next
|
|
3615
|
+
* unpublish — acceptable for a platform-staff-rare action.
|
|
3616
|
+
*/
|
|
3617
|
+
knownGlobalSkillIds: /* @__PURE__ */ new Map()
|
|
3603
3618
|
};
|
|
3604
3619
|
function clearAgentState(agentId, codeName) {
|
|
3605
3620
|
agentState.knownVersions.delete(agentId);
|
|
@@ -3615,6 +3630,7 @@ function clearAgentState(agentId, codeName) {
|
|
|
3615
3630
|
agentState.knownSenderPolicyHashes.delete(agentId);
|
|
3616
3631
|
agentState.knownMsTeamsBehaviourHashes.delete(agentId);
|
|
3617
3632
|
agentState.knownSlackBehaviourHashes.delete(agentId);
|
|
3633
|
+
agentState.knownGlobalSkillIds.delete(agentId);
|
|
3618
3634
|
agentState.agentDisplayNames.delete(codeName);
|
|
3619
3635
|
agentState.codeNameToAgentId.delete(codeName);
|
|
3620
3636
|
let channelCacheMutated = false;
|
|
@@ -3632,6 +3648,28 @@ function clearAgentState(agentId, codeName) {
|
|
|
3632
3648
|
return channelCacheMutated;
|
|
3633
3649
|
}
|
|
3634
3650
|
|
|
3651
|
+
// src/lib/manager/global-skills.ts
|
|
3652
|
+
function sanitizeGlobalSkillId(codeName) {
|
|
3653
|
+
return codeName.trim().replace(/[^a-z0-9-]/g, "-").replace(/-+/g, "-").replace(/^-|-$/g, "");
|
|
3654
|
+
}
|
|
3655
|
+
function planGlobalSkillSync(globalSkills, prevIds, hashOf, knownHash) {
|
|
3656
|
+
const currentIds = /* @__PURE__ */ new Set();
|
|
3657
|
+
const installs = [];
|
|
3658
|
+
for (const gs of globalSkills ?? []) {
|
|
3659
|
+
const codeName = (gs?.code_name ?? "").trim();
|
|
3660
|
+
const content = gs?.content ?? "";
|
|
3661
|
+
if (!codeName || !content.trim()) continue;
|
|
3662
|
+
const skillId = sanitizeGlobalSkillId(codeName);
|
|
3663
|
+
if (!skillId) continue;
|
|
3664
|
+
currentIds.add(skillId);
|
|
3665
|
+
const hash = hashOf(content);
|
|
3666
|
+
if (knownHash(skillId) === hash) continue;
|
|
3667
|
+
installs.push({ skillId, content, hash });
|
|
3668
|
+
}
|
|
3669
|
+
const removes = [...prevIds].filter((id) => !currentIds.has(id));
|
|
3670
|
+
return { installs, removes, currentIds };
|
|
3671
|
+
}
|
|
3672
|
+
|
|
3635
3673
|
// src/lib/wedge-detection.ts
|
|
3636
3674
|
var DEFAULTS = {
|
|
3637
3675
|
inboundWaitSeconds: 120,
|
|
@@ -5041,7 +5079,7 @@ var cachedMaintenanceWindow = null;
|
|
|
5041
5079
|
var lastVersionCheckAt = 0;
|
|
5042
5080
|
var VERSION_CHECK_INTERVAL_MS = 5 * 60 * 1e3;
|
|
5043
5081
|
var lastResponsivenessProbeAt = 0;
|
|
5044
|
-
var agtCliVersion = true ? "0.28.
|
|
5082
|
+
var agtCliVersion = true ? "0.28.2" : "dev";
|
|
5045
5083
|
function resolveBrewPath(execFileSync4) {
|
|
5046
5084
|
try {
|
|
5047
5085
|
const out = execFileSync4("which", ["brew"], { timeout: 5e3 }).toString().trim();
|
|
@@ -8018,6 +8056,40 @@ async function processAgent(agent, agentStates) {
|
|
|
8018
8056
|
} catch (err) {
|
|
8019
8057
|
log(`Integration skill cleanup failed for '${agent.code_name}': ${err.message}`);
|
|
8020
8058
|
}
|
|
8059
|
+
try {
|
|
8060
|
+
const plan = planGlobalSkillSync(
|
|
8061
|
+
refreshAny.global_skills ?? [],
|
|
8062
|
+
agentState.knownGlobalSkillIds.get(agent.agent_id) ?? /* @__PURE__ */ new Set(),
|
|
8063
|
+
(content) => createHash4("sha256").update(content).digest("hex").slice(0, 12),
|
|
8064
|
+
(skillId) => agentState.knownSkillHashes.get(`global-skill:${agent.agent_id}:${skillId}`)
|
|
8065
|
+
);
|
|
8066
|
+
for (const { skillId, content, hash } of plan.installs) {
|
|
8067
|
+
frameworkAdapter.installSkillFiles(agent.code_name, skillId, [{ relativePath: "SKILL.md", content }]);
|
|
8068
|
+
agentState.knownSkillHashes.set(`global-skill:${agent.agent_id}:${skillId}`, hash);
|
|
8069
|
+
log(`Installed global skill '${skillId}' for '${agent.code_name}'`);
|
|
8070
|
+
}
|
|
8071
|
+
if (plan.removes.length) {
|
|
8072
|
+
const { rmSync: rmSync3 } = await import("fs");
|
|
8073
|
+
const { homedir: homedir6 } = await import("os");
|
|
8074
|
+
const globalSkillDirs = [
|
|
8075
|
+
join10(homedir6(), ".augmented", agent.code_name, "skills"),
|
|
8076
|
+
join10(homedir6(), ".augmented", agent.code_name, "project", ".claude", "skills"),
|
|
8077
|
+
join10(homedir6(), `.openclaw-${agent.code_name}`, "skills"),
|
|
8078
|
+
join10(agentDir, ".claude", "skills")
|
|
8079
|
+
];
|
|
8080
|
+
for (const id of plan.removes) {
|
|
8081
|
+
for (const dir of globalSkillDirs) {
|
|
8082
|
+
const p = join10(dir, id);
|
|
8083
|
+
if (existsSync5(p)) rmSync3(p, { recursive: true, force: true });
|
|
8084
|
+
}
|
|
8085
|
+
agentState.knownSkillHashes.delete(`global-skill:${agent.agent_id}:${id}`);
|
|
8086
|
+
log(`Removed unpublished global skill '${id}' for '${agent.code_name}'`);
|
|
8087
|
+
}
|
|
8088
|
+
}
|
|
8089
|
+
agentState.knownGlobalSkillIds.set(agent.agent_id, plan.currentIds);
|
|
8090
|
+
} catch (err) {
|
|
8091
|
+
log(`Global skill install failed for '${agent.code_name}': ${err.message}`);
|
|
8092
|
+
}
|
|
8021
8093
|
try {
|
|
8022
8094
|
const agentFwForIndex = agentFrameworkCache.get(agent.code_name) ?? "openclaw";
|
|
8023
8095
|
if (agentFwForIndex === "claude-code") {
|