@osovv/vv-opencode 2.2.0 → 2.3.0-rc.0
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 +16 -0
- package/README.md +47 -4
- package/dist/index.d.ts +1 -0
- package/dist/index.js +6 -3
- package/dist/index.js.map +1 -1
- package/dist/lib/plugin-toggle-config.d.ts +1 -1
- package/dist/lib/plugin-toggle-config.js +3 -1
- package/dist/lib/plugin-toggle-config.js.map +1 -1
- package/dist/lib/vvoc-config.d.ts +90 -5
- package/dist/lib/vvoc-config.js +123 -9
- package/dist/lib/vvoc-config.js.map +1 -1
- package/dist/plugins/guardian/index.d.ts +3 -6
- package/dist/plugins/guardian/index.js +7 -26
- package/dist/plugins/guardian/index.js.map +1 -1
- package/dist/plugins/telegram/bot-api.d.ts +162 -0
- package/dist/plugins/telegram/bot-api.js +273 -0
- package/dist/plugins/telegram/bot-api.js.map +1 -0
- package/dist/plugins/telegram/commands.d.ts +167 -0
- package/dist/plugins/telegram/commands.js +709 -0
- package/dist/plugins/telegram/commands.js.map +1 -0
- package/dist/plugins/telegram/config.d.ts +38 -0
- package/dist/plugins/telegram/config.js +86 -0
- package/dist/plugins/telegram/config.js.map +1 -0
- package/dist/plugins/telegram/delivery.d.ts +121 -0
- package/dist/plugins/telegram/delivery.js +395 -0
- package/dist/plugins/telegram/delivery.js.map +1 -0
- package/dist/plugins/telegram/gateway.d.ts +61 -0
- package/dist/plugins/telegram/gateway.js +230 -0
- package/dist/plugins/telegram/gateway.js.map +1 -0
- package/dist/plugins/telegram/index.d.ts +110 -0
- package/dist/plugins/telegram/index.js +390 -0
- package/dist/plugins/telegram/index.js.map +1 -0
- package/dist/plugins/telegram/sessions.d.ts +147 -0
- package/dist/plugins/telegram/sessions.js +322 -0
- package/dist/plugins/telegram/sessions.js.map +1 -0
- package/dist/plugins/telegram/topology.d.ts +116 -0
- package/dist/plugins/telegram/topology.js +339 -0
- package/dist/plugins/telegram/topology.js.map +1 -0
- package/dist/plugins/web-tools/schemas.d.ts +19 -19
- package/dist/plugins/workflow/results.d.ts +39 -39
- package/package.json +6 -1
- package/schemas/vvoc/v3.json +89 -13
- package/templates/skills/vv-execute/references/tool-contracts.md +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,19 @@
|
|
|
1
|
+
## 2.3.0-rc.0 (2026-10-04)
|
|
2
|
+
|
|
3
|
+
### Summary
|
|
4
|
+
|
|
5
|
+
This release candidate introduces the TelegramBridgePlugin, a native server plugin that bridges OpenCode sessions to Telegram, letting users drive and monitor multiple parallel sessions directly from a phone. Each active session gets its own private-chat forum topic, with live status shown as an emoji in the topic title, so several sessions can run side by side without opening each conversation. Users can create and sync sessions, switch models through an inline picker, answer agent questions and permission requests with inline actions, view subagent activity, fork or revert messages, and send file attachments, while assistant output streams through durable, throttled delivery that survives server restarts without duplicating messages or topics. The plugin is configured through a new optional top-level telegram section in strict schema v3, including bot token with environment-placeholder substitution, an allowed-user list, an activity window defaulting to 240 minutes, and mutually exclusive custom API root or outbound proxy options for corporate networks, with the plugin toggling itself off via a value-free diagnostic when the token is missing. This matters because it turns OpenCode into a remotely controllable, multi-session workflow available from a chat client, while keeping bot credentials out of logs and stored state and preserving exactly-once delivery.
|
|
6
|
+
|
|
7
|
+
* feat(telegram): add TelegramBridgePlugin for parallel Telegram session control ([1e01e54](https://github.com/osovv/vv-opencode/commit/1e01e54))
|
|
8
|
+
|
|
9
|
+
## <small>2.2.1 (2026-10-04)</small>
|
|
10
|
+
|
|
11
|
+
### Summary
|
|
12
|
+
|
|
13
|
+
Version 2.2.1 removes the unused System One shadow mode from Guardian, simplifying the permission-review configuration. The `guardian.systemone.shadow` option has been dropped from the config schema and documentation, so Guardian now uses the System One decision backend only when it is explicitly selected and the provider is available, otherwise it falls back to the fast backend, while a runtime provider failure still defers to manual approval. This removes a calibration-only setting that no longer served a purpose, keeping the fail-safe behavior intact and making the documented configuration example cleaner for users opting into System One.
|
|
14
|
+
|
|
15
|
+
* fix(guardian): remove unused System One shadow mode ([11d6bac](https://github.com/osovv/vv-opencode/commit/11d6bac))
|
|
16
|
+
|
|
1
17
|
## 2.2.0 (2026-10-04)
|
|
2
18
|
|
|
3
19
|
### Summary
|
package/README.md
CHANGED
|
@@ -165,9 +165,9 @@ grep '<COMPONENT-' .vvoc/specs/*/*.xml # component map across spec and plan
|
|
|
165
165
|
|
|
166
166
|
## What's inside
|
|
167
167
|
|
|
168
|
-
### The
|
|
168
|
+
### The server plugins and the native TUI
|
|
169
169
|
|
|
170
|
-
|
|
170
|
+
The server plugins run inside the OpenCode server process; **ContextTuiPlugin** runs in the terminal UI through the same pinned package's `./tui` export.
|
|
171
171
|
|
|
172
172
|
| Plugin | What it does |
|
|
173
173
|
|---|---|
|
|
@@ -182,6 +182,7 @@ Eleven server plugins run inside the OpenCode server process; the twelfth entry,
|
|
|
182
182
|
| **AnalyticsPlugin** | Local-only token and cache telemetry per model step, a live `cache NN%` indicator in the TUI, and `vvoc analytics cache-hit-rate` for retrospective comparison. |
|
|
183
183
|
| **PeakHoursPlugin** | Warns or blocks models whose provider is in peak-priced hours right now, suggests connected off-peak providers, and shows a persistent orange banner in the TUI. |
|
|
184
184
|
| **SpecGuardPlugin** | Deterministic host-side verification of spec-package artifacts: annotates reads with lint verdicts and validates writes; in enforce mode refuses writes that would break the format. |
|
|
185
|
+
| **TelegramBridgePlugin** | Runs a single-owner Telegram bot inside the OpenCode server process: one private-chat DM topic per active session with a live status emoji in the topic title, a General control topic, manual permission and question buttons, and durable state that survives `opencode service restart`. |
|
|
185
186
|
| **ContextTuiPlugin** | The `/context` inspector: an honest, scrollable TUI dialog showing context-window usage by category, tool, and MCP server. |
|
|
186
187
|
|
|
187
188
|
### Managed agents
|
|
@@ -690,6 +691,49 @@ The engine checks well-formedness, the attribute ban, the template contract per
|
|
|
690
691
|
|
|
691
692
|
Conservatively materialized by `vvoc sync`/`init`; `enforce` blocks only ERROR states; internal failures degrade to a warning log and never break a tool call. Changes require an OpenCode restart, like other runtime plugin settings.
|
|
692
693
|
|
|
694
|
+
### Telegram bridge
|
|
695
|
+
|
|
696
|
+
`TelegramBridgePlugin` runs a single-owner Telegram bot inside the OpenCode server process — no second process, no exposed ports. Enable forum topics for the bot in @BotFather first; the bridge uses the private chat between you and the bot only.
|
|
697
|
+
|
|
698
|
+
The layout is one Telegram DM topic per active session, with a fixed **General** topic as the control lane. Topic titles carry a live status emoji (⚙️ running, 💤 idle, ❓ question, 🔐 permission, ‼️ error, ⏹ aborted) ahead of the session title. A session stays active while it is running or was updated within the activity window (default 240 minutes, or used through the bot); when it goes inactive its topic is closed — never deleted, history stays readable — and `/sync` reconciles topics to the actual active session set.
|
|
699
|
+
|
|
700
|
+
Commands:
|
|
701
|
+
|
|
702
|
+
| Command | Where | What it does |
|
|
703
|
+
|---|---|---|
|
|
704
|
+
| `/new` | General | Pick a project from an inline list; the session is created with that project's default agent and gets its own topic |
|
|
705
|
+
| `/sync` | General | Idempotent reconciliation: create topics for active sessions missing one, close stale ones, report counts |
|
|
706
|
+
| `/status` | General or session topic | Active sessions with context usage, or the current session's state |
|
|
707
|
+
| `/help` | anywhere | Command list |
|
|
708
|
+
| plain text | session topic | Prompt for that session; consecutive texts inside the merge window join into one prompt |
|
|
709
|
+
| `/model` | session topic | Inline provider and model picker; the current model is applied through the session model switch |
|
|
710
|
+
| `/rename <title>` | session topic | Rename the session and its topic |
|
|
711
|
+
| `/messages` | session topic | Browse user messages; Revert rolls the session back, Fork branches a new session that gets its own topic |
|
|
712
|
+
| `/abort` | session topic | Interrupt the session |
|
|
713
|
+
| `/settings` | anywhere | Toggle reasoning visibility, tool-call detail, and markdown/raw reply format |
|
|
714
|
+
|
|
715
|
+
Permissions and agent questions arrive as inline-button prompts in the owning session topic — `✅ Once / ♾ Always / ❌ Reject` for permissions, the offered options plus `✍️ Custom` for questions. Choosing Custom holds the topic's input gate so your next plain message becomes the answer (`/cancel` aborts); nothing is ever auto-approved and no decision is fabricated when a prompt is resolved outside Telegram. Subagent activity renders as bounded cards in the parent topic. Images, PDFs, and text files (bounded, albums included) can be attached to prompts; oversized files are rejected with an explicit notice.
|
|
716
|
+
|
|
717
|
+
Configuration is an optional top-level section of `vvoc.json` (schema v3). The bot never starts without it:
|
|
718
|
+
|
|
719
|
+
```json
|
|
720
|
+
"telegram": {
|
|
721
|
+
"enabled": true,
|
|
722
|
+
"botToken": "${TELEGRAM_BOT_TOKEN}",
|
|
723
|
+
"allowedUserIds": [123456789],
|
|
724
|
+
"activityWindowMinutes": 240,
|
|
725
|
+
"apiRoot": "https://tg.example.com"
|
|
726
|
+
}
|
|
727
|
+
```
|
|
728
|
+
|
|
729
|
+
- `botToken` — a literal or `${VAR}` placeholder resolved from the OpenCode process environment at startup; an unset variable disables the gateway with a value-free diagnostic naming the variable. Prefer the environment or the global vvoc layer; never commit a token.
|
|
730
|
+
- `allowedUserIds` — the numeric Telegram user ids allowed to talk to the bot (get yours from @userinfobot). This is the entire access boundary: single owner, private chat, non-owner messages are ignored.
|
|
731
|
+
- `activityWindowMinutes` — how long a session stays active after its last update (default 240).
|
|
732
|
+
- `apiRoot` or `proxyUrl` — mutually exclusive connectivity modes for restricted corporate networks: a custom Bot API root behind your own reverse proxy, or an outbound proxy URL for `api.telegram.org`.
|
|
733
|
+
- `settings` — delivery defaults: `showReasoning` (default false), `showToolCalls` (default false), `formatMode` (`markdown` default or `raw`), `codeFileMaxKb` (default 100; larger code blocks arrive as file documents), `mergeWindowMs` (default 1500).
|
|
734
|
+
|
|
735
|
+
Durable state (update offset, topic and session map, message mirror, pending finals, settings) lives in the OpenCode plugin storage, scoped to the plugin, and survives `opencode service restart`; a changed bot token resets the stored maps instead of reusing stale bindings. Assistant output streams through draft previews with a throttled edit fallback, finals are delivered exactly once per message across restarts, and all topics share one chat rate budget, so streaming is throttled adaptively. Telegram configuration changes require an OpenCode restart, like other runtime plugins; the `telegram` plugin toggle (`plugins["telegram"]`) is a kill-switch that registers nothing.
|
|
736
|
+
|
|
693
737
|
### Web tools
|
|
694
738
|
|
|
695
739
|
`WebToolsPlugin` exposes exactly two canonical model-facing tools:
|
|
@@ -749,13 +793,12 @@ Guardian can derive its bounded low-risk assessment either from the captured `fa
|
|
|
749
793
|
},
|
|
750
794
|
"guardian": {
|
|
751
795
|
"decisionBackend": "systemone",
|
|
752
|
-
"systemone": { "
|
|
796
|
+
"systemone": { "lowRiskThreshold": 0.95 }
|
|
753
797
|
}
|
|
754
798
|
```
|
|
755
799
|
|
|
756
800
|
- `decisionBackend` is `"fast"` (default) or `"systemone"`; the default keeps today's behavior unchanged.
|
|
757
801
|
- With `"systemone"`, Guardian asks one `noul` ("the action is low-risk") and one `score` (risk rubric) over the same bounded review input and reuses the existing `risk_level === "low" && risk_score < approvalRiskThreshold` rule. `lowRiskThreshold` is the noul probability gate.
|
|
758
|
-
- `systemone.shadow` keeps the `fast` backend authoritative while evaluating and logging the System One decision, so thresholds can be calibrated against real decisions before opting in.
|
|
759
802
|
- Fail-closed: an unavailable, unreachable, timed-out, or malformed provider defers to manual approval and never auto-approves from a provider answer. A disabled section, a disabled `systemone` plugin toggle, or an unresolved `${VAR}` key keeps the `fast` backend.
|
|
760
803
|
- The `systemone` plugin toggle is a kill switch: `vvoc plugin disable systemone` constructs no provider and forces the fast backend.
|
|
761
804
|
- `apiKey` may be a literal or a `${VAR}` placeholder resolved from the OpenCode process environment at startup, like web provider credentials. The resolved value is never logged or written to persisted config snapshots.
|
package/dist/index.d.ts
CHANGED
|
@@ -10,6 +10,7 @@ export { ToolHistoryCompactionPlugin } from "./plugins/tool-history-compaction/i
|
|
|
10
10
|
export { AnalyticsPlugin } from "./plugins/analytics/index.js";
|
|
11
11
|
export { PeakHoursPlugin } from "./plugins/peak-hours/index.js";
|
|
12
12
|
export { SpecGuardPlugin } from "./plugins/spec-guard/index.js";
|
|
13
|
+
export { TelegramBridgePlugin } from "./plugins/telegram/index.js";
|
|
13
14
|
/**
|
|
14
15
|
* The eleven native server plugins in deterministic setup order. Model roles is
|
|
15
16
|
* first so the shared snapshot runtime exists before every consumer acquires it;
|
package/dist/index.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// VERSION: 1.1.0
|
|
3
3
|
// START_MODULE_CONTRACT
|
|
4
4
|
// PURPOSE: Re-export the public vv-opencode plugin entrypoints from the package root and assemble them into one native aggregate server plugin.
|
|
5
|
-
// SCOPE: Package-root exports for GuardianPlugin, HashlineEditPlugin, ModelRolesPlugin, SystemContextInjectionPlugin, WorkflowPlugin, SecretsRedactionPlugin, WebToolsPlugin, ToolHistoryCompactionPlugin, AnalyticsPlugin, PeakHoursPlugin, and
|
|
5
|
+
// SCOPE: Package-root exports for GuardianPlugin, HashlineEditPlugin, ModelRolesPlugin, SystemContextInjectionPlugin, WorkflowPlugin, SecretsRedactionPlugin, WebToolsPlugin, ToolHistoryCompactionPlugin, AnalyticsPlugin, PeakHoursPlugin, SpecGuardPlugin, and TelegramBridgePlugin, plus the native default definition that sets all of them up against one shared Context with complete reverse-order teardown and partial-setup rollback.
|
|
6
6
|
// DEPENDS: [@opencode/plugin, src/plugins/guardian/index.ts, src/plugins/hashline-edit/index.ts, src/plugins/model-roles/index.ts, src/plugins/system-context-injection/index.ts, src/plugins/workflow/index.ts, src/plugins/secrets-redaction.ts, src/plugins/web-tools/index.ts, src/plugins/tool-history-compaction/index.ts, src/plugins/analytics/index.ts, src/plugins/peak-hours/index.ts, src/plugins/spec-guard/index.ts]
|
|
7
7
|
// LINKS: [M-PLUGIN-GUARDIAN, M-PLUGIN-HASHLINE-EDIT, M-PLUGIN-MODEL-ROLES, M-PLUGIN-SYSTEM-CONTEXT-INJECTION, M-PLUGIN-WORKFLOW, M-PLUGIN-SECRETS-REDACTION, M-PLUGIN-WEB-TOOLS, M-PLUGIN-TOOL-HISTORY-COMPACTION, M-PLUGIN-ANALYTICS, M-PLUGIN-PEAK-HOURS, M-PLUGIN-SPEC-GUARD]
|
|
8
8
|
// ROLE: BARREL
|
|
@@ -10,8 +10,8 @@
|
|
|
10
10
|
// END_MODULE_CONTRACT
|
|
11
11
|
//
|
|
12
12
|
// START_MODULE_MAP
|
|
13
|
-
// GuardianPlugin, HashlineEditPlugin, ModelRolesPlugin, SystemContextInjectionPlugin, WorkflowPlugin, SecretsRedactionPlugin, WebToolsPlugin, ToolHistoryCompactionPlugin, AnalyticsPlugin, PeakHoursPlugin, SpecGuardPlugin - Public plugin exports available from @osovv/vv-opencode.
|
|
14
|
-
// VVOC_SERVER_PLUGINS - The
|
|
13
|
+
// GuardianPlugin, HashlineEditPlugin, ModelRolesPlugin, SystemContextInjectionPlugin, WorkflowPlugin, SecretsRedactionPlugin, WebToolsPlugin, ToolHistoryCompactionPlugin, AnalyticsPlugin, PeakHoursPlugin, SpecGuardPlugin, TelegramBridgePlugin - Public plugin exports available from @osovv/vv-opencode.
|
|
14
|
+
// VVOC_SERVER_PLUGINS - The native server plugins in deterministic setup order (model roles first so the shared snapshot runtime exists before consumers; the telegram bridge last as a standalone gateway).
|
|
15
15
|
// VvocPlugin - Native aggregate server plugin that sets up all eleven plugins on one Context and tears them down in reverse order.
|
|
16
16
|
// default - Native default server plugin definition loaded by OpenCode from the package or a local directory.
|
|
17
17
|
// END_MODULE_MAP
|
|
@@ -28,6 +28,7 @@ import { ModelRolesPlugin } from "./plugins/model-roles/index.js";
|
|
|
28
28
|
import { PeakHoursPlugin } from "./plugins/peak-hours/index.js";
|
|
29
29
|
import { SecretsRedactionPlugin } from "./plugins/secrets-redaction.js";
|
|
30
30
|
import { SpecGuardPlugin } from "./plugins/spec-guard/index.js";
|
|
31
|
+
import { TelegramBridgePlugin } from "./plugins/telegram/index.js";
|
|
31
32
|
import { SystemContextInjectionPlugin } from "./plugins/system-context-injection/index.js";
|
|
32
33
|
import { ToolHistoryCompactionPlugin } from "./plugins/tool-history-compaction/index.js";
|
|
33
34
|
import { WebToolsPlugin } from "./plugins/web-tools/index.js";
|
|
@@ -43,6 +44,7 @@ export { ToolHistoryCompactionPlugin } from "./plugins/tool-history-compaction/i
|
|
|
43
44
|
export { AnalyticsPlugin } from "./plugins/analytics/index.js";
|
|
44
45
|
export { PeakHoursPlugin } from "./plugins/peak-hours/index.js";
|
|
45
46
|
export { SpecGuardPlugin } from "./plugins/spec-guard/index.js";
|
|
47
|
+
export { TelegramBridgePlugin } from "./plugins/telegram/index.js";
|
|
46
48
|
// START_BLOCK_AGGREGATE
|
|
47
49
|
/**
|
|
48
50
|
* The eleven native server plugins in deterministic setup order. Model roles is
|
|
@@ -61,6 +63,7 @@ export const VVOC_SERVER_PLUGINS = [
|
|
|
61
63
|
AnalyticsPlugin,
|
|
62
64
|
PeakHoursPlugin,
|
|
63
65
|
SpecGuardPlugin,
|
|
66
|
+
TelegramBridgePlugin,
|
|
64
67
|
];
|
|
65
68
|
/**
|
|
66
69
|
* Native aggregate server plugin. Every plugin is set up against the exact same
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,qBAAqB;AACrB,iBAAiB;AACjB,wBAAwB;AACxB,kJAAkJ;AAClJ,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,qBAAqB;AACrB,iBAAiB;AACjB,wBAAwB;AACxB,kJAAkJ;AAClJ,kbAAkb;AAClb,qaAAqa;AACra,mRAAmR;AACnR,iBAAiB;AACjB,sBAAsB;AACtB,sBAAsB;AACtB,EAAE;AACF,mBAAmB;AACnB,gTAAgT;AAChT,+MAA+M;AAC/M,qIAAqI;AACrI,gHAAgH;AAChH,iBAAiB;AACjB,EAAE;AACF,uBAAuB;AACvB,iMAAiM;AACjM,0FAA0F;AAC1F,qBAAqB;AAErB,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC1C,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAC/D,OAAO,EAAE,cAAc,EAAE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mB,GAA6B;IAC3D,gBAAgB;IAChB,sBAAsB;IACtB,cAAc;IACd,kBAAkB;IAClB,cAAc;IACd,4BAA4B;IAC5B,cAAc;IACd,2BAA2B;IAC3B,eAAe;IACf,eAAe;IACf,eAAe;IACf,oBAAoB;CACrB,CAAC;AAEF;;;;;GAKG;AACH,MAAM,UAAU,GAAG,MAAM,CAAC,MAAM,CAAC;IAC/B,EAAE,EAAE,MAAM;IACV,KAAK,CAAC,KAAK,CAAC,GAAG;QACb,MAAM,QAAQ,GAAsC,EAAE,CAAC;QACvD,KAAK,MAAM,MAAM,IAAI,mBAAmB,EAAE,CAAC;YACzC,IAAI,CAAC;gBACH,MAAM,OAAO,GAAG,MAAM,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;gBACxC,IAAI,OAAO,OAAO,KAAK,UAAU;oBAAE,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;YAC5D,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACf,KAAK,MAAM,OAAO,IAAI,QAAQ,CAAC,OAAO,EAAE,EAAE,CAAC;oBACzC,IAAI,CAAC;wBACH,MAAM,OAAO,EAAE,CAAC;oBAClB,CAAC;oBAAC,MAAM,CAAC;wBACP,yEAAyE;oBAC3E,CAAC;gBACH,CAAC;gBACD,MAAM,KAAK,CAAC;YACd,CAAC;QACH,CAAC;QACD,OAAO,KAAK,IAAI,EAAE;YAChB,KAAK,MAAM,OAAO,IAAI,QAAQ,CAAC,OAAO,EAAE;gBAAE,MAAM,OAAO,EAAE,CAAC;QAC5D,CAAC,CAAC;IACJ,CAAC;CACF,CAAC,CAAC;AAEH,OAAO,EAAE,UAAU,EAAE,CAAC;AACtB,eAAe,UAAU,CAAC;AAC1B,sBAAsB"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const PLUGIN_TOGGLE_NAMES: readonly ["guardian", "hashline-edit", "model-roles", "system-context-injection", "workflow", "secrets-redaction", "context", "web-tools", "tool-history-compaction", "analytics", "peak-hours", "spec-guard", "systemone"];
|
|
1
|
+
export declare const PLUGIN_TOGGLE_NAMES: readonly ["guardian", "hashline-edit", "model-roles", "system-context-injection", "workflow", "secrets-redaction", "context", "web-tools", "tool-history-compaction", "analytics", "peak-hours", "spec-guard", "systemone", "telegram"];
|
|
2
2
|
export type VvocPluginEntryConfig = {
|
|
3
3
|
enabled?: boolean;
|
|
4
4
|
routing?: Record<string, unknown>;
|
|
@@ -30,7 +30,8 @@
|
|
|
30
30
|
// END_MODULE_MAP
|
|
31
31
|
//
|
|
32
32
|
// START_CHANGE_SUMMARY
|
|
33
|
-
// LAST_CHANGE: [C-
|
|
33
|
+
// LAST_CHANGE: [C-TELEGRAM-BRIDGE-PLUGIN T-001 - Added the telegram toggle name with no default materialization entry; the optional telegram section gates actual gateway behavior.]
|
|
34
|
+
// PREVIOUS: [C-SYSTEMONE-DECISION-BACKEND T-003 - Added the systemone provider toggle name.]
|
|
34
35
|
// END_CHANGE_SUMMARY
|
|
35
36
|
// START_BLOCK_CONSTANTS
|
|
36
37
|
export const PLUGIN_TOGGLE_NAMES = [
|
|
@@ -47,6 +48,7 @@ export const PLUGIN_TOGGLE_NAMES = [
|
|
|
47
48
|
"peak-hours",
|
|
48
49
|
"spec-guard",
|
|
49
50
|
"systemone",
|
|
51
|
+
"telegram",
|
|
50
52
|
];
|
|
51
53
|
// Default edit-routing table for the hashline-edit plugin. Materialized into vvoc.json
|
|
52
54
|
// on sync/init so it is visible and editable; kept as a plain config-shape object
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin-toggle-config.js","sourceRoot":"","sources":["../../src/lib/plugin-toggle-config.ts"],"names":[],"mappings":"AAAA,wCAAwC;AACxC,iBAAiB;AACjB,wBAAwB;AACxB,+IAA+I;AAC/I,kTAAkT;AAClT,oBAAoB;AACpB,+FAA+F;AAC/F,kBAAkB;AAClB,sBAAsB;AACtB,sBAAsB;AACtB,EAAE;AACF,mBAAmB;AACnB,uEAAuE;AACvE,mGAAmG;AACnG,iHAAiH;AACjH,2FAA2F;AAC3F,yHAAyH;AACzH,4HAA4H;AAC5H,6GAA6G;AAC7G,oGAAoG;AACpG,4GAA4G;AAC5G,8FAA8F;AAC9F,8FAA8F;AAC9F,mIAAmI;AACnI,0JAA0J;AAC1J,qHAAqH;AACrH,4HAA4H;AAC5H,kGAAkG;AAClG,+EAA+E;AAC/E,iBAAiB;AACjB,EAAE;AACF,uBAAuB;AACvB,
|
|
1
|
+
{"version":3,"file":"plugin-toggle-config.js","sourceRoot":"","sources":["../../src/lib/plugin-toggle-config.ts"],"names":[],"mappings":"AAAA,wCAAwC;AACxC,iBAAiB;AACjB,wBAAwB;AACxB,+IAA+I;AAC/I,kTAAkT;AAClT,oBAAoB;AACpB,+FAA+F;AAC/F,kBAAkB;AAClB,sBAAsB;AACtB,sBAAsB;AACtB,EAAE;AACF,mBAAmB;AACnB,uEAAuE;AACvE,mGAAmG;AACnG,iHAAiH;AACjH,2FAA2F;AAC3F,yHAAyH;AACzH,4HAA4H;AAC5H,6GAA6G;AAC7G,oGAAoG;AACpG,4GAA4G;AAC5G,8FAA8F;AAC9F,8FAA8F;AAC9F,mIAAmI;AACnI,0JAA0J;AAC1J,qHAAqH;AACrH,4HAA4H;AAC5H,kGAAkG;AAClG,+EAA+E;AAC/E,iBAAiB;AACjB,EAAE;AACF,uBAAuB;AACvB,uLAAuL;AACvL,+FAA+F;AAC/F,qBAAqB;AAErB,wBAAwB;AACxB,MAAM,CAAC,MAAM,mBAAmB,GAAG;IACjC,UAAU;IACV,eAAe;IACf,aAAa;IACb,0BAA0B;IAC1B,UAAU;IACV,mBAAmB;IACnB,SAAS;IACT,WAAW;IACX,yBAAyB;IACzB,WAAW;IACX,YAAY;IACZ,YAAY;IACZ,WAAW;IACX,UAAU;CACF,CAAC;AASX,uFAAuF;AACvF,kFAAkF;AAClF,iFAAiF;AACjF,MAAM,CAAC,MAAM,6BAA6B,GAAG;IAC3C,OAAO,EAAE,eAAe;I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U,CAAC,CAAC;IACjD,2DAA2D;IAC3D,IAAI,WAAW,KAAK,SAAS,EAAE,CAAC;QAC9B,OAAO,IAAI,CAAC;IACd,CAAC;IAED,IAAI,OAAO,WAAW,KAAK,SAAS,EAAE,CAAC;QACrC,IAAI,OAAO,CAAC,GAAG,CAAC,KAAK,EAAE,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC;YACxC,OAAO,CAAC,GAAG,CACT,sEAAsE;gBACpE,UAAU;gBACV,YAAY;gBACZ,WAAW,CACd,CAAC;QACJ,CAAC;QACD,OAAO,WAAW,CAAC;IACrB,CAAC;IAED,mFAAmF;IACnF,OAAO,WAAW,CAAC,OAAO,KAAK,KAAK,CAAC;AACvC,CAAC;AAED,MAAM,CAAC,MAAM,mBAAmB,GAAG,eAAe,CAAC;AACnD,8BAA8B"}
|
|
@@ -22,9 +22,8 @@ export type GuardianConfig = {
|
|
|
22
22
|
export type GuardianConfigOverrides = Partial<GuardianConfig>;
|
|
23
23
|
/** Selected Guardian assessment backend. Fast is the default; systemone is explicit opt-in. */
|
|
24
24
|
export type GuardianDecisionBackend = "fast" | "systemone";
|
|
25
|
-
/** Guardian-specific System One policy:
|
|
25
|
+
/** Guardian-specific System One policy: the low-risk noul probability gate. */
|
|
26
26
|
export type GuardianSystemOneConfig = {
|
|
27
|
-
shadow: boolean;
|
|
28
27
|
lowRiskThreshold: number;
|
|
29
28
|
};
|
|
30
29
|
/** Resolved connection settings for the optional provider-neutral System One section. */
|
|
@@ -79,6 +78,24 @@ export type VvocWebConfig = {
|
|
|
79
78
|
search?: VvocWebSearchConfig;
|
|
80
79
|
fetch?: VvocWebFetchConfig;
|
|
81
80
|
};
|
|
81
|
+
/** Owner-tunable Telegram delivery defaults; persisted runtime settings seed from these. */
|
|
82
|
+
export type VvocTelegramSettings = {
|
|
83
|
+
showReasoning?: boolean;
|
|
84
|
+
showToolCalls?: boolean;
|
|
85
|
+
formatMode?: "markdown" | "raw";
|
|
86
|
+
codeFileMaxKb?: number;
|
|
87
|
+
mergeWindowMs?: number;
|
|
88
|
+
};
|
|
89
|
+
/** Optional top-level telegram bridge section of canonical vvoc.json. */
|
|
90
|
+
export type VvocTelegramConfig = {
|
|
91
|
+
enabled?: boolean;
|
|
92
|
+
botToken: string;
|
|
93
|
+
allowedUserIds: number[];
|
|
94
|
+
activityWindowMinutes?: number;
|
|
95
|
+
apiRoot?: string;
|
|
96
|
+
proxyUrl?: string;
|
|
97
|
+
settings?: VvocTelegramSettings;
|
|
98
|
+
};
|
|
82
99
|
export type VvocConfig = {
|
|
83
100
|
$schema: string;
|
|
84
101
|
version: number;
|
|
@@ -90,6 +107,7 @@ export type VvocConfig = {
|
|
|
90
107
|
plugins: VvocPluginToggleConfig;
|
|
91
108
|
web?: VvocWebConfig;
|
|
92
109
|
systemone?: SystemOneConfig;
|
|
110
|
+
telegram?: VvocTelegramConfig;
|
|
93
111
|
};
|
|
94
112
|
export type ParsedVvocConfig = {
|
|
95
113
|
sourceSchema: string;
|
|
@@ -168,9 +186,6 @@ export declare const VVOC_CONFIG_SCHEMA: {
|
|
|
168
186
|
additionalProperties: boolean;
|
|
169
187
|
required: string[];
|
|
170
188
|
properties: {
|
|
171
|
-
shadow: {
|
|
172
|
-
type: string;
|
|
173
|
-
};
|
|
174
189
|
lowRiskThreshold: {
|
|
175
190
|
type: string;
|
|
176
191
|
minimum: number;
|
|
@@ -607,6 +622,75 @@ export declare const VVOC_CONFIG_SCHEMA: {
|
|
|
607
622
|
};
|
|
608
623
|
};
|
|
609
624
|
};
|
|
625
|
+
telegram: {
|
|
626
|
+
type: string;
|
|
627
|
+
description: string;
|
|
628
|
+
additionalProperties: boolean;
|
|
629
|
+
required: string[];
|
|
630
|
+
properties: {
|
|
631
|
+
enabled: {
|
|
632
|
+
type: string;
|
|
633
|
+
};
|
|
634
|
+
botToken: {
|
|
635
|
+
type: string;
|
|
636
|
+
minLength: number;
|
|
637
|
+
description: string;
|
|
638
|
+
};
|
|
639
|
+
allowedUserIds: {
|
|
640
|
+
type: string;
|
|
641
|
+
minItems: number;
|
|
642
|
+
items: {
|
|
643
|
+
type: string;
|
|
644
|
+
};
|
|
645
|
+
description: string;
|
|
646
|
+
};
|
|
647
|
+
activityWindowMinutes: {
|
|
648
|
+
type: string;
|
|
649
|
+
minimum: number;
|
|
650
|
+
description: string;
|
|
651
|
+
};
|
|
652
|
+
apiRoot: {
|
|
653
|
+
type: string;
|
|
654
|
+
minLength: number;
|
|
655
|
+
description: string;
|
|
656
|
+
};
|
|
657
|
+
proxyUrl: {
|
|
658
|
+
type: string;
|
|
659
|
+
minLength: number;
|
|
660
|
+
description: string;
|
|
661
|
+
};
|
|
662
|
+
settings: {
|
|
663
|
+
type: string;
|
|
664
|
+
additionalProperties: boolean;
|
|
665
|
+
properties: {
|
|
666
|
+
showReasoning: {
|
|
667
|
+
type: string;
|
|
668
|
+
};
|
|
669
|
+
showToolCalls: {
|
|
670
|
+
type: string;
|
|
671
|
+
};
|
|
672
|
+
formatMode: {
|
|
673
|
+
type: string;
|
|
674
|
+
enum: string[];
|
|
675
|
+
};
|
|
676
|
+
codeFileMaxKb: {
|
|
677
|
+
type: string;
|
|
678
|
+
minimum: number;
|
|
679
|
+
};
|
|
680
|
+
mergeWindowMs: {
|
|
681
|
+
type: string;
|
|
682
|
+
minimum: number;
|
|
683
|
+
};
|
|
684
|
+
};
|
|
685
|
+
};
|
|
686
|
+
};
|
|
687
|
+
allOf: {
|
|
688
|
+
if: {
|
|
689
|
+
required: string[];
|
|
690
|
+
};
|
|
691
|
+
then: boolean;
|
|
692
|
+
}[];
|
|
693
|
+
};
|
|
610
694
|
};
|
|
611
695
|
};
|
|
612
696
|
export declare function createGuardianConfig(overrides?: GuardianConfigOverrides): GuardianConfig;
|
|
@@ -622,6 +706,7 @@ export declare function renderSystemOneConfig(overrides?: Partial<SystemOneConfi
|
|
|
622
706
|
export declare function renderGuardianConfig(overrides?: GuardianConfigOverrides): string;
|
|
623
707
|
export declare function parseVersionedVvocConfigText(text: string, label: string): ParsedVvocConfig;
|
|
624
708
|
export declare function parseVvocConfigText(text: string, label: string): VvocConfig;
|
|
709
|
+
export declare function createTelegramConfig(value: unknown): VvocTelegramConfig | undefined;
|
|
625
710
|
export declare function renderVvocConfig(config?: VvocConfig): string;
|
|
626
711
|
export declare function validateVvocConfigDocument(document: unknown): string[];
|
|
627
712
|
export declare function createWebConfig(value: unknown): VvocWebConfig | undefined;
|
package/dist/lib/vvoc-config.js
CHANGED
|
@@ -46,10 +46,14 @@
|
|
|
46
46
|
// VvocWebFetchConfig - Optional web fetch provider section type.
|
|
47
47
|
// VvocWebConfig - Optional canonical web tools section type.
|
|
48
48
|
// createWebConfig - Normalizes an optional web section, returning undefined when empty.
|
|
49
|
+
// VvocTelegramSettings - Owner-tunable Telegram delivery defaults type.
|
|
50
|
+
// VvocTelegramConfig - Optional top-level telegram bridge section type.
|
|
51
|
+
// createTelegramConfig - Normalizes an optional telegram section, returning undefined when absent.
|
|
49
52
|
// END_MODULE_MAP
|
|
50
53
|
//
|
|
51
54
|
// START_CHANGE_SUMMARY
|
|
52
|
-
// LAST_CHANGE: [C-
|
|
55
|
+
// LAST_CHANGE: [C-TELEGRAM-BRIDGE-PLUGIN T-001 - Added the optional strict top-level telegram section with ${VAR} token convention, single-owner allowlist, activity window, mutually exclusive connectivity modes, and delivery settings defaults.]
|
|
56
|
+
// PREVIOUS: [C-SYSTEMONE-DECISION-BACKEND T-002 - Added the optional strict systemone connection section and the guardian decisionBackend and systemone policy fields.]
|
|
53
57
|
// END_CHANGE_SUMMARY
|
|
54
58
|
import { Ajv2020 } from "ajv/dist/2020.js";
|
|
55
59
|
import { BUILTIN_ROLE_NAMES, parseModelSelection } from "./model-roles.js";
|
|
@@ -85,9 +89,8 @@ const BUILTIN_SECRETS_REDACTION_PATTERNS = [
|
|
|
85
89
|
const GUARDIAN_SYSTEMONE_CONFIG_SCHEMA = {
|
|
86
90
|
type: "object",
|
|
87
91
|
additionalProperties: false,
|
|
88
|
-
required: ["
|
|
92
|
+
required: ["lowRiskThreshold"],
|
|
89
93
|
properties: {
|
|
90
|
-
shadow: { type: "boolean" },
|
|
91
94
|
lowRiskThreshold: { type: "number", minimum: 0, maximum: 1 },
|
|
92
95
|
},
|
|
93
96
|
};
|
|
@@ -122,6 +125,68 @@ const SYSTEMONE_CONFIG_SCHEMA = {
|
|
|
122
125
|
maxRetries: { type: "integer", minimum: 0, maximum: 5 },
|
|
123
126
|
},
|
|
124
127
|
};
|
|
128
|
+
const TELEGRAM_SETTINGS_SCHEMA = {
|
|
129
|
+
type: "object",
|
|
130
|
+
additionalProperties: false,
|
|
131
|
+
properties: {
|
|
132
|
+
showReasoning: { type: "boolean" },
|
|
133
|
+
showToolCalls: { type: "boolean" },
|
|
134
|
+
formatMode: { type: "string", enum: ["markdown", "raw"] },
|
|
135
|
+
codeFileMaxKb: { type: "integer", minimum: 1 },
|
|
136
|
+
mergeWindowMs: { type: "integer", minimum: 0 },
|
|
137
|
+
},
|
|
138
|
+
};
|
|
139
|
+
// START_BLOCK_TELEGRAM_SCHEMA
|
|
140
|
+
/**
|
|
141
|
+
* Optional top-level telegram bridge section. Present means configured: botToken
|
|
142
|
+
* and the single-owner allowlist are required, the activity window defaults are
|
|
143
|
+
* applied at resolution time, and apiRoot plus proxyUrl are mutually exclusive
|
|
144
|
+
* connectivity modes (configuring both is a validation error).
|
|
145
|
+
*/
|
|
146
|
+
const TELEGRAM_CONFIG_SCHEMA = {
|
|
147
|
+
type: "object",
|
|
148
|
+
description: "Optional Telegram bridge section enabling the vvoc.telegram server plugin gateway.",
|
|
149
|
+
additionalProperties: false,
|
|
150
|
+
required: ["botToken", "allowedUserIds"],
|
|
151
|
+
properties: {
|
|
152
|
+
enabled: { type: "boolean" },
|
|
153
|
+
botToken: {
|
|
154
|
+
type: "string",
|
|
155
|
+
minLength: 1,
|
|
156
|
+
description: "Telegram bot token. Either a literal value or ${VAR} placeholders resolved from the OpenCode process environment at startup; never committed to project config.",
|
|
157
|
+
},
|
|
158
|
+
allowedUserIds: {
|
|
159
|
+
type: "array",
|
|
160
|
+
minItems: 1,
|
|
161
|
+
items: { type: "integer" },
|
|
162
|
+
description: "Numeric Telegram user ids allowed to interact with the bot.",
|
|
163
|
+
},
|
|
164
|
+
activityWindowMinutes: {
|
|
165
|
+
type: "integer",
|
|
166
|
+
minimum: 1,
|
|
167
|
+
description: "Minutes a session stays active after its last update. Default 240.",
|
|
168
|
+
},
|
|
169
|
+
apiRoot: {
|
|
170
|
+
type: "string",
|
|
171
|
+
minLength: 1,
|
|
172
|
+
description: "Custom Telegram Bot API root URL for restricted networks.",
|
|
173
|
+
},
|
|
174
|
+
proxyUrl: {
|
|
175
|
+
type: "string",
|
|
176
|
+
minLength: 1,
|
|
177
|
+
description: "Outbound proxy URL for Telegram Bot API traffic.",
|
|
178
|
+
},
|
|
179
|
+
settings: TELEGRAM_SETTINGS_SCHEMA,
|
|
180
|
+
},
|
|
181
|
+
allOf: [
|
|
182
|
+
{
|
|
183
|
+
if: { required: ["apiRoot", "proxyUrl"] },
|
|
184
|
+
// oxlint-disable-next-line unicorn/no-thenable -- JSON Schema conditional keyword.
|
|
185
|
+
then: false,
|
|
186
|
+
},
|
|
187
|
+
],
|
|
188
|
+
};
|
|
189
|
+
// END_BLOCK_TELEGRAM_SCHEMA
|
|
125
190
|
const SECRETS_REDACTION_CONFIG_SCHEMA = {
|
|
126
191
|
type: "object",
|
|
127
192
|
additionalProperties: false,
|
|
@@ -394,6 +459,7 @@ export const VVOC_CONFIG_SCHEMA = {
|
|
|
394
459
|
},
|
|
395
460
|
web: WEB_CONFIG_SCHEMA,
|
|
396
461
|
systemone: SYSTEMONE_CONFIG_SCHEMA,
|
|
462
|
+
telegram: TELEGRAM_CONFIG_SCHEMA,
|
|
397
463
|
},
|
|
398
464
|
};
|
|
399
465
|
const ajv = new Ajv2020({ allErrors: true, strict: false });
|
|
@@ -414,7 +480,6 @@ export function createGuardianConfig(overrides = {}) {
|
|
|
414
480
|
}
|
|
415
481
|
export function createGuardianSystemOneConfig(overrides = {}) {
|
|
416
482
|
return {
|
|
417
|
-
shadow: overrides.shadow ?? false,
|
|
418
483
|
lowRiskThreshold: overrides.lowRiskThreshold ?? DEFAULT_GUARDIAN_SYSTEMONE_LOW_RISK_THRESHOLD,
|
|
419
484
|
};
|
|
420
485
|
}
|
|
@@ -540,12 +605,8 @@ function parseGuardianSystemOneConfigText(value, label) {
|
|
|
540
605
|
if (!isPlainObject(value)) {
|
|
541
606
|
throw new Error(`${label}: expected a top-level object`);
|
|
542
607
|
}
|
|
543
|
-
assertAllowedKeys(value, ["
|
|
544
|
-
if (typeof value.shadow !== "boolean") {
|
|
545
|
-
throw new Error(`${label}: shadow expected a boolean`);
|
|
546
|
-
}
|
|
608
|
+
assertAllowedKeys(value, ["lowRiskThreshold"], label);
|
|
547
609
|
return {
|
|
548
|
-
shadow: value.shadow,
|
|
549
610
|
lowRiskThreshold: readUnitInterval(value.lowRiskThreshold, `${label}: lowRiskThreshold`),
|
|
550
611
|
};
|
|
551
612
|
}
|
|
@@ -568,6 +629,13 @@ export function renderGuardianConfig(overrides = {}) {
|
|
|
568
629
|
return renderJson(createGuardianConfig(overrides));
|
|
569
630
|
}
|
|
570
631
|
// END_BLOCK_SECTION_PARSE_AND_RENDER
|
|
632
|
+
// START_CONTRACT: createTelegramConfig
|
|
633
|
+
// PURPOSE: Normalize an optional telegram section from a validated document or in-memory config.
|
|
634
|
+
// INPUTS: { value: unknown - candidate telegram section }
|
|
635
|
+
// OUTPUTS: { VvocTelegramConfig | undefined - normalized section, or undefined when absent }
|
|
636
|
+
// SIDE_EFFECTS: none; the botToken value is preserved exactly and never logged
|
|
637
|
+
// LINKS: M-TELEGRAM-CONFIG, M-ENV-SUBSTITUTION
|
|
638
|
+
// END_CONTRACT: createTelegramConfig
|
|
571
639
|
// START_BLOCK_CANONICAL_CONFIG_PARSE_RENDER
|
|
572
640
|
export function parseVersionedVvocConfigText(text, label) {
|
|
573
641
|
const value = parseStrictJson(text, label);
|
|
@@ -580,9 +648,53 @@ export function parseVersionedVvocConfigText(text, label) {
|
|
|
580
648
|
export function parseVvocConfigText(text, label) {
|
|
581
649
|
return parseVersionedVvocConfigText(text, label).config;
|
|
582
650
|
}
|
|
651
|
+
export function createTelegramConfig(value) {
|
|
652
|
+
if (!isPlainObject(value)) {
|
|
653
|
+
return undefined;
|
|
654
|
+
}
|
|
655
|
+
assertAllowedKeys(value, [
|
|
656
|
+
"enabled",
|
|
657
|
+
"botToken",
|
|
658
|
+
"allowedUserIds",
|
|
659
|
+
"activityWindowMinutes",
|
|
660
|
+
"apiRoot",
|
|
661
|
+
"proxyUrl",
|
|
662
|
+
"settings",
|
|
663
|
+
], "telegram");
|
|
664
|
+
const settings = isPlainObject(value.settings) ? value.settings : {};
|
|
665
|
+
const allowedUserIds = Array.isArray(value.allowedUserIds)
|
|
666
|
+
? value.allowedUserIds.filter((id) => typeof id === "number")
|
|
667
|
+
: [];
|
|
668
|
+
return compactObject({
|
|
669
|
+
enabled: typeof value.enabled === "boolean" ? value.enabled : undefined,
|
|
670
|
+
botToken: readNonEmptyString(value.botToken, "telegram: botToken"),
|
|
671
|
+
allowedUserIds,
|
|
672
|
+
activityWindowMinutes: typeof value.activityWindowMinutes === "number" && value.activityWindowMinutes > 0
|
|
673
|
+
? value.activityWindowMinutes
|
|
674
|
+
: undefined,
|
|
675
|
+
apiRoot: normalizeOptionalString(typeof value.apiRoot === "string" ? value.apiRoot : undefined),
|
|
676
|
+
proxyUrl: normalizeOptionalString(typeof value.proxyUrl === "string" ? value.proxyUrl : undefined),
|
|
677
|
+
settings: compactObject({
|
|
678
|
+
showReasoning: typeof settings.showReasoning === "boolean" ? settings.showReasoning : undefined,
|
|
679
|
+
showToolCalls: typeof settings.showToolCalls === "boolean" ? settings.showToolCalls : undefined,
|
|
680
|
+
formatMode: settings.formatMode === "raw"
|
|
681
|
+
? "raw"
|
|
682
|
+
: settings.formatMode === "markdown"
|
|
683
|
+
? "markdown"
|
|
684
|
+
: undefined,
|
|
685
|
+
codeFileMaxKb: typeof settings.codeFileMaxKb === "number" && settings.codeFileMaxKb > 0
|
|
686
|
+
? settings.codeFileMaxKb
|
|
687
|
+
: undefined,
|
|
688
|
+
mergeWindowMs: typeof settings.mergeWindowMs === "number" && settings.mergeWindowMs >= 0
|
|
689
|
+
? settings.mergeWindowMs
|
|
690
|
+
: undefined,
|
|
691
|
+
}),
|
|
692
|
+
});
|
|
693
|
+
}
|
|
583
694
|
export function renderVvocConfig(config = createDefaultVvocConfig()) {
|
|
584
695
|
const web = createWebConfig(config.web);
|
|
585
696
|
const systemone = createSystemOneConfig(config.systemone);
|
|
697
|
+
const telegram = createTelegramConfig(config.telegram);
|
|
586
698
|
return renderJson({
|
|
587
699
|
$schema: VVOC_CONFIG_SCHEMA_URL,
|
|
588
700
|
version: VVOC_CONFIG_VERSION,
|
|
@@ -594,6 +706,7 @@ export function renderVvocConfig(config = createDefaultVvocConfig()) {
|
|
|
594
706
|
plugins: config.plugins,
|
|
595
707
|
...(web ? { web } : {}),
|
|
596
708
|
...(systemone ? { systemone } : {}),
|
|
709
|
+
...(telegram ? { telegram } : {}),
|
|
597
710
|
});
|
|
598
711
|
}
|
|
599
712
|
// END_BLOCK_CANONICAL_CONFIG_PARSE_RENDER
|
|
@@ -624,6 +737,7 @@ function normalizeStrictVvocConfig(value) {
|
|
|
624
737
|
plugins: createPluginToggleConfig(value.plugins),
|
|
625
738
|
web: createWebConfig(value.web),
|
|
626
739
|
systemone: createSystemOneConfig(value.systemone),
|
|
740
|
+
telegram: createTelegramConfig(value.telegram),
|
|
627
741
|
},
|
|
628
742
|
};
|
|
629
743
|
}
|