@sublang/slc 0.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/LICENSE +201 -0
- package/README.md +192 -0
- package/dist/app.d.ts +85 -0
- package/dist/app.d.ts.map +1 -0
- package/dist/app.js +233 -0
- package/dist/app.js.map +1 -0
- package/dist/artifacts.d.ts +61 -0
- package/dist/artifacts.d.ts.map +1 -0
- package/dist/artifacts.js +97 -0
- package/dist/artifacts.js.map +1 -0
- package/dist/cli.d.ts +3 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +26 -0
- package/dist/cli.js.map +1 -0
- package/dist/cligent-agent.d.ts +11 -0
- package/dist/cligent-agent.d.ts.map +1 -0
- package/dist/cligent-agent.js +66 -0
- package/dist/cligent-agent.js.map +1 -0
- package/dist/compiled-executor.d.ts +42 -0
- package/dist/compiled-executor.d.ts.map +1 -0
- package/dist/compiled-executor.js +433 -0
- package/dist/compiled-executor.js.map +1 -0
- package/dist/config-file.d.ts +52 -0
- package/dist/config-file.d.ts.map +1 -0
- package/dist/config-file.js +159 -0
- package/dist/config-file.js.map +1 -0
- package/dist/config.d.ts +82 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +161 -0
- package/dist/config.js.map +1 -0
- package/dist/entry-module.d.ts +22 -0
- package/dist/entry-module.d.ts.map +1 -0
- package/dist/entry-module.js +216 -0
- package/dist/entry-module.js.map +1 -0
- package/dist/execution.d.ts +71 -0
- package/dist/execution.d.ts.map +1 -0
- package/dist/execution.js +207 -0
- package/dist/execution.js.map +1 -0
- package/dist/file-capability.d.ts +46 -0
- package/dist/file-capability.d.ts.map +1 -0
- package/dist/file-capability.js +234 -0
- package/dist/file-capability.js.map +1 -0
- package/dist/file-grants.d.ts +79 -0
- package/dist/file-grants.d.ts.map +1 -0
- package/dist/file-grants.js +133 -0
- package/dist/file-grants.js.map +1 -0
- package/dist/hash.d.ts +14 -0
- package/dist/hash.d.ts.map +1 -0
- package/dist/hash.js +34 -0
- package/dist/hash.js.map +1 -0
- package/dist/index.d.ts +20 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +22 -0
- package/dist/index.js.map +1 -0
- package/dist/interpreter.d.ts +48 -0
- package/dist/interpreter.d.ts.map +1 -0
- package/dist/interpreter.js +118 -0
- package/dist/interpreter.js.map +1 -0
- package/dist/invocation.d.ts +64 -0
- package/dist/invocation.d.ts.map +1 -0
- package/dist/invocation.js +148 -0
- package/dist/invocation.js.map +1 -0
- package/dist/link.d.ts +63 -0
- package/dist/link.d.ts.map +1 -0
- package/dist/link.js +172 -0
- package/dist/link.js.map +1 -0
- package/dist/markdown.d.ts +12 -0
- package/dist/markdown.d.ts.map +1 -0
- package/dist/markdown.js +63 -0
- package/dist/markdown.js.map +1 -0
- package/dist/normalize.md +68 -0
- package/dist/phase-runner.d.ts +64 -0
- package/dist/phase-runner.d.ts.map +1 -0
- package/dist/phase-runner.js +322 -0
- package/dist/phase-runner.js.map +1 -0
- package/dist/phase.d.ts +62 -0
- package/dist/phase.d.ts.map +1 -0
- package/dist/phase.js +111 -0
- package/dist/phase.js.map +1 -0
- package/dist/pin-closure.d.ts +19 -0
- package/dist/pin-closure.d.ts.map +1 -0
- package/dist/pin-closure.js +110 -0
- package/dist/pin-closure.js.map +1 -0
- package/dist/pin-currency.d.ts +55 -0
- package/dist/pin-currency.d.ts.map +1 -0
- package/dist/pin-currency.js +435 -0
- package/dist/pin-currency.js.map +1 -0
- package/dist/pin-generate.d.ts +46 -0
- package/dist/pin-generate.d.ts.map +1 -0
- package/dist/pin-generate.js +131 -0
- package/dist/pin-generate.js.map +1 -0
- package/dist/pin-paths.d.ts +11 -0
- package/dist/pin-paths.d.ts.map +1 -0
- package/dist/pin-paths.js +108 -0
- package/dist/pin-paths.js.map +1 -0
- package/dist/pins.d.ts +84 -0
- package/dist/pins.d.ts.map +1 -0
- package/dist/pins.js +265 -0
- package/dist/pins.js.map +1 -0
- package/dist/pipeline.d.ts +61 -0
- package/dist/pipeline.d.ts.map +1 -0
- package/dist/pipeline.js +147 -0
- package/dist/pipeline.js.map +1 -0
- package/dist/playbook-contract.d.ts +194 -0
- package/dist/playbook-contract.d.ts.map +1 -0
- package/dist/playbook-contract.js +180 -0
- package/dist/playbook-contract.js.map +1 -0
- package/dist/playbook-ports.d.ts +53 -0
- package/dist/playbook-ports.d.ts.map +1 -0
- package/dist/playbook-ports.js +217 -0
- package/dist/playbook-ports.js.map +1 -0
- package/dist/resolver.d.ts +68 -0
- package/dist/resolver.d.ts.map +1 -0
- package/dist/resolver.js +133 -0
- package/dist/resolver.js.map +1 -0
- package/dist/runner.d.ts +45 -0
- package/dist/runner.d.ts.map +1 -0
- package/dist/runner.js +506 -0
- package/dist/runner.js.map +1 -0
- package/dist/runtime-package.d.ts +7 -0
- package/dist/runtime-package.d.ts.map +1 -0
- package/dist/runtime-package.js +132 -0
- package/dist/runtime-package.js.map +1 -0
- package/dist/slc.config.template.yaml +5 -0
- package/dist/verify-coverage.d.ts +99 -0
- package/dist/verify-coverage.d.ts.map +1 -0
- package/dist/verify-coverage.js +1949 -0
- package/dist/verify-coverage.js.map +1 -0
- package/dist/verify-support.d.ts +10 -0
- package/dist/verify-support.d.ts.map +1 -0
- package/dist/verify-support.js +52 -0
- package/dist/verify-support.js.map +1 -0
- package/dist/verify.d.ts +393 -0
- package/dist/verify.d.ts.map +1 -0
- package/dist/verify.js +1790 -0
- package/dist/verify.js.map +1 -0
- package/package.json +76 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright [yyyy] [name of copyright owner]
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|
package/README.md
ADDED
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
<!-- SPDX-License-Identifier: Apache-2.0 -->
|
|
2
|
+
<!-- SPDX-FileCopyrightText: 2026 SubLang International <https://sublang.ai> -->
|
|
3
|
+
|
|
4
|
+
# slc
|
|
5
|
+
|
|
6
|
+
[](https://github.com/sublang-ai/slc/actions/workflows/ci.yml)
|
|
7
|
+
|
|
8
|
+
_The SubLang Compiler: pipelines whose phases are written in prose and
|
|
9
|
+
carried out by coding agents._
|
|
10
|
+
|
|
11
|
+
`slc` runs compilation pipelines in which each phase is defined by a
|
|
12
|
+
plain markdown file and executed by an AI coding agent (reached through
|
|
13
|
+
[cligent](https://github.com/sublang-ai/cligent)). Adding a phase means
|
|
14
|
+
writing a definition, never changing the compiler: `slc` itself performs
|
|
15
|
+
only the generic mechanics — chaining phases by their declared formats,
|
|
16
|
+
validating names and locations, and placing artifacts.
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
slc <pipeline>[.<phase>] <source> [-o <target>]
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
Its flagship pipeline is `playbook`, the compilation service behind
|
|
23
|
+
[playbook](https://github.com/sublang-ai/playbook): it turns a workflow
|
|
24
|
+
written in prose into GEARS spec items (one normative item per state
|
|
25
|
+
behavior) and then into an inspectable XState v5 state machine,
|
|
26
|
+
optionally linked into the runnable runtime module playbook's hosts
|
|
27
|
+
execute.
|
|
28
|
+
|
|
29
|
+
Distinctively, `slc` is self-hosting. The reserved `slc` meta-pipeline
|
|
30
|
+
compiles phase definitions themselves into runnable playbook artifacts:
|
|
31
|
+
the bundled phases ship compiled, reviewed, and sha256-pinned under
|
|
32
|
+
[`pipelines/playbook/`](pipelines/playbook). A pinned phase runs exactly
|
|
33
|
+
its reviewed compiled artifact, verified by hash — a missing or stale
|
|
34
|
+
pin fails with a diagnostic instead of silently reinterpreting — while
|
|
35
|
+
unpinned phases fall back to the agent reading the definition directly.
|
|
36
|
+
|
|
37
|
+
## Install
|
|
38
|
+
|
|
39
|
+
Install the compiler and Playbook runtime in the project that will contain the
|
|
40
|
+
generated artifacts:
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
npm install --save-dev @sublang/slc @sublang/playbook
|
|
44
|
+
npx slc --version
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
The project-local Playbook install is required: generated thin runtime modules
|
|
48
|
+
import `@sublang/playbook/xstate-runtime` and their FSMs import `xstate` from
|
|
49
|
+
the artifact's project. A global-only install does not provide Node module
|
|
50
|
+
resolution for artifacts written elsewhere.
|
|
51
|
+
|
|
52
|
+
Requirements:
|
|
53
|
+
|
|
54
|
+
- A POSIX platform — macOS or Linux; on Windows, use WSL (or Git
|
|
55
|
+
Bash). Compiled script steps execute through `sh`, so native Windows
|
|
56
|
+
is not supported.
|
|
57
|
+
- Node.js >= 23.6 (compiled phase artifacts are imported as native
|
|
58
|
+
TypeScript at runtime).
|
|
59
|
+
- One supported coding-agent CLI, installed and authenticated:
|
|
60
|
+
[Claude Code](https://docs.anthropic.com/en/docs/claude-code/overview),
|
|
61
|
+
[Codex CLI](https://github.com/openai/codex),
|
|
62
|
+
[Gemini CLI](https://github.com/google-gemini/gemini-cli), or
|
|
63
|
+
[OpenCode](https://opencode.ai).
|
|
64
|
+
|
|
65
|
+
## Quick start
|
|
66
|
+
|
|
67
|
+
From the repo root — its [`slc.config.yaml`](slc.config.yaml) routes the
|
|
68
|
+
`playbook` pipeline to the bundled copy under `pipelines/` — compile a
|
|
69
|
+
prose workflow:
|
|
70
|
+
|
|
71
|
+
```bash
|
|
72
|
+
npx slc playbook my-workflow.md
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
This writes `my-workflow.playbook/` — the intermediates
|
|
76
|
+
(`my-workflow.gears.md`, the XState machine `my-workflow.fsm.ts`), the
|
|
77
|
+
runnable runtime module, and its verification tests — plus the
|
|
78
|
+
`my-workflow.ts` entry that `playbook run` consumes, all in your
|
|
79
|
+
working directory. A raw input (any extension the entry phase doesn't
|
|
80
|
+
declare, e.g. `.txt`) is normalized first, and the pipeline's
|
|
81
|
+
optimization pass runs by default (`--no-optimize` skips it). For what
|
|
82
|
+
a prose workflow looks like, see playbook's canonical worked example,
|
|
83
|
+
[`code.md`](https://github.com/sublang-ai/playbook/blob/main/reference/sdlc/code.md).
|
|
84
|
+
Intermediates are first-class: edit one and re-run a single
|
|
85
|
+
phase (`npx slc playbook.gears2fsm …`) and it lands in the same place.
|
|
86
|
+
`npx slc --help` shows all invocation forms. The repo config pins
|
|
87
|
+
`agent: claude-code` — set `SLC_AGENT` (or edit the config) to compile
|
|
88
|
+
with another agent CLI.
|
|
89
|
+
|
|
90
|
+
Success prints the written artifact paths and exits 0; a failure prints
|
|
91
|
+
diagnostics to stderr — naming the failing phase when one is at fault —
|
|
92
|
+
and exits non-zero.
|
|
93
|
+
|
|
94
|
+
## Configuration
|
|
95
|
+
|
|
96
|
+
`slc` reads its agent and pipeline settings from an optional YAML config file,
|
|
97
|
+
overridden per key by environment variables. A blank or unset environment value
|
|
98
|
+
falls through to the file. When no config file exists anywhere, the first run
|
|
99
|
+
seeds `~/.config/slc/config.yaml` with `agent: claude-code`, so a fresh
|
|
100
|
+
machine needs no setup; `model` falls through to the agent CLI's own default
|
|
101
|
+
and `pipelinePath` to the working directory.
|
|
102
|
+
|
|
103
|
+
```yaml
|
|
104
|
+
# slc.config.yaml
|
|
105
|
+
agent: claude-code # claude-code | codex | gemini | opencode
|
|
106
|
+
model: claude-opus-4-8 # optional; omit to use the agent CLI's default
|
|
107
|
+
pipelinePath: # search roots for <pipeline> references; defaults to the cwd
|
|
108
|
+
- ./pipelines
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
Discovery order (first match wins):
|
|
112
|
+
|
|
113
|
+
1. `slc.config.yaml` in the working directory.
|
|
114
|
+
2. `${XDG_CONFIG_HOME:-~/.config}/slc/config.yaml`.
|
|
115
|
+
|
|
116
|
+
`slc --config <path>` loads a specific file and disables discovery; a `--config`
|
|
117
|
+
path that does not exist is an error, whereas a discovery miss simply falls
|
|
118
|
+
through to the environment and defaults. Unknown keys, malformed YAML, and
|
|
119
|
+
wrong-typed values are rejected.
|
|
120
|
+
|
|
121
|
+
The matching environment variables, which override the file per key, are:
|
|
122
|
+
|
|
123
|
+
| Variable | Overrides | Meaning |
|
|
124
|
+
| --- | --- | --- |
|
|
125
|
+
| `SLC_AGENT` | `agent` | agent CLI: `claude-code`, `codex`, `gemini`, `opencode` |
|
|
126
|
+
| `SLC_MODEL` | `model` | optional model for the agent CLI |
|
|
127
|
+
| `SLC_PIPELINE_PATH` | `pipelinePath` | OS path-list of search roots (default: cwd) |
|
|
128
|
+
|
|
129
|
+
Credentials are read by the agent CLI from the inherited process environment.
|
|
130
|
+
Run `slc --help` for the full invocation and configuration summary.
|
|
131
|
+
|
|
132
|
+
## How pipelines work
|
|
133
|
+
|
|
134
|
+
A pipeline is a directory of phase definitions named
|
|
135
|
+
`<source-format>2<target-format>.md`, each declaring its formats in a
|
|
136
|
+
`## Formats` table, plus an optional `link.md` defining the terminal
|
|
137
|
+
link phase. `slc` infers phase order by chaining formats — no
|
|
138
|
+
manifest — and refuses incomplete, branching, or cyclic chains. The
|
|
139
|
+
bundled `playbook` pipeline chains `text2gears` and `gears2fsm`, with
|
|
140
|
+
`link` emitting the runnable runtime.
|
|
141
|
+
|
|
142
|
+
Every phase runs through a coding agent, one of two ways:
|
|
143
|
+
|
|
144
|
+
- **Interpreted** — the configured agent reads the definition and
|
|
145
|
+
performs it.
|
|
146
|
+
- **Compiled** — the phase's own compiled playbook artifact (produced by
|
|
147
|
+
the `slc` meta-pipeline, reviewed, and pinned in
|
|
148
|
+
[`slc.pins.json`](pipelines/playbook/slc.pins.json)) drives the agent
|
|
149
|
+
through audited state-machine steps. Pins bind each artifact by
|
|
150
|
+
sha256 to every input that shaped it — definition, artifact bundle,
|
|
151
|
+
and runtime dependencies — so which artifact executes is reproducible,
|
|
152
|
+
and pinned runs fail closed on drift.
|
|
153
|
+
|
|
154
|
+
Specs are the source of truth — start at the
|
|
155
|
+
[spec map](specs/map.md).
|
|
156
|
+
|
|
157
|
+
## Ecosystem
|
|
158
|
+
|
|
159
|
+
`slc` is part of the SubLang stack (all Apache-2.0,
|
|
160
|
+
[github.com/sublang-ai](https://github.com/sublang-ai)):
|
|
161
|
+
|
|
162
|
+
- [cligent](https://github.com/sublang-ai/cligent) — the unified
|
|
163
|
+
coding-agent SDK `slc` executes phases through.
|
|
164
|
+
- [playbook](https://github.com/sublang-ai/playbook) — authors the
|
|
165
|
+
`playbook` pipeline's phase specs and runs the compiled output.
|
|
166
|
+
- [spex](https://github.com/sublang-ai/spex) — the desktop app that
|
|
167
|
+
invokes `slc` for its in-app playbook compile flow.
|
|
168
|
+
|
|
169
|
+
## Develop
|
|
170
|
+
|
|
171
|
+
```bash
|
|
172
|
+
npm ci
|
|
173
|
+
npm run build
|
|
174
|
+
npm test
|
|
175
|
+
npm run lint
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
CI additionally re-verifies the compiled meta-phase bundles and checks
|
|
179
|
+
that pin regeneration is byte-identical to the committed index.
|
|
180
|
+
|
|
181
|
+
## Contributing
|
|
182
|
+
|
|
183
|
+
We welcome contributions of all kinds.
|
|
184
|
+
|
|
185
|
+
- 🌟 Star our repo if you find slc useful.
|
|
186
|
+
- [Open an issue](https://github.com/sublang-ai/slc/issues) for bugs or feature requests.
|
|
187
|
+
- [Open a PR](https://github.com/sublang-ai/slc/pulls) for fixes or improvements.
|
|
188
|
+
- Discuss on [Discord](https://discord.gg/XxTPjNqy9g) for support or new ideas.
|
|
189
|
+
|
|
190
|
+
## License
|
|
191
|
+
|
|
192
|
+
[Apache-2.0](LICENSE)
|
package/dist/app.d.ts
ADDED
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { createConfiguredCompiledFactory, createConfiguredExecutor, type AgentSelection } from './config.js';
|
|
2
|
+
import { type FileConfig } from './config-file.js';
|
|
3
|
+
import { type SlcDeps } from './runner.js';
|
|
4
|
+
/** The program name. */
|
|
5
|
+
export declare const name = "slc";
|
|
6
|
+
/** Returns the slc version string. */
|
|
7
|
+
export declare function version(): string;
|
|
8
|
+
/** Builds run dependencies for a run; injected by tests to supply fakes. */
|
|
9
|
+
export type DepsBuilder = (io: {
|
|
10
|
+
env: Record<string, string | undefined>;
|
|
11
|
+
cwd: string;
|
|
12
|
+
signal: AbortSignal;
|
|
13
|
+
/** Explicit `--config <path>`, when given (CLI-20). */
|
|
14
|
+
configPath?: string;
|
|
15
|
+
/** Sink for host notes such as first-run config seeding (DR-015, CLI-30). */
|
|
16
|
+
note?: (text: string) => void;
|
|
17
|
+
}) => SlcDeps | Promise<SlcDeps>;
|
|
18
|
+
/** Injectable IO and configuration for {@link run}; all fields default to the process. */
|
|
19
|
+
export interface RunOptions {
|
|
20
|
+
env?: Record<string, string | undefined>;
|
|
21
|
+
cwd?: string;
|
|
22
|
+
stdout?: (text: string) => void;
|
|
23
|
+
stderr?: (text: string) => void;
|
|
24
|
+
/** Cancellation signal passed into `runSlc` (CLI-10). */
|
|
25
|
+
signal?: AbortSignal;
|
|
26
|
+
/** Overrides production dependency construction (CLI-6, CLI-7). */
|
|
27
|
+
buildDeps?: DepsBuilder;
|
|
28
|
+
}
|
|
29
|
+
/** The executor factory {@link buildSlcDeps} uses; injected in tests. */
|
|
30
|
+
export type ExecutorFactory = typeof createConfiguredExecutor;
|
|
31
|
+
/** The compiled-execution factory builder {@link buildSlcDeps} uses; injected in tests. */
|
|
32
|
+
export type CompiledFactoryBuilder = typeof createConfiguredCompiledFactory;
|
|
33
|
+
/**
|
|
34
|
+
* Builds the production {@link SlcDeps}: a pipeline resolver over the resolved
|
|
35
|
+
* search roots (CLI-6) — with the reserved `slc` reference routed to the
|
|
36
|
+
* meta-pipeline definitions `@sublang/playbook` provides (SELFHOST-2) — an
|
|
37
|
+
* interpreted executor for the resolved agent/model (CLI-7), and the
|
|
38
|
+
* compiled-execution factory a current pinned phase selects (CLI-8, PHEXEC-27).
|
|
39
|
+
* Configuration is loaded from the config file (DR-006, CLI-20) and
|
|
40
|
+
* then overridden per key by a non-blank environment variable, so existing
|
|
41
|
+
* env-only runs are unchanged and the file fills any key the environment leaves
|
|
42
|
+
* unset.
|
|
43
|
+
*
|
|
44
|
+
* @throws {import('./config-file.js').ConfigFileError} when an explicit
|
|
45
|
+
* `--config` path is absent or the file is malformed or invalid (CLI-21).
|
|
46
|
+
* @throws {import('./config.js').ConfigError} when neither source supplies an
|
|
47
|
+
* agent, or the resolved agent is unsupported (CLI-12).
|
|
48
|
+
*/
|
|
49
|
+
export declare function buildSlcDeps({ env, cwd, signal, configPath, note }: Parameters<DepsBuilder>[0], createExecutor?: ExecutorFactory, createCompiled?: CompiledFactoryBuilder): Promise<SlcDeps>;
|
|
50
|
+
/** The cligent-invocation selection after merging environment over file (DR-006). */
|
|
51
|
+
export interface RunConfig {
|
|
52
|
+
selection: AgentSelection;
|
|
53
|
+
/** Search-root source: an `SLC_PIPELINE_PATH` string, the file's sequence, or undefined. */
|
|
54
|
+
pipelinePath: string | string[] | undefined;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Merges the environment over config-file values per key (DR-006, CLI-20): for
|
|
58
|
+
* each key a non-blank environment variable wins, otherwise the file value,
|
|
59
|
+
* otherwise the built-in default. The agent and model go through
|
|
60
|
+
* {@link resolveAgentSelection} so the supported-agent check stays single-sourced
|
|
61
|
+
* (CLI-7, CLI-12).
|
|
62
|
+
*/
|
|
63
|
+
export declare function resolveRunConfig(env: Record<string, string | undefined>, file: FileConfig): RunConfig;
|
|
64
|
+
/** Usage text naming the documented invocation forms and configuration (CLI-2). */
|
|
65
|
+
export declare function usageText(): string;
|
|
66
|
+
/**
|
|
67
|
+
* Runs the `slc` command line and returns a process exit code (CLI package).
|
|
68
|
+
* Never rejects: configuration refusals and run failures are reported and
|
|
69
|
+
* mapped to a non-zero code.
|
|
70
|
+
*/
|
|
71
|
+
export declare function run(argv: readonly string[], options?: RunOptions): Promise<number>;
|
|
72
|
+
/**
|
|
73
|
+
* Wires `SIGINT`/`SIGTERM` on `emitter` to abort a fresh controller, returning
|
|
74
|
+
* its cancellation signal and a disposer that removes the listeners (CLI-10).
|
|
75
|
+
* The `cli.ts` shim passes `process`; tests pass a fake emitter so the
|
|
76
|
+
* interrupt-to-abort wiring is exercised without real signals.
|
|
77
|
+
*/
|
|
78
|
+
export declare function interruptSignal(emitter: {
|
|
79
|
+
once(event: string, listener: () => void): unknown;
|
|
80
|
+
removeListener(event: string, listener: () => void): unknown;
|
|
81
|
+
}): {
|
|
82
|
+
signal: AbortSignal;
|
|
83
|
+
dispose: () => void;
|
|
84
|
+
};
|
|
85
|
+
//# sourceMappingURL=app.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"app.d.ts","sourceRoot":"","sources":["../src/app.ts"],"names":[],"mappings":"AAmBA,OAAO,EACL,+BAA+B,EAC/B,wBAAwB,EAExB,KAAK,cAAc,EACpB,MAAM,aAAa,CAAC;AACrB,OAAO,EAAkB,KAAK,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAMnE,OAAO,EAAU,KAAK,OAAO,EAAE,MAAM,aAAa,CAAC;AAUnD,wBAAwB;AACxB,eAAO,MAAM,IAAI,QAAQ,CAAC;AAE1B,sCAAsC;AACtC,wBAAgB,OAAO,IAAI,MAAM,CAEhC;AAED,4EAA4E;AAC5E,MAAM,MAAM,WAAW,GAAG,CAAC,EAAE,EAAE;IAC7B,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC;IACxC,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,WAAW,CAAC;IACpB,uDAAuD;IACvD,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,6EAA6E;IAC7E,IAAI,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;CAC/B,KAAK,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;AAEjC,0FAA0F;AAC1F,MAAM,WAAW,UAAU;IACzB,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC;IACzC,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAChC,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAChC,yDAAyD;IACzD,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,mEAAmE;IACnE,SAAS,CAAC,EAAE,WAAW,CAAC;CACzB;AAED,yEAAyE;AACzE,MAAM,MAAM,eAAe,GAAG,OAAO,wBAAwB,CAAC;AAE9D,2FAA2F;AAC3F,MAAM,MAAM,sBAAsB,GAAG,OAAO,+BAA+B,CAAC;AAE5E;;;;;;;;;;;;;;;GAeG;AACH,wBAAsB,YAAY,CAChC,EAAE,GAAG,EAAE,GAAG,EAAE,MAAM,EAAE,UAAU,EAAE,IAAI,EAAE,EAAE,UAAU,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,EAKlE,cAAc,GAAE,eAA0C,EAC1D,cAAc,GAAE,sBAAwD,GACvE,OAAO,CAAC,OAAO,CAAC,CAmBlB;AAED,qFAAqF;AACrF,MAAM,WAAW,SAAS;IACxB,SAAS,EAAE,cAAc,CAAC;IAC1B,4FAA4F;IAC5F,YAAY,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,SAAS,CAAC;CAC7C;AAED;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAC9B,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,EACvC,IAAI,EAAE,UAAU,GACf,SAAS,CAQX;AAOD,mFAAmF;AACnF,wBAAgB,SAAS,IAAI,MAAM,CAoClC;AA6BD;;;;GAIG;AACH,wBAAsB,GAAG,CACvB,IAAI,EAAE,SAAS,MAAM,EAAE,EACvB,OAAO,GAAE,UAAe,GACvB,OAAO,CAAC,MAAM,CAAC,CAmDjB;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE;IACvC,IAAI,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,IAAI,GAAG,OAAO,CAAC;IACnD,cAAc,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,IAAI,GAAG,OAAO,CAAC;CAC9D,GAAG;IAAE,MAAM,EAAE,WAAW,CAAC;IAAC,OAAO,EAAE,MAAM,IAAI,CAAA;CAAE,CAY/C"}
|