@opengeni/core 4.3.3-canary.39786771332001 → 4.4.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.
- package/dist/domain/capabilities.d.ts +12 -1
- package/dist/index.js +27 -1
- package/dist/index.js.map +1 -1
- package/package.json +13 -13
- package/src/domain/capabilities.ts +37 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opengeni/core",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.4.1",
|
|
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.
|
|
55
|
-
"@opengeni/codex": "4.
|
|
56
|
-
"@opengeni/config": "4.
|
|
57
|
-
"@opengeni/contracts": "4.
|
|
58
|
-
"@opengeni/db": "4.
|
|
59
|
-
"@opengeni/documents": "4.
|
|
60
|
-
"@opengeni/events": "4.
|
|
61
|
-
"@opengeni/network": "4.
|
|
62
|
-
"@opengeni/observability": "4.
|
|
63
|
-
"@opengeni/runtime": "4.
|
|
64
|
-
"@opengeni/storage": "4.
|
|
65
|
-
"@opengeni/vaults": "4.
|
|
54
|
+
"@opengeni/capabilities": "4.4.1",
|
|
55
|
+
"@opengeni/codex": "4.4.1",
|
|
56
|
+
"@opengeni/config": "4.4.1",
|
|
57
|
+
"@opengeni/contracts": "4.4.1",
|
|
58
|
+
"@opengeni/db": "4.4.1",
|
|
59
|
+
"@opengeni/documents": "4.4.1",
|
|
60
|
+
"@opengeni/events": "4.4.1",
|
|
61
|
+
"@opengeni/network": "4.4.1",
|
|
62
|
+
"@opengeni/observability": "4.4.1",
|
|
63
|
+
"@opengeni/runtime": "4.4.1",
|
|
64
|
+
"@opengeni/storage": "4.4.1",
|
|
65
|
+
"@opengeni/vaults": "4.4.1",
|
|
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,
|
|
@@ -1889,6 +1891,41 @@ export function nativeConnectionCapabilityRecommendations(
|
|
|
1889
1891
|
return items;
|
|
1890
1892
|
}
|
|
1891
1893
|
|
|
1894
|
+
/**
|
|
1895
|
+
* The `tool.auth_needed` payload of the setup card that fixes a person-fixable
|
|
1896
|
+
* tool refusal (see USER_SETUP_BLOCKERS). Every tool and route that hits such a
|
|
1897
|
+
* refusal posts this same card in the calling turn, so the person sees the fix
|
|
1898
|
+
* on the first attempt. Null when the blocker's capability is not a native
|
|
1899
|
+
* card this deployment can show.
|
|
1900
|
+
*/
|
|
1901
|
+
export function userSetupCardPayload(
|
|
1902
|
+
blocker: UserSetupBlocker,
|
|
1903
|
+
options: { toolName: string; requestedSandboxId?: string | null },
|
|
1904
|
+
): ToolAuthNeededPayload | null {
|
|
1905
|
+
const item = nativeConnectionCapabilityRecommendations({ connectedMachines: true }).find(
|
|
1906
|
+
(candidate) => candidate.id === blocker.capabilityId,
|
|
1907
|
+
);
|
|
1908
|
+
if (!item) return null;
|
|
1909
|
+
return ToolAuthNeededPayload.parse({
|
|
1910
|
+
serverId: "opengeni",
|
|
1911
|
+
toolName: options.toolName,
|
|
1912
|
+
// Built-in capabilities are Opengeni's own; a blank domain must not fail the card.
|
|
1913
|
+
providerDomain: item.providerDomain?.trim() || "opengeni.local",
|
|
1914
|
+
reason: "missing_connection",
|
|
1915
|
+
capability: {
|
|
1916
|
+
id: item.id,
|
|
1917
|
+
name: item.name,
|
|
1918
|
+
kind: item.kind,
|
|
1919
|
+
source: item.source,
|
|
1920
|
+
action: "connect",
|
|
1921
|
+
rationale: blocker.rationale,
|
|
1922
|
+
requiredVariables: [],
|
|
1923
|
+
},
|
|
1924
|
+
...(options.requestedSandboxId ? { requestedSandboxId: options.requestedSandboxId } : {}),
|
|
1925
|
+
...(blocker.purpose ? { purpose: blocker.purpose } : {}),
|
|
1926
|
+
});
|
|
1927
|
+
}
|
|
1928
|
+
|
|
1892
1929
|
function socialConnectionCounts(
|
|
1893
1930
|
connections: SocialConnection[],
|
|
1894
1931
|
provider: "x" | "reddit",
|