rapida-partner 6.1.1 → 7.0.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": "rapida-partner",
3
- "version": "6.1.1",
3
+ "version": "7.0.0",
4
4
  "main": "dist/index.js",
5
5
  "module": "index.ts",
6
6
  "files": [
@@ -62,21 +62,21 @@ export interface IAiAgentConfig {
62
62
  };
63
63
 
64
64
  businessContext: {
65
- // Not used by the code generator today (kept only for compatibility).
66
- // Contracts come from this project's modules and, optionally, from
67
- // targetBackendDefinitionFile.
68
- targetBackendProjectId?: string;
69
-
70
- // Optional path to an ALREADY COMPILED rapidaObject.json of the target
71
- // backend project (NOT the .ts source — the loader parses it as JSON),
72
- // resolved relative to the directory of this agent's own
73
- // rapidaObject.json. When provided, the code generator loads this file
74
- // and resolves contract bindings against it in addition to the current
75
- // project. When omitted, contracts are resolved only from the current
76
- // project's modules — the simplest and only end-to-end tested setup
77
- // today is embedding the same modules directly in this project (see
78
- // katia.ts), rather than pointing at an external compiled file.
79
- targetBackendDefinitionFile?: string;
65
+ // Backend in ANOTHER Rapida project (e.g. a separate ERP). Without it the
66
+ // agent talks to this project's own backend (backend[] and modules).
67
+ // With it, the agent calls only the target backend:
68
+ // - definitionFile: ALREADY COMPILED rapidaObject.json of the target
69
+ // project (not the .ts source), relative to the directory of this
70
+ // agent's rapidaObject.json. Contracts, fixed-tool endpoints and the
71
+ // history endpoint are resolved against it only.
72
+ // - baseUrl: the target backend URL (with or without /api/v1), written to
73
+ // BOT_API_BASE_URL.
74
+ // The bot user (botCredentials) must exist on the target backend: this
75
+ // project's own backend does not create it when targetBackend is set.
76
+ targetBackend?: {
77
+ definitionFile: string;
78
+ baseUrl: string;
79
+ };
80
80
 
81
81
  // exposedContracts only covers *additional* domain actions. The agent
82
82
  // ships fixed tools according to `capabilities` (identity → /people,
@@ -95,7 +95,7 @@ export interface IAiAgentConfig {
95
95
  //
96
96
  // Besides the fixed tools, the agent itself stores and reads the
97
97
  // conversation history at /whatsapp-chat-histories: some module of the
98
- // project (or of targetBackendDefinitionFile) must expose that endpoint —
98
+ // project (or of targetBackend) must expose that endpoint —
99
99
  // usually whatsappModule from rapida-projects. Code generation fails
100
100
  // without it.
101
101
  //
@@ -55,12 +55,15 @@
55
55
  "businessContext": {
56
56
  "type": "object",
57
57
  "properties": {
58
- "targetBackendProjectId": {
59
- "type": "string"
60
- },
61
- "targetBackendDefinitionFile": {
62
- "type": "string",
63
- "description": "Path to an ALREADY COMPILED rapidaObject.json of the target backend (not the .ts source), resolved relative to the directory of this agent's own rapidaObject.json."
58
+ "targetBackend": {
59
+ "type": "object",
60
+ "description": "Backend in another Rapida project: compiled rapidaObject.json (relative to this agent's rapidaObject.json) and its URL.",
61
+ "properties": {
62
+ "definitionFile": { "type": "string", "minLength": 1 },
63
+ "baseUrl": { "type": "string", "minLength": 1 }
64
+ },
65
+ "required": ["definitionFile", "baseUrl"],
66
+ "additionalProperties": false
64
67
  },
65
68
  "exposedContracts": {
66
69
  "type": "array",