@bevel-software/platform-core-frontend 0.13.5 → 0.14.0

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 (35) hide show
  1. package/THIRD-PARTY-NOTICES.md +416 -418
  2. package/package.json +2 -2
  3. package/src/lib/__tests__/utils.test.ts +43 -0
  4. package/src/lib/utils.ts +15 -7
  5. package/src/modules/library/__tests__/LibraryRoutes.test.tsx +1 -0
  6. package/src/modules/library/__tests__/McpServerSection.test.tsx +7 -1
  7. package/src/modules/library/__tests__/ToolConnectionSection.test.tsx +216 -8
  8. package/src/modules/library/__tests__/ToolPage.test.tsx +164 -3
  9. package/src/modules/library/__tests__/ToolVarRow.test.tsx +7 -7
  10. package/src/modules/library/__tests__/status.test.ts +84 -0
  11. package/src/modules/library/components/LibraryCard.tsx +7 -1
  12. package/src/modules/library/components/skill-page/SkillPage.tsx +5 -1
  13. package/src/modules/library/components/tool-page/McpServerSection.tsx +9 -1
  14. package/src/modules/library/components/tool-page/ToolConnectionSection.tsx +223 -8
  15. package/src/modules/library/components/tool-page/ToolPage.tsx +103 -1
  16. package/src/modules/library/components/tool-page/ToolVarRow.tsx +30 -8
  17. package/src/modules/library/hooks/useToolPage.ts +28 -11
  18. package/src/modules/library/hooks/useToolSource.ts +77 -0
  19. package/src/modules/library/utils/status.ts +99 -10
  20. package/src/modules/onboarding/__tests__/onboarding.test.tsx +760 -730
  21. package/src/modules/onboarding/agent-clients.ts +9 -3
  22. package/src/modules/onboarding/components/WelcomePage.tsx +9 -7
  23. package/src/modules/secrets-vault/components/ConnectToolsPage.tsx +29 -14
  24. package/src/modules/secrets-vault/components/SecretsPage.tsx +4 -1
  25. package/src/modules/secrets-vault/components/ToolSecretsPanel.tsx +4 -1
  26. package/src/modules/secrets-vault/services/tool-secrets.api.ts +36 -0
  27. package/src/modules/toolbar/components/ExternalAgentAccessPage.tsx +6 -10
  28. package/src/modules/toolbar/components/__tests__/ExternalAgentAccessPage.test.tsx +34 -12
  29. package/src/shared/mcp/ChatGptInstallLink.tsx +45 -0
  30. package/src/shared/mcp/ClaudeInstallLink.tsx +3 -3
  31. package/src/shared/mcp/ConnectionInstructions.tsx +17 -11
  32. package/src/shared/mcp/__tests__/ChatGptInstallLink.test.tsx +34 -0
  33. package/src/shared/mcp/__tests__/connect-snippets.test.ts +49 -13
  34. package/src/shared/mcp/connect-snippets.ts +41 -6
  35. package/src/shared/mcp/index.ts +4 -0
@@ -1,6 +1,9 @@
1
1
  import { describe, it, expect, beforeEach, vi } from 'vitest';
2
2
  import {
3
+ MCP_DISPLAY_NAME,
4
+ MCP_SERVER_KEY,
3
5
  canDeepLink,
6
+ chatgptInstallUrl,
4
7
  claudeCodeCommand,
5
8
  claudeInstallUrl,
6
9
  configureMcpUrl,
@@ -325,9 +328,42 @@ describe('claudeInstallUrl: the documented install link', () => {
325
328
  });
326
329
  });
327
330
 
331
+ describe('chatgptInstallUrl: the settings pane, since ChatGPT prefills nothing', () => {
332
+ it('opens ChatGPT’s connector settings over https', () => {
333
+ const link = chatgptInstallUrl();
334
+ expect(link.startsWith('https://chatgpt.com/')).toBe(true);
335
+ expect(link).toContain('settings');
336
+ });
337
+ });
338
+
339
+ describe('the two spellings of the name', () => {
340
+ // Humans read this one: it is what the connector list and the ChatGPT
341
+ // Create dialog show, so it is the product's words, not a slug.
342
+ it('shows people "Skills, Tools and Knowledge"', () => {
343
+ expect(MCP_DISPLAY_NAME).toBe('Skills, Tools and Knowledge');
344
+ });
345
+
346
+ /**
347
+ * Config files read this one. Claude Code derives every tool name from it
348
+ * (`mcp__<server>__<tool>`), so a space or a comma here would surface in
349
+ * an identifier — and the same key must serve the hosted endpoint and the
350
+ * local server, so nothing drifts between the two families of snippets.
351
+ */
352
+ it('gives config files a plain slug that every snippet shares', () => {
353
+ expect(MCP_SERVER_KEY).toMatch(/^[a-z0-9-]+$/);
354
+ const URL_UNDER_TEST = 'https://kb.acme.com/api/mcp';
355
+ expect(claudeCodeCommand(URL_UNDER_TEST)).toContain(` ${MCP_SERVER_KEY} `);
356
+ expect(Object.keys(JSON.parse(jsonConfigSnippet(URL_UNDER_TEST)).mcpServers)).toEqual([MCP_SERVER_KEY]);
357
+ expect(hexisMcpClaudeCommand('https://kb.acme.com')).toContain(`claude mcp add ${MCP_SERVER_KEY} `);
358
+ expect(Object.keys(JSON.parse(hexisMcpJsonSnippet('https://kb.acme.com')).mcpServers)).toEqual([
359
+ MCP_SERVER_KEY,
360
+ ]);
361
+ });
362
+ });
363
+
328
364
  describe('connectorName: what it is called in a connector list', () => {
329
365
  it('names the product and the deployment', () => {
330
- expect(connectorName('https://kb.acme.com/api/mcp')).toBe('Knowledge — kb.acme.com');
366
+ expect(connectorName('https://kb.acme.com/api/mcp')).toBe('Skills, Tools and Knowledge — kb.acme.com');
331
367
  });
332
368
 
333
369
  /**
@@ -343,11 +379,11 @@ describe('connectorName: what it is called in a connector list', () => {
343
379
 
344
380
  // `host`, not `hostname` — two instances on one machine differ only by port.
345
381
  it('keeps a non-default port', () => {
346
- expect(connectorName('https://kb.acme.com:8443/api/mcp')).toBe('Knowledge — kb.acme.com:8443');
382
+ expect(connectorName('https://kb.acme.com:8443/api/mcp')).toBe('Skills, Tools and Knowledge — kb.acme.com:8443');
347
383
  });
348
384
 
349
385
  it('still names something when the URL is unparseable', () => {
350
- expect(connectorName('not a url')).toBe('Knowledge');
386
+ expect(connectorName('not a url')).toBe('Skills, Tools and Knowledge');
351
387
  });
352
388
  });
353
389
 
@@ -357,13 +393,13 @@ describe('snippets: one builder per client, keyed or not', () => {
357
393
 
358
394
  it('builds the Claude Code command without a key', () => {
359
395
  expect(claudeCodeCommand(URL_UNDER_TEST)).toBe(
360
- `claude mcp add --transport http knowledge-base ${URL_UNDER_TEST}`,
396
+ `claude mcp add --transport http skills-tools-knowledge ${URL_UNDER_TEST}`,
361
397
  );
362
398
  });
363
399
 
364
400
  it('appends the Authorization header when there is a key', () => {
365
401
  expect(claudeCodeCommand(URL_UNDER_TEST, KEY)).toBe(
366
- `claude mcp add --transport http knowledge-base ${URL_UNDER_TEST} --header "Authorization: Bearer ${KEY}"`,
402
+ `claude mcp add --transport http skills-tools-knowledge ${URL_UNDER_TEST} --header "Authorization: Bearer ${KEY}"`,
367
403
  );
368
404
  });
369
405
 
@@ -373,16 +409,16 @@ describe('snippets: one builder per client, keyed or not', () => {
373
409
  */
374
410
  it('omits headers entirely from the keyless JSON config', () => {
375
411
  const parsed = JSON.parse(jsonConfigSnippet(URL_UNDER_TEST));
376
- expect(parsed.mcpServers['knowledge-base']).toEqual({
412
+ expect(parsed.mcpServers['skills-tools-knowledge']).toEqual({
377
413
  type: 'http',
378
414
  url: URL_UNDER_TEST,
379
415
  });
380
- expect('headers' in parsed.mcpServers['knowledge-base']).toBe(false);
416
+ expect('headers' in parsed.mcpServers['skills-tools-knowledge']).toBe(false);
381
417
  });
382
418
 
383
419
  it('carries the key in the JSON config when there is one', () => {
384
420
  const parsed = JSON.parse(jsonConfigSnippet(URL_UNDER_TEST, KEY));
385
- expect(parsed.mcpServers['knowledge-base']).toEqual({
421
+ expect(parsed.mcpServers['skills-tools-knowledge']).toEqual({
386
422
  type: 'http',
387
423
  url: URL_UNDER_TEST,
388
424
  headers: { Authorization: `Bearer ${KEY}` },
@@ -396,7 +432,7 @@ describe('snippets: one builder per client, keyed or not', () => {
396
432
  */
397
433
  it('escapes shell metacharacters in the key for the Claude Code command', () => {
398
434
  expect(claudeCodeCommand(URL_UNDER_TEST, 'a"b$c`d\\e')).toBe(
399
- `claude mcp add --transport http knowledge-base ${URL_UNDER_TEST} --header "Authorization: Bearer a\\"b\\$c\\\`d\\\\e"`,
435
+ `claude mcp add --transport http skills-tools-knowledge ${URL_UNDER_TEST} --header "Authorization: Bearer a\\"b\\$c\\\`d\\\\e"`,
400
436
  );
401
437
  });
402
438
 
@@ -404,7 +440,7 @@ describe('snippets: one builder per client, keyed or not', () => {
404
440
  // the client reading the file gets the exact bytes back.
405
441
  it('does not shell-escape the key in the JSON config', () => {
406
442
  const parsed = JSON.parse(jsonConfigSnippet(URL_UNDER_TEST, 'a"b$c'));
407
- expect(parsed.mcpServers['knowledge-base'].headers.Authorization).toBe('Bearer a"b$c');
443
+ expect(parsed.mcpServers['skills-tools-knowledge'].headers.Authorization).toBe('Bearer a"b$c');
408
444
  });
409
445
 
410
446
  it('spells the Langdock fields out separately', () => {
@@ -430,7 +466,7 @@ describe('snippets: one builder per client, keyed or not', () => {
430
466
 
431
467
  it('builds a JSON config that spawns the package with the key', () => {
432
468
  const parsed = JSON.parse(hexisMcpJsonSnippet(BASE, KEY));
433
- expect(parsed.mcpServers['knowledge']).toEqual({
469
+ expect(parsed.mcpServers['skills-tools-knowledge']).toEqual({
434
470
  command: 'npx',
435
471
  args: ['-y', '@bevel-software/hexis-mcp'],
436
472
  env: {
@@ -448,7 +484,7 @@ describe('snippets: one builder per client, keyed or not', () => {
448
484
  */
449
485
  it('omits the key env entirely when no key was minted — keyless selects browser sign-in', () => {
450
486
  const parsed = JSON.parse(hexisMcpJsonSnippet(BASE));
451
- expect(parsed.mcpServers['knowledge'].env).toEqual({
487
+ expect(parsed.mcpServers['skills-tools-knowledge'].env).toEqual({
452
488
  HEXIS_URL: BASE,
453
489
  });
454
490
  expect(hexisMcpJsonSnippet(BASE)).not.toContain(KEY);
@@ -456,7 +492,7 @@ describe('snippets: one builder per client, keyed or not', () => {
456
492
 
457
493
  it('builds the Claude Code command as a stdio add with both env values', () => {
458
494
  expect(hexisMcpClaudeCommand(BASE, KEY)).toBe(
459
- `claude mcp add knowledge --env HEXIS_URL="${BASE}" --env HEXIS_CONNECTION_KEY="${KEY}" -- npx -y @bevel-software/hexis-mcp`,
495
+ `claude mcp add skills-tools-knowledge --env HEXIS_URL="${BASE}" --env HEXIS_CONNECTION_KEY="${KEY}" -- npx -y @bevel-software/hexis-mcp`,
460
496
  );
461
497
  });
462
498
 
@@ -28,6 +28,25 @@
28
28
  /** Where `/api/mcp` hangs off a given origin. The one place that path is spelled. */
29
29
  const MCP_PATH = '/api/mcp';
30
30
 
31
+ /**
32
+ * What this workspace is called when it shows up in an agent's server list.
33
+ * Two spellings of one name, because the two places it goes have different
34
+ * rules:
35
+ *
36
+ * - {@link MCP_DISPLAY_NAME} is for humans: the connector name claude.ai
37
+ * shows, and what someone types into ChatGPT's "Create" dialog. Spaces and
38
+ * punctuation are fine there.
39
+ * - {@link MCP_SERVER_KEY} is for config files: the `mcpServers` key and the
40
+ * `claude mcp add <name>` argument. Clients derive identifiers from it —
41
+ * Claude Code names every tool `mcp__<server>__<tool>` — so it has to be a
42
+ * plain slug. The same key serves the hosted endpoint and the local server:
43
+ * they are one workspace, and nobody adds both to one client.
44
+ *
45
+ * Everything below spells the name through these two; nothing re-types it.
46
+ */
47
+ export const MCP_DISPLAY_NAME = 'Skills, Tools and Knowledge';
48
+ export const MCP_SERVER_KEY = 'skills-tools-knowledge';
49
+
31
50
  /**
32
51
  * The deployment's own answer, from `GET /api/config`. Module-global because
33
52
  * it is a property of the deployment rather than of any component, and it is
@@ -279,9 +298,9 @@ function isPrivateIpv6(bracketed: string): boolean {
279
298
  */
280
299
  export function connectorName(mcpUrl: string): string {
281
300
  try {
282
- return `Knowledge — ${new URL(mcpUrl).host}`;
301
+ return `${MCP_DISPLAY_NAME} — ${new URL(mcpUrl).host}`;
283
302
  } catch {
284
- return 'Knowledge';
303
+ return MCP_DISPLAY_NAME;
285
304
  }
286
305
  }
287
306
 
@@ -308,6 +327,22 @@ export function claudeInstallUrl(mcpUrl: string, name: string): string {
308
327
  return `${CLAUDE_ADD_CONNECTOR}?${params}`;
309
328
  }
310
329
 
330
+ /**
331
+ * Where ChatGPT keeps its connector settings — the pane whose "Advanced"
332
+ * section holds the Developer mode toggle and, once it is on, the "Create"
333
+ * button for a custom MCP server.
334
+ *
335
+ * Unlike Claude, ChatGPT publishes no install link: there is no query
336
+ * parameter that prefills a connector's name or URL. So this is a shortcut to
337
+ * the right settings pane and nothing more — the person still types the name
338
+ * and pastes the endpoint, which is why every surface that offers this link
339
+ * shows both right beside it. The settings pane is a hash route, so it takes
340
+ * no parameters and there is nothing to encode.
341
+ */
342
+ export function chatgptInstallUrl(): string {
343
+ return 'https://chatgpt.com/#settings/Connectors';
344
+ }
345
+
311
346
  /* ------------------------------------------------------------------ *
312
347
  * The snippets themselves. One builder per client, each taking the URL
313
348
  * so no caller ever re-derives it, and an optional bearer token for the
@@ -326,7 +361,7 @@ function escapeForDoubleQuotes(value: string): string {
326
361
 
327
362
  /** The `claude mcp add` one-liner, with the key appended when there is one. */
328
363
  export function claudeCodeCommand(mcpUrl: string, bearer?: string): string {
329
- const base = `claude mcp add --transport http knowledge-base ${mcpUrl}`;
364
+ const base = `claude mcp add --transport http ${MCP_SERVER_KEY} ${mcpUrl}`;
330
365
  return bearer ? `${base} --header "Authorization: Bearer ${escapeForDoubleQuotes(bearer)}"` : base;
331
366
  }
332
367
 
@@ -335,7 +370,7 @@ export function jsonConfigSnippet(mcpUrl: string, bearer?: string): string {
335
370
  return JSON.stringify(
336
371
  {
337
372
  mcpServers: {
338
- 'knowledge-base': {
373
+ [MCP_SERVER_KEY]: {
339
374
  type: 'http',
340
375
  url: mcpUrl,
341
376
  ...(bearer ? { headers: { Authorization: `Bearer ${bearer}` } } : {}),
@@ -394,7 +429,7 @@ export function hexisMcpJsonSnippet(baseUrl: string, bearer?: string): string {
394
429
  return JSON.stringify(
395
430
  {
396
431
  mcpServers: {
397
- knowledge: {
432
+ [MCP_SERVER_KEY]: {
398
433
  command: 'npx',
399
434
  args: ['-y', '@bevel-software/hexis-mcp'],
400
435
  env: {
@@ -421,7 +456,7 @@ export function hexisMcpJsonSnippet(baseUrl: string, bearer?: string): string {
421
456
  */
422
457
  export function hexisMcpClaudeCommand(baseUrl: string, bearer?: string): string {
423
458
  return (
424
- `claude mcp add knowledge` +
459
+ `claude mcp add ${MCP_SERVER_KEY}` +
425
460
  ` --env HEXIS_URL="${escapeForDoubleQuotes(baseUrl)}"` +
426
461
  (bearer ? ` --env HEXIS_CONNECTION_KEY="${escapeForDoubleQuotes(bearer)}"` : '') +
427
462
  ` -- npx -y @bevel-software/hexis-mcp`
@@ -12,7 +12,10 @@
12
12
  * Tests import it straight from `./connect-snippets`, as `test-setup.ts` does.
13
13
  */
14
14
  export {
15
+ MCP_DISPLAY_NAME,
16
+ MCP_SERVER_KEY,
15
17
  canDeepLink,
18
+ chatgptInstallUrl,
16
19
  claudeCodeCommand,
17
20
  claudeInstallUrl,
18
21
  configureMcpUrl,
@@ -26,6 +29,7 @@ export {
26
29
  } from './connect-snippets';
27
30
 
28
31
  export { ClaudeInstallLink } from './ClaudeInstallLink';
32
+ export { ChatGptInstallLink } from './ChatGptInstallLink';
29
33
  export { ConnectionInstructions } from './ConnectionInstructions';
30
34
  export { CopyBlock } from './CopyBlock';
31
35
  export { useCopyFeedback } from './useCopyFeedback';