@aligndottech/cli 0.37.1 → 0.38.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 +16 -10
- package/dist/cli.d.ts +28 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +98 -0
- package/dist/cli.js.map +1 -0
- package/dist/commands/check.d.ts +1 -1
- package/dist/commands/check.d.ts.map +1 -1
- package/dist/commands/check.js +44 -2
- package/dist/commands/check.js.map +1 -1
- package/dist/commands/connect-agents.d.ts +1 -0
- package/dist/commands/connect-agents.d.ts.map +1 -1
- package/dist/commands/connect-agents.js +10 -6
- package/dist/commands/connect-agents.js.map +1 -1
- package/dist/commands/connect.d.ts +31 -0
- package/dist/commands/connect.d.ts.map +1 -0
- package/dist/commands/connect.js +92 -0
- package/dist/commands/connect.js.map +1 -0
- package/dist/commands/context.d.ts.map +1 -1
- package/dist/commands/context.js +52 -10
- package/dist/commands/context.js.map +1 -1
- package/dist/commands/decisions/index.d.ts.map +1 -1
- package/dist/commands/decisions/index.js +5 -0
- package/dist/commands/decisions/index.js.map +1 -1
- package/dist/commands/default-action.d.ts +3 -1
- package/dist/commands/default-action.d.ts.map +1 -1
- package/dist/commands/default-action.js +29 -27
- package/dist/commands/default-action.js.map +1 -1
- package/dist/commands/export.d.ts.map +1 -1
- package/dist/commands/export.js +3 -0
- package/dist/commands/export.js.map +1 -1
- package/dist/commands/import/sessions.d.ts +10 -2
- package/dist/commands/import/sessions.d.ts.map +1 -1
- package/dist/commands/import/sessions.js +98 -3
- package/dist/commands/import/sessions.js.map +1 -1
- package/dist/commands/import.d.ts +7 -0
- package/dist/commands/import.d.ts.map +1 -1
- package/dist/commands/import.js +42 -2
- package/dist/commands/import.js.map +1 -1
- package/dist/commands/invite.d.ts +25 -0
- package/dist/commands/invite.d.ts.map +1 -0
- package/dist/commands/invite.js +68 -0
- package/dist/commands/invite.js.map +1 -0
- package/dist/commands/links.d.ts.map +1 -1
- package/dist/commands/links.js +5 -0
- package/dist/commands/links.js.map +1 -1
- package/dist/commands/mcp.d.ts +64 -35
- package/dist/commands/mcp.d.ts.map +1 -1
- package/dist/commands/mcp.js +85 -40
- package/dist/commands/mcp.js.map +1 -1
- package/dist/commands/ratify.d.ts.map +1 -1
- package/dist/commands/ratify.js +21 -0
- package/dist/commands/ratify.js.map +1 -1
- package/dist/commands/registry.d.ts +30 -0
- package/dist/commands/registry.d.ts.map +1 -0
- package/dist/commands/registry.js +70 -0
- package/dist/commands/registry.js.map +1 -0
- package/dist/commands/setup.d.ts +45 -1
- package/dist/commands/setup.d.ts.map +1 -1
- package/dist/commands/setup.js +197 -88
- package/dist/commands/setup.js.map +1 -1
- package/dist/commands/status.d.ts.map +1 -1
- package/dist/commands/status.js +10 -22
- package/dist/commands/status.js.map +1 -1
- package/dist/commands/telemetry.d.ts +7 -3
- package/dist/commands/telemetry.d.ts.map +1 -1
- package/dist/commands/telemetry.js +12 -7
- package/dist/commands/telemetry.js.map +1 -1
- package/dist/commands/why.d.ts.map +1 -1
- package/dist/commands/why.js +52 -10
- package/dist/commands/why.js.map +1 -1
- package/dist/index.js +4 -90
- package/dist/index.js.map +1 -1
- package/dist/lib/agent-rules.d.ts +1 -0
- package/dist/lib/agent-rules.d.ts.map +1 -1
- package/dist/lib/agent-rules.js +60 -0
- package/dist/lib/agent-rules.js.map +1 -1
- package/dist/lib/commands-doc.d.ts +15 -0
- package/dist/lib/commands-doc.d.ts.map +1 -0
- package/dist/lib/commands-doc.js +85 -0
- package/dist/lib/commands-doc.js.map +1 -0
- package/dist/lib/config.d.ts +7 -2
- package/dist/lib/config.d.ts.map +1 -1
- package/dist/lib/config.js.map +1 -1
- package/dist/lib/connect-prompt.d.ts +1 -1
- package/dist/lib/connect-prompt.js +2 -2
- package/dist/lib/connect-prompt.js.map +1 -1
- package/dist/lib/decision-links.d.ts +39 -0
- package/dist/lib/decision-links.d.ts.map +1 -1
- package/dist/lib/decision-links.js +51 -0
- package/dist/lib/decision-links.js.map +1 -1
- package/dist/lib/first-decision.d.ts +22 -0
- package/dist/lib/first-decision.d.ts.map +1 -0
- package/dist/lib/first-decision.js +22 -0
- package/dist/lib/first-decision.js.map +1 -0
- package/dist/lib/gateway-client.d.ts +13 -0
- package/dist/lib/gateway-client.d.ts.map +1 -1
- package/dist/lib/gateway-client.js +14 -0
- package/dist/lib/gateway-client.js.map +1 -1
- package/dist/lib/git.d.ts +28 -0
- package/dist/lib/git.d.ts.map +1 -1
- package/dist/lib/git.js +42 -0
- package/dist/lib/git.js.map +1 -1
- package/dist/lib/hook-context.d.ts +7 -0
- package/dist/lib/hook-context.d.ts.map +1 -0
- package/dist/lib/hook-context.js +37 -0
- package/dist/lib/hook-context.js.map +1 -0
- package/dist/lib/hook-payload.d.ts +7 -0
- package/dist/lib/hook-payload.d.ts.map +1 -1
- package/dist/lib/hook-payload.js +56 -8
- package/dist/lib/hook-payload.js.map +1 -1
- package/dist/lib/invite-prompt.d.ts +46 -0
- package/dist/lib/invite-prompt.d.ts.map +1 -0
- package/dist/lib/invite-prompt.js +63 -0
- package/dist/lib/invite-prompt.js.map +1 -0
- package/dist/lib/mcp-instructions.shared.d.ts +40 -0
- package/dist/lib/mcp-instructions.shared.d.ts.map +1 -0
- package/dist/lib/mcp-instructions.shared.js +56 -0
- package/dist/lib/mcp-instructions.shared.js.map +1 -0
- package/dist/lib/mcp-setup.d.ts +32 -2
- package/dist/lib/mcp-setup.d.ts.map +1 -1
- package/dist/lib/mcp-setup.js +92 -6
- package/dist/lib/mcp-setup.js.map +1 -1
- package/dist/lib/next-step.d.ts +92 -0
- package/dist/lib/next-step.d.ts.map +1 -0
- package/dist/lib/next-step.js +97 -0
- package/dist/lib/next-step.js.map +1 -0
- package/dist/lib/personal-email-domains.d.ts +8 -0
- package/dist/lib/personal-email-domains.d.ts.map +1 -0
- package/dist/lib/personal-email-domains.js +39 -0
- package/dist/lib/personal-email-domains.js.map +1 -0
- package/dist/lib/personal-import.d.ts +2 -0
- package/dist/lib/personal-import.d.ts.map +1 -1
- package/dist/lib/personal-import.js +4 -1
- package/dist/lib/personal-import.js.map +1 -1
- package/dist/lib/read-value-rollup.d.ts +18 -0
- package/dist/lib/read-value-rollup.d.ts.map +1 -0
- package/dist/lib/read-value-rollup.js +33 -0
- package/dist/lib/read-value-rollup.js.map +1 -0
- package/dist/lib/sessions/import-summary.d.ts +39 -0
- package/dist/lib/sessions/import-summary.d.ts.map +1 -0
- package/dist/lib/sessions/import-summary.js +41 -0
- package/dist/lib/sessions/import-summary.js.map +1 -0
- package/dist/lib/sessions/memory-files.d.ts +85 -0
- package/dist/lib/sessions/memory-files.d.ts.map +1 -0
- package/dist/lib/sessions/memory-files.js +235 -0
- package/dist/lib/sessions/memory-files.js.map +1 -0
- package/dist/lib/sessions/source-url.d.ts +11 -0
- package/dist/lib/sessions/source-url.d.ts.map +1 -1
- package/dist/lib/sessions/source-url.js +15 -0
- package/dist/lib/sessions/source-url.js.map +1 -1
- package/dist/lib/setup-funnel.d.ts +41 -0
- package/dist/lib/setup-funnel.d.ts.map +1 -0
- package/dist/lib/setup-funnel.js +28 -0
- package/dist/lib/setup-funnel.js.map +1 -0
- package/dist/lib/telemetry-consent.d.ts +17 -8
- package/dist/lib/telemetry-consent.d.ts.map +1 -1
- package/dist/lib/telemetry-consent.js +21 -6
- package/dist/lib/telemetry-consent.js.map +1 -1
- package/dist/lib/telemetry-env.d.ts +19 -0
- package/dist/lib/telemetry-env.d.ts.map +1 -0
- package/dist/lib/telemetry-env.js +13 -0
- package/dist/lib/telemetry-env.js.map +1 -0
- package/dist/lib/usage-telemetry.d.ts +108 -13
- package/dist/lib/usage-telemetry.d.ts.map +1 -1
- package/dist/lib/usage-telemetry.js +227 -55
- package/dist/lib/usage-telemetry.js.map +1 -1
- package/dist/lib/user-hooks.d.ts +15 -0
- package/dist/lib/user-hooks.d.ts.map +1 -0
- package/dist/lib/user-hooks.js +144 -0
- package/dist/lib/user-hooks.js.map +1 -0
- package/dist/lib/value-rollup.d.ts +10 -3
- package/dist/lib/value-rollup.d.ts.map +1 -1
- package/dist/lib/value-rollup.js +11 -4
- package/dist/lib/value-rollup.js.map +1 -1
- package/package.json +2 -1
package/dist/lib/hook-payload.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
const asRecord = (v) => v !== null && typeof v === 'object' && !Array.isArray(v) ? v : null;
|
|
2
|
+
const cwdOf = (p) => (typeof p['cwd'] === 'string' ? p['cwd'] : undefined);
|
|
2
3
|
// pi's edit tool takes edits[{oldText,newText}] (and still accepts a legacy top-level
|
|
3
4
|
// oldText/newText pair - see prepareEditArguments in pi's core/tools/edit.ts). Rename
|
|
4
5
|
// into the canonical shape proposedChangeText() reads.
|
|
@@ -43,21 +44,51 @@ function fromOpenCodeArgs(args) {
|
|
|
43
44
|
out.new_string = args['newString'];
|
|
44
45
|
return out;
|
|
45
46
|
}
|
|
47
|
+
// Codex speaks Claude Code's field names, and its file edits go through apply_patch, whose
|
|
48
|
+
// tool_input carries the whole patch under `command` (Codex hooks reference: "tool_input.command
|
|
49
|
+
// applies to Bash and apply_patch"). The patch IS the proposed change, so it maps to
|
|
50
|
+
// `content` exactly as OpenCode's patchText does. ONLY for apply_patch: a Bash command is
|
|
51
|
+
// not a proposed edit. Documented shape, pending a real capture (fixtures/hook-payloads/).
|
|
52
|
+
function fromCodexInput(toolName, input) {
|
|
53
|
+
const out = { ...input };
|
|
54
|
+
if (toolName === 'apply_patch' && typeof input['command'] === 'string' && out.content === undefined) {
|
|
55
|
+
out.content = input['command'];
|
|
56
|
+
}
|
|
57
|
+
return out;
|
|
58
|
+
}
|
|
59
|
+
// The host event names that mean "before the tool runs" / "after it ran". Claude Code and
|
|
60
|
+
// Codex use PascalCase; Cursor uses camelCase for the same two events. Passed through
|
|
61
|
+
// verbatim, 'preToolUse' would never equal 'PreToolUse' and the proposed edit would be
|
|
62
|
+
// checked as though it had already landed - silently.
|
|
63
|
+
function canonicalEvent(name) {
|
|
64
|
+
const lower = name.toLowerCase();
|
|
65
|
+
if (lower === 'pretooluse')
|
|
66
|
+
return 'PreToolUse';
|
|
67
|
+
if (lower === 'posttooluse')
|
|
68
|
+
return 'PostToolUse';
|
|
69
|
+
return name;
|
|
70
|
+
}
|
|
46
71
|
// Normalize whichever host's hook payload arrived on stdin into the canonical
|
|
47
72
|
// HookPayload, so runAdvisory never learns which agent it is serving. Every field name
|
|
48
73
|
// below comes from that host's published schema:
|
|
49
|
-
// Claude Code {hook_event_name, tool_name, tool_input} - already canonical
|
|
74
|
+
// Claude Code {hook_event_name, tool_name, tool_input, cwd} - already canonical
|
|
75
|
+
// Codex the same, with apply_patch's patch under tool_input.command
|
|
50
76
|
// pi {type:'tool_call'|'tool_result', toolName, input} - extension events
|
|
51
77
|
// Gemini CLI {tool_name, tool_input, tool_response?} - AfterTool is the
|
|
52
78
|
// one carrying tool_response, which is what derives the event
|
|
53
|
-
// Cursor {hook_event_name:'
|
|
79
|
+
// Cursor {hook_event_name:'preToolUse'|'postToolUse', tool_name, tool_input, cwd},
|
|
80
|
+
// and {hook_event_name:'afterFileEdit', file_path, edits} - fields sit at the
|
|
54
81
|
// TOP level rather than under tool_input
|
|
82
|
+
// Copilot CLI {sessionId, timestamp, cwd, toolName, toolArgs, toolResult?} - no event
|
|
83
|
+
// name at all; toolResult is what postToolUse carries. Its "VS Code
|
|
84
|
+
// compatible" variant is the Claude Code shape and takes that branch.
|
|
55
85
|
// Returns null when nothing tool-shaped is present, so callers fall back rather than
|
|
56
86
|
// checking an empty change.
|
|
57
87
|
export function normalizeHookPayload(raw) {
|
|
58
88
|
const p = asRecord(raw);
|
|
59
89
|
if (!p)
|
|
60
90
|
return null;
|
|
91
|
+
const cwd = cwdOf(p);
|
|
61
92
|
// pi: the event type is explicit on the payload.
|
|
62
93
|
if (p['type'] === 'tool_call' || p['type'] === 'tool_result') {
|
|
63
94
|
const input = asRecord(p['input']) ?? {};
|
|
@@ -65,6 +96,7 @@ export function normalizeHookPayload(raw) {
|
|
|
65
96
|
hook_event_name: p['type'] === 'tool_call' ? 'PreToolUse' : 'PostToolUse',
|
|
66
97
|
tool_name: typeof p['toolName'] === 'string' ? p['toolName'] : undefined,
|
|
67
98
|
tool_input: fromPiInput(input),
|
|
99
|
+
...(cwd !== undefined ? { cwd } : {}),
|
|
68
100
|
};
|
|
69
101
|
}
|
|
70
102
|
// OpenCode: the plugin hook name is the event.
|
|
@@ -73,28 +105,44 @@ export function normalizeHookPayload(raw) {
|
|
|
73
105
|
hook_event_name: p['type'] === 'tool.execute.before' ? 'PreToolUse' : 'PostToolUse',
|
|
74
106
|
tool_name: typeof p['tool'] === 'string' ? p['tool'] : undefined,
|
|
75
107
|
tool_input: fromOpenCodeArgs(asRecord(p['args']) ?? {}),
|
|
108
|
+
...(cwd !== undefined ? { cwd } : {}),
|
|
76
109
|
};
|
|
77
110
|
}
|
|
78
|
-
// Cursor: afterFileEdit is observational and flat.
|
|
111
|
+
// Cursor: afterFileEdit is observational and flat.
|
|
79
112
|
if (p['hook_event_name'] === 'afterFileEdit') {
|
|
80
113
|
const tool_input = {};
|
|
81
114
|
if (typeof p['file_path'] === 'string')
|
|
82
115
|
tool_input.file_path = p['file_path'];
|
|
83
116
|
if (Array.isArray(p['edits']))
|
|
84
117
|
tool_input.edits = p['edits'];
|
|
85
|
-
return { hook_event_name: 'PostToolUse', tool_name: 'Edit', tool_input };
|
|
118
|
+
return { hook_event_name: 'PostToolUse', tool_name: 'Edit', tool_input, ...(cwd !== undefined ? { cwd } : {}) };
|
|
86
119
|
}
|
|
87
|
-
// Claude Code / Gemini CLI:
|
|
120
|
+
// Claude Code / Codex / Gemini CLI / Cursor: all speak tool_name + tool_input.
|
|
88
121
|
if (p['tool_name'] !== undefined || p['tool_input'] !== undefined) {
|
|
122
|
+
const tool_name = typeof p['tool_name'] === 'string' ? p['tool_name'] : undefined;
|
|
89
123
|
const event = typeof p['hook_event_name'] === 'string'
|
|
90
|
-
? p['hook_event_name']
|
|
124
|
+
? canonicalEvent(p['hook_event_name'])
|
|
91
125
|
: p['tool_response'] !== undefined
|
|
92
126
|
? 'PostToolUse'
|
|
93
127
|
: 'PreToolUse';
|
|
94
128
|
return {
|
|
95
129
|
hook_event_name: event,
|
|
96
|
-
tool_name
|
|
97
|
-
tool_input: (asRecord(p['tool_input']) ?? {}),
|
|
130
|
+
tool_name,
|
|
131
|
+
tool_input: fromCodexInput(tool_name, asRecord(p['tool_input']) ?? {}),
|
|
132
|
+
...(cwd !== undefined ? { cwd } : {}),
|
|
133
|
+
};
|
|
134
|
+
}
|
|
135
|
+
// Copilot CLI (camelCase): toolName + toolArgs, toolResult only after the tool ran. The
|
|
136
|
+
// toolArgs field names for its edit/create tools are not documented; they pass through
|
|
137
|
+
// as-is and a shape proposedChangeText() cannot read means the pre-edit check stays
|
|
138
|
+
// silent (fail-open) while postToolUse still carries the landed diff. Pending a real
|
|
139
|
+
// capture (fixtures/hook-payloads/).
|
|
140
|
+
if (typeof p['toolName'] === 'string') {
|
|
141
|
+
return {
|
|
142
|
+
hook_event_name: p['toolResult'] !== undefined ? 'PostToolUse' : 'PreToolUse',
|
|
143
|
+
tool_name: p['toolName'],
|
|
144
|
+
tool_input: (asRecord(p['toolArgs']) ?? {}),
|
|
145
|
+
...(cwd !== undefined ? { cwd } : {}),
|
|
98
146
|
};
|
|
99
147
|
}
|
|
100
148
|
return null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hook-payload.js","sourceRoot":"","sources":["../../src/lib/hook-payload.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"hook-payload.js","sourceRoot":"","sources":["../../src/lib/hook-payload.ts"],"names":[],"mappings":"AAyBA,MAAM,QAAQ,GAAG,CAAC,CAAU,EAAc,EAAE,CAC1C,CAAC,KAAK,IAAI,IAAI,OAAO,CAAC,KAAK,QAAQ,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAE,CAAS,CAAC,CAAC,CAAC,IAAI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,CAAC,CAAC;QACF,uFAAuF;QACvF,uFAAuF;QACvF,2DAA2D;QAC3D,MAAM,GAAG,GAAG,CAAC,EAAU,EAAQ,EAAE;YAC/B,YAAY,CAAC,KAAK,CAAC,CAAC;YACpB,KAAK,GAAG,UAAU,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;QACjC,CAAC,CAAC;QACF,GAAG,CAAC,qBAAqB,CAAC,CAAC;QAC3B,MAAM,CAAC,WAAW,EAAE,CAAC,MAAM,CAAC,CAAC;QAC7B,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,CAAC,KAAa,EAAE,EAAE;YAClC,IAAI,IAAI,KAAK,CAAC;YACd,GAAG,CAAC,eAAe,CAAC,CAAC;QACvB,CAAC,CAAC,CAAC;QACH,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;QACzB,MAAM,CAAC,EAAE,CAAC,OAAO,EAAE,CAAC,GAAG,EAAE,EAAE;YACzB,YAAY,CAAC,KAAK,CAAC,CAAC;YACpB,MAAM,CAAC,GAAG,CAAC,CAAC;QACd,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ALI-938: the invite nudge - what replaces the three "Share this graph with your team:
|
|
3
|
+
* https://align.tech/pricing" lines in mcp.ts, why.ts and value-rollup.ts. A URL asks
|
|
4
|
+
* someone to go somewhere else and figure it out; `align invite <email>` is a command
|
|
5
|
+
* they can run right there.
|
|
6
|
+
*
|
|
7
|
+
* Pure and I/O-free, same discipline as connect-prompt.ts's gap lines: the callers
|
|
8
|
+
* (why.ts, in particular) gather whatever local git/graph state the decision requires,
|
|
9
|
+
* and this module only turns already-known facts into copy.
|
|
10
|
+
*/
|
|
11
|
+
export declare const INVITE_HINT = "align invite <their-email>";
|
|
12
|
+
export type InviteNudgeReason = 'value' | 'answered-by-other' | 'empty-with-committers';
|
|
13
|
+
/**
|
|
14
|
+
* One line, reason-specific lead-in + the shared command hint. Three reasons:
|
|
15
|
+
* - 'value': the graph has done something worth sharing (mcp.ts, value-rollup.ts's
|
|
16
|
+
* existing `hasValue` trigger - an aggregate signal, not tied to one decision).
|
|
17
|
+
* - 'answered-by-other': `align ask` answered from a decision someone else made -
|
|
18
|
+
* the clearest single moment the bottom-up thesis is about ("this would be amazing
|
|
19
|
+
* if my whole team's decisions were in here").
|
|
20
|
+
* - 'empty-with-committers': the question came back empty, but the repo has commits
|
|
21
|
+
* from people other than whoever is running the command - their graph isn't in
|
|
22
|
+
* here yet.
|
|
23
|
+
*/
|
|
24
|
+
export declare function inviteNudgeLine(reason?: InviteNudgeReason): string;
|
|
25
|
+
export interface DecisionAuthorLike {
|
|
26
|
+
name?: string;
|
|
27
|
+
email?: string;
|
|
28
|
+
}
|
|
29
|
+
export interface LocalIdentity {
|
|
30
|
+
email: string | null;
|
|
31
|
+
name: string | null;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Whether at least one of these decisions was authored by someone other than whoever is
|
|
35
|
+
* running the command - the signal `inviteNudgeLine('answered-by-other')` is for.
|
|
36
|
+
*
|
|
37
|
+
* Deliberately conservative in both directions:
|
|
38
|
+
* - with no local identity at all, this can't compare anything and returns false
|
|
39
|
+
* rather than guessing (verification.md: never claim a comparison you didn't make).
|
|
40
|
+
* - for one author, it compares email-to-email if both sides have an email, else
|
|
41
|
+
* name-to-name if both sides have a name. It never compares an email against a
|
|
42
|
+
* name (no cheap way to know they refer to the same person), and an author with
|
|
43
|
+
* neither field carries no attribution to judge.
|
|
44
|
+
*/
|
|
45
|
+
export declare function answeredBySomeoneElse(authors: Array<DecisionAuthorLike | null | undefined>, me: LocalIdentity): boolean;
|
|
46
|
+
//# sourceMappingURL=invite-prompt.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"invite-prompt.d.ts","sourceRoot":"","sources":["../../src/lib/invite-prompt.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,eAAO,MAAM,WAAW,+BAA+B,CAAC;AAExD,MAAM,MAAM,iBAAiB,GAAG,OAAO,GAAG,mBAAmB,GAAG,uBAAuB,CAAC;AAExF;;;;;;;;;;GAUG;AACH,wBAAgB,eAAe,CAAC,MAAM,GAAE,iBAA2B,GAAG,MAAM,CAU3E;AAED,MAAM,WAAW,kBAAkB;IACjC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,aAAa;IAC5B,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;CACrB;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,qBAAqB,CACnC,OAAO,EAAE,KAAK,CAAC,kBAAkB,GAAG,IAAI,GAAG,SAAS,CAAC,EACrD,EAAE,EAAE,aAAa,GAChB,OAAO,CAaT"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ALI-938: the invite nudge - what replaces the three "Share this graph with your team:
|
|
3
|
+
* https://align.tech/pricing" lines in mcp.ts, why.ts and value-rollup.ts. A URL asks
|
|
4
|
+
* someone to go somewhere else and figure it out; `align invite <email>` is a command
|
|
5
|
+
* they can run right there.
|
|
6
|
+
*
|
|
7
|
+
* Pure and I/O-free, same discipline as connect-prompt.ts's gap lines: the callers
|
|
8
|
+
* (why.ts, in particular) gather whatever local git/graph state the decision requires,
|
|
9
|
+
* and this module only turns already-known facts into copy.
|
|
10
|
+
*/
|
|
11
|
+
export const INVITE_HINT = 'align invite <their-email>';
|
|
12
|
+
/**
|
|
13
|
+
* One line, reason-specific lead-in + the shared command hint. Three reasons:
|
|
14
|
+
* - 'value': the graph has done something worth sharing (mcp.ts, value-rollup.ts's
|
|
15
|
+
* existing `hasValue` trigger - an aggregate signal, not tied to one decision).
|
|
16
|
+
* - 'answered-by-other': `align ask` answered from a decision someone else made -
|
|
17
|
+
* the clearest single moment the bottom-up thesis is about ("this would be amazing
|
|
18
|
+
* if my whole team's decisions were in here").
|
|
19
|
+
* - 'empty-with-committers': the question came back empty, but the repo has commits
|
|
20
|
+
* from people other than whoever is running the command - their graph isn't in
|
|
21
|
+
* here yet.
|
|
22
|
+
*/
|
|
23
|
+
export function inviteNudgeLine(reason = 'value') {
|
|
24
|
+
switch (reason) {
|
|
25
|
+
case 'answered-by-other':
|
|
26
|
+
return `That came from a decision someone else made. Get your whole team in here: ${INVITE_HINT}`;
|
|
27
|
+
case 'empty-with-committers':
|
|
28
|
+
return `Nothing matched, but this repo has other committers. Bring them into your graph: ${INVITE_HINT}`;
|
|
29
|
+
case 'value':
|
|
30
|
+
default:
|
|
31
|
+
return `Add a teammate to this graph: ${INVITE_HINT}`;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Whether at least one of these decisions was authored by someone other than whoever is
|
|
36
|
+
* running the command - the signal `inviteNudgeLine('answered-by-other')` is for.
|
|
37
|
+
*
|
|
38
|
+
* Deliberately conservative in both directions:
|
|
39
|
+
* - with no local identity at all, this can't compare anything and returns false
|
|
40
|
+
* rather than guessing (verification.md: never claim a comparison you didn't make).
|
|
41
|
+
* - for one author, it compares email-to-email if both sides have an email, else
|
|
42
|
+
* name-to-name if both sides have a name. It never compares an email against a
|
|
43
|
+
* name (no cheap way to know they refer to the same person), and an author with
|
|
44
|
+
* neither field carries no attribution to judge.
|
|
45
|
+
*/
|
|
46
|
+
export function answeredBySomeoneElse(authors, me) {
|
|
47
|
+
const myEmail = me.email?.toLowerCase() ?? null;
|
|
48
|
+
const myName = me.name?.toLowerCase() ?? null;
|
|
49
|
+
if (!myEmail && !myName)
|
|
50
|
+
return false;
|
|
51
|
+
return authors.some((a) => {
|
|
52
|
+
if (!a)
|
|
53
|
+
return false;
|
|
54
|
+
const email = a.email?.toLowerCase();
|
|
55
|
+
const name = a.name?.toLowerCase();
|
|
56
|
+
if (email && myEmail)
|
|
57
|
+
return email !== myEmail;
|
|
58
|
+
if (name && myName)
|
|
59
|
+
return name !== myName;
|
|
60
|
+
return false;
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
//# sourceMappingURL=invite-prompt.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"invite-prompt.js","sourceRoot":"","sources":["../../src/lib/invite-prompt.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,MAAM,CAAC,MAAM,WAAW,GAAG,4BAA4B,CAAC;AAIxD;;;;;;;;;;GAUG;AACH,MAAM,UAAU,eAAe,CAAC,SAA4B,OAAO;IACjE,QAAQ,MAAM,EAAE,CAAC;QACf,KAAK,mBAAmB;YACtB,OAAO,6EAA6E,WAAW,EAAE,CAAC;QACpG,KAAK,uBAAuB;YAC1B,OAAO,oFAAoF,WAAW,EAAE,CAAC;QAC3G,KAAK,OAAO,CAAC;QACb;YACE,OAAO,iCAAiC,WAAW,EAAE,CAAC;IAC1D,CAAC;AACH,CAAC;AAYD;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,qBAAqB,CACnC,OAAqD,EACrD,EAAiB;IAEjB,MAAM,OAAO,GAAG,EAAE,CAAC,KAAK,EAAE,WAAW,EAAE,IAAI,IAAI,CAAC;IAChD,MAAM,MAAM,GAAG,EAAE,CAAC,IAAI,EAAE,WAAW,EAAE,IAAI,IAAI,CAAC;IAC9C,IAAI,CAAC,OAAO,IAAI,CAAC,MAAM;QAAE,OAAO,KAAK,CAAC;IAEtC,OAAO,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE;QACxB,IAAI,CAAC,CAAC;YAAE,OAAO,KAAK,CAAC;QACrB,MAAM,KAAK,GAAG,CAAC,CAAC,KAAK,EAAE,WAAW,EAAE,CAAC;QACrC,MAAM,IAAI,GAAG,CAAC,CAAC,IAAI,EAAE,WAAW,EAAE,CAAC;QACnC,IAAI,KAAK,IAAI,OAAO;YAAE,OAAO,KAAK,KAAK,OAAO,CAAC;QAC/C,IAAI,IAAI,IAAI,MAAM;YAAE,OAAO,IAAI,KAAK,MAAM,CAAC;QAC3C,OAAO,KAAK,CAAC;IACf,CAAC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The MCP server instructions Align's two servers SHARE.
|
|
3
|
+
*
|
|
4
|
+
* This file is committed in two repositories and is byte-identical in both:
|
|
5
|
+
* align-cli src/lib/mcp-instructions.shared.ts (the CLI's local server)
|
|
6
|
+
* align-stack connectors/mcp-align/src/mcpInstructions.shared.ts (the hosted server)
|
|
7
|
+
* A parity test on each side reads the OTHER side's copy from its origin/main and fails on any
|
|
8
|
+
* difference (ALI-952). Two texts for one contract had already drifted once: the local server
|
|
9
|
+
* never told an agent to search the graph before reading the code. EDIT BOTH COPIES IN THE
|
|
10
|
+
* SAME SITTING - a change to one repo fails that repo's parity test until the other merges.
|
|
11
|
+
*
|
|
12
|
+
* Tool names are TOKENS, because the two servers name the same tool differently
|
|
13
|
+
* (`check_alignment` hosted, `align_check_alignment` local). Each server renders the tokens
|
|
14
|
+
* through its own table; a token the table cannot name throws at render, so a line about a
|
|
15
|
+
* tool only one server has cannot live here. Those lines go in the PER-SERVER section each
|
|
16
|
+
* server appends via renderMcpInstructions.
|
|
17
|
+
*
|
|
18
|
+
* Budget: Claude Code truncates server instructions around 2,048 characters. Each server pins
|
|
19
|
+
* its own RENDERED text (shared + per-server lines, plus the local server's graph-identity
|
|
20
|
+
* suffix) under that limit. CUT BEFORE YOU ADD, and re-derive the length rather than trusting
|
|
21
|
+
* a number written here.
|
|
22
|
+
*
|
|
23
|
+
* This is a .ts module rather than a .md file so the published CLI (which ships dist/ only)
|
|
24
|
+
* has the text at runtime without a copy step, and so both repos lint and typecheck it.
|
|
25
|
+
*/
|
|
26
|
+
export declare const SHARED_MCP_TOOL_KEYS: readonly ["check_alignment", "search"];
|
|
27
|
+
export type SharedMcpToolKey = (typeof SHARED_MCP_TOOL_KEYS)[number];
|
|
28
|
+
/**
|
|
29
|
+
* Lines about the tools BOTH servers expose. No backtick anywhere in the prose: this is a
|
|
30
|
+
* template literal, and a stray one ends it silently (align-stack mcpServer.test.ts).
|
|
31
|
+
*/
|
|
32
|
+
export declare const MCP_INSTRUCTIONS_SHARED = "Align is this team's decision graph - what was decided, why, and by whom. Use these tools proactively, without being asked:\n\n- BEFORE writing or changing non-trivial code, call {check_alignment} with the diff, phrased as the DECISION and its value (\"set the worker pool to 12\"), never the chore (\"wire up a worker\"). A \"conflict\" result, or a matched decision whose OWN status is conflicted, means a past decision opposes the change - STOP and confirm with the user before proceeding.\n- An \"unknown\" status means the check could not run (the service was unavailable) - it is NOT a pass. Surface it to the user and do not proceed as if aligned.\n- To answer \"why did we decide X\" or to understand a convention, call {search}. A decision's status (active/conflicted) and who decided it are in the graph.\n- Do the same for questions ABOUT BEHAVIOUR, which rarely name a decision: \"what happens when X fails\", \"does it fail open\", \"how does Y work\".\n- Cite a decision by its cite value when present; link via decision_url if present, else source_url if present, else say no link - never present one as the other.\n- When the question was only a question, REPORT what the graph returned, with its titles and source links, and do not re-derive it from the code. Read the code to confirm only when you are about to change behaviour.\n- Search the graph BEFORE reading the code: it spans repositories, so grepping this checkout misses decisions made in another repository.";
|
|
33
|
+
/**
|
|
34
|
+
* Render the shared text for one server: substitute each {token} with that server's name for
|
|
35
|
+
* the tool, then append the server's own lines (tools only it exposes), one per line.
|
|
36
|
+
* Throws on a token the table does not name rather than emitting a literal brace for the
|
|
37
|
+
* agent to puzzle over.
|
|
38
|
+
*/
|
|
39
|
+
export declare function renderMcpInstructions(toolNames: Record<SharedMcpToolKey, string>, perServerLines: readonly string[]): string;
|
|
40
|
+
//# sourceMappingURL=mcp-instructions.shared.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mcp-instructions.shared.d.ts","sourceRoot":"","sources":["../../src/lib/mcp-instructions.shared.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH,eAAO,MAAM,oBAAoB,wCAAyC,CAAC;AAC3E,MAAM,MAAM,gBAAgB,GAAG,CAAC,OAAO,oBAAoB,CAAC,CAAC,MAAM,CAAC,CAAC;AAErE;;;GAGG;AACH,eAAO,MAAM,uBAAuB,k9CAQsG,CAAC;AAE3I;;;;;GAKG;AACH,wBAAgB,qBAAqB,CACnC,SAAS,EAAE,MAAM,CAAC,gBAAgB,EAAE,MAAM,CAAC,EAC3C,cAAc,EAAE,SAAS,MAAM,EAAE,GAChC,MAAM,CAQR"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The MCP server instructions Align's two servers SHARE.
|
|
3
|
+
*
|
|
4
|
+
* This file is committed in two repositories and is byte-identical in both:
|
|
5
|
+
* align-cli src/lib/mcp-instructions.shared.ts (the CLI's local server)
|
|
6
|
+
* align-stack connectors/mcp-align/src/mcpInstructions.shared.ts (the hosted server)
|
|
7
|
+
* A parity test on each side reads the OTHER side's copy from its origin/main and fails on any
|
|
8
|
+
* difference (ALI-952). Two texts for one contract had already drifted once: the local server
|
|
9
|
+
* never told an agent to search the graph before reading the code. EDIT BOTH COPIES IN THE
|
|
10
|
+
* SAME SITTING - a change to one repo fails that repo's parity test until the other merges.
|
|
11
|
+
*
|
|
12
|
+
* Tool names are TOKENS, because the two servers name the same tool differently
|
|
13
|
+
* (`check_alignment` hosted, `align_check_alignment` local). Each server renders the tokens
|
|
14
|
+
* through its own table; a token the table cannot name throws at render, so a line about a
|
|
15
|
+
* tool only one server has cannot live here. Those lines go in the PER-SERVER section each
|
|
16
|
+
* server appends via renderMcpInstructions.
|
|
17
|
+
*
|
|
18
|
+
* Budget: Claude Code truncates server instructions around 2,048 characters. Each server pins
|
|
19
|
+
* its own RENDERED text (shared + per-server lines, plus the local server's graph-identity
|
|
20
|
+
* suffix) under that limit. CUT BEFORE YOU ADD, and re-derive the length rather than trusting
|
|
21
|
+
* a number written here.
|
|
22
|
+
*
|
|
23
|
+
* This is a .ts module rather than a .md file so the published CLI (which ships dist/ only)
|
|
24
|
+
* has the text at runtime without a copy step, and so both repos lint and typecheck it.
|
|
25
|
+
*/
|
|
26
|
+
export const SHARED_MCP_TOOL_KEYS = ['check_alignment', 'search'];
|
|
27
|
+
/**
|
|
28
|
+
* Lines about the tools BOTH servers expose. No backtick anywhere in the prose: this is a
|
|
29
|
+
* template literal, and a stray one ends it silently (align-stack mcpServer.test.ts).
|
|
30
|
+
*/
|
|
31
|
+
export const MCP_INSTRUCTIONS_SHARED = `Align is this team's decision graph - what was decided, why, and by whom. Use these tools proactively, without being asked:
|
|
32
|
+
|
|
33
|
+
- BEFORE writing or changing non-trivial code, call {check_alignment} with the diff, phrased as the DECISION and its value ("set the worker pool to 12"), never the chore ("wire up a worker"). A "conflict" result, or a matched decision whose OWN status is conflicted, means a past decision opposes the change - STOP and confirm with the user before proceeding.
|
|
34
|
+
- An "unknown" status means the check could not run (the service was unavailable) - it is NOT a pass. Surface it to the user and do not proceed as if aligned.
|
|
35
|
+
- To answer "why did we decide X" or to understand a convention, call {search}. A decision's status (active/conflicted) and who decided it are in the graph.
|
|
36
|
+
- Do the same for questions ABOUT BEHAVIOUR, which rarely name a decision: "what happens when X fails", "does it fail open", "how does Y work".
|
|
37
|
+
- Cite a decision by its cite value when present; link via decision_url if present, else source_url if present, else say no link - never present one as the other.
|
|
38
|
+
- When the question was only a question, REPORT what the graph returned, with its titles and source links, and do not re-derive it from the code. Read the code to confirm only when you are about to change behaviour.
|
|
39
|
+
- Search the graph BEFORE reading the code: it spans repositories, so grepping this checkout misses decisions made in another repository.`;
|
|
40
|
+
/**
|
|
41
|
+
* Render the shared text for one server: substitute each {token} with that server's name for
|
|
42
|
+
* the tool, then append the server's own lines (tools only it exposes), one per line.
|
|
43
|
+
* Throws on a token the table does not name rather than emitting a literal brace for the
|
|
44
|
+
* agent to puzzle over.
|
|
45
|
+
*/
|
|
46
|
+
export function renderMcpInstructions(toolNames, perServerLines) {
|
|
47
|
+
const names = toolNames;
|
|
48
|
+
const rendered = MCP_INSTRUCTIONS_SHARED.replace(/\{([a-z_]+)\}/g, (_match, key) => {
|
|
49
|
+
const name = names[key];
|
|
50
|
+
if (!name)
|
|
51
|
+
throw new Error(`MCP instructions name a tool this server has no name for: {${key}}`);
|
|
52
|
+
return name;
|
|
53
|
+
});
|
|
54
|
+
return perServerLines.length ? `${rendered}\n${perServerLines.join('\n')}` : rendered;
|
|
55
|
+
}
|
|
56
|
+
//# sourceMappingURL=mcp-instructions.shared.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mcp-instructions.shared.js","sourceRoot":"","sources":["../../src/lib/mcp-instructions.shared.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,iBAAiB,EAAE,QAAQ,CAAU,CAAC;AAG3E;;;GAGG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG;;;;;;;;0IAQmG,CAAC;AAE3I;;;;;GAKG;AACH,MAAM,UAAU,qBAAqB,CACnC,SAA2C,EAC3C,cAAiC;IAEjC,MAAM,KAAK,GAAG,SAA+C,CAAC;IAC9D,MAAM,QAAQ,GAAG,uBAAuB,CAAC,OAAO,CAAC,gBAAgB,EAAE,CAAC,MAAM,EAAE,GAAW,EAAE,EAAE;QACzF,MAAM,IAAI,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC;QACxB,IAAI,CAAC,IAAI;YAAE,MAAM,IAAI,KAAK,CAAC,8DAA8D,GAAG,GAAG,CAAC,CAAC;QACjG,OAAO,IAAI,CAAC;IACd,CAAC,CAAC,CAAC;IACH,OAAO,cAAc,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,QAAQ,KAAK,cAAc,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC;AACxF,CAAC"}
|
package/dist/lib/mcp-setup.d.ts
CHANGED
|
@@ -1,8 +1,15 @@
|
|
|
1
|
-
|
|
1
|
+
import { type UserHookTarget } from './user-hooks.js';
|
|
2
|
+
export type McpFormat = 'mcpServers' | 'vscode' | 'zed' | 'codex' | 'pi' | 'copilot';
|
|
2
3
|
export interface EditorTarget {
|
|
3
4
|
name: string;
|
|
4
5
|
configPath: string;
|
|
5
6
|
format: McpFormat;
|
|
7
|
+
/**
|
|
8
|
+
* The host's USER-level hook file, for the hosts that have one (ALI-952: Codex, Cursor,
|
|
9
|
+
* Copilot CLI). writeMcpConfig writes the advisory pre-edit hook there next to the MCP
|
|
10
|
+
* entry, and removeMcpConfig takes it out again. Absent on hosts with no hook API.
|
|
11
|
+
*/
|
|
12
|
+
hooks?: UserHookTarget;
|
|
6
13
|
}
|
|
7
14
|
export declare function alignServerEntry(format: McpFormat, env?: string): Record<string, unknown>;
|
|
8
15
|
export declare function detectEditors(): EditorTarget[];
|
|
@@ -22,5 +29,28 @@ export declare function detectEditors(): EditorTarget[];
|
|
|
22
29
|
* user was part-way through editing.
|
|
23
30
|
*/
|
|
24
31
|
export declare function removeMcpConfig(target: EditorTarget): boolean;
|
|
25
|
-
|
|
32
|
+
/**
|
|
33
|
+
* Wire one agent: its MCP entry, plus the user-level advisory hook on the hosts that have
|
|
34
|
+
* one (ALI-952). Returns every file it wrote, in order, for the caller to disclose - the
|
|
35
|
+
* hook file is the one a user would not expect to have been touched.
|
|
36
|
+
*/
|
|
37
|
+
export declare function writeMcpConfig(target: EditorTarget, env?: string): string[];
|
|
38
|
+
/**
|
|
39
|
+
* ALI-950: is Align already in this agent's config? The second-run card names the agents
|
|
40
|
+
* wired NOW, which is a different question from detectEditors' "installed": an agent whose
|
|
41
|
+
* write failed, or that `align mcp --remove` ran on, is installed and not connected, and
|
|
42
|
+
* telling someone to open it hands them an agent that cannot answer.
|
|
43
|
+
*
|
|
44
|
+
* Never throws - the card must never error - so an unparseable config reads as not wired.
|
|
45
|
+
* Mirrors removeMcpConfig's own lookup (JSON key per format, marker block for Codex).
|
|
46
|
+
*/
|
|
47
|
+
export declare function hasAlignEntry(target: EditorTarget): boolean;
|
|
48
|
+
export declare function detectWiredEditors(): EditorTarget[];
|
|
49
|
+
/**
|
|
50
|
+
* The agent wired through this repo's project config. `.mcp.json` is what
|
|
51
|
+
* setupAgentAlignment writes (agent-rules.ts); Claude Code reads it as a project config.
|
|
52
|
+
* (pi reads it too, via pi-mcp-adapter, but only when installed - naming an agent that may
|
|
53
|
+
* not exist on the machine is the same error as naming one that is not connected.)
|
|
54
|
+
*/
|
|
55
|
+
export declare function projectMcpAgents(cwd: string): string[];
|
|
26
56
|
//# sourceMappingURL=mcp-setup.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mcp-setup.d.ts","sourceRoot":"","sources":["../../src/lib/mcp-setup.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"mcp-setup.d.ts","sourceRoot":"","sources":["../../src/lib/mcp-setup.ts"],"names":[],"mappings":"AAGA,OAAO,EAAmB,KAAK,cAAc,EAAkB,MAAM,iBAAiB,CAAC;AAWvF,MAAM,MAAM,SAAS,GAAG,YAAY,GAAG,QAAQ,GAAG,KAAK,GAAG,OAAO,GAAG,IAAI,GAAG,SAAS,CAAC;AAErF,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,SAAS,CAAC;IAClB;;;;OAIG;IACH,KAAK,CAAC,EAAE,cAAc,CAAC;CACxB;AAUD,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,SAAS,EAAE,GAAG,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAoBzF;AAmBD,wBAAgB,aAAa,IAAI,YAAY,EAAE,CAiG9C;AA8ED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,YAAY,GAAG,OAAO,CAK7D;AAiCD;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,YAAY,EAAE,GAAG,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAS3E;AAED;;;;;;;;GAQG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,YAAY,GAAG,OAAO,CAc3D;AAED,wBAAgB,kBAAkB,IAAI,YAAY,EAAE,CAEnD;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,EAAE,CAQtD"}
|
package/dist/lib/mcp-setup.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { existsSync, mkdirSync, readFileSync, writeFileSync } from 'node:fs';
|
|
2
2
|
import path from 'node:path';
|
|
3
3
|
import os from 'node:os';
|
|
4
|
+
import { removeUserHooks, writeUserHooks } from './user-hooks.js';
|
|
4
5
|
function alignArgs(env) {
|
|
5
6
|
return env ? ['mcp', '--env', env] : ['mcp'];
|
|
6
7
|
}
|
|
@@ -21,6 +22,10 @@ export function alignServerEntry(format, env) {
|
|
|
21
22
|
// ALIGN_MCP_INSTRUCTIONS' "call align_check_alignment BEFORE writing code", so
|
|
22
23
|
// ask for the tools to be registered directly.
|
|
23
24
|
return { command: 'align', args, directTools: true };
|
|
25
|
+
case 'copilot':
|
|
26
|
+
// Copilot CLI requires `type` and a `tools` allowlist; without `tools` the server is
|
|
27
|
+
// configured and none of its tools are callable (GitHub's MCP configuration docs).
|
|
28
|
+
return { type: 'local', command: 'align', args, tools: ['*'] };
|
|
24
29
|
default:
|
|
25
30
|
return { command: 'align', args };
|
|
26
31
|
}
|
|
@@ -67,9 +72,14 @@ export function detectEditors() {
|
|
|
67
72
|
if (existsSync(path.join(home, '.claude.json'))) {
|
|
68
73
|
found.push({ name: 'Claude Code', configPath: path.join(home, '.claude.json'), format: 'mcpServers' });
|
|
69
74
|
}
|
|
70
|
-
// Cursor (~/.cursor/mcp.json)
|
|
75
|
+
// Cursor (~/.cursor/mcp.json). Hooks: ~/.cursor/hooks.json, Cursor 1.7+ (ALI-952).
|
|
71
76
|
if (existsSync(path.join(home, '.cursor'))) {
|
|
72
|
-
found.push({
|
|
77
|
+
found.push({
|
|
78
|
+
name: 'Cursor',
|
|
79
|
+
configPath: path.join(home, '.cursor', 'mcp.json'),
|
|
80
|
+
format: 'mcpServers',
|
|
81
|
+
hooks: { host: 'cursor', path: path.join(home, '.cursor', 'hooks.json') },
|
|
82
|
+
});
|
|
73
83
|
}
|
|
74
84
|
// Windsurf (~/.codeium/windsurf/mcp_config.json)
|
|
75
85
|
if (existsSync(path.join(home, '.codeium', 'windsurf'))) {
|
|
@@ -88,9 +98,24 @@ export function detectEditors() {
|
|
|
88
98
|
if (existsSync(path.join(home, '.config', 'zed'))) {
|
|
89
99
|
found.push({ name: 'Zed', configPath: path.join(home, '.config', 'zed', 'settings.json'), format: 'zed' });
|
|
90
100
|
}
|
|
91
|
-
// OpenAI Codex CLI (~/.codex/config.toml)
|
|
101
|
+
// OpenAI Codex CLI (~/.codex/config.toml). Hooks: ~/.codex/hooks.json (ALI-952).
|
|
92
102
|
if (existsSync(path.join(home, '.codex'))) {
|
|
93
|
-
found.push({
|
|
103
|
+
found.push({
|
|
104
|
+
name: 'Codex',
|
|
105
|
+
configPath: path.join(home, '.codex', 'config.toml'),
|
|
106
|
+
format: 'codex',
|
|
107
|
+
hooks: { host: 'codex', path: path.join(home, '.codex', 'hooks.json') },
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
// GitHub Copilot CLI (~/.copilot/mcp-config.json). Hooks: one file of ours under
|
|
111
|
+
// ~/.copilot/hooks/, which Copilot loads alongside any others there (ALI-952).
|
|
112
|
+
if (existsSync(path.join(home, '.copilot'))) {
|
|
113
|
+
found.push({
|
|
114
|
+
name: 'Copilot CLI',
|
|
115
|
+
configPath: path.join(home, '.copilot', 'mcp-config.json'),
|
|
116
|
+
format: 'copilot',
|
|
117
|
+
hooks: { host: 'copilot', path: path.join(home, '.copilot', 'hooks', 'align.json') },
|
|
118
|
+
});
|
|
94
119
|
}
|
|
95
120
|
// pi (pi.dev) - MCP comes from the `pi-mcp-adapter` package, which reads the Pi agent
|
|
96
121
|
// dir (~/.pi/agent by default, relocatable via $PI_CODING_AGENT_DIR). Write the Pi-owned
|
|
@@ -198,6 +223,12 @@ function writeJsonConfig(target, env) {
|
|
|
198
223
|
* user was part-way through editing.
|
|
199
224
|
*/
|
|
200
225
|
export function removeMcpConfig(target) {
|
|
226
|
+
// The hook file first, and unconditionally: it is a separate file, so an MCP config that
|
|
227
|
+
// was already hand-cleaned must not leave the hook behind (ALI-952).
|
|
228
|
+
const hookRemoved = target.hooks ? removeUserHooks(target.hooks) : false;
|
|
229
|
+
return removeMcpEntry(target) || hookRemoved;
|
|
230
|
+
}
|
|
231
|
+
function removeMcpEntry(target) {
|
|
201
232
|
if (!existsSync(target.configPath))
|
|
202
233
|
return false;
|
|
203
234
|
if (target.format === 'codex') {
|
|
@@ -230,11 +261,66 @@ export function removeMcpConfig(target) {
|
|
|
230
261
|
writeFileSync(target.configPath, JSON.stringify(existing, null, 2), 'utf8');
|
|
231
262
|
return true;
|
|
232
263
|
}
|
|
264
|
+
/**
|
|
265
|
+
* Wire one agent: its MCP entry, plus the user-level advisory hook on the hosts that have
|
|
266
|
+
* one (ALI-952). Returns every file it wrote, in order, for the caller to disclose - the
|
|
267
|
+
* hook file is the one a user would not expect to have been touched.
|
|
268
|
+
*/
|
|
233
269
|
export function writeMcpConfig(target, env) {
|
|
234
270
|
if (target.format === 'codex') {
|
|
235
271
|
writeCodexConfig(target.configPath, env);
|
|
236
|
-
return;
|
|
237
272
|
}
|
|
238
|
-
|
|
273
|
+
else {
|
|
274
|
+
writeJsonConfig(target, env);
|
|
275
|
+
}
|
|
276
|
+
if (!target.hooks)
|
|
277
|
+
return [target.configPath];
|
|
278
|
+
writeUserHooks(target.hooks, env);
|
|
279
|
+
return [target.configPath, target.hooks.path];
|
|
280
|
+
}
|
|
281
|
+
/**
|
|
282
|
+
* ALI-950: is Align already in this agent's config? The second-run card names the agents
|
|
283
|
+
* wired NOW, which is a different question from detectEditors' "installed": an agent whose
|
|
284
|
+
* write failed, or that `align mcp --remove` ran on, is installed and not connected, and
|
|
285
|
+
* telling someone to open it hands them an agent that cannot answer.
|
|
286
|
+
*
|
|
287
|
+
* Never throws - the card must never error - so an unparseable config reads as not wired.
|
|
288
|
+
* Mirrors removeMcpConfig's own lookup (JSON key per format, marker block for Codex).
|
|
289
|
+
*/
|
|
290
|
+
export function hasAlignEntry(target) {
|
|
291
|
+
try {
|
|
292
|
+
const raw = readConfig(target.configPath, target.format);
|
|
293
|
+
if (!raw.trim())
|
|
294
|
+
return false;
|
|
295
|
+
if (target.format === 'codex') {
|
|
296
|
+
const start = raw.indexOf(CODEX_BLOCK_START);
|
|
297
|
+
const end = raw.indexOf(CODEX_BLOCK_END);
|
|
298
|
+
return start !== -1 && end !== -1 && end > start;
|
|
299
|
+
}
|
|
300
|
+
const servers = JSON.parse(raw)[jsonTopKey(target.format)];
|
|
301
|
+
return typeof servers === 'object' && servers !== null && 'align' in servers;
|
|
302
|
+
}
|
|
303
|
+
catch {
|
|
304
|
+
return false;
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
export function detectWiredEditors() {
|
|
308
|
+
return detectEditors().filter(hasAlignEntry);
|
|
309
|
+
}
|
|
310
|
+
/**
|
|
311
|
+
* The agent wired through this repo's project config. `.mcp.json` is what
|
|
312
|
+
* setupAgentAlignment writes (agent-rules.ts); Claude Code reads it as a project config.
|
|
313
|
+
* (pi reads it too, via pi-mcp-adapter, but only when installed - naming an agent that may
|
|
314
|
+
* not exist on the machine is the same error as naming one that is not connected.)
|
|
315
|
+
*/
|
|
316
|
+
export function projectMcpAgents(cwd) {
|
|
317
|
+
try {
|
|
318
|
+
const raw = readFileSync(path.join(cwd, '.mcp.json'), 'utf8');
|
|
319
|
+
const servers = JSON.parse(raw)['mcpServers'];
|
|
320
|
+
return typeof servers === 'object' && servers !== null && 'align' in servers ? ['Claude Code'] : [];
|
|
321
|
+
}
|
|
322
|
+
catch {
|
|
323
|
+
return [];
|
|
324
|
+
}
|
|
239
325
|
}
|
|
240
326
|
//# sourceMappingURL=mcp-setup.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mcp-setup.js","sourceRoot":"","sources":["../../src/lib/mcp-setup.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAC7E,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,MAAM,SAAS,CAAC;AAkBzB,SAAS,SAAS,CAAC,GAAY;IAC7B,OAAO,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,EAAE,OAAO,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;AAC/C,CAAC;AAED,8EAA8E;AAC9E,gFAAgF;AAChF,kFAAkF;AAClF,sDAAsD;AACtD,MAAM,UAAU,gBAAgB,CAAC,MAAiB,EAAE,GAAY;IAC9D,MAAM,IAAI,GAAG,SAAS,CAAC,GAAG,CAAC,CAAC;IAC5B,QAAQ,MAAM,EAAE,CAAC;QACf,KAAK,QAAQ;YACX,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;QACnD,KAAK,KAAK;YACR,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;QACtD,KAAK,IAAI;YACP,gFAAgF;YAChF,+EAA+E;YAC/E,+EAA+E;YAC/E,+CAA+C;YAC/C,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,IAAI,EAAE,CAAC;QACvD;YACE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;IACtC,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