specrails-core 5.5.1 → 6.0.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 +27 -145
- package/bin/specrails-core.mjs +12 -554
- package/dist/agent-runtime/capabilities.js +0 -1
- package/dist/agent-runtime/cli-executor.d.ts +1 -1
- package/dist/agent-runtime/cli-executor.js +4 -3
- package/dist/agent-runtime/cli-process.js +0 -1
- package/dist/agent-runtime/cli.d.ts +8 -0
- package/dist/agent-runtime/cli.js +31 -5
- package/dist/agent-runtime/codex-schema.js +0 -1
- package/dist/agent-runtime/compact/architect.d.ts +3 -272
- package/dist/agent-runtime/compact/architect.js +8 -9
- package/dist/agent-runtime/compact/chat-client.d.ts +3 -3
- package/dist/agent-runtime/compact/chat-client.js +1 -2
- package/dist/agent-runtime/compact/developer.d.ts +3 -70
- package/dist/agent-runtime/compact/developer.js +13 -14
- package/dist/agent-runtime/compact/environment.d.ts +4 -5
- package/dist/agent-runtime/compact/environment.js +1 -2
- package/dist/agent-runtime/compact/exit-code-honesty.d.ts +2 -1
- package/dist/agent-runtime/compact/exit-code-honesty.js +0 -1
- package/dist/agent-runtime/compact/guarded-loop.d.ts +2 -18
- package/dist/agent-runtime/compact/guarded-loop.js +7 -8
- package/dist/agent-runtime/compact/prompt-inputs.d.ts +0 -2
- package/dist/agent-runtime/compact/prompt-inputs.js +1 -2
- package/dist/agent-runtime/compact/reviewer.d.ts +0 -13
- package/dist/agent-runtime/compact/reviewer.js +5 -6
- package/dist/agent-runtime/compact/step.d.ts +0 -1
- package/dist/agent-runtime/compact/step.js +1 -2
- package/dist/agent-runtime/compact/test-reachability.js +0 -1
- package/dist/agent-runtime/config.js +0 -1
- package/dist/agent-runtime/core-host.d.ts +1 -1
- package/dist/agent-runtime/core-host.js +5 -3
- package/dist/agent-runtime/durable-store.d.ts +0 -1
- package/dist/agent-runtime/durable-store.js +1 -2
- package/dist/agent-runtime/efficiency-summary.d.ts +2 -2
- package/dist/agent-runtime/efficiency-summary.js +1 -2
- package/dist/agent-runtime/efficiency-types.js +0 -1
- package/dist/agent-runtime/efficiency.js +0 -1
- package/dist/agent-runtime/evaluation-corpus.js +0 -1
- package/dist/agent-runtime/evaluation.d.ts +2 -1
- package/dist/agent-runtime/evaluation.js +1 -2
- package/dist/agent-runtime/executor-types.d.ts +1 -1
- package/dist/agent-runtime/executor-types.js +0 -1
- package/dist/agent-runtime/executors.js +0 -1
- package/dist/agent-runtime/gemini-policy.js +0 -1
- package/dist/agent-runtime/graph/artifacts.d.ts +1 -1
- package/dist/agent-runtime/graph/artifacts.js +11 -5
- package/dist/agent-runtime/graph/nodes.d.ts +1 -1
- package/dist/agent-runtime/graph/nodes.js +1 -2
- package/dist/agent-runtime/graph/review-policy.js +0 -1
- package/dist/agent-runtime/graph/roles.d.ts +2 -5
- package/dist/agent-runtime/graph/roles.js +2 -8
- package/dist/agent-runtime/graph/state.d.ts +1 -1
- package/dist/agent-runtime/graph/state.js +0 -1
- package/dist/agent-runtime/graph-checkpointer.d.ts +2 -1
- package/dist/agent-runtime/graph-checkpointer.js +0 -1
- package/dist/agent-runtime/guardrails.d.ts +3 -3
- package/dist/agent-runtime/guardrails.js +1 -2
- package/dist/agent-runtime/index.d.ts +2 -1
- package/dist/agent-runtime/index.js +2 -2
- package/dist/agent-runtime/kimi-acp.js +1 -2
- package/dist/agent-runtime/kimi-model.d.ts +6 -0
- package/dist/agent-runtime/kimi-model.js +12 -0
- package/dist/agent-runtime/openai-executor.d.ts +0 -9
- package/dist/agent-runtime/openai-executor.js +6 -7
- package/dist/agent-runtime/openspec-tool-server.js +1 -2
- package/dist/agent-runtime/openspec.d.ts +0 -2
- package/dist/agent-runtime/openspec.js +3 -7
- package/dist/agent-runtime/prompts.d.ts +4 -3
- package/dist/agent-runtime/prompts.js +0 -1
- package/dist/agent-runtime/provider-diagnostic.js +1 -2
- package/dist/agent-runtime/recovery.d.ts +46 -0
- package/dist/agent-runtime/recovery.js +169 -0
- package/dist/agent-runtime/repository-context.d.ts +1 -1
- package/dist/agent-runtime/repository-context.js +0 -1
- package/dist/agent-runtime/review-context.d.ts +1 -1
- package/dist/agent-runtime/review-context.js +0 -1
- package/dist/agent-runtime/role-routing.js +0 -1
- package/dist/agent-runtime/role-state.js +0 -1
- package/dist/agent-runtime/runtime-identity.js +1 -2
- package/dist/agent-runtime/tool-event.js +0 -1
- package/dist/agent-runtime/verification-plan.d.ts +5 -4
- package/dist/agent-runtime/verification-plan.js +1 -2
- package/dist/agent-runtime/workflow-types.js +0 -1
- package/dist/agent-runtime/workflow.js +0 -1
- package/dist/agent-runtime/workspace-tools.d.ts +2 -2
- package/dist/agent-runtime/workspace-tools.js +1 -2
- package/dist/installer/cli.d.ts +3 -32
- package/dist/installer/cli.js +26 -101
- package/dist/installer/commands/framework.d.ts +4 -3
- package/dist/installer/commands/framework.js +0 -1
- package/dist/installer/commands/init.d.ts +4 -25
- package/dist/installer/commands/init.js +5 -8
- package/dist/installer/phases/framework-lifecycle.d.ts +3 -17
- package/dist/installer/phases/framework-lifecycle.js +2 -3
- package/dist/installer/phases/install-config.d.ts +7 -8
- package/dist/installer/phases/install-config.js +2 -7
- package/dist/installer/phases/manifest.d.ts +6 -7
- package/dist/installer/phases/manifest.js +2 -7
- package/dist/installer/phases/prereqs.d.ts +6 -7
- package/dist/installer/phases/prereqs.js +4 -6
- package/dist/installer/phases/provider-detect.d.ts +6 -7
- package/dist/installer/phases/provider-detect.js +2 -4
- package/dist/installer/phases/scaffold.d.ts +9 -10
- package/dist/installer/phases/scaffold.js +82 -805
- package/dist/installer/util/errors.js +0 -1
- package/dist/installer/util/exec.d.ts +3 -2
- package/dist/installer/util/exec.js +0 -1
- package/dist/installer/util/fs.d.ts +0 -10
- package/dist/installer/util/fs.js +1 -2
- package/dist/installer/util/git.js +0 -1
- package/dist/installer/util/install-transaction.d.ts +2 -2
- package/dist/installer/util/install-transaction.js +1 -2
- package/dist/installer/util/logger.d.ts +1 -3
- package/dist/installer/util/logger.js +0 -1
- package/dist/installer/util/paths.js +0 -1
- package/dist/installer/util/registry.d.ts +4 -8
- package/dist/installer/util/registry.js +2 -3
- package/dist/{installer/runtime → pipeline}/pipeline-state.js +0 -3
- package/dist/shared/args.d.ts +18 -0
- package/dist/shared/args.js +53 -0
- package/integration-contract.json +10 -46
- package/package.json +3 -10
- package/templates/agents/sr-architect.md +15 -310
- package/templates/agents/sr-developer.md +15 -269
- package/templates/agents/sr-reviewer.md +13 -367
- package/templates/codex-skills/rails/sr-architect/SKILL.md +14 -308
- package/templates/codex-skills/rails/sr-developer/SKILL.md +14 -201
- package/templates/codex-skills/rails/sr-reviewer/SKILL.md +15 -289
- package/templates/kimi/specrails/run-skill.mjs +91 -2173
- package/bin/tui-installer.mjs +0 -430
- package/commands/doctor.md +0 -62
- package/dist/agent-runtime/capabilities.js.map +0 -1
- package/dist/agent-runtime/cli-executor.js.map +0 -1
- package/dist/agent-runtime/cli-process.js.map +0 -1
- package/dist/agent-runtime/cli.js.map +0 -1
- package/dist/agent-runtime/codex-schema.js.map +0 -1
- package/dist/agent-runtime/compact/architect.js.map +0 -1
- package/dist/agent-runtime/compact/chat-client.js.map +0 -1
- package/dist/agent-runtime/compact/developer.js.map +0 -1
- package/dist/agent-runtime/compact/environment.js.map +0 -1
- package/dist/agent-runtime/compact/exit-code-honesty.js.map +0 -1
- package/dist/agent-runtime/compact/guarded-loop.js.map +0 -1
- package/dist/agent-runtime/compact/prompt-inputs.js.map +0 -1
- package/dist/agent-runtime/compact/reviewer.js.map +0 -1
- package/dist/agent-runtime/compact/step.js.map +0 -1
- package/dist/agent-runtime/compact/test-reachability.js.map +0 -1
- package/dist/agent-runtime/config.js.map +0 -1
- package/dist/agent-runtime/core-host.js.map +0 -1
- package/dist/agent-runtime/durable-store.js.map +0 -1
- package/dist/agent-runtime/efficiency-summary.js.map +0 -1
- package/dist/agent-runtime/efficiency-types.js.map +0 -1
- package/dist/agent-runtime/efficiency.js.map +0 -1
- package/dist/agent-runtime/evaluation-corpus.js.map +0 -1
- package/dist/agent-runtime/evaluation.js.map +0 -1
- package/dist/agent-runtime/executor-types.js.map +0 -1
- package/dist/agent-runtime/executors.js.map +0 -1
- package/dist/agent-runtime/gemini-policy.js.map +0 -1
- package/dist/agent-runtime/graph/artifacts.js.map +0 -1
- package/dist/agent-runtime/graph/nodes.js.map +0 -1
- package/dist/agent-runtime/graph/review-policy.js.map +0 -1
- package/dist/agent-runtime/graph/roles.js.map +0 -1
- package/dist/agent-runtime/graph/state.js.map +0 -1
- package/dist/agent-runtime/graph-checkpointer.js.map +0 -1
- package/dist/agent-runtime/guardrails.js.map +0 -1
- package/dist/agent-runtime/index.js.map +0 -1
- package/dist/agent-runtime/kimi-acp.js.map +0 -1
- package/dist/agent-runtime/openai-executor.js.map +0 -1
- package/dist/agent-runtime/openspec-tool-server.js.map +0 -1
- package/dist/agent-runtime/openspec.js.map +0 -1
- package/dist/agent-runtime/prompts.js.map +0 -1
- package/dist/agent-runtime/provider-diagnostic.js.map +0 -1
- package/dist/agent-runtime/repository-context.js.map +0 -1
- package/dist/agent-runtime/review-context.js.map +0 -1
- package/dist/agent-runtime/role-routing.js.map +0 -1
- package/dist/agent-runtime/role-state.js.map +0 -1
- package/dist/agent-runtime/runtime-identity.js.map +0 -1
- package/dist/agent-runtime/tool-event.js.map +0 -1
- package/dist/agent-runtime/verification-plan.js.map +0 -1
- package/dist/agent-runtime/workflow-types.js.map +0 -1
- package/dist/agent-runtime/workflow.js.map +0 -1
- package/dist/agent-runtime/workspace-tools.js.map +0 -1
- package/dist/installer/cli.js.map +0 -1
- package/dist/installer/commands/doctor.d.ts +0 -27
- package/dist/installer/commands/doctor.js +0 -615
- package/dist/installer/commands/doctor.js.map +0 -1
- package/dist/installer/commands/framework.js.map +0 -1
- package/dist/installer/commands/init.js.map +0 -1
- package/dist/installer/commands/update.d.ts +0 -56
- package/dist/installer/commands/update.js +0 -257
- package/dist/installer/commands/update.js.map +0 -1
- package/dist/installer/commands/v5-migration.d.ts +0 -32
- package/dist/installer/commands/v5-migration.js +0 -133
- package/dist/installer/commands/v5-migration.js.map +0 -1
- package/dist/installer/phases/framework-lifecycle.js.map +0 -1
- package/dist/installer/phases/install-config.js.map +0 -1
- package/dist/installer/phases/manifest.js.map +0 -1
- package/dist/installer/phases/prereqs.js.map +0 -1
- package/dist/installer/phases/provider-detect.js.map +0 -1
- package/dist/installer/phases/scaffold.js.map +0 -1
- package/dist/installer/runtime/kimi.d.ts +0 -84
- package/dist/installer/runtime/kimi.js +0 -255
- package/dist/installer/runtime/kimi.js.map +0 -1
- package/dist/installer/runtime/pipeline-state.js.map +0 -1
- package/dist/installer/util/errors.js.map +0 -1
- package/dist/installer/util/exec.js.map +0 -1
- package/dist/installer/util/fs.js.map +0 -1
- package/dist/installer/util/git.js.map +0 -1
- package/dist/installer/util/install-transaction.js.map +0 -1
- package/dist/installer/util/logger.js.map +0 -1
- package/dist/installer/util/paths.js.map +0 -1
- package/dist/installer/util/prompts.d.ts +0 -23
- package/dist/installer/util/prompts.js +0 -49
- package/dist/installer/util/prompts.js.map +0 -1
- package/dist/installer/util/registry.js.map +0 -1
- package/dist/installer/util/template.d.ts +0 -23
- package/dist/installer/util/template.js +0 -60
- package/dist/installer/util/template.js.map +0 -1
- package/docs/README.md +0 -40
- package/docs/agent-runtime-efficiency.md +0 -65
- package/docs/agent-runtime.md +0 -347
- package/docs/agents.md +0 -315
- package/docs/changelog.md +0 -168
- package/docs/ci-cd.md +0 -60
- package/docs/concepts.md +0 -183
- package/docs/customization.md +0 -363
- package/docs/deployment.md +0 -234
- package/docs/getting-started.md +0 -122
- package/docs/installation.md +0 -395
- package/docs/local-tickets.md +0 -191
- package/docs/migration-guide.md +0 -140
- package/docs/playbook-oss-maintainer.md +0 -112
- package/docs/playbook-parallel-dev.md +0 -124
- package/docs/playbook-product-discovery.md +0 -115
- package/docs/plugin-architecture.md +0 -144
- package/docs/research/codex-compatibility-analysis.md +0 -365
- package/docs/research/mcp-feasibility-analysis.md +0 -382
- package/docs/testing/test-matrix-codex.md +0 -130
- package/docs/updating.md +0 -89
- package/docs/user-docs/cli-reference.md +0 -428
- package/docs/user-docs/codex-vs-claude-code.md +0 -23
- package/docs/user-docs/core-updates.md +0 -70
- package/docs/user-docs/faq.md +0 -146
- package/docs/user-docs/getting-started-codex.md +0 -194
- package/docs/user-docs/getting-started-kimi.md +0 -423
- package/docs/user-docs/installation.md +0 -237
- package/docs/user-docs/provider-pipelines.md +0 -96
- package/docs/user-docs/quick-start.md +0 -161
- package/docs/windows.md +0 -78
- package/docs/workflows.md +0 -463
- package/schemas/profile.v1.json +0 -207
- package/templates/claude-md/CLAUDE-quickstart.md +0 -54
- package/templates/claude-md/root.md +0 -50
- package/templates/codex-skills/batch-implement/SKILL.md +0 -38
- package/templates/codex-skills/implement/SKILL.md +0 -38
- package/templates/codex-skills/retry/SKILL.md +0 -16
- package/templates/commands/specrails/compat-check.md +0 -271
- package/templates/commands/specrails/doctor.md +0 -62
- package/templates/commands/specrails/explore-spec.md +0 -173
- package/templates/commands/specrails/health-check.md +0 -527
- package/templates/commands/specrails/memory-inspect.md +0 -261
- package/templates/commands/specrails/opsx-diff.md +0 -419
- package/templates/commands/specrails/propose-spec.md +0 -102
- package/templates/commands/specrails/refactor-recommender.md +0 -169
- package/templates/commands/specrails/telemetry.md +0 -552
- package/templates/commands/specrails/why.md +0 -96
- package/templates/gemini-commands/batch-implement.toml +0 -37
- package/templates/gemini-commands/implement.toml +0 -37
- package/templates/gemini-commands/retry.toml +0 -15
- package/templates/profiles/default.json +0 -14
- package/templates/profiles/kimi-default.json +0 -15
- package/templates/rules/layer.md +0 -8
- package/templates/runtime/provider-pipeline.md +0 -113
- package/templates/security/security-exemptions.yaml +0 -20
- package/templates/settings/confidence-config.json +0 -17
- package/templates/settings/settings.json +0 -15
- /package/dist/{installer/runtime → pipeline}/pipeline-state.d.ts +0 -0
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Shape of the `.specrails/specrails-manifest.json` file the installer
|
|
3
|
-
* writes at install time.
|
|
4
|
-
* the `doctor` command, update.sh) parse it to detect template drift.
|
|
3
|
+
* writes at install time. specrails-desktop reads it to detect template drift.
|
|
5
4
|
*/
|
|
6
|
-
|
|
5
|
+
interface SpecrailsManifest {
|
|
7
6
|
version: string;
|
|
8
7
|
installed_at: string;
|
|
9
8
|
/** Provider inventory is emitted only by provider-aware lifecycle callers. */
|
|
@@ -15,12 +14,12 @@ export interface SpecrailsManifest {
|
|
|
15
14
|
* Computes a stable sha256 digest for a file, returned as `sha256:<hex>`.
|
|
16
15
|
*/
|
|
17
16
|
export declare function sha256Of(filePath: string): string;
|
|
18
|
-
|
|
17
|
+
interface BuildManifestInput {
|
|
19
18
|
/** Absolute path to the specrails-core source package directory. */
|
|
20
19
|
scriptDir: string;
|
|
21
20
|
/** Absolute path to the user's repo root where the manifest is written. */
|
|
22
21
|
repoRoot: string;
|
|
23
|
-
/**
|
|
22
|
+
/** specrails-core package version. */
|
|
24
23
|
version: string;
|
|
25
24
|
/** Override "installed_at" — exposed for deterministic testing. */
|
|
26
25
|
installedAt?: string;
|
|
@@ -29,8 +28,7 @@ export interface BuildManifestInput {
|
|
|
29
28
|
primaryProvider?: string;
|
|
30
29
|
}
|
|
31
30
|
/**
|
|
32
|
-
* Walks `templates/**`
|
|
33
|
-
* produces a stable-sorted manifest.
|
|
31
|
+
* Walks `templates/**` and produces a stable-sorted manifest.
|
|
34
32
|
*
|
|
35
33
|
* Stable-sort rule: artifact keys are sorted ascending by POSIX path.
|
|
36
34
|
*/
|
|
@@ -43,3 +41,4 @@ export declare function writeManifestFiles(repoRoot: string, manifest: Specrails
|
|
|
43
41
|
manifestPath: string;
|
|
44
42
|
versionPath: string;
|
|
45
43
|
};
|
|
44
|
+
export {};
|
|
@@ -12,8 +12,7 @@ export function sha256Of(filePath) {
|
|
|
12
12
|
return `sha256:${hash}`;
|
|
13
13
|
}
|
|
14
14
|
/**
|
|
15
|
-
* Walks `templates/**`
|
|
16
|
-
* produces a stable-sorted manifest.
|
|
15
|
+
* Walks `templates/**` and produces a stable-sorted manifest.
|
|
17
16
|
*
|
|
18
17
|
* Stable-sort rule: artifact keys are sorted ascending by POSIX path.
|
|
19
18
|
*/
|
|
@@ -25,8 +24,6 @@ export function buildManifest(input) {
|
|
|
25
24
|
const rel = path.relative(input.scriptDir, absFile).split(path.sep).join('/');
|
|
26
25
|
artifacts[rel] = sha256Of(absFile);
|
|
27
26
|
});
|
|
28
|
-
const doctorPath = path.join(input.scriptDir, 'commands', 'doctor.md');
|
|
29
|
-
artifacts['commands/specrails/doctor.md'] = sha256Of(doctorPath);
|
|
30
27
|
const manifest = {
|
|
31
28
|
version: input.version,
|
|
32
29
|
installed_at,
|
|
@@ -71,8 +68,7 @@ export function writeManifestFiles(repoRoot, manifest) {
|
|
|
71
68
|
}
|
|
72
69
|
/**
|
|
73
70
|
* Enumerates files under `templates/` excluding `node_modules/` and
|
|
74
|
-
* package-lock files
|
|
75
|
-
* find ... -not -path "(star)/node_modules/(star)" -not -name 'package-lock.json'
|
|
71
|
+
* package-lock files.
|
|
76
72
|
*/
|
|
77
73
|
function walkManifestSources(root) {
|
|
78
74
|
const collected = [];
|
|
@@ -111,4 +107,3 @@ function sortKeys(obj) {
|
|
|
111
107
|
}
|
|
112
108
|
return out;
|
|
113
109
|
}
|
|
114
|
-
//# sourceMappingURL=manifest.js.map
|
|
@@ -8,13 +8,12 @@ import { type Provider, type ProviderAvailability } from './provider-detect.js';
|
|
|
8
8
|
export declare const MIN_NODE_VERSION = "20.19.0";
|
|
9
9
|
export declare function isSupportedNodeVersion(version: string): boolean;
|
|
10
10
|
/**
|
|
11
|
-
* Phase 1 prerequisite bundle.
|
|
12
|
-
* with explicit options rather than a grab-bag of globals.
|
|
11
|
+
* Phase 1 prerequisite bundle.
|
|
13
12
|
*
|
|
14
13
|
* Returns the resolved inputs later phases need — primarily the
|
|
15
14
|
* selected provider and the detected CLI availability.
|
|
16
15
|
*/
|
|
17
|
-
|
|
16
|
+
interface PrereqOptions {
|
|
18
17
|
/** Absolute path to the target repository root. */
|
|
19
18
|
repoRoot: string;
|
|
20
19
|
/** --yes / -y equivalent — auto-init git, skip interactive prompts. */
|
|
@@ -24,7 +23,7 @@ export interface PrereqOptions {
|
|
|
24
23
|
/** SPECRAILS_SKIP_PREREQS=1 equivalent — relax hard failures for CI. */
|
|
25
24
|
skipPrereqs: boolean;
|
|
26
25
|
}
|
|
27
|
-
|
|
26
|
+
interface PrereqResult {
|
|
28
27
|
availability: ProviderAvailability;
|
|
29
28
|
provider: Provider;
|
|
30
29
|
/**
|
|
@@ -36,7 +35,7 @@ export interface PrereqResult {
|
|
|
36
35
|
*/
|
|
37
36
|
ossSignals: OssSignals;
|
|
38
37
|
}
|
|
39
|
-
|
|
38
|
+
interface OssSignals {
|
|
40
39
|
hasGh: boolean;
|
|
41
40
|
publicRepo: boolean;
|
|
42
41
|
hasCi: boolean;
|
|
@@ -45,7 +44,7 @@ export interface OssSignals {
|
|
|
45
44
|
}
|
|
46
45
|
/**
|
|
47
46
|
* Orchestrates every prerequisite check that must pass before the
|
|
48
|
-
* installer proceeds to Phase 3 (scaffolding).
|
|
49
|
-
* lines matching the retired bash output.
|
|
47
|
+
* installer proceeds to Phase 3 (scaffolding).
|
|
50
48
|
*/
|
|
51
49
|
export declare function checkPrerequisites(options: PrereqOptions): Promise<PrereqResult>;
|
|
50
|
+
export {};
|
|
@@ -28,8 +28,7 @@ export function isSupportedNodeVersion(version) {
|
|
|
28
28
|
}
|
|
29
29
|
/**
|
|
30
30
|
* Orchestrates every prerequisite check that must pass before the
|
|
31
|
-
* installer proceeds to Phase 3 (scaffolding).
|
|
32
|
-
* lines matching the retired bash output.
|
|
31
|
+
* installer proceeds to Phase 3 (scaffolding).
|
|
33
32
|
*/
|
|
34
33
|
export async function checkPrerequisites(options) {
|
|
35
34
|
const nodeVersion = process.versions.node;
|
|
@@ -42,8 +41,8 @@ export async function checkPrerequisites(options) {
|
|
|
42
41
|
if (!(await gitInstalled())) {
|
|
43
42
|
throw new PrerequisiteError('git is required but not on PATH. Install git: https://git-scm.com/');
|
|
44
43
|
}
|
|
45
|
-
// 1.1 Git repository — auto-init when --yes
|
|
46
|
-
//
|
|
44
|
+
// 1.1 Git repository — auto-init when --yes; otherwise the caller must
|
|
45
|
+
// provide a repository.
|
|
47
46
|
if (!(await isGitRepo(options.repoRoot))) {
|
|
48
47
|
if (!options.autoYes) {
|
|
49
48
|
throw new PrerequisiteError(`${options.repoRoot} is not a git repository. ` +
|
|
@@ -100,7 +99,7 @@ export async function checkPrerequisites(options) {
|
|
|
100
99
|
'the first workflow will report 401/login errors. Run `kimi login` if needed.');
|
|
101
100
|
}
|
|
102
101
|
}
|
|
103
|
-
// 1.4 npm — required
|
|
102
|
+
// 1.4 npm — required to run the pinned OpenSpec CLI through npx.
|
|
104
103
|
if (!(await commandExists('npm'))) {
|
|
105
104
|
if (options.skipPrereqs) {
|
|
106
105
|
warn('npm not found (skipped — SPECRAILS_SKIP_PREREQS=1)');
|
|
@@ -167,4 +166,3 @@ function hasCiWorkflows(repoRoot) {
|
|
|
167
166
|
return false;
|
|
168
167
|
return listDir(dir).some((p) => p.endsWith('.yml') || p.endsWith('.yaml'));
|
|
169
168
|
}
|
|
170
|
-
//# sourceMappingURL=prereqs.js.map
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Provider detection + authentication checks
|
|
3
|
-
* 1.2 / 1.3 branches of the retired install.sh.
|
|
2
|
+
* Provider detection + authentication checks (init Phase 1.2 / 1.3).
|
|
4
3
|
*/
|
|
5
4
|
export type Provider = 'claude' | 'codex' | 'gemini' | 'kimi';
|
|
6
5
|
/** Oldest TypeScript Kimi Code CLI release covered by this integration. */
|
|
@@ -13,7 +12,7 @@ export interface ProviderAvailability {
|
|
|
13
12
|
/** Optional so callers/tests predating Kimi still typecheck; absent = false. */
|
|
14
13
|
kimi?: boolean;
|
|
15
14
|
}
|
|
16
|
-
|
|
15
|
+
interface ProviderDerivedPaths {
|
|
17
16
|
/** Root directory inside the user's repo: `.claude` / `.codex` / `.gemini` / `.kimi-code`. */
|
|
18
17
|
providerDir: string;
|
|
19
18
|
/** Instructions file relative to the artifact root. */
|
|
@@ -57,14 +56,13 @@ export declare function resolveProvider(availability: ProviderAvailability, opti
|
|
|
57
56
|
*/
|
|
58
57
|
export declare function derivedPaths(provider: Provider): ProviderDerivedPaths;
|
|
59
58
|
/**
|
|
60
|
-
* Asserts that Claude Code is authenticated
|
|
61
|
-
*
|
|
62
|
-
* ~/.claude.json OAuth.
|
|
59
|
+
* Asserts that Claude Code is authenticated: `claude config list` →
|
|
60
|
+
* ANTHROPIC_API_KEY env → ~/.claude.json OAuth.
|
|
63
61
|
*/
|
|
64
62
|
export declare function assertClaudeAuthenticated(options?: {
|
|
65
63
|
skipPrereqs?: boolean;
|
|
66
64
|
}): Promise<void>;
|
|
67
|
-
|
|
65
|
+
type KimiAuthenticationStatus = 'authenticated' | 'unauthenticated' | 'unknown';
|
|
68
66
|
/**
|
|
69
67
|
* Bounded, non-billing Kimi authentication probe.
|
|
70
68
|
*
|
|
@@ -87,3 +85,4 @@ export declare function assertKimiAuthenticated(options?: {
|
|
|
87
85
|
kimiCodeHome?: string;
|
|
88
86
|
env?: NodeJS.ProcessEnv;
|
|
89
87
|
}): Promise<KimiAuthenticationStatus>;
|
|
88
|
+
export {};
|
|
@@ -115,9 +115,8 @@ export function derivedPaths(provider) {
|
|
|
115
115
|
throw new ProviderError(`Unsupported provider: ${String(provider)}`);
|
|
116
116
|
}
|
|
117
117
|
/**
|
|
118
|
-
* Asserts that Claude Code is authenticated
|
|
119
|
-
*
|
|
120
|
-
* ~/.claude.json OAuth.
|
|
118
|
+
* Asserts that Claude Code is authenticated: `claude config list` →
|
|
119
|
+
* ANTHROPIC_API_KEY env → ~/.claude.json OAuth.
|
|
121
120
|
*/
|
|
122
121
|
export async function assertClaudeAuthenticated(options = {}) {
|
|
123
122
|
if (await hasClaudeApiKeyConfigured())
|
|
@@ -227,4 +226,3 @@ function compareVersionTriples(left, right) {
|
|
|
227
226
|
}
|
|
228
227
|
return 0;
|
|
229
228
|
}
|
|
230
|
-
//# sourceMappingURL=provider-detect.js.map
|
|
@@ -30,7 +30,7 @@ export declare function translateOpsxSkillCallsForGemini(body: string): string;
|
|
|
30
30
|
export declare function translateClaudeTextForKimi(body: string): string;
|
|
31
31
|
export declare function geminiAgentLimitMetadata(env?: NodeJS.ProcessEnv): string[];
|
|
32
32
|
/**
|
|
33
|
-
* Phase 2 + Phase 3 of
|
|
33
|
+
* Phase 2 + Phase 3 of init:
|
|
34
34
|
* - Detect prior installation state (.claude/.codex/openspec already present).
|
|
35
35
|
* - Create the directory skeleton.
|
|
36
36
|
* - Copy templates into `.specrails/setup-templates/` (the internal
|
|
@@ -41,7 +41,7 @@ export declare function geminiAgentLimitMetadata(env?: NodeJS.ProcessEnv): strin
|
|
|
41
41
|
* the user's live `.claude/agents/` and `.claude/commands/specrails/` dirs so
|
|
42
42
|
* the installer finishes in one pass — no follow-up wizard required.
|
|
43
43
|
*/
|
|
44
|
-
|
|
44
|
+
interface ScaffoldInput {
|
|
45
45
|
/** Absolute path to the specrails-core package (installed via npx). */
|
|
46
46
|
scriptDir: string;
|
|
47
47
|
/**
|
|
@@ -80,16 +80,14 @@ export interface ScaffoldInput {
|
|
|
80
80
|
*/
|
|
81
81
|
materializeAllAgents?: boolean;
|
|
82
82
|
}
|
|
83
|
-
|
|
83
|
+
interface ScaffoldResult {
|
|
84
84
|
existingSetup: boolean;
|
|
85
85
|
createdDirs: string[];
|
|
86
86
|
copiedFiles: number;
|
|
87
87
|
}
|
|
88
88
|
/**
|
|
89
89
|
* Returns true iff any of the provider directories already contains
|
|
90
|
-
* content.
|
|
91
|
-
* assumes `--yes`; the CLI dispatcher (bin/specrails-core.cjs) should
|
|
92
|
-
* have prompted before entering this phase.
|
|
90
|
+
* content.
|
|
93
91
|
*/
|
|
94
92
|
export declare function detectExistingSetup(input: Pick<ScaffoldInput, 'artifactRoot' | 'codeRoot' | 'providerDir'>): boolean;
|
|
95
93
|
/**
|
|
@@ -97,7 +95,7 @@ export declare function detectExistingSetup(input: Pick<ScaffoldInput, 'artifact
|
|
|
97
95
|
* .gitignore. Returns a summary for logging / tests.
|
|
98
96
|
*/
|
|
99
97
|
export declare function scaffoldInstallation(input: ScaffoldInput): ScaffoldResult;
|
|
100
|
-
|
|
98
|
+
interface InstallFrameworkInput {
|
|
101
99
|
/** Absolute path to the specrails-core package (templates/ + commands/). */
|
|
102
100
|
scriptDir: string;
|
|
103
101
|
/** Root of the versioned framework store, e.g. `<home>/.specrails/framework`. */
|
|
@@ -111,7 +109,7 @@ export interface InstallFrameworkInput {
|
|
|
111
109
|
/** Optional explicit agent allow-list (kept for parity with scaffold). */
|
|
112
110
|
selectedAgents?: string[];
|
|
113
111
|
}
|
|
114
|
-
|
|
112
|
+
interface InstallFrameworkResult {
|
|
115
113
|
/** `<frameworkDir>/<version>/<providerDir>` — root of the static subtree. */
|
|
116
114
|
providerFrameworkDir: string;
|
|
117
115
|
/** `<frameworkDir>/<version>` — the version root (also holds setup-templates/). */
|
|
@@ -141,7 +139,7 @@ export declare function installFramework(input: InstallFrameworkInput): InstallF
|
|
|
141
139
|
* provider links resolve through `current/...` and an update is a single swap.
|
|
142
140
|
*/
|
|
143
141
|
export declare function ensureCurrentSymlink(frameworkDir: string, version: string): void;
|
|
144
|
-
|
|
142
|
+
interface AssembleProjectWorkspaceInput {
|
|
145
143
|
/** The per-project workspace artifact root (= resolveArtifacts artifactRoot). */
|
|
146
144
|
workspace: string;
|
|
147
145
|
/** Root of the versioned framework store (the parent of `current/`). */
|
|
@@ -176,7 +174,7 @@ export interface AssembleProjectWorkspaceInput {
|
|
|
176
174
|
*/
|
|
177
175
|
copyStatics?: boolean;
|
|
178
176
|
}
|
|
179
|
-
|
|
177
|
+
interface AssembleProjectWorkspaceResult {
|
|
180
178
|
/** Per-linked-subtree mechanism, for diagnostics (copy-fallback loses O(1) swap). */
|
|
181
179
|
links: Record<string, 'symlink' | 'junction' | 'copy'>;
|
|
182
180
|
/** Agent ids whose memory dirs were seeded as real writable dirs. */
|
|
@@ -209,3 +207,4 @@ export declare function assembleProjectWorkspace(input: AssembleProjectWorkspace
|
|
|
209
207
|
* acknowledged interactively).
|
|
210
208
|
*/
|
|
211
209
|
export declare function writeGeminiAgentAcknowledgments(repoRoot: string, agentIds: string[], agentsBaseDir?: string): void;
|
|
210
|
+
export {};
|