@zhin.js/adapter-sandbox 1.1.22 → 1.1.24

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.
@@ -0,0 +1,200 @@
1
+ // Generated by build-plugin-runtime-entries.mjs. Do not edit.
2
+ /** The adapter owns its workbench presentation; no styles from a particular Console shell are required. */
3
+ export const sandboxStyles = `
4
+ .zhin-sandbox.agent-playground-shell { position: relative; display: grid; grid-template-columns: 232px minmax(0,1fr); height: calc(100dvh - 72px); min-height: 520px; overflow: hidden; border: 1px solid var(--ac-line); border-radius: 14px; background: var(--ac-panel); }
5
+ .zhin-sandbox [hidden], .zhin-sandbox .hidden { display: none !important; }
6
+ .zhin-sandbox button { display: inline-flex; justify-content: center; align-items: center; gap: 7px; border: 1px solid var(--ac-line); border-radius: 8px; min-height: 34px; padding: 6px 10px; color: var(--ac-ink); background: var(--ac-panel); cursor: pointer; font-size: 12px; line-height: 1.4; }
7
+ .zhin-sandbox button:hover:not(:disabled) { background: var(--ac-soft); }
8
+ .zhin-sandbox button:disabled { opacity: .45; cursor: not-allowed; }
9
+ .zhin-sandbox button.primary { background: var(--ac-primary); color: var(--ac-panel); border-color: var(--ac-primary); }
10
+ .zhin-sandbox button.danger, .zhin-sandbox .agent-playground-stop { color: var(--ac-bad); background: var(--ac-bad-bg); border-color: transparent; }
11
+ .zhin-sandbox .agent-playground-mobilebar { display: none; }
12
+ .zhin-sandbox .agent-playground-sessions { min-width: 0; display: flex; flex-direction: column; background: var(--ac-canvas); border-right: 1px solid var(--ac-line); overflow: hidden; }
13
+ .zhin-sandbox .agent-playground-brand { padding: 24px 18px; }
14
+ .zhin-sandbox .agent-playground-brand > div { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
15
+ .zhin-sandbox .agent-playground-brand > div > div { display: flex; align-items: center; gap: 10px; }
16
+ .zhin-sandbox .agent-playground-brand h2 { font-size: 18px; font-weight: 650; letter-spacing: -.02em; }
17
+ .zhin-sandbox .agent-playground-brand small { font-size: 11px; color: var(--ac-muted); }
18
+ .zhin-sandbox .agent-playground-mark { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--ac-ink); color: var(--ac-panel); }
19
+ .zhin-sandbox .agent-playground-connection { display: grid; place-items: center; color: var(--ac-warn); }
20
+ .zhin-sandbox .agent-playground-connection.is-online, .zhin-sandbox .is-online { color: var(--ac-ok); }
21
+ .zhin-sandbox .agent-playground-section-label { display: flex; align-items: center; gap: 8px; padding: 0 18px 10px; font-size: 12px; color: var(--ac-muted); }
22
+ .zhin-sandbox .agent-playground-section-label button { margin-left: auto; min-height: 28px; padding: 4px; background: transparent; border-color: transparent; }
23
+ .zhin-sandbox .agent-playground-session-list { flex: 1; min-height: 0; overflow: auto; padding: 0 10px; }
24
+ .zhin-sandbox .agent-playground-session { display: flex; justify-content: flex-start; width: 100%; gap: 10px; padding: 12px 10px; border: 1px solid transparent; margin-bottom: 4px; background: transparent; text-align: left; }
25
+ .zhin-sandbox .agent-playground-session.active { background: var(--ac-panel); border-color: var(--ac-line); box-shadow: 0 2px 3px #19283e05; }
26
+ .zhin-sandbox .agent-playground-session-icon { color: var(--ac-muted); }
27
+ .zhin-sandbox .agent-playground-session.active .agent-playground-session-icon { color: var(--ac-primary); }
28
+ .zhin-sandbox .agent-playground-session > div { flex: 1; min-width: 0; }
29
+ .zhin-sandbox .agent-playground-session > div > div:first-child { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
30
+ .zhin-sandbox .agent-playground-session > div > div:last-child { font-size: 11px; color: var(--ac-muted); margin-top: 4px; }
31
+ .zhin-sandbox .agent-playground-new-session { padding: 16px 14px; }
32
+ .zhin-sandbox .agent-playground-add { width: 100%; background: var(--ac-panel); }
33
+ .zhin-sandbox .agent-playground-new-form { display: grid; gap: 10px; }
34
+ .zhin-sandbox .agent-playground-scope-picker, .zhin-sandbox .agent-playground-new-actions { display: flex; gap: 5px; }
35
+ .zhin-sandbox .agent-playground-scope-picker button { flex: 1; font-size: 11px; padding: 6px; }
36
+ .zhin-sandbox .agent-playground-scope-picker button.active { border-color: var(--ac-primary); color: var(--ac-primary); background: var(--ac-tint); }
37
+ .zhin-sandbox .agent-playground-new-actions { justify-content: flex-end; }
38
+ .zhin-sandbox .agent-playground-endpoint { padding: 14px 18px; border-top: 1px solid var(--ac-line); display: grid; gap: 3px; }
39
+ .zhin-sandbox .agent-playground-endpoint span { font-size: 11px; color: var(--ac-muted); }
40
+ .zhin-sandbox .agent-playground-endpoint strong { font-size: 12px; font-weight: 550; overflow-wrap: anywhere; }
41
+ .zhin-sandbox .agent-playground-main { display: flex; flex-direction: column; min-height: 0; min-width: 0; overflow: hidden; }
42
+ .zhin-sandbox .agent-playground-runbar { padding: 18px 24px; display: flex; align-items: center; justify-content: space-between; gap: 16px; border-bottom: 1px solid var(--ac-line); }
43
+ .zhin-sandbox .agent-playground-run-identity { display: flex; gap: 10px; align-items: center; min-width: 0; }
44
+ .zhin-sandbox .agent-playground-run-identity > div { min-width: 0; }
45
+ .zhin-sandbox .agent-playground-run-icon { color: var(--ac-primary); }
46
+ .zhin-sandbox .agent-playground-run-title h1 { font-size: 16px; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
47
+ .zhin-sandbox .agent-playground-run-title span { font-size: 11px; color: var(--ac-muted); }
48
+ .zhin-sandbox .agent-playground-run-actions { display: flex; align-items: center; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
49
+ .zhin-sandbox .agent-playground-run-actions > a { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; padding: 6px; text-decoration: none; }
50
+ .zhin-sandbox .agent-playground-run-state { display: inline-flex; align-items: center; gap: 5px; color: var(--ac-muted); font-size: 11px; }
51
+ .zhin-sandbox .agent-playground-run-state.is-running { color: var(--ac-primary); }
52
+ .zhin-sandbox .agent-playground-run-state.has-problem { color: var(--ac-bad); }
53
+ .zhin-sandbox .agent-playground-confirm { display: flex; align-items: center; gap: 10px; background: var(--ac-warn-bg); color: var(--ac-warn); padding: 12px 20px; border-bottom: 1px solid var(--ac-line); font-size: 12px; }
54
+ .zhin-sandbox .agent-playground-confirm > div { flex: 1; display: grid; gap: 3px; min-width: 0; overflow-wrap: anywhere; }
55
+ .zhin-sandbox .agent-playground-run-settings { display: flex; flex-wrap: wrap; gap: 14px; padding: 16px 24px; background: var(--ac-canvas); border-bottom: 1px solid var(--ac-line); }
56
+ .zhin-sandbox .agent-playground-run-settings label { display: grid; gap: 5px; flex: 1; min-width: 140px; }
57
+ .zhin-sandbox .agent-playground-run-settings label > span { display: flex; align-items: center; gap: 5px; font-size: 11px; color: var(--ac-muted); }
58
+ .zhin-sandbox .agent-playground-run-settings input, .zhin-sandbox .agent-playground-run-settings select { font-size: 12px; padding: 7px 9px; }
59
+ .zhin-sandbox .agent-playground-run-settings .agent-playground-directory-field { flex-basis: 100%; }
60
+ .zhin-sandbox .agent-playground-run-settings .agent-playground-network-toggle { display: flex; align-items: center; gap: 10px; flex: none; }
61
+ .zhin-sandbox .agent-playground-network-toggle i { display: none; }
62
+ .zhin-sandbox .agent-playground-run-settings p { display: flex; gap: 7px; align-items: flex-start; font-size: 12px; color: var(--ac-warn); flex-basis: 100%; }
63
+ .zhin-sandbox .agent-playground-conversation { flex: 1; display: flex; min-height: 0; overflow: hidden; }
64
+ .zhin-sandbox .agent-playground-message-scroll { flex: 1; min-width: 0; overflow-y: auto; padding: 28px 24px; scrollbar-gutter: stable; }
65
+ .zhin-sandbox .agent-playground-empty { max-width: 560px; margin: clamp(24px, 8vh, 100px) auto 32px; text-align: center; }
66
+ .zhin-sandbox .agent-playground-empty-mark { display: grid; place-items: center; width: 56px; height: 56px; margin: 0 auto 20px; border-radius: 18px; background: var(--ac-tint); color: var(--ac-primary); }
67
+ .zhin-sandbox .agent-playground-empty h2 { font-size: clamp(18px, 2vw, 24px); font-weight: 650; letter-spacing: -.025em; margin-bottom: 10px; }
68
+ .zhin-sandbox .agent-playground-empty p { color: var(--ac-muted); font-size: 13px; line-height: 1.8; max-width: 48ch; margin: 0 auto; }
69
+ .zhin-sandbox .agent-playground-prompts { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 24px; }
70
+ .zhin-sandbox .agent-playground-prompts button { padding: 9px 12px; }
71
+ .zhin-sandbox .agent-playground-message-list { display: grid; gap: 24px; max-width: 780px; margin: 0 auto; }
72
+ .zhin-sandbox .agent-playground-message { display: flex; align-items: flex-start; gap: 12px; }
73
+ .zhin-sandbox .agent-playground-message-avatar { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; background: var(--ac-tint); color: var(--ac-primary); flex-shrink: 0; }
74
+ .zhin-sandbox .agent-playground-message.is-user .agent-playground-message-avatar { background: var(--ac-soft); color: var(--ac-muted); }
75
+ .zhin-sandbox .agent-playground-message-main { flex: 1; min-width: 0; }
76
+ .zhin-sandbox .agent-playground-message-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
77
+ .zhin-sandbox .agent-playground-message-meta strong { font-size: 12px; font-weight: 650; }
78
+ .zhin-sandbox .agent-playground-message-meta time { font-size: 10px; color: var(--ac-muted); }
79
+ .zhin-sandbox .agent-playground-message-meta span { color: var(--ac-warn); font-size: 10px; }
80
+ .zhin-sandbox .agent-playground-message-content { line-height: 1.8; overflow-wrap: anywhere; }
81
+ .zhin-sandbox .agent-playground-message-content img { max-width: 100%; border-radius: 10px; }
82
+ .zhin-sandbox .agent-playground-message.is-user .agent-playground-message-content { background: var(--ac-canvas); border-radius: 10px; padding: 12px 16px; }
83
+ .zhin-sandbox .agent-playground-message.is-approval { padding: 16px; background: var(--ac-warn-bg); border: 1px solid var(--ac-line); border-radius: 10px; }
84
+ .zhin-sandbox .agent-playground-composer { padding: 16px 24px; border-top: 1px solid var(--ac-line); display: grid; gap: 12px; background: var(--ac-panel); }
85
+ .zhin-sandbox .agent-playground-composer > div:first-child { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
86
+ .zhin-sandbox .agent-playground-composer > div:first-child > div.flex-1 { flex: 1; }
87
+ .zhin-sandbox .agent-playground-composer > div:nth-last-child(2) { display: flex; align-items: flex-end; gap: 10px; }
88
+ .zhin-sandbox .agent-playground-composer > div:nth-last-child(2) > div { flex: 1; min-width: 0; }
89
+ .zhin-sandbox .agent-playground-composer > div:nth-last-child(2) > button { min-height: 42px; padding: 10px 16px; background: var(--ac-primary); border-color: var(--ac-primary); color: var(--ac-panel); }
90
+ .zhin-sandbox .agent-playground-composer > div:last-child { display: flex; align-items: center; flex-wrap: wrap; gap: 5px; font-size: 10px; color: var(--ac-muted); }
91
+ .zhin-sandbox .agent-playground-composer > div:last-child span { padding: 1px 4px; border: 1px solid var(--ac-line); border-radius: 4px; }
92
+ .zhin-sandbox [contenteditable="true"] { padding: 12px 14px; background: var(--ac-canvas); border: 1px solid var(--ac-line); border-radius: 10px; line-height: 1.6; overflow-y: auto; outline: none; }
93
+ .zhin-sandbox [contenteditable="true"]:focus-visible { border-color: var(--ac-primary); outline: 2px solid var(--ac-primary); outline-offset: 1px; }
94
+ .zhin-sandbox [contenteditable="true"]:empty::before { content: attr(data-placeholder); color: var(--ac-muted); pointer-events: none; }
95
+ .zhin-sandbox .editor-face { width: 24px; height: 24px; display: inline-block; vertical-align: middle; }
96
+ .zhin-sandbox .editor-image { max-height: 100px; max-width: 100%; display: inline-block; }
97
+ .zhin-sandbox .sandbox-composer-tabs { display: flex; gap: 3px; padding: 3px; background: var(--ac-soft); border-radius: 8px; }
98
+ .zhin-sandbox .sandbox-composer-tabs button { border-color: transparent; min-height: 26px; background: transparent; }
99
+ .zhin-sandbox .sandbox-composer-tabs button.active { color: var(--ac-primary); background: var(--ac-panel); }
100
+ .zhin-sandbox .sandbox-markdown-preview { max-height: 200px; min-height: 44px; padding: 12px; overflow: auto; background: var(--ac-canvas); border: 1px solid var(--ac-line); border-radius: 10px; }
101
+ .zhin-sandbox .sandbox-markdown-preview-empty { color: var(--ac-muted); }
102
+ .zhin-sandbox .agent-playground-inspector { position: absolute; right: 0; top: 0; bottom: 0; width: min(360px, 90%); z-index: 30; display: flex; flex-direction: column; background: var(--ac-canvas); border-left: 1px solid var(--ac-line); overflow: auto; }
103
+ .zhin-sandbox .agent-playground-inspector-head { display: flex; justify-content: space-between; align-items: center; padding: 20px; border-bottom: 1px solid var(--ac-line); }
104
+ .zhin-sandbox .agent-playground-inspector-head > div:last-child { display: flex; gap: 6px; }
105
+ .zhin-sandbox .agent-playground-inspector-head span { font-size: 11px; color: var(--ac-muted); }
106
+ .zhin-sandbox .agent-playground-inspector-head h2 { font-size: 17px; font-weight: 650; }
107
+ .zhin-sandbox .agent-playground-inspector-tabs { display: flex; gap: 6px; padding: 14px 16px; }
108
+ .zhin-sandbox .agent-playground-inspector-tabs button { flex: 1; background: transparent; border-color: transparent; }
109
+ .zhin-sandbox .agent-playground-inspector-tabs button.active { background: var(--ac-panel); border-color: var(--ac-line); color: var(--ac-primary); }
110
+ .zhin-sandbox .agent-playground-inspector-section { padding: 18px 20px; border-bottom: 1px solid var(--ac-line); }
111
+ .zhin-sandbox .agent-playground-inspector-title { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 14px; font-size: 12px; font-weight: 650; }
112
+ .zhin-sandbox .agent-playground-inspector-title small { color: var(--ac-muted); font-weight: 400; font-size: 10px; }
113
+ .zhin-sandbox .agent-playground-metrics { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
114
+ .zhin-sandbox .agent-playground-metrics > div { display: grid; grid-template-columns: 20px 1fr; align-items: center; gap: 4px 8px; padding: 12px; border: 1px solid var(--ac-line); background: var(--ac-panel); border-radius: 8px; }
115
+ .zhin-sandbox .agent-playground-metrics svg { width: 15px; height: 15px; color: var(--ac-muted); }
116
+ .zhin-sandbox .agent-playground-metrics strong { font-size: 18px; font-weight: 650; font-variant-numeric: tabular-nums; }
117
+ .zhin-sandbox .agent-playground-metrics span { grid-column: 2; font-size: 10px; color: var(--ac-muted); }
118
+ .zhin-sandbox .agent-playground-metrics .has-problem svg { color: var(--ac-bad); }
119
+ .zhin-sandbox .agent-playground-context-list { display: grid; gap: 8px; font-size: 11px; }
120
+ .zhin-sandbox .agent-playground-context-list > div { display: grid; grid-template-columns: 64px minmax(0,1fr); gap: 8px; }
121
+ .zhin-sandbox .agent-playground-context-list dt { color: var(--ac-muted); }
122
+ .zhin-sandbox .agent-playground-context-list dd { overflow-wrap: anywhere; }
123
+ .zhin-sandbox .agent-playground-trace-list { display: grid; gap: 14px; }
124
+ .zhin-sandbox .agent-playground-trace-item { display: flex; align-items: flex-start; gap: 8px; font-size: 11px; }
125
+ .zhin-sandbox .agent-playground-trace-item > div { flex: 1; min-width: 0; display: grid; gap: 3px; }
126
+ .zhin-sandbox .agent-playground-trace-item strong { font-weight: 600; }
127
+ .zhin-sandbox .agent-playground-trace-item small, .zhin-sandbox .agent-playground-trace-item time { color: var(--ac-muted); font-size: 10px; overflow-wrap: anywhere; }
128
+ .zhin-sandbox .agent-playground-trace-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--ac-muted); flex-shrink: 0; margin-top: 6px; }
129
+ .zhin-sandbox .agent-playground-trace-item.is-error .agent-playground-trace-dot { background: var(--ac-bad); }
130
+ .zhin-sandbox .agent-playground-artifact-empty, .zhin-sandbox .agent-playground-trace-empty, .zhin-sandbox .agent-playground-trace-notice { display: flex; gap: 10px; align-items: flex-start; font-size: 12px; color: var(--ac-muted); padding: 12px 0; }
131
+ .zhin-sandbox .agent-playground-trace-notice { color: var(--ac-bad); }
132
+ .zhin-sandbox .agent-playground-task-list, .zhin-sandbox .agent-playground-artifact-list { display: grid; gap: 8px; }
133
+ .zhin-sandbox .agent-playground-task-list article { padding: 12px; border: 1px solid var(--ac-line); background: var(--ac-panel); border-radius: 8px; }
134
+ .zhin-sandbox .agent-playground-task-list article > div { display: flex; justify-content: space-between; font-size: 11px; }
135
+ .zhin-sandbox .agent-playground-task-list code { color: var(--ac-muted); font-size: 10px; }
136
+ .zhin-sandbox .agent-playground-task-list dl { display: flex; gap: 14px; margin-top: 8px; font-size: 10px; }
137
+ .zhin-sandbox .agent-playground-task-list dt { color: var(--ac-muted); }
138
+ .zhin-sandbox .agent-playground-artifact-list article { border: 1px solid var(--ac-line); background: var(--ac-panel); border-radius: 8px; overflow: hidden; }
139
+ .zhin-sandbox .agent-playground-artifact-list article > button { width: 100%; border: 0; border-radius: 0; padding: 12px; text-align: left; }
140
+ .zhin-sandbox .agent-playground-artifact-list article > button > span:nth-child(2) { flex: 1; min-width: 0; display: grid; gap: 4px; }
141
+ .zhin-sandbox .agent-playground-artifact-list small { color: var(--ac-muted); font-size: 10px; overflow-wrap: anywhere; }
142
+ .zhin-sandbox .agent-playground-artifact-list em { font-style: normal; color: var(--ac-muted); font-size: 10px; }
143
+ .zhin-sandbox .agent-playground-artifact-detail { padding: 12px; font-size: 11px; display: grid; gap: 8px; }
144
+ .zhin-sandbox .agent-playground-artifact-detail pre { max-height: 320px; overflow: auto; padding: 10px; background: var(--ac-canvas); border-radius: 6px; }
145
+ .zhin-sandbox .agent-playground-artifact-detail footer { display: flex; justify-content: space-between; color: var(--ac-muted); }
146
+ .zhin-sandbox .agent-playground-studio-link { display: grid; gap: 6px; padding: 18px 20px; font-size: 12px; margin-top: auto; border-top: 1px solid var(--ac-line); text-decoration: none; }
147
+ .zhin-sandbox .agent-playground-studio-link span { display: flex; gap: 7px; align-items: center; }
148
+ .zhin-sandbox .agent-playground-studio-link code { color: var(--ac-muted); font-size: 10px; overflow-wrap: anywhere; }
149
+ .zhin-sandbox .agent-playground-inspector-overlay, .zhin-sandbox .channel-overlay { display: none; }
150
+ .zhin-sandbox .agent-playground-inline-run { border: 1px solid var(--ac-line); border-radius: 10px; padding: 16px; background: var(--ac-canvas); }
151
+ .zhin-sandbox .agent-playground-inline-run-head { display: flex; align-items: flex-start; gap: 10px; }
152
+ .zhin-sandbox .agent-playground-inline-run-icon { color: var(--ac-muted); padding-top: 4px; }
153
+ .zhin-sandbox .agent-playground-inline-run-copy { flex: 1; min-width: 0; }
154
+ .zhin-sandbox .agent-playground-inline-run-copy > span { font-size: 10px; color: var(--ac-muted); }
155
+ .zhin-sandbox .agent-playground-inline-run-copy h3 { font-size: 14px; font-weight: 600; }
156
+ .zhin-sandbox .agent-playground-inline-run-copy p { font-size: 12px; color: var(--ac-muted); overflow-wrap: anywhere; margin-top: 4px; }
157
+ .zhin-sandbox .agent-playground-inline-run-actions { display: flex; gap: 6px; }
158
+ .zhin-sandbox .agent-playground-inline-run-metrics { display: flex; flex-wrap: wrap; gap: 20px; padding: 14px 0; border-bottom: 1px solid var(--ac-line); font-variant-numeric: tabular-nums; }
159
+ .zhin-sandbox .agent-playground-inline-run-metrics dt { font-size: 10px; color: var(--ac-muted); }
160
+ .zhin-sandbox .agent-playground-inline-run-metrics dd { font-size: 13px; font-weight: 600; }
161
+ .zhin-sandbox .agent-playground-inline-run-steps { padding: 0; list-style: none; margin: 16px 0; display: grid; gap: 12px; }
162
+ .zhin-sandbox .agent-playground-inline-run-steps li { display: flex; align-items: flex-start; gap: 8px; }
163
+ .zhin-sandbox .agent-playground-inline-run-steps li > div { flex: 1; min-width: 0; display: grid; gap: 4px; }
164
+ .zhin-sandbox .agent-playground-inline-run-steps strong { font-size: 12px; font-weight: 600; }
165
+ .zhin-sandbox .agent-playground-inline-run-steps small, .zhin-sandbox .agent-playground-inline-run-steps li > span { font-size: 10px; color: var(--ac-muted); overflow-wrap: anywhere; }
166
+ .zhin-sandbox .agent-playground-inline-run-steps i { width: 6px; height: 6px; margin-top: 6px; border-radius: 50%; background: var(--ac-muted); flex-shrink: 0; }
167
+ .zhin-sandbox .agent-playground-inline-run-steps .is-failed i { background: var(--ac-bad); }
168
+ .zhin-sandbox .agent-playground-inline-run-empty { font-size: 12px; padding-top: 12px; color: var(--ac-muted); }
169
+ .zhin-sandbox .agent-playground-inline-run footer { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; }
170
+ .zhin-sandbox .agent-playground-inline-run footer { margin-top: 12px; }
171
+ .zhin-sandbox .agent-playground-conversation-details { padding: 20px; overflow: auto; flex: 1; }
172
+ .zhin-sandbox .agent-playground-history-navigation, .zhin-sandbox .agent-playground-history-notice { text-align: center; padding: 10px; color: var(--ac-muted); font-size: 12px; }
173
+ @media (min-width: 1280px) {
174
+ .zhin-sandbox.agent-playground-shell.has-inspector { grid-template-columns: 232px minmax(0,1fr) 330px; }
175
+ .zhin-sandbox .agent-playground-inspector { position: static; width: auto; }
176
+ }
177
+ @media (max-width: 1279px) {
178
+ .zhin-sandbox .agent-playground-inspector-overlay { display: block; position: absolute; inset: 0; background: #18181b40; z-index: 25; }
179
+ }
180
+ @media (max-width: 767px) {
181
+ .zhin-sandbox.agent-playground-shell { grid-template-columns: minmax(0,1fr); grid-template-rows: auto minmax(0,1fr); height: calc(100dvh - 92px); min-height: 480px; border-radius: 10px; }
182
+ .zhin-sandbox .agent-playground-mobilebar { display: flex; align-items: center; justify-content: space-between; padding: 10px; border-bottom: 1px solid var(--ac-line); }
183
+ .zhin-sandbox .agent-playground-mobilebar strong { font-size: 13px; }
184
+ .zhin-sandbox .agent-playground-mobilebar button { font-size: 11px; padding: 6px; }
185
+ .zhin-sandbox .agent-playground-sessions { display: none; position: absolute; inset: 0 auto 0 0; width: min(280px,85%); z-index: 40; }
186
+ .zhin-sandbox .agent-playground-sessions.show { display: flex; }
187
+ .zhin-sandbox .channel-overlay { display: block; position: absolute; inset: 0; z-index: 35; background: #18181b40; }
188
+ .zhin-sandbox .agent-playground-runbar { padding: 12px; align-items: flex-start; flex-direction: column; gap: 10px; }
189
+ .zhin-sandbox .agent-playground-run-actions { justify-content: flex-start; }
190
+ .zhin-sandbox .agent-playground-run-actions > button[aria-controls="sandbox-run-inspector"] { display: none; }
191
+ .zhin-sandbox .agent-playground-message-scroll { padding: 20px 12px; }
192
+ .zhin-sandbox .agent-playground-composer { padding: 12px; }
193
+ .zhin-sandbox .agent-playground-composer > div:last-child { max-height: 32px; overflow: hidden; }
194
+ .zhin-sandbox .agent-playground-confirm { padding: 12px; flex-wrap: wrap; }
195
+ .zhin-sandbox .agent-playground-confirm > div { flex-basis: 100%; }
196
+ .zhin-sandbox .agent-playground-run-settings { padding: 12px; max-height: 240px; overflow: auto; }
197
+ .zhin-sandbox .agent-playground-empty { margin-top: 24px; }
198
+ .zhin-sandbox .agent-playground-prompts { flex-direction: column; }
199
+ }
200
+ `;
@@ -0,0 +1,199 @@
1
+ /** The adapter owns its workbench presentation; no styles from a particular Console shell are required. */
2
+ export const sandboxStyles = `
3
+ .zhin-sandbox.agent-playground-shell { position: relative; display: grid; grid-template-columns: 232px minmax(0,1fr); height: calc(100dvh - 72px); min-height: 520px; overflow: hidden; border: 1px solid var(--ac-line); border-radius: 14px; background: var(--ac-panel); }
4
+ .zhin-sandbox [hidden], .zhin-sandbox .hidden { display: none !important; }
5
+ .zhin-sandbox button { display: inline-flex; justify-content: center; align-items: center; gap: 7px; border: 1px solid var(--ac-line); border-radius: 8px; min-height: 34px; padding: 6px 10px; color: var(--ac-ink); background: var(--ac-panel); cursor: pointer; font-size: 12px; line-height: 1.4; }
6
+ .zhin-sandbox button:hover:not(:disabled) { background: var(--ac-soft); }
7
+ .zhin-sandbox button:disabled { opacity: .45; cursor: not-allowed; }
8
+ .zhin-sandbox button.primary { background: var(--ac-primary); color: var(--ac-panel); border-color: var(--ac-primary); }
9
+ .zhin-sandbox button.danger, .zhin-sandbox .agent-playground-stop { color: var(--ac-bad); background: var(--ac-bad-bg); border-color: transparent; }
10
+ .zhin-sandbox .agent-playground-mobilebar { display: none; }
11
+ .zhin-sandbox .agent-playground-sessions { min-width: 0; display: flex; flex-direction: column; background: var(--ac-canvas); border-right: 1px solid var(--ac-line); overflow: hidden; }
12
+ .zhin-sandbox .agent-playground-brand { padding: 24px 18px; }
13
+ .zhin-sandbox .agent-playground-brand > div { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
14
+ .zhin-sandbox .agent-playground-brand > div > div { display: flex; align-items: center; gap: 10px; }
15
+ .zhin-sandbox .agent-playground-brand h2 { font-size: 18px; font-weight: 650; letter-spacing: -.02em; }
16
+ .zhin-sandbox .agent-playground-brand small { font-size: 11px; color: var(--ac-muted); }
17
+ .zhin-sandbox .agent-playground-mark { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--ac-ink); color: var(--ac-panel); }
18
+ .zhin-sandbox .agent-playground-connection { display: grid; place-items: center; color: var(--ac-warn); }
19
+ .zhin-sandbox .agent-playground-connection.is-online, .zhin-sandbox .is-online { color: var(--ac-ok); }
20
+ .zhin-sandbox .agent-playground-section-label { display: flex; align-items: center; gap: 8px; padding: 0 18px 10px; font-size: 12px; color: var(--ac-muted); }
21
+ .zhin-sandbox .agent-playground-section-label button { margin-left: auto; min-height: 28px; padding: 4px; background: transparent; border-color: transparent; }
22
+ .zhin-sandbox .agent-playground-session-list { flex: 1; min-height: 0; overflow: auto; padding: 0 10px; }
23
+ .zhin-sandbox .agent-playground-session { display: flex; justify-content: flex-start; width: 100%; gap: 10px; padding: 12px 10px; border: 1px solid transparent; margin-bottom: 4px; background: transparent; text-align: left; }
24
+ .zhin-sandbox .agent-playground-session.active { background: var(--ac-panel); border-color: var(--ac-line); box-shadow: 0 2px 3px #19283e05; }
25
+ .zhin-sandbox .agent-playground-session-icon { color: var(--ac-muted); }
26
+ .zhin-sandbox .agent-playground-session.active .agent-playground-session-icon { color: var(--ac-primary); }
27
+ .zhin-sandbox .agent-playground-session > div { flex: 1; min-width: 0; }
28
+ .zhin-sandbox .agent-playground-session > div > div:first-child { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
29
+ .zhin-sandbox .agent-playground-session > div > div:last-child { font-size: 11px; color: var(--ac-muted); margin-top: 4px; }
30
+ .zhin-sandbox .agent-playground-new-session { padding: 16px 14px; }
31
+ .zhin-sandbox .agent-playground-add { width: 100%; background: var(--ac-panel); }
32
+ .zhin-sandbox .agent-playground-new-form { display: grid; gap: 10px; }
33
+ .zhin-sandbox .agent-playground-scope-picker, .zhin-sandbox .agent-playground-new-actions { display: flex; gap: 5px; }
34
+ .zhin-sandbox .agent-playground-scope-picker button { flex: 1; font-size: 11px; padding: 6px; }
35
+ .zhin-sandbox .agent-playground-scope-picker button.active { border-color: var(--ac-primary); color: var(--ac-primary); background: var(--ac-tint); }
36
+ .zhin-sandbox .agent-playground-new-actions { justify-content: flex-end; }
37
+ .zhin-sandbox .agent-playground-endpoint { padding: 14px 18px; border-top: 1px solid var(--ac-line); display: grid; gap: 3px; }
38
+ .zhin-sandbox .agent-playground-endpoint span { font-size: 11px; color: var(--ac-muted); }
39
+ .zhin-sandbox .agent-playground-endpoint strong { font-size: 12px; font-weight: 550; overflow-wrap: anywhere; }
40
+ .zhin-sandbox .agent-playground-main { display: flex; flex-direction: column; min-height: 0; min-width: 0; overflow: hidden; }
41
+ .zhin-sandbox .agent-playground-runbar { padding: 18px 24px; display: flex; align-items: center; justify-content: space-between; gap: 16px; border-bottom: 1px solid var(--ac-line); }
42
+ .zhin-sandbox .agent-playground-run-identity { display: flex; gap: 10px; align-items: center; min-width: 0; }
43
+ .zhin-sandbox .agent-playground-run-identity > div { min-width: 0; }
44
+ .zhin-sandbox .agent-playground-run-icon { color: var(--ac-primary); }
45
+ .zhin-sandbox .agent-playground-run-title h1 { font-size: 16px; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
46
+ .zhin-sandbox .agent-playground-run-title span { font-size: 11px; color: var(--ac-muted); }
47
+ .zhin-sandbox .agent-playground-run-actions { display: flex; align-items: center; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
48
+ .zhin-sandbox .agent-playground-run-actions > a { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; padding: 6px; text-decoration: none; }
49
+ .zhin-sandbox .agent-playground-run-state { display: inline-flex; align-items: center; gap: 5px; color: var(--ac-muted); font-size: 11px; }
50
+ .zhin-sandbox .agent-playground-run-state.is-running { color: var(--ac-primary); }
51
+ .zhin-sandbox .agent-playground-run-state.has-problem { color: var(--ac-bad); }
52
+ .zhin-sandbox .agent-playground-confirm { display: flex; align-items: center; gap: 10px; background: var(--ac-warn-bg); color: var(--ac-warn); padding: 12px 20px; border-bottom: 1px solid var(--ac-line); font-size: 12px; }
53
+ .zhin-sandbox .agent-playground-confirm > div { flex: 1; display: grid; gap: 3px; min-width: 0; overflow-wrap: anywhere; }
54
+ .zhin-sandbox .agent-playground-run-settings { display: flex; flex-wrap: wrap; gap: 14px; padding: 16px 24px; background: var(--ac-canvas); border-bottom: 1px solid var(--ac-line); }
55
+ .zhin-sandbox .agent-playground-run-settings label { display: grid; gap: 5px; flex: 1; min-width: 140px; }
56
+ .zhin-sandbox .agent-playground-run-settings label > span { display: flex; align-items: center; gap: 5px; font-size: 11px; color: var(--ac-muted); }
57
+ .zhin-sandbox .agent-playground-run-settings input, .zhin-sandbox .agent-playground-run-settings select { font-size: 12px; padding: 7px 9px; }
58
+ .zhin-sandbox .agent-playground-run-settings .agent-playground-directory-field { flex-basis: 100%; }
59
+ .zhin-sandbox .agent-playground-run-settings .agent-playground-network-toggle { display: flex; align-items: center; gap: 10px; flex: none; }
60
+ .zhin-sandbox .agent-playground-network-toggle i { display: none; }
61
+ .zhin-sandbox .agent-playground-run-settings p { display: flex; gap: 7px; align-items: flex-start; font-size: 12px; color: var(--ac-warn); flex-basis: 100%; }
62
+ .zhin-sandbox .agent-playground-conversation { flex: 1; display: flex; min-height: 0; overflow: hidden; }
63
+ .zhin-sandbox .agent-playground-message-scroll { flex: 1; min-width: 0; overflow-y: auto; padding: 28px 24px; scrollbar-gutter: stable; }
64
+ .zhin-sandbox .agent-playground-empty { max-width: 560px; margin: clamp(24px, 8vh, 100px) auto 32px; text-align: center; }
65
+ .zhin-sandbox .agent-playground-empty-mark { display: grid; place-items: center; width: 56px; height: 56px; margin: 0 auto 20px; border-radius: 18px; background: var(--ac-tint); color: var(--ac-primary); }
66
+ .zhin-sandbox .agent-playground-empty h2 { font-size: clamp(18px, 2vw, 24px); font-weight: 650; letter-spacing: -.025em; margin-bottom: 10px; }
67
+ .zhin-sandbox .agent-playground-empty p { color: var(--ac-muted); font-size: 13px; line-height: 1.8; max-width: 48ch; margin: 0 auto; }
68
+ .zhin-sandbox .agent-playground-prompts { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 24px; }
69
+ .zhin-sandbox .agent-playground-prompts button { padding: 9px 12px; }
70
+ .zhin-sandbox .agent-playground-message-list { display: grid; gap: 24px; max-width: 780px; margin: 0 auto; }
71
+ .zhin-sandbox .agent-playground-message { display: flex; align-items: flex-start; gap: 12px; }
72
+ .zhin-sandbox .agent-playground-message-avatar { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; background: var(--ac-tint); color: var(--ac-primary); flex-shrink: 0; }
73
+ .zhin-sandbox .agent-playground-message.is-user .agent-playground-message-avatar { background: var(--ac-soft); color: var(--ac-muted); }
74
+ .zhin-sandbox .agent-playground-message-main { flex: 1; min-width: 0; }
75
+ .zhin-sandbox .agent-playground-message-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
76
+ .zhin-sandbox .agent-playground-message-meta strong { font-size: 12px; font-weight: 650; }
77
+ .zhin-sandbox .agent-playground-message-meta time { font-size: 10px; color: var(--ac-muted); }
78
+ .zhin-sandbox .agent-playground-message-meta span { color: var(--ac-warn); font-size: 10px; }
79
+ .zhin-sandbox .agent-playground-message-content { line-height: 1.8; overflow-wrap: anywhere; }
80
+ .zhin-sandbox .agent-playground-message-content img { max-width: 100%; border-radius: 10px; }
81
+ .zhin-sandbox .agent-playground-message.is-user .agent-playground-message-content { background: var(--ac-canvas); border-radius: 10px; padding: 12px 16px; }
82
+ .zhin-sandbox .agent-playground-message.is-approval { padding: 16px; background: var(--ac-warn-bg); border: 1px solid var(--ac-line); border-radius: 10px; }
83
+ .zhin-sandbox .agent-playground-composer { padding: 16px 24px; border-top: 1px solid var(--ac-line); display: grid; gap: 12px; background: var(--ac-panel); }
84
+ .zhin-sandbox .agent-playground-composer > div:first-child { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
85
+ .zhin-sandbox .agent-playground-composer > div:first-child > div.flex-1 { flex: 1; }
86
+ .zhin-sandbox .agent-playground-composer > div:nth-last-child(2) { display: flex; align-items: flex-end; gap: 10px; }
87
+ .zhin-sandbox .agent-playground-composer > div:nth-last-child(2) > div { flex: 1; min-width: 0; }
88
+ .zhin-sandbox .agent-playground-composer > div:nth-last-child(2) > button { min-height: 42px; padding: 10px 16px; background: var(--ac-primary); border-color: var(--ac-primary); color: var(--ac-panel); }
89
+ .zhin-sandbox .agent-playground-composer > div:last-child { display: flex; align-items: center; flex-wrap: wrap; gap: 5px; font-size: 10px; color: var(--ac-muted); }
90
+ .zhin-sandbox .agent-playground-composer > div:last-child span { padding: 1px 4px; border: 1px solid var(--ac-line); border-radius: 4px; }
91
+ .zhin-sandbox [contenteditable="true"] { padding: 12px 14px; background: var(--ac-canvas); border: 1px solid var(--ac-line); border-radius: 10px; line-height: 1.6; overflow-y: auto; outline: none; }
92
+ .zhin-sandbox [contenteditable="true"]:focus-visible { border-color: var(--ac-primary); outline: 2px solid var(--ac-primary); outline-offset: 1px; }
93
+ .zhin-sandbox [contenteditable="true"]:empty::before { content: attr(data-placeholder); color: var(--ac-muted); pointer-events: none; }
94
+ .zhin-sandbox .editor-face { width: 24px; height: 24px; display: inline-block; vertical-align: middle; }
95
+ .zhin-sandbox .editor-image { max-height: 100px; max-width: 100%; display: inline-block; }
96
+ .zhin-sandbox .sandbox-composer-tabs { display: flex; gap: 3px; padding: 3px; background: var(--ac-soft); border-radius: 8px; }
97
+ .zhin-sandbox .sandbox-composer-tabs button { border-color: transparent; min-height: 26px; background: transparent; }
98
+ .zhin-sandbox .sandbox-composer-tabs button.active { color: var(--ac-primary); background: var(--ac-panel); }
99
+ .zhin-sandbox .sandbox-markdown-preview { max-height: 200px; min-height: 44px; padding: 12px; overflow: auto; background: var(--ac-canvas); border: 1px solid var(--ac-line); border-radius: 10px; }
100
+ .zhin-sandbox .sandbox-markdown-preview-empty { color: var(--ac-muted); }
101
+ .zhin-sandbox .agent-playground-inspector { position: absolute; right: 0; top: 0; bottom: 0; width: min(360px, 90%); z-index: 30; display: flex; flex-direction: column; background: var(--ac-canvas); border-left: 1px solid var(--ac-line); overflow: auto; }
102
+ .zhin-sandbox .agent-playground-inspector-head { display: flex; justify-content: space-between; align-items: center; padding: 20px; border-bottom: 1px solid var(--ac-line); }
103
+ .zhin-sandbox .agent-playground-inspector-head > div:last-child { display: flex; gap: 6px; }
104
+ .zhin-sandbox .agent-playground-inspector-head span { font-size: 11px; color: var(--ac-muted); }
105
+ .zhin-sandbox .agent-playground-inspector-head h2 { font-size: 17px; font-weight: 650; }
106
+ .zhin-sandbox .agent-playground-inspector-tabs { display: flex; gap: 6px; padding: 14px 16px; }
107
+ .zhin-sandbox .agent-playground-inspector-tabs button { flex: 1; background: transparent; border-color: transparent; }
108
+ .zhin-sandbox .agent-playground-inspector-tabs button.active { background: var(--ac-panel); border-color: var(--ac-line); color: var(--ac-primary); }
109
+ .zhin-sandbox .agent-playground-inspector-section { padding: 18px 20px; border-bottom: 1px solid var(--ac-line); }
110
+ .zhin-sandbox .agent-playground-inspector-title { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 14px; font-size: 12px; font-weight: 650; }
111
+ .zhin-sandbox .agent-playground-inspector-title small { color: var(--ac-muted); font-weight: 400; font-size: 10px; }
112
+ .zhin-sandbox .agent-playground-metrics { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
113
+ .zhin-sandbox .agent-playground-metrics > div { display: grid; grid-template-columns: 20px 1fr; align-items: center; gap: 4px 8px; padding: 12px; border: 1px solid var(--ac-line); background: var(--ac-panel); border-radius: 8px; }
114
+ .zhin-sandbox .agent-playground-metrics svg { width: 15px; height: 15px; color: var(--ac-muted); }
115
+ .zhin-sandbox .agent-playground-metrics strong { font-size: 18px; font-weight: 650; font-variant-numeric: tabular-nums; }
116
+ .zhin-sandbox .agent-playground-metrics span { grid-column: 2; font-size: 10px; color: var(--ac-muted); }
117
+ .zhin-sandbox .agent-playground-metrics .has-problem svg { color: var(--ac-bad); }
118
+ .zhin-sandbox .agent-playground-context-list { display: grid; gap: 8px; font-size: 11px; }
119
+ .zhin-sandbox .agent-playground-context-list > div { display: grid; grid-template-columns: 64px minmax(0,1fr); gap: 8px; }
120
+ .zhin-sandbox .agent-playground-context-list dt { color: var(--ac-muted); }
121
+ .zhin-sandbox .agent-playground-context-list dd { overflow-wrap: anywhere; }
122
+ .zhin-sandbox .agent-playground-trace-list { display: grid; gap: 14px; }
123
+ .zhin-sandbox .agent-playground-trace-item { display: flex; align-items: flex-start; gap: 8px; font-size: 11px; }
124
+ .zhin-sandbox .agent-playground-trace-item > div { flex: 1; min-width: 0; display: grid; gap: 3px; }
125
+ .zhin-sandbox .agent-playground-trace-item strong { font-weight: 600; }
126
+ .zhin-sandbox .agent-playground-trace-item small, .zhin-sandbox .agent-playground-trace-item time { color: var(--ac-muted); font-size: 10px; overflow-wrap: anywhere; }
127
+ .zhin-sandbox .agent-playground-trace-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--ac-muted); flex-shrink: 0; margin-top: 6px; }
128
+ .zhin-sandbox .agent-playground-trace-item.is-error .agent-playground-trace-dot { background: var(--ac-bad); }
129
+ .zhin-sandbox .agent-playground-artifact-empty, .zhin-sandbox .agent-playground-trace-empty, .zhin-sandbox .agent-playground-trace-notice { display: flex; gap: 10px; align-items: flex-start; font-size: 12px; color: var(--ac-muted); padding: 12px 0; }
130
+ .zhin-sandbox .agent-playground-trace-notice { color: var(--ac-bad); }
131
+ .zhin-sandbox .agent-playground-task-list, .zhin-sandbox .agent-playground-artifact-list { display: grid; gap: 8px; }
132
+ .zhin-sandbox .agent-playground-task-list article { padding: 12px; border: 1px solid var(--ac-line); background: var(--ac-panel); border-radius: 8px; }
133
+ .zhin-sandbox .agent-playground-task-list article > div { display: flex; justify-content: space-between; font-size: 11px; }
134
+ .zhin-sandbox .agent-playground-task-list code { color: var(--ac-muted); font-size: 10px; }
135
+ .zhin-sandbox .agent-playground-task-list dl { display: flex; gap: 14px; margin-top: 8px; font-size: 10px; }
136
+ .zhin-sandbox .agent-playground-task-list dt { color: var(--ac-muted); }
137
+ .zhin-sandbox .agent-playground-artifact-list article { border: 1px solid var(--ac-line); background: var(--ac-panel); border-radius: 8px; overflow: hidden; }
138
+ .zhin-sandbox .agent-playground-artifact-list article > button { width: 100%; border: 0; border-radius: 0; padding: 12px; text-align: left; }
139
+ .zhin-sandbox .agent-playground-artifact-list article > button > span:nth-child(2) { flex: 1; min-width: 0; display: grid; gap: 4px; }
140
+ .zhin-sandbox .agent-playground-artifact-list small { color: var(--ac-muted); font-size: 10px; overflow-wrap: anywhere; }
141
+ .zhin-sandbox .agent-playground-artifact-list em { font-style: normal; color: var(--ac-muted); font-size: 10px; }
142
+ .zhin-sandbox .agent-playground-artifact-detail { padding: 12px; font-size: 11px; display: grid; gap: 8px; }
143
+ .zhin-sandbox .agent-playground-artifact-detail pre { max-height: 320px; overflow: auto; padding: 10px; background: var(--ac-canvas); border-radius: 6px; }
144
+ .zhin-sandbox .agent-playground-artifact-detail footer { display: flex; justify-content: space-between; color: var(--ac-muted); }
145
+ .zhin-sandbox .agent-playground-studio-link { display: grid; gap: 6px; padding: 18px 20px; font-size: 12px; margin-top: auto; border-top: 1px solid var(--ac-line); text-decoration: none; }
146
+ .zhin-sandbox .agent-playground-studio-link span { display: flex; gap: 7px; align-items: center; }
147
+ .zhin-sandbox .agent-playground-studio-link code { color: var(--ac-muted); font-size: 10px; overflow-wrap: anywhere; }
148
+ .zhin-sandbox .agent-playground-inspector-overlay, .zhin-sandbox .channel-overlay { display: none; }
149
+ .zhin-sandbox .agent-playground-inline-run { border: 1px solid var(--ac-line); border-radius: 10px; padding: 16px; background: var(--ac-canvas); }
150
+ .zhin-sandbox .agent-playground-inline-run-head { display: flex; align-items: flex-start; gap: 10px; }
151
+ .zhin-sandbox .agent-playground-inline-run-icon { color: var(--ac-muted); padding-top: 4px; }
152
+ .zhin-sandbox .agent-playground-inline-run-copy { flex: 1; min-width: 0; }
153
+ .zhin-sandbox .agent-playground-inline-run-copy > span { font-size: 10px; color: var(--ac-muted); }
154
+ .zhin-sandbox .agent-playground-inline-run-copy h3 { font-size: 14px; font-weight: 600; }
155
+ .zhin-sandbox .agent-playground-inline-run-copy p { font-size: 12px; color: var(--ac-muted); overflow-wrap: anywhere; margin-top: 4px; }
156
+ .zhin-sandbox .agent-playground-inline-run-actions { display: flex; gap: 6px; }
157
+ .zhin-sandbox .agent-playground-inline-run-metrics { display: flex; flex-wrap: wrap; gap: 20px; padding: 14px 0; border-bottom: 1px solid var(--ac-line); font-variant-numeric: tabular-nums; }
158
+ .zhin-sandbox .agent-playground-inline-run-metrics dt { font-size: 10px; color: var(--ac-muted); }
159
+ .zhin-sandbox .agent-playground-inline-run-metrics dd { font-size: 13px; font-weight: 600; }
160
+ .zhin-sandbox .agent-playground-inline-run-steps { padding: 0; list-style: none; margin: 16px 0; display: grid; gap: 12px; }
161
+ .zhin-sandbox .agent-playground-inline-run-steps li { display: flex; align-items: flex-start; gap: 8px; }
162
+ .zhin-sandbox .agent-playground-inline-run-steps li > div { flex: 1; min-width: 0; display: grid; gap: 4px; }
163
+ .zhin-sandbox .agent-playground-inline-run-steps strong { font-size: 12px; font-weight: 600; }
164
+ .zhin-sandbox .agent-playground-inline-run-steps small, .zhin-sandbox .agent-playground-inline-run-steps li > span { font-size: 10px; color: var(--ac-muted); overflow-wrap: anywhere; }
165
+ .zhin-sandbox .agent-playground-inline-run-steps i { width: 6px; height: 6px; margin-top: 6px; border-radius: 50%; background: var(--ac-muted); flex-shrink: 0; }
166
+ .zhin-sandbox .agent-playground-inline-run-steps .is-failed i { background: var(--ac-bad); }
167
+ .zhin-sandbox .agent-playground-inline-run-empty { font-size: 12px; padding-top: 12px; color: var(--ac-muted); }
168
+ .zhin-sandbox .agent-playground-inline-run footer { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; }
169
+ .zhin-sandbox .agent-playground-inline-run footer { margin-top: 12px; }
170
+ .zhin-sandbox .agent-playground-conversation-details { padding: 20px; overflow: auto; flex: 1; }
171
+ .zhin-sandbox .agent-playground-history-navigation, .zhin-sandbox .agent-playground-history-notice { text-align: center; padding: 10px; color: var(--ac-muted); font-size: 12px; }
172
+ @media (min-width: 1280px) {
173
+ .zhin-sandbox.agent-playground-shell.has-inspector { grid-template-columns: 232px minmax(0,1fr) 330px; }
174
+ .zhin-sandbox .agent-playground-inspector { position: static; width: auto; }
175
+ }
176
+ @media (max-width: 1279px) {
177
+ .zhin-sandbox .agent-playground-inspector-overlay { display: block; position: absolute; inset: 0; background: #18181b40; z-index: 25; }
178
+ }
179
+ @media (max-width: 767px) {
180
+ .zhin-sandbox.agent-playground-shell { grid-template-columns: minmax(0,1fr); grid-template-rows: auto minmax(0,1fr); height: calc(100dvh - 92px); min-height: 480px; border-radius: 10px; }
181
+ .zhin-sandbox .agent-playground-mobilebar { display: flex; align-items: center; justify-content: space-between; padding: 10px; border-bottom: 1px solid var(--ac-line); }
182
+ .zhin-sandbox .agent-playground-mobilebar strong { font-size: 13px; }
183
+ .zhin-sandbox .agent-playground-mobilebar button { font-size: 11px; padding: 6px; }
184
+ .zhin-sandbox .agent-playground-sessions { display: none; position: absolute; inset: 0 auto 0 0; width: min(280px,85%); z-index: 40; }
185
+ .zhin-sandbox .agent-playground-sessions.show { display: flex; }
186
+ .zhin-sandbox .channel-overlay { display: block; position: absolute; inset: 0; z-index: 35; background: #18181b40; }
187
+ .zhin-sandbox .agent-playground-runbar { padding: 12px; align-items: flex-start; flex-direction: column; gap: 10px; }
188
+ .zhin-sandbox .agent-playground-run-actions { justify-content: flex-start; }
189
+ .zhin-sandbox .agent-playground-run-actions > button[aria-controls="sandbox-run-inspector"] { display: none; }
190
+ .zhin-sandbox .agent-playground-message-scroll { padding: 20px 12px; }
191
+ .zhin-sandbox .agent-playground-composer { padding: 12px; }
192
+ .zhin-sandbox .agent-playground-composer > div:last-child { max-height: 32px; overflow: hidden; }
193
+ .zhin-sandbox .agent-playground-confirm { padding: 12px; flex-wrap: wrap; }
194
+ .zhin-sandbox .agent-playground-confirm > div { flex-basis: 100%; }
195
+ .zhin-sandbox .agent-playground-run-settings { padding: 12px; max-height: 240px; overflow: auto; }
196
+ .zhin-sandbox .agent-playground-empty { margin-top: 24px; }
197
+ .zhin-sandbox .agent-playground-prompts { flex-direction: column; }
198
+ }
199
+ `;
@@ -115,19 +115,28 @@ export function readSandboxHistoryPage(body, binding, before, locale = 'zh-CN')
115
115
  || !validTime(item.timestamp) || before !== undefined && Number(item.sequence) >= before)
116
116
  fail();
117
117
  previous = Number(item.sequence);
118
- if (item.type === 'message.created') {
118
+ if (item.type === 'message.created' || item.type === 'message.updated') {
119
119
  const message = record(item.message), ref = record(message?.ref), actor = record(message?.actor);
120
120
  if (!message || !ref || !text(ref.id) || !matches(ref.conversation) || !validTime(message.timestamp)
121
121
  || !Array.isArray(message.segments) || !message.segments.every(segment => text(record(segment)?.type) && record(record(segment)?.data))
122
122
  || message.actor !== undefined && (!actor || !text(actor.id) || actor.displayName !== undefined && typeof actor.displayName !== 'string')
123
123
  || message.contentStatus !== undefined && message.contentStatus !== 'unavailable')
124
124
  fail();
125
+ if (message.revision !== undefined && (!Number.isSafeInteger(message.revision) || Number(message.revision) < 0)
126
+ || item.type === 'message.updated' && (!Number.isSafeInteger(message.revision) || Number(message.revision) <= 0)
127
+ || message.recalled !== undefined && message.recalled !== true)
128
+ fail();
125
129
  const content = message.contentStatus === 'unavailable'
126
130
  ? [{ type: 'text', data: { text: sandboxText(locale, '消息正文未保存') } }] : message.segments;
127
131
  messages.push({ id: ref.id, type: actor ? 'sent' : 'received', channelType: binding.scene.type, channelId: binding.scene.id,
128
132
  channelName: binding.scene.name, senderId: actor ? String(actor.id) : 'endpoint',
129
133
  senderName: actor ? String(actor.displayName || actor.id) : binding.scope.id, content, timestamp: message.timestamp,
130
- historySequence: previous, ...(hasPlaygroundKeyboard(content) ? { interactionReadOnly: true } : {}) });
134
+ historySequence: previous, historyEvent: { type: item.type, sequence: previous },
135
+ ...(item.type === 'message.created' ? { historyCreatedSequence: previous } : {}),
136
+ ...(hasPlaygroundKeyboard(content) ? { interactionReadOnly: true } : {}),
137
+ ...(message.revision === undefined ? {} : { revision: Number(message.revision), streaming: false }),
138
+ ...(message.recalled === true ? { recalled: true } : {}),
139
+ });
131
140
  }
132
141
  else if (item.type === 'message.recalled') {
133
142
  const ref = record(item.messageRef);
@@ -147,15 +156,39 @@ export function readSandboxHistoryPage(body, binding, before, locale = 'zh-CN')
147
156
  /** Stable message identity joins canonical events, optimistic inputs and native wire receipts. */
148
157
  export function mergeSandboxHistory(current, history) {
149
158
  const key = (row) => JSON.stringify([row.channelType, row.channelId, row.type, row.id]);
150
- const rows = new Map(current.map(row => [key(row), row]));
159
+ const targetKey = (row, id = row.id) => JSON.stringify([row.channelType, row.channelId, id]);
160
+ const lowest = (left, right) => left === undefined ? right : right === undefined ? left : Math.min(left, right);
161
+ const recalled = new Set(), recallSequences = new Map();
162
+ for (const row of [...current, ...history]) {
163
+ if (!row.recalledMessageId)
164
+ continue;
165
+ const target = targetKey(row, row.recalledMessageId);
166
+ recalled.add(target);
167
+ if (row.historySequence !== undefined)
168
+ recallSequences.set(target, lowest(recallSequences.get(target), row.historySequence));
169
+ }
170
+ // An earlier page can reveal that a previously loaded raw update followed a recall.
171
+ const afterRecall = (row) => row.historyEvent?.type === 'message.updated'
172
+ && recallSequences.has(targetKey(row)) && row.historyEvent.sequence >= recallSequences.get(targetKey(row));
173
+ const rows = new Map(current.filter(row => !afterRecall(row)).map(row => [key(row), row]));
151
174
  for (const row of history) {
175
+ if (afterRecall(row))
176
+ continue;
152
177
  const existing = rows.get(key(row));
153
- rows.set(key(row), existing ? { ...row, ...existing, historySequence: row.historySequence,
154
- ...(existing.interactionReadOnly === false ? { interactionReadOnly: false } : row.interactionReadOnly ? { interactionReadOnly: true } : {}) } : row);
178
+ const beforeRecall = Boolean(row.historyEvent && row.historyEvent.sequence < (recallSequences.get(targetKey(row)) ?? -1));
179
+ const newer = (!existing?.recalled || row.recalled || beforeRecall) && ((row.revision ?? 0) > (existing?.revision ?? 0)
180
+ || (row.revision ?? 0) === (existing?.revision ?? 0) && row.historyEvent && existing?.historyEvent
181
+ && row.historyEvent.sequence < existing.historyEvent.sequence);
182
+ const createdSequence = lowest(existing?.historyCreatedSequence, row.historyCreatedSequence);
183
+ rows.set(key(row), existing ? { ...(newer ? { ...existing, ...row } : { ...row, ...existing }),
184
+ historySequence: createdSequence ?? lowest(existing.historySequence, row.historySequence), historyCreatedSequence: createdSequence,
185
+ historyEvent: newer ? row.historyEvent : existing.historyEvent,
186
+ ...(!newer && existing.interactionReadOnly === false ? { interactionReadOnly: false } : row.interactionReadOnly ? { interactionReadOnly: true } : {}),
187
+ ...(existing.recalled || row.recalled ? { recalled: true } : {}),
188
+ } : row);
155
189
  }
156
- const recalled = new Set([...rows.values()].filter(row => row.recalledMessageId).map(row => JSON.stringify([row.channelType, row.channelId, row.recalledMessageId])));
157
- return [...rows.values()].map(row => recalled.has(JSON.stringify([row.channelType, row.channelId, row.id]))
158
- ? { ...row, recalled: true, ...(hasPlaygroundKeyboard(row.content) ? { interactionReadOnly: true } : {}) } : row)
190
+ return [...rows.values()].map(row => row.recalled || recalled.has(targetKey(row))
191
+ ? { ...row, recalled: true, streaming: false, ...(hasPlaygroundKeyboard(row.content) ? { interactionReadOnly: true } : {}) } : row)
159
192
  .sort((a, b) => a.timestamp - b.timestamp || (a.channelType === b.channelType && a.channelId === b.channelId
160
193
  ? (a.historySequence ?? Number.MAX_SAFE_INTEGER) - (b.historySequence ?? Number.MAX_SAFE_INTEGER) : 0));
161
194
  }
@@ -121,18 +121,26 @@ export function readSandboxHistoryPage(body: unknown, binding: SandboxHistoryBin
121
121
  if (!item || !Number.isSafeInteger(item.sequence) || Number(item.sequence) <= previous || !text(item.type)
122
122
  || !validTime(item.timestamp) || before !== undefined && Number(item.sequence) >= before) fail();
123
123
  previous = Number(item.sequence);
124
- if (item.type === 'message.created') {
124
+ if (item.type === 'message.created' || item.type === 'message.updated') {
125
125
  const message = record(item.message), ref = record(message?.ref), actor = record(message?.actor);
126
126
  if (!message || !ref || !text(ref.id) || !matches(ref.conversation) || !validTime(message.timestamp)
127
127
  || !Array.isArray(message.segments) || !message.segments.every(segment => text(record(segment)?.type) && record(record(segment)?.data))
128
128
  || message.actor !== undefined && (!actor || !text(actor.id) || actor.displayName !== undefined && typeof actor.displayName !== 'string')
129
129
  || message.contentStatus !== undefined && message.contentStatus !== 'unavailable') fail();
130
+ if (message.revision !== undefined && (!Number.isSafeInteger(message.revision) || Number(message.revision) < 0)
131
+ || item.type === 'message.updated' && (!Number.isSafeInteger(message.revision) || Number(message.revision) <= 0)
132
+ || message.recalled !== undefined && message.recalled !== true) fail();
130
133
  const content: MessageSegment[] = message.contentStatus === 'unavailable'
131
134
  ? [{ type: 'text', data: { text: sandboxText(locale, '消息正文未保存') } }] : message.segments as MessageSegment[];
132
135
  messages.push({ id: ref.id, type: actor ? 'sent' : 'received', channelType: binding.scene.type, channelId: binding.scene.id,
133
136
  channelName: binding.scene.name, senderId: actor ? String(actor.id) : 'endpoint',
134
137
  senderName: actor ? String(actor.displayName || actor.id) : binding.scope.id, content, timestamp: message.timestamp,
135
- historySequence: previous, ...(hasPlaygroundKeyboard(content) ? { interactionReadOnly: true } : {}) });
138
+ historySequence: previous, historyEvent: { type: item.type, sequence: previous },
139
+ ...(item.type === 'message.created' ? { historyCreatedSequence: previous } : {}),
140
+ ...(hasPlaygroundKeyboard(content) ? { interactionReadOnly: true } : {}),
141
+ ...(message.revision === undefined ? {} : { revision: Number(message.revision), streaming: false }),
142
+ ...(message.recalled === true ? { recalled: true } : {}),
143
+ });
136
144
  } else if (item.type === 'message.recalled') {
137
145
  const ref = record(item.messageRef);
138
146
  if (item.messageRef !== undefined && (!ref || !text(ref.id) || !matches(ref.conversation))) fail();
@@ -150,15 +158,36 @@ export function readSandboxHistoryPage(body: unknown, binding: SandboxHistoryBin
150
158
  /** Stable message identity joins canonical events, optimistic inputs and native wire receipts. */
151
159
  export function mergeSandboxHistory(current: readonly PlaygroundMessage[], history: readonly PlaygroundMessage[]): PlaygroundMessage[] {
152
160
  const key = (row: PlaygroundMessage) => JSON.stringify([row.channelType, row.channelId, row.type, row.id]);
153
- const rows = new Map(current.map(row => [key(row), row]));
161
+ const targetKey = (row: PlaygroundMessage, id = row.id) => JSON.stringify([row.channelType, row.channelId, id]);
162
+ const lowest = (left?: number, right?: number) => left === undefined ? right : right === undefined ? left : Math.min(left, right);
163
+ const recalled = new Set<string>(), recallSequences = new Map<string, number>();
164
+ for (const row of [...current, ...history]) {
165
+ if (!row.recalledMessageId) continue;
166
+ const target = targetKey(row, row.recalledMessageId);
167
+ recalled.add(target);
168
+ if (row.historySequence !== undefined) recallSequences.set(target, lowest(recallSequences.get(target), row.historySequence)!);
169
+ }
170
+ // An earlier page can reveal that a previously loaded raw update followed a recall.
171
+ const afterRecall = (row: PlaygroundMessage) => row.historyEvent?.type === 'message.updated'
172
+ && recallSequences.has(targetKey(row)) && row.historyEvent.sequence >= recallSequences.get(targetKey(row))!;
173
+ const rows = new Map(current.filter(row => !afterRecall(row)).map(row => [key(row), row]));
154
174
  for (const row of history) {
175
+ if (afterRecall(row)) continue;
155
176
  const existing = rows.get(key(row));
156
- rows.set(key(row), existing ? { ...row, ...existing, historySequence: row.historySequence,
157
- ...(existing.interactionReadOnly === false ? { interactionReadOnly: false } : row.interactionReadOnly ? { interactionReadOnly: true } : {}) } : row);
177
+ const beforeRecall = Boolean(row.historyEvent && row.historyEvent.sequence < (recallSequences.get(targetKey(row)) ?? -1));
178
+ const newer = (!existing?.recalled || row.recalled || beforeRecall) && ((row.revision ?? 0) > (existing?.revision ?? 0)
179
+ || (row.revision ?? 0) === (existing?.revision ?? 0) && row.historyEvent && existing?.historyEvent
180
+ && row.historyEvent.sequence < existing.historyEvent.sequence);
181
+ const createdSequence = lowest(existing?.historyCreatedSequence, row.historyCreatedSequence);
182
+ rows.set(key(row), existing ? { ...(newer ? { ...existing, ...row } : { ...row, ...existing }),
183
+ historySequence: createdSequence ?? lowest(existing.historySequence, row.historySequence), historyCreatedSequence: createdSequence,
184
+ historyEvent: newer ? row.historyEvent : existing.historyEvent,
185
+ ...(!newer && existing.interactionReadOnly === false ? { interactionReadOnly: false } : row.interactionReadOnly ? { interactionReadOnly: true } : {}),
186
+ ...(existing.recalled || row.recalled ? { recalled: true } : {}),
187
+ } : row);
158
188
  }
159
- const recalled = new Set([...rows.values()].filter(row => row.recalledMessageId).map(row => JSON.stringify([row.channelType, row.channelId, row.recalledMessageId])));
160
- return [...rows.values()].map(row => recalled.has(JSON.stringify([row.channelType, row.channelId, row.id]))
161
- ? { ...row, recalled: true, ...(hasPlaygroundKeyboard(row.content) ? { interactionReadOnly: true } : {}) } : row)
189
+ return [...rows.values()].map(row => row.recalled || recalled.has(targetKey(row))
190
+ ? { ...row, recalled: true, streaming: false, ...(hasPlaygroundKeyboard(row.content) ? { interactionReadOnly: true } : {}) } : row)
162
191
  .sort((a, b) => a.timestamp - b.timestamp || (a.channelType === b.channelType && a.channelId === b.channelId
163
192
  ? (a.historySequence ?? Number.MAX_SAFE_INTEGER) - (b.historySequence ?? Number.MAX_SAFE_INTEGER) : 0));
164
193
  }
package/plugin.js CHANGED
@@ -2,6 +2,7 @@
2
2
  import { definePlugin } from 'zhin.js';
3
3
  export default definePlugin({
4
4
  name: 'sandbox',
5
+ configUpdate: { featurePaths: [['nickname'], ['profile'], ['endpoints']] },
5
6
  metadata: {
6
7
  displayName: 'Sandbox Adapter',
7
8
  },