braindump 0.4.3 → 0.4.4
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/dist/adapters/index.d.ts
CHANGED
|
@@ -13,7 +13,7 @@ export declare function getAllAdapters(): AgentAdapter[];
|
|
|
13
13
|
export declare function detectAgents(): Promise<DetectResult[]>;
|
|
14
14
|
/**
|
|
15
15
|
* Auto-detect the most recently active agent for the given project path.
|
|
16
|
-
*
|
|
16
|
+
* Falls back to the first detected adapter when no session metadata is available.
|
|
17
17
|
*/
|
|
18
18
|
export declare function autoDetectSource(projectPath?: string): Promise<AgentAdapter | null>;
|
|
19
19
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/adapters/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/adapters/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,YAAY,EACZ,OAAO,EACP,YAAY,EAEb,MAAM,mBAAmB,CAAC;AAc3B;;GAEG;AACH,wBAAgB,UAAU,CAAC,OAAO,EAAE,OAAO,GAAG,YAAY,CAEzD;AAED;;GAEG;AACH,wBAAgB,cAAc,IAAI,YAAY,EAAE,CAE/C;AAED;;GAEG;AACH,wBAAsB,YAAY,IAAI,OAAO,CAAC,YAAY,EAAE,CAAC,CAqB5D;AAED;;;GAGG;AACH,wBAAsB,gBAAgB,CAAC,WAAW,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,GAAG,IAAI,CAAC,CAgCzF"}
|
package/dist/adapters/index.js
CHANGED
|
@@ -47,19 +47,56 @@ export async function detectAgents() {
|
|
|
47
47
|
}
|
|
48
48
|
/**
|
|
49
49
|
* Auto-detect the most recently active agent for the given project path.
|
|
50
|
-
*
|
|
50
|
+
* Falls back to the first detected adapter when no session metadata is available.
|
|
51
51
|
*/
|
|
52
52
|
export async function autoDetectSource(projectPath) {
|
|
53
|
+
let firstDetected = null;
|
|
54
|
+
let mostRecentAdapter = null;
|
|
55
|
+
let mostRecentTs = Number.NEGATIVE_INFINITY;
|
|
53
56
|
for (const adapter of Object.values(adapters)) {
|
|
54
57
|
try {
|
|
55
58
|
const detected = await adapter.detect();
|
|
56
|
-
if (detected)
|
|
57
|
-
|
|
59
|
+
if (!detected) {
|
|
60
|
+
continue;
|
|
61
|
+
}
|
|
62
|
+
if (!firstDetected) {
|
|
63
|
+
firstDetected = adapter;
|
|
64
|
+
}
|
|
65
|
+
const sessions = await adapter.listSessions(projectPath);
|
|
66
|
+
if (sessions.length === 0) {
|
|
67
|
+
continue;
|
|
68
|
+
}
|
|
69
|
+
const latestTs = getSessionRecency(sessions[0]);
|
|
70
|
+
if (!mostRecentAdapter || latestTs > mostRecentTs) {
|
|
71
|
+
mostRecentAdapter = adapter;
|
|
72
|
+
mostRecentTs = latestTs;
|
|
73
|
+
}
|
|
58
74
|
}
|
|
59
75
|
catch {
|
|
60
76
|
// skip this adapter
|
|
61
77
|
}
|
|
62
78
|
}
|
|
63
|
-
return
|
|
79
|
+
return mostRecentAdapter ?? firstDetected;
|
|
80
|
+
}
|
|
81
|
+
function getSessionRecency(session) {
|
|
82
|
+
if (!session) {
|
|
83
|
+
return Number.NEGATIVE_INFINITY;
|
|
84
|
+
}
|
|
85
|
+
const lastActiveAt = toTimestamp(session.lastActiveAt);
|
|
86
|
+
if (Number.isFinite(lastActiveAt)) {
|
|
87
|
+
return lastActiveAt;
|
|
88
|
+
}
|
|
89
|
+
const startedAt = toTimestamp(session.startedAt);
|
|
90
|
+
if (Number.isFinite(startedAt)) {
|
|
91
|
+
return startedAt;
|
|
92
|
+
}
|
|
93
|
+
return Number.NEGATIVE_INFINITY;
|
|
94
|
+
}
|
|
95
|
+
function toTimestamp(value) {
|
|
96
|
+
if (!value) {
|
|
97
|
+
return Number.NaN;
|
|
98
|
+
}
|
|
99
|
+
const ts = Date.parse(value);
|
|
100
|
+
return Number.isNaN(ts) ? Number.NaN : ts;
|
|
64
101
|
}
|
|
65
102
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/adapters/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/adapters/index.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAElD;;GAEG;AACH,MAAM,QAAQ,GAAkC;IAC9C,aAAa,EAAE,IAAI,iBAAiB,EAAE;IACtC,MAAM,EAAE,IAAI,aAAa,EAAE;IAC3B,KAAK,EAAE,IAAI,YAAY,EAAE;CAC1B,CAAC;AAEF;;GAEG;AACH,MAAM,UAAU,UAAU,CAAC,OAAgB;IACzC,OAAO,QAAQ,CAAC,OAAO,CAAC,CAAC;AAC3B,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,cAAc;IAC5B,OAAO,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;AACjC,CAAC;AAED;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,YAAY;IAChC,MAAM,OAAO,GAAmB,EAAE,CAAC;IACnC,KAAK,MAAM,OAAO,IAAI,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE,CAAC;QAC9C,IAAI,QAAQ,GAAG,KAAK,CAAC;QACrB,IAAI,CAAC;YACH,QAAQ,GAAG,MAAM,OAAO,CAAC,MAAM,EAAE,CAAC;QACpC,CAAC;QAAC,MAAM,CAAC;YACP,QAAQ,GAAG,KAAK,CAAC;QACnB,CAAC;QACD,MAAM,IAAI,GAAG,MAAM,MAAM,CAAC,qBAAqB,CAAC,CAAC,IAAI,CACnD,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CAAC;YAC1B,CAAC;QACH,CAAC;QAAC,MAAM,CAAC;YACP,oBAAoB;QACtB,CAAC;IACH,CAAC;IAED,OAAO,iBAAiB,IAAI,aAAa,CAAC;AAC5C,CAAC;AAED,SAAS,iBAAiB,CAAC,OAAgC;IACzD,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,OAAO,MAAM,CAAC,iBAAiB,CAAC;IAClC,CAAC;IAED,MAAM,YAAY,GAAG,WAAW,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC;IACvD,IAAI,MAAM,CAAC,QAAQ,CAAC,YAAY,CAAC,EAAE,CAAC;QAClC,OAAO,YAAY,CAAC;IACtB,CAAC;IAED,MAAM,SAAS,GAAG,WAAW,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IACjD,IAAI,MAAM,CAAC,QAAQ,CAAC,SAAS,CAAC,EAAE,CAAC;QAC/B,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,OAAO,MAAM,CAAC,iBAAiB,CAAC;AAClC,CAAC;AAED,SAAS,WAAW,CAAC,KAAyB;IAC5C,IAAI,CAAC,KAAK,EAAE,CAAC;QACX,OAAO,MAAM,CAAC,GAAG,CAAC;IACpB,CAAC;IACD,MAAM,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IAC7B,OAAO,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC;AAC5C,CAAC"}
|
package/dist/cli/index.js
CHANGED
|
@@ -22,7 +22,7 @@ const program = new Command();
|
|
|
22
22
|
program
|
|
23
23
|
.name("braindump")
|
|
24
24
|
.description("Capture your AI coding agent session and continue in a different agent.")
|
|
25
|
-
.version("0.4.
|
|
25
|
+
.version("0.4.4");
|
|
26
26
|
// --- runHandoff (extracted for default command) ---
|
|
27
27
|
async function runHandoff(options) {
|
|
28
28
|
try {
|
|
@@ -512,7 +512,7 @@ program
|
|
|
512
512
|
.command("info")
|
|
513
513
|
.description("Show agent storage paths, context window sizes, and config")
|
|
514
514
|
.action(async () => {
|
|
515
|
-
console.log(banner("0.4.
|
|
515
|
+
console.log(banner("0.4.4"));
|
|
516
516
|
for (const meta of Object.values(AGENT_REGISTRY)) {
|
|
517
517
|
const storagePath = meta.storagePaths[process.platform] || "N/A";
|
|
518
518
|
console.log(` ${chalk.bold(meta.name)} ${chalk.dim(`(${meta.id})`)}`);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "braindump",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.4",
|
|
4
4
|
"description": "A CLI tool that captures your AI coding agent session and generates a portable resume prompt so you can seamlessly continue in a different agent.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/cli/index.js",
|