@damphuquy/agent-init 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/README.md CHANGED
@@ -1,105 +1,90 @@
1
- # RIPER-5 Coding Agents & Operational Workspace Scaffolder
1
+ # @damphuquy/agent-init
2
2
 
3
- Bộ công cụ khởi tạo bộ khung System Prompt / Agent Manual (`AGENTS.md`) và Operational Workspace (`process/`) cho bất kỳ subsystem hoặc repository nào.
3
+ Bộ công cụ khởi tạo khung System Prompt / Agent Manual (`AGENTS.md`) và Operational Workspace (`process/`) theo chuẩn **RIPER-5 Framework** cho mọi repository hoặc subsystem.
4
4
 
5
- ---
5
+ CLI sở hữu giao diện trực quan với phong cách **Tokyo Night Theme**, hỗ trợ hiển thị trạng thái chi tiết, thống kê quá trình cài đặt và hướng dẫn các bước tiếp theo.
6
6
 
7
- ## 1. Khởi tạo từ xa (Remote Execution)
7
+ ---
8
8
 
9
- Không cần clone repository, chạy trực tiếp trên máy đích.
9
+ ## 1. Khởi tạo nhanh với NPX (Khuyên dùng)
10
10
 
11
- ### Node.js (npx)
11
+ Không cần cài đặt toàn cục hay clone repository, bạn có thể khởi tạo trực tiếp bất kỳ lúc nào:
12
12
 
13
13
  ```bash
14
14
  # Khởi tạo tại thư mục hiện tại
15
15
  npx @damphuquy/agent-init .
16
16
 
17
- # Khởi tạo vào thư mục chỉ định
17
+ # Khởi tạo vào thư mục / subsystem chỉ định
18
18
  npx @damphuquy/agent-init ./my-project
19
- ```
20
-
21
- ### Linux / macOS / WSL (Bash)
22
-
23
- ```bash
24
- # Khởi tạo tại thư mục hiện tại
25
- curl -fsSL https://raw.githubusercontent.com/<USER>/<REPO>/main/bootstrap.sh | bash
26
-
27
- # Khởi tạo vào thư mục chỉ định
28
- curl -fsSL https://raw.githubusercontent.com/<USER>/<REPO>/main/bootstrap.sh | bash -s -- ./my-project
29
- ```
30
-
31
- ### Windows (PowerShell)
32
-
33
- ```powershell
34
- # Khởi tạo tại thư mục hiện tại
35
- irm https://raw.githubusercontent.com/<USER>/<REPO>/main/bootstrap.ps1 | iex
36
-
37
- # Khởi tạo vào thư mục chỉ định
38
- & ([scriptblock]::Create((irm https://raw.githubusercontent.com/<USER>/<REPO>/main/bootstrap.ps1))) -TargetDir ".\my-project"
19
+ npx @damphuquy/agent-init ./services/billing
39
20
  ```
40
21
 
41
22
  ---
42
23
 
43
24
  ## 2. Khởi tạo cục bộ (Local Execution)
44
25
 
45
- Khi đã tải hoặc clone repository về máy:
26
+ Khi làm việc trực tiếp trong repository nguồn:
46
27
 
47
28
  ```bash
48
- # Sử dụng Node.js
49
- node bin/bootstrap.js [target_directory]
29
+ # Build nguồn TypeScript
30
+ npm run build
50
31
 
51
- # Sử dụng Bash
52
- bash bootstrap.sh [target_directory]
32
+ # Chạy trực tiếp qua CLI
33
+ npm start -- [target_directory] [options]
53
34
 
54
- # Sử dụng Python
55
- python3 bootstrap.py [target_directory]
35
+ # Hoặc qua npx/node
36
+ node dist/cli.js [target_directory] [options]
37
+ node bin/bootstrap.js [target_directory] [options]
56
38
  ```
57
39
 
58
40
  ---
59
41
 
60
42
  ## 3. Tùy chọn tham số (Options)
61
43
 
62
- - `-f, --force`: Ghi đè file nếu đã tồn tại trước đó.
63
- - `-h, --help`: Hiển thị hướng dẫn sử dụng.
44
+ - `-f, --force`: Ghi đè các file đã tồn tại trước đó.
45
+ - `-h, --help`: Hiển thị bảng trợ giúp và các ví dụ sử dụng.
46
+ - `-v, --version`: Hiển thị phiên bản hiện tại.
64
47
 
65
48
  Ví dụ:
66
49
  ```bash
67
50
  npx @damphuquy/agent-init ./my-project --force
68
- bash bootstrap.sh ./my-project --force
69
51
  ```
70
52
 
71
53
  ---
72
54
 
73
- ## 4. Cấu trúc thư mục mã nguồn chỉnh sửa template
74
-
75
- Tất cả template mẫu được tách riêng biệt thành các file thực tế trong thư mục `templates/`:
55
+ ## 4. Cấu trúc mã nguồn Scaffolder (TypeScript)
76
56
 
77
57
  ```text
78
58
  .
79
- ├── templates/ # Toàn bộ nội dung template (chỉnh sửa trực tiếp tại đây)
80
- │ ├── AGENTS.md
81
- │ ├── .agents/name_rule.md
59
+ ├── src/ # nguồn TypeScript (đầy đủ Type definitions)
60
+ │ ├── types.ts # Interfaces, Types cho Palette, Theme, FileGroups, Options, Stats
61
+ │ ├── theme.ts # Tokyo Night Color Engine & ANSI formatters
62
+ │ ├── config.ts # File classification catalog & package info
63
+ │ ├── ui.ts # Box renderer, Banner & Help documentation UI
64
+ │ ├── scaffolder.ts # Core Scaffolding Engine
65
+ │ ├── cli.ts # CLI argument parser & runner entrypoint
66
+ │ └── index.ts # Public library exports
67
+ ├── templates/ # Toàn bộ template gốc (chỉnh sửa trực tiếp tại đây)
68
+ │ ├── AGENTS.md # Master Agent Manual (4 Pillars & RIPER-5 Loop)
69
+ │ ├── .agents/name_rule.md # Quy tắc đặt tên và interface
82
70
  │ └── process/
83
- │ ├── README.md
71
+ │ ├── README.md # Trung tâm điều hành task process
84
72
  │ ├── _seeds/ # Các seed templates (task, program, context)
85
- │ ├── context/ # Context routers
86
- └── development-protocols/ # Quy chuẩn lập trình & điều phối
73
+ ├── _GUIDE.md
74
+ │ ├── task-template.md.seed
75
+ │ │ ├── program-template.md.seed
76
+ │ │ └── context-group.md.seed
77
+ │ ├── context/ # Context routers & Planning standards
78
+ │ ├── development-protocols/ # Giao thức lập trình & điều phối
79
+ │ ├── features/ # Thư mục active/backlog/completed cho features
80
+ │ └── general-plans/ # Thư mục active/backlog/completed cho general plans
81
+ ├── dist/ # Compiled JavaScript & Type Declaration files (.d.ts)
87
82
  ├── bin/
88
- │ └── bootstrap.js # CLI runner đọc trực tiếp từ templates/
89
- ├── scripts/
90
- │ └── build-bundle.js # Trình biên dịch tự động templates/ vào bootstrap.sh/ps1/py
91
- ├── bootstrap.sh # Bản standalone cho curl | bash
92
- ├── bootstrap.ps1 # Bản standalone cho PowerShell irm | iex
93
- ├── bootstrap.py # Bản standalone cho Python
83
+ │ └── bootstrap.js # CLI runner forwarder
84
+ ├── tsconfig.json # TypeScript Compiler Configuration (Strict mode)
94
85
  └── package.json
95
86
  ```
96
87
 
97
- Khi bạn chỉnh sửa bất kỳ nội dung nào trong thư mục `templates/`, chỉ cần chạy lệnh sau để tự động đồng bộ sang tất cả các file thực thi đơn lẻ:
98
-
99
- ```bash
100
- npm run build
101
- ```
102
-
103
88
  ---
104
89
 
105
90
  ## 5. Cấu trúc thư mục được sinh ra trên dự án đích
@@ -138,9 +123,12 @@ npm run build
138
123
  ## 6. Các bước sau khi khởi tạo
139
124
 
140
125
  1. **Cập nhật lệnh kiểm thử trong `AGENTS.md`**:
141
- Mở file `<target_dir>/AGENTS.md` và chỉnh sửa các lệnh kiểm thử tại phần `<validation_commands>` phù hợp với công nghệ của dự án (ví dụ: `npm test`, `pytest`, `go test ./...`).
126
+ Mở file `<target_dir>/AGENTS.md` và tùy chỉnh các lệnh kiểm thử tại phần `<validation_commands>` phù hợp với stack công nghệ của dự án (ví dụ: `npm test`, `pytest`, `cargo test`, `go test ./...`).
142
127
 
143
128
  2. **Tạo task đầu tiên từ template**:
144
129
  ```bash
145
130
  cp process/_seeds/task-template.md.seed process/general-plans/active/01-init_PLAN.md
146
131
  ```
132
+
133
+ 3. **Kích hoạt AI Coding Agent**:
134
+ Yêu cầu Agent đọc file `AGENTS.md` để nắm quy trình và bắt đầu thực hiện kế hoạch trong `process/general-plans/active/01-init_PLAN.md`.
package/bin/bootstrap.js CHANGED
@@ -1,88 +1,3 @@
1
1
  #!/usr/bin/env node
2
2
 
3
- const fs = require('fs');
4
- const path = require('path');
5
-
6
- function parseArgs() {
7
- const args = process.argv.slice(2);
8
- let targetDir = '.';
9
- let force = false;
10
-
11
- for (let i = 0; i < args.length; i++) {
12
- const arg = args[i];
13
- if (arg === '--force' || arg === '-f') {
14
- force = true;
15
- } else if (arg === '--help' || arg === '-h') {
16
- console.log(`
17
- Usage:
18
- npx @damphuquy/agent-init [target_directory] [options]
19
- node bin/bootstrap.js [target_directory] [options]
20
-
21
- Options:
22
- -f, --force Overwrite existing files if present
23
- -h, --help Display this help message
24
-
25
- Examples:
26
- npx @damphuquy/agent-init .
27
- npx @damphuquy/agent-init ./services/billing --force
28
- `);
29
- process.exit(0);
30
- } else if (!arg.startsWith('-')) {
31
- targetDir = arg;
32
- }
33
- }
34
-
35
- return { targetDir, force };
36
- }
37
-
38
- function copyDirectoryRecursive(srcDir, destDir, targetBase, force, stats = { created: 0, skipped: 0 }) {
39
- if (!fs.existsSync(destDir)) {
40
- fs.mkdirSync(destDir, { recursive: true });
41
- }
42
-
43
- const entries = fs.readdirSync(srcDir, { withFileTypes: true });
44
-
45
- for (const entry of entries) {
46
- const srcPath = path.join(srcDir, entry.name);
47
- const destPath = path.join(destDir, entry.name);
48
-
49
- if (entry.isDirectory()) {
50
- copyDirectoryRecursive(srcPath, destPath, targetBase, force, stats);
51
- } else {
52
- const relPath = path.relative(targetBase, destPath);
53
- if (fs.existsSync(destPath) && !force) {
54
- console.log(` [SKIPPED] ${relPath} (already exists, use --force to overwrite)`);
55
- stats.skipped++;
56
- } else {
57
- fs.copyFileSync(srcPath, destPath);
58
- console.log(` [CREATED] ${relPath}`);
59
- stats.created++;
60
- }
61
- }
62
- }
63
-
64
- return stats;
65
- }
66
-
67
- function scaffold(targetDir, force) {
68
- const templatesDir = path.resolve(__dirname, '../templates');
69
-
70
- if (!fs.existsSync(templatesDir)) {
71
- console.error(`Error: Templates directory not found at ${templatesDir}`);
72
- process.exit(1);
73
- }
74
-
75
- const resolvedTarget = path.resolve(process.cwd(), targetDir);
76
- console.log(`Scaffolding RIPER-5 Coding Agents Workspace into: ${resolvedTarget}`);
77
-
78
- const stats = copyDirectoryRecursive(templatesDir, resolvedTarget, resolvedTarget, force);
79
-
80
- console.log(`\nSetup complete: ${stats.created} created, ${stats.skipped} skipped.`);
81
- console.log(`\nNext Steps:`);
82
- console.log(` 1. Review and customize validation commands in: ${path.join(targetDir, 'AGENTS.md')}`);
83
- console.log(` 2. Instantiate your first active task:`);
84
- console.log(` cp ${path.join(targetDir, 'process/_seeds/task-template.md.seed')} ${path.join(targetDir, 'process/general-plans/active/01-init_PLAN.md')}\n`);
85
- }
86
-
87
- const { targetDir, force } = parseArgs();
88
- scaffold(targetDir, force);
3
+ import '../dist/cli.js';
package/dist/cli.d.ts ADDED
@@ -0,0 +1,5 @@
1
+ #!/usr/bin/env node
2
+ import { CliOptions } from './types.js';
3
+ export declare function parseArgs(argv?: readonly string[]): CliOptions;
4
+ export declare function run(): void;
5
+ //# sourceMappingURL=cli.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AAMA,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAGxC,wBAAgB,SAAS,CAAC,IAAI,GAAE,SAAS,MAAM,EAA0B,GAAG,UAAU,CAoBrF;AAED,wBAAgB,GAAG,IAAI,IAAI,CAsB1B"}
package/dist/cli.js ADDED
@@ -0,0 +1,49 @@
1
+ #!/usr/bin/env node
2
+ import process from 'node:process';
3
+ import { getPackageInfo } from './config.js';
4
+ import { scaffold } from './scaffolder.js';
5
+ import { colors } from './theme.js';
6
+ import { showHelp } from './ui.js';
7
+ export function parseArgs(argv = process.argv.slice(2)) {
8
+ let targetDir = '.';
9
+ let force = false;
10
+ let help = false;
11
+ let version = false;
12
+ for (let i = 0; i < argv.length; i++) {
13
+ const arg = argv[i];
14
+ if (arg === '--force' || arg === '-f') {
15
+ force = true;
16
+ }
17
+ else if (arg === '--help' || arg === '-h') {
18
+ help = true;
19
+ }
20
+ else if (arg === '--version' || arg === '-v') {
21
+ version = true;
22
+ }
23
+ else if (!arg.startsWith('-')) {
24
+ targetDir = arg;
25
+ }
26
+ }
27
+ return { targetDir, force, help, version };
28
+ }
29
+ export function run() {
30
+ const options = parseArgs();
31
+ const pkgInfo = getPackageInfo();
32
+ if (options.help) {
33
+ showHelp(pkgInfo, colors);
34
+ process.exit(0);
35
+ }
36
+ if (options.version) {
37
+ console.log(`${pkgInfo.name} v${pkgInfo.version}`);
38
+ process.exit(0);
39
+ }
40
+ const result = scaffold({
41
+ targetDir: options.targetDir,
42
+ force: options.force,
43
+ });
44
+ if (!result.success) {
45
+ process.exit(1);
46
+ }
47
+ }
48
+ run();
49
+ //# sourceMappingURL=cli.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AAEA,OAAO,OAAO,MAAM,cAAc,CAAC;AACnC,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAEpC,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAEnC,MAAM,UAAU,SAAS,CAAC,IAAI,GAAsB,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC;IACvE,IAAI,SAAS,GAAG,GAAG,CAAC;IACpB,IAAI,KAAK,GAAG,KAAK,CAAC;IAClB,IAAI,IAAI,GAAG,KAAK,CAAC;IACjB,IAAI,OAAO,GAAG,KAAK,CAAC;IAEpB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QACrC,MAAM,GAAG,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;QACpB,IAAI,GAAG,KAAK,SAAS,IAAI,GAAG,KAAK,IAAI,EAAE,CAAC;YACtC,KAAK,GAAG,IAAI,CAAC;QACf,CAAC;aAAM,IAAI,GAAG,KAAK,QAAQ,IAAI,GAAG,KAAK,IAAI,EAAE,CAAC;YAC5C,IAAI,GAAG,IAAI,CAAC;QACd,CAAC;aAAM,IAAI,GAAG,KAAK,WAAW,IAAI,GAAG,KAAK,IAAI,EAAE,CAAC;YAC/C,OAAO,GAAG,IAAI,CAAC;QACjB,CAAC;aAAM,IAAI,CAAC,GAAG,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC;YAChC,SAAS,GAAG,GAAG,CAAC;QAClB,CAAC;IACH,CAAC;IAED,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;AAC7C,CAAC;AAED,MAAM,UAAU,GAAG;IACjB,MAAM,OAAO,GAAG,SAAS,EAAE,CAAC;IAC5B,MAAM,OAAO,GAAG,cAAc,EAAE,CAAC;IAEjC,IAAI,OAAO,CAAC,IAAI,EAAE,CAAC;QACjB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;QAC1B,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;IAED,IAAI,OAAO,CAAC,OAAO,EAAE,CAAC;QACpB,OAAO,CAAC,GAAG,CAAC,GAAG,OAAO,CAAC,IAAI,KAAK,OAAO,CAAC,OAAO,EAAE,CAAC,CAAC;QACnD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;IAED,MAAM,MAAM,GAAG,QAAQ,CAAC;QACtB,SAAS,EAAE,OAAO,CAAC,SAAS;QAC5B,KAAK,EAAE,OAAO,CAAC,KAAK;KACrB,CAAC,CAAC;IAEH,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;QACpB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;AACH,CAAC;AAED,GAAG,EAAE,CAAC"}
@@ -0,0 +1,5 @@
1
+ import { FileGroup, PackageInfo } from './types.js';
2
+ export declare const FILE_GROUPS: readonly FileGroup[];
3
+ export declare function getPackageRoot(): string;
4
+ export declare function getPackageInfo(packageRootDir?: string): PackageInfo;
5
+ //# sourceMappingURL=config.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAEpD,eAAO,MAAM,WAAW,EAAE,SAAS,SAAS,EA4C3C,CAAC;AAEF,wBAAgB,cAAc,IAAI,MAAM,CASvC;AAED,wBAAgB,cAAc,CAAC,cAAc,GAAE,MAAyB,GAAG,WAAW,CAgBrF"}
package/dist/config.js ADDED
@@ -0,0 +1,79 @@
1
+ import fs from 'node:fs';
2
+ import path from 'node:path';
3
+ import process from 'node:process';
4
+ import { fileURLToPath } from 'node:url';
5
+ export const FILE_GROUPS = [
6
+ {
7
+ title: 'Core Agent Manual & Interface Directives',
8
+ files: [
9
+ { path: 'AGENTS.md', desc: 'Master Agent Manual (4 Pillars & RIPER-5 Loop)' },
10
+ { path: '.agents/name_rule.md', desc: 'Agent naming conventions & interface contracts' },
11
+ ],
12
+ },
13
+ {
14
+ title: 'Operational Workspace Control & Seeds (_seeds/)',
15
+ files: [
16
+ { path: 'process/README.md', desc: 'Operational Workspace Control Center' },
17
+ { path: 'process/_seeds/_GUIDE.md', desc: 'Seed archetypes usage & lifecycle guide' },
18
+ { path: 'process/_seeds/task-template.md.seed', desc: 'Task Spec & Plan blueprint (INVEST & AC)' },
19
+ { path: 'process/_seeds/program-template.md.seed', desc: 'Multi-phase umbrella epic blueprint' },
20
+ { path: 'process/_seeds/context-group.md.seed', desc: 'Domain knowledge & context router blueprint' },
21
+ ],
22
+ },
23
+ {
24
+ title: 'Context Routing & Planning Standards (context/)',
25
+ files: [
26
+ { path: 'process/context/all-context.md', desc: 'Root context & knowledge routing registry' },
27
+ { path: 'process/context/planning/all-planning.md', desc: 'INVEST criteria & vertical slicing standards' },
28
+ ],
29
+ },
30
+ {
31
+ title: 'Engineering Protocols & Harness (development-protocols/)',
32
+ files: [
33
+ { path: 'process/development-protocols/all-development-protocols.md', desc: 'Development protocols index router' },
34
+ { path: 'process/development-protocols/orchestration.md', desc: 'Subagent delegation & isolation rules' },
35
+ { path: 'process/development-protocols/implementation-standards.md', desc: 'Strict typing & domain purity standards' },
36
+ ],
37
+ },
38
+ {
39
+ title: 'Lifecycle Pipelines & Task Directories (process/)',
40
+ files: [
41
+ { path: 'process/features/active/.gitkeep', desc: 'Active feature task pipeline' },
42
+ { path: 'process/features/backlog/.gitkeep', desc: 'Feature backlog & note pipeline' },
43
+ { path: 'process/features/completed/.gitkeep', desc: 'Completed feature archive pipeline' },
44
+ { path: 'process/general-plans/active/.gitkeep', desc: 'Active general plans pipeline' },
45
+ { path: 'process/general-plans/backlog/.gitkeep', desc: 'General plans backlog pipeline' },
46
+ { path: 'process/general-plans/completed/.gitkeep', desc: 'Completed general plans archive' },
47
+ ],
48
+ },
49
+ ];
50
+ export function getPackageRoot() {
51
+ try {
52
+ const currentFilePath = fileURLToPath(import.meta.url);
53
+ const currentDir = path.dirname(currentFilePath);
54
+ // When in src/ or dist/, root is one level up
55
+ return path.resolve(currentDir, '..');
56
+ }
57
+ catch {
58
+ return process.cwd();
59
+ }
60
+ }
61
+ export function getPackageInfo(packageRootDir = getPackageRoot()) {
62
+ try {
63
+ const pkgPath = path.resolve(packageRootDir, 'package.json');
64
+ if (fs.existsSync(pkgPath)) {
65
+ const content = fs.readFileSync(pkgPath, 'utf8');
66
+ const parsed = JSON.parse(content);
67
+ return {
68
+ name: parsed.name ?? '@damphuquy/agent-init',
69
+ version: parsed.version ?? '1.0.0',
70
+ description: parsed.description,
71
+ };
72
+ }
73
+ }
74
+ catch {
75
+ // fallback
76
+ }
77
+ return { name: '@damphuquy/agent-init', version: '1.0.0' };
78
+ }
79
+ //# sourceMappingURL=config.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,OAAO,MAAM,cAAc,CAAC;AACnC,OAAO,EAAE,aAAa,EAAE,MAAM,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AC;IACD,OAAO,EAAE,IAAI,EAAE,uBAAuB,EAAE,OAAO,EAAE,OAAO,EAAE,CAAC;AAC7D,CAAC"}
@@ -0,0 +1,7 @@
1
+ export * from './types.js';
2
+ export * from './theme.js';
3
+ export * from './config.js';
4
+ export * from './ui.js';
5
+ export * from './scaffolder.js';
6
+ export { parseArgs } from './cli.js';
7
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,SAAS,CAAC;AACxB,cAAc,iBAAiB,CAAC;AAChC,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,7 @@
1
+ export * from './types.js';
2
+ export * from './theme.js';
3
+ export * from './config.js';
4
+ export * from './ui.js';
5
+ export * from './scaffolder.js';
6
+ export { parseArgs } from './cli.js';
7
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,SAAS,CAAC;AACxB,cAAc,iBAAiB,CAAC;AAChC,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { ScaffoldOptions, ScaffoldResult } from './types.js';
2
+ export declare function scaffold(options: ScaffoldOptions): ScaffoldResult;
3
+ //# sourceMappingURL=scaffolder.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"scaffolder.d.ts","sourceRoot":"","sources":["../src/scaffolder.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,eAAe,EAAE,cAAc,EAAiB,MAAM,YAAY,CAAC;AAE5E,wBAAgB,QAAQ,CAAC,OAAO,EAAE,eAAe,GAAG,cAAc,CA4GjE"}
@@ -0,0 +1,96 @@
1
+ import fs from 'node:fs';
2
+ import path from 'node:path';
3
+ import process from 'node:process';
4
+ import { FILE_GROUPS, getPackageInfo, getPackageRoot } from './config.js';
5
+ import { colors } from './theme.js';
6
+ import { renderBanner, renderBox } from './ui.js';
7
+ export function scaffold(options) {
8
+ const { targetDir, force, cwd = process.cwd(), templatesDir = path.resolve(getPackageRoot(), 'templates'), } = options;
9
+ const pkgInfo = getPackageInfo();
10
+ renderBanner(pkgInfo, colors);
11
+ if (!fs.existsSync(templatesDir)) {
12
+ console.error(`\n ${colors.badgeError()} Templates directory not found at: ${colors.red(templatesDir)}\n`);
13
+ return {
14
+ success: false,
15
+ stats: { created: 0, skipped: 0, directories: 0 },
16
+ targetPath: path.resolve(cwd, targetDir),
17
+ };
18
+ }
19
+ const resolvedTarget = path.resolve(cwd, targetDir);
20
+ const displayTarget = targetDir === '.' ? cwd : resolvedTarget;
21
+ // Configuration Card
22
+ console.log(colors.purple(colors.bold(' CONFIGURATION')));
23
+ console.log(` ${colors.dim('Target Directory :')} ${colors.cyan(colors.bold(displayTarget))}`);
24
+ console.log(` ${colors.dim('Overwrite Mode :')} ${force ? colors.red(colors.bold('Enabled (--force)')) : colors.green('Disabled (Preserve existing)')}`);
25
+ console.log();
26
+ // Execution Progress
27
+ console.log(colors.purple(colors.bold(' INITIALIZING WORKSPACE')));
28
+ console.log();
29
+ const stats = { created: 0, skipped: 0, dirs: new Set() };
30
+ for (const group of FILE_GROUPS) {
31
+ console.log(` ${colors.teal(colors.bold(group.title))}`);
32
+ for (const item of group.files) {
33
+ const srcPath = path.join(templatesDir, item.path);
34
+ const destPath = path.join(resolvedTarget, item.path);
35
+ const destDir = path.dirname(destPath);
36
+ if (!fs.existsSync(destDir)) {
37
+ fs.mkdirSync(destDir, { recursive: true });
38
+ stats.dirs.add(destDir);
39
+ }
40
+ else {
41
+ stats.dirs.add(destDir);
42
+ }
43
+ const displayRelPath = item.path.replace(/\/\.gitkeep$/, '');
44
+ const desc = item.desc ? ` ${colors.comment(`— ${item.desc}`)}` : '';
45
+ if (!fs.existsSync(srcPath)) {
46
+ continue;
47
+ }
48
+ if (fs.existsSync(destPath) && !force) {
49
+ console.log(` ${colors.badgeSkipped()} ${colors.dim(displayRelPath)}${desc}`);
50
+ stats.skipped++;
51
+ }
52
+ else {
53
+ fs.copyFileSync(srcPath, destPath);
54
+ console.log(` ${colors.badgeCreated()} ${colors.fg(colors.bold(displayRelPath))}${desc}`);
55
+ stats.created++;
56
+ }
57
+ }
58
+ console.log();
59
+ }
60
+ // Summary Card
61
+ const summaryLines = [
62
+ ` ${colors.dim('Files Created :')} ${colors.green(colors.bold(String(stats.created)))}`,
63
+ ` ${colors.dim('Files Skipped :')} ${colors.yellow(colors.bold(String(stats.skipped)))}`,
64
+ ` ${colors.dim('Directories Setup :')} ${colors.blue(colors.bold(String(stats.dirs.size)))}`,
65
+ ];
66
+ console.log(renderBox(summaryLines, colors, { title: colors.teal(colors.bold('SETUP SUMMARY')) }));
67
+ console.log();
68
+ // Next Steps Guide
69
+ const relPathPrefix = targetDir === '.' ? '.' : targetDir;
70
+ const agentsPath = path.join(relPathPrefix, 'AGENTS.md');
71
+ const seedTaskPath = path.join(relPathPrefix, 'process/_seeds/task-template.md.seed');
72
+ const activePlanPath = path.join(relPathPrefix, 'process/general-plans/active/01-init_PLAN.md');
73
+ const nextStepLines = [
74
+ `${colors.cyan(colors.bold('1. Configure Validation Commands:'))}`,
75
+ ` Edit ${colors.green(agentsPath)} and specify your project test/lint/typecheck commands.`,
76
+ '',
77
+ `${colors.cyan(colors.bold('2. Instantiate Your First Active Task:'))}`,
78
+ ` ${colors.yellow(`cp ${seedTaskPath} \\`)}`,
79
+ ` ${colors.yellow(activePlanPath)}`,
80
+ '',
81
+ `${colors.cyan(colors.bold('3. Activate AI Coding Agent:'))}`,
82
+ ` Direct your agent to read ${colors.green(agentsPath)} and begin execution.`,
83
+ ];
84
+ console.log(renderBox(nextStepLines, colors, { title: colors.purple(colors.bold('NEXT STEPS')) }));
85
+ console.log();
86
+ return {
87
+ success: true,
88
+ stats: {
89
+ created: stats.created,
90
+ skipped: stats.skipped,
91
+ directories: stats.dirs.size,
92
+ },
93
+ targetPath: resolvedTarget,
94
+ };
95
+ }
96
+ //# sourceMappingURL=scaffolder.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"scaffolder.js","sourceRoot":"","sources":["../src/scaffolder.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,OAAO,MAAM,cAAc,CAAC;AACnC,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAC1E,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AACpC,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAGlD,MAAM,UAAU,QAAQ,CAAC,OAAwB;IAC/C,MAAM,EACJ,SAAS,EACT,KAAK,EACL,GAAG,GAAG,OAAO,CAAC,GAAG,EAAE,EACnB,YAAY,GAAG,IAAI,CAAC,OAAO,CAAC,cAAc,EAAE,EAAE,WAAW,CAAC,GAC3D,GAAG,OAAO,CAAC;IAEZ,MAAM,OAAO,GAAG,cAAc,EAAE,CAAC;IACjC,YAAY,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;IAE9B,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,YAAY,CAAC,EAAE,CAAC;QACjC,OAAO,CAAC,KAAK,CAAC,QAAQ,MAAM,CAAC,UAAU,EAAE,sCAAsC,MAAM,CAAC,GAAG,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC;QAC7G,OAAO;YACL,OAAO,EAAE,KAAK;YACd,KAAK,EAAE,EAAE,OAAO,EAAE,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,WAA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IAAI,CAAC,IAAI;SAC7B;QACD,UAAU,EAAE,cAAc;KAC3B,CAAC;AACJ,CAAC"}
@@ -0,0 +1,8 @@
1
+ import { TokyoNightPalette, ColorEngine, RGBTuple, ColorFunction } from './types.js';
2
+ export declare const TN: TokyoNightPalette;
3
+ export declare function isColorSupported(): boolean;
4
+ export declare function createRgbFormatter(r: number, g: number, b: number, supported: boolean): ColorFunction;
5
+ export declare function createBadgeFormatter(text: string, fgTuple: RGBTuple, bgTuple: RGBTuple, supported: boolean): () => string;
6
+ export declare function createColorEngine(supported?: boolean): ColorEngine;
7
+ export declare const colors: ColorEngine;
8
+ //# sourceMappingURL=theme.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"theme.d.ts","sourceRoot":"","sources":["../src/theme.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,WAAW,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAErF,eAAO,MAAM,EAAE,EAAE,iBAgBhB,CAAC;AAEF,wBAAgB,gBAAgB,IAAI,OAAO,CAI1C;AAED,wBAAgB,kBAAkB,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,SAAS,EAAE,OAAO,GAAG,aAAa,CAErG;AAED,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,OAAO,GAAG,MAAM,MAAM,CAOzH;AAED,wBAAgB,iBAAiB,CAAC,SAAS,GAAE,OAA4B,GAAG,WAAW,CAoBtF;AAED,eAAO,MAAM,MAAM,aAAsB,CAAC"}
package/dist/theme.js ADDED
@@ -0,0 +1,60 @@
1
+ import process from 'node:process';
2
+ export const TN = {
3
+ bg_dark: [26, 27, 38], // #1a1b26 - Night Dark
4
+ bg_highlight: [41, 46, 66], // #292e42 - Selection Dark
5
+ border: [59, 66, 97], // #3b4261 - Slate Border
6
+ comment: [86, 95, 137], // #565f89 - Muted Gray
7
+ fg: [192, 202, 245], // #c0caf5 - Moonlight White/Blue
8
+ fg_dim: [169, 177, 214], // #a9b1d6 - Soft Foreground
9
+ blue: [122, 162, 247], // #7aa2f7 - Sky Blue (Primary)
10
+ cyan: [125, 207, 255], // #7dcfff - Bright Cyan
11
+ teal: [115, 218, 202], // #73daca - Fresh Teal
12
+ purple: [187, 154, 247], // #bb9af7 - Lavender Purple
13
+ green: [158, 206, 106], // #9ece6a - Olive Green (Success)
14
+ yellow: [224, 175, 104], // #e0af68 - Ochre Yellow (Warning)
15
+ orange: [255, 158, 100], // #ff9e64 - Coral Orange
16
+ red: [247, 118, 142], // #f7768e - Ruby Red (Error)
17
+ white: [255, 255, 255],
18
+ };
19
+ export function isColorSupported() {
20
+ if (process.env.NO_COLOR || process.argv.includes('--no-color'))
21
+ return false;
22
+ if (process.env.FORCE_COLOR)
23
+ return true;
24
+ return Boolean(process.stdout.isTTY);
25
+ }
26
+ export function createRgbFormatter(r, g, b, supported) {
27
+ return (text) => (supported ? `\x1b[38;2;${r};${g};${b}m${text}\x1b[0m` : String(text));
28
+ }
29
+ export function createBadgeFormatter(text, fgTuple, bgTuple, supported) {
30
+ return () => {
31
+ if (!supported)
32
+ return `[${text}]`;
33
+ const [fr, fg, fb] = fgTuple;
34
+ const [br, bg, bb] = bgTuple;
35
+ return `\x1b[38;2;${fr};${fg};${fb}m\x1b[48;2;${br};${bg};${bb}m\x1b[1m ${text} \x1b[0m`;
36
+ };
37
+ }
38
+ export function createColorEngine(supported = isColorSupported()) {
39
+ return {
40
+ blue: createRgbFormatter(...TN.blue, supported),
41
+ cyan: createRgbFormatter(...TN.cyan, supported),
42
+ teal: createRgbFormatter(...TN.teal, supported),
43
+ purple: createRgbFormatter(...TN.purple, supported),
44
+ green: createRgbFormatter(...TN.green, supported),
45
+ yellow: createRgbFormatter(...TN.yellow, supported),
46
+ orange: createRgbFormatter(...TN.orange, supported),
47
+ red: createRgbFormatter(...TN.red, supported),
48
+ fg: createRgbFormatter(...TN.fg, supported),
49
+ dim: createRgbFormatter(...TN.fg_dim, supported),
50
+ comment: createRgbFormatter(...TN.comment, supported),
51
+ border: createRgbFormatter(...TN.border, supported),
52
+ bold: (text) => (supported ? `\x1b[1m${text}\x1b[22m` : String(text)),
53
+ italic: (text) => (supported ? `\x1b[3m${text}\x1b[23m` : String(text)),
54
+ badgeCreated: createBadgeFormatter('CREATED', TN.bg_dark, TN.green, supported),
55
+ badgeSkipped: createBadgeFormatter('SKIPPED', TN.bg_dark, TN.yellow, supported),
56
+ badgeError: createBadgeFormatter(' ERROR ', TN.white, TN.red, supported),
57
+ };
58
+ }
59
+ export const colors = createColorEngine();
60
+ //# sourceMappingURL=theme.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"theme.js","sourceRoot":"","sources":["../src/theme.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,cAAc,CAAC;AAGnC,MAAM,CAAC,MAAM,EAAE,GAAsB;IACnC,OAAO,EAAE,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,EAAS,uBAAuB;IACrD,YAAY,EAAE,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,EAAI,2BAA2B;IACzD,MAAM,EAAE,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,EAAU,yBAAyB;IACvD,OAAO,EAAE,CAAC,EAAE,EAAE,EAAE,EAAE,GAAG,CAAC,EAAQ,uBAAuB;IACrD,EAAE,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,EAAW,iCAAiC;IAC/D,MAAM,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,EAAO,4BAA4B;IAC1D,IAAI,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,EAAS,+BAA+B;IAC7D,IAAI,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,EAAS,wB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AAC,GAAG,EAAE,CAAC,MAAM,EAAE,SAAS,CAAC;QACnD,IAAI,EAAE,CAAC,IAAqB,EAAE,EAAE,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,UAAU,IAAI,UAAU,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;QACtF,MAAM,EAAE,CAAC,IAAqB,EAAE,EAAE,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,UAAU,IAAI,UAAU,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;QACxF,YAAY,EAAE,oBAAoB,CAAC,SAAS,EAAE,EAAE,CAAC,OAAO,EAAE,EAAE,CAAC,KAAK,EAAE,SAAS,CAAC;QAC9E,YAAY,EAAE,oBAAoB,CAAC,SAAS,EAAE,EAAE,CAAC,OAAO,EAAE,EAAE,CAAC,MAAM,EAAE,SAAS,CAAC;QAC/E,UAAU,EAAE,oBAAoB,CAAC,SAAS,EAAE,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,GAAG,EAAE,SAAS,CAAC;KACzE,CAAC;AACJ,CAAC;AAED,MAAM,CAAC,MAAM,MAAM,GAAG,iBAAiB,EAAE,CAAC"}
@@ -0,0 +1,87 @@
1
+ /**
2
+ * Type definitions for @damphuquy/agent-init scaffolding engine
3
+ */
4
+ export type RGBTuple = readonly [r: number, g: number, b: number];
5
+ export type ColorFunction = (text: string | number) => string;
6
+ export type BadgeFunction = () => string;
7
+ export interface TokyoNightPalette {
8
+ readonly bg_dark: RGBTuple;
9
+ readonly bg_highlight: RGBTuple;
10
+ readonly border: RGBTuple;
11
+ readonly comment: RGBTuple;
12
+ readonly fg: RGBTuple;
13
+ readonly fg_dim: RGBTuple;
14
+ readonly blue: RGBTuple;
15
+ readonly cyan: RGBTuple;
16
+ readonly teal: RGBTuple;
17
+ readonly purple: RGBTuple;
18
+ readonly green: RGBTuple;
19
+ readonly yellow: RGBTuple;
20
+ readonly orange: RGBTuple;
21
+ readonly red: RGBTuple;
22
+ readonly white: RGBTuple;
23
+ }
24
+ export interface ColorEngine {
25
+ readonly blue: ColorFunction;
26
+ readonly cyan: ColorFunction;
27
+ readonly teal: ColorFunction;
28
+ readonly purple: ColorFunction;
29
+ readonly green: ColorFunction;
30
+ readonly yellow: ColorFunction;
31
+ readonly orange: ColorFunction;
32
+ readonly red: ColorFunction;
33
+ readonly fg: ColorFunction;
34
+ readonly dim: ColorFunction;
35
+ readonly comment: ColorFunction;
36
+ readonly border: ColorFunction;
37
+ readonly bold: ColorFunction;
38
+ readonly italic: ColorFunction;
39
+ readonly badgeCreated: BadgeFunction;
40
+ readonly badgeSkipped: BadgeFunction;
41
+ readonly badgeError: BadgeFunction;
42
+ }
43
+ export interface BoxOptions {
44
+ readonly title?: string;
45
+ readonly borderColor?: ColorFunction;
46
+ readonly minWidth?: number;
47
+ }
48
+ export interface PackageInfo {
49
+ readonly name: string;
50
+ readonly version: string;
51
+ readonly description?: string;
52
+ }
53
+ export interface FileItem {
54
+ readonly path: string;
55
+ readonly desc?: string;
56
+ }
57
+ export interface FileGroup {
58
+ readonly title: string;
59
+ readonly files: readonly FileItem[];
60
+ }
61
+ export interface CliOptions {
62
+ readonly targetDir: string;
63
+ readonly force: boolean;
64
+ readonly help: boolean;
65
+ readonly version: boolean;
66
+ }
67
+ export interface ScaffoldStats {
68
+ created: number;
69
+ skipped: number;
70
+ dirs: Set<string>;
71
+ }
72
+ export interface ScaffoldOptions {
73
+ readonly targetDir: string;
74
+ readonly force: boolean;
75
+ readonly templatesDir?: string;
76
+ readonly cwd?: string;
77
+ }
78
+ export interface ScaffoldResult {
79
+ readonly success: boolean;
80
+ readonly stats: {
81
+ readonly created: number;
82
+ readonly skipped: number;
83
+ readonly directories: number;
84
+ };
85
+ readonly targetPath: string;
86
+ }
87
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,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CAAC,IAAI,EAAE,OAAO,CAAC;IACvB,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;CAC3B;AAED,MAAM,WAAW,aAAa;IAC5B,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;CACnB;AAED,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC;IACxB,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC;IAC/B,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,KAAK,EAAE;QACd,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;QACzB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;QACzB,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;KAC9B,CAAC;IACF,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;CAC7B"}
package/dist/types.js ADDED
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Type definitions for @damphuquy/agent-init scaffolding engine
3
+ */
4
+ export {};
5
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;GAEG"}
package/dist/ui.d.ts ADDED
@@ -0,0 +1,8 @@
1
+ import { BoxOptions, ColorEngine, PackageInfo } from './types.js';
2
+ export declare function stripAnsi(str: string): string;
3
+ export declare function visibleLength(str: string): number;
4
+ export declare function padEndVisible(str: string, targetWidth: number): string;
5
+ export declare function renderBox(lines: readonly string[], colors: ColorEngine, options?: BoxOptions): string;
6
+ export declare function renderBanner(pkgInfo: PackageInfo, colors: ColorEngine): void;
7
+ export declare function showHelp(pkgInfo: PackageInfo, colors: ColorEngine): void;
8
+ //# sourceMappingURL=ui.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ui.d.ts","sourceRoot":"","sources":["../src/ui.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAElE,wBAAgB,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAE7C;AAED,wBAAgB,aAAa,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAEjD;AAED,wBAAgB,aAAa,CAAC,GAAG,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,MAAM,CAItE;AAED,wBAAgB,SAAS,CACvB,KAAK,EAAE,SAAS,MAAM,EAAE,EACxB,MAAM,EAAE,WAAW,EACnB,OAAO,GAAE,UAAe,GACvB,MAAM,CAwCR;AAED,wBAAgB,YAAY,CAAC,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,WAAW,GAAG,IAAI,CAS5E;AAED,wBAAgB,QAAQ,CAAC,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,WAAW,GAAG,IAAI,CAwBxE"}
package/dist/ui.js ADDED
@@ -0,0 +1,86 @@
1
+ export function stripAnsi(str) {
2
+ return String(str).replace(/\x1b\[[0-9;]*m/g, '');
3
+ }
4
+ export function visibleLength(str) {
5
+ return stripAnsi(str).length;
6
+ }
7
+ export function padEndVisible(str, targetWidth) {
8
+ const vLen = visibleLength(str);
9
+ if (vLen >= targetWidth)
10
+ return str;
11
+ return str + ' '.repeat(targetWidth - vLen);
12
+ }
13
+ export function renderBox(lines, colors, options = {}) {
14
+ const { title = '', borderColor = colors.border, minWidth = 76 } = options;
15
+ let maxContentLen = 0;
16
+ for (const item of lines) {
17
+ if (item !== '---' && item !== '') {
18
+ maxContentLen = Math.max(maxContentLen, visibleLength(item));
19
+ }
20
+ }
21
+ if (title) {
22
+ maxContentLen = Math.max(maxContentLen, visibleLength(title) + 4);
23
+ }
24
+ const width = Math.max(minWidth, maxContentLen + 4);
25
+ const contentWidth = width - 4;
26
+ const topBorder = '─'.repeat(width - 2);
27
+ const out = [];
28
+ if (title) {
29
+ const titleLen = visibleLength(title);
30
+ const rightDashes = '─'.repeat(Math.max(0, width - 5 - titleLen));
31
+ out.push(` ${borderColor('╭─ ')}${title} ${borderColor(`${rightDashes}╮`)}`);
32
+ }
33
+ else {
34
+ out.push(` ${borderColor(`╭${topBorder}╮`)}`);
35
+ }
36
+ for (const item of lines) {
37
+ if (item === '---') {
38
+ out.push(` ${borderColor(`├${topBorder}┤`)}`);
39
+ }
40
+ else if (item === '') {
41
+ out.push(` ${borderColor('│')}${' '.repeat(width - 2)}${borderColor('│')}`);
42
+ }
43
+ else {
44
+ const padded = padEndVisible(item, contentWidth);
45
+ out.push(` ${borderColor('│')} ${padded} ${borderColor('│')}`);
46
+ }
47
+ }
48
+ out.push(` ${borderColor(`╰${topBorder}╯`)}`);
49
+ return out.join('\n');
50
+ }
51
+ export function renderBanner(pkgInfo, colors) {
52
+ const bannerLines = [
53
+ colors.purple(colors.bold('RIPER-5 CODING AGENTS & OPERATIONAL WORKSPACE')),
54
+ colors.cyan('Deterministic Framework & Engineering Harness for AI Agents'),
55
+ colors.comment(`${pkgInfo.name} • v${pkgInfo.version} • Tokyo Night Theme`),
56
+ ];
57
+ console.log();
58
+ console.log(renderBox(bannerLines, colors));
59
+ console.log();
60
+ }
61
+ export function showHelp(pkgInfo, colors) {
62
+ renderBanner(pkgInfo, colors);
63
+ console.log(colors.purple(colors.bold(' USAGE')));
64
+ console.log(` ${colors.cyan('$')} ${colors.green('npx @damphuquy/agent-init')} ${colors.dim('[target_directory]')} ${colors.yellow('[options]')}`);
65
+ console.log(` ${colors.cyan('$')} ${colors.green('node dist/cli.js')} ${colors.dim('[target_directory]')} ${colors.yellow('[options]')}`);
66
+ console.log();
67
+ console.log(colors.purple(colors.bold(' ARGUMENTS')));
68
+ console.log(` ${colors.cyan('target_directory')} Destination path for workspace ${colors.comment('(default: .)')}`);
69
+ console.log();
70
+ console.log(colors.purple(colors.bold(' OPTIONS')));
71
+ console.log(` ${colors.yellow('-f, --force')} Overwrite existing files if already present`);
72
+ console.log(` ${colors.yellow('-h, --help')} Display this help documentation`);
73
+ console.log(` ${colors.yellow('-v, --version')} Display version number`);
74
+ console.log();
75
+ console.log(colors.purple(colors.bold(' EXAMPLES')));
76
+ console.log(` ${colors.comment('# Scaffold into current directory:')}`);
77
+ console.log(` ${colors.cyan('$')} npx @damphuquy/agent-init .`);
78
+ console.log();
79
+ console.log(` ${colors.comment('# Scaffold into a specific project or subsystem:')}`);
80
+ console.log(` ${colors.cyan('$')} npx @damphuquy/agent-init ./services/ai-agent`);
81
+ console.log();
82
+ console.log(` ${colors.comment('# Force overwrite existing files:')}`);
83
+ console.log(` ${colors.cyan('$')} npx @damphuquy/agent-init . --force`);
84
+ console.log();
85
+ }
86
+ //# sourceMappingURL=ui.js.map
package/dist/ui.js.map ADDED
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ui.js","sourceRoot":"","sources":["../src/ui.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,SAAS,CAAC,GAAW;IACnC,OAAO,MAAM,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,iBAAiB,EAAE,EAAE,CAAC,CAAC;AACpD,CAAC;AAED,MAAM,UAAU,aAAa,CAAC,GAAW;IACvC,OAAO,SAAS,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC;AAC/B,CAAC;AAED,MAAM,UAAU,aAAa,CAAC,GAAW,EAAE,WAAmB;IAC5D,MAAM,IAAI,GAAG,aAAa,CAAC,GAAG,CAAC,CAAC;IAChC,IAAI,IAAI,IAAI,WAAW;QAAE,OAAO,GAAG,CAAC;IACpC,OAAO,GAAG,GAAG,GAAG,CAAC,MAAM,CAAC,WAAW,GAAG,IAAI,CAAC,CAAC;AAC9C,CAAC;AAED,MAAM,UAAU,SAAS,CACvB,KAAwB,EACxB,MAA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AC,CAAC;IACrG,OAAO,CAAC,GAAG,CAAC,OAAO,MAAM,CAAC,MAAM,CAAC,YAAY,CAAC,yCAAyC,CAAC,CAAC;IACzF,OAAO,CAAC,GAAG,CAAC,OAAO,MAAM,CAAC,MAAM,CAAC,eAAe,CAAC,6BAA6B,CAAC,CAAC;IAChF,OAAO,CAAC,GAAG,EAAE,CAAC;IACd,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;IACtD,OAAO,CAAC,GAAG,CAAC,OAAO,MAAM,CAAC,OAAO,CAAC,oCAAoC,CAAC,EAAE,CAAC,CAAC;IAC3E,OAAO,CAAC,GAAG,CAAC,OAAO,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,8BAA8B,CAAC,CAAC;IACnE,OAAO,CAAC,GAAG,EAAE,CAAC;IACd,OAAO,CAAC,GAAG,CAAC,OAAO,MAAM,CAAC,OAAO,CAAC,kDAAkD,CAAC,EAAE,CAAC,CAAC;IACzF,OAAO,CAAC,GAAG,CAAC,OAAO,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,gDAAgD,CAAC,CAAC;IACrF,OAAO,CAAC,GAAG,EAAE,CAAC;IACd,OAAO,CAAC,GAAG,CAAC,OAAO,MAAM,CAAC,OAAO,CAAC,mCAAmC,CAAC,EAAE,CAAC,CAAC;IAC1E,OAAO,CAAC,GAAG,CAAC,OAAO,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,sCAAsC,CAAC,CAAC;IAC3E,OAAO,CAAC,GAAG,EAAE,CAAC;AAChB,CAAC"}
package/package.json CHANGED
@@ -1,22 +1,28 @@
1
1
  {
2
2
  "name": "@damphuquy/agent-init",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "description": "Scaffolding CLI to bootstrap RIPER-5 Coding Agents & Operational Workspace",
5
- "main": "bin/bootstrap.js",
5
+ "type": "module",
6
+ "main": "./dist/index.js",
7
+ "types": "./dist/index.d.ts",
6
8
  "bin": {
7
- "agent-init": "./bin/bootstrap.js"
9
+ "agent-init": "./dist/cli.js"
8
10
  },
9
11
  "files": [
10
- "bin",
11
- "templates"
12
+ "dist",
13
+ "templates",
14
+ "bin"
12
15
  ],
13
16
  "publishConfig": {
14
17
  "access": "public"
15
18
  },
16
19
  "scripts": {
17
- "build": "node scripts/build-bundle.js",
18
- "start": "node ./bin/bootstrap.js",
19
- "scaffold": "node ./bin/bootstrap.js"
20
+ "build": "tsc",
21
+ "typecheck": "tsc --noEmit",
22
+ "prepublishOnly": "npm run build",
23
+ "start": "node ./dist/cli.js",
24
+ "scaffold": "node ./dist/cli.js",
25
+ "test": "node ./dist/cli.js --help"
20
26
  },
21
27
  "keywords": [
22
28
  "ai-agent",
@@ -31,5 +37,9 @@
31
37
  "license": "MIT",
32
38
  "engines": {
33
39
  "node": ">=16.0.0"
40
+ },
41
+ "devDependencies": {
42
+ "@types/node": "^26.4.0",
43
+ "typescript": "^7.0.2"
34
44
  }
35
45
  }