@matatbread/matbot-plugin-api 0.4.0 → 0.4.1

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/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "node",
5
5
  "browser"
6
6
  ],
7
- "version": "0.4.0",
7
+ "version": "0.4.1",
8
8
  "engines": {
9
9
  "node": ">=24.0.0"
10
10
  },
@@ -185,7 +185,8 @@ export function singleTurnRequest(req: SingleTurnRequest): CompletionRequest {
185
185
  id: '', traceId: '', createdAt: new Date().toISOString(), role: 'user',
186
186
  content: [{ type: 'text', text: req.prompt }],
187
187
  }],
188
- ...(req.system !== undefined ? { system: req.system } : {}),
189
- ...(req.signal !== undefined ? { signal: req.signal } : {}),
188
+ ...(req.system !== undefined ? { system: req.system } : {}),
189
+ ...(req.parameters !== undefined ? { parameters: req.parameters } : {}),
190
+ ...(req.signal !== undefined ? { signal: req.signal } : {}),
190
191
  };
191
192
  }
package/src/plugin.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import type {
2
- FileStore, Principal, Vault, Message,
2
+ FileStore, Principal, Vault, Message, ModelParameters,
3
3
  ProviderAdapter, ProviderConfig, ProviderRegistry, Tool, ToolRegistry, FrontendInfo,
4
4
  Store, Session, SystemContextRegistry, KnowledgeIndex, PromptFn, SessionRunner, Usage, HookRegistrar,
5
5
  TypeScriptStripper, ToolTypeIndex, ToolPresenter, SteeringPolicy,
@@ -28,6 +28,21 @@ export interface CompletionRequest {
28
28
  provider: string;
29
29
  messages: Message[];
30
30
  system?: string;
31
+ /**
32
+ * Per-call parameter overrides, shallow-merged over the named provider's own `parameters` (request
33
+ * wins). For *transient* model behaviour — a lower `temperature` to classify, `thinking` off for a
34
+ * cheap sub-call, a tighter `maxTokens` on a call whose output is parsed rather than shown.
35
+ *
36
+ * The alternative is a near-duplicate provider profile per behaviour, identical to its sibling but
37
+ * for one field, which pushes a caller's transient concern into global, user-editable config and
38
+ * multiplies the profiles a user has to understand. So: **durable properties of a model belong in
39
+ * the provider profile; a single call's behaviour belongs here.** If the same override appears at
40
+ * every call site of a provider, that is the signal it was a profile all along.
41
+ *
42
+ * Honoured by both hosts (CLI + web-bundle), which resolve the merge before handing the config to
43
+ * the adapter; an unrecognised key is the adapter's business, exactly as in a profile.
44
+ */
45
+ parameters?: Partial<ModelParameters>;
31
46
  signal?: AbortSignal;
32
47
  }
33
48
 
@@ -40,6 +55,8 @@ export interface SingleTurnRequest {
40
55
  provider: string;
41
56
  prompt: string;
42
57
  system?: string;
58
+ /** Forwarded verbatim to {@link CompletionRequest.parameters} — same merge, same guidance. */
59
+ parameters?: Partial<ModelParameters>;
43
60
  signal?: AbortSignal;
44
61
  }
45
62