@eng-ai/sdk 2.8.1 → 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 +4 -1
- package/README.md +13 -0
- package/package.json +1 -1
- package/src/client.js +36 -0
package/CHANGELOG.md
CHANGED
|
@@ -2,13 +2,16 @@
|
|
|
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.2 - 2026-04-09
|
|
6
6
|
|
|
7
7
|
### Added
|
|
8
8
|
|
|
9
9
|
- External Project Knowledge pages API (v2) in SDK:
|
|
10
10
|
- `listProjectKnowledgePages(projectId, { limit? })`
|
|
11
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" })`
|
|
12
15
|
|
|
13
16
|
## 2.8.0 - 2026-04-09
|
|
14
17
|
|
package/README.md
CHANGED
|
@@ -81,6 +81,17 @@ 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
|
|
@@ -147,6 +158,8 @@ Supported automation plan actions:
|
|
|
147
158
|
|
|
148
159
|
Supported project knowledge actions:
|
|
149
160
|
|
|
161
|
+
- `getProjectIntakeStatus(projectId)`
|
|
162
|
+
- `runProjectIntake(projectId, { mode? })`
|
|
150
163
|
- `getProjectKnowledgeStatus(projectId)`
|
|
151
164
|
- `listProjectKnowledgePages(projectId, { limit? })`
|
|
152
165
|
- `listProjectKnowledgeIssues(projectId, { onlyOpen?, limit? })`
|
package/package.json
CHANGED
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(
|