orc-ai 0.1.63 → 0.1.64
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/README.md +3 -2
- package/dist/index.js +897 -803
- package/dist/skills/orc-platform/SKILL.md +1 -1
- package/dist/skills/orc-platform/references/html-kit.md +154 -0
- package/dist/skills/orc-platform/references/scratchpads.md +6 -2
- package/dist/web/assets/{Agents-DmrIiUAL.js → Agents-G5dt5_s6.js} +2 -2
- package/dist/web/assets/Audit-De9E5Tfd.js +1 -0
- package/dist/web/assets/ChatUiRenderer-B1D3eTfy.js +4 -0
- package/dist/web/assets/ConfirmDialog-Cp1PcD4R.js +1 -0
- package/dist/web/assets/{Dashboard-Dh9P-zTd.js → Dashboard-DWorNfLX.js} +1 -1
- package/dist/web/assets/DocumentWorkspace-DZI0NvGD.js +1 -0
- package/dist/web/assets/FileEditor-CarhD1G9.js +1 -0
- package/dist/web/assets/{IntegrationCallback-CUZ5N-88.js → IntegrationCallback-CuUd_OOy.js} +1 -1
- package/dist/web/assets/JobWebhooks-8emXf4c1.js +1 -0
- package/dist/web/assets/Jobs-ComQ_dFU.js +3 -0
- package/dist/web/assets/Knowledge-Cm2ZVDRs.js +1 -0
- package/dist/web/assets/{MarkdownRenderer-fsBqw-wB.js → MarkdownRenderer-CHALCapQ.js} +5 -5
- package/dist/web/assets/{NativeFolderField-BuHwey26.js → NativeFolderField-CdaIEZa-.js} +1 -1
- package/dist/web/assets/PackageCatalog-CcPUM8f8.js +8 -0
- package/dist/web/assets/{PackageRunDialog-C8m43ZhJ.js → PackageRunDialog-DV1E6WX3.js} +19 -19
- package/dist/web/assets/{Pager-Dbs7fj3d.js → Pager-DZtibAkl.js} +1 -1
- package/dist/web/assets/Projects-BxrWujMD.js +3 -0
- package/dist/web/assets/{ResponsiveFilters-HzhzzjyL.js → ResponsiveFilters-C3siPRT-.js} +1 -1
- package/dist/web/assets/{ResumeActions-e6YpUhEq.js → ResumeActions-0eJvpGmW.js} +1 -1
- package/dist/web/assets/Rules-CHdgAIUd.js +18 -0
- package/dist/web/assets/{ScratchpadDiagramEditor-DkW_SmM8.js → ScratchpadDiagramEditor-6R8JsXS3.js} +1 -1
- package/dist/web/assets/Scratchpads-uD9R68sw.js +10 -0
- package/dist/web/assets/{SessionHomeLink-BAWO86fJ.js → SessionHomeLink-CMCZb7Vy.js} +1 -1
- package/dist/web/assets/Sessions-BD9AlzAN.js +4 -0
- package/dist/web/assets/Settings-Bt1even4.js +14 -0
- package/dist/web/assets/Skills-BSsN8kq-.js +3 -0
- package/dist/web/assets/{SourceEditor-B6pT-Rc0.js → SourceEditor-V5vL7Aof.js} +4 -4
- package/dist/web/assets/{TagInput-ChFu05vJ.js → TagInput-DU4zMpED.js} +1 -1
- package/dist/web/assets/TaskDetailSheet-C8dGHMsb.js +1 -0
- package/dist/web/assets/{Tasks-CC92r1kL.js → Tasks-wxRlyx-L.js} +6 -6
- package/dist/web/assets/Terminals-BFRG72xa.js +2 -0
- package/dist/web/assets/{ViewHeader-D-lhe59Y.js → ViewHeader-CKIR1ZTZ.js} +1 -1
- package/dist/web/assets/{Webhooks-BxpA1QBK.js → Webhooks-Bg3pm4rJ.js} +1 -1
- package/dist/web/assets/{badge-BqTVr27Z.js → badge-DfvoXiLp.js} +1 -1
- package/dist/web/assets/check-DrnDUgkq.js +1 -0
- package/dist/web/assets/chevron-down-C1WyGsAA.js +1 -0
- package/dist/web/assets/chevron-up-ZnWliPW7.js +1 -0
- package/dist/web/assets/{chunk-OB3PAWPO-1IihCzFx.js → chunk-OB3PAWPO-BD6ylT0A.js} +1 -1
- package/dist/web/assets/{circle-check-DWP3C_MJ.js → circle-check-CnioupGj.js} +1 -1
- package/dist/web/assets/{client-954dj6K2.js → client-DigivyCS.js} +1 -1
- package/dist/web/assets/{download-BD7lYc4O.js → download-CNwtbYo1.js} +1 -1
- package/dist/web/assets/{highlighted-body-JLMTFACH-CAMR1LA5.js → highlighted-body-JLMTFACH-dpkthrjz.js} +1 -1
- package/dist/web/assets/{index-XIDqokJX.js → index-Bc-Nka6Y.js} +50 -49
- package/dist/web/assets/index-BrDTqMtQ.css +1 -0
- package/dist/web/assets/{live-sessions-C6D_vHcN.js → live-sessions-BG3mNXnQ.js} +1 -1
- package/dist/web/assets/{maximize-2-BUxUwGbf.js → maximize-2-CcupqYE8.js} +1 -1
- package/dist/web/assets/mermaid-WFAXDIZX-BX9NWlJb.js +1 -0
- package/dist/web/assets/orc-kit-BZEVA3Qv.js +317 -0
- package/dist/web/assets/{scratchpad-kinds-B0Y6McXL.js → scratchpad-kinds-RGciqVT1.js} +1 -1
- package/dist/web/assets/{scratchpad-routes-BtsIfhUW.js → scratchpad-routes-Q2TRGUnx.js} +1 -1
- package/dist/web/assets/send-0IpktRLv.js +1 -0
- package/dist/web/assets/{upload-CPf6QZHl.js → upload-CaDKCpy5.js} +1 -1
- package/dist/web/assets/{useDetailRoute-DOhAbdV7.js → useDetailRoute-B-xjWsyW.js} +1 -1
- package/dist/web/assets/{useIntegrations-C0MAVKB4.js → useIntegrations-C6zijOMH.js} +1 -1
- package/dist/web/assets/{useJobs-BlWldKP0.js → useJobs-Dly6n-pv.js} +1 -1
- package/dist/web/assets/{useMemories-CAf8HcOI.js → useMemories-jakANU6m.js} +1 -1
- package/dist/web/assets/useProjectScope-DpgzthH7.js +1 -0
- package/dist/web/assets/{useSessions-DiUU2FN8.js → useSessions-tFa1FZ9M.js} +1 -1
- package/dist/web/assets/{view-params-DD7i9s5g.js → view-params-YEmeZppw.js} +1 -1
- package/dist/web/assets/{x-tY-z3woy.js → x-BayoBYp_.js} +1 -1
- package/dist/web/index.html +11 -18
- package/dist/web/sw.js +26 -17
- package/package.json +1 -1
- package/dist/web/assets/Audit-DGSNmToV.js +0 -1
- package/dist/web/assets/ChatUiRenderer-Dddr55cW.js +0 -4
- package/dist/web/assets/ConfirmDialog-B5es4nUp.js +0 -1
- package/dist/web/assets/DocumentWorkspace-I81K42yx.js +0 -1
- package/dist/web/assets/FileEditor-wRs221QU.js +0 -1
- package/dist/web/assets/JobWebhooks-oaF694Af.js +0 -1
- package/dist/web/assets/Jobs-Lmyw5700.js +0 -3
- package/dist/web/assets/Knowledge-V4JuZnUZ.js +0 -1
- package/dist/web/assets/Markdown-D-AaJ4bU.js +0 -2
- package/dist/web/assets/MarkdownEditor-5U4_BhYm.js +0 -2
- package/dist/web/assets/PackageCatalog-BC-yAjPQ.js +0 -8
- package/dist/web/assets/Projects-C280nbHV.js +0 -3
- package/dist/web/assets/Rules-BwsnRQBe.js +0 -18
- package/dist/web/assets/Scratchpads-BtUKOhup.js +0 -10
- package/dist/web/assets/Sessions-Cn2dIJBt.js +0 -4
- package/dist/web/assets/Settings-Bb01CfFw.js +0 -14
- package/dist/web/assets/Skills-Vw41zPVg.js +0 -3
- package/dist/web/assets/TaskDetailSheet-DuTfo6rZ.js +0 -1
- package/dist/web/assets/Terminals-dCbgpRsm.js +0 -2
- package/dist/web/assets/check-Cg2_C_4I.js +0 -1
- package/dist/web/assets/chevron-down-KBvm_HoX.js +0 -1
- package/dist/web/assets/dialog-DNIYhwi4.js +0 -1
- package/dist/web/assets/file-kind-BYU1kv95.js +0 -1
- package/dist/web/assets/index-hvCYuRJb.css +0 -1
- package/dist/web/assets/label-Bm_d0NKL.js +0 -1
- package/dist/web/assets/mermaid-WFAXDIZX-Bzg8wVqT.js +0 -1
- package/dist/web/assets/select-cyLFVkkB.js +0 -1
- package/dist/web/assets/tabs-bEwJLtA0.js +0 -1
- package/dist/web/assets/textarea-CovStda2.js +0 -1
- package/dist/web/assets/useProjectScope-DtEj9j-P.js +0 -1
|
@@ -0,0 +1,317 @@
|
|
|
1
|
+
var e=`const registerOrcElements = (selectTab) => {
|
|
2
|
+
const define = (name, element) => {
|
|
3
|
+
if (!customElements.get(name)) customElements.define(name, element);
|
|
4
|
+
};
|
|
5
|
+
for (const name of ["page", "grid", "row", "card", "chart"]) {
|
|
6
|
+
define("orc-" + name, class extends HTMLElement {
|
|
7
|
+
connectedCallback() { this.classList.add("orc-" + name); }
|
|
8
|
+
});
|
|
9
|
+
}
|
|
10
|
+
define("orc-stat", class extends HTMLElement {
|
|
11
|
+
static observedAttributes = ["label", "value"];
|
|
12
|
+
connectedCallback() { this.render(); }
|
|
13
|
+
attributeChangedCallback() { if (this.isConnected) this.render(); }
|
|
14
|
+
render() {
|
|
15
|
+
this.classList.add("orc-stat");
|
|
16
|
+
const label = document.createElement("span");
|
|
17
|
+
label.className = "orc-stat-label";
|
|
18
|
+
label.textContent = this.getAttribute("label") ?? "";
|
|
19
|
+
const value = document.createElement("span");
|
|
20
|
+
value.className = "orc-stat-value";
|
|
21
|
+
value.textContent = this.getAttribute("value") ?? "";
|
|
22
|
+
this.replaceChildren(label, value);
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
define("orc-badge", class extends HTMLElement {
|
|
26
|
+
static observedAttributes = ["tone"];
|
|
27
|
+
connectedCallback() { this.render(); }
|
|
28
|
+
attributeChangedCallback() { if (this.isConnected) this.render(); }
|
|
29
|
+
render() {
|
|
30
|
+
this.classList.add("orc-badge");
|
|
31
|
+
for (const tone of ["success", "warning", "error"]) {
|
|
32
|
+
this.classList.toggle("orc-badge-" + tone, this.getAttribute("tone") === tone);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
define("orc-table", class extends HTMLElement {
|
|
37
|
+
connectedCallback() {
|
|
38
|
+
this.classList.add("orc-table-wrap");
|
|
39
|
+
this.style.display = "block";
|
|
40
|
+
queueMicrotask(() => this.querySelector(":scope > table")?.classList.add("orc-table"));
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
let nextId = 0;
|
|
44
|
+
const uniqueId = () => {
|
|
45
|
+
let id;
|
|
46
|
+
do { id = "orc-kit-tab-" + ++nextId; } while (document.getElementById(id));
|
|
47
|
+
return id;
|
|
48
|
+
};
|
|
49
|
+
define("orc-tabs", class extends HTMLElement {
|
|
50
|
+
connectedCallback() { queueMicrotask(() => this.mount()); }
|
|
51
|
+
mount() {
|
|
52
|
+
if (this.querySelector(":scope > .orc-tab-list")) return;
|
|
53
|
+
this.classList.add("orc-tabs");
|
|
54
|
+
const list = document.createElement("div");
|
|
55
|
+
list.className = "orc-tab-list";
|
|
56
|
+
list.setAttribute("role", "tablist");
|
|
57
|
+
list.setAttribute("aria-label", this.getAttribute("label") ?? "Tabs");
|
|
58
|
+
list.setAttribute("aria-orientation", this.getAttribute("orientation") === "vertical" ? "vertical" : "horizontal");
|
|
59
|
+
let selected;
|
|
60
|
+
for (const panel of Array.from(this.children).filter((child) => child.localName === "orc-tab")) {
|
|
61
|
+
const button = document.createElement("button");
|
|
62
|
+
button.type = "button";
|
|
63
|
+
button.className = "orc-tab";
|
|
64
|
+
button.id = uniqueId();
|
|
65
|
+
button.textContent = panel.getAttribute("label") ?? "Tab";
|
|
66
|
+
button.disabled = panel.hasAttribute("disabled");
|
|
67
|
+
panel.id ||= uniqueId();
|
|
68
|
+
panel.classList.add("orc-tab-panel");
|
|
69
|
+
panel.setAttribute("role", "tabpanel");
|
|
70
|
+
panel.setAttribute("aria-labelledby", button.id);
|
|
71
|
+
panel.tabIndex = 0;
|
|
72
|
+
button.setAttribute("role", "tab");
|
|
73
|
+
button.setAttribute("aria-controls", panel.id);
|
|
74
|
+
button.setAttribute("data-orc-tab", "");
|
|
75
|
+
button.dataset.orcPanel = panel.id;
|
|
76
|
+
button.setAttribute("aria-selected", "false");
|
|
77
|
+
button.tabIndex = -1;
|
|
78
|
+
panel.hidden = true;
|
|
79
|
+
if (!button.disabled && (!selected || panel.hasAttribute("selected"))) selected = button;
|
|
80
|
+
list.append(button);
|
|
81
|
+
}
|
|
82
|
+
this.prepend(list);
|
|
83
|
+
if (selected) selectTab(selected);
|
|
84
|
+
}
|
|
85
|
+
});
|
|
86
|
+
};`,t={1:`
|
|
87
|
+
:root {
|
|
88
|
+
--background: 250 250 250;
|
|
89
|
+
--surface: 255 255 255;
|
|
90
|
+
--surface-low: 250 250 250;
|
|
91
|
+
--surface-high: 243 243 245;
|
|
92
|
+
--surface-highest: 233 234 237;
|
|
93
|
+
--surface-bright: 222 224 228;
|
|
94
|
+
--foreground: 37 38 42;
|
|
95
|
+
--muted-foreground: 98 102 110;
|
|
96
|
+
--border: 222 224 228;
|
|
97
|
+
--primary: 37 38 42;
|
|
98
|
+
--primary-foreground: 255 255 255;
|
|
99
|
+
--success: 70 102 83;
|
|
100
|
+
--warning: 121 95 48;
|
|
101
|
+
--error: 155 69 77;
|
|
102
|
+
--progress: 49 87 151;
|
|
103
|
+
--focus: 80 101 133;
|
|
104
|
+
--control-border: 133 137 145;
|
|
105
|
+
--error-container: 250 224 228;
|
|
106
|
+
color-scheme: light;
|
|
107
|
+
}
|
|
108
|
+
:root.dark {
|
|
109
|
+
--background: 0 0 0;
|
|
110
|
+
--surface: 20 20 20;
|
|
111
|
+
--surface-low: 0 0 0;
|
|
112
|
+
--surface-high: 28 28 28;
|
|
113
|
+
--surface-highest: 36 36 36;
|
|
114
|
+
--surface-bright: 82 82 82;
|
|
115
|
+
--foreground: 229 229 229;
|
|
116
|
+
--muted-foreground: 163 163 163;
|
|
117
|
+
--border: 38 38 38;
|
|
118
|
+
--primary: 222 222 222;
|
|
119
|
+
--primary-foreground: 0 0 0;
|
|
120
|
+
--success: 133 193 157;
|
|
121
|
+
--warning: 214 182 117;
|
|
122
|
+
--error: 226 145 154;
|
|
123
|
+
--error-container: 49 20 25;
|
|
124
|
+
--progress: 138 180 248;
|
|
125
|
+
--focus: 196 196 196;
|
|
126
|
+
--control-border: 113 113 113;
|
|
127
|
+
color-scheme: dark;
|
|
128
|
+
}
|
|
129
|
+
* {
|
|
130
|
+
box-sizing: border-box;
|
|
131
|
+
border-color: rgb(var(--border));
|
|
132
|
+
}
|
|
133
|
+
body {
|
|
134
|
+
margin: 0;
|
|
135
|
+
padding: 16px;
|
|
136
|
+
background: rgb(var(--background));
|
|
137
|
+
color: rgb(var(--foreground));
|
|
138
|
+
font: 14px/1.5 "IBM Plex Sans", "Segoe UI", system-ui, sans-serif;
|
|
139
|
+
}
|
|
140
|
+
h1 { margin: 0; font-size: 22px; font-weight: 500; }
|
|
141
|
+
h2 { margin: 0; font-size: 16px; font-weight: 500; }
|
|
142
|
+
h3 { margin: 0; font-size: 14px; font-weight: 500; }
|
|
143
|
+
p { margin: 0; }
|
|
144
|
+
a { color: rgb(var(--progress)); text-decoration-thickness: 1px; text-underline-offset: 2px; }
|
|
145
|
+
code, pre, kbd {
|
|
146
|
+
font-family: "IBM Plex Mono", Consolas, monospace;
|
|
147
|
+
font-size: 13px;
|
|
148
|
+
}
|
|
149
|
+
pre { margin: 0; background: rgb(var(--surface-high)); border-radius: 6px; padding: 10px 12px; overflow-x: auto; }
|
|
150
|
+
hr { border: 0; border-top: 1px solid rgb(var(--border)); margin: 4px 0; }
|
|
151
|
+
.orc-page { max-width: 980px; margin: 0 auto; display: grid; gap: 14px; align-content: start; }
|
|
152
|
+
.orc-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
|
|
153
|
+
.orc-card {
|
|
154
|
+
background: rgb(var(--surface));
|
|
155
|
+
border: 1px solid rgb(var(--border));
|
|
156
|
+
border-radius: 8px;
|
|
157
|
+
padding: 12px 14px;
|
|
158
|
+
display: grid;
|
|
159
|
+
gap: 8px;
|
|
160
|
+
align-content: start;
|
|
161
|
+
}
|
|
162
|
+
.orc-stat { display: grid; gap: 2px; }
|
|
163
|
+
.orc-stat-label { font-size: 12px; color: rgb(var(--muted-foreground)); }
|
|
164
|
+
.orc-stat-value { font-size: 22px; font-weight: 500; line-height: 1.2; }
|
|
165
|
+
.orc-badge {
|
|
166
|
+
display: inline-flex;
|
|
167
|
+
align-items: center;
|
|
168
|
+
gap: 6px;
|
|
169
|
+
width: fit-content;
|
|
170
|
+
font-size: 12px;
|
|
171
|
+
padding: 2px 8px;
|
|
172
|
+
border-radius: 4px;
|
|
173
|
+
border: 1px solid rgb(var(--control-border));
|
|
174
|
+
color: rgb(var(--muted-foreground));
|
|
175
|
+
}
|
|
176
|
+
.orc-badge-success { color: rgb(var(--success)); border-color: rgb(var(--success)); }
|
|
177
|
+
.orc-badge-warning { color: rgb(var(--warning)); border-color: rgb(var(--warning)); }
|
|
178
|
+
.orc-badge-error { color: rgb(var(--error)); border-color: rgb(var(--error)); }
|
|
179
|
+
.orc-table-wrap { overflow-x: auto; }
|
|
180
|
+
.orc-table { width: 100%; border-collapse: collapse; font-size: 13px; }
|
|
181
|
+
.orc-table th {
|
|
182
|
+
text-align: left;
|
|
183
|
+
font-weight: 500;
|
|
184
|
+
font-size: 12px;
|
|
185
|
+
color: rgb(var(--muted-foreground));
|
|
186
|
+
padding: 6px 10px;
|
|
187
|
+
border-bottom: 1px solid rgb(var(--border));
|
|
188
|
+
}
|
|
189
|
+
.orc-table td { padding: 6px 10px; border-bottom: 1px solid rgb(var(--border)); }
|
|
190
|
+
.orc-table tr:last-child td { border-bottom: 0; }
|
|
191
|
+
.orc-tabs { display: grid; gap: 0; }
|
|
192
|
+
.orc-tab-list { display: flex; gap: 2px; border-bottom: 1px solid rgb(var(--border)); }
|
|
193
|
+
.orc-tab {
|
|
194
|
+
appearance: none;
|
|
195
|
+
background: none;
|
|
196
|
+
border: 0;
|
|
197
|
+
border-bottom: 2px solid transparent;
|
|
198
|
+
margin-bottom: -1px;
|
|
199
|
+
padding: 6px 10px;
|
|
200
|
+
font: inherit;
|
|
201
|
+
font-size: 13px;
|
|
202
|
+
font-weight: 500;
|
|
203
|
+
color: rgb(var(--muted-foreground));
|
|
204
|
+
cursor: pointer;
|
|
205
|
+
}
|
|
206
|
+
.orc-tab[aria-selected="true"] {
|
|
207
|
+
color: rgb(var(--foreground));
|
|
208
|
+
border-bottom-color: rgb(var(--primary));
|
|
209
|
+
}
|
|
210
|
+
.orc-tab-panel { padding: 10px 0; display: grid; gap: 10px; }
|
|
211
|
+
.orc-tab-panel[hidden] { display: none; }
|
|
212
|
+
.orc-chart {
|
|
213
|
+
--chart-line: rgb(var(--progress));
|
|
214
|
+
--chart-grid: rgb(var(--border));
|
|
215
|
+
--chart-text: rgb(var(--muted-foreground));
|
|
216
|
+
display: grid;
|
|
217
|
+
gap: 6px;
|
|
218
|
+
align-content: start;
|
|
219
|
+
}
|
|
220
|
+
.orc-chart svg { max-width: 100%; height: auto; }
|
|
221
|
+
.orc-chart text { fill: var(--chart-text); font-size: 11px; }
|
|
222
|
+
.orc-chart-label { font-size: 12px; color: rgb(var(--muted-foreground)); }
|
|
223
|
+
.orc-button {
|
|
224
|
+
display: inline-flex;
|
|
225
|
+
align-items: center;
|
|
226
|
+
gap: 6px;
|
|
227
|
+
border: 1px solid rgb(var(--primary));
|
|
228
|
+
background: rgb(var(--primary));
|
|
229
|
+
color: rgb(var(--primary-foreground));
|
|
230
|
+
border-radius: 6px;
|
|
231
|
+
padding: 6px 12px;
|
|
232
|
+
font: inherit;
|
|
233
|
+
font-size: 13px;
|
|
234
|
+
font-weight: 500;
|
|
235
|
+
cursor: pointer;
|
|
236
|
+
}
|
|
237
|
+
.orc-button[data-variant="quiet"] {
|
|
238
|
+
background: none;
|
|
239
|
+
color: rgb(var(--foreground));
|
|
240
|
+
border-color: transparent;
|
|
241
|
+
}
|
|
242
|
+
.orc-button:disabled { opacity: 0.5; cursor: not-allowed; }
|
|
243
|
+
input, select, textarea {
|
|
244
|
+
border: 1px solid rgb(var(--control-border));
|
|
245
|
+
border-radius: 6px;
|
|
246
|
+
padding: 6px 10px;
|
|
247
|
+
background: transparent;
|
|
248
|
+
color: rgb(var(--foreground));
|
|
249
|
+
font: inherit;
|
|
250
|
+
font-size: 16px;
|
|
251
|
+
}
|
|
252
|
+
input[type="checkbox"] { accent-color: rgb(var(--primary)); width: 16px; height: 16px; padding: 0; }
|
|
253
|
+
input:focus-visible, select:focus-visible, textarea:focus-visible, .orc-tab:focus-visible, .orc-button:focus-visible {
|
|
254
|
+
outline: 2px solid rgb(var(--focus));
|
|
255
|
+
outline-offset: 2px;
|
|
256
|
+
}
|
|
257
|
+
@media (min-width: 640px) and (pointer: fine) {
|
|
258
|
+
input, select, textarea { font-size: 13px; padding-block: 5px; }
|
|
259
|
+
}
|
|
260
|
+
@media (max-width: 639px), (pointer: coarse) {
|
|
261
|
+
.orc-tab, .orc-button, input:not([type="checkbox"]), select, label { min-height: 44px; }
|
|
262
|
+
}
|
|
263
|
+
label { display: flex; align-items: center; gap: 8px; font-size: 13px; }
|
|
264
|
+
.orc-list { margin: 0; padding-left: 18px; display: grid; gap: 4px; font-size: 13px; }
|
|
265
|
+
.orc-muted { color: rgb(var(--muted-foreground)); }
|
|
266
|
+
.orc-hint { font-size: 12px; color: rgb(var(--muted-foreground)); }
|
|
267
|
+
.orc-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
|
|
268
|
+
`},n=`(() => {
|
|
269
|
+
${e}
|
|
270
|
+
const buttonsFor = (tabs) => Array.from(tabs.querySelectorAll("[data-orc-tab]"))
|
|
271
|
+
.filter((button) => button.closest(".orc-tabs") === tabs);
|
|
272
|
+
const select = (tab) => {
|
|
273
|
+
const tabs = tab.closest(".orc-tabs");
|
|
274
|
+
if (!tabs || tab.disabled) return;
|
|
275
|
+
for (const button of buttonsFor(tabs)) {
|
|
276
|
+
const selected = button === tab;
|
|
277
|
+
button.setAttribute("aria-selected", String(selected));
|
|
278
|
+
button.tabIndex = selected ? 0 : -1;
|
|
279
|
+
const panel = document.getElementById(button.dataset.orcPanel ?? "");
|
|
280
|
+
if (panel && panel.closest(".orc-tabs") === tabs) panel.hidden = !selected;
|
|
281
|
+
}
|
|
282
|
+
};
|
|
283
|
+
const eventTab = (event) => event.target instanceof Element
|
|
284
|
+
? event.target.closest("[data-orc-tab]") : null;
|
|
285
|
+
document.addEventListener("click", (event) => {
|
|
286
|
+
const tab = eventTab(event);
|
|
287
|
+
if (tab) select(tab);
|
|
288
|
+
});
|
|
289
|
+
document.addEventListener("keydown", (event) => {
|
|
290
|
+
const tab = eventTab(event);
|
|
291
|
+
if (!tab || tab.disabled) return;
|
|
292
|
+
const tabs = tab.closest(".orc-tabs");
|
|
293
|
+
if (!tabs) return;
|
|
294
|
+
const buttons = buttonsFor(tabs).filter((button) => !button.disabled);
|
|
295
|
+
const index = buttons.indexOf(tab);
|
|
296
|
+
const vertical = tab.closest('[role="tablist"]')?.getAttribute("aria-orientation") === "vertical";
|
|
297
|
+
let next;
|
|
298
|
+
if (event.key === "Home") next = 0;
|
|
299
|
+
else if (event.key === "End") next = buttons.length - 1;
|
|
300
|
+
else if (event.key === (vertical ? "ArrowUp" : "ArrowLeft")) next = (index - 1 + buttons.length) % buttons.length;
|
|
301
|
+
else if (event.key === (vertical ? "ArrowDown" : "ArrowRight")) next = (index + 1) % buttons.length;
|
|
302
|
+
else return;
|
|
303
|
+
event.preventDefault();
|
|
304
|
+
select(buttons[next]);
|
|
305
|
+
buttons[next].focus();
|
|
306
|
+
});
|
|
307
|
+
const initialize = () => {
|
|
308
|
+
registerOrcElements(select);
|
|
309
|
+
for (const tabs of document.querySelectorAll(".orc-tabs")) {
|
|
310
|
+
const buttons = buttonsFor(tabs).filter((button) => !button.disabled);
|
|
311
|
+
const selected = buttons.find((button) => button.getAttribute("aria-selected") === "true") ?? buttons[0];
|
|
312
|
+
if (selected) select(selected);
|
|
313
|
+
}
|
|
314
|
+
};
|
|
315
|
+
if (document.readyState === "loading") document.addEventListener("DOMContentLoaded", initialize, { once: true });
|
|
316
|
+
else initialize();
|
|
317
|
+
})();`;function r(e){let n=RegExp(`<meta\\b(?=[^>]*\\bname=["']orc-kit["'])(?=[^>]*\\bcontent=["'](\\d+)["'])[^>]*>`,`i`).exec(e),r=n?Number(n[1]):1;return n&&r in t?{version:r,pinned:!0}:{version:1,pinned:!1}}function i(e,i){let{version:a}=r(e),o=`<style id="orc-kit" data-orc-kit-version="${a}">${t[a]}</style><script id="orc-kit-js">${i===`dark`?`document.documentElement.classList.add("dark");`:``}${n}<\/script>`,s=/^\s*<!doctype[^>]*>/i.exec(e);return s?`${s[0]}${o}${e.slice(s[0].length)}`:`${o}${e}`}export{i as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{h as e}from"./client-
|
|
1
|
+
import{h as e}from"./client-DigivyCS.js";import{xi as t}from"./index-Bc-Nka6Y.js";var n={name:`code-xml`,size:24,node:[[`path`,{d:`m18 16 4-4-4-4`,key:`1inbqp`}],[`path`,{d:`m6 8-4 4 4 4`,key:`15zrgr`}],[`path`,{d:`m14.5 4-5 16`,key:`e7oirm`}]],aliases:[`code-2`]};n.node;var r=e(n),i={name:`shapes`,size:24,node:[[`path`,{d:`M8.3 10a.7.7 0 0 1-.626-1.079L11.4 3a.7.7 0 0 1 1.198-.043L16.3 8.9a.7.7 0 0 1-.572 1.1Z`,key:`1bo67w`}],[`rect`,{x:`3`,y:`14`,width:`7`,height:`7`,rx:`1`,key:`1bkyp8`}],[`circle`,{cx:`17.5`,cy:`17.5`,r:`3.5`,key:`w3z12y`}]]};i.node;var a=e(i),o={doc:{label:`Doc`,icon:t,hint:`Markdown with mermaid diagrams`},diagram:{label:`Diagram`,icon:a,hint:`Excalidraw canvas`},html:{label:`HTML`,icon:r,hint:`A page shown in a sandboxed frame`}};export{o as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e}from"./QueryClientProvider-DlPztvhd.js";import{n as t,t as n}from"./useMutation-CRAWY7v2.js";import{n as r}from"./client-
|
|
1
|
+
import{n as e}from"./QueryClientProvider-DlPztvhd.js";import{n as t,t as n}from"./useMutation-CRAWY7v2.js";import{n as r}from"./client-DigivyCS.js";var i=`scratchpads`,a=`scratchpad`;function o(e,n){return t({queryKey:[i,e],queryFn:()=>r.scratchpads.list(e),enabled:n?.enabled??!0})}function s(e){return t({queryKey:[a,e],queryFn:()=>r.scratchpads.get(e),enabled:!!e})}function c(){let t=e();return async()=>{await Promise.all([t.invalidateQueries({queryKey:[i]}),t.invalidateQueries({queryKey:[a]})])}}function l(){let e=c();return n({mutationFn:e=>r.scratchpads.create(e),onSuccess:e})}function u(){let e=c();return n({mutationFn:({id:e,...t})=>r.scratchpads.update(e,t),onSettled:e})}function d(){let t=e(),i=c();return n({mutationFn:e=>r.scratchpads.delete(e),onSuccess:(e,n)=>(t.removeQueries({queryKey:[a,n]}),i())})}var f=`/scratchpad`;function p(e){return`${f}/${encodeURIComponent(e)}`}function m(e){return new URL(p(e),window.location.origin).toString()}export{d as a,o as c,l as i,u as l,p as n,c as o,m as r,s,f as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{h as e}from"./client-DigivyCS.js";var t={name:`send`,size:24,node:[[`path`,{d:`M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z`,key:`1ffxy3`}],[`path`,{d:`m21.854 2.147-10.94 10.939`,key:`12cjpa`}]]};t.node;var n=e(t);export{n as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{h as e}from"./client-
|
|
1
|
+
import{h as e}from"./client-DigivyCS.js";var t={name:`upload`,size:24,node:[[`path`,{d:`M12 3v12`,key:`1x0j5s`}],[`path`,{d:`m17 8-5-5-5 5`,key:`7q97r8`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}]]};t.node;var n=e(t);export{n as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e}from"./rolldown-runtime-DSDNlrLa.js";import{n as t}from"./jsx-runtime-CVMpzJz9.js";import{f as n,p as r,u as i}from"./chunk-OB3PAWPO-
|
|
1
|
+
import{a as e}from"./rolldown-runtime-DSDNlrLa.js";import{n as t}from"./jsx-runtime-CVMpzJz9.js";import{f as n,p as r,u as i}from"./chunk-OB3PAWPO-BD6ylT0A.js";var a=e(t(),1);function o(e,t){let o=r(),s=i(),c=n(),l=o[t]??null;return{selectedId:l,open:l!==null,openDetail:(0,a.useCallback)(t=>{c(`${e}/${encodeURIComponent(t)}${s.search}`)},[e,s.search,c]),closeDetail:(0,a.useCallback)(()=>{c(`${e}${s.search}`)},[e,s.search,c])}}export{o as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e}from"./QueryClientProvider-DlPztvhd.js";import{n as t,t as n}from"./useMutation-CRAWY7v2.js";import{n as r}from"./client-
|
|
1
|
+
import{n as e}from"./QueryClientProvider-DlPztvhd.js";import{n as t,t as n}from"./useMutation-CRAWY7v2.js";import{n as r}from"./client-DigivyCS.js";var i=[`integrations`,`connections`];function a(e){return t({queryKey:i,queryFn:()=>r.integrations.connections(),select:e=>e.connections,enabled:e})}function o(e){return t({queryKey:[...i,e],queryFn:()=>r.integrations.connection(e??``),enabled:e!==null})}function s(e){return t({queryKey:[...i,e,`tools`],queryFn:()=>r.integrations.tools(e??``),select:e=>e.tools,enabled:e!==null})}function c(e,n){return t({queryKey:[...i,e,`tools`,n],queryFn:()=>r.integrations.tool(e,n??``),enabled:n!==null})}function l(t){let r=e();return n({mutationFn:t,onSuccess:()=>r.invalidateQueries({queryKey:i})})}function u(){return l(({name:e,source:t,create:n})=>n?r.integrations.create(e,t):r.integrations.update(e,t))}function d(){return n({mutationFn:({name:e,source:t})=>r.integrations.test(e,t)})}function f(){return l(({name:e,enabled:t})=>r.integrations.setEnabled(e,t))}function p(){return l(e=>r.integrations.remove(e))}function m(){return l(e=>r.integrations.refresh(e))}var h=e=>`${window.location.origin}/integrations/oauth/${encodeURIComponent(e)}/callback`;function g(){return l(e=>r.integrations.authorize(e,h(e)))}function _(){return l(({name:e,code:t,state:n})=>r.integrations.finishAuthorization(e,t,n))}function v(){return l(e=>r.integrations.signOut(e))}function y(){return l(({name:e,tool:t,enabled:n})=>r.integrations.setToolEnabled(e,t,n))}function b(){return n({mutationFn:({name:e,tool:t,args:n})=>r.integrations.invoke(e,t,n)})}function x(e,n){return t({queryKey:[...i,e,`resources`],queryFn:()=>r.integrations.resources(e),enabled:n})}function S(e,n){return t({queryKey:[...i,e,`prompts`],queryFn:()=>r.integrations.prompts(e),enabled:n})}function C(){return n({mutationFn:({name:e,uri:t,vars:n})=>r.integrations.readResource(e,t,n)})}function w(){return n({mutationFn:({name:e,prompt:t,args:n})=>r.integrations.getPrompt(e,t,n)})}export{v as _,c as a,_ as c,C as d,m as f,y as g,f as h,x as i,w as l,u as m,o as n,s as o,p,S as r,a as s,g as t,b as u,d as v};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e}from"./QueryClientProvider-DlPztvhd.js";import{n as t,t as n}from"./useMutation-CRAWY7v2.js";import{n as r}from"./client-
|
|
1
|
+
import{n as e}from"./QueryClientProvider-DlPztvhd.js";import{n as t,t as n}from"./useMutation-CRAWY7v2.js";import{n as r}from"./client-DigivyCS.js";import{t as i}from"./bulk-actions-C8S1Gt4W.js";function a(e){return t({queryKey:[`jobs`,e],queryFn:()=>r.jobs.listAll(e),select:e=>e.jobs})}function o(e){return t({queryKey:[`job`,e],queryFn:()=>r.jobs.get(e),enabled:!!e})}function s(){let t=e();return n({mutationFn:e=>r.jobs.create(e),onSuccess:()=>{t.invalidateQueries({queryKey:[`jobs`]}),t.invalidateQueries({queryKey:[`webhooks`]})}})}function c(){let t=e();return n({mutationFn:({id:e,...t})=>r.jobs.update(e,t),onSuccess:()=>{t.invalidateQueries({queryKey:[`jobs`]}),t.invalidateQueries({queryKey:[`job`]}),t.invalidateQueries({queryKey:[`webhooks`]})}})}function l(){let t=e();return n({mutationFn:async({ids:e,enabled:t,scope:n})=>({...await i(e,e=>r.jobs.update(e,{enabled:t})),enabled:t,scope:n}),onSuccess:()=>{t.invalidateQueries({queryKey:[`jobs`]}),t.invalidateQueries({queryKey:[`job`]})}})}function u(){let t=e();return n({mutationFn:e=>r.jobs.delete(e),onSuccess:()=>{t.invalidateQueries({queryKey:[`jobs`]}),t.invalidateQueries({queryKey:[`webhooks`]})}})}function d(){let t=e();return n({mutationFn:e=>r.jobs.trigger(e),onSuccess:()=>{t.invalidateQueries({queryKey:[`job-runs`]}),t.invalidateQueries({queryKey:[`jobs`]}),t.invalidateQueries({queryKey:[`webhooks`]})}})}function f(e){return t({queryKey:[`job-runs`,e],refetchInterval:e=>e.state.data?.runs.some(e=>[`pending`,`running`].includes(e.status))?1e3:!1,queryFn:()=>r.jobs.runs(e),select:e=>e.runs,enabled:!!e})}function p(e,n,i=!1){return t({queryKey:[`job-run-logs`,e,n,i],refetchInterval:i?1e3:!1,queryFn:()=>r.jobs.runLogs(e,n),enabled:!!e&&!!n,select:e=>e.logs})}export{f as a,d as c,p as i,c as l,u as n,a as o,o as r,l as s,s as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e}from"./QueryClientProvider-DlPztvhd.js";import{n as t,t as n}from"./useMutation-CRAWY7v2.js";import{n as r}from"./client-
|
|
1
|
+
import{n as e}from"./QueryClientProvider-DlPztvhd.js";import{n as t,t as n}from"./useMutation-CRAWY7v2.js";import{n as r}from"./client-DigivyCS.js";var i=`memories`,a=`memory`,o=`memory-history`;function s(e,n){return t({queryKey:[i,e],queryFn:()=>r.memories.list(e),enabled:n?.enabled??!0})}function c(){return t({queryKey:[`memory-limits`],queryFn:()=>r.memories.limits()})}function l(e,n){return t({queryKey:[a,e,n],queryFn:()=>r.memories.get(e,n),enabled:!!(e&&n)})}function u(e,n){return t({queryKey:[o,e,n],queryFn:()=>r.memories.history(e,n),enabled:!!(e&&n)})}function d(){let t=e();return async()=>{await Promise.all([t.invalidateQueries({queryKey:[i]}),t.invalidateQueries({queryKey:[a]}),t.invalidateQueries({queryKey:[o]})])}}function f(){let e=d();return n({mutationFn:e=>r.memories.create(e),onSuccess:e})}function p(){let e=d();return n({mutationFn:({name:e,...t})=>r.memories.update(e,t),onSuccess:e})}function m(){let t=e(),i=d();return n({mutationFn:({projectId:e,name:t})=>r.memories.delete(e,t),onSuccess:(e,{projectId:n,name:r})=>(t.removeQueries({queryKey:[a,n,r]}),i())})}function h(){let e=d();return n({mutationFn:({name:e,...t})=>r.memories.revert(e,t),onSuccess:e})}export{u as a,p as c,l as i,m as n,c as o,s as r,h as s,f as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{h as e}from"./chunk-OB3PAWPO-BD6ylT0A.js";function t(t){let[n]=e();return n.get(`project`)??t}export{t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e}from"./QueryClientProvider-DlPztvhd.js";import{n as t,t as n,w as r}from"./useMutation-CRAWY7v2.js";import{n as i}from"./client-
|
|
1
|
+
import{n as e}from"./QueryClientProvider-DlPztvhd.js";import{n as t,t as n,w as r}from"./useMutation-CRAWY7v2.js";import{n as i}from"./client-DigivyCS.js";function a(e){return t({queryKey:[`sessions`,`logged`,e],queryFn:()=>i.sessions.list(e),placeholderData:r})}function o(e){return t({queryKey:[`session`,e],queryFn:()=>i.sessions.get(e),enabled:!!e})}function s(e,n){return t({queryKey:[`sessions`,`live`,e,n],queryFn:()=>i.sessions.live({active:e,limit:5e3,...n?{project_id:n}:{}}),select:e=>e.sessions})}function c(){let t=e();return n({mutationFn:()=>i.sessions.sync(),onSuccess:()=>t.invalidateQueries({queryKey:[`sessions`]})})}function l(){let t=e();return n({mutationFn:({id:e,taskId:t})=>i.sessions.linkTask(e,t),onSuccess:()=>t.invalidateQueries({queryKey:[`sessions`]})})}function u(e,n,r){return t({queryKey:[`sessions`,`search`,e,n,r],queryFn:()=>i.sessions.search({q:e,...n?{agent:n}:{},...r?{project_id:r}:{},limit:200}),enabled:e.trim().length>=2,staleTime:3e4})}var d=500;function f(e,n){return t({queryKey:[`sessions`,`transcript`,e,n],queryFn:async()=>{let t=await i.sessions.transcript(e,{offset:0,limit:d,...n?{q:n}:{}}),r=[...t.turns];for(;r.length<t.total;){let t=await i.sessions.transcript(e,{offset:r.length,limit:d});if(t.turns.length===0)break;r.push(...t.turns)}return{...t,turns:r}},enabled:!!e,staleTime:0,refetchOnMount:`always`,retry:!1})}function p(e){return t({queryKey:[`sessions`,`live`,`task`,e],queryFn:()=>i.sessions.live({task_id:e,active:!1,limit:100}),enabled:!!e,select:e=>e.sessions})}function m(e,n){return t({queryKey:[`sessions`,`messages`,e],queryFn:()=>i.sessions.messages(e),select:e=>e.messages,enabled:!!e,staleTime:0,refetchInterval:n?1e4:!1,retry:!1})}function h(t){let n=e();return()=>n.invalidateQueries({queryKey:[`sessions`,`messages`,t]})}function g(e){let t=h(e);return n({mutationFn:t=>i.sessions.sendMessage(e,t),onSuccess:t})}function _(e){let t=h(e);return n({mutationFn:e=>i.sessions.cancelMessage(e),onSuccess:t})}function v(e){let t=h(e);return n({mutationFn:e=>i.sessions.moveMessage(e.messageId,e.direction),onSuccess:t})}export{v as a,m as c,p as d,f,a as i,u as l,l as n,g as o,s as r,o as s,_ as t,c as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e}from"./rolldown-runtime-DSDNlrLa.js";import{n as t}from"./jsx-runtime-CVMpzJz9.js";import{f as n,
|
|
1
|
+
import{a as e}from"./rolldown-runtime-DSDNlrLa.js";import{n as t}from"./jsx-runtime-CVMpzJz9.js";import{f as n,h as r}from"./chunk-OB3PAWPO-BD6ylT0A.js";var i=e(t(),1);function a(e,t,n,r){let i=new URLSearchParams(e);return n===r?i.delete(t):i.set(t,n),i}function o(e,t,o){let[s]=r(),c=n(),l=(0,i.useRef)(void 0);(0,i.useEffect)(()=>{l.current=s.toString()},[s]);let u=s.get(e);return[u!==null&&(!o||o.includes(u))?u:t,(n,r)=>{let i=new URLSearchParams(window.location.search),o=a(i,e,n,t).toString();o!==i.toString()&&o!==l.current&&(l.current=o,c({pathname:window.location.pathname,search:o,hash:window.location.hash},r))}]}export{o as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e}from"./rolldown-runtime-DSDNlrLa.js";import{n as t,t as n}from"./jsx-runtime-CVMpzJz9.js";import{C as r,E as i,F as a,I as o,M as s,N as c,P as l,S as u,_ as d,b as f,j as p,k as m,v as h,w as g,y as _}from"./button-By-NN7c7.js";import{t as v}from"./dist-bytwC6rk.js";import{n as y,t as b}from"./es2015-w69PgVrA.js";import{h as x}from"./client-
|
|
1
|
+
import{a as e}from"./rolldown-runtime-DSDNlrLa.js";import{n as t,t as n}from"./jsx-runtime-CVMpzJz9.js";import{C as r,E as i,F as a,I as o,M as s,N as c,P as l,S as u,_ as d,b as f,j as p,k as m,v as h,w as g,y as _}from"./button-By-NN7c7.js";import{t as v}from"./dist-bytwC6rk.js";import{n as y,t as b}from"./es2015-w69PgVrA.js";import{h as x}from"./client-DigivyCS.js";var S=e(t(),1),C=n(),w=Object.defineProperty,T=(e,t)=>w(e,`name`,{value:t,configurable:!0}),E=`Dialog`,[D,ee]=l(E),[O,k]=D(E),A=T(e=>{let{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!0}=e,c=S.useRef(null),l=S.useRef(null),{nodes:d,registry:f}=u(),[m,h]=p({prop:r,defaultProp:i??!1,onChange:a,caller:E}),[g,_]=S.useState(0),[v,y]=S.useState(0);return(0,C.jsx)(O,{scope:t,triggerRef:c,contentRef:l,contentId:s(),titleId:s(),descriptionId:s(),titlePresent:g>0,descriptionPresent:v>0,setTitleCount:_,setDescriptionCount:y,open:m,onOpenChange:h,onOpenToggle:S.useCallback(()=>h(e=>!e),[h]),modal:o,branchNodes:d,branchRegistry:f,children:n})},`Dialog`),j=`DialogTrigger`,M=S.forwardRef(T(function(e,t){let{__scopeDialog:n,...r}=e,s=k(j,n),c=a(t,s.triggerRef);return(0,C.jsx)(i.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":s.open,"aria-controls":s.open?s.contentId:void 0,"data-state":Z(s.open),...r,ref:c,onClick:o(e.onClick,s.onOpenToggle)})},`DialogTrigger`)),N=`DialogPortal`,[P,F]=D(N,{forceMount:void 0}),I=T(e=>{let{__scopeDialog:t,forceMount:n,children:r,container:i}=e,a=k(N,t);return(0,C.jsx)(P,{scope:t,forceMount:n,children:S.Children.map(r,e=>(0,C.jsx)(d,{present:n||a.open,children:(0,C.jsx)(h,{asChild:!0,container:i,children:e})}))})},`DialogPortal`),L=`DialogOverlay`,R=S.forwardRef(T(function(e,t){let n=F(L,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=k(L,e.__scopeDialog);return a.modal?(0,C.jsx)(d,{present:r||a.open,children:(0,C.jsx)(B,{...i,ref:t})}):null},`DialogOverlay`)),z=m(`DialogOverlay.RemoveScroll`),B=S.forwardRef(T(function(e,t){let{__scopeDialog:n,...r}=e,o=k(L,n),s=g(),c=a(t,s);return(0,C.jsx)(y,{as:z,allowPinchZoom:!0,shards:S.useMemo(()=>[o.contentRef,...o.branchNodes.map(e=>({current:e}))],[o.contentRef,o.branchNodes]),children:(0,C.jsx)(i.div,{"data-state":Z(o.open),...r,ref:c,style:{pointerEvents:`auto`,...r.style}})})},`DialogOverlayImpl`)),V=`DialogContent`,H=S.forwardRef(T(function(e,t){let n=F(V,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=k(V,e.__scopeDialog);return(0,C.jsx)(d,{present:r||a.open,children:a.modal?(0,C.jsx)(U,{...i,ref:t}):(0,C.jsx)(W,{...i,ref:t})})},`DialogContent`)),U=S.forwardRef(T(function(e,t){let n=k(V,e.__scopeDialog),r=S.useRef(null),i=a(t,n.contentRef,r);return S.useEffect(()=>{let e=r.current;if(e)return b(e)},[]),(0,C.jsx)(G,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,onCloseAutoFocus:o(e.onCloseAutoFocus,e=>{e.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:o(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;(t.button===2||n)&&e.preventDefault()}),onFocusOutside:o(e.onFocusOutside,e=>e.preventDefault())})},`DialogContentModal`)),W=S.forwardRef(T(function(e,t){let n=k(V,e.__scopeDialog),r=S.useRef(!1),i=S.useRef(!1);return(0,C.jsx)(G,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(i.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&i.current&&t.preventDefault()}})},`DialogContentNonModal`)),G=S.forwardRef(T(function(e,t){let{__scopeDialog:n,trapFocus:i,onOpenAutoFocus:a,onCloseAutoFocus:o,"aria-describedby":s,children:c,...l}=e,u=k(V,n);return v(),(0,C.jsx)(f,{registry:u.branchRegistry,children:(0,C.jsx)(_,{asChild:!0,loop:!0,trapped:i,branches:u.branchNodes,onMountAutoFocus:a,onUnmountAutoFocus:o,children:(0,C.jsx)(r,{role:`dialog`,id:u.contentId,"aria-labelledby":u.titlePresent?u.titleId:void 0,"aria-describedby":u.descriptionPresent?X(s,u.descriptionId):s,"data-state":Z(u.open),...l,ref:t,deferPointerDownOutside:!0,onDismiss:()=>u.onOpenChange(!1),children:c})})})},`DialogContentImpl`)),K=S.forwardRef(T(function(e,t){let{__scopeDialog:n,...r}=e,a=k(`DialogTitle`,n),{setTitleCount:o}=a;return c(()=>(o(e=>e+1),()=>o(e=>e-1)),[o]),(0,C.jsx)(i.h2,{id:a.titleId,...r,ref:t})},`DialogTitle`)),q=S.forwardRef(T(function(e,t){let{__scopeDialog:n,...r}=e,a=k(`DialogDescription`,n),{setDescriptionCount:o}=a;return c(()=>(o(e=>e+1),()=>o(e=>e-1)),[o]),(0,C.jsx)(i.p,{id:a.descriptionId,...r,ref:t})},`DialogDescription`)),J=`DialogClose`,Y=S.forwardRef(T(function(e,t){let{__scopeDialog:n,...r}=e,a=k(J,n);return(0,C.jsx)(i.button,{type:`button`,...r,ref:t,onClick:o(e.onClick,()=>a.onOpenChange(!1))})},`DialogClose`));function X(...e){let t=new Set;for(let n of e)if(typeof n==`string`)for(let e of String(n).trim().split(/\s+/))e&&t.add(e);return t.size>0?Array.from(t).join(` `):void 0}T(X,`concatAriaDescribedby`);function Z(e){return e?`open`:`closed`}T(Z,`getState`);var Q={name:`x`,size:24,node:[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]};Q.node;var $=x(Q);export{q as a,K as c,H as i,M as l,A as n,R as o,Y as r,I as s,$ as t};
|
package/dist/web/index.html
CHANGED
|
@@ -21,40 +21,33 @@
|
|
|
21
21
|
<meta name="apple-mobile-web-app-capable" content="yes" />
|
|
22
22
|
<meta name="apple-mobile-web-app-title" content="ORC" />
|
|
23
23
|
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
|
|
24
|
-
<script type="module" crossorigin src="/assets/index-
|
|
24
|
+
<script type="module" crossorigin src="/assets/index-Bc-Nka6Y.js"></script>
|
|
25
25
|
<link rel="modulepreload" crossorigin href="/assets/rolldown-runtime-DSDNlrLa.js">
|
|
26
26
|
<link rel="modulepreload" crossorigin href="/assets/jsx-runtime-CVMpzJz9.js">
|
|
27
27
|
<link rel="modulepreload" crossorigin href="/assets/QueryClientProvider-DlPztvhd.js">
|
|
28
28
|
<link rel="modulepreload" crossorigin href="/assets/useMutation-CRAWY7v2.js">
|
|
29
29
|
<link rel="modulepreload" crossorigin href="/assets/react-dom-DTbwZiiP.js">
|
|
30
|
-
<link rel="modulepreload" crossorigin href="/assets/chunk-OB3PAWPO-
|
|
30
|
+
<link rel="modulepreload" crossorigin href="/assets/chunk-OB3PAWPO-BD6ylT0A.js">
|
|
31
31
|
<link rel="modulepreload" crossorigin href="/assets/floating-ui.react-dom-BDMgcqWu.js">
|
|
32
32
|
<link rel="modulepreload" crossorigin href="/assets/bundle-mjs-CdK3cBzO.js">
|
|
33
33
|
<link rel="modulepreload" crossorigin href="/assets/button-By-NN7c7.js">
|
|
34
34
|
<link rel="modulepreload" crossorigin href="/assets/dist-bytwC6rk.js">
|
|
35
35
|
<link rel="modulepreload" crossorigin href="/assets/es2015-w69PgVrA.js">
|
|
36
|
-
<link rel="modulepreload" crossorigin href="/assets/client-
|
|
37
|
-
<link rel="modulepreload" crossorigin href="/assets/x-
|
|
38
|
-
<link rel="modulepreload" crossorigin href="/assets/check-
|
|
39
|
-
<link rel="modulepreload" crossorigin href="/assets/chevron-down-
|
|
36
|
+
<link rel="modulepreload" crossorigin href="/assets/client-DigivyCS.js">
|
|
37
|
+
<link rel="modulepreload" crossorigin href="/assets/x-BayoBYp_.js">
|
|
38
|
+
<link rel="modulepreload" crossorigin href="/assets/check-DrnDUgkq.js">
|
|
39
|
+
<link rel="modulepreload" crossorigin href="/assets/chevron-down-C1WyGsAA.js">
|
|
40
|
+
<link rel="modulepreload" crossorigin href="/assets/chevron-up-ZnWliPW7.js">
|
|
41
|
+
<link rel="modulepreload" crossorigin href="/assets/circle-check-CnioupGj.js">
|
|
42
|
+
<link rel="modulepreload" crossorigin href="/assets/maximize-2-CcupqYE8.js">
|
|
40
43
|
<link rel="modulepreload" crossorigin href="/assets/dist-DScw4RwC.js">
|
|
41
44
|
<link rel="modulepreload" crossorigin href="/assets/dist-Ct6061MC.js">
|
|
42
45
|
<link rel="modulepreload" crossorigin href="/assets/dist-D8Wfxh48.js">
|
|
43
|
-
<link rel="modulepreload" crossorigin href="/assets/
|
|
44
|
-
<link rel="modulepreload" crossorigin href="/assets/circle-check-DWP3C_MJ.js">
|
|
45
|
-
<link rel="modulepreload" crossorigin href="/assets/maximize-2-BUxUwGbf.js">
|
|
46
|
+
<link rel="modulepreload" crossorigin href="/assets/schemas-BQZhekae.js">
|
|
46
47
|
<link rel="modulepreload" crossorigin href="/assets/preload-helper-BLdHbfdN.js">
|
|
47
|
-
<link rel="modulepreload" crossorigin href="/assets/Markdown-D-AaJ4bU.js">
|
|
48
48
|
<link rel="modulepreload" crossorigin href="/assets/document-display-BQ5dM8QT.js">
|
|
49
|
-
<link rel="modulepreload" crossorigin href="/assets/file-kind-BYU1kv95.js">
|
|
50
|
-
<link rel="modulepreload" crossorigin href="/assets/MarkdownEditor-5U4_BhYm.js">
|
|
51
|
-
<link rel="modulepreload" crossorigin href="/assets/textarea-CovStda2.js">
|
|
52
|
-
<link rel="modulepreload" crossorigin href="/assets/tabs-bEwJLtA0.js">
|
|
53
|
-
<link rel="modulepreload" crossorigin href="/assets/label-Bm_d0NKL.js">
|
|
54
|
-
<link rel="modulepreload" crossorigin href="/assets/schemas-BQZhekae.js">
|
|
55
|
-
<link rel="modulepreload" crossorigin href="/assets/dialog-DNIYhwi4.js">
|
|
56
49
|
<link rel="modulepreload" crossorigin href="/assets/bulk-actions-C8S1Gt4W.js">
|
|
57
|
-
<link rel="stylesheet" crossorigin href="/assets/index-
|
|
50
|
+
<link rel="stylesheet" crossorigin href="/assets/index-BrDTqMtQ.css">
|
|
58
51
|
</head>
|
|
59
52
|
<body class="bg-background text-on-surface font-body">
|
|
60
53
|
<div id="root"></div>
|
package/dist/web/sw.js
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
// ORC service worker: offline app shell, immutable asset cache and Web Push.
|
|
2
2
|
// API, MCP and WebSocket traffic is never intercepted — it always goes to the network.
|
|
3
|
-
|
|
3
|
+
// Bump SHELL_CACHE whenever the shell handling changes: activate() drops every cache
|
|
4
|
+
// not listed here, which is what removes a stale shell from installed clients. Asset
|
|
5
|
+
// entries are content-hashed, so orc-assets-v1 is kept to stay warm across updates.
|
|
6
|
+
const SHELL_CACHE = "orc-shell-v2";
|
|
4
7
|
const ASSET_CACHE = "orc-assets-v1";
|
|
5
8
|
const CACHES = [SHELL_CACHE, ASSET_CACHE];
|
|
6
9
|
const MAX_ASSETS = 200;
|
|
7
|
-
const NAVIGATION_TIMEOUT_MS = 4000;
|
|
8
10
|
const BYPASS_PREFIXES = ["/api/", "/mcp", "/docs", "/openapi.json"];
|
|
9
11
|
|
|
10
12
|
self.addEventListener("install", (event) => {
|
|
@@ -42,22 +44,29 @@ async function trimAssets(cache) {
|
|
|
42
44
|
}
|
|
43
45
|
|
|
44
46
|
async function navigate(event) {
|
|
45
|
-
|
|
46
|
-
const response = (await event.preloadResponse) ?? (await fetch(event.request));
|
|
47
|
-
if (cacheableShell(response)) {
|
|
48
|
-
const cache = await caches.open(SHELL_CACHE);
|
|
49
|
-
await cache.put("/", response.clone());
|
|
50
|
-
}
|
|
51
|
-
return response;
|
|
52
|
-
})();
|
|
53
|
-
const timeout = new Promise((resolve) => setTimeout(resolve, NAVIGATION_TIMEOUT_MS));
|
|
47
|
+
let response;
|
|
54
48
|
try {
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
49
|
+
response = (await event.preloadResponse) ?? (await fetch(event.request));
|
|
50
|
+
} catch (error) {
|
|
51
|
+
// Offline only. A cached shell is never fresher than the last deploy, and an
|
|
52
|
+
// old one asks for chunk names the new build already removed, so serving it
|
|
53
|
+
// while the network is merely slow turns a delay into a broken app.
|
|
54
|
+
const cached = await caches.match("/", { cacheName: SHELL_CACHE });
|
|
55
|
+
if (cached) return cached;
|
|
56
|
+
throw error;
|
|
57
|
+
}
|
|
58
|
+
// Storing the shell is best effort: a full or blocked cache must not turn this
|
|
59
|
+
// successful navigation into the stale shell.
|
|
60
|
+
if (cacheableShell(response)) {
|
|
61
|
+
const copy = response.clone();
|
|
62
|
+
event.waitUntil(
|
|
63
|
+
caches
|
|
64
|
+
.open(SHELL_CACHE)
|
|
65
|
+
.then((cache) => cache.put("/", copy))
|
|
66
|
+
.catch(() => {}),
|
|
67
|
+
);
|
|
68
|
+
}
|
|
69
|
+
return response;
|
|
61
70
|
}
|
|
62
71
|
|
|
63
72
|
async function asset(request) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "orc-ai",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.64",
|
|
4
4
|
"description": "Human + AI Orchestration Hub - persistent memory, task management, session continuity and multi-agent collaboration for Cursor, Claude Code, and Codex",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e}from"./rolldown-runtime-DSDNlrLa.js";import{n as t,t as n}from"./jsx-runtime-CVMpzJz9.js";import{n as r}from"./useMutation-CRAWY7v2.js";import{u as i}from"./chunk-OB3PAWPO-1IihCzFx.js";import{t as a}from"./button-By-NN7c7.js";import{n as o}from"./client-954dj6K2.js";import{t as s}from"./chevron-down-KBvm_HoX.js";import{t as c}from"./ResponsiveFilters-HzhzzjyL.js";import{t as l}from"./scroll-area-BhajWBGy.js";import{t as u}from"./Markdown-D-AaJ4bU.js";import{Dr as d,O as f,Qr as p,_t as m,dt as h,ft as g,gt as _,ht as v,ut as y,z as b}from"./index-XIDqokJX.js";import{t as x}from"./ErrorState-DB0nWfcc.js";import{t as S}from"./ViewHeader-D-lhe59Y.js";import{t as C}from"./useDetailRoute-DOhAbdV7.js";import{t as w}from"./view-params-DD7i9s5g.js";import{t as T}from"./EmptyState-YM4VSLR9.js";import{t as E}from"./Pager-Dbs7fj3d.js";import{i as D,r as O}from"./useSessions-DiUU2FN8.js";import{a as k,i as A,n as j,o as M,r as N,t as P}from"./table-COm8Aml-.js";import{t as F}from"./useProjectScope-DtEj9j-P.js";var I=e(t(),1),L=n(),R=[`all`,`notification`,`human_request`,`job_run`,`task`,`settings`,`memory`,`skill`,`kb`],z={all:`All events`,notification:`Notifications`,human_request:`Human requests`,job_run:`Job runs`,task:`Tasks`,settings:`Settings`,memory:`Memories`,skill:`Skills`,kb:`Knowledge`},B=100;function V(e){let t=e.replace(/[._-]/g,` `);return t.charAt(0).toUpperCase()+t.slice(1)}function H(e,t=0){return typeof e==`string`?e.length>500?`${e.slice(0,500)}…`:e:!e||typeof e!=`object`?e:t>=3?`…`:Array.isArray(e)?e.slice(0,10).map(e=>H(e,t+1)):Object.fromEntries(Object.entries(e).slice(0,12).map(([e,n])=>[e,H(n,t+1)]))}function U(e){let t=JSON.stringify(H(e),null,2);return t.length>4e3?`${t.slice(0,4e3)}\n…`:t}function W({entry:e}){let[t,n]=(0,I.useState)(!1),r=new Date(e.created_at*1e3),i=e.subject_ids.slice(0,3).join(`, `)||`Workspace`;return(0,L.jsx)(`li`,{children:(0,L.jsxs)(`details`,{"data-testid":`audit-event`,className:`group py-1`,onToggle:e=>n(e.currentTarget.open),children:[(0,L.jsxs)(`summary`,{className:`grid min-h-11 cursor-pointer list-inside grid-cols-[minmax(0,1fr)_auto] items-center gap-x-3 gap-y-1 rounded py-2 text-sm focus-visible:outline-2 focus-visible:outline-focus md:min-h-9 md:grid-cols-[minmax(12rem,1fr)_minmax(0,1fr)_auto]`,children:[(0,L.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1 font-medium`,children:[(0,L.jsx)(p,{className:`size-3 shrink-0 transition-transform group-open:rotate-90`}),V(e.action)]}),(0,L.jsx)(`span`,{className:`col-start-1 min-w-0 truncate text-xs text-outline md:col-start-auto`,title:i,children:i}),(0,L.jsx)(`time`,{dateTime:r.toISOString(),className:`col-start-2 row-start-1 whitespace-nowrap text-xs text-outline md:col-start-auto md:row-start-auto`,children:r.toLocaleString()})]}),t&&(0,L.jsxs)(`div`,{className:`space-y-2 pb-3 pl-3 text-xs text-outline`,children:[(0,L.jsxs)(`p`,{children:[`Project: `,e.project_id??`Unassigned`,` · Actor: `,e.actor??`Not recorded`]}),e.session_id&&(0,L.jsxs)(`p`,{className:`break-all`,children:[`Session: `,e.session_id]}),e.result_ids.length>0&&(0,L.jsxs)(`p`,{className:`break-all`,children:[`Results: `,e.result_ids.slice(0,10).join(`, `)]}),e.note&&(0,L.jsx)(`p`,{className:`whitespace-pre-wrap break-words`,children:e.note.slice(0,1e3)}),e.snapshot!==null&&e.snapshot!==void 0&&(0,L.jsxs)(`div`,{children:[(0,L.jsx)(`p`,{className:`mb-1`,children:`Metadata preview`}),(0,L.jsx)(`pre`,{"data-testid":`audit-event-metadata`,className:`max-h-56 overflow-auto whitespace-pre-wrap break-all text-xs text-on-surface`,children:U(e.snapshot)})]})]})]})})}function G({projectId:e}){let[t,n]=w(`auditEntity`,`all`,R),i=r({queryKey:[`audit`,`events`,e,t],queryFn:()=>o.audit.list({...e===`all`?{scope:`all`}:e===`unassigned`?{scope:`global`}:{project_id:e},...t===`all`?{}:{entity_type:t},limit:B,snapshot:`preview`}),retry:!1});return(0,L.jsxs)(`section`,{"aria-label":`Audit events`,"data-testid":`audit-events`,className:`min-w-0`,children:[(0,L.jsxs)(`div`,{className:`mb-2 flex flex-wrap items-center justify-between gap-2`,children:[(0,L.jsxs)(`p`,{className:`text-xs text-outline`,children:[`Up to `,B,` newest events`]}),(0,L.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,L.jsx)(c,{activeCount:t===`all`?0:1,children:(0,L.jsx)(`select`,{"aria-label":`Audit event type`,"data-testid":`audit-event-filter`,className:`form-control form-control-single`,value:t,onChange:e=>n(e.target.value),children:R.map(e=>(0,L.jsx)(`option`,{value:e,children:z[e]},e))})}),(0,L.jsxs)(a,{variant:`ghost`,size:`sm`,onClick:()=>void i.refetch(),disabled:i.isFetching,"data-testid":`audit-events-refresh`,children:[(0,L.jsx)(d,{className:`size-4`}),`Refresh`]})]})]}),i.isLoading&&(0,L.jsx)(`p`,{role:`status`,className:`py-4 text-sm text-outline`,children:`Loading events…`}),i.error&&(0,L.jsxs)(`p`,{role:`alert`,className:`py-3 text-sm text-error`,children:[`Could not load audit events: `,i.error.message]}),!i.isLoading&&!i.error&&i.data?.entries.length===0&&(0,L.jsx)(`p`,{className:`py-6 text-sm text-outline`,children:`No audit events in this scope.`}),i.data&&(0,L.jsx)(`ol`,{className:`divide-y divide-border`,children:i.data.entries.map(e=>(0,L.jsx)(W,{entry:e},e.id))})]})}var K={file:`text-outline`,task:`text-outline`,decision:`text-outline`,error:`text-error`,git:`text-outline`,rule:`text-outline`,plan:`text-outline`},q=`text-outline`;function J(e){return K[e]??q}function Y({sessionId:e,open:t,onClose:n}){let{data:r,isLoading:i,error:a,refetch:o}=D(e??``);return(0,L.jsx)(y,{open:t,onOpenChange:e=>!e&&n(),children:(0,L.jsxs)(g,{side:`right`,defaultWidth:540,resizeKey:`sessions`,children:[(0,L.jsx)(v,{children:(0,L.jsx)(_,{children:i?`Loading...`:r?`${r.agent??`Session`} ${r.agent_version?`v${r.agent_version}`:``}`:`Session Detail`})}),(0,L.jsxs)(h,{children:[(0,L.jsx)(`p`,{className:`mb-4 text-sm text-outline`,children:`This audit record contains summaries and events. Open Sessions to read native agent conversations or resume them.`}),a?(0,L.jsx)(x,{message:a.message,onRetry:()=>o()}):i?(0,L.jsx)(`div`,{className:`space-y-4`,children:[...[,,,,]].map((e,t)=>(0,L.jsx)(f,{className:`h-8 w-full bg-surface-highest`},t))}):r?(0,L.jsxs)(`div`,{className:`space-y-6`,children:[r.summary&&(0,L.jsx)(`div`,{className:`font-body text-xs text-on-surface leading-relaxed`,children:(0,L.jsx)(u,{children:r.summary})}),(0,L.jsxs)(`div`,{className:`grid grid-cols-1 sm:grid-cols-2 gap-4`,children:[(0,L.jsx)(b,{label:`ID`,children:(0,L.jsx)(`span`,{className:`font-mono text-xs break-all`,children:r.id})}),(0,L.jsx)(b,{label:`Project ID`,children:r.project_id??`—`}),(0,L.jsx)(b,{label:`Job Run ID`,children:r.job_run_id??`—`}),(0,L.jsx)(b,{label:`Tokens Used`,children:r.tokens_used==null?`—`:r.tokens_used.toLocaleString()}),(0,L.jsx)(b,{label:`Created`,children:new Date(r.created_at).toLocaleString()})]}),r.events.length>0&&(0,L.jsxs)(`div`,{children:[(0,L.jsxs)(`div`,{className:`font-label text-xs font-medium text-outline mb-3`,children:[`Events (`,r.events.length,`)`]}),(0,L.jsx)(l,{className:`h-[300px]`,children:(0,L.jsx)(`div`,{className:`space-y-1`,children:[...r.events].sort((e,t)=>new Date(e.created_at).getTime()-new Date(t.created_at).getTime()).map(e=>(0,L.jsx)(X,{event:e},e.id))})})]}),r.snapshot&&(0,L.jsxs)(`div`,{children:[(0,L.jsx)(`div`,{className:`font-label text-xs font-medium text-outline mb-3`,children:`Snapshot`}),(0,L.jsx)(l,{className:`h-[200px]`,children:(0,L.jsx)(`pre`,{className:`font-mono text-xs text-on-surface-variant whitespace-pre-wrap wrap-break-word bg-background border-l border-border p-3`,children:r.snapshot})})]})]}):(0,L.jsx)(`div`,{className:`font-body text-xs text-outline py-8 text-center`,children:`Session not found`})]})]})})}function X({event:e}){let[t,n]=(0,I.useState)(!1),r=e.data!=null;return(0,L.jsxs)(`div`,{className:`border-b border-border/65`,children:[(0,L.jsxs)(`button`,{type:`button`,className:`w-full flex items-center gap-2 px-3 py-2 text-left hover:bg-surface-high transition-colors`,onClick:()=>r&&n(!t),"aria-expanded":r?t:void 0,children:[r?t?(0,L.jsx)(s,{size:10,className:`text-outline shrink-0`}):(0,L.jsx)(p,{size:10,className:`text-outline shrink-0`}):(0,L.jsx)(`span`,{className:`w-[10px] shrink-0`}),(0,L.jsx)(`span`,{className:`inline-flex items-center px-1.5 py-0.5 text-[10px] font-label font-medium ${J(e.type)}`,children:e.type}),(0,L.jsx)(`span`,{className:`flex-1 font-body text-xs text-outline truncate`,children:Z(e.data)}),(0,L.jsx)(`span`,{className:`font-label text-[10px] text-outline shrink-0`,children:new Date(e.created_at).toLocaleTimeString()})]}),t&&r&&(0,L.jsx)(`div`,{className:`px-3 pb-2`,children:(0,L.jsx)(`pre`,{className:`font-mono text-xs text-on-surface-variant whitespace-pre-wrap wrap-break-word bg-background border-l border-border/65 p-2 max-h-48 overflow-auto`,children:JSON.stringify(e.data,null,2)})})]})}function Z(e){if(e==null)return``;if(typeof e==`string`)return e;if(typeof e==`object`){let t=e;if(typeof t.path==`string`)return t.path;if(typeof t.content==`string`)return t.content.length>80?`${t.content.slice(0,80)}...`:t.content;if(typeof t.message==`string`)return t.message;if(typeof t.summary==`string`)return t.summary;let n=Object.keys(t);return n.length<=3?n.join(`, `):`${n.length} fields`}return String(e)}var Q=25,$=`font-label text-xs font-medium text-outline`;function ee({projectId:e}){let t=m(`xl`),[n,r]=w(`order`,`desc`,[`asc`,`desc`]),[i,a]=(0,I.useState)({order:n,page:0}),o=i.order===n?i.page:0,s=e=>a({order:n,page:e}),{selectedId:c,openDetail:l,closeDetail:u}=C(`/audit`,`sessionId`),{data:d,isLoading:p,error:h,refetch:g}=O({...e===`all`?{}:{project_id:e},limit:Q,offset:o*Q,order:n});if(h)return(0,L.jsx)(x,{message:h.message,onRetry:()=>g()});let _=d?.sessions??[],v=d?.total??0;return(0,L.jsxs)(`section`,{"data-testid":`logged-sessions`,children:[(0,L.jsxs)(`div`,{className:`mb-4 flex flex-wrap items-center justify-between gap-2`,children:[(0,L.jsxs)(`span`,{className:`text-xs text-outline`,children:[v,` records`]}),(0,L.jsxs)(`select`,{"aria-label":`Sort audit by date`,"data-testid":`audit-date-sort`,value:n,onChange:e=>{s(0),r(e.target.value)},className:`form-control form-control-single w-auto max-w-full`,children:[(0,L.jsx)(`option`,{value:`desc`,children:`Created: newest first`}),(0,L.jsx)(`option`,{value:`asc`,children:`Created: oldest first`})]})]}),p?(0,L.jsx)(`div`,{className:`space-y-2`,children:[...[,,,,,]].map((e,t)=>(0,L.jsx)(f,{className:`h-10 w-full bg-surface-highest`},t))}):_.length===0?(0,L.jsx)(T,{message:`No audit records`}):(0,L.jsxs)(`div`,{className:`min-w-0 overflow-hidden`,children:[t?(0,L.jsxs)(P,{children:[(0,L.jsx)(k,{children:(0,L.jsxs)(M,{className:`border-b border-border hover:bg-transparent`,children:[(0,L.jsx)(A,{className:$,children:`Agent`}),(0,L.jsx)(A,{className:`${$} w-24`,children:`Version`}),(0,L.jsx)(A,{className:$,children:`Summary`}),(0,L.jsx)(A,{className:`${$} w-24`,children:`Project`}),(0,L.jsx)(A,{className:`${$} w-28`,children:`Tokens used`}),(0,L.jsx)(A,{className:`${$} w-36`,children:`Created`})]})}),(0,L.jsx)(j,{children:_.map(e=>(0,L.jsxs)(M,{"data-testid":`session-row`,"data-session-id":e.id,className:`border-b border-border/65 hover:bg-surface-high cursor-pointer`,onClick:()=>l(e.id),children:[(0,L.jsx)(N,{className:`font-label text-xs text-primary`,children:(0,L.jsx)(`button`,{type:`button`,className:`text-left font-medium hover:underline`,onClick:t=>{t.stopPropagation(),l(e.id)},children:e.agent??`Session`})}),(0,L.jsx)(N,{className:`font-label text-xs text-outline`,children:e.agent_version??`—`}),(0,L.jsx)(N,{className:`font-body text-xs text-on-surface-variant max-w-sm truncate`,children:e.summary??`—`}),(0,L.jsx)(N,{className:`font-label text-xs text-outline`,children:e.project_id?e.project_id.slice(-6):`—`}),(0,L.jsx)(N,{className:`font-label text-xs text-outline text-right`,children:e.tokens_used==null?`—`:e.tokens_used.toLocaleString()}),(0,L.jsx)(N,{className:`font-label text-xs text-outline`,children:new Date(e.created_at).toLocaleString()})]},e.id))})]}):(0,L.jsx)(`div`,{className:`divide-y divide-border`,children:_.map(e=>(0,L.jsxs)(`article`,{"data-testid":`session-row`,"data-session-id":e.id,className:`py-3 space-y-2`,children:[(0,L.jsx)(`button`,{type:`button`,className:`min-h-8 text-sm text-left font-medium text-primary wrap-break-word`,onClick:()=>l(e.id),children:e.agent??`Session`}),(0,L.jsx)(`p`,{className:`text-sm leading-relaxed text-on-surface wrap-break-word`,children:e.summary??`No summary recorded`}),(0,L.jsxs)(`div`,{className:`flex flex-wrap gap-x-4 gap-y-2 text-xs text-outline`,children:[(0,L.jsxs)(`span`,{children:[`Version `,e.agent_version??`—`]}),(0,L.jsxs)(`span`,{children:[e.tokens_used?.toLocaleString()??`—`,` tokens`]}),(0,L.jsx)(`span`,{children:e.project_id?`Project ${e.project_id.slice(-6)}`:`Unassigned`}),(0,L.jsx)(`span`,{children:new Date(e.created_at).toLocaleString()})]})]},e.id))}),(0,L.jsx)(E,{page:o,pageSize:Q,total:v,onPage:s})]}),(0,L.jsx)(Y,{sessionId:c,open:!!c,onClose:u})]})}function te({projectId:e}){let t=F(e),n=i(),r=n.pathname.startsWith(`/audit/`)||n.hash===`#records`||new URLSearchParams(n.search).has(`agent`)||new URLSearchParams(n.search).has(`order`),[a,o]=(0,I.useState)(r);return(0,I.useEffect)(()=>{r&&o(!0)},[r]),(0,L.jsxs)(`div`,{children:[(0,L.jsx)(S,{title:`Audit`,help:`Meaningful workspace changes, request and job outcomes, and notification history. Events remain until the configured audit retention expires.`}),(0,L.jsx)(G,{projectId:t},t),(0,L.jsxs)(`details`,{open:a,onToggle:e=>o(e.currentTarget.open),"data-testid":`audit-session-history`,className:`mt-6 border-t border-border pt-3`,children:[(0,L.jsx)(`summary`,{className:`min-h-11 cursor-pointer py-2 text-sm font-medium md:min-h-8`,children:`Logged session history`}),(0,L.jsx)(ee,{projectId:t},t)]})]})}export{te as default};
|