pi-cicd 1.0.12 → 1.0.14
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/package.json
CHANGED
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: agent-integration
|
|
3
|
+
description: Master guide for all extensions working together. Explains how to use pi-recollect, pi-debug, pi-audit, pi-browse, and other extensions to minimize token waste and maximize efficiency.
|
|
4
|
+
triggers:
|
|
5
|
+
- memory
|
|
6
|
+
- integrate
|
|
7
|
+
- token optimization
|
|
8
|
+
- efficiency
|
|
9
|
+
- extension
|
|
10
|
+
- work together
|
|
11
|
+
- remember
|
|
12
|
+
- previous
|
|
13
|
+
- similar
|
|
14
|
+
- found before
|
|
15
|
+
requirements:
|
|
16
|
+
tools: [memory_store, memory_search, memory_recall, memory_status]
|
|
17
|
+
context: [any task that involves repeated work]
|
|
18
|
+
---
|
|
19
|
+
|
|
20
|
+
# Agent Integration Master Skill
|
|
21
|
+
|
|
22
|
+
## Overview
|
|
23
|
+
|
|
24
|
+
All 9 extensions are designed to work **together**, with **pi-recollect** as the central memory hub.
|
|
25
|
+
|
|
26
|
+
## Golden Rule
|
|
27
|
+
|
|
28
|
+
```
|
|
29
|
+
"Store in memory, search before doing"
|
|
30
|
+
|
|
31
|
+
BEFORE: Do something (find bug, research, audit)
|
|
32
|
+
AFTER: Store result in memory
|
|
33
|
+
NEXT: Search memory before doing same thing
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
## Extension Integration
|
|
37
|
+
|
|
38
|
+
| Extension | Integrates with Memory | Purpose |
|
|
39
|
+
|-----------|----------------------|---------|
|
|
40
|
+
| pi-debug | ✅ Store bug fixes | Remember bugs found |
|
|
41
|
+
| pi-audit | ✅ Store security issues | Remember vulnerabilities |
|
|
42
|
+
| pi-browse | ✅ Store research | Remember API patterns |
|
|
43
|
+
| pi-pipeline | ✅ Store failures | Remember quality issues |
|
|
44
|
+
| pi-cicd | ✅ Store deploy issues | Remember deployment problems |
|
|
45
|
+
| pi-smart | ✅ Store patterns | Remember code patterns |
|
|
46
|
+
| pi-render | ✅ Store decisions | Remember design decisions |
|
|
47
|
+
| pi-langsrv | ✅ Store definitions | Remember code structure |
|
|
48
|
+
|
|
49
|
+
## Token Optimization
|
|
50
|
+
|
|
51
|
+
Without memory:
|
|
52
|
+
- Session 1: Debug bug (2000 tokens)
|
|
53
|
+
- Session 2: Debug same bug again (2000 tokens)
|
|
54
|
+
- Total: 4000 tokens
|
|
55
|
+
|
|
56
|
+
With memory:
|
|
57
|
+
- Session 1: Debug bug (2000 tokens) + store
|
|
58
|
+
- Session 2: Search memory → Found! (50 tokens)
|
|
59
|
+
- Total: 2050 tokens
|
|
60
|
+
|
|
61
|
+
**Savings: ~50% per session!**
|
|
62
|
+
|
|
63
|
+
## Workflow
|
|
64
|
+
|
|
65
|
+
```
|
|
66
|
+
1. About to do work?
|
|
67
|
+
→ memory_search first!
|
|
68
|
+
|
|
69
|
+
2. Found/Solved something?
|
|
70
|
+
→ memory_store immediately!
|
|
71
|
+
|
|
72
|
+
3. Store categories:
|
|
73
|
+
- gotcha: Common mistakes
|
|
74
|
+
- decision: Architectural choices
|
|
75
|
+
- pattern: Code patterns
|
|
76
|
+
- solution: Fixed problems
|
|
77
|
+
- bug: Bug fixes
|
|
78
|
+
- security: Security findings
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
## Quick Reference
|
|
82
|
+
|
|
83
|
+
```typescript
|
|
84
|
+
// Search before doing
|
|
85
|
+
memory_search({ query: "related topic" })
|
|
86
|
+
|
|
87
|
+
// Store after finding
|
|
88
|
+
memory_store({
|
|
89
|
+
category: "bug",
|
|
90
|
+
title: "Brief description",
|
|
91
|
+
content: "What was fixed/found"
|
|
92
|
+
})
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
## Remember
|
|
96
|
+
|
|
97
|
+
- **Store after solving** - Don't lose discovered knowledge
|
|
98
|
+
- **Search before starting** - Don't repeat work
|
|
99
|
+
- **Use categories** - Keep memory organized
|
|
100
|
+
- **Be concise** - Store insights, not raw data
|
|
@@ -0,0 +1,416 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: cross-extension
|
|
3
|
+
description: Master guide for all extensions working together. Complete integration patterns between pi-langsrv, pi-smart, pi-recollect, pi-debug, pi-audit, pi-browse, pi-pipeline, pi-render, and pi-cicd.
|
|
4
|
+
triggers:
|
|
5
|
+
- integrate
|
|
6
|
+
- extension
|
|
7
|
+
- work together
|
|
8
|
+
- combine
|
|
9
|
+
- chain
|
|
10
|
+
- workflow
|
|
11
|
+
- cross
|
|
12
|
+
- lsp + debug
|
|
13
|
+
- audit + browse
|
|
14
|
+
- pipeline + render
|
|
15
|
+
requirements:
|
|
16
|
+
tools: [ALL]
|
|
17
|
+
context: [any task requiring multiple capabilities]
|
|
18
|
+
---
|
|
19
|
+
|
|
20
|
+
# Cross-Extension Integration Master Skill
|
|
21
|
+
|
|
22
|
+
## Overview
|
|
23
|
+
|
|
24
|
+
All 9 extensions are designed to work **together** in powerful combinations.
|
|
25
|
+
|
|
26
|
+
## Extension Purposes
|
|
27
|
+
|
|
28
|
+
| Extension | Primary Role | Key Tools |
|
|
29
|
+
|-----------|-------------|-----------|
|
|
30
|
+
| pi-langsrv | Code Navigation | lsp_hover, lsp_find_refs, lsp_goto_def |
|
|
31
|
+
| pi-smart | Context Optimization | analyze, smart_config |
|
|
32
|
+
| pi-recollect | Memory | memory_store, memory_search |
|
|
33
|
+
| pi-debug | Runtime Debug | debug_start, debug_variables |
|
|
34
|
+
| pi-audit | Security Review | review_diff, review_file |
|
|
35
|
+
| pi-browse | Web Research | web_search, web_fetch |
|
|
36
|
+
| pi-pipeline | Workflow | pipeline_verify, pipeline_status |
|
|
37
|
+
| pi-render | Visual UI | visual_update_plan, visual_show_findings |
|
|
38
|
+
| pi-cicd | CI/CD | /ci command |
|
|
39
|
+
|
|
40
|
+
## Cross-Extension Workflows
|
|
41
|
+
|
|
42
|
+
### Workflow 1: Security Audit + Web Research
|
|
43
|
+
|
|
44
|
+
**Extensions:** pi-audit + pi-browse + pi-recollect
|
|
45
|
+
|
|
46
|
+
```typescript
|
|
47
|
+
// 1. Find potential vulnerability
|
|
48
|
+
review_diff({ base: "HEAD~1", head: "HEAD" })
|
|
49
|
+
|
|
50
|
+
// 2. Research CVE for this vulnerability
|
|
51
|
+
web_search({
|
|
52
|
+
query: "SQL injection express CVE 2024"
|
|
53
|
+
})
|
|
54
|
+
|
|
55
|
+
// 3. Get fix details
|
|
56
|
+
web_fetch({
|
|
57
|
+
url: "https://owasp.org/www-community/attacks/SQL_Injection"
|
|
58
|
+
})
|
|
59
|
+
|
|
60
|
+
// 4. Store for future reference
|
|
61
|
+
memory_store({
|
|
62
|
+
category: "security",
|
|
63
|
+
title: "SQL Injection prevention",
|
|
64
|
+
content: "Fix: Use parameterized queries. Tools: mysql2.escape(), SQL.stringify()"
|
|
65
|
+
})
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
### Workflow 2: Code Navigation + Debugging
|
|
69
|
+
|
|
70
|
+
**Extensions:** pi-langsrv + pi-debug
|
|
71
|
+
|
|
72
|
+
```typescript
|
|
73
|
+
// 1. Find all usages of a function
|
|
74
|
+
lsp_find_refs({
|
|
75
|
+
file: "src/auth.ts",
|
|
76
|
+
line: 42
|
|
77
|
+
})
|
|
78
|
+
// → Found 5 call sites
|
|
79
|
+
|
|
80
|
+
// 2. See code issues
|
|
81
|
+
lsp_diagnostics({ file: "src/auth.ts" })
|
|
82
|
+
|
|
83
|
+
// 3. Debug at the problematic call site
|
|
84
|
+
debug_start({ program: "src/app.ts" })
|
|
85
|
+
debug_breakpoint({ file: "src/auth.ts", line: 42 })
|
|
86
|
+
|
|
87
|
+
// 4. Inspect state
|
|
88
|
+
debug_variables({ scope: "locals" })
|
|
89
|
+
debug_stack()
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
### Workflow 3: Code Navigation + Security Audit
|
|
93
|
+
|
|
94
|
+
**Extensions:** pi-langsrv + pi-audit
|
|
95
|
+
|
|
96
|
+
```typescript
|
|
97
|
+
// 1. Find all input handling code
|
|
98
|
+
lsp_find_refs({
|
|
99
|
+
file: "src/validation.ts",
|
|
100
|
+
line: 10
|
|
101
|
+
})
|
|
102
|
+
// → Found 12 input fields
|
|
103
|
+
|
|
104
|
+
// 2. Audit each for security
|
|
105
|
+
for (const ref of references) {
|
|
106
|
+
review_file({
|
|
107
|
+
file: ref.file,
|
|
108
|
+
context: "full",
|
|
109
|
+
perspectives: ["security"]
|
|
110
|
+
})
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
// 3. Generate report
|
|
114
|
+
review_report({
|
|
115
|
+
format: "markdown",
|
|
116
|
+
groupBy: "severity"
|
|
117
|
+
})
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
### Workflow 4: Context Analysis + Pipeline
|
|
121
|
+
|
|
122
|
+
**Extensions:** pi-smart + pi-pipeline
|
|
123
|
+
|
|
124
|
+
```typescript
|
|
125
|
+
// 1. Analyze codebase complexity
|
|
126
|
+
analyze({
|
|
127
|
+
files: "src/**/*.ts",
|
|
128
|
+
intent: "complexity"
|
|
129
|
+
})
|
|
130
|
+
|
|
131
|
+
// 2. Optimize context for pipeline
|
|
132
|
+
smart_config({
|
|
133
|
+
action: "set",
|
|
134
|
+
key: "focus",
|
|
135
|
+
value: "src/complex/*"
|
|
136
|
+
})
|
|
137
|
+
|
|
138
|
+
// 3. Run pipeline with optimized context
|
|
139
|
+
pipeline_verify({
|
|
140
|
+
testCommand: "npm test"
|
|
141
|
+
})
|
|
142
|
+
|
|
143
|
+
// 4. Monitor status
|
|
144
|
+
pipeline_status()
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
### Workflow 5: Security + Debug Verification
|
|
148
|
+
|
|
149
|
+
**Extensions:** pi-audit + pi-debug + pi-recollect
|
|
150
|
+
|
|
151
|
+
```typescript
|
|
152
|
+
// 1. Find vulnerability
|
|
153
|
+
review_diff({ base: "HEAD~1", head: "HEAD" })
|
|
154
|
+
// → Found: SQL injection at db.ts:42
|
|
155
|
+
|
|
156
|
+
// 2. Debug to verify exploitability
|
|
157
|
+
debug_start({ program: "src/app.ts" })
|
|
158
|
+
debug_breakpoint({ file: "src/db.ts", line: 42 })
|
|
159
|
+
|
|
160
|
+
// 3. Test the exploit
|
|
161
|
+
debug_evaluate({
|
|
162
|
+
expression: "userInput + query"
|
|
163
|
+
})
|
|
164
|
+
// → Confirmed: SQL injection possible
|
|
165
|
+
|
|
166
|
+
// 4. Store the finding
|
|
167
|
+
memory_store({
|
|
168
|
+
category: "security",
|
|
169
|
+
title: "SQL Injection db.ts:42",
|
|
170
|
+
content: "Verified exploitable. Fix: Use db.query('SELECT * FROM ? WHERE id = ?', [table, id])"
|
|
171
|
+
})
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
### Workflow 6: Pipeline + Visual Feedback
|
|
175
|
+
|
|
176
|
+
**Extensions:** pi-pipeline + pi-render
|
|
177
|
+
|
|
178
|
+
```typescript
|
|
179
|
+
// 1. Show pipeline plan
|
|
180
|
+
visual_update_plan({
|
|
181
|
+
title: "Security Review Pipeline",
|
|
182
|
+
status: "DRAFT",
|
|
183
|
+
tasks: [
|
|
184
|
+
{ id: "1", description: "Review diff", status: "pending" },
|
|
185
|
+
{ id: "2", description: "Audit code", status: "pending" },
|
|
186
|
+
{ id: "3", description: "Generate report", status: "pending" }
|
|
187
|
+
]
|
|
188
|
+
})
|
|
189
|
+
|
|
190
|
+
// 2. Run verification
|
|
191
|
+
pipeline_verify({ testCommand: "npm test" })
|
|
192
|
+
|
|
193
|
+
// 3. Show progress
|
|
194
|
+
visual_update_progress({
|
|
195
|
+
phase: "audit",
|
|
196
|
+
completed: 1,
|
|
197
|
+
total: 3,
|
|
198
|
+
currentTask: "Auditing authentication"
|
|
199
|
+
})
|
|
200
|
+
|
|
201
|
+
// 4. Show findings
|
|
202
|
+
visual_show_findings({
|
|
203
|
+
findings: [
|
|
204
|
+
{ file: "src/auth.ts", severity: "high", message: "Missing rate limiting" }
|
|
205
|
+
]
|
|
206
|
+
})
|
|
207
|
+
```
|
|
208
|
+
|
|
209
|
+
### Workflow 7: CI/CD + Debug
|
|
210
|
+
|
|
211
|
+
**Extensions:** pi-cicd + pi-debug + pi-recollect
|
|
212
|
+
|
|
213
|
+
```typescript
|
|
214
|
+
// 1. Run CI tests
|
|
215
|
+
// /ci run --stage=test
|
|
216
|
+
|
|
217
|
+
// 2. If failed: debug the failing test
|
|
218
|
+
debug_start({ program: "test/auth.test.ts" })
|
|
219
|
+
debug_breakpoint({ file: "test/auth.test.ts", line: 42 })
|
|
220
|
+
|
|
221
|
+
// 3. Find root cause
|
|
222
|
+
debug_variables({ scope: "locals" })
|
|
223
|
+
debug_evaluate({ expression: "expected" })
|
|
224
|
+
|
|
225
|
+
// 4. Store the fix
|
|
226
|
+
memory_store({
|
|
227
|
+
category: "bug",
|
|
228
|
+
title: "Auth test fix",
|
|
229
|
+
content: "Test expected 'admin' but got 'user'. Fix: Check user.role instead of user.name"
|
|
230
|
+
})
|
|
231
|
+
```
|
|
232
|
+
|
|
233
|
+
### Workflow 8: Web Research + Memory
|
|
234
|
+
|
|
235
|
+
**Extensions:** pi-browse + pi-recollect
|
|
236
|
+
|
|
237
|
+
```typescript
|
|
238
|
+
// 1. Research API
|
|
239
|
+
web_search({ query: "Stripe subscription API 2024" })
|
|
240
|
+
web_fetch({ url: "https://stripe.com/docs/api/subscriptions" })
|
|
241
|
+
|
|
242
|
+
// 2. Store findings
|
|
243
|
+
memory_store({
|
|
244
|
+
category: "api",
|
|
245
|
+
title: "Stripe Subscription API",
|
|
246
|
+
content: `POST /v1/subscriptions
|
|
247
|
+
Body: { customer, items: [{price, quantity}] }
|
|
248
|
+
Response: { id, status, customer }`
|
|
249
|
+
})
|
|
250
|
+
|
|
251
|
+
// 3. Next time: just search
|
|
252
|
+
memory_search({ query: "Stripe subscription" })
|
|
253
|
+
```
|
|
254
|
+
|
|
255
|
+
### Workflow 9: Code Structure + Analysis
|
|
256
|
+
|
|
257
|
+
**Extensions:** pi-langsrv + pi-smart
|
|
258
|
+
|
|
259
|
+
```typescript
|
|
260
|
+
// 1. Get code structure
|
|
261
|
+
lsp_symbols({ file: "src/**/*.ts" })
|
|
262
|
+
// → Get all classes and functions
|
|
263
|
+
|
|
264
|
+
// 2. Analyze for refactoring
|
|
265
|
+
analyze({
|
|
266
|
+
files: "src/**/*.ts",
|
|
267
|
+
intent: "refactor-candidates"
|
|
268
|
+
})
|
|
269
|
+
|
|
270
|
+
// 3. Get details on complex ones
|
|
271
|
+
for (const symbol of complexSymbols) {
|
|
272
|
+
lsp_find_refs({ file: symbol.file, line: symbol.line })
|
|
273
|
+
// → Find all usages
|
|
274
|
+
}
|
|
275
|
+
```
|
|
276
|
+
|
|
277
|
+
## Integration Decision Tree
|
|
278
|
+
|
|
279
|
+
```
|
|
280
|
+
┌─────────────────────────────────────────────────────────────┐
|
|
281
|
+
│ WHAT ARE YOU DOING? │
|
|
282
|
+
└─────────────────────────────────────────────────────────────┘
|
|
283
|
+
│
|
|
284
|
+
▼
|
|
285
|
+
┌─────────────────────────────────────────┐
|
|
286
|
+
│ Security Audit? │
|
|
287
|
+
│ → Use pi-audit │
|
|
288
|
+
│ → Combine with: │
|
|
289
|
+
│ - pi-browse (CVE research) │
|
|
290
|
+
│ - pi-debug (verify exploit) │
|
|
291
|
+
│ - pi-recollect (store findings) │
|
|
292
|
+
└─────────────────────────────────────────┘
|
|
293
|
+
│
|
|
294
|
+
┌─────────────────────────────────────────┐
|
|
295
|
+
│ Debugging Issue? │
|
|
296
|
+
│ → Use pi-debug │
|
|
297
|
+
│ → Combine with: │
|
|
298
|
+
│ - pi-langsrv (find call sites) │
|
|
299
|
+
│ - pi-recollect (past bugs) │
|
|
300
|
+
└─────────────────────────────────────────┘
|
|
301
|
+
│
|
|
302
|
+
┌─────────────────────────────────────────┐
|
|
303
|
+
│ Understanding Code? │
|
|
304
|
+
│ → Use pi-langsrv │
|
|
305
|
+
│ → Combine with: │
|
|
306
|
+
│ - pi-smart (complexity analysis) │
|
|
307
|
+
│ - pi-audit (security review) │
|
|
308
|
+
└─────────────────────────────────────────┘
|
|
309
|
+
│
|
|
310
|
+
┌─────────────────────────────────────────┐
|
|
311
|
+
│ CI/CD Issue? │
|
|
312
|
+
│ → Use pi-cicd │
|
|
313
|
+
│ → Combine with: │
|
|
314
|
+
│ - pi-debug (debug failing tests) │
|
|
315
|
+
│ - pi-pipeline (orchestrate) │
|
|
316
|
+
│ - pi-render (show progress) │
|
|
317
|
+
└─────────────────────────────────────────┘
|
|
318
|
+
│
|
|
319
|
+
┌─────────────────────────────────────────┐
|
|
320
|
+
│ Pipeline Run? │
|
|
321
|
+
│ → Use pi-pipeline │
|
|
322
|
+
│ → Combine with: │
|
|
323
|
+
│ - pi-render (visual feedback) │
|
|
324
|
+
│ - pi-audit (security gate) │
|
|
325
|
+
│ - pi-smart (optimize context) │
|
|
326
|
+
└─────────────────────────────────────────┘
|
|
327
|
+
```
|
|
328
|
+
|
|
329
|
+
## Golden Rules
|
|
330
|
+
|
|
331
|
+
### Rule 1: Combine Understanding + Action
|
|
332
|
+
```
|
|
333
|
+
pi-langsrv (where is this?) → pi-debug (run it)
|
|
334
|
+
pi-langsrv (what calls this?) → pi-audit (is it secure?)
|
|
335
|
+
```
|
|
336
|
+
|
|
337
|
+
### Rule 2: Combine Analysis + Memory
|
|
338
|
+
```
|
|
339
|
+
pi-browse (research) → pi-recollect (remember)
|
|
340
|
+
pi-debug (find bug) → pi-recollect (remember)
|
|
341
|
+
pi-audit (find vuln) → pi-recollect (remember)
|
|
342
|
+
```
|
|
343
|
+
|
|
344
|
+
### Rule 3: Combine Execution + Feedback
|
|
345
|
+
```
|
|
346
|
+
pi-pipeline (run) → pi-render (show progress)
|
|
347
|
+
pi-cicd (run) → pi-render (show results)
|
|
348
|
+
```
|
|
349
|
+
|
|
350
|
+
## Common Patterns
|
|
351
|
+
|
|
352
|
+
### Pattern: Research → Store → Apply
|
|
353
|
+
```typescript
|
|
354
|
+
// Research
|
|
355
|
+
web_search({ query: "best practices React hooks" })
|
|
356
|
+
|
|
357
|
+
// Store
|
|
358
|
+
memory_store({ category: "pattern", title: "React hooks", content: "..." })
|
|
359
|
+
|
|
360
|
+
// Apply next time
|
|
361
|
+
memory_search({ query: "React hooks" })
|
|
362
|
+
```
|
|
363
|
+
|
|
364
|
+
### Pattern: Find → Verify → Fix → Remember
|
|
365
|
+
```typescript
|
|
366
|
+
// Find issue
|
|
367
|
+
review_diff({ base: "HEAD~1", head: "HEAD" })
|
|
368
|
+
|
|
369
|
+
// Verify with runtime
|
|
370
|
+
debug_start({ program: "src/app.ts" })
|
|
371
|
+
|
|
372
|
+
// Fix code...
|
|
373
|
+
|
|
374
|
+
// Remember
|
|
375
|
+
memory_store({ category: "bug", title: "Fixed issue", content: "..." })
|
|
376
|
+
```
|
|
377
|
+
|
|
378
|
+
### Pattern: Understand → Analyze → Refactor
|
|
379
|
+
```typescript
|
|
380
|
+
// Understand structure
|
|
381
|
+
lsp_symbols({ file: "src/**/*.ts" })
|
|
382
|
+
|
|
383
|
+
// Analyze complexity
|
|
384
|
+
analyze({ files: "src/**/*.ts", intent: "refactor" })
|
|
385
|
+
|
|
386
|
+
// Refactor
|
|
387
|
+
// ... make changes ...
|
|
388
|
+
```
|
|
389
|
+
|
|
390
|
+
## Token Optimization Matrix
|
|
391
|
+
|
|
392
|
+
| Workflow | Without Integration | With Integration | Savings |
|
|
393
|
+
|----------|-------------------|------------------|---------|
|
|
394
|
+
| Security Audit | 3000 tokens | 1500 tokens | 50% |
|
|
395
|
+
| Debug Issue | 2000 tokens | 1000 tokens | 50% |
|
|
396
|
+
| CI/CD Debug | 4000 tokens | 2000 tokens | 50% |
|
|
397
|
+
| Research API | 5000 tokens | 2500 tokens | 50% |
|
|
398
|
+
|
|
399
|
+
## When to Combine Extensions
|
|
400
|
+
|
|
401
|
+
| Task | Required Extensions |
|
|
402
|
+
|------|-------------------|
|
|
403
|
+
| Security review | pi-audit + pi-browse + pi-recollect |
|
|
404
|
+
| Debug issue | pi-debug + pi-langsrv + pi-recollect |
|
|
405
|
+
| CI/CD failure | pi-cicd + pi-debug + pi-recollect |
|
|
406
|
+
| Security gate in pipeline | pi-pipeline + pi-audit + pi-render |
|
|
407
|
+
| Code analysis | pi-langsrv + pi-smart + pi-recollect |
|
|
408
|
+
| Web research | pi-browse + pi-recollect |
|
|
409
|
+
|
|
410
|
+
## Remember
|
|
411
|
+
|
|
412
|
+
1. **No extension works alone** - Always consider combinations
|
|
413
|
+
2. **Store findings** - Use pi-recollect to remember
|
|
414
|
+
3. **Use navigation** - pi-langsrv helps find what to debug/audit
|
|
415
|
+
4. **Visual feedback** - Use pi-render for progress
|
|
416
|
+
5. **Chain workflows** - One output feeds into the next
|
package/src/config.ts
CHANGED
|
@@ -51,6 +51,29 @@ const DEFAULT_CONFIG: PiCiConfig = {
|
|
|
51
51
|
},
|
|
52
52
|
};
|
|
53
53
|
|
|
54
|
+
/** Recursively merge `override` into `base`, handling nested objects.
|
|
55
|
+
* Does not mutate either argument.
|
|
56
|
+
*/
|
|
57
|
+
function deepMerge(base: Record<string, unknown>, override: Record<string, unknown>): Record<string, unknown> {
|
|
58
|
+
const result: Record<string, unknown> = { ...base };
|
|
59
|
+
for (const key of Object.keys(override)) {
|
|
60
|
+
const bv = base[key];
|
|
61
|
+
const ov = override[key];
|
|
62
|
+
if (
|
|
63
|
+
bv !== undefined && ov !== undefined &&
|
|
64
|
+
typeof bv === "object" && !Array.isArray(bv) &&
|
|
65
|
+
typeof ov === "object" && !Array.isArray(ov)
|
|
66
|
+
) {
|
|
67
|
+
result[key] = deepMerge(bv as Record<string, unknown>, ov as Record<string, unknown>);
|
|
68
|
+
} else {
|
|
69
|
+
result[key] = ov;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
return result;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export { deepMerge };
|
|
76
|
+
|
|
54
77
|
/**
|
|
55
78
|
* Load pi-ci configuration from `.pi/pi-ci.json` (if present) merged with defaults.
|
|
56
79
|
*/
|
|
@@ -62,38 +85,18 @@ export async function loadCiConfig(cwd?: string): Promise<PiCiConfig> {
|
|
|
62
85
|
try {
|
|
63
86
|
text = await readFile(configPath, "utf-8");
|
|
64
87
|
} catch {
|
|
65
|
-
return
|
|
88
|
+
return structuredClone(DEFAULT_CONFIG) as PiCiConfig;
|
|
66
89
|
}
|
|
67
90
|
|
|
68
91
|
const raw: unknown = JSON.parse(text);
|
|
69
92
|
if (typeof raw !== "object" || raw === null || Array.isArray(raw)) {
|
|
70
|
-
return
|
|
93
|
+
return structuredClone(DEFAULT_CONFIG) as PiCiConfig;
|
|
71
94
|
}
|
|
72
95
|
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
typeof user.idleTimeoutMs === "number" ? user.idleTimeoutMs : DEFAULT_CONFIG.idleTimeoutMs,
|
|
78
|
-
maxRetries:
|
|
79
|
-
typeof user.maxRetries === "number" ? user.maxRetries : DEFAULT_CONFIG.maxRetries,
|
|
80
|
-
retryBackoffMaxMs:
|
|
81
|
-
typeof user.retryBackoffMaxMs === "number"
|
|
82
|
-
? user.retryBackoffMaxMs
|
|
83
|
-
: DEFAULT_CONFIG.retryBackoffMaxMs,
|
|
84
|
-
exitCodes: {
|
|
85
|
-
...DEFAULT_CONFIG.exitCodes,
|
|
86
|
-
...(typeof user.exitCodes === "object" && user.exitCodes !== null
|
|
87
|
-
? (user.exitCodes as Partial<PiCiExitCodeConfig>)
|
|
88
|
-
: {}),
|
|
89
|
-
},
|
|
90
|
-
report: {
|
|
91
|
-
...DEFAULT_CONFIG.report,
|
|
92
|
-
...(typeof user.report === "object" && user.report !== null
|
|
93
|
-
? (user.report as Partial<PiCiReportConfig>)
|
|
94
|
-
: {}),
|
|
95
|
-
},
|
|
96
|
-
};
|
|
96
|
+
return deepMerge(
|
|
97
|
+
structuredClone(DEFAULT_CONFIG) as unknown as Record<string, unknown>,
|
|
98
|
+
raw as Record<string, unknown>,
|
|
99
|
+
) as PiCiConfig;
|
|
97
100
|
}
|
|
98
101
|
|
|
99
|
-
export { DEFAULT_CONFIG };
|
|
102
|
+
export { DEFAULT_CONFIG };
|