@codeworksh/plugin 0.0.1-dev.20260925150557 → 0.1.0-canary.16.1.gfa1c6c4c

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/settings.mjs CHANGED
@@ -1,5 +1,6 @@
1
+ import { NonNegativeInt, isAikitModelInfo, validateAikitModelInfo } from "./schema.mjs";
1
2
  import { Model as Model$1 } from "@codeworksh/aikit";
2
- import { Schema } from "effect";
3
+ import { Effect, Schema, SchemaGetter, SchemaIssue } from "effect";
3
4
  //#region src/settings.ts
4
5
  const ThinkingLevel = Schema.Literals(Object.values(Model$1.ThinkingLevelEnum));
5
6
  const ToolExecution = Schema.Literals(["sequential", "parallel"]);
@@ -21,6 +22,15 @@ const requestFields = {
21
22
  baseURL: Schema.optional(Schema.String),
22
23
  method: Schema.optional(Schema.Literals(Object.values(Model$1.APIMethodEnum)))
23
24
  };
25
+ /**
26
+ * An API key named, never written: `"${NAME}"`, read from the host process environment when the
27
+ * model is called. Settings only ever hold the variable's name.
28
+ */
29
+ const keyReference = /^\$\{([A-Za-z_][A-Za-z0-9_]*)\}$/;
30
+ const keyReferenceError = "apiKey must reference an environment variable, e.g. \"${OPENAI_API_KEY}\"";
31
+ const KeyReference = Schema.String.check(Schema.makeFilter((value) => keyReference.test(value) || keyReferenceError));
32
+ /** The variable a `"${NAME}"` reference names. */
33
+ const keyName = (reference) => keyReference.exec(reference)?.[1] ?? reference;
24
34
  const reserved = /* @__PURE__ */ new Set([
25
35
  "toolChoice",
26
36
  "activeTools",
@@ -30,7 +40,6 @@ const reserved = /* @__PURE__ */ new Set([
30
40
  "sessionId",
31
41
  "reasoning",
32
42
  "modelId",
33
- "apiKey",
34
43
  "onPayload",
35
44
  "api",
36
45
  "npm",
@@ -46,6 +55,8 @@ const Block = Schema.StructWithRest(Schema.Struct({
46
55
  thinkingLevel: Schema.optional(ThinkingLevel),
47
56
  toolExecution: Schema.optional(ToolExecution),
48
57
  contextWindow: Schema.optional(Schema.Finite),
58
+ /** Which environment variable holds the key for this model: `"${NAME}"`. */
59
+ apiKey: Schema.optional(KeyReference),
49
60
  extras: Schema.optional(Schema.Record(Schema.String, Schema.Unknown))
50
61
  }), [Schema.Record(Schema.String, Schema.Unknown)]).check(Schema.makeFilter((value) => Object.keys(value).every((key) => !reserved.has(key)) || "Reserved configuration key in model options"));
51
62
  const Model = Schema.Struct({
@@ -57,6 +68,23 @@ const Model = Schema.Struct({
57
68
  options: Schema.optional(Block),
58
69
  providerOptions: Schema.optional(Schema.Record(Schema.String, Schema.Record(Schema.String, Block)))
59
70
  });
71
+ const reasonOf = (cause) => cause instanceof Error ? cause.message : String(cause);
72
+ const decodeModelEntry = (value, options) => Effect.try({
73
+ try: () => {
74
+ const entry = validateAikitModelInfo(value, "models entry");
75
+ if (entry.provider.key !== void 0 && !keyReference.test(entry.provider.key)) throw new Error(`models entry ${entry.provider.id}/${entry.id}: provider.key: ${keyReferenceError}`);
76
+ return entry;
77
+ },
78
+ catch: (cause) => new SchemaIssue.InvalidValue({ message: reasonOf(cause) }, value, options)
79
+ });
80
+ /**
81
+ * A catalog entry in settings: an aikit `Model.Info`, read exactly like an entry of the generated
82
+ * catalog. The one difference is `provider.key`, which must be a `"${NAME}"` reference.
83
+ */
84
+ const ModelEntry = Schema.Unknown.pipe(Schema.decodeTo(Schema.declare(isAikitModelInfo, { expected: "aikit Model.Info" }), {
85
+ decode: SchemaGetter.transformEffect(decodeModelEntry),
86
+ encode: SchemaGetter.transformEffect(decodeModelEntry)
87
+ }));
60
88
  /** A module to load: a path, a `file:` URL, or a package spec. */
61
89
  const PluginReference = Schema.String.check(Schema.isNonEmpty());
62
90
  /**
@@ -76,15 +104,31 @@ const PluginPatch = Schema.Union([Schema.Struct({
76
104
  ...config
77
105
  })], { mode: "oneOf" });
78
106
  const PluginEntry = Schema.Union([PluginReference, PluginPatch]);
107
+ /**
108
+ * Agent-level retry of a turn whose provider request failed transiently (rate limit, overload,
109
+ * 5xx, dropped connection). Delays double from `baseDelayMs` and stop growing at `maxDelayMs`;
110
+ * a server that asks for a longer wait than `maxDelayMs` is not retried. `maxRetries: 0` is off.
111
+ *
112
+ * Separate from `model.options.maxRetries`, which retries inside the provider SDK and defaults to
113
+ * 0 so that the two do not multiply, and so a quota error reaches the loop instead of being retried.
114
+ */
115
+ const Retry = Schema.Struct({
116
+ maxRetries: Schema.optional(NonNegativeInt),
117
+ baseDelayMs: Schema.optional(NonNegativeInt),
118
+ maxDelayMs: Schema.optional(NonNegativeInt)
119
+ });
79
120
  const Patch = Schema.Struct({
80
121
  $schema: Schema.optional(Schema.String),
81
122
  plugins: Schema.optional(Schema.Array(PluginEntry)),
82
- model: Schema.optional(Model)
123
+ model: Schema.optional(Model),
124
+ models: Schema.optional(Schema.Array(ModelEntry)),
125
+ retry: Schema.optional(Retry)
83
126
  });
84
127
  /** Let aikit supply model-aware generation defaults. */
85
128
  const defaults = {
86
129
  plugins: [],
87
130
  declared: [],
131
+ models: [],
88
132
  model: {
89
133
  provider: "openai",
90
134
  id: "gpt-5.6-luna",
@@ -92,11 +136,16 @@ const defaults = {
92
136
  toolExecution: "sequential",
93
137
  options: {
94
138
  timeoutMs: 36e5,
95
- maxRetries: 3
139
+ maxRetries: 0
96
140
  }
141
+ },
142
+ retry: {
143
+ maxRetries: 3,
144
+ baseDelayMs: 2e3,
145
+ maxDelayMs: 6e4
97
146
  }
98
147
  };
99
148
  //#endregion
100
- export { Block, Model, ModelProtocol, Patch, PluginEntry, PluginPatch, ThinkingLevel, ToolExecution, defaults, requestFields };
149
+ export { Block, KeyReference, Model, ModelEntry, ModelProtocol, Patch, PluginEntry, PluginPatch, Retry, ThinkingLevel, ToolExecution, defaults, keyName, requestFields };
101
150
 
102
151
  //# sourceMappingURL=settings.mjs.map
package/settings.mjs.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"settings.mjs","names":["AikitModel"],"sources":["../../src/settings.ts"],"sourcesContent":["import { Model as AikitModel, type Protocol } from \"@codeworksh/aikit\";\nimport { Schema } from \"effect\";\n\nexport const ThinkingLevel = Schema.Literals(Object.values(AikitModel.ThinkingLevelEnum));\nexport const ToolExecution = Schema.Literals([\"sequential\", \"parallel\"]);\nexport type ToolExecution = typeof ToolExecution.Type;\nconst Budgets = Schema.Record(\n\tSchema.Literals(Object.values(AikitModel.ThinkingLevelEnum).filter((level) => level !== \"off\")),\n\tSchema.optional(Schema.Finite),\n);\n\n/** Aikit does not export its request schema; keep this routing surface checked against its public types. */\nexport const requestFields = {\n\ttemperature: Schema.optional(Schema.Finite),\n\tmaxTokens: Schema.optional(Schema.Finite),\n\tcacheRetention: Schema.optional(Schema.Literals([\"none\", \"short\", \"long\"])),\n\theaders: Schema.optional(Schema.Record(Schema.String, Schema.String)),\n\ttimeoutMs: Schema.optional(Schema.Finite),\n\tmaxRetries: Schema.optional(Schema.Finite),\n\tmetadata: Schema.optional(Schema.Record(Schema.String, Schema.Unknown)),\n\tthinkingBudgets: Schema.optional(Budgets),\n\tbaseURL: Schema.optional(Schema.String),\n\tmethod: Schema.optional(Schema.Literals(Object.values(AikitModel.APIMethodEnum))),\n} satisfies Record<\n\t| Exclude<keyof Protocol.CommonOptions, \"signal\" | \"sessionId\" | \"reasoning\" | \"apiKey\" | \"onPayload\">\n\t| \"baseURL\"\n\t| \"method\",\n\tSchema.Top\n>;\n\nconst reserved = new Set([\n\t\"toolChoice\",\n\t\"activeTools\",\n\t\"provider\",\n\t\"id\",\n\t\"signal\",\n\t\"sessionId\",\n\t\"reasoning\",\n\t\"modelId\",\n\t\"apiKey\",\n\t\"onPayload\",\n\t\"api\",\n\t\"npm\",\n\t\"providerOptionsKey\",\n\t\"compat\",\n\t\"thinkingLevelMap\",\n]);\n\n/** The wire protocol a model speaks, which a catalog entry may have wrong for a local endpoint. */\nexport const ModelProtocol = Schema.Literals(Object.values(AikitModel.KnownProviderEnum));\n\nexport const Block = Schema.StructWithRest(\n\tSchema.Struct({\n\t\t...requestFields,\n\t\tprotocol: Schema.optional(ModelProtocol),\n\t\tthinkingLevel: Schema.optional(ThinkingLevel),\n\t\ttoolExecution: Schema.optional(ToolExecution),\n\t\tcontextWindow: Schema.optional(Schema.Finite),\n\t\textras: Schema.optional(Schema.Record(Schema.String, Schema.Unknown)),\n\t}),\n\t[Schema.Record(Schema.String, Schema.Unknown)],\n).check(\n\tSchema.makeFilter(\n\t\t(value) => Object.keys(value).every((key) => !reserved.has(key)) || \"Reserved configuration key in model options\",\n\t),\n);\nexport type Block = typeof Block.Type;\n\nexport const Model = Schema.Struct({\n\tprovider: Schema.optional(Schema.String),\n\tid: Schema.optional(Schema.String),\n\tthinkingLevel: Schema.optional(ThinkingLevel),\n\ttoolExecution: Schema.optional(ToolExecution),\n\tthinkingBudgets: Schema.optional(Budgets),\n\toptions: Schema.optional(Block),\n\tproviderOptions: Schema.optional(Schema.Record(Schema.String, Schema.Record(Schema.String, Block))),\n});\n/** A module to load: a path, a `file:` URL, or a package spec. */\nconst PluginReference = Schema.String.check(Schema.isNonEmpty());\n/**\n * Configuration for a plugin something else already selected, named by its ID (`plugin`) or by\n * its registered module string (`package`). It never loads anything: an entry naming a plugin\n * that is not in the selection is ignored.\n */\nconst config = {\n\tenabled: Schema.optional(Schema.Boolean),\n\toptions: Schema.optional(Schema.Record(Schema.String, Schema.Unknown)),\n};\nexport const PluginPatch = Schema.Union(\n\t[Schema.Struct({ plugin: PluginReference, ...config }), Schema.Struct({ package: PluginReference, ...config })],\n\t// `oneOf`, so an entry carrying both keys is a decode failure rather than one of them being\n\t// quietly dropped -- naming a plugin two ways at once says two different things.\n\t{ mode: \"oneOf\" },\n);\nexport const PluginEntry = Schema.Union([PluginReference, PluginPatch]);\nexport type PluginEntry = typeof PluginEntry.Type;\n\nexport const Patch = Schema.Struct({\n\t$schema: Schema.optional(Schema.String),\n\tplugins: Schema.optional(Schema.Array(PluginEntry)),\n\tmodel: Schema.optional(Model),\n});\nexport type Patch = typeof Patch.Type;\n\n/**\n * One plugin entry, and where it came from.\n *\n * Flattening every layer's `plugins` into one array loses the file that declared each entry, and\n * that cannot be recovered afterwards: two layers may declare the same string, so attribution is\n * genuinely gone rather than merely inconvenient. Three things need it -- anchoring a relative\n * path, naming the declaring layer in `plugin list`, and the missing-plugin diagnostic -- so the\n * loaded shape carries it from the start.\n *\n * In simple terms:\n * `written` - is what module the developer is declaring - what\n * `file` - where the module is being declared - where\n * `entry` - the resolved path of the module, relative to the `file`; especially needed for local.\n *\n * Example:\n * written: \"@acme/x@^1\"\n * entry: \"@acme/x@^1\"\n * file: \"/Users/me/.codework/settings.jsonc\"\n *\n * written: \"./plugins/mine.mjs\"\n * entry: \"/Users/me/.codework/plugins/mine.mjs\"\n * file: \"/Users/me/.codework/settings.jsonc\"\n */\nexport interface Declared {\n\t/** The entry exactly as the file spells it, which is the string a person will search for. */\n\treadonly written: PluginEntry;\n\t/** The same entry with any relative path anchored to the directory of its declaring file. */\n\treadonly entry: PluginEntry;\n\t/** The settings file that declared it. */\n\treadonly file: string;\n}\n\nexport interface Info {\n\t/**\n\t * Plugin entries added to the harness selection, in order: every layer's entries, lowest\n\t * priority first, so a project's list extends the user's rather than replacing it.\n\t *\n\t * Anchored, and stripped of provenance: this is the list the loader consumes. {@link Info.declared}\n\t * is the same list with the file each entry came from.\n\t */\n\treadonly plugins: ReadonlyArray<PluginEntry>;\n\t/** {@link Info.plugins}, with the origin of each entry. Same order, same length. */\n\treadonly declared: ReadonlyArray<Declared>;\n\treadonly model: typeof Model.Type & {\n\t\treadonly provider: string;\n\t\treadonly id: string;\n\t\treadonly thinkingLevel: AikitModel.ThinkingLevel;\n\t\treadonly toolExecution: ToolExecution;\n\t};\n}\n\n/** Let aikit supply model-aware generation defaults. */\nexport const defaults: Info = {\n\tplugins: [],\n\tdeclared: [],\n\tmodel: {\n\t\tprovider: \"openai\",\n\t\tid: \"gpt-5.6-luna\",\n\t\tthinkingLevel: \"high\",\n\t\ttoolExecution: \"sequential\",\n\t\toptions: { timeoutMs: 3_600_000, maxRetries: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AAU;EACV,IAAI;EACJ,eAAe;EACf,eAAe;EACf,SAAS;GAAE,WAAW;GAAW,YAAY;EAAE;CAChD;AACD"}
1
+ {"version":3,"file":"settings.mjs","names":["AikitModel"],"sources":["../../src/settings.ts"],"sourcesContent":["import { Model as AikitModel, type Protocol } from \"@codeworksh/aikit\";\nimport { Effect, Schema, type SchemaAST, SchemaGetter, SchemaIssue } from \"effect\";\nimport { isAikitModelInfo, NonNegativeInt, validateAikitModelInfo } from \"./schema.ts\";\n\nexport const ThinkingLevel = Schema.Literals(Object.values(AikitModel.ThinkingLevelEnum));\nexport const ToolExecution = Schema.Literals([\"sequential\", \"parallel\"]);\nexport type ToolExecution = typeof ToolExecution.Type;\nconst Budgets = Schema.Record(\n\tSchema.Literals(Object.values(AikitModel.ThinkingLevelEnum).filter((level) => level !== \"off\")),\n\tSchema.optional(Schema.Finite),\n);\n\n/** Aikit does not export its request schema; keep this routing surface checked against its public types. */\nexport const requestFields = {\n\ttemperature: Schema.optional(Schema.Finite),\n\tmaxTokens: Schema.optional(Schema.Finite),\n\tcacheRetention: Schema.optional(Schema.Literals([\"none\", \"short\", \"long\"])),\n\theaders: Schema.optional(Schema.Record(Schema.String, Schema.String)),\n\ttimeoutMs: Schema.optional(Schema.Finite),\n\tmaxRetries: Schema.optional(Schema.Finite),\n\tmetadata: Schema.optional(Schema.Record(Schema.String, Schema.Unknown)),\n\tthinkingBudgets: Schema.optional(Budgets),\n\tbaseURL: Schema.optional(Schema.String),\n\tmethod: Schema.optional(Schema.Literals(Object.values(AikitModel.APIMethodEnum))),\n} satisfies Record<\n\t| Exclude<keyof Protocol.CommonOptions, \"signal\" | \"sessionId\" | \"reasoning\" | \"apiKey\" | \"onPayload\">\n\t| \"baseURL\"\n\t| \"method\",\n\tSchema.Top\n>;\n\n/**\n * An API key named, never written: `\"${NAME}\"`, read from the host process environment when the\n * model is called. Settings only ever hold the variable's name.\n */\nconst keyReference = /^\\$\\{([A-Za-z_][A-Za-z0-9_]*)\\}$/;\nconst keyReferenceError = 'apiKey must reference an environment variable, e.g. \"${OPENAI_API_KEY}\"';\nexport const KeyReference = Schema.String.check(\n\tSchema.makeFilter((value) => keyReference.test(value) || keyReferenceError),\n);\n\n/** The variable a `\"${NAME}\"` reference names. */\nexport const keyName = (reference: string): string => keyReference.exec(reference)?.[1] ?? reference;\n\nconst reserved = new Set([\n\t\"toolChoice\",\n\t\"activeTools\",\n\t\"provider\",\n\t\"id\",\n\t\"signal\",\n\t\"sessionId\",\n\t\"reasoning\",\n\t\"modelId\",\n\t\"onPayload\",\n\t\"api\",\n\t\"npm\",\n\t\"providerOptionsKey\",\n\t\"compat\",\n\t\"thinkingLevelMap\",\n]);\n\n/** The wire protocol a model speaks, which a catalog entry may have wrong for a local endpoint. */\nexport const ModelProtocol = Schema.Literals(Object.values(AikitModel.KnownProviderEnum));\n\nexport const Block = Schema.StructWithRest(\n\tSchema.Struct({\n\t\t...requestFields,\n\t\tprotocol: Schema.optional(ModelProtocol),\n\t\tthinkingLevel: Schema.optional(ThinkingLevel),\n\t\ttoolExecution: Schema.optional(ToolExecution),\n\t\tcontextWindow: Schema.optional(Schema.Finite),\n\t\t/** Which environment variable holds the key for this model: `\"${NAME}\"`. */\n\t\tapiKey: Schema.optional(KeyReference),\n\t\textras: Schema.optional(Schema.Record(Schema.String, Schema.Unknown)),\n\t}),\n\t[Schema.Record(Schema.String, Schema.Unknown)],\n).check(\n\tSchema.makeFilter(\n\t\t(value) => Object.keys(value).every((key) => !reserved.has(key)) || \"Reserved configuration key in model options\",\n\t),\n);\nexport type Block = typeof Block.Type;\n\nexport const Model = Schema.Struct({\n\tprovider: Schema.optional(Schema.String),\n\tid: Schema.optional(Schema.String),\n\tthinkingLevel: Schema.optional(ThinkingLevel),\n\ttoolExecution: Schema.optional(ToolExecution),\n\tthinkingBudgets: Schema.optional(Budgets),\n\toptions: Schema.optional(Block),\n\tproviderOptions: Schema.optional(Schema.Record(Schema.String, Schema.Record(Schema.String, Block))),\n});\nconst reasonOf = (cause: unknown): string => (cause instanceof Error ? cause.message : String(cause));\n\nconst decodeModelEntry = (value: unknown, options: SchemaAST.ParseOptions) =>\n\tEffect.try({\n\t\ttry: () => {\n\t\t\tconst entry = validateAikitModelInfo(value, \"models entry\");\n\t\t\tif (entry.provider.key !== undefined && !keyReference.test(entry.provider.key)) {\n\t\t\t\tthrow new Error(`models entry ${entry.provider.id}/${entry.id}: provider.key: ${keyReferenceError}`);\n\t\t\t}\n\t\t\treturn entry;\n\t\t},\n\t\tcatch: (cause) => new SchemaIssue.InvalidValue({ message: reasonOf(cause) }, value, options),\n\t});\n\n/**\n * A catalog entry in settings: an aikit `Model.Info`, read exactly like an entry of the generated\n * catalog. The one difference is `provider.key`, which must be a `\"${NAME}\"` reference.\n */\nexport const ModelEntry = Schema.Unknown.pipe(\n\tSchema.decodeTo(Schema.declare<AikitModel.Info>(isAikitModelInfo, { expected: \"aikit Model.Info\" }), {\n\t\tdecode: SchemaGetter.transformEffect(decodeModelEntry),\n\t\tencode: SchemaGetter.transformEffect(decodeModelEntry),\n\t}),\n);\nexport type ModelEntry = typeof ModelEntry.Type;\n\n/** A module to load: a path, a `file:` URL, or a package spec. */\nconst PluginReference = Schema.String.check(Schema.isNonEmpty());\n/**\n * Configuration for a plugin something else already selected, named by its ID (`plugin`) or by\n * its registered module string (`package`). It never loads anything: an entry naming a plugin\n * that is not in the selection is ignored.\n */\nconst config = {\n\tenabled: Schema.optional(Schema.Boolean),\n\toptions: Schema.optional(Schema.Record(Schema.String, Schema.Unknown)),\n};\nexport const PluginPatch = Schema.Union(\n\t[Schema.Struct({ plugin: PluginReference, ...config }), Schema.Struct({ package: PluginReference, ...config })],\n\t// `oneOf`, so an entry carrying both keys is a decode failure rather than one of them being\n\t// quietly dropped -- naming a plugin two ways at once says two different things.\n\t{ mode: \"oneOf\" },\n);\nexport const PluginEntry = Schema.Union([PluginReference, PluginPatch]);\nexport type PluginEntry = typeof PluginEntry.Type;\n\n/**\n * Agent-level retry of a turn whose provider request failed transiently (rate limit, overload,\n * 5xx, dropped connection). Delays double from `baseDelayMs` and stop growing at `maxDelayMs`;\n * a server that asks for a longer wait than `maxDelayMs` is not retried. `maxRetries: 0` is off.\n *\n * Separate from `model.options.maxRetries`, which retries inside the provider SDK and defaults to\n * 0 so that the two do not multiply, and so a quota error reaches the loop instead of being retried.\n */\nexport const Retry = Schema.Struct({\n\tmaxRetries: Schema.optional(NonNegativeInt),\n\tbaseDelayMs: Schema.optional(NonNegativeInt),\n\tmaxDelayMs: Schema.optional(NonNegativeInt),\n});\nexport interface RetryPolicy {\n\treadonly maxRetries: number;\n\treadonly baseDelayMs: number;\n\treadonly maxDelayMs: number;\n}\n\nexport const Patch = Schema.Struct({\n\t$schema: Schema.optional(Schema.String),\n\tplugins: Schema.optional(Schema.Array(PluginEntry)),\n\tmodel: Schema.optional(Model),\n\tmodels: Schema.optional(Schema.Array(ModelEntry)),\n\tretry: Schema.optional(Retry),\n});\nexport type Patch = typeof Patch.Type;\n\n/**\n * One plugin entry, and where it came from.\n *\n * Flattening every layer's `plugins` into one array loses the file that declared each entry, and\n * that cannot be recovered afterwards: two layers may declare the same string, so attribution is\n * genuinely gone rather than merely inconvenient. Three things need it -- anchoring a relative\n * path, naming the declaring layer in `plugin list`, and the missing-plugin diagnostic -- so the\n * loaded shape carries it from the start.\n *\n * In simple terms:\n * `written` - is what module the developer is declaring - what\n * `file` - where the module is being declared - where\n * `entry` - the resolved path of the module, relative to the `file`; especially needed for local.\n *\n * Example:\n * written: \"@acme/x@^1\"\n * entry: \"@acme/x@^1\"\n * file: \"/Users/me/.codework/settings.jsonc\"\n *\n * written: \"./plugins/mine.mjs\"\n * entry: \"/Users/me/.codework/plugins/mine.mjs\"\n * file: \"/Users/me/.codework/settings.jsonc\"\n */\nexport interface Declared {\n\t/** The entry exactly as the file spells it, which is the string a person will search for. */\n\treadonly written: PluginEntry;\n\t/** The same entry with any relative path anchored to the directory of its declaring file. */\n\treadonly entry: PluginEntry;\n\t/** The settings file that declared it. */\n\treadonly file: string;\n}\n\n/** A `models` entry, and the settings file that declared it. */\nexport interface DeclaredModel {\n\treadonly entry: AikitModel.Info;\n\treadonly file: string;\n}\n\nexport interface Info {\n\t/**\n\t * Plugin entries added to the harness selection, in order: every layer's entries, lowest\n\t * priority first, so a project's list extends the user's rather than replacing it.\n\t *\n\t * Anchored, and stripped of provenance: this is the list the loader consumes. {@link Info.declared}\n\t * is the same list with the file each entry came from.\n\t */\n\treadonly plugins: ReadonlyArray<PluginEntry>;\n\t/** {@link Info.plugins}, with the origin of each entry. Same order, same length. */\n\treadonly declared: ReadonlyArray<Declared>;\n\t/**\n\t * Catalog entries from every layer, lowest priority first. Applied over the generated catalog\n\t * in this order, so for one `provider.id` + `id` the last entry wins.\n\t */\n\treadonly models: ReadonlyArray<DeclaredModel>;\n\treadonly model: typeof Model.Type & {\n\t\treadonly provider: string;\n\t\treadonly id: string;\n\t\treadonly thinkingLevel: AikitModel.ThinkingLevel;\n\t\treadonly toolExecution: ToolExecution;\n\t};\n\treadonly retry: RetryPolicy;\n}\n\n/** Let aikit supply model-aware generation defaults. */\nexport const defaults: Info = {\n\tplugins: [],\n\tdeclared: [],\n\tmodels: [],\n\tmodel: {\n\t\tprovider: \"openai\",\n\t\tid: \"gpt-5.6-luna\",\n\t\tthinkingLevel: \"high\",\n\t\ttoolExecution: \"sequential\",\n\t\toptions: { timeoutMs: 3_600_000, maxRetries: 0 },\n\t},\n\tretry: { maxRetries: 3, baseDelayMs: 2_000, maxDelayMs: 60_000 },\n};\n"],"mappings":";;;;AAIA,MAAa,gBAAgB,OAAO,SAAS,OAAO,OAAOA,QAAW,iBAAiB,CAAC;AACxF,MAAa,gBAAgB,OAAO,SAAS,CAAC,cAAc,UAAU,CAAC;AAEvE,MAAM,UAAU,OAAO,OACtB,OAAO,SAAS,OAAO,OAAOA,QAAW,iBAAiB,CAAC,CAAC,QAAQ,UAAU,UAAU,KAAK,CAAC,GAC9F,OAAO,SAAS,OAAO,MA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CACd,SAAS,OAAO,SAAS,OAAO,OAAO;CACvC,SAAS,OAAO,SAAS,OAAO,OAAO,OAAO,QAAQ,OAAO,OAAO,CAAC;AACtE;AACA,MAAa,cAAc,OAAO,MACjC,CAAC,OAAO,OAAO;CAAE,QAAQ;CAAiB,GAAG;AAAO,CAAC,GAAG,OAAO,OAAO;CAAE,SAAS;CAAiB,GAAG;AAAO,CAAC,CAAC,GAG9G,EAAE,MAAM,QAAQ,CACjB;AACA,MAAa,cAAc,OAAO,MAAM,CAAC,iBAAiB,WAAW,CAAC;;;;;;;;;AAWtE,MAAa,QAAQ,OAAO,OAAO;CAClC,YAAY,OAAO,SAAS,cAAc;CAC1C,aAAa,OAAO,SAAS,cAAc;CAC3C,YAAY,OAAO,SAAS,cAAc;AAC3C,CAAC;AAOD,MAAa,QAAQ,OAAO,OAAO;CAClC,SAAS,OAAO,SAAS,OAAO,MAAM;CACtC,SAAS,OAAO,SAAS,OAAO,MAAM,WAAW,CAAC;CAClD,OAAO,OAAO,SAAS,KAAK;CAC5B,QAAQ,OAAO,SAAS,OAAO,MAAM,UAAU,CAAC;CAChD,OAAO,OAAO,SAAS,KAAK;AAC7B,CAAC;;AAmED,MAAa,WAAiB;CAC7B,SAAS,CAAC;CACV,UAAU,CAAC;CACX,QAAQ,CAAC;CACT,OAAO;EACN,UAAU;EACV,IAAI;EACJ,eAAe;EACf,eAAe;EACf,SAAS;GAAE,WAAW;GAAW,YAAY;EAAE;CAChD;CACA,OAAO;EAAE,YAAY;EAAG,aAAa;EAAO,YAAY;CAAO;AAChE"}
@@ -1,10 +0,0 @@
1
- declare namespace prompt_d_exports {
2
- export { PromptRegistry };
3
- }
4
- interface PromptRegistry {
5
- readonly set: (systemPrompt: string) => void;
6
- readonly get: () => string | undefined;
7
- }
8
- //#endregion
9
- export { prompt_d_exports as n, PromptRegistry as t };
10
- //# sourceMappingURL=prompt-BcpagjGh.d.mts.map
@@ -1,207 +0,0 @@
1
- import { Model } from "@codeworksh/aikit";
2
- import { Schema } from "effect";
3
- //#region src/settings.d.ts
4
- declare const ThinkingLevel: Schema.Literals<("high" | "low" | "max" | "medium" | "minimal" | "off" | "xhigh")[]>;
5
- declare const ToolExecution: Schema.Literals<readonly ["sequential", "parallel"]>;
6
- type ToolExecution = typeof ToolExecution.Type;
7
- /** Aikit does not export its request schema; keep this routing surface checked against its public types. */
8
- declare const requestFields: {
9
- temperature: Schema.optional<Schema.Finite>;
10
- maxTokens: Schema.optional<Schema.Finite>;
11
- cacheRetention: Schema.optional<Schema.Literals<readonly ["none", "short", "long"]>>;
12
- headers: Schema.optional<Schema.$Record<Schema.String, Schema.String>>;
13
- timeoutMs: Schema.optional<Schema.Finite>;
14
- maxRetries: Schema.optional<Schema.Finite>;
15
- metadata: Schema.optional<Schema.$Record<Schema.String, Schema.Unknown>>;
16
- thinkingBudgets: Schema.optional<Schema.$Record<Schema.Literals<("high" | "low" | "max" | "medium" | "minimal" | "xhigh")[]>, Schema.optional<Schema.Finite>>>;
17
- baseURL: Schema.optional<Schema.String>;
18
- method: Schema.optional<Schema.Literals<("chat" | "completion" | "completionModel" | "languageModel" | "messages" | "responses")[]>>;
19
- };
20
- /** The wire protocol a model speaks, which a catalog entry may have wrong for a local endpoint. */
21
- declare const ModelProtocol: Schema.Literals<("anthropic" | "github-copilot" | "google" | "google-vertex" | "google-vertex-anthropic" | "openai" | "openai-codex" | "openai-compatible" | "openrouter" | "xai")[]>;
22
- declare const Block: Schema.StructWithRest<Schema.Struct<{
23
- readonly temperature: Schema.optional<Schema.Finite>;
24
- readonly maxTokens: Schema.optional<Schema.Finite>;
25
- readonly cacheRetention: Schema.optional<Schema.Literals<readonly ["none", "short", "long"]>>;
26
- readonly headers: Schema.optional<Schema.$Record<Schema.String, Schema.String>>;
27
- readonly timeoutMs: Schema.optional<Schema.Finite>;
28
- readonly maxRetries: Schema.optional<Schema.Finite>;
29
- readonly metadata: Schema.optional<Schema.$Record<Schema.String, Schema.Unknown>>;
30
- readonly thinkingBudgets: Schema.optional<Schema.$Record<Schema.Literals<("high" | "low" | "max" | "medium" | "minimal" | "xhigh")[]>, Schema.optional<Schema.Finite>>>;
31
- readonly baseURL: Schema.optional<Schema.String>;
32
- readonly method: Schema.optional<Schema.Literals<("chat" | "completion" | "completionModel" | "languageModel" | "messages" | "responses")[]>>;
33
- readonly protocol: Schema.optional<Schema.Literals<("anthropic" | "github-copilot" | "google" | "google-vertex" | "google-vertex-anthropic" | "openai" | "openai-codex" | "openai-compatible" | "openrouter" | "xai")[]>>;
34
- readonly thinkingLevel: Schema.optional<Schema.Literals<("high" | "low" | "max" | "medium" | "minimal" | "off" | "xhigh")[]>>;
35
- readonly toolExecution: Schema.optional<Schema.Literals<readonly ["sequential", "parallel"]>>;
36
- readonly contextWindow: Schema.optional<Schema.Finite>;
37
- readonly extras: Schema.optional<Schema.$Record<Schema.String, Schema.Unknown>>;
38
- }>, readonly [Schema.$Record<Schema.String, Schema.Unknown>]>;
39
- type Block = typeof Block.Type;
40
- declare const Model$1: Schema.Struct<{
41
- readonly provider: Schema.optional<Schema.String>;
42
- readonly id: Schema.optional<Schema.String>;
43
- readonly thinkingLevel: Schema.optional<Schema.Literals<("high" | "low" | "max" | "medium" | "minimal" | "off" | "xhigh")[]>>;
44
- readonly toolExecution: Schema.optional<Schema.Literals<readonly ["sequential", "parallel"]>>;
45
- readonly thinkingBudgets: Schema.optional<Schema.$Record<Schema.Literals<("high" | "low" | "max" | "medium" | "minimal" | "xhigh")[]>, Schema.optional<Schema.Finite>>>;
46
- readonly options: Schema.optional<Schema.StructWithRest<Schema.Struct<{
47
- readonly temperature: Schema.optional<Schema.Finite>;
48
- readonly maxTokens: Schema.optional<Schema.Finite>;
49
- readonly cacheRetention: Schema.optional<Schema.Literals<readonly ["none", "short", "long"]>>;
50
- readonly headers: Schema.optional<Schema.$Record<Schema.String, Schema.String>>;
51
- readonly timeoutMs: Schema.optional<Schema.Finite>;
52
- readonly maxRetries: Schema.optional<Schema.Finite>;
53
- readonly metadata: Schema.optional<Schema.$Record<Schema.String, Schema.Unknown>>;
54
- readonly thinkingBudgets: Schema.optional<Schema.$Record<Schema.Literals<("high" | "low" | "max" | "medium" | "minimal" | "xhigh")[]>, Schema.optional<Schema.Finite>>>;
55
- readonly baseURL: Schema.optional<Schema.String>;
56
- readonly method: Schema.optional<Schema.Literals<("chat" | "completion" | "completionModel" | "languageModel" | "messages" | "responses")[]>>;
57
- readonly protocol: Schema.optional<Schema.Literals<("anthropic" | "github-copilot" | "google" | "google-vertex" | "google-vertex-anthropic" | "openai" | "openai-codex" | "openai-compatible" | "openrouter" | "xai")[]>>;
58
- readonly thinkingLevel: Schema.optional<Schema.Literals<("high" | "low" | "max" | "medium" | "minimal" | "off" | "xhigh")[]>>;
59
- readonly toolExecution: Schema.optional<Schema.Literals<readonly ["sequential", "parallel"]>>;
60
- readonly contextWindow: Schema.optional<Schema.Finite>;
61
- readonly extras: Schema.optional<Schema.$Record<Schema.String, Schema.Unknown>>;
62
- }>, readonly [Schema.$Record<Schema.String, Schema.Unknown>]>>;
63
- readonly providerOptions: Schema.optional<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.StructWithRest<Schema.Struct<{
64
- readonly temperature: Schema.optional<Schema.Finite>;
65
- readonly maxTokens: Schema.optional<Schema.Finite>;
66
- readonly cacheRetention: Schema.optional<Schema.Literals<readonly ["none", "short", "long"]>>;
67
- readonly headers: Schema.optional<Schema.$Record<Schema.String, Schema.String>>;
68
- readonly timeoutMs: Schema.optional<Schema.Finite>;
69
- readonly maxRetries: Schema.optional<Schema.Finite>;
70
- readonly metadata: Schema.optional<Schema.$Record<Schema.String, Schema.Unknown>>;
71
- readonly thinkingBudgets: Schema.optional<Schema.$Record<Schema.Literals<("high" | "low" | "max" | "medium" | "minimal" | "xhigh")[]>, Schema.optional<Schema.Finite>>>;
72
- readonly baseURL: Schema.optional<Schema.String>;
73
- readonly method: Schema.optional<Schema.Literals<("chat" | "completion" | "completionModel" | "languageModel" | "messages" | "responses")[]>>;
74
- readonly protocol: Schema.optional<Schema.Literals<("anthropic" | "github-copilot" | "google" | "google-vertex" | "google-vertex-anthropic" | "openai" | "openai-codex" | "openai-compatible" | "openrouter" | "xai")[]>>;
75
- readonly thinkingLevel: Schema.optional<Schema.Literals<("high" | "low" | "max" | "medium" | "minimal" | "off" | "xhigh")[]>>;
76
- readonly toolExecution: Schema.optional<Schema.Literals<readonly ["sequential", "parallel"]>>;
77
- readonly contextWindow: Schema.optional<Schema.Finite>;
78
- readonly extras: Schema.optional<Schema.$Record<Schema.String, Schema.Unknown>>;
79
- }>, readonly [Schema.$Record<Schema.String, Schema.Unknown>]>>>>;
80
- }>;
81
- declare const PluginPatch: Schema.Union<readonly [Schema.Struct<{
82
- readonly enabled: Schema.optional<Schema.Boolean>;
83
- readonly options: Schema.optional<Schema.$Record<Schema.String, Schema.Unknown>>;
84
- readonly plugin: Schema.String;
85
- }>, Schema.Struct<{
86
- readonly enabled: Schema.optional<Schema.Boolean>;
87
- readonly options: Schema.optional<Schema.$Record<Schema.String, Schema.Unknown>>;
88
- readonly package: Schema.String;
89
- }>]>;
90
- declare const PluginEntry: Schema.Union<readonly [Schema.String, Schema.Union<readonly [Schema.Struct<{
91
- readonly enabled: Schema.optional<Schema.Boolean>;
92
- readonly options: Schema.optional<Schema.$Record<Schema.String, Schema.Unknown>>;
93
- readonly plugin: Schema.String;
94
- }>, Schema.Struct<{
95
- readonly enabled: Schema.optional<Schema.Boolean>;
96
- readonly options: Schema.optional<Schema.$Record<Schema.String, Schema.Unknown>>;
97
- readonly package: Schema.String;
98
- }>]>]>;
99
- type PluginEntry = typeof PluginEntry.Type;
100
- declare const Patch: Schema.Struct<{
101
- readonly $schema: Schema.optional<Schema.String>;
102
- readonly plugins: Schema.optional<Schema.$Array<Schema.Union<readonly [Schema.String, Schema.Union<readonly [Schema.Struct<{
103
- readonly enabled: Schema.optional<Schema.Boolean>;
104
- readonly options: Schema.optional<Schema.$Record<Schema.String, Schema.Unknown>>;
105
- readonly plugin: Schema.String;
106
- }>, Schema.Struct<{
107
- readonly enabled: Schema.optional<Schema.Boolean>;
108
- readonly options: Schema.optional<Schema.$Record<Schema.String, Schema.Unknown>>;
109
- readonly package: Schema.String;
110
- }>]>]>>>;
111
- readonly model: Schema.optional<Schema.Struct<{
112
- readonly provider: Schema.optional<Schema.String>;
113
- readonly id: Schema.optional<Schema.String>;
114
- readonly thinkingLevel: Schema.optional<Schema.Literals<("high" | "low" | "max" | "medium" | "minimal" | "off" | "xhigh")[]>>;
115
- readonly toolExecution: Schema.optional<Schema.Literals<readonly ["sequential", "parallel"]>>;
116
- readonly thinkingBudgets: Schema.optional<Schema.$Record<Schema.Literals<("high" | "low" | "max" | "medium" | "minimal" | "xhigh")[]>, Schema.optional<Schema.Finite>>>;
117
- readonly options: Schema.optional<Schema.StructWithRest<Schema.Struct<{
118
- readonly temperature: Schema.optional<Schema.Finite>;
119
- readonly maxTokens: Schema.optional<Schema.Finite>;
120
- readonly cacheRetention: Schema.optional<Schema.Literals<readonly ["none", "short", "long"]>>;
121
- readonly headers: Schema.optional<Schema.$Record<Schema.String, Schema.String>>;
122
- readonly timeoutMs: Schema.optional<Schema.Finite>;
123
- readonly maxRetries: Schema.optional<Schema.Finite>;
124
- readonly metadata: Schema.optional<Schema.$Record<Schema.String, Schema.Unknown>>;
125
- readonly thinkingBudgets: Schema.optional<Schema.$Record<Schema.Literals<("high" | "low" | "max" | "medium" | "minimal" | "xhigh")[]>, Schema.optional<Schema.Finite>>>;
126
- readonly baseURL: Schema.optional<Schema.String>;
127
- readonly method: Schema.optional<Schema.Literals<("chat" | "completion" | "completionModel" | "languageModel" | "messages" | "responses")[]>>;
128
- readonly protocol: Schema.optional<Schema.Literals<("anthropic" | "github-copilot" | "google" | "google-vertex" | "google-vertex-anthropic" | "openai" | "openai-codex" | "openai-compatible" | "openrouter" | "xai")[]>>;
129
- readonly thinkingLevel: Schema.optional<Schema.Literals<("high" | "low" | "max" | "medium" | "minimal" | "off" | "xhigh")[]>>;
130
- readonly toolExecution: Schema.optional<Schema.Literals<readonly ["sequential", "parallel"]>>;
131
- readonly contextWindow: Schema.optional<Schema.Finite>;
132
- readonly extras: Schema.optional<Schema.$Record<Schema.String, Schema.Unknown>>;
133
- }>, readonly [Schema.$Record<Schema.String, Schema.Unknown>]>>;
134
- readonly providerOptions: Schema.optional<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.StructWithRest<Schema.Struct<{
135
- readonly temperature: Schema.optional<Schema.Finite>;
136
- readonly maxTokens: Schema.optional<Schema.Finite>;
137
- readonly cacheRetention: Schema.optional<Schema.Literals<readonly ["none", "short", "long"]>>;
138
- readonly headers: Schema.optional<Schema.$Record<Schema.String, Schema.String>>;
139
- readonly timeoutMs: Schema.optional<Schema.Finite>;
140
- readonly maxRetries: Schema.optional<Schema.Finite>;
141
- readonly metadata: Schema.optional<Schema.$Record<Schema.String, Schema.Unknown>>;
142
- readonly thinkingBudgets: Schema.optional<Schema.$Record<Schema.Literals<("high" | "low" | "max" | "medium" | "minimal" | "xhigh")[]>, Schema.optional<Schema.Finite>>>;
143
- readonly baseURL: Schema.optional<Schema.String>;
144
- readonly method: Schema.optional<Schema.Literals<("chat" | "completion" | "completionModel" | "languageModel" | "messages" | "responses")[]>>;
145
- readonly protocol: Schema.optional<Schema.Literals<("anthropic" | "github-copilot" | "google" | "google-vertex" | "google-vertex-anthropic" | "openai" | "openai-codex" | "openai-compatible" | "openrouter" | "xai")[]>>;
146
- readonly thinkingLevel: Schema.optional<Schema.Literals<("high" | "low" | "max" | "medium" | "minimal" | "off" | "xhigh")[]>>;
147
- readonly toolExecution: Schema.optional<Schema.Literals<readonly ["sequential", "parallel"]>>;
148
- readonly contextWindow: Schema.optional<Schema.Finite>;
149
- readonly extras: Schema.optional<Schema.$Record<Schema.String, Schema.Unknown>>;
150
- }>, readonly [Schema.$Record<Schema.String, Schema.Unknown>]>>>>;
151
- }>>;
152
- }>;
153
- type Patch = typeof Patch.Type;
154
- /**
155
- * One plugin entry, and where it came from.
156
- *
157
- * Flattening every layer's `plugins` into one array loses the file that declared each entry, and
158
- * that cannot be recovered afterwards: two layers may declare the same string, so attribution is
159
- * genuinely gone rather than merely inconvenient. Three things need it -- anchoring a relative
160
- * path, naming the declaring layer in `plugin list`, and the missing-plugin diagnostic -- so the
161
- * loaded shape carries it from the start.
162
- *
163
- * In simple terms:
164
- * `written` - is what module the developer is declaring - what
165
- * `file` - where the module is being declared - where
166
- * `entry` - the resolved path of the module, relative to the `file`; especially needed for local.
167
- *
168
- * Example:
169
- * written: "@acme/x@^1"
170
- * entry: "@acme/x@^1"
171
- * file: "/Users/me/.codework/settings.jsonc"
172
- *
173
- * written: "./plugins/mine.mjs"
174
- * entry: "/Users/me/.codework/plugins/mine.mjs"
175
- * file: "/Users/me/.codework/settings.jsonc"
176
- */
177
- interface Declared {
178
- /** The entry exactly as the file spells it, which is the string a person will search for. */
179
- readonly written: PluginEntry;
180
- /** The same entry with any relative path anchored to the directory of its declaring file. */
181
- readonly entry: PluginEntry;
182
- /** The settings file that declared it. */
183
- readonly file: string;
184
- }
185
- interface Info {
186
- /**
187
- * Plugin entries added to the harness selection, in order: every layer's entries, lowest
188
- * priority first, so a project's list extends the user's rather than replacing it.
189
- *
190
- * Anchored, and stripped of provenance: this is the list the loader consumes. {@link Info.declared}
191
- * is the same list with the file each entry came from.
192
- */
193
- readonly plugins: ReadonlyArray<PluginEntry>;
194
- /** {@link Info.plugins}, with the origin of each entry. Same order, same length. */
195
- readonly declared: ReadonlyArray<Declared>;
196
- readonly model: typeof Model$1.Type & {
197
- readonly provider: string;
198
- readonly id: string;
199
- readonly thinkingLevel: Model.ThinkingLevel;
200
- readonly toolExecution: ToolExecution;
201
- };
202
- }
203
- /** Let aikit supply model-aware generation defaults. */
204
- declare const defaults: Info;
205
- //#endregion
206
- export { ModelProtocol as a, PluginPatch as c, defaults as d, requestFields as f, Model$1 as i, ThinkingLevel as l, Declared as n, Patch as o, Info as r, PluginEntry as s, Block as t, ToolExecution as u };
207
- //# sourceMappingURL=settings-bbJi7FiQ.d.mts.map