@monster-orange/den 0.4.17 → 0.4.19

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.
Files changed (49) hide show
  1. package/CHANGELOG.md +177 -0
  2. package/README.md +14 -13
  3. package/docs/distributions.md +138 -25
  4. package/docs/reference.md +1 -1
  5. package/package.json +2 -1
  6. package/skills/install-den/SKILL.md +35 -75
  7. package/src/shared/agents/den-claude.ts +40 -6
  8. package/src/shared/agents/guardrails/stop-hook.ts +30 -4
  9. package/src/shared/agents/guardrails.ts +40 -4
  10. package/src/shared/agents/handback.ts +22 -4
  11. package/src/shared/agents/personas.ts +32 -5
  12. package/src/shared/agents/runtime.ts +8 -0
  13. package/src/shared/agents/server-agent.ts +57 -0
  14. package/src/shared/agents/server-pack/server.md +45 -0
  15. package/src/shared/environment-manager/workspaces.ts +4 -0
  16. package/src/ui/cli/agent-ops.ts +84 -6
  17. package/src/ui/cli/create.ts +2 -2
  18. package/src/ui/cli/index.ts +1 -1
  19. package/src/ui/cli/repo-command.ts +8 -1
  20. package/src/ui/cli/repo-detect.ts +58 -0
  21. package/src/ui/cli/server-agent-ops.ts +411 -0
  22. package/src/ui/mcp/server.ts +29 -12
  23. package/src/ui/mcp/tools.ts +4 -2
  24. package/src/ui/server/agent-routes.ts +10 -1
  25. package/src/ui/server/held-actions.ts +35 -7
  26. package/src/ui/server/index.ts +20 -5
  27. package/src/ui/server/public/agents-page.js +33 -1
  28. package/src/ui/server/public/agents.html +13 -0
  29. package/src/ui/server/public/error-page.js +39 -1
  30. package/src/ui/server/public/graph.css +43 -0
  31. package/src/ui/server/public/graph.js +68 -1
  32. package/src/ui/server/public/header.js +36 -7
  33. package/src/ui/server/public/i18n/es.js +72 -0
  34. package/src/ui/server/public/i18n/ja.js +74 -0
  35. package/src/ui/server/public/local-dev.html +33 -3
  36. package/src/ui/server/public/log-source.js +26 -0
  37. package/src/ui/server/public/logs.html +7 -20
  38. package/src/ui/server/public/persona-ui.css +6 -0
  39. package/src/ui/server/public/server-agent-page.js +415 -0
  40. package/src/ui/server/public/server-agent.html +222 -0
  41. package/src/ui/server/public/services.html +18 -3
  42. package/src/ui/server/public/shell.js +274 -31
  43. package/src/ui/server/public/svc-panel.js +685 -0
  44. package/src/ui/server/public/topbar.js +13 -1
  45. package/src/ui/server/route-classes.ts +21 -0
  46. package/src/ui/server/server-agent-routes.ts +176 -0
  47. package/src/ui/server/session-routes.ts +12 -1
  48. package/src/ui/server/ui-assets.ts +6 -0
  49. package/src/ui/server/workspace-routes.ts +3 -0
@@ -0,0 +1,222 @@
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.0" />
6
+ <script>
7
+ // Mode before first paint: yours (the server fills it in below),
8
+ // else the system's, else the theme's default, else dark.
9
+ (function () {
10
+ var m = "@@DEN_MODE@@";
11
+ if (m !== "dark" && m !== "light") {
12
+ var q = function (s) {
13
+ return (
14
+ window.matchMedia &&
15
+ matchMedia("(prefers-color-scheme: " + s + ")").matches
16
+ );
17
+ };
18
+ m = q("light")
19
+ ? "light"
20
+ : q("dark")
21
+ ? "dark"
22
+ : "@@DEN_DEFAULT_MODE@@";
23
+ }
24
+ document.documentElement.dataset.mode =
25
+ m === "light" ? "light" : "dark";
26
+ })();
27
+ </script>
28
+ <link rel="stylesheet" href="/theme.css" id="theme-css" />
29
+ <link rel="stylesheet" href="/vendor/xterm.css" />
30
+ <title>__DEN_TITLE__ · Server agent</title>
31
+ <style>
32
+ /* The server agent's page (ON-6): the prototype's page header (.ph,
33
+ R20), then the agent's terminal as the page, the Agents tab's pane
34
+ look (.pane .term) without its list. --r is --radius. */
35
+ *,
36
+ *::before,
37
+ *::after {
38
+ box-sizing: border-box;
39
+ }
40
+ html,
41
+ body {
42
+ height: 100%;
43
+ margin: 0;
44
+ background: var(--bg);
45
+ color: var(--text);
46
+ }
47
+ body {
48
+ display: flex;
49
+ flex-direction: column;
50
+ overflow: hidden;
51
+ }
52
+ html body.den-has-shell > #den-content {
53
+ display: flex;
54
+ flex-direction: column;
55
+ min-width: 0;
56
+ min-height: 0;
57
+ overflow: auto;
58
+ padding: 20px 24px 14px 24px;
59
+ font: 14px/1.45 var(--sans);
60
+ color: var(--text);
61
+ }
62
+ #den-content :focus-visible {
63
+ outline: 2px solid var(--accent);
64
+ outline-offset: 2px;
65
+ }
66
+ a {
67
+ color: var(--accent-text);
68
+ }
69
+ .ph {
70
+ display: flex;
71
+ align-items: flex-end;
72
+ gap: 16px;
73
+ flex-wrap: wrap;
74
+ margin-bottom: 12px;
75
+ }
76
+ .ph h1 {
77
+ font: 600 22px/1.2 var(--display);
78
+ margin: 0;
79
+ text-wrap: balance;
80
+ }
81
+ .ph .sub {
82
+ color: var(--muted);
83
+ font-size: 13px;
84
+ margin-top: 4px;
85
+ }
86
+ .ph .acts {
87
+ margin-left: auto;
88
+ display: flex;
89
+ align-items: center;
90
+ gap: 10px;
91
+ flex-wrap: wrap;
92
+ }
93
+ .ph label {
94
+ font-size: 13px;
95
+ color: var(--muted);
96
+ display: flex;
97
+ align-items: center;
98
+ gap: 6px;
99
+ }
100
+ .ph select {
101
+ font: inherit;
102
+ color: var(--text);
103
+ background: var(--surface);
104
+ border: 1px solid var(--border);
105
+ border-radius: var(--radius-button);
106
+ padding: 4px 8px;
107
+ }
108
+ .note {
109
+ color: var(--muted);
110
+ font-size: 13px;
111
+ margin: 0 0 10px;
112
+ }
113
+ .note.bad {
114
+ color: var(--bad);
115
+ }
116
+ h2.sec {
117
+ font: 600 13px var(--mono);
118
+ text-transform: uppercase;
119
+ letter-spacing: 0.07em;
120
+ color: var(--muted);
121
+ margin: 0 0 10px;
122
+ }
123
+ section {
124
+ margin-bottom: 22px;
125
+ }
126
+ code {
127
+ font: 12.5px var(--mono);
128
+ }
129
+ .sa-steps li,
130
+ .sa-install li {
131
+ margin-bottom: 6px;
132
+ }
133
+ .sa-idle {
134
+ display: flex;
135
+ align-items: center;
136
+ gap: 12px;
137
+ margin-bottom: 10px;
138
+ }
139
+ .sa-idle p {
140
+ margin: 0;
141
+ }
142
+ /* The terminal is the page: it takes what is left. */
143
+ #sa-pane {
144
+ flex: 1 1 auto;
145
+ min-height: 0;
146
+ display: flex;
147
+ }
148
+ #sa-pane:empty {
149
+ display: none;
150
+ }
151
+ .sa-term {
152
+ flex: 1 1 auto;
153
+ min-height: 240px;
154
+ min-width: 0;
155
+ display: grid;
156
+ grid-template: minmax(0, 1fr) / minmax(0, 1fr);
157
+ padding: 6px 4px 4px 8px;
158
+ background: var(--sunken);
159
+ border: 1px solid var(--border);
160
+ border-radius: var(--radius);
161
+ overflow: hidden;
162
+ }
163
+ .sa-term .tbox {
164
+ min-height: 0;
165
+ min-width: 0;
166
+ overflow: hidden;
167
+ }
168
+ .sa-term .xterm {
169
+ height: 100%;
170
+ }
171
+ .sa-term .xterm .xterm-viewport {
172
+ background-color: var(--sunken);
173
+ }
174
+ </style>
175
+ </head>
176
+ <body>
177
+ <!-- The shell: top bar and rail, the same on every page (shell.js). -->
178
+ <div id="den-shell" data-page="server-agent"></div>
179
+ <script src="/shell.js"></script>
180
+
181
+ <!-- The page's one main landmark: everything after the shell. -->
182
+ <main id="den-content">
183
+ <div class="ph">
184
+ <div>
185
+ <h1 id="sa-title">__DEN_TITLE__ agent</h1>
186
+ <div class="sub" id="sa-sub"></div>
187
+ </div>
188
+ <div class="acts">
189
+ <label id="sa-runtime" hidden
190
+ ><span>Runs on</span> <select></select
191
+ ></label>
192
+ <label id="sa-model" hidden
193
+ ><span>Model</span> <select></select
194
+ ></label>
195
+ <a class="den-btn" id="sa-open" href="/agents" hidden
196
+ >Open in Agents</a
197
+ >
198
+ </div>
199
+ </div>
200
+ <div id="sa-body" aria-busy="true" aria-live="polite"></div>
201
+ <div id="sa-pane"></div>
202
+
203
+ <script type="module">
204
+ import {
205
+ applyDenConfig,
206
+ initChangelog,
207
+ initHealth,
208
+ initLogBadge,
209
+ initWorkspacePill,
210
+ } from "/header.js";
211
+ import { mountServerAgentPage } from "/server-agent-page.js";
212
+ void Promise.all([
213
+ initHealth(),
214
+ initWorkspacePill(),
215
+ applyDenConfig(),
216
+ initChangelog(),
217
+ ]).then(initLogBadge);
218
+ void mountServerAgentPage(document.getElementById("den-content"));
219
+ </script>
220
+ </main>
221
+ </body>
222
+ </html>
@@ -211,6 +211,20 @@
211
211
  font-weight: 600;
212
212
  color: var(--text);
213
213
  }
214
+ /* 0.4.18: the name opens the service panel (svc-panel.js). */
215
+ .svc-name-btn {
216
+ background: none;
217
+ border: 0;
218
+ padding: 0;
219
+ font: inherit;
220
+ color: inherit;
221
+ cursor: pointer;
222
+ text-align: left;
223
+ }
224
+ .svc-name-btn:hover,
225
+ .svc-name-btn[aria-expanded="true"] {
226
+ text-decoration: underline;
227
+ }
214
228
  .service-repo .owners {
215
229
  color: var(--accent-text);
216
230
  }
@@ -335,6 +349,7 @@
335
349
  envReady,
336
350
  sudoRun,
337
351
  } from "/header.js";
352
+ import { logStreamUrl } from "/log-source.js";
338
353
  import { ownersLabel } from "/workspace-picker.js";
339
354
 
340
355
  let es = null;
@@ -656,7 +671,7 @@
656
671
  <div class="service-card-header">
657
672
  <span class="dot" id="dot-${s.repo}-${s.service}"></span>
658
673
  <div class="service-card-title">
659
- <div class="service-name">${addr}</div>
674
+ <div class="service-name"><button type="button" class="svc-name-btn" data-svpanel-open="${esc(isSub ? addr : s.repo)}" aria-haspopup="dialog" aria-expanded="false" title="${esc(window.denShell?.t?.("svp.more", { s: isSub ? addr : s.repo }) ?? addr)}">${esc(addr)}</button></div>
660
675
  <div class="service-repo">${s.repo}${
661
676
  ownersLabel(s.inWorkspaces)
662
677
  ? `<span class="owners" title="Shared: listed once for every workspace in view that defines it">${esc(ownersLabel(s.inWorkspaces))}</span>`
@@ -821,8 +836,8 @@
821
836
  );
822
837
  appendLine(`\n▶ ${repo}/${service} logs · ${env}\n`, "cmd");
823
838
 
824
- const params = new URLSearchParams({ repo, service, env });
825
- es = new EventSource(`/api/service/logs?${params}`);
839
+ // The Logs page's source (log-source.js): taillog for local.
840
+ es = new EventSource(logStreamUrl(repo, service, env));
826
841
  handleSSE(es, repo, service, { stream: true });
827
842
  }
828
843