@llm4ts/shell 3.3.0 → 4.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +36 -0
- package/dist/Cli.d.ts +4 -4
- package/dist/Cli.d.ts.map +1 -1
- package/dist/Cli.js +5 -4
- package/dist/Cli.js.map +1 -1
- package/dist/CoderChoice.d.ts +2 -4
- package/dist/CoderChoice.d.ts.map +1 -1
- package/dist/CoderChoice.js +8 -12
- package/dist/CoderChoice.js.map +1 -1
- package/dist/Config.d.ts +3 -3
- package/dist/Config.d.ts.map +1 -1
- package/dist/Config.js +8 -6
- package/dist/Config.js.map +1 -1
- package/dist/ConfigEdit.js +4 -4
- package/dist/ConfigEdit.js.map +1 -1
- package/dist/Costs.d.ts +52 -0
- package/dist/Costs.d.ts.map +1 -0
- package/dist/Costs.js +95 -0
- package/dist/Costs.js.map +1 -0
- package/dist/OperatorActTools.d.ts +1 -1
- package/dist/OperatorActTools.d.ts.map +1 -1
- package/dist/OperatorActTools.js +1 -1
- package/dist/OperatorActTools.js.map +1 -1
- package/dist/OperatorConfig.d.ts.map +1 -1
- package/dist/OperatorConfig.js +2 -1
- package/dist/OperatorConfig.js.map +1 -1
- package/dist/OperatorNode.js +2 -2
- package/dist/OperatorNode.js.map +1 -1
- package/dist/OperatorRuns.d.ts +1 -1
- package/dist/OperatorRuns.d.ts.map +1 -1
- package/dist/OperatorRuns.js +1 -1
- package/dist/OperatorRuns.js.map +1 -1
- package/dist/OperatorTools.d.ts +4 -2
- package/dist/OperatorTools.d.ts.map +1 -1
- package/dist/OperatorTools.js +4 -4
- package/dist/OperatorTools.js.map +1 -1
- package/dist/Profile.d.ts +313 -0
- package/dist/Profile.d.ts.map +1 -0
- package/dist/Profile.js +937 -0
- package/dist/Profile.js.map +1 -0
- package/dist/Refine.d.ts.map +1 -1
- package/dist/Refine.js +3 -2
- package/dist/Refine.js.map +1 -1
- package/dist/RunReaders.d.ts +70 -0
- package/dist/RunReaders.d.ts.map +1 -0
- package/dist/RunReaders.js +236 -0
- package/dist/RunReaders.js.map +1 -0
- package/dist/StoryReaders.d.ts +16 -0
- package/dist/StoryReaders.d.ts.map +1 -0
- package/dist/StoryReaders.js +107 -0
- package/dist/StoryReaders.js.map +1 -0
- package/dist/Watch.d.ts +68 -0
- package/dist/Watch.d.ts.map +1 -0
- package/dist/Watch.js +261 -0
- package/dist/Watch.js.map +1 -0
- package/flows/epic-design.js +7 -5
- package/flows/epic-retro.js +3 -2
- package/flows/implement.js +3 -2
- package/flows/issue-pr.js +3 -2
- package/flows/judge-suite.js +2 -2
- package/flows/lib/debt.js +2 -2
- package/flows/lib/epic-design.js +1 -1
- package/flows/lib/epic-retro.js +3 -6
- package/flows/lib/epic-stories.js +53 -118
- package/flows/lib/modernize-extract.js +6 -9
- package/flows/lib/pack-fork.js +8 -10
- package/flows/lib/port.js +8 -10
- package/flows/local.js +3 -2
- package/flows/modernize-bench.js +11 -6
- package/flows/modernize-extract.js +9 -8
- package/flows/modernize-implement.js +5 -8
- package/flows/modernize-pack-check.js +2 -1
- package/flows/modernize-pack-upgrade.js +2 -1
- package/flows/modernize-refine.js +7 -6
- package/flows/modernize-review.js +4 -5
- package/flows/modernize-seed.js +8 -8
- package/flows/modernize-survey.js +5 -8
- package/flows/modernize-verify.js +3 -3
- package/flows/pack-fork.js +5 -4
- package/flows/port-compile.js +4 -3
- package/flows/port-files.js +2 -2
- package/flows/port-guide.js +6 -5
- package/flows/port-ledger.js +3 -3
- package/flows/port-tests.js +5 -4
- package/flows/roundtable.js +2 -2
- package/flows/sdd.js +8 -13
- package/flows/taskforce.js +5 -4
- package/kits/j2ee-nextjs/flows/convert-all.js +8 -7
- package/kits/j2ee-nextjs/flows/convert-feature.js +2 -2
- package/kits/j2ee-nextjs/flows/convert-page.js +2 -2
- package/kits/j2ee-nextjs/flows/lib/convert.js +9 -13
- package/kits/soap-ace/flows/soap-design.js +5 -8
- package/kits/soap-ace/flows/soap-discover.js +4 -3
- package/kits/soap-ace/flows/soap-epic.js +4 -7
- package/kits/soap-ace/flows/soap-explore.js +8 -7
- package/kits/soap-ace/flows/soap-sample.js +10 -10
- package/kits/soap-ace/tools/soap-call.js +3 -2
- package/package.json +4 -24
- package/src/Cli.ts +6 -9
- package/src/CoderChoice.ts +10 -16
- package/src/Config.ts +9 -5
- package/src/ConfigEdit.ts +4 -4
- package/src/Costs.ts +148 -0
- package/src/OperatorActTools.ts +1 -1
- package/src/OperatorConfig.ts +2 -1
- package/src/OperatorNode.ts +2 -2
- package/src/OperatorRuns.ts +1 -1
- package/src/OperatorTools.ts +4 -4
- package/src/Profile.ts +1196 -0
- package/src/Refine.ts +3 -2
- package/src/RunReaders.ts +370 -0
- package/src/StoryReaders.ts +157 -0
- package/src/Watch.ts +451 -0
|
@@ -23,7 +23,7 @@ import * as Effect from "effect/Effect";
|
|
|
23
23
|
import { withContract } from "@llm4ts/flow/AutonomyContract";
|
|
24
24
|
import { Dimension, Sample } from "@llm4ts/core/eval/Eval";
|
|
25
25
|
import { judge } from "@llm4ts/core/eval/Judge";
|
|
26
|
-
import { FlowAborted, FlowLlmError, Info, ReviewResult, asReadOnly,
|
|
26
|
+
import { FlowAborted, FlowLlmError, Info, ReviewResult, asReadOnly, coderFromEnvironment, implementTaskLoop, lintCommand, loadKitPatternCards, makeChat, makeNodeWorkspace, makePlanStore, mergeReviewResults, minimalReviewers, nodePlainFileStore, nodeProcessExecutor, openPack, resolveFlowInput, reviewAndFixLoop, runFlowMain, runNode, stage } from "@llm4ts/runner";
|
|
27
27
|
import { capped, renderTruncation, truncations, withShrink } from "@llm4ts/flow/Context";
|
|
28
28
|
import { FlowEvents } from "@llm4ts/flow/FlowEvents";
|
|
29
29
|
import { judgeAllPrograms } from "@llm4ts/flow/ProgramJudge";
|
|
@@ -34,11 +34,9 @@ import { nodePreflight } from "@llm4ts/flow/NodePreflight";
|
|
|
34
34
|
import { ReviewIssue } from "@llm4ts/flow/Review";
|
|
35
35
|
import { checkWall, wallBreachMessage } from "@llm4ts/flow/Wall";
|
|
36
36
|
import { parseDecisions } from "@llm4ts/flow/Decisions";
|
|
37
|
+
import { settingValue } from "@llm4ts/flow/Settings";
|
|
37
38
|
const ModDir = "docs/modernization";
|
|
38
|
-
const judgeRounds = () =>
|
|
39
|
-
const raw = Number.parseInt(process.env.LLM4TS_JUDGE_ROUNDS ?? "", 10);
|
|
40
|
-
return Number.isFinite(raw) && raw > 0 ? raw : 2;
|
|
41
|
-
};
|
|
39
|
+
const judgeRounds = () => settingValue("LLM4TS_JUDGE_ROUNDS", process.env) ?? 2;
|
|
42
40
|
const complianceDimensions = [
|
|
43
41
|
Dimension.make({
|
|
44
42
|
name: "spec-compliance",
|
|
@@ -144,7 +142,7 @@ const recordTruncations = (manifestPath, events) => Effect.gen(function* () {
|
|
|
144
142
|
});
|
|
145
143
|
const program = Effect.gen(function* () {
|
|
146
144
|
const input = yield* resolveFlowInput("Implement the seeded modernization plan");
|
|
147
|
-
const coder =
|
|
145
|
+
const coder = yield* coderFromEnvironment();
|
|
148
146
|
const files = nodePlainFileStore;
|
|
149
147
|
const planPath = join(input.workDir, ModDir, "plan.md");
|
|
150
148
|
yield* runNode({
|
|
@@ -321,8 +319,7 @@ const program = Effect.gen(function* () {
|
|
|
321
319
|
specFor: (program) => files
|
|
322
320
|
.read(join(specsDirAbs, `${program}.md`))
|
|
323
321
|
.pipe(Effect.map((text) => scope === undefined ? (text ?? "") : `${text ?? ""}\n\n${scope}`)),
|
|
324
|
-
query: input.prompt
|
|
325
|
-
fingerprint: reviewFingerprint
|
|
322
|
+
query: input.prompt
|
|
326
323
|
});
|
|
327
324
|
const trace = yield* files
|
|
328
325
|
.read(join(specsDirAbs, "traceability.md"))
|
|
@@ -27,6 +27,7 @@ import { FlowAborted, Info, makeNodeWorkspace, mock, openPack, resolveFlowInput,
|
|
|
27
27
|
import { graphStats, probeResults } from "@llm4ts/flow/GraphQuery";
|
|
28
28
|
import { coverageUnits, matchingFiles } from "@llm4ts/flow/SpecChecks";
|
|
29
29
|
import { buildCodeGraph, nodeId, nodeKind } from "@llm4ts/flow/Survey";
|
|
30
|
+
import { settingValue } from "@llm4ts/flow/Settings";
|
|
30
31
|
import { legacySourceWorkspaceLimits, workspaceLimitsFromEnv } from "@llm4ts/flow/Workspace";
|
|
31
32
|
/** Prompt sidecars the modernization phases read, with the phase that reads each. */
|
|
32
33
|
const phasePrompts = [
|
|
@@ -218,7 +219,7 @@ const program = Effect.gen(function* () {
|
|
|
218
219
|
});
|
|
219
220
|
}
|
|
220
221
|
yield* say(`pack '${pack.name}' check passed with ${plural(warnings.length, "warning")} — ` +
|
|
221
|
-
`next: LLM4TS_PACK=${process.env
|
|
222
|
+
`next: LLM4TS_PACK=${settingValue("LLM4TS_PACK", process.env) ?? opened.dir} modernize-survey --repo ${input.workDir}`);
|
|
222
223
|
}));
|
|
223
224
|
}));
|
|
224
225
|
});
|
|
@@ -30,6 +30,7 @@ import { withDraftApproval } from "@llm4ts/flow/Approval";
|
|
|
30
30
|
import { DeepenMark, Decisions, parseDecisions, renderDecisions, scenarioTitles, waivedUnits } from "@llm4ts/flow/Decisions";
|
|
31
31
|
import { packageVersion } from "@llm4ts/flow/Package";
|
|
32
32
|
import { coverageReport, coverageUnits, features, matchingFiles, specSchemaIssues } from "@llm4ts/flow/SpecChecks";
|
|
33
|
+
import { settingValue } from "@llm4ts/flow/Settings";
|
|
33
34
|
import { legacySourceWorkspaceLimits, workspaceLimitsFromEnv } from "@llm4ts/flow/Workspace";
|
|
34
35
|
import { FlowAborted, Info, makeNodeWorkspace, mock, nodePlainFileStore, openPack, resolveFlowInput, runFlowMain, runNode, stage } from "@llm4ts/runner";
|
|
35
36
|
import { ModDir, programName, readmeFor, readmeVersion } from "./lib/modernize-extract.js";
|
|
@@ -37,7 +38,7 @@ const program = Effect.gen(function* () {
|
|
|
37
38
|
const input = yield* resolveFlowInput("Check a spec pack an older llm4ts extracted against the current release");
|
|
38
39
|
const files = nodePlainFileStore;
|
|
39
40
|
const modDirAbs = join(input.workDir, ModDir);
|
|
40
|
-
const markDeepen = process.env
|
|
41
|
+
const markDeepen = settingValue("LLM4TS_MARK_DEEPEN", process.env);
|
|
41
42
|
yield* runNode({
|
|
42
43
|
workDir: input.workDir,
|
|
43
44
|
workspace: input.workspace,
|
|
@@ -33,24 +33,25 @@ import { ProgramArtifacts, ProgramUnit, extractProgramsResumably, programArtifac
|
|
|
33
33
|
import { budget, capped } from "@llm4ts/flow/Context";
|
|
34
34
|
import { Decisions, DecisionsInvalid, DecisionsProposal, OpenPointsPending, applyProposal, decisionsProposalJsonSchema, parseDecisions, proposePrompt, renderDecisions, scenarioTitles, validateDecisions, waivedUnits } from "@llm4ts/flow/Decisions";
|
|
35
35
|
import { DomainProposal, Domains, checkExactlyOnce, clusterPrograms, consolidatePrompt, domainProposalJsonSchema, domainsFromProposal, domainsInputsHash, parseDomains, renderDomains } from "@llm4ts/flow/Domains";
|
|
36
|
-
import { structuredAndPublish } from "@llm4ts/flow/
|
|
36
|
+
import { structuredAndPublish } from "@llm4ts/flow/Usage";
|
|
37
37
|
import { FlowEvents } from "@llm4ts/flow/FlowEvents";
|
|
38
38
|
import { Task } from "@llm4ts/flow/Plan";
|
|
39
39
|
import { coverageUnits, matchingFiles } from "@llm4ts/flow/SpecChecks";
|
|
40
40
|
import { SurveyGraph, closureFor } from "@llm4ts/flow/Survey";
|
|
41
41
|
import { freshGraph, graphCachePath } from "@llm4ts/flow/GraphCache";
|
|
42
42
|
import { withDraftApproval } from "@llm4ts/flow/Approval";
|
|
43
|
+
import { settingValue } from "@llm4ts/flow/Settings";
|
|
43
44
|
import { legacySourceWorkspaceLimits, workspaceLimitsFromEnv } from "@llm4ts/flow/Workspace";
|
|
44
|
-
import { FlowAborted, Info, Plan, asReadOnly,
|
|
45
|
+
import { FlowAborted, Info, Plan, asReadOnly, coderFromEnvironment, defaultPlanInstructions, makeNodeWorkspace, nodePlainFileStore, openPack, planFrom, resolveFlowInput, runFlowMain, runNode, stage, withTurnLimit } from "@llm4ts/runner";
|
|
45
46
|
import { ModDir, analystSystem, analystTurns, fixTurn, makeProgramJudge, maxClosureFiles, programArtifactsJsonSchema, programAsk, programFixAsk, programName, readmeFor } from "./lib/modernize-extract.js";
|
|
46
47
|
const today = () => new Date().toISOString().slice(0, 10);
|
|
47
48
|
const program = Effect.gen(function* () {
|
|
48
49
|
const input = yield* resolveFlowInput("Refine the extracted spec pack: prune, deepen, and consolidate it before approval");
|
|
49
|
-
const coder = withTurnLimit(
|
|
50
|
+
const coder = withTurnLimit(yield* coderFromEnvironment(), analystTurns());
|
|
50
51
|
const files = nodePlainFileStore;
|
|
51
52
|
const modDirAbs = join(input.workDir, ModDir);
|
|
52
|
-
const targetRepo = process.env
|
|
53
|
-
const regroup = process.env
|
|
53
|
+
const targetRepo = settingValue("LLM4TS_TARGET_REPO", process.env);
|
|
54
|
+
const regroup = settingValue("LLM4TS_REGROUP", process.env);
|
|
54
55
|
yield* runNode({
|
|
55
56
|
workDir: input.workDir,
|
|
56
57
|
workspace: input.workspace,
|
|
@@ -210,7 +211,7 @@ const program = Effect.gen(function* () {
|
|
|
210
211
|
spec: packState.specs[name] ?? "",
|
|
211
212
|
feature: packState.features[name] ?? ""
|
|
212
213
|
}));
|
|
213
|
-
const targetMounted = targetRepo !== undefined
|
|
214
|
+
const targetMounted = targetRepo !== undefined;
|
|
214
215
|
if (!targetMounted) {
|
|
215
216
|
yield* say("no LLM4TS_TARGET_REPO — the proposal cannot claim anything is provided by the target");
|
|
216
217
|
}
|
|
@@ -20,8 +20,8 @@ import * as Schema from "effect/Schema";
|
|
|
20
20
|
import { Dimension } from "@llm4ts/core/eval/Eval";
|
|
21
21
|
import { judge } from "@llm4ts/core/eval/Judge";
|
|
22
22
|
import { capped, renderTruncation, truncations, withShrink } from "@llm4ts/flow/Context";
|
|
23
|
-
import { FlowAborted, Info, Plan, ReviewResult, asReadOnly,
|
|
24
|
-
import { structuredAndPublish } from "@llm4ts/flow/
|
|
23
|
+
import { FlowAborted, Info, Plan, ReviewResult, asReadOnly, coderFromEnvironment, makeNodeWorkspace, makePlanStore, mergeReviewResults, nodePlainFileStore, openPack, resolveFlowInput, runFlowMain, runNode, stage } from "@llm4ts/runner";
|
|
24
|
+
import { structuredAndPublish } from "@llm4ts/flow/Usage";
|
|
25
25
|
import { FlowEvents } from "@llm4ts/flow/FlowEvents";
|
|
26
26
|
import { judgeAllPrograms } from "@llm4ts/flow/ProgramJudge";
|
|
27
27
|
import { Provenance, makeProvenanceStore } from "@llm4ts/flow/Provenance";
|
|
@@ -145,7 +145,7 @@ const recordTruncations = (manifestPath, events) => Effect.gen(function* () {
|
|
|
145
145
|
});
|
|
146
146
|
const program = Effect.gen(function* () {
|
|
147
147
|
const input = yield* resolveFlowInput("Review the modernization increment against its spec pack");
|
|
148
|
-
const coder =
|
|
148
|
+
const coder = yield* coderFromEnvironment();
|
|
149
149
|
const files = nodePlainFileStore;
|
|
150
150
|
const planPath = join(input.workDir, ModDir, "plan.md");
|
|
151
151
|
yield* runNode({
|
|
@@ -223,8 +223,7 @@ const program = Effect.gen(function* () {
|
|
|
223
223
|
specFor: (program) => files
|
|
224
224
|
.read(join(input.workDir, pack.specsDir, `${program}.md`))
|
|
225
225
|
.pipe(Effect.map((text) => text ?? "")),
|
|
226
|
-
query: input.prompt
|
|
227
|
-
fingerprint: reviewFingerprint
|
|
226
|
+
query: input.prompt
|
|
228
227
|
});
|
|
229
228
|
}).pipe(Effect.provideService(FlowEvents, context.events)));
|
|
230
229
|
const outcome = yield* stage(context.events, "distill", withShrink("distill", (cap) => Effect.gen(function* () {
|
package/flows/modernize-seed.js
CHANGED
|
@@ -22,12 +22,13 @@ import { join } from "node:path";
|
|
|
22
22
|
import * as Effect from "effect/Effect";
|
|
23
23
|
import * as Schema from "effect/Schema";
|
|
24
24
|
import { PersistenceError } from "@llm4ts/flow/FlowError";
|
|
25
|
-
import { FlowAborted, Info,
|
|
25
|
+
import { FlowAborted, Info, coderFromEnvironment, makeNodeWorkspace, nodePlainFileStore, openPack, parsePlan, resolveFlowInput, runFlowMain, runNode, stage } from "@llm4ts/runner";
|
|
26
26
|
import { packageVersion } from "@llm4ts/flow/Package";
|
|
27
27
|
import { Provenance, makeProvenanceStore } from "@llm4ts/flow/Provenance";
|
|
28
28
|
import { matchingFiles } from "@llm4ts/flow/SpecChecks";
|
|
29
29
|
import { requireApproval } from "@llm4ts/flow/Approval";
|
|
30
30
|
import { Decisions, filterFeature, parseDecisions } from "@llm4ts/flow/Decisions";
|
|
31
|
+
import { settingValue } from "@llm4ts/flow/Settings";
|
|
31
32
|
const ModDir = "docs/modernization";
|
|
32
33
|
const skipped = new Set([".git", "target", "node_modules", "dist"]);
|
|
33
34
|
const Seats = Schema.Record(Schema.String, Schema.String);
|
|
@@ -60,18 +61,19 @@ const copyFile = Effect.fn("modernize-seed.copyFile")(function* (source, target,
|
|
|
60
61
|
});
|
|
61
62
|
const program = Effect.gen(function* () {
|
|
62
63
|
const input = yield* resolveFlowInput("Seed the target repository from the approved spec pack");
|
|
63
|
-
const legacyRepo = process.env
|
|
64
|
+
const legacyRepo = settingValue("LLM4TS_LEGACY_REPO", process.env);
|
|
64
65
|
const files = nodePlainFileStore;
|
|
66
|
+
const coder = yield* coderFromEnvironment();
|
|
65
67
|
yield* runNode({
|
|
66
68
|
workDir: input.workDir,
|
|
67
69
|
workspace: input.workspace,
|
|
68
70
|
userPrompt: input.prompt,
|
|
69
71
|
// This phase makes no model call; the seat is wired only because the
|
|
70
72
|
// runner composes one context shape for every flow.
|
|
71
|
-
coder
|
|
73
|
+
coder,
|
|
72
74
|
environment: process.env
|
|
73
75
|
}, (context) => Effect.gen(function* () {
|
|
74
|
-
if (legacyRepo === undefined
|
|
76
|
+
if (legacyRepo === undefined) {
|
|
75
77
|
return yield* FlowAborted.make({
|
|
76
78
|
message: "set LLM4TS_LEGACY_REPO to the legacy repository holding the approved spec pack"
|
|
77
79
|
});
|
|
@@ -202,15 +204,13 @@ const program = Effect.gen(function* () {
|
|
|
202
204
|
try: () => Schema.decodeUnknownSync(Schema.fromJsonString(Seats))(seatsText),
|
|
203
205
|
catch: () => undefined
|
|
204
206
|
}).pipe(Effect.orElseSucceed(() => ({})));
|
|
205
|
-
const approver = process.env
|
|
207
|
+
const approver = settingValue("LLM4TS_APPROVER", process.env);
|
|
206
208
|
yield* provenance.write(join(input.workDir, ModDir, "provenance.json"), Provenance.make({
|
|
207
209
|
schema: 1,
|
|
208
210
|
pack: pack.name,
|
|
209
211
|
llm4tsVersion: packageVersion,
|
|
210
212
|
createdAt: new Date().toISOString(),
|
|
211
|
-
...(approver === undefined
|
|
212
|
-
? {}
|
|
213
|
-
: { approvedBy: approver }),
|
|
213
|
+
...(approver === undefined ? {} : { approvedBy: approver }),
|
|
214
214
|
seats,
|
|
215
215
|
specs,
|
|
216
216
|
gateVerdicts: Object.fromEntries(Object.entries(verdicts).map(([path, hash]) => [
|
|
@@ -25,9 +25,9 @@ import { join } from "node:path";
|
|
|
25
25
|
import * as Effect from "effect/Effect";
|
|
26
26
|
import * as Schema from "effect/Schema";
|
|
27
27
|
import { capped, withShrink } from "@llm4ts/flow/Context";
|
|
28
|
-
import { FlowAborted, Info, asReadOnly,
|
|
28
|
+
import { FlowAborted, Info, asReadOnly, coderFromEnvironment, makeNodeWorkspace, nodePlainFileStore, openPack, resolveFlowInput, runFlowMain, runNode, stage } from "@llm4ts/runner";
|
|
29
29
|
import { FlowEvents } from "@llm4ts/flow/FlowEvents";
|
|
30
|
-
import { structuredAndPublish } from "@llm4ts/flow/
|
|
30
|
+
import { structuredAndPublish } from "@llm4ts/flow/Usage";
|
|
31
31
|
import { loadBenchRecords, renderBenchReport } from "@llm4ts/flow/BenchReport";
|
|
32
32
|
import { nodeKind, renderSurveyGraphJson, renderSurveyInventory, surveyTriagePrompt } from "@llm4ts/flow/Survey";
|
|
33
33
|
import { discoveryOverflowAdvice, legacySourceWorkspaceLimits, workspaceLimitsFromEnv } from "@llm4ts/flow/Workspace";
|
|
@@ -36,6 +36,7 @@ import { freshGraph, graphCachePath, updateGraphCache } from "@llm4ts/flow/Graph
|
|
|
36
36
|
import { WorklistAnswer, mergeWorklist, renderWorklistReport, verifyWorklistAnswer, worklistAnswerJsonSchema, worklistBatches, worklistOf, worklistPrompt } from "@llm4ts/flow/GraphWorklist";
|
|
37
37
|
import { wholeView } from "@llm4ts/flow/GraphQuery";
|
|
38
38
|
import { renderClusterDiagrams, renderEntryPaths, renderGraphDot } from "@llm4ts/flow/GraphRender";
|
|
39
|
+
import { settingValue } from "@llm4ts/flow/Settings";
|
|
39
40
|
const ModDir = "docs/modernization";
|
|
40
41
|
class NodeTriage extends Schema.Class("NodeTriage")({
|
|
41
42
|
name: Schema.String,
|
|
@@ -124,13 +125,9 @@ const renderWavePlan = (outcome, graph, projection) => {
|
|
|
124
125
|
...(projection === undefined ? [] : [projection])
|
|
125
126
|
].join("\n") + "\n");
|
|
126
127
|
};
|
|
127
|
-
const refineDisabled = (environment) => {
|
|
128
|
-
const value = environment.LLM4TS_GRAPH_REFINE?.trim().toLowerCase();
|
|
129
|
-
return value === "off" || value === "0" || value === "false";
|
|
130
|
-
};
|
|
131
128
|
const program = Effect.gen(function* () {
|
|
132
129
|
const input = yield* resolveFlowInput("Survey the legacy estate and propose a migration wave plan");
|
|
133
|
-
const coder =
|
|
130
|
+
const coder = yield* coderFromEnvironment();
|
|
134
131
|
yield* runNode({
|
|
135
132
|
workDir: input.workDir,
|
|
136
133
|
workspace: input.workspace,
|
|
@@ -171,7 +168,7 @@ const program = Effect.gen(function* () {
|
|
|
171
168
|
return built;
|
|
172
169
|
}));
|
|
173
170
|
const graph = fresh.graph;
|
|
174
|
-
const refined = yield* stage(context.events, "graph refine",
|
|
171
|
+
const refined = yield* stage(context.events, "graph refine", !settingValue("LLM4TS_GRAPH_REFINE", process.env)
|
|
175
172
|
? context.events
|
|
176
173
|
.publish(Info.make({ message: "LLM4TS_GRAPH_REFINE=off — regex graph ships unrefined" }))
|
|
177
174
|
.pipe(Effect.as(graph))
|
|
@@ -24,9 +24,9 @@ import { CurrentEquivSchema, EquivVector, Observations, canonicaliseFieldMap, re
|
|
|
24
24
|
import { capped, renderTruncation, truncations, withShrink } from "@llm4ts/flow/Context";
|
|
25
25
|
import { renderEquivReport, VectorVerdict } from "@llm4ts/flow/EquivReport";
|
|
26
26
|
import { PlanParseError } from "@llm4ts/flow/FlowError";
|
|
27
|
-
import { structuredAndPublish } from "@llm4ts/flow/
|
|
27
|
+
import { structuredAndPublish } from "@llm4ts/flow/Usage";
|
|
28
28
|
import { FlowEvents } from "@llm4ts/flow/FlowEvents";
|
|
29
|
-
import { FlowAborted, Info, Plan, asReadOnly,
|
|
29
|
+
import { FlowAborted, Info, Plan, asReadOnly, coderFromEnvironment, makeNodeWorkspace, makePlanStore, nodePlainFileStore, nodeProcessExecutor, openPack, resolveFlowInput, runFlowMain, runNode, stage } from "@llm4ts/runner";
|
|
30
30
|
import { Task } from "@llm4ts/flow/Plan";
|
|
31
31
|
import { Provenance, makeProvenanceStore } from "@llm4ts/flow/Provenance";
|
|
32
32
|
import { matchingFiles } from "@llm4ts/flow/SpecChecks";
|
|
@@ -237,7 +237,7 @@ const specPrograms = Effect.fn("modernize-verify.specPrograms")(function* (targe
|
|
|
237
237
|
});
|
|
238
238
|
const program = Effect.gen(function* () {
|
|
239
239
|
const input = yield* resolveFlowInput("Prove the implementation equivalent to its spec pack");
|
|
240
|
-
const coder =
|
|
240
|
+
const coder = yield* coderFromEnvironment();
|
|
241
241
|
const files = nodePlainFileStore;
|
|
242
242
|
const planPath = join(input.workDir, ModDir, "plan.md");
|
|
243
243
|
const vectorsDir = join(input.workDir, ModDir, "vectors");
|
package/flows/pack-fork.js
CHANGED
|
@@ -30,12 +30,12 @@
|
|
|
30
30
|
import { basename, join, relative as relativePath, resolve as resolvePath } from "node:path";
|
|
31
31
|
import { rmSync } from "node:fs";
|
|
32
32
|
import * as Effect from "effect/Effect";
|
|
33
|
-
import { structuredAndPublish } from "@llm4ts/flow/
|
|
33
|
+
import { structuredAndPublish } from "@llm4ts/flow/Usage";
|
|
34
34
|
import { FlowEvents, Info } from "@llm4ts/flow/FlowEvents";
|
|
35
35
|
import { capped, withShrink } from "@llm4ts/flow/Context";
|
|
36
36
|
import { withDraftApproval } from "@llm4ts/flow/Approval";
|
|
37
37
|
import { legacySourceWorkspaceLimits, workspaceLimitsFromEnv } from "@llm4ts/flow/Workspace";
|
|
38
|
-
import { asReadOnly, asToolless,
|
|
38
|
+
import { asReadOnly, asToolless, coderFromEnvironment, makeNodeWorkspace, nodePlainFileStore, openPack, resolveFlowInput, runFlowMain, runNode, ScriptUsage, stage } from "@llm4ts/runner";
|
|
39
39
|
import { ConventionSection, conventionPassAsk, conventionSectionJsonSchema, forkPackMarkdown, forkedReadme, GroundingSelection, groundingSelectionAsk, groundingSelectionJsonSchema, parseFeedback, parseForkAs, parseTargetKind, passesForTargetKind, provenanceMarkdown, readGroundingFiles, selectionsForCategory, targetConventionsReviewer, validSelections } from "./lib/pack-fork.js";
|
|
40
40
|
const forkPackFiles = Effect.fn("flows/pack-fork.forkPackFiles")(function* (source, destinationAbs, files) {
|
|
41
41
|
// `source.dir` is "." for an absolute-path pack reference (Packs.ts's
|
|
@@ -81,7 +81,8 @@ const program = Effect.gen(function* () {
|
|
|
81
81
|
const targetKind = yield* parseTargetKind(process.env);
|
|
82
82
|
const forkAs = yield* parseForkAs(process.env);
|
|
83
83
|
const feedback = parseFeedback(process.env);
|
|
84
|
-
const
|
|
84
|
+
const selected = yield* coderFromEnvironment();
|
|
85
|
+
const coder = asReadOnly(selected);
|
|
85
86
|
const files = nodePlainFileStore;
|
|
86
87
|
yield* runNode({
|
|
87
88
|
workDir: input.workDir,
|
|
@@ -95,7 +96,7 @@ const program = Effect.gen(function* () {
|
|
|
95
96
|
// ("empty response … no text to parse as structured output"). A
|
|
96
97
|
// read-only coder still offers a read tool over some connectors
|
|
97
98
|
// (pi in particular); asToolless offers none.
|
|
98
|
-
reasoning: asToolless(
|
|
99
|
+
reasoning: asToolless(selected),
|
|
99
100
|
environment: process.env
|
|
100
101
|
}, (context) => Effect.gen(function* () {
|
|
101
102
|
const repo = yield* makeNodeWorkspace(input.workDir, workspaceLimitsFromEnv(process.env, legacySourceWorkspaceLimits));
|
package/flows/port-compile.js
CHANGED
|
@@ -16,15 +16,16 @@ import { groupDiagnostics, parseDiagnostics, renderDiagnostics } from "@llm4ts/f
|
|
|
16
16
|
import { FlowAborted, ProcessError, Stalled } from "@llm4ts/flow/FlowError";
|
|
17
17
|
import { Info } from "@llm4ts/flow/FlowEvents";
|
|
18
18
|
import { adversarialReviewer, reviewAndFixLoop } from "@llm4ts/flow/Review";
|
|
19
|
+
import { settingValue } from "@llm4ts/flow/Settings";
|
|
19
20
|
import { runQueue } from "@llm4ts/flow/WorkQueue";
|
|
20
|
-
import { asReadOnly,
|
|
21
|
+
import { asReadOnly, coderFromEnvironment, nodePlainFileStore, nodeProcessExecutor, openPack, resolveFlowInput, runFlowMain, runNode, stage } from "@llm4ts/runner";
|
|
21
22
|
import { asPortingPack, compileFixerSystem, portEnv, portStateDir } from "./lib/port.js";
|
|
22
23
|
const program = Effect.gen(function* () {
|
|
23
24
|
const input = yield* resolveFlowInput("Fix every compiler diagnostic, one unit at a time");
|
|
24
|
-
const coder =
|
|
25
|
+
const coder = yield* coderFromEnvironment();
|
|
25
26
|
const files = nodePlainFileStore;
|
|
26
27
|
const knobs = portEnv(process.env);
|
|
27
|
-
const maxRounds =
|
|
28
|
+
const maxRounds = settingValue("LLM4TS_PORT_COMPILE_ROUNDS", process.env);
|
|
28
29
|
const stateDir = portStateDir(input.workDir);
|
|
29
30
|
yield* runNode({
|
|
30
31
|
workDir: input.workDir,
|
package/flows/port-files.js
CHANGED
|
@@ -22,7 +22,7 @@ import { Info } from "@llm4ts/flow/FlowEvents";
|
|
|
22
22
|
import { asAddedFileDiff, batchesOf, ledgerRowsFor, portStatusIn, renderPilotReport } from "@llm4ts/flow/Port";
|
|
23
23
|
import { adversarialReviewer, reviewAndFixLoop } from "@llm4ts/flow/Review";
|
|
24
24
|
import { runQueue } from "@llm4ts/flow/WorkQueue";
|
|
25
|
-
import { asReadOnly,
|
|
25
|
+
import { asReadOnly, coderFromEnvironment, makeNodeWorkspace, nodePlainFileStore, openPack, resolveFlowInput, runFlowMain, runNode, stage } from "@llm4ts/runner";
|
|
26
26
|
import { asPortingPack, implementerPrompt, implementerSystem, ledgerPath, portEnv, readLedgerRows, portFixerSystem, portManifest, portStateDir } from "./lib/port.js";
|
|
27
27
|
const renderReport = (outcomes, total, pending) => {
|
|
28
28
|
const done = outcomes.filter((outcome) => outcome.status === "done");
|
|
@@ -50,7 +50,7 @@ const renderReport = (outcomes, total, pending) => {
|
|
|
50
50
|
};
|
|
51
51
|
const program = Effect.gen(function* () {
|
|
52
52
|
const input = yield* resolveFlowInput("Port every source file the pack matches to its target");
|
|
53
|
-
const coder =
|
|
53
|
+
const coder = yield* coderFromEnvironment();
|
|
54
54
|
const files = nodePlainFileStore;
|
|
55
55
|
const knobs = portEnv(process.env);
|
|
56
56
|
const stateDir = portStateDir(input.workDir);
|
package/flows/port-guide.js
CHANGED
|
@@ -17,8 +17,9 @@ import { cap } from "@llm4ts/flow/Context";
|
|
|
17
17
|
import { Info } from "@llm4ts/flow/FlowEvents";
|
|
18
18
|
import { GuideFinding, defaultAuditDimensions, renderGuideAudit, standsAfterRefutes } from "@llm4ts/flow/Port";
|
|
19
19
|
import { AppliedMarkerPrefix, applyRuleEdit, retroApprovalOf } from "@llm4ts/flow/Retro";
|
|
20
|
-
import { asReadOnly,
|
|
21
|
-
import { structuredAndPublish } from "@llm4ts/flow/
|
|
20
|
+
import { asReadOnly, coderFromEnvironment, makeNodeWorkspace, nodePlainFileStore, openPack, resolveFlowInput, runFlowMain, runNode, stage } from "@llm4ts/runner";
|
|
21
|
+
import { structuredAndPublish } from "@llm4ts/flow/Usage";
|
|
22
|
+
import { settingValue } from "@llm4ts/flow/Settings";
|
|
22
23
|
import { asPortingPack, implementerPrompt, implementerSystem, nativeImplementerSystem, portEnv, portManifest, portStateDir } from "./lib/port.js";
|
|
23
24
|
class Findings extends Schema.Class("Findings")({
|
|
24
25
|
findings: Schema.Array(GuideFinding)
|
|
@@ -70,11 +71,11 @@ const encodeAudit = Schema.encodeSync(Schema.fromJsonString(AuditRecord));
|
|
|
70
71
|
const decodeAudit = Schema.decodeUnknownOption(Schema.fromJsonString(AuditRecord));
|
|
71
72
|
const program = Effect.gen(function* () {
|
|
72
73
|
const input = yield* resolveFlowInput("Audit the porting rulebook against sample sources");
|
|
73
|
-
const coder =
|
|
74
|
+
const coder = yield* coderFromEnvironment();
|
|
74
75
|
const files = nodePlainFileStore;
|
|
75
76
|
const knobs = portEnv(process.env);
|
|
76
|
-
const sampleSize =
|
|
77
|
-
const trialOn = process.env
|
|
77
|
+
const sampleSize = settingValue("LLM4TS_PORT_GUIDE_SAMPLE", process.env);
|
|
78
|
+
const trialOn = settingValue("LLM4TS_PORT_GUIDE_TRIAL", process.env);
|
|
78
79
|
const stateDir = portStateDir(input.workDir);
|
|
79
80
|
const reportPath = join(stateDir, "guide-audit.md");
|
|
80
81
|
const recordPath = join(stateDir, "guide-audit.json");
|
package/flows/port-ledger.js
CHANGED
|
@@ -17,8 +17,8 @@ import { FlowAborted } from "@llm4ts/flow/FlowError";
|
|
|
17
17
|
import { Info } from "@llm4ts/flow/FlowEvents";
|
|
18
18
|
import { LedgerRow, renderLedger, standsAfterRefutes, unitsIn } from "@llm4ts/flow/Port";
|
|
19
19
|
import { runQueue } from "@llm4ts/flow/WorkQueue";
|
|
20
|
-
import { asReadOnly,
|
|
21
|
-
import { structuredAndPublish } from "@llm4ts/flow/
|
|
20
|
+
import { asReadOnly, coderFromEnvironment, makeNodeWorkspace, nodePlainFileStore, openPack, resolveFlowInput, runFlowMain, runNode, stage } from "@llm4ts/runner";
|
|
21
|
+
import { structuredAndPublish } from "@llm4ts/flow/Usage";
|
|
22
22
|
import { asPortingPack, ledgerPath, portEnv, portManifest } from "./lib/port.js";
|
|
23
23
|
class Classified extends Schema.Class("Classified")({
|
|
24
24
|
rows: Schema.Array(Schema.Struct({
|
|
@@ -65,7 +65,7 @@ const refuteJson = {
|
|
|
65
65
|
};
|
|
66
66
|
const program = Effect.gen(function* () {
|
|
67
67
|
const input = yield* resolveFlowInput("Classify every unit the pack's ledger regex names");
|
|
68
|
-
const coder =
|
|
68
|
+
const coder = yield* coderFromEnvironment();
|
|
69
69
|
const files = nodePlainFileStore;
|
|
70
70
|
const knobs = portEnv(process.env);
|
|
71
71
|
yield* runNode({
|
package/flows/port-tests.js
CHANGED
|
@@ -20,8 +20,9 @@ import { Info } from "@llm4ts/flow/FlowEvents";
|
|
|
20
20
|
import { diffVerdict, renderDiag, renderDifferentialReport } from "@llm4ts/flow/Port";
|
|
21
21
|
import { ReviewResult, adversarialReviewer, lintCommand, reviewAndFixLoop } from "@llm4ts/flow/Review";
|
|
22
22
|
import { matchingFiles } from "@llm4ts/flow/SpecChecks";
|
|
23
|
+
import { settingValue } from "@llm4ts/flow/Settings";
|
|
23
24
|
import { runQueue } from "@llm4ts/flow/WorkQueue";
|
|
24
|
-
import { asReadOnly,
|
|
25
|
+
import { asReadOnly, coderFromEnvironment, makeNodeWorkspace, nodePlainFileStore, nodeProcessExecutor, openPack, resolveFlowInput, runFlowMain, runNode, stage } from "@llm4ts/runner";
|
|
25
26
|
import { asPortingPack, compileFixerSystem, portEnv, portStateDir } from "./lib/port.js";
|
|
26
27
|
const Baseline = Schema.fromJsonString(ReviewResult);
|
|
27
28
|
const encodeBaseline = Schema.encodeSync(Baseline);
|
|
@@ -29,11 +30,11 @@ const decodeBaseline = Schema.decodeUnknownOption(Baseline);
|
|
|
29
30
|
const slug = (path) => path.replace(/[^a-z0-9]+/giu, "-").replace(/^-|-$/gu, "");
|
|
30
31
|
const program = Effect.gen(function* () {
|
|
31
32
|
const input = yield* resolveFlowInput("Run every test file on the legacy and the target build, fix what diverges");
|
|
32
|
-
const coder =
|
|
33
|
+
const coder = yield* coderFromEnvironment();
|
|
33
34
|
const files = nodePlainFileStore;
|
|
34
35
|
const knobs = portEnv(process.env);
|
|
35
|
-
const maxRounds =
|
|
36
|
-
const tailChars = Math.max(500,
|
|
36
|
+
const maxRounds = settingValue("LLM4TS_PORT_TEST_ROUNDS", process.env);
|
|
37
|
+
const tailChars = Math.max(500, settingValue("LLM4TS_GATE_TAIL_CHARS", process.env));
|
|
37
38
|
const stateDir = join(portStateDir(input.workDir), "tests");
|
|
38
39
|
yield* runNode({
|
|
39
40
|
workDir: input.workDir,
|
package/flows/roundtable.js
CHANGED
|
@@ -35,7 +35,7 @@ import { budget } from "@llm4ts/flow/Context";
|
|
|
35
35
|
import { judgmentOf } from "@llm4ts/flow/Judgment";
|
|
36
36
|
import { parseMeeting } from "@llm4ts/flow/Roundtable";
|
|
37
37
|
import { ScriptUsage, asToolless, nodePlainFileStore, resolveFlowInput, runFlowMain, runNode, stage } from "@llm4ts/runner";
|
|
38
|
-
import { reasonerFromEnvironment } from "
|
|
38
|
+
import { reasonerFromEnvironment } from "@llm4ts/runner/Connectors";
|
|
39
39
|
import { describePersonas, ejectPersonas, meetingDir, meetingSlug, meetingsDir, parseRoundtableArgs, personasDir, resolvePersonas, runRoundtable } from "./lib/roundtable.js";
|
|
40
40
|
import { defaultAttendees } from "./lib/roundtable-personas.js";
|
|
41
41
|
const files = nodePlainFileStore;
|
|
@@ -125,7 +125,7 @@ const program = Effect.gen(function* () {
|
|
|
125
125
|
const personas = yield* resolvePersonas(custom, attendeeNames);
|
|
126
126
|
// Relative to the repository: the standards usually live beside the code.
|
|
127
127
|
const docs = yield* contextDocs(flags.context === undefined ? undefined : resolve(workDir, flags.context));
|
|
128
|
-
const reasoning = asToolless(yield* reasonerFromEnvironment(
|
|
128
|
+
const reasoning = asToolless(yield* reasonerFromEnvironment());
|
|
129
129
|
const outcome = yield* runNode({
|
|
130
130
|
workDir,
|
|
131
131
|
workspace: given.workspace,
|
package/flows/sdd.js
CHANGED
|
@@ -2,10 +2,11 @@
|
|
|
2
2
|
import { join } from "node:path";
|
|
3
3
|
import * as Effect from "effect/Effect";
|
|
4
4
|
import { withContract } from "@llm4ts/flow/AutonomyContract";
|
|
5
|
-
import {
|
|
5
|
+
import { settingGiven, settingValue } from "@llm4ts/flow/Settings";
|
|
6
|
+
import { FlowAborted, Plan, asReadOnly, coderFromEnvironment, defaultPlanInstructions, defaultPlanPath, implementTaskLoop, lintCommand, makeChat, makePlanStore, minimalReviewers, nodePlainFileStore, nodeProcessExecutor, planFrom, resolveFlowInput, reviewAndFixLoop, runFlowMain, runNode, stage, withModel, writeBrief } from "@llm4ts/runner";
|
|
6
7
|
import { gemini } from "@llm4ts/runner/Connectors";
|
|
7
|
-
const proModel = process.env
|
|
8
|
-
const flashModel = process.env
|
|
8
|
+
const proModel = settingValue("LLM4TS_REASONING_MODEL", process.env) ?? "gemini-3-pro-preview";
|
|
9
|
+
const flashModel = settingValue("LLM4TS_CODER_MODEL", process.env) ?? "gemini-2.5-flash";
|
|
9
10
|
const specInstructions = [
|
|
10
11
|
"Turn the change request into a precise repository specification with context, goals,",
|
|
11
12
|
"non-goals, and a numbered list of testable Given/When/Then acceptance criteria.",
|
|
@@ -26,16 +27,10 @@ const verificationFailure = (result) => FlowAborted.make({
|
|
|
26
27
|
});
|
|
27
28
|
const program = Effect.gen(function* () {
|
|
28
29
|
const input = yield* resolveFlowInput("Add due dates, mark overdue items in list output, and show items due today.");
|
|
29
|
-
const
|
|
30
|
-
const coder =
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
const reasoning = explicitCoder === undefined || explicitCoder.length === 0
|
|
34
|
-
? asReadOnly(withModel(gemini, proModel))
|
|
35
|
-
: asReadOnly(coder);
|
|
36
|
-
const reviewer = explicitCoder === undefined || explicitCoder.length === 0
|
|
37
|
-
? asReadOnly(withModel(gemini, flashModel))
|
|
38
|
-
: asReadOnly(coder);
|
|
30
|
+
const coderNamed = settingGiven("LLM4TS_CODER", process.env)._tag !== "Unset";
|
|
31
|
+
const coder = yield* coderFromEnvironment(process.env, withModel(gemini, flashModel));
|
|
32
|
+
const reasoning = coderNamed ? asReadOnly(coder) : asReadOnly(withModel(gemini, proModel));
|
|
33
|
+
const reviewer = coderNamed ? asReadOnly(coder) : asReadOnly(withModel(gemini, flashModel));
|
|
39
34
|
const store = makePlanStore(nodePlainFileStore);
|
|
40
35
|
const planPath = join(input.workDir, defaultPlanPath(input.prompt));
|
|
41
36
|
yield* runNode({
|
package/flows/taskforce.js
CHANGED
|
@@ -38,8 +38,8 @@ import { parseNote } from "@llm4ts/flow/Memory";
|
|
|
38
38
|
import { parseReviewer, Reviewer } from "@llm4ts/flow/Reviewer";
|
|
39
39
|
import { parsePlan } from "@llm4ts/flow/Taskforce";
|
|
40
40
|
import { ScriptUsage, asReadOnly, asToolless, nodePlainFileStore, nodeProcessExecutor, resolveFlowInput, runFlowMain, runNode, stage, withTurnLimit } from "@llm4ts/runner";
|
|
41
|
-
import {
|
|
42
|
-
import {
|
|
41
|
+
import { claude, seatsFromEnvironment } from "@llm4ts/runner/Connectors";
|
|
42
|
+
import { worktreeRootFor } from "./lib/epic-stories.js";
|
|
43
43
|
import { bundledLenses, commandsPath, declaredCommands, defaultAgents, describeCast, ejectPersonas, lensesDir, parseTaskforceArgs, personasDir, resolveCast, runDir, runSlug, runsDir, runTaskforce } from "./lib/taskforce.js";
|
|
44
44
|
const files = nodePlainFileStore;
|
|
45
45
|
const namesIn = (dir, suffix) => Effect.tryPromise(() => readdir(dir, { withFileTypes: true })).pipe(Effect.map((entries) => entries
|
|
@@ -144,8 +144,9 @@ const program = Effect.gen(function* () {
|
|
|
144
144
|
? bundledLenses.map((lens) => Reviewer.make(lens))
|
|
145
145
|
: Object.entries(lensCards).map(([name, text]) => parseReviewer(name, text));
|
|
146
146
|
const allowedCommand = declaredCommands(yield* files.read(join(workDir, "package.json")), yield* files.read(commandsPath(workDir)));
|
|
147
|
-
const
|
|
148
|
-
const
|
|
147
|
+
const seats = yield* seatsFromEnvironment({ reasoner: claude });
|
|
148
|
+
const reasoner = seats.reasoning;
|
|
149
|
+
const coder = withTurnLimit(seats.coder, flags.turns ?? 30);
|
|
149
150
|
const worktreeRoot = worktreeRootFor(workDir, `taskforce-${runId}`, process.env);
|
|
150
151
|
const outcome = yield* runNode({
|
|
151
152
|
workDir,
|
|
@@ -23,11 +23,12 @@ import * as Effect from "effect/Effect";
|
|
|
23
23
|
import { AdoConfig, makeAzureDevOpsTool } from "@llm4ts/flow/AzureDevOpsTool";
|
|
24
24
|
import { BoardItem, composeBoardSync, makeAdoBoardSync, makeLocalBoardSync } from "@llm4ts/flow/BoardSync";
|
|
25
25
|
import { describeFlowError } from "@llm4ts/flow/FlowError";
|
|
26
|
-
import { Info, asReadOnly,
|
|
26
|
+
import { Info, asReadOnly, coderFromEnvironment, nodePlainFileStore, nodeProcessExecutor, resolveFlowInput, runFlowMain, runNode, stage } from "@llm4ts/runner";
|
|
27
27
|
import { conversionInventory, convertFeature, convertPage, featureInventory, migrationReport, setupConversion } from "./lib/convert.js";
|
|
28
|
+
import { settingValue } from "@llm4ts/flow/Settings";
|
|
28
29
|
const program = Effect.gen(function* () {
|
|
29
30
|
const input = yield* resolveFlowInput("Convert the legacy estate into the destination SPA");
|
|
30
|
-
const coder =
|
|
31
|
+
const coder = yield* coderFromEnvironment();
|
|
31
32
|
yield* runNode({
|
|
32
33
|
workDir: input.workDir,
|
|
33
34
|
workspace: input.workspace,
|
|
@@ -43,15 +44,15 @@ const program = Effect.gen(function* () {
|
|
|
43
44
|
const boards = [
|
|
44
45
|
makeLocalBoardSync(files, join(input.workDir, ".llm4ts", "convert"), boardTitle)
|
|
45
46
|
];
|
|
46
|
-
const orgUrl = process.env
|
|
47
|
-
const project = process.env
|
|
48
|
-
if (orgUrl !== undefined &&
|
|
47
|
+
const orgUrl = settingValue("LLM4TS_ADO_ORG_URL", process.env);
|
|
48
|
+
const project = settingValue("LLM4TS_ADO_PROJECT", process.env);
|
|
49
|
+
if (orgUrl !== undefined && project !== undefined) {
|
|
49
50
|
// az CLI owns the credentials (`az devops login` / AZURE_DEVOPS_EXT_PAT);
|
|
50
51
|
// no PAT ever passes through llm4ts configuration.
|
|
51
52
|
const ado = makeAzureDevOpsTool(AdoConfig.make({
|
|
52
53
|
orgUrl,
|
|
53
54
|
project,
|
|
54
|
-
repository: process.env
|
|
55
|
+
repository: settingValue("LLM4TS_ADO_REPO", process.env) ?? project
|
|
55
56
|
}), nodeProcessExecutor, input.workDir, context.events);
|
|
56
57
|
boards.push(yield* makeAdoBoardSync(ado, boardTitle));
|
|
57
58
|
yield* context.events.publish(Info.make({ message: `ADO board mirror enabled: ${orgUrl}/${project}` }));
|
|
@@ -108,7 +109,7 @@ const program = Effect.gen(function* () {
|
|
|
108
109
|
...(item.detail === undefined ? {} : { detail: item.detail })
|
|
109
110
|
}))));
|
|
110
111
|
const baseBranch = yield* context.git.currentBranch;
|
|
111
|
-
const failFast = process.env
|
|
112
|
+
const failFast = settingValue("LLM4TS_FAIL_FAST", process.env);
|
|
112
113
|
for (const item of items) {
|
|
113
114
|
const snapshot = yield* board.snapshot;
|
|
114
115
|
const known = snapshot.items.find((candidate) => candidate.id === item.id);
|
|
@@ -14,12 +14,12 @@
|
|
|
14
14
|
// and tests per page. Gates and judge as convert-page, plus the feature
|
|
15
15
|
// judged against its contract of record. Branch `convert/<feature>`, no PR.
|
|
16
16
|
import * as Effect from "effect/Effect";
|
|
17
|
-
import { FlowAborted, Info, asReadOnly,
|
|
17
|
+
import { FlowAborted, Info, asReadOnly, coderFromEnvironment, resolveFlowInput, runFlowMain, runNode } from "@llm4ts/runner";
|
|
18
18
|
import { convertFeature, setupConversion } from "./lib/convert.js";
|
|
19
19
|
const program = Effect.gen(function* () {
|
|
20
20
|
const input = yield* resolveFlowInput("Convert one domain feature into the destination SPA");
|
|
21
21
|
const feature = input.prompt.trim().split(/\s+/)[0] ?? "";
|
|
22
|
-
const coder =
|
|
22
|
+
const coder = yield* coderFromEnvironment();
|
|
23
23
|
yield* runNode({
|
|
24
24
|
workDir: input.workDir,
|
|
25
25
|
workspace: input.workspace,
|
|
@@ -18,12 +18,12 @@
|
|
|
18
18
|
// LLM4TS_ESTIMATE_CHARS_PER_TOKEN). Pack: LLM4TS_PACK (default
|
|
19
19
|
// j2ee-nextjs-spa, from the j2ee-nextjs kit).
|
|
20
20
|
import * as Effect from "effect/Effect";
|
|
21
|
-
import { FlowAborted, Info, asReadOnly,
|
|
21
|
+
import { FlowAborted, Info, asReadOnly, coderFromEnvironment, resolveFlowInput, runFlowMain, runNode } from "@llm4ts/runner";
|
|
22
22
|
import { convertPage, setupConversion } from "./lib/convert.js";
|
|
23
23
|
const program = Effect.gen(function* () {
|
|
24
24
|
const input = yield* resolveFlowInput("Convert one legacy page into the destination SPA");
|
|
25
25
|
const page = input.prompt.trim().split(/\s+/)[0] ?? "";
|
|
26
|
-
const coder =
|
|
26
|
+
const coder = yield* coderFromEnvironment();
|
|
27
27
|
yield* runNode({
|
|
28
28
|
workDir: input.workDir,
|
|
29
29
|
workspace: input.workspace,
|