@loicngr/kobo 1.7.28 → 1.7.30
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/CHANGELOG.md +8 -0
- package/dist/server/routes/templates.js +19 -1
- package/dist/server/routes/workspaces.js +83 -6
- package/dist/server/services/pr-watcher-service.js +8 -1
- package/dist/server/services/settings-service.js +13 -0
- package/dist/server/services/templates-service.js +28 -0
- package/dist/server/utils/git-ops.js +85 -3
- package/package.json +1 -1
- package/src/client/dist/spa/assets/{ActivityFeed-DW7Bv1Cx.js → ActivityFeed-Dcp3KOD-.js} +1 -1
- package/src/client/dist/spa/assets/{ChangelogPage-vEYi6Byk.js → ChangelogPage-CQuEm5ri.js} +1 -1
- package/src/client/dist/spa/assets/{ClosePopup-BWYh08p9.js → ClosePopup-CY16K9Yi.js} +1 -1
- package/src/client/dist/spa/assets/{CreatePage-CSbZYNPW.js → CreatePage-DwPnA1bE.js} +1 -1
- package/src/client/dist/spa/assets/{DiffViewer-CkZgt7Fp.js → DiffViewer-CdpddYBw.js} +3 -3
- package/src/client/dist/spa/assets/{HealthPage-BLcP13YD.js → HealthPage-czYUHzsb.js} +1 -1
- package/src/client/dist/spa/assets/{MainLayout-CILSd-EM.css → MainLayout-D2SRkiCN.css} +1 -1
- package/src/client/dist/spa/assets/{MainLayout-j-gqN_I5.js → MainLayout-DsG5p1lc.js} +17 -17
- package/src/client/dist/spa/assets/{QExpansionItem-CiBP4NiY.js → QExpansionItem-_8j8FyQg.js} +1 -1
- package/src/client/dist/spa/assets/{QMenu-CoPEAblj.js → QMenu-BXssnk-g.js} +1 -1
- package/src/client/dist/spa/assets/{QScrollArea-CZVgBUBp.js → QScrollArea-_Mvx2t8o.js} +1 -1
- package/src/client/dist/spa/assets/{QScrollObserver-CAlbLisQ.js → QScrollObserver-C6P7wS4h.js} +1 -1
- package/src/client/dist/spa/assets/{QSelect-U9wJ7Z2A.js → QSelect-kWnJnHbT.js} +1 -1
- package/src/client/dist/spa/assets/{QTooltip-CwBZU_bs.js → QTooltip-DyIRS1GH.js} +1 -1
- package/src/client/dist/spa/assets/{SearchPage-BPknEVtZ.js → SearchPage-CxqEGjQZ.js} +1 -1
- package/src/client/dist/spa/assets/SettingsPage-CL9uI9wk.js +9 -0
- package/src/client/dist/spa/assets/SettingsPage-D1Ap5wB7.css +1 -0
- package/src/client/dist/spa/assets/{TouchPan-DXGxNMLq.js → TouchPan-DZZEI8eo.js} +1 -1
- package/src/client/dist/spa/assets/{WorkspacePage-Co34Wjna.js → WorkspacePage-DYOstvf6.js} +3 -3
- package/src/client/dist/spa/assets/{build-path-tree-B9aeh1tv.js → build-path-tree-BUfhgOSH.js} +1 -1
- package/src/client/dist/spa/assets/{cssMode-D_Z8-Q5h.js → cssMode-DK7cw-vE.js} +1 -1
- package/src/client/dist/spa/assets/{editor.api-DgduwnV5.js → editor.api-DvSpUXCz.js} +1 -1
- package/src/client/dist/spa/assets/{editor.main-C4_EYinG.js → editor.main-DwPjO6GT.js} +3 -3
- package/src/client/dist/spa/assets/{engineFeatures-B3_uxW5Z.js → engineFeatures-Bt8kYOzE.js} +1 -1
- package/src/client/dist/spa/assets/{expand-template-D7jp6KZJ.js → expand-template-CIu2odEp.js} +1 -1
- package/src/client/dist/spa/assets/{freemarker2-6aUXBO6n.js → freemarker2-D7ge7blW.js} +1 -1
- package/src/client/dist/spa/assets/{handlebars-D2zveC0w.js → handlebars-CUEC5MGt.js} +1 -1
- package/src/client/dist/spa/assets/{html-C-zqkrrG.js → html-CxVVScDS.js} +1 -1
- package/src/client/dist/spa/assets/{htmlMode-DE3gz2Wd.js → htmlMode-B56eLBAd.js} +1 -1
- package/src/client/dist/spa/assets/i18n-QWFh8Zwf.js +1 -0
- package/src/client/dist/spa/assets/index-B-lBV8Zz.js +82 -0
- package/src/client/dist/spa/assets/{javascript-xiWyVH4o.js → javascript-B3eFu2aM.js} +1 -1
- package/src/client/dist/spa/assets/{jsonMode-JTmi1bQa.js → jsonMode-D2R4UZpk.js} +1 -1
- package/src/client/dist/spa/assets/{kobo-commands-C0Y02P5A.js → kobo-commands-Bty0N8JZ.js} +1 -1
- package/src/client/dist/spa/assets/{liquid-CT9b60IZ.js → liquid-96V_PNfN.js} +1 -1
- package/src/client/dist/spa/assets/{mdx-QIdOXPHb.js → mdx-Dm6cvsMe.js} +1 -1
- package/src/client/dist/spa/assets/{monaco.contribution-uzj4TvhF.js → monaco.contribution-CYHCoAZe.js} +2 -2
- package/src/client/dist/spa/assets/{notifications-l1Pxijve.js → notifications-BtVr85fZ.js} +1 -1
- package/src/client/dist/spa/assets/{python-7sJU2SF0.js → python-DswGzTX7.js} +1 -1
- package/src/client/dist/spa/assets/{razor-kkOOm93b.js → razor-4HZKZMY8.js} +1 -1
- package/src/client/dist/spa/assets/{render-chat-markdown-G7XwL3vR.js → render-chat-markdown-BpWIaLW6.js} +1 -1
- package/src/client/dist/spa/assets/{tsMode-BY1pp4Yd.js → tsMode-C83Lp_IK.js} +1 -1
- package/src/client/dist/spa/assets/{typescript-D3HSMsZe.js → typescript-Dbm3rcf_.js} +1 -1
- package/src/client/dist/spa/assets/{use-onboarding-CcwSDBsS.js → use-onboarding-BorG03FJ.js} +1 -1
- package/src/client/dist/spa/assets/{xml-BC8zXouV.js → xml-BDATADOG.js} +1 -1
- package/src/client/dist/spa/assets/{yaml-CeoIec1I.js → yaml-Fic7yQhp.js} +1 -1
- package/src/client/dist/spa/index.html +2 -2
- package/src/client/dist/spa/assets/SettingsPage-C64_E1oJ.css +0 -1
- package/src/client/dist/spa/assets/SettingsPage-HhPqZAtG.js +0 -9
- package/src/client/dist/spa/assets/i18n-BmFuyRbK.js +0 -1
- package/src/client/dist/spa/assets/index-TewFyoT4.js +0 -82
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,14 @@ All notable changes to Kōbō are documented here. The format is based on
|
|
|
4
4
|
[Keep a Changelog](https://keepachangelog.com/). Each release is an `## <version>`
|
|
5
5
|
section — the in-app "What's new" dialog reads this file.
|
|
6
6
|
|
|
7
|
+
## 1.7.30
|
|
8
|
+
|
|
9
|
+
- feat: open-in-terminal button + git creation/purge fixes
|
|
10
|
+
|
|
11
|
+
## 1.7.29
|
|
12
|
+
|
|
13
|
+
- feat: git working-tree tooling, template reset, diff label
|
|
14
|
+
|
|
7
15
|
## 1.7.28
|
|
8
16
|
|
|
9
17
|
- feat: commit diff review, workspace rename tool, macOS usage keychain
|
|
@@ -5,7 +5,10 @@ const app = new Hono();
|
|
|
5
5
|
// GET /api/templates — list all templates
|
|
6
6
|
app.get('/', (c) => {
|
|
7
7
|
try {
|
|
8
|
-
return c.json({
|
|
8
|
+
return c.json({
|
|
9
|
+
templates: templatesService.listTemplates(),
|
|
10
|
+
defaultSlugs: templatesService.getDefaultTemplateSlugs(),
|
|
11
|
+
});
|
|
9
12
|
}
|
|
10
13
|
catch (err) {
|
|
11
14
|
const message = err instanceof Error ? err.message : String(err);
|
|
@@ -75,6 +78,21 @@ app.post('/reload-defaults', (c) => {
|
|
|
75
78
|
return c.json({ error: message }, 500);
|
|
76
79
|
}
|
|
77
80
|
});
|
|
81
|
+
// POST /api/templates/:slug/reset-default — restore a default template to its built-in content
|
|
82
|
+
app.post('/:slug/reset-default', (c) => {
|
|
83
|
+
try {
|
|
84
|
+
const slug = c.req.param('slug');
|
|
85
|
+
const template = templatesService.resetTemplateToDefault(slug);
|
|
86
|
+
if (!template) {
|
|
87
|
+
return c.json({ error: `Template '${slug}' is not a default template` }, 404);
|
|
88
|
+
}
|
|
89
|
+
return c.json({ template });
|
|
90
|
+
}
|
|
91
|
+
catch (err) {
|
|
92
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
93
|
+
return c.json({ error: message }, 500);
|
|
94
|
+
}
|
|
95
|
+
});
|
|
78
96
|
// DELETE /api/templates/:slug — delete a template
|
|
79
97
|
app.delete('/:slug', (c) => {
|
|
80
98
|
try {
|
|
@@ -222,7 +222,10 @@ app.post('/', migrationGuard, async (c) => {
|
|
|
222
222
|
// which is what Sentry auto-close recognises in commit messages.
|
|
223
223
|
const detectedTicketId = notionContent?.ticketId || sentryContent?.issueId || body.name.match(/[A-Z]+-\d+/i)?.[0];
|
|
224
224
|
if (detectedTicketId && !workingBranch.toLowerCase().includes(detectedTicketId.toLowerCase())) {
|
|
225
|
-
|
|
225
|
+
// Sanitize + length-cap the ticket id: a Sentry issue id / title can carry
|
|
226
|
+
// odd characters (PHP namespace `Foo\Bar\Baz`) or be long, which would
|
|
227
|
+
// otherwise yield an invalid or too-long branch that fails `git worktree add`.
|
|
228
|
+
const ticketPrefix = gitOps.slugifyBranchSegment(detectedTicketId, 40).toUpperCase();
|
|
226
229
|
const slashIdx = workingBranch.indexOf('/');
|
|
227
230
|
const typePrefix = slashIdx >= 0 ? workingBranch.slice(0, slashIdx + 1) : 'feature/';
|
|
228
231
|
// Use Notion/Sentry title or body name for the slug — all have proper accented
|
|
@@ -235,7 +238,8 @@ app.post('/', migrationGuard, async (c) => {
|
|
|
235
238
|
.replace(/[^a-z0-9]+/g, '-')
|
|
236
239
|
.replace(/^-|-$/g, '')
|
|
237
240
|
.substring(0, 50);
|
|
238
|
-
|
|
241
|
+
const safeSlug = titleSlug || 'task';
|
|
242
|
+
workingBranch = ticketPrefix ? `${typePrefix}${ticketPrefix}--${safeSlug}` : `${typePrefix}${safeSlug}`;
|
|
239
243
|
}
|
|
240
244
|
}
|
|
241
245
|
// Compute the project slug once and reuse it for both the prospective
|
|
@@ -383,7 +387,21 @@ app.post('/', migrationGuard, async (c) => {
|
|
|
383
387
|
}
|
|
384
388
|
catch (err) {
|
|
385
389
|
const message = err instanceof Error ? err.message : String(err);
|
|
386
|
-
|
|
390
|
+
// Roll back the half-created workspace: a failed worktree creation must NOT
|
|
391
|
+
// leave an orphan record behind. Best-effort cleanup of any partial worktree
|
|
392
|
+
// dir git may have produced, then delete the just-inserted workspace row.
|
|
393
|
+
try {
|
|
394
|
+
worktreeService.removeWorktree(body.projectPath, prospectiveWorktreePath);
|
|
395
|
+
}
|
|
396
|
+
catch {
|
|
397
|
+
// worktree may never have been registered — ignore
|
|
398
|
+
}
|
|
399
|
+
try {
|
|
400
|
+
workspaceService.deleteWorkspace(workspace.id);
|
|
401
|
+
}
|
|
402
|
+
catch (delErr) {
|
|
403
|
+
console.error('[workspaces] rollback deleteWorkspace failed:', delErr);
|
|
404
|
+
}
|
|
387
405
|
return c.json({ error: `Failed to create worktree: ${message}` }, 500);
|
|
388
406
|
}
|
|
389
407
|
}
|
|
@@ -1783,6 +1801,46 @@ app.post('/:id/open-editor', (c) => {
|
|
|
1783
1801
|
return c.json({ error: message }, 500);
|
|
1784
1802
|
}
|
|
1785
1803
|
});
|
|
1804
|
+
/** Open the workspace worktree in the user's configured terminal emulator. */
|
|
1805
|
+
app.post('/:id/open-terminal', async (c) => {
|
|
1806
|
+
try {
|
|
1807
|
+
const id = c.req.param('id');
|
|
1808
|
+
const workspace = workspaceService.getWorkspace(id);
|
|
1809
|
+
if (!workspace)
|
|
1810
|
+
return c.json({ error: `Workspace '${id}' not found` }, 404);
|
|
1811
|
+
const globalSettings = settingsService.getGlobalSettings();
|
|
1812
|
+
if (!globalSettings.terminalCommand.trim()) {
|
|
1813
|
+
return c.json({ error: 'No terminal command configured' }, 400);
|
|
1814
|
+
}
|
|
1815
|
+
const worktreePath = workspace.worktreePath;
|
|
1816
|
+
if (!fs.existsSync(worktreePath)) {
|
|
1817
|
+
return c.json({ error: `Worktree path does not exist: ${worktreePath}` }, 400);
|
|
1818
|
+
}
|
|
1819
|
+
// Split on whitespace, then substitute the optional {path} placeholder. The
|
|
1820
|
+
// terminal also gets cwd = worktree, so emulators that inherit the cwd
|
|
1821
|
+
// (kitty, alacritty, wezterm) work with no placeholder, while those that
|
|
1822
|
+
// need an explicit flag use {path} (gnome-terminal --working-directory={path}).
|
|
1823
|
+
const tokens = globalSettings.terminalCommand
|
|
1824
|
+
.trim()
|
|
1825
|
+
.split(/\s+/)
|
|
1826
|
+
.map((t) => t.replace(/\{path\}/g, worktreePath));
|
|
1827
|
+
const [cmd, ...args] = tokens;
|
|
1828
|
+
// Await the spawn so a bad command (ENOENT) surfaces as a clear 400 instead of
|
|
1829
|
+
// a fire-and-forget "success" — same pattern as open-file-manager.
|
|
1830
|
+
try {
|
|
1831
|
+
await waitForSpawn(cmd, args, { cwd: worktreePath });
|
|
1832
|
+
}
|
|
1833
|
+
catch (err) {
|
|
1834
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
1835
|
+
return c.json({ error: `Failed to launch terminal '${globalSettings.terminalCommand}': ${msg}` }, 400);
|
|
1836
|
+
}
|
|
1837
|
+
return c.json({ success: true });
|
|
1838
|
+
}
|
|
1839
|
+
catch (err) {
|
|
1840
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
1841
|
+
return c.json({ error: message }, 500);
|
|
1842
|
+
}
|
|
1843
|
+
});
|
|
1786
1844
|
/** Open the workspace worktree in the user's configured file manager. */
|
|
1787
1845
|
app.post('/:id/open-file-manager', async (c) => {
|
|
1788
1846
|
try {
|
|
@@ -1818,9 +1876,9 @@ app.post('/:id/open-file-manager', async (c) => {
|
|
|
1818
1876
|
});
|
|
1819
1877
|
/** Spawn a detached process and resolve as soon as it has started (or reject
|
|
1820
1878
|
* on launch failure). Caller doesn't await process completion. */
|
|
1821
|
-
function waitForSpawn(command, args) {
|
|
1879
|
+
function waitForSpawn(command, args, options = {}) {
|
|
1822
1880
|
return new Promise((resolve, reject) => {
|
|
1823
|
-
const child = spawn(command, args, { detached: true, stdio: 'ignore' });
|
|
1881
|
+
const child = spawn(command, args, { detached: true, stdio: 'ignore', ...options });
|
|
1824
1882
|
let settled = false;
|
|
1825
1883
|
child.once('spawn', () => {
|
|
1826
1884
|
if (settled)
|
|
@@ -2421,6 +2479,21 @@ app.get('/:id/commits', async (c) => {
|
|
|
2421
2479
|
return c.json({ error: message }, 500);
|
|
2422
2480
|
}
|
|
2423
2481
|
});
|
|
2482
|
+
// GET /:id/working-tree-files — list uncommitted working-tree files (read-only)
|
|
2483
|
+
app.get('/:id/working-tree-files', (c) => {
|
|
2484
|
+
try {
|
|
2485
|
+
const id = c.req.param('id');
|
|
2486
|
+
const workspace = workspaceService.getWorkspace(id);
|
|
2487
|
+
if (!workspace)
|
|
2488
|
+
return c.json({ error: `Workspace '${id}' not found` }, 404);
|
|
2489
|
+
const files = gitOps.getWorkingTreeFiles(workspace.worktreePath);
|
|
2490
|
+
return c.json({ files });
|
|
2491
|
+
}
|
|
2492
|
+
catch (err) {
|
|
2493
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
2494
|
+
return c.json({ error: message }, 500);
|
|
2495
|
+
}
|
|
2496
|
+
});
|
|
2424
2497
|
// POST /api/workspaces/:id/rename-branch { newName }
|
|
2425
2498
|
// Rename the working branch in git, move the worktree dir to match, and
|
|
2426
2499
|
// update the DB. Run as one atomic operation from the UI "Rename branch"
|
|
@@ -2592,10 +2665,14 @@ app.post('/:id/pull', (c) => {
|
|
|
2592
2665
|
return c.json({ error: `Workspace '${id}' not found` }, 404);
|
|
2593
2666
|
}
|
|
2594
2667
|
const worktreePath = workspace.worktreePath;
|
|
2668
|
+
const autostash = c.req.query('autostash') === '1';
|
|
2595
2669
|
try {
|
|
2596
|
-
gitOps.pullBranch(worktreePath, workspace.workingBranch);
|
|
2670
|
+
gitOps.pullBranch(worktreePath, workspace.workingBranch, 'origin', { autostash });
|
|
2597
2671
|
}
|
|
2598
2672
|
catch (err) {
|
|
2673
|
+
if (err instanceof gitOps.DirtyWorktreeError) {
|
|
2674
|
+
return c.json({ error: err.message, code: 'dirty_worktree', operation: err.operation, status: err.status }, 409);
|
|
2675
|
+
}
|
|
2599
2676
|
const message = err instanceof Error ? err.message : String(err);
|
|
2600
2677
|
return c.json({ error: message }, 500);
|
|
2601
2678
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import fs from 'node:fs';
|
|
2
|
-
import { fetchSourceBranchAsync } from '../utils/git-ops.js';
|
|
2
|
+
import { fetchSourceBranchAsync, isGitWorktree } from '../utils/git-ops.js';
|
|
3
3
|
import { stopDevServer } from './dev-server-service.js';
|
|
4
4
|
import { getForgeProvider } from './forge/registry.js';
|
|
5
5
|
import { resolveForge } from './forge/resolve.js';
|
|
@@ -72,6 +72,13 @@ function autoRestoreManuallyRecreatedWorktrees() {
|
|
|
72
72
|
continue;
|
|
73
73
|
if (!fs.existsSync(ws.worktreePath))
|
|
74
74
|
continue;
|
|
75
|
+
// Only a genuinely recreated worktree (gh pr checkout / git worktree add)
|
|
76
|
+
// should trigger restore. A purge that failed to fully remove the folder
|
|
77
|
+
// (e.g. root-owned Docker files) leaves a residual non-git directory that
|
|
78
|
+
// satisfies existsSync but is NOT a valid worktree — restoring it would
|
|
79
|
+
// wrongly un-archive the workspace and flood git fetches with "(null)".
|
|
80
|
+
if (!isGitWorktree(ws.worktreePath))
|
|
81
|
+
continue;
|
|
75
82
|
try {
|
|
76
83
|
const restored = restoreWorktreeFromDisk(ws.id);
|
|
77
84
|
emitEphemeral(ws.id, 'workspace:worktree-restored', { workspace: restored });
|
|
@@ -607,6 +607,17 @@ const settingsMigrations = [
|
|
|
607
607
|
}
|
|
608
608
|
},
|
|
609
609
|
},
|
|
610
|
+
{
|
|
611
|
+
version: 37,
|
|
612
|
+
name: 'add-terminal-command',
|
|
613
|
+
migrate: ({ global }) => {
|
|
614
|
+
// Empty by default — the "Open in terminal" button only shows
|
|
615
|
+
// when the user explicitly fills it (`xterm`, `gnome-terminal`, `wt`…).
|
|
616
|
+
if (typeof global.terminalCommand !== 'string') {
|
|
617
|
+
global.terminalCommand = '';
|
|
618
|
+
}
|
|
619
|
+
},
|
|
620
|
+
},
|
|
610
621
|
];
|
|
611
622
|
/** Current settings schema version — always equals the highest migration version. */
|
|
612
623
|
export const SETTINGS_SCHEMA_VERSION = settingsMigrations.length > 0 ? settingsMigrations[settingsMigrations.length - 1].version : 0;
|
|
@@ -650,6 +661,7 @@ function defaultSettings() {
|
|
|
650
661
|
changeSourceBranchScript: DEFAULT_CHANGE_SOURCE_BRANCH_SCRIPT,
|
|
651
662
|
editorCommand: '',
|
|
652
663
|
fileManagerCommand: '',
|
|
664
|
+
terminalCommand: '',
|
|
653
665
|
autoPurgeOnPrMerged: false,
|
|
654
666
|
browserNotifications: true,
|
|
655
667
|
audioNotifications: true,
|
|
@@ -989,6 +1001,7 @@ export function updateGlobalSettings(data) {
|
|
|
989
1001
|
'changeSourceBranchScript',
|
|
990
1002
|
'editorCommand',
|
|
991
1003
|
'fileManagerCommand',
|
|
1004
|
+
'terminalCommand',
|
|
992
1005
|
'autoPurgeOnPrMerged',
|
|
993
1006
|
'browserNotifications',
|
|
994
1007
|
'audioNotifications',
|
|
@@ -72,6 +72,34 @@ export function deleteTemplate(slug) {
|
|
|
72
72
|
writeTemplates(next);
|
|
73
73
|
return true;
|
|
74
74
|
}
|
|
75
|
+
/** Slugs of every built-in default template (used to show the reset action). */
|
|
76
|
+
export function getDefaultTemplateSlugs() {
|
|
77
|
+
return DEFAULT_TEMPLATES.map((t) => t.slug);
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Reset a default template back to its built-in content/description. Returns the
|
|
81
|
+
* updated template, or null if `slug` is not a default template. Recreates the
|
|
82
|
+
* row if it had been deleted.
|
|
83
|
+
*/
|
|
84
|
+
export function resetTemplateToDefault(slug) {
|
|
85
|
+
const def = DEFAULT_TEMPLATES.find((d) => d.slug === slug);
|
|
86
|
+
if (!def)
|
|
87
|
+
return null;
|
|
88
|
+
const templates = listTemplates();
|
|
89
|
+
const now = new Date().toISOString();
|
|
90
|
+
const idx = templates.findIndex((t) => t.slug === slug);
|
|
91
|
+
let result;
|
|
92
|
+
if (idx >= 0) {
|
|
93
|
+
result = { ...templates[idx], description: def.description, content: def.content, updatedAt: now };
|
|
94
|
+
templates[idx] = result;
|
|
95
|
+
}
|
|
96
|
+
else {
|
|
97
|
+
result = { ...def, createdAt: now, updatedAt: now };
|
|
98
|
+
templates.push(result);
|
|
99
|
+
}
|
|
100
|
+
writeTemplates(templates);
|
|
101
|
+
return result;
|
|
102
|
+
}
|
|
75
103
|
// ── Internals ──────────────────────────────────────────────────────────────
|
|
76
104
|
function validateTemplateInput(input) {
|
|
77
105
|
if (!SLUG_PATTERN.test(input.slug)) {
|
|
@@ -153,10 +153,24 @@ export function fetchAllBranches(repoPath, remote = 'origin') {
|
|
|
153
153
|
throw new Error(`Failed to fetch from '${remote}': ${message}`);
|
|
154
154
|
}
|
|
155
155
|
}
|
|
156
|
-
/** Pull the current branch from the remote using fast-forward only.
|
|
157
|
-
|
|
156
|
+
/** Pull the current branch from the remote using fast-forward only.
|
|
157
|
+
* With `opts.autostash`, dirty changes are stashed/re-applied automatically.
|
|
158
|
+
* Without it, a dirty tree (staged or modified tracked files) is refused up-front
|
|
159
|
+
* with a `DirtyWorktreeError` — same recovery path rebase/merge offer — instead of
|
|
160
|
+
* letting git fail with a localized message. Detected locale-independently. */
|
|
161
|
+
export function pullBranch(repoPath, branchName, remote = 'origin', opts) {
|
|
162
|
+
if (!opts?.autostash) {
|
|
163
|
+
const status = getWorkingTreeStatus(repoPath);
|
|
164
|
+
if (status.staged > 0 || status.modified > 0) {
|
|
165
|
+
throw new DirtyWorktreeError('pull', status);
|
|
166
|
+
}
|
|
167
|
+
}
|
|
158
168
|
try {
|
|
159
|
-
|
|
169
|
+
const args = ['pull', '--ff-only'];
|
|
170
|
+
if (opts?.autostash)
|
|
171
|
+
args.push('--autostash');
|
|
172
|
+
args.push(remote, branchName);
|
|
173
|
+
git(repoPath, args);
|
|
160
174
|
}
|
|
161
175
|
catch (err) {
|
|
162
176
|
const message = err instanceof Error ? err.message : String(err);
|
|
@@ -882,6 +896,74 @@ export function getWorkingTreeStatus(repoPath) {
|
|
|
882
896
|
return { staged: 0, modified: 0, untracked: 0 };
|
|
883
897
|
}
|
|
884
898
|
}
|
|
899
|
+
/**
|
|
900
|
+
* List uncommitted working-tree files with their status, parsed from
|
|
901
|
+
* `git status --porcelain`. Same classification rule as getWorkingTreeStatus.
|
|
902
|
+
* For renames (porcelain `old -> new`) the NEW path is kept. Best-effort: [] on error.
|
|
903
|
+
*/
|
|
904
|
+
export function getWorkingTreeFiles(repoPath) {
|
|
905
|
+
try {
|
|
906
|
+
const output = git(repoPath, ['status', '--porcelain']);
|
|
907
|
+
const files = [];
|
|
908
|
+
for (const line of output.split('\n')) {
|
|
909
|
+
if (!line)
|
|
910
|
+
continue;
|
|
911
|
+
const x = line[0];
|
|
912
|
+
const y = line[1];
|
|
913
|
+
let filePath = line.slice(3);
|
|
914
|
+
const arrowIdx = filePath.indexOf(' -> ');
|
|
915
|
+
if (arrowIdx !== -1)
|
|
916
|
+
filePath = filePath.slice(arrowIdx + 4);
|
|
917
|
+
const untracked = x === '?' && y === '?';
|
|
918
|
+
files.push({
|
|
919
|
+
path: filePath,
|
|
920
|
+
staged: !untracked && x !== ' ' && x !== '?',
|
|
921
|
+
modified: !untracked && y !== ' ' && y !== '?',
|
|
922
|
+
untracked,
|
|
923
|
+
});
|
|
924
|
+
}
|
|
925
|
+
return files;
|
|
926
|
+
}
|
|
927
|
+
catch {
|
|
928
|
+
return [];
|
|
929
|
+
}
|
|
930
|
+
}
|
|
931
|
+
/**
|
|
932
|
+
* True if `repoPath` is the root of a valid git work tree — a real repo (`.git`
|
|
933
|
+
* directory) or a linked worktree (`.git` file). A purge leftover (no `.git`, or
|
|
934
|
+
* a dead `.git` link pointing at a pruned gitdir) returns false, so it is never
|
|
935
|
+
* mistaken for a manually recreated worktree. Requires a LOCAL `.git` entry so a
|
|
936
|
+
* residual directory nested inside a parent repo doesn't resolve to that parent.
|
|
937
|
+
* Best-effort: false on any error.
|
|
938
|
+
*/
|
|
939
|
+
export function isGitWorktree(repoPath) {
|
|
940
|
+
try {
|
|
941
|
+
if (!existsSync(join(repoPath, '.git')))
|
|
942
|
+
return false;
|
|
943
|
+
return git(repoPath, ['rev-parse', '--is-inside-work-tree']).trim() === 'true';
|
|
944
|
+
}
|
|
945
|
+
catch {
|
|
946
|
+
return false;
|
|
947
|
+
}
|
|
948
|
+
}
|
|
949
|
+
/**
|
|
950
|
+
* Turn an arbitrary string into a git-ref-safe segment, capped to `maxLen`.
|
|
951
|
+
* Strips accents (é→e), collapses every run of non-alphanumeric characters
|
|
952
|
+
* (backslashes, colons, spaces, dots… — all unsafe or awkward in a ref/path)
|
|
953
|
+
* into a single hyphen, and trims leading/trailing hyphens (including one the
|
|
954
|
+
* length cap may leave). Preserves case — the caller upper/lower-cases as needed.
|
|
955
|
+
* Used to build the working branch from Notion/Sentry titles + issue IDs so an
|
|
956
|
+
* over-long or odd-charactered source can never produce an invalid worktree.
|
|
957
|
+
*/
|
|
958
|
+
export function slugifyBranchSegment(input, maxLen = 50) {
|
|
959
|
+
return input
|
|
960
|
+
.normalize('NFD')
|
|
961
|
+
.replace(/[\u0300-\u036f]/g, '')
|
|
962
|
+
.replace(/[^A-Za-z0-9]+/g, '-')
|
|
963
|
+
.replace(/^-+|-+$/g, '')
|
|
964
|
+
.slice(0, maxLen)
|
|
965
|
+
.replace(/-+$/g, '');
|
|
966
|
+
}
|
|
885
967
|
/**
|
|
886
968
|
* Count commits ahead of `origin/<workingBranch>`. Returns `-1` when the remote
|
|
887
969
|
* ref does not exist (i.e. the branch has never been pushed).
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@loicngr/kobo",
|
|
3
|
-
"version": "1.7.
|
|
3
|
+
"version": "1.7.30",
|
|
4
4
|
"description": "Kōbō — multi-workspace agent manager for Claude Code. Orchestrates isolated git worktrees with dev servers, Notion integration, and MCP tools.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "GPL-3.0-or-later",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{D as e,G as t,I as n,N as r,P as i,R as a,St as o,W as s,_ as c,at as l,d as u,et as d,f,g as p,l as m,p as h,r as g,u as _,xt as v,y,yt as b}from"./runtime-core.esm-bundler-D_RRiKBh.js";import{U as x,l as S,t as C}from"./QIcon-BmEX2rXO.js";import{c as w,s as T}from"./notifications-
|
|
1
|
+
import{D as e,G as t,I as n,N as r,P as i,R as a,St as o,W as s,_ as c,at as l,d as u,et as d,f,g as p,l as m,p as h,r as g,u as _,xt as v,y,yt as b}from"./runtime-core.esm-bundler-D_RRiKBh.js";import{U as x,l as S,t as C}from"./QIcon-BmEX2rXO.js";import{c as w,s as T}from"./notifications-BtVr85fZ.js";import{t as E}from"./QBtn-CoU-UC_j.js";import{n as D}from"./vue-i18n-Cq-KgjJC.js";import{_ as O,c as k,m as A,u as j}from"./index-B-lBV8Zz.js";import{t as M}from"./QSpinnerDots-DspFKwCZ.js";import{t as N}from"./QTooltip-DyIRS1GH.js";import{t as ee}from"./QExpansionItem-_8j8FyQg.js";import{t as te}from"./QScrollArea-_Mvx2t8o.js";import{i as ne,n as re,t as P}from"./render-chat-markdown-BpWIaLW6.js";import{t as F}from"./documents-CX2-4fhr.js";import{t as I}from"./_plugin-vue_export-helper-r4mAJOHR.js";function ie(e,t,n=!0){let r=[],i=new Map,a=new Map;for(let n=0;n<e.length;n++){let o=e[n],s=t?.[n];switch(o.kind){case`message:text`:{let e=i.get(o.messageId);if(e)e.text+=o.text,e.streaming=o.streaming;else{let e={type:`text`,messageId:o.messageId,text:o.text,streaming:o.streaming,ts:s};i.set(o.messageId,e),r.push(e)}break}case`message:end`:{let e=i.get(o.messageId);e&&(e.streaming=!1);break}case`message:thinking`:r.push({type:`thinking`,messageId:o.messageId,text:o.text,ts:s});break;case`tool:call`:{let e={type:`tool`,toolCallId:o.toolCallId,name:o.name,input:o.input,ts:s};a.set(o.toolCallId,e),r.push(e);break}case`tool:result`:{let e=a.get(o.toolCallId);e&&(e.result={output:o.output,isError:o.isError});break}case`session:started`:r.push({type:`session`,kind:`started`,detail:{engineSessionId:o.engineSessionId,model:o.model},ts:s});break;case`session:ended`:r.push({type:`session`,kind:`ended`,detail:{reason:o.reason,exitCode:o.exitCode},ts:s});break;case`session:compacted`:r.push({type:`session`,kind:`compacted`,ts:s});break;case`session:brainstorm-complete`:case`session:user-input-requested`:case`message:raw`:case`skills:discovered`:case`usage`:case`rate_limit`:case`subagent:progress`:case`error`:break;default:}}let o=null;for(let e of r)e.type===`text`&&e.streaming&&(o&&(o.streaming=!1),o=e);return o&&!n&&(o.streaming=!1),r}function ae(e,t){if(t.length===0)return e;let n=t.map(e=>({type:`user`,content:e.content,sender:e.sender,ts:e.ts})),r=[...e,...n];r.sort((e,t)=>{let n=e.ts??``,r=t.ts??``;return n===r?0:n?r?n<r?-1:1:-1:1});let i;for(let e of r)e.type===`user`&&e.sender!==`system-prompt`&&e.ts&&(!i||e.ts>i)&&(i=e.ts);if(i)for(let e of r)e.type===`text`&&e.streaming&&(!e.ts||e.ts<i)&&(e.streaming=!1);return r}var L=new Set([`setup`,`cleanup`,`archive`]);function R(e){switch(e.type){case`user`:return e.sender===`system-prompt`?`system-prompt`:L.has(e.sender)?`script`:`user`;case`session`:return`session`;default:return`agent`}}function oe(e){let t=[],n=null,r=null;for(let i of e){let e=R(i),a=e===`session`||e===`system-prompt`,o=e===`script`&&i.type===`user`?`script:${i.sender}`:e;!n||r!==o||a?(n={speaker:e,ts:i.ts,items:[i]},r=o,t.push(n),a&&(n=null)):n.items.push(i)}return t}var z={class:`text-caption text-grey-6`},B=y({__name:`SessionEventItem`,props:{item:{}},setup(e){let t=e,r=m(()=>{switch(t.item.kind){case`started`:return`session.started`;case`ended`:return`session.ended`;case`compacted`:return`session.compacted`;default:return`session.started`}});return(e,t)=>(n(),h(`span`,z,o(e.$t(r.value)),1))}});function se(e,t){if(t.length===0||e.length===0)return e;let n=[...t].sort((e,t)=>t.length-e.length),r=new DOMParser().parseFromString(`<div>${e}</div>`,`text/html`),i=r.body.firstChild;if(!i)return e;function a(e){if(e.nodeType===Node.TEXT_NODE){V(e,n,r);return}if(e.nodeName===`A`)return;let t=Array.from(e.childNodes);for(let e of t)a(e)}return a(i),i.innerHTML}function V(e,t,n){let r=e.textContent??``;if(!t.some(e=>r.includes(e)))return;let i=n.createDocumentFragment(),a=0;for(;a<r.length;){let e=H(r,a,t);if(!e){i.appendChild(n.createTextNode(r.slice(a)));break}e.index>a&&i.appendChild(n.createTextNode(r.slice(a,e.index)));let o=n.createElement(`a`);o.className=`document-link`,o.setAttribute(`data-document-path`,e.path),o.setAttribute(`href`,`#`),o.textContent=e.path,i.appendChild(o),a=e.index+e.path.length}e.parentNode?.replaceChild(i,e)}function H(e,t,n){let r=null;for(let i of n){let n=e.indexOf(i,t);n<0||(!r||n<r.index||n===r.index&&i.length>r.path.length)&&(r={index:n,path:i})}return r}var U=[`innerHTML`],ce=I(y({__name:`TextMessageItem`,props:{item:{}},setup(e){let t=e,r=F(),i=k(),a=m(()=>{let e=i.selectedWorkspaceId;return e?r.documentsFor(e).map(e=>e.path):[]}),o=m(()=>re(se(ne.parse(t.item.text,{async:!1,breaks:!0,gfm:!0}),a.value),{addAttr:[`data-document-path`]}));function s(e){let t=e.target?.closest(`.document-link`);if(!t)return;e.preventDefault();let n=t.getAttribute(`data-document-path`),a=i.selectedWorkspaceId;!n||!a||r.openDocumentByPath(a,n)}return(t,r)=>(n(),h(`div`,{class:`markdown-message`,onClick:s},[_(`div`,{innerHTML:o.value},null,8,U),e.item.streaming?(n(),u(S,{key:0,size:`xs`,class:`q-ml-xs`})):f(``,!0)]))}}),[[`__scopeId`,`data-v-1b7bd8ca`]]),W={key:0,class:`text-caption text-grey-5`,style:{"font-style":`italic`}},G=[`innerHTML`],K={key:1,style:{"white-space":`pre-wrap`}},le=I(y({__name:`ThinkingItem`,props:{item:{}},setup(e){let r=e,i=m(()=>r.item.text.trim().slice(0,100)),a=m(()=>r.item.text.trim().length>0),s=m(()=>r.item.text.trim().length>100),c=m(()=>P(r.item.text));return(r,l)=>a.value?(n(),h(`div`,W,[s.value?(n(),u(ee,{key:0,dense:``,"dense-toggle":``,label:i.value,"header-class":`text-grey-5 text-caption`,style:{"font-style":`italic`}},{default:t(()=>[_(`div`,{class:`q-py-xs markdown-thinking`,innerHTML:c.value},null,8,G)]),_:1},8,[`label`])):(n(),h(`span`,K,o(e.item.text),1))])):f(``,!0)}}),[[`__scopeId`,`data-v-7f45ed94`]]);function ue(e,t){let n=e.split(`
|
|
2
2
|
`),r=t.split(`
|
|
3
3
|
`),i=n.length,a=r.length,o=Array.from({length:i+1},()=>Array(a+1).fill(0));for(let e=i-1;e>=0;e--)for(let t=a-1;t>=0;t--)n[e]===r[t]?o[e][t]=o[e+1][t+1]+1:o[e][t]=Math.max(o[e+1][t],o[e][t+1]);let s=[],c=0,l=0;for(;c<i&&l<a;)n[c]===r[l]?(s.push({type:`context`,content:n[c]}),c++,l++):o[c+1][l]>=o[c][l+1]?(s.push({type:`del`,content:n[c]}),c++):(s.push({type:`add`,content:r[l]}),l++);for(;c<i;)s.push({type:`del`,content:n[c++]});for(;l<a;)s.push({type:`add`,content:r[l++]});return s}function de(e){let t=e.split(`
|
|
4
4
|
`),n=[];for(let e of t)e.startsWith(`@@`)||e.startsWith(`+++`)||e.startsWith(`---`)||(e.startsWith(`+`)?n.push({type:`add`,content:e.slice(1)}):e.startsWith(`-`)?n.push({type:`del`,content:e.slice(1)}):e.startsWith(` `)?n.push({type:`context`,content:e.slice(1)}):e.length>0&&n.push({type:`context`,content:e}));return n}function fe(e,t){if(!t||typeof t!=`object`)return null;let n=t;if(e===`Edit`){let e=n.file_path;if(!e)return null;let t=n.old_string??``,r=n.new_string??``,i=typeof n.diff==`string`?n.diff:``;if(!t&&!r&&i.length>0){let t=de(i);return{toolName:`Edit`,filePath:e,additions:t.filter(e=>e.type===`add`).length,deletions:t.filter(e=>e.type===`del`).length,diffLines:t}}return{toolName:`Edit`,filePath:e,oldString:t,newString:r,replaceAll:n.replace_all??!1,additions:r?r.split(`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{G as e,I as t,N as n,R as r,St as i,_ as a,at as o,d as s,et as c,f as l,p as u,r as d,u as f,y as p}from"./runtime-core.esm-bundler-D_RRiKBh.js";import{t as m}from"./QBtn-CoU-UC_j.js";import{b as h,i as g,x as _}from"./index-
|
|
1
|
+
import{G as e,I as t,N as n,R as r,St as i,_ as a,at as o,d as s,et as c,f as l,p as u,r as d,u as f,y as p}from"./runtime-core.esm-bundler-D_RRiKBh.js";import{t as m}from"./QBtn-CoU-UC_j.js";import{b as h,i as g,x as _}from"./index-B-lBV8Zz.js";import{t as v}from"./render-chat-markdown-BpWIaLW6.js";import{t as y}from"./_plugin-vue_export-helper-r4mAJOHR.js";import{t as b}from"./QSpace-Crcx82On.js";import{t as x}from"./QChip-5bnjPnRz.js";import{t as S}from"./QPage-3-ah4oor.js";var C={class:`row items-center q-mb-md`},w={class:`text-h6 q-ml-sm`},T={key:0,class:`text-grey-6 text-center q-pa-lg`},E={key:1,class:`text-negative text-center q-pa-lg`},D={key:2,class:`text-grey-6 text-center q-pa-lg`},O={key:3,class:`column q-gutter-md`},k={key:0,class:`text-caption text-grey-6`},A={class:`row items-center q-mb-sm`},j={class:`text-subtitle1 text-indigo-3`,style:{"font-family":`var(--kobo-font-mono, monospace)`}},M=[`innerHTML`],N=y(p({__name:`ChangelogPage`,setup(p){let y=g(),N=c([]),P=c(``),F=c(!1),I=c(null);function L(e){return v(e)}async function R(){F.value=!0,I.value=null;try{let e=await fetch(`/api/changelog`);if(!e.ok)throw Error(`HTTP ${e.status}`);let t=await e.json();P.value=t.currentVersion??``,N.value=t.versions??[]}catch(e){I.value=e instanceof Error?e.message:String(e)}finally{F.value=!1}}return n(R),(n,c)=>(t(),s(S,{class:`q-pa-md`,style:{"max-width":`900px`,margin:`0 auto`}},{default:e(()=>[f(`div`,C,[a(m,{flat:``,dense:``,round:``,icon:`arrow_back`,onClick:c[0]||=e=>o(y).back()}),f(`div`,w,i(n.$t(`changelog.title`)),1),a(b),a(m,{flat:``,dense:``,icon:`refresh`,loading:F.value,label:n.$t(`common.refresh`),onClick:R},null,8,[`loading`,`label`])]),F.value&&N.value.length===0?(t(),u(`div`,T,i(n.$t(`common.loading`)),1)):I.value?(t(),u(`div`,E,i(I.value),1)):N.value.length===0?(t(),u(`div`,D,i(n.$t(`changelog.empty`)),1)):(t(),u(`div`,O,[P.value?(t(),u(`div`,k,i(n.$t(`changelog.currentVersion`,{version:P.value})),1)):l(``,!0),(t(!0),u(d,null,r(N.value,r=>(t(),s(h,{key:r.version,dark:``,flat:``,bordered:``},{default:e(()=>[a(_,null,{default:e(()=>[f(`div`,A,[f(`div`,j,` v`+i(r.version),1),r.version===P.value?(t(),s(x,{key:0,dense:``,size:`sm`,color:`indigo-7`,"text-color":`grey-2`,label:n.$t(`changelog.current`),class:`q-ml-sm`},null,8,[`label`])):l(``,!0)]),f(`div`,{class:`changelog-notes`,innerHTML:L(r.notes)},null,8,M)]),_:2},1024)]),_:2},1024))),128))]))]),_:1}))}}),[[`__scopeId`,`data-v-ed73d661`]]);export{N as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{F as e,b as t}from"./QIcon-BmEX2rXO.js";import{T as n,w as r}from"./notifications-
|
|
1
|
+
import{F as e,b as t}from"./QIcon-BmEX2rXO.js";import{T as n,w as r}from"./notifications-BtVr85fZ.js";function i(e){if(e===!1)return 0;if(e===!0||e===void 0)return 1;let t=parseInt(e,10);return isNaN(t)?0:t}var a=e({name:`close-popup`,beforeMount(e,{value:a}){let o={depth:i(a),handler(t){o.depth!==0&&setTimeout(()=>{let i=n(e);i!==void 0&&r(i,t,o.depth)})},handlerKey(e){t(e,13)===!0&&o.handler(e)}};e.__qclosepopup=o,e.addEventListener(`click`,o.handler),e.addEventListener(`keyup`,o.handlerKey)},updated(e,{value:t,oldValue:n}){t!==n&&(e.__qclosepopup.depth=i(t))},beforeUnmount(e){let t=e.__qclosepopup;e.removeEventListener(`click`,t.handler),e.removeEventListener(`keyup`,t.handlerKey),delete e.__qclosepopup}});export{a as t};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{D as e,E as t,G as n,I as r,N as i,P as ee,R as te,S as ne,St as a,W as o,_ as s,at as c,bt as re,d as l,et as u,f as d,g as f,l as p,p as m,r as ie,u as h,y as ae,yt as oe}from"./runtime-core.esm-bundler-D_RRiKBh.js";import{H as se,R as ce,U as g,t as _}from"./QIcon-BmEX2rXO.js";import{r as v}from"./use-id-BCnfiBjU.js";import{s as le}from"./notifications-l1Pxijve.js";import{t as y}from"./QBtn-CoU-UC_j.js";import{n as ue}from"./vue-i18n-Cq-KgjJC.js";import{t as b}from"./QInput-D0t39uK_.js";import{c as de,g as fe,i as pe,o as me}from"./index-TewFyoT4.js";import{t as he}from"./QSpinnerDots-DspFKwCZ.js";import{n as x,t as ge}from"./QItemSection-DRg-QuAD.js";import{t as S}from"./QItemLabel-Btqw0P7M.js";import{t as C}from"./QTooltip-CwBZU_bs.js";import{t as _e}from"./QExpansionItem-CiBP4NiY.js";import{t as ve}from"./_plugin-vue_export-helper-r4mAJOHR.js";import{t as ye}from"./QSpace-Crcx82On.js";import{t as be}from"./use-quasar-sypIWZgU.js";import{t as w}from"./QSelect-U9wJ7Z2A.js";import{t as xe}from"./QPage-3-ah4oor.js";import{a as Se,i as Ce,n as we,r as Te,t as Ee}from"./expand-template-D7jp6KZJ.js";import{i as De,r as Oe,t as ke}from"./permissionModes-BUhr5Wdx.js";var T=`kobo:create-page-prefs`;function Ae(){try{let e=localStorage.getItem(T);return e===null?void 0:JSON.parse(e)}catch{return}}function E(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function je(){let e=Ae();if(!E(e))return{};let t={};return typeof e.projectPath==`string`&&e.projectPath.length>0&&(t.projectPath=e.projectPath),typeof e.autoLoop==`boolean`&&(t.autoLoop=e.autoLoop),t}function Me(e){try{localStorage.setItem(T,JSON.stringify(e))}catch{}}var Ne={class:`create-inner`},Pe={class:`create-title text-center text-weight-bold q-mb-lg text-grey-3`},Fe={class:`create-card rounded-borders`},Ie={class:`card-top-bar row items-center q-px-md q-py-xs`},Le={class:`model-badge cursor-default row items-center q-gutter-xs`},Re={class:`text-indigo-3 text-weight-medium text-caption`},ze={key:0,class:`notion-url-wrap`},Be={key:0,class:`notion-error text-caption q-px-md q-pb-xs text-red-5`},Ve={key:1,class:`notion-valid text-caption q-px-md q-pb-xs text-green-4`},He={key:2,class:`notion-peek-choice q-px-md q-pb-sm`},Ue={class:`text-caption text-grey-4 q-mb-sm`},We={class:`row q-gutter-sm`},Ge={class:`peek-card-text`},Ke={class:`peek-card-title`},qe={class:`peek-card-desc`},Je={class:`peek-card-text`},Ye={class:`peek-card-title`},Xe={class:`peek-card-desc`},Ze={key:0,class:`sentry-url-wrap`},Qe={key:0,class:`sentry-error text-caption q-px-md q-pb-xs text-red-5`},$e={key:1,class:`sentry-valid text-caption q-px-md q-pb-xs text-red-4`},et={class:`card-name-wrap`},tt={class:`card-textarea-wrap`},nt={class:`row items-center justify-end q-px-sm q-pb-xs q-gutter-sm`},rt={key:0,class:`row items-center text-caption text-amber-6`},it={class:`manual-hint q-px-md q-py-sm text-caption text-grey-6`},at={class:`q-pa-sm manual-section-body`},ot={class:`row items-center q-gutter-sm q-mb-sm`},st={class:`col text-caption text-grey-4`},ct={class:`q-pa-sm manual-section-body`},lt={class:`row items-center q-gutter-sm q-mb-sm`},ut={class:`col text-caption text-grey-4`},dt={class:`card-bottom-bar`},ft={class:`row q-col-gutter-xs q-px-xs`},pt={key:0,class:`col-12 col-sm-6 col-md-3`},mt={class:`bottom-select-label row items-center no-wrap`},ht={class:`col-12 col-sm-6 col-md-3`},gt={class:`bottom-select-label row items-center no-wrap`},_t={class:`col-12 col-sm-6 col-md-3`},vt={class:`bottom-select-label row items-center no-wrap`},yt={class:`col-12 col-md-3`},bt={class:`bottom-select-label row items-center no-wrap`},xt={class:`row q-col-gutter-xs q-pa-xs col-12 items-center justify-center`},St={class:`col-12 col-md-auto`},Ct={class:`col-12 col-md-auto`},wt={class:`col-12 col-md-auto`},Tt={class:`row q-col-gutter-xs q-px-xs bottom-row-git`},Et={class:`col-12 col-md-4`},Dt={key:0,class:`col-12 col-md-4`},Ot={class:`bottom-select-label row items-center no-wrap`},kt={key:1,class:`col-12 col-md-4`},At={class:`bottom-select-label row items-center no-wrap`},jt={class:`col-12 col-md-4`},Mt={class:`bottom-select-label row items-center no-wrap`},Nt={class:`row justify-center q-px-sm q-py-sm`},Pt={class:`create-hint text-center text-body2 q-mt-md text-grey-8`},Ft=6e4,D=ve(ae({__name:`CreatePage`,setup(ae){let ve=pe(),T=be(),Ae=de(),E=le(),{t:D}=ue(),It=u([]),Lt=u(``),O=u(``),Rt=u(null),zt=u(``),k=u(!1),A=u(!1),Bt=u(null),Vt=u(null),Ht=u([]),Ut=u(null),j=u(``),M=u(!1),N=u(`claude-opus-4-8`),P=u(`auto`),F=u(``),I=u(null),L=u(`feature`),R=u(!1),Wt=p(()=>E.global.voiceEnabled),Gt=u([]),z=u(`claude-code`),Kt=p(()=>Gt.value.find(e=>e.id===z.value)),qt=p(()=>Gt.value.map(e=>({value:e.id,label:e.displayName}))),Jt=p(()=>E.global.branchPrefixes.map(e=>({label:`${e}/`,value:e}))),Yt=[`plan`,`bypass`,`strict`,`interactive`];function Xt(e,t){let n=e?E.getProjectByPath(e):void 0,r=n?.agentPermissionMode;if(typeof r==`string`&&Yt.includes(r))return r;let i=E.global.defaultPermissionModeByEngine?.[t];return typeof i==`string`&&Yt.includes(i)?i:n?.dangerouslySkipPermissions??E.global.dangerouslySkipPermissions??!0?`bypass`:t===`codex`?`plan`:`interactive`}let B=u(Xt(``,z.value)),Zt=p(()=>{switch(B.value){case`plan`:return`visibility`;case`bypass`:return`flash_on`;case`strict`:return`lock`;case`interactive`:return`security`}}),Qt=p(()=>(ke[z.value]??Yt).map(e=>({value:e,label:D(`agentPermissionMode.${e}`),disabled:e===`plan`&&X.value}))),V=u([]),$t=u([]),en=u(!1),tn=u(!1);function nn(e,t){t(()=>{$t.value=e?V.value.filter(t=>t.toLowerCase().includes(e.toLowerCase())):V.value})}let rn=fe();function an(){return Rt.value?.nativeEl??null}let{showSkills:on,selectedSkillIndex:H,groupedDropdown:sn,flatDropdown:U,fetchSkills:cn,detectSlashFragment:ln,replaceFragmentWith:un,closeDropdown:dn}=Ce(O,an,{excludeKoboCommands:!0});cn(),o(O,async()=>{await e(),await ln()});function fn(e){if(e.type===`template`){let t=rn.templates.find(t=>t.slug===e.name);if(!t)return;un(we(t.content,Ee({workspace:null,gitStats:null,sessionName:null}))),dn();return}un(`/${e.name} `),dn()}function pn(e){!on.value||U.value.length===0||(e.key===`ArrowDown`?(e.preventDefault(),H.value=(H.value+1)%U.value.length):e.key===`ArrowUp`?(e.preventDefault(),H.value=(H.value-1+U.value.length)%U.value.length):e.key===`Enter`&&!e.shiftKey&&!e.ctrlKey&&!e.metaKey?(e.preventDefault(),fn(U.value[H.value])):e.key===`Escape`&&(e.preventDefault(),dn()))}async function mn(){if(!(!Wt.value||k.value||A.value)){if(!navigator.mediaDevices?.getUserMedia||typeof MediaRecorder>`u`){T.notify({type:`warning`,message:D(`voice.notSupported`),position:`top`,timeout:4e3});return}try{let e=await navigator.mediaDevices.getUserMedia({audio:!0});Vt.value=e,Ht.value=[];let t=MediaRecorder.isTypeSupported(`audio/webm`)?`audio/webm`:``,n=t?new MediaRecorder(e,{mimeType:t}):new MediaRecorder(e);n.ondataavailable=e=>{e.data&&e.data.size>0&&Ht.value.push(e.data)},n.start(),Bt.value=n,k.value=!0,Ut.value=setTimeout(()=>{W(),T.notify({type:`info`,message:D(`voice.maxDurationReached`),position:`top`,timeout:3500})},Ft)}catch{T.notify({type:`negative`,message:D(`voice.errorMicPermission`),position:`top`,timeout:5e3})}}}async function W(){if(!k.value)return;let e=Bt.value;if(!e)return;k.value=!1,A.value=!0,Ut.value&&=(clearTimeout(Ut.value),null);let t=await new Promise(t=>{e.onstop=()=>t(new Blob(Ht.value,{type:`audio/webm`})),e.stop()});try{if(t.size===0)throw Error(`MIC_AUDIO_INVALID`);let e=new FormData;e.append(`audio`,t,`voice.webm`),e.append(`language`,E.global.voiceLanguage||`auto`);let n=await fetch(`/api/voice/transcribe`,{method:`POST`,body:e});if(!n.ok){let e=await n.json().catch(()=>({}));throw Error(String(e.code??e.error??`HTTP_${n.status}`))}let r=await n.json();r.text?.trim()&&(O.value=O.value?`${O.value.trimEnd()} ${r.text.trim()}`:r.text.trim())}catch(e){let t=e instanceof Error?e.message:`TRANSCRIPTION_FAILED`;T.notify({type:`negative`,message:D({VOICE_DISABLED:`voice.errorDisabled`,MODEL_NOT_CONFIGURED:`voice.errorModelMissing`,MODEL_NOT_INSTALLED:`voice.errorModelNotInstalled`,VOICE_RUNTIME_MISSING:`voice.errorRuntimeMissing`,MIC_AUDIO_INVALID:`voice.errorAudioInvalid`,LANGUAGE_INVALID:`voice.errorLanguageInvalid`,TRANSCRIPTION_TIMEOUT:`voice.errorTranscription`}[t]??`voice.errorTranscription`),position:`top`,timeout:5e3})}finally{Bt.value=null,Ht.value=[],Vt.value?.getTracks().forEach(e=>{e.stop()}),Vt.value=null,A.value=!1}}function hn(e){return Wt.value?E.global.voicePttKey===`ctrl+space`?e.ctrlKey&&e.code===`Space`:e.key===`Alt`:!1}function gn(e){!hn(e)||e.repeat||(e.preventDefault(),mn())}function _n(e){hn(e)&&(e.preventDefault(),W())}function vn(){k.value&&W()}function yn(){document.visibilityState!==`visible`&&k.value&&W()}let bn=p(()=>(De[z.value]??Oe).map(e=>({label:D(e.i18nLabelKey),value:e.value,description:D(e.i18nDescriptionKey)})));o(z,()=>{let e=bn.value.map(e=>e.value);if(e.length>0){let t=E.global.defaultModelByEngine?.[z.value];typeof t==`string`&&e.includes(t)?N.value=t:e.includes(N.value)||(N.value=e.includes(`auto`)?`auto`:e[0]??`auto`)}let t=ke[z.value]??[];t.length>0&&!t.includes(B.value)&&(B.value=Xt(F.value,z.value));let n=(Te[z.value]??[]).map(e=>e.value);n.length>0&&!n.includes(P.value)&&(P.value=n.includes(`auto`)?`auto`:n[0]??`auto`)});function xn(e){let t=e.indexOf(`:`);return t>=0?e.slice(t+1).trim():e}let Sn=p(()=>(Te[z.value]??Te[`claude-code`]).map(e=>({value:e.value,label:xn(D(e.i18nLabelKey)),description:D(e.i18nDescriptionKey)}))),G=p(()=>{let e=j.value.trim();return e.startsWith(`https://www.notion.so/`)||e.startsWith(`https://app.notion.com/`)}),Cn=p(()=>/[?&]p=[0-9a-f]{32}(?:[&#]|$)/i.test(j.value)),K=u(`panel`);function wn(){let e=j.value.trim();return K.value===`parent`&&Cn.value?e.replace(/([?&])p=[0-9a-f]{32}(?=[&#]|$)/i,`$1`).replace(/([?&])pm=[a-z]+(?=[&#]|$)/i,`$1`).replace(/[?&]+$/,``).replace(/\?&/,`?`):e}let q=u([]),J=u([]),Tn=u(``),En=u(``),Dn=p(()=>!M.value||!G.value);function On(){let e=Tn.value.trim();e&&(q.value.push(e),Tn.value=``)}function kn(e){q.value.splice(e,1)}function An(){let e=En.value.trim();e&&(J.value.push(e),En.value=``)}function jn(e){J.value.splice(e,1)}function Mn(){M.value=!M.value,M.value||(j.value=``)}let Y=u(!1),X=u(!1);o(()=>X.value,e=>{e&&B.value!==`bypass`&&(B.value=`bypass`,T.notify({type:`info`,message:D(`agentPermissionMode.autoLoopLocked`),timeout:4e3}))});let Z=u(``),Nn=p(()=>/\/issues\/\d+/.test(Z.value.trim()));function Pn(){Y.value=!Y.value,Y.value||(Z.value=``)}let Q=u(!1),$=u(null),Fn=u([]),In=u(!1);async function Ln(){if(!F.value.trim()){Fn.value=[];return}In.value=!0;try{Fn.value=await Ae.fetchOrphanWorktrees(F.value.trim())}catch{Fn.value=[]}finally{In.value=!1}}function Rn(){Q.value=!Q.value,Q.value?(M.value=!1,j.value=``,Y.value=!1,Z.value=``,R.value=!0,Ln()):$.value=null}o(F,()=>{$.value=null,Q.value&&Ln()}),o($,e=>{if(!e)return;let t=Fn.value.find(t=>t.path===e);t&&(I.value=t.suggestedSourceBranch),R.value=!0});async function zn(e){if(!e.trim()){V.value=[],I.value=null;return}en.value=!0;try{let t=await fetch(`/api/git/branches?path=${encodeURIComponent(e.trim())}`);if(!t.ok)throw Error(`HTTP ${t.status}`);let n=await t.json();V.value=n.local??n.branches??[],V.value.length>0&&!I.value&&(I.value=V.value[0]??null)}catch{V.value=[],I.value=null}finally{en.value=!1}}function Bn(e){let t=E.getProjectByPath(e);if(t){t.defaultSourceBranch&&(I.value=t.defaultSourceBranch);let e=t.taskPromptTemplate??``;(O.value===``||O.value===zt.value)&&(O.value=e,zt.value=e);let n=bn.value.map(e=>e.value);if(t.defaultModel&&n.includes(t.defaultModel))N.value=t.defaultModel;else{let e=E.global.defaultModelByEngine?.[z.value];typeof e==`string`&&n.includes(e)&&(N.value=e)}}B.value=Xt(e,z.value)}let Vn=null;o(F,e=>{Vn&&clearTimeout(Vn),Vn=setTimeout(()=>{I.value=null,zn(e),Bn(e)},500)});function Hn(e,t){t(()=>{It.value=E.projectPaths.filter(t=>t.toLowerCase().includes(e.toLowerCase()))})}i(async()=>{await E.fetchSettings();let e=E.global.branchPrefixes;e.length>0&&!e.includes(L.value)&&(L.value=e[0]);let t=je();t.autoLoop===!0&&(X.value=!0),t.projectPath&&E.projectPaths.includes(t.projectPath)&&(F.value=t.projectPath),B.value=Xt(F.value,z.value);try{let e=await fetch(`/api/engines`);e.ok&&(Gt.value=await e.json())}catch{}{let e=bn.value.map(e=>e.value),t=E.global.defaultModelByEngine?.[z.value];typeof t==`string`&&e.includes(t)?N.value=t:e.length>0&&!e.includes(N.value)&&(N.value=e.includes(`auto`)?`auto`:e[0]??`auto`)}window.addEventListener(`keydown`,gn),window.addEventListener(`keyup`,_n),window.addEventListener(`blur`,vn),document.addEventListener(`visibilitychange`,yn)}),ee(()=>{Vn&&clearTimeout(Vn),window.removeEventListener(`keydown`,gn),window.removeEventListener(`keyup`,_n),window.removeEventListener(`blur`,vn),document.removeEventListener(`visibilitychange`,yn),Ut.value&&=(clearTimeout(Ut.value),null),k.value&&W()});function Un(e){return e.normalize(`NFD`).replace(/[\u0300-\u036f]/g,``).toLowerCase().replace(/[^a-z0-9\s-]/g,``).trim().replace(/\s+/g,`-`).replace(/-+/g,`-`).substring(0,50)}function Wn(){return Lt.value.trim()?Lt.value.trim().substring(0,80):!M.value&&!Y.value&&O.value.trim()&&(O.value.trim().split(`
|
|
1
|
+
import{D as e,E as t,G as n,I as r,N as i,P as ee,R as te,S as ne,St as a,W as o,_ as s,at as c,bt as re,d as l,et as u,f as d,g as f,l as p,p as m,r as ie,u as h,y as ae,yt as oe}from"./runtime-core.esm-bundler-D_RRiKBh.js";import{H as se,R as ce,U as g,t as _}from"./QIcon-BmEX2rXO.js";import{r as v}from"./use-id-BCnfiBjU.js";import{s as le}from"./notifications-BtVr85fZ.js";import{t as y}from"./QBtn-CoU-UC_j.js";import{n as ue}from"./vue-i18n-Cq-KgjJC.js";import{t as b}from"./QInput-D0t39uK_.js";import{c as de,g as fe,i as pe,o as me}from"./index-B-lBV8Zz.js";import{t as he}from"./QSpinnerDots-DspFKwCZ.js";import{n as x,t as ge}from"./QItemSection-DRg-QuAD.js";import{t as S}from"./QItemLabel-Btqw0P7M.js";import{t as C}from"./QTooltip-DyIRS1GH.js";import{t as _e}from"./QExpansionItem-_8j8FyQg.js";import{t as ve}from"./_plugin-vue_export-helper-r4mAJOHR.js";import{t as ye}from"./QSpace-Crcx82On.js";import{t as be}from"./use-quasar-sypIWZgU.js";import{t as w}from"./QSelect-kWnJnHbT.js";import{t as xe}from"./QPage-3-ah4oor.js";import{a as Se,i as Ce,n as we,r as Te,t as Ee}from"./expand-template-CIu2odEp.js";import{i as De,r as Oe,t as ke}from"./permissionModes-BUhr5Wdx.js";var T=`kobo:create-page-prefs`;function Ae(){try{let e=localStorage.getItem(T);return e===null?void 0:JSON.parse(e)}catch{return}}function E(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function je(){let e=Ae();if(!E(e))return{};let t={};return typeof e.projectPath==`string`&&e.projectPath.length>0&&(t.projectPath=e.projectPath),typeof e.autoLoop==`boolean`&&(t.autoLoop=e.autoLoop),t}function Me(e){try{localStorage.setItem(T,JSON.stringify(e))}catch{}}var Ne={class:`create-inner`},Pe={class:`create-title text-center text-weight-bold q-mb-lg text-grey-3`},Fe={class:`create-card rounded-borders`},Ie={class:`card-top-bar row items-center q-px-md q-py-xs`},Le={class:`model-badge cursor-default row items-center q-gutter-xs`},Re={class:`text-indigo-3 text-weight-medium text-caption`},ze={key:0,class:`notion-url-wrap`},Be={key:0,class:`notion-error text-caption q-px-md q-pb-xs text-red-5`},Ve={key:1,class:`notion-valid text-caption q-px-md q-pb-xs text-green-4`},He={key:2,class:`notion-peek-choice q-px-md q-pb-sm`},Ue={class:`text-caption text-grey-4 q-mb-sm`},We={class:`row q-gutter-sm`},Ge={class:`peek-card-text`},Ke={class:`peek-card-title`},qe={class:`peek-card-desc`},Je={class:`peek-card-text`},Ye={class:`peek-card-title`},Xe={class:`peek-card-desc`},Ze={key:0,class:`sentry-url-wrap`},Qe={key:0,class:`sentry-error text-caption q-px-md q-pb-xs text-red-5`},$e={key:1,class:`sentry-valid text-caption q-px-md q-pb-xs text-red-4`},et={class:`card-name-wrap`},tt={class:`card-textarea-wrap`},nt={class:`row items-center justify-end q-px-sm q-pb-xs q-gutter-sm`},rt={key:0,class:`row items-center text-caption text-amber-6`},it={class:`manual-hint q-px-md q-py-sm text-caption text-grey-6`},at={class:`q-pa-sm manual-section-body`},ot={class:`row items-center q-gutter-sm q-mb-sm`},st={class:`col text-caption text-grey-4`},ct={class:`q-pa-sm manual-section-body`},lt={class:`row items-center q-gutter-sm q-mb-sm`},ut={class:`col text-caption text-grey-4`},dt={class:`card-bottom-bar`},ft={class:`row q-col-gutter-xs q-px-xs`},pt={key:0,class:`col-12 col-sm-6 col-md-3`},mt={class:`bottom-select-label row items-center no-wrap`},ht={class:`col-12 col-sm-6 col-md-3`},gt={class:`bottom-select-label row items-center no-wrap`},_t={class:`col-12 col-sm-6 col-md-3`},vt={class:`bottom-select-label row items-center no-wrap`},yt={class:`col-12 col-md-3`},bt={class:`bottom-select-label row items-center no-wrap`},xt={class:`row q-col-gutter-xs q-pa-xs col-12 items-center justify-center`},St={class:`col-12 col-md-auto`},Ct={class:`col-12 col-md-auto`},wt={class:`col-12 col-md-auto`},Tt={class:`row q-col-gutter-xs q-px-xs bottom-row-git`},Et={class:`col-12 col-md-4`},Dt={key:0,class:`col-12 col-md-4`},Ot={class:`bottom-select-label row items-center no-wrap`},kt={key:1,class:`col-12 col-md-4`},At={class:`bottom-select-label row items-center no-wrap`},jt={class:`col-12 col-md-4`},Mt={class:`bottom-select-label row items-center no-wrap`},Nt={class:`row justify-center q-px-sm q-py-sm`},Pt={class:`create-hint text-center text-body2 q-mt-md text-grey-8`},Ft=6e4,D=ve(ae({__name:`CreatePage`,setup(ae){let ve=pe(),T=be(),Ae=de(),E=le(),{t:D}=ue(),It=u([]),Lt=u(``),O=u(``),Rt=u(null),zt=u(``),k=u(!1),A=u(!1),Bt=u(null),Vt=u(null),Ht=u([]),Ut=u(null),j=u(``),M=u(!1),N=u(`claude-opus-4-8`),P=u(`auto`),F=u(``),I=u(null),L=u(`feature`),R=u(!1),Wt=p(()=>E.global.voiceEnabled),Gt=u([]),z=u(`claude-code`),Kt=p(()=>Gt.value.find(e=>e.id===z.value)),qt=p(()=>Gt.value.map(e=>({value:e.id,label:e.displayName}))),Jt=p(()=>E.global.branchPrefixes.map(e=>({label:`${e}/`,value:e}))),Yt=[`plan`,`bypass`,`strict`,`interactive`];function Xt(e,t){let n=e?E.getProjectByPath(e):void 0,r=n?.agentPermissionMode;if(typeof r==`string`&&Yt.includes(r))return r;let i=E.global.defaultPermissionModeByEngine?.[t];return typeof i==`string`&&Yt.includes(i)?i:n?.dangerouslySkipPermissions??E.global.dangerouslySkipPermissions??!0?`bypass`:t===`codex`?`plan`:`interactive`}let B=u(Xt(``,z.value)),Zt=p(()=>{switch(B.value){case`plan`:return`visibility`;case`bypass`:return`flash_on`;case`strict`:return`lock`;case`interactive`:return`security`}}),Qt=p(()=>(ke[z.value]??Yt).map(e=>({value:e,label:D(`agentPermissionMode.${e}`),disabled:e===`plan`&&X.value}))),V=u([]),$t=u([]),en=u(!1),tn=u(!1);function nn(e,t){t(()=>{$t.value=e?V.value.filter(t=>t.toLowerCase().includes(e.toLowerCase())):V.value})}let rn=fe();function an(){return Rt.value?.nativeEl??null}let{showSkills:on,selectedSkillIndex:H,groupedDropdown:sn,flatDropdown:U,fetchSkills:cn,detectSlashFragment:ln,replaceFragmentWith:un,closeDropdown:dn}=Ce(O,an,{excludeKoboCommands:!0});cn(),o(O,async()=>{await e(),await ln()});function fn(e){if(e.type===`template`){let t=rn.templates.find(t=>t.slug===e.name);if(!t)return;un(we(t.content,Ee({workspace:null,gitStats:null,sessionName:null}))),dn();return}un(`/${e.name} `),dn()}function pn(e){!on.value||U.value.length===0||(e.key===`ArrowDown`?(e.preventDefault(),H.value=(H.value+1)%U.value.length):e.key===`ArrowUp`?(e.preventDefault(),H.value=(H.value-1+U.value.length)%U.value.length):e.key===`Enter`&&!e.shiftKey&&!e.ctrlKey&&!e.metaKey?(e.preventDefault(),fn(U.value[H.value])):e.key===`Escape`&&(e.preventDefault(),dn()))}async function mn(){if(!(!Wt.value||k.value||A.value)){if(!navigator.mediaDevices?.getUserMedia||typeof MediaRecorder>`u`){T.notify({type:`warning`,message:D(`voice.notSupported`),position:`top`,timeout:4e3});return}try{let e=await navigator.mediaDevices.getUserMedia({audio:!0});Vt.value=e,Ht.value=[];let t=MediaRecorder.isTypeSupported(`audio/webm`)?`audio/webm`:``,n=t?new MediaRecorder(e,{mimeType:t}):new MediaRecorder(e);n.ondataavailable=e=>{e.data&&e.data.size>0&&Ht.value.push(e.data)},n.start(),Bt.value=n,k.value=!0,Ut.value=setTimeout(()=>{W(),T.notify({type:`info`,message:D(`voice.maxDurationReached`),position:`top`,timeout:3500})},Ft)}catch{T.notify({type:`negative`,message:D(`voice.errorMicPermission`),position:`top`,timeout:5e3})}}}async function W(){if(!k.value)return;let e=Bt.value;if(!e)return;k.value=!1,A.value=!0,Ut.value&&=(clearTimeout(Ut.value),null);let t=await new Promise(t=>{e.onstop=()=>t(new Blob(Ht.value,{type:`audio/webm`})),e.stop()});try{if(t.size===0)throw Error(`MIC_AUDIO_INVALID`);let e=new FormData;e.append(`audio`,t,`voice.webm`),e.append(`language`,E.global.voiceLanguage||`auto`);let n=await fetch(`/api/voice/transcribe`,{method:`POST`,body:e});if(!n.ok){let e=await n.json().catch(()=>({}));throw Error(String(e.code??e.error??`HTTP_${n.status}`))}let r=await n.json();r.text?.trim()&&(O.value=O.value?`${O.value.trimEnd()} ${r.text.trim()}`:r.text.trim())}catch(e){let t=e instanceof Error?e.message:`TRANSCRIPTION_FAILED`;T.notify({type:`negative`,message:D({VOICE_DISABLED:`voice.errorDisabled`,MODEL_NOT_CONFIGURED:`voice.errorModelMissing`,MODEL_NOT_INSTALLED:`voice.errorModelNotInstalled`,VOICE_RUNTIME_MISSING:`voice.errorRuntimeMissing`,MIC_AUDIO_INVALID:`voice.errorAudioInvalid`,LANGUAGE_INVALID:`voice.errorLanguageInvalid`,TRANSCRIPTION_TIMEOUT:`voice.errorTranscription`}[t]??`voice.errorTranscription`),position:`top`,timeout:5e3})}finally{Bt.value=null,Ht.value=[],Vt.value?.getTracks().forEach(e=>{e.stop()}),Vt.value=null,A.value=!1}}function hn(e){return Wt.value?E.global.voicePttKey===`ctrl+space`?e.ctrlKey&&e.code===`Space`:e.key===`Alt`:!1}function gn(e){!hn(e)||e.repeat||(e.preventDefault(),mn())}function _n(e){hn(e)&&(e.preventDefault(),W())}function vn(){k.value&&W()}function yn(){document.visibilityState!==`visible`&&k.value&&W()}let bn=p(()=>(De[z.value]??Oe).map(e=>({label:D(e.i18nLabelKey),value:e.value,description:D(e.i18nDescriptionKey)})));o(z,()=>{let e=bn.value.map(e=>e.value);if(e.length>0){let t=E.global.defaultModelByEngine?.[z.value];typeof t==`string`&&e.includes(t)?N.value=t:e.includes(N.value)||(N.value=e.includes(`auto`)?`auto`:e[0]??`auto`)}let t=ke[z.value]??[];t.length>0&&!t.includes(B.value)&&(B.value=Xt(F.value,z.value));let n=(Te[z.value]??[]).map(e=>e.value);n.length>0&&!n.includes(P.value)&&(P.value=n.includes(`auto`)?`auto`:n[0]??`auto`)});function xn(e){let t=e.indexOf(`:`);return t>=0?e.slice(t+1).trim():e}let Sn=p(()=>(Te[z.value]??Te[`claude-code`]).map(e=>({value:e.value,label:xn(D(e.i18nLabelKey)),description:D(e.i18nDescriptionKey)}))),G=p(()=>{let e=j.value.trim();return e.startsWith(`https://www.notion.so/`)||e.startsWith(`https://app.notion.com/`)}),Cn=p(()=>/[?&]p=[0-9a-f]{32}(?:[&#]|$)/i.test(j.value)),K=u(`panel`);function wn(){let e=j.value.trim();return K.value===`parent`&&Cn.value?e.replace(/([?&])p=[0-9a-f]{32}(?=[&#]|$)/i,`$1`).replace(/([?&])pm=[a-z]+(?=[&#]|$)/i,`$1`).replace(/[?&]+$/,``).replace(/\?&/,`?`):e}let q=u([]),J=u([]),Tn=u(``),En=u(``),Dn=p(()=>!M.value||!G.value);function On(){let e=Tn.value.trim();e&&(q.value.push(e),Tn.value=``)}function kn(e){q.value.splice(e,1)}function An(){let e=En.value.trim();e&&(J.value.push(e),En.value=``)}function jn(e){J.value.splice(e,1)}function Mn(){M.value=!M.value,M.value||(j.value=``)}let Y=u(!1),X=u(!1);o(()=>X.value,e=>{e&&B.value!==`bypass`&&(B.value=`bypass`,T.notify({type:`info`,message:D(`agentPermissionMode.autoLoopLocked`),timeout:4e3}))});let Z=u(``),Nn=p(()=>/\/issues\/\d+/.test(Z.value.trim()));function Pn(){Y.value=!Y.value,Y.value||(Z.value=``)}let Q=u(!1),$=u(null),Fn=u([]),In=u(!1);async function Ln(){if(!F.value.trim()){Fn.value=[];return}In.value=!0;try{Fn.value=await Ae.fetchOrphanWorktrees(F.value.trim())}catch{Fn.value=[]}finally{In.value=!1}}function Rn(){Q.value=!Q.value,Q.value?(M.value=!1,j.value=``,Y.value=!1,Z.value=``,R.value=!0,Ln()):$.value=null}o(F,()=>{$.value=null,Q.value&&Ln()}),o($,e=>{if(!e)return;let t=Fn.value.find(t=>t.path===e);t&&(I.value=t.suggestedSourceBranch),R.value=!0});async function zn(e){if(!e.trim()){V.value=[],I.value=null;return}en.value=!0;try{let t=await fetch(`/api/git/branches?path=${encodeURIComponent(e.trim())}`);if(!t.ok)throw Error(`HTTP ${t.status}`);let n=await t.json();V.value=n.local??n.branches??[],V.value.length>0&&!I.value&&(I.value=V.value[0]??null)}catch{V.value=[],I.value=null}finally{en.value=!1}}function Bn(e){let t=E.getProjectByPath(e);if(t){t.defaultSourceBranch&&(I.value=t.defaultSourceBranch);let e=t.taskPromptTemplate??``;(O.value===``||O.value===zt.value)&&(O.value=e,zt.value=e);let n=bn.value.map(e=>e.value);if(t.defaultModel&&n.includes(t.defaultModel))N.value=t.defaultModel;else{let e=E.global.defaultModelByEngine?.[z.value];typeof e==`string`&&n.includes(e)&&(N.value=e)}}B.value=Xt(e,z.value)}let Vn=null;o(F,e=>{Vn&&clearTimeout(Vn),Vn=setTimeout(()=>{I.value=null,zn(e),Bn(e)},500)});function Hn(e,t){t(()=>{It.value=E.projectPaths.filter(t=>t.toLowerCase().includes(e.toLowerCase()))})}i(async()=>{await E.fetchSettings();let e=E.global.branchPrefixes;e.length>0&&!e.includes(L.value)&&(L.value=e[0]);let t=je();t.autoLoop===!0&&(X.value=!0),t.projectPath&&E.projectPaths.includes(t.projectPath)&&(F.value=t.projectPath),B.value=Xt(F.value,z.value);try{let e=await fetch(`/api/engines`);e.ok&&(Gt.value=await e.json())}catch{}{let e=bn.value.map(e=>e.value),t=E.global.defaultModelByEngine?.[z.value];typeof t==`string`&&e.includes(t)?N.value=t:e.length>0&&!e.includes(N.value)&&(N.value=e.includes(`auto`)?`auto`:e[0]??`auto`)}window.addEventListener(`keydown`,gn),window.addEventListener(`keyup`,_n),window.addEventListener(`blur`,vn),document.addEventListener(`visibilitychange`,yn)}),ee(()=>{Vn&&clearTimeout(Vn),window.removeEventListener(`keydown`,gn),window.removeEventListener(`keyup`,_n),window.removeEventListener(`blur`,vn),document.removeEventListener(`visibilitychange`,yn),Ut.value&&=(clearTimeout(Ut.value),null),k.value&&W()});function Un(e){return e.normalize(`NFD`).replace(/[\u0300-\u036f]/g,``).toLowerCase().replace(/[^a-z0-9\s-]/g,``).trim().replace(/\s+/g,`-`).replace(/-+/g,`-`).substring(0,50)}function Wn(){return Lt.value.trim()?Lt.value.trim().substring(0,80):!M.value&&!Y.value&&O.value.trim()&&(O.value.trim().split(`
|
|
2
2
|
`)[0]??``).substring(0,80)||`workspace`}function Gn(e){let t=(e.split(`/`).pop()??``).split(`-`);t.length>1&&/^[0-9a-f]{12,}$/i.test(t[t.length-1])&&t.pop();let n=t.join(`-`).toLowerCase(),r=n.match(/tk-(\d+)/);if(r){let e=`TK-${r[1]}`,t=n.replace(/tk-\d+/i,``).replace(/-+/g,`-`).replace(/^-|-$/g,``).substring(0,40);return t?`${e}--${t}`:e}return n.substring(0,50)||`task-${Date.now()}`}function Kn(){return M.value&&!G.value?D(`createPage.validationNotionUrl`):Y.value&&!Nn.value?D(`createPage.sentryValidation`):!M.value&&!Y.value&&!O.value.trim()?D(`createPage.validationDescription`):!M.value&&!Y.value&&(!Wn()||Wn()===`workspace`)&&!Lt.value.trim()&&!O.value.trim()?D(`createPage.validationName`):F.value.trim()?I.value?null:D(`createPage.validationBranch`):D(`createPage.validationPath`)}async function qn(){let e=Kn();if(e){T.notify({type:`negative`,message:e,position:`top`});return}if(Q.value&&!$.value){T.notify({type:`negative`,message:D(`createPage.pickWorktreeRequired`),position:`top`});return}tn.value=!0;try{let e=Wn(),t;t=M.value&&G.value?Gn(wn()):e===`workspace`?`task-${Date.now()}`:Un(e);let n=`${L.value}/${t}`,r={name:e,projectPath:F.value.trim(),sourceBranch:I.value,...Q.value&&$.value?{worktreePath:$.value,skipSetupScript:!0}:{workingBranch:n},engine:z.value,model:N.value,reasoningEffort:P.value,...M.value&&G.value?{notionUrl:wn()}:{},...Y.value&&Nn.value?{sentryUrl:Z.value.trim()}:{},...Dn.value&&q.value.length>0?{tasks:q.value}:{},...Dn.value&&J.value.length>0?{acceptanceCriteria:J.value}:{},...R.value&&!Q.value?{skipSetupScript:!0}:{},...O.value.trim()?{description:O.value.trim()}:{},...X.value?{autoLoop:!0}:{},agentPermissionMode:X.value&&B.value===`plan`?`bypass`:B.value},i=await Ae.createWorkspace(r);i._branchAdjusted&&T.notify({type:`info`,message:D(`createPage.branchAdjusted`,{branch:i.workingBranch}),position:`top`,timeout:6e3}),Me({projectPath:F.value.trim(),autoLoop:X.value}),me().subscribe(i.id),Ae.selectWorkspace(i.id),ve.push({name:`workspace`,params:{id:i.id}})}catch{T.notify({type:`negative`,message:D(`createPage.errorCreating`),position:`top`})}finally{tn.value=!1}}return(e,i)=>(r(),l(xe,{class:`create-page flex flex-center column`},{default:n(()=>[h(`div`,Ne,[h(`div`,Pe,a(e.$t(`createPage.title`)),1),h(`div`,Fe,[h(`div`,Ie,[h(`span`,Le,[s(_,{name:`auto_awesome`,size:`14px`,color:`indigo-4`}),h(`span`,Re,a(Kt.value?.displayName??e.$t(`createPage.claudeCode`)),1)]),s(ye),s(y,{flat:``,dense:``,"no-caps":``,size:`sm`,color:M.value?`green-4`:`grey-5`,class:`notion-toggle-btn text-caption rounded-borders`,disable:Q.value,onClick:Mn},{default:n(()=>[s(_,{name:`description`,size:`14px`,class:`q-mr-xs`}),f(` `+a(M.value?e.$t(`createPage.notionEnabled`):e.$t(`createPage.importNotion`)),1)]),_:1},8,[`color`,`disable`]),s(y,{flat:``,dense:``,"no-caps":``,size:`sm`,color:Y.value?`red-4`:`grey-5`,class:`sentry-toggle-btn text-caption rounded-borders q-ml-sm`,disable:Q.value,onClick:Pn},{default:n(()=>[s(_,{name:`bug_report`,size:`14px`,class:`q-mr-xs`}),f(` `+a(Y.value?e.$t(`createPage.sentryEnabled`):e.$t(`createPage.importSentry`)),1)]),_:1},8,[`color`,`disable`])]),s(v,{color:`grey-9`}),s(ce,{name:`slide`},{default:n(()=>[M.value?(r(),m(`div`,ze,[s(b,{modelValue:j.value,"onUpdate:modelValue":i[0]||=e=>j.value=e,borderless:``,dense:``,placeholder:e.$t(`createPage.notionPlaceholder`),class:`notion-url-input`,"input-class":`notion-url-input-inner`},{prepend:n(()=>[s(_,{name:`link`,size:`16px`,color:G.value?`green-4`:`grey-6`},null,8,[`color`])]),_:1},8,[`modelValue`,`placeholder`]),j.value.trim()&&!G.value?(r(),m(`div`,Be,a(e.$t(`createPage.notionValidation`)),1)):d(``,!0),G.value?(r(),m(`div`,Ve,a(e.$t(`createPage.notionAutoExtract`)),1)):d(``,!0),G.value&&Cn.value?(r(),m(`div`,He,[h(`div`,Ue,[s(_,{name:`info`,size:`14px`,color:`indigo-4`,class:`q-mr-xs`}),f(` `+a(e.$t(`createPage.notionPanelChoiceLabel`)),1)]),h(`div`,We,[h(`button`,{type:`button`,class:oe([`peek-card col`,{"peek-card--active":K.value===`panel`}]),onClick:i[1]||=e=>K.value=`panel`},[s(_,{name:`article`,size:`22px`,class:`peek-card-icon`}),h(`div`,Ge,[h(`div`,Ke,a(e.$t(`createPage.notionPanelOption`)),1),h(`div`,qe,a(e.$t(`createPage.notionPanelOptionDesc`)),1)]),K.value===`panel`?(r(),l(_,{key:0,name:`check_circle`,size:`18px`,color:`indigo-4`,class:`peek-card-check`})):d(``,!0)],2),h(`button`,{type:`button`,class:oe([`peek-card col`,{"peek-card--active":K.value===`parent`}]),onClick:i[2]||=e=>K.value=`parent`},[s(_,{name:`folder_open`,size:`22px`,class:`peek-card-icon`}),h(`div`,Je,[h(`div`,Ye,a(e.$t(`createPage.notionParentOption`)),1),h(`div`,Xe,a(e.$t(`createPage.notionParentOptionDesc`)),1)]),K.value===`parent`?(r(),l(_,{key:0,name:`check_circle`,size:`18px`,color:`indigo-4`,class:`peek-card-check`})):d(``,!0)],2)])])):d(``,!0)])):d(``,!0)]),_:1}),M.value?(r(),l(v,{key:0,color:`grey-9`})):d(``,!0),s(ce,{name:`slide`},{default:n(()=>[Y.value?(r(),m(`div`,Ze,[s(b,{modelValue:Z.value,"onUpdate:modelValue":i[3]||=e=>Z.value=e,borderless:``,dense:``,placeholder:e.$t(`createPage.sentryPlaceholder`),class:`sentry-url-input`,"input-class":`sentry-url-input-inner`},{prepend:n(()=>[s(_,{name:`link`,size:`16px`,color:Nn.value?`red-4`:`grey-6`},null,8,[`color`])]),_:1},8,[`modelValue`,`placeholder`]),Z.value.trim()&&!Nn.value?(r(),m(`div`,Qe,a(e.$t(`createPage.sentryValidation`)),1)):d(``,!0),Nn.value?(r(),m(`div`,$e,a(e.$t(`createPage.sentryAutoExtract`)),1)):d(``,!0)])):d(``,!0)]),_:1}),Y.value?(r(),l(v,{key:1,color:`grey-9`})):d(``,!0),h(`div`,et,[s(b,{modelValue:Lt.value,"onUpdate:modelValue":i[4]||=e=>Lt.value=e,borderless:``,dense:``,placeholder:M.value&&G.value?e.$t(`createPage.workspaceName`):e.$t(`createPage.workspaceNamePlaceholder`),class:`name-input`,"input-class":`name-input-inner`},null,8,[`modelValue`,`placeholder`])]),s(v,{color:`grey-9`}),h(`div`,tt,[s(b,{ref_key:`descriptionRef`,ref:Rt,modelValue:O.value,"onUpdate:modelValue":i[5]||=e=>O.value=e,type:`textarea`,borderless:``,autogrow:``,rows:3,placeholder:M.value?e.$t(`createPage.instructions`):e.$t(`createPage.instructionsPlaceholder`),class:`create-textarea`,"input-class":`create-textarea-input`,onKeydown:[pn,se(g(qn,[`ctrl`]),[`enter`]),se(g(qn,[`meta`]),[`enter`])]},null,8,[`modelValue`,`placeholder`,`onKeydown`]),h(`div`,nt,[A.value?(r(),m(`div`,rt,[s(he,{size:`14px`,color:`amber-6`,class:`q-mr-xs`}),h(`span`,null,a(e.$t(`voice.transcribing`)),1)])):d(``,!0),s(y,{flat:``,dense:``,size:`sm`,icon:A.value?`hourglass_top`:k.value?`mic`:`mic_none`,color:k.value?`red-5`:A.value?`amber-6`:`grey-6`,disable:!Wt.value||A.value,class:oe({"voice-btn--recording":k.value}),onMousedown:g(mn,[`prevent`]),onMouseup:g(W,[`prevent`]),onMouseleave:g(W,[`prevent`]),onTouchstart:g(mn,[`prevent`]),onTouchend:g(W,[`prevent`])},{default:n(()=>[s(C,null,{default:n(()=>[f(a(A.value?e.$t(`voice.transcribing`):k.value?e.$t(`voice.recording`):e.$t(`voice.holdToTalk`)),1)]),_:1})]),_:1},8,[`icon`,`color`,`disable`,`class`])]),c(on)&&c(U).length>0?(r(),l(Se,{key:0,class:`create-slash-popup`,"grouped-dropdown":c(sn),"flat-dropdown":c(U),"selected-index":c(H),onSelect:fn},null,8,[`grouped-dropdown`,`flat-dropdown`,`selected-index`])):d(``,!0)]),s(v,{color:`grey-9`}),Dn.value?(r(),m(ie,{key:2},[h(`div`,it,a(e.$t(`createPage.manualHint`)),1),s(_e,{dark:``,dense:``,label:e.$t(`createPage.tasks`,{count:q.value.length}),"header-class":`text-grey-4 manual-expansion-header`,class:`manual-expansion q-mx-sm`},{default:n(()=>[h(`div`,at,[h(`div`,ot,[s(b,{modelValue:Tn.value,"onUpdate:modelValue":i[6]||=e=>Tn.value=e,dark:``,dense:``,borderless:``,placeholder:e.$t(`createPage.addTask`),class:`col manual-input`,"input-class":`manual-input-inner`,onKeydown:se(g(On,[`prevent`]),[`enter`])},null,8,[`modelValue`,`placeholder`,`onKeydown`]),s(y,{flat:``,dense:``,round:``,icon:`add`,color:`indigo-4`,disable:!Tn.value.trim(),onClick:On},{default:n(()=>[s(C,null,{default:n(()=>[f(a(e.$t(`tooltip.addTask`)),1)]),_:1})]),_:1},8,[`disable`])]),(r(!0),m(ie,null,te(q.value,(t,i)=>(r(),m(`div`,{key:`task-${i}`,class:`row items-center q-py-xs manual-item`},[h(`span`,st,a(t),1),s(y,{flat:``,dense:``,round:``,icon:`close`,size:`xs`,color:`grey-6`,onClick:e=>kn(i)},{default:n(()=>[s(C,null,{default:n(()=>[f(a(e.$t(`tooltip.removeTask`)),1)]),_:1})]),_:1},8,[`onClick`])]))),128))])]),_:1},8,[`label`]),s(_e,{dark:``,dense:``,label:e.$t(`createPage.acceptanceCriteria`,{count:J.value.length}),"header-class":`text-grey-4 manual-expansion-header`,class:`manual-expansion q-mx-sm q-mb-sm`},{default:n(()=>[h(`div`,ct,[h(`div`,lt,[s(b,{modelValue:En.value,"onUpdate:modelValue":i[7]||=e=>En.value=e,dark:``,dense:``,borderless:``,placeholder:e.$t(`createPage.addCriterion`),class:`col manual-input`,"input-class":`manual-input-inner`,onKeydown:se(g(An,[`prevent`]),[`enter`])},null,8,[`modelValue`,`placeholder`,`onKeydown`]),s(y,{flat:``,dense:``,round:``,icon:`add`,color:`indigo-4`,disable:!En.value.trim(),onClick:An},{default:n(()=>[s(C,null,{default:n(()=>[f(a(e.$t(`tooltip.addCriterion`)),1)]),_:1})]),_:1},8,[`disable`])]),(r(!0),m(ie,null,te(J.value,(t,i)=>(r(),m(`div`,{key:`crit-${i}`,class:`row items-center q-py-xs manual-item`},[h(`span`,ut,a(t),1),s(y,{flat:``,dense:``,round:``,icon:`close`,size:`xs`,color:`grey-6`,onClick:e=>jn(i)},{default:n(()=>[s(C,null,{default:n(()=>[f(a(e.$t(`tooltip.removeCriterion`)),1)]),_:1})]),_:1},8,[`onClick`])]))),128))])]),_:1},8,[`label`]),s(v,{color:`grey-9`})],64)):d(``,!0),h(`div`,dt,[h(`div`,ft,[qt.value.length>0?(r(),m(`div`,pt,[s(w,{modelValue:z.value,"onUpdate:modelValue":i[8]||=e=>z.value=e,options:qt.value,dense:``,borderless:``,class:`bottom-select rounded-borders`,"hide-dropdown-icon":``,"emit-value":``,"map-options":``,"option-value":`value`,"option-label":`label`},{selected:n(()=>[h(`span`,mt,[s(_,{name:`hub`,size:`12px`,color:`grey-5`,class:`q-mr-xs`}),f(` `+a(qt.value.find(e=>e.value===z.value)?.label??z.value)+` `,1),s(_,{name:`expand_more`,size:`12px`,color:`grey-5`})])]),default:n(()=>[s(C,null,{default:n(()=>[f(a(e.$t(`engine.select`)),1)]),_:1})]),_:1},8,[`modelValue`,`options`])])):d(``,!0),h(`div`,ht,[s(w,{modelValue:N.value,"onUpdate:modelValue":i[9]||=e=>N.value=e,options:bn.value,dense:``,borderless:``,class:`bottom-select rounded-borders model-select`,"hide-dropdown-icon":``,"emit-value":``,"map-options":``,"option-value":`value`,"option-label":`label`},{selected:n(()=>[h(`span`,gt,[f(a(bn.value.find(e=>e.value===N.value)?.label??N.value)+` `,1),s(_,{name:`expand_more`,size:`12px`,color:`grey-5`})])]),option:n(({opt:e,itemProps:r})=>[s(x,t(r,{class:`model-option`}),{default:n(()=>[s(ge,null,{default:n(()=>[s(S,{class:`text-white`},{default:n(()=>[f(a(e.label),1)]),_:2},1024),s(S,{caption:``,class:`text-grey-5`},{default:n(()=>[f(a(e.description),1)]),_:2},1024)]),_:2},1024)]),_:2},1040)]),_:1},8,[`modelValue`,`options`])]),h(`div`,_t,[s(w,{modelValue:P.value,"onUpdate:modelValue":i[10]||=e=>P.value=e,options:Sn.value,dense:``,borderless:``,class:`bottom-select rounded-borders`,"hide-dropdown-icon":``,"emit-value":``,"map-options":``,"option-value":`value`,"option-label":`label`},{selected:n(()=>[h(`span`,vt,[s(_,{name:`psychology`,size:`12px`,color:`grey-5`,class:`q-mr-xs`}),f(` `+a(Sn.value.find(e=>e.value===P.value)?.label??P.value)+` `,1),s(_,{name:`expand_more`,size:`12px`,color:`grey-5`})])]),option:n(({opt:e,itemProps:t})=>[s(x,re(ne(t)),{default:n(()=>[s(ge,null,{default:n(()=>[s(S,{class:`text-white`},{default:n(()=>[f(a(e.label),1)]),_:2},1024),s(S,{caption:``,class:`text-grey-5`},{default:n(()=>[f(a(e.description),1)]),_:2},1024)]),_:2},1024)]),_:2},1040)]),_:1},8,[`modelValue`,`options`])]),h(`div`,yt,[s(w,{modelValue:B.value,"onUpdate:modelValue":i[11]||=e=>B.value=e,options:Qt.value,disable:X.value,dense:``,borderless:``,class:`bottom-select rounded-borders`,"hide-dropdown-icon":``,"emit-value":``,"map-options":``,"option-value":`value`,"option-label":`label`,"option-disable":e=>e.disabled===!0},{selected:n(()=>[h(`span`,bt,[s(_,{name:Zt.value,size:`12px`,color:`amber-6`,class:`q-mr-xs`},null,8,[`name`]),f(` `+a(Qt.value.find(e=>e.value===B.value)?.label??B.value)+` `,1),X.value?d(``,!0):(r(),l(_,{key:0,name:`expand_more`,size:`12px`,color:`grey-5`}))])]),default:n(()=>[s(C,null,{default:n(()=>[f(a(X.value?e.$t(`agentPermissionMode.autoLoopLocked`):e.$t(`agentPermissionMode.tooltip`)),1)]),_:1})]),_:1},8,[`modelValue`,`options`,`disable`,`option-disable`])])]),h(`div`,xt,[h(`div`,St,[s(y,{flat:``,dense:``,size:`sm`,"no-caps":``,icon:X.value?`autorenew`:`sync_disabled`,color:X.value?`amber-4`:`grey-5`,label:e.$t(`autoLoop.startInMode`),class:`skip-setup-btn`,onClick:i[12]||=e=>X.value=!X.value},{default:n(()=>[s(C,null,{default:n(()=>[f(a(e.$t(`autoLoop.startInMode`)),1)]),_:1})]),_:1},8,[`icon`,`color`,`label`])]),h(`div`,Ct,[s(y,{flat:``,dense:``,size:`sm`,"no-caps":``,icon:R.value?`play_disabled`:`play_circle`,color:R.value?`orange-4`:`grey-5`,label:e.$t(`createPage.skipSetupScript`),class:`skip-setup-btn`,onClick:i[13]||=e=>R.value=!R.value},{default:n(()=>[s(C,null,{default:n(()=>[f(a(e.$t(`createPage.skipSetupScript`)),1)]),_:1})]),_:1},8,[`icon`,`color`,`label`])]),h(`div`,wt,[s(y,{flat:``,dense:``,size:`sm`,"no-caps":``,icon:`folder_open`,color:Q.value?`cyan-4`:`grey-5`,label:Q.value?e.$t(`createPage.attachWorktreeEnabled`):e.$t(`createPage.attachWorktreeToggle`),class:`skip-setup-btn`,onClick:Rn},null,8,[`color`,`label`])])]),h(`div`,Tt,[h(`div`,Et,[s(w,{modelValue:F.value,"onUpdate:modelValue":i[14]||=e=>F.value=e,options:It.value,dense:``,borderless:``,"use-input":``,"fill-input":``,"hide-selected":``,"input-debounce":`0`,"new-value-mode":`add`,class:`bottom-select rounded-borders repo-select`,"hide-dropdown-icon":``,"input-class":F.value?``:`repo-input-empty`,placeholder:e.$t(`createPage.projectPath`),behavior:c(E).projectPaths.length>0?`menu`:`dialog`,onFilter:Hn,onInputValue:i[15]||=e=>{F.value=e}},{prepend:n(()=>[s(_,{name:`folder`,size:`14px`,color:`grey-5`})]),"no-option":n(()=>[s(x,null,{default:n(()=>[s(ge,{class:`text-grey-6 text-caption`},{default:n(()=>[f(a(e.$t(`createPage.enterPath`)),1)]),_:1})]),_:1})]),_:1},8,[`modelValue`,`options`,`input-class`,`placeholder`,`behavior`])]),Q.value?d(``,!0):(r(),m(`div`,Dt,[s(w,{modelValue:L.value,"onUpdate:modelValue":i[16]||=e=>L.value=e,options:Jt.value,"emit-value":``,"map-options":``,dense:``,borderless:``,class:`bottom-select rounded-borders branch-type-select`,"hide-dropdown-icon":``},{selected:n(()=>[h(`span`,Ot,[s(_,{name:`account_tree`,size:`12px`,color:`grey-5`,class:`q-mr-xs`}),f(` `+a(L.value)+`/ `,1),s(_,{name:`expand_more`,size:`12px`,color:`grey-5`})])]),default:n(()=>[s(C,null,{default:n(()=>[f(a(e.$t(`createPage.branchType`)),1)]),_:1})]),_:1},8,[`modelValue`,`options`])])),Q.value?(r(),m(`div`,kt,[s(w,{modelValue:$.value,"onUpdate:modelValue":i[17]||=e=>$.value=e,options:Fn.value,"option-label":`branch`,"option-value":`path`,"emit-value":``,"map-options":``,"use-input":``,dense:``,borderless:``,class:`bottom-select rounded-borders worktree-select`,"hide-dropdown-icon":``,loading:In.value,disable:!F.value.trim()||In.value},{selected:n(()=>[h(`span`,At,[s(_,{name:`folder_open`,size:`12px`,color:`cyan-5`,class:`q-mr-xs`}),f(` `+a($.value?Fn.value.find(e=>e.path===$.value)?.branch??$.value:e.$t(`createPage.worktreePickerLabel`))+` `,1),s(_,{name:`expand_more`,size:`12px`,color:`grey-5`})])]),option:n(e=>[s(x,re(ne(e.itemProps)),{default:n(()=>[s(ge,null,{default:n(()=>[s(S,null,{default:n(()=>[f(a(e.opt.branch),1)]),_:2},1024),s(S,{caption:``},{default:n(()=>[f(a(e.opt.path),1)]),_:2},1024)]),_:2},1024)]),_:2},1040)]),"no-option":n(()=>[s(x,null,{default:n(()=>[s(ge,{class:`text-grey-6 text-caption`},{default:n(()=>[f(a(F.value.trim()?e.$t(`createPage.noOrphanWorktrees`):e.$t(`createPage.enterPath`)),1)]),_:1})]),_:1})]),_:1},8,[`modelValue`,`options`,`loading`,`disable`])])):d(``,!0),h(`div`,jt,[s(w,{modelValue:I.value,"onUpdate:modelValue":i[18]||=e=>I.value=e,options:$t.value,dense:``,borderless:``,class:`bottom-select rounded-borders branch-select`,"hide-dropdown-icon":``,"use-input":``,"input-debounce":`0`,loading:en.value,disable:!F.value.trim()||en.value,onFilter:nn},{selected:n(()=>[h(`span`,Mt,[s(_,{name:`call_split`,size:`12px`,color:`grey-5`,class:`q-mr-xs`}),f(` `+a(I.value??e.$t(`createPage.branch`))+` `,1),s(_,{name:`expand_more`,size:`12px`,color:`grey-5`})])]),"no-option":n(()=>[s(x,null,{default:n(()=>[s(ge,{class:`text-grey-6 text-caption`},{default:n(()=>[f(a(F.value.trim()?e.$t(`createPage.noBranches`):e.$t(`createPage.enterPath`)),1)]),_:1})]),_:1})]),_:1},8,[`modelValue`,`options`,`loading`,`disable`])])])]),h(`div`,Nt,[s(y,{label:e.$t(`createPage.create`),"no-caps":``,unelevated:``,class:`create-btn text-weight-bold rounded-borders`,loading:tn.value,disable:tn.value||Q.value&&!$.value,onClick:qn},null,8,[`label`,`loading`,`disable`])])]),h(`div`,Pt,a(M.value?e.$t(`createPage.notionExtractHint`):e.$t(`createPage.notionImportHint`)),1)])]),_:1}))}}),[[`__scopeId`,`data-v-515045d6`]]);export{D as default};
|