@codeworksh/harness 0.3.0-canary.42.1.gf2cf72a9 → 0.3.0-canary.44.1.g0d10cb87

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/effect.d.mts CHANGED
@@ -1754,6 +1754,7 @@ declare const parse$1: (path: string, source: string) => Effect.Effect<{
1754
1754
  supportsOpenAIGrammarTools?: boolean;
1755
1755
  supportsThinkingTokenBudget?: boolean;
1756
1756
  forceAdaptiveThinking?: boolean;
1757
+ supportsTemperature?: boolean;
1757
1758
  thinkingTokenBudgetField?: string;
1758
1759
  };
1759
1760
  contextWindow: number;
@@ -2655,7 +2656,7 @@ declare class ProviderError extends ProviderError_base {
2655
2656
  }
2656
2657
  declare const ModelCatalogError_base: Schema.Class<ModelCatalogError, Schema.TaggedStruct<"Runner.ModelCatalogError", {
2657
2658
  readonly path: Schema.String;
2658
- readonly reason: Schema.Literals<readonly ["missing", "unreadable", "empty", "invalid"]>;
2659
+ readonly reason: Schema.Literals<readonly ["unreadable", "empty", "invalid"]>;
2659
2660
  readonly detail: Schema.String;
2660
2661
  }>, import("effect/Cause").YieldableError>;
2661
2662
  declare class ModelCatalogError extends ModelCatalogError_base {
@@ -3564,6 +3565,7 @@ declare const models: Effect.Effect<Partial<Record<string, Record<string, {
3564
3565
  supportsOpenAIGrammarTools?: boolean;
3565
3566
  supportsThinkingTokenBudget?: boolean;
3566
3567
  forceAdaptiveThinking?: boolean;
3568
+ supportsTemperature?: boolean;
3567
3569
  thinkingTokenBudgetField?: string;
3568
3570
  };
3569
3571
  contextWindow: number;
@@ -3671,6 +3673,7 @@ declare const effective: (declared: readonly schema_d_exports$4.DeclaredModel[])
3671
3673
  supportsOpenAIGrammarTools?: boolean;
3672
3674
  supportsThinkingTokenBudget?: boolean;
3673
3675
  forceAdaptiveThinking?: boolean;
3676
+ supportsTemperature?: boolean;
3674
3677
  thinkingTokenBudgetField?: string;
3675
3678
  };
3676
3679
  contextWindow: number;
package/effect.mjs CHANGED
@@ -21,7 +21,7 @@ import { ChildProcess, ChildProcessSpawner } from "effect/process";
21
21
  import { Buffer as Buffer$1 } from "node:buffer";
22
22
  import { fileURLToPath, pathToFileURL } from "node:url";
23
23
  import { DirectoryNotFoundError, DirectoryNotFoundError as DirectoryNotFoundError$1, Info, Info as Info$1, NotDirectoryError, NotDirectoryError as NotDirectoryError$1, Service, Service as Service$8 } from "@codeworksh/plugin/location";
24
- import { generateModels } from "@codeworksh/aikit/modelgen";
24
+ import { downloadCatalog } from "@codeworksh/aikit/modelgen";
25
25
  import { JsonGitHubCopilotAuthStorage, getGitHubCopilotApiKey } from "@codeworksh/aikit/oauth/github/copilot";
26
26
  import { JsonOpenAICodexAuthStorage, getOpenAICodexApiKey } from "@codeworksh/aikit/oauth/openai/codex";
27
27
  import { parse, printParseErrorCode } from "jsonc-parser";
@@ -4939,7 +4939,6 @@ var ProviderError = class extends Schema.TaggedError()("Runner.ProviderError", {
4939
4939
  var ModelCatalogError = class extends Schema.TaggedError()("Runner.ModelCatalogError", {
4940
4940
  path: Schema.String,
4941
4941
  reason: Schema.Literals([
4942
- "missing",
4943
4942
  "unreadable",
4944
4943
  "empty",
4945
4944
  "invalid"
@@ -5631,8 +5630,13 @@ const stale = Effect.fn("ModelCatalog.stale")(function* (path) {
5631
5630
  const ttl = yield* ttlConfig;
5632
5631
  return (yield* Clock.currentTimeMillis) - mtime.value >= Duration.toMillis(ttl);
5633
5632
  });
5633
+ /** OpenRouter's catalog is narrowed to what the host's key may use, when one is set. */
5634
+ const openRouterKey = () => getEnvApiKey({ env: ["OPENROUTER_API_KEY"] });
5634
5635
  const download$1 = (path) => Effect.tryPromise({
5635
- try: () => generateModels({ path }),
5636
+ try: () => downloadCatalog({
5637
+ path,
5638
+ openRouterKey: openRouterKey()
5639
+ }),
5636
5640
  catch: (cause) => new RefreshError({
5637
5641
  path,
5638
5642
  detail: cause instanceof Error ? cause.message : String(cause)
@@ -5653,8 +5657,7 @@ const refresh$1 = Effect.fn("ModelCatalog.refresh")(function* (home, options = {
5653
5657
  });
5654
5658
  /**
5655
5659
  * The automatic check: refresh a stale catalog unless it is pinned, and never fail. A failed
5656
- * download leaves the old file in place; a missing one surfaces later as a
5657
- * `Runner.ModelCatalogError` from whatever needed it.
5660
+ * download leaves the old file in place; without one, aikit's bundled baseline is read.
5658
5661
  */
5659
5662
  const check$1 = Effect.fn("ModelCatalog.check")(function* ({ path, pinned }) {
5660
5663
  if (pinned || !(yield* stale(path))) return;
@@ -5690,7 +5693,7 @@ const loadError = (cause) => {
5690
5693
  if (typeof cause !== "object" || cause === null || !("name" in cause) || cause.name !== "ModelCatalogLoadError") return;
5691
5694
  if (!("data" in cause) || typeof cause.data !== "object" || cause.data === null) return void 0;
5692
5695
  const data = cause.data;
5693
- if (!("path" in data) || typeof data.path !== "string" || !("message" in data) || typeof data.message !== "string" || !("reason" in data) || data.reason !== "missing" && data.reason !== "unreadable" && data.reason !== "empty" && data.reason !== "invalid") return;
5696
+ if (!("path" in data) || typeof data.path !== "string" || !("message" in data) || typeof data.message !== "string" || !("reason" in data) || data.reason !== "unreadable" && data.reason !== "empty" && data.reason !== "invalid") return;
5694
5697
  return new ModelCatalogError({
5695
5698
  path: data.path,
5696
5699
  reason: data.reason,