@copilotz/team 0.0.0-stage → 1.0.0-rc.35
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 +21 -0
- package/README.md +49 -2
- package/WORDS.md +200 -0
- package/contract.d.ts +8 -0
- package/contract.js +8 -0
- package/mod.d.ts +25 -0
- package/mod.js +25 -0
- package/package.json +63 -4
- package/team/actions/agent.d.ts +4 -0
- package/team/actions/agent.js +179 -0
- package/team/actions/define.d.ts +1 -0
- package/team/actions/define.js +27 -0
- package/team/collections/agent.d.ts +132 -0
- package/team/collections/agent.js +75 -0
- package/team/contract.d.ts +10 -0
- package/team/contract.js +1 -0
- package/team/mod.d.ts +21 -0
- package/team/mod.js +49 -0
- package/team/shared/definition.d.ts +3 -0
- package/team/shared/definition.js +10 -0
- package/team/views/web/agent-add.d.ts +14 -0
- package/team/views/web/agent-add.js +48 -0
- package/team/views/web/agent-fields.d.ts +33 -0
- package/team/views/web/agent-fields.js +88 -0
- package/team/views/web/agent-known.d.ts +22 -0
- package/team/views/web/agent-known.js +61 -0
- package/team/views/web/agent-new.d.ts +24 -0
- package/team/views/web/agent-new.js +129 -0
- package/team/views/web/agent-palette.d.ts +19 -0
- package/team/views/web/agent-palette.js +203 -0
- package/team/views/web/agent-steps.d.ts +23 -0
- package/team/views/web/agent-steps.js +56 -0
- package/team/views/web/agent.d.ts +17 -0
- package/team/views/web/agent.js +257 -0
- package/team/views/web/agents.d.ts +48 -0
- package/team/views/web/agents.js +59 -0
- package/team/views/web/model-pick.d.ts +25 -0
- package/team/views/web/model-pick.js +39 -0
- package/team/views/web/model-picker.d.ts +57 -0
- package/team/views/web/model-picker.js +218 -0
- package/team/views/web/places.d.ts +24 -0
- package/team/views/web/places.js +10 -0
- package/team/views/web/style.d.ts +9 -0
- package/team/views/web/style.js +246 -0
- package/team/views/web/words.d.ts +5 -0
- package/team/views/web/words.js +211 -0
- package/team/web.d.ts +22 -0
- package/team/web.js +41 -0
- package/tiers/actions/choose.d.ts +2 -0
- package/tiers/actions/choose.js +98 -0
- package/tiers/actions/model.d.ts +1 -0
- package/tiers/actions/model.js +36 -0
- package/tiers/collections/choice.d.ts +48 -0
- package/tiers/collections/choice.js +59 -0
- package/tiers/contract.d.ts +19 -0
- package/tiers/contract.js +1 -0
- package/tiers/mod.d.ts +54 -0
- package/tiers/mod.js +92 -0
- package/tiers/shared/shown.d.ts +87 -0
- package/tiers/shared/shown.js +155 -0
- package/tiers/shared/tiers.d.ts +103 -0
- package/tiers/shared/tiers.js +129 -0
- package/tiers/views/web/org.d.ts +38 -0
- package/tiers/views/web/org.js +142 -0
- package/tiers/views/web/space.d.ts +43 -0
- package/tiers/views/web/space.js +103 -0
- package/tiers/views/web/style.d.ts +7 -0
- package/tiers/views/web/style.js +87 -0
- package/tiers/views/web/words.d.ts +21 -0
- package/tiers/views/web/words.js +49 -0
- package/tiers/web.d.ts +18 -0
- package/tiers/web.js +40 -0
- package/web.d.ts +14 -0
- package/web.js +14 -0
|
@@ -0,0 +1,218 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
/**
|
|
3
|
+
* Choosing the model an agent thinks with, from every provider the app can
|
|
4
|
+
* reach (`models.offered`, from the models.dev catalog). Closed, it shows
|
|
5
|
+
* what's chosen, and says so when it can't run yet; or, where a line already
|
|
6
|
+
* says what's chosen (`look: "link"`), it's just a small "Change". Open, a dialog: search
|
|
7
|
+
* across providers and models, or browse the providers, those ready first, and
|
|
8
|
+
* then one's models, newest first, with what each costs and can do. A provider
|
|
9
|
+
* without a key asks for one: the org's owners and admins add it here
|
|
10
|
+
* (`modelKey.set`), and it's never shown again; anyone else is told whom to ask.
|
|
11
|
+
*/
|
|
12
|
+
import { useCallback, useEffect, useRef, useState } from "react";
|
|
13
|
+
import { createPortal } from "react-dom";
|
|
14
|
+
import { Badge, Button, Dialog, formatNumber, Icon, IconButton, Input, message, Notice, Skeleton, } from "copilotz/web";
|
|
15
|
+
import { say } from "./words.js";
|
|
16
|
+
/** How long after typing it searches. */
|
|
17
|
+
const TYPING_MS = 180;
|
|
18
|
+
/** Tokens, shortly: `200K`, `1M`. */
|
|
19
|
+
const tokens = (count) => count >= 1_000
|
|
20
|
+
? formatNumber(count, {
|
|
21
|
+
notation: "compact",
|
|
22
|
+
maximumFractionDigits: count >= 1_000_000 ? 1 : 0,
|
|
23
|
+
})
|
|
24
|
+
: formatNumber(count);
|
|
25
|
+
/** Dollars, in the page's language; the currency stays. */
|
|
26
|
+
const usd = (amount) => formatNumber(+amount.toFixed(amount < 1 ? 3 : 2), {
|
|
27
|
+
style: "currency",
|
|
28
|
+
currency: "USD",
|
|
29
|
+
minimumFractionDigits: 0,
|
|
30
|
+
maximumFractionDigits: 3,
|
|
31
|
+
});
|
|
32
|
+
/**
|
|
33
|
+
* What a model costs, per million tokens in and out; nothing, when it says so. On
|
|
34
|
+
* the org's own key it's its provider's to charge, and uses none of the org's
|
|
35
|
+
* credits, which is worth knowing before choosing it.
|
|
36
|
+
*/
|
|
37
|
+
function priced({ price, ownKey }) {
|
|
38
|
+
if (price?.input === undefined || price.output === undefined)
|
|
39
|
+
return undefined;
|
|
40
|
+
if (!price.input && !price.output)
|
|
41
|
+
return say("noCreditsUsed");
|
|
42
|
+
const per = say("priceLine", { input: usd(price.input), output: usd(price.output) });
|
|
43
|
+
return ownKey ? say("priceOwnKey", { price: per }) : per;
|
|
44
|
+
}
|
|
45
|
+
/** What a kind of input is called. */
|
|
46
|
+
const media = (kind) => kind === "image"
|
|
47
|
+
? say("mediaImage")
|
|
48
|
+
: kind === "pdf"
|
|
49
|
+
? say("mediaPdf")
|
|
50
|
+
: kind === "audio"
|
|
51
|
+
? say("mediaAudio")
|
|
52
|
+
: kind === "video"
|
|
53
|
+
? say("mediaVideo")
|
|
54
|
+
: kind;
|
|
55
|
+
/** What a model can do, in a line. */
|
|
56
|
+
function abilities(model) {
|
|
57
|
+
return [
|
|
58
|
+
...(model.context ? [say("contextSize", { size: tokens(model.context) })] : []),
|
|
59
|
+
...(model.input ?? []).map(media),
|
|
60
|
+
...(model.reasons ? [say("reasoning")] : []),
|
|
61
|
+
];
|
|
62
|
+
}
|
|
63
|
+
export function ModelPicker({ value, onChange, call, disabled, id, look = "field", label }) {
|
|
64
|
+
const [open, setOpen] = useState(false);
|
|
65
|
+
const [chosen, setChosen] = useState();
|
|
66
|
+
// What's chosen, by name, for the field; a link leaves that to the line it's on.
|
|
67
|
+
const load = useCallback(() => {
|
|
68
|
+
if (!value || look === "link")
|
|
69
|
+
return setChosen(undefined);
|
|
70
|
+
call("models.offered", {
|
|
71
|
+
model: value,
|
|
72
|
+
}).then(setChosen, () => setChosen(undefined));
|
|
73
|
+
}, [value, call, look]);
|
|
74
|
+
useEffect(load, [load]);
|
|
75
|
+
// Known and not ready: nothing can reach it until its key is added.
|
|
76
|
+
const stuck = chosen?.provider && !chosen.provider.ready;
|
|
77
|
+
const dialog = open
|
|
78
|
+
? createPortal(_jsx(Dialog, { open: true, onClose: () => {
|
|
79
|
+
setOpen(false);
|
|
80
|
+
load();
|
|
81
|
+
}, title: say("chooseModel"), className: "model-dialog", children: _jsx(Choosing, { value: value, call: call, onChoose: (model) => {
|
|
82
|
+
onChange(model);
|
|
83
|
+
setOpen(false);
|
|
84
|
+
} }) }), document.body)
|
|
85
|
+
: null;
|
|
86
|
+
if (look === "link") {
|
|
87
|
+
return (_jsxs(_Fragment, { children: [_jsx(Button, { id: id, variant: "link", size: "sm", className: "model-change", disabled: disabled, "aria-haspopup": "dialog", onClick: () => setOpen(true), children: label ?? say("change") }), dialog] }));
|
|
88
|
+
}
|
|
89
|
+
return (_jsxs(_Fragment, { children: [_jsxs("button", { type: "button", id: id, className: "model-chosen", disabled: disabled, "aria-haspopup": "dialog", onClick: () => setOpen(true), children: [_jsxs("span", { className: "model-chosen-text", children: [_jsx("b", { children: chosen?.model?.name ?? (value || say("chooseModel")) }), _jsxs("span", { children: [chosen?.provider?.name, chosen?.model && priced(chosen.model) ? ` · ${priced(chosen.model)}` : ""] })] }), stuck ? _jsx(Badge, { tone: "warning", children: say("needsKey") }) : null, _jsx(Icon, { name: "selector", size: 16 })] }), dialog] }));
|
|
90
|
+
}
|
|
91
|
+
/** What's in the dialog: the search, then what it found, the providers, or one provider. */
|
|
92
|
+
function Choosing({ value, call, onChoose }) {
|
|
93
|
+
const [listing, setListing] = useState();
|
|
94
|
+
const [typed, setTyped] = useState("");
|
|
95
|
+
const [found, setFound] = useState();
|
|
96
|
+
const [at, setAt] = useState();
|
|
97
|
+
const [error, setError] = useState();
|
|
98
|
+
const list = useCallback(() => {
|
|
99
|
+
call("models.offered", {}).then(setListing, (e) => setError(message(e)));
|
|
100
|
+
}, [call]);
|
|
101
|
+
useEffect(list, [list]);
|
|
102
|
+
// The last search asked is the one that shows.
|
|
103
|
+
const asked = useRef(0);
|
|
104
|
+
useEffect(() => {
|
|
105
|
+
const search = typed.trim();
|
|
106
|
+
const mine = ++asked.current;
|
|
107
|
+
if (!search)
|
|
108
|
+
return setFound(undefined);
|
|
109
|
+
const timer = setTimeout(() => {
|
|
110
|
+
call("models.offered", { search }).then((answer) => mine === asked.current && setFound(answer), (e) => mine === asked.current && setError(message(e)));
|
|
111
|
+
}, TYPING_MS);
|
|
112
|
+
return () => clearTimeout(timer);
|
|
113
|
+
}, [typed, call]);
|
|
114
|
+
if (at) {
|
|
115
|
+
return (_jsx(ProviderModels, { id: at, value: value, call: call, may: !!listing?.set, onBack: () => {
|
|
116
|
+
setAt(undefined);
|
|
117
|
+
list();
|
|
118
|
+
}, onChoose: onChoose }));
|
|
119
|
+
}
|
|
120
|
+
return (_jsxs("div", { className: "model-choose", children: [_jsx(Input, { icon: "search", placeholder: say("searchModels"), "aria-label": say("searchModels"), value: typed, autoFocus: true, onChange: (event) => setTyped(event.target.value) }), error ? _jsx(Notice, { tone: "destructive", role: "alert", children: error }) : null, typed.trim()
|
|
121
|
+
? _jsx(Results, { found: found, value: value, onProvider: setAt, onChoose: onChoose })
|
|
122
|
+
: _jsx(Providers, { listing: listing, onProvider: setAt })] }));
|
|
123
|
+
}
|
|
124
|
+
const Loading = () => (_jsx("div", { className: "model-list", "aria-busy": "true", children: [0, 1, 2, 3].map((n) => _jsx(Skeleton, { height: 46 }, n)) }));
|
|
125
|
+
function ProviderRow({ provider, onOpen }) {
|
|
126
|
+
return (_jsx("li", { children: _jsxs("button", { type: "button", className: "model-row", onClick: onOpen, children: [_jsxs("span", { className: "model-row-text", children: [_jsx("b", { children: provider.name }), _jsxs("span", { children: [say("providerModels", { count: provider.models }), provider.note ? ` · ${provider.note}` : ""] })] }), provider.hint ? _jsx(Badge, { tone: "primary", children: say("yourKey") }) : null, _jsx(Icon, { name: "chevron", size: 15 })] }) }));
|
|
127
|
+
}
|
|
128
|
+
/** The providers: those that can be used now, then those that take a key. */
|
|
129
|
+
export function Providers({ listing, onProvider }) {
|
|
130
|
+
if (!listing)
|
|
131
|
+
return _jsx(Loading, {});
|
|
132
|
+
const ready = listing.providers.filter((p) => p.ready);
|
|
133
|
+
const others = listing.providers.filter((p) => !p.ready);
|
|
134
|
+
return (_jsxs("div", { className: "model-groups", children: [ready.length
|
|
135
|
+
? (_jsxs("section", { children: [_jsx("h3", { className: "model-group", children: say("readyToUse") }), _jsx("ul", { className: "model-list", children: ready.map((p) => (_jsx(ProviderRow, { provider: p, onOpen: () => onProvider(p.id) }, p.id))) })] }))
|
|
136
|
+
: null, others.length
|
|
137
|
+
? (_jsxs("section", { children: [_jsx("h3", { className: "model-group", children: say("withOwnKey") }), _jsx("ul", { className: "model-list", children: others.map((p) => (_jsx(ProviderRow, { provider: p, onOpen: () => onProvider(p.id) }, p.id))) })] }))
|
|
138
|
+
: null] }));
|
|
139
|
+
}
|
|
140
|
+
export function ModelRow({ model, value, withProvider, onChoose }) {
|
|
141
|
+
const cost = priced(model);
|
|
142
|
+
return (_jsx("li", { children: _jsxs("button", { type: "button", className: "model-row model-row-model", disabled: !model.ready, "aria-current": model.id === value || undefined, onClick: onChoose, children: [_jsxs("span", { className: "model-row-text", children: [_jsx("b", { children: model.name }), _jsx("span", { children: [withProvider, ...abilities(model)].filter(Boolean).join(" · ") }), cost ? _jsx("span", { children: cost }) : null] }), model.id === value ? _jsx(Icon, { name: "check", size: 16 }) : null] }) }));
|
|
143
|
+
}
|
|
144
|
+
export function Results({ found, value, onProvider, onChoose }) {
|
|
145
|
+
if (!found)
|
|
146
|
+
return _jsx(Loading, {});
|
|
147
|
+
if (!found.providers.length && !found.models.length) {
|
|
148
|
+
return _jsx("p", { className: "model-none", children: say("nothingMatches") });
|
|
149
|
+
}
|
|
150
|
+
return (_jsxs("div", { className: "model-groups", children: [found.providers.length
|
|
151
|
+
? (_jsxs("section", { children: [_jsx("h3", { className: "model-group", children: say("providers") }), _jsx("ul", { className: "model-list", children: found.providers.map((p) => (_jsx(ProviderRow, { provider: p, onOpen: () => onProvider(p.id) }, p.id))) })] }))
|
|
152
|
+
: null, found.models.length
|
|
153
|
+
? (_jsxs("section", { children: [_jsx("h3", { className: "model-group", children: say("models") }), _jsx("ul", { className: "model-list", children: found.models.map((m) => m.ready
|
|
154
|
+
? (_jsx(ModelRow, { model: m, value: value, withProvider: m.from, onChoose: () => onChoose(m.id) }, m.id))
|
|
155
|
+
: (_jsx("li", { children: _jsxs("button", { type: "button", className: "model-row", onClick: () => onProvider(m.provider), children: [_jsxs("span", { className: "model-row-text", children: [_jsx("b", { children: m.name }), _jsx("span", { children: m.from })] }), _jsx(Badge, { children: say("needsKey") })] }) }, m.id))) })] }))
|
|
156
|
+
: null] }));
|
|
157
|
+
}
|
|
158
|
+
/** One provider: its key, if it takes one, and its models. */
|
|
159
|
+
function ProviderModels({ id, value, call, may, onBack, onChoose }) {
|
|
160
|
+
const [shown, setShown] = useState();
|
|
161
|
+
const [error, setError] = useState();
|
|
162
|
+
const load = useCallback(() => {
|
|
163
|
+
call("models.offered", {
|
|
164
|
+
provider: id,
|
|
165
|
+
}).then(setShown, (e) => setError(message(e)));
|
|
166
|
+
}, [id, call]);
|
|
167
|
+
useEffect(load, [load]);
|
|
168
|
+
const provider = shown?.provider;
|
|
169
|
+
return (_jsxs("div", { className: "model-choose", children: [_jsxs("div", { className: "model-provider-head", children: [_jsx(IconButton, { icon: "chevron-left", label: say("allProviders"), size: "sm", onClick: onBack }), _jsx("h3", { children: provider?.name ?? id })] }), provider?.note ? _jsx("p", { className: "model-provider-note", children: provider.note }) : null, error ? _jsx(Notice, { tone: "destructive", role: "alert", children: error }) : null, provider?.keyed
|
|
170
|
+
? _jsx(ProviderKey, { provider: provider, may: may, call: call, onChange: load })
|
|
171
|
+
: null, shown
|
|
172
|
+
? (_jsx("ul", { className: "model-list", children: shown.models.map((m) => (_jsx(ModelRow, { model: m, value: value, onChoose: () => onChoose(m.id) }, m.id))) }))
|
|
173
|
+
: _jsx(Loading, {})] }));
|
|
174
|
+
}
|
|
175
|
+
/** The org's key for a provider: added, replaced or removed by those who run it. */
|
|
176
|
+
export function ProviderKey({ provider, may, call, onChange }) {
|
|
177
|
+
const [editing, setEditing] = useState(false);
|
|
178
|
+
const [key, setKey] = useState("");
|
|
179
|
+
const [busy, setBusy] = useState(false);
|
|
180
|
+
const [error, setError] = useState();
|
|
181
|
+
const act = async (work) => {
|
|
182
|
+
setBusy(true);
|
|
183
|
+
setError(undefined);
|
|
184
|
+
try {
|
|
185
|
+
await work();
|
|
186
|
+
setKey("");
|
|
187
|
+
setEditing(false);
|
|
188
|
+
onChange();
|
|
189
|
+
}
|
|
190
|
+
catch (e) {
|
|
191
|
+
setError(message(e));
|
|
192
|
+
}
|
|
193
|
+
finally {
|
|
194
|
+
setBusy(false);
|
|
195
|
+
}
|
|
196
|
+
};
|
|
197
|
+
if (!may) {
|
|
198
|
+
return provider.ready ? null : (_jsx(Notice, { tone: "neutral", icon: "info", children: say("noKeyForProvider", { provider: provider.name }) }));
|
|
199
|
+
}
|
|
200
|
+
// Asked for at once where nothing else can reach this provider.
|
|
201
|
+
if (editing || (!provider.ready && !provider.hint)) {
|
|
202
|
+
return (_jsxs("form", { className: "model-key", onSubmit: (event) => {
|
|
203
|
+
event.preventDefault();
|
|
204
|
+
// React hands it on to the form this picker was opened from.
|
|
205
|
+
event.stopPropagation();
|
|
206
|
+
if (key.trim()) {
|
|
207
|
+
void act(() => call("modelKey.set", { provider: provider.id, key: key.trim() }));
|
|
208
|
+
}
|
|
209
|
+
}, children: [_jsx("label", { htmlFor: `key-${provider.id}`, children: say("apiKeyLabel", { provider: provider.name }) }), _jsxs("div", { className: "model-key-entry", children: [_jsx(Input, { id: `key-${provider.id}`, type: "password", autoComplete: "off", spellCheck: false, placeholder: say("pasteIt"), value: key, invalid: !!error, disabled: busy, onChange: (event) => setKey(event.target.value) }), _jsx(Button, { type: "submit", variant: "primary", disabled: busy || !key.trim(), children: say("save") }), provider.ready || provider.hint
|
|
210
|
+
? (_jsx(Button, { type: "button", variant: "ghost", disabled: busy, onClick: () => setEditing(false), children: say("cancel") }))
|
|
211
|
+
: null] }), _jsx("p", { children: say("keyNote", { provider: provider.name }) }), error ? _jsx("p", { className: "model-key-error", role: "alert", children: error }) : null] }));
|
|
212
|
+
}
|
|
213
|
+
return (_jsxs("div", { className: "model-key-kept", children: [_jsx("span", { children: provider.hint
|
|
214
|
+
? say.nodes("orgKey", { hint: _jsx("code", { children: provider.hint }) })
|
|
215
|
+
: say("usesAppKey") }), _jsxs("span", { className: "model-key-actions", children: [_jsx(Button, { type: "button", variant: "ghost", size: "sm", disabled: busy, onClick: () => setEditing(true), children: provider.hint ? say("replace") : say("useOwnKey") }), provider.hint
|
|
216
|
+
? (_jsx(Button, { type: "button", variant: "ghost", size: "sm", disabled: busy, onClick: () => void act(() => call("modelKey.remove", { provider: provider.id })), children: say("remove") }))
|
|
217
|
+
: null] }), error ? _jsx("p", { className: "model-key-error", role: "alert", children: error }) : null] }));
|
|
218
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Spaces as chat's web front end reads them (the spaces plugin's
|
|
3
|
+
* `space.reached`, by name): what each is called (yours is "Personal"),
|
|
4
|
+
* whether the person manages one, and those they manage and still use,
|
|
5
|
+
* Personal first: where they make agents and add them.
|
|
6
|
+
*/
|
|
7
|
+
/** A space, as `space.reached` answers: with what the person may do there. */
|
|
8
|
+
export type Place = {
|
|
9
|
+
_id: string;
|
|
10
|
+
name: string;
|
|
11
|
+
kind: string;
|
|
12
|
+
can?: string[];
|
|
13
|
+
/** The agent that answers its new chats. */
|
|
14
|
+
agent?: string;
|
|
15
|
+
archived?: string;
|
|
16
|
+
};
|
|
17
|
+
/** What a space is called where it shows: yours is "Personal". */
|
|
18
|
+
export declare const placeName: (place: Pick<Place, "name" | "kind">) => string;
|
|
19
|
+
/** Whether the person manages it. */
|
|
20
|
+
export declare const manages: (place?: Pick<Place, "can"> | null) => boolean;
|
|
21
|
+
/** The spaces the person manages, in use: Personal first, then by name. */
|
|
22
|
+
export declare const managed: <P extends Place>(places: P[]) => P[];
|
|
23
|
+
/** A space's page, at a tab. */
|
|
24
|
+
export declare const placePath: (place: string, tab?: string) => string;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { say } from "./words.js";
|
|
2
|
+
/** What a space is called where it shows: yours is "Personal". */
|
|
3
|
+
export const placeName = (place) => place.kind === "personal" ? say("personalSpace") : place.name;
|
|
4
|
+
/** Whether the person manages it. */
|
|
5
|
+
export const manages = (place) => !!place?.can?.includes("manage");
|
|
6
|
+
/** The spaces the person manages, in use: Personal first, then by name. */
|
|
7
|
+
export const managed = (places) => places.filter((p) => manages(p) && !p.archived).sort((a, b) => Number(b.kind === "personal") - Number(a.kind === "personal") ||
|
|
8
|
+
a.name.localeCompare(b.name, undefined, { sensitivity: "base" }));
|
|
9
|
+
/** A space's page, at a tab. */
|
|
10
|
+
export const placePath = (place, tab) => `/space/${encodeURIComponent(place)}${tab ? `?tab=${encodeURIComponent(tab)}` : ""}`;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Agents' layout on the web, on the theme's variables: adding one to a
|
|
3
|
+
* space (those someone knows, and making one), the form an agent is made
|
|
4
|
+
* and changed with (its emoji, its instructions being written, its model, its tools),
|
|
5
|
+
* what making one says after, and an agent's page (where it works, what
|
|
6
|
+
* it's told, what it uses, changing and deleting it). Only layout: the
|
|
7
|
+
* pieces are the toolkit's.
|
|
8
|
+
*/
|
|
9
|
+
export declare const STYLE = "\n/* Choosing a model */\n.model-chosen { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 54px;\n padding: 8px 12px; border: 1px solid var(--input); border-radius: var(--radius-md);\n background: var(--background); color: inherit; font: inherit; text-align: left; cursor: pointer;\n transition: border-color .15s, background-color .15s; }\n.model-chosen:hover:not(:disabled) { background: var(--accent); }\n.model-chosen:focus-visible { outline: 2px solid var(--ring); outline-offset: 1px; }\n.model-chosen:disabled { opacity: .6; cursor: default; }\n.model-chosen > .copilotz-icon { flex: none; color: var(--muted-foreground); }\n.model-chosen-text, .model-row-text { display: grid; flex: 1; min-width: 0; gap: 1px; }\n.model-chosen-text b, .model-row-text b { overflow: hidden; font-size: 14px; font-weight: 580;\n text-overflow: ellipsis; white-space: nowrap; }\n.model-chosen-text span, .model-row-text span { overflow: hidden; color: var(--muted-foreground);\n font-size: 12.5px; line-height: 1.4; text-overflow: ellipsis; white-space: nowrap; }\n.model-dialog .copilotz-dialog-body { display: flex; min-height: min(560px, calc(100dvh - 130px)); }\n.model-choose { display: flex; flex: 1; flex-direction: column; gap: 12px; min-width: 0; }\n.model-groups { display: grid; gap: 16px; }\n.model-group { margin: 0 0 6px; color: var(--muted-foreground); font-size: 12px; font-weight: 600; }\n.model-list { display: grid; gap: 2px; margin: 0; padding: 0; list-style: none; }\n.model-row { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 48px;\n padding: 7px 10px; border: 0; border-radius: var(--radius-md); background: transparent;\n color: inherit; font: inherit; text-align: left; cursor: pointer; }\n.model-row:hover:not(:disabled) { background: var(--accent); }\n.model-row:focus-visible { outline: 2px solid var(--ring); outline-offset: -2px; }\n.model-row:disabled { opacity: .55; cursor: not-allowed; }\n.model-row[aria-current] { background: var(--primary-soft); }\n.model-row > .copilotz-icon { flex: none; color: var(--muted-foreground); }\n.model-row[aria-current] > .copilotz-icon { color: var(--primary); }\n.model-row .model-row-text span { white-space: normal; }\n.model-none { margin: 24px 0; color: var(--muted-foreground); font-size: 14px; text-align: center; }\n.model-provider-head { display: flex; align-items: center; gap: 8px; margin-left: -6px; }\n.model-provider-head h3 { margin: 0; overflow-wrap: anywhere; font-size: 15px; font-weight: 600; }\n.model-provider-note { margin: -6px 0 0; color: var(--muted-foreground); font-size: 13px; }\n.model-key { display: grid; gap: 8px; padding: 12px; border: 1px solid var(--border);\n border-radius: var(--radius-lg); background: var(--card); }\n.model-key label { font-size: 13.5px; font-weight: 600; }\n.model-key p { margin: 0; color: var(--muted-foreground); font-size: 12.5px; line-height: 1.45; }\n.model-key-entry { display: flex; flex-wrap: wrap; gap: 8px; }\n.model-key-entry > .copilotz-input { flex: 1 1 180px; min-width: 0; }\n.model-key p.model-key-error, .model-key-error { margin: 0; color: var(--destructive-text, var(--destructive));\n font-size: 13px; }\n.model-key-kept { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;\n gap: 4px 10px; padding: 6px 6px 6px 12px; border: 1px solid var(--border);\n border-radius: var(--radius-lg); background: var(--card); font-size: 13px; }\n.model-key-actions { display: flex; }\n.model-key-kept .model-key-error { flex-basis: 100%; }\n.model-pick { display: grid; gap: 4px; min-width: 0; }\n.model-pick[data-look=link] { display: inline-flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; }\n.model-pick-error { color: var(--destructive-text, var(--destructive)); font-size: 12.5px; line-height: 1.4; }\n.model-change { height: auto; padding: 0; font-size: 13px; }\n\n/* Adding an agent to a space */\n.agent-add { container: agent-add / inline-size; display: grid; gap: 14px; }\n.agent-known { display: grid; gap: 12px; }\n.agent-known-tools { display: flex; align-items: center; justify-content: space-between; gap: 10px; }\n.agent-known-find { flex: 1; min-width: 0; }\n.agent-known-intro { margin: 0; color: var(--muted-foreground); font-size: 13px; }\n.agent-known-role { flex: none; display: inline-flex; align-items: center; gap: 8px; color: var(--muted-foreground);\n font-size: 13px; }\n.agent-known-role .copilotz-select { min-width: 112px; }\n.agent-known-list { list-style: none; display: grid; margin: 0; padding: 4px; border: 1px solid var(--border);\n border-radius: var(--radius-xl); background: var(--card); max-height: min(420px, 52vh); overflow-y: auto;\n scrollbar-width: thin; }\n.agent-known-row { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; align-items: center; gap: 12px;\n width: 100%; min-height: 56px; padding: 8px 8px 8px 10px; border: 0; border-radius: var(--radius-lg);\n background: transparent; color: inherit; font: inherit; text-align: left; }\n.agent-known-row + .agent-known-row, li + .agent-known-row { border-top: 1px solid var(--border); border-radius: 0; }\n.agent-known-new { cursor: pointer; transition: background-color .12s; }\n.agent-known-new:hover { background: var(--accent); }\n.agent-known-new > .copilotz-icon { color: var(--muted-foreground); margin-right: 6px; }\n.agent-known-plus { display: grid; place-items: center; width: 34px; height: 34px; border: 1px dashed var(--primary-border);\n border-radius: var(--radius-md); background: var(--primary-soft); color: var(--primary-text); }\n.agent-known-text { display: grid; gap: 1px; min-width: 0; line-height: 1.35; }\n.agent-known-name { overflow: hidden; font-size: 14px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }\n.agent-known-what { overflow: hidden; color: var(--muted-foreground); font-size: 12.5px; text-overflow: ellipsis;\n white-space: nowrap; }\n.agent-known-from { margin-left: 8px; color: var(--muted-foreground); font-size: 12px; font-weight: 450; }\n.agent-known-from::before { content: \"\u00B7\"; margin-right: 8px; }\n.agent-known-none { margin: 0 2px; color: var(--muted-foreground); font-size: 13px; text-align: center; }\n.agent-handle { color: var(--muted-foreground); font: 500 12px var(--font-mono); }\n.agent-form-note b.agent-handle, .copilotz-field-note b.agent-handle { color: var(--secondary-foreground); }\n.agent-done { display: inline-flex; align-items: center; gap: 6px; color: var(--success-text); }\n.agent-error { color: var(--destructive-text); }\n@container agent-add (max-width: 420px) {\n .agent-known-tools { flex-wrap: wrap; }\n .agent-known-find { flex-basis: 100%; }\n .agent-known-from { display: block; margin-left: 0; }\n .agent-known-from::before { content: none; }\n}\n\n/* Making one */\n.agent-new { display: grid; gap: 20px; }\n.agent-new :is(input, textarea, select, button) { scroll-margin-bottom: 84px; }\n.agent-new-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: -4px; }\n.agent-new-top > .copilotz-button { margin-left: -8px; }\n.agent-new-from { display: inline-flex; align-items: center; gap: 8px; color: var(--muted-foreground); font-size: 13px; }\n.agent-new-from .copilotz-select { min-width: 170px; }\n.agent-new-end { position: sticky; bottom: -22px; z-index: 1; display: flex; align-items: center; justify-content: flex-end;\n gap: 14px; margin: 0 -22px -22px; padding: 12px 22px 16px; border-top: 1px solid var(--border);\n background: var(--popover); }\n.agent-new-end .agent-form-note { flex: 1; min-width: 0; }\n.agent-new-end .agent-form-note:empty { visibility: hidden; }\n\n/* The form: who it is, what it does, what it's told, what it uses */\n.agent-form { display: grid; gap: 20px; }\n.agent-form-who { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: start; gap: 16px; }\n.agent-form-who > .copilotz-avatar { margin-top: 22px; box-shadow: var(--shadow-sm); }\n.agent-face-empty { display: grid; place-items: center; width: 56px; height: 56px; margin-top: 22px;\n border: 1.5px dashed var(--input); border-radius: var(--radius-xl); background: var(--muted);\n color: var(--muted-foreground); }\n.agent-form-field { display: grid; gap: 7px; min-width: 0; }\n.agent-form-label { font-size: 13.5px; font-weight: 600; color: var(--foreground); }\n.agent-form-label-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 30px;\n margin: -4px 0 -3px; }\n.agent-form-label-row > .copilotz-button { margin-right: -6px; }\n.agent-form-count { margin-left: 6px; color: var(--muted-foreground); font-weight: 500; font-variant-numeric: tabular-nums; }\n.agent-form-note { margin: 0; color: var(--muted-foreground); font-size: 12.5px; line-height: 1.45; }\n.agent-undo { min-height: 0; padding: 0; vertical-align: baseline; }\n.agent-icons { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }\n.agent-icon { display: grid; place-items: center; width: 36px; height: 36px; padding: 0; border: 1px solid var(--border);\n border-radius: var(--radius-md); background: var(--card); color: var(--secondary-foreground); font-size: 18px;\n line-height: 1; cursor: pointer; transition: background-color .12s, border-color .12s, transform .12s; }\n.agent-icon:hover:not(:disabled) { background: var(--accent); transform: translateY(-1px); }\n.agent-icon[aria-checked=true] { border-color: var(--ring); background: var(--primary-soft);\n outline: 2px solid color-mix(in oklab, var(--ring) 22%, transparent); }\n.agent-icon:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }\n.agent-icon-none { font-size: 13px; font-weight: 650; }\n.agent-icon-own { width: 84px; height: 36px; }\n.agent-icon-own:has(input[data-chosen]) { border-color: var(--ring); background: var(--primary-soft); }\n.agent-instructions { position: relative; }\n.agent-instructions .copilotz-textarea { font-size: 14px; line-height: 1.55; }\n.agent-instructions[data-busy] .copilotz-textarea { color: transparent; }\n.agent-drafting { position: absolute; inset: 1px; display: grid; align-content: start; gap: 10px; overflow: hidden;\n padding: 12px 14px; border-radius: var(--radius-lg); background: color-mix(in oklab, var(--card) 94%, transparent);\n animation: agent-fade .2s ease-out; }\n.agent-drafting-say { display: inline-flex; align-items: center; gap: 8px; margin-bottom: 2px; color: var(--primary-text);\n font-size: 13px; font-weight: 560; }\n@keyframes agent-fade { from { opacity: 0; } }\n.agent-tools { display: grid; gap: 6px; padding: 6px 6px 8px 12px; border: 1px solid var(--border);\n border-radius: var(--radius-lg); background: color-mix(in oklab, var(--muted) 35%, var(--card)); }\n.agent-tools ul { list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));\n gap: 8px 16px; margin: 0; padding: 0; max-height: 260px; overflow-y: auto; scrollbar-width: thin; }\n.agent-tools-all { display: flex; gap: 12px; }\n.agent-tools-all .copilotz-button { min-height: 26px; padding: 0; }\n.agent-tool { display: grid; gap: 1px; }\n.agent-tool code { font: 600 12.5px var(--font-mono); }\n.agent-tool span { color: var(--muted-foreground); font-size: 12.5px; line-height: 1.4; }\n.agent-tools-line { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0; color: var(--muted-foreground);\n font-size: 12.5px; }\n.agent-tools-line code { padding: 2px 7px; border-radius: var(--radius-full); background: var(--muted);\n color: var(--secondary-foreground); font: 500 12px var(--font-mono); }\n\n/* Made: what's next */\n.agent-made { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: start; gap: 16px; padding: 18px;\n border: 1px solid var(--success-border); border-radius: var(--radius-xl);\n background: color-mix(in oklab, var(--success-soft) 55%, var(--card)); animation: agent-rise .25s ease-out; }\n@keyframes agent-rise { from { opacity: 0; transform: translateY(4px); } }\n.agent-made-face { position: relative; }\n.agent-made-check { position: absolute; right: -4px; bottom: -4px; display: grid; place-items: center; width: 20px;\n height: 20px; border: 2px solid var(--card); border-radius: var(--radius-full); background: var(--success);\n color: var(--success-foreground); }\n.agent-made-text { display: grid; gap: 4px; min-width: 0; }\n.agent-made-text h3 { margin: 0; font-family: var(--font-display); font-size: 16px; font-weight: 650; }\n.agent-made-text p { margin: 0; color: var(--secondary-foreground); font-size: 13.5px; }\n.agent-made-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }\n\n/* An agent's page */\n.agent-mark { box-shadow: var(--shadow-sm); }\n.agent-narrow { display: none; }\n@container copilotz-page (max-width: 640px) {\n .agent-wide { display: none; }\n .agent-narrow { display: inline-grid; }\n .agent-mark { --size: 40px !important; }\n}\n.agent-page-handle { font: 500 12px var(--font-mono); }\n.agent-page { display: grid; gap: 26px; }\n.agent-page-error { margin-bottom: 16px; }\n.agent-page-note { display: flex; align-items: center; gap: 7px; margin: -6px 0 -8px; color: var(--muted-foreground);\n font-size: 13px; }\n.agent-section { display: grid; gap: 10px; }\n.agent-section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 30px;\n margin-bottom: -4px; }\n.agent-section-head .copilotz-button { margin-right: -6px; }\n.agent-section-title { display: flex; align-items: center; gap: 8px; margin: 0; color: var(--muted-foreground);\n font-size: 12px; font-weight: 650; letter-spacing: .06em; text-transform: uppercase; }\n.agent-count { font-variant-numeric: tabular-nums; letter-spacing: 0; }\n.agent-seats { list-style: none; display: grid; margin: 0; padding: 4px; border: 1px solid var(--border);\n border-radius: var(--radius-xl); background: var(--card); box-shadow: var(--shadow-sm); }\n.agent-seat { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 8px 12px 8px 10px;\n border-radius: var(--radius-lg); color: inherit; text-decoration: none; transition: background-color .12s; }\n.agent-seat:hover { background: var(--accent); }\n.agent-seat > .copilotz-icon { color: var(--muted-foreground); }\n.agent-seat-personal { display: grid; place-items: center; flex: none; width: 28px; height: 28px;\n border-radius: var(--radius-md); background: var(--primary-soft); color: var(--primary-text); }\n.agent-seat-name { flex: 1; min-width: 0; overflow: hidden; font-weight: 580; text-overflow: ellipsis; white-space: nowrap; }\n.agent-none { margin: 0; color: var(--muted-foreground); font-size: 13.5px; }\n.agent-instructions-read { font-size: 14.5px; line-height: 1.6; }\n.agent-tool-list { list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr));\n gap: 10px 22px; margin: 0; padding: 0; }\n.agent-tool-list li { display: grid; gap: 1px; min-width: 0; }\n.agent-tool-list code { font: 600 12.5px var(--font-mono); }\n.agent-tool-list span { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden;\n color: var(--muted-foreground); font-size: 12.5px; line-height: 1.45; }\n.agent-tool-list span:empty { display: none; }\n.agent-tools-read { display: grid; justify-items: start; gap: 8px; }\n.agent-tools-read > .copilotz-button { min-height: 0; padding: 0; }\n.agent-edit { display: grid; gap: 14px; }\n.agent-edit-card { padding: 20px; }\n.agent-edit-end { position: sticky; bottom: 0; z-index: 2; display: flex; align-items: center; gap: 10px;\n margin: 0 -24px -64px; padding: 14px 24px 18px; border-top: 1px solid var(--border);\n background: color-mix(in oklab, var(--background) 92%, transparent); backdrop-filter: blur(8px); }\n.agent-edit-end .agent-form-note { flex: 1; min-width: 0; }\n.agent-delete-means { display: grid; gap: 10px; margin: 0 0 4px; padding: 0 0 0 18px; color: var(--secondary-foreground);\n font-size: 14px; line-height: 1.5; }\n.agent-delete-means b { color: var(--foreground); font-weight: 620; }\n.agent-delete-means + .copilotz-notice { margin-top: 14px; }\n.agent-missing { display: grid; place-items: center; height: 100%; padding: 32px; }\n@container copilotz-page (max-width: 560px) {\n .agent-edit-card { padding: 16px; }\n .agent-edit-end { flex-wrap: wrap; margin: 0 -16px -48px; padding: 12px 16px 14px; }\n .agent-edit-end .agent-form-note { flex-basis: 100%; }\n .agent-edit-end .copilotz-button { flex: 1; }\n .agent-form-who { gap: 12px; }\n .agent-form-who > .copilotz-avatar { --size: 44px !important; margin-top: 24px; }\n .agent-face-empty { width: 44px; height: 44px; margin-top: 24px; }\n}\n@container agent-add (max-width: 420px) {\n .agent-form-who { gap: 12px; }\n .agent-form-who > .copilotz-avatar { --size: 44px !important; margin-top: 24px; }\n .agent-face-empty { width: 44px; height: 44px; margin-top: 24px; }\n .agent-new-top { flex-wrap: wrap; }\n .agent-new-end { flex-wrap: wrap; }\n .agent-new-end .agent-form-note { flex-basis: 100%; }\n .agent-new-end .agent-form-note:empty { display: none; }\n .agent-new-end .copilotz-button { flex: 1; }\n}\n";
|
|
@@ -0,0 +1,246 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Agents' layout on the web, on the theme's variables: adding one to a
|
|
3
|
+
* space (those someone knows, and making one), the form an agent is made
|
|
4
|
+
* and changed with (its emoji, its instructions being written, its model, its tools),
|
|
5
|
+
* what making one says after, and an agent's page (where it works, what
|
|
6
|
+
* it's told, what it uses, changing and deleting it). Only layout: the
|
|
7
|
+
* pieces are the toolkit's.
|
|
8
|
+
*/
|
|
9
|
+
export const STYLE = `
|
|
10
|
+
/* Choosing a model */
|
|
11
|
+
.model-chosen { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 54px;
|
|
12
|
+
padding: 8px 12px; border: 1px solid var(--input); border-radius: var(--radius-md);
|
|
13
|
+
background: var(--background); color: inherit; font: inherit; text-align: left; cursor: pointer;
|
|
14
|
+
transition: border-color .15s, background-color .15s; }
|
|
15
|
+
.model-chosen:hover:not(:disabled) { background: var(--accent); }
|
|
16
|
+
.model-chosen:focus-visible { outline: 2px solid var(--ring); outline-offset: 1px; }
|
|
17
|
+
.model-chosen:disabled { opacity: .6; cursor: default; }
|
|
18
|
+
.model-chosen > .copilotz-icon { flex: none; color: var(--muted-foreground); }
|
|
19
|
+
.model-chosen-text, .model-row-text { display: grid; flex: 1; min-width: 0; gap: 1px; }
|
|
20
|
+
.model-chosen-text b, .model-row-text b { overflow: hidden; font-size: 14px; font-weight: 580;
|
|
21
|
+
text-overflow: ellipsis; white-space: nowrap; }
|
|
22
|
+
.model-chosen-text span, .model-row-text span { overflow: hidden; color: var(--muted-foreground);
|
|
23
|
+
font-size: 12.5px; line-height: 1.4; text-overflow: ellipsis; white-space: nowrap; }
|
|
24
|
+
.model-dialog .copilotz-dialog-body { display: flex; min-height: min(560px, calc(100dvh - 130px)); }
|
|
25
|
+
.model-choose { display: flex; flex: 1; flex-direction: column; gap: 12px; min-width: 0; }
|
|
26
|
+
.model-groups { display: grid; gap: 16px; }
|
|
27
|
+
.model-group { margin: 0 0 6px; color: var(--muted-foreground); font-size: 12px; font-weight: 600; }
|
|
28
|
+
.model-list { display: grid; gap: 2px; margin: 0; padding: 0; list-style: none; }
|
|
29
|
+
.model-row { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 48px;
|
|
30
|
+
padding: 7px 10px; border: 0; border-radius: var(--radius-md); background: transparent;
|
|
31
|
+
color: inherit; font: inherit; text-align: left; cursor: pointer; }
|
|
32
|
+
.model-row:hover:not(:disabled) { background: var(--accent); }
|
|
33
|
+
.model-row:focus-visible { outline: 2px solid var(--ring); outline-offset: -2px; }
|
|
34
|
+
.model-row:disabled { opacity: .55; cursor: not-allowed; }
|
|
35
|
+
.model-row[aria-current] { background: var(--primary-soft); }
|
|
36
|
+
.model-row > .copilotz-icon { flex: none; color: var(--muted-foreground); }
|
|
37
|
+
.model-row[aria-current] > .copilotz-icon { color: var(--primary); }
|
|
38
|
+
.model-row .model-row-text span { white-space: normal; }
|
|
39
|
+
.model-none { margin: 24px 0; color: var(--muted-foreground); font-size: 14px; text-align: center; }
|
|
40
|
+
.model-provider-head { display: flex; align-items: center; gap: 8px; margin-left: -6px; }
|
|
41
|
+
.model-provider-head h3 { margin: 0; overflow-wrap: anywhere; font-size: 15px; font-weight: 600; }
|
|
42
|
+
.model-provider-note { margin: -6px 0 0; color: var(--muted-foreground); font-size: 13px; }
|
|
43
|
+
.model-key { display: grid; gap: 8px; padding: 12px; border: 1px solid var(--border);
|
|
44
|
+
border-radius: var(--radius-lg); background: var(--card); }
|
|
45
|
+
.model-key label { font-size: 13.5px; font-weight: 600; }
|
|
46
|
+
.model-key p { margin: 0; color: var(--muted-foreground); font-size: 12.5px; line-height: 1.45; }
|
|
47
|
+
.model-key-entry { display: flex; flex-wrap: wrap; gap: 8px; }
|
|
48
|
+
.model-key-entry > .copilotz-input { flex: 1 1 180px; min-width: 0; }
|
|
49
|
+
.model-key p.model-key-error, .model-key-error { margin: 0; color: var(--destructive-text, var(--destructive));
|
|
50
|
+
font-size: 13px; }
|
|
51
|
+
.model-key-kept { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
|
|
52
|
+
gap: 4px 10px; padding: 6px 6px 6px 12px; border: 1px solid var(--border);
|
|
53
|
+
border-radius: var(--radius-lg); background: var(--card); font-size: 13px; }
|
|
54
|
+
.model-key-actions { display: flex; }
|
|
55
|
+
.model-key-kept .model-key-error { flex-basis: 100%; }
|
|
56
|
+
.model-pick { display: grid; gap: 4px; min-width: 0; }
|
|
57
|
+
.model-pick[data-look=link] { display: inline-flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; }
|
|
58
|
+
.model-pick-error { color: var(--destructive-text, var(--destructive)); font-size: 12.5px; line-height: 1.4; }
|
|
59
|
+
.model-change { height: auto; padding: 0; font-size: 13px; }
|
|
60
|
+
|
|
61
|
+
/* Adding an agent to a space */
|
|
62
|
+
.agent-add { container: agent-add / inline-size; display: grid; gap: 14px; }
|
|
63
|
+
.agent-known { display: grid; gap: 12px; }
|
|
64
|
+
.agent-known-tools { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
|
|
65
|
+
.agent-known-find { flex: 1; min-width: 0; }
|
|
66
|
+
.agent-known-intro { margin: 0; color: var(--muted-foreground); font-size: 13px; }
|
|
67
|
+
.agent-known-role { flex: none; display: inline-flex; align-items: center; gap: 8px; color: var(--muted-foreground);
|
|
68
|
+
font-size: 13px; }
|
|
69
|
+
.agent-known-role .copilotz-select { min-width: 112px; }
|
|
70
|
+
.agent-known-list { list-style: none; display: grid; margin: 0; padding: 4px; border: 1px solid var(--border);
|
|
71
|
+
border-radius: var(--radius-xl); background: var(--card); max-height: min(420px, 52vh); overflow-y: auto;
|
|
72
|
+
scrollbar-width: thin; }
|
|
73
|
+
.agent-known-row { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; align-items: center; gap: 12px;
|
|
74
|
+
width: 100%; min-height: 56px; padding: 8px 8px 8px 10px; border: 0; border-radius: var(--radius-lg);
|
|
75
|
+
background: transparent; color: inherit; font: inherit; text-align: left; }
|
|
76
|
+
.agent-known-row + .agent-known-row, li + .agent-known-row { border-top: 1px solid var(--border); border-radius: 0; }
|
|
77
|
+
.agent-known-new { cursor: pointer; transition: background-color .12s; }
|
|
78
|
+
.agent-known-new:hover { background: var(--accent); }
|
|
79
|
+
.agent-known-new > .copilotz-icon { color: var(--muted-foreground); margin-right: 6px; }
|
|
80
|
+
.agent-known-plus { display: grid; place-items: center; width: 34px; height: 34px; border: 1px dashed var(--primary-border);
|
|
81
|
+
border-radius: var(--radius-md); background: var(--primary-soft); color: var(--primary-text); }
|
|
82
|
+
.agent-known-text { display: grid; gap: 1px; min-width: 0; line-height: 1.35; }
|
|
83
|
+
.agent-known-name { overflow: hidden; font-size: 14px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
|
|
84
|
+
.agent-known-what { overflow: hidden; color: var(--muted-foreground); font-size: 12.5px; text-overflow: ellipsis;
|
|
85
|
+
white-space: nowrap; }
|
|
86
|
+
.agent-known-from { margin-left: 8px; color: var(--muted-foreground); font-size: 12px; font-weight: 450; }
|
|
87
|
+
.agent-known-from::before { content: "·"; margin-right: 8px; }
|
|
88
|
+
.agent-known-none { margin: 0 2px; color: var(--muted-foreground); font-size: 13px; text-align: center; }
|
|
89
|
+
.agent-handle { color: var(--muted-foreground); font: 500 12px var(--font-mono); }
|
|
90
|
+
.agent-form-note b.agent-handle, .copilotz-field-note b.agent-handle { color: var(--secondary-foreground); }
|
|
91
|
+
.agent-done { display: inline-flex; align-items: center; gap: 6px; color: var(--success-text); }
|
|
92
|
+
.agent-error { color: var(--destructive-text); }
|
|
93
|
+
@container agent-add (max-width: 420px) {
|
|
94
|
+
.agent-known-tools { flex-wrap: wrap; }
|
|
95
|
+
.agent-known-find { flex-basis: 100%; }
|
|
96
|
+
.agent-known-from { display: block; margin-left: 0; }
|
|
97
|
+
.agent-known-from::before { content: none; }
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
/* Making one */
|
|
101
|
+
.agent-new { display: grid; gap: 20px; }
|
|
102
|
+
.agent-new :is(input, textarea, select, button) { scroll-margin-bottom: 84px; }
|
|
103
|
+
.agent-new-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: -4px; }
|
|
104
|
+
.agent-new-top > .copilotz-button { margin-left: -8px; }
|
|
105
|
+
.agent-new-from { display: inline-flex; align-items: center; gap: 8px; color: var(--muted-foreground); font-size: 13px; }
|
|
106
|
+
.agent-new-from .copilotz-select { min-width: 170px; }
|
|
107
|
+
.agent-new-end { position: sticky; bottom: -22px; z-index: 1; display: flex; align-items: center; justify-content: flex-end;
|
|
108
|
+
gap: 14px; margin: 0 -22px -22px; padding: 12px 22px 16px; border-top: 1px solid var(--border);
|
|
109
|
+
background: var(--popover); }
|
|
110
|
+
.agent-new-end .agent-form-note { flex: 1; min-width: 0; }
|
|
111
|
+
.agent-new-end .agent-form-note:empty { visibility: hidden; }
|
|
112
|
+
|
|
113
|
+
/* The form: who it is, what it does, what it's told, what it uses */
|
|
114
|
+
.agent-form { display: grid; gap: 20px; }
|
|
115
|
+
.agent-form-who { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: start; gap: 16px; }
|
|
116
|
+
.agent-form-who > .copilotz-avatar { margin-top: 22px; box-shadow: var(--shadow-sm); }
|
|
117
|
+
.agent-face-empty { display: grid; place-items: center; width: 56px; height: 56px; margin-top: 22px;
|
|
118
|
+
border: 1.5px dashed var(--input); border-radius: var(--radius-xl); background: var(--muted);
|
|
119
|
+
color: var(--muted-foreground); }
|
|
120
|
+
.agent-form-field { display: grid; gap: 7px; min-width: 0; }
|
|
121
|
+
.agent-form-label { font-size: 13.5px; font-weight: 600; color: var(--foreground); }
|
|
122
|
+
.agent-form-label-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 30px;
|
|
123
|
+
margin: -4px 0 -3px; }
|
|
124
|
+
.agent-form-label-row > .copilotz-button { margin-right: -6px; }
|
|
125
|
+
.agent-form-count { margin-left: 6px; color: var(--muted-foreground); font-weight: 500; font-variant-numeric: tabular-nums; }
|
|
126
|
+
.agent-form-note { margin: 0; color: var(--muted-foreground); font-size: 12.5px; line-height: 1.45; }
|
|
127
|
+
.agent-undo { min-height: 0; padding: 0; vertical-align: baseline; }
|
|
128
|
+
.agent-icons { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
|
|
129
|
+
.agent-icon { display: grid; place-items: center; width: 36px; height: 36px; padding: 0; border: 1px solid var(--border);
|
|
130
|
+
border-radius: var(--radius-md); background: var(--card); color: var(--secondary-foreground); font-size: 18px;
|
|
131
|
+
line-height: 1; cursor: pointer; transition: background-color .12s, border-color .12s, transform .12s; }
|
|
132
|
+
.agent-icon:hover:not(:disabled) { background: var(--accent); transform: translateY(-1px); }
|
|
133
|
+
.agent-icon[aria-checked=true] { border-color: var(--ring); background: var(--primary-soft);
|
|
134
|
+
outline: 2px solid color-mix(in oklab, var(--ring) 22%, transparent); }
|
|
135
|
+
.agent-icon:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }
|
|
136
|
+
.agent-icon-none { font-size: 13px; font-weight: 650; }
|
|
137
|
+
.agent-icon-own { width: 84px; height: 36px; }
|
|
138
|
+
.agent-icon-own:has(input[data-chosen]) { border-color: var(--ring); background: var(--primary-soft); }
|
|
139
|
+
.agent-instructions { position: relative; }
|
|
140
|
+
.agent-instructions .copilotz-textarea { font-size: 14px; line-height: 1.55; }
|
|
141
|
+
.agent-instructions[data-busy] .copilotz-textarea { color: transparent; }
|
|
142
|
+
.agent-drafting { position: absolute; inset: 1px; display: grid; align-content: start; gap: 10px; overflow: hidden;
|
|
143
|
+
padding: 12px 14px; border-radius: var(--radius-lg); background: color-mix(in oklab, var(--card) 94%, transparent);
|
|
144
|
+
animation: agent-fade .2s ease-out; }
|
|
145
|
+
.agent-drafting-say { display: inline-flex; align-items: center; gap: 8px; margin-bottom: 2px; color: var(--primary-text);
|
|
146
|
+
font-size: 13px; font-weight: 560; }
|
|
147
|
+
@keyframes agent-fade { from { opacity: 0; } }
|
|
148
|
+
.agent-tools { display: grid; gap: 6px; padding: 6px 6px 8px 12px; border: 1px solid var(--border);
|
|
149
|
+
border-radius: var(--radius-lg); background: color-mix(in oklab, var(--muted) 35%, var(--card)); }
|
|
150
|
+
.agent-tools ul { list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
|
|
151
|
+
gap: 8px 16px; margin: 0; padding: 0; max-height: 260px; overflow-y: auto; scrollbar-width: thin; }
|
|
152
|
+
.agent-tools-all { display: flex; gap: 12px; }
|
|
153
|
+
.agent-tools-all .copilotz-button { min-height: 26px; padding: 0; }
|
|
154
|
+
.agent-tool { display: grid; gap: 1px; }
|
|
155
|
+
.agent-tool code { font: 600 12.5px var(--font-mono); }
|
|
156
|
+
.agent-tool span { color: var(--muted-foreground); font-size: 12.5px; line-height: 1.4; }
|
|
157
|
+
.agent-tools-line { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0; color: var(--muted-foreground);
|
|
158
|
+
font-size: 12.5px; }
|
|
159
|
+
.agent-tools-line code { padding: 2px 7px; border-radius: var(--radius-full); background: var(--muted);
|
|
160
|
+
color: var(--secondary-foreground); font: 500 12px var(--font-mono); }
|
|
161
|
+
|
|
162
|
+
/* Made: what's next */
|
|
163
|
+
.agent-made { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: start; gap: 16px; padding: 18px;
|
|
164
|
+
border: 1px solid var(--success-border); border-radius: var(--radius-xl);
|
|
165
|
+
background: color-mix(in oklab, var(--success-soft) 55%, var(--card)); animation: agent-rise .25s ease-out; }
|
|
166
|
+
@keyframes agent-rise { from { opacity: 0; transform: translateY(4px); } }
|
|
167
|
+
.agent-made-face { position: relative; }
|
|
168
|
+
.agent-made-check { position: absolute; right: -4px; bottom: -4px; display: grid; place-items: center; width: 20px;
|
|
169
|
+
height: 20px; border: 2px solid var(--card); border-radius: var(--radius-full); background: var(--success);
|
|
170
|
+
color: var(--success-foreground); }
|
|
171
|
+
.agent-made-text { display: grid; gap: 4px; min-width: 0; }
|
|
172
|
+
.agent-made-text h3 { margin: 0; font-family: var(--font-display); font-size: 16px; font-weight: 650; }
|
|
173
|
+
.agent-made-text p { margin: 0; color: var(--secondary-foreground); font-size: 13.5px; }
|
|
174
|
+
.agent-made-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
|
|
175
|
+
|
|
176
|
+
/* An agent's page */
|
|
177
|
+
.agent-mark { box-shadow: var(--shadow-sm); }
|
|
178
|
+
.agent-narrow { display: none; }
|
|
179
|
+
@container copilotz-page (max-width: 640px) {
|
|
180
|
+
.agent-wide { display: none; }
|
|
181
|
+
.agent-narrow { display: inline-grid; }
|
|
182
|
+
.agent-mark { --size: 40px !important; }
|
|
183
|
+
}
|
|
184
|
+
.agent-page-handle { font: 500 12px var(--font-mono); }
|
|
185
|
+
.agent-page { display: grid; gap: 26px; }
|
|
186
|
+
.agent-page-error { margin-bottom: 16px; }
|
|
187
|
+
.agent-page-note { display: flex; align-items: center; gap: 7px; margin: -6px 0 -8px; color: var(--muted-foreground);
|
|
188
|
+
font-size: 13px; }
|
|
189
|
+
.agent-section { display: grid; gap: 10px; }
|
|
190
|
+
.agent-section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 30px;
|
|
191
|
+
margin-bottom: -4px; }
|
|
192
|
+
.agent-section-head .copilotz-button { margin-right: -6px; }
|
|
193
|
+
.agent-section-title { display: flex; align-items: center; gap: 8px; margin: 0; color: var(--muted-foreground);
|
|
194
|
+
font-size: 12px; font-weight: 650; letter-spacing: .06em; text-transform: uppercase; }
|
|
195
|
+
.agent-count { font-variant-numeric: tabular-nums; letter-spacing: 0; }
|
|
196
|
+
.agent-seats { list-style: none; display: grid; margin: 0; padding: 4px; border: 1px solid var(--border);
|
|
197
|
+
border-radius: var(--radius-xl); background: var(--card); box-shadow: var(--shadow-sm); }
|
|
198
|
+
.agent-seat { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 8px 12px 8px 10px;
|
|
199
|
+
border-radius: var(--radius-lg); color: inherit; text-decoration: none; transition: background-color .12s; }
|
|
200
|
+
.agent-seat:hover { background: var(--accent); }
|
|
201
|
+
.agent-seat > .copilotz-icon { color: var(--muted-foreground); }
|
|
202
|
+
.agent-seat-personal { display: grid; place-items: center; flex: none; width: 28px; height: 28px;
|
|
203
|
+
border-radius: var(--radius-md); background: var(--primary-soft); color: var(--primary-text); }
|
|
204
|
+
.agent-seat-name { flex: 1; min-width: 0; overflow: hidden; font-weight: 580; text-overflow: ellipsis; white-space: nowrap; }
|
|
205
|
+
.agent-none { margin: 0; color: var(--muted-foreground); font-size: 13.5px; }
|
|
206
|
+
.agent-instructions-read { font-size: 14.5px; line-height: 1.6; }
|
|
207
|
+
.agent-tool-list { list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr));
|
|
208
|
+
gap: 10px 22px; margin: 0; padding: 0; }
|
|
209
|
+
.agent-tool-list li { display: grid; gap: 1px; min-width: 0; }
|
|
210
|
+
.agent-tool-list code { font: 600 12.5px var(--font-mono); }
|
|
211
|
+
.agent-tool-list span { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden;
|
|
212
|
+
color: var(--muted-foreground); font-size: 12.5px; line-height: 1.45; }
|
|
213
|
+
.agent-tool-list span:empty { display: none; }
|
|
214
|
+
.agent-tools-read { display: grid; justify-items: start; gap: 8px; }
|
|
215
|
+
.agent-tools-read > .copilotz-button { min-height: 0; padding: 0; }
|
|
216
|
+
.agent-edit { display: grid; gap: 14px; }
|
|
217
|
+
.agent-edit-card { padding: 20px; }
|
|
218
|
+
.agent-edit-end { position: sticky; bottom: 0; z-index: 2; display: flex; align-items: center; gap: 10px;
|
|
219
|
+
margin: 0 -24px -64px; padding: 14px 24px 18px; border-top: 1px solid var(--border);
|
|
220
|
+
background: color-mix(in oklab, var(--background) 92%, transparent); backdrop-filter: blur(8px); }
|
|
221
|
+
.agent-edit-end .agent-form-note { flex: 1; min-width: 0; }
|
|
222
|
+
.agent-delete-means { display: grid; gap: 10px; margin: 0 0 4px; padding: 0 0 0 18px; color: var(--secondary-foreground);
|
|
223
|
+
font-size: 14px; line-height: 1.5; }
|
|
224
|
+
.agent-delete-means b { color: var(--foreground); font-weight: 620; }
|
|
225
|
+
.agent-delete-means + .copilotz-notice { margin-top: 14px; }
|
|
226
|
+
.agent-missing { display: grid; place-items: center; height: 100%; padding: 32px; }
|
|
227
|
+
@container copilotz-page (max-width: 560px) {
|
|
228
|
+
.agent-edit-card { padding: 16px; }
|
|
229
|
+
.agent-edit-end { flex-wrap: wrap; margin: 0 -16px -48px; padding: 12px 16px 14px; }
|
|
230
|
+
.agent-edit-end .agent-form-note { flex-basis: 100%; }
|
|
231
|
+
.agent-edit-end .copilotz-button { flex: 1; }
|
|
232
|
+
.agent-form-who { gap: 12px; }
|
|
233
|
+
.agent-form-who > .copilotz-avatar { --size: 44px !important; margin-top: 24px; }
|
|
234
|
+
.agent-face-empty { width: 44px; height: 44px; margin-top: 24px; }
|
|
235
|
+
}
|
|
236
|
+
@container agent-add (max-width: 420px) {
|
|
237
|
+
.agent-form-who { gap: 12px; }
|
|
238
|
+
.agent-form-who > .copilotz-avatar { --size: 44px !important; margin-top: 24px; }
|
|
239
|
+
.agent-face-empty { width: 44px; height: 44px; margin-top: 24px; }
|
|
240
|
+
.agent-new-top { flex-wrap: wrap; }
|
|
241
|
+
.agent-new-end { flex-wrap: wrap; }
|
|
242
|
+
.agent-new-end .agent-form-note { flex-basis: 100%; }
|
|
243
|
+
.agent-new-end .agent-form-note:empty { display: none; }
|
|
244
|
+
.agent-new-end .copilotz-button { flex: 1; }
|
|
245
|
+
}
|
|
246
|
+
`;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/** Every word Team's web front end shows, to be changed by the app (`team.<key>`). */
|
|
2
|
+
import { type Phrase } from "copilotz/web/words";
|
|
3
|
+
export declare const say: import("copilotz/web/words").Say<"instructions" | "model" | "effort" | "tools" | "replace" | "cancel" | "change" | "listJoin" | "listEnd" | "personalSpace" | "noSuchAgentTitle" | "noSuchAgent" | "noSuchAgentBody" | "goHome" | "partOfApp" | "madeIn" | "madeElsewhere" | "answersNewChatsHere" | "askAgent" | "edit" | "editAgent" | "moreMenu" | "makeAnswerIn" | "addToSpaceMenu" | "startFromIt" | "deleteMenu" | "addToTitle" | "addToNote" | "newLikeTitle" | "newLikeNote" | "newAgentIn" | "startingFrom" | "appAgentNotice" | "startFromShort" | "managersChangeIt" | "managersChangeItElsewhere" | "worksIn" | "addToSpace" | "answersNewChats" | "roleViewer" | "roleEditor" | "worksNowhere" | "modelAndTools" | "thinks" | "toolsLabel" | "noTools" | "showFewer" | "showAll" | "modelsThenJoin" | "changeAgent" | "keepsHandle" | "saveChanges" | "deleteTitle" | "deleteButton" | "deleteLeavesBold" | "deleteLeavesNamed" | "deleteLeaves" | "deleteGoneBold" | "deleteGone" | "deleteChatsBold" | "deleteChats" | "findSpace" | "spacesYouManage" | "justYou" | "keywordPersonal" | "deleteStepNote" | "deleteStepKeep" | "fieldName" | "calledIn" | "nameHint" | "namePlaceholder" | "emoji" | "noEmoji" | "anotherEmoji" | "otherEmoji" | "fieldDoes" | "doesHint" | "doesPlaceholder" | "modelHint" | "rewriteForMe" | "writeForMe" | "sayNameFirst" | "youArePlaceholder" | "youAreDefaultName" | "writingFor" | "draftNote" | "undo" | "instructionsHint" | "instructionsEmptyHint" | "toolsOf" | "toolsChooseDone" | "toolsChoose" | "toolsAll" | "toolsNone" | "toolsMore" | "newAgentForm" | "agentsYouKnow" | "startFrom" | "startBlank" | "worksInAs" | "belongsHint" | "createNamed" | "createAgent" | "worksNow" | "askHandle" | "readsOnly" | "makeAnswer" | "openPage" | "makeAnother" | "notYourSpace" | "archivedSpace" | "managersAdd" | "addAnAgentTitle" | "addAnAgentNote" | "oneOfApps" | "madeInOther" | "findAgent" | "findAgentKnown" | "knownIntro" | "addsAs" | "createNewAgent" | "createNewAgentBody" | "addAgentTo" | "add" | "noneCalled" | "allWorkHere" | "worksNowNames" | "paletteThisAgent" | "paletteThisSpace" | "paletteAgents" | "paletteCreate" | "makeNamedAnswerIn" | "makeNamedAnswer" | "keywordDefault" | "keywordAnswer" | "keywordNewChats" | "addNamedTo" | "addNamedNote" | "keywordMember" | "keywordJoin" | "keywordWork" | "editNamed" | "keywordChange" | "keywordInstructions" | "keywordRename" | "startNewFrom" | "keywordCopy" | "keywordLike" | "keywordCreate" | "addAnAgentTo" | "keywordInvite" | "keywordAgent" | "worksHere" | "newAgent" | "newAgentInHere" | "keywordMake" | "newAgentInStep" | "newAgentInNote" | "chooseModel" | "needsKey" | "yourKey" | "providerModels" | "searchModels" | "readyToUse" | "withOwnKey" | "providers" | "models" | "nothingMatches" | "allProviders" | "noKeyForProvider" | "apiKeyLabel" | "pasteIt" | "save" | "keyNote" | "orgKey" | "usesAppKey" | "useOwnKey" | "remove" | "noCreditsUsed" | "priceLine" | "priceOwnKey" | "contextSize" | "mediaImage" | "mediaPdf" | "mediaAudio" | "mediaVideo" | "reasoning">;
|
|
4
|
+
/** Every word of team's front end, by area (WORDS.md lists them). */
|
|
5
|
+
export declare const PHRASES: Record<string, Record<string, Phrase>>;
|