specrails-core 6.0.1 → 6.1.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 +1 -1
- package/dist/agent-runtime/capabilities.js +3 -1
- package/dist/agent-runtime/cli-executor.d.ts +3 -0
- package/dist/agent-runtime/cli-executor.js +50 -13
- package/dist/agent-runtime/cli-process.js +6 -2
- package/dist/agent-runtime/cli.d.ts +15 -0
- package/dist/agent-runtime/cli.js +43 -9
- package/dist/agent-runtime/compact/chat-client.js +2 -1
- package/dist/agent-runtime/config.d.ts +4 -1
- package/dist/agent-runtime/config.js +41 -3
- package/dist/agent-runtime/core-host.d.ts +9 -3
- package/dist/agent-runtime/core-host.js +21 -18
- package/dist/agent-runtime/efficiency-summary.d.ts +4 -1
- package/dist/agent-runtime/efficiency-summary.js +30 -27
- package/dist/agent-runtime/efficiency-types.d.ts +4 -4
- package/dist/agent-runtime/efficiency.d.ts +1 -1
- package/dist/agent-runtime/efficiency.js +7 -6
- package/dist/agent-runtime/engine/__fixtures__/implementation-component.json +90 -0
- package/dist/agent-runtime/engine/__fixtures__/implementation-fixture.d.ts +11 -0
- package/dist/agent-runtime/engine/__fixtures__/implementation-fixture.js +60 -0
- package/dist/agent-runtime/engine/__fixtures__/implementation.json +43 -0
- package/dist/agent-runtime/engine/budget.d.ts +9 -0
- package/dist/agent-runtime/engine/budget.js +33 -0
- package/dist/agent-runtime/engine/canonical-json.d.ts +9 -0
- package/dist/agent-runtime/engine/canonical-json.js +162 -0
- package/dist/agent-runtime/engine/checkpoint/database.d.ts +67 -0
- package/dist/agent-runtime/engine/checkpoint/database.js +304 -0
- package/dist/agent-runtime/engine/checkpoint/lease.d.ts +17 -0
- package/dist/agent-runtime/engine/checkpoint/lease.js +82 -0
- package/dist/agent-runtime/engine/checkpoint/ledger.d.ts +133 -0
- package/dist/agent-runtime/engine/checkpoint/ledger.js +510 -0
- package/dist/agent-runtime/engine/checkpoint/saver.d.ts +25 -0
- package/dist/agent-runtime/engine/checkpoint/saver.js +146 -0
- package/dist/agent-runtime/engine/cli.d.ts +10 -0
- package/dist/agent-runtime/engine/cli.js +172 -0
- package/dist/agent-runtime/engine/compiler.d.ts +23 -0
- package/dist/agent-runtime/engine/compiler.js +261 -0
- package/dist/agent-runtime/engine/composition.d.ts +16 -0
- package/dist/agent-runtime/engine/composition.js +28 -0
- package/dist/agent-runtime/engine/concurrency.d.ts +14 -0
- package/dist/agent-runtime/engine/concurrency.js +55 -0
- package/dist/agent-runtime/engine/contracts.d.ts +273 -0
- package/dist/agent-runtime/engine/contracts.js +11 -0
- package/dist/agent-runtime/engine/definition-schema.d.ts +250 -0
- package/dist/agent-runtime/engine/definition-schema.js +313 -0
- package/dist/agent-runtime/engine/definition-types.d.ts +84 -0
- package/dist/agent-runtime/engine/definition-types.js +3 -0
- package/dist/agent-runtime/engine/definition-validator.d.ts +7 -0
- package/dist/agent-runtime/engine/definition-validator.js +187 -0
- package/dist/agent-runtime/engine/efficiency-summary.d.ts +62 -0
- package/dist/agent-runtime/engine/efficiency-summary.js +31 -0
- package/dist/agent-runtime/engine/events.d.ts +19 -0
- package/dist/agent-runtime/engine/events.js +88 -0
- package/dist/agent-runtime/engine/execution.d.ts +29 -0
- package/dist/agent-runtime/engine/execution.js +121 -0
- package/dist/agent-runtime/engine/expressions.d.ts +11 -0
- package/dist/agent-runtime/engine/expressions.js +172 -0
- package/dist/agent-runtime/engine/fork.d.ts +28 -0
- package/dist/agent-runtime/engine/fork.js +211 -0
- package/dist/agent-runtime/engine/graph-description.d.ts +48 -0
- package/dist/agent-runtime/engine/graph-description.js +16 -0
- package/dist/agent-runtime/engine/implementation-compiler.d.ts +214 -0
- package/dist/agent-runtime/engine/implementation-compiler.js +91 -0
- package/dist/agent-runtime/engine/index.d.ts +14 -0
- package/dist/agent-runtime/engine/index.js +14 -0
- package/dist/agent-runtime/engine/invocation-context.d.ts +11 -0
- package/dist/agent-runtime/engine/invocation-context.js +128 -0
- package/dist/agent-runtime/engine/otel.d.ts +15 -0
- package/dist/agent-runtime/engine/otel.js +132 -0
- package/dist/agent-runtime/engine/output.d.ts +4 -0
- package/dist/agent-runtime/engine/output.js +73 -0
- package/dist/agent-runtime/engine/piece-dependencies.d.ts +50 -0
- package/dist/agent-runtime/engine/piece-dependencies.js +193 -0
- package/dist/agent-runtime/engine/piece-registry.d.ts +19 -0
- package/dist/agent-runtime/engine/piece-registry.js +62 -0
- package/dist/agent-runtime/engine/pieces/assign.d.ts +4 -0
- package/dist/agent-runtime/engine/pieces/assign.js +35 -0
- package/dist/agent-runtime/engine/pieces/control.d.ts +5 -0
- package/dist/agent-runtime/engine/pieces/control.js +49 -0
- package/dist/agent-runtime/engine/pieces/decider.d.ts +5 -0
- package/dist/agent-runtime/engine/pieces/decider.js +70 -0
- package/dist/agent-runtime/engine/pieces/implementation-binding.d.ts +12 -0
- package/dist/agent-runtime/engine/pieces/implementation-binding.js +40 -0
- package/dist/agent-runtime/engine/pieces/implementation-journal.d.ts +25 -0
- package/dist/agent-runtime/engine/pieces/implementation-journal.js +192 -0
- package/dist/agent-runtime/engine/pieces/implementation.d.ts +23 -0
- package/dist/agent-runtime/engine/pieces/implementation.js +176 -0
- package/dist/agent-runtime/engine/pieces/index.d.ts +7 -0
- package/dist/agent-runtime/engine/pieces/index.js +22 -0
- package/dist/agent-runtime/engine/pieces/openspec.d.ts +3 -0
- package/dist/agent-runtime/engine/pieces/openspec.js +69 -0
- package/dist/agent-runtime/engine/pieces/ports.d.ts +48 -0
- package/dist/agent-runtime/engine/pieces/ports.js +1 -0
- package/dist/agent-runtime/engine/pieces/project-memory.d.ts +3 -0
- package/dist/agent-runtime/engine/pieces/project-memory.js +13 -0
- package/dist/agent-runtime/engine/pieces/prompt.d.ts +5 -0
- package/dist/agent-runtime/engine/pieces/prompt.js +130 -0
- package/dist/agent-runtime/engine/pieces/role-turn.d.ts +7 -0
- package/dist/agent-runtime/engine/pieces/role-turn.js +73 -0
- package/dist/agent-runtime/engine/pieces/shared.d.ts +67 -0
- package/dist/agent-runtime/engine/pieces/shared.js +40 -0
- package/dist/agent-runtime/engine/pieces/shell.d.ts +6 -0
- package/dist/agent-runtime/engine/pieces/shell.js +47 -0
- package/dist/agent-runtime/engine/pieces/verify.d.ts +7 -0
- package/dist/agent-runtime/engine/pieces/verify.js +52 -0
- package/dist/agent-runtime/engine/preflight.d.ts +27 -0
- package/dist/agent-runtime/engine/preflight.js +54 -0
- package/dist/agent-runtime/engine/regex.d.ts +3 -0
- package/dist/agent-runtime/engine/regex.js +19 -0
- package/dist/agent-runtime/engine/run-status.d.ts +563 -0
- package/dist/agent-runtime/engine/run-status.js +61 -0
- package/dist/agent-runtime/engine/runs.d.ts +605 -0
- package/dist/agent-runtime/engine/runs.js +247 -0
- package/dist/agent-runtime/engine/state.d.ts +64 -0
- package/dist/agent-runtime/engine/state.js +98 -0
- package/dist/agent-runtime/engine/steering/inbox.d.ts +54 -0
- package/dist/agent-runtime/engine/steering/inbox.js +113 -0
- package/dist/agent-runtime/engine/storage/fork-allocation.d.ts +21 -0
- package/dist/agent-runtime/engine/storage/fork-allocation.js +143 -0
- package/dist/agent-runtime/engine/storage/private-path.d.ts +11 -0
- package/dist/agent-runtime/engine/storage/private-path.js +74 -0
- package/dist/agent-runtime/engine/store/sqlite-store.d.ts +26 -0
- package/dist/agent-runtime/engine/store/sqlite-store.js +227 -0
- package/dist/agent-runtime/evaluation-corpus.d.ts +125 -0
- package/dist/agent-runtime/evaluation-corpus.js +4 -0
- package/dist/agent-runtime/evaluation.d.ts +9 -3
- package/dist/agent-runtime/evaluation.js +50 -8
- package/dist/agent-runtime/executor-types.d.ts +53 -3
- package/dist/agent-runtime/executor-types.js +35 -2
- package/dist/agent-runtime/executors.js +2 -2
- package/dist/agent-runtime/graph/artifacts.d.ts +7 -0
- package/dist/agent-runtime/graph/artifacts.js +82 -9
- package/dist/agent-runtime/graph/nodes.d.ts +2 -0
- package/dist/agent-runtime/graph/nodes.js +2 -2
- package/dist/agent-runtime/graph/roles.d.ts +6 -0
- package/dist/agent-runtime/graph/roles.js +23 -17
- package/dist/agent-runtime/kimi-acp.js +6 -6
- package/dist/agent-runtime/openai-executor.js +17 -12
- package/dist/agent-runtime/openspec.d.ts +17 -2
- package/dist/agent-runtime/openspec.js +54 -20
- package/dist/agent-runtime/prompts.d.ts +4 -3
- package/dist/agent-runtime/prompts.js +26 -5
- package/dist/agent-runtime/recovery.d.ts +1 -1
- package/dist/agent-runtime/repository-context.js +1 -1
- package/dist/agent-runtime/role-routing.js +4 -2
- package/dist/agent-runtime/role-state.d.ts +5 -0
- package/dist/agent-runtime/verification-plan.d.ts +2 -0
- package/dist/agent-runtime/verification-plan.js +10 -0
- package/dist/agent-runtime/workflow-types.d.ts +2 -0
- package/dist/agent-runtime/workflow.d.ts +3 -1
- package/dist/agent-runtime/workflow.js +7 -3
- package/dist/agent-runtime/workspace-tools.d.ts +2 -2
- package/dist/agent-runtime/workspace-tools.js +6 -6
- package/dist/installer/cli.js +5 -0
- package/dist/installer/phases/scaffold.d.ts +2 -2
- package/dist/installer/phases/scaffold.js +3 -7
- package/dist/pipeline/pipeline-state.d.ts +38 -4
- package/dist/pipeline/pipeline-state.js +94 -21
- package/integration-contract.json +83 -11
- package/package.json +12 -5
- package/schemas/agent-runtime.schema.json +93 -1
- package/schemas/workflow-definition.schema.json +312 -0
- package/templates/kimi/specrails/run-skill.mjs +15 -1
- package/templates/commands/specrails/batch-implement.md +0 -32
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "specrails-core",
|
|
3
|
-
"version": "6.0
|
|
3
|
+
"version": "6.1.0",
|
|
4
4
|
"description": "Agent workflow engine for specrails-desktop: provider-independent installer and programmatic agent runtime for Claude Code, Codex, Gemini CLI and Kimi Code",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -9,9 +9,15 @@
|
|
|
9
9
|
"import": "./dist/agent-runtime/index.js",
|
|
10
10
|
"default": "./dist/agent-runtime/index.js"
|
|
11
11
|
},
|
|
12
|
+
"./agent-runtime/engine": {
|
|
13
|
+
"types": "./dist/agent-runtime/engine/index.d.ts",
|
|
14
|
+
"import": "./dist/agent-runtime/engine/index.js",
|
|
15
|
+
"default": "./dist/agent-runtime/engine/index.js"
|
|
16
|
+
},
|
|
12
17
|
"./package.json": "./package.json",
|
|
13
18
|
"./integration-contract.json": "./integration-contract.json",
|
|
14
|
-
"./schemas/agent-runtime.schema.json": "./schemas/agent-runtime.schema.json"
|
|
19
|
+
"./schemas/agent-runtime.schema.json": "./schemas/agent-runtime.schema.json",
|
|
20
|
+
"./schemas/workflow-definition.schema.json": "./schemas/workflow-definition.schema.json"
|
|
15
21
|
},
|
|
16
22
|
"bin": {
|
|
17
23
|
"specrails-core": "bin/specrails-core.mjs"
|
|
@@ -25,7 +31,7 @@
|
|
|
25
31
|
"pinned-versions.json"
|
|
26
32
|
],
|
|
27
33
|
"engines": {
|
|
28
|
-
"node": ">=
|
|
34
|
+
"node": ">=22.22.3"
|
|
29
35
|
},
|
|
30
36
|
"repository": {
|
|
31
37
|
"type": "git",
|
|
@@ -66,7 +72,8 @@
|
|
|
66
72
|
"test:coverage": "npm run build && vitest run --coverage",
|
|
67
73
|
"dogfood": "npm run build && node bin/specrails-core.mjs init --yes",
|
|
68
74
|
"prepack": "npm run build",
|
|
69
|
-
"test:scripts": "node --test scripts/release-utils.test.mjs scripts/ci-tests.test.mjs",
|
|
75
|
+
"test:scripts": "node --test scripts/release-utils.test.mjs scripts/ci-tests.test.mjs scripts/evaluate-definition-corpus.test.mjs",
|
|
76
|
+
"test:engine-spikes": "npm run build && node scripts/run-engine-spikes.mjs",
|
|
70
77
|
"check:package": "npm run build && node scripts/verify-package.mjs",
|
|
71
78
|
"ci": "npm run typecheck && npm run test:scripts && npm run test:coverage && npm run check:package"
|
|
72
79
|
},
|
|
@@ -76,6 +83,7 @@
|
|
|
76
83
|
"@langchain/langgraph": "1.4.14",
|
|
77
84
|
"@langchain/langgraph-checkpoint": "1.1.5",
|
|
78
85
|
"@modelcontextprotocol/sdk": "1.29.0",
|
|
86
|
+
"ajv": "^8.20.0",
|
|
79
87
|
"cross-spawn": "7.0.6",
|
|
80
88
|
"js-yaml": "^4.1.0",
|
|
81
89
|
"picocolors": "^1.1.1",
|
|
@@ -86,7 +94,6 @@
|
|
|
86
94
|
"@types/js-yaml": "^4.0.9",
|
|
87
95
|
"@types/node": "^22.10.2",
|
|
88
96
|
"@vitest/coverage-v8": "^4.1.5",
|
|
89
|
-
"ajv": "^8.20.0",
|
|
90
97
|
"typescript": "^5.7.2",
|
|
91
98
|
"vitest": "^4.1.5"
|
|
92
99
|
},
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
"verification": { "type": "object", "additionalProperties": false, "properties": { "maxConcurrency": { "type": "integer", "minimum": 1, "maximum": 4 } } }
|
|
14
14
|
} },
|
|
15
15
|
"guardrails": { "type": "object", "additionalProperties": false, "properties": { "plan-validation": { "type": "boolean" }, "genuine-blocking-question": { "type": "boolean" }, "plan-language-hint": { "type": "boolean" }, "frozen-plan-writes": { "type": "boolean" }, "primary-language": { "type": "boolean" }, "duplicate-sibling": { "type": "boolean" }, "one-test-per-module": { "type": "boolean" }, "empty-write": { "type": "boolean" }, "evidence-gated-ticking": { "type": "boolean" }, "inventory-retry": { "type": "boolean" }, "synthetic-corrections": { "type": "boolean" }, "silent-group-closure": { "type": "boolean" }, "verify-per-group": { "type": "boolean" }, "test-reachability": { "type": "boolean" }, "exit-code-honesty": { "type": "boolean" }, "environment-repair": { "type": "boolean" }, "lockfile-repair": { "type": "boolean" }, "verify-idle-timeout": { "type": "boolean" } } },
|
|
16
|
-
"rolePrompts": { "type": "object", "additionalProperties":
|
|
16
|
+
"rolePrompts": { "type": "object", "propertyNames": { "pattern": "^[a-z][a-z0-9-]{0,63}$" }, "additionalProperties": { "type": "string", "minLength": 1, "maxLength": 20000, "pattern": "\\S" }, "properties": {
|
|
17
17
|
"architect": { "type": "string", "minLength": 1, "maxLength": 20000, "pattern": "\\S" },
|
|
18
18
|
"developer": { "type": "string", "minLength": 1, "maxLength": 20000, "pattern": "\\S" },
|
|
19
19
|
"reviewer": { "type": "string", "minLength": 1, "maxLength": 20000, "pattern": "\\S" },
|
|
@@ -35,6 +35,98 @@
|
|
|
35
35
|
} }
|
|
36
36
|
] } },
|
|
37
37
|
"fixer": { "$ref": "#/definitions/agent" },
|
|
38
|
+
"roles": {
|
|
39
|
+
"type": "object",
|
|
40
|
+
"propertyNames": {
|
|
41
|
+
"pattern": "^[a-z][a-z0-9-]{0,63}$",
|
|
42
|
+
"not": {
|
|
43
|
+
"const": "fixer"
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
"additionalProperties": {
|
|
47
|
+
"type": "object",
|
|
48
|
+
"additionalProperties": false,
|
|
49
|
+
"required": [
|
|
50
|
+
"provider",
|
|
51
|
+
"access",
|
|
52
|
+
"artifacts"
|
|
53
|
+
],
|
|
54
|
+
"dependencies": {
|
|
55
|
+
"escalation": [
|
|
56
|
+
"model"
|
|
57
|
+
]
|
|
58
|
+
},
|
|
59
|
+
"properties": {
|
|
60
|
+
"effort": {
|
|
61
|
+
"$ref": "#/definitions/effort"
|
|
62
|
+
},
|
|
63
|
+
"thinking": {
|
|
64
|
+
"type": "string",
|
|
65
|
+
"enum": [
|
|
66
|
+
"on",
|
|
67
|
+
"off"
|
|
68
|
+
],
|
|
69
|
+
"description": "OpenAI-compatible engines only: private thinking (chat_template_kwargs.enable_thinking). Default off."
|
|
70
|
+
},
|
|
71
|
+
"escalation": {
|
|
72
|
+
"type": "object",
|
|
73
|
+
"additionalProperties": false,
|
|
74
|
+
"required": [
|
|
75
|
+
"model"
|
|
76
|
+
],
|
|
77
|
+
"properties": {
|
|
78
|
+
"model": {
|
|
79
|
+
"type": "string",
|
|
80
|
+
"minLength": 1,
|
|
81
|
+
"maxLength": 256,
|
|
82
|
+
"pattern": "^[^-\\r\\n\\u0000][^\\r\\n\\u0000]*$"
|
|
83
|
+
},
|
|
84
|
+
"effort": {
|
|
85
|
+
"$ref": "#/definitions/effort"
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
},
|
|
89
|
+
"provider": {
|
|
90
|
+
"$ref": "#/definitions/id"
|
|
91
|
+
},
|
|
92
|
+
"model": {
|
|
93
|
+
"type": "string",
|
|
94
|
+
"minLength": 1,
|
|
95
|
+
"maxLength": 256,
|
|
96
|
+
"pattern": "^[^-\\r\\n\\u0000][^\\r\\n\\u0000]*$"
|
|
97
|
+
},
|
|
98
|
+
"maxTurns": {
|
|
99
|
+
"$ref": "#/definitions/positiveInteger"
|
|
100
|
+
},
|
|
101
|
+
"access": {
|
|
102
|
+
"enum": [
|
|
103
|
+
"read",
|
|
104
|
+
"write"
|
|
105
|
+
]
|
|
106
|
+
},
|
|
107
|
+
"artifacts": {
|
|
108
|
+
"enum": [
|
|
109
|
+
"none",
|
|
110
|
+
"tasks-checkboxes",
|
|
111
|
+
"all"
|
|
112
|
+
]
|
|
113
|
+
},
|
|
114
|
+
"prompt": {
|
|
115
|
+
"type": "string",
|
|
116
|
+
"minLength": 1,
|
|
117
|
+
"maxLength": 20000,
|
|
118
|
+
"pattern": "\\S"
|
|
119
|
+
},
|
|
120
|
+
"openspecSkill": {
|
|
121
|
+
"enum": [
|
|
122
|
+
"openspec-ff-change",
|
|
123
|
+
"openspec-apply-change",
|
|
124
|
+
"openspec-verify-change"
|
|
125
|
+
]
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
},
|
|
38
130
|
"agents": { "type": "object", "additionalProperties": false, "required": ["architect", "developer", "reviewer"], "properties": {
|
|
39
131
|
"architect": { "$ref": "#/definitions/agent" }, "developer": { "$ref": "#/definitions/agent" }, "reviewer": { "$ref": "#/definitions/agent" }
|
|
40
132
|
} },
|
|
@@ -0,0 +1,312 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://specrails.dev/schemas/workflow-definition/1",
|
|
4
|
+
"type": "object",
|
|
5
|
+
"additionalProperties": false,
|
|
6
|
+
"required": [
|
|
7
|
+
"schemaVersion",
|
|
8
|
+
"id",
|
|
9
|
+
"version",
|
|
10
|
+
"title",
|
|
11
|
+
"journal",
|
|
12
|
+
"change",
|
|
13
|
+
"entry",
|
|
14
|
+
"maxTransitions",
|
|
15
|
+
"roles",
|
|
16
|
+
"nodes"
|
|
17
|
+
],
|
|
18
|
+
"properties": {
|
|
19
|
+
"schemaVersion": {
|
|
20
|
+
"const": 1
|
|
21
|
+
},
|
|
22
|
+
"id": {
|
|
23
|
+
"type": "string",
|
|
24
|
+
"pattern": "^[a-z0-9][a-z0-9-]{0,63}$"
|
|
25
|
+
},
|
|
26
|
+
"version": {
|
|
27
|
+
"type": "string",
|
|
28
|
+
"pattern": "^[0-9a-f]{64}$"
|
|
29
|
+
},
|
|
30
|
+
"title": {
|
|
31
|
+
"type": "string",
|
|
32
|
+
"minLength": 1,
|
|
33
|
+
"maxLength": 120
|
|
34
|
+
},
|
|
35
|
+
"journal": {
|
|
36
|
+
"enum": [
|
|
37
|
+
"ledger-only",
|
|
38
|
+
"implementation"
|
|
39
|
+
]
|
|
40
|
+
},
|
|
41
|
+
"change": {
|
|
42
|
+
"enum": [
|
|
43
|
+
"new",
|
|
44
|
+
"existing",
|
|
45
|
+
"none"
|
|
46
|
+
]
|
|
47
|
+
},
|
|
48
|
+
"entry": {
|
|
49
|
+
"$ref": "#/$defs/nodeId"
|
|
50
|
+
},
|
|
51
|
+
"maxTransitions": {
|
|
52
|
+
"type": "integer",
|
|
53
|
+
"minimum": 1,
|
|
54
|
+
"maximum": 10000
|
|
55
|
+
},
|
|
56
|
+
"budget": {
|
|
57
|
+
"type": "object",
|
|
58
|
+
"additionalProperties": false,
|
|
59
|
+
"properties": {
|
|
60
|
+
"maxCostUsd": {
|
|
61
|
+
"type": "number",
|
|
62
|
+
"exclusiveMinimum": 0
|
|
63
|
+
},
|
|
64
|
+
"maxTokens": {
|
|
65
|
+
"type": "integer",
|
|
66
|
+
"minimum": 1
|
|
67
|
+
},
|
|
68
|
+
"maxDurationMs": {
|
|
69
|
+
"type": "integer",
|
|
70
|
+
"minimum": 1000
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
},
|
|
74
|
+
"policies": {
|
|
75
|
+
"type": "object",
|
|
76
|
+
"additionalProperties": false,
|
|
77
|
+
"properties": {
|
|
78
|
+
"failFast": {
|
|
79
|
+
"type": "integer",
|
|
80
|
+
"minimum": 1,
|
|
81
|
+
"maximum": 10,
|
|
82
|
+
"default": 2
|
|
83
|
+
},
|
|
84
|
+
"noProgress": {
|
|
85
|
+
"type": "integer",
|
|
86
|
+
"minimum": 1,
|
|
87
|
+
"maximum": 10,
|
|
88
|
+
"default": 2
|
|
89
|
+
},
|
|
90
|
+
"historyMaxChars": {
|
|
91
|
+
"type": "integer",
|
|
92
|
+
"minimum": 200,
|
|
93
|
+
"maximum": 20000,
|
|
94
|
+
"default": 1500
|
|
95
|
+
},
|
|
96
|
+
"concurrency": {
|
|
97
|
+
"type": "integer",
|
|
98
|
+
"minimum": 1,
|
|
99
|
+
"maximum": 8,
|
|
100
|
+
"default": 1
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
},
|
|
104
|
+
"roles": {
|
|
105
|
+
"type": "array",
|
|
106
|
+
"items": {
|
|
107
|
+
"$ref": "#/$defs/roleId"
|
|
108
|
+
},
|
|
109
|
+
"uniqueItems": true
|
|
110
|
+
},
|
|
111
|
+
"nodes": {
|
|
112
|
+
"type": "object",
|
|
113
|
+
"minProperties": 1,
|
|
114
|
+
"propertyNames": {
|
|
115
|
+
"$ref": "#/$defs/nodeId"
|
|
116
|
+
},
|
|
117
|
+
"additionalProperties": {
|
|
118
|
+
"$ref": "#/$defs/node"
|
|
119
|
+
}
|
|
120
|
+
},
|
|
121
|
+
"components": {
|
|
122
|
+
"type": "object",
|
|
123
|
+
"propertyNames": {
|
|
124
|
+
"pattern": "^[a-z0-9][a-z0-9-]{0,63}$"
|
|
125
|
+
},
|
|
126
|
+
"additionalProperties": {
|
|
127
|
+
"$ref": "#/$defs/componentBody"
|
|
128
|
+
}
|
|
129
|
+
},
|
|
130
|
+
"delivery": {
|
|
131
|
+
"type": "object",
|
|
132
|
+
"additionalProperties": false,
|
|
133
|
+
"properties": {
|
|
134
|
+
"requiresVerified": {
|
|
135
|
+
"type": "boolean"
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
},
|
|
140
|
+
"$defs": {
|
|
141
|
+
"nodeId": {
|
|
142
|
+
"type": "string",
|
|
143
|
+
"pattern": "^[A-Za-z0-9][A-Za-z0-9_-]{0,119}$",
|
|
144
|
+
"not": {
|
|
145
|
+
"enum": [
|
|
146
|
+
"START",
|
|
147
|
+
"END",
|
|
148
|
+
"__start__",
|
|
149
|
+
"__end__",
|
|
150
|
+
"next"
|
|
151
|
+
]
|
|
152
|
+
}
|
|
153
|
+
},
|
|
154
|
+
"roleId": {
|
|
155
|
+
"type": "string",
|
|
156
|
+
"pattern": "^[a-z][a-z0-9-]{0,63}$"
|
|
157
|
+
},
|
|
158
|
+
"engine": {
|
|
159
|
+
"type": "object",
|
|
160
|
+
"additionalProperties": false,
|
|
161
|
+
"required": [
|
|
162
|
+
"provider"
|
|
163
|
+
],
|
|
164
|
+
"properties": {
|
|
165
|
+
"provider": {
|
|
166
|
+
"type": "string"
|
|
167
|
+
},
|
|
168
|
+
"model": {
|
|
169
|
+
"type": "string"
|
|
170
|
+
},
|
|
171
|
+
"effort": {
|
|
172
|
+
"type": "string"
|
|
173
|
+
},
|
|
174
|
+
"thinking": {
|
|
175
|
+
"enum": [
|
|
176
|
+
"on",
|
|
177
|
+
"off"
|
|
178
|
+
]
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
},
|
|
182
|
+
"retry": {
|
|
183
|
+
"type": "object",
|
|
184
|
+
"additionalProperties": false,
|
|
185
|
+
"properties": {
|
|
186
|
+
"maxAttempts": {
|
|
187
|
+
"type": "integer",
|
|
188
|
+
"minimum": 1,
|
|
189
|
+
"maximum": 10
|
|
190
|
+
},
|
|
191
|
+
"backoffMs": {
|
|
192
|
+
"type": "integer",
|
|
193
|
+
"minimum": 0,
|
|
194
|
+
"maximum": 600000
|
|
195
|
+
},
|
|
196
|
+
"retryOn": {
|
|
197
|
+
"type": "array",
|
|
198
|
+
"items": {
|
|
199
|
+
"enum": [
|
|
200
|
+
"idle_timeout",
|
|
201
|
+
"timeout",
|
|
202
|
+
"provider_request_error",
|
|
203
|
+
"session_not_found",
|
|
204
|
+
"invalid_structured_output"
|
|
205
|
+
]
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
},
|
|
210
|
+
"ends": {
|
|
211
|
+
"type": "object",
|
|
212
|
+
"propertyNames": {
|
|
213
|
+
"pattern": "^[a-z][a-z0-9-]{0,31}$"
|
|
214
|
+
},
|
|
215
|
+
"additionalProperties": {
|
|
216
|
+
"oneOf": [
|
|
217
|
+
{
|
|
218
|
+
"$ref": "#/$defs/nodeId"
|
|
219
|
+
},
|
|
220
|
+
{
|
|
221
|
+
"type": "null"
|
|
222
|
+
}
|
|
223
|
+
]
|
|
224
|
+
}
|
|
225
|
+
},
|
|
226
|
+
"node": {
|
|
227
|
+
"type": "object",
|
|
228
|
+
"additionalProperties": false,
|
|
229
|
+
"required": [
|
|
230
|
+
"kind",
|
|
231
|
+
"params",
|
|
232
|
+
"ends"
|
|
233
|
+
],
|
|
234
|
+
"properties": {
|
|
235
|
+
"kind": {
|
|
236
|
+
"enum": [
|
|
237
|
+
"prompt",
|
|
238
|
+
"role-turn",
|
|
239
|
+
"decider",
|
|
240
|
+
"condition",
|
|
241
|
+
"assign",
|
|
242
|
+
"verify",
|
|
243
|
+
"shell",
|
|
244
|
+
"openspec-validate",
|
|
245
|
+
"openspec-archive",
|
|
246
|
+
"approval",
|
|
247
|
+
"question",
|
|
248
|
+
"gate",
|
|
249
|
+
"map",
|
|
250
|
+
"join",
|
|
251
|
+
"component",
|
|
252
|
+
"implementation",
|
|
253
|
+
"end"
|
|
254
|
+
]
|
|
255
|
+
},
|
|
256
|
+
"params": {
|
|
257
|
+
"type": "object"
|
|
258
|
+
},
|
|
259
|
+
"ends": {
|
|
260
|
+
"$ref": "#/$defs/ends"
|
|
261
|
+
},
|
|
262
|
+
"retry": {
|
|
263
|
+
"$ref": "#/$defs/retry"
|
|
264
|
+
},
|
|
265
|
+
"label": {
|
|
266
|
+
"type": "string",
|
|
267
|
+
"maxLength": 80
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
},
|
|
271
|
+
"componentBody": {
|
|
272
|
+
"type": "object",
|
|
273
|
+
"additionalProperties": false,
|
|
274
|
+
"required": [
|
|
275
|
+
"entry",
|
|
276
|
+
"nodes"
|
|
277
|
+
],
|
|
278
|
+
"properties": {
|
|
279
|
+
"entry": {
|
|
280
|
+
"$ref": "#/$defs/nodeId"
|
|
281
|
+
},
|
|
282
|
+
"maxTransitions": {
|
|
283
|
+
"type": "integer",
|
|
284
|
+
"minimum": 1,
|
|
285
|
+
"maximum": 10000
|
|
286
|
+
},
|
|
287
|
+
"inputs": {
|
|
288
|
+
"type": "array",
|
|
289
|
+
"items": {
|
|
290
|
+
"type": "string"
|
|
291
|
+
}
|
|
292
|
+
},
|
|
293
|
+
"outputs": {
|
|
294
|
+
"type": "array",
|
|
295
|
+
"items": {
|
|
296
|
+
"type": "string"
|
|
297
|
+
}
|
|
298
|
+
},
|
|
299
|
+
"nodes": {
|
|
300
|
+
"type": "object",
|
|
301
|
+
"minProperties": 1,
|
|
302
|
+
"propertyNames": {
|
|
303
|
+
"$ref": "#/$defs/nodeId"
|
|
304
|
+
},
|
|
305
|
+
"additionalProperties": {
|
|
306
|
+
"$ref": "#/$defs/node"
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
}
|
|
312
|
+
}
|
|
@@ -231,6 +231,7 @@ export function parseRunnerArgs(argv) {
|
|
|
231
231
|
attachmentPaths: [],
|
|
232
232
|
extraPrompt: undefined,
|
|
233
233
|
plainPromptStdin: false,
|
|
234
|
+
renderOnly: false,
|
|
234
235
|
}
|
|
235
236
|
let positionalArgs
|
|
236
237
|
const seenSingleValueFlags = new Set()
|
|
@@ -251,8 +252,14 @@ export function parseRunnerArgs(argv) {
|
|
|
251
252
|
parsed.sessionId = value
|
|
252
253
|
continue
|
|
253
254
|
}
|
|
255
|
+
if (token === '--render-only') {
|
|
256
|
+
if (parsed.renderOnly) throw new RunnerUsageError('--render-only may be supplied once')
|
|
257
|
+
parsed.renderOnly = true
|
|
258
|
+
continue
|
|
259
|
+
}
|
|
254
260
|
if (token === PLAIN_PROMPT_STDIN_FLAG) {
|
|
255
|
-
if (parsed.plainPromptStdin)
|
|
261
|
+
if (parsed.renderOnly && parsed.plainPromptStdin) throw new RunnerUsageError('--render-only requires a skill')
|
|
262
|
+
if (parsed.plainPromptStdin) {
|
|
256
263
|
throw new RunnerUsageError(
|
|
257
264
|
`${PLAIN_PROMPT_STDIN_FLAG} may be supplied once`,
|
|
258
265
|
)
|
|
@@ -301,6 +308,7 @@ export function parseRunnerArgs(argv) {
|
|
|
301
308
|
parsed.rawArgs = positionalArgs
|
|
302
309
|
}
|
|
303
310
|
|
|
311
|
+
if (parsed.renderOnly && parsed.plainPromptStdin) throw new RunnerUsageError('--render-only requires a skill')
|
|
304
312
|
if (parsed.plainPromptStdin) {
|
|
305
313
|
for (const flag of ['--skill', '--args', '--prompt', '--attachment']) {
|
|
306
314
|
if (
|
|
@@ -594,6 +602,12 @@ export async function runSkillCli(argv, dependencies = {}) {
|
|
|
594
602
|
}
|
|
595
603
|
const scriptPath = dependencies.scriptPath ?? process.argv[1]
|
|
596
604
|
const providerRoot = resolveProviderRoot(scriptPath)
|
|
605
|
+
if (parsedArgs.renderOnly) {
|
|
606
|
+
const { prompt } = prepareSkillLaunch({ ...parsedArgs, providerRoot }, dependencies)
|
|
607
|
+
assertManagedPrompt(prompt)
|
|
608
|
+
;(dependencies.writeStdout ?? (text => process.stdout.write(text)))(JSON.stringify({ prompt }) + '\n')
|
|
609
|
+
return 0
|
|
610
|
+
}
|
|
597
611
|
if (parsedArgs.plainPromptStdin) {
|
|
598
612
|
const readStdin =
|
|
599
613
|
dependencies.readStdin ??
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
# Programmatic implementation
|
|
2
|
-
|
|
3
|
-
Implement the requested spec or batch through the installed agent runtime. The runtime owns architecture, development, verification, review and archive; do not delegate these phases yourself or launch a second coordinator.
|
|
4
|
-
|
|
5
|
-
## Freeze the requested scope
|
|
6
|
-
|
|
7
|
-
Use the supplied absolute `SPECRAILS_EXECUTION_CONTEXT` unchanged. It defines runId, specs and acceptance criteria, artifactRoot, selected repositories and ownership. For standalone use, admit the exact requested tickets once with:
|
|
8
|
-
|
|
9
|
-
```sh
|
|
10
|
-
node .specrails/runtime/pipeline.mjs init --change <stable-change> --tickets "<requested-ids>"
|
|
11
|
-
```
|
|
12
|
-
|
|
13
|
-
For a free-form request use `--scope-request <absolute-json>` with the user's specs and criteria. Use the returned absolute context path. Never select a different run by modification time or replace scope from mutable backlog. Multiple tickets share one aggregate context and one runtime invocation.
|
|
14
|
-
|
|
15
|
-
## Execute
|
|
16
|
-
|
|
17
|
-
```sh
|
|
18
|
-
node .specrails/runtime/agent-runtime.mjs run --context <absolute-context> --config .specrails/agent-runtime.json --change <stable-change>
|
|
19
|
-
```
|
|
20
|
-
|
|
21
|
-
Desktop launches this runtime directly and freezes its resolved global connections and project settings. Standalone installations provide a local configuration. If required runtime/configuration files are missing, repair the Core installation; do not fall back to a prompt-orchestrated implementation.
|
|
22
|
-
|
|
23
|
-
Wait for the foreground process. Report its structured status, acceptance and verification evidence. A process failure or pause preserves progress; it does not authorize a replacement run. Resume only the exact saved execution:
|
|
24
|
-
|
|
25
|
-
```sh
|
|
26
|
-
node .specrails/runtime/agent-runtime.mjs status --context <absolute-context>
|
|
27
|
-
node .specrails/runtime/agent-runtime.mjs resume --context <absolute-context>
|
|
28
|
-
```
|
|
29
|
-
|
|
30
|
-
Answers, approvals and recovery flags must correspond to the pending request and user authorization. Resume keeps the saved models, scope and configuration. Never manually rewrite phase receipts, bypass review, or treat provider prose as completion.
|
|
31
|
-
|
|
32
|
-
Honor the context's ownership throughout: Desktop owns worktrees, commits, PRs and backlog delivery. Runtime success prepares a reviewed candidate; host delivery remains a separate action. Preview requests must not invoke mutating execution.
|