@jskit-ai/connectors-catalog 0.2.66 → 0.2.68

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/CHANGELOG.md CHANGED
@@ -2,6 +2,7 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ - An AI integration may declare `settings.effort`, the reasoning effort its calls ask for: `none`, `minimal`, `low`, `medium`, `high` or `xhigh`, validated with the integration; `createAiConnectionResolver` returns it as the connection's `effort`. It has no editor field and is kept when the model changes. Some OpenAI-compatible hosts reason only when asked.
5
6
  - The Wave, Mapbox, Logo.dev and Inngest instructions, the Firebase and GA4 field hints and the event delivery pattern name the staging or production server, or the application's pages, where they said the deployed application.
6
7
  - The patterns and docs give `createConnectionService` `appEnv: appEnvironment(env)` in place of `sideEffects`; a marked operation is logged outside production (`APP_ENV`).
7
8
  - Operations that act on the world are marked `sideEffect`, so a test copy (`SIDE_EFFECTS` is not `live`) simulates them: Brevo email, SMS, campaign sends and events; Calendly cancellations and invitees; Chargebee subscription changes; Firebase Cloud Messaging; GatewayAPI; Gmail sends; Google Ads campaign status; incident.io incidents; Inngest events; LinkedIn posts; Mailgun; Outlook mail and events; Teams messages; Resend emails and broadcasts; Slack messages; Telegram; Twilio messages and calls; Twitch chat; Wave invoice and estimate sends; Wix Bookings changes; WooCommerce refunds. The api-key and Firebase messaging patterns pass `sideEffects: resolveSideEffectsMode(env)`.
package/docs/ai.md CHANGED
@@ -118,6 +118,15 @@ An administrator-funded Z.AI model:
118
118
  }
119
119
  ```
120
120
 
121
+ An integration may also declare `settings.effort`, the reasoning effort its
122
+ calls ask for: one of `none`, `minimal`, `low`, `medium`, `high` or `xhigh`, the
123
+ AI SDK's standard reasoning levels; any other value fails validation. Leave it
124
+ out for the engine's default. Set it where a model or its host needs one: some
125
+ OpenAI-compatible hosts reason only when asked, so a reasoning model there
126
+ answers without reasoning unless an effort is sent. It has no editor field; set
127
+ it in `integrations.json`, for example
128
+ `"settings": { "model": "deepseek/deepseek-v4-flash", "effort": "high" }`.
129
+
121
130
  Store the key's **value** in the
122
131
  existing Env screen or the application's normal private environment. The host's
123
132
  existing launch/deployment environment mechanism supplies it to the backend;
@@ -128,8 +137,8 @@ the variable's name.
128
137
  `createAiConnectionResolver({ configuration, authorize, resolveReference? })`
129
138
  is imported from `@jskit-ai/connectors-catalog/server/ai`. It uses the existing
130
139
  environment-reference resolver by default. `resolve({ context, integrationId })`
131
- returns `{ providerId, model, sdkPackage, baseURL?, apiKey, access }` **to backend
132
- code only**. An absent `baseURL` means use the named provider SDK's normal
140
+ returns `{ providerId, model, sdkPackage, modelLimits, baseURL?, apiKey, access, effort? }` **to backend
141
+ code only**, with `effort` when the integration declares one. An absent `baseURL` means use the named provider SDK's normal
133
142
  endpoint. Pass the result to an explicitly installed SDK adapter; never
134
143
  dynamically install a package or send the result through a browser route.
135
144
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jskit-ai/connectors-catalog",
3
- "version": "0.2.66",
3
+ "version": "0.2.68",
4
4
  "description": "Provider definitions and focused API operations for JSKIT connectors.",
5
5
  "type": "module",
6
6
  "exports": {
@@ -125,14 +125,14 @@
125
125
  "@aws-sdk/client-redshift-data": "3.1128.0",
126
126
  "@aws-sdk/client-s3": "3.1128.0",
127
127
  "@aws-sdk/s3-request-presigner": "3.1128.0",
128
- "@jskit-ai/connectors-core": "0.2.63",
128
+ "@jskit-ai/connectors-core": "0.2.64",
129
129
  "@modelcontextprotocol/sdk": "1.32.1",
130
130
  "@smithy/fetch-http-handler": "5.8.0",
131
131
  "jose": "^6.1.3",
132
132
  "json-rest-schema": "^1.0.20"
133
133
  },
134
134
  "peerDependencies": {
135
- "@jskit-ai/kernel": "0.2.37"
135
+ "@jskit-ai/kernel": "0.2.38"
136
136
  },
137
137
  "jskit": {
138
138
  "kind": "runtime",
package/src/server/ai.js CHANGED
@@ -52,7 +52,8 @@ function createAiConnectionResolver({ configuration, authorize, resolveReference
52
52
  modelLimits: Object.freeze({ ...model.limit }),
53
53
  ...(provider.baseURL ? { baseURL: provider.baseURL } : {}),
54
54
  apiKey,
55
- access: model.access
55
+ access: model.access,
56
+ ...(integration.settings.effort ? { effort: integration.settings.effort } : {})
56
57
  });
57
58
  }
58
59
  return Object.freeze({ resolve });
@@ -34,6 +34,9 @@ const activeModels = [...configurableModels.values()].filter((model) => model.st
34
34
  const modelItems = Object.freeze(activeModels.map((model) => Object.freeze({
35
35
  value: model.key, title: `${model.name} (${model.providerId})`, props: { subtitle: aiAccessLabels[model.access] }
36
36
  })));
37
+ // The reasoning efforts an AI integration may declare: the AI SDK's standard reasoning levels, which
38
+ // each provider sends in its own format.
39
+ const aiReasoningEfforts = Object.freeze(["none", "minimal", "low", "medium", "high", "xhigh"]);
37
40
  const aiDefinition = Object.freeze({
38
41
  id: "ai", name: "AI", description: "jskit.connectors.ai.description",
39
42
  accountModes: ["shared", "per-user"], authenticationMethods: ["api-key", "none"], scopes: [],
@@ -41,8 +44,10 @@ const aiDefinition = Object.freeze({
41
44
  ? ["none", "api-key"] : ["api-key"],
42
45
  authenticationLabels: { none: "jskit.connectors.ai.authenticationLabels.none", "api-key": "jskit.connectors.ai.authenticationLabels.apiKey" },
43
46
  authenticationHint: "jskit.connectors.ai.authenticationHint",
47
+ // `effort` is optional: the reasoning effort the connection's calls ask for, where the engine's
48
+ // default is not what the model or its host needs.
44
49
  settingsSchema: createSchema({ model: { type: "string", required: true,
45
- enum: modelItems.map((item) => item.value) } }),
50
+ enum: modelItems.map((item) => item.value) }, effort: { type: "string", enum: aiReasoningEfforts } }),
46
51
  settingsFields: [{ name: "model", label: "jskit.connectors.ai.fields.model.label", searchable: true, items: modelItems,
47
52
  credentialScope: (key) => configurableModels.get(key)?.providerId,
48
53
  // The catalogue date is display text: formatDate (useJskitText's) uses the app's active
package/test/ai.test.js CHANGED
@@ -110,6 +110,22 @@ test("AI refuses missing models, deprecated models, coding subscriptions and uns
110
110
  }
111
111
  });
112
112
 
113
+ test("AI keeps the reasoning effort an integration declares, refuses one outside the levels, and resolves it with the connection", async () => {
114
+ const model = "deepseek/deepseek-v4-flash";
115
+ const authentication = { method: "api-key", secretRef: "env:KEY" };
116
+ const saved = validate(configuration({ settings: { model, effort: "high" }, authentication }));
117
+ assert.deepEqual(saved.integrations.suggestions.settings, { model, effort: "high" });
118
+ const resolve = settings => createAiConnectionResolver({ configuration: configuration({ settings, authentication }), authorize,
119
+ resolveReference: () => "test-key" }).resolve(request);
120
+ assert.equal((await resolve({ model, effort: "high" })).effort, "high");
121
+ assert.equal(Object.hasOwn(await resolve({ model }), "effort"), false, "Without one the engine's default applies");
122
+ for (const effort of ["extreme", "max", ""]) {
123
+ assert.throws(() => validate(configuration({ settings: { model, effort }, authentication })), (error) => {
124
+ assert.ok(error.fieldErrors["integrations.suggestions.settings.effort"], JSON.stringify(error.fieldErrors)); return true;
125
+ });
126
+ }
127
+ });
128
+
113
129
  test("AI resolves explicit no-account SDK parameters without environment, network or an OpenCode runtime", async (t) => {
114
130
  t.mock.method(globalThis, "fetch", () => { throw new Error("Network is forbidden in this resolver."); });
115
131
  const resolver = createAiConnectionResolver({ configuration: configuration({ settings: { model: "opencode/mimo-v2.5-free" } }), authorize,