@fro.bot/systematic 3.9.0 → 3.10.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.
@@ -1,117 +0,0 @@
1
- /**
2
- * Provider-grouped source category model defaults for Systematic bundled agents.
3
- *
4
- * This module owns the canonical shape, Zod schema, and constant for the
5
- * per-category model resolution chain. The resolution algorithm walks
6
- * the provider list in order and picks the first available provider/model pair.
7
- *
8
- * Provider catalog is constrained to the 7 IDs with empirical OMO usage-frequency
9
- * justification: vercel=80, opencode=55, github-copilot=39, opencode-go=26,
10
- * openai=20, anthropic=18, google=10.
11
- */
12
- import { z } from 'zod';
13
- /**
14
- * Zod literal union of the 7 supported provider IDs.
15
- * Ordered by OMO empirical usage frequency (highest first).
16
- */
17
- export declare const ProviderID: z.ZodUnion<readonly [z.ZodLiteral<"vercel">, z.ZodLiteral<"opencode">, z.ZodLiteral<"github-copilot">, z.ZodLiteral<"opencode-go">, z.ZodLiteral<"openai">, z.ZodLiteral<"anthropic">, z.ZodLiteral<"google">]>;
18
- export type ProviderID = z.infer<typeof ProviderID>;
19
- /**
20
- * Zod schema for the full source category model defaults map.
21
- *
22
- * Schema is **pure** — it validates only structural correctness:
23
- * - Shape correctness (CategoryDefaultSchema per value)
24
- * - Provider lists non-empty (enforced by CategoryDefaultSchema)
25
- * - Model lists non-empty (enforced by ProviderEntrySchema)
26
- * - (model, variant) pairs unique within a provider entry
27
- * - Provider IDs unique within a category
28
- * - variant is non-empty, whitespace-free, max 128 chars
29
- * - `rationale` and `whenToOverride` reject pipe (`|`) and newline characters
30
- * so the generator produces well-formed Markdown tables
31
- *
32
- * Filesystem coverage (every key resolves to a real `agents/<category>/`
33
- * directory) is NOT checked here. Use `assertCategoryCoverageOnDisk` to
34
- * enforce that invariant from tests where it matters; the production
35
- * runtime path uses `assertSourceCategoryModelCoverage` from
36
- * `agent-overlays.ts` against an in-memory inventory rather than reading
37
- * disk again.
38
- */
39
- export declare const SourceCategoryDefaultsSchema: z.ZodRecord<z.ZodString, z.ZodObject<{
40
- rationale: z.ZodString;
41
- whenToOverride: z.ZodOptional<z.ZodString>;
42
- providers: z.ZodArray<z.ZodObject<{
43
- provider: z.ZodUnion<readonly [z.ZodLiteral<"vercel">, z.ZodLiteral<"opencode">, z.ZodLiteral<"github-copilot">, z.ZodLiteral<"opencode-go">, z.ZodLiteral<"openai">, z.ZodLiteral<"anthropic">, z.ZodLiteral<"google">]>;
44
- models: z.ZodArray<z.ZodObject<{
45
- model: z.ZodString;
46
- variant: z.ZodOptional<z.ZodString>;
47
- }, z.core.$strict>>;
48
- }, z.core.$strict>>;
49
- }, z.core.$strict>>;
50
- /**
51
- * Verify that every category key in `categories` maps to a real
52
- * `agents/<category>/` directory on disk under `agentsDir` (defaulting to
53
- * the package's bundled-agents directory). Throws with a useful message if
54
- * any keys are unrecognized.
55
- *
56
- * Use from tests to lock the SOURCE_CATEGORY_MODEL_DEFAULTS ↔ agents/
57
- * directory layout contract. The production runtime path validates the
58
- * inverse direction (every bundled-agent category has a source default)
59
- * via `assertSourceCategoryModelCoverage` in `agent-overlays.ts`.
60
- */
61
- export declare function assertCategoryCoverageOnDisk(categories: readonly string[], agentsDir?: string): void;
62
- export interface ModelEntry {
63
- model: string;
64
- variant?: string;
65
- }
66
- export interface ProviderEntry {
67
- provider: ProviderID;
68
- models: ModelEntry[];
69
- }
70
- export interface CategoryDefault {
71
- rationale: string;
72
- whenToOverride?: string;
73
- providers: ProviderEntry[];
74
- }
75
- export type SourceCategoryDefaults = Record<string, CategoryDefault>;
76
- /**
77
- * Provider-grouped source model defaults for the 5 Systematic agent categories.
78
- *
79
- * Provider chains are ordered by OMO category-fit reasoning. The resolver
80
- * walks providers in order and picks the first available provider/model pair.
81
- * If no provider is available, the first entry of the first provider is used as
82
- * the last-resort fallback.
83
- *
84
- * Model choices translate the existing flat-string-array constant in agent-overlays.ts
85
- * to the new provider-grouped shape, with variant annotations where applicable.
86
- */
87
- export declare const SOURCE_CATEGORY_MODEL_DEFAULTS: SourceCategoryDefaults;
88
- /**
89
- * Format the SOURCE_CATEGORY_MODEL_DEFAULTS as a GitHub-flavored markdown table
90
- * for injection into documentation.
91
- *
92
- * Columns: Category | Chain | Rationale | When to Override
93
- *
94
- * Chain format: comma-separated `provider/model[+variant]` for the first 2–3
95
- * provider entries (first model per provider). Appends `, …` when there are
96
- * more than 3 provider entries.
97
- *
98
- * Returns a string ending with `\n` for clean concatenation.
99
- */
100
- export declare function formatForDocs(): string;
101
- /**
102
- * Walk the provider-grouped shape for a category and return the first available
103
- * provider/model pair from the availability set.
104
- *
105
- * Algorithm:
106
- * 1. Look up the category. Unknown category is a programmer error — throw.
107
- * 2. Walk providers in declared order. For each provider, walk its models in
108
- * declared order and test `${provider}/${model}` membership in availabilitySet.
109
- * 3. On first hit, return { provider, model, variant? }.
110
- * 4. Last-resort fallback (no available model anywhere): return the first model
111
- * entry of the first provider entry, including its variant if present.
112
- */
113
- export declare function resolveSourceModel(category: string, availabilitySet: ReadonlySet<string>): {
114
- provider: ProviderID;
115
- model: string;
116
- variant?: string;
117
- };