@adecore/agents-react 0.31.2 → 0.31.4

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.
@@ -9,6 +9,7 @@ import { PROVIDER_PATHS } from './provider-paths.js';
9
9
  const BUILT_IN_MARKS = {
10
10
  claude: siClaude,
11
11
  codex: { title: 'Codex', path: PROVIDER_PATHS.codex },
12
+ grok: { title: 'Grok', path: PROVIDER_PATHS.grok },
12
13
  gemini: siGooglegemini,
13
14
  copilot: siGithubcopilot
14
15
  };
@@ -1,9 +1,10 @@
1
1
  /*
2
- * The marks of Anthropic and OpenAI, and a monogram for a provider with no mark of its own. Lucide has no brand marks, so these are the icon rule's
2
+ * The marks of Anthropic, OpenAI and xAI, and a monogram for a provider with no mark of its own. Lucide has no brand marks, so these are the icon rule's
3
3
  * exception for provider marks. One path each, in `currentColor`, so a row decides how loud the logo is.
4
4
  */
5
5
  export const PROVIDER_PATHS = {
6
6
  claude: 'M4.709 15.955l4.72-2.647.079-.23-.08-.128H9.2l-.79-.048-2.698-.073-2.339-.097-2.266-.122-.571-.121L0 11.784l.055-.352.48-.321.686.06 1.52.103 2.278.158 1.652.097 2.449.255h.389l.055-.157-.134-.098-.103-.097-2.358-1.596-2.552-1.688-1.336-.972-.724-.491-.364-.462-.158-1.008.656-.722.881.06.225.061.893.686 1.908 1.476 2.491 1.833.365.304.145-.103.019-.073-.164-.274-1.355-2.446-1.446-2.49-.644-1.032-.17-.619a2.97 2.97 0 01-.104-.729L6.283.134 6.696 0l.996.134.42.364.62 1.414 1.002 2.229 1.555 3.03.456.898.243.832.091.255h.158V9.01l.128-1.706.237-2.095.23-2.695.08-.76.377-.91.747-.492.584.28.48.685-.067.444-.286 1.851-.559 2.903-.364 1.942h.212l.243-.242.985-1.306 1.652-2.064.73-.82.85-.904.547-.431h1.033l.76 1.129-.34 1.166-1.064 1.347-.881 1.142-1.264 1.7-.79 1.36.073.11.188-.02 2.856-.606 1.543-.28 1.841-.315.833.388.091.395-.328.807-1.969.486-2.309.462-3.439.813-.042.03.048.061 1.549.146.662.036h1.622l3.02.225.79.522.474.638-.079.485-1.215.62-1.64-.389-3.829-.91-1.312-.329h-.182v.11l1.093 1.068 2.006 1.81 2.509 2.33.127.578-.322.455-.34-.049-2.205-1.657-.851-.747-1.926-1.62h-.128v.17l.444.649 2.345 3.521.122 1.08-.17.353-.607.212-.668-.122-1.374-1.925-1.415-2.167-1.143-1.943-.14.08-.674 7.254-.316.37-.729.28-.607-.461-.322-.747.322-1.476.389-1.924.315-1.53.286-1.9.17-.632-.012-.042-.14.018-1.434 1.967-2.18 2.945-1.726 1.845-.414.164-.717-.37.067-.662.401-.589 2.388-3.036 1.44-1.882.93-1.086-.006-.158h-.055L4.132 18.56l-1.13.146-.487-.456.061-.746.231-.243 1.914-1.316-.012.01z',
7
7
  codex: 'M21.55 10.004a5.416 5.416 0 00-.478-4.501c-1.217-2.09-3.662-3.166-6.05-2.66A5.59 5.59 0 0010.831 1C8.39.995 6.224 2.546 5.473 4.838A5.553 5.553 0 001.76 7.496a5.487 5.487 0 00.691 6.5 5.416 5.416 0 00.477 4.502c1.217 2.09 3.662 3.165 6.05 2.66A5.586 5.586 0 0013.168 23c2.443.006 4.61-1.546 5.361-3.84a5.554 5.554 0 003.715-2.66 5.488 5.488 0 00-.693-6.497v.001zm-8.381 11.558a4.199 4.199 0 01-2.675-.954c.034-.018.093-.05.132-.074l4.44-2.53a.71.71 0 00.364-.623v-6.176l1.877 1.069c.02.01.033.029.036.05v5.115c-.003 2.274-1.87 4.118-4.174 4.123zM4.192 17.78a4.059 4.059 0 01-.498-2.763c.032.019.09.055.131.078l4.44 2.53c.225.13.504.13.73 0l5.42-3.088v2.138a.068.068 0 01-.027.057L9.9 19.288c-1.999 1.136-4.552.46-5.707-1.51h-.001zM3.023 8.216A4.15 4.15 0 015.198 6.41l-.002.151v5.06a.711.711 0 00.364.624l5.42 3.087-1.876 1.07a.067.067 0 01-.063.005l-4.489-2.559c-1.995-1.14-2.679-3.658-1.53-5.63h.001zm15.417 3.54l-5.42-3.088L14.896 7.6a.067.067 0 01.063-.006l4.489 2.557c1.998 1.14 2.683 3.662 1.529 5.633a4.163 4.163 0 01-2.174 1.807V12.38a.71.71 0 00-.363-.623zm1.867-2.773a6.04 6.04 0 00-.132-.078l-4.44-2.53a.731.731 0 00-.729 0l-5.42 3.088V7.325a.068.068 0 01.027-.057L14.1 4.713c2-1.137 4.555-.46 5.707 1.513.487.833.664 1.809.499 2.757h.001zm-11.741 3.81l-1.877-1.068a.065.065 0 01-.036-.051V6.559c.001-2.277 1.873-4.122 4.181-4.12.976 0 1.92.338 2.671.954-.034.018-.092.05-.131.073l-4.44 2.53a.71.71 0 00-.365.623l-.003 6.173v.001zm1.02-2.168L12 9.25l2.414 1.375v2.75L12 14.75l-2.415-1.375v-2.75z',
8
- nanogpt: 'M5 20V4h2.6l8.8 11.2V4H19v16h-2.6L7.6 8.8V20z'
8
+ nanogpt: 'M5 20V4h2.6l8.8 11.2V4H19v16h-2.6L7.6 8.8V20z',
9
+ grok: 'M6.469 8.776 16.512 23h-4.464L2.005 8.776H6.47Zm-.004 7.9 2.233 3.164L6.467 23H2l4.465-6.324ZM22 2.582V23h-3.659V7.764L22 2.582ZM22 1l-9.952 14.095-2.233-3.163L17.533 1H22Z'
9
10
  };
@@ -8,7 +8,8 @@ const CLI_COLORS = {
8
8
  codex: 'text-chart-codex',
9
9
  gemini: 'text-chart-gemini',
10
10
  copilot: 'text-chart-copilot',
11
- nanogpt: 'text-chart-nanogpt'
11
+ nanogpt: 'text-chart-nanogpt',
12
+ grok: 'text-chart-grok'
12
13
  };
13
14
  export function CliMark({ kind, size = 14, className }) {
14
15
  return _jsx(AgentIcon, { kind: kind, size: size, className: clsx('shrink-0', CLI_COLORS[kind] ?? 'text-text-muted', className) });
package/dist/theme.css CHANGED
@@ -14,6 +14,7 @@
14
14
  --chart-gemini: #3b82f6;
15
15
  --chart-copilot: #64748b;
16
16
  --chart-nanogpt: #34c759;
17
+ --chart-grok: #ff2d55;
17
18
  /* What a chat's context holds, one color per part; the rest is the system's and stays gray. */
18
19
  --chart-context-tools: #4d7ce6;
19
20
  --chart-context-files: #9a63e0;
@@ -47,6 +48,7 @@
47
48
  --chart-gemini: #60a5fa;
48
49
  --chart-copilot: #94a3b8;
49
50
  --chart-nanogpt: #30d158;
51
+ --chart-grok: #ff375f;
50
52
  --chart-context-tools: #8aa7f5;
51
53
  --chart-context-files: #b98af3;
52
54
  --chart-context-conversation: #6dd08b;
@@ -85,6 +87,7 @@
85
87
  --color-chart-gemini: var(--chart-gemini);
86
88
  --color-chart-copilot: var(--chart-copilot);
87
89
  --color-chart-nanogpt: var(--chart-nanogpt);
90
+ --color-chart-grok: var(--chart-grok);
88
91
  --color-chart-context-tools: var(--chart-context-tools);
89
92
  --color-chart-context-files: var(--chart-context-files);
90
93
  --color-chart-context-conversation: var(--chart-context-conversation);
@@ -20,11 +20,12 @@ export function moneyFormat(currency, rate) {
20
20
  return formatMoney(value, code, value !== 0 && Math.abs(value) < 0.01 ? 4 : undefined);
21
21
  };
22
22
  }
23
- export const PROVIDER_LABELS = { claude: 'Claude Code', codex: 'Codex', nanogpt: 'NanoGPT' };
23
+ export const PROVIDER_LABELS = { claude: 'Claude Code', codex: 'Codex', nanogpt: 'NanoGPT', grok: 'Grok' };
24
24
  export const PROVIDER_COLORS = {
25
25
  claude: 'var(--chart-claude)',
26
26
  codex: 'var(--chart-codex)',
27
- nanogpt: 'var(--chart-nanogpt)'
27
+ nanogpt: 'var(--chart-nanogpt)',
28
+ grok: 'var(--chart-grok)'
28
29
  };
29
30
  /*
30
31
  * A slot is `2026-09-10` or `2026-09-10T14`, already in the viewer's own zone, so it is read as plain
@@ -9,9 +9,13 @@ const MINUTE = 60_000;
9
9
  * The plan numbers per CLI, one row per account. The machine only reads an account that is signed in,
10
10
  * so an account that is on but signed out comes from the account list, where it can say why it has
11
11
  * no numbers. An account that is off is left out, unless the machine still reads it (a CLI's default).
12
+ * A CLI the machine reads no plan of at all has no group, whatever accounts it has.
12
13
  */
13
14
  export function limitGroups(snapshot, accounts) {
14
15
  return USAGE_PROVIDERS.flatMap((kind) => {
16
+ if (!snapshot.providers.some((entry) => entry.kind === kind)) {
17
+ return [];
18
+ }
15
19
  const known = accountsOfKind(accounts, kind);
16
20
  const read = snapshot.providers
17
21
  .filter((entry) => entry.kind === kind)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adecore/agents-react",
3
- "version": "0.31.2",
3
+ "version": "0.31.4",
4
4
  "description": "React agent chat threads, composers, approvals, provider accounts and usage views.",
5
5
  "type": "module",
6
6
  "exports": {
@@ -67,11 +67,11 @@
67
67
  "test:visuals": "bun --config=integration.bunfig.toml --conditions=source test ./src/chat/visual-viewport.integration.test.ts"
68
68
  },
69
69
  "dependencies": {
70
- "@adecore/agent-contracts": "0.31.2",
71
- "@adecore/editor": "0.31.2",
72
- "@adecore/editor-react": "0.31.2",
73
- "@adecore/intelligent-ui": "0.31.2",
74
- "@adecore/merge": "0.31.2",
70
+ "@adecore/agent-contracts": "0.31.4",
71
+ "@adecore/editor": "0.31.4",
72
+ "@adecore/editor-react": "0.31.4",
73
+ "@adecore/intelligent-ui": "0.31.4",
74
+ "@adecore/merge": "0.31.4",
75
75
  "@codemirror/commands": "^6.11.1",
76
76
  "@codemirror/language": "^6.12.4",
77
77
  "@codemirror/state": "^6.7.6",
@@ -94,14 +94,14 @@
94
94
  "zustand": "^5.0.15"
95
95
  },
96
96
  "peerDependencies": {
97
- "@adecore/ui": "^0.31.2",
97
+ "@adecore/ui": "^0.31.4",
98
98
  "i18next": "^26.4.2",
99
99
  "react": "^19.3.0",
100
100
  "react-dom": "^19.3.0",
101
101
  "react-i18next": "^17.0.15"
102
102
  },
103
103
  "devDependencies": {
104
- "@adecore/ui": "0.31.2",
104
+ "@adecore/ui": "0.31.4",
105
105
  "@types/bun": "^1.4.2",
106
106
  "@types/react": "^19.3.0",
107
107
  "@types/react-dom": "^19.3.0",
@@ -10,6 +10,7 @@ import { PROVIDER_PATHS } from './provider-paths';
10
10
  const BUILT_IN_MARKS: Partial<Record<AgentKind, AgentMark>> = {
11
11
  claude: siClaude,
12
12
  codex: { title: 'Codex', path: PROVIDER_PATHS.codex },
13
+ grok: { title: 'Grok', path: PROVIDER_PATHS.grok },
13
14
  gemini: siGooglegemini,
14
15
  copilot: siGithubcopilot
15
16
  };
@@ -1,11 +1,12 @@
1
1
  import type { UsageProvider } from '@adecore/agent-contracts';
2
2
 
3
3
  /*
4
- * The marks of Anthropic and OpenAI, and a monogram for a provider with no mark of its own. Lucide has no brand marks, so these are the icon rule's
4
+ * The marks of Anthropic, OpenAI and xAI, and a monogram for a provider with no mark of its own. Lucide has no brand marks, so these are the icon rule's
5
5
  * exception for provider marks. One path each, in `currentColor`, so a row decides how loud the logo is.
6
6
  */
7
7
  export const PROVIDER_PATHS: Record<UsageProvider, string> = {
8
8
  claude: 'M4.709 15.955l4.72-2.647.079-.23-.08-.128H9.2l-.79-.048-2.698-.073-2.339-.097-2.266-.122-.571-.121L0 11.784l.055-.352.48-.321.686.06 1.52.103 2.278.158 1.652.097 2.449.255h.389l.055-.157-.134-.098-.103-.097-2.358-1.596-2.552-1.688-1.336-.972-.724-.491-.364-.462-.158-1.008.656-.722.881.06.225.061.893.686 1.908 1.476 2.491 1.833.365.304.145-.103.019-.073-.164-.274-1.355-2.446-1.446-2.49-.644-1.032-.17-.619a2.97 2.97 0 01-.104-.729L6.283.134 6.696 0l.996.134.42.364.62 1.414 1.002 2.229 1.555 3.03.456.898.243.832.091.255h.158V9.01l.128-1.706.237-2.095.23-2.695.08-.76.377-.91.747-.492.584.28.48.685-.067.444-.286 1.851-.559 2.903-.364 1.942h.212l.243-.242.985-1.306 1.652-2.064.73-.82.85-.904.547-.431h1.033l.76 1.129-.34 1.166-1.064 1.347-.881 1.142-1.264 1.7-.79 1.36.073.11.188-.02 2.856-.606 1.543-.28 1.841-.315.833.388.091.395-.328.807-1.969.486-2.309.462-3.439.813-.042.03.048.061 1.549.146.662.036h1.622l3.02.225.79.522.474.638-.079.485-1.215.62-1.64-.389-3.829-.91-1.312-.329h-.182v.11l1.093 1.068 2.006 1.81 2.509 2.33.127.578-.322.455-.34-.049-2.205-1.657-.851-.747-1.926-1.62h-.128v.17l.444.649 2.345 3.521.122 1.08-.17.353-.607.212-.668-.122-1.374-1.925-1.415-2.167-1.143-1.943-.14.08-.674 7.254-.316.37-.729.28-.607-.461-.322-.747.322-1.476.389-1.924.315-1.53.286-1.9.17-.632-.012-.042-.14.018-1.434 1.967-2.18 2.945-1.726 1.845-.414.164-.717-.37.067-.662.401-.589 2.388-3.036 1.44-1.882.93-1.086-.006-.158h-.055L4.132 18.56l-1.13.146-.487-.456.061-.746.231-.243 1.914-1.316-.012.01z',
9
9
  codex: 'M21.55 10.004a5.416 5.416 0 00-.478-4.501c-1.217-2.09-3.662-3.166-6.05-2.66A5.59 5.59 0 0010.831 1C8.39.995 6.224 2.546 5.473 4.838A5.553 5.553 0 001.76 7.496a5.487 5.487 0 00.691 6.5 5.416 5.416 0 00.477 4.502c1.217 2.09 3.662 3.165 6.05 2.66A5.586 5.586 0 0013.168 23c2.443.006 4.61-1.546 5.361-3.84a5.554 5.554 0 003.715-2.66 5.488 5.488 0 00-.693-6.497v.001zm-8.381 11.558a4.199 4.199 0 01-2.675-.954c.034-.018.093-.05.132-.074l4.44-2.53a.71.71 0 00.364-.623v-6.176l1.877 1.069c.02.01.033.029.036.05v5.115c-.003 2.274-1.87 4.118-4.174 4.123zM4.192 17.78a4.059 4.059 0 01-.498-2.763c.032.019.09.055.131.078l4.44 2.53c.225.13.504.13.73 0l5.42-3.088v2.138a.068.068 0 01-.027.057L9.9 19.288c-1.999 1.136-4.552.46-5.707-1.51h-.001zM3.023 8.216A4.15 4.15 0 015.198 6.41l-.002.151v5.06a.711.711 0 00.364.624l5.42 3.087-1.876 1.07a.067.067 0 01-.063.005l-4.489-2.559c-1.995-1.14-2.679-3.658-1.53-5.63h.001zm15.417 3.54l-5.42-3.088L14.896 7.6a.067.067 0 01.063-.006l4.489 2.557c1.998 1.14 2.683 3.662 1.529 5.633a4.163 4.163 0 01-2.174 1.807V12.38a.71.71 0 00-.363-.623zm1.867-2.773a6.04 6.04 0 00-.132-.078l-4.44-2.53a.731.731 0 00-.729 0l-5.42 3.088V7.325a.068.068 0 01.027-.057L14.1 4.713c2-1.137 4.555-.46 5.707 1.513.487.833.664 1.809.499 2.757h.001zm-11.741 3.81l-1.877-1.068a.065.065 0 01-.036-.051V6.559c.001-2.277 1.873-4.122 4.181-4.12.976 0 1.92.338 2.671.954-.034.018-.092.05-.131.073l-4.44 2.53a.71.71 0 00-.365.623l-.003 6.173v.001zm1.02-2.168L12 9.25l2.414 1.375v2.75L12 14.75l-2.415-1.375v-2.75z',
10
- nanogpt: 'M5 20V4h2.6l8.8 11.2V4H19v16h-2.6L7.6 8.8V20z'
10
+ nanogpt: 'M5 20V4h2.6l8.8 11.2V4H19v16h-2.6L7.6 8.8V20z',
11
+ grok: 'M6.469 8.776 16.512 23h-4.464L2.005 8.776H6.47Zm-.004 7.9 2.233 3.164L6.467 23H2l4.465-6.324ZM22 2.582V23h-3.659V7.764L22 2.582ZM22 1l-9.952 14.095-2.233-3.163L17.533 1H22Z'
11
12
  };
@@ -9,7 +9,8 @@ const CLI_COLORS: Partial<Record<AgentKind, string>> = {
9
9
  codex: 'text-chart-codex',
10
10
  gemini: 'text-chart-gemini',
11
11
  copilot: 'text-chart-copilot',
12
- nanogpt: 'text-chart-nanogpt'
12
+ nanogpt: 'text-chart-nanogpt',
13
+ grok: 'text-chart-grok'
13
14
  };
14
15
 
15
16
  export function CliMark({ kind, size = 14, className }: { kind: AgentKind; size?: number; className?: string }) {
package/src/theme.css CHANGED
@@ -14,6 +14,7 @@
14
14
  --chart-gemini: #3b82f6;
15
15
  --chart-copilot: #64748b;
16
16
  --chart-nanogpt: #34c759;
17
+ --chart-grok: #ff2d55;
17
18
  /* What a chat's context holds, one color per part; the rest is the system's and stays gray. */
18
19
  --chart-context-tools: #4d7ce6;
19
20
  --chart-context-files: #9a63e0;
@@ -47,6 +48,7 @@
47
48
  --chart-gemini: #60a5fa;
48
49
  --chart-copilot: #94a3b8;
49
50
  --chart-nanogpt: #30d158;
51
+ --chart-grok: #ff375f;
50
52
  --chart-context-tools: #8aa7f5;
51
53
  --chart-context-files: #b98af3;
52
54
  --chart-context-conversation: #6dd08b;
@@ -85,6 +87,7 @@
85
87
  --color-chart-gemini: var(--chart-gemini);
86
88
  --color-chart-copilot: var(--chart-copilot);
87
89
  --color-chart-nanogpt: var(--chart-nanogpt);
90
+ --color-chart-grok: var(--chart-grok);
88
91
  --color-chart-context-tools: var(--chart-context-tools);
89
92
  --color-chart-context-files: var(--chart-context-files);
90
93
  --color-chart-context-conversation: var(--chart-context-conversation);
@@ -28,12 +28,13 @@ export function moneyFormat(currency: UsageCurrency, rate: UsageRate | null): (u
28
28
  };
29
29
  }
30
30
 
31
- export const PROVIDER_LABELS: Record<UsageProvider, string> = { claude: 'Claude Code', codex: 'Codex', nanogpt: 'NanoGPT' };
31
+ export const PROVIDER_LABELS: Record<UsageProvider, string> = { claude: 'Claude Code', codex: 'Codex', nanogpt: 'NanoGPT', grok: 'Grok' };
32
32
 
33
33
  export const PROVIDER_COLORS: Record<UsageProvider, string> = {
34
34
  claude: 'var(--chart-claude)',
35
35
  codex: 'var(--chart-codex)',
36
- nanogpt: 'var(--chart-nanogpt)'
36
+ nanogpt: 'var(--chart-nanogpt)',
37
+ grok: 'var(--chart-grok)'
37
38
  };
38
39
 
39
40
  /*
@@ -36,9 +36,13 @@ export interface LimitGroup {
36
36
  * The plan numbers per CLI, one row per account. The machine only reads an account that is signed in,
37
37
  * so an account that is on but signed out comes from the account list, where it can say why it has
38
38
  * no numbers. An account that is off is left out, unless the machine still reads it (a CLI's default).
39
+ * A CLI the machine reads no plan of at all has no group, whatever accounts it has.
39
40
  */
40
41
  export function limitGroups(snapshot: UsageLimitsSnapshot, accounts: ProviderAccounts | null): LimitGroup[] {
41
42
  return USAGE_PROVIDERS.flatMap((kind) => {
43
+ if (!snapshot.providers.some((entry) => entry.kind === kind)) {
44
+ return [];
45
+ }
42
46
  const known = accountsOfKind(accounts, kind);
43
47
  const read = snapshot.providers
44
48
  .filter((entry) => entry.kind === kind)