@orbit-build/cli 0.8.0 → 0.8.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/index.js +124 -33
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -276738,23 +276738,39 @@ var WEB_UI_CLIENT_BINDINGS_SCRIPT = String.raw` elements.composer.addEventListe
|
|
|
276738
276738
|
elements.projectPathInput.focus();
|
|
276739
276739
|
elements.projectPathInput.select();
|
|
276740
276740
|
};
|
|
276741
|
-
const
|
|
276741
|
+
const reserveProjectTab = () => {
|
|
276742
|
+
const projectTab = window.open('about:blank', '_blank');
|
|
276743
|
+
if (projectTab) projectTab.opener = null;
|
|
276744
|
+
return projectTab;
|
|
276745
|
+
};
|
|
276746
|
+
const closeReservedProjectTab = (projectTab) => {
|
|
276747
|
+
if (projectTab && !projectTab.closed) projectTab.close();
|
|
276748
|
+
};
|
|
276749
|
+
const switchToProject = (result, projectTab) => {
|
|
276742
276750
|
if (!result || typeof result.url !== 'string') {
|
|
276751
|
+
closeReservedProjectTab(projectTab);
|
|
276743
276752
|
throw new Error(copy.projectSwitchFailed);
|
|
276744
276753
|
}
|
|
276745
|
-
const
|
|
276746
|
-
const token = new URLSearchParams(
|
|
276754
|
+
const projectUrl = new URL(result.url);
|
|
276755
|
+
const token = new URLSearchParams(projectUrl.hash.slice(1)).get('token');
|
|
276747
276756
|
if (
|
|
276748
|
-
|
|
276749
|
-
!['127.0.0.1', '::1', 'localhost'].includes(
|
|
276750
|
-
|
|
276751
|
-
|
|
276757
|
+
projectUrl.protocol !== 'http:' ||
|
|
276758
|
+
!['127.0.0.1', '::1', 'localhost'].includes(projectUrl.hostname) ||
|
|
276759
|
+
projectUrl.username ||
|
|
276760
|
+
projectUrl.password ||
|
|
276752
276761
|
!token ||
|
|
276753
276762
|
!/^[A-Za-z0-9_-]{32,128}$/.test(token)
|
|
276754
276763
|
) {
|
|
276764
|
+
closeReservedProjectTab(projectTab);
|
|
276755
276765
|
throw new Error(copy.projectSwitchFailed);
|
|
276756
276766
|
}
|
|
276757
|
-
|
|
276767
|
+
if (projectTab && !projectTab.closed) {
|
|
276768
|
+
projectTab.location.replace(projectUrl.href);
|
|
276769
|
+
projectTab.focus();
|
|
276770
|
+
showToast(copy.projectOpened, 'success');
|
|
276771
|
+
return;
|
|
276772
|
+
}
|
|
276773
|
+
window.location.assign(projectUrl.href);
|
|
276758
276774
|
};
|
|
276759
276775
|
const launchProject = async (action, selectedPath) => {
|
|
276760
276776
|
const path = String(selectedPath || elements.projectPathInput.value).trim();
|
|
@@ -276764,10 +276780,16 @@ var WEB_UI_CLIENT_BINDINGS_SCRIPT = String.raw` elements.composer.addEventListe
|
|
|
276764
276780
|
return;
|
|
276765
276781
|
}
|
|
276766
276782
|
if (elements.projectDialogOpen.disabled) return;
|
|
276783
|
+
const projectTab = reserveProjectTab();
|
|
276784
|
+
const pendingButton = action === 'create' ? elements.projectDialogCreate : elements.projectDialogOpen;
|
|
276785
|
+
const pendingLabel = action === 'create' ? copy.projectCreating : copy.projectOpening;
|
|
276786
|
+
const originalLabel = pendingButton.textContent;
|
|
276767
276787
|
elements.projectDialogBrowse.disabled = true;
|
|
276768
276788
|
elements.projectDialogOpen.disabled = true;
|
|
276769
276789
|
elements.projectDialogCreate.disabled = true;
|
|
276770
|
-
|
|
276790
|
+
pendingButton.textContent = pendingLabel;
|
|
276791
|
+
pendingButton.setAttribute('aria-busy', 'true');
|
|
276792
|
+
showToast(pendingLabel);
|
|
276771
276793
|
try {
|
|
276772
276794
|
const result = await api('/api/project', {
|
|
276773
276795
|
method: 'POST',
|
|
@@ -276776,10 +276798,13 @@ var WEB_UI_CLIENT_BINDINGS_SCRIPT = String.raw` elements.composer.addEventListe
|
|
|
276776
276798
|
});
|
|
276777
276799
|
closeProjectDialog(false);
|
|
276778
276800
|
elements.projectPathInput.value = '';
|
|
276779
|
-
switchToProject(result);
|
|
276801
|
+
switchToProject(result, projectTab);
|
|
276780
276802
|
} catch (error) {
|
|
276803
|
+
closeReservedProjectTab(projectTab);
|
|
276781
276804
|
showToast(error.message || String(error), 'error');
|
|
276782
276805
|
} finally {
|
|
276806
|
+
pendingButton.textContent = originalLabel;
|
|
276807
|
+
pendingButton.removeAttribute('aria-busy');
|
|
276783
276808
|
elements.projectDialogBrowse.disabled = false;
|
|
276784
276809
|
elements.projectDialogOpen.disabled = false;
|
|
276785
276810
|
elements.projectDialogCreate.disabled = false;
|
|
@@ -276849,15 +276874,19 @@ var WEB_UI_CLIENT_BINDINGS_SCRIPT = String.raw` elements.composer.addEventListe
|
|
|
276849
276874
|
const button = event.target.closest('[data-project-path]');
|
|
276850
276875
|
if (!button || button.disabled || state.busy) return;
|
|
276851
276876
|
state.busy = true;
|
|
276877
|
+
const projectTab = reserveProjectTab();
|
|
276852
276878
|
button.classList.add('is-switching');
|
|
276853
276879
|
button.setAttribute('aria-busy', 'true');
|
|
276854
|
-
showToast(copy.
|
|
276880
|
+
showToast(copy.projectOpening);
|
|
276855
276881
|
api('/api/project', {
|
|
276856
276882
|
method: 'POST',
|
|
276857
276883
|
headers: { 'Content-Type': 'application/json' },
|
|
276858
276884
|
body: JSON.stringify({ action: 'open', path: button.dataset.projectPath || '' }),
|
|
276859
|
-
}).then(switchToProject)
|
|
276860
|
-
.catch((error) =>
|
|
276885
|
+
}).then((result) => switchToProject(result, projectTab))
|
|
276886
|
+
.catch((error) => {
|
|
276887
|
+
closeReservedProjectTab(projectTab);
|
|
276888
|
+
showToast(error.message || String(error), 'error');
|
|
276889
|
+
})
|
|
276861
276890
|
.finally(() => {
|
|
276862
276891
|
state.busy = false;
|
|
276863
276892
|
button.classList.remove('is-switching');
|
|
@@ -278118,8 +278147,10 @@ var WEB_UI_CLIENT_FOUNDATION_SCRIPT = String.raw` const byId = (id) => document
|
|
|
278118
278147
|
sessionArchived: '对话已归档',
|
|
278119
278148
|
sessionRestored: '对话已恢复',
|
|
278120
278149
|
sessionDeleted: '对话已删除',
|
|
278121
|
-
|
|
278122
|
-
|
|
278150
|
+
projectOpening: '正在新标签页打开项目…',
|
|
278151
|
+
projectCreating: '正在创建项目并打开新标签页…',
|
|
278152
|
+
projectOpened: '项目已在新标签页中打开',
|
|
278153
|
+
projectSwitchFailed: '项目已启动,但无法安全打开页面',
|
|
278123
278154
|
projectRemoved: '项目已从 Orbit 移除,磁盘文件未删除',
|
|
278124
278155
|
removeProject: '从 Orbit 移除项目',
|
|
278125
278156
|
confirmRemoveProject: '再次点击确认移除',
|
|
@@ -278268,8 +278299,10 @@ var WEB_UI_CLIENT_FOUNDATION_SCRIPT = String.raw` const byId = (id) => document
|
|
|
278268
278299
|
sessionArchived: 'Chat archived',
|
|
278269
278300
|
sessionRestored: 'Chat restored',
|
|
278270
278301
|
sessionDeleted: 'Chat deleted',
|
|
278271
|
-
|
|
278272
|
-
|
|
278302
|
+
projectOpening: 'Opening project in a new tab…',
|
|
278303
|
+
projectCreating: 'Creating project and opening a new tab…',
|
|
278304
|
+
projectOpened: 'Project opened in a new tab',
|
|
278305
|
+
projectSwitchFailed: 'The project started, but Orbit could not open it safely',
|
|
278273
278306
|
projectRemoved: 'Project removed from Orbit; files were not deleted',
|
|
278274
278307
|
removeProject: 'Remove project from Orbit',
|
|
278275
278308
|
confirmRemoveProject: 'Click again to confirm removal',
|
|
@@ -278382,7 +278415,10 @@ var WEB_UI_CLIENT_FOUNDATION_SCRIPT = String.raw` const byId = (id) => document
|
|
|
278382
278415
|
sessionArchived: '對話已封存',
|
|
278383
278416
|
sessionRestored: '對話已復原',
|
|
278384
278417
|
sessionDeleted: '對話已刪除',
|
|
278385
|
-
|
|
278418
|
+
projectOpening: '正在新分頁開啟專案…',
|
|
278419
|
+
projectCreating: '正在建立專案並開啟新分頁…',
|
|
278420
|
+
projectOpened: '專案已在新分頁中開啟',
|
|
278421
|
+
projectSwitchFailed: '專案已啟動,但無法安全開啟頁面',
|
|
278386
278422
|
projectRemoved: '專案已從 Orbit 移除,磁碟檔案未刪除',
|
|
278387
278423
|
removeProject: '從 Orbit 移除專案',
|
|
278388
278424
|
archiveSession: '封存',
|
|
@@ -283675,7 +283711,7 @@ var BASE_COPY = {
|
|
|
283675
283711
|
recentProjects: "Recent projects",
|
|
283676
283712
|
newProject: "New project",
|
|
283677
283713
|
projectDialogTitle: "Open or create a project",
|
|
283678
|
-
projectDialogBody: "Choose an existing folder, or enter the absolute path of a new folder. Orbit opens it in a separate local tab with its own chats and context.",
|
|
283714
|
+
projectDialogBody: "Choose an existing folder, or enter the absolute path of a new folder whose parent already exists. Orbit opens it in a separate local browser tab with its own chats and context.",
|
|
283679
283715
|
projectPath: "Project folder path",
|
|
283680
283716
|
projectPathPlaceholder: "C:\\path\\to\\project",
|
|
283681
283717
|
browseProject: "Browse folders",
|
|
@@ -283856,7 +283892,7 @@ var BASE_COPY = {
|
|
|
283856
283892
|
recentProjects: "\u6700\u8FD1\u9879\u76EE",
|
|
283857
283893
|
newProject: "\u65B0\u5EFA\u9879\u76EE",
|
|
283858
283894
|
projectDialogTitle: "\u6253\u5F00\u6216\u521B\u5EFA\u9879\u76EE",
|
|
283859
|
-
projectDialogBody: "\u6D4F\u89C8\u9009\u62E9\u5DF2\u6709\u6587\u4EF6\u5939\uFF0C\u6216\u8F93\u5165\u65B0\u6587\u4EF6\u5939\
|
|
283895
|
+
projectDialogBody: "\u6D4F\u89C8\u9009\u62E9\u5DF2\u6709\u6587\u4EF6\u5939\uFF0C\u6216\u8F93\u5165\u7236\u76EE\u5F55\u5DF2\u5B58\u5728\u7684\u65B0\u6587\u4EF6\u5939\u7EDD\u5BF9\u8DEF\u5F84\u3002Orbit \u4F1A\u5728\u72EC\u7ACB\u7684\u672C\u5730\u6D4F\u89C8\u5668\u6807\u7B7E\u9875\u4E2D\u6253\u5F00\uFF0C\u5E76\u4FDD\u7559\u81EA\u5DF1\u7684\u804A\u5929\u548C\u4E0A\u4E0B\u6587\u3002",
|
|
283860
283896
|
projectPath: "\u9879\u76EE\u6587\u4EF6\u5939\u8DEF\u5F84",
|
|
283861
283897
|
projectPathPlaceholder: "C:\\\u8DEF\u5F84\\\u9879\u76EE\u540D\u79F0",
|
|
283862
283898
|
browseProject: "\u6D4F\u89C8\u6587\u4EF6\u5939",
|
|
@@ -284041,7 +284077,7 @@ var COPY = {
|
|
|
284041
284077
|
recentProjects: "\u6700\u8FD1\u5C08\u6848",
|
|
284042
284078
|
newProject: "\u65B0\u589E\u5C08\u6848",
|
|
284043
284079
|
projectDialogTitle: "\u958B\u555F\u6216\u5EFA\u7ACB\u5C08\u6848",
|
|
284044
|
-
projectDialogBody: "\u700F\u89BD\u9078\u64C7\u73FE\u6709\u8CC7\u6599\u593E\uFF0C\u6216\u8F38\u5165\
|
|
284080
|
+
projectDialogBody: "\u700F\u89BD\u9078\u64C7\u73FE\u6709\u8CC7\u6599\u593E\uFF0C\u6216\u8F38\u5165\u7236\u8CC7\u6599\u593E\u5DF2\u5B58\u5728\u7684\u65B0\u8CC7\u6599\u593E\u7D55\u5C0D\u8DEF\u5F91\u3002Orbit \u6703\u5728\u7368\u7ACB\u7684\u672C\u6A5F\u700F\u89BD\u5668\u5206\u9801\u958B\u555F\uFF0C\u4E26\u4FDD\u7559\u81EA\u5DF1\u7684\u804A\u5929\u548C\u4E0A\u4E0B\u6587\u3002",
|
|
284045
284081
|
projectPath: "\u5C08\u6848\u8CC7\u6599\u593E\u8DEF\u5F91",
|
|
284046
284082
|
browseProject: "\u700F\u89BD\u8CC7\u6599\u593E",
|
|
284047
284083
|
openProject: "\u958B\u555F\u8CC7\u6599\u593E",
|
|
@@ -284361,7 +284397,7 @@ function renderWebUiPage(language) {
|
|
|
284361
284397
|
<span class="project-chat-count" id="projectChatCount" aria-label="0">0</span>
|
|
284362
284398
|
<span class="project-toggle-chevron">${renderUiIcon("down")}</span>
|
|
284363
284399
|
</button>
|
|
284364
|
-
<div class="project-chat-body" id="projectChatBody">
|
|
284400
|
+
<div class="project-chat-body" id="projectChatBody" role="region" aria-label="${copy.recentTasks}" tabindex="0">
|
|
284365
284401
|
<section class="recent-section" id="recentSection" aria-labelledby="recentHeading">
|
|
284366
284402
|
<div class="nav-section-heading session-section-heading" id="recentHeading">
|
|
284367
284403
|
<span>${copy.recentTasks}</span><i></i>
|
|
@@ -284388,7 +284424,7 @@ function renderWebUiPage(language) {
|
|
|
284388
284424
|
|
|
284389
284425
|
<section class="recent-projects-shell" id="recentProjectsShell" aria-label="${copy.recentProjects}" hidden>
|
|
284390
284426
|
<div class="project-list-label">${copy.recentProjects}</div>
|
|
284391
|
-
<div class="project-list" id="projectList"></div>
|
|
284427
|
+
<div class="project-list" id="projectList" role="region" aria-label="${copy.recentProjects}" tabindex="0"></div>
|
|
284392
284428
|
</section>
|
|
284393
284429
|
|
|
284394
284430
|
<div class="sidebar-spacer"></div>
|
|
@@ -286017,14 +286053,12 @@ var WEB_UI_CONVERSATION_STYLES = String.raw`
|
|
|
286017
286053
|
}
|
|
286018
286054
|
|
|
286019
286055
|
.message-scroll::-webkit-scrollbar,
|
|
286020
|
-
.inspector-content::-webkit-scrollbar
|
|
286021
|
-
.sidebar::-webkit-scrollbar {
|
|
286056
|
+
.inspector-content::-webkit-scrollbar {
|
|
286022
286057
|
width: 9px;
|
|
286023
286058
|
}
|
|
286024
286059
|
|
|
286025
286060
|
.message-scroll::-webkit-scrollbar-thumb,
|
|
286026
|
-
.inspector-content::-webkit-scrollbar-thumb
|
|
286027
|
-
.sidebar::-webkit-scrollbar-thumb {
|
|
286061
|
+
.inspector-content::-webkit-scrollbar-thumb {
|
|
286028
286062
|
background: color-mix(in srgb, var(--faint) 48%, transparent);
|
|
286029
286063
|
border: 3px solid transparent;
|
|
286030
286064
|
border-radius: 9px;
|
|
@@ -290057,10 +290091,7 @@ var WEB_UI_SHELL_STYLES = String.raw`
|
|
|
290057
290091
|
flex-direction: column;
|
|
290058
290092
|
gap: 9px;
|
|
290059
290093
|
padding: 12px 13px;
|
|
290060
|
-
overflow
|
|
290061
|
-
overflow-y: auto;
|
|
290062
|
-
overscroll-behavior: contain;
|
|
290063
|
-
scrollbar-gutter: stable;
|
|
290094
|
+
overflow: hidden;
|
|
290064
290095
|
color: var(--sidebar-ink);
|
|
290065
290096
|
background: transparent;
|
|
290066
290097
|
border-right: 0;
|
|
@@ -290326,7 +290357,10 @@ var WEB_UI_SHELL_STYLES = String.raw`
|
|
|
290326
290357
|
|
|
290327
290358
|
.project-section {
|
|
290328
290359
|
min-width: 0;
|
|
290360
|
+
min-height: 148px;
|
|
290329
290361
|
display: grid;
|
|
290362
|
+
grid-template-rows: auto minmax(0, 1fr);
|
|
290363
|
+
flex: 1 1 280px;
|
|
290330
290364
|
overflow: hidden;
|
|
290331
290365
|
background: color-mix(in srgb, var(--sidebar-surface) 44%, transparent);
|
|
290332
290366
|
border: 1px solid var(--sidebar-border);
|
|
@@ -290335,7 +290369,11 @@ var WEB_UI_SHELL_STYLES = String.raw`
|
|
|
290335
290369
|
|
|
290336
290370
|
.recent-projects-shell {
|
|
290337
290371
|
min-width: 0;
|
|
290372
|
+
min-height: 0;
|
|
290373
|
+
max-height: min(196px, 26dvh);
|
|
290338
290374
|
display: grid;
|
|
290375
|
+
grid-template-rows: auto minmax(0, 1fr);
|
|
290376
|
+
flex: 0 1 auto;
|
|
290339
290377
|
gap: 3px;
|
|
290340
290378
|
margin: 12px 4px 0;
|
|
290341
290379
|
padding-top: 10px;
|
|
@@ -290356,8 +290394,14 @@ var WEB_UI_SHELL_STYLES = String.raw`
|
|
|
290356
290394
|
|
|
290357
290395
|
.project-list {
|
|
290358
290396
|
min-width: 0;
|
|
290397
|
+
min-height: 0;
|
|
290359
290398
|
display: grid;
|
|
290399
|
+
align-content: start;
|
|
290360
290400
|
gap: 6px;
|
|
290401
|
+
overflow-x: hidden;
|
|
290402
|
+
overflow-y: auto;
|
|
290403
|
+
overscroll-behavior: contain;
|
|
290404
|
+
scrollbar-gutter: stable;
|
|
290361
290405
|
}
|
|
290362
290406
|
|
|
290363
290407
|
.registered-project {
|
|
@@ -290540,10 +290584,56 @@ var WEB_UI_SHELL_STYLES = String.raw`
|
|
|
290540
290584
|
|
|
290541
290585
|
.project-chat-body {
|
|
290542
290586
|
min-width: 0;
|
|
290587
|
+
min-height: 0;
|
|
290543
290588
|
padding: 0 5px 5px;
|
|
290589
|
+
overflow-x: hidden;
|
|
290590
|
+
overflow-y: auto;
|
|
290591
|
+
overscroll-behavior: contain;
|
|
290592
|
+
scrollbar-gutter: stable;
|
|
290544
290593
|
border-top: 1px solid color-mix(in srgb, var(--sidebar-border) 70%, transparent);
|
|
290545
290594
|
}
|
|
290546
290595
|
|
|
290596
|
+
.project-chat-body,
|
|
290597
|
+
.project-list {
|
|
290598
|
+
scrollbar-width: thin;
|
|
290599
|
+
scrollbar-color: color-mix(in srgb, var(--accent) 42%, var(--sidebar-faint)) color-mix(in srgb, var(--sidebar-border) 36%, transparent);
|
|
290600
|
+
}
|
|
290601
|
+
|
|
290602
|
+
.project-chat-body:focus-visible,
|
|
290603
|
+
.project-list:focus-visible {
|
|
290604
|
+
outline: 2px solid color-mix(in srgb, var(--accent) 58%, transparent);
|
|
290605
|
+
outline-offset: -2px;
|
|
290606
|
+
border-radius: 0 0 11px 11px;
|
|
290607
|
+
}
|
|
290608
|
+
|
|
290609
|
+
.project-chat-body::-webkit-scrollbar,
|
|
290610
|
+
.project-list::-webkit-scrollbar {
|
|
290611
|
+
width: 9px;
|
|
290612
|
+
}
|
|
290613
|
+
|
|
290614
|
+
.project-chat-body::-webkit-scrollbar-track,
|
|
290615
|
+
.project-list::-webkit-scrollbar-track {
|
|
290616
|
+
background: color-mix(in srgb, var(--sidebar-border) 36%, transparent);
|
|
290617
|
+
border-radius: 999px;
|
|
290618
|
+
}
|
|
290619
|
+
|
|
290620
|
+
.project-chat-body::-webkit-scrollbar-thumb,
|
|
290621
|
+
.project-list::-webkit-scrollbar-thumb {
|
|
290622
|
+
min-height: 34px;
|
|
290623
|
+
background: color-mix(in srgb, var(--accent) 42%, var(--sidebar-faint));
|
|
290624
|
+
border: 2px solid transparent;
|
|
290625
|
+
border-radius: 999px;
|
|
290626
|
+
background-clip: padding-box;
|
|
290627
|
+
}
|
|
290628
|
+
|
|
290629
|
+
.project-chat-body:hover::-webkit-scrollbar-thumb,
|
|
290630
|
+
.project-chat-body:focus-within::-webkit-scrollbar-thumb,
|
|
290631
|
+
.project-list:hover::-webkit-scrollbar-thumb,
|
|
290632
|
+
.project-list:focus-within::-webkit-scrollbar-thumb {
|
|
290633
|
+
background: color-mix(in srgb, var(--accent) 48%, var(--sidebar-faint));
|
|
290634
|
+
background-clip: padding-box;
|
|
290635
|
+
}
|
|
290636
|
+
|
|
290547
290637
|
.project-chat-body[hidden] {
|
|
290548
290638
|
display: none;
|
|
290549
290639
|
}
|
|
@@ -290552,6 +290642,7 @@ var WEB_UI_SHELL_STYLES = String.raw`
|
|
|
290552
290642
|
min-height: 0;
|
|
290553
290643
|
display: grid;
|
|
290554
290644
|
grid-template-rows: auto auto minmax(0, auto) auto auto auto;
|
|
290645
|
+
align-content: start;
|
|
290555
290646
|
margin-top: 2px;
|
|
290556
290647
|
}
|
|
290557
290648
|
|
|
@@ -290850,8 +290941,8 @@ var WEB_UI_SHELL_STYLES = String.raw`
|
|
|
290850
290941
|
}
|
|
290851
290942
|
|
|
290852
290943
|
.sidebar-spacer {
|
|
290853
|
-
min-height:
|
|
290854
|
-
flex:
|
|
290944
|
+
min-height: 4px;
|
|
290945
|
+
flex: 0 0 4px;
|
|
290855
290946
|
}
|
|
290856
290947
|
|
|
290857
290948
|
.workspace-view {
|