@app-vitals/agent-admin 1.107.5 → 1.108.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.
Files changed (40) hide show
  1. package/e2e/real/admin-access.real.e2e.ts +77 -68
  2. package/e2e/real/agent-management.real.e2e.ts +165 -143
  3. package/e2e/real/owner-access.real.e2e.ts +228 -212
  4. package/openapi.platform.json +127 -6
  5. package/package.json +2 -2
  6. package/src/account-created-notifier.ts +1 -1
  7. package/src/account-onboarding.integration.test.ts +69 -0
  8. package/src/account-onboarding.ts +29 -3
  9. package/src/account-repo-lookup-api.integration.test.ts +163 -0
  10. package/src/account-repo-lookup-api.ts +106 -0
  11. package/src/account-repo-lookup.ts +89 -0
  12. package/src/account-trial-expiry-sweeper.ts +1 -1
  13. package/src/accounts-api.integration.test.ts +5 -2
  14. package/src/accounts-api.smoke.test.ts +21 -5
  15. package/src/accounts-api.ts +12 -15
  16. package/src/admin-boot-config.ts +2 -0
  17. package/src/admin-boot-config.unit.test.ts +27 -0
  18. package/src/admin-boot.ts +18 -10
  19. package/src/admin-spec.ts +6 -0
  20. package/src/admin-ui-account.smoke.test.ts +7 -3
  21. package/src/admin-ui-account.ts +10 -15
  22. package/src/admin-ui-accounts.smoke.test.ts +4 -4
  23. package/src/admin-ui-accounts.ts +7 -11
  24. package/src/admin-ui-settings-nav-context.smoke.test.ts +24 -0
  25. package/src/admin-ui-settings.smoke.test.ts +17 -1
  26. package/src/admin-ui.smoke.test.ts +168 -2
  27. package/src/admin-ui.ts +39 -26
  28. package/src/agent-management-access.integration.test.ts +18 -6
  29. package/src/agent-manifest.ts +2 -1
  30. package/src/agent-provisioner.integration.test.ts +10 -10
  31. package/src/agent-provisioner.ts +10 -1
  32. package/src/agent-provisioner.unit.test.ts +110 -36
  33. package/src/agent-templates-api.integration.test.ts +23 -5
  34. package/src/agent-templates-api.ts +11 -8
  35. package/src/caller-scope.integration.test.ts +8 -6
  36. package/src/caller-scope.ts +32 -26
  37. package/src/caller-scope.unit.test.ts +15 -11
  38. package/src/openapi-schemas.ts +22 -0
  39. package/src/platform-routes.ts +14 -2
  40. package/src/platform-routes.unit.test.ts +2 -0
@@ -1,9 +1,10 @@
1
1
  /**
2
2
  * admin/e2e/real/owner-access.real.e2e.ts
3
3
  *
4
- * Real-service e2e, self-serve ON: an account owner (owner1, Account One)
5
- * sees and manages everything in their account, including agents they are not
6
- * an AgentMember of, and nothing in the other account. Direct URLs and requests
4
+ * Real-service e2e, self-serve OFF and ON (the setting must not change it):
5
+ * an account owner (owner1, Account One) sees and manages everything in their
6
+ * account, including agents they are not an AgentMember of, and nothing in the
7
+ * other account. Direct URLs and requests
7
8
  * for Account Two's agents, its chat and the admin-only pages are refused, and
8
9
  * each refusal is shown to have changed nothing.
9
10
  */
@@ -12,226 +13,241 @@ import { expect, test } from "@playwright/test";
12
13
  import { AGENTS, EMAILS, THREADS } from "./constants.ts";
13
14
  import { RealHarness } from "./fixture.ts";
14
15
 
15
- const harness = new RealHarness({
16
- selfServe: true,
17
- adminPort: 3520,
18
- chatPort: 3521,
19
- });
20
-
21
16
  test.describe.configure({ mode: "serial" });
22
17
 
23
- test.beforeAll(async () => {
24
- test.setTimeout(240_000);
25
- await harness.start();
26
- });
27
- test.afterAll(async () => {
28
- await harness.stop();
29
- });
30
-
31
18
  const REFUSED = [403, 404];
32
19
 
33
- test.describe("owner, self-serve on", () => {
34
- test("Agents list shows every agent in their account and none of the other", async ({
35
- page,
36
- context,
37
- }) => {
38
- await harness.signIn(context, EMAILS.owner1);
39
- await page.goto(`${harness.adminUrl}/admin/agents`);
40
- await expect(page.getByText(AGENTS.alpha.name).first()).toBeVisible();
41
- // Beta: same account, owner1 is not an AgentMember of it.
42
- await expect(page.getByText(AGENTS.beta.name).first()).toBeVisible();
43
- await expect(page.getByText(AGENTS.gamma.name)).toHaveCount(0);
44
-
45
- const res = await context.request.get(`${harness.adminUrl}/agents`);
46
- const ids = ((await res.json()) as { id: string }[]).map((a) => a.id);
47
- expect(ids.sort()).toEqual([AGENTS.alpha.id, AGENTS.beta.id].sort());
48
- });
49
-
50
- test("owner opens an agent they are not an AgentMember of", async ({
51
- page,
52
- context,
53
- }) => {
54
- await harness.signIn(context, EMAILS.owner1);
55
- const res = await page.goto(
56
- `${harness.adminUrl}/admin/agents/${AGENTS.beta.id}`,
57
- );
58
- expect(res?.status()).toBe(200);
59
- await expect(page.getByText(AGENTS.beta.name).first()).toBeVisible();
60
- const json = await context.request.get(
61
- `${harness.adminUrl}/agents/${AGENTS.beta.id}`,
62
- );
63
- expect(json.status()).toBe(200);
64
- });
20
+ /** The self-serve setting must not change any of this. */
21
+ const MODES = [
22
+ { selfServe: false, adminPort: 3526, chatPort: 3527 },
23
+ { selfServe: true, adminPort: 3520, chatPort: 3521 },
24
+ ];
25
+
26
+ for (const mode of MODES) {
27
+ test.describe(`self-serve ${mode.selfServe ? "on" : "off"}`, () => {
28
+ test.describe.configure({ mode: "serial" });
29
+ const harness = new RealHarness(mode);
30
+
31
+ test.beforeAll(async () => {
32
+ test.setTimeout(240_000);
33
+ await harness.start();
34
+ });
35
+ test.afterAll(async () => {
36
+ await harness.stop();
37
+ });
38
+
39
+ test.describe("owner", () => {
40
+ test("Agents list shows every agent in their account and none of the other", async ({
41
+ page,
42
+ context,
43
+ }) => {
44
+ await harness.signIn(context, EMAILS.owner1);
45
+ await page.goto(`${harness.adminUrl}/admin/agents`);
46
+ await expect(page.getByText(AGENTS.alpha.name).first()).toBeVisible();
47
+ // Beta: same account, owner1 is not an AgentMember of it.
48
+ await expect(page.getByText(AGENTS.beta.name).first()).toBeVisible();
49
+ await expect(page.getByText(AGENTS.gamma.name)).toHaveCount(0);
50
+
51
+ const res = await context.request.get(`${harness.adminUrl}/agents`);
52
+ const ids = ((await res.json()) as { id: string }[]).map((a) => a.id);
53
+ expect(ids.sort()).toEqual([AGENTS.alpha.id, AGENTS.beta.id].sort());
54
+ });
65
55
 
66
- test("owner Settings, Templates and Account pages open; admin-only items do not", async ({
67
- page,
68
- context,
69
- }) => {
70
- await harness.signIn(context, EMAILS.owner1);
71
- const base = harness.adminUrl;
72
- for (const path of [
73
- "/admin/settings",
74
- "/admin/settings/templates",
75
- "/admin/account",
76
- ]) {
77
- const res = await page.goto(`${base}${path}`);
78
- expect(res?.status(), path).toBe(200);
79
- await expect(page.locator("nav.settings-sidebar")).toBeVisible();
80
- }
81
- const nav = page.locator("nav.settings-sidebar");
82
- await expect(nav.locator('a[href^="/admin/account"]')).toHaveCount(1);
83
- await expect(
84
- nav.locator('a[href^="/admin/settings/templates"]'),
85
- ).toHaveCount(1);
86
- // Admin-only items are not offered.
87
- for (const href of [
88
- "/admin/settings/github-enterprise",
89
- "/admin/accounts",
90
- ]) {
91
- await expect(nav.locator(`a[href^="${href}"]`)).toHaveCount(0);
92
- }
93
- // The owner's Account page shows their own account only.
94
- await page.goto(`${base}/admin/account`);
95
- await expect(page.getByText(EMAILS.member1).first()).toBeVisible();
96
- await expect(page.getByText(EMAILS.owner2)).toHaveCount(0);
97
- });
56
+ test("owner opens an agent they are not an AgentMember of", async ({
57
+ page,
58
+ context,
59
+ }) => {
60
+ await harness.signIn(context, EMAILS.owner1);
61
+ const res = await page.goto(
62
+ `${harness.adminUrl}/admin/agents/${AGENTS.beta.id}`,
63
+ );
64
+ expect(res?.status()).toBe(200);
65
+ await expect(page.getByText(AGENTS.beta.name).first()).toBeVisible();
66
+ const json = await context.request.get(
67
+ `${harness.adminUrl}/agents/${AGENTS.beta.id}`,
68
+ );
69
+ expect(json.status()).toBe(200);
70
+ });
98
71
 
99
- test("owner can open the agent creation form", async ({ page, context }) => {
100
- await harness.signIn(context, EMAILS.owner1);
101
- const form = await page.goto(`${harness.adminUrl}/admin/agents/new`);
102
- expect(form?.status()).toBe(200);
103
- await expect(page.locator("form").first()).toBeVisible();
104
- });
72
+ test("owner Settings, Templates and Account pages open; admin-only items do not", async ({
73
+ page,
74
+ context,
75
+ }) => {
76
+ await harness.signIn(context, EMAILS.owner1);
77
+ const base = harness.adminUrl;
78
+ for (const path of [
79
+ "/admin/settings",
80
+ "/admin/settings/templates",
81
+ "/admin/account",
82
+ ]) {
83
+ const res = await page.goto(`${base}${path}`);
84
+ expect(res?.status(), path).toBe(200);
85
+ await expect(page.locator("nav.settings-sidebar")).toBeVisible();
86
+ }
87
+ const nav = page.locator("nav.settings-sidebar");
88
+ await expect(nav.locator('a[href^="/admin/account"]')).toHaveCount(1);
89
+ await expect(
90
+ nav.locator('a[href^="/admin/settings/templates"]'),
91
+ ).toHaveCount(1);
92
+ // Admin-only items are not offered.
93
+ for (const href of [
94
+ "/admin/settings/github-enterprise",
95
+ "/admin/accounts",
96
+ ]) {
97
+ await expect(nav.locator(`a[href^="${href}"]`)).toHaveCount(0);
98
+ }
99
+ // The owner's Account page shows their own account only.
100
+ await page.goto(`${base}/admin/account`);
101
+ await expect(page.getByText(EMAILS.member1).first()).toBeVisible();
102
+ await expect(page.getByText(EMAILS.owner2)).toHaveCount(0);
103
+ });
105
104
 
106
- test("direct URLs and requests for the other account's agent are refused", async ({
107
- page,
108
- context,
109
- }) => {
110
- await harness.signIn(context, EMAILS.owner1);
111
- const base = harness.adminUrl;
112
- const other = AGENTS.gamma;
113
-
114
- for (const path of [
115
- `/admin/agents/${other.id}`,
116
- `/admin/agents/${other.id}/setup`,
117
- ]) {
118
- const res = await page.goto(`${base}${path}`);
119
- expect(REFUSED, path).toContain(res?.status());
120
- await expect(page.getByText(other.name)).toHaveCount(0);
121
- }
122
-
123
- for (const path of [
124
- `/agents/${other.id}`,
125
- `/agents/${other.id}/envs`,
126
- `/agents/${other.id}/crons`,
127
- `/agents/${other.id}/tokens`,
128
- ]) {
129
- const res = await context.request.get(`${base}${path}`);
130
- expect(REFUSED, `GET ${path}`).toContain(res.status());
131
- expect(await res.text()).not.toContain(other.name);
132
- }
133
-
134
- const writes: [string, string, unknown?][] = [
135
- ["PATCH", `/agents/${other.id}`, { repos: ["evil-org/pwn"] }],
136
- ["POST", `/agents/${other.id}/repos`, { repos: ["evil-org/pwn"] }],
137
- ["DELETE", `/agents/${other.id}`],
138
- ];
139
- for (const [method, path, data] of writes) {
140
- const res = await context.request.fetch(`${base}${path}`, {
141
- method,
142
- ...(data ? { data } : {}),
105
+ test("owner can open the agent creation form", async ({
106
+ page,
107
+ context,
108
+ }) => {
109
+ await harness.signIn(context, EMAILS.owner1);
110
+ const form = await page.goto(`${harness.adminUrl}/admin/agents/new`);
111
+ expect(form?.status()).toBe(200);
112
+ await expect(page.locator("form").first()).toBeVisible();
143
113
  });
144
- expect(REFUSED, `${method} ${path}`).toContain(res.status());
145
- }
146
-
147
- for (const path of [
148
- `/admin/agents/${other.id}/settings`,
149
- `/admin/agents/${other.id}/members`,
150
- `/admin/agents/${other.id}/envs`,
151
- `/admin/agents/${other.id}/delete`,
152
- ]) {
153
- const res = await context.request.post(`${base}${path}`, {
154
- form: { email: "owner1@e2e.test", key: "K", value: "V" },
155
- maxRedirects: 0,
114
+
115
+ test("direct URLs and requests for the other account's agent are refused", async ({
116
+ page,
117
+ context,
118
+ }) => {
119
+ await harness.signIn(context, EMAILS.owner1);
120
+ const base = harness.adminUrl;
121
+ const other = AGENTS.gamma;
122
+
123
+ for (const path of [
124
+ `/admin/agents/${other.id}`,
125
+ `/admin/agents/${other.id}/setup`,
126
+ ]) {
127
+ const res = await page.goto(`${base}${path}`);
128
+ expect(REFUSED, path).toContain(res?.status());
129
+ await expect(page.getByText(other.name)).toHaveCount(0);
130
+ }
131
+
132
+ for (const path of [
133
+ `/agents/${other.id}`,
134
+ `/agents/${other.id}/envs`,
135
+ `/agents/${other.id}/crons`,
136
+ `/agents/${other.id}/tokens`,
137
+ ]) {
138
+ const res = await context.request.get(`${base}${path}`);
139
+ expect(REFUSED, `GET ${path}`).toContain(res.status());
140
+ expect(await res.text()).not.toContain(other.name);
141
+ }
142
+
143
+ const writes: [string, string, unknown?][] = [
144
+ ["PATCH", `/agents/${other.id}`, { repos: ["evil-org/pwn"] }],
145
+ ["POST", `/agents/${other.id}/repos`, { repos: ["evil-org/pwn"] }],
146
+ ["DELETE", `/agents/${other.id}`],
147
+ ];
148
+ for (const [method, path, data] of writes) {
149
+ const res = await context.request.fetch(`${base}${path}`, {
150
+ method,
151
+ ...(data ? { data } : {}),
152
+ });
153
+ expect(REFUSED, `${method} ${path}`).toContain(res.status());
154
+ }
155
+
156
+ for (const path of [
157
+ `/admin/agents/${other.id}/settings`,
158
+ `/admin/agents/${other.id}/members`,
159
+ `/admin/agents/${other.id}/envs`,
160
+ `/admin/agents/${other.id}/delete`,
161
+ ]) {
162
+ const res = await context.request.post(`${base}${path}`, {
163
+ form: { email: "owner1@e2e.test", key: "K", value: "V" },
164
+ maxRedirects: 0,
165
+ });
166
+ expect(REFUSED, `POST ${path}`).toContain(res.status());
167
+ }
156
168
  });
157
- expect(REFUSED, `POST ${path}`).toContain(res.status());
158
- }
159
- });
160
169
 
161
- test("the other account's chat is refused", async ({ page, context }) => {
162
- await harness.signIn(context, EMAILS.owner1);
163
- const base = harness.adminUrl;
164
- const other = AGENTS.gamma;
165
- const seeded = THREADS.gamma;
166
- const threadId = await harness.threadIdByTitle(seeded.title);
167
-
168
- const picked = await page.goto(`${base}/admin/chat?agentId=${other.id}`);
169
- expect(REFUSED).toContain(picked?.status());
170
- await expect(page.getByText(seeded.title)).toHaveCount(0);
171
-
172
- const read = await page.goto(
173
- `${base}/admin/chat/${other.id}/threads/${threadId}`,
174
- );
175
- expect(REFUSED).toContain(read?.status());
176
- await expect(page.getByText(seeded.message)).toHaveCount(0);
177
-
178
- const before = await harness.chatThreads();
179
- for (const path of [
180
- `/admin/chat/${other.id}/threads`,
181
- `/admin/chat/${other.id}/threads/${threadId}/messages`,
182
- `/admin/chat/${other.id}/threads/${threadId}/delete`,
183
- ]) {
184
- const res = await context.request.post(`${base}${path}`, {
185
- form: { title: "pwn thread", body: "pwn message" },
186
- maxRedirects: 0,
170
+ test("the other account's chat is refused", async ({ page, context }) => {
171
+ await harness.signIn(context, EMAILS.owner1);
172
+ const base = harness.adminUrl;
173
+ const other = AGENTS.gamma;
174
+ const seeded = THREADS.gamma;
175
+ const threadId = await harness.threadIdByTitle(seeded.title);
176
+
177
+ const picked = await page.goto(
178
+ `${base}/admin/chat?agentId=${other.id}`,
179
+ );
180
+ expect(REFUSED).toContain(picked?.status());
181
+ await expect(page.getByText(seeded.title)).toHaveCount(0);
182
+
183
+ const read = await page.goto(
184
+ `${base}/admin/chat/${other.id}/threads/${threadId}`,
185
+ );
186
+ expect(REFUSED).toContain(read?.status());
187
+ await expect(page.getByText(seeded.message)).toHaveCount(0);
188
+
189
+ const before = await harness.chatThreads();
190
+ for (const path of [
191
+ `/admin/chat/${other.id}/threads`,
192
+ `/admin/chat/${other.id}/threads/${threadId}/messages`,
193
+ `/admin/chat/${other.id}/threads/${threadId}/delete`,
194
+ ]) {
195
+ const res = await context.request.post(`${base}${path}`, {
196
+ form: { title: "pwn thread", body: "pwn message" },
197
+ maxRedirects: 0,
198
+ });
199
+ expect(REFUSED, `POST ${path}`).toContain(res.status());
200
+ }
201
+ const after = await harness.chatThreads();
202
+ expect(after.map((t) => [t.id, t.title]).sort()).toEqual(
203
+ before.map((t) => [t.id, t.title]).sort(),
204
+ );
205
+ expect(
206
+ (await harness.chatMessages(threadId)).map((m) => m.body),
207
+ ).toEqual([seeded.message]);
187
208
  });
188
- expect(REFUSED, `POST ${path}`).toContain(res.status());
189
- }
190
- const after = await harness.chatThreads();
191
- expect(after.map((t) => [t.id, t.title]).sort()).toEqual(
192
- before.map((t) => [t.id, t.title]).sort(),
193
- );
194
- expect((await harness.chatMessages(threadId)).map((m) => m.body)).toEqual([
195
- seeded.message,
196
- ]);
197
- });
198
209
 
199
- test("admin-only pages are refused", async ({ page, context }) => {
200
- await harness.signIn(context, EMAILS.owner1);
201
- const base = harness.adminUrl;
202
- for (const path of [
203
- "/admin/settings/github-enterprise",
204
- "/admin/accounts",
205
- `/admin/accounts/${AGENTS.gamma.accountId}`,
206
- ]) {
207
- const res = await page.goto(`${base}${path}`);
208
- expect(REFUSED, path).toContain(res?.status());
209
- await expect(page.getByText("Account Two")).toHaveCount(0);
210
- }
211
- for (const path of ["/accounts", `/accounts/${AGENTS.gamma.accountId}`]) {
212
- const res = await context.request.get(`${base}${path}`);
213
- expect(REFUSED, `GET ${path}`).toContain(res.status());
214
- expect(await res.text()).not.toContain("Account Two");
215
- }
216
- const post = await context.request.post(
217
- `${base}/admin/accounts/${AGENTS.gamma.accountId}`,
218
- { form: { name: "pwned" }, maxRedirects: 0 },
219
- );
220
- expect(REFUSED).toContain(post.status());
221
- });
210
+ test("admin-only pages are refused", async ({ page, context }) => {
211
+ await harness.signIn(context, EMAILS.owner1);
212
+ const base = harness.adminUrl;
213
+ for (const path of [
214
+ "/admin/settings/github-enterprise",
215
+ "/admin/accounts",
216
+ `/admin/accounts/${AGENTS.gamma.accountId}`,
217
+ ]) {
218
+ const res = await page.goto(`${base}${path}`);
219
+ expect(REFUSED, path).toContain(res?.status());
220
+ await expect(page.getByText("Account Two")).toHaveCount(0);
221
+ }
222
+ for (const path of [
223
+ "/accounts",
224
+ `/accounts/${AGENTS.gamma.accountId}`,
225
+ ]) {
226
+ const res = await context.request.get(`${base}${path}`);
227
+ expect(REFUSED, `GET ${path}`).toContain(res.status());
228
+ expect(await res.text()).not.toContain("Account Two");
229
+ }
230
+ const post = await context.request.post(
231
+ `${base}/admin/accounts/${AGENTS.gamma.accountId}`,
232
+ { form: { name: "pwned" }, maxRedirects: 0 },
233
+ );
234
+ expect(REFUSED).toContain(post.status());
235
+ });
222
236
 
223
- test("nothing in the other account was changed", async ({ context }) => {
224
- await harness.signIn(context, EMAILS.admin);
225
- const res = await context.request.get(
226
- `${harness.adminUrl}/agents/${AGENTS.gamma.id}`,
227
- );
228
- const row = (await res.json()) as {
229
- name: string;
230
- repos: string[];
231
- accountId: string;
232
- };
233
- expect(row.name).toBe(AGENTS.gamma.name);
234
- expect(row.repos).toEqual([...AGENTS.gamma.repos]);
235
- expect(row.accountId).toBe(AGENTS.gamma.accountId);
237
+ test("nothing in the other account was changed", async ({ context }) => {
238
+ await harness.signIn(context, EMAILS.admin);
239
+ const res = await context.request.get(
240
+ `${harness.adminUrl}/agents/${AGENTS.gamma.id}`,
241
+ );
242
+ const row = (await res.json()) as {
243
+ name: string;
244
+ repos: string[];
245
+ accountId: string;
246
+ };
247
+ expect(row.name).toBe(AGENTS.gamma.name);
248
+ expect(row.repos).toEqual([...AGENTS.gamma.repos]);
249
+ expect(row.accountId).toBe(AGENTS.gamma.accountId);
250
+ });
251
+ });
236
252
  });
237
- });
253
+ }
@@ -4733,6 +4733,67 @@
4733
4733
  "required": [
4734
4734
  "ids"
4735
4735
  ]
4736
+ },
4737
+ "AccountRepoLookupResponse": {
4738
+ "type": "object",
4739
+ "properties": {
4740
+ "repos": {
4741
+ "type": "array",
4742
+ "items": {
4743
+ "type": "object",
4744
+ "properties": {
4745
+ "repo": {
4746
+ "type": "string",
4747
+ "example": "acme/widgets"
4748
+ },
4749
+ "accountIds": {
4750
+ "type": "array",
4751
+ "items": {
4752
+ "type": "string"
4753
+ },
4754
+ "example": [
4755
+ "acct-a"
4756
+ ]
4757
+ }
4758
+ },
4759
+ "required": [
4760
+ "repo",
4761
+ "accountIds"
4762
+ ]
4763
+ }
4764
+ },
4765
+ "singleAccount": {
4766
+ "type": "boolean"
4767
+ },
4768
+ "singleAccountId": {
4769
+ "type": [
4770
+ "string",
4771
+ "null"
4772
+ ],
4773
+ "description": "Set only when singleAccount is true"
4774
+ }
4775
+ },
4776
+ "required": [
4777
+ "repos",
4778
+ "singleAccount",
4779
+ "singleAccountId"
4780
+ ]
4781
+ },
4782
+ "AccountRepoLookupBody": {
4783
+ "type": "object",
4784
+ "properties": {
4785
+ "repos": {
4786
+ "type": "array",
4787
+ "items": {
4788
+ "type": "string",
4789
+ "minLength": 1
4790
+ },
4791
+ "maxItems": 500
4792
+ }
4793
+ },
4794
+ "required": [
4795
+ "repos"
4796
+ ]
4736
4797
  }
4737
4798
  },
4738
4799
  "parameters": {}
@@ -9086,7 +9147,7 @@
9086
9147
  }
9087
9148
  },
9088
9149
  "403": {
9089
- "description": "Forbidden (caller has no account, or names another account / the deployment scope)",
9150
+ "description": "Forbidden (caller is not an account owner, or names another account / the deployment scope)",
9090
9151
  "content": {
9091
9152
  "application/json": {
9092
9153
  "schema": {
@@ -9164,7 +9225,7 @@
9164
9225
  }
9165
9226
  },
9166
9227
  "403": {
9167
- "description": "Forbidden (caller has no account, or names another account / the deployment scope)",
9228
+ "description": "Forbidden (caller is not an account owner, or names another account / the deployment scope)",
9168
9229
  "content": {
9169
9230
  "application/json": {
9170
9231
  "schema": {
@@ -9235,7 +9296,7 @@
9235
9296
  }
9236
9297
  },
9237
9298
  "403": {
9238
- "description": "Forbidden (caller has no account, or names another account / the deployment scope)",
9299
+ "description": "Forbidden (caller is not an account owner, or names another account / the deployment scope)",
9239
9300
  "content": {
9240
9301
  "application/json": {
9241
9302
  "schema": {
@@ -9287,7 +9348,7 @@
9287
9348
  }
9288
9349
  },
9289
9350
  "403": {
9290
- "description": "Forbidden (caller has no account, or names another account / the deployment scope)",
9351
+ "description": "Forbidden (caller is not an account owner, or names another account / the deployment scope)",
9291
9352
  "content": {
9292
9353
  "application/json": {
9293
9354
  "schema": {
@@ -9367,7 +9428,7 @@
9367
9428
  }
9368
9429
  },
9369
9430
  "403": {
9370
- "description": "Forbidden (caller has no account, or names another account / the deployment scope)",
9431
+ "description": "Forbidden (caller is not an account owner, or names another account / the deployment scope)",
9371
9432
  "content": {
9372
9433
  "application/json": {
9373
9434
  "schema": {
@@ -9446,7 +9507,7 @@
9446
9507
  }
9447
9508
  },
9448
9509
  "403": {
9449
- "description": "Forbidden (caller has no account, or names another account / the deployment scope)",
9510
+ "description": "Forbidden (caller is not an account owner, or names another account / the deployment scope)",
9450
9511
  "content": {
9451
9512
  "application/json": {
9452
9513
  "schema": {
@@ -9600,6 +9661,66 @@
9600
9661
  }
9601
9662
  }
9602
9663
  }
9664
+ },
9665
+ "/account-lookup/by-repos": {
9666
+ "post": {
9667
+ "tags": [
9668
+ "accounts"
9669
+ ],
9670
+ "summary": "Resolve repos to the accounts of the agents that list them",
9671
+ "description": "Admin-only. For each repo, the distinct accounts of the agents that list it, matched case-insensitively. An agent with no account counts as the default account. Also reports whether the deployment has exactly one account and its id.",
9672
+ "requestBody": {
9673
+ "content": {
9674
+ "application/json": {
9675
+ "schema": {
9676
+ "$ref": "#/components/schemas/AccountRepoLookupBody"
9677
+ }
9678
+ }
9679
+ }
9680
+ },
9681
+ "responses": {
9682
+ "200": {
9683
+ "description": "Accounts per repo and the single-account report",
9684
+ "content": {
9685
+ "application/json": {
9686
+ "schema": {
9687
+ "$ref": "#/components/schemas/AccountRepoLookupResponse"
9688
+ }
9689
+ }
9690
+ }
9691
+ },
9692
+ "400": {
9693
+ "description": "Bad request",
9694
+ "content": {
9695
+ "application/json": {
9696
+ "schema": {
9697
+ "$ref": "#/components/schemas/Error"
9698
+ }
9699
+ }
9700
+ }
9701
+ },
9702
+ "401": {
9703
+ "description": "Unauthorized",
9704
+ "content": {
9705
+ "application/json": {
9706
+ "schema": {
9707
+ "$ref": "#/components/schemas/Error"
9708
+ }
9709
+ }
9710
+ }
9711
+ },
9712
+ "403": {
9713
+ "description": "Forbidden (non-admin caller)",
9714
+ "content": {
9715
+ "application/json": {
9716
+ "schema": {
9717
+ "$ref": "#/components/schemas/Error"
9718
+ }
9719
+ }
9720
+ }
9721
+ }
9722
+ }
9723
+ }
9603
9724
  }
9604
9725
  },
9605
9726
  "webhooks": {}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@app-vitals/agent-admin",
3
- "version": "1.107.5",
3
+ "version": "1.108.1",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/app-vitals/agent.git",
@@ -44,7 +44,7 @@
44
44
  },
45
45
  "dependencies": {
46
46
  "@anthropic-ai/sdk": "0.137.0",
47
- "@app-vitals/agent-lib": "1.107.5",
47
+ "@app-vitals/agent-lib": "1.108.1",
48
48
  "@hono/zod-openapi": "^1.0.0",
49
49
  "@prisma/adapter-pg": "^7.10.0",
50
50
  "@prisma/client": "^7.10.0",