promptlineapp 1.10.0 → 1.10.2
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/bin/cli.js +90 -32
- package/package.json +1 -1
package/bin/cli.js
CHANGED
|
@@ -2679,24 +2679,94 @@ export default function DevAdmin() {
|
|
|
2679
2679
|
)}
|
|
2680
2680
|
</div>
|
|
2681
2681
|
|
|
2682
|
-
{/* Save
|
|
2683
|
-
<
|
|
2684
|
-
|
|
2685
|
-
|
|
2686
|
-
|
|
2687
|
-
|
|
2688
|
-
|
|
2689
|
-
|
|
2690
|
-
|
|
2691
|
-
|
|
2692
|
-
|
|
2693
|
-
|
|
2694
|
-
|
|
2695
|
-
|
|
2696
|
-
|
|
2697
|
-
|
|
2698
|
-
|
|
2699
|
-
|
|
2682
|
+
{/* Save & Export/Import Buttons */}
|
|
2683
|
+
<div style={{ display: 'flex', gap: 12, marginBottom: 24 }}>
|
|
2684
|
+
<button
|
|
2685
|
+
onClick={save}
|
|
2686
|
+
style={{
|
|
2687
|
+
flex: 1,
|
|
2688
|
+
padding: 14,
|
|
2689
|
+
background: saved ? '#22c55e' : '#6366f1',
|
|
2690
|
+
color: '#fff',
|
|
2691
|
+
border: 'none',
|
|
2692
|
+
borderRadius: 8,
|
|
2693
|
+
fontSize: 16,
|
|
2694
|
+
fontWeight: 600,
|
|
2695
|
+
cursor: 'pointer'
|
|
2696
|
+
}}
|
|
2697
|
+
>
|
|
2698
|
+
{saved ? '✓ Saved!' : 'Save Configuration'}
|
|
2699
|
+
</button>
|
|
2700
|
+
<button
|
|
2701
|
+
onClick={() => {
|
|
2702
|
+
const config = {
|
|
2703
|
+
apiKey,
|
|
2704
|
+
endpoints,
|
|
2705
|
+
exportedAt: new Date().toISOString()
|
|
2706
|
+
}
|
|
2707
|
+
const blob = new Blob([JSON.stringify(config, null, 2)], { type: 'application/json' })
|
|
2708
|
+
const url = URL.createObjectURL(blob)
|
|
2709
|
+
const a = document.createElement('a')
|
|
2710
|
+
a.href = url
|
|
2711
|
+
a.download = 'promptline-dev-config.json'
|
|
2712
|
+
a.click()
|
|
2713
|
+
URL.revokeObjectURL(url)
|
|
2714
|
+
}}
|
|
2715
|
+
style={{
|
|
2716
|
+
padding: '14px 20px',
|
|
2717
|
+
background: '#fff',
|
|
2718
|
+
color: '#6366f1',
|
|
2719
|
+
border: '2px solid #6366f1',
|
|
2720
|
+
borderRadius: 8,
|
|
2721
|
+
fontSize: 14,
|
|
2722
|
+
fontWeight: 600,
|
|
2723
|
+
cursor: 'pointer'
|
|
2724
|
+
}}
|
|
2725
|
+
>
|
|
2726
|
+
⬇ Export
|
|
2727
|
+
</button>
|
|
2728
|
+
<label
|
|
2729
|
+
style={{
|
|
2730
|
+
padding: '14px 20px',
|
|
2731
|
+
background: '#fff',
|
|
2732
|
+
color: '#10b981',
|
|
2733
|
+
border: '2px solid #10b981',
|
|
2734
|
+
borderRadius: 8,
|
|
2735
|
+
fontSize: 14,
|
|
2736
|
+
fontWeight: 600,
|
|
2737
|
+
cursor: 'pointer',
|
|
2738
|
+
display: 'flex',
|
|
2739
|
+
alignItems: 'center'
|
|
2740
|
+
}}
|
|
2741
|
+
>
|
|
2742
|
+
⬆ Import
|
|
2743
|
+
<input
|
|
2744
|
+
type="file"
|
|
2745
|
+
accept=".json"
|
|
2746
|
+
style={{ display: 'none' }}
|
|
2747
|
+
onChange={e => {
|
|
2748
|
+
const file = e.target.files?.[0]
|
|
2749
|
+
if (!file) return
|
|
2750
|
+
const reader = new FileReader()
|
|
2751
|
+
reader.onload = (ev) => {
|
|
2752
|
+
try {
|
|
2753
|
+
const config = JSON.parse(ev.target?.result)
|
|
2754
|
+
if (config.apiKey) setApiKey(config.apiKey)
|
|
2755
|
+
if (config.endpoints) setEndpoints(config.endpoints)
|
|
2756
|
+
localStorage.setItem(API_KEY_STORAGE, config.apiKey || '')
|
|
2757
|
+
localStorage.setItem(STORAGE_KEY, JSON.stringify(config.endpoints || {}))
|
|
2758
|
+
setSaved(true)
|
|
2759
|
+
setTimeout(() => setSaved(false), 2000)
|
|
2760
|
+
} catch (err) {
|
|
2761
|
+
alert('Invalid config file')
|
|
2762
|
+
}
|
|
2763
|
+
}
|
|
2764
|
+
reader.readAsText(file)
|
|
2765
|
+
e.target.value = ''
|
|
2766
|
+
}}
|
|
2767
|
+
/>
|
|
2768
|
+
</label>
|
|
2769
|
+
</div>
|
|
2700
2770
|
|
|
2701
2771
|
{/* Test Panel */}
|
|
2702
2772
|
<div style={{ background: '#fff', border: '1px solid #e5e7eb', borderRadius: 8, padding: 16 }}>
|
|
@@ -2803,25 +2873,13 @@ async function getProject(gitUrl, destName) {
|
|
|
2803
2873
|
console.log(`${c.cyan}→${c.reset} Destination: ${c.green}${destName}${c.reset}\n`);
|
|
2804
2874
|
|
|
2805
2875
|
try {
|
|
2806
|
-
// Clone
|
|
2807
|
-
execSync(`git clone
|
|
2876
|
+
// Clone (full history for push capability)
|
|
2877
|
+
execSync(`git clone "${gitUrl}" "${destName}"`, {
|
|
2808
2878
|
stdio: 'inherit',
|
|
2809
2879
|
cwd: process.cwd()
|
|
2810
2880
|
});
|
|
2811
|
-
|
|
2812
|
-
// Remove .git
|
|
2813
|
-
const gitDir = path.join(targetDir, '.git');
|
|
2814
|
-
if (fs.existsSync(gitDir)) {
|
|
2815
|
-
fs.rmSync(gitDir, { recursive: true });
|
|
2816
|
-
}
|
|
2817
2881
|
success('Cloned repository');
|
|
2818
2882
|
|
|
2819
|
-
// Init fresh git
|
|
2820
|
-
try {
|
|
2821
|
-
execSync('git init', { cwd: targetDir, stdio: 'pipe' });
|
|
2822
|
-
success('Initialized new git repository');
|
|
2823
|
-
} catch (e) {}
|
|
2824
|
-
|
|
2825
2883
|
// Detect structure
|
|
2826
2884
|
const hasDevRuntime = fs.existsSync(path.join(targetDir, 'dev-runtime'));
|
|
2827
2885
|
const hasPromptlineYaml = fs.existsSync(path.join(targetDir, 'promptline.yaml'));
|