@ericsanchezok/synergy-util 2.4.5 → 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.
@@ -1,291 +1,18 @@
1
1
  export type SynergyCapabilityRisk = "low" | "medium" | "high";
2
- export type SynergyCapabilityRiskScope = "install" | "agent";
3
2
  export declare const SYNERGY_CAPABILITY_CATEGORIES: readonly ["tools", "files", "network", "data", "ui", "runtime", "hooks", "session", "browser", "identity", "communication", "platform"];
4
3
  export type SynergyCapabilityCategory = (typeof SYNERGY_CAPABILITY_CATEGORIES)[number];
5
- export type SynergyCapabilitySeverity = SynergyCapabilityRisk;
6
- export interface SynergyCapabilityPermissionItem {
7
- key: string;
4
+ export interface SynergyCapabilityDefinition {
8
5
  category: SynergyCapabilityCategory;
9
- severity: SynergyCapabilitySeverity;
6
+ severity: SynergyCapabilityRisk;
10
7
  title: string;
11
8
  description: string;
12
9
  technical?: string;
13
- }
14
- export interface RegistryPermissionItem {
15
- key: string;
16
- description: string;
17
- risk: SynergyCapabilityRisk;
18
- }
19
- export type ManifestTool = NonNullable<NonNullable<SynergyCapabilityManifest["contributes"]>["tools"]>[number];
20
- export interface SynergyCapabilityManifestTool {
21
- id?: string;
22
- name: string;
23
- exposure?: {
24
- mode?: string;
25
- };
26
- capabilities?: {
27
- filesystem?: "none" | "read" | "write";
28
- shell?: boolean;
29
- network?: boolean;
30
- session?: "none" | "metadata" | "read";
31
- workspace?: "none" | "metadata" | "read";
32
- config?: "none" | "plugin" | "global";
33
- };
34
- }
35
- export interface SynergyCapabilityManifest {
36
- permissions?: {
37
- tools?: {
38
- filesystem?: "none" | "read" | "write";
39
- shell?: boolean;
40
- network?: boolean;
41
- mcp?: "none" | "invoke" | "spawn";
42
- task?: unknown;
43
- };
44
- data?: {
45
- session?: "none" | "metadata" | "read";
46
- workspace?: "none" | "metadata" | "read";
47
- config?: "none" | "plugin" | "global";
48
- secrets?: "none" | "own";
49
- };
50
- ui?: {
51
- toolRenderers?: boolean;
52
- partRenderers?: boolean;
53
- workbenchPanels?: boolean;
54
- appPanels?: boolean;
55
- settings?: boolean;
56
- messageSlots?: boolean;
57
- themes?: boolean;
58
- icons?: boolean;
59
- appRoutes?: boolean;
60
- commands?: boolean;
61
- trustedImport?: boolean;
62
- sandboxIframe?: boolean;
63
- };
64
- hooks?: {
65
- promptTransform?: boolean;
66
- compactionTransform?: boolean;
67
- toolExecute?: "none" | "own" | "declared" | "all";
68
- permissionAsk?: "none" | "own" | "all";
69
- events?: "none" | "selected" | "all";
70
- eventNames?: string[];
71
- config?: boolean;
72
- };
73
- network?: {
74
- connectDomains?: string[];
75
- };
76
- };
77
- contributes?: {
78
- permissions?: unknown;
79
- tools?: SynergyCapabilityManifestTool[];
80
- agents?: Array<{
81
- name?: string;
82
- mode?: string;
83
- hidden?: boolean;
84
- model?: unknown;
85
- modelRole?: unknown;
86
- permission?: unknown;
87
- }>;
88
- mcp?: unknown;
89
- ui?: {
90
- toolRenderers?: unknown[];
91
- partRenderers?: unknown[];
92
- workbenchPanels?: unknown[];
93
- appPanels?: unknown[];
94
- settings?: unknown[];
95
- messageSlots?: unknown[];
96
- themes?: unknown[];
97
- icons?: unknown[];
98
- appRoutes?: unknown[];
99
- commands?: unknown[];
100
- };
101
- };
102
- lifecycle?: unknown;
103
- }
104
- export interface SynergyCapabilityDefinition extends Omit<SynergyCapabilityPermissionItem, "key"> {
105
10
  nonBypassable?: boolean;
106
11
  }
107
- export declare function publicToolNames(manifest: SynergyCapabilityManifest): string[];
108
- export declare function hasPublicTools(manifest: SynergyCapabilityManifest): boolean;
109
12
  export declare const SYNERGY_CAPABILITY_DETAILS: Record<string, SynergyCapabilityDefinition>;
110
- export declare const SYNERGY_PROFILE_CAPABILITIES: readonly ["file_read", "file_write", "shell_read", "shell", "shell_remote_write", "shell_remote_publish", "shell_destructive", "shell_hardline", "file_external_read", "file_external_write", "network_read", "network_request", "mcp_invoke", "mcp_spawn", "session_data", "workspace_data", "config:read", "config:write", "secrets", "task", "prompt_transform", "compaction_transform", "tool_execution_hook", "permission_hook", "event_hook", "config_hook", "identity_act", "communication_email", "channel_outbound", "platform_control", "protected_op", "session_state", "browser_interact", "browser_inspect", "browser_eval_readonly", "browser_eval_trusted", "browser_clipboard", "browser_download", "browser_viewport"];
13
+ export declare const SYNERGY_PROFILE_CAPABILITIES: readonly ["file_read", "file_write", "shell_read", "shell", "shell_branch_mutation", "shell_remote_execute", "shell_remote_publish", "shell_remote_write", "shell_destructive", "shell_hardline", "file_external_read", "file_external_write", "network_read", "network_request", "mcp_invoke", "mcp_spawn", "session_data", "workspace_data", "config:read", "config:write", "secrets", "task", "prompt_transform", "compaction_transform", "tool_execution_hook", "permission_hook", "event_hook", "config_hook", "identity_act", "communication_email", "channel_outbound", "platform_control", "protected_op", "session_state", "browser_interact", "browser_inspect", "browser_eval_readonly", "browser_eval_trusted", "browser_clipboard", "browser_upload", "browser_coordinate", "browser_download", "browser_emulation"];
111
14
  export declare const SYNERGY_PERMISSION_CAPABILITY: Record<string, string>;
112
15
  export declare function permissionCapability(permission: string): string;
113
16
  export declare function capabilityNonBypassable(capability: string): boolean;
114
- export declare function capabilityRisk(capability: string, manifest?: SynergyCapabilityManifest): SynergyCapabilityRisk;
115
- export declare function baseCapabilities(manifest: SynergyCapabilityManifest): string[];
116
- export declare function toolCapabilities(manifest: SynergyCapabilityManifest, tool: ManifestTool): string[];
117
- export declare function publicToolCapabilities(manifest: SynergyCapabilityManifest): string[];
118
- export declare function computeRisk(capabilities: string[], manifest?: SynergyCapabilityManifest): SynergyCapabilityRisk;
119
- export declare function capabilitiesForRiskScope(manifest: SynergyCapabilityManifest, scope: SynergyCapabilityRiskScope): string[];
120
- export declare function pluginRisk(manifest: SynergyCapabilityManifest, input: {
121
- scope: SynergyCapabilityRiskScope;
122
- }): SynergyCapabilityRisk;
123
- export declare function toolRisk(manifest: SynergyCapabilityManifest, tool: ManifestTool): SynergyCapabilityRisk;
124
- export declare function permissionItems(manifest: SynergyCapabilityManifest, capabilities: string[]): SynergyCapabilityPermissionItem[];
125
- export declare function registryPermissionSummary(manifest: SynergyCapabilityManifest, capabilities: string[]): RegistryPermissionItem[];
17
+ export declare function capabilityRisk(capability: string): SynergyCapabilityRisk;
126
18
  export declare function permissionCategoryForKey(key: string): SynergyCapabilityCategory;
127
- export declare function permissionsHashPayload(manifest: SynergyCapabilityManifest, capabilities: string[]): {
128
- capabilities: string[];
129
- permissions: {
130
- tools?: {
131
- filesystem?: "none" | "read" | "write";
132
- shell?: boolean;
133
- network?: boolean;
134
- mcp?: "none" | "invoke" | "spawn";
135
- task?: unknown;
136
- };
137
- data?: {
138
- session?: "none" | "metadata" | "read";
139
- workspace?: "none" | "metadata" | "read";
140
- config?: "none" | "plugin" | "global";
141
- secrets?: "none" | "own";
142
- };
143
- ui?: {
144
- toolRenderers?: boolean;
145
- partRenderers?: boolean;
146
- workbenchPanels?: boolean;
147
- appPanels?: boolean;
148
- settings?: boolean;
149
- messageSlots?: boolean;
150
- themes?: boolean;
151
- icons?: boolean;
152
- appRoutes?: boolean;
153
- commands?: boolean;
154
- trustedImport?: boolean;
155
- sandboxIframe?: boolean;
156
- };
157
- hooks?: {
158
- promptTransform?: boolean;
159
- compactionTransform?: boolean;
160
- toolExecute?: "none" | "own" | "declared" | "all";
161
- permissionAsk?: "none" | "own" | "all";
162
- events?: "none" | "selected" | "all";
163
- eventNames?: string[];
164
- config?: boolean;
165
- };
166
- network?: {
167
- connectDomains?: string[];
168
- };
169
- };
170
- contributes: {
171
- ui?: {
172
- toolRenderers: boolean;
173
- partRenderers: boolean;
174
- workbenchPanels: boolean;
175
- appPanels: boolean;
176
- settings: boolean;
177
- messageSlots: boolean;
178
- themes: boolean;
179
- icons: boolean;
180
- appRoutes: boolean;
181
- commands: boolean;
182
- } | undefined;
183
- mcp?: {} | undefined;
184
- agents?: {
185
- name: string | undefined;
186
- mode: string | undefined;
187
- hidden: boolean | undefined;
188
- model: unknown;
189
- modelRole: unknown;
190
- permission: unknown;
191
- }[] | undefined;
192
- tools?: {
193
- id: string | undefined;
194
- name: string;
195
- exposure: {
196
- mode?: string;
197
- } | undefined;
198
- capabilities: {
199
- filesystem?: "none" | "read" | "write";
200
- shell?: boolean;
201
- network?: boolean;
202
- session?: "none" | "metadata" | "read";
203
- workspace?: "none" | "metadata" | "read";
204
- config?: "none" | "plugin" | "global";
205
- } | undefined;
206
- }[] | undefined;
207
- permissions?: {} | undefined;
208
- } | undefined;
209
- lifecycle: {};
210
- };
211
- export declare function manifestHashPayload(manifest: SynergyCapabilityManifest): SynergyCapabilityManifest;
212
- export declare function stablePluginJson(value: unknown): string;
213
- export type BridgeMethodPolicy = {
214
- type: "capability";
215
- capability: string;
216
- } | {
217
- type: "unprivileged";
218
- } | {
219
- type: "unknown";
220
- };
221
- export declare const SYNERGY_BRIDGE_METHOD_POLICY: {
222
- readonly "config.get": {
223
- readonly type: "capability";
224
- readonly capability: "config:read";
225
- };
226
- readonly "config.set": {
227
- readonly type: "capability";
228
- readonly capability: "config:write";
229
- };
230
- readonly "config.replace": {
231
- readonly type: "capability";
232
- readonly capability: "config:write";
233
- };
234
- readonly "secret.get": {
235
- readonly type: "capability";
236
- readonly capability: "secrets";
237
- };
238
- readonly "secret.set": {
239
- readonly type: "capability";
240
- readonly capability: "secrets";
241
- };
242
- readonly "secret.delete": {
243
- readonly type: "capability";
244
- readonly capability: "secrets";
245
- };
246
- readonly "cache.get": {
247
- readonly type: "unprivileged";
248
- };
249
- readonly "cache.set": {
250
- readonly type: "unprivileged";
251
- };
252
- readonly "cache.delete": {
253
- readonly type: "unprivileged";
254
- };
255
- readonly "file.read": {
256
- readonly type: "capability";
257
- readonly capability: "file_read";
258
- };
259
- readonly "file.write": {
260
- readonly type: "capability";
261
- readonly capability: "file_write";
262
- };
263
- readonly "network.fetch": {
264
- readonly type: "capability";
265
- readonly capability: "network_request";
266
- };
267
- readonly "shell.run": {
268
- readonly type: "capability";
269
- readonly capability: "shell";
270
- };
271
- readonly "session.getMetadata": {
272
- readonly type: "capability";
273
- readonly capability: "session_data";
274
- };
275
- readonly "workspace.getMetadata": {
276
- readonly type: "capability";
277
- readonly capability: "workspace_data";
278
- };
279
- readonly "task.run": {
280
- readonly type: "capability";
281
- readonly capability: "task";
282
- };
283
- readonly "tool.invoke": {
284
- readonly type: "unprivileged";
285
- };
286
- readonly "permission.request": {
287
- readonly type: "unprivileged";
288
- };
289
- };
290
- export declare function bridgeMethodPolicy(method: string): BridgeMethodPolicy;
291
- export declare function bridgeCapability(method: string): string | undefined;