@elliotding/ai-agent-mcp 0.1.25 → 0.1.26

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 (237) hide show
  1. package/package.json +4 -1
  2. package/.prompt-cache/cmd-cmd-client-sdk-ai-hub-generate-testcase.md +0 -101
  3. package/.prompt-cache/cmd-cmd-client-sdk-ai-hub-submit_zct_job.md +0 -158
  4. package/.prompt-cache/skill-skill-client-sdk-ai-hub-analyze-conf-status.md +0 -311
  5. package/.prompt-cache/skill-skill-client-sdk-ai-hub-analyze-sdk-log.md +0 -64
  6. package/.prompt-cache/skill-skill-client-sdk-ai-hub-analyze-zmb-log-errors.md +0 -84
  7. package/ai-resource-telemetry.json +0 -40
  8. package/dist/api/cached-client.d.ts +0 -48
  9. package/dist/api/cached-client.d.ts.map +0 -1
  10. package/dist/api/cached-client.js +0 -126
  11. package/dist/api/cached-client.js.map +0 -1
  12. package/dist/api/client.d.ts +0 -281
  13. package/dist/api/client.d.ts.map +0 -1
  14. package/dist/api/client.js +0 -371
  15. package/dist/api/client.js.map +0 -1
  16. package/dist/auth/index.d.ts +0 -8
  17. package/dist/auth/index.d.ts.map +0 -1
  18. package/dist/auth/index.js +0 -26
  19. package/dist/auth/index.js.map +0 -1
  20. package/dist/auth/middleware.d.ts +0 -36
  21. package/dist/auth/middleware.d.ts.map +0 -1
  22. package/dist/auth/middleware.js +0 -194
  23. package/dist/auth/middleware.js.map +0 -1
  24. package/dist/auth/permissions.d.ts +0 -60
  25. package/dist/auth/permissions.d.ts.map +0 -1
  26. package/dist/auth/permissions.js +0 -262
  27. package/dist/auth/permissions.js.map +0 -1
  28. package/dist/auth/token-validator.d.ts +0 -52
  29. package/dist/auth/token-validator.d.ts.map +0 -1
  30. package/dist/auth/token-validator.js +0 -215
  31. package/dist/auth/token-validator.js.map +0 -1
  32. package/dist/cache/cache-manager.d.ts +0 -49
  33. package/dist/cache/cache-manager.d.ts.map +0 -1
  34. package/dist/cache/cache-manager.js +0 -191
  35. package/dist/cache/cache-manager.js.map +0 -1
  36. package/dist/cache/index.d.ts +0 -6
  37. package/dist/cache/index.d.ts.map +0 -1
  38. package/dist/cache/index.js +0 -12
  39. package/dist/cache/index.js.map +0 -1
  40. package/dist/cache/redis-client.d.ts +0 -45
  41. package/dist/cache/redis-client.d.ts.map +0 -1
  42. package/dist/cache/redis-client.js +0 -210
  43. package/dist/cache/redis-client.js.map +0 -1
  44. package/dist/config/constants.d.ts +0 -28
  45. package/dist/config/constants.d.ts.map +0 -1
  46. package/dist/config/constants.js +0 -31
  47. package/dist/config/constants.js.map +0 -1
  48. package/dist/config/index.d.ts +0 -71
  49. package/dist/config/index.d.ts.map +0 -1
  50. package/dist/config/index.js +0 -190
  51. package/dist/config/index.js.map +0 -1
  52. package/dist/filesystem/manager.d.ts +0 -45
  53. package/dist/filesystem/manager.d.ts.map +0 -1
  54. package/dist/filesystem/manager.js +0 -246
  55. package/dist/filesystem/manager.js.map +0 -1
  56. package/dist/git/multi-source-manager.d.ts +0 -78
  57. package/dist/git/multi-source-manager.d.ts.map +0 -1
  58. package/dist/git/multi-source-manager.js +0 -577
  59. package/dist/git/multi-source-manager.js.map +0 -1
  60. package/dist/git/operations.d.ts +0 -27
  61. package/dist/git/operations.d.ts.map +0 -1
  62. package/dist/git/operations.js +0 -83
  63. package/dist/git/operations.js.map +0 -1
  64. package/dist/index.d.ts +0 -6
  65. package/dist/index.d.ts.map +0 -1
  66. package/dist/index.js +0 -122
  67. package/dist/index.js.map +0 -1
  68. package/dist/monitoring/health.d.ts +0 -35
  69. package/dist/monitoring/health.d.ts.map +0 -1
  70. package/dist/monitoring/health.js +0 -105
  71. package/dist/monitoring/health.js.map +0 -1
  72. package/dist/prompts/cache.d.ts +0 -69
  73. package/dist/prompts/cache.d.ts.map +0 -1
  74. package/dist/prompts/cache.js +0 -163
  75. package/dist/prompts/cache.js.map +0 -1
  76. package/dist/prompts/generator.d.ts +0 -49
  77. package/dist/prompts/generator.d.ts.map +0 -1
  78. package/dist/prompts/generator.js +0 -160
  79. package/dist/prompts/generator.js.map +0 -1
  80. package/dist/prompts/index.d.ts +0 -13
  81. package/dist/prompts/index.d.ts.map +0 -1
  82. package/dist/prompts/index.js +0 -24
  83. package/dist/prompts/index.js.map +0 -1
  84. package/dist/prompts/manager.d.ts +0 -207
  85. package/dist/prompts/manager.d.ts.map +0 -1
  86. package/dist/prompts/manager.js +0 -566
  87. package/dist/prompts/manager.js.map +0 -1
  88. package/dist/resources/index.d.ts +0 -6
  89. package/dist/resources/index.d.ts.map +0 -1
  90. package/dist/resources/index.js +0 -10
  91. package/dist/resources/index.js.map +0 -1
  92. package/dist/resources/loader.d.ts +0 -88
  93. package/dist/resources/loader.d.ts.map +0 -1
  94. package/dist/resources/loader.js +0 -492
  95. package/dist/resources/loader.js.map +0 -1
  96. package/dist/server/http.d.ts +0 -57
  97. package/dist/server/http.d.ts.map +0 -1
  98. package/dist/server/http.js +0 -435
  99. package/dist/server/http.js.map +0 -1
  100. package/dist/server.d.ts +0 -13
  101. package/dist/server.d.ts.map +0 -1
  102. package/dist/server.js +0 -201
  103. package/dist/server.js.map +0 -1
  104. package/dist/session/manager.d.ts +0 -91
  105. package/dist/session/manager.d.ts.map +0 -1
  106. package/dist/session/manager.js +0 -251
  107. package/dist/session/manager.js.map +0 -1
  108. package/dist/telemetry/index.d.ts +0 -3
  109. package/dist/telemetry/index.d.ts.map +0 -1
  110. package/dist/telemetry/index.js +0 -7
  111. package/dist/telemetry/index.js.map +0 -1
  112. package/dist/telemetry/manager.d.ts +0 -151
  113. package/dist/telemetry/manager.d.ts.map +0 -1
  114. package/dist/telemetry/manager.js +0 -367
  115. package/dist/telemetry/manager.js.map +0 -1
  116. package/dist/tools/index.d.ts +0 -13
  117. package/dist/tools/index.d.ts.map +0 -1
  118. package/dist/tools/index.js +0 -29
  119. package/dist/tools/index.js.map +0 -1
  120. package/dist/tools/manage-subscription.d.ts +0 -47
  121. package/dist/tools/manage-subscription.d.ts.map +0 -1
  122. package/dist/tools/manage-subscription.js +0 -317
  123. package/dist/tools/manage-subscription.js.map +0 -1
  124. package/dist/tools/registry.d.ts +0 -40
  125. package/dist/tools/registry.d.ts.map +0 -1
  126. package/dist/tools/registry.js +0 -85
  127. package/dist/tools/registry.js.map +0 -1
  128. package/dist/tools/resolve-prompt-content.d.ts +0 -35
  129. package/dist/tools/resolve-prompt-content.d.ts.map +0 -1
  130. package/dist/tools/resolve-prompt-content.js +0 -99
  131. package/dist/tools/resolve-prompt-content.js.map +0 -1
  132. package/dist/tools/search-resources.d.ts +0 -35
  133. package/dist/tools/search-resources.d.ts.map +0 -1
  134. package/dist/tools/search-resources.js +0 -159
  135. package/dist/tools/search-resources.js.map +0 -1
  136. package/dist/tools/sync-resources.d.ts +0 -54
  137. package/dist/tools/sync-resources.d.ts.map +0 -1
  138. package/dist/tools/sync-resources.js +0 -735
  139. package/dist/tools/sync-resources.js.map +0 -1
  140. package/dist/tools/track-usage.d.ts +0 -63
  141. package/dist/tools/track-usage.d.ts.map +0 -1
  142. package/dist/tools/track-usage.js +0 -90
  143. package/dist/tools/track-usage.js.map +0 -1
  144. package/dist/tools/uninstall-resource.d.ts +0 -30
  145. package/dist/tools/uninstall-resource.d.ts.map +0 -1
  146. package/dist/tools/uninstall-resource.js +0 -174
  147. package/dist/tools/uninstall-resource.js.map +0 -1
  148. package/dist/tools/upload-resource.d.ts +0 -81
  149. package/dist/tools/upload-resource.d.ts.map +0 -1
  150. package/dist/tools/upload-resource.js +0 -393
  151. package/dist/tools/upload-resource.js.map +0 -1
  152. package/dist/transport/sse.d.ts +0 -29
  153. package/dist/transport/sse.d.ts.map +0 -1
  154. package/dist/transport/sse.js +0 -271
  155. package/dist/transport/sse.js.map +0 -1
  156. package/dist/types/errors.d.ts +0 -60
  157. package/dist/types/errors.d.ts.map +0 -1
  158. package/dist/types/errors.js +0 -112
  159. package/dist/types/errors.js.map +0 -1
  160. package/dist/types/index.d.ts +0 -7
  161. package/dist/types/index.d.ts.map +0 -1
  162. package/dist/types/index.js +0 -23
  163. package/dist/types/index.js.map +0 -1
  164. package/dist/types/mcp.d.ts +0 -50
  165. package/dist/types/mcp.d.ts.map +0 -1
  166. package/dist/types/mcp.js +0 -6
  167. package/dist/types/mcp.js.map +0 -1
  168. package/dist/types/resources.d.ts +0 -109
  169. package/dist/types/resources.d.ts.map +0 -1
  170. package/dist/types/resources.js +0 -7
  171. package/dist/types/resources.js.map +0 -1
  172. package/dist/types/tools.d.ts +0 -253
  173. package/dist/types/tools.d.ts.map +0 -1
  174. package/dist/types/tools.js +0 -6
  175. package/dist/types/tools.js.map +0 -1
  176. package/dist/utils/cursor-paths.d.ts +0 -84
  177. package/dist/utils/cursor-paths.d.ts.map +0 -1
  178. package/dist/utils/cursor-paths.js +0 -166
  179. package/dist/utils/cursor-paths.js.map +0 -1
  180. package/dist/utils/log-cleaner.d.ts +0 -18
  181. package/dist/utils/log-cleaner.d.ts.map +0 -1
  182. package/dist/utils/log-cleaner.js +0 -112
  183. package/dist/utils/log-cleaner.js.map +0 -1
  184. package/dist/utils/logger.d.ts +0 -59
  185. package/dist/utils/logger.d.ts.map +0 -1
  186. package/dist/utils/logger.js +0 -292
  187. package/dist/utils/logger.js.map +0 -1
  188. package/dist/utils/validation.d.ts +0 -58
  189. package/dist/utils/validation.d.ts.map +0 -1
  190. package/dist/utils/validation.js +0 -214
  191. package/dist/utils/validation.js.map +0 -1
  192. package/src/api/cached-client.ts +0 -144
  193. package/src/api/client.ts +0 -697
  194. package/src/auth/index.ts +0 -11
  195. package/src/auth/middleware.ts +0 -244
  196. package/src/auth/permissions.ts +0 -323
  197. package/src/auth/token-validator.ts +0 -292
  198. package/src/cache/cache-manager.ts +0 -243
  199. package/src/cache/index.ts +0 -6
  200. package/src/cache/redis-client.ts +0 -249
  201. package/src/config/constants.ts +0 -33
  202. package/src/config/index.ts +0 -269
  203. package/src/filesystem/manager.ts +0 -235
  204. package/src/git/multi-source-manager.ts +0 -654
  205. package/src/git/operations.ts +0 -93
  206. package/src/index.ts +0 -157
  207. package/src/monitoring/health.ts +0 -132
  208. package/src/prompts/cache.ts +0 -140
  209. package/src/prompts/generator.ts +0 -143
  210. package/src/prompts/index.ts +0 -20
  211. package/src/prompts/manager.ts +0 -718
  212. package/src/resources/index.ts +0 -13
  213. package/src/resources/loader.ts +0 -563
  214. package/src/server/http.ts +0 -549
  215. package/src/server.ts +0 -206
  216. package/src/session/manager.ts +0 -296
  217. package/src/telemetry/index.ts +0 -10
  218. package/src/telemetry/manager.ts +0 -419
  219. package/src/tools/index.ts +0 -13
  220. package/src/tools/manage-subscription.ts +0 -388
  221. package/src/tools/registry.ts +0 -97
  222. package/src/tools/resolve-prompt-content.ts +0 -113
  223. package/src/tools/search-resources.ts +0 -185
  224. package/src/tools/sync-resources.ts +0 -829
  225. package/src/tools/track-usage.ts +0 -113
  226. package/src/tools/uninstall-resource.ts +0 -199
  227. package/src/tools/upload-resource.ts +0 -431
  228. package/src/transport/sse.ts +0 -308
  229. package/src/types/errors.ts +0 -146
  230. package/src/types/index.ts +0 -7
  231. package/src/types/mcp.ts +0 -61
  232. package/src/types/resources.ts +0 -141
  233. package/src/types/tools.ts +0 -305
  234. package/src/utils/cursor-paths.ts +0 -135
  235. package/src/utils/log-cleaner.ts +0 -92
  236. package/src/utils/logger.ts +0 -333
  237. package/src/utils/validation.ts +0 -262
@@ -1,109 +0,0 @@
1
- /**
2
- * AI Resources Type Definitions
3
- * Defines types for multi-source AI resource management
4
- */
5
- /**
6
- * Resource type enumeration
7
- */
8
- export type ResourceType = 'commands' | 'skills' | 'mcp' | 'rules';
9
- /**
10
- * Resource source configuration
11
- */
12
- export interface ResourceSource {
13
- /** Source name (identifier) */
14
- name: string;
15
- /** Relative path to AI-Resources root */
16
- path: string;
17
- /** Whether this source is enabled */
18
- enabled: boolean;
19
- /** Priority (higher number = higher priority) */
20
- priority: number;
21
- /** Mapping of resource types to subdirectories */
22
- resources: Partial<Record<ResourceType, string>>;
23
- /** Optional description */
24
- description?: string;
25
- }
26
- /**
27
- * AI Resources configuration
28
- */
29
- export interface AIResourcesConfig {
30
- /** Configuration version */
31
- version: string;
32
- /** Optional description */
33
- description?: string;
34
- /** Default resource source (always loaded) */
35
- default_source: ResourceSource;
36
- /** Extended resource sources */
37
- extended_sources: ResourceSource[];
38
- /** Supported resource types */
39
- resource_types: ResourceType[];
40
- /** Loading order strategy */
41
- loading_order: 'priority_desc' | 'priority_asc' | 'name_asc';
42
- /** Conflict resolution strategy */
43
- conflict_resolution: 'highest_priority_wins' | 'merge' | 'error';
44
- /** Cache configuration */
45
- cache?: {
46
- enabled: boolean;
47
- ttl: number;
48
- };
49
- }
50
- /**
51
- * Resource metadata
52
- */
53
- export interface ResourceMetadata {
54
- /** Resource ID */
55
- id: string;
56
- /** Resource name */
57
- name: string;
58
- /** Resource type */
59
- type: ResourceType;
60
- /** Source name */
61
- source: string;
62
- /** Source priority */
63
- priority: number;
64
- /** Full file path */
65
- path: string;
66
- /** Version (if available) */
67
- version?: string;
68
- /** Description (if available) */
69
- description?: string;
70
- /** Tags (if available) */
71
- tags?: string[];
72
- }
73
- /**
74
- * Resource conflict information
75
- */
76
- export interface ResourceConflict {
77
- /** Resource name */
78
- name: string;
79
- /** Resource type */
80
- type: ResourceType;
81
- /** Conflicting resources */
82
- conflicts: Array<{
83
- source: string;
84
- priority: number;
85
- path: string;
86
- }>;
87
- /** Selected resource (after conflict resolution) */
88
- selected: {
89
- source: string;
90
- priority: number;
91
- path: string;
92
- };
93
- }
94
- /**
95
- * Resource loader statistics
96
- */
97
- export interface LoaderStats {
98
- /** Total sources loaded */
99
- sourcesLoaded: number;
100
- /** Total resources indexed */
101
- resourcesIndexed: number;
102
- /** Resources by type */
103
- byType: Record<ResourceType, number>;
104
- /** Conflicts detected */
105
- conflictsDetected: number;
106
- /** Load duration (ms) */
107
- loadDuration: number;
108
- }
109
- //# sourceMappingURL=resources.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":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IAAI,EAAE,YAAY,CAAC;IAEnB,kBAAkB;IAClB,MAAM,EAAE,MAAM,CAAC;IAEf,sBAAsB;IACtB,QAAQ,EAAE,MAAM,CAAC;IAEjB,qBAAqB;IACrB,IAAI,EAAE,MAAM,CAAC;IAEb,6BAA6B;IAC7B,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB,iCAAiC;IACjC,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB,0BAA0B;IAC1B,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;CACjB;AAED;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,oBAAoB;IACpB,IAAI,EAAE,MAAM,CAAC;IAEb,oBAAoB;IACpB,IAAI,EAAE,YAAY,CAAC;IAEnB,4BAA4B;IAC5B,SAAS,EAAE,KAAK,CAAC;QACf,MAAM,EAAE,MAAM,CAAC;QACf,QAAQ,EAAE,MAAM,CAAC;QACjB,IAAI,EAAE,MAAM,CAAC;KACd,CAAC,CAAC;IAEH,oDAAoD;IACpD,QAAQ,EAAE;QACR,MAAM,EAAE,MAAM,CAAC;QACf,QAAQ,EAAE,MAAM,CAAC;QACjB,IAAI,EAAE,MAAM,CAAC;KACd,CAAC;CACH;AAED;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,2BAA2B;IAC3B,aAAa,EAAE,MAAM,CAAC;IAEtB,8BAA8B;IAC9B,gBAAgB,EAAE,MAAM,CAAC;IAEzB,wBAAwB;IACxB,MAAM,EAAE,MAAM,CAAC,YAAY,EAAE,MAAM,CAAC,CAAC;IAErC,yBAAyB;IACzB,iBAAiB,EAAE,MAAM,CAAC;IAE1B,yBAAyB;IACzB,YAAY,EAAE,MAAM,CAAC;CACtB"}
@@ -1,7 +0,0 @@
1
- "use strict";
2
- /**
3
- * AI Resources Type Definitions
4
- * Defines types for multi-source AI resource management
5
- */
6
- Object.defineProperty(exports, "__esModule", { value: true });
7
- //# sourceMappingURL=resources.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"resources.js","sourceRoot":"","sources":["../../src/types/resources.ts"],"names":[],"mappings":";AAAA;;;GAGG"}
@@ -1,253 +0,0 @@
1
- /**
2
- * MCP Tool Types
3
- */
4
- import type { MCPToolSchema } from './mcp';
5
- export interface WriteFileAction {
6
- action: 'write_file';
7
- /** Absolute path on the user's local machine (may start with ~). */
8
- path: string;
9
- /** UTF-8 file content to write. */
10
- content: string;
11
- }
12
- export interface DeleteFileAction {
13
- action: 'delete_file';
14
- /** Absolute path on the user's local machine (may start with ~). */
15
- path: string;
16
- /** When true, recursively delete a directory. */
17
- recursive?: boolean;
18
- }
19
- export interface MergeMcpJsonAction {
20
- action: 'merge_mcp_json';
21
- /** Absolute path to the user's mcp.json file. */
22
- mcp_json_path: string;
23
- /** Key under mcpServers to add or update. */
24
- server_name: string;
25
- /** The MCP server entry object to merge in. */
26
- entry: Record<string, unknown>;
27
- /** env keys that are currently empty and must be filled by the user. */
28
- missing_env?: string[];
29
- /** Human-readable hint when manual env configuration is required. */
30
- setup_hint?: string;
31
- /** Path to a local setup/readme doc if one exists in the install dir. */
32
- setup_doc?: string;
33
- /**
34
- * When true, the AI MUST skip this action if `mcpServers[server_name]`
35
- * already exists in mcp.json (regardless of content).
36
- * Use this for idempotent installs where re-writing would clobber
37
- * user-customised values (e.g. env vars the user has already filled in).
38
- */
39
- skip_if_exists?: boolean;
40
- }
41
- export interface RemoveMcpJsonEntryAction {
42
- action: 'remove_mcp_json_entry';
43
- /** Absolute path to the user's mcp.json file. */
44
- mcp_json_path: string;
45
- /** Key under mcpServers to remove. */
46
- server_name: string;
47
- }
48
- export type LocalAction = WriteFileAction | DeleteFileAction | MergeMcpJsonAction | RemoveMcpJsonEntryAction;
49
- export type ToolHandler = (params: unknown) => Promise<ToolResult>;
50
- export interface ToolDefinition {
51
- name: string;
52
- description: string;
53
- inputSchema: MCPToolSchema;
54
- handler: ToolHandler;
55
- }
56
- export interface ToolResult<T = unknown> {
57
- success: boolean;
58
- data?: T;
59
- error?: {
60
- code: string;
61
- message: string;
62
- details?: unknown;
63
- };
64
- }
65
- export interface SyncResourcesParams {
66
- mode?: 'check' | 'incremental' | 'full';
67
- scope?: 'global' | 'workspace' | 'all';
68
- types?: string[];
69
- /**
70
- * CSP API token from the user's mcp.json env configuration.
71
- * Overrides the server-level fallback token so that each user
72
- * makes API calls with their own identity.
73
- */
74
- user_token?: string;
75
- /**
76
- * List of MCP server names that are already configured in the user's
77
- * ~/.cursor/mcp.json. The server will skip downloading and generating
78
- * write_file actions for these MCP resources to reduce overhead.
79
- *
80
- * Set this to the keys from mcpServers in ~/.cursor/mcp.json:
81
- * Object.keys(JSON.parse(fs.readFileSync('~/.cursor/mcp.json')).mcpServers || {})
82
- *
83
- * Only applies in 'incremental' mode; 'full' mode always downloads everything.
84
- */
85
- configured_mcp_servers?: string[];
86
- }
87
- export interface McpSetupItem {
88
- /** MCP server name as it appears in mcp.json */
89
- server_name: string;
90
- /** Human-readable path to mcp.json on this platform */
91
- mcp_json_path: string;
92
- /** env keys that are currently empty and need user input */
93
- missing_env: string[];
94
- /** true when the registered command might not be correct for this machine */
95
- command_needs_verification: boolean;
96
- /** the command string that was registered */
97
- command: string;
98
- /** freeform guidance shown to the user */
99
- setup_hint: string;
100
- /** absolute path to a local setup/readme doc found in the install directory, if any */
101
- setup_doc?: string;
102
- }
103
- export interface SyncResourcesResult {
104
- mode: string;
105
- health_score: number;
106
- summary: {
107
- total: number;
108
- synced: number;
109
- cached: number;
110
- failed: number;
111
- };
112
- details: Array<{
113
- id: string;
114
- name: string;
115
- action: string;
116
- version: string;
117
- }>;
118
- /**
119
- * MCP servers that were installed/updated but require manual configuration
120
- * before they can be used. Present only when at least one server needs setup.
121
- * @deprecated use local_actions_required MergeMcpJsonAction.missing_env instead
122
- */
123
- pending_setup?: McpSetupItem[];
124
- /**
125
- * Ordered list of file-system and mcp.json operations the AI Agent must
126
- * execute on the user's LOCAL machine after receiving this response.
127
- * Present only when at least one Rule or MCP resource was synced.
128
- *
129
- * The AI MUST execute every action in order before reporting success to the
130
- * user. See LocalAction type variants for details.
131
- */
132
- local_actions_required?: LocalAction[];
133
- }
134
- export interface ManageSubscriptionParams {
135
- action: 'subscribe' | 'unsubscribe' | 'list' | 'batch_subscribe' | 'batch_unsubscribe';
136
- resource_ids?: string[];
137
- auto_sync?: boolean;
138
- scope?: 'global' | 'workspace';
139
- notify?: boolean;
140
- /** CSP API token from the user's mcp.json env configuration. */
141
- user_token?: string;
142
- }
143
- export interface ManageSubscriptionResult {
144
- action: string;
145
- success: boolean;
146
- subscriptions?: Array<{
147
- id: string;
148
- name: string;
149
- type: string;
150
- subscribed_at: string;
151
- }>;
152
- message?: string;
153
- /** Sync results for each resource after auto-sync on subscribe */
154
- sync_details?: Array<{
155
- id: string;
156
- name: string;
157
- action: string;
158
- }>;
159
- /** MCP servers that need manual configuration after auto-sync */
160
- pending_setup?: unknown[];
161
- }
162
- export interface SearchResourcesParams {
163
- team?: string;
164
- type?: string;
165
- keyword: string;
166
- /** CSP API token from the user's mcp.json env configuration. */
167
- user_token?: string;
168
- }
169
- export interface SearchResourcesResult {
170
- total: number;
171
- results: Array<{
172
- id: string;
173
- name: string;
174
- type: string;
175
- team: string;
176
- version: string;
177
- description: string;
178
- score: number;
179
- is_subscribed: boolean;
180
- is_installed: boolean;
181
- }>;
182
- }
183
- export interface ResolvePromptContentParams {
184
- prompt_name?: string;
185
- resource_id?: string;
186
- /** CSP API token from the user's mcp.json env configuration. */
187
- user_token?: string;
188
- /** Optional Jira Issue ID for usage correlation. */
189
- jira_id?: string;
190
- }
191
- export interface ResolvePromptContentResult {
192
- prompt_name: string;
193
- resource_id: string;
194
- resource_type: 'command' | 'skill';
195
- resource_name: string;
196
- description: string;
197
- content: string;
198
- content_source: 'cache' | 'generated' | 'raw_fallback';
199
- usage_tracked: boolean;
200
- }
201
- export interface FileEntry {
202
- path: string;
203
- content: string;
204
- }
205
- export interface UploadResourceParams {
206
- resource_id: string;
207
- /** Resource category. Optional — auto-detected from file structure when omitted. */
208
- type?: 'command' | 'skill' | 'rule' | 'mcp';
209
- message: string;
210
- /** Human-readable resource name sent to the CSP API. Defaults to the primary file name (without extension). */
211
- name?: string;
212
- /** Target source repo from ai-resources-config.json (e.g. "csp", "client-sdk-ai-hub"). Defaults to default_source. */
213
- target_source?: string;
214
- team?: string;
215
- /** File list to upload. Paths are relative to the type subdir of the chosen source. Any file extension allowed. */
216
- files: FileEntry[];
217
- title?: string;
218
- metadata?: Record<string, unknown>;
219
- /** CSP API token from the user's mcp.json env configuration. */
220
- user_token?: string;
221
- }
222
- export interface UploadResourceResult {
223
- resource_id: string;
224
- version: string;
225
- url: string;
226
- commit_hash: string;
227
- message: string;
228
- }
229
- export interface UninstallResourceParams {
230
- resource_id_or_name: string;
231
- remove_from_account?: boolean;
232
- /** When known, the resource type — narrows which local_actions are emitted. */
233
- resource_type?: 'command' | 'skill' | 'rule' | 'mcp';
234
- /** CSP API token from the user's mcp.json env configuration. */
235
- user_token?: string;
236
- }
237
- export interface UninstallResourceResult {
238
- success: boolean;
239
- removed_resources: Array<{
240
- id: string;
241
- name: string;
242
- path: string;
243
- }>;
244
- subscription_removed: boolean;
245
- message: string;
246
- /**
247
- * Ordered list of file-system and mcp.json operations the AI Agent must
248
- * execute on the user's LOCAL machine after receiving this response.
249
- * Present only for Rule and local-executable MCP resources.
250
- */
251
- local_actions_required?: LocalAction[];
252
- }
253
- //# sourceMappingURL=tools.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"tools.d.ts","sourceRoot":"","sources":["../../src/types/tools.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAc3C,MAAM,WAAW,eAAe;IAC9B,MAAM,EAAE,YAAY,CAAC;IACrB,oEAAoE;IACpE,IAAI,EAAE,MAAM,CAAC;IACb,mCAAmC;IACnC,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,gBAAgB;IAC/B,MAAM,E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AAC,CAAC;IACnC,gEAAgE;IAChE,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,oBAAoB;IACnC,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;IAChB,GAAG,EAAE,MAAM,CAAC;IACZ,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;CACjB;AAGD,MAAM,WAAW,uBAAuB;IACtC,mBAAmB,EAAE,MAAM,CAAC;IAC5B,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,+EAA+E;IAC/E,aAAa,CAAC,EAAE,SAAS,GAAG,OAAO,GAAG,MAAM,GAAG,KAAK,CAAC;IACrD,gEAAgE;IAChE,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,uBAAuB;IACtC,OAAO,EAAE,OAAO,CAAC;IACjB,iBAAiB,EAAE,KAAK,CAAC;QACvB,EAAE,EAAE,MAAM,CAAC;QACX,IAAI,EAAE,MAAM,CAAC;QACb,IAAI,EAAE,MAAM,CAAC;KACd,CAAC,CAAC;IACH,oBAAoB,EAAE,OAAO,CAAC;IAC9B,OAAO,EAAE,MAAM,CAAC;IAChB;;;;OAIG;IACH,sBAAsB,CAAC,EAAE,WAAW,EAAE,CAAC;CACxC"}
@@ -1,6 +0,0 @@
1
- "use strict";
2
- /**
3
- * MCP Tool Types
4
- */
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- //# sourceMappingURL=tools.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"tools.js","sourceRoot":"","sources":["../../src/types/tools.ts"],"names":[],"mappings":";AAAA;;GAEG"}
@@ -1,84 +0,0 @@
1
- /**
2
- * Cursor IDE standard directory path resolver.
3
- *
4
- * Cursor stores user-level assets in platform-specific locations:
5
- * macOS / Linux : ~/.cursor/<type>/
6
- * Windows : %APPDATA%\Cursor\User\<type>\
7
- * (typically C:\Users\<user>\AppData\Roaming\Cursor\User\<type>\)
8
- *
9
- * Resource type → subdirectory mapping mirrors the actual Cursor directory layout.
10
- */
11
- /** Supported Cursor resource types and their directory names. */
12
- export declare const CURSOR_TYPE_DIRS: Record<string, string>;
13
- /**
14
- * Returns the root of the Cursor user directory on the current platform.
15
- *
16
- * macOS / Linux : ~/.cursor
17
- * Windows : %APPDATA%\Cursor\User
18
- *
19
- * NOTE: Only use this when running code on the USER's local machine.
20
- * When generating paths for LocalAction instructions (which are executed by the
21
- * AI on the user's machine, not on this server), use getCursorRootDirForClient()
22
- * instead to avoid returning the server's home directory.
23
- */
24
- export declare function getCursorRootDir(): string;
25
- /**
26
- * Returns a platform-neutral Cursor root path for use in LocalAction instructions.
27
- *
28
- * LocalAction paths are sent to the AI Agent running on the USER's local machine,
29
- * not executed on this (possibly remote) server. Using os.homedir() here would
30
- * produce the server's home directory (e.g. /root/.cursor on a Linux server),
31
- * which is wrong when the user is on macOS or Windows.
32
- *
33
- * We return a tilde-prefixed path ("~/.cursor") which the AI / shell on the
34
- * user's machine will expand to the correct home directory automatically.
35
- * For Windows we still return the APPDATA-relative form as a hint, but note
36
- * that the AI is expected to expand %APPDATA% on the client side.
37
- */
38
- export declare function getCursorRootDirForClient(): string;
39
- /**
40
- * Returns the Cursor subdirectory for a given resource type, using a
41
- * client-side portable path (tilde-based). Use this when building paths
42
- * that will be included in LocalAction instructions.
43
- */
44
- export declare function getCursorTypeDirForClient(resourceType: string): string;
45
- /**
46
- * Returns the Cursor subdirectory for a given resource type.
47
- *
48
- * @param resourceType - API resource type string (e.g. 'skill', 'command', 'rule', 'mcp')
49
- * @returns Absolute path to the matching Cursor directory
50
- * @throws Error if the resource type is not recognised
51
- *
52
- * @example
53
- * getCursorTypeDir('skill') // ~/.cursor/skills
54
- * getCursorTypeDir('command') // ~/.cursor/commands
55
- * getCursorTypeDir('rule') // ~/.cursor/rules
56
- * getCursorTypeDir('mcp') // ~/.cursor/mcp-servers
57
- */
58
- export declare function getCursorTypeDir(resourceType: string): string;
59
- /**
60
- * Returns the install path for a specific named resource.
61
- *
62
- * For directory-based resources (skill, mcp) the result is a directory:
63
- * ~/.cursor/skills/<name>/
64
- *
65
- * For file-based resources (command, rule) the result is the file path
66
- * preserving the original filename (caller should pass name with extension):
67
- * ~/.cursor/commands/<name> (e.g. generate-testcase.md)
68
- * ~/.cursor/rules/<name> (e.g. elliotTest.mdc)
69
- *
70
- * @param resourceType - Resource type string
71
- * @param resourceName - Resource name (with or without extension)
72
- */
73
- export declare function getCursorResourcePath(resourceType: string, resourceName: string): string;
74
- /**
75
- * Returns the path to the local AI resource telemetry file.
76
- *
77
- * Stored at the Cursor root level (not inside a resource-type subdirectory)
78
- * so it persists independently of individual resource installs/uninstalls.
79
- *
80
- * macOS / Linux : ~/.cursor/ai-resource-telemetry.json
81
- * Windows : %APPDATA%\Cursor\User\ai-resource-telemetry.json
82
- */
83
- export declare function getTelemetryFilePath(): string;
84
- //# sourceMappingURL=cursor-paths.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"cursor-paths.d.ts","sourceRoot":"","sources":["../../src/utils/cursor-paths.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAKH,iEAAiE;AACjE,eAAO,MAAM,gBAAgB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CASnD,CAAC;AAEF;;;;;;;;;;GAUG;AACH,wBAAgB,gBAAgB,IAAI,MAAM,CAQzC;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,yBAAyB,IAAI,MAAM,CAGlD;AAED;;;;GAIG;AACH,wBAAgB,yBAAyB,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM,CAStE;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,gBAAgB,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM,CAS7D;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,qBAAqB,CAAC,YAAY,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,GAAG,MAAM,CAExF;AAED;;;;;;;;GAQG;AACH,wBAAgB,oBAAoB,IAAI,MAAM,CAE7C"}
@@ -1,166 +0,0 @@
1
- "use strict";
2
- /**
3
- * Cursor IDE standard directory path resolver.
4
- *
5
- * Cursor stores user-level assets in platform-specific locations:
6
- * macOS / Linux : ~/.cursor/<type>/
7
- * Windows : %APPDATA%\Cursor\User\<type>\
8
- * (typically C:\Users\<user>\AppData\Roaming\Cursor\User\<type>\)
9
- *
10
- * Resource type → subdirectory mapping mirrors the actual Cursor directory layout.
11
- */
12
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
13
- if (k2 === undefined) k2 = k;
14
- var desc = Object.getOwnPropertyDescriptor(m, k);
15
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
16
- desc = { enumerable: true, get: function() { return m[k]; } };
17
- }
18
- Object.defineProperty(o, k2, desc);
19
- }) : (function(o, m, k, k2) {
20
- if (k2 === undefined) k2 = k;
21
- o[k2] = m[k];
22
- }));
23
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
24
- Object.defineProperty(o, "default", { enumerable: true, value: v });
25
- }) : function(o, v) {
26
- o["default"] = v;
27
- });
28
- var __importStar = (this && this.__importStar) || (function () {
29
- var ownKeys = function(o) {
30
- ownKeys = Object.getOwnPropertyNames || function (o) {
31
- var ar = [];
32
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
33
- return ar;
34
- };
35
- return ownKeys(o);
36
- };
37
- return function (mod) {
38
- if (mod && mod.__esModule) return mod;
39
- var result = {};
40
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
41
- __setModuleDefault(result, mod);
42
- return result;
43
- };
44
- })();
45
- Object.defineProperty(exports, "__esModule", { value: true });
46
- exports.CURSOR_TYPE_DIRS = void 0;
47
- exports.getCursorRootDir = getCursorRootDir;
48
- exports.getCursorRootDirForClient = getCursorRootDirForClient;
49
- exports.getCursorTypeDirForClient = getCursorTypeDirForClient;
50
- exports.getCursorTypeDir = getCursorTypeDir;
51
- exports.getCursorResourcePath = getCursorResourcePath;
52
- exports.getTelemetryFilePath = getTelemetryFilePath;
53
- const os = __importStar(require("os"));
54
- const path = __importStar(require("path"));
55
- /** Supported Cursor resource types and their directory names. */
56
- exports.CURSOR_TYPE_DIRS = {
57
- skill: 'skills',
58
- skills: 'skills',
59
- command: 'commands',
60
- commands: 'commands',
61
- rule: 'rules',
62
- rules: 'rules',
63
- mcp: 'mcp-servers',
64
- 'mcp-servers': 'mcp-servers',
65
- };
66
- /**
67
- * Returns the root of the Cursor user directory on the current platform.
68
- *
69
- * macOS / Linux : ~/.cursor
70
- * Windows : %APPDATA%\Cursor\User
71
- *
72
- * NOTE: Only use this when running code on the USER's local machine.
73
- * When generating paths for LocalAction instructions (which are executed by the
74
- * AI on the user's machine, not on this server), use getCursorRootDirForClient()
75
- * instead to avoid returning the server's home directory.
76
- */
77
- function getCursorRootDir() {
78
- if (process.platform === 'win32') {
79
- // APPDATA is always set on Windows; fall back to USERPROFILE as a safety net
80
- const appData = process.env.APPDATA ?? path.join(os.homedir(), 'AppData', 'Roaming');
81
- return path.join(appData, 'Cursor', 'User');
82
- }
83
- // macOS and Linux both use ~/.cursor
84
- return path.join(os.homedir(), '.cursor');
85
- }
86
- /**
87
- * Returns a platform-neutral Cursor root path for use in LocalAction instructions.
88
- *
89
- * LocalAction paths are sent to the AI Agent running on the USER's local machine,
90
- * not executed on this (possibly remote) server. Using os.homedir() here would
91
- * produce the server's home directory (e.g. /root/.cursor on a Linux server),
92
- * which is wrong when the user is on macOS or Windows.
93
- *
94
- * We return a tilde-prefixed path ("~/.cursor") which the AI / shell on the
95
- * user's machine will expand to the correct home directory automatically.
96
- * For Windows we still return the APPDATA-relative form as a hint, but note
97
- * that the AI is expected to expand %APPDATA% on the client side.
98
- */
99
- function getCursorRootDirForClient() {
100
- // Return a portable ~-based path; the AI on the user's machine expands it.
101
- return '~/.cursor';
102
- }
103
- /**
104
- * Returns the Cursor subdirectory for a given resource type, using a
105
- * client-side portable path (tilde-based). Use this when building paths
106
- * that will be included in LocalAction instructions.
107
- */
108
- function getCursorTypeDirForClient(resourceType) {
109
- const subdir = exports.CURSOR_TYPE_DIRS[resourceType.toLowerCase()];
110
- if (!subdir) {
111
- throw new Error(`Unknown resource type "${resourceType}". ` +
112
- `Supported types: ${Object.keys(exports.CURSOR_TYPE_DIRS).join(', ')}`);
113
- }
114
- return `${getCursorRootDirForClient()}/${subdir}`;
115
- }
116
- /**
117
- * Returns the Cursor subdirectory for a given resource type.
118
- *
119
- * @param resourceType - API resource type string (e.g. 'skill', 'command', 'rule', 'mcp')
120
- * @returns Absolute path to the matching Cursor directory
121
- * @throws Error if the resource type is not recognised
122
- *
123
- * @example
124
- * getCursorTypeDir('skill') // ~/.cursor/skills
125
- * getCursorTypeDir('command') // ~/.cursor/commands
126
- * getCursorTypeDir('rule') // ~/.cursor/rules
127
- * getCursorTypeDir('mcp') // ~/.cursor/mcp-servers
128
- */
129
- function getCursorTypeDir(resourceType) {
130
- const subdir = exports.CURSOR_TYPE_DIRS[resourceType.toLowerCase()];
131
- if (!subdir) {
132
- throw new Error(`Unknown resource type "${resourceType}". ` +
133
- `Supported types: ${Object.keys(exports.CURSOR_TYPE_DIRS).join(', ')}`);
134
- }
135
- return path.join(getCursorRootDir(), subdir);
136
- }
137
- /**
138
- * Returns the install path for a specific named resource.
139
- *
140
- * For directory-based resources (skill, mcp) the result is a directory:
141
- * ~/.cursor/skills/<name>/
142
- *
143
- * For file-based resources (command, rule) the result is the file path
144
- * preserving the original filename (caller should pass name with extension):
145
- * ~/.cursor/commands/<name> (e.g. generate-testcase.md)
146
- * ~/.cursor/rules/<name> (e.g. elliotTest.mdc)
147
- *
148
- * @param resourceType - Resource type string
149
- * @param resourceName - Resource name (with or without extension)
150
- */
151
- function getCursorResourcePath(resourceType, resourceName) {
152
- return path.join(getCursorTypeDir(resourceType), resourceName);
153
- }
154
- /**
155
- * Returns the path to the local AI resource telemetry file.
156
- *
157
- * Stored at the Cursor root level (not inside a resource-type subdirectory)
158
- * so it persists independently of individual resource installs/uninstalls.
159
- *
160
- * macOS / Linux : ~/.cursor/ai-resource-telemetry.json
161
- * Windows : %APPDATA%\Cursor\User\ai-resource-telemetry.json
162
- */
163
- function getTelemetryFilePath() {
164
- return path.join(getCursorRootDir(), 'ai-resource-telemetry.json');
165
- }
166
- //# sourceMappingURL=cursor-paths.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"cursor-paths.js","sourceRoot":"","sources":["../../src/utils/cursor-paths.ts"],"names":[],"mappings":";AAAA;;;;;;;;;GASG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4BH,4CAQC;AAeD,8DAGC;AAOD,8DASC;AAeD,4CASC;AAgBD,sDAEC;AAWD,oDAEC;AA3HD,uCAAyB;AACzB,2CAA6B;AAE7B,iEAAiE;AACpD,QAAA,gBAAgB,GAA2B;IACtD,KAAK,EAAI,QAAQ;IACjB,MAAM,EAAG,QAAQ;IACjB,OAAO,EAAE,UAAU;IACnB,QAAQ,EAAC,UAAU;IACnB,IAAI,EAAK,OAAO;IAChB,KAAK,EAAI,OAAO;IAChB,GAAG,EAAM,aAAa;IACtB,aAAa,EAAE,aAAa;CAC7B,CAAC;AAEF;;;;;;;;;;GAUG;AACH,SAAgB,gBAAgB;IAC9B,IAAI,OAAO,CAAC,QAAQ,KAAK,OAAO,EAAE,CAAC;QACjC,6EAA6E;QAC7E,MAAM,OAAO,GAAG,OAAO,CAAC,GAAG,CAAC,OAAO,IAAI,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,SAAS,EAAE,SAAS,CAAC,CAAC;QACrF,OAAO,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC;IAC9C,CAAC;IACD,qCAAqC;IACrC,OAAO,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,OAAO,E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