@ajvikram/relay 0.1.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.
Files changed (95) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +538 -0
  3. package/dist/cli/commands/branch.d.ts +9 -0
  4. package/dist/cli/commands/branch.d.ts.map +1 -0
  5. package/dist/cli/commands/branch.js +69 -0
  6. package/dist/cli/commands/branch.js.map +1 -0
  7. package/dist/cli/commands/diff.d.ts +8 -0
  8. package/dist/cli/commands/diff.d.ts.map +1 -0
  9. package/dist/cli/commands/diff.js +61 -0
  10. package/dist/cli/commands/diff.js.map +1 -0
  11. package/dist/cli/commands/history.d.ts +8 -0
  12. package/dist/cli/commands/history.d.ts.map +1 -0
  13. package/dist/cli/commands/history.js +32 -0
  14. package/dist/cli/commands/history.js.map +1 -0
  15. package/dist/cli/commands/hook.d.ts +6 -0
  16. package/dist/cli/commands/hook.d.ts.map +1 -0
  17. package/dist/cli/commands/hook.js +118 -0
  18. package/dist/cli/commands/hook.js.map +1 -0
  19. package/dist/cli/commands/init.d.ts +4 -0
  20. package/dist/cli/commands/init.d.ts.map +1 -0
  21. package/dist/cli/commands/init.js +41 -0
  22. package/dist/cli/commands/init.js.map +1 -0
  23. package/dist/cli/commands/install.d.ts +18 -0
  24. package/dist/cli/commands/install.d.ts.map +1 -0
  25. package/dist/cli/commands/install.js +203 -0
  26. package/dist/cli/commands/install.js.map +1 -0
  27. package/dist/cli/commands/load.d.ts +9 -0
  28. package/dist/cli/commands/load.d.ts.map +1 -0
  29. package/dist/cli/commands/load.js +69 -0
  30. package/dist/cli/commands/load.js.map +1 -0
  31. package/dist/cli/commands/repos.d.ts +7 -0
  32. package/dist/cli/commands/repos.d.ts.map +1 -0
  33. package/dist/cli/commands/repos.js +53 -0
  34. package/dist/cli/commands/repos.js.map +1 -0
  35. package/dist/cli/commands/save.d.ts +9 -0
  36. package/dist/cli/commands/save.d.ts.map +1 -0
  37. package/dist/cli/commands/save.js +267 -0
  38. package/dist/cli/commands/save.js.map +1 -0
  39. package/dist/cli/commands/status.d.ts +23 -0
  40. package/dist/cli/commands/status.d.ts.map +1 -0
  41. package/dist/cli/commands/status.js +134 -0
  42. package/dist/cli/commands/status.js.map +1 -0
  43. package/dist/cli/commands/ui.d.ts +9 -0
  44. package/dist/cli/commands/ui.d.ts.map +1 -0
  45. package/dist/cli/commands/ui.js +54 -0
  46. package/dist/cli/commands/ui.js.map +1 -0
  47. package/dist/cli/commands/vscode.d.ts +6 -0
  48. package/dist/cli/commands/vscode.d.ts.map +1 -0
  49. package/dist/cli/commands/vscode.js +86 -0
  50. package/dist/cli/commands/vscode.js.map +1 -0
  51. package/dist/cli/index.d.ts +3 -0
  52. package/dist/cli/index.d.ts.map +1 -0
  53. package/dist/cli/index.js +143 -0
  54. package/dist/cli/index.js.map +1 -0
  55. package/dist/format/renderer.d.ts +5 -0
  56. package/dist/format/renderer.d.ts.map +1 -0
  57. package/dist/format/renderer.js +207 -0
  58. package/dist/format/renderer.js.map +1 -0
  59. package/dist/format/schema.d.ts +516 -0
  60. package/dist/format/schema.d.ts.map +1 -0
  61. package/dist/format/schema.js +90 -0
  62. package/dist/format/schema.js.map +1 -0
  63. package/dist/format/template.d.ts +44 -0
  64. package/dist/format/template.d.ts.map +1 -0
  65. package/dist/format/template.js +131 -0
  66. package/dist/format/template.js.map +1 -0
  67. package/dist/git/context.d.ts +23 -0
  68. package/dist/git/context.d.ts.map +1 -0
  69. package/dist/git/context.js +121 -0
  70. package/dist/git/context.js.map +1 -0
  71. package/dist/index.d.ts +8 -0
  72. package/dist/index.d.ts.map +1 -0
  73. package/dist/index.js +8 -0
  74. package/dist/index.js.map +1 -0
  75. package/dist/mcp/server.d.ts +2 -0
  76. package/dist/mcp/server.d.ts.map +1 -0
  77. package/dist/mcp/server.js +164 -0
  78. package/dist/mcp/server.js.map +1 -0
  79. package/dist/server/index.d.ts +12 -0
  80. package/dist/server/index.d.ts.map +1 -0
  81. package/dist/server/index.js +143 -0
  82. package/dist/server/index.js.map +1 -0
  83. package/dist/server/ui.d.ts +2 -0
  84. package/dist/server/ui.d.ts.map +1 -0
  85. package/dist/server/ui.js +797 -0
  86. package/dist/server/ui.js.map +1 -0
  87. package/dist/storage/global.d.ts +40 -0
  88. package/dist/storage/global.d.ts.map +1 -0
  89. package/dist/storage/global.js +126 -0
  90. package/dist/storage/global.js.map +1 -0
  91. package/dist/storage/index.d.ts +59 -0
  92. package/dist/storage/index.d.ts.map +1 -0
  93. package/dist/storage/index.js +253 -0
  94. package/dist/storage/index.js.map +1 -0
  95. package/package.json +54 -0
@@ -0,0 +1,131 @@
1
+ /**
2
+ * Returns a human-readable interactive template string used when running
3
+ * `relay save` in guided mode. This is shown to the user via inquirer prompts.
4
+ */
5
+ export const PLATFORM_CHOICES = [
6
+ { name: 'Claude / Claude Code', value: 'claude' },
7
+ { name: 'Cursor', value: 'cursor' },
8
+ { name: 'GitHub Copilot', value: 'copilot' },
9
+ { name: 'Antigravity', value: 'antigravity' },
10
+ { name: 'Other', value: 'other' },
11
+ ];
12
+ export const STATUS_CHOICES = [
13
+ { name: '🟡 In Progress — more work needed', value: 'in_progress' },
14
+ { name: '🔴 Blocked — stuck, need help', value: 'blocked' },
15
+ { name: '✅ Completed — wrapping up', value: 'completed' },
16
+ ];
17
+ export const PRIORITY_CHOICES = [
18
+ { name: '🔴 Immediate — do this first', value: 'immediate' },
19
+ { name: '🟡 Soon — after immediate steps', value: 'soon' },
20
+ { name: '🔵 Later — backlog', value: 'later' },
21
+ ];
22
+ // ─── Handoff format instructions (injected into AI agents for agent-assisted save) ──
23
+ export const AGENT_SAVE_PROMPT = `
24
+ Please write a Relay handoff document for our current session.
25
+ Format your response as a JSON object matching this exact structure:
26
+
27
+ {
28
+ "session": {
29
+ "goal": "<one sentence: what were we trying to accomplish?>",
30
+ "status": "<in_progress|blocked|completed>",
31
+ "token_exhausted": <true|false>,
32
+ "duration_hint": "<rough time estimate, e.g. ~2 hours>"
33
+ },
34
+ "decisions": [
35
+ {
36
+ "what": "<what was decided>",
37
+ "why": "<rationale — be specific>",
38
+ "evidence": "<commit SHA, file path, or note — optional>"
39
+ }
40
+ ],
41
+ "constraints": [
42
+ "<hard constraint that MUST NOT be violated>"
43
+ ],
44
+ "failed_approaches": [
45
+ {
46
+ "approach": "<what we tried>",
47
+ "why_failed": "<exactly why it didn't work — be specific>"
48
+ }
49
+ ],
50
+ "files_modified": [
51
+ {
52
+ "path": "<relative path from repo root>",
53
+ "status": "<added|modified|deleted>",
54
+ "summary": "<what changed and why>"
55
+ }
56
+ ],
57
+ "next_steps": [
58
+ {
59
+ "task": "<clear actionable instruction>",
60
+ "context": "<additional context — optional>",
61
+ "priority": "<immediate|soon|later>",
62
+ "file_hint": "<specific file to look at first — optional>"
63
+ }
64
+ ]
65
+ }
66
+
67
+ Rules:
68
+ - Include ALL decisions made, even small ones. The next agent needs the full picture.
69
+ - For failed approaches, be brutally specific about WHY it failed. "It didn't work" is not acceptable.
70
+ - Constraints must be truly non-negotiable. Don't add preferences.
71
+ - Next steps should be ordered — the first item should be the very next action to take.
72
+ - Do not include the raw diff or repository state — the CLI handles that automatically.
73
+
74
+ Respond with ONLY the JSON object, no other text.
75
+ `.trim();
76
+ // ─── Handoff example (used in README and tests) ──────────────────────────────
77
+ export function getExampleHandoff() {
78
+ return {
79
+ session: {
80
+ goal: 'Implement JWT refresh token rotation in the auth service',
81
+ status: 'in_progress',
82
+ token_exhausted: true,
83
+ duration_hint: '~3 hours',
84
+ },
85
+ decisions: [
86
+ {
87
+ what: 'Using Redis for refresh token storage, not the database',
88
+ why: 'Token revocation needs O(1) lookup. DB queries were 40ms+ under load testing.',
89
+ evidence: 'See benchmark in src/auth/benchmarks/token-lookup.ts',
90
+ },
91
+ ],
92
+ constraints: [
93
+ 'Must maintain backward compatibility with v2 API — existing access tokens still valid',
94
+ 'No new npm dependencies — bundle size is at ceiling',
95
+ 'Redis connection must use the existing pool in src/redis/client.ts, not a new one',
96
+ ],
97
+ failed_approaches: [
98
+ {
99
+ approach: 'Store refresh tokens as JWTs (self-contained)',
100
+ why_failed: 'Cannot revoke a stateless JWT before expiry. Tried a blocklist but it requires Redis anyway, making stateless JWTs pointless overhead.',
101
+ },
102
+ ],
103
+ files_modified: [
104
+ {
105
+ path: 'src/auth/tokens.ts',
106
+ status: 'modified',
107
+ summary: 'Added generateRefreshToken() and revokeRefreshToken() — stubs only, not wired up yet',
108
+ },
109
+ {
110
+ path: 'src/auth/routes.ts',
111
+ status: 'modified',
112
+ summary: 'Added POST /auth/refresh route — calls token.ts but refresh rotation logic is incomplete',
113
+ },
114
+ ],
115
+ next_steps: [
116
+ {
117
+ task: 'Complete the refresh token rotation logic in src/auth/tokens.ts:rotateRefreshToken()',
118
+ context: 'The function exists but is a stub. It needs to: 1) validate old token in Redis, 2) generate new token, 3) atomically swap old→new in Redis, 4) return new token pair.',
119
+ priority: 'immediate',
120
+ file_hint: 'src/auth/tokens.ts',
121
+ },
122
+ {
123
+ task: 'Add integration test for the rotation flow',
124
+ context: 'Test file is at src/auth/tokens.test.ts — pattern follows the existing login tests',
125
+ priority: 'soon',
126
+ file_hint: 'src/auth/tokens.test.ts',
127
+ },
128
+ ],
129
+ };
130
+ }
131
+ //# sourceMappingURL=template.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"template.js","sourceRoot":"","sources":["../../src/format/template.ts"],"names":[],"mappings":"AAEA;;;GAGG;AAEH,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC9B,EAAE,IAAI,EAAE,sBAAsB,EAAE,KAAK,EAAE,QAAQ,EAAE;IACjD,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,QAAQ,EAAE;IACnC,EAAE,IAAI,EAAE,gBAAgB,EAAE,KAAK,EAAE,SAAS,EAAE;IAC5C,EAAE,IAAI,EAAE,aAAa,EAAE,KAAK,EAAE,aAAa,EAAE;IAC7C,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,OAA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AoB;gBAC1B,MAAM,EAAE,UAAU;gBAClB,OAAO,EAAE,0FAA0F;aACpG;SACF;QACD,UAAU,EAAE;YACV;gBACE,IAAI,EAAE,sFAAsF;gBAC5F,OAAO,EACL,uKAAuK;gBACzK,QAAQ,EAAE,WAAW;gBACrB,SAAS,EAAE,oBAAoB;aAChC;YACD;gBACE,IAAI,EAAE,4CAA4C;gBAClD,OAAO,EAAE,oFAAoF;gBAC7F,QAAQ,EAAE,MAAM;gBAChB,SAAS,EAAE,yBAAyB;aACrC;SACF;KACF,CAAC;AACJ,CAAC"}
@@ -0,0 +1,23 @@
1
+ import type { Repository, ModifiedFile } from '../format/schema.js';
2
+ export interface GitContext {
3
+ repository: Repository;
4
+ files_modified: ModifiedFile[];
5
+ raw_diff: string;
6
+ is_git_repo: boolean;
7
+ }
8
+ /**
9
+ * Detects whether the given directory is a git repository.
10
+ */
11
+ export declare function isGitRepo(cwd: string): Promise<boolean>;
12
+ /**
13
+ * Captures the current git state of the repository at `cwd`.
14
+ * Returns a GitContext with repository metadata, modified files, and raw diff.
15
+ * Gracefully handles non-git directories.
16
+ */
17
+ export declare function captureGitContext(cwd: string): Promise<GitContext>;
18
+ /**
19
+ * Returns the absolute path to the git repository root for the given directory.
20
+ * Returns null if not in a git repo.
21
+ */
22
+ export declare function getRepoRoot(cwd: string): Promise<string | null>;
23
+ //# sourceMappingURL=context.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../src/git/context.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAIpE,MAAM,WAAW,UAAU;IACzB,UAAU,EAAE,UAAU,CAAC;IACvB,cAAc,EAAE,YAAY,EAAE,CAAC;IAC/B,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,OAAO,CAAC;CACtB;AAED;;GAEG;AACH,wBAAsB,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAQ7D;AAED;;;;GAIG;AACH,wBAAsB,iBAAiB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC,CA2FxE;AAED;;;GAGG;AACH,wBAAsB,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAQrE"}
@@ -0,0 +1,121 @@
1
+ import { simpleGit } from 'simple-git';
2
+ /**
3
+ * Detects whether the given directory is a git repository.
4
+ */
5
+ export async function isGitRepo(cwd) {
6
+ try {
7
+ const git = simpleGit(cwd);
8
+ await git.revparse(['--git-dir']);
9
+ return true;
10
+ }
11
+ catch {
12
+ return false;
13
+ }
14
+ }
15
+ /**
16
+ * Captures the current git state of the repository at `cwd`.
17
+ * Returns a GitContext with repository metadata, modified files, and raw diff.
18
+ * Gracefully handles non-git directories.
19
+ */
20
+ export async function captureGitContext(cwd) {
21
+ const git = simpleGit(cwd);
22
+ const isRepo = await isGitRepo(cwd);
23
+ if (!isRepo) {
24
+ return {
25
+ repository: {
26
+ path: cwd,
27
+ branch: 'unknown',
28
+ head_commit: 'unknown',
29
+ },
30
+ files_modified: [],
31
+ raw_diff: '',
32
+ is_git_repo: false,
33
+ };
34
+ }
35
+ // ── Repo metadata ──────────────────────────────────────────────────────────
36
+ const [branch, headLog, topLevel] = await Promise.all([
37
+ git.revparse(['--abbrev-ref', 'HEAD']).catch(() => 'unknown'),
38
+ git.log({ maxCount: 1 }).catch(() => null),
39
+ git.revparse(['--show-toplevel']).catch(() => cwd),
40
+ ]);
41
+ const head_commit = headLog?.latest?.hash?.slice(0, 8) ?? 'unknown';
42
+ const head_message = headLog?.latest?.message?.trim();
43
+ const repository = {
44
+ path: topLevel.trim(),
45
+ branch: branch.trim(),
46
+ head_commit,
47
+ ...(head_message ? { head_message } : {}),
48
+ };
49
+ // ── Modified files ─────────────────────────────────────────────────────────
50
+ const status = await git.status();
51
+ const files_modified = [];
52
+ const addFile = (path, gitStatus) => {
53
+ const status = gitStatus === 'D' || gitStatus === '??' // deleted or untracked-new
54
+ ? gitStatus === 'D'
55
+ ? 'deleted'
56
+ : 'added'
57
+ : gitStatus === 'A' || gitStatus === '?'
58
+ ? 'added'
59
+ : 'modified';
60
+ files_modified.push({
61
+ path,
62
+ status,
63
+ summary: 'Modified during session', // User will update this in interactive mode
64
+ });
65
+ };
66
+ for (const f of status.modified)
67
+ addFile(f, 'M');
68
+ for (const f of status.created)
69
+ addFile(f, 'A');
70
+ for (const f of status.deleted)
71
+ addFile(f, 'D');
72
+ for (const f of status.not_added)
73
+ addFile(f, '?');
74
+ for (const f of status.staged) {
75
+ // Avoid duplicates — staged files may also appear in modified/created/deleted
76
+ if (!files_modified.some((fm) => fm.path === f)) {
77
+ addFile(f, 'M');
78
+ }
79
+ }
80
+ // ── Raw diff ───────────────────────────────────────────────────────────────
81
+ let raw_diff = '';
82
+ try {
83
+ // Staged diff
84
+ const staged = await git.diff(['--cached', '--stat']);
85
+ // Unstaged diff
86
+ const unstaged = await git.diff(['--stat']);
87
+ raw_diff = [staged, unstaged].filter(Boolean).join('\n');
88
+ // Full diff (capped to avoid massive outputs)
89
+ const fullDiff = await git.diff(['--cached']).then((d) => d || git.diff());
90
+ if (fullDiff.length < 50_000) {
91
+ raw_diff = fullDiff;
92
+ }
93
+ else {
94
+ raw_diff = fullDiff.slice(0, 50_000) + '\n\n[diff truncated — too large]';
95
+ }
96
+ }
97
+ catch {
98
+ raw_diff = '';
99
+ }
100
+ return {
101
+ repository,
102
+ files_modified,
103
+ raw_diff,
104
+ is_git_repo: true,
105
+ };
106
+ }
107
+ /**
108
+ * Returns the absolute path to the git repository root for the given directory.
109
+ * Returns null if not in a git repo.
110
+ */
111
+ export async function getRepoRoot(cwd) {
112
+ try {
113
+ const git = simpleGit(cwd);
114
+ const root = await git.revparse(['--show-toplevel']);
115
+ return root.trim();
116
+ }
117
+ catch {
118
+ return null;
119
+ }
120
+ }
121
+ //# source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ACN,QAAQ,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC,EAAE,MAAM,CAAC,GAAG,kCAAkC,CAAC;QAC5E,CAAC;IACH,CAAC;IAAC,MAAM,CAAC;QACP,QAAQ,GAAG,EAAE,CAAC;IAChB,CAAC;IAED,OAAO;QACL,UAAU;QACV,cAAc;QACd,QAAQ;QACR,WAAW,EAAE,IAAI;KAClB,CAAC;AACJ,CAAC;AAED;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,WAAW,CAAC,GAAW;IAC3C,IAAI,CAAC;QACH,MAAM,GAAG,GAAc,SAAS,CAAC,GAAG,CAAC,CAAC;QACtC,MAAM,IAAI,GAAG,MAAM,GAAG,CAAC,QAAQ,CAAC,CAAC,iBAAiB,CAAC,CAAC,CAAC;QACrD,OAAO,IAAI,CAAC,IAAI,EAAE,CAAC;IACrB,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,IAAI,CAAC;IACd,CAAC;AACH,CAAC"}
@@ -0,0 +1,8 @@
1
+ export { HandoffSchema, HistoryEntrySchema } from './format/schema.js';
2
+ export type { Handoff, HistoryEntry, Decision, FailedApproach, ModifiedFile, NextStep } from './format/schema.js';
3
+ export { renderMarkdown, renderAgentPrompt, renderHistoryList } from './format/renderer.js';
4
+ export { captureGitContext, getRepoRoot, isGitRepo } from './git/context.js';
5
+ export { saveHandoff, readHandoff, readHistory, readHistoryEntry, listSavedBranches, getBranchHandoffPath, initRelayDir, isRelayInitialized, registerRepo, unregisterRepo, listRegisteredRepos, readGlobalRegistry, saveGlobalRegistry, getGlobalRegistryPath, } from './storage/index.js';
6
+ export { getStatusReport, type StatusReport } from './cli/commands/status.js';
7
+ export { startDashboardServer } from './server/index.js';
8
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AACvE,YAAY,EAAE,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,cAAc,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAClH,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAC5F,OAAO,EAAE,iBAAiB,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7E,OAAO,EACL,WAAW,EACX,WAAW,EACX,WAAW,EACX,gBAAgB,EAChB,iBAAiB,EACjB,oBAAoB,EACpB,YAAY,EACZ,kBAAkB,EAClB,YAAY,EACZ,cAAc,EACd,mBAAmB,EACnB,kBAAkB,EAClB,kBAAkB,EAClB,qBAAqB,GACtB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,eAAe,EAAE,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAC9E,OAAO,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,8 @@
1
+ // Public API — for programmatic use by other tools
2
+ export { HandoffSchema, HistoryEntrySchema } from './format/schema.js';
3
+ export { renderMarkdown, renderAgentPrompt, renderHistoryList } from './format/renderer.js';
4
+ export { captureGitContext, getRepoRoot, isGitRepo } from './git/context.js';
5
+ export { saveHandoff, readHandoff, readHistory, readHistoryEntry, listSavedBranches, getBranchHandoffPath, initRelayDir, isRelayInitialized, registerRepo, unregisterRepo, listRegisteredRepos, readGlobalRegistry, saveGlobalRegistry, getGlobalRegistryPath, } from './storage/index.js';
6
+ export { getStatusReport } from './cli/commands/status.js';
7
+ export { startDashboardServer } from './server/index.js';
8
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,mDAAmD;AACnD,OAAO,EAAE,aAAa,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAEvE,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAC5F,OAAO,EAAE,iBAAiB,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7E,OAAO,EACL,WAAW,EACX,WAAW,EACX,WAAW,EACX,gBAAgB,EAChB,iBAAiB,EACjB,oBAAoB,EACpB,YAAY,EACZ,kBAAkB,EAClB,YAAY,EACZ,cAAc,EACd,mBAAmB,EACnB,kBAAkB,EAClB,kBAAkB,EAClB,qBAAqB,GACtB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,eAAe,EAAqB,MAAM,0BAA0B,CAAC;AAC9E,OAAO,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare function startMcpServer(): Promise<void>;
2
+ //# sourceMappingURL=server.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../src/mcp/server.ts"],"names":[],"mappings":"AAcA,wBAAsB,cAAc,IAAI,OAAO,CAAC,IAAI,CAAC,CA+LpD"}
@@ -0,0 +1,164 @@
1
+ // @ts-nocheck
2
+ // Note: The MCP SDK v2 bundles its own zod/v4 types that TS treats as a
3
+ // different instance from ours. @ts-nocheck is the cleanest workaround here;
4
+ // runtime behaviour is correct (verified separately).
5
+ import { McpServer } from '@modelcontextprotocol/server';
6
+ import { StdioServerTransport } from '@modelcontextprotocol/server/stdio';
7
+ import * as z from 'zod/v4';
8
+ import { readHandoff, saveHandoff, readHistory, readHistoryEntry, resolveCwd } from '../storage/index.js';
9
+ import { captureGitContext, getRepoRoot } from '../git/context.js';
10
+ import { HandoffSchema } from '../format/schema.js';
11
+ import { renderAgentPrompt, renderMarkdown } from '../format/renderer.js';
12
+ import { randomUUID } from 'crypto';
13
+ export async function startMcpServer() {
14
+ const cwd = resolveCwd();
15
+ const repoRoot = await getRepoRoot(cwd);
16
+ if (!repoRoot) {
17
+ process.stderr.write('Relay MCP server: not in a git repository\n');
18
+ process.exit(1);
19
+ }
20
+ const server = new McpServer({
21
+ name: 'relay',
22
+ version: '0.1.0',
23
+ });
24
+ // ── Tool: read_handoff ───────────────────────────────────────────────────────
25
+ server.registerTool('read_handoff', {
26
+ description: 'Read the current Relay handoff document. Call this at the start of any session to inherit context from the previous platform.',
27
+ inputSchema: z.object({
28
+ format: z.enum(['prompt', 'markdown', 'json']).optional().describe('Output format: "prompt" = compact agent-ready text, "markdown" = full document, "json" = raw data (default: prompt)'),
29
+ }),
30
+ }, async ({ format }) => {
31
+ const handoff = readHandoff(repoRoot);
32
+ if (!handoff) {
33
+ return {
34
+ content: [{ type: 'text', text: 'No handoff found. This is a fresh session.' }],
35
+ };
36
+ }
37
+ const text = format === 'json'
38
+ ? JSON.stringify(handoff, null, 2)
39
+ : format === 'markdown'
40
+ ? renderMarkdown(handoff)
41
+ : renderAgentPrompt(handoff);
42
+ return { content: [{ type: 'text', text }] };
43
+ });
44
+ // ── Tool: write_handoff ──────────────────────────────────────────────────────
45
+ server.registerTool('write_handoff', {
46
+ description: 'Write a Relay handoff document. Call this when ending a session to preserve context for the next platform.',
47
+ inputSchema: z.object({
48
+ goal: z.string().describe('What the session was trying to accomplish'),
49
+ status: z.enum(['in_progress', 'blocked', 'completed']).describe('Current status of the work'),
50
+ token_exhausted: z.boolean().optional().describe('Was this handoff triggered by a token limit?'),
51
+ source_platform: z.enum(['claude', 'cursor', 'copilot', 'antigravity', 'other']).optional().describe('Source platform name'),
52
+ decisions: z.array(z.object({
53
+ what: z.string(),
54
+ why: z.string(),
55
+ evidence: z.string().optional(),
56
+ })).optional().describe('Key decisions made'),
57
+ constraints: z.array(z.string()).optional().describe('Non-negotiable constraints'),
58
+ failed_approaches: z.array(z.object({
59
+ approach: z.string(),
60
+ why_failed: z.string(),
61
+ })).optional().describe('Approaches tried and failed'),
62
+ files_modified: z.array(z.object({
63
+ path: z.string(),
64
+ status: z.enum(['added', 'modified', 'deleted']).optional(),
65
+ summary: z.string(),
66
+ })).optional().describe('List of modified files'),
67
+ next_steps: z.array(z.object({
68
+ task: z.string(),
69
+ context: z.string().optional(),
70
+ priority: z.enum(['immediate', 'soon', 'later']).optional(),
71
+ file_hint: z.string().optional(),
72
+ })).optional().describe('Ordered next steps'),
73
+ }),
74
+ }, async (input) => {
75
+ const gitContext = await captureGitContext(repoRoot);
76
+ const handoff = HandoffSchema.parse({
77
+ version: '1',
78
+ id: randomUUID().slice(0, 8),
79
+ timestamp: new Date().toISOString(),
80
+ repository: gitContext.repository,
81
+ raw_diff: gitContext.raw_diff || undefined,
82
+ files_modified: Array.isArray(input['files_modified']) && input['files_modified'].length > 0
83
+ ? input['files_modified']
84
+ : gitContext.files_modified,
85
+ session: {
86
+ goal: input['goal'],
87
+ status: input['status'],
88
+ token_exhausted: input['token_exhausted'] || false,
89
+ },
90
+ source_platform: input['source_platform'] || 'other',
91
+ decisions: input['decisions'] || [],
92
+ constraints: input['constraints'] || [],
93
+ failed_approaches: input['failed_approaches'] || [],
94
+ next_steps: input['next_steps'] || [],
95
+ });
96
+ saveHandoff(repoRoot, handoff);
97
+ return {
98
+ content: [{
99
+ type: 'text',
100
+ text: `✓ Handoff saved (ID: ${handoff.id})\n\nThe next agent can read it with the read_handoff tool or by reading .relay/handoff.md`,
101
+ }],
102
+ };
103
+ });
104
+ // ── Tool: get_git_context ────────────────────────────────────────────────────
105
+ server.registerTool('get_git_context', {
106
+ description: 'Get the current git state — branch, HEAD commit, modified files, and diff.',
107
+ inputSchema: z.object({
108
+ include_diff: z.boolean().optional().describe('Include the raw git diff (can be large)'),
109
+ }),
110
+ }, async ({ include_diff }) => {
111
+ const ctx = await captureGitContext(repoRoot);
112
+ const output = {
113
+ repository: ctx.repository,
114
+ files_modified: ctx.files_modified,
115
+ ...(include_diff ? { raw_diff: ctx.raw_diff } : {}),
116
+ };
117
+ return { content: [{ type: 'text', text: JSON.stringify(output, null, 2) }] };
118
+ });
119
+ // ── Tool: list_history ────────────────────────────────────────────────────────
120
+ server.registerTool('list_history', {
121
+ description: 'List past Relay handoffs for this repository.',
122
+ inputSchema: z.object({
123
+ limit: z.number().int().positive().optional().describe('Maximum number of entries to return (default: 10)'),
124
+ }),
125
+ }, async ({ limit }) => {
126
+ const entries = readHistory(repoRoot).slice(0, limit || 10);
127
+ if (entries.length === 0) {
128
+ return { content: [{ type: 'text', text: 'No handoff history found.' }] };
129
+ }
130
+ return { content: [{ type: 'text', text: JSON.stringify(entries, null, 2) }] };
131
+ });
132
+ // ── Tool: get_history_entry ───────────────────────────────────────────────────
133
+ server.registerTool('get_history_entry', {
134
+ description: 'Get a specific past handoff by ID.',
135
+ inputSchema: z.object({
136
+ id: z.string().describe('Handoff ID (from list_history)'),
137
+ }),
138
+ }, async ({ id }) => {
139
+ const content = readHistoryEntry(repoRoot, id);
140
+ if (!content) {
141
+ return {
142
+ isError: true,
143
+ content: [{ type: 'text', text: `No history entry found with ID: ${id}` }],
144
+ };
145
+ }
146
+ return { content: [{ type: 'text', text: content }] };
147
+ });
148
+ // ── Resource: current handoff ──────────────────────────────────────────────
149
+ server.registerResource('current-handoff', 'relay://handoff/current', {
150
+ description: 'The current Relay handoff document for this repository',
151
+ mimeType: 'text/markdown',
152
+ }, async () => {
153
+ const handoff = readHandoff(repoRoot);
154
+ if (!handoff) {
155
+ return { contents: [{ uri: 'relay://handoff/current', text: 'No handoff found.' }] };
156
+ }
157
+ return { contents: [{ uri: 'relay://handoff/current', text: renderMarkdown(handoff) }] };
158
+ });
159
+ // ── Start server via StdioServerTransport ──────────────────────────────────
160
+ process.stderr.write(`Relay MCP server starting (repo: ${repoRoot})\n`);
161
+ const transport = new StdioServerTransport();
162
+ await server.connect(transport);
163
+ }
164
+ //# sourceMappingURL=server.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"server.js","sourceRoot":"","sources":["../../src/mcp/server.ts"],"names":[],"mappings":"AAAA,cAAc;AACd,wEAAwE;AACxE,6EAA6E;AAC7E,sDA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WAAW,EAAE,wDAAwD;QACrE,QAAQ,EAAE,eAAe;KAC1B,EACD,KAAK,IAAI,EAAE;QACT,MAAM,OAAO,GAAG,WAAW,CAAC,QAAQ,CAAC,CAAC;QACtC,IAAI,CAAC,OAAO,EAAE,CAAC;YACb,OAAO,EAAE,QAAQ,EAAE,CAAC,EAAE,GAAG,EAAE,yBAAyB,EAAE,IAAI,EAAE,mBAAmB,EAAE,CAAC,EAAE,CAAC;QACvF,CAAC;QACD,OAAO,EAAE,QAAQ,EAAE,CAAC,EAAE,GAAG,EAAE,yBAAyB,EAAE,IAAI,EAAE,cAAc,CAAC,OAAO,CAAC,EAAE,CAAC,EAAE,CAAC;IAC3F,CAAC,CACF,CAAC;IAEF,8EAA8E;IAC9E,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,oCAAoC,QAAQ,KAAK,CAAC,CAAC;IACxE,MAAM,SAAS,GAAG,IAAI,oBAAoB,EAAE,CAAC;IAC7C,MAAM,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;AAClC,CAAC"}
@@ -0,0 +1,12 @@
1
+ import http from 'http';
2
+ export interface ServerOptions {
3
+ port?: number | undefined;
4
+ repoRoot: string;
5
+ global?: boolean;
6
+ }
7
+ export declare function startDashboardServer(options: ServerOptions): Promise<{
8
+ server: http.Server;
9
+ port: number;
10
+ url: string;
11
+ }>;
12
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/server/index.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,MAAM,CAAC;AAQxB,MAAM,WAAW,aAAa;IAC5B,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1B,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,aAAa,GAAG,OAAO,CAAC;IAAE,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,CAAC,CAkJxH"}