@adecore/agents-react 0.46.0 → 0.46.1

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,26 +9,30 @@ const MINUTE = 60_000;
9
9
  /*
10
10
  * The plan numbers per CLI, one row per account. The machine only reads an account that is signed in,
11
11
  * so an account that is on but signed out comes from the account list, where it can say why it has
12
- * no numbers. An account that is off is left out, unless the machine still reads it (a CLI's default).
13
- * A CLI the machine reads no plan of at all has no group, whatever accounts it has.
12
+ * no numbers. An account that is off is left out, also when an older machine still reads it.
13
+ * A CLI the machine reads no plan of, or that is not installed there, has no group, whatever accounts it has.
14
14
  */
15
15
  export function limitGroups(snapshot, accounts) {
16
16
  return USAGE_PROVIDERS.flatMap(kind => {
17
- if (!snapshot.providers.some(entry => entry.kind === kind)) {
17
+ const entries = snapshot.providers.filter(entry => entry.kind === kind && entry.unavailable?.reason !== 'not-installed');
18
+ if (entries.length === 0) {
18
19
  return [];
19
20
  }
20
21
  const known = accountsOfKind(accounts, kind);
21
- const read = snapshot.providers.filter(entry => entry.kind === kind).map(entry => {
22
+ const read = entries.flatMap(entry => {
22
23
  const id = limitsAccountId(entry);
23
24
  const account = known.find(each => each.id === id);
24
- return {
25
+ if (account?.account.enabled === false) {
26
+ return [];
27
+ }
28
+ return [{
25
29
  id,
26
30
  kind,
27
31
  name: account === undefined ? entry.account?.label ?? PROVIDER_LABELS[kind] : accountName(account, PROVIDER_LABELS[kind]),
28
32
  color: account === undefined ? entry.account?.color : account.account.color,
29
33
  entry,
30
34
  status: account?.status ?? null
31
- };
35
+ }];
32
36
  });
33
37
  const unread = known.filter(account => account.account.enabled !== false && !read.some(row => row.id === account.id)).map(account => ({
34
38
  id: account.id,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adecore/agents-react",
3
- "version": "0.46.0",
3
+ "version": "0.46.1",
4
4
  "description": "React agent chat threads, composers, approvals, provider accounts and usage views.",
5
5
  "type": "module",
6
6
  "exports": {
@@ -72,11 +72,11 @@
72
72
  "test:visuals": "bun --config=integration.bunfig.toml --conditions=source test ./src/chat/visual-viewport.integration.test.ts"
73
73
  },
74
74
  "dependencies": {
75
- "@adecore/agent-contracts": "0.46.0",
76
- "@adecore/editor": "0.46.0",
77
- "@adecore/editor-react": "0.46.0",
78
- "@adecore/intelligent-ui": "0.46.0",
79
- "@adecore/merge": "0.46.0",
75
+ "@adecore/agent-contracts": "0.46.1",
76
+ "@adecore/editor": "0.46.1",
77
+ "@adecore/editor-react": "0.46.1",
78
+ "@adecore/intelligent-ui": "0.46.1",
79
+ "@adecore/merge": "0.46.1",
80
80
  "@codemirror/commands": "^6.11.1",
81
81
  "@codemirror/language": "^6.13.1",
82
82
  "@codemirror/state": "^6.7.6",
@@ -100,14 +100,14 @@
100
100
  "zustand": "^5.0.16"
101
101
  },
102
102
  "peerDependencies": {
103
- "@adecore/ui": "^0.46.0",
103
+ "@adecore/ui": "^0.46.1",
104
104
  "i18next": "^26.4.2",
105
105
  "react": "^19.3.0",
106
106
  "react-dom": "^19.3.0",
107
107
  "react-i18next": "^17.0.15"
108
108
  },
109
109
  "devDependencies": {
110
- "@adecore/ui": "0.46.0",
110
+ "@adecore/ui": "0.46.1",
111
111
  "@types/bun": "^1.4.4",
112
112
  "@types/react": "^19.3.0",
113
113
  "@types/react-dom": "^19.3.0",
@@ -38,32 +38,38 @@ export interface LimitGroup {
38
38
  /*
39
39
  * The plan numbers per CLI, one row per account. The machine only reads an account that is signed in,
40
40
  * so an account that is on but signed out comes from the account list, where it can say why it has
41
- * no numbers. An account that is off is left out, unless the machine still reads it (a CLI's default).
42
- * A CLI the machine reads no plan of at all has no group, whatever accounts it has.
41
+ * no numbers. An account that is off is left out, also when an older machine still reads it.
42
+ * A CLI the machine reads no plan of, or that is not installed there, has no group, whatever accounts it has.
43
43
  */
44
44
  export function limitGroups(snapshot: UsageLimitsSnapshot, accounts: ProviderAccounts | null): LimitGroup[] {
45
45
  return USAGE_PROVIDERS.flatMap((kind) => {
46
- if (!snapshot.providers.some((entry) => entry.kind === kind)) {
46
+ const entries = snapshot.providers.filter((entry) => entry.kind === kind && entry.unavailable?.reason !== 'not-installed');
47
+
48
+ if (entries.length === 0) {
47
49
  return [];
48
50
  }
49
51
 
50
52
  const known = accountsOfKind(accounts, kind);
51
53
 
52
- const read = snapshot.providers
53
- .filter((entry) => entry.kind === kind)
54
- .map((entry): LimitAccount => {
55
- const id = limitsAccountId(entry);
56
- const account = known.find((each) => each.id === id);
54
+ const read = entries.flatMap((entry): LimitAccount[] => {
55
+ const id = limitsAccountId(entry);
56
+ const account = known.find((each) => each.id === id);
57
+
58
+ if (account?.account.enabled === false) {
59
+ return [];
60
+ }
57
61
 
58
- return {
62
+ return [
63
+ {
59
64
  id,
60
65
  kind,
61
66
  name: account === undefined ? (entry.account?.label ?? PROVIDER_LABELS[kind]) : accountName(account, PROVIDER_LABELS[kind]),
62
67
  color: account === undefined ? entry.account?.color : account.account.color,
63
68
  entry,
64
69
  status: account?.status ?? null
65
- };
66
- });
70
+ }
71
+ ];
72
+ });
67
73
 
68
74
  const unread = known
69
75
  .filter((account) => account.account.enabled !== false && !read.some((row) => row.id === account.id))