@creativeintelligence/abbie 0.1.6 → 0.1.7

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.
Files changed (141) hide show
  1. package/bin/dev.js +1 -49
  2. package/bin/run.js +42 -49
  3. package/dist/cli/commands/project/add.d.ts +0 -1
  4. package/dist/cli/commands/project/add.js +16 -52
  5. package/dist/cli/commands/project/list.js +13 -93
  6. package/dist/cli/commands/project/remove.d.ts +0 -2
  7. package/dist/cli/commands/project/remove.js +11 -28
  8. package/dist/cli/commands/session/list.js +3 -12
  9. package/dist/cli/commands/session/mark-done.js +1 -7
  10. package/dist/cli/commands/session/start.d.ts +0 -1
  11. package/dist/cli/commands/session/start.js +5 -7
  12. package/dist/lib/active-sessions.d.ts +0 -12
  13. package/dist/lib/active-sessions.js +6 -175
  14. package/dist/lib/project-path.d.ts +6 -0
  15. package/dist/lib/project-path.js +21 -0
  16. package/dist/lib.d.ts +1 -2
  17. package/dist/lib.js +2 -4
  18. package/oclif.manifest.json +2569 -6368
  19. package/package.json +1 -1
  20. package/dist/cli/commands/backlog/add.d.ts +0 -22
  21. package/dist/cli/commands/backlog/add.js +0 -65
  22. package/dist/cli/commands/backlog/claim.d.ts +0 -19
  23. package/dist/cli/commands/backlog/claim.js +0 -45
  24. package/dist/cli/commands/backlog/complete.d.ts +0 -18
  25. package/dist/cli/commands/backlog/complete.js +0 -42
  26. package/dist/cli/commands/backlog/list.d.ts +0 -20
  27. package/dist/cli/commands/backlog/list.js +0 -91
  28. package/dist/cli/commands/backlog/pick.d.ts +0 -18
  29. package/dist/cli/commands/backlog/pick.js +0 -42
  30. package/dist/cli/commands/backlog/sync.d.ts +0 -24
  31. package/dist/cli/commands/backlog/sync.js +0 -109
  32. package/dist/cli/commands/daemon.d.ts +0 -56
  33. package/dist/cli/commands/daemon.js +0 -1465
  34. package/dist/cli/commands/docs/lint.d.ts +0 -18
  35. package/dist/cli/commands/docs/lint.js +0 -82
  36. package/dist/cli/commands/docs/sync.d.ts +0 -19
  37. package/dist/cli/commands/docs/sync.js +0 -76
  38. package/dist/cli/commands/gc.d.ts +0 -29
  39. package/dist/cli/commands/gc.js +0 -211
  40. package/dist/cli/commands/index.d.ts +0 -36
  41. package/dist/cli/commands/index.js +0 -228
  42. package/dist/cli/commands/panes/broker.d.ts +0 -17
  43. package/dist/cli/commands/panes/broker.js +0 -57
  44. package/dist/cli/commands/panes/pipe-sink.d.ts +0 -17
  45. package/dist/cli/commands/panes/pipe-sink.js +0 -90
  46. package/dist/cli/commands/panes/snapshot.d.ts +0 -20
  47. package/dist/cli/commands/panes/snapshot.js +0 -125
  48. package/dist/cli/commands/preview/init.d.ts +0 -25
  49. package/dist/cli/commands/preview/init.js +0 -159
  50. package/dist/cli/commands/preview/sync.d.ts +0 -23
  51. package/dist/cli/commands/preview/sync.js +0 -144
  52. package/dist/cli/commands/preview/watch.d.ts +0 -24
  53. package/dist/cli/commands/preview/watch.js +0 -153
  54. package/dist/cli/commands/resource/acquire.d.ts +0 -21
  55. package/dist/cli/commands/resource/acquire.js +0 -90
  56. package/dist/cli/commands/resource/list.d.ts +0 -15
  57. package/dist/cli/commands/resource/list.js +0 -61
  58. package/dist/cli/commands/resource/release.d.ts +0 -18
  59. package/dist/cli/commands/resource/release.js +0 -50
  60. package/dist/cli/commands/resource/wait.d.ts +0 -21
  61. package/dist/cli/commands/resource/wait.js +0 -73
  62. package/dist/cli/commands/session/view.d.ts +0 -24
  63. package/dist/cli/commands/session/view.js +0 -145
  64. package/dist/cli/commands/start.d.ts +0 -37
  65. package/dist/cli/commands/start.js +0 -234
  66. package/dist/cli/commands/triage/claim.d.ts +0 -23
  67. package/dist/cli/commands/triage/claim.js +0 -186
  68. package/dist/cli/commands/triage/list.d.ts +0 -22
  69. package/dist/cli/commands/triage/list.js +0 -112
  70. package/dist/cli/commands/triage/next.d.ts +0 -18
  71. package/dist/cli/commands/triage/next.js +0 -63
  72. package/dist/cli/commands/triage/pull.d.ts +0 -19
  73. package/dist/cli/commands/triage/pull.js +0 -82
  74. package/dist/cli/commands/triage/stats.d.ts +0 -16
  75. package/dist/cli/commands/triage/stats.js +0 -69
  76. package/dist/cli/commands/tunnel/list.d.ts +0 -16
  77. package/dist/cli/commands/tunnel/list.js +0 -98
  78. package/dist/cli/commands/tunnel/start.d.ts +0 -24
  79. package/dist/cli/commands/tunnel/start.js +0 -107
  80. package/dist/cli/commands/tunnel/stop.d.ts +0 -20
  81. package/dist/cli/commands/tunnel/stop.js +0 -90
  82. package/dist/cli/commands/tunnel/url.d.ts +0 -21
  83. package/dist/cli/commands/tunnel/url.js +0 -70
  84. package/dist/cli/commands/windows/context.d.ts +0 -18
  85. package/dist/cli/commands/windows/context.js +0 -326
  86. package/dist/cli/commands/windows/focus.d.ts +0 -17
  87. package/dist/cli/commands/windows/focus.js +0 -103
  88. package/dist/cli/commands/windows/list.d.ts +0 -21
  89. package/dist/cli/commands/windows/list.js +0 -172
  90. package/dist/cli/commands/windows/map.d.ts +0 -17
  91. package/dist/cli/commands/windows/map.js +0 -168
  92. package/dist/cli/commands/windows/read.d.ts +0 -21
  93. package/dist/cli/commands/windows/read.js +0 -241
  94. package/dist/cli/commands/windows/search.d.ts +0 -24
  95. package/dist/cli/commands/windows/search.js +0 -171
  96. package/dist/cli/commands/windows/show.d.ts +0 -19
  97. package/dist/cli/commands/windows/show.js +0 -165
  98. package/dist/cli/commands/windows/watch.d.ts +0 -19
  99. package/dist/cli/commands/windows/watch.js +0 -241
  100. package/dist/lib/managed-session.d.ts +0 -27
  101. package/dist/lib/managed-session.js +0 -105
  102. package/dist/lib/panes/broker.d.ts +0 -130
  103. package/dist/lib/panes/broker.js +0 -97
  104. package/dist/lib/panes/index.d.ts +0 -2
  105. package/dist/lib/panes/index.js +0 -1
  106. package/dist/lib/panes/server.d.ts +0 -17
  107. package/dist/lib/panes/server.js +0 -308
  108. package/dist/lib/preview/manager.d.ts +0 -77
  109. package/dist/lib/preview/manager.js +0 -369
  110. package/dist/lib/preview/schema.d.ts +0 -2
  111. package/dist/lib/preview/schema.js +0 -32
  112. package/dist/lib/preview/sprite.d.ts +0 -85
  113. package/dist/lib/preview/sprite.js +0 -321
  114. package/dist/lib/preview/watcher.d.ts +0 -63
  115. package/dist/lib/preview/watcher.js +0 -185
  116. package/dist/lib/project-identity.d.ts +0 -16
  117. package/dist/lib/project-identity.js +0 -75
  118. package/dist/lib/tmux/bridge.d.ts +0 -133
  119. package/dist/lib/tmux/bridge.js +0 -315
  120. package/dist/lib/tmux/context.d.ts +0 -82
  121. package/dist/lib/tmux/context.js +0 -239
  122. package/dist/lib/tmux/index.d.ts +0 -8
  123. package/dist/lib/tmux/index.js +0 -11
  124. package/dist/lib/tmux/map.d.ts +0 -57
  125. package/dist/lib/tmux/map.js +0 -198
  126. package/dist/lib/tmux/panes.d.ts +0 -27
  127. package/dist/lib/tmux/panes.js +0 -151
  128. package/dist/lib/tmux/redaction.d.ts +0 -57
  129. package/dist/lib/tmux/redaction.js +0 -152
  130. package/dist/lib/web/analytics.d.ts +0 -63
  131. package/dist/lib/web/analytics.js +0 -168
  132. package/dist/lib/web/server.d.ts +0 -26
  133. package/dist/lib/web/server.js +0 -697
  134. package/dist/lib/web/tmux-bridge.d.ts +0 -7
  135. package/dist/lib/web/tmux-bridge.js +0 -7
  136. package/dist/lib/windows/index.d.ts +0 -3
  137. package/dist/lib/windows/index.js +0 -2
  138. package/dist/lib/windows/inventory.d.ts +0 -21
  139. package/dist/lib/windows/inventory.js +0 -263
  140. package/dist/lib/windows/types.d.ts +0 -46
  141. package/dist/lib/windows/types.js +0 -1
@@ -1,18 +0,0 @@
1
- import { type AgentsDocsLintResult } from "../../../lib/docs/lint.js";
2
- import { BaseCommand } from "../../base-command.js";
3
- export default class DocsLintCommand extends BaseCommand {
4
- static summary: string;
5
- static description: string;
6
- static examples: string[];
7
- static flags: {
8
- root: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
9
- include: import("@oclif/core/interfaces").OptionFlag<string[], import("@oclif/core/interfaces").CustomOptions>;
10
- format: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
11
- quiet: import("@oclif/core/interfaces").BooleanFlag<boolean>;
12
- "json-errors": import("@oclif/core/interfaces").BooleanFlag<boolean>;
13
- ndjson: import("@oclif/core/interfaces").BooleanFlag<boolean>;
14
- };
15
- execute(): Promise<AgentsDocsLintResult>;
16
- private renderText;
17
- }
18
- //# sourceMappingURL=lint.d.ts.map
@@ -1,82 +0,0 @@
1
- import { Flags } from "@oclif/core";
2
- import { lintAgentsDocs } from "../../../lib/docs/lint.js";
3
- import { BaseCommand } from "../../base-command.js";
4
- export default class DocsLintCommand extends BaseCommand {
5
- static summary = "Lint AGENTS.md contracts across the workspace";
6
- static description = `Scans ~/Developer/{apps,packages,utils} for AGENTS.md files and validates:
7
- - AGENTS.md is canonical, CLAUDE.md → AGENTS.md symlink
8
- - Markdown structure (H1, headings)
9
- - XML-ish / non-Markdown AGENTS.md detection
10
- - Duplicate-content clusters (drift report)
11
-
12
- Excludes common vendor/build directories (node_modules, dist, build, .git, .next, etc.).`;
13
- static examples = [
14
- "$ abbie docs lint",
15
- "$ abbie docs lint --json --quiet",
16
- "$ abbie docs lint --root ~/Developer --include apps --include packages --include utils",
17
- ];
18
- static flags = {
19
- ...BaseCommand.baseFlags,
20
- root: Flags.string({
21
- description: "Workspace root (defaults to ~/Developer)",
22
- default: undefined,
23
- }),
24
- include: Flags.string({
25
- description: "Subdirectory under root to scan (repeatable)",
26
- multiple: true,
27
- default: ["apps", "packages", "utils"],
28
- }),
29
- };
30
- async execute() {
31
- const { flags } = await this.parse(DocsLintCommand);
32
- this.parsedFlags = flags;
33
- const result = lintAgentsDocs({
34
- workspaceRoot: flags.root,
35
- include: flags.include,
36
- });
37
- if (!this.jsonEnabled?.()) {
38
- this.renderText(result);
39
- if (!result.ok)
40
- this.exit(1);
41
- }
42
- return { ...result, exitCode: result.ok ? 0 : 1 };
43
- }
44
- renderText(result) {
45
- this.log("");
46
- this.log("abbie docs lint");
47
- this.log("─".repeat(50));
48
- this.log("");
49
- this.log(`Workspace: ${result.workspaceRoot}`);
50
- this.log(`Include: ${result.includedRoots.join(", ") || "(none found)"}`);
51
- this.log(`AGENTS.md: ${result.agentsFiles}`);
52
- this.log(`Issues: ${result.errors} error, ${result.warnings} warn`);
53
- this.log(`Duplicates:${result.duplicateGroups.length} groups`);
54
- this.log("");
55
- if (result.issues.length > 0) {
56
- this.log("Issues:");
57
- for (const issue of result.issues) {
58
- const level = issue.severity === "error" ? "✗" : "!";
59
- this.log(` ${level} ${issue.path}: ${issue.detail}`);
60
- }
61
- this.log("");
62
- }
63
- if (result.duplicateGroups.length > 0) {
64
- this.log("Duplicate clusters (by content hash):");
65
- for (const group of result.duplicateGroups.slice(0, 25)) {
66
- this.log(` ${group.hash} (${group.count})`);
67
- for (const p of group.paths)
68
- this.log(` - ${p}`);
69
- }
70
- if (result.duplicateGroups.length > 25) {
71
- this.log(` … ${result.duplicateGroups.length - 25} more`);
72
- }
73
- this.log("");
74
- }
75
- if (result.ok) {
76
- this.log("✓ OK");
77
- }
78
- else {
79
- this.log("✗ Issues found");
80
- }
81
- }
82
- }
@@ -1,19 +0,0 @@
1
- import { type AgentsDocsSyncResult } from "../../../lib/docs/sync.js";
2
- import { BaseCommand } from "../../base-command.js";
3
- export default class DocsSyncCommand extends BaseCommand {
4
- static summary: string;
5
- static description: string;
6
- static examples: string[];
7
- static flags: {
8
- root: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
9
- include: import("@oclif/core/interfaces").OptionFlag<string[], import("@oclif/core/interfaces").CustomOptions>;
10
- "dry-run": import("@oclif/core/interfaces").BooleanFlag<boolean>;
11
- format: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
12
- quiet: import("@oclif/core/interfaces").BooleanFlag<boolean>;
13
- "json-errors": import("@oclif/core/interfaces").BooleanFlag<boolean>;
14
- ndjson: import("@oclif/core/interfaces").BooleanFlag<boolean>;
15
- };
16
- execute(): Promise<AgentsDocsSyncResult>;
17
- private renderText;
18
- }
19
- //# sourceMappingURL=sync.d.ts.map
@@ -1,76 +0,0 @@
1
- import { Flags } from "@oclif/core";
2
- import { syncAgentsDocs } from "../../../lib/docs/sync.js";
3
- import { BaseCommand } from "../../base-command.js";
4
- export default class DocsSyncCommand extends BaseCommand {
5
- static summary = "Sync AGENTS.md spawn protocol across the workspace";
6
- static description = `Scans ~/Developer/{apps,packages,utils} for AGENTS.md and appends a standard
7
- "Agent Spawn Protocol (Recommended)" section when missing.
8
-
9
- This is non-blocking guidance (warn/log policy): skills are preferred but not required.`;
10
- static examples = [
11
- "$ abbie docs sync --dry-run",
12
- "$ abbie docs sync",
13
- "$ abbie docs sync --root ~/Developer --include apps --include packages --include utils",
14
- "$ abbie docs sync --json --quiet",
15
- ];
16
- static flags = {
17
- ...BaseCommand.baseFlags,
18
- root: Flags.string({
19
- description: "Workspace root (defaults to ~/Developer)",
20
- default: undefined,
21
- }),
22
- include: Flags.string({
23
- description: "Subdirectory under root to scan (repeatable)",
24
- multiple: true,
25
- default: ["apps", "packages", "utils"],
26
- }),
27
- "dry-run": Flags.boolean({
28
- description: "Preview changes without writing files",
29
- default: false,
30
- }),
31
- };
32
- async execute() {
33
- const { flags } = await this.parse(DocsSyncCommand);
34
- this.parsedFlags = flags;
35
- const result = syncAgentsDocs({
36
- workspaceRoot: flags.root,
37
- include: flags.include,
38
- dryRun: flags["dry-run"],
39
- });
40
- if (!this.jsonEnabled?.()) {
41
- this.renderText(result);
42
- }
43
- return result;
44
- }
45
- renderText(result) {
46
- this.log("");
47
- this.log("abbie docs sync");
48
- this.log("─".repeat(50));
49
- this.log("");
50
- this.log(`Workspace: ${result.workspaceRoot}`);
51
- this.log(`Include: ${result.includedRoots.join(", ") || "(none found)"}`);
52
- this.log(`Scanned: ${result.scanned}`);
53
- this.log(`Updated: ${result.updated}`);
54
- this.log(`Skipped: ${result.skipped}`);
55
- this.log(`Mode: ${result.dryRun ? "dry-run" : "write"}`);
56
- this.log("");
57
- if (result.touchedPaths.length > 0) {
58
- this.log("Updated files:");
59
- for (const path of result.touchedPaths) {
60
- this.log(` ✓ ${path}`);
61
- }
62
- this.log("");
63
- }
64
- if (result.skippedPaths.length > 0 && !this.parsedFlags?.quiet) {
65
- this.log("Skipped files:");
66
- for (const entry of result.skippedPaths.slice(0, 50)) {
67
- this.log(` - ${entry.path} (${entry.reason})`);
68
- }
69
- if (result.skippedPaths.length > 50) {
70
- this.log(` … ${result.skippedPaths.length - 50} more`);
71
- }
72
- this.log("");
73
- }
74
- this.log(result.dryRun ? "✓ Dry-run complete" : "✓ Sync complete");
75
- }
76
- }
@@ -1,29 +0,0 @@
1
- import { BaseCommand } from "../base-command.js";
2
- interface GcResult {
3
- dryRun: boolean;
4
- deleted: number;
5
- freedBytes: number;
6
- details: Array<{
7
- path: string;
8
- type: string;
9
- ageMs: number;
10
- sizeBytes: number;
11
- deleted: boolean;
12
- }>;
13
- }
14
- export default class GcCommand extends BaseCommand {
15
- static summary: string;
16
- static description: string;
17
- static examples: string[];
18
- static flags: {
19
- "dry-run": import("@oclif/core/interfaces").BooleanFlag<boolean>;
20
- days: import("@oclif/core/interfaces").OptionFlag<number, import("@oclif/core/interfaces").CustomOptions>;
21
- format: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
22
- quiet: import("@oclif/core/interfaces").BooleanFlag<boolean>;
23
- "json-errors": import("@oclif/core/interfaces").BooleanFlag<boolean>;
24
- ndjson: import("@oclif/core/interfaces").BooleanFlag<boolean>;
25
- };
26
- protected execute(): Promise<GcResult>;
27
- }
28
- export {};
29
- //# sourceMappingURL=gc.d.ts.map
@@ -1,211 +0,0 @@
1
- import { existsSync, readdirSync, readFileSync, statSync, unlinkSync, writeFileSync } from "node:fs";
2
- import { homedir } from "node:os";
3
- import { join } from "node:path";
4
- import { Flags } from "@oclif/core";
5
- import { BaseCommand } from "../base-command.js";
6
- export default class GcCommand extends BaseCommand {
7
- static summary = "Clean up local staging data";
8
- static description = `Delete stale local staging data older than N days (default 7).
9
-
10
- Cleans:
11
- - ~/.abbie/active-sessions/*.json (completed/failed/stopped sessions)
12
- - ~/.abbie/session-artifacts/*.json
13
- - ~/.abbie/prompts/* (prompt files)
14
- - ~/.abbie/events/*/events.jsonl (compact to retention window)
15
- - ~/.abbie/sessions/* (heartbeat files)`;
16
- static examples = [
17
- "$ abbie gc",
18
- "$ abbie gc --dry-run",
19
- "$ abbie gc --days 3",
20
- "$ abbie gc --json --quiet",
21
- ];
22
- static flags = {
23
- ...BaseCommand.baseFlags,
24
- "dry-run": Flags.boolean({
25
- description: "Preview what would be deleted without actually deleting",
26
- default: false,
27
- }),
28
- days: Flags.integer({
29
- char: "d",
30
- description: "Delete files older than N days",
31
- default: 7,
32
- }),
33
- };
34
- async execute() {
35
- const { flags } = await this.parse(GcCommand);
36
- this.parsedFlags = flags;
37
- const dryRun = flags["dry-run"];
38
- const maxAgeMs = flags.days * 24 * 60 * 60 * 1000;
39
- const cutoff = Date.now() - maxAgeMs;
40
- const abbieDir = join(homedir(), ".abbie");
41
- const details = [];
42
- let deleted = 0;
43
- let freedBytes = 0;
44
- // 1. active-sessions/*.json — only terminal-status sessions
45
- const activeSessionsDir = join(abbieDir, "active-sessions");
46
- if (existsSync(activeSessionsDir)) {
47
- for (const file of readdirSync(activeSessionsDir)) {
48
- if (!file.endsWith(".json"))
49
- continue;
50
- const filePath = join(activeSessionsDir, file);
51
- const stat = statSync(filePath);
52
- if (stat.mtimeMs >= cutoff)
53
- continue;
54
- // Only delete sessions in terminal status
55
- try {
56
- const content = JSON.parse(readFileSync(filePath, "utf-8"));
57
- const status = content.status;
58
- if (status === "running" || status === "spawned")
59
- continue;
60
- }
61
- catch {
62
- continue;
63
- }
64
- details.push({
65
- path: filePath,
66
- type: "active-session",
67
- ageMs: Date.now() - stat.mtimeMs,
68
- sizeBytes: stat.size,
69
- deleted: !dryRun,
70
- });
71
- if (!dryRun) {
72
- unlinkSync(filePath);
73
- }
74
- deleted++;
75
- freedBytes += stat.size;
76
- }
77
- }
78
- // 2. session-artifacts/*.json
79
- const artifactsDir = join(abbieDir, "session-artifacts");
80
- if (existsSync(artifactsDir)) {
81
- for (const file of readdirSync(artifactsDir)) {
82
- if (!file.endsWith(".json"))
83
- continue;
84
- const filePath = join(artifactsDir, file);
85
- const stat = statSync(filePath);
86
- if (stat.mtimeMs >= cutoff)
87
- continue;
88
- details.push({
89
- path: filePath,
90
- type: "session-artifact",
91
- ageMs: Date.now() - stat.mtimeMs,
92
- sizeBytes: stat.size,
93
- deleted: !dryRun,
94
- });
95
- if (!dryRun) {
96
- unlinkSync(filePath);
97
- }
98
- deleted++;
99
- freedBytes += stat.size;
100
- }
101
- }
102
- // 3. prompts/* (prompt files for sessions)
103
- const promptsDir = join(abbieDir, "prompts");
104
- if (existsSync(promptsDir)) {
105
- for (const file of readdirSync(promptsDir)) {
106
- const filePath = join(promptsDir, file);
107
- const stat = statSync(filePath);
108
- if (!stat.isFile() || stat.mtimeMs >= cutoff)
109
- continue;
110
- details.push({
111
- path: filePath,
112
- type: "prompt",
113
- ageMs: Date.now() - stat.mtimeMs,
114
- sizeBytes: stat.size,
115
- deleted: !dryRun,
116
- });
117
- if (!dryRun) {
118
- unlinkSync(filePath);
119
- }
120
- deleted++;
121
- freedBytes += stat.size;
122
- }
123
- }
124
- // 4. events/*/events.jsonl — compact to retention window
125
- const eventsDir = join(abbieDir, "events");
126
- if (existsSync(eventsDir)) {
127
- for (const project of readdirSync(eventsDir)) {
128
- const projectDir = join(eventsDir, project);
129
- if (!statSync(projectDir).isDirectory())
130
- continue;
131
- const eventsFile = join(projectDir, "events.jsonl");
132
- if (!existsSync(eventsFile))
133
- continue;
134
- const stat = statSync(eventsFile);
135
- const content = readFileSync(eventsFile, "utf-8");
136
- const lines = content.split("\n").filter(Boolean);
137
- const cutoffISO = new Date(cutoff).toISOString();
138
- const kept = lines.filter((line) => {
139
- try {
140
- const event = JSON.parse(line);
141
- return event.timestamp >= cutoffISO;
142
- }
143
- catch {
144
- return false;
145
- }
146
- });
147
- const removed = lines.length - kept.length;
148
- if (removed === 0)
149
- continue;
150
- const originalSize = stat.size;
151
- const newContent = kept.length > 0 ? `${kept.join("\n")}\n` : "";
152
- const newSize = Buffer.byteLength(newContent);
153
- const savedBytes = originalSize - newSize;
154
- details.push({
155
- path: eventsFile,
156
- type: "events-compact",
157
- ageMs: 0, // compaction, not age-based
158
- sizeBytes: savedBytes,
159
- deleted: !dryRun,
160
- });
161
- if (!dryRun) {
162
- writeFileSync(eventsFile, newContent);
163
- }
164
- deleted += removed;
165
- freedBytes += savedBytes;
166
- }
167
- }
168
- // 5. sessions/* (heartbeat files)
169
- const sessionsDir = join(abbieDir, "sessions");
170
- if (existsSync(sessionsDir)) {
171
- for (const file of readdirSync(sessionsDir)) {
172
- const filePath = join(sessionsDir, file);
173
- const stat = statSync(filePath);
174
- if (!stat.isFile() || stat.mtimeMs >= cutoff)
175
- continue;
176
- details.push({
177
- path: filePath,
178
- type: "heartbeat",
179
- ageMs: Date.now() - stat.mtimeMs,
180
- sizeBytes: stat.size,
181
- deleted: !dryRun,
182
- });
183
- if (!dryRun) {
184
- unlinkSync(filePath);
185
- }
186
- deleted++;
187
- freedBytes += stat.size;
188
- }
189
- }
190
- const result = {
191
- dryRun,
192
- deleted,
193
- freedBytes,
194
- details,
195
- };
196
- if (!this.jsonEnabled?.()) {
197
- const action = dryRun ? "Would delete" : "Deleted";
198
- const freedKB = (freedBytes / 1024).toFixed(1);
199
- if (deleted === 0) {
200
- this.log(`No stale files found (threshold: ${flags.days} days)`);
201
- }
202
- else {
203
- this.log(`${action} ${deleted} items (${freedKB} KB freed)`);
204
- if (dryRun) {
205
- this.log("\nRun without --dry-run to actually delete.");
206
- }
207
- }
208
- }
209
- return result;
210
- }
211
- }
@@ -1,36 +0,0 @@
1
- /**
2
- * abbie (default command) — the single entry point.
3
- *
4
- * First run:
5
- * 1. Check Pi → not found → auto-install
6
- * 2. Install Abbie Pi extension
7
- * 3. Open browser for Clerk auth
8
- * 4. Launch Pi (extension auto-starts bridge)
9
- *
10
- * Subsequent runs:
11
- * Launch Pi directly (extension handles bridge)
12
- */
13
- import { BaseCommand } from "../base-command.js";
14
- export default class DefaultCommand extends BaseCommand {
15
- static id: string;
16
- static summary: string;
17
- static description: string;
18
- static examples: string[];
19
- static flags: {
20
- setup: import("@oclif/core/interfaces").BooleanFlag<boolean>;
21
- status: import("@oclif/core/interfaces").BooleanFlag<boolean>;
22
- format: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
23
- quiet: import("@oclif/core/interfaces").BooleanFlag<boolean>;
24
- "json-errors": import("@oclif/core/interfaces").BooleanFlag<boolean>;
25
- ndjson: import("@oclif/core/interfaces").BooleanFlag<boolean>;
26
- };
27
- static strict: boolean;
28
- execute(): Promise<unknown>;
29
- private runSetup;
30
- /**
31
- * Find the bundled extension source directory.
32
- * Looks in several locations depending on how the CLI is installed.
33
- */
34
- private findExtensionSource;
35
- }
36
- //# sourceMappingURL=index.d.ts.map