@jmylchreest/aide-plugin 0.0.28 → 0.0.30
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/package.json +1 -1
- package/src/core/session-init.ts +35 -13
- package/src/core/types.ts +6 -25
- package/src/opencode/hooks.ts +8 -2
package/package.json
CHANGED
package/src/core/session-init.ts
CHANGED
|
@@ -63,14 +63,25 @@ export function ensureDirectories(cwd: string): {
|
|
|
63
63
|
}
|
|
64
64
|
}
|
|
65
65
|
|
|
66
|
-
// Ensure .gitignore exists in .aide directory
|
|
66
|
+
// Ensure .gitignore exists in .aide directory.
|
|
67
|
+
// Structure: exclude all local-only runtime data, allow shared/ and config/.
|
|
68
|
+
// shared/ contains git-friendly markdown exports (decisions, memories).
|
|
67
69
|
const gitignorePath = join(cwd, ".aide", ".gitignore");
|
|
68
|
-
const requiredGitignoreContent = `# AIDE runtime files - do not commit
|
|
70
|
+
const requiredGitignoreContent = `# AIDE local runtime files - do not commit
|
|
71
|
+
# These are machine-specific and/or binary (non-mergeable)
|
|
69
72
|
_logs/
|
|
70
73
|
state/
|
|
71
74
|
bin/
|
|
72
|
-
|
|
73
|
-
|
|
75
|
+
worktrees/
|
|
76
|
+
memory/
|
|
77
|
+
code/
|
|
78
|
+
|
|
79
|
+
# Legacy top-level database
|
|
80
|
+
aide-memory.db
|
|
81
|
+
|
|
82
|
+
# Shared data IS committed (git-friendly markdown with frontmatter)
|
|
83
|
+
# See: aide share export / aide share import
|
|
84
|
+
!shared/
|
|
74
85
|
`;
|
|
75
86
|
if (!existsSync(gitignorePath)) {
|
|
76
87
|
try {
|
|
@@ -79,10 +90,16 @@ bin/
|
|
|
79
90
|
// Ignore
|
|
80
91
|
}
|
|
81
92
|
} else {
|
|
93
|
+
// Migrate old gitignore format: ensure shared/ is allowed
|
|
82
94
|
try {
|
|
83
95
|
const existingContent = readFileSync(gitignorePath, "utf-8");
|
|
84
|
-
if (!existingContent.includes("
|
|
85
|
-
const updatedContent =
|
|
96
|
+
if (!existingContent.includes("!shared/")) {
|
|
97
|
+
const updatedContent =
|
|
98
|
+
existingContent.trimEnd() +
|
|
99
|
+
`\n
|
|
100
|
+
# Shared data IS committed (git-friendly markdown with frontmatter)
|
|
101
|
+
!shared/
|
|
102
|
+
`;
|
|
86
103
|
writeFileSync(gitignorePath, updatedContent);
|
|
87
104
|
}
|
|
88
105
|
} catch {
|
|
@@ -116,7 +133,9 @@ export function getProjectName(cwd: string): string {
|
|
|
116
133
|
}
|
|
117
134
|
|
|
118
135
|
/**
|
|
119
|
-
* Load
|
|
136
|
+
* Load config from .aide/config/aide.json (if it exists).
|
|
137
|
+
* Returns DEFAULT_CONFIG if no config file exists or it can't be parsed.
|
|
138
|
+
* Does NOT create a default config file — only user-set values are persisted.
|
|
120
139
|
*/
|
|
121
140
|
export function loadConfig(cwd: string): AideConfig {
|
|
122
141
|
const configPath = join(cwd, ".aide", "config", "aide.json");
|
|
@@ -130,12 +149,6 @@ export function loadConfig(cwd: string): AideConfig {
|
|
|
130
149
|
}
|
|
131
150
|
}
|
|
132
151
|
|
|
133
|
-
try {
|
|
134
|
-
writeFileSync(configPath, JSON.stringify(DEFAULT_CONFIG, null, 2));
|
|
135
|
-
} catch {
|
|
136
|
-
// Ignore
|
|
137
|
-
}
|
|
138
|
-
|
|
139
152
|
return DEFAULT_CONFIG;
|
|
140
153
|
}
|
|
141
154
|
|
|
@@ -231,6 +244,7 @@ export function runSessionInit(
|
|
|
231
244
|
cwd: string,
|
|
232
245
|
projectName: string,
|
|
233
246
|
sessionLimit: number,
|
|
247
|
+
config?: AideConfig,
|
|
234
248
|
): MemoryInjection {
|
|
235
249
|
const result: MemoryInjection = {
|
|
236
250
|
static: { global: [], project: [], decisions: [] },
|
|
@@ -249,6 +263,14 @@ export function runSessionInit(
|
|
|
249
263
|
`--session-limit=${sessionLimit}`,
|
|
250
264
|
];
|
|
251
265
|
|
|
266
|
+
// Add --share-import if configured or env var set
|
|
267
|
+
if (
|
|
268
|
+
config?.share?.autoImport ||
|
|
269
|
+
process.env.AIDE_SHARE_AUTO_IMPORT === "1"
|
|
270
|
+
) {
|
|
271
|
+
args.push("--share-import");
|
|
272
|
+
}
|
|
273
|
+
|
|
252
274
|
const output = execFileSync(binary, args, {
|
|
253
275
|
cwd,
|
|
254
276
|
encoding: "utf-8",
|
package/src/core/types.ts
CHANGED
|
@@ -9,34 +9,15 @@
|
|
|
9
9
|
// =============================================================================
|
|
10
10
|
|
|
11
11
|
export interface AideConfig {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
12
|
+
share?: {
|
|
13
|
+
/** Auto-import shared data from .aide/shared/ on session start (default: false) */
|
|
14
|
+
autoImport?: boolean;
|
|
15
|
+
/** Auto-export on session end (default: false) */
|
|
16
|
+
autoExport?: boolean;
|
|
17
17
|
};
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
-
export const DEFAULT_CONFIG: AideConfig = {
|
|
21
|
-
tiers: {
|
|
22
|
-
fast: "Cheapest/fastest model",
|
|
23
|
-
balanced: "Good cost/capability balance",
|
|
24
|
-
smart: "Most capable model",
|
|
25
|
-
},
|
|
26
|
-
aliases: {
|
|
27
|
-
opus: "smart",
|
|
28
|
-
sonnet: "balanced",
|
|
29
|
-
haiku: "fast",
|
|
30
|
-
cheap: "fast",
|
|
31
|
-
quick: "fast",
|
|
32
|
-
thorough: "smart",
|
|
33
|
-
best: "smart",
|
|
34
|
-
},
|
|
35
|
-
hud: {
|
|
36
|
-
enabled: true,
|
|
37
|
-
elements: ["mode", "model", "agents"],
|
|
38
|
-
},
|
|
39
|
-
};
|
|
20
|
+
export const DEFAULT_CONFIG: AideConfig = {};
|
|
40
21
|
|
|
41
22
|
// =============================================================================
|
|
42
23
|
// Session
|
package/src/opencode/hooks.ts
CHANGED
|
@@ -259,7 +259,7 @@ function initializeAide(state: AideState): void {
|
|
|
259
259
|
debug(SOURCE, `MCP sync failed (non-fatal): ${err}`);
|
|
260
260
|
}
|
|
261
261
|
|
|
262
|
-
loadConfig(state.cwd);
|
|
262
|
+
const config = loadConfig(state.cwd);
|
|
263
263
|
cleanupStaleStateFiles(state.cwd);
|
|
264
264
|
resetHudState(state.cwd);
|
|
265
265
|
|
|
@@ -267,7 +267,13 @@ function initializeAide(state: AideState): void {
|
|
|
267
267
|
|
|
268
268
|
if (state.binary) {
|
|
269
269
|
const projectName = getProjectName(state.cwd);
|
|
270
|
-
state.memories = runSessionInit(
|
|
270
|
+
state.memories = runSessionInit(
|
|
271
|
+
state.binary,
|
|
272
|
+
state.cwd,
|
|
273
|
+
projectName,
|
|
274
|
+
3,
|
|
275
|
+
config,
|
|
276
|
+
);
|
|
271
277
|
}
|
|
272
278
|
|
|
273
279
|
state.initialized = true;
|