@opengeni/core 4.3.3-canary.39786771332001 → 4.5.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opengeni/core",
3
- "version": "4.3.3-canary.39786771332001",
3
+ "version": "4.5.0",
4
4
  "description": "Opengeni framework-agnostic core: the domain, access, and billing layers (neutral access, off-HTTP V2 surface). Behavior-preserving extraction from apps/api — keeps Hono's HTTPException for error throwing (typed-errors cleanup deferred).",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -51,18 +51,18 @@
51
51
  "dependencies": {
52
52
  "@modelcontextprotocol/client": "2.3.1",
53
53
  "@modelcontextprotocol/sdk": "^1.29.0",
54
- "@opengeni/capabilities": "4.3.3-canary.39786771332001",
55
- "@opengeni/codex": "4.3.3-canary.39786771332001",
56
- "@opengeni/config": "4.3.3-canary.39786771332001",
57
- "@opengeni/contracts": "4.3.3-canary.39786771332001",
58
- "@opengeni/db": "4.3.3-canary.39786771332001",
59
- "@opengeni/documents": "4.3.3-canary.39786771332001",
60
- "@opengeni/events": "4.3.3-canary.39786771332001",
61
- "@opengeni/network": "4.3.3-canary.39786771332001",
62
- "@opengeni/observability": "4.3.3-canary.39786771332001",
63
- "@opengeni/runtime": "4.3.3-canary.39786771332001",
64
- "@opengeni/storage": "4.3.3-canary.39786771332001",
65
- "@opengeni/vaults": "4.3.3-canary.39786771332001",
54
+ "@opengeni/capabilities": "4.5.0",
55
+ "@opengeni/codex": "4.5.0",
56
+ "@opengeni/config": "4.5.0",
57
+ "@opengeni/contracts": "4.5.0",
58
+ "@opengeni/db": "4.5.0",
59
+ "@opengeni/documents": "4.5.0",
60
+ "@opengeni/events": "4.5.0",
61
+ "@opengeni/network": "4.5.0",
62
+ "@opengeni/observability": "4.5.0",
63
+ "@opengeni/runtime": "4.5.0",
64
+ "@opengeni/storage": "4.5.0",
65
+ "@opengeni/vaults": "4.5.0",
66
66
  "hono": "^4.12.18",
67
67
  "zod": "^4.2.1"
68
68
  },
@@ -25,6 +25,8 @@ import {
25
25
  type McpPersonalConnectionDelegation,
26
26
  assertOrganizationIntegrationAllowed,
27
27
  type SocialConnection,
28
+ ToolAuthNeededPayload,
29
+ type UserSetupBlocker,
28
30
  } from "@opengeni/contracts";
29
31
  import {
30
32
  CODEX_APPS_MCP_SERVER_ID,
@@ -1666,6 +1668,20 @@ function onePasswordCatalogItem(connections: ConnectionMetadata[]): CapabilityCa
1666
1668
  });
1667
1669
  }
1668
1670
 
1671
+ /** How people and agents name the deployment's Chrome extension, and where it is installed. */
1672
+ export type BrowserExtension = { name: string; installUrl: string };
1673
+
1674
+ /** The deployment's configured Chrome extension, else Opengeni Browser. */
1675
+ export function browserExtension(settings: {
1676
+ browserExtensionName?: string | undefined;
1677
+ browserExtensionInstallUrl?: string | undefined;
1678
+ }): BrowserExtension {
1679
+ return {
1680
+ name: settings.browserExtensionName ?? "Opengeni Browser",
1681
+ installUrl: settings.browserExtensionInstallUrl ?? OPENGENI_BROWSER_EXTENSION_URL,
1682
+ };
1683
+ }
1684
+
1669
1685
  /** The catalog id of the Excel add-in tile and its in-chat install card. */
1670
1686
  export const EXCEL_ADDIN_CAPABILITY_ID = "api:excel-addin";
1671
1687
 
@@ -1791,8 +1807,9 @@ export const CONNECTED_MACHINE_CAPABILITY_ID = "api:connected-machine";
1791
1807
  export { OPENGENI_BROWSER_EXTENSION_URL };
1792
1808
 
1793
1809
  export function nativeConnectionCapabilityRecommendations(
1794
- options: { connectedMachines?: boolean } = {},
1810
+ options: { connectedMachines?: boolean; browserExtension?: BrowserExtension } = {},
1795
1811
  ): CapabilityCatalogItem[] {
1812
+ const extensionUrl = options.browserExtension?.installUrl ?? OPENGENI_BROWSER_EXTENSION_URL;
1796
1813
  const items = [
1797
1814
  CapabilityCatalogItem.parse({
1798
1815
  id: "api:github-app",
@@ -1863,7 +1880,7 @@ export function nativeConnectionCapabilityRecommendations(
1863
1880
  tools: [{ kind: "mcp", id: "opengeni" }],
1864
1881
  runtime: {
1865
1882
  available: true,
1866
- notes: `The person sets up their machine from the chat card. The Chrome browser extension (${OPENGENI_BROWSER_EXTENSION_URL}) works only after the machine is connected.`,
1883
+ notes: `The person sets up their machine from the chat card. The Chrome browser extension (${extensionUrl}) works only after the machine is connected.`,
1867
1884
  },
1868
1885
  lifecycle: {
1869
1886
  status: "available",
@@ -1880,7 +1897,7 @@ export function nativeConnectionCapabilityRecommendations(
1880
1897
  "connected_machine_enroll_token",
1881
1898
  "connected_machine_enable_screen_control",
1882
1899
  ],
1883
- browserExtensionUrl: OPENGENI_BROWSER_EXTENSION_URL,
1900
+ browserExtensionUrl: extensionUrl,
1884
1901
  recommendationOnly: true,
1885
1902
  },
1886
1903
  }),
@@ -1889,6 +1906,41 @@ export function nativeConnectionCapabilityRecommendations(
1889
1906
  return items;
1890
1907
  }
1891
1908
 
1909
+ /**
1910
+ * The `tool.auth_needed` payload of the setup card that fixes a person-fixable
1911
+ * tool refusal (see USER_SETUP_BLOCKERS). Every tool and route that hits such a
1912
+ * refusal posts this same card in the calling turn, so the person sees the fix
1913
+ * on the first attempt. Null when the blocker's capability is not a native
1914
+ * card this deployment can show.
1915
+ */
1916
+ export function userSetupCardPayload(
1917
+ blocker: UserSetupBlocker,
1918
+ options: { toolName: string; requestedSandboxId?: string | null },
1919
+ ): ToolAuthNeededPayload | null {
1920
+ const item = nativeConnectionCapabilityRecommendations({ connectedMachines: true }).find(
1921
+ (candidate) => candidate.id === blocker.capabilityId,
1922
+ );
1923
+ if (!item) return null;
1924
+ return ToolAuthNeededPayload.parse({
1925
+ serverId: "opengeni",
1926
+ toolName: options.toolName,
1927
+ // Built-in capabilities are Opengeni's own; a blank domain must not fail the card.
1928
+ providerDomain: item.providerDomain?.trim() || "opengeni.local",
1929
+ reason: "missing_connection",
1930
+ capability: {
1931
+ id: item.id,
1932
+ name: item.name,
1933
+ kind: item.kind,
1934
+ source: item.source,
1935
+ action: "connect",
1936
+ rationale: blocker.rationale,
1937
+ requiredVariables: [],
1938
+ },
1939
+ ...(options.requestedSandboxId ? { requestedSandboxId: options.requestedSandboxId } : {}),
1940
+ ...(blocker.purpose ? { purpose: blocker.purpose } : {}),
1941
+ });
1942
+ }
1943
+
1892
1944
  function socialConnectionCounts(
1893
1945
  connections: SocialConnection[],
1894
1946
  provider: "x" | "reddit",