kiro-agents 1.8.0 → 1.9.1

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,80 @@ 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
+ console.log("ℹ️ Registry data prepared (write disabled - manual activation required)");
136
+ }
62
137
  async function installFile(relativePath, installDir, sourceDir) {
63
138
  const destPath = join(installDir, relativePath);
64
139
  if (existsSync(destPath)) {
@@ -74,9 +149,9 @@ async function installFile(relativePath, installDir, sourceDir) {
74
149
  console.log(`✅ Installed: ${relativePath}`);
75
150
  }
76
151
  async function install() {
77
- console.log(`� Installinng kiro-agents system...
152
+ console.log(`\uD83D\uDE80 Installing kiro-agents system...
78
153
  `);
79
- console.log(" InTstalling steering files to ~/.kiro/steering/kiro-agents/");
154
+ console.log("\uD83D\uDCC4 Installing steering files to ~/.kiro/steering/kiro-agents/");
80
155
  if (existsSync(STEERING_INSTALL_DIR)) {
81
156
  console.log("\uD83D\uDDD1️ Removing existing steering installation...");
82
157
  const { rmSync } = await import("fs");
@@ -96,11 +171,27 @@ async function install() {
96
171
  await installFile(file, POWER_INSTALL_DIR, "power");
97
172
  }
98
173
  console.log(`
174
+ \uD83D\uDCDD Registry registration (currently disabled)...`);
175
+ try {
176
+ await registerPowerInRegistry();
177
+ } catch (error) {
178
+ console.warn("⚠️ Warning: Could not register power in registry:", error instanceof Error ? error.message : error);
179
+ console.warn(" The power files are installed but may not appear in Kiro Powers UI.");
180
+ console.warn(" You can manually add the power via: Powers panel → Add Repository → Local Directory");
181
+ console.warn(` Path: ${POWER_INSTALL_DIR}`);
182
+ }
183
+ console.log(`
99
184
  ✨ Installation completed successfully!`);
100
185
  console.log(`
101
186
  \uD83D\uDCC1 Steering files: ${STEERING_INSTALL_DIR}`);
102
187
  console.log(`\uD83D\uDCC1 Power files: ${POWER_INSTALL_DIR}`);
103
188
  console.log(`
189
+ \uD83D\uDCA1 To activate the kiro-protocols power:`);
190
+ console.log(" 1. Open Kiro IDE Powers panel");
191
+ console.log(" 2. Add Repository → Local Directory");
192
+ console.log(` 3. Select: ${POWER_INSTALL_DIR}`);
193
+ console.log(" 4. Install the power");
194
+ console.log(`
104
195
  \uD83D\uDCA1 Files are set to read-only. To modify them, change permissions first.`);
105
196
  console.log(`
106
197
  \uD83D\uDD04 To update, simply run 'npx kiro-agents' again.`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kiro-agents",
3
- "version": "1.8.0",
3
+ "version": "1.9.1",
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": {