@coffer-org/plugin-telegram 3.0.0 → 3.0.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/dist/schema.js CHANGED
@@ -4946,7 +4946,8 @@ function source(raw) {
4946
4946
  hints: {
4947
4947
  ext,
4948
4948
  maxBytes,
4949
- noEditControl: true
4949
+ noEditControl: true,
4950
+ ...o.key ? { fileName: o.key } : {}
4950
4951
  },
4951
4952
  zod: optionalize(s, required)
4952
4953
  });
@@ -6421,10 +6422,27 @@ function select(raw) {
6421
6422
  zod: optionalize(s, required)
6422
6423
  }, o.multiple ?? false));
6423
6424
  }
6425
+ /**
6426
+ * Reject anything beyond a flat equality map: an operator key (`$in`, `$and`, …), an
6427
+ * object-valued entry (which is how a nested operator like `{ type: { $in: [...] } }`
6428
+ * would smuggle itself in), or an explicit `undefined` value all throw, naming the
6429
+ * offending key. `undefined` is rejected alongside objects because it would otherwise
6430
+ * slip through every later layer unnoticed: `Condition` types it as a valid value,
6431
+ * `conditionKeys` skips it so compose validates nothing against the target shelf, and
6432
+ * the picker's query-string builder turns it into the literal string `'undefined'`
6433
+ * (an empty picker with no error anywhere).
6434
+ */
6435
+ function assertFlatEqualityFilter(filter) {
6436
+ for (const [key, value] of Object.entries(filter)) {
6437
+ if (key.startsWith("$")) throw new Error(`[relation] filter key '${key}' is an operator — only flat equality is allowed here`);
6438
+ if (value === void 0 || value !== null && typeof value === "object") throw new Error(`[relation] filter key '${key}' has a non-scalar value — only flat equality is allowed here`);
6439
+ }
6440
+ }
6424
6441
  function relation(raw) {
6425
6442
  const o = normalizeOpts(raw);
6426
6443
  const required = o.required ?? false;
6427
6444
  const multi = o.multiple ?? false;
6445
+ if (raw.options.filter) assertFlatEqualityFilter(raw.options.filter);
6428
6446
  let s;
6429
6447
  if (multi) s = unknown().superRefine((raw, ctx) => {
6430
6448
  const arr = jsonValue(raw);
@@ -6446,7 +6464,8 @@ function relation(raw) {
6446
6464
  },
6447
6465
  relation: {
6448
6466
  library: raw.options.library,
6449
- shelf: raw.options.shelf
6467
+ shelf: raw.options.shelf,
6468
+ ...raw.options.filter && { filter: raw.options.filter }
6450
6469
  },
6451
6470
  ...multi && { json: true },
6452
6471
  zod: optionalize(s, required)
@@ -0,0 +1,23 @@
1
+ {
2
+ "telegram": {
3
+ "plugin": {
4
+ "label": "Telegram bot",
5
+ "description": "Connects Telegram to the orchestrator via GramJS."
6
+ },
7
+ "settings": {
8
+ "label": "Bot settings",
9
+ "api_id": "API ID",
10
+ "api_hash": "API Hash",
11
+ "bot_token": "Bot token",
12
+ "phone": "Phone number",
13
+ "reasoning_display": "Reasoning display",
14
+ "reasoning_display_off": "Hidden",
15
+ "reasoning_display_collapsible": "Collapsible block",
16
+ "reasoning_display_separate": "Separate messages"
17
+ },
18
+ "model": {
19
+ "prompt": "Choose a model:",
20
+ "confirm": "Done"
21
+ }
22
+ }
23
+ }
@@ -0,0 +1,23 @@
1
+ {
2
+ "telegram": {
3
+ "plugin": {
4
+ "label": "Telegram-бот",
5
+ "description": "Подключает Telegram к оркестратору через GramJS."
6
+ },
7
+ "settings": {
8
+ "label": "Настройки бота",
9
+ "api_id": "API ID",
10
+ "api_hash": "API Hash",
11
+ "bot_token": "Токен бота",
12
+ "phone": "Номер телефона",
13
+ "reasoning_display": "Показ рассуждений",
14
+ "reasoning_display_off": "Не показывать",
15
+ "reasoning_display_collapsible": "Свёрнутым блоком",
16
+ "reasoning_display_separate": "Отдельными сообщениями"
17
+ },
18
+ "model": {
19
+ "prompt": "Выберите модель:",
20
+ "confirm": "Готово"
21
+ }
22
+ }
23
+ }
@@ -0,0 +1,23 @@
1
+ {
2
+ "telegram": {
3
+ "plugin": {
4
+ "label": "Telegram-бот",
5
+ "description": "Підключає Telegram до оркестратора через GramJS."
6
+ },
7
+ "settings": {
8
+ "label": "Налаштування бота",
9
+ "api_id": "API ID",
10
+ "api_hash": "API Hash",
11
+ "bot_token": "Токен бота",
12
+ "phone": "Номер телефону",
13
+ "reasoning_display": "Показ міркувань",
14
+ "reasoning_display_off": "Не показувати",
15
+ "reasoning_display_collapsible": "Згорнутим блоком",
16
+ "reasoning_display_separate": "Окремими повідомленнями"
17
+ },
18
+ "model": {
19
+ "prompt": "Оберіть модель:",
20
+ "confirm": "Готово"
21
+ }
22
+ }
23
+ }
package/package.json CHANGED
@@ -1,12 +1,13 @@
1
1
  {
2
2
  "name": "@coffer-org/plugin-telegram",
3
- "version": "3.0.0",
3
+ "version": "3.0.1",
4
4
  "type": "module",
5
5
  "engines": {
6
6
  "node": ">=24"
7
7
  },
8
8
  "files": [
9
- "dist"
9
+ "dist",
10
+ "locales"
10
11
  ],
11
12
  "exports": {
12
13
  ".": {
@@ -25,7 +26,7 @@
25
26
  "test": "node --import tsx --test \"src/runtime/*.test.ts\""
26
27
  },
27
28
  "dependencies": {
28
- "@coffer-org/plugin-orchestrator": "^3.0.0",
29
+ "@coffer-org/plugin-orchestrator": "^3.1.1",
29
30
  "@coffer-org/sdk": "^3.0.0",
30
31
  "@coffer-org/server": "^3.0.0",
31
32
  "input": "^1.0.1",