@aligndottech/cli 0.63.0 → 0.64.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/dist/cli.d.ts +2 -2
- package/dist/cli.js +6 -6
- package/dist/cli.js.map +1 -1
- package/dist/commands/adjudicate.d.ts +3 -3
- package/dist/commands/capture.js +2 -2
- package/dist/commands/capture.js.map +1 -1
- package/dist/commands/check.d.ts +1 -1
- package/dist/commands/check.js +30 -30
- package/dist/commands/check.js.map +1 -1
- package/dist/commands/connect-agents.d.ts +4 -2
- package/dist/commands/connect-agents.d.ts.map +1 -1
- package/dist/commands/connect-agents.js +7 -7
- package/dist/commands/connect-agents.js.map +1 -1
- package/dist/commands/connect.d.ts +1 -1
- package/dist/commands/connector/index.js +1 -1
- package/dist/commands/connector/index.js.map +1 -1
- package/dist/commands/context.d.ts +4 -4
- package/dist/commands/context.js +7 -7
- package/dist/commands/context.js.map +1 -1
- package/dist/commands/decisions/index.js +4 -4
- package/dist/commands/decisions/index.js.map +1 -1
- package/dist/commands/default-action.d.ts.map +1 -1
- package/dist/commands/default-action.js +8 -5
- package/dist/commands/default-action.js.map +1 -1
- package/dist/commands/glossary.d.ts +1 -1
- package/dist/commands/import/confluence.js +1 -1
- package/dist/commands/import/confluence.js.map +1 -1
- package/dist/commands/import/git.js +4 -4
- package/dist/commands/import/git.js.map +1 -1
- package/dist/commands/import/jira.js +1 -1
- package/dist/commands/import/jira.js.map +1 -1
- package/dist/commands/import/sessions.d.ts +6 -6
- package/dist/commands/import/sessions.js +10 -10
- package/dist/commands/import/sessions.js.map +1 -1
- package/dist/commands/import.d.ts +2 -2
- package/dist/commands/import.js +2 -2
- package/dist/commands/invite.d.ts +1 -1
- package/dist/commands/invite.js +1 -1
- package/dist/commands/invite.js.map +1 -1
- package/dist/commands/local.js +3 -3
- package/dist/commands/local.js.map +1 -1
- package/dist/commands/mcp.d.ts +4 -4
- package/dist/commands/mcp.d.ts.map +1 -1
- package/dist/commands/mcp.js +34 -35
- package/dist/commands/mcp.js.map +1 -1
- package/dist/commands/ratify.d.ts +1 -1
- package/dist/commands/ratify.js +1 -1
- package/dist/commands/ratify.js.map +1 -1
- package/dist/commands/registry.d.ts +2 -2
- package/dist/commands/registry.js +3 -3
- package/dist/commands/registry.js.map +1 -1
- package/dist/commands/search.js +2 -2
- package/dist/commands/search.js.map +1 -1
- package/dist/commands/setup.d.ts +14 -10
- package/dist/commands/setup.d.ts.map +1 -1
- package/dist/commands/setup.js +133 -75
- package/dist/commands/setup.js.map +1 -1
- package/dist/commands/status.js +2 -2
- package/dist/commands/status.js.map +1 -1
- package/dist/commands/telemetry.d.ts +2 -2
- package/dist/commands/telemetry.js +3 -3
- package/dist/commands/telemetry.js.map +1 -1
- package/dist/commands/why.js +31 -31
- package/dist/commands/why.js.map +1 -1
- package/dist/detector/local-model-default.d.ts +1 -1
- package/dist/detector/local-model-default.js +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/lib/access-capability.d.ts +1 -1
- package/dist/lib/access-capability.js +1 -1
- package/dist/lib/advisory-verdict.d.ts +3 -3
- package/dist/lib/advisory-verdict.js +3 -3
- package/dist/lib/agent-rules.d.ts +9 -0
- package/dist/lib/agent-rules.d.ts.map +1 -1
- package/dist/lib/agent-rules.js +55 -39
- package/dist/lib/agent-rules.js.map +1 -1
- package/dist/lib/approve-suggestions.d.ts +1 -1
- package/dist/lib/approve-suggestions.js +1 -1
- package/dist/lib/as-of.d.ts +6 -6
- package/dist/lib/as-of.js +6 -6
- package/dist/lib/ask-evidence.js +1 -1
- package/dist/lib/ask-key-offer.js +1 -1
- package/dist/lib/ask-listing.js +1 -1
- package/dist/lib/brand.d.ts +2 -2
- package/dist/lib/brand.js +3 -3
- package/dist/lib/capture-report.d.ts +1 -1
- package/dist/lib/capture-report.d.ts.map +1 -1
- package/dist/lib/capture-report.js +3 -3
- package/dist/lib/capture-report.js.map +1 -1
- package/dist/lib/capture-sources.d.ts +1 -1
- package/dist/lib/capture-sources.js +1 -1
- package/dist/lib/check-depth.d.ts +1 -1
- package/dist/lib/check-depth.js +1 -1
- package/dist/lib/claude-presence.d.ts +1 -1
- package/dist/lib/claude-presence.js +1 -1
- package/dist/lib/cli-oauth.js +1 -1
- package/dist/lib/cli-oauth.js.map +1 -1
- package/dist/lib/commands-doc.d.ts +1 -1
- package/dist/lib/commands-doc.js +1 -1
- package/dist/lib/commit-cite.js +2 -2
- package/dist/lib/commit-shape.d.ts +1 -1
- package/dist/lib/commit-shape.js +1 -1
- package/dist/lib/config.d.ts +6 -6
- package/dist/lib/config.js +7 -7
- package/dist/lib/config.js.map +1 -1
- package/dist/lib/connect-prompt.d.ts +1 -1
- package/dist/lib/connect-prompt.js +1 -1
- package/dist/lib/decider-kind.d.ts +4 -4
- package/dist/lib/decider-kind.js +4 -4
- package/dist/lib/decision-links.d.ts +7 -8
- package/dist/lib/decision-links.d.ts.map +1 -1
- package/dist/lib/decision-links.js +8 -9
- package/dist/lib/decision-links.js.map +1 -1
- package/dist/lib/decision-refs.d.ts +3 -3
- package/dist/lib/decision-refs.js +4 -4
- package/dist/lib/decision-refs.js.map +1 -1
- package/dist/lib/decision-relations.d.ts +4 -4
- package/dist/lib/decision-relations.js +4 -4
- package/dist/lib/decision-render.d.ts +2 -2
- package/dist/lib/decision-render.d.ts.map +1 -1
- package/dist/lib/decision-render.js +5 -5
- package/dist/lib/decision-render.js.map +1 -1
- package/dist/lib/decisions-context.d.ts +4 -4
- package/dist/lib/decisions-context.js +5 -5
- package/dist/lib/decisions-context.js.map +1 -1
- package/dist/lib/doctor-mcp.js +1 -1
- package/dist/lib/doctor.d.ts +2 -2
- package/dist/lib/embedding-assets.js +1 -1
- package/dist/lib/embedding-runtime.js +1 -1
- package/dist/lib/fetchers/capture.d.ts +1 -1
- package/dist/lib/fetchers/docs.d.ts +1 -1
- package/dist/lib/fetchers/docs.js +5 -5
- package/dist/lib/fetchers/docs.js.map +1 -1
- package/dist/lib/fetchers/git.d.ts +1 -1
- package/dist/lib/fetchers/git.js +1 -1
- package/dist/lib/fetchers/github.d.ts +2 -2
- package/dist/lib/fetchers/github.js +2 -2
- package/dist/lib/fetchers/linear.js +1 -1
- package/dist/lib/fetchers/slack.d.ts +2 -2
- package/dist/lib/fetchers/slack.js +2 -2
- package/dist/lib/first-decision.d.ts +1 -1
- package/dist/lib/first-decision.js +1 -1
- package/dist/lib/first-run-pr-import.d.ts +1 -1
- package/dist/lib/format-date.d.ts +1 -1
- package/dist/lib/format-date.js +1 -1
- package/dist/lib/found-summary.js +4 -4
- package/dist/lib/found-summary.js.map +1 -1
- package/dist/lib/gateway-client.d.ts +27 -27
- package/dist/lib/gateway-client.d.ts.map +1 -1
- package/dist/lib/gateway-client.js +30 -30
- package/dist/lib/gateway-client.js.map +1 -1
- package/dist/lib/git.d.ts +10 -10
- package/dist/lib/git.d.ts.map +1 -1
- package/dist/lib/git.js +12 -12
- package/dist/lib/git.js.map +1 -1
- package/dist/lib/hook-context.js +1 -1
- package/dist/lib/hook-payload.d.ts +1 -1
- package/dist/lib/hybrid-rank.d.ts +3 -3
- package/dist/lib/hybrid-rank.d.ts.map +1 -1
- package/dist/lib/hybrid-rank.js +3 -3
- package/dist/lib/hybrid-rank.js.map +1 -1
- package/dist/lib/import-defaults.d.ts +5 -5
- package/dist/lib/import-defaults.js +3 -3
- package/dist/lib/inline-rules.d.ts +1 -1
- package/dist/lib/inline-rules.js +1 -1
- package/dist/lib/invite-prompt.d.ts +1 -1
- package/dist/lib/invite-prompt.js +1 -1
- package/dist/lib/launch/mcp-child-env.js +1 -1
- package/dist/lib/launch/mcp-child-env.js.map +1 -1
- package/dist/lib/launch/strict-entry.js +2 -2
- package/dist/lib/launch/strict-entry.js.map +1 -1
- package/dist/lib/lexical-store.d.ts +1 -1
- package/dist/lib/lexical-store.js +1 -1
- package/dist/lib/lexical-terms.d.ts +1 -1
- package/dist/lib/lexical-terms.js +1 -1
- package/dist/lib/lexical-text.d.ts +2 -2
- package/dist/lib/lexical-text.js +2 -2
- package/dist/lib/llm-providers.d.ts +1 -1
- package/dist/lib/llm-providers.js +2 -2
- package/dist/lib/llm-providers.js.map +1 -1
- package/dist/lib/llm-trace.d.ts +1 -1
- package/dist/lib/llm-trace.js +1 -1
- package/dist/lib/llm-trace.js.map +1 -1
- package/dist/lib/local-candidate-classify.d.ts +1 -1
- package/dist/lib/local-candidate-classify.js +3 -3
- package/dist/lib/local-candidate-classify.js.map +1 -1
- package/dist/lib/local-db-migrate.d.ts +6 -6
- package/dist/lib/local-db-migrate.js +9 -9
- package/dist/lib/local-db-migrate.js.map +1 -1
- package/dist/lib/local-db-v11.d.ts +1 -1
- package/dist/lib/local-db.d.ts +33 -33
- package/dist/lib/local-db.d.ts.map +1 -1
- package/dist/lib/local-db.js +27 -27
- package/dist/lib/local-db.js.map +1 -1
- package/dist/lib/local-embeddings-native.js +1 -1
- package/dist/lib/local-embeddings.d.ts +2 -2
- package/dist/lib/local-embeddings.js +2 -2
- package/dist/lib/local-embeddings.js.map +1 -1
- package/dist/lib/local-gateway-client.d.ts +5 -5
- package/dist/lib/local-gateway-client.js +40 -40
- package/dist/lib/local-gateway-client.js.map +1 -1
- package/dist/lib/local-ingest.d.ts +3 -3
- package/dist/lib/local-ingest.js +3 -3
- package/dist/lib/local-link-pass.js +1 -1
- package/dist/lib/local-link-pass.js.map +1 -1
- package/dist/lib/local-llm.d.ts +21 -22
- package/dist/lib/local-llm.d.ts.map +1 -1
- package/dist/lib/local-llm.js +28 -30
- package/dist/lib/local-llm.js.map +1 -1
- package/dist/lib/local-mode.d.ts +1 -1
- package/dist/lib/local-mode.js +2 -2
- package/dist/lib/local-mode.js.map +1 -1
- package/dist/lib/local-provenance.d.ts +1 -1
- package/dist/lib/local-provenance.js +1 -1
- package/dist/lib/local-relationship-classifier.d.ts +6 -6
- package/dist/lib/local-relationship-classifier.js +7 -7
- package/dist/lib/local-relationship-classifier.js.map +1 -1
- package/dist/lib/local-thresholds.d.ts +3 -3
- package/dist/lib/local-thresholds.js +4 -4
- package/dist/lib/local-thresholds.js.map +1 -1
- package/dist/lib/mcp/share-status-tool.js +1 -1
- package/dist/lib/mcp/share-tool.js +1 -1
- package/dist/lib/mcp-setup.d.ts +11 -4
- package/dist/lib/mcp-setup.d.ts.map +1 -1
- package/dist/lib/mcp-setup.js +22 -12
- package/dist/lib/mcp-setup.js.map +1 -1
- package/dist/lib/mcp-timeline-tools.d.ts +5 -5
- package/dist/lib/mcp-timeline-tools.d.ts.map +1 -1
- package/dist/lib/mcp-timeline-tools.js +22 -23
- package/dist/lib/mcp-timeline-tools.js.map +1 -1
- package/dist/lib/next-step.d.ts +11 -5
- package/dist/lib/next-step.d.ts.map +1 -1
- package/dist/lib/next-step.js +12 -4
- package/dist/lib/next-step.js.map +1 -1
- package/dist/lib/personal-import.d.ts +3 -3
- package/dist/lib/personal-import.d.ts.map +1 -1
- package/dist/lib/personal-import.js +4 -4
- package/dist/lib/personal-import.js.map +1 -1
- package/dist/lib/personal-oauth.js +3 -3
- package/dist/lib/personal-oauth.js.map +1 -1
- package/dist/lib/query-expand.d.ts +1 -1
- package/dist/lib/query-expand.js +1 -1
- package/dist/lib/read-value-rollup.d.ts +2 -2
- package/dist/lib/read-value-rollup.js +3 -3
- package/dist/lib/read-value-rollup.js.map +1 -1
- package/dist/lib/reason-extract.d.ts +1 -1
- package/dist/lib/reason-extract.js +1 -1
- package/dist/lib/repo-identity.d.ts +2 -2
- package/dist/lib/repo-identity.js +3 -3
- package/dist/lib/resolve-env.d.ts +1 -1
- package/dist/lib/resolve-env.js +1 -1
- package/dist/lib/scope-defaults.js +1 -1
- package/dist/lib/scope-real.d.ts.map +1 -1
- package/dist/lib/scope-real.js +1 -1
- package/dist/lib/scope-real.js.map +1 -1
- package/dist/lib/search-query.d.ts +2 -2
- package/dist/lib/search-query.js +2 -2
- package/dist/lib/search-rerank.d.ts +1 -1
- package/dist/lib/search-rerank.js +1 -1
- package/dist/lib/sessions/confirm-freetext.d.ts +3 -3
- package/dist/lib/sessions/confirm-freetext.d.ts.map +1 -1
- package/dist/lib/sessions/confirm-freetext.js +2 -2
- package/dist/lib/sessions/extract-freetext.d.ts +3 -3
- package/dist/lib/sessions/extract-freetext.d.ts.map +1 -1
- package/dist/lib/sessions/import-summary.d.ts +1 -1
- package/dist/lib/sessions/import-summary.js +1 -1
- package/dist/lib/sessions/memory-files.d.ts +1 -1
- package/dist/lib/sessions/memory-files.js +5 -5
- package/dist/lib/sessions/source-url.d.ts +2 -2
- package/dist/lib/sessions/source-url.js +2 -2
- package/dist/lib/sessions/types.d.ts +6 -6
- package/dist/lib/sessions/types.js +4 -4
- package/dist/lib/setup-funnel.d.ts +2 -2
- package/dist/lib/setup-ux.d.ts +2 -2
- package/dist/lib/setup-ux.js +3 -3
- package/dist/lib/setup-ux.js.map +1 -1
- package/dist/lib/share/approval.js +1 -1
- package/dist/lib/share/browser-flow.d.ts +1 -1
- package/dist/lib/share/browser-flow.js +1 -1
- package/dist/lib/share/command.js +1 -1
- package/dist/lib/share/envelope.js +1 -1
- package/dist/lib/share/pending.d.ts +1 -1
- package/dist/lib/share/requests-client.d.ts +1 -1
- package/dist/lib/share/run.d.ts +1 -1
- package/dist/lib/sparse-graph.d.ts +20 -0
- package/dist/lib/sparse-graph.d.ts.map +1 -0
- package/dist/lib/sparse-graph.js +39 -0
- package/dist/lib/sparse-graph.js.map +1 -0
- package/dist/lib/suppress-sqlite-warning.d.ts +1 -1
- package/dist/lib/sync/real-env.d.ts.map +1 -1
- package/dist/lib/telemetry-env.d.ts +3 -3
- package/dist/lib/telemetry-env.js +1 -1
- package/dist/lib/token-estimate.d.ts +1 -1
- package/dist/lib/token-estimate.js +3 -3
- package/dist/lib/token-estimate.js.map +1 -1
- package/dist/lib/token-scope-gate.d.ts +1 -1
- package/dist/lib/token-scope-gate.js +1 -1
- package/dist/lib/trusted-align-bin.d.ts +2 -2
- package/dist/lib/trusted-align-bin.d.ts.map +1 -1
- package/dist/lib/trusted-align-bin.js +2 -2
- package/dist/lib/trusted-align-bin.js.map +1 -1
- package/dist/lib/usage-telemetry.d.ts +17 -17
- package/dist/lib/usage-telemetry.js +24 -24
- package/dist/lib/usage-telemetry.js.map +1 -1
- package/dist/lib/user-hooks.d.ts +1 -1
- package/dist/lib/user-hooks.d.ts.map +1 -1
- package/dist/lib/user-hooks.js +3 -3
- package/dist/lib/user-hooks.js.map +1 -1
- package/dist/lib/value-rollup.d.ts +7 -7
- package/dist/lib/value-rollup.d.ts.map +1 -1
- package/dist/lib/value-rollup.js +12 -12
- package/dist/lib/value-rollup.js.map +1 -1
- package/dist/lib/write-confirm.d.ts +53 -0
- package/dist/lib/write-confirm.d.ts.map +1 -0
- package/dist/lib/write-confirm.js +70 -0
- package/dist/lib/write-confirm.js.map +1 -0
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* The "what your graph did for you" value rollup. Aggregates the gateway's
|
|
3
3
|
* per-tenant value signals into one normalized shape the status readout renders. Each
|
|
4
4
|
* source is fetched independently and a failure nulls only its own field - an old gateway
|
|
5
5
|
* missing /decisions/reuse-rate must not blank the whole readout.
|
|
@@ -9,7 +9,7 @@ export interface ValueRollup {
|
|
|
9
9
|
decisions: number;
|
|
10
10
|
conflictsCaught: number;
|
|
11
11
|
/**
|
|
12
|
-
* Decisions linked by embedding similarity alone
|
|
12
|
+
* Decisions linked by embedding similarity alone. Deliberately a separate
|
|
13
13
|
* number from conflictsCaught: an embedding says two decisions are about the same thing,
|
|
14
14
|
* never that they disagree. Populated offline only; the cloud rollup has richer signals.
|
|
15
15
|
*/
|
|
@@ -19,7 +19,7 @@ export interface ValueRollup {
|
|
|
19
19
|
reuseRate: number | null;
|
|
20
20
|
healthGrade: string | null;
|
|
21
21
|
/**
|
|
22
|
-
*
|
|
22
|
+
* Unresolved-ref gaps the local graph can name for itself - a decision
|
|
23
23
|
* cites a Jira key, but nothing has connected Jira yet. Local-only: decision_refs
|
|
24
24
|
* lives in the local SQLite graph (local-db.ts), so the hosted gateway has none to
|
|
25
25
|
* report and fetchValueRollup always sets this to [].
|
|
@@ -27,7 +27,7 @@ export interface ValueRollup {
|
|
|
27
27
|
gaps: UnresolvedGap[];
|
|
28
28
|
}
|
|
29
29
|
/**
|
|
30
|
-
* Decisions in a local graph before the sharing prompt is earned
|
|
30
|
+
* Decisions in a local graph before the sharing prompt is earned.
|
|
31
31
|
*
|
|
32
32
|
* The prompt used to be gated on conflictsCaught, which offline was fabricated from cosine
|
|
33
33
|
* similarity, so a manufactured detection was what asked the user for money. Nothing writes
|
|
@@ -59,7 +59,7 @@ export interface ValueRollupClient {
|
|
|
59
59
|
/**
|
|
60
60
|
* `days` is the window the impact and reuse-rate endpoints measure over. Undefined keeps
|
|
61
61
|
* each endpoint's own default (30), which is what `align status` has always read; the
|
|
62
|
-
* second-run card passes 7 so it can honestly say "this week"
|
|
62
|
+
* second-run card passes 7 so it can honestly say "this week".
|
|
63
63
|
*/
|
|
64
64
|
export declare function fetchValueRollup(client: ValueRollupClient, opts?: {
|
|
65
65
|
days?: number;
|
|
@@ -81,7 +81,7 @@ export interface LocalRollupDb {
|
|
|
81
81
|
listLinks(filter?: {
|
|
82
82
|
relation?: string;
|
|
83
83
|
}): unknown[];
|
|
84
|
-
/**
|
|
84
|
+
/** Every ref across every decision, for the gap resolver. */
|
|
85
85
|
getAllRefs(): Array<{
|
|
86
86
|
decisionId: string;
|
|
87
87
|
ref: string;
|
|
@@ -91,7 +91,7 @@ export interface LocalRollupDb {
|
|
|
91
91
|
/**
|
|
92
92
|
* The offline honest subset: decisions + conflict/duplicate/supersession counts derivable
|
|
93
93
|
* from the local decision_links table. Reuse rate and composite health need the gateway,
|
|
94
|
-
* so they are null here - we do NOT fabricate them offline
|
|
94
|
+
* so they are null here - we do NOT fabricate them offline.
|
|
95
95
|
*
|
|
96
96
|
* `isConnected` defaults to "nothing is connected", which only matters when the graph
|
|
97
97
|
* actually carries refs - both real callers (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ollup.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* The "what your graph did for you" value rollup. Aggregates the gateway's
|
|
3
3
|
* per-tenant value signals into one normalized shape the status readout renders. Each
|
|
4
4
|
* source is fetched independently and a failure nulls only its own field - an old gateway
|
|
5
5
|
* missing /decisions/reuse-rate must not blank the whole readout.
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
import { statusGapLine, unresolvedGaps } from './connect-prompt.js';
|
|
8
8
|
import { inviteNudgeLine } from './invite-prompt.js';
|
|
9
9
|
/**
|
|
10
|
-
* Decisions in a local graph before the sharing prompt is earned
|
|
10
|
+
* Decisions in a local graph before the sharing prompt is earned.
|
|
11
11
|
*
|
|
12
12
|
* The prompt used to be gated on conflictsCaught, which offline was fabricated from cosine
|
|
13
13
|
* similarity, so a manufactured detection was what asked the user for money. Nothing writes
|
|
@@ -27,7 +27,7 @@ async function settle(p) {
|
|
|
27
27
|
/**
|
|
28
28
|
* `days` is the window the impact and reuse-rate endpoints measure over. Undefined keeps
|
|
29
29
|
* each endpoint's own default (30), which is what `align status` has always read; the
|
|
30
|
-
* second-run card passes 7 so it can honestly say "this week"
|
|
30
|
+
* second-run card passes 7 so it can honestly say "this week".
|
|
31
31
|
*/
|
|
32
32
|
export async function fetchValueRollup(client, opts = {}) {
|
|
33
33
|
const [stats, impact, links, reuse, health] = await Promise.all([
|
|
@@ -59,15 +59,15 @@ export async function fetchValueRollup(client, opts = {}) {
|
|
|
59
59
|
*/
|
|
60
60
|
export function renderValueReadout(r, opts) {
|
|
61
61
|
const reuse = r.reuseRate === null ? 'n/a' : `${Math.round(r.reuseRate * 100)}%`;
|
|
62
|
-
//
|
|
62
|
+
// Offline, nothing can write a conflict link, so "N conflicts caught" was either
|
|
63
63
|
// fabricated from cosine similarity or a permanent zero that reads as a broken counter.
|
|
64
64
|
// Report what the local graph genuinely knows instead.
|
|
65
65
|
const lines = [` ${r.decisions} decisions in your graph`];
|
|
66
66
|
if (opts.mode === 'local') {
|
|
67
|
-
//
|
|
67
|
+
// Offline, nothing writes a similarity, duplicate or supersession link on a
|
|
68
68
|
// first run, so all three are structurally zero and a row of them reads as a broken
|
|
69
69
|
// dashboard to someone ninety seconds into the tool. HIDDEN AT ZERO, never deleted -
|
|
70
|
-
// localValueRollup still counts the real relations (
|
|
70
|
+
// localValueRollup still counts the real relations (the positive control), so a
|
|
71
71
|
// genuine one appears the moment it exists. Deleting the line would make that
|
|
72
72
|
// impossible and would look identical from here.
|
|
73
73
|
if (r.similarDecisions > 0)
|
|
@@ -92,7 +92,7 @@ export function renderValueReadout(r, opts) {
|
|
|
92
92
|
lines.push('');
|
|
93
93
|
lines.push(' Reuse rate and health need the cloud graph - run `align login` to see them.');
|
|
94
94
|
}
|
|
95
|
-
//
|
|
95
|
+
// Name the gaps the graph can see for itself - one line per platform, only
|
|
96
96
|
// when there is one to name. Local-only, same as similarDecisions above.
|
|
97
97
|
if (r.gaps.length) {
|
|
98
98
|
lines.push('');
|
|
@@ -100,12 +100,12 @@ export function renderValueReadout(r, opts) {
|
|
|
100
100
|
lines.push(statusGapLine(gap));
|
|
101
101
|
}
|
|
102
102
|
// similarDecisions is deliberately absent: buying the upsell with a cosine artefact is
|
|
103
|
-
// the defect this ticket exists to remove, not a smaller version of it
|
|
103
|
+
// the defect this ticket exists to remove, not a smaller version of it.
|
|
104
104
|
const hasValue = (opts.mode === 'local' && r.decisions >= LOCAL_SHARE_THRESHOLD)
|
|
105
105
|
|| r.conflictsCaught > 0 || r.duplicates > 0 || r.supersessions > 0;
|
|
106
106
|
if (hasValue) {
|
|
107
107
|
lines.push('');
|
|
108
|
-
//
|
|
108
|
+
// A command someone can run right there, not a URL to go figure out later.
|
|
109
109
|
lines.push(` ${inviteNudgeLine('value')}`);
|
|
110
110
|
}
|
|
111
111
|
return lines.join('\n');
|
|
@@ -113,7 +113,7 @@ export function renderValueReadout(r, opts) {
|
|
|
113
113
|
/**
|
|
114
114
|
* The offline honest subset: decisions + conflict/duplicate/supersession counts derivable
|
|
115
115
|
* from the local decision_links table. Reuse rate and composite health need the gateway,
|
|
116
|
-
* so they are null here - we do NOT fabricate them offline
|
|
116
|
+
* so they are null here - we do NOT fabricate them offline.
|
|
117
117
|
*
|
|
118
118
|
* `isConnected` defaults to "nothing is connected", which only matters when the graph
|
|
119
119
|
* actually carries refs - both real callers (status.ts, local.ts) always pass a real
|
|
@@ -125,11 +125,11 @@ export function localValueRollup(db, isConnected = () => false) {
|
|
|
125
125
|
decisions: db.getStats().decisions,
|
|
126
126
|
// Kept counting the real relations even though nothing offline writes one, so the
|
|
127
127
|
// counter stays provably capable of reporting a conflict. That is what makes a zero
|
|
128
|
-
// here mean "none found" rather than "the counter is broken"
|
|
128
|
+
// here mean "none found" rather than "the counter is broken".
|
|
129
129
|
conflictsCaught: count('conflicts_with') + count('contradicts'),
|
|
130
130
|
similarDecisions: count('relates'),
|
|
131
131
|
duplicates: count('duplicates'),
|
|
132
|
-
//
|
|
132
|
+
// partially_supersedes is a real capture-time typed edge now too - counting
|
|
133
133
|
// only 'supersedes' would undercount the moment a decision partially replaces another.
|
|
134
134
|
supersessions: count('supersedes') + count('partially_supersedes'),
|
|
135
135
|
reuseRate: null,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"value-rollup.js","sourceRoot":"","sources":["../../src/lib/value-rollup.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,aAAa,EAAsB,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACxF,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAwBrD;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,CAAC;AAUvC,KAAK,UAAU,MAAM,CAAI,CAAa;IACpC,IAAI,CAAC;QACH,OAAO,MAAM,CAAC,CAAC;IACjB,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,IAAI,CAAC;IACd,CAAC;AACH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MAAM,UAAU,gBAAgB,CAC9B,EAAiB,EACjB,cAAgD,GAAG,EAAE,CAAC,KAAK;IAE3D,MAAM,KAAK,GAAG,CAAC,QAAgB,EAAE,EAAE,CAAC,EAAE,CAAC,SAAS,CAAC,EAAE,QAAQ,EAAE,CAAC,CAAC,MAAM,CAAC;IACtE,OAAO;QACL,SAAS,EAAE,EAAE,CAAC,QAAQ,EAAE,CAAC,SAAS;QAClC,kFAAkF;QAClF,oFAAoF;QACpF,8DAA8D;QAC9D,eAAe,EAAE,KAAK,CAAC,gBAAgB,CAAC,GAAG,KAAK,CAAC,aAAa,CAAC;QAC/D,gBAAgB,EAAE,KAAK,CAAC,SAAS,CAAC;QAClC,UAAU,EAAE,KAAK,CAAC,YAAY,CAAC;QAC/B,4EAA4E;QAC5E,uFAAuF;QACvF,aAAa,EAAE,KAAK,CAAC,YAAY,CAAC,GAAG,KAAK,CAAC,sBAAsB,CAAC;QAClE,SAAS,EAAE,IAAI;QACf,WAAW,EAAE,IAAI;QACjB,IAAI,EAAE,cAAc,CAAC,EAAE,CAAC,UAAU,EAAE,EAAE,WAAW,CAAC;KACnD,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { type EditorTarget } from './mcp-setup.js';
|
|
2
|
+
/** One file setup will create or modify. `display` is what the person reads. */
|
|
3
|
+
export interface PlannedWrite {
|
|
4
|
+
/** Absolute path. */
|
|
5
|
+
file: string;
|
|
6
|
+
display: string;
|
|
7
|
+
action: 'create' | 'modify';
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* A path under home as `~/...` with forward slashes on every OS, so the list reads the same as the
|
|
11
|
+
* project rows. Windows' native separator made it `~\.codex\config.toml` beside `.claude/settings.json`.
|
|
12
|
+
*/
|
|
13
|
+
export declare function homeDisplay(file: string, home: string): string;
|
|
14
|
+
/**
|
|
15
|
+
* Every file one setup run can create or modify: the project's agent files, then each detected
|
|
16
|
+
* agent's own config. Built from the tables the writers themselves run (planAgentAlignment,
|
|
17
|
+
* mcpConfigFiles), never from a second hand-written list.
|
|
18
|
+
*/
|
|
19
|
+
export declare function planSetupWrites(opts: {
|
|
20
|
+
cwd: string;
|
|
21
|
+
editors: EditorTarget[];
|
|
22
|
+
home?: string;
|
|
23
|
+
}): PlannedWrite[];
|
|
24
|
+
/**
|
|
25
|
+
* "may": the list is every file a writer CAN touch. A writer leaves its file as found when it is a
|
|
26
|
+
* symlink or the entry in it belongs to a team, and that is decided inside the writer while it runs
|
|
27
|
+
* (agent-rules.ts, mcp-setup.ts), so it cannot be asked ahead of time without a second copy of the rule.
|
|
28
|
+
*/
|
|
29
|
+
export declare const WRITE_PLAN_HEADING = "Align may create or change these files:";
|
|
30
|
+
/** The list, one file per line. Plain text so the same lines print on a terminal and in a log. */
|
|
31
|
+
export declare function renderWritePlan(files: PlannedWrite[]): string;
|
|
32
|
+
/**
|
|
33
|
+
* Shown with the list, before the question. `align use --undo` replays the write manifest, which
|
|
34
|
+
* records the project files AND each agent's own config (write-confirm.test.ts pins both), so one
|
|
35
|
+
* command covers every file listed. `align mcp --remove` also works, but only for the agent configs.
|
|
36
|
+
*/
|
|
37
|
+
export declare const WRITE_UNDO_LINE = "The first copy of any file that already exists is kept. Undo any time: align use --undo (it covers every file listed, project and agent config alike)";
|
|
38
|
+
export declare const WRITE_CONFIRM_QUESTION = "Continue?";
|
|
39
|
+
/**
|
|
40
|
+
* Show the list, then ask. The list prints on EVERY run, so a scripted run leaves a record of
|
|
41
|
+
* what it touched. The question is asked only with a person at a terminal and without
|
|
42
|
+
* --approve; otherwise the run goes ahead, as it did before the prompt existed.
|
|
43
|
+
* Returns false only when the person says no (or cancels).
|
|
44
|
+
*/
|
|
45
|
+
export declare function confirmWrites(opts: {
|
|
46
|
+
files: PlannedWrite[];
|
|
47
|
+
approve?: boolean;
|
|
48
|
+
interactive: boolean;
|
|
49
|
+
print: (text: string) => void;
|
|
50
|
+
/** The yes/no prompt. Default yes. Resolves to undefined when the person cancels. */
|
|
51
|
+
ask: (message: string) => Promise<boolean | undefined>;
|
|
52
|
+
}): Promise<boolean>;
|
|
53
|
+
//# sourceMappingURL=write-confirm.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"write-confirm.d.ts","sourceRoot":"","sources":["../../src/lib/write-confirm.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,YAAY,EAAkB,MAAM,gBAAgB,CAAC;AAEnE,gFAAgF;AAChF,MAAM,WAAW,YAAY;IAC3B,qBAAqB;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,QAAQ,GAAG,QAAQ,CAAC;CAC7B;AAED;;;GAGG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAG9D;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,YAAY,EAAE,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,YAAY,EAAE,CAgB7G;AAED;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,4CAA4C,CAAC;AAE5E,kGAAkG;AAClG,wBAAgB,eAAe,CAAC,KAAK,EAAE,YAAY,EAAE,GAAG,MAAM,CAG7D;AAED;;;;GAIG;AACH,eAAO,MAAM,eAAe,0JAA0J,CAAC;AAEvL,eAAO,MAAM,sBAAsB,cAAc,CAAC;AAElD;;;;;GAKG;AACH,wBAAsB,aAAa,CAAC,IAAI,EAAE;IACxC,KAAK,EAAE,YAAY,EAAE,CAAC;IACtB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,WAAW,EAAE,OAAO,CAAC;IACrB,KAAK,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAC9B,qFAAqF;IACrF,GAAG,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,OAAO,CAAC,OAAO,GAAG,SAAS,CAAC,CAAC;CACxD,GAAG,OAAO,CAAC,OAAO,CAAC,CAKnB"}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { existsSync } from 'node:fs';
|
|
2
|
+
import os from 'node:os';
|
|
3
|
+
import path from 'node:path';
|
|
4
|
+
import { planAgentAlignment } from './agent-rules.js';
|
|
5
|
+
import { mcpConfigFiles } from './mcp-setup.js';
|
|
6
|
+
/**
|
|
7
|
+
* A path under home as `~/...` with forward slashes on every OS, so the list reads the same as the
|
|
8
|
+
* project rows. Windows' native separator made it `~\.codex\config.toml` beside `.claude/settings.json`.
|
|
9
|
+
*/
|
|
10
|
+
export function homeDisplay(file, home) {
|
|
11
|
+
const under = file.startsWith(`${home}/`) || file.startsWith(`${home}\\`);
|
|
12
|
+
return under ? `~${file.slice(home.length).replace(/\\/g, '/')}` : file;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Every file one setup run can create or modify: the project's agent files, then each detected
|
|
16
|
+
* agent's own config. Built from the tables the writers themselves run (planAgentAlignment,
|
|
17
|
+
* mcpConfigFiles), never from a second hand-written list.
|
|
18
|
+
*/
|
|
19
|
+
export function planSetupWrites(opts) {
|
|
20
|
+
const home = opts.home ?? os.homedir();
|
|
21
|
+
const out = [];
|
|
22
|
+
const seen = new Set();
|
|
23
|
+
const add = (abs, display, action) => {
|
|
24
|
+
if (seen.has(abs))
|
|
25
|
+
return;
|
|
26
|
+
seen.add(abs);
|
|
27
|
+
out.push({ file: abs, display, action });
|
|
28
|
+
};
|
|
29
|
+
for (const { file, action } of planAgentAlignment(opts.cwd))
|
|
30
|
+
add(path.join(opts.cwd, file), file, action);
|
|
31
|
+
for (const editor of opts.editors) {
|
|
32
|
+
for (const file of mcpConfigFiles(editor)) {
|
|
33
|
+
add(file, homeDisplay(file, home), existsSync(file) ? 'modify' : 'create');
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
return out;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* "may": the list is every file a writer CAN touch. A writer leaves its file as found when it is a
|
|
40
|
+
* symlink or the entry in it belongs to a team, and that is decided inside the writer while it runs
|
|
41
|
+
* (agent-rules.ts, mcp-setup.ts), so it cannot be asked ahead of time without a second copy of the rule.
|
|
42
|
+
*/
|
|
43
|
+
export const WRITE_PLAN_HEADING = 'Align may create or change these files:';
|
|
44
|
+
/** The list, one file per line. Plain text so the same lines print on a terminal and in a log. */
|
|
45
|
+
export function renderWritePlan(files) {
|
|
46
|
+
const width = Math.max(...files.map((f) => f.action.length));
|
|
47
|
+
return [WRITE_PLAN_HEADING, ...files.map((f) => ` ${f.action.padEnd(width)} ${f.display}`)].join('\n');
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Shown with the list, before the question. `align use --undo` replays the write manifest, which
|
|
51
|
+
* records the project files AND each agent's own config (write-confirm.test.ts pins both), so one
|
|
52
|
+
* command covers every file listed. `align mcp --remove` also works, but only for the agent configs.
|
|
53
|
+
*/
|
|
54
|
+
export const WRITE_UNDO_LINE = 'The first copy of any file that already exists is kept. Undo any time: align use --undo (it covers every file listed, project and agent config alike)';
|
|
55
|
+
export const WRITE_CONFIRM_QUESTION = 'Continue?';
|
|
56
|
+
/**
|
|
57
|
+
* Show the list, then ask. The list prints on EVERY run, so a scripted run leaves a record of
|
|
58
|
+
* what it touched. The question is asked only with a person at a terminal and without
|
|
59
|
+
* --approve; otherwise the run goes ahead, as it did before the prompt existed.
|
|
60
|
+
* Returns false only when the person says no (or cancels).
|
|
61
|
+
*/
|
|
62
|
+
export async function confirmWrites(opts) {
|
|
63
|
+
if (opts.files.length === 0)
|
|
64
|
+
return true;
|
|
65
|
+
opts.print(`${renderWritePlan(opts.files)}\n${WRITE_UNDO_LINE}`);
|
|
66
|
+
if (!opts.interactive || opts.approve)
|
|
67
|
+
return true;
|
|
68
|
+
return (await opts.ask(WRITE_CONFIRM_QUESTION)) === true;
|
|
69
|
+
}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