kiro-agents 1.8.0 → 1.9.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.
@@ -27,6 +27,7 @@ var __filename2 = fileURLToPath(import.meta.url);
27
27
  var __dirname2 = dirname(__filename2);
28
28
  var STEERING_INSTALL_DIR = join(homedir(), ".kiro", "steering", "kiro-agents");
29
29
  var POWER_INSTALL_DIR = join(homedir(), ".kiro", "powers", "kiro-protocols");
30
+ var REGISTRY_PATH = join(homedir(), ".kiro", "powers", "registry.json");
30
31
  var STEERING_FILES = [
31
32
  "strict-mode.md",
32
33
  "agents.md",
@@ -59,6 +60,81 @@ async function setReadOnly(filePath) {
59
60
  console.warn(`⚠️ Could not set read-only: ${filePath}`);
60
61
  }
61
62
  }
63
+ async function extractPowerMetadata(powerMdPath) {
64
+ const { readFile } = await import("fs/promises");
65
+ const content = await readFile(powerMdPath, "utf-8");
66
+ const frontmatterMatch = content.match(/^---\n([\s\S]*?)\n---/);
67
+ if (!frontmatterMatch || !frontmatterMatch[1]) {
68
+ throw new Error("No frontmatter found in POWER.md");
69
+ }
70
+ const frontmatter = frontmatterMatch[1];
71
+ const extractField = (pattern, defaultValue) => {
72
+ const match = frontmatter.match(pattern);
73
+ return match && match[1] ? match[1].trim() : defaultValue;
74
+ };
75
+ const extractKeywords = () => {
76
+ const match = frontmatter.match(/^keywords:\s*\[(.*?)\]$/m);
77
+ if (!match || !match[1])
78
+ return [];
79
+ return match[1].split(",").map((k) => k.trim().replace(/["']/g, ""));
80
+ };
81
+ return {
82
+ name: extractField(/^name:\s*["']?([^"'\n]+)["']?$/m, "kiro-protocols"),
83
+ displayName: extractField(/^displayName:\s*["']?([^"'\n]+)["']?$/m, "Kiro Protocols"),
84
+ description: extractField(/^description:\s*["']?([^"'\n]+)["']?$/m, ""),
85
+ keywords: extractKeywords(),
86
+ author: extractField(/^author:\s*["']?([^"'\n]+)["']?$/m, "")
87
+ };
88
+ }
89
+ async function registerPowerInRegistry() {
90
+ const { readFile, writeFile, mkdir } = await import("fs/promises");
91
+ const registryDir = dirname(REGISTRY_PATH);
92
+ await mkdir(registryDir, { recursive: true });
93
+ let registry;
94
+ if (existsSync(REGISTRY_PATH)) {
95
+ const content = await readFile(REGISTRY_PATH, "utf-8");
96
+ registry = JSON.parse(content);
97
+ } else {
98
+ registry = {
99
+ version: "1.0.0",
100
+ powers: {},
101
+ repoSources: {},
102
+ lastUpdated: new Date().toISOString()
103
+ };
104
+ }
105
+ const powerMdPath = join(POWER_INSTALL_DIR, "POWER.md");
106
+ const metadata = await extractPowerMetadata(powerMdPath);
107
+ const repoId = `npx-kiro-agents-${Date.now()}`;
108
+ registry.powers[metadata.name] = {
109
+ name: metadata.name,
110
+ displayName: metadata.displayName,
111
+ description: metadata.description,
112
+ mcpServers: [],
113
+ author: metadata.author,
114
+ keywords: metadata.keywords,
115
+ installed: true,
116
+ installedAt: new Date().toISOString(),
117
+ installPath: POWER_INSTALL_DIR,
118
+ source: {
119
+ type: "local",
120
+ repoId,
121
+ repoName: "npx kiro-agents"
122
+ },
123
+ sourcePath: POWER_INSTALL_DIR
124
+ };
125
+ registry.repoSources[repoId] = {
126
+ name: "npx kiro-agents",
127
+ type: "local",
128
+ enabled: true,
129
+ addedAt: new Date().toISOString(),
130
+ path: POWER_INSTALL_DIR,
131
+ lastSync: new Date().toISOString(),
132
+ powerCount: 1
133
+ };
134
+ registry.lastUpdated = new Date().toISOString();
135
+ await writeFile(REGISTRY_PATH, JSON.stringify(registry, null, 2), "utf-8");
136
+ console.log("✅ Registered power in Kiro registry");
137
+ }
62
138
  async function installFile(relativePath, installDir, sourceDir) {
63
139
  const destPath = join(installDir, relativePath);
64
140
  if (existsSync(destPath)) {
@@ -74,9 +150,9 @@ async function installFile(relativePath, installDir, sourceDir) {
74
150
  console.log(`✅ Installed: ${relativePath}`);
75
151
  }
76
152
  async function install() {
77
- console.log(`� Installinng kiro-agents system...
153
+ console.log(`\uD83D\uDE80 Installing kiro-agents system...
78
154
  `);
79
- console.log(" InTstalling steering files to ~/.kiro/steering/kiro-agents/");
155
+ console.log("\uD83D\uDCC4 Installing steering files to ~/.kiro/steering/kiro-agents/");
80
156
  if (existsSync(STEERING_INSTALL_DIR)) {
81
157
  console.log("\uD83D\uDDD1️ Removing existing steering installation...");
82
158
  const { rmSync } = await import("fs");
@@ -96,12 +172,23 @@ async function install() {
96
172
  await installFile(file, POWER_INSTALL_DIR, "power");
97
173
  }
98
174
  console.log(`
175
+ \uD83D\uDCDD Registering power in Kiro registry...`);
176
+ try {
177
+ await registerPowerInRegistry();
178
+ } catch (error) {
179
+ console.warn("⚠️ Warning: Could not register power in registry:", error instanceof Error ? error.message : error);
180
+ console.warn(" The power files are installed but may not appear in Kiro Powers UI.");
181
+ console.warn(" You can manually add the power via: Powers panel → Add Repository → Local Directory");
182
+ console.warn(` Path: ${POWER_INSTALL_DIR}`);
183
+ }
184
+ console.log(`
99
185
  ✨ Installation completed successfully!`);
100
186
  console.log(`
101
187
  \uD83D\uDCC1 Steering files: ${STEERING_INSTALL_DIR}`);
102
188
  console.log(`\uD83D\uDCC1 Power files: ${POWER_INSTALL_DIR}`);
103
189
  console.log(`
104
- \uD83D\uDCA1 Files are set to read-only. To modify them, change permissions first.`);
190
+ \uD83D\uDCA1 The kiro-protocols power should now appear as installed in Kiro Powers UI.`);
191
+ console.log("\uD83D\uDCA1 Files are set to read-only. To modify them, change permissions first.");
105
192
  console.log(`
106
193
  \uD83D\uDD04 To update, simply run 'npx kiro-agents' again.`);
107
194
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kiro-agents",
3
- "version": "1.8.0",
3
+ "version": "1.9.0",
4
4
  "description": "Advanced AI agent system for Kiro IDE - Create specialized AI agents, switch interaction modes, and enhance development workflows with minimal cognitive overhead",
5
5
  "homepage": "https://github.com/Theadd/kiro-agents#readme",
6
6
  "repository": {