archondev 2.1.1 → 2.1.2
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 +23 -0
- package/dist/index.js +48 -17
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -124,6 +124,29 @@ This works similarly to how Claude Code allows subscription-based access. We're
|
|
|
124
124
|
3. **Changes Are Validated** — Quality gates check code before it's applied
|
|
125
125
|
4. **Learnings Persist** — Insights saved for future sessions
|
|
126
126
|
|
|
127
|
+
## Cloud Execution
|
|
128
|
+
|
|
129
|
+
Run AI agents in the cloud — close your laptop and get a PR when it's done.
|
|
130
|
+
|
|
131
|
+
```bash
|
|
132
|
+
# 1. Authenticate
|
|
133
|
+
archon login
|
|
134
|
+
|
|
135
|
+
# 2. Connect GitHub (one-time setup)
|
|
136
|
+
archon github connect # Opens browser for authorization
|
|
137
|
+
archon github status # Verify connection
|
|
138
|
+
|
|
139
|
+
# 3. Plan locally, execute in cloud
|
|
140
|
+
archon plan "add user settings page"
|
|
141
|
+
archon execute ATOM-001 --cloud
|
|
142
|
+
|
|
143
|
+
# 4. Check progress
|
|
144
|
+
archon cloud status # List all cloud executions
|
|
145
|
+
archon cloud logs <id> # View execution logs
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
The cloud worker clones your repo, runs the Executor agent, creates a feature branch, and opens a PR. You can close your terminal after queuing.
|
|
149
|
+
|
|
127
150
|
## Working with Existing Projects
|
|
128
151
|
|
|
129
152
|
Have a project created by another AI agent? ArchonDev can review it first, then govern future changes.
|
package/dist/index.js
CHANGED
|
@@ -418,6 +418,14 @@ var PROGRESS_FILE = "progress.txt";
|
|
|
418
418
|
var ARCHON_DIR = ".archon";
|
|
419
419
|
var CACHE_DIR = ".archon/cache";
|
|
420
420
|
var ARCHIVE_DIR = "docs/archive";
|
|
421
|
+
var DEFAULT_THRESHOLDS = {
|
|
422
|
+
progressMaxLines: 500,
|
|
423
|
+
progressMaxKb: 100,
|
|
424
|
+
archonDirMaxMb: 10,
|
|
425
|
+
progressArchiveDays: 30,
|
|
426
|
+
cacheRetentionDays: 7,
|
|
427
|
+
cloudLogRetentionDays: 30
|
|
428
|
+
};
|
|
421
429
|
function formatBytes(bytes) {
|
|
422
430
|
if (bytes === 0) return "0 B";
|
|
423
431
|
const k = 1024;
|
|
@@ -446,17 +454,30 @@ function getDirSize(dirPath) {
|
|
|
446
454
|
return totalSize;
|
|
447
455
|
}
|
|
448
456
|
async function loadCleanupConfig(cwd) {
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
457
|
+
let cleanup = void 0;
|
|
458
|
+
const projectConfigPath = join3(cwd, "archon.config.yaml");
|
|
459
|
+
if (existsSync3(projectConfigPath)) {
|
|
460
|
+
try {
|
|
461
|
+
const content = await readFile3(projectConfigPath, "utf-8");
|
|
462
|
+
const config = yaml.parse(content);
|
|
463
|
+
if (config.cleanup) {
|
|
464
|
+
cleanup = config.cleanup;
|
|
465
|
+
}
|
|
466
|
+
} catch {
|
|
467
|
+
}
|
|
452
468
|
}
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
469
|
+
const localConfigPath = join3(cwd, CONFIG_PATH);
|
|
470
|
+
if (existsSync3(localConfigPath)) {
|
|
471
|
+
try {
|
|
472
|
+
const content = await readFile3(localConfigPath, "utf-8");
|
|
473
|
+
const config = yaml.parse(content);
|
|
474
|
+
if (config.cleanup) {
|
|
475
|
+
cleanup = { ...cleanup, ...config.cleanup };
|
|
476
|
+
}
|
|
477
|
+
} catch {
|
|
478
|
+
}
|
|
459
479
|
}
|
|
480
|
+
return cleanup;
|
|
460
481
|
}
|
|
461
482
|
async function saveCleanupConfig(cwd, cleanup) {
|
|
462
483
|
const configPath = join3(cwd, CONFIG_PATH);
|
|
@@ -562,16 +583,19 @@ async function parseProgressEntries(content) {
|
|
|
562
583
|
async function cleanupCheck() {
|
|
563
584
|
const cwd = process.cwd();
|
|
564
585
|
const results = [];
|
|
586
|
+
const config = await loadCleanupConfig(cwd);
|
|
587
|
+
const progressMaxKb = config?.progressMaxKb ?? DEFAULT_THRESHOLDS.progressMaxKb;
|
|
588
|
+
const archonDirMaxMb = config?.archonDirMaxMb ?? DEFAULT_THRESHOLDS.archonDirMaxMb;
|
|
565
589
|
console.log(chalk3.blue("\n\u{1F50D} Analyzing workspace for maintenance needs...\n"));
|
|
566
590
|
const progressPath = join3(cwd, PROGRESS_FILE);
|
|
567
591
|
if (existsSync3(progressPath)) {
|
|
568
592
|
const size = statSync(progressPath).size;
|
|
569
593
|
let status2 = "ok";
|
|
570
594
|
let recommendation;
|
|
571
|
-
if (size >
|
|
595
|
+
if (size > progressMaxKb * 2 * 1024) {
|
|
572
596
|
status2 = "critical";
|
|
573
597
|
recommendation = "Archive old entries with: archon cleanup run";
|
|
574
|
-
} else if (size >
|
|
598
|
+
} else if (size > progressMaxKb * 1024) {
|
|
575
599
|
status2 = "warn";
|
|
576
600
|
recommendation = "Consider archiving entries older than 30 days";
|
|
577
601
|
}
|
|
@@ -588,7 +612,7 @@ async function cleanupCheck() {
|
|
|
588
612
|
const size = getDirSize(archonPath);
|
|
589
613
|
let status2 = "ok";
|
|
590
614
|
let recommendation;
|
|
591
|
-
if (size >
|
|
615
|
+
if (size > archonDirMaxMb * 1024 * 1024) {
|
|
592
616
|
status2 = "warn";
|
|
593
617
|
recommendation = "Clear stale cache files with: archon cleanup run";
|
|
594
618
|
}
|
|
@@ -662,13 +686,17 @@ async function cleanupRun() {
|
|
|
662
686
|
const cwd = process.cwd();
|
|
663
687
|
const results = [];
|
|
664
688
|
let totalSaved = 0;
|
|
689
|
+
const config = await loadCleanupConfig(cwd);
|
|
690
|
+
const progressArchiveDays = config?.progressArchiveDays ?? DEFAULT_THRESHOLDS.progressArchiveDays;
|
|
691
|
+
const cacheRetentionDays = config?.cacheRetentionDays ?? DEFAULT_THRESHOLDS.cacheRetentionDays;
|
|
692
|
+
const cloudLogRetentionDays = config?.cloudLogRetentionDays ?? DEFAULT_THRESHOLDS.cloudLogRetentionDays;
|
|
665
693
|
console.log(chalk3.blue("\n\u{1F9F9} Running workspace cleanup...\n"));
|
|
666
694
|
const progressPath = join3(cwd, PROGRESS_FILE);
|
|
667
695
|
if (existsSync3(progressPath)) {
|
|
668
696
|
const content = await readFile3(progressPath, "utf-8");
|
|
669
697
|
const entries = await parseProgressEntries(content);
|
|
670
698
|
const cutoffDate = /* @__PURE__ */ new Date();
|
|
671
|
-
cutoffDate.setDate(cutoffDate.getDate() -
|
|
699
|
+
cutoffDate.setDate(cutoffDate.getDate() - progressArchiveDays);
|
|
672
700
|
const oldEntries = entries.filter((e) => e.date < cutoffDate);
|
|
673
701
|
const recentEntries = entries.filter((e) => e.date >= cutoffDate);
|
|
674
702
|
if (oldEntries.length > 0) {
|
|
@@ -713,7 +741,7 @@ async function cleanupRun() {
|
|
|
713
741
|
}
|
|
714
742
|
const cachePath = join3(cwd, CACHE_DIR);
|
|
715
743
|
if (existsSync3(cachePath)) {
|
|
716
|
-
const staleCache = await getStaleFiles(cachePath,
|
|
744
|
+
const staleCache = await getStaleFiles(cachePath, cacheRetentionDays);
|
|
717
745
|
let cacheSaved = 0;
|
|
718
746
|
for (const file of staleCache) {
|
|
719
747
|
try {
|
|
@@ -734,7 +762,7 @@ async function cleanupRun() {
|
|
|
734
762
|
}
|
|
735
763
|
const cloudLogsPath = join3(cwd, ".archon", "cloud-logs");
|
|
736
764
|
if (existsSync3(cloudLogsPath)) {
|
|
737
|
-
const staleLogs = await getStaleFiles(cloudLogsPath,
|
|
765
|
+
const staleLogs = await getStaleFiles(cloudLogsPath, cloudLogRetentionDays);
|
|
738
766
|
let logsSaved = 0;
|
|
739
767
|
for (const file of staleLogs) {
|
|
740
768
|
try {
|
|
@@ -818,16 +846,19 @@ async function shouldRunAutoCleanup(cwd) {
|
|
|
818
846
|
async function runAutoCleanupCheck(cwd) {
|
|
819
847
|
const progressPath = join3(cwd, PROGRESS_FILE);
|
|
820
848
|
const archonPath = join3(cwd, ARCHON_DIR);
|
|
849
|
+
const config = await loadCleanupConfig(cwd);
|
|
850
|
+
const progressMaxKb = config?.progressMaxKb ?? DEFAULT_THRESHOLDS.progressMaxKb;
|
|
851
|
+
const archonDirMaxMb = config?.archonDirMaxMb ?? DEFAULT_THRESHOLDS.archonDirMaxMb;
|
|
821
852
|
let needsAttention = false;
|
|
822
853
|
if (existsSync3(progressPath)) {
|
|
823
854
|
const size = statSync(progressPath).size;
|
|
824
|
-
if (size >
|
|
855
|
+
if (size > progressMaxKb * 1024) {
|
|
825
856
|
needsAttention = true;
|
|
826
857
|
}
|
|
827
858
|
}
|
|
828
859
|
if (existsSync3(archonPath)) {
|
|
829
860
|
const size = getDirSize(archonPath);
|
|
830
|
-
if (size >
|
|
861
|
+
if (size > archonDirMaxMb * 1024 * 1024) {
|
|
831
862
|
needsAttention = true;
|
|
832
863
|
}
|
|
833
864
|
}
|