@teammates/cli 0.2.7 → 0.3.0
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 +12 -6
- package/dist/adapter.d.ts +20 -0
- package/dist/adapter.js +63 -5
- package/dist/adapters/cli-proxy.d.ts +21 -1
- package/dist/adapters/cli-proxy.js +70 -18
- package/dist/adapters/copilot.js +20 -1
- package/dist/cli.js +224 -374
- package/dist/compact.d.ts +7 -0
- package/dist/compact.js +97 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.js +1 -1
- package/dist/types.d.ts +13 -0
- package/package.json +3 -2
- package/template/TEMPLATE.md +1 -1
- package/template/example/SOUL.md +1 -1
package/dist/compact.d.ts
CHANGED
|
@@ -37,3 +37,10 @@ export declare function compactWeeklies(teammateDir: string): Promise<{
|
|
|
37
37
|
* 2. Compact weeklies older than 52 weeks → monthly summaries
|
|
38
38
|
*/
|
|
39
39
|
export declare function compactEpisodic(teammateDir: string, teammateName: string): Promise<CompactionResult>;
|
|
40
|
+
/**
|
|
41
|
+
* Build a prompt that tells a teammate to distill their WISDOM.md
|
|
42
|
+
* from typed memories, daily logs, and weekly summaries.
|
|
43
|
+
*
|
|
44
|
+
* Returns null if there are no typed memories to distill from.
|
|
45
|
+
*/
|
|
46
|
+
export declare function buildWisdomPrompt(teammateDir: string, teammateName: string): Promise<string | null>;
|
package/dist/compact.js
CHANGED
|
@@ -267,3 +267,100 @@ export async function compactEpisodic(teammateDir, teammateName) {
|
|
|
267
267
|
weekliesRemoved: weeklyResult.removed,
|
|
268
268
|
};
|
|
269
269
|
}
|
|
270
|
+
/**
|
|
271
|
+
* Build a prompt that tells a teammate to distill their WISDOM.md
|
|
272
|
+
* from typed memories, daily logs, and weekly summaries.
|
|
273
|
+
*
|
|
274
|
+
* Returns null if there are no typed memories to distill from.
|
|
275
|
+
*/
|
|
276
|
+
export async function buildWisdomPrompt(teammateDir, teammateName) {
|
|
277
|
+
const memoryDir = join(teammateDir, "memory");
|
|
278
|
+
const wisdomPath = join(teammateDir, "WISDOM.md");
|
|
279
|
+
// Read current WISDOM.md
|
|
280
|
+
let currentWisdom = "";
|
|
281
|
+
try {
|
|
282
|
+
currentWisdom = await readFile(wisdomPath, "utf-8");
|
|
283
|
+
}
|
|
284
|
+
catch {
|
|
285
|
+
// No WISDOM.md yet — that's fine, we'll create one
|
|
286
|
+
}
|
|
287
|
+
// Read typed memory files (anything in memory/ that isn't a daily log)
|
|
288
|
+
const typedMemories = [];
|
|
289
|
+
try {
|
|
290
|
+
const entries = await readdir(memoryDir);
|
|
291
|
+
for (const entry of entries) {
|
|
292
|
+
if (!entry.endsWith(".md"))
|
|
293
|
+
continue;
|
|
294
|
+
// Skip daily logs (YYYY-MM-DD.md)
|
|
295
|
+
if (/^\d{4}-\d{2}-\d{2}\.md$/.test(entry))
|
|
296
|
+
continue;
|
|
297
|
+
// Skip subdirectories (weekly/, monthly/) — readdir only returns files here
|
|
298
|
+
const content = await readFile(join(memoryDir, entry), "utf-8");
|
|
299
|
+
typedMemories.push({ file: entry, content });
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
catch {
|
|
303
|
+
// No memory dir
|
|
304
|
+
}
|
|
305
|
+
// Read recent daily logs (current week)
|
|
306
|
+
const recentDailies = [];
|
|
307
|
+
try {
|
|
308
|
+
const entries = await readdir(memoryDir);
|
|
309
|
+
for (const entry of entries) {
|
|
310
|
+
if (!entry.endsWith(".md"))
|
|
311
|
+
continue;
|
|
312
|
+
const stem = basename(entry, ".md");
|
|
313
|
+
if (!/^\d{4}-\d{2}-\d{2}$/.test(stem))
|
|
314
|
+
continue;
|
|
315
|
+
const content = await readFile(join(memoryDir, entry), "utf-8");
|
|
316
|
+
recentDailies.push({ date: stem, content });
|
|
317
|
+
}
|
|
318
|
+
recentDailies.sort((a, b) => b.date.localeCompare(a.date));
|
|
319
|
+
}
|
|
320
|
+
catch {
|
|
321
|
+
// No memory dir
|
|
322
|
+
}
|
|
323
|
+
// If there's nothing to distill from, skip
|
|
324
|
+
if (typedMemories.length === 0 && recentDailies.length === 0) {
|
|
325
|
+
return null;
|
|
326
|
+
}
|
|
327
|
+
const today = new Date().toISOString().slice(0, 10);
|
|
328
|
+
const parts = [];
|
|
329
|
+
parts.push("# Wisdom Distillation Task\n");
|
|
330
|
+
parts.push("Update your WISDOM.md by distilling durable knowledge from your typed memories, recent daily logs, and weekly summaries.\n");
|
|
331
|
+
parts.push("## Rules\n");
|
|
332
|
+
parts.push("- WISDOM.md contains **distilled principles and patterns** — not a changelog or task list");
|
|
333
|
+
parts.push("- Each entry should be a reusable insight: a convention, decision, pattern, gotcha, or codebase fact");
|
|
334
|
+
parts.push("- Keep entries concise (2-4 lines each) with a bold title");
|
|
335
|
+
parts.push("- Remove entries that are outdated or no longer accurate");
|
|
336
|
+
parts.push("- Update entries whose details have changed (e.g., line counts, file counts)");
|
|
337
|
+
parts.push("- Add new entries for durable knowledge not yet captured");
|
|
338
|
+
parts.push(`- Set \`Last compacted: ${today}\` at the top`);
|
|
339
|
+
parts.push("- Do NOT include task-specific details, conversation history, or ephemeral state");
|
|
340
|
+
parts.push("- Do NOT include anything already in your SOUL.md (ownership, routing, technologies, etc.)\n");
|
|
341
|
+
if (currentWisdom) {
|
|
342
|
+
parts.push("## Current WISDOM.md\n");
|
|
343
|
+
parts.push("```markdown");
|
|
344
|
+
parts.push(currentWisdom.trim());
|
|
345
|
+
parts.push("```\n");
|
|
346
|
+
}
|
|
347
|
+
if (typedMemories.length > 0) {
|
|
348
|
+
parts.push("## Typed Memories\n");
|
|
349
|
+
for (const mem of typedMemories) {
|
|
350
|
+
parts.push(`### ${mem.file}\n`);
|
|
351
|
+
parts.push(mem.content.trim());
|
|
352
|
+
parts.push("");
|
|
353
|
+
}
|
|
354
|
+
}
|
|
355
|
+
if (recentDailies.length > 0) {
|
|
356
|
+
parts.push("## Recent Daily Logs\n");
|
|
357
|
+
for (const daily of recentDailies.slice(0, 7)) {
|
|
358
|
+
parts.push(`### ${daily.date}\n`);
|
|
359
|
+
parts.push(daily.content.trim());
|
|
360
|
+
parts.push("");
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
parts.push("\n## Instructions\n");
|
|
364
|
+
parts.push(`Read your current WISDOM.md at \`.teammates/${teammateName}/WISDOM.md\` and rewrite it with updated, distilled entries. Write the file directly — this is the one time you are allowed to edit WISDOM.md.`);
|
|
365
|
+
return parts.join("\n");
|
|
366
|
+
}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export type { AgentAdapter, InstalledService, RosterEntry } from "./adapter.js";
|
|
2
|
-
export { buildTeammatePrompt, formatHandoffContext } from "./adapter.js";
|
|
1
|
+
export type { AgentAdapter, InstalledService, RecallContext, RosterEntry, } from "./adapter.js";
|
|
2
|
+
export { buildTeammatePrompt, formatHandoffContext, queryRecallContext, syncRecallIndex, } from "./adapter.js";
|
|
3
3
|
export { type AgentPreset, CliProxyAdapter, type CliProxyOptions, PRESETS, } from "./adapters/cli-proxy.js";
|
|
4
4
|
export { EchoAdapter } from "./adapters/echo.js";
|
|
5
5
|
export { Orchestrator, type OrchestratorConfig, type TeammateStatus, } from "./orchestrator.js";
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// Public API for @teammates/cli
|
|
2
|
-
export { buildTeammatePrompt, formatHandoffContext } from "./adapter.js";
|
|
2
|
+
export { buildTeammatePrompt, formatHandoffContext, queryRecallContext, syncRecallIndex, } from "./adapter.js";
|
|
3
3
|
export { CliProxyAdapter, PRESETS, } from "./adapters/cli-proxy.js";
|
|
4
4
|
export { EchoAdapter } from "./adapters/echo.js";
|
|
5
5
|
export { Orchestrator, } from "./orchestrator.js";
|
package/dist/types.d.ts
CHANGED
|
@@ -68,6 +68,19 @@ export interface TaskResult {
|
|
|
68
68
|
handoffs: HandoffEnvelope[];
|
|
69
69
|
/** Raw output from the agent */
|
|
70
70
|
rawOutput?: string;
|
|
71
|
+
/** Process diagnostics for debugging empty/failed responses */
|
|
72
|
+
diagnostics?: {
|
|
73
|
+
/** Process exit code (null if killed by signal) */
|
|
74
|
+
exitCode: number | null;
|
|
75
|
+
/** Signal that killed the process (null if exited normally) */
|
|
76
|
+
signal: string | null;
|
|
77
|
+
/** stderr output (separate from stdout) */
|
|
78
|
+
stderr: string;
|
|
79
|
+
/** Whether the process was killed by timeout */
|
|
80
|
+
timedOut: boolean;
|
|
81
|
+
/** Path to the agent's debug log file, if written */
|
|
82
|
+
debugFile?: string;
|
|
83
|
+
};
|
|
71
84
|
}
|
|
72
85
|
/** Task assignment to a teammate */
|
|
73
86
|
export interface TaskAssignment {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@teammates/cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"description": "Agent-agnostic CLI for teammates. Routes tasks, manages handoffs, and plugs into any coding agent backend.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -31,7 +31,8 @@
|
|
|
31
31
|
"license": "MIT",
|
|
32
32
|
"dependencies": {
|
|
33
33
|
"@github/copilot-sdk": "^0.1.32",
|
|
34
|
-
"@teammates/consolonia": "0.
|
|
34
|
+
"@teammates/consolonia": "0.3.0",
|
|
35
|
+
"@teammates/recall": "0.3.0",
|
|
35
36
|
"chalk": "^5.6.2",
|
|
36
37
|
"ora": "^9.3.0"
|
|
37
38
|
},
|
package/template/TEMPLATE.md
CHANGED
|
@@ -20,7 +20,7 @@ Each session, you wake up fresh. These files _are_ your memory. Read them. Updat
|
|
|
20
20
|
- Read your SOUL.md and WISDOM.md at the start of every session.
|
|
21
21
|
- Read `memory/YYYY-MM-DD.md` for today and yesterday.
|
|
22
22
|
- Read USER.md to understand who you're working with.
|
|
23
|
-
-
|
|
23
|
+
- Relevant memories from past work are automatically provided in your context via recall search.
|
|
24
24
|
- Update your files as you learn. If you change SOUL.md, tell the user.
|
|
25
25
|
- You may create additional private docs under your folder (e.g., `.teammates/<name>/notes/`, `.teammates/<name>/specs/`). To share a doc with other teammates, add a pointer to it in [CROSS-TEAM.md](../CROSS-TEAM.md).
|
|
26
26
|
|
package/template/example/SOUL.md
CHANGED
|
@@ -11,7 +11,7 @@ Each session, you wake up fresh. These files _are_ your memory. Read them. Updat
|
|
|
11
11
|
- Read your SOUL.md and WISDOM.md at the start of every session.
|
|
12
12
|
- Read `memory/YYYY-MM-DD.md` for today and yesterday.
|
|
13
13
|
- Read USER.md to understand who you're working with.
|
|
14
|
-
-
|
|
14
|
+
- Relevant memories from past work are automatically provided in your context via recall search.
|
|
15
15
|
- Update your files as you learn. If you change SOUL.md, tell the user.
|
|
16
16
|
|
|
17
17
|
## Core Principles
|