@osovv/vv-opencode 2.2.1 → 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.
Files changed (40) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/README.md +46 -2
  3. package/dist/index.d.ts +1 -0
  4. package/dist/index.js +6 -3
  5. package/dist/index.js.map +1 -1
  6. package/dist/lib/plugin-toggle-config.d.ts +1 -1
  7. package/dist/lib/plugin-toggle-config.js +3 -1
  8. package/dist/lib/plugin-toggle-config.js.map +1 -1
  9. package/dist/lib/vvoc-config.d.ts +89 -0
  10. package/dist/lib/vvoc-config.js +121 -1
  11. package/dist/lib/vvoc-config.js.map +1 -1
  12. package/dist/plugins/telegram/bot-api.d.ts +162 -0
  13. package/dist/plugins/telegram/bot-api.js +273 -0
  14. package/dist/plugins/telegram/bot-api.js.map +1 -0
  15. package/dist/plugins/telegram/commands.d.ts +167 -0
  16. package/dist/plugins/telegram/commands.js +709 -0
  17. package/dist/plugins/telegram/commands.js.map +1 -0
  18. package/dist/plugins/telegram/config.d.ts +38 -0
  19. package/dist/plugins/telegram/config.js +86 -0
  20. package/dist/plugins/telegram/config.js.map +1 -0
  21. package/dist/plugins/telegram/delivery.d.ts +121 -0
  22. package/dist/plugins/telegram/delivery.js +395 -0
  23. package/dist/plugins/telegram/delivery.js.map +1 -0
  24. package/dist/plugins/telegram/gateway.d.ts +61 -0
  25. package/dist/plugins/telegram/gateway.js +230 -0
  26. package/dist/plugins/telegram/gateway.js.map +1 -0
  27. package/dist/plugins/telegram/index.d.ts +110 -0
  28. package/dist/plugins/telegram/index.js +390 -0
  29. package/dist/plugins/telegram/index.js.map +1 -0
  30. package/dist/plugins/telegram/sessions.d.ts +147 -0
  31. package/dist/plugins/telegram/sessions.js +322 -0
  32. package/dist/plugins/telegram/sessions.js.map +1 -0
  33. package/dist/plugins/telegram/topology.d.ts +116 -0
  34. package/dist/plugins/telegram/topology.js +339 -0
  35. package/dist/plugins/telegram/topology.js.map +1 -0
  36. package/dist/plugins/web-tools/schemas.d.ts +19 -19
  37. package/dist/plugins/workflow/results.d.ts +39 -39
  38. package/package.json +6 -1
  39. package/schemas/vvoc/v3.json +89 -9
  40. package/templates/skills/vv-execute/references/tool-contracts.md +1 -1
@@ -0,0 +1,167 @@
1
+ import type { TelegramCallbackQuery, TelegramTransport } from "./bot-api.js";
2
+ import type { TelegramDelivery } from "./delivery.js";
3
+ import type { SessionBridge } from "./sessions.js";
4
+ import type { TelegramTopology } from "./topology.js";
5
+ /** Injectable native project listing and session creation. */
6
+ export interface NativeProjectSurface {
7
+ listProjects(): Promise<readonly {
8
+ readonly id: string;
9
+ readonly directory: string;
10
+ }[]>;
11
+ createSession(input: {
12
+ readonly directory: string;
13
+ }): Promise<{
14
+ readonly id: string;
15
+ }>;
16
+ }
17
+ /** Injectable native model listing. */
18
+ export interface NativeModelSurface {
19
+ listModels(): Promise<readonly {
20
+ readonly providerID: string;
21
+ readonly modelID: string;
22
+ }[]>;
23
+ }
24
+ /** Injectable native message listing, revert, and fork. */
25
+ export interface NativeHistorySurface {
26
+ listUserMessages(input: {
27
+ readonly sessionID: string;
28
+ }): Promise<readonly {
29
+ readonly messageID: string;
30
+ readonly text: string;
31
+ }[]>;
32
+ revert(input: {
33
+ readonly sessionID: string;
34
+ readonly messageID: string;
35
+ }): Promise<void>;
36
+ fork(input: {
37
+ readonly sessionID: string;
38
+ readonly messageID: string;
39
+ }): Promise<{
40
+ readonly id: string;
41
+ }>;
42
+ }
43
+ /** Injectable native permission list and reply. */
44
+ export interface NativePermissionSurface {
45
+ listPending(input: {
46
+ readonly sessionID: string;
47
+ }): Promise<readonly {
48
+ readonly requestID: string;
49
+ readonly summary?: string;
50
+ }[]>;
51
+ reply(input: {
52
+ readonly sessionID: string;
53
+ readonly requestID: string;
54
+ readonly reply: "once" | "always" | "reject";
55
+ }): Promise<void>;
56
+ }
57
+ /** Injectable native question reply. */
58
+ export interface NativeQuestionSurface {
59
+ reply(input: {
60
+ readonly sessionID: string;
61
+ readonly questionID: string;
62
+ readonly answer: string;
63
+ }): Promise<void>;
64
+ }
65
+ /** Pure callback-data builder for permission actions. */
66
+ export declare function permissionCallbackData(requestID: string, action: "once" | "always" | "reject"): string;
67
+ /** Pure callback-data builder for question options. */
68
+ export declare function questionCallbackData(questionID: string, optionIndex: number): string;
69
+ /** Pure callback-data builder for the custom-answer action. */
70
+ export declare function questionCustomCallbackData(questionID: string): string;
71
+ /** Pure callback-data parser shared by interactions and pickers. */
72
+ export declare function parseCallbackData(data: string): {
73
+ readonly kind: "permission";
74
+ readonly id: string;
75
+ readonly action: "once" | "always" | "reject";
76
+ } | {
77
+ readonly kind: "question";
78
+ readonly id: string;
79
+ readonly optionIndex: number;
80
+ } | {
81
+ readonly kind: "question-custom";
82
+ readonly id: string;
83
+ } | undefined;
84
+ /**
85
+ * Permission and question prompts. Every decision is manual: buttons call the
86
+ * native surfaces, a failed reply keeps the prompt answerable with a warning,
87
+ * and a prompt that disappears outside Telegram closes truthfully. Choosing the
88
+ * custom answer opens the topic input gate so the next plain message becomes
89
+ * the answer instead of a prompt.
90
+ */
91
+ export declare class TelegramInteractions {
92
+ #private;
93
+ constructor(deps: {
94
+ transport: TelegramTransport;
95
+ topology: TelegramTopology;
96
+ permissions: NativePermissionSurface;
97
+ questions: NativeQuestionSurface;
98
+ });
99
+ /** Whether a topic currently holds the input gate for a custom answer. */
100
+ isGated(threadId: number): boolean;
101
+ onPermissionEvent(input: {
102
+ readonly sessionID: string;
103
+ readonly requestID: string | undefined;
104
+ readonly phase: "requested" | "resolved";
105
+ readonly summary: string | undefined;
106
+ }): Promise<void>;
107
+ onQuestionEvent(input: {
108
+ readonly sessionID: string;
109
+ readonly questionID: string | undefined;
110
+ readonly phase: "requested" | "resolved";
111
+ readonly prompt: string | undefined;
112
+ readonly options: readonly string[];
113
+ }): Promise<void>;
114
+ /** Handle one owner callback query routed here by the command layer. */
115
+ handleCallback(query: TelegramCallbackQuery): Promise<void>;
116
+ /** Consume a gated plain message as the custom answer; returns true when consumed. */
117
+ consumeGatedText(threadId: number, text: string): Promise<boolean>;
118
+ /** Re-render still-pending native permission prompts after a restart. */
119
+ resurfacePending(sessionIDs: readonly string[]): Promise<void>;
120
+ }
121
+ type Schedule = (fn: () => void, ms: number) => void;
122
+ /**
123
+ * Command dispatch for the General and session topics. Plain text in a session
124
+ * topic is consumed by the custom-answer gate first, then coalesced through the
125
+ * per-topic merge window before admission as a prompt.
126
+ */
127
+ export declare class TelegramCommands {
128
+ #private;
129
+ constructor(deps: {
130
+ transport: TelegramTransport;
131
+ topology: TelegramTopology;
132
+ delivery: TelegramDelivery;
133
+ bridge: SessionBridge;
134
+ interactions: TelegramInteractions;
135
+ projects: NativeProjectSurface;
136
+ models: NativeModelSurface;
137
+ history: NativeHistorySurface;
138
+ reads: {
139
+ listSessions(): Promise<readonly {
140
+ id: string;
141
+ title: string | undefined;
142
+ timeUpdatedMs: number;
143
+ parentID: string | undefined;
144
+ }[]>;
145
+ activeSessionIds(): Promise<readonly string[]>;
146
+ };
147
+ clock: {
148
+ now(): number;
149
+ };
150
+ schedule?: Schedule;
151
+ maxAttachmentBytes?: number;
152
+ maxAttachments?: number;
153
+ });
154
+ /** Route one owner message; the caller has already verified the sender. */
155
+ handleMessage(input: {
156
+ readonly threadId: number;
157
+ readonly text: string | undefined;
158
+ readonly attachments?: readonly {
159
+ readonly fileId: string;
160
+ readonly filename: string | undefined;
161
+ readonly mimeType: string | undefined;
162
+ }[];
163
+ }): Promise<void>;
164
+ /** Route one owner callback query to pickers or the interactions layer. */
165
+ handleCallback(query: TelegramCallbackQuery): Promise<void>;
166
+ }
167
+ export {};