@eng-ai/sdk 2.8.0 → 2.8.2

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,17 @@
2
2
 
3
3
  All notable changes to `@eng-ai/sdk` will be documented in this file.
4
4
 
5
+ ## 2.8.2 - 2026-04-09
6
+
7
+ ### Added
8
+
9
+ - External Project Knowledge pages API (v2) in SDK:
10
+ - `listProjectKnowledgePages(projectId, { limit? })`
11
+ - Enables external integrations to inspect compiled knowledge pages (`wiki/index/log`) for user-facing observability.
12
+ - External Project Intake APIs (v2) in SDK:
13
+ - `getProjectIntakeStatus(projectId)`
14
+ - `runProjectIntake(projectId, { mode?: "initial_full" | "delta_refresh" })`
15
+
5
16
  ## 2.8.0 - 2026-04-09
6
17
 
7
18
  ### Added
package/README.md CHANGED
@@ -81,10 +81,24 @@ const context = await client.getProjectContext(project.id);
81
81
  console.log(context.autonomous_tasks_mode);
82
82
  ```
83
83
 
84
+ Project intake (initial_full and delta_refresh):
85
+
86
+ ```js
87
+ const intakeStatus = await client.getProjectIntakeStatus(project.id);
88
+ if (intakeStatus.intake_status === "ready") {
89
+ await client.runProjectIntake(project.id, { mode: "delta_refresh" });
90
+ } else {
91
+ await client.runProjectIntake(project.id, { mode: "initial_full" });
92
+ }
93
+ ```
94
+
84
95
  Project knowledge (status, lint issues, manual rebuild):
85
96
 
86
97
  ```js
87
98
  const knowledgeStatus = await client.getProjectKnowledgeStatus(project.id);
99
+ const knowledgePages = await client.listProjectKnowledgePages(project.id, {
100
+ limit: 20
101
+ });
88
102
  const knowledgeIssues = await client.listProjectKnowledgeIssues(project.id, {
89
103
  onlyOpen: true,
90
104
  limit: 10
@@ -93,7 +107,7 @@ await client.rebuildProjectKnowledge(project.id, {
93
107
  idempotencyKey: `knowledge-rebuild-${project.id}`
94
108
  });
95
109
 
96
- console.log(knowledgeStatus.status, knowledgeIssues.length);
110
+ console.log(knowledgeStatus.status, knowledgePages.length, knowledgeIssues.length);
97
111
  ```
98
112
 
99
113
  Project documents (tags, filters, upload, update):
@@ -144,7 +158,10 @@ Supported automation plan actions:
144
158
 
145
159
  Supported project knowledge actions:
146
160
 
161
+ - `getProjectIntakeStatus(projectId)`
162
+ - `runProjectIntake(projectId, { mode? })`
147
163
  - `getProjectKnowledgeStatus(projectId)`
164
+ - `listProjectKnowledgePages(projectId, { limit? })`
148
165
  - `listProjectKnowledgeIssues(projectId, { onlyOpen?, limit? })`
149
166
  - `rebuildProjectKnowledge(projectId, { idempotencyKey? })`
150
167
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eng-ai/sdk",
3
- "version": "2.8.0",
3
+ "version": "2.8.2",
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
@@ -7,6 +7,7 @@ const VALID_AUTONOMOUS_TASKS_MODES = new Set([
7
7
  "approval_delete_only",
8
8
  "full_autonomy",
9
9
  ]);
10
+ const VALID_PROJECT_INTAKE_MODES = new Set(["initial_full", "delta_refresh"]);
10
11
  const VALID_DOCUMENT_TAG_MODES = new Set(["any", "all"]);
11
12
 
12
13
  function isPlainObject(value) {
@@ -678,6 +679,41 @@ export class EngAIClient {
678
679
  });
679
680
  }
680
681
 
682
+ async getProjectIntakeStatus(projectId) {
683
+ const normalizedProjectId = this._requireNonEmptyString(projectId, "projectId");
684
+ return await this._request(
685
+ `/projects/${encodeURIComponent(normalizedProjectId)}/intake-status`,
686
+ {
687
+ method: "GET",
688
+ }
689
+ );
690
+ }
691
+
692
+ async runProjectIntake(projectId, options = {}) {
693
+ const normalizedProjectId = this._requireNonEmptyString(projectId, "projectId");
694
+ const payload = {};
695
+ const requestedMode = options?.mode;
696
+ if (requestedMode !== undefined && requestedMode !== null) {
697
+ const normalizedMode = String(requestedMode).trim().toLowerCase();
698
+ if (!VALID_PROJECT_INTAKE_MODES.has(normalizedMode)) {
699
+ throw new EngAIError("invalid mode for runProjectIntake", {
700
+ status: 400,
701
+ code: "validation_error",
702
+ detail: "mode must be one of: initial_full, delta_refresh",
703
+ });
704
+ }
705
+ payload.mode = normalizedMode;
706
+ }
707
+
708
+ return await this._request(
709
+ `/projects/${encodeURIComponent(normalizedProjectId)}/intake`,
710
+ {
711
+ method: "POST",
712
+ body: payload,
713
+ }
714
+ );
715
+ }
716
+
681
717
  async getProjectKnowledgeStatus(projectId) {
682
718
  const normalizedProjectId = this._requireNonEmptyString(projectId, "projectId");
683
719
  return await this._request(
@@ -706,6 +742,21 @@ export class EngAIClient {
706
742
  );
707
743
  }
708
744
 
745
+ async listProjectKnowledgePages(projectId, options = {}) {
746
+ const normalizedProjectId = this._requireNonEmptyString(projectId, "projectId");
747
+ const query = new URLSearchParams();
748
+ if (options.limit !== undefined && options.limit !== null) {
749
+ query.set("limit", String(options.limit));
750
+ }
751
+ const suffix = query.toString() ? `?${query.toString()}` : "";
752
+ return await this._request(
753
+ `/projects/${encodeURIComponent(normalizedProjectId)}/knowledge/pages${suffix}`,
754
+ {
755
+ method: "GET",
756
+ }
757
+ );
758
+ }
759
+
709
760
  async rebuildProjectKnowledge(projectId, options = {}) {
710
761
  const normalizedProjectId = this._requireNonEmptyString(projectId, "projectId");
711
762
  const headers = {};