@integrity-labs/agt-cli 0.9.10 → 0.10.0

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.
@@ -9,7 +9,7 @@ import {
9
9
  provisionStopHook,
10
10
  requireHost,
11
11
  resolveChannels
12
- } from "../chunk-IT34G2Y2.js";
12
+ } from "../chunk-UWH2MMKY.js";
13
13
  import {
14
14
  findTaskByTemplate,
15
15
  getProjectDir,
@@ -1591,10 +1591,11 @@ async function processAgent(agent, agentStates) {
1591
1591
  const fw = agentFrameworkCache.get(agent.code_name) ?? "openclaw";
1592
1592
  if (fw === "claude-code" && isSessionHealthy(agent.code_name)) {
1593
1593
  const names = integrations.map((i) => i.display_name || i.definition_id).join(", ");
1594
- injectMessage(agent.code_name, "system", `Your integrations have been updated. You now have access to: ${names}. Re-read your CLAUDE.md for details.`, {
1594
+ injectMessage(agent.code_name, "system", `Your integrations have been updated. You now have access to: ${names}. Your .env.integrations and CLAUDE.md have been refreshed \u2014 credentials are available immediately via environment variables.`, {
1595
1595
  task_name: "integration-update"
1596
1596
  }, log).catch(() => {
1597
1597
  });
1598
+ log(`[hot-reload] Notified '${agent.code_name}' about integration update: ${names}`);
1598
1599
  }
1599
1600
  const managedIntegrations = integrations.filter((i) => i.auth_type === "managed");
1600
1601
  if (managedIntegrations.length > 0 && frameworkAdapter.writeMcpServer) {
@@ -1636,6 +1637,25 @@ async function processAgent(agent, agentStates) {
1636
1637
  }
1637
1638
  }
1638
1639
  needsGatewayRestart = true;
1640
+ if (managedIntegrations.length > 0 && fw === "claude-code" && isSessionHealthy(agent.code_name)) {
1641
+ const mcpNames = managedIntegrations.map((i) => i.display_name || i.definition_id).join(", ");
1642
+ log(`[hot-reload] MCP servers changed for '${agent.code_name}': ${mcpNames} \u2014 restarting session`);
1643
+ const delivered = await injectMessage(
1644
+ agent.code_name,
1645
+ "system",
1646
+ `New MCP tool servers have been configured: ${mcpNames}. Note: MCP servers require a session restart to connect. Your manager will restart your session shortly.`,
1647
+ { task_name: "mcp-update" },
1648
+ log
1649
+ ).catch(() => false);
1650
+ const delay = delivered ? 8e3 : 3e3;
1651
+ if (!delivered) {
1652
+ log(`[hot-reload] Inject notification unconfirmed for '${agent.code_name}' \u2014 proceeding with shorter delay`);
1653
+ }
1654
+ setTimeout(() => {
1655
+ stopPersistentSession(agent.code_name, log);
1656
+ log(`[hot-reload] Session stopped for '${agent.code_name}' \u2014 will respawn with new MCP servers`);
1657
+ }, delay);
1658
+ }
1639
1659
  }
1640
1660
  const resolvedDefIds = new Set(integrations.map((i) => i.definition_id));
1641
1661
  for (const capId of resolvedDefIds) {
@@ -1652,15 +1672,30 @@ async function processAgent(agent, agentStates) {
1652
1672
  const skillKey = `${agent.agent_id}:${capId}`;
1653
1673
  const prevSkillHash = knownSkillHashes.get(skillKey);
1654
1674
  if (skillHash !== prevSkillHash) {
1675
+ const installedSkillNames = [];
1655
1676
  if (frameworkAdapter.installSkillFiles && capData.skills) {
1656
1677
  for (const skill of capData.skills) {
1657
1678
  if (skill.files.length > 0) {
1658
1679
  frameworkAdapter.installSkillFiles(agent.code_name, skill.id, skill.files);
1680
+ installedSkillNames.push(skill.name || skill.id);
1659
1681
  log(`Installed skill '${skill.id}' for '${agent.code_name}' (${skill.files.length} file(s))`);
1660
1682
  }
1661
1683
  }
1662
1684
  }
1663
1685
  knownSkillHashes.set(skillKey, skillHash);
1686
+ const agentFw2 = agentFrameworkCache.get(agent.code_name) ?? "openclaw";
1687
+ if (agentFw2 === "claude-code" && installedSkillNames.length > 0 && isSessionHealthy(agent.code_name)) {
1688
+ const names = installedSkillNames.join(", ");
1689
+ injectMessage(
1690
+ agent.code_name,
1691
+ "system",
1692
+ `New skills installed: ${names}. These are available immediately \u2014 Claude Code loads skills on demand from .claude/skills/.`,
1693
+ { task_name: "skill-update" },
1694
+ log
1695
+ ).catch(() => {
1696
+ });
1697
+ log(`[hot-reload] Notified '${agent.code_name}' about new skills: ${names}`);
1698
+ }
1664
1699
  }
1665
1700
  const ALLOWED_CLI_PACKAGES = /* @__PURE__ */ new Set([
1666
1701
  "xero-cli",
@@ -3397,6 +3432,15 @@ function generateArtifacts(agent, refreshData, adapter) {
3397
3432
  }
3398
3433
  const resolvedChannels = resolveChannels(agentChannelPolicy, orgChannelPolicy);
3399
3434
  const effectiveChannels = agent.status === "paused" ? [] : resolvedChannels;
3435
+ const tasks = refreshData.scheduled_tasks;
3436
+ const taskTimezones = [...new Set(
3437
+ (tasks ?? []).map((t) => typeof t.timezone === "string" ? t.timezone.trim() : "").filter((tz) => tz.length > 0)
3438
+ )];
3439
+ const teamTimezoneRaw = refreshData.team?.timezone;
3440
+ const teamTimezone = typeof teamTimezoneRaw === "string" && teamTimezoneRaw.trim().length > 0 ? teamTimezoneRaw.trim() : void 0;
3441
+ const agentTimezone = (taskTimezones.length === 1 ? taskTimezones[0] : void 0) ?? teamTimezone ?? "UTC";
3442
+ const orgDefaults = refreshData.model_defaults;
3443
+ const personalitySeed = orgDefaults?.org?.settings?.personality_seed;
3400
3444
  const provisionInput = {
3401
3445
  agent: refreshData.agent,
3402
3446
  charterFrontmatter,
@@ -3406,7 +3450,10 @@ function generateArtifacts(agent, refreshData, adapter) {
3406
3450
  resolvedChannels: effectiveChannels,
3407
3451
  deploymentTarget: "local_docker",
3408
3452
  gatewayPort: 9e3,
3409
- team: refreshData.team ?? void 0
3453
+ team: refreshData.team ?? void 0,
3454
+ timezone: agentTimezone,
3455
+ reportsTo,
3456
+ personalitySeed
3410
3457
  };
3411
3458
  const provisionOutput = provision(provisionInput, adapter.id);
3412
3459
  return provisionOutput.artifacts;