@sushanglewis/lincoln 1.5.0 → 1.5.1
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/dist/main.d.ts +3 -0
- package/dist/main.js +1231 -906
- package/dist/main.js.map +1 -1
- package/dist/postinstall.d.ts +3 -0
- package/dist/postinstall.js +18 -0
- package/dist/postinstall.js.map +1 -0
- package/framework/.claude/agents/_contract.md +79 -0
- package/framework/.claude/agents/architect.md +31 -0
- package/framework/.claude/agents/default.md +151 -0
- package/framework/.claude/agents/designer.md +33 -0
- package/framework/.claude/agents/engineer.md +42 -0
- package/framework/.claude/agents/external/NOTICES.md +12 -0
- package/framework/.claude/agents/external/everything-claude-code.manifest.yaml +23 -0
- package/framework/.claude/agents/external/oh-my-claudecode.manifest.yaml +26 -0
- package/framework/.claude/agents/external/wshobson-agents.manifest.yaml +23 -0
- package/framework/.claude/agents/frontend-engineer.md +32 -0
- package/framework/.claude/agents/knowledge-curator.md +28 -0
- package/framework/.claude/agents/pm.md +38 -0
- package/framework/.claude/agents/qa.md +28 -0
- package/framework/.claude/agents/release-coordinator.md +25 -0
- package/framework/.claude/agents/researcher.md +41 -0
- package/framework/.claude/harnesses/claude-code.yaml +15 -0
- package/framework/.claude/harnesses/codex.yaml +40 -0
- package/framework/.claude/harnesses/command-map.yaml +255 -0
- package/framework/.claude/harnesses/opencode.yaml +32 -0
- package/framework/.claude/harnesses/scenarios.yaml +45 -0
- package/framework/.claude/hooks/on-pr-event.sh +69 -0
- package/framework/.claude/hooks/on-session-start.sh +427 -0
- package/framework/.claude/hooks/on-stop.sh +104 -0
- package/framework/.claude/hooks/post-tool-use.sh +161 -0
- package/framework/.claude/hooks/pre-tool-use.sh +246 -0
- package/framework/.claude/schemas/agent-definition.schema.json +35 -0
- package/framework/.claude/schemas/benchmark-report.schema.json +148 -0
- package/framework/.claude/schemas/pm-to-ux-handoff.schema.yaml +128 -0
- package/framework/.claude/schemas/stage-definition.schema.json +233 -0
- package/framework/.claude/schemas/workflow-stage.schema.json +86 -0
- package/framework/.claude/schemas/workflow-template.schema.json +88 -0
- package/framework/.claude/settings.json +14 -0
- package/framework/.claude/skills/build-product-prototype/SKILL.md +35 -0
- package/framework/.claude/skills/build-product-prototype/prompts/main.md +78 -0
- package/framework/.claude/skills/clarify-requirements/SKILL.md +32 -0
- package/framework/.claude/skills/clarify-requirements/prompts/main.md +81 -0
- package/framework/.claude/skills/dependencies.yaml +139 -0
- package/framework/.claude/skills/draft-product-design/SKILL.md +40 -0
- package/framework/.claude/skills/draft-product-design/prompts/main.md +47 -0
- package/framework/.claude/skills/lc-analyze-frameworks/SKILL.md +43 -0
- package/framework/.claude/skills/lc-analyze-frameworks/prompts/main.md +95 -0
- package/framework/.claude/skills/lc-benchmark/SKILL.md +61 -0
- package/framework/.claude/skills/lc-build-codebase-knowledge/SKILL.md +38 -0
- package/framework/.claude/skills/lc-build-codebase-knowledge/prompts/build-codebase-knowledge.md +61 -0
- package/framework/.claude/skills/lc-collect-intelligence/SKILL.md +43 -0
- package/framework/.claude/skills/lc-collect-intelligence/prompts/main.md +72 -0
- package/framework/.claude/skills/lc-competitive-analysis/SKILL.md +43 -0
- package/framework/.claude/skills/lc-competitive-analysis/prompts/main.md +70 -0
- package/framework/.claude/skills/lc-explore-opensource/SKILL.md +36 -0
- package/framework/.claude/skills/lc-explore-opensource/prompts/explore-opensource.md +77 -0
- package/framework/.claude/skills/lc-first-principles/SKILL.md +43 -0
- package/framework/.claude/skills/lc-first-principles/prompts/main.md +73 -0
- package/framework/.claude/skills/lc-handoff/SKILL.md +34 -0
- package/framework/.claude/skills/lc-init-branch/SKILL.md +52 -0
- package/framework/.claude/skills/lc-market-research/SKILL.md +43 -0
- package/framework/.claude/skills/lc-market-research/prompts/main.md +79 -0
- package/framework/.claude/skills/lc-product-research/SKILL.md +43 -0
- package/framework/.claude/skills/lc-product-research/prompts/main.md +80 -0
- package/framework/.claude/skills/lc-research-report/SKILL.md +43 -0
- package/framework/.claude/skills/lc-research-report/prompts/main.md +90 -0
- package/framework/.claude/skills/lc-research-scope/SKILL.md +43 -0
- package/framework/.claude/skills/lc-research-scope/prompts/main.md +82 -0
- package/framework/.claude/skills/lc-setup/SKILL.md +68 -0
- package/framework/.claude/skills/lc-setup/prompts/main.md +88 -0
- package/framework/.claude/skills/lc-stage/SKILL.md +45 -0
- package/framework/.claude/skills/lc-stakeholder-research/SKILL.md +43 -0
- package/framework/.claude/skills/lc-stakeholder-research/prompts/main.md +65 -0
- package/framework/.claude/skills/lc-status/SKILL.md +25 -0
- package/framework/.claude/skills/lc-storytelling/SKILL.md +43 -0
- package/framework/.claude/skills/lc-storytelling/prompts/main.md +77 -0
- package/framework/.claude/skills/lc-wf/SKILL.md +54 -0
- package/framework/.claude/skills/lc-workflow/SKILL.md +48 -0
- package/framework/.claude/skills/lc-workflow/validators/validate.py +755 -0
- package/framework/.claude/skills/lc-workflow-router/SKILL.md +41 -0
- package/framework/.claude/skills/lc-workflow-router/prompts/intake-prompt.md +91 -0
- package/framework/.claude/skills/lc-workflow-router/prompts/router-prompt.md +44 -0
- package/framework/.claude/skills/plan-tdd-development/SKILL.md +31 -0
- package/framework/.claude/skills/plan-tdd-development/prompts/main.md +44 -0
- package/framework/.claude/skills/process-interview/SKILL.md +32 -0
- package/framework/.claude/skills/process-interview/prompts/main.md +47 -0
- package/framework/.claude/skills/propose-with-openspec/SKILL.md +37 -0
- package/framework/.claude/skills/propose-with-openspec/prompts/main.md +53 -0
- package/framework/.claude/skills/split-to-github/SKILL.md +32 -0
- package/framework/.claude/skills/split-to-github/prompts/main.md +42 -0
- package/framework/.claude/skills/sync-to-knowledge/SKILL.md +35 -0
- package/framework/.claude/skills/sync-to-knowledge/prompts/main.md +54 -0
- package/framework/.claude/skills/workflow-continue/SKILL.md +24 -0
- package/framework/.claude/skills/workflow-continue/prompts/main.md +25 -0
- package/framework/.claude/stages/build-codebase-knowledge.yaml +42 -0
- package/framework/.claude/stages/clarify.yaml +59 -0
- package/framework/.claude/stages/explore-opensource.yaml +40 -0
- package/framework/.claude/stages/implement.yaml +60 -0
- package/framework/.claude/stages/ingest.yaml +40 -0
- package/framework/.claude/stages/lc-analyze-frameworks.yaml +37 -0
- package/framework/.claude/stages/lc-collect-intelligence.yaml +37 -0
- package/framework/.claude/stages/lc-competitive-analysis.yaml +37 -0
- package/framework/.claude/stages/lc-first-principles.yaml +37 -0
- package/framework/.claude/stages/lc-market-research.yaml +37 -0
- package/framework/.claude/stages/lc-product-research.yaml +37 -0
- package/framework/.claude/stages/lc-research-report.yaml +38 -0
- package/framework/.claude/stages/lc-research-scope.yaml +38 -0
- package/framework/.claude/stages/lc-stakeholder-research.yaml +37 -0
- package/framework/.claude/stages/lc-storytelling.yaml +37 -0
- package/framework/.claude/stages/product-design-docs.yaml +66 -0
- package/framework/.claude/stages/product-prototype.yaml +53 -0
- package/framework/.claude/stages/propose.yaml +45 -0
- package/framework/.claude/stages/split.yaml +41 -0
- package/framework/.claude/stages/sync-knowledge.yaml +49 -0
- package/framework/.claude/stages/tdd-development-plan.yaml +43 -0
- package/framework/.claude/stages/workflow-router.yaml +45 -0
- package/framework/.claude/templates/solo-workflow-context.yaml +23 -0
- package/framework/.claude/workflows/README.md +93 -0
- package/framework/.claude/workflows/bug-fix.yaml +81 -0
- package/framework/.claude/workflows/design-spike.yaml +55 -0
- package/framework/.claude/workflows/existing-project-iteration.yaml +106 -0
- package/framework/.claude/workflows/interview-to-knowledge.yaml +189 -0
- package/framework/.claude/workflows/oss-first-design.yaml +100 -0
- package/framework/.claude/workflows/pm-research.yaml +115 -0
- package/framework/.claude-plugin/hooks.json +6 -0
- package/framework/.claude-plugin/marketplace.json +32 -0
- package/framework/.claude-plugin/plugin.json +57 -0
- package/framework/.version-bump.json +43 -0
- package/framework/CLAUDE.md +140 -0
- package/framework/CONTRIBUTING.md +219 -0
- package/framework/LICENSE +21 -0
- package/framework/README.en.md +139 -0
- package/framework/README.md +139 -0
- package/framework/RELEASE.md +334 -0
- package/framework/SKILL.md +24 -0
- package/framework/USAGE.md +356 -0
- package/framework/manifest.json +1214 -0
- package/framework/requirements.txt +4 -0
- package/framework/scripts/__init__.py +0 -0
- package/framework/scripts/build_codebase_knowledge.py +76 -0
- package/framework/scripts/bump_version.py +181 -0
- package/framework/scripts/check-dependency-drift.py +69 -0
- package/framework/scripts/check-harness-drift.sh +57 -0
- package/framework/scripts/check-main-merge-hygiene.py +128 -0
- package/framework/scripts/check-skill-dependencies.sh +124 -0
- package/framework/scripts/init-lincoln-branch.sh +300 -0
- package/framework/scripts/init-project.sh +184 -0
- package/framework/scripts/lc-benchmark-cli.py +66 -0
- package/framework/scripts/lincoln-audit.py +288 -0
- package/framework/scripts/lincoln-setup.py +651 -0
- package/framework/scripts/lincoln-status.py +448 -0
- package/framework/scripts/lincoln_benchmark.py +224 -0
- package/framework/scripts/lincoln_benchmark_eval.py +104 -0
- package/framework/scripts/lincoln_benchmark_metrics.py +818 -0
- package/framework/scripts/lincoln_benchmark_report.py +141 -0
- package/framework/scripts/lincoln_command_map.py +289 -0
- package/framework/scripts/lincoln_dependency_manager.py +335 -0
- package/framework/scripts/lincoln_documents.py +175 -0
- package/framework/scripts/lincoln_harness_adapter.py +319 -0
- package/framework/scripts/lincoln_index.py +255 -0
- package/framework/scripts/lincoln_paths.py +198 -0
- package/framework/scripts/lincoln_prd.py +227 -0
- package/framework/scripts/lincoln_role.py +46 -0
- package/framework/scripts/lincoln_scenario.py +59 -0
- package/framework/scripts/lincoln_session_start_metrics.py +71 -0
- package/framework/scripts/lincoln_skill_prompt.py +48 -0
- package/framework/scripts/lincoln_trace.py +335 -0
- package/framework/scripts/lincoln_workflow.py +199 -0
- package/framework/scripts/list-active-lincoln-branches.sh +87 -0
- package/framework/scripts/package-lincoln-plugin.py +340 -0
- package/framework/scripts/run-infrastructure-tests.py +84 -0
- package/framework/scripts/stage_loader.py +1071 -0
- package/framework/scripts/static-check.sh +356 -0
- package/framework/scripts/sync-external-agents.sh +210 -0
- package/framework/scripts/sync-framework-package.mjs +218 -0
- package/framework/scripts/task_tool_guard.py +213 -0
- package/framework/scripts/track-artifacts.py +140 -0
- package/framework/scripts/validate_stage.py +350 -0
- package/{README.md → framework/tools/lincoln/README.md} +4 -4
- package/framework/tools/lincoln/package-lock.json +3349 -0
- package/framework/tools/lincoln/package.json +48 -0
- package/framework/tools/lincoln/src/cli.tsx +60 -0
- package/framework/tools/lincoln/src/components/AudioMeter.tsx +34 -0
- package/framework/tools/lincoln/src/components/CancelledScreen.tsx +11 -0
- package/framework/tools/lincoln/src/components/DevicesMenu.tsx +79 -0
- package/framework/tools/lincoln/src/components/HintBar.tsx +25 -0
- package/framework/tools/lincoln/src/components/LogView.tsx +36 -0
- package/framework/tools/lincoln/src/components/ModelMenu.tsx +122 -0
- package/framework/tools/lincoln/src/components/ReadyScreen.tsx +54 -0
- package/framework/tools/lincoln/src/components/RecordingApp.tsx +211 -0
- package/framework/tools/lincoln/src/components/RecordingScreen.tsx +41 -0
- package/framework/tools/lincoln/src/components/SelectMenu.tsx +53 -0
- package/framework/tools/lincoln/src/components/StatusPanel.tsx +52 -0
- package/framework/tools/lincoln/src/components/StopConfirmation.tsx +32 -0
- package/framework/tools/lincoln/src/config/args.ts +35 -0
- package/framework/tools/lincoln/src/config/loadConfig.ts +81 -0
- package/framework/tools/lincoln/src/config/resolveConfig.ts +85 -0
- package/framework/tools/lincoln/src/devices/listDevices.ts +11 -0
- package/framework/tools/lincoln/src/devices/parseDevices.ts +25 -0
- package/framework/tools/lincoln/src/hooks/useKeyHandler.ts +63 -0
- package/framework/tools/lincoln/src/main.tsx +4 -0
- package/framework/tools/lincoln/src/models/models.ts +34 -0
- package/framework/tools/lincoln/src/models/runWarmup.ts +46 -0
- package/framework/tools/lincoln/src/models/warmupProgress.ts +30 -0
- package/framework/tools/lincoln/src/recording/spawnRecorder.ts +127 -0
- package/framework/tools/lincoln/src/recording/useRecorder.ts +146 -0
- package/framework/tools/lincoln/src/utils/amplitudeToMeter.ts +4 -0
- package/framework/tools/lincoln/src/utils/formatDuration.ts +6 -0
- package/framework/tools/lincoln/src/utils/sessionId.ts +25 -0
- package/framework/tools/lincoln/tests/cli.test.tsx +52 -0
- package/framework/tools/lincoln/tests/components/AudioMeter.test.tsx +31 -0
- package/framework/tools/lincoln/tests/components/CancelledScreen.test.tsx +12 -0
- package/framework/tools/lincoln/tests/components/ReadyScreen.test.tsx +68 -0
- package/framework/tools/lincoln/tests/components/RecordingApp.menus.test.tsx +158 -0
- package/framework/tools/lincoln/tests/components/RecordingApp.test.tsx +248 -0
- package/framework/tools/lincoln/tests/components/RecordingScreen.test.tsx +37 -0
- package/framework/tools/lincoln/tests/components/SelectMenu.test.tsx +59 -0
- package/framework/tools/lincoln/tests/components/StopConfirmation.test.tsx +38 -0
- package/framework/tools/lincoln/tests/config/args.test.ts +49 -0
- package/framework/tools/lincoln/tests/config/loadConfig.test.ts +59 -0
- package/framework/tools/lincoln/tests/config/resolveConfig.test.ts +72 -0
- package/framework/tools/lincoln/tests/devices/parseDevices.test.ts +21 -0
- package/framework/tools/lincoln/tests/hooks/useKeyHandler.enabled.test.tsx +44 -0
- package/framework/tools/lincoln/tests/hooks/useKeyHandler.test.tsx +130 -0
- package/framework/tools/lincoln/tests/models/models.test.ts +27 -0
- package/framework/tools/lincoln/tests/models/warmupProgress.test.ts +25 -0
- package/framework/tools/lincoln/tests/recording/spawnRecorder.test.ts +85 -0
- package/framework/tools/lincoln/tests/recording/useRecorder.test.tsx +172 -0
- package/framework/tools/lincoln/tests/utils/amplitudeToMeter.test.ts +22 -0
- package/framework/tools/lincoln/tests/utils/formatDuration.test.ts +11 -0
- package/framework/tools/lincoln/tests/utils/sessionId.test.ts +30 -0
- package/framework/tools/lincoln/tsconfig.json +22 -0
- package/framework/tools/lincoln/tsconfig.tests.json +10 -0
- package/framework/tools/lincoln/tsup.config.ts +17 -0
- package/framework/tools/lincoln/vitest.config.ts +20 -0
- package/framework/tools/lincoln-installer/package-lock.json +3611 -0
- package/framework/tools/lincoln-installer/package.json +53 -0
- package/framework/tools/lincoln-installer/src/cli.tsx +63 -0
- package/framework/tools/lincoln-installer/src/components/HarnessSelectScreen.tsx +43 -0
- package/framework/tools/lincoln-installer/src/components/InstallerApp.tsx +98 -0
- package/framework/tools/lincoln-installer/src/components/OptionsScreen.tsx +56 -0
- package/framework/tools/lincoln-installer/src/components/ProgressScreen.tsx +25 -0
- package/framework/tools/lincoln-installer/src/components/ResultScreen.tsx +40 -0
- package/framework/tools/lincoln-installer/src/components/SelectMenu.tsx +73 -0
- package/framework/tools/lincoln-installer/src/components/SummaryScreen.tsx +49 -0
- package/framework/tools/lincoln-installer/src/components/UpdateApp.tsx +135 -0
- package/framework/tools/lincoln-installer/src/components/WelcomeScreen.tsx +22 -0
- package/framework/tools/lincoln-installer/src/config/args.ts +76 -0
- package/framework/tools/lincoln-installer/src/config/resolveConfig.ts +33 -0
- package/framework/tools/lincoln-installer/src/config/updateArgs.ts +67 -0
- package/framework/tools/lincoln-installer/src/hooks/useSetup.ts +149 -0
- package/framework/tools/lincoln-installer/src/main.tsx +11 -0
- package/framework/tools/lincoln-installer/src/types.ts +19 -0
- package/framework/tools/lincoln-installer/src/update-main.tsx +11 -0
- package/framework/tools/lincoln-installer/src/update.tsx +90 -0
- package/framework/tools/lincoln-installer/src/utils/detectHarness.ts +51 -0
- package/framework/tools/lincoln-installer/src/utils/runSetup.ts +62 -0
- package/framework/tools/lincoln-installer/src/utils/updateRelease.ts +454 -0
- package/framework/tools/lincoln-installer/tests/components/InstallerApp.test.tsx +88 -0
- package/framework/tools/lincoln-installer/tests/components/SelectMenu.test.tsx +26 -0
- package/framework/tools/lincoln-installer/tests/components/UpdateApp.test.tsx +170 -0
- package/framework/tools/lincoln-installer/tests/components/screens.test.tsx +310 -0
- package/framework/tools/lincoln-installer/tests/config/args.test.ts +66 -0
- package/framework/tools/lincoln-installer/tests/config/resolveConfig.test.ts +75 -0
- package/framework/tools/lincoln-installer/tests/config/updateArgs.test.ts +52 -0
- package/framework/tools/lincoln-installer/tests/hooks/useSetup.test.tsx +213 -0
- package/framework/tools/lincoln-installer/tests/update.test.tsx +108 -0
- package/framework/tools/lincoln-installer/tests/utils/detectHarness.test.ts +40 -0
- package/framework/tools/lincoln-installer/tests/utils/runSetup.test.ts +45 -0
- package/framework/tools/lincoln-installer/tests/utils/updateRelease.test.ts +559 -0
- package/framework/tools/lincoln-installer/tsconfig.json +22 -0
- package/framework/tools/lincoln-installer/tsconfig.tests.json +8 -0
- package/framework/tools/lincoln-installer/tsup.config.ts +17 -0
- package/framework/tools/lincoln-installer/vitest.config.ts +20 -0
- package/framework/tools/lincoln-record/Cargo.lock +1896 -0
- package/framework/tools/lincoln-record/Cargo.toml +24 -0
- package/framework/tools/lincoln-record/diarize/diarize.py +117 -0
- package/framework/tools/lincoln-record/diarize/merge.py +55 -0
- package/framework/tools/lincoln-record/src/audio/capture/microphone.rs +194 -0
- package/framework/tools/lincoln-record/src/audio/capture/mod.rs +1 -0
- package/framework/tools/lincoln-record/src/audio/devices.rs +20 -0
- package/framework/tools/lincoln-record/src/audio/mod.rs +5 -0
- package/framework/tools/lincoln-record/src/audio/resampler.rs +44 -0
- package/framework/tools/lincoln-record/src/audio/saver.rs +87 -0
- package/framework/tools/lincoln-record/src/audio/source.rs +104 -0
- package/framework/tools/lincoln-record/src/cli.rs +96 -0
- package/framework/tools/lincoln-record/src/config.rs +135 -0
- package/framework/tools/lincoln-record/src/lib.rs +6 -0
- package/framework/tools/lincoln-record/src/main.rs +242 -0
- package/framework/tools/lincoln-record/src/model/mod.rs +248 -0
- package/framework/tools/lincoln-record/src/output/metadata.rs +30 -0
- package/framework/tools/lincoln-record/src/output/mod.rs +2 -0
- package/framework/tools/lincoln-record/src/output/transcript.rs +42 -0
- package/framework/tools/lincoln-record/src/transcription/diarization.rs +64 -0
- package/framework/tools/lincoln-record/src/transcription/mod.rs +3 -0
- package/framework/tools/lincoln-record/src/transcription/provider.rs +43 -0
- package/framework/tools/lincoln-record/src/transcription/whisper.rs +176 -0
- package/framework/tools/lincoln-record/tests/cli_args.rs +103 -0
- package/framework/tools/lincoln-record/tests/config_test.rs +70 -0
- package/framework/tools/lincoln-record/tests/devices_test.rs +23 -0
- package/framework/tools/lincoln-record/tests/diarization_tests.rs +101 -0
- package/framework/tools/lincoln-record/tests/integration_tests.rs +44 -0
- package/framework/tools/lincoln-record/tests/model_test.rs +68 -0
- package/framework/tools/lincoln-record/tests/transcription_tests.rs +73 -0
- package/package.json +19 -13
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
export interface ParsedArgs {
|
|
2
|
+
root: string
|
|
3
|
+
harness: string[]
|
|
4
|
+
yes: boolean
|
|
5
|
+
dryRun: boolean
|
|
6
|
+
noTui: boolean
|
|
7
|
+
format: 'human' | 'json'
|
|
8
|
+
help: boolean
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
function takeValue(argv: string[], i: number, name: string): string {
|
|
12
|
+
const value = argv[i + 1]
|
|
13
|
+
if (value === undefined || value.startsWith('--')) {
|
|
14
|
+
throw new Error(`Missing value for ${name}`)
|
|
15
|
+
}
|
|
16
|
+
return value
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export function parseArgs(argv: string[]): ParsedArgs {
|
|
20
|
+
const args: ParsedArgs = {
|
|
21
|
+
root: '.',
|
|
22
|
+
harness: [],
|
|
23
|
+
yes: false,
|
|
24
|
+
dryRun: false,
|
|
25
|
+
noTui: false,
|
|
26
|
+
format: 'human',
|
|
27
|
+
help: false,
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
for (let i = 0; i < argv.length; i++) {
|
|
31
|
+
const arg = argv[i]
|
|
32
|
+
switch (arg) {
|
|
33
|
+
case '--root': {
|
|
34
|
+
const value = takeValue(argv, i, '--root')
|
|
35
|
+
args.root = value
|
|
36
|
+
i++
|
|
37
|
+
break
|
|
38
|
+
}
|
|
39
|
+
case '--harness': {
|
|
40
|
+
const value = takeValue(argv, i, '--harness')
|
|
41
|
+
args.harness.push(value)
|
|
42
|
+
i++
|
|
43
|
+
break
|
|
44
|
+
}
|
|
45
|
+
case '--yes':
|
|
46
|
+
args.yes = true
|
|
47
|
+
break
|
|
48
|
+
case '--dry-run':
|
|
49
|
+
args.dryRun = true
|
|
50
|
+
break
|
|
51
|
+
case '--no-tui':
|
|
52
|
+
args.noTui = true
|
|
53
|
+
break
|
|
54
|
+
case '--format': {
|
|
55
|
+
const value = takeValue(argv, i, '--format')
|
|
56
|
+
if (value !== 'human' && value !== 'json') {
|
|
57
|
+
throw new Error(`Invalid value for --format: ${value}. Must be 'human' or 'json'.`)
|
|
58
|
+
}
|
|
59
|
+
args.format = value
|
|
60
|
+
i++
|
|
61
|
+
break
|
|
62
|
+
}
|
|
63
|
+
case '-h':
|
|
64
|
+
case '--help':
|
|
65
|
+
args.help = true
|
|
66
|
+
break
|
|
67
|
+
default:
|
|
68
|
+
if (arg.startsWith('--')) {
|
|
69
|
+
throw new Error(`Unknown argument: ${arg}`)
|
|
70
|
+
}
|
|
71
|
+
break
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
return args
|
|
76
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { existsSync, statSync } from 'node:fs'
|
|
2
|
+
import { resolve } from 'node:path'
|
|
3
|
+
|
|
4
|
+
import type { ParsedArgs } from './args'
|
|
5
|
+
|
|
6
|
+
export interface InstallerConfig {
|
|
7
|
+
root: string
|
|
8
|
+
harnesses: string[]
|
|
9
|
+
yes: boolean
|
|
10
|
+
dryRun: boolean
|
|
11
|
+
format: 'human' | 'json'
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export function resolveConfig(args: ParsedArgs): InstallerConfig {
|
|
15
|
+
const root = resolve(args.root)
|
|
16
|
+
if (!existsSync(root) || !statSync(root).isDirectory()) {
|
|
17
|
+
throw new Error(`Project root does not exist or is not a directory: ${root}`)
|
|
18
|
+
}
|
|
19
|
+
const setupScript = resolve(root, 'scripts', 'lincoln-setup.py')
|
|
20
|
+
if (!existsSync(setupScript)) {
|
|
21
|
+
throw new Error(
|
|
22
|
+
`Lincoln setup script not found at ${setupScript}. ` +
|
|
23
|
+
`Run lincoln-install inside a Lincoln project checkout.`
|
|
24
|
+
)
|
|
25
|
+
}
|
|
26
|
+
return {
|
|
27
|
+
root,
|
|
28
|
+
harnesses: args.harness.length > 0 ? args.harness : [],
|
|
29
|
+
yes: args.yes,
|
|
30
|
+
dryRun: args.dryRun,
|
|
31
|
+
format: args.format,
|
|
32
|
+
}
|
|
33
|
+
}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { validateRepoSlug } from '../utils/updateRelease'
|
|
2
|
+
|
|
3
|
+
export interface UpdateParsedArgs {
|
|
4
|
+
root: string
|
|
5
|
+
repo: string
|
|
6
|
+
dryRun: boolean
|
|
7
|
+
noTui: boolean
|
|
8
|
+
format: 'human' | 'json'
|
|
9
|
+
help: boolean
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
function takeValue(argv: string[], i: number, name: string): string {
|
|
13
|
+
const value = argv[i + 1]
|
|
14
|
+
if (value === undefined || value.startsWith('--')) {
|
|
15
|
+
throw new Error(`Missing value for ${name}`)
|
|
16
|
+
}
|
|
17
|
+
return value
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export function parseUpdateArgs(argv: string[]): UpdateParsedArgs {
|
|
21
|
+
const args: UpdateParsedArgs = {
|
|
22
|
+
root: '.',
|
|
23
|
+
repo: 'sushanglewis/Lincoln',
|
|
24
|
+
dryRun: false,
|
|
25
|
+
noTui: false,
|
|
26
|
+
format: 'human',
|
|
27
|
+
help: false,
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
for (let i = 0; i < argv.length; i++) {
|
|
31
|
+
const arg = argv[i]
|
|
32
|
+
switch (arg) {
|
|
33
|
+
case '--root':
|
|
34
|
+
args.root = takeValue(argv, i, '--root')
|
|
35
|
+
i++
|
|
36
|
+
break
|
|
37
|
+
case '--repo':
|
|
38
|
+
args.repo = takeValue(argv, i, '--repo')
|
|
39
|
+
validateRepoSlug(args.repo)
|
|
40
|
+
i++
|
|
41
|
+
break
|
|
42
|
+
case '--dry-run':
|
|
43
|
+
args.dryRun = true
|
|
44
|
+
break
|
|
45
|
+
case '--no-tui':
|
|
46
|
+
args.noTui = true
|
|
47
|
+
break
|
|
48
|
+
case '--format': {
|
|
49
|
+
const value = takeValue(argv, i, '--format')
|
|
50
|
+
if (value !== 'human' && value !== 'json') {
|
|
51
|
+
throw new Error(`Invalid value for --format: ${value}`)
|
|
52
|
+
}
|
|
53
|
+
args.format = value
|
|
54
|
+
i++
|
|
55
|
+
break
|
|
56
|
+
}
|
|
57
|
+
case '--help':
|
|
58
|
+
case '-h':
|
|
59
|
+
args.help = true
|
|
60
|
+
break
|
|
61
|
+
default:
|
|
62
|
+
throw new Error(`Unknown argument: ${arg}`)
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
return args
|
|
67
|
+
}
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
import { existsSync } from 'node:fs'
|
|
2
|
+
import { resolve } from 'node:path'
|
|
3
|
+
import { useCallback, useState } from 'react'
|
|
4
|
+
|
|
5
|
+
import { runSetup, parseJsonOutput, type RunSetupResult } from '../utils/runSetup'
|
|
6
|
+
|
|
7
|
+
export type SetupPhase =
|
|
8
|
+
| 'welcome'
|
|
9
|
+
| 'harness'
|
|
10
|
+
| 'options'
|
|
11
|
+
| 'summary'
|
|
12
|
+
| 'running'
|
|
13
|
+
| 'result'
|
|
14
|
+
|
|
15
|
+
export interface SetupOptions {
|
|
16
|
+
root: string
|
|
17
|
+
harnesses: string[]
|
|
18
|
+
yes: boolean
|
|
19
|
+
dryRun: boolean
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export interface StepResult {
|
|
23
|
+
step: string
|
|
24
|
+
success: boolean
|
|
25
|
+
output?: unknown
|
|
26
|
+
error?: string
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export interface UseSetupReturn {
|
|
30
|
+
isRunning: boolean
|
|
31
|
+
results: StepResult[]
|
|
32
|
+
currentStep: string
|
|
33
|
+
error?: string
|
|
34
|
+
startSetup: (options: SetupOptions) => void
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
function getPythonCommand(): string {
|
|
38
|
+
if (process.platform === 'win32') {
|
|
39
|
+
return 'python'
|
|
40
|
+
}
|
|
41
|
+
return 'python3'
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export function useSetup(): UseSetupReturn {
|
|
45
|
+
const [isRunning, setIsRunning] = useState(false)
|
|
46
|
+
const [results, setResults] = useState<StepResult[]>([])
|
|
47
|
+
const [currentStep, setCurrentStep] = useState<string>('')
|
|
48
|
+
const [error, setError] = useState<string | undefined>(undefined)
|
|
49
|
+
|
|
50
|
+
const runStep = useCallback(
|
|
51
|
+
async (label: string, command: string, args: string[], root: string): Promise<StepResult> => {
|
|
52
|
+
setCurrentStep(label)
|
|
53
|
+
const result: RunSetupResult = await runSetup({ root, command, args })
|
|
54
|
+
const output = parseJsonOutput(result.stdout)
|
|
55
|
+
const stepResult: StepResult = {
|
|
56
|
+
step: label,
|
|
57
|
+
success: result.success,
|
|
58
|
+
output,
|
|
59
|
+
error: result.error || (result.success ? undefined : result.stderr || 'unknown error'),
|
|
60
|
+
}
|
|
61
|
+
setResults((prev) => [...prev, stepResult])
|
|
62
|
+
return stepResult
|
|
63
|
+
},
|
|
64
|
+
[]
|
|
65
|
+
)
|
|
66
|
+
|
|
67
|
+
const startSetup = useCallback(
|
|
68
|
+
(options: SetupOptions) => {
|
|
69
|
+
setIsRunning(true)
|
|
70
|
+
setResults([])
|
|
71
|
+
setError(undefined)
|
|
72
|
+
|
|
73
|
+
async function runAll(): Promise<void> {
|
|
74
|
+
const setupScript = resolve(options.root, 'scripts', 'lincoln-setup.py')
|
|
75
|
+
if (!existsSync(setupScript)) {
|
|
76
|
+
throw new Error(
|
|
77
|
+
`Lincoln setup script not found at ${setupScript}. ` +
|
|
78
|
+
`Run lincoln-install inside a Lincoln project checkout.`
|
|
79
|
+
)
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
const format = '--format=json'
|
|
83
|
+
const rootArg = `--root=${options.root}`
|
|
84
|
+
const yesArg = options.yes ? '--yes' : undefined
|
|
85
|
+
const dryRunArg = options.dryRun ? '--dry-run' : undefined
|
|
86
|
+
const commonArgs = [rootArg, format, yesArg, dryRunArg].filter(
|
|
87
|
+
(arg): arg is string => arg !== undefined
|
|
88
|
+
)
|
|
89
|
+
|
|
90
|
+
const python = getPythonCommand()
|
|
91
|
+
|
|
92
|
+
const check = await runStep('check', python, [setupScript, 'check', ...commonArgs], options.root)
|
|
93
|
+
if (!check.success) {
|
|
94
|
+
return
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
const skills = await runStep('install-skills', python, [setupScript, 'install-skills', ...commonArgs], options.root)
|
|
98
|
+
if (!skills.success) {
|
|
99
|
+
return
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
const clis = await runStep('install-clis', python, [setupScript, 'install-clis', ...commonArgs], options.root)
|
|
103
|
+
if (!clis.success) {
|
|
104
|
+
return
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
const config = await runStep('init-repo-config', python, [setupScript, 'init-repo-config', ...commonArgs], options.root)
|
|
108
|
+
if (!config.success) {
|
|
109
|
+
return
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
const project = await runStep('init-project', python, [setupScript, 'init-project', ...commonArgs], options.root)
|
|
113
|
+
if (!project.success) {
|
|
114
|
+
return
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
if (options.harnesses.length > 0) {
|
|
118
|
+
const harnessArgs = options.harnesses.flatMap((h) => ['--harness', h])
|
|
119
|
+
const harness = await runStep(
|
|
120
|
+
'generate-harness',
|
|
121
|
+
python,
|
|
122
|
+
[setupScript, 'generate-harness', ...commonArgs, ...harnessArgs],
|
|
123
|
+
options.root
|
|
124
|
+
)
|
|
125
|
+
if (!harness.success) {
|
|
126
|
+
return
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
runAll()
|
|
132
|
+
.catch((err) => {
|
|
133
|
+
setError(err instanceof Error ? err.message : String(err))
|
|
134
|
+
})
|
|
135
|
+
.finally(() => {
|
|
136
|
+
setIsRunning(false)
|
|
137
|
+
})
|
|
138
|
+
},
|
|
139
|
+
[runStep]
|
|
140
|
+
)
|
|
141
|
+
|
|
142
|
+
return {
|
|
143
|
+
isRunning,
|
|
144
|
+
results,
|
|
145
|
+
currentStep,
|
|
146
|
+
error,
|
|
147
|
+
startSetup,
|
|
148
|
+
}
|
|
149
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { main } from './cli'
|
|
3
|
+
|
|
4
|
+
console.log(
|
|
5
|
+
'⚠️ lincoln-install is deprecated. Run: npm install -g @sushanglewis/lincoln && lincoln install'
|
|
6
|
+
)
|
|
7
|
+
|
|
8
|
+
main().catch((err) => {
|
|
9
|
+
console.error(err instanceof Error ? err.message : String(err))
|
|
10
|
+
process.exit(1)
|
|
11
|
+
})
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export interface HarnessInfo {
|
|
2
|
+
id: string
|
|
3
|
+
name: string
|
|
4
|
+
description: string
|
|
5
|
+
installed: boolean
|
|
6
|
+
projectDir?: string
|
|
7
|
+
globalDir?: string
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export interface SetupStep {
|
|
11
|
+
command: string
|
|
12
|
+
label: string
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export interface SetupResult {
|
|
16
|
+
success: boolean
|
|
17
|
+
step?: string
|
|
18
|
+
error?: string
|
|
19
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { updateMain } from './update'
|
|
3
|
+
|
|
4
|
+
console.log(
|
|
5
|
+
'⚠️ lincoln-update is deprecated. Run: npm install -g @sushanglewis/lincoln && lincoln install'
|
|
6
|
+
)
|
|
7
|
+
|
|
8
|
+
updateMain().catch((err) => {
|
|
9
|
+
console.error(err instanceof Error ? err.message : String(err))
|
|
10
|
+
process.exit(1)
|
|
11
|
+
})
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { Box, Text } from 'ink'
|
|
3
|
+
import React from 'react'
|
|
4
|
+
|
|
5
|
+
import { parseUpdateArgs } from './config/updateArgs'
|
|
6
|
+
import { UpdateApp } from './components/UpdateApp'
|
|
7
|
+
import { updateRelease, type UpdateResult } from './utils/updateRelease'
|
|
8
|
+
|
|
9
|
+
function printHumanResult(result: UpdateResult): void {
|
|
10
|
+
if (!result.success) {
|
|
11
|
+
console.log(`Update failed: ${result.error ?? 'unknown error'}`)
|
|
12
|
+
return
|
|
13
|
+
}
|
|
14
|
+
if (result.fromVersion === result.toVersion) {
|
|
15
|
+
console.log(`Lincoln is up to date (${result.fromVersion}).`)
|
|
16
|
+
return
|
|
17
|
+
}
|
|
18
|
+
console.log(`Update available: ${result.fromVersion} → ${result.toVersion}`)
|
|
19
|
+
if (result.updated.length > 0) {
|
|
20
|
+
console.log(`Updated files (${result.updated.length}):`)
|
|
21
|
+
for (const file of result.updated.slice(0, 10)) {
|
|
22
|
+
console.log(` ${file}`)
|
|
23
|
+
}
|
|
24
|
+
if (result.updated.length > 10) {
|
|
25
|
+
console.log(` ...and ${result.updated.length - 10} more`)
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
if (result.preserved.length > 0) {
|
|
29
|
+
console.log('Preserved user data:')
|
|
30
|
+
for (const path of result.preserved) {
|
|
31
|
+
console.log(` ${path}`)
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
if (result.backupDir) {
|
|
35
|
+
console.log(`Backup directory: ${result.backupDir}`)
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export function UpdateAppRoot({ args }: { args: ReturnType<typeof parseUpdateArgs> }) {
|
|
40
|
+
if (args.help) {
|
|
41
|
+
return (
|
|
42
|
+
<Box flexDirection="column" padding={1}>
|
|
43
|
+
<Text bold>lincoln-update</Text>
|
|
44
|
+
<Text>Update Lincoln to the latest release.</Text>
|
|
45
|
+
<Text />
|
|
46
|
+
<Text bold>Usage:</Text>
|
|
47
|
+
<Text> npx lincoln-update [options]</Text>
|
|
48
|
+
<Text />
|
|
49
|
+
<Text bold>Options:</Text>
|
|
50
|
+
<Text> --root Project root directory (default: current dir)</Text>
|
|
51
|
+
<Text> --repo GitHub repository slug (default: sushanglewis/Lincoln)</Text>
|
|
52
|
+
<Text> --dry-run Show what would be updated without applying changes</Text>
|
|
53
|
+
<Text> --no-tui Print result as JSON and exit</Text>
|
|
54
|
+
<Text> --format Output format: human|json (default: human)</Text>
|
|
55
|
+
<Text> --help, -h Show this help message</Text>
|
|
56
|
+
</Box>
|
|
57
|
+
)
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
return <UpdateApp root={args.root} repo={args.repo} dryRun={args.dryRun} />
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export async function updateMain(argv: string[] = process.argv.slice(2)): Promise<void> {
|
|
64
|
+
try {
|
|
65
|
+
const args = parseUpdateArgs(argv)
|
|
66
|
+
|
|
67
|
+
if (args.help) {
|
|
68
|
+
const { render } = await import('ink')
|
|
69
|
+
render(<UpdateAppRoot args={args} />)
|
|
70
|
+
return
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
if (args.noTui) {
|
|
74
|
+
const result = await updateRelease({ root: args.root, repo: args.repo, dryRun: args.dryRun })
|
|
75
|
+
if (args.format === 'human') {
|
|
76
|
+
printHumanResult(result)
|
|
77
|
+
} else {
|
|
78
|
+
console.log(JSON.stringify(result, null, 2))
|
|
79
|
+
}
|
|
80
|
+
return
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
const { render } = await import('ink')
|
|
84
|
+
render(<UpdateAppRoot args={args} />)
|
|
85
|
+
} catch (err) {
|
|
86
|
+
const message = err instanceof Error ? err.message : String(err)
|
|
87
|
+
console.error(`Error: ${message}`)
|
|
88
|
+
process.exitCode = 1
|
|
89
|
+
}
|
|
90
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { existsSync } from 'node:fs'
|
|
2
|
+
import { homedir } from 'node:os'
|
|
3
|
+
import { join } from 'node:path'
|
|
4
|
+
|
|
5
|
+
import type { HarnessInfo } from '../types'
|
|
6
|
+
|
|
7
|
+
const HARNESS_DEFINITIONS: Omit<HarnessInfo, 'installed'>[] = [
|
|
8
|
+
{
|
|
9
|
+
id: 'claude-code',
|
|
10
|
+
name: 'Claude Code',
|
|
11
|
+
description: 'Anthropic Claude Code agent',
|
|
12
|
+
projectDir: '.claude',
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
id: 'cursor',
|
|
16
|
+
name: 'Cursor',
|
|
17
|
+
description: 'Cursor editor rules',
|
|
18
|
+
projectDir: '.cursor',
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
id: 'codex',
|
|
22
|
+
name: 'Codex',
|
|
23
|
+
description: 'OpenAI Codex CLI',
|
|
24
|
+
projectDir: '.codex',
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
id: 'opencode',
|
|
28
|
+
name: 'OpenCode',
|
|
29
|
+
description: 'OpenCode agent',
|
|
30
|
+
projectDir: '.opencode',
|
|
31
|
+
},
|
|
32
|
+
]
|
|
33
|
+
|
|
34
|
+
function globalDirFor(id: string, homeDir: string): string | undefined {
|
|
35
|
+
if (id === 'cursor') return undefined
|
|
36
|
+
return join(homeDir, '.' + id.replace('claude-code', 'claude'))
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export function detectHarnesses(root: string, homeDir: string = homedir()): HarnessInfo[] {
|
|
40
|
+
return HARNESS_DEFINITIONS.map((harness) => {
|
|
41
|
+
const projectInstalled = harness.projectDir
|
|
42
|
+
? existsSync(join(root, harness.projectDir))
|
|
43
|
+
: false
|
|
44
|
+
const global = globalDirFor(harness.id, homeDir)
|
|
45
|
+
const globalInstalled = global ? existsSync(global) : false
|
|
46
|
+
return {
|
|
47
|
+
...harness,
|
|
48
|
+
installed: projectInstalled || globalInstalled,
|
|
49
|
+
}
|
|
50
|
+
})
|
|
51
|
+
}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { spawn } from 'node:child_process'
|
|
2
|
+
|
|
3
|
+
export interface RunSetupOptions {
|
|
4
|
+
root: string
|
|
5
|
+
command: string
|
|
6
|
+
args: string[]
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export interface RunSetupResult {
|
|
10
|
+
success: boolean
|
|
11
|
+
code: number | null
|
|
12
|
+
stdout: string
|
|
13
|
+
stderr: string
|
|
14
|
+
error?: string
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export function runSetup(options: RunSetupOptions): Promise<RunSetupResult> {
|
|
18
|
+
return new Promise((resolve) => {
|
|
19
|
+
const { root, command, args } = options
|
|
20
|
+
const proc = spawn(command, args, {
|
|
21
|
+
cwd: root,
|
|
22
|
+
stdio: ['ignore', 'pipe', 'pipe'],
|
|
23
|
+
})
|
|
24
|
+
|
|
25
|
+
let stdout = ''
|
|
26
|
+
let stderr = ''
|
|
27
|
+
let settled = false
|
|
28
|
+
|
|
29
|
+
function finish(result: RunSetupResult): void {
|
|
30
|
+
if (settled) return
|
|
31
|
+
settled = true
|
|
32
|
+
resolve(result)
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
proc.stdout.on('data', (data: Buffer) => {
|
|
36
|
+
stdout += data.toString('utf-8')
|
|
37
|
+
})
|
|
38
|
+
|
|
39
|
+
proc.stderr.on('data', (data: Buffer) => {
|
|
40
|
+
stderr += data.toString('utf-8')
|
|
41
|
+
})
|
|
42
|
+
|
|
43
|
+
proc.on('error', (error) => {
|
|
44
|
+
finish({ success: false, code: null, stdout, stderr, error: error.message })
|
|
45
|
+
})
|
|
46
|
+
|
|
47
|
+
proc.on('close', (code) => {
|
|
48
|
+
finish({ success: code === 0, code, stdout, stderr })
|
|
49
|
+
})
|
|
50
|
+
})
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export function parseJsonOutput(stdout: string): unknown {
|
|
54
|
+
const lines = stdout.trim().split('\n')
|
|
55
|
+
const lastLine = lines[lines.length - 1]
|
|
56
|
+
if (!lastLine) return undefined
|
|
57
|
+
try {
|
|
58
|
+
return JSON.parse(lastLine)
|
|
59
|
+
} catch {
|
|
60
|
+
return undefined
|
|
61
|
+
}
|
|
62
|
+
}
|