@sublang/slc 0.5.0 → 0.7.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 +10 -5
- package/dist/app.d.ts +20 -20
- package/dist/app.d.ts.map +1 -1
- package/dist/app.js +44 -31
- package/dist/app.js.map +1 -1
- package/dist/artifacts.d.ts +6 -6
- package/dist/artifacts.d.ts.map +1 -1
- package/dist/artifacts.js +9 -9
- package/dist/artifacts.js.map +1 -1
- package/dist/cli.js +3 -3
- package/dist/cligent-agent.d.ts +9 -2
- package/dist/cligent-agent.d.ts.map +1 -1
- package/dist/cligent-agent.js +6 -5
- package/dist/cligent-agent.js.map +1 -1
- package/dist/compiled-execution.d.ts +44 -0
- package/dist/compiled-execution.d.ts.map +1 -0
- package/dist/compiled-execution.js +184 -0
- package/dist/compiled-execution.js.map +1 -0
- package/dist/compiled-executor.d.ts +16 -6
- package/dist/compiled-executor.d.ts.map +1 -1
- package/dist/compiled-executor.js +182 -35
- package/dist/compiled-executor.js.map +1 -1
- package/dist/config-file.d.ts +9 -6
- package/dist/config-file.d.ts.map +1 -1
- package/dist/config-file.js +27 -9
- package/dist/config-file.js.map +1 -1
- package/dist/config.d.ts +77 -24
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +128 -52
- package/dist/config.js.map +1 -1
- package/dist/emitted-imports.d.ts +14 -0
- package/dist/emitted-imports.d.ts.map +1 -1
- package/dist/emitted-imports.js +63 -7
- package/dist/emitted-imports.js.map +1 -1
- package/dist/entry-module.d.ts +5 -3
- package/dist/entry-module.d.ts.map +1 -1
- package/dist/entry-module.js +41 -13
- package/dist/entry-module.js.map +1 -1
- package/dist/execution.d.ts +10 -10
- package/dist/execution.d.ts.map +1 -1
- package/dist/execution.js +13 -13
- package/dist/execution.js.map +1 -1
- package/dist/hash.js +2 -2
- package/dist/interpreter.d.ts +2 -2
- package/dist/interpreter.d.ts.map +1 -1
- package/dist/interpreter.js +7 -7
- package/dist/invocation.d.ts +6 -6
- package/dist/invocation.d.ts.map +1 -1
- package/dist/invocation.js +1 -1
- package/dist/link.d.ts +4 -4
- package/dist/link.d.ts.map +1 -1
- package/dist/link.js +11 -11
- package/dist/link.js.map +1 -1
- package/dist/phase-runner.d.ts +13 -6
- package/dist/phase-runner.d.ts.map +1 -1
- package/dist/phase-runner.js +12 -10
- package/dist/phase-runner.js.map +1 -1
- package/dist/phase.d.ts +4 -4
- package/dist/phase.d.ts.map +1 -1
- package/dist/phase.js +7 -7
- package/dist/phase.js.map +1 -1
- package/dist/pin-closure.d.ts +35 -7
- package/dist/pin-closure.d.ts.map +1 -1
- package/dist/pin-closure.js +135 -21
- package/dist/pin-closure.js.map +1 -1
- package/dist/pin-currency.d.ts +9 -4
- package/dist/pin-currency.d.ts.map +1 -1
- package/dist/pin-currency.js +57 -20
- package/dist/pin-currency.js.map +1 -1
- package/dist/pin-generate.d.ts +7 -7
- package/dist/pin-generate.d.ts.map +1 -1
- package/dist/pin-generate.js +24 -10
- package/dist/pin-generate.js.map +1 -1
- package/dist/pin-inputs.d.ts +41 -0
- package/dist/pin-inputs.d.ts.map +1 -0
- package/dist/pin-inputs.js +179 -0
- package/dist/pin-inputs.js.map +1 -0
- package/dist/pin-paths.d.ts +1 -1
- package/dist/pin-paths.js +4 -4
- package/dist/pin-paths.js.map +1 -1
- package/dist/pins.d.ts +4 -4
- package/dist/pins.d.ts.map +1 -1
- package/dist/pins.js +5 -5
- package/dist/pins.js.map +1 -1
- package/dist/pipeline.d.ts +5 -5
- package/dist/pipeline.js +10 -10
- package/dist/playbook-contract.d.ts +49 -5
- package/dist/playbook-contract.d.ts.map +1 -1
- package/dist/playbook-contract.js +70 -21
- package/dist/playbook-contract.js.map +1 -1
- package/dist/playbook-ports.d.ts +9 -9
- package/dist/playbook-ports.d.ts.map +1 -1
- package/dist/playbook-ports.js +3 -3
- package/dist/playbook-ports.js.map +1 -1
- package/dist/progress.d.ts +8 -9
- package/dist/progress.d.ts.map +1 -1
- package/dist/progress.js +3 -3
- package/dist/progress.js.map +1 -1
- package/dist/resolver.d.ts +9 -9
- package/dist/resolver.d.ts.map +1 -1
- package/dist/resolver.js +12 -12
- package/dist/resolver.js.map +1 -1
- package/dist/runner.d.ts +2 -2
- package/dist/runner.d.ts.map +1 -1
- package/dist/runner.js +218 -81
- package/dist/runner.js.map +1 -1
- package/dist/runtime-contract.d.ts +17 -0
- package/dist/runtime-contract.d.ts.map +1 -0
- package/dist/runtime-contract.js +114 -0
- package/dist/runtime-contract.js.map +1 -0
- package/dist/slc.config.template.yaml +7 -2
- package/dist/verify-coverage.d.ts +4 -3
- package/dist/verify-coverage.d.ts.map +1 -1
- package/dist/verify-coverage.js +509 -71
- package/dist/verify-coverage.js.map +1 -1
- package/dist/verify.d.ts +153 -15
- package/dist/verify.d.ts.map +1 -1
- package/dist/verify.js +707 -59
- package/dist/verify.js.map +1 -1
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -78,7 +78,7 @@ commands with `npx`: a project-local install is authoritative wherever it
|
|
|
78
78
|
resolves, a project manifest declaring `@sublang/playbook` must install
|
|
79
79
|
it itself, and a global SDK is invisible to a project's nested
|
|
80
80
|
`@sublang/cligent`
|
|
81
|
-
([
|
|
81
|
+
([[release-11](specs/packages/release.md#release-11)] has the full rules).
|
|
82
82
|
|
|
83
83
|
## Quick start
|
|
84
84
|
|
|
@@ -132,7 +132,7 @@ the next one to compile ordinarily. `.slc/` holds verbatim copies of
|
|
|
132
132
|
your source and outputs — treat it as no less private, gitignore it if
|
|
133
133
|
you commit the bundle, and delete it freely. Excluded invocation forms
|
|
134
134
|
and the full rules are in the
|
|
135
|
-
[incremental spec](specs/
|
|
135
|
+
[incremental spec](specs/packages/incremental-compilation.md).
|
|
136
136
|
|
|
137
137
|
## Configuration
|
|
138
138
|
|
|
@@ -147,16 +147,21 @@ either, per key.
|
|
|
147
147
|
agent: claude-code # claude-code | codex | gemini | opencode
|
|
148
148
|
model: claude-opus-4-8 # optional; omit to use the agent CLI's default
|
|
149
149
|
effort: high # optional adapter-scoped reasoning effort
|
|
150
|
+
fastMode: true # optional adapter-scoped fast mode; false is a literal request
|
|
150
151
|
reviewerAgent: codex # optional; enables reviewed compilation
|
|
151
152
|
reviewerModel: gpt-5.3-codex # optional reviewer model
|
|
152
153
|
reviewerEffort: xhigh # optional reviewer reasoning effort
|
|
154
|
+
reviewerFastMode: true # optional reviewer fast mode
|
|
153
155
|
stallTimeout: 600 # seconds of agent silence before a stalled call fails
|
|
154
156
|
pipelinePath: # search roots for <pipeline> references; defaults to the cwd
|
|
155
157
|
- ./pipelines
|
|
156
158
|
```
|
|
157
159
|
|
|
158
|
-
|
|
159
|
-
|
|
160
|
+
Effort and fast mode are adapter-scoped: Cligent's capability contract
|
|
161
|
+
decides which agent CLIs accept them, and a literal on one that does not
|
|
162
|
+
refuses the run before any agent call. Discovery order, `--config`, and
|
|
163
|
+
validation rules live in the [CLI spec](specs/packages/cli.md);
|
|
164
|
+
`slc --help` prints the summary.
|
|
160
165
|
|
|
161
166
|
### Reviewed compilation (two agents)
|
|
162
167
|
|
|
@@ -195,7 +200,7 @@ Every phase runs through a coding agent, one of two ways:
|
|
|
195
200
|
bundled phases this way: `slc` is self-hosting, its phase definitions
|
|
196
201
|
compiled, reviewed, and sha256-pinned under
|
|
197
202
|
[`pipelines/playbook/`](pipelines/playbook), failing closed on drift
|
|
198
|
-
([self-hosting spec](specs/
|
|
203
|
+
([self-hosting spec](specs/packages/self-hosting.md)).
|
|
199
204
|
|
|
200
205
|
Specs are the source of truth — start at the
|
|
201
206
|
[spec map](specs/map.md).
|
package/dist/app.d.ts
CHANGED
|
@@ -11,11 +11,11 @@ export type DepsBuilder = (io: {
|
|
|
11
11
|
env: Record<string, string | undefined>;
|
|
12
12
|
cwd: string;
|
|
13
13
|
signal: AbortSignal;
|
|
14
|
-
/** Explicit `--config <path>`, when given (
|
|
14
|
+
/** Explicit `--config <path>`, when given (cli-20). */
|
|
15
15
|
configPath?: string;
|
|
16
|
-
/** Sink for host notes such as first-run config seeding (DR-015,
|
|
16
|
+
/** Sink for host notes such as first-run config seeding (DR-015, cli-30). */
|
|
17
17
|
note?: (text: string) => void;
|
|
18
|
-
/** The run's progress sink, rendered to stderr by the bin (DR-019,
|
|
18
|
+
/** The run's progress sink, rendered to stderr by the bin (DR-019, cli-35). */
|
|
19
19
|
progress?: ProgressSink;
|
|
20
20
|
}) => SlcDeps | Promise<SlcDeps>;
|
|
21
21
|
/** Injectable IO and configuration for {@link run}; all fields default to the process. */
|
|
@@ -24,9 +24,9 @@ export interface RunOptions {
|
|
|
24
24
|
cwd?: string;
|
|
25
25
|
stdout?: (text: string) => void;
|
|
26
26
|
stderr?: (text: string) => void;
|
|
27
|
-
/** Cancellation signal passed into `runSlc` (
|
|
27
|
+
/** Cancellation signal passed into `runSlc` (cli-10). */
|
|
28
28
|
signal?: AbortSignal;
|
|
29
|
-
/** Overrides production dependency construction (
|
|
29
|
+
/** Overrides production dependency construction (cli-6, cli-7). */
|
|
30
30
|
buildDeps?: DepsBuilder;
|
|
31
31
|
}
|
|
32
32
|
/** The executor factory {@link buildSlcDeps} uses; injected in tests. */
|
|
@@ -35,19 +35,19 @@ export type ExecutorFactory = typeof createConfiguredExecutor;
|
|
|
35
35
|
export type CompiledFactoryBuilder = typeof createConfiguredCompiledFactory;
|
|
36
36
|
/**
|
|
37
37
|
* Builds the production {@link SlcDeps}: a pipeline resolver over the resolved
|
|
38
|
-
* search roots (
|
|
39
|
-
* meta-pipeline definitions `@sublang/playbook` provides (
|
|
40
|
-
* interpreted executor for the resolved agent/model (
|
|
41
|
-
* compiled-execution factory a current pinned phase selects (
|
|
42
|
-
* Configuration is loaded from the config file (DR-006,
|
|
38
|
+
* search roots (cli-6) — with the reserved `slc` reference routed to the
|
|
39
|
+
* meta-pipeline definitions `@sublang/playbook` provides (self-hosting-2) — an
|
|
40
|
+
* interpreted executor for the resolved agent/model (cli-7), and the
|
|
41
|
+
* compiled-execution factory a current pinned phase selects (cli-8, phase-execution-27).
|
|
42
|
+
* Configuration is loaded from the config file (DR-006, cli-20) and
|
|
43
43
|
* then overridden per key by a non-blank environment variable, so existing
|
|
44
44
|
* env-only runs are unchanged and the file fills any key the environment leaves
|
|
45
45
|
* unset.
|
|
46
46
|
*
|
|
47
47
|
* @throws {import('./config-file.js').ConfigFileError} when an explicit
|
|
48
|
-
* `--config` path is absent or the file is malformed or invalid (
|
|
48
|
+
* `--config` path is absent or the file is malformed or invalid (cli-21).
|
|
49
49
|
* @throws {import('./config.js').ConfigError} when neither source supplies an
|
|
50
|
-
* agent, or the resolved agent is unsupported (
|
|
50
|
+
* agent, or the resolved agent is unsupported (cli-12).
|
|
51
51
|
*/
|
|
52
52
|
export declare function buildSlcDeps({ env, cwd, signal, configPath, note, progress }: Parameters<DepsBuilder>[0], createExecutor?: ExecutorFactory, createCompiled?: CompiledFactoryBuilder): Promise<SlcDeps>;
|
|
53
53
|
/** The cligent-invocation selection after merging environment over file (DR-006). */
|
|
@@ -55,34 +55,34 @@ export interface RunConfig {
|
|
|
55
55
|
selection: AgentSelection;
|
|
56
56
|
/** Search-root source: an `SLC_PIPELINE_PATH` string, the file's sequence, or undefined. */
|
|
57
57
|
pipelinePath: string | string[] | undefined;
|
|
58
|
-
/** Agent-stall watchdog window in milliseconds; `0` disables (DR-019,
|
|
58
|
+
/** Agent-stall watchdog window in milliseconds; `0` disables (DR-019, cli-34). */
|
|
59
59
|
stallTimeoutMs: number;
|
|
60
60
|
}
|
|
61
|
-
/** Default agent-stall watchdog window in seconds (DR-019,
|
|
61
|
+
/** Default agent-stall watchdog window in seconds (DR-019, cli-34). */
|
|
62
62
|
export declare const DEFAULT_STALL_TIMEOUT_SECONDS = 600;
|
|
63
63
|
/**
|
|
64
|
-
* Merges the environment over config-file values per key (DR-006,
|
|
64
|
+
* Merges the environment over config-file values per key (DR-006, cli-20): for
|
|
65
65
|
* each key a non-blank environment variable wins, otherwise the file value,
|
|
66
66
|
* otherwise the built-in default. The agent and model go through
|
|
67
67
|
* {@link resolveAgentSelection} so the supported-agent check stays single-sourced
|
|
68
|
-
* (
|
|
68
|
+
* (cli-7, cli-12); the stall timeout defaults to
|
|
69
69
|
* {@link DEFAULT_STALL_TIMEOUT_SECONDS} with `0` disabling the watchdog
|
|
70
|
-
* (DR-019,
|
|
70
|
+
* (DR-019, cli-34).
|
|
71
71
|
*
|
|
72
72
|
* @throws {Error} when `SLC_STALL_TIMEOUT` is not a non-negative number.
|
|
73
73
|
*/
|
|
74
74
|
export declare function resolveRunConfig(env: Record<string, string | undefined>, file: FileConfig): RunConfig;
|
|
75
|
-
/** Usage text naming the documented invocation forms and configuration (
|
|
75
|
+
/** Usage text naming the documented invocation forms and configuration (cli-2). */
|
|
76
76
|
export declare function usageText(): string;
|
|
77
77
|
/**
|
|
78
|
-
* Runs the `slc` command line and returns a process exit code (
|
|
78
|
+
* Runs the `slc` command line and returns a process exit code (`cli` package).
|
|
79
79
|
* Never rejects: configuration refusals and run failures are reported and
|
|
80
80
|
* mapped to a non-zero code.
|
|
81
81
|
*/
|
|
82
82
|
export declare function run(argv: readonly string[], options?: RunOptions): Promise<number>;
|
|
83
83
|
/**
|
|
84
84
|
* Wires `SIGINT`/`SIGTERM` on `emitter` to abort a fresh controller, returning
|
|
85
|
-
* its cancellation signal and a disposer that removes the listeners (
|
|
85
|
+
* its cancellation signal and a disposer that removes the listeners (cli-10).
|
|
86
86
|
* The `cli.ts` shim passes `process`; tests pass a fake emitter so the
|
|
87
87
|
* interrupt-to-abort wiring is exercised without real signals.
|
|
88
88
|
*/
|
package/dist/app.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app.d.ts","sourceRoot":"","sources":["../src/app.ts"],"names":[],"mappings":"AAoBA,OAAO,EACL,+BAA+B,EAC/B,wBAAwB,EAExB,KAAK,cAAc,EACpB,MAAM,aAAa,CAAC;AACrB,OAAO,EAGL,KAAK,UAAU,EAChB,MAAM,kBAAkB,CAAC;AAC1B,OAAO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M,CAAC;CACxB;AAED,uEAAuE;AACvE,eAAO,MAAM,6BAA6B,MAAM,CAAC;AAEjD;;;;;;;;;;GAUG;AACH,wBAAgB,gBAAgB,CAC9B,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,EACvC,IAAI,EAAE,UAAU,GACf,SAAS,CAmBX;AAkCD,mFAAmF;AACnF,wBAAgB,SAAS,IAAI,MAAM,CA8ClC;AA6BD;;;;GAIG;AACH,wBAAsB,GAAG,CACvB,IAAI,EAAE,SAAS,MAAM,EAAE,EACvB,OAAO,GAAE,UAAe,GACvB,OAAO,CAAC,MAAM,CAAC,CA+DjB;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"}
|
package/dist/app.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
// SPDX-License-Identifier: Apache-2.0
|
|
2
2
|
// SPDX-FileCopyrightText: 2026 SubLang International <https://sublang.ai>
|
|
3
3
|
/**
|
|
4
|
-
* The `slc` bin orchestrator (
|
|
4
|
+
* The `slc` bin orchestrator (`cli` package).
|
|
5
5
|
*
|
|
6
6
|
* `run` is the testable command-line entry: it short-circuits `--version` and
|
|
7
|
-
* `--help` before touching any pipeline or agent (
|
|
8
|
-
* the run dependencies from environment configuration (
|
|
9
|
-
* invokes the injectable `runSlc` core under a cancellation signal (
|
|
7
|
+
* `--help` before touching any pipeline or agent (cli-1, cli-2, cli-9), builds
|
|
8
|
+
* the run dependencies from environment configuration (cli-6, cli-7, cli-12),
|
|
9
|
+
* invokes the injectable `runSlc` core under a cancellation signal (cli-10), and
|
|
10
10
|
* maps the result onto process streams and an exit code — produced artifact
|
|
11
|
-
* paths to stdout on success, the failure report to stderr otherwise (
|
|
12
|
-
*
|
|
11
|
+
* paths to stdout on success, the failure report to stderr otherwise (cli-3,
|
|
12
|
+
* cli-4, cli-11). Every IO seam is injectable so the bin is integration-testable
|
|
13
13
|
* without a real agent; the `cli.ts` shim supplies the process-backed defaults
|
|
14
|
-
* and signal wiring. See specs/
|
|
14
|
+
* and signal wiring. See specs/packages/cli.md.
|
|
15
15
|
*/
|
|
16
16
|
import { createRequire } from 'node:module';
|
|
17
17
|
import { messageOf } from './errors.js';
|
|
@@ -33,19 +33,19 @@ export function version() {
|
|
|
33
33
|
}
|
|
34
34
|
/**
|
|
35
35
|
* Builds the production {@link SlcDeps}: a pipeline resolver over the resolved
|
|
36
|
-
* search roots (
|
|
37
|
-
* meta-pipeline definitions `@sublang/playbook` provides (
|
|
38
|
-
* interpreted executor for the resolved agent/model (
|
|
39
|
-
* compiled-execution factory a current pinned phase selects (
|
|
40
|
-
* Configuration is loaded from the config file (DR-006,
|
|
36
|
+
* search roots (cli-6) — with the reserved `slc` reference routed to the
|
|
37
|
+
* meta-pipeline definitions `@sublang/playbook` provides (self-hosting-2) — an
|
|
38
|
+
* interpreted executor for the resolved agent/model (cli-7), and the
|
|
39
|
+
* compiled-execution factory a current pinned phase selects (cli-8, phase-execution-27).
|
|
40
|
+
* Configuration is loaded from the config file (DR-006, cli-20) and
|
|
41
41
|
* then overridden per key by a non-blank environment variable, so existing
|
|
42
42
|
* env-only runs are unchanged and the file fills any key the environment leaves
|
|
43
43
|
* unset.
|
|
44
44
|
*
|
|
45
45
|
* @throws {import('./config-file.js').ConfigFileError} when an explicit
|
|
46
|
-
* `--config` path is absent or the file is malformed or invalid (
|
|
46
|
+
* `--config` path is absent or the file is malformed or invalid (cli-21).
|
|
47
47
|
* @throws {import('./config.js').ConfigError} when neither source supplies an
|
|
48
|
-
* agent, or the resolved agent is unsupported (
|
|
48
|
+
* agent, or the resolved agent is unsupported (cli-12).
|
|
49
49
|
*/
|
|
50
50
|
export async function buildSlcDeps({ env, cwd, signal, configPath, note, progress },
|
|
51
51
|
// Injectable so a test can capture the executor options — notably the
|
|
@@ -65,7 +65,7 @@ createExecutor = createConfiguredExecutor, createCompiled = createConfiguredComp
|
|
|
65
65
|
// Auto-accept the agents' file operations so a non-interactive `slc` run can
|
|
66
66
|
// write its target artifact; the DR-003 generic checks still guard the
|
|
67
67
|
// protected inputs (DR-004). The stall watchdog rides every constructed
|
|
68
|
-
// transport (DR-019,
|
|
68
|
+
// transport (DR-019, cli-35).
|
|
69
69
|
const agentOpts = {
|
|
70
70
|
cwd,
|
|
71
71
|
permissions: { mode: 'auto' },
|
|
@@ -73,7 +73,7 @@ createExecutor = createConfiguredExecutor, createCompiled = createConfiguredComp
|
|
|
73
73
|
};
|
|
74
74
|
const executor = createExecutor(selection, agentOpts);
|
|
75
75
|
// Compiled-runtime status streams to the same reporter as phase progress
|
|
76
|
-
// (
|
|
76
|
+
// (phase-execution-25, cli-32).
|
|
77
77
|
const compiled = createCompiled(selection, {
|
|
78
78
|
...agentOpts,
|
|
79
79
|
onStatus: progress === undefined
|
|
@@ -82,16 +82,16 @@ createExecutor = createConfiguredExecutor, createCompiled = createConfiguredComp
|
|
|
82
82
|
});
|
|
83
83
|
return { resolver, executor, compiled, cwd, signal, progress };
|
|
84
84
|
}
|
|
85
|
-
/** Default agent-stall watchdog window in seconds (DR-019,
|
|
85
|
+
/** Default agent-stall watchdog window in seconds (DR-019, cli-34). */
|
|
86
86
|
export const DEFAULT_STALL_TIMEOUT_SECONDS = 600;
|
|
87
87
|
/**
|
|
88
|
-
* Merges the environment over config-file values per key (DR-006,
|
|
88
|
+
* Merges the environment over config-file values per key (DR-006, cli-20): for
|
|
89
89
|
* each key a non-blank environment variable wins, otherwise the file value,
|
|
90
90
|
* otherwise the built-in default. The agent and model go through
|
|
91
91
|
* {@link resolveAgentSelection} so the supported-agent check stays single-sourced
|
|
92
|
-
* (
|
|
92
|
+
* (cli-7, cli-12); the stall timeout defaults to
|
|
93
93
|
* {@link DEFAULT_STALL_TIMEOUT_SECONDS} with `0` disabling the watchdog
|
|
94
|
-
* (DR-019,
|
|
94
|
+
* (DR-019, cli-34).
|
|
95
95
|
*
|
|
96
96
|
* @throws {Error} when `SLC_STALL_TIMEOUT` is not a non-negative number.
|
|
97
97
|
*/
|
|
@@ -100,9 +100,11 @@ export function resolveRunConfig(env, file) {
|
|
|
100
100
|
SLC_AGENT: nonBlank(env.SLC_AGENT) ?? file.agent,
|
|
101
101
|
SLC_MODEL: nonBlank(env.SLC_MODEL) ?? file.model,
|
|
102
102
|
SLC_EFFORT: nonBlank(env.SLC_EFFORT) ?? file.effort,
|
|
103
|
+
SLC_FAST_MODE: nonBlank(env.SLC_FAST_MODE) ?? flag(file.fastMode),
|
|
103
104
|
SLC_REVIEWER_AGENT: nonBlank(env.SLC_REVIEWER_AGENT) ?? file.reviewerAgent,
|
|
104
105
|
SLC_REVIEWER_MODEL: nonBlank(env.SLC_REVIEWER_MODEL) ?? file.reviewerModel,
|
|
105
106
|
SLC_REVIEWER_EFFORT: nonBlank(env.SLC_REVIEWER_EFFORT) ?? file.reviewerEffort,
|
|
107
|
+
SLC_REVIEWER_FAST_MODE: nonBlank(env.SLC_REVIEWER_FAST_MODE) ?? flag(file.reviewerFastMode),
|
|
106
108
|
});
|
|
107
109
|
const pipelinePath = nonBlank(env.SLC_PIPELINE_PATH) ?? file.pipelinePath;
|
|
108
110
|
const stallSeconds = parseStallTimeout(nonBlank(env.SLC_STALL_TIMEOUT)) ??
|
|
@@ -128,7 +130,15 @@ function parseStallTimeout(value) {
|
|
|
128
130
|
function nonBlank(value) {
|
|
129
131
|
return value !== undefined && value.trim() !== '' ? value : undefined;
|
|
130
132
|
}
|
|
131
|
-
/**
|
|
133
|
+
/**
|
|
134
|
+
* Renders a file boolean in the exact `true`/`false` form its environment
|
|
135
|
+
* variable accepts, so one resolver validates both sources (cli-7); a
|
|
136
|
+
* literal `false` stays a request, and an absent key stays absent.
|
|
137
|
+
*/
|
|
138
|
+
function flag(value) {
|
|
139
|
+
return value === undefined ? undefined : String(value);
|
|
140
|
+
}
|
|
141
|
+
/** Usage text naming the documented invocation forms and configuration (cli-2). */
|
|
132
142
|
export function usageText() {
|
|
133
143
|
return [
|
|
134
144
|
'Usage:',
|
|
@@ -158,15 +168,18 @@ export function usageText() {
|
|
|
158
168
|
' environment variable below:',
|
|
159
169
|
' ./slc.config.yaml',
|
|
160
170
|
' ${XDG_CONFIG_HOME:-~/.config}/slc/config.yaml',
|
|
161
|
-
' Keys: agent, model, effort, reviewerAgent, reviewerModel,',
|
|
162
|
-
' reviewerEffort, pipelinePath, stallTimeout.',
|
|
171
|
+
' Keys: agent, model, effort, fastMode, reviewerAgent, reviewerModel,',
|
|
172
|
+
' reviewerEffort, reviewerFastMode, pipelinePath, stallTimeout.',
|
|
163
173
|
'',
|
|
164
174
|
' SLC_AGENT agent CLI: claude-code | codex | gemini | opencode',
|
|
165
175
|
' SLC_MODEL optional model for the agent CLI',
|
|
166
176
|
' SLC_EFFORT optional adapter-scoped reasoning effort (e.g. xhigh)',
|
|
177
|
+
' SLC_FAST_MODE optional adapter-scoped fast mode: true | false',
|
|
178
|
+
' (omit for the agent CLI default)',
|
|
167
179
|
' SLC_REVIEWER_AGENT optional independent reviewer; enables reviewed compilation',
|
|
168
180
|
' SLC_REVIEWER_MODEL optional model for the reviewer agent CLI',
|
|
169
181
|
' SLC_REVIEWER_EFFORT optional adapter-scoped reviewer reasoning effort',
|
|
182
|
+
' SLC_REVIEWER_FAST_MODE optional adapter-scoped reviewer fast mode: true | false',
|
|
170
183
|
' SLC_PIPELINE_PATH search roots for <pipeline> references (default: cwd)',
|
|
171
184
|
' SLC_STALL_TIMEOUT seconds of agent inactivity before a stalled call',
|
|
172
185
|
' fails the run (default: 600; 0 disables)',
|
|
@@ -175,7 +188,7 @@ export function usageText() {
|
|
|
175
188
|
}
|
|
176
189
|
/**
|
|
177
190
|
* Splits `--config <path>` out of argv, returning the path and the remaining
|
|
178
|
-
* arguments for `runSlc` (
|
|
191
|
+
* arguments for `runSlc` (cli-20). `--config` is a bin-level flag, so it is
|
|
179
192
|
* removed before the grammar parser, which rejects unknown options.
|
|
180
193
|
*
|
|
181
194
|
* @throws {Error} when `--config` is given without a following value.
|
|
@@ -198,14 +211,14 @@ function extractConfigFlag(argv) {
|
|
|
198
211
|
return { configPath, rest };
|
|
199
212
|
}
|
|
200
213
|
/**
|
|
201
|
-
* Runs the `slc` command line and returns a process exit code (
|
|
214
|
+
* Runs the `slc` command line and returns a process exit code (`cli` package).
|
|
202
215
|
* Never rejects: configuration refusals and run failures are reported and
|
|
203
216
|
* mapped to a non-zero code.
|
|
204
217
|
*/
|
|
205
218
|
export async function run(argv, options = {}) {
|
|
206
219
|
const stdout = options.stdout ?? ((text) => void process.stdout.write(text));
|
|
207
220
|
const stderr = options.stderr ?? ((text) => void process.stderr.write(text));
|
|
208
|
-
// Conveniences short-circuit before any pipeline or agent work (
|
|
221
|
+
// Conveniences short-circuit before any pipeline or agent work (cli-1, cli-2, cli-9).
|
|
209
222
|
if (hasFlag(argv, '--version', '-v')) {
|
|
210
223
|
stdout(`${name} ${version()}\n`);
|
|
211
224
|
return 0;
|
|
@@ -218,13 +231,13 @@ export async function run(argv, options = {}) {
|
|
|
218
231
|
const cwd = options.cwd ?? process.cwd();
|
|
219
232
|
const signal = options.signal ?? new AbortController().signal;
|
|
220
233
|
// In-run progress renders on stderr as it happens, with the silence-bounded
|
|
221
|
-
// heartbeat (DR-019,
|
|
234
|
+
// heartbeat (DR-019, cli-32, cli-33, cli-35).
|
|
222
235
|
const reporter = createProgressReporter(stderr);
|
|
223
236
|
let deps;
|
|
224
237
|
let rest;
|
|
225
238
|
try {
|
|
226
239
|
// `--config <path>` is a bin-level flag: strip it before runSlc, whose
|
|
227
|
-
// grammar (parseInvocation) rejects unknown options (
|
|
240
|
+
// grammar (parseInvocation) rejects unknown options (cli-20).
|
|
228
241
|
const extracted = extractConfigFlag(argv);
|
|
229
242
|
rest = extracted.rest;
|
|
230
243
|
deps = await (options.buildDeps ?? buildSlcDeps)({
|
|
@@ -238,7 +251,7 @@ export async function run(argv, options = {}) {
|
|
|
238
251
|
}
|
|
239
252
|
catch (error) {
|
|
240
253
|
// Configuration refusals — a bad `--config`, an invalid config file
|
|
241
|
-
// (
|
|
254
|
+
// (cli-21), or an unset/unsupported agent (cli-12) — fail the run.
|
|
242
255
|
reporter.dispose();
|
|
243
256
|
stderr(`${name}: ${messageOf(error)}\n`);
|
|
244
257
|
return 1;
|
|
@@ -255,7 +268,7 @@ export async function run(argv, options = {}) {
|
|
|
255
268
|
stdout('up to date\n');
|
|
256
269
|
else if (result.outputs.length > 0)
|
|
257
270
|
stdout(`${result.outputs.join('\n')}\n`);
|
|
258
|
-
// Surface
|
|
271
|
+
// Surface benign ambiguity resolved during the run without polluting paths.
|
|
259
272
|
if (result.diagnostics.length > 0)
|
|
260
273
|
stderr(`${result.diagnostics.join('\n')}\n`);
|
|
261
274
|
return 0;
|
|
@@ -266,7 +279,7 @@ export async function run(argv, options = {}) {
|
|
|
266
279
|
}
|
|
267
280
|
/**
|
|
268
281
|
* Wires `SIGINT`/`SIGTERM` on `emitter` to abort a fresh controller, returning
|
|
269
|
-
* its cancellation signal and a disposer that removes the listeners (
|
|
282
|
+
* its cancellation signal and a disposer that removes the listeners (cli-10).
|
|
270
283
|
* The `cli.ts` shim passes `process`; tests pass a fake emitter so the
|
|
271
284
|
* interrupt-to-abort wiring is exercised without real signals.
|
|
272
285
|
*/
|
package/dist/app.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app.js","sourceRoot":"","sources":["../src/app.ts"],"names":[],"mappings":"AAAA,sCAAsC;AACtC,0EAA0E;AAE1E;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,C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,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC/C,OAAO,CAAC,CAAC;AACX,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,eAAe,CAAC,OAG/B;IACC,MAAM,UAAU,GAAG,IAAI,eAAe,EAAE,CAAC;IACzC,MAAM,WAAW,GAAG,GAAS,EAAE,CAAC,UAAU,CAAC,KAAK,EAAE,CAAC;IACnD,OAAO,CAAC,IAAI,CAAC,QAAQ,EAAE,WAAW,CAAC,CAAC;IACpC,OAAO,CAAC,IAAI,CAAC,SAAS,EAAE,WAAW,CAAC,CAAC;IACrC,OAAO;QACL,MAAM,EAAE,UAAU,CAAC,MAAM;QACzB,OAAO,EAAE,GAAG,EAAE;YACZ,OAAO,CAAC,cAAc,CAAC,QAAQ,EAAE,WAAW,CAAC,CAAC;YAC9C,OAAO,CAAC,cAAc,CAAC,SAAS,EAAE,WAAW,CAAC,CAAC;QACjD,CAAC;KACF,CAAC;AACJ,CAAC;AAED,kEAAkE;AAClE,SAAS,OAAO,CAAC,IAAuB,EAAE,GAAG,KAAe;IAC1D,OAAO,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC;AACjD,CAAC"}
|
package/dist/artifacts.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Phase } from './phase.js';
|
|
2
2
|
/** Machine-readable reason a source path was refused. */
|
|
3
3
|
export type SourceErrorCode = 'invalid-source-name';
|
|
4
|
-
/** Raised when a source filename matches no applicable form (
|
|
4
|
+
/** Raised when a source filename matches no applicable form (pipeline-6). */
|
|
5
5
|
export declare class SourceError extends Error {
|
|
6
6
|
readonly code: SourceErrorCode;
|
|
7
7
|
constructor(code: SourceErrorCode, message: string);
|
|
@@ -12,13 +12,13 @@ export interface ParsedSource {
|
|
|
12
12
|
basename: string;
|
|
13
13
|
/**
|
|
14
14
|
* True when an entry source carries a foreign extension: a raw input whose
|
|
15
|
-
* compilation auto-schedules normalization (DR-014,
|
|
15
|
+
* compilation auto-schedules normalization (DR-014, pipeline-6, pipeline-34).
|
|
16
16
|
*/
|
|
17
17
|
raw: boolean;
|
|
18
18
|
}
|
|
19
19
|
/**
|
|
20
20
|
* Validates a source path against the consuming phase's source format and
|
|
21
|
-
* extension, returning its `<basename>` (
|
|
21
|
+
* extension, returning its `<basename>` (pipeline-6).
|
|
22
22
|
*
|
|
23
23
|
* The non-entry form requires `<basename>.<source-format>.<ext>`; the entry form
|
|
24
24
|
* also accepts the plain `<basename>.<ext>`, and an entry source with any other
|
|
@@ -36,10 +36,10 @@ export declare function parseSource(opts: {
|
|
|
36
36
|
/**
|
|
37
37
|
* Computes the artifact directory under the invocation working directory,
|
|
38
38
|
* reusing the working directory itself without nesting when its leaf is
|
|
39
|
-
* already the canonical `<basename>.<pipeline>` (
|
|
39
|
+
* already the canonical `<basename>.<pipeline>` (pipeline-7, DR-014).
|
|
40
40
|
*/
|
|
41
41
|
export declare function artifactDir(cwd: string, basename: string, pipeline: string): string;
|
|
42
|
-
/** Computes the canonical path of a `<basename>.<format>.<ext>` artifact (
|
|
42
|
+
/** Computes the canonical path of a `<basename>.<format>.<ext>` artifact (pipeline-8). */
|
|
43
43
|
export declare function artifactPath(artDir: string, basename: string, format: string, ext: string): string;
|
|
44
44
|
/** A planned artifact: the phase that writes it, its path, and its pipeline role. */
|
|
45
45
|
export interface ArtifactPlan {
|
|
@@ -50,7 +50,7 @@ export interface ArtifactPlan {
|
|
|
50
50
|
/**
|
|
51
51
|
* Plans the target artifact each phase writes: every non-terminal phase writes a
|
|
52
52
|
* canonical intermediate, and the terminal phase writes the output, overridden by
|
|
53
|
-
* `output` (`-o`) when provided while intermediates stay canonical (
|
|
53
|
+
* `output` (`-o`) when provided while intermediates stay canonical (pipeline-8).
|
|
54
54
|
*/
|
|
55
55
|
export declare function planArtifacts(opts: {
|
|
56
56
|
phases: readonly Phase[];
|
package/dist/artifacts.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"artifacts.d.ts","sourceRoot":"","sources":["../src/artifacts.ts"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAExC,yDAAyD;AACzD,MAAM,MAAM,eAAe,GAAG,qBAAqB,CAAC;AAEpD,
|
|
1
|
+
{"version":3,"file":"artifacts.d.ts","sourceRoot":"","sources":["../src/artifacts.ts"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAExC,yDAAyD;AACzD,MAAM,MAAM,eAAe,GAAG,qBAAqB,CAAC;AAEpD,6EAA6E;AAC7E,qBAAa,WAAY,SAAQ,KAAK;IACpC,QAAQ,CAAC,IAAI,EAAE,eAAe,CAAC;gBAEnB,IAAI,EAAE,eAAe,EAAE,OAAO,EAAE,MAAM;CAKnD;AAED,iFAAiF;AACjF,MAAM,WAAW,YAAY;IAC3B,4EAA4E;IAC5E,QAAQ,EAAE,MAAM,CAAC;IACjB;;;OAGG;IACH,GAAG,EAAE,OAAO,CAAC;CACd;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,EAAE,MAAM,CAAC;IACrB,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,OAAO,CAAC;CAChB,GAAG,YAAY,CA4Cf;AAED;;;;GAIG;AACH,wBAAgB,WAAW,CACzB,GAAG,EAAE,MAAM,EACX,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,MAAM,GACf,MAAM,CAMR;AAED,0FAA0F;AAC1F,wBAAgB,YAAY,CAC1B,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,MAAM,EACd,GAAG,EAAE,MAAM,GACV,MAAM,CAER;AAED,qFAAqF;AACrF,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,KAAK,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,cAAc,GAAG,QAAQ,CAAC;CACjC;AAED;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE;IAClC,MAAM,EAAE,SAAS,KAAK,EAAE,CAAC;IACzB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,GAAG,YAAY,EAAE,CAgBjB"}
|
package/dist/artifacts.js
CHANGED
|
@@ -3,14 +3,14 @@
|
|
|
3
3
|
/**
|
|
4
4
|
* Source-name validation and artifact-path computation (DR-001, DR-014).
|
|
5
5
|
*
|
|
6
|
-
* Implements
|
|
7
|
-
* foreign-extension entry source accepted as a raw input),
|
|
6
|
+
* Implements pipeline-6 (the entry/non-entry source filename forms, with a
|
|
7
|
+
* foreign-extension entry source accepted as a raw input), pipeline-7 (compute the
|
|
8
8
|
* artifact directory under the invocation working directory, reusing it without
|
|
9
|
-
* nesting), and
|
|
10
|
-
* specs/
|
|
9
|
+
* nesting), and pipeline-8 (place intermediates and the output, honoring `-o`). See
|
|
10
|
+
* specs/packages/pipeline.md.
|
|
11
11
|
*/
|
|
12
12
|
import { basename as pathBasename, extname, join } from 'node:path';
|
|
13
|
-
/** Raised when a source filename matches no applicable form (
|
|
13
|
+
/** Raised when a source filename matches no applicable form (pipeline-6). */
|
|
14
14
|
export class SourceError extends Error {
|
|
15
15
|
code;
|
|
16
16
|
constructor(code, message) {
|
|
@@ -21,7 +21,7 @@ export class SourceError extends Error {
|
|
|
21
21
|
}
|
|
22
22
|
/**
|
|
23
23
|
* Validates a source path against the consuming phase's source format and
|
|
24
|
-
* extension, returning its `<basename>` (
|
|
24
|
+
* extension, returning its `<basename>` (pipeline-6).
|
|
25
25
|
*
|
|
26
26
|
* The non-entry form requires `<basename>.<source-format>.<ext>`; the entry form
|
|
27
27
|
* also accepts the plain `<basename>.<ext>`, and an entry source with any other
|
|
@@ -64,7 +64,7 @@ export function parseSource(opts) {
|
|
|
64
64
|
/**
|
|
65
65
|
* Computes the artifact directory under the invocation working directory,
|
|
66
66
|
* reusing the working directory itself without nesting when its leaf is
|
|
67
|
-
* already the canonical `<basename>.<pipeline>` (
|
|
67
|
+
* already the canonical `<basename>.<pipeline>` (pipeline-7, DR-014).
|
|
68
68
|
*/
|
|
69
69
|
export function artifactDir(cwd, basename, pipeline) {
|
|
70
70
|
const canonicalLeaf = `${basename}.${pipeline}`;
|
|
@@ -73,14 +73,14 @@ export function artifactDir(cwd, basename, pipeline) {
|
|
|
73
73
|
}
|
|
74
74
|
return join(cwd, canonicalLeaf);
|
|
75
75
|
}
|
|
76
|
-
/** Computes the canonical path of a `<basename>.<format>.<ext>` artifact (
|
|
76
|
+
/** Computes the canonical path of a `<basename>.<format>.<ext>` artifact (pipeline-8). */
|
|
77
77
|
export function artifactPath(artDir, basename, format, ext) {
|
|
78
78
|
return join(artDir, `${basename}.${format}${ext}`);
|
|
79
79
|
}
|
|
80
80
|
/**
|
|
81
81
|
* Plans the target artifact each phase writes: every non-terminal phase writes a
|
|
82
82
|
* canonical intermediate, and the terminal phase writes the output, overridden by
|
|
83
|
-
* `output` (`-o`) when provided while intermediates stay canonical (
|
|
83
|
+
* `output` (`-o`) when provided while intermediates stay canonical (pipeline-8).
|
|
84
84
|
*/
|
|
85
85
|
export function planArtifacts(opts) {
|
|
86
86
|
const { phases, basename, artDir, output } = opts;
|
package/dist/artifacts.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"artifacts.js","sourceRoot":"","sources":["../src/artifacts.ts"],"names":[],"mappings":"AAAA,sCAAsC;AACtC,0EAA0E;AAE1E;;;;;;;;GAQG;AAEH,OAAO,EAAE,QAAQ,IAAI,YAAY,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAOpE,
|
|
1
|
+
{"version":3,"file":"artifacts.js","source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,IAAI,MAAM,GAAG,GAAG,EAAE,CAAC,CAAC;AACrD,CAAC;AASD;;;;GAIG;AACH,MAAM,UAAU,aAAa,CAAC,IAK7B;IACC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;IAClD,OAAO,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE;QACjC,MAAM,UAAU,GAAG,KAAK,KAAK,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC;QAC/C,MAAM,SAAS,GAAG,YAAY,CAC5B,MAAM,EACN,QAAQ,EACR,KAAK,CAAC,MAAM,CAAC,MAAM,EACnB,KAAK,CAAC,MAAM,CAAC,GAAG,CACjB,CAAC;QACF,OAAO;YACL,KAAK;YACL,IAAI,EAAE,UAAU,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,cAAc;YAC5C,IAAI,EAAE,UAAU,IAAI,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS;SAC9D,CAAC;IACJ,CAAC,CAAC,CAAC;AACL,CAAC"}
|
package/dist/cli.js
CHANGED
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
// SPDX-License-Identifier: Apache-2.0
|
|
3
3
|
// SPDX-FileCopyrightText: 2026 SubLang International <https://sublang.ai>
|
|
4
4
|
/**
|
|
5
|
-
* The published `slc` executable shim (
|
|
5
|
+
* The published `slc` executable shim (`cli` package).
|
|
6
6
|
*
|
|
7
7
|
* It supplies the process-backed defaults `run` falls back to and wires
|
|
8
8
|
* cancellation through `interruptSignal`: an interrupt aborts the in-flight run
|
|
9
|
-
* via the signal passed into `runSlc` (
|
|
10
|
-
* becomes the process exit status (
|
|
9
|
+
* via the signal passed into `runSlc` (cli-10), and the returned exit code
|
|
10
|
+
* becomes the process exit status (cli-11). All behavior lives in the testable
|
|
11
11
|
* `run`/`interruptSignal`; see app.ts.
|
|
12
12
|
*/
|
|
13
13
|
import { messageOf } from './errors.js';
|
package/dist/cligent-agent.d.ts
CHANGED
|
@@ -13,14 +13,21 @@ export interface WatchdogTimers {
|
|
|
13
13
|
export declare const defaultWatchdogTimers: WatchdogTimers;
|
|
14
14
|
/** Wraps a Cligent adapter as an {@link AgentClient} for the interpreter. */
|
|
15
15
|
export declare function createCligentAgent(opts: {
|
|
16
|
-
adapter
|
|
16
|
+
/** Any Cligent adapter; effort is validated adapter-scoped upstream (cli-12). */
|
|
17
|
+
adapter: AgentAdapter<string, boolean>;
|
|
17
18
|
maxTurns?: number;
|
|
18
19
|
permissions?: PermissionPolicy;
|
|
19
20
|
/** Adapter-scoped reasoning effort, validated by the configuration layer. */
|
|
20
21
|
effort?: string;
|
|
22
|
+
/**
|
|
23
|
+
* Literal adapter-scoped fast-mode request (`false` asks for it off), its
|
|
24
|
+
* adapter support validated by the configuration layer; absent leaves the
|
|
25
|
+
* agent CLI's default.
|
|
26
|
+
*/
|
|
27
|
+
fastMode?: boolean;
|
|
21
28
|
/**
|
|
22
29
|
* Milliseconds of adapter-event inactivity after which the in-flight call is
|
|
23
|
-
* aborted and reported as an error (DR-019,
|
|
30
|
+
* aborted and reported as an error (DR-019, phase-execution-36). Zero or absent
|
|
24
31
|
* disables the watchdog.
|
|
25
32
|
*/
|
|
26
33
|
stallTimeoutMs?: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cligent-agent.d.ts","sourceRoot":"","sources":["../src/cligent-agent.ts"],"names":[],"mappings":"AAyBA,OAAO,KAAK,EACV,YAAY,
|
|
1
|
+
{"version":3,"file":"cligent-agent.d.ts","sourceRoot":"","sources":["../src/cligent-agent.ts"],"names":[],"mappings":"AAyBA,OAAO,KAAK,EACV,YAAY,EAEZ,gBAAgB,EACjB,MAAM,kBAAkB,CAAC;AAE1B,OAAO,KAAK,EAAE,WAAW,EAAkB,MAAM,kBAAkB,CAAC;AAGpE,6DAA6D;AAC7D,MAAM,WAAW,cAAc;IAC7B,UAAU,CAAC,QAAQ,EAAE,MAAM,IAAI,EAAE,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC;IACtD,YAAY,CAAC,MAAM,EAAE,OAAO,GAAG,IAAI,CAAC;CACrC;AAED;;;;GAIG;AACH,eAAO,MAAM,qBAAqB,EAAE,cASnC,CAAC;AAEF,6EAA6E;AAC7E,wBAAgB,kBAAkB,CAAC,IAAI,EAAE;IACvC,iFAAiF;IACjF,OAAO,EAAE,YAAY,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACvC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,gBAAgB,CAAC;IAC/B,6EAA6E;IAC7E,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;;OAIG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,wEAAwE;IACxE,cAAc,CAAC,EAAE,cAAc,CAAC;CACjC,GAAG,WAAW,CAkFd"}
|
package/dist/cligent-agent.js
CHANGED
|
@@ -6,19 +6,19 @@
|
|
|
6
6
|
* Backs the interpreter's agent transport with Cligent (npm `@sublang/cligent`),
|
|
7
7
|
* draining its event stream into a normalized {@link AgentRunResult}. The host
|
|
8
8
|
* supplies the concrete `AgentAdapter` (e.g. Claude Code, Codex) and any write
|
|
9
|
-
* permissions, keeping agent selection a configuration concern (
|
|
9
|
+
* permissions, keeping agent selection a configuration concern (phase-execution-13); the
|
|
10
10
|
* DR-003 write-scope sandbox would be configured here via `permissions`.
|
|
11
11
|
*
|
|
12
|
-
* The transport also owns the agent-stall watchdog (DR-019,
|
|
12
|
+
* The transport also owns the agent-stall watchdog (DR-019, phase-execution-36): with a
|
|
13
13
|
* positive `stallTimeoutMs`, an in-flight call that observes no adapter event
|
|
14
14
|
* for that window is aborted through a call-local controller — the caller's
|
|
15
15
|
* signal is composed in, never mutated — and reported as an error carrying the
|
|
16
16
|
* inactivity duration. Cligent's abort drain guarantees the event loop then
|
|
17
17
|
* terminates promptly with a terminal event, so a tripped watchdog cannot
|
|
18
|
-
* itself hang. No retry occurs at this seam (
|
|
18
|
+
* itself hang. No retry occurs at this seam (phase-execution-12, phase-execution-23).
|
|
19
19
|
*
|
|
20
20
|
* This transport is exercised by integration runs and by tests that fake the
|
|
21
|
-
* adapter's event stream. See specs/
|
|
21
|
+
* adapter's event stream. See specs/packages/phase-execution.md.
|
|
22
22
|
*/
|
|
23
23
|
import { Cligent } from '@sublang/cligent';
|
|
24
24
|
import { formatElapsed } from './progress.js';
|
|
@@ -42,8 +42,9 @@ export function createCligentAgent(opts) {
|
|
|
42
42
|
const cligent = new Cligent(opts.adapter, {
|
|
43
43
|
maxTurns: opts.maxTurns,
|
|
44
44
|
permissions: opts.permissions,
|
|
45
|
-
//
|
|
45
|
+
// Both validated adapter-scoped by the configuration layer (cli-7, cli-12).
|
|
46
46
|
...(opts.effort !== undefined ? { effort: opts.effort } : {}),
|
|
47
|
+
...(opts.fastMode !== undefined ? { fastMode: opts.fastMode } : {}),
|
|
47
48
|
});
|
|
48
49
|
const stallMs = opts.stallTimeoutMs ?? 0;
|
|
49
50
|
const timers = opts.watchdogTimers ?? defaultWatchdogTimers;
|