clanka 0.15.0 → 0.16.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 CHANGED
@@ -113,6 +113,20 @@ clanka --reported-version 2.33.0 --version
113
113
  Put the flag in the launcher's fixed arguments, before the subcommand, so both
114
114
  the version probe and `clanka acp` see it.
115
115
 
116
+ Set `CLANKA_REASONING` to choose the reasoning effort new sessions start with,
117
+ for launchers that have no effort setting of their own:
118
+
119
+ ```sh
120
+ CLANKA_REASONING=high clanka acp
121
+ ```
122
+
123
+ It applies when `--model` has no effort, as in `--model openai/gpt-6-astra`.
124
+ An effort in `--model`, such as `openai/gpt-6-astra/low`, takes precedence, and
125
+ without either the effort is `medium`. The value must be one of `none`,
126
+ `minimal`, `low`, `medium`, `high`, `xhigh` or `max`; anything else stops
127
+ `clanka acp` at startup. The ACP client can still change the effort of a
128
+ session, and loaded sessions keep the effort they were saved with.
129
+
116
130
  `_session/steer`, kiro-cli's extension method, adds a message to the prompt a
117
131
  session is running. It takes `{ sessionId, message }` and returns
118
132
  `{ "queued": true }` when the running prompt will read the message, or
package/dist/bin/cli.mjs CHANGED
@@ -41316,7 +41316,7 @@ const providerIds = [
41316
41316
  ];
41317
41317
  const ModelsDevApi = Struct(Object.fromEntries(providerIds.map(([id]) => [id, optionalKey(ModelsDevProvider)])));
41318
41318
  const decodeModel = decodeUnknownOption(ModelsDevModel);
41319
- const isThoughtLevel = is(ThoughtLevel);
41319
+ const isThoughtLevel$1 = is(ThoughtLevel);
41320
41320
  const toCatalog = (api) => providerIds.flatMap(([id, provider]) => Object.values(api[id]?.models ?? {}).flatMap((entry) => {
41321
41321
  const model = getOrUndefined(decodeModel(entry));
41322
41322
  if (model === void 0 || model.type !== void 0 || model.status === "deprecated" || model.tool_call !== true) return [];
@@ -41325,7 +41325,7 @@ const toCatalog = (api) => providerIds.flatMap(([id, provider]) => Object.values
41325
41325
  provider,
41326
41326
  id: model.id,
41327
41327
  name: model.name,
41328
- efforts: (effort?.values ?? []).filter(isThoughtLevel)
41328
+ efforts: (effort?.values ?? []).filter(isThoughtLevel$1)
41329
41329
  })];
41330
41330
  }));
41331
41331
  var CachedCatalog = class extends Class$1("clanka/ModelsRepo/CachedCatalog")({
@@ -41555,7 +41555,7 @@ const makeAcp = (options) => (modelId, thoughtLevel, fastMode = false) => map$8(
41555
41555
  const LogToStderr = LogToStderr$1;
41556
41556
  //#endregion
41557
41557
  //#region package.json
41558
- var version$1 = "0.15.0";
41558
+ var version$1 = "0.16.0";
41559
41559
  //#endregion
41560
41560
  //#region src/cli.ts
41561
41561
  const ReportedVersion = Setting("reported-version")({ flag: String$1("reported-version").pipe(withDescription$1("Report this version instead of clanka's own, for --version and to ACP clients"), optional$1) });
@@ -41600,14 +41600,15 @@ const selectModel = fnUntraced(function* (provider) {
41600
41600
  };
41601
41601
  });
41602
41602
  const isProvider = is(Provider);
41603
+ const isThoughtLevel = is(ThoughtLevel);
41603
41604
  const parseModelId = (modelId) => {
41604
41605
  const [provider, model, effort, ...rest] = modelId.split("/");
41605
- return isProvider(provider) && model !== void 0 && is(ThoughtLevel)(effort) && rest.length === 0 ? some({
41606
+ return isProvider(provider) && model !== void 0 && (effort === void 0 || isThoughtLevel(effort)) && rest.length === 0 ? some({
41606
41607
  model: `${provider}:${model}`,
41607
- thoughtLevel: effort
41608
+ thoughtLevel: fromUndefinedOr(effort)
41608
41609
  }) : none();
41609
41610
  };
41610
- const ModelId = String$6.pipe(check(makeFilter((modelId) => isSome(parseModelId(modelId)) || `Invalid model "${modelId}", expected <provider>/<model>/<effort> with effort one of ${ThoughtLevel.literals.join(", ")}`)));
41611
+ const ModelId = String$6.pipe(check(makeFilter((modelId) => isSome(parseModelId(modelId)) || `Invalid model "${modelId}", expected <provider>/<model>[/<effort>] with effort one of ${ThoughtLevel.literals.join(", ")}`)));
41611
41612
  const provider = Literals("provider", providers).pipe(withAlias("p"), withFallbackPrompt(Select({
41612
41613
  message: "Select a provider",
41613
41614
  choices: [
@@ -41653,8 +41654,9 @@ const Search = (directory) => unwrap$1(gen(function* () {
41653
41654
  database: path.join(directory, "search.sqlite")
41654
41655
  }).pipe(provide$3(model$3("text-embedding-3-small", { dimensions: 1536 })), provide$3(layer$4({ apiKey: apiKey.value })));
41655
41656
  })).pipe(provide$3([layer$9, HttpClientLive]));
41656
- const acpModel = String$1("model").pipe(withAlias("m"), withDescription$1("Default model as <provider>/<model>/<effort>, e.g. openai/gpt-6-astra/medium"), withSchema(ModelId), withDefault("openai/gpt-6-astra/medium"), map$1((modelId) => getOrThrow(parseModelId(modelId))));
41657
- const trustAllTools = Boolean$1("trust-all-tools").pipe(withDescription$1("Accepted for kiro-cli compatibility. Has no effect: clanka runs every tool call without asking."));
41657
+ const acpModel = String$1("model").pipe(withAlias("m"), withDescription$1("Default model as <provider>/<model>[/<effort>], e.g. openai/gpt-6-astra/medium. Without an effort, uses CLANKA_REASONING, or medium."), withSchema(ModelId), withDefault("openai/gpt-6-astra"), map$1((modelId) => getOrThrow(parseModelId(modelId))));
41658
+ const trustAllTools = Boolean$1("trust-all-tools").pipe(withDescription$1("Accepted for kiro-cli compatibility. Has no effect: clanka runs every tool call without asking."), withDefault(false));
41659
+ const reasoning = schema$1(ThoughtLevel, "CLANKA_REASONING").pipe(withDefault$2("medium"));
41658
41660
  const acp = make$30("acp", {
41659
41661
  model: acpModel,
41660
41662
  trustAllTools,
@@ -41664,10 +41666,11 @@ const acp = make$30("acp", {
41664
41666
  apiUrl
41665
41667
  }).pipe(withDescription("Run as an Agent Client Protocol (ACP) server over stdio"), withHandler(({ model, fast, apiKey, apiUrl }) => gen(function* () {
41666
41668
  const repo = yield* ModelsRepo;
41669
+ const defaultThoughtLevel = yield* reasoning;
41667
41670
  return yield* runStdio({
41668
41671
  version,
41669
41672
  defaultModel: model.model,
41670
- defaultThoughtLevel: model.thoughtLevel,
41673
+ defaultThoughtLevel: getOrElse(model.thoughtLevel, () => defaultThoughtLevel),
41671
41674
  defaultFastMode: fast,
41672
41675
  supportsFastMode: acpSupportsFastMode,
41673
41676
  availableModels: map$5(repo.models, acpModels),