kiro-agents 1.0.0 → 1.0.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.
- package/bin/cli.js +81 -0
- package/bin/cli.ts +16 -5
- package/package.json +2 -2
package/bin/cli.js
ADDED
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { createRequire } from "node:module";
|
|
3
|
+
var __create = Object.create;
|
|
4
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
5
|
+
var __defProp = Object.defineProperty;
|
|
6
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __toESM = (mod, isNodeMode, target) => {
|
|
9
|
+
target = mod != null ? __create(__getProtoOf(mod)) : {};
|
|
10
|
+
const to = isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target;
|
|
11
|
+
for (let key of __getOwnPropNames(mod))
|
|
12
|
+
if (!__hasOwnProp.call(to, key))
|
|
13
|
+
__defProp(to, key, {
|
|
14
|
+
get: () => mod[key],
|
|
15
|
+
enumerable: true
|
|
16
|
+
});
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __require = /* @__PURE__ */ createRequire(import.meta.url);
|
|
20
|
+
|
|
21
|
+
// bin/cli.ts
|
|
22
|
+
import { join, dirname } from "path";
|
|
23
|
+
import { homedir } from "os";
|
|
24
|
+
import { existsSync, chmodSync, constants } from "fs";
|
|
25
|
+
import { fileURLToPath } from "url";
|
|
26
|
+
var __filename2 = fileURLToPath(import.meta.url);
|
|
27
|
+
var __dirname2 = dirname(__filename2);
|
|
28
|
+
var INSTALL_DIR = join(homedir(), ".kiro", "steering");
|
|
29
|
+
var FILES_TO_INSTALL = [
|
|
30
|
+
"agent-system.md",
|
|
31
|
+
"modes-system.md",
|
|
32
|
+
"agent-system/strict-mode.md",
|
|
33
|
+
"agent-system/kiro-spec-mode.md",
|
|
34
|
+
"agent-system/kiro-vibe-mode.md",
|
|
35
|
+
"agent-system/interactions/chit-chat.md",
|
|
36
|
+
"agent-system/interactions/interaction-styles.md",
|
|
37
|
+
"agent-system/tools/client-tools.md"
|
|
38
|
+
];
|
|
39
|
+
async function setWritable(filePath) {
|
|
40
|
+
try {
|
|
41
|
+
chmodSync(filePath, constants.S_IRUSR | constants.S_IWUSR | constants.S_IRGRP | constants.S_IROTH);
|
|
42
|
+
} catch (error) {}
|
|
43
|
+
}
|
|
44
|
+
async function setReadOnly(filePath) {
|
|
45
|
+
try {
|
|
46
|
+
chmodSync(filePath, constants.S_IRUSR | constants.S_IRGRP | constants.S_IROTH);
|
|
47
|
+
} catch (error) {
|
|
48
|
+
console.warn(`⚠️ Could not set read-only: ${filePath}`);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
async function installFile(relativePath) {
|
|
52
|
+
const destPath = join(INSTALL_DIR, relativePath);
|
|
53
|
+
if (existsSync(destPath)) {
|
|
54
|
+
await setWritable(destPath);
|
|
55
|
+
}
|
|
56
|
+
const srcPath = join(__dirname2, "..", "dist", relativePath);
|
|
57
|
+
const { readFile, writeFile, mkdir } = await import("fs/promises");
|
|
58
|
+
const content = await readFile(srcPath);
|
|
59
|
+
const destDir = dirname(destPath);
|
|
60
|
+
await mkdir(destDir, { recursive: true });
|
|
61
|
+
await writeFile(destPath, content);
|
|
62
|
+
await setReadOnly(destPath);
|
|
63
|
+
console.log(`✅ Installed: ${relativePath}`);
|
|
64
|
+
}
|
|
65
|
+
async function install() {
|
|
66
|
+
console.log(`\uD83D\uDCE6 Installing kiro-agents to ~/.kiro/steering/
|
|
67
|
+
`);
|
|
68
|
+
for (const file of FILES_TO_INSTALL) {
|
|
69
|
+
await installFile(file);
|
|
70
|
+
}
|
|
71
|
+
console.log(`
|
|
72
|
+
✨ Installation completed successfully!`);
|
|
73
|
+
console.log(`
|
|
74
|
+
\uD83D\uDCC1 Files installed to: ${INSTALL_DIR}`);
|
|
75
|
+
console.log(`
|
|
76
|
+
\uD83D\uDCA1 Files are set to read-only. To modify them, change permissions first.`);
|
|
77
|
+
}
|
|
78
|
+
install().catch((error) => {
|
|
79
|
+
console.error("❌ Installation failed:", error);
|
|
80
|
+
process.exit(1);
|
|
81
|
+
});
|
package/bin/cli.ts
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
|
-
#!/usr/bin/env
|
|
2
|
-
import { join } from "path";
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { join, dirname } from "path";
|
|
3
3
|
import { homedir } from "os";
|
|
4
4
|
import { existsSync, chmodSync, constants } from "fs";
|
|
5
|
+
import { fileURLToPath } from "url";
|
|
6
|
+
|
|
7
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
8
|
+
const __dirname = dirname(__filename);
|
|
5
9
|
|
|
6
10
|
const INSTALL_DIR = join(homedir(), ".kiro", "steering");
|
|
7
11
|
|
|
@@ -42,11 +46,18 @@ async function installFile(relativePath: string): Promise<void> {
|
|
|
42
46
|
}
|
|
43
47
|
|
|
44
48
|
// Get source file from package dist/
|
|
45
|
-
const srcPath = join(
|
|
46
|
-
|
|
49
|
+
const srcPath = join(__dirname, "..", "dist", relativePath);
|
|
50
|
+
|
|
51
|
+
// Read file using fs for Node.js compatibility
|
|
52
|
+
const { readFile, writeFile, mkdir } = await import("fs/promises");
|
|
53
|
+
const content = await readFile(srcPath);
|
|
54
|
+
|
|
55
|
+
// Ensure directory exists
|
|
56
|
+
const destDir = dirname(destPath);
|
|
57
|
+
await mkdir(destDir, { recursive: true });
|
|
47
58
|
|
|
48
59
|
// Write file
|
|
49
|
-
await
|
|
60
|
+
await writeFile(destPath, content);
|
|
50
61
|
|
|
51
62
|
// Set read-only
|
|
52
63
|
await setReadOnly(destPath);
|
package/package.json
CHANGED