sap-ai-dev-toolkit 0.8.3 → 0.8.4

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/README.md CHANGED
@@ -278,7 +278,7 @@ The installer handles VSP provisioning automatically:
278
278
 
279
279
  Setup detects where it is running. With `H2O_URL` set, it treats the environment as SAP Business Application Studio and opens a checkbox picker for BAS destinations, with no destinations selected by default. Use **Space** to choose destinations and **Enter** to confirm. Press **a** to toggle all destinations (select all if any are unchecked; otherwise clear the selection). Confirming with none selected removes this add-on's managed MCP entries. When the `cf` CLI 8.18 or newer is authenticated to a targeted space, setup first offers an optional import from that space's Destination service; type **y** then **Enter** to include it, or press **Enter** to skip. Accepted CF and BAS destinations appear together in the picker.
280
280
 
281
- Without `H2O_URL`, interactive setup looks for local SAP GUI system configuration on macOS and Windows (for example SAP GUI landscape XML and `saplogon.ini`). SAP GUI landscape files describe SAP GUI/DIAG connectivity, not the ADT HTTP(S) endpoint or a complete ABAP client catalog, so setup asks for the SAP client or comma-separated clients to configure for each selected system (for example `100,200`), proposes an ADT URL from the SAP GUI host and instance when it can, and asks you to confirm or edit that value. Multiple entered clients create separate isolated MCP entries, one per system/client pair. When the ADT URL uses an IP address, setup automatically inspects the SAP HTTPS certificate, extracts DNS subjectAltName entries, and offers to enable secure TLS self-healing with a simple yes/no confirmation; you do not need to type certificate names. The generated MCP entry uses VS Code input prompts for the SAP user and password at server start; raw SAP credentials are not stored in `mcp.json`. On Windows, setup can instead write an experimental `SAP_AUTH_MODE=windows-sso` entry without username/password prompts; this requires the ADT endpoint to support HTTP Negotiate/SPNEGO. Runtime uses the bundled Windows Negotiate helper by default, or a trusted custom helper configured with `SAP_AI_DEV_TOOLKIT_NEGOTIATE_HELPER`. npm may run its install hook without an interactive terminal, even when the shell is interactive; in that case, destination selection is skipped without changing MCP config, and you should run `sap-ai-dev --setup` afterwards.
281
+ Without `H2O_URL`, interactive setup looks for local SAP GUI system configuration on macOS and Windows (for example SAP GUI landscape XML and `saplogon.ini`). SAP GUI landscape files describe SAP GUI/DIAG connectivity, not the ADT HTTP(S) endpoint or a complete ABAP client catalog, so setup asks for the SAP client or comma-separated clients to configure for each selected system (for example `100,200`), proposes an ADT URL from the SAP GUI host and instance when it can, and asks you to confirm or edit that value. Multiple entered clients create separate isolated MCP entries, one per system/client pair. Local SAP GUI MCP server keys use the SAP system ID and client (for example `t4d-100`) instead of the longer SAP GUI description, while `SAP_AI_DEV_TOOLKIT_DESTINATION` still preserves the display name. When the ADT URL uses an IP address, setup automatically inspects the SAP HTTPS certificate, extracts DNS subjectAltName entries, and offers to enable secure TLS self-healing with a simple yes/no confirmation; you do not need to type certificate names. The generated MCP entry uses VS Code input prompts for the SAP user and password at server start; raw SAP credentials are not stored in `mcp.json`. On Windows, setup can instead write an experimental `SAP_AUTH_MODE=windows-sso` entry without username/password prompts; this requires the ADT endpoint to support HTTP Negotiate/SPNEGO. Runtime uses the bundled Windows Negotiate helper by default, or a trusted custom helper configured with `SAP_AI_DEV_TOOLKIT_NEGOTIATE_HELPER`. npm may run its install hook without an interactive terminal, even when the shell is interactive; in that case, destination selection is skipped without changing MCP config, and you should run `sap-ai-dev --setup` afterwards.
282
282
 
283
283
  ### 🖥️ Local machine SAP GUI support
284
284
 
@@ -290,7 +290,7 @@ Supported discovery and runtime behavior:
290
290
  - **Client selection:** SAP GUI entries may contain one default client but cannot reliably list every ABAP client available through ADT. Setup asks for one or more 3-digit clients per selected system; enter comma-separated values such as `100,200` to create separate MCP servers for each client.
291
291
  - **ADT endpoint derivation:** SAP GUI entries usually contain DIAG/router information, not the HTTP(S) ADT endpoint. Setup derives the common ADT port from the SAP instance when possible, for example instance `00` → `https://host:44300`, and asks for confirmation only when configuring the selected entry.
292
292
  - **Credential handling:** username/password local entries use VS Code MCP input prompts (`${input:...}`) at server start. Plain SAP credentials are not written to `mcp.json`.
293
- - **Windows SSO:** local Windows entries can use `SAP_AUTH_MODE=windows-sso` instead of username/password prompts when the ABAP ADT endpoint supports HTTP Negotiate/SPNEGO. The runtime starts a loopback ADT proxy and uses the bundled Windows SSPI helper unless `SAP_AI_DEV_TOOLKIT_NEGOTIATE_HELPER` points to a trusted custom helper. NTLM fallback is rejected.
293
+ - **Windows SSO / smart-card Windows logon:** local Windows entries can use `SAP_AUTH_MODE=windows-sso` instead of username/password prompts when the ABAP ADT endpoint supports HTTP Negotiate/SPNEGO. The runtime starts a loopback ADT proxy and uses the bundled Windows SSPI helper with the current Windows logon session, including smart-card-backed Windows logon. The toolkit does not prompt for, store, or accept manually pasted bearer/SAML tokens. Use `SAP_AI_DEV_TOOLKIT_NEGOTIATE_HELPER` only to point to a trusted custom SSPI/Negotiate helper. NTLM fallback is rejected.
294
294
  - **IP-address HTTPS self-healing:** if the confirmed ADT URL is `https://<ip>:<port>` and the certificate is issued to DNS names, setup reads the certificate DNS SANs automatically and stores them as `SAP_TLS_SERVER_NAMES`. At runtime a loopback proxy dials the IP address but verifies TLS against those discovered DNS names, trying them one by one. Certificate verification stays enabled; there is no `--insecure` mode.
295
295
  - **Private CAs:** if the SAP HTTPS certificate chains to an internal CA that is not trusted by the local Node runtime, set `SAP_TLS_CA_FILE` or `SAP_AI_DEV_TOOLKIT_TLS_CA_FILE` to a PEM CA bundle. This adds trust roots for the self-healing proxy without disabling certificate validation.
296
296
  - **Redirect and request safety:** local loopback proxies reject cross-origin forward-form requests and rewrite same-origin SAP redirects back through the loopback listener, so VSP stays on the safe route.
@@ -740,7 +740,7 @@ The MCP client discovers the schemas; callers do not need to memorize every argu
740
740
  | Add-on command options | `sap-ai-dev --help` |
741
741
  | BAS destinations and probe status | `sap-ai-dev --list-destinations --json` (BAS only) |
742
742
  | Destination availability only | `sap-ai-dev --check` |
743
- | Generated server names and destination mapping | **MCP: Open User Configuration**; look for lowercase slug entries (for example `demo-abap`) whose `SAP_AI_DEV_TOOLKIT_DESTINATION` names the BAS destination or local SAP GUI system. |
743
+ | Generated server names and destination mapping | **MCP: Open User Configuration**; look for lowercase slug entries (for BAS, for example `demo-abap`; for local SAP GUI, system/client slugs such as `t4d-100`) whose `SAP_AI_DEV_TOOLKIT_DESTINATION` names the BAS destination or local SAP GUI system. |
744
744
  | Running server | **MCP: List Servers**; select the server and choose **Start Server**. |
745
745
  | Tools and exact schemas | Expand that server in the Chat tools picker. The MCP host requests `tools/list`, whose entries include `name`, `description`, and `inputSchema`; the agent should call those tools through chat, not reproduce the protocol in a terminal. |
746
746
  | Runtime and tool-call logs | Select the MCP server in the Output view. Startup, call lifecycle, and child stderr logs are written to stderr; child MCP log notifications are forwarded to the client. Tool arguments and result contents are not logged. |
@@ -782,11 +782,11 @@ The response contains a `tools` array. A `RunQuery` entry resembles this excerpt
782
782
  | `SAP_AI_DEV_TOOLKIT_DESTINATION` | Comma-separated destination allowlist for normal runtime discovery. Setup clears this temporarily so it can display all eligible systems. |
783
783
  | `SAP_AI_DEV_TOOLKIT_MODE` | VSP child mode (`expert` by default; `focused` omits `ActivateMultiple`, `GetUserTransports`, and `GetTransportInfo`). The proxy exposes its curated tool subset and local workflow tools, including `LintABAP`. |
784
784
  | `SAP_ALLOW_TRANSPORTABLE_EDITS` | Generated MCP entries set this to `true` to permit source edits in transportable packages; VSP safety checks and SAP authorizations still apply. |
785
- | `SAP_AUTH_MODE=windows-sso` | Local SAP GUI entry mode for experimental Windows Integrated Authentication. Runtime starts a loopback ADT proxy and does not pass SAP username/password credentials to VSP. |
785
+ | `SAP_AUTH_MODE=windows-sso` | Local SAP GUI entry mode for experimental Windows Integrated Authentication over HTTP Negotiate/SPNEGO. Runtime starts a loopback ADT proxy, uses the current Windows logon session (including smart-card-backed Windows logon), and does not pass SAP username/password credentials or manual bearer/SAML tokens to VSP. |
786
786
  | `SAP_TLS_SERVER_NAMES` / `SAP_AI_DEV_TOOLKIT_TLS_SERVER_NAMES` | Comma-separated local SAP GUI TLS self-healing names, normally auto-discovered during setup from the SAP HTTPS certificate when `SAP_URL` uses an IP address. Runtime tries them one by one while keeping certificate validation enabled. |
787
787
  | `SAP_TLS_SERVER_NAME` / `SAP_AI_DEV_TOOLKIT_TLS_SERVER_NAME` | Single-name compatibility form of the local SAP GUI TLS self-healing override. Prefer the auto-discovered plural variable written by setup. |
788
788
  | `SAP_TLS_CA_FILE` / `SAP_AI_DEV_TOOLKIT_TLS_CA_FILE` | Optional PEM CA bundle for the local TLS self-healing proxy when the SAP HTTPS certificate chains to a private CA that is not in the OS/Node trust store. Certificate verification remains enabled. |
789
- | `SAP_AI_DEV_TOOLKIT_NEGOTIATE_HELPER` / `SAP_AI_DEV_TOOLKIT_SSPI_HELPER` | Optional trusted Windows helper executable used by the local Windows SSO proxy to convert an HTTP `WWW-Authenticate: Negotiate` challenge into a Kerberos/SPNEGO token. NTLM fallback is rejected because it is connection-oriented and unsafe for this proxy shape. When unset on Windows, the bundled PowerShell SSPI helper is used. A custom helper receives one JSON line on stdin (`url`, `challenge`, `mechanism`) and prints the base64 token on stdout. |
789
+ | `SAP_AI_DEV_TOOLKIT_NEGOTIATE_HELPER` / `SAP_AI_DEV_TOOLKIT_SSPI_HELPER` | Optional trusted Windows helper executable used by the local Windows SSO proxy to answer an HTTP `WWW-Authenticate: Negotiate` challenge with the current Windows SSPI/Kerberos/SPNEGO credentials. It is not a prompt for a user-entered token; the helper must obtain credentials from Windows. NTLM fallback is rejected because it is connection-oriented and unsafe for this proxy shape. When unset on Windows, the bundled PowerShell SSPI helper is used. A custom helper receives one JSON line on stdin (`url`, `challenge`, `mechanism`) and prints the base64 Negotiate response on stdout. |
790
790
  | `SAP_AI_DEV_TOOLKIT_HTTP_PROXY` | Egress proxy for BAS discovery and probe traffic. Takes precedence over `HTTP_PROXY`/`http_proxy`; unset means the default BAS proxy for `.dest` hosts, empty means direct. |
791
791
  | `SAP_AI_DEV_TOOLKIT_REQUEST_TIMEOUT_MS` | Per-request timeout for calls forwarded to a VSP child (default 600000 = 10 minutes; `0` disables). A stalled request fails with a timeout error; the child is left running. |
792
792
  | `SAP_AI_DEV_MCP_CONFIG` | Explicit MCP configuration path; highest precedence. |
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sap-ai-dev-toolkit",
3
- "version": "0.8.3",
3
+ "version": "0.8.4",
4
4
  "description": "SAP AI development toolkit for BAS, ABAP, RAP, CAP, HANA Cloud, Fiori, UI5, and MCP",
5
5
  "author": "Gurkan Yilmaz",
6
6
  "type": "module",
package/src/launcher.mjs CHANGED
@@ -195,6 +195,7 @@ async function configuredLocalSapGuiDestination(env) {
195
195
  url: route.url,
196
196
  backendUrl: env.SAP_URL,
197
197
  client: env.SAP_CLIENT || '001',
198
+ systemId: env.SAP_SYSTEM_ID || '',
198
199
  authentication: 'WindowsSSO',
199
200
  childEnv: {},
200
201
  close: () => closeRoute(route),
@@ -207,6 +208,7 @@ async function configuredLocalSapGuiDestination(env) {
207
208
  url: adtUrl,
208
209
  backendUrl: tlsRoute ? env.SAP_URL : undefined,
209
210
  client: env.SAP_CLIENT || '001',
211
+ systemId: env.SAP_SYSTEM_ID || '',
210
212
  authentication: 'Basic',
211
213
  childEnv: {
212
214
  SAP_USER: env.SAP_USER || env.SAP_USERNAME || '',
@@ -129,6 +129,15 @@ export function generatedServerName(destinationName) {
129
129
  return slugifyDestination(destinationName);
130
130
  }
131
131
 
132
+ export function generatedDestinationServerName(destination) {
133
+ if (destination?.source === 'sap-gui-local') {
134
+ const systemId = String(destination.systemId || '').trim();
135
+ const client = String(destination.client || '001').trim() || '001';
136
+ if (systemId) return generatedServerName(`${systemId}-${client}`);
137
+ }
138
+ return generatedServerName(destination?.source === 'cloud-foundry' ? destination.serverName : destination?.name);
139
+ }
140
+
132
141
  export function buildSapDevelopmentMcpEntries(serverIds = SAP_DEVELOPMENT_MCP_SERVERS.map(server => server.id), { packageVersions = {}, packageManager = 'npx' } = {}) {
133
142
  const selected = new Set(serverIds);
134
143
  const entries = Object.create(null);
@@ -159,7 +168,7 @@ export function buildMcpEntries(destinations, env = process.env) {
159
168
  for (const destination of selected) {
160
169
  const isCf = destination.source === 'cloud-foundry';
161
170
  const isLocalSapGui = destination.source === 'sap-gui-local';
162
- const name = generatedServerName(isCf ? destination.serverName : destination.name);
171
+ const name = generatedDestinationServerName(destination);
163
172
  if (Object.hasOwn(entries, name)) throw new Error(`Duplicate MCP destination server name: ${name} (two destination names normalize to the same lowercase server name)`);
164
173
  const entryEnv = {
165
174
  ...(h2oUrl ? { H2O_URL: String(h2oUrl) } : {}),
@@ -402,9 +411,9 @@ export async function repairManagedMcpConfig(discoveredDestinations, { env = pro
402
411
  for (const [serverName, entry] of Object.entries(config.servers)) {
403
412
  if (!isManagedBasDestinationEntry(entry)) continue;
404
413
  const destinationName = destinationValue(entry.env);
405
- const expectedName = generatedServerName(destinationName);
406
414
  const destination = basDestinations.get(destinationName);
407
415
  if (!destination) continue;
416
+ const expectedName = generatedDestinationServerName(destination);
408
417
  if (expectedName !== serverName) {
409
418
  // Legacy mixed-case entries migrate to the normalized lowercase key.
410
419
  // A user-owned entry on the target key blocks the rename; merging is
package/src/setup.mjs CHANGED
@@ -2,7 +2,7 @@ import { createInterface } from 'node:readline/promises';
2
2
  import { stdin, stdout } from 'node:process';
3
3
  import { platform } from 'node:os';
4
4
  import { isIP } from 'node:net';
5
- import { checkboxPrompt, colorText, formatStatus, textPrompt } from './terminal-ui.mjs';
5
+ import { checkboxPrompt, colorText, formatStatus, selectPrompt, textPrompt } from './terminal-ui.mjs';
6
6
  import { discoverDestinations, remediation } from './bas-discovery.mjs';
7
7
  import { defaultAdtUrl, discoverSapGuiSystems } from './local-sap-gui.mjs';
8
8
  import { discoverCloudFoundryDestinations, getCloudFoundryTarget, deleteManagedCloudFoundryServiceKeys, findOrphanedCloudFoundryServiceKeys } from './cf-destination.mjs';
@@ -56,17 +56,14 @@ function windowsSsoSetupAvailable(env = process.env) {
56
56
 
57
57
  async function chooseLocalAuthMode(destination, { input = stdin, output = stdout, env = process.env } = {}) {
58
58
  if (!windowsSsoSetupAvailable(env)) return 'basic';
59
- const answer = await textPrompt({
60
- message: `Authentication for ${destination.name} (password/sso)`,
61
- placeholder: 'password',
62
- required: false,
63
- validate: value => {
64
- const candidate = String(value || 'password').trim().toLowerCase();
65
- return ['password', 'basic', 'sso', 'windows-sso'].includes(candidate) || 'Enter password or sso.';
66
- }
59
+ return await selectPrompt({
60
+ message: `Authentication for ${destination.name}`,
61
+ defaultValue: 'basic',
62
+ choices: [
63
+ { name: 'password', value: 'basic', shortcut: 'p' },
64
+ { name: 'windows-sso (Kerberos/SPNEGO, including smart-card Windows logon)', value: 'windows-sso', shortcut: 's' }
65
+ ]
67
66
  }, { input, output });
68
- const normalized = String(answer || 'password').trim().toLowerCase();
69
- return ['sso', 'windows-sso'].includes(normalized) ? 'windows-sso' : 'basic';
70
67
  }
71
68
 
72
69
  async function confirmCloudFoundryImport({ input = stdin, output = stdout } = {}) {
@@ -387,7 +384,7 @@ export async function runSetup({
387
384
  print(output, '');
388
385
  print(output, formatStatus('SAP GUI landscapes do not contain ADT HTTP(S) endpoints or a complete client catalog. Confirm the SAP client(s), ADT URL, and authentication for each selected system.', 'step', output, 'Local SAP GUI'));
389
386
  print(output, ' Enter multiple clients as comma-separated 3-digit values, for example 100,200. Setup creates one isolated MCP server per system/client pair.');
390
- if (windowsSsoSetupAvailable(env)) print(output, ' Windows SSO is experimental and only applies to ADT systems configured for HTTP Integrated Authentication. Username/password remains the default.');
387
+ if (windowsSsoSetupAvailable(env)) print(output, ' Windows SSO is experimental and only applies to ADT systems configured for HTTP Integrated Authentication (Negotiate/SPNEGO). It uses the current Windows logon session, including smart-card-backed Windows logon; the toolkit cannot prompt for or accept manual bearer/SAML tokens. Username/password remains the default.');
391
388
  const selectedNameCounts = selected.reduce((counts, destination) => {
392
389
  const key = String(destination.name).toLowerCase();
393
390
  counts.set(key, (counts.get(key) || 0) + 1);
@@ -115,6 +115,102 @@ function checkboxPageSize(output, choiceCount) {
115
115
  return clamp(Math.min(choiceCount, rows - 7), 1, Math.max(1, choiceCount));
116
116
  }
117
117
 
118
+ export async function selectPrompt({ message, choices, defaultValue } = {}, { input = process.stdin, output = process.stdout } = {}) {
119
+ if (!Array.isArray(choices) || !choices.length) return undefined;
120
+ let cursor = choices.findIndex(choice => !choice.disabled && (choice.value === defaultValue || choice.checked));
121
+ if (cursor === -1) cursor = firstEnabledIndex(choices);
122
+ let top = 0;
123
+ let renderedLines = 0;
124
+ let done = false;
125
+ let previousRawMode;
126
+
127
+ const write = text => output.write(text);
128
+ const clearRendered = () => {
129
+ if (!renderedLines) return;
130
+ write(`\u001b[${renderedLines}A\u001b[J`);
131
+ renderedLines = 0;
132
+ };
133
+ const ensureVisible = pageSize => {
134
+ if (cursor < top) top = cursor;
135
+ if (cursor >= top + pageSize) top = cursor - pageSize + 1;
136
+ top = clamp(top, 0, Math.max(0, choices.length - pageSize));
137
+ };
138
+ const render = () => {
139
+ const columns = Number.isFinite(output?.columns) ? output.columns : 80;
140
+ const pageSize = checkboxPageSize(output, choices.length);
141
+ ensureVisible(pageSize);
142
+ const lines = [];
143
+ lines.push(truncateToColumns(`${message} (↑/↓: choose, Enter: confirm)`, columns));
144
+ const end = Math.min(choices.length, top + pageSize);
145
+ for (let index = top; index < end; index += 1) {
146
+ const choice = choices[index];
147
+ const pointer = index === cursor ? '❯' : ' ';
148
+ const marker = index === cursor ? colorText('●', 'green', output) : '○';
149
+ const disabled = choice.disabled ? ` — ${choice.disabled}` : '';
150
+ const label = `${pointer}${marker} ${choice.name}${disabled}`;
151
+ lines.push(truncateToColumns(label, columns));
152
+ }
153
+ if (choices.length > pageSize) {
154
+ lines.push(truncateToColumns(colorText(` Showing ${top + 1}-${end} of ${choices.length}; use ↑/↓ to scroll.`, 'cyan', output), columns));
155
+ }
156
+ clearRendered();
157
+ write(`${lines.join('\n')}\n`);
158
+ renderedLines = physicalRows(lines, columns);
159
+ };
160
+
161
+ return new Promise((resolve, reject) => {
162
+ const cleanup = () => {
163
+ input.off('keypress', onKeypress);
164
+ if (typeof input.setRawMode === 'function' && previousRawMode !== undefined) input.setRawMode(previousRawMode);
165
+ if (typeof input.pause === 'function') input.pause();
166
+ write('\u001b[?25h');
167
+ };
168
+ const finish = choice => {
169
+ if (done) return;
170
+ done = true;
171
+ clearRendered();
172
+ write(`${stripAnsi(message)} ${choice?.name || choice?.value || ''}\n`);
173
+ cleanup();
174
+ resolve(choice?.value);
175
+ };
176
+ const fail = error => {
177
+ if (done) return;
178
+ done = true;
179
+ cleanup();
180
+ reject(error);
181
+ };
182
+ const onKeypress = (chunk, key = {}) => {
183
+ if (key.ctrl && key.name === 'c') return fail(new Error('Prompt interrupted'));
184
+ if (key.name === 'up' || key.name === 'k') cursor = nextEnabledIndex(choices, cursor, -1);
185
+ else if (key.name === 'down' || key.name === 'j') cursor = nextEnabledIndex(choices, cursor, 1);
186
+ else if (key.name === 'return' || key.name === 'enter') return finish(choices[cursor]);
187
+ else if (chunk) {
188
+ const typed = String(chunk).toLowerCase();
189
+ const match = choices.findIndex(choice => !choice.disabled && (
190
+ String(choice.shortcut || '').toLowerCase() === typed ||
191
+ String(choice.value || '').toLowerCase().startsWith(typed) ||
192
+ String(choice.name || '').toLowerCase().startsWith(typed)
193
+ ));
194
+ if (match !== -1) cursor = match;
195
+ else return;
196
+ } else return;
197
+ render();
198
+ };
199
+
200
+ try {
201
+ readline.emitKeypressEvents(input);
202
+ previousRawMode = input.isRaw;
203
+ if (typeof input.setRawMode === 'function') input.setRawMode(true);
204
+ if (typeof input.resume === 'function') input.resume();
205
+ write('\u001b[?25l');
206
+ input.on('keypress', onKeypress);
207
+ render();
208
+ } catch (error) {
209
+ fail(error);
210
+ }
211
+ });
212
+ }
213
+
118
214
  export async function checkboxPrompt({ message, choices, required = false, shortcuts = { all: 'a' }, validate } = {}, { input = process.stdin, output = process.stdout } = {}) {
119
215
  if (!Array.isArray(choices) || !choices.length) return [];
120
216
  const selectable = enabledChoices(choices);
@@ -122,7 +122,7 @@ function execHelper(helper, payload, execFileImpl = nodeExecFile, env = process.
122
122
  env: { ...process.env, ...env }
123
123
  }, (error, stdout) => {
124
124
  // execFile errors can contain helper stdout/stderr, including tokens.
125
- if (error) return reject(safeError('Windows SSO helper failed; verify the helper and Windows Kerberos configuration.'));
125
+ if (error) return reject(safeError('Windows SSO helper failed; verify the ADT endpoint supports HTTP Negotiate/SPNEGO for the signed-in Windows identity (including smart-card-backed Windows logon) and that Kerberos/SPN configuration is correct. The toolkit cannot prompt for or accept manually pasted bearer/SAML tokens.'));
126
126
  const token = String(stdout || '').trim();
127
127
  if (!/^[A-Za-z0-9+/=_-]+$/.test(token)) return reject(safeError('Windows SSO helper returned an invalid Negotiate token'));
128
128
  if (tokenLooksLikeNtlm(token)) return reject(safeError('Windows SSO helper returned an NTLM token. ADT SSO requires Kerberos/SPNEGO; verify the backend SPN and Kerberos configuration, or rerun sap-ai-dev --setup and choose username/password.'));
@@ -135,7 +135,7 @@ function execHelper(helper, payload, execFileImpl = nodeExecFile, env = process.
135
135
  async function acquireNegotiateToken({ targetUrl, challenge, env, execFileImpl }) {
136
136
  const helper = helperCommand(env);
137
137
  if (!helper) {
138
- throw safeError('Windows SSO requires an SSPI/Negotiate helper. Set SAP_AI_DEV_TOOLKIT_NEGOTIATE_HELPER to a trusted helper executable, or rerun sap-ai-dev --setup and choose username/password.');
138
+ throw safeError('Windows SSO requires an SSPI/Negotiate helper that uses the current Windows logon session (including smart-card-backed logon). Set SAP_AI_DEV_TOOLKIT_NEGOTIATE_HELPER to a trusted helper executable, or rerun sap-ai-dev --setup and choose username/password. Manual token entry is not supported.');
139
139
  }
140
140
  return execHelper(helper, { url: targetUrl, challenge, mechanism: 'Negotiate' }, execFileImpl, env);
141
141
  }