JumpStart Integration Guide
How JumpStart SAP Intelligence integrates with Cosmos SDK, ADK V2, Storage/DMS, and local connector tools
Updated 2026-11-03
Verified 2026-11-03
JumpStart integrates with Cosmos through @cosmos/sdk. New generic platform behavior should go into cosmos-sdk-typescript; JumpStart should keep only application concerns: Next.js routes, Prisma models, project access policy, blueprints, connector credentials, and SAP/Oracle/BTP domain tools.
Current Integration Notes
- JumpStart passes the execution context (including the manifest hash), runtime skill and KB selections, and the canonical project ID through the SDK. It sends no compaction or history-filter controls; ADK owns them.
- Configurator runtime manifest calls use on-behalf-of headers, and dry-run diagnostics surface blocking manifest errors before execution.
- Project members, groups, and journey grants are read from and written to native Cosmos project RBAC; there are no local mirror tables.
- DMS uploads use a single async direct-to-cloud upload path through SDK upload sessions, with a 6 GB size cap enforced by Storage.
- Compass document write tools, workbench delete tools, and built-in tools run through the app-local tool boundary.
SDK Setup
JumpStart installs the TypeScript SDK from the Cosmos SDK repository. Use the current package.json pin when documenting or debugging a deployed branch; do not copy older commit pins from stale docs.
{
"@cosmos/sdk": "github:ey-org/cosmos-sdk-typescript#<current-pin>"
}
A request-scoped CosmosClient is created server-side from the current NextAuth session (or, for worker tool calls, from the bearer token the worker passes). Token refresh is owned by NextAuth, while the SDK receives the current Cosmos access token, service URLs, and the canonical project ID.
import { CosmosClient, decodeCosmosAccessToken } from "@cosmos/sdk";
import { COSMOS_ORG_ID } from "@/lib/config";
export function createCosmosClient(accessToken: string, projectId?: string) {
const decoded = decodeCosmosAccessToken(accessToken);
return new CosmosClient({
orgId: COSMOS_ORG_ID,
...(projectId ? { projectId } : {}), // canonical Cosmos project UUID
userId: decoded.user_id,
services: {
user: process.env.COSMOS_USER_SERVICE_URL,
chat: process.env.COSMOS_CHAT_SERVICE_URL,
configurator: process.env.COSMOS_CONFIGURATOR_SERVICE_URL,
tools: process.env.COSMOS_TOOLS_SERVICE_URL,
observer: process.env.COSMOS_OBSERVER_SERVICE_URL,
storage: process.env.COSMOS_STORAGE_SERVICE_URL,
adk: process.env.COSMOS_ADK_SERVICE_URL,
ragflow: process.env.COSMOS_RAGFLOW_SERVICE_URL,
},
// Optional fallback for services without a direct URL
gatewayUrl: process.env.COSMOS_GATEWAY_URL,
authManager: {
tokens: {
accessToken,
refreshToken: "",
expiresAt: new Date(decoded.exp * 1000),
},
},
});
}
Only services with a configured URL are passed in services. For session-backed clients, JumpStart replaces the SDK refresh with a re-read of the current NextAuth session tokens, so NextAuth remains the only owner of refresh-token rotation.
Authentication
JumpStart uses two auth modes:
User Authentication (NextAuth + OAuth2 PKCE)
| Concern | Implementation |
|---|---|
| Login | Cosmos User Service /oauth/authorize/ |
| Token exchange | Cosmos User Service /oauth/token/ |
| User profile | Cosmos User Service /api/v1/users/me/ |
| Refresh | SDK refreshCosmosToken() from the NextAuth JWT callback |
| Session | JWT session with proactive refresh before expiry |
Service Authentication (client_credentials)
JumpStart also authenticates as a service for server-to-server calls that don't need a user context (project API queries, delegated user onboarding, storage ACL management). This uses the SDK's acquireServiceToken() with a multi-audience token cache.
| Concern | Implementation |
|---|---|
| Token grant | SDK acquireServiceToken() via lib/cosmos-service-auth.ts |
| Client ID | COSMOS_JUMPSTART_SERVICE_CLIENT_ID (default cosmos-jumpstart-v1); secret from COSMOS_CLIENT_SECRET |
| Caching | Per scope::audience key with refresh-skew, in-process Map |
| Audiences | User Service (no audience), Storage (cosmos-storage-v3), Configurator (cosmos-configurator-v3, overridable with COSMOS_CONFIGURATOR_SERVICE_AUDIENCE) |
Configurator calls made on a user's behalf send the service token plus X-On-Behalf-Of-User-Id and X-Project-Id; the user's own token is not forwarded. See SDK Service Auth for the SDK reference and Authentication for the platform token model.
Durable Chat Jobs
The primary AI flow uses job endpoints and a worker process.
| Step | Responsibility |
|---|---|
| Create job | API route validates project access, blueprint, model, files, and selected skills |
| Resolve context | Worker loads terminal state, DMS files, project connection, skills, and KB collections |
| Register tools | Worker registers local connector, canvas, DMS, and context tools with the SDK |
| Call ADK V2 | SDK opens /api/v1/adk/converse/v2 and streams chunks/events |
| Execute callbacks | ADK tool calls are executed by SDK handlers inside JumpStart |
| Persist output | Worker stores job state, generated files, panel updates, and final answer |
| Stream to browser | chat/jobs/[id]/stream replays persisted job events over SSE; accept, reject, resume, cancel, and notify subroutes act on the job |
Jobs are queued with BullMQ on Redis and processed by the worker.
ADK V2 Pattern
const result = await cosmos.sendMessageViaADK(sessionId, userMessage, {
systemPrompt,
providerId,
modelId,
skills,
excludeTools,
additionalCollectionIds,
executionContext, // app/scope boundary, including manifestHash
observabilityMetadata,
channel: "jumpstart",
appName,
maxToolRoundtrips,
onChunk: (text) => appendJobChunk(jobId, text),
onToolCallArgsDelta: (name, path, delta) => recordToolArgs(jobId, name, path, delta),
onToolStart: (name) => markToolStarted(jobId, name),
onToolComplete: (name, output) => markToolComplete(jobId, name, output),
onCustomEvent: (type, payload) => recordCustomEvent(jobId, type, payload),
onUsage: (usage) => recordContextUsage(jobId, usage),
onError: (code, message, fatal) => markJobError(jobId, code, message, fatal),
});
When a JumpStart tool handler returns { ok: false, error } or throws, the SDK sends the error message as the tool result's error, so the model sees the actual failure reason.
Use prompt-only mode for BBP/workbench chat unless a flow explicitly needs a saved Cosmos agent. The COSMOS_AGENT_ID environment variable is for the ABAP AI Fix flow, not the general BBP generation path.
Storage And DMS
JumpStart uses Cosmos Storage for uploaded documents, previews, and generated files. Route handlers should call SDK storage helpers rather than duplicating Storage API behavior.
| Use Case | Pattern |
|---|---|
| Upload project files | Async direct-to-cloud upload through app/api/cosmos/dms/upload-session/start, upload-session/[id], and upload-session/[id]/complete, up to 6 GB |
| Create folders | POST app/api/cosmos/dms with a JSON body; it rejects other content types with 415 |
| Preview file | Resolve DMS path or item ID, request download URL/content |
| Agent-created file | Register document tools and persist through Cosmos Storage |
| Reuse in prompts | Reference DMS path or version, usually with :latest |
| Audio and video attachments | mp3, wav, m4a, mp4, avi and similar files are transcribed through ADK before the model uses them |
Connector Tools
JumpStart connector tools run locally inside the worker. They are not deployed to Cosmos MCP.
| Connector | Owned By | Typical Tools |
|---|---|---|
| SAP ADT | JumpStart | Object search, source read/write, ATC check, activation |
| Oracle DB | JumpStart | Object search, DDL/source read, compile check, dependency analysis |
| BTP Neo | JumpStart | App inventory, dependency analysis, destination/config inspection |
| Canvas/files | JumpStart + Cosmos Storage | Read/write panel content, create/edit DMS files |
| Built-in | JumpStart worker | markdown_to_excel, extract_files/read_extracted_file on every chat; cpi_compile, smartform_build, adobe_form_build, evaluate_and_correct_form when a blueprint lists them in builtinTools |
The SAP data explorer blocks sensitive tables and uses a circuit breaker for failing SAP calls.
Keep credentials inside JumpStart's encrypted connection records. Tool handlers should receive only the scoped project/connection context they need.
Project Access
Native Cosmos project RBAC is the only store for project members, groups, and app-surface (journey) grants. JumpStart reads and writes them through the User Service project APIs.
| Concept | Behavior |
|---|---|
| Principals | Users (by Cosmos user ID), groups (native group ID), and the organization |
| Matrix | Settings → Project Access lists journeys against principals with direct, inherited, and effective access |
| Restriction | A per-user or per-group journey restriction is stored as a native manual deny. A restriction that cannot take effect, because access comes from an org-admin permission, a group, or a managed source, is shown as an error |
| Members | Paginated (100 per page by default) with search |
| Journey availability | A journey is visible only when its agent is authorized for the project and the journey's own catalog entry is enabled; execution rechecks this and returns 403 otherwise. Journeys without an agent cannot be enabled |
Knowledge Map
app/api/cosmos/knowledge-map/graphs and graphs/[id] serve the Knowledge Map. JumpStart calls Configurator with its service token, the signed-in user as on-behalf-of subject, and the canonical project ID. A graph is returned only when the journey agent's manifest grants graph.read on it, the graph is ready, and the project catalog grants it. Access is checked again on every read.
Cost Limits
app/api/cosmos/my-cost-limits returns the signed-in user's effective session, weekly, and monthly limits from the SDK costLimits.getMyCostLimits(). Limit-increase requests use app/api/cosmos/limit-increase-requests; the server snapshots the current limits, so JumpStart sends only the requested values.
API Route Ownership
| Route Area | Owner | Notes |
|---|---|---|
app/api/cosmos/chat/jobs/* | JumpStart | Primary durable AI path |
app/api/cosmos/dms/* | JumpStart + SDK | DMS upload, preview, download proxies |
app/api/data/* | JumpStart | Prisma-backed projects, sessions, settings, and project-access APIs over Cosmos RBAC |
app/api/data/project-access-matrix | JumpStart + User Service | Project Access matrix reads and journey restrictions |
app/api/data/feedback/export | JumpStart | Feedback inbox Excel export |
app/api/data/project-onboarding/bulk | JumpStart | Project access template download and Excel upload |
app/api/data/jumpstart-assistant/* | JumpStart + Cosmos Assistant | Assistant chat, action confirmation, and Cosmos resource delegation |
app/api/sap/*, oracle/*, btp-neo/* | JumpStart | Domain connector endpoints |
app/api/cosmos/skills, agents, templates, models | Cosmos SDK | Thin proxies to Configurator/model catalog |
app/api/cosmos/knowledge-map/*, agent-resources | JumpStart + Configurator | Read-only agent knowledge, skills, and graphs |
app/api/cosmos/my-cost-limits, period-usage, limit-increase-requests | Cosmos SDK | Cost limits, usage, and limit-increase requests |
Test Expectations
Run unit tests for ordinary route/tool changes. Use opt-in Playwright suites only when touching the relevant live surfaces:
| Suite | Env |
|---|---|
| Access-control E2E | RUN_ACCESS_CONTROL_E2E=1 |
| Live ADK/file generation | RUN_LIVE_ADK_E2E=1 |
| Live SAP/object search | RUN_LIVE_SAP_E2E=1 |
| Slow LLM edit-file loop | RUN_LIVE_ADK_E2E=1 RUN_LIVE_LLM_EDIT_E2E=1 |