@volter-ai-dev/supercode-ui 0.1.1 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -5
- package/components.d.ts +17 -0
- package/components.mjs +416 -346
- package/composer.d.ts +2 -0
- package/composer.mjs +23 -20
- package/conversation.d.ts +20 -0
- package/conversation.mjs +79 -65
- package/core.d.ts +41 -0
- package/core.mjs +71 -4
- package/embed.d.ts +2 -0
- package/embed.mjs +415 -345
- package/logo.d.ts +2 -0
- package/logo.mjs +7 -70
- package/messenger.d.ts +10 -0
- package/messenger.mjs +413 -343
- package/package.json +23 -12
- package/sessions.d.ts +9 -0
- package/sessions.mjs +71 -53
- package/styles.css +5 -4
package/logo.d.ts
ADDED
package/logo.mjs
CHANGED
|
@@ -1,73 +1,6 @@
|
|
|
1
|
-
// src/
|
|
2
|
-
import
|
|
3
|
-
import { useEffect, useId, useLayoutEffect, useMemo, useRef, useState } from "preact/hooks";
|
|
4
|
-
|
|
5
|
-
// core.mjs
|
|
6
|
-
var HARNESS_NAMES = Object.freeze({
|
|
7
|
-
"claude-code": "Claude Code",
|
|
8
|
-
codex: "Codex",
|
|
9
|
-
opencode: "OpenCode",
|
|
10
|
-
pi: "Pi",
|
|
11
|
-
grok: "Grok"
|
|
12
|
-
});
|
|
13
|
-
var DEFAULT_LABELS = Object.freeze({
|
|
14
|
-
chats: "Chats",
|
|
15
|
-
newChat: "New chat",
|
|
16
|
-
searchChats: "Search chats",
|
|
17
|
-
askAgent: "Ask your agent\u2026",
|
|
18
|
-
continueHere: "Continue here",
|
|
19
|
-
joinLive: "Join live",
|
|
20
|
-
forkHere: "Fork here"
|
|
21
|
-
});
|
|
22
|
-
var EMPTY_UI_STATE = Object.freeze({
|
|
23
|
-
pill: Object.freeze({ tone: "off", label: "connecting\u2026" }),
|
|
24
|
-
startup: "connecting",
|
|
25
|
-
transcript: Object.freeze([]),
|
|
26
|
-
busy: false,
|
|
27
|
-
operation: null,
|
|
28
|
-
needsInput: false,
|
|
29
|
-
harness: "",
|
|
30
|
-
mode: "none",
|
|
31
|
-
strategy: null,
|
|
32
|
-
canSend: false,
|
|
33
|
-
canResume: false,
|
|
34
|
-
canBranch: false,
|
|
35
|
-
canAttach: false,
|
|
36
|
-
canDetach: false,
|
|
37
|
-
canOpenTerminal: false,
|
|
38
|
-
canExport: false,
|
|
39
|
-
canReduce: false,
|
|
40
|
-
canInterrupt: false,
|
|
41
|
-
canRespond: false,
|
|
42
|
-
messaging: null,
|
|
43
|
-
workspace: "",
|
|
44
|
-
taskPlan: Object.freeze({ source: "none", items: Object.freeze([]), residueCount: 0, observedAt: null }),
|
|
45
|
-
semantics: Object.freeze({ fidelity: null, residue: Object.freeze([]), residueCount: 0, parseErrors: 0, rawRecords: 0, subagents: Object.freeze([]) }),
|
|
46
|
-
terminalHandoff: null,
|
|
47
|
-
exportBackTarget: null,
|
|
48
|
-
exportReceipt: null,
|
|
49
|
-
reductionReceipt: null,
|
|
50
|
-
error: null,
|
|
51
|
-
recoverable: false,
|
|
52
|
-
harnesses: Object.freeze([]),
|
|
53
|
-
history: Object.freeze({ sessionLimit: 0, hasMoreSessions: false, transcriptLimit: 120, hasEarlier: false }),
|
|
54
|
-
savedDraft: "",
|
|
55
|
-
attention: Object.freeze([]),
|
|
56
|
-
sessions: Object.freeze([]),
|
|
57
|
-
attached: null,
|
|
58
|
-
owned: null,
|
|
59
|
-
attachError: null
|
|
60
|
-
});
|
|
61
|
-
|
|
62
|
-
// src/components.jsx
|
|
1
|
+
// src/logo.jsx
|
|
2
|
+
import { useEffect } from "preact/hooks";
|
|
63
3
|
import { jsx, jsxs } from "preact/jsx-runtime";
|
|
64
|
-
var markdown = new MarkdownIt({ html: false, linkify: true, breaks: false });
|
|
65
|
-
var defaultLinkOpen = markdown.renderer.rules.link_open;
|
|
66
|
-
markdown.renderer.rules.link_open = (tokens, index, options, env, self) => {
|
|
67
|
-
tokens[index]?.attrSet("target", "_blank");
|
|
68
|
-
tokens[index]?.attrSet("rel", "noreferrer noopener");
|
|
69
|
-
return defaultLinkOpen ? defaultLinkOpen(tokens, index, options, env, self) : self.renderToken(tokens, index, options);
|
|
70
|
-
};
|
|
71
4
|
var LOGOS = {
|
|
72
5
|
"claude-code": {
|
|
73
6
|
viewBox: "-1 3.5 26 18",
|
|
@@ -81,6 +14,10 @@ var LOGOS = {
|
|
|
81
14
|
["path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M8.086.457a6.105 6.105 0 013.046-.415c1.333.153 2.521.72 3.564 1.7a.117.117 0 00.107.029c1.408-.346 2.762-.224 4.061.366l.063.03.154.076c1.357.703 2.33 1.77 2.918 3.198.278.679.418 1.388.421 2.126a5.655 5.655 0 01-.18 1.631.167.167 0 00.04.155 5.982 5.982 0 011.578 2.891c.385 1.901-.01 3.615-1.183 5.14l-.182.22a6.063 6.063 0 01-2.934 1.851.162.162 0 00-.108.102c-.255.736-.511 1.364-.987 1.992-1.199 1.582-2.962 2.462-4.948 2.451-1.583-.008-2.986-.587-4.21-1.736a.145.145 0 00-.14-.032c-.518.167-1.04.191-1.604.185a5.924 5.924 0 01-2.595-.622 6.058 6.058 0 01-2.146-1.781c-.203-.269-.404-.522-.551-.821a7.74 7.74 0 01-.495-1.283 6.11 6.11 0 01-.017-3.064.166.166 0 00.008-.074.115.115 0 00-.037-.064 5.958 5.958 0 01-1.38-2.202 5.196 5.196 0 01-.333-1.589 6.915 6.915 0 01.188-2.132c.45-1.484 1.309-2.648 2.577-3.493.282-.188.55-.334.802-.438.286-.12.573-.22.861-.304a.129.129 0 00.087-.087A6.016 6.016 0 015.635 2.31C6.315 1.464 7.132.846 8.086.457zm-.804 7.85a.848.848 0 00-1.473.842l1.694 2.965-1.688 2.848a.849.849 0 001.46.864l1.94-3.272a.849.849 0 00.007-.854l-1.94-3.393zm5.446 6.24a.849.849 0 000 1.695h4.848a.849.849 0 000-1.696h-4.848z" }]
|
|
82
15
|
]
|
|
83
16
|
},
|
|
17
|
+
gemini: {
|
|
18
|
+
viewBox: "0 0 24 24",
|
|
19
|
+
paths: [["path", { d: "M12 24C12 17.373 6.627 12 0 12 6.627 12 12 6.627 12 0c0 6.627 5.373 12 12 12-6.627 0-12 5.373-12 12z" }]]
|
|
20
|
+
},
|
|
84
21
|
grok: {
|
|
85
22
|
viewBox: "-1 -1 26 26",
|
|
86
23
|
paths: [["path", { d: "M9.27 15.29l7.978-5.897c.391-.29.95-.177 1.137.272.98 2.369.542 5.215-1.41 7.169-1.951 1.954-4.667 2.382-7.149 1.406l-2.711 1.257c3.889 2.661 8.611 2.003 11.562-.953 2.341-2.344 3.066-5.539 2.388-8.42l.006.007c-.983-4.232.242-5.924 2.75-9.383.06-.082.12-.164.179-.248l-3.301 3.305v-.01L9.267 15.292M7.623 16.723c-2.792-2.67-2.31-6.801.071-9.184 1.761-1.763 4.647-2.483 7.166-1.425l2.705-1.25a7.808 7.808 0 00-1.829-1A8.975 8.975 0 005.984 5.83c-2.533 2.536-3.33 6.436-1.962 9.764 1.022 2.487-.653 4.246-2.34 6.022-.599.63-1.199 1.259-1.682 1.925l7.62-6.815" }]]
|
|
@@ -104,7 +41,7 @@ function HarnessLogo({ id, activity, size = 28, onMissingLogo }) {
|
|
|
104
41
|
}, [id, logo, onMissingLogo]);
|
|
105
42
|
if (!logo) return null;
|
|
106
43
|
return /* @__PURE__ */ jsxs("span", { class: "scui-logo", "data-harness": id, "data-activity": activity, style: `--scui-logo-size:${size}px`, "aria-hidden": "true", children: [
|
|
107
|
-
/* @__PURE__ */ jsx("svg", { viewBox: logo.viewBox, focusable: "false", children: logo.paths.map(([Tag, props], index) => /* @__PURE__ */ jsx(Tag, { ...props }, index)) }),
|
|
44
|
+
/* @__PURE__ */ jsx("svg", { viewBox: logo.viewBox, preserveAspectRatio: "xMidYMid meet", focusable: "false", children: logo.paths.map(([Tag, props], index) => /* @__PURE__ */ jsx(Tag, { ...props }, index)) }),
|
|
108
45
|
activity && activity !== "idle" ? /* @__PURE__ */ jsx("i", {}) : null
|
|
109
46
|
] });
|
|
110
47
|
}
|