@muggleai/mcp 1.0.19 → 1.0.20

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.
@@ -9,11 +9,11 @@ export declare const AuthLoginInputSchema: z.ZodObject<{
9
9
  waitForCompletion: z.ZodOptional<z.ZodBoolean>;
10
10
  timeoutMs: z.ZodOptional<z.ZodNumber>;
11
11
  }, "strip", z.ZodTypeAny, {
12
- waitForCompletion?: boolean | undefined;
13
12
  timeoutMs?: number | undefined;
14
- }, {
15
13
  waitForCompletion?: boolean | undefined;
14
+ }, {
16
15
  timeoutMs?: number | undefined;
16
+ waitForCompletion?: boolean | undefined;
17
17
  }>;
18
18
  export type AuthLoginInput = z.infer<typeof AuthLoginInputSchema>;
19
19
  /**
@@ -32,21 +32,21 @@ export declare const TestCaseDetailsSchema: z.ZodObject<{
32
32
  /** Original cloud URL (for reference, replaced by localUrl). */
33
33
  url: z.ZodOptional<z.ZodString>;
34
34
  }, "strip", z.ZodTypeAny, {
35
- title: string;
36
35
  id: string;
37
36
  goal: string;
37
+ title: string;
38
38
  expectedResult: string;
39
39
  url?: string | undefined;
40
- instructions?: string | undefined;
41
40
  precondition?: string | undefined;
41
+ instructions?: string | undefined;
42
42
  }, {
43
- title: string;
44
43
  id: string;
45
44
  goal: string;
45
+ title: string;
46
46
  expectedResult: string;
47
47
  url?: string | undefined;
48
- instructions?: string | undefined;
49
48
  precondition?: string | undefined;
49
+ instructions?: string | undefined;
50
50
  }>;
51
51
  export type TestCaseDetails = z.infer<typeof TestCaseDetailsSchema>;
52
52
  /**
@@ -65,16 +65,16 @@ export declare const TestScriptDetailsSchema: z.ZodObject<{
65
65
  /** Original cloud URL (for reference, replaced by localUrl). */
66
66
  url: z.ZodOptional<z.ZodString>;
67
67
  }, "strip", z.ZodTypeAny, {
68
- name: string;
69
68
  id: string;
70
- testCaseId: string;
69
+ name: string;
71
70
  actionScript: unknown[];
71
+ testCaseId: string;
72
72
  url?: string | undefined;
73
73
  }, {
74
- name: string;
75
74
  id: string;
76
- testCaseId: string;
75
+ name: string;
77
76
  actionScript: unknown[];
77
+ testCaseId: string;
78
78
  url?: string | undefined;
79
79
  }>;
80
80
  export type TestScriptDetails = z.infer<typeof TestScriptDetailsSchema>;
@@ -100,21 +100,21 @@ export declare const ExecuteTestGenerationInputSchema: z.ZodObject<{
100
100
  /** Original cloud URL (for reference, replaced by localUrl). */
101
101
  url: z.ZodOptional<z.ZodString>;
102
102
  }, "strip", z.ZodTypeAny, {
103
- title: string;
104
103
  id: string;
105
104
  goal: string;
105
+ title: string;
106
106
  expectedResult: string;
107
107
  url?: string | undefined;
108
- instructions?: string | undefined;
109
108
  precondition?: string | undefined;
109
+ instructions?: string | undefined;
110
110
  }, {
111
- title: string;
112
111
  id: string;
113
112
  goal: string;
113
+ title: string;
114
114
  expectedResult: string;
115
115
  url?: string | undefined;
116
- instructions?: string | undefined;
117
116
  precondition?: string | undefined;
117
+ instructions?: string | undefined;
118
118
  }>;
119
119
  /** Local URL to test against. */
120
120
  localUrl: z.ZodString;
@@ -125,26 +125,26 @@ export declare const ExecuteTestGenerationInputSchema: z.ZodObject<{
125
125
  }, "strip", z.ZodTypeAny, {
126
126
  localUrl: string;
127
127
  testCase: {
128
- title: string;
129
128
  id: string;
130
129
  goal: string;
130
+ title: string;
131
131
  expectedResult: string;
132
132
  url?: string | undefined;
133
- instructions?: string | undefined;
134
133
  precondition?: string | undefined;
134
+ instructions?: string | undefined;
135
135
  };
136
136
  approveElectronAppLaunch: boolean;
137
137
  timeoutMs?: number | undefined;
138
138
  }, {
139
139
  localUrl: string;
140
140
  testCase: {
141
- title: string;
142
141
  id: string;
143
142
  goal: string;
143
+ title: string;
144
144
  expectedResult: string;
145
145
  url?: string | undefined;
146
- instructions?: string | undefined;
147
146
  precondition?: string | undefined;
147
+ instructions?: string | undefined;
148
148
  };
149
149
  approveElectronAppLaunch: boolean;
150
150
  timeoutMs?: number | undefined;
@@ -168,16 +168,16 @@ export declare const ExecuteReplayInputSchema: z.ZodObject<{
168
168
  /** Original cloud URL (for reference, replaced by localUrl). */
169
169
  url: z.ZodOptional<z.ZodString>;
170
170
  }, "strip", z.ZodTypeAny, {
171
- name: string;
172
171
  id: string;
173
- testCaseId: string;
172
+ name: string;
174
173
  actionScript: unknown[];
174
+ testCaseId: string;
175
175
  url?: string | undefined;
176
176
  }, {
177
- name: string;
178
177
  id: string;
179
- testCaseId: string;
178
+ name: string;
180
179
  actionScript: unknown[];
180
+ testCaseId: string;
181
181
  url?: string | undefined;
182
182
  }>;
183
183
  /** Local URL to test against. */
@@ -190,10 +190,10 @@ export declare const ExecuteReplayInputSchema: z.ZodObject<{
190
190
  localUrl: string;
191
191
  approveElectronAppLaunch: boolean;
192
192
  testScript: {
193
- name: string;
194
193
  id: string;
195
- testCaseId: string;
194
+ name: string;
196
195
  actionScript: unknown[];
196
+ testCaseId: string;
197
197
  url?: string | undefined;
198
198
  };
199
199
  timeoutMs?: number | undefined;
@@ -201,10 +201,10 @@ export declare const ExecuteReplayInputSchema: z.ZodObject<{
201
201
  localUrl: string;
202
202
  approveElectronAppLaunch: boolean;
203
203
  testScript: {
204
- name: string;
205
204
  id: string;
206
- testCaseId: string;
205
+ name: string;
207
206
  actionScript: unknown[];
207
+ testCaseId: string;
208
208
  url?: string | undefined;
209
209
  };
210
210
  timeoutMs?: number | undefined;
@@ -228,11 +228,11 @@ export declare const RunResultListInputSchema: z.ZodObject<{
228
228
  cloudTestCaseId: z.ZodOptional<z.ZodString>;
229
229
  limit: z.ZodOptional<z.ZodNumber>;
230
230
  }, "strip", z.ZodTypeAny, {
231
- limit?: number | undefined;
232
231
  cloudTestCaseId?: string | undefined;
233
- }, {
234
232
  limit?: number | undefined;
233
+ }, {
235
234
  cloudTestCaseId?: string | undefined;
235
+ limit?: number | undefined;
236
236
  }>;
237
237
  export type RunResultListInput = z.infer<typeof RunResultListInputSchema>;
238
238
  /**
@@ -61,8 +61,25 @@ export declare class AuthService {
61
61
  loadStoredAuth(): IStoredAuth | null;
62
62
  /**
63
63
  * Get the current access token (if valid).
64
+ * Does not auto-refresh - use getValidAccessToken() for that.
64
65
  */
65
66
  getAccessToken(): string | null;
67
+ /**
68
+ * Check if the access token is expired or about to expire.
69
+ * Uses a 5-minute buffer for safety.
70
+ */
71
+ isAccessTokenExpired(): boolean;
72
+ /**
73
+ * Refresh the access token using the stored refresh token.
74
+ * @returns New access token or null if refresh failed.
75
+ */
76
+ refreshAccessToken(): Promise<string | null>;
77
+ /**
78
+ * Get a valid access token, refreshing if necessary.
79
+ * This is the preferred method for getting an access token for API calls.
80
+ * @returns Valid access token or null if not authenticated or refresh failed.
81
+ */
82
+ getValidAccessToken(): Promise<string | null>;
66
83
  /**
67
84
  * Clear stored authentication (logout).
68
85
  */
@@ -1 +1 @@
1
- {"version":3,"file":"auth-service.d.ts","sourceRoot":"","sources":["../../../src/local-qa/services/auth-service.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAQH,OAAO,KAAK,EACV,WAAW,EACX,qBAAqB,EACrB,mBAAmB,EACnB,WAAW,EAEZ,MAAM,mBAAmB,CAAC;AAM3B;;GAEG;AACH,qBAAa,WAAW;IACtB,6BAA6B;IAC7B,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAS;IAEtC,4CAA4C;IAC5C,OAAO,CAAC,QAAQ,CAAC,qBAAqB,CAAS;IAE/C;;OAEG;;IAUH;;OAEG;IACH,aAAa,IAAI,WAAW;IA4B5B;;OAEG;IACG,mBAAmB,IAAI,OAAO,CAAC,mBAAmB,CAAC;IA6EzD;;OAEG;IACH,OAAO,CAAC,sBAAsB;IAoB9B;;OAEG;IACH,oBAAoB,IAAI,MAAM,GAAG,IAAI;IAkCrC;;OAEG;IACH,OAAO,CAAC,sBAAsB;IAe9B;;OAEG;IACG,cAAc,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,qBAAqB,CAAC;IA6GxE;;OAEG;IACG,8BAA8B,CAAC,MAAM,EAAE;QAC3C,UAAU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C,EAAE,MAAM,CAAC;KACpB,GAAG,OAAO,CAAC,qBAAqB,CAAC;IAiClC;;OAEG;YACW,WAAW;IA8BzB;;OAEG;YACW,SAAS;IA+BvB;;OAEG;IACH,cAAc,IAAI,WAAW,GAAG,IAAI;IAkBpC;;;OAGG;IACH,cAAc,IAAI,MAAM,GAAG,IAAI;IAiB/B;;;OAGG;IACH,oBAAoB,IAAI,OAAO;IAc/B;;;OAGG;IACG,kBAAkB,IAAI,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC;IA6ElD;;;;OAIG;IACG,mBAAmB,IAAI,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC;IAyBnD;;OAEG;IACH,MAAM,IAAI,OAAO;CAmBlB;AAKD;;GAEG;AACH,wBAAgB,cAAc,IAAI,WAAW,CAG5C;AAED;;GAEG;AACH,wBAAgB,gBAAgB,IAAI,IAAI,CAEvC"}
@@ -22,12 +22,12 @@ export declare const ProjectCreateInputSchema: z.ZodObject<{
22
22
  description: z.ZodString;
23
23
  url: z.ZodString;
24
24
  }, "strip", z.ZodTypeAny, {
25
- description: string;
26
25
  url: string;
26
+ description: string;
27
27
  projectName: string;
28
28
  }, {
29
- description: string;
30
29
  url: string;
30
+ description: string;
31
31
  projectName: string;
32
32
  }>;
33
33
  export declare const ProjectGetInputSchema: z.ZodObject<{
@@ -51,13 +51,13 @@ export declare const ProjectUpdateInputSchema: z.ZodObject<{
51
51
  url: z.ZodOptional<z.ZodString>;
52
52
  }, "strip", z.ZodTypeAny, {
53
53
  projectId: string;
54
- description?: string | undefined;
55
54
  url?: string | undefined;
55
+ description?: string | undefined;
56
56
  projectName?: string | undefined;
57
57
  }, {
58
58
  projectId: string;
59
- description?: string | undefined;
60
59
  url?: string | undefined;
60
+ description?: string | undefined;
61
61
  projectName?: string | undefined;
62
62
  }>;
63
63
  export declare const ProjectListInputSchema: z.ZodObject<{
@@ -113,18 +113,18 @@ export declare const PrdFileProcessStartInputSchema: z.ZodObject<{
113
113
  contentChecksum: z.ZodString;
114
114
  fileSize: z.ZodNumber;
115
115
  }, "strip", z.ZodTypeAny, {
116
- description: string;
117
- url: string;
118
116
  name: string;
117
+ url: string;
118
+ description: string;
119
119
  projectId: string;
120
120
  prdFilePath: string;
121
121
  originalFileName: string;
122
122
  contentChecksum: string;
123
123
  fileSize: number;
124
124
  }, {
125
- description: string;
126
- url: string;
127
125
  name: string;
126
+ url: string;
127
+ description: string;
128
128
  projectId: string;
129
129
  prdFilePath: string;
130
130
  originalFileName: string;
@@ -152,15 +152,15 @@ export declare const SecretCreateInputSchema: z.ZodObject<{
152
152
  description: z.ZodString;
153
153
  source: z.ZodOptional<z.ZodEnum<["user", "agent"]>>;
154
154
  }, "strip", z.ZodTypeAny, {
155
+ name: string;
155
156
  value: string;
156
157
  description: string;
157
- name: string;
158
158
  projectId: string;
159
159
  source?: "user" | "agent" | undefined;
160
160
  }, {
161
+ name: string;
161
162
  value: string;
162
163
  description: string;
163
- name: string;
164
164
  projectId: string;
165
165
  source?: "user" | "agent" | undefined;
166
166
  }>;
@@ -178,14 +178,14 @@ export declare const SecretUpdateInputSchema: z.ZodObject<{
178
178
  description: z.ZodOptional<z.ZodString>;
179
179
  }, "strip", z.ZodTypeAny, {
180
180
  secretId: string;
181
+ name?: string | undefined;
181
182
  value?: string | undefined;
182
183
  description?: string | undefined;
183
- name?: string | undefined;
184
184
  }, {
185
185
  secretId: string;
186
+ name?: string | undefined;
186
187
  value?: string | undefined;
187
188
  description?: string | undefined;
188
- name?: string | undefined;
189
189
  }>;
190
190
  export declare const SecretDeleteInputSchema: z.ZodObject<{
191
191
  secretId: z.ZodString;
@@ -331,30 +331,30 @@ export declare const TestCaseCreateInputSchema: z.ZodObject<{
331
331
  category: z.ZodOptional<z.ZodString>;
332
332
  automated: z.ZodOptional<z.ZodBoolean>;
333
333
  }, "strip", z.ZodTypeAny, {
334
- description: string;
335
334
  url: string;
335
+ goal: string;
336
336
  title: string;
337
+ expectedResult: string;
338
+ description: string;
337
339
  projectId: string;
338
340
  useCaseId: string;
339
- goal: string;
340
- expectedResult: string;
341
341
  status?: "DRAFT" | "ACTIVE" | "DEPRECATED" | "ARCHIVED" | undefined;
342
- priority?: "HIGH" | "MEDIUM" | "LOW" | undefined;
343
342
  precondition?: string | undefined;
343
+ priority?: "HIGH" | "MEDIUM" | "LOW" | undefined;
344
344
  tags?: string[] | undefined;
345
345
  category?: string | undefined;
346
346
  automated?: boolean | undefined;
347
347
  }, {
348
- description: string;
349
348
  url: string;
349
+ goal: string;
350
350
  title: string;
351
+ expectedResult: string;
352
+ description: string;
351
353
  projectId: string;
352
354
  useCaseId: string;
353
- goal: string;
354
- expectedResult: string;
355
355
  status?: "DRAFT" | "ACTIVE" | "DEPRECATED" | "ARCHIVED" | undefined;
356
- priority?: "HIGH" | "MEDIUM" | "LOW" | undefined;
357
356
  precondition?: string | undefined;
357
+ priority?: "HIGH" | "MEDIUM" | "LOW" | undefined;
358
358
  tags?: string[] | undefined;
359
359
  category?: string | undefined;
360
360
  automated?: boolean | undefined;
@@ -401,14 +401,14 @@ export declare const WorkflowStartWebsiteScanInputSchema: z.ZodObject<{
401
401
  archiveUnapproved: z.ZodOptional<z.ZodBoolean>;
402
402
  workflowParams: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
403
403
  }, "strip", z.ZodTypeAny, {
404
- description: string;
405
404
  url: string;
405
+ description: string;
406
406
  projectId: string;
407
407
  archiveUnapproved?: boolean | undefined;
408
408
  workflowParams?: Record<string, unknown> | undefined;
409
409
  }, {
410
- description: string;
411
410
  url: string;
411
+ description: string;
412
412
  projectId: string;
413
413
  archiveUnapproved?: boolean | undefined;
414
414
  workflowParams?: Record<string, unknown> | undefined;
@@ -435,16 +435,16 @@ export declare const WorkflowStartTestCaseDetectionInputSchema: z.ZodObject<{
435
435
  url: z.ZodString;
436
436
  workflowParams: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
437
437
  }, "strip", z.ZodTypeAny, {
438
- description: string;
439
- url: string;
440
438
  name: string;
439
+ url: string;
440
+ description: string;
441
441
  projectId: string;
442
442
  useCaseId: string;
443
443
  workflowParams?: Record<string, unknown> | undefined;
444
444
  }, {
445
- description: string;
446
- url: string;
447
445
  name: string;
446
+ url: string;
447
+ description: string;
448
448
  projectId: string;
449
449
  useCaseId: string;
450
450
  workflowParams?: Record<string, unknown> | undefined;
@@ -461,26 +461,26 @@ export declare const WorkflowStartTestScriptGenerationInputSchema: z.ZodObject<{
461
461
  expectedResult: z.ZodString;
462
462
  workflowParams: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
463
463
  }, "strip", z.ZodTypeAny, {
464
- url: string;
465
464
  name: string;
465
+ url: string;
466
+ goal: string;
467
+ expectedResult: string;
468
+ precondition: string;
466
469
  instructions: string;
470
+ testCaseId: string;
467
471
  projectId: string;
468
472
  useCaseId: string;
469
- testCaseId: string;
470
- goal: string;
471
- precondition: string;
472
- expectedResult: string;
473
473
  workflowParams?: Record<string, unknown> | undefined;
474
474
  }, {
475
- url: string;
476
475
  name: string;
476
+ url: string;
477
+ goal: string;
478
+ expectedResult: string;
479
+ precondition: string;
477
480
  instructions: string;
481
+ testCaseId: string;
478
482
  projectId: string;
479
483
  useCaseId: string;
480
- testCaseId: string;
481
- goal: string;
482
- precondition: string;
483
- expectedResult: string;
484
484
  workflowParams?: Record<string, unknown> | undefined;
485
485
  }>;
486
486
  export declare const WorkflowGetLatestScriptGenByTestCaseInputSchema: z.ZodObject<{
@@ -498,18 +498,18 @@ export declare const WorkflowStartTestScriptReplayInputSchema: z.ZodObject<{
498
498
  name: z.ZodString;
499
499
  workflowParams: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
500
500
  }, "strip", z.ZodTypeAny, {
501
+ testScriptId: string;
501
502
  name: string;
503
+ testCaseId: string;
502
504
  projectId: string;
503
505
  useCaseId: string;
504
- testCaseId: string;
505
- testScriptId: string;
506
506
  workflowParams?: Record<string, unknown> | undefined;
507
507
  }, {
508
+ testScriptId: string;
508
509
  name: string;
510
+ testCaseId: string;
509
511
  projectId: string;
510
512
  useCaseId: string;
511
- testCaseId: string;
512
- testScriptId: string;
513
513
  workflowParams?: Record<string, unknown> | undefined;
514
514
  }>;
515
515
  export declare const WorkflowStartTestScriptReplayBulkInputSchema: z.ZodObject<{
@@ -526,20 +526,20 @@ export declare const WorkflowStartTestScriptReplayBulkInputSchema: z.ZodObject<{
526
526
  name: string;
527
527
  projectId: string;
528
528
  intervalSec: number;
529
+ limit?: number | undefined;
529
530
  useCaseId?: string | undefined;
530
531
  workflowParams?: Record<string, unknown> | undefined;
531
532
  namePrefix?: string | undefined;
532
- limit?: number | undefined;
533
533
  testCaseIds?: string[] | undefined;
534
534
  repeatPerTestCase?: number | undefined;
535
535
  }, {
536
536
  name: string;
537
537
  projectId: string;
538
538
  intervalSec: number;
539
+ limit?: number | undefined;
539
540
  useCaseId?: string | undefined;
540
541
  workflowParams?: Record<string, unknown> | undefined;
541
542
  namePrefix?: string | undefined;
542
- limit?: number | undefined;
543
543
  testCaseIds?: string[] | undefined;
544
544
  repeatPerTestCase?: number | undefined;
545
545
  }>;
@@ -717,11 +717,11 @@ export declare const ApiKeyCreateInputSchema: z.ZodObject<{
717
717
  name: z.ZodOptional<z.ZodString>;
718
718
  expiry: z.ZodOptional<z.ZodEnum<["30d", "90d", "1y", "never"]>>;
719
719
  }, "strip", z.ZodTypeAny, {
720
- expiry?: "30d" | "90d" | "1y" | "never" | undefined;
721
720
  name?: string | undefined;
722
- }, {
723
721
  expiry?: "30d" | "90d" | "1y" | "never" | undefined;
722
+ }, {
724
723
  name?: string | undefined;
724
+ expiry?: "30d" | "90d" | "1y" | "never" | undefined;
725
725
  }>;
726
726
  export declare const ApiKeyListInputSchema: z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>;
727
727
  export declare const ApiKeyGetInputSchema: z.ZodObject<{
@@ -745,11 +745,11 @@ export declare const AuthLoginInputSchema: z.ZodObject<{
745
745
  waitForCompletion: z.ZodOptional<z.ZodBoolean>;
746
746
  timeoutMs: z.ZodOptional<z.ZodNumber>;
747
747
  }, "strip", z.ZodTypeAny, {
748
- waitForCompletion?: boolean | undefined;
749
748
  timeoutMs?: number | undefined;
750
- }, {
751
749
  waitForCompletion?: boolean | undefined;
750
+ }, {
752
751
  timeoutMs?: number | undefined;
752
+ waitForCompletion?: boolean | undefined;
753
753
  }>;
754
754
  /**
755
755
  * Auth poll input schema.
@@ -42,10 +42,11 @@ export declare function createApiKeyWithToken(accessToken: string, keyName: stri
42
42
  }>;
43
43
  /**
44
44
  * Complete the full device code login flow.
45
- * Starts the flow, waits for user authorization, and creates credentials.
45
+ * Starts the flow, waits for user authorization, and stores credentials.
46
+ * API key creation is optional - only created when keyName is provided.
46
47
  *
47
- * @param keyName - Optional name for the API key.
48
- * @param keyExpiry - Expiry option for API key.
48
+ * @param keyName - Optional name for the API key. If provided, creates an API key.
49
+ * @param keyExpiry - Expiry option for API key (only used if keyName is provided).
49
50
  * @param timeoutMs - Maximum time to wait for authorization.
50
51
  * @returns Result of the login flow.
51
52
  */
@@ -56,15 +57,23 @@ export declare function performLogin(keyName?: string, keyExpiry?: "30d" | "90d"
56
57
  error?: string;
57
58
  }>;
58
59
  /**
59
- * Perform logout by clearing credentials.
60
+ * Perform logout by clearing all credentials (auth tokens and API keys).
60
61
  */
61
62
  export declare function performLogout(): void;
62
63
  /**
63
- * Get caller credentials for API requests.
64
- * Returns credentials from storage if available and valid.
64
+ * Get caller credentials for API requests (sync version).
65
+ * Checks for API key first, then falls back to access token.
66
+ * Does NOT auto-refresh - use getCallerCredentialsAsync() for that.
65
67
  * @returns Caller credentials or empty object.
66
68
  */
67
69
  export declare function getCallerCredentials(): ICallerCredentials;
70
+ /**
71
+ * Get caller credentials for API requests (async version with auto-refresh).
72
+ * This is the preferred method - automatically refreshes expired access tokens.
73
+ * Priority: 1) API key (if explicitly set), 2) Access token (with auto-refresh)
74
+ * @returns Caller credentials or empty object.
75
+ */
76
+ export declare function getCallerCredentialsAsync(): Promise<ICallerCredentials>;
68
77
  /**
69
78
  * Check if authentication is required for the given tool.
70
79
  * Local-only tools don't require auth.
@@ -1 +1 @@
1
- {"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../../src/shared/auth.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAYH,OAAO,KAAK,EACV,YAAY,EACZ,kBAAkB,EAClB,uBAAuB,EACvB,mBAAmB,EACnB,kBAAkB,EACnB,MAAM,YAAY,CAAC;AAIpB;;;;;;;GAOG;AACH,wBAAsB,mBAAmB,CAAC,MAAM,EAAE,YAAY,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAkE5F;AAED;;;;;;;GAOG;AACH,wBAAsB,cAAc,CAClC,MAAM,EAAE,YAAY,EACpB,UAAU,EAAE,MAAM,GACjB,OAAO,CAAC,uBAAuB,CAAC,CA2ElC;AAED;;;;;;;;GAQG;AACH,wBAAsB,qBAAqB,CACzC,WAAW,EAAE,MAAM,EACnB,OAAO,EAAE,MAAM,GAAG,SAAS,EAC3B,MAAM,GAAE,KAAK,GAAG,KAAK,GAAG,IAAI,GAAG,OAAe,GAC7C,OAAO,CAAC;IACT,EAAE,EAAE,MAAM,CAAC;IACX,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;CAC1B,CAAC,CAyCD;AAED;;;;;;;;GAQG;AACH,wBAAsB,YAAY,CAChC,OAAO,CAAC,EAAE,MAAM,EAChB,SAAS,GAAE,KAAK,GAAG,KAAK,GAAG,IAAI,GAAG,OAAe,EACjD,SAAS,GAAE,MAAe,GACzB,OAAO,CAAC;IACT,OAAO,EAAE,OAAO,CAAC;IACjB,kBAAkB,CAAC,EA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AAY,CAChC,OAAO,CAAC,EAAE,MAAM,EAChB,SAAS,GAAE,KAAK,GAAG,KAAK,GAAG,IAAI,GAAG,OAAe,EACjD,SAAS,GAAE,MAAe,GACzB,OAAO,CAAC;IACT,OAAO,EAAE,OAAO,CAAC;IACjB,kBAAkB,CAAC,EAAE,mBAAmB,CAAC;IACzC,WAAW,CAAC,EAAE,kBAAkB,CAAC;IACjC,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC,CA4FD;AAED;;GAEG;AACH,wBAAgB,aAAa,IAAI,IAAI,CASpC;AAED;;;;;GAKG;AACH,wBAAgB,oBAAoB,IAAI,kBAAkB,CAiBzD;AAED;;;;;GAKG;AACH,wBAAsB,yBAAyB,IAAI,OAAO,CAAC,kBAAkB,CAAC,CAiB7E;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAwD1D"}
@@ -30,19 +30,28 @@ export declare function deleteCredentials(): void;
30
30
  export declare function isCredentialsExpired(credentials: IStoredCredentials): boolean;
31
31
  /**
32
32
  * Get valid credentials if available.
33
- * Returns null if no credentials or if expired.
33
+ * This is primarily used for API key storage.
34
+ * Access token authentication is handled by AuthService.
34
35
  * @returns Valid credentials or null.
35
36
  */
36
37
  export declare function getValidCredentials(): IStoredCredentials | null;
37
38
  /**
38
- * Get authentication status.
39
- * @returns Object with authentication status information.
39
+ * Check if an API key is stored.
40
+ * @returns True if API key exists.
40
41
  */
41
- export declare function getAuthStatus(): {
42
- authenticated: boolean;
43
- email?: string;
44
- userId?: string;
45
- expiresAt?: string;
46
- hasApiKey: boolean;
47
- };
42
+ export declare function hasApiKey(): boolean;
43
+ /**
44
+ * Get stored API key if available.
45
+ * @returns API key or null.
46
+ */
47
+ export declare function getApiKey(): string | null;
48
+ /**
49
+ * Save API key to credentials.
50
+ * @param apiKey - The API key to save.
51
+ * @param apiKeyId - The API key ID.
52
+ */
53
+ export declare function saveApiKey(params: {
54
+ apiKey: string;
55
+ apiKeyId: string;
56
+ }): void;
48
57
  //# sourceMappingURL=credentials.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"credentials.d.ts","sourceRoot":"","sources":["../../src/shared/credentials.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAOH,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAKrD;;;GAGG;AACH,wBAAgB,sBAAsB,IAAI,MAAM,CAE/C;AAYD;;;GAGG;AACH,wBAAgB,eAAe,IAAI,kBAAkB,GAAG,IAAI,CA0B3D;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAAC,WAAW,EAAE,kBAAkB,GAAG,IAAI,CAiBrE;AAED;;GAEG;AACH,wBAAgB,iBAAiB,IAAI,IAAI,CAcxC;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,WAAW,EAAE,kBAAkB,GAAG,OAAO,CAO7E;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,IAAI,kBAAkB,GAAG,IAAI,CAa/D;AAED;;;GAGG;AACH,wBAAgB,aAAa,IAAI;IAC/B,aAAa,EAAE,OAAO,CAAC;IACvB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,OAAO,CAAC;CACpB,CAmBA"}
1
+ {"version":3,"file":"credentials.d.ts","sourceRoot":"","sources":["../../src/shared/credentials.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAOH,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAKrD;;;GAGG;AACH,wBAAgB,sBAAsB,IAAI,MAAM,CAE/C;AAYD;;;GAGG;AACH,wBAAgB,eAAe,IAAI,kBAAkB,GAAG,IAAI,CA0B3D;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAAC,WAAW,EAAE,kBAAkB,GAAG,IAAI,CAiBrE;AAED;;GAEG;AACH,wBAAgB,iBAAiB,IAAI,IAAI,CAcxC;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,WAAW,EAAE,kBAAkB,GAAG,OAAO,CAO7E;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,IAAI,kBAAkB,GAAG,IAAI,CAa/D;AAED;;;GAGG;AACH,wBAAgB,SAAS,IAAI,OAAO,CAGnC;AAED;;;GAGG;AACH,wBAAgB,SAAS,IAAI,MAAM,GAAG,IAAI,CAGzC;AAED;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,MAAM,EAAE;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CAwB7E"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@muggleai/mcp",
3
- "version": "1.0.19",
3
+ "version": "1.0.20",
4
4
  "description": "Unified MCP server for Muggle AI - Cloud QA and Local Testing tools",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",