@eng-ai/sdk 2.8.2 → 2.8.3

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 CHANGED
@@ -2,6 +2,18 @@
2
2
 
3
3
  All notable changes to `@eng-ai/sdk` will be documented in this file.
4
4
 
5
+ ## 2.8.3 - 2026-04-09
6
+
7
+ ### Added
8
+
9
+ - External Project Context Suggestion confirmation API (v2) in SDK:
10
+ - `confirmProjectContextSuggestion(projectId, suggestionId, { summary, proposedPatch, expiresAt, checksum })`
11
+ - Enables external API/SDK consumers to confirm `context_update_suggestion` from project chat and apply canonical context updates safely.
12
+
13
+ ### Changed
14
+
15
+ - README updated with end-to-end project chat suggestion confirmation example.
16
+
5
17
  ## 2.8.2 - 2026-04-09
6
18
 
7
19
  ### Added
package/README.md CHANGED
@@ -110,6 +110,25 @@ await client.rebuildProjectKnowledge(project.id, {
110
110
  console.log(knowledgeStatus.status, knowledgePages.length, knowledgeIssues.length);
111
111
  ```
112
112
 
113
+ Project chat suggestion confirmation (when response includes `context_update_suggestion`):
114
+
115
+ ```js
116
+ const response = await client.invokeAgent({
117
+ message: "A ART e licenças foram entregues, estamos em dia agora.",
118
+ projectId: project.id,
119
+ });
120
+
121
+ const suggestion = response?.context_update_suggestion;
122
+ if (suggestion) {
123
+ await client.confirmProjectContextSuggestion(project.id, suggestion.suggestion_id, {
124
+ summary: suggestion.summary,
125
+ proposedPatch: suggestion.proposed_patch,
126
+ expiresAt: suggestion.expires_at,
127
+ checksum: suggestion.checksum,
128
+ });
129
+ }
130
+ ```
131
+
113
132
  Project documents (tags, filters, upload, update):
114
133
 
115
134
  ```js
@@ -164,6 +183,7 @@ Supported project knowledge actions:
164
183
  - `listProjectKnowledgePages(projectId, { limit? })`
165
184
  - `listProjectKnowledgeIssues(projectId, { onlyOpen?, limit? })`
166
185
  - `rebuildProjectKnowledge(projectId, { idempotencyKey? })`
186
+ - `confirmProjectContextSuggestion(projectId, suggestionId, { summary, proposedPatch, expiresAt, checksum })`
167
187
 
168
188
  External user settings (API key owner scope):
169
189
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eng-ai/sdk",
3
- "version": "2.8.2",
3
+ "version": "2.8.3",
4
4
  "description": "Official JavaScript SDK for ENG-AI External API v2",
5
5
  "type": "module",
6
6
  "main": "./src/client.js",
package/src/client.js CHANGED
@@ -679,6 +679,39 @@ export class EngAIClient {
679
679
  });
680
680
  }
681
681
 
682
+ async confirmProjectContextSuggestion(projectId, suggestionId, payload = {}) {
683
+ const normalizedProjectId = this._requireNonEmptyString(projectId, "projectId");
684
+ const normalizedSuggestionId = this._requireNonEmptyString(suggestionId, "suggestionId");
685
+ const summary = this._requireNonEmptyString(payload.summary, "summary");
686
+ const expiresAt = this._requireNonEmptyString(
687
+ payload.expiresAt ?? payload.expires_at,
688
+ "expiresAt"
689
+ );
690
+ const checksum = this._requireNonEmptyString(payload.checksum, "checksum");
691
+ const proposedPatch = payload.proposedPatch ?? payload.proposed_patch;
692
+
693
+ if (!isPlainObject(proposedPatch)) {
694
+ throw new EngAIError("proposedPatch must be an object", {
695
+ status: 400,
696
+ code: "validation_error",
697
+ detail: "proposedPatch/proposed_patch must be a JSON object",
698
+ });
699
+ }
700
+
701
+ return await this._request(
702
+ `/projects/${encodeURIComponent(normalizedProjectId)}/context/suggestions/${encodeURIComponent(normalizedSuggestionId)}/confirm`,
703
+ {
704
+ method: "POST",
705
+ body: {
706
+ summary,
707
+ proposed_patch: proposedPatch,
708
+ expires_at: expiresAt,
709
+ checksum,
710
+ },
711
+ }
712
+ );
713
+ }
714
+
682
715
  async getProjectIntakeStatus(projectId) {
683
716
  const normalizedProjectId = this._requireNonEmptyString(projectId, "projectId");
684
717
  return await this._request(