specrails-core 5.6.0 → 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 +1 -2
- package/dist/agent-runtime/cli-process.js +0 -1
- package/dist/agent-runtime/cli.js +3 -4
- 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 +1 -2
- 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 +1 -2
- 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 +1 -1
- package/dist/agent-runtime/index.js +1 -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 +1 -6
- 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.js +1 -2
- 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/recovery.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 -393
- 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 -553
- 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
|
@@ -9,15 +9,6 @@ export interface OpenAICompatibleOptions {
|
|
|
9
9
|
idleTimeoutMs?: number;
|
|
10
10
|
}
|
|
11
11
|
export declare function parseStructuredText(text: string): Record<string, unknown> | undefined;
|
|
12
|
-
/** The agent loop an openai-compatible provider runs: compact host-driven pipelines by default. */
|
|
13
|
-
/** The OpenAI `reasoning_effort` tiers a compatible endpoint accepts. */
|
|
14
|
-
export declare const OPENAI_EFFORTS: readonly ["low", "medium", "high"];
|
|
15
|
-
export declare function resolveAgentLoop(provider: ApiProvider): 'compact' | 'free';
|
|
16
|
-
/** Compact runs: abort when NOTHING happens for this long (no tool call, reply or usage) — the real hang detector now that the wall clock is per task group. A non-streaming 16k reply at 20 tok/s is ~13 min, hence the margin. */
|
|
17
|
-
export declare const IDLE_TIMEOUT_MS: number;
|
|
18
|
-
export declare function resolveContextWindow(provider: ApiProvider): number;
|
|
19
|
-
/** The per-turn output budget the connection declares; undefined keeps the loop's default. */
|
|
20
|
-
export declare function resolveOutputBudget(provider: ApiProvider): number | undefined;
|
|
21
12
|
/** No SDK, gateway, tracing backend, paid probe, or mandatory key. */
|
|
22
13
|
export declare class OpenAICompatibleExecutor implements AgentExecutor {
|
|
23
14
|
private readonly provider;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { readVerificationEvidence } from '../
|
|
1
|
+
import { readVerificationEvidence } from '../pipeline/pipeline-state.js';
|
|
2
2
|
import { assertEffortSupported, unknownCapabilities } from './capabilities.js';
|
|
3
3
|
import { OpenSpecTools, OPENSPEC_TOOL_DEFINITION, openSpecPrompt } from './openspec.js';
|
|
4
4
|
import { AgentExecutionError, unknownUsage, validateAgentRequest } from './executor-types.js';
|
|
@@ -19,13 +19,13 @@ export function parseStructuredText(text) {
|
|
|
19
19
|
}
|
|
20
20
|
/** The agent loop an openai-compatible provider runs: compact host-driven pipelines by default. */
|
|
21
21
|
/** The OpenAI `reasoning_effort` tiers a compatible endpoint accepts. */
|
|
22
|
-
|
|
23
|
-
|
|
22
|
+
const OPENAI_EFFORTS = ['low', 'medium', 'high'];
|
|
23
|
+
function resolveAgentLoop(provider) { return provider.agentLoop ?? 'compact'; }
|
|
24
24
|
/** Compact runs: abort when NOTHING happens for this long (no tool call, reply or usage) — the real hang detector now that the wall clock is per task group. A non-streaming 16k reply at 20 tok/s is ~13 min, hence the margin. */
|
|
25
|
-
|
|
26
|
-
|
|
25
|
+
const IDLE_TIMEOUT_MS = 20 * 60_000;
|
|
26
|
+
function resolveContextWindow(provider) { return provider.contextWindowTokens ?? DEFAULT_CONTEXT_WINDOW_TOKENS; }
|
|
27
27
|
/** The per-turn output budget the connection declares; undefined keeps the loop's default. */
|
|
28
|
-
|
|
28
|
+
function resolveOutputBudget(provider) { return provider.maxOutputTokens; }
|
|
29
29
|
/** No SDK, gateway, tracing backend, paid probe, or mandatory key. */
|
|
30
30
|
export class OpenAICompatibleExecutor {
|
|
31
31
|
provider;
|
|
@@ -134,4 +134,3 @@ export class OpenAICompatibleExecutor {
|
|
|
134
134
|
}
|
|
135
135
|
}
|
|
136
136
|
}
|
|
137
|
-
//# sourceMappingURL=openai-executor.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { readVerificationEvidence } from '../
|
|
1
|
+
import { readVerificationEvidence } from '../pipeline/pipeline-state.js';
|
|
2
2
|
import { readFileSync } from 'node:fs';
|
|
3
3
|
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
4
4
|
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
|
|
@@ -34,4 +34,3 @@ if (context.evidenceScope && context.role !== 'architect')
|
|
|
34
34
|
}
|
|
35
35
|
});
|
|
36
36
|
await server.connect(new StdioServerTransport());
|
|
37
|
-
//# sourceMappingURL=openspec-tool-server.js.map
|
|
@@ -62,7 +62,6 @@ export declare const IMPLEMENTATION_PROGRESS_SCHEMA: z.ZodObject<{
|
|
|
62
62
|
}, z.core.$strict>>;
|
|
63
63
|
blockers: z.ZodArray<z.ZodString>;
|
|
64
64
|
}, z.core.$strict>;
|
|
65
|
-
export declare function renderProgressHandoff(context: OpenSpecRoleContext): string;
|
|
66
65
|
export declare function hash(text: string): string;
|
|
67
66
|
export declare function resolveOpenSpecCli(): string;
|
|
68
67
|
export declare function runOpenSpec(cli: string, root: string, args: string[], signal?: AbortSignal): Promise<string>;
|
|
@@ -98,7 +97,6 @@ export declare class OpenSpecTools {
|
|
|
98
97
|
assertParticipation(after?: number): void;
|
|
99
98
|
assertReady(): Promise<OpenSpecApply>;
|
|
100
99
|
}
|
|
101
|
-
export declare const OPENSPEC_BRIDGE_ENTRY: string;
|
|
102
100
|
export declare const OPENSPEC_TOOL_ACTIONS: readonly ["load_skill", "new", "status", "instructions", "validate", "write_artifact", "read_progress", "write_progress"];
|
|
103
101
|
export declare const OPENSPEC_TOOL_DEFINITION: {
|
|
104
102
|
type: string;
|
|
@@ -36,10 +36,6 @@ function readProgress(context) {
|
|
|
36
36
|
return { notice: PROGRESS_NOTICE + ' Saved progress is unavailable or invalid; inspect the current diff and tasks before continuing.', record: null };
|
|
37
37
|
}
|
|
38
38
|
}
|
|
39
|
-
export function renderProgressHandoff(context) {
|
|
40
|
-
const saved = readProgress(context);
|
|
41
|
-
return saved.record ? `\n## Saved implementation progress\n${saved.notice}\n${JSON.stringify(saved.record)}\n` : saved.notice.includes('unavailable') ? '\n' + saved.notice + '\n' : '';
|
|
42
|
-
}
|
|
43
39
|
function writeProgress(context, input) {
|
|
44
40
|
if (context.role !== 'developer')
|
|
45
41
|
throw new Error('Only the developer may write implementation progress');
|
|
@@ -301,7 +297,7 @@ export class OpenSpecTools {
|
|
|
301
297
|
return apply;
|
|
302
298
|
}
|
|
303
299
|
}
|
|
304
|
-
|
|
300
|
+
const OPENSPEC_BRIDGE_ENTRY = fileURLToPath(new URL('./openspec-tool-server.js', import.meta.url));
|
|
305
301
|
export const OPENSPEC_TOOL_ACTIONS = ['load_skill', 'new', 'status', 'instructions', 'validate', 'write_artifact', 'read_progress', 'write_progress'];
|
|
306
302
|
export const OPENSPEC_TOOL_DEFINITION = { type: 'function', function: { name: 'openspec_workflow', description: 'Run the official OpenSpec role workflow. Load the skill first (developer/reviewer also receive real status, apply context and saved progress), then use its CLI instructions and write artifacts within the fixed change. Developer may save a bounded advisory handoff with write_progress; read_progress refreshes it. Progress never substitutes for verification.', parameters: { type: 'object', additionalProperties: false, required: ['action'], properties: { action: { type: 'string', enum: OPENSPEC_TOOL_ACTIONS }, artifact: { type: 'string' }, path: { type: 'string' }, content: { type: 'string' }, progress: {
|
|
307
303
|
type: 'object', additionalProperties: false, required: ['summary', 'completedTasks', 'nextTasks', 'checks', 'blockers'], properties: {
|
|
@@ -327,4 +323,3 @@ export function openSpecRepairPrompt(context) {
|
|
|
327
323
|
return `The previous ${context.role} result cannot be accepted because you omitted the required official OpenSpec workflow. Do not merely resend the JSON. Continue this same role with the work already available. Load ${ROLE_SKILLS[context.role]} using the scoped workflow tool (action=load_skill), consult status and instructions ${context.role === 'architect' ? 'tasks' : 'apply'}, and execute the complete returned skill procedure against the current artifacts and code. Reconcile your previous conclusions with that procedure; correct your report if necessary. Do not rerun the implementation or the host verification commands. ${context.role === 'reviewer' ? 'Stay read-only; do not modify code or artifacts.' : 'Keep already-correct work and respect the same frozen scope.'} Finish with the originally requested JSON report.
|
|
328
324
|
`;
|
|
329
325
|
}
|
|
330
|
-
//# sourceMappingURL=openspec.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { AgentRole } from './executor-types.js';
|
|
2
|
-
import type { PipelineContext, VerificationCommand } from '../
|
|
2
|
+
import type { PipelineContext, VerificationCommand } from '../pipeline/pipeline-state.js';
|
|
3
3
|
import { type ReviewPolicy } from './graph/review-policy.js';
|
|
4
4
|
import type { DeveloperRecord } from './graph/state.js';
|
|
5
5
|
/** Bump whenever the wording changes: the version is part of the frozen run identity. */
|
|
@@ -15,7 +15,7 @@ export interface FrozenCriterion {
|
|
|
15
15
|
requirement: string;
|
|
16
16
|
}
|
|
17
17
|
/** Roles with an editable definition: the three pipeline agents plus the FIXER stance the developer role takes on a correction round. */
|
|
18
|
-
|
|
18
|
+
type PromptRole = AgentRole | 'fixer';
|
|
19
19
|
export interface RoleInstructionOptions {
|
|
20
20
|
definition?: string;
|
|
21
21
|
/** `fixer`: the developer invocation is a correction round on the fixer stance (own definition, no plan dump). */
|
|
@@ -39,7 +39,7 @@ export declare const DEVELOPER_OUTPUT_SCHEMA: Record<string, unknown>;
|
|
|
39
39
|
export declare const REVIEW_OUTPUT_SCHEMA: Record<string, unknown>;
|
|
40
40
|
/** Actual editable task definitions; dynamic scope and output contracts are assembled separately. */
|
|
41
41
|
export declare function rolePromptDefaults(): Record<PromptRole, string>;
|
|
42
|
-
|
|
42
|
+
interface ReReviewContext {
|
|
43
43
|
changes: Array<{
|
|
44
44
|
repositoryId: string;
|
|
45
45
|
path: string;
|
|
@@ -61,3 +61,4 @@ export declare function correctionInstructions(role: AgentRole, feedback: RoleFe
|
|
|
61
61
|
export declare function deepenInstructions(question: string | undefined): string;
|
|
62
62
|
/** Asks a structured role to resend a malformed reply without repeating its work. */
|
|
63
63
|
export declare function repairInstructions(role: AgentRole, problem: string): string;
|
|
64
|
+
export {};
|
|
@@ -357,4 +357,3 @@ export function deepenInstructions(question) {
|
|
|
357
357
|
export function repairInstructions(role, problem) {
|
|
358
358
|
return `Your previous reply could not be used: ${problem}\n\nDo not redo the ${role} work. Reply again with exactly one JSON object matching the output contract, with no prose before or after it and no Markdown fence.\n`;
|
|
359
359
|
}
|
|
360
|
-
//# sourceMappingURL=prompts.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { redactRuntimeText } from '../
|
|
1
|
+
import { redactRuntimeText } from '../pipeline/pipeline-state.js';
|
|
2
2
|
import { stripVTControlCharacters } from 'node:util';
|
|
3
3
|
/** Keep provider errors visible without dumping full output, prompts or credentials. */
|
|
4
4
|
export function providerDiagnostic(stdout, stderr, env = process.env) {
|
|
@@ -22,4 +22,3 @@ export function providerDiagnostic(stdout, stderr, env = process.env) {
|
|
|
22
22
|
message = stripVTControlCharacters(message);
|
|
23
23
|
return redactRuntimeText(message, env).replace(/\s+/g, ' ').slice(0, 1200).trim();
|
|
24
24
|
}
|
|
25
|
-
//# sourceMappingURL=provider-diagnostic.js.map
|
|
@@ -6,7 +6,7 @@ import { WorkspaceTools } from './workspace-tools.js';
|
|
|
6
6
|
import { artifactPath, hash, resolveOpenSpecCli, runOpenSpec } from './openspec.js';
|
|
7
7
|
import { write } from './graph/artifacts.js';
|
|
8
8
|
import { expandedPlanCommands, readVerificationPlan } from './verification-plan.js';
|
|
9
|
-
import { inspectPipeline, pipelineStateDirectory, validatePipelineContext, verifyPipeline } from '../
|
|
9
|
+
import { inspectPipeline, pipelineStateDirectory, validatePipelineContext, verifyPipeline } from '../pipeline/pipeline-state.js';
|
|
10
10
|
const file = { repositoryId: z.string().min(1).max(128), path: z.string().min(1).max(1024) };
|
|
11
11
|
const operation = { operationId: z.string().uuid(), reason: z.string().trim().min(1).max(2000), acknowledgeInterrupted: z.boolean().optional(), changedPrecondition: z.string().trim().min(1).max(2000).optional() };
|
|
12
12
|
export const recoveryRequestSchema = z.discriminatedUnion('action', [
|
|
@@ -167,4 +167,3 @@ export async function runRecovery(contextInput, input, signal) {
|
|
|
167
167
|
await release();
|
|
168
168
|
}
|
|
169
169
|
}
|
|
170
|
-
//# sourceMappingURL=recovery.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { PipelineContext } from '../
|
|
1
|
+
import type { PipelineContext } from '../pipeline/pipeline-state.js';
|
|
2
2
|
/** Small, provider-independent map of facts from the admitted checkout. Never
|
|
3
3
|
* follows a documentation link out of scope or invents verification commands. */
|
|
4
4
|
export interface RepositoryContextEntry {
|
|
@@ -38,4 +38,3 @@ export function reviewChanges(previous, current) {
|
|
|
38
38
|
const transversal = changes.some(change => TRANSVERSAL.test(change.path));
|
|
39
39
|
return { mode: transversal ? 'full' : 'incremental', reason: transversal ? 'A shared contract, build, dependency or security input changed' : 'Changes since the previous reviewed candidate', changes };
|
|
40
40
|
}
|
|
41
|
-
//# sourceMappingURL=review-context.js.map
|
|
@@ -21,7 +21,7 @@ export function runtimePackageIntegrity(root = fileURLToPath(new URL('../../', i
|
|
|
21
21
|
else
|
|
22
22
|
throw new Error('Runtime package contains a nonregular file: ' + relative);
|
|
23
23
|
};
|
|
24
|
-
for (const entry of ['package.json', 'dist', 'bin', 'templates', 'schemas', '
|
|
24
|
+
for (const entry of ['package.json', 'dist', 'bin', 'templates', 'schemas', 'integration-contract.json', 'pinned-versions.json']) {
|
|
25
25
|
if (existsSync(path.join(root, entry)))
|
|
26
26
|
visit(entry);
|
|
27
27
|
}
|
|
@@ -30,4 +30,3 @@ export function runtimePackageIntegrity(root = fileURLToPath(new URL('../../', i
|
|
|
30
30
|
export function sameRuntimeIdentity(left, right) {
|
|
31
31
|
return ['packageVersion', 'workflowVersion', 'instructionsVersion', 'packageIntegrity', 'apiVersion'].every(key => left[key] === right[key]);
|
|
32
32
|
}
|
|
33
|
-
//# sourceMappingURL=runtime-identity.js.map
|
|
@@ -21,4 +21,3 @@ export function toolEvent(tool, input) {
|
|
|
21
21
|
const cwd = args.workdir ?? args.cwd;
|
|
22
22
|
return { kind: 'tool-start', tool, ...(detail ? { detail } : {}), ...(targetPaths.length ? { targetPaths } : {}), ...(typeof cwd === 'string' ? { cwd } : {}) };
|
|
23
23
|
}
|
|
24
|
-
//# sourceMappingURL=tool-event.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type PipelineContext, type VerificationCommand } from '../
|
|
1
|
+
import { type PipelineContext, type VerificationCommand } from '../pipeline/pipeline-state.js';
|
|
2
2
|
export interface ProposedCheck {
|
|
3
3
|
kind: 'command' | 'harness';
|
|
4
4
|
key: string;
|
|
@@ -14,12 +14,12 @@ export interface ProposedCheck {
|
|
|
14
14
|
content: string;
|
|
15
15
|
}>;
|
|
16
16
|
}
|
|
17
|
-
|
|
17
|
+
interface HarnessSource {
|
|
18
18
|
path: string;
|
|
19
19
|
hash: string;
|
|
20
20
|
byteCount: number;
|
|
21
21
|
}
|
|
22
|
-
|
|
22
|
+
interface PlanEntry {
|
|
23
23
|
id: string;
|
|
24
24
|
key: string;
|
|
25
25
|
label: string;
|
|
@@ -31,7 +31,7 @@ export interface PlanEntry {
|
|
|
31
31
|
sources: HarnessSource[];
|
|
32
32
|
};
|
|
33
33
|
}
|
|
34
|
-
|
|
34
|
+
interface VerificationPlan {
|
|
35
35
|
schemaVersion: 1;
|
|
36
36
|
runId: string;
|
|
37
37
|
revision: number;
|
|
@@ -53,3 +53,4 @@ export declare function addDeveloperChecks(context: PipelineContext, proposals:
|
|
|
53
53
|
export declare function expandedPlanCommands(context: PipelineContext, plan: VerificationPlan): VerificationCommand[];
|
|
54
54
|
/** Bind the exact manifest and every source to lifecycle gates. */
|
|
55
55
|
export declare function bindPlan(context: PipelineContext, plan: VerificationPlan): void;
|
|
56
|
+
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { existsSync, readFileSync, statSync } from 'node:fs';
|
|
2
2
|
import path from 'node:path';
|
|
3
3
|
import { createHash } from 'node:crypto';
|
|
4
|
-
import { bindVerificationPlan, pipelineStateDirectory, validateVerificationRequest } from '../
|
|
4
|
+
import { bindVerificationPlan, pipelineStateDirectory, validateVerificationRequest } from '../pipeline/pipeline-state.js';
|
|
5
5
|
import { fingerprint } from './durable-store.js';
|
|
6
6
|
import { child, write } from './graph/artifacts.js';
|
|
7
7
|
const SAFE_ID = /^[a-zA-Z0-9][a-zA-Z0-9._-]{0,127}$/;
|
|
@@ -203,4 +203,3 @@ export function bindPlan(context, plan) {
|
|
|
203
203
|
}
|
|
204
204
|
bindVerificationPlan(context, plan.planHash, files);
|
|
205
205
|
}
|
|
206
|
-
//# sourceMappingURL=verification-plan.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { AgentRole } from './executor-types.js';
|
|
2
|
-
|
|
2
|
+
interface WorkspaceToolDefinition {
|
|
3
3
|
type: 'function';
|
|
4
4
|
function: {
|
|
5
5
|
name: string;
|
|
@@ -7,7 +7,6 @@ export interface WorkspaceToolDefinition {
|
|
|
7
7
|
parameters: Record<string, unknown>;
|
|
8
8
|
};
|
|
9
9
|
}
|
|
10
|
-
export declare function isWithinRoot(root: string, file: string): boolean;
|
|
11
10
|
export declare function canonicalWorkspace(cwd: string, allowedRoots: string[]): {
|
|
12
11
|
cwd: string;
|
|
13
12
|
roots: string[];
|
|
@@ -27,3 +26,4 @@ export declare class WorkspaceTools {
|
|
|
27
26
|
private search;
|
|
28
27
|
private diff;
|
|
29
28
|
}
|
|
29
|
+
export {};
|
|
@@ -18,7 +18,7 @@ function integer(value, fallback, max) {
|
|
|
18
18
|
return value;
|
|
19
19
|
}
|
|
20
20
|
function digest(text) { return createHash('sha256').update(text).digest('hex'); }
|
|
21
|
-
|
|
21
|
+
function isWithinRoot(root, file) {
|
|
22
22
|
const relative = path.relative(root, file);
|
|
23
23
|
return relative === '' || (!path.isAbsolute(relative) && relative !== '..' && !relative.startsWith('..' + path.sep));
|
|
24
24
|
}
|
|
@@ -279,4 +279,3 @@ export class WorkspaceTools {
|
|
|
279
279
|
return JSON.stringify({ untracked: false, diff: '', truncated: false });
|
|
280
280
|
}
|
|
281
281
|
}
|
|
282
|
-
//# sourceMappingURL=workspace-tools.js.map
|
package/dist/installer/cli.d.ts
CHANGED
|
@@ -1,35 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* specrails-core CLI entry
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
* During the port, `bin/specrails-core.js` keeps shelling out to the
|
|
6
|
-
* shell scripts while this module carries the in-progress Node
|
|
7
|
-
* implementation. Once Phases 2–4 ship the command handlers and
|
|
8
|
-
* Phase 5 deletes the shell scripts, the `bin/` dispatcher collapses
|
|
9
|
-
* to a single `import { main } from './dist/installer/cli.js'` call.
|
|
2
|
+
* specrails-core CLI: the installer and runtime entry points Desktop drives.
|
|
3
|
+
* `bin/specrails-core.mjs` and a direct `node dist/installer/cli.js` run both
|
|
4
|
+
* land in {@link main}.
|
|
10
5
|
*/
|
|
11
|
-
export interface ParsedArgs {
|
|
12
|
-
subcommand: string | null;
|
|
13
|
-
flags: Record<string, string | boolean>;
|
|
14
|
-
positionals: string[];
|
|
15
|
-
}
|
|
16
|
-
/**
|
|
17
|
-
* Minimal arg parser, no external dep. Handles:
|
|
18
|
-
* subcommand (first bare positional)
|
|
19
|
-
* --flag (boolean true)
|
|
20
|
-
* --flag=value (string)
|
|
21
|
-
* --flag value (string, consumes next token)
|
|
22
|
-
* -h / --help (help alias)
|
|
23
|
-
* -v / --version (version alias)
|
|
24
|
-
* positionals (everything else)
|
|
25
|
-
*/
|
|
26
|
-
export declare function parseArgs(argv: string[]): ParsedArgs;
|
|
27
|
-
/**
|
|
28
|
-
* Sentinel exit code used during the port: when a Node command is not
|
|
29
|
-
* yet implemented, the CLI exits with this code and the outer bash
|
|
30
|
-
* dispatcher (bin/specrails-core.js) may choose to fall through to
|
|
31
|
-
* the shell path. Removed entirely in Phase 5 when no shell scripts
|
|
32
|
-
* remain.
|
|
33
|
-
*/
|
|
34
|
-
export declare const NOT_IMPLEMENTED = 2;
|
|
35
6
|
export declare function main(argv?: string[]): Promise<number>;
|
package/dist/installer/cli.js
CHANGED
|
@@ -1,100 +1,35 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* specrails-core CLI entry
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
* During the port, `bin/specrails-core.js` keeps shelling out to the
|
|
6
|
-
* shell scripts while this module carries the in-progress Node
|
|
7
|
-
* implementation. Once Phases 2–4 ship the command handlers and
|
|
8
|
-
* Phase 5 deletes the shell scripts, the `bin/` dispatcher collapses
|
|
9
|
-
* to a single `import { main } from './dist/installer/cli.js'` call.
|
|
2
|
+
* specrails-core CLI: the installer and runtime entry points Desktop drives.
|
|
3
|
+
* `bin/specrails-core.mjs` and a direct `node dist/installer/cli.js` run both
|
|
4
|
+
* land in {@link main}.
|
|
10
5
|
*/
|
|
11
6
|
import { readFileSync, realpathSync } from 'node:fs';
|
|
12
7
|
import path from 'node:path';
|
|
13
8
|
import { fileURLToPath, pathToFileURL } from 'node:url';
|
|
14
|
-
import { runDoctor } from './commands/doctor.js';
|
|
15
9
|
import { runAssemble, runInstallFramework, runSwapCurrent, } from './commands/framework.js';
|
|
16
10
|
import { runInit } from './commands/init.js';
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
11
|
+
import { runPipelineCommand } from '../pipeline/pipeline-state.js';
|
|
12
|
+
import { parseArgs } from '../shared/args.js';
|
|
19
13
|
import { isInstallerError } from './util/errors.js';
|
|
20
14
|
import { fatal } from './util/logger.js';
|
|
21
|
-
/**
|
|
22
|
-
* Minimal arg parser, no external dep. Handles:
|
|
23
|
-
* subcommand (first bare positional)
|
|
24
|
-
* --flag (boolean true)
|
|
25
|
-
* --flag=value (string)
|
|
26
|
-
* --flag value (string, consumes next token)
|
|
27
|
-
* -h / --help (help alias)
|
|
28
|
-
* -v / --version (version alias)
|
|
29
|
-
* positionals (everything else)
|
|
30
|
-
*/
|
|
31
|
-
export function parseArgs(argv) {
|
|
32
|
-
const flags = {};
|
|
33
|
-
const positionals = [];
|
|
34
|
-
let subcommand = null;
|
|
35
|
-
for (let i = 0; i < argv.length; i++) {
|
|
36
|
-
const token = argv[i];
|
|
37
|
-
if (token.startsWith('--')) {
|
|
38
|
-
const rest = token.slice(2);
|
|
39
|
-
const eq = rest.indexOf('=');
|
|
40
|
-
if (eq >= 0) {
|
|
41
|
-
flags[rest.slice(0, eq)] = rest.slice(eq + 1);
|
|
42
|
-
}
|
|
43
|
-
else {
|
|
44
|
-
const peek = argv[i + 1];
|
|
45
|
-
if (peek !== undefined && !peek.startsWith('-')) {
|
|
46
|
-
flags[rest] = peek;
|
|
47
|
-
i++;
|
|
48
|
-
}
|
|
49
|
-
else {
|
|
50
|
-
flags[rest] = true;
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
else if (token === '-h') {
|
|
55
|
-
flags.help = true;
|
|
56
|
-
}
|
|
57
|
-
else if (token === '-v') {
|
|
58
|
-
flags.version = true;
|
|
59
|
-
}
|
|
60
|
-
else if (token.startsWith('-') && token.length > 1) {
|
|
61
|
-
flags[token.slice(1)] = true;
|
|
62
|
-
}
|
|
63
|
-
else {
|
|
64
|
-
if (subcommand === null) {
|
|
65
|
-
subcommand = token;
|
|
66
|
-
}
|
|
67
|
-
else {
|
|
68
|
-
positionals.push(token);
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
return { subcommand, flags, positionals };
|
|
73
|
-
}
|
|
74
15
|
function usageText() {
|
|
75
16
|
return [
|
|
76
17
|
'',
|
|
77
|
-
'specrails-core —
|
|
18
|
+
'specrails-core — agent workflow engine for specrails-desktop',
|
|
78
19
|
'',
|
|
79
20
|
'Usage:',
|
|
80
21
|
' specrails-core <command> [options]',
|
|
81
22
|
'',
|
|
82
23
|
'Commands:',
|
|
83
|
-
' init Install specrails into a repository',
|
|
84
|
-
' update Update an existing specrails installation',
|
|
85
|
-
' pipeline Inspect and execute durable implementation phases',
|
|
86
|
-
' runtime Run, inspect and resume programmatic agents',
|
|
87
|
-
' doctor Diagnose the health of an existing installation',
|
|
24
|
+
' init Install specrails into a repository (claude, codex, gemini, or kimi)',
|
|
88
25
|
' install-framework Materialize the versioned framework (offline)',
|
|
89
26
|
' swap-current Point framework/current at a version (offline)',
|
|
90
|
-
' assemble
|
|
27
|
+
' assemble Link the framework into a project workspace (offline)',
|
|
28
|
+
' pipeline Inspect and verify durable implementation phases',
|
|
29
|
+
' runtime Run, inspect and resume programmatic agents',
|
|
91
30
|
' help Show this help message',
|
|
92
31
|
' version Print the installed version',
|
|
93
32
|
'',
|
|
94
|
-
'Global options:',
|
|
95
|
-
' -h, --help Show this help',
|
|
96
|
-
' -v, --version Print version',
|
|
97
|
-
'',
|
|
98
33
|
].join('\n');
|
|
99
34
|
}
|
|
100
35
|
function readVersion() {
|
|
@@ -113,30 +48,15 @@ function readVersion() {
|
|
|
113
48
|
return 'unknown';
|
|
114
49
|
}
|
|
115
50
|
}
|
|
116
|
-
|
|
117
|
-
* Sentinel exit code used during the port: when a Node command is not
|
|
118
|
-
* yet implemented, the CLI exits with this code and the outer bash
|
|
119
|
-
* dispatcher (bin/specrails-core.js) may choose to fall through to
|
|
120
|
-
* the shell path. Removed entirely in Phase 5 when no shell scripts
|
|
121
|
-
* remain.
|
|
122
|
-
*/
|
|
123
|
-
export const NOT_IMPLEMENTED = 2;
|
|
124
|
-
async function dispatch(subcommand, flags, _positionals) {
|
|
51
|
+
async function dispatch(subcommand, flags, positionals) {
|
|
125
52
|
switch (subcommand) {
|
|
126
53
|
case 'init':
|
|
127
54
|
await runInit(flags);
|
|
128
55
|
return 0;
|
|
129
|
-
case 'update':
|
|
130
|
-
await runUpdate(flags);
|
|
131
|
-
return 0;
|
|
132
56
|
case 'pipeline':
|
|
133
|
-
return runPipelineCommand(flags,
|
|
57
|
+
return runPipelineCommand(flags, positionals);
|
|
134
58
|
case 'runtime':
|
|
135
|
-
return (await import('../agent-runtime/cli.js')).runRuntimeCommand(flags,
|
|
136
|
-
case 'doctor': {
|
|
137
|
-
const result = await runDoctor(flags);
|
|
138
|
-
return result.failed === 0 ? 0 : 1;
|
|
139
|
-
}
|
|
59
|
+
return (await import('../agent-runtime/cli.js')).runRuntimeCommand(flags, positionals);
|
|
140
60
|
case 'install-framework':
|
|
141
61
|
await runInstallFramework(flags);
|
|
142
62
|
return 0;
|
|
@@ -147,7 +67,6 @@ async function dispatch(subcommand, flags, _positionals) {
|
|
|
147
67
|
await runAssemble(flags);
|
|
148
68
|
return 0;
|
|
149
69
|
case 'help':
|
|
150
|
-
case '':
|
|
151
70
|
process.stdout.write(usageText());
|
|
152
71
|
return 0;
|
|
153
72
|
case 'version':
|
|
@@ -161,16 +80,23 @@ async function dispatch(subcommand, flags, _positionals) {
|
|
|
161
80
|
}
|
|
162
81
|
export async function main(argv = process.argv.slice(2)) {
|
|
163
82
|
const { subcommand, flags, positionals } = parseArgs(argv);
|
|
164
|
-
|
|
83
|
+
// `--version` is global only before a command: `swap-current --version <v>`
|
|
84
|
+
// names a framework version.
|
|
85
|
+
if (subcommand === null) {
|
|
86
|
+
if (flags.version === true || flags.V === true) {
|
|
87
|
+
process.stdout.write(`${readVersion()}\n`);
|
|
88
|
+
return 0;
|
|
89
|
+
}
|
|
165
90
|
process.stdout.write(usageText());
|
|
166
91
|
return 0;
|
|
167
92
|
}
|
|
168
|
-
|
|
169
|
-
|
|
93
|
+
// `init --help` must print help, never install.
|
|
94
|
+
if (flags.help === true && subcommand !== 'runtime') {
|
|
95
|
+
process.stdout.write(usageText());
|
|
170
96
|
return 0;
|
|
171
97
|
}
|
|
172
98
|
try {
|
|
173
|
-
return await dispatch(subcommand
|
|
99
|
+
return await dispatch(subcommand, flags, positionals);
|
|
174
100
|
}
|
|
175
101
|
catch (err) {
|
|
176
102
|
if (isInstallerError(err)) {
|
|
@@ -187,8 +113,8 @@ export async function main(argv = process.argv.slice(2)) {
|
|
|
187
113
|
* (`node dist/installer/cli.js <subcommand>`), run `main()` and propagate its
|
|
188
114
|
* exit code. specrails-desktop's bundled-core path (server/framework-manager.ts)
|
|
189
115
|
* spawns `node <core>/dist/installer/cli.js install-framework|assemble …` and
|
|
190
|
-
* relies on this —
|
|
191
|
-
*
|
|
116
|
+
* relies on this — `bin/specrails-core.mjs` imports `main` and is unaffected
|
|
117
|
+
* (it never executes this file as argv[1]).
|
|
192
118
|
*
|
|
193
119
|
* Comparing `import.meta.url` against `process.argv[1]` keeps the guard inert on
|
|
194
120
|
* import (so unit tests that `import { main }` never trigger a process.exit).
|
|
@@ -219,4 +145,3 @@ if (isDirectRun) {
|
|
|
219
145
|
process.exitCode = code;
|
|
220
146
|
});
|
|
221
147
|
}
|
|
222
|
-
//# sourceMappingURL=cli.js.map
|
|
@@ -40,7 +40,7 @@ export interface AssembleFlags {
|
|
|
40
40
|
/** Comma-separated per-project agent allow-list (links a subset of the superset). */
|
|
41
41
|
'selected-agents'?: string | boolean;
|
|
42
42
|
}
|
|
43
|
-
|
|
43
|
+
interface InstallFrameworkOutcome {
|
|
44
44
|
frameworkDir: string;
|
|
45
45
|
provider: Provider;
|
|
46
46
|
version: string;
|
|
@@ -48,13 +48,13 @@ export interface InstallFrameworkOutcome {
|
|
|
48
48
|
/** True when `current` was swapped to `<version>` this call. */
|
|
49
49
|
swapped: boolean;
|
|
50
50
|
}
|
|
51
|
-
|
|
51
|
+
interface SwapCurrentOutcome {
|
|
52
52
|
frameworkDir: string;
|
|
53
53
|
version: string;
|
|
54
54
|
/** Complete provider set validated before the pointer was moved. */
|
|
55
55
|
providers: Provider[];
|
|
56
56
|
}
|
|
57
|
-
|
|
57
|
+
interface AssembleOutcome {
|
|
58
58
|
workspace: string;
|
|
59
59
|
frameworkDir: string;
|
|
60
60
|
provider: Provider;
|
|
@@ -83,3 +83,4 @@ export declare function runSwapCurrent(flags: SwapCurrentFlags): Promise<SwapCur
|
|
|
83
83
|
export declare function runAssemble(flags: AssembleFlags): Promise<AssembleOutcome>;
|
|
84
84
|
/** Read the package version (the version the desktop should materialize). */
|
|
85
85
|
export declare function readPackageVersion(scriptDir?: string): string;
|
|
86
|
+
export {};
|