@copilotz/team 1.0.0-rc.53 → 1.0.0-rc.55
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/WORDS.md +156 -0
- package/package.json +2 -2
- package/team/actions/agent.d.ts +10 -0
- package/team/actions/agent.js +226 -7
- package/team/actions/define.js +7 -3
- package/team/collections/agent.d.ts +52 -7
- package/team/collections/agent.js +56 -5
- package/team/mod.d.ts +7 -0
- package/team/mod.js +14 -1
- package/team/resources/propose.d.ts +1 -0
- package/team/resources/propose.js +97 -0
- package/team/shared/definition.d.ts +1 -1
- package/team/shared/definition.js +5 -4
- package/team/shared/everywhere.d.ts +11 -0
- package/team/shared/everywhere.js +29 -0
- package/team/views/web/agent-add.js +14 -4
- package/team/views/web/agent-describe.d.ts +38 -0
- package/team/views/web/agent-describe.js +44 -0
- package/team/views/web/agent-fields.d.ts +3 -1
- package/team/views/web/agent-fields.js +2 -2
- package/team/views/web/agent-known.js +2 -1
- package/team/views/web/agent-new.d.ts +4 -1
- package/team/views/web/agent-new.js +26 -5
- package/team/views/web/agent-org.d.ts +12 -0
- package/team/views/web/agent-org.js +89 -0
- package/team/views/web/agent.d.ts +7 -4
- package/team/views/web/agent.js +81 -28
- package/team/views/web/model-pick.d.ts +3 -1
- package/team/views/web/model-pick.js +4 -1
- package/team/views/web/style.d.ts +1 -1
- package/team/views/web/style.js +5 -0
- package/team/views/web/words.d.ts +1 -1
- package/team/views/web/words.js +28 -0
- package/team/web.js +2 -0
- package/tiers/actions/choose.d.ts +5 -1
- package/tiers/actions/choose.js +247 -66
- package/tiers/actions/model.js +31 -22
- package/tiers/collections/choice.d.ts +17 -10
- package/tiers/collections/choice.js +39 -27
- package/tiers/collections/template.d.ts +90 -0
- package/tiers/collections/template.js +41 -0
- package/tiers/contract.d.ts +10 -8
- package/tiers/mod.d.ts +30 -21
- package/tiers/mod.js +45 -36
- package/tiers/shared/shown.d.ts +131 -49
- package/tiers/shared/shown.js +192 -98
- package/tiers/shared/tiers.d.ts +105 -62
- package/tiers/shared/tiers.js +127 -86
- package/tiers/views/web/composer.d.ts +12 -0
- package/tiers/views/web/composer.js +79 -0
- package/tiers/views/web/org.d.ts +44 -21
- package/tiers/views/web/org.js +231 -84
- package/tiers/views/web/say.d.ts +138 -0
- package/tiers/views/web/say.js +142 -0
- package/tiers/views/web/setup.d.ts +23 -0
- package/tiers/views/web/setup.js +80 -0
- package/tiers/views/web/space.d.ts +8 -20
- package/tiers/views/web/space.js +30 -59
- package/tiers/views/web/style.d.ts +1 -1
- package/tiers/views/web/style.js +98 -4
- package/tiers/views/web/team.d.ts +38 -0
- package/tiers/views/web/team.js +118 -0
- package/tiers/views/web/words.d.ts +36 -16
- package/tiers/views/web/words.js +102 -35
- package/tiers/web.d.ts +18 -9
- package/tiers/web.js +36 -10
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
/** Every word tiers' web front end shows, to be changed by the app (`tiers.<key>`). */
|
|
2
|
+
import { defineWords } from "copilotz/web/words";
|
|
3
|
+
export const tiers = {
|
|
4
|
+
// What prices are for, and how far credits go
|
|
5
|
+
perMessage: "a message",
|
|
6
|
+
perReply: "a reply",
|
|
7
|
+
messages: { one: "{count} message", other: "{count} messages" },
|
|
8
|
+
replies: { one: "{count} reply", other: "{count} replies" },
|
|
9
|
+
creditsOnce: "about {things} with {plan}'s {amount}",
|
|
10
|
+
creditsSeat: "about {things} a month for each seat on {plan}",
|
|
11
|
+
creditsMonth: "about {things} a month with {plan}'s {amount}",
|
|
12
|
+
underTenth: "under 0.1¢",
|
|
13
|
+
// How hard a model thinks
|
|
14
|
+
effortNone: "no reasoning",
|
|
15
|
+
effortMinimal: "minimal effort",
|
|
16
|
+
effortLow: "low effort",
|
|
17
|
+
effortMedium: "medium effort",
|
|
18
|
+
effortHigh: "high effort",
|
|
19
|
+
effortXhigh: "extra-high effort",
|
|
20
|
+
effortMax: "max effort",
|
|
21
|
+
effortOther: "{effort} effort",
|
|
22
|
+
providerChatgpt: "your ChatGPT plan",
|
|
23
|
+
// Who chose the tier in force
|
|
24
|
+
byThread: "chosen for this chat",
|
|
25
|
+
byPerson: "your default",
|
|
26
|
+
bySpace: "this space's default",
|
|
27
|
+
byOrg: "the org's default",
|
|
28
|
+
byPlan: "your plan's default",
|
|
29
|
+
// The org's page: its tiers
|
|
30
|
+
emptyTitle: "No tiers to choose from",
|
|
31
|
+
emptyBody: "This app's agents each think with the model it gives them.",
|
|
32
|
+
nowOrg: "New chats use {tier}, your org's default.",
|
|
33
|
+
nowPlan: "New chats use {tier}, your plan's default.",
|
|
34
|
+
nowMore: "Anyone can switch a chat's tier as they write, and spaces can set their own.",
|
|
35
|
+
backToPlan: "Back to your plan's default",
|
|
36
|
+
doneSaid: "New chats use {tier} from now on.",
|
|
37
|
+
undo: "Undo",
|
|
38
|
+
onlyRunners: "Only {org}'s owners and admins change these. You can switch a chat's tier as you write.",
|
|
39
|
+
onlyRunnersHere: "Only the org's owners and admins change these. You can switch a chat's tier as you write.",
|
|
40
|
+
tiersLabel: "Tiers",
|
|
41
|
+
newTier: "New tier",
|
|
42
|
+
newTierAbout: "Mix models your way: one for deciding, another for checking.",
|
|
43
|
+
takenAway: "Taken away:",
|
|
44
|
+
addBackTier: "Add back {tier}",
|
|
45
|
+
capLabel: "Members can choose up to",
|
|
46
|
+
capAny: "Any tier",
|
|
47
|
+
capNote: "Owners and admins can always use any of them.",
|
|
48
|
+
noCredits: "{plan} gives this org no credits.",
|
|
49
|
+
noCreditsMore: "Choose a plan or add credits for your agents to start working.",
|
|
50
|
+
billing: "Billing",
|
|
51
|
+
faster: "{tier} uses your credits about {times} faster than {cheapest}.",
|
|
52
|
+
fasterGoes: "That's {goes}.",
|
|
53
|
+
changeAnyTime: "You can change it any time.",
|
|
54
|
+
footMessage: "A typical message here, measured from how people use these agents: the one who answers often calls its model a few times, and others join some messages.",
|
|
55
|
+
footReply: "A typical reply here: about 20,000 tokens read, most of them from the cache, and 1,000 written.",
|
|
56
|
+
footPrices: "At your org's prices; real ones vary. What agents spend stays within your {budget}.",
|
|
57
|
+
budget: "budget",
|
|
58
|
+
// A tier's card
|
|
59
|
+
tierMore: "{tier}: more",
|
|
60
|
+
customize: "Customize…",
|
|
61
|
+
duplicate: "Duplicate…",
|
|
62
|
+
copyOf: "{tier} copy",
|
|
63
|
+
backToOriginal: "Back to the original",
|
|
64
|
+
deleteTier: "Delete",
|
|
65
|
+
takeAway: "Take away",
|
|
66
|
+
badgeDefault: "Default",
|
|
67
|
+
badgePlan: "Plan's",
|
|
68
|
+
badgeYours: "Yours",
|
|
69
|
+
badgeChanged: "Changed",
|
|
70
|
+
pricedEach: "Priced as each model is",
|
|
71
|
+
tierModels: "{tier}'s models",
|
|
72
|
+
then: "then {names}",
|
|
73
|
+
defaultForNew: "Default for new chats",
|
|
74
|
+
makeDefault: "Make it the default",
|
|
75
|
+
// Customizing a tier, or making one
|
|
76
|
+
newTierTitle: "A new tier",
|
|
77
|
+
customizeTitle: "Customize {tier}",
|
|
78
|
+
newTierStarts: "It starts as {tier}: change the model for any kind of work.",
|
|
79
|
+
customizeAbout: "Each kind of work's model, and what it falls back to when that one fails. Changes apply from each chat's next reply.",
|
|
80
|
+
cancel: "Cancel",
|
|
81
|
+
createTier: "Create tier",
|
|
82
|
+
save: "Save",
|
|
83
|
+
name: "Name",
|
|
84
|
+
namePlaceholder: "Balanced",
|
|
85
|
+
forLabel: "What it's for",
|
|
86
|
+
forPlaceholder: "Strong judgment, quick checks.",
|
|
87
|
+
nobodyYet: "No agent does this yet",
|
|
88
|
+
newKind: "A new kind of work",
|
|
89
|
+
newKindPlaceholder: "Numbers",
|
|
90
|
+
startsFrom: "Starts from",
|
|
91
|
+
add: "Add",
|
|
92
|
+
addKind: "Add a kind of work",
|
|
93
|
+
fallbacks: "If it fails, then",
|
|
94
|
+
moveUp: "Move up",
|
|
95
|
+
moveDown: "Move down",
|
|
96
|
+
remove: "Remove",
|
|
97
|
+
noFallback: "Nothing: if it fails, the reply fails.",
|
|
98
|
+
addFallback: "Add a fallback",
|
|
99
|
+
// The team
|
|
100
|
+
teamTitle: "Your team",
|
|
101
|
+
teamAbout: "Every space in {org} starts with these agents. Each does a kind of work, and the tier gives it its model.",
|
|
102
|
+
teamAboutMine: "Every space of yours starts with these agents. Each does a kind of work, and the tier gives it its model.",
|
|
103
|
+
addAgent: "Add an agent",
|
|
104
|
+
edit: "Edit",
|
|
105
|
+
removeFromTeam: "Remove from the team",
|
|
106
|
+
badgeOrgs: "Your org's",
|
|
107
|
+
onTier: "{model} on {tier}",
|
|
108
|
+
notOnTeam: "Not on your team",
|
|
109
|
+
addBack: "Add back",
|
|
110
|
+
addAgentTitle: "Add an agent to the team",
|
|
111
|
+
addAgentAbout: "It works in every space in {org}, and every new one.",
|
|
112
|
+
addAgentAboutMine: "It works in every space of yours, and every new one.",
|
|
113
|
+
removeTitle: "Remove {name} from the team?",
|
|
114
|
+
removeSaid: "{name} leaves every space in {org} and won't join new ones. What it already said stays in its chats.",
|
|
115
|
+
removeSaidMine: "{name} leaves every space of yours and won't join new ones. What it already said stays in its chats.",
|
|
116
|
+
removeDeletes: "This deletes it.",
|
|
117
|
+
removeBack: "You can add it back from this page.",
|
|
118
|
+
// A new org's choice
|
|
119
|
+
recommended: "Recommended",
|
|
120
|
+
ownersChoose: "Your org's owners and admins choose this.",
|
|
121
|
+
// A space
|
|
122
|
+
spaceStartsOn: "New chats here start on {tier}",
|
|
123
|
+
spaceChosen: "Chosen for this space. The org's default is {tier}.",
|
|
124
|
+
spaceAsOrg: "As the org's default.",
|
|
125
|
+
spaceSwitch: "Anyone can switch a chat's tier as they write.",
|
|
126
|
+
spaceManagers: "This space's managers can change its default.",
|
|
127
|
+
spaceSelect: "This space's default tier",
|
|
128
|
+
asOrg: "As the org: {tier}",
|
|
129
|
+
agentLine: "{model} · {kind} · on {tier}",
|
|
130
|
+
// Beside the send button
|
|
131
|
+
pickLabel: "Tier: {tier}, {by}",
|
|
132
|
+
pickCap: "Members can use up to {cap}.",
|
|
133
|
+
backToDefault: "Back to the default",
|
|
134
|
+
backToOrgDefault: "Back to the org's default",
|
|
135
|
+
chatRunsOn: "This chat runs on {tier} from its next reply.",
|
|
136
|
+
chatRunsDefault: "This chat runs on its default.",
|
|
137
|
+
newChatsOn: "Your new chats start on {tier}.",
|
|
138
|
+
newChatsDefault: "Your new chats start on the default.",
|
|
139
|
+
};
|
|
140
|
+
export const say = defineWords("tiers", tiers);
|
|
141
|
+
/** Every word of tiers' front end, by area (team's WORDS.md lists them). */
|
|
142
|
+
export const PHRASES = { tiers };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Choosing the org's tier when it's new (kind `tiers.setup`): a step of a
|
|
3
|
+
* welcome, or anywhere a page wants the choice short. The tiers as one choice,
|
|
4
|
+
* each its name, what it's good for, what a typical message comes to at this
|
|
5
|
+
* org's prices, how far the plan's credits go at that, and a meter of how
|
|
6
|
+
* much it spends next to the others; the plan's own marked Recommended. A
|
|
7
|
+
* click chooses it for the org at once (`tiers.choose`, as the org's page
|
|
8
|
+
* does: the plan's own goes back to following the plan), and on a plan of
|
|
9
|
+
* credits given once, a heavier tier says how much faster it spends them. A
|
|
10
|
+
* link goes on to the org's page, to pick a model per agent. Owners and
|
|
11
|
+
* admins choose; anyone else reads it, and is told who can.
|
|
12
|
+
*/
|
|
13
|
+
import { type ReactNode } from "react";
|
|
14
|
+
import type { ViewContext } from "copilotz";
|
|
15
|
+
import type { Shown } from "../../contract.js";
|
|
16
|
+
type Call = <R = unknown>(action: string, input?: unknown) => Promise<R>;
|
|
17
|
+
export declare const tiersSetupView: (_: unknown, ctx: ViewContext<ReactNode>) => ReactNode;
|
|
18
|
+
export declare function SetupTiers({ shown, may: given, call }: {
|
|
19
|
+
shown: Shown;
|
|
20
|
+
may?: boolean;
|
|
21
|
+
call: Call;
|
|
22
|
+
}): ReactNode;
|
|
23
|
+
export {};
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
/**
|
|
3
|
+
* Choosing the org's tier when it's new (kind `tiers.setup`): a step of a
|
|
4
|
+
* welcome, or anywhere a page wants the choice short. The tiers as one choice,
|
|
5
|
+
* each its name, what it's good for, what a typical message comes to at this
|
|
6
|
+
* org's prices, how far the plan's credits go at that, and a meter of how
|
|
7
|
+
* much it spends next to the others; the plan's own marked Recommended. A
|
|
8
|
+
* click chooses it for the org at once (`tiers.choose`, as the org's page
|
|
9
|
+
* does: the plan's own goes back to following the plan), and on a plan of
|
|
10
|
+
* credits given once, a heavier tier says how much faster it spends them. A
|
|
11
|
+
* link goes on to the org's page, to pick a model per agent. Owners and
|
|
12
|
+
* admins choose; anyone else reads it, and is told who can.
|
|
13
|
+
*/
|
|
14
|
+
import { useState } from "react";
|
|
15
|
+
import { Badge, Icon, message, Notice, Skeleton, Spinner } from "copilotz/web";
|
|
16
|
+
import { runs, useStanding } from "copilotz/plugins/interfaces/contract";
|
|
17
|
+
import { SpendNote } from "./org.js";
|
|
18
|
+
import { STYLE } from "./style.js";
|
|
19
|
+
import { say } from "./say.js";
|
|
20
|
+
import { creditsGo, perReply, shownSaid, unitSaid } from "./words.js";
|
|
21
|
+
export const tiersSetupView = (_, ctx) => {
|
|
22
|
+
const shown = shownSaid(ctx.db.collection("modelChoice").query("offered", {}).value);
|
|
23
|
+
// Given the person's role where it's shown (the org's page), else asked (a welcome's step).
|
|
24
|
+
const given = "role" in ctx.hints
|
|
25
|
+
? runs({
|
|
26
|
+
role: ctx.hints.role ?? null,
|
|
27
|
+
staff: ctx.hints.staff === true,
|
|
28
|
+
})
|
|
29
|
+
: undefined;
|
|
30
|
+
return (_jsxs(_Fragment, { children: [_jsx("style", { href: "tiers-web", precedence: "copilotz", children: STYLE }), shown
|
|
31
|
+
? _jsx(SetupTiers, { shown: shown, may: given, call: ctx.call })
|
|
32
|
+
: (_jsx("div", { className: "tiers-setup", "aria-busy": "true", children: [0, 1, 2, 3].map((n) => _jsx(Skeleton, { height: 74, radius: "lg" }, n)) }))] }));
|
|
33
|
+
};
|
|
34
|
+
export function SetupTiers({ shown, may: given, call }) {
|
|
35
|
+
const standing = useStanding(call, given === undefined);
|
|
36
|
+
const may = given ?? (standing ? runs(standing) : false);
|
|
37
|
+
const [busy, setBusy] = useState();
|
|
38
|
+
const [error, setError] = useState();
|
|
39
|
+
// The org's default: what new chats start on.
|
|
40
|
+
const now = shown.org.tier ?? shown.plan ?? shown.tiers[0]?.name;
|
|
41
|
+
const top = Math.max(...shown.tiers.map((t) => t.price ?? 0));
|
|
42
|
+
const choose = async (tier) => {
|
|
43
|
+
if (!may || busy || tier.name === now)
|
|
44
|
+
return;
|
|
45
|
+
setBusy(tier.name);
|
|
46
|
+
setError(undefined);
|
|
47
|
+
try {
|
|
48
|
+
// The plan's own: back to following the plan, so a new plan moves it.
|
|
49
|
+
await call("tiers.choose", { tier: tier.name === shown.plan ? null : tier.name });
|
|
50
|
+
}
|
|
51
|
+
catch (e) {
|
|
52
|
+
setError(message(e));
|
|
53
|
+
}
|
|
54
|
+
finally {
|
|
55
|
+
setBusy(undefined);
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
return (_jsxs("div", { className: "tiers-setup", children: [_jsx("div", { className: "tiers-options", role: "radiogroup", "aria-label": say("tiersLabel"), children: shown.tiers.map((tier) => {
|
|
59
|
+
const price = perReply(tier.price);
|
|
60
|
+
const goes = creditsGo(shown.credits, tier.price, shown.per);
|
|
61
|
+
const checked = tier.name === now;
|
|
62
|
+
// How much it spends next to the others: a quarter of the bar at least, the dearest full.
|
|
63
|
+
const share = tier.price && top ? Math.max(tier.price / top, 0.04) : 0;
|
|
64
|
+
return (_jsxs("button", { type: "button", role: "radio", "aria-checked": checked, "aria-disabled": !may || undefined, "aria-busy": busy === tier.name || undefined, className: "tiers-option", "data-checked": checked || undefined, onClick: () => void choose(tier), children: [_jsx("span", { className: "tiers-option-mark", "aria-hidden": "true", children: busy === tier.name
|
|
65
|
+
? _jsx(Spinner, { size: 14 })
|
|
66
|
+
: checked
|
|
67
|
+
? _jsx(Icon, { name: "check", size: 13 })
|
|
68
|
+
: null }), _jsxs("span", { className: "tiers-option-text", children: [_jsxs("span", { className: "tiers-option-name", children: [tier.title, tier.name === shown.plan
|
|
69
|
+
? _jsx(Badge, { tone: "primary", children: say("recommended") })
|
|
70
|
+
: null] }), tier.description
|
|
71
|
+
? _jsx("span", { className: "tiers-option-for", children: tier.description })
|
|
72
|
+
: null, goes ? _jsx("span", { className: "tiers-option-goes", children: goes }) : null] }), _jsxs("span", { className: "tiers-option-price", children: [price
|
|
73
|
+
? (_jsxs(_Fragment, { children: [_jsx("b", { children: price }), _jsx("small", { children: unitSaid(shown.per) })] }))
|
|
74
|
+
: _jsx("small", { children: say("pricedEach") }), share
|
|
75
|
+
? (_jsx("span", { className: "tiers-option-meter", "aria-hidden": "true", children: _jsx("span", { style: { inlineSize: `${Math.round(share * 100)}%` } }) }))
|
|
76
|
+
: null] })] }, tier.name));
|
|
77
|
+
}) }), error ? _jsx(Notice, { tone: "destructive", role: "alert", children: error }) : null, may || (given === undefined && !standing)
|
|
78
|
+
? _jsx(SpendNote, { shown: shown, tier: now })
|
|
79
|
+
: (_jsx(Notice, { tone: "neutral", icon: "lock", children: say("ownersChoose") }))] }));
|
|
80
|
+
}
|
|
@@ -2,25 +2,23 @@
|
|
|
2
2
|
* A space's agents' models, on its Members tab (spaces' `spaceAgents`).
|
|
3
3
|
*
|
|
4
4
|
* - Above its agents (kind `tiers.space`, item `{ _id }`, the space): the
|
|
5
|
-
* tier
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* - On each
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
* model is chosen with, team's `model.pick`) and, once picked, the way back
|
|
12
|
-
* to what it had. Agents people make say nothing here: their model is theirs.
|
|
5
|
+
* tier new chats here start on, and for its managers a choice of every
|
|
6
|
+
* tier, each with what a typical message comes to, or the org's default
|
|
7
|
+
* again. Anyone still switches a chat's own as they write.
|
|
8
|
+
* - On each agent (kind `tiers.agent`, item `{ _id }`, the agent): its model
|
|
9
|
+
* here, its kind of work and the tier ("Claude Haiku 5.5 · Checks · on
|
|
10
|
+
* Everyday"). Models are the tiers', by kind of work: none is picked here.
|
|
13
11
|
*
|
|
14
12
|
* Both are watched reads, so a change shows at once, wherever it was made.
|
|
15
13
|
*/
|
|
16
14
|
import { type ReactNode } from "react";
|
|
17
15
|
import type { ViewContext } from "copilotz";
|
|
18
|
-
import type {
|
|
16
|
+
import type { Shown } from "../../contract.js";
|
|
19
17
|
type Call = <R = unknown>(action: string, input?: unknown) => Promise<R>;
|
|
20
18
|
export declare const tiersSpaceView: (item: {
|
|
21
19
|
_id?: string;
|
|
22
20
|
}, ctx: ViewContext<ReactNode>) => ReactNode;
|
|
23
|
-
/** The space's tier: what
|
|
21
|
+
/** The space's tier: what new chats here start on, who chose it, and choosing another. */
|
|
24
22
|
export declare function SpaceTier({ shown, space, manage, call }: {
|
|
25
23
|
shown: Shown;
|
|
26
24
|
space: string;
|
|
@@ -30,14 +28,4 @@ export declare function SpaceTier({ shown, space, manage, call }: {
|
|
|
30
28
|
export declare const tiersAgentView: (item: {
|
|
31
29
|
_id?: string;
|
|
32
30
|
}, ctx: ViewContext<ReactNode>) => ReactNode;
|
|
33
|
-
/** What an agent thinks with here, where that comes from, and changing it. */
|
|
34
|
-
export declare function AgentLine({ now, agent, space, manage, call }: {
|
|
35
|
-
now: AgentNow & {
|
|
36
|
-
without?: AgentNow;
|
|
37
|
-
};
|
|
38
|
-
agent: string;
|
|
39
|
-
space: string;
|
|
40
|
-
manage: boolean;
|
|
41
|
-
call: Call;
|
|
42
|
-
}): ReactNode;
|
|
43
31
|
export {};
|
package/tiers/views/web/space.js
CHANGED
|
@@ -3,43 +3,39 @@ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-run
|
|
|
3
3
|
* A space's agents' models, on its Members tab (spaces' `spaceAgents`).
|
|
4
4
|
*
|
|
5
5
|
* - Above its agents (kind `tiers.space`, item `{ _id }`, the space): the
|
|
6
|
-
* tier
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
* - On each
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
* model is chosen with, team's `model.pick`) and, once picked, the way back
|
|
13
|
-
* to what it had. Agents people make say nothing here: their model is theirs.
|
|
6
|
+
* tier new chats here start on, and for its managers a choice of every
|
|
7
|
+
* tier, each with what a typical message comes to, or the org's default
|
|
8
|
+
* again. Anyone still switches a chat's own as they write.
|
|
9
|
+
* - On each agent (kind `tiers.agent`, item `{ _id }`, the agent): its model
|
|
10
|
+
* here, its kind of work and the tier ("Claude Haiku 5.5 · Checks · on
|
|
11
|
+
* Everyday"). Models are the tiers', by kind of work: none is picked here.
|
|
14
12
|
*
|
|
15
13
|
* Both are watched reads, so a change shows at once, wherever it was made.
|
|
16
14
|
*/
|
|
17
15
|
import { useState } from "react";
|
|
18
|
-
import {
|
|
16
|
+
import { Icon, message, Select } from "copilotz/web";
|
|
19
17
|
import { STYLE } from "./style.js";
|
|
20
|
-
import {
|
|
18
|
+
import { say } from "./say.js";
|
|
19
|
+
import { sayText } from "copilotz/web/words";
|
|
20
|
+
import { bySaid, modelSaid, perReply, shownSaid, unitSaid } from "./words.js";
|
|
21
21
|
const style = _jsx("style", { href: "tiers-web", precedence: "copilotz", children: STYLE });
|
|
22
22
|
export const tiersSpaceView = (item, ctx) => {
|
|
23
23
|
const space = item._id ?? String(ctx.hints.in ?? "");
|
|
24
|
-
const shown = ctx.db.collection("modelChoice").query("offered", { space }).value;
|
|
24
|
+
const shown = shownSaid(ctx.db.collection("modelChoice").query("offered", { space }).value);
|
|
25
25
|
if (!shown?.tiers.length)
|
|
26
26
|
return null;
|
|
27
27
|
return (_jsxs(_Fragment, { children: [style, _jsx(SpaceTier, { shown: shown, space: space, manage: ctx.hints.manage === true, call: ctx.call })] }));
|
|
28
28
|
};
|
|
29
|
-
/** The space's tier: what
|
|
29
|
+
/** The space's tier: what new chats here start on, who chose it, and choosing another. */
|
|
30
30
|
export function SpaceTier({ shown, space, manage, call }) {
|
|
31
31
|
const [busy, setBusy] = useState(false);
|
|
32
32
|
const [error, setError] = useState();
|
|
33
33
|
const title = (name) => shown.tiers.find((t) => t.name === name)?.title;
|
|
34
|
-
const
|
|
35
|
-
const
|
|
36
|
-
const said =
|
|
37
|
-
?
|
|
38
|
-
|
|
39
|
-
: now.by === "org"
|
|
40
|
-
? "As the org chose."
|
|
41
|
-
: "Your plan's default, as the org hasn't chosen."
|
|
42
|
-
: "Each agent uses its own.";
|
|
34
|
+
const above = shown.org.tier ?? shown.plan ?? shown.tiers[0]?.name;
|
|
35
|
+
const here = shown.space?.tier ?? above;
|
|
36
|
+
const said = shown.space?.tier
|
|
37
|
+
? say("spaceChosen", { tier: title(above) ?? "" })
|
|
38
|
+
: say("spaceAsOrg");
|
|
43
39
|
const choose = async (tier) => {
|
|
44
40
|
setBusy(true);
|
|
45
41
|
setError(undefined);
|
|
@@ -53,51 +49,26 @@ export function SpaceTier({ shown, space, manage, call }) {
|
|
|
53
49
|
setBusy(false);
|
|
54
50
|
}
|
|
55
51
|
};
|
|
56
|
-
return (_jsxs("div", { className: "tiers-space", "aria-busy": busy || undefined, children: [_jsx("span", { className: "tiers-space-mark", "aria-hidden": "true", children: _jsx(Icon, { name: "sparkles", size: 16 }) }), _jsxs("div", { className: "tiers-space-text", children: [
|
|
57
|
-
|
|
58
|
-
: "This space's managers can change it."] })] }), manage
|
|
59
|
-
? (_jsxs(Select, { size: "sm", "aria-label": "This space's models", value: shown.space?.tier ?? "", disabled: busy, onChange: (event) => void choose(event.target.value), children: [_jsx("option", { value: "", children: above ? `As the org: ${title(above)}` : "As the org: the agents' own" }), shown.tiers.map((tier) => {
|
|
52
|
+
return (_jsxs("div", { className: "tiers-space", "aria-busy": busy || undefined, children: [_jsx("span", { className: "tiers-space-mark", "aria-hidden": "true", children: _jsx(Icon, { name: "sparkles", size: 16 }) }), _jsxs("div", { className: "tiers-space-text", children: [_jsx("b", { children: say("spaceStartsOn", { tier: title(here) ?? "" }) }), _jsxs("span", { children: [said, " ", say("spaceSwitch"), " ", manage ? "" : say("spaceManagers")] })] }), manage
|
|
53
|
+
? (_jsxs(Select, { size: "sm", "aria-label": say("spaceSelect"), value: shown.space?.tier ?? "", disabled: busy, onChange: (event) => void choose(event.target.value), children: [_jsx("option", { value: "", children: say("asOrg", { tier: title(above) ?? "" }) }), shown.tiers.map((tier) => {
|
|
60
54
|
const price = perReply(tier.price);
|
|
61
|
-
return (_jsxs("option", { value: tier.name, children: [tier.title, price ? ` · ${price}
|
|
55
|
+
return (_jsxs("option", { value: tier.name, children: [tier.title, price ? ` · ${price} ${unitSaid(shown.per)}` : ""] }, tier.name));
|
|
62
56
|
})] }))
|
|
63
57
|
: null, error ? _jsx("p", { className: "tiers-space-error", role: "alert", children: error }) : null] }));
|
|
64
58
|
}
|
|
65
59
|
export const tiersAgentView = (item, ctx) => {
|
|
66
60
|
const agent = item._id ?? "";
|
|
67
61
|
const space = String(ctx.hints.in ?? "");
|
|
68
|
-
const now = ctx.db.collection("modelChoice").query("agent", {
|
|
69
|
-
|
|
62
|
+
const now = ctx.db.collection("modelChoice").query("agent", {
|
|
63
|
+
agent,
|
|
64
|
+
...(space ? { space } : {}),
|
|
65
|
+
}).value;
|
|
66
|
+
// No tier applies (or still reading): nothing to say.
|
|
70
67
|
if (!now)
|
|
71
68
|
return null;
|
|
72
|
-
return (_jsxs(_Fragment, { children: [style, _jsx(
|
|
69
|
+
return (_jsxs(_Fragment, { children: [style, _jsx("span", { className: "tiers-line", title: `${modelSaid(now.model)}, ${bySaid(now.by)}`, children: say.nodes("agentLine", {
|
|
70
|
+
model: _jsx("b", { children: now.model.name }),
|
|
71
|
+
kind: sayText(now.kindTitle),
|
|
72
|
+
tier: sayText(now.tierTitle),
|
|
73
|
+
}) })] }));
|
|
73
74
|
};
|
|
74
|
-
/** What an agent thinks with here, where that comes from, and changing it. */
|
|
75
|
-
export function AgentLine({ now, agent, space, manage, call }) {
|
|
76
|
-
const [busy, setBusy] = useState(false);
|
|
77
|
-
const [error, setError] = useState();
|
|
78
|
-
const effort = effortSaid(now.model.effort);
|
|
79
|
-
const pick = {
|
|
80
|
-
action: "tiers.pick",
|
|
81
|
-
input: { space, agent },
|
|
82
|
-
look: "link",
|
|
83
|
-
label: "Change",
|
|
84
|
-
};
|
|
85
|
-
const back = async () => {
|
|
86
|
-
setBusy(true);
|
|
87
|
-
setError(undefined);
|
|
88
|
-
try {
|
|
89
|
-
await call("tiers.pick", { space, agent, model: null });
|
|
90
|
-
}
|
|
91
|
-
catch (e) {
|
|
92
|
-
setError(message(e));
|
|
93
|
-
}
|
|
94
|
-
finally {
|
|
95
|
-
setBusy(false);
|
|
96
|
-
}
|
|
97
|
-
};
|
|
98
|
-
return (_jsxs(_Fragment, { children: [_jsxs("span", { className: "tiers-line", "data-picked": now.without ? true : undefined, title: effort ? `${now.model.name}, ${effort}` : undefined, children: [_jsx("b", { children: now.model.name }), " \u00B7 ", _jsx("span", { className: "tiers-line-from", children: spaceFromSaid(now.from) })] }), manage
|
|
99
|
-
? _jsx(LazyView, { kind: "model.pick", item: { value: now.model.id }, hints: pick, fallback: null })
|
|
100
|
-
: null, manage && now.without
|
|
101
|
-
? (_jsxs(Button, { variant: "link", size: "sm", className: "tiers-back", disabled: busy, onClick: () => void back(), title: `Back to ${now.without.model.name}, ${spaceFromSaid(now.without.from)}`, children: ["Back to ", now.without.model.name] }))
|
|
102
|
-
: null, error ? _jsx("span", { className: "tiers-line", role: "alert", children: error }) : null] }));
|
|
103
|
-
}
|
|
@@ -4,4 +4,4 @@
|
|
|
4
4
|
* agent's model in rows, the line a space's agents get, and the space's own
|
|
5
5
|
* choice above them. Only layout: the pieces are the toolkit's.
|
|
6
6
|
*/
|
|
7
|
-
export declare const STYLE = "\n.tiers { container: tiers / inline-size; display: grid; gap: 16px; min-width: 0; }\n.tiers-now { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 16px; }\n.tiers-now p { margin: 0; color: var(--secondary-foreground); font-size: 14.5px; line-height: 1.5; }\n.tiers-now b { color: var(--foreground); font-weight: 650; }\n.tiers-now .copilotz-button { flex: none; }\n\n/* The tiers, as cards */\n.tiers-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(214px, 1fr)); gap: 12px; margin: 0; padding: 0;\n list-style: none; }\n.tier-card { display: grid; grid-template-rows: auto auto auto 1fr auto; gap: 10px; min-width: 0; padding: 16px 16px 14px;\n transition: border-color .15s, outline-color .15s; }\n.tier-card[data-current] { border-color: var(--ring); outline: 1px solid var(--ring); outline-offset: -2px; }\n.tier-card-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 8px; min-height: 22px; }\n.tier-card h3 { margin: 0; font-family: var(--font-display); font-size: 18px; font-weight: 660; letter-spacing: -.012em; }\n.tier-card-top .copilotz-badge { gap: 4px; }\n.tier-card-for { margin: -4px 0 0; color: var(--secondary-foreground); font-size: 13.5px; line-height: 1.45; }\n.tier-card-price { display: flex; align-items: baseline; gap: 6px; margin: 0; color: var(--muted-foreground); font-size: 12.5px; }\n.tier-card-price b { color: var(--foreground); font-family: var(--font-display); font-size: 21px; font-weight: 660;\n letter-spacing: -.015em; font-variant-numeric: tabular-nums; }\n.tier-card-agents { display: grid; align-content: start; gap: 7px; margin: 0; padding: 10px 0 2px; border-top: 1px solid var(--border);\n list-style: none; }\n.tier-card-agents li { display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 8px; align-items: baseline; font-size: 13px;\n line-height: 1.35; }\n.tier-who { display: flex; align-items: baseline; gap: 5px; min-width: 0; overflow: hidden; color: var(--muted-foreground);\n white-space: nowrap; text-overflow: ellipsis; }\n.tier-model { display: grid; min-width: 0; color: var(--foreground); font-weight: 560; overflow-wrap: anywhere; }\n.tier-model small { color: var(--muted-foreground); font-size: 12px; font-weight: 450; }\n.tier-card-end { display: grid; margin-top: 2px; }\n.tier-card-using { display: flex; align-items: center; justify-content: center; gap: 6px; height: 36px; margin: 0;\n border-radius: var(--radius-md); background: var(--primary-soft); color: var(--primary-text); font-size: 13.5px; font-weight: 600; }\n\n/* Each agent's model */\n.tiers-agents { display: grid; gap: 2px; padding: 16px 18px 8px; }\n.tiers-agents-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 8px 12px; }\n.tiers-agents-head h3 { margin: 0; font-size: 15px; font-weight: 650; }\n.tiers-agents-head p { margin: 3px 0 0; color: var(--muted-foreground); font-size: 13px; line-height: 1.45; }\n.tiers-agents-actions { display: flex; flex-wrap: wrap; gap: 6px; }\n.tiers-rows { display: grid; margin: 6px 0 0; padding: 0; list-style: none; }\n.tiers-row { display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; align-items: center; gap: 4px 12px; padding: 11px 0; }\n.tiers-row + .tiers-row { border-top: 1px solid var(--border); }\n.tiers-row-text { display: grid; gap: 2px; min-width: 0; }\n.tiers-row-name { margin: 0; font-size: 14px; font-weight: 620; }\n.tiers-row-model { margin: 0; color: var(--secondary-foreground); font-size: 13px; line-height: 1.45; }\n.tiers-row-model b { color: var(--foreground); font-weight: 600; }\n.tiers-row-from[data-picked] { color: var(--primary-text); }\n.tiers-row-price { color: var(--muted-foreground); font-size: 12.5px; font-variant-numeric: tabular-nums; white-space: nowrap; }\n.tiers-row[data-editing] { grid-template-columns: 32px minmax(0, 1fr); align-items: start; }\n.tiers-row[data-editing] > .copilotz-avatar { margin-top: 2px; }\n.tiers-row-pick { display: grid; gap: 6px; min-width: 0; }\n.tiers-row-under { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; color: var(--muted-foreground); font-size: 12.5px; }\n.tiers-back { height: auto; padding: 0; font-size: 12.5px; }\n\n.tiers-foot { display: flex; align-items: flex-start; gap: 7px; margin: 0 2px; color: var(--muted-foreground); font-size: 12.5px; line-height: 1.5; }\n.tiers-foot .copilotz-icon { flex: none; margin-top: 2px; }\n.tiers-foot a { color: var(--primary-text); text-underline-offset: 3px; }\n\n/* A space's agents: its choice, and each one's line */\n.tiers-space { container: tiers-space / inline-size; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px;\n padding: 12px 12px 12px 14px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--card); }\n.tiers-space-mark { flex: none; display: grid; place-items: center; width: 32px; height: 32px; border-radius: var(--radius-md);\n background: var(--primary-soft); color: var(--primary-text); }\n.tiers-space-text { flex: 1 1 200px; display: grid; gap: 1px; min-width: 0; }\n.tiers-space-text b { font-size: 14px; font-weight: 620; }\n.tiers-space-text span { color: var(--muted-foreground); font-size: 12.5px; line-height: 1.45; }\n.tiers-space > .copilotz-select { flex: 1 1 210px; max-width: 280px; }\n.tiers-space-error { flex-basis: 100%; margin: 0; color: var(--destructive-text, var(--destructive)); font-size: 12.5px; }\n.tiers-line { min-width: 0; color: var(--muted-foreground); font-size: 12.5px; line-height: 1.45; }\n.tiers-line b { color: var(--secondary-foreground); font-weight: 600; }\n.tiers-line[data-picked] .tiers-line-from { color: var(--primary-text); }\n\n@container tiers-space (max-width: 480px) {\n .tiers-space > .copilotz-select { flex-basis: 100%; max-width: none; }\n}\n@container tiers (max-width: 520px) {\n .tiers-agents { padding: 14px 14px 6px; }\n .tiers-row { grid-template-columns: 32px minmax(0, 1fr); align-items: start; }\n .tiers-row > .copilotz-avatar { margin-top: 2px; }\n .tiers-row-price { grid-column: 2; }\n}\n";
|
|
7
|
+
export declare const STYLE = "\n.tiers { container: tiers / inline-size; display: grid; gap: 16px; min-width: 0; }\n.tiers-now { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 16px; }\n.tiers-now p { margin: 0; color: var(--secondary-foreground); font-size: 14.5px; line-height: 1.5; }\n.tiers-now b { color: var(--foreground); font-weight: 650; }\n.tiers-now .copilotz-button { flex: none; }\n\n/* The tiers, as cards */\n.tiers-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(214px, 1fr)); gap: 12px; margin: 0; padding: 0;\n list-style: none; }\n.tier-card { display: grid; grid-template-rows: auto auto auto auto 1fr auto; gap: 10px; min-width: 0; padding: 16px 16px 14px;\n transition: border-color .15s, outline-color .15s; }\n.tier-card[data-current] { border-color: var(--ring); outline: 1px solid var(--ring); outline-offset: -2px; }\n.tier-card-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 8px; min-height: 22px; }\n.tier-card h3 { margin: 0; font-family: var(--font-display); font-size: 18px; font-weight: 660; letter-spacing: -.012em; }\n.tier-card-top .copilotz-badge { gap: 4px; }\n.tier-card-for { margin: -4px 0 0; color: var(--secondary-foreground); font-size: 13.5px; line-height: 1.45; }\n.tier-card-price { display: flex; align-items: baseline; gap: 6px; margin: 0; color: var(--muted-foreground); font-size: 12.5px; }\n.tier-card-price b { color: var(--foreground); font-family: var(--font-display); font-size: 21px; font-weight: 660;\n letter-spacing: -.015em; font-variant-numeric: tabular-nums; }\n.tier-card-goes { margin: -6px 0 0; color: var(--muted-foreground); font-size: 12.5px; line-height: 1.4; }\n.tier-card-goes:empty { margin-top: -10px; }\n.tier-card-agents { display: grid; align-content: start; gap: 7px; margin: 0; padding: 10px 0 2px; border-top: 1px solid var(--border);\n list-style: none; }\n.tier-card-agents li { display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 8px; align-items: baseline; font-size: 13px;\n line-height: 1.35; }\n.tier-who { display: flex; align-items: baseline; gap: 5px; min-width: 0; overflow: hidden; color: var(--muted-foreground);\n white-space: nowrap; text-overflow: ellipsis; }\n.tier-model { display: grid; min-width: 0; color: var(--foreground); font-weight: 560; overflow-wrap: anywhere; }\n.tier-model small { color: var(--muted-foreground); font-size: 12px; font-weight: 450; }\n.tier-card-end { display: grid; margin-top: 2px; }\n.tier-card-using { display: flex; align-items: center; justify-content: center; gap: 6px; height: 36px; margin: 0;\n border-radius: var(--radius-md); background: var(--primary-soft); color: var(--primary-text); font-size: 13.5px; font-weight: 600; }\n\n.tier-card-badges { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }\n.tier-card-badges .copilotz-badge { gap: 4px; }\n.tier-model small { display: block; }\n.tier-new { display: grid; min-height: 160px; }\n.tier-new-button { display: grid; place-content: center; justify-items: center; gap: 6px; padding: 18px; border: 1.5px dashed var(--border);\n border-radius: var(--radius-xl); background: transparent; color: var(--muted-foreground); font: inherit; text-align: center;\n cursor: pointer; transition: border-color .12s, color .12s; }\n.tier-new-button:hover, .tier-new-button:focus-visible { border-color: var(--ring); color: var(--foreground); }\n.tier-new-button b { color: var(--foreground); font-size: 15px; font-weight: 650; }\n.tier-new-button span { max-width: 22ch; font-size: 12.5px; line-height: 1.45; }\n.tiers-removed { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin: -4px 0 0; color: var(--muted-foreground);\n font-size: 13px; }\n.tiers-cap { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; color: var(--secondary-foreground); font-size: 13.5px; }\n.tiers-cap > .copilotz-select { width: auto; min-width: 160px; }\n.tiers-cap span { color: var(--muted-foreground); font-size: 12.5px; }\n\n/* Customizing a tier */\n.tiers-editor { display: grid; gap: 16px; min-width: 0; }\n.tiers-editor-names { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 12px; }\n.tiers-editor-error { margin-inline-end: auto; align-self: center; color: var(--destructive-text, var(--destructive)); font-size: 13px; }\n.tiers-kinds { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; }\n.tiers-kind { display: grid; gap: 8px; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius-lg); }\n.tiers-kind-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }\n.tiers-kind-head b { font-size: 14.5px; font-weight: 650; }\n.tiers-kind-head span { color: var(--muted-foreground); font-size: 12.5px; }\n.tiers-chain { display: grid; gap: 6px; min-width: 0; }\n.tiers-kind-new { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 10px; padding: 12px 14px;\n border: 1px dashed var(--border); border-radius: var(--radius-lg); }\n.tiers-kind-new-end { grid-column: 1 / -1; display: flex; justify-content: flex-end; gap: 6px; }\n@container tiers (max-width: 520px) {\n .tiers-editor-names, .tiers-kind-new { grid-template-columns: minmax(0, 1fr); }\n}\n\n/* Beside the send button */\n.tiers-pick { display: inline-flex; }\n.tiers-pick .copilotz-button { color: var(--muted-foreground); font-weight: 550; }\n.tiers-remove-said { margin: 0; color: var(--secondary-foreground); font-size: 14px; line-height: 1.5; }\n.tiers-row-kind { display: inline-block; margin-right: 6px; padding: 0 6px; border-radius: var(--radius-full);\n background: var(--muted); color: var(--secondary-foreground); font-size: 11.5px; font-weight: 600; }\n\n/* Each agent's model */\n.tiers-agents { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2px; padding: 16px 18px 8px; }\n.tiers-agents-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 8px 12px; }\n.tiers-agents-head h3 { margin: 0; font-size: 15px; font-weight: 650; }\n.tiers-agents-head p { margin: 3px 0 0; color: var(--muted-foreground); font-size: 13px; line-height: 1.45; }\n.tiers-agents-actions { display: flex; flex-wrap: wrap; gap: 6px; }\n.tiers-rows { display: grid; margin: 6px 0 0; padding: 0; list-style: none; }\n.tiers-row { display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; align-items: center; gap: 4px 12px; padding: 11px 0; }\n.tiers-row + .tiers-row { border-top: 1px solid var(--border); }\n.tiers-row-text { display: grid; gap: 2px; min-width: 0; }\n.tiers-row-name { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 8px; margin: 0; font-size: 14px; font-weight: 620; }\n.tiers-row-handle { color: var(--muted-foreground); font-family: var(--font-mono); font-size: 12px; font-weight: 450; }\n.tiers-row-about { margin: 0; overflow: hidden; color: var(--muted-foreground); font-size: 13px; line-height: 1.45;\n text-overflow: ellipsis; white-space: nowrap; }\n.tiers-row-end { display: flex; align-items: center; gap: 6px; }\n.tiers-off { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; margin: 4px 0 8px; padding-top: 12px; border-top: 1px solid var(--border); }\n.tiers-off h4 { margin: 0; color: var(--muted-foreground); font-size: 12px; font-weight: 650; letter-spacing: .05em;\n text-transform: uppercase; }\n.tiers-off-row { display: flex; align-items: center; gap: 10px; min-width: 0; color: var(--secondary-foreground); font-size: 13.5px; }\n.tiers-off-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }\n.tiers-row-model { margin: 0; color: var(--secondary-foreground); font-size: 13px; line-height: 1.45; }\n.tiers-row-model b { color: var(--foreground); font-weight: 600; }\n.tiers-row-from[data-picked] { color: var(--primary-text); }\n.tiers-row-price { color: var(--muted-foreground); font-size: 12.5px; font-variant-numeric: tabular-nums; white-space: nowrap; }\n.tiers-row[data-editing] { grid-template-columns: 32px minmax(0, 1fr) auto; align-items: start; }\n.tiers-row[data-editing] > .copilotz-avatar { margin-top: 2px; }\n.tiers-row-pick { display: grid; gap: 6px; min-width: 0; }\n.tiers-row-under { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; color: var(--muted-foreground); font-size: 12.5px; }\n.tiers-back { height: auto; padding: 0; font-size: 12.5px; }\n.tiers-row-then { margin: 1px 0 0; color: var(--muted-foreground); font-size: 12.5px; line-height: 1.45; }\n.tiers-fallbacks { display: grid; gap: 4px; margin-top: 6px; padding: 8px 10px; border: 1px dashed var(--border);\n border-radius: var(--radius-md); }\n.tiers-fallbacks-head { margin: 0; color: var(--secondary-foreground); font-size: 12.5px; font-weight: 600; }\n.tiers-fallbacks-head span { color: var(--muted-foreground); font-weight: 450; }\n.tiers-fallbacks-list { display: grid; gap: 2px; margin: 0; padding: 0 0 0 18px; font-size: 13px; }\n.tiers-fallbacks-list li { padding-left: 2px; }\n.tiers-fallback-name { display: inline-flex; align-items: baseline; gap: 6px; min-width: 0; margin-right: 4px; }\n.tiers-fallback-name b { font-weight: 600; }\n.tiers-fallback-name small { color: var(--muted-foreground); font-size: 12px; }\n.tiers-fallbacks-none { margin: 0; color: var(--muted-foreground); font-size: 12.5px; }\n\n.tiers-foot { display: flex; align-items: flex-start; gap: 7px; margin: 0 2px; color: var(--muted-foreground); font-size: 12.5px; line-height: 1.5; }\n.tiers-foot .copilotz-icon { flex: none; margin-top: 2px; }\n.tiers-foot a { color: var(--primary-text); text-underline-offset: 3px; }\n\n/* Choosing a tier when the org is new: one choice, a row each */\n.tiers-setup { container: tiers-setup / inline-size; display: grid; gap: 12px; min-width: 0; }\n.tiers-options { display: grid; gap: 8px; }\n.tiers-option { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; align-items: start; gap: 12px; width: 100%;\n padding: 13px 14px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--card);\n color: inherit; font: inherit; text-align: left; cursor: pointer; transition: border-color .12s, background-color .12s; }\n.tiers-option:hover { border-color: var(--ring); }\n.tiers-option:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }\n.tiers-option[data-checked] { border-color: var(--ring); outline: 1px solid var(--ring); outline-offset: -2px;\n background: color-mix(in oklab, var(--primary-soft) 40%, var(--card)); }\n.tiers-option[aria-disabled] { cursor: default; }\n.tiers-option-mark { display: grid; place-items: center; width: 20px; height: 20px; margin-top: 1px; border: 1.5px solid var(--input);\n border-radius: var(--radius-full); color: var(--primary-foreground); }\n.tiers-option[data-checked] .tiers-option-mark { border-color: var(--primary); background: var(--primary); }\n.tiers-option[aria-busy] .tiers-option-mark { border-color: transparent; color: var(--primary-text); }\n.tiers-option-text { display: grid; gap: 3px; min-width: 0; }\n.tiers-option-name { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-family: var(--font-display);\n font-size: 15.5px; font-weight: 650; letter-spacing: -.01em; }\n.tiers-option-for { color: var(--secondary-foreground); font-size: 13.5px; line-height: 1.45; }\n.tiers-option-goes { color: var(--muted-foreground); font-size: 12.5px; line-height: 1.45; }\n.tiers-option-price { display: grid; justify-items: end; gap: 1px; min-width: 76px; color: var(--muted-foreground); font-size: 12px;\n white-space: nowrap; }\n.tiers-option-price b { color: var(--foreground); font-family: var(--font-display); font-size: 19px; font-weight: 660;\n letter-spacing: -.015em; font-variant-numeric: tabular-nums; }\n.tiers-option-meter { display: block; width: 64px; height: 4px; margin-top: 6px; border-radius: var(--radius-full);\n background: var(--muted); overflow: hidden; }\n.tiers-option-meter > span { display: block; height: 100%; border-radius: inherit; background: var(--primary); }\n@container tiers-setup (max-width: 420px) {\n .tiers-option { grid-template-columns: 22px minmax(0, 1fr); }\n .tiers-option-price { grid-column: 2; justify-items: start; }\n}\n\n/* A space's agents: its choice, and each one's line */\n.tiers-space { container: tiers-space / inline-size; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px;\n padding: 12px 12px 12px 14px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--card); }\n.tiers-space-mark { flex: none; display: grid; place-items: center; width: 32px; height: 32px; border-radius: var(--radius-md);\n background: var(--primary-soft); color: var(--primary-text); }\n.tiers-space-text { flex: 1 1 200px; display: grid; gap: 1px; min-width: 0; }\n.tiers-space-text b { font-size: 14px; font-weight: 620; }\n.tiers-space-text span { color: var(--muted-foreground); font-size: 12.5px; line-height: 1.45; }\n.tiers-space > .copilotz-select { flex: 1 1 210px; max-width: 280px; }\n.tiers-space-error { flex-basis: 100%; margin: 0; color: var(--destructive-text, var(--destructive)); font-size: 12.5px; }\n.tiers-line { min-width: 0; color: var(--muted-foreground); font-size: 12.5px; line-height: 1.45; }\n.tiers-line b { color: var(--secondary-foreground); font-weight: 600; }\n.tiers-line[data-picked] .tiers-line-from { color: var(--primary-text); }\n\n@container tiers-space (max-width: 480px) {\n .tiers-space > .copilotz-select { flex-basis: 100%; max-width: none; }\n}\n@container tiers (max-width: 520px) {\n .tiers-agents { padding: 14px 14px 6px; }\n .tiers-row { grid-template-columns: 32px minmax(0, 1fr); align-items: start; }\n .tiers-row > .copilotz-avatar { margin-top: 2px; }\n .tiers-row-price { grid-column: 2; }\n}\n";
|
package/tiers/views/web/style.js
CHANGED
|
@@ -14,7 +14,7 @@ export const STYLE = `
|
|
|
14
14
|
/* The tiers, as cards */
|
|
15
15
|
.tiers-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(214px, 1fr)); gap: 12px; margin: 0; padding: 0;
|
|
16
16
|
list-style: none; }
|
|
17
|
-
.tier-card { display: grid; grid-template-rows: auto auto auto 1fr auto; gap: 10px; min-width: 0; padding: 16px 16px 14px;
|
|
17
|
+
.tier-card { display: grid; grid-template-rows: auto auto auto auto 1fr auto; gap: 10px; min-width: 0; padding: 16px 16px 14px;
|
|
18
18
|
transition: border-color .15s, outline-color .15s; }
|
|
19
19
|
.tier-card[data-current] { border-color: var(--ring); outline: 1px solid var(--ring); outline-offset: -2px; }
|
|
20
20
|
.tier-card-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 8px; min-height: 22px; }
|
|
@@ -24,6 +24,8 @@ export const STYLE = `
|
|
|
24
24
|
.tier-card-price { display: flex; align-items: baseline; gap: 6px; margin: 0; color: var(--muted-foreground); font-size: 12.5px; }
|
|
25
25
|
.tier-card-price b { color: var(--foreground); font-family: var(--font-display); font-size: 21px; font-weight: 660;
|
|
26
26
|
letter-spacing: -.015em; font-variant-numeric: tabular-nums; }
|
|
27
|
+
.tier-card-goes { margin: -6px 0 0; color: var(--muted-foreground); font-size: 12.5px; line-height: 1.4; }
|
|
28
|
+
.tier-card-goes:empty { margin-top: -10px; }
|
|
27
29
|
.tier-card-agents { display: grid; align-content: start; gap: 7px; margin: 0; padding: 10px 0 2px; border-top: 1px solid var(--border);
|
|
28
30
|
list-style: none; }
|
|
29
31
|
.tier-card-agents li { display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 8px; align-items: baseline; font-size: 13px;
|
|
@@ -36,8 +38,48 @@ export const STYLE = `
|
|
|
36
38
|
.tier-card-using { display: flex; align-items: center; justify-content: center; gap: 6px; height: 36px; margin: 0;
|
|
37
39
|
border-radius: var(--radius-md); background: var(--primary-soft); color: var(--primary-text); font-size: 13.5px; font-weight: 600; }
|
|
38
40
|
|
|
41
|
+
.tier-card-badges { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
|
|
42
|
+
.tier-card-badges .copilotz-badge { gap: 4px; }
|
|
43
|
+
.tier-model small { display: block; }
|
|
44
|
+
.tier-new { display: grid; min-height: 160px; }
|
|
45
|
+
.tier-new-button { display: grid; place-content: center; justify-items: center; gap: 6px; padding: 18px; border: 1.5px dashed var(--border);
|
|
46
|
+
border-radius: var(--radius-xl); background: transparent; color: var(--muted-foreground); font: inherit; text-align: center;
|
|
47
|
+
cursor: pointer; transition: border-color .12s, color .12s; }
|
|
48
|
+
.tier-new-button:hover, .tier-new-button:focus-visible { border-color: var(--ring); color: var(--foreground); }
|
|
49
|
+
.tier-new-button b { color: var(--foreground); font-size: 15px; font-weight: 650; }
|
|
50
|
+
.tier-new-button span { max-width: 22ch; font-size: 12.5px; line-height: 1.45; }
|
|
51
|
+
.tiers-removed { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin: -4px 0 0; color: var(--muted-foreground);
|
|
52
|
+
font-size: 13px; }
|
|
53
|
+
.tiers-cap { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; color: var(--secondary-foreground); font-size: 13.5px; }
|
|
54
|
+
.tiers-cap > .copilotz-select { width: auto; min-width: 160px; }
|
|
55
|
+
.tiers-cap span { color: var(--muted-foreground); font-size: 12.5px; }
|
|
56
|
+
|
|
57
|
+
/* Customizing a tier */
|
|
58
|
+
.tiers-editor { display: grid; gap: 16px; min-width: 0; }
|
|
59
|
+
.tiers-editor-names { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 12px; }
|
|
60
|
+
.tiers-editor-error { margin-inline-end: auto; align-self: center; color: var(--destructive-text, var(--destructive)); font-size: 13px; }
|
|
61
|
+
.tiers-kinds { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; }
|
|
62
|
+
.tiers-kind { display: grid; gap: 8px; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius-lg); }
|
|
63
|
+
.tiers-kind-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
|
|
64
|
+
.tiers-kind-head b { font-size: 14.5px; font-weight: 650; }
|
|
65
|
+
.tiers-kind-head span { color: var(--muted-foreground); font-size: 12.5px; }
|
|
66
|
+
.tiers-chain { display: grid; gap: 6px; min-width: 0; }
|
|
67
|
+
.tiers-kind-new { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 10px; padding: 12px 14px;
|
|
68
|
+
border: 1px dashed var(--border); border-radius: var(--radius-lg); }
|
|
69
|
+
.tiers-kind-new-end { grid-column: 1 / -1; display: flex; justify-content: flex-end; gap: 6px; }
|
|
70
|
+
@container tiers (max-width: 520px) {
|
|
71
|
+
.tiers-editor-names, .tiers-kind-new { grid-template-columns: minmax(0, 1fr); }
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/* Beside the send button */
|
|
75
|
+
.tiers-pick { display: inline-flex; }
|
|
76
|
+
.tiers-pick .copilotz-button { color: var(--muted-foreground); font-weight: 550; }
|
|
77
|
+
.tiers-remove-said { margin: 0; color: var(--secondary-foreground); font-size: 14px; line-height: 1.5; }
|
|
78
|
+
.tiers-row-kind { display: inline-block; margin-right: 6px; padding: 0 6px; border-radius: var(--radius-full);
|
|
79
|
+
background: var(--muted); color: var(--secondary-foreground); font-size: 11.5px; font-weight: 600; }
|
|
80
|
+
|
|
39
81
|
/* Each agent's model */
|
|
40
|
-
.tiers-agents { display: grid; gap: 2px; padding: 16px 18px 8px; }
|
|
82
|
+
.tiers-agents { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2px; padding: 16px 18px 8px; }
|
|
41
83
|
.tiers-agents-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 8px 12px; }
|
|
42
84
|
.tiers-agents-head h3 { margin: 0; font-size: 15px; font-weight: 650; }
|
|
43
85
|
.tiers-agents-head p { margin: 3px 0 0; color: var(--muted-foreground); font-size: 13px; line-height: 1.45; }
|
|
@@ -46,21 +88,73 @@ export const STYLE = `
|
|
|
46
88
|
.tiers-row { display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; align-items: center; gap: 4px 12px; padding: 11px 0; }
|
|
47
89
|
.tiers-row + .tiers-row { border-top: 1px solid var(--border); }
|
|
48
90
|
.tiers-row-text { display: grid; gap: 2px; min-width: 0; }
|
|
49
|
-
.tiers-row-name { margin: 0; font-size: 14px; font-weight: 620; }
|
|
91
|
+
.tiers-row-name { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 8px; margin: 0; font-size: 14px; font-weight: 620; }
|
|
92
|
+
.tiers-row-handle { color: var(--muted-foreground); font-family: var(--font-mono); font-size: 12px; font-weight: 450; }
|
|
93
|
+
.tiers-row-about { margin: 0; overflow: hidden; color: var(--muted-foreground); font-size: 13px; line-height: 1.45;
|
|
94
|
+
text-overflow: ellipsis; white-space: nowrap; }
|
|
95
|
+
.tiers-row-end { display: flex; align-items: center; gap: 6px; }
|
|
96
|
+
.tiers-off { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; margin: 4px 0 8px; padding-top: 12px; border-top: 1px solid var(--border); }
|
|
97
|
+
.tiers-off h4 { margin: 0; color: var(--muted-foreground); font-size: 12px; font-weight: 650; letter-spacing: .05em;
|
|
98
|
+
text-transform: uppercase; }
|
|
99
|
+
.tiers-off-row { display: flex; align-items: center; gap: 10px; min-width: 0; color: var(--secondary-foreground); font-size: 13.5px; }
|
|
100
|
+
.tiers-off-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
50
101
|
.tiers-row-model { margin: 0; color: var(--secondary-foreground); font-size: 13px; line-height: 1.45; }
|
|
51
102
|
.tiers-row-model b { color: var(--foreground); font-weight: 600; }
|
|
52
103
|
.tiers-row-from[data-picked] { color: var(--primary-text); }
|
|
53
104
|
.tiers-row-price { color: var(--muted-foreground); font-size: 12.5px; font-variant-numeric: tabular-nums; white-space: nowrap; }
|
|
54
|
-
.tiers-row[data-editing] { grid-template-columns: 32px minmax(0, 1fr); align-items: start; }
|
|
105
|
+
.tiers-row[data-editing] { grid-template-columns: 32px minmax(0, 1fr) auto; align-items: start; }
|
|
55
106
|
.tiers-row[data-editing] > .copilotz-avatar { margin-top: 2px; }
|
|
56
107
|
.tiers-row-pick { display: grid; gap: 6px; min-width: 0; }
|
|
57
108
|
.tiers-row-under { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; color: var(--muted-foreground); font-size: 12.5px; }
|
|
58
109
|
.tiers-back { height: auto; padding: 0; font-size: 12.5px; }
|
|
110
|
+
.tiers-row-then { margin: 1px 0 0; color: var(--muted-foreground); font-size: 12.5px; line-height: 1.45; }
|
|
111
|
+
.tiers-fallbacks { display: grid; gap: 4px; margin-top: 6px; padding: 8px 10px; border: 1px dashed var(--border);
|
|
112
|
+
border-radius: var(--radius-md); }
|
|
113
|
+
.tiers-fallbacks-head { margin: 0; color: var(--secondary-foreground); font-size: 12.5px; font-weight: 600; }
|
|
114
|
+
.tiers-fallbacks-head span { color: var(--muted-foreground); font-weight: 450; }
|
|
115
|
+
.tiers-fallbacks-list { display: grid; gap: 2px; margin: 0; padding: 0 0 0 18px; font-size: 13px; }
|
|
116
|
+
.tiers-fallbacks-list li { padding-left: 2px; }
|
|
117
|
+
.tiers-fallback-name { display: inline-flex; align-items: baseline; gap: 6px; min-width: 0; margin-right: 4px; }
|
|
118
|
+
.tiers-fallback-name b { font-weight: 600; }
|
|
119
|
+
.tiers-fallback-name small { color: var(--muted-foreground); font-size: 12px; }
|
|
120
|
+
.tiers-fallbacks-none { margin: 0; color: var(--muted-foreground); font-size: 12.5px; }
|
|
59
121
|
|
|
60
122
|
.tiers-foot { display: flex; align-items: flex-start; gap: 7px; margin: 0 2px; color: var(--muted-foreground); font-size: 12.5px; line-height: 1.5; }
|
|
61
123
|
.tiers-foot .copilotz-icon { flex: none; margin-top: 2px; }
|
|
62
124
|
.tiers-foot a { color: var(--primary-text); text-underline-offset: 3px; }
|
|
63
125
|
|
|
126
|
+
/* Choosing a tier when the org is new: one choice, a row each */
|
|
127
|
+
.tiers-setup { container: tiers-setup / inline-size; display: grid; gap: 12px; min-width: 0; }
|
|
128
|
+
.tiers-options { display: grid; gap: 8px; }
|
|
129
|
+
.tiers-option { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; align-items: start; gap: 12px; width: 100%;
|
|
130
|
+
padding: 13px 14px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--card);
|
|
131
|
+
color: inherit; font: inherit; text-align: left; cursor: pointer; transition: border-color .12s, background-color .12s; }
|
|
132
|
+
.tiers-option:hover { border-color: var(--ring); }
|
|
133
|
+
.tiers-option:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }
|
|
134
|
+
.tiers-option[data-checked] { border-color: var(--ring); outline: 1px solid var(--ring); outline-offset: -2px;
|
|
135
|
+
background: color-mix(in oklab, var(--primary-soft) 40%, var(--card)); }
|
|
136
|
+
.tiers-option[aria-disabled] { cursor: default; }
|
|
137
|
+
.tiers-option-mark { display: grid; place-items: center; width: 20px; height: 20px; margin-top: 1px; border: 1.5px solid var(--input);
|
|
138
|
+
border-radius: var(--radius-full); color: var(--primary-foreground); }
|
|
139
|
+
.tiers-option[data-checked] .tiers-option-mark { border-color: var(--primary); background: var(--primary); }
|
|
140
|
+
.tiers-option[aria-busy] .tiers-option-mark { border-color: transparent; color: var(--primary-text); }
|
|
141
|
+
.tiers-option-text { display: grid; gap: 3px; min-width: 0; }
|
|
142
|
+
.tiers-option-name { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-family: var(--font-display);
|
|
143
|
+
font-size: 15.5px; font-weight: 650; letter-spacing: -.01em; }
|
|
144
|
+
.tiers-option-for { color: var(--secondary-foreground); font-size: 13.5px; line-height: 1.45; }
|
|
145
|
+
.tiers-option-goes { color: var(--muted-foreground); font-size: 12.5px; line-height: 1.45; }
|
|
146
|
+
.tiers-option-price { display: grid; justify-items: end; gap: 1px; min-width: 76px; color: var(--muted-foreground); font-size: 12px;
|
|
147
|
+
white-space: nowrap; }
|
|
148
|
+
.tiers-option-price b { color: var(--foreground); font-family: var(--font-display); font-size: 19px; font-weight: 660;
|
|
149
|
+
letter-spacing: -.015em; font-variant-numeric: tabular-nums; }
|
|
150
|
+
.tiers-option-meter { display: block; width: 64px; height: 4px; margin-top: 6px; border-radius: var(--radius-full);
|
|
151
|
+
background: var(--muted); overflow: hidden; }
|
|
152
|
+
.tiers-option-meter > span { display: block; height: 100%; border-radius: inherit; background: var(--primary); }
|
|
153
|
+
@container tiers-setup (max-width: 420px) {
|
|
154
|
+
.tiers-option { grid-template-columns: 22px minmax(0, 1fr); }
|
|
155
|
+
.tiers-option-price { grid-column: 2; justify-items: start; }
|
|
156
|
+
}
|
|
157
|
+
|
|
64
158
|
/* A space's agents: its choice, and each one's line */
|
|
65
159
|
.tiers-space { container: tiers-space / inline-size; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px;
|
|
66
160
|
padding: 12px 12px 12px 14px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--card); }
|