@eng-ai/sdk 2.8.2 → 2.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/CHANGELOG.md CHANGED
@@ -2,6 +2,33 @@
2
2
 
3
3
  All notable changes to `@eng-ai/sdk` will be documented in this file.
4
4
 
5
+ ## 2.8.4 - 2026-04-09
6
+
7
+ ### Added
8
+
9
+ - Project Knowledge pages now support graph payload in SDK:
10
+ - `listProjectKnowledgePages(projectId, { limit?, includeGraph? })`
11
+ - When `includeGraph=true`, API may return envelope with:
12
+ - `pages`
13
+ - `graph`
14
+ - `graph_meta`
15
+
16
+ ### Changed
17
+
18
+ - README updated with graph-enabled knowledge pages example.
19
+
20
+ ## 2.8.3 - 2026-04-09
21
+
22
+ ### Added
23
+
24
+ - External Project Context Suggestion confirmation API (v2) in SDK:
25
+ - `confirmProjectContextSuggestion(projectId, suggestionId, { summary, proposedPatch, expiresAt, checksum })`
26
+ - Enables external API/SDK consumers to confirm `context_update_suggestion` from project chat and apply canonical context updates safely.
27
+
28
+ ### Changed
29
+
30
+ - README updated with end-to-end project chat suggestion confirmation example.
31
+
5
32
  ## 2.8.2 - 2026-04-09
6
33
 
7
34
  ### Added
package/README.md CHANGED
@@ -97,7 +97,8 @@ Project knowledge (status, lint issues, manual rebuild):
97
97
  ```js
98
98
  const knowledgeStatus = await client.getProjectKnowledgeStatus(project.id);
99
99
  const knowledgePages = await client.listProjectKnowledgePages(project.id, {
100
- limit: 20
100
+ limit: 20,
101
+ includeGraph: true,
101
102
  });
102
103
  const knowledgeIssues = await client.listProjectKnowledgeIssues(project.id, {
103
104
  onlyOpen: true,
@@ -107,7 +108,32 @@ await client.rebuildProjectKnowledge(project.id, {
107
108
  idempotencyKey: `knowledge-rebuild-${project.id}`
108
109
  });
109
110
 
110
- console.log(knowledgeStatus.status, knowledgePages.length, knowledgeIssues.length);
111
+ const pagesCount = Array.isArray(knowledgePages)
112
+ ? knowledgePages.length
113
+ : (knowledgePages?.pages || []).length;
114
+ const graphNodes = Array.isArray(knowledgePages)
115
+ ? 0
116
+ : (knowledgePages?.graph?.nodes || []).length;
117
+ console.log(knowledgeStatus.status, pagesCount, knowledgeIssues.length, graphNodes);
118
+ ```
119
+
120
+ Project chat suggestion confirmation (when response includes `context_update_suggestion`):
121
+
122
+ ```js
123
+ const response = await client.invokeAgent({
124
+ message: "A ART e licenças foram entregues, estamos em dia agora.",
125
+ projectId: project.id,
126
+ });
127
+
128
+ const suggestion = response?.context_update_suggestion;
129
+ if (suggestion) {
130
+ await client.confirmProjectContextSuggestion(project.id, suggestion.suggestion_id, {
131
+ summary: suggestion.summary,
132
+ proposedPatch: suggestion.proposed_patch,
133
+ expiresAt: suggestion.expires_at,
134
+ checksum: suggestion.checksum,
135
+ });
136
+ }
111
137
  ```
112
138
 
113
139
  Project documents (tags, filters, upload, update):
@@ -161,9 +187,10 @@ Supported project knowledge actions:
161
187
  - `getProjectIntakeStatus(projectId)`
162
188
  - `runProjectIntake(projectId, { mode? })`
163
189
  - `getProjectKnowledgeStatus(projectId)`
164
- - `listProjectKnowledgePages(projectId, { limit? })`
190
+ - `listProjectKnowledgePages(projectId, { limit?, includeGraph? })`
165
191
  - `listProjectKnowledgeIssues(projectId, { onlyOpen?, limit? })`
166
192
  - `rebuildProjectKnowledge(projectId, { idempotencyKey? })`
193
+ - `confirmProjectContextSuggestion(projectId, suggestionId, { summary, proposedPatch, expiresAt, checksum })`
167
194
 
168
195
  External user settings (API key owner scope):
169
196
 
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.4",
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(
@@ -748,6 +781,10 @@ export class EngAIClient {
748
781
  if (options.limit !== undefined && options.limit !== null) {
749
782
  query.set("limit", String(options.limit));
750
783
  }
784
+ if (options.includeGraph !== undefined || options.include_graph !== undefined) {
785
+ const includeGraph = options.includeGraph ?? options.include_graph;
786
+ query.set("include_graph", String(!!includeGraph));
787
+ }
751
788
  const suffix = query.toString() ? `?${query.toString()}` : "";
752
789
  return await this._request(
753
790
  `/projects/${encodeURIComponent(normalizedProjectId)}/knowledge/pages${suffix}`,