@toren-run/console 0.1.0
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/LICENSE +202 -0
- package/dist/app.css +299 -0
- package/dist/app.js +1 -0
- package/dist/index.html +15 -0
- package/dist/serve.js +3 -0
- package/package.json +40 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
|
|
2
|
+
Apache License
|
|
3
|
+
Version 2.0, January 2004
|
|
4
|
+
http://www.apache.org/licenses/
|
|
5
|
+
|
|
6
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
7
|
+
|
|
8
|
+
1. Definitions.
|
|
9
|
+
|
|
10
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
11
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
12
|
+
|
|
13
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
14
|
+
the copyright owner that is granting the License.
|
|
15
|
+
|
|
16
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
17
|
+
other entities that control, are controlled by, or are under common
|
|
18
|
+
control with that entity. For the purposes of this definition,
|
|
19
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
20
|
+
direction or management of such entity, whether by contract or
|
|
21
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
22
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
23
|
+
|
|
24
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
25
|
+
exercising permissions granted by this License.
|
|
26
|
+
|
|
27
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
28
|
+
including but not limited to software source code, documentation
|
|
29
|
+
source, and configuration files.
|
|
30
|
+
|
|
31
|
+
"Object" form shall mean any form resulting from mechanical
|
|
32
|
+
transformation or translation of a Source form, including but
|
|
33
|
+
not limited to compiled object code, generated documentation,
|
|
34
|
+
and conversions to other media types.
|
|
35
|
+
|
|
36
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
37
|
+
Object form, made available under the License, as indicated by a
|
|
38
|
+
copyright notice that is included in or attached to the work
|
|
39
|
+
(an example is provided in the Appendix below).
|
|
40
|
+
|
|
41
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
42
|
+
form, that is based on (or derived from) the Work and for which the
|
|
43
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
44
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
45
|
+
of this License, Derivative Works shall not include works that remain
|
|
46
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
47
|
+
the Work and Derivative Works thereof.
|
|
48
|
+
|
|
49
|
+
"Contribution" shall mean any work of authorship, including
|
|
50
|
+
the original version of the Work and any modifications or additions
|
|
51
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
52
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
53
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
54
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
55
|
+
means any form of electronic, verbal, or written communication sent
|
|
56
|
+
to the Licensor or its representatives, including but not limited to
|
|
57
|
+
communication on electronic mailing lists, source code control systems,
|
|
58
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
59
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
60
|
+
excluding communication that is conspicuously marked or otherwise
|
|
61
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
62
|
+
|
|
63
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
64
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
65
|
+
subsequently incorporated within the Work.
|
|
66
|
+
|
|
67
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
68
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
69
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
70
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
71
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
72
|
+
Work and such Derivative Works in Source or Object form.
|
|
73
|
+
|
|
74
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
75
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
76
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
77
|
+
(except as stated in this section) patent license to make, have made,
|
|
78
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
79
|
+
where such license applies only to those patent claims licensable
|
|
80
|
+
by such Contributor that are necessarily infringed by their
|
|
81
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
82
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
83
|
+
institute patent litigation against any entity (including a
|
|
84
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
85
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
86
|
+
or contributory patent infringement, then any patent licenses
|
|
87
|
+
granted to You under this License for that Work shall terminate
|
|
88
|
+
as of the date such litigation is filed.
|
|
89
|
+
|
|
90
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
91
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
92
|
+
modifications, and in Source or Object form, provided that You
|
|
93
|
+
meet the following conditions:
|
|
94
|
+
|
|
95
|
+
(a) You must give any other recipients of the Work or
|
|
96
|
+
Derivative Works a copy of this License; and
|
|
97
|
+
|
|
98
|
+
(b) You must cause any modified files to carry prominent notices
|
|
99
|
+
stating that You changed the files; and
|
|
100
|
+
|
|
101
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
102
|
+
that You distribute, all copyright, patent, trademark, and
|
|
103
|
+
attribution notices from the Source form of the Work,
|
|
104
|
+
excluding those notices that do not pertain to any part of
|
|
105
|
+
the Derivative Works; and
|
|
106
|
+
|
|
107
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
108
|
+
distribution, then any Derivative Works that You distribute must
|
|
109
|
+
include a readable copy of the attribution notices contained
|
|
110
|
+
within such NOTICE file, excluding those notices that do not
|
|
111
|
+
pertain to any part of the Derivative Works, in at least one
|
|
112
|
+
of the following places: within a NOTICE text file distributed
|
|
113
|
+
as part of the Derivative Works; within the Source form or
|
|
114
|
+
documentation, if provided along with the Derivative Works; or,
|
|
115
|
+
within a display generated by the Derivative Works, if and
|
|
116
|
+
wherever such third-party notices normally appear. The contents
|
|
117
|
+
of the NOTICE file are for informational purposes only and
|
|
118
|
+
do not modify the License. You may add Your own attribution
|
|
119
|
+
notices within Derivative Works that You distribute, alongside
|
|
120
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
121
|
+
that such additional attribution notices cannot be construed
|
|
122
|
+
as modifying the License.
|
|
123
|
+
|
|
124
|
+
You may add Your own copyright statement to Your modifications and
|
|
125
|
+
may provide additional or different license terms and conditions
|
|
126
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
127
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
128
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
129
|
+
the conditions stated in this License.
|
|
130
|
+
|
|
131
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
132
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
133
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
134
|
+
this License, without any additional terms or conditions.
|
|
135
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
136
|
+
the terms of any separate license agreement you may have executed
|
|
137
|
+
with Licensor regarding such Contributions.
|
|
138
|
+
|
|
139
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
140
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
141
|
+
except as required for reasonable and customary use in describing the
|
|
142
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
143
|
+
|
|
144
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
145
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
146
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
147
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
148
|
+
implied, including, without limitation, any warranties or conditions
|
|
149
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
150
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
151
|
+
appropriateness of using or redistributing the Work and assume any
|
|
152
|
+
risks associated with Your exercise of permissions under this License.
|
|
153
|
+
|
|
154
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
155
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
156
|
+
unless required by applicable law (such as deliberate and grossly
|
|
157
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
158
|
+
liable to You for damages, including any direct, indirect, special,
|
|
159
|
+
incidental, or consequential damages of any character arising as a
|
|
160
|
+
result of this License or out of the use or inability to use the
|
|
161
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
162
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
163
|
+
other commercial damages or losses), even if such Contributor
|
|
164
|
+
has been advised of the possibility of such damages.
|
|
165
|
+
|
|
166
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
167
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
168
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
169
|
+
or other liability obligations and/or rights consistent with this
|
|
170
|
+
License. However, in accepting such obligations, You may act only
|
|
171
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
172
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
173
|
+
defend, and hold each Contributor harmless for any liability
|
|
174
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
175
|
+
of your accepting any such warranty or additional liability.
|
|
176
|
+
|
|
177
|
+
END OF TERMS AND CONDITIONS
|
|
178
|
+
|
|
179
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
180
|
+
|
|
181
|
+
To apply the Apache License to your work, attach the following
|
|
182
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
183
|
+
replaced with your own identifying information. (Don't include
|
|
184
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
185
|
+
comment syntax for the file format. We also recommend that a
|
|
186
|
+
file or class name and description of purpose be included on the
|
|
187
|
+
same "printed page" as the copyright notice for easier
|
|
188
|
+
identification within third-party archives.
|
|
189
|
+
|
|
190
|
+
Copyright [yyyy] [name of copyright owner]
|
|
191
|
+
|
|
192
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
193
|
+
you may not use this file except in compliance with the License.
|
|
194
|
+
You may obtain a copy of the License at
|
|
195
|
+
|
|
196
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
197
|
+
|
|
198
|
+
Unless required by applicable law or agreed to in writing, software
|
|
199
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
200
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
201
|
+
See the License for the specific language governing permissions and
|
|
202
|
+
limitations under the License.
|
package/dist/app.css
ADDED
|
@@ -0,0 +1,299 @@
|
|
|
1
|
+
/* Toren Console — the drafting sheet, working edition. */
|
|
2
|
+
|
|
3
|
+
:root {
|
|
4
|
+
--paper: #f8f7f3; --ink: #122134; --teal: #0a8884; --signal: #f4571c;
|
|
5
|
+
--line: #d8e0e4; --muted: #5b6b7b; --card: #ffffff; --navy: #101d2c; --navy-ink: #cfe3e0;
|
|
6
|
+
--grid: rgba(18, 33, 52, 0.05);
|
|
7
|
+
--shadow: 5px 5px 0 rgba(18, 33, 52, 0.10);
|
|
8
|
+
--border: 2px solid var(--ink);
|
|
9
|
+
}
|
|
10
|
+
* { box-sizing: border-box; }
|
|
11
|
+
body {
|
|
12
|
+
margin: 0; color: var(--ink);
|
|
13
|
+
font: 15.5px/1.55 "Source Sans 3", "Segoe UI", system-ui, sans-serif;
|
|
14
|
+
background:
|
|
15
|
+
linear-gradient(var(--grid) 1px, transparent 1px),
|
|
16
|
+
linear-gradient(90deg, var(--grid) 1px, transparent 1px),
|
|
17
|
+
var(--paper);
|
|
18
|
+
background-size: 30px 30px, 30px 30px, auto;
|
|
19
|
+
}
|
|
20
|
+
code, pre, .mono { font-family: "JetBrains Mono", ui-monospace, monospace; }
|
|
21
|
+
h1 { font: 800 30px/1.1 Archivo, sans-serif; letter-spacing: -0.01em; margin: 2px 0 0; }
|
|
22
|
+
h2 { font: 800 21px/1.15 Archivo, sans-serif; margin: 4px 0 8px; }
|
|
23
|
+
.muted { color: var(--muted); }
|
|
24
|
+
.dim { color: var(--muted); font-size: 13px; }
|
|
25
|
+
.fine { color: var(--muted); font-size: 12.5px; margin: 10px 0 0; }
|
|
26
|
+
|
|
27
|
+
.overline {
|
|
28
|
+
font: 700 10.5px "JetBrains Mono", monospace; letter-spacing: 0.14em;
|
|
29
|
+
color: var(--muted); text-transform: uppercase;
|
|
30
|
+
}
|
|
31
|
+
.overline.signal { color: var(--signal); }
|
|
32
|
+
.overline .mono { color: var(--ink); }
|
|
33
|
+
|
|
34
|
+
/* ---- shell */
|
|
35
|
+
.shell { min-height: 100vh; display: flex; flex-direction: column; }
|
|
36
|
+
.topbar {
|
|
37
|
+
display: flex; align-items: center; gap: 26px; padding: 13px 26px;
|
|
38
|
+
background: color-mix(in srgb, var(--paper) 90%, transparent);
|
|
39
|
+
border-bottom: 1.5px solid var(--ink); position: sticky; top: 0; z-index: 5;
|
|
40
|
+
backdrop-filter: blur(6px);
|
|
41
|
+
}
|
|
42
|
+
.brand { display: flex; align-items: center; gap: 9px; color: var(--ink); text-decoration: none; }
|
|
43
|
+
.brand b { font: 800 15px Archivo, sans-serif; letter-spacing: 0.28em; }
|
|
44
|
+
.dwg {
|
|
45
|
+
font: 500 9.5px "JetBrains Mono", monospace; letter-spacing: 0.12em; color: var(--muted);
|
|
46
|
+
border: 1px solid var(--line); border-radius: 3px; padding: 3px 7px; white-space: nowrap;
|
|
47
|
+
}
|
|
48
|
+
.topbar nav { display: flex; gap: 18px; }
|
|
49
|
+
.topbar nav a { color: var(--ink); text-decoration: none; font-weight: 600; font-size: 14px; padding-bottom: 2px; border-bottom: 2.5px solid transparent; }
|
|
50
|
+
.topbar nav a.on { border-bottom-color: var(--teal); }
|
|
51
|
+
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
|
|
52
|
+
.role { font: 700 10px "JetBrains Mono", monospace; letter-spacing: 0.12em; color: var(--teal); }
|
|
53
|
+
.foot {
|
|
54
|
+
margin-top: auto; padding: 14px 26px; border-top: 1px solid var(--line);
|
|
55
|
+
font: 500 10px "JetBrains Mono", monospace; letter-spacing: 0.1em; color: var(--muted);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.page { width: min(1060px, 100%); margin: 0 auto; padding: 30px 26px 60px; }
|
|
59
|
+
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
|
|
60
|
+
.head-actions { display: flex; align-items: center; gap: 16px; }
|
|
61
|
+
.h-run { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
|
|
62
|
+
|
|
63
|
+
.live-dot { font: 700 10px "JetBrains Mono", monospace; letter-spacing: 0.14em; color: var(--teal); display: inline-flex; align-items: center; gap: 6px; }
|
|
64
|
+
.live-dot i { width: 7px; height: 7px; border-radius: 50%; background: var(--teal); animation: pulse 1.6s infinite; }
|
|
65
|
+
@keyframes pulse { 0%,100% { opacity: 1 } 50% { opacity: 0.25 } }
|
|
66
|
+
|
|
67
|
+
/* ---- buttons & inputs */
|
|
68
|
+
button { font: 600 14px "Source Sans 3", sans-serif; cursor: pointer; border-radius: 5px; }
|
|
69
|
+
.btn-primary {
|
|
70
|
+
background: var(--signal); color: #fff; border: none; padding: 9px 18px;
|
|
71
|
+
box-shadow: 3px 3px 0 rgba(18,33,52,.85); transition: transform .12s, box-shadow .12s;
|
|
72
|
+
}
|
|
73
|
+
.btn-primary:hover { transform: translate(1px,1px); box-shadow: 2px 2px 0 rgba(18,33,52,.85); }
|
|
74
|
+
.btn-primary:disabled { opacity: 0.5; cursor: default; transform: none; }
|
|
75
|
+
.btn-ghost { background: var(--card); border: 1.5px solid var(--ink); padding: 8px 14px; color: var(--ink); }
|
|
76
|
+
.btn-ghost:hover { border-color: var(--teal); color: var(--teal); }
|
|
77
|
+
.btn-deny { background: var(--card); border: 1.5px solid var(--signal); color: var(--signal); padding: 8px 14px; }
|
|
78
|
+
.btn-deny:hover { background: var(--signal); color: #fff; }
|
|
79
|
+
.sm { padding: 5px 10px; font-size: 12.5px; }
|
|
80
|
+
.copy { background: none; border: none; color: var(--teal); font-size: 13px; padding: 0 3px; }
|
|
81
|
+
input, textarea {
|
|
82
|
+
font: 500 14px "JetBrains Mono", monospace; color: var(--ink);
|
|
83
|
+
background: var(--card); border: 1.5px solid var(--line); border-radius: 5px; padding: 10px 12px;
|
|
84
|
+
width: 100%;
|
|
85
|
+
}
|
|
86
|
+
input:focus, textarea:focus { outline: none; border-color: var(--teal); }
|
|
87
|
+
.form-err { color: var(--signal); font-size: 13.5px; margin: 10px 0 0; font-weight: 600; }
|
|
88
|
+
|
|
89
|
+
/* ---- login */
|
|
90
|
+
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
|
|
91
|
+
.login-card {
|
|
92
|
+
width: min(480px, 100%); background: var(--card); border: var(--border); border-radius: 6px;
|
|
93
|
+
box-shadow: 8px 8px 0 rgba(18,33,52,.10); padding: 34px 34px 26px;
|
|
94
|
+
transform: rotate(-0.4deg);
|
|
95
|
+
}
|
|
96
|
+
.login-brand { display: flex; align-items: center; gap: 9px; margin-bottom: 18px; }
|
|
97
|
+
.login-brand b { font: 800 15px Archivo, sans-serif; letter-spacing: 0.28em; }
|
|
98
|
+
.login-card h1 { font-size: 32px; margin-bottom: 8px; }
|
|
99
|
+
.login-card p { margin: 0 0 18px; }
|
|
100
|
+
.login-card input { margin-bottom: 14px; }
|
|
101
|
+
.login-card .btn-primary { width: 100%; padding: 12px; font-size: 15px; }
|
|
102
|
+
|
|
103
|
+
/* ---- tables */
|
|
104
|
+
.sheet-table {
|
|
105
|
+
width: 100%; border-collapse: collapse; background: var(--card);
|
|
106
|
+
border: var(--border); box-shadow: var(--shadow);
|
|
107
|
+
}
|
|
108
|
+
.sheet-table th {
|
|
109
|
+
font: 700 10.5px "JetBrains Mono", monospace; letter-spacing: 0.1em; text-transform: uppercase;
|
|
110
|
+
color: var(--muted); text-align: left; padding: 10px 14px; border-bottom: 1.5px solid var(--ink);
|
|
111
|
+
background: var(--paper);
|
|
112
|
+
}
|
|
113
|
+
.sheet-table td { padding: 11px 14px; border-bottom: 1px solid var(--line); }
|
|
114
|
+
.sheet-table tr:last-child td { border-bottom: none; }
|
|
115
|
+
.rowlink { cursor: pointer; }
|
|
116
|
+
.rowlink:hover td { background: color-mix(in srgb, var(--teal) 6%, transparent); }
|
|
117
|
+
.row-dead td { opacity: 0.55; }
|
|
118
|
+
|
|
119
|
+
/* ---- chips */
|
|
120
|
+
.chip {
|
|
121
|
+
font: 700 10.5px "JetBrains Mono", monospace; letter-spacing: 0.08em; text-transform: uppercase;
|
|
122
|
+
padding: 3px 9px; border-radius: 3px; border: 1.5px solid; white-space: nowrap;
|
|
123
|
+
}
|
|
124
|
+
.chip-running { color: var(--teal); border-color: var(--teal); }
|
|
125
|
+
.chip-completed { color: #fff; background: var(--teal); border-color: var(--teal); }
|
|
126
|
+
.chip-failed { color: #fff; background: var(--signal); border-color: var(--signal); }
|
|
127
|
+
.chip-created, .chip-pending { color: var(--muted); border-color: var(--line); }
|
|
128
|
+
.chip-cancelled { color: var(--muted); border-color: var(--muted); }
|
|
129
|
+
.chip-waiting_approval { color: var(--signal); border-color: var(--signal); animation: pulse 1.6s infinite; }
|
|
130
|
+
|
|
131
|
+
/* ---- empty state */
|
|
132
|
+
.empty {
|
|
133
|
+
background: var(--card); border: 2px dashed var(--line); border-radius: 6px; padding: 44px;
|
|
134
|
+
display: grid; gap: 6px; justify-items: center; color: var(--muted);
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
/* ---- run detail */
|
|
138
|
+
.io-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 18px; }
|
|
139
|
+
@media (max-width: 760px) { .io-grid { grid-template-columns: 1fr; } }
|
|
140
|
+
.io-pane { background: var(--navy); border: var(--border); border-radius: 6px; box-shadow: var(--shadow); overflow: hidden; }
|
|
141
|
+
.io-label { font: 700 10px "JetBrains Mono", monospace; letter-spacing: 0.14em; color: #6fd3c7; padding: 9px 14px 0; }
|
|
142
|
+
.io-pane pre {
|
|
143
|
+
margin: 6px 0 0; padding: 6px 14px 14px; color: var(--navy-ink);
|
|
144
|
+
font-size: 12.5px; line-height: 1.55; white-space: pre-wrap; word-break: break-word;
|
|
145
|
+
max-height: 300px; overflow: auto;
|
|
146
|
+
}
|
|
147
|
+
.err-text { color: #ff9d7a !important; }
|
|
148
|
+
|
|
149
|
+
.waves { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
|
|
150
|
+
.wave-pill {
|
|
151
|
+
font: 600 11px "JetBrains Mono", monospace; letter-spacing: 0.06em;
|
|
152
|
+
border: 1.5px solid var(--ink); border-radius: 4px; padding: 5px 10px; background: var(--card);
|
|
153
|
+
}
|
|
154
|
+
.wave-pill b { color: var(--signal); }
|
|
155
|
+
.wave-pill.done b { color: var(--teal); }
|
|
156
|
+
|
|
157
|
+
.approve-card {
|
|
158
|
+
background: var(--card); border: var(--border); border-left: 6px solid var(--signal);
|
|
159
|
+
border-radius: 6px; box-shadow: var(--shadow); padding: 16px 18px; margin-bottom: 4px;
|
|
160
|
+
}
|
|
161
|
+
.approve-row { display: grid; gap: 12px; margin-top: 12px; }
|
|
162
|
+
.approve-what b { font-family: "JetBrains Mono", monospace; font-size: 14px; }
|
|
163
|
+
.approve-actions { display: flex; gap: 10px; flex-wrap: wrap; }
|
|
164
|
+
.approve-actions input { flex: 1; min-width: 220px; }
|
|
165
|
+
|
|
166
|
+
/* ---- event streams */
|
|
167
|
+
.streams { display: grid; gap: 14px; margin-top: 10px; }
|
|
168
|
+
.stream { background: var(--card); border: var(--border); border-radius: 6px; box-shadow: var(--shadow); overflow: hidden; }
|
|
169
|
+
.stream-head {
|
|
170
|
+
font: 700 11.5px "JetBrains Mono", monospace; letter-spacing: 0.08em;
|
|
171
|
+
padding: 9px 14px; border-bottom: 1.5px solid var(--ink); background: var(--paper);
|
|
172
|
+
}
|
|
173
|
+
.ev summary {
|
|
174
|
+
display: flex; align-items: center; gap: 12px; padding: 7px 14px; cursor: pointer;
|
|
175
|
+
border-bottom: 1px solid var(--line); list-style: none;
|
|
176
|
+
}
|
|
177
|
+
.ev summary::-webkit-details-marker { display: none; }
|
|
178
|
+
.ev summary:hover { background: color-mix(in srgb, var(--teal) 5%, transparent); }
|
|
179
|
+
.ev-seq { font: 500 11px "JetBrains Mono", monospace; color: var(--muted); }
|
|
180
|
+
.ev-type { font: 600 12.5px "JetBrains Mono", monospace; }
|
|
181
|
+
.ev-ink { color: var(--ink); } .ev-teal { color: var(--teal); } .ev-signal { color: var(--signal); } .ev-amber { color: #b8410f; }
|
|
182
|
+
.ev-usage { margin-left: auto; font: 500 10.5px "JetBrains Mono", monospace; color: var(--muted); }
|
|
183
|
+
.ev-payload {
|
|
184
|
+
margin: 0; padding: 10px 14px 12px 44px; background: var(--navy); color: var(--navy-ink);
|
|
185
|
+
font-size: 11.5px; line-height: 1.5; white-space: pre-wrap; word-break: break-word;
|
|
186
|
+
max-height: 260px; overflow: auto;
|
|
187
|
+
}
|
|
188
|
+
.ev-payload.inline { border-radius: 5px; padding: 10px 12px; max-height: 160px; }
|
|
189
|
+
|
|
190
|
+
/* ---- agent page */
|
|
191
|
+
.stat-strip { display: flex; gap: 0; background: var(--card); border: var(--border); border-radius: 6px; box-shadow: var(--shadow); margin-bottom: 18px; overflow: hidden; }
|
|
192
|
+
.stat { flex: 1; display: grid; justify-items: center; gap: 0; padding: 14px 8px; border-right: 1px solid var(--line); }
|
|
193
|
+
.stat:last-child { border-right: none; }
|
|
194
|
+
.stat b { font: 800 26px Archivo, sans-serif; }
|
|
195
|
+
.stat b.teal { color: var(--teal); } .stat b.signal { color: var(--signal); }
|
|
196
|
+
.stat span { font: 600 10px "JetBrains Mono", monospace; letter-spacing: 0.12em; color: var(--muted); text-transform: uppercase; }
|
|
197
|
+
|
|
198
|
+
.agent-card { background: var(--card); border: var(--border); border-radius: 6px; box-shadow: var(--shadow); padding: 16px 18px; margin-bottom: 16px; }
|
|
199
|
+
.agent-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
|
|
200
|
+
.agent-ref { font: 700 11px "JetBrains Mono", monospace; letter-spacing: 0.1em; color: var(--signal); }
|
|
201
|
+
.model-chip { font: 600 12px "JetBrains Mono", monospace; background: var(--navy); color: var(--navy-ink); padding: 3px 10px; border-radius: 4px; }
|
|
202
|
+
.agent-env { margin: 10px 0 2px; font-size: 13px; }
|
|
203
|
+
.agent-env code { background: rgba(18,33,52,.07); border-radius: 4px; padding: 2px 7px; margin-right: 6px; font-size: 12px; }
|
|
204
|
+
.tool-table { width: 100%; border-collapse: collapse; margin-top: 12px; }
|
|
205
|
+
.tool-table th { font: 700 10px "JetBrains Mono", monospace; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); text-align: left; padding: 6px 10px; border-bottom: 1.5px solid var(--ink); }
|
|
206
|
+
.tool-table td { padding: 8px 10px; border-bottom: 1px solid var(--line); font-size: 13.5px; }
|
|
207
|
+
.tool-table tr:last-child td { border-bottom: none; }
|
|
208
|
+
|
|
209
|
+
/* ---- sessions chat */
|
|
210
|
+
.chat-page { display: flex; flex-direction: column; min-height: calc(100vh - 140px); }
|
|
211
|
+
.chat { flex: 1; display: flex; flex-direction: column; gap: 14px; padding: 8px 0 18px; }
|
|
212
|
+
.bubble { max-width: 76%; }
|
|
213
|
+
.bubble.user { align-self: flex-end; }
|
|
214
|
+
.bubble.assistant { align-self: flex-start; }
|
|
215
|
+
.bubble-meta {
|
|
216
|
+
font: 700 9.5px "JetBrains Mono", monospace; letter-spacing: .12em;
|
|
217
|
+
color: var(--muted); margin: 0 4px 4px;
|
|
218
|
+
}
|
|
219
|
+
.bubble.user .bubble-meta { text-align: right; }
|
|
220
|
+
.bubble-text {
|
|
221
|
+
border: 2px solid var(--ink); border-radius: 6px; padding: 10px 14px;
|
|
222
|
+
background: var(--card); box-shadow: 3px 3px 0 rgba(18,33,52,.08);
|
|
223
|
+
white-space: pre-wrap; word-break: break-word; font-size: 15px; line-height: 1.5;
|
|
224
|
+
}
|
|
225
|
+
.bubble.user .bubble-text { background: var(--navy); color: var(--navy-ink); border-color: var(--navy); }
|
|
226
|
+
.bubble.assistant .bubble-text { border-left: 5px solid var(--teal); }
|
|
227
|
+
.bubble.thinking .bubble-text { color: var(--muted); font-style: italic; }
|
|
228
|
+
.dots { animation: pulse 1.4s infinite; }
|
|
229
|
+
.chat-input { display: flex; gap: 10px; position: sticky; bottom: 0; padding: 12px 0 4px; background: var(--paper); }
|
|
230
|
+
.chat-input input { flex: 1; font-family: "Source Sans 3", sans-serif; font-size: 15px; }
|
|
231
|
+
.chat-closed {
|
|
232
|
+
text-align: center; padding: 14px; border: 2px dashed var(--line); border-radius: 6px;
|
|
233
|
+
color: var(--muted); font-size: 14px;
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
/* ---- schedules */
|
|
237
|
+
.sched-form { margin-bottom: 16px; display: grid; gap: 10px; }
|
|
238
|
+
.sched-row { display: grid; grid-template-columns: 1fr 1.4fr 1fr auto; gap: 10px; }
|
|
239
|
+
@media (max-width: 760px) { .sched-row { grid-template-columns: 1fr; } }
|
|
240
|
+
.sched-actions { display: flex; gap: 8px; justify-content: flex-end; }
|
|
241
|
+
|
|
242
|
+
/* ---- keys */
|
|
243
|
+
.key-form { display: flex; gap: 12px; margin-bottom: 16px; }
|
|
244
|
+
.key-form input { max-width: 380px; }
|
|
245
|
+
.minted {
|
|
246
|
+
background: var(--card); border: var(--border); border-left: 6px solid var(--signal);
|
|
247
|
+
border-radius: 6px; box-shadow: var(--shadow); padding: 14px 18px; margin-bottom: 16px;
|
|
248
|
+
}
|
|
249
|
+
.minted-row { display: flex; align-items: center; gap: 12px; margin-top: 8px; flex-wrap: wrap; }
|
|
250
|
+
.minted-row code { background: var(--navy); color: var(--navy-ink); padding: 8px 12px; border-radius: 5px; font-size: 13px; word-break: break-all; }
|
|
251
|
+
|
|
252
|
+
/* ---- fleet */
|
|
253
|
+
.crew { margin-bottom: 30px; }
|
|
254
|
+
.crew-title { font: 800 19px Archivo, sans-serif; margin-bottom: 10px; display: flex; align-items: center; }
|
|
255
|
+
.agent-select { display: flex; gap: 8px; flex-wrap: wrap; margin: 4px 0 12px; }
|
|
256
|
+
.agent-opt {
|
|
257
|
+
font: 600 12.5px "JetBrains Mono", monospace; background: var(--card);
|
|
258
|
+
border: 1.5px solid var(--line); border-radius: 4px; padding: 6px 12px; color: var(--ink);
|
|
259
|
+
}
|
|
260
|
+
.agent-opt.on { border-color: var(--teal); color: var(--teal); background: color-mix(in srgb, var(--teal) 7%, transparent); }
|
|
261
|
+
|
|
262
|
+
/* ---- modal */
|
|
263
|
+
.modal-back { position: fixed; inset: 0; background: rgba(18,33,52,.35); display: grid; place-items: center; z-index: 10; padding: 20px; }
|
|
264
|
+
.modal {
|
|
265
|
+
width: min(560px, 100%); background: var(--card); border: var(--border); border-radius: 6px;
|
|
266
|
+
box-shadow: 10px 10px 0 rgba(18,33,52,.18); padding: 24px 26px;
|
|
267
|
+
}
|
|
268
|
+
.modal textarea { margin-top: 6px; }
|
|
269
|
+
.modal-actions { display: flex; justify-content: flex-end; gap: 12px; margin-top: 16px; }
|
|
270
|
+
|
|
271
|
+
/* ---- mobile polish */
|
|
272
|
+
@media (max-width: 760px) {
|
|
273
|
+
input, textarea, .chat-input input { font-size: 16px; } /* stops iOS zoom-on-focus */
|
|
274
|
+
.topbar { padding: 10px 14px; gap: 14px; }
|
|
275
|
+
.topbar nav { overflow-x: auto; scrollbar-width: none; flex: 1; }
|
|
276
|
+
.topbar nav::-webkit-scrollbar { display: none; }
|
|
277
|
+
.page { padding: 20px 14px 70px; }
|
|
278
|
+
.page-head { margin-bottom: 14px; }
|
|
279
|
+
h1 { font-size: 26px; }
|
|
280
|
+
.sheet-table { display: block; overflow-x: auto; }
|
|
281
|
+
.bubble { max-width: 88%; }
|
|
282
|
+
.chat-input { padding-bottom: calc(6px + env(safe-area-inset-bottom)); }
|
|
283
|
+
button, .btn-primary, .btn-ghost, .btn-deny { min-height: 42px; }
|
|
284
|
+
.sm { min-height: 34px; }
|
|
285
|
+
}
|
|
286
|
+
@media (max-width: 560px) {
|
|
287
|
+
.role { display: none; }
|
|
288
|
+
.head-actions .live-dot { display: none; }
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
/* ---- chat attachments */
|
|
292
|
+
.attach-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
|
|
293
|
+
.attach-chip {
|
|
294
|
+
display: inline-flex; align-items: center; gap: 6px;
|
|
295
|
+
font: 600 12px "JetBrains Mono", monospace; color: var(--teal);
|
|
296
|
+
border: 1.5px solid var(--teal); border-radius: 4px; padding: 3px 8px; background: var(--card);
|
|
297
|
+
}
|
|
298
|
+
.attach-x { background: none; border: none; color: var(--muted); font-size: 14px; padding: 0 2px; }
|
|
299
|
+
.attach-btn { padding: 8px 12px; }
|
package/dist/app.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var z,g,yt,Kt,I,ft,bt,kt,st,j,U,wt,rt,at,ot,zt,B={},q=[],Jt=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,J=Array.isArray;function N(n,e){for(var s in e)n[s]=e[s];return n}function it(n){n&&n.parentNode&&n.parentNode.removeChild(n)}function Yt(n,e,s){var r,i,a,l={};for(a in e)a=="key"?r=e[a]:a=="ref"?i=e[a]:l[a]=e[a];if(arguments.length>2&&(l.children=arguments.length>3?z.call(arguments,2):s),typeof n=="function"&&n.defaultProps!=null)for(a in n.defaultProps)l[a]===void 0&&(l[a]=n.defaultProps[a]);return G(n,l,r,i,null)}function G(n,e,s,r,i){var a={type:n,props:e,key:s,ref:r,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:i??++yt,__i:-1,__u:0};return i==null&&g.vnode!=null&&g.vnode(a),a}function L(n){return n.children}function V(n,e){this.props=n,this.context=e}function $(n,e){if(e==null)return n.__?$(n.__,n.__i+1):null;for(var s;e<n.__k.length;e++)if((s=n.__k[e])!=null&&s.__e!=null)return s.__e;return typeof n.type=="function"?$(n):null}function Zt(n){if(n.__P&&n.__d){var e=n.__v,s=e.__e,r=[],i=[],a=N({},e);a.__v=e.__v+1,g.vnode&&g.vnode(a),lt(n.__P,a,e,n.__n,n.__P.namespaceURI,32&e.__u?[s]:null,r,s??$(e),!!(32&e.__u),i),a.__v=e.__v,a.__.__k[a.__i]=a,xt(r,a,i),e.__e=e.__=null,a.__e!=s&&St(a)}}function St(n){if((n=n.__)!=null&&n.__c!=null)return n.__e=n.__c.base=null,n.__k.some(function(e){if(e!=null&&e.__e!=null)return n.__e=n.__c.base=e.__e}),St(n)}function vt(n){(!n.__d&&(n.__d=!0)&&I.push(n)&&!K.__r++||ft!=g.debounceRendering)&&((ft=g.debounceRendering)||bt)(K)}function K(){try{for(var n,e=1;I.length;)I.length>e&&I.sort(kt),n=I.shift(),e=I.length,Zt(n)}finally{I.length=K.__r=0}}function Tt(n,e,s,r,i,a,l,c,p,_,d){var h,o,u,v,y,S,T=r&&r.__k||q,f=e.length;for(p=Qt(s,e,T,p,f),h=0;h<f;h++)(u=s.__k[h])!=null&&(o=u.__i!=-1&&T[u.__i]||B,u.__i=h,S=lt(n,u,o,i,a,l,c,p,_,d),v=u.__e,u.ref&&o.ref!=u.ref&&(o.ref&&ct(o.ref,null,u),d.push(u.ref,u.__c||v,u)),y==null&&v!=null&&(y=v),4&u.__u?(p=Et(u,p,n),o.__e&&(o.__e=null)):typeof u.type=="function"&&S!==void 0?p=S:v&&(p=v.nextSibling),u.__u&=-7);return s.__e=y,p}function Qt(n,e,s,r,i){var a,l,c,p,_,d=s.length,h=d,o=0;for(n.__k=new Array(i),a=0;a<i;a++)(l=e[a])!=null&&typeof l!="boolean"&&typeof l!="function"?(typeof l=="string"||typeof l=="number"||typeof l=="bigint"||l.constructor==String?l=n.__k[a]=G(null,l,null,null,null):J(l)?l=n.__k[a]=G(L,{children:l},null,null,null):l.constructor===void 0&&l.__b>0?l=n.__k[a]=G(l.type,l.props,l.key,l.ref?l.ref:null,l.__v):n.__k[a]=l,p=a+o,l.__=n,l.__b=n.__b+1,c=null,(_=l.__i=Xt(l,s,p,h))!=-1&&(h--,(c=s[_])&&(c.__u|=2)),c==null||c.__v==null?(_==-1&&(i>d?o--:i<d&&o++),typeof l.type!="function"&&(l.__u|=4)):_!=p&&(_==p-1?o--:_==p+1?o++:(_>p?o--:o++,l.__u|=4))):n.__k[a]=null;if(h)for(a=0;a<d;a++)(c=s[a])!=null&&!(2&c.__u)&&(c.__e==r&&(r=$(c)),Nt(c,c));return r}function Et(n,e,s){var r,i;if(typeof n.type=="function"){for(r=n.__k,i=0;r&&i<r.length;i++)r[i]&&(r[i].__=n,e=Et(r[i],e,s));return e}n.__e!=e&&(e&&n.type&&!e.parentNode&&(e=$(n)),e=s.insertBefore(n.__e,e||null));do e=e&&e.nextSibling;while(e!=null&&e.nodeType==8);return e}function Xt(n,e,s,r){var i,a,l,c=n.key,p=n.type,_=e[s],d=_!=null&&(2&_.__u)==0;if(_===null&&c==null||d&&c==_.key&&p==_.type)return s;if(r>(d?1:0)){for(i=s-1,a=s+1;i>=0||a<e.length;)if((_=e[l=i>=0?i--:a++])!=null&&!(2&_.__u)&&c==_.key&&p==_.type)return l}return-1}function mt(n,e,s){e[0]=="-"?n.setProperty(e,s??""):n[e]=s==null?"":typeof s!="number"||Jt.test(e)?s:s+"px"}function W(n,e,s,r,i){var a,l;t:if(e=="style")if(typeof s=="string")n.style.cssText=s;else{if(typeof r=="string"&&(n.style.cssText=r=""),r)for(e in r)s&&e in s||mt(n.style,e,"");if(s)for(e in s)r&&s[e]==r[e]||mt(n.style,e,s[e])}else if(e[0]=="o"&&e[1]=="n")a=e!=(e=e.replace(wt,"$1")),l=e.toLowerCase(),e=l in n||e=="onFocusOut"||e=="onFocusIn"?l.slice(2):e.slice(2),n.l||(n.l={}),n.l[e+a]=s,s?r?s[U]=r[U]:(s[U]=rt,n.addEventListener(e,a?ot:at,a)):n.removeEventListener(e,a?ot:at,a);else{if(i=="http://www.w3.org/2000/svg")e=e.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(e!="width"&&e!="height"&&e!="href"&&e!="list"&&e!="form"&&e!="tabIndex"&&e!="download"&&e!="rowSpan"&&e!="colSpan"&&e!="role"&&e!="popover"&&e in n)try{n[e]=s??"";break t}catch{}typeof s=="function"||(s==null||s===!1&&e[4]!="-"?n.removeAttribute(e):n.setAttribute(e,e=="popover"&&s==1?"":s))}}function gt(n){return function(e){if(this.l){var s=this.l[e.type+n];if(e[j]==null)e[j]=rt++;else if(e[j]<s[U])return;return s(g.event?g.event(e):e)}}}function lt(n,e,s,r,i,a,l,c,p,_){var d,h,o,u,v,y,S,T,f,k,O,C,P,R,F,nt,x=e.type;if(e.constructor!==void 0)return null;128&s.__u&&(p=!!(32&s.__u),a=[c=e.__e=s.__e]),(d=g.__b)&&d(e);t:if(typeof x=="function"){h=l.length;try{if(f=e.props,k=x.prototype&&x.prototype.render,O=(d=x.contextType)&&r[d.__c],C=d?O?O.props.value:d.__:r,s.__c?T=(o=e.__c=s.__c).__=o.__E:(k?e.__c=o=new x(f,C):(e.__c=o=new V(f,C),o.constructor=x,o.render=ee),O&&O.sub(o),o.state||(o.state={}),o.__n=r,u=o.__d=!0,o.__h=[],o._sb=[]),k&&o.__s==null&&(o.__s=o.state),k&&x.getDerivedStateFromProps!=null&&(o.__s==o.state&&(o.__s=N({},o.__s)),N(o.__s,x.getDerivedStateFromProps(f,o.__s))),v=o.props,y=o.state,o.__v=e,u)k&&x.getDerivedStateFromProps==null&&o.componentWillMount!=null&&o.componentWillMount(),k&&o.componentDidMount!=null&&o.__h.push(o.componentDidMount);else{if(k&&x.getDerivedStateFromProps==null&&f!==v&&o.componentWillReceiveProps!=null&&o.componentWillReceiveProps(f,C),e.__v==s.__v||!o.__e&&o.shouldComponentUpdate!=null&&o.shouldComponentUpdate(f,o.__s,C)===!1){e.__v!=s.__v&&(o.props=f,o.state=o.__s,o.__d=!1),e.__e=s.__e,e.__k=s.__k,e.__k.some(function(D){D&&(D.__=e)}),q.push.apply(o.__h,o._sb),o._sb=[],o.__h.length&&l.push(o),c=$(s);break t}o.componentWillUpdate!=null&&o.componentWillUpdate(f,o.__s,C),k&&o.componentDidUpdate!=null&&o.__h.push(function(){o.componentDidUpdate(v,y,S)})}if(o.context=C,o.props=f,o.__P=n,o.__e=!1,P=g.__r,R=0,k)o.state=o.__s,o.__d=!1,P&&P(e),d=o.render(o.props,o.state,o.context),q.push.apply(o.__h,o._sb),o._sb=[];else do o.__d=!1,P&&P(e),d=o.render(o.props,o.state,o.context),o.state=o.__s;while(o.__d&&++R<25);o.state=o.__s,o.getChildContext!=null&&(r=N(N({},r),o.getChildContext())),k&&!u&&o.getSnapshotBeforeUpdate!=null&&(S=o.getSnapshotBeforeUpdate(v,y)),F=d!=null&&d.type===L&&d.key==null?At(d.props.children):d,c=Tt(n,J(F)?F:[F],e,s,r,i,a,l,c,p,_),o.base=e.__e,e.__u&=-161,o.__h.length&&l.push(o),T&&(o.__E=o.__=null)}catch(D){if(l.length=h,e.__v=null,p||a!=null){if(D.then){for(e.__u|=p?160:128;c&&c.nodeType==8&&c.nextSibling;)c=c.nextSibling;a!=null&&(a[a.indexOf(c)]=null),e.__e=c}else if(a!=null)for(nt=a.length;nt--;)it(a[nt])}else e.__e=s.__e;e.__k==null&&(e.__k=s.__k||[]),D.then||Ct(e),g.__e(D,e,s)}}else a==null&&e.__v==s.__v?(e.__k=s.__k,e.__e=s.__e):c=e.__e=te(s.__e,e,s,r,i,a,l,p,_);return(d=g.diffed)&&d(e),128&e.__u?void 0:c}function Ct(n){n&&(n.__c&&(n.__c.__e=!0),n.__k&&n.__k.some(Ct))}function xt(n,e,s){for(var r=0;r<s.length;r++)ct(s[r],s[++r],s[++r]);g.__c&&g.__c(e,n),n.some(function(i){try{n=i.__h,i.__h=[],n.some(function(a){a.call(i)})}catch(a){g.__e(a,i.__v)}})}function At(n){return typeof n!="object"||n==null||n.__b>0?n:J(n)?n.map(At):n.constructor!==void 0?null:N({},n)}function te(n,e,s,r,i,a,l,c,p){var _,d,h,o,u,v,y,S=s.props||B,T=e.props,f=e.type;if(f=="svg"?i="http://www.w3.org/2000/svg":f=="math"?i="http://www.w3.org/1998/Math/MathML":i||(i="http://www.w3.org/1999/xhtml"),a!=null){for(_=0;_<a.length;_++)if((u=a[_])&&"setAttribute"in u==!!f&&(f?u.localName==f:u.nodeType==3)){n=u,a[_]=null;break}}if(n==null){if(f==null)return document.createTextNode(T);n=document.createElementNS(i,f,T.is&&T),c&&(g.__m&&g.__m(e,a),c=!1),a=null}if(f==null)S===T||c&&n.data==T||(n.data=T);else{if(a=f=="textarea"&&T.defaultValue!=null?null:a&&z.call(n.childNodes),!c&&a!=null)for(S={},_=0;_<n.attributes.length;_++)S[(u=n.attributes[_]).name]=u.value;for(_ in S)u=S[_],_=="dangerouslySetInnerHTML"?h=u:_=="children"||_ in T||_=="value"&&"defaultValue"in T||_=="checked"&&"defaultChecked"in T||W(n,_,null,u,i);for(_ in T)u=T[_],_=="children"?o=u:_=="dangerouslySetInnerHTML"?d=u:_=="value"?v=u:_=="checked"?y=u:c&&typeof u!="function"||S[_]===u||W(n,_,u,S[_],i);if(d)c||h&&(d.__html==h.__html||d.__html==n.innerHTML)||(n.innerHTML=d.__html),e.__k=[];else if(h&&(n.innerHTML=""),Tt(e.type=="template"?n.content:n,J(o)?o:[o],e,s,r,f=="foreignObject"?"http://www.w3.org/1999/xhtml":i,a,l,a?a[0]:s.__k&&$(s,0),c,p),a!=null)for(_=a.length;_--;)it(a[_]);c&&f!="textarea"||(_="value",f=="progress"&&v==null?n.removeAttribute("value"):v!=null&&(v!==n[_]||f=="progress"&&!v||f=="option"&&v!=S[_])&&W(n,_,v,S[_],i),_="checked",y!=null&&y!=n[_]&&W(n,_,y,S[_],i))}return n}function ct(n,e,s){try{if(typeof n=="function"){var r=typeof n.__u=="function";r&&n.__u(),r&&e==null||(n.__u=n(e))}else n.current=e}catch(i){g.__e(i,s)}}function Nt(n,e,s){var r,i;if(g.unmount&&g.unmount(n),(r=n.ref)&&(r.current&&r.current!=n.__e||ct(r,null,e)),(r=n.__c)!=null){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(a){g.__e(a,e)}r.base=r.__P=r.__n=null}if(r=n.__k)for(i=0;i<r.length;i++)r[i]&&Nt(r[i],e,s||typeof n.type!="function");s||it(n.__e),n.__c=n.__=n.__e=void 0}function ee(n,e,s){return this.constructor(n,s)}function It(n,e,s){var r,i,a,l;e==document&&(e=document.documentElement),g.__&&g.__(n,e),i=(r=typeof s=="function")?null:s&&s.__k||e.__k,a=[],l=[],lt(e,n=(!r&&s||e).__k=Yt(L,null,[n]),i||B,B,e.namespaceURI,!r&&s?[s]:i?null:e.firstChild?z.call(e.childNodes):null,a,!r&&s?s:i?i.__e:e.firstChild,r,l),xt(a,n,l),n.props.children=null}z=q.slice,g={__e:function(n,e,s,r){for(var i,a,l;e=e.__;)if((i=e.__c)&&!i.__)try{if((a=i.constructor)&&a.getDerivedStateFromError!=null&&(i.setState(a.getDerivedStateFromError(n)),l=i.__d),i.componentDidCatch!=null&&(i.componentDidCatch(n,r||{}),l=i.__d),l)return i.__E=i}catch(c){n=c}throw n}},yt=0,Kt=function(n){return n!=null&&n.constructor===void 0},V.prototype.setState=function(n,e){var s;s=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=N({},this.state),typeof n=="function"&&(n=n(N({},s),this.props)),n&&N(s,n),n!=null&&this.__v&&(e&&this._sb.push(e),vt(this))},V.prototype.forceUpdate=function(n){this.__v&&(this.__e=!0,n&&this.__h.push(n),vt(this))},V.prototype.render=L,I=[],bt=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,kt=function(n,e){return n.__v.__b-e.__v.__b},K.__r=0,st=Math.random().toString(8),j="__d"+st,U="__a"+st,wt=/(PointerCapture)$|Capture$/i,rt=0,at=gt(!1),ot=gt(!0),zt=0;var H,w,ut,Ot,Z=0,Mt=[],E=g,Pt=E.__b,Rt=E.__r,$t=E.diffed,Dt=E.__c,Lt=E.unmount,Ut=E.__;function dt(n,e){E.__h&&E.__h(w,n,Z||e),Z=0;var s=w.__H||(w.__H={__:[],__h:[]});return n>=s.__.length&&s.__.push({}),s.__[n]}function m(n){return Z=1,ne(Wt,n)}function ne(n,e,s){var r=dt(H++,2);if(r.t=n,!r.__c&&(r.__=[s?s(e):Wt(void 0,e),function(c){var p=r.__N?r.__N[0]:r.__[0],_=r.t(p,c);p!==_&&(r.__N=[_,r.__[1]],r.__c.setState({}))}],r.__c=w,!w.__f)){var i=function(c,p,_){if(!r.__c.__H)return!0;var d=!1,h=r.__c.props!==c;if(r.__c.__H.__.some(function(u){if(u.__N){d=!0;var v=u.__[0];u.__=u.__N,u.__N=void 0,v!==u.__[0]&&(h=!0)}}),a){var o=a.call(this,c,p,_);return d?o||h:o}return!d||h};w.__f=!0;var a=w.shouldComponentUpdate,l=w.componentWillUpdate;w.componentWillUpdate=function(c,p,_){if(this.__e){var d=a;a=void 0,i(c,p,_),a=d}l&&l.call(this,c,p,_)},w.shouldComponentUpdate=i}return r.__N||r.__}function A(n,e){var s=dt(H++,3);!E.__s&&Ft(s.__H,e)&&(s.__=n,s.u=e,w.__H.__h.push(s))}function Q(n){return Z=5,se(function(){return{current:n}},[])}function se(n,e){var s=dt(H++,7);return Ft(s.__H,e)&&(s.__=n(),s.__H=e,s.__h=n),s.__}function ae(){for(var n;n=Mt.shift();){var e=n.__H;if(n.__P&&e)try{e.__h.some(Y),e.__h.some(_t),e.__h=[]}catch(s){e.__h=[],E.__e(s,n.__v)}}}E.__b=function(n){w=null,Pt&&Pt(n)},E.__=function(n,e){n&&e.__k&&e.__k.__m&&(n.__m=e.__k.__m),Ut&&Ut(n,e)},E.__r=function(n){Rt&&Rt(n),H=0;var e=(w=n.__c).__H;e&&(ut===w?(e.__h=[],w.__h=[],e.__.some(function(s){s.__N&&(s.__=s.__N),s.u=s.__N=void 0})):(e.__h.some(Y),e.__h.some(_t),e.__h=[],H=0)),ut=w},E.diffed=function(n){$t&&$t(n);var e=n.__c;e&&e.__H&&(e.__H.__h.length&&(Mt.push(e)!==1&&Ot===E.requestAnimationFrame||((Ot=E.requestAnimationFrame)||oe)(ae)),e.__H.__.some(function(s){s.u&&(s.__H=s.u,s.u=void 0)})),ut=w=null},E.__c=function(n,e){e.some(function(s){try{s.__h.some(Y),s.__h=s.__h.filter(function(r){return!r.__||_t(r)})}catch(r){e.some(function(i){i.__h&&(i.__h=[])}),e=[],E.__e(r,s.__v)}}),Dt&&Dt(n,e)},E.unmount=function(n){Lt&&Lt(n);var e,s=n.__c;s&&s.__H&&(s.__H.__.some(function(r){try{Y(r)}catch(i){e=i}}),s.__H=void 0,e&&E.__e(e,s.__v))};var Ht=typeof requestAnimationFrame=="function";function oe(n){var e,s=function(){clearTimeout(r),Ht&&cancelAnimationFrame(e),setTimeout(n)},r=setTimeout(s,35);Ht&&(e=requestAnimationFrame(s))}function Y(n){var e=w,s=n.__c;typeof s=="function"&&(n.__c=void 0,s()),w=e}function _t(n){var e=w;n.__c=n.__(),w=e}function Ft(n,e){return!n||n.length!==e.length||e.some(function(s,r){return s!==n[r]})}function Wt(n,e){return typeof e=="function"?e(n):e}var re=0,Ee=Array.isArray;function t(n,e,s,r,i,a){e||(e={});var l,c,p=e;if("ref"in p)for(c in p={},e)c=="ref"?l=e[c]:p[c]=e[c];var _={type:n,props:p,key:s,ref:l,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--re,__i:-1,__u:0,__source:i,__self:a};if(typeof n=="function"&&(l=n.defaultProps))for(c in l)p[c]===void 0&&(p[c]=l[c]);return g.vnode&&g.vnode(_),_}var pt="toren.console.token",Gt=()=>localStorage.getItem(pt)??"",Vt=n=>localStorage.setItem(pt,n),Bt=()=>localStorage.removeItem(pt);async function b(n,e,s){let r=await fetch(e,{method:n,headers:{authorization:`Bearer ${Gt()}`,...s!==void 0?{"content-type":"application/json"}:{}},...s!==void 0?{body:JSON.stringify(s)}:{}}),i=await r.json().catch(()=>({}));if(!r.ok){let a=new Error(i.error??`${r.status}`);throw a.status=r.status,a}return i}var X=n=>(n??"").slice(0,8),tt=n=>{if(!n)return"\u2014";let e=Math.max(0,(Date.now()-new Date(n).getTime())/1e3);return e<60?`${Math.floor(e)}s ago`:e<3600?`${Math.floor(e/60)}m ago`:e<86400?`${Math.floor(e/3600)}h ago`:`${Math.floor(e/86400)}d ago`};function M(n,e,s){let[r,i]=m(0);return A(()=>{let a=!0,l=async()=>{try{await n()}catch{}a&&i(p=>p+1)};l();let c=setInterval(l,e);return()=>{a=!1,clearInterval(c)}},s??[]),r}function ht(n){navigator.clipboard?.writeText(n)}var et=({status:n,waiting:e})=>{let s=e?"waiting_approval":n;return t("span",{class:`chip chip-${s}`,children:s==="waiting_approval"?"awaiting approval":s})},qt=()=>t("svg",{viewBox:"0 0 64 104",width:"15",height:"25","aria-hidden":"true",children:[t("defs",{children:t("mask",{id:"cm",children:[t("rect",{width:"64",height:"104",fill:"white"}),t("rect",{x:"-16",y:"47",width:"96",height:"8",fill:"black",transform:"rotate(-12 32 52)"})]})}),t("rect",{x:"12",y:"4",width:"40",height:"96",rx:"7",fill:"currentColor",mask:"url(#cm)"})]});function ie({onIn:n}){let[e,s]=m(""),[r,i]=m(""),[a,l]=m(!1);return t("div",{class:"login-wrap",children:t("form",{class:"login-card",onSubmit:async p=>{p.preventDefault(),l(!0),i(""),Vt(e.trim());try{await b("GET","/runs"),n()}catch{Bt(),i("That credential was refused. Paste the admin token (TOREN_API_TOKEN) or an issued API key.")}finally{l(!1)}},children:[t("div",{class:"login-brand",children:[t(qt,{})," ",t("b",{children:"TOREN"})," ",t("span",{class:"dwg",children:"CONSOLE"})]}),t("h1",{children:"Present credentials."}),t("p",{class:"muted",children:["The admin token unlocks everything, including key management. An issued API key (",t("code",{children:"trn_\u2026"}),") operates runs and approvals only."]}),t("input",{type:"password",autofocus:!0,placeholder:"TOREN_API_TOKEN \xB7 trn_\u2026",value:e,onInput:p=>s(p.currentTarget.value)}),r&&t("div",{class:"form-err",children:r}),t("button",{class:"btn-primary",disabled:a||!e.trim(),children:a?"Checking\u2026":"Enter the console"}),t("p",{class:"fine",children:["Tip: ",t("code",{children:"toren dev"})," prints a pre-authenticated link."]})]})})}function le({nav:n}){let[e,s]=m(null),[r,i]=m(!1);return M(async()=>s((await b("GET","/runs")).runs.filter(a=>a.mode!=="session")),2500),t("div",{class:"page",children:[t("div",{class:"page-head",children:[t("div",{children:[t("div",{class:"overline",children:"SHT 01 \xB7 OPERATIONS"}),t("h1",{children:"Runs"})]}),t("div",{class:"head-actions",children:[t("span",{class:"live-dot",title:"polling every 2.5s",children:[t("i",{}),"LIVE"]}),t("button",{class:"btn-primary",onClick:()=>i(!0),children:"+ New run"})]})]}),e===null?t("div",{class:"empty",children:"Loading\u2026"}):e.length===0?t("div",{class:"empty",children:[t("b",{children:"No runs yet."}),t("span",{children:["Start one here, or from the CLI: ",t("code",{children:`toren run . --input '"hello"'`})]})]}):t("table",{class:"sheet-table",children:[t("thead",{children:t("tr",{children:[t("th",{children:"Run"}),t("th",{children:"Agent"}),t("th",{children:"Status"}),t("th",{children:"Started"})]})}),t("tbody",{children:e.map(a=>t("tr",{class:"rowlink",onClick:()=>n(`#/runs/${a.runId}`),children:[t("td",{class:"mono",children:[X(a.runId),t("span",{class:"dim",children:"\u2026"})]}),t("td",{children:[a.agent,a.process&&a.process!=="main"&&t("span",{class:"dim",children:[" \xB7 ",a.process]})]}),t("td",{children:t(et,{status:a.status})}),t("td",{class:"dim",children:tt(a.createdAt)})]},a.runId))})]}),r&&t(ce,{onClose:()=>i(!1),nav:n})]})}function ce({onClose:n,nav:e}){let[s,r]=m(""),[i,a]=m(""),[l,c]=m([]),[p,_]=m(""),[d,h]=m(!1);return A(()=>{b("GET","/agent").then(u=>{let v=u.agent?.crews?Object.keys(u.agent.crews):[u.agent?.name].filter(Boolean);c(v),a(u.agent?.default??v[0]??"")}).catch(()=>{})},[]),t("div",{class:"modal-back",onClick:u=>u.target===u.currentTarget&&n(),children:t("form",{class:"modal",onSubmit:async u=>{u.preventDefault(),h(!0),_("");try{let{runId:v}=await b("POST","/runs",{input:s,...i?{agent:i}:{}});n(),e(`#/runs/${v}`)}catch(v){_(String(v.message))}finally{h(!1)}},children:[t("div",{class:"overline",children:"NEW RUN"}),t("h2",{children:"Give the agent its input"}),l.length>1&&t("div",{class:"agent-select",children:l.map(u=>t("button",{type:"button",class:`agent-opt${u===i?" on":""}`,onClick:()=>a(u),children:u},u))}),t("p",{class:"muted",children:["Passed verbatim as the workflow's ",t("code",{children:"ctx.input"})," string; many agents expect JSON, e.g. ",t("code",{children:'["topic a","topic b"]'}),"."]}),t("textarea",{rows:"4",autofocus:!0,placeholder:'["research this","and this"]',value:s,onInput:u=>r(u.currentTarget.value)}),p&&t("div",{class:"form-err",children:p}),t("div",{class:"modal-actions",children:[t("button",{type:"button",class:"btn-ghost",onClick:n,children:"Cancel"}),t("button",{class:"btn-primary",disabled:d||!s.trim(),children:d?"Starting\u2026":"Start run"})]})]})})}var ue={LlmCallCompleted:"teal",ToolCallCompleted:"teal",TaskCompleted:"teal",WaveSettled:"teal",RunCompleted:"teal",RunFailed:"signal",TaskFailed:"signal",StreamInvalidated:"signal",ApprovalRequested:"amber"};function _e({e:n}){let e=ue[n.type]??"ink",s=n.payload?.usage;return t("details",{class:"ev",children:[t("summary",{children:[t("span",{class:"ev-seq",children:String(n.seq).padStart(3,"0")}),t("span",{class:`ev-type ev-${e}`,children:n.type}),s&&t("span",{class:"ev-usage",children:[s.inputTokens,"\u25B8",s.outputTokens," tok"]})]}),t("pre",{class:"ev-payload",children:JSON.stringify(n.payload,null,2)})]})}function jt({name:n,events:e}){return t("div",{class:"stream",children:[t("div",{class:"stream-head",children:[n," ",t("span",{class:"dim",children:["\xB7 ",e.length," events"]})]}),e.map(s=>t(_e,{e:s},`${n}:${s.seq}`))]})}function de({runId:n,isAdmin:e}){let[s,r]=m(null),[i,a]=m(null),[l,c]=m(""),[p,_]=m("");if(M(async()=>{r(await b("GET",`/runs/${n}`)),a(await b("GET",`/runs/${n}/events`))},2500,[n]),!s)return t("div",{class:"page",children:t("div",{class:"empty",children:"Loading\u2026"})});let d=s.run,h=s.approvals??[],o=async(u,v)=>{_("");try{await b("POST",`/runs/${n}/approvals`,{taskId:u.taskId,stepId:u.stepId,granted:v,by:"console",comment:l||void 0}),c("")}catch(y){_(String(y.message))}};return t("div",{class:"page",children:[t("div",{class:"page-head",children:[t("div",{children:[t("div",{class:"overline",children:["RUN ",t("span",{class:"mono",children:X(n)})," ",t("button",{class:"copy",onClick:()=>ht(n),title:"copy full id",children:"\u29C9"})]}),t("h1",{class:"h-run",children:[d.agent,d.process&&d.process!=="main"&&t("span",{class:"dim",children:[" \xB7 ",d.process]})," ",t(et,{status:d.status,waiting:h.length>0})]})]}),t("span",{class:"live-dot",children:[t("i",{}),"LIVE"]})]}),h.length>0&&t("div",{class:"approve-card",children:[t("div",{class:"overline signal",children:"HELD FOR APPROVAL \xB7 ZERO COMPUTE WHILE PARKED"}),h.map(u=>t("div",{class:"approve-row",children:[t("div",{class:"approve-what",children:[t("b",{children:u.tool}),t("pre",{class:"ev-payload inline",children:JSON.stringify(u.args,null,2)})]}),t("div",{class:"approve-actions",children:[t("input",{placeholder:"comment for the agent (optional)",value:l,onInput:v=>c(v.currentTarget.value)}),t("button",{class:"btn-primary",onClick:()=>o(u,!0),children:"Approve"}),t("button",{class:"btn-deny",onClick:()=>o(u,!1),children:"Deny"})]})]},`${u.taskId}:${u.stepId}`)),p&&t("div",{class:"form-err",children:p})]}),t("div",{class:"io-grid",children:[t("div",{class:"io-pane",children:[t("div",{class:"io-label",children:"INPUT"}),t("pre",{children:d.input??"\u2014"})]}),t("div",{class:"io-pane",children:[t("div",{class:"io-label",children:d.status==="failed"?"ERROR":"OUTPUT"}),t("pre",{class:d.status==="failed"?"err-text":"",children:d.error??d.output??(d.status==="running"?"\u2026 still working":"\u2014")})]})]}),(s.waves??[]).length>0&&t("div",{class:"waves",children:s.waves.map(u=>t("span",{class:`wave-pill${u.done?" done":""}`,children:["WAVE ",u.name," ",t("b",{children:[u.settled,"/",u.tasks]})]},u.name))}),t("div",{class:"overline",style:"margin-top:26px",children:"EVENT LOG \xB7 THE SOURCE OF TRUTH"}),i&&t("div",{class:"streams",children:[t(jt,{name:"run",events:i.run??[]}),Object.entries(i.tasks??{}).map(([u,v])=>t(jt,{name:`task:${u}`,events:v},u))]})]})}function pe(){let[n,e]=m(null),[s,r]=m([]);if(A(()=>{b("GET","/agent").then(l=>e(l.agent)),b("GET","/runs").then(l=>r(l.runs.filter(c=>c.mode!=="session"))).catch(()=>{})},[]),!n)return t("div",{class:"page",children:t("div",{class:"empty",children:"Loading\u2026"})});let i=n.crews??{[n.name]:n},a=Object.keys(i);return t("div",{class:"page",children:[t("div",{class:"page-head",children:t("div",{children:[t("div",{class:"overline",children:"SHT 03 \xB7 SPECIFICATION"}),t("h1",{children:a.length===1?a[0]:`${a.length} process agents`})]})}),a.map(l=>{let c=i[l],p=c.agents??{},_=p.main?"main":l,d=[_,...Object.keys(p).filter(u=>u!==_)].filter(u=>p[u]),h=s.filter(u=>u.agent===l),o={total:h.length,completed:h.filter(u=>u.status==="completed").length,failed:h.filter(u=>u.status==="failed").length,running:h.filter(u=>u.status==="running").length};return t("div",{class:"crew",children:[a.length>1&&t("div",{class:"crew-title",children:[l,n.default===l&&t("span",{class:"dwg",style:"margin-left:10px",children:"DEFAULT"})]}),c.processes?.length>1&&t("div",{class:"agent-env",children:["PROCESSES: ",c.processes.map(u=>t("code",{children:[u,c.defaultProcess===u?" (default)":""]},u))," ",t("span",{class:"dim",children:["(named workflows \u2014 trigger with --process or POST /runs ","{process}",")"]})]}),t("div",{class:"stat-strip",children:[t("div",{class:"stat",children:[t("b",{children:o.total}),t("span",{children:"runs"})]}),t("div",{class:"stat",children:[t("b",{class:"teal",children:o.completed}),t("span",{children:"completed"})]}),t("div",{class:"stat",children:[t("b",{class:"signal",children:o.failed}),t("span",{children:"failed"})]}),t("div",{class:"stat",children:[t("b",{children:o.running}),t("span",{children:"in flight"})]})]}),d.map(u=>{let v=p[u];return t("div",{class:"agent-card",children:[t("div",{class:"agent-head",children:[t("span",{class:"agent-ref",children:u===_?"ROOT AGENT":`SUBAGENT \xB7 ${u}`}),t("span",{class:"model-chip",children:v.model}),t("span",{class:"dim",children:["max ",v.maxSteps," steps \xB7 ",v.maxTokens," tok \xB7 prompt ",v.systemChars," chars"]})]}),v.env.length>0&&t("div",{class:"agent-env",children:["ENV: ",v.env.map(y=>t("code",{children:y},y))," ",t("span",{class:"dim",children:"(names only; values never leave the worker)"})]}),v.tools.length===0?t("div",{class:"dim",style:"padding: 4px 0 2px",children:"No tools; pure model reasoning."}):t("table",{class:"tool-table",children:[t("thead",{children:t("tr",{children:[t("th",{children:"Tool"}),t("th",{children:"Description"}),t("th",{children:"Effects"}),t("th",{children:"Approval"})]})}),t("tbody",{children:v.tools.map(y=>t("tr",{children:[t("td",{class:"mono",children:y.name}),t("td",{class:"dim",children:y.description}),t("td",{class:"mono dim",children:y.effects}),t("td",{children:y.approval==="always"?t("span",{class:"chip chip-waiting_approval",style:"animation:none",children:"gated"}):t("span",{class:"dim",children:"auto"})})]},y.name))})]})]},u)})]},l)})]})}function he({nav:n}){let[e,s]=m(null),[r,i]=m([]),[a,l]=m(!1);return M(async()=>s((await b("GET","/sessions")).sessions),3e3),A(()=>{b("GET","/agent").then(c=>{i(c.agent?.crews?Object.keys(c.agent.crews):[c.agent?.name].filter(Boolean))}).catch(()=>{})},[]),t("div",{class:"page",children:[t("div",{class:"page-head",children:[t("div",{children:[t("div",{class:"overline",children:"SHT 05 \xB7 CONVERSATIONS"}),t("h1",{children:"Sessions"})]}),t("div",{class:"head-actions",children:[t("span",{class:"live-dot",children:[t("i",{}),"LIVE"]}),t("button",{class:"btn-primary",onClick:()=>l(!0),children:"+ New session"})]})]}),e===null?t("div",{class:"empty",children:"Loading\u2026"}):e.length===0?t("div",{class:"empty",children:[t("b",{children:"No conversations yet."}),t("span",{children:"Sessions park at zero compute between turns, and they never re-pay a completed one."})]}):t("table",{class:"sheet-table",children:[t("thead",{children:t("tr",{children:[t("th",{children:"Session"}),t("th",{children:"Agent"}),t("th",{children:"Status"}),t("th",{children:"Started"})]})}),t("tbody",{children:e.map(c=>t("tr",{class:"rowlink",onClick:()=>n(`#/sessions/${c.runId}`),children:[t("td",{class:"mono",children:[X(c.runId),t("span",{class:"dim",children:"\u2026"})]}),t("td",{children:c.agent}),t("td",{children:t(et,{status:c.status==="running"?"active":c.status})}),t("td",{class:"dim",children:tt(c.createdAt)})]},c.runId))})]}),a&&t(fe,{agents:r,onClose:()=>l(!1),nav:n})]})}function fe({agents:n,onClose:e,nav:s}){let[r,i]=m(n[0]??""),[a,l]=m(""),[c,p]=m(""),[_,d]=m(!1);return t("div",{class:"modal-back",onClick:o=>o.target===o.currentTarget&&e(),children:t("form",{class:"modal",onSubmit:async o=>{o.preventDefault(),d(!0),p("");try{let{runId:u}=await b("POST","/sessions",{agent:r||void 0,message:a});e(),s(`#/sessions/${u}`)}catch(u){p(String(u.message))}finally{d(!1)}},children:[t("div",{class:"overline",children:"NEW SESSION"}),t("h2",{children:"Start a conversation"}),n.length>1&&t("div",{class:"agent-select",children:n.map(o=>t("button",{type:"button",class:`agent-opt${o===r?" on":""}`,onClick:()=>i(o),children:o},o))}),t("textarea",{rows:"3",autofocus:!0,placeholder:"First message to the agent\u2026",value:a,onInput:o=>l(o.currentTarget.value)}),c&&t("div",{class:"form-err",children:c}),t("div",{class:"modal-actions",children:[t("button",{type:"button",class:"btn-ghost",onClick:e,children:"Cancel"}),t("button",{class:"btn-primary",disabled:_||!a.trim(),children:"Start"})]})]})})}function ve({runId:n}){let[e,s]=m(null),[r,i]=m(""),[a,l]=m(""),[c,p]=m([]),[_,d]=m(!1),h=Q(null),o=Q(null),u=Q(0);if(M(async()=>s(await b("GET",`/sessions/${n}`)),2e3,[n]),A(()=>{let f=e?.transcript?.length??0;f>u.current&&(u.current=f,o.current?.scrollIntoView({behavior:"smooth"}))},[e]),!e)return t("div",{class:"page",children:t("div",{class:"empty",children:"Loading\u2026"})});let v=e.state==="awaiting_input",y=e.state==="working",S=async f=>{l("");try{await b("POST",`/sessions/${n}/messages`,f?{close:!0}:{message:r,channel:"console",...c.length?{files:c.map(k=>k.fileId)}:{}}),f||(i(""),p([])),s({...e,state:"working"})}catch(k){l(String(k.message))}},T=async f=>{l(""),d(!0);try{let k=await new Promise((C,P)=>{let R=new FileReader;R.onload=()=>C(String(R.result).split(",")[1]),R.onerror=P,R.readAsDataURL(f)}),O=await b("POST","/files",{name:f.name,content_base64:k});p(C=>[...C,O])}catch(k){l(String(k.message))}finally{d(!1),h.current&&(h.current.value="")}};return t("div",{class:"page chat-page",children:[t("div",{class:"page-head",children:[t("div",{children:[t("div",{class:"overline",children:["SESSION ",t("span",{class:"mono",children:X(n)})," ",t("button",{class:"copy",onClick:()=>ht(n),title:"copy full id",children:"\u29C9"})]}),t("h1",{class:"h-run",children:[e.agent," ",t(et,{status:e.state==="awaiting_input"?"running":e.state})]})]}),v&&t("button",{class:"btn-deny sm",onClick:()=>S(!0),children:"End session"})]}),t("div",{class:"chat",children:[e.transcript.map(f=>t("div",{class:`bubble ${f.role}`,children:[t("div",{class:"bubble-meta",children:f.role==="user"?`YOU${f.channel?` \xB7 ${f.channel.toUpperCase()}`:""}`:e.agent.toUpperCase()}),t("div",{class:"bubble-text",children:f.text})]},f.seq)),y&&t("div",{class:"bubble assistant thinking",children:[t("div",{class:"bubble-meta",children:e.agent.toUpperCase()}),t("div",{class:"bubble-text",children:["working",t("span",{class:"dots",children:"\u2026"})]})]}),t("div",{ref:o})]}),a&&t("div",{class:"form-err",children:a}),e.state==="completed"?t("div",{class:"chat-closed",children:"Session ended. The full transcript is durable, and it never re-paid a turn."}):t("div",{children:[c.length>0&&t("div",{class:"attach-row",children:c.map(f=>t("span",{class:"attach-chip",children:[f.name," \xB7 ",f.pages,"p",t("button",{type:"button",class:"attach-x",onClick:()=>p(c.filter(k=>k.fileId!==f.fileId)),children:"\xD7"})]},f.fileId))}),t("form",{class:"chat-input",onSubmit:f=>{f.preventDefault(),r.trim()&&S(!1)},children:[t("input",{type:"file",ref:h,style:"display:none",accept:".pdf,.docx,.xlsx,.xls,.txt,.md,.csv,.json,.yaml,.yml,.html,.xml,.log",onChange:f=>{let k=f.currentTarget.files?.[0];k&&T(k)}}),t("button",{type:"button",class:"btn-ghost attach-btn",title:"Attach a file (pdf, docx, xlsx, text)",disabled:!v||_,onClick:()=>h.current?.click(),children:_?"\u2026":"\u{1F4CE}"}),t("input",{placeholder:v?"Your message\u2026":"The agent is working; it has the floor",disabled:!v,value:r,onInput:f=>i(f.currentTarget.value)}),t("button",{class:"btn-primary",disabled:!v||!r.trim(),children:"Send"})]})]})]})}var me=n=>{let e=(new Date(n).getTime()-Date.now())/1e3;return e<=0?"due":e<90?`in ${Math.round(e)}s`:e<5400?`in ${Math.round(e/60)}m`:`in ${Math.round(e/3600)}h`};function ge(){let[n,e]=m(null),[s,r]=m([]),[i,a]=m({agent:"",cron:"",input:"",name:""}),[l,c]=m("");M(async()=>e((await b("GET","/schedules")).schedules),5e3),A(()=>{b("GET","/agent").then(d=>{let h=d.agent?.crews?Object.keys(d.agent.crews):[d.agent?.name].filter(Boolean);r(h),a(o=>({...o,agent:d.agent?.default??h[0]??""}))}).catch(()=>{})},[]);let p=async d=>{d.preventDefault(),c("");try{await b("POST","/schedules",{...i,name:i.name||i.cron}),a(h=>({...h,cron:"",input:"",name:""}))}catch(h){c(String(h.message))}},_=async(d,h)=>{c("");try{h==="rm"?await b("DELETE",`/schedules/${d}`):await b("POST",`/schedules/${d}/${h}`)}catch(o){c(String(o.message))}};return t("div",{class:"page",children:[t("div",{class:"page-head",children:[t("div",{children:[t("div",{class:"overline",children:"SHT 04 \xB7 TIMETABLE"}),t("h1",{children:"Schedules"})]}),t("span",{class:"live-dot",children:[t("i",{}),"LIVE"]})]}),t("form",{class:"sched-form",onSubmit:p,children:[s.length>1&&t("div",{class:"agent-select",children:s.map(d=>t("button",{type:"button",class:`agent-opt${d===i.agent?" on":""}`,onClick:()=>a(h=>({...h,agent:d})),children:d},d))}),t("div",{class:"sched-row",children:[t("input",{placeholder:'cron: "0 9 * * *"',value:i.cron,onInput:d=>a(h=>({...h,cron:d.currentTarget.value}))}),t("input",{placeholder:'input: ["topic"]',value:i.input,onInput:d=>a(h=>({...h,input:d.currentTarget.value}))}),t("input",{placeholder:"name (optional)",value:i.name,onInput:d=>a(h=>({...h,name:d.currentTarget.value}))}),t("button",{class:"btn-primary",disabled:!i.cron.trim()||!i.input.trim(),children:"Schedule"})]})]}),l&&t("div",{class:"form-err",children:l}),n===null?t("div",{class:"empty",children:"Loading\u2026"}):n.length===0?t("div",{class:"empty",children:[t("b",{children:"Nothing scheduled."}),t("span",{children:"Cron-triggered runs fire from the workers: exactly once, crash-safe."})]}):t("table",{class:"sheet-table",children:[t("thead",{children:t("tr",{children:[t("th",{children:"Name"}),t("th",{children:"Agent"}),t("th",{children:"Cron"}),t("th",{children:"Next fire"}),t("th",{children:"Last fired"}),t("th",{})]})}),t("tbody",{children:n.map(d=>t("tr",{class:d.enabled?"":"row-dead",children:[t("td",{children:d.name}),t("td",{children:d.agent}),t("td",{class:"mono",children:[d.cron," ",t("span",{class:"dim",children:d.tz})]}),t("td",{children:d.enabled?t("b",{class:"mono",children:me(d.nextFireAt)}):t("span",{class:"chip chip-cancelled",children:"paused"})}),t("td",{class:"dim",children:tt(d.lastFiredAt)}),t("td",{class:"sched-actions",children:[t("button",{class:"btn-ghost sm",onClick:()=>_(d.id,d.enabled?"pause":"resume"),children:d.enabled?"Pause":"Resume"}),t("button",{class:"btn-deny sm",onClick:()=>_(d.id,"rm"),children:"Delete"})]})]},d.id))})]})]})}function ye(){let[n,e]=m(null),[s,r]=m(""),[i,a]=m(null),[l,c]=m(""),p=async()=>e((await b("GET","/keys")).keys);A(()=>{p().catch(h=>c(String(h.message)))},[]);let _=async h=>{h.preventDefault(),c("");try{let{key:o}=await b("POST","/keys",{name:s});a(o),r(""),await p()}catch(o){c(String(o.message))}},d=async h=>{c("");try{await b("DELETE",`/keys/${h}`),await p()}catch(o){c(String(o.message))}};return t("div",{class:"page",children:[t("div",{class:"page-head",children:t("div",{children:[t("div",{class:"overline",children:"SHT 02 \xB7 ACCESS"}),t("h1",{children:"API keys"})]})}),t("form",{class:"key-form",onSubmit:_,children:[t("input",{placeholder:"key name, e.g. ci-pipeline",value:s,onInput:h=>r(h.currentTarget.value)}),t("button",{class:"btn-primary",disabled:!s.trim(),children:"Issue key"})]}),i&&t("div",{class:"minted",children:[t("div",{class:"overline signal",children:"SECRET \xB7 SHOWN ONCE, STORE IT NOW"}),t("div",{class:"minted-row",children:[t("code",{children:i.secret}),t("button",{class:"btn-ghost",onClick:()=>ht(i.secret),children:"Copy"}),t("button",{class:"btn-ghost",onClick:()=>a(null),children:"Dismiss"})]})]}),l&&t("div",{class:"form-err",children:l}),n&&t("table",{class:"sheet-table",children:[t("thead",{children:t("tr",{children:[t("th",{children:"Key"}),t("th",{children:"Name"}),t("th",{children:"Last used"}),t("th",{children:"Status"}),t("th",{})]})}),t("tbody",{children:n.map(h=>t("tr",{class:h.revokedAt?"row-dead":"",children:[t("td",{class:"mono",children:[h.prefix,"\u2026"]}),t("td",{children:h.name}),t("td",{class:"dim",children:tt(h.lastUsedAt)}),t("td",{children:h.revokedAt?t("span",{class:"chip chip-failed",children:"revoked"}):t("span",{class:"chip chip-completed",children:"active"})}),t("td",{children:!h.revokedAt&&t("button",{class:"btn-deny sm",onClick:()=>d(h.id),children:"Revoke"})})]},h.id))})]})]})}function be(){let[n,e]=m(()=>{let _=location.hash.match(/#token=(.+)$/);return _&&(Vt(decodeURIComponent(_[1])),history.replaceState(null,"",location.pathname+"#/runs")),!!Gt()}),[s,r]=m(location.hash||"#/runs"),[i,a]=m(!1);A(()=>{let _=()=>r(location.hash||"#/runs");return addEventListener("hashchange",_),()=>removeEventListener("hashchange",_)},[]),A(()=>{n&&b("GET","/keys").then(()=>a(!0)).catch(_=>a((_.status!==403,!1)))},[n]);let l=_=>{location.hash=_};if(!n)return t(ie,{onIn:()=>{e(!0),l("#/runs")}});let c=s.match(/^#\/runs\/(.+)$/),p=s.match(/^#\/sessions\/(.+)$/);return t("div",{class:"shell",children:[t("header",{class:"topbar",children:[t("a",{class:"brand",href:"#/runs",children:[t(qt,{})," ",t("b",{children:"TOREN"})," ",t("span",{class:"dwg",children:"CONSOLE \xB7 DWG \u2116 TRN-003"})]}),t("nav",{children:[t("a",{class:s.startsWith("#/runs")?"on":"",href:"#/runs",children:"Runs"}),t("a",{class:s.startsWith("#/sessions")?"on":"",href:"#/sessions",children:"Sessions"}),t("a",{class:s==="#/agent"?"on":"",href:"#/agent",children:"Agent"}),i&&t("a",{class:s==="#/schedules"?"on":"",href:"#/schedules",children:"Schedules"}),i&&t("a",{class:s==="#/keys"?"on":"",href:"#/keys",children:"API keys"})]}),t("div",{class:"topbar-right",children:[t("span",{class:"role",children:i?"ADMIN":"KEY"}),t("button",{class:"btn-ghost sm",onClick:()=>{Bt(),location.reload()},children:"Sign out"})]})]}),p?t(ve,{runId:p[1]}):s.startsWith("#/sessions")?t(he,{nav:l}):c?t(de,{runId:c[1],isAdmin:i}):s==="#/agent"?t(pe,{}):s==="#/schedules"&&i?t(ge,{}):s==="#/keys"&&i?t(ye,{}):t(le,{nav:l}),t("footer",{class:"foot",children:"TOREN CONSOLE \xB7 single deployment \xB7 credentials never leave this browser"})]})}It(t(be,{}),document.getElementById("root"));
|
package/dist/index.html
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8">
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
6
|
+
<title>Toren Console</title>
|
|
7
|
+
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Archivo:wght@500;600;700;800;900&family=Source+Sans+3:ital,wght@0,400;0,600;1,400&family=JetBrains+Mono:wght@400;500;600&display=swap">
|
|
8
|
+
<link rel="stylesheet" href="./app.css">
|
|
9
|
+
<link rel="icon" type="image/svg+xml" href='data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 104"%3E%3Cdefs%3E%3Cmask id="c"%3E%3Crect width="64" height="104" fill="white"/%3E%3Crect x="-16" y="47" width="96" height="8" fill="black" transform="rotate(-12 32 52)"/%3E%3C/mask%3E%3C/defs%3E%3Crect x="12" y="4" width="40" height="96" rx="7" fill="%230a8884" mask="url(%23c)"/%3E%3C/svg%3E'>
|
|
10
|
+
</head>
|
|
11
|
+
<body>
|
|
12
|
+
<div id="root"></div>
|
|
13
|
+
<script type="module" src="./app.js"></script>
|
|
14
|
+
</body>
|
|
15
|
+
</html>
|
package/dist/serve.js
ADDED
package/package.json
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@toren-run/console",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Toren's built-in web console: live runs, event timelines, approvals, API keys. Served by `toren dev`.",
|
|
5
|
+
"license": "Apache-2.0",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"exports": {
|
|
8
|
+
".": "./dist/serve.js"
|
|
9
|
+
},
|
|
10
|
+
"files": [
|
|
11
|
+
"dist"
|
|
12
|
+
],
|
|
13
|
+
"repository": {
|
|
14
|
+
"type": "git",
|
|
15
|
+
"url": "git+https://github.com/toren-run/toren.git",
|
|
16
|
+
"directory": "packages/console"
|
|
17
|
+
},
|
|
18
|
+
"homepage": "https://toren.run",
|
|
19
|
+
"bugs": "https://github.com/toren-run/toren/issues",
|
|
20
|
+
"keywords": [
|
|
21
|
+
"agents",
|
|
22
|
+
"ai",
|
|
23
|
+
"durable-execution",
|
|
24
|
+
"console",
|
|
25
|
+
"dashboard"
|
|
26
|
+
],
|
|
27
|
+
"engines": {
|
|
28
|
+
"node": ">=20"
|
|
29
|
+
},
|
|
30
|
+
"publishConfig": {
|
|
31
|
+
"access": "public"
|
|
32
|
+
},
|
|
33
|
+
"devDependencies": {
|
|
34
|
+
"esbuild": "^0.24.0",
|
|
35
|
+
"preact": "^10.24.0"
|
|
36
|
+
},
|
|
37
|
+
"scripts": {
|
|
38
|
+
"build": "node build.mjs"
|
|
39
|
+
}
|
|
40
|
+
}
|