@ericsanchezok/synergy-util 2.4.4 → 3.0.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.
@@ -1,289 +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
- };
72
- network?: {
73
- connectDomains?: string[];
74
- };
75
- };
76
- contributes?: {
77
- permissions?: unknown;
78
- tools?: SynergyCapabilityManifestTool[];
79
- agents?: Array<{
80
- name?: string;
81
- mode?: string;
82
- hidden?: boolean;
83
- model?: unknown;
84
- modelRole?: unknown;
85
- permission?: unknown;
86
- }>;
87
- mcp?: unknown;
88
- ui?: {
89
- toolRenderers?: unknown[];
90
- partRenderers?: unknown[];
91
- workbenchPanels?: unknown[];
92
- appPanels?: unknown[];
93
- settings?: unknown[];
94
- messageSlots?: unknown[];
95
- themes?: unknown[];
96
- icons?: unknown[];
97
- appRoutes?: unknown[];
98
- commands?: unknown[];
99
- };
100
- };
101
- lifecycle?: unknown;
102
- }
103
- export interface SynergyCapabilityDefinition extends Omit<SynergyCapabilityPermissionItem, "key"> {
104
10
  nonBypassable?: boolean;
105
11
  }
106
- export declare function publicToolNames(manifest: SynergyCapabilityManifest): string[];
107
- export declare function hasPublicTools(manifest: SynergyCapabilityManifest): boolean;
108
12
  export declare const SYNERGY_CAPABILITY_DETAILS: Record<string, SynergyCapabilityDefinition>;
109
- 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", "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"];
110
14
  export declare const SYNERGY_PERMISSION_CAPABILITY: Record<string, string>;
111
15
  export declare function permissionCapability(permission: string): string;
112
16
  export declare function capabilityNonBypassable(capability: string): boolean;
113
- export declare function capabilityRisk(capability: string, manifest?: SynergyCapabilityManifest): SynergyCapabilityRisk;
114
- export declare function baseCapabilities(manifest: SynergyCapabilityManifest): string[];
115
- export declare function toolCapabilities(manifest: SynergyCapabilityManifest, tool: ManifestTool): string[];
116
- export declare function publicToolCapabilities(manifest: SynergyCapabilityManifest): string[];
117
- export declare function computeRisk(capabilities: string[], manifest?: SynergyCapabilityManifest): SynergyCapabilityRisk;
118
- export declare function capabilitiesForRiskScope(manifest: SynergyCapabilityManifest, scope: SynergyCapabilityRiskScope): string[];
119
- export declare function pluginRisk(manifest: SynergyCapabilityManifest, input: {
120
- scope: SynergyCapabilityRiskScope;
121
- }): SynergyCapabilityRisk;
122
- export declare function toolRisk(manifest: SynergyCapabilityManifest, tool: ManifestTool): SynergyCapabilityRisk;
123
- export declare function permissionItems(manifest: SynergyCapabilityManifest, capabilities: string[]): SynergyCapabilityPermissionItem[];
124
- export declare function registryPermissionSummary(manifest: SynergyCapabilityManifest, capabilities: string[]): RegistryPermissionItem[];
17
+ export declare function capabilityRisk(capability: string): SynergyCapabilityRisk;
125
18
  export declare function permissionCategoryForKey(key: string): SynergyCapabilityCategory;
126
- export declare function permissionsHashPayload(manifest: SynergyCapabilityManifest, capabilities: string[]): {
127
- capabilities: string[];
128
- permissions: {
129
- tools?: {
130
- filesystem?: "none" | "read" | "write";
131
- shell?: boolean;
132
- network?: boolean;
133
- mcp?: "none" | "invoke" | "spawn";
134
- task?: unknown;
135
- };
136
- data?: {
137
- session?: "none" | "metadata" | "read";
138
- workspace?: "none" | "metadata" | "read";
139
- config?: "none" | "plugin" | "global";
140
- secrets?: "none" | "own";
141
- };
142
- ui?: {
143
- toolRenderers?: boolean;
144
- partRenderers?: boolean;
145
- workbenchPanels?: boolean;
146
- appPanels?: boolean;
147
- settings?: boolean;
148
- messageSlots?: boolean;
149
- themes?: boolean;
150
- icons?: boolean;
151
- appRoutes?: boolean;
152
- commands?: boolean;
153
- trustedImport?: boolean;
154
- sandboxIframe?: boolean;
155
- };
156
- hooks?: {
157
- promptTransform?: boolean;
158
- compactionTransform?: boolean;
159
- toolExecute?: "none" | "own" | "declared" | "all";
160
- permissionAsk?: "none" | "own" | "all";
161
- events?: "none" | "selected" | "all";
162
- eventNames?: string[];
163
- };
164
- network?: {
165
- connectDomains?: string[];
166
- };
167
- };
168
- contributes: {
169
- ui?: {
170
- toolRenderers: boolean;
171
- partRenderers: boolean;
172
- workbenchPanels: boolean;
173
- appPanels: boolean;
174
- settings: boolean;
175
- messageSlots: boolean;
176
- themes: boolean;
177
- icons: boolean;
178
- appRoutes: boolean;
179
- commands: boolean;
180
- } | undefined;
181
- mcp?: {} | undefined;
182
- agents?: {
183
- name: string | undefined;
184
- mode: string | undefined;
185
- hidden: boolean | undefined;
186
- model: unknown;
187
- modelRole: unknown;
188
- permission: unknown;
189
- }[] | undefined;
190
- tools?: {
191
- id: string | undefined;
192
- name: string;
193
- exposure: {
194
- mode?: string;
195
- } | undefined;
196
- capabilities: {
197
- filesystem?: "none" | "read" | "write";
198
- shell?: boolean;
199
- network?: boolean;
200
- session?: "none" | "metadata" | "read";
201
- workspace?: "none" | "metadata" | "read";
202
- config?: "none" | "plugin" | "global";
203
- } | undefined;
204
- }[] | undefined;
205
- permissions?: {} | undefined;
206
- } | undefined;
207
- lifecycle: {};
208
- };
209
- export declare function manifestHashPayload(manifest: SynergyCapabilityManifest): SynergyCapabilityManifest;
210
- export declare function stablePluginJson(value: unknown): string;
211
- export type BridgeMethodPolicy = {
212
- type: "capability";
213
- capability: string;
214
- } | {
215
- type: "unprivileged";
216
- } | {
217
- type: "unknown";
218
- };
219
- export declare const SYNERGY_BRIDGE_METHOD_POLICY: {
220
- readonly "config.get": {
221
- readonly type: "capability";
222
- readonly capability: "config:read";
223
- };
224
- readonly "config.set": {
225
- readonly type: "capability";
226
- readonly capability: "config:write";
227
- };
228
- readonly "config.replace": {
229
- readonly type: "capability";
230
- readonly capability: "config:write";
231
- };
232
- readonly "secret.get": {
233
- readonly type: "capability";
234
- readonly capability: "secrets";
235
- };
236
- readonly "secret.set": {
237
- readonly type: "capability";
238
- readonly capability: "secrets";
239
- };
240
- readonly "secret.delete": {
241
- readonly type: "capability";
242
- readonly capability: "secrets";
243
- };
244
- readonly "cache.get": {
245
- readonly type: "unprivileged";
246
- };
247
- readonly "cache.set": {
248
- readonly type: "unprivileged";
249
- };
250
- readonly "cache.delete": {
251
- readonly type: "unprivileged";
252
- };
253
- readonly "file.read": {
254
- readonly type: "capability";
255
- readonly capability: "file_read";
256
- };
257
- readonly "file.write": {
258
- readonly type: "capability";
259
- readonly capability: "file_write";
260
- };
261
- readonly "network.fetch": {
262
- readonly type: "capability";
263
- readonly capability: "network_request";
264
- };
265
- readonly "shell.run": {
266
- readonly type: "capability";
267
- readonly capability: "shell";
268
- };
269
- readonly "session.getMetadata": {
270
- readonly type: "capability";
271
- readonly capability: "session_data";
272
- };
273
- readonly "workspace.getMetadata": {
274
- readonly type: "capability";
275
- readonly capability: "workspace_data";
276
- };
277
- readonly "task.run": {
278
- readonly type: "capability";
279
- readonly capability: "task";
280
- };
281
- readonly "tool.invoke": {
282
- readonly type: "unprivileged";
283
- };
284
- readonly "permission.request": {
285
- readonly type: "unprivileged";
286
- };
287
- };
288
- export declare function bridgeMethodPolicy(method: string): BridgeMethodPolicy;
289
- export declare function bridgeCapability(method: string): string | undefined;