sequant 2.9.0 → 2.10.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/.claude-plugin/marketplace.json +1 -1
- package/.claude-plugin/plugin.json +1 -1
- package/README.md +14 -3
- package/dist/bin/cli.js +97 -17
- package/dist/marketplace/external_plugins/sequant/.claude-plugin/plugin.json +1 -1
- package/dist/marketplace/external_plugins/sequant/.mcp.json +1 -1
- package/dist/marketplace/external_plugins/sequant/README.md +56 -2
- package/dist/marketplace/external_plugins/sequant/hooks/parallel-marker.sh +50 -0
- package/dist/marketplace/external_plugins/sequant/hooks/post-tool.sh +20 -7
- package/dist/marketplace/external_plugins/sequant/hooks/pre-tool.sh +75 -10
- package/dist/marketplace/external_plugins/sequant/skills/_shared/references/trust-model.md +18 -0
- package/dist/marketplace/external_plugins/sequant/skills/assess/SKILL.md +215 -390
- package/dist/marketplace/external_plugins/sequant/skills/assess/references/predicted-collision-detection.md +1 -1
- package/dist/marketplace/external_plugins/sequant/skills/docs/SKILL.md +4 -4
- package/dist/marketplace/external_plugins/sequant/skills/exec/SKILL.md +26 -6
- package/dist/marketplace/external_plugins/sequant/skills/fullsolve/SKILL.md +3 -1
- package/dist/marketplace/external_plugins/sequant/skills/loop/SKILL.md +38 -2
- package/dist/marketplace/external_plugins/sequant/skills/merger/SKILL.md +2 -2
- package/dist/marketplace/external_plugins/sequant/skills/qa/SKILL.md +337 -57
- package/dist/marketplace/external_plugins/sequant/skills/qa/references/anti-pattern-detection.md +6 -6
- package/dist/marketplace/external_plugins/sequant/skills/qa/references/call-site-review.md +2 -2
- package/dist/marketplace/external_plugins/sequant/skills/qa/references/code-review-checklist.md +2 -2
- package/dist/marketplace/external_plugins/sequant/skills/qa/references/fixtures/injection-issue-body.md +36 -0
- package/dist/marketplace/external_plugins/sequant/skills/qa/references/quality-gates.md +21 -7
- package/dist/marketplace/external_plugins/sequant/skills/qa/references/testing-requirements.md +1 -1
- package/dist/marketplace/external_plugins/sequant/skills/qa/scripts/quality-checks.sh +11 -11
- package/dist/marketplace/external_plugins/sequant/skills/release/SKILL.md +1 -1
- package/dist/marketplace/external_plugins/sequant/skills/setup/SKILL.md +5 -5
- package/dist/marketplace/external_plugins/sequant/skills/spec/SKILL.md +2 -0
- package/dist/marketplace/external_plugins/sequant/skills/test/SKILL.md +1 -1
- package/dist/src/commands/assess-render.d.ts +23 -0
- package/dist/src/commands/assess-render.js +60 -0
- package/dist/src/commands/doctor.js +8 -13
- package/dist/src/commands/init.js +13 -1
- package/dist/src/commands/locks.js +2 -0
- package/dist/src/commands/logs.js +14 -5
- package/dist/src/commands/merge.js +154 -2
- package/dist/src/commands/ready-tui-adapter.js +6 -1
- package/dist/src/commands/ready.d.ts +25 -3
- package/dist/src/commands/ready.js +39 -13
- package/dist/src/commands/resume.d.ts +113 -0
- package/dist/src/commands/resume.js +193 -0
- package/dist/src/commands/run-display.js +37 -4
- package/dist/src/commands/run-flags.d.ts +42 -1
- package/dist/src/commands/run-flags.js +53 -1
- package/dist/src/commands/run-progress.js +26 -1
- package/dist/src/commands/run.js +11 -10
- package/dist/src/commands/state.js +7 -0
- package/dist/src/commands/status.d.ts +9 -0
- package/dist/src/commands/status.js +24 -1
- package/dist/src/commands/sync.js +90 -19
- package/dist/src/commands/update.js +28 -5
- package/dist/src/lib/ac-parser.d.ts +14 -0
- package/dist/src/lib/ac-parser.js +99 -5
- package/dist/src/lib/assess/index.d.ts +10 -0
- package/dist/src/lib/assess/index.js +9 -0
- package/dist/src/lib/assess/renderer.d.ts +64 -0
- package/dist/src/lib/assess/renderer.js +481 -0
- package/dist/src/lib/assess/types.d.ts +224 -0
- package/dist/src/lib/assess/types.js +241 -0
- package/dist/src/lib/ci/outputs.d.ts +15 -2
- package/dist/src/lib/ci/outputs.js +17 -5
- package/dist/src/lib/cli-flags.d.ts +33 -0
- package/dist/src/lib/cli-flags.js +46 -0
- package/dist/src/lib/cli-ui/run-renderer-types.d.ts +21 -7
- package/dist/src/lib/cli-ui/run-renderer.d.ts +10 -0
- package/dist/src/lib/cli-ui/run-renderer.js +62 -0
- package/dist/src/lib/errors.d.ts +78 -6
- package/dist/src/lib/errors.js +133 -15
- package/dist/src/lib/locks/index.d.ts +3 -3
- package/dist/src/lib/locks/index.js +2 -2
- package/dist/src/lib/locks/lock-manager.d.ts +20 -2
- package/dist/src/lib/locks/lock-manager.js +47 -3
- package/dist/src/lib/locks/types.d.ts +34 -3
- package/dist/src/lib/locks/types.js +16 -0
- package/dist/src/lib/mcp-config.d.ts +45 -0
- package/dist/src/lib/mcp-config.js +77 -1
- package/dist/src/lib/merge-check/combined-branch-test.d.ts +21 -2
- package/dist/src/lib/merge-check/combined-branch-test.js +233 -110
- package/dist/src/lib/merge-check/command-result.d.ts +36 -0
- package/dist/src/lib/merge-check/command-result.js +56 -0
- package/dist/src/lib/merge-check/index.d.ts +4 -0
- package/dist/src/lib/merge-check/index.js +1 -1
- package/dist/src/lib/merge-check/report.js +5 -1
- package/dist/src/lib/merge-check/types.d.ts +9 -0
- package/dist/src/lib/merge-check/watch.d.ts +121 -0
- package/dist/src/lib/merge-check/watch.js +215 -0
- package/dist/src/lib/qa/infra-blocked-ci.d.ts +90 -0
- package/dist/src/lib/qa/infra-blocked-ci.js +80 -0
- package/dist/src/lib/settings.d.ts +14 -0
- package/dist/src/lib/settings.js +61 -8
- package/dist/src/lib/shutdown.d.ts +42 -2
- package/dist/src/lib/shutdown.js +75 -5
- package/dist/src/lib/skills-check.d.ts +26 -0
- package/dist/src/lib/skills-check.js +31 -0
- package/dist/src/lib/stacks.d.ts +110 -1
- package/dist/src/lib/stacks.js +244 -5
- package/dist/src/lib/templates.d.ts +74 -0
- package/dist/src/lib/templates.js +171 -16
- package/dist/src/lib/test-tautology-detector.d.ts +9 -2
- package/dist/src/lib/test-tautology-detector.js +153 -12
- package/dist/src/lib/version-check.d.ts +31 -0
- package/dist/src/lib/version-check.js +45 -2
- package/dist/src/lib/workflow/batch-executor.d.ts +125 -6
- package/dist/src/lib/workflow/batch-executor.js +477 -44
- package/dist/src/lib/workflow/chain-resume.d.ts +13 -11
- package/dist/src/lib/workflow/chain-resume.js +24 -20
- package/dist/src/lib/workflow/completed-status.d.ts +52 -0
- package/dist/src/lib/workflow/completed-status.js +57 -0
- package/dist/src/lib/workflow/config-resolver.d.ts +26 -0
- package/dist/src/lib/workflow/config-resolver.js +54 -2
- package/dist/src/lib/workflow/drivers/agent-driver.d.ts +7 -0
- package/dist/src/lib/workflow/drivers/aider.d.ts +2 -0
- package/dist/src/lib/workflow/drivers/aider.js +2 -0
- package/dist/src/lib/workflow/drivers/claude-code.d.ts +14 -0
- package/dist/src/lib/workflow/drivers/claude-code.js +20 -2
- package/dist/src/lib/workflow/git-diff-utils.d.ts +35 -3
- package/dist/src/lib/workflow/git-diff-utils.js +77 -4
- package/dist/src/lib/workflow/heartbeat.d.ts +38 -0
- package/dist/src/lib/workflow/heartbeat.js +90 -0
- package/dist/src/lib/workflow/log-writer.d.ts +44 -1
- package/dist/src/lib/workflow/log-writer.js +75 -6
- package/dist/src/lib/workflow/metrics-schema.d.ts +3 -3
- package/dist/src/lib/workflow/phase-executor.d.ts +203 -14
- package/dist/src/lib/workflow/phase-executor.js +457 -52
- package/dist/src/lib/workflow/phase-registry.js +2 -1
- package/dist/src/lib/workflow/platforms/github.d.ts +64 -0
- package/dist/src/lib/workflow/platforms/github.js +152 -0
- package/dist/src/lib/workflow/qa-cache.d.ts +6 -1
- package/dist/src/lib/workflow/qa-cache.js +22 -9
- package/dist/src/lib/workflow/ready-gate.d.ts +17 -4
- package/dist/src/lib/workflow/ready-gate.js +25 -9
- package/dist/src/lib/workflow/run-log-schema.d.ts +14 -0
- package/dist/src/lib/workflow/run-log-schema.js +47 -1
- package/dist/src/lib/workflow/run-orchestrator.d.ts +19 -0
- package/dist/src/lib/workflow/run-orchestrator.js +141 -20
- package/dist/src/lib/workflow/skills-preflight.d.ts +89 -0
- package/dist/src/lib/workflow/skills-preflight.js +112 -0
- package/dist/src/lib/workflow/state-cleanup.js +9 -2
- package/dist/src/lib/workflow/state-manager.d.ts +33 -0
- package/dist/src/lib/workflow/state-manager.js +83 -0
- package/dist/src/lib/workflow/state-schema.d.ts +26 -0
- package/dist/src/lib/workflow/state-schema.js +47 -0
- package/dist/src/lib/workflow/types.d.ts +126 -4
- package/dist/src/lib/workflow/types.js +1 -0
- package/dist/src/lib/workflow/worktree-manager.d.ts +28 -2
- package/dist/src/lib/workflow/worktree-manager.js +102 -23
- package/dist/src/mcp/tools/run.d.ts +9 -1
- package/dist/src/mcp/tools/run.js +20 -1
- package/dist/src/mcp/tools/status.js +6 -0
- package/dist/src/ui/tui/ElapsedTimer.d.ts +12 -3
- package/dist/src/ui/tui/ElapsedTimer.js +12 -10
- package/dist/src/ui/tui/IssueBox.js +10 -2
- package/dist/src/ui/tui/row-cap.js +2 -1
- package/dist/src/ui/tui/theme.d.ts +7 -0
- package/dist/src/ui/tui/theme.js +9 -0
- package/package.json +8 -7
- package/templates/hooks/parallel-marker.sh +50 -0
- package/templates/hooks/post-tool.sh +20 -7
- package/templates/hooks/pre-tool.sh +75 -10
- package/templates/scripts/cleanup-worktree.sh +182 -19
- package/templates/scripts/new-feature.sh +264 -16
- package/templates/skills/_shared/references/trust-model.md +18 -0
- package/templates/skills/assess/SKILL.md +215 -390
- package/templates/skills/assess/references/predicted-collision-detection.md +1 -1
- package/templates/skills/docs/SKILL.md +4 -4
- package/templates/skills/exec/SKILL.md +26 -6
- package/templates/skills/fullsolve/SKILL.md +3 -1
- package/templates/skills/loop/SKILL.md +38 -2
- package/templates/skills/merger/SKILL.md +2 -2
- package/templates/skills/qa/SKILL.md +337 -57
- package/templates/skills/qa/references/anti-pattern-detection.md +6 -6
- package/templates/skills/qa/references/call-site-review.md +2 -2
- package/templates/skills/qa/references/code-review-checklist.md +2 -2
- package/templates/skills/qa/references/fixtures/injection-issue-body.md +36 -0
- package/templates/skills/qa/references/quality-gates.md +21 -7
- package/templates/skills/qa/references/testing-requirements.md +1 -1
- package/templates/skills/qa/scripts/quality-checks.sh +11 -11
- package/templates/skills/release/SKILL.md +1 -1
- package/templates/skills/setup/SKILL.md +5 -5
- package/templates/skills/spec/SKILL.md +2 -0
- package/templates/skills/test/SKILL.md +1 -1
- package/dist/src/lib/phase-spinner.d.ts +0 -146
- package/dist/src/lib/phase-spinner.js +0 -255
- package/dist/src/lib/workflow/pr-operations.d.ts +0 -86
- package/dist/src/lib/workflow/pr-operations.js +0 -326
- package/dist/src/lib/workflow/run-summary.d.ts +0 -36
- package/dist/src/lib/workflow/run-summary.js +0 -142
|
@@ -14,8 +14,32 @@ export declare const DEFAULT_STALE_AGE_MS: number;
|
|
|
14
14
|
* Override per-process via `SEQUANT_SKILL_LOCK_TTL_MS` (milliseconds).
|
|
15
15
|
*/
|
|
16
16
|
export declare const DEFAULT_SKILL_LOCK_TTL_MS: number;
|
|
17
|
+
/**
|
|
18
|
+
* Absolute age ceiling (ms) beyond which a lock is stale no matter what
|
|
19
|
+
* (#856). Unlike the two TTLs above this one is NOT conditional on host or
|
|
20
|
+
* PID liveness: the same-host branch of `classifyStaleness` treats a live PID
|
|
21
|
+
* as authoritative proof of freshness, so before this ceiling existed a lock
|
|
22
|
+
* whose PID had been recycled by the OS read as fresh forever and blocked its
|
|
23
|
+
* issue permanently (observed: `505.lock` from 2026-05-14, `708.lock`,
|
|
24
|
+
* `803.lock`). It is also the recovery path for locks leaked by a SIGKILLed
|
|
25
|
+
* run, where no in-process release handler can ever fire.
|
|
26
|
+
*
|
|
27
|
+
* 24h is ~48x the 30-minute default phase timeout and 4x
|
|
28
|
+
* `DEFAULT_SKILL_LOCK_TTL_MS`, so no real run can reach it.
|
|
29
|
+
*
|
|
30
|
+
* Override per-process via `SEQUANT_MAX_LOCK_AGE_MS` (milliseconds).
|
|
31
|
+
*/
|
|
32
|
+
export declare const DEFAULT_MAX_LOCK_AGE_MS: number;
|
|
17
33
|
/** Default lock directory relative to the project root. */
|
|
18
34
|
export declare const DEFAULT_LOCKS_DIR = ".sequant/locks";
|
|
35
|
+
/**
|
|
36
|
+
* Why a lock is considered stale, or `null` when it is fresh.
|
|
37
|
+
*
|
|
38
|
+
* - `pid-dead` — same-host holder PID is gone.
|
|
39
|
+
* - `age-exceeded` — cross-host / skill-shell lock past its TTL.
|
|
40
|
+
* - `max-age-exceeded` — past the absolute ceiling; applies unconditionally.
|
|
41
|
+
*/
|
|
42
|
+
export type StaleReason = "pid-dead" | "age-exceeded" | "max-age-exceeded";
|
|
19
43
|
/** On-disk lock payload. */
|
|
20
44
|
export declare const LockFileSchema: z.ZodObject<{
|
|
21
45
|
pid: z.ZodNumber;
|
|
@@ -35,7 +59,7 @@ export type AcquireResult = {
|
|
|
35
59
|
lockPath: string;
|
|
36
60
|
/** True when the holder appears stale and could be cleared with `--force`. */
|
|
37
61
|
stale: boolean;
|
|
38
|
-
staleReason?:
|
|
62
|
+
staleReason?: StaleReason | null;
|
|
39
63
|
};
|
|
40
64
|
/** Listing entry from `LockManager.list()`. */
|
|
41
65
|
export interface LockListing {
|
|
@@ -43,7 +67,7 @@ export interface LockListing {
|
|
|
43
67
|
holder: LockFile;
|
|
44
68
|
ageMs: number;
|
|
45
69
|
stale: boolean;
|
|
46
|
-
staleReason:
|
|
70
|
+
staleReason: StaleReason | null;
|
|
47
71
|
lockPath: string;
|
|
48
72
|
}
|
|
49
73
|
/**
|
|
@@ -51,7 +75,14 @@ export interface LockListing {
|
|
|
51
75
|
* that previously all collapsed to `false`, so callers can produce accurate
|
|
52
76
|
* log lines (#637).
|
|
53
77
|
*/
|
|
54
|
-
export type SignalReason = "sent" | "orchestrator" | "cross-host" | "self-or-parent" | "pid-dead"
|
|
78
|
+
export type SignalReason = "sent" | "orchestrator" | "cross-host" | "self-or-parent" | "pid-dead"
|
|
79
|
+
/**
|
|
80
|
+
* Holder is past the absolute age ceiling, so its PID is not trustworthy
|
|
81
|
+
* identity (#856). Signalling it would target whatever process the OS has
|
|
82
|
+
* since recycled that PID onto — an unrelated program, killed by a
|
|
83
|
+
* `--force --signal-other` aimed at a lock abandoned weeks ago.
|
|
84
|
+
*/
|
|
85
|
+
| "stale-pid-untrusted" | "kill-failed";
|
|
55
86
|
/** Outcome of `LockManager.signalOther()`. */
|
|
56
87
|
export interface SignalOtherResult {
|
|
57
88
|
sent: boolean;
|
|
@@ -14,6 +14,22 @@ export const DEFAULT_STALE_AGE_MS = 2 * 60 * 60 * 1000; // 2h
|
|
|
14
14
|
* Override per-process via `SEQUANT_SKILL_LOCK_TTL_MS` (milliseconds).
|
|
15
15
|
*/
|
|
16
16
|
export const DEFAULT_SKILL_LOCK_TTL_MS = 6 * 60 * 60 * 1000; // 6h
|
|
17
|
+
/**
|
|
18
|
+
* Absolute age ceiling (ms) beyond which a lock is stale no matter what
|
|
19
|
+
* (#856). Unlike the two TTLs above this one is NOT conditional on host or
|
|
20
|
+
* PID liveness: the same-host branch of `classifyStaleness` treats a live PID
|
|
21
|
+
* as authoritative proof of freshness, so before this ceiling existed a lock
|
|
22
|
+
* whose PID had been recycled by the OS read as fresh forever and blocked its
|
|
23
|
+
* issue permanently (observed: `505.lock` from 2026-05-14, `708.lock`,
|
|
24
|
+
* `803.lock`). It is also the recovery path for locks leaked by a SIGKILLed
|
|
25
|
+
* run, where no in-process release handler can ever fire.
|
|
26
|
+
*
|
|
27
|
+
* 24h is ~48x the 30-minute default phase timeout and 4x
|
|
28
|
+
* `DEFAULT_SKILL_LOCK_TTL_MS`, so no real run can reach it.
|
|
29
|
+
*
|
|
30
|
+
* Override per-process via `SEQUANT_MAX_LOCK_AGE_MS` (milliseconds).
|
|
31
|
+
*/
|
|
32
|
+
export const DEFAULT_MAX_LOCK_AGE_MS = 24 * 60 * 60 * 1000; // 24h
|
|
17
33
|
/** Default lock directory relative to the project root. */
|
|
18
34
|
export const DEFAULT_LOCKS_DIR = ".sequant/locks";
|
|
19
35
|
/** On-disk lock payload. */
|
|
@@ -6,6 +6,21 @@
|
|
|
6
6
|
*/
|
|
7
7
|
/** Path to the project-level MCP config file used by Claude Code */
|
|
8
8
|
export declare const PROJECT_MCP_JSON = ".mcp.json";
|
|
9
|
+
/**
|
|
10
|
+
* npm package specifier used to launch the MCP server (#793).
|
|
11
|
+
*
|
|
12
|
+
* We pin to the installed version rather than `@latest` so that `npx` does not
|
|
13
|
+
* re-resolve and reinstall the package on the first MCP reconnect after every
|
|
14
|
+
* sequant release — the reinstall was surfacing as an opaque
|
|
15
|
+
* `Failed to reconnect to sequant: -32000` when npx's cache was corrupted
|
|
16
|
+
* (npm ENOTEMPTY). `setup`/`update` (re)write this pin, so the MCP server
|
|
17
|
+
* tracks new releases when the user runs `sequant update` — matching how the
|
|
18
|
+
* plugin cache already pins. See docs/troubleshooting.md ("MCP Server Issues").
|
|
19
|
+
*
|
|
20
|
+
* Falls back to `latest` if the installed version cannot be resolved, so a
|
|
21
|
+
* failed lookup never writes a bogus `sequant@0.0.0` pin into `.mcp.json`.
|
|
22
|
+
*/
|
|
23
|
+
export declare function getSequantPackageSpec(): string;
|
|
9
24
|
export type McpClientType = "claude-desktop" | "cursor" | "vscode-continue";
|
|
10
25
|
export interface McpClientInfo {
|
|
11
26
|
name: string;
|
|
@@ -52,3 +67,33 @@ export interface ProjectMcpJsonResult {
|
|
|
52
67
|
* because Claude Code runs from the project root.
|
|
53
68
|
*/
|
|
54
69
|
export declare function createProjectMcpJson(projectDir?: string): ProjectMcpJsonResult;
|
|
70
|
+
export interface SyncMcpPinResult {
|
|
71
|
+
updated: boolean;
|
|
72
|
+
/** Why no rewrite happened, when updated === false. */
|
|
73
|
+
reason?: "no-file" | "no-entry" | "no-pin" | "already-current";
|
|
74
|
+
/** Previous package spec, when updated === true (e.g. "sequant@latest"). */
|
|
75
|
+
from?: string;
|
|
76
|
+
/** New package spec, when updated === true (e.g. "sequant@2.9.0"). */
|
|
77
|
+
to?: string;
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Re-pin an existing project `.mcp.json` sequant entry to the installed version (#793).
|
|
81
|
+
*
|
|
82
|
+
* Unlike {@link createProjectMcpJson} (which skips when a sequant entry already
|
|
83
|
+
* exists), this is the `update`/`sync` path: it refreshes the version pin so the
|
|
84
|
+
* MCP server tracks the release the user just updated to. It only rewrites the
|
|
85
|
+
* `sequant@<version>` token inside `args` and leaves everything else untouched.
|
|
86
|
+
*
|
|
87
|
+
* No-ops (returns `updated: false`) when:
|
|
88
|
+
* - `.mcp.json` doesn't exist (`no-file`) — we never create it here; that's init's job
|
|
89
|
+
* - there's no sequant server entry (`no-entry`)
|
|
90
|
+
* - the entry uses a local-binary form with no `sequant@…` arg (`no-pin`) — a
|
|
91
|
+
* deliberate contributor override we must not clobber
|
|
92
|
+
* - the pin already matches the installed version (`already-current`)
|
|
93
|
+
*
|
|
94
|
+
* With `opts.dryRun`, computes `from`/`to` and returns `updated: true` for a
|
|
95
|
+
* pending change but does not write the file — the caller reports it as a preview.
|
|
96
|
+
*/
|
|
97
|
+
export declare function syncSequantMcpPin(projectDir?: string, opts?: {
|
|
98
|
+
dryRun?: boolean;
|
|
99
|
+
}): SyncMcpPinResult;
|
|
@@ -7,8 +7,29 @@
|
|
|
7
7
|
import * as fs from "fs";
|
|
8
8
|
import * as os from "os";
|
|
9
9
|
import * as path from "path";
|
|
10
|
+
import { getVersion } from "./version.js";
|
|
10
11
|
/** Path to the project-level MCP config file used by Claude Code */
|
|
11
12
|
export const PROJECT_MCP_JSON = ".mcp.json";
|
|
13
|
+
/**
|
|
14
|
+
* npm package specifier used to launch the MCP server (#793).
|
|
15
|
+
*
|
|
16
|
+
* We pin to the installed version rather than `@latest` so that `npx` does not
|
|
17
|
+
* re-resolve and reinstall the package on the first MCP reconnect after every
|
|
18
|
+
* sequant release — the reinstall was surfacing as an opaque
|
|
19
|
+
* `Failed to reconnect to sequant: -32000` when npx's cache was corrupted
|
|
20
|
+
* (npm ENOTEMPTY). `setup`/`update` (re)write this pin, so the MCP server
|
|
21
|
+
* tracks new releases when the user runs `sequant update` — matching how the
|
|
22
|
+
* plugin cache already pins. See docs/troubleshooting.md ("MCP Server Issues").
|
|
23
|
+
*
|
|
24
|
+
* Falls back to `latest` if the installed version cannot be resolved, so a
|
|
25
|
+
* failed lookup never writes a bogus `sequant@0.0.0` pin into `.mcp.json`.
|
|
26
|
+
*/
|
|
27
|
+
export function getSequantPackageSpec() {
|
|
28
|
+
const version = getVersion();
|
|
29
|
+
return version && version !== "0.0.0"
|
|
30
|
+
? `sequant@${version}`
|
|
31
|
+
: "sequant@latest";
|
|
32
|
+
}
|
|
12
33
|
/**
|
|
13
34
|
* Clients that need an explicit cwd because they don't run from the project directory.
|
|
14
35
|
*/
|
|
@@ -25,7 +46,7 @@ const CLIENTS_NEEDING_CWD = new Set([
|
|
|
25
46
|
export function getSequantMcpConfig(options) {
|
|
26
47
|
const config = {
|
|
27
48
|
command: "npx",
|
|
28
|
-
args: ["-y",
|
|
49
|
+
args: ["-y", getSequantPackageSpec(), "serve"],
|
|
29
50
|
};
|
|
30
51
|
// Add cwd for clients that don't run from the project directory
|
|
31
52
|
if (options?.clientType && CLIENTS_NEEDING_CWD.has(options.clientType)) {
|
|
@@ -170,3 +191,58 @@ export function createProjectMcpJson(projectDir) {
|
|
|
170
191
|
}
|
|
171
192
|
return { created: true, merged: false, skipped: false };
|
|
172
193
|
}
|
|
194
|
+
/**
|
|
195
|
+
* Re-pin an existing project `.mcp.json` sequant entry to the installed version (#793).
|
|
196
|
+
*
|
|
197
|
+
* Unlike {@link createProjectMcpJson} (which skips when a sequant entry already
|
|
198
|
+
* exists), this is the `update`/`sync` path: it refreshes the version pin so the
|
|
199
|
+
* MCP server tracks the release the user just updated to. It only rewrites the
|
|
200
|
+
* `sequant@<version>` token inside `args` and leaves everything else untouched.
|
|
201
|
+
*
|
|
202
|
+
* No-ops (returns `updated: false`) when:
|
|
203
|
+
* - `.mcp.json` doesn't exist (`no-file`) — we never create it here; that's init's job
|
|
204
|
+
* - there's no sequant server entry (`no-entry`)
|
|
205
|
+
* - the entry uses a local-binary form with no `sequant@…` arg (`no-pin`) — a
|
|
206
|
+
* deliberate contributor override we must not clobber
|
|
207
|
+
* - the pin already matches the installed version (`already-current`)
|
|
208
|
+
*
|
|
209
|
+
* With `opts.dryRun`, computes `from`/`to` and returns `updated: true` for a
|
|
210
|
+
* pending change but does not write the file — the caller reports it as a preview.
|
|
211
|
+
*/
|
|
212
|
+
export function syncSequantMcpPin(projectDir, opts) {
|
|
213
|
+
const mcpJsonPath = path.resolve(projectDir ?? ".", PROJECT_MCP_JSON);
|
|
214
|
+
if (!fs.existsSync(mcpJsonPath)) {
|
|
215
|
+
return { updated: false, reason: "no-file" };
|
|
216
|
+
}
|
|
217
|
+
let config;
|
|
218
|
+
try {
|
|
219
|
+
config = JSON.parse(fs.readFileSync(mcpJsonPath, "utf-8"));
|
|
220
|
+
}
|
|
221
|
+
catch {
|
|
222
|
+
// Corrupt file — leave it alone rather than overwriting user content.
|
|
223
|
+
return { updated: false, reason: "no-file" };
|
|
224
|
+
}
|
|
225
|
+
const servers = config?.mcpServers;
|
|
226
|
+
const sequant = servers?.sequant;
|
|
227
|
+
if (!sequant) {
|
|
228
|
+
return { updated: false, reason: "no-entry" };
|
|
229
|
+
}
|
|
230
|
+
const args = sequant.args;
|
|
231
|
+
if (!Array.isArray(args)) {
|
|
232
|
+
return { updated: false, reason: "no-pin" };
|
|
233
|
+
}
|
|
234
|
+
const pinIndex = args.findIndex((a) => typeof a === "string" && a.startsWith("sequant@"));
|
|
235
|
+
if (pinIndex === -1) {
|
|
236
|
+
return { updated: false, reason: "no-pin" };
|
|
237
|
+
}
|
|
238
|
+
const from = args[pinIndex];
|
|
239
|
+
const to = getSequantPackageSpec();
|
|
240
|
+
if (from === to) {
|
|
241
|
+
return { updated: false, reason: "already-current" };
|
|
242
|
+
}
|
|
243
|
+
if (!opts?.dryRun) {
|
|
244
|
+
args[pinIndex] = to;
|
|
245
|
+
fs.writeFileSync(mcpJsonPath, JSON.stringify(config, null, 2) + "\n");
|
|
246
|
+
}
|
|
247
|
+
return { updated: true, from, to };
|
|
248
|
+
}
|
|
@@ -2,11 +2,30 @@
|
|
|
2
2
|
* Combined branch testing (AC-1)
|
|
3
3
|
*
|
|
4
4
|
* Creates a temporary branch merging all feature branches from a run batch,
|
|
5
|
-
*
|
|
5
|
+
* reinstalls dependencies when the merge moved a lockfile, then runs the
|
|
6
|
+
* project's test and build scripts on the combined state and reports results.
|
|
6
7
|
*/
|
|
7
8
|
import type { BranchInfo, CheckResult, BranchCheckResult, CheckFinding } from "./types.js";
|
|
9
|
+
import { resolveFailureReason, type CommandResult } from "./command-result.js";
|
|
10
|
+
export { resolveFailureReason, type CommandResult };
|
|
8
11
|
/**
|
|
9
|
-
*
|
|
12
|
+
* Run a package-manager command line (e.g. "npm ci", "pnpm run build").
|
|
13
|
+
*
|
|
14
|
+
* @param command Full command line, as stored in PM_CONFIG
|
|
15
|
+
* @param cwd Working directory
|
|
16
|
+
* @param timeoutMs Kill the command after this long
|
|
17
|
+
* @internal Exported for testing
|
|
18
|
+
*/
|
|
19
|
+
export declare function runPackageManagerCommand(command: string, cwd: string, timeoutMs: number): CommandResult;
|
|
20
|
+
/**
|
|
21
|
+
* Whether any lockfile differs between `baseRef` and the current HEAD.
|
|
22
|
+
*
|
|
23
|
+
* @internal Exported for testing
|
|
24
|
+
*/
|
|
25
|
+
export declare function lockfileChanged(repoRoot: string, baseRef: string): boolean;
|
|
26
|
+
/**
|
|
27
|
+
* Create temp branch, merge all feature branches, reinstall dependencies if the
|
|
28
|
+
* lockfile moved, then run tests and build.
|
|
10
29
|
*
|
|
11
30
|
* @param branches - Feature branches to merge
|
|
12
31
|
* @param repoRoot - Path to the git repository root
|