@eng-ai/sdk 2.8.6 → 2.8.8
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/CHANGELOG.md +18 -1
- package/README.md +31 -0
- package/package.json +2 -1
- package/src/client.js +20 -0
package/CHANGELOG.md
CHANGED
|
@@ -2,7 +2,24 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to `@eng-ai/sdk` will be documented in this file.
|
|
4
4
|
|
|
5
|
-
## 2.8.
|
|
5
|
+
## 2.8.8 - 2026-06-25
|
|
6
|
+
|
|
7
|
+
### Added
|
|
8
|
+
|
|
9
|
+
- Desktop Cloud contract v1 support for private local-context invocations:
|
|
10
|
+
- `desktop_contract_version`
|
|
11
|
+
- `client_context`
|
|
12
|
+
- `privacy`
|
|
13
|
+
- `chat_history`
|
|
14
|
+
- `project_id`
|
|
15
|
+
- `getCapabilities()` for authenticated Desktop capability checks.
|
|
16
|
+
- `validateCredentials()` using authenticated non-mutating External API v2 settings lookup.
|
|
17
|
+
|
|
18
|
+
### Security
|
|
19
|
+
|
|
20
|
+
- Desktop `privacy.mode="no_persistence"` payloads can be forwarded without dropping required privacy/context fields.
|
|
21
|
+
|
|
22
|
+
## 2.8.7 - 2026-04-22
|
|
6
23
|
|
|
7
24
|
### Added
|
|
8
25
|
|
package/README.md
CHANGED
|
@@ -95,6 +95,37 @@ console.log(sessions.map((item) => item.id));
|
|
|
95
95
|
console.log(session.messages.length);
|
|
96
96
|
```
|
|
97
97
|
|
|
98
|
+
Desktop private local-context invocation:
|
|
99
|
+
|
|
100
|
+
```js
|
|
101
|
+
const capabilities = await client.getCapabilities();
|
|
102
|
+
if (!capabilities.no_persistence || capabilities.desktop_contract_version < 1) {
|
|
103
|
+
throw new Error("ENG-AI Cloud does not support the Desktop privacy contract");
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
const response = await client.invokeAgent("contract_manager", {
|
|
107
|
+
message: "Analise os trechos locais e crie a tarefa de revisão",
|
|
108
|
+
desktopContractVersion: 1,
|
|
109
|
+
projectId: "project-id",
|
|
110
|
+
clientContext: {
|
|
111
|
+
digest: "sha256-local-context",
|
|
112
|
+
chunks: [
|
|
113
|
+
{
|
|
114
|
+
document_id: "local-doc-id",
|
|
115
|
+
chunk_index: 0,
|
|
116
|
+
text: "Trecho bounded do índice local",
|
|
117
|
+
score: 0.91
|
|
118
|
+
}
|
|
119
|
+
]
|
|
120
|
+
},
|
|
121
|
+
chatHistory: [{ role: "user", content: "Histórico local bounded" }],
|
|
122
|
+
privacy: { mode: "no_persistence", allow_project_mutations: true },
|
|
123
|
+
idempotencyKey: "desktop-project-mutation-uuid"
|
|
124
|
+
});
|
|
125
|
+
|
|
126
|
+
console.log(response.privacy.persisted); // false
|
|
127
|
+
```
|
|
128
|
+
|
|
98
129
|
Task autonomy mode by project:
|
|
99
130
|
|
|
100
131
|
```js
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eng-ai/sdk",
|
|
3
|
-
"version": "2.8.
|
|
3
|
+
"version": "2.8.8",
|
|
4
4
|
"description": "Official JavaScript SDK for ENG-AI External API v2",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./src/client.js",
|
|
@@ -18,6 +18,7 @@
|
|
|
18
18
|
"LICENSE"
|
|
19
19
|
],
|
|
20
20
|
"scripts": {
|
|
21
|
+
"check:contract": "node ./test-contract.mjs",
|
|
21
22
|
"check:pack": "NPM_CONFIG_CACHE=${NPM_CONFIG_CACHE:-/tmp/engai-npm-cache} npm pack --dry-run"
|
|
22
23
|
},
|
|
23
24
|
"keywords": [
|
package/src/client.js
CHANGED
|
@@ -400,9 +400,17 @@ export class EngAIClient {
|
|
|
400
400
|
? { message: payload }
|
|
401
401
|
: {
|
|
402
402
|
message: payload?.message,
|
|
403
|
+
desktop_contract_version:
|
|
404
|
+
payload?.desktopContractVersion ?? payload?.desktop_contract_version,
|
|
403
405
|
project_id: payload?.projectId ?? payload?.project_id,
|
|
404
406
|
session_id: payload?.sessionId ?? payload?.session_id,
|
|
405
407
|
context_digest: payload?.contextDigest ?? payload?.context_digest,
|
|
408
|
+
chat_history: payload?.chatHistory ?? payload?.chat_history,
|
|
409
|
+
client_context: payload?.clientContext ?? payload?.client_context,
|
|
410
|
+
privacy: payload?.privacy,
|
|
411
|
+
attachments: payload?.attachments,
|
|
412
|
+
provider: payload?.provider,
|
|
413
|
+
model: payload?.model,
|
|
406
414
|
normative_mode:
|
|
407
415
|
(payload?.normativeMode ?? payload?.normative_mode) ||
|
|
408
416
|
(payload?.normId ?? payload?.norm_id)
|
|
@@ -437,6 +445,18 @@ export class EngAIClient {
|
|
|
437
445
|
});
|
|
438
446
|
}
|
|
439
447
|
|
|
448
|
+
async getCapabilities() {
|
|
449
|
+
return await this._request("/sdk/capabilities", {
|
|
450
|
+
method: "GET",
|
|
451
|
+
});
|
|
452
|
+
}
|
|
453
|
+
|
|
454
|
+
async validateCredentials() {
|
|
455
|
+
return await this._request("/settings/llm", {
|
|
456
|
+
method: "GET",
|
|
457
|
+
});
|
|
458
|
+
}
|
|
459
|
+
|
|
440
460
|
async listSdkSessions(options = {}) {
|
|
441
461
|
const query = new URLSearchParams();
|
|
442
462
|
if (options.limit !== undefined) query.set("limit", String(options.limit));
|