@mwturnbull/papi-mcp 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +320 -0
- package/dist/config/assembler.d.ts +6 -0
- package/dist/config/assembler.d.ts.map +1 -0
- package/dist/config/assembler.js +56 -0
- package/dist/config/assembler.js.map +1 -0
- package/dist/config/parser.d.ts +6 -0
- package/dist/config/parser.d.ts.map +1 -0
- package/dist/config/parser.js +79 -0
- package/dist/config/parser.js.map +1 -0
- package/dist/config/snippets.d.ts +12 -0
- package/dist/config/snippets.d.ts.map +1 -0
- package/dist/config/snippets.js +75 -0
- package/dist/config/snippets.js.map +1 -0
- package/dist/git/git-ops.d.ts +16 -0
- package/dist/git/git-ops.d.ts.map +1 -0
- package/dist/git/git-ops.js +64 -0
- package/dist/git/git-ops.js.map +1 -0
- package/dist/git/github.d.ts +12 -0
- package/dist/git/github.d.ts.map +1 -0
- package/dist/git/github.js +83 -0
- package/dist/git/github.js.map +1 -0
- package/dist/git/gitlab.d.ts +11 -0
- package/dist/git/gitlab.d.ts.map +1 -0
- package/dist/git/gitlab.js +65 -0
- package/dist/git/gitlab.js.map +1 -0
- package/dist/git/provider.d.ts +33 -0
- package/dist/git/provider.d.ts.map +1 -0
- package/dist/git/provider.js +49 -0
- package/dist/git/provider.js.map +1 -0
- package/dist/papi/auth.d.ts +12 -0
- package/dist/papi/auth.d.ts.map +1 -0
- package/dist/papi/auth.js +74 -0
- package/dist/papi/auth.js.map +1 -0
- package/dist/papi/client.d.ts +19 -0
- package/dist/papi/client.d.ts.map +1 -0
- package/dist/papi/client.js +115 -0
- package/dist/papi/client.js.map +1 -0
- package/dist/papi/types.d.ts +487 -0
- package/dist/papi/types.d.ts.map +1 -0
- package/dist/papi/types.js +94 -0
- package/dist/papi/types.js.map +1 -0
- package/dist/redaction/redactor.d.ts +25 -0
- package/dist/redaction/redactor.d.ts.map +1 -0
- package/dist/redaction/redactor.js +128 -0
- package/dist/redaction/redactor.js.map +1 -0
- package/dist/server.d.ts +3 -0
- package/dist/server.d.ts.map +1 -0
- package/dist/server.js +219 -0
- package/dist/server.js.map +1 -0
- package/dist/tools/activate.d.ts +16 -0
- package/dist/tools/activate.d.ts.map +1 -0
- package/dist/tools/activate.js +59 -0
- package/dist/tools/activate.js.map +1 -0
- package/dist/tools/diff-configs.d.ts +3 -0
- package/dist/tools/diff-configs.d.ts.map +1 -0
- package/dist/tools/diff-configs.js +152 -0
- package/dist/tools/diff-configs.js.map +1 -0
- package/dist/tools/get-property-config.d.ts +9 -0
- package/dist/tools/get-property-config.d.ts.map +1 -0
- package/dist/tools/get-property-config.js +53 -0
- package/dist/tools/get-property-config.js.map +1 -0
- package/dist/tools/pipeline.d.ts +11 -0
- package/dist/tools/pipeline.d.ts.map +1 -0
- package/dist/tools/pipeline.js +9 -0
- package/dist/tools/pipeline.js.map +1 -0
- package/dist/tools/sync-property.d.ts +9 -0
- package/dist/tools/sync-property.d.ts.map +1 -0
- package/dist/tools/sync-property.js +65 -0
- package/dist/tools/sync-property.js.map +1 -0
- package/dist/tools/write-snippet.d.ts +30 -0
- package/dist/tools/write-snippet.d.ts.map +1 -0
- package/dist/tools/write-snippet.js +92 -0
- package/dist/tools/write-snippet.js.map +1 -0
- package/dist/validation/local.d.ts +3 -0
- package/dist/validation/local.d.ts.map +1 -0
- package/dist/validation/local.js +290 -0
- package/dist/validation/local.js.map +1 -0
- package/dist/validation/papi.d.ts +6 -0
- package/dist/validation/papi.d.ts.map +1 -0
- package/dist/validation/papi.js +59 -0
- package/dist/validation/papi.js.map +1 -0
- package/package.json +55 -0
- package/src/skill/system-prompt.md +205 -0
- package/templates/.gitkeep +0 -0
- package/templates/CLAUDE.md +115 -0
- package/templates/copilot-instructions.md +78 -0
|
@@ -0,0 +1,487 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export interface PapiBehavior {
|
|
3
|
+
name: string;
|
|
4
|
+
options: Record<string, unknown>;
|
|
5
|
+
}
|
|
6
|
+
export interface PapiCriteria {
|
|
7
|
+
name: string;
|
|
8
|
+
options: Record<string, unknown>;
|
|
9
|
+
}
|
|
10
|
+
export interface PapiVariable {
|
|
11
|
+
name: string;
|
|
12
|
+
value: string;
|
|
13
|
+
description: string;
|
|
14
|
+
hidden: boolean;
|
|
15
|
+
sensitive: boolean;
|
|
16
|
+
}
|
|
17
|
+
export interface PapiRule {
|
|
18
|
+
name: string;
|
|
19
|
+
children: (PapiRule | string)[];
|
|
20
|
+
behaviors: PapiBehavior[];
|
|
21
|
+
criteria: PapiCriteria[];
|
|
22
|
+
criteriaMustSatisfy: 'all' | 'any';
|
|
23
|
+
comments?: string;
|
|
24
|
+
options?: Record<string, unknown>;
|
|
25
|
+
variables?: PapiVariable[];
|
|
26
|
+
}
|
|
27
|
+
export interface RuleTree {
|
|
28
|
+
rules: PapiRule;
|
|
29
|
+
ruleFormat?: string;
|
|
30
|
+
comments?: string;
|
|
31
|
+
}
|
|
32
|
+
export interface LatestVersionInfo {
|
|
33
|
+
propertyVersion: number;
|
|
34
|
+
updatedByUser?: string;
|
|
35
|
+
updatedDate?: string;
|
|
36
|
+
productionStatus?: string;
|
|
37
|
+
stagingStatus?: string;
|
|
38
|
+
productId?: string;
|
|
39
|
+
ruleFormat: string;
|
|
40
|
+
}
|
|
41
|
+
export interface EnvInfo {
|
|
42
|
+
name: string;
|
|
43
|
+
propertyId: string | number;
|
|
44
|
+
propertyName: string;
|
|
45
|
+
groupId: number;
|
|
46
|
+
isSecure?: boolean;
|
|
47
|
+
latestVersionInfo: LatestVersionInfo;
|
|
48
|
+
suggestedRuleFormat?: string;
|
|
49
|
+
lastSavedHash?: string;
|
|
50
|
+
lastSavedHostnamesHash?: string;
|
|
51
|
+
environmentHash?: string;
|
|
52
|
+
lastKnownRuleTreeEtag?: string;
|
|
53
|
+
pendingActivations?: {
|
|
54
|
+
STAGING?: number;
|
|
55
|
+
PRODUCTION?: number;
|
|
56
|
+
};
|
|
57
|
+
activeIn_STAGING_Info?: LatestVersionInfo;
|
|
58
|
+
activeIn_PRODUCTION_Info?: LatestVersionInfo;
|
|
59
|
+
}
|
|
60
|
+
export interface ProjectInfo {
|
|
61
|
+
name: string;
|
|
62
|
+
productId: string;
|
|
63
|
+
contractId: string;
|
|
64
|
+
groupId: number;
|
|
65
|
+
version: string;
|
|
66
|
+
isSecure: boolean;
|
|
67
|
+
edgeGridConfig?: {
|
|
68
|
+
section: string;
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
export interface HostnameEntry {
|
|
72
|
+
cnameFrom: string;
|
|
73
|
+
cnameTo: string;
|
|
74
|
+
cnameType: string;
|
|
75
|
+
edgeHostnameId: string;
|
|
76
|
+
}
|
|
77
|
+
export interface PropertyConfig {
|
|
78
|
+
envInfo: EnvInfo;
|
|
79
|
+
projectInfo: ProjectInfo;
|
|
80
|
+
hostnames: HostnameEntry[];
|
|
81
|
+
snippets: Map<string, PapiRule>;
|
|
82
|
+
}
|
|
83
|
+
export type ValidationSeverity = 'error' | 'warning' | 'info';
|
|
84
|
+
export interface ValidationCheck {
|
|
85
|
+
check: string;
|
|
86
|
+
severity: ValidationSeverity;
|
|
87
|
+
message: string;
|
|
88
|
+
location?: string;
|
|
89
|
+
}
|
|
90
|
+
export interface ValidationResult {
|
|
91
|
+
valid: boolean;
|
|
92
|
+
errors: ValidationCheck[];
|
|
93
|
+
warnings: ValidationCheck[];
|
|
94
|
+
infos: ValidationCheck[];
|
|
95
|
+
}
|
|
96
|
+
export type SyncStatus = 'in-sync' | 'remote-ahead' | 'local-ahead' | 'content-modified';
|
|
97
|
+
export interface SyncResult {
|
|
98
|
+
status: SyncStatus;
|
|
99
|
+
localVersion: number;
|
|
100
|
+
remoteVersion: number;
|
|
101
|
+
localEtag?: string;
|
|
102
|
+
remoteEtag?: string;
|
|
103
|
+
}
|
|
104
|
+
export interface DiffChange {
|
|
105
|
+
type: 'added' | 'removed' | 'modified';
|
|
106
|
+
path: string;
|
|
107
|
+
name: string;
|
|
108
|
+
before?: unknown;
|
|
109
|
+
after?: unknown;
|
|
110
|
+
}
|
|
111
|
+
export interface DiffResult {
|
|
112
|
+
hasChanges: boolean;
|
|
113
|
+
summary: {
|
|
114
|
+
rulesAdded: number;
|
|
115
|
+
rulesRemoved: number;
|
|
116
|
+
rulesModified: number;
|
|
117
|
+
behaviorsAdded: number;
|
|
118
|
+
behaviorsRemoved: number;
|
|
119
|
+
behaviorsModified: number;
|
|
120
|
+
criteriaAdded: number;
|
|
121
|
+
criteriaRemoved: number;
|
|
122
|
+
criteriaModified: number;
|
|
123
|
+
variablesAdded: number;
|
|
124
|
+
variablesRemoved: number;
|
|
125
|
+
variablesModified: number;
|
|
126
|
+
};
|
|
127
|
+
changes: DiffChange[];
|
|
128
|
+
unifiedDiff: string;
|
|
129
|
+
}
|
|
130
|
+
export type ActivationNetwork = 'STAGING' | 'PRODUCTION';
|
|
131
|
+
export type ActivationStatus = 'PENDING' | 'ACTIVE' | 'FAILED' | 'DEACTIVATED' | 'ABORTED';
|
|
132
|
+
export interface ActivationRequest {
|
|
133
|
+
propertyId: string;
|
|
134
|
+
propertyVersion: number;
|
|
135
|
+
network: ActivationNetwork;
|
|
136
|
+
note?: string;
|
|
137
|
+
notifyEmails?: string[];
|
|
138
|
+
acknowledgeAllWarnings?: boolean;
|
|
139
|
+
}
|
|
140
|
+
export interface ActivationResponse {
|
|
141
|
+
activationId: string;
|
|
142
|
+
propertyId: string;
|
|
143
|
+
propertyVersion: number;
|
|
144
|
+
network: ActivationNetwork;
|
|
145
|
+
status: ActivationStatus;
|
|
146
|
+
note?: string;
|
|
147
|
+
notifyEmails?: string[];
|
|
148
|
+
}
|
|
149
|
+
export interface RedactionConfig {
|
|
150
|
+
redact?: {
|
|
151
|
+
sensitiveVariables?: boolean;
|
|
152
|
+
fields?: string[];
|
|
153
|
+
sensitiveHeaders?: string[];
|
|
154
|
+
};
|
|
155
|
+
gitProvider?: {
|
|
156
|
+
type: 'gitlab' | 'github';
|
|
157
|
+
host?: string;
|
|
158
|
+
};
|
|
159
|
+
}
|
|
160
|
+
export interface EdgeGridCredentials {
|
|
161
|
+
clientSecret: string;
|
|
162
|
+
host: string;
|
|
163
|
+
accessToken: string;
|
|
164
|
+
clientToken: string;
|
|
165
|
+
}
|
|
166
|
+
export interface ParsedRule {
|
|
167
|
+
path: string;
|
|
168
|
+
name: string;
|
|
169
|
+
behaviors: {
|
|
170
|
+
name: string;
|
|
171
|
+
keyOptions: Record<string, unknown>;
|
|
172
|
+
}[];
|
|
173
|
+
criteria: {
|
|
174
|
+
name: string;
|
|
175
|
+
matchType: string;
|
|
176
|
+
values: unknown;
|
|
177
|
+
}[];
|
|
178
|
+
comments?: string;
|
|
179
|
+
childCount: number;
|
|
180
|
+
}
|
|
181
|
+
export interface ParsedRuleTree {
|
|
182
|
+
rules: ParsedRule[];
|
|
183
|
+
variables: {
|
|
184
|
+
name: string;
|
|
185
|
+
value: string;
|
|
186
|
+
description: string;
|
|
187
|
+
sensitive: boolean;
|
|
188
|
+
}[];
|
|
189
|
+
ruleFormat?: string;
|
|
190
|
+
totalRules: number;
|
|
191
|
+
totalBehaviors: number;
|
|
192
|
+
}
|
|
193
|
+
export interface PapiError {
|
|
194
|
+
type: string;
|
|
195
|
+
title?: string;
|
|
196
|
+
status: number;
|
|
197
|
+
detail: string;
|
|
198
|
+
retryAfter?: number;
|
|
199
|
+
}
|
|
200
|
+
export interface PapiRuleTreeResponse {
|
|
201
|
+
propertyId: string;
|
|
202
|
+
propertyVersion: number;
|
|
203
|
+
etag: string;
|
|
204
|
+
ruleFormat: string;
|
|
205
|
+
rules: PapiRule;
|
|
206
|
+
}
|
|
207
|
+
export interface PapiValidationResponse {
|
|
208
|
+
propertyId: string;
|
|
209
|
+
propertyVersion: number;
|
|
210
|
+
ruleFormat: string;
|
|
211
|
+
errors: {
|
|
212
|
+
type: string;
|
|
213
|
+
errorLocation: string;
|
|
214
|
+
detail: string;
|
|
215
|
+
}[];
|
|
216
|
+
warnings: {
|
|
217
|
+
type: string;
|
|
218
|
+
errorLocation: string;
|
|
219
|
+
detail: string;
|
|
220
|
+
}[];
|
|
221
|
+
}
|
|
222
|
+
export interface PapiVersionResponse {
|
|
223
|
+
propertyVersion: number;
|
|
224
|
+
etag: string;
|
|
225
|
+
updatedDate: string;
|
|
226
|
+
note?: string;
|
|
227
|
+
}
|
|
228
|
+
export declare const GetPropertyConfigSchema: z.ZodObject<{
|
|
229
|
+
propertyId: z.ZodOptional<z.ZodString>;
|
|
230
|
+
version: z.ZodOptional<z.ZodNumber>;
|
|
231
|
+
repoPath: z.ZodOptional<z.ZodString>;
|
|
232
|
+
edgercPath: z.ZodOptional<z.ZodString>;
|
|
233
|
+
edgercSection: z.ZodOptional<z.ZodString>;
|
|
234
|
+
}, "strip", z.ZodTypeAny, {
|
|
235
|
+
propertyId?: string | undefined;
|
|
236
|
+
version?: number | undefined;
|
|
237
|
+
repoPath?: string | undefined;
|
|
238
|
+
edgercPath?: string | undefined;
|
|
239
|
+
edgercSection?: string | undefined;
|
|
240
|
+
}, {
|
|
241
|
+
propertyId?: string | undefined;
|
|
242
|
+
version?: number | undefined;
|
|
243
|
+
repoPath?: string | undefined;
|
|
244
|
+
edgercPath?: string | undefined;
|
|
245
|
+
edgercSection?: string | undefined;
|
|
246
|
+
}>;
|
|
247
|
+
export declare const ReadSnippetsSchema: z.ZodObject<{
|
|
248
|
+
repoPath: z.ZodString;
|
|
249
|
+
snippetName: z.ZodOptional<z.ZodString>;
|
|
250
|
+
}, "strip", z.ZodTypeAny, {
|
|
251
|
+
repoPath: string;
|
|
252
|
+
snippetName?: string | undefined;
|
|
253
|
+
}, {
|
|
254
|
+
repoPath: string;
|
|
255
|
+
snippetName?: string | undefined;
|
|
256
|
+
}>;
|
|
257
|
+
export declare const ParseRuleTreeSchema: z.ZodEffects<z.ZodObject<{
|
|
258
|
+
repoPath: z.ZodOptional<z.ZodString>;
|
|
259
|
+
ruleTree: z.ZodOptional<z.ZodString>;
|
|
260
|
+
}, "strip", z.ZodTypeAny, {
|
|
261
|
+
repoPath?: string | undefined;
|
|
262
|
+
ruleTree?: string | undefined;
|
|
263
|
+
}, {
|
|
264
|
+
repoPath?: string | undefined;
|
|
265
|
+
ruleTree?: string | undefined;
|
|
266
|
+
}>, {
|
|
267
|
+
repoPath?: string | undefined;
|
|
268
|
+
ruleTree?: string | undefined;
|
|
269
|
+
}, {
|
|
270
|
+
repoPath?: string | undefined;
|
|
271
|
+
ruleTree?: string | undefined;
|
|
272
|
+
}>;
|
|
273
|
+
export declare const AssembleRuleTreeSchema: z.ZodObject<{
|
|
274
|
+
repoPath: z.ZodString;
|
|
275
|
+
}, "strip", z.ZodTypeAny, {
|
|
276
|
+
repoPath: string;
|
|
277
|
+
}, {
|
|
278
|
+
repoPath: string;
|
|
279
|
+
}>;
|
|
280
|
+
export declare const SyncPropertySchema: z.ZodObject<{
|
|
281
|
+
repoPath: z.ZodString;
|
|
282
|
+
dryRun: z.ZodDefault<z.ZodBoolean>;
|
|
283
|
+
edgercPath: z.ZodOptional<z.ZodString>;
|
|
284
|
+
edgercSection: z.ZodOptional<z.ZodString>;
|
|
285
|
+
}, "strip", z.ZodTypeAny, {
|
|
286
|
+
repoPath: string;
|
|
287
|
+
dryRun: boolean;
|
|
288
|
+
edgercPath?: string | undefined;
|
|
289
|
+
edgercSection?: string | undefined;
|
|
290
|
+
}, {
|
|
291
|
+
repoPath: string;
|
|
292
|
+
edgercPath?: string | undefined;
|
|
293
|
+
edgercSection?: string | undefined;
|
|
294
|
+
dryRun?: boolean | undefined;
|
|
295
|
+
}>;
|
|
296
|
+
export declare const ValidateConfigSchema: z.ZodObject<{
|
|
297
|
+
repoPath: z.ZodString;
|
|
298
|
+
apiValidation: z.ZodDefault<z.ZodBoolean>;
|
|
299
|
+
edgercPath: z.ZodOptional<z.ZodString>;
|
|
300
|
+
edgercSection: z.ZodOptional<z.ZodString>;
|
|
301
|
+
}, "strip", z.ZodTypeAny, {
|
|
302
|
+
repoPath: string;
|
|
303
|
+
apiValidation: boolean;
|
|
304
|
+
edgercPath?: string | undefined;
|
|
305
|
+
edgercSection?: string | undefined;
|
|
306
|
+
}, {
|
|
307
|
+
repoPath: string;
|
|
308
|
+
edgercPath?: string | undefined;
|
|
309
|
+
edgercSection?: string | undefined;
|
|
310
|
+
apiValidation?: boolean | undefined;
|
|
311
|
+
}>;
|
|
312
|
+
export declare const DiffConfigsSchema: z.ZodObject<{
|
|
313
|
+
before: z.ZodString;
|
|
314
|
+
after: z.ZodString;
|
|
315
|
+
}, "strip", z.ZodTypeAny, {
|
|
316
|
+
before: string;
|
|
317
|
+
after: string;
|
|
318
|
+
}, {
|
|
319
|
+
before: string;
|
|
320
|
+
after: string;
|
|
321
|
+
}>;
|
|
322
|
+
export declare const WriteSnippetSchema: z.ZodObject<{
|
|
323
|
+
repoPath: z.ZodString;
|
|
324
|
+
snippetName: z.ZodString;
|
|
325
|
+
content: z.ZodString;
|
|
326
|
+
addToMainJson: z.ZodDefault<z.ZodBoolean>;
|
|
327
|
+
position: z.ZodDefault<z.ZodEnum<["beginning", "end"]>>;
|
|
328
|
+
}, "strip", z.ZodTypeAny, {
|
|
329
|
+
repoPath: string;
|
|
330
|
+
snippetName: string;
|
|
331
|
+
content: string;
|
|
332
|
+
addToMainJson: boolean;
|
|
333
|
+
position: "beginning" | "end";
|
|
334
|
+
}, {
|
|
335
|
+
repoPath: string;
|
|
336
|
+
snippetName: string;
|
|
337
|
+
content: string;
|
|
338
|
+
addToMainJson?: boolean | undefined;
|
|
339
|
+
position?: "beginning" | "end" | undefined;
|
|
340
|
+
}>;
|
|
341
|
+
export declare const ApplyBehaviorSchema: z.ZodObject<{
|
|
342
|
+
repoPath: z.ZodString;
|
|
343
|
+
snippetName: z.ZodString;
|
|
344
|
+
behavior: z.ZodString;
|
|
345
|
+
criteria: z.ZodOptional<z.ZodString>;
|
|
346
|
+
criteriaMustSatisfy: z.ZodOptional<z.ZodEnum<["all", "any"]>>;
|
|
347
|
+
}, "strip", z.ZodTypeAny, {
|
|
348
|
+
repoPath: string;
|
|
349
|
+
snippetName: string;
|
|
350
|
+
behavior: string;
|
|
351
|
+
criteria?: string | undefined;
|
|
352
|
+
criteriaMustSatisfy?: "all" | "any" | undefined;
|
|
353
|
+
}, {
|
|
354
|
+
repoPath: string;
|
|
355
|
+
snippetName: string;
|
|
356
|
+
behavior: string;
|
|
357
|
+
criteria?: string | undefined;
|
|
358
|
+
criteriaMustSatisfy?: "all" | "any" | undefined;
|
|
359
|
+
}>;
|
|
360
|
+
export declare const CreateBranchSchema: z.ZodObject<{
|
|
361
|
+
repoPath: z.ZodString;
|
|
362
|
+
type: z.ZodEnum<["feature", "fix", "refactor", "chore"]>;
|
|
363
|
+
description: z.ZodString;
|
|
364
|
+
}, "strip", z.ZodTypeAny, {
|
|
365
|
+
repoPath: string;
|
|
366
|
+
type: "feature" | "fix" | "refactor" | "chore";
|
|
367
|
+
description: string;
|
|
368
|
+
}, {
|
|
369
|
+
repoPath: string;
|
|
370
|
+
type: "feature" | "fix" | "refactor" | "chore";
|
|
371
|
+
description: string;
|
|
372
|
+
}>;
|
|
373
|
+
export declare const CreateMergeRequestSchema: z.ZodObject<{
|
|
374
|
+
repoPath: z.ZodString;
|
|
375
|
+
title: z.ZodString;
|
|
376
|
+
description: z.ZodString;
|
|
377
|
+
files: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
378
|
+
targetBranch: z.ZodDefault<z.ZodString>;
|
|
379
|
+
}, "strip", z.ZodTypeAny, {
|
|
380
|
+
repoPath: string;
|
|
381
|
+
description: string;
|
|
382
|
+
title: string;
|
|
383
|
+
targetBranch: string;
|
|
384
|
+
files?: string[] | undefined;
|
|
385
|
+
}, {
|
|
386
|
+
repoPath: string;
|
|
387
|
+
description: string;
|
|
388
|
+
title: string;
|
|
389
|
+
files?: string[] | undefined;
|
|
390
|
+
targetBranch?: string | undefined;
|
|
391
|
+
}>;
|
|
392
|
+
export declare const ActivateStagingSchema: z.ZodEffects<z.ZodObject<{
|
|
393
|
+
propertyId: z.ZodOptional<z.ZodString>;
|
|
394
|
+
version: z.ZodOptional<z.ZodNumber>;
|
|
395
|
+
repoPath: z.ZodOptional<z.ZodString>;
|
|
396
|
+
note: z.ZodOptional<z.ZodString>;
|
|
397
|
+
edgercPath: z.ZodOptional<z.ZodString>;
|
|
398
|
+
edgercSection: z.ZodOptional<z.ZodString>;
|
|
399
|
+
}, "strip", z.ZodTypeAny, {
|
|
400
|
+
propertyId?: string | undefined;
|
|
401
|
+
version?: number | undefined;
|
|
402
|
+
repoPath?: string | undefined;
|
|
403
|
+
edgercPath?: string | undefined;
|
|
404
|
+
edgercSection?: string | undefined;
|
|
405
|
+
note?: string | undefined;
|
|
406
|
+
}, {
|
|
407
|
+
propertyId?: string | undefined;
|
|
408
|
+
version?: number | undefined;
|
|
409
|
+
repoPath?: string | undefined;
|
|
410
|
+
edgercPath?: string | undefined;
|
|
411
|
+
edgercSection?: string | undefined;
|
|
412
|
+
note?: string | undefined;
|
|
413
|
+
}>, {
|
|
414
|
+
propertyId?: string | undefined;
|
|
415
|
+
version?: number | undefined;
|
|
416
|
+
repoPath?: string | undefined;
|
|
417
|
+
edgercPath?: string | undefined;
|
|
418
|
+
edgercSection?: string | undefined;
|
|
419
|
+
note?: string | undefined;
|
|
420
|
+
}, {
|
|
421
|
+
propertyId?: string | undefined;
|
|
422
|
+
version?: number | undefined;
|
|
423
|
+
repoPath?: string | undefined;
|
|
424
|
+
edgercPath?: string | undefined;
|
|
425
|
+
edgercSection?: string | undefined;
|
|
426
|
+
note?: string | undefined;
|
|
427
|
+
}>;
|
|
428
|
+
export declare const ActivateProductionSchema: z.ZodEffects<z.ZodObject<{
|
|
429
|
+
propertyId: z.ZodOptional<z.ZodString>;
|
|
430
|
+
version: z.ZodOptional<z.ZodNumber>;
|
|
431
|
+
repoPath: z.ZodOptional<z.ZodString>;
|
|
432
|
+
acknowledgeProductionRisk: z.ZodLiteral<true>;
|
|
433
|
+
contactEmails: z.ZodArray<z.ZodString, "many">;
|
|
434
|
+
note: z.ZodOptional<z.ZodString>;
|
|
435
|
+
edgercPath: z.ZodOptional<z.ZodString>;
|
|
436
|
+
edgercSection: z.ZodOptional<z.ZodString>;
|
|
437
|
+
}, "strip", z.ZodTypeAny, {
|
|
438
|
+
acknowledgeProductionRisk: true;
|
|
439
|
+
contactEmails: string[];
|
|
440
|
+
propertyId?: string | undefined;
|
|
441
|
+
version?: number | undefined;
|
|
442
|
+
repoPath?: string | undefined;
|
|
443
|
+
edgercPath?: string | undefined;
|
|
444
|
+
edgercSection?: string | undefined;
|
|
445
|
+
note?: string | undefined;
|
|
446
|
+
}, {
|
|
447
|
+
acknowledgeProductionRisk: true;
|
|
448
|
+
contactEmails: string[];
|
|
449
|
+
propertyId?: string | undefined;
|
|
450
|
+
version?: number | undefined;
|
|
451
|
+
repoPath?: string | undefined;
|
|
452
|
+
edgercPath?: string | undefined;
|
|
453
|
+
edgercSection?: string | undefined;
|
|
454
|
+
note?: string | undefined;
|
|
455
|
+
}>, {
|
|
456
|
+
acknowledgeProductionRisk: true;
|
|
457
|
+
contactEmails: string[];
|
|
458
|
+
propertyId?: string | undefined;
|
|
459
|
+
version?: number | undefined;
|
|
460
|
+
repoPath?: string | undefined;
|
|
461
|
+
edgercPath?: string | undefined;
|
|
462
|
+
edgercSection?: string | undefined;
|
|
463
|
+
note?: string | undefined;
|
|
464
|
+
}, {
|
|
465
|
+
acknowledgeProductionRisk: true;
|
|
466
|
+
contactEmails: string[];
|
|
467
|
+
propertyId?: string | undefined;
|
|
468
|
+
version?: number | undefined;
|
|
469
|
+
repoPath?: string | undefined;
|
|
470
|
+
edgercPath?: string | undefined;
|
|
471
|
+
edgercSection?: string | undefined;
|
|
472
|
+
note?: string | undefined;
|
|
473
|
+
}>;
|
|
474
|
+
export declare const TriggerPipelineSchema: z.ZodObject<{
|
|
475
|
+
repoPath: z.ZodString;
|
|
476
|
+
branch: z.ZodOptional<z.ZodString>;
|
|
477
|
+
variables: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
478
|
+
}, "strip", z.ZodTypeAny, {
|
|
479
|
+
repoPath: string;
|
|
480
|
+
branch?: string | undefined;
|
|
481
|
+
variables?: Record<string, string> | undefined;
|
|
482
|
+
}, {
|
|
483
|
+
repoPath: string;
|
|
484
|
+
branch?: string | undefined;
|
|
485
|
+
variables?: Record<string, string> | undefined;
|
|
486
|
+
}>;
|
|
487
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/papi/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAClC;AAED,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAClC;AAED,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,OAAO,CAAC;IAChB,SAAS,EAAE,OAAO,CAAC;CACpB;AAED,MAAM,WAAW,QAAQ;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,CAAC,QAAQ,GAAG,MAAM,CAAC,EAAE,CAAC;IAChC,SAAS,EAAE,YAAY,EAAE,CAAC;IAC1B,QAAQ,EAAE,YAAY,EAAE,CAAC;IACzB,mBAAmB,EAAE,KAAK,GAAG,KAAK,CAAC;IACnC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC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;;;EAK/B,CAAC;AAEH,eAAO,MAAM,iBAAiB;;;;;;;;;EAG5B,CAAC;AAEH,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;EAM7B,CAAC;AAEH,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;EAM9B,CAAC;AAEH,eAAO,MAAM,kBAAkB;;;;;;;;;;;;EAI7B,CAAC;AAEH,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;EAMnC,CAAC;AAEH,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAShC,CAAC;AAEH,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAanC,CAAC;AAEH,eAAO,MAAM,qBAAqB;;;;;;;;;;;;EAIhC,CAAC"}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
// === Zod Schemas for Tool Input Validation ===
|
|
3
|
+
export const GetPropertyConfigSchema = z.object({
|
|
4
|
+
propertyId: z.string().optional().describe('Akamai property ID (e.g., prp_12345)'),
|
|
5
|
+
version: z.number().optional().describe('Property version (defaults to latest)'),
|
|
6
|
+
repoPath: z.string().optional().describe('Path to local property repo (auto-detects propertyId from envInfo.json)'),
|
|
7
|
+
edgercPath: z.string().optional().describe('Custom .edgerc file path'),
|
|
8
|
+
edgercSection: z.string().optional().describe('.edgerc section name (default: "default")'),
|
|
9
|
+
});
|
|
10
|
+
export const ReadSnippetsSchema = z.object({
|
|
11
|
+
repoPath: z.string().describe('Path to the property repo'),
|
|
12
|
+
snippetName: z.string().optional().describe('Specific snippet file name (omit to list all)'),
|
|
13
|
+
});
|
|
14
|
+
export const ParseRuleTreeSchema = z.object({
|
|
15
|
+
repoPath: z.string().optional().describe('Path to the property repo (assembles from disk)'),
|
|
16
|
+
ruleTree: z.string().optional().describe('Raw rule tree JSON string'),
|
|
17
|
+
}).refine(data => data.repoPath || data.ruleTree, {
|
|
18
|
+
message: 'Either repoPath or ruleTree must be provided',
|
|
19
|
+
});
|
|
20
|
+
export const AssembleRuleTreeSchema = z.object({
|
|
21
|
+
repoPath: z.string().describe('Path to the property repo'),
|
|
22
|
+
});
|
|
23
|
+
export const SyncPropertySchema = z.object({
|
|
24
|
+
repoPath: z.string().describe('Path to the property repo'),
|
|
25
|
+
dryRun: z.boolean().default(true).describe('If true, report status only (default)'),
|
|
26
|
+
edgercPath: z.string().optional(),
|
|
27
|
+
edgercSection: z.string().optional(),
|
|
28
|
+
});
|
|
29
|
+
export const ValidateConfigSchema = z.object({
|
|
30
|
+
repoPath: z.string().describe('Path to the property repo'),
|
|
31
|
+
apiValidation: z.boolean().default(false).describe('Also validate against PAPI API'),
|
|
32
|
+
edgercPath: z.string().optional(),
|
|
33
|
+
edgercSection: z.string().optional(),
|
|
34
|
+
});
|
|
35
|
+
export const DiffConfigsSchema = z.object({
|
|
36
|
+
before: z.string().describe('First rule tree JSON string'),
|
|
37
|
+
after: z.string().describe('Second rule tree JSON string'),
|
|
38
|
+
});
|
|
39
|
+
export const WriteSnippetSchema = z.object({
|
|
40
|
+
repoPath: z.string().describe('Path to the property repo'),
|
|
41
|
+
snippetName: z.string().describe('Snippet file name (e.g., "My_Rule.json")'),
|
|
42
|
+
content: z.string().describe('Snippet content as JSON string'),
|
|
43
|
+
addToMainJson: z.boolean().default(false).describe('Add #include: to main.json'),
|
|
44
|
+
position: z.enum(['beginning', 'end']).default('end').describe('Position in children array'),
|
|
45
|
+
});
|
|
46
|
+
export const ApplyBehaviorSchema = z.object({
|
|
47
|
+
repoPath: z.string().describe('Path to the property repo'),
|
|
48
|
+
snippetName: z.string().describe('Target snippet file name'),
|
|
49
|
+
behavior: z.string().describe('Behavior object as JSON string'),
|
|
50
|
+
criteria: z.string().optional().describe('Criteria array as JSON string'),
|
|
51
|
+
criteriaMustSatisfy: z.enum(['all', 'any']).optional(),
|
|
52
|
+
});
|
|
53
|
+
export const CreateBranchSchema = z.object({
|
|
54
|
+
repoPath: z.string().describe('Path to the property repo'),
|
|
55
|
+
type: z.enum(['feature', 'fix', 'refactor', 'chore']).describe('Branch type'),
|
|
56
|
+
description: z.string().describe('Short description for branch name'),
|
|
57
|
+
});
|
|
58
|
+
export const CreateMergeRequestSchema = z.object({
|
|
59
|
+
repoPath: z.string().describe('Path to the property repo'),
|
|
60
|
+
title: z.string().describe('MR/PR title'),
|
|
61
|
+
description: z.string().describe('Plain-English description of changes'),
|
|
62
|
+
files: z.array(z.string()).optional().describe('Specific files to commit (defaults to all changed)'),
|
|
63
|
+
targetBranch: z.string().default('main').describe('Target branch for MR/PR'),
|
|
64
|
+
});
|
|
65
|
+
export const ActivateStagingSchema = z.object({
|
|
66
|
+
propertyId: z.string().optional(),
|
|
67
|
+
version: z.number().optional(),
|
|
68
|
+
repoPath: z.string().optional(),
|
|
69
|
+
note: z.string().optional().describe('Activation note'),
|
|
70
|
+
edgercPath: z.string().optional(),
|
|
71
|
+
edgercSection: z.string().optional(),
|
|
72
|
+
}).refine(data => data.propertyId || data.repoPath, {
|
|
73
|
+
message: 'Either propertyId or repoPath must be provided',
|
|
74
|
+
});
|
|
75
|
+
export const ActivateProductionSchema = z.object({
|
|
76
|
+
propertyId: z.string().optional(),
|
|
77
|
+
version: z.number().optional(),
|
|
78
|
+
repoPath: z.string().optional(),
|
|
79
|
+
acknowledgeProductionRisk: z.literal(true, {
|
|
80
|
+
errorMap: () => ({ message: 'You must set acknowledgeProductionRisk to true for production activation' }),
|
|
81
|
+
}),
|
|
82
|
+
contactEmails: z.array(z.string().email()).min(1).describe('Required notification emails'),
|
|
83
|
+
note: z.string().optional(),
|
|
84
|
+
edgercPath: z.string().optional(),
|
|
85
|
+
edgercSection: z.string().optional(),
|
|
86
|
+
}).refine(data => data.propertyId || data.repoPath, {
|
|
87
|
+
message: 'Either propertyId or repoPath must be provided',
|
|
88
|
+
});
|
|
89
|
+
export const TriggerPipelineSchema = z.object({
|
|
90
|
+
repoPath: z.string().describe('Path to the property repo'),
|
|
91
|
+
branch: z.string().optional().describe('Branch to trigger pipeline for (defaults to current)'),
|
|
92
|
+
variables: z.record(z.string()).optional().describe('Key-value variables for pipeline parameters'),
|
|
93
|
+
});
|
|
94
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/papi/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AA8PxB,gDAAgD;AAEhD,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC9C,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,sCAAsC,CAAC;IAClF,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,uCAAuC,CAAC;IAChF,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,yEAAyE,CAAC;IACnH,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,0BAA0B,CAAC;IACtE,aAAa,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,2CAA2C,CAAC;CAC3F,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,CAAC,MAAM,CAAC;IACzC,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,2BAA2B,CAAC;IAC1D,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,+CAA+C,CAAC;CAC7F,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC1C,QAAQ,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I,CAAC,QAAQ,EAAE;IAClD,OAAO,EAAE,gDAAgD;CAC1D,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC5C,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,2BAA2B,CAAC;IAC1D,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,sDAAsD,CAAC;IAC9F,SAAS,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,6CAA6C,CAAC;CACnG,CAAC,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { RedactionConfig } from '../papi/types.js';
|
|
2
|
+
export declare class Redactor {
|
|
3
|
+
private readonly config;
|
|
4
|
+
constructor(config?: RedactionConfig);
|
|
5
|
+
/**
|
|
6
|
+
* Apply redaction rules to an object. Returns a deep clone with sensitive fields replaced.
|
|
7
|
+
* If no redaction config, returns the original object unchanged.
|
|
8
|
+
*/
|
|
9
|
+
redact<T>(data: T): T;
|
|
10
|
+
private redactValue;
|
|
11
|
+
/**
|
|
12
|
+
* Pattern matching: dot-delimited suffix matching.
|
|
13
|
+
* `*` matches a single path segment.
|
|
14
|
+
* e.g., pattern "options.hostname" matches "rules.children.0.behaviors.0.options.hostname"
|
|
15
|
+
* e.g., pattern "variables.*.value" matches "variables.0.value" or "variables.MY_VAR.value"
|
|
16
|
+
*/
|
|
17
|
+
private matchPattern;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Load RedactionConfig from .papi-mcp.json.
|
|
21
|
+
* Search order: env var path > working dir > home dir.
|
|
22
|
+
* Returns undefined if no config found (not an error).
|
|
23
|
+
*/
|
|
24
|
+
export declare function loadRedactionConfig(): Promise<RedactionConfig | undefined>;
|
|
25
|
+
//# sourceMappingURL=redactor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"redactor.d.ts","sourceRoot":"","sources":["../../src/redaction/redactor.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAExD,qBAAa,QAAQ;IACnB,OAAO,CAAC,QAAQ,CAAC,MAAM,CAA4B;gBAEvC,MAAM,CAAC,EAAE,eAAe;IAIpC;;;OAGG;IACH,MAAM,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,GAAG,CAAC;IAQrB,OAAO,CAAC,WAAW;IAsDnB;;;;;OAKG;IACH,OAAO,CAAC,YAAY;CAiBrB;AAED;;;;GAIG;AACH,wBAAsB,mBAAmB,IAAI,OAAO,CAAC,eAAe,GAAG,SAAS,CAAC,CAoChF"}
|