@frockbot/configuration-core 0.3.5 → 0.3.7

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@frockbot/configuration-core",
3
- "version": "0.3.5",
3
+ "version": "0.3.7",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "exports": {
@@ -12,8 +12,8 @@
12
12
  "typecheck": "tsc --noEmit -p tsconfig.json"
13
13
  },
14
14
  "dependencies": {
15
- "@frockbot/connection-core": "0.3.5",
16
- "@frockbot/kernel-composition": "0.3.5"
15
+ "@frockbot/connection-core": "0.3.7",
16
+ "@frockbot/kernel-composition": "0.3.7"
17
17
  },
18
18
  "devDependencies": {
19
19
  "@types/bun": "1.3.6",
package/src/index.test.ts CHANGED
@@ -1174,12 +1174,12 @@ describe("Bot execution-plan authority", () => {
1174
1174
  };
1175
1175
  expect(
1176
1176
  modelBindingFailureV1({ model, user, packages: modelPackages }),
1177
- ).toContain('Package "provider-ollama-cloud" is not installed and enabled');
1177
+ ).toContain("Turn this model's plugin back on in Plugins to use it.");
1178
1178
  expect(
1179
1179
  resolveBotModelBindingV1({ model, user, packages: modelPackages }),
1180
1180
  ).toMatchObject({
1181
1181
  state: "unavailable",
1182
- failure: expect.stringContaining("enable it"),
1182
+ failure: expect.stringContaining("Turn this model's plugin back on"),
1183
1183
  });
1184
1184
 
1185
1185
  const revoked = {
@@ -1197,7 +1197,7 @@ describe("Bot execution-plan authority", () => {
1197
1197
  }),
1198
1198
  ).toMatchObject({
1199
1199
  state: "unavailable",
1200
- failure: expect.stringContaining("reconnect it"),
1200
+ failure: expect.stringContaining("needs reconnecting"),
1201
1201
  });
1202
1202
  }
1203
1203
  });
@@ -1650,7 +1650,9 @@ describe("effective Bot model resolution", () => {
1650
1650
  expect(effective.source).toBe("bot");
1651
1651
  expect(effective.binding).toMatchObject({
1652
1652
  state: "unavailable",
1653
- failure: expect.stringContaining('"custom-models" and "other-models"'),
1653
+ failure: expect.stringContaining(
1654
+ "Two plugins are both set as your model",
1655
+ ),
1654
1656
  });
1655
1657
  expect(effective.model).toBeUndefined();
1656
1658
  });
package/src/index.ts CHANGED
@@ -514,16 +514,16 @@ export function modelBindingFailureV1(input: {
514
514
  (candidate) => candidate.connectionId === input.model.connectionId,
515
515
  );
516
516
  if (!connection) {
517
- return `Connection "${input.model.connectionId}" is unavailable; reconnect it or choose another model`;
517
+ return "That account is no longer connected. Reconnect it, or pick another model.";
518
518
  }
519
519
  if (connection.state !== "ready") {
520
- return `Connection "${input.model.connectionId}" is ${connection.state}; enable or reconnect it`;
520
+ return "That account needs reconnecting before this Bot can reply.";
521
521
  }
522
522
  const installation = input.user.packages.find(
523
523
  (candidate) => candidate.packageId === connection.packageId,
524
524
  );
525
525
  if (!installation || installation.state !== "installed") {
526
- return `Package "${connection.packageId}" is not installed and enabled; enable it to use Connection "${connection.connectionId}"`;
526
+ return "Turn this model's plugin back on in Plugins to use it.";
527
527
  }
528
528
  const pkg = input.packages.find(
529
529
  (candidate) =>
@@ -531,7 +531,7 @@ export function modelBindingFailureV1(input: {
531
531
  candidate.version === installation.version,
532
532
  );
533
533
  if (!pkg) {
534
- return `Installed Package "${connection.packageId}" version "${installation.version}" is unavailable`;
534
+ return "This model's plugin is unavailable. Pick another model.";
535
535
  }
536
536
  const connectionType = pkg.connectionTypes.find(
537
537
  (candidate) => candidate.id === connection.connectionTypeId,
@@ -543,7 +543,7 @@ export function modelBindingFailureV1(input: {
543
543
  connectionType?.capabilities.includes(candidate.id),
544
544
  );
545
545
  if (!connectionType || !modelCapability) {
546
- return `Connection "${connection.connectionId}" does not provide a model Capability accepted by Package "${pkg.packageId}"`;
546
+ return "That account can't provide this model. Pick another one in Models.";
547
547
  }
548
548
  return undefined;
549
549
  }
@@ -581,9 +581,7 @@ export function resolveBotModelBindingV1(input: {
581
581
  candidate.version === installation.version,
582
582
  )!;
583
583
  if (!connection.providerType) {
584
- return unavailable(
585
- `Connection "${connection.connectionId}" provider type is unavailable`,
586
- );
584
+ return unavailable("That account isn't set up for models yet.");
587
585
  }
588
586
  const knownModel = connection.modelCatalog?.models.some(
589
587
  (candidate: { providerModelId: string }) =>
@@ -664,7 +662,8 @@ export function resolveEffectiveBotModelV1(input: {
664
662
  if (declarations.length > 1) {
665
663
  const names = declarations.map(({ pkg }) => `"${pkg.packageId}"`);
666
664
  return {
667
- conflict: `Enabled Packages ${names.join(" and ")} both declare the model role at ${scope === "user" ? "User" : "Bot"} scope; disable one Package`,
665
+ conflict:
666
+ "Two plugins are both set as your model. Turn one off in Plugins.",
668
667
  };
669
668
  }
670
669
  const declaration = declarations[0];