@llmguard/opencode 0.0.0-stage → 0.1.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/MANUAL-TEST-G.md +167 -0
- package/README.md +334 -2
- package/RELEASE.md +122 -0
- package/bin/darwin-amd64/helper +0 -0
- package/bin/darwin-arm64/helper +0 -0
- package/bin/linux-amd64/helper +0 -0
- package/bin/linux-arm64/helper +0 -0
- package/bin/manifest.json +51 -0
- package/bin/windows-amd64/helper.exe +0 -0
- package/bin/windows-arm64/helper.exe +0 -0
- package/bridge/client.d.ts +55 -0
- package/bridge/client.js +425 -0
- package/bridge/framing.d.ts +19 -0
- package/bridge/framing.js +110 -0
- package/bridge/process.d.ts +38 -0
- package/bridge/process.js +378 -0
- package/bridge/protocol.d.ts +184 -0
- package/bridge/protocol.js +683 -0
- package/connection-catalog.d.ts +69 -0
- package/connection-catalog.js +287 -0
- package/connections-tui.d.ts +11 -0
- package/connections-tui.js +394 -0
- package/demasking.d.ts +2 -0
- package/demasking.js +445 -0
- package/gui-experimental.cjs +33 -0
- package/hook-trace.d.ts +2 -0
- package/hook-trace.js +35 -0
- package/index.d.ts +1 -0
- package/index.js +1 -0
- package/licenses/Go-LICENSE +27 -0
- package/messages.d.ts +230 -0
- package/messages.js +231 -0
- package/native/index.d.ts +1 -0
- package/native/index.js +1 -0
- package/native/tui.d.ts +1 -0
- package/native/tui.js +1 -0
- package/package.json +49 -4
- package/plugin-runtime.d.ts +3 -0
- package/plugin-runtime.js +3 -0
- package/plugin-settings.d.ts +77 -0
- package/plugin-settings.js +487 -0
- package/plugin.d.ts +41 -0
- package/plugin.js +10 -0
- package/response-diagnostics.d.ts +13 -0
- package/response-diagnostics.js +142 -0
- package/runtime/attachments.d.ts +4 -0
- package/runtime/attachments.js +19 -0
- package/runtime/errors.d.ts +18 -0
- package/runtime/errors.js +26 -0
- package/runtime/json.d.ts +14 -0
- package/runtime/json.js +243 -0
- package/runtime/limits.d.ts +2 -0
- package/runtime/limits.js +3 -0
- package/runtime/native-edit.d.ts +14 -0
- package/runtime/native-edit.js +73 -0
- package/runtime/runtime.d.ts +43 -0
- package/runtime/runtime.js +345 -0
- package/runtime/session-state.d.ts +13 -0
- package/runtime/session-state.js +73 -0
- package/runtime/text-layout.d.ts +9 -0
- package/runtime/text-layout.js +47 -0
- package/server.d.ts +1 -0
- package/server.js +1 -0
- package/settings-rpc.d.ts +511 -0
- package/settings-rpc.js +197 -0
- package/tui-messages.d.ts +1 -0
- package/tui-messages.js +84 -0
- package/tui.d.ts +17 -0
- package/tui.js +427 -0
- package/v1/hooks.d.ts +81 -0
- package/v1/hooks.js +97 -0
- package/v1/projection.d.ts +32 -0
- package/v1/projection.js +217 -0
- package/v1.d.ts +2 -0
- package/v1.js +2 -0
- package/v2/projection.d.ts +36 -0
- package/v2/projection.js +374 -0
- package/v2/server.d.ts +6 -0
- package/v2/server.js +633 -0
package/messages.d.ts
ADDED
|
@@ -0,0 +1,230 @@
|
|
|
1
|
+
export declare const catalog: {
|
|
2
|
+
en: {
|
|
3
|
+
filesTitle: string;
|
|
4
|
+
filesInspect: string;
|
|
5
|
+
filesOff: string;
|
|
6
|
+
filesOn: string;
|
|
7
|
+
filesUninspectable: string;
|
|
8
|
+
filesBlock: string;
|
|
9
|
+
filesAllow: string;
|
|
10
|
+
filesNote: string;
|
|
11
|
+
filesAllowNote: string;
|
|
12
|
+
filesEnv: string;
|
|
13
|
+
filesDamaged: string;
|
|
14
|
+
filesSavedOn: string;
|
|
15
|
+
filesSavedOff: string;
|
|
16
|
+
catalogTitle: string;
|
|
17
|
+
catalogAdd: string;
|
|
18
|
+
catalogSearch: string;
|
|
19
|
+
catalogSearchPlaceholder: string;
|
|
20
|
+
catalogNoResults: string;
|
|
21
|
+
catalogEmpty: string;
|
|
22
|
+
catalogNew: string;
|
|
23
|
+
catalogName: string;
|
|
24
|
+
catalogServer: string;
|
|
25
|
+
catalogSave: string;
|
|
26
|
+
catalogCancel: string;
|
|
27
|
+
catalogConnect: string;
|
|
28
|
+
catalogDisconnect: string;
|
|
29
|
+
catalogCheck: string;
|
|
30
|
+
catalogRetry: string;
|
|
31
|
+
catalogActive: string;
|
|
32
|
+
catalogKeyAvailable: string;
|
|
33
|
+
catalogKeyRequired: string;
|
|
34
|
+
catalogKeepKey: string;
|
|
35
|
+
catalogEnterKey: string;
|
|
36
|
+
catalogDiscardConfirm: string;
|
|
37
|
+
catalogDisconnectConfirm: string;
|
|
38
|
+
catalogDiscard: string;
|
|
39
|
+
catalogContinue: string;
|
|
40
|
+
catalogDisconnected: string;
|
|
41
|
+
catalogConflict: string;
|
|
42
|
+
catalogOutcomeUnknown: string;
|
|
43
|
+
catalogSaved: string;
|
|
44
|
+
catalogConnected: string;
|
|
45
|
+
catalogChecked: string;
|
|
46
|
+
catalogRoute: string;
|
|
47
|
+
catalogNone: string;
|
|
48
|
+
statusFailed: string;
|
|
49
|
+
unsavedChanges: string;
|
|
50
|
+
discardChanges: string;
|
|
51
|
+
saveDraftHint: string;
|
|
52
|
+
activeDraftHint: string;
|
|
53
|
+
inactiveDraftHint: string;
|
|
54
|
+
keyDraftHint: string;
|
|
55
|
+
testDraftHint: string;
|
|
56
|
+
connectionSaved: string;
|
|
57
|
+
keySaved: string;
|
|
58
|
+
settings: string;
|
|
59
|
+
actionFailed: string;
|
|
60
|
+
protection: string;
|
|
61
|
+
protectionDescription: string;
|
|
62
|
+
statusUnavailable: string;
|
|
63
|
+
loading: string;
|
|
64
|
+
enabled: string;
|
|
65
|
+
blocked: string;
|
|
66
|
+
disabled: string;
|
|
67
|
+
requests: string;
|
|
68
|
+
noConnection: string;
|
|
69
|
+
loadingStatus: string;
|
|
70
|
+
checksDescription: string;
|
|
71
|
+
blockedDescription: string;
|
|
72
|
+
disabledDescription: string;
|
|
73
|
+
enable: string;
|
|
74
|
+
connection: string;
|
|
75
|
+
connectionDescription: string;
|
|
76
|
+
noData: string;
|
|
77
|
+
environment: string;
|
|
78
|
+
connectionSet: string;
|
|
79
|
+
setupRequired: string;
|
|
80
|
+
connectionEnvironment: string;
|
|
81
|
+
urlExample: string;
|
|
82
|
+
projectSID: string;
|
|
83
|
+
transport: string;
|
|
84
|
+
transportDescription: string;
|
|
85
|
+
allowHTTP: string;
|
|
86
|
+
accessKey: string;
|
|
87
|
+
keyDescription: string;
|
|
88
|
+
keySet: string;
|
|
89
|
+
keyMissing: string;
|
|
90
|
+
guardKey: string;
|
|
91
|
+
serverEnvironment: string;
|
|
92
|
+
untilRestart: string;
|
|
93
|
+
keyStorage: string;
|
|
94
|
+
catalogRestoreKey: string;
|
|
95
|
+
catalogSaveKey: string;
|
|
96
|
+
connectionTest: string;
|
|
97
|
+
testDescription: string;
|
|
98
|
+
available: string;
|
|
99
|
+
testFailed: string;
|
|
100
|
+
checking: string;
|
|
101
|
+
notChecked: string;
|
|
102
|
+
testingConnection: string;
|
|
103
|
+
timeout: string;
|
|
104
|
+
guardTestFailed: string;
|
|
105
|
+
testError: string;
|
|
106
|
+
testing: string;
|
|
107
|
+
testConnection: string;
|
|
108
|
+
testHint: string;
|
|
109
|
+
intro: string;
|
|
110
|
+
saveConnection: string;
|
|
111
|
+
setKey: string;
|
|
112
|
+
refreshStatus: string;
|
|
113
|
+
keySource: string;
|
|
114
|
+
testDecision: string;
|
|
115
|
+
};
|
|
116
|
+
ru: {
|
|
117
|
+
filesTitle: string;
|
|
118
|
+
filesInspect: string;
|
|
119
|
+
filesOff: string;
|
|
120
|
+
filesOn: string;
|
|
121
|
+
filesUninspectable: string;
|
|
122
|
+
filesBlock: string;
|
|
123
|
+
filesAllow: string;
|
|
124
|
+
filesNote: string;
|
|
125
|
+
filesAllowNote: string;
|
|
126
|
+
filesEnv: string;
|
|
127
|
+
filesDamaged: string;
|
|
128
|
+
filesSavedOn: string;
|
|
129
|
+
filesSavedOff: string;
|
|
130
|
+
catalogTitle: string;
|
|
131
|
+
catalogAdd: string;
|
|
132
|
+
catalogSearch: string;
|
|
133
|
+
catalogSearchPlaceholder: string;
|
|
134
|
+
catalogNoResults: string;
|
|
135
|
+
catalogEmpty: string;
|
|
136
|
+
catalogNew: string;
|
|
137
|
+
catalogName: string;
|
|
138
|
+
catalogServer: string;
|
|
139
|
+
catalogSave: string;
|
|
140
|
+
catalogCancel: string;
|
|
141
|
+
catalogConnect: string;
|
|
142
|
+
catalogDisconnect: string;
|
|
143
|
+
catalogCheck: string;
|
|
144
|
+
catalogRetry: string;
|
|
145
|
+
catalogActive: string;
|
|
146
|
+
catalogKeyAvailable: string;
|
|
147
|
+
catalogKeyRequired: string;
|
|
148
|
+
catalogKeepKey: string;
|
|
149
|
+
catalogEnterKey: string;
|
|
150
|
+
catalogDiscardConfirm: string;
|
|
151
|
+
catalogDisconnectConfirm: string;
|
|
152
|
+
catalogDiscard: string;
|
|
153
|
+
catalogContinue: string;
|
|
154
|
+
catalogDisconnected: string;
|
|
155
|
+
catalogConflict: string;
|
|
156
|
+
catalogOutcomeUnknown: string;
|
|
157
|
+
catalogSaved: string;
|
|
158
|
+
catalogConnected: string;
|
|
159
|
+
catalogChecked: string;
|
|
160
|
+
catalogRoute: string;
|
|
161
|
+
catalogNone: string;
|
|
162
|
+
statusFailed: string;
|
|
163
|
+
unsavedChanges: string;
|
|
164
|
+
discardChanges: string;
|
|
165
|
+
saveDraftHint: string;
|
|
166
|
+
activeDraftHint: string;
|
|
167
|
+
inactiveDraftHint: string;
|
|
168
|
+
keyDraftHint: string;
|
|
169
|
+
testDraftHint: string;
|
|
170
|
+
connectionSaved: string;
|
|
171
|
+
keySaved: string;
|
|
172
|
+
settings: string;
|
|
173
|
+
actionFailed: string;
|
|
174
|
+
protection: string;
|
|
175
|
+
protectionDescription: string;
|
|
176
|
+
statusUnavailable: string;
|
|
177
|
+
loading: string;
|
|
178
|
+
enabled: string;
|
|
179
|
+
blocked: string;
|
|
180
|
+
disabled: string;
|
|
181
|
+
requests: string;
|
|
182
|
+
noConnection: string;
|
|
183
|
+
loadingStatus: string;
|
|
184
|
+
checksDescription: string;
|
|
185
|
+
blockedDescription: string;
|
|
186
|
+
disabledDescription: string;
|
|
187
|
+
enable: string;
|
|
188
|
+
connection: string;
|
|
189
|
+
connectionDescription: string;
|
|
190
|
+
noData: string;
|
|
191
|
+
environment: string;
|
|
192
|
+
connectionSet: string;
|
|
193
|
+
setupRequired: string;
|
|
194
|
+
connectionEnvironment: string;
|
|
195
|
+
urlExample: string;
|
|
196
|
+
projectSID: string;
|
|
197
|
+
transport: string;
|
|
198
|
+
transportDescription: string;
|
|
199
|
+
allowHTTP: string;
|
|
200
|
+
accessKey: string;
|
|
201
|
+
keyDescription: string;
|
|
202
|
+
keySet: string;
|
|
203
|
+
keyMissing: string;
|
|
204
|
+
guardKey: string;
|
|
205
|
+
serverEnvironment: string;
|
|
206
|
+
untilRestart: string;
|
|
207
|
+
keyStorage: string;
|
|
208
|
+
catalogRestoreKey: string;
|
|
209
|
+
catalogSaveKey: string;
|
|
210
|
+
connectionTest: string;
|
|
211
|
+
testDescription: string;
|
|
212
|
+
available: string;
|
|
213
|
+
testFailed: string;
|
|
214
|
+
checking: string;
|
|
215
|
+
notChecked: string;
|
|
216
|
+
testingConnection: string;
|
|
217
|
+
timeout: string;
|
|
218
|
+
guardTestFailed: string;
|
|
219
|
+
testError: string;
|
|
220
|
+
testing: string;
|
|
221
|
+
testConnection: string;
|
|
222
|
+
testHint: string;
|
|
223
|
+
intro: string;
|
|
224
|
+
saveConnection: string;
|
|
225
|
+
setKey: string;
|
|
226
|
+
refreshStatus: string;
|
|
227
|
+
keySource: string;
|
|
228
|
+
testDecision: string;
|
|
229
|
+
};
|
|
230
|
+
};
|
package/messages.js
ADDED
|
@@ -0,0 +1,231 @@
|
|
|
1
|
+
// OpenCode selects the interface language; English is the host fallback.
|
|
2
|
+
export const catalog = {
|
|
3
|
+
en: {
|
|
4
|
+
filesTitle: "Attachments",
|
|
5
|
+
filesInspect: "Inspect files and images",
|
|
6
|
+
filesOff: "Off",
|
|
7
|
+
filesOn: "On",
|
|
8
|
+
filesUninspectable: "When a file cannot be inspected",
|
|
9
|
+
filesBlock: "Block",
|
|
10
|
+
filesAllow: "Let through",
|
|
11
|
+
filesNote: "If a file fails inspection or a rule matches its text, the request is rejected; otherwise the provider gets the original.",
|
|
12
|
+
filesAllowNote: "Unsupported types, links and file ids go to the provider without inspection. Service failures and rule matches still stop the request.",
|
|
13
|
+
filesEnv: "Set by LLMGUARD_FILE_INSPECTION and LLMGUARD_FILE_UNINSPECTABLE; settings do not change it.",
|
|
14
|
+
filesDamaged: "The settings file is damaged: strict mode is in effect. Choose values to replace it.",
|
|
15
|
+
filesSavedOn: "Attachment inspection is on. It applies to the next request.",
|
|
16
|
+
filesSavedOff: "Attachment inspection is off. Files pass as before.",
|
|
17
|
+
catalogTitle: "Connections",
|
|
18
|
+
catalogAdd: "Add connection",
|
|
19
|
+
catalogSearch: "Search connections",
|
|
20
|
+
catalogSearchPlaceholder: "Name, server or SID",
|
|
21
|
+
catalogNoResults: "No connections found",
|
|
22
|
+
catalogEmpty: "Add your first connection",
|
|
23
|
+
catalogNew: "New connection",
|
|
24
|
+
catalogName: "Name",
|
|
25
|
+
catalogServer: "Server",
|
|
26
|
+
catalogSave: "Save",
|
|
27
|
+
catalogCancel: "Cancel",
|
|
28
|
+
catalogConnect: "Connect",
|
|
29
|
+
catalogDisconnect: "Disconnect",
|
|
30
|
+
catalogCheck: "Check",
|
|
31
|
+
catalogRetry: "Retry",
|
|
32
|
+
catalogActive: "Connected",
|
|
33
|
+
catalogKeyAvailable: "Key available",
|
|
34
|
+
catalogKeyRequired: "Key required",
|
|
35
|
+
catalogKeepKey: "Leave blank to keep this connection’s key",
|
|
36
|
+
catalogEnterKey: "Enter a project key",
|
|
37
|
+
catalogDiscardConfirm: "Discard the unsaved changes? Saved connections will stay unchanged.",
|
|
38
|
+
catalogDisconnectConfirm: "Disconnect protection for all sessions on this server? Requests will pass without Guard checks.",
|
|
39
|
+
catalogDiscard: "Discard changes",
|
|
40
|
+
catalogContinue: "Continue editing",
|
|
41
|
+
catalogDisconnected: "Protection disconnected",
|
|
42
|
+
catalogConflict: "The connection list changed. Cancel the draft and review the latest saved settings.",
|
|
43
|
+
catalogOutcomeUnknown: "Action outcome unknown. Review the list before retrying. Your draft has been kept; re-enter the key if needed.",
|
|
44
|
+
catalogSaved: "Connection saved. Active route unchanged.",
|
|
45
|
+
catalogConnected: "Connected to {{name}}. Protection enabled.",
|
|
46
|
+
catalogChecked: "{{name}} is reachable · test decision: {{decision}}. Active route unchanged.",
|
|
47
|
+
catalogRoute: "Route: {{name}}",
|
|
48
|
+
catalogNone: "not configured",
|
|
49
|
+
statusFailed: "Status unavailable. Check the server plugin and refresh. Your input has been kept.",
|
|
50
|
+
unsavedChanges: "Unapplied changes",
|
|
51
|
+
discardChanges: "Discard changes",
|
|
52
|
+
saveDraftHint: "Saving applies this connection and turns protection off. You can enable it again above.",
|
|
53
|
+
activeDraftHint: "Protection uses the saved settings. Your changes have not been applied yet.",
|
|
54
|
+
inactiveDraftHint: "Apply or discard your changes before enabling protection.",
|
|
55
|
+
keyDraftHint: "The new key has not been applied. Select Set key to replace the current key and turn protection off.",
|
|
56
|
+
testDraftHint: "This check uses the saved connection and key. Apply or discard your changes first.",
|
|
57
|
+
connectionSaved: "Connection saved. Check the connection before enabling protection.",
|
|
58
|
+
keySaved: "Key applied. Check the connection before enabling protection.",
|
|
59
|
+
settings: "LLMGuard: settings and status",
|
|
60
|
+
actionFailed: "Action failed. Check the connection and server plugin availability.",
|
|
61
|
+
protection: "Protection",
|
|
62
|
+
protectionDescription: "Check requests and tools across all sessions on this server.",
|
|
63
|
+
statusUnavailable: "Status unavailable",
|
|
64
|
+
loading: "Loading…",
|
|
65
|
+
enabled: "Protection enabled",
|
|
66
|
+
blocked: "Operations blocked",
|
|
67
|
+
disabled: "Protection disabled",
|
|
68
|
+
requests: "Request checks",
|
|
69
|
+
noConnection: "Cannot reach the server plugin. Refresh the status.",
|
|
70
|
+
loadingStatus: "Retrieving server plugin status.",
|
|
71
|
+
checksDescription: "Guard checks selected text fields before they are sent.",
|
|
72
|
+
blockedDescription: "Protection is enabled but the connection is not ready. Configure the connection and key; operations remain blocked until then.",
|
|
73
|
+
disabledDescription: "Requests pass without Guard checks. Configure the connection and enable protection.",
|
|
74
|
+
enable: "Enable protection",
|
|
75
|
+
connection: "Connection",
|
|
76
|
+
connectionDescription: "Guard address and LLMGuard project. Saving changes disables protection until you enable it again.",
|
|
77
|
+
noData: "No data",
|
|
78
|
+
environment: "From environment",
|
|
79
|
+
connectionSet: "Connection configured",
|
|
80
|
+
setupRequired: "Setup required",
|
|
81
|
+
connectionEnvironment: "Connection is configured by the server environment",
|
|
82
|
+
urlExample: "For example, https://guard.example.com",
|
|
83
|
+
projectSID: "Project SID",
|
|
84
|
+
transport: "Connection protocol",
|
|
85
|
+
transportDescription: "For Guard without TLS; HTTPS is required by default",
|
|
86
|
+
allowHTTP: "Allow HTTP",
|
|
87
|
+
accessKey: "Access key",
|
|
88
|
+
keyDescription: "The key is sent to the server plugin and is not written to chat. Replacing the key disables protection.",
|
|
89
|
+
keySet: "Key configured",
|
|
90
|
+
keyMissing: "Key not configured",
|
|
91
|
+
guardKey: "Guard key",
|
|
92
|
+
serverEnvironment: "server environment",
|
|
93
|
+
untilRestart: "saved locally",
|
|
94
|
+
keyStorage: "The key is saved locally on the OpenCode server",
|
|
95
|
+
catalogRestoreKey: "Enter the key and save to enable Connect and Check.",
|
|
96
|
+
catalogSaveKey: "Save the key first, then connect or check this profile.",
|
|
97
|
+
connectionTest: "Connection test",
|
|
98
|
+
testDescription: "Sends only fixed test text. Session content is not sent.",
|
|
99
|
+
available: "Guard is available",
|
|
100
|
+
testFailed: "Test failed",
|
|
101
|
+
checking: "Checking…",
|
|
102
|
+
notChecked: "Connection not tested",
|
|
103
|
+
testingConnection: "Testing the connection to Guard…",
|
|
104
|
+
timeout: "The test timed out. Guard did not respond in time.",
|
|
105
|
+
guardTestFailed: "Guard test failed. Check the address, key and server availability.",
|
|
106
|
+
testError: "Could not run the test. Check server plugin availability.",
|
|
107
|
+
testing: "Testing…",
|
|
108
|
+
testConnection: "Test connection",
|
|
109
|
+
testHint: "No test has been run yet. Configure the connection and key, then click “Test connection”.",
|
|
110
|
+
intro: "One connection and shared protection for all OpenCode projects and sessions.",
|
|
111
|
+
saveConnection: "Save connection",
|
|
112
|
+
setKey: "Set key",
|
|
113
|
+
refreshStatus: "Refresh status",
|
|
114
|
+
keySource: "Key configured: {{source}}. A new key disables protection.",
|
|
115
|
+
testDecision: "Guard is available. Decision for the test text: {{decision}}.",
|
|
116
|
+
},
|
|
117
|
+
ru: {
|
|
118
|
+
filesTitle: "Вложения",
|
|
119
|
+
filesInspect: "Проверять файлы и изображения",
|
|
120
|
+
filesOff: "Выключена",
|
|
121
|
+
filesOn: "Включена",
|
|
122
|
+
filesUninspectable: "Если файл нельзя проверить",
|
|
123
|
+
filesBlock: "Блокировать",
|
|
124
|
+
filesAllow: "Пропускать",
|
|
125
|
+
filesNote: "Если файл не прошёл проверку или правило сработало на его тексте, запрос отклоняется; иначе провайдер получает оригинал.",
|
|
126
|
+
filesAllowNote: "Неподдерживаемые типы, ссылки и идентификаторы файлов уходят провайдеру без проверки. Сбои проверки и срабатывания правил запрос всё равно останавливают.",
|
|
127
|
+
filesEnv: "Задано переменными LLMGUARD_FILE_INSPECTION и LLMGUARD_FILE_UNINSPECTABLE; настройки их не меняют.",
|
|
128
|
+
filesDamaged: "Файл настроек повреждён: действует строгий режим. Выберите значения, чтобы заменить его.",
|
|
129
|
+
filesSavedOn: "Проверка вложений включена. Она применится к следующему запросу.",
|
|
130
|
+
filesSavedOff: "Проверка вложений выключена. Файлы проходят как раньше.",
|
|
131
|
+
catalogTitle: "Подключения",
|
|
132
|
+
catalogAdd: "Добавить подключение",
|
|
133
|
+
catalogSearch: "Поиск подключений",
|
|
134
|
+
catalogSearchPlaceholder: "Название, сервер или SID",
|
|
135
|
+
catalogNoResults: "Ничего не найдено",
|
|
136
|
+
catalogEmpty: "Добавьте первое подключение",
|
|
137
|
+
catalogNew: "Новое подключение",
|
|
138
|
+
catalogName: "Название",
|
|
139
|
+
catalogServer: "Сервер",
|
|
140
|
+
catalogSave: "Сохранить",
|
|
141
|
+
catalogCancel: "Отмена",
|
|
142
|
+
catalogConnect: "Подключить",
|
|
143
|
+
catalogDisconnect: "Отключить",
|
|
144
|
+
catalogCheck: "Проверить",
|
|
145
|
+
catalogRetry: "Повторить",
|
|
146
|
+
catalogActive: "Подключён",
|
|
147
|
+
catalogKeyAvailable: "Ключ доступен",
|
|
148
|
+
catalogKeyRequired: "Нужен ключ",
|
|
149
|
+
catalogKeepKey: "Пусто — оставить ключ этого подключения",
|
|
150
|
+
catalogEnterKey: "Введите ключ проекта",
|
|
151
|
+
catalogDiscardConfirm: "Отбросить несохранённые изменения? Сохранённые подключения останутся прежними.",
|
|
152
|
+
catalogDisconnectConfirm: "Отключить защиту для всех сессий этого сервера? Запросы будут проходить без проверки Guard.",
|
|
153
|
+
catalogDiscard: "Отбросить изменения",
|
|
154
|
+
catalogContinue: "Продолжить редактирование",
|
|
155
|
+
catalogDisconnected: "Защита отключена",
|
|
156
|
+
catalogConflict: "Список подключений изменился. Отмените черновик и проверьте актуальные сохранённые настройки.",
|
|
157
|
+
catalogOutcomeUnknown: "Результат действия неизвестен. Проверьте список перед повтором. Черновик сохранён; при необходимости введите ключ заново.",
|
|
158
|
+
catalogSaved: "Подключение сохранено. Активный маршрут не изменён.",
|
|
159
|
+
catalogConnected: "Подключено: {{name}}. Защита включена.",
|
|
160
|
+
catalogChecked: "{{name}} доступен · решение теста: {{decision}}. Активный маршрут не изменён.",
|
|
161
|
+
catalogRoute: "Маршрут: {{name}}",
|
|
162
|
+
catalogNone: "не задан",
|
|
163
|
+
statusFailed: "Статус недоступен. Проверьте серверный плагин и обновите статус. Введённые данные сохранены в форме.",
|
|
164
|
+
unsavedChanges: "Есть неприменённые изменения",
|
|
165
|
+
discardChanges: "Отменить изменения",
|
|
166
|
+
saveDraftHint: "Сохранение применит подключение и выключит защиту. Включить её снова можно выше.",
|
|
167
|
+
activeDraftHint: "Защита использует сохранённые настройки. Изменения в форме ещё не применены.",
|
|
168
|
+
inactiveDraftHint: "Примените или отмените изменения перед включением защиты.",
|
|
169
|
+
keyDraftHint: "Новый ключ ещё не применён. Нажмите «Задать ключ», чтобы заменить текущий ключ и выключить защиту.",
|
|
170
|
+
testDraftHint: "Проверка использует сохранённое подключение и ключ. Сначала примените или отмените изменения.",
|
|
171
|
+
connectionSaved: "Подключение сохранено. Проверьте связь перед включением защиты.",
|
|
172
|
+
keySaved: "Ключ применён. Проверьте связь перед включением защиты.",
|
|
173
|
+
settings: "LLMGuard: настройки и статус",
|
|
174
|
+
actionFailed: "Не удалось выполнить действие. Проверьте подключение и доступность серверного плагина.",
|
|
175
|
+
protection: "Защита",
|
|
176
|
+
protectionDescription: "Проверка запросов и инструментов во всех сессиях этого сервера.",
|
|
177
|
+
statusUnavailable: "Статус недоступен",
|
|
178
|
+
loading: "Загрузка…",
|
|
179
|
+
enabled: "Защита включена",
|
|
180
|
+
blocked: "Операции заблокированы",
|
|
181
|
+
disabled: "Защита выключена",
|
|
182
|
+
requests: "Проверка запросов",
|
|
183
|
+
noConnection: "Нет связи с серверным плагином. Обновите статус.",
|
|
184
|
+
loadingStatus: "Получаем состояние серверного плагина.",
|
|
185
|
+
checksDescription: "Выбранные текстовые поля проверяются Guard перед отправкой.",
|
|
186
|
+
blockedDescription: "Защита включена, но подключение не готово. Настройте подключение и ключ: до этого операции блокируются.",
|
|
187
|
+
disabledDescription: "Запросы проходят без проверки Guard. Настройте подключение и включите защиту.",
|
|
188
|
+
enable: "Включить защиту",
|
|
189
|
+
connection: "Подключение",
|
|
190
|
+
connectionDescription: "Адрес Guard и проект LLMGuard. Сохранение изменений выключает защиту до повторного включения.",
|
|
191
|
+
noData: "Нет данных",
|
|
192
|
+
environment: "Из окружения",
|
|
193
|
+
connectionSet: "Подключение задано",
|
|
194
|
+
setupRequired: "Требуется настройка",
|
|
195
|
+
connectionEnvironment: "Подключение задано окружением сервера",
|
|
196
|
+
urlExample: "Например, https://guard.example.com",
|
|
197
|
+
projectSID: "SID проекта",
|
|
198
|
+
transport: "Протокол подключения",
|
|
199
|
+
transportDescription: "Для Guard без TLS; по умолчанию требуется HTTPS",
|
|
200
|
+
allowHTTP: "Разрешить HTTP",
|
|
201
|
+
accessKey: "Ключ доступа",
|
|
202
|
+
keyDescription: "Ключ передаётся серверному плагину и не записывается в чат. Замена ключа выключает защиту.",
|
|
203
|
+
keySet: "Ключ задан",
|
|
204
|
+
keyMissing: "Ключ не задан",
|
|
205
|
+
guardKey: "Ключ Guard",
|
|
206
|
+
serverEnvironment: "окружение сервера",
|
|
207
|
+
untilRestart: "сохранён локально",
|
|
208
|
+
keyStorage: "Ключ сохранён локально на сервере OpenCode",
|
|
209
|
+
catalogRestoreKey: "Введите ключ и сохраните, чтобы подключиться или проверить.",
|
|
210
|
+
catalogSaveKey: "Сначала сохраните ключ, затем подключите или проверьте профиль.",
|
|
211
|
+
connectionTest: "Проверка связи",
|
|
212
|
+
testDescription: "Отправляет только фиксированный тестовый текст. Содержимое сессий не передаётся.",
|
|
213
|
+
available: "Guard доступен",
|
|
214
|
+
testFailed: "Проверка не пройдена",
|
|
215
|
+
checking: "Проверяем…",
|
|
216
|
+
notChecked: "Связь не проверена",
|
|
217
|
+
testingConnection: "Проверка подключения к Guard…",
|
|
218
|
+
timeout: "Время проверки истекло. Guard не ответил вовремя.",
|
|
219
|
+
guardTestFailed: "Проверка Guard не прошла. Проверьте адрес, ключ и доступность сервера.",
|
|
220
|
+
testError: "Не удалось выполнить проверку. Проверьте доступность серверного плагина.",
|
|
221
|
+
testing: "Проверка…",
|
|
222
|
+
testConnection: "Проверить связь",
|
|
223
|
+
testHint: "Проверка ещё не выполнялась. После настройки подключения и ключа нажмите «Проверить связь».",
|
|
224
|
+
intro: "Одно подключение и общая защита для всех проектов и сессий OpenCode.",
|
|
225
|
+
saveConnection: "Сохранить подключение",
|
|
226
|
+
setKey: "Задать ключ",
|
|
227
|
+
refreshStatus: "Обновить статус",
|
|
228
|
+
keySource: "Ключ задан: {{source}}. Новый ключ выключает защиту.",
|
|
229
|
+
testDecision: "Guard доступен. Решение для тестового текста: {{decision}}.",
|
|
230
|
+
},
|
|
231
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from "../server.js";
|
package/native/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from "../server.js";
|
package/native/tui.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from "../tui.js";
|
package/native/tui.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from "../tui.js";
|
package/package.json
CHANGED
|
@@ -1,6 +1,51 @@
|
|
|
1
1
|
{
|
|
2
|
+
"description": "LLMGuard native OpenCode plugin with bundled Go Guard core",
|
|
3
|
+
"engines": {
|
|
4
|
+
"node": "\u003e=24 \u003c25"
|
|
5
|
+
},
|
|
6
|
+
"exports": {
|
|
7
|
+
".": {
|
|
8
|
+
"import": "./index.js",
|
|
9
|
+
"types": "./index.d.ts"
|
|
10
|
+
},
|
|
11
|
+
"./gui-experimental": "./gui-experimental.cjs",
|
|
12
|
+
"./plugin": {
|
|
13
|
+
"import": "./plugin.js",
|
|
14
|
+
"types": "./plugin.d.ts"
|
|
15
|
+
},
|
|
16
|
+
"./rpc": {
|
|
17
|
+
"import": "./settings-rpc.js",
|
|
18
|
+
"types": "./settings-rpc.d.ts"
|
|
19
|
+
},
|
|
20
|
+
"./server": {
|
|
21
|
+
"import": "./server.js",
|
|
22
|
+
"types": "./server.d.ts"
|
|
23
|
+
},
|
|
24
|
+
"./settings-rpc": {
|
|
25
|
+
"import": "./settings-rpc.js",
|
|
26
|
+
"types": "./settings-rpc.d.ts"
|
|
27
|
+
},
|
|
28
|
+
"./tui": {
|
|
29
|
+
"import": "./tui.js",
|
|
30
|
+
"types": "./tui.d.ts"
|
|
31
|
+
},
|
|
32
|
+
"./v1": {
|
|
33
|
+
"import": "./v1.js",
|
|
34
|
+
"types": "./v1.d.ts"
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
"files": [
|
|
38
|
+
"gui-experimental.cjs",
|
|
39
|
+
"**/*.js",
|
|
40
|
+
"**/*.d.ts",
|
|
41
|
+
"bin/**",
|
|
42
|
+
"licenses/**",
|
|
43
|
+
"MANUAL-TEST-G.md",
|
|
44
|
+
"RELEASE.md"
|
|
45
|
+
],
|
|
46
|
+
"license": "UNLICENSED",
|
|
2
47
|
"name": "@llmguard/opencode",
|
|
3
|
-
"
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
}
|
|
48
|
+
"private": false,
|
|
49
|
+
"type": "module",
|
|
50
|
+
"version": "0.1.0"
|
|
51
|
+
}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { ConnectionCatalog, type ConnectionDocument } from "./connection-catalog.js";
|
|
2
|
+
import type { PluginOptions } from "./runtime/runtime.js";
|
|
3
|
+
export interface ConnectionProfile {
|
|
4
|
+
baseURL: string;
|
|
5
|
+
projectSID: string;
|
|
6
|
+
allowLoopbackHTTP: boolean;
|
|
7
|
+
}
|
|
8
|
+
export interface SettingsStatus extends ConnectionProfile {
|
|
9
|
+
configured: boolean;
|
|
10
|
+
enabled: boolean;
|
|
11
|
+
tokenPresent: boolean;
|
|
12
|
+
environmentOverride: boolean;
|
|
13
|
+
tokenSource: "environment" | "session" | "missing";
|
|
14
|
+
}
|
|
15
|
+
export interface SettingsStore {
|
|
16
|
+
get(key: string): Promise<unknown>;
|
|
17
|
+
set(key: string, value: ConnectionProfile | (ConnectionProfile & {
|
|
18
|
+
connectionID?: string;
|
|
19
|
+
token: string;
|
|
20
|
+
}) | boolean | ConnectionDocument): Promise<void>;
|
|
21
|
+
}
|
|
22
|
+
export declare class SettingsError extends Error {
|
|
23
|
+
constructor();
|
|
24
|
+
}
|
|
25
|
+
export type FilesPolicy = {
|
|
26
|
+
inspect: boolean;
|
|
27
|
+
allowUninspectable: boolean;
|
|
28
|
+
source: "default" | "file" | "env";
|
|
29
|
+
damaged: boolean;
|
|
30
|
+
};
|
|
31
|
+
export declare class PluginSettings {
|
|
32
|
+
#private;
|
|
33
|
+
readonly store: SettingsStore;
|
|
34
|
+
readonly cwd: string;
|
|
35
|
+
readonly connections: ConnectionCatalog;
|
|
36
|
+
constructor(store: SettingsStore, cwd: string, environment: Record<string, string | undefined>);
|
|
37
|
+
load(): Promise<void>;
|
|
38
|
+
gatewayConnection(): PluginOptions;
|
|
39
|
+
status(): SettingsStatus;
|
|
40
|
+
save(input: unknown): Promise<SettingsStatus>;
|
|
41
|
+
setKey(input: unknown): Promise<SettingsStatus>;
|
|
42
|
+
enforcing(): boolean;
|
|
43
|
+
setEnabled(input: unknown): Promise<SettingsStatus>;
|
|
44
|
+
files(signal?: AbortSignal): Promise<FilesPolicy>;
|
|
45
|
+
setFiles(input: unknown, signal?: AbortSignal): Promise<FilesPolicy>;
|
|
46
|
+
runtime(cwd?: string): {
|
|
47
|
+
deadline: (started?: number) => number;
|
|
48
|
+
checkModelTexts: (name: string, texts: string[], session: string | null, sourcePayload?: Record<string, import("./runtime/json.js").JsonValue>, commit?: (texts: string[], replacements: import("./bridge/protocol.js").AttachmentReplacement[]) => void, deadline?: number, attachments?: import("./bridge/protocol.js").AttachmentParam[]) => Promise<string[]>;
|
|
49
|
+
inspectsAttachments(deadline: number): Promise<boolean>;
|
|
50
|
+
routeStatus(session: string): Promise<{
|
|
51
|
+
local: boolean;
|
|
52
|
+
gateway_required: boolean;
|
|
53
|
+
}>;
|
|
54
|
+
checkProviderRequest(session: string, path: string, body: Uint8Array, deadline: number): Promise<{
|
|
55
|
+
routeLease?: string;
|
|
56
|
+
leaseAction?: (action: "renew" | "release") => Promise<number>;
|
|
57
|
+
local: boolean | undefined;
|
|
58
|
+
body: Buffer<ArrayBuffer>;
|
|
59
|
+
}>;
|
|
60
|
+
checkToolArguments: (input: import("./runtime/runtime.js").ToolInput, argsValue: unknown, commit?: (candidate: import("./runtime/errors.js").RecordValue) => void, deadline?: number, profile?: "v1.tool.before" | "v2.tool.before") => Promise<import("./runtime/errors.js").RecordValue>;
|
|
61
|
+
checkToolTexts(input: import("./runtime/runtime.js").ToolInput, texts: string[], commit: (texts: string[]) => void, deadline?: number): Promise<string[]>;
|
|
62
|
+
hasRestoration: (session: string) => boolean;
|
|
63
|
+
restoreText: (session: string, text: string) => string;
|
|
64
|
+
observeToolAfter(tool: import("./runtime/runtime.js").ToolInput, output: string): Promise<void>;
|
|
65
|
+
demaskResponse(session: string | null, response: Response, trace?: (reason: string) => void): Promise<Response>;
|
|
66
|
+
forgetSession: (session: string) => Promise<void>;
|
|
67
|
+
dispose(): Promise<void>;
|
|
68
|
+
};
|
|
69
|
+
releaseRuntime(cwd: string): Promise<void>;
|
|
70
|
+
test(signal?: AbortSignal): Promise<{
|
|
71
|
+
connected: boolean;
|
|
72
|
+
code: string;
|
|
73
|
+
decision: import("./bridge/protocol.js").Decision | null;
|
|
74
|
+
}>;
|
|
75
|
+
forgetSession(id: string, cwd?: string): Promise<void>;
|
|
76
|
+
dispose(): Promise<void>;
|
|
77
|
+
}
|