specweave 1.0.108 → 1.0.110
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/CLAUDE.md +25 -25
- package/bin/specweave.js +90 -0
- package/dist/src/cli/commands/auto-simple.d.ts +31 -0
- package/dist/src/cli/commands/auto-simple.d.ts.map +1 -0
- package/dist/src/cli/commands/auto-simple.js +218 -0
- package/dist/src/cli/commands/auto-simple.js.map +1 -0
- package/dist/src/cli/commands/auto-status.d.ts.map +1 -1
- package/dist/src/cli/commands/auto-status.js +28 -18
- package/dist/src/cli/commands/auto-status.js.map +1 -1
- package/dist/src/cli/commands/auto.d.ts.map +1 -1
- package/dist/src/cli/commands/auto.js +61 -32
- package/dist/src/cli/commands/auto.js.map +1 -1
- package/dist/src/cli/commands/cancel-auto.d.ts.map +1 -1
- package/dist/src/cli/commands/cancel-auto.js +28 -7
- package/dist/src/cli/commands/cancel-auto.js.map +1 -1
- package/dist/src/cli/commands/cancel-go.d.ts +8 -0
- package/dist/src/cli/commands/cancel-go.d.ts.map +1 -0
- package/dist/src/cli/commands/cancel-go.js +57 -0
- package/dist/src/cli/commands/cancel-go.js.map +1 -0
- package/dist/src/cli/commands/go-status.d.ts +9 -0
- package/dist/src/cli/commands/go-status.d.ts.map +1 -0
- package/dist/src/cli/commands/go-status.js +96 -0
- package/dist/src/cli/commands/go-status.js.map +1 -0
- package/dist/src/cli/commands/go.d.ts +20 -0
- package/dist/src/cli/commands/go.d.ts.map +1 -0
- package/dist/src/cli/commands/go.js +64 -0
- package/dist/src/cli/commands/go.js.map +1 -0
- package/dist/src/cli/commands/logs.d.ts +13 -0
- package/dist/src/cli/commands/logs.d.ts.map +1 -0
- package/dist/src/cli/commands/logs.js +155 -0
- package/dist/src/cli/commands/logs.js.map +1 -0
- package/dist/src/core/auto/index.d.ts +7 -11
- package/dist/src/core/auto/index.d.ts.map +1 -1
- package/dist/src/core/auto/index.js +9 -19
- package/dist/src/core/auto/index.js.map +1 -1
- package/dist/src/core/hooks/hook-health-tracker.d.ts +55 -0
- package/dist/src/core/hooks/hook-health-tracker.d.ts.map +1 -0
- package/dist/src/core/hooks/hook-health-tracker.js +164 -0
- package/dist/src/core/hooks/hook-health-tracker.js.map +1 -0
- package/dist/src/core/hooks/hook-logger.d.ts +87 -0
- package/dist/src/core/hooks/hook-logger.d.ts.map +1 -0
- package/dist/src/core/hooks/hook-logger.js +130 -0
- package/dist/src/core/hooks/hook-logger.js.map +1 -0
- package/dist/src/core/hooks/log-rotator.d.ts +55 -0
- package/dist/src/core/hooks/log-rotator.d.ts.map +1 -0
- package/dist/src/core/hooks/log-rotator.js +102 -0
- package/dist/src/core/hooks/log-rotator.js.map +1 -0
- package/dist/src/core/logging/prompt-logger.d.ts +3 -1
- package/dist/src/core/logging/prompt-logger.d.ts.map +1 -1
- package/dist/src/core/logging/prompt-logger.js +19 -10
- package/dist/src/core/logging/prompt-logger.js.map +1 -1
- package/dist/src/examples/hello-world.d.ts +5 -0
- package/dist/src/examples/hello-world.d.ts.map +1 -0
- package/dist/src/examples/hello-world.js +7 -0
- package/dist/src/examples/hello-world.js.map +1 -0
- package/dist/src/utils/bash-sanitizer.d.ts +74 -0
- package/dist/src/utils/bash-sanitizer.d.ts.map +1 -0
- package/dist/src/utils/bash-sanitizer.js +179 -0
- package/dist/src/utils/bash-sanitizer.js.map +1 -0
- package/dist/src/utils/credential-masker.d.ts +118 -0
- package/dist/src/utils/credential-masker.d.ts.map +1 -0
- package/dist/src/utils/credential-masker.js +275 -0
- package/dist/src/utils/credential-masker.js.map +1 -0
- package/dist/src/utils/logger.d.ts +4 -0
- package/dist/src/utils/logger.d.ts.map +1 -1
- package/dist/src/utils/logger.js +78 -12
- package/dist/src/utils/logger.js.map +1 -1
- package/package.json +4 -2
- package/plugins/specweave/commands/auto.md +15 -9
- package/plugins/specweave/commands/cancel-go.md +108 -0
- package/plugins/specweave/commands/go-status.md +119 -0
- package/plugins/specweave/commands/go.md +504 -0
- package/plugins/specweave/hooks/stop-auto-simple.sh +118 -0
- package/plugins/specweave/hooks/stop-dispatcher.sh +2 -2
- package/plugins/specweave/hooks/stop-go.sh +251 -0
- package/plugins/specweave/hooks/user-prompt-submit.sh +30 -20
- package/plugins/specweave/lib/vendor/utils/logger.d.ts +4 -0
- package/plugins/specweave/lib/vendor/utils/logger.js +78 -12
- package/plugins/specweave/lib/vendor/utils/logger.js.map +1 -1
- package/plugins/specweave/scripts/setup-auto.sh +16 -3
- package/plugins/specweave/scripts/setup-go.sh +290 -0
- package/dist/src/core/auto/circuit-breaker.d.ts +0 -146
- package/dist/src/core/auto/circuit-breaker.d.ts.map +0 -1
- package/dist/src/core/auto/circuit-breaker.js +0 -328
- package/dist/src/core/auto/circuit-breaker.js.map +0 -1
- package/dist/src/core/auto/cost-estimator.d.ts +0 -53
- package/dist/src/core/auto/cost-estimator.d.ts.map +0 -1
- package/dist/src/core/auto/cost-estimator.js +0 -150
- package/dist/src/core/auto/cost-estimator.js.map +0 -1
- package/dist/src/core/auto/human-gate.d.ts +0 -102
- package/dist/src/core/auto/human-gate.d.ts.map +0 -1
- package/dist/src/core/auto/human-gate.js +0 -295
- package/dist/src/core/auto/human-gate.js.map +0 -1
- package/dist/src/core/auto/increment-queue.d.ts +0 -100
- package/dist/src/core/auto/increment-queue.d.ts.map +0 -1
- package/dist/src/core/auto/increment-queue.js +0 -290
- package/dist/src/core/auto/increment-queue.js.map +0 -1
- package/dist/src/core/auto/report-generator.d.ts +0 -67
- package/dist/src/core/auto/report-generator.d.ts.map +0 -1
- package/dist/src/core/auto/report-generator.js +0 -287
- package/dist/src/core/auto/report-generator.js.map +0 -1
- package/dist/src/core/auto/session-state.d.ts +0 -98
- package/dist/src/core/auto/session-state.d.ts.map +0 -1
- package/dist/src/core/auto/session-state.js +0 -296
- package/dist/src/core/auto/session-state.js.map +0 -1
- package/dist/src/core/auto/sync-checkpoint.d.ts +0 -106
- package/dist/src/core/auto/sync-checkpoint.d.ts.map +0 -1
- package/dist/src/core/auto/sync-checkpoint.js +0 -258
- package/dist/src/core/auto/sync-checkpoint.js.map +0 -1
- package/dist/src/core/auto/test-gate.d.ts +0 -98
- package/dist/src/core/auto/test-gate.d.ts.map +0 -1
- package/dist/src/core/auto/test-gate.js +0 -258
- package/dist/src/core/auto/test-gate.js.map +0 -1
- /package/plugins/specweave/hooks/{stop-auto.sh → stop-auto-legacy.sh} +0 -0
package/CLAUDE.md
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
<!-- SW:META template="claude" version="1.0.
|
|
1
|
+
<!-- SW:META template="claude" version="1.0.109" sections="header,start,autodetect,metarule,rules,workflow,reflect,context,lsp,structure,taskformat,secrets,syncing,mapping,testing,api,limits,troubleshooting,principles,linking,mcp,autoexecute,auto,docs" -->
|
|
2
2
|
|
|
3
|
-
<!-- SW:SECTION:header version="1.0.
|
|
3
|
+
<!-- SW:SECTION:header version="1.0.109" -->
|
|
4
4
|
**Framework**: SpecWeave | **Truth**: `spec.md` + `tasks.md`
|
|
5
5
|
<!-- SW:END:header -->
|
|
6
6
|
|
|
7
|
-
<!-- SW:SECTION:start version="1.0.
|
|
7
|
+
<!-- SW:SECTION:start version="1.0.109" -->
|
|
8
8
|
## Getting Started
|
|
9
9
|
|
|
10
10
|
**Initial increment**: `0001-project-setup` (auto-created by `specweave init`)
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
2. **Customize**: Edit spec.md and use for setup tasks
|
|
15
15
|
<!-- SW:END:start -->
|
|
16
16
|
|
|
17
|
-
<!-- SW:SECTION:autodetect version="1.0.
|
|
17
|
+
<!-- SW:SECTION:autodetect version="1.0.109" -->
|
|
18
18
|
## Auto-Detection
|
|
19
19
|
|
|
20
20
|
SpecWeave auto-detects product descriptions and routes to `/sw:increment`:
|
|
@@ -24,7 +24,7 @@ SpecWeave auto-detects product descriptions and routes to `/sw:increment`:
|
|
|
24
24
|
**Opt-out phrases**: "Just brainstorm first" | "Don't plan yet" | "Quick discussion" | "Let's explore ideas"
|
|
25
25
|
<!-- SW:END:autodetect -->
|
|
26
26
|
|
|
27
|
-
<!-- SW:SECTION:metarule version="1.0.
|
|
27
|
+
<!-- SW:SECTION:metarule version="1.0.109" -->
|
|
28
28
|
## Meta-Rule: Think-Before-Act
|
|
29
29
|
|
|
30
30
|
**Satisfy dependencies BEFORE dependent operations.**
|
|
@@ -35,7 +35,7 @@ SpecWeave auto-detects product descriptions and routes to `/sw:increment`:
|
|
|
35
35
|
```
|
|
36
36
|
<!-- SW:END:metarule -->
|
|
37
37
|
|
|
38
|
-
<!-- SW:SECTION:rules version="1.0.
|
|
38
|
+
<!-- SW:SECTION:rules version="1.0.109" -->
|
|
39
39
|
## Rules
|
|
40
40
|
|
|
41
41
|
1. **Files** → `.specweave/increments/####-name/` (spec.md, plan.md, tasks.md at root; reports/, scripts/, logs/ subfolders)
|
|
@@ -48,7 +48,7 @@ SpecWeave auto-detects product descriptions and routes to `/sw:increment`:
|
|
|
48
48
|
8. **⛔ Marketplace refresh**: ALWAYS use `specweave refresh-marketplace` CLI command. NEVER suggest `scripts/refresh-marketplace.sh` - end users don't have the scripts folder (npm global install).
|
|
49
49
|
<!-- SW:END:rules -->
|
|
50
50
|
|
|
51
|
-
<!-- SW:SECTION:workflow version="1.0.
|
|
51
|
+
<!-- SW:SECTION:workflow version="1.0.109" -->
|
|
52
52
|
## Workflow
|
|
53
53
|
|
|
54
54
|
`/sw:increment "X"` → `/sw:do` → `/sw:progress` → `/sw:done 0001`
|
|
@@ -68,7 +68,7 @@ SpecWeave auto-detects product descriptions and routes to `/sw:increment`:
|
|
|
68
68
|
**Natural language**: "Let's build X" → `/sw:increment` | "What's status?" → `/sw:progress` | "We're done" → `/sw:done` | "Ship while sleeping" → `/sw:auto`
|
|
69
69
|
<!-- SW:END:workflow -->
|
|
70
70
|
|
|
71
|
-
<!-- SW:SECTION:reflect version="1.0.
|
|
71
|
+
<!-- SW:SECTION:reflect version="1.0.109" -->
|
|
72
72
|
## Self-Improving Skills (Reflect)
|
|
73
73
|
|
|
74
74
|
**Learn once, never repeat.** Claude learns from corrections and patterns across sessions.
|
|
@@ -112,7 +112,7 @@ ls ~/.specweave/memory/*.md 2>/dev/null
|
|
|
112
112
|
**Enable auto-learning**: `/sw:reflect-on` → Stop hook analyzes sessions automatically
|
|
113
113
|
<!-- SW:END:reflect -->
|
|
114
114
|
|
|
115
|
-
<!-- SW:SECTION:context version="1.0.
|
|
115
|
+
<!-- SW:SECTION:context version="1.0.109" -->
|
|
116
116
|
## Living Docs Context
|
|
117
117
|
|
|
118
118
|
**Before implementing features**: Check existing docs for patterns and decisions.
|
|
@@ -132,7 +132,7 @@ grep -ril "keyword" .specweave/docs/internal/
|
|
|
132
132
|
**Use `/sw:context <topic>`** to load relevant living docs into conversation.
|
|
133
133
|
<!-- SW:END:context -->
|
|
134
134
|
|
|
135
|
-
<!-- SW:SECTION:lsp version="1.0.
|
|
135
|
+
<!-- SW:SECTION:lsp version="1.0.109" -->
|
|
136
136
|
## LSP-Enhanced Exploration
|
|
137
137
|
|
|
138
138
|
**USE LSP ACTIVELY** for semantic code understanding (100x faster than grep).
|
|
@@ -149,7 +149,7 @@ go install golang.org/x/tools/gopls@latest # Go
|
|
|
149
149
|
**Best Practices**: ALWAYS use `findReferences` before refactoring | Use `goToDefinition` instead of grep | Combine with Explore agent
|
|
150
150
|
<!-- SW:END:lsp -->
|
|
151
151
|
|
|
152
|
-
<!-- SW:SECTION:structure version="1.0.
|
|
152
|
+
<!-- SW:SECTION:structure version="1.0.109" -->
|
|
153
153
|
## Structure
|
|
154
154
|
|
|
155
155
|
```
|
|
@@ -219,7 +219,7 @@ my-project/
|
|
|
219
219
|
```
|
|
220
220
|
<!-- SW:END:structure -->
|
|
221
221
|
|
|
222
|
-
<!-- SW:SECTION:taskformat version="1.0.
|
|
222
|
+
<!-- SW:SECTION:taskformat version="1.0.109" -->
|
|
223
223
|
## Task Format
|
|
224
224
|
|
|
225
225
|
```markdown
|
|
@@ -229,7 +229,7 @@ my-project/
|
|
|
229
229
|
```
|
|
230
230
|
<!-- SW:END:taskformat -->
|
|
231
231
|
|
|
232
|
-
<!-- SW:SECTION:secrets version="1.0.
|
|
232
|
+
<!-- SW:SECTION:secrets version="1.0.109" -->
|
|
233
233
|
## Secrets Check
|
|
234
234
|
|
|
235
235
|
**BEFORE CLI tools**: Check existing config first!
|
|
@@ -240,7 +240,7 @@ gh auth status
|
|
|
240
240
|
```
|
|
241
241
|
<!-- SW:END:secrets -->
|
|
242
242
|
|
|
243
|
-
<!-- SW:SECTION:syncing version="1.0.
|
|
243
|
+
<!-- SW:SECTION:syncing version="1.0.109" -->
|
|
244
244
|
## External Sync (GitHub/JIRA/ADO)
|
|
245
245
|
|
|
246
246
|
**After increment creation**: Run `/sw-github:sync {id}` to create issues!
|
|
@@ -268,7 +268,7 @@ Living docs sync ≠ External sync. They are separate:
|
|
|
268
268
|
**Verify tokens**: `grep GITHUB_TOKEN .env` | `gh auth status`
|
|
269
269
|
<!-- SW:END:syncing -->
|
|
270
270
|
|
|
271
|
-
<!-- SW:SECTION:mapping version="1.0.
|
|
271
|
+
<!-- SW:SECTION:mapping version="1.0.109" -->
|
|
272
272
|
## GitHub Mapping
|
|
273
273
|
|
|
274
274
|
| SpecWeave | GitHub |
|
|
@@ -278,7 +278,7 @@ Living docs sync ≠ External sync. They are separate:
|
|
|
278
278
|
| Task T-XXX | Checkbox |
|
|
279
279
|
<!-- SW:END:mapping -->
|
|
280
280
|
|
|
281
|
-
<!-- SW:SECTION:testing version="1.0.
|
|
281
|
+
<!-- SW:SECTION:testing version="1.0.109" -->
|
|
282
282
|
## Testing
|
|
283
283
|
|
|
284
284
|
BDD in tasks.md | Unit >80% | `.test.ts` (Vitest)
|
|
@@ -290,7 +290,7 @@ vi.mock('fs', () => ({ readFile: vi.fn() }));
|
|
|
290
290
|
```
|
|
291
291
|
<!-- SW:END:testing -->
|
|
292
292
|
|
|
293
|
-
<!-- SW:SECTION:api version="1.0.
|
|
293
|
+
<!-- SW:SECTION:api version="1.0.109" -->
|
|
294
294
|
## API Development (OpenAPI-First)
|
|
295
295
|
|
|
296
296
|
**For API projects only.** OpenAPI = source of truth → Postman derived from it.
|
|
@@ -309,13 +309,13 @@ vi.mock('fs', () => ({ readFile: vi.fn() }));
|
|
|
309
309
|
**Import**: Postman → Import collection + env → Fill secrets → Select env
|
|
310
310
|
<!-- SW:END:api -->
|
|
311
311
|
|
|
312
|
-
<!-- SW:SECTION:limits version="1.0.
|
|
312
|
+
<!-- SW:SECTION:limits version="1.0.109" -->
|
|
313
313
|
## Limits
|
|
314
314
|
|
|
315
315
|
**Max 1500 lines/file** — extract before adding
|
|
316
316
|
<!-- SW:END:limits -->
|
|
317
317
|
|
|
318
|
-
<!-- SW:SECTION:troubleshooting version="1.0.
|
|
318
|
+
<!-- SW:SECTION:troubleshooting version="1.0.109" -->
|
|
319
319
|
## Troubleshooting
|
|
320
320
|
|
|
321
321
|
| Issue | Fix |
|
|
@@ -335,7 +335,7 @@ vi.mock('fs', () => ({ readFile: vi.fn() }));
|
|
|
335
335
|
| Path patterns not working | `//path` = absolute, `/path` = relative to settings file, `additionalDirectories` for explicit working dirs |
|
|
336
336
|
<!-- SW:END:troubleshooting -->
|
|
337
337
|
|
|
338
|
-
<!-- SW:SECTION:principles version="1.0.
|
|
338
|
+
<!-- SW:SECTION:principles version="1.0.109" -->
|
|
339
339
|
## Principles
|
|
340
340
|
|
|
341
341
|
1. **Spec-first**: `/sw:increment` before coding
|
|
@@ -345,7 +345,7 @@ vi.mock('fs', () => ({ readFile: vi.fn() }));
|
|
|
345
345
|
5. **Clean**: All files in increment folders
|
|
346
346
|
<!-- SW:END:principles -->
|
|
347
347
|
|
|
348
|
-
<!-- SW:SECTION:linking version="1.0.
|
|
348
|
+
<!-- SW:SECTION:linking version="1.0.109" -->
|
|
349
349
|
## Bidirectional Linking
|
|
350
350
|
|
|
351
351
|
Tasks ↔ User Stories auto-linked via AC-IDs: `AC-US1-01` → `US-001`
|
|
@@ -353,7 +353,7 @@ Tasks ↔ User Stories auto-linked via AC-IDs: `AC-US1-01` → `US-001`
|
|
|
353
353
|
Task format: `**AC**: AC-US1-01, AC-US1-02` (CRITICAL for linking)
|
|
354
354
|
<!-- SW:END:linking -->
|
|
355
355
|
|
|
356
|
-
<!-- SW:SECTION:mcp version="1.0.
|
|
356
|
+
<!-- SW:SECTION:mcp version="1.0.109" -->
|
|
357
357
|
## External Service Connection
|
|
358
358
|
|
|
359
359
|
**Priority**: MCP Server → REST API → CLI → Direct Connection
|
|
@@ -377,7 +377,7 @@ wrangler whoami 2>/dev/null
|
|
|
377
377
|
```
|
|
378
378
|
<!-- SW:END:mcp -->
|
|
379
379
|
|
|
380
|
-
<!-- SW:SECTION:autoexecute version="1.0.
|
|
380
|
+
<!-- SW:SECTION:autoexecute version="1.0.109" -->
|
|
381
381
|
## Auto-Execute Rule
|
|
382
382
|
|
|
383
383
|
**NEVER** output "Manual Step Required" when credentials exist. **EXECUTE DIRECTLY.**
|
|
@@ -391,7 +391,7 @@ wrangler whoami 2>/dev/null && gh auth status 2>/dev/null
|
|
|
391
391
|
```
|
|
392
392
|
<!-- SW:END:autoexecute -->
|
|
393
393
|
|
|
394
|
-
<!-- SW:SECTION:auto version="1.0.
|
|
394
|
+
<!-- SW:SECTION:auto version="1.0.109" -->
|
|
395
395
|
## Auto Mode (Autonomous Execution)
|
|
396
396
|
|
|
397
397
|
**Continuous execution until all tasks complete.**
|
|
@@ -468,7 +468,7 @@ wrangler whoami 2>/dev/null && gh auth status 2>/dev/null
|
|
|
468
468
|
**Circuit Breaker**: External API fails 3x? Queue & continue
|
|
469
469
|
<!-- SW:END:auto -->
|
|
470
470
|
|
|
471
|
-
<!-- SW:SECTION:docs version="1.0.
|
|
471
|
+
<!-- SW:SECTION:docs version="1.0.109" -->
|
|
472
472
|
## Docs
|
|
473
473
|
|
|
474
474
|
[spec-weave.com](https://spec-weave.com) | `.specweave/docs/internal/`
|
package/bin/specweave.js
CHANGED
|
@@ -344,6 +344,24 @@ program
|
|
|
344
344
|
await statusCommand(options);
|
|
345
345
|
});
|
|
346
346
|
|
|
347
|
+
// Logs command - View hook execution logs
|
|
348
|
+
program
|
|
349
|
+
.command('logs')
|
|
350
|
+
.description('View hook execution logs')
|
|
351
|
+
.option('--tail <number>', 'Number of log entries to show (default: 50)', '50')
|
|
352
|
+
.option('--hook <name>', 'Filter by hook name')
|
|
353
|
+
.option('--format <type>', 'Output format: json or table (default: table)', 'table')
|
|
354
|
+
.option('--follow', 'Follow new log entries (not yet implemented)')
|
|
355
|
+
.action(async (options) => {
|
|
356
|
+
const { logsCommand } = await import('../dist/src/cli/commands/logs.js');
|
|
357
|
+
await logsCommand({
|
|
358
|
+
tail: parseInt(options.tail, 10),
|
|
359
|
+
hook: options.hook,
|
|
360
|
+
format: options.format,
|
|
361
|
+
follow: options.follow
|
|
362
|
+
});
|
|
363
|
+
});
|
|
364
|
+
|
|
347
365
|
// Status line command - Display current increment progress
|
|
348
366
|
program
|
|
349
367
|
.command('status-line')
|
|
@@ -485,6 +503,78 @@ program
|
|
|
485
503
|
await cancelCmd.parseAsync(args, { from: 'user' });
|
|
486
504
|
});
|
|
487
505
|
|
|
506
|
+
// Go mode commands - Pure Ralph Wiggum pattern (simpler than auto mode)
|
|
507
|
+
program
|
|
508
|
+
.command('go <prompt>')
|
|
509
|
+
.description('Start go session (Ralph Wiggum pattern) - simple autonomous iteration')
|
|
510
|
+
.option('--max-iterations <n>', 'Maximum iterations (safety net)', '100')
|
|
511
|
+
.option('--completion-promise <text>', 'Exact phrase that signals completion')
|
|
512
|
+
.option('--build', 'Build must pass before completion')
|
|
513
|
+
.option('--tests', 'Tests must pass before completion')
|
|
514
|
+
.option('--e2e', 'E2E tests must pass before completion')
|
|
515
|
+
.option('--lint', 'Linting must pass before completion')
|
|
516
|
+
.option('--types', 'Type-checking must pass before completion')
|
|
517
|
+
.option('--dry-run', 'Preview without starting')
|
|
518
|
+
.action(async (prompt, options) => {
|
|
519
|
+
const path = await import('path');
|
|
520
|
+
const fs = await import('fs');
|
|
521
|
+
const projectPath = process.cwd();
|
|
522
|
+
|
|
523
|
+
// Check if SpecWeave is initialized
|
|
524
|
+
const specweavePath = path.join(projectPath, '.specweave');
|
|
525
|
+
if (!fs.existsSync(specweavePath)) {
|
|
526
|
+
console.log(chalk.yellow('No SpecWeave project found in current directory.'));
|
|
527
|
+
console.log(chalk.gray('Run `specweave init` to initialize a project.'));
|
|
528
|
+
return;
|
|
529
|
+
}
|
|
530
|
+
|
|
531
|
+
try {
|
|
532
|
+
const { handleGoCommand } = await import('../dist/src/cli/commands/go.js');
|
|
533
|
+
await handleGoCommand(projectPath, prompt, options);
|
|
534
|
+
} catch (error) {
|
|
535
|
+
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
536
|
+
console.error(chalk.red(`Error: ${errorMessage}`));
|
|
537
|
+
process.exit(1);
|
|
538
|
+
}
|
|
539
|
+
});
|
|
540
|
+
|
|
541
|
+
program
|
|
542
|
+
.command('go-status')
|
|
543
|
+
.description('Check go session status')
|
|
544
|
+
.option('--verbose', 'Show detailed information')
|
|
545
|
+
.option('--json', 'Output as JSON')
|
|
546
|
+
.action(async (options) => {
|
|
547
|
+
const path = await import('path');
|
|
548
|
+
const projectPath = process.cwd();
|
|
549
|
+
|
|
550
|
+
try {
|
|
551
|
+
const { handleGoStatusCommand } = await import('../dist/src/cli/commands/go-status.js');
|
|
552
|
+
await handleGoStatusCommand(projectPath, options);
|
|
553
|
+
} catch (error) {
|
|
554
|
+
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
555
|
+
console.error(chalk.red(`Error: ${errorMessage}`));
|
|
556
|
+
process.exit(1);
|
|
557
|
+
}
|
|
558
|
+
});
|
|
559
|
+
|
|
560
|
+
program
|
|
561
|
+
.command('cancel-go')
|
|
562
|
+
.description('Cancel running go session')
|
|
563
|
+
.option('--force', 'Force cancel without confirmation')
|
|
564
|
+
.action(async (options) => {
|
|
565
|
+
const path = await import('path');
|
|
566
|
+
const projectPath = process.cwd();
|
|
567
|
+
|
|
568
|
+
try {
|
|
569
|
+
const { handleCancelGoCommand } = await import('../dist/src/cli/commands/cancel-go.js');
|
|
570
|
+
await handleCancelGoCommand(projectPath, options);
|
|
571
|
+
} catch (error) {
|
|
572
|
+
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
573
|
+
console.error(chalk.red(`Error: ${errorMessage}`));
|
|
574
|
+
process.exit(1);
|
|
575
|
+
}
|
|
576
|
+
});
|
|
577
|
+
|
|
488
578
|
// Update instructions command - Smart merge CLAUDE.md/AGENTS.md
|
|
489
579
|
program
|
|
490
580
|
.command('update-instructions')
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Auto Mode CLI Command (Simplified)
|
|
3
|
+
*
|
|
4
|
+
* Philosophy: Trust the framework!
|
|
5
|
+
* - No session state (increments ARE the state)
|
|
6
|
+
* - No manual sync (hooks handle it)
|
|
7
|
+
* - No quality gates here (belongs in /sw:done)
|
|
8
|
+
* - Just: find active increments, start working, stop hook blocks until done
|
|
9
|
+
*
|
|
10
|
+
* Usage:
|
|
11
|
+
* specweave auto [INCREMENT_IDS...] [OPTIONS]
|
|
12
|
+
* specweave auto # Work on active increments
|
|
13
|
+
* specweave auto 0001 0002 # Work on specific increments
|
|
14
|
+
* specweave auto --all-backlog # Work on all backlog increments
|
|
15
|
+
*/
|
|
16
|
+
import { Command } from 'commander';
|
|
17
|
+
export interface AutoCommandOptions {
|
|
18
|
+
allBacklog?: boolean;
|
|
19
|
+
noIncrement?: boolean;
|
|
20
|
+
noInc?: boolean;
|
|
21
|
+
prompt?: string;
|
|
22
|
+
yes?: boolean;
|
|
23
|
+
y?: boolean;
|
|
24
|
+
dryRun?: boolean;
|
|
25
|
+
}
|
|
26
|
+
export declare function createAutoCommand(): Command;
|
|
27
|
+
/**
|
|
28
|
+
* Main auto command handler (simplified)
|
|
29
|
+
*/
|
|
30
|
+
export declare function handleAutoCommand(projectPath: string, incrementIds: string[], options: AutoCommandOptions): Promise<void>;
|
|
31
|
+
//# sourceMappingURL=auto-simple.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auto-simple.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/auto-simple.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAKH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIpC,MAAM,WAAW,kBAAkB;IACjC,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,CAAC,CAAC,EAAE,OAAO,CAAC;IACZ,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED,wBAAgB,iBAAiB,IAAI,OAAO,CA8B3C;AAED;;GAEG;AACH,wBAAsB,iBAAiB,CACrC,WAAW,EAAE,MAAM,EACnB,YAAY,EAAE,MAAM,EAAE,EACtB,OAAO,EAAE,kBAAkB,GAC1B,OAAO,CAAC,IAAI,CAAC,CAuEf"}
|
|
@@ -0,0 +1,218 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Auto Mode CLI Command (Simplified)
|
|
3
|
+
*
|
|
4
|
+
* Philosophy: Trust the framework!
|
|
5
|
+
* - No session state (increments ARE the state)
|
|
6
|
+
* - No manual sync (hooks handle it)
|
|
7
|
+
* - No quality gates here (belongs in /sw:done)
|
|
8
|
+
* - Just: find active increments, start working, stop hook blocks until done
|
|
9
|
+
*
|
|
10
|
+
* Usage:
|
|
11
|
+
* specweave auto [INCREMENT_IDS...] [OPTIONS]
|
|
12
|
+
* specweave auto # Work on active increments
|
|
13
|
+
* specweave auto 0001 0002 # Work on specific increments
|
|
14
|
+
* specweave auto --all-backlog # Work on all backlog increments
|
|
15
|
+
*/
|
|
16
|
+
import * as path from 'path';
|
|
17
|
+
import * as fs from 'fs';
|
|
18
|
+
import chalk from 'chalk';
|
|
19
|
+
import { Command } from 'commander';
|
|
20
|
+
import { isSpecWeaveInitialized } from '../../utils/fs-native.js';
|
|
21
|
+
export function createAutoCommand() {
|
|
22
|
+
const cmd = new Command('auto')
|
|
23
|
+
.description('Start autonomous execution (simplified - trusts framework hooks)')
|
|
24
|
+
.argument('[incrementIds...]', 'Increment IDs to process')
|
|
25
|
+
.option('--all-backlog', 'Process all backlog/planned increments')
|
|
26
|
+
.option('--no-increment', 'Require existing increments (skip auto-creation)')
|
|
27
|
+
.option('--no-inc', 'Alias for --no-increment')
|
|
28
|
+
.option('--prompt <text>', 'Analyze prompt and create increments')
|
|
29
|
+
.option('--yes', 'Auto-approve increment plan')
|
|
30
|
+
.option('-y', 'Alias for --yes')
|
|
31
|
+
.option('--dry-run', 'Preview without starting')
|
|
32
|
+
.action(async (incrementIds, options) => {
|
|
33
|
+
const projectPath = process.cwd();
|
|
34
|
+
if (!isSpecWeaveInitialized(projectPath)) {
|
|
35
|
+
console.log(chalk.yellow('No SpecWeave project found in current directory.'));
|
|
36
|
+
console.log(chalk.gray('Run `specweave init` to initialize a project.'));
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
try {
|
|
40
|
+
await handleAutoCommand(projectPath, incrementIds, options);
|
|
41
|
+
}
|
|
42
|
+
catch (error) {
|
|
43
|
+
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
44
|
+
console.error(chalk.red(`Error: ${errorMessage}`));
|
|
45
|
+
process.exit(1);
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
return cmd;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Main auto command handler (simplified)
|
|
52
|
+
*/
|
|
53
|
+
export async function handleAutoCommand(projectPath, incrementIds, options) {
|
|
54
|
+
const incrementsDir = path.join(projectPath, '.specweave/increments');
|
|
55
|
+
const stateDir = path.join(projectPath, '.specweave/state');
|
|
56
|
+
// Parse options
|
|
57
|
+
const allBacklog = options.allBacklog || false;
|
|
58
|
+
const noIncrement = options.noIncrement || options.noInc || false;
|
|
59
|
+
const prompt = options.prompt;
|
|
60
|
+
const autoApprove = options.yes || options.y || false;
|
|
61
|
+
const dryRun = options.dryRun || false;
|
|
62
|
+
// Handle --prompt (intelligent chunking)
|
|
63
|
+
if (prompt) {
|
|
64
|
+
await handlePromptChunking(projectPath, prompt, autoApprove, stateDir);
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
// Build increment list
|
|
68
|
+
let finalIncrementIds = [...incrementIds];
|
|
69
|
+
if (allBacklog) {
|
|
70
|
+
finalIncrementIds = findIncrementsByStatus(incrementsDir, ['backlog', 'planned']);
|
|
71
|
+
if (finalIncrementIds.length === 0) {
|
|
72
|
+
console.log(chalk.yellow('⚠️ No backlog or planned increments found'));
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
// If no increments specified, find active ones
|
|
77
|
+
if (finalIncrementIds.length === 0) {
|
|
78
|
+
finalIncrementIds = findIncrementsByStatus(incrementsDir, ['active', 'in-progress']);
|
|
79
|
+
}
|
|
80
|
+
// Still no increments?
|
|
81
|
+
if (finalIncrementIds.length === 0) {
|
|
82
|
+
if (noIncrement) {
|
|
83
|
+
console.log(chalk.red('❌ No increments specified and no active increments found'));
|
|
84
|
+
console.log('');
|
|
85
|
+
console.log('Usage: specweave auto [INCREMENT_IDS...]');
|
|
86
|
+
console.log(' specweave auto --all-backlog');
|
|
87
|
+
process.exit(1);
|
|
88
|
+
}
|
|
89
|
+
else {
|
|
90
|
+
// Signal to Claude: create increments as needed
|
|
91
|
+
console.log(chalk.blue('🤔 No increments found. Auto mode will analyze context and create increments.'));
|
|
92
|
+
console.log('');
|
|
93
|
+
console.log('💡 The LLM will:');
|
|
94
|
+
console.log(' 1. Analyze user prompt and project context');
|
|
95
|
+
console.log(' 2. Match existing increments OR create new ones');
|
|
96
|
+
console.log(' 3. Start autonomous execution');
|
|
97
|
+
console.log('');
|
|
98
|
+
// Create marker for LLM
|
|
99
|
+
const markerPath = path.join(stateDir, 'auto-needs-increment.json');
|
|
100
|
+
fs.writeFileSync(markerPath, JSON.stringify({ needsIncrementCreation: true, timestamp: new Date().toISOString() }, null, 2), 'utf-8');
|
|
101
|
+
process.exit(2); // Special exit code: increment creation needed
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
// Dry run preview
|
|
105
|
+
if (dryRun) {
|
|
106
|
+
printDryRunPreview(finalIncrementIds);
|
|
107
|
+
return;
|
|
108
|
+
}
|
|
109
|
+
// Start autonomous execution
|
|
110
|
+
printStartMessage(finalIncrementIds);
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* Handle --prompt option (intelligent chunking)
|
|
114
|
+
*/
|
|
115
|
+
async function handlePromptChunking(projectPath, prompt, autoApprove, stateDir) {
|
|
116
|
+
console.log(chalk.blue('🧠 Analyzing prompt for intelligent chunking...'));
|
|
117
|
+
console.log('');
|
|
118
|
+
const marker = {
|
|
119
|
+
needsIncrementCreation: true,
|
|
120
|
+
fromChunking: true,
|
|
121
|
+
autoApproved: autoApprove,
|
|
122
|
+
prompt,
|
|
123
|
+
timestamp: new Date().toISOString(),
|
|
124
|
+
};
|
|
125
|
+
const markerPath = path.join(stateDir, 'auto-needs-increment.json');
|
|
126
|
+
fs.writeFileSync(markerPath, JSON.stringify(marker, null, 2), 'utf-8');
|
|
127
|
+
console.log(chalk.yellow('📋 Prompt analysis required - LLM will handle chunking'));
|
|
128
|
+
console.log('');
|
|
129
|
+
if (autoApprove) {
|
|
130
|
+
console.log(chalk.green('✅ Plan will be auto-approved'));
|
|
131
|
+
}
|
|
132
|
+
else {
|
|
133
|
+
console.log('💡 Review the plan and approve before execution');
|
|
134
|
+
}
|
|
135
|
+
process.exit(2);
|
|
136
|
+
}
|
|
137
|
+
/**
|
|
138
|
+
* Find increments by status (filesystem-based, no session state!)
|
|
139
|
+
*/
|
|
140
|
+
function findIncrementsByStatus(incrementsDir, statuses) {
|
|
141
|
+
if (!fs.existsSync(incrementsDir)) {
|
|
142
|
+
return [];
|
|
143
|
+
}
|
|
144
|
+
const increments = [];
|
|
145
|
+
const entries = fs.readdirSync(incrementsDir);
|
|
146
|
+
for (const entry of entries) {
|
|
147
|
+
// Skip non-increment directories
|
|
148
|
+
if (!/^[0-9]{4}-/.test(entry))
|
|
149
|
+
continue;
|
|
150
|
+
const metaPath = path.join(incrementsDir, entry, 'metadata.json');
|
|
151
|
+
if (!fs.existsSync(metaPath))
|
|
152
|
+
continue;
|
|
153
|
+
try {
|
|
154
|
+
const metadata = JSON.parse(fs.readFileSync(metaPath, 'utf-8'));
|
|
155
|
+
if (statuses.includes(metadata.status)) {
|
|
156
|
+
increments.push(entry);
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
catch (error) {
|
|
160
|
+
// Skip invalid metadata
|
|
161
|
+
continue;
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
return increments;
|
|
165
|
+
}
|
|
166
|
+
/**
|
|
167
|
+
* Print dry run preview
|
|
168
|
+
*/
|
|
169
|
+
function printDryRunPreview(incrementIds) {
|
|
170
|
+
console.log(chalk.blue('🔍 Dry Run - Preview'));
|
|
171
|
+
console.log('');
|
|
172
|
+
console.log('Active Increments:');
|
|
173
|
+
for (const incId of incrementIds) {
|
|
174
|
+
console.log(' • ' + chalk.cyan(incId));
|
|
175
|
+
}
|
|
176
|
+
console.log('');
|
|
177
|
+
console.log(chalk.gray('Run without --dry-run to start autonomous execution.'));
|
|
178
|
+
}
|
|
179
|
+
/**
|
|
180
|
+
* Print start message
|
|
181
|
+
*/
|
|
182
|
+
function printStartMessage(incrementIds) {
|
|
183
|
+
console.log(chalk.green('🚀 Auto Mode Started'));
|
|
184
|
+
console.log('');
|
|
185
|
+
console.log(`Active Increments (${incrementIds.length}):`);
|
|
186
|
+
for (const incId of incrementIds) {
|
|
187
|
+
console.log(' • ' + chalk.cyan(incId));
|
|
188
|
+
}
|
|
189
|
+
console.log('');
|
|
190
|
+
console.log('━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━');
|
|
191
|
+
console.log(chalk.yellow('📋 HOW AUTO MODE WORKS:'));
|
|
192
|
+
console.log('');
|
|
193
|
+
console.log('1. Stop hook checks for active increments');
|
|
194
|
+
console.log('2. If active increments exist → blocks exit, continues working');
|
|
195
|
+
console.log('3. Execute /sw:do to work on tasks');
|
|
196
|
+
console.log('4. When tasks complete → run /sw:done for validation');
|
|
197
|
+
console.log('5. If /sw:done passes → increment completes, move to next');
|
|
198
|
+
console.log('6. If /sw:done fails → keep fixing, try again');
|
|
199
|
+
console.log('7. When all increments complete → stop hook approves exit');
|
|
200
|
+
console.log('');
|
|
201
|
+
console.log(chalk.yellow('🎯 FRAMEWORK HANDLES:'));
|
|
202
|
+
console.log(' • Task updates → Auto-sync to GitHub/JIRA/ADO (via hooks)');
|
|
203
|
+
console.log(' • Spec updates → Auto-update ACs (via hooks)');
|
|
204
|
+
console.log(' • Status transitions → Auto-transition when tasks complete (via hooks)');
|
|
205
|
+
console.log(' • Quality validation → Tests, build, coverage (/sw:done)');
|
|
206
|
+
console.log(' • Living docs → Auto-sync on completion (via hooks)');
|
|
207
|
+
console.log('');
|
|
208
|
+
console.log(chalk.yellow('⚡ STOP CRITERIA:'));
|
|
209
|
+
console.log(' • All active increments completed (validated by /sw:done)');
|
|
210
|
+
console.log(' • Tests pass (enforced by /sw:done)');
|
|
211
|
+
console.log(' • Build succeeds (enforced by /sw:done)');
|
|
212
|
+
console.log(' • User runs specweave cancel-auto');
|
|
213
|
+
console.log('━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━');
|
|
214
|
+
console.log('');
|
|
215
|
+
console.log(chalk.gray('💡 Tip: The stop hook will keep you working until done. Trust the framework!'));
|
|
216
|
+
console.log('');
|
|
217
|
+
}
|
|
218
|
+
//# sourceMappingURL=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IAAI,CAAC,8EAA8E,CAAC,CAAC,CAAC;IACxG,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;AAClB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auto-status.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/auto-status.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAKH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"auto-status.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/auto-status.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAKH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,MAAM,WAAW,iBAAiB;IAChC,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB;AAED,wBAAgB,uBAAuB,IAAI,OAAO,CA0BjD"}
|
|
@@ -12,7 +12,6 @@ import * as path from 'path';
|
|
|
12
12
|
import * as fs from 'fs';
|
|
13
13
|
import chalk from 'chalk';
|
|
14
14
|
import { Command } from 'commander';
|
|
15
|
-
import { SessionStateManager } from '../../core/auto/session-state.js';
|
|
16
15
|
export function createAutoStatusCommand() {
|
|
17
16
|
const cmd = new Command('auto-status')
|
|
18
17
|
.description('Check auto session status and progress')
|
|
@@ -42,14 +41,22 @@ export function createAutoStatusCommand() {
|
|
|
42
41
|
* Handle auto-status command
|
|
43
42
|
*/
|
|
44
43
|
async function handleAutoStatus(projectPath, options) {
|
|
45
|
-
const
|
|
46
|
-
|
|
47
|
-
if (!
|
|
44
|
+
const sessionPath = path.join(projectPath, '.specweave/state/auto-session.json');
|
|
45
|
+
// Load session
|
|
46
|
+
if (!fs.existsSync(sessionPath)) {
|
|
48
47
|
console.log(chalk.yellow('No auto session found'));
|
|
49
48
|
console.log('');
|
|
50
49
|
console.log('Start a new session with: ' + chalk.cyan('specweave auto [INCREMENT_IDS...]'));
|
|
51
50
|
return;
|
|
52
51
|
}
|
|
52
|
+
let session;
|
|
53
|
+
try {
|
|
54
|
+
session = JSON.parse(fs.readFileSync(sessionPath, 'utf-8'));
|
|
55
|
+
}
|
|
56
|
+
catch (error) {
|
|
57
|
+
console.log(chalk.yellow('Invalid auto session file'));
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
53
60
|
// JSON output
|
|
54
61
|
if (options.json) {
|
|
55
62
|
console.log(JSON.stringify(session, null, 2));
|
|
@@ -140,20 +147,23 @@ async function handleAutoStatus(projectPath, options) {
|
|
|
140
147
|
}
|
|
141
148
|
}
|
|
142
149
|
// Circuit breakers
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
console.log('
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
150
|
+
if (session.circuitBreakers) {
|
|
151
|
+
const openBreakers = Object.entries(session.circuitBreakers).filter(([_, status]) => status.state === 'open');
|
|
152
|
+
if (openBreakers.length > 0) {
|
|
153
|
+
console.log('');
|
|
154
|
+
console.log(chalk.bold('CIRCUIT BREAKERS'));
|
|
155
|
+
console.log(chalk.bold('━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━'));
|
|
156
|
+
console.log('');
|
|
157
|
+
for (const [service, status] of openBreakers) {
|
|
158
|
+
const s = status;
|
|
159
|
+
console.log(`${service}:`.padEnd(15) + chalk.red('OPEN'));
|
|
160
|
+
console.log(' Failures: ' + chalk.yellow(s.failures.toString()));
|
|
161
|
+
if (s.lastFailure) {
|
|
162
|
+
console.log(' Last: ' + chalk.gray(s.lastFailure));
|
|
163
|
+
}
|
|
164
|
+
if (s.nextRetry) {
|
|
165
|
+
console.log(' Next Retry: ' + chalk.gray(s.nextRetry));
|
|
166
|
+
}
|
|
157
167
|
}
|
|
158
168
|
}
|
|
159
169
|
}
|