@llm4ts/shell 3.2.6 → 3.4.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.
Files changed (105) hide show
  1. package/README.md +36 -0
  2. package/dist/Cli.d.ts +11 -3
  3. package/dist/Cli.d.ts.map +1 -1
  4. package/dist/Cli.js +127 -39
  5. package/dist/Cli.js.map +1 -1
  6. package/dist/CoderChoice.d.ts +2 -4
  7. package/dist/CoderChoice.d.ts.map +1 -1
  8. package/dist/CoderChoice.js +8 -12
  9. package/dist/CoderChoice.js.map +1 -1
  10. package/dist/Config.d.ts +238 -0
  11. package/dist/Config.d.ts.map +1 -0
  12. package/dist/Config.js +594 -0
  13. package/dist/Config.js.map +1 -0
  14. package/dist/ConfigCommand.d.ts +180 -0
  15. package/dist/ConfigCommand.d.ts.map +1 -0
  16. package/dist/ConfigCommand.js +903 -0
  17. package/dist/ConfigCommand.js.map +1 -0
  18. package/dist/ConfigEdit.d.ts +79 -0
  19. package/dist/ConfigEdit.d.ts.map +1 -0
  20. package/dist/ConfigEdit.js +110 -0
  21. package/dist/ConfigEdit.js.map +1 -0
  22. package/dist/ConfigTrust.d.ts +45 -0
  23. package/dist/ConfigTrust.d.ts.map +1 -0
  24. package/dist/ConfigTrust.js +72 -0
  25. package/dist/ConfigTrust.js.map +1 -0
  26. package/dist/FlowLaunch.d.ts +2 -3
  27. package/dist/FlowLaunch.d.ts.map +1 -1
  28. package/dist/FlowLaunch.js +1 -5
  29. package/dist/FlowLaunch.js.map +1 -1
  30. package/dist/FlowProcess.d.ts +3 -1
  31. package/dist/FlowProcess.d.ts.map +1 -1
  32. package/dist/FlowProcess.js.map +1 -1
  33. package/dist/Menu.d.ts +1 -1
  34. package/dist/Menu.d.ts.map +1 -1
  35. package/dist/Menu.js +33 -6
  36. package/dist/Menu.js.map +1 -1
  37. package/dist/OperatorConfig.d.ts.map +1 -1
  38. package/dist/OperatorConfig.js +2 -1
  39. package/dist/OperatorConfig.js.map +1 -1
  40. package/dist/OperatorTools.d.ts +2 -0
  41. package/dist/OperatorTools.d.ts.map +1 -1
  42. package/dist/Refine.d.ts.map +1 -1
  43. package/dist/Refine.js +3 -2
  44. package/dist/Refine.js.map +1 -1
  45. package/dist/RunSupervisor.d.ts +4 -3
  46. package/dist/RunSupervisor.d.ts.map +1 -1
  47. package/dist/RunSupervisor.js +26 -13
  48. package/dist/RunSupervisor.js.map +1 -1
  49. package/flows/epic-design.js +7 -5
  50. package/flows/epic-retro.js +3 -2
  51. package/flows/implement.js +3 -2
  52. package/flows/issue-pr.js +3 -2
  53. package/flows/judge-suite.js +2 -2
  54. package/flows/lib/debt.js +2 -2
  55. package/flows/lib/epic-retro.js +3 -6
  56. package/flows/lib/epic-stories.js +54 -115
  57. package/flows/lib/modernize-extract.js +3 -6
  58. package/flows/lib/pack-fork.js +8 -10
  59. package/flows/lib/port.js +8 -10
  60. package/flows/local.js +3 -2
  61. package/flows/modernize-bench.js +5 -5
  62. package/flows/modernize-extract.js +8 -7
  63. package/flows/modernize-implement.js +4 -6
  64. package/flows/modernize-pack-check.js +2 -1
  65. package/flows/modernize-pack-upgrade.js +2 -1
  66. package/flows/modernize-refine.js +6 -5
  67. package/flows/modernize-review.js +2 -2
  68. package/flows/modernize-seed.js +8 -8
  69. package/flows/modernize-survey.js +4 -7
  70. package/flows/modernize-verify.js +2 -2
  71. package/flows/pack-fork.js +4 -3
  72. package/flows/port-compile.js +4 -3
  73. package/flows/port-files.js +2 -2
  74. package/flows/port-guide.js +5 -4
  75. package/flows/port-ledger.js +2 -2
  76. package/flows/port-tests.js +5 -4
  77. package/flows/roundtable.js +2 -2
  78. package/flows/sdd.js +8 -13
  79. package/flows/taskforce.js +5 -4
  80. package/kits/j2ee-nextjs/README.md +2 -1
  81. package/kits/j2ee-nextjs/fixtures/demo-bank/RUNBOOK.md +32 -14
  82. package/kits/j2ee-nextjs/fixtures/demo-bank/reset-demo.mjs +3 -1
  83. package/kits/j2ee-nextjs/flows/convert-all.js +8 -7
  84. package/kits/j2ee-nextjs/flows/convert-feature.js +2 -2
  85. package/kits/j2ee-nextjs/flows/convert-page.js +2 -2
  86. package/kits/j2ee-nextjs/flows/lib/convert.js +7 -10
  87. package/kits/soap-ace/flows/soap-design.js +5 -8
  88. package/kits/soap-ace/flows/soap-discover.js +4 -3
  89. package/kits/soap-ace/flows/soap-epic.js +4 -7
  90. package/kits/soap-ace/flows/soap-explore.js +8 -7
  91. package/kits/soap-ace/flows/soap-sample.js +10 -10
  92. package/kits/soap-ace/tools/soap-call.js +3 -2
  93. package/package.json +8 -4
  94. package/src/Cli.ts +176 -46
  95. package/src/CoderChoice.ts +10 -16
  96. package/src/Config.ts +868 -0
  97. package/src/ConfigCommand.ts +1423 -0
  98. package/src/ConfigEdit.ts +180 -0
  99. package/src/ConfigTrust.ts +145 -0
  100. package/src/FlowLaunch.ts +3 -8
  101. package/src/FlowProcess.ts +3 -1
  102. package/src/Menu.ts +40 -7
  103. package/src/OperatorConfig.ts +2 -1
  104. package/src/Refine.ts +3 -2
  105. package/src/RunSupervisor.ts +26 -14
@@ -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, coderFromEnv, resolveFlowInput, runFlowMain, runNode } from "@llm4ts/runner";
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 = coderFromEnv(process.env);
26
+ const coder = yield* coderFromEnvironment();
27
27
  yield* runNode({
28
28
  workDir: input.workDir,
29
29
  workspace: input.workspace,
@@ -23,10 +23,7 @@ import { closureFor } from "@llm4ts/flow/Survey";
23
23
  import { freshGraph, graphCachePath } from "@llm4ts/flow/GraphCache";
24
24
  import { estimatedUsageOptionsFromEnv, makeEstimatedUsageMeter } from "@llm4ts/flow/EstimatedUsage";
25
25
  import { legacySourceWorkspaceLimits, workspaceLimitsFromEnv } from "@llm4ts/flow/Workspace";
26
- export const positiveEnvInt = (environment, name, fallback) => {
27
- const raw = Number.parseInt(environment[name] ?? "", 10);
28
- return Number.isFinite(raw) && raw > 0 ? raw : fallback;
29
- };
26
+ import { settingValue } from "@llm4ts/flow/Settings";
30
27
  /** Sums the coder and reasoning meters into one per-run estimate. */
31
28
  export const combineTotals = (first, second) => Effect.gen(function* () {
32
29
  const left = yield* first;
@@ -215,7 +212,7 @@ const legacyEvidence = Effect.fn("convert.legacyEvidence")(function* (deps, page
215
212
  ? ""
216
213
  : yield* deps.legacy.read(sourcePath).pipe(Effect.orElseSucceed(() => ""));
217
214
  const graph = (yield* freshGraph(deps.files, graphCachePath(deps.legacyDir, deps.pack.name), deps.pack, deps.legacy)).graph;
218
- const closure = closureFor(graph, page, positiveEnvInt(deps.environment, "LLM4TS_MAX_CLOSURE_FILES", 12));
215
+ const closure = closureFor(graph, page, settingValue("LLM4TS_MAX_CLOSURE_FILES", deps.environment) ?? 12);
219
216
  const parts = [];
220
217
  if (sourcePath !== undefined) {
221
218
  parts.push(`===== ${sourcePath} =====\n${source}`);
@@ -319,7 +316,7 @@ const runConversion = Effect.fn("convert.run")(function* (deps, unit) {
319
316
  }));
320
317
  yield* stage(context.events, "judge", Effect.gen(function* () {
321
318
  const complianceJudge = judge(context.reasoning, conversionDimensions);
322
- const rounds = positiveEnvInt(environment, "LLM4TS_JUDGE_ROUNDS", 2);
319
+ const rounds = settingValue("LLM4TS_JUDGE_ROUNDS", environment) ?? 2;
323
320
  const specOf = new Map(unit.judged.map((entry) => [entry.name, entry.spec]));
324
321
  for (let round = 1; round <= rounds; round += 1) {
325
322
  const base = yield* context.git.defaultBase;
@@ -539,13 +536,13 @@ export const convertFeature = Effect.fn("convert.feature")(function* (deps, feat
539
536
  * the pack (default `j2ee-nextjs-spa`, from the kit), and the pattern-card deck.
540
537
  */
541
538
  export const setupConversion = Effect.fn("convert.setup")(function* (context, input, environment, flowDir) {
542
- const legacyRaw = environment.LLM4TS_LEGACY_REPO;
543
- if (legacyRaw === undefined || legacyRaw.trim().length === 0) {
539
+ const legacyRepo = settingValue("LLM4TS_LEGACY_REPO", environment);
540
+ if (legacyRepo === undefined) {
544
541
  return yield* FlowAborted.make({
545
542
  message: "set LLM4TS_LEGACY_REPO to the extracted legacy repository path"
546
543
  });
547
544
  }
548
- const legacyDir = resolve(input.workspace, legacyRaw.trim());
545
+ const legacyDir = resolve(input.workspace, legacyRepo);
549
546
  const estimateOptions = estimatedUsageOptionsFromEnv(environment);
550
547
  const coderMeter = yield* makeEstimatedUsageMeter(context.coder, estimateOptions);
551
548
  const reasoningMeter = yield* makeEstimatedUsageMeter(context.reasoning, estimateOptions);
@@ -561,7 +558,7 @@ export const setupConversion = Effect.fn("convert.setup")(function* (context, in
561
558
  const opened = yield* stage(context.events, "pack", openPack({
562
559
  environment: {
563
560
  ...environment,
564
- LLM4TS_PACK: environment.LLM4TS_PACK ?? "j2ee-nextjs-spa"
561
+ LLM4TS_PACK: settingValue("LLM4TS_PACK", environment) ?? "j2ee-nextjs-spa"
565
562
  },
566
563
  launchDir: input.workspace,
567
564
  flowDir
@@ -24,6 +24,7 @@
24
24
  import { readFile } from "node:fs/promises";
25
25
  import { fileURLToPath } from "node:url";
26
26
  import * as Effect from "effect/Effect";
27
+ import { settingText, settingValue } from "@llm4ts/flow/Settings";
27
28
  import { FlowAborted, Info, makeNodeWorkspace, mock, resolveFlowInput, runFlowMain, runNode, ScriptUsage } from "@llm4ts/runner";
28
29
  import { coderFor } from "@llm4ts/runner/Connectors";
29
30
  import { analysisPaths, writeAnalyses } from "./lib/soap/Analysis.js";
@@ -44,11 +45,11 @@ const program = Effect.gen(function* () {
44
45
  const environment = process.env;
45
46
  const drafting = command === "design" || command === "revise";
46
47
  const reasoner = drafting
47
- ? coderFor((environment.LLM4TS_REASONER ?? "claude").trim() || "claude")
48
+ ? coderFor(settingText("LLM4TS_REASONER", environment) ?? "claude")
48
49
  : undefined;
49
50
  if (drafting && reasoner === undefined) {
50
51
  return yield* ScriptUsage.make({
51
- message: `unknown LLM4TS_REASONER '${environment.LLM4TS_REASONER ?? ""}'`
52
+ message: `unknown LLM4TS_REASONER '${settingText("LLM4TS_REASONER", environment) ?? ""}'`
52
53
  });
53
54
  }
54
55
  yield* runNode({
@@ -61,13 +62,9 @@ const program = Effect.gen(function* () {
61
62
  }, (context) => Effect.gen(function* () {
62
63
  const say = (message) => context.events.publish(Info.make({ message }));
63
64
  const workspace = yield* makeNodeWorkspace(input.workDir);
64
- const requested = environment.LLM4TS_SOAP_SERVICE?.trim();
65
+ const requested = settingValue("LLM4TS_SOAP_SERVICE", environment);
65
66
  const services = (yield* workspace.discover(".llm4ts/soap/*/catalog.json")).map((path) => path.split("/")[2] ?? "");
66
- const service = requested !== undefined && requested !== ""
67
- ? requested
68
- : services.length === 1
69
- ? services[0]
70
- : undefined;
67
+ const service = requested ?? (services.length === 1 ? services[0] : undefined);
71
68
  if (service === undefined) {
72
69
  return yield* FlowAborted.make({
73
70
  message: services.length === 0
@@ -21,6 +21,7 @@
21
21
  // Bearer, mTLS; references only) authenticates every document request.
22
22
  import { isAbsolute, resolve } from "node:path";
23
23
  import * as Effect from "effect/Effect";
24
+ import { settingValue } from "@llm4ts/flow/Settings";
24
25
  import { Info, makeNodeWorkspace, mock, resolveFlowInput, runFlowMain, runNode } from "@llm4ts/runner";
25
26
  import { judgmentConnectorFromEnvironment } from "@llm4ts/runner/Connectors";
26
27
  import { nodeSecretSource, resolveSide } from "./lib/soap/Auth.js";
@@ -33,7 +34,7 @@ const program = Effect.gen(function* () {
33
34
  const raw = input.prompt.trim();
34
35
  const location = isUrl(raw) || isAbsolute(raw) ? raw : resolve(input.workspace, raw);
35
36
  const judgment = yield* judgmentConnectorFromEnvironment();
36
- const service = process.env.LLM4TS_SOAP_SERVICE?.trim();
37
+ const service = settingValue("LLM4TS_SOAP_SERVICE", process.env);
37
38
  yield* runNode({
38
39
  workDir: input.workDir,
39
40
  workspace: input.workspace,
@@ -45,9 +46,9 @@ const program = Effect.gen(function* () {
45
46
  }, (context) => Effect.gen(function* () {
46
47
  const say = (message) => context.events.publish(Info.make({ message }));
47
48
  const workspace = yield* makeNodeWorkspace(input.workDir);
48
- const profile = service === undefined || service === ""
49
+ const profile = service === undefined
49
50
  ? undefined
50
- : yield* loadAuthProfile(workspace, service, process.env.LLM4TS_SOAP_ENV?.trim() || undefined);
51
+ : yield* loadAuthProfile(workspace, service, settingValue("LLM4TS_SOAP_ENV", process.env));
51
52
  if (isUrl(location) && profile === undefined) {
52
53
  yield* say("fetching without credentials (set LLM4TS_SOAP_SERVICE and write its auth.json for an authenticated WSDL)");
53
54
  }
@@ -24,6 +24,7 @@ import { readdir, readFile } from "node:fs/promises";
24
24
  import { dirname, join, relative, resolve } from "node:path";
25
25
  import { fileURLToPath } from "node:url";
26
26
  import * as Effect from "effect/Effect";
27
+ import { settingValue } from "@llm4ts/flow/Settings";
27
28
  import { makeStoryPlanStore } from "@llm4ts/flow/StoryPlan";
28
29
  import { FlowAborted, Info, makeNodeWorkspace, mock, nodePlainFileStore, nodeProcessExecutor, resolveFlowInput, runFlowMain, runNode, ScriptUsage } from "@llm4ts/runner";
29
30
  import { analysisPaths, writeAnalyses } from "./lib/soap/Analysis.js";
@@ -116,13 +117,9 @@ const program = Effect.gen(function* () {
116
117
  if (!existsSync(join(targetRoot, ".git")))
117
118
  yield* say(`⚠ ${targetRoot} is not a git repository; epic-stories needs one with at least one commit`);
118
119
  const workspace = yield* makeNodeWorkspace(input.workDir);
119
- const requested = environment.LLM4TS_SOAP_SERVICE?.trim();
120
+ const requested = settingValue("LLM4TS_SOAP_SERVICE", environment);
120
121
  const services = (yield* workspace.discover(".llm4ts/soap/*/catalog.json")).map((path) => path.split("/")[2] ?? "");
121
- const service = requested !== undefined && requested !== ""
122
- ? requested
123
- : services.length === 1
124
- ? services[0]
125
- : undefined;
122
+ const service = requested ?? (services.length === 1 ? services[0] : undefined);
126
123
  if (service === undefined) {
127
124
  return yield* FlowAborted.make({
128
125
  message: services.length === 0
@@ -144,7 +141,7 @@ const program = Effect.gen(function* () {
144
141
  message: `${paths.design} must be approved with no check errors (${file.approved ? `${errors.length} errors` : "not approved"}); run soap-design "check"`
145
142
  });
146
143
  }
147
- const api = environment.LLM4TS_ACE_API?.trim() || apiNameFor(service);
144
+ const api = settingValue("LLM4TS_ACE_API", environment) ?? apiNameFor(service);
148
145
  const soapRoot = catalog.documents[0] === undefined ? undefined : dirname(catalog.documents[0]);
149
146
  // Schemas may be declared in ISO-8859-1: decode by their declaration and
150
147
  // re-emit as UTF-8 so the ACE toolkit and git see one encoding.
@@ -33,6 +33,7 @@ import { readFile } from "node:fs/promises";
33
33
  import { isAbsolute, resolve } from "node:path";
34
34
  import { fileURLToPath } from "node:url";
35
35
  import * as Effect from "effect/Effect";
36
+ import { settingText, settingValue } from "@llm4ts/flow/Settings";
36
37
  import { FlowAborted, Info, makeNodeWorkspace, mock, resolveFlowInput, runFlowMain, runNode, ScriptUsage } from "@llm4ts/runner";
37
38
  import { coderFor, judgmentConnectorFromEnvironment } from "@llm4ts/runner/Connectors";
38
39
  import { nodeSecretSource, resolveSide } from "./lib/soap/Auth.js";
@@ -71,9 +72,9 @@ const program = Effect.gen(function* () {
71
72
  const raw = input.prompt.trim();
72
73
  const location = raw === "" ? undefined : isUrl(raw) || isAbsolute(raw) ? raw : resolve(input.workspace, raw);
73
74
  const environment = process.env;
74
- const requested = environment.LLM4TS_SOAP_SERVICE?.trim() || undefined;
75
+ const requested = settingValue("LLM4TS_SOAP_SERVICE", environment);
75
76
  const judgment = yield* judgmentConnectorFromEnvironment();
76
- const reasonerName = (environment.LLM4TS_REASONER ?? "claude").trim() || "claude";
77
+ const reasonerName = settingText("LLM4TS_REASONER", environment) ?? "claude";
77
78
  const reasoner = flags.design ? coderFor(reasonerName) : undefined;
78
79
  if (flags.design && reasoner === undefined) {
79
80
  return yield* ScriptUsage.make({ message: `unknown LLM4TS_REASONER '${reasonerName}'` });
@@ -97,7 +98,7 @@ const program = Effect.gen(function* () {
97
98
  if (location !== undefined) {
98
99
  const fetchProfile = requested === undefined
99
100
  ? undefined
100
- : yield* loadAuthProfile(workspace, requested, environment.LLM4TS_SOAP_ENV?.trim() || undefined);
101
+ : yield* loadAuthProfile(workspace, requested, settingValue("LLM4TS_SOAP_ENV", environment));
101
102
  const fetchSide = yield* resolveSide(nodeSecretSource(environment), fetchProfile?.fetch);
102
103
  const discovered = yield* discoverService({
103
104
  workspace,
@@ -127,7 +128,7 @@ const program = Effect.gen(function* () {
127
128
  catalog = yield* loadCatalog(workspace, service);
128
129
  yield* say(`continuing ${service}: ${catalog.operations.length} operations`);
129
130
  }
130
- const env = environment.LLM4TS_SOAP_ENV?.trim() || undefined;
131
+ const env = settingValue("LLM4TS_SOAP_ENV", environment);
131
132
  const profile = yield* loadAuthProfile(workspace, service, env);
132
133
  if (profile !== undefined)
133
134
  yield* say(`profile: ${profilePath(service, env)}`);
@@ -140,11 +141,11 @@ const program = Effect.gen(function* () {
140
141
  judged = new Map(yield* Effect.forEach(candidates, (operation) => Effect.map(judgeClass(seat, catalog, operation), (answer) => [operation.name, answer])));
141
142
  }
142
143
  // 2-3. requests and the probe
143
- const stub = environment.LLM4TS_SOAP_STUB?.trim();
144
- const transport = stub === undefined || stub === ""
144
+ const stub = settingValue("LLM4TS_SOAP_STUB", environment);
145
+ const transport = stub === undefined
145
146
  ? makeNodeSoapTransport()
146
147
  : makeDirectoryStubTransport(resolve(input.workspace, stub), catalog);
147
- if (stub !== undefined && stub !== "")
148
+ if (stub !== undefined)
148
149
  yield* say(`LLM4TS_SOAP_STUB: answering from ${stub}, not the network`);
149
150
  const result = yield* exploreService({
150
151
  workspace,
@@ -34,6 +34,7 @@ import * as Effect from "effect/Effect";
34
34
  import { FlowAborted, Info, makeNodeWorkspace, mock, resolveFlowInput, runFlowMain, runNode, ScriptUsage } from "@llm4ts/runner";
35
35
  import { coderFor } from "@llm4ts/runner/Connectors";
36
36
  import { terminalInteraction } from "@llm4ts/runner/TerminalInteraction";
37
+ import { settingText, settingValue } from "@llm4ts/flow/Settings";
37
38
  import { nodeSecretSource } from "./lib/soap/Auth.js";
38
39
  import { callOperation } from "./lib/soap/Call.js";
39
40
  import { operationByName } from "./lib/soap/Catalog.js";
@@ -95,7 +96,7 @@ export const parseSampleFlags = (argv) => Effect.gen(function* () {
95
96
  });
96
97
  /** The service directory: LLM4TS_SOAP_SERVICE, or the only one discovered. */
97
98
  const pickService = (workspace, requested) => Effect.gen(function* () {
98
- if (requested !== undefined && requested !== "")
99
+ if (requested !== undefined)
99
100
  return requested;
100
101
  const catalogs = yield* workspace.discover(".llm4ts/soap/*/catalog.json");
101
102
  const services = catalogs.map((path) => path.split("/")[2] ?? "");
@@ -117,13 +118,13 @@ const program = Effect.gen(function* () {
117
118
  const input = yield* resolveFlowInput("list", flags.rest);
118
119
  const [command = "list", ...args] = input.prompt.trim().split(/\s+/);
119
120
  const environment = process.env;
120
- const env = flags.env ?? (environment.LLM4TS_SOAP_ENV?.trim() || undefined);
121
+ const env = flags.env ?? settingValue("LLM4TS_SOAP_ENV", environment);
121
122
  const reasoner = command === "propose"
122
- ? coderFor((environment.LLM4TS_REASONER ?? "claude").trim() || "claude")
123
+ ? coderFor(settingText("LLM4TS_REASONER", environment) ?? "claude")
123
124
  : undefined;
124
125
  if (command === "propose" && reasoner === undefined) {
125
126
  return yield* ScriptUsage.make({
126
- message: `unknown LLM4TS_REASONER '${environment.LLM4TS_REASONER ?? ""}'`
127
+ message: `unknown LLM4TS_REASONER '${settingText("LLM4TS_REASONER", environment) ?? ""}'`
127
128
  });
128
129
  }
129
130
  yield* runNode({
@@ -136,7 +137,7 @@ const program = Effect.gen(function* () {
136
137
  }, (context) => Effect.gen(function* () {
137
138
  const say = (message) => context.events.publish(Info.make({ message }));
138
139
  const workspace = yield* makeNodeWorkspace(input.workDir);
139
- const service = yield* pickService(workspace, environment.LLM4TS_SOAP_SERVICE?.trim());
140
+ const service = yield* pickService(workspace, settingValue("LLM4TS_SOAP_SERVICE", environment));
140
141
  const catalog = yield* loadCatalog(workspace, service);
141
142
  const operations = yield* loadOperationsFile(workspace, service);
142
143
  switch (command) {
@@ -252,8 +253,7 @@ const program = Effect.gen(function* () {
252
253
  message: `no profile at ${profilePath(service, env)}; write it first`
253
254
  });
254
255
  }
255
- const stub = environment.LLM4TS_SOAP_STUB?.trim();
256
- if (stub !== undefined && stub !== "") {
256
+ if (settingValue("LLM4TS_SOAP_STUB", environment) !== undefined) {
257
257
  return yield* FlowAborted.make({
258
258
  message: "trust reads a real server; unset LLM4TS_SOAP_STUB"
259
259
  });
@@ -325,11 +325,11 @@ const program = Effect.gen(function* () {
325
325
  secrets: nodeSecretSource(environment),
326
326
  transport: makeNodeSoapTransport()
327
327
  });
328
- const stub = environment.LLM4TS_SOAP_STUB?.trim();
329
- const transport = stub === undefined || stub === ""
328
+ const stub = settingValue("LLM4TS_SOAP_STUB", environment);
329
+ const transport = stub === undefined
330
330
  ? makeNodeSoapTransport()
331
331
  : makeDirectoryStubTransport(resolve(input.workspace, stub), catalog);
332
- if (stub !== undefined && stub !== "")
332
+ if (stub !== undefined)
333
333
  yield* say(`LLM4TS_SOAP_STUB: answering from ${stub}, not the network`);
334
334
  const targets = [];
335
335
  const operationNames = target === "all"
@@ -11,6 +11,7 @@ import * as Effect from "effect/Effect";
11
11
  import * as Schema from "effect/Schema";
12
12
  import { nodeSecretSource } from "@llm4ts/flow/endpoint/Auth";
13
13
  import { SoapTransport } from "@llm4ts/flow/endpoint/Transport";
14
+ import { settingValue } from "@llm4ts/flow/Settings";
14
15
  import { ToolContext, ToolError, defineTool, report } from "@llm4ts/flow/tools/Tool";
15
16
  import { makeNodeWorkspace } from "@llm4ts/runner/NodeWorkspace";
16
17
  import { runToolMain } from "@llm4ts/runner/ToolMain";
@@ -73,8 +74,8 @@ export const soapCall = defineTool({
73
74
  return yield* fail(`no profile at ${profilePath(input.service, input.env)}`);
74
75
  }
75
76
  // `LLM4TS_SOAP_STUB=<dir>` answers from recorded responses, as soap-sample does.
76
- const stub = context.environment.LLM4TS_SOAP_STUB?.trim();
77
- const transport = stub === undefined || stub === ""
77
+ const stub = settingValue("LLM4TS_SOAP_STUB", context.environment);
78
+ const transport = stub === undefined
78
79
  ? live
79
80
  : makeDirectoryStubTransport(resolve(context.projectRoot, stub), catalog);
80
81
  const secrets = nodeSecretSource(context.environment);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@llm4ts/shell",
3
- "version": "3.2.6",
3
+ "version": "3.4.0",
4
4
  "description": "Interactive shell and CLI for llm4ts: flow discovery, run-a-flow, and view",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -20,6 +20,10 @@
20
20
  "exports": {
21
21
  "./Cli": "./dist/Cli.js",
22
22
  "./CoderChoice": "./dist/CoderChoice.js",
23
+ "./Config": "./dist/Config.js",
24
+ "./ConfigCommand": "./dist/ConfigCommand.js",
25
+ "./ConfigEdit": "./dist/ConfigEdit.js",
26
+ "./ConfigTrust": "./dist/ConfigTrust.js",
23
27
  "./FlowCatalog": "./dist/FlowCatalog.js",
24
28
  "./FlowLaunch": "./dist/FlowLaunch.js",
25
29
  "./FlowProcess": "./dist/FlowProcess.js",
@@ -61,9 +65,9 @@
61
65
  "dependencies": {
62
66
  "@effect/platform-node": "4.0.0",
63
67
  "@effect/platform-node-shared": "4.0.0",
64
- "@llm4ts/core": "3.2.6",
65
- "@llm4ts/runner": "3.2.6",
66
- "@llm4ts/flow": "3.2.6"
68
+ "@llm4ts/flow": "3.4.0",
69
+ "@llm4ts/runner": "3.4.0",
70
+ "@llm4ts/core": "3.4.0"
67
71
  },
68
72
  "peerDependencies": {
69
73
  "effect": "4.0.0"