@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
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import type { EnvName } from './config.js';
|
|
2
|
+
/**
|
|
3
|
+
* ALI-950: after the wizard, the next step is in the agent.
|
|
4
|
+
*
|
|
5
|
+
* Every one of Claude Code, Codex, Cursor, Gemini CLI and Copilot CLI makes first value a
|
|
6
|
+
* chat turn in the agent, never a setup verb. Both outros used to end on `align ask ...`
|
|
7
|
+
* and the second-run card suggested three CLI verbs and `align --help` - every next step
|
|
8
|
+
* something to type at the prompt, when the product's whole value is a question asked in
|
|
9
|
+
* the agent that already has the graph wired. So the outro and the card name the agent and
|
|
10
|
+
* the question, and name no CLI verb.
|
|
11
|
+
*
|
|
12
|
+
* Pure string builders, no I/O and no chalk, so the wording is unit-testable and there is
|
|
13
|
+
* ONE writer of it for both surfaces (the outro in setup.ts, the card in default-action.ts).
|
|
14
|
+
*/
|
|
15
|
+
export interface WiredAgents {
|
|
16
|
+
/** Agents wired through this repo's project config (.mcp.json). */
|
|
17
|
+
project: string[];
|
|
18
|
+
/** Agents wired through their global config, in detection order. */
|
|
19
|
+
global: string[];
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* The agent detected in this repo's project config leads: it is the one the user is most
|
|
23
|
+
* likely sitting in, since the wizard ran from this repo. Then the rest, deduplicated - Claude
|
|
24
|
+
* Code reads both its global ~/.claude.json and the project .mcp.json, and is one agent.
|
|
25
|
+
*/
|
|
26
|
+
export declare function orderAgents(w: WiredAgents): string[];
|
|
27
|
+
/**
|
|
28
|
+
* Which agents setupAgentAlignment's write reached, from the file list it returns. Only
|
|
29
|
+
* `.mcp.json` wires an agent's MCP client (the rest are hooks and nudges); Claude Code is the
|
|
30
|
+
* agent that reads it as a project config. pi reads it too, through pi-mcp-adapter, but only
|
|
31
|
+
* when installed, and the outro must not name an agent that may not exist on the machine.
|
|
32
|
+
*/
|
|
33
|
+
export declare function projectAgentsFromWritten(written: string[]): string[];
|
|
34
|
+
/** Prints only when something was actually wired: a connection claim with nothing behind it is worse than silence. */
|
|
35
|
+
export declare function agentConnectedLine(agents: string[]): string | undefined;
|
|
36
|
+
/**
|
|
37
|
+
* The question to hand the agent. Against a REAL decision the wizard found when there is one,
|
|
38
|
+
* because "why did we X" is checkable against the repo the user is sitting in. The fallback
|
|
39
|
+
* is ABOUT the graph rather than in it, which is a bad thing to type into `align ask` (ALI-771:
|
|
40
|
+
* on-device search matches nothing) and a fine thing to ask an agent, which answers it with a
|
|
41
|
+
* list tool rather than a similarity search.
|
|
42
|
+
*/
|
|
43
|
+
export declare function firstQuestion(firstTitle: string | undefined): string;
|
|
44
|
+
/**
|
|
45
|
+
* The one next action, and it happens in the agent. `inRepo` is the outro (the wizard just
|
|
46
|
+
* ran here, and the project config only applies here); the card drops it.
|
|
47
|
+
*
|
|
48
|
+
* With no agent detected the line says so and names `align mcp` ONCE - the only CLI verb it
|
|
49
|
+
* may carry, and the ask is still what follows it.
|
|
50
|
+
*/
|
|
51
|
+
export declare function agentAskLine(opts: {
|
|
52
|
+
agents: string[];
|
|
53
|
+
firstTitle: string | undefined;
|
|
54
|
+
inRepo: boolean;
|
|
55
|
+
envName: EnvName;
|
|
56
|
+
}): string;
|
|
57
|
+
/**
|
|
58
|
+
* The ALI-215 readout's numbers the card shows. `mode` decides the label: cloud reads a
|
|
59
|
+
* windowed impact and reuse rate off the gateway (the caller says how many days), local has
|
|
60
|
+
* no window at all - its link counts are all-time - and nothing writes a conflict link
|
|
61
|
+
* offline, so a zero there is hidden rather than printed as a broken counter (ALI-503, the
|
|
62
|
+
* same rule renderValueReadout applies).
|
|
63
|
+
*
|
|
64
|
+
* The ticket asked for "N conflicts caught, M answers served". The readout has no
|
|
65
|
+
* answers-served counter, so this prints the numbers it DOES have and labels them as what
|
|
66
|
+
* they are, rather than inventing one.
|
|
67
|
+
*/
|
|
68
|
+
export interface CardValue {
|
|
69
|
+
mode: 'cloud' | 'local';
|
|
70
|
+
decisions: number;
|
|
71
|
+
conflictsCaught: number;
|
|
72
|
+
reuseRate: number | null;
|
|
73
|
+
}
|
|
74
|
+
export interface SecondRunCard {
|
|
75
|
+
/** Already composed by the caller: `Local graph <path>` or `Signed in <env>`. */
|
|
76
|
+
graphLine: string;
|
|
77
|
+
/** Wired agents, already ordered (orderAgents). */
|
|
78
|
+
agents: string[];
|
|
79
|
+
hasDecisions: boolean;
|
|
80
|
+
firstTitle: string | undefined;
|
|
81
|
+
envName: EnvName;
|
|
82
|
+
/** Absent when the readout could not be read: the line is left out, never zeros. */
|
|
83
|
+
value: CardValue | undefined;
|
|
84
|
+
}
|
|
85
|
+
export declare function cardLabel(label: string): string;
|
|
86
|
+
/**
|
|
87
|
+
* The card bare `align` prints once set up. Graph, agents by name, the readout, and exactly
|
|
88
|
+
* ONE next action. No CLI verb, with one exception: an empty graph's action is
|
|
89
|
+
* `align connect`, because nothing in the agent can fill a graph yet.
|
|
90
|
+
*/
|
|
91
|
+
export declare function renderSecondRunCard(card: SecondRunCard): string;
|
|
92
|
+
//# sourceMappingURL=next-step.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"next-step.d.ts","sourceRoot":"","sources":["../../src/lib/next-step.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAE3C;;;;;;;;;;;;GAYG;AAEH,MAAM,WAAW,WAAW;IAC1B,mEAAmE;IACnE,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,oEAAoE;IACpE,MAAM,EAAE,MAAM,EAAE,CAAC;CAClB;AAED;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,CAAC,EAAE,WAAW,GAAG,MAAM,EAAE,CASpD;AAED;;;;;GAKG;AACH,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,CAEpE;AAED,sHAAsH;AACtH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,GAAG,SAAS,CAGvE;AAED;;;;;;GAMG;AACH,wBAAgB,aAAa,CAAC,UAAU,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,CAEpE;AAOD;;;;;;GAMG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE;IACjC,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,UAAU,EAAE,MAAM,GAAG,SAAS,CAAC;IAC/B,MAAM,EAAE,OAAO,CAAC;IAChB,OAAO,EAAE,OAAO,CAAC;CAClB,GAAG,MAAM,CAOT;AAED;;;;;;;;;;GAUG;AACH,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,OAAO,GAAG,OAAO,CAAC;IACxB,SAAS,EAAE,MAAM,CAAC;IAClB,eAAe,EAAE,MAAM,CAAC;IACxB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;CAC1B;AAED,MAAM,WAAW,aAAa;IAC5B,qFAAqF;IACrF,SAAS,EAAE,MAAM,CAAC;IAClB,mDAAmD;IACnD,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,YAAY,EAAE,OAAO,CAAC;IACtB,UAAU,EAAE,MAAM,GAAG,SAAS,CAAC;IAC/B,OAAO,EAAE,OAAO,CAAC;IACjB,oFAAoF;IACpF,KAAK,EAAE,SAAS,GAAG,SAAS,CAAC;CAC9B;AAID,wBAAgB,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAE/C;AAWD;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,aAAa,GAAG,MAAM,CAe/D"}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The agent detected in this repo's project config leads: it is the one the user is most
|
|
3
|
+
* likely sitting in, since the wizard ran from this repo. Then the rest, deduplicated - Claude
|
|
4
|
+
* Code reads both its global ~/.claude.json and the project .mcp.json, and is one agent.
|
|
5
|
+
*/
|
|
6
|
+
export function orderAgents(w) {
|
|
7
|
+
const seen = new Set();
|
|
8
|
+
const out = [];
|
|
9
|
+
for (const name of [...w.project, ...w.global]) {
|
|
10
|
+
if (seen.has(name))
|
|
11
|
+
continue;
|
|
12
|
+
seen.add(name);
|
|
13
|
+
out.push(name);
|
|
14
|
+
}
|
|
15
|
+
return out;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Which agents setupAgentAlignment's write reached, from the file list it returns. Only
|
|
19
|
+
* `.mcp.json` wires an agent's MCP client (the rest are hooks and nudges); Claude Code is the
|
|
20
|
+
* agent that reads it as a project config. pi reads it too, through pi-mcp-adapter, but only
|
|
21
|
+
* when installed, and the outro must not name an agent that may not exist on the machine.
|
|
22
|
+
*/
|
|
23
|
+
export function projectAgentsFromWritten(written) {
|
|
24
|
+
return written.includes('.mcp.json') ? ['Claude Code'] : [];
|
|
25
|
+
}
|
|
26
|
+
/** Prints only when something was actually wired: a connection claim with nothing behind it is worse than silence. */
|
|
27
|
+
export function agentConnectedLine(agents) {
|
|
28
|
+
if (agents.length === 0)
|
|
29
|
+
return undefined;
|
|
30
|
+
return `Your agent is connected: ${agents.join(', ')}.`;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* The question to hand the agent. Against a REAL decision the wizard found when there is one,
|
|
34
|
+
* because "why did we X" is checkable against the repo the user is sitting in. The fallback
|
|
35
|
+
* is ABOUT the graph rather than in it, which is a bad thing to type into `align ask` (ALI-771:
|
|
36
|
+
* on-device search matches nothing) and a fine thing to ask an agent, which answers it with a
|
|
37
|
+
* list tool rather than a similarity search.
|
|
38
|
+
*/
|
|
39
|
+
export function firstQuestion(firstTitle) {
|
|
40
|
+
return firstTitle ? `why did we ${firstTitle}?` : 'what decisions exist in this codebase?';
|
|
41
|
+
}
|
|
42
|
+
/** Runnable AS PRINTED: bare `align mcp --setup` wires the cloud default, which is not a local user's graph. */
|
|
43
|
+
function mcpSetupCommand(envName) {
|
|
44
|
+
return envName === 'prod' ? 'align mcp --setup' : `align mcp --setup --env ${envName}`;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* The one next action, and it happens in the agent. `inRepo` is the outro (the wizard just
|
|
48
|
+
* ran here, and the project config only applies here); the card drops it.
|
|
49
|
+
*
|
|
50
|
+
* With no agent detected the line says so and names `align mcp` ONCE - the only CLI verb it
|
|
51
|
+
* may carry, and the ask is still what follows it.
|
|
52
|
+
*/
|
|
53
|
+
export function agentAskLine(opts) {
|
|
54
|
+
const question = firstQuestion(opts.firstTitle);
|
|
55
|
+
const first = opts.agents[0];
|
|
56
|
+
if (!first) {
|
|
57
|
+
return `No agent detected. Run ${mcpSetupCommand(opts.envName)}, then ask it: ${question}`;
|
|
58
|
+
}
|
|
59
|
+
return `Open ${first}${opts.inRepo ? ' in this repo' : ''} and ask: ${question}`;
|
|
60
|
+
}
|
|
61
|
+
/** Labels are padded to one column so the card reads as a table. */
|
|
62
|
+
const LABEL_WIDTH = 13;
|
|
63
|
+
export function cardLabel(label) {
|
|
64
|
+
return label.padEnd(LABEL_WIDTH);
|
|
65
|
+
}
|
|
66
|
+
function valueLine(v) {
|
|
67
|
+
if (v.mode === 'cloud') {
|
|
68
|
+
const reuse = v.reuseRate === null ? 'n/a' : `${Math.round(v.reuseRate * 100)}%`;
|
|
69
|
+
return `${cardLabel('This week')}${v.conflictsCaught} conflicts caught, reuse rate ${reuse}`;
|
|
70
|
+
}
|
|
71
|
+
const conflicts = v.conflictsCaught > 0 ? `, ${v.conflictsCaught} conflicts caught` : '';
|
|
72
|
+
return `${cardLabel('So far')}${v.decisions} decisions in your graph${conflicts}`;
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* The card bare `align` prints once set up. Graph, agents by name, the readout, and exactly
|
|
76
|
+
* ONE next action. No CLI verb, with one exception: an empty graph's action is
|
|
77
|
+
* `align connect`, because nothing in the agent can fill a graph yet.
|
|
78
|
+
*/
|
|
79
|
+
export function renderSecondRunCard(card) {
|
|
80
|
+
const lines = [
|
|
81
|
+
` ${card.graphLine}`,
|
|
82
|
+
` ${cardLabel('Agents')}${card.agents.length ? card.agents.join(', ') : 'none detected'}`,
|
|
83
|
+
];
|
|
84
|
+
if (card.value)
|
|
85
|
+
lines.push(` ${valueLine(card.value)}`);
|
|
86
|
+
lines.push('');
|
|
87
|
+
if (!card.hasDecisions) {
|
|
88
|
+
// ALI-951: the one verb, and it is the picker - git needs no token and is the first row.
|
|
89
|
+
lines.push(' Your graph is empty. Fill it:');
|
|
90
|
+
lines.push(' align connect');
|
|
91
|
+
}
|
|
92
|
+
else {
|
|
93
|
+
lines.push(` ${agentAskLine({ agents: card.agents, firstTitle: card.firstTitle, inRepo: false, envName: card.envName })}`);
|
|
94
|
+
}
|
|
95
|
+
return lines.join('\n');
|
|
96
|
+
}
|
|
97
|
+
//# sourceMappingURL=next-step.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"next-step.js","sourceRoot":"","sources":["../../src/lib/next-step.ts"],"names":[],"mappings":"AAuBA;;;;GAIG;AACH,MAAM,UAAU,WAAW,CAAC,CAAc;IACxC,MAAM,IAAI,GAAG,IAAI,GAAG,EAAU,CAAC;IAC/B,MAAM,GAAG,GAAa,EAAE,CAAC;IACzB,KAAK,MAAM,IAAI,IAAI,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC;QAC/C,IAAI,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC;YAAE,SAAS;QAC7B,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QACf,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACjB,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,wBAAwB,CAAC,OAAiB;IACxD,OAAO,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,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,YAAY,CAAC,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE,UAAU,EAAE,IAAI,CAAC,UAAU,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,CAAC,EAAE,CAAC,CAAC;IAC9H,CAAC;IACD,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Whether an email's domain is a personal-account provider rather than a company's own
|
|
3
|
+
* domain. Malformed input (no `@`, an empty domain) answers false rather than throwing -
|
|
4
|
+
* this is a messaging hint, never a validator, so an unparseable address should not crash
|
|
5
|
+
* the command that is about to reject it for other reasons anyway.
|
|
6
|
+
*/
|
|
7
|
+
export declare function isPersonalEmailDomain(email: string): boolean;
|
|
8
|
+
//# sourceMappingURL=personal-email-domains.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"personal-email-domains.d.ts","sourceRoot":"","sources":["../../src/lib/personal-email-domains.ts"],"names":[],"mappings":"AA0BA;;;;;GAKG;AACH,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAK5D"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ALI-938: which email domains are individual accounts rather than a company's.
|
|
3
|
+
*
|
|
4
|
+
* `align invite` needs to know whether the CALLER's own tenant is a work-domain org
|
|
5
|
+
* (has room for a team) or a personal, single-person tenant (nothing to invite anyone
|
|
6
|
+
* into) - the same distinction align-stack's gateway makes at signup
|
|
7
|
+
* (`services/gateway/src/billing/provisioning.ts`, `PERSONAL_EMAIL_DOMAINS` /
|
|
8
|
+
* `isPersonalEmailDomain`). This is a client-side mirror of that list for UX purposes
|
|
9
|
+
* only - `align invite`'s messaging reads better when it can say so up front, but the
|
|
10
|
+
* gateway is the actual authority on tenant type (it is the one that decided at signup).
|
|
11
|
+
* Keep the two lists in sync by hand; there is no shared package between the two repos
|
|
12
|
+
* for a list this short.
|
|
13
|
+
*/
|
|
14
|
+
const PERSONAL_EMAIL_DOMAINS = new Set([
|
|
15
|
+
'gmail.com', 'googlemail.com',
|
|
16
|
+
'yahoo.com', 'yahoo.co.uk', 'yahoo.fr', 'yahoo.de', 'yahoo.es', 'yahoo.it',
|
|
17
|
+
'hotmail.com', 'hotmail.co.uk', 'hotmail.fr', 'hotmail.de', 'hotmail.es',
|
|
18
|
+
'outlook.com', 'live.com', 'msn.com',
|
|
19
|
+
'aol.com',
|
|
20
|
+
'icloud.com', 'me.com', 'mac.com',
|
|
21
|
+
'protonmail.com', 'protonmail.ch', 'proton.me',
|
|
22
|
+
'fastmail.com', 'fastmail.fm',
|
|
23
|
+
'hey.com',
|
|
24
|
+
'zoho.com',
|
|
25
|
+
]);
|
|
26
|
+
/**
|
|
27
|
+
* Whether an email's domain is a personal-account provider rather than a company's own
|
|
28
|
+
* domain. Malformed input (no `@`, an empty domain) answers false rather than throwing -
|
|
29
|
+
* this is a messaging hint, never a validator, so an unparseable address should not crash
|
|
30
|
+
* the command that is about to reject it for other reasons anyway.
|
|
31
|
+
*/
|
|
32
|
+
export function isPersonalEmailDomain(email) {
|
|
33
|
+
const at = email.lastIndexOf('@');
|
|
34
|
+
if (at === -1 || at === email.length - 1)
|
|
35
|
+
return false;
|
|
36
|
+
const domain = email.slice(at + 1).toLowerCase();
|
|
37
|
+
return PERSONAL_EMAIL_DOMAINS.has(domain);
|
|
38
|
+
}
|
|
39
|
+
//# sourceMappingURL=personal-email-domains.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"personal-email-domains.js","sourceRoot":"","sources":["../../src/lib/personal-email-domains.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,MAAM,sBAAsB,GAAG,IAAI,GAAG,CAAC;IACrC,WAAW,EAAE,gBAAgB;IAC7B,WAAW,EAAE,aAAa,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU;IAC1E,aAAa,EAAE,eAAe,EAAE,YAAY,EAAE,YAAY,EAAE,YAAY;IACxE,aAAa,EAAE,UAAU,EAAE,SAAS;IACpC,SAAS;IACT,YAAY,EAAE,QAAQ,EAAE,SAAS;IACjC,gBAAgB,EAAE,eAAe,EAAE,WAAW;IAC9C,cAAc,EAAE,aAAa;IAC7B,SAAS;IACT,UAAU;CACX,CAAC,CAAC;AAEH;;;;;GAKG;AACH,MAAM,UAAU,qBAAqB,CAAC,KAAa;IACjD,MAAM,EAAE,GAAG,KAAK,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC;IAClC,IAAI,EAAE,KAAK,CAAC,CAAC,IAAI,EAAE,KAAK,KAAK,CAAC,MAAM,GAAG,CAAC;QAAE,OAAO,KAAK,CAAC;IACvD,MAAM,MAAM,GAAG,KAAK,CAAC,KAAK,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC;IACjD,OAAO,sBAAsB,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;AAC5C,CAAC"}
|
|
@@ -9,6 +9,8 @@ export declare function runPersonalImport(items: PersonalImportItem[], client: R
|
|
|
9
9
|
quiet?: boolean;
|
|
10
10
|
deferEnrichment?: boolean;
|
|
11
11
|
local?: boolean;
|
|
12
|
+
/** ALI-951 (`align connect --json`): with quiet, print nothing at all - the caller owns stdout. */
|
|
13
|
+
silent?: boolean;
|
|
12
14
|
/** ALI-795: when present, emit the import_completed funnel stage after ingest.
|
|
13
15
|
* Carries the env because the consent decision needs it; source is the connector
|
|
14
16
|
* id ('git', 'jira'), which becomes the stage's provenance command. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"personal-import.d.ts","sourceRoot":"","sources":["../../src/lib/personal-import.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,eAAe,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAChF,OAAO,KAAK,EAAE,i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K,EAAE,kBAAkB,EAAE,EAC3B,MAAM,EAAE,UAAU,CAAC,OAAO,mBAAmB,CAAC,EAC9C,IAAI,EAAE;IACJ,KAAK,EAAE,MAAM,CAAC;IAAC,OAAO,CAAC,EAAE,OAAO,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,OAAO,CAAC;IAAC,eAAe,CAAC,EAAE,OAAO,CAAC;IAAC,KAAK,CAAC,EAAE,OAAO,CAAC;IAC9G,mGAAmG;IACnG,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB;;4EAEwE;IACxE,MAAM,CAAC,EAAE;QAAE,GAAG,EAAE,iBAAiB,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC;CACrD,GACA,OAAO,CAAC,MAAM,CAAC,CAoIjB;AAED,wFAAwF;AACxF,MAAM,WAAW,eAAe;IAC9B,MAAM,IAAI,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,iBAAiB;IAChC,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB;6DACyD;IACzD,SAAS,EAAE,MAAM,CAAC;CACnB;AAED;;;;;;;;;GASG;AACH,wBAAsB,oBAAoB,CAAC,CAAC,SAAS,eAAe,EAClE,KAAK,EAAE,CAAC,EAAE,EACV,QAAQ,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,OAAO,CAAC;IAAE,EAAE,EAAE,MAAM,CAAA;CAAE,CAAC,EAC9C,IAAI,EAAE;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE,GACtB,OAAO,CAAC,iBAAiB,CAAC,CAiC5B"}
|
|
@@ -70,7 +70,8 @@ export async function runWithConcurrency(tasks, concurrency) {
|
|
|
70
70
|
}
|
|
71
71
|
export async function runPersonalImport(items, client, opts) {
|
|
72
72
|
if (!items.length) {
|
|
73
|
-
|
|
73
|
+
if (!opts.silent)
|
|
74
|
+
p.log.warn(`No items found from ${opts.label}.`);
|
|
74
75
|
return 0;
|
|
75
76
|
}
|
|
76
77
|
// Quiet mode (concurrent setup imports): skip the preview table, the animated
|
|
@@ -152,6 +153,8 @@ export async function runPersonalImport(items, client, opts) {
|
|
|
152
153
|
// Quiet mode: one compact completion line; the shared footer is printed once
|
|
153
154
|
// by the caller after all concurrent imports finish.
|
|
154
155
|
if (opts.quiet) {
|
|
156
|
+
if (opts.silent)
|
|
157
|
+
return total;
|
|
155
158
|
const conn = relatedCount > 0 ? `, ${relatedCount} connection${relatedCount === 1 ? '' : 's'}` : '';
|
|
156
159
|
const failNote = failures.length
|
|
157
160
|
? chalk.yellow(` (${failures.length} batch${failures.length > 1 ? 'es' : ''} failed)`)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"personal-import.js","sourceRoot":"","sources":["../../src/lib/personal-import.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,GAAG,MAAM,KAAK,CAAC;AACtB,OAAO,KAAK,CAAC,MAAM,gBAAgB,CAAC;AACpC,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAGnD,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAIzD,MAAM,UAAU,GAAG,EAAE,CAAC;AACtB,MAAM,iBAAiB,GAAG,CAAC,CAAC;AAE5B,yEAAyE;AACzE,2EAA2E;AAC3E,0EAA0E;AAC1E,uEAAuE;AACvE,MAAM,yBAAyB,GAAG,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,0BAA0B,CAAC,CAAC,IAAI,CAAC,CAAC;AACvF,MAAM,mBAAmB,GAAG,CAAC,CAAC;AAC9B,MAAM,iBAAiB,GAAG,GAAG,CAAC;AAE9B,IAAI,aAAa,GAAG,CAAC,CAAC;AACtB,MAAM,aAAa,GAAsB,EAAE,CAAC;AAE5C,2EAA2E;AAC3E,6DAA6D;AAC7D,KAAK,UAAU,c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AAC,IAAI,CAAC,CAAC;YACrB,QAAQ,EAAE,CAAC;QACb,CAAC;aAAM,CAAC;YACN,OAAO,EAAE,CAAC;QACZ,CAAC;IACH,CAAC;IACD,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,SAAS,EAAE,CAAC,EAAE,CAAC;AAC7C,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { createConfigStore, EnvName } from './config.js';
|
|
2
|
+
import { type ValueRollup } from './value-rollup.js';
|
|
3
|
+
/**
|
|
4
|
+
* The ALI-215 "what your graph did for you" rollup for an environment, from wherever that
|
|
5
|
+
* environment keeps it: the local SQLite graph for local-embedded, the gateway otherwise.
|
|
6
|
+
* Moved out of status.ts (ALI-950) so the second-run card reads the SAME readout `align
|
|
7
|
+
* status` prints, rather than a second copy of the query that can drift from it.
|
|
8
|
+
*
|
|
9
|
+
* `days` is the window the gateway's impact and reuse-rate endpoints are read over; the
|
|
10
|
+
* local graph has no window (its link counts are all-time) and ignores it.
|
|
11
|
+
*/
|
|
12
|
+
export declare function readValueRollup(config: ReturnType<typeof createConfigStore>, envName: EnvName, opts?: {
|
|
13
|
+
days?: number;
|
|
14
|
+
}): Promise<{
|
|
15
|
+
mode: 'cloud' | 'local';
|
|
16
|
+
rollup: ValueRollup;
|
|
17
|
+
}>;
|
|
18
|
+
//# sourceMappingURL=read-value-rollup.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"read-value-rollup.d.ts","sourceRoot":"","sources":["../../src/lib/read-value-rollup.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAI9D,OAAO,EAAsC,KAAK,WAAW,EAA0B,MAAM,mBAAmB,CAAC;AAEjH;;;;;;;;GAQG;AACH,wBAAsB,eAAe,CACnC,MAAM,EAAE,UAAU,CAAC,OAAO,iBAAiB,CAAC,EAC5C,OAAO,EAAE,OAAO,EAChB,IAAI,GAAE;IAAE,IAAI,CAAC,EAAE,MAAM,CAAA;CAAO,GAC3B,OAAO,CAAC;IAAE,IAAI,EAAE,OAAO,GAAG,OAAO,CAAC;IAAC,MAAM,EAAE,WAAW,CAAA;CAAE,CAAC,CAiB3D"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { createGatewayClient } from './gateway-client.js';
|
|
2
|
+
import { createLocalDb } from './local-db.js';
|
|
3
|
+
import { getLocalDbPath } from './local-mode.js';
|
|
4
|
+
import { fetchValueRollup, localValueRollup } from './value-rollup.js';
|
|
5
|
+
/**
|
|
6
|
+
* The ALI-215 "what your graph did for you" rollup for an environment, from wherever that
|
|
7
|
+
* environment keeps it: the local SQLite graph for local-embedded, the gateway otherwise.
|
|
8
|
+
* Moved out of status.ts (ALI-950) so the second-run card reads the SAME readout `align
|
|
9
|
+
* status` prints, rather than a second copy of the query that can drift from it.
|
|
10
|
+
*
|
|
11
|
+
* `days` is the window the gateway's impact and reuse-rate endpoints are read over; the
|
|
12
|
+
* local graph has no window (its link counts are all-time) and ignores it.
|
|
13
|
+
*/
|
|
14
|
+
export async function readValueRollup(config, envName, opts = {}) {
|
|
15
|
+
const env = config.getEnvironment(envName);
|
|
16
|
+
if (env.mode === 'local-embedded') {
|
|
17
|
+
// Same readout `align local status` gives: the honest offline subset. Reuse rate and
|
|
18
|
+
// health need the cloud graph, and renderValueReadout's local mode says so.
|
|
19
|
+
const db = createLocalDb(env.localDbPath ?? getLocalDbPath());
|
|
20
|
+
try {
|
|
21
|
+
// ALI-796: a connector counts as connected once local mode holds a saved token for
|
|
22
|
+
// it - the same check `align local forget` uses to tell "removed" from "nothing saved".
|
|
23
|
+
const isConnected = (id) => config.getConnectorFields(envName, id) !== null;
|
|
24
|
+
return { mode: 'local', rollup: localValueRollup(db, isConnected) };
|
|
25
|
+
}
|
|
26
|
+
finally {
|
|
27
|
+
db.close();
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
const client = createGatewayClient(env);
|
|
31
|
+
return { mode: 'cloud', rollup: await fetchValueRollup(client, opts) };
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=read-value-rollup.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"read-value-rollup.js","sourceRoot":"","sources":["../../src/lib/read-value-rollup.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAC9C,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAA4C,MAAM,mBAAmB,CAAC;AAEjH;;;;;;;;GAQG;AACH,MAAM,CAAC,KAAK,UAAU,eAAe,CACnC,MAA4C,EAC5C,OAAgB,EAChB,OAA0B,EAAE;IAE5B,MAAM,GAAG,GAAG,MAAM,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC;IAC3C,IAAI,GAAG,CAAC,IAAI,KAAK,gBAAgB,EAAE,CAAC;QAClC,qFAAqF;QACrF,4EAA4E;QAC5E,MAAM,EAAE,GAAG,aAAa,CAAC,GAAG,CAAC,WAAW,IAAI,cAAc,EAAE,CAAC,CAAC;QAC9D,IAAI,CAAC;YACH,mFAAmF;YACnF,wFAAwF;YACxF,MAAM,WAAW,GAAG,CAAC,EAAU,EAAE,EAAE,CAAC,MAAM,CAAC,kBAAkB,CAAC,OAAO,EAAE,EAAE,CAAC,KAAK,IAAI,CAAC;YACpF,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,gBAAgB,CAAC,EAAE,EAAE,WAAW,CAAC,EAAE,CAAC;QACtE,CAAC;gBAAS,CAAC;YACT,EAAE,CAAC,KAAK,EAAE,CAAC;QACb,CAAC;IACH,CAAC;IACD,MAAM,MAAM,GAAG,mBAAmB,CAAC,GAAG,CAAC,CAAC;IACxC,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC,MAAsC,EAAE,IAAI,CAAC,EAAE,CAAC;AACzG,CAAC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ALI-835: the line a human reads at the end of `align import sessions`, and the counts the
|
|
3
|
+
* funnel reports.
|
|
4
|
+
*
|
|
5
|
+
* The line is the product moment; the ping is the measurement. They are built from ONE object
|
|
6
|
+
* here so the two can never disagree - a summary saying 41 beside a ping saying 40 would make
|
|
7
|
+
* both unusable, and nothing downstream could tell which was wrong.
|
|
8
|
+
*
|
|
9
|
+
* The demo beat this exists for (Madhuri, 2026-08-25): run the import on the prospect's own
|
|
10
|
+
* repo, read the line aloud, ask who in the room knew.
|
|
11
|
+
*/
|
|
12
|
+
export interface SessionImportCounts {
|
|
13
|
+
/** Session files read, across every detected agent. */
|
|
14
|
+
sessionsScanned: number;
|
|
15
|
+
/** Decision-shaped moments found, before review. */
|
|
16
|
+
candidatesFound: number;
|
|
17
|
+
/** How many of those a human confirmed into the graph this run. */
|
|
18
|
+
candidatesConfirmed: number;
|
|
19
|
+
/**
|
|
20
|
+
* How many of the confirmed claims already carry a human ratification.
|
|
21
|
+
*
|
|
22
|
+
* Structurally 0 at import: `align import sessions` writes claims, and ratifying is a
|
|
23
|
+
* separate human act (`align ratify`). It is reported anyway, because "0 have been ratified"
|
|
24
|
+
* is the sentence the demo turns on - the point is that nobody has stood behind any of them
|
|
25
|
+
* yet. The funnel's own decisions_ratified stage is emitted from `align ratify`, where the
|
|
26
|
+
* number actually moves, rather than from here where it could only ever be zero.
|
|
27
|
+
*/
|
|
28
|
+
ratified: number;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* The summary line.
|
|
32
|
+
*
|
|
33
|
+
* Renders honestly at zero rather than crashing or printing a line about nothing: "Found 0
|
|
34
|
+
* decisions in 3 sessions" is a different sentence from "Found 0 decisions across 0 sessions",
|
|
35
|
+
* and both are different from an exception. Singular and plural are handled for every count,
|
|
36
|
+
* because "1 sessions" in a demo is the kind of detail that costs more attention than it saves.
|
|
37
|
+
*/
|
|
38
|
+
export declare function renderImportSummary(counts: SessionImportCounts): string;
|
|
39
|
+
//# sourceMappingURL=import-summary.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"import-summary.d.ts","sourceRoot":"","sources":["../../../src/lib/sessions/import-summary.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,MAAM,WAAW,mBAAmB;IAClC,uDAAuD;IACvD,eAAe,EAAE,MAAM,CAAC;IACxB,oDAAoD;IACpD,eAAe,EAAE,MAAM,CAAC;IACxB,mEAAmE;IACnE,mBAAmB,EAAE,MAAM,CAAC;IAC5B;;;;;;;;OAQG;IACH,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED;;;;;;;GAOG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,mBAAmB,GAAG,MAAM,CAyBvE"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ALI-835: the line a human reads at the end of `align import sessions`, and the counts the
|
|
3
|
+
* funnel reports.
|
|
4
|
+
*
|
|
5
|
+
* The line is the product moment; the ping is the measurement. They are built from ONE object
|
|
6
|
+
* here so the two can never disagree - a summary saying 41 beside a ping saying 40 would make
|
|
7
|
+
* both unusable, and nothing downstream could tell which was wrong.
|
|
8
|
+
*
|
|
9
|
+
* The demo beat this exists for (Madhuri, 2026-08-25): run the import on the prospect's own
|
|
10
|
+
* repo, read the line aloud, ask who in the room knew.
|
|
11
|
+
*/
|
|
12
|
+
/**
|
|
13
|
+
* The summary line.
|
|
14
|
+
*
|
|
15
|
+
* Renders honestly at zero rather than crashing or printing a line about nothing: "Found 0
|
|
16
|
+
* decisions in 3 sessions" is a different sentence from "Found 0 decisions across 0 sessions",
|
|
17
|
+
* and both are different from an exception. Singular and plural are handled for every count,
|
|
18
|
+
* because "1 sessions" in a demo is the kind of detail that costs more attention than it saves.
|
|
19
|
+
*/
|
|
20
|
+
export function renderImportSummary(counts) {
|
|
21
|
+
const { sessionsScanned, candidatesFound, candidatesConfirmed, ratified } = counts;
|
|
22
|
+
const sessions = `${sessionsScanned} session${sessionsScanned === 1 ? '' : 's'}`;
|
|
23
|
+
if (candidatesFound === 0) {
|
|
24
|
+
// The ticket's own wording for the empty case. A run that found nothing is a real result,
|
|
25
|
+
// not a failure, and it must not read like one.
|
|
26
|
+
return `Found 0 decisions in ${sessions}.`;
|
|
27
|
+
}
|
|
28
|
+
const decisions = `${candidatesFound} decision${candidatesFound === 1 ? '' : 's'}`;
|
|
29
|
+
const parts = [`Found ${decisions} across ${sessions}.`];
|
|
30
|
+
// Every candidate here came from an agent's own session, so "made by an agent" is the whole
|
|
31
|
+
// found set by construction rather than a second measurement. Stated as its own sentence
|
|
32
|
+
// because it is the one a prospect reacts to.
|
|
33
|
+
parts.push(`${candidatesFound} ${candidatesFound === 1 ? 'was' : 'were'} made by an agent.`);
|
|
34
|
+
parts.push(`${ratified} ${ratified === 1 ? 'has' : 'have'} been ratified.`);
|
|
35
|
+
if (candidatesConfirmed !== candidatesFound) {
|
|
36
|
+
// Only when it differs, so the common "reviewed them all" run keeps a short line.
|
|
37
|
+
parts.push(`${candidatesConfirmed} confirmed this run.`);
|
|
38
|
+
}
|
|
39
|
+
return parts.join(' ');
|
|
40
|
+
}
|
|
41
|
+
//# sourceMappingURL=import-summary.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"import-summary.js","sourceRoot":"","sources":["../../../src/lib/sessions/import-summary.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAqBH;;;;;;;GAOG;AACH,MAAM,UAAU,mBAAmB,CAAC,MAA2B;IAC7D,MAAM,EAAE,eAAe,EAAE,eAAe,EAAE,mBAAmB,EAAE,QAAQ,EAAE,GAAG,MAAM,CAAC;IACnF,MAAM,QAAQ,GAAG,GAAG,eAAe,WAAW,eAAe,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC;IAEjF,IAAI,eAAe,KAAK,CAAC,EAAE,CAAC;QAC1B,0FAA0F;QAC1F,gDAAgD;QAChD,OAAO,wBAAwB,QAAQ,GAAG,CAAC;IAC7C,CAAC;IAED,MAAM,SAAS,GAAG,GAAG,eAAe,YAAY,eAAe,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC;IACnF,MAAM,KAAK,GAAG,CAAC,SAAS,SAAS,WAAW,QAAQ,GAAG,CAAC,CAAC;IAEzD,4FAA4F;IAC5F,yFAAyF;IACzF,8CAA8C;IAC9C,KAAK,CAAC,IAAI,CAAC,GAAG,eAAe,IAAI,eAAe,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,oBAAoB,CAAC,CAAC;IAC7F,KAAK,CAAC,IAAI,CAAC,GAAG,QAAQ,IAAI,QAAQ,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,iBAAiB,CAAC,CAAC;IAE5E,IAAI,mBAAmB,KAAK,eAAe,EAAE,CAAC;QAC5C,kFAAkF;QAClF,KAAK,CAAC,IAAI,CAAC,GAAG,mBAAmB,sBAAsB,CAAC,CAAC;IAC3D,CAAC;IAED,OAAO,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AACzB,CAAC"}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
/** The four kinds Claude Code records, verbatim from the documentation. */
|
|
2
|
+
export declare const MEMORY_TYPES: readonly ["user", "feedback", "project", "reference"];
|
|
3
|
+
export type MemoryType = (typeof MEMORY_TYPES)[number];
|
|
4
|
+
/**
|
|
5
|
+
* The two kinds that are decision-shaped.
|
|
6
|
+
*
|
|
7
|
+
* `project` is "ongoing work, deadlines, and decisions that Claude can't derive from the code
|
|
8
|
+
* or git history" and `feedback` is "corrections you give Claude and approaches you confirm" -
|
|
9
|
+
* both are things somebody decided. `user` is a person's role and working preferences, and
|
|
10
|
+
* `reference` is where to find a dashboard. Neither is a decision, and importing them would
|
|
11
|
+
* put personal notes into a decision graph.
|
|
12
|
+
*/
|
|
13
|
+
export declare const DECISION_MEMORY_TYPES: readonly MemoryType[];
|
|
14
|
+
/** The index file, never a memory in its own right. */
|
|
15
|
+
export declare const MEMORY_INDEX_FILENAME = "MEMORY.md";
|
|
16
|
+
export interface MemoryFile {
|
|
17
|
+
filePath: string;
|
|
18
|
+
/** Null when the file carries no frontmatter, or carries frontmatter with no `type`, or a
|
|
19
|
+
* `type` outside the four documented values. All three are "cannot classify", which is a
|
|
20
|
+
* different fact from "classified as something we skip" - see extractMemoryDecisions. */
|
|
21
|
+
type: MemoryType | null;
|
|
22
|
+
/** ISO-8601 from the `modified` field, or null when absent (the field only appears on files
|
|
23
|
+
* Claude has written since v2.1.214, and never on a file that has no frontmatter). */
|
|
24
|
+
modified: string | null;
|
|
25
|
+
/** Every other scalar frontmatter key, unparsed. Nothing depends on these; they exist so a
|
|
26
|
+
* later ticket can confirm `description`/`originSessionId` from real data without a reparse. */
|
|
27
|
+
extra: Record<string, string>;
|
|
28
|
+
/** The markdown below the frontmatter, trimmed. */
|
|
29
|
+
body: string;
|
|
30
|
+
}
|
|
31
|
+
export interface MemoryDecisionCandidate {
|
|
32
|
+
filePath: string;
|
|
33
|
+
type: MemoryType;
|
|
34
|
+
/** The file's first markdown heading, else its filename stem with separators as spaces. */
|
|
35
|
+
title: string;
|
|
36
|
+
body: string;
|
|
37
|
+
/** ISO-8601 or null, from `modified`. */
|
|
38
|
+
timestamp: string | null;
|
|
39
|
+
/** The memory directory this file came from, used to build a stable source_url. */
|
|
40
|
+
memoryDir: string;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Where this project's memory directory is, if anywhere.
|
|
44
|
+
*
|
|
45
|
+
* Resolution order, and the reason for it:
|
|
46
|
+
*
|
|
47
|
+
* 1. `autoMemoryDirectory` from `~/.claude/settings.json`. Reading it matters because the
|
|
48
|
+
* failure direction without it is silent: a user who relocated the directory would get an
|
|
49
|
+
* empty list, which is indistinguishable from "no memories yet".
|
|
50
|
+
* 2. Otherwise, the `memory/` sibling of this project's Claude Code session files. The docs
|
|
51
|
+
* say `<project>` is derived from the git repository, and the exact slug encoding is not
|
|
52
|
+
* documented - so rather than guess at it, this reuses the cwd matching ALI-808 already
|
|
53
|
+
* proved (each session file records its own `cwd`) and takes the directory those files
|
|
54
|
+
* sit in. That is correct for worktrees and subdirectories for free, because they share
|
|
55
|
+
* one project directory.
|
|
56
|
+
*
|
|
57
|
+
* Returns [] when the agent has never run here, which is the normal case and not an error.
|
|
58
|
+
*/
|
|
59
|
+
export declare function locateMemoryDirs(cwd: string): string[];
|
|
60
|
+
/** Memory topic files for this project, newest first. `MEMORY.md` is excluded: it is an index
|
|
61
|
+
* of the others, so importing it would duplicate every memory as one more candidate. */
|
|
62
|
+
export declare function locateMemoryFiles(cwd: string): string[];
|
|
63
|
+
/**
|
|
64
|
+
* Parses one memory file.
|
|
65
|
+
*
|
|
66
|
+
* The frontmatter reader deliberately handles only `key: value` scalars on one line, which is
|
|
67
|
+
* every field the documentation describes. Anything else - a nested map, a list, a block
|
|
68
|
+
* scalar - is left in `extra` as its raw text if it is a simple scalar and otherwise ignored,
|
|
69
|
+
* rather than half-understood. js-yaml is a devDependency here, not a runtime one, so pulling
|
|
70
|
+
* a YAML parser into shipped CLI code would be a new dependency for two scalar fields.
|
|
71
|
+
*
|
|
72
|
+
* Returns null only for an unreadable file.
|
|
73
|
+
*/
|
|
74
|
+
export declare function parseMemoryFile(filePath: string): MemoryFile | null;
|
|
75
|
+
/**
|
|
76
|
+
* The decision-shaped memories among these files.
|
|
77
|
+
*
|
|
78
|
+
* Three separate reasons a file is dropped, all deliberate:
|
|
79
|
+
* - `type` is `user` or `reference`: classified, and not a decision.
|
|
80
|
+
* - `type` is absent or unrecognised: NOT classified. Importing it would be a guess about
|
|
81
|
+
* personal notes, so it is skipped rather than defaulted into a decision.
|
|
82
|
+
* - the body is empty: nothing to review.
|
|
83
|
+
*/
|
|
84
|
+
export declare function extractMemoryDecisions(filePaths: string[]): MemoryDecisionCandidate[];
|
|
85
|
+
//# sourceMappingURL=memory-files.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"memory-files.d.ts","sourceRoot":"","sources":["../../../src/lib/sessions/memory-files.ts"],"names":[],"mappings":"AA4CA,2EAA2E;AAC3E,eAAO,MAAM,YAAY,uDAAwD,CAAC;AAClF,MAAM,MAAM,UAAU,GAAG,CAAC,OAAO,YAAY,CAAC,CAAC,MAAM,CAAC,CAAC;AAEvD;;;;;;;;GAQG;AACH,eAAO,MAAM,qBAAqB,EAAE,SAAS,UAAU,EAA4B,CAAC;AAEpF,uDAAuD;AACvD,eAAO,MAAM,qBAAqB,cAAc,CAAC;AAEjD,MAAM,WAAW,UAAU;IACzB,QAAQ,EAAE,MAAM,CAAC;IACjB;;8FAE0F;IAC1F,IAAI,EAAE,UAAU,GAAG,IAAI,CAAC;IACxB;2FACuF;IACvF,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB;qGACiG;IACjG,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC9B,mDAAmD;IACnD,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,uBAAuB;IACtC,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,UAAU,CAAC;IACjB,2FAA2F;IAC3F,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,yCAAyC;IACzC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,mFAAmF;IACnF,SAAS,EAAE,MAAM,CAAC;CACnB;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,EAAE,CAQtD;AAED;yFAC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