@integrity-labs/agt-cli 0.9.7 → 0.9.9

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
@@ -32,7 +32,7 @@ import {
32
32
  resolveChannels,
33
33
  serializeManifestForSlackCli,
34
34
  setActiveTeam
35
- } from "../chunk-2F6REM24.js";
35
+ } from "../chunk-IT34G2Y2.js";
36
36
 
37
37
  // src/bin/agt.ts
38
38
  import { join as join11 } from "path";
@@ -3411,7 +3411,7 @@ async function acpxCloseCommand(agent2, _opts, cmd) {
3411
3411
  import { execSync } from "child_process";
3412
3412
  import chalk19 from "chalk";
3413
3413
  import ora15 from "ora";
3414
- var cliVersion = true ? "0.9.7" : "dev";
3414
+ var cliVersion = true ? "0.9.9" : "dev";
3415
3415
  async function fetchLatestVersion() {
3416
3416
  const host2 = AGT_HOST;
3417
3417
  if (!host2) return null;
@@ -3527,7 +3527,7 @@ async function checkForUpdateOnStartup() {
3527
3527
  }
3528
3528
 
3529
3529
  // src/bin/agt.ts
3530
- var cliVersion2 = true ? "0.9.7" : "dev";
3530
+ var cliVersion2 = true ? "0.9.9" : "dev";
3531
3531
  var program = new Command();
3532
3532
  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");
3533
3533
  program.hook("preAction", (thisCommand) => {
@@ -414,11 +414,42 @@ function serializeOpenClawConfig(config) {
414
414
  }
415
415
 
416
416
  // ../../packages/core/dist/provisioning/frameworks/openclaw/identity.js
417
+ function buildKnowledgeSection(knowledge) {
418
+ if (!knowledge?.length)
419
+ return "";
420
+ const orgEntries = knowledge.filter((k) => k.scope === "org");
421
+ const teamEntries = knowledge.filter((k) => k.scope === "team");
422
+ const formatEntry = (k) => `- **${k.title}** \u2192 \`knowledge/${k.slug}.md\``;
423
+ let body = "";
424
+ if (orgEntries.length) {
425
+ body += `### Organization
426
+
427
+ ${orgEntries.map(formatEntry).join("\n")}
428
+ `;
429
+ }
430
+ if (orgEntries.length && teamEntries.length) {
431
+ body += "\n";
432
+ }
433
+ if (teamEntries.length) {
434
+ body += `### Team
435
+
436
+ ${teamEntries.map(formatEntry).join("\n")}
437
+ `;
438
+ }
439
+ return `
440
+ ## Core Knowledge
441
+
442
+ Your team has provided the following knowledge. Read the relevant files when
443
+ you need context about who you work for or how to operate.
444
+
445
+ ${body}`;
446
+ }
417
447
  function generateSoulMd(input) {
418
- const { frontmatter, role, description, resolvedChannels, team } = input;
448
+ const { frontmatter, role, description, resolvedChannels, team, knowledge } = input;
419
449
  const channelList = resolvedChannels?.length ? resolvedChannels.join(", ") : "none";
420
450
  const roleDisplay = role ?? "Agent";
421
451
  const desc = description?.trim();
452
+ const knowledgeSection = buildKnowledgeSection(knowledge);
422
453
  return `# ${frontmatter.display_name}
423
454
 
424
455
  You are **${frontmatter.display_name}**, **${roleDisplay}**${team ? ` at **${team.name}**` : ""}.
@@ -428,7 +459,7 @@ ${desc}
428
459
  - Owner: ${frontmatter.owner.name}
429
460
  - Environment: ${frontmatter.environment}
430
461
  - Channels: ${channelList}
431
- `;
462
+ ${knowledgeSection}`;
432
463
  }
433
464
  function generateAgentsMd(input) {
434
465
  const { frontmatter, role, description, team } = input;
@@ -445,6 +476,7 @@ ${desc}
445
476
  1. Read \`SOUL.md\` \u2014 your identity
446
477
  2. Read \`USER.md\` \u2014 who you help
447
478
  3. Read \`memory/YYYY-MM-DD.md\` (today + yesterday) for context
479
+ 4. Check \`knowledge/\` \u2014 team-provided context (if available)
448
480
 
449
481
  ## Rules
450
482
 
@@ -624,14 +656,21 @@ var openclawAdapter = {
624
656
  cliBinary: "openclaw",
625
657
  buildArtifacts(input) {
626
658
  const config = buildOpenClawConfig(input);
659
+ const safeKnowledge = (input.knowledge ?? []).filter((k) => !/[/\\]|\.\./.test(k.slug));
660
+ const knowledgeRefs = safeKnowledge.map((k) => ({
661
+ title: k.title,
662
+ slug: k.slug,
663
+ scope: k.scope
664
+ }));
627
665
  const soulInput = {
628
666
  frontmatter: input.charterFrontmatter,
629
667
  role: input.agent.role,
630
668
  description: input.agent.description,
631
669
  resolvedChannels: input.resolvedChannels,
632
- team: input.team
670
+ team: input.team,
671
+ knowledge: knowledgeRefs.length > 0 ? knowledgeRefs : void 0
633
672
  };
634
- return [
673
+ const artifacts = [
635
674
  { relativePath: "openclaw.json5", content: serializeOpenClawConfig(config) },
636
675
  { relativePath: "AGENTS.md", content: generateAgentsMd(soulInput) },
637
676
  { relativePath: "SOUL.md", content: generateSoulMd(soulInput) },
@@ -639,6 +678,15 @@ var openclawAdapter = {
639
678
  { relativePath: "CHARTER.md", content: input.charterContent },
640
679
  { relativePath: "TOOLS.md", content: input.toolsContent }
641
680
  ];
681
+ for (const entry of safeKnowledge) {
682
+ artifacts.push({
683
+ relativePath: `knowledge/${entry.slug}.md`,
684
+ content: `# ${entry.title} (${entry.scope === "org" ? "Organization" : "Team"})
685
+
686
+ ${entry.content}`
687
+ });
688
+ }
689
+ return artifacts;
642
690
  },
643
691
  driftTrackedFiles() {
644
692
  return ["openclaw.json5", "AGENTS.md", "SOUL.md", "CHARTER.md", "TOOLS.md"];
@@ -1787,6 +1835,37 @@ Two types of memory files, both plain Markdown:
1787
1835
 
1788
1836
  ${recall}`;
1789
1837
  }
1838
+ function buildKnowledgeSection2(knowledge) {
1839
+ if (!knowledge?.length)
1840
+ return "";
1841
+ const orgEntries = knowledge.filter((k) => k.scope === "org");
1842
+ const teamEntries = knowledge.filter((k) => k.scope === "team");
1843
+ const formatEntry = (k) => `- **${k.title}** (skill: \`knowledge-${k.slug}\`)`;
1844
+ let body = "";
1845
+ if (orgEntries.length) {
1846
+ body += `### Organization
1847
+
1848
+ ${orgEntries.map(formatEntry).join("\n")}
1849
+ `;
1850
+ }
1851
+ if (orgEntries.length && teamEntries.length) {
1852
+ body += "\n";
1853
+ }
1854
+ if (teamEntries.length) {
1855
+ body += `### Team
1856
+
1857
+ ${teamEntries.map(formatEntry).join("\n")}
1858
+ `;
1859
+ }
1860
+ return `## Core Knowledge
1861
+
1862
+ Your team has provided the following core knowledge as skills. These are
1863
+ automatically available \u2014 Claude Code will surface the relevant skill when
1864
+ you need context. You do not need to read files manually.
1865
+
1866
+ ${body}
1867
+ `;
1868
+ }
1790
1869
  function buildIntegrationsSection(integrations) {
1791
1870
  if (!integrations?.length)
1792
1871
  return "";
@@ -1809,13 +1888,14 @@ Check \`.claude/skills/\` for detailed usage instructions for each integration.
1809
1888
  `;
1810
1889
  }
1811
1890
  function generateClaudeMd(input) {
1812
- const { frontmatter, role, description, resolvedChannels, team, consoleUrl, hasQmd, integrations } = input;
1891
+ const { frontmatter, role, description, resolvedChannels, team, consoleUrl, hasQmd, integrations, knowledge } = input;
1813
1892
  const channelList = resolvedChannels?.length ? resolvedChannels.join(", ") : "none";
1814
1893
  const roleDisplay = role ?? "Agent";
1815
1894
  const desc = description?.trim();
1816
1895
  const kanbanUrl = consoleUrl ? `${consoleUrl}/agents/${frontmatter.agent_id}?tab=kanban` : null;
1817
1896
  const memorySection = buildMemorySection(hasQmd);
1818
1897
  const integrationsSection = buildIntegrationsSection(integrations);
1898
+ const knowledgeSection = buildKnowledgeSection2(knowledge);
1819
1899
  return `# ${frontmatter.display_name}
1820
1900
 
1821
1901
  You are **${frontmatter.display_name}**, **${roleDisplay}**${team ? ` at **${team.name}**` : ""}.
@@ -1870,7 +1950,7 @@ first to load your recent board state. This gives you context about completed an
1870
1950
  in-progress items so you can answer accurately.
1871
1951
 
1872
1952
  ${memorySection}
1873
- ${integrationsSection}## Development Workflow
1953
+ ${integrationsSection}${knowledgeSection}## Development Workflow
1874
1954
 
1875
1955
  ### Repository Management
1876
1956
 
@@ -2149,6 +2229,11 @@ var claudeCodeAdapter = {
2149
2229
  description: def?.description
2150
2230
  };
2151
2231
  });
2232
+ const knowledgeRefs = (input.knowledge ?? []).map((k) => ({
2233
+ title: k.title,
2234
+ slug: k.slug,
2235
+ scope: k.scope
2236
+ }));
2152
2237
  const claudeMdInput = {
2153
2238
  frontmatter: input.charterFrontmatter,
2154
2239
  role: input.agent.role,
@@ -2157,15 +2242,33 @@ var claudeCodeAdapter = {
2157
2242
  team: input.team,
2158
2243
  consoleUrl: process.env["NEXT_PUBLIC_APP_URL"] || process.env["AGT_CONSOLE_URL"] || void 0,
2159
2244
  hasQmd: input.integrations?.some((i) => i.definition_id === "qmd") ?? false,
2160
- integrations: integrationSummaries
2245
+ integrations: integrationSummaries,
2246
+ knowledge: knowledgeRefs.length > 0 ? knowledgeRefs : void 0
2161
2247
  };
2162
- return [
2248
+ const artifacts = [
2163
2249
  { relativePath: "CLAUDE.md", content: generateClaudeMd(claudeMdInput) },
2164
2250
  { relativePath: "settings.json", content: JSON.stringify(buildSettingsJson(input), null, 2) },
2165
2251
  { relativePath: ".mcp.json", content: JSON.stringify(buildMcpJson(input), null, 2) },
2166
2252
  { relativePath: "CHARTER.md", content: input.charterContent },
2167
2253
  { relativePath: "TOOLS.md", content: input.toolsContent }
2168
2254
  ];
2255
+ for (const entry of input.knowledge ?? []) {
2256
+ const skillPath = `.claude/skills/knowledge-${entry.slug}/SKILL.md`;
2257
+ assertSafeRelativePath(skillPath);
2258
+ const scopeLabel = entry.scope === "org" ? "organization" : "team";
2259
+ artifacts.push({
2260
+ relativePath: skillPath,
2261
+ content: `---
2262
+ name: knowledge-${entry.slug}
2263
+ description: "${entry.title} \u2014 ${scopeLabel}-level core knowledge. Use when you need context about ${entry.title.toLowerCase()}."
2264
+ ---
2265
+
2266
+ # ${entry.title}
2267
+
2268
+ ${entry.content}`
2269
+ });
2270
+ }
2271
+ return artifacts;
2169
2272
  },
2170
2273
  driftTrackedFiles() {
2171
2274
  return ["CLAUDE.md", "settings.json", ".mcp.json", "CHARTER.md", "TOOLS.md"];
@@ -4724,4 +4827,4 @@ export {
4724
4827
  detectDrift,
4725
4828
  provision
4726
4829
  };
4727
- //# sourceMappingURL=chunk-2F6REM24.js.map
4830
+ //# sourceMappingURL=chunk-IT34G2Y2.js.map