@superblocksteam/vite-plugin-file-sync 2.0.51 → 2.0.52-next.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.
Files changed (214) hide show
  1. package/dist/ai-service/agent/prompts/build-base-system-prompt.d.ts.map +1 -1
  2. package/dist/ai-service/agent/prompts/build-base-system-prompt.js +36 -7
  3. package/dist/ai-service/agent/prompts/build-base-system-prompt.js.map +1 -1
  4. package/dist/ai-service/agent/subagents/apis/generate-api-source.d.ts +28 -3
  5. package/dist/ai-service/agent/subagents/apis/generate-api-source.d.ts.map +1 -1
  6. package/dist/ai-service/agent/subagents/apis/generate-api-source.js +109 -14
  7. package/dist/ai-service/agent/subagents/apis/generate-api-source.js.map +1 -1
  8. package/dist/ai-service/agent/subagents/apis/prompt-builder.d.ts +1 -1
  9. package/dist/ai-service/agent/subagents/apis/prompt-builder.js +2 -2
  10. package/dist/ai-service/agent/subagents/apis/state.d.ts +10 -0
  11. package/dist/ai-service/agent/subagents/apis/state.d.ts.map +1 -1
  12. package/dist/ai-service/agent/subagents/apis/system-prompt.d.ts +1 -1
  13. package/dist/ai-service/agent/subagents/apis/system-prompt.d.ts.map +1 -1
  14. package/dist/ai-service/agent/subagents/apis/system-prompt.js +294 -5
  15. package/dist/ai-service/agent/subagents/apis/system-prompt.js.map +1 -1
  16. package/dist/ai-service/agent/tools/apis/build-api.d.ts +2 -0
  17. package/dist/ai-service/agent/tools/apis/build-api.d.ts.map +1 -1
  18. package/dist/ai-service/agent/tools/apis/build-api.js +95 -13
  19. package/dist/ai-service/agent/tools/apis/build-api.js.map +1 -1
  20. package/dist/ai-service/agent/tools/apis/finalize-api.d.ts.map +1 -1
  21. package/dist/ai-service/agent/tools/apis/finalize-api.js +13 -4
  22. package/dist/ai-service/agent/tools/apis/finalize-api.js.map +1 -1
  23. package/dist/ai-service/agent/tools/build-debug.d.ts.map +1 -1
  24. package/dist/ai-service/agent/tools/build-debug.js +64 -2
  25. package/dist/ai-service/agent/tools/build-debug.js.map +1 -1
  26. package/dist/ai-service/agent/tools/build-edit-file.d.ts.map +1 -1
  27. package/dist/ai-service/agent/tools/build-edit-file.js +12 -0
  28. package/dist/ai-service/agent/tools/build-edit-file.js.map +1 -1
  29. package/dist/ai-service/agent/tools/build-finalize.d.ts.map +1 -1
  30. package/dist/ai-service/agent/tools/build-finalize.js +43 -0
  31. package/dist/ai-service/agent/tools/build-finalize.js.map +1 -1
  32. package/dist/ai-service/agent/tools/build-multi-edit-file.d.ts.map +1 -1
  33. package/dist/ai-service/agent/tools/build-multi-edit-file.js +6 -0
  34. package/dist/ai-service/agent/tools/build-multi-edit-file.js.map +1 -1
  35. package/dist/ai-service/agent/tools/build-write-file.d.ts.map +1 -1
  36. package/dist/ai-service/agent/tools/build-write-file.js +6 -0
  37. package/dist/ai-service/agent/tools/build-write-file.js.map +1 -1
  38. package/dist/ai-service/agent/tools/debug-cache.d.ts +42 -0
  39. package/dist/ai-service/agent/tools/debug-cache.d.ts.map +1 -1
  40. package/dist/ai-service/agent/tools/debug-cache.js +121 -14
  41. package/dist/ai-service/agent/tools/debug-cache.js.map +1 -1
  42. package/dist/ai-service/agent/tools/index.d.ts +1 -0
  43. package/dist/ai-service/agent/tools/index.d.ts.map +1 -1
  44. package/dist/ai-service/agent/tools/index.js +1 -0
  45. package/dist/ai-service/agent/tools/index.js.map +1 -1
  46. package/dist/ai-service/agent/tools/integrations/execute-request.d.ts +9 -5
  47. package/dist/ai-service/agent/tools/integrations/execute-request.d.ts.map +1 -1
  48. package/dist/ai-service/agent/tools/integrations/execute-request.js +109 -7
  49. package/dist/ai-service/agent/tools/integrations/execute-request.js.map +1 -1
  50. package/dist/ai-service/agent/tools/integrations/index.d.ts +1 -1
  51. package/dist/ai-service/agent/tools/integrations/index.d.ts.map +1 -1
  52. package/dist/ai-service/agent/tools/integrations/index.js +1 -1
  53. package/dist/ai-service/agent/tools/integrations/index.js.map +1 -1
  54. package/dist/ai-service/agent/tools/integrations/metadata.d.ts +0 -4
  55. package/dist/ai-service/agent/tools/integrations/metadata.d.ts.map +1 -1
  56. package/dist/ai-service/agent/tools/integrations/metadata.js +0 -44
  57. package/dist/ai-service/agent/tools/integrations/metadata.js.map +1 -1
  58. package/dist/ai-service/agent/tools.d.ts.map +1 -1
  59. package/dist/ai-service/agent/tools.js +45 -10
  60. package/dist/ai-service/agent/tools.js.map +1 -1
  61. package/dist/ai-service/agent/tools2/access-control.d.ts +1 -1
  62. package/dist/ai-service/agent/tools2/access-control.d.ts.map +1 -1
  63. package/dist/ai-service/agent/tools2/access-control.js +14 -5
  64. package/dist/ai-service/agent/tools2/access-control.js.map +1 -1
  65. package/dist/ai-service/agent/tools2/entity-permissions.d.ts +172 -0
  66. package/dist/ai-service/agent/tools2/entity-permissions.d.ts.map +1 -0
  67. package/dist/ai-service/agent/tools2/entity-permissions.js +144 -0
  68. package/dist/ai-service/agent/tools2/entity-permissions.js.map +1 -0
  69. package/dist/ai-service/agent/tools2/example.d.ts.map +1 -1
  70. package/dist/ai-service/agent/tools2/example.js +25 -6
  71. package/dist/ai-service/agent/tools2/example.js.map +1 -1
  72. package/dist/ai-service/agent/tools2/index.d.ts +4 -2
  73. package/dist/ai-service/agent/tools2/index.d.ts.map +1 -1
  74. package/dist/ai-service/agent/tools2/index.js +2 -1
  75. package/dist/ai-service/agent/tools2/index.js.map +1 -1
  76. package/dist/ai-service/agent/tools2/registry.d.ts +47 -0
  77. package/dist/ai-service/agent/tools2/registry.d.ts.map +1 -1
  78. package/dist/ai-service/agent/tools2/registry.js +115 -19
  79. package/dist/ai-service/agent/tools2/registry.js.map +1 -1
  80. package/dist/ai-service/agent/tools2/test-utils.d.ts +7 -0
  81. package/dist/ai-service/agent/tools2/test-utils.d.ts.map +1 -0
  82. package/dist/ai-service/agent/tools2/test-utils.js +10 -0
  83. package/dist/ai-service/agent/tools2/test-utils.js.map +1 -0
  84. package/dist/ai-service/agent/tools2/tools/ask-multi-choice.d.ts.map +1 -1
  85. package/dist/ai-service/agent/tools2/tools/ask-multi-choice.js +17 -9
  86. package/dist/ai-service/agent/tools2/tools/ask-multi-choice.js.map +1 -1
  87. package/dist/ai-service/agent/tools2/tools/exit-plan-mode.d.ts +4 -1
  88. package/dist/ai-service/agent/tools2/tools/exit-plan-mode.d.ts.map +1 -1
  89. package/dist/ai-service/agent/tools2/tools/exit-plan-mode.js +224 -26
  90. package/dist/ai-service/agent/tools2/tools/exit-plan-mode.js.map +1 -1
  91. package/dist/ai-service/agent/tools2/tools/grep-metadata-ripgrep.d.ts +18 -0
  92. package/dist/ai-service/agent/tools2/tools/grep-metadata-ripgrep.d.ts.map +1 -0
  93. package/dist/ai-service/agent/tools2/tools/grep-metadata-ripgrep.js +837 -0
  94. package/dist/ai-service/agent/tools2/tools/grep-metadata-ripgrep.js.map +1 -0
  95. package/dist/ai-service/agent/tools2/tools/grep-metadata.d.ts +96 -0
  96. package/dist/ai-service/agent/tools2/tools/grep-metadata.d.ts.map +1 -0
  97. package/dist/ai-service/agent/tools2/tools/grep-metadata.js +437 -0
  98. package/dist/ai-service/agent/tools2/tools/grep-metadata.js.map +1 -0
  99. package/dist/ai-service/agent/tools2/types.d.ts +116 -6
  100. package/dist/ai-service/agent/tools2/types.d.ts.map +1 -1
  101. package/dist/ai-service/agent/tools2/types.js +15 -0
  102. package/dist/ai-service/agent/tools2/types.js.map +1 -1
  103. package/dist/ai-service/agent/tools2/utils.d.ts +9 -0
  104. package/dist/ai-service/agent/tools2/utils.d.ts.map +1 -0
  105. package/dist/ai-service/agent/tools2/utils.js +11 -0
  106. package/dist/ai-service/agent/tools2/utils.js.map +1 -0
  107. package/dist/ai-service/chat/chat-session-store.d.ts.map +1 -1
  108. package/dist/ai-service/chat/chat-session-store.js +47 -1
  109. package/dist/ai-service/chat/chat-session-store.js.map +1 -1
  110. package/dist/ai-service/const.d.ts +0 -1
  111. package/dist/ai-service/const.d.ts.map +1 -1
  112. package/dist/ai-service/const.js +0 -1
  113. package/dist/ai-service/const.js.map +1 -1
  114. package/dist/ai-service/index.d.ts +11 -0
  115. package/dist/ai-service/index.d.ts.map +1 -1
  116. package/dist/ai-service/index.js +51 -3
  117. package/dist/ai-service/index.js.map +1 -1
  118. package/dist/ai-service/integrations/metadata-storage/index.d.ts +25 -0
  119. package/dist/ai-service/integrations/metadata-storage/index.d.ts.map +1 -0
  120. package/dist/ai-service/integrations/metadata-storage/index.js +2 -0
  121. package/dist/ai-service/integrations/metadata-storage/index.js.map +1 -0
  122. package/dist/ai-service/integrations/metadata-storage/local.d.ts +53 -0
  123. package/dist/ai-service/integrations/metadata-storage/local.d.ts.map +1 -0
  124. package/dist/ai-service/integrations/metadata-storage/local.js +315 -0
  125. package/dist/ai-service/integrations/metadata-storage/local.js.map +1 -0
  126. package/dist/ai-service/integrations/store.d.ts +17 -14
  127. package/dist/ai-service/integrations/store.d.ts.map +1 -1
  128. package/dist/ai-service/integrations/store.js +124 -131
  129. package/dist/ai-service/integrations/store.js.map +1 -1
  130. package/dist/ai-service/llm/utils.js +1 -1
  131. package/dist/ai-service/llm/utils.js.map +1 -1
  132. package/dist/ai-service/llmobs/helpers.d.ts.map +1 -1
  133. package/dist/ai-service/llmobs/helpers.js +17 -23
  134. package/dist/ai-service/llmobs/helpers.js.map +1 -1
  135. package/dist/ai-service/llmobs/middleware/stream-text.d.ts.map +1 -1
  136. package/dist/ai-service/llmobs/middleware/stream-text.js +1 -0
  137. package/dist/ai-service/llmobs/middleware/stream-text.js.map +1 -1
  138. package/dist/ai-service/state-machine/clark-fsm.d.ts +6 -2
  139. package/dist/ai-service/state-machine/clark-fsm.d.ts.map +1 -1
  140. package/dist/ai-service/state-machine/clark-fsm.js +4 -2
  141. package/dist/ai-service/state-machine/clark-fsm.js.map +1 -1
  142. package/dist/ai-service/state-machine/handlers/agent-planning.d.ts.map +1 -1
  143. package/dist/ai-service/state-machine/handlers/agent-planning.js +10 -4
  144. package/dist/ai-service/state-machine/handlers/agent-planning.js.map +1 -1
  145. package/dist/ai-service/state-machine/handlers/llm-generating.d.ts.map +1 -1
  146. package/dist/ai-service/state-machine/handlers/llm-generating.js +16 -7
  147. package/dist/ai-service/state-machine/handlers/llm-generating.js.map +1 -1
  148. package/dist/ai-service/state-machine/handlers/post-processing.d.ts.map +1 -1
  149. package/dist/ai-service/state-machine/handlers/post-processing.js +11 -2
  150. package/dist/ai-service/state-machine/handlers/post-processing.js.map +1 -1
  151. package/dist/ai-service/transform/api-builder/to-sdk-transformer.d.ts.map +1 -1
  152. package/dist/ai-service/transform/api-builder/to-sdk-transformer.js +0 -1
  153. package/dist/ai-service/transform/api-builder/to-sdk-transformer.js.map +1 -1
  154. package/dist/ai-service/types.d.ts +1 -0
  155. package/dist/ai-service/types.d.ts.map +1 -1
  156. package/dist/ai-service/types.js.map +1 -1
  157. package/dist/file-sync-vite-plugin.d.ts.map +1 -1
  158. package/dist/file-sync-vite-plugin.js +12 -0
  159. package/dist/file-sync-vite-plugin.js.map +1 -1
  160. package/dist/file-system-helpers.d.ts.map +1 -1
  161. package/dist/file-system-helpers.js +1 -0
  162. package/dist/file-system-helpers.js.map +1 -1
  163. package/dist/socket-manager.d.ts.map +1 -1
  164. package/dist/socket-manager.js +6 -0
  165. package/dist/socket-manager.js.map +1 -1
  166. package/dist/sync-service/index.d.ts +8 -0
  167. package/dist/sync-service/index.d.ts.map +1 -1
  168. package/dist/sync-service/index.js +15 -0
  169. package/dist/sync-service/index.js.map +1 -1
  170. package/dist/util/open-api.d.ts +2 -46
  171. package/dist/util/open-api.d.ts.map +1 -1
  172. package/dist/util/open-api.js +1 -114
  173. package/dist/util/open-api.js.map +1 -1
  174. package/package.json +7 -7
  175. package/dist/ai-service/integrations/metadata/database.d.ts +0 -15
  176. package/dist/ai-service/integrations/metadata/database.d.ts.map +0 -1
  177. package/dist/ai-service/integrations/metadata/database.js +0 -121
  178. package/dist/ai-service/integrations/metadata/database.js.map +0 -1
  179. package/dist/ai-service/integrations/metadata/databricks.d.ts +0 -25
  180. package/dist/ai-service/integrations/metadata/databricks.d.ts.map +0 -1
  181. package/dist/ai-service/integrations/metadata/databricks.js +0 -174
  182. package/dist/ai-service/integrations/metadata/databricks.js.map +0 -1
  183. package/dist/ai-service/integrations/metadata/graphql-based.d.ts +0 -16
  184. package/dist/ai-service/integrations/metadata/graphql-based.d.ts.map +0 -1
  185. package/dist/ai-service/integrations/metadata/graphql-based.js +0 -383
  186. package/dist/ai-service/integrations/metadata/graphql-based.js.map +0 -1
  187. package/dist/ai-service/integrations/metadata/index.d.ts +0 -9
  188. package/dist/ai-service/integrations/metadata/index.d.ts.map +0 -1
  189. package/dist/ai-service/integrations/metadata/index.js +0 -7
  190. package/dist/ai-service/integrations/metadata/index.js.map +0 -1
  191. package/dist/ai-service/integrations/metadata/llm-utils.d.ts +0 -24
  192. package/dist/ai-service/integrations/metadata/llm-utils.d.ts.map +0 -1
  193. package/dist/ai-service/integrations/metadata/llm-utils.js +0 -45
  194. package/dist/ai-service/integrations/metadata/llm-utils.js.map +0 -1
  195. package/dist/ai-service/integrations/metadata/open-api.d.ts +0 -17
  196. package/dist/ai-service/integrations/metadata/open-api.d.ts.map +0 -1
  197. package/dist/ai-service/integrations/metadata/open-api.js +0 -62
  198. package/dist/ai-service/integrations/metadata/open-api.js.map +0 -1
  199. package/dist/ai-service/integrations/metadata/table-based.d.ts +0 -10
  200. package/dist/ai-service/integrations/metadata/table-based.d.ts.map +0 -1
  201. package/dist/ai-service/integrations/metadata/table-based.js +0 -27
  202. package/dist/ai-service/integrations/metadata/table-based.js.map +0 -1
  203. package/dist/ai-service/prompt-builder-service/builders/dbschema-intent.d.ts +0 -19
  204. package/dist/ai-service/prompt-builder-service/builders/dbschema-intent.d.ts.map +0 -1
  205. package/dist/ai-service/prompt-builder-service/builders/dbschema-intent.js +0 -145
  206. package/dist/ai-service/prompt-builder-service/builders/dbschema-intent.js.map +0 -1
  207. package/dist/ai-service/prompt-builder-service/builders/openapi-intent.d.ts +0 -19
  208. package/dist/ai-service/prompt-builder-service/builders/openapi-intent.d.ts.map +0 -1
  209. package/dist/ai-service/prompt-builder-service/builders/openapi-intent.js +0 -41
  210. package/dist/ai-service/prompt-builder-service/builders/openapi-intent.js.map +0 -1
  211. package/dist/ai-service/prompt-builder-service/index.d.ts +0 -3
  212. package/dist/ai-service/prompt-builder-service/index.d.ts.map +0 -1
  213. package/dist/ai-service/prompt-builder-service/index.js +0 -3
  214. package/dist/ai-service/prompt-builder-service/index.js.map +0 -1
@@ -0,0 +1,172 @@
1
+ /**
2
+ * Entity permission management for access control.
3
+ *
4
+ * Provides a generalized system for tracking user approvals for accessing
5
+ * specific entities (e.g., integrations, files, APIs). This enables granular
6
+ * per-entity access control where users can approve access to specific
7
+ * resources rather than blanket permissions.
8
+ */
9
+ import type { Tool } from "./types.js";
10
+ import type { AiEntityType } from "@superblocksteam/library-shared/types";
11
+ /**
12
+ * Permission key components for scoping.
13
+ * Array of strings that identify the scope (e.g., ["toolName"] or ["category", "readonly"]).
14
+ */
15
+ export type ToolPermissionKey = string[];
16
+ /**
17
+ * Formatted scope string for storage.
18
+ * Created by joining ToolPermissionKey components with a delimiter.
19
+ */
20
+ export type ToolPermissionScope = string;
21
+ /**
22
+ * Strategy for determining how permissions are scoped by tool.
23
+ *
24
+ * Different strategies enable different granularities:
25
+ * - Per-tool: Each tool requires separate approval
26
+ * - Per-category: All tools in a category share approvals
27
+ * - Per-access: Separate read/write permissions
28
+ */
29
+ export declare abstract class ToolPermissionKeyStrategy {
30
+ /**
31
+ * Generate permission key components for a tool.
32
+ *
33
+ * @param tool - Tool to generate key for
34
+ * @returns Array of key components
35
+ */
36
+ abstract getToolPermissionKey(tool: Tool): ToolPermissionKey;
37
+ /**
38
+ * Format permission key into storage scope string.
39
+ *
40
+ * Default implementation joins components with ':' delimiter.
41
+ *
42
+ * @param key - Permission key components
43
+ * @returns Formatted scope string
44
+ */
45
+ formatScope(key: ToolPermissionKey): ToolPermissionScope;
46
+ }
47
+ /**
48
+ * Default strategy: scope permissions per individual tool.
49
+ *
50
+ * Most granular approach - each tool requires separate approval
51
+ * for accessing entities. Provides maximum user control.
52
+ */
53
+ export declare class ToolNamePermissionKeyStrategy extends ToolPermissionKeyStrategy {
54
+ getToolPermissionKey(tool: Tool): ToolPermissionKey;
55
+ }
56
+ /**
57
+ * Store for tracking entity-level permissions.
58
+ *
59
+ * This interface abstracts the storage mechanism, allowing different
60
+ * implementations (session-based, persistent, etc.) to be swapped out
61
+ * without changing the access control logic.
62
+ *
63
+ * Permissions are scoped by tool permission scope strings, enabling
64
+ * granular control (e.g., per-tool, per-category, etc.).
65
+ */
66
+ export interface EntityPermissionStore {
67
+ /**
68
+ * Check if access to a specific entity has been approved for a scope.
69
+ *
70
+ * @param entityType - The type of entity to check
71
+ * @param entityId - The unique identifier of the entity
72
+ * @param scope - Permission scope (e.g., "toolName", "category:read")
73
+ * @returns True if the entity has been approved for this scope
74
+ */
75
+ isApproved(entityType: AiEntityType, entityId: string, scope: ToolPermissionScope): boolean;
76
+ /**
77
+ * Approve access to a specific entity for a scope.
78
+ *
79
+ * Once approved, future permission checks for this entity and scope will
80
+ * return true until explicitly revoked or the store is cleared.
81
+ *
82
+ * @param entityType - The type of entity to approve
83
+ * @param entityId - The unique identifier of the entity
84
+ * @param scope - Permission scope (e.g., "toolName", "category:read")
85
+ */
86
+ approve(entityType: AiEntityType, entityId: string, scope: ToolPermissionScope): void;
87
+ /**
88
+ * Revoke access to a specific entity for a scope.
89
+ *
90
+ * Removes the approval for this entity and scope, requiring re-approval
91
+ * for future access attempts.
92
+ *
93
+ * @param entityType - The type of entity to revoke
94
+ * @param entityId - The unique identifier of the entity
95
+ * @param scope - Permission scope (e.g., "toolName", "category:read")
96
+ */
97
+ revoke(entityType: AiEntityType, entityId: string, scope: ToolPermissionScope): void;
98
+ /**
99
+ * Clear all entity approvals.
100
+ *
101
+ * Removes all stored approvals across all entity types and scopes.
102
+ */
103
+ clear(): void;
104
+ /**
105
+ * Get all approved entity IDs for a specific entity type and optional scope.
106
+ *
107
+ * Useful for debugging, inspection, and UI display of approved entities.
108
+ *
109
+ * @param entityType - The type of entity to list approvals for
110
+ * @param scope - Optional permission scope. If provided, returns only approvals
111
+ * for that scope. If omitted, returns all approved entities
112
+ * across all scopes.
113
+ * @returns Array of approved entity IDs for the given type (and scope)
114
+ */
115
+ getApproved(entityType: AiEntityType, scope?: ToolPermissionScope): string[];
116
+ }
117
+ /**
118
+ * Session-scoped implementation of entity permission store.
119
+ *
120
+ * Stores approvals in memory for the duration of the session.
121
+ * Approvals are lost when the session ends or the store is cleared.
122
+ *
123
+ * Permissions are scoped, allowing different tools/categories to have
124
+ * independent approval states for the same entity.
125
+ *
126
+ * This implementation is suitable for session-based permission tracking
127
+ * and can be replaced with a persistent implementation if needed.
128
+ */
129
+ export declare class SessionEntityPermissionStore implements EntityPermissionStore {
130
+ private permissions;
131
+ constructor();
132
+ /**
133
+ * Check if access to a specific entity has been approved for a scope.
134
+ *
135
+ * @param entityType - The type of entity to check
136
+ * @param entityId - The unique identifier of the entity
137
+ * @param scope - Permission scope
138
+ * @returns True if the entity has been approved for this scope
139
+ */
140
+ isApproved(entityType: AiEntityType, entityId: string, scope: ToolPermissionScope): boolean;
141
+ /**
142
+ * Approve access to a specific entity for a scope.
143
+ *
144
+ * @param entityType - The type of entity to approve
145
+ * @param entityId - The unique identifier of the entity
146
+ * @param scope - Permission scope
147
+ */
148
+ approve(entityType: AiEntityType, entityId: string, scope: ToolPermissionScope): void;
149
+ /**
150
+ * Revoke access to a specific entity for a scope.
151
+ *
152
+ * @param entityType - The type of entity to revoke
153
+ * @param entityId - The unique identifier of the entity
154
+ * @param scope - Permission scope
155
+ */
156
+ revoke(entityType: AiEntityType, entityId: string, scope: ToolPermissionScope): void;
157
+ /**
158
+ * Clear all entity approvals across all scopes.
159
+ */
160
+ clear(): void;
161
+ /**
162
+ * Get all approved entity IDs for a specific entity type and optional scope.
163
+ *
164
+ * @param entityType - The type of entity to list approvals for
165
+ * @param scope - Optional permission scope. If provided, returns only approvals
166
+ * for that scope. If omitted, returns all approved entities
167
+ * across all scopes (deduplicated).
168
+ * @returns Array of approved entity IDs for the given type (and scope)
169
+ */
170
+ getApproved(entityType: AiEntityType, scope?: ToolPermissionScope): string[];
171
+ }
172
+ //# sourceMappingURL=entity-permissions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"entity-permissions.d.ts","sourceRoot":"","sources":["../../../../src/ai-service/agent/tools2/entity-permissions.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AACvC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uCAAuC,CAAC;AAE1E;;;GAGG;AACH,MAAM,MAAM,iBAAiB,GAAG,MAAM,EAAE,CAAC;AAEzC;;;GAGG;AACH,MAAM,MAAM,mBAAmB,GAAG,MAAM,CAAC;AAEzC;;;;;;;GAOG;AACH,8BAAsB,yBAAyB;IAC7C;;;;;OAKG;IACH,QAAQ,CAAC,oBAAoB,CAAC,IAAI,EAAE,IAAI,GAAG,iBAAiB;IAE5D;;;;;;;OAOG;IACH,WAAW,CAAC,GAAG,EAAE,iBAAiB,GAAG,mBAAmB;CAGzD;AAED;;;;;GAKG;AACH,qBAAa,6BAA8B,SAAQ,yBAAyB;IAC1E,oBAAoB,CAAC,IAAI,EAAE,IAAI,GAAG,iBAAiB;CAGpD;AAED;;;;;;;;;GASG;AACH,MAAM,WAAW,qBAAqB;IACpC;;;;;;;OAOG;IACH,UAAU,CACR,UAAU,EAAE,YAAY,EACxB,QAAQ,EAAE,MAAM,EAChB,KAAK,EAAE,mBAAmB,GACzB,OAAO,CAAC;IAEX;;;;;;;;;OASG;IACH,OAAO,CACL,UAAU,EAAE,YAAY,EACxB,QAAQ,EAAE,MAAM,EAChB,KAAK,EAAE,mBAAmB,GACzB,IAAI,CAAC;IAER;;;;;;;;;OASG;IACH,MAAM,CACJ,UAAU,EAAE,YAAY,EACxB,QAAQ,EAAE,MAAM,EAChB,KAAK,EAAE,mBAAmB,GACzB,IAAI,CAAC;IAER;;;;OAIG;IACH,KAAK,IAAI,IAAI,CAAC;IAEd;;;;;;;;;;OAUG;IACH,WAAW,CAAC,UAAU,EAAE,YAAY,EAAE,KAAK,CAAC,EAAE,mBAAmB,GAAG,MAAM,EAAE,CAAC;CAC9E;AAED;;;;;;;;;;;GAWG;AACH,qBAAa,4BAA6B,YAAW,qBAAqB;IACxE,OAAO,CAAC,WAAW,CAA2D;;IAM9E;;;;;;;OAOG;IACH,UAAU,CACR,UAAU,EAAE,YAAY,EACxB,QAAQ,EAAE,MAAM,EAChB,KAAK,EAAE,mBAAmB,GACzB,OAAO;IASV;;;;;;OAMG;IACH,OAAO,CACL,UAAU,EAAE,YAAY,EACxB,QAAQ,EAAE,MAAM,EAChB,KAAK,EAAE,mBAAmB,GACzB,IAAI;IAgBP;;;;;;OAMG;IACH,MAAM,CACJ,UAAU,EAAE,YAAY,EACxB,QAAQ,EAAE,MAAM,EAChB,KAAK,EAAE,mBAAmB,GACzB,IAAI;IASP;;OAEG;IACH,KAAK,IAAI,IAAI;IAIb;;;;;;;;OAQG;IACH,WAAW,CAAC,UAAU,EAAE,YAAY,EAAE,KAAK,CAAC,EAAE,mBAAmB,GAAG,MAAM,EAAE;CAqB7E"}
@@ -0,0 +1,144 @@
1
+ /**
2
+ * Entity permission management for access control.
3
+ *
4
+ * Provides a generalized system for tracking user approvals for accessing
5
+ * specific entities (e.g., integrations, files, APIs). This enables granular
6
+ * per-entity access control where users can approve access to specific
7
+ * resources rather than blanket permissions.
8
+ */
9
+ /**
10
+ * Strategy for determining how permissions are scoped by tool.
11
+ *
12
+ * Different strategies enable different granularities:
13
+ * - Per-tool: Each tool requires separate approval
14
+ * - Per-category: All tools in a category share approvals
15
+ * - Per-access: Separate read/write permissions
16
+ */
17
+ export class ToolPermissionKeyStrategy {
18
+ /**
19
+ * Format permission key into storage scope string.
20
+ *
21
+ * Default implementation joins components with ':' delimiter.
22
+ *
23
+ * @param key - Permission key components
24
+ * @returns Formatted scope string
25
+ */
26
+ formatScope(key) {
27
+ return key.join(":");
28
+ }
29
+ }
30
+ /**
31
+ * Default strategy: scope permissions per individual tool.
32
+ *
33
+ * Most granular approach - each tool requires separate approval
34
+ * for accessing entities. Provides maximum user control.
35
+ */
36
+ export class ToolNamePermissionKeyStrategy extends ToolPermissionKeyStrategy {
37
+ getToolPermissionKey(tool) {
38
+ return [tool.name];
39
+ }
40
+ }
41
+ /**
42
+ * Session-scoped implementation of entity permission store.
43
+ *
44
+ * Stores approvals in memory for the duration of the session.
45
+ * Approvals are lost when the session ends or the store is cleared.
46
+ *
47
+ * Permissions are scoped, allowing different tools/categories to have
48
+ * independent approval states for the same entity.
49
+ *
50
+ * This implementation is suitable for session-based permission tracking
51
+ * and can be replaced with a persistent implementation if needed.
52
+ */
53
+ export class SessionEntityPermissionStore {
54
+ permissions;
55
+ constructor() {
56
+ this.permissions = new Map();
57
+ }
58
+ /**
59
+ * Check if access to a specific entity has been approved for a scope.
60
+ *
61
+ * @param entityType - The type of entity to check
62
+ * @param entityId - The unique identifier of the entity
63
+ * @param scope - Permission scope
64
+ * @returns True if the entity has been approved for this scope
65
+ */
66
+ isApproved(entityType, entityId, scope) {
67
+ const scopedPermissions = this.permissions.get(entityType);
68
+ if (!scopedPermissions) {
69
+ return false;
70
+ }
71
+ const approved = scopedPermissions.get(scope);
72
+ return approved?.has(entityId) ?? false;
73
+ }
74
+ /**
75
+ * Approve access to a specific entity for a scope.
76
+ *
77
+ * @param entityType - The type of entity to approve
78
+ * @param entityId - The unique identifier of the entity
79
+ * @param scope - Permission scope
80
+ */
81
+ approve(entityType, entityId, scope) {
82
+ let scopedPermissions = this.permissions.get(entityType);
83
+ if (!scopedPermissions) {
84
+ scopedPermissions = new Map();
85
+ this.permissions.set(entityType, scopedPermissions);
86
+ }
87
+ let approved = scopedPermissions.get(scope);
88
+ if (!approved) {
89
+ approved = new Set();
90
+ scopedPermissions.set(scope, approved);
91
+ }
92
+ approved.add(entityId);
93
+ }
94
+ /**
95
+ * Revoke access to a specific entity for a scope.
96
+ *
97
+ * @param entityType - The type of entity to revoke
98
+ * @param entityId - The unique identifier of the entity
99
+ * @param scope - Permission scope
100
+ */
101
+ revoke(entityType, entityId, scope) {
102
+ const scopedPermissions = this.permissions.get(entityType);
103
+ if (!scopedPermissions) {
104
+ return;
105
+ }
106
+ const approved = scopedPermissions.get(scope);
107
+ approved?.delete(entityId);
108
+ }
109
+ /**
110
+ * Clear all entity approvals across all scopes.
111
+ */
112
+ clear() {
113
+ this.permissions.clear();
114
+ }
115
+ /**
116
+ * Get all approved entity IDs for a specific entity type and optional scope.
117
+ *
118
+ * @param entityType - The type of entity to list approvals for
119
+ * @param scope - Optional permission scope. If provided, returns only approvals
120
+ * for that scope. If omitted, returns all approved entities
121
+ * across all scopes (deduplicated).
122
+ * @returns Array of approved entity IDs for the given type (and scope)
123
+ */
124
+ getApproved(entityType, scope) {
125
+ const scopedPermissions = this.permissions.get(entityType);
126
+ if (!scopedPermissions) {
127
+ return [];
128
+ }
129
+ // If scope provided, return only that scope's entities
130
+ if (scope !== undefined) {
131
+ const approved = scopedPermissions.get(scope);
132
+ return approved ? Array.from(approved) : [];
133
+ }
134
+ // No scope provided - return all entities across all scopes (deduplicated)
135
+ const allEntities = new Set();
136
+ for (const approved of scopedPermissions.values()) {
137
+ for (const entityId of approved) {
138
+ allEntities.add(entityId);
139
+ }
140
+ }
141
+ return Array.from(allEntities);
142
+ }
143
+ }
144
+ //# sourceMappingURL=entity-permissions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"entity-permissions.js","sourceRoot":"","sources":["../../../../src/ai-service/agent/tools2/entity-permissions.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAiBH;;;;;;;GAOG;AACH,MAAM,OAAgB,yBAAyB;IAS7C;;;;;;;OAOG;IACH,WAAW,CAAC,GAAsB;QAChC,OAAO,GAAG,CAAC,IAAI,CAAC,GAAG,CAA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AC,IAAI,CAAC,WAAW,CAAC,CAAC;IACjC,CAAC;CACF"}
@@ -1 +1 @@
1
- {"version":3,"file":"example.d.ts","sourceRoot":"","sources":["../../../../src/ai-service/agent/tools2/example.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAGH,OAAO,EACL,YAAY,EAMb,MAAM,YAAY,CAAC;AAkFpB,wBAAgB,oBAAoB,iBA+CnC;AAMD,wBAAsB,YAAY,kBAuCjC"}
1
+ {"version":3,"file":"example.d.ts","sourceRoot":"","sources":["../../../../src/ai-service/agent/tools2/example.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAGH,OAAO,EACL,YAAY,EAOb,MAAM,YAAY,CAAC;AAkFpB,wBAAgB,oBAAoB,iBAoEnC;AAMD,wBAAsB,YAAY,kBAuCjC"}
@@ -8,7 +8,7 @@
8
8
  * - Executing tools with permissions
9
9
  */
10
10
  import { z } from "zod";
11
- import { ToolRegistry, PermissionLevel, promptForTools, requireRole, createToolFactory, ToolCategory, } from "./index.js";
11
+ import { ToolRegistry, PermissionLevel, ToolPermissionResponse, promptForTools, requireRole, createToolFactory, ToolCategory, } from "./index.js";
12
12
  // ============================================================================
13
13
  // Example Tool: Add Event
14
14
  // ============================================================================
@@ -92,15 +92,34 @@ export function setupExampleRegistry() {
92
92
  // Or use a preset
93
93
  // registry.addAccessRule(...presets.production());
94
94
  // 3. Setup prompt handler
95
- registry.setPromptHandler(async (toolName, input, context) => {
95
+ registry.setPromptHandler(async (tool, input, context) => {
96
96
  console.log(`\n=== User Confirmation Required ===`);
97
- console.log(`Tool: ${toolName}`);
98
- console.log(`Input:`, input);
97
+ console.log(`Tool: ${tool.name}`);
98
+ // Use tool formatting methods if available
99
+ const actionName = tool.getActionName?.();
100
+ const formattedInput = tool.formatInput?.(input);
101
+ if (actionName) {
102
+ console.log(`Action: ${actionName.future}`);
103
+ }
104
+ if (formattedInput) {
105
+ if (formattedInput.targets.length > 0) {
106
+ console.log(`Targets: ${formattedInput.targets.join(", ")}`);
107
+ }
108
+ if (formattedInput.summary) {
109
+ console.log(`Summary: ${formattedInput.summary}`);
110
+ }
111
+ if (formattedInput.details) {
112
+ console.log(`Details:\n${formattedInput.details}`);
113
+ }
114
+ }
115
+ else {
116
+ console.log(`Input:`, input);
117
+ }
99
118
  console.log(`User: ${context.userId} (${context.userRole})`);
100
119
  console.log(`===================================\n`);
101
120
  // In real implementation, show dialog and wait for user response
102
- // For example: return await showConfirmDialog({ toolName, input });
103
- return true; // Mock: auto-approve for demo
121
+ // For example: return await showConfirmDialog({ tool, input });
122
+ return ToolPermissionResponse.ALLOW; // Mock: auto-approve for demo
104
123
  });
105
124
  // 4. Instantiate tools with dependencies
106
125
  const mockDeps = {
@@ -1 +1 @@
1
- {"version":3,"file":"example.js","sourceRoot":"","sources":["../../../../src/ai-service/agent/tools2/example.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACL,YAAY,EACZ,eAAe,EACf,cAAc,EACd,WAAW,EACX,iBAAiB,EACjB,YAAY,GACb,MAAM,YAAY,CAAC;AAEpB,+EAA+E;AAC/E,0BAA0B;AAC1B,+EAA+E;AAE/E,MAAM,mBAAmB,GAAG,iBAAiB,CAC3C,WAAW,EACX,CAAC,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE;IAC5B,sDAAsD;IACtD,MAAM,aAAa,GAAG,CAAC;SACpB,MAAM,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,QAAQ,EAAE,SAAS,CAAC,CAAC,CAAC;SAC3D,QAAQ,EAAE,CAAC;IAEd,OAAO;QACL,WAAW,EAAE,8BAA8B;QAC3C,QAAQ,EAAE,YAAY,CAAC,SAAS;QAChC,iBAAiB,EAAE,eAAe,CAAC,KAAK;QACxC,WAAW,EAAE,CAAC,CAAC,MAAM,CAAC;YACpB,WAAW,E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pD,+BAA+B;IAC/B,OAAO,CAAC,GAAG,CAAC,oCAAoC,CAAC,CAAC;IAClD,MAAM,QAAQ,GAAG,QAAQ,CAAC,eAAe,EAAE,CAAC;IAC5C,OAAO,CAAC,GAAG,CAAC,gBAAgB,EAAE,QAAQ,CAAC,CAAC;AAC1C,CAAC;AAED,6BAA6B;AAC7B,kBAAkB"}
@@ -7,8 +7,10 @@
7
7
  * - User prompt handling
8
8
  * - Type-safe tool definitions
9
9
  */
10
- export type { Tool, ToolFactory, ToolExecutionResult, AccessControlContext, AccessControlRule, PromptHandler, } from "./types.js";
11
- export { PermissionLevel, ToolCategory, createToolFactory } from "./types.js";
10
+ export type { Tool, ToolFactory, ToolExecutionResult, AccessControlContext, AccessControlRule, PromptHandler, EntityReference, } from "./types.js";
11
+ export { PermissionLevel, ToolCategory, ToolPermissionResponse, createToolFactory, } from "./types.js";
12
+ export type { EntityPermissionStore } from "./entity-permissions.js";
13
+ export { SessionEntityPermissionStore } from "./entity-permissions.js";
12
14
  export { ToolRegistry } from "./registry.js";
13
15
  export { blockTools, promptForTools, requireRole, combineRules, forTools, forCategory, presets, } from "./access-control.js";
14
16
  import { ToolRegistry } from "./registry.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/ai-service/agent/tools2/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAGH,YAAY,EACV,IAAI,EACJ,WAAW,EACX,mBAAmB,EACnB,oBAAoB,EACpB,iBAAiB,EACjB,aAAa,GACd,MAAM,YAAY,CAAC;AAEpB,OAAO,EAAE,eAAe,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAG9E,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAG7C,OAAO,EACL,UAAU,EACV,cAAc,EACd,WAAW,EACX,YAAY,EACZ,QAAQ,EACR,WAAW,EACX,OAAO,GACR,MAAM,qBAAqB,CAAC;AAG7B,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAC7C,eAAO,MAAM,eAAe,cAAqB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/ai-service/agent/tools2/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAGH,YAAY,EACV,IAAI,EACJ,WAAW,EACX,mBAAmB,EACnB,oBAAoB,EACpB,iBAAiB,EACjB,aAAa,EACb,eAAe,GAChB,MAAM,YAAY,CAAC;AAEpB,OAAO,EACL,eAAe,EACf,YAAY,EACZ,sBAAsB,EACtB,iBAAiB,GAClB,MAAM,YAAY,CAAC;AAGpB,YAAY,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AACrE,OAAO,EAAE,4BAA4B,EAAE,MAAM,yBAAyB,CAAC;AAGvE,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAG7C,OAAO,EACL,UAAU,EACV,cAAc,EACd,WAAW,EACX,YAAY,EACZ,QAAQ,EACR,WAAW,EACX,OAAO,GACR,MAAM,qBAAqB,CAAC;AAG7B,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAC7C,eAAO,MAAM,eAAe,cAAqB,CAAC"}
@@ -7,7 +7,8 @@
7
7
  * - User prompt handling
8
8
  * - Type-safe tool definitions
9
9
  */
10
- export { PermissionLevel, ToolCategory, createToolFactory } from "./types.js";
10
+ export { PermissionLevel, ToolCategory, ToolPermissionResponse, createToolFactory, } from "./types.js";
11
+ export { SessionEntityPermissionStore } from "./entity-permissions.js";
11
12
  // Export registry
12
13
  export { ToolRegistry } from "./registry.js";
13
14
  // Export access control utilities
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/ai-service/agent/tools2/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAYH,OAAO,EAAE,eAAe,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAE9E,kBAAkB;AAClB,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAE7C,kCAAkC;AAClC,OAAO,EACL,UAAU,EACV,cAAc,EACd,WAAW,EACX,YAAY,EACZ,QAAQ,EACR,WAAW,EACX,OAAO,GACR,MAAM,qBAAqB,CAAC;AAE7B,4CAA4C;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAC7C,MAAM,CAAC,MAAM,eAAe,GAAG,IAAI,YAAY,EAAE,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/ai-service/agent/tools2/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAaH,OAAO,EACL,eAAe,EACf,YAAY,EACZ,sBAAsB,EACtB,iBAAiB,GAClB,MAAM,YAAY,CAAC;AAIpB,OAAO,EAAE,4BAA4B,EAAE,MAAM,yBAAyB,CAAC;AAEvE,kBAAkB;AAClB,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAE7C,kCAAkC;AAClC,OAAO,EACL,UAAU,EACV,cAAc,EACd,WAAW,EACX,YAAY,EACZ,QAAQ,EACR,WAAW,EACX,OAAO,GACR,MAAM,qBAAqB,CAAC;AAE7B,4CAA4C;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAC7C,MAAM,CAAC,MAAM,eAAe,GAAG,IAAI,YAAY,EAAE,CAAC"}
@@ -1,4 +1,5 @@
1
1
  import { type Tool, type ToolFactory, type AccessControlContext, type AccessControlRule, type PromptHandler, type ToolExecutionResult, PermissionLevel, type ToolMiddleware } from "./types.js";
2
+ import type { EntityPermissionStore } from "./entity-permissions.js";
2
3
  import type { ToolCallOptions } from "ai";
3
4
  /**
4
5
  * Central registry for tools with access control.
@@ -15,6 +16,9 @@ export declare class ToolRegistry {
15
16
  private accessRules;
16
17
  private middleware;
17
18
  private promptHandler?;
19
+ private promptQueue;
20
+ private entityPermissionStore?;
21
+ private scopeStrategy;
18
22
  /**
19
23
  * Register a tool factory and optionally instantiate it immediately.
20
24
  *
@@ -121,6 +125,26 @@ export declare class ToolRegistry {
121
125
  * @param handler - Prompt handler function
122
126
  */
123
127
  setPromptHandler(handler: PromptHandler): void;
128
+ /**
129
+ * Set entity permission store for tracking per-entity approvals.
130
+ *
131
+ * When set, tools with `extractEntities` defined will automatically
132
+ * check if extracted entities have been approved before execution.
133
+ * If any entity is not approved, the user will be prompted.
134
+ *
135
+ * @param store - Entity permission store instance
136
+ */
137
+ setEntityPermissionStore(store: EntityPermissionStore): void;
138
+ /**
139
+ * Get permission scope for a tool.
140
+ *
141
+ * Computes the scope string using the configured strategy.
142
+ * This scope is used to isolate permissions between different tools/categories.
143
+ *
144
+ * @param tool - Tool to get scope for
145
+ * @returns Permission scope string
146
+ */
147
+ private getToolPermissionScope;
124
148
  /**
125
149
  * Check permission level for tool execution.
126
150
  *
@@ -143,6 +167,29 @@ export declare class ToolRegistry {
143
167
  * @returns Execution result with success status and data/error
144
168
  */
145
169
  execute<Input, Output>(toolName: string, input: Input, context?: AccessControlContext, options?: ToolCallOptions): Promise<ToolExecutionResult<Output>>;
170
+ /**
171
+ * Check if we need to prompt the user for a tool with PROMPT permission.
172
+ *
173
+ * For tools with entity extraction, returns false if all entities are already
174
+ * approved for this tool's scope (skipping the prompt). For tools without
175
+ * entity extraction, always returns true (standard prompting).
176
+ *
177
+ * @param tool - Tool to check
178
+ * @param input - Tool input to extract entities from
179
+ * @returns True if we should prompt user, false if we can skip
180
+ */
181
+ private shouldPromptForEntities;
182
+ /**
183
+ * Store entity approvals after successful user prompt.
184
+ *
185
+ * Extracts entities from tool input and marks them as approved for this
186
+ * tool's scope in the entity permission store. No-op if entity system
187
+ * is not configured.
188
+ *
189
+ * @param tool - Tool that was approved
190
+ * @param input - Tool input to extract entities from
191
+ */
192
+ private approveEntitiesAfterPrompt;
146
193
  /**
147
194
  * Wrap a tool to enforce access control on execute().
148
195
  *
@@ -1 +1 @@
1
- {"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../../../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