You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit a852514
Browse filesBrowse the repository at this point in the historyBrowse files
You are a helpful editor for a technical writer. Your task is to review and improve the text while ensuring that it adheres to a structured set of writing rules. All categories are of equal priority—no rule should be prioritized over another.
@@ -72,7 +69,7 @@ Focus on content-level accessibility based on WCAG guidelines. Prioritize Level
72
69
- Make sure that sentences are complete and that images, code blocks, and so on are not in between overflowing sentences.
73
70
74
71
7. Consistency
75
-
Use the `search` tool to check consistency across the repo. Report findings but do not auto-fix — flag locations for the author to review.
72
+
Check consistency across the repo. Report findings but do not auto-fix — flag locations for the author to review. Identify questionable changes, and search the repository or cap.cloud.sap for related terms and references.
76
73
77
74
-**Terminology**: Identify terms, product names, or UI labels introduced or changed in the diff. Search the repo for prior uses of the old term and flag files where the wording may be inconsistent or outdated.
78
75
-**Renamed identifiers**: When a variable, class, method, config key, or file is renamed in the diff, search the repo for references to the old name and list any files that likely need updating.
Copy file name to clipboardExpand all lines: cds/cdl.md
+56-5Lines changed: 56 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2040,7 +2040,9 @@ service AdminService {
2040
2040
### Auto-Exposed Entities
2041
2041
{#auto-expose}
2042
2042
2043
-
Annotate entities with `@cds.autoexpose` to automatically expose them in services containing entities with associations referring to them.
2043
+
Annotate entities with `@cds.autoexpose` to auto-expose them in services that contain entities with associations referring to them. Composition targets are auto-exposed without an annotation.
2044
+
2045
+
#### Using @cds.autoexpose
2044
2046
2045
2047
For example, given the following entity definitions:
2046
2048
@@ -2066,16 +2068,16 @@ service Zoo {
2066
2068
}
2067
2069
```
2068
2070
2069
-
... would result in the service being automatically extended like this:
2071
+
... results in the service being automatically extended like this:
2070
2072
2071
2073
```cds
2072
2074
extend service Zoo with { // auto-exposed entities:
2073
-
@readonly entity Foo_bar as projection on Bar;
2074
-
@readonly entity Foo_car as projection on Car;
2075
+
entity Bar as projection on my.Bar;
2076
+
entity Car as projection on my.Car;
2075
2077
}
2076
2078
```
2077
2079
2078
-
You can still expose such entities explicitly, for example, to make them read-write:
2080
+
You can still expose such entities directly, for example, to make them read-write:
2079
2081
2080
2082
```cds
2081
2083
service MyOrders {
@@ -2084,9 +2086,58 @@ service MyOrders {
2084
2086
}
2085
2087
```
2086
2088
2089
+
#### Using Compositions
2090
+
2091
+
Besides entities annotated with `@cds.autoexpose`, composition targets are auto-exposed.
2092
+
2093
+
Example:
2094
+
```cds
2095
+
// schema.cds
2096
+
namespace travels;
2097
+
entity Travels {
2098
+
key id : Integer;
2099
+
bookings : Composition of many Bookings on Bookings.Travel = $self;
2100
+
}
2101
+
entity Bookings {
2102
+
key Travel : Association to Travels;
2103
+
key Pos : Integer;
2104
+
}
2105
+
```
2106
+
2107
+
When `Travels` is exposed in a service ...
2108
+
2109
+
```cds
2110
+
using { travels } from './schema.cds';
2111
+
service TravelService {
2112
+
entity Travels as projection on travels.Travels
2113
+
}
2114
+
```
2115
+
2116
+
... the composition target `Bookings` is auto-exposed as follows:
2117
+
2118
+
```cds
2119
+
extend service TravelService with { // auto-exposed entity:
2120
+
entity Bookings as projection on travels.Bookings;
2121
+
}
2122
+
```
2123
+
2087
2124
[Learn more about **CodeLists in `@sap/cds/common`**.](./common#code-lists){.learn-more}
2088
2125
2089
2126
2127
+
#### Switch Off Auto-Exposure
2128
+
2129
+
To switch off auto-exposure of entities annotated with `@cds.autoexpose` in a service, annotate the service with `@cds.autoexpose: false`:
2130
+
```cds
2131
+
@cds.autoexpose: false
2132
+
service Zoo {
2133
+
// ...
2134
+
// Bar and Car are not auto-exposed in this service
2135
+
}
2136
+
```
2137
+
2138
+
>[!important] Not valid for compositions
2139
+
> The `@cds.autoexpose: false` annotation does not affect auto-exposure of composition targets.
Copy file name to clipboardExpand all lines: get-started/bookshop.md
+22-25Lines changed: 22 additions & 25 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -733,7 +733,8 @@ annotate AdminService.Books with {
733
733
734
734
### Custom Handlers in Node.js
735
735
736
-
Prepare your project for custom coding in Node.js by adding the respective facet:
736
+
Custom handlers are required for implementing business logic that cannot be expressed declarativatively, for example, through constraints. Prepare your project for custom coding in Node.js by adding the respective facet:
737
+
737
738
```shell
738
739
cds add nodejs
739
740
npm install
@@ -743,33 +744,22 @@ Put implementations for services into equally named _.js_ files placed next to a
743
744
744
745
```zsh
745
746
├─ srv/
746
-
│ ├─ cat-service.cds # [!code focus]
747
-
│ └─ cat-service.js # [!code focus]
747
+
│ ├─ admin-service.cds # [!code focus]
748
+
│ └─ admin-service.js # [!code focus]
748
749
└─ ...
749
750
```
750
751
751
752
::: code-group
752
-
```js [srv/cat-service.js]
753
-
const cds = require('@sap/cds')
754
-
class CatalogService extends cds.ApplicationService { init() {
755
-
756
-
// After READ handler on Books to add discount info
When the agent decides to call the action, the task pauses and transitions to the A2A [`input-required`](https://a2a-protocol.org/latest/specification/#413-taskstate) state instead of running the action immediately.
71
71
72
72
> [!warning] Only supported by CAP Node.js
73
-
> `@agent.hitl` is not yet supported by CAP Java
73
+
> `@agent.hitl` is not yet supported by CAP Java.
74
74
75
75
76
76
@@ -248,7 +248,7 @@ DEBUG=agents cds watch
248
248
> The plugin can automatically fetch required/missing credentials from local installations of supported LLMs, allowing you to work with zero additional configuration.
249
249
250
250
> [!warning] CAP Node.js only
251
-
> Auto configuration from local Claude and OpenCode installations is not supported by CAP Java
251
+
> Auto configuration from local Claude and OpenCode installations is not supported by CAP Java.
252
252
253
253
### Using Chat Preview <Alpha/>
254
254
@@ -269,7 +269,7 @@ Also answer the questions that the agent asks you back.
269
269

270
270
271
271
> [!tip] Embedded with the CAP application
272
-
> Essentially we see that the CAP-level agent accomplishes the same functionality than the generic agent that comes with _OpenCode_. The main difference is that it is tightly integrated with the CAP application, allowing for more seamless interaction with the underlying services and data models. Also the end user doesn't need any local AI client like _OpenCode_, nor do they need access to an LLM directly.
272
+
> Essentially we see that the CAP-level agent accomplishes the same functionality as the generic agent that comes with _OpenCode_. The main difference is that it is tightly integrated with the CAP application, allowing for more seamless interaction with the underlying services and data models. Also the end user doesn't need any local AI client like _OpenCode_, nor do they need access to an LLM directly.
273
273
274
274
275
275
## Served out of the box
@@ -352,9 +352,9 @@ For details on configuring and using audit logging, refer to the documentation a
352
352
353
353
### Persistence
354
354
355
-
The CAP-based harness provides short-term memory for agents by storing conversational and checkpoints in the connected primary database.
355
+
The CAP-based agent harness provides short-term memory out-of-the-box via the connected primary database – that is in _SQLite_ in local dev, _SAP HANA_ in production.
356
356
357
-
Agents can leverage this short-term memory to maintain context across multiple interactions within a session.
357
+
This allows agents to persist conversational context and workflow checkpoints, so that they can resume sessions seamlessly even after server restarts, as well as boosting scalability in clustered environments. In addition, it provides a foundation for implementing long-term memory, monitoring and analytics on agent interactions.
358
358
359
359
360
360
@@ -406,9 +406,7 @@ The plugin can also export traces to [MLflow](https://mlflow.org/docs/latest/llm
406
406
```
407
407
:::
408
408
409
-
When enabled, an _MLflow_ exporter is added as a **second span processor** alongside any existing exporter (Dynatrace, Cloud Logging, Grafana, etc.),
410
-
and the plugin automatically adds the following `mlflow.*` span attributes to existing OTel spans so the MLflow OTLP ingestion endpoint assembles them
411
-
into proper MLflow traces — no additional SDK required.
409
+
When enabled, an _MLflow_ exporter is added as a **second span processor** alongside any existing exporter (Dynatrace, Cloud Logging, Grafana, etc.), and the plugin automatically adds the following `mlflow.*` span attributes to existing OTel spans so the MLflow OTLP ingestion endpoint assembles them into proper MLflow traces — no additional SDK required.
|`aicore`| The default for `production` and `hybrid`, connects to SAP AI Core |
556
+
|`auto`| The default for `development`, using local Claude, Codex or OpenCode configuration |
557
+
|`mock`| A pure mock for `development`, provides dummy responses when called |
560
558
561
-
See [SAP AI Core → Create a Service Instance](https://help.sap.com/docs/sap-ai-core/sap-ai-core-service-guide/create-service-instance) for how to create an instance.vite
559
+
See [SAP AI Core → Create a Service Instance](https://help.sap.com/docs/sap-ai-core/sap-ai-core-service-guide/create-service-instance) for how to create an instance.
562
560
563
561
564
562
> [!tip] Automatically Fetching Credentials
565
-
> In development profile, with the pre-configured `auto` kind, the plugin tries to fetch missing credentials from local installation of [Claude Code](https://claude.ai) or [OpenCode](https://opencode.ai).
563
+
> In development profile, with the pre-configured `auto` kind, the plugin tries to fetch missing credentials from local installation of [Claude Code](https://claude.ai), [Codex](https://openai.com/codex/) or [OpenCode](https://opencode.ai).
566
564
> This allows you to work with local LLM instances without providing any additional config at all.
567
565
568
566
@@ -581,5 +579,5 @@ See section [_Quotas_](#quotas) above for details.
581
579
## SAP API Policy
582
580
583
581
> [!caution]
584
-
> CAP-level agents as documented herein must not be used as gateways or proxies for SAP Application APIs. The _cap/agents_ plugins are not an SAP-endorsed architecture, data service, or service-specific pathway under section 2.2.2 of the [_SAP API Policy_](https://help.sap.com/docs/business-accelerator-hub/sap-business-accelerator-hub/sap-api-policy) and is not an endorsed mechanism for exposing, proxying, or providing agentic access to SAP Application APIs.
585
-
> Any use of SAP Application APIs must be in accordance with the [_SAP API Policy_](https://help.sap.com/docs/business-accelerator-hub/sap-business-accelerator-hub/sap-api-policy). For SAP-endorsed patterns on agentic access to SAP Application APIs, consult the [_SAP Architecture Center_](https://architecture.learning.sap.com/docs/ref-arch/98efa0) reference architectures.
582
+
> CAP-level agents as documented herein must not be used as gateways or proxies for SAP Application APIs. The `@cap-js/agents` plugin is not an SAP-endorsed architecture, data service, or service-specific pathway under section 2.2.2 of the [_SAP API Policy_](https://help.sap.com/docs/business-accelerator-hub/sap-business-accelerator-hub/sap-api-policy) and is not an endorsed mechanism for exposing, proxying, or providing agentic access to SAP Application APIs.
583
+
> Any use of SAP Application APIs must be in accordance with the [_SAP API Policy_](https://help.sap.com/docs/business-accelerator-hub/sap-business-accelerator-hub/sap-api-policy). For SAP-endorsed patterns on agentic access to SAP Application APIs, consult the [_SAP Architecture Center_](https://architecture.learning.sap.com/docs/ref-arch/98efa0) reference architectures.
@@ -524,4 +521,4 @@ Future versions of the adapter may add support for data changes using CREATE, UP
524
521
525
522
> [!caution]
526
523
> The CAP MCP adapter must not be used as a gateway or proxy for SAP Application APIs. The adapter is not an SAP-endorsed architecture, data service, or service-specific pathway under section 2.2.2 of the [_SAP API Policy_](https://help.sap.com/docs/business-accelerator-hub/sap-business-accelerator-hub/sap-api-policy) and is not an endorsed mechanism for exposing, proxying, or providing agentic access to SAP Application APIs.
527
-
> Any use of SAP Application APIs must be in accordance with the [_SAP API Policy_](https://help.sap.com/docs/business-accelerator-hub/sap-business-accelerator-hub/sap-api-policy). For SAP-endorsed patterns on agentic access to SAP Application APIs, consult the [_SAP Architecture Center_](https://architecture.learning.sap.com/docs/ref-arch/98efa0) reference architectures.
524
+
> Any use of SAP Application APIs must be in accordance with the [_SAP API Policy_](https://help.sap.com/docs/business-accelerator-hub/sap-business-accelerator-hub/sap-api-policy). For SAP-endorsed patterns on agentic access to SAP Application APIs, consult the [_SAP Architecture Center_](https://architecture.learning.sap.com/docs/ref-arch/98efa0) reference architectures.
0 commit comments