subscription-gateway 0.1.1 → 0.1.3

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/gateway.mjs CHANGED
@@ -19,7 +19,7 @@
19
19
  * тонкости, которых нет в документации, и переживёт их смену.
20
20
  *
21
21
  * 🔴 НЕЗАВИСИМОСТЬ ОТ ГЛАВНОЙ МАШИНЫ. SDK стоит ЗДЕСЬ, токен ЗДЕСЬ, выход в
22
- * сеть у машины свой. aclaude в цепочке не участвует и может быть выключен —
22
+ * сеть у машины свой. Главная машина в цепочке не участвует и может быть выключена —
23
23
  * это прямое требование владельца, проверенное живым вызовом.
24
24
  *
25
25
  * ГРАНИЦЫ. Слушает только петлю. Наружу не выставляется никогда: это доступ к
package/package.json CHANGED
@@ -1,9 +1,12 @@
1
1
  {
2
2
  "name": "subscription-gateway",
3
- "version": "0.1.1",
3
+ "version": "0.1.3",
4
4
  "description": "Subscription gateway for DeepSeek Harness — runs the model loop through the vendor's official agent SDK, so the platform works on a subscription seat instead of a metered API key, with the token kept in one place on the machine.",
5
5
  "type": "module",
6
6
  "main": "gateway.mjs",
7
+ "scripts": {
8
+ "test": "node test-schema-adapter.mjs"
9
+ },
7
10
  "files": [
8
11
  "gateway.mjs",
9
12
  "jsonschema-to-zod.mjs",
@@ -43,7 +43,24 @@ console.log('\n=== A. Real platform schedule schemas ===')
43
43
  // an argument, because what must be checked is your installation, not the one the
44
44
  // bench was written on.
45
45
  const SCHEDULE_FILE = process.argv[2] ?? `${dirname(fileURLToPath(import.meta.url))}/schedule.json`
46
- const SCHEDULE = JSON.parse(readFileSync(SCHEDULE_FILE, 'utf8'))
46
+ // 🔴 ТРЕТИЙ ИСХОД И ЗДЕСЬ. Выше этот класс уже лечён для ЗАВИСИМОСТИ, а для самого файла
47
+ // схем остался непройденным: без него стенд падал голым стектрейсом с кодом 1 — то есть
48
+ // говорил «предмет расходится» при исправном предмете. Путь берётся из аргумента и пакет
49
+ // прямо приглашает указать СВОЙ файл: опечатка в пути — обычное дело, и отвечать на неё
50
+ // обвинением коду нельзя. Нет файла или он не разбирается — проверять НЕЧЕМ, это код 2.
51
+ // The same third outcome for the schema file itself: a missing or unparsable file means
52
+ // there is nothing to check (exit 2), not that the subject disagrees (exit 1).
53
+ let SCHEDULE
54
+ try {
55
+ SCHEDULE = JSON.parse(readFileSync(SCHEDULE_FILE, 'utf8'))
56
+ if (!Array.isArray(SCHEDULE)) throw new Error('ожидался массив схем / an array of schemas was expected')
57
+ } catch (e) {
58
+ console.log(`СЛЕПОТА: файл схем не прочитан: ${String(e?.message ?? e).slice(0, 120)}`)
59
+ console.log(` Путь: ${SCHEDULE_FILE}`)
60
+ console.log(' Это не расхождение предмета: укажите файл схем аргументом'
61
+ + ' (`node test-schema-adapter.mjs /путь/к/schedule.json`) и повторите.')
62
+ process.exit(2)
63
+ }
47
64
  for (const tool of SCHEDULE) {
48
65
  blok(`${tool.name}: the schema assembled`, () => {
49
66
  const s = shape(tool.parameters)